[Libreoffice-commits] core.git: chart2/source cui/uiconfig cui/UIConfig_cui.mk extensions/source include/sfx2 sfx2/source sw/source

Caolán McNamara caolanm at redhat.com
Wed Jul 3 01:00:19 PDT 2013


 chart2/source/controller/dialogs/dlg_NumberFormat.cxx |    3 
 cui/UIConfig_cui.mk                                   |    5 -
 cui/uiconfig/ui/formatnumberdialog.ui                 |   81 ++++++++++++++++++
 extensions/source/propctrlr/formcomponenthandler.cxx  |    4 
 include/sfx2/basedlgs.hxx                             |    9 +-
 sfx2/source/dialog/basedlgs.cxx                       |   31 ++++--
 sw/source/ui/chrdlg/tblnumfm.cxx                      |    3 
 7 files changed, 115 insertions(+), 21 deletions(-)

New commits:
commit e8fdd77a66fe92fae063394683c6d9f64c9f54e6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jul 2 20:16:40 2013 +0100

    restore title on Format Number single tab dialogs
    
    Allow a .ui to be given to the SingleTabDialog ctor. There are *three*
    single-tab Format Number dialogs, we really should combine them together into
    one dialog.
    
    Change-Id: I1021c9b968764bd9ad35832958ef2bd067fca798

diff --git a/chart2/source/controller/dialogs/dlg_NumberFormat.cxx b/chart2/source/controller/dialogs/dlg_NumberFormat.cxx
index 348f667..741bebc 100644
--- a/chart2/source/controller/dialogs/dlg_NumberFormat.cxx
+++ b/chart2/source/controller/dialogs/dlg_NumberFormat.cxx
@@ -40,7 +40,8 @@ namespace chart
 using namespace ::com::sun::star;
 
 NumberFormatDialog::NumberFormatDialog(Window* pParent, SfxItemSet& rSet)
-    : SfxSingleTabDialog(pParent, rSet)
+    : SfxSingleTabDialog(pParent, rSet, "FormatNumberDialog",
+        "cui/ui/formatnumberdialog.ui")
 {
     SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
     ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT );
diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk
index 4bd60b4..bf0e766 100644
--- a/cui/UIConfig_cui.mk
+++ b/cui/UIConfig_cui.mk
@@ -21,6 +21,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
 	cui/uiconfig/ui/charnamepage \
 	cui/uiconfig/ui/colorpage \
 	cui/uiconfig/ui/comment \
+	cui/uiconfig/ui/formatnumberdialog \
 	cui/uiconfig/ui/gradientpage \
 	cui/uiconfig/ui/colorconfigwin \
 	cui/uiconfig/ui/effectspage \
@@ -59,8 +60,8 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
 	cui/uiconfig/ui/optuserpage \
 	cui/uiconfig/ui/optviewpage \
 	cui/uiconfig/ui/pageformatpage \
-        cui/uiconfig/ui/paragalignpage \
-        cui/uiconfig/ui/paraindentspacing \
+	cui/uiconfig/ui/paragalignpage \
+	cui/uiconfig/ui/paraindentspacing \
 	cui/uiconfig/ui/pastespecial \
 	cui/uiconfig/ui/personalization_tab \
 	cui/uiconfig/ui/pickbulletpage \
diff --git a/cui/uiconfig/ui/formatnumberdialog.ui b/cui/uiconfig/ui/formatnumberdialog.ui
new file mode 100644
index 0000000..6671d4b
--- /dev/null
+++ b/cui/uiconfig/ui/formatnumberdialog.ui
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="FormatNumberDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Format Number</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox1">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">2</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <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>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <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>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <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>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">ok</action-widget>
+      <action-widget response="0">cancel</action-widget>
+      <action-widget response="0">help</action-widget>
+    </action-widgets>
+  </object>
+</interface>
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index e29b892..bdf86f6 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -2716,7 +2716,9 @@ namespace pcr
             aCoreSet.Put( aFormatter );
 
             // a tab dialog with a single page
-            boost::scoped_ptr< SfxSingleTabDialog > xDialog(new SfxSingleTabDialog(impl_getDefaultDialogParent_nothrow(), aCoreSet));
+            boost::scoped_ptr< SfxSingleTabDialog > xDialog(new SfxSingleTabDialog(
+                impl_getDefaultDialogParent_nothrow(), aCoreSet,
+                "FormatNumberDialog", "cui/ui/formatnumberdialog.ui"));
             SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
             DBG_ASSERT( pFact, "CreateFactory fail!" );
             ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT );
diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
index 95278e8..609d639 100644
--- a/include/sfx2/basedlgs.hxx
+++ b/include/sfx2/basedlgs.hxx
@@ -182,7 +182,8 @@ class SFX2_DLLPUBLIC SfxSingleTabDialogBase : public SfxModalDialog
 {
 public:
     //layout ctor
-    SfxSingleTabDialogBase(Window* pParent, const SfxItemSet& rOptionsSet);
+    SfxSingleTabDialogBase(Window *pParent, const SfxItemSet& rOptionsSet,
+        const OString& rID, const OUString& rUIXMLDescription);
 
     //non-layout ctors
     SfxSingleTabDialogBase( Window* pParent, const SfxItemSet& rOptionsSet, sal_uInt16 nUniqueId );
@@ -210,8 +211,10 @@ protected:
 class SFX2_DLLPUBLIC SfxSingleTabDialog : public SfxSingleTabDialogBase
 {
 public:
-    SfxSingleTabDialog(Window* pParent, const SfxItemSet& rOptionsSet)
-        : SfxSingleTabDialogBase(pParent, rOptionsSet)
+    SfxSingleTabDialog(Window *pParent, const SfxItemSet& rOptionsSet,
+        const OString& rID = OString("SingleTabDialog"),
+        const OUString& rUIXMLDescription = OUString("sfx/ui/singletabdialog.ui"))
+        : SfxSingleTabDialogBase(pParent, rOptionsSet, rID, rUIXMLDescription)
     {
     }
     void setTabPage(SfxTabPage* pTabPage, GetTabPageRanges pRangesFunc = 0, sal_uInt32 nSettingsId = 0);
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 6b26bf3..ff44f01 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -749,8 +749,9 @@ SfxSingleTabDialogBase::SfxSingleTabDialogBase
     SetInputSet( pInSet );
 }
 
-SfxSingleTabDialogBase::SfxSingleTabDialogBase(Window *pParent, const SfxItemSet& rSet)
-    : SfxModalDialog(pParent, "SingleTabDialog", "sfx/ui/singletabdialog.ui")
+SfxSingleTabDialogBase::SfxSingleTabDialogBase(Window *pParent, const SfxItemSet& rSet,
+    const OString& rID, const OUString& rUIXMLDescription)
+    : SfxModalDialog(pParent, rID, rUIXMLDescription)
     , pImpl(new SingleTabDlgImpl)
 {
     get(pOKBtn, "ok");
@@ -788,23 +789,27 @@ void SfxSingleTabDialog::setTabPage(SfxTabPage* pTabPage,
     {
         // First obtain the user data, only then Reset()
         SvtViewOptions aPageOpt( E_TABPAGE, OUString::number( GetUniqId() ) );
-        String sUserData;
         Any aUserItem = aPageOpt.GetUserItem( USERITEM_NAME );
-        OUString aTemp;
-        if ( aUserItem >>= aTemp )
-            sUserData = String( aTemp );
-        pImpl->m_pSfxPage->SetUserData( sUserData );
+        OUString sUserData;
+        aUserItem >>= sUserData;
+        pImpl->m_pSfxPage->SetUserData(sUserData);
         pImpl->m_pSfxPage->Reset( *GetInputItemSet() );
         pImpl->m_pSfxPage->Show();
 
         pHelpBtn->Show(Help::IsContextHelpEnabled());
 
-        // Set TabPage text in the Dialog
-        SetText( pImpl->m_pSfxPage->GetText() );
-
-        // Dialog recieves the HelpId of TabPage
-        SetHelpId( pImpl->m_pSfxPage->GetHelpId() );
-        SetUniqueId( pImpl->m_pSfxPage->GetUniqueId() );
+        // Set TabPage text in the Dialog if there is any
+        OUString sTitle(pImpl->m_pSfxPage->GetText());
+        if (!sTitle.isEmpty())
+            SetText(sTitle);
+
+        // Dialog recieves the HelpId of TabPage if there is any
+        OString sHelpId(pImpl->m_pSfxPage->GetHelpId());
+        if (!sHelpId.isEmpty())
+            SetHelpId(sHelpId);
+        OString sUniqueId(pImpl->m_pSfxPage->GetUniqueId());
+        if (!sUniqueId.isEmpty())
+            SetUniqueId(sUniqueId);
     }
 }
 
diff --git a/sw/source/ui/chrdlg/tblnumfm.cxx b/sw/source/ui/chrdlg/tblnumfm.cxx
index 1552f60..a77c08a 100644
--- a/sw/source/ui/chrdlg/tblnumfm.cxx
+++ b/sw/source/ui/chrdlg/tblnumfm.cxx
@@ -30,7 +30,8 @@
 #include <sfx2/tabdlg.hxx>
 
 SwNumFmtDlg::SwNumFmtDlg(Window* pParent, const SfxItemSet& rSet)
-    : SfxSingleTabDialog(pParent, rSet)
+    : SfxSingleTabDialog(pParent, rSet, "FormatNumberDialog",
+        "cui/ui/formatnumberdialog.ui")
 {
     // Create TabPage
     SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();


More information about the Libreoffice-commits mailing list