diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2017-05-25 18:54:37 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-05-28 11:29:17 +0200 |
commit | 46edac18b76d8e9cc74aed8a9712ca3bdadd0972 (patch) | |
tree | a08cce863e02fc8bb163c7e30699d52fd2cbcae7 /sw | |
parent | ba5a9132375bcfedebd7c3d2500006161800da3b (diff) |
Watermark: VML font-family import for textpath
Handle style attribute to get font-family:
<v:textpath style="font-family:"DejaVu Sans Light";font-size:1pt" .../>
Change-Id: I5fe530aecccc57e103b413ef494502f666f1005a
Reviewed-on: https://gerrit.libreoffice.org/38039
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/watermark-font.docx | bin | 0 -> 10705 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport2.cxx | 13 | ||||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 3 |
3 files changed, 14 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/watermark-font.docx b/sw/qa/extras/ooxmlexport/data/watermark-font.docx Binary files differnew file mode 100644 index 000000000000..82d7ec8a83fc --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/watermark-font.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx index 3b4445f8585e..9a13c5aaef21 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx @@ -691,6 +691,19 @@ DECLARE_OOXMLEXPORT_TEST(testWatermark, "watermark.docx") CPPUNIT_ASSERT_EQUAL(drawing::LineStyle_NONE, getProperty<drawing::LineStyle>(xShape, "LineStyle")); } +DECLARE_OOXMLEXPORT_TEST(testWatermarkFont, "watermark-font.docx") +{ + uno::Reference<text::XTextRange> xShape(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("TestFont"), xShape->getString()); + + uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY); + OUString aFont; + + // Check font family + CPPUNIT_ASSERT(xPropertySet->getPropertyValue("CharFontName") >>= aFont); + CPPUNIT_ASSERT_EQUAL(OUString("DejaVu Serif"), aFont); +} + DECLARE_OOXMLEXPORT_TEST(testFdo43093, "fdo43093.docx") { // The problem was that the alignment are not exchange when the paragraph are RTL. diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 60ad0c17719b..88be24d04a53 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -874,8 +874,7 @@ void SwUiWriterTest::testWatermarkDOCX() const SfxWatermarkItem* pWatermark = static_cast<const SfxWatermarkItem*>(pItem); CPPUNIT_ASSERT_EQUAL(OUString("CustomWatermark"), pWatermark->GetText()); - //TODO: VML import textpath style - //CPPUNIT_ASSERT_EQUAL(OUString("DejaVu Sans Light"), pWatermark->GetFont()); + CPPUNIT_ASSERT_EQUAL(OUString("DejaVu Sans Light"), pWatermark->GetFont()); CPPUNIT_ASSERT_EQUAL((sal_Int16)45, pWatermark->GetAngle()); CPPUNIT_ASSERT_EQUAL((sal_uInt32)0x548dd4, pWatermark->GetColor()); CPPUNIT_ASSERT_EQUAL((sal_Int16)50, pWatermark->GetTransparency()); |