svx/source/gallery2/galmisc.cxx         |   20 ++++++-
 sw/UIConfig_swriter.mk                  |    1 
 sw/source/ui/config/optload.cxx         |   11 +---
 sw/source/ui/inc/optload.hxx            |    5 -
 sw/uiconfig/swriter/ui/captiondialog.ui |   81 ++++++++++++++++++++++++++++++++
 5 files changed, 104 insertions(+), 14 deletions(-)

New commits:
commit 2e4360815b08e1b5bd7233509d033b5a49b7c61e
Author: Caolán McNamara <caol...@redhat.com>
Date:   Tue Dec 17 10:21:49 2013 +0000

    fix caption dialog
    
    Change-Id: I499f47b116ff6957bbbc20b91224fe95593d1da1

diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index 441cc43..2787065 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -74,6 +74,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
        sw/uiconfig/swriter/ui/bulletsandnumbering \
        sw/uiconfig/swriter/ui/businessdatapage \
        sw/uiconfig/swriter/ui/cannotsavelabeldialog \
+       sw/uiconfig/swriter/ui/captiondialog \
        sw/uiconfig/swriter/ui/captionoptions \
        sw/uiconfig/swriter/ui/cardformatpage \
        sw/uiconfig/swriter/ui/cardmediumpage \
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index 8196d48..3eef208 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -312,15 +312,12 @@ IMPL_LINK_NOARG(SwLoadOptPage, MetricHdl)
     return 0;
 }
 
-SwCaptionOptDlg::SwCaptionOptDlg(Window* pParent, const SfxItemSet& rSet) :
-    SfxNoLayoutSingleTabDialog(pParent, rSet, 0)
+SwCaptionOptDlg::SwCaptionOptDlg(Window* pParent, const SfxItemSet& rSet)
+    : SfxSingleTabDialog(pParent, rSet, "CaptionDialog",
+        "modules/swriter/ui/captiondialog.ui")
 {
     // create TabPage
-    SetTabPage((SwCaptionOptPage*) SwCaptionOptPage::Create(this, rSet));
-}
-
-SwCaptionOptDlg::~SwCaptionOptDlg()
-{
+    setTabPage(SwCaptionOptPage::Create(get_content_area(), rSet));
 }
 
 SwCaptionPreview::SwCaptionPreview( Window* pParent, WinBits nStyle )
diff --git a/sw/source/ui/inc/optload.hxx b/sw/source/ui/inc/optload.hxx
index 7825ab5..0ee5023 100644
--- a/sw/source/ui/inc/optload.hxx
+++ b/sw/source/ui/inc/optload.hxx
@@ -69,11 +69,10 @@ public:
     virtual void        Reset( const SfxItemSet& rSet );
 };
 
-class SwCaptionOptDlg : public SfxNoLayoutSingleTabDialog
+class SwCaptionOptDlg : public SfxSingleTabDialog
 {
 public:
-     SwCaptionOptDlg(Window* pParent, const SfxItemSet& rSet);
-    ~SwCaptionOptDlg();
+    SwCaptionOptDlg(Window* pParent, const SfxItemSet& rSet);
 };
 
 class CaptionComboBox : public SwComboBox
diff --git a/sw/uiconfig/swriter/ui/captiondialog.ui 
b/sw/uiconfig/swriter/ui/captiondialog.ui
new file mode 100644
index 0000000..0b6e2d2
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/captiondialog.ui
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="CaptionDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Caption</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>
+          </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>
+          <placeholder/>
+        </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 c2f0845931b7cb1007d54173c2633c44123a137c
Author: Caolán McNamara <caol...@redhat.com>
Date:   Tue Dec 17 10:23:30 2013 +0000

    avoid negative offsets to OUString::copy
    
    Change-Id: I0a62f8a38694a4a7662fe376aaabc35dca817d33

diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx
index b1214d5..fca950f 100644
--- a/svx/source/gallery2/galmisc.cxx
+++ b/svx/source/gallery2/galmisc.cxx
@@ -199,10 +199,22 @@ OUString GetReducedString( const INetURLObject& rURL, 
sal_Int32 nMaxLen )
 
         if( aPath.getLength() > nMaxLen )
         {
-            aReduced = aPath.copy( 0, nMaxLen - aName.getLength() - 4 );
-            aReduced += "...";
-            aReduced += OUString(aDelimiter);
-            aReduced += aName;
+            sal_Int32 nPathPrefixLen = nMaxLen - aName.getLength() - 4;
+
+            if (nPathPrefixLen >= 0)
+            {
+                aReduced = aPath.copy(0, nPathPrefixLen);
+                aReduced += "...";
+                aReduced += OUString(aDelimiter);
+                aReduced += aName;
+            }
+            else
+            {
+                aReduced += "...";
+                aReduced += OUString(aDelimiter);
+                aReduced += "...";
+                aReduced += aName.copy( aName.getLength() - (nMaxLen - 7) );
+            }
         }
         else
             aReduced = aPath;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to