summaryrefslogtreecommitdiff
path: root/oox/source/drawingml/shape.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-06-20 20:56:26 +0200
committerFridrich Strba <fridrich@documentfoundation.org>2013-06-23 04:19:14 +0000
commit34d278a5e6c40dd812480c09754fa1bcc53a71d6 (patch)
treedf05a9d03666cd42e04239a885fa3b71159ee6a6 /oox/source/drawingml/shape.cxx
parent85b05fac54b1b9ed87f5603001a4885a14f3a5ab (diff)
fdo#43641 oox: fix position/size of LineShapes inside lockedCanvas
Change-Id: Idf14d40f174ca87543a829ccfe22ed5cbb8e3cbc (cherry picked from commit 6ada1ddecd98a616114cb36651c0f0f48c6dd3c3) Reviewed-on: https://gerrit.libreoffice.org/4423 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
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 )