[Libreoffice-commits] core.git: drawinglayer/source
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Wed Nov 20 10:21:26 UTC 2019
drawinglayer/source/tools/primitive2dxmldump.cxx | 63 ++++++++++++++++++++++-
1 file changed, 62 insertions(+), 1 deletion(-)
New commits:
commit b6d794e14e65697fbf47a5b425d9d264e26e0161
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Wed Nov 20 10:18:37 2019 +0100
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Nov 20 11:20:14 2019 +0100
drawinglayer: handle more primitives in the xml dump
In preparation of writing a test for semi-transparent shape text.
Change-Id: I2dac94a6cd9da48de9a5e407ceab78fb8be933d7
Reviewed-on: https://gerrit.libreoffice.org/83264
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
Tested-by: Jenkins
diff --git a/drawinglayer/source/tools/primitive2dxmldump.cxx b/drawinglayer/source/tools/primitive2dxmldump.cxx
index 65170ae096f2..f94896e347f2 100644
--- a/drawinglayer/source/tools/primitive2dxmldump.cxx
+++ b/drawinglayer/source/tools/primitive2dxmldump.cxx
@@ -34,6 +34,7 @@
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
using namespace drawinglayer::primitive2d;
@@ -155,7 +156,7 @@ void Primitive2dXmlDump::decomposeAndWrite(
if (!pBasePrimitive)
continue;
sal_uInt32 nId = pBasePrimitive->getPrimitive2DID();
- if (maFilter[nId])
+ if (nId < maFilter.size() && maFilter[nId])
continue;
OUString sCurrentElementTag = drawinglayer::primitive2d::idToString(nId);
@@ -336,6 +337,66 @@ void Primitive2dXmlDump::decomposeAndWrite(
break;
+ case PRIMITIVE2D_ID_SDRRECTANGLEPRIMITIVE2D:
+ {
+ // SdrRectanglePrimitive2D is private to us.
+ rWriter.startElement("sdrrectangle");
+ drawinglayer::primitive2d::Primitive2DContainer aPrimitiveContainer;
+ pBasePrimitive->get2DDecomposition(aPrimitiveContainer,
+ drawinglayer::geometry::ViewInformation2D());
+ decomposeAndWrite(aPrimitiveContainer, rWriter);
+ rWriter.endElement();
+ break;
+ }
+
+ case PRIMITIVE2D_ID_SDRBLOCKTEXTPRIMITIVE2D:
+ {
+ // SdrBlockTextPrimitive2D is private to us.
+ rWriter.startElement("sdrblocktext");
+ drawinglayer::primitive2d::Primitive2DContainer aPrimitiveContainer;
+ pBasePrimitive->get2DDecomposition(aPrimitiveContainer,
+ drawinglayer::geometry::ViewInformation2D());
+ decomposeAndWrite(aPrimitiveContainer, rWriter);
+ rWriter.endElement();
+ break;
+ }
+
+ case PRIMITIVE2D_ID_TEXTHIERARCHYBLOCKPRIMITIVE2D:
+ {
+ // TextHierarchyBlockPrimitive2D.
+ rWriter.startElement("texthierarchyblock");
+ drawinglayer::primitive2d::Primitive2DContainer aPrimitiveContainer;
+ pBasePrimitive->get2DDecomposition(aPrimitiveContainer,
+ drawinglayer::geometry::ViewInformation2D());
+ decomposeAndWrite(aPrimitiveContainer, rWriter);
+ rWriter.endElement();
+ break;
+ }
+
+ case PRIMITIVE2D_ID_TEXTHIERARCHYPARAGRAPHPRIMITIVE2D:
+ {
+ // TextHierarchyParagraphPrimitive2D.
+ rWriter.startElement("texthierarchyparagraph");
+ drawinglayer::primitive2d::Primitive2DContainer aPrimitiveContainer;
+ pBasePrimitive->get2DDecomposition(aPrimitiveContainer,
+ drawinglayer::geometry::ViewInformation2D());
+ decomposeAndWrite(aPrimitiveContainer, rWriter);
+ rWriter.endElement();
+ break;
+ }
+
+ case PRIMITIVE2D_ID_TEXTHIERARCHYLINEPRIMITIVE2D:
+ {
+ // TextHierarchyLinePrimitive2D.
+ rWriter.startElement("texthierarchyline");
+ drawinglayer::primitive2d::Primitive2DContainer aPrimitiveContainer;
+ pBasePrimitive->get2DDecomposition(aPrimitiveContainer,
+ drawinglayer::geometry::ViewInformation2D());
+ decomposeAndWrite(aPrimitiveContainer, rWriter);
+ rWriter.endElement();
+ break;
+ }
+
default:
{
rWriter.element(OUStringToOString(sCurrentElementTag, RTL_TEXTENCODING_UTF8));
More information about the Libreoffice-commits
mailing list