include/svx/dialogs.hrc                  |    1 
 svx/UIConfig_svx.mk                      |    1 
 svx/source/form/fmtextcontroldialogs.cxx |   28 +----
 svx/source/form/fmtextcontrolshell.cxx   |   32 ++----
 svx/source/form/formshell.src            |   37 -------
 svx/source/inc/fmtextcontroldialogs.hxx  |    6 -
 svx/uiconfig/ui/textcontrolparadialog.ui |  162 +++++++++++++++++++++++++++++++
 7 files changed, 188 insertions(+), 79 deletions(-)

New commits:
commit 2a1d60f76d84f4c617792b1dcf4196b4289fb51f
Author: Caolán McNamara <caol...@redhat.com>
Date:   Tue Dec 24 22:21:43 2013 +0000

    convert text control paragraph dialog to .ui
    
    Change-Id: Iedaa5db0add3e6f65d4e207f1514b8eb8344b6da

diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc
index 7c89bb7..53660a8 100644
--- a/include/svx/dialogs.hrc
+++ b/include/svx/dialogs.hrc
@@ -219,7 +219,6 @@
 #define RID_SVXIMG_CHECKED                  (RID_SVX_START + 244)
 
 #define RID_SVXDLG_TEXTCONTROL_CHARATTR     (RID_SVX_START + 286)
-#define RID_SVXDLG_TEXTCONTROL_PARAATTR     (RID_SVX_START + 287)
 
 #define RID_SVXDLG_LINK_WARNING             (RID_SVX_START + 313)
 #define RID_SIDEBAR_TEXT_PANEL              (RID_SVX_START + 314)
diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk
index 004cae2..9faa773 100644
--- a/svx/UIConfig_svx.mk
+++ b/svx/UIConfig_svx.mk
@@ -39,6 +39,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\
        svx/uiconfig/ui/sidebarparagraph \
        svx/uiconfig/ui/sidebarpossize \
        svx/uiconfig/ui/sidebartextpanel \
+       svx/uiconfig/ui/textcontrolparadialog \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/svx/source/form/fmtextcontroldialogs.cxx 
b/svx/source/form/fmtextcontroldialogs.cxx
index 40be5a8..92a5402 100644
--- a/svx/source/form/fmtextcontroldialogs.cxx
+++ b/svx/source/form/fmtextcontroldialogs.cxx
@@ -78,33 +78,23 @@ namespace svx
         }
     }
 
-    //====================================================================
-    //= TextControlParaAttribDialog
-    //====================================================================
-    //--------------------------------------------------------------------
-    TextControlParaAttribDialog::TextControlParaAttribDialog( Window* 
_pParent, const SfxItemSet& _rCoreSet )
-        :SfxTabDialog( _pParent, SVX_RES( RID_SVXDLG_TEXTCONTROL_PARAATTR ), 
&_rCoreSet )
+    TextControlParaAttribDialog::TextControlParaAttribDialog(Window* _pParent,
+        const SfxItemSet& _rCoreSet)
+        : SfxTabDialog( _pParent, "TextControlParagraphPropertiesDialog",
+            "svx/ui/textcontrolparadialog.ui", &_rCoreSet )
     {
-        FreeResource();
-
-        AddTabPage( RID_SVXPAGE_STD_PARAGRAPH );
-        AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH );
+        AddTabPage("labelTP_PARA_STD", RID_SVXPAGE_STD_PARAGRAPH);
+        AddTabPage("labelTP_PARA_ALIGN", RID_SVXPAGE_ALIGN_PARAGRAPH);
 
         SvtCJKOptions aCJKOptions;
         if( aCJKOptions.IsAsianTypographyEnabled() )
-            AddTabPage( RID_SVXPAGE_PARA_ASIAN );
+            AddTabPage("labelTP_PARA_ASIAN", RID_SVXPAGE_PARA_ASIAN);
         else
-            RemoveTabPage( RID_SVXPAGE_PARA_ASIAN );
+            RemoveTabPage("labelTP_PARA_ASIAN");
 
-        AddTabPage( RID_SVXPAGE_TABULATOR );
+        AddTabPage("labelTP_TABULATOR", RID_SVXPAGE_TABULATOR);
     }
 
-    //--------------------------------------------------------------------
-    TextControlParaAttribDialog::~TextControlParaAttribDialog()
-    {
-    }
-
-//........................................................................
 }   // namespace svx
 //........................................................................
 
diff --git a/svx/source/form/formshell.src b/svx/source/form/formshell.src
index 1a236ee..965e91f 100644
--- a/svx/source/form/formshell.src
+++ b/svx/source/form/formshell.src
@@ -182,41 +182,4 @@ TabDialog RID_SVXDLG_TEXTCONTROL_CHARATTR
     };
 };
 
-TabDialog RID_SVXDLG_TEXTCONTROL_PARAATTR
-{
-    OutputSize = TRUE;
-    SVLook = TRUE;
-    Moveable = TRUE;
-
-    Text [ en-US ] = "Paragraph";
-
-    TabControl 1
-    {
-        OutputSize = TRUE;
-        PageList =
-        {
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_STD_PARAGRAPH;
-                Text [ en-US ] = "Indents & Spacing";
-            };
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_ALIGN_PARAGRAPH;
-                Text [ en-US ] = "Alignment";
-            };
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_PARA_ASIAN;
-                Text [ en-US ] = "Asian Typography";
-            };
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_TABULATOR;
-                Text [ en-US ] = "Tabs";
-            };
-        };
-    };
-};
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/inc/fmtextcontroldialogs.hxx 
b/svx/source/inc/fmtextcontroldialogs.hxx
index 2ceb654..9f20a54 100644
--- a/svx/source/inc/fmtextcontroldialogs.hxx
+++ b/svx/source/inc/fmtextcontroldialogs.hxx
@@ -45,14 +45,10 @@ namespace svx
         virtual void PageCreated( sal_uInt16 _nId, SfxTabPage& _rPage );
     };
 
-    //====================================================================
-    //= TextControlParaAttribDialog
-    //====================================================================
     class TextControlParaAttribDialog : public SfxTabDialog
     {
     public:
-        TextControlParaAttribDialog( Window* _pParent, const SfxItemSet& 
_rCoreSet );
-        ~TextControlParaAttribDialog();
+        TextControlParaAttribDialog(Window* _pParent, const SfxItemSet& 
_rCoreSet);
     };
 //........................................................................
 } // namespace svx
diff --git a/svx/uiconfig/ui/textcontrolparadialog.ui 
b/svx/uiconfig/ui/textcontrolparadialog.ui
new file mode 100644
index 0000000..72a56b7
--- /dev/null
+++ b/svx/uiconfig/ui/textcontrolparadialog.ui
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="TextControlParagraphPropertiesDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Paragraph</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">12</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>
+            <child>
+              <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="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">3</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>
+          <object class="GtkNotebook" id="tabcontrol">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
+            <property name="vexpand">True</property>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="labelTP_PARA_STD">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Indents &amp; 
Spacing</property>
+              </object>
+              <packing>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="labelTP_PARA_ALIGN">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0.4699999988079071</property>
+                <property name="label" translatable="yes">Alignment</property>
+              </object>
+              <packing>
+                <property name="position">1</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="labelTP_PARA_ASIAN">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Asian 
Typography</property>
+              </object>
+              <packing>
+                <property name="position">2</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="labelTP_TABULATOR">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Tabs</property>
+              </object>
+              <packing>
+                <property name="position">3</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </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-widget response="0">reset</action-widget>
+    </action-widgets>
+  </object>
+</interface>
commit 1346055530f27acb53cafdfd0e2022a3382b1857
Author: Caolán McNamara <caol...@redhat.com>
Date:   Tue Dec 24 22:10:14 2013 +0000

    std::auto_ptr->boost::scoped_ptr
    
    Change-Id: I231de866d46d0e0a20e2f80855c0de3bd999ed1b

diff --git a/svx/source/form/fmtextcontrolshell.cxx 
b/svx/source/form/fmtextcontrolshell.cxx
index a2e2530..8365b20 100644
--- a/svx/source/form/fmtextcontrolshell.cxx
+++ b/svx/source/form/fmtextcontrolshell.cxx
@@ -63,8 +63,6 @@
 #include <vcl/outdev.hxx>
 #include <osl/mutex.hxx>
 
-#include <memory>
-
 //........................................................................
 namespace svx
 {
@@ -662,24 +660,24 @@ namespace svx
 
         SfxItemPool* pPool = EditEngine::CreatePool();
         pPool->FreezeIdRanges();
-        ::std::auto_ptr< SfxItemSet > pPureItems( new SfxItemSet( *pPool ) );
+        boost::scoped_ptr< SfxItemSet > xPureItems( new SfxItemSet( *pPool ) );
 
         // put the current states of the items into the set
-        ::std::auto_ptr< SfxAllItemSet > pCurrentItems( new SfxAllItemSet( 
*pPureItems ) );
-        transferFeatureStatesToItemSet( m_aControlFeatures, *pCurrentItems );
+        boost::scoped_ptr<SfxAllItemSet> xCurrentItems( new SfxAllItemSet( 
*xPureItems ) );
+        transferFeatureStatesToItemSet( m_aControlFeatures, *xCurrentItems );
 
         // additional items, which we are not responsible for at the SfxShell 
level,
         // but which need to be forwarded to the dialog, anyway
         ControlFeatures aAdditionalFestures;
         fillFeatureDispatchers( m_xActiveControl, pDialogSlots, 
aAdditionalFestures );
-        transferFeatureStatesToItemSet( aAdditionalFestures, *pCurrentItems, 
true );
+        transferFeatureStatesToItemSet( aAdditionalFestures, *xCurrentItems, 
true );
 
-        ::std::auto_ptr< SfxTabDialog > pDialog ( _eSet == eCharAttribs
-                                                ? static_cast< SfxTabDialog* 
>( new TextControlCharAttribDialog( NULL, *pCurrentItems, *pFontList ) )
-                                                : static_cast< SfxTabDialog* 
>( new TextControlParaAttribDialog( NULL, *pCurrentItems ) ) );
-        if ( RET_OK == pDialog->Execute() )
+        boost::scoped_ptr<SfxTabDialog> xDialog ( _eSet == eCharAttribs
+                                                ? static_cast< SfxTabDialog* 
>( new TextControlCharAttribDialog( NULL, *xCurrentItems, *pFontList ) )
+                                                : static_cast< SfxTabDialog* 
>( new TextControlParaAttribDialog( NULL, *xCurrentItems ) ) );
+        if ( RET_OK == xDialog->Execute() )
         {
-            const SfxItemSet& rModifiedItems = *pDialog->GetOutputItemSet();
+            const SfxItemSet& rModifiedItems = *xDialog->GetOutputItemSet();
             for ( WhichId nWhich = pPool->GetFirstWhich(); nWhich <= 
pPool->GetLastWhich(); ++nWhich )
             {
                 if ( rModifiedItems.GetItemState( nWhich ) == SFX_ITEM_SET )
@@ -713,9 +711,9 @@ namespace svx
                         Sequence< PropertyValue > aArgs;
                         // temporarily put the modified item into a "clean" 
set,
                         // and let TransformItems calc the respective UNO 
parameters
-                        pPureItems->Put( *pModifiedItem );
-                        TransformItems( nSlotForItemSet, *pPureItems, aArgs );
-                        pPureItems->ClearItem( nWhich );
+                        xPureItems->Put( *pModifiedItem );
+                        TransformItems( nSlotForItemSet, *xPureItems, aArgs );
+                        xPureItems->ClearItem( nWhich );
 
                         if  (   ( nSlotForItemSet == 
SID_ATTR_PARA_HANGPUNCTUATION )
                             ||  ( nSlotForItemSet == 
SID_ATTR_PARA_FORBIDDEN_RULES )
@@ -760,9 +758,9 @@ namespace svx
             _rReq.Done( rModifiedItems );
         }
 
-        pDialog.reset();
-        pCurrentItems.reset();
-        pPureItems.reset();
+        xDialog.reset();
+        xCurrentItems.reset();
+        xPureItems.reset();
         SfxItemPool::Free(pPool);
     }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to