summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEilidh McAdam <eilidh@lanedo.com>2012-09-27 12:39:59 +0100
committerNoel Power <noel.power@suse.com>2012-09-27 12:48:30 +0000
commit57633e42ffba2f495fd685233695acad6b9dde94 (patch)
tree433c2661aff1801f43d58f8e4170213770804829
parentdca431cfea27385ffbcbebd3f080176a809bf9a2 (diff)
Export image shadow effects to docx.
Change-Id: Ic8be107eeaeed286359869fd7e6712c3f740fba5 Reviewed-on: https://gerrit.libreoffice.org/709 Reviewed-by: Noel Power <noel.power@suse.com> Tested-by: Noel Power <noel.power@suse.com>
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx32
1 files changed, 32 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index e4cd0924f1c5..1252a3bec04e 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2176,6 +2176,38 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode& rGrfNode, const Size
m_pSerializer->singleElementNS( XML_a, XML_tailEnd,
FSEND );
m_pSerializer->endElementNS( XML_a, XML_ln );
+
+ // Output effects
+ SvxShadowItem aShadowItem = rGrfNode.GetFlyFmt()->GetShadow();
+ if ( aShadowItem.GetLocation() != SVX_SHADOW_NONE )
+ {
+ // Distance is measured diagonally from corner
+ double nShadowDist = sqrt((aShadowItem.GetWidth()*aShadowItem.GetWidth())*2);
+ OString aShadowDist( OString::valueOf( TwipsToEMU( nShadowDist ) ) );
+ OString aShadowColor = impl_ConvertColor( aShadowItem.GetColor() );
+ sal_uInt32 nShadowDir = 0;
+ switch ( aShadowItem.GetLocation() )
+ {
+ case SVX_SHADOW_TOPLEFT: nShadowDir = 13500000; break;
+ case SVX_SHADOW_TOPRIGHT: nShadowDir = 18900000; break;
+ case SVX_SHADOW_BOTTOMLEFT: nShadowDir = 8100000; break;
+ case SVX_SHADOW_BOTTOMRIGHT: nShadowDir = 2700000; break;
+ case SVX_SHADOW_NONE:
+ case SVX_SHADOW_END:
+ break;
+ }
+ OString aShadowDir( OString::valueOf( long(nShadowDir) ) );
+
+ m_pSerializer->startElementNS( XML_a, XML_effectLst, FSEND );
+ m_pSerializer->startElementNS( XML_a, XML_outerShdw,
+ XML_dist, aShadowDist.getStr(),
+ XML_dir, aShadowDir.getStr(), FSEND );
+ m_pSerializer->singleElementNS( XML_a, XML_srgbClr,
+ XML_val, aShadowColor.getStr(), FSEND );
+ m_pSerializer->endElementNS( XML_a, XML_outerShdw );
+ m_pSerializer->endElementNS( XML_a, XML_effectLst );
+ }
+
m_pSerializer->endElementNS( XML_pic, XML_spPr );
m_pSerializer->endElementNS( XML_pic, XML_pic );