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 | |
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')
53 files changed, 174 insertions, 169 deletions
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx index 0e4545a83027..4bbd44ce78b1 100644 --- a/sw/source/uibase/app/docsh.cxx +++ b/sw/source/uibase/app/docsh.cxx @@ -215,9 +215,9 @@ bool SwDocShell::ConvertFrom( SfxMedium& rMedium ) } SwWait aWait( *this, true ); + SwModule* mod = SwModule::get(); // Suppress SfxProgress, when we are Embedded - SW_MOD()->SetEmbeddedLoadSave( - SfxObjectCreateMode::EMBEDDED == GetCreateMode() ); + mod->SetEmbeddedLoadSave(SfxObjectCreateMode::EMBEDDED == GetCreateMode()); pRdr->GetDoc().getIDocumentSettingAccess().set(DocumentSettingId::HTML_MODE, dynamic_cast< const SwWebDocShell *>( this ) != nullptr); @@ -243,7 +243,7 @@ bool SwDocShell::ConvertFrom( SfxMedium& rMedium ) pRdr.reset(); - SW_MOD()->SetEmbeddedLoadSave( false ); + mod->SetEmbeddedLoadSave(false); SetError(nErr); bool bOk = !nErr.IsError(); @@ -280,6 +280,7 @@ bool SwDocShell::Save() ErrCode nVBWarning = ERRCODE_NONE; if( SfxObjectShell::Save() ) { + SwModule* mod = SwModule::get(); switch( GetCreateMode() ) { case SfxObjectCreateMode::INTERNAL: @@ -299,7 +300,7 @@ bool SwDocShell::Save() case SfxObjectCreateMode::EMBEDDED: // Suppress SfxProgress, if we are Embedded - SW_MOD()->SetEmbeddedLoadSave( true ); + mod->SetEmbeddedLoadSave(true); [[fallthrough]]; case SfxObjectCreateMode::STANDARD: @@ -334,7 +335,7 @@ bool SwDocShell::Save() } break; } - SW_MOD()->SetEmbeddedLoadSave( false ); + mod->SetEmbeddedLoadSave(false); } SetError(nErr ? nErr : nVBWarning); @@ -527,9 +528,9 @@ bool SwDocShell::SaveAs( SfxMedium& rMedium ) Link<bool,void> aOldOLELnk( m_xDoc->GetOle2Link() ); m_xDoc->SetOle2Link( Link<bool,void>() ); + SwModule* mod = SwModule::get(); // Suppress SfxProgress when we are Embedded - SW_MOD()->SetEmbeddedLoadSave( - SfxObjectCreateMode::EMBEDDED == GetCreateMode() ); + mod->SetEmbeddedLoadSave(SfxObjectCreateMode::EMBEDDED == GetCreateMode()); WriterRef xWrt; ::GetXMLWriter(std::u16string_view(), rMedium.GetBaseURL(true), xWrt); @@ -554,7 +555,7 @@ bool SwDocShell::SaveAs( SfxMedium& rMedium ) } m_xDoc->SetOle2Link( aOldOLELnk ); - SW_MOD()->SetEmbeddedLoadSave( false ); + mod->SetEmbeddedLoadSave(false); // Increase RSID m_xDoc->setRsid( m_xDoc->getRsid() ); @@ -752,9 +753,9 @@ bool SwDocShell::ConvertTo( SfxMedium& rMedium ) xWriter->SetAsciiOptions( aOpt ); } + SwModule* mod = SwModule::get(); // Suppress SfxProgress when we are Embedded - SW_MOD()->SetEmbeddedLoadSave( - SfxObjectCreateMode::EMBEDDED == GetCreateMode()); + mod->SetEmbeddedLoadSave(SfxObjectCreateMode::EMBEDDED == GetCreateMode()); // Span Context in order to suppress the Selection's View ErrCodeMsg nErrno; @@ -804,7 +805,7 @@ bool SwDocShell::ConvertTo( SfxMedium& rMedium ) } } - SW_MOD()->SetEmbeddedLoadSave( false ); + mod->SetEmbeddedLoadSave(false); SetError(nErrno ? nErrno : nVBWarning); if( !rMedium.IsStorage() ) rMedium.CloseOutStream(); @@ -879,7 +880,7 @@ void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup, pDev->SetBackground(); const bool bWeb = dynamic_cast< const SwWebDocShell *>( this ) != nullptr; SwPrintData aOpts; - SwViewShell::PrtOle2(m_xDoc.get(), SW_MOD()->GetUsrPref(bWeb), aOpts, *pDev, aRect, bOutputForScreen); + SwViewShell::PrtOle2(m_xDoc.get(), SwModule::get()->GetUsrPref(bWeb), aOpts, *pDev, aRect, bOutputForScreen); pDev->Pop(); if( pOrig ) @@ -1180,7 +1181,7 @@ void SwDocShell::SetView(SwView* pVw) // Set view-specific redline author. const OUString& rRedlineAuthor = m_pView->GetRedlineAuthor(); if (!rRedlineAuthor.isEmpty()) - SW_MOD()->SetRedlineAuthor(m_pView->GetRedlineAuthor()); + SwModule::get()->SetRedlineAuthor(m_pView->GetRedlineAuthor()); } else m_pWrtShell = nullptr; diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index a252737fa8a4..733121e9dd0e 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -252,7 +252,7 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) case SfxEventHintId::OpenDoc: { uno::Sequence< css::uno::Any > aArgs; - SW_MOD()->CallAutomationApplicationEventSinks( u"DocumentChange"_ustr, aArgs ); + SwModule::get()->CallAutomationApplicationEventSinks(u"DocumentChange"_ustr, aArgs); break; } default: @@ -266,7 +266,7 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) uno::Any aDocument; aDocument <<= mxAutomationDocumentObject; uno::Sequence< uno::Any > aArgs{ aDocument }; - SW_MOD()->CallAutomationApplicationEventSinks( u"NewDocument"_ustr, aArgs ); + SwModule::get()->CallAutomationApplicationEventSinks( u"NewDocument"_ustr, aArgs ); } break; case SfxEventHintId::OpenDoc: @@ -274,7 +274,7 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) uno::Any aDocument; aDocument <<= mxAutomationDocumentObject; uno::Sequence< uno::Any > aArgs{ aDocument }; - SW_MOD()->CallAutomationApplicationEventSinks( u"DocumentOpen"_ustr, aArgs ); + SwModule::get()->CallAutomationApplicationEventSinks( u"DocumentOpen"_ustr, aArgs ); } break; default: @@ -365,7 +365,7 @@ bool SwDocShell::PrepareClose( bool bUI ) uno::Any(false) }; - SW_MOD()->CallAutomationApplicationEventSinks( u"DocumentBeforeClose"_ustr, aArgs ); + SwModule::get()->CallAutomationApplicationEventSinks(u"DocumentBeforeClose"_ustr, aArgs); // If the Cancel argument was set to True by an event handler, return false. bool bCancel(false); diff --git a/sw/source/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx index 8605ce7fba92..90d9629b1d2f 100644 --- a/sw/source/uibase/app/docshini.cxx +++ b/sw/source/uibase/app/docshini.cxx @@ -105,6 +105,7 @@ bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) if ( GetCreateMode() == SfxObjectCreateMode::EMBEDDED ) SwTransferable::InitOle( this ); + SwModule* mod = SwModule::get(); // set forbidden characters if necessary const bool bFuzzing = comphelper::IsFuzzing(); if (!bFuzzing) @@ -120,14 +121,14 @@ bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) m_xDoc->getIDocumentSettingAccess().set(DocumentSettingId::KERN_ASIAN_PUNCTUATION, !SvxAsianConfig::IsKerningWesternTextOnly()); m_xDoc->getIDocumentSettingAccess().setCharacterCompressionType(SvxAsianConfig::GetCharDistanceCompression()); - m_xDoc->getIDocumentDeviceAccess().setPrintData(*SW_MOD()->GetPrtOptions(bWeb)); + m_xDoc->getIDocumentDeviceAccess().setPrintData(*mod->GetPrtOptions(bWeb)); } SubInitNew(); // for all - SwStdFontConfig* pStdFont = SW_MOD()->GetStdFontConfig(); + SwStdFontConfig* pStdFont = mod->GetStdFontConfig(); SfxPrinter* pPrt = m_xDoc->getIDocumentDeviceAccess().getPrinter( false ); OUString sEntry; @@ -287,7 +288,7 @@ bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) // (old documents, where this property was not yet implemented, will get the // value 'false' in the SwDoc c-tor) m_xDoc->getIDocumentSettingAccess().set( DocumentSettingId::MATH_BASELINE_ALIGNMENT, - SW_MOD()->GetUsrPref( bWeb )->IsAlignMathObjectsToBaseline() ); + mod->GetUsrPref( bWeb )->IsAlignMathObjectsToBaseline() ); m_xDoc->getIDocumentSettingAccess().set( DocumentSettingId::FOOTNOTE_IN_COLUMN_TO_PAGEEND, true); } @@ -381,7 +382,7 @@ SwDocShell::~SwDocShell() void SwDocShell::Init_Impl() { - SetPool(&SW_MOD()->GetPool()); + SetPool(&SwModule::get()->GetPool()); SetBaseModel(new SwXTextDocument(this)); // we, as BroadCaster also become our own Listener // (for DocInfo/FileNames/...) @@ -497,6 +498,7 @@ bool SwDocShell::Load( SfxMedium& rMedium ) m_nUpdateDocMode = pUpdateDocItem ? pUpdateDocItem->GetValue() : document::UpdateDocMode::NO_UPDATE; } + SwModule* mod = SwModule::get(); SwWait aWait( *this, true ); ErrCodeMsg nErr = ERR_SWG_READ_ERROR; switch( GetCreateMode() ) @@ -519,7 +521,7 @@ bool SwDocShell::Load( SfxMedium& rMedium ) SwTransferable::InitOle( this ); } // suppress SfxProgress, when we are Embedded - SW_MOD()->SetEmbeddedLoadSave( true ); + mod->SetEmbeddedLoadSave( true ); [[fallthrough]]; case SfxObjectCreateMode::STANDARD: @@ -568,7 +570,7 @@ bool SwDocShell::Load( SfxMedium& rMedium ) } // suppress SfxProgress, when we are Embedded - SW_MOD()->SetEmbeddedLoadSave( false ); + mod->SetEmbeddedLoadSave( false ); } return bRet; @@ -669,7 +671,7 @@ void SwDocShell::SubInitNew() aDfltSet.Put( aHyp ); - sal_uInt16 nNewPos = o3tl::toTwips(SW_MOD()->GetUsrPref(false)->GetDefTabInMm100(), o3tl::Length::mm100); + sal_uInt16 nNewPos = o3tl::toTwips(SwModule::get()->GetUsrPref(false)->GetDefTabInMm100(), o3tl::Length::mm100); if( nNewPos ) aDfltSet.Put( SvxTabStopItem( 1, nNewPos, SvxTabAdjust::Default, RES_PARATR_TABSTOP ) ); @@ -681,7 +683,7 @@ void SwDocShell::SubInitNew() //default page mode for text grid if(!bWeb) { - bool bSquaredPageMode = SW_MOD()->GetUsrPref(false)->IsSquaredPageMode(); + bool bSquaredPageMode = SwModule::get()->GetUsrPref(false)->IsSquaredPageMode(); m_xDoc->SetDefaultPageMode( bSquaredPageMode ); // only set Widow/Orphan defaults on a new, non-web document - not an opened one diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index 6bc5e0b56ae2..ecdb14726e37 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -695,7 +695,7 @@ IMPL_LINK_NOARG(ApplyStyle, ApplyHdl, LinkParamNone*, void) aUsrPref.SetKeepRatio(pBoolItem->GetValue()); if (pBoolItem->GetValue() != pVOpt->IsKeepRatio()) { - SW_MOD()->ApplyUsrPref(aUsrPref, &pWrtShell->GetView()); + SwModule::get()->ApplyUsrPref(aUsrPref, &pWrtShell->GetView()); } } } @@ -984,7 +984,7 @@ void SwDocShell::Edit( PutItem(SfxUInt16Item(SID_HTML_MODE, nHtmlMode)); FieldUnit eMetric = ::GetDfltMetric(0 != (HTMLMODE_ON&nHtmlMode)); - SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); + SwModule::get()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast<sal_uInt16>(eMetric))); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); if (!pDialogParent) { diff --git a/sw/source/uibase/app/mainwn.cxx b/sw/source/uibase/app/mainwn.cxx index 7c21797f8e3d..fce2d12970a1 100644 --- a/sw/source/uibase/app/mainwn.cxx +++ b/sw/source/uibase/app/mainwn.cxx @@ -52,7 +52,7 @@ static SwProgress *lcl_SwFindProgress( SwDocShell const *pDocShell ) void StartProgress( TranslateId pMessResId, tools::Long nStartValue, tools::Long nEndValue, SwDocShell *pDocShell ) { - if( SW_MOD()->IsEmbeddedLoadSave() ) + if (SwModule::get()->IsEmbeddedLoadSave()) return; SwProgress *pProgress = nullptr; @@ -81,7 +81,7 @@ void StartProgress( TranslateId pMessResId, tools::Long nStartValue, tools::Long void SetProgressState( tools::Long nPosition, SwDocShell const *pDocShell ) { - if( pProgressContainer && !SW_MOD()->IsEmbeddedLoadSave() ) + if (pProgressContainer && !SwModule::get()->IsEmbeddedLoadSave()) { SwProgress *pProgress = lcl_SwFindProgress( pDocShell ); if ( pProgress ) @@ -91,7 +91,7 @@ void SetProgressState( tools::Long nPosition, SwDocShell const *pDocShell ) void EndProgress( SwDocShell const *pDocShell ) { - if( !pProgressContainer || SW_MOD()->IsEmbeddedLoadSave() ) + if (!pProgressContainer || SwModule::get()->IsEmbeddedLoadSave()) return; SwProgress *pProgress = nullptr; @@ -122,7 +122,7 @@ void EndProgress( SwDocShell const *pDocShell ) void RescheduleProgress( SwDocShell const *pDocShell ) { - if( pProgressContainer && !SW_MOD()->IsEmbeddedLoadSave() ) + if (pProgressContainer && !SwModule::get()->IsEmbeddedLoadSave()) { SwProgress *pProgress = lcl_SwFindProgress( pDocShell ); if ( pProgress ) diff --git a/sw/source/uibase/app/swdll.cxx b/sw/source/uibase/app/swdll.cxx index 89f7b0b6cd71..a0d0d35773dd 100644 --- a/sw/source/uibase/app/swdll.cxx +++ b/sw/source/uibase/app/swdll.cxx @@ -156,7 +156,7 @@ SwDLL::~SwDLL() COVERITY_NOEXCEPT_FALSE } // Pool has to be deleted before statics are - SW_MOD()->RemoveAttrPool(); + SwModule::get()->RemoveAttrPool(); ::FinitUI(); m_pFilters.reset(); diff --git a/sw/source/uibase/app/swmodul1.cxx b/sw/source/uibase/app/swmodul1.cxx index be12a460ab6d..96bde7096a1b 100644 --- a/sw/source/uibase/app/swmodul1.cxx +++ b/sw/source/uibase/app/swmodul1.cxx @@ -432,15 +432,15 @@ static Color lcl_GetAuthorColor(std::size_t nPos) // same as SwPostItMgr::GetColorAnchor() switch (nPos % 9) { - case 0: return SW_MOD()->GetColorConfig().GetColorValue(svtools::AUTHOR1).nColor; - case 1: return SW_MOD()->GetColorConfig().GetColorValue(svtools::AUTHOR2).nColor; - case 2: return SW_MOD()->GetColorConfig().GetColorValue(svtools::AUTHOR3).nColor; - case 3: return SW_MOD()->GetColorConfig().GetColorValue(svtools::AUTHOR4).nColor; - case 4: return SW_MOD()->GetColorConfig().GetColorValue(svtools::AUTHOR5).nColor; - case 5: return SW_MOD()->GetColorConfig().GetColorValue(svtools::AUTHOR6).nColor; - case 6: return SW_MOD()->GetColorConfig().GetColorValue(svtools::AUTHOR7).nColor; - case 7: return SW_MOD()->GetColorConfig().GetColorValue(svtools::AUTHOR8).nColor; - case 8: return SW_MOD()->GetColorConfig().GetColorValue(svtools::AUTHOR9).nColor; + case 0: return SwModule::get()->GetColorConfig().GetColorValue(svtools::AUTHOR1).nColor; + case 1: return SwModule::get()->GetColorConfig().GetColorValue(svtools::AUTHOR2).nColor; + case 2: return SwModule::get()->GetColorConfig().GetColorValue(svtools::AUTHOR3).nColor; + case 3: return SwModule::get()->GetColorConfig().GetColorValue(svtools::AUTHOR4).nColor; + case 4: return SwModule::get()->GetColorConfig().GetColorValue(svtools::AUTHOR5).nColor; + case 5: return SwModule::get()->GetColorConfig().GetColorValue(svtools::AUTHOR6).nColor; + case 6: return SwModule::get()->GetColorConfig().GetColorValue(svtools::AUTHOR7).nColor; + case 7: return SwModule::get()->GetColorConfig().GetColorValue(svtools::AUTHOR8).nColor; + case 8: return SwModule::get()->GetColorConfig().GetColorValue(svtools::AUTHOR9).nColor; default: return COL_AUTO; // silence -Wreturn-type } } diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx index 737fe747a112..98d4364fcdd9 100644 --- a/sw/source/uibase/app/swmodule.cxx +++ b/sw/source/uibase/app/swmodule.cxx @@ -168,12 +168,12 @@ SwModule::SwModule( SfxObjectFactory* pWebFact, OUString SwResId(TranslateId aId) { - return Translate::get(aId, SW_MOD()->GetResLocale()); + return Translate::get(aId, SwModule::get()->GetResLocale()); } OUString SwResId(TranslateNId aContextSingularPlural, int nCardinality) { - return Translate::nget(aContextSingularPlural, nCardinality, SW_MOD()->GetResLocale()); + return Translate::nget(aContextSingularPlural, nCardinality, SwModule::get()->GetResLocale()); } uno::Reference< scanner::XScannerManager2 > const & @@ -229,7 +229,7 @@ void SwDLL::RegisterFactories() void SwDLL::RegisterInterfaces() { - SwModule* pMod = SW_MOD(); + SwModule* pMod = SwModule::get(); SwModule::RegisterInterface( pMod ); SwDocShell::RegisterInterface( pMod ); SwWebDocShell::RegisterInterface( pMod ); @@ -266,7 +266,7 @@ void SwDLL::RegisterInterfaces() void SwDLL::RegisterControls() { - SwModule* pMod = SW_MOD(); + SwModule* pMod = SwModule::get(); SvxTbxCtlDraw::RegisterControl(SID_INSERT_DRAW, pMod ); SvxTbxCtlDraw::RegisterControl(SID_TRACK_CHANGES_BAR, pMod ); diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index 79193c08eff5..757eba8c24c7 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -1627,7 +1627,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, pViewFrame = SfxViewFrame::GetNext(*pViewFrame, pSourceDocSh); } - SW_MOD()->SetView(&pSourceShell->GetView()); + SwModule::get()->SetView(&pSourceShell->GetView()); if( xMailDispatcher.is() ) { @@ -2532,7 +2532,7 @@ SwDSParam* SwDBManager::FindDSConnection(const OUString& rDataSource, bool bCre const SwDBData& SwDBManager::GetAddressDBName() { - return SW_MOD()->GetDBConfig()->GetAddressSource(); + return SwModule::get()->GetDBConfig()->GetAddressSource(); } uno::Sequence<OUString> SwDBManager::GetExistingDatabaseNames() 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)) ) diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx index 4979045c48dd..03f3e5030ed6 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -383,7 +383,7 @@ void SwAnnotationWin::InitControls() } mpOutliner->SetControlWord(nCntrl); - std::size_t aIndex = SW_MOD()->InsertRedlineAuthor(GetAuthor()); + std::size_t aIndex = SwModule::get()->InsertRedlineAuthor(GetAuthor()); SetColor( SwPostItMgr::GetColorDark(aIndex), SwPostItMgr::GetColorLight(aIndex), SwPostItMgr::GetColorAnchor(aIndex)); @@ -457,7 +457,7 @@ void SwAnnotationWin::CheckMetaText() void SwAnnotationWin::UpdateColors() { - std::size_t aIndex = SW_MOD()->InsertRedlineAuthor(GetAuthor()); + std::size_t aIndex = SwModule::get()->InsertRedlineAuthor(GetAuthor()); SetColor( SwPostItMgr::GetColorDark(aIndex), SwPostItMgr::GetColorLight(aIndex), SwPostItMgr::GetColorAnchor(aIndex)); diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index 177d52c9777b..7ee85f5c7690 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -380,7 +380,7 @@ SwPostItMgr::SwPostItMgr(SwView* pView) mpView->GetWrtShell().MakeDrawView(); //make sure we get the colour yellow always, even if not the first one of comments or redlining - SW_MOD()->GetRedlineAuthor(); + SwModule::get()->GetRedlineAuthor(); // collect all PostIts and redline comments that exist after loading the document // don't check for existence for any of them, don't focus them diff --git a/sw/source/uibase/docvw/edtdd.cxx b/sw/source/uibase/docvw/edtdd.cxx index 287d2969f632..72e50a65599e 100644 --- a/sw/source/uibase/docvw/edtdd.cxx +++ b/sw/source/uibase/docvw/edtdd.cxx @@ -249,9 +249,9 @@ sal_Int8 SwEditWin::ExecuteDrop( const ExecuteDropEvent& rEvt ) if( !SwTransferable::PasteData( aData, rSh, m_nDropAction, nActionFlags, m_nDropFormat, m_nDropDestination, false, rEvt.mbDefault, &aDocPt, nRet)) nRet = DND_ACTION_NONE; - else if ( SW_MOD()->m_pDragDrop ) + else if (SwModule* mod = SwModule::get(); mod->m_pDragDrop) //Don't clean up anymore at internal D&D! - SW_MOD()->m_pDragDrop->SetCleanUp( false ); + mod->m_pDragDrop->SetCleanUp(false); return nRet; } @@ -400,7 +400,7 @@ sal_Int8 SwEditWin::AcceptDrop( const AcceptDropEvent& rEvt ) const Point aDocPt( PixelToLogic( aPixPt ) ); //With the default action we still want to have a say. - SwModule *pMod = SW_MOD(); + SwModule* pMod = SwModule::get(); if( pMod->m_pDragDrop ) { bool bCleanup = false; diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 7680cc4ebb0e..7d71f58bd363 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -1667,7 +1667,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) pACorr = pACfg->GetAutoCorrect(); } - SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig(); + SwModuleOptions* pModOpt = SwModule::get()->GetModuleConfig(); OUString sFormulaEntry; @@ -4334,7 +4334,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) if(aRelPos.X() >= 0) { FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( &GetView()) != nullptr ); - SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); + SwModule::get()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); const SfxPointItem aTmp1( SID_ATTR_POSITION, aRelPos ); rBnd.SetState( aTmp1 ); } diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx index d8d7f7ec2057..11b3b3d4d9d1 100644 --- a/sw/source/uibase/docvw/edtwin2.cxx +++ b/sw/source/uibase/docvw/edtwin2.cxx @@ -533,7 +533,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) default: { - SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig(); + SwModuleOptions* pModOpt = SwModule::get()->GetModuleConfig(); if(!pModOpt->IsHideFieldTips()) { const SwField* pField = aContentAtPos.aFnd.pField; diff --git a/sw/source/uibase/docvw/edtwin3.cxx b/sw/source/uibase/docvw/edtwin3.cxx index 423b6a53847e..4a60637c9624 100644 --- a/sw/source/uibase/docvw/edtwin3.cxx +++ b/sw/source/uibase/docvw/edtwin3.cxx @@ -106,7 +106,7 @@ bool SwEditWin::RulerMarginDrag( const MouseEvent& rMEvt, TableChgMode GetTableChgDefaultMode() { - SwModuleOptions* pOpt = SW_MOD()->GetModuleConfig(); + SwModuleOptions* pOpt = SwModule::get()->GetModuleConfig(); return pOpt ? pOpt->GetTableMode() : TableChgMode::VarWidthChangeAbs; } diff --git a/sw/source/uibase/docvw/romenu.cxx b/sw/source/uibase/docvw/romenu.cxx index fb8d20d0e525..ae59afcc1abc 100644 --- a/sw/source/uibase/docvw/romenu.cxx +++ b/sw/source/uibase/docvw/romenu.cxx @@ -100,7 +100,7 @@ SwReadOnlyPopup::SwReadOnlyPopup(const Point &rDPos, SwView &rV) , m_rView(rV) , m_xBrushItem(std::make_unique<SvxBrushItem>(RES_BACKGROUND)) { - m_bGrfToGalleryAsLnk = SW_MOD()->GetModuleConfig()->IsGrfToGalleryAsLnk(); + m_bGrfToGalleryAsLnk = SwModule::get()->GetModuleConfig()->IsGrfToGalleryAsLnk(); SwWrtShell &rSh = m_rView.GetWrtShell(); OUString sDescription; rSh.IsURLGrfAtPos( rDPos, &m_sURL, &m_sTargetFrameName, &sDescription ); @@ -303,9 +303,9 @@ void SwReadOnlyPopup::Execute( vcl::Window* pWin, sal_uInt16 nId ) else if (nId == m_nReadonlyGraphicoff) nExecId = FN_VIEW_GRAPHIC; else if (nId == m_nReadonlyTogallerylink || nId == m_nReadonlyBackgroundTogallerylink) - SW_MOD()->GetModuleConfig()->SetGrfToGalleryAsLnk(true); + SwModule::get()->GetModuleConfig()->SetGrfToGalleryAsLnk(true); else if (nId == m_nReadonlyTogallerycopy || nId == m_nReadonlyBackgroundTogallerycopy) - SW_MOD()->GetModuleConfig()->SetGrfToGalleryAsLnk(false); + SwModule::get()->GetModuleConfig()->SetGrfToGalleryAsLnk(false); if( USHRT_MAX != nExecId ) rDis.GetBindings()->Execute( nExecId ); diff --git a/sw/source/uibase/docvw/srcedtw.cxx b/sw/source/uibase/docvw/srcedtw.cxx index 1fdc55838f29..8f6224682a61 100644 --- a/sw/source/uibase/docvw/srcedtw.cxx +++ b/sw/source/uibase/docvw/srcedtw.cxx @@ -700,7 +700,7 @@ void SwSrcEditWindow::ImpDoHighlight( std::u16string_view aSource, sal_uInt16 nL r.eType != svtools::HTMLKEYWORD && r.eType != svtools::HTMLUNKNOWN) r.eType = svtools::HTMLUNKNOWN; - Color aColor(SW_MOD()->GetColorConfig().GetColorValue(r.eType).nColor); + Color aColor(SwModule::get()->GetColorConfig().GetColorValue(r.eType).nColor); m_pTextEngine->SetAttrib( TextAttribFontColor( aColor ), nLineOff, r.nStart, r.nEnd+1 ); } } diff --git a/sw/source/uibase/envelp/envimg.cxx b/sw/source/uibase/envelp/envimg.cxx index c78ed3ea7f73..d1ca1ab1ad23 100644 --- a/sw/source/uibase/envelp/envimg.cxx +++ b/sw/source/uibase/envelp/envimg.cxx @@ -44,7 +44,7 @@ SfxPoolItem* SwEnvItem::CreateDefault() { return new SwEnvItem; } OUString MakeSender() { - SvtUserOptions& rUserOpt = SW_MOD()->GetUserOptions(); + SvtUserOptions& rUserOpt = SwModule::get()->GetUserOptions(); const OUString sSenderToken(SwResId(STR_SENDER_TOKENS)); if (sSenderToken.isEmpty()) diff --git a/sw/source/uibase/envelp/labimg.cxx b/sw/source/uibase/envelp/labimg.cxx index f2aed778f921..4fb5829bea24 100644 --- a/sw/source/uibase/envelp/labimg.cxx +++ b/sw/source/uibase/envelp/labimg.cxx @@ -366,7 +366,7 @@ SwLabCfgItem::SwLabCfgItem(bool bLabel) : if(m_bIsLabel || !bNoConfigValues) return; - SvtUserOptions& rUserOpt = SW_MOD()->GetUserOptions(); + SvtUserOptions& rUserOpt = SwModule::get()->GetUserOptions(); m_aItem.m_aPrivFirstName = rUserOpt.GetFirstName(); m_aItem.m_aPrivName = rUserOpt.GetLastName(); m_aItem.m_aPrivShortCut = rUserOpt.GetID(); diff --git a/sw/source/uibase/lingu/olmenu.cxx b/sw/source/uibase/lingu/olmenu.cxx index 0c737246317c..e2a992e841c7 100644 --- a/sw/source/uibase/lingu/olmenu.cxx +++ b/sw/source/uibase/lingu/olmenu.cxx @@ -292,7 +292,7 @@ SwSpellPopup::SwSpellPopup( m_xPopupMenu->EnableItem(m_nCorrectMenuId, bEnable); - uno::Reference< linguistic2::XLanguageGuessing > xLG = SW_MOD()->GetLanguageGuesser(); + uno::Reference<linguistic2::XLanguageGuessing> xLG = SwModule::get()->GetLanguageGuesser(); LanguageType nGuessLangWord = LANGUAGE_NONE; LanguageType nGuessLangPara = LANGUAGE_NONE; if (m_xSpellAlt.is() && xLG.is()) @@ -502,7 +502,7 @@ SwSpellPopup::SwSpellPopup( m_xPopupMenu->EnableItem(m_nCorrectMenuId, false); m_xPopupMenu->EnableItem(m_nCorrectDialogId, false); - uno::Reference< linguistic2::XLanguageGuessing > xLG = SW_MOD()->GetLanguageGuesser(); + uno::Reference<linguistic2::XLanguageGuessing> xLG = SwModule::get()->GetLanguageGuesser(); LanguageType nGuessLangWord = LANGUAGE_NONE; LanguageType nGuessLangPara = LANGUAGE_NONE; if (xLG.is()) diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index 2282174ae9aa..d1180be8271a 100644 --- a/sw/source/uibase/misc/redlndlg.cxx +++ b/sw/source/uibase/misc/redlndlg.cxx @@ -256,7 +256,7 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(std::shared_ptr<weld::Window> xParent, we m_aSelectTimer.SetInvokeHandler(LINK(this, SwRedlineAcceptDlg, GotoHdl)); // we want to receive SfxHintId::SwRedlineContentAtPos - StartListening(*(SW_MOD()->GetView()->GetDocShell())); + StartListening(*(SwModule::get()->GetView()->GetDocShell())); } SwRedlineAcceptDlg::~SwRedlineAcceptDlg() @@ -561,7 +561,7 @@ void SwRedlineAcceptDlg::Activate() } // check comment - bool bIsShowChangesInMargin = SW_MOD()->GetUsrPref(false)->IsShowChangesInMargin(); + bool bIsShowChangesInMargin = SwModule::get()->GetUsrPref(false)->IsShowChangesInMargin(); for (SwRedlineTable::size_type i = 0; i < nCount; i++) { const SwRangeRedline& rRedln = pSh->GetRedline(i); @@ -919,7 +919,7 @@ void SwRedlineAcceptDlg::InsertParents(SwRedlineTable::size_type nStart, SwRedli if (m_pTable->IsSorted()) rTreeView.make_unsorted(); - bool bIsShowChangesInMargin = SW_MOD()->GetUsrPref(false)->IsShowChangesInMargin(); + bool bIsShowChangesInMargin = SwModule::get()->GetUsrPref(false)->IsShowChangesInMargin(); // collect redlines of tracked table/row/column insertion/deletions under a single tree list // item to accept/reject the table change with a single click on Accept/Reject @@ -1653,7 +1653,7 @@ SwRedlineAcceptPanel::SwRedlineAcceptPanel(weld::Widget* pParent) mpImplDlg->Init(); // we want to receive SfxHintId::DocChanged - StartListening(*(SW_MOD()->GetView()->GetDocShell())); + StartListening(*(SwModule::get()->GetView()->GetDocShell())); } SwRedlineAcceptPanel::~SwRedlineAcceptPanel() diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index 4d225dfc8aaa..8b30443a241c 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -497,7 +497,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) /* mod SwView* pView = &GetView(); FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( pView) != nullptr ); - SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, eMetric)); + SwModule::get()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, eMetric)); */ SfxItemSetFixed<XATTR_FILLSTYLE, XATTR_FILLCOLOR, EE_ITEMS_START, EE_ITEMS_END> aDlgAttr(GetPool()); @@ -550,7 +550,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) /* mod todo ??? SwView* pView = &GetView(); FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( pView) != nullptr ); - SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, eMetric)); + SwModule::get()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, eMetric)); */ SfxItemSetFixed< EE_ITEMS_START, EE_ITEMS_END, diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index b7012e9274d7..739b12cb251b 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -2413,7 +2413,7 @@ void SwBaseShell::ExecTextCtrl( SfxRequest& rReq ) if(nInputLang != LANGUAGE_DONTKNOW && nInputLang != LANGUAGE_SYSTEM) nScripts = SvtLanguageOptions::GetScriptTypeOfLanguage( nInputLang ); sal_uInt32 nHeight = static_cast< const SvxFontHeightItem& >(pArgs->Get( nWhich )).GetHeight(); - SwStdFontConfig* pStdFont = SW_MOD()->GetStdFontConfig(); + SwStdFontConfig* pStdFont = SwModule::get()->GetStdFontConfig(); SfxItemSetFixed<RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE, RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_LANGUAGE, @@ -3083,7 +3083,7 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest ) if( !pArgs && rSh.IsSelection() && !rSh.IsInClickToEdit() && !rSh.IsTableMode() ) { - const SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig(); + const SwModuleOptions* pModOpt = SwModule::get()->GetModuleConfig(); SwInsertTableOptions aInsTableOpts = pModOpt->GetInsTableFlags(bHTMLMode); rSh.StartUndo(SwUndoId::INSTABLE); @@ -3140,7 +3140,7 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest ) aInsTableOptsIn.mnInsMode = static_cast<SwInsertTableFlags>(pFlags->GetValue()); else { - const SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig(); + const SwModuleOptions* pModOpt = SwModule::get()->GetModuleConfig(); aInsTableOptsIn = pModOpt->GetInsTableFlags(bHTMLMode); } } diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx index dd93cb847387..e66d3e98021f 100644 --- a/sw/source/uibase/shells/drawsh.cxx +++ b/sw/source/uibase/shells/drawsh.cxx @@ -290,7 +290,7 @@ void SwDrawShell::Execute(SfxRequest &rReq) case SID_FONTWORK: { FieldUnit eMetric = ::GetDfltMetric( dynamic_cast<SwWebView*>( &rSh.GetView()) != nullptr ); - SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) ); + SwModule::get()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) ); SfxViewFrame& rVFrame = GetView().GetViewFrame(); if (pArgs) { diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx index 2c59cfe8ffa0..d0ee5e477bdb 100644 --- a/sw/source/uibase/shells/drwbassh.cxx +++ b/sw/source/uibase/shells/drwbassh.cxx @@ -217,7 +217,7 @@ void SwDrawBaseShell::Execute(SfxRequest& rReq) const WhichRangesContainer aRange = pDlg->GetInputRanges( *aNewAttr.GetPool() ); SfxItemSet aSet( *aNewAttr.GetPool(), aRange ); FieldUnit eMetric = ::GetDfltMetric( dynamic_cast<SwWebView*>(&GetView()) != nullptr ); - SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) ); + SwModule::get()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) ); aSet.Put( aNewAttr, false ); diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index 38d2a8521057..b3f152cf51a5 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -378,7 +378,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) SwView& rView = GetView(); FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>(&rView) != nullptr); - SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) ); + SwModule::get()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) ); SfxItemSetFixed<XATTR_FILLSTYLE, XATTR_FILLCOLOR, EE_ITEMS_START, EE_ITEMS_END> aDlgAttr(GetPool()); // util::Language does not exists in the EditEngine! That is why not in set. @@ -454,7 +454,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) { SwView& rView = GetView(); FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>(&rView) != nullptr); - SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) ); + SwModule::get()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) ); SfxItemSetFixed< EE_ITEMS_START, EE_ITEMS_END, SID_ATTR_PARA_HYPHENZONE, SID_ATTR_PARA_WIDOWS> aDlgAttr( GetPool() ); diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx index 0b50fe3b94b0..21a11a9f53f0 100644 --- a/sw/source/uibase/shells/drwtxtsh.cxx +++ b/sw/source/uibase/shells/drwtxtsh.cxx @@ -175,7 +175,7 @@ void SwDrawTextShell::ExecFontWork(SfxRequest const & rReq) { SwWrtShell &rSh = GetShell(); FieldUnit eMetric = ::GetDfltMetric( dynamic_cast<SwWebView*>( &rSh.GetView()) != nullptr ); - SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) ); + SwModule::get()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast<sal_uInt16>(eMetric))); SfxViewFrame& rVFrame = GetView().GetViewFrame(); if ( rReq.GetArgs() ) { diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx index d1790ed10bdf..8f613c9a83f1 100644 --- a/sw/source/uibase/shells/frmsh.cxx +++ b/sw/source/uibase/shells/frmsh.cxx @@ -511,7 +511,8 @@ void SwFrameShell::Execute(SfxRequest &rReq) aSet.Put(SfxFrameItem( SID_DOCFRAME, &GetView().GetViewFrame().GetFrame())); FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( &GetView()) != nullptr ); - SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric) )); + SwModule* mod = SwModule::get(); + mod->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast<sal_uInt16>(eMetric))); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateFrameTabDialog( nSel & SelectionType::Graphic ? u"PictureDialog"_ustr : @@ -540,7 +541,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) { SwViewOption aUsrPref( *pVOpt ); aUsrPref.SetKeepRatio(pRatioItem->GetValue()); - SW_MOD()->ApplyUsrPref(aUsrPref, &GetView()); + mod->ApplyUsrPref(aUsrPref, &GetView()); } if (const SfxStringItem* pAltNameItem = pOutSet->GetItemIfSet(FN_SET_FRM_ALT_NAME)) { diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx index d7d53292a80a..c508b0d4e86c 100644 --- a/sw/source/uibase/shells/grfsh.cxx +++ b/sw/source/uibase/shells/grfsh.cxx @@ -295,7 +295,8 @@ void SwGrfShell::Execute(SfxRequest &rReq) sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell()); aSet.Put(SfxUInt16Item(SID_HTML_MODE, nHtmlMode)); FieldUnit eMetric = ::GetDfltMetric(0 != (nHtmlMode&HTMLMODE_ON)); - SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) ); + SwModule* mod = SwModule::get(); + mod->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast<sal_uInt16>(eMetric))); const SwRect* pRect = &rSh.GetAnyCurRect(CurRectType::Page); SwFormatFrameSize aFrameSize( SwFrameSize::Variable, pRect->Width(), pRect->Height()); @@ -468,7 +469,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) } if( bApplyUsrPref ) - SW_MOD()->ApplyUsrPref(aUsrPref, &GetView()); + mod->ApplyUsrPref(aUsrPref, &GetView()); // and now set all the graphic attributes and other stuff if( const SvxBrushItem* pGraphicBrushItem = pSet->GetItemIfSet( diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index 581e494cb3c7..577be8fe0369 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -278,7 +278,7 @@ void ItemSetToTableParam( const SfxItemSet& rSet, { SwViewOption aUsrPref( *rSh.GetViewOptions() ); aUsrPref.SetTableDest(static_cast<sal_uInt8>(pDestItem->GetValue())); - SW_MOD()->ApplyUsrPref(aUsrPref, &rSh.GetView()); + SwModule::get()->ApplyUsrPref(aUsrPref, &rSh.GetView()); } bool bBorder = ( SfxItemState::SET == rSet.GetItemState( RES_BOX ) || SfxItemState::SET == rSet.GetItemState( SID_ATTR_BORDER_INNER ) ); @@ -606,7 +606,7 @@ void SwTableShell::Execute(SfxRequest &rReq) SfxItemSet aCoreSet( GetPool(), aUITableAttrRange); FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( &rSh.GetView()) != nullptr ); - SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); + SwModule::get()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); std::shared_ptr<SwTableRep> xTableRep(::lcl_TableParamToItemSet(aCoreSet, rSh)); aCoreSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell()))); @@ -688,7 +688,7 @@ void SwTableShell::Execute(SfxRequest &rReq) if (SwView* pView = GetActiveView()) { FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( pView) != nullptr ); - SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); + SwModule::get()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); SvNumberFormatter* pFormatter = rSh.GetNumberFormatter(); auto pCoreSet = std::make_shared<SfxItemSetFixed<SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_INFO>>( GetPool() ); diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index dfd5591b6e46..d313c899f659 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -526,7 +526,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) auto xSet = CreateInsertFrameItemSet(aMgr); FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebDocShell*>( GetView().GetDocShell()) != nullptr ); - SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); + SwModule::get()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateFrameTabDialog(u"FrameDialog"_ustr, GetView().GetViewFrame(), diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index c9b9ceb60e38..2b3614437a79 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -164,7 +164,7 @@ static void sw_CharDialog(SwWrtShell& rWrtSh, bool bUseDialog, bool bApplyToPara sal_uInt16 nSlot, const SfxItemSet* pArgs, SfxRequest* pReq) { FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( &rWrtSh.GetView()) != nullptr ); - SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); + SwModule::get()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast<sal_uInt16>(eMetric))); auto pCoreSet = std::make_shared<SfxItemSetFixed< RES_CHRATR_BEGIN, RES_CHRATR_END - 1, RES_TXTATR_INETFMT, RES_TXTATR_INETFMT, @@ -1653,10 +1653,11 @@ void SwTextShell::Execute(SfxRequest &rReq) pPaM = rWrtSh.GetCursor(); FieldUnit eMetric = ::GetDfltMetric( dynamic_cast<SwWebView*>( &GetView()) != nullptr ); - SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); + SwModule* mod = SwModule::get(); + mod->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast<sal_uInt16>(eMetric))); bool bApplyCharUnit = ::HasCharUnit( dynamic_cast<SwWebView*>( &GetView()) != nullptr ); - SW_MOD()->PutItem(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, bApplyCharUnit)); + mod->PutItem(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, bApplyCharUnit)); SfxItemSetFixed< RES_PARATR_BEGIN, RES_FRMATR_END - 1, diff --git a/sw/source/uibase/sidebar/TableEditPanel.cxx b/sw/source/uibase/sidebar/TableEditPanel.cxx index a3c376835768..cee7dfeba5f7 100644 --- a/sw/source/uibase/sidebar/TableEditPanel.cxx +++ b/sw/source/uibase/sidebar/TableEditPanel.cxx @@ -188,7 +188,7 @@ void TableEditPanel::InitRowHeightToolitem() Link<weld::MetricSpinButton&, void> aLink = LINK(this, TableEditPanel, RowHeightMofiyHdl); m_aRowHeightEdit.connect_value_changed(aLink); - FieldUnit eFieldUnit = SW_MOD()->GetUsrPref(false)->GetMetric(); + FieldUnit eFieldUnit = SwModule::get()->GetUsrPref(false)->GetMetric(); m_aRowHeightEdit.SetFieldUnit(eFieldUnit); m_aRowHeightEdit.set_min(MINLAY, FieldUnit::TWIP); @@ -202,7 +202,7 @@ void TableEditPanel::InitColumnWidthToolitem() Link<weld::MetricSpinButton&, void> aLink = LINK(this, TableEditPanel, ColumnWidthMofiyHdl); m_aColumnWidthEdit.connect_value_changed(aLink); - FieldUnit eFieldUnit = SW_MOD()->GetUsrPref(false)->GetMetric(); + FieldUnit eFieldUnit = SwModule::get()->GetUsrPref(false)->GetMetric(); m_aColumnWidthEdit.SetFieldUnit(eFieldUnit); m_aColumnWidthEdit.set_min(MINLAY, FieldUnit::TWIP); @@ -229,7 +229,7 @@ void TableEditPanel::InitAlignmentControls() m_xAlignment->append(OUString::number(text::HoriOrientation::NONE), SwResId(STR_TABLE_PANEL_ALIGN_MANUAL)); - FieldUnit eFieldUnit = SW_MOD()->GetUsrPref(false)->GetMetric(); + FieldUnit eFieldUnit = SwModule::get()->GetUsrPref(false)->GetMetric(); m_aLeftSpacingEdit.SetFieldUnit(eFieldUnit); m_aRightSpacingEdit.SetFieldUnit(eFieldUnit); } diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index 6fb310455a6f..aca313a9bc1b 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -178,7 +178,7 @@ SwPagePreviewWin::SwPagePreviewWin( vcl::Window *pParent, SwPagePreview& rPView GetOutDev()->SetLineColor( GetBackground().GetColor()); SetMapMode( MapMode(MapUnit::MapTwip) ); - const SwMasterUsrPref *pUsrPref = SW_MOD()->GetUsrPref(false); + const SwMasterUsrPref* pUsrPref = SwModule::get()->GetUsrPref(false); mnRow = pUsrPref->GetPagePrevRow(); // 1 row mnCol = pUsrPref->GetPagePrevCol(); // 1 column mnSttPage = USHRT_MAX; @@ -516,7 +516,7 @@ void SwPagePreviewWin::MouseButtonDown( const MouseEvent& rMEvt ) void SwPagePreviewWin::SetPagePreview( sal_Int16 nRow, sal_Int16 nCol ) { - SwMasterUsrPref *pOpt = const_cast<SwMasterUsrPref *>(SW_MOD()->GetUsrPref(false)); + SwMasterUsrPref* pOpt = const_cast<SwMasterUsrPref*>(SwModule::get()->GetUsrPref(false)); if (nRow != pOpt->GetPagePrevRow() || nCol != pOpt->GetPagePrevCol()) { @@ -1093,7 +1093,8 @@ void SwPagePreview::Init() // the handler, because the shell is unknown to the SFX management // within the CTOR phase. - const SwViewOption * pPrefs = SW_MOD()->GetUsrPref(false); + SwModule* mod = SwModule::get(); + const SwViewOption* pPrefs = mod->GetUsrPref(false); mbHScrollbarEnabled = pPrefs->IsViewHScrollBar(); mbVScrollbarEnabled = pPrefs->IsViewVScrollBar(); @@ -1135,7 +1136,7 @@ void SwPagePreview::Init() #endif // adjust view shell option to the same as for print - SwPrintData const aPrintOptions = *SW_MOD()->GetPrtOptions(false); + SwPrintData const aPrintOptions = *mod->GetPrtOptions(false); GetViewShell()->AdjustOptionsForPagePreview( aPrintOptions ); GetViewShell()->CalcLayout(); diff --git a/sw/source/uibase/uiview/uivwimp.cxx b/sw/source/uibase/uiview/uivwimp.cxx index ed0c3c68fcfc..01dc4f856c06 100644 --- a/sw/source/uibase/uiview/uivwimp.cxx +++ b/sw/source/uibase/uiview/uivwimp.cxx @@ -104,7 +104,7 @@ void SwView_Impl::ExecuteScan( SfxRequest& rReq ) case SID_TWAIN_SELECT: { bool bDone = false; - Reference< XScannerManager2 > xScanMgr = SW_MOD()->GetScannerManager(); + Reference<XScannerManager2> xScanMgr = SwModule::get()->GetScannerManager(); if( xScanMgr.is() ) { @@ -152,7 +152,7 @@ void SwView_Impl::ExecuteScan( SfxRequest& rReq ) { bool bDone = false; - Reference< XScannerManager2 > xScanMgr = SW_MOD()->GetScannerManager(); + Reference<XScannerManager2> xScanMgr = SwModule::get()->GetScannerManager(); if( xScanMgr.is() ) { SwScannerEventListener& rListener = GetScannerEventListener(); diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index 02722177646d..f2fef7d341e0 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -326,7 +326,7 @@ void SwView::SelectShell() { SfxDispatcher &rDispatcher = GetDispatcher(); - SwToolbarConfigItem *pBarCfg = SW_MOD()->GetToolbarConfig(); + SwToolbarConfigItem* pBarCfg = SwModule::get()->GetToolbarConfig(); if ( m_pShell ) { @@ -850,7 +850,7 @@ SwView::SwView(SfxViewFrame& _rFrame, SfxViewShell* pOldSh) rDocSh.UpdateFontList(); bool bWebDShell = dynamic_cast<const SwWebDocShell*>(&rDocSh) != nullptr; - const SwMasterUsrPref *pUsrPref = SW_MOD()->GetUsrPref(bWebDShell); + const SwMasterUsrPref* pUsrPref = SwModule::get()->GetUsrPref(bWebDShell); SwViewOption aUsrPref( *pUsrPref); //! get lingu options without loading lingu DLL @@ -1144,7 +1144,7 @@ SwViewGlueDocShell::SwViewGlueDocShell(SwView& rView, SwDocShell& rDocSh) { // Set DocShell rDocSh.SetView(&m_rView); - SW_MOD()->SetView(&m_rView); + SwModule::get()->SetView(&m_rView); } SwViewGlueDocShell::~SwViewGlueDocShell() @@ -1152,8 +1152,8 @@ SwViewGlueDocShell::~SwViewGlueDocShell() SwDocShell* pDocSh = m_rView.GetDocShell(); if (pDocSh && pDocSh->GetView() == &m_rView) pDocSh->SetView(nullptr); - if (SW_MOD()->GetView() == &m_rView) - SW_MOD()->SetView(nullptr); + if (SwModule* mod = SwModule::get(); mod->GetView() == &m_rView) + mod->SetView(nullptr); } SwView::~SwView() @@ -1289,7 +1289,7 @@ static bool lcl_IsOwnDocument( SwView& rView ) = xDPS->getDocumentProperties(); OUString Created = xDocProps->getAuthor(); OUString Changed = xDocProps->getModifiedBy(); - OUString FullName = SW_MOD()->GetUserOptions().GetFullName(); + OUString FullName = SwModule::get()->GetUserOptions().GetFullName(); return !FullName.isEmpty() && (Changed == FullName || (Changed.isEmpty() && Created == FullName)); } @@ -1573,7 +1573,7 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue > // Got a custom value, then it makes sense to trigger notifications. SwViewOption aUsrPref(*pVOpt); aUsrPref.SetKeepRatio(bKeepRatio); - SW_MOD()->ApplyUsrPref(aUsrPref, this); + SwModule::get()->ApplyUsrPref(aUsrPref, this); } // Set ViewLayoutSettings @@ -1582,7 +1582,7 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue > const bool bSetViewSettings = bGotZoomType && bGotZoomFactor && ( pVOpt->GetZoom() != nZoomFactor || pVOpt->GetZoomType() != eZoom ) && - SW_MOD()->GetUsrPref(pVOpt->getBrowseMode())->IsDefaultZoom(); + SwModule::get()->GetUsrPref(pVOpt->getBrowseMode())->IsDefaultZoom(); // In case we have a 'fixed' view layout of 2 or more columns, // we have to apply the view options *before* starting the action. @@ -1852,8 +1852,7 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) void SwView::ScannerEventHdl() { - uno::Reference< XScannerManager2 > xScanMgr = SW_MOD()->GetScannerManager(); - if( xScanMgr.is() ) + if (uno::Reference<XScannerManager2> xScanMgr = SwModule::get()->GetScannerManager()) { const ScannerContext aContext( xScanMgr->getAvailableScanners().getConstArray()[ 0 ] ); const ScanError eError = xScanMgr->getError( aContext ); @@ -2126,7 +2125,7 @@ namespace sw { void InitPrintOptionsFromApplication(SwPrintData & o_rData, bool const bWeb) { - o_rData = *SW_MOD()->GetPrtOptions(bWeb); + o_rData = *SwModule::get()->GetPrtOptions(bWeb); } } // namespace sw diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx index 0a0e21a28e68..3b640c179eae 100644 --- a/sw/source/uibase/uiview/view0.cxx +++ b/sw/source/uibase/uiview/view0.cxx @@ -707,7 +707,7 @@ void SwView::ExecViewOptions(SfxRequest &rReq) bool bWebView = dynamic_cast<const SwWebView*>(this) != nullptr; SwWrtShell &rSh = GetWrtShell(); rSh.StartAction(); - SwModule* pModule = SW_MOD(); + SwModule* pModule = SwModule::get(); if( *rSh.GetViewOptions() != *pOpt ) { rSh.ApplyViewOptions( *pOpt ); diff --git a/sw/source/uibase/uiview/view1.cxx b/sw/source/uibase/uiview/view1.cxx index ca51ceba98c7..e18de9600d58 100644 --- a/sw/source/uibase/uiview/view1.cxx +++ b/sw/source/uibase/uiview/view1.cxx @@ -47,8 +47,7 @@ void SwView::Activate(bool bMDIActivate) SwDocShell* pDocSh = GetDocShell(); if(pDocSh) pDocSh->SetView(this); - SwModule* pSwMod = SW_MOD(); - pSwMod->SetView(this); + SwModule::get()->SetView(this); // Document size has changed. if(!bDocSzUpdated) diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index fa4d6b3d7eae..ff795be11827 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -2952,7 +2952,7 @@ namespace return ( !aNames.hasElements() || ( ( 1 == aNames.getLength() ) - && aNames.getConstArray()[0] == SW_MOD()->GetDBConfig()->GetBibliographySource().sDataSource + && aNames.getConstArray()[0] == SwModule::get()->GetDBConfig()->GetBibliographySource().sDataSource ) ); } diff --git a/sw/source/uibase/uiview/viewdlg2.cxx b/sw/source/uibase/uiview/viewdlg2.cxx index 5eb3340627c6..49112bb77495 100644 --- a/sw/source/uibase/uiview/viewdlg2.cxx +++ b/sw/source/uibase/uiview/viewdlg2.cxx @@ -195,7 +195,7 @@ bool SwView::isQRCodeSelected() const void SwView::AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId) { - SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig(); + SwModuleOptions* pModOpt = SwModule::get()->GetModuleConfig(); bool bWeb = dynamic_cast<SwWebView*>( this ) != nullptr; if (pModOpt->IsInsWithCaption(bWeb)) diff --git a/sw/source/uibase/uiview/viewmdi.cxx b/sw/source/uibase/uiview/viewmdi.cxx index f211396116d7..e62c4987ea79 100644 --- a/sw/source/uibase/uiview/viewmdi.cxx +++ b/sw/source/uibase/uiview/viewmdi.cxx @@ -95,7 +95,8 @@ void SwView::SetZoom_( const Size &rEditSize, SvxZoomType eZoomType, tools::Long nFac = nFactor; const bool bWeb = dynamic_cast< const SwWebView *>( this ) != nullptr; - SwMasterUsrPref *pUsrPref = const_cast<SwMasterUsrPref*>(SW_MOD()->GetUsrPref(bWeb)); + SwModule* mod = SwModule::get(); + SwMasterUsrPref *pUsrPref = const_cast<SwMasterUsrPref*>(mod->GetUsrPref(bWeb)); const SwPageDesc &rDesc = m_pWrtShell->GetPageDesc( m_pWrtShell->GetCurPageDesc() ); const SvxLRSpaceItem &rLRSpace = rDesc.GetMaster().GetLRSpace(); @@ -167,7 +168,7 @@ void SwView::SetZoom_( const Size &rEditSize, SvxZoomType eZoomType, { pUsrPref->SetZoom(nZoomFac); pUsrPref->SetZoomType(eZoomType); - SW_MOD()->ApplyUsrPref(*pUsrPref, nullptr); + mod->ApplyUsrPref(*pUsrPref, nullptr); pUsrPref->SetModified(); } if ( pOpt->GetZoom() != nZoomFac ) @@ -227,7 +228,8 @@ void SwView::SetViewLayout( sal_uInt16 nColumns, bool bBookMode, bool bViewOnly if ( !GetViewFrame().GetFrame().IsInPlace() && !bViewOnly ) { const bool bWeb = dynamic_cast< const SwWebView *>( this ) != nullptr; - SwMasterUsrPref *pUsrPref = const_cast<SwMasterUsrPref*>(SW_MOD()->GetUsrPref(bWeb)); + SwModule* mod = SwModule::get(); + SwMasterUsrPref *pUsrPref = const_cast<SwMasterUsrPref*>(mod->GetUsrPref(bWeb)); // Update MasterUsrPrefs and after that update the ViewOptions of the current View. if ( nColumns != pUsrPref->GetViewLayoutColumns() || @@ -235,7 +237,7 @@ void SwView::SetViewLayout( sal_uInt16 nColumns, bool bBookMode, bool bViewOnly { pUsrPref->SetViewLayoutColumns(nColumns); pUsrPref->SetViewLayoutBookMode(bBookMode); - SW_MOD()->ApplyUsrPref(*pUsrPref, nullptr); + mod->ApplyUsrPref(*pUsrPref, nullptr); pUsrPref->SetModified(); } } diff --git a/sw/source/uibase/uiview/viewprt.cxx b/sw/source/uibase/uiview/viewprt.cxx index 1d19a897c034..aca4407a5264 100644 --- a/sw/source/uibase/uiview/viewprt.cxx +++ b/sw/source/uibase/uiview/viewprt.cxx @@ -79,7 +79,7 @@ SfxPrinter* SwView::GetPrinter( bool bCreate ) void SetPrinter( IDocumentDeviceAccess* pIDDA, SfxPrinter const * pNew, bool bWeb ) { - SwPrintOptions* pOpt = SW_MOD()->GetPrtOptions(bWeb); + SwPrintOptions* pOpt = SwModule::get()->GetPrtOptions(bWeb); if( !pOpt) return; @@ -177,7 +177,7 @@ void SwView::ExecutePrint(SfxRequest& rReq) { case FN_FAX: { - SwPrintOptions* pPrintOptions = SW_MOD()->GetPrtOptions(bWeb); + SwPrintOptions* pPrintOptions = SwModule::get()->GetPrtOptions(bWeb); const OUString& sFaxName(pPrintOptions->GetFaxName()); if (!sFaxName.isEmpty()) { @@ -214,7 +214,7 @@ void SwView::ExecutePrint(SfxRequest& rReq) bool bFromMerge = pPrintFromMergeItem && pPrintFromMergeItem->GetValue(); bool bPrintSelection = false; if(!bSilent && !bFromMerge && - SW_MOD()->GetModuleConfig()->IsAskForMailMerge() && pSh->IsAnyDatabaseFieldInDoc()) + SwModule::get()->GetModuleConfig()->IsAskForMailMerge() && pSh->IsAnyDatabaseFieldInDoc()) { std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetEditWin().GetFrameWeld(), u"modules/swriter/ui/printmergedialog.ui"_ustr)); std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog(u"PrintMergeDialog"_ustr)); diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx index d1e3f102f967..866e1a9fa99a 100644 --- a/sw/source/uibase/uiview/viewstat.cxx +++ b/sw/source/uibase/uiview/viewstat.cxx @@ -301,7 +301,7 @@ void SwView::GetState(SfxItemSet &rSet) case SID_TWAIN_TRANSFER: #if defined(_WIN32) || defined UNX { - if(!SW_MOD()->GetScannerManager().is()) + if (!SwModule::get()->GetScannerManager().is()) rSet.DisableItem(nWhich); } #endif diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx index 713dea75838f..2d6c636f0bc9 100644 --- a/sw/source/uibase/uno/unomod.cxx +++ b/sw/source/uibase/uno/unomod.cxx @@ -270,7 +270,7 @@ void SwXPrintSettings::_preSetValues () switch (meType) { case SwXPrintSettingsType::Module: - mpPrtOpt = SW_MOD()->GetPrtOptions( false ); + mpPrtOpt = SwModule::get()->GetPrtOptions(false); break; case SwXPrintSettingsType::Document: { @@ -407,7 +407,7 @@ void SwXPrintSettings::_preGetValues() switch (meType) { case SwXPrintSettingsType::Module: - mpPrtOpt = SW_MOD()->GetPrtOptions( false ); + mpPrtOpt = SwModule::get()->GetPrtOptions(false); break; case SwXPrintSettingsType::Document: { @@ -543,7 +543,7 @@ void SwXViewSettings::_preSetValues () pVOpt = m_pView->GetWrtShell().GetViewOptions(); } else - pVOpt = SW_MOD()->GetViewOption(false); + pVOpt = SwModule::get()->GetViewOption(false); mpViewOption.reset( new SwViewOption (*pVOpt) ); mbApplyZoom = false; @@ -758,6 +758,7 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c void SwXViewSettings::_postSetValues() { + SwModule* mod = SwModule::get(); if( m_pView ) { if(mbApplyZoom ) @@ -772,12 +773,12 @@ void SwXViewSettings::_postSetValues() else { if(mbApplyHRulerMetric) - SW_MOD()->ApplyRulerMetric( m_eHRulerUnit, true, false ); + mod->ApplyRulerMetric(m_eHRulerUnit, true, false); if(mbApplyVRulerMetric) - SW_MOD()->ApplyRulerMetric( m_eVRulerUnit, false, false ); + mod->ApplyRulerMetric(m_eVRulerUnit, false, false); } - SW_MOD()->ApplyUsrPref( *mpViewOption, m_pView, m_pView ? SvViewOpt::DestViewOnly + mod->ApplyUsrPref( *mpViewOption, m_pView, m_pView ? SvViewOpt::DestViewOnly : SvViewOpt::DestText ); mpViewOption.reset(); @@ -792,7 +793,7 @@ void SwXViewSettings::_preGetValues () mpConstViewOption = m_pView->GetWrtShell().GetViewOptions(); } else - mpConstViewOption = SW_MOD()->GetViewOption(false); + mpConstViewOption = SwModule::get()->GetViewOption(false); } void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, uno::Any & rValue ) @@ -909,7 +910,7 @@ void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, u } else { - const SwMasterUsrPref* pUsrPref = SW_MOD()->GetUsrPref( false ); + const SwMasterUsrPref* pUsrPref = SwModule::get()->GetUsrPref(false); rValue <<= static_cast<sal_Int32>(pUsrPref->GetHScrollMetric()); } bBool = false; @@ -925,7 +926,7 @@ void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, u } else { - const SwMasterUsrPref* pUsrPref = SW_MOD()->GetUsrPref( false ); + const SwMasterUsrPref* pUsrPref = SwModule::get()->GetUsrPref(false); rValue <<= static_cast<sal_Int32>(pUsrPref->GetVScrollMetric()); } bBool = false; diff --git a/sw/source/uibase/uno/unomodule.cxx b/sw/source/uibase/uno/unomodule.cxx index 714ae5d5ec1c..202e876f3b26 100644 --- a/sw/source/uibase/uno/unomodule.cxx +++ b/sw/source/uibase/uno/unomodule.cxx @@ -52,14 +52,15 @@ void SAL_CALL SwUnoModule::dispatchWithNotification( const util::URL& aURL, cons SolarMutexGuard aGuard; SwGlobals::ensure(); - const SfxSlot* pSlot = SW_MOD()->GetInterface()->GetSlot( aURL.Complete ); + SwModule* mod = SwModule::get(); + const SfxSlot* pSlot = mod->GetInterface()->GetSlot(aURL.Complete); sal_Int16 aState = frame::DispatchResultState::DONTKNOW; if ( !pSlot ) aState = frame::DispatchResultState::FAILURE; else { - SfxRequest aReq( pSlot, aArgs, SfxCallMode::SYNCHRON, SW_MOD()->GetPool() ); + SfxRequest aReq(pSlot, aArgs, SfxCallMode::SYNCHRON, mod->GetPool()); SfxAllItemSet aInternalSet( SfxGetpApp()->GetPool() ); css::uno::Reference<css::frame::XDesktop2> xDesktop = css::frame::Desktop::create(::comphelper::getProcessComponentContext()); @@ -68,7 +69,7 @@ void SAL_CALL SwUnoModule::dispatchWithNotification( const util::URL& aURL, cons aInternalSet.Put(SfxUnoFrameItem(SID_FILLFRAME, xCurrentFrame)); aReq.SetInternalArgs_Impl(aInternalSet); - const SfxPoolItemHolder& rResult(SW_MOD()->ExecuteSlot(aReq)); + const SfxPoolItemHolder& rResult(mod->ExecuteSlot(aReq)); if (rResult) aState = frame::DispatchResultState::SUCCESS; else @@ -123,7 +124,7 @@ uno::Reference< frame::XDispatch > SAL_CALL SwUnoModule::queryDispatch( SolarMutexGuard aGuard; SwGlobals::ensure(); - const SfxSlot* pSlot = SW_MOD()->GetInterface()->GetSlot( aURL.Complete ); + const SfxSlot* pSlot = SwModule::get()->GetInterface()->GetSlot(aURL.Complete); if ( pSlot ) xReturn = this; diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 2c5d72edaff2..148cb4de6189 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -1944,7 +1944,7 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, const Any& { OUString sDelim; aValue >>= sDelim; - SW_MOD()->GetModuleConfig()->SetWordDelimiter(sDelim); + SwModule::get()->GetModuleConfig()->SetWordDelimiter(sDelim); } break; case WID_DOC_CHANGES_RECORD: @@ -1991,7 +1991,7 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, const Any& } break; case WID_DOC_HIDE_TIPS : - SW_MOD()->GetModuleConfig()->SetHideFieldTips(*o3tl::doAccess<bool>(aValue)); + SwModule::get()->GetModuleConfig()->SetHideFieldTips(*o3tl::doAccess<bool>(aValue)); break; case WID_DOC_REDLINE_DISPLAY: { @@ -2167,9 +2167,7 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName) } break; case WID_DOC_WORD_SEPARATOR : - { - aAny <<= SW_MOD()->GetDocStatWordDelim(); - } + aAny <<= SwModule::get()->GetDocStatWordDelim(); break; case WID_DOC_CHANGES_RECORD: case WID_DOC_CHANGES_SHOW: @@ -2194,7 +2192,7 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName) aAny <<= GetDocOrThrow().GetTOIAutoMarkURL(); break; case WID_DOC_HIDE_TIPS : - aAny <<= SW_MOD()->GetModuleConfig()->IsHideFieldTips(); + aAny <<= SwModule::get()->GetModuleConfig()->IsHideFieldTips(); break; case WID_DOC_REDLINE_DISPLAY: { @@ -3450,7 +3448,7 @@ void SwXTextDocument::getTrackedChanges(tools::JsonWriter& rJson) void SwXTextDocument::getTrackedChangeAuthors(tools::JsonWriter& rJsonWriter) { - SW_MOD()->GetRedlineAuthorInfo(rJsonWriter); + SwModule::get()->GetRedlineAuthorInfo(rJsonWriter); } void SwXTextDocument::getRulerState(tools::JsonWriter& rJsonWriter) @@ -3777,7 +3775,7 @@ void SwXTextDocument::initializeForTiledRendering(const css::uno::Sequence<css:: OUString sThemeName; OUString sBackgroundThemeName; - OUString sOrigAuthor = SW_MOD()->GetRedlineAuthor(SW_MOD()->GetRedlineAuthor()); + OUString sOrigAuthor = SwModule::get()->GetRedlineAuthor(SwModule::get()->GetRedlineAuthor()); OUString sAuthor; for (const beans::PropertyValue& rValue : rArguments) diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 722e5bc2e93f..adddc658fba6 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -479,7 +479,7 @@ SwContentType::SwContentType(SwWrtShell* pShell, ContentTypeId nType, sal_uInt8 const int nShift = static_cast<int>(m_nContentType); assert(nShift > -1); const sal_Int32 nMask = 1 << nShift; - const sal_Int32 nBlock = SW_MOD()->GetNavigationConfig()->GetSortAlphabeticallyBlock(); + const sal_Int32 nBlock = SwModule::get()->GetNavigationConfig()->GetSortAlphabeticallyBlock(); m_bAlphabeticSort = nBlock & nMask; FillMemberList(); @@ -1143,7 +1143,7 @@ SwContentTree::SwContentTree(std::unique_ptr<weld::TreeView> xTreeView, SwNaviga , m_sInvisible(SwResId(STR_INVISIBLE)) , m_pHiddenShell(nullptr) , m_pActiveShell(nullptr) - , m_pConfig(SW_MOD()->GetNavigationConfig()) + , m_pConfig(SwModule::get()->GetNavigationConfig()) , m_nActiveBlock(0) , m_nHiddenBlock(0) , m_nEntryCount(0) diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index e8ab96545266..e0c77c357943 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -444,7 +444,7 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent, , m_pContentWrtShell(nullptr) , m_pActContView(nullptr) , m_pCreateView(nullptr) - , m_pConfig(SW_MOD()->GetNavigationConfig()) + , m_pConfig(SwModule::get()->GetNavigationConfig()) , m_rBindings(*_pBindings) , m_bIsZoomedIn(false) , m_bGlobalMode(false) @@ -1282,7 +1282,7 @@ SwNavigatorWin::SwNavigatorWin(SfxBindings* _pBindings, SfxChildWindow* _pMgr, { _pBindings->Invalidate(SID_NAVIGATOR); - SwNavigationConfig* pNaviConfig = SW_MOD()->GetNavigationConfig(); + SwNavigationConfig* pNaviConfig = SwModule::get()->GetNavigationConfig(); SetMinOutputSizePixel(GetOptimalSize()); if (pNaviConfig->IsSmall()) diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx index 86c1c18264ef..ac13b482ea92 100644 --- a/sw/source/uibase/utlui/uitool.cxx +++ b/sw/source/uibase/utlui/uitool.cxx @@ -758,14 +758,14 @@ void SwToSfxPageDescAttr( SfxItemSet& rCoreSet ) FieldUnit GetDfltMetric(bool bWeb) { - return SW_MOD()->GetUsrPref(bWeb)->GetMetric(); + return SwModule::get()->GetUsrPref(bWeb)->GetMetric(); } // Determine metric void SetDfltMetric( FieldUnit eMetric, bool bWeb ) { - SW_MOD()->ApplyUserMetric(eMetric, bWeb); + SwModule::get()->ApplyUserMetric(eMetric, bWeb); } void InsertStringSorted(const OUString& rId, const OUString& rEntry, weld::ComboBox& rToFill, int nOffset) @@ -873,12 +873,12 @@ OUString GetAppLangDateTimeString( const DateTime& rDT ) bool HasCharUnit( bool bWeb) { - return SW_MOD()->GetUsrPref(bWeb)->IsApplyCharUnit(); + return SwModule::get()->GetUsrPref(bWeb)->IsApplyCharUnit(); } void SetApplyCharUnit(bool bApplyChar, bool bWeb) { - SW_MOD()->ApplyUserCharUnit(bApplyChar, bWeb); + SwModule::get()->ApplyUserCharUnit(bApplyChar, bWeb); } bool ExecuteMenuCommand(const css::uno::Reference<css::awt::XPopupMenu>& rMenu, const SfxViewFrame& rViewFrame, sal_uInt16 nId) diff --git a/sw/source/uibase/utlui/unotools.cxx b/sw/source/uibase/utlui/unotools.cxx index 680f4f22c61e..7029b6f29e68 100644 --- a/sw/source/uibase/utlui/unotools.cxx +++ b/sw/source/uibase/utlui/unotools.cxx @@ -92,7 +92,7 @@ SwOneExampleFrame::SwOneExampleFrame(sal_uInt32 nFlags, const Link<SwOneExampleFrame&,void>* pInitializedLink, const OUString* pURL) : m_aLoadedIdle("sw uibase SwOneExampleFrame Loaded") - , m_pModuleView(SW_MOD()->GetView()) + , m_pModuleView(SwModule::get()->GetView()) , m_nStyleFlags(nFlags) , m_bIsInitialized(false) { @@ -141,7 +141,7 @@ void SwOneExampleFrame::Paint(vcl::RenderContext& rRenderContext, const tools::R // invalidate on rRenderContext if it is a vcl::Window, which is the "classic" gen mode m_xVirDev->SetOutputSizePixel(aSize); - Color aBgColor = SW_MOD()->GetColorConfig().GetColorValue(::svtools::DOCCOLOR).nColor; + Color aBgColor = SwModule::get()->GetColorConfig().GetColorValue(::svtools::DOCCOLOR).nColor; m_xVirDev->DrawWallpaper(tools::Rectangle(Point(), aSize), aBgColor); if (m_xCursor) @@ -415,7 +415,7 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer, void ) } } - SW_MOD()->SetView(m_pModuleView); + SwModule::get()->SetView(m_pModuleView); Invalidate(); } diff --git a/sw/source/uibase/web/wview.cxx b/sw/source/uibase/web/wview.cxx index 766c1a5ccb00..2ed240b0252c 100644 --- a/sw/source/uibase/web/wview.cxx +++ b/sw/source/uibase/web/wview.cxx @@ -117,7 +117,7 @@ void SwWebView::SelectShell() else { SfxDispatcher &rDispatcher = *GetViewFrame().GetDispatcher(); - SwToolbarConfigItem *pBarCfg = SW_MOD()->GetWebToolbarConfig(); + SwToolbarConfigItem* pBarCfg = SwModule::get()->GetWebToolbarConfig(); if( GetCurShell() ) { diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index c9651cec90f3..040d3c81ebc7 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -455,7 +455,7 @@ void SwWrtShell::InsertObject( const svt::EmbeddedObjectRef& xRef, SvGlobalName // TODO/LATER: recording! Convert properties to items case SID_INSERT_FLOATINGFRAME: { - SfxSlotPool* pSlotPool = SW_MOD()->GetSlotPool(); + SfxSlotPool* pSlotPool = SwModule::get()->GetSlotPool(); const SfxSlot* pSlot = pSlotPool->GetSlot(nSlotId); OUString aCmd = pSlot->GetCommand(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); @@ -2260,8 +2260,9 @@ void SwWrtShell::InsertPostIt(SwFieldMgr& rFieldMgr, const SfxRequest& rReq) sAuthor = pAuthorItem->GetValue(); else { - std::size_t nAuthor = SW_MOD()->GetRedlineAuthor(); - sAuthor = SW_MOD()->GetRedlineAuthor(nAuthor); + SwModule* mod = SwModule::get(); + std::size_t nAuthor = mod->GetRedlineAuthor(); + sAuthor = mod->GetRedlineAuthor(nAuthor); } const SvxPostItTextItem* pTextItem = rReq.GetArg<SvxPostItTextItem>(SID_ATTR_POSTIT_TEXT); |