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

Ravindra Vidhate ravindra.vidhate at synerzip.com
Tue May 13 01:18:48 PDT 2014


 sw/qa/extras/ooxmlexport/data/fdo78420.docx  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx     |   15 +++++++++++++++
 sw/source/filter/ww8/docxattributeoutput.cxx |    5 +++++
 sw/source/filter/ww8/docxattributeoutput.hxx |    1 +
 sw/source/filter/ww8/docxexport.cxx          |    4 ++++
 5 files changed, 25 insertions(+)

New commits:
commit c00690d2e579607bb0d8a3582580bd875225bffb
Author: Ravindra Vidhate <ravindra.vidhate at synerzip.com>
Date:   Thu May 8 20:32:56 2014 +0530

    fdo#78420  File is getting corrupted after exported from LO.
    
    It is not creating .rels file for Header3.xml. While the Header3.xml contains the images.
    
    Change-Id: I3d1eb187eaf23fc05783fbfd3576d9a585de791f
    Reviewed-on: https://gerrit.libreoffice.org/9286
    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/fdo78420.docx b/sw/qa/extras/ooxmlexport/data/fdo78420.docx
new file mode 100644
index 0000000..6b253b1
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo78420.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index e2c7e58..4919d01 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3283,6 +3283,21 @@ DECLARE_OOXMLEXPORT_TEST(testContentTypeOLE, "fdo77759.docx")
                 "/word/embeddings/oleObject1.xlsx");
 }
 
+DECLARE_OOXMLEXPORT_TEST(testfdo78420, "fdo78420.docx")
+{
+    xmlDocPtr pXmlHeader = parseExport("word/header3.xml");
+
+    if (!pXmlHeader)
+       return;
+
+    xmlDocPtr pXmlHeaderRels = parseExport("word/_rels/header3.xml.rels");
+    if(!pXmlHeaderRels)
+       return;
+
+    assertXPath(pXmlHeaderRels,"/rels:Relationships/rels:Relationship[1]","Id","rId1");
+}
+
+
 DECLARE_OOXMLEXPORT_TEST(testPageBreakInFirstPara,"fdo77727.docx")
 {
     /* Break to next page was not exported if it is in first paragraph of the section.
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index e969c0c..c84d2e6 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3567,6 +3567,11 @@ void DocxAttributeOutput::WriteSrcRect(const SdrObject* pSdrObj )
     }
 }
 
+void DocxAttributeOutput::ClearGraphicCache()
+{
+    m_aRelIdCache.clear();
+}
+
 void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size& rSize, const SwFlyFrmFmt* pOLEFrmFmt, SwOLENode* pOLENode, const SdrObject* pSdrObj )
 {
     OSL_TRACE( "TODO DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size& rSize, const SwFlyFrmFmt* pOLEFrmFmt, SwOLENode* pOLENode, const SdrObject* pSdrObj  ) - some stuff still missing" );
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index ba26fba..81305ba 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -358,6 +358,7 @@ public:
 
     void WriteBookmarks_Impl( std::vector< OUString >& rStarts, std::vector< OUString >& rEnds );
     void WriteAnnotationMarks_Impl( std::vector< OUString >& rStarts, std::vector< OUString >& rEnds );
+    void ClearGraphicCache();
 
 private:
     /// Initialize the structures where we are going to collect some of the paragraph properties.
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index c3a6ddf..f8500e4 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -711,6 +711,10 @@ void DocxExport::WriteHeaderFooter( const SwFmt& rFmt, bool bHeader, const char*
     // do the work
     WriteHeaderFooterText( rFmt, bHeader );
 
+    //When the stream changes the cache which is maintained for the graphics in case of alternate content is not cleared.
+    //So clearing the alternate content graphic cache.
+    m_pAttrOutput->ClearGraphicCache();
+
     // switch the serializer back
     m_pAttrOutput->SetSerializer( m_pDocumentFS );
     m_pVMLExport->SetFS( m_pDocumentFS );


More information about the Libreoffice-commits mailing list