diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-10-04 23:11:58 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-10-15 02:56:32 +0000 |
commit | 99e3cf1ce98357ae068b52d726be1b76df5278fe (patch) | |
tree | 047efe37f2d44f3300fa4e729afca8b04a55ec65 /chart2 | |
parent | tdf#103170 Add contextual image section buttons (diff) | |
download | core-99e3cf1ce98357ae068b52d726be1b76df5278fe.tar.gz core-99e3cf1ce98357ae068b52d726be1b76df5278fe.zip |
avoid exception
Transformation is an optional property of XShape,
rATransformation can refer to an empty Any.
results in warnings like this, e.g. when you add a legend:
> warn:chart2:27587:1:chart2/source/view/main/ShapeFactory.cxx:2135:
> Exception caught. Type: N3com3sun4star3uno9ExceptionE, Message:
set Transformation property only if needed
Change-Id: I1edae0a984f8264a6a0638b90a7197e316832c02
Reviewed-on: https://gerrit.libreoffice.org/29527
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/main/ShapeFactory.cxx | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx index bf8de1628401..d9ccc32000d6 100644 --- a/chart2/source/view/main/ShapeFactory.cxx +++ b/chart2/source/view/main/ShapeFactory.cxx @@ -2225,15 +2225,18 @@ uno::Reference< drawing::XShape > //set whole text shape properties PropertyMapper::setMultiProperties( rPropNames, rPropValues, xProp ); - //set position matrix - //the matrix needs to be set at the end behind autogrow and such position influencing properties - try - { - xProp->setPropertyValue( "Transformation", rATransformation ); - } - catch( const uno::Exception& e ) + if (rATransformation.hasValue()) { - ASSERT_EXCEPTION( e ); + //set position matrix + //the matrix needs to be set at the end behind autogrow and such position influencing properties + try + { + xProp->setPropertyValue( "Transformation", rATransformation ); + } + catch( const uno::Exception& e ) + { + ASSERT_EXCEPTION( e ); + } } } return xShape; |