summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@frugalware.org>2011-08-18 00:56:43 +0200
committerMiklos Vajna <vmiklos@frugalware.org>2011-08-18 00:56:43 +0200
commit6c8d683a4b23c812cf7484ad483bed3fc2e8797f (patch)
tree01943a591fc7de474b79fb007001d6479a5790ef /writerfilter
parenta5d694abef5b889f4f9e8645e1f7f713c25a72fd (diff)
implement RTF_FLYVERT and RTF_FLYHORZ
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfcontrolwords.cxx2
-rw-r--r--writerfilter/source/rtftok/rtfcontrolwords.hxx4
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx20
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.hxx5
4 files changed, 26 insertions, 5 deletions
diff --git a/writerfilter/source/rtftok/rtfcontrolwords.cxx b/writerfilter/source/rtftok/rtfcontrolwords.cxx
index dfdec0750fba..00a11a5b753e 100644
--- a/writerfilter/source/rtftok/rtfcontrolwords.cxx
+++ b/writerfilter/source/rtftok/rtfcontrolwords.cxx
@@ -1845,6 +1845,8 @@ RTFSymbol aRTFControlWords[] = {
{"zwnbo", CONTROL_SYMBOL, RTF_ZWNBO},
{"zwnj", CONTROL_SYMBOL, RTF_ZWNJ},
{"flymaincnt", CONTROL_DESTINATION, RTF_FLYMAINCNT},
+ {"flyvert", CONTROL_VALUE, RTF_FLYVERT},
+ {"flyhorz", CONTROL_VALUE, RTF_FLYHORZ},
};
int nRTFControlWords = SAL_N_ELEMENTS(aRTFControlWords);
diff --git a/writerfilter/source/rtftok/rtfcontrolwords.hxx b/writerfilter/source/rtftok/rtfcontrolwords.hxx
index b3ca6e2a76e6..2c1a05b3c9da 100644
--- a/writerfilter/source/rtftok/rtfcontrolwords.hxx
+++ b/writerfilter/source/rtftok/rtfcontrolwords.hxx
@@ -1844,7 +1844,9 @@ enum RTFKeyword
RTF_ZWJ,
RTF_ZWNBO,
RTF_ZWNJ,
- RTF_FLYMAINCNT
+ RTF_FLYMAINCNT,
+ RTF_FLYVERT,
+ RTF_FLYHORZ
};
/// Types of an RTF Control Word
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 4f62fed2a8cc..b99db4dafb68 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -725,9 +725,11 @@ void RTFDocumentImpl::checkChangedFrame()
xPropertySet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("SizeType")), uno::Any(text::SizeType::MIN));
xShape->setSize(awt::Size(m_aStates.top().aFrame.nW, m_aStates.top().aFrame.nH));
- xPropertySet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("HoriOrient")), uno::Any(text::HoriOrientation::NONE));
+ xPropertySet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("HoriOrient")), uno::Any(m_aStates.top().aFrame.nHoriOrient));
+ xPropertySet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("HoriOrientRelation")), uno::Any(m_aStates.top().aFrame.nHoriOrientRelation));
xPropertySet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("HoriOrientPosition")), uno::Any(sal_Int32(m_aStates.top().aFrame.nX)));
- xPropertySet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("VertOrient")), uno::Any(text::VertOrientation::NONE));
+ xPropertySet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("VertOrient")), uno::Any(m_aStates.top().aFrame.nVertOrient));
+ xPropertySet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("VertOrientRelation")), uno::Any(m_aStates.top().aFrame.nVertOrientRelation));
xPropertySet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("VertOrientPosition")), uno::Any(sal_Int32(m_aStates.top().aFrame.nY)));
xPropertySet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("LeftMargin")), uno::Any(sal_Int32(m_aStates.top().aFrame.nLeftMargin)));
xPropertySet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("RightMargin")), uno::Any(sal_Int32(m_aStates.top().aFrame.nRightMargin)));
@@ -2418,6 +2420,20 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
m_aStates.top().aFrame.nLeftMargin = m_aStates.top().aFrame.nRightMargin =
m_aStates.top().aFrame.nTopMargin = m_aStates.top().aFrame.nBottomMargin = TWIP_TO_MM100(nParam);
break;
+ case RTF_FLYVERT:
+ {
+ RTFVertOrient aVertOrient(nParam);
+ m_aStates.top().aFrame.nVertOrient = aVertOrient.GetOrient();
+ m_aStates.top().aFrame.nVertOrientRelation = aVertOrient.GetRelation();
+ }
+ break;
+ case RTF_FLYHORZ:
+ {
+ RTFHoriOrient aHoriOrient(nParam);
+ m_aStates.top().aFrame.nHoriOrient = aHoriOrient.GetOrient();
+ m_aStates.top().aFrame.nHoriOrientRelation = aHoriOrient.GetRelation();
+ }
+ break;
default:
#if OSL_DEBUG_LEVEL > 1
OSL_TRACE("%s: TODO handle value '%s'", OSL_THIS_FUNC, lcl_RtfToString(nKeyword));
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 5ebc3a74608d..4fecf1a2fd14 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -192,8 +192,9 @@ namespace writerfilter {
class RTFFrame
{
public:
- int nX, nY, nW, nH;
- int nLeftMargin, nRightMargin, nTopMargin, nBottomMargin;
+ sal_Int32 nX, nY, nW, nH;
+ sal_Int32 nLeftMargin, nRightMargin, nTopMargin, nBottomMargin;
+ sal_Int16 nHoriOrient, nHoriOrientRelation, nVertOrient, nVertOrientRelation;
};
/// State of the parser, which gets saved / restored when changing groups.