Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index



From a2f9d5f66b400e86dfe12df6a0061b547ff8cd6c Mon Sep 17 00:00:00 2001
From: Rafael Dominguez <venccsralph@gmail.com>
Date: Wed, 1 Jun 2011 22:35:29 -0430
Subject: [PATCH 3/3] Replace List for std::vector<const SfxItemSet*>.

---
 svx/source/sdr/properties/attributeproperties.cxx |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/svx/source/sdr/properties/attributeproperties.cxx 
b/svx/source/sdr/properties/attributeproperties.cxx
index 27514e0..92d8fb9 100644
--- a/svx/source/sdr/properties/attributeproperties.cxx
+++ b/svx/source/sdr/properties/attributeproperties.cxx
@@ -425,23 +425,20 @@ namespace sdr
                         {
                             // there is no StyleSheetPool in the new model, thus set
                             // all items as hard items in the object
-                            List aList;
+                            std::vector<const SfxItemSet*> aSetList;
                             const SfxItemSet* pItemSet = &pOldStyleSheet->GetItemSet();
 
                             while(pItemSet)
                             {
-                                aList.Insert((void*)pItemSet, CONTAINER_APPEND);
+                                aSetList.push_back(pItemSet);
                                 pItemSet = pItemSet->GetParent();
                             }
 
                             SfxItemSet* pNewSet = 
&CreateObjectSpecificItemSet(pNewModel->GetItemPool());
-                            pItemSet = (SfxItemSet*)aList.Last();
 
-                            while(pItemSet)
-                            {
-                                pNewSet->Put(*pItemSet);
-                                pItemSet = (SfxItemSet*)aList.Prev();
-                            }
+                            std::vector<const SfxItemSet*>::const_reverse_iterator riter;
+                            for (riter = aSetList.rbegin(); riter != aSetList.rend(); ++riter)
+                                pNewSet->Put(*(*riter));
 
                             // Items which were hard attributes before need to stay
                             if(mpItemSet)
-- 
1.7.3.4

From 3bc1e1a175498db06c8eef81cab6b2334f452175 Mon Sep 17 00:00:00 2001
From: Rafael Dominguez <venccsralph@gmail.com>
Date: Wed, 1 Jun 2011 22:34:45 -0430
Subject: [PATCH 2/3] Replace List for std::vector<SfxStyleSheetBase*>.

---
 svx/source/sdr/properties/attributeproperties.cxx |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/svx/source/sdr/properties/attributeproperties.cxx 
b/svx/source/sdr/properties/attributeproperties.cxx
index 6ea4fe9..27514e0 100644
--- a/svx/source/sdr/properties/attributeproperties.cxx
+++ b/svx/source/sdr/properties/attributeproperties.cxx
@@ -353,7 +353,7 @@ namespace sdr
                         if(pOldPool && pNewPool)
                         {
                             // build a list of to-be-copied Styles
-                            List aList;
+                            std::vector<SfxStyleSheetBase*> aStyleList;
                             SfxStyleSheetBase* pAnchor = 0L;
 
                             while(pSheet)
@@ -362,7 +362,7 @@ namespace sdr
 
                                 if(!pAnchor)
                                 {
-                                    aList.Insert(pSheet, LIST_APPEND);
+                                    aStyleList.push_back(pSheet);
                                     pSheet = pOldPool->Find(pSheet->GetParent(), 
pSheet->GetFamily());
                                 }
                                 else
@@ -373,15 +373,15 @@ namespace sdr
                             }
 
                             // copy and set the parents
-                            pSheet = (SfxStyleSheetBase*)aList.First();
                             SfxStyleSheetBase* pNewSheet = 0L;
                             SfxStyleSheetBase* pLastSheet = 0L;
                             SfxStyleSheetBase* pForThisObject = 0L;
 
-                            while(pSheet)
+                            std::vector<SfxStyleSheetBase*>::iterator iter;
+                            for (iter = aStyleList.begin(); iter != aStyleList.end(); ++iter)
                             {
-                                pNewSheet = &pNewPool->Make(pSheet->GetName(), 
pSheet->GetFamily(), pSheet->GetMask());
-                                pNewSheet->GetItemSet().Put(pSheet->GetItemSet(), sal_False);
+                                pNewSheet = &pNewPool->Make((*iter)->GetName(), 
(*iter)->GetFamily(), (*iter)->GetMask());
+                                pNewSheet->GetItemSet().Put((*iter)->GetItemSet(), sal_False);
 
                                 if(bScaleUnitChanged)
                                 {
@@ -399,7 +399,6 @@ namespace sdr
                                 }
 
                                 pLastSheet = pNewSheet;
-                                pSheet = (SfxStyleSheetBase*)aList.Next();
                             }
 
                             // Set link to the Style found in the Pool
-- 
1.7.3.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.