summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-12-03 13:30:41 +0100
committerThorsten Behrens <thorsten.behrens@allotropia.de>2021-04-20 22:20:50 +0200
commit28e07fa9ef737921857cf9941086c0425409b90b (patch)
treeb51ee1f0d339936f952516277d88a0baf11980c9
parent66e384f4ddfb9d3ac5eaccf3cf3b1923fb4d7a11 (diff)
Adapt to C++20 deleted ostream << for sal_Unicode (aka char16_t)
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1423r3.html> "char8_t backward compatibility remediation", as implemented now by <https://gcc.gnu.org/ git/?p=gcc.git;a=commit;h=0c5b35933e5b150df0ab487efb2f11ef5685f713> "libstdc++: P1423R3 char8_t remediation (2/4)" for -std=c++2a, deletes operator << overloads that would print an integer rather than a (presumably expected) character. But in these cases printing an integer is as expected, so add explicit casts. Change-Id: I7c2f1afaa2982b284aef8af183b71466c37142c2 Reviewed-on: https://gerrit.libreoffice.org/84339 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit e8cb5f2e11838060f85e7940540b5f7096d9eeb7)
-rw-r--r--include/com/sun/star/uno/Any.hxx2
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/com/sun/star/uno/Any.hxx b/include/com/sun/star/uno/Any.hxx
index 2467a9c3d1f4..948d5b0e32ff 100644
--- a/include/com/sun/star/uno/Any.hxx
+++ b/include/com/sun/star/uno/Any.hxx
@@ -701,7 +701,7 @@ inline std::basic_ostream<charT, traits> &operator<<(std::basic_ostream<charT, t
std::ios_base::hex, std::ios_base::basefield);
charT fill = o.fill('0');
o << " U+" << std::setw(4)
- << *static_cast<sal_Unicode const *>(any.getValue());
+ << unsigned(*static_cast<sal_Unicode const *>(any.getValue()));
o.setf(flgs);
o.fill(fill);
break;
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 0438a1e54caf..c5a2f8bdedc7 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2730,7 +2730,7 @@ void DocxAttributeOutput::RunText( const OUString& rText, rtl_TextEncoding /*eCh
if ( *pIt < 0x0020 ) // filter out the control codes
{
impl_WriteRunText( m_pSerializer, nTextToken, pBegin, pIt );
- SAL_INFO("sw.ww8", "Ignored control code in a text run: " << *pIt );
+ SAL_INFO("sw.ww8", "Ignored control code in a text run: " << unsigned(*pIt) );
}
prevUnicode = *pIt;
break;