summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-09-03 11:33:36 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-09-03 14:26:01 +0000
commit327fb3ec1df35f2e92e3e18083f746a18201ec71 (patch)
treebe484f4a7926a2ebdb480b5d256c4a62ad46507a /sw
parent648cae8562179d66b3075a43d4b29a76018a28a0 (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. (cherry picked from commit b2ad33fd5a1ee0cd9a1e657725aedc90da659f24) Change-Id: Ida0c15779d4583ca075428d77b8dc03c32f22edb Reviewed-on: https://gerrit.libreoffice.org/18303 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf93676-1.odtbin0 -> 18743 bytes
-rw-r--r--sw/source/filter/ww8/docxsdrexport.cxx10
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx10
3 files changed, 12 insertions, 8 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf93676-1.odt b/sw/qa/extras/ooxmlexport/data/tdf93676-1.odt
new file mode 100644
index 000000000000..37d621b903cd
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf93676-1.odt
Binary files differ
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index a7dc475c8630..7c21a11a95ae 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -1525,23 +1525,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 != 0xff)
{
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 != 0xff)
{
pFS->startElementNS(XML_wp14, XML_sizeRelV,
XML_relativeFrom, (rSize.GetHeightPercentRelation() == text::RelOrientation::PAGE_FRAME ? "page" : "margin"),
FSEND);
pFS->startElementNS(XML_wp14, XML_pctHeight, FSEND);
- 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);
}
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index da8f01ffe846..d9550c051d8e 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -1610,9 +1610,10 @@ void lcl_TextFrameRelativeSize(std::vector< std::pair<OString, OString> >& rFlyP
const SwFmtFrmSize& rSize = rFrmFmt.GetFrmSize();
// Relative size of the Text Frame.
- if (rSize.GetWidthPercent())
+ const sal_uInt8 nWidthPercent = rSize.GetWidthPercent();
+ if (nWidthPercent && nWidthPercent != 0xff)
{
- rFlyProperties.push_back(std::make_pair<OString, OString>("pctHoriz", OString::number(rSize.GetWidthPercent() * 10)));
+ rFlyProperties.push_back(std::make_pair<OString, OString>("pctHoriz", OString::number(nWidthPercent * 10)));
OString aRelation;
switch (rSize.GetWidthPercentRelation())
@@ -1626,9 +1627,10 @@ void lcl_TextFrameRelativeSize(std::vector< std::pair<OString, OString> >& rFlyP
}
rFlyProperties.push_back(std::make_pair("sizerelh", aRelation));
}
- if (rSize.GetHeightPercent())
+ const sal_uInt8 nHeightPercent = rSize.GetHeightPercent();
+ if (nHeightPercent && nHeightPercent != 0xff)
{
- rFlyProperties.push_back(std::make_pair<OString, OString>("pctVert", OString::number(rSize.GetHeightPercent() * 10)));
+ rFlyProperties.push_back(std::make_pair<OString, OString>("pctVert", OString::number(nHeightPercent * 10)));
OString aRelation;
switch (rSize.GetHeightPercentRelation())