[Libreoffice-commits] core.git: Branch 'feature/cib_contract138c' - 9 commits - basegfx/source cppu/qa cui/source i18npool/qa i18npool/source include/com include/o3tl sal/qa sdext/source sd/source starmath/qa starmath/source svl/qa svx/source sw/qa sw/source vcl/qa xmlsecurity/qa

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 20 21:41:49 UTC 2021


 basegfx/source/polygon/b2dsvgpolypolygon.cxx                 |    2 
 cppu/qa/cppumaker/test_cppumaker.cxx                         |    1 
 cppu/qa/test_any.cxx                                         |    1 
 cui/source/tabpages/tpline.cxx                               |    2 
 i18npool/qa/cppunit/test_breakiterator.cxx                   |    1 
 i18npool/source/calendar/calendar_gregorian.cxx              |    2 
 include/com/sun/star/uno/Any.hxx                             |    2 
 include/o3tl/cppunittraitshelper.hxx                         |   27 +++++++++++
 sal/qa/rtl/oustring/rtl_OUString2.cxx                        |    2 
 sal/qa/rtl/oustringbuffer/test_oustringbuffer_appendchar.cxx |    3 +
 sal/qa/rtl/strings/test_oustring_stringliterals.cxx          |    1 
 sal/qa/rtl/textenc/rtl_textcvt.cxx                           |    1 
 sd/source/ui/framework/factories/BasicPaneFactory.cxx        |    2 
 sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx           |    1 
 starmath/qa/cppunit/test_node.cxx                            |    1 
 starmath/qa/extras/mmlexport-test.cxx                        |    2 
 starmath/source/ooxmlimport.cxx                              |    4 -
 svl/qa/unit/test_INetContentType.cxx                         |   12 ++--
 svl/qa/unit/test_lngmisc.cxx                                 |    3 +
 svx/source/dialog/fntctrl.cxx                                |    2 
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx                     |    1 
 sw/qa/extras/ooxmlexport/ooxmlexport5.cxx                    |    1 
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx                     |    1 
 sw/qa/extras/rtfimport/rtfimport.cxx                         |    2 
 sw/qa/extras/uiwriter/uiwriter.cxx                           |    2 
 sw/source/filter/ww8/docxattributeoutput.cxx                 |    2 
 vcl/qa/cppunit/mnemonic.cxx                                  |    3 +
 vcl/qa/cppunit/pdfexport/pdfexport.cxx                       |    6 +-
 xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx                |    3 -
 29 files changed, 73 insertions(+), 20 deletions(-)

New commits:
commit ae72b5fa6ec527480880c179f16cdde2f18e860c
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Dec 3 13:58:23 2019 +0100
Commit:     Thorsten Behrens <thorsten.behrens at allotropia.de>
CommitDate: Tue Apr 20 23:40:52 2021 +0200

    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 a pointer rather than a (presumably expected) string.
    
    But here it should be fine to print pointers, esp. as there are null pointers
    involved.
    
    Change-Id: I62fad4cb9eaaa612989f035f686086ef29093d70
    Reviewed-on: https://gerrit.libreoffice.org/84351
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit 1f0c54c250c2390962105128dcf871aad0689323)

diff --git a/svl/qa/unit/test_INetContentType.cxx b/svl/qa/unit/test_INetContentType.cxx
index 8495d2d93273..2d060d271b51 100644
--- a/svl/qa/unit/test_INetContentType.cxx
+++ b/svl/qa/unit/test_INetContentType.cxx
@@ -40,8 +40,8 @@ public:
 void Test::testBad() {
     OUString in("foo=bar");
     CPPUNIT_ASSERT_EQUAL(
-        static_cast<sal_Unicode const *>(nullptr),
-        INetMIME::scanContentType(in));
+        static_cast<void const *>(nullptr),
+        static_cast<void const *>(INetMIME::scanContentType(in)));
     OUString t;
     OUString s;
     INetContentTypeParameterList ps;
