summaryrefslogtreecommitdiffstats
path: root/vcl
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2017-06-23 12:16:33 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2017-07-15 11:01:30 +0200
commit48af0b9310023f3789d46d5714498e62728a8d8c (patch)
treeef6f71c5e0eda29bb47453b7bd3dbd5d8b43ecfe /vcl
parentemfplus: finetuning, UnitTest, not active by default (diff)
downloadcore-48af0b9310023f3789d46d5714498e62728a8d8c.tar.gz
core-48af0b9310023f3789d46d5714498e62728a8d8c.zip
emfplus: UnitTests and gerrit build corrections
Needed to migrate UnitTest for Emf/Wmf import from vcl to emfio. Corrected stuff based on gerrit build feedback Change-Id: I7fd2456f814ea19583072ba09730a07e9b9d4061
Diffstat (limited to 'vcl')
-rw-r--r--vcl/CppunitTest_vcl_wmf_test.mk215
-rw-r--r--vcl/Module_vcl.mk1
-rw-r--r--vcl/qa/cppunit/wmf/data/ETO_PDY.emfbin1644 -> 0 bytes
-rw-r--r--vcl/qa/cppunit/wmf/data/ETO_PDY.wmfbin306 -> 0 bytes
-rw-r--r--vcl/qa/cppunit/wmf/data/computer_mail.emfbin45876 -> 0 bytes
-rw-r--r--vcl/qa/cppunit/wmf/data/image1.emfbin233976 -> 0 bytes
-rw-r--r--vcl/qa/cppunit/wmf/data/line_styles.emfbin2748 -> 0 bytes
-rw-r--r--vcl/qa/cppunit/wmf/data/sine_wave.emfbin15456 -> 0 bytes
-rw-r--r--vcl/qa/cppunit/wmf/data/tdf39894.emfbin1628 -> 0 bytes
-rw-r--r--vcl/qa/cppunit/wmf/data/tdf39894.wmfbin300 -> 0 bytes
-rw-r--r--vcl/qa/cppunit/wmf/data/tdf93750.emfbin66416 -> 0 bytes
-rw-r--r--vcl/qa/cppunit/wmf/data/visio_import_source.wmfbin13801 -> 0 bytes
-rw-r--r--vcl/qa/cppunit/wmf/wmfimporttest.cxx317
13 files changed, 0 insertions, 533 deletions
diff --git a/vcl/CppunitTest_vcl_wmf_test.mk b/vcl/CppunitTest_vcl_wmf_test.mk
deleted file mode 100644
index 9e057d9c7581..000000000000
--- a/vcl/CppunitTest_vcl_wmf_test.mk
+++ /dev/null
@@ -1,215 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-$(eval $(call gb_CppunitTest_CppunitTest,vcl_wmf_test))
-
-$(eval $(call gb_CppunitTest_add_exception_objects,vcl_wmf_test, \
- vcl/qa/cppunit/wmf/wmfimporttest \
-))
-
-$(eval $(call gb_CppunitTest_use_externals,vcl_wmf_test,\
- boost_headers \
- libxml2 \
- $(if $(filter PDFIUM,$(BUILD_TYPE)),pdfium) \
-))
-
-$(eval $(call gb_CppunitTest_set_include,vcl_wmf_test,\
- $$(INCLUDE) \
- -I$(SRCDIR)/vcl/inc \
- -I$(SRCDIR)/vcl/source/filter/wmf \
-))
-
-$(eval $(call gb_CppunitTest_use_library_objects,vcl_wmf_test, \
- test-setupvcl \
- vcl \
-))
-
-$(eval $(call gb_CppunitTest_use_externals,vcl_wmf_test,\
- $(if $(filter LINUX MACOSX %BSD SOLARIS,$(OS)), \
- curl) \
- jpeg \
- $(if $(filter-out IOS WNT,$(OS)), \
- nss3 \
- plc4) \
- libeot \
-))
-
-$(eval $(call gb_CppunitTest_use_libraries,vcl_wmf_test,\
- $(call gb_Helper_optional,BREAKPAD, \
- crashreport) \
- basegfx \
- comphelper \
- cppu \
- cppuhelper \
- i18nlangtag \
- i18nutil \
- $(if $(filter OPENCL,$(BUILD_TYPE)),opencl) \
- sal \
- salhelper \
- sot \
- svl \
- svt \
- test \
- tl \
- ucbhelper \
- unotest \
- utl \
- xmlreader \
-))
-
-ifeq ($(OS),MACOSX)
-$(eval $(call gb_CppunitTest_add_libs,vcl_wmf_test,\
- -framework IOKit \
- -F/System/Library/PrivateFrameworks \
- -framework CoreUI \
- -lobjc \
-))
-endif
-
-ifeq ($(ENABLE_JAVA),TRUE)
-$(eval $(call gb_CppunitTest_use_libraries,vcl_wmf_test,\
- jvmaccess \
-))
-endif
-
-$(eval $(call gb_CppunitTest_use_externals,vcl_wmf_test,\
- gio \
- graphite \
- harfbuzz \
- icuuc \
- lcms2 \
-))
-ifeq ($(ENABLE_HEADLESS),)
-$(eval $(call gb_CppunitTest_use_externals,vcl_wmf_test,\
- epoxy \
- ))
-endif
-
-ifeq ($(OS),MACOSX)
-$(eval $(call gb_CppunitTest_use_system_darwin_frameworks,vcl_wmf_test,\
- ApplicationServices \
-))
-$(eval $(call gb_CppunitTest_use_system_darwin_frameworks,vcl_wmf_test,\
- $(if $(filter X86_64,$(CPUNAME)),,QuickTime) \
- Cocoa \
- Carbon \
- CoreFoundation \
-))
-ifneq ($(ENABLE_MACOSX_SANDBOX),TRUE)
-$(eval $(call gb_CppunitTest_use_libraries,vcl_wmf_test,\
- AppleRemote \
-))
-endif
-endif
-
-ifeq ($(USING_X11),TRUE)
-$(eval $(call gb_CppunitTest_use_externals,vcl_wmf_test,\
- cairo \
- cups \
- dbus \
- fontconfig \
- freetype \
- valgrind \
-))
-endif
-
-ifeq ($(ENABLE_HEADLESS),TRUE)
-$(eval $(call gb_CppunitTest_use_externals,vcl_wmf_test,\
- cairo \
- freetype \
- fontconfig \
-))
-else
-ifeq ($(OS),LINUX)
-$(eval $(call gb_CppunitTest_add_libs,vcl_wmf_test,\
- -lm \
- -ldl \
- -lpthread \
- -lX11 \
-))
-endif
-endif
-
-ifeq ($(OS),ANDROID)
-$(eval $(call gb_CppunitTest_add_libs,vcl_wmf_test,\
- -llog \
- -landroid \
- -llo-bootstrap \
-))
-$(eval $(call gb_CppunitTest_use_externals,vcl_wmf_test,\
- cairo \
- fontconfig \
- freetype \
- expat \
-))
-endif
-
-ifeq ($(OS),IOS)
-$(eval $(call gb_CppunitTest_use_system_darwin_frameworks,vcl_wmf_test,\
- UIKit \
- CoreFoundation \
-))
-endif
-
-ifeq ($(OS),WNT)
-$(eval $(call gb_CppunitTest_use_system_win32_libs,vcl_wmf_test,\
- advapi32 \
- crypt32 \
- gdi32 \
- gdiplus \
- imm32 \
- mpr \
- ole32 \
- shell32 \
- usp10 \
- uuid \
- version \
- winspool \
- setupapi \
- shlwapi \
-))
-#$(eval $(call gb_CppunitTest_add_nativeres,vcl_wmf_test,vcl/salsrc))
-endif
-
-ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
-$(eval $(call gb_CppunitTest_add_libs,vcl_wmf_test,\
- -lm $(DLOPEN_LIBS) \
- -lpthread \
- -lX11 \
- -lXext \
-))
-endif
-
-$(eval $(call gb_CppunitTest_use_sdk_api,vcl_wmf_test))
-
-$(eval $(call gb_CppunitTest_use_ure,vcl_wmf_test))
-
-$(eval $(call gb_CppunitTest_use_components,vcl_wmf_test,\
- configmgr/source/configmgr \
- i18npool/util/i18npool \
- ucb/source/core/ucb1 \
- unotools/util/utl \
-))
-
-$(eval $(call gb_CppunitTest_use_configuration,vcl_wmf_test))
-
-# See gb_CppunitTest__use_vcl (solenv/gbuild/CppunitTest.mk; headless):
-ifeq ($(USING_X11),TRUE)
-$(call gb_CppunitTest_get_target,vcl_wmf_test): \
- $(call gb_Library_get_target,desktop_detector)
-endif
-
-# Hack to suppress ASan ODR violation warnings about symbols present in both the
-# vcl objects linked into this test library and the vcl library (which gets
-# dynamically loaded during the test):
-$(call gb_CppunitTest_get_target,vcl_wmf_test): \
- EXTRA_ENV_VARS := \
- ASAN_OPTIONS="$${ASAN_OPTIONS+$$ASAN_OPTIONS:}"detect_odr_violation=0
-
-# vim: set noet sw=4 ts=4:
diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk
index fe5d973907b8..eb5681278951 100644
--- a/vcl/Module_vcl.mk
+++ b/vcl/Module_vcl.mk
@@ -151,7 +151,6 @@ $(eval $(call gb_Module_add_check_targets,vcl,\
CppunitTest_vcl_mapmode \
CppunitTest_vcl_outdev \
CppunitTest_vcl_app_test \
- $(if $(MERGELIBS),,CppunitTest_vcl_wmf_test) \
CppunitTest_vcl_jpeg_read_write_test \
CppunitTest_vcl_svm_test \
CppunitTest_vcl_pdfexport \
diff --git a/vcl/qa/cppunit/wmf/data/ETO_PDY.emf b/vcl/qa/cppunit/wmf/data/ETO_PDY.emf
deleted file mode 100644
index 065698eaff2c..000000000000
--- a/vcl/qa/cppunit/wmf/data/ETO_PDY.emf
+++ /dev/null
Binary files differ
diff --git a/vcl/qa/cppunit/wmf/data/ETO_PDY.wmf b/vcl/qa/cppunit/wmf/data/ETO_PDY.wmf
deleted file mode 100644
index bd97740698e3..000000000000
--- a/vcl/qa/cppunit/wmf/data/ETO_PDY.wmf
+++ /dev/null
Binary files differ
diff --git a/vcl/qa/cppunit/wmf/data/computer_mail.emf b/vcl/qa/cppunit/wmf/data/computer_mail.emf
deleted file mode 100644
index 0dbf23f7f330..000000000000
--- a/vcl/qa/cppunit/wmf/data/computer_mail.emf
+++ /dev/null
Binary files differ
diff --git a/vcl/qa/cppunit/wmf/data/image1.emf b/vcl/qa/cppunit/wmf/data/image1.emf
deleted file mode 100644
index 2dcc32a4cf27..000000000000
--- a/vcl/qa/cppunit/wmf/data/image1.emf
+++ /dev/null
Binary files differ
diff --git a/vcl/qa/cppunit/wmf/data/line_styles.emf b/vcl/qa/cppunit/wmf/data/line_styles.emf
deleted file mode 100644
index 07b78327dabb..000000000000
--- a/vcl/qa/cppunit/wmf/data/line_styles.emf
+++ /dev/null
Binary files differ
diff --git a/vcl/qa/cppunit/wmf/data/sine_wave.emf b/vcl/qa/cppunit/wmf/data/sine_wave.emf
deleted file mode 100644
index e5a4fa6759d1..000000000000
--- a/vcl/qa/cppunit/wmf/data/sine_wave.emf
+++ /dev/null
Binary files differ
diff --git a/vcl/qa/cppunit/wmf/data/tdf39894.emf b/vcl/qa/cppunit/wmf/data/tdf39894.emf
deleted file mode 100644
index c9d5b957b87a..000000000000
--- a/vcl/qa/cppunit/wmf/data/tdf39894.emf
+++ /dev/null
Binary files differ
diff --git a/vcl/qa/cppunit/wmf/data/tdf39894.wmf b/vcl/qa/cppunit/wmf/data/tdf39894.wmf
deleted file mode 100644
index 32e41dee9070..000000000000
--- a/vcl/qa/cppunit/wmf/data/tdf39894.wmf
+++ /dev/null
Binary files differ
diff --git a/vcl/qa/cppunit/wmf/data/tdf93750.emf b/vcl/qa/cppunit/wmf/data/tdf93750.emf
deleted file mode 100644
index 3c4c41592be6..000000000000
--- a/vcl/qa/cppunit/wmf/data/tdf93750.emf
+++ /dev/null
Binary files differ
diff --git a/vcl/qa/cppunit/wmf/data/visio_import_source.wmf b/vcl/qa/cppunit/wmf/data/visio_import_source.wmf
deleted file mode 100644
index 88deac9d248d..000000000000
--- a/vcl/qa/cppunit/wmf/data/visio_import_source.wmf
+++ /dev/null
Binary files differ
diff --git a/vcl/qa/cppunit/wmf/wmfimporttest.cxx b/vcl/qa/cppunit/wmf/wmfimporttest.cxx
deleted file mode 100644
index 96e11c0984d2..000000000000
--- a/vcl/qa/cppunit/wmf/wmfimporttest.cxx
+++ /dev/null
@@ -1,317 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <test/xmltesttools.hxx>
-#include <test/mtfxmldump.hxx>
-#include <test/setupvcl.hxx>
-#include <unotest/bootstrapfixturebase.hxx>
-#include <vcl/wmf.hxx>
-#include <vcl/metaact.hxx>
-
-using namespace css;
-
-class WmfTest : public test::BootstrapFixtureBase, public XmlTestTools
-{
- OUString maDataUrl;
-
- OUString getFullUrl(const OUString& sFileName)
- {
- return m_directories.getURLFromSrc(maDataUrl) + sFileName;
- }
-
-public:
- WmfTest() :
- maDataUrl("/vcl/qa/cppunit/wmf/data/")
- {}
-
- // Hack around missing "once per class" setUp/tearDown in CppUnit; must be
- // called before/after all other tests:
- void globalSetUp() { test::setUpVcl(); }
- // void globalTearDown() { /* DeInitVCL(); */ }
- // on e.g. Mac OS X, DeInitVCL() causes more trouble than it's worth,
- // calling VclPtr<WorkWindow>::disposeAndClear -> ... ->
- // vcl::Window::dispose -> UnoWrapper::WindowDestroy (tk) -> ... ->
- // Application::GetSolarMutex in the vcl library (linked from tk)
- // instead of the vcl objects linked into the unit test library, which
- // isn't initialized
-
- void testNonPlaceableWmf();
- void testSine();
- void testEmfProblem();
- void testEmfLineStyles();
- void testWorldTransformFontSize();
- void testTdf93750();
- void testTdf99402();
- void testTdf39894();
- void testETO_PDY();
-
- CPPUNIT_TEST_SUITE(WmfTest);
- CPPUNIT_TEST(globalSetUp);
- CPPUNIT_TEST(testNonPlaceableWmf);
- CPPUNIT_TEST(testSine);
- CPPUNIT_TEST(testEmfProblem);
- CPPUNIT_TEST(testEmfLineStyles);
- CPPUNIT_TEST(testWorldTransformFontSize);
- CPPUNIT_TEST(testTdf93750);
- CPPUNIT_TEST(testTdf99402);
- CPPUNIT_TEST(testTdf39894);
- CPPUNIT_TEST(testETO_PDY);
- CPPUNIT_TEST_SUITE_END();
-};
-
-void WmfTest::testNonPlaceableWmf()
-{
- SvFileStream aFileStream(getFullUrl("visio_import_source.wmf"), StreamMode::READ);
- GDIMetaFile aGDIMetaFile;
- ReadWindowMetafile(aFileStream, aGDIMetaFile);
-
- MetafileXmlDump dumper;
- dumper.filterAllActionTypes();
- dumper.filterActionType(MetaActionType::POLYLINE, false);
- xmlDocPtr pDoc = dumper.dumpAndParse(aGDIMetaFile);
-
- CPPUNIT_ASSERT (pDoc);
-
- assertXPath(pDoc, "/metafile/polyline[1]/point[1]", "x", "16798");
- assertXPath(pDoc, "/metafile/polyline[1]/point[1]", "y", "1003");
-
- assertXPath(pDoc, "/metafile/polyline[1]/point[2]", "x", "16798");
- assertXPath(pDoc, "/metafile/polyline[1]/point[2]", "y", "7507");
-
- assertXPath(pDoc, "/metafile/polyline[1]/point[3]", "x", "26090");
- assertXPath(pDoc, "/metafile/polyline[1]/point[3]", "y", "7507");
-
- assertXPath(pDoc, "/metafile/polyline[1]/point[4]", "x", "26090");
- assertXPath(pDoc, "/metafile/polyline[1]/point[4]", "y", "1003");
-
- assertXPath(pDoc, "/metafile/polyline[1]/point[5]", "x", "16798");
- assertXPath(pDoc, "/metafile/polyline[1]/point[5]", "y", "1003");
-}
-
-void WmfTest::testSine()
-{
- SvFileStream aFileStream(getFullUrl("sine_wave.emf"), StreamMode::READ);
- GDIMetaFile aGDIMetaFile;
- ReadWindowMetafile(aFileStream, aGDIMetaFile);
-
- MetafileXmlDump dumper;
- dumper.filterAllActionTypes();
- dumper.filterActionType(MetaActionType::ISECTRECTCLIPREGION, false);
- xmlDocPtr pDoc = dumper.dumpAndParse(aGDIMetaFile);
-
- CPPUNIT_ASSERT (pDoc);
-
- assertXPath(pDoc, "/metafile/sectrectclipregion", 0);
-}
-
-void WmfTest::testEmfProblem()
-{
- SvFileStream aFileStream(getFullUrl("computer_mail.emf"), StreamMode::READ);
- GDIMetaFile aGDIMetaFile;
- ReadWindowMetafile(aFileStream, aGDIMetaFile);
-
- MetafileXmlDump dumper;
- dumper.filterAllActionTypes();
- dumper.filterActionType(MetaActionType::ISECTRECTCLIPREGION, false);
- xmlDocPtr pDoc = dumper.dumpAndParse(aGDIMetaFile);
-
- CPPUNIT_ASSERT (pDoc);
-
- assertXPath(pDoc, "/metafile/sectrectclipregion[1]", "top", "427");
- assertXPath(pDoc, "/metafile/sectrectclipregion[1]", "left", "740");
- assertXPath(pDoc, "/metafile/sectrectclipregion[1]", "bottom", "2823");
- assertXPath(pDoc, "/metafile/sectrectclipregion[1]", "right", "1876");
-}
-
-void WmfTest::testEmfLineStyles()
-{
- SvFileStream aFileStream(getFullUrl("line_styles.emf"), StreamMode::READ);
- GDIMetaFile aGDIMetaFile;
- ReadWindowMetafile(aFileStream, aGDIMetaFile);
-
- MetafileXmlDump dumper;
- dumper.filterAllActionTypes();
- dumper.filterActionType(MetaActionType::LINE, false);
- dumper.filterActionType(MetaActionType::LINECOLOR, false);
- xmlDocPtr pDoc = dumper.dumpAndParse(aGDIMetaFile);
-
- CPPUNIT_ASSERT (pDoc);
-
- assertXPath(pDoc, "/metafile/line", 4);
- assertXPath(pDoc, "/metafile/linecolor", 5);
-
- assertXPath(pDoc, "/metafile/linecolor[1]", "color", "#ffffff");
- assertXPath(pDoc, "/metafile/linecolor[2]", "color", "#00ff00");
- assertXPath(pDoc, "/metafile/linecolor[3]", "color", "#408080");
- assertXPath(pDoc, "/metafile/linecolor[4]", "color", "#ff0000");
- assertXPath(pDoc, "/metafile/linecolor[5]", "color", "#0000ff");
-
- assertXPath(pDoc, "/metafile/line[1]", "style", "dash");
- assertXPath(pDoc, "/metafile/line[1]", "dashlen", "528");
- assertXPath(pDoc, "/metafile/line[1]", "dashcount", "1");
- assertXPath(pDoc, "/metafile/line[1]", "dotlen", "176");
- assertXPath(pDoc, "/metafile/line[1]", "dotcount", "0");
- assertXPath(pDoc, "/metafile/line[1]", "distance", "176");
- assertXPath(pDoc, "/metafile/line[1]", "join", "miter");
- assertXPath(pDoc, "/metafile/line[1]", "cap", "butt");
-
- assertXPath(pDoc, "/metafile/line[2]", "style", "dash");
- assertXPath(pDoc, "/metafile/line[2]", "dashlen", "528");
- assertXPath(pDoc, "/metafile/line[2]", "dashcount", "0");
- assertXPath(pDoc, "/metafile/line[2]", "dotlen", "176");
- assertXPath(pDoc, "/metafile/line[2]", "dotcount", "1");
- assertXPath(pDoc, "/metafile/line[2]", "distance", "176");
- assertXPath(pDoc, "/metafile/line[2]", "join", "miter");
- assertXPath(pDoc, "/metafile/line[2]", "cap", "butt");
-
- assertXPath(pDoc, "/metafile/line[3]", "style", "dash");
- assertXPath(pDoc, "/metafile/line[3]", "dashlen", "528");
- assertXPath(pDoc, "/metafile/line[3]", "dashcount", "1");
- assertXPath(pDoc, "/metafile/line[3]", "dotlen", "176");
- assertXPath(pDoc, "/metafile/line[3]", "dotcount", "1");
- assertXPath(pDoc, "/metafile/line[3]", "distance", "176");
- assertXPath(pDoc, "/metafile/line[3]", "join", "miter");
- assertXPath(pDoc, "/metafile/line[3]", "cap", "butt");
-
- assertXPath(pDoc, "/metafile/line[4]", "style", "dash");
- assertXPath(pDoc, "/metafile/line[4]", "dashlen", "528");
- assertXPath(pDoc, "/metafile/line[4]", "dashcount", "1");
- assertXPath(pDoc, "/metafile/line[4]", "dotlen", "176");
- assertXPath(pDoc, "/metafile/line[4]", "dotcount", "2");
- assertXPath(pDoc, "/metafile/line[4]", "distance", "176");
- assertXPath(pDoc, "/metafile/line[4]", "join", "miter");
- assertXPath(pDoc, "/metafile/line[4]", "cap", "butt");
-};
-
-void WmfTest::testWorldTransformFontSize()
-{
- SvFileStream aFileStream(getFullUrl("image1.emf"), StreamMode::READ);
- GDIMetaFile aGDIMetaFile;
- ReadWindowMetafile(aFileStream, aGDIMetaFile);
-
- MetafileXmlDump dumper;
- dumper.filterAllActionTypes();
- dumper.filterActionType(MetaActionType::FONT, false);
- xmlDocPtr pDoc = dumper.dumpAndParse(aGDIMetaFile);
-
- CPPUNIT_ASSERT (pDoc);
-
- assertXPath(pDoc, "/metafile/font", 8);
-
- assertXPath(pDoc, "/metafile/font[1]", "color", "#595959");
- assertXPath(pDoc, "/metafile/font[1]", "width", "0");
- assertXPath(pDoc, "/metafile/font[1]", "height", "389");
- assertXPath(pDoc, "/metafile/font[1]", "orientation", "0");
- assertXPath(pDoc, "/metafile/font[1]", "weight", "bold");
-
- // World transform should not affect font size. Rotating text for 90 degrees
- // should not exchange font width and height.
- assertXPath(pDoc, "/metafile/font[3]", "color", "#000000");
- assertXPath(pDoc, "/metafile/font[3]", "width", "0");
- assertXPath(pDoc, "/metafile/font[3]", "height", "530");
- assertXPath(pDoc, "/metafile/font[3]", "orientation", "900");
- assertXPath(pDoc, "/metafile/font[3]", "weight", "normal");
-}
-
-void WmfTest::testTdf93750()
-{
- SvFileStream aFileStream(getFullUrl("tdf93750.emf"), StreamMode::READ);
- GDIMetaFile aGDIMetaFile;
- ReadWindowMetafile(aFileStream, aGDIMetaFile);
-
- MetafileXmlDump dumper;
- xmlDocPtr pDoc = dumper.dumpAndParse(aGDIMetaFile);
-
- CPPUNIT_ASSERT (pDoc);
-
- assertXPath(pDoc, "/metafile/push[1]/comment[2]", "datasize", "28");
- assertXPath(pDoc, "/metafile/push[1]/comment[3]", "datasize", "72");
-}
-
-void WmfTest::testTdf99402()
-{
- // Symbol font should arrive with RTL_TEXTENCODING_SYMBOL encoding,
- // even if charset is OEM_CHARSET/DEFAULT_CHARSET in WMF
- LOGFONTW logfontw;
- logfontw.lfHeight = 0;
- logfontw.lfWidth = 0;
- logfontw.lfEscapement = 0;
- logfontw.lfWeight = 0;
- logfontw.lfItalic = 0;
- logfontw.lfUnderline = 0;
- logfontw.lfStrikeOut = 0;
- logfontw.lfCharSet = OEM_CHARSET;
- logfontw.lfPitchAndFamily = FF_ROMAN | DEFAULT_PITCH;
- logfontw.alfFaceName = "Symbol";
-
- WinMtfFontStyle fontStyle(logfontw);
-
- CPPUNIT_ASSERT_EQUAL(RTL_TEXTENCODING_SYMBOL, fontStyle.aFont.GetCharSet());
-}
-
-void WmfTest::testTdf39894()
-{
- OUString files[] = { "tdf39894.wmf", "tdf39894.emf" };
- for (const auto& file: files)
- {
- SvFileStream aFileStream(getFullUrl(file), StreamMode::READ);
- GDIMetaFile aGDIMetaFile;
- ReadWindowMetafile(aFileStream, aGDIMetaFile);
-
- MetafileXmlDump dumper;
- xmlDocPtr pDoc = dumper.dumpAndParse(aGDIMetaFile);
-
- CPPUNIT_ASSERT(pDoc);
-
- // The x position of the second text must take into account
- // the previous text's last Dx (previously was ~300)
- auto x = getXPath(pDoc, "/metafile/push[2]/textarray[2]", "x");
- CPPUNIT_ASSERT_MESSAGE(file.toUtf8().getStr(), x.toInt32() > 2700);
- }
-}
-
-void WmfTest::testETO_PDY()
-{
- OUString files[] = { "ETO_PDY.wmf", "ETO_PDY.emf" };
- for (const auto& file: files)
- {
- SvFileStream aFileStream(getFullUrl(file), StreamMode::READ);
- GDIMetaFile aGDIMetaFile;
- ReadWindowMetafile(aFileStream, aGDIMetaFile);
-
- MetafileXmlDump dumper;
- xmlDocPtr pDoc = dumper.dumpAndParse(aGDIMetaFile);
-
- CPPUNIT_ASSERT(pDoc);
-
- // The y position of following text
- // must be smaller than that of previous
- auto y1 = getXPath(pDoc, "/metafile/push[2]/textarray[1]", "y");
- auto y2 = getXPath(pDoc, "/metafile/push[2]/textarray[2]", "y");
- auto y3 = getXPath(pDoc, "/metafile/push[2]/textarray[3]", "y");
- CPPUNIT_ASSERT_MESSAGE(file.toUtf8().getStr(), y2.toInt32() < y1.toInt32());
- CPPUNIT_ASSERT_MESSAGE(file.toUtf8().getStr(), y3.toInt32() < y2.toInt32());
- }
-}
-
-CPPUNIT_TEST_SUITE_REGISTRATION(WmfTest);
-
-CPPUNIT_PLUGIN_IMPLEMENT();
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */