remove unwanted files added with ee51444ed1

<sigh> added some files that were part of a patch that I was testing
were not intended as part of commit

Change-Id: I34ed7f55de28fa09739c0dd8d5084824de676477
This commit is contained in:
Noel Power
2013-06-25 11:01:52 +01:00
parent 69dcacedac
commit 90ffe25cdd
10 changed files with 84 additions and 70 deletions

View File

@@ -145,7 +145,6 @@ private:
Timer* mpWorkStartupTimer; Timer* mpWorkStartupTimer;
Timer* mpOnlineSpellingTimer; Timer* mpOnlineSpellingTimer;
sd::ShapeList* mpOnlineSpellingList; sd::ShapeList* mpOnlineSpellingList;
sd::ShapeList::const_iterator maShapeListIterator;
SvxSearchItem* mpOnlineSearchItem; SvxSearchItem* mpOnlineSearchItem;
std::vector<sd::FrameView*> maFrameViewList; std::vector<sd::FrameView*> maFrameViewList;
SdCustomShowList* mpCustomShowList; SdCustomShowList* mpCustomShowList;

View File

@@ -29,10 +29,6 @@ namespace sd
class ShapeList : public sdr::ObjectUser class ShapeList : public sdr::ObjectUser
{ {
public: public:
/** const_iterator guarantee only that the list itself is not
altered. The objects referenced by the list are still mutable. */
typedef std::list< SdrObject* >::const_iterator const_iterator;
ShapeList(); ShapeList();
virtual ~ShapeList(); virtual ~ShapeList();
@@ -52,17 +48,26 @@ namespace sd
/** @return true if given shape is part of this list */ /** @return true if given shape is part of this list */
bool hasShape( SdrObject& rObject ) const; bool hasShape( SdrObject& rObject ) const;
/** @return const_iterator pointing to the first element */ /** returns the shape the internal iterator points to, or 0 if
const_iterator cbegin() const; * the list end is reached. moves the internal iterator to the
* next shape. */
SdrObject* getNextShape();
/** @return const_iterator pointing to the list termination element */ /** Sets the internal iterator to the shape at given index. */
const_iterator cend() const; void seekShape( sal_uInt32 nIndex );
/**
*/
bool hasMore() const;
const std::list< SdrObject* >& getList() const { return maShapeList; }
private: private:
virtual void ObjectInDestruction(const SdrObject& rObject); virtual void ObjectInDestruction(const SdrObject& rObject);
typedef std::list< SdrObject* > ListImpl; typedef std::list< SdrObject* > ListImpl;
ListImpl maShapeList; ListImpl maShapeList;
ListImpl::iterator maIter;
}; };
} }

View File

