summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-09-27 19:50:26 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-09-28 08:55:15 +0200
commit8a8a0c6577e0695b00c482822951402d8ef944b9 (patch)
treed70349838dd6d3a2391f6dea63dbb6631ab0451f
parent8dc8b22997138ff51b2e1b806a2a42f3b363d58f (diff)
weld SvxMeasureDialog
Change-Id: I9fc3364d83fa5e55cee6c823f16c05934ee2dc43 Reviewed-on: https://gerrit.libreoffice.org/61053 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--cui/source/factory/dlgfact.cxx30
-rw-r--r--cui/source/factory/dlgfact.hxx18
-rw-r--r--cui/source/inc/measure.hxx4
-rw-r--r--cui/source/tabpages/measure.cxx17
-rw-r--r--cui/uiconfig/ui/dimensionlinestabpage.ui22
5 files changed, 62 insertions, 29 deletions
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index e9929805ae5d..d32d0a817e90 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -98,6 +98,12 @@ using ::com::sun::star::uno::Reference;
using namespace svx;
// AbstractTabDialog implementations just forwards everything to the dialog
IMPL_ABSTDLG_BASE(CuiAbstractSfxDialog_Impl)
+
+short CuiAbstractController_Impl::Execute()
+{
+ return m_xDlg->run();
+}
+
IMPL_ABSTDLG_BASE(CuiVclAbstractDialog_Impl)
IMPL_ABSTDLG_BASE(VclAbstractRefreshableDialog_Impl);
IMPL_ABSTDLG_BASE(CuiAbstractTabDialog_Impl);
@@ -361,7 +367,15 @@ void CuiAbstractTabController_Impl::SetText( const OUString& rStr )
m_xDlg->set_title(rStr);
}
+const SfxItemSet* CuiAbstractController_Impl::GetOutputItemSet() const
+{
+ return m_xDlg->GetOutputItemSet();
+}
+void CuiAbstractController_Impl::SetText(const OUString& rStr)
+{
+ m_xDlg->set_title(rStr);
+}
const SfxItemSet* CuiAbstractSfxDialog_Impl::GetOutputItemSet() const
{
@@ -1343,19 +1357,18 @@ VclPtr<SfxAbstractDialog> AbstractDialogFactory_Impl::CreateEventConfigDialog( v
return VclPtr<CuiAbstractSfxDialog_Impl>::Create(pDlg);
}
-VclPtr<SfxAbstractDialog> AbstractDialogFactory_Impl::CreateSfxDialog( vcl::Window* pParent,
- const SfxItemSet& rAttr,
- const SdrView* pView,
- sal_uInt32 nResId
- )
+VclPtr<SfxAbstractDialog> AbstractDialogFactory_Impl::CreateSfxDialog(vcl::Window* pParent,
+ const SfxItemSet& rAttr,
+ const SdrView* pView,
+ sal_uInt32 nResId)
{
-
SfxSingleTabDialog* pDlg=nullptr;
switch ( nResId )
{
case RID_SVXPAGE_MEASURE :
- pDlg = VclPtr<SvxMeasureDialog>::Create( pParent, rAttr, pView );
- break;
+ {
+ return VclPtr<CuiAbstractController_Impl>::Create(o3tl::make_unique<SvxMeasureDialog>(pParent ? pParent->GetFrameWeld() : nullptr, rAttr, pView));
+ }
case RID_SVXPAGE_CONNECTION :
pDlg = VclPtr<SvxConnectionDialog>::Create( pParent, rAttr, pView );
break;
@@ -1372,6 +1385,7 @@ VclPtr<SfxAbstractDialog> AbstractDialogFactory_Impl::CreateSfxDialog( vcl::Wind
return nullptr;
}
+
VclPtr<AbstractSvxPostItDialog> AbstractDialogFactory_Impl::CreateSvxPostItDialog( weld::Window* pParent,
const SfxItemSet& rCoreSet,
bool bPrevNext )
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index c2a91e684ade..3a1acd506334 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -28,6 +28,7 @@
class SfxTabDialog;
class SfxModalDialog;
+class SfxSingleTabDialogController;
class Dialog;
class SfxItemPool;
class FmShowColsDialog;
@@ -113,6 +114,23 @@ class CuiAbstractSfxDialog_Impl : public SfxAbstractDialog
virtual void SetText( const OUString& rStr ) override;
};
+class CuiAbstractController_Impl : public SfxAbstractDialog
+{
+protected:
+ std::unique_ptr<SfxSingleTabDialogController> m_xDlg;
+public:
+ explicit CuiAbstractController_Impl(std::unique_ptr<SfxSingleTabDialogController> p)
+ : m_xDlg(std::move(p))
+ {
+ }
+ virtual short Execute() override;
+ virtual const SfxItemSet* GetOutputItemSet() const override;
+
+ //From class Window.
+ virtual void SetText( const OUString& rStr ) override;
+};
+
+
class CuiAbstractTabDialog_Impl : public SfxAbstractTabDialog
{
DECL_ABSTDLG_BASE(CuiAbstractTabDialog_Impl,SfxTabDialog)
diff --git a/cui/source/inc/measure.hxx b/cui/source/inc/measure.hxx
index 5ba4ef2ecc4f..6574babc86f3 100644
--- a/cui/source/inc/measure.hxx
+++ b/cui/source/inc/measure.hxx
@@ -89,10 +89,10 @@ public:
/* Derived from SfxSingleTabDialog, in order to be able to be
informed about virtual methods by the control. */
-class SvxMeasureDialog : public SfxSingleTabDialog
+class SvxMeasureDialog : public SfxSingleTabDialogController
{
public:
- SvxMeasureDialog(vcl::Window* pParent, const SfxItemSet& rAttr,
+ SvxMeasureDialog(weld::Window* pParent, const SfxItemSet& rAttr,
const SdrView* pView);
};
diff --git a/cui/source/tabpages/measure.cxx b/cui/source/tabpages/measure.cxx
index 7946c0b8637a..977c9c253fc5 100644
--- a/cui/source/tabpages/measure.cxx
+++ b/cui/source/tabpages/measure.cxx
@@ -58,17 +58,18 @@ const sal_uInt16 SvxMeasurePage::pRanges[] =
|*
\************************************************************************/
-SvxMeasureDialog::SvxMeasureDialog( vcl::Window* pParent, const SfxItemSet& rInAttrs,
- const SdrView* pSdrView )
- : SfxSingleTabDialog(pParent, rInAttrs)
+SvxMeasureDialog::SvxMeasureDialog(weld::Window* pParent, const SfxItemSet& rInAttrs,
+ const SdrView* pSdrView)
+ : SfxSingleTabDialogController(pParent, rInAttrs)
{
- VclPtrInstance<SvxMeasurePage> _pPage( get_content_area(), rInAttrs );
+ TabPageParent pPageParent(get_content_area(), this);
+ VclPtrInstance<SvxMeasurePage> pPage(pPageParent, rInAttrs);
- _pPage->SetView( pSdrView );
- _pPage->Construct();
+ pPage->SetView(pSdrView);
+ pPage->Construct();
- SetTabPage(_pPage );
- SetText(CuiResId(RID_SVXSTR_DIMENSION_LINE));
+ SetTabPage(pPage);
+ m_xDialog->set_title(CuiResId(RID_SVXSTR_DIMENSION_LINE));
}
/*************************************************************************
diff --git a/cui/uiconfig/ui/dimensionlinestabpage.ui b/cui/uiconfig/ui/dimensionlinestabpage.ui
index b6609c336b07..760304e7b2de 100644
--- a/cui/uiconfig/ui/dimensionlinestabpage.ui
+++ b/cui/uiconfig/ui/dimensionlinestabpage.ui
@@ -156,7 +156,7 @@
<object class="GtkCheckButton" id="TSB_BELOW_REF_EDGE">
<property name="label" translatable="yes" context="dimensionlinestabpage|TSB_BELOW_REF_EDGE">Measure _below object</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="margin_left">12</property>
<property name="use_underline">True</property>
@@ -173,7 +173,7 @@
<child>
<object class="GtkSpinButton" id="MTR_LINE_DIST">
<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>
@@ -186,7 +186,7 @@
<child>
<object class="GtkSpinButton" id="MTR_FLD_HELPLINE_OVERHANG">
<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>
@@ -199,7 +199,7 @@
<child>
<object class="GtkSpinButton" id="MTR_FLD_HELPLINE_DIST">
<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>
@@ -212,7 +212,7 @@
<child>
<object class="GtkSpinButton" id="MTR_FLD_HELPLINE1_LEN">
<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">adjustment5</property>
<property name="digits">2</property>
@@ -225,7 +225,7 @@
<child>
<object class="GtkSpinButton" id="MTR_FLD_HELPLINE2_LEN">
<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">adjustment6</property>
<property name="digits">2</property>
@@ -238,7 +238,7 @@
<child>
<object class="GtkSpinButton" id="MTR_FLD_DECIMALPLACES">
<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>
</object>
@@ -347,7 +347,7 @@
<object class="GtkCheckButton" id="TSB_AUTOPOSV">
<property name="label" translatable="yes" context="dimensionlinestabpage|TSB_AUTOPOSV">_AutoVertical</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>
@@ -364,7 +364,7 @@
<object class="GtkCheckButton" id="TSB_AUTOPOSH">
<property name="label" translatable="yes" context="dimensionlinestabpage|TSB_AUTOPOSH">A_utoHorizontal</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>
@@ -390,7 +390,7 @@
<object class="GtkCheckButton" id="TSB_PARALLEL">
<property name="label" translatable="yes" context="dimensionlinestabpage|TSB_PARALLEL">_Parallel to line</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>
@@ -407,7 +407,7 @@
<object class="GtkCheckButton" id="TSB_SHOW_UNIT">
<property name="label" translatable="yes" context="dimensionlinestabpage|TSB_SHOW_UNIT">Show _measurement units</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>