summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorIvan Timofeev <timofeev.i.s@gmail.com>2012-01-31 21:38:43 +0400
committerIvan Timofeev <timofeev.i.s@gmail.com>2012-01-31 21:52:02 +0400
commitf2e17f8f6b6724d7e56d6583d79434372f6221bd (patch)
treea70d238eb27d1a4d2a486944a682f54af0b15535 /sd
parentff462c9f5e9b010b1740772dc696487f99375d34 (diff)
erase garbage after std::remove
this fixes commit 5a71069339b3a3c118f3015d978799ef66db7564
Diffstat (limited to 'sd')
-rw-r--r--sd/inc/cusshow.hxx1
-rw-r--r--sd/source/core/cusshow.cxx7
-rw-r--r--sd/source/core/drawdoc_animations.cxx6
-rw-r--r--sd/source/ui/unoidl/unocpres.cxx10
4 files changed, 16 insertions, 8 deletions
diff --git a/sd/inc/cusshow.hxx b/sd/inc/cusshow.hxx
index 1bd361452b6d..74c6cfab1b6c 100644
--- a/sd/inc/cusshow.hxx
+++ b/sd/inc/cusshow.hxx
@@ -71,6 +71,7 @@ public:
PageVec& PagesVector();
void ReplacePage( const SdPage* pOldPage, const SdPage* pNewPage );
+ void RemovePage( const SdPage* pPage );
void SetName(const String& rName);
String GetName() const;
diff --git a/sd/source/core/cusshow.cxx b/sd/source/core/cusshow.cxx
index dcdb343469b8..d3233b76ef8c 100644
--- a/sd/source/core/cusshow.cxx
+++ b/sd/source/core/cusshow.cxx
@@ -106,7 +106,7 @@ void SdCustomShow::ReplacePage( const SdPage* pOldPage, const SdPage* pNewPage )
{
if( !pNewPage )
{
- ::std::remove(maPages.begin(), maPages.end(), pOldPage);
+ RemovePage(pOldPage);
}
else
{
@@ -114,6 +114,11 @@ void SdCustomShow::ReplacePage( const SdPage* pOldPage, const SdPage* pNewPage )
}
}
+void SdCustomShow::RemovePage( const SdPage* pPage )
+{
+ maPages.erase(::std::remove(maPages.begin(), maPages.end(), pPage), maPages.end());
+}
+
void SdCustomShow::SetName(const String& rName)
{
aName = rName;
diff --git a/sd/source/core/drawdoc_animations.cxx b/sd/source/core/drawdoc_animations.cxx
index de62ec5b53df..375dd4d6296e 100644
--- a/sd/source/core/drawdoc_animations.cxx
+++ b/sd/source/core/drawdoc_animations.cxx
@@ -43,11 +43,7 @@ void SdDrawDocument::ReplacePageInCustomShows( const SdPage* pOldPage, const SdP
for (sal_uLong i = 0; i < mpCustomShowList->Count(); i++)
{
SdCustomShow* pCustomShow = (SdCustomShow*) mpCustomShowList->GetObject(i);
- if( pNewPage == 0 )
- ::std::remove(pCustomShow->PagesVector().begin(), pCustomShow->PagesVector().end(),
- pOldPage);
- else
- pCustomShow->ReplacePage(pOldPage,pNewPage);
+ pCustomShow->ReplacePage(pOldPage, pNewPage);
}
}
}
diff --git a/sd/source/ui/unoidl/unocpres.cxx b/sd/source/ui/unoidl/unocpres.cxx
index e0aa857e2824..e44f61eda751 100644
--- a/sd/source/ui/unoidl/unocpres.cxx
+++ b/sd/source/ui/unoidl/unocpres.cxx
@@ -144,10 +144,16 @@ void SAL_CALL SdXCustomPresentation::removeByIndex( sal_Int32 Index )
if( xPage.is() )
{
- SvxDrawPage* pPage = SvxDrawPage::getImplementation( xPage );
+ SvxDrawPage* pPage = SvxDrawPage::getImplementation( xPage );
if(pPage)
- ::std::remove(mpSdCustomShow->PagesVector().begin(), mpSdCustomShow->PagesVector().end(),
+ {
+ SdCustomShow::PageVec::iterator it = std::find(
+ mpSdCustomShow->PagesVector().begin(),
+ mpSdCustomShow->PagesVector().end(),
pPage->GetSdrPage());
+ if (it != mpSdCustomShow->PagesVector().end())
+ mpSdCustomShow->PagesVector().erase(it);
+ }
}
}