diff options
author | Eilidh McAdam <eilidh@lanedo.com> | 2012-09-19 09:45:49 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-06-24 17:24:42 +0200 |
commit | 4869de23a6cc8d1f21041f856bac6822bbe963b1 (patch) | |
tree | a26302ea9d9c287776ad35205b207a8f20405b85 | |
parent | 99c9338276339572eeed3b00033c03282105ca8e (diff) |
bnc#823655 Import RTF shape wrap property.
Property \shpwrN, where N can be
1: Wrap at top and bottom (no wrap at sides)
2: Wrap around shape
3: None (wrap as though shape isn't there)
4: Wrap tightly around shape
5: Wrap text through shape
Reviewed-on: https://gerrit.libreoffice.org/647
Reviewed-by: Miklos Vajna <vmiklos@suse.cz>
Tested-by: Miklos Vajna <vmiklos@suse.cz>
(cherry picked from commit d56e7c9011e662b39f0e9775e654f62cea8765c2)
Change-Id: Ic700e06bf9ef894a6efa7e8d033888ed80a7082f
Signed-off-by: Miklos Vajna <vmiklos@suse.cz>
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 22 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.hxx | 1 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfsdrimport.cxx | 2 |
3 files changed, 23 insertions, 2 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index a89b3c0804f1..67a26e3ae53c 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -35,6 +35,7 @@ #include <com/sun/star/text/HoriOrientation.hpp> #include <com/sun/star/text/VertOrientation.hpp> #include <com/sun/star/text/RelOrientation.hpp> +#include <com/sun/star/text/WrapTextMode.hpp> #include <rtl/tencinfo.h> #include <svl/lngmisc.hxx> #include <unotools/ucbstreamhelper.hxx> @@ -617,7 +618,6 @@ int RTFDocumentImpl::resolvePict(bool bInline) { SvMemoryStream aStream; SvStream *pStream = 0; - if (!m_pBinaryData.get()) { pStream = &aStream; @@ -2692,6 +2692,23 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) m_aStates.top().aCharacterAttributes.set(NS_ooxml::LN_CT_WrapSquare_wrapText, pValue); } break; + case RTF_SHPWR: + { + switch (nParam) + { + case 1: + m_aStates.top().aShape.nWrap = com::sun::star::text::WrapTextMode_NONE; break; + case 2: + m_aStates.top().aShape.nWrap = com::sun::star::text::WrapTextMode_PARALLEL; break; + case 3: + m_aStates.top().aShape.nWrap = com::sun::star::text::WrapTextMode_THROUGHT; break; + case 4: + m_aStates.top().aShape.nWrap = com::sun::star::text::WrapTextMode_PARALLEL; break; + case 5: + m_aStates.top().aShape.nWrap = com::sun::star::text::WrapTextMode_THROUGHT; break; + } + } + break; case RTF_CELLX: { int nCellX = nParam - m_aStates.top().nCellX; @@ -3878,7 +3895,8 @@ RTFShape::RTFShape() nRight(0), nBottom(0), nHoriOrientRelation(0), - nVertOrientRelation(0) + nVertOrientRelation(0), + nWrap(-1) { } diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index 5a4b519e9e31..5aa7ba365113 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -199,6 +199,7 @@ namespace writerfilter { int nBottom; sal_Int16 nHoriOrientRelation; sal_Int16 nVertOrientRelation; + int nWrap; }; /// Stores the properties of a drawing object. diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx index 701780d288a1..0258fe3acdc4 100644 --- a/writerfilter/source/rtftok/rtfsdrimport.cxx +++ b/writerfilter/source/rtftok/rtfsdrimport.cxx @@ -325,6 +325,8 @@ void RTFSdrImport::resolve(RTFShape& rShape) xPropertySet->setPropertyValue("HoriOrientRelation", uno::makeAny(rShape.nHoriOrientRelation)); if (rShape.nVertOrientRelation != 0) xPropertySet->setPropertyValue("VertOrientRelation", uno::makeAny(rShape.nVertOrientRelation)); + if (rShape.nWrap != -1) + xPropertySet->setPropertyValue("Surround", uno::makeAny(rShape.nWrap)); } // Send it to dmapper |