[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - 3 commits - filter/source sd/qa svx/source sw/qa sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Mar 5 22:39:24 UTC 2019


 filter/source/svg/svgexport.cxx                 |   20 +++++++++++++-------
 sd/qa/unit/SVGExportTests.cxx                   |   15 +++++++++++++++
 sd/qa/unit/data/odp/textbox-link-javascript.odp |binary
 svx/source/xml/xmlgrhlp.cxx                     |    1 +
 sw/qa/extras/ooxmlexport/data/tdf123705.docx    |binary
 sw/qa/extras/ooxmlexport/ooxmlexport8.cxx       |    4 ++++
 sw/source/filter/ww8/docxattributeoutput.cxx    |    3 +++
 7 files changed, 36 insertions(+), 7 deletions(-)

New commits:
commit 6f696fd39cabfe212b60152ff11126817d77b89d
Author:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Mon Mar 4 09:38:02 2019 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Mar 5 23:38:43 2019 +0100

    Check svg URLs before exporting
    
    Reviewed-on: https://gerrit.libreoffice.org/68668
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    (cherry picked from commit 34ec46571701d639d9bc542b2d19f87a21a83648)
    
    Change-Id: I3b86b6b82318b0d201c3d7db516664520eb47bed

diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 87fbbdee425d..e78f546a0c1b 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -49,6 +49,7 @@
 #include <comphelper/sequenceashashmap.hxx>
 #include <i18nlangtag/lang.h>
 #include <svl/zforlist.hxx>
+#include <tools/urlobj.hxx>
 #include <xmloff/unointerfacetouniqueidentifiermapper.hxx>
 #include <xmloff/nmspmap.hxx>
 #include <xmloff/xmlnmspe.hxx>
@@ -1957,13 +1958,18 @@ bool SVGFilter::implExportShape( const Reference< XShape >& rxShape, bool bMaste
 
                         if( !aBookmark.isEmpty() )
                         {
-                            mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xlink:href", aBookmark);
-                            SvXMLElementExport alinkA( *mpSVGExport, XML_NAMESPACE_NONE, "a", true, true );
-                            mpSVGWriter->WriteMetaFile( aTopLeft, aSize, rMtf,
-                                                        0xffffffff,
-                                                        pElementId,
-                                                        &rxShape,
-                                                        pEmbeddedBitmapsMtf );
+                            INetURLObject aINetURLObject(aBookmark);
+                            if (!aINetURLObject.HasError()
+                                && aINetURLObject.GetProtocol() != INetProtocol::Javascript)
+                            {
+                                mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xlink:href", aBookmark);
+                                SvXMLElementExport alinkA( *mpSVGExport, XML_NAMESPACE_NONE, "a", true, true );
+                                mpSVGWriter->WriteMetaFile( aTopLeft, aSize, rMtf,
+                                                            0xffffffff,
+                                                            pElementId,
+                                                            &rxShape,
+                                                            pEmbeddedBitmapsMtf );
+                            }
                         }
                         else
                         {
diff --git a/sd/qa/unit/SVGExportTests.cxx b/sd/qa/unit/SVGExportTests.cxx
index 9afc5cb42a01..400d604e786c 100644
--- a/sd/qa/unit/SVGExportTests.cxx
+++ b/sd/qa/unit/SVGExportTests.cxx
@@ -110,8 +110,23 @@ public:
         assertXPath(svgDoc, MAKE_PATH_STRING( /SVG_SVG/SVG_G[2]/SVG_G/SVG_G/SVG_G/SVG_G/SVG_G[2]/SVG_G/SVG_TEXT/SVG_TSPAN ), "text-decoration", "line-through");
     }
 
+    void testSVGExportJavascriptURL()
+    {
+        executeExport("textbox-link-javascript.odp");
+
+        xmlDocPtr svgDoc = parseXml(maTempFile);
+        CPPUNIT_ASSERT(svgDoc);
+
+        // There should be only one child (no link to javascript url)
+        assertXPathChildren(svgDoc,
+                            MAKE_PATH_STRING(/ SVG_SVG / SVG_G[2] / SVG_G / SVG_G / SVG_G / SVG_G
+                                             / SVG_G[4] / SVG_G),
+                            1);
+    }
+
     CPPUNIT_TEST_SUITE(SdSVGFilterTest);
     CPPUNIT_TEST(testSVGExportTextDecorations);
+    CPPUNIT_TEST(testSVGExportJavascriptURL);
     CPPUNIT_TEST_SUITE_END();
 };
 
diff --git a/sd/qa/unit/data/odp/textbox-link-javascript.odp b/sd/qa/unit/data/odp/textbox-link-javascript.odp
new file mode 100644
index 000000000000..c046cf0c7de5
Binary files /dev/null and b/sd/qa/unit/data/odp/textbox-link-javascript.odp differ
commit 03e349cbc8117a9b0c5f5b5ad7f2b7fe28a27f6a
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Tue Feb 26 19:06:59 2019 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Mar 5 23:38:43 2019 +0100

    tdf#123705: avoid duplicate themeColor
    
    See http://bugs.documentfoundation.org/attachment.cgi?id=149585
    + https://bugs.documentfoundation.org/show_bug.cgi?id=123705#c4
    
    Change-Id: I3c6fb0a1ac46a62c75bb9daeaded1633889416eb
    Reviewed-on: https://gerrit.libreoffice.org/68398
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
    (cherry picked from commit 42398e3860aafd6468688eda6c0da942323b7f82)

diff --git a/sw/qa/extras/ooxmlexport/data/tdf123705.docx b/sw/qa/extras/ooxmlexport/data/tdf123705.docx
new file mode 100644
index 000000000000..46e053fd464e
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf123705.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
index f5a8b95e1737..e647a19052b3 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
@@ -981,6 +981,10 @@ DECLARE_OOXMLEXPORT_TEST(testN830205, "n830205.docx")
     getParagraph(1, "XXX");
 }
 
+DECLARE_OOXMLEXPORT_TEST(tdf123705, "tdf123705.docx")
+{
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTableAutoColumnFixedSize, "table-auto-column-fixed-size.docx")
 {
     uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index a1629f0d7210..f9d79b09d637 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2725,6 +2725,8 @@ void DocxAttributeOutput::Redline( const SwRedlineData* pRedlineData)
                     // we are done exporting the redline attributes.
                     rtl::Reference<sax_fastparser::FastAttributeList> pFontsAttrList_Original(m_pFontsAttrList);
                     m_pFontsAttrList.clear();
+                    rtl::Reference<sax_fastparser::FastAttributeList> pColorAttrList_Original(m_pColorAttrList);
+                    m_pColorAttrList.clear();
                     rtl::Reference<sax_fastparser::FastAttributeList> pEastAsianLayoutAttrList_Original(m_pEastAsianLayoutAttrList);
                     m_pEastAsianLayoutAttrList.clear();
                     rtl::Reference<sax_fastparser::FastAttributeList> pCharLangAttrList_Original(m_pCharLangAttrList);
@@ -2738,6 +2740,7 @@ void DocxAttributeOutput::Redline( const SwRedlineData* pRedlineData)
 
                     // Revert back the original values that were stored in 'm_pFontsAttrList', 'm_pEastAsianLayoutAttrList', 'm_pCharLangAttrList'
                     m_pFontsAttrList = pFontsAttrList_Original;
+                    m_pColorAttrList = pColorAttrList_Original;
                     m_pEastAsianLayoutAttrList = pEastAsianLayoutAttrList_Original;
                     m_pCharLangAttrList = pCharLangAttrList_Original;
 
commit 043c4e9ebf8beb7733d4f08988299b8b3d7cb31e
Author:     Bartosz Kosiorek <gang65 at poczta.onet.pl>
AuthorDate: Mon Mar 4 23:46:52 2019 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Mar 5 23:38:43 2019 +0100

    tdf#123452 EMF Re-enable compression for image/x-emf files
    
    Change-Id: I9fd801d5eef6c65f8e68e30723415da7b493d767
    Reviewed-on: https://gerrit.libreoffice.org/68716
    Tested-by: Jenkins
    Reviewed-by: László Németh <nemeth at numbertext.org>
    (cherry picked from commit df22e97db5b7608b6d53b15b86b5a83610f9c87b)

diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index 64c272bbbe72..38be563ba9c6 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -521,6 +521,7 @@ bool SvXMLGraphicHelper::ImplWriteGraphic( const OUString& rPictureStorageName,
             static const char* aCompressiblePics[] =
             {
                 "image/svg+xml",
+                "image/x-emf",
                 "image/x-wmf",
                 "image/tiff",
                 "image/x-eps",


More information about the Libreoffice-commits mailing list