diff options
author | Noel Grandin <noel@peralex.com> | 2015-04-23 15:00:26 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-04-29 10:41:39 +0200 |
commit | 1f1b9b9ff56d8649b22b78c5696a36b078ea9dcf (patch) | |
tree | 23e712ed0972b8ea8dd08e0aa9fd30ada8e58db6 | |
parent | d478a1cd6426aba6a502963862ace5a9f6182450 (diff) |
convert SDRINSERT constants to scoped enum
Change-Id: I6335e00cae161cea7ece922ecfa845c205626cd9
27 files changed, 77 insertions, 68 deletions
diff --git a/include/svx/svdedtv.hxx b/include/svx/svdedtv.hxx index 7f4451d4d242..c22074bcc5ae 100644 --- a/include/svx/svdedtv.hxx +++ b/include/svx/svdedtv.hxx @@ -24,6 +24,7 @@ #include <svx/xpoly.hxx> #include <svx/svdmodel.hxx> #include <svx/svxdllapi.h> +#include <o3tl/typed_flags_set.hxx> class SfxUndoAction; class SdrUndoAction; @@ -52,12 +53,20 @@ enum SdrMergeMode { SDR_MERGE_INTERSECT }; -// Optionen fuer InsertObject() -#define SDRINSERT_DONTMARK 0x0001 /* object will not be marked (the actual marking remains) */ -#define SDRINSERT_ADDMARK 0x0002 /* object will be added an existing selection */ -#define SDRINSERT_SETDEFATTR 0x0004 /* actual attributes (+StyleSheet) are assigned to the object */ -#define SDRINSERT_SETDEFLAYER 0x0008 /* actual layer is assigned to the object */ -#define SDRINSERT_NOBROADCAST 0x0010 /* insert with NbcInsertObject() for SolidDragging */ +// Options for InsertObject() +enum class SdrInsertFlags +{ + NONE = 0x0000, + DONTMARK = 0x0001, /* object will not be marked (the actual marking remains) */ + ADDMARK = 0x0002, /* object will be added an existing selection */ + SETDEFATTR = 0x0004, /* actual attributes (+StyleSheet) are assigned to the object */ + SETDEFLAYER = 0x0008, /* actual layer is assigned to the object */ + NOBROADCAST = 0x0010, /* insert with NbcInsertObject() for SolidDragging */ +}; +namespace o3tl +{ + template<> struct typed_flags<SdrInsertFlags> : is_typed_flags<SdrInsertFlags, 0x1f> {}; +} class SVX_DLLPUBLIC SdrEditView: public SdrMarkView { @@ -274,7 +283,7 @@ public: // the target layer is locked or not visible. In this case // the method returns FALSE. // Amongst others the method does not create an undo-action. - bool InsertObjectAtView(SdrObject* pObj, SdrPageView& rPV, sal_uIntPtr nOptions=0); + bool InsertObjectAtView(SdrObject* pObj, SdrPageView& rPV, SdrInsertFlags nOptions=SdrInsertFlags::NONE); // Replace one drawing object by another. // *pNewObj belongs to me, *pOldObj is changed into Undo. diff --git a/include/svx/svdxcgv.hxx b/include/svx/svdxcgv.hxx index afa84e7a3f4b..ec5d3be323c3 100644 --- a/include/svx/svdxcgv.hxx +++ b/include/svx/svdxcgv.hxx @@ -32,7 +32,7 @@ class SVX_DLLPUBLIC SdrExchangeView: public SdrObjEditView protected: void ImpGetPasteObjList(Point& rPos, SdrObjList*& rpLst); - void ImpPasteObject(SdrObject* pObj, SdrObjList& rLst, const Point& rCenter, const Size& rSiz, const MapMode& rMap, sal_uInt32 nOptions); + void ImpPasteObject(SdrObject* pObj, SdrObjList& rLst, const Point& rCenter, const Size& rSiz, const MapMode& rMap, SdrInsertFlags nOptions); bool ImpGetPasteLayer(const SdrObjList* pObjList, SdrLayerID& rLayer) const; // liefert True, wenn rPt geaendert wurde @@ -104,11 +104,11 @@ public: // Gueltige Werte fuer nOptions sind SDRINSERT_DONTMARK und // SDRINSERT_ADDMARK (siehe svdedtv.hxx). virtual bool Paste( - const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions, + const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, SdrInsertFlags nOptions, const OUString& rSrcShellID, const OUString& rDestShellID ); - bool Paste(const OUString& rStr, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0); - bool Paste(SvStream& rInput, const OUString& rBaseURL, sal_uInt16 eFormat, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0); + bool Paste(const OUString& rStr, const Point& rPos, SdrObjList* pLst=NULL, SdrInsertFlags nOptions=SdrInsertFlags::NONE); + bool Paste(SvStream& rInput, const OUString& rBaseURL, sal_uInt16 eFormat, const Point& rPos, SdrObjList* pLst=NULL, SdrInsertFlags nOptions=SdrInsertFlags::NONE); static bool Cut( sal_uIntPtr nFormat = SDR_ANYFORMAT ); diff --git a/include/svx/view3d.hxx b/include/svx/view3d.hxx index 37c08de09e63..2f66ebe864f2 100644 --- a/include/svx/view3d.hxx +++ b/include/svx/view3d.hxx @@ -99,7 +99,7 @@ public: // On Paste: We need to insert the objects of the Scene, but not the Scene itself using SdrView::Paste; virtual bool Paste( - const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions, + const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, SdrInsertFlags nOptions, const OUString& rSrcShellID, const OUString& rDestShellID ) SAL_OVERRIDE; // #83403# Service routine used from local Clone() and from SdrCreateView::EndCreateObj(...) diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index b5da44b8e31e..5d7d48852e4f 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -986,7 +986,7 @@ void correctOverlapping(SdrObject* _pControl,OReportSection& _aReportSection,boo } } if ( !bOverlapping && _bInsert ) // now insert objects - rSectionView.InsertObjectAtView(_pControl,*rSectionView.GetSdrPageView(),SDRINSERT_ADDMARK); + rSectionView.InsertObjectAtView(_pControl,*rSectionView.GetSdrPageView(), SdrInsertFlags::ADDMARK); } void setZoomFactor(const Fraction& _aZoom, vcl::Window& _rWindow) diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx index b1b3c204e522..0e4f4d2e6dd5 100644 --- a/sc/source/ui/app/drwtrans.cxx +++ b/sc/source/ui/app/drwtrans.cxx @@ -739,7 +739,7 @@ void ScDrawTransferObj::InitDocShell() aDestView.Paste( *pModel, Point(aSrcSize.Width()/2, aSrcSize.Height()/2), - NULL, 0, OUString(), OUString()); + NULL, SdrInsertFlags::NONE, OUString(), OUString()); // put objects to right layer (see ScViewFunc::PasteDataFormat for SotClipboardFormatId::DRAWING) diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx index 43b8f0616b54..0c94d8b3c7fa 100644 --- a/sc/source/ui/drawfunc/fuins1.cxx +++ b/sc/source/ui/drawfunc/fuins1.cxx @@ -164,7 +164,7 @@ static void lcl_InsertGraphic( const Graphic& rGraphic, pObj->SetName(aName); // don't select if from (dispatch) API, to allow subsequent cell operations - sal_uLong nInsOptions = bApi ? SDRINSERT_DONTMARK : 0; + SdrInsertFlags nInsOptions = bApi ? SdrInsertFlags::DONTMARK : SdrInsertFlags::NONE; pView->InsertObjectAtView( pObj, *pPV, nInsOptions ); // SetGraphicLink has to be used after inserting the object, @@ -216,7 +216,7 @@ static void lcl_InsertMedia( const OUString& rMediaURL, bool bApi, pObj->SetModel(rData.GetDocument()->GetDrawLayer()); // set before setURL pObj->setURL( realURL, ""/*TODO?*/ ); - pView->InsertObjectAtView( pObj, *pPV, bApi ? SDRINSERT_DONTMARK : 0 ); + pView->InsertObjectAtView( pObj, *pPV, bApi ? SdrInsertFlags::DONTMARK : SdrInsertFlags::NONE ); } /************************************************************************* diff --git a/sc/source/ui/inc/drawview.hxx b/sc/source/ui/inc/drawview.hxx index 54f20bde7eba..42cb740ee0f5 100644 --- a/sc/source/ui/inc/drawview.hxx +++ b/sc/source/ui/inc/drawview.hxx @@ -115,7 +115,7 @@ public: bool HasMarkedControl() const; bool HasMarkedInternal() const; - bool InsertObjectSafe(SdrObject* pObj, SdrPageView& rPV, sal_uLong nOptions=0); + bool InsertObjectSafe(SdrObject* pObj, SdrPageView& rPV, SdrInsertFlags nOptions=SdrInsertFlags::NONE); /** Returns the selected object, if it is the caption object of a cell note. @param ppCaptData (out-param) If not null, returns the pointer to the caption object data. */ diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index afa14e194652..e7d08f966401 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -778,7 +778,7 @@ bool ScDrawView::GetObjectIsMarked( SdrObject* pObject ) return bisMarked; } -bool ScDrawView::InsertObjectSafe(SdrObject* pObj, SdrPageView& rPV, sal_uLong nOptions) +bool ScDrawView::InsertObjectSafe(SdrObject* pObj, SdrPageView& rPV, SdrInsertFlags nOptions) { // Markierung nicht aendern, wenn Ole-Objekt aktiv // (bei Drop aus Ole-Objekt wuerde sonst mitten im ExecuteDrag deaktiviert!) @@ -787,7 +787,7 @@ bool ScDrawView::InsertObjectSafe(SdrObject* pObj, SdrPageView& rPV, sal_uLong n { SfxInPlaceClient* pClient = pViewData->GetViewShell()->GetIPClient(); if ( pClient && pClient->IsObjectInPlaceActive() ) - nOptions |= SDRINSERT_DONTMARK; + nOptions |= SdrInsertFlags::DONTMARK; } return InsertObjectAtView( pObj, rPV, nOptions ); diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx index 77701c5dad47..578e62ed0d73 100644 --- a/sc/source/ui/view/viewfun7.cxx +++ b/sc/source/ui/view/viewfun7.cxx @@ -204,10 +204,10 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel, // don't change marking if OLE object is active // (at Drop from OLE object it would be deactivated in the middle of ExecuteDrag!) - sal_uLong nOptions = 0; + SdrInsertFlags nOptions = SdrInsertFlags::NONE; SfxInPlaceClient* pClient = GetViewData().GetViewShell()->GetIPClient(); if ( pClient && pClient->IsObjectInPlaceActive() ) - nOptions |= SDRINSERT_DONTMARK; + nOptions |= SdrInsertFlags::DONTMARK; ::std::vector< OUString > aExcludedChartNames; SCTAB nTab = GetViewData().GetTabNo(); diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index 58c246f8035a..087010f3efba 100644 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -1098,7 +1098,7 @@ bool SdDrawDocument::InsertBookmarkAsObject( pBMView->GetDoc().SetAllocDocSh(true); SdDrawDocument* pTmpDoc = static_cast<SdDrawDocument*>( pBMView->GetMarkedObjModel() ); - bOK = pView->Paste(*pTmpDoc, aObjPos, pPage, 0, OUString(), OUString()); + bOK = pView->Paste(*pTmpDoc, aObjPos, pPage, SdrInsertFlags::NONE, OUString(), OUString()); if (bOLEObjFound) pBMView->GetDoc().SetAllocDocSh(false); diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx index d1d16558b05a..43f20a7e19b4 100644 --- a/sd/source/ui/dlg/animobjs.cxx +++ b/sd/source/ui/dlg/animobjs.cxx @@ -1029,7 +1029,7 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView ) const Point aOrg( aWindowCenter.X() - ( aMaxSizeLog.Width() >> 1 ), aWindowCenter.Y() - ( aMaxSizeLog.Height() >> 1 ) ); pGrafObj->SetLogicRect( Rectangle( aOrg, aMaxSizeLog ) ); - rView.InsertObjectAtView( pGrafObj, *pPV, SDRINSERT_SETDEFLAYER); + rView.InsertObjectAtView( pGrafObj, *pPV, SdrInsertFlags::SETDEFLAYER); } else { diff --git a/sd/source/ui/func/fuconarc.cxx b/sd/source/ui/func/fuconarc.cxx index 2fce438a7c2c..cc7d3769f0e0 100644 --- a/sd/source/ui/func/fuconarc.cxx +++ b/sd/source/ui/func/fuconarc.cxx @@ -98,7 +98,7 @@ void FuConstructArc::DoExecute( SfxRequest& rReq ) (long) (pPhiEnd->GetValue () * 10.0)); SdrPageView *pPV = mpView->GetSdrPageView(); - mpView->InsertObjectAtView(pNewCircle, *pPV, SDRINSERT_SETDEFLAYER); + mpView->InsertObjectAtView(pNewCircle, *pPV, SdrInsertFlags::SETDEFLAYER); } } diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx index 86129b98d8ce..d8ee5ddecd1b 100644 --- a/sd/source/ui/func/fuconrec.cxx +++ b/sd/source/ui/func/fuconrec.cxx @@ -113,7 +113,7 @@ void FuConstructRectangle::DoExecute( SfxRequest& rReq ) SdrCircObj *pNewCircle = new SdrCircObj (OBJ_CIRC, aNewRectangle); SdrPageView *pPV = mpView->GetSdrPageView(); - mpView->InsertObjectAtView(pNewCircle, *pPV, SDRINSERT_SETDEFLAYER | SDRINSERT_SETDEFATTR); + mpView->InsertObjectAtView(pNewCircle, *pPV, SdrInsertFlags::SETDEFLAYER | SdrInsertFlags::SETDEFATTR); } break; @@ -131,7 +131,7 @@ void FuConstructRectangle::DoExecute( SfxRequest& rReq ) SdrRectObj *pNewRect = new SdrRectObj (aNewRectangle); SdrPageView *pPV = mpView->GetSdrPageView(); - mpView->InsertObjectAtView(pNewRect, *pPV, SDRINSERT_SETDEFLAYER | SDRINSERT_SETDEFATTR); + mpView->InsertObjectAtView(pNewRect, *pPV, SdrInsertFlags::SETDEFLAYER | SdrInsertFlags::SETDEFATTR); } break; } diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx index a12d8b2ed52a..d3708df9bb04 100644 --- a/sd/source/ui/func/fuinsert.cxx +++ b/sd/source/ui/func/fuinsert.cxx @@ -375,7 +375,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) if( pPickObj ) mpView->ReplaceObjectAtView(pPickObj, *pPV, pOleObj, true ); else - bRet = mpView->InsertObjectAtView(pOleObj, *pPV, SDRINSERT_SETDEFLAYER); + bRet = mpView->InsertObjectAtView(pOleObj, *pPV, SdrInsertFlags::SETDEFLAYER); if( bRet ) { @@ -623,7 +623,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) SdrOle2Obj* pObj = new SdrOle2Obj( aObjRef, aName, aRect); - if( mpView->InsertObjectAtView(pObj, *pPV, SDRINSERT_SETDEFLAYER) ) + if( mpView->InsertObjectAtView(pObj, *pPV, SdrInsertFlags::SETDEFLAYER) ) { // Math objects change their object size during InsertObject. // New size must be set in SdrObject, or a wrong scale will be set at diff --git a/sd/source/ui/func/fumorph.cxx b/sd/source/ui/func/fumorph.cxx index d2fe87dc6e88..2e47df4e6f9a 100644 --- a/sd/source/ui/func/fumorph.cxx +++ b/sd/source/ui/func/fumorph.cxx @@ -439,7 +439,7 @@ void FuMorph::ImpInsertPolygons( pObjList->InsertObject( pObj1->Clone(), 0 ); pObjList->InsertObject( pObj2->Clone() ); mpView->DeleteMarked(); - mpView->InsertObjectAtView( pObjGroup, *pPageView, SDRINSERT_SETDEFLAYER ); + mpView->InsertObjectAtView( pObjGroup, *pPageView, SdrInsertFlags:: SETDEFLAYER ); } } } diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx index f4823faa8cdd..f0e3c436df09 100644 --- a/sd/source/ui/inc/View.hxx +++ b/sd/source/ui/inc/View.hxx @@ -171,7 +171,7 @@ public: SdrMediaObj* InsertMediaObj( const OUString& rURL, const OUString& rMimeType, sal_Int8& rAction, const Point& rPos, const Size& rSize ); - bool PasteRTFTable( SotStorageStreamRef xStm, SdrPage* pPage, sal_uLong nPasteOptions ); + bool PasteRTFTable( SotStorageStreamRef xStm, SdrPage* pPage, SdrInsertFlags nPasteOptions ); bool IsPresObjSelected(bool bOnPage = true, bool bOnMasterPage = true, bool bCheckPresObjListOnly = false, bool bCheckLayoutOnly = false) const; @@ -197,7 +197,7 @@ public: virtual SdrModel* GetMarkedObjModel() const SAL_OVERRIDE; virtual bool Paste( - const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions, + const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, SdrInsertFlags nOptions, const OUString& rSrcShellID, const OUString& rDestShellID ) SAL_OVERRIDE; using SdrExchangeView::Paste; diff --git a/sd/source/ui/table/tablefunction.cxx b/sd/source/ui/table/tablefunction.cxx index 87452cc2aa52..6a242eb98433 100644 --- a/sd/source/ui/table/tablefunction.cxx +++ b/sd/source/ui/table/tablefunction.cxx @@ -188,7 +188,7 @@ void DrawViewShell::FuTable(SfxRequest& rReq) if( pPickObj ) mpView->ReplaceObjectAtView(pPickObj, *pPV, pObj, true ); else - mpView->InsertObjectAtView(pObj, *pPV, SDRINSERT_SETDEFLAYER); + mpView->InsertObjectAtView(pObj, *pPV, SdrInsertFlags::SETDEFLAYER); Invalidate(SID_DRAWTBX_INSERT); rReq.Ignore(); diff --git a/sd/source/ui/view/drviews8.cxx b/sd/source/ui/view/drviews8.cxx index cdcddc26f201..17c070993c8f 100644 --- a/sd/source/ui/view/drviews8.cxx +++ b/sd/source/ui/view/drviews8.cxx @@ -129,7 +129,7 @@ void DrawViewShell::ScannerEvent( const ::com::sun::star::lang::EventObject& ) { pGrafObj = new SdrGrafObj( Graphic( aScanBmp ), aRect ); SdrPageView* pPV = GetView()->GetSdrPageView(); - GetView()->InsertObjectAtView( pGrafObj, *pPV, SDRINSERT_SETDEFLAYER ); + GetView()->InsertObjectAtView( pGrafObj, *pPV, SdrInsertFlags::SETDEFLAYER ); } } } diff --git a/sd/source/ui/view/drviews9.cxx b/sd/source/ui/view/drviews9.cxx index 7b2137113e9c..a45a1ede5b37 100644 --- a/sd/source/ui/view/drviews9.cxx +++ b/sd/source/ui/view/drviews9.cxx @@ -170,7 +170,7 @@ void DrawViewShell::ExecGallery(SfxRequest& rReq) { pGrafObj = new SdrGrafObj(aGraphic, aRect); SdrPageView* pPV = mpDrawView->GetSdrPageView(); - mpDrawView->InsertObjectAtView(pGrafObj, *pPV, SDRINSERT_SETDEFLAYER); + mpDrawView->InsertObjectAtView(pGrafObj, *pPV, SdrInsertFlags::SETDEFLAYER); } } // insert sound diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 402dbda474f4..ef6b102007d5 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -1702,13 +1702,13 @@ void DrawViewShell::InsertURLButton(const OUString& rURL, const OUString& rText, aPos.Y() -= aSize.Height() / 2; pUnoCtrl->SetLogicRect(Rectangle(aPos, aSize)); - sal_uLong nOptions = SDRINSERT_SETDEFLAYER; + SdrInsertFlags nOptions = SdrInsertFlags::SETDEFLAYER; OSL_ASSERT (GetViewShell()!=NULL); SfxInPlaceClient* pIpClient = GetViewShell()->GetIPClient(); if (pIpClient!=NULL && pIpClient->IsObjectInPlaceActive()) { - nOptions |= SDRINSERT_DONTMARK; + nOptions |= SdrInsertFlags::DONTMARK; } mpDrawView->InsertObjectAtView(pUnoCtrl, *mpDrawView->GetSdrPageView(), nOptions); diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx index b8862ca1650e..c279456e1348 100644 --- a/sd/source/ui/view/sdview2.cxx +++ b/sd/source/ui/view/sdview2.cxx @@ -951,7 +951,7 @@ SdrModel* View::GetMarkedObjModel() const } bool View::Paste( - const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions, + const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, SdrInsertFlags nOptions, const OUString& rSrcShellID, const OUString& rDestShellID ) { return FmFormView::Paste(rMod, rPos, pLst, nOptions, rSrcShellID, rDestShellID); diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index 5619c15acf23..0458af1ac139 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -269,7 +269,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, bool bReturn = false; bool bLink = ( ( mnAction & DND_ACTION_LINK ) != 0 ); bool bCopy = ( ( ( mnAction & DND_ACTION_COPY ) != 0 ) || bLink ); - sal_uLong nPasteOptions = SDRINSERT_SETDEFLAYER; + SdrInsertFlags nPasteOptions = SdrInsertFlags::SETDEFLAYER; if (mpViewSh != NULL) { @@ -277,7 +277,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, SfxInPlaceClient* pIpClient = mpViewSh->GetViewShell()->GetIPClient(); if( mpViewSh->ISA(::sd::slidesorter::SlideSorterViewShell) || (pIpClient!=NULL && pIpClient->IsObjectInPlaceActive())) - nPasteOptions |= SDRINSERT_DONTMARK; + nPasteOptions |= SdrInsertFlags::DONTMARK; } if( bDrag ) @@ -829,7 +829,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, aRect.SetPos( maDropPos ); pObj->SetLogicRect( aRect ); - InsertObjectAtView( pObj, *GetSdrPageView(), SDRINSERT_SETDEFLAYER ); + InsertObjectAtView( pObj, *GetSdrPageView(), SdrInsertFlags::SETDEFLAYER ); bReturn = true; } } @@ -977,7 +977,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, Rectangle aRect( maDropPos, aSize ); SdrOle2Obj* pObj = new SdrOle2Obj( aObjRef, aName, aRect ); SdrPageView* pPV = GetSdrPageView(); - sal_uLong nOptions = SDRINSERT_SETDEFLAYER; + SdrInsertFlags nOptions = SdrInsertFlags::SETDEFLAYER; if (mpViewSh!=NULL) { @@ -985,7 +985,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, SfxInPlaceClient* pIpClient = mpViewSh->GetViewShell()->GetIPClient(); if (pIpClient!=NULL && pIpClient->IsObjectInPlaceActive()) - nOptions |= SDRINSERT_DONTMARK; + nOptions |= SdrInsertFlags::DONTMARK; } InsertObjectAtView( pObj, *pPV, nOptions ); @@ -1147,7 +1147,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, Rectangle aRect( maDropPos, aSize ); SdrOle2Obj* pObj = new SdrOle2Obj( aObjRef, aName, aRect ); SdrPageView* pPV = GetSdrPageView(); - sal_uLong nOptions = SDRINSERT_SETDEFLAYER; + SdrInsertFlags nOptions = SdrInsertFlags::SETDEFLAYER; if (mpViewSh!=NULL) { @@ -1155,7 +1155,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, SfxInPlaceClient* pIpClient = mpViewSh->GetViewShell()->GetIPClient(); if (pIpClient!=NULL && pIpClient->IsObjectInPlaceActive()) - nOptions |= SDRINSERT_DONTMARK; + nOptions |= SdrInsertFlags::DONTMARK; } InsertObjectAtView( pObj, *pPV, nOptions ); @@ -1500,7 +1500,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, return bReturn; } -bool View::PasteRTFTable( SotStorageStreamRef xStm, SdrPage* pPage, sal_uLong nPasteOptions ) +bool View::PasteRTFTable( SotStorageStreamRef xStm, SdrPage* pPage, SdrInsertFlags nPasteOptions ) { boost::scoped_ptr<SdDrawDocument> pModel(new SdDrawDocument( DOCUMENT_TYPE_IMPRESS, mpDocSh )); pModel->NewOrLoadCompleted(NEW_DOC); diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx index 992c111d672c..929beb64ea6e 100644 --- a/sd/source/ui/view/sdview4.cxx +++ b/sd/source/ui/view/sdview4.cxx @@ -199,7 +199,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction, aPageSize.Height() -= pPage->GetUppBorder() + pPage->GetLwrBorder(); pNewGrafObj->AdjustToMaxRect( Rectangle( Point(), aPageSize ), true ); - sal_uLong nOptions = SDRINSERT_SETDEFLAYER; + SdrInsertFlags nOptions = SdrInsertFlags::SETDEFLAYER; bool bIsPresTarget = false; if ((mpViewSh @@ -207,7 +207,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction, && mpViewSh->GetViewShell()->GetIPClient() && mpViewSh->GetViewShell()->GetIPClient()->IsObjectInPlaceActive()) || this->ISA(::sd::slidesorter::view::SlideSorterView)) - nOptions |= SDRINSERT_DONTMARK; + nOptions |= SdrInsertFlags::DONTMARK; if( ( mnAction & DND_ACTION_MOVE ) && pPickObj && (pPickObj->IsEmptyPresObj() || pPickObj->GetUserCall()) ) { @@ -373,7 +373,7 @@ SdrMediaObj* View::InsertMediaObj( const OUString& rMediaURL, const OUString& rM if( pPickObj ) ReplaceObjectAtView(pPickObj, *pPV, pNewMediaObj); else - InsertObjectAtView( pNewMediaObj, *pPV, SDRINSERT_SETDEFLAYER ); + InsertObjectAtView( pNewMediaObj, *pPV, SdrInsertFlags::SETDEFLAYER ); OUString referer; DrawDocShell * sh = GetDocSh(); @@ -552,7 +552,7 @@ IMPL_LINK_NOARG(View, DropInsertFileHdl) aRect = Rectangle( maDropPos, aSize ); SdrOle2Obj* pOleObj = new SdrOle2Obj( svt::EmbeddedObjectRef( xObj, nAspect ), aName, aRect ); - sal_uLong nOptions = SDRINSERT_SETDEFLAYER; + SdrInsertFlags nOptions = SdrInsertFlags::SETDEFLAYER; if (mpViewSh != NULL) { @@ -560,7 +560,7 @@ IMPL_LINK_NOARG(View, DropInsertFileHdl) SfxInPlaceClient* pIpClient = mpViewSh->GetViewShell()->GetIPClient(); if (pIpClient!=NULL && pIpClient->IsObjectInPlaceActive()) - nOptions |= SDRINSERT_DONTMARK; + nOptions |= SdrInsertFlags::DONTMARK; } InsertObjectAtView( pOleObj, *GetSdrPageView(), nOptions ); diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx index 6de3c9602ca2..6132a0ec2b98 100644 --- a/svx/source/engine3d/view3d.cxx +++ b/svx/source/engine3d/view3d.cxx @@ -441,7 +441,7 @@ SdrModel* E3dView::GetMarkedObjModel() const // not the scene itself bool E3dView::Paste( - const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions, + const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, SdrInsertFlags nOptions, const OUString& rSrcShellID, const OUString& rDestShellID ) { bool bRetval = false; @@ -1604,7 +1604,7 @@ void E3dView::BreakSingle3DObj(E3dObject* pObj) SdrAttrObj* pNewObj = pObj->GetBreakObj(); if(pNewObj) { - InsertObjectAtView(pNewObj, *GetSdrPageView(), SDRINSERT_DONTMARK); + InsertObjectAtView(pNewObj, *GetSdrPageView(), SdrInsertFlags::DONTMARK); pNewObj->SetChanged(); pNewObj->BroadcastObjectChange(); } diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx index 64a40d145d61..8984e9450353 100644 --- a/svx/source/svdraw/svdedtv.cxx +++ b/svx/source/svdraw/svdedtv.cxx @@ -948,9 +948,9 @@ void SdrEditView::CopyMarkedObj() -bool SdrEditView::InsertObjectAtView(SdrObject* pObj, SdrPageView& rPV, sal_uIntPtr nOptions) +bool SdrEditView::InsertObjectAtView(SdrObject* pObj, SdrPageView& rPV, SdrInsertFlags nOptions) { - if ((nOptions & SDRINSERT_SETDEFLAYER)!=0) { + if (nOptions & SdrInsertFlags::SETDEFLAYER) { SdrLayerID nLayer=rPV.GetPage()->GetLayerAdmin().GetLayerID(aAktLayer,true); if (nLayer==SDRLAYER_NOTFOUND) nLayer=0; if (rPV.GetLockedLayers().IsSet(nLayer) || !rPV.GetVisibleLayers().IsSet(nLayer)) { @@ -959,13 +959,13 @@ bool SdrEditView::InsertObjectAtView(SdrObject* pObj, SdrPageView& rPV, sal_uInt } pObj->NbcSetLayer(nLayer); } - if ((nOptions & SDRINSERT_SETDEFATTR)!=0) { + if (nOptions & SdrInsertFlags::SETDEFATTR) { if (pDefaultStyleSheet!=NULL) pObj->NbcSetStyleSheet(pDefaultStyleSheet, false); pObj->SetMergedItemSet(aDefaultAttr); } if (!pObj->IsInserted()) { SdrInsertReason aReason(SDRREASON_VIEWCALL); - if ((nOptions & SDRINSERT_NOBROADCAST)!=0) { + if (nOptions & SdrInsertFlags::NOBROADCAST) { rPV.GetObjList()->NbcInsertObject(pObj, SAL_MAX_SIZE, &aReason); } else { rPV.GetObjList()->InsertObject(pObj, SAL_MAX_SIZE, &aReason); @@ -974,8 +974,8 @@ bool SdrEditView::InsertObjectAtView(SdrObject* pObj, SdrPageView& rPV, sal_uInt if( IsUndoEnabled() ) AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pObj)); - if ((nOptions & SDRINSERT_DONTMARK)==0) { - if ((nOptions & SDRINSERT_ADDMARK)==0) UnmarkAllObj(); + if (!(nOptions & SdrInsertFlags::DONTMARK)) { + if (!(nOptions & SdrInsertFlags::ADDMARK)) UnmarkAllObj(); MarkObj(pObj,&rPV); } return true; diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx index a033fd8c7eb8..9f4bd1c51443 100644 --- a/svx/source/svdraw/svdxcgv.cxx +++ b/svx/source/svdraw/svdxcgv.cxx @@ -125,7 +125,7 @@ bool SdrExchangeView::ImpGetPasteLayer(const SdrObjList* pObjList, SdrLayerID& r return bRet; } -bool SdrExchangeView::Paste(const OUString& rStr, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions) +bool SdrExchangeView::Paste(const OUString& rStr, const Point& rPos, SdrObjList* pLst, SdrInsertFlags nOptions) { if (rStr.isEmpty()) return false; @@ -136,7 +136,7 @@ bool SdrExchangeView::Paste(const OUString& rStr, const Point& rPos, SdrObjList* if (pLst==NULL) return false; SdrLayerID nLayer; if (!ImpGetPasteLayer(pLst,nLayer)) return false; - bool bUnmark=(nOptions&(SDRINSERT_DONTMARK|SDRINSERT_ADDMARK))==0 && !IsTextEdit(); + bool bUnmark = (nOptions & (SdrInsertFlags::DONTMARK|SdrInsertFlags::ADDMARK))==SdrInsertFlags::NONE && !IsTextEdit(); if (bUnmark) UnmarkAllObj(); Rectangle aTextRect(0,0,500,500); SdrPage* pPage=pLst->GetPage(); @@ -165,7 +165,7 @@ bool SdrExchangeView::Paste(const OUString& rStr, const Point& rPos, SdrObjList* return true; } -bool SdrExchangeView::Paste(SvStream& rInput, const OUString& rBaseURL, sal_uInt16 eFormat, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions) +bool SdrExchangeView::Paste(SvStream& rInput, const OUString& rBaseURL, sal_uInt16 eFormat, const Point& rPos, SdrObjList* pLst, SdrInsertFlags nOptions) { Point aPos(rPos); ImpGetPasteObjList(aPos,pLst); @@ -173,7 +173,7 @@ bool SdrExchangeView::Paste(SvStream& rInput, const OUString& rBaseURL, sal_uInt if (pLst==NULL) return false; SdrLayerID nLayer; if (!ImpGetPasteLayer(pLst,nLayer)) return false; - bool bUnmark=(nOptions&(SDRINSERT_DONTMARK|SDRINSERT_ADDMARK))==0 && !IsTextEdit(); + bool bUnmark=(nOptions&(SdrInsertFlags::DONTMARK|SdrInsertFlags::ADDMARK))==SdrInsertFlags::NONE && !IsTextEdit(); if (bUnmark) UnmarkAllObj(); Rectangle aTextRect(0,0,500,500); SdrPage* pPage=pLst->GetPage(); @@ -224,7 +224,7 @@ bool SdrExchangeView::Paste(SvStream& rInput, const OUString& rBaseURL, sal_uInt } bool SdrExchangeView::Paste( - const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions, + const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, SdrInsertFlags nOptions, const OUString& rSrcShellID, const OUString& rDestShellID ) { const SdrModel* pSrcMod=&rMod; @@ -258,7 +258,7 @@ bool SdrExchangeView::Paste( if (pLst==NULL) return false; - bool bUnmark=(nOptions&(SDRINSERT_DONTMARK|SDRINSERT_ADDMARK))==0 && !IsTextEdit(); + bool bUnmark=(nOptions&(SdrInsertFlags::DONTMARK|SdrInsertFlags::ADDMARK))==SdrInsertFlags::NONE && !IsTextEdit(); if (bUnmark) UnmarkAllObj(); @@ -290,7 +290,7 @@ bool SdrExchangeView::Paste( Size aSiz(aDist.X(),aDist.Y()); size_t nCloneErrCnt = 0; const size_t nObjCount = pSrcPg->GetObjCount(); - bool bMark=pMarkPV!=NULL && !IsTextEdit() && (nOptions&SDRINSERT_DONTMARK)==0; + bool bMark = pMarkPV!=NULL && !IsTextEdit() && (nOptions&SdrInsertFlags::DONTMARK)==SdrInsertFlags::NONE; // #i13033# // New mechanism to re-create the connections of cloned connectors @@ -396,7 +396,7 @@ bool SdrExchangeView::Paste( return true; } -void SdrExchangeView::ImpPasteObject(SdrObject* pObj, SdrObjList& rLst, const Point& rCenter, const Size& rSiz, const MapMode& rMap, sal_uInt32 nOptions) +void SdrExchangeView::ImpPasteObject(SdrObject* pObj, SdrObjList& rLst, const Point& rCenter, const Size& rSiz, const MapMode& rMap, SdrInsertFlags nOptions) { BigInt nSizX(rSiz.Width()); BigInt nSizY(rSiz.Height()); @@ -436,7 +436,7 @@ void SdrExchangeView::ImpPasteObject(SdrObject* pObj, SdrObjList& rLst, const Po pMarkPV=pPV; } - bool bMark=pMarkPV!=NULL && !IsTextEdit() && (nOptions&SDRINSERT_DONTMARK)==0; + bool bMark = pMarkPV!=NULL && !IsTextEdit() && (nOptions&SdrInsertFlags::DONTMARK)==SdrInsertFlags::NONE; if (bMark) { // select object the first PageView we found MarkObj(pObj,pMarkPV); diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index 16a297c3c54e..c1a183100c36 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -1517,7 +1517,7 @@ void SwFEShell::Paste( SvStream& rStrm, sal_uInt16 nAction, const Point* pPt ) // #i50824# // method <lcl_RemoveOleObjsFromSdrModel> replaced by <lcl_ConvertSdrOle2ObjsToSdrGrafObjs> lcl_ConvertSdrOle2ObjsToSdrGrafObjs( pModel ); - pView->Paste(*pModel, aPos, NULL, 0, OUString(), OUString()); + pView->Paste(*pModel, aPos, NULL, SdrInsertFlags::NONE, OUString(), OUString()); const size_t nCnt = pView->GetMarkedObjectList().GetMarkCount(); if( nCnt ) |