[Libreoffice-commits] core.git: cui/source cui/uiconfig include/svx svx/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Sep 28 12:04:21 UTC 2018
cui/source/dialogs/sdrcelldlg.cxx | 17 +--
cui/source/factory/dlgfact.cxx | 4
cui/source/factory/dlgfact.hxx | 2
cui/source/inc/sdrcelldlg.hxx | 9 --
cui/uiconfig/ui/formatcellsdialog.ui | 129 ++++++++++++++++++++++++++----
include/svx/sdr/table/tablecontroller.hxx | 4
include/svx/svxdlg.hxx | 2
svx/source/table/tablecontroller.cxx | 9 +-
8 files changed, 138 insertions(+), 38 deletions(-)
New commits:
commit 1e6b6f038af656b475cb87844822287fd4e6c166
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Sep 26 13:38:50 2018 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Sep 28 14:03:52 2018 +0200
weld SvxFormatCellsDialog
Change-Id: I236ddc4f58b882e648512a99306440fa88a3aeeb
Reviewed-on: https://gerrit.libreoffice.org/61017
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/cui/source/dialogs/sdrcelldlg.cxx b/cui/source/dialogs/sdrcelldlg.cxx
index 47dd49cbc6a5..e20a3f488209 100644
--- a/cui/source/dialogs/sdrcelldlg.cxx
+++ b/cui/source/dialogs/sdrcelldlg.cxx
@@ -25,25 +25,24 @@
#include <border.hxx>
#include <svx/dialogs.hrc>
-SvxFormatCellsDialog::SvxFormatCellsDialog( vcl::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel )
- : SfxTabDialog(pParent, "FormatCellsDialog", "cui/ui/formatcellsdialog.ui", pAttr)
+SvxFormatCellsDialog::SvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel)
+ : SfxTabDialogController(pParent, "cui/ui/formatcellsdialog.ui", "FormatCellsDialog", pAttr)
, mrOutAttrs(*pAttr)
, mpColorTab(rModel.GetColorList())
, mpGradientList(rModel.GetGradientList())
, mpHatchingList(rModel.GetHatchList())
, mpBitmapList(rModel.GetBitmapList())
, mpPatternList(rModel.GetPatternList())
- , m_nAreaPageId(0)
{
AddTabPage("name", RID_SVXPAGE_CHAR_NAME);
AddTabPage("effects", RID_SVXPAGE_CHAR_EFFECTS);
- m_nBorderPageId = AddTabPage("border", RID_SVXPAGE_BORDER );
- m_nAreaPageId = AddTabPage("area", RID_SVXPAGE_AREA);
+ AddTabPage("border", RID_SVXPAGE_BORDER );
+ AddTabPage("area", RID_SVXPAGE_AREA);
}
-void SvxFormatCellsDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
+void SvxFormatCellsDialog::PageCreated(const OString& rId, SfxTabPage &rPage)
{
- if (nId == m_nAreaPageId)
+ if (rId == "area")
{
SvxAreaTabPage& rAreaPage = static_cast<SvxAreaTabPage&>(rPage);
rAreaPage.SetColorList( mpColorTab );
@@ -53,13 +52,13 @@ void SvxFormatCellsDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
rAreaPage.SetPatternList( mpPatternList );;
rAreaPage.ActivatePage( mrOutAttrs );
}
- else if (nId == m_nBorderPageId)
+ else if (rId == "border")
{
SvxBorderTabPage& rBorderPage = static_cast<SvxBorderTabPage&>(rPage);
rBorderPage.SetTableMode();
}
else
- SfxTabDialog::PageCreated( nId, rPage );
+ SfxTabDialogController::PageCreated(rId, rPage);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index d32d0a817e90..e48e1f87d11c 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1618,9 +1618,9 @@ VclPtr<SfxAbstractLinksDialog> AbstractDialogFactory_Impl::CreateLinksDialog( vc
return VclPtr<AbstractLinksDialog_Impl>::Create( pLinkDlg );
}
-VclPtr<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateSvxFormatCellsDialog( const SfxItemSet* pAttr, const SdrModel& rModel, const SdrObject* /*pObj*/ )
+VclPtr<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateSvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel, const SdrObject* /*pObj*/)
{
- return VclPtr<CuiAbstractTabDialog_Impl>::Create( VclPtr<SvxFormatCellsDialog>::Create( nullptr, pAttr, rModel ) );
+ return VclPtr<CuiAbstractTabController_Impl>::Create(o3tl::make_unique<SvxFormatCellsDialog>(pParent, pAttr, rModel));
}
VclPtr<SvxAbstractSplitTableDialog> AbstractDialogFactory_Impl::CreateSvxSplitTableDialog(weld::Window* pParent, bool bIsTableVertical, long nMaxVertical)
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 3a1acd506334..2316ff7be199 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -824,7 +824,7 @@ public:
const sal_uInt16 _nInitiallySelectedEvent
) override;
- virtual VclPtr<SfxAbstractTabDialog> CreateSvxFormatCellsDialog( const SfxItemSet* pAttr, const SdrModel& rModel, const SdrObject* pObj ) override;
+ virtual VclPtr<SfxAbstractTabDialog> CreateSvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel, const SdrObject* pObj) override;
virtual VclPtr<SvxAbstractSplitTableDialog> CreateSvxSplitTableDialog(weld::Window* pParent, bool bIsTableVertical, long nMaxVertical) override;
diff --git a/cui/source/inc/sdrcelldlg.hxx b/cui/source/inc/sdrcelldlg.hxx
index 0a38f759a494..50ab4b39ac70 100644
--- a/cui/source/inc/sdrcelldlg.hxx
+++ b/cui/source/inc/sdrcelldlg.hxx
@@ -25,7 +25,7 @@
#include <svx/xtable.hxx>
class SdrModel;
-class SvxFormatCellsDialog : public SfxTabDialog
+class SvxFormatCellsDialog : public SfxTabDialogController
{
private:
const SfxItemSet& mrOutAttrs;
@@ -36,13 +36,10 @@ private:
XBitmapListRef mpBitmapList;
XPatternListRef mpPatternList;
- sal_uInt16 m_nAreaPageId;
- sal_uInt16 m_nBorderPageId;
-
public:
- SvxFormatCellsDialog( vcl::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel );
+ SvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel);
- virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) override;
+ virtual void PageCreated(const OString& rId, SfxTabPage &rPage) override;
};
diff --git a/cui/uiconfig/ui/formatcellsdialog.ui b/cui/uiconfig/ui/formatcellsdialog.ui
index a07b314394de..741a401c122d 100644
--- a/cui/uiconfig/ui/formatcellsdialog.ui
+++ b/cui/uiconfig/ui/formatcellsdialog.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="FormatCellsDialog">
@@ -7,7 +7,13 @@
<property name="border_width">6</property>
<property name="title" translatable="yes" context="formatcellsdialog|FormatCellsDialog">Table Properties</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>
@@ -18,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>
@@ -34,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>
@@ -48,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>
@@ -59,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>
@@ -74,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>
@@ -90,6 +96,7 @@
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
+ <property name="scrollable">True</property>
<child>
<object class="GtkGrid">
<property name="visible">True</property>
@@ -97,6 +104,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 +147,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 +194,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>
@@ -162,6 +241,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>
@@ -188,10 +291,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/sdr/table/tablecontroller.hxx b/include/svx/sdr/table/tablecontroller.hxx
index 22b010f1dae4..eecc60d75a8b 100644
--- a/include/svx/sdr/table/tablecontroller.hxx
+++ b/include/svx/sdr/table/tablecontroller.hxx
@@ -72,9 +72,9 @@ public:
SVX_DLLPRIVATE void onInsert( sal_uInt16 nSId, const SfxItemSet* pArgs = nullptr );
SVX_DLLPRIVATE void onDelete( sal_uInt16 nSId );
SVX_DLLPRIVATE void onSelect( sal_uInt16 nSId );
- SVX_DLLPRIVATE void onFormatTable( SfxRequest const & rReq );
+ SVX_DLLPRIVATE void onFormatTable(const SfxRequest& rReq);
SVX_DLLPRIVATE void MergeMarkedCells();
- SVX_DLLPRIVATE void SplitMarkedCells();
+ SVX_DLLPRIVATE void SplitMarkedCells(const SfxRequest& rReq);
SVX_DLLPRIVATE void DistributeColumns( const bool bOptimize );
SVX_DLLPRIVATE void DistributeRows( const bool bOptimize );
SVX_DLLPRIVATE void SetVertical( sal_uInt16 nSId );
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index 061c30ffc9a7..1c8ae7b1eeb2 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -462,7 +462,7 @@ public:
const sal_uInt16 _nInitiallySelectedEvent
) = 0;
- virtual VclPtr<SfxAbstractTabDialog> CreateSvxFormatCellsDialog( const SfxItemSet* pAttr, const SdrModel& rModel, const SdrObject* pObj )=0;
+ virtual VclPtr<SfxAbstractTabDialog> CreateSvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel, const SdrObject* pObj )=0;
virtual VclPtr<SvxAbstractSplitTableDialog> CreateSvxSplitTableDialog(weld::Window* pParent, bool bIsTableVertical, long nMaxVertical) = 0;
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index df7868920f6f..301829a20a37 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -887,7 +887,7 @@ namespace
}
}
-void SvxTableController::onFormatTable( SfxRequest const & rReq )
+void SvxTableController::onFormatTable(const SfxRequest& rReq)
{
if(!mxTableObj.is())
return;
@@ -912,6 +912,7 @@ void SvxTableController::onFormatTable( SfxRequest const & rReq )
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
ScopedVclPtr<SfxAbstractTabDialog> xDlg( pFact->CreateSvxFormatCellsDialog(
+ rReq.GetFrameWeld(),
&aNewAttr,
rModel,
&rTableObj) );
@@ -999,7 +1000,7 @@ void SvxTableController::Execute( SfxRequest& rReq )
break;
case SID_TABLE_SPLIT_CELLS:
- SplitMarkedCells();
+ SplitMarkedCells(rReq);
break;
case SID_TABLE_OPTIMAL_COLUMN_WIDTH:
@@ -1246,13 +1247,13 @@ void SvxTableController::MergeMarkedCells()
}
}
-void SvxTableController::SplitMarkedCells()
+void SvxTableController::SplitMarkedCells(const SfxRequest& rReq)
{
if(!checkTableObject() || !mxTable.is())
return;
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- ScopedVclPtr< SvxAbstractSplitTableDialog > xDlg( pFact->CreateSvxSplitTableDialog( nullptr, false, 99 ) );
+ ScopedVclPtr<SvxAbstractSplitTableDialog> xDlg(pFact->CreateSvxSplitTableDialog(rReq.GetFrameWeld(), false, 99));
if( xDlg->Execute() )
{
More information about the Libreoffice-commits
mailing list