[PATCH] rtl: add global empty oustring

Norbert Thiebaud (via Code Review) gerrit at gerrit.libreoffice.org
Thu Jun 13 06:20:27 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/4264

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/64/4264/1

rtl: add global empty oustring

Change-Id: Ia5c3fcf564243dd90eb816d4ef571b3750a5ef5d
---
M include/rtl/ustring.hxx
M sal/rtl/ustring.cxx
2 files changed, 20 insertions(+), 0 deletions(-)



diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx
index 112486d..49a9696 100644
--- a/include/rtl/ustring.hxx
+++ b/include/rtl/ustring.hxx
@@ -55,6 +55,13 @@
 namespace rtl
 {
 
+class OUString;
+}
+SAL_DLLPUBLIC rtl::OUString& SAL_CALL rtl_ustr_get_empty(void);
+
+namespace rtl
+{
+
 #ifdef RTL_STRING_UNITTEST
 #undef rtl
 #endif
@@ -2232,6 +2239,11 @@
         rtl_uString_newFromAscii( &pNew, value );
         return OUString( pNew, SAL_NO_ACQUIRE );
     }
+
+    static OUString& getEmptyOUString(void)
+    {
+        return rtl_ustr_get_empty();
+    }
 };
 
 /* ======================================================================= */
diff --git a/sal/rtl/ustring.cxx b/sal/rtl/ustring.cxx
index bdebd89..0d045c2 100644
--- a/sal/rtl/ustring.cxx
+++ b/sal/rtl/ustring.cxx
@@ -44,6 +44,7 @@
 
 #include "rtl/math.h"
 #include "rtl/tencinfo.h"
+#include "rtl/ustring.hxx"
 
 /* ======================================================================= */
 
@@ -75,6 +76,13 @@
 
 #include "strtmpl.cxx"
 
+rtl::OUString& SAL_CALL rtl_ustr_get_empty(void)
+{
+    static rtl::OUString aEmpty;
+    return aEmpty;
+}
+
+
 sal_Int32 rtl_ustr_indexOfAscii_WithLength(
     sal_Unicode const * str, sal_Int32 len,
     char const * subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C()

-- 
To view, visit https://gerrit.libreoffice.org/4264
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia5c3fcf564243dd90eb816d4ef571b3750a5ef5d
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Norbert Thiebaud <nthiebaud at gmail.com>



More information about the LibreOffice mailing list