From 2d93aee9bf614f8db176a34b04c20eb8ae3beb9e Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 17 Feb 2014 14:31:12 +0100 Subject: [PATCH] DOCX export: handle relative size of drawinglayer shapes Change-Id: If4548f7b7a530402158ce5f84febe4fe5eaf2184 --- .../ooxmlexport/data/dml-shape-relsize.docx | Bin 0 -> 15499 bytes sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 10 ++++++++ sw/source/filter/ww8/docxsdrexport.cxx | 23 ++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 sw/qa/extras/ooxmlexport/data/dml-shape-relsize.docx diff --git a/sw/qa/extras/ooxmlexport/data/dml-shape-relsize.docx b/sw/qa/extras/ooxmlexport/data/dml-shape-relsize.docx new file mode 100644 index 0000000000000000000000000000000000000000..80ae02e0267c995238b144a6cae263cbd9631774 GIT binary patch literal 15499 zcmeHubzEIpvhKm%-8Hzo1Shx#cZcBalHgA8;2PZB-95OwySu&9Jw122d*;6P{=awg zJ7*WLt0?MJt@>)!Dg|jUaC87902%-QkN{xFgZ+F#0Dve6000dD4XPz#YvW{Mt~8I+5~i8iN|i^b?vP(5#fYX z*GdJ%3TXdJ)!?I@%C7pen0pJ?C`Qudvt%mm7+o>WixAatM1=t>^d|Qt@e`(A?G-=d#lS3;^){4hB&8OXL#9 z;5J+X-BAu0m~g9R0b}-j++;tgx)Rce6htKbPvCI>TG=5wgNSV>W9cRbPDF(#^Ud z97;iBP%FjH3_*On(%i;&j`3qmeD=o(=8~MPnjj%^eo|A`%3STh!FJ{5XnaW+rSCDL zc()NH&Fup>YG5hJ`AZrI=4R)Dbpz@gdUJ?6oVY%)rsoSIp%{Zu2DXa~hBQ`^{SJ{9 z)VFlFR!kEg(qjxuVL3L;b7pTv-}SzG3>pw% zngc%lKl>_;la&u(`o}Uq)q<|76S-K8#lBclez`)g^d%tCsUPXB4WkBjI0uSB)-hOAN zw85`tyk(JomIWD>m27?+(4w2B*erRB-@un$w>E|z8oRf?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Df`=Jh|Bo0eXglGF5&3 zF49mQg2%l$aW`@;y>V8;*@q}HGtMylSV{v|J4J21{Hdv&h|y-4l)@l^X?!bZ#fa|w z;Sr}5YM+@rvWgfM56k37Y=;TmFrp`lnR30dx%R=Q9Jbm~_Q=GCjUBV^991L5&880t zzi5=Pe8}mb`j>T{7>gWOj>A(u&Lx?GaXoECh2K(klad{Zpg3|ATF7O}Ja-)Z2Ef-o zg)5N1zN3QUsfW(CrFkZUjk74bNciyatVivH}2b2^4*S2_;wQAhPn$w?P-sjZi|eB(D!+OPI4&`?e&@4LCj@GWEu2 zcm#Y1m_4E|TP|#Y=KjY%H3%p@a3B9aPgVZ&L;2_ZKg?JvNdHy9Ux&N?$@ts78Mr3? zY1HfQjDMYY`7`4h@EpwlZT{sqNrYg(^&endElementNS(XML_a, XML_graphicData); pFS->endElementNS(XML_a, XML_graphic); + // Relative size of the drawing. + if (pSdrObject->GetRelativeWidth()) + { + // At the moment drawinglayer objects are always relative from page. + pFS->startElementNS(XML_wp14, XML_sizeRelH, + XML_relativeFrom, "page", + FSEND); + pFS->startElementNS(XML_wp14, XML_pctWidth, FSEND); + pFS->writeEscaped(OUString::number(*pSdrObject->GetRelativeWidth() * 100 * oox::drawingml::PER_PERCENT)); + pFS->endElementNS(XML_wp14, XML_pctWidth); + pFS->endElementNS(XML_wp14, XML_sizeRelH); + } + if (pSdrObject->GetRelativeHeight()) + { + pFS->startElementNS(XML_wp14, XML_sizeRelV, + XML_relativeFrom, "page", + FSEND); + pFS->startElementNS(XML_wp14, XML_pctHeight, FSEND); + pFS->writeEscaped(OUString::number(*pSdrObject->GetRelativeHeight() * 100 * oox::drawingml::PER_PERCENT)); + pFS->endElementNS(XML_wp14, XML_pctHeight); + pFS->endElementNS(XML_wp14, XML_sizeRelV); + } + m_rSdrExport.endDMLAnchorInline(pFrmFmt); }