diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-03-24 14:55:09 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-03-24 16:49:28 +0100 |
commit | 5e994d528c67e4db1e0ef7ba01349a51acbdacb3 (patch) | |
tree | 71daa08106110393c8505261099812dd5a5376b9 /writerfilter | |
parent | 0d9132c5046e15540abc20e45d64080708626441 (diff) |
fdo#47036 fix RTF import of multi-paragraph exact height textboxes
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 12 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.hxx | 1 |
2 files changed, 8 insertions, 5 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 5daec329cc9c..e4d4e5055bd5 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -3460,6 +3460,7 @@ RTFFrame::RTFFrame(RTFParserState* pParserState) nHoriAnchor(0), nVertAlign(0), nVertAnchor(0), + nHRule(NS_ooxml::LN_Value_wordprocessingml_ST_HeightRule_auto), nAnchorType(0) { } @@ -3547,7 +3548,12 @@ RTFSprms RTFFrame::getSprms() break; case NS_sprm::LN_PWHeightAbs: if ( nH != 0 ) - pValue.reset(new RTFValue(nH)); + { + if (nHRule == NS_ooxml::LN_Value_wordprocessingml_ST_HeightRule_exact) + pValue.reset(new RTFValue(-nH)); // The negative value just sets nHRule + else + pValue.reset(new RTFValue(nH)); + } break; case NS_sprm::LN_PDxaWidth: if ( nW != 0 ) @@ -3577,12 +3583,8 @@ RTFSprms RTFFrame::getSprms() break; case NS_ooxml::LN_CT_FramePr_hRule: { - sal_Int32 nHRule = NS_ooxml::LN_Value_wordprocessingml_ST_HeightRule_auto; if ( nH < 0 ) - { nHRule = NS_ooxml::LN_Value_wordprocessingml_ST_HeightRule_exact; - nH = -nH; // The negative value just sets nHRule - } else if ( nH > 0 ) nHRule = NS_ooxml::LN_Value_wordprocessingml_ST_HeightRule_atLeast; pValue.reset(new RTFValue(nHRule)); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index bd2a7016a3db..54459e74ce85 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -214,6 +214,7 @@ namespace writerfilter { sal_Int32 nX, nY, nW, nH; sal_Int32 nHoriPadding, nVertPadding; sal_Int32 nHoriAlign, nHoriAnchor, nVertAlign, nVertAnchor; + Id nHRule; public: RTFFrame(RTFParserState* pParserState); sal_Int16 nAnchorType; |