weld SvxTextTabDialog

Change-Id: I2a48230d38fbc3c7d3e1e3b3ad43d4b17f48ed16
Reviewed-on: https://gerrit.libreoffice.org/53783
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2018-05-03 10:24:52 +01:00
parent 2d45f87330
commit 098ba55907
14 changed files with 161 additions and 67 deletions

View File

@@ -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();

View File

@@ -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<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateCustomizeTabDialo
}
// TabDialog that use functionality of the drawing layer
VclPtr<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateTextTabDialog( vcl::Window* pParent,
VclPtr<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateTextTabDialog(weld::Window* pParent,
const SfxItemSet* pAttrSet,
SdrView* pView )
SdrView* pView)
{
VclPtrInstance<SvxTextTabDialog> pDlg( pParent, pAttrSet, pView );
return VclPtr<CuiAbstractTabDialog_Impl>::Create( pDlg );
return VclPtr<CuiAbstractTabController_Impl>::Create(new SvxTextTabDialog(pParent, pAttrSet, pView));
}
// TabDialog that use functionality of the drawing layer and add AnchorTypes -- for SvxCaptionTabDialog

View File

@@ -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<SfxTabDialogController> 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<SfxAbstractTabDialog> CreateCustomizeTabDialog(
const SfxItemSet* pAttrSet,
const css::uno::Reference< css::frame::XFrame >& xViewFrame ) override;
virtual VclPtr<SfxAbstractTabDialog> CreateTextTabDialog( vcl::Window* pParent,
virtual VclPtr<SfxAbstractTabDialog> CreateTextTabDialog( weld::Window* pParent,
const SfxItemSet* pAttrSet,
SdrView* pView ) override;
virtual VclPtr<SfxAbstractTabDialog> CreateTabItemDialog(vcl::Window* pParent,

View File

@@ -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: */

View File

@@ -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;

View File

@@ -268,7 +268,7 @@
<object class="GtkCheckButton" id="TSB_START_INSIDE">
<property name="label" translatable="yes" context="textanimtabpage|TSB_START_INSIDE">S_tart inside</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
@@ -285,7 +285,7 @@
<object class="GtkCheckButton" id="TSB_STOP_INSIDE">
<property name="label" translatable="yes" context="textanimtabpage|TSB_STOP_INSIDE">Text _visible when exiting</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
@@ -322,7 +322,7 @@
<object class="GtkCheckButton" id="TSB_ENDLESS">
<property name="label" translatable="yes" context="textanimtabpage|TSB_ENDLESS">_Continuous</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
@@ -341,7 +341,7 @@
<child>
<object class="GtkSpinButton" id="NUM_FLD_COUNT">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="halign">start</property>
<property name="activates_default">True</property>
<accessibility>
@@ -385,7 +385,7 @@
<object class="GtkCheckButton" id="TSB_PIXEL">
<property name="label" translatable="yes" context="textanimtabpage|TSB_PIXEL">_Pixels</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
@@ -404,7 +404,7 @@
<child>
<object class="GtkSpinButton" id="MTR_FLD_AMOUNT">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="halign">start</property>
<property name="activates_default">True</property>
<accessibility>
@@ -448,7 +448,7 @@
<object class="GtkCheckButton" id="TSB_AUTO">
<property name="label" translatable="yes" context="textanimtabpage|TSB_AUTO">_Automatic</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
@@ -467,7 +467,7 @@
<child>
<object class="GtkSpinButton" id="MTR_FLD_DELAY">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="halign">start</property>
<property name="activates_default">True</property>
<accessibility>

View File

@@ -300,7 +300,7 @@
<child>
<object class="GtkSpinButton" id="MTR_FLD_LEFT">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="activates_default">True</property>
<property name="adjustment">adjustment1</property>
<property name="digits">2</property>
@@ -313,7 +313,7 @@
<child>
<object class="GtkSpinButton" id="MTR_FLD_RIGHT">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="activates_default">True</property>
<property name="adjustment">adjustment2</property>
<property name="digits">2</property>
@@ -326,7 +326,7 @@
<child>
<object class="GtkSpinButton" id="MTR_FLD_TOP">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="activates_default">True</property>
<property name="adjustment">adjustment3</property>
<property name="digits">2</property>
@@ -339,7 +339,7 @@
<child>
<object class="GtkSpinButton" id="MTR_FLD_BOTTOM">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="activates_default">True</property>
<property name="adjustment">adjustment4</property>
<property name="digits">2</property>
@@ -374,21 +374,19 @@
<child>
<object class="GtkFrame" id="FL_POSITION">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="vexpand">True</property>
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkBox" id="box3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="vexpand">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
@@ -426,7 +424,7 @@
<object class="GtkCheckButton" id="TSB_FULL_WIDTH">
<property name="label" translatable="yes" context="textattrtabpage|TSB_FULL_WIDTH">Full _width</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<!-- Generated with glade 3.20.4 -->
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="TextDialog">
@@ -7,6 +7,9 @@
<property name="border_width">6</property>
<property name="title" translatable="yes" context="textdialog|TextDialog">Text</property>
<property name="resizable">False</property>
<property name="modal">True</property>
<property name="default_width">0</property>
<property name="default_height">0</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
@@ -17,6 +20,20 @@
<object class="GtkButtonBox" id="dialog-action_area1">
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<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="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="ok">
<property name="label">gtk-ok</property>
@@ -30,7 +47,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="position">1</property>
</packing>
</child>
<child>
@@ -44,7 +61,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">2</property>
</packing>
</child>
<child>
@@ -55,25 +72,11 @@
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<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>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
<property name="secondary">True</property>
</packing>
</child>
</object>
@@ -87,7 +90,7 @@
<child>
<object class="GtkNotebook" id="tabcontrol">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child>
@@ -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>
@@ -142,10 +193,13 @@
</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>
<child>
<placeholder/>
</child>
</object>
</interface>

View File

@@ -335,7 +335,7 @@ public:
virtual ~SvxAbstractDialogFactory() override;
virtual VclPtr<SfxAbstractTabDialog> CreateTextTabDialog( vcl::Window* pParent,
virtual VclPtr<SfxAbstractTabDialog> CreateTextTabDialog( weld::Window* pParent,
const SfxItemSet* pAttrSet,
SdrView* pView ) = 0 ;

View File

@@ -446,7 +446,8 @@ void ScDrawShell::ExecuteTextAttrDlg( SfxRequest& rReq )
pView->MergeAttrFromMarked( aNewAttr, false );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog( pViewData->GetDialogParent(), &aNewAttr, pView ));
vcl::Window* pWin = pViewData->GetDialogParent();
ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog(pWin ? pWin->GetFrameWeld() : nullptr, &aNewAttr, pView));
sal_uInt16 nResult = pDlg->Execute();

View File

@@ -874,7 +874,8 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
case SID_DRAWTEXT_ATTR_DLG:
{
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog( pViewData->GetDialogParent(), &aEditAttr, pView ));
vcl::Window* pWin = pViewData->GetDialogParent();
ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog( pWin ? pWin->GetFrameWeld() : nullptr, &aEditAttr, pView ));
bDone = ( RET_OK == pDlg->Execute() );

View File

@@ -57,7 +57,7 @@ void FuTextAttrDlg::DoExecute( SfxRequest& rReq )
if( !pArgs )
{
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog( nullptr, &aNewAttr, mpView ));
ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog(rReq.GetFrameWeld(), &aNewAttr, mpView));
sal_uInt16 nResult = pDlg->Execute();

View File

@@ -54,7 +54,7 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if ( pFact )
{
ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog( nullptr, &aNewAttr, pView ));
ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog(rReq.GetFrameWeld(), &aNewAttr, pView));
sal_uInt16 nResult = pDlg->Execute();
if (nResult == RET_OK)

View File

@@ -440,7 +440,7 @@ void SwDrawTextShell::ExecDraw(SfxRequest &rReq)
if ( pFact )
{
ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog(
&(GetView().GetViewFrame()->GetWindow()),
GetView().GetViewFrame()->GetWindow().GetFrameWeld(),
&aNewAttr, pSdrView ));
sal_uInt16 nResult = pDlg->Execute();