@@ -54,8 +54,8 @@ void Test::testBad() {
 void Test::testFull() {
     OUString in("foo/bar;baz=boz");
     CPPUNIT_ASSERT_EQUAL(
-        in.getStr() + in.getLength(),
-        INetMIME::scanContentType(in));
+        static_cast<void const *>(in.getStr() + in.getLength()),
+        static_cast<void const *>(INetMIME::scanContentType(in)));
     OUString t;
     OUString s;
     INetContentTypeParameterList ps;
@@ -70,8 +70,8 @@ void Test::testFull() {
 void Test::testFollow() {
     OUString in("foo/bar;baz=boz;base64,");
     CPPUNIT_ASSERT_EQUAL(
-        in.getStr() + std::strlen("foo/bar;baz=boz"),
-        INetMIME::scanContentType(in));
+        static_cast<void const *>(in.getStr() + std::strlen("foo/bar;baz=boz")),
+        static_cast<void const *>(INetMIME::scanContentType(in)));
     OUString t;
     OUString s;
     INetContentTypeParameterList ps;
commit 3b9646b509fd02a37c53e77f84e37105e233440b
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Dec 3 13:46:24 2019 +0100
Commit:     Thorsten Behrens <thorsten.behrens at allotropia.de>
CommitDate: Tue Apr 20 23:40:52 2021 +0200

    Adapt CPPUNIT_ASSERT 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 for simplicity (and to avoid issues with non-printing characters), keep
    printing an integer here.
    
    Change-Id: I751b99ee32d418eb488131ffa130d6f7d6d38dc7
    Reviewed-on: https://gerrit.libreoffice.org/84348
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit 5d8f0fad50f90195a11873c70ddab4644f5839ea)
    
    Conflicts:
            cppu/qa/test_any.cxx
            svl/qa/unit/lockfiles/test_lockfiles.cxx
            sw/qa/extras/ooxmlimport/ooxmlimport.cxx
            sw/qa/extras/rtfexport/rtfexport4.cxx
            sw/qa/extras/uiwriter/uiwriter.cxx

diff --git a/cppu/qa/cppumaker/test_cppumaker.cxx b/cppu/qa/cppumaker/test_cppumaker.cxx
index e73a502333f8..0ac7f854fe76 100644
--- a/cppu/qa/cppumaker/test_cppumaker.cxx
+++ b/cppu/qa/cppumaker/test_cppumaker.cxx
@@ -360,6 +360,7 @@
 #include <cppunit/TestFixture.h>
 #include <cppunit/extensions/HelperMacros.h>
 #include <cppunit/plugin/TestPlugIn.h>
+#include <o3tl/cppunittraitshelper.hxx>
 #include <rtl/ustring.hxx>
 
 #include <cstddef>
diff --git a/cppu/qa/test_any.cxx b/cppu/qa/test_any.cxx
index 7787176ffd3b..ea4013b2e2bc 100644
--- a/cppu/qa/test_any.cxx
+++ b/cppu/qa/test_any.cxx
@@ -50,6 +50,7 @@
 #include <com/sun/star/uno/Sequence.hxx>
 #include <com/sun/star/uno/Type.hxx>
 #include <com/sun/star/uno/XInterface.hpp>
+#include <o3tl/cppunittraitshelper.hxx>
 #include <osl/interlck.h>
 #include <rtl/string.h>
 #include <rtl/ustring.h>
diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx b/i18npool/qa/cppunit/test_breakiterator.cxx
index 0c132acf3a43..71858daa617e 100644
--- a/i18npool/qa/cppunit/test_breakiterator.cxx
+++ b/i18npool/qa/cppunit/test_breakiterator.cxx
@@ -13,6 +13,7 @@
 #include <com/sun/star/i18n/CharacterIteratorMode.hpp>
 #include <com/sun/star/i18n/ScriptType.hpp>
 #include <com/sun/star/i18n/WordType.hpp>
+#include <o3tl/cppunittraitshelper.hxx>
 #include <unotest/bootstrapfixturebase.hxx>
 
 #include <unicode/uversion.h>
diff --git a/include/o3tl/cppunittraitshelper.hxx b/include/o3tl/cppunittraitshelper.hxx
new file mode 100644
index 000000000000..d9f75a61b4c8
--- /dev/null
+++ b/include/o3tl/cppunittraitshelper.hxx
@@ -0,0 +1,27 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_O3TL_CPPUNITTRAITSHELPER_HXX
+#define INCLUDED_O3TL_CPPUNITTRAITSHELPER_HXX
+
+#include <sal/config.h>
+
+#include <string>
+
+#include <cppunit/TestAssert.h>
+
+// ostream << char16_t is deleted since C++20 (but just keep outputting numeric values):
+template <> inline std::string CppUnit::assertion_traits<char16_t>::toString(char16_t const& x)
+{
+    return assertion_traits<unsigned>::toString(unsigned(x));
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/sal/qa/rtl/oustring/rtl_OUString2.cxx b/sal/qa/rtl/oustring/rtl_OUString2.cxx
index b932e371be3d..20fe5e02991c 100644
--- a/sal/qa/rtl/oustring/rtl_OUString2.cxx
+++ b/sal/qa/rtl/oustring/rtl_OUString2.cxx
@@ -30,6 +30,8 @@
 #include <cppunit/extensions/HelperMacros.h>
 #include <cppunit/plugin/TestPlugIn.h>
 
+#include <o3tl/cppunittraitshelper.hxx>
+
 #include <stringhelper.hxx>
 #include <valueequal.hxx>
 
diff --git a/sal/qa/rtl/oustringbuffer/test_oustringbuffer_appendchar.cxx b/sal/qa/rtl/oustringbuffer/test_oustringbuffer_appendchar.cxx
index f1a151fdc836..80ce83b1d2d0 100644
--- a/sal/qa/rtl/oustringbuffer/test_oustringbuffer_appendchar.cxx
+++ b/sal/qa/rtl/oustringbuffer/test_oustringbuffer_appendchar.cxx
@@ -7,6 +7,9 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include <sal/config.h>
+
+#include <o3tl/cppunittraitshelper.hxx>
 #include <sal/types.h>
 #include <cppunit/TestFixture.h>
 #include <cppunit/TestAssert.h>
diff --git a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
index a98401351a7f..c09dfe99451b 100644
--- a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
@@ -14,6 +14,7 @@
 
 #include <utility>
 
+#include <o3tl/cppunittraitshelper.hxx>
 #include <sal/types.h>
 #include <config_global.h>
 #include <cppunit/TestFixture.h>
diff --git a/sal/qa/rtl/textenc/rtl_textcvt.cxx b/sal/qa/rtl/textenc/rtl_textcvt.cxx
index 339075decba3..3c8539640522 100644
--- a/sal/qa/rtl/textenc/rtl_textcvt.cxx
+++ b/sal/qa/rtl/textenc/rtl_textcvt.cxx
@@ -27,6 +27,7 @@
 #include <cppunit/TestFixture.h>
 #include <cppunit/extensions/HelperMacros.h>
 
+#include <o3tl/cppunittraitshelper.hxx>
 #include <rtl/string.hxx>
 #include <rtl/ustring.hxx>
 #include <rtl/tencinfo.h>
diff --git a/starmath/qa/cppunit/test_node.cxx b/starmath/qa/cppunit/test_node.cxx
index cb24bbdff78b..19cb5167cc2f 100644
--- a/starmath/qa/cppunit/test_node.cxx
+++ b/starmath/qa/cppunit/test_node.cxx
@@ -10,6 +10,7 @@
 #include <sal/config.h>
 #include <test/bootstrapfixture.hxx>
 
+#include <o3tl/cppunittraitshelper.hxx>
 #include <sfx2/sfxmodelfactory.hxx>
 
 #include <document.hxx>
diff --git a/starmath/qa/extras/mmlexport-test.cxx b/starmath/qa/extras/mmlexport-test.cxx
index 8fdaa566a778..cbcc1d040c26 100644
--- a/starmath/qa/extras/mmlexport-test.cxx
+++ b/starmath/qa/extras/mmlexport-test.cxx
@@ -8,6 +8,8 @@
  */
 
 #include <sal/config.h>
+
+#include <o3tl/cppunittraitshelper.hxx>
 #include <test/bootstrapfixture.hxx>
 #include <test/xmltesttools.hxx>
 #include <unotools/tempfile.hxx>
diff --git a/svl/qa/unit/test_lngmisc.cxx b/svl/qa/unit/test_lngmisc.cxx
index b4ba30c6c63b..e8daf852ddf2 100644
--- a/svl/qa/unit/test_lngmisc.cxx
+++ b/svl/qa/unit/test_lngmisc.cxx
@@ -7,6 +7,9 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include <sal/config.h>
+
+#include <o3tl/cppunittraitshelper.hxx>
 #include <sal/types.h>
 #include <cppunit/TestAssert.h>
 #include <cppunit/TestFixture.h>
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 3c84ed37e97e..ebc8da1bb79c 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -19,6 +19,7 @@
 #include <com/sun/star/text/XTextRangeCompare.hpp>
 #include <com/sun/star/text/WritingMode2.hpp>
 #include <com/sun/star/text/TableColumnSeparator.hpp>
+#include <o3tl/cppunittraitshelper.hxx>
 #include <oox/drawingml/drawingmltypes.hxx>
 #include <config_features.h>
 #include <string>
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index 64b9adc07ff9..09bc82a493ce 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -48,6 +48,7 @@
 #include <com/sun/star/drawing/Hatch.hpp>
 #include <com/sun/star/rdf/URI.hpp>
 #include <com/sun/star/rdf/Statement.hpp>
+#include <o3tl/cppunittraitshelper.hxx>
 
 #include <string>
 #include <config_features.h>
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index e05d7490519a..20d769bf77e3 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -53,6 +53,7 @@
 #include <com/sun/star/document/XFilter.hpp>
 #include <com/sun/star/document/XImporter.hpp>
 #include <vcl/bitmapaccess.hxx>
+#include <o3tl/cppunittraitshelper.hxx>
 #include <unotools/fltrcfg.hxx>
 #include <comphelper/sequenceashashmap.hxx>
 #include <com/sun/star/text/GraphicCrop.hpp>
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 263b9aef0e5d..df71b2359cea 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -39,7 +39,7 @@
 #include <com/sun/star/text/HoriOrientation.hpp>
 #include <com/sun/star/text/VertOrientation.hpp>
 #include <com/sun/star/text/XFormField.hpp>
-
+#include <o3tl/cppunittraitshelper.hxx>
 #include <rtl/ustring.hxx>
 #include <vcl/settings.hxx>
 #include <comphelper/sequenceashashmap.hxx>
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index e16e78beba22..b007d50ff4a1 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -91,6 +91,8 @@
 #include <com/sun/star/chart2/data/XDataSource.hpp>
 #include <com/sun/star/document/XEmbeddedObjectSupplier2.hpp>
 #include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/linguistic2/XLinguProperties.hpp>
+#include <o3tl/cppunittraitshelper.hxx>
 #include <o3tl/deleter.hxx>
 #include <o3tl/make_unique.hxx>
 #include <osl/file.hxx>
diff --git a/vcl/qa/cppunit/mnemonic.cxx b/vcl/qa/cppunit/mnemonic.cxx
index 0109c1cd0279..b846d72334dd 100644
--- a/vcl/qa/cppunit/mnemonic.cxx
+++ b/vcl/qa/cppunit/mnemonic.cxx
@@ -7,6 +7,9 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include <sal/config.h>
+
+#include <o3tl/cppunittraitshelper.hxx>
 #include <test/bootstrapfixture.hxx>
 #include <cppunit/TestAssert.h>
 #include <cppunit/TestFixture.h>
commit 690d078f2b91d769f31e048b8a1d523af18e6d11
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon Oct 21 22:16:42 2019 +0200
Commit:     Thorsten Behrens <thorsten.behrens at allotropia.de>
CommitDate: Tue Apr 20 23:40:52 2021 +0200

    Comparison between css::uno::WeakReference and css::uno::Reference
    
    ...causes overload resolution ambiguity in C++20, as observed with recent
    Clang 10 trunk with -std=c++2a:
    
    > sd/source/ui/framework/factories/BasicPaneFactory.cxx:327:39: error: use of overloaded operator '==' is ambiguous (with operand types 'css::uno::WeakReference<css::drawing::framework::XConfigurationController>' and 'const ::css::uno::Reference< ::css::uno::XInterface>')
    >     if (mxConfigurationControllerWeak == rEventObject.Source)
    >         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~
    > include/com/sun/star/uno/Reference.hxx:425:28: note: candidate function (with reversed parameter order)
    > inline bool BaseReference::operator == ( const BaseReference & rRef ) const
    >                            ^
    > include/cppuhelper/weakref.hxx:106:19: note: candidate function
    >     bool SAL_CALL operator == ( const WeakReferenceHelper & rObj ) const
    
    An alternative would be to add overloads for combinations of
    css::uno::WeakReference adn css::uno::Reference, but this was the only case of
    such an ambiguity across the whole code base, such just resolve it with an
    explicit .get().
    
    Change-Id: I4689d5ffd4f8993cc1f9401d3c21b24f53f21ccd
    Reviewed-on: https://gerrit.libreoffice.org/81282
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit 0c3e90d95c2c952265625bcff590599627114ec1)

diff --git a/sd/source/ui/framework/factories/BasicPaneFactory.cxx b/sd/source/ui/framework/factories/BasicPaneFactory.cxx
index 432b459087b4..00974ce725a0 100644
--- a/sd/source/ui/framework/factories/BasicPaneFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicPaneFactory.cxx
@@ -330,7 +330,7 @@ void SAL_CALL BasicPaneFactory::notifyConfigurationChange (
 void SAL_CALL BasicPaneFactory::disposing (
     const lang::EventObject& rEventObject)
 {
-    if (mxConfigurationControllerWeak == rEventObject.Source)
+    if (mxConfigurationControllerWeak.get() == rEventObject.Source)
     {
         mxConfigurationControllerWeak.clear();
     }
commit 92e82b76e713dc0f5421890f9010678af5b54ec2
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Oct 22 12:18:34 2019 +0200
Commit:     Thorsten Behrens <thorsten.behrens at allotropia.de>
CommitDate: Tue Apr 20 23:40:52 2021 +0200

    Avoid C++20 operator overloading ambiguity
    
    ...which is reported now by Clang 10 trunk with -std=c++2a:
    
    > cui/source/tabpages/tpline.cxx:481:80: error: use of overloaded operator '==' is ambiguous (with operand types 'const XLineEndItem' and 'XLineStartItem')
    >             if( pItem && ( !pOld || !( *static_cast<const XLineEndItem*>(pOld) == *pItem ) ) )
    >                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~
    > include/svx/xlnstit.hxx:43:29: note: candidate function (with reversed parameter order)
    >     virtual bool            operator==(const SfxPoolItem& rItem) const override;
    >                             ^
    > include/svx/xlnedit.hxx:43:29: note: candidate function
    >     virtual bool            operator==(const SfxPoolItem& rItem) const override;
    >                             ^
    
    But the base SfxPoolItem::operator == is virtual anyway, so no need to cast
    pOld to a derived type.
    
    And once the expression is changed to
    
      !( *pOld == *pItem )
    
    loplugin:simplifybool would kick in, but only with old compilers.  So update
    loplugin:simplifybool to also kick in on that with latest Clang trunk with
    -std=c++2a, and simplify the expression accordingly.
    
    Change-Id: I3de9175b30d8645ed7a52f87cfac320144576cc8
    Reviewed-on: https://gerrit.libreoffice.org/81203
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit 54f292d1d199dae36257a1ceb0ff30f32a7e0824)
    
    Conflicts:
            compilerplugins/clang/simplifybool.cxx
            compilerplugins/clang/test/simplifybool.cxx

diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index b4498348c8ed..cdb34e67aa9a 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -478,7 +478,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
             else if( m_pLineEndList->Count() > static_cast<long>( nPos - 1 ) )
                 pItem.reset(new XLineStartItem( m_xLbStartStyle->get_active_text(), m_pLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() ));
             pOld = GetOldItem( *rAttrs, XATTR_LINESTART );
-            if( pItem && ( !pOld || !( *static_cast<const XLineEndItem*>(pOld) == *pItem ) ) )
+            if( pItem && ( !pOld || *pOld != *pItem ) )
             {
                 rAttrs->Put( *pItem );
                 bModified = true;
commit eaddb1bf995be734b64b4ee33d3adc350e68bf2d
Author:     Thorsten Behrens <thorsten.behrens at allotropia.de>
AuthorDate: Tue Apr 20 23:25:27 2021 +0200
Commit:     Thorsten Behrens <thorsten.behrens at allotropia.de>
CommitDate: Tue Apr 20 23:40:24 2021 +0200

    Fixup for gcc11 - presumably true is fine
    
    See also a16a22023bf570184b499f01097f73d5ee29049d
    
        presumably 'true' is sufficient in all cases
    
    Change-Id: I02f989f53acd986143a2b49e0cf31fe960b56725

diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index b1a14c7961b2..e8d444bb4977 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -1716,7 +1716,7 @@ void FontPrevWindow::SetFromItemSet(const SfxItemSet &rSet, bool bPreviewBackgro
          rCTLFont.SetFillColor( rColor );
     }
     else
-        bTransparent = TRUE;
+        bTransparent = true;
 
     rFont.SetTransparent( bTransparent );
     rCJKFont.SetTransparent( bTransparent );
commit 505be3d773a8d4d8e9d67a51d8dc1db1adb07dbf
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Dec 3 11:56:33 2019 +0100
Commit:     Thorsten Behrens <thorsten.behrens at allotropia.de>
CommitDate: Tue Apr 20 22:59:57 2021 +0200

    Adapt SAL_WARN 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.
    
    Change-Id: Ic70d3e90e4b990d297e35f07379fe4952e138820
    Reviewed-on: https://gerrit.libreoffice.org/84321
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit b8bb7fd853db5d0d7cc4ea9120efb1a707e46c22)

diff --git a/basegfx/source/polygon/b2dsvgpolypolygon.cxx b/basegfx/source/polygon/b2dsvgpolypolygon.cxx
index 7906704e76e3..ac3e93627632 100644
--- a/basegfx/source/polygon/b2dsvgpolypolygon.cxx
+++ b/basegfx/source/polygon/b2dsvgpolypolygon.cxx
@@ -654,7 +654,7 @@ namespace basegfx
                     default:
                     {
                         SAL_WARN("basegfx", "importFromSvgD(): skipping tags in svg:d element (unknown: \""
-                                << aCurrChar
+                                << OUString(aCurrChar)
                                 << "\")!");
                         ++nPos;
                         break;
diff --git a/starmath/source/ooxmlimport.cxx b/starmath/source/ooxmlimport.cxx
index ca636f9138e6..4d27f663f6f4 100644
--- a/starmath/source/ooxmlimport.cxx
+++ b/starmath/source/ooxmlimport.cxx
@@ -221,7 +221,7 @@ OUString SmOoxmlImport::handleAcc()
             break;
         default:
             acc = "acute";
-            SAL_WARN( "starmath.ooxml", "Unknown m:chr in m:acc \'" << accChr << "\'" );
+            SAL_WARN( "starmath.ooxml", "Unknown m:chr in m:acc \'" << OUString(accChr) << "\'" );
             break;
     }
     OUString e = readOMathArgInElement( M_TOKEN( e ));
@@ -552,7 +552,7 @@ OUString SmOoxmlImport::handleNary()
             ret = "sum";
             break;
         default:
-            SAL_WARN( "starmath.ooxml", "Unknown m:nary chr \'" << chr << "\'" );
+            SAL_WARN( "starmath.ooxml", "Unknown m:nary chr \'" << OUString(chr) << "\'" );
             break;
     }
     if( !subHide )
commit a16a22023bf570184b499f01097f73d5ee29049d
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Nov 3 14:10:31 2020 +0000
Commit:     Thorsten Behrens <thorsten.behrens at allotropia.de>
CommitDate: Tue Apr 20 22:32:31 2021 +0200

    presumably 'true' is sufficient in all cases
    
    Change-Id: I9366193085a4c46ef64f0a9660e51b8678ca35f9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105252
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit ba1dc6fcb9f5df0b397effb20e2f58bb8c734879)
    
    Conflicts:
            i18npool/source/calendar/calendar_gregorian.cxx

diff --git a/i18npool/source/calendar/calendar_gregorian.cxx b/i18npool/source/calendar/calendar_gregorian.cxx
index cc15c9c40f6e..fa2da020db8a 100644
--- a/i18npool/source/calendar/calendar_gregorian.cxx
+++ b/i18npool/source/calendar/calendar_gregorian.cxx
@@ -329,7 +329,7 @@ Calendar_gregorian::setLocalDateTime( double fTimeInDays )
             "Calendar_gregorian::setLocalDateTime: " << std::fixed << fM << " rounded to " << fR);
     int32_t nZoneOffset, nDSTOffset;
     UErrorCode status = U_ZERO_ERROR;
-    body->getTimeZone().getOffset( fR, TRUE, nZoneOffset, nDSTOffset, status );
+    body->getTimeZone().getOffset( fR, true, nZoneOffset, nDSTOffset, status );
     if ( !U_SUCCESS(status) ) throw ERROR;
     status = U_ZERO_ERROR;
     body->setTime( fR - (nZoneOffset + nDSTOffset), status );
commit 28e07fa9ef737921857cf9941086c0425409b90b
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Dec 3 13:30:41 2019 +0100
Commit:     Thorsten Behrens <thorsten.behrens at allotropia.de>
CommitDate: Tue Apr 20 22:20:50 2021 +0200

    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 at redhat.com>
    (cherry picked from commit e8cb5f2e11838060f85e7940540b5f7096d9eeb7)

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;
commit 66e384f4ddfb9d3ac5eaccf3cf3b1923fb4d7a11
Author:     Thorsten Behrens <thorsten.behrens at allotropia.de>
AuthorDate: Tue Apr 20 21:08:50 2021 +0200
Commit:     Thorsten Behrens <thorsten.behrens at allotropia.de>
CommitDate: Tue Apr 20 21:43:38 2021 +0200

    Adjust various unit tests past-backports
    
    Change-Id: I44fac2793a62a8cd33b0d5c8b28c1db726960a77

diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
index a2d2ce3226ca..ac40c7db3fda 100644
--- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
@@ -18,6 +18,7 @@
  */
 
 #include "pdfioutdev_gpl.hxx"
+#include <o3tl/make_unique.hxx>
 #ifdef _WIN32
 # include <io.h>
 # include <fcntl.h>  /*_O_BINARY*/
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index aa013abc0901..65961db7bbcb 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -347,7 +347,7 @@ void PdfExportTest::testTdf105461()
             continue;
 
         unsigned int nRed = 0, nGreen = 0, nBlue = 0, nAlpha = 0;
-        FPDFPath_GetFillColor(pPdfPageObject, &nRed, &nGreen, &nBlue, &nAlpha);
+        FPDFPageObj_GetFillColor(pPdfPageObject, &nRed, &nGreen, &nBlue, &nAlpha);
         if (Color(nRed, nGreen, nBlue) == COL_YELLOW)
             ++nYellowPathCount;
     }
@@ -402,7 +402,7 @@ void PdfExportTest::testTdf107868()
             continue;
 
         unsigned int nRed = 0, nGreen = 0, nBlue = 0, nAlpha = 0;
-        FPDFPath_GetFillColor(pPdfPageObject, &nRed, &nGreen, &nBlue, &nAlpha);
+        FPDFPageObj_GetFillColor(pPdfPageObject, &nRed, &nGreen, &nBlue, &nAlpha);
         if (Color(nRed, nGreen, nBlue) == COL_WHITE)
             ++nWhitePathCount;
     }
@@ -896,7 +896,7 @@ void PdfExportTest::testTdf108963()
             continue;
 
         unsigned int nRed = 0, nGreen = 0, nBlue = 0, nAlpha = 0;
-        FPDFPath_GetFillColor(pPdfPageObject, &nRed, &nGreen, &nBlue, &nAlpha);
+        FPDFPageObj_GetFillColor(pPdfPageObject, &nRed, &nGreen, &nBlue, &nAlpha);
         if (Color(nRed, nGreen, nBlue) == COL_YELLOW)
         {
             ++nYellowPathCount;
diff --git a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
index dc01c5c74d37..55e548112f9d 100644
--- a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
+++ b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
@@ -46,6 +46,8 @@ protected:
      * had nOriginalSignatureCount signatures.
      */
     bool sign(const OUString& rInURL, const OUString& rOutURL, size_t nOriginalSignatureCount);
+
+public:
     /**
      * Read a pdf and make sure that it has the expected number of valid
      * signatures.
@@ -53,7 +55,6 @@ protected:
     std::vector<SignatureInformation> verify(const OUString& rURL, size_t nCount,
                                              const OString& rExpectedSubFilter);
 
-public:
     PDFSigningTest();
     void setUp() override;
 


More information about the Libreoffice-commits mailing list