summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sd/inc/sdabstdlg.hxx2
-rw-r--r--sd/qa/unit/dialogs-test.cxx18
-rw-r--r--sd/source/ui/dlg/dlgchar.cxx29
-rw-r--r--sd/source/ui/dlg/sddlgfact.cxx4
-rw-r--r--sd/source/ui/dlg/sddlgfact.hxx2
-rw-r--r--sd/source/ui/func/fuchar.cxx2
-rw-r--r--sd/source/ui/inc/dlg_char.hxx12
-rw-r--r--sd/uiconfig/sdraw/ui/drawchardialog.ui128
8 files changed, 141 insertions, 56 deletions
diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx
index f9c364c3a428..e8b1ed936ce1 100644
--- a/sd/inc/sdabstdlg.hxx
+++ b/sd/inc/sdabstdlg.hxx
@@ -170,7 +170,7 @@ public:
virtual VclPtr<VclAbstractDialog> CreateBreakDlg(weld::Window* pWindow, ::sd::DrawView* pDrView, ::sd::DrawDocShell* pShell, sal_uLong nSumActionCount, sal_uLong nObjCount ) = 0;
virtual VclPtr<AbstractCopyDlg> CreateCopyDlg(vcl::Window* pWindow, const SfxItemSet& rInAttrs, ::sd::View* pView ) = 0;
virtual VclPtr<AbstractSdCustomShowDlg> CreateSdCustomShowDlg(weld::Window* pWindow, SdDrawDocument& rDrawDoc) = 0;
- virtual VclPtr<SfxAbstractTabDialog> CreateSdTabCharDialog(vcl::Window* pWindow, const SfxItemSet* pAttr, SfxObjectShell* pDocShell) = 0;
+ virtual VclPtr<SfxAbstractTabDialog> CreateSdTabCharDialog(weld::Window* pWindow, const SfxItemSet* pAttr, SfxObjectShell* pDocShell) = 0;
virtual VclPtr<SfxAbstractTabDialog> CreateSdTabPageDialog(weld::Window* pWindow, const SfxItemSet* pAttr, SfxObjectShell* pDocShell, bool bAreaPage) = 0;
virtual VclPtr<AbstractSdModifyFieldDlg> CreateSdModifyFieldDlg(weld::Window* pWindow, const SvxFieldData* pInField, const SfxItemSet& rSet) = 0;
virtual VclPtr<AbstractSdSnapLineDlg> CreateSdSnapLineDlg(weld::Window* pParent, const SfxItemSet& rInAttrs, ::sd::View* pView) = 0;
diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx
index 1fe44cc04243..0988949f415d 100644
--- a/sd/qa/unit/dialogs-test.cxx
+++ b/sd/qa/unit/dialogs-test.cxx
@@ -305,10 +305,8 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID)
SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc();
CPPUNIT_ASSERT(pDrawDoc);
- auto const parent = getViewShell()->GetActiveWindow();
pRetval = getSdAbstractDialogFactory()->CreateSdCustomShowDlg(
- parent == nullptr ? nullptr : parent->GetFrameWeld(),
- *pDrawDoc);
+ getViewShell()->GetFrameWeld(), *pDrawDoc);
break;
}
case 4:
@@ -317,7 +315,7 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID)
// needs an SfxItemSet, use an empty constructed one
// needs a 'SfxObjectShell* pDocShell', crashes without
pRetval = getSdAbstractDialogFactory()->CreateSdTabCharDialog(
- getViewShell()->GetActiveWindow(),
+ getViewShell()->GetFrameWeld(),
&getEmptySfxItemSet(),
getDocShell());
break;
@@ -327,9 +325,8 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID)
// CreateSdTabPageDialog(const SfxItemSet* pAttr, SfxObjectShell* pDocShell, bool bAreaPage = true) override;
// needs a special SfxItemSet with merged content from page and other stuff, crashes without that (2nd page)
// needs a 'SfxObjectShell* pDocShell', crashes without. Also sufficient: FillStyleItemSet with XFILL_NONE set
- auto const parent = getViewShell()->GetActiveWindow();
pRetval = getSdAbstractDialogFactory()->CreateSdTabPageDialog(
- parent == nullptr ? nullptr : parent->GetFrameWeld(),
+ getViewShell()->GetFrameWeld(),
&getEmptyFillStyleSfxItemSet(),
getDocShell(),
true);
@@ -338,9 +335,8 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID)
case 6:
{
// CreateSdModifyFieldDlg(weld::Window* pWindow, const SvxFieldData* pInField, const SfxItemSet& rSet) override;
- auto const parent = getViewShell()->GetActiveWindow();
pRetval = getSdAbstractDialogFactory()->CreateSdModifyFieldDlg(
- parent == nullptr ? nullptr : parent->GetFrameWeld(),
+ getViewShell()->GetFrameWeld(),
nullptr,
getEmptySfxItemSet());
break;
@@ -353,9 +349,8 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID)
SfxItemSet aNewAttr(pDrawDoc->GetItemPool(), svl::Items<ATTR_SNAPLINE_START, ATTR_SNAPLINE_END>{});
aNewAttr.Put(SfxInt32Item(ATTR_SNAPLINE_X, 0));
aNewAttr.Put(SfxInt32Item(ATTR_SNAPLINE_Y, 0));
- auto const parent = getViewShell()->GetActiveWindow();
pRetval = getSdAbstractDialogFactory()->CreateSdSnapLineDlg(
- parent == nullptr ? nullptr : parent->GetFrameWeld(),
+ getViewShell()->GetFrameWeld(),
aNewAttr,
getDrawView());
break;
@@ -374,9 +369,8 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID)
aNewAttr.Put(makeSdAttrLayerPrintable());
aNewAttr.Put(makeSdAttrLayerLocked());
aNewAttr.Put(makeSdAttrLayerThisPage());
- auto const parent = getViewShell()->GetActiveWindow();
pRetval = getSdAbstractDialogFactory()->CreateSdInsertLayerDlg(
- parent == nullptr ? nullptr : parent->GetFrameWeld(),
+ getViewShell()->GetFrameWeld(),
aNewAttr,
true, // alternative: false
SdResId(STR_INSERTLAYER) /* alternative: STR_MODIFYLAYER */);
diff --git a/sd/source/ui/dlg/dlgchar.cxx b/sd/source/ui/dlg/dlgchar.cxx
index 4075a5995388..5901dd1fe4c8 100644
--- a/sd/source/ui/dlg/dlgchar.cxx
+++ b/sd/source/ui/dlg/dlgchar.cxx
@@ -30,38 +30,35 @@
/**
* Constructor of tab dialog: append pages to dialog
*/
-SdCharDlg::SdCharDlg( vcl::Window* pParent, const SfxItemSet* pAttr,
- const SfxObjectShell* pDocShell ) :
- SfxTabDialog ( pParent
- ,"DrawCharDialog"
- ,"modules/sdraw/ui/drawchardialog.ui"
- , pAttr ),
- rDocShell ( *pDocShell )
+SdCharDlg::SdCharDlg(weld::Window* pParent, const SfxItemSet* pAttr,
+ const SfxObjectShell* pDocShell)
+ : SfxTabDialogController(pParent, "modules/sdraw/ui/drawchardialog.ui",
+ "DrawCharDialog", pAttr)
+ , rDocShell(*pDocShell)
{
-
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
- mnCharName = AddTabPage( "RID_SVXPAGE_CHAR_NAME", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), nullptr );
- mnCharEffects = AddTabPage( "RID_SVXPAGE_CHAR_EFFECTS", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), nullptr );
- AddTabPage( "RID_SVXPAGE_CHAR_POSITION", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), nullptr );
- mnCharBackground = AddTabPage( "RID_SVXPAGE_BACKGROUND", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), nullptr );
+ AddTabPage("RID_SVXPAGE_CHAR_NAME", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_CHAR_NAME), nullptr);
+ AddTabPage("RID_SVXPAGE_CHAR_EFFECTS", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_CHAR_EFFECTS), nullptr);
+ AddTabPage("RID_SVXPAGE_CHAR_POSITION", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_CHAR_POSITION), nullptr);
+ AddTabPage("RID_SVXPAGE_BACKGROUND", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_BACKGROUND), nullptr);
}
-void SdCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
+void SdCharDlg::PageCreated(const OString& rId, SfxTabPage &rPage)
{
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
- if (nId == mnCharName)
+ if (rId == "RID_SVXPAGE_CHAR_NAME")
{
SvxFontListItem aItem(* static_cast<const SvxFontListItem*>( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) );
aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST));
rPage.PageCreated(aSet);
}
- else if (nId == mnCharEffects)
+ else if (rId == "RID_SVXPAGE_CHAR_EFFECTS")
{
rPage.PageCreated(aSet);
}
- else if (nId == mnCharBackground)
+ else if (rId == "RID_SVXPAGE_BACKGROUND")
{
aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,static_cast<sal_uInt32>(SvxBackgroundTabFlags::SHOW_CHAR_BKGCOLOR)));
rPage.PageCreated(aSet);
diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx
index 7173bfc0c533..f6640e06d42b 100644
--- a/sd/source/ui/dlg/sddlgfact.cxx
+++ b/sd/source/ui/dlg/sddlgfact.cxx
@@ -384,9 +384,9 @@ VclPtr<AbstractSdCustomShowDlg> SdAbstractDialogFactory_Impl::CreateSdCustomShow
return VclPtr<AbstractSdCustomShowDlg_Impl>::Create(o3tl::make_unique<SdCustomShowDlg>(pParent, rDrawDoc));
}
-VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdTabCharDialog(vcl::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell )
+VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdTabCharDialog(weld::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell)
{
- return VclPtr<SdAbstractTabDialog_Impl>::Create( VclPtr<SdCharDlg>::Create(pParent, pAttr, pDocShell) );
+ return VclPtr<SdAbstractTabController_Impl>::Create(o3tl::make_unique<SdCharDlg>(pParent, pAttr, pDocShell));
}
VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdTabPageDialog(weld::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell, bool bAreaPage )
diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx
index 16c0b0be361d..706bedb9854e 100644
--- a/sd/source/ui/dlg/sddlgfact.hxx
+++ b/sd/source/ui/dlg/sddlgfact.hxx
@@ -310,7 +310,7 @@ public:
virtual VclPtr<VclAbstractDialog> CreateBreakDlg(weld::Window* pWindow, ::sd::DrawView* pDrView, ::sd::DrawDocShell* pShell, sal_uLong nSumActionCount, sal_uLong nObjCount) override;
virtual VclPtr<AbstractCopyDlg> CreateCopyDlg(vcl::Window* pParent, const SfxItemSet& rInAttrs, ::sd::View* pView) override;
virtual VclPtr<AbstractSdCustomShowDlg> CreateSdCustomShowDlg(weld::Window* pParent, SdDrawDocument& rDrawDoc) override;
- virtual VclPtr<SfxAbstractTabDialog> CreateSdTabCharDialog(vcl::Window* pWindow, const SfxItemSet* pAttr, SfxObjectShell* pDocShell) override;
+ virtual VclPtr<SfxAbstractTabDialog> CreateSdTabCharDialog(weld::Window* pWindow, const SfxItemSet* pAttr, SfxObjectShell* pDocShell) override;
virtual VclPtr<SfxAbstractTabDialog> CreateSdTabPageDialog(weld::Window* pWindow, const SfxItemSet* pAttr, SfxObjectShell* pDocShell, bool bAreaPage) override;
virtual VclPtr<AbstractSdModifyFieldDlg> CreateSdModifyFieldDlg(weld::Window* pWindow, const SvxFieldData* pInField, const SfxItemSet& rSet) override;
virtual VclPtr<AbstractSdSnapLineDlg> CreateSdSnapLineDlg(weld::Window* pParent, const SfxItemSet& rInAttrs, ::sd::View* pView) override;
diff --git a/sd/source/ui/func/fuchar.cxx b/sd/source/ui/func/fuchar.cxx
index f53afb018762..4ad60edfdfa9 100644
--- a/sd/source/ui/func/fuchar.cxx
+++ b/sd/source/ui/func/fuchar.cxx
@@ -72,7 +72,7 @@ void FuChar::DoExecute( SfxRequest& rReq )
aNewAttr.Put( aEditAttr, false );
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
- ScopedVclPtr<SfxAbstractTabDialog> pDlg( pFact->CreateSdTabCharDialog(mpViewShell->GetActiveWindow(), &aNewAttr, mpDoc->GetDocSh() ) );
+ ScopedVclPtr<SfxAbstractTabDialog> pDlg( pFact->CreateSdTabCharDialog(mpViewShell->GetFrameWeld(), &aNewAttr, mpDoc->GetDocSh() ) );
if (rReq.GetSlot() == SID_CHAR_DLG_EFFECT)
{
pDlg->SetCurPageId("RID_SVXPAGE_CHAR_EFFECTS");
diff --git a/sd/source/ui/inc/dlg_char.hxx b/sd/source/ui/inc/dlg_char.hxx
index 22335ed44ee9..f56a2e6e64cf 100644
--- a/sd/source/ui/inc/dlg_char.hxx
+++ b/sd/source/ui/inc/dlg_char.hxx
@@ -28,21 +28,15 @@ class SfxObjectShell;
/**
* Character-Tab-Dialog
*/
-class SdCharDlg : public SfxTabDialog
+class SdCharDlg : public SfxTabDialogController
{
private:
- sal_uInt16 mnCharName;
- sal_uInt16 mnCharEffects;
- sal_uInt16 mnCharBackground;
-
const SfxObjectShell& rDocShell;
- virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) override;
+ virtual void PageCreated(const OString& rId, SfxTabPage &rPage) override;
public:
-
- SdCharDlg( vcl::Window* pParent, const SfxItemSet* pAttr,
- const SfxObjectShell* pDocShell );
+ SdCharDlg(weld::Window* pParent, const SfxItemSet* pAttr, const SfxObjectShell* pDocShell);
};
#endif // INCLUDED_SD_SOURCE_UI_INC_DLG_CHAR_HXX
diff --git a/sd/uiconfig/sdraw/ui/drawchardialog.ui b/sd/uiconfig/sdraw/ui/drawchardialog.ui
index c04ea7212b43..959e98e65b6b 100644
--- a/sd/uiconfig/sdraw/ui/drawchardialog.ui
+++ b/sd/uiconfig/sdraw/ui/drawchardialog.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="sd">
<requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="DrawCharDialog">
@@ -7,6 +7,9 @@
<property name="border_width">6</property>
<property name="title" translatable="yes" context="drawchardialog|DrawCharDialog">Character</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>
@@ -17,12 +20,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>
@@ -33,10 +34,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>
@@ -47,8 +50,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>
@@ -58,12 +61,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>
@@ -73,6 +75,7 @@
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
+ <property name="secondary">True</property>
</packing>
</child>
</object>
@@ -86,9 +89,10 @@
<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>
+ <property name="scrollable">True</property>
<child>
<object class="GtkGrid">
<property name="visible">True</property>
@@ -96,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">
@@ -115,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>
@@ -138,6 +190,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>
@@ -161,6 +237,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>
@@ -187,10 +287,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>