compilerplugins/clang/redundantfcast.cxx         |    4 +++
 writerperfect/qa/unit/EPUBExportTest.cxx         |   26 +++++++++++------------
 writerperfect/source/writer/EPUBExportFilter.cxx |    4 +--
 writerperfect/source/writer/EPUBPackage.cxx      |    2 -
 writerperfect/source/writer/exp/xmlimp.cxx       |    5 ++--
 5 files changed, 23 insertions(+), 18 deletions(-)

New commits:
commit 64106353c98e8cb0c99c9e4ff509348edf8ed911
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Mon May 2 14:31:03 2022 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Mon May 2 22:01:00 2022 +0200

    Just use Any ctor instead of makeAny in writerperfect
    
    (which needs one more false loplugin:redundantfcast suppression case)
    
    Change-Id: Ib8a72a510384f497bddaef5b812a46ea473481d7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133703
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/compilerplugins/clang/redundantfcast.cxx 
b/compilerplugins/clang/redundantfcast.cxx
index e78f2cf976ab..38a7daf9fff7 100644
--- a/compilerplugins/clang/redundantfcast.cxx
+++ b/compilerplugins/clang/redundantfcast.cxx
@@ -180,6 +180,10 @@ public:
 
             if (m_Seen.insert(arg->getExprLoc()).second)
             {
+                if (suppressWarningAt(arg->getBeginLoc()))
+                {
+                    continue;
+                }
                 report(DiagnosticsEngine::Warning,
                        "redundant functional cast from %0 to %1 in construct 
expression",
                        arg->getExprLoc())
diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index 15e70733dda5..71bf41130a9c 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -215,7 +215,7 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, testEPUB2)
 {
     uno::Sequence<beans::PropertyValue> 
aFilterData(comphelper::InitPropertySequence(
         { // Explicitly request EPUB2.
-          { "EPUBVersion", uno::makeAny(static_cast<sal_Int32>(20)) } }));
+          { "EPUBVersion", uno::Any(static_cast<sal_Int32>(20)) } }));
     createDoc(u"hello.fodt", aFilterData);
 
     mpXmlDoc = parseExport("OEBPS/content.opf");
@@ -228,7 +228,7 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, testEPUBFixedLayout)
     uno::Sequence<beans::PropertyValue> 
aFilterData(comphelper::InitPropertySequence(
         { // Explicitly request fixed layout.
           { "EPUBLayoutMethod",
-            
uno::makeAny(static_cast<sal_Int32>(libepubgen::EPUB_LAYOUT_METHOD_FIXED)) } 
}));
+            
uno::Any(static_cast<sal_Int32>(libepubgen::EPUB_LAYOUT_METHOD_FIXED)) } }));
     createDoc(u"hello.fodt", aFilterData);
 
     mpXmlDoc = parseExport("OEBPS/content.opf");
@@ -254,7 +254,7 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, 
testEPUBFixedLayoutImplicitBreak)
     uno::Sequence<beans::PropertyValue> 
aFilterData(comphelper::InitPropertySequence(
         { // Explicitly request fixed layout.
           { "EPUBLayoutMethod",
-            
uno::makeAny(static_cast<sal_Int32>(libepubgen::EPUB_LAYOUT_METHOD_FIXED)) } 
}));
+            
uno::Any(static_cast<sal_Int32>(libepubgen::EPUB_LAYOUT_METHOD_FIXED)) } }));
     createDoc(u"fxl-2page.fodt", aFilterData);
 
     CPPUNIT_ASSERT(mxZipFile->hasByName("OEBPS/sections/section0001.xhtml"));
@@ -275,7 +275,7 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, testPageBreakSplit)
     uno::Sequence<beans::PropertyValue> 
aFilterData(comphelper::InitPropertySequence(
         { // Explicitly request split on page break (instead of on heading).
           { "EPUBSplitMethod",
-            
uno::makeAny(static_cast<sal_Int32>(libepubgen::EPUB_SPLIT_METHOD_PAGE_BREAK)) 
} }));
+            
uno::Any(static_cast<sal_Int32>(libepubgen::EPUB_SPLIT_METHOD_PAGE_BREAK)) } 
}));
     createDoc(u"2pages.fodt", aFilterData);
 
     // Make sure that the output is split into two.
@@ -345,11 +345,11 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, testMetaXMP)
 CPPUNIT_TEST_FIXTURE(EPUBExportTest, testMetaAPI)
 {
     uno::Sequence<beans::PropertyValue> 
aFilterData(comphelper::InitPropertySequence(
-        { { "RVNGIdentifier", 
uno::makeAny(OUString("deadc0de-e394-4cd6-9b83-7172794612e5")) },
-          { "RVNGTitle", uno::makeAny(OUString("unknown title from api")) },
-          { "RVNGInitialCreator", uno::makeAny(OUString("unknown author from 
api")) },
-          { "RVNGLanguage", uno::makeAny(OUString("hu")) },
-          { "RVNGDate", uno::makeAny(OUString("2015-11-20T17:16:07Z")) } }));
+        { { "RVNGIdentifier", 
uno::Any(OUString("deadc0de-e394-4cd6-9b83-7172794612e5")) },
+          { "RVNGTitle", uno::Any(OUString("unknown title from api")) },
+          { "RVNGInitialCreator", uno::Any(OUString("unknown author from 
api")) },
+          { "RVNGLanguage", uno::Any(OUString("hu")) },
+          { "RVNGDate", uno::Any(OUString("2015-11-20T17:16:07Z")) } }));
     createDoc(u"meta-xmp.fodt", aFilterData);
     mpXmlDoc = parseExport("OEBPS/content.opf");
 
@@ -367,7 +367,7 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, testCoverImage)
 {
     OUString aCoverURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"meta.cover-image.png";
     uno::Sequence<beans::PropertyValue> aFilterData(
-        comphelper::InitPropertySequence({ { "RVNGCoverImage", 
uno::makeAny(aCoverURL) } }));
+        comphelper::InitPropertySequence({ { "RVNGCoverImage", 
uno::Any(aCoverURL) } }));
     createDoc(u"hello.fodt", aFilterData);
     mpXmlDoc = parseExport("OEBPS/content.opf");
 
@@ -755,7 +755,7 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, testPopupAPI)
     // Make sure that the popup works with data from a media directory.
     OUString aMediaDir = m_directories.getURLFromSrc(DATA_DIRECTORY) + "popup";
     uno::Sequence<beans::PropertyValue> aFilterData(
-        comphelper::InitPropertySequence({ { "RVNGMediaDir", 
uno::makeAny(aMediaDir) } }));
+        comphelper::InitPropertySequence({ { "RVNGMediaDir", 
uno::Any(aMediaDir) } }));
     createDoc(u"popup-api.odt", aFilterData);
 
     // We have a non-empty anchor image.
@@ -773,7 +773,7 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, testPageSize)
 {
     uno::Sequence<beans::PropertyValue> 
aFilterData(comphelper::InitPropertySequence(
         { { "EPUBLayoutMethod",
-            
uno::makeAny(static_cast<sal_Int32>(libepubgen::EPUB_LAYOUT_METHOD_FIXED)) } 
}));
+            
uno::Any(static_cast<sal_Int32>(libepubgen::EPUB_LAYOUT_METHOD_FIXED)) } }));
     createDoc(u"hello.fodt", aFilterData);
 
     // This failed, viewport was empty, so page size was lost.
@@ -792,7 +792,7 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, testSVG)
 {
     uno::Sequence<beans::PropertyValue> 
aFilterData(comphelper::InitPropertySequence(
         { { "EPUBLayoutMethod",
-            
uno::makeAny(static_cast<sal_Int32>(libepubgen::EPUB_LAYOUT_METHOD_FIXED)) } 
}));
+            
uno::Any(static_cast<sal_Int32>(libepubgen::EPUB_LAYOUT_METHOD_FIXED)) } }));
     createDoc(u"hello.fodt", aFilterData);
 
     CPPUNIT_ASSERT(mxZipFile->hasByName("OEBPS/images/image0001.svg"));
diff --git a/writerperfect/source/writer/EPUBExportFilter.cxx 
b/writerperfect/source/writer/EPUBExportFilter.cxx
index 129d2941c795..cdd7d1d2cb82 100644
--- a/writerperfect/source/writer/EPUBExportFilter.cxx
+++ b/writerperfect/source/writer/EPUBExportFilter.cxx
@@ -111,9 +111,9 @@ sal_Bool EPUBExportFilter::filter(const 
uno::Sequence<beans::PropertyValue>& rDe
             { OUString(), 0, uno::Type(), 0, 0 } };
     uno::Reference<beans::XPropertySet> xInfoSet(
         comphelper::GenericPropertySet_CreateInstance(new 
comphelper::PropertySetInfo(aInfoMap)));
-    xInfoSet->setPropertyValue("BaseURI", uno::makeAny(aSourceURL));
+    xInfoSet->setPropertyValue("BaseURI", uno::Any(aSourceURL));
 
-    xInitialization->initialize({ uno::makeAny(xExportHandler), 
uno::makeAny(xInfoSet) });
+    xInitialization->initialize({ uno::Any(xExportHandler), uno::Any(xInfoSet) 
});
     uno::Reference<document::XExporter> xExporter(xInitialization, 
uno::UNO_QUERY);
     xExporter->setSourceDocument(mxSourceDocument);
     uno::Reference<document::XFilter> xFilter(xInitialization, uno::UNO_QUERY);
diff --git a/writerperfect/source/writer/EPUBPackage.cxx 
b/writerperfect/source/writer/EPUBPackage.cxx
index 476c3a94625a..727a8ed7e3de 100644
--- a/writerperfect/source/writer/EPUBPackage.cxx
+++ b/writerperfect/source/writer/EPUBPackage.cxx
@@ -52,7 +52,7 @@ 
EPUBPackage::EPUBPackage(uno::Reference<uno::XComponentContext> xContext,
 
     // MIME type must be uncompressed.
     uno::Reference<beans::XPropertySet> xPropertySet(mxOutputStream, 
uno::UNO_QUERY);
-    xPropertySet->setPropertyValue("Compressed", uno::makeAny(false));
+    xPropertySet->setPropertyValue("Compressed", uno::Any(false));
     mxOutputStream.clear();
 }
 
diff --git a/writerperfect/source/writer/exp/xmlimp.cxx 
b/writerperfect/source/writer/exp/xmlimp.cxx
index 3efd6eab7ddd..ae7b33518eed 100644
--- a/writerperfect/source/writer/exp/xmlimp.cxx
+++ b/writerperfect/source/writer/exp/xmlimp.cxx
@@ -286,8 +286,9 @@ void XMLOfficeDocContext::HandleFixedLayoutPage(const 
FixedLayoutPage& rPage, bo
     if (!xSaxWriter.is())
         return;
 
-    uno::Sequence<uno::Any> aArguments = { 
uno::makeAny<uno::Sequence<beans::PropertyValue>>(
-        { comphelper::makePropertyValue("DTDString", false) }) };
+    // [-loplugin:redundantfcast] false positive:
+    uno::Sequence<uno::Any> aArguments = { 
uno::Any(uno::Sequence<beans::PropertyValue>(
+        { comphelper::makePropertyValue("DTDString", false) })) };
     uno::Reference<svg::XSVGWriter> xSVGWriter(
         xCtx->getServiceManager()->createInstanceWithArgumentsAndContext(
             "com.sun.star.svg.SVGWriter", aArguments, xCtx),

Reply via email to