diff options
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/vml/vmlformatting.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx index 0dc6a766fee9..c215cc577c7b 100644 --- a/oox/source/vml/vmlformatting.cxx +++ b/oox/source/vml/vmlformatting.cxx @@ -16,6 +16,11 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ + +#include <sal/config.h> + +#include <cstdlib> + #include <oox/vml/vmlformatting.hxx> #include <com/sun/star/beans/PropertyValue.hpp> @@ -873,9 +878,11 @@ void ShadowModel::pushToPropMap(ShapePropertyMap& rPropMap, const GraphicHelper& table::ShadowFormat aFormat; aFormat.Color = sal_Int32(aColor.getColor(rGraphicHelper)); - aFormat.Location = table::ShadowLocation_BOTTOM_RIGHT; + aFormat.Location = nOffsetX < 0 + ? nOffsetY < 0 ? table::ShadowLocation_TOP_LEFT : table::ShadowLocation_BOTTOM_LEFT + : nOffsetY < 0 ? table::ShadowLocation_TOP_RIGHT : table::ShadowLocation_BOTTOM_RIGHT; // The width of the shadow is the average of the x and y values, see SwWW8ImplReader::MatchSdrItemsIntoFlySet(). - aFormat.ShadowWidth = ((nOffsetX + nOffsetY) / 2); + aFormat.ShadowWidth = ((std::abs(nOffsetX) + std::abs(nOffsetY)) / 2); rPropMap.setProperty(PROP_ShadowFormat, aFormat); } |