summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-07-15 15:38:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-07-16 08:09:56 +0200
commitbd2eed385f5827e3b7f3510d4f83be03d548d418 (patch)
tree7c830679a40c079698177a670bb2794df69fdb43
parentf34a5252a08644599a202f4267d3ba1056000430 (diff)
write out empty state explicitly in writeRectangle
this is purely an internal XML format, so we can change it Change-Id: I9e2a4350c6c3f51031742e94823ea052dd73c8df Reviewed-on: https://gerrit.libreoffice.org/75639 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--filter/qa/cppunit/filters-pict-test.cxx4
-rw-r--r--vcl/qa/cppunit/svm/svmtest.cxx4
-rw-r--r--vcl/source/gdi/mtfxmldump.cxx11
3 files changed, 12 insertions, 7 deletions
diff --git a/filter/qa/cppunit/filters-pict-test.cxx b/filter/qa/cppunit/filters-pict-test.cxx
index 67a04c52e159..a7824e4e929c 100644
--- a/filter/qa/cppunit/filters-pict-test.cxx
+++ b/filter/qa/cppunit/filters-pict-test.cxx
@@ -92,8 +92,8 @@ void PictFilterTest::testDontClipTooMuch()
assertXPath(pDoc, "/metafile/clipregion[5]", "top", "0");
assertXPath(pDoc, "/metafile/clipregion[5]", "left", "0");
- assertXPath(pDoc, "/metafile/clipregion[5]", "bottom", "-32767");
- assertXPath(pDoc, "/metafile/clipregion[5]", "right", "-32767");
+ assertXPath(pDoc, "/metafile/clipregion[5]", "bottom", "empty");
+ assertXPath(pDoc, "/metafile/clipregion[5]", "right", "empty");
}
CPPUNIT_TEST_SUITE_REGISTRATION(PictFilterTest);
diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx
index d2f096f4452e..00541e7f2b8f 100644
--- a/vcl/qa/cppunit/svm/svmtest.cxx
+++ b/vcl/qa/cppunit/svm/svmtest.cxx
@@ -1250,8 +1250,8 @@ void SvmTest::checkWallpaper(const GDIMetaFile& rMetaFile)
{
{"left", "0"},
{"top", "0"},
- {"right", "-32767"},
- {"bottom", "-32767"},
+ {"right", "empty"},
+ {"bottom", "empty"},
});
assertXPathAttrs(pDoc, "/metafile/wallpaper[1]/wallpaper",
diff --git a/vcl/source/gdi/mtfxmldump.cxx b/vcl/source/gdi/mtfxmldump.cxx
index c679b08e86e6..00ea60334b33 100644
--- a/vcl/source/gdi/mtfxmldump.cxx
+++ b/vcl/source/gdi/mtfxmldump.cxx
@@ -459,9 +459,14 @@ void writeRectangle(tools::XmlWriter& rWriter, tools::Rectangle const& rRectangl
{
rWriter.attribute("left", rRectangle.Left());
rWriter.attribute("top", rRectangle.Top());
- // FIXME what should we write for empty?
- rWriter.attribute("right", rRectangle.IsWidthEmpty() ? -32767 : rRectangle.Right());
- rWriter.attribute("bottom", rRectangle.IsHeightEmpty() ? -32767 : rRectangle.Bottom());
+ if (rRectangle.IsWidthEmpty())
+ rWriter.attribute("right", OString("empty"));
+ else
+ rWriter.attribute("right", rRectangle.Right());
+ if (rRectangle.IsHeightEmpty())
+ rWriter.attribute("bottom", OString("empty"));
+ else
+ rWriter.attribute("bottom", rRectangle.Bottom());
}
void writeLineInfo(tools::XmlWriter& rWriter, LineInfo const& rLineInfo)