diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2017-05-25 18:54:37 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2017-06-01 08:10:23 +0200 |
commit | 8d322275b0a4d482296b891a550e538e33986324 (patch) | |
tree | 7ef8f52a8b55020e968f78b9962586438bc7df76 /sw | |
parent | 5bc597c49207be961454cc333425f6d2a9230347 (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 80b5bba9ad9f..636dd76643e6 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx @@ -727,6 +727,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 e8c81d6e575b..b3c0ff237025 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -835,8 +835,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()); |