[Libreoffice-commits] core.git: sw/qa sw/source

YogeshBharate yogesh.bharate at synerzip.com
Wed Feb 26 01:25:25 PST 2014


 sw/qa/extras/ooxmlexport/data/footer-contain-hyperlink.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx                    |   12 ++++++++++++
 sw/source/filter/ww8/wrtw8nds.cxx                           |    2 +-
 3 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 4654e9b113a66c800161d0ee82d587055fff4f8b
Author: YogeshBharate <yogesh.bharate at synerzip.com>
Date:   Fri Jan 31 16:31:01 2014 +0530

    fdo#74271: Added unit test & code changes for footer contains hyperlink.
    
    Problem description:
    - If the document contains a hyperlink in footer
      that starts with "www" (ex. www.google.com) then
      the footer1.xml.rels of the roundtrip file contains
      empty Target.
    - Since the target is empty, the file get corrupted in MS Office 2007.
    
    Implementation:
    - If hyperlink starts with "www" then make bSmart as true.
    
    Change-Id: Ifa2b587d3326152b2d9778bd818fbe68b1cf6410
    Reviewed-on: https://gerrit.libreoffice.org/7766
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/qa/extras/ooxmlexport/data/footer-contain-hyperlink.docx b/sw/qa/extras/ooxmlexport/data/footer-contain-hyperlink.docx
new file mode 100644
index 0000000..27b00ed
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/footer-contain-hyperlink.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 324838e..194b7c6 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3629,6 +3629,18 @@ DECLARE_OOXMLEXPORT_TEST(testW14TextEffects_TextOutline, "TextEffects_TextOutlin
     assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:rPr/w14:textOutline/w14:bevel", 1);
 }
 
+DECLARE_OOXMLEXPORT_TEST(testFooterContainHyperlink,"footer-contain-hyperlink.docx")
+{
+    // Problem is that footer1.xml.rels contains the empty
+    // Target due to which the file get corrupted
+    // in MS Office 2007.
+    // Check for footer1.xml.rels file.
+    xmlDocPtr pXmlRels = parseExport("word/_rels/footer1.xml.rels");
+    if (!pXmlRels)
+        return;
+    // Check the value of Target which is http://www.google.com/.
+    assertXPath(pXmlRels,"/rels:Relationships/rels:Relationship","Target","http://www.google.com/");
+}
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 645b82f..29da65d 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -810,7 +810,7 @@ bool AttributeOutputBase::AnalyzeURL( const OUString& rUrl, const OUString& /*rT
     }
     else
     {
-        INetURLObject aURL( rUrl );
+        INetURLObject aURL( rUrl, INET_PROT_NOT_VALID );
         sURL = aURL.GetURLNoMark( INetURLObject::DECODE_UNAMBIGUOUS );
         sMark = aURL.GetMark( INetURLObject::DECODE_UNAMBIGUOUS );
     }


More information about the Libreoffice-commits mailing list