summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/docxsdrexport.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-09-03 11:33:36 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-09-03 13:32:38 +0100
commitb2ad33fd5a1ee0cd9a1e657725aedc90da659f24 (patch)
tree5cf1b28d3e67ec2fee33d8b46ae5243ed24f3182 /sw/source/filter/ww8/docxsdrexport.cxx
parent28650e0bcf120428d244578266acad9339a88540 (diff)
Related: tdf#93676 special 255 Percent Flag should not be exported to docx
as a true percentage value. 255 is a special flag that the value is synced to the other dimension. Without this word gives the frame in the attached example a huge height. Change-Id: Ida0c15779d4583ca075428d77b8dc03c32f22edb
Diffstat (limited to 'sw/source/filter/ww8/docxsdrexport.cxx')
-rw-r--r--sw/source/filter/ww8/docxsdrexport.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index 3d2ba4c67eb4..02b134a8247f 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -1593,24 +1593,25 @@ void DocxSdrExport::writeDMLTextFrame(sw::Frame* pParentFrame, int nAnchorId, bo
pFS->endElementNS(XML_a, XML_graphic);
// Relative size of the Text Frame.
- if (rSize.GetWidthPercent())
+ const sal_uInt8 nWidthPercent = rSize.GetWidthPercent();
+ if (nWidthPercent && nWidthPercent != SwFormatFrmSize::SYNCED)
{
pFS->startElementNS(XML_wp14, XML_sizeRelH,
XML_relativeFrom, (rSize.GetWidthPercentRelation() == text::RelOrientation::PAGE_FRAME ? "page" : "margin"),
FSEND);
pFS->startElementNS(XML_wp14, XML_pctWidth, FSEND);
- pFS->writeEscaped(OUString::number(rSize.GetWidthPercent() * oox::drawingml::PER_PERCENT));
+ pFS->writeEscaped(OUString::number(nWidthPercent * oox::drawingml::PER_PERCENT));
pFS->endElementNS(XML_wp14, XML_pctWidth);
pFS->endElementNS(XML_wp14, XML_sizeRelH);
}
- if (rSize.GetHeightPercent())
+ const sal_uInt8 nHeightPercent = rSize.GetHeightPercent();
+ if (nHeightPercent && nHeightPercent != SwFormatFrmSize::SYNCED)
{
pFS->startElementNS(XML_wp14, XML_sizeRelV,
XML_relativeFrom, (rSize.GetHeightPercentRelation() == text::RelOrientation::PAGE_FRAME ? "page" : "margin"),
FSEND);
pFS->startElementNS(XML_wp14, XML_pctHeight, FSEND);
- fprintf(stderr, "height pc is %d\n", rSize.GetHeightPercent());
- pFS->writeEscaped(OUString::number(rSize.GetHeightPercent() * oox::drawingml::PER_PERCENT));
+ pFS->writeEscaped(OUString::number(nHeightPercent * oox::drawingml::PER_PERCENT));
pFS->endElementNS(XML_wp14, XML_pctHeight);
pFS->endElementNS(XML_wp14, XML_sizeRelV);
}