From 32ada80a9f47b095d7b0c4d16e3422f6ef7f2ac2 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 21 Feb 2014 12:57:57 +0100 Subject: [PATCH] DOCX export: make sure a graphic is only written once Even if it's referenced multiple times, because of mc:AlternateContent. Change-Id: Ie4cb0ec088d12be5421bac43113c8ae4636028e0 --- .../data/dml-picture-in-textframe.docx | Bin 0 -> 17252 bytes sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 11 +++++++++++ sw/source/filter/ww8/docxattributeoutput.cxx | 14 +++++++++++--- sw/source/filter/ww8/docxattributeoutput.hxx | 3 +++ 4 files changed, 25 insertions(+), 3 deletions(-) create mode 100755 sw/qa/extras/ooxmlexport/data/dml-picture-in-textframe.docx diff --git a/sw/qa/extras/ooxmlexport/data/dml-picture-in-textframe.docx b/sw/qa/extras/ooxmlexport/data/dml-picture-in-textframe.docx new file mode 100755 index 0000000000000000000000000000000000000000..7d5876108d732eae61709d6ca27d7d2286101d37 GIT binary patch literal 17252 zcmeIaWpo_LvM$f8Ic*0EiVNEiV6S+Kmq^&LO>2Y^>r8!0MH2r0H6RMfi;C}tR0Q4 z9d(r4Y>gbW>0GTW335PzDY5{-@Ad!p_#Z5RIwdJNU`E9D)O&o^wv<&r2m@Fch`!vo zkV~!R+Q~+*JjKs%Yn0J&$hx0?)=1#5TQq!3UlUXvg5{>Nu%8>(paCMb${uAmIq%v3 znL&yXKq+hlw_^!4=)QVfI&OOiKoP_qT_gd$>*N@QGX0Y5qPLP>vDY zd)a)|&P)b?GL6Wg_Wc?(KS_n~klxhev{xvQ#!X8nLW2WkTv;-VU-n@X)r0C#l#qDm z2wpa!2fL>0ULerbUTcHhx@?#yZJJSig*;!Csz4Qt1Z1-(e9|y&qMY7UZ&yk2=%nuA zi(v!J*8nX1#kB9ph==rtRHbrt^2Vw6MF_AX&==?0Wo{D*Z}NK6^inZDxl@j_86&f6 z>wDoF)ZqlPh|-C#UZx6ULN!C0EJRU0Hg!b@cQu_{+9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1CH3<&YfLW_e%hR$iZwgGK~>eSrM@g^-o5Az!z93G7O_T>K;3yaIQZ z(K2#rswvzZQ=?_XP~I1qZ$||v-9jU5`92}5G<~vIakGJGU}+Qg;Z7zH5PO5c6CrS~ zXn5LI=UX+cZm!8%qtEJ}d~6A3Y{zGGcKW`sfnwwBhn}V(-dQ%xUy8rZJ1(TTuYK6! z<;geEu(DRMcr5_q+;tV&zf*kqk0Jm8)4qpf{`o%u{{6%M`~DCA2p})@cYwd|K>j!3 zuY1qCcKu~P^6!Ly-eEmI2g1Y`Oa{^8f!Nzdy-|F#kpV zd&=MM9Q>Y*_9sN^dnD(Nw)~!(_B+JyQU5<7z7hTl;;%UXzmxwSaQl;7^L^{#KZW0Z zNBBMb^d~|z`M(+Xr(o3YIDcO;`V$2JAYlLi{@eP|@8rMFV(&QUd@F+<)QyUuHsH3hce70swIDFX{Kr4$S}l2Jrs@Ny-l# literal 0 HcmV?d00001 diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index c68d3dfaab83..025b27e2d84e 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2307,6 +2307,17 @@ DECLARE_OOXMLEXPORT_TEST(testDmlShapeRelsize, "dml-shape-relsize.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp14:sizeRelH", "relativeFrom", "margin"); } +DECLARE_OOXMLEXPORT_TEST(testDmlPictureInTextframe, "dml-picture-in-textframe.docx") +{ + if (!m_bExported) + return; + + uno::Reference xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), m_aTempFile.GetURL()); + CPPUNIT_ASSERT_EQUAL(true, bool(xNameAccess->hasByName("word/media/image1.gif"))); + // This was also true, image was written twice. + CPPUNIT_ASSERT_EQUAL(false, bool(xNameAccess->hasByName("word/media/image2.gif"))); +} + DECLARE_OOXMLEXPORT_TEST(testDmlGroupshapeRelsize, "dml-groupshape-relsize.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index afeb0573e071..ab71fd93075f 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -3020,10 +3020,18 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size else pGraphic = pOLENode->GetGraphic(); - m_rDrawingML.SetFS( m_pSerializer ); // to be sure that we write to the right stream - OUString aImageId = m_rDrawingML.WriteImage( *pGraphic ); + if (m_aRelIdCache.find(pGraphic) != m_aRelIdCache.end()) + // We already have a RelId for this Graphic. + aRelId = m_aRelIdCache[pGraphic]; + else + { + // Not in cache, then need to write it. + m_rDrawingML.SetFS( m_pSerializer ); // to be sure that we write to the right stream + OUString aImageId = m_rDrawingML.WriteImage( *pGraphic ); - aRelId = OUStringToOString( aImageId, RTL_TEXTENCODING_UTF8 ); + aRelId = OUStringToOString( aImageId, RTL_TEXTENCODING_UTF8 ); + m_aRelIdCache[pGraphic] = aRelId; + } nImageType = XML_embed; } diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index e25606deb4c6..47ce782b8443 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -824,6 +824,9 @@ private: bool m_setFootnote; + /// RelId <-> Graphic* cache, so that in case of alternate content, the same graphic only gets written once. + std::map m_aRelIdCache; + public: DocxAttributeOutput( DocxExport &rExport, ::sax_fastparser::FSHelperPtr pSerializer, oox::drawingml::DrawingML* pDrawingML );