sc/source/ui/app/drwtrans.cxx | 152 +++++++++++++++++++++--------------------- sc/source/ui/inc/drwtrans.hxx | 32 ++++---- 2 files changed, 92 insertions(+), 92 deletions(-)
New commits: commit beef3e6c9782c7ad38b59fa75d25531c0e9531a9 Author: Henry Castro <hcas...@collabora.com> AuthorDate: Tue May 8 14:05:01 2018 -0400 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Mon Aug 27 20:31:46 2018 +0200 sc: prefix members of ScDrawTransferObj Change-Id: I6a9ad039ec8b34470dd8c5e232b76fa8f686f219 Reviewed-on: https://gerrit.libreoffice.org/54002 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Henry Castro <hcas...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/59621 Reviewed-by: Andras Timar <andras.ti...@collabora.com> Tested-by: Andras Timar <andras.ti...@collabora.com> diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx index d661d1711a0d..b2ac16670efc 100644 --- a/sc/source/ui/app/drwtrans.cxx +++ b/sc/source/ui/app/drwtrans.cxx @@ -74,21 +74,21 @@ constexpr sal_uInt32 SCDRAWTRANS_TYPE_DOCUMENT = 3; ScDrawTransferObj::ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContainerShell, const TransferableObjectDescriptor& rDesc ) : - pModel( pClipModel ), - aObjDesc( rDesc ), - pBookmark( nullptr ), - bGraphic( false ), - bGrIsBit( false ), - bOleObj( false ), - pDragSourceView( nullptr ), - nDragSourceFlags( ScDragSrc::Undefined ), - bDragWasInternal( false ), + m_pModel( pClipModel ), + m_aObjDesc( rDesc ), + m_pBookmark( nullptr ), + m_bGraphic( false ), + m_bGrIsBit( false ), + m_bOleObj( false ), + m_pDragSourceView( nullptr ), + m_nDragSourceFlags( ScDragSrc::Undefined ), + m_bDragWasInternal( false ), maShellID(SfxObjectShell::CreateShellID(pContainerShell)) { // check what kind of objects are contained - SdrPage* pPage = pModel->GetPage(0); + SdrPage* pPage = m_pModel->GetPage(0); if (pPage) { SdrObjListIter aIter( *pPage, SdrIterMode::Flat ); @@ -106,7 +106,7 @@ ScDrawTransferObj::ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContain { uno::Reference< embed::XEmbedPersist > xPersObj( static_cast<SdrOle2Obj*>(pObject)->GetObjRef(), uno::UNO_QUERY ); if ( xPersObj.is() && xPersObj->hasEntry() ) - bOleObj = true; + m_bOleObj = true; } catch( uno::Exception& ) {} @@ -117,9 +117,9 @@ ScDrawTransferObj::ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContain if (nSdrObjKind == OBJ_GRAF) { - bGraphic = true; + m_bGraphic = true; if ( static_cast<SdrGrafObj*>(pObject)->GetGraphic().GetType() == GraphicType::Bitmap ) - bGrIsBit = true; + m_bGrIsBit = true; } // URL button @@ -174,7 +174,7 @@ ScDrawTransferObj::ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContain aLabel = sTmp; } } - pBookmark = new INetBookmark( aAbs, aLabel ); + m_pBookmark = new INetBookmark( aAbs, aLabel ); } } } @@ -188,20 +188,20 @@ ScDrawTransferObj::ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContain // #i71538# use complete SdrViews // SdrExchangeView aView(pModel); - SdrView aView(pModel); + SdrView aView(m_pModel); SdrPageView* pPv = aView.ShowSdrPage(aView.GetModel()->GetPage(0)); aView.MarkAllObj(pPv); - aSrcSize = aView.GetAllMarkedRect().GetSize(); + m_aSrcSize = aView.GetAllMarkedRect().GetSize(); - if ( bOleObj ) // single OLE object + if ( m_bOleObj ) // single OLE object { SdrOle2Obj* pObj = GetSingleObject(); if ( pObj && pObj->GetObjRef().is() ) - SvEmbedTransferHelper::FillTransferableObjectDescriptor( aObjDesc, pObj->GetObjRef(), pObj->GetGraphic(), pObj->GetAspect() ); + SvEmbedTransferHelper::FillTransferableObjectDescriptor( m_aObjDesc, pObj->GetObjRef(), pObj->GetGraphic(), pObj->GetAspect() ); } - aObjDesc.maSize = aSrcSize; - PrepareOLE( aObjDesc ); + m_aObjDesc.maSize = m_aSrcSize; + PrepareOLE( m_aObjDesc ); // remember a unique ID of the source document @@ -226,14 +226,14 @@ ScDrawTransferObj::~ScDrawTransferObj() pScMod->ResetDragObject(); } - aOleData = TransferableDataHelper(); // clear before releasing the mutex - aDocShellRef.clear(); + m_aOleData = TransferableDataHelper(); // clear before releasing the mutex + m_aDocShellRef.clear(); - delete pModel; - aDrawPersistRef.clear(); // after the model + delete m_pModel; + m_aDrawPersistRef.clear(); // after the model - delete pBookmark; - delete pDragSourceView; + delete m_pBookmark; + delete m_pDragSourceView; } ScDrawTransferObj* ScDrawTransferObj::GetOwnClipboard( vcl::Window* pWin ) @@ -283,7 +283,7 @@ static bool lcl_HasOnlyControls( SdrModel* pModel ) void ScDrawTransferObj::AddSupportedFormats() { - if ( bGrIsBit ) // single bitmap graphic + if ( m_bGrIsBit ) // single bitmap graphic { AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR ); AddFormat( SotClipboardFormatId::SVXB ); @@ -291,7 +291,7 @@ void ScDrawTransferObj::AddSupportedFormats() AddFormat( SotClipboardFormatId::BITMAP ); AddFormat( SotClipboardFormatId::GDIMETAFILE ); } - else if ( bGraphic ) // other graphic + else if ( m_bGraphic ) // other graphic { // #i25616# AddFormat( SotClipboardFormatId::DRAWING ); @@ -302,7 +302,7 @@ void ScDrawTransferObj::AddSupportedFormats() AddFormat( SotClipboardFormatId::PNG ); AddFormat( SotClipboardFormatId::BITMAP ); } - else if ( pBookmark ) // url button + else if ( m_pBookmark ) // url button { // AddFormat( SotClipboardFormatId::EMBED_SOURCE ); AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR ); @@ -312,7 +312,7 @@ void ScDrawTransferObj::AddSupportedFormats() AddFormat( SotClipboardFormatId::NETSCAPE_BOOKMARK ); AddFormat( SotClipboardFormatId::DRAWING ); } - else if ( bOleObj ) // single OLE object + else if ( m_bOleObj ) // single OLE object { AddFormat( SotClipboardFormatId::EMBED_SOURCE ); AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR ); @@ -320,12 +320,12 @@ void ScDrawTransferObj::AddSupportedFormats() CreateOLEData(); - if ( aOleData.GetTransferable().is() ) + if ( m_aOleData.GetTransferable().is() ) { // get format list from object snapshot // (this must be after inserting the default formats!) - DataFlavorExVector aVector( aOleData.GetDataFlavorExVector() ); + DataFlavorExVector aVector( m_aOleData.GetDataFlavorExVector() ); DataFlavorExVector::iterator aIter( aVector.begin() ), aEnd( aVector.end() ); while( aIter != aEnd ) @@ -339,7 +339,7 @@ void ScDrawTransferObj::AddSupportedFormats() AddFormat( SotClipboardFormatId::DRAWING ); // leave out bitmap and metafile if there are only controls - if ( !lcl_HasOnlyControls( pModel ) ) + if ( !lcl_HasOnlyControls( m_pModel ) ) { AddFormat( SotClipboardFormatId::PNG ); AddFormat( SotClipboardFormatId::BITMAP ); @@ -356,24 +356,24 @@ bool ScDrawTransferObj::GetData( const css::datatransfer::DataFlavor& rFlavor, c bool bOK = false; SotClipboardFormatId nFormat = SotExchange::GetFormat( rFlavor ); - if ( bOleObj && nFormat != SotClipboardFormatId::GDIMETAFILE ) + if ( m_bOleObj && nFormat != SotClipboardFormatId::GDIMETAFILE ) { CreateOLEData(); - if( aOleData.GetTransferable().is() && aOleData.HasFormat( rFlavor ) ) + if( m_aOleData.GetTransferable().is() && m_aOleData.HasFormat( rFlavor ) ) { SdrSwapGraphicsMode nOldSwapMode(SdrSwapGraphicsMode::DEFAULT); - if( pModel ) + if( m_pModel ) { - nOldSwapMode = pModel->GetSwapGraphicsMode(); - pModel->SetSwapGraphicsMode( SdrSwapGraphicsMode::PURGE ); + nOldSwapMode = m_pModel->GetSwapGraphicsMode(); + m_pModel->SetSwapGraphicsMode( SdrSwapGraphicsMode::PURGE ); } - bOK = SetAny( aOleData.GetAny(rFlavor, rDestDoc) ); + bOK = SetAny( m_aOleData.GetAny(rFlavor, rDestDoc) ); - if( pModel ) - pModel->SetSwapGraphicsMode( nOldSwapMode ); + if( m_pModel ) + m_pModel->SetSwapGraphicsMode( nOldSwapMode ); return bOK; } @@ -383,11 +383,11 @@ bool ScDrawTransferObj::GetData( const css::datatransfer::DataFlavor& rFlavor, c { if ( nFormat == SotClipboardFormatId::LINKSRCDESCRIPTOR || nFormat == SotClipboardFormatId::OBJECTDESCRIPTOR ) { - bOK = SetTransferableObjectDescriptor( aObjDesc ); + bOK = SetTransferableObjectDescriptor( m_aObjDesc ); } else if ( nFormat == SotClipboardFormatId::DRAWING ) { - bOK = SetObject( pModel, SCDRAWTRANS_TYPE_DRAWMODEL, rFlavor ); + bOK = SetObject( m_pModel, SCDRAWTRANS_TYPE_DRAWMODEL, rFlavor ); } else if ( nFormat == SotClipboardFormatId::BITMAP || nFormat == SotClipboardFormatId::PNG @@ -395,7 +395,7 @@ bool ScDrawTransferObj::GetData( const css::datatransfer::DataFlavor& rFlavor, c { // #i71538# use complete SdrViews // SdrExchangeView aView( pModel ); - SdrView aView( pModel ); + SdrView aView( m_pModel ); SdrPageView* pPv = aView.ShowSdrPage(aView.GetModel()->GetPage(0)); OSL_ENSURE( pPv, "pPv not there..." ); aView.MarkAllObj( pPv ); @@ -408,7 +408,7 @@ bool ScDrawTransferObj::GetData( const css::datatransfer::DataFlavor& rFlavor, c { // only enabled for single graphics object - SdrPage* pPage = pModel->GetPage(0); + SdrPage* pPage = m_pModel->GetPage(0); if (pPage) { SdrObjListIter aIter( *pPage, SdrIterMode::Flat ); @@ -422,7 +422,7 @@ bool ScDrawTransferObj::GetData( const css::datatransfer::DataFlavor& rFlavor, c } else if ( nFormat == SotClipboardFormatId::EMBED_SOURCE ) { - if ( bOleObj ) // single OLE object + if ( m_bOleObj ) // single OLE object { SdrOle2Obj* pObj = GetSingleObject(); if ( pObj && pObj->GetObjRef().is() ) @@ -435,13 +435,13 @@ bool ScDrawTransferObj::GetData( const css::datatransfer::DataFlavor& rFlavor, c //TODO/LATER: needs new Format, because now single OLE and "this" are different InitDocShell(); // set aDocShellRef - SfxObjectShell* pEmbObj = aDocShellRef.get(); + SfxObjectShell* pEmbObj = m_aDocShellRef.get(); bOK = SetObject( pEmbObj, SCDRAWTRANS_TYPE_DOCUMENT, rFlavor ); } } - else if( pBookmark ) + else if( m_pBookmark ) { - bOK = SetINetBookmark( *pBookmark, rFlavor ); + bOK = SetINetBookmark( *m_pBookmark, rFlavor ); } } return bOK; @@ -462,15 +462,15 @@ bool ScDrawTransferObj::WriteObject( tools::SvRef<SotStorageStream>& rxOStm, voi // for the changed pool defaults from drawing layer pool set those // attributes as hard attributes to preserve them for saving - const SfxItemPool& rItemPool = pModel->GetItemPool(); + const SfxItemPool& rItemPool = m_pModel->GetItemPool(); const SvxFontHeightItem& rDefaultFontHeight = rItemPool.GetDefaultItem(EE_CHAR_FONTHEIGHT); // SW should have no MasterPages - OSL_ENSURE(0 == pModel->GetMasterPageCount(), "SW with MasterPages (!)"); + OSL_ENSURE(0 == m_pModel->GetMasterPageCount(), "SW with MasterPages (!)"); - for(sal_uInt16 a(0); a < pModel->GetPageCount(); a++) + for(sal_uInt16 a(0); a < m_pModel->GetPageCount(); a++) { - const SdrPage* pPage = pModel->GetPage(a); + const SdrPage* pPage = m_pModel->GetPage(a); SdrObjListIter aIter(*pPage, SdrIterMode::DeepNoGroups); while(aIter.IsMore()) @@ -590,26 +590,26 @@ bool ScDrawTransferObj::WriteObject( tools::SvRef<SotStorageStream>& rxOStm, voi void ScDrawTransferObj::DragFinished( sal_Int8 nDropAction ) { - if ( nDropAction == DND_ACTION_MOVE && !bDragWasInternal && !(nDragSourceFlags & ScDragSrc::Navigator) ) + if ( nDropAction == DND_ACTION_MOVE && !m_bDragWasInternal && !(m_nDragSourceFlags & ScDragSrc::Navigator) ) { // move: delete source objects - if ( pDragSourceView ) - pDragSourceView->DeleteMarked(); + if ( m_pDragSourceView ) + m_pDragSourceView->DeleteMarked(); } ScModule* pScMod = SC_MOD(); if ( pScMod->GetDragData().pDrawTransfer == this ) pScMod->ResetDragObject(); - DELETEZ( pDragSourceView ); + DELETEZ( m_pDragSourceView ); TransferableHelper::DragFinished( nDropAction ); } void ScDrawTransferObj::SetDrawPersist( const SfxObjectShellRef& rRef ) { - aDrawPersistRef = rRef; + m_aDrawPersistRef = rRef; } static void lcl_InitMarks( SdrMarkView& rDest, const SdrMarkView& rSource, SCTAB nTab ) @@ -631,32 +631,32 @@ static void lcl_InitMarks( SdrMarkView& rDest, const SdrMarkView& rSource, SCTAB void ScDrawTransferObj::SetDragSource( const ScDrawView* pView ) { - DELETEZ( pDragSourceView ); - pDragSourceView = new SdrView( pView->GetModel() ); - lcl_InitMarks( *pDragSourceView, *pView, pView->GetTab() ); + DELETEZ( m_pDragSourceView ); + m_pDragSourceView = new SdrView( pView->GetModel() ); + lcl_InitMarks( *m_pDragSourceView, *pView, pView->GetTab() ); //! add as listener with document, delete pDragSourceView if document gone } void ScDrawTransferObj::SetDragSourceObj( SdrObject* pObj, SCTAB nTab ) { - DELETEZ( pDragSourceView ); - pDragSourceView = new SdrView( pObj->GetModel() ); - pDragSourceView->ShowSdrPage(pDragSourceView->GetModel()->GetPage(nTab)); - SdrPageView* pPV = pDragSourceView->GetSdrPageView(); - pDragSourceView->MarkObj(pObj, pPV); + DELETEZ( m_pDragSourceView ); + m_pDragSourceView = new SdrView( pObj->GetModel() ); + m_pDragSourceView->ShowSdrPage(m_pDragSourceView->GetModel()->GetPage(nTab)); + SdrPageView* pPV = m_pDragSourceView->GetSdrPageView(); + m_pDragSourceView->MarkObj(pObj, pPV); //! add as listener with document, delete pDragSourceView if document gone } void ScDrawTransferObj::SetDragSourceFlags(ScDragSrc nFlags) { - nDragSourceFlags = nFlags; + m_nDragSourceFlags = nFlags; } void ScDrawTransferObj::SetDragWasInternal() { - bDragWasInternal = true; + m_bDragWasInternal = true; } const OUString& ScDrawTransferObj::GetShellID() const @@ -668,7 +668,7 @@ SdrOle2Obj* ScDrawTransferObj::GetSingleObject() { // if single OLE object was copied, get its object - SdrPage* pPage = pModel->GetPage(0); + SdrPage* pPage = m_pModel->GetPage(0); if (pPage) { SdrObjListIter aIter( *pPage, SdrIterMode::Flat ); @@ -684,7 +684,7 @@ SdrOle2Obj* ScDrawTransferObj::GetSingleObject() void ScDrawTransferObj::CreateOLEData() { - if (aOleData.GetTransferable().is()) + if (m_aOleData.GetTransferable().is()) // Already created. return; @@ -699,17 +699,17 @@ void ScDrawTransferObj::CreateOLEData() pEmbedTransfer->SetParentShellID(maShellID); - aOleData = TransferableDataHelper(pEmbedTransfer); + m_aOleData = TransferableDataHelper(pEmbedTransfer); } // initialize aDocShellRef with a live document from the ClipDoc void ScDrawTransferObj::InitDocShell() { - if ( !aDocShellRef.is() ) + if ( !m_aDocShellRef.is() ) { ScDocShell* pDocSh = new ScDocShell; - aDocShellRef = pDocSh; // ref must be there before InitNew + m_aDocShellRef = pDocSh; // ref must be there before InitNew pDocSh->DoInitNew(); @@ -722,8 +722,8 @@ void ScDrawTransferObj::InitDocShell() SdrView aDestView( pDestModel ); aDestView.ShowSdrPage(aDestView.GetModel()->GetPage(0)); aDestView.Paste( - *pModel, - Point(aSrcSize.Width()/2, aSrcSize.Height()/2), + *m_pModel, + Point(m_aSrcSize.Width()/2, m_aSrcSize.Height()/2), nullptr, SdrInsertFlags::NONE); // put objects to right layer (see ScViewFunc::PasteDataFormat for SotClipboardFormatId::DRAWING) @@ -744,7 +744,7 @@ void ScDrawTransferObj::InitDocShell() } Point aTmpPoint; - tools::Rectangle aDestArea( aTmpPoint, aSrcSize ); + tools::Rectangle aDestArea( aTmpPoint, m_aSrcSize ); pDocSh->SetVisArea( aDestArea ); ScViewOptions aViewOpt( rDestDoc.GetViewOptions() ); diff --git a/sc/source/ui/inc/drwtrans.hxx b/sc/source/ui/inc/drwtrans.hxx index be1137ed37e8..586b3e910b38 100644 --- a/sc/source/ui/inc/drwtrans.hxx +++ b/sc/source/ui/inc/drwtrans.hxx @@ -41,23 +41,23 @@ enum class ScDragSrc; class ScDrawTransferObj : public TransferableHelper { private: - SdrModel* pModel; - TransferableDataHelper aOleData; - TransferableObjectDescriptor aObjDesc; - SfxObjectShellRef aDocShellRef; - SfxObjectShellRef aDrawPersistRef; + SdrModel* m_pModel; + TransferableDataHelper m_aOleData; + TransferableObjectDescriptor m_aObjDesc; + SfxObjectShellRef m_aDocShellRef; + SfxObjectShellRef m_aDrawPersistRef; // extracted from model in ctor: - Size aSrcSize; - INetBookmark* pBookmark; - bool bGraphic; - bool bGrIsBit; - bool bOleObj; + Size m_aSrcSize; + INetBookmark* m_pBookmark; + bool m_bGraphic; + bool m_bGrIsBit; + bool m_bOleObj; // source information for drag&drop: // (view is needed to handle drawing obejcts) - SdrView* pDragSourceView; - ScDragSrc nDragSourceFlags; - bool bDragWasInternal; + SdrView* m_pDragSourceView; + ScDragSrc m_nDragSourceFlags; + bool m_bDragWasInternal; ScRangeListVector m_aProtectedChartRangesVector; @@ -79,7 +79,7 @@ public: const css::datatransfer::DataFlavor& rFlavor ) override; virtual void DragFinished( sal_Int8 nDropAction ) override; - SdrModel* GetModel() { return pModel; } + SdrModel* GetModel() { return m_pModel; } void SetDrawPersist( const SfxObjectShellRef& rRef ); void SetDragSource( const ScDrawView* pView ); @@ -89,8 +89,8 @@ public: const OUString& GetShellID() const; - SdrView* GetDragSourceView() { return pDragSourceView; } - ScDragSrc GetDragSourceFlags() const { return nDragSourceFlags; } + SdrView* GetDragSourceView() { return m_pDragSourceView; } + ScDragSrc GetDragSourceFlags() const { return m_nDragSourceFlags; } static ScDrawTransferObj* GetOwnClipboard( vcl::Window* ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits