svgio/qa/cppunit/SvgImportTest.cxx  |   22 ++++++++++++++++++++++
 svgio/qa/cppunit/data/tdf149880.svg |   11 +++++++++++
 svgio/source/svgreader/svgtools.cxx |   13 +++++++++++--
 translations                        |    2 +-
 4 files changed, 45 insertions(+), 3 deletions(-)

New commits:
commit 460d3689956410d8e2d03cf3fe29ab570e24e865
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Wed Jul 6 16:52:38 2022 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Jul 6 21:30:46 2022 +0200

    tdf#149880: handle url when it's inside the quotation marks
    
    Change-Id: I053323f9b48c8856d520095da0a4768ac03b0176
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136847
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    (cherry picked from commit babb5858957292ac31921c3253c039ca9d0fce14)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136859

diff --git a/svgio/qa/cppunit/SvgImportTest.cxx 
b/svgio/qa/cppunit/SvgImportTest.cxx
index 4b5af1e54d84..5c041ac3b386 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -70,6 +70,7 @@ class Test : public test::BootstrapFixture, public 
XmlTestTools
     void testTdf94765();
     void testBehaviourWhenWidthAndHeightIsOrIsNotSet();
     void testTdf97663();
+    void testTdf149880();
     void testCssClassRedefinition();
 
     Primitive2DSequence parseSvg(std::u16string_view aSource);
@@ -107,6 +108,7 @@ public:
     CPPUNIT_TEST(testTdf94765);
     CPPUNIT_TEST(testBehaviourWhenWidthAndHeightIsOrIsNotSet);
     CPPUNIT_TEST(testTdf97663);
+    CPPUNIT_TEST(testTdf149880);
     CPPUNIT_TEST(testCssClassRedefinition);
     CPPUNIT_TEST_SUITE_END();
 };
@@ -835,6 +837,26 @@ void Test::testTdf97663()
     assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "y", 
"236");
 }
 
+void Test::testTdf149880()
+{
+    Primitive2DSequence aSequence = 
parseSvg(u"/svgio/qa/cppunit/data/tdf149880.svg");
+    CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence.getLength()));
+
+    drawinglayer::Primitive2dXmlDump dumper;
+    xmlDocUniquePtr pDocument = 
dumper.dumpAndParse(Primitive2DContainer(aSequence));
+
+    CPPUNIT_ASSERT (pDocument);
+
+    // Without the fix in place, this test would have failed with
+    // - Expected: 1
+    // - Actual  : 0
+    // - In <>, XPath '/primitive2D/transform/mask/unhandled' number of nodes 
is incorrect
+    assertXPath(pDocument,
+            "/primitive2D/transform/mask/unhandled", "id", "PATTERNFILL");
+    assertXPath(pDocument,
+            
"/primitive2D/transform/mask/unhandled/mask/transform/transform/bitmap", 28);
+}
+
 void Test::testCssClassRedefinition()
 {
     // Tests for svg css class redefinition behavior
diff --git a/svgio/qa/cppunit/data/tdf149880.svg 
b/svgio/qa/cppunit/data/tdf149880.svg
new file mode 100644
index 000000000000..08ba748487cb
--- /dev/null
+++ b/svgio/qa/cppunit/data/tdf149880.svg
@@ -0,0 +1,11 @@
+<?xml version="1.0" standalone="no"?>
+<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"; version="1.1">
+  <defs>
+    <pattern id="Pattern" x=".05" y=".05" width=".25" height=".25">
+      <rect x="0" y="0" width="50" height="50" fill="skyblue"/>
+    </pattern>
+
+  </defs>
+
+  <rect fill='url("#Pattern")' stroke="black" x="0" y="0" width="200" 
height="200"/>
+</svg>
diff --git a/svgio/source/svgreader/svgtools.cxx 
b/svgio/source/svgreader/svgtools.cxx
index 9ba7f1d47952..4ae287784d8c 100644
--- a/svgio/source/svgreader/svgtools.cxx
+++ b/svgio/source/svgreader/svgtools.cxx
@@ -1072,9 +1072,18 @@ namespace svgio::svgreader
                 const sal_Int32 nLen(rCandidate.getLength());
                 sal_Int32 nPos(strlen(aStrUrl));
 
-                skip_char(rCandidate, '(', '#', nPos, nLen);
+                skip_char(rCandidate, '(', nPos, nLen);
+                sal_Unicode aLimiter(')');
+
+                if('"' == rCandidate[nPos])
+                    aLimiter = '"';
+
+                skip_char(rCandidate, '"', nPos, nLen);
+                skip_char(rCandidate, '#', nPos, nLen);
                 OUStringBuffer aTokenValue;
-                copyToLimiter(rCandidate, ')', nPos, aTokenValue, nLen);
+
+                copyToLimiter(rCandidate, aLimiter, nPos, aTokenValue, nLen);
+
                 rURL = aTokenValue.makeStringAndClear();
 
                 return true;
commit ce344a6ec4fe673c455e561997cf22907e8a72b7
Author:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
AuthorDate: Wed Jul 6 21:30:39 2022 +0200
Commit:     Gerrit Code Review <ger...@gerrit.libreoffice.org>
CommitDate: Wed Jul 6 21:30:39 2022 +0200

    Update git submodules
    
    * Update translations from branch 'libreoffice-7-4'
      to 94ba1b5ac10372c2ffc7eef23dfc942766dc2d26
      - update translations for 7.4.0 rc1/master
    
        and force-fix errors using pocheck
    
        Change-Id: I85614e5c08b7f31ebf654b85a50cf3b56c373d91
        (cherry picked from commit c2687d2f197c096563b19920262ded8ed15d2630)

diff --git a/translations b/translations
index 4c43098f7c9a..94ba1b5ac103 160000
--- a/translations
+++ b/translations
@@ -1 +1 @@
-Subproject commit 4c43098f7c9a2a86daeb5b5a7a3849f0fb550d55
+Subproject commit 94ba1b5ac10372c2ffc7eef23dfc942766dc2d26

Reply via email to