[Libreoffice-commits] .: sal/inc

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Dec 10 14:55:44 PST 2012


 sal/inc/rtl/strbuf.hxx  |   15 +++++++++++++++
 sal/inc/rtl/ustrbuf.hxx |   15 +++++++++++++++
 2 files changed, 30 insertions(+)

New commits:
commit 17b272effc206875fe4165e58d6452f0ecd82222
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Mon Dec 10 23:51:22 2012 +0100

    operator+ for stringbuffer
    
    This is to complement the RTL_FAST_STRING variant, which allows any
    combination, so even two stringbuffers.
    
    Change-Id: Ic15d81246b3d0f3e22b51c0516409e95c3a4dc8d

diff --git a/sal/inc/rtl/strbuf.hxx b/sal/inc/rtl/strbuf.hxx
index 86f89ef..2740c48 100644
--- a/sal/inc/rtl/strbuf.hxx
+++ b/sal/inc/rtl/strbuf.hxx
@@ -862,6 +862,21 @@ public:
         return *this;
     }
 
+#ifdef LIBO_INTERNAL_ONLY
+    // This is to complement the RTL_FAST_STRING operator+, which allows any combination of valid operands,
+    // even two buffers. It's intentional it returns OString, just like the operator+ would in the fast variant.
+#ifndef RTL_FAST_STRING
+    /**
+     @internal
+     @since LibreOffice 4.1
+    */
+    friend OString operator+( const OStringBuffer& str1, const OStringBuffer& str2  ) SAL_THROW(())
+    {
+        return OString( str1.pData ).concat( str2.pData );
+    }
+#endif
+#endif
+
 private:
     /**
         A pointer to the data structur which contains the data.
diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index 3814a6f..d48245b 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -1298,6 +1298,21 @@ public:
         return stripStart(c) + stripEnd(c);
     }
 
+#ifdef LIBO_INTERNAL_ONLY
+    // This is to complement the RTL_FAST_STRING operator+, which allows any combination of valid operands,
+    // even two buffers. It's intentional it returns OUString, just like the operator+ would in the fast variant.
+#ifndef RTL_FAST_STRING
+    /**
+     @internal
+     @since LibreOffice 4.1
+    */
+    friend OUString operator+( const OUStringBuffer& str1, const OUStringBuffer& str2  ) SAL_THROW(())
+    {
+        return OUString( str1.pData ).concat( str2.pData );
+    }
+#endif
+#endif
+
 private:
     /**
         A pointer to the data structur which contains the data.


More information about the Libreoffice-commits mailing list