diff options
-rw-r--r-- | chart2/source/controller/main/ShapeController.cxx | 2 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.cxx | 35 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.hxx | 14 | ||||
-rw-r--r-- | cui/source/inc/labdlg.hxx | 9 | ||||
-rw-r--r-- | cui/source/tabpages/labdlg.cxx | 22 | ||||
-rw-r--r-- | cui/uiconfig/ui/calloutdialog.ui | 101 | ||||
-rw-r--r-- | include/svx/svxdlg.hxx | 6 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/drawsh.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/futransf.cxx | 2 |
9 files changed, 139 insertions, 54 deletions
diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx index f6e7c0db1106..32708238c1fc 100644 --- a/chart2/source/controller/main/ShapeController.cxx +++ b/chart2/source/controller/main/ShapeController.cxx @@ -362,7 +362,7 @@ void ShapeController::executeDispatch_TransformDialog() SfxItemSet aGeoAttr( pDrawViewWrapper->GetGeoAttrFromMarked() ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); ScopedVclPtr< SfxAbstractTabDialog > pDlg( - pFact->CreateCaptionDialog( pChartWindow, pDrawViewWrapper ) ); + pFact->CreateCaptionDialog(pChartWindow->GetFrameWeld(), pDrawViewWrapper)); const sal_uInt16* pRange = pDlg->GetInputRanges( *aAttr.GetPool() ); SfxItemSet aCombAttr( *aAttr.GetPool(), pRange ); aCombAttr.Put( aAttr ); diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index acd14fa0dd6d..e7c622ad507c 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -141,7 +141,16 @@ bool AbstractSvxTransformTabDialog_Impl::StartExecuteAsync(AsyncContext &rCtx) return SfxTabDialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); } -IMPL_ABSTDLG_BASE(AbstractSvxCaptionDialog_Impl); +short AbstractSvxCaptionDialog_Impl::Execute() +{ + return m_xDlg->execute(); +} + +bool AbstractSvxCaptionDialog_Impl::StartExecuteAsync(AsyncContext &rCtx) +{ + return SfxTabDialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); +} + IMPL_ABSTDLG_BASE(AbstractSvxJSearchOptionsDialog_Impl); short AbstractFmInputRecordNoDialog_Impl::Execute() @@ -630,31 +639,32 @@ void AbstractSvxTransformTabDialog_Impl::SetValidateFramePosLink( const Link<Svx // AbstractSvxCaptionDialog implementations just forwards everything to the dialog void AbstractSvxCaptionDialog_Impl::SetCurPageId( const OString& rName ) { - pDlg->SetCurPageId( rName ); + m_xDlg->SetCurPageId(rName); } const SfxItemSet* AbstractSvxCaptionDialog_Impl::GetOutputItemSet() const { - return pDlg->GetOutputItemSet(); + return m_xDlg->GetOutputItemSet(); } const sal_uInt16* AbstractSvxCaptionDialog_Impl::GetInputRanges(const SfxItemPool& pItem ) { - return pDlg->GetInputRanges( pItem ); + return m_xDlg->GetInputRanges( pItem ); } void AbstractSvxCaptionDialog_Impl::SetInputSet( const SfxItemSet* pInSet ) { - pDlg->SetInputSet( pInSet ); + m_xDlg->SetInputSet( pInSet ); } -//From class Window. + void AbstractSvxCaptionDialog_Impl::SetText( const OUString& rStr ) { - pDlg->SetText( rStr ); + m_xDlg->set_title(rStr); } + void AbstractSvxCaptionDialog_Impl::SetValidateFramePosLink( const Link<SvxSwFrameValidation&,void>& rLink ) { - pDlg->SetValidateFramePosLink( rLink ); + m_xDlg->SetValidateFramePosLink( rLink ); } TransliterationFlags AbstractSvxJSearchOptionsDialog_Impl::GetTransliterationFlags() const @@ -1008,12 +1018,11 @@ VclPtr<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateTextTabDialog(wel } // TabDialog that use functionality of the drawing layer and add AnchorTypes -- for SvxCaptionTabDialog -VclPtr<AbstractSvxCaptionDialog> AbstractDialogFactory_Impl::CreateCaptionDialog( vcl::Window* pParent, - const SdrView* pView, - SvxAnchorIds nAnchorTypes ) +VclPtr<AbstractSvxCaptionDialog> AbstractDialogFactory_Impl::CreateCaptionDialog(weld::Window* pParent, + const SdrView* pView, + SvxAnchorIds nAnchorTypes) { - VclPtrInstance<SvxCaptionTabDialog> pDlg( pParent, pView, nAnchorTypes ); - return VclPtr<AbstractSvxCaptionDialog_Impl>::Create( pDlg ); + return VclPtr<AbstractSvxCaptionDialog_Impl>::Create(o3tl::make_unique<SvxCaptionTabDialog>(pParent, pView, nAnchorTypes)); } VclPtr<AbstractSvxDistributeDialog> AbstractDialogFactory_Impl::CreateSvxDistributeDialog(const SfxItemSet& rAttr) diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index c7595fdf0566..c3340103e61c 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -323,7 +323,15 @@ public: class AbstractSvxCaptionDialog_Impl : public AbstractSvxCaptionDialog { - DECL_ABSTDLG_BASE(AbstractSvxCaptionDialog_Impl,SvxCaptionTabDialog) +protected: + std::shared_ptr<SvxCaptionTabDialog> m_xDlg; +public: + explicit AbstractSvxCaptionDialog_Impl(std::unique_ptr<SvxCaptionTabDialog> p) + : m_xDlg(std::move(p)) + { + } + virtual short Execute() override; + virtual bool StartExecuteAsync(AsyncContext &rCtx) override; virtual void SetValidateFramePosLink( const Link<SvxSwFrameValidation&,void>& rLink ) override; virtual void SetCurPageId( const OString& rName ) override; virtual const SfxItemSet* GetOutputItemSet() const override; @@ -647,9 +655,9 @@ public: virtual VclPtr<SfxAbstractTabDialog> CreateTabItemDialog(vcl::Window* pParent, const SfxItemSet& rSet) override; virtual VclPtr<AbstractSvxCaptionDialog> - CreateCaptionDialog( vcl::Window* pParent, + CreateCaptionDialog(weld::Window* pParent, const SdrView* pView, - SvxAnchorIds nAnchorTypes = SvxAnchorIds::NONE ) override; + SvxAnchorIds nAnchorTypes = SvxAnchorIds::NONE) override; virtual VclPtr<AbstractSvxDistributeDialog> CreateSvxDistributeDialog(const SfxItemSet& rAttr) override; virtual VclPtr<SfxAbstractInsertObjectDialog> diff --git a/cui/source/inc/labdlg.hxx b/cui/source/inc/labdlg.hxx index fd06c5d71b98..3a9dd48cc98c 100644 --- a/cui/source/inc/labdlg.hxx +++ b/cui/source/inc/labdlg.hxx @@ -100,21 +100,18 @@ public: // class SvxCaptionTabDialog --------------------------------------------- struct SvxSwFrameValidation; -class SvxCaptionTabDialog : public SfxTabDialog +class SvxCaptionTabDialog : public SfxTabDialogController { private: const SdrView* pView; SvxAnchorIds nAnchorCtrls; - sal_uInt16 m_nSwPosSizePageId; - sal_uInt16 m_nPositionSizePageId; - sal_uInt16 m_nCaptionPageId; Link<SvxSwFrameValidation&,void> aValidateLink; - virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) override; + virtual void PageCreated(const OString& rId, SfxTabPage &rPage) override; public: - SvxCaptionTabDialog(vcl::Window* pParent, const SdrView* pView, + SvxCaptionTabDialog(weld::Window* pParent, const SdrView* pView, SvxAnchorIds nAnchorTypes); /// link for the Writer to validate positions diff --git a/cui/source/tabpages/labdlg.cxx b/cui/source/tabpages/labdlg.cxx index e45947c673b2..1b612cf6357d 100644 --- a/cui/source/tabpages/labdlg.cxx +++ b/cui/source/tabpages/labdlg.cxx @@ -473,37 +473,34 @@ void SvxCaptionTabPage::FillValueSet() m_xCT_CAPTTYPE->SetItemImage(BMP_CAPTTYPE_3, m_aBmpCapTypes[2] ); } -SvxCaptionTabDialog::SvxCaptionTabDialog(vcl::Window* pParent, const SdrView* pSdrView, +SvxCaptionTabDialog::SvxCaptionTabDialog(weld::Window* pParent, const SdrView* pSdrView, SvxAnchorIds nAnchorTypes) - : SfxTabDialog( pParent, "CalloutDialog", "cui/ui/calloutdialog.ui") + : SfxTabDialogController(pParent, "cui/ui/calloutdialog.ui", "CalloutDialog") , pView(pSdrView) , nAnchorCtrls(nAnchorTypes) - , m_nSwPosSizePageId(0) - , m_nPositionSizePageId(0) - , m_nCaptionPageId(0) { assert(pView); // No valid View transferred! //different positioning page in Writer if (nAnchorCtrls & (SvxAnchorIds::Paragraph | SvxAnchorIds::Character | SvxAnchorIds::Page | SvxAnchorIds::Fly)) { - m_nSwPosSizePageId = AddTabPage("RID_SVXPAGE_SWPOSSIZE", SvxSwPosSizeTabPage::Create, + AddTabPage("RID_SVXPAGE_SWPOSSIZE", SvxSwPosSizeTabPage::Create, SvxSwPosSizeTabPage::GetRanges ); RemoveTabPage("RID_SVXPAGE_POSITION_SIZE"); } else { - m_nPositionSizePageId = AddTabPage("RID_SVXPAGE_POSITION_SIZE", SvxPositionSizeTabPage::Create, + AddTabPage("RID_SVXPAGE_POSITION_SIZE", SvxPositionSizeTabPage::Create, SvxPositionSizeTabPage::GetRanges ); RemoveTabPage("RID_SVXPAGE_SWPOSSIZE"); } - m_nCaptionPageId = AddTabPage("RID_SVXPAGE_CAPTION", SvxCaptionTabPage::Create, + AddTabPage("RID_SVXPAGE_CAPTION", SvxCaptionTabPage::Create, SvxCaptionTabPage::GetRanges ); } -void SvxCaptionTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) +void SvxCaptionTabDialog::PageCreated(const OString& rId, SfxTabPage &rPage) { - if (nId == m_nPositionSizePageId) + if (rId == "RID_SVXPAGE_POSITION_SIZE") { static_cast<SvxPositionSizeTabPage&>( rPage ).SetView( pView ); static_cast<SvxPositionSizeTabPage&>( rPage ).Construct(); @@ -513,13 +510,13 @@ void SvxCaptionTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) if( nAnchorCtrls & SvxAnchorIds::NoProtect ) static_cast<SvxPositionSizeTabPage&>( rPage ).DisableProtect(); } - else if (nId == m_nSwPosSizePageId) + else if (rId == "RID_SVXPAGE_SWPOSSIZE") { SvxSwPosSizeTabPage& rSwPage = static_cast<SvxSwPosSizeTabPage&>(rPage); rSwPage.EnableAnchorTypes(nAnchorCtrls); rSwPage.SetValidateFramePosLink( aValidateLink ); } - else if (nId == m_nCaptionPageId) + else if (rId == "RID_SVXPAGE_CAPTION") { static_cast<SvxCaptionTabPage&>( rPage ).SetView( pView ); static_cast<SvxCaptionTabPage&>( rPage ).Construct(); @@ -531,5 +528,4 @@ void SvxCaptionTabDialog::SetValidateFramePosLink( const Link<SvxSwFrameValidati aValidateLink = rLink; } - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/uiconfig/ui/calloutdialog.ui b/cui/uiconfig/ui/calloutdialog.ui index 113cfc015ef3..998985db8b1a 100644 --- a/cui/uiconfig/ui/calloutdialog.ui +++ b/cui/uiconfig/ui/calloutdialog.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.20.0 --> +<!-- Generated with glade 3.22.1 --> <interface domain="cui"> <requires lib="gtk+" version="3.18"/> <object class="GtkDialog" id="CalloutDialog"> @@ -8,6 +8,9 @@ <property name="title" translatable="yes" context="calloutdialog|CalloutDialog">Position and Size</property> <property name="resizable">False</property> <property name="type_hint">dialog</property> + <child> + <placeholder/> + </child> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> <property name="can_focus">False</property> @@ -18,12 +21,10 @@ <property name="can_focus">False</property> <property name="layout_style">end</property> <child> - <object class="GtkButton" id="ok"> - <property name="label">gtk-ok</property> + <object class="GtkButton" id="reset"> + <property name="label">gtk-revert-to-saved</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> <property name="receives_default">True</property> <property name="use_stock">True</property> </object> @@ -34,10 +35,12 @@ </packing> </child> <child> - <object class="GtkButton" id="cancel"> - <property name="label">gtk-cancel</property> + <object class="GtkButton" id="ok"> + <property name="label">gtk-ok</property> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> <property name="receives_default">True</property> <property name="use_stock">True</property> </object> @@ -48,8 +51,8 @@ </packing> </child> <child> - <object class="GtkButton" id="help"> - <property name="label">gtk-help</property> + <object class="GtkButton" id="cancel"> + <property name="label">gtk-cancel</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -59,12 +62,11 @@ <property name="expand">False</property> <property name="fill">True</property> <property name="position">2</property> - <property name="secondary">True</property> </packing> </child> <child> - <object class="GtkButton" id="reset"> - <property name="label">gtk-revert-to-saved</property> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -74,6 +76,7 @@ <property name="expand">False</property> <property name="fill">True</property> <property name="position">3</property> + <property name="secondary">True</property> </packing> </child> </object> @@ -97,6 +100,30 @@ <child> <placeholder/> </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> </object> </child> <child type="tab"> @@ -116,6 +143,30 @@ <child> <placeholder/> </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> </object> <packing> <property name="position">1</property> @@ -139,6 +190,30 @@ <child> <placeholder/> </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> </object> <packing> <property name="position">2</property> @@ -165,10 +240,10 @@ </object> </child> <action-widgets> + <action-widget response="0">reset</action-widget> <action-widget response="-5">ok</action-widget> <action-widget response="-6">cancel</action-widget> <action-widget response="-11">help</action-widget> - <action-widget response="0">reset</action-widget> </action-widgets> </object> </interface> diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx index a5f62832db28..61d7cfb20083 100644 --- a/include/svx/svxdlg.hxx +++ b/include/svx/svxdlg.hxx @@ -338,9 +338,9 @@ public: const SfxItemSet* pAttrSet, SdrView* pView ) = 0 ; - virtual VclPtr<AbstractSvxCaptionDialog> CreateCaptionDialog( vcl::Window* pParent, - const SdrView* pView, - SvxAnchorIds nAnchorTypes = SvxAnchorIds::NONE ) = 0; + virtual VclPtr<AbstractSvxCaptionDialog> CreateCaptionDialog(weld::Window* pParent, + const SdrView* pView, + SvxAnchorIds nAnchorTypes = SvxAnchorIds::NONE) = 0; virtual VclPtr<AbstractSvxDistributeDialog> CreateSvxDistributeDialog( const SfxItemSet& rAttr)= 0; diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx index 4e0a84375818..95cba625e577 100644 --- a/sc/source/ui/drawfunc/drawsh.cxx +++ b/sc/source/ui/drawfunc/drawsh.cxx @@ -265,7 +265,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq ) SfxItemSet aNewGeoAttr(pView->GetGeoAttrFromMarked()); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateCaptionDialog( pWin, pView )); + ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateCaptionDialog(pWin ? pWin->GetFrameWeld() : nullptr, pView)); const sal_uInt16* pRange = pDlg->GetInputRanges( *aNewAttr.GetPool() ); SfxItemSet aCombSet( *aNewAttr.GetPool(), pRange ); diff --git a/sd/source/ui/func/futransf.cxx b/sd/source/ui/func/futransf.cxx index 7bb64faae105..d0ffd8366055 100644 --- a/sd/source/ui/func/futransf.cxx +++ b/sd/source/ui/func/futransf.cxx @@ -93,7 +93,7 @@ void FuTransform::DoExecute( SfxRequest& rReq ) mpView->GetAttributes( aNewAttr ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - pDlg.reset(pFact->CreateCaptionDialog(mpViewShell->GetActiveWindow(), mpView)); + pDlg.reset(pFact->CreateCaptionDialog(mpViewShell->GetFrameWeld(), mpView)); const sal_uInt16* pRange = pDlg->GetInputRanges( *aNewAttr.GetPool() ); SfxItemSet aCombSet( *aNewAttr.GetPool(), pRange ); |