diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-02-01 10:38:57 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-02-01 20:21:04 -0500 |
commit | 2a7c07e2e5fbdce057aaecb87231c62d98981bcb (patch) | |
tree | f18fb28b3ec85955de96e5cdce6a74ea5b38186a | |
parent | 513bbdf9c4664e2677537acb9387df84349529cd (diff) |
InsertData to AppendData, to hide the insert position.
Only a few places in sc specified insert position, and those were
not strictly necessary.
-rw-r--r-- | sc/source/core/data/drwlayer.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/unoobj/shapeuno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsh9.cxx | 2 | ||||
-rw-r--r-- | sd/source/core/drawdoc2.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unoobj.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/drviewsg.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/sdview3.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/sdview4.cxx | 6 | ||||
-rw-r--r-- | svx/inc/svx/svdobj.hxx | 4 | ||||
-rw-r--r-- | svx/source/dialog/imapwnd.cxx | 8 | ||||
-rw-r--r-- | svx/source/gallery2/galtheme.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 24 | ||||
-rw-r--r-- | svx/source/svdraw/svdotxln.cxx | 2 |
13 files changed, 29 insertions, 35 deletions
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 64935132d7e7..e781e605183d 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -1836,7 +1836,7 @@ ScDrawObjData* ScDrawLayer::GetObjData( SdrObject* pObj, sal_Bool bCreate ) if( pObj && bCreate ) { ScDrawObjData* pData = new ScDrawObjData; - pObj->InsertUserData( pData, 0 ); + pObj->AppendUserData(pData); return pData; } return 0; @@ -1945,7 +1945,7 @@ ScMacroInfo* ScDrawLayer::GetMacroInfo( SdrObject* pObj, sal_Bool bCreate ) if ( bCreate ) { ScMacroInfo* pData = new ScMacroInfo; - pObj->InsertUserData( pData, 0 ); + pObj->AppendUserData(pData); return pData; } return 0; diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx index f794994bb0fe..efbce663d2bd 100644 --- a/sc/source/ui/unoobj/shapeuno.cxx +++ b/sc/source/ui/unoobj/shapeuno.cxx @@ -470,7 +470,7 @@ void SAL_CALL ScShapeObj::setPropertyValue( else { // insert new user data with image map - pObj->InsertUserData(new ScIMapInfo(aImageMap) ); + pObj->AppendUserData(new ScIMapInfo(aImageMap) ); } } } diff --git a/sc/source/ui/view/tabvwsh9.cxx b/sc/source/ui/view/tabvwsh9.cxx index c4c1133232d1..931ec01e9b3d 100644 --- a/sc/source/ui/view/tabvwsh9.cxx +++ b/sc/source/ui/view/tabvwsh9.cxx @@ -207,7 +207,7 @@ void ScTabViewShell::ExecImageMap( SfxRequest& rReq ) ScIMapInfo* pIMapInfo = ScDrawLayer::GetIMapInfo( pSdrObj ); if ( !pIMapInfo ) - pSdrObj->InsertUserData( new ScIMapInfo( rImageMap ) ); + pSdrObj->AppendUserData( new ScIMapInfo( rImageMap ) ); else pIMapInfo->SetImageMap( rImageMap ); diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx index 59a73d023db6..be9f2d11ca49 100644 --- a/sd/source/core/drawdoc2.cxx +++ b/sd/source/core/drawdoc2.cxx @@ -1059,7 +1059,7 @@ SdAnimationInfo* SdDrawDocument::GetShapeUserData(SdrObject& rObject, bool bCrea if( (pRet == 0) && bCreate ) { pRet = new SdAnimationInfo( rObject ); - rObject.InsertUserData( pRet); + rObject.AppendUserData( pRet); } return pRet; diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx index 9431aa8d8e9b..82380b6cc652 100644 --- a/sd/source/ui/unoidl/unoobj.cxx +++ b/sd/source/ui/unoidl/unoobj.cxx @@ -676,7 +676,7 @@ void SAL_CALL SdXShape::setPropertyValue( const ::rtl::OUString& aPropertyName, else { // insert new user data with image map - pObj->InsertUserData(new SdIMapInfo(aImageMap) ); + pObj->AppendUserData(new SdIMapInfo(aImageMap) ); } } } diff --git a/sd/source/ui/view/drviewsg.cxx b/sd/source/ui/view/drviewsg.cxx index 9a9ad2a5d1bb..d93774562488 100644 --- a/sd/source/ui/view/drviewsg.cxx +++ b/sd/source/ui/view/drviewsg.cxx @@ -76,7 +76,7 @@ void DrawViewShell::ExecIMap( SfxRequest& rReq ) SdIMapInfo* pIMapInfo = GetDoc()->GetIMapInfo( pSdrObj ); if ( !pIMapInfo ) - pSdrObj->InsertUserData( new SdIMapInfo( rImageMap ) ); + pSdrObj->AppendUserData( new SdIMapInfo( rImageMap ) ); else pIMapInfo->SetImageMap( rImageMap ); diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index 78e3a3bdfd9e..70f2a7a1e707 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -967,7 +967,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper, InsertObjectAtView( pObj, *pPV, nOptions ); if( pImageMap ) - pObj->InsertUserData( new SdIMapInfo( *pImageMap ) ); + pObj->AppendUserData( new SdIMapInfo( *pImageMap ) ); if ( pObj && pObj->IsChart() ) { @@ -1137,7 +1137,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper, InsertObjectAtView( pObj, *pPV, nOptions ); if( pImageMap ) - pObj->InsertUserData( new SdIMapInfo( *pImageMap ) ); + pObj->AppendUserData( new SdIMapInfo( *pImageMap ) ); // let the object stay in loaded state after insertion pObj->Unload(); diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx index afc2eb948f21..d953f73f21ad 100644 --- a/sd/source/ui/view/sdview4.cxx +++ b/sd/source/ui/view/sdview4.cxx @@ -150,7 +150,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction, } if (pImageMap) - pNewGrafObj->InsertUserData(new SdIMapInfo(*pImageMap)); + pNewGrafObj->AppendUserData(new SdIMapInfo(*pImageMap)); ReplaceObjectAtView(pPickObj, *pPV, pNewGrafObj); // maybe ReplaceObjectAtView @@ -229,7 +229,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction, { // replace object if (pImageMap) - pNewGrafObj->InsertUserData(new SdIMapInfo(*pImageMap)); + pNewGrafObj->AppendUserData(new SdIMapInfo(*pImageMap)); Rectangle aPickObjRect(pPickObj->GetCurrentBoundRect()); Size aPickObjSize(aPickObjRect.GetSize()); @@ -272,7 +272,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction, InsertObjectAtView(pNewGrafObj, *pPV, nOptions); if( pImageMap ) - pNewGrafObj->InsertUserData(new SdIMapInfo(*pImageMap)); + pNewGrafObj->AppendUserData(new SdIMapInfo(*pImageMap)); } } diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx index 03494441f379..ed8d8c73d6e0 100644 --- a/svx/inc/svx/svdobj.hxx +++ b/svx/inc/svx/svdobj.hxx @@ -996,9 +996,7 @@ public: sal_uInt16 GetUserDataCount() const; SdrObjUserData* GetUserData(sal_uInt16 nNum) const; - // Insert uebernimmt den auf dem Heap angelegten Record in den Besitz - // des Zeichenobjekts - void InsertUserData(SdrObjUserData* pData, sal_uInt16 nPos=0xFFFF); + void AppendUserData(SdrObjUserData* pData); // Delete entfernt den Record aus der Liste und ruft // ein delete (FreeMem+Dtor). diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index 7fbf77173e87..262e554d578e 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -280,7 +280,7 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj ) pSdrObj->SetMergedItemSetAndBroadcast(aSet); - pSdrObj->InsertUserData( new IMapUserData( pCloneIMapObj ) ); + pSdrObj->AppendUserData( new IMapUserData( pCloneIMapObj ) ); pSdrObj->SetUserCall( GetSdrUserCall() ); } @@ -309,7 +309,7 @@ void IMapWindow::SdrObjCreated( const SdrObject& rObj ) IMapRectangleObject* pObj = new IMapRectangleObject( pRectObj->GetLogicRect(), String(), String(), String(), String(), String(), sal_True, sal_False ); - pRectObj->InsertUserData( new IMapUserData( IMapObjectPtr(pObj) ) ); + pRectObj->AppendUserData( new IMapUserData( IMapObjectPtr(pObj) ) ); } break; @@ -322,7 +322,7 @@ void IMapWindow::SdrObjCreated( const SdrObject& rObj ) IMapPolygonObject* pObj = new IMapPolygonObject( Polygon(aPoly), String(), String(), String(), String(), String(), sal_True, sal_False ); pObj->SetExtraEllipse( aPoly.GetBoundRect() ); - pCircObj->InsertUserData( new IMapUserData( IMapObjectPtr(pObj) ) ); + pCircObj->AppendUserData( new IMapUserData( IMapObjectPtr(pObj) ) ); } break; @@ -338,7 +338,7 @@ void IMapWindow::SdrObjCreated( const SdrObject& rObj ) { Polygon aPoly(rXPolyPoly.getB2DPolygon(0L)); IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, String(), String(), String(), String(), String(), sal_True, sal_False ); - pPathObj->InsertUserData( new IMapUserData( IMapObjectPtr(pObj) ) ); + pPathObj->AppendUserData( new IMapUserData( IMapObjectPtr(pObj) ) ); } } break; diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index c64fbb6938f3..de4de7350e8f 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -1310,7 +1310,7 @@ sal_Bool GalleryTheme::InsertTransferable( const uno::Reference< datatransfer::X SdrPage* pPage = aModel.GetModel()->GetPage(0); SdrGrafObj* pGrafObj = new SdrGrafObj( *pGraphic ); - pGrafObj->InsertUserData( new SgaIMapInfo( aImageMap ) ); + pGrafObj->AppendUserData( new SgaIMapInfo( aImageMap ) ); pPage->InsertObject( pGrafObj ); bRet = InsertModel( *aModel.GetModel(), nInsertPos ); } diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 5ce27e6487bf..2ac68a234899 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -2842,23 +2842,19 @@ SdrObjUserData* SdrObject::GetUserData(sal_uInt16 nNum) const return pPlusData->pUserDataList->GetUserData(nNum); } -void SdrObject::InsertUserData(SdrObjUserData* pData, sal_uInt16 nPos) +void SdrObject::AppendUserData(SdrObjUserData* pData) { - if (pData!=NULL) + if (!pData) { - ImpForcePlusData(); - if (!pPlusData->pUserDataList) - pPlusData->pUserDataList = new SdrObjUserDataList; - - if (nPos == 0xFFFF) - pPlusData->pUserDataList->AppendUserData(pData); - else - pPlusData->pUserDataList->InsertUserData(pData, nPos); - } - else - { - OSL_FAIL("SdrObject::InsertUserData(): pData is NULL pointer."); + OSL_FAIL("SdrObject::AppendUserData(): pData is NULL pointer."); + return; } + + ImpForcePlusData(); + if (!pPlusData->pUserDataList) + pPlusData->pUserDataList = new SdrObjUserDataList; + + pPlusData->pUserDataList->AppendUserData(pData); } void SdrObject::DeleteUserData(sal_uInt16 nNum) diff --git a/svx/source/svdraw/svdotxln.cxx b/svx/source/svdraw/svdotxln.cxx index 58abf9025d1a..e8c8344bec84 100644 --- a/svx/source/svdraw/svdotxln.cxx +++ b/svx/source/svdraw/svdotxln.cxx @@ -151,7 +151,7 @@ void SdrTextObj::SetTextLink(const String& rFileName, const String& rFilterName, pData->aFileName=rFileName; pData->aFilterName=rFilterName; pData->eCharSet=eCharSet; - InsertUserData(pData); + AppendUserData(pData); ImpLinkAnmeldung(); } |