Kaydet (Commit) 4449da41 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Michael Stahl

Convert SV_DECL_PTRARR_DEL(SvxNumSettingsArr_Impl) to boost::ptr_vector

Change-Id: I1d53e6815c4da5ef5f525dbc11bca73723bb3bd2
üst bbe2cb40
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
// include --------------------------------------------------------------- // include ---------------------------------------------------------------
#include <vector> #include <vector>
#include <boost/ptr_container/ptr_vector.hpp>
#include <sfx2/tabdlg.hxx> #include <sfx2/tabdlg.hxx>
#include <vcl/group.hxx> #include <vcl/group.hxx>
...@@ -41,7 +42,6 @@ ...@@ -41,7 +42,6 @@
#include <vcl/field.hxx> #include <vcl/field.hxx>
#include <editeng/numdef.hxx> #include <editeng/numdef.hxx>
#include <svtools/ctrlbox.hxx> #include <svtools/ctrlbox.hxx>
#include <svl/svarray.hxx>
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
class SvxNumRule; class SvxNumRule;
...@@ -68,8 +68,7 @@ struct SvxNumSettings_Impl ...@@ -68,8 +68,7 @@ struct SvxNumSettings_Impl
{} {}
}; };
typedef SvxNumSettings_Impl* SvxNumSettings_ImplPtr; typedef boost::ptr_vector<SvxNumSettings_Impl> SvxNumSettingsArr_Impl;
SV_DECL_PTRARR_DEL(SvxNumSettingsArr_Impl,SvxNumSettings_ImplPtr,8)
//------------------------------------------------ //------------------------------------------------
......
...@@ -89,8 +89,6 @@ using namespace com::sun::star::container; ...@@ -89,8 +89,6 @@ using namespace com::sun::star::container;
using namespace com::sun::star::style; using namespace com::sun::star::style;
using rtl::OUString; using rtl::OUString;
SV_IMPL_PTRARR(SvxNumSettingsArr_Impl,SvxNumSettings_ImplPtr);
#define NUM_PAGETYPE_BULLET 0 #define NUM_PAGETYPE_BULLET 0
#define NUM_PAGETYPE_SINGLENUM 1 #define NUM_PAGETYPE_SINGLENUM 1
#define NUM_PAGETYPE_NUM 2 #define NUM_PAGETYPE_NUM 2
...@@ -119,10 +117,10 @@ Reference<XDefaultNumberingProvider> lcl_GetNumberingProvider() ...@@ -119,10 +117,10 @@ Reference<XDefaultNumberingProvider> lcl_GetNumberingProvider()
return xRet; return xRet;
} }
SvxNumSettings_ImplPtr lcl_CreateNumSettingsPtr(const Sequence<PropertyValue>& rLevelProps) SvxNumSettings_Impl* lcl_CreateNumSettingsPtr(const Sequence<PropertyValue>& rLevelProps)
{ {
const PropertyValue* pValues = rLevelProps.getConstArray(); const PropertyValue* pValues = rLevelProps.getConstArray();
SvxNumSettings_ImplPtr pNew = new SvxNumSettings_Impl; SvxNumSettings_Impl* pNew = new SvxNumSettings_Impl;
for(sal_Int32 j = 0; j < rLevelProps.getLength(); j++) for(sal_Int32 j = 0; j < rLevelProps.getLength(); j++)
{ {
if ( pValues[j].Name == cNumberingType ) if ( pValues[j].Name == cNumberingType )
...@@ -238,8 +236,8 @@ SvxSingleNumPickTabPage::SvxSingleNumPickTabPage(Window* pParent, ...@@ -238,8 +236,8 @@ SvxSingleNumPickTabPage::SvxSingleNumPickTabPage(Window* pParent,
const Sequence<PropertyValue>* pValuesArr = aNumberings.getConstArray(); const Sequence<PropertyValue>* pValuesArr = aNumberings.getConstArray();
for(sal_Int32 i = 0; i < nLength; i++) for(sal_Int32 i = 0; i < nLength; i++)
{ {
SvxNumSettings_ImplPtr pNew = lcl_CreateNumSettingsPtr(pValuesArr[i]); SvxNumSettings_Impl* pNew = lcl_CreateNumSettingsPtr(pValuesArr[i]);
aNumSettingsArr.Insert(pNew, aNumSettingsArr.Count()); aNumSettingsArr.push_back(pNew);
} }
} }
catch(Exception&) catch(Exception&)
...@@ -255,7 +253,6 @@ SvxSingleNumPickTabPage::SvxSingleNumPickTabPage(Window* pParent, ...@@ -255,7 +253,6 @@ SvxSingleNumPickTabPage::SvxSingleNumPickTabPage(Window* pParent,
delete pActNum; delete pActNum;
delete pExamplesVS; delete pExamplesVS;
delete pSaveNum; delete pSaveNum;
aNumSettingsArr.DeleteAndDestroy(0, aNumSettingsArr.Count());
} }
SfxTabPage* SvxSingleNumPickTabPage::Create( Window* pParent, SfxTabPage* SvxSingleNumPickTabPage::Create( Window* pParent,
...@@ -352,10 +349,10 @@ IMPL_LINK_NOARG(SvxSingleNumPickTabPage, NumSelectHdl_Impl) ...@@ -352,10 +349,10 @@ IMPL_LINK_NOARG(SvxSingleNumPickTabPage, NumSelectHdl_Impl)
bPreset = sal_False; bPreset = sal_False;
bModified = sal_True; bModified = sal_True;
sal_uInt16 nIdx = pExamplesVS->GetSelectItemId() - 1; sal_uInt16 nIdx = pExamplesVS->GetSelectItemId() - 1;
DBG_ASSERT(aNumSettingsArr.Count() > nIdx, "wrong index"); DBG_ASSERT(aNumSettingsArr.size() > nIdx, "wrong index");
if(aNumSettingsArr.Count() <= nIdx) if(aNumSettingsArr.size() <= nIdx)
return 0; return 0;
SvxNumSettings_ImplPtr _pSet = aNumSettingsArr.GetObject(nIdx); SvxNumSettings_Impl* _pSet = &aNumSettingsArr[nIdx];
sal_Int16 eNewType = _pSet->nNumberType; sal_Int16 eNewType = _pSet->nNumberType;
const sal_Unicode cLocalPrefix = !_pSet->sPrefix.isEmpty() ? _pSet->sPrefix.getStr()[0] : 0; const sal_Unicode cLocalPrefix = !_pSet->sPrefix.isEmpty() ? _pSet->sPrefix.getStr()[0] : 0;
const sal_Unicode cLocalSuffix = !_pSet->sSuffix.isEmpty() ? _pSet->sSuffix.getStr()[0] : 0; const sal_Unicode cLocalSuffix = !_pSet->sSuffix.isEmpty() ? _pSet->sSuffix.getStr()[0] : 0;
...@@ -606,8 +603,8 @@ SvxNumPickTabPage::SvxNumPickTabPage(Window* pParent, ...@@ -606,8 +603,8 @@ SvxNumPickTabPage::SvxNumPickTabPage(Window* pParent,
Any aValueAny = xLevel->getByIndex(nLevel); Any aValueAny = xLevel->getByIndex(nLevel);
Sequence<PropertyValue> aLevelProps; Sequence<PropertyValue> aLevelProps;
aValueAny >>= aLevelProps; aValueAny >>= aLevelProps;
SvxNumSettings_ImplPtr pNew = lcl_CreateNumSettingsPtr(aLevelProps); SvxNumSettings_Impl* pNew = lcl_CreateNumSettingsPtr(aLevelProps);
rItemArr.Insert( pNew, rItemArr.Count() ); rItemArr.push_back( pNew );
} }
} }
} }
...@@ -725,11 +722,11 @@ IMPL_LINK_NOARG(SvxNumPickTabPage, NumSelectHdl_Impl) ...@@ -725,11 +722,11 @@ IMPL_LINK_NOARG(SvxNumPickTabPage, NumSelectHdl_Impl)
SvxNumSettingsArr_Impl& rItemArr = aNumSettingsArrays[pExamplesVS->GetSelectItemId() - 1]; SvxNumSettingsArr_Impl& rItemArr = aNumSettingsArrays[pExamplesVS->GetSelectItemId() - 1];
Font& rActBulletFont = lcl_GetDefaultBulletFont(); Font& rActBulletFont = lcl_GetDefaultBulletFont();
SvxNumSettings_ImplPtr pLevelSettings = 0; SvxNumSettings_Impl* pLevelSettings = 0;
for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
{ {
if(rItemArr.Count() > i) if(rItemArr.size() > i)
pLevelSettings = rItemArr[i]; pLevelSettings = &rItemArr[i];
if(!pLevelSettings) if(!pLevelSettings)
break; break;
SvxNumberFormat aFmt(pActNum->GetLevel(i)); SvxNumberFormat aFmt(pActNum->GetLevel(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