sw/qa/extras/rtfexport/data/piccrop.rtf | 74 +++++++++++++++++++++++++ sw/qa/extras/rtfexport/rtfexport8.cxx | 25 ++++++++ writerfilter/source/dmapper/GraphicImport.cxx | 12 +++- writerfilter/source/rtftok/rtfdocumentimpl.cxx | 10 +++ writerfilter/source/rtftok/rtfvalue.cxx | 9 +++ writerfilter/source/rtftok/rtfvalue.hxx | 6 ++ 6 files changed, 134 insertions(+), 2 deletions(-)
New commits: commit 5bce41f82a487c12f11ecad37cad02c93a14c1cb Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Tue Feb 13 14:45:25 2024 +0100 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Mon Feb 19 11:39:47 2024 +0100 tdf#155663 writerfilter: RTF import: don't lose \piccrop* For DOCX the a:srcRect is imported in oox module in BlipFillContext and set on the XShape; obviously that doesn't work for RTF. The crop was already taken into account in RTFDocumentImpl::resolvePict(), but only to set the size of the picture; to actually set a crop effect, set shape's "GraphicsCrop" property in dmapper::GraphicImport::lcl_attribute(). Change-Id: Ib12853724744542a09b0073fefc42ad32bb2ff19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163310 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> (cherry picked from commit 47f50af3f057bac1739b7d17d781c0b1d05faa95) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163331 Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> diff --git a/sw/qa/extras/rtfexport/data/piccrop.rtf b/sw/qa/extras/rtfexport/data/piccrop.rtf new file mode 100644 index 000000000000..4e8a70420575 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/piccrop.rtf @@ -0,0 +1,74 @@ +{ tf1deflang1025nsinsicpg1252\uc1deff31507\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi31507\deflang1033\deflangfe1028 hemelang1033 hemelangfe1028 hemelangcs1025{onttbl{1bidi swiss charset0prq2{\*\panose 020b0604020202020204}Arial{\*alt Arial};} +{14bidi nilcharset136prq2{\*\panose 02010601000101010101}PMingLiU{\*alt Arial Unicode MS};}{34bidi romancharset0prq2{\*\panose 02040503050406030204}Cambria Math;} +{37bidi swisscharset0prq2{\*\panose 020f0502020204030204}Calibri;}{291 bidi nilcharset136prq2{\*\panose 00000000000000000000}@PMingLiU;} +{lomajor31500bidi romancharset0prq2{\*\panose 02020603050405020304}Times New Roman{\*alt Arial};}{dbmajor31501bidi nilcharset136prq2{\*\panose 02010601000101010101}PMingLiU{\*alt Arial Unicode MS};} +{himajor31502bidi swisscharset0prq2{\*\panose 020f0302020204030204}Calibri Light;}{bimajor31503bidi romancharset0 prq2{\*\panose 02020603050405020304}Times New Roman{\*alt Arial};} +{lominor31504bidi romancharset0prq2{\*\panose 02020603050405020304}Times New Roman{\*alt Arial};}{dbminor31505bidi nilcharset136prq2{\*\panose 02010601000101010101}PMingLiU{\*alt Arial Unicode MS};} +{himinor31506bidi swisscharset0prq2{\*\panose 020f0502020204030204}Calibri;}{biminor31507bidi swisscharset0 prq2{\*\panose 020b0604020202020204}Arial{\*alt Arial};}{302bidi swiss charset238prq2 Arial CE{\*alt Arial};} +{303bidi swisscharset204prq2 Arial Cyr{\*alt Arial};}{305bidi swiss charset161prq2 Arial Greek{\*alt Arial};}{306bidi swisscharset162prq2 Arial Tur{\*alt Arial};} +{307bidi swisscharset177prq2 Arial (Hebrew){\*alt Arial};}{308bidi swisscharset178prq2 Arial (Arabic){\*alt Arial};}{309bidi swiss charset186prq2 Arial Baltic{\*alt Arial};} +{310bidi swisscharset163prq2 Arial (Vietnamese){\*alt Arial};}{632bidi romancharset238prq2 Cambria Math CE;}{633bidi romancharset204prq2 Cambria Math Cyr;}{635bidi romancharset161prq2 Cambria Math Greek;} +{636bidi romancharset162prq2 Cambria Math Tur;}{639bidi roman charset186prq2 Cambria Math Baltic;}{640bidi romancharset163prq2 Cambria Math (Vietnamese);}{662bidi swisscharset238prq2 Calibri CE;} +{663bidi swisscharset204prq2 Calibri Cyr;}{665bidi swisscharset161 prq2 Calibri Greek;}{666bidi swisscharset162prq2 Calibri Tur;}{667bidi swisscharset177prq2 Calibri (Hebrew);} +{668bidi swisscharset178prq2 Calibri (Arabic);}{669bidi swiss charset186prq2 Calibri Baltic;}{670bidi swisscharset163prq2 Calibri (Vietnamese);} +{lomajor31508bidi romancharset238prq2 Times New Roman CE{\*alt Arial};}{lomajor31509bidi romancharset204prq2 Times New Roman Cyr{\*alt Arial};} +{lomajor31511bidi romancharset161prq2 Times New Roman Greek{\*alt Arial};}{lomajor31512bidi romancharset162prq2 Times New Roman Tur{\*alt Arial};} +{lomajor31513bidi romancharset177prq2 Times New Roman (Hebrew){\*alt Arial};}{lomajor31514bidi romancharset178prq2 Times New Roman (Arabic){\* alt Arial};} +{lomajor31515bidi romancharset186prq2 Times New Roman Baltic{\*alt Arial};}{lomajor31516bidi romancharset163prq2 Times New Roman (Vietnamese){\*alt Arial};}{himajor31528bidi swisscharset238prq2 Calibri Light CE;} +{himajor31529bidi swisscharset204prq2 Calibri Light Cyr;}{himajor31531 bidi swisscharset161prq2 Calibri Light Greek;}{himajor31532bidi swiss charset162prq2 Calibri Light Tur;} +{himajor31533bidi swisscharset177prq2 Calibri Light (Hebrew);}{himajor 31534bidi swisscharset178prq2 Calibri Light (Arabic);}{himajor31535bidi swisscharset186prq2 Calibri Light Baltic;} +{himajor31536bidi swisscharset163prq2 Calibri Light (Vietnamese);}{ bimajor31538bidi romancharset238prq2 Times New Roman CE{\*alt Arial};}{ bimajor31539bidi romancharset204prq2 Times New Roman Cyr{\*alt Arial};} +{bimajor31541bidi romancharset161prq2 Times New Roman Greek{\*alt Arial};}{bimajor31542bidi romancharset162prq2 Times New Roman Tur{\*alt Arial};} +{bimajor31543bidi romancharset177prq2 Times New Roman (Hebrew){\*alt Arial};}{bimajor31544bidi romancharset178prq2 Times New Roman (Arabic){\* alt Arial};} +{bimajor31545bidi romancharset186prq2 Times New Roman Baltic{\*alt Arial};}{bimajor31546bidi romancharset163prq2 Times New Roman (Vietnamese){\*alt Arial};} +{lominor31548bidi romancharset238prq2 Times New Roman CE{\*alt Arial};}{lominor31549bidi romancharset204prq2 Times New Roman Cyr{\*alt Arial};} +{lominor31551bidi romancharset161prq2 Times New Roman Greek{\*alt Arial};}{lominor31552bidi romancharset162prq2 Times New Roman Tur{\*alt Arial};} +{lominor31553bidi romancharset177prq2 Times New Roman (Hebrew){\*alt Arial};}{lominor31554bidi romancharset178prq2 Times New Roman (Arabic){\* alt Arial};} +{lominor31555bidi romancharset186prq2 Times New Roman Baltic{\*alt Arial};}{lominor31556bidi romancharset163prq2 Times New Roman (Vietnamese){\*alt Arial};}{himinor31568bidi swisscharset238prq2 Calibri CE;} +{himinor31569bidi swisscharset204prq2 Calibri Cyr;}{himinor31571bidi swisscharset161prq2 Calibri Greek;}{himinor31572bidi swisscharset162 prq2 Calibri Tur;} +{himinor31573bidi swisscharset177prq2 Calibri (Hebrew);}{himinor31574 bidi swisscharset178prq2 Calibri (Arabic);}{himinor31575bidi swiss charset186prq2 Calibri Baltic;} +{himinor31576bidi swisscharset163prq2 Calibri (Vietnamese);}{biminor 31578bidi swisscharset238prq2 Arial CE{\*alt Arial};}{biminor31579bidi swisscharset204prq2 Arial Cyr{\*alt Arial};} +{biminor31581bidi swisscharset161prq2 Arial Greek{\*alt Arial};}{ biminor31582bidi swisscharset162prq2 Arial Tur{\*alt Arial};}{biminor 31583bidi swisscharset177prq2 Arial (Hebrew){\*alt Arial};} +{biminor31584bidi swisscharset178prq2 Arial (Arabic){\*alt Arial};}{ biminor31585bidi swisscharset186prq2 Arial Baltic{\*alt Arial};}{biminor 31586bidi swisscharset163prq2 Arial (Vietnamese){\*alt Arial};} +{292bidi romancharset238prq2 Times New Roman CE{\*alt Arial};}{293bidi romancharset204prq2 Times New Roman Cyr{\*alt Arial};}{295bidi roman charset161prq2 Times New Roman Greek{\*alt Arial};} +{296bidi romancharset162prq2 Times New Roman Tur{\*alt Arial};}{297 bidi romancharset177prq2 Times New Roman (Hebrew){\*alt Arial};}{298bidi romancharset178prq2 Times New Roman (Arabic){\*alt Arial};} +{299bidi romancharset186prq2 Times New Roman Baltic{\*alt Arial};}{300 bidi romancharset163prq2 Times New Roman (Vietnamese){\*alt Arial};}}{+ ed0\green255lue0; ed255\green0lue255; ed255\green0lue0; ed255\green255lue0; ed255\green255lue255; ed0\green0lue128; ed0\green128lue128; ed0\green128lue0; ed128\green0lue128; ed128\green0lue0; ed128\green128lue0; + ed128\green128lue128; ed192\green192lue192;}{\*\defchp s22\lochf31506\hichf31506\dbchf31505 }{\*\defpap \ql \li0 i0\sa160\sl259\slmult1\widctlpar\wrapdefaultspalphaspnumaautodjustright in0\lin0\itap0 } oqfpromote {\stylesheet{ +\ql \li0 i0\sa160\sl259\slmult1\widctlpar\wrapdefaultspalphaspnum aautodjustright in0\lin0\itap0 tlchcs1 f31507fs22lang1025 \ltrchcs0 s22\lang1033\langfe1028\loch31506\hichf31506\dbchf31505+\snext0 \sqformat \spriority0 Normal;}{\*+ s11 srowd rftsWidthB3 rpaddl108 rpaddr108 rpaddfl3 rpaddft3 rpaddfb3 rpaddfr3 blind0 blindtype3 svertalt sbrdrt sbrdrl sbrdrb sbrdrr sbrdrdgl sbrdrdgr sbrdrh sbrdrv \ql \li0 i0\sa160\sl259\slmult1 +\widctlpar\wrapdefaultspalphaspnumaautodjustright in0\lin0\itap0 tlchcs1 f31507fs22lang1025 \ltrchcs0 s22\lang1033\langfe1028\loch 31506\hichf31506\dbchf31505+Normal Table;}}{\* sidtbl sid1539605 sid6818220 sid9513591}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{uthor ms}{\operator ms} +{+\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect +\widowctrltnbjenddoc rackmoves0 rackformatting1\donotembedsysfont1 elyonvml0\donotembedlingdata0\grfdocevents0 alidatexml1\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors1 oxlattoyen +xpshrtn oultrlspc\dntblnsbdb ospaceforul ormshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1440\dgvorigin1440\dghshow1\dgvshow1 +\jexpandiewkind1iewscale100\pgbrdrhead\pgbrdrfoot\splytwnine tnlytwnine\htmautsp olnhtadjtbl\useltbalnlntblind\lytcalctblwd\lyttblrtgr\lnbrkrule obrkwrptbl\snaptogridincellllowfieldendsel\wrppunct +sianbrkrule sidroot1539605 ewtblstyruls ogrowautofit\usenormstyforlist oindnmbrtselnbrelev ocxsptable\indrlsweleven oafcnsttblfelev\utinl\hwelev\spltpgpar otcvasp otbrkcnstfrctbl otvatxbx\krnprsnet+{\*\wgrffmtfilter 2450} ofeaturethrottle1\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\headery708 ootery708+\pard\plain \ltrpar\ql \li0 i0\sa160\sl259\slmult1\widctlpar\wrapdefaultspalphaspnumaautodjustright in0\lin0\itap0 tlchcs1 f31507fs22lang1025 \ltrchcs0 + s22\lang1033\langfe1028\lochf31506\hichf31506\dbchf31505+{\pict{\*\picprop\shplid1025{\sp{\sn shapeType}{\sv 75}}{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fLockAspectRatio}{\sv 1}}{\sp{\sn fLockPosition}{\sv 0}}{\sp{\sn fLockAgainstSelect}{\sv 0}}{\sp{\sn fLockAgainstGrouping}{\sv 0}} +{\sp{\sn pictureGray}{\sv 0}}{\sp{\sn pictureBiLevel}{\sv 0}}{\sp{\sn fFilled}{\sv 0}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn wzName}{\sv Picture 1}}{\sp{\sn dhgt}{\sv 251658240}}{\sp{\sn fHidden}{\sv 0}}{\sp{\sn fLayoutInCell}{\sv 1}}} +\picscalex780\picscaley780\piccropl70\piccropr70\piccropt70\piccropb70\picw503\pich503\picwgoal285\pichgoal285\pngblipliptag-2138324634{\*lipuid 808bc16643ef1085bdc9d6183a9f49dc} +89504e470d0a1a0a0000000d4948445200000013000000130806000000725036cc0000000467414d410000d6d8d44f58320000001974455874536f6674776172 +650041646f626520496d616765526561647971c9653c000001694944415478da62fcffff3f03b50040003111a3e8e3646ba26c04082026620ce2bf720cc5c049 +eb57fe076174b50001c4448c41479f3232201bd83b733356f50001c4448c4120806e20360010404cc418c4d1b81dc5c04bdef7192e5d7a8da10f208098883148 +53d312c3c05ea1e518860104101331067171f1613510ddcb0001c4448c4120408c810001c4084ab4f80cfaf6ed13dc6618fffaf5e30c3fea3dc162d6d240fd3a +560cfcb9471901028809dda0a83f5128068134e6752f02d3203ecc852075e82e040820963b56750c0c5640d700258c8ddd195d1ba7fc87790d64c0f42db71926 +95c6810dcc84a8011be86a69c1605dbf84f1ecd99dffcf425d0e10400c206f22e3e486c9ff41e0ebd78fff416c108d8d0f5587a2172080f0e680ddc74fa04400 +888f0f000410130315014000b160130405f48f1f5fb16ac0250e02000184d53050c0e302f7ef5fc229071040580d03c5200cc87bc4e09443070001c448cd921620c000313009ee012707180000000049454e44ae426082}}{ onshppict +{\pict\picscalex781\picscaley790\piccropl70\piccropr70\piccropt70\piccropb70\picw503\pich503\picwgoal285\pichgoal285\wmetafile8liptag-2138324634{\*lipuid 808bc16643ef1085bdc9d6183a9f49dc} +010009000003370100000000b300000000000400000003010800050000000b0200000000050000000c0214001400030000001e00040000000701040004000000 +070104000800000026060f000600544e505006014b000000410b8600ee0013001300000000001300130000000000280000001300000013000000010001000000 +0000000000000000000000000000000000000000000000000000ffffff000000000c0ffe000c0ffe00000ffe00000ffe00000ffe00000ffe0000effee000ffff +e0007fffc0003fff80001fff00000ffe000507fe000003fe000c01f6000c00e600000040000000000000b3000000410bc6008800130013000000000013001300 +000000002800000013000000130000000100040000000000000000000000000000000000000000000000000000000000ffffff004ba1f3000078ff00b5baa000 +035dcd006d592c00c3d4d400a2907500f3f7f700eaf0f00000000000000000000000000000000000000000001111111111111111111001011111888666668881 +11100101111187761116778111100801111189a61116a98111100706111181961116918111100100111181961116918111100106111181989198918111100101 +77718117898711817770080123556919787919655320090612355791999197553210010011235579111975532110090811123557919755321110070111112355 +797553211110080111111235575532811110010911111123555326411110024c1111111235321641111009011111111123211441111002031111111112111111111005031111111111111111111005070800000026060f000600544e50500701040000002701ffff030000000000}}}{ tlchcs1 f31507 +\ltrchcs0 \insrsid6818220 +\par } +} diff --git a/sw/qa/extras/rtfexport/rtfexport8.cxx b/sw/qa/extras/rtfexport/rtfexport8.cxx index 0f01f4f36193..cbe9536ebfb9 100644 --- a/sw/qa/extras/rtfexport/rtfexport8.cxx +++ b/sw/qa/extras/rtfexport/rtfexport8.cxx @@ -9,9 +9,10 @@ #include <swmodeltestbase.hxx> +#include <com/sun/star/awt/FontWeight.hpp> +#include <com/sun/star/text/GraphicCrop.hpp> #include <com/sun/star/text/XFootnote.hpp> #include <com/sun/star/text/XFootnotesSupplier.hpp> -#include <com/sun/star/awt/FontWeight.hpp> #include <com/sun/star/text/XEndnotesSupplier.hpp> #include <com/sun/star/text/XTextFieldsSupplier.hpp> #include <com/sun/star/text/XTextTablesSupplier.hpp> @@ -47,6 +48,28 @@ public: } }; +DECLARE_RTFEXPORT_TEST(testTdf155663, "piccrop.rtf") +{ + auto const xShape(getShape(1)); + if (!isExported()) + { + CPPUNIT_ASSERT_EQUAL(sal_Int32(2004), xShape->getSize().Height); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2004), xShape->getSize().Width); + } + else // bit of rounding loss? + { + CPPUNIT_ASSERT_EQUAL(sal_Int32(2013), xShape->getSize().Height); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2013), xShape->getSize().Width); + } + CPPUNIT_ASSERT_EQUAL(sal_Int32(123), getProperty<text::GraphicCrop>(xShape, "GraphicCrop").Top); + CPPUNIT_ASSERT_EQUAL(sal_Int32(123), + getProperty<text::GraphicCrop>(xShape, "GraphicCrop").Bottom); + CPPUNIT_ASSERT_EQUAL(sal_Int32(123), + getProperty<text::GraphicCrop>(xShape, "GraphicCrop").Left); + CPPUNIT_ASSERT_EQUAL(sal_Int32(123), + getProperty<text::GraphicCrop>(xShape, "GraphicCrop").Right); +} + DECLARE_RTFEXPORT_TEST(testTdf158586_0, "tdf158586_pageBreak0.rtf") { // The specified page break must be lost because it is in a text frame diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index dfc084f9c3ee..ec78380c8c9e 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -271,6 +271,7 @@ public: std::optional<sal_Int32> m_oEffectExtentTop; std::optional<sal_Int32> m_oEffectExtentRight; std::optional<sal_Int32> m_oEffectExtentBottom; + std::optional<text::GraphicCrop> m_oCrop; GraphicImport_Impl(GraphicImportType & rImportType, DomainMapper& rDMapper, std::pair<OUString, OUString>& rPositionOffsets, @@ -796,6 +797,9 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue) case NS_ooxml::LN_CT_WrapSquare_wrapText: //90928; handleWrapTextValue(rValue.getInt()); break; + case NS_ooxml::LN_CT_BlipFillProperties_srcRect: + m_pImpl->m_oCrop.emplace(rValue.getAny().get<text::GraphicCrop>()); + break; case NS_ooxml::LN_shape: { uno::Reference< drawing::XShape> xShape; @@ -858,7 +862,13 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue) text::GraphicCrop aGraphicCrop( 0, 0, 0, 0 ); uno::Reference< beans::XPropertySet > xSourceGraphProps( xShape, uno::UNO_QUERY ); uno::Any aAny = xSourceGraphProps->getPropertyValue("GraphicCrop"); - if(aAny >>= aGraphicCrop) { + if (m_pImpl->m_oCrop) + { // RTF: RTFValue from resolvePict() + xGraphProps->setPropertyValue("GraphicCrop", + uno::Any(*m_pImpl->m_oCrop)); + } + else if (aAny >>= aGraphicCrop) + { // DOCX: imported in oox BlipFillContext xGraphProps->setPropertyValue("GraphicCrop", uno::Any( aGraphicCrop ) ); } diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index a7ff017183f4..54d1cff006aa 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -1068,6 +1068,16 @@ void RTFDocumentImpl::resolvePict(bool const bInline, uno::Reference<drawing::XS RTFSprms aAttributes; // shape attribute RTFSprms aPicAttributes; + if (m_aStates.top().getPicture().nCropT != 0 || m_aStates.top().getPicture().nCropB != 0 + || m_aStates.top().getPicture().nCropL != 0 || m_aStates.top().getPicture().nCropR != 0) + { + text::GraphicCrop const crop{ m_aStates.top().getPicture().nCropT, + m_aStates.top().getPicture().nCropB, + m_aStates.top().getPicture().nCropL, + m_aStates.top().getPicture().nCropR }; + auto const pCrop = new RTFValue(crop); + aPicAttributes.set(NS_ooxml::LN_CT_BlipFillProperties_srcRect, pCrop); + } auto pShapeValue = new RTFValue(xShape); aPicAttributes.set(NS_ooxml::LN_shape, pShapeValue); // pic sprm diff --git a/writerfilter/source/rtftok/rtfvalue.cxx b/writerfilter/source/rtftok/rtfvalue.cxx index 7a9137f5db4a..6654a3f2eca5 100644 --- a/writerfilter/source/rtftok/rtfvalue.cxx +++ b/writerfilter/source/rtftok/rtfvalue.cxx @@ -85,6 +85,11 @@ RTFValue::RTFValue(const RTFPicture& rPicture) { } +RTFValue::RTFValue(text::GraphicCrop const& rCrop) + : m_oCrop(rCrop) +{ +} + RTFValue::~RTFValue() = default; int RTFValue::getInt() const { return m_nValue; } @@ -110,6 +115,10 @@ uno::Any RTFValue::getAny() const ret <<= m_xStream; else if (m_xObject.is()) ret <<= m_xObject; + else if (m_oCrop) + { + ret <<= *m_oCrop; + } else ret <<= static_cast<sal_Int32>(m_nValue); return ret; diff --git a/writerfilter/source/rtftok/rtfvalue.hxx b/writerfilter/source/rtftok/rtfvalue.hxx index 4f37a5dcbcec..6c87c61a1d05 100644 --- a/writerfilter/source/rtftok/rtfvalue.hxx +++ b/writerfilter/source/rtftok/rtfvalue.hxx @@ -11,6 +11,10 @@ #include <dmapper/resourcemodel.hxx> +#include <com/sun/star/text/GraphicCrop.hpp> + +#include <optional> + namespace com::sun::star { namespace embed @@ -49,6 +53,7 @@ public: explicit RTFValue(css::uno::Reference<css::embed::XEmbeddedObject> xObject); explicit RTFValue(const RTFShape& aShape); explicit RTFValue(const RTFPicture& rPicture); + explicit RTFValue(css::text::GraphicCrop const& rCrop); ~RTFValue() override; void setString(const OUString& sValue); int getInt() const override; @@ -79,6 +84,7 @@ private: bool m_bForceString = false; mutable tools::SvRef<RTFShape> m_pShape; mutable tools::SvRef<RTFPicture> m_pPicture; + ::std::optional<css::text::GraphicCrop> m_oCrop; }; } // namespace writerfilter::rtftok