diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx index 1ffe80d2786b..1b6a89b94985 100644 --- a/chart2/source/controller/main/ShapeController.cxx +++ b/chart2/source/controller/main/ShapeController.cxx @@ -336,7 +336,7 @@ void ShapeController::executeDispatch_TextAttributes() if ( pFact ) { ScopedVclPtr< SfxAbstractTabDialog > pDlg( - pFact->CreateTextTabDialog( pChartWindow, &aAttr, pDrawViewWrapper ) ); + pFact->CreateTextTabDialog( pChartWindow ? pChartWindow->GetFrameWeld() : nullptr, &aAttr, pDrawViewWrapper ) ); if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) ) { const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet(); diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index 85b2d1504c37..a22a64c1f933 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -275,6 +275,38 @@ void CuiAbstractTabDialog_Impl::SetText( const OUString& rStr ) pDlg->SetText( rStr ); } +short CuiAbstractTabController_Impl::Execute() +{ + return m_xDlg->execute(); +} + +void CuiAbstractTabController_Impl::SetCurPageId( const OString &rName ) +{ + m_xDlg->SetCurPageId( rName ); +} + +const SfxItemSet* CuiAbstractTabController_Impl::GetOutputItemSet() const +{ + return m_xDlg->GetOutputItemSet(); +} + +const sal_uInt16* CuiAbstractTabController_Impl::GetInputRanges(const SfxItemPool& pItem ) +{ + return m_xDlg->GetInputRanges( pItem ); +} + +void CuiAbstractTabController_Impl::SetInputSet( const SfxItemSet* pInSet ) +{ + m_xDlg->SetInputSet( pInSet ); +} + +//From class Window. +void CuiAbstractTabController_Impl::SetText( const OUString& rStr ) +{ + m_xDlg->set_title(rStr); +} + + const SfxItemSet* CuiAbstractSfxDialog_Impl::GetOutputItemSet() const { @@ -934,12 +966,11 @@ VclPtr AbstractDialogFactory_Impl::CreateCustomizeTabDialo } // TabDialog that use functionality of the drawing layer -VclPtr AbstractDialogFactory_Impl::CreateTextTabDialog( vcl::Window* pParent, +VclPtr AbstractDialogFactory_Impl::CreateTextTabDialog(weld::Window* pParent, const SfxItemSet* pAttrSet, - SdrView* pView ) + SdrView* pView) { - VclPtrInstance pDlg( pParent, pAttrSet, pView ); - return VclPtr::Create( pDlg ); + return VclPtr::Create(new SvxTextTabDialog(pParent, pAttrSet, pView)); } // TabDialog that use functionality of the drawing layer and add AnchorTypes -- for SvxCaptionTabDialog diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index 9de13861ee17..b1239c049e00 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -124,6 +124,24 @@ class CuiAbstractTabDialog_Impl : public SfxAbstractTabDialog virtual void SetText( const OUString& rStr ) override; }; +class CuiAbstractTabController_Impl : public SfxAbstractTabDialog +{ +protected: + std::unique_ptr m_xDlg; +public: + explicit CuiAbstractTabController_Impl(SfxTabDialogController* p) + : m_xDlg(p) + { + } + virtual short Execute() override; + virtual void SetCurPageId( const OString &rName ) override; + virtual const SfxItemSet* GetOutputItemSet() const override; + virtual const sal_uInt16* GetInputRanges( const SfxItemPool& pItem ) override; + virtual void SetInputSet( const SfxItemSet* pInSet ) override; + //From class Window. + virtual void SetText( const OUString& rStr ) override; +}; + class SvxDistributeDialog; class AbstractSvxDistributeDialog_Impl: public AbstractSvxDistributeDialog { @@ -588,7 +606,7 @@ public: virtual VclPtr CreateCustomizeTabDialog( const SfxItemSet* pAttrSet, const css::uno::Reference< css::frame::XFrame >& xViewFrame ) override; - virtual VclPtr CreateTextTabDialog( vcl::Window* pParent, + virtual VclPtr CreateTextTabDialog( weld::Window* pParent, const SfxItemSet* pAttrSet, SdrView* pView ) override; virtual VclPtr CreateTabItemDialog(vcl::Window* pParent, diff --git a/cui/source/inc/textanim.hxx b/cui/source/inc/textanim.hxx index 958b99841acc..953399d718e8 100644 --- a/cui/source/inc/textanim.hxx +++ b/cui/source/inc/textanim.hxx @@ -95,21 +95,17 @@ public: |* Text-Tab-Dialog |* \************************************************************************/ -class SvxTextTabDialog : public SfxTabDialog +class SvxTextTabDialog : public SfxTabDialogController { - sal_uInt16 m_nTextId; private: const SdrView* pView; - virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) override; + virtual void PageCreated(const OString& rId, SfxTabPage &rPage) override; public: - - SvxTextTabDialog( vcl::Window* pParent, const SfxItemSet* pAttr, - const SdrView* pView ); + SvxTextTabDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrView* pView); }; - #endif // INCLUDED_CUI_SOURCE_INC_TEXTANIM_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/textanim.cxx b/cui/source/tabpages/textanim.cxx index 3a2ca39e625c..ac79e3607893 100644 --- a/cui/source/tabpages/textanim.cxx +++ b/cui/source/tabpages/textanim.cxx @@ -41,17 +41,12 @@ const sal_uInt16 SvxTextAnimationPage::pRanges[] = |* \************************************************************************/ -SvxTextTabDialog::SvxTextTabDialog( vcl::Window* pParent, - const SfxItemSet* pAttr, - const SdrView* pSdrView ) : - SfxTabDialog ( pParent - ,"TextDialog" - ,"cui/ui/textdialog.ui" - , pAttr ), - pView ( pSdrView ) +SvxTextTabDialog::SvxTextTabDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrView* pSdrView) + : SfxTabDialogController(pParent, "cui/ui/textdialog.ui", "TextDialog", pAttr) + , pView(pSdrView) { - m_nTextId = AddTabPage( "RID_SVXPAGE_TEXTATTR", SvxTextAttrPage::Create, nullptr); - AddTabPage( "RID_SVXPAGE_TEXTANIMATION", SvxTextAnimationPage::Create, nullptr); + AddTabPage("RID_SVXPAGE_TEXTATTR", SvxTextAttrPage::Create, nullptr); + AddTabPage("RID_SVXPAGE_TEXTANIMATION", SvxTextAnimationPage::Create, nullptr); } /************************************************************************* @@ -60,9 +55,9 @@ SvxTextTabDialog::SvxTextTabDialog( vcl::Window* pParent, |* \************************************************************************/ -void SvxTextTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) +void SvxTextTabDialog::PageCreated(const OString& rId, SfxTabPage &rPage) { - if (nId == m_nTextId) + if (rId == "RID_SVXPAGE_TEXTATTR") { const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); bool bHasMarked = rMarkList.GetMarkCount() > 0; diff --git a/cui/uiconfig/ui/textanimtabpage.ui b/cui/uiconfig/ui/textanimtabpage.ui index a6c701af5ee0..d234f5af44b9 100644 --- a/cui/uiconfig/ui/textanimtabpage.ui +++ b/cui/uiconfig/ui/textanimtabpage.ui @@ -268,7 +268,7 @@ S_tart inside True - False + True False True 0 @@ -285,7 +285,7 @@ Text _visible when exiting True - False + True False True 0 @@ -322,7 +322,7 @@ _Continuous True - False + True False True 0 @@ -341,7 +341,7 @@ True - False + True start True @@ -385,7 +385,7 @@ _Pixels True - False + True False True 0 @@ -404,7 +404,7 @@ True - False + True start True @@ -448,7 +448,7 @@ _Automatic True - False + True False True 0 @@ -467,7 +467,7 @@ True - False + True start True diff --git a/cui/uiconfig/ui/textattrtabpage.ui b/cui/uiconfig/ui/textattrtabpage.ui index f5ee8ec34ed1..2b6b02b5a4d7 100644 --- a/cui/uiconfig/ui/textattrtabpage.ui +++ b/cui/uiconfig/ui/textattrtabpage.ui @@ -300,7 +300,7 @@ True - False + True True adjustment1 2 @@ -313,7 +313,7 @@ True - False + True True adjustment2 2 @@ -326,7 +326,7 @@ True - False + True True adjustment3 2 @@ -339,7 +339,7 @@ True - False + True True adjustment4 2 @@ -374,21 +374,19 @@ True - True + False 0 none True False - True 6 12 True False - True vertical 6 @@ -426,7 +424,7 @@ Full _width True - False + True False True 0 diff --git a/cui/uiconfig/ui/textdialog.ui b/cui/uiconfig/ui/textdialog.ui index f31c82d9997a..7a7a43d88559 100644 --- a/cui/uiconfig/ui/textdialog.ui +++ b/cui/uiconfig/ui/textdialog.ui @@ -1,5 +1,5 @@ - + @@ -7,6 +7,9 @@ 6 Text False + True + 0 + 0 dialog @@ -17,6 +20,20 @@ False end + + + gtk-revert-to-saved + True + True + True + True + + + False + True + 0 + + gtk-ok @@ -30,7 +47,7 @@ False True - 0 + 1 @@ -44,7 +61,7 @@ False True - 1 + 2 @@ -55,25 +72,11 @@ True True - - False - True - 2 - True - - - - - gtk-revert-to-saved - True - True - True - True - False True 3 + True @@ -87,7 +90,7 @@ True - False + True True True @@ -97,6 +100,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -116,6 +143,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + 1 @@ -142,10 +193,13 @@ + reset ok cancel help - reset + + + diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx index 3d60ad7de275..1d8b43f4c7b0 100644 --- a/include/svx/svxdlg.hxx +++ b/include/svx/svxdlg.hxx @@ -335,7 +335,7 @@ public: virtual ~SvxAbstractDialogFactory() override; - virtual VclPtr CreateTextTabDialog( vcl::Window* pParent, + virtual VclPtr CreateTextTabDialog( weld::Window* pParent, const SfxItemSet* pAttrSet, SdrView* pView ) = 0 ; diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx index 32782c5385b4..ab1b08a37f4f 100644 --- a/sc/source/ui/drawfunc/drawsh.cxx +++ b/sc/source/ui/drawfunc/drawsh.cxx @@ -446,7 +446,8 @@ void ScDrawShell::ExecuteTextAttrDlg( SfxRequest& rReq ) pView->MergeAttrFromMarked( aNewAttr, false ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr pDlg(pFact->CreateTextTabDialog( pViewData->GetDialogParent(), &aNewAttr, pView )); + vcl::Window* pWin = pViewData->GetDialogParent(); + ScopedVclPtr pDlg(pFact->CreateTextTabDialog(pWin ? pWin->GetFrameWeld() : nullptr, &aNewAttr, pView)); sal_uInt16 nResult = pDlg->Execute(); diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index 0da8c62579eb..6a6ac2ef0528 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -874,7 +874,8 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq ) case SID_DRAWTEXT_ATTR_DLG: { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr pDlg(pFact->CreateTextTabDialog( pViewData->GetDialogParent(), &aEditAttr, pView )); + vcl::Window* pWin = pViewData->GetDialogParent(); + ScopedVclPtr pDlg(pFact->CreateTextTabDialog( pWin ? pWin->GetFrameWeld() : nullptr, &aEditAttr, pView )); bDone = ( RET_OK == pDlg->Execute() ); diff --git a/sd/source/ui/func/futxtatt.cxx b/sd/source/ui/func/futxtatt.cxx index 78fcb3f011d0..721acabcdcb0 100644 --- a/sd/source/ui/func/futxtatt.cxx +++ b/sd/source/ui/func/futxtatt.cxx @@ -57,7 +57,7 @@ void FuTextAttrDlg::DoExecute( SfxRequest& rReq ) if( !pArgs ) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr pDlg(pFact->CreateTextTabDialog( nullptr, &aNewAttr, mpView )); + ScopedVclPtr pDlg(pFact->CreateTextTabDialog(rReq.GetFrameWeld(), &aNewAttr, mpView)); sal_uInt16 nResult = pDlg->Execute(); diff --git a/sw/source/uibase/shells/drawdlg.cxx b/sw/source/uibase/shells/drawdlg.cxx index 21dbe250db15..2edc3848a9c0 100644 --- a/sw/source/uibase/shells/drawdlg.cxx +++ b/sw/source/uibase/shells/drawdlg.cxx @@ -54,7 +54,7 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if ( pFact ) { - ScopedVclPtr pDlg(pFact->CreateTextTabDialog( nullptr, &aNewAttr, pView )); + ScopedVclPtr pDlg(pFact->CreateTextTabDialog(rReq.GetFrameWeld(), &aNewAttr, pView)); sal_uInt16 nResult = pDlg->Execute(); if (nResult == RET_OK) diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx index 130af5052b3e..f4a1f7f8b263 100644 --- a/sw/source/uibase/shells/drwtxtsh.cxx +++ b/sw/source/uibase/shells/drwtxtsh.cxx @@ -440,7 +440,7 @@ void SwDrawTextShell::ExecDraw(SfxRequest &rReq) if ( pFact ) { ScopedVclPtr pDlg(pFact->CreateTextTabDialog( - &(GetView().GetViewFrame()->GetWindow()), + GetView().GetViewFrame()->GetWindow().GetFrameWeld(), &aNewAttr, pSdrView )); sal_uInt16 nResult = pDlg->Execute();