[Libreoffice-commits] core.git: sc/AllLangResTarget_sc.mk sc/inc sc/source sc/uiconfig sc/UIConfig_scalc.mk

Caolán McNamara caolanm at redhat.com
Sat Jan 4 12:14:49 PST 2014


 sc/AllLangResTarget_sc.mk          |    1 
 sc/UIConfig_scalc.mk               |    1 
 sc/inc/sc.hrc                      |    3 
 sc/inc/scabstdlg.hxx               |    4 
 sc/source/ui/attrdlg/scdlgfact.cxx |   19 ----
 sc/source/ui/attrdlg/scdlgfact.hxx |    4 
 sc/source/ui/drawfunc/drtxtob1.cxx |    3 
 sc/source/ui/inc/textdlgs.hxx      |    9 --
 sc/source/ui/miscdlgs/textdlgs.cxx |   35 +++----
 sc/source/ui/src/textdlgs.src      |   90 --------------------
 sc/uiconfig/scalc/ui/paradialog.ui |  163 +++++++++++++++++++++++++++++++++++++
 11 files changed, 193 insertions(+), 139 deletions(-)

New commits:
commit c2b40175fd2b6ec2169e89ffd3bac14a3cf679dc
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 4 20:08:36 2014 +0000

    convert calc paragraph dialog to .ui
    
    and that's the last TabDialog in calc converted
    
    Change-Id: Idecf1b4ba991f7b59e40ea0f0813a5dc5644dfd3

diff --git a/sc/AllLangResTarget_sc.mk b/sc/AllLangResTarget_sc.mk
index cfc913c..baa4527 100644
--- a/sc/AllLangResTarget_sc.mk
+++ b/sc/AllLangResTarget_sc.mk
@@ -38,7 +38,6 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\
     sc/source/ui/src/globstr.src \
     sc/source/ui/src/toolbox.src \
     sc/source/ui/src/scfuncs.src \
-    sc/source/ui/src/textdlgs.src \
     sc/source/ui/src/sc.src \
     sc/source/ui/src/hdrcont.src \
     sc/source/ui/src/scerrors.src \
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index 2cbf29f..8299602 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -114,6 +114,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
 	sc/uiconfig/scalc/ui/optimalrowheightdialog \
 	sc/uiconfig/scalc/ui/optsortlists \
 	sc/uiconfig/scalc/ui/pagetemplatedialog \
+	sc/uiconfig/scalc/ui/paradialog \
 	sc/uiconfig/scalc/ui/paratemplatedialog \
 	sc/uiconfig/scalc/ui/printareasdialog \
 	sc/uiconfig/scalc/ui/printeroptions \
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 98aebf8..bfd9668 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -1047,9 +1047,6 @@
 #define RID_SCPAGE_PRINT                (SC_DIALOGS_START + 70)
 #define RID_SCDLG_COLORROW              (SC_DIALOGS_START + 71)
 
-
-
-#define RID_SCDLG_PARAGRAPH             (SC_DIALOGS_START + 77)
 #define RID_SCDLG_CONTACTS              (SC_DIALOGS_START + 78)
 
 #define RID_SCPAGE_STAT                 (SC_DIALOGS_START + 79)
diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx
index c7716db..dc1b17f 100644
--- a/sc/inc/scabstdlg.hxx
+++ b/sc/inc/scabstdlg.hxx
@@ -495,8 +495,8 @@ public:
     virtual SfxAbstractTabDialog * CreateScCharDlg(Window* pParent,
         const SfxItemSet* pAttr, const SfxObjectShell* pDocShell) = 0;
 
-    virtual SfxAbstractTabDialog * CreateScParagraphDlg( Window* pParent, const SfxItemSet* pAttr ,
-                                                            int nId ) = 0;
+    virtual SfxAbstractTabDialog * CreateScParagraphDlg(Window* pParent,
+        const SfxItemSet* pAttr) = 0;
 
     virtual SfxAbstractTabDialog * CreateScValidationDlg(Window* pParent,
         const SfxItemSet* pArgSet, ScTabViewShell *pTabVwSh) = 0;
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index 1ac1e0e..9e3f47e 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -1132,22 +1132,11 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScCharDlg(
     return new ScAbstractTabDialog_Impl(pDlg);
 }
 
-SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScParagraphDlg( Window* pParent, const SfxItemSet* pAttr ,
-                                                                            int nId )
+SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScParagraphDlg(
+    Window* pParent, const SfxItemSet* pAttr)
 {
-    SfxTabDialog* pDlg=NULL;
-    switch ( nId )
-    {
-        case RID_SCDLG_PARAGRAPH :
-            pDlg = new ScParagraphDlg( pParent, pAttr );
-            break;
-        default:
-            break;
-    }
-
-    if ( pDlg )
-        return new ScAbstractTabDialog_Impl( pDlg );
-    return 0;
+    SfxTabDialog* pDlg = new ScParagraphDlg(pParent, pAttr);
+    return new ScAbstractTabDialog_Impl(pDlg);
 }
 
 SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScValidationDlg(Window* pParent,
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index cbbf070..91c450b 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -562,8 +562,8 @@ public:
     virtual SfxAbstractTabDialog * CreateScCharDlg(Window* pParent,
         const SfxItemSet* pAttr, const SfxObjectShell* pDocShell);
 
-    virtual SfxAbstractTabDialog * CreateScParagraphDlg( Window* pParent, const SfxItemSet* pAttr ,
-                                                            int nId );
+    virtual SfxAbstractTabDialog * CreateScParagraphDlg(Window* pParent,
+        const SfxItemSet* pAttr);
 
     virtual SfxAbstractTabDialog * CreateScValidationDlg(Window* pParent,
         const SfxItemSet* pArgSet, ScTabViewShell *pTabVwSh);
diff --git a/sc/source/ui/drawfunc/drtxtob1.cxx b/sc/source/ui/drawfunc/drtxtob1.cxx
index 141062d..5142bf3 100644
--- a/sc/source/ui/drawfunc/drtxtob1.cxx
+++ b/sc/source/ui/drawfunc/drtxtob1.cxx
@@ -94,7 +94,8 @@ sal_Bool ScDrawTextObjectBar::ExecuteParaDlg( const SfxItemSet& rArgs,
     ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
     OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
 
-    SfxAbstractTabDialog* pDlg = pFact->CreateScParagraphDlg( pViewData->GetDialogParent(), &aNewAttr, RID_SCDLG_PARAGRAPH);
+    SfxAbstractTabDialog* pDlg = pFact->CreateScParagraphDlg(
+        pViewData->GetDialogParent(), &aNewAttr);
     OSL_ENSURE(pDlg, "Dialog create fail!");
     sal_Bool bRet = ( pDlg->Execute() == RET_OK );
 
diff --git a/sc/source/ui/inc/textdlgs.hxx b/sc/source/ui/inc/textdlgs.hxx
index 65e4d56..abcd88a 100644
--- a/sc/source/ui/inc/textdlgs.hxx
+++ b/sc/source/ui/inc/textdlgs.hxx
@@ -40,15 +40,14 @@ public:
 class ScParagraphDlg : public SfxTabDialog
 {
 private:
-    virtual void    PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
+    sal_uInt16 m_nTabPageId;
+
+    virtual void PageCreated(sal_uInt16 nId, SfxTabPage &rPage);
 
 public:
-            ScParagraphDlg( Window* pParent, const SfxItemSet* pAttr );
-            ~ScParagraphDlg() {}
+    ScParagraphDlg(Window* pParent, const SfxItemSet* pAttr);
 };
 
-
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/textdlgs.cxx b/sc/source/ui/miscdlgs/textdlgs.cxx
index 324dce7..3b19249 100644
--- a/sc/source/ui/miscdlgs/textdlgs.cxx
+++ b/sc/source/ui/miscdlgs/textdlgs.cxx
@@ -67,36 +67,31 @@ void ScCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
 
 // -----------------------------------------------------------------------
 
-ScParagraphDlg::ScParagraphDlg( Window* pParent, const SfxItemSet* pAttr ) :
-        SfxTabDialog        ( pParent, ScResId( RID_SCDLG_PARAGRAPH ), pAttr )
+ScParagraphDlg::ScParagraphDlg(Window* pParent, const SfxItemSet* pAttr)
+    : SfxTabDialog(pParent, "ParagraphDialog",
+        "modules/scalc/ui/paradialog.ui", pAttr)
+    , m_nTabPageId(0)
 {
-    FreeResource();
-
+    AddTabPage("labelTP_PARA_STD", RID_SVXPAGE_STD_PARAGRAPH);
+    AddTabPage("labelTP_PARA_ALIGN", RID_SVXPAGE_ALIGN_PARAGRAPH);
     SvtCJKOptions aCJKOptions;
-
-    AddTabPage( RID_SVXPAGE_STD_PARAGRAPH );
-    AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH );
-    if ( aCJKOptions.IsAsianTypographyEnabled() )
-        AddTabPage( RID_SVXPAGE_PARA_ASIAN);
+    if (aCJKOptions.IsAsianTypographyEnabled() )
+        AddTabPage("labelTP_PARA_ASIAN", RID_SVXPAGE_PARA_ASIAN);
     else
-        RemoveTabPage( RID_SVXPAGE_PARA_ASIAN );
-    AddTabPage( RID_SVXPAGE_TABULATOR );
+        RemoveTabPage("labelTP_PARA_ASIAN");
+    m_nTabPageId = AddTabPage("labelTP_TABULATOR", RID_SVXPAGE_TABULATOR);
 }
 
 // -----------------------------------------------------------------------
 
 void ScParagraphDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
 {
-    switch( nId )
+    if (nId == m_nTabPageId)
     {
-        case RID_SVXPAGE_TABULATOR:
-            {
-            SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
-            aSet.Put(SfxUInt16Item(SID_SVXTABULATORTABPAGE_CONTROLFLAGS,(TABTYPE_ALL &~TABTYPE_LEFT) |
-                                (TABFILL_ALL &~TABFILL_NONE) ));
-            rPage.PageCreated(aSet);
-            }
-        break;
+        SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
+        aSet.Put(SfxUInt16Item(SID_SVXTABULATORTABPAGE_CONTROLFLAGS,
+            (TABTYPE_ALL &~TABTYPE_LEFT) | (TABFILL_ALL &~TABFILL_NONE)));
+        rPage.PageCreated(aSet);
     }
 }
 
diff --git a/sc/source/ui/src/textdlgs.src b/sc/source/ui/src/textdlgs.src
deleted file mode 100644
index 57caacf..0000000
--- a/sc/source/ui/src/textdlgs.src
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <svx/dialogs.hrc>
-#include "sc.hrc"
-
-TabDialog RID_SCDLG_PARAGRAPH
-{
-    OutputSize = TRUE ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( 289 , 176 ) ;
-    Text [ en-US ] = "Paragraph" ;
-    Moveable = TRUE ;
-    Closeable = TRUE ;
-    TabControl 1
-    {
-        OutputSize = TRUE ;
-        Pos = MAP_APPFONT ( 3 , 3 ) ;
-        Size = MAP_APPFONT ( 260 , 135 ) ;
-        PageList =
-        {
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_STD_PARAGRAPH ;
-                Text [ en-US ] = "Indents & Spacing" ;
-                PageResID = RID_SVXPAGE_STD_PARAGRAPH ;
-            };
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_ALIGN_PARAGRAPH ;
-                PageResID = 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 ] = "Tab" ;
-                PageResID = RID_SVXPAGE_TABULATOR ;
-            };
-        };
-    };
-    OKButton 1
-    {
-        Pos = MAP_APPFONT ( 6 , 151 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-    };
-    CancelButton 1
-    {
-        Pos = MAP_APPFONT ( 60 , 151 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-    };
-    HelpButton 1
-    {
-        Pos = MAP_APPFONT ( 114 , 151 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-    };
-    PushButton 1
-    {
-        Pos = MAP_APPFONT ( 169 , 151 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        Text [ en-US ] = "Back" ;
-        TabStop = TRUE ;
-    };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/uiconfig/scalc/ui/paradialog.ui b/sc/uiconfig/scalc/ui/paradialog.ui
new file mode 100644
index 0000000..e9c95d8
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/paradialog.ui
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.0 on Sat Jan  4 19:26:45 2014 -->
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="ParagraphDialog">
+    <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 & 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>


More information about the Libreoffice-commits mailing list