[Libreoffice-commits] .: bridges/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Nov 26 14:15:28 PST 2012


 bridges/source/cpp_uno/cc50_solaris_sparc/except.cxx      |    7 ----
 bridges/source/cpp_uno/cc5_solaris_sparc64/exceptions.cxx |   24 ++++++--------
 bridges/source/cpp_uno/cc5_solaris_sparc64/uno2cpp.cxx    |    4 +-
 bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx       |    8 +---
 4 files changed, 16 insertions(+), 27 deletions(-)

New commits:
commit 1d095efaf989730c298b2ad99720eacf68f71229
Author: Ricardo Montania <ricardo at linuxafundo.com.br>
Date:   Wed Nov 14 17:20:12 2012 -0200

    Some ::rtl::OUString -> OUString in bridges
    
    Change-Id: I5412773f9cebc633a78ee5733b62f64b6d1599d4
    Reviewed-on: https://gerrit.libreoffice.org/1068
    Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>
    Tested-by: Norbert Thiebaud <nthiebaud at gmail.com>

diff --git a/bridges/source/cpp_uno/cc50_solaris_sparc/except.cxx b/bridges/source/cpp_uno/cc50_solaris_sparc/except.cxx
index a4a2f66..56de9c4 100644
--- a/bridges/source/cpp_uno/cc50_solaris_sparc/except.cxx
+++ b/bridges/source/cpp_uno/cc50_solaris_sparc/except.cxx
@@ -39,11 +39,6 @@
 #include <hash.cxx>
 
 // need a += operator for OString and sal_Char
-using ::rtl::OUString;
-using ::rtl::OString;
-using ::rtl::OStringBuffer;
-using ::rtl::OUStringToOString;
-using ::rtl::OStringToOUString;
 
 {
     inline OString& operator+=( OString& rString, sal_Char cAdd )
@@ -422,7 +417,7 @@ void cc50_solaris_sparc_fillUnoException(
 
 #if OSL_DEBUG_LEVEL > 1
     fprintf( stderr, "> c++ exception occurred: %s\n",
-             ::rtl::OUStringToOString(
+             OUStringToOString(
                  pExcTypeDescr->pTypeName,
                  RTL_TEXTENCODING_ASCII_US ).getStr() );
 #endif
diff --git a/bridges/source/cpp_uno/cc5_solaris_sparc64/exceptions.cxx b/bridges/source/cpp_uno/cc5_solaris_sparc64/exceptions.cxx
index 09aac8b..2a55fcd 100644
--- a/bridges/source/cpp_uno/cc5_solaris_sparc64/exceptions.cxx
+++ b/bridges/source/cpp_uno/cc5_solaris_sparc64/exceptions.cxx
@@ -59,7 +59,7 @@ Function toFunction(void * pointer) {
 #pragma enable_warn
 }
 
-bool toUnoName(char const * rttiName, rtl::OUString * unoName) {
+bool toUnoName(char const * rttiName, OUString * unoName) {
     rtl::OStringBuffer buf;
     for (;;) {
         char const * p = std::strchr(rttiName, ':');
@@ -281,11 +281,11 @@ private:
         rtl::OString cppName;
         std::vector< __Crun::class_base_descr > bases;
     };
-    typedef std::map< rtl::OUString, Data > Map;
+    typedef std::map< OUString, Data > Map;
 
     static void toCppNames(
-        rtl::OUString const & unoName, rtl::OString * cppName,
-        rtl::OString * rttiName);
+        OUString const & unoName, OString * cppName,
+        OString * rttiName);
 
     static Data const & get_(typelib_CompoundTypeDescription const * type);
 
@@ -307,16 +307,16 @@ __Crun::static_type_info const * RttiMap::get(
 }
 
 void RttiMap::toCppNames(
-    rtl::OUString const & unoName, rtl::OString * cppName,
-    rtl::OString * rttiName)
+    OUString const & unoName, OString * cppName,
+    OString * rttiName)
 {
     OSL_ASSERT(cppName != NULL && rttiName != NULL);
     rtl::OStringBuffer bc;
     rtl::OStringBuffer br;
     br.append("__1n");
     for (sal_Int32 i = 0; i != -1;) {
-        rtl::OUString tok(unoName.getToken(0, '.', i));
-        bc.append(rtl::OUStringToOString(tok, RTL_TEXTENCODING_UTF8));
+        OUString tok(unoName.getToken(0, '.', i));
+        bc.append(OUStringToOString(tok, RTL_TEXTENCODING_UTF8));
             // conversion should never fail, as tok should be well-formed ASCII
         if (i != -1) {
             bc.append("::");
@@ -347,7 +347,7 @@ void RttiMap::toCppNames(
 RttiMap::Data const & RttiMap::get_(
     typelib_CompoundTypeDescription const * type)
 {
-    rtl::OUString name(type->aBase.pTypeName);
+    OUString name(type->aBase.pTypeName);
     Map::iterator it(m_map->find(name));
     if (it == m_map->end()) {
         it = m_map->insert(std::make_pair(name, Data())).first;
@@ -426,16 +426,14 @@ void fillUnoException(
     void * cppException, char const * cppName, uno_Any * unoException,
     uno_Mapping * cppToUno)
 {
-    rtl::OUString name;
+    OUString name;
     typelib_TypeDescription * type = NULL;
     if (toUnoName(cppName, &name)) {
         typelib_typedescription_getByName(&type, name.pData);
     }
     if (type == NULL || type->eTypeClass != typelib_TypeClass_EXCEPTION) {
         css::uno::RuntimeException exc(
-            (rtl::OUString(
-                RTL_CONSTASCII_USTRINGPARAM("Not a UNO exception type: ")) +
-             name),
+            "Not a UNO exception type: " + name),
             css::uno::Reference< css::uno::XInterface >());
         uno_type_any_constructAndConvert(
             unoException, &exc, getCppuType(&exc).getTypeLibType(), cppToUno);
diff --git a/bridges/source/cpp_uno/cc5_solaris_sparc64/uno2cpp.cxx b/bridges/source/cpp_uno/cc5_solaris_sparc64/uno2cpp.cxx
index abd3b23..cf4545a 100644
--- a/bridges/source/cpp_uno/cc5_solaris_sparc64/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/cc5_solaris_sparc64/uno2cpp.cxx
@@ -416,6 +416,7 @@ void unoInterfaceProxyDispatch(
                     0, NULL, pReturn, pArgs, ppException);
             } else {
                 // Setter:
+                OUString aVoid = "void";
                 typelib_MethodParameter param = {
                     NULL,
                     (reinterpret_cast<
@@ -424,8 +425,7 @@ void unoInterfaceProxyDispatch(
                     true, false };
                 typelib_TypeDescriptionReference * rtd = NULL;
                 typelib_typedescriptionreference_new(
-                    &rtd, typelib_TypeClass_VOID,
-                    rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("void")).pData);
+                    &rtd, typelib_TypeClass_VOID, aVoid.pData);
                 slot.index += 1;
                 call(proxy, slot, rtd, 1, &param, pReturn, pArgs, ppException);
                 typelib_typedescriptionreference_release(rtd);
diff --git a/bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx
index 58863ec..f60afae 100644
--- a/bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx
@@ -337,9 +337,7 @@ static typelib_TypeClass cpp_mediate(
         OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" );
         if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex)
         {
-                throw RuntimeException(
-            rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "illegal vtable index!" )),
-            (XInterface *)pThis );
+                throw RuntimeException( "illegal vtable index!", (XInterface *)pThis );
         }
 
         // determine called method
@@ -429,9 +427,7 @@ static typelib_TypeClass cpp_mediate(
         }
         default:
         {
-                throw RuntimeException(
-            rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "no member description found!" )),
-            (XInterface *)pThis );
+                throw RuntimeException( "no member description found!", (XInterface *)pThis );
         }
         }
 


More information about the Libreoffice-commits mailing list