sc/inc/scmod.hxx | 4 sc/qa/unit/helper/sorthelper.hxx | 5 sc/qa/unit/jumbosheets-test.cxx | 10 - sc/qa/unit/subsequent_export_test3.cxx | 2 sc/qa/unit/subsequent_filters_test4.cxx | 13 - sc/qa/unit/ucalc_formula.cxx | 2 sc/qa/unit/uicalc/uicalc.cxx | 24 +-- sc/qa/unit/uicalc/uicalc2.cxx | 2 sc/source/core/data/documen2.cxx | 4 sc/source/core/data/documen3.cxx | 2 sc/source/core/data/documen7.cxx | 2 sc/source/core/data/documen8.cxx | 2 sc/source/core/data/document.cxx | 10 - sc/source/core/data/drwlayer.cxx | 2 sc/source/core/data/funcdesc.cxx | 2 sc/source/core/data/global.cxx | 13 - sc/source/core/data/patattr.cxx | 6 sc/source/core/data/table1.cxx | 4 sc/source/core/data/table5.cxx | 5 sc/source/core/tool/addincfg.cxx | 2 sc/source/core/tool/addincol.cxx | 4 sc/source/core/tool/chgtrack.cxx | 10 - sc/source/core/tool/detfunc.cxx | 2 sc/source/core/tool/editutil.cxx | 4 sc/source/core/tool/viewopti.cxx | 2 sc/source/filter/oox/workbookfragment.cxx | 5 sc/source/ui/Accessibility/AccessibleCsvControl.cxx | 4 sc/source/ui/Accessibility/AccessibleDocument.cxx | 2 sc/source/ui/Accessibility/AccessibleEditObject.cxx | 2 sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx | 6 sc/source/ui/Accessibility/AccessibleText.cxx | 2 sc/source/ui/app/drwtrans.cxx | 4 sc/source/ui/app/inputhdl.cxx | 41 ++--- sc/source/ui/app/inputwin.cxx | 50 +++--- sc/source/ui/app/lnktrans.cxx | 3 sc/source/ui/app/rfindlst.cxx | 2 sc/source/ui/app/scdll.cxx | 4 sc/source/ui/app/scmod.cxx | 9 - sc/source/ui/app/seltrans.cxx | 4 sc/source/ui/app/transobj.cxx | 4 sc/source/ui/dbgui/PivotLayoutDialog.cxx | 2 sc/source/ui/dbgui/csvgrid.cxx | 2 sc/source/ui/dbgui/validate.cxx | 2 sc/source/ui/docshell/dbdocfun.cxx | 2 sc/source/ui/docshell/docfunc.cxx | 2 sc/source/ui/docshell/docsh.cxx | 46 +++-- sc/source/ui/docshell/docsh3.cxx | 8 - sc/source/ui/docshell/docsh4.cxx | 22 +- sc/source/ui/docshell/docsh6.cxx | 4 sc/source/ui/docshell/externalrefmgr.cxx | 2 sc/source/ui/docshell/sizedev.cxx | 2 sc/source/ui/drawfunc/fuins2.cxx | 2 sc/source/ui/drawfunc/fusel.cxx | 4 sc/source/ui/formdlg/dwfunctr.cxx | 5 sc/source/ui/formdlg/formula.cxx | 21 +- sc/source/ui/inc/validate.hxx | 2 sc/source/ui/miscdlgs/acredlin.cxx | 2 sc/source/ui/miscdlgs/anyrefdg.cxx | 11 - sc/source/ui/miscdlgs/autofmt.cxx | 2 sc/source/ui/miscdlgs/onlyactivesheetsaveddlg.cxx | 2 sc/source/ui/miscdlgs/warnbox.cxx | 4 sc/source/ui/navipi/content.cxx | 10 - sc/source/ui/navipi/navipi.cxx | 6 sc/source/ui/optdlg/opredlin.cxx | 7 sc/source/ui/optdlg/tpprint.cxx | 2 sc/source/ui/optdlg/tpview.cxx | 7 sc/source/ui/uitest/uiobject.cxx | 4 sc/source/ui/undo/undostyl.cxx | 2 sc/source/ui/unoobj/appluno.cxx | 8 - sc/source/ui/unoobj/confuno.cxx | 2 sc/source/ui/unoobj/docuno.cxx | 30 ++- sc/source/ui/unoobj/textuno.cxx | 2 sc/source/ui/unoobj/viewuno.cxx | 4 sc/source/ui/vba/vbaapplication.cxx | 9 - sc/source/ui/view/cellsh1.cxx | 16 -- sc/source/ui/view/cellsh2.cxx | 6 sc/source/ui/view/cellsh3.cxx | 16 +- sc/source/ui/view/cellsh4.cxx | 4 sc/source/ui/view/colrowba.cxx | 8 - sc/source/ui/view/drawvie4.cxx | 2 sc/source/ui/view/drawview.cxx | 4 sc/source/ui/view/editsh.cxx | 14 - sc/source/ui/view/formatsh.cxx | 6 sc/source/ui/view/gridwin.cxx | 78 +++++----- sc/source/ui/view/gridwin4.cxx | 19 +- sc/source/ui/view/hdrcont.cxx | 19 +- sc/source/ui/view/output.cxx | 30 ++- sc/source/ui/view/output2.cxx | 5 sc/source/ui/view/preview.cxx | 8 - sc/source/ui/view/prevwsh.cxx | 4 sc/source/ui/view/printfun.cxx | 8 - sc/source/ui/view/reffact.cxx | 2 sc/source/ui/view/select.cxx | 17 +- sc/source/ui/view/spelldialog.cxx | 2 sc/source/ui/view/tabcont.cxx | 16 +- sc/source/ui/view/tabview.cxx | 4 sc/source/ui/view/tabview2.cxx | 4 sc/source/ui/view/tabview3.cxx | 41 ++--- sc/source/ui/view/tabview4.cxx | 15 + sc/source/ui/view/tabview5.cxx | 2 sc/source/ui/view/tabvwsh2.cxx | 5 sc/source/ui/view/tabvwsh3.cxx | 10 - sc/source/ui/view/tabvwsh4.cxx | 23 +- sc/source/ui/view/tabvwsh5.cxx | 2 sc/source/ui/view/tabvwsha.cxx | 20 +- sc/source/ui/view/tabvwshb.cxx | 4 sc/source/ui/view/tabvwshc.cxx | 11 - sc/source/ui/view/tabvwshd.cxx | 2 sc/source/ui/view/tabvwshe.cxx | 4 sc/source/ui/view/viewdata.cxx | 10 - sc/source/ui/view/viewfun3.cxx | 6 sc/source/ui/view/viewfun4.cxx | 4 sc/source/ui/view/viewfun5.cxx | 2 sc/source/ui/view/viewfun6.cxx | 2 sc/source/ui/view/viewfun7.cxx | 3 sc/source/ui/view/viewfunc.cxx | 12 - sd/inc/sdmod.hxx | 4 sd/qa/unit/dialogs-test.cxx | 2 sd/source/core/drawdoc.cxx | 8 - sd/source/core/drawdoc3.cxx | 5 sd/source/core/sdpage.cxx | 2 sd/source/filter/eppt/pptx-epptooxml.cxx | 2 sd/source/ui/animations/CustomAnimationPane.cxx | 4 sd/source/ui/animations/SlideTransitionPane.cxx | 4 sd/source/ui/annotations/annotationmanager.cxx | 6 sd/source/ui/app/sdmod.cxx | 4 sd/source/ui/app/sdmod2.cxx | 5 sd/source/ui/app/sdpopup.cxx | 4 sd/source/ui/app/sdxfer.cxx | 4 sd/source/ui/dlg/dlgfield.cxx | 4 sd/source/ui/dlg/headerfooterdlg.cxx | 2 sd/source/ui/dlg/sdtreelb.cxx | 4 sd/source/ui/docshell/docshel3.cxx | 4 sd/source/ui/docshell/docshel4.cxx | 6 sd/source/ui/docshell/docshell.cxx | 2 sd/source/ui/func/fudraw.cxx | 6 sd/source/ui/func/fuexpand.cxx | 2 sd/source/ui/func/fuinsert.cxx | 2 sd/source/ui/func/fuinsfil.cxx | 4 sd/source/ui/func/fusel.cxx | 4 sd/source/ui/func/fusldlg.cxx | 2 sd/source/ui/func/fusumry.cxx | 2 sd/source/ui/func/futempl.cxx | 8 - sd/source/ui/sidebar/LayoutMenu.cxx | 2 sd/source/ui/slideshow/slideshow.cxx | 6 sd/source/ui/slideshow/slideshowimpl.cxx | 6 sd/source/ui/slidesorter/controller/SlideSorterController.cxx | 2 sd/source/ui/slidesorter/controller/SlsClipboard.cxx | 14 - sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx | 2 sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx | 7 sd/source/ui/slidesorter/controller/SlsSlotManager.cxx | 4 sd/source/ui/table/tablefunction.cxx | 2 sd/source/ui/table/tableobjectbar.cxx | 2 sd/source/ui/unoidl/UnoDocumentSettings.cxx | 4 sd/source/ui/unoidl/unomodel.cxx | 2 sd/source/ui/unoidl/unomodule.cxx | 9 - sd/source/ui/unoidl/unoobj.cxx | 4 sd/source/ui/view/NotesPanelView.cxx | 2 sd/source/ui/view/NotesPanelViewShell.cxx | 2 sd/source/ui/view/Outliner.cxx | 6 sd/source/ui/view/ViewClipboard.cxx | 2 sd/source/ui/view/ViewShellBase.cxx | 4 sd/source/ui/view/drviews2.cxx | 4 sd/source/ui/view/drviews4.cxx | 2 sd/source/ui/view/drviews5.cxx | 2 sd/source/ui/view/drviews7.cxx | 2 sd/source/ui/view/drviewsa.cxx | 7 sd/source/ui/view/drviewse.cxx | 2 sd/source/ui/view/drviewsf.cxx | 2 sd/source/ui/view/drviewsg.cxx | 2 sd/source/ui/view/drviewsk.cxx | 2 sd/source/ui/view/frmview.cxx | 2 sd/source/ui/view/outlview.cxx | 2 sd/source/ui/view/sdview.cxx | 2 sd/source/ui/view/sdview2.cxx | 15 + sd/source/ui/view/sdview3.cxx | 15 + sd/source/ui/view/viewshel.cxx | 2 sw/inc/swmodule.hxx | 7 sw/qa/core/attr/attr.cxx | 2 sw/qa/extras/htmlexport/htmlexport.cxx | 4 sw/qa/extras/tiledrendering/tiledrenderingmodeltestbase.cxx | 2 sw/qa/extras/uiwriter/uiwriter.cxx | 5 sw/qa/extras/ww8export/ww8export.cxx | 2 sw/qa/uibase/uiview/uiview.cxx | 2 sw/source/core/access/accdoc.cxx | 2 sw/source/core/access/accpara.cxx | 2 sw/source/core/bastyp/calc.cxx | 2 sw/source/core/bastyp/init.cxx | 2 sw/source/core/doc/DocumentRedlineManager.cxx | 4 sw/source/core/doc/DocumentSettingManager.cxx | 4 sw/source/core/doc/doc.cxx | 10 - sw/source/core/doc/doccomp.cxx | 7 sw/source/core/doc/docfmt.cxx | 4 sw/source/core/doc/doclay.cxx | 4 sw/source/core/doc/docredln.cxx | 6 sw/source/core/fields/docufld.cxx | 9 - sw/source/core/layout/frmtool.cxx | 2 sw/source/core/layout/paintfrm.cxx | 4 sw/source/core/text/frmpaint.cxx | 4 sw/source/core/text/inftxt.cxx | 4 sw/source/core/text/redlnitr.cxx | 6 sw/source/core/text/txtfld.cxx | 4 sw/source/core/text/txtftn.cxx | 4 sw/source/core/txtnode/swfont.cxx | 8 - sw/source/core/txtnode/txtedt.cxx | 2 sw/source/filter/html/wrthtml.cxx | 5 sw/source/filter/ww8/docxattributeoutput.cxx | 6 sw/source/filter/ww8/docxtableexport.cxx | 4 sw/source/filter/ww8/rtfattributeoutput.cxx | 4 sw/source/filter/ww8/rtfexport.cxx | 2 sw/source/filter/ww8/wrtw8sty.cxx | 2 sw/source/filter/ww8/wrtww8.cxx | 2 sw/source/filter/xml/xmlexp.cxx | 2 sw/source/ui/chrdlg/swuiccoll.cxx | 2 sw/source/ui/config/optload.cxx | 10 - sw/source/ui/config/optpage.cxx | 14 - sw/source/ui/dbui/dbinsdlg.cxx | 2 sw/source/ui/envelp/mailmrge.cxx | 2 sw/source/ui/fldui/flddb.cxx | 2 sw/source/ui/frmdlg/cption.cxx | 4 sw/source/ui/index/cnttab.cxx | 4 sw/source/ui/misc/linenum.cxx | 2 sw/source/ui/misc/outline.cxx | 2 sw/source/ui/table/autoformatpreview.cxx | 3 sw/source/ui/table/colwd.cxx | 2 sw/source/ui/table/convert.cxx | 2 sw/source/ui/table/instable.cxx | 2 sw/source/ui/table/rowht.cxx | 2 sw/source/ui/vba/vbaapplication.cxx | 2 sw/source/uibase/app/docsh.cxx | 27 +-- sw/source/uibase/app/docsh2.cxx | 8 - sw/source/uibase/app/docshini.cxx | 18 +- sw/source/uibase/app/docst.cxx | 4 sw/source/uibase/app/mainwn.cxx | 8 - sw/source/uibase/app/swdll.cxx | 2 sw/source/uibase/app/swmodul1.cxx | 18 +- sw/source/uibase/app/swmodule.cxx | 8 - sw/source/uibase/dbui/dbmgr.cxx | 4 sw/source/uibase/dochdl/swdtflvr.cxx | 17 -- sw/source/uibase/docvw/AnnotationWin2.cxx | 4 sw/source/uibase/docvw/PostItMgr.cxx | 2 sw/source/uibase/docvw/edtdd.cxx | 6 sw/source/uibase/docvw/edtwin.cxx | 4 sw/source/uibase/docvw/edtwin2.cxx | 2 sw/source/uibase/docvw/edtwin3.cxx | 2 sw/source/uibase/docvw/romenu.cxx | 6 sw/source/uibase/docvw/srcedtw.cxx | 2 sw/source/uibase/envelp/envimg.cxx | 2 sw/source/uibase/envelp/labimg.cxx | 2 sw/source/uibase/lingu/olmenu.cxx | 4 sw/source/uibase/misc/redlndlg.cxx | 8 - sw/source/uibase/shells/annotsh.cxx | 4 sw/source/uibase/shells/basesh.cxx | 6 sw/source/uibase/shells/drawsh.cxx | 2 sw/source/uibase/shells/drwbassh.cxx | 2 sw/source/uibase/shells/drwtxtex.cxx | 4 sw/source/uibase/shells/drwtxtsh.cxx | 2 sw/source/uibase/shells/frmsh.cxx | 5 sw/source/uibase/shells/grfsh.cxx | 5 sw/source/uibase/shells/tabsh.cxx | 6 sw/source/uibase/shells/textsh.cxx | 2 sw/source/uibase/shells/textsh1.cxx | 7 sw/source/uibase/sidebar/TableEditPanel.cxx | 6 sw/source/uibase/uiview/pview.cxx | 9 - sw/source/uibase/uiview/uivwimp.cxx | 4 sw/source/uibase/uiview/view.cxx | 21 +- sw/source/uibase/uiview/view0.cxx | 2 sw/source/uibase/uiview/view1.cxx | 3 sw/source/uibase/uiview/view2.cxx | 2 sw/source/uibase/uiview/viewdlg2.cxx | 2 sw/source/uibase/uiview/viewmdi.cxx | 10 - sw/source/uibase/uiview/viewprt.cxx | 6 sw/source/uibase/uiview/viewstat.cxx | 2 sw/source/uibase/uno/unomod.cxx | 19 +- sw/source/uibase/uno/unomodule.cxx | 9 - sw/source/uibase/uno/unotxdoc.cxx | 14 - sw/source/uibase/utlui/content.cxx | 4 sw/source/uibase/utlui/navipi.cxx | 4 sw/source/uibase/utlui/uitool.cxx | 8 - sw/source/uibase/utlui/unotools.cxx | 6 sw/source/uibase/web/wview.cxx | 2 sw/source/uibase/wrtsh/wrtsh1.cxx | 7 vbahelper/source/vbahelper/vbahelper.cxx | 2 283 files changed, 910 insertions(+), 880 deletions(-)
New commits: commit 7fce875718687e12df4d7a8b997ca7baea548b91 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Thu Nov 14 19:28:09 2024 +0500 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Sun Nov 24 07:43:12 2024 +0100 Turn SD_MOD macro to a function Change-Id: I1303e9d48e92ac00eee12af9ed299cdaad2ce009 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177072 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/sd/inc/sdmod.hxx b/sd/inc/sdmod.hxx index b872ebf0913d..156a2ec09cec 100644 --- a/sd/inc/sdmod.hxx +++ b/sd/inc/sdmod.hxx @@ -127,6 +127,8 @@ public: svtools::ColorConfig& GetColorConfig(); + static auto get() { return static_cast<SdModule*>(SfxApplication::GetModule(SfxToolsModule::Draw)); } + private: SdOptions* pImpressOptions; @@ -173,6 +175,4 @@ private: std::unique_ptr<svtools::ColorConfig> mpColorConfig; }; -#define SD_MOD() ( static_cast<SdModule*>(SfxApplication::GetModule(SfxToolsModule::Draw)) ) - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx index bebbb2629341..0a00c80f88a7 100644 --- a/sd/qa/unit/dialogs-test.cxx +++ b/sd/qa/unit/dialogs-test.cxx @@ -409,7 +409,7 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID) aDlgSet.Put(SfxBoolItem(ATTR_PRESENT_SHOW_PAUSELOGO, rPresentationSettings.mbShowPauseLogo)); aDlgSet.Put(SfxBoolItem(ATTR_PRESENT_INTERACTIVE, rPresentationSettings.mbInteractive)); - //SdOptions* pOptions = SD_MOD()->GetSdOptions(DocumentType::Impress); + //SdOptions* pOptions = SdModule::get()->GetSdOptions(DocumentType::Impress); aDlgSet.Put(SfxInt32Item(ATTR_PRESENT_DISPLAY, 0 /*pOptions->GetDisplay()*/)); pRetval = getSdAbstractDialogFactory()->CreateSdStartPresentationDlg( Application::GetDefDialogParent(), diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx index 178b85265241..a07d24e4ffcb 100644 --- a/sd/source/core/drawdoc.cxx +++ b/sd/source/core/drawdoc.cxx @@ -159,7 +159,7 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh) // Set measuring unit (of the application) and scale (of SdMod) sal_Int32 nX, nY; - SdOptions* pOptions = SD_MOD()->GetSdOptions(meDocType); + SdOptions* pOptions = SdModule::get()->GetSdOptions(meDocType); nX = officecfg::Office::Draw::Zoom::ScaleX::get(); nY = officecfg::Office::Draw::Zoom::ScaleY::get(); SvtSysLocale aSysLocale; @@ -935,7 +935,7 @@ SdOutliner* SdDrawDocument::GetOutliner(bool bCreateOutliner) mpOutliner.reset(new SdOutliner( this, OutlinerMode::TextObject )); if (mpDocSh) - mpOutliner->SetRefDevice( SD_MOD()->GetVirtualRefDevice() ); + mpOutliner->SetRefDevice(SdModule::get()->GetVirtualRefDevice()); mpOutliner->SetDefTab( m_nDefaultTabulator ); mpOutliner->SetStyleSheetPool(static_cast<SfxStyleSheetPool*>(GetStyleSheetPool())); @@ -959,7 +959,7 @@ SdOutliner* SdDrawDocument::GetInternalOutliner(bool bCreateOutliner) mpInternalOutliner->EnableUndo( false ); if (mpDocSh) - mpInternalOutliner->SetRefDevice( SD_MOD()->GetVirtualRefDevice() ); + mpInternalOutliner->SetRefDevice(SdModule::get()->GetVirtualRefDevice()); mpInternalOutliner->SetDefTab( m_nDefaultTabulator ); mpInternalOutliner->SetStyleSheetPool(static_cast<SfxStyleSheetPool*>(GetStyleSheetPool())); @@ -1097,7 +1097,7 @@ void SdDrawDocument::MasterPageListChanged() void SdDrawDocument::SetCalcFieldValueHdl(::Outliner* pOutliner) { - pOutliner->SetCalcFieldValueHdl(LINK(SD_MOD(), SdModule, CalcFieldValueHdl)); + pOutliner->SetCalcFieldValueHdl(LINK(SdModule::get(), SdModule, CalcFieldValueHdl)); } sal_uInt16 SdDrawDocument::GetAnnotationAuthorIndex( const OUString& rAuthor ) diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index 82cc1611caff..5df9ea0d7dfd 100644 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -444,12 +444,13 @@ bool SdDrawDocument::InsertBookmarkAsPage( if( bNoDialogs ) { + SdModule* mod = SdModule::get(); // If this is clipboard, then no need to scale objects: // this will make copied masters to differ from the originals, // and thus InsertBookmarkAsPage_FindDuplicateLayouts will // duplicate masters on insert to same document - m_bTransportContainer = (SD_MOD()->pTransferClip && - SD_MOD()->pTransferClip->GetWorkDocument() == this); + m_bTransportContainer = (mod->pTransferClip && + mod->pTransferClip->GetWorkDocument() == this); if (!m_bTransportContainer) { if (rBookmarkList.empty()) diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index ba3bbfb9d014..e611246eded6 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -2365,7 +2365,7 @@ void SdPage::SetObjText(SdrTextObj* pObj, SdrOutliner* pOutliner, PresObjKind eO { SfxItemPool* pPool(static_cast< SdDrawDocument& >(getSdrModelFromSdrPage()).GetDrawOutliner().GetEmptyItemSet().GetPool()); pOutl = new ::Outliner( pPool, OutlinerMode::OutlineObject ); - pOutl->SetRefDevice( SD_MOD()->GetVirtualRefDevice() ); + pOutl->SetRefDevice(SdModule::get()->GetVirtualRefDevice()); pOutl->SetEditTextObjectPool(pPool); pOutl->SetStyleSheetPool(static_cast<SfxStyleSheetPool*>(getSdrModelFromSdrPage().GetStyleSheetPool())); pOutl->EnableUndo(false); diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index ab319d6ab498..01174b023902 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -1960,7 +1960,7 @@ ShapeExport& PowerPointShapeExport::WritePlaceholderReferenceTextBody( aDateTimeText = SvxDateTimeField::GetFormatted( aDateTime, aDateTime, eDate, - eTime, *(SD_MOD()->GetNumberFormatter()), + eTime, *(SdModule::get()->GetNumberFormatter()), rLanguageTag.getLanguageType()); } diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index 528e53e9d86d..77a2e4aa6a7d 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -743,7 +743,7 @@ void CustomAnimationPane::updateControls() mxPBMoveUp->set_sensitive(mxView.is() && bEnableUp); mxPBMoveDown->set_sensitive(mxView.is() && bEnableDown); - SdOptions* pOptions = SD_MOD()->GetSdOptions(DocumentType::Impress); + SdOptions* pOptions = SdModule::get()->GetSdOptions(DocumentType::Impress); mxCBAutoPreview->set_active(pOptions->IsPreviewChangedEffects()); updateMotionPathTags(); @@ -2320,7 +2320,7 @@ void CustomAnimationPane::implControlHdl(const weld::Widget* pControl) onPreview( true ); else if (pControl == mxCBAutoPreview.get()) { - SdOptions* pOptions = SD_MOD()->GetSdOptions(DocumentType::Impress); + SdOptions* pOptions = SdModule::get()->GetSdOptions(DocumentType::Impress); pOptions->SetPreviewChangedEffects(mxCBAutoPreview->get_active()); } } diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index 69a22927cb49..1ab9ca44ab0c 100644 --- a/sd/source/ui/animations/SlideTransitionPane.cxx +++ b/sd/source/ui/animations/SlideTransitionPane.cxx @@ -634,7 +634,7 @@ void SlideTransitionPane::updateControls() else { mxRepeatAutoFrame->hide(); - SdOptions* pOptions = SD_MOD()->GetSdOptions(DocumentType::Impress); + SdOptions* pOptions = SdModule::get()->GetSdOptions(DocumentType::Impress); mxCB_AUTO_PREVIEW->set_active( pOptions->IsPreviewTransitions() ); } @@ -1115,7 +1115,7 @@ IMPL_LINK_NOARG(SlideTransitionPane, LoopSoundBoxChecked, weld::Toggleable&, voi IMPL_LINK_NOARG(SlideTransitionPane, AutoPreviewClicked, weld::Toggleable&, void) { - SdOptions* pOptions = SD_MOD()->GetSdOptions(DocumentType::Impress); + SdOptions* pOptions = SdModule::get()->GetSdOptions(DocumentType::Impress); pOptions->SetPreviewTransitions( mxCB_AUTO_PREVIEW->get_active() ); } diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index e2e5977a7e1e..d172d5acd0af 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -177,8 +177,7 @@ AnnotationManagerImpl::AnnotationManagerImpl( ViewShellBase& rViewShellBase ) , mbShowAnnotations( true ) , mnUpdateTagsEvent( nullptr ) { - SdOptions* pOptions = SD_MOD()->GetSdOptions(mpDoc->GetDocumentType()); - if( pOptions ) + if (SdOptions* pOptions = SdModule::get()->GetSdOptions(mpDoc->GetDocumentType())) mbShowAnnotations = pOptions->IsShowComments(); } @@ -289,8 +288,7 @@ void AnnotationManagerImpl::ShowAnnotations( bool bShow ) { mbShowAnnotations = bShow; - SdOptions* pOptions = SD_MOD()->GetSdOptions(mpDoc->GetDocumentType()); - if( pOptions ) + if (SdOptions* pOptions = SdModule::get()->GetSdOptions(mpDoc->GetDocumentType())) pOptions->SetShowComments( mbShowAnnotations ); UpdateTags(); diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx index df2fd5c50eee..8b2ff650f6b3 100644 --- a/sd/source/ui/app/sdmod.cxx +++ b/sd/source/ui/app/sdmod.cxx @@ -86,12 +86,12 @@ SdModule::SdModule(SfxObjectFactory* pFact1, SfxObjectFactory* pFact2 ) OUString SdResId(TranslateId aId) { - return Translate::get(aId, SD_MOD()->GetResLocale()); + return Translate::get(aId, SdModule::get()->GetResLocale()); } OUString SdResId(TranslateNId aContextSingularPlural, int nCardinality) { - return Translate::nget(aContextSingularPlural, nCardinality, SD_MOD()->GetResLocale()); + return Translate::nget(aContextSingularPlural, nCardinality, SdModule::get()->GetResLocale()); } // Dtor diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx index a9cafe31a765..52b3f7780844 100644 --- a/sd/source/ui/app/sdmod2.cxx +++ b/sd/source/ui/app/sdmod2.cxx @@ -864,16 +864,17 @@ std::unique_ptr<SfxTabPage> SdModule::CreateTabPage( sal_uInt16 nId, weld::Conta std::optional<SfxStyleFamilies> SdModule::CreateStyleFamilies() { SfxStyleFamilies aStyleFamilies; + std::locale resLocale = SdModule::get()->GetResLocale(); aStyleFamilies.emplace_back(SfxStyleFamily::Para, SdResId(STR_GRAPHICS_STYLE_FAMILY), BMP_STYLES_FAMILY_GRAPHICS, - RID_GRAPHICSTYLEFAMILY, SD_MOD()->GetResLocale()); + RID_GRAPHICSTYLEFAMILY, resLocale); aStyleFamilies.emplace_back(SfxStyleFamily::Pseudo, SdResId(STR_PRESENTATIONS_STYLE_FAMILY), BMP_STYLES_FAMILY_PRESENTATIONS, - RID_PRESENTATIONSTYLEFAMILY, SD_MOD()->GetResLocale()); + RID_PRESENTATIONSTYLEFAMILY, resLocale); return aStyleFamilies; } diff --git a/sd/source/ui/app/sdpopup.cxx b/sd/source/ui/app/sdpopup.cxx index 0e6f84347e7e..8c9607421be7 100644 --- a/sd/source/ui/app/sdpopup.cxx +++ b/sd/source/ui/app/sdpopup.cxx @@ -69,7 +69,7 @@ void SdFieldPopup::Fill( LanguageType eLanguage ) m_xPopup->append_radio(OUString::number(nID++), SdResId(STR_STANDARD_SMALL)); m_xPopup->append_radio(OUString::number(nID++), SdResId(STR_STANDARD_BIG)); - SvNumberFormatter* pNumberFormatter = SD_MOD()->GetNumberFormatter(); + SvNumberFormatter* pNumberFormatter = SdModule::get()->GetNumberFormatter(); aDateField.SetFormat( SvxDateFormat::A ); // 13.02.96 m_xPopup->append_radio(OUString::number(nID++), aDateField.GetFormatted(*pNumberFormatter, eLanguage)); aDateField.SetFormat( SvxDateFormat::B ); // 13.02.1996 @@ -99,7 +99,7 @@ void SdFieldPopup::Fill( LanguageType eLanguage ) //SvxTimeFormat::System, // is not used m_xPopup->append_radio(OUString::number(nID++), SdResId(STR_STANDARD_NORMAL)); - SvNumberFormatter* pNumberFormatter = SD_MOD()->GetNumberFormatter(); + SvNumberFormatter* pNumberFormatter = SdModule::get()->GetNumberFormatter(); aTimeField.SetFormat( SvxTimeFormat::HH24_MM ); // 13:49 m_xPopup->append_radio(OUString::number(nID++), aTimeField.GetFormatted(*pNumberFormatter, eLanguage)); aTimeField.SetFormat( SvxTimeFormat::HH24_MM_SS ); // 13:49:38 diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx index a7cd70860ce1..17ed6280b13a 100644 --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -436,7 +436,7 @@ void SdTransferable::AddSupportedFormats() bool SdTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDoc ) { - if (SD_MOD()==nullptr) + if (SdModule::get() == nullptr) return false; SotClipboardFormatId nFormat = SotExchange::GetFormat( rFlavor ); @@ -636,7 +636,7 @@ void SdTransferable::DragFinished( sal_Int8 nDropAction ) void SdTransferable::ObjectReleased() { - SdModule *pModule = SD_MOD(); + SdModule* pModule = SdModule::get(); if (!pModule) return; diff --git a/sd/source/ui/dlg/dlgfield.cxx b/sd/source/ui/dlg/dlgfield.cxx index 881ab311b75d..61623d16c409 100644 --- a/sd/source/ui/dlg/dlgfield.cxx +++ b/sd/source/ui/dlg/dlgfield.cxx @@ -162,7 +162,7 @@ void SdModifyFieldDlg::FillFormatList() m_xLbFormat->append_text( SdResId( STR_STANDARD_SMALL ) ); m_xLbFormat->append_text( SdResId( STR_STANDARD_BIG ) ); - SvNumberFormatter* pNumberFormatter = SD_MOD()->GetNumberFormatter(); + SvNumberFormatter* pNumberFormatter = SdModule::get()->GetNumberFormatter(); aDateField.SetFormat( SvxDateFormat::A ); // 13.02.96 m_xLbFormat->append_text( aDateField.GetFormatted( *pNumberFormatter, eLangType ) ); aDateField.SetFormat( SvxDateFormat::B ); // 13.02.1996 @@ -186,7 +186,7 @@ void SdModifyFieldDlg::FillFormatList() //SvxTimeFormat::System, // not used m_xLbFormat->append_text( SdResId( STR_STANDARD_NORMAL ) ); - SvNumberFormatter* pNumberFormatter = SD_MOD()->GetNumberFormatter(); + SvNumberFormatter* pNumberFormatter = SdModule::get()->GetNumberFormatter(); aTimeField.SetFormat( SvxTimeFormat::HH24_MM ); // 13:49 m_xLbFormat->append_text( aTimeField.GetFormatted( *pNumberFormatter, eLangType ) ); aTimeField.SetFormat( SvxTimeFormat::HH24_MM_SS ); // 13:49:38 diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx index c2936d014faa..fe5c17045efe 100644 --- a/sd/source/ui/dlg/headerfooterdlg.cxx +++ b/sd/source/ui/dlg/headerfooterdlg.cxx @@ -431,7 +431,7 @@ void HeaderFooterTabPage::FillFormatList( sal_Int32 nSelectedPos ) OUString aStr( SvxDateTimeField::GetFormatted( aDateTime, aDateTime, nDateTimeFormats[nFormat].meDateFormat, nDateTimeFormats[nFormat].meTimeFormat, - *(SD_MOD()->GetNumberFormatter()), eLanguage ) ); + *(SdModule::get()->GetNumberFormatter()), eLanguage ) ); mxCBDateTimeFormat->append_text(aStr); if (nFormat == nSelectedPos) mxCBDateTimeFormat->set_active(nFormat); diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 8834c71e50bb..be28cc2fda73 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -465,7 +465,7 @@ bool SdPageObjsTLV::DoDrag() { AddShapeToTransferable(*m_xHelper, *pObject); m_xHelper->SetView(pView); - SD_MOD()->pTransferDrag = m_xHelper.get(); + SdModule::get()->pTransferDrag = m_xHelper.get(); } // Unnamed shapes have to be selected to be recognized by the @@ -479,7 +479,7 @@ bool SdPageObjsTLV::DoDrag() else { m_xHelper->SetView(pView); - SD_MOD()->pTransferDrag = m_xHelper.get(); + SdModule::get()->pTransferDrag = m_xHelper.get(); } return false; diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx index 234c63578667..e4e3f9d4d171 100644 --- a/sd/source/ui/docshell/docshel3.cxx +++ b/sd/source/ui/docshell/docshel3.cxx @@ -144,7 +144,7 @@ void DrawDocShell::Execute( SfxRequest& rReq ) { const SvxSearchItem & rSearchItem = pReqArgs->Get(SID_SEARCH_ITEM); - SD_MOD()->SetSearchItem(std::unique_ptr<SvxSearchItem>(rSearchItem.Clone())); + SdModule::get()->SetSearchItem(std::unique_ptr<SvxSearchItem>(rSearchItem.Clone())); } rReq.Done(); @@ -220,7 +220,7 @@ void DrawDocShell::Execute( SfxRequest& rReq ) { const SvxSearchItem& rSearchItem = pReqArgs->Get(SID_SEARCH_ITEM); - SD_MOD()->SetSearchItem(std::unique_ptr<SvxSearchItem>(rSearchItem.Clone())); + SdModule::get()->SetSearchItem(std::unique_ptr<SvxSearchItem>(rSearchItem.Clone())); xFuSearch->SearchAndReplace(&rSearchItem); } } diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx index c71706e3caab..dca885bcd2cd 100644 --- a/sd/source/ui/docshell/docshel4.cxx +++ b/sd/source/ui/docshell/docshel4.cxx @@ -105,7 +105,7 @@ SfxPrinter* DrawDocShell::GetPrinter(bool bCreate) SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC, ATTR_OPTIONS_PRINT, ATTR_OPTIONS_PRINT>>( GetPool() ); // set PrintOptionsSet - SdOptionsPrintItem aPrintItem( SD_MOD()->GetSdOptions(mpDoc->GetDocumentType()) ); + SdOptionsPrintItem aPrintItem(SdModule::get()->GetSdOptions(mpDoc->GetDocumentType())); SfxFlagItem aFlagItem( SID_PRINTER_CHANGESTODOC ); SfxPrinterChangeFlags nFlags = (aPrintItem.GetOptionsPrint().IsWarningSize() ? SfxPrinterChangeFlags::CHG_SIZE : SfxPrinterChangeFlags::NONE) | @@ -168,7 +168,7 @@ void DrawDocShell::UpdateFontList() if ( mpDoc->GetPrinterIndependentLayout() == css::document::PrinterIndependentLayout::DISABLED ) pRefDevice = GetPrinter(true); else - pRefDevice = SD_MOD()->GetVirtualRefDevice(); + pRefDevice = SdModule::get()->GetVirtualRefDevice(); mpFontList.reset( new FontList(pRefDevice, nullptr) ); SvxFontListItem aFontListItem( mpFontList.get(), SID_ATTR_CHAR_FONTLIST ); PutItem( aFontListItem ); @@ -218,7 +218,7 @@ void DrawDocShell::UpdateRefDevice() break; case css::document::PrinterIndependentLayout::ENABLED: - pRefDevice = SD_MOD()->GetVirtualRefDevice(); + pRefDevice = SdModule::get()->GetVirtualRefDevice(); break; default: diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx index cadc59826f47..834de4941159 100644 --- a/sd/source/ui/docshell/docshell.cxx +++ b/sd/source/ui/docshell/docshell.cxx @@ -223,7 +223,7 @@ void DrawDocShell::GetState(SfxItemSet &rSet) case SID_SEARCH_ITEM: { - rSet.Put( *SD_MOD()->GetSearchItem() ); + rSet.Put(*SdModule::get()->GetSearchItem()); } break; diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx index 3e36d5d78f76..d40f325f2392 100644 --- a/sd/source/ui/func/fudraw.cxx +++ b/sd/source/ui/func/fudraw.cxx @@ -468,7 +468,7 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt) if (mpView->IsDragObj()) { - if (SD_MOD()->GetWaterCan() && !mpView->PickHandle(aPnt)) + if (SdModule::get()->GetWaterCan() && !mpView->PickHandle(aPnt)) { // water can mode bDefPointer = false; @@ -479,7 +479,7 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt) { SdrHdl* pHdl = mpView->PickHandle(aPnt); - if (SD_MOD()->GetWaterCan() && !pHdl) + if (SdModule::get()->GetWaterCan() && !pHdl) { // water can mode bDefPointer = false; @@ -656,7 +656,7 @@ void FuDraw::DoubleClick(const MouseEvent& rMEvt) SfxCallMode::ASYNCHRON | SfxCallMode::RECORD ); } else if ( ( DynCastSdrTextObj( pObj ) != nullptr || dynamic_cast< const SdrObjGroup *>( pObj ) != nullptr ) && - !SD_MOD()->GetWaterCan() && + !SdModule::get()->GetWaterCan() && mpViewShell->GetFrameView()->IsDoubleClickTextEdit() && !mpDocSh->IsReadOnly()) { diff --git a/sd/source/ui/func/fuexpand.cxx b/sd/source/ui/func/fuexpand.cxx index 17e0e0fed1ad..bd12519a66bb 100644 --- a/sd/source/ui/func/fuexpand.cxx +++ b/sd/source/ui/func/fuexpand.cxx @@ -92,7 +92,7 @@ void FuExpandPage::DoExecute( SfxRequest& ) aOutliner.EnableUndo(false); if (mpDocSh) - aOutliner.SetRefDevice( SD_MOD()->GetVirtualRefDevice() ); + aOutliner.SetRefDevice(SdModule::get()->GetVirtualRefDevice()); aOutliner.SetDefTab( mpDoc->GetDefaultTabulator() ); aOutliner.SetStyleSheetPool(static_cast<SfxStyleSheetPool*>(mpDoc->GetStyleSheetPool())); diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx index 693ae65f14c4..c2f9d7ea1022 100644 --- a/sd/source/ui/func/fuinsert.cxx +++ b/sd/source/ui/func/fuinsert.cxx @@ -492,7 +492,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); ScopedVclPtr<SfxAbstractInsertObjectDialog> pDlg( - pFact->CreateInsertObjectDialog( mpViewShell->GetFrameWeld(), SD_MOD()->GetSlotPool()->GetSlot(nSlotId)->GetCommand(), + pFact->CreateInsertObjectDialog( mpViewShell->GetFrameWeld(), SdModule::get()->GetSlotPool()->GetSlot(nSlotId)->GetCommand(), xStorage, &aServerLst )); pDlg->Execute(); bCreateNew = pDlg->IsCreateNew(); diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx index 46253dad1467..639c9845ba14 100644 --- a/sd/source/ui/func/fuinsfil.cxx +++ b/sd/source/ui/func/fuinsfil.cxx @@ -425,7 +425,7 @@ void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium) SdOutliner aOutliner( mpDoc, OutlinerMode::TextObject ); // set reference device - aOutliner.SetRefDevice( SD_MOD()->GetVirtualRefDevice() ); + aOutliner.SetRefDevice(SdModule::get()->GetVirtualRefDevice()); SdPage* pPage = static_cast<DrawViewShell*>(mpViewShell)->GetActualPage(); aLayoutName = pPage->GetLayoutName(); @@ -577,7 +577,7 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium) aOutliner.SetStyleSheetPool(static_cast<SfxStyleSheetPool*>(mpDoc->GetStyleSheetPool())); // set reference device - aOutliner.SetRefDevice(SD_MOD()->GetVirtualRefDevice()); + aOutliner.SetRefDevice(SdModule::get()->GetVirtualRefDevice()); aOutliner.SetPaperSize(Size(0x7fffffff, 0x7fffffff)); SvStream* pStream = pMedium->GetInStream(); diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index efc1c6ea262d..bc2da0ced224 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -128,7 +128,7 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) { pHdl = nullptr; bool bReturn = FuDraw::MouseButtonDown(rMEvt); - bool bWaterCan = SD_MOD()->GetWaterCan(); + bool bWaterCan = SdModule::get()->GetWaterCan(); const bool bReadOnly = mpDocSh->IsReadOnly(); // When the right mouse button is pressed then only select objects // (and deselect others) as a preparation for showing the context @@ -801,7 +801,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) mpView->EndAction(); } - if( SD_MOD()->GetWaterCan() ) + if (SdModule::get()->GetWaterCan()) { if( rMEvt.IsRight() ) { diff --git a/sd/source/ui/func/fusldlg.cxx b/sd/source/ui/func/fusldlg.cxx index 3ce1814c92b2..95df1ad81c42 100644 --- a/sd/source/ui/func/fusldlg.cxx +++ b/sd/source/ui/func/fusldlg.cxx @@ -104,7 +104,7 @@ void FuSlideShowDlg::DoExecute( SfxRequest& ) aDlgSet.Put( SfxBoolItem( ATTR_PRESENT_SHOW_PAUSELOGO, rPresentationSettings.mbShowPauseLogo ) ); aDlgSet.Put( SfxBoolItem( ATTR_PRESENT_INTERACTIVE, rPresentationSettings.mbInteractive ) ); - SdOptions* pOptions = SD_MOD()->GetSdOptions(DocumentType::Impress); + SdOptions* pOptions = SdModule::get()->GetSdOptions(DocumentType::Impress); aDlgSet.Put( SfxInt32Item( ATTR_PRESENT_DISPLAY, pOptions->GetDisplay() ) ); SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); diff --git a/sd/source/ui/func/fusumry.cxx b/sd/source/ui/func/fusumry.cxx index 9b160099cba0..1c916e238842 100644 --- a/sd/source/ui/func/fusumry.cxx +++ b/sd/source/ui/func/fusumry.cxx @@ -164,7 +164,7 @@ void FuSummaryPage::DoExecute( SfxRequest& ) pOutl->EnableUndo(false); if (mpDocSh) - pOutl->SetRefDevice(SD_MOD()->GetVirtualRefDevice()); + pOutl->SetRefDevice(SdModule::get()->GetVirtualRefDevice()); pOutl->SetDefTab( mpDoc->GetDefaultTabulator() ); pOutl->SetStyleSheetPool(static_cast<SfxStyleSheetPool*>(mpDoc->GetStyleSheetPool())); diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx index d670c706f182..07580a6cef03 100644 --- a/sd/source/ui/func/futempl.cxx +++ b/sd/source/ui/func/futempl.cxx @@ -250,12 +250,12 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) case SID_STYLE_WATERCAN: { - if( !SD_MOD()->GetWaterCan() ) + if (SdModule* mod = SdModule::get(); !mod->GetWaterCan()) { if (pArgs && pArgs->GetItemState( nSId ) == SfxItemState::SET) { aStyleName = static_cast<const SfxStringItem &>( pArgs->Get( nSId ) ).GetValue(); - SD_MOD()->SetWaterCan( true ); + mod->SetWaterCan(true); pStyleSheet = pSSPool->Find( aStyleName, nFamily); } // no presentation object templates, they are only allowed implicitly @@ -269,11 +269,11 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) } else - SD_MOD()->SetWaterCan( false ); + mod->SetWaterCan(false); } else { - SD_MOD()->SetWaterCan( false ); + mod->SetWaterCan(false); // we have to re-enable to tools-bar mpViewShell->Invalidate(); } diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx index 83e73e2ea4e8..4f0545fbf83e 100644 --- a/sd/source/ui/sidebar/LayoutMenu.cxx +++ b/sd/source/ui/sidebar/LayoutMenu.cxx @@ -558,7 +558,7 @@ void LayoutMenu::Clear() void LayoutMenu::ShowContextMenu(const Point* pPos) { - if (SD_MOD()->GetWaterCan()) + if (SdModule::get()->GetWaterCan()) return; // Determine the position where to show the menu. diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx index 047fa95c27f9..49cb4f489bf5 100644 --- a/sd/source/ui/slideshow/slideshow.cxx +++ b/sd/source/ui/slideshow/slideshow.cxx @@ -519,7 +519,7 @@ void SAL_CALL SlideShow::setPropertyValue( const OUString& aPropertyName, const { bIllegalArgument = false; - SdOptions* pOptions = SD_MOD()->GetSdOptions(DocumentType::Impress); + SdOptions* pOptions = SdModule::get()->GetSdOptions(DocumentType::Impress); pOptions->SetDisplay( nDisplay ); FullScreenWorkWindow *pWin = dynamic_cast<FullScreenWorkWindow *>(GetWorkWindow()); @@ -598,7 +598,7 @@ Any SAL_CALL SlideShow::getPropertyValue( const OUString& PropertyName ) return Any( rPresSettings.mbShowPauseLogo ); case ATTR_PRESENT_DISPLAY: { - SdOptions* pOptions = SD_MOD()->GetSdOptions(DocumentType::Impress); + SdOptions* pOptions = SdModule::get()->GetSdOptions(DocumentType::Impress); return Any(pOptions->GetDisplay()); } @@ -1216,7 +1216,7 @@ sal_Int32 SlideShow::GetDisplay() { sal_Int32 nDisplay = 0; - SdOptions* pOptions = SD_MOD()->GetSdOptions(DocumentType::Impress); + SdOptions* pOptions = SdModule::get()->GetSdOptions(DocumentType::Impress); if( pOptions ) nDisplay = pOptions->GetDisplay(); diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 8562688be5a7..d8a8eccf5cdc 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -601,7 +601,7 @@ SlideshowImpl::SlideshowImpl( const Reference< XPresentation2 >& xPresentation, mbUsePen = maPresSettings.mbMouseAsPen; - SdOptions* pOptions = SD_MOD()->GetSdOptions(DocumentType::Impress); + SdOptions* pOptions = SdModule::get()->GetSdOptions(DocumentType::Impress); if( pOptions ) { mnUserPaintColor = pOptions->GetPresentationPenColor(); @@ -620,7 +620,7 @@ SlideshowImpl::~SlideshowImpl() if (nullptr != mpDoc) EndListening(*mpDoc); - SdModule *pModule = SD_MOD(); + SdModule* pModule = SdModule::get(); //rhbz#806663 SlideshowImpl can outlive SdModule SdOptions* pOptions = pModule ? pModule->GetSdOptions(DocumentType::Impress) : nullptr; @@ -1195,7 +1195,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx const * pPresSettings ) beans::PropertyState_DIRECT_VALUE ); const bool bZOrderEnabled( - SD_MOD()->GetSdOptions( mpDoc->GetDocumentType() )->IsSlideshowRespectZOrder() ); + SdModule::get()->GetSdOptions( mpDoc->GetDocumentType() )->IsSlideshowRespectZOrder() ); aProperties.emplace_back( "DisableAnimationZOrder" , -1, Any( !bZOrderEnabled ), beans::PropertyState_DIRECT_VALUE ); diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx index 43c8ec30ee3a..ad1d84bc1564 100644 --- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx +++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx @@ -318,7 +318,7 @@ bool SlideSorterController::Command ( // indicator so that the user knows where a page insertion // would take place. mpInsertionIndicatorHandler->Start(false); - mpInsertionIndicatorHandler->UpdateIndicatorIcon(SD_MOD()->pTransferClip); + mpInsertionIndicatorHandler->UpdateIndicatorIcon(SdModule::get()->pTransferClip); mpInsertionIndicatorHandler->UpdatePosition( pWindow->PixelToLogic(rEvent.GetMousePosPixel()), InsertionIndicatorHandler::MoveMode); diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx index 90fa0b7d7399..2c0b81bde2b2 100644 --- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx +++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx @@ -227,7 +227,7 @@ void Clipboard::DoCopy () void Clipboard::DoPaste () { - SdTransferable* pClipTransferable = SD_MOD()->pTransferClip; + SdTransferable* pClipTransferable = SdModule::get()->pTransferClip; if (pClipTransferable==nullptr || !pClipTransferable->IsPageTransferable()) return; @@ -288,7 +288,7 @@ sal_Int32 Clipboard::GetInsertionPosition () sal_Int32 Clipboard::PasteTransferable (sal_Int32 nInsertPosition) { - SdTransferable* pClipTransferable = SD_MOD()->pTransferClip; + SdTransferable* pClipTransferable = SdModule::get()->pTransferClip; model::SlideSorterModel& rModel (mrSlideSorter.GetModel()); bool bMergeMasterPages = !pClipTransferable->HasSourceDoc (rModel.GetDocument()); sal_uInt16 nInsertIndex (rModel.GetCoreIndex(nInsertPosition)); @@ -432,9 +432,9 @@ void Clipboard::CreateSlideTransferable ( std::move(aRepresentatives)); if (bDrag) - SD_MOD()->pTransferDrag = pTransferable.get(); + SdModule::get()->pTransferDrag = pTransferable.get(); else - SD_MOD()->pTransferClip = pTransferable.get(); + SdModule::get()->pTransferClip = pTransferable.get(); pDocument->CreatingDataObj (pTransferable.get()); pTransferable->SetWorkDocument(pDocument->AllocSdDrawDocument()); @@ -631,7 +631,7 @@ sal_Int8 Clipboard::AcceptDrop ( // Use the copy action when the drop action is the default, i.e. not // explicitly set to move or link, and when the source and // target models are not the same. - SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag; + SdTransferable* pDragTransferable = SdModule::get()->pTransferDrag; if (pDragTransferable != nullptr && pDragTransferable->IsPageTransferable() && ((rEvent.maDragEvent.DropAction @@ -693,7 +693,7 @@ sal_Int8 Clipboard::ExecuteDrop ( case DT_PAGE: case DT_PAGE_FROM_NAVIGATOR: { - SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag; + SdTransferable* pDragTransferable = SdModule::get()->pTransferDrag; const Point aEventModelPosition ( pTargetWindow->PixelToLogic (rEvent.maPosPixel)); const sal_Int32 nXOffset (std::abs (pDragTransferable->GetStartPos().X() @@ -829,7 +829,7 @@ sal_uInt16 Clipboard::DetermineInsertPosition () Clipboard::DropType Clipboard::IsDropAccepted() const { - const SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag; + const SdTransferable* pDragTransferable = SdModule::get()->pTransferDrag; if (pDragTransferable == nullptr) return DT_NONE; diff --git a/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx b/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx index b635accc5535..248db2656a38 100644 --- a/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx +++ b/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx @@ -44,7 +44,7 @@ DragAndDropContext::DragAndDropContext (SlideSorter& rSlideSorter) // For properly handling transferables created by the navigator we // need additional information. For this a user data object is // created that contains the necessary information. - SdTransferable* pTransferable = SD_MOD()->pTransferDrag; + SdTransferable* pTransferable = SdModule::get()->pTransferDrag; SdPageObjsTLV::SdPageObjsTransferable* pTreeListBoxTransferable = dynamic_cast<SdPageObjsTLV::SdPageObjsTransferable*>(pTransferable); if (pTreeListBoxTransferable!=nullptr && !TransferableData::GetFromTransferable(pTransferable)) diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx index af09253db8d1..902f02cd303f 100644 --- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx @@ -941,7 +941,7 @@ void SelectionFunction::ModeHandler::StartDrag ( // modifier key can trigger a MouseMotion event in the originating // window (focus still in there). Together with the mouse button pressed // (drag-and-drop is active) this triggers the start of drag-and-drop.) - if (SD_MOD()->pTransferDrag != nullptr) + if (SdModule::get()->pTransferDrag != nullptr) return; mrSelectionFunction.SwitchToDragAndDropMode(rMousePosition); @@ -1389,14 +1389,15 @@ DragAndDropModeHandler::DragAndDropModeHandler ( vcl::Window* pWindow) : ModeHandler(rSlideSorter, rSelectionFunction, false) { - SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag; + SdModule* mod = SdModule::get(); + SdTransferable* pDragTransferable = mod->pTransferDrag; if (pDragTransferable==nullptr && mrSlideSorter.GetViewShell() != nullptr) { SlideSorterViewShell* pSlideSorterViewShell = dynamic_cast<SlideSorterViewShell*>(mrSlideSorter.GetViewShell()); if (pSlideSorterViewShell != nullptr) pSlideSorterViewShell->StartDrag(rMousePosition, pWindow); - pDragTransferable = SD_MOD()->pTransferDrag; + pDragTransferable = mod->pTransferDrag; } mpDragAndDropContext.reset(new DragAndDropContext(mrSlideSorter)); diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx index 7eeb776af914..17482e36957f 100644 --- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx @@ -366,7 +366,7 @@ void SlotManager::FuSupport (SfxRequest& rRequest) case SID_PASTE: { - SdTransferable* pTransferClip = SD_MOD()->pTransferClip; + SdTransferable* pTransferClip = SdModule::get()->pTransferClip; if( pTransferClip ) { SfxObjectShell* pTransferDocShell = pTransferClip->GetDocShell().get(); @@ -697,7 +697,7 @@ void SlotManager::GetMenuState (SfxItemSet& rSet) void SlotManager::GetClipboardState ( SfxItemSet& rSet) { - SdTransferable* pTransferClip = SD_MOD()->pTransferClip; + SdTransferable* pTransferClip = SdModule::get()->pTransferClip; if (rSet.GetItemState(SID_PASTE) == SfxItemState::DEFAULT || rSet.GetItemState(SID_PASTE_SPECIAL) == SfxItemState::DEFAULT) diff --git a/sd/source/ui/table/tablefunction.cxx b/sd/source/ui/table/tablefunction.cxx index 5670ffb1fd86..943744da15dc 100644 --- a/sd/source/ui/table/tablefunction.cxx +++ b/sd/source/ui/table/tablefunction.cxx @@ -254,7 +254,7 @@ void DrawViewShell::GetTableMenuState( SfxItemSet &rSet ) if( ( !aActiveLayer.isEmpty() && pPV && ( pPV->IsLayerLocked(aActiveLayer) || !pPV->IsLayerVisible(aActiveLayer) ) ) || - SD_MOD()->GetWaterCan() ) + SdModule::get()->GetWaterCan() ) { rSet.DisableItem( SID_INSERT_TABLE ); } diff --git a/sd/source/ui/table/tableobjectbar.cxx b/sd/source/ui/table/tableobjectbar.cxx index 2f60f0882376..9f460238b042 100644 --- a/sd/source/ui/table/tableobjectbar.cxx +++ b/sd/source/ui/table/tableobjectbar.cxx @@ -130,7 +130,7 @@ void TableObjectBar::Execute( SfxRequest& rReq ) vcl::Window* pWin = mpView->GetViewShell()->GetParentWindow(); VclPtr<SvxAbstractInsRowColDlg> pDlg( pFact->CreateSvxInsRowColDlg(pWin ? pWin->GetFrameWeld() : nullptr, nSlotId == SID_TABLE_INSERT_COL_DLG, - SD_MOD()->GetSlotPool()->GetSlot(nSlotId)->GetCommand()) ); + SdModule::get()->GetSlotPool()->GetSlot(nSlotId)->GetCommand()) ); pDlg->StartExecuteAsync( [pDlg, xRequest=std::move(xRequest), nSlotId, xController, pBindings] (sal_Int32 nResult) mutable ->void { diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx index cc610d2dd36c..41ff0b6c27db 100644 --- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx +++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx @@ -430,7 +430,7 @@ DocumentSettings::_setPropertyValues(const PropertyMapEntry** ppEntries, } else { - aOptionsPrintItem.SetOptions( SD_MOD()->GetSdOptions(pDoc->GetDocumentType()) ); + aOptionsPrintItem.SetOptions(SdModule::get()->GetSdOptions(pDoc->GetDocumentType())); } SdOptionsPrint& aPrintOpts = aOptionsPrintItem.GetOptionsPrint(); @@ -1104,7 +1104,7 @@ DocumentSettings::_getPropertyValues( } else { - aOptionsPrintItem.SetOptions( SD_MOD()->GetSdOptions(pDoc->GetDocumentType()) ); + aOptionsPrintItem.SetOptions(SdModule::get()->GetSdOptions(pDoc->GetDocumentType())); } SdOptionsPrint& aPrintOpts = aOptionsPrintItem.GetOptionsPrint(); diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 182988f1d62b..ecc9c0fb9645 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -3975,7 +3975,7 @@ void SdXImpressDocument::initializeForTiledRendering(const css::uno::Sequence<cs } // Disable comments if requested - SdOptions* pOptions = SD_MOD()->GetSdOptions(mpDoc->GetDocumentType()); + SdOptions* pOptions = SdModule::get()->GetSdOptions(mpDoc->GetDocumentType()); pOptions->SetShowComments(comphelper::LibreOfficeKit::isTiledAnnotations()); pViewShell->SetRuler(false); diff --git a/sd/source/ui/unoidl/unomodule.cxx b/sd/source/ui/unoidl/unomodule.cxx index 571bca850472..743ccd62b097 100644 --- a/sd/source/ui/unoidl/unomodule.cxx +++ b/sd/source/ui/unoidl/unomodule.cxx @@ -40,15 +40,16 @@ void SAL_CALL SdUnoModule::dispatchWithNotification( const util::URL& aURL, cons SolarMutexGuard aGuard; SdDLL::Init(); - const SfxSlot* pSlot = SD_MOD()->GetInterface()->GetSlot( aURL.Complete ); + SdModule* mod = SdModule::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, SD_MOD()->GetPool() ); - const SfxPoolItemHolder aResult(SD_MOD()->ExecuteSlot(aReq)); + SfxRequest aReq( pSlot, aArgs, SfxCallMode::SYNCHRON, mod->GetPool() ); + const SfxPoolItemHolder aResult(mod->ExecuteSlot(aReq)); if (aResult) aState = frame::DispatchResultState::SUCCESS; else @@ -93,7 +94,7 @@ uno::Reference< frame::XDispatch > SAL_CALL SdUnoModule::queryDispatch( const ut { SolarMutexGuard aGuard; SdDLL::Init(); - const SfxSlot* pSlot = SD_MOD()->GetInterface()->GetSlot( aURL.Complete ); + const SfxSlot* pSlot = SdModule::get()->GetInterface()->GetSlot(aURL.Complete); uno::Reference< frame::XDispatch > xSlot; if ( pSlot ) diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx index 39e81fdc2c49..49633f61bc30 100644 --- a/sd/source/ui/unoidl/unoobj.cxx +++ b/sd/source/ui/unoidl/unoobj.cxx @@ -307,7 +307,7 @@ uno::Sequence< uno::Type > SAL_CALL SdXShape::getTypes() { SdrObjKind nObjId = mpShape->getShapeKind(); uno::Sequence< uno::Type > aTypes; - SdTypesCache& gImplTypesCache = SD_MOD()->gImplTypesCache; + SdTypesCache& gImplTypesCache = SdModule::get()->gImplTypesCache; SdTypesCache::iterator aIter( gImplTypesCache.find( nObjId ) ); if( aIter == gImplTypesCache.end() ) { @@ -382,7 +382,7 @@ css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL SdXShape::getProper css::uno::Reference<css::beans::XPropertySetInfo> pInfo; SdExtPropertySetInfoCache& rCache = (mpModel && mpModel->IsImpressDocument()) ? - SD_MOD()->gImplImpressPropertySetInfoCache : SD_MOD()->gImplDrawPropertySetInfoCache; + SdModule::get()->gImplImpressPropertySetInfoCache : SdModule::get()->gImplDrawPropertySetInfoCache; SdExtPropertySetInfoCache::iterator aIter( rCache.find( nObjId ) ); if( aIter == rCache.end() ) diff --git a/sd/source/ui/view/NotesPanelView.cxx b/sd/source/ui/view/NotesPanelView.cxx index 037fb0809cf5..42562275b70f 100644 --- a/sd/source/ui/view/NotesPanelView.cxx +++ b/sd/source/ui/view/NotesPanelView.cxx @@ -41,7 +41,7 @@ NotesPanelView::NotesPanelView(DrawDocShell& rDocSh, vcl::Window* pWindow, aModifyIdle.SetPriority(TaskPriority::LOWEST); maOutliner.Init(OutlinerMode::OutlineView); - maOutliner.SetRefDevice(SD_MOD()->GetVirtualRefDevice()); + maOutliner.SetRefDevice(SdModule::get()->GetVirtualRefDevice()); maOutliner.SetPaperSize(mrNotesPanelViewShell.GetActiveWindow()->GetViewSize()); maOutlinerView.SetOutputArea( diff --git a/sd/source/ui/view/NotesPanelViewShell.cxx b/sd/source/ui/view/NotesPanelViewShell.cxx index 5a5c9ec1407b..e2fadf2a2c5c 100644 --- a/sd/source/ui/view/NotesPanelViewShell.cxx +++ b/sd/source/ui/view/NotesPanelViewShell.cxx @@ -1362,7 +1362,7 @@ void NotesPanelViewShell::Execute(SfxRequest& rReq) { const SvxSearchItem& rSearchItem = pReqArgs->Get(SID_SEARCH_ITEM); - SD_MOD()->SetSearchItem( + SdModule::get()->SetSearchItem( std::unique_ptr<SvxSearchItem>(rSearchItem.Clone())); xFuSearch->SearchAndReplace(&rSearchItem); } diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index 9ebadaca1026..d25744a4926e 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -185,7 +185,7 @@ SdOutliner::SdOutliner( SdDrawDocument* pDoc, OutlinerMode nMode ) { SetStyleSheetPool(static_cast<SfxStyleSheetPool*>( mpDrawDocument->GetStyleSheetPool() )); SetEditTextObjectPool( &pDoc->GetItemPool() ); - SetCalcFieldValueHdl(LINK(SD_MOD(), SdModule, CalcFieldValueHdl)); + SetCalcFieldValueHdl(LINK(SdModule::get(), SdModule, CalcFieldValueHdl)); SetForbiddenCharsTable( pDoc->GetForbiddenCharsTable() ); EEControlBits nCntrl = GetControlWord(); @@ -272,7 +272,7 @@ void SdOutliner::PrepareSpelling() sd::ViewShellBase* pBase = getViewShellBase(); if (pBase != nullptr) SetViewShell (pBase->GetMainViewShell()); - SetRefDevice( SD_MOD()->GetVirtualRefDevice() ); + SetRefDevice(SdModule::get()->GetVirtualRefDevice()); std::shared_ptr<sd::ViewShell> pViewShell (mpWeakViewShell.lock()); if (pViewShell) @@ -1970,7 +1970,7 @@ void SdOutliner::PrepareConversion() void SdOutliner::BeginConversion() { - SetRefDevice( SD_MOD()->GetVirtualRefDevice() ); + SetRefDevice(SdModule::get()->GetVirtualRefDevice()); sd::ViewShellBase* pBase = getViewShellBase(); if (pBase != nullptr) diff --git a/sd/source/ui/view/ViewClipboard.cxx b/sd/source/ui/view/ViewClipboard.cxx index c17bf7de1f01..89cf897eaae9 100644 --- a/sd/source/ui/view/ViewClipboard.cxx +++ b/sd/source/ui/view/ViewClipboard.cxx @@ -222,7 +222,7 @@ sal_uInt16 ViewClipboard::InsertSlides ( false, false, nInsertPosition, - (&rTransferable == SD_MOD()->pTransferDrag), + (&rTransferable == SdModule::get()->pTransferDrag), pDataDocSh, true, bMergeMasterPages, diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index 15f1a51f1e8b..37d32df82f0f 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -368,7 +368,7 @@ void ViewShellBase::LateInit (const OUString& rsDefaultView) pFrameView->SetViewShellTypeOnLoad(pViewShell->GetShellType()); } // Show/Hide the TabBar - SdOptions* pOptions = SD_MOD()->GetSdOptions(GetDocument()->GetDocumentType()); + SdOptions* pOptions = SdModule::get()->GetSdOptions(GetDocument()->GetDocumentType()); bool bIsTabBarVisible = pOptions->IsTabBarVisible(); mpImpl->SetUserWantsTabBar( bIsTabBarVisible ); } @@ -648,7 +648,7 @@ void ViewShellBase::Execute (SfxRequest& rRequest) case SID_TOGGLE_TABBAR_VISIBILITY: { - SdOptions* pOptions = SD_MOD()->GetSdOptions(GetDocument()->GetDocumentType()); + SdOptions* pOptions = SdModule::get()->GetSdOptions(GetDocument()->GetDocumentType()); bool bIsTabBarVisible = pOptions->IsTabBarVisible(); pOptions->SetTabBarVisible( !bIsTabBarVisible ); mpImpl->SetUserWantsTabBar( !bIsTabBarVisible ); diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 4faf8b632be7..d67963b2a823 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -1914,7 +1914,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); vcl::Window* pWin = GetActiveWindow(); ScopedVclPtr<AbstractSdInsertLayerDlg> pDlg( pFact->CreateSdInsertLayerDlg(pWin ? pWin->GetFrameWeld() : nullptr, aNewAttr, true, SdResId(STR_INSERTLAYER)) ); - pDlg->SetHelpId( SD_MOD()->GetSlotPool()->GetSlot( SID_INSERTLAYER )->GetCommand() ); + pDlg->SetHelpId( SdModule::get()->GetSlotPool()->GetSlot( SID_INSERTLAYER )->GetCommand() ); // test for already existing names bool bLoop = true; @@ -2067,7 +2067,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); vcl::Window* pWin = GetActiveWindow(); ScopedVclPtr<AbstractSdInsertLayerDlg> pDlg( pFact->CreateSdInsertLayerDlg(pWin ? pWin->GetFrameWeld() : nullptr, aNewAttr, bDelete, SdResId(STR_MODIFYLAYER)) ); - pDlg->SetHelpId( SD_MOD()->GetSlotPool()->GetSlot( SID_MODIFYLAYER )->GetCommand() ); + pDlg->SetHelpId( SdModule::get()->GetSlotPool()->GetSlot( SID_MODIFYLAYER )->GetCommand() ); // test for already existing names bool bLoop = true; diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index 3611af691081..6652f8d64e9c 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -558,7 +558,7 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin) } } else if( rCEvt.GetCommand() == CommandEventId::ContextMenu && !bNativeShow && - pWin != nullptr && !mpDrawView->IsAction() && !SD_MOD()->GetWaterCan() ) + pWin != nullptr && !mpDrawView->IsAction() && !SdModule::get()->GetWaterCan() ) { OUString aPopupId; // Resource name for popup menu diff --git a/sd/source/ui/view/drviews5.cxx b/sd/source/ui/view/drviews5.cxx index 3488bc9bc6ff..118c8971d917 100644 --- a/sd/source/ui/view/drviews5.cxx +++ b/sd/source/ui/view/drviews5.cxx @@ -136,7 +136,7 @@ void DrawViewShell::ReadFrameViewData(FrameView* pView) // this option has to be adjust at the model GetDoc()->SetPickThroughTransparentTextFrames( - SD_MOD()->GetSdOptions(GetDoc()->GetDocumentType())->IsPickThrough()); + SdModule::get()->GetSdOptions(GetDoc()->GetDocumentType())->IsPickThrough()); // initialization of the Character-(Screen-) attribute if (HasRuler() != pView->HasRuler()) diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 753c34b01e4e..8bb8748e2e36 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -1064,7 +1064,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) if ( ( !aActiveLayer.isEmpty() && pPV && ( pPV->IsLayerLocked(aActiveLayer) || !pPV->IsLayerVisible(aActiveLayer) ) ) || - SD_MOD()->GetWaterCan() ) + SdModule::get()->GetWaterCan() ) { rSet.DisableItem( SID_PASTE ); rSet.DisableItem( SID_PASTE_SPECIAL ); diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx index 2779e27f7adc..78e86ff87e8a 100644 --- a/sd/source/ui/view/drviewsa.cxx +++ b/sd/source/ui/view/drviewsa.cxx @@ -132,8 +132,9 @@ DrawViewShell::DrawViewShell( ViewShellBase& rViewShellBase, vcl::Window* pParen doShow(); ConfigureAppBackgroundColor(); - SD_MOD()->GetColorConfig().AddListener(this); - maViewOptions.mnDocBackgroundColor = SD_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor; + SdModule* mod = SdModule::get(); + mod->GetColorConfig().AddListener(this); + maViewOptions.mnDocBackgroundColor = mod->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor; if (comphelper::LibreOfficeKit::isActive()) { @@ -162,7 +163,7 @@ void DrawViewShell::ImplDestroy() { destroyXSlideShowInstance(); - SD_MOD()->GetColorConfig().RemoveListener(this); + SdModule::get()->GetColorConfig().RemoveListener(this); mpSelectionChangeHandler->Disconnect(); diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index a096b31da543..b68d3e09cfdf 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -618,7 +618,7 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) return; // get SdOptions - SdOptions* pOptions = SD_MOD()->GetSdOptions(GetDoc()->GetDocumentType()); + SdOptions* pOptions = SdModule::get()->GetSdOptions(GetDoc()->GetDocumentType()); sal_uInt32 nDefaultObjectSizeWidth(pOptions->GetDefaultObjectSizeWidth()); sal_uInt32 nDefaultObjectSizeHeight(pOptions->GetDefaultObjectSizeHeight()); diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx index 037207137c75..0d9286ffcc62 100644 --- a/sd/source/ui/view/drviewsf.cxx +++ b/sd/source/ui/view/drviewsf.cxx @@ -545,7 +545,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) rSet.Put(SfxBoolItem(nWhich,false)); else { - SfxBoolItem aItem(nWhich, SD_MOD()->GetWaterCan()); + SfxBoolItem aItem(nWhich, SdModule::get()->GetWaterCan()); aAllSet.Put( aItem ); } } diff --git a/sd/source/ui/view/drviewsg.cxx b/sd/source/ui/view/drviewsg.cxx index 1e156f3df0fa..c0e71e05ad7e 100644 --- a/sd/source/ui/view/drviewsg.cxx +++ b/sd/source/ui/view/drviewsg.cxx @@ -105,7 +105,7 @@ void DrawViewShell::ExecOptionsBar( SfxRequest& rReq ) bool bDefault = false; sal_uInt16 nSlot = rReq.GetSlot(); - SdOptions* pOptions = SD_MOD()->GetSdOptions(GetDoc()->GetDocumentType()); + SdOptions* pOptions = SdModule::get()->GetSdOptions(GetDoc()->GetDocumentType()); std::shared_ptr<comphelper::ConfigurationChanges> batch( comphelper::ConfigurationChanges::create()); diff --git a/sd/source/ui/view/drviewsk.cxx b/sd/source/ui/view/drviewsk.cxx index 1aaa2039ffd6..54cb0ac55aca 100644 --- a/sd/source/ui/view/drviewsk.cxx +++ b/sd/source/ui/view/drviewsk.cxx @@ -53,7 +53,7 @@ void DrawViewShell::ConfigurationChanged( utl::ConfigurationBroadcaster* pCb, Co void DrawViewShell::ConfigureAppBackgroundColor( svtools::ColorConfig *pColorConfig ) { if (!pColorConfig) - pColorConfig = &SD_MOD()->GetColorConfig(); + pColorConfig = &SdModule::get()->GetColorConfig(); Color aFillColor( pColorConfig->GetColorValue( svtools::APPBACKGROUND ).nColor ); if (comphelper::LibreOfficeKit::isActive()) aFillColor = COL_TRANSPARENT; diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx index 3fc4c4089085..54b84a5f550f 100644 --- a/sd/source/ui/view/frmview.cxx +++ b/sd/source/ui/view/frmview.cxx @@ -246,7 +246,7 @@ FrameView::FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView /* = NULL * bInitDesignMode = false; SetDesignMode( bInitDesignMode ); - Update( SD_MOD()->GetSdOptions(pDrawDoc->GetDocumentType()) ); + Update(SdModule::get()->GetSdOptions(pDrawDoc->GetDocumentType())); } } diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index 0fa6402f1a04..15fad231a696 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -87,7 +87,7 @@ OutlineView::OutlineView( DrawDocShell& rDocSh, vcl::Window* pWindow, OutlineVie // initialize Outliner: set Reference Device bInitOutliner = true; mrOutliner.Init( OutlinerMode::OutlineView ); - mrOutliner.SetRefDevice( SD_MOD()->GetVirtualRefDevice() ); + mrOutliner.SetRefDevice(SdModule::get()->GetVirtualRefDevice()); //viewsize without the width of the image and number in front mnPaperWidth = (mrOutlineViewShell.GetActiveWindow()->GetViewSize().Width() - 4000); mrOutliner.SetPaperSize(Size(mnPaperWidth, 400000000)); diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index 189d3050bbf8..5a6be3034fb8 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -675,7 +675,7 @@ bool View::SdrBeginTextEdit( if( pOutl ) { pOutl->SetStyleSheetPool(static_cast<SfxStyleSheetPool*>( mrDoc.GetStyleSheetPool() )); - pOutl->SetCalcFieldValueHdl(LINK(SD_MOD(), SdModule, CalcFieldValueHdl)); + pOutl->SetCalcFieldValueHdl(LINK(SdModule::get(), SdModule, CalcFieldValueHdl)); EEControlBits nCntrl = pOutl->GetControlWord(); nCntrl |= EEControlBits::ALLOWBIGOBJS; nCntrl |= EEControlBits::MARKFIELDS; diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx index b2f58cfcfffd..fd4abde21279 100644 --- a/sd/source/ui/view/sdview2.cxx +++ b/sd/source/ui/view/sdview2.cxx @@ -83,7 +83,7 @@ css::uno::Reference< css::datatransfer::XTransferable > View::CreateClipboardDat // dynamically created object is destroyed automatically rtl::Reference<SdTransferable> pTransferable = new SdTransferable( &mrDoc, nullptr, false ); - SD_MOD()->pTransferClip = pTransferable.get(); + SdModule::get()->pTransferClip = pTransferable.get(); mrDoc.CreatingDataObj( pTransferable.get() ); pTransferable->SetWorkDocument( static_cast<SdDrawDocument*>(CreateMarkedObjModel().release()) ); @@ -145,7 +145,7 @@ css::uno::Reference< css::datatransfer::XTransferable > View::CreateDragDataObje { rtl::Reference<SdTransferable> pTransferable = new SdTransferable( &mrDoc, pWorkView, false ); - SD_MOD()->pTransferDrag = pTransferable.get(); + SdModule::get()->pTransferDrag = pTransferable.get(); std::unique_ptr<TransferableObjectDescriptor> pObjDesc(new TransferableObjectDescriptor); OUString aDisplayName; @@ -196,7 +196,7 @@ css::uno::Reference< css::datatransfer::XTransferable > View::CreateSelectionDat std::unique_ptr<TransferableObjectDescriptor> pObjDesc(new TransferableObjectDescriptor); const ::tools::Rectangle aMarkRect( GetAllMarkedRect() ); - SD_MOD()->pTransferSelection = pTransferable.get(); + SdModule::get()->pTransferSelection = pTransferable.get(); if( mpDocSh ) { @@ -232,10 +232,11 @@ void View::ClearSelectionClipboard() // true case return; if (!mpViewSh->GetActiveWindow()) return; - if (SD_MOD()->pTransferSelection && SD_MOD()->pTransferSelection->GetView() == this) + SdModule* mod = SdModule::get(); + if (mod->pTransferSelection && mod->pTransferSelection->GetView() == this) { TransferableHelper::ClearPrimarySelection(); - SD_MOD()->pTransferSelection = nullptr; + mod->pTransferSelection = nullptr; } } @@ -378,7 +379,7 @@ void View::DragFinished( sal_Int8 nDropAction ) BegUndo(aStr + " " + mpDragSrcMarkList->GetMarkDescription()); } - SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag; + SdTransferable* pDragTransferable = SdModule::get()->pTransferDrag; if( pDragTransferable ) pDragTransferable->SetView( nullptr ); @@ -473,7 +474,7 @@ sal_Int8 View::AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTarge if( !bIsInsideOutlinerView ) { - SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag; + SdTransferable* pDragTransferable = SdModule::get()->pTransferDrag; if(pDragTransferable && (nDropAction & DND_ACTION_LINK)) { diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index 4f7a52b0a9c3..c16f92b7349c 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -300,15 +300,16 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, // try to get own transfer data if( pImplementation ) { - if( SD_MOD()->pTransferClip == pImplementation ) - pOwnData = SD_MOD()->pTransferClip; - else if( SD_MOD()->pTransferDrag == pImplementation ) + SdModule* mod = SdModule::get(); + if (mod->pTransferClip == pImplementation) + pOwnData = mod->pTransferClip; + else if (mod->pTransferDrag == pImplementation) { - pOwnData = SD_MOD()->pTransferDrag; + pOwnData = mod->pTransferDrag; bSelfDND = true; } - else if( SD_MOD()->pTransferSelection == pImplementation ) - pOwnData = SD_MOD()->pTransferSelection; + else if (mod->pTransferSelection == pImplementation) + pOwnData = mod->pTransferSelection; } const bool bGroupUndoFromDragWithDrop = bSelfDND && mpDragSrcMarkList && IsUndoEnabled(); @@ -467,7 +468,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, // calculate real position of current // source objects, if necessary (#103207) - if( pOwnData == SD_MOD()->pTransferSelection ) + if (pOwnData == SdModule::get()->pTransferSelection) { ::tools::Rectangle aCurBoundRect; diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 261c6aaf7701..6c139827182e 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -383,7 +383,7 @@ void ViewShell::UIDeactivated( SfxInPlaceClient* ) void ViewShell::Deactivate(bool bIsMDIActivate) { // remove view from a still active drag'n'drop session - SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag; + SdTransferable* pDragTransferable = SdModule::get()->pTransferDrag; if (IsMainViewShell()) GetDocSh()->Disconnect(this); commit 2ca32d2905aaf42ca3feaae04a55500c708fe8ad Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Thu Nov 14 18:53:16 2024 +0500 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Sun Nov 24 07:43:07 2024 +0100 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.kagan...@collabora.com> diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx index 334faf772738..c77fa3d0d7b7 100644 --- a/sw/inc/swmodule.hxx +++ b/sw/inc/swmodule.hxx @@ -251,11 +251,12 @@ public: SW_DLLPUBLIC void RegisterAutomationApplicationEventsCaller(css::uno::Reference< ooo::vba::XSinkCaller > const& xCaller); void CallAutomationApplicationEventSinks(const OUString& Method, css::uno::Sequence< css::uno::Any >& Arguments); -}; -// Access to SwModule, the View and the shell. +// Access to SwModule + static auto get() { return static_cast<SwModule*>(SfxApplication::GetModule(SfxToolsModule::Writer)); } +}; -#define SW_MOD() ( static_cast<SwModule*>(SfxApplication::GetModule(SfxToolsModule::Writer))) +// Access to the View and the shell. SAL_RET_MAYBENULL SW_DLLPUBLIC SwView* GetActiveView(); SAL_RET_MAYBENULL SW_DLLPUBLIC SwWrtShell* GetActiveWrtShell(); diff --git a/sw/qa/core/attr/attr.cxx b/sw/qa/core/attr/attr.cxx index fcb68493875f..fbacf044cb48 100644 --- a/sw/qa/core/attr/attr.cxx +++ b/sw/qa/core/attr/attr.cxx @@ -39,7 +39,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSwAttrSet) dispatchCommand(mxComponent, u".uno:Cut"_ustr, {}); dispatchCommand(mxComponent, u".uno:SelectAll"_ustr, {}); rtl::Reference<SwTransferable> xTransferable(new SwTransferable(*pWrtShell)); - SwModule* pMod = SW_MOD(); + SwModule* pMod = SwModule::get(); SwTransferable* pOldTransferable = pMod->m_pXSelection; pMod->m_pXSelection = xTransferable.get(); diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx index 8dbb4cff6a14..fa6b75e9da92 100644 --- a/sw/qa/extras/htmlexport/htmlexport.cxx +++ b/sw/qa/extras/htmlexport/htmlexport.cxx @@ -101,8 +101,8 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testFdo86857) CPPUNIT_TEST_FIXTURE(HtmlExportTest, testCharacterBorder) { // FIXME if padding-top gets exported as inches, not cms, we get rounding errors. - SwGlobals::ensure(); // make sure that SW_MOD() is not 0 - SwMasterUsrPref* pPref = const_cast<SwMasterUsrPref*>(SW_MOD()->GetUsrPref(false)); + SwGlobals::ensure(); // make sure that SwModule::get() is not 0 + SwMasterUsrPref* pPref = const_cast<SwMasterUsrPref*>(SwModule::get()->GetUsrPref(false)); FieldUnit eUnit = pPref->GetMetric(); pPref->SetMetric(FieldUnit::CM); comphelper::ScopeGuard g([pPref, eUnit]() { pPref->SetMetric(eUnit); }); diff --git a/sw/qa/extras/tiledrendering/tiledrenderingmodeltestbase.cxx b/sw/qa/extras/tiledrendering/tiledrenderingmodeltestbase.cxx index 62d41e0a63b0..a53770b06cc3 100644 --- a/sw/qa/extras/tiledrendering/tiledrenderingmodeltestbase.cxx +++ b/sw/qa/extras/tiledrendering/tiledrenderingmodeltestbase.cxx @@ -84,7 +84,7 @@ void SwTiledRenderingTest::setUp() SwModelTestBase::setUp(); SwGlobals::ensure(); - SW_MOD()->ClearRedlineAuthors(); + SwModule::get()->ClearRedlineAuthors(); comphelper::LibreOfficeKit::setActive(true); } diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index be9cb4d7416f..dd683c11acce 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -1874,7 +1874,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf68183) // First disable RSID and check if indeed no such attribute is inserted. createSwDoc(); SwDoc* pDoc = getSwDoc(); - SW_MOD()->GetModuleConfig()->SetStoreRsid(false); + SwModule* mod = SwModule::get(); + mod->GetModuleConfig()->SetStoreRsid(false); SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); pWrtShell->Insert2(u"X"_ustr); @@ -1884,7 +1885,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf68183) CPPUNIT_ASSERT_EQUAL(false, pTextNode->GetSwAttrSet().HasItem(RES_PARATR_RSID)); // Then enable storing of RSID and make sure that the attribute is inserted. - SW_MOD()->GetModuleConfig()->SetStoreRsid(true); + mod->GetModuleConfig()->SetStoreRsid(true); pWrtShell->DelToStartOfLine(); pWrtShell->Insert2(u"X"_ustr); diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index 9ac1e8321bef..c62078af50d0 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -1503,7 +1503,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf94386) SfxItemSet aSet(pWrtShell->GetView().GetCurShell()->GetPool(), svl::Items<FN_ENVELOP, FN_ENVELOP>); aSet.Put(SwEnvItem()); SfxRequest aRequest(FN_ENVELOP, SfxCallMode::SYNCHRON, aSet); - SW_MOD()->ExecOther(aRequest); + SwModule::get()->ExecOther(aRequest); } saveAndReload(u"MS Word 97"_ustr); diff --git a/sw/qa/uibase/uiview/uiview.cxx b/sw/qa/uibase/uiview/uiview.cxx index a7453f0b8f6e..531d4d351432 100644 --- a/sw/qa/uibase/uiview/uiview.cxx +++ b/sw/qa/uibase/uiview/uiview.cxx @@ -124,7 +124,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, testKeepRatio) comphelper::ScopeGuard g([pWrtShell, pViewOption] { SwViewOption aViewOption(*pViewOption); aViewOption.SetKeepRatio(false); - SW_MOD()->ApplyUsrPref(aViewOption, &pWrtShell->GetView()); + SwModule::get()->ApplyUsrPref(aViewOption, &pWrtShell->GetView()); }); // Without the accompanying fix in place, this test would have failed, because KeepRatio was not // mapped to settings.xml diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx index 8bad1e5c5f06..e2d4bea133e0 100644 --- a/sw/source/core/access/accdoc.cxx +++ b/sw/source/core/access/accdoc.cxx @@ -714,7 +714,7 @@ uno::Any SAL_CALL SwAccessibleDocument::getExtendedAttributes() sal_Int32 SAL_CALL SwAccessibleDocument::getBackground() { SolarMutexGuard aGuard; - return sal_Int32(SW_MOD()->GetColorConfig().GetColorValue( ::svtools::DOCCOLOR ).nColor); + return sal_Int32(SwModule::get()->GetColorConfig().GetColorValue(::svtools::DOCCOLOR).nColor); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 57743ad19cdc..09ca10c3265d 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -1837,7 +1837,7 @@ void SwAccessibleParagraph::_correctValues( const sal_Int32 nIndex, if ( pRedline ) { - const SwModuleOptions *pOpt = SW_MOD()->GetModuleConfig(); + const SwModuleOptions* pOpt = SwModule::get()->GetModuleConfig(); AuthorCharAttr aChangeAttr; if ( pOpt ) { diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index 26ea024c511c..5512e4259651 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -271,7 +271,7 @@ SwCalc::SwCalc( SwDoc& rD ) for( n = 0; n < 4; ++n ) lcl_GetCalcExp(m_aVarTable, sNTypeTab[n + 7]).nValue.PutLong( rDocStat.*aDocStat2[ n ] ); - SvtUserOptions& rUserOptions = SW_MOD()->GetUserOptions(); + SvtUserOptions& rUserOptions = SwModule::get()->GetUserOptions(); lcl_GetCalcExp(m_aVarTable, sNTypeTab[11]).nValue.PutString( rUserOptions.GetFirstName() ); lcl_GetCalcExp(m_aVarTable, sNTypeTab[12]).nValue.PutString( rUserOptions.GetLastName() ); diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index c823eccd94e6..da24bbaf4d5e 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -336,7 +336,7 @@ ItemInfoPackage& getItemInfoPackageSwAttributes() { RES_TXTATR_METAFIELD, SwFormatMeta::CreatePoolDefault(RES_TXTATR_METAFIELD), 0, SFX_ITEMINFOFLAG_NONE }, { RES_TXTATR_AUTOFMT, new SwFormatAutoFormat, 0, SFX_ITEMINFOFLAG_NONE }, - // We cannot yet create the SwFormatINetFormat, that would crash since SW_MOD + // We cannot yet create the SwFormatINetFormat, that would crash since SwModule::get // is not initialized and the translated resource strings would not be available. // Luckily this mechanism allows to also flag this ItemInfo as 'incomplete' using // a nullptr as ItemPtr and implementing on-demand creation, see ::getItemInfo diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index b6f2ba079fbf..82e128f0fd95 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -3850,13 +3850,13 @@ bool DocumentRedlineManager::SetRedlineComment( const SwPaM& rPaM, const OUStrin // Create a new author if necessary std::size_t DocumentRedlineManager::GetRedlineAuthor() { - return SW_MOD()->GetRedlineAuthor(); + return SwModule::get()->GetRedlineAuthor(); } /// Insert new author into the Table for the Readers etc. std::size_t DocumentRedlineManager::InsertRedlineAuthor( const OUString& rNew ) { - return SW_MOD()->InsertRedlineAuthor(rNew); + return SwModule::get()->InsertRedlineAuthor(rNew); } void DocumentRedlineManager::UpdateRedlineAttr() diff --git a/sw/source/core/doc/DocumentSettingManager.cxx b/sw/source/core/doc/DocumentSettingManager.cxx index 2d9e2c389724..2f9d4f840d90 100644 --- a/sw/source/core/doc/DocumentSettingManager.cxx +++ b/sw/source/core/doc/DocumentSettingManager.cxx @@ -670,7 +670,7 @@ sal_uInt16 sw::DocumentSettingManager::getLinkUpdateMode( /*[in]*/bool bGlobalSe { sal_uInt16 nRet = mnLinkUpdMode; if( bGlobalSettings && GLOBALSETTING == nRet ) - nRet = SW_MOD()->GetLinkUpdMode(); + nRet = SwModule::get()->GetLinkUpdMode(); return nRet; } @@ -683,7 +683,7 @@ SwFieldUpdateFlags sw::DocumentSettingManager::getFieldUpdateFlags( /*[in]*/bool { SwFieldUpdateFlags eRet = meFieldUpdMode; if( bGlobalSettings && AUTOUPD_GLOBALSETTING == eRet ) - eRet = SW_MOD()->GetFieldUpdateFlags(); + eRet = SwModule::get()->GetFieldUpdateFlags(); return eRet; } diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 2c23d36d6c16..a7351ea9ef7a 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -2115,27 +2115,27 @@ bool SwDoc::ConvertFieldsToText(SwRootFrame const& rLayout) bool SwDoc::IsInsTableFormatNum() const { - return SW_MOD()->IsInsTableFormatNum(GetDocumentSettingManager().get(DocumentSettingId::HTML_MODE)); + return SwModule::get()->IsInsTableFormatNum(GetDocumentSettingManager().get(DocumentSettingId::HTML_MODE)); } bool SwDoc::IsInsTableChangeNumFormat() const { - return SW_MOD()->IsInsTableChangeNumFormat(GetDocumentSettingManager().get(DocumentSettingId::HTML_MODE)); + return SwModule::get()->IsInsTableChangeNumFormat(GetDocumentSettingManager().get(DocumentSettingId::HTML_MODE)); } bool SwDoc::IsInsTableAlignNum() const { - return SW_MOD()->IsInsTableAlignNum(GetDocumentSettingManager().get(DocumentSettingId::HTML_MODE)); + return SwModule::get()->IsInsTableAlignNum(GetDocumentSettingManager().get(DocumentSettingId::HTML_MODE)); } bool SwDoc::IsSplitVerticalByDefault() const { - return SW_MOD()->IsSplitVerticalByDefault(GetDocumentSettingManager().get(DocumentSettingId::HTML_MODE)); + return SwModule::get()->IsSplitVerticalByDefault(GetDocumentSettingManager().get(DocumentSettingId::HTML_MODE)); } void SwDoc::SetSplitVerticalByDefault(bool value) { - SW_MOD()->SetSplitVerticalByDefault(GetDocumentSettingManager().get(DocumentSettingId::HTML_MODE), value); + SwModule::get()->SetSplitVerticalByDefault(GetDocumentSettingManager().get(DocumentSettingId::HTML_MODE), value); } /// Set up the InsertDB as Undo table diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index 17999886deb1..50aea4a5a20e 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -1837,7 +1837,8 @@ tools::Long SwDoc::CompareDoc( const SwDoc& rDoc ) tools::Long nRet = 0; // Get comparison options - CmpOptions.eCmpMode = SW_MOD()->GetCompareMode(); + SwModule* mod = SwModule::get(); + CmpOptions.eCmpMode = mod->GetCompareMode(); if( CmpOptions.eCmpMode == SwCompareMode::Auto ) { if( getRsidRoot() == rDoc.getRsidRoot() ) @@ -1855,8 +1856,8 @@ tools::Long SwDoc::CompareDoc( const SwDoc& rDoc ) } else { - CmpOptions.bUseRsid = getRsidRoot() == rDoc.getRsidRoot() && SW_MOD()->IsUseRsid(); - CmpOptions.nIgnoreLen = SW_MOD()->IsIgnorePieces() ? SW_MOD()->GetPieceLen() : 0; + CmpOptions.bUseRsid = getRsidRoot() == rDoc.getRsidRoot() && mod->IsUseRsid(); + CmpOptions.nIgnoreLen = mod->IsIgnorePieces() ? mod->GetPieceLen() : 0; } GetIDocumentUndoRedo().StartUndo(SwUndoId::EMPTY, nullptr); diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 085cdd9770f1..1e10a532c2a9 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -411,7 +411,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg, /// Set the rsid of the next nLen symbols of rRg to the current session number void SwDoc::UpdateRsid( const SwPaM &rRg, const sal_Int32 nLen ) { - if (!SW_MOD()->GetModuleConfig()->IsStoreRsid()) + if (!SwModule::get()->GetModuleConfig()->IsStoreRsid()) return; SwTextNode *pTextNode = rRg.GetPoint()->GetNode().GetTextNode(); @@ -442,7 +442,7 @@ void SwDoc::UpdateRsid( const SwPaM &rRg, const sal_Int32 nLen ) bool SwDoc::UpdateParRsid( SwTextNode *pTextNode, sal_uInt32 nVal ) { - if (!SW_MOD()->GetModuleConfig()->IsStoreRsid()) + if (!SwModule::get()->GetModuleConfig()->IsStoreRsid()) return false; if (!pTextNode) diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 00c6d8080286..b6fbed83c51c 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -887,7 +887,7 @@ lcl_InsertLabel(SwDoc & rDoc, SwTextFormatColls *const pTextFormatCollTable, if( pNew ) { // #i61007# order of captions - bool bOrderNumberingFirst = SW_MOD()->GetModuleConfig()->IsCaptionOrderNumberingFirst(); + bool bOrderNumberingFirst = SwModule::get()->GetModuleConfig()->IsCaptionOrderNumberingFirst(); // Work up OUString OUString aText; if( bOrderNumberingFirst ) @@ -1180,7 +1180,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTextFormatColls *const pTextFormatCollTable if( pNew ) { //#i61007# order of captions - bool bOrderNumberingFirst = SW_MOD()->GetModuleConfig()->IsCaptionOrderNumberingFirst(); + bool bOrderNumberingFirst = SwModule::get()->GetModuleConfig()->IsCaptionOrderNumberingFirst(); // prepare string OUString aText; diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 9ccc8348a561..988ec45884f0 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -1359,7 +1359,7 @@ void SwRedlineData::dumpAsXml(xmlTextWriterPtr pWriter) const (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this); (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("id"), BAD_CAST(OString::number(GetSeqNo()).getStr())); - (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("author"), BAD_CAST(SW_MOD()->GetRedlineAuthor(GetAuthor()).toUtf8().getStr())); + (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("author"), BAD_CAST(SwModule::get()->GetRedlineAuthor(GetAuthor()).toUtf8().getStr())); (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("date"), BAD_CAST(DateTimeToOString(GetTimeStamp()).getStr())); (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("descr"), BAD_CAST(GetDescr().toUtf8().getStr())); @@ -1572,7 +1572,7 @@ void SwRangeRedline::Show(sal_uInt16 nLoop, size_t nMyPos, bool bForced) if (pSh) bIsShowChangesInMargin = pSh->GetViewOptions()->IsShowChangesInMargin(); else - bIsShowChangesInMargin = SW_MOD()->GetUsrPref(false)->IsShowChangesInMargin(); + bIsShowChangesInMargin = SwModule::get()->GetUsrPref(false)->IsShowChangesInMargin(); } if( 1 > nLoop && !bIsShowChangesInMargin ) @@ -2268,7 +2268,7 @@ std::size_t SwRangeRedline::GetAuthor( sal_uInt16 nPos ) const OUString const & SwRangeRedline::GetAuthorString( sal_uInt16 nPos ) const { - return SW_MOD()->GetRedlineAuthor(GetRedlineData(nPos).m_nAuthor); + return SwModule::get()->GetRedlineAuthor(GetRedlineData(nPos).m_nAuthor); } sal_uInt32 SwRangeRedline::GetMovedID(sal_uInt16 nPos) const diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index ec439961d788..948b955b196f 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -322,13 +322,14 @@ SwAuthorFieldType::SwAuthorFieldType() OUString SwAuthorFieldType::Expand(sal_uLong nFormat) { - SvtUserOptions& rOpt = SW_MOD()->GetUserOptions(); + SwModule* mod = SwModule::get(); + SvtUserOptions& rOpt = mod->GetUserOptions(); if((nFormat & 0xff) == AF_NAME) { // Prefer the view's redline author name. // (set in SwXTextDocument::initializeForTiledRendering) - std::size_t nAuthor = SW_MOD()->GetRedlineAuthor(); - OUString sAuthor = SW_MOD()->GetRedlineAuthor(nAuthor); + std::size_t nAuthor = mod->GetRedlineAuthor(); + OUString sAuthor = mod->GetRedlineAuthor(nAuthor); if (sAuthor.isEmpty()) return rOpt.GetFullName(); @@ -2074,7 +2075,7 @@ OUString SwExtUserFieldType::Expand(sal_uInt16 nSub ) } if( static_cast<UserOptToken>(USHRT_MAX) != nRet ) { - SvtUserOptions& rUserOpt = SW_MOD()->GetUserOptions(); + SvtUserOptions& rUserOpt = SwModule::get()->GetUserOptions(); return rUserOpt.GetToken( nRet ); } return OUString(); diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 14cac86e962a..2ccb8b34116d 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -3961,7 +3961,7 @@ bool IsExtraData( const SwDoc *pDoc ) const SwLineNumberInfo &rInf = pDoc->GetLineNumberInfo(); if (rInf.IsPaintLineNumbers() || rInf.IsCountInFlys() || - (static_cast<sal_Int16>(SW_MOD()->GetRedlineMarkPos()) != text::HoriOrientation::NONE && + (static_cast<sal_Int16>(SwModule::get()->GetRedlineMarkPos()) != text::HoriOrientation::NONE && !pDoc->getIDocumentRedlineAccess().GetRedlineTable().empty())) { return true; diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 1120879e707a..8e2b97e7c045 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -7655,7 +7655,7 @@ void SwPageFrame::RefreshExtraData( const SwRect &rRect ) const { const SwLineNumberInfo &rInfo = GetFormat()->GetDoc()->GetLineNumberInfo(); bool bLineInFly = (rInfo.IsPaintLineNumbers() && rInfo.IsCountInFlys()) - || static_cast<sal_Int16>(SW_MOD()->GetRedlineMarkPos()) != text::HoriOrientation::NONE; + || static_cast<sal_Int16>(SwModule::get()->GetRedlineMarkPos()) != text::HoriOrientation::NONE; SwRect aRect( rRect ); ::SwAlignRect( aRect, gProp.pSGlobalShell, gProp.pSGlobalShell->GetOut() ); @@ -7682,7 +7682,7 @@ void SwLayoutFrame::RefreshExtraData( const SwRect &rRect ) const const SwLineNumberInfo &rInfo = GetFormat()->GetDoc()->GetLineNumberInfo(); bool bLineInBody = rInfo.IsPaintLineNumbers(), bLineInFly = bLineInBody && rInfo.IsCountInFlys(), - bRedLine = static_cast<sal_Int16>(SW_MOD()->GetRedlineMarkPos())!=text::HoriOrientation::NONE; + bRedLine = static_cast<sal_Int16>(SwModule::get()->GetRedlineMarkPos())!=text::HoriOrientation::NONE; const SwContentFrame *pCnt = ContainsContent(); while ( pCnt && IsAnLower( pCnt ) ) diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx index b23741335cb0..ce6f31a4e88f 100644 --- a/sw/source/core/text/frmpaint.cxx +++ b/sw/source/core/text/frmpaint.cxx @@ -295,7 +295,7 @@ void SwExtraPainter::PaintRedline( SwTwips nY, tools::Long nMax ) } } const Color aOldCol( m_pSh->GetOut()->GetLineColor() ); - m_pSh->GetOut()->SetLineColor( SW_MOD()->GetRedlineMarkColor() ); + m_pSh->GetOut()->SetLineColor(SwModule::get()->GetRedlineMarkColor()); if ( m_pTextFrame->IsVertical() ) { @@ -320,7 +320,7 @@ void SwTextFrame::PaintExtraData( const SwRect &rRect ) const const SwFormatLineNumber &rLineNum = GetAttrSet()->GetLineNumber(); bool bLineNum = !IsInTab() && rLineInf.IsPaintLineNumbers() && ( !IsInFly() || rLineInf.IsCountInFlys() ) && rLineNum.IsCount(); - sal_Int16 eHor = static_cast<sal_Int16>(SW_MOD()->GetRedlineMarkPos()); + sal_Int16 eHor = static_cast<sal_Int16>(SwModule::get()->GetRedlineMarkPos()); if (eHor != text::HoriOrientation::NONE && (!IDocumentRedlineAccess::IsShowChanges(rIDRA.GetRedlineFlags()) || getRootFrame()->IsHideRedlines())) diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index 1d7bbaf42e18..ec2d82be4356 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -313,7 +313,7 @@ void SwTextSizeInfo::CtorInitTextSizeInfo( OutputDevice* pRenderContext, SwTextF m_pOpt = m_pVsh ? m_pVsh->GetViewOptions() : - SW_MOD()->GetViewOption(rDoc.getIDocumentSettingAccess().get(DocumentSettingId::HTML_MODE)); // Options from Module, due to StarONE + SwModule::get()->GetViewOption(rDoc.getIDocumentSettingAccess().get(DocumentSettingId::HTML_MODE)); // Options from Module, due to StarONE // bURLNotify is set if MakeGraphic prepares it // TODO: Unwind @@ -1637,7 +1637,7 @@ void SwTextFormatInfo::CtorInitTextFormatInfo( OutputDevice* pRenderContext, SwT m_nLineNetHeight = 0; SetLineStart(TextFrameIndex(0)); - SvtCTLOptions::TextNumerals const nTextNumerals(SW_MOD()->GetCTLTextNumerals()); + SvtCTLOptions::TextNumerals const nTextNumerals(SwModule::get()->GetCTLTextNumerals()); // cannot cache for NUMERALS_CONTEXT because we need to know the string // for the whole paragraph now if (nTextNumerals != SvtCTLOptions::NUMERALS_CONTEXT) diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx index 9b4175d9697e..9285bf457803 100644 --- a/sw/source/core/text/redlnitr.cxx +++ b/sw/source/core/text/redlnitr.cxx @@ -873,14 +873,14 @@ void SwRedlineItr::FillHints( std::size_t nAuthor, RedlineType eType ) switch ( eType ) { case RedlineType::Insert: - SW_MOD()->GetInsertAuthorAttr(nAuthor, *m_pSet); + SwModule::get()->GetInsertAuthorAttr(nAuthor, *m_pSet); break; case RedlineType::Delete: - SW_MOD()->GetDeletedAuthorAttr(nAuthor, *m_pSet); + SwModule::get()->GetDeletedAuthorAttr(nAuthor, *m_pSet); break; case RedlineType::Format: case RedlineType::FmtColl: - SW_MOD()->GetFormatAuthorAttr(nAuthor, *m_pSet); + SwModule::get()->GetFormatAuthorAttr(nAuthor, *m_pSet); break; default: break; diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx index 3020a2118722..a9406f55740c 100644 --- a/sw/source/core/text/txtfld.cxx +++ b/sw/source/core/text/txtfld.cxx @@ -485,9 +485,9 @@ static bool lcl_setRedlineAttr( SwTextFormatInfo &rInf, const SwTextNode& rTextN : pRedlineNum->GetAuthor(); if ( RedlineType::Delete == pRedlineNum->GetType() ) - SW_MOD()->GetDeletedAuthorAttr(aAuthor, aSet); + SwModule::get()->GetDeletedAuthorAttr(aAuthor, aSet); else - SW_MOD()->GetInsertAuthorAttr(aAuthor, aSet); + SwModule::get()->GetInsertAuthorAttr(aAuthor, aSet); if (const SvxColorItem* pItem = aSet.GetItemIfSet(RES_CHRATR_COLOR)) pNumFnt->SetColor(pItem->GetValue()); diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx index 787ea1390e78..0cf0f266511a 100644 --- a/sw/source/core/text/txtftn.cxx +++ b/sw/source/core/text/txtftn.cxx @@ -1015,9 +1015,9 @@ SwNumberPortion *SwTextFormatter::NewFootnoteNumPortion( SwTextFormatInfo const : pRedline->GetAuthor(); if ( RedlineType::Delete == pRedline->GetType() ) - SW_MOD()->GetDeletedAuthorAttr(aAuthor, aSet); + SwModule::get()->GetDeletedAuthorAttr(aAuthor, aSet); else - SW_MOD()->GetInsertAuthorAttr(aAuthor, aSet); + SwModule::get()->GetInsertAuthorAttr(aAuthor, aSet); if (const SvxColorItem* pItem = aSet.GetItemIfSet(RES_CHRATR_COLOR)) pNumFnt->SetColor(pItem->GetValue()); diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 864d3c99ecfb..905d65d0a8b8 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -1012,7 +1012,7 @@ Size SwSubFont::GetTextSize_( SwDrawTextInfo& rInf ) ChgFnt( rInf.GetShell(), rInf.GetOut() ); SwDigitModeModifier aDigitModeModifier(rInf.GetOut(), rInf.GetFont()->GetLanguage(), - SW_MOD()->GetCTLTextNumerals()); + SwModule::get()->GetCTLTextNumerals()); Size aTextSize; TextFrameIndex const nLn = rInf.GetLen() == TextFrameIndex(COMPLETE_STRING) @@ -1142,7 +1142,7 @@ void SwSubFont::DrawText_( SwDrawTextInfo &rInf, const bool bGrey ) ChgFnt( rInf.GetShell(), rInf.GetOut() ); SwDigitModeModifier aDigitModeModifier(rInf.GetOut(), rInf.GetFont()->GetLanguage(), - SW_MOD()->GetCTLTextNumerals()); + SwModule::get()->GetCTLTextNumerals()); const Point aOldPos(rInf.GetPos()); Point aPos( rInf.GetPos() ); @@ -1268,7 +1268,7 @@ void SwSubFont::DrawStretchText_( SwDrawTextInfo &rInf ) ChgFnt( rInf.GetShell(), rInf.GetOut() ); SwDigitModeModifier aDigitModeModifier(rInf.GetOut(), rInf.GetFont()->GetLanguage(), - SW_MOD()->GetCTLTextNumerals()); + SwModule::get()->GetCTLTextNumerals()); rInf.ApplyAutoColor(); @@ -1334,7 +1334,7 @@ TextFrameIndex SwSubFont::GetModelPositionForViewPoint_( SwDrawTextInfo& rInf ) ChgFnt( rInf.GetShell(), rInf.GetOut() ); SwDigitModeModifier aDigitModeModifier(rInf.GetOut(), rInf.GetFont()->GetLanguage(), - SW_MOD()->GetCTLTextNumerals()); + SwModule::get()->GetCTLTextNumerals()); TextFrameIndex const nLn = rInf.GetLen() == TextFrameIndex(COMPLETE_STRING) ? TextFrameIndex(rInf.GetText().getLength()) diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index e3ae5955a6da..0b448c74ead5 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -228,7 +228,7 @@ lcl_MaskRedlinesAndHiddenText( const SwTextNode& rNode, OUStringBuffer& rText, nRedlinesMasked = lcl_MaskRedlines( rNode, rText, nStt, nEnd, cChar ); } - const bool bHideHidden = !SW_MOD()->GetViewOption(rDoc.GetDocumentSettingManager().get(DocumentSettingId::HTML_MODE))->IsShowHiddenChar(); + const bool bHideHidden = !SwModule::get()->GetViewOption(rDoc.GetDocumentSettingManager().get(DocumentSettingId::HTML_MODE))->IsShowHiddenChar(); // If called from word count, we want to mask the hidden ranges even // if they are visible: diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index b4a277ec5df4..88a4da9e3dd3 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -377,7 +377,8 @@ void SwHTMLWriter::SetupFilterFromPropertyValues( ErrCode SwHTMLWriter::WriteStream() { - if (!SW_MOD()) + SwModule* mod = SwModule::get(); + if (!mod) return ERRCODE_ABORT; // Intercept paste output if requested. char* pPasteEnv = getenv("SW_DEBUG_HTML_PASTE_TO"); @@ -439,7 +440,7 @@ ErrCode SwHTMLWriter::WriteStream() if( IsHTMLMode(HTMLMODE_SOME_STYLES | HTMLMODE_FULL_STYLES) ) m_nHTMLMode |= HTMLMODE_PRINT_EXT; - m_eCSS1Unit = SW_MOD()->GetMetric( m_pDoc->getIDocumentSettingAccess().get(DocumentSettingId::HTML_MODE) ); + m_eCSS1Unit = mod->GetMetric( m_pDoc->getIDocumentSettingAccess().get(DocumentSettingId::HTML_MODE) ); // Only for the MS-IE we favour the export of styles. m_bCfgPreferStyles = HTML_CFG_MSIE == m_nExportMode; diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 8061bdcd9f49..84605d814f7d 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2214,7 +2214,7 @@ void DocxAttributeOutput::DoWriteMoveRangeTagStart(std::u16string_view bookmarkN SvtSecurityOptions::EOption::DocWarnRemovePersonalInfo ) && !SvtSecurityOptions::IsOptionSet( SvtSecurityOptions::EOption::DocWarnKeepRedlineInfo); - const OUString &rAuthor( SW_MOD()->GetRedlineAuthor( pRedlineData->GetAuthor() ) ); + const OUString& rAuthor(SwModule::get()->GetRedlineAuthor(pRedlineData->GetAuthor())); const DateTime& aDateTime = pRedlineData->GetTimeStamp(); bool bNoDate = bRemovePersonalInfo || ( aDateTime.GetYear() == 1970 && aDateTime.GetMonth() == 1 && aDateTime.GetDay() == 1 ); @@ -4106,7 +4106,7 @@ void DocxAttributeOutput::Redline( const SwRedlineData* pRedlineData) SvtSecurityOptions::EOption::DocWarnKeepRedlineInfo); OString aId( OString::number( pRedlineData->GetSeqNo() ) ); - const OUString &rAuthor( SW_MOD()->GetRedlineAuthor( pRedlineData->GetAuthor() ) ); + const OUString& rAuthor(SwModule::get()->GetRedlineAuthor(pRedlineData->GetAuthor())); const DateTime& aDateTime = pRedlineData->GetTimeStamp(); bool bNoDate = bRemovePersonalInfo || ( aDateTime.GetYear() == 1970 && aDateTime.GetMonth() == 1 && aDateTime.GetDay() == 1 ); @@ -4262,7 +4262,7 @@ void DocxAttributeOutput::StartRedline( const SwRedlineData * pRedlineData, bool SvtSecurityOptions::EOption::DocWarnRemovePersonalInfo ) && !SvtSecurityOptions::IsOptionSet( SvtSecurityOptions::EOption::DocWarnKeepRedlineInfo); - const OUString &rAuthor( SW_MOD()->GetRedlineAuthor( pRedlineData->GetAuthor() ) ); + const OUString& rAuthor(SwModule::get()->GetRedlineAuthor(pRedlineData->GetAuthor())); OString aAuthor( OUStringToOString( bRemovePersonalInfo ? "Author" + OUString::number( GetExport().GetInfoID(rAuthor) ) : rAuthor, RTL_TEXTENCODING_UTF8 ) ); diff --git a/sw/source/filter/ww8/docxtableexport.cxx b/sw/source/filter/ww8/docxtableexport.cxx index d8ee80836b0f..6a35e414a2d9 100644 --- a/sw/source/filter/ww8/docxtableexport.cxx +++ b/sw/source/filter/ww8/docxtableexport.cxx @@ -675,7 +675,7 @@ void DocxAttributeOutput::TableRowRedline( // use the same redline id in OOXML exported by MSO, but it seems, the recent solution // (different IDs for different ranges, also row changes) is also portable. OString aId(OString::number(m_nRedlineId++)); - const OUString& rAuthor(SW_MOD()->GetRedlineAuthor(aRedlineData.GetAuthor())); + const OUString& rAuthor(SwModule::get()->GetRedlineAuthor(aRedlineData.GetAuthor())); OString aAuthor(OUStringToOString( bRemovePersonalInfo ? "Author" + OUString::number(GetExport().GetInfoID(rAuthor)) : rAuthor, @@ -746,7 +746,7 @@ void DocxAttributeOutput::TableCellRedline( // use the same redline id in OOXML exported by MSO, but it seems, the recent solution // (different IDs for different ranges, also row changes) is also portable. OString aId(OString::number(m_nRedlineId++)); - const OUString& rAuthor(SW_MOD()->GetRedlineAuthor(aRedlineData.GetAuthor())); + const OUString& rAuthor(SwModule::get()->GetRedlineAuthor(aRedlineData.GetAuthor())); OString aAuthor(OUStringToOString( bRemovePersonalInfo ? "Author" + OUString::number(GetExport().GetInfoID(rAuthor)) : rAuthor, diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 7ddde4e78101..4f881ab90d84 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -637,7 +637,7 @@ void RtfAttributeOutput::Redline(const SwRedlineData* pRedline) m_aRun->append(OOO_STRING_SVTOOLS_RTF_REVISED); m_aRun->append(OOO_STRING_SVTOOLS_RTF_REVAUTH); m_aRun->append(static_cast<sal_Int32>( - m_rExport.GetRedline(SW_MOD()->GetRedlineAuthor(pRedline->GetAuthor())))); + m_rExport.GetRedline(SwModule::get()->GetRedlineAuthor(pRedline->GetAuthor())))); if (!bRemoveCommentAuthorDates) m_aRun->append(OOO_STRING_SVTOOLS_RTF_REVDTTM); } @@ -646,7 +646,7 @@ void RtfAttributeOutput::Redline(const SwRedlineData* pRedline) m_aRun->append(OOO_STRING_SVTOOLS_RTF_DELETED); m_aRun->append(OOO_STRING_SVTOOLS_RTF_REVAUTHDEL); m_aRun->append(static_cast<sal_Int32>( - m_rExport.GetRedline(SW_MOD()->GetRedlineAuthor(pRedline->GetAuthor())))); + m_rExport.GetRedline(SwModule::get()->GetRedlineAuthor(pRedline->GetAuthor())))); if (!bRemoveCommentAuthorDates) m_aRun->append(OOO_STRING_SVTOOLS_RTF_REVDTTMDEL); } diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index b8c78f828375..bdbcdbe000df 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -270,7 +270,7 @@ void RtfExport::WriteRevTab() for (SwRangeRedline* pRedl : m_rDoc.getIDocumentRedlineAccess().GetRedlineTable()) { - GetRedline(SW_MOD()->GetRedlineAuthor(pRedl->GetAuthor())); + GetRedline(SwModule::get()->GetRedlineAuthor(pRedl->GetAuthor())); } bool bRemoveChangesInfo diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 39f195bc3d6e..6b26ce5533db 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -2222,7 +2222,7 @@ WW8_Annotation::WW8_Annotation(const SwRedlineData* pRedline) m_nRangeEnd(0), mpAuthorIDs(new SvtSecurityMapPersonalInfo) { - initPersonalInfo(SW_MOD()->GetRedlineAuthor(pRedline->GetAuthor()), u""_ustr, + initPersonalInfo(SwModule::get()->GetRedlineAuthor(pRedline->GetAuthor()), u""_ustr, pRedline->GetTimeStamp()); } diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index d436a61d00d7..41ec0aaf4e46 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -1684,7 +1684,7 @@ sal_uInt16 WW8Export::AddRedlineAuthor( std::size_t nId ) bool bRemovePersonalInfo = SvtSecurityOptions::IsOptionSet(SvtSecurityOptions::EOption::DocWarnRemovePersonalInfo) && !SvtSecurityOptions::IsOptionSet(SvtSecurityOptions::EOption::DocWarnKeepRedlineInfo); - OUString sName(SW_MOD()->GetRedlineAuthor(nId)); + OUString sName(SwModule::get()->GetRedlineAuthor(nId)); return m_pRedlAuthors->AddName( bRemovePersonalInfo ? "Author" + OUString::number(mpAuthorIDs->GetInfoID(sName)) : sName); } diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx index b0be42eab82f..6ccdf667ce20 100644 --- a/sw/source/filter/xml/xmlexp.cxx +++ b/sw/source/filter/xml/xmlexp.cxx @@ -191,7 +191,7 @@ ErrCode SwXMLExport::exportDoc( enum XMLTokenEnum eClass ) } -e ... etc. - the rest is truncated