summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ww8export/ww8export3.cxx
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2019-12-21 16:10:03 +0300
committerMiklos Vajna <vmiklos@collabora.com>2020-01-03 12:13:12 +0100
commit4ca73073a0d7c62b12a7354f76f8f80adc5d98c1 (patch)
tree61c08cb6ffead3de807882b2c963b7b2d94adc4e /sw/qa/extras/ww8export/ww8export3.cxx
parente5f4352d52044957c10f6530f76e97e0ca5cc4b3 (diff)
tdf#129522 SvxShadowItem/writerfilter: allow shadow_NONE overrides
Both editeng and writerfilter were ignoring the case where NONE should override an inherited shadow location. Of course, this situation is very rare. Nearly all unit tests ran when asserting that eLocation is already NONE. The same is true for DOC, except that it is not affected by SvxShadowItem's PutValue problem (and neither is ODT). RTF is not even removing the borderlines themselves, so no point in worrying about the shadow for RTF. Change-Id: I7c1ae67270dde81915daee2f0282aa2074d2ec8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85658 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/qa/extras/ww8export/ww8export3.cxx')
-rw-r--r--sw/qa/extras/ww8export/ww8export3.cxx23
1 files changed, 23 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx
index cb04cc83bc20..231aaabe58ad 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -15,6 +15,7 @@
#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/drawing/LineDash.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/table/ShadowFormat.hpp>
#include <com/sun/star/text/XFormField.hpp>
#include <com/sun/star/text/XTextTable.hpp>
#include <com/sun/star/text/XTextTablesSupplier.hpp>
@@ -285,6 +286,28 @@ DECLARE_WW8EXPORT_TEST(testTdf120711_joinedParagraphWithChangeTracking, "tdf1207
CPPUNIT_ASSERT(style::NumberingType::CHAR_SPECIAL != numFormat);
}
+DECLARE_WW8EXPORT_TEST(testTdf129522_removeShadowStyle, "tdf129522_removeShadowStyle.odt")
+{
+ uno::Reference< container::XNameAccess > paragraphStyles = getStyles("ParagraphStyles");
+ uno::Reference< beans::XPropertySet > xStyleProps(paragraphStyles->getByName("Shadow"), uno::UNO_QUERY_THROW);
+ table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(xStyleProps, "ParaShadowFormat");
+ CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location);
+
+ // Shadows were inherited regardless of whether the style disabled them.
+ xStyleProps.set(paragraphStyles->getByName("Shadow-removed"), uno::UNO_QUERY_THROW);
+ aShadow = getProperty<table::ShadowFormat>(xStyleProps, "ParaShadowFormat");
+ CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_NONE, aShadow.Location);
+
+ uno::Reference< container::XNameAccess > characterStyles = getStyles("CharacterStyles");
+ xStyleProps.set(characterStyles->getByName("CharShadow"), uno::UNO_QUERY_THROW);
+ aShadow = getProperty<table::ShadowFormat>(xStyleProps, "CharShadowFormat");
+ CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location);
+
+ xStyleProps.set(characterStyles->getByName("CharShadow-removed"), uno::UNO_QUERY_THROW);
+ aShadow = getProperty<table::ShadowFormat>(xStyleProps, "CharShadowFormat");
+ //CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_NONE, aShadow.Location);
+}
+
DECLARE_WW8EXPORT_TEST(testBtlrCell, "btlr-cell.doc")
{
// Without the accompanying fix in place, this test would have failed, as