diff options
Diffstat (limited to 'sd')
61 files changed, 128 insertions, 123 deletions
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); |