Kaydet (Commit) d56e7c90 authored tarafından Eilidh McAdam's avatar Eilidh McAdam Kaydeden (comit) Miklos Vajna

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/647Reviewed-by: 's avatarMiklos Vajna <vmiklos@suse.cz>
Tested-by: 's avatarMiklos Vajna <vmiklos@suse.cz>
üst 43724668
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <com/sun/star/text/HoriOrientation.hpp> #include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/text/VertOrientation.hpp> #include <com/sun/star/text/VertOrientation.hpp>
#include <com/sun/star/text/RelOrientation.hpp> #include <com/sun/star/text/RelOrientation.hpp>
#include <com/sun/star/text/WrapTextMode.hpp>
#include <rtl/tencinfo.h> #include <rtl/tencinfo.h>
#include <svtools/wmf.hxx> #include <svtools/wmf.hxx>
#include <svl/lngmisc.hxx> #include <svl/lngmisc.hxx>
...@@ -597,7 +598,6 @@ int RTFDocumentImpl::resolvePict(bool bInline) ...@@ -597,7 +598,6 @@ int RTFDocumentImpl::resolvePict(bool bInline)
{ {
SvMemoryStream aStream; SvMemoryStream aStream;
SvStream *pStream = 0; SvStream *pStream = 0;
if (!m_pBinaryData.get()) if (!m_pBinaryData.get())
{ {
pStream = &aStream; pStream = &aStream;
...@@ -2746,6 +2746,23 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) ...@@ -2746,6 +2746,23 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
m_aStates.top().aCharacterAttributes.set(NS_ooxml::LN_CT_WrapSquare_wrapText, pValue); m_aStates.top().aCharacterAttributes.set(NS_ooxml::LN_CT_WrapSquare_wrapText, pValue);
} }
break; 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: case RTF_CELLX:
{ {
int nCellX = nParam - m_aStates.top().nCellX; int nCellX = nParam - m_aStates.top().nCellX;
...@@ -4059,7 +4076,8 @@ RTFShape::RTFShape() ...@@ -4059,7 +4076,8 @@ RTFShape::RTFShape()
nRight(0), nRight(0),
nBottom(0), nBottom(0),
nHoriOrientRelation(0), nHoriOrientRelation(0),
nVertOrientRelation(0) nVertOrientRelation(0),
nWrap(-1)
{ {
} }
......
...@@ -257,6 +257,7 @@ namespace writerfilter { ...@@ -257,6 +257,7 @@ namespace writerfilter {
int nBottom; int nBottom;
sal_Int16 nHoriOrientRelation; sal_Int16 nHoriOrientRelation;
sal_Int16 nVertOrientRelation; sal_Int16 nVertOrientRelation;
int nWrap;
}; };
/// Stores the properties of a drawing object. /// Stores the properties of a drawing object.
......
...@@ -346,6 +346,8 @@ void RTFSdrImport::resolve(RTFShape& rShape) ...@@ -346,6 +346,8 @@ void RTFSdrImport::resolve(RTFShape& rShape)
xPropertySet->setPropertyValue("HoriOrientRelation", uno::makeAny(rShape.nHoriOrientRelation)); xPropertySet->setPropertyValue("HoriOrientRelation", uno::makeAny(rShape.nHoriOrientRelation));
if (rShape.nVertOrientRelation != 0) if (rShape.nVertOrientRelation != 0)
xPropertySet->setPropertyValue("VertOrientRelation", uno::makeAny(rShape.nVertOrientRelation)); xPropertySet->setPropertyValue("VertOrientRelation", uno::makeAny(rShape.nVertOrientRelation));
if (rShape.nWrap != -1)
xPropertySet->setPropertyValue("Surround", uno::makeAny(rShape.nWrap));
} }
// Send it to dmapper // Send it to dmapper
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment