Kaydet (Commit) c00690d2 authored tarafından Ravindra Vidhate's avatar Ravindra Vidhate Kaydeden (comit) Miklos Vajna

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/9286Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst f4dd7d54
......@@ -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.
......
......@@ -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" );
......
......@@ -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.
......
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment