summaryrefslogtreecommitdiff
path: root/oox/source/drawingml/shape.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'oox/source/drawingml/shape.cxx')
-rw-r--r--oox/source/drawingml/shape.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index acb71281b6a7..0d3a2868dd3e 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -81,6 +81,7 @@ Shape::Shape( const sal_Char* pServiceName )
, mbFlipV( false )
, mbHidden( false )
, mbHiddenMasterShape( false )
+, mbLockedCanvas( false )
{
if ( pServiceName )
msServiceName = OUString::createFromAscii( pServiceName );
@@ -115,6 +116,7 @@ Shape::Shape( const ShapePtr& pSourceShape )
, mbFlipV( pSourceShape->mbFlipV )
, mbHidden( pSourceShape->mbHidden )
, mbHiddenMasterShape( pSourceShape->mbHiddenMasterShape )
+, mbLockedCanvas( pSourceShape->mbLockedCanvas )
{}
@@ -223,6 +225,16 @@ void Shape::addShape(
}
}
+void Shape::setLockedCanvas(bool bLockedCanvas)
+{
+ mbLockedCanvas = bLockedCanvas;
+}
+
+bool Shape::getLockedCanvas()
+{
+ return mbLockedCanvas;
+}
+
void Shape::applyShapeReference( const Shape& rReferencedShape, bool bUseText )
{
SAL_INFO("oox", "apply shape reference: " << rReferencedShape.msId << " to shape id: " << msId);
@@ -560,6 +572,12 @@ Reference< XShape > Shape::createAndInsert(
if( aServiceName != "com.sun.star.drawing.GroupShape" )
{
PropertySet( xSet ).setProperties( aShapeProps );
+ if (mbLockedCanvas && aServiceName == "com.sun.star.drawing.LineShape")
+ {
+ // It seems the position and size for lines inside a locked canvas is absolute.
+ mxShape->setPosition(awt::Point(aShapeRectHmm.X, aShapeRectHmm.Y));
+ mxShape->setSize(awt::Size(aShapeRectHmm.Width, aShapeRectHmm.Height));
+ }
}
if( bIsCustomShape )