summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-03-24 14:55:09 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-04-05 14:45:51 +0100
commit830c2151d48e0821b183348c1778856f7d85d296 (patch)
tree224c05cc2a1781b08be69eb08219fd6399b8ea1d
parentfdo#47036 fix RTF import of shapes inside text frames at the start of the doc (diff)
downloadcore-830c2151d48e0821b183348c1778856f7d85d296.tar.gz
core-830c2151d48e0821b183348c1778856f7d85d296.zip
fdo#47036 fix RTF import of multi-paragraph exact height textboxes
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx12
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.hxx1
2 files changed, 8 insertions, 5 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 16d5c754c804..2d82e288d5e5 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3493,6 +3493,7 @@ RTFFrame::RTFFrame(RTFParserState* pParserState)
nHoriAnchor(0),
nVertAlign(0),
nVertAnchor(0),
+ nHRule(NS_ooxml::LN_Value_wordprocessingml_ST_HeightRule_auto),
nAnchorType(0)
{
}
@@ -3580,7 +3581,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 )
@@ -3610,12 +3616,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 3a148f5643af..96260633b1a7 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;