[Libreoffice-commits] core.git: cui/AllLangResTarget_cui.mk cui/source cui/uiconfig cui/UIConfig_cui.mk include/svx

Caolán McNamara caolanm at redhat.com
Sun Jan 5 15:42:28 PST 2014


 cui/AllLangResTarget_cui.mk      |    1 
 cui/UIConfig_cui.mk              |    1 
 cui/source/inc/cuires.hrc        |    2 
 cui/source/inc/labdlg.hxx        |   18 ++--
 cui/source/tabpages/labdlg.cxx   |   82 +++++++++------------
 cui/source/tabpages/labdlg.hrc   |   26 ------
 cui/source/tabpages/labdlg.src   |   64 ----------------
 cui/uiconfig/ui/calloutdialog.ui |  148 +++++++++++++++++++++++++++++++++++++++
 include/svx/dialogs.hrc          |    2 
 9 files changed, 194 insertions(+), 150 deletions(-)

New commits:
commit be4035d00f37c492494fa7860955b6d0868c7f77
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 5 22:46:17 2014 +0000

    convert callout tabdialog to .ui
    
    Change-Id: If16ddb848eb0a46d0d5d91cb6366a6e268cd1b7a

diff --git a/cui/AllLangResTarget_cui.mk b/cui/AllLangResTarget_cui.mk
index 4db5d6d..804180e 100644
--- a/cui/AllLangResTarget_cui.mk
+++ b/cui/AllLangResTarget_cui.mk
@@ -59,7 +59,6 @@ $(eval $(call gb_SrsTarget_add_files,cui/res,\
     cui/source/tabpages/border.src \
     cui/source/tabpages/dstribut.src \
     cui/source/tabpages/frmdirlbox.src \
-    cui/source/tabpages/labdlg.src \
     cui/source/tabpages/macroass.src \
     cui/source/tabpages/page.src \
     cui/source/tabpages/paragrph.src \
diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk
index b5dfe0d..07a669d 100644
--- a/cui/UIConfig_cui.mk
+++ b/cui/UIConfig_cui.mk
@@ -27,6 +27,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
 	cui/uiconfig/ui/borderbackgrounddialog \
 	cui/uiconfig/ui/borderpage \
 	cui/uiconfig/ui/breaknumberoption \
+	cui/uiconfig/ui/calloutdialog \
 	cui/uiconfig/ui/calloutpage \
 	cui/uiconfig/ui/cellalignment \
 	cui/uiconfig/ui/charnamepage \
diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc
index 0c51510..f3580e6 100644
--- a/cui/source/inc/cuires.hrc
+++ b/cui/source/inc/cuires.hrc
@@ -40,8 +40,6 @@
 //      RID_CUI_GALLERY_END                 (RID_SVX_START + 410)
 
 // used in "tabpages"
-#define RID_SVXDLG_LINE                     (RID_SVX_START +  50)
-#define RID_SVXDLG_CAPTION                  (RID_SVX_START + 151)
 #define RID_SVXSTRARY_PAPERSIZE_STD         (RID_SVX_START + 142)
 #define RID_SVXSTRARY_PAPERSIZE_DRAW        (RID_SVX_START + 143)
 #define RID_SVXSTR_TABLE_PRESET_NONE        (RID_SVX_START + 969)
diff --git a/cui/source/inc/labdlg.hxx b/cui/source/inc/labdlg.hxx
index 2d049d6..1df123b 100644
--- a/cui/source/inc/labdlg.hxx
+++ b/cui/source/inc/labdlg.hxx
@@ -93,22 +93,22 @@ public:
 class SvxCaptionTabDialog : public SfxTabDialog
 {
 private:
-    const SdrView*      pView;
-    sal_uInt16              nAnchorCtrls;
+    const SdrView* pView;
+    sal_uInt16 nAnchorCtrls;
+    sal_uInt16 m_nSwPosSizePageId;
+    sal_uInt16 m_nPositionSizePageId;
+    sal_uInt16 m_nCaptionPageId;
 
     Link                aValidateLink;
 
     virtual void        PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
 
 public:
+    SvxCaptionTabDialog(Window* pParent, const SdrView* pView,
+                            sal_uInt16 nAnchorTypes = 0);
 
-            SvxCaptionTabDialog(Window* pParent, const SdrView* pView,
-                                    sal_uInt16 nAnchorTypes = 0 );
-
-            ~SvxCaptionTabDialog();
-
-            /// link for the Writer to validate positions
-            void SetValidateFramePosLink( const Link& rLink );
+    /// link for the Writer to validate positions
+    void SetValidateFramePosLink( const Link& rLink );
 };
 
 
diff --git a/cui/source/tabpages/labdlg.cxx b/cui/source/tabpages/labdlg.cxx
index 41bc3d7..1fd3866 100644
--- a/cui/source/tabpages/labdlg.cxx
+++ b/cui/source/tabpages/labdlg.cxx
@@ -34,7 +34,6 @@
 #include <svx/sxctitm.hxx>
 
 #include "svx/dlgutil.hxx"
-#include "labdlg.hrc"
 #include "labdlg.hxx"
 #include "transfrm.hxx"
 
@@ -508,65 +507,56 @@ void SvxCaptionTabPage::FillValueSet()
 //========================================================================
 
 
-SvxCaptionTabDialog::SvxCaptionTabDialog(Window* pParent, const SdrView* pSdrView, sal_uInt16 nAnchorTypes)
- :  SfxTabDialog( pParent, CUI_RES( RID_SVXDLG_CAPTION ) ),
-    pView       ( pSdrView ),
-    nAnchorCtrls(nAnchorTypes)
+SvxCaptionTabDialog::SvxCaptionTabDialog(Window* pParent, const SdrView* pSdrView,
+    sal_uInt16 nAnchorTypes)
+    : SfxTabDialog( pParent, "CalloutDialog", "cui/ui/calloutdialog.ui")
+    , pView(pSdrView)
+    , nAnchorCtrls(nAnchorTypes)
+    , m_nSwPosSizePageId(0)
+    , m_nPositionSizePageId(0)
+    , m_nCaptionPageId(0)
 {
-    FreeResource();
-
-    DBG_ASSERT( pView, "Keine gueltige View Uebergeben!" );
+    assert(pView); //Keine gueltige View Uebergeben!
 
     //different positioning page in Writer
-    if(nAnchorCtrls & 0x00ff )
+    if (nAnchorCtrls & 0x00ff)
     {
-        AddTabPage( RID_SVXPAGE_SWPOSSIZE, SvxSwPosSizeTabPage::Create,
-                                SvxSwPosSizeTabPage::GetRanges );
-        RemoveTabPage( RID_SVXPAGE_POSITION_SIZE);
+        m_nSwPosSizePageId = AddTabPage("RID_SVXPAGE_SWPOSSIZE", SvxSwPosSizeTabPage::Create,
+            SvxSwPosSizeTabPage::GetRanges );
+        RemoveTabPage("RID_SVXPAGE_POSITION_SIZE");
     }
     else
     {
-        AddTabPage( RID_SVXPAGE_POSITION_SIZE, SvxPositionSizeTabPage::Create,
-                                SvxPositionSizeTabPage::GetRanges );
-        RemoveTabPage( RID_SVXPAGE_SWPOSSIZE );
+        m_nPositionSizePageId = AddTabPage("RID_SVXPAGE_POSITION_SIZE", SvxPositionSizeTabPage::Create,
+            SvxPositionSizeTabPage::GetRanges );
+        RemoveTabPage("RID_SVXPAGE_SWPOSSIZE");
     }
-    AddTabPage( RID_SVXPAGE_CAPTION, SvxCaptionTabPage::Create,
-                            SvxCaptionTabPage::GetRanges );
+    m_nCaptionPageId = AddTabPage("RID_SVXPAGE_CAPTION", SvxCaptionTabPage::Create,
+        SvxCaptionTabPage::GetRanges );
 }
 
-// -----------------------------------------------------------------------
-
-SvxCaptionTabDialog::~SvxCaptionTabDialog()
-{
-}
-
-// -----------------------------------------------------------------------
-
 void SvxCaptionTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
 {
-    switch( nId )
+    if (nId == m_nPositionSizePageId)
     {
-        case RID_SVXPAGE_POSITION_SIZE:
-            ( (SvxPositionSizeTabPage&) rPage ).SetView( pView );
-            ( (SvxPositionSizeTabPage&) rPage ).Construct();
-            if( nAnchorCtrls & SVX_OBJ_NORESIZE )
-                ( (SvxPositionSizeTabPage&) rPage ).DisableResize();
-
-            if( nAnchorCtrls & SVX_OBJ_NOPROTECT )
-                ( (SvxPositionSizeTabPage&) rPage ).DisableProtect();
-        break;
-        case RID_SVXPAGE_SWPOSSIZE :
-        {
-            SvxSwPosSizeTabPage& rSwPage = static_cast<SvxSwPosSizeTabPage&>(rPage);
-            rSwPage.EnableAnchorTypes(nAnchorCtrls);
-            rSwPage.SetValidateFramePosLink( aValidateLink );
-        }
-        break;
+        ( (SvxPositionSizeTabPage&) rPage ).SetView( pView );
+        ( (SvxPositionSizeTabPage&) rPage ).Construct();
+        if( nAnchorCtrls & SVX_OBJ_NORESIZE )
+            ( (SvxPositionSizeTabPage&) rPage ).DisableResize();
 
-        case RID_SVXPAGE_CAPTION:
-            ( (SvxCaptionTabPage&) rPage ).SetView( pView );
-            ( (SvxCaptionTabPage&) rPage ).Construct();
-        break;
+        if( nAnchorCtrls & SVX_OBJ_NOPROTECT )
+            ( (SvxPositionSizeTabPage&) rPage ).DisableProtect();
+    }
+    else if (nId == m_nSwPosSizePageId)
+    {
+        SvxSwPosSizeTabPage& rSwPage = static_cast<SvxSwPosSizeTabPage&>(rPage);
+        rSwPage.EnableAnchorTypes(nAnchorCtrls);
+        rSwPage.SetValidateFramePosLink( aValidateLink );
+    }
+    else if (nId == m_nCaptionPageId)
+    {
+        ( (SvxCaptionTabPage&) rPage ).SetView( pView );
+        ( (SvxCaptionTabPage&) rPage ).Construct();
     }
 }
 
diff --git a/cui/source/tabpages/labdlg.hrc b/cui/source/tabpages/labdlg.hrc
deleted file mode 100644
index 2cc565e..0000000
--- a/cui/source/tabpages/labdlg.hrc
+++ /dev/null
@@ -1,26 +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 <cuires.hrc>
-
-#define TAB_CONTROL             1
-#define BTN_OK                  1
-#define BTN_CANCEL              1
-#define BTN_HELP                1
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/tabpages/labdlg.src b/cui/source/tabpages/labdlg.src
deleted file mode 100644
index f105ae7..0000000
--- a/cui/source/tabpages/labdlg.src
+++ /dev/null
@@ -1,64 +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 "helpid.hrc"
-#include "labdlg.hrc"
-#include <svx/dialogs.hrc>
-
-#define  _POS_SIZE_TEXT \
-                Text [ en-US ] = "Position and Size" ;             \
-
-TabDialog RID_SVXDLG_CAPTION
-{
-    OutputSize = TRUE ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( 237 , 161 ) ;
-    Text [ en-US ] = "Callouts" ;\
-    Moveable = TRUE ;
-    TabControl TAB_CONTROL\
-    {
-        OutputSize = TRUE ;
-        Pos = MAP_APPFONT ( 3 , 3 ) ;
-        Size = MAP_APPFONT ( 189 , 97 ) ;
-        PageList =
-        {
-            PageItem\
-            {
-                Identifier = RID_SVXPAGE_POSITION_SIZE ;
-                PageResID = RID_SVXPAGE_POSITION_SIZE ;
-                _POS_SIZE_TEXT
-            };
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_SWPOSSIZE;
-                PageResID = RID_SVXPAGE_SWPOSSIZE;
-                _POS_SIZE_TEXT
-            };
-            PageItem
-            {
-                Identifier = RID_SVXPAGE_CAPTION ;
-                PageResID = RID_SVXPAGE_CAPTION ;
-                Text [ en-US ] = "Callout" ;
-            };
-        };
-    };
-};
- // ********************************************************************** EOF
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/uiconfig/ui/calloutdialog.ui b/cui/uiconfig/ui/calloutdialog.ui
new file mode 100644
index 0000000..a48a49a
--- /dev/null
+++ b/cui/uiconfig/ui/calloutdialog.ui
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.0 on Sun Jan  5 22:45:32 2014 -->
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="CalloutDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Position and size</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="RID_SVXPAGE_POSITION_SIZE">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Position and Size</property>
+              </object>
+              <packing>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="RID_SVXPAGE_SWPOSSIZE">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Position and Size</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="RID_SVXPAGE_CAPTION">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Callout</property>
+              </object>
+              <packing>
+                <property name="position">2</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>
diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc
index a422d2d..a48c0f3 100644
--- a/include/svx/dialogs.hrc
+++ b/include/svx/dialogs.hrc
@@ -82,8 +82,6 @@
 #define RID_SVXPAGE_PICK_BULLET             (RID_SVX_START + 216)
 #define RID_SVXPAGE_PICK_NUM                (RID_SVX_START + 217)
 #define RID_SVXPAGE_PICK_BMP                (RID_SVX_START + 218)
-#define RID_SVXPAGE_CAPTION                 (RID_SVX_START + 150)
-#define RID_SVXPAGE_SWPOSSIZE               (RID_SVX_START + 288)
 #define RID_SVXPAGE_POSITION_SIZE           (RID_SVX_START +  87)
 #define RID_SVXPAGE_EVENTASSIGN             (RID_SVX_START + 303)
 #define RID_SVXPAGE_HATCH                   (RID_SVX_START +  57)


More information about the Libreoffice-commits mailing list