summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@frugalware.org>2011-08-17 21:12:17 +0200
committerMiklos Vajna <vmiklos@frugalware.org>2011-08-17 21:12:25 +0200
commitb7633fa4b2ff9fd54a608dcdbf72c3372ee0fdd9 (patch)
treec5f0bf1f7ac938b9bd748dce1b7f60795232b2ac /writerfilter
parent174b65ec87676078da23952e3fe61ab1366fcfb8 (diff)
Implement textframe margins
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx18
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.hxx1
2 files changed, 15 insertions, 4 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index e0c864ce0eda..4f85e69cfc51 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -829,10 +829,10 @@ void RTFDocumentImpl::text(OUString& rString)
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("VertOrientPosition")), uno::Any(sal_Int32(m_aStates.top().aFrame.nY)));
- xPropertySet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("LeftMargin")), uno::Any(sal_Int32(0)));
- xPropertySet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("RightMargin")), uno::Any(sal_Int32(0)));
- xPropertySet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("TopMargin")), uno::Any(sal_Int32(0)));
- xPropertySet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BottomMargin")), uno::Any(sal_Int32(0)));
+ 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)));
+ xPropertySet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("TopMargin")), uno::Any(sal_Int32(m_aStates.top().aFrame.nTopMargin)));
+ xPropertySet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BottomMargin")), uno::Any(sal_Int32(m_aStates.top().aFrame.nBottomMargin)));
Mapper().startShape(xShape);
Mapper().startParagraphGroup();
@@ -2390,6 +2390,16 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
case RTF_POSY:
m_aStates.top().aFrame.nY = TWIP_TO_MM100(nParam);
break;
+ case RTF_DFRMTXTX:
+ m_aStates.top().aFrame.nLeftMargin = m_aStates.top().aFrame.nRightMargin = TWIP_TO_MM100(nParam);
+ break;
+ case RTF_DFRMTXTY:
+ m_aStates.top().aFrame.nTopMargin = m_aStates.top().aFrame.nBottomMargin = TWIP_TO_MM100(nParam);
+ break;
+ case RTF_DXFRTEXT:
+ 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;
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 fda42800a866..5c683b20cc90 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -192,6 +192,7 @@ namespace writerfilter {
{
public:
int nX, nY, nW, nH;
+ int nLeftMargin, nRightMargin, nTopMargin, nBottomMargin;
};
/// State of the parser, which gets saved / restored when changing groups.