Kaydet (Commit) 2e3c45af authored tarafından Rafael Dominguez's avatar Rafael Dominguez Kaydeden (comit) Joseph Powers

Remove usage of deprecated List container.

üst ff6ee6fb
...@@ -28,6 +28,10 @@ ...@@ -28,6 +28,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove // MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sd.hxx" #include "precompiled_sd.hxx"
#include <vector>
#include <boost/ptr_container/ptr_vector.hpp>
#include <sfx2/docfile.hxx> #include <sfx2/docfile.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <editeng/outliner.hxx> #include <editeng/outliner.hxx>
...@@ -146,10 +150,10 @@ void SdPage::SetPresentationLayout(const String& rLayoutName, ...@@ -146,10 +150,10 @@ void SdPage::SetPresentationLayout(const String& rLayoutName,
// Listen mit: // Listen mit:
// - Vorlagenzeigern fuer Gliederungstextobjekt (alte und neue Vorlagen) // - Vorlagenzeigern fuer Gliederungstextobjekt (alte und neue Vorlagen)
// -Replacedaten fuer OutlinerParaObject // -Replacedaten fuer OutlinerParaObject
List aOutlineStyles; std::vector<SfxStyleSheetBase*> aOutlineStyles;
List aOldOutlineStyles; std::vector<SfxStyleSheetBase*> aOldOutlineStyles;
List aReplList; boost::ptr_vector<StyleReplaceData> aReplList;
BOOL bListsFilled = FALSE; bool bListsFilled = false;
ULONG nObjCount = GetObjCount(); ULONG nObjCount = GetObjCount();
...@@ -178,11 +182,11 @@ void SdPage::SetPresentationLayout(const String& rLayoutName, ...@@ -178,11 +182,11 @@ void SdPage::SetPresentationLayout(const String& rLayoutName,
pSheet = pStShPool->Find(aOldFullName, SD_STYLE_FAMILY_MASTERPAGE); pSheet = pStShPool->Find(aOldFullName, SD_STYLE_FAMILY_MASTERPAGE);
DBG_ASSERT(pSheet, "alte Gliederungsvorlage nicht gefunden"); DBG_ASSERT(pSheet, "alte Gliederungsvorlage nicht gefunden");
aOldOutlineStyles.Insert(pSheet, LIST_APPEND); aOldOutlineStyles.push_back(pSheet);
pSheet = pStShPool->Find(aFullName, SD_STYLE_FAMILY_MASTERPAGE); pSheet = pStShPool->Find(aFullName, SD_STYLE_FAMILY_MASTERPAGE);
DBG_ASSERT(pSheet, "neue Gliederungsvorlage nicht gefunden"); DBG_ASSERT(pSheet, "neue Gliederungsvorlage nicht gefunden");
aOutlineStyles.Insert(pSheet, LIST_APPEND); aOutlineStyles.push_back(pSheet);
if (bReplaceStyleSheets && pSheet) if (bReplaceStyleSheets && pSheet)
{ {
...@@ -192,7 +196,7 @@ void SdPage::SetPresentationLayout(const String& rLayoutName, ...@@ -192,7 +196,7 @@ void SdPage::SetPresentationLayout(const String& rLayoutName,
pReplData->nFamily = pSheet->GetFamily(); pReplData->nFamily = pSheet->GetFamily();
pReplData->aNewName = aFullName; pReplData->aNewName = aFullName;
pReplData->aName = aOldFullName; pReplData->aName = aOldFullName;
aReplList.Insert(pReplData, LIST_APPEND); aReplList.push_back(pReplData);
} }
else else
{ {
...@@ -203,13 +207,20 @@ void SdPage::SetPresentationLayout(const String& rLayoutName, ...@@ -203,13 +207,20 @@ void SdPage::SetPresentationLayout(const String& rLayoutName,
} }
} }
bListsFilled = TRUE; bListsFilled = true;
} }
SfxStyleSheet* pSheet = (SfxStyleSheet*)aOutlineStyles.First(); SfxStyleSheet* pSheet = NULL;
SfxStyleSheet* pOldSheet = (SfxStyleSheet*)aOldOutlineStyles.First(); SfxStyleSheet* pOldSheet = NULL;
while (pSheet)
std::vector<SfxStyleSheetBase*>::iterator iterOut = aOutlineStyles.begin();
std::vector<SfxStyleSheetBase*>::iterator iterOldOut = aOldOutlineStyles.begin();
while (iterOut != aOutlineStyles.end())
{ {
pSheet = reinterpret_cast<SfxStyleSheet*>(*iterOut);
pOldSheet = reinterpret_cast<SfxStyleSheet*>(*iterOldOut);
if (pSheet != pOldSheet) if (pSheet != pOldSheet)
{ {
pObj->EndListening(*pOldSheet); pObj->EndListening(*pOldSheet);
...@@ -218,19 +229,18 @@ void SdPage::SetPresentationLayout(const String& rLayoutName, ...@@ -218,19 +229,18 @@ void SdPage::SetPresentationLayout(const String& rLayoutName,
pObj->StartListening(*pSheet); pObj->StartListening(*pSheet);
} }
pSheet = (SfxStyleSheet*)aOutlineStyles.Next(); ++iterOut;
pOldSheet = (SfxStyleSheet*)aOldOutlineStyles.Next(); ++iterOldOut;
} }
OutlinerParaObject* pOPO = ((SdrTextObj*)pObj)->GetOutlinerParaObject(); OutlinerParaObject* pOPO = ((SdrTextObj*)pObj)->GetOutlinerParaObject();
if ( bReplaceStyleSheets && pOPO ) if ( bReplaceStyleSheets && pOPO )
{ {
StyleReplaceData* pReplData = (StyleReplaceData*) aReplList.First(); boost::ptr_vector<StyleReplaceData>::const_iterator it = aReplList.begin();
while (it != aReplList.end())
while( pReplData )
{ {
pOPO->ChangeStyleSheets( pReplData->aName, pReplData->nFamily, pReplData->aNewName, pReplData->nNewFamily ); pOPO->ChangeStyleSheets( it->aName, it->nFamily, it->aNewName, it->nNewFamily );
pReplData = (StyleReplaceData*) aReplList.Next(); ++it;
} }
} }
} }
...@@ -253,11 +263,6 @@ void SdPage::SetPresentationLayout(const String& rLayoutName, ...@@ -253,11 +263,6 @@ void SdPage::SetPresentationLayout(const String& rLayoutName,
pObj->SetStyleSheet(pSheet, TRUE); pObj->SetStyleSheet(pSheet, TRUE);
} }
} }
for (ULONG i = 0; i < aReplList.Count(); i++)
{
delete (StyleReplaceData*) aReplList.GetObject(i);
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment