diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-05-26 15:28:31 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-05-26 09:43:30 -0500 |
commit | dba6c0414cdbf744fb99c47dd1a04ba1a6ee3f71 (patch) | |
tree | 44a88dcab1fb1aa5a24296f769cd4293d41cd530 | |
parent | ae95cdd2a1708a8e9e114dd9bcf577f57f1f5af3 (diff) |
fdo#78900 RTF import: allow \dpxsize inside \dptxbxtext
Previously we assumed that they always appear under \do directly.
Change-Id: Ie3a978da856986f604a3815d6127abb4191323c0
(cherry picked from commit 21c11ffe254612ac46aa891addacb0024d5b93f0)
Reviewed-on: https://gerrit.libreoffice.org/9488
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/qa/core/data/rtf/pass/fdo78900.rtf | 11 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 11 |
2 files changed, 22 insertions, 0 deletions
diff --git a/sw/qa/core/data/rtf/pass/fdo78900.rtf b/sw/qa/core/data/rtf/pass/fdo78900.rtf new file mode 100644 index 000000000000..d379735efa62 --- /dev/null +++ b/sw/qa/core/data/rtf/pass/fdo78900.rtf @@ -0,0 +1,11 @@ +{\rtf1\ansi\ansicpg1252\deff0\deftab720 +\viewkind1\paperw11910\paperh16845\margl225\margr225\margt225\margb225\headery0\footery0 +{ +{\*\do\dobxpage\dobypage\dptxbx +{\dptxbxtext\dpx227\dpy227\dpxsize11911\dpysize9709\dplinehollow +{hello +} +} +} +\par} +} diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index ab23fb46f23d..816595d598b0 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -5037,6 +5037,17 @@ int RTFDocumentImpl::popState() m_aStates.top().pCurrentBuffer->push_back( Buf_t(BUFFER_ENDSHAPE)); } + + // It's allowed to declare these inside the the shape text, and they + // are expected to have an effect for the whole shape. + if (aState.aDrawingObject.nLeft) + m_aStates.top().aDrawingObject.nLeft = aState.aDrawingObject.nLeft; + if (aState.aDrawingObject.nTop) + m_aStates.top().aDrawingObject.nTop = aState.aDrawingObject.nTop; + if (aState.aDrawingObject.nRight) + m_aStates.top().aDrawingObject.nRight = aState.aDrawingObject.nRight; + if (aState.aDrawingObject.nBottom) + m_aStates.top().aDrawingObject.nBottom = aState.aDrawingObject.nBottom; break; default: { |