[Libreoffice-commits] core.git: 3 commits - sc/uiconfig sfx2/uiconfig uui/source

Thomas Arnhold thomas at arnhold.org
Sun Aug 17 16:45:45 PDT 2014


 sc/uiconfig/scalc/ui/pivottablelayoutdialog.ui |    1 
 sfx2/uiconfig/ui/versionsofdialog.ui           |    3 +-
 uui/source/iahndl.cxx                          |   33 ++++---------------------
 3 files changed, 9 insertions(+), 28 deletions(-)

New commits:
commit fbb3617a9bfb0742990a3711d5e0d3fa5adf3962
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Mon Aug 18 01:38:24 2014 +0200

    iahndl: do lazy replacement
    
    There's no need for such a bloat method to replace just two vars.
    
    Change-Id: I235d092b89160c2599a41e1046a15475b8ba433c

diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index 1ec2344..ffe9bc8 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -249,33 +249,12 @@ UUIInteractionHelper::replaceMessageWithArguments(
     std::vector< OUString > const & rArguments )
 {
     OUString aMessage = _aMessage;
-    for (sal_Int32 i = 0;;)
-    {
-        i = aMessage.indexOf("$(ARG", i);
-        if (i == -1)
-            break;
-        if (aMessage.getLength() - i >= RTL_CONSTASCII_LENGTH("$(ARGx)")
-            && aMessage[i + RTL_CONSTASCII_LENGTH("$(ARGx")] == ')')
-        {
-            sal_Unicode c = aMessage[i + RTL_CONSTASCII_LENGTH("$(ARG")];
-            if (c >= '1' && c <= '2')
-            {
-                std::vector< OUString >::size_type nIndex
-                    = static_cast< std::vector< OUString >::size_type >(
-                        c - '1');
-                if (nIndex < rArguments.size())
-                {
-                    aMessage
-                        = aMessage.replaceAt(i,
-                                             RTL_CONSTASCII_LENGTH("$(ARGx)"),
-                                             rArguments[nIndex]);
-                    i += rArguments[nIndex].getLength();
-                    continue;
-                }
-            }
-        }
-        ++i;
-    }
+
+    SAL_WARN_IF(rArguments.size() == 0, "uui", "replaceMessageWithArguments: No arguments passed!");
+    if (rArguments.size() > 0)
+        aMessage = aMessage.replaceAll("$(ARG1)", rArguments[0]);
+    if (rArguments.size() > 1)
+        aMessage = aMessage.replaceAll("$(ARG2)", rArguments[1]);
 
     return aMessage;
 }
commit dc053144e63264d144f15409bf5ed6d6cb7420c9
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Mon Aug 18 00:57:42 2014 +0200

    pivottablelayoutdialog: define default button
    
    Change-Id: Ica4bc2a52e7351899a5741086c6db299caa5ed16

diff --git a/sc/uiconfig/scalc/ui/pivottablelayoutdialog.ui b/sc/uiconfig/scalc/ui/pivottablelayoutdialog.ui
index fd65936..05d54cd 100644
--- a/sc/uiconfig/scalc/ui/pivottablelayoutdialog.ui
+++ b/sc/uiconfig/scalc/ui/pivottablelayoutdialog.ui
@@ -22,6 +22,7 @@
                 <property name="label">gtk-ok</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
+                <property name="has_default">True</property>
                 <property name="receives_default">True</property>
                 <property name="use_stock">True</property>
               </object>
commit 6a27f470c586147c88d7f1edf10387570c506c52
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Mon Aug 18 00:18:52 2014 +0200

    versionofdialog: define default button
    
    Change-Id: I2636555d9351b59572eebcf4d3f420da33674e3a

diff --git a/sfx2/uiconfig/ui/versionsofdialog.ui b/sfx2/uiconfig/ui/versionsofdialog.ui
index cd0f542..5d8003a 100644
--- a/sfx2/uiconfig/ui/versionsofdialog.ui
+++ b/sfx2/uiconfig/ui/versionsofdialog.ui
@@ -20,6 +20,7 @@
                 <property name="label">gtk-close</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
+                <property name="has_default">True</property>
                 <property name="receives_default">True</property>
                 <property name="use_stock">True</property>
               </object>
@@ -99,7 +100,6 @@
                 <property name="position">5</property>
               </packing>
             </child>
-
             <child>
               <object class="GtkButton" id="help">
                 <property name="label">gtk-help</property>
@@ -329,6 +329,7 @@
       <action-widget response="0">show</action-widget>
       <action-widget response="0">delete</action-widget>
       <action-widget response="0">compare</action-widget>
+      <action-widget response="0">cmis</action-widget>
       <action-widget response="0">help</action-widget>
     </action-widgets>
   </object>


More information about the Libreoffice-commits mailing list