summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorEilidh McAdam <eilidh@lanedo.com>2012-09-19 09:45:49 +0100
committerMiklos Vajna <vmiklos@suse.cz>2012-09-19 12:53:16 +0000
commitd56e7c9011e662b39f0e9775e654f62cea8765c2 (patch)
tree81b43a82b17dc818a3e418f36ab5c850b79dd655 /writerfilter
parent43724668d6a31a73a2847918f740f99d59ced305 (diff)
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 Change-Id: Ic700e06bf9ef894a6efa7e8d033888ed80a7082f Reviewed-on: https://gerrit.libreoffice.org/647 Reviewed-by: Miklos Vajna <vmiklos@suse.cz> Tested-by: Miklos Vajna <vmiklos@suse.cz>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx22
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.hxx1
-rw-r--r--writerfilter/source/rtftok/rtfsdrimport.cxx2
3 files changed, 23 insertions, 2 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 282f68a881ba..4acaad9dc3a9 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 <svtools/wmf.hxx>
#include <svl/lngmisc.hxx>
@@ -597,7 +598,6 @@ int RTFDocumentImpl::resolvePict(bool bInline)
{
SvMemoryStream aStream;
SvStream *pStream = 0;
-
if (!m_pBinaryData.get())
{
pStream = &aStream;
@@ -2746,6 +2746,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;
@@ -4059,7 +4076,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 e2a5aa619632..beec3b51fc3d 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -257,6 +257,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 956ada1ef413..2545c03521d6 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -346,6 +346,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