@@ -144,7 +144,6 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh)
, mpWorkStartupTimer(NULL) , mpWorkStartupTimer(NULL)
, mpOnlineSpellingTimer(NULL) , mpOnlineSpellingTimer(NULL)
, mpOnlineSpellingList(NULL) , mpOnlineSpellingList(NULL)
, maShapeListIterator()
, mpOnlineSearchItem(NULL) , mpOnlineSearchItem(NULL)
, mpCustomShowList(NULL) , mpCustomShowList(NULL)
, mpDocSh(static_cast< ::sd::DrawDocShell*>(pDrDocSh)) , mpDocSh(static_cast< ::sd::DrawDocShell*>(pDrDocSh))
@@ -695,7 +694,7 @@ void SdDrawDocument::UpdateAllLinks()
*/ */
void SdDrawDocument::NewOrLoadCompleted( SdPage* pPage, SdStyleSheetPool* pSPool ) void SdDrawDocument::NewOrLoadCompleted( SdPage* pPage, SdStyleSheetPool* pSPool )
{ {
const sd::ShapeList& rPresentationShapes( pPage->GetPresentationShapeList() ); sd::ShapeList& rPresentationShapes( pPage->GetPresentationShapeList() );
if(!rPresentationShapes.isEmpty()) if(!rPresentationShapes.isEmpty())
{ {
// Create lists of title and outline styles // Create lists of title and outline styles
@@ -707,13 +706,13 @@ void SdDrawDocument::NewOrLoadCompleted( SdPage* pPage, SdStyleSheetPool* pSPool
SfxStyleSheet* pTitleSheet = (SfxStyleSheet*)pSPool->GetTitleSheet(aName); SfxStyleSheet* pTitleSheet = (SfxStyleSheet*)pSPool->GetTitleSheet(aName);
SdrObject* pObj = 0;
rPresentationShapes.seekShape(0);
// Now look for title and outline text objects, then make those objects // Now look for title and outline text objects, then make those objects
// listeners. // listeners.
for( ShapeList::const_iterator aIter (rPresentationShapes.cbegin() ); while( (pObj = rPresentationShapes.getNextShape()) )
aIter != rPresentationShapes.cend(); ++aIter )
{ {
SdrObject* pObj = *aIter;
if (pObj->GetObjInventor() == SdrInventor) if (pObj->GetObjInventor() == SdrInventor)
{ {
OutlinerParaObject* pOPO = pObj->GetOutlinerParaObject(); OutlinerParaObject* pOPO = pObj->GetOutlinerParaObject();

View File

@@ -755,7 +755,6 @@ void SdDrawDocument::StartOnlineSpelling(sal_Bool bForceSpelling)
pOutl->SetDefaultLanguage( meLanguage ); pOutl->SetDefaultLanguage( meLanguage );
mpOnlineSpellingList = new ShapeList; mpOnlineSpellingList = new ShapeList;
maShapeListIterator = mpOnlineSpellingList->cend();
sal_uInt16 nPage; sal_uInt16 nPage;
for ( nPage = 0; nPage < GetPageCount(); nPage++ ) for ( nPage = 0; nPage < GetPageCount(); nPage++ )
@@ -770,7 +769,7 @@ void SdDrawDocument::StartOnlineSpelling(sal_Bool bForceSpelling)
FillOnlineSpellingList((SdPage*) GetMasterPage(nPage)); FillOnlineSpellingList((SdPage*) GetMasterPage(nPage));
} }
maShapeListIterator = mpOnlineSpellingList->cbegin(); mpOnlineSpellingList->seekShape(0);
mpOnlineSpellingTimer = new Timer(); mpOnlineSpellingTimer = new Timer();
mpOnlineSpellingTimer->SetTimeoutHdl( LINK(this, SdDrawDocument, OnlineSpellingHdl) ); mpOnlineSpellingTimer->SetTimeoutHdl( LINK(this, SdDrawDocument, OnlineSpellingHdl) );
mpOnlineSpellingTimer->SetTimeout(250); mpOnlineSpellingTimer->SetTimeout(250);
@@ -824,14 +823,11 @@ void SdDrawDocument::FillOnlineSpellingList(SdPage* pPage)
// OnlineSpelling in the background // OnlineSpelling in the background
IMPL_LINK_NOARG(SdDrawDocument, OnlineSpellingHdl) IMPL_LINK_NOARG(SdDrawDocument, OnlineSpellingHdl)
{ {
bool bHasMore = maShapeListIterator != mpOnlineSpellingList->cend();
if (mpOnlineSpellingList!=NULL if (mpOnlineSpellingList!=NULL
&& ( !mbOnlineSpell || bHasMore)) && ( !mbOnlineSpell || mpOnlineSpellingList->hasMore()))
{ {
// Spell next object // Spell next object
SdrObject* pObj = *maShapeListIterator; SdrObject* pObj = mpOnlineSpellingList->getNextShape();
++maShapeListIterator;
if (pObj) if (pObj)
{ {

View File

@@ -155,11 +155,11 @@ SdrObject* SdPage::GetPresObj(PresObjKind eObjKind, int nIndex, bool bFuzzySearc
// first sort all matching shapes with z-order // first sort all matching shapes with z-order
std::vector< SdrObject* > aMatches; std::vector< SdrObject* > aMatches;
for( ShapeList::const_iterator aIter( maPresentationShapeList.cbegin() ); SdrObject* pObj = 0;
aIter != maPresentationShapeList.cend(); ++aIter ) maPresentationShapeList.seekShape(0);
{
SdrObject* pObj = *aIter;
while( (pObj = maPresentationShapeList.getNextShape()) )
{
SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pObj); SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pObj);
if( pInfo ) if( pInfo )
{ {
@@ -1576,38 +1576,27 @@ void SdPage::SetAutoLayout(AutoLayout eLayout, sal_Bool bInit, sal_Bool bCreate
// now delete all empty presentation objects that are no longer used by the new layout // now delete all empty presentation objects that are no longer used by the new layout
if( bInit ) if( bInit )
{ {
std::list< SdrObject* > aRemoveList; SdrObject* pObj = 0;
maPresentationShapeList.seekShape(0);
for( ShapeList::const_iterator aIter = maPresentationShapeList.cbegin(); while( (pObj = maPresentationShapeList.getNextShape()) )
aIter != maPresentationShapeList.cend(); ++aIter )
{ {
SdrObject* pObj = *aIter;
if( aUsedPresentationObjects.count(pObj) == 0 ) if( aUsedPresentationObjects.count(pObj) == 0 )
{ {
if( pObj->IsEmptyPresObj() ) if( pObj->IsEmptyPresObj() )
{ {
// remove the object now would invalidate the iterator and lead to a seg fault if( bUndo )
aRemoveList.push_back(pObj); pUndoManager->AddUndoAction(pModel->GetSdrUndoFactory().CreateUndoDeleteObject(*pObj));
RemoveObject( pObj->GetOrdNum() );
if( !bUndo )
SdrObject::Free( pObj );
} }
/* #i108541# keep non empty pres obj as pres obj even if they are not part of the current layout */ /* #i108541# keep non empty pres obj as pres obj even if they are not part of the current layout */
} }
} }
for( std::list<SdrObject*>::iterator aIter = aRemoveList.begin();
aIter != aRemoveList.end(); ++aIter )
{
SdrObject* pObj = *aIter;
if( bUndo )
pUndoManager->AddUndoAction(pModel->GetSdrUndoFactory().CreateUndoDeleteObject(*pObj));
RemoveObject( pObj->GetOrdNum() );
if( !bUndo )
SdrObject::Free( pObj );
}
} }
} }

View File

@@ -379,8 +379,10 @@ SdPage::SdPage(const SdPage& rSrcPage)
mePageKind = rSrcPage.mePageKind; mePageKind = rSrcPage.mePageKind;
meAutoLayout = rSrcPage.meAutoLayout; meAutoLayout = rSrcPage.meAutoLayout;
for( ShapeList::const_iterator aIter( rSrcPage.maPresentationShapeList.cbegin() ); // use shape list directly to preserve constness of rSrcPage
aIter != rSrcPage.maPresentationShapeList.cend(); ++aIter ) const std::list< SdrObject* >& rShapeList = rSrcPage.maPresentationShapeList.getList();
for( std::list< SdrObject* >::const_iterator aIter = rShapeList.begin();
aIter != rShapeList.end(); ++aIter )
{ {
SdrObject* pObj = *aIter; SdrObject* pObj = *aIter;
InsertPresObj(GetObj(pObj->GetOrdNum()), rSrcPage.GetPresObjKind(pObj)); InsertPresObj(GetObj(pObj->GetOrdNum()), rSrcPage.GetPresObjKind(pObj));

View File

@@ -26,6 +26,7 @@ using namespace sd;
ShapeList::ShapeList() ShapeList::ShapeList()
{ {
maIter = maShapeList.end();
} }
ShapeList::~ShapeList() ShapeList::~ShapeList()
@@ -54,9 +55,14 @@ SdrObject* ShapeList::removeShape( SdrObject& rObject )
ListImpl::iterator aIter( std::find( maShapeList.begin(), maShapeList.end(), &rObject ) ); ListImpl::iterator aIter( std::find( maShapeList.begin(), maShapeList.end(), &rObject ) );
if( aIter != maShapeList.end() ) if( aIter != maShapeList.end() )
{ {
bool bIterErased = aIter == maIter;
(*aIter)->RemoveObjectUser(*this); (*aIter)->RemoveObjectUser(*this);
aIter = maShapeList.erase( aIter ); aIter = maShapeList.erase( aIter );
if( bIterErased )
maIter = aIter;
if( aIter != maShapeList.end() ) if( aIter != maShapeList.end() )
return (*aIter); return (*aIter);
} }
@@ -77,6 +83,8 @@ void ShapeList::clear()
ListImpl::iterator aIter( aShapeList.begin() ); ListImpl::iterator aIter( aShapeList.begin() );
while( aIter != aShapeList.end() ) while( aIter != aShapeList.end() )
(*aIter++)->RemoveObjectUser(*this); (*aIter++)->RemoveObjectUser(*this);
maIter = aShapeList.end();
} }
/** returns true if this list is empty */ /** returns true if this list is empty */
@@ -91,22 +99,17 @@ bool ShapeList::hasShape( SdrObject& rObject ) const
return std::find( maShapeList.begin(), maShapeList.end(), &rObject ) != maShapeList.end(); return std::find( maShapeList.begin(), maShapeList.end(), &rObject ) != maShapeList.end();
} }
ShapeList::const_iterator ShapeList::cbegin() const
{
return maShapeList.begin();
}
ShapeList::const_iterator ShapeList::cend() const
{
return maShapeList.end();
}
void ShapeList::ObjectInDestruction(const SdrObject& rObject) void ShapeList::ObjectInDestruction(const SdrObject& rObject)
{ {
ListImpl::iterator aIter( std::find( maShapeList.begin(), maShapeList.end(), &rObject ) ); ListImpl::iterator aIter( std::find( maShapeList.begin(), maShapeList.end(), &rObject ) );
if( aIter != maShapeList.end() ) if( aIter != maShapeList.end() )
{ {
maShapeList.erase( aIter ); bool bIterErased = aIter == maIter;
aIter = maShapeList.erase( aIter );
if( bIterErased )
maIter = aIter;
} }
else else
{ {
@@ -114,4 +117,28 @@ void ShapeList::ObjectInDestruction(const SdrObject& rObject)
} }
} }
SdrObject* ShapeList::getNextShape()
{
if( maIter != maShapeList.end() )
{
return (*maIter++);
}
else
{
return 0;
}
}
void ShapeList::seekShape( sal_uInt32 nIndex )
{
maIter = maShapeList.begin();
while( nIndex-- && (maIter != maShapeList.end()) )
maIter++;
}
bool ShapeList::hasMore() const
{
return maIter != maShapeList.end();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -1059,12 +1059,11 @@ sal_Bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
{ {
// set pages for all available handout presentation objects // set pages for all available handout presentation objects
sd::ShapeList& rShapeList = pMaster->GetPresentationShapeList(); sd::ShapeList& rShapeList = pMaster->GetPresentationShapeList();
SdrObject* pObj = 0;
rShapeList.seekShape(0);
for( ShapeList::const_iterator aIter( rShapeList.cbegin() ); while( (pObj = rShapeList.getNextShape()) )
aIter != rShapeList.cend(); ++aIter )
{ {
SdrObject* pObj = *aIter;
if( pMaster->GetPresObjKind(pObj) == PRESOBJ_HANDOUT ) if( pMaster->GetPresObjKind(pObj) == PRESOBJ_HANDOUT )
{ {
// #i105146# We want no content to be displayed for PK_HANDOUT, // #i105146# We want no content to be displayed for PK_HANDOUT,

View File

@@ -101,10 +101,9 @@ SdrObject* View::GetEmptyPresentationObject( PresObjKind eKind )
// last try to find empty pres obj of multiple type // last try to find empty pres obj of multiple type
if( !pEmptyObj ) if( !pEmptyObj )
{ {
ShapeList& rShapeList = pPage->GetPresentationShapeList(); const std::list< SdrObject* >& rShapes = pPage->GetPresentationShapeList().getList();
for( ShapeList::const_iterator iter( rShapeList.cbegin() ); for( std::list< SdrObject* >::const_iterator iter( rShapes.begin() ); iter != rShapes.end(); ++iter )
iter != rShapeList.cend(); ++iter )
{ {
if( (*iter)->IsEmptyPresObj() && implIsMultiPresObj(pPage->GetPresObjKind(*iter)) ) if( (*iter)->IsEmptyPresObj() && implIsMultiPresObj(pPage->GetPresObjKind(*iter)) )
{ {

View File

@@ -546,10 +546,9 @@ bool ViewOverlayManager::CreateTags()
if( pPage && !pPage->IsMasterPage() && (pPage->GetPageKind() == PK_STANDARD) ) if( pPage && !pPage->IsMasterPage() && (pPage->GetPageKind() == PK_STANDARD) )
{ {
ShapeList& rShapeList = pPage->GetPresentationShapeList(); const std::list< SdrObject* >& rShapes = pPage->GetPresentationShapeList().getList();
for( ShapeList::const_iterator iter( rShapeList.cbegin() ); for( std::list< SdrObject* >::const_iterator iter( rShapes.begin() ); iter != rShapes.end(); ++iter )
iter != rShapeList.cend(); ++iter )
{ {
if( (*iter)->IsEmptyPresObj() && ((*iter)->GetObjIdentifier() == OBJ_OUTLINETEXT) && (mrBase.GetDrawView()->GetTextEditObject() != (*iter)) ) if( (*iter)->IsEmptyPresObj() && ((*iter)->GetObjIdentifier() == OBJ_OUTLINETEXT) && (mrBase.GetDrawView()->GetTextEditObject() != (*iter)) )
{ {