summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRavindra Vidhate <ravindra.vidhate@synerzip.com>2014-05-08 20:32:56 +0530
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-05-13 08:18:16 +0000
commitc00690d2e579607bb0d8a3582580bd875225bffb (patch)
treed5dfdcf3f804fc0a0ce9f5696758c48be90b81cb
parentf4dd7d548ea80c00aed02e10dd8f27d324dd5855 (diff)
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@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--sw/qa/extras/ooxmlexport/data/fdo78420.docxbin0 -> 687154 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx15
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx5
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.hxx1
-rw-r--r--sw/source/filter/ww8/docxexport.cxx4
5 files changed, 25 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/fdo78420.docx b/sw/qa/extras/ooxmlexport/data/fdo78420.docx
new file mode 100644
index 000000000000..6b253b189f5c
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/fdo78420.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index e2c7e5867b13..4919d01f05cf 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 e969c0c8f07d..c84d2e65e7d4 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 ba26fbaa4a2b..81305ba155c5 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 c3a6ddf93678..f8500e4b6573 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 );