[Libreoffice-commits] core.git: comphelper/source l10ntools/source sal/osl sc/source unotools/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 16 21:06:14 UTC 2021


 comphelper/source/xml/xmltools.cxx           |    2 +-
 l10ntools/source/po.cxx                      |    4 ++--
 sal/osl/unx/uunxapi.cxx                      |    2 +-
 sc/source/filter/excel/xestream.cxx          |    2 +-
 sc/source/filter/html/htmlexp.cxx            |    2 +-
 sc/source/filter/xcl97/XclExpChangeTrack.cxx |    4 ++--
 unotools/source/i18n/resmgr.cxx              |    2 +-
 7 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 433ab39b2175bdadb4916373cd2dc8e1aabc08a5
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Jun 16 16:14:24 2021 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed Jun 16 23:05:34 2021 +0200

    Adapt implicit OString return value construction to C++23 P2266R1
    
    With the recent implementation of
    <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2266r1.html> "P2266R1:
    Simpler implicit move" in Clang 13 trunk as
    <https://github.com/llvm/llvm-project/commit/bf20631782183cd19e0bb7219e908c2bbb01a75f>
    "[clang] Implement P2266 Simpler implicit move", a --with-latest-c++ build
    started to fail with
    
    > comphelper/source/xml/xmltools.cxx:103:20: error: no viable conversion from returned value of type 'char [39]' to function return type 'rtl::OString'
    >             return str;
    >                    ^~~
    [...]
    > include/rtl/string.hxx:277:5: note: candidate constructor [with T = char [39]] not viable: expects an lvalue for 1st argument
    >     OString( T& value, typename libreoffice_internal::NonConstCharArrayDetector< T, libreoffice_internal::Dummy >::Type = libreoffice_internal::Dummy() )
    >     ^
    [...]
    
    etc.
    
    Change-Id: If34f143a1855fdd7cd22ea3d7594f9381d50a7ec
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117336
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/comphelper/source/xml/xmltools.cxx b/comphelper/source/xml/xmltools.cxx
index 74ad5faa67e7..366321076bad 100644
--- a/comphelper/source/xml/xmltools.cxx
+++ b/comphelper/source/xml/xmltools.cxx
@@ -100,7 +100,7 @@ namespace comphelper::xml
                     aSeq[0], aSeq[1], aSeq[2], aSeq[3], aSeq[4], aSeq[5], aSeq[6], aSeq[7], aSeq[8],
                     aSeq[9], aSeq[10], aSeq[11], aSeq[12], aSeq[13], aSeq[14], aSeq[15]);
 
-            return str;
+            return OString(str);
         }
 }
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx
index 8d47a7d39410..2c0b4f88b254 100644
--- a/l10ntools/source/po.cxx
+++ b/l10ntools/source/po.cxx
@@ -427,7 +427,7 @@ OString PoEntry::genKeyId(const OString& rGenerator)
         nCRC >>= 6;
     }
     sKeyId[5] = '\0';
-    return sKeyId;
+    return OString(sKeyId);
 }
 
 namespace
@@ -439,7 +439,7 @@ namespace
         struct tm* pNow = localtime(&aNow);
         char pBuff[50];
         strftime( pBuff, sizeof pBuff, "%Y-%m-%d %H:%M%z", pNow );
-        return pBuff;
+        return OString(pBuff);
     }
 }
 
diff --git a/sal/osl/unx/uunxapi.cxx b/sal/osl/unx/uunxapi.cxx
index 1f847cfd32a5..917476d7ab03 100644
--- a/sal/osl/unx/uunxapi.cxx
+++ b/sal/osl/unx/uunxapi.cxx
@@ -154,7 +154,7 @@ static OString macxp_resolveAliasAndConvert(OString const & p)
     {
         strcpy(path, p.getStr());
         macxp_resolveAlias(path, PATH_MAX);
-        return path;
+        return OString(path);
     }
     return p;
 }
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index ac63d34414b5..17395145bbab 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -705,7 +705,7 @@ OString XclXmlUtils::ToOString( const Color& rColor )
     char buf[9];
     sprintf( buf, "%.2X%.2X%.2X%.2X", rColor.GetAlpha(), rColor.GetRed(), rColor.GetGreen(), rColor.GetBlue() );
     buf[8] = '\0';
-    return buf;
+    return OString(buf);
 }
 
 OStringBuffer& XclXmlUtils::ToOString( OStringBuffer& s, const ScAddress& rAddress )
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index 270312f594ce..de0f438d2640 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -189,7 +189,7 @@ static OString lcl_makeHTMLColorTriplet(const Color& rColor)
     // <font COLOR="#00FF40">hello</font>
     snprintf( buf, 24, "\"#%02X%02X%02X\"", rColor.GetRed(), rColor.GetGreen(), rColor.GetBlue() );
 
-    return buf;
+    return OString(buf);
 }
 
 ScHTMLExport::ScHTMLExport( SvStream& rStrmP, const OUString& rBaseURL, ScDocument* pDocP,
diff --git a/sc/source/filter/xcl97/XclExpChangeTrack.cxx b/sc/source/filter/xcl97/XclExpChangeTrack.cxx
index 5ddd4bf64d7e..225345836793 100644
--- a/sc/source/filter/xcl97/XclExpChangeTrack.cxx
+++ b/sc/source/filter/xcl97/XclExpChangeTrack.cxx
@@ -45,7 +45,7 @@ static OString lcl_GuidToOString( sal_uInt8 aGuid[ 16 ] )
             "{%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
             aGuid[ 0 ], aGuid[ 1 ], aGuid[ 2 ], aGuid[ 3 ], aGuid[ 4 ], aGuid[ 5 ], aGuid[ 6 ], aGuid[ 7 ],
             aGuid[ 8 ], aGuid[ 9 ], aGuid[ 10 ], aGuid[ 11 ], aGuid[ 12 ], aGuid[ 13 ], aGuid[ 14 ], aGuid[ 15 ] );
-    return sBuf;
+    return OString(sBuf);
 }
 
 static OString lcl_DateTimeToOString( const DateTime& rDateTime )
@@ -56,7 +56,7 @@ static OString lcl_DateTimeToOString( const DateTime& rDateTime )
             rDateTime.GetYear(), rDateTime.GetMonth(), rDateTime.GetDay(),
             rDateTime.GetHour(), rDateTime.GetMin(), rDateTime.GetSec(),
             rDateTime.GetNanoSec() );
-    return sBuf;
+    return OString(sBuf);
 }
 
 // local functions
diff --git a/unotools/source/i18n/resmgr.cxx b/unotools/source/i18n/resmgr.cxx
index caee3ecf1818..ef525cf48ca5 100644
--- a/unotools/source/i18n/resmgr.cxx
+++ b/unotools/source/i18n/resmgr.cxx
@@ -90,7 +90,7 @@ namespace
             nCRC >>= 6;
         }
         sKeyId[5] = '\0';
-        return sKeyId;
+        return OString(sKeyId);
     }
 }
 


More information about the Libreoffice-commits mailing list