[Libreoffice-commits] core.git: drawinglayer/source emfio/qa svgio/qa test/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Nov 8 20:01:31 UTC 2018
drawinglayer/source/tools/emfphelperdata.cxx | 5 ++++-
emfio/qa/cppunit/emf/EmfImportTest.cxx | 19 ++++++++-----------
svgio/qa/cppunit/SvgImportTest.cxx | 4 ++--
test/source/primitive2dxmldump.cxx | 6 +++---
4 files changed, 17 insertions(+), 17 deletions(-)
New commits:
commit 1873ba08d82efdc228462d839e16c802ffb6cfa3
Author: Bartosz Kosiorek <gang65 at poczta.onet.pl>
AuthorDate: Tue Nov 6 00:43:53 2018 +0100
Commit: Bartosz Kosiorek <gang65 at poczta.onet.pl>
CommitDate: Thu Nov 8 20:59:41 2018 +0100
tdf#113624 EMF+ Fix shift of DrawString without StringFormat
While we are drawing DrawString record, in most cases optional
StringFormat information is available.
If StringFromat information is available then we should use default
values.
For LeadingMargin for String the default value is 1/6 inch.
Change-Id: I4a0a68df5ebe74e810f8b5864232b477b3aac255
Reviewed-on: https://gerrit.libreoffice.org/62927
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65 at poczta.onet.pl>
diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx
index dd95f2fb6027..5f35ef931682 100644
--- a/drawinglayer/source/tools/emfphelperdata.cxx
+++ b/drawinglayer/source/tools/emfphelperdata.cxx
@@ -1320,7 +1320,6 @@ namespace emfplushelper
break;
}
mrPropertyHolders.Current().setFont(vcl::Font(font->family, Size(font->emSize, font->emSize)));
- // done reading
const OUString emptyString;
drawinglayer::attribute::FontAttribute fontAttribute(
@@ -1359,6 +1358,10 @@ namespace emfplushelper
}
else
{
+ // By default LeadingMargin is 1/6 inch
+ // TODO for typographic fonts set value to 0.
+ stringAlignmentHorizontalOffset = 16.0;
+
// use system default
locale = Application::GetSettings().GetLanguageTag().getLocale();
}
diff --git a/emfio/qa/cppunit/emf/EmfImportTest.cxx b/emfio/qa/cppunit/emf/EmfImportTest.cxx
index 4eb34e308227..88cd0ea65925 100644
--- a/emfio/qa/cppunit/emf/EmfImportTest.cxx
+++ b/emfio/qa/cppunit/emf/EmfImportTest.cxx
@@ -125,17 +125,14 @@ void Test::TestDrawStringTransparent()
xmlDocPtr pDocument = dumper.dumpAndParse(comphelper::sequenceToContainer<Primitive2DContainer>(aSequence));
CPPUNIT_ASSERT (pDocument);
- //TODO Strange that transparency is set to 0 even if it is not fully transparent
- // check correct import of the DrawString: transparency, height, position, text, color and font
- assertXPath(pDocument, "/primitive2D/metafile/transform/transform/unifiedtransparence", "transparence", "0");
-
- //TODO Where was textsimpleportion gone?
- //assertXPath(pDocument, "/primitive2D/metafile/transform/transform/textsimpleportion", "height", "276");
- //assertXPath(pDocument, "/primitive2D/metafile/transform/transform/textsimpleportion", "x", "25");
- //assertXPath(pDocument, "/primitive2D/metafile/transform/transform/textsimpleportion", "y", "323");
- //assertXPath(pDocument, "/primitive2D/metafile/transform/transform/textsimpleportion", "text", "Transparent Text");
- //assertXPath(pDocument, "/primitive2D/metafile/transform/transform/textsimpleportion", "fontcolor", "#000000");
- //assertXPath(pDocument, "/primitive2D/metafile/transform/transform/textsimpleportion", "familyname", "CALIBRI");
+ assertXPath(pDocument, "/primitive2D/metafile/transform/mask/transform/unifiedtransparence", "transparence", "0.498039215686275");
+
+ assertXPath(pDocument, "/primitive2D/metafile/transform/mask/transform/unifiedtransparence/textsimpleportion", "height", "24");
+ assertXPath(pDocument, "/primitive2D/metafile/transform/mask/transform/unifiedtransparence/textsimpleportion", "x", "66");
+ assertXPath(pDocument, "/primitive2D/metafile/transform/mask/transform/unifiedtransparence/textsimpleportion", "y", "74");
+ assertXPath(pDocument, "/primitive2D/metafile/transform/mask/transform/unifiedtransparence/textsimpleportion", "text", "Transparent Text");
+ assertXPath(pDocument, "/primitive2D/metafile/transform/mask/transform/unifiedtransparence/textsimpleportion", "fontcolor", "#0000ff");
+ assertXPath(pDocument, "/primitive2D/metafile/transform/mask/transform/unifiedtransparence/textsimpleportion", "familyname", "ARIAL");
}
void Test::TestDrawLine()
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index 6b71a0dfeb7a..8174c068d045 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -367,7 +367,7 @@ void Test::testTdf79163()
CPPUNIT_ASSERT (pDocument);
- assertXPath(pDocument, "/primitive2D/transform/unifiedtransparence", "transparence", "0");
+ assertXPath(pDocument, "/primitive2D/transform/unifiedtransparence", "transparence", "0.5");
}
void Test::testTdf97542_1()
@@ -450,7 +450,7 @@ void Test::testRGBAColor()
CPPUNIT_ASSERT (pDocument);
- assertXPath(pDocument, "/primitive2D/transform/unifiedtransparence", "transparence", "0");
+ assertXPath(pDocument, "/primitive2D/transform/unifiedtransparence", "transparence", "0.5");
}
void Test::testTdf97936()
diff --git a/test/source/primitive2dxmldump.cxx b/test/source/primitive2dxmldump.cxx
index fa2b02d4e2cf..ee1f34eda697 100644
--- a/test/source/primitive2dxmldump.cxx
+++ b/test/source/primitive2dxmldump.cxx
@@ -217,8 +217,8 @@ void Primitive2dXmlDump::decomposeAndWrite(
{
const UnifiedTransparencePrimitive2D& rUnifiedTransparencePrimitive2D = dynamic_cast<const UnifiedTransparencePrimitive2D&>(*pBasePrimitive);
rWriter.startElement("unifiedtransparence");
-
- rWriter.attribute("transparence", rUnifiedTransparencePrimitive2D.getTransparence());
+ rWriter.attribute("transparence", OString::number(rUnifiedTransparencePrimitive2D.getTransparence()));
+ decomposeAndWrite(rUnifiedTransparencePrimitive2D.getChildren(), rWriter);
rWriter.endElement();
}
@@ -240,7 +240,7 @@ void Primitive2dXmlDump::decomposeAndWrite(
rWriter.startElement("svgradialgradient");
basegfx::B2DPoint aFocusAttribute = rSvgRadialGradientPrimitive2D.getFocal();
- rWriter.attribute("radius", rSvgRadialGradientPrimitive2D.getRadius());
+ rWriter.attribute("radius", OString::number(rSvgRadialGradientPrimitive2D.getRadius()));
rWriter.attribute("x", aFocusAttribute.getX());
rWriter.attribute("y", aFocusAttribute.getY());
More information about the Libreoffice-commits
mailing list