[Libreoffice-commits] core.git: 2 commits - sd/AllLangResTarget_sd.mk sd/source sd/uiconfig sd/UIConfig_simpress.mk vcl/source

Caolán McNamara caolanm at redhat.com
Wed May 22 01:27:05 PDT 2013


 sd/AllLangResTarget_sd.mk                  |    1 
 sd/UIConfig_simpress.mk                    |    1 
 sd/source/ui/dlg/masterlayoutdlg.cxx       |   69 +++++++------------
 sd/source/ui/dlg/masterlayoutdlg.src       |  105 -----------------------------
 sd/source/ui/inc/dialogs.hrc               |    1 
 sd/source/ui/inc/masterlayoutdlg.hrc       |   30 --------
 sd/source/ui/inc/masterlayoutdlg.hxx       |   22 ++----
 sd/uiconfig/simpress/ui/masterlayoutdlg.ui |   46 ++++++++----
 vcl/source/glyphs/graphite_layout.cxx      |    2 
 9 files changed, 67 insertions(+), 210 deletions(-)

New commits:
commit 6a0a33444255fcdbe16500de24fc5bfd74adca4b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed May 22 09:26:32 2013 +0100

    WaE: signed/unsigned comparison
    
    Change-Id: Iaa439c268eda24d700471560927d8f4c0f2e017b

diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx
index 72e48c9..3898ab1 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -589,7 +589,7 @@ gr_segment * GraphiteLayout::CreateSegment(ImplLayoutArgs& rArgs)
                     nSegCharLimit - rArgs.mnEndCharPos, bRtl);
             }
         }
-        size_t numchars = gr_count_unicode_characters(gr_utf16, rArgs.mpStr + mnSegCharOffset,
+        int numchars = gr_count_unicode_characters(gr_utf16, rArgs.mpStr + mnSegCharOffset,
                 rArgs.mpStr + (rArgs.mnLength > limit + 64 ? limit + 64 : rArgs.mnLength), NULL);
         if (rArgs.mnMinCharPos + numchars > limit) numchars = limit - rArgs.mnMinCharPos; // fdo#52540
         if (mpFeatures)
commit 38b7f28268fc48e2761f963ffc7652ebdf2a8e9b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue May 21 20:50:44 2013 +0100

    adapt code to use masterlayoutdlg .ui
    
    Change-Id: I4fd8530d461701c736beaf15ca6cf66dfdf58f86

diff --git a/sd/AllLangResTarget_sd.mk b/sd/AllLangResTarget_sd.mk
index 5f25e41..0e59384 100644
--- a/sd/AllLangResTarget_sd.mk
+++ b/sd/AllLangResTarget_sd.mk
@@ -55,7 +55,6 @@ $(eval $(call gb_SrsTarget_add_files,sd/res,\
     sd/source/ui/dlg/inspagob.src \
     sd/source/ui/dlg/ins_paste.src \
     sd/source/ui/dlg/LayerDialog.src \
-    sd/source/ui/dlg/masterlayoutdlg.src \
     sd/source/ui/dlg/morphdlg.src \
     sd/source/ui/dlg/navigatr.src \
     sd/source/ui/dlg/PaneDockingWindow.src \
diff --git a/sd/UIConfig_simpress.mk b/sd/UIConfig_simpress.mk
index f5d088f..8234765 100644
--- a/sd/UIConfig_simpress.mk
+++ b/sd/UIConfig_simpress.mk
@@ -71,6 +71,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/simpress,\
 
 $(eval $(call gb_UIConfig_add_uifiles,modules/simpress,\
 	sd/uiconfig/simpress/ui/definecustomslideshow \
+	sd/uiconfig/simpress/ui/masterlayoutdlg \
 	sd/uiconfig/simpress/ui/presentationdialog \
 	sd/uiconfig/simpress/ui/printeroptions \
 	sd/uiconfig/simpress/ui/photoalbum \
diff --git a/sd/source/ui/dlg/masterlayoutdlg.cxx b/sd/source/ui/dlg/masterlayoutdlg.cxx
index b0fd86f..e080822 100644
--- a/sd/source/ui/dlg/masterlayoutdlg.cxx
+++ b/sd/source/ui/dlg/masterlayoutdlg.cxx
@@ -24,23 +24,21 @@
 #include "strings.hrc"
 #include "dialogs.hrc"
 #include "masterlayoutdlg.hxx"
-#include "masterlayoutdlg.hrc"
 #include "drawdoc.hxx"
 
 using namespace ::sd;
 
 MasterLayoutDialog::MasterLayoutDialog( Window* pParent, SdDrawDocument* pDoc, SdPage* pCurrentPage )
-:   ModalDialog( pParent, SdResId( RID_SD_DLG_MASTER_LAYOUT ) ),
-    mpDoc( pDoc ),
-    mpCurrentPage( pCurrentPage ),
-    maFLPlaceholders( this, SdResId( FL_PLACEHOLDERS ) ),
-    maCBDate( this, SdResId( CB_DATE ) ),
-    maCBPageNumber( this, SdResId( CB_PAGE_NUMBER ) ),
-    maCBHeader( this, SdResId( CB_HEADER ) ),
-    maCBFooter( this, SdResId( CB_FOOTER ) ),
-    maPBOK( this, SdResId( BT_OK ) ),
-    maPBCancel( this, SdResId( BT_CANCEL ) )
+    : ModalDialog(pParent, "MasterLayoutDialog", "modules/simpress/ui/masterlayoutdlg.ui")
+    , mpDoc(pDoc)
+    , mpCurrentPage(pCurrentPage)
 {
+    get(mpCBDate, "datetime");
+    get(mpCBPageNumber, "pagenumber");
+    get(mpCBSlideNumber, "slidenumber");
+    get(mpCBHeader, "header");
+    get(mpCBFooter, "footer");
+
     if( mpCurrentPage && !mpCurrentPage->IsMasterPage() )
     {
         mpCurrentPage = (SdPage*)(&(mpCurrentPage->TRG_GetMasterPage()));
@@ -54,40 +52,27 @@ MasterLayoutDialog::MasterLayoutDialog( Window* pParent, SdDrawDocument* pDoc, S
 
     switch( mpCurrentPage->GetPageKind() )
     {
-    case PK_STANDARD:
-    {
-        //      aTitle = String( SdResId( STR_MASTER_LAYOUT_TITLE ) );
-        maCBHeader.Enable( sal_False );
-    String aSlideNumberStr( SdResId( STR_SLIDE_NUMBER ) );
-        maCBPageNumber.SetText( aSlideNumberStr );
-        break;
+        case PK_STANDARD:
+        {
+            mpCBHeader->Enable(false);
+            mpCBPageNumber->SetText(mpCBSlideNumber->GetText());
+            break;
+        }
+        case PK_NOTES:
+            break;
+        case PK_HANDOUT:
+            break;
     }
-    case PK_NOTES:
-        //      aTitle = String( SdResId( STR_NOTES_MASTER_LAYOUT_TITLE ) );
-        break;
-    case PK_HANDOUT:
-        //      aTitle = String( SdResId( STR_HANDOUT_TEMPLATE_LAYOUT_TITLE ) );
-        break;
-    }
-    String aTitle (SdResId( STR_MASTER_LAYOUT_TITLE ) );
-
-    SetText( aTitle );
-
-    FreeResource();
 
     mbOldHeader = mpCurrentPage->GetPresObj( PRESOBJ_HEADER ) != NULL;
     mbOldDate = mpCurrentPage->GetPresObj( PRESOBJ_DATETIME ) != NULL;
     mbOldFooter = mpCurrentPage->GetPresObj( PRESOBJ_FOOTER ) != NULL;
     mbOldPageNumber = mpCurrentPage->GetPresObj( PRESOBJ_SLIDENUMBER ) != NULL;
 
-    maCBHeader.Check( mbOldHeader );
-    maCBDate.Check( mbOldDate );
-    maCBFooter.Check( mbOldFooter );
-    maCBPageNumber.Check( mbOldPageNumber );
-}
-
-MasterLayoutDialog::~MasterLayoutDialog()
-{
+    mpCBHeader->Check( mbOldHeader );
+    mpCBDate->Check( mbOldDate );
+    mpCBFooter->Check( mbOldFooter );
+    mpCBPageNumber->Check( mbOldPageNumber );
 }
 
 short MasterLayoutDialog::Execute()
@@ -101,7 +86,7 @@ void MasterLayoutDialog::applyChanges()
 {
     mpDoc->BegUndo(GetText());
 
-    if( (mpCurrentPage->GetPageKind() != PK_STANDARD) && (mbOldHeader != maCBHeader.IsChecked() ) )
+    if( (mpCurrentPage->GetPageKind() != PK_STANDARD) && (mbOldHeader != mpCBHeader->IsChecked() ) )
     {
         if( mbOldHeader )
             remove( PRESOBJ_HEADER );
@@ -109,7 +94,7 @@ void MasterLayoutDialog::applyChanges()
             create( PRESOBJ_HEADER );
     }
 
-    if( mbOldFooter != maCBFooter.IsChecked() )
+    if( mbOldFooter != mpCBFooter->IsChecked() )
     {
         if( mbOldFooter )
             remove( PRESOBJ_FOOTER );
@@ -117,7 +102,7 @@ void MasterLayoutDialog::applyChanges()
             create( PRESOBJ_FOOTER );
     }
 
-    if( mbOldDate != maCBDate.IsChecked() )
+    if( mbOldDate != mpCBDate->IsChecked() )
     {
         if( mbOldDate )
             remove( PRESOBJ_DATETIME );
@@ -125,7 +110,7 @@ void MasterLayoutDialog::applyChanges()
             create( PRESOBJ_DATETIME );
     }
 
-    if( mbOldPageNumber != maCBPageNumber.IsChecked() )
+    if( mbOldPageNumber != mpCBPageNumber->IsChecked() )
     {
         if( mbOldPageNumber )
             remove( PRESOBJ_SLIDENUMBER );
diff --git a/sd/source/ui/dlg/masterlayoutdlg.src b/sd/source/ui/dlg/masterlayoutdlg.src
deleted file mode 100644
index 18e520c..0000000
--- a/sd/source/ui/dlg/masterlayoutdlg.src
+++ /dev/null
@@ -1,105 +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 <dialogs.hrc>
-#include <masterlayoutdlg.hrc>
-#include <strings.hrc>
-
-ModalDialog RID_SD_DLG_MASTER_LAYOUT
-{
-    HelpID = "sd:ModalDialog:RID_SD_DLG_MASTER_LAYOUT";
-    Size = MAP_APPFONT( 89 , 92 );
-    OutputSize = TRUE;
-    SVLook   = TRUE;
-    Moveable = TRUE;
-    CloseAble = TRUE;
-    FixedLine FL_PLACEHOLDERS
-    {
-        Pos = MAP_APPFONT( 3, 3 );
-        Size = MAP_APPFONT( 83, 10 );
-
-        Text [ en-US ] = "Placeholders";
-    };
-
-    CheckBox CB_HEADER
-    {
-        HelpID = "sd:CheckBox:RID_SD_DLG_MASTER_LAYOUT:CB_HEADER";
-        Pos = MAP_APPFONT( 6, 16 );
-        Size = MAP_APPFONT( 134 , 10 );
-        TabStop = TRUE;
-
-        Text [ en-US ] = "Header";
-    };
-
-    CheckBox CB_DATE
-    {
-        HelpID = "sd:CheckBox:RID_SD_DLG_MASTER_LAYOUT:CB_DATE";
-        Pos = MAP_APPFONT( 6, 29 );
-        Size = MAP_APPFONT( 134 , 10 );
-        TabStop = TRUE;
-
-        Text [ en-US ] = "Date/time";
-    };
-
-    CheckBox CB_FOOTER
-    {
-        HelpID = "sd:CheckBox:RID_SD_DLG_MASTER_LAYOUT:CB_FOOTER";
-        Pos = MAP_APPFONT( 6, 42 );
-        Size = MAP_APPFONT( 134 , 10 );
-        TabStop = TRUE;
-
-        Text [ en-US ] = "Footer";
-    };
-
-    CheckBox CB_PAGE_NUMBER
-    {
-        HelpID = "sd:CheckBox:RID_SD_DLG_MASTER_LAYOUT:CB_PAGE_NUMBER";
-        Pos = MAP_APPFONT( 6, 55 );
-        Size = MAP_APPFONT( 134 , 10 );
-        TabStop = TRUE;
-
-        Text [ en-US ] = "Page number";
-    };
-
-    OKButton BT_OK
-    {
-        Pos = MAP_APPFONT( 3, 71 );
-        Size = MAP_APPFONT( 40 , 14 );
-        TabStop = TRUE;
-    };
-
-    CancelButton BT_CANCEL
-    {
-        Pos = MAP_APPFONT( 46, 71 );
-        Size = MAP_APPFONT( 40 , 14 );
-        TabStop = TRUE;
-    };
-
-    String STR_SLIDE_NUMBER
-    {
-        Text [ en-US ] = "Slide number";
-    };
-
-    String STR_MASTER_LAYOUT_TITLE
-    {
-        Text [ en-US ] = "Master Elements";
-    };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/dialogs.hrc b/sd/source/ui/inc/dialogs.hrc
index 61dfa76..b19b8e0 100644
--- a/sd/source/ui/inc/dialogs.hrc
+++ b/sd/source/ui/inc/dialogs.hrc
@@ -19,7 +19,6 @@
 
 /** module unique resource ids for dialogs */
 #define RID_SD_DLG_HEADERFOOTER                     (1000)
-#define RID_SD_DLG_MASTER_LAYOUT                    (1001)
 
 /** module unique resource ids for tabpages */
 #define RID_SD_TABPAGE_HEADERFOOTER                 (1000)
diff --git a/sd/source/ui/inc/masterlayoutdlg.hrc b/sd/source/ui/inc/masterlayoutdlg.hrc
deleted file mode 100644
index 0f66335..0000000
--- a/sd/source/ui/inc/masterlayoutdlg.hrc
+++ /dev/null
@@ -1,30 +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 .
- */
-
-#define FL_PLACEHOLDERS     1
-#define CB_DATE             2
-#define CB_PAGE_NUMBER      3
-#define CB_HEADER           4
-#define CB_FOOTER           5
-#define BT_OK               6
-#define BT_CANCEL           7
-#define STR_SLIDE_NUMBER        8
-#define STR_MASTER_LAYOUT_TITLE 9
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/masterlayoutdlg.hxx b/sd/source/ui/inc/masterlayoutdlg.hxx
index 95cf77b..037caac 100644
--- a/sd/source/ui/inc/masterlayoutdlg.hxx
+++ b/sd/source/ui/inc/masterlayoutdlg.hxx
@@ -37,19 +37,16 @@ private:
     SdDrawDocument* mpDoc;
     SdPage*         mpCurrentPage;
 
-    FixedLine       maFLPlaceholders;
-    CheckBox        maCBDate;
-    CheckBox        maCBPageNumber;
-    CheckBox        maCBHeader;
-    CheckBox        maCBFooter;
+    CheckBox*       mpCBDate;
+    CheckBox*       mpCBPageNumber;
+    CheckBox*       mpCBSlideNumber;
+    CheckBox*       mpCBHeader;
+    CheckBox*       mpCBFooter;
 
-    OKButton        maPBOK;
-    CancelButton    maPBCancel;
-
-    sal_Bool            mbOldHeader;
-    sal_Bool            mbOldFooter;
-    sal_Bool            mbOldDate;
-    sal_Bool            mbOldPageNumber;
+    bool            mbOldHeader;
+    bool            mbOldFooter;
+    bool            mbOldDate;
+    bool            mbOldPageNumber;
 
     void applyChanges();
     void remove( PresObjKind eKind );
@@ -57,7 +54,6 @@ private:
 
 public:
     MasterLayoutDialog( Window* pParent, SdDrawDocument* pDoc, SdPage* pCurrentPage );
-    ~MasterLayoutDialog();
 
     virtual short Execute();
 };
diff --git a/sd/uiconfig/simpress/ui/masterlayoutdlg.ui b/sd/uiconfig/simpress/ui/masterlayoutdlg.ui
index d7d5f10..40d391d 100644
--- a/sd/uiconfig/simpress/ui/masterlayoutdlg.ui
+++ b/sd/uiconfig/simpress/ui/masterlayoutdlg.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
-  <object class="GtkDialog" id="MasterElementsDialog">
+  <object class="GtkDialog" id="MasterLayoutDialog">
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
     <property name="title" translatable="yes">Master Elements</property>
@@ -10,19 +10,19 @@
       <object class="GtkBox" id="dialog-vbox1">
         <property name="can_focus">False</property>
         <property name="orientation">vertical</property>
-        <property name="spacing">2</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">spread</property>
+            <property name="layout_style">end</property>
             <child>
-              <object class="GtkButton" id="ok1">
+              <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_action_appearance">False</property>
                 <property name="use_stock">True</property>
               </object>
               <packing>
@@ -32,12 +32,11 @@
               </packing>
             </child>
             <child>
-              <object class="GtkButton" id="cancel1">
+              <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_action_appearance">False</property>
                 <property name="use_stock">True</property>
               </object>
               <packing>
@@ -71,13 +70,13 @@
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="orientation">vertical</property>
+                    <property name="spacing">6</property>
                     <child>
-                      <object class="GtkCheckButton" id="checkbutton1">
+                      <object class="GtkCheckButton" id="header">
                         <property name="label" translatable="yes">_Header</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">False</property>
-                        <property name="use_action_appearance">False</property>
                         <property name="use_underline">True</property>
                         <property name="xalign">0</property>
                         <property name="draw_indicator">True</property>
@@ -89,12 +88,11 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkCheckButton" id="checkbutton2">
+                      <object class="GtkCheckButton" id="datetime">
                         <property name="label" translatable="yes">_Date/time</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">False</property>
-                        <property name="use_action_appearance">False</property>
                         <property name="use_underline">True</property>
                         <property name="xalign">0</property>
                         <property name="draw_indicator">True</property>
@@ -106,12 +104,11 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkCheckButton" id="checkbutton3">
+                      <object class="GtkCheckButton" id="footer">
                         <property name="label" translatable="yes">_Footer</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">False</property>
-                        <property name="use_action_appearance">False</property>
                         <property name="use_underline">True</property>
                         <property name="xalign">0</property>
                         <property name="draw_indicator">True</property>
@@ -123,12 +120,11 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkCheckButton" id="checkbutton4">
+                      <object class="GtkCheckButton" id="pagenumber">
                         <property name="label" translatable="yes">_Page number</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">False</property>
-                        <property name="use_action_appearance">False</property>
                         <property name="use_underline">True</property>
                         <property name="xalign">0</property>
                         <property name="draw_indicator">True</property>
@@ -139,6 +135,22 @@
                         <property name="position">3</property>
                       </packing>
                     </child>
+                    <child>
+                      <object class="GtkCheckButton" id="slidenumber">
+                        <property name="label" translatable="yes">_Slide number</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="no_show_all">True</property>
+                        <property name="use_underline">True</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">4</property>
+                      </packing>
+                    </child>
                   </object>
                 </child>
               </object>
@@ -166,8 +178,8 @@
       </object>
     </child>
     <action-widgets>
-      <action-widget response="0">ok1</action-widget>
-      <action-widget response="0">cancel1</action-widget>
+      <action-widget response="0">ok</action-widget>
+      <action-widget response="0">cancel</action-widget>
     </action-widgets>
   </object>
 </interface>


More information about the Libreoffice-commits mailing list