summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-03-31 15:00:35 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-03-31 15:39:52 +0200
commitc7837b8caad61b8c0dfd3704a133cdeaffd69b06 (patch)
tree5fd2bc2bc492b843f083629bd615a0a8887d51ed
parent53851801c62185541ccbee4421f9327b225771a2 (diff)
sw: fix DOC/DOCX/RTF export of TextFrame background color
Change-Id: I8b7c23af7548a0eb073e046eedfbabfb9f78fafe
-rw-r--r--sw/inc/unobrushitemhelper.hxx3
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx3
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx20
3 files changed, 22 insertions, 4 deletions
diff --git a/sw/inc/unobrushitemhelper.hxx b/sw/inc/unobrushitemhelper.hxx
index 1c6a3ec9913e..fa66383575b4 100644
--- a/sw/inc/unobrushitemhelper.hxx
+++ b/sw/inc/unobrushitemhelper.hxx
@@ -20,11 +20,12 @@
#ifndef _UNOBRUSHITEMHELPER_HXX
#define _UNOBRUSHITEMHELPER_HXX
+#include <swdllapi.h>
#include <editeng/brushitem.hxx>
//UUUU helper function definintions for UNO API fallbacks to replace SvxBrushItem
void setSvxBrushItemAsFillAttributesToTargetSet(const SvxBrushItem& rBrush, SfxItemSet& rToSet);
-SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_Bool bSearchInParents = sal_True);
+SW_DLLPUBLIC SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_Bool bSearchInParents = sal_True);
#endif // _UNOBRUSHITEMHELPER_HXX
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 0094004e5060..4b409adc55c4 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -459,8 +459,6 @@ DECLARE_RTFEXPORT_TEST(testHyperlink, "hyperlink.rtf")
CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(getRun(getParagraph(1), 3, "!"), "HyperLinkURL"));
}
-#if 0
-// FIXME port to FillAttributes
DECLARE_RTFEXPORT_TEST(testTextFrameBorders, "textframe-borders.rtf")
{
uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
@@ -477,7 +475,6 @@ DECLARE_RTFEXPORT_TEST(testTextFrameBorders, "textframe-borders.rtf")
CPPUNIT_ASSERT_EQUAL(sal_Int16(48), aShadowFormat.ShadowWidth);
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x622423), aShadowFormat.Color);
}
-#endif
#if 0
// FIXME port to FillAttributes
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index ea1592bb052c..163a3fc43217 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -112,6 +112,8 @@
#include <breakit.hxx>
#include <com/sun/star/i18n/ScriptType.hpp>
#include <unotools/localedatawrapper.hxx>
+#include <unobrushitemhelper.hxx>
+#include <svx/xenum.hxx>
#include <tgrditem.hxx>
#include <flddropdown.hxx>
#include <chpfld.hxx>
@@ -826,6 +828,24 @@ void MSWordExportBase::OutputFormat( const SwFmt& rFmt, bool bPapFmt, bool bChpF
if (SFX_ITEM_SET != aSet.GetItemState(RES_SURROUND))
aSet.Put(SwFmtSurround(SURROUND_NONE));
+ const XFillStyleItem* pXFillStyleItem(static_cast< const XFillStyleItem* >(rFrmFmt.GetAttrSet().GetItem(XATTR_FILLSTYLE)));
+ if (pXFillStyleItem)
+ {
+ switch (pXFillStyleItem->GetValue())
+ {
+ case XFILL_NONE:
+ break;
+ case XFILL_SOLID:
+ {
+ // Construct an SvxBrushItem, as expected by the exporters.
+ aSet.Put(getSvxBrushItemFromSourceSet(rFrmFmt.GetAttrSet()));
+ break;
+ }
+ default:
+ break;
+ }
+ }
+
bOutFlyFrmAttrs = true;
//script doesn't matter if not exporting chp
OutputItemSet(aSet, true, false,