Kaydet (Commit) 27ad84a9 authored tarafından Cédric Bosdonnat's avatar Cédric Bosdonnat Kaydeden (comit) Cédric Bosdonnat

n#779627: support for arcsize value in VML

Change-Id: If03f36d30a7861f5d14ed3142e339d52da0bdce0
üst 7539a695
...@@ -77,6 +77,7 @@ struct ShapeTypeModel ...@@ -77,6 +77,7 @@ struct ShapeTypeModel
sal_Bool mbAutoHeight; ///< If true, the height value is a minimum value (mostly used for textboxes) sal_Bool mbAutoHeight; ///< If true, the height value is a minimum value (mostly used for textboxes)
sal_Bool mbVisible; ///< Visible or Hidden sal_Bool mbVisible; ///< Visible or Hidden
::rtl::OUString maWrapStyle; ///< Wrapping mode for text. ::rtl::OUString maWrapStyle; ///< Wrapping mode for text.
::rtl::OUString maArcsize; ///< round rectangles arc size
StrokeModel maStrokeModel; ///< Border line formatting. StrokeModel maStrokeModel; ///< Border line formatting.
FillModel maFillModel; ///< Shape fill formatting. FillModel maFillModel; ///< Shape fill formatting.
......
...@@ -101,6 +101,7 @@ CopyBack ...@@ -101,6 +101,7 @@ CopyBack
CopyFormulas CopyFormulas
CopyOutputData CopyOutputData
CopyStyles CopyStyles
CornerRadius
CrossoverPosition CrossoverPosition
CrossoverValue CrossoverValue
CursorPositionX CursorPositionX
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <algorithm>
#include "oox/vml/vmlshape.hxx" #include "oox/vml/vmlshape.hxx"
#include <com/sun/star/beans/PropertyValues.hpp> #include <com/sun/star/beans/PropertyValues.hpp>
...@@ -502,7 +504,22 @@ Reference<XShape> RectangleShape::implConvertAndInsert(const Reference<XShapes>& ...@@ -502,7 +504,22 @@ Reference<XShape> RectangleShape::implConvertAndInsert(const Reference<XShapes>&
return SimpleShape::createPictureObject(rxShapes, rShapeRect, aGraphicPath); return SimpleShape::createPictureObject(rxShapes, rShapeRect, aGraphicPath);
// default: try to create a rectangle shape // default: try to create a rectangle shape
return SimpleShape::implConvertAndInsert(rxShapes, rShapeRect); Reference<XShape> xShape = SimpleShape::implConvertAndInsert(rxShapes, rShapeRect);
rtl::OUString sArcsize = maTypeModel.maArcsize;
if ( !sArcsize.isEmpty( ) )
{
sal_Unicode cLastChar = sArcsize[sArcsize.getLength() - 1];
sal_Int32 nValue = sArcsize.copy( 0, sArcsize.getLength() - 1 ).toInt32( );
// Get the smallest half-side
double size = std::min( rShapeRect.Height, rShapeRect.Width ) / 2.0;
sal_Int32 nRadius = 0;
if ( cLastChar == 'f' )
nRadius = size * nValue / 65536;
else if ( cLastChar == '%' )
nRadius = size * nValue / 100;
PropertySet( xShape ).setAnyProperty( PROP_CornerRadius, makeAny( nRadius ) );
}
return xShape;
} }
// ============================================================================ // ============================================================================
......
...@@ -280,6 +280,9 @@ ShapeTypeContext::ShapeTypeContext( ContextHandler2Helper& rParent, ShapeType& r ...@@ -280,6 +280,9 @@ ShapeTypeContext::ShapeTypeContext( ContextHandler2Helper& rParent, ShapeType& r
// fill settings (may be overridden by v:fill element later) // fill settings (may be overridden by v:fill element later)
mrTypeModel.maFillModel.moFilled = lclDecodeBool( rAttribs, XML_filled ); mrTypeModel.maFillModel.moFilled = lclDecodeBool( rAttribs, XML_filled );
mrTypeModel.maFillModel.moColor = rAttribs.getString( XML_fillcolor ); mrTypeModel.maFillModel.moColor = rAttribs.getString( XML_fillcolor );
// For roundrect we may have a arcsize attribute to read
mrTypeModel.maArcsize = rAttribs.getString( XML_arcsize,rtl::OUString( ) );
} }
ContextHandlerRef ShapeTypeContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) ContextHandlerRef ShapeTypeContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment