summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-06-21 15:53:53 +0200
committerMichael Stahl <mstahl@redhat.com>2012-06-25 20:13:14 +0200
commit2cbd5929f73201bf5a995c5d83b2a4c1d35993d4 (patch)
tree2f648ae1ef58501367efc5d07804d3e7577f3471 /sw
parent29b835a9227e0ac2c937b3a2128619a6568ddd6d (diff)
Convert GetPageObjs and SetPageObjsNewPages from Svptrarr to std::vector
Change-Id: Ia85fc0d4930bc90d8d32d435f4a100f69081d468
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/fesh.hxx4
-rw-r--r--sw/source/core/frmedt/fefly1.cxx19
-rw-r--r--sw/source/ui/app/appenv.cxx4
3 files changed, 12 insertions, 15 deletions
diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index 06f306c1d250..4377364c5736 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -329,8 +329,8 @@ public:
Size GetObjSize() const;
// SS for envelopes: get all page-bound objects and set them to new page.
- void GetPageObjs( SvPtrarr& rFillArr );
- void SetPageObjsNewPage( SvPtrarr& rFillArr, int nOffset = 1 );
+ void GetPageObjs( std::vector<SwFrmFmt*>& rFillArr );
+ void SetPageObjsNewPage( std::vector<SwFrmFmt*>& rFillArr, int nOffset = 1 );
// Show current selection (frame / draw object as required).
virtual void MakeSelVisible();
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 30334dad6b65..fe065599fe7a 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -935,18 +935,16 @@ void SwFEShell::InsertDrawObj( SdrObject& rDrawObj,
#* Methode : GetPageObjs
#***********************************************************************/
-void SwFEShell::GetPageObjs( SvPtrarr& rFillArr )
+void SwFEShell::GetPageObjs( std::vector<SwFrmFmt*>& rFillArr )
{
- if( rFillArr.Count() )
- rFillArr.Remove( 0, rFillArr.Count() );
+ rFillArr.clear();
- const SwFrmFmt* pFmt;
for( sal_uInt16 n = 0; n < pDoc->GetSpzFrmFmts()->size(); ++n )
{
- pFmt = (const SwFrmFmt*)(*pDoc->GetSpzFrmFmts())[n];
+ SwFrmFmt* pFmt = (*pDoc->GetSpzFrmFmts())[n];
if (FLY_AT_PAGE == pFmt->GetAnchor().GetAnchorId())
{
- rFillArr.Insert( (VoidPtr)pFmt, rFillArr.Count() );
+ rFillArr.push_back( pFmt );
}
}
}
@@ -956,22 +954,21 @@ void SwFEShell::GetPageObjs( SvPtrarr& rFillArr )
#* Methode : SetPageFlysNewPage
#***********************************************************************/
-void SwFEShell::SetPageObjsNewPage( SvPtrarr& rFillArr, int nOffset )
+void SwFEShell::SetPageObjsNewPage( std::vector<SwFrmFmt*>& rFillArr, int nOffset )
{
- if( !rFillArr.Count() || !nOffset )
+ if( rFillArr.empty() || !nOffset )
return;
StartAllAction();
StartUndo();
- SwFrmFmt* pFmt;
long nNewPage;
SwRootFrm* pTmpRootFrm = GetLayout();//swmod 080317
sal_uInt16 nMaxPage = pTmpRootFrm->GetPageNum();
sal_Bool bTmpAssert = sal_False;
- for( sal_uInt16 n = 0; n < rFillArr.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rFillArr.size(); ++n )
{
- pFmt = (SwFrmFmt*)rFillArr[n];
+ SwFrmFmt* pFmt = rFillArr[n];
if( pDoc->GetSpzFrmFmts()->Contains( pFmt ))
{
// FlyFmt is still valid, therefore process
diff --git a/sw/source/ui/app/appenv.cxx b/sw/source/ui/app/appenv.cxx
index 87616026c93e..ac4fce17a23f 100644
--- a/sw/source/ui/app/appenv.cxx
+++ b/sw/source/ui/app/appenv.cxx
@@ -336,7 +336,7 @@ void SwModule::InsertEnv( SfxRequest& rReq )
pSh->SetNewDoc(); // Avoid performance problems
// Remember Flys of this site
- SvPtrarr aFlyArr(0);
+ std::vector<SwFrmFmt*> aFlyArr;
if( ENV_NEWDOC != nMode && !bEnvChange )
pSh->GetPageObjs( aFlyArr );
@@ -460,7 +460,7 @@ void SwModule::InsertEnv( SfxRequest& rReq )
InsertLabEnvText(*pSh, aFldMgr, rItem.aAddrText);
// Move Flys to the "old" pages
- if (aFlyArr.Count())
+ if (!aFlyArr.empty())
pSh->SetPageObjsNewPage(aFlyArr, 1);
// Finished