[Libreoffice-commits] .: 2 commits - svx/source
Petr Mladek
pmladek at kemper.freedesktop.org
Mon Jun 6 10:59:17 PDT 2011
svx/source/sdr/properties/attributeproperties.cxx | 26 +++++++++-------------
1 file changed, 11 insertions(+), 15 deletions(-)
New commits:
commit 4f61edafb897223441b79a78fb076687e0bf42d3
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Wed Jun 1 22:35:29 2011 -0430
Replace List for std::vector<const SfxItemSet*>.
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)
commit 1a431852f1aad0bb1debb2097b0b73f8ee28545e
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Wed Jun 1 22:34:45 2011 -0430
Replace List for std::vector<SfxStyleSheetBase*>.
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
More information about the Libreoffice-commits
mailing list