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

Caolán McNamara caolanm at redhat.com
Thu Nov 14 03:57:10 PST 2013


 sd/AllLangResTarget_sd.mk               |    1 
 sd/UIConfig_sdraw.mk                    |    1 
 sd/source/ui/dlg/morphdlg.cxx           |   33 ++---
 sd/source/ui/dlg/morphdlg.src           |   97 ----------------
 sd/source/ui/inc/morphdlg.hrc           |   29 ----
 sd/source/ui/inc/morphdlg.hxx           |   17 +-
 sd/uiconfig/sdraw/ui/crossfadedialog.ui |  191 ++++++++++++++++++++++++++++++++
 sw/source/core/doc/doctxm.cxx           |    6 -
 8 files changed, 215 insertions(+), 160 deletions(-)

New commits:
commit f7bb9d000b6f54298cc3d9678711b82eb2dcb337
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 14 11:44:02 2013 +0000

    convert cross-fade dialog to .ui
    
    Change-Id: I51f90299f0a2f9573dd8cfd1e6b875e7c76af125

diff --git a/sd/AllLangResTarget_sd.mk b/sd/AllLangResTarget_sd.mk
index 3e36039..88578a8 100644
--- a/sd/AllLangResTarget_sd.mk
+++ b/sd/AllLangResTarget_sd.mk
@@ -46,7 +46,6 @@ $(eval $(call gb_SrsTarget_add_files,sd/res,\
     sd/source/ui/dlg/dlgfield.src \
     sd/source/ui/dlg/dlgolbul.src \
     sd/source/ui/dlg/LayerDialog.src \
-    sd/source/ui/dlg/morphdlg.src \
     sd/source/ui/dlg/navigatr.src \
     sd/source/ui/dlg/PaneDockingWindow.src \
     sd/source/ui/dlg/RemoteDialog.src \
diff --git a/sd/UIConfig_sdraw.mk b/sd/UIConfig_sdraw.mk
index 51c9726..1f924e8 100644
--- a/sd/UIConfig_sdraw.mk
+++ b/sd/UIConfig_sdraw.mk
@@ -67,6 +67,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/sdraw,\
 
 $(eval $(call gb_UIConfig_add_uifiles,modules/sdraw,\
 	sd/uiconfig/sdraw/ui/breakdialog \
+	sd/uiconfig/sdraw/ui/crossfadedialog \
 	sd/uiconfig/sdraw/ui/dlgsnap \
 	sd/uiconfig/sdraw/ui/copydlg \
 	sd/uiconfig/sdraw/ui/drawchardialog \
diff --git a/sd/source/ui/dlg/morphdlg.cxx b/sd/source/ui/dlg/morphdlg.cxx
index 2b682bd..af95d59 100644
--- a/sd/source/ui/dlg/morphdlg.cxx
+++ b/sd/source/ui/dlg/morphdlg.cxx
@@ -23,7 +23,6 @@
 #include "sdresid.hxx"
 #include "sdmod.hxx"
 #include "sdiocmpt.hxx"
-#include "morphdlg.hrc"
 #include <svx/xfillit0.hxx>
 #include <svx/xlineit0.hxx>
 #include <svx/xenum.hxx>
@@ -33,18 +32,14 @@
 
 namespace sd {
 
-MorphDlg::MorphDlg( ::Window* pParent, const SdrObject* pObj1, const SdrObject* pObj2 ) :
-            ModalDialog     ( pParent, SdResId( DLG_MORPH ) ),
-            aGrpPreset      ( this, SdResId( GRP_PRESET ) ),
-            aFtSteps        ( this, SdResId( FT_STEPS ) ),
-            aMtfSteps       ( this, SdResId( MTF_STEPS ) ),
-            aCbxAttributes  ( this, SdResId( CBX_ATTRIBUTES ) ),
-            aCbxOrientation ( this, SdResId( CBX_ORIENTATION ) ),
-            aBtnOK          ( this, SdResId( BTN_OK ) ),
-            aBtnCancel      ( this, SdResId( BTN_CANCEL ) ),
-            aBtnHelp        ( this, SdResId( BTN_HELP ) )
+MorphDlg::MorphDlg( ::Window* pParent, const SdrObject* pObj1, const SdrObject* pObj2 )
+    : ModalDialog(pParent, "CrossFadeDialog",
+        "modules/sdraw/ui/crossfadedialog.ui")
 {
-    FreeResource();
+    get(m_pMtfSteps, "increments");
+    get(m_pCbxAttributes, "attributes");
+    get(m_pCbxOrientation, "orientation");
+
     LoadSettings();
 
     SfxItemPool*    pPool = (SfxItemPool*) pObj1->GetObjectItemPool();
@@ -62,7 +57,7 @@ MorphDlg::MorphDlg( ::Window* pParent, const SdrObject* pObj1, const SdrObject*
     if ( ( ( eLineStyle1 == XLINE_NONE ) || ( eLineStyle2 == XLINE_NONE ) ) &&
          ( ( eFillStyle1 != XFILL_SOLID ) || ( eFillStyle2 != XFILL_SOLID ) ) )
     {
-        aCbxAttributes.Disable();
+        m_pCbxAttributes->Disable();
     }
 }
 
@@ -89,9 +84,9 @@ void MorphDlg::LoadSettings()
         bOrient = bAttrib = sal_True;
     }
 
-    aMtfSteps.SetValue( nSteps );
-    aCbxOrientation.Check( bOrient );
-    aCbxAttributes.Check( bAttrib );
+    m_pMtfSteps->SetValue( nSteps );
+    m_pCbxOrientation->Check( bOrient );
+    m_pCbxAttributes->Check( bAttrib );
 }
 
 // -----------------------------------------------------------------------------
@@ -105,9 +100,9 @@ void MorphDlg::SaveSettings() const
     {
         SdIOCompat aCompat( *xOStm, STREAM_WRITE, 1 );
 
-        *xOStm << (sal_uInt16) aMtfSteps.GetValue()
-               << aCbxOrientation.IsChecked()
-               << aCbxAttributes.IsChecked();
+        *xOStm << (sal_uInt16) m_pMtfSteps->GetValue()
+               << m_pCbxOrientation->IsChecked()
+               << m_pCbxAttributes->IsChecked();
     }
 }
 
diff --git a/sd/source/ui/dlg/morphdlg.src b/sd/source/ui/dlg/morphdlg.src
deleted file mode 100644
index 975a7af..0000000
--- a/sd/source/ui/dlg/morphdlg.src
+++ /dev/null
@@ -1,97 +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 "app.hrc"
-#include "morphdlg.hrc"
-#include "helpids.h"
-
-ModalDialog DLG_MORPH
-{
-    HelpID = CMD_SID_POLYGON_MORPHING ;
-    HelpID = ".uno:Morphing" ;
-    OutputSize = TRUE ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( 196 , 68 ) ;
-    Moveable = TRUE ;
-    Closeable = TRUE ;
-    OKButton BTN_OK
-    {
-        Pos = MAP_APPFONT ( 141 , 6 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-        DefButton = TRUE ;
-    };
-    CancelButton BTN_CANCEL
-    {
-        Pos = MAP_APPFONT ( 141 , 23 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-    };
-    HelpButton BTN_HELP
-    {
-        Pos = MAP_APPFONT ( 140 , 43 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-    };
-    FixedLine GRP_PRESET
-    {
-        Pos = MAP_APPFONT ( 6 , 3 ) ;
-        Size = MAP_APPFONT ( 129 , 8 ) ;
-        Text [ en-US ] = "Settings" ;
-    };
-    FixedText FT_STEPS
-    {
-        Pos = MAP_APPFONT ( 12 , 16 ) ;
-        Size = MAP_APPFONT ( 40 , 10 ) ;
-        Text [ en-US ] = "Increments" ;
-    };
-    MetricField MTF_STEPS
-    {
-        HelpID = "sd:MetricField:DLG_MORPH:MTF_STEPS";
-        Border = TRUE ;
-        Pos = MAP_APPFONT ( 56 , 14 ) ;
-        Size = MAP_APPFONT ( 30 , 12 ) ;
-        TabStop = TRUE ;
-        Spin = TRUE ;
-        Repeat = TRUE ;
-        Minimum = 1 ;
-        Maximum = 256 ;
-        First = 1 ;
-        Last = 256 ;
-    };
-    CheckBox CBX_ATTRIBUTES
-    {
-        HelpID = "sd:CheckBox:DLG_MORPH:CBX_ATTRIBUTES";
-        Pos = MAP_APPFONT ( 12 , 29 ) ;
-        Size = MAP_APPFONT ( 121 , 12 ) ;
-        TabStop = TRUE ;
-        Text [ en-US ] = "Cross-fade attributes" ;
-    };
-    CheckBox CBX_ORIENTATION
-    {
-        HelpID = "sd:CheckBox:DLG_MORPH:CBX_ORIENTATION";
-        Pos = MAP_APPFONT ( 12 , 44 ) ;
-        Size = MAP_APPFONT ( 121 , 12 ) ;
-        TabStop = TRUE ;
-        Text [ en-US ] = "Same orientation" ;
-    };
-    Text [ en-US ] = "Cross-fading" ;
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/morphdlg.hrc b/sd/source/ui/inc/morphdlg.hrc
deleted file mode 100644
index 8a45398..0000000
--- a/sd/source/ui/inc/morphdlg.hrc
+++ /dev/null
@@ -1,29 +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 DLG_MORPH           653
-#define BTN_OK              1
-#define BTN_CANCEL          1
-#define BTN_HELP            1
-#define GRP_PRESET          1
-#define FT_STEPS            1
-#define MTF_STEPS           1
-#define CBX_ATTRIBUTES      1
-#define CBX_ORIENTATION     2
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/morphdlg.hxx b/sd/source/ui/inc/morphdlg.hxx
index a3ff874..1e639eb 100644
--- a/sd/source/ui/inc/morphdlg.hxx
+++ b/sd/source/ui/inc/morphdlg.hxx
@@ -41,19 +41,14 @@ public:
     virtual ~MorphDlg (void);
 
     void            SaveSettings() const;
-    sal_uInt16          GetFadeSteps() const { return (sal_uInt16) aMtfSteps.GetValue(); }
-    sal_Bool            IsAttributeFade() const { return aCbxAttributes.IsChecked(); }
-    sal_Bool            IsOrientationFade() const { return aCbxOrientation.IsChecked(); }
+    sal_uInt16      GetFadeSteps() const { return (sal_uInt16) m_pMtfSteps->GetValue(); }
+    bool            IsAttributeFade() const { return m_pCbxAttributes->IsChecked(); }
+    bool            IsOrientationFade() const { return m_pCbxOrientation->IsChecked(); }
 
 private:
-    FixedLine       aGrpPreset;
-    FixedText       aFtSteps;
-    MetricField     aMtfSteps;
-    CheckBox        aCbxAttributes;
-    CheckBox        aCbxOrientation;
-    OKButton        aBtnOK;
-    CancelButton    aBtnCancel;
-    HelpButton      aBtnHelp;
+    NumericField*   m_pMtfSteps;
+    CheckBox*       m_pCbxAttributes;
+    CheckBox*       m_pCbxOrientation;
 
     void            LoadSettings();
 };
diff --git a/sd/uiconfig/sdraw/ui/crossfadedialog.ui b/sd/uiconfig/sdraw/ui/crossfadedialog.ui
new file mode 100644
index 0000000..b8db60b
--- /dev/null
+++ b/sd/uiconfig/sdraw/ui/crossfadedialog.ui
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkAdjustment" id="adjustment1">
+    <property name="lower">1</property>
+    <property name="upper">256</property>
+    <property name="value">1</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkDialog" id="CrossFadeDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Cross-fading</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="margin_top">5</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>
+          <object class="GtkFrame" id="frame1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">none</property>
+            <child>
+              <object class="GtkAlignment" id="alignment1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="top_padding">6</property>
+                <property name="left_padding">12</property>
+                <child>
+                  <object class="GtkGrid" id="grid2">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="hexpand">True</property>
+                    <property name="vexpand">True</property>
+                    <property name="row_spacing">6</property>
+                    <property name="column_spacing">12</property>
+                    <child>
+                      <object class="GtkCheckButton" id="orientation">
+                        <property name="label" translatable="yes">Same orientation</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="use_underline">True</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">2</property>
+                        <property name="width">2</property>
+                        <property name="height">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="attributes">
+                        <property name="label" translatable="yes">Cross-fade attributes</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="use_underline">True</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">1</property>
+                        <property name="width">2</property>
+                        <property name="height">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="label2">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Increments</property>
+                        <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">increments</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">0</property>
+                        <property name="width">1</property>
+                        <property name="height">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkSpinButton" id="increments">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="invisible_char">•</property>
+                        <property name="adjustment">adjustment1</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="top_attach">0</property>
+                        <property name="width">1</property>
+                        <property name="height">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child type="label">
+              <object class="GtkLabel" id="label1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Settings</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
+              </object>
+            </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-widgets>
+  </object>
+</interface>
commit 4f08dcc0e68fa7da6778706b349a19de1c064531
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 14 11:49:26 2013 +0000

    longparas: safe STRING_NOTFOUND -> -1
    
    Change-Id: Ib60e1f052d15ca49e8cbba48b65a94d273a82170

diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index a9641dd..0d77608 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -1595,7 +1595,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
         OSL_ENSURE( nLvl < GetTOXForm().GetFormMax(), "invalid FORM_LEVEL");
 
         SvxTabStopItem aTStops( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP );
-        xub_StrLen nLinkStartPosition = STRING_NOTFOUND;
+        sal_Int32 nLinkStartPosition = -1;
         OUString  sLinkCharacterStyle; // default to "Default" character style - which is none
         OUString sURL;
         // create an enumerator
@@ -1781,7 +1781,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
 
             case TOKEN_LINK_END:
                     //TODO: only paired start/end tokens are valid
-                if( STRING_NOTFOUND != nLinkStartPosition)
+                if (nLinkStartPosition != -1)
                 {
                     SwIndex aIdx( pTOXNd, nLinkStartPosition );
                     // pTOXNd->Erase( aIdx, SwForm::nFormLinkSttLen );
@@ -1810,7 +1810,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
                         pNewLink->aINetFmt.SetINetFmtId(USHRT_MAX);
                     }
                     aLinkArr.push_back(pNewLink);
-                    nLinkStartPosition = STRING_NOTFOUND;
+                    nLinkStartPosition = -1;
                     sLinkCharacterStyle = "";
                 }
                 break;


More information about the Libreoffice-commits mailing list