summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-08-13 15:20:24 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-08-13 17:35:15 +0200
commit65afb07d56e8faf0cf020de784747046cbcb9d0e (patch)
tree91dbe4df7ebb275a092c9d420a942e6a5f99e9b8 /sw
parent590751d98e10867609c45fff93edae53dfaef3a8 (diff)
DOCX export of paragraph border drop shadow
Instead of passing over shadow location only in case of page borders, do the same for paragraph borders as well. Change-Id: I311638fe0f41ef47ae351f7d199bfbc8b8aabfbe
Diffstat (limited to 'sw')
-rwxr-xr-xsw/qa/extras/ooxmlexport/data/para-shadow.docxbin0 -> 4056 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx12
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx16
3 files changed, 20 insertions, 8 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/para-shadow.docx b/sw/qa/extras/ooxmlexport/data/para-shadow.docx
new file mode 100755
index 000000000000..d35d5f958dfe
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/para-shadow.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 0b4003eb5d3c..fc55bb973e70 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -106,6 +106,7 @@ public:
void testFdo65718();
void testFdo64350();
void testFdo67013();
+ void testParaShadow();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -188,6 +189,7 @@ void Test::run()
{"fdo65718.docx", &Test::testFdo65718},
{"fdo64350.docx", &Test::testFdo64350},
{"fdo67013.docx", &Test::testFdo67013},
+ {"para-shadow.docx", &Test::testParaShadow},
};
// Don't test the first import of these, for some reason those tests fail
const char* aBlacklist[] = {
@@ -1134,6 +1136,16 @@ void Test::testFdo67013()
CPPUNIT_ASSERT_EQUAL(sal_Int16(106), aFooterTopBorder.OuterLineWidth);
}
+void Test::testParaShadow()
+{
+ // The problem was that in w:pBdr, child elements had a w:shadow attribute, but that was ignored.
+ table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(getParagraph(2), "ParaShadowFormat");
+ CPPUNIT_ASSERT_EQUAL(COL_BLACK, sal_uInt32(aShadow.Color));
+ CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location);
+ // w:sz="48" is in eights of a point, 1 pt is 20 twips.
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(TWIP_TO_MM100(24/8*20)), aShadow.ShadowWidth);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 55de9c98dfaf..51caae9e5b20 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -5125,6 +5125,14 @@ void DocxAttributeOutput::FormatBox( const SvxBoxItem& rBox )
OutputBorderOptions aOutputBorderOptions = lcl_getBoxBorderOptions();
+ // Check if there is a shadow item
+ const SfxPoolItem* pItem = GetExport().HasItem( RES_SHADOW );
+ if ( pItem )
+ {
+ const SvxShadowItem* pShadowItem = (const SvxShadowItem*)pItem;
+ aOutputBorderOptions.aShadowLocation = pShadowItem->GetLocation();
+ }
+
if ( m_bOpenedSectPr && GetWritingHeaderFooter() == false)
{
@@ -5133,14 +5141,6 @@ void DocxAttributeOutput::FormatBox( const SvxBoxItem& rBox )
// Check if the distance is larger than 31 points
aOutputBorderOptions.bCheckDistanceSize = true;
- // Check if there is a shadow item
- const SfxPoolItem* pItem = GetExport().HasItem( RES_SHADOW );
- if ( pItem )
- {
- const SvxShadowItem* pShadowItem = (const SvxShadowItem*)pItem;
- aOutputBorderOptions.aShadowLocation = pShadowItem->GetLocation();
- }
-
impl_borders( m_pSerializer, rBox, aOutputBorderOptions, &m_pageMargins );
// Special handling for pgBorder