diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-11-14 18:53:16 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-11-24 07:43:07 +0100 |
commit | 2ca32d2905aaf42ca3feaae04a55500c708fe8ad (patch) | |
tree | 54f26a1bdbb787c6a0a61a7353509d30d7f90256 /sw/source/uibase/dochdl | |
parent | 5166efaa646fdb53345009529ba2005abf9fb6c2 (diff) |
Turn SW_MOD macro to a function
Change-Id: Ide1f6fd2fc8a80b31353a14e416505a2349cea2b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177071
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/source/uibase/dochdl')
-rw-r--r-- | sw/source/uibase/dochdl/swdtflvr.cxx | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 9e2bded63797..f6b1e9d9377a 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -300,8 +300,7 @@ SwTransferable::~SwTransferable() } m_aDocShellRef.Clear(); - SwModule* pMod = SW_MOD(); - if(pMod) + if (SwModule* pMod = SwModule::get()) { if ( pMod->m_pDragDrop == this ) pMod->m_pDragDrop = nullptr; @@ -321,7 +320,7 @@ static SwDoc& lcl_GetDoc(SwDocFac & rDocFac) void SwTransferable::ObjectReleased() { - SwModule *pMod = SW_MOD(); + SwModule* pMod = SwModule::get(); if (!pMod) return; if( this == pMod->m_pDragDrop ) @@ -333,8 +332,7 @@ void SwTransferable::ObjectReleased() void SwTransferable::AddSupportedFormats() { // only need if we are the current XSelection Object - SwModule *pMod = SW_MOD(); - if( this == pMod->m_pXSelection || comphelper::LibreOfficeKit::isActive()) + if (this == SwModule::get()->m_pXSelection || comphelper::LibreOfficeKit::isActive()) { SetDataForDragAndDrop( Point( 0,0) ); } @@ -1710,7 +1708,7 @@ bool SwTransferable::PasteData( const TransferableDataHelper& rData, { SwWait aWait( *rSh.GetView().GetDocShell(), false ); std::unique_ptr<SwTrnsfrActionAndUndo, o3tl::default_delete<SwTrnsfrActionAndUndo>> pAction; - SwModule* pMod = SW_MOD(); + SwModule* pMod = SwModule::get(); bool bRet = false; bool bCallAutoCaption = false; @@ -3759,7 +3757,7 @@ void SwTransferable::StartDrag( vcl::Window* pWin, const Point& rPos ) if( m_pWrtShell->IsSelFrameMode() ) m_pWrtShell->ShowCursor(); - SW_MOD()->m_pDragDrop = this; + SwModule::get()->m_pDragDrop = this; SetDataForDragAndDrop( rPos ); @@ -4396,19 +4394,18 @@ bool SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, void SwTransferable::CreateSelection( SwWrtShell& rSh, const SwFrameShell * _pCreatorView ) { - SwModule *pMod = SW_MOD(); rtl::Reference<SwTransferable> pNew = new SwTransferable( rSh ); pNew->m_pCreatorView = _pCreatorView; - pMod->m_pXSelection = pNew.get(); + SwModule::get()->m_pXSelection = pNew.get(); pNew->CopyToPrimarySelection(); } void SwTransferable::ClearSelection( const SwWrtShell& rSh, const SwFrameShell * _pCreatorView) { - SwModule *pMod = SW_MOD(); + SwModule* pMod = SwModule::get(); if( pMod->m_pXSelection && ((!pMod->m_pXSelection->m_pWrtShell) || (pMod->m_pXSelection->m_pWrtShell == &rSh)) && (!_pCreatorView || (pMod->m_pXSelection->m_pCreatorView == _pCreatorView)) ) |