summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
Diffstat (limited to 'cui')
-rw-r--r--cui/source/factory/dlgfact.cxx50
-rw-r--r--cui/source/factory/dlgfact.hxx27
-rw-r--r--cui/source/inc/transfrm.hxx19
-rw-r--r--cui/source/tabpages/transfrm.cxx86
-rw-r--r--cui/uiconfig/ui/positionsizedialog.ui127
5 files changed, 207 insertions, 102 deletions
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index a5c76ef405ab..05c404a88b5e 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -130,7 +130,16 @@ short AbstractSvxSearchSimilarityDialog_Impl::Execute()
return m_xDlg->run();
}
-IMPL_ABSTDLG_BASE(AbstractSvxTransformTabDialog_Impl);
+short AbstractSvxTransformTabDialog_Impl::Execute()
+{
+ return m_xDlg->execute();
+}
+
+bool AbstractSvxTransformTabDialog_Impl::StartExecuteAsync(AsyncContext &rCtx)
+{
+ return SfxTabDialogController::runAsync(m_xDlg, rCtx.maEndDialogFn);
+}
+
IMPL_ABSTDLG_BASE(AbstractSvxCaptionDialog_Impl);
IMPL_ABSTDLG_BASE(AbstractSvxJSearchOptionsDialog_Impl);
@@ -579,31 +588,33 @@ bool AbstractSvxSearchSimilarityDialog_Impl::IsRelaxed()
// AbstractSvxTransformTabDialog implementations just forwards everything to the dialog
void AbstractSvxTransformTabDialog_Impl::SetCurPageId( const OString& rName )
{
- pDlg->SetCurPageId( rName );
+ m_xDlg->SetCurPageId( rName );
}
const SfxItemSet* AbstractSvxTransformTabDialog_Impl::GetOutputItemSet() const
{
- return pDlg->GetOutputItemSet();
+ return m_xDlg->GetOutputItemSet();
}
const sal_uInt16* AbstractSvxTransformTabDialog_Impl::GetInputRanges(const SfxItemPool& pItem )
{
- return pDlg->GetInputRanges( pItem );
+ return m_xDlg->GetInputRanges( pItem );
}
void AbstractSvxTransformTabDialog_Impl::SetInputSet( const SfxItemSet* pInSet )
{
- pDlg->SetInputSet( pInSet );
+ m_xDlg->SetInputSet( pInSet );
}
+
//From class Window.
void AbstractSvxTransformTabDialog_Impl::SetText( const OUString& rStr )
{
- pDlg->SetText( rStr );
+ m_xDlg->set_title(rStr);
}
+
void AbstractSvxTransformTabDialog_Impl::SetValidateFramePosLink( const Link<SvxSwFrameValidation&,void>& rLink )
{
- pDlg->SetValidateFramePosLink( rLink );
+ m_xDlg->SetValidateFramePosLink( rLink );
}
// AbstractSvxCaptionDialog implementations just forwards everything to the dialog
@@ -1151,25 +1162,24 @@ VclPtr<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateSvxBorderBackgrou
return VclPtr<CuiAbstractTabDialog_Impl>::Create(pDlg);
}
-VclPtr<AbstractSvxTransformTabDialog> AbstractDialogFactory_Impl::CreateSvxTransformTabDialog( vcl::Window* pParent,
- const SfxItemSet* pAttr,
- const SdrView* pView,
- SvxAnchorIds nAnchorTypes )
+VclPtr<AbstractSvxTransformTabDialog> AbstractDialogFactory_Impl::CreateSvxTransformTabDialog(weld::Window* pParent,
+ const SfxItemSet* pAttr,
+ const SdrView* pView,
+ SvxAnchorIds nAnchorTypes)
{
- VclPtrInstance<SvxTransformTabDialog> pDlg( pParent, pAttr,pView, nAnchorTypes);
- return VclPtr<AbstractSvxTransformTabDialog_Impl>::Create( pDlg );
+ return VclPtr<AbstractSvxTransformTabDialog_Impl>::Create(new SvxTransformTabDialog(pParent, pAttr,pView, nAnchorTypes));
}
-VclPtr<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateSchTransformTabDialog( vcl::Window* pParent,
- const SfxItemSet* pAttr,
- const SdrView* pSdrView,
- bool bSizeTabPage
- )
+VclPtr<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateSchTransformTabDialog(weld::Window* pParent,
+ const SfxItemSet* pAttr,
+ const SdrView* pSdrView,
+ bool bSizeTabPage)
{
- VclPtrInstance<SvxTransformTabDialog> pDlg( pParent, pAttr,pSdrView, bSizeTabPage ? SvxAnchorIds::NoProtect : SvxAnchorIds::NoProtect|SvxAnchorIds::NoResize);
+ SvxTransformTabDialog* pDlg = new SvxTransformTabDialog(pParent, pAttr, pSdrView,
+ bSizeTabPage ? SvxAnchorIds::NoProtect : SvxAnchorIds::NoProtect|SvxAnchorIds::NoResize);
pDlg->RemoveTabPage( "RID_SVXPAGE_ANGLE" );
pDlg->RemoveTabPage( "RID_SVXPAGE_SLANT" );
- return VclPtr<CuiAbstractTabDialog_Impl>::Create( pDlg );
+ return VclPtr<CuiAbstractTabController_Impl>::Create(pDlg);
}
VclPtr<AbstractSvxJSearchOptionsDialog> AbstractDialogFactory_Impl::CreateSvxJSearchOptionsDialog( vcl::Window* pParent,
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 3c4e3dac1bb0..abb202ffa198 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -304,7 +304,15 @@ class AbstractSvxJSearchOptionsDialog_Impl :public AbstractSvxJSearchOptionsDial
class AbstractSvxTransformTabDialog_Impl : public AbstractSvxTransformTabDialog
{
- DECL_ABSTDLG_BASE(AbstractSvxTransformTabDialog_Impl,SvxTransformTabDialog)
+protected:
+ std::shared_ptr<SvxTransformTabDialog> m_xDlg;
+public:
+ explicit AbstractSvxTransformTabDialog_Impl(SvxTransformTabDialog* p)
+ : m_xDlg(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;
@@ -664,15 +672,14 @@ public:
const SfxItemSet& rCoreSet,
bool bEnableDrawingLayerFillStyles) override;
- virtual VclPtr<AbstractSvxTransformTabDialog> CreateSvxTransformTabDialog( vcl::Window* pParent,
- const SfxItemSet* pAttr,
- const SdrView* pView,
- SvxAnchorIds nAnchorTypes = SvxAnchorIds::NONE) override ;
- virtual VclPtr<SfxAbstractTabDialog> CreateSchTransformTabDialog( vcl::Window* pParent,
- const SfxItemSet* pAttr,
- const SdrView* pSdrView,
- bool bSizeTabPage
- ) override;
+ virtual VclPtr<AbstractSvxTransformTabDialog> CreateSvxTransformTabDialog(weld::Window* pParent,
+ const SfxItemSet* pAttr,
+ const SdrView* pView,
+ SvxAnchorIds nAnchorTypes = SvxAnchorIds::NONE) override ;
+ virtual VclPtr<SfxAbstractTabDialog> CreateSchTransformTabDialog(weld::Window* pParent,
+ const SfxItemSet* pAttr,
+ const SdrView* pSdrView,
+ bool bSizeTabPage) override;
virtual VclPtr<AbstractSpellDialog> CreateSvxSpellDialog(
vcl::Window* pParent,
SfxBindings* pBindings,
diff --git a/cui/source/inc/transfrm.hxx b/cui/source/inc/transfrm.hxx
index 9dccd2663241..d4f9be4e6917 100644
--- a/cui/source/inc/transfrm.hxx
+++ b/cui/source/inc/transfrm.hxx
@@ -37,28 +37,23 @@ class SdrView;
\************************************************************************/
struct SvxSwFrameValidation;
-class SvxTransformTabDialog : public SfxTabDialog
+class SvxTransformTabDialog : public SfxTabDialogController
{
- sal_uInt16 nPosSize;
- sal_uInt16 nSWPosSize;
- sal_uInt16 nRotation;
- sal_uInt16 nSlant;
private:
const SdrView* pView;
SvxAnchorIds nAnchorCtrls;
Link<SvxSwFrameValidation&,void> aValidateLink;
- virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) override;
+ virtual void PageCreated(const OString& rId, SfxTabPage &rPage) override;
public:
+ SvxTransformTabDialog(weld::Window* pParent, const SfxItemSet* pAttr,
+ const SdrView* pView,
+ SvxAnchorIds nAnchorTypes);
- SvxTransformTabDialog( vcl::Window* pParent, const SfxItemSet* pAttr,
- const SdrView* pView,
- SvxAnchorIds nAnchorTypes);
-
- //link for the Writer to validate positions
- void SetValidateFramePosLink( const Link<SvxSwFrameValidation&,void>& rLink );
+ //link for the Writer to validate positions
+ void SetValidateFramePosLink( const Link<SvxSwFrameValidation&,void>& rLink );
};
/*************************************************************************
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index cf3bc446a78e..6cfe85e3c0bf 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -86,14 +86,9 @@ const sal_uInt16 SvxSlantTabPage::pSlantRanges[] =
|*
\************************************************************************/
-SvxTransformTabDialog::SvxTransformTabDialog( vcl::Window* pParent, const SfxItemSet* pAttr,
- const SdrView* pSdrView, SvxAnchorIds nAnchorTypes )
- : SfxTabDialog( pParent
- ,"PositionAndSizeDialog"
- ,"cui/ui/positionsizedialog.ui"
- , pAttr )
- , nPosSize(0)
- , nSWPosSize(0)
+SvxTransformTabDialog::SvxTransformTabDialog(weld::Window* pParent, const SfxItemSet* pAttr,
+ const SdrView* pSdrView, SvxAnchorIds nAnchorTypes)
+ : SfxTabDialogController(pParent, "cui/ui/positionsizedialog.ui", "PositionAndSizeDialog", pAttr)
, pView(pSdrView)
, nAnchorCtrls(nAnchorTypes)
{
@@ -102,65 +97,62 @@ SvxTransformTabDialog::SvxTransformTabDialog( vcl::Window* pParent, const SfxIte
//different positioning page in Writer
if(nAnchorCtrls & (SvxAnchorIds::Paragraph | SvxAnchorIds::Character | SvxAnchorIds::Page | SvxAnchorIds::Fly))
{
- nSWPosSize = AddTabPage("RID_SVXPAGE_SWPOSSIZE", SvxSwPosSizeTabPage::Create, SvxSwPosSizeTabPage::GetRanges);
+ AddTabPage("RID_SVXPAGE_SWPOSSIZE", SvxSwPosSizeTabPage::Create, SvxSwPosSizeTabPage::GetRanges);
RemoveTabPage("RID_SVXPAGE_POSITION_SIZE");
}
else
{
- nPosSize = AddTabPage("RID_SVXPAGE_POSITION_SIZE", SvxPositionSizeTabPage::Create, SvxPositionSizeTabPage::GetRanges);
+ AddTabPage("RID_SVXPAGE_POSITION_SIZE", SvxPositionSizeTabPage::Create, SvxPositionSizeTabPage::GetRanges);
RemoveTabPage("RID_SVXPAGE_SWPOSSIZE");
}
- nRotation = AddTabPage("RID_SVXPAGE_ANGLE", SvxAngleTabPage::Create, SvxAngleTabPage::GetRanges);
- nSlant = AddTabPage("RID_SVXPAGE_SLANT", SvxSlantTabPage::Create, SvxSlantTabPage::GetRanges);
+ AddTabPage("RID_SVXPAGE_ANGLE", SvxAngleTabPage::Create, SvxAngleTabPage::GetRanges);
+ AddTabPage("RID_SVXPAGE_SLANT", SvxSlantTabPage::Create, SvxSlantTabPage::GetRanges);
}
-void SvxTransformTabDialog::PageCreated(sal_uInt16 nId, SfxTabPage &rPage)
+void SvxTransformTabDialog::PageCreated(const OString& rId, SfxTabPage &rPage)
{
- if (nId==nPosSize)
- {
- SvxPositionSizeTabPage& rSvxPos = static_cast<SvxPositionSizeTabPage&>(rPage);
- rSvxPos.SetView(pView);
- rSvxPos.Construct();
-
- if(nAnchorCtrls & SvxAnchorIds::NoResize)
- {
- rSvxPos.DisableResize();
- }
+ if (rId == "RID_SVXPAGE_POSITION_SIZE")
+ {
+ SvxPositionSizeTabPage& rSvxPos = static_cast<SvxPositionSizeTabPage&>(rPage);
+ rSvxPos.SetView(pView);
+ rSvxPos.Construct();
- if(nAnchorCtrls & SvxAnchorIds::NoProtect)
- {
- rSvxPos.DisableProtect();
- rSvxPos.UpdateControlStates();
- }
- }
- else if (nId == nSWPosSize)
+ if(nAnchorCtrls & SvxAnchorIds::NoResize)
{
- SvxSwPosSizeTabPage& rSwPos = static_cast<SvxSwPosSizeTabPage&>(rPage);
-
- rSwPos.EnableAnchorTypes(nAnchorCtrls);
- rSwPos.SetValidateFramePosLink(aValidateLink);
- rSwPos.SetView(pView);
+ rSvxPos.DisableResize();
}
- else if( nId == nRotation)
+ if(nAnchorCtrls & SvxAnchorIds::NoProtect)
{
- SvxAngleTabPage& rSvxAng = static_cast<SvxAngleTabPage&>(rPage);
-
- rSvxAng.SetView( pView );
- rSvxAng.Construct();
+ rSvxPos.DisableProtect();
+ rSvxPos.UpdateControlStates();
}
+ }
+ else if (rId == "RID_SVXPAGE_SWPOSSIZE")
+ {
+ SvxSwPosSizeTabPage& rSwPos = static_cast<SvxSwPosSizeTabPage&>(rPage);
- else if (nId == nSlant)
- {
- SvxSlantTabPage& rSvxSlnt = static_cast<SvxSlantTabPage&>(rPage);
+ rSwPos.EnableAnchorTypes(nAnchorCtrls);
+ rSwPos.SetValidateFramePosLink(aValidateLink);
+ rSwPos.SetView(pView);
+ }
+ else if (rId == "RID_SVXPAGE_ANGLE")
+ {
+ SvxAngleTabPage& rSvxAng = static_cast<SvxAngleTabPage&>(rPage);
- rSvxSlnt.SetView( pView );
- rSvxSlnt.Construct();
- }
-}
+ rSvxAng.SetView( pView );
+ rSvxAng.Construct();
+ }
+ else if (rId == "RID_SVXPAGE_SLANT")
+ {
+ SvxSlantTabPage& rSvxSlnt = static_cast<SvxSlantTabPage&>(rPage);
+ rSvxSlnt.SetView( pView );
+ rSvxSlnt.Construct();
+ }
+}
void SvxTransformTabDialog::SetValidateFramePosLink(const Link<SvxSwFrameValidation&,void>& rLink)
{
diff --git a/cui/uiconfig/ui/positionsizedialog.ui b/cui/uiconfig/ui/positionsizedialog.ui
index 658d5d056f8e..8b276311627c 100644
--- a/cui/uiconfig/ui/positionsizedialog.ui
+++ b/cui/uiconfig/ui/positionsizedialog.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="PositionAndSizeDialog">
@@ -8,7 +8,12 @@
<property name="title" translatable="yes" context="positionsizedialog|PositionAndSizeDialog">Position and Size</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>
+ <placeholder/>
+ </child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
@@ -19,12 +24,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>
@@ -35,10 +38,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>
@@ -49,8 +54,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>
@@ -60,12 +65,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>
@@ -75,6 +79,7 @@
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
+ <property name="secondary">True</property>
</packing>
</child>
</object>
@@ -98,6 +103,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">
@@ -117,6 +146,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>
@@ -140,6 +193,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>
@@ -163,6 +240,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">3</property>
@@ -189,10 +290,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>