From e86a602df7540d491dbfd6a61571bd128b0d0ca4 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 10 Feb 2014 11:55:01 +0100 Subject: [PATCH] drawingML import: handle RelativeWidth/Height for drawinglayer shapes This was already handled in the VML importer previously. Change-Id: Ie04ed0cec632222c5f6481943ad7f4db66a752e5 --- .../ooxmlexport/data/dml-rectangle-relsize.docx | Bin 0 -> 14807 bytes sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 7 +++++++ sw/source/core/layout/anchoreddrawobject.cxx | 2 +- writerfilter/source/dmapper/GraphicImport.cxx | 13 +++++-------- 4 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 sw/qa/extras/ooxmlexport/data/dml-rectangle-relsize.docx diff --git a/sw/qa/extras/ooxmlexport/data/dml-rectangle-relsize.docx b/sw/qa/extras/ooxmlexport/data/dml-rectangle-relsize.docx new file mode 100644 index 0000000000000000000000000000000000000000..391d737bf1247fa2849df12bdbca43f9a7f152dd GIT binary patch literal 14807 zcmeHu1y>zQv-ZZ_-Gc>pcL?t8?(Xgo+}#Q88l2$n?yd7hpyzDs&Uh-*?dILIrb1diZMrcpSA z!1M%Gd5Irvd+k60mRAOfgSH|fWxCs7QW*%CUP-rtLTYd&J;vZk_D|3;XQNtP{7&O* zg!OSdk$yv9nAOjUxvd>biWP{SxS=y(BuakoelTf?J;%y^FglV+wIICuwBo(Mvj~aI5bvT!u=#?TD>#!Q& zi1#xZ82`|af3(n@A{!G!%aka_+t-@rz-Rpo^F7J%V!)>k`2Y{7IA;>J3MA8%-H^~w4k z1ORw@0|ChW%_Q;Tu$#``c_#C2aWL;Dsq0{D-WE=_HWo!4&uC@+FbpJ6DBU?jf>v!+< z%WeH(FhK9V>s`+O?V}=o^qny8@9v=2fK+c9E^oO{->oDFR~KFY!uWh8)KKHs+nv>7 z;>S~ZEk7NqQXMD#SXU>z!(AiiJd1ON91ss8t34Mf-AeJR&jb)HRV|P4C^6&oG<9^W zvZgF#BgKBRwC zU2j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N zHLPs&LnR$>I>LrX1_bG$-g-ig4~gNn=!Tzr}LM)OuUdFa{3JC{02eBQ>fveSgN zK~I{v6x%BZaQ86Jk1)26sg@=vO4p|t*7lB34MkVho07FFHkg}^U7Sjmm7*HO2%1)p zq*X^SxlGO%bS?TEa|_ur5a4Z0>Re}!j})s!Tb2==GOTr+_@>}^(W;M^T?vlvj@m8w zN+x_L@kVd=FjzX>Dc5745tF~AyL_}1I6bv@jB)#lw+N=#<1=46C-dQydUwGzgw=*e z$C4!D?egw@Kh5vo@<6~e@0p`NY6*Ye>GmtG`s?v8``+Xv|1RL~`*QvYPI$lNUv}yI z6ZrQH3x5UHy;sctf7=&+Nx}#DmHqm+MeLZriF%Kq0R{et@7wwQWl1~Of0nfWV>$aj z75r!M{!bOf-tY0RrTl-2_-Cc&PZ3%8e?(4yN!getSize().Height); +} + DECLARE_OOXMLEXPORT_TEST(testGradientFillPreservation, "gradient-fill-preservation.docx") { xmlDocPtr pXmlDocument = parseExport("word/document.xml"); diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx index 380227205157..f88690bde9b8 100644 --- a/sw/source/core/layout/anchoreddrawobject.cxx +++ b/sw/source/core/layout/anchoreddrawobject.cxx @@ -642,7 +642,7 @@ const SwRect SwAnchoredDrawObject::GetObjRect() const const SwRect SwAnchoredDrawObject::GetObjBoundRect() const { // Resize objects with relative width or height - if ( GetDrawObj( )->GetRelativeWidth( ) || GetDrawObj()->GetRelativeHeight( ) ) + if ( GetPageFrm( ) && ( GetDrawObj( )->GetRelativeWidth( ) || GetDrawObj()->GetRelativeHeight( ) ) ) { Rectangle aPageRect = GetPageFrm( )->GetBoundRect( ).SVRect(); Rectangle aCurrObjRect = GetDrawObj()->GetCurrentBoundRect(); diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index 7eec0312bc40..9528cd543ef3 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -951,16 +952,12 @@ void GraphicImport::lcl_sprm(Sprm & rSprm) case NS_ooxml::LN_CT_SizeRelV_pctHeight: if (m_xShape.is() && !m_pImpl->m_rPositivePercentages.empty()) { - sal_Int16 nPositivePercentage = rtl::math::round(m_pImpl->m_rPositivePercentages.front().toDouble() / 1000); + sal_Int16 nPositivePercentage = rtl::math::round(m_pImpl->m_rPositivePercentages.front().toDouble() / oox::drawingml::PER_PERCENT); m_pImpl->m_rPositivePercentages.pop(); - uno::Reference xServiceInfo(m_xShape, uno::UNO_QUERY_THROW); - if (xServiceInfo->supportsService("com.sun.star.text.TextFrame")) - { - uno::Reference xPropertySet(m_xShape, uno::UNO_QUERY); - OUString aProperty = nSprmId == NS_ooxml::LN_CT_SizeRelH_pctWidth ? OUString("RelativeWidth") : OUString("RelativeHeight"); - xPropertySet->setPropertyValue(aProperty, uno::makeAny(nPositivePercentage)); - } + uno::Reference xPropertySet(m_xShape, uno::UNO_QUERY); + OUString aProperty = nSprmId == NS_ooxml::LN_CT_SizeRelH_pctWidth ? OUString("RelativeWidth") : OUString("RelativeHeight"); + xPropertySet->setPropertyValue(aProperty, uno::makeAny(nPositivePercentage)); } break; case 0x271b: