diff options
author | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-10-01 03:21:59 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2019-01-07 17:49:44 +0100 |
commit | 3272c1eb5563f3bda2caa24f32b1018372622109 (patch) | |
tree | b4b948fd36ed53b1d8399babf2dbe701469da412 /oox/source/drawingml/shape.cxx | |
parent | 5dfd5755c709e91d2903bd7be4582f7832e89780 (diff) |
related tdf#100074: prepare group shapes text input via writerfilter
Put various preps into place, that enable us to read txbxContent from
group shape children via the writerfilter parser, which gets us much
more features
Also:
- store shapecontexthandler on wrapper class in writerfilter
- move adding children shapes to ctor, not dtor
- remove RuntimeException in Writer's XShapes::add(), aligns this
with Draw/Impress API semantics, and helps here when trying to
add the same shape a 2nd time (which we then simply ignore)
- make oox's Shape notion of 'inside group' less ad-hoc
- make SwTextBoxHelper::getTextRectangle() cope with more than
CustomShape - so passing in a group shape will also yield some
sensible bounding box
- have SwTextBoxHelper handle group content, too
- derive WpsContext from ShapeContext, so we can later substitute it
for that inside WpgContext
- keep WpgContext::onCreateContext() _for the moment_ with the old
delegation to ShapeContext (needs to use WpsContext to enable
writerfilter text input)
Change-Id: I2b0f0583e21137f3321a8dc13823058b14d19773
Reviewed-on: https://gerrit.libreoffice.org/65914
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'oox/source/drawingml/shape.cxx')
-rw-r--r-- | oox/source/drawingml/shape.cxx | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 45d7946816d3..8449082bc774 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -256,7 +256,8 @@ void Shape::addShape( const Reference< XShapes >& rxShapes, const basegfx::B2DHomMatrix& aTransformation, FillProperties& rShapeOrParentShapeFillProps, - ShapeIdMap* pShapeMap ) + ShapeIdMap* pShapeMap, + bool bInGroup ) { SAL_INFO("oox.drawingml", "Shape::addShape: id='" << msId << "'"); @@ -266,7 +267,7 @@ void Shape::addShape( if( !sServiceName.isEmpty() ) { basegfx::B2DHomMatrix aMatrix( aTransformation ); - Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, false, false, aMatrix, rShapeOrParentShapeFillProps ) ); + Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, false, false, aMatrix, rShapeOrParentShapeFillProps, bInGroup ) ); if( pShapeMap && !msId.isEmpty() ) { @@ -391,7 +392,7 @@ void Shape::addChildren( for (auto const& child : rMaster.maChildren) { child->setMasterTextListStyle( mpMasterTextListStyle ); - child->addShape( rFilterBase, pTheme, rxShapes, aChildTransformation, getFillProperties(), pShapeMap ); + child->addShape( rFilterBase, pTheme, rxShapes, aChildTransformation, getFillProperties(), pShapeMap, true ); } } @@ -586,7 +587,8 @@ Reference< XShape > const & Shape::createAndInsert( bool bClearText, bool bDoNotInsertEmptyTextBody, basegfx::B2DHomMatrix& aParentTransformation, - FillProperties& rShapeOrParentShapeFillProps ) + FillProperties& rShapeOrParentShapeFillProps, + bool bInGroup ) { bool bIsEmbMedia = false; SAL_INFO("oox.drawingml", "Shape::createAndInsert: id='" << msId << "' service='" << rServiceName << "'"); @@ -672,8 +674,8 @@ Reference< XShape > const & Shape::createAndInsert( maSize.Height ? maSize.Height : 1.0 ); } - bool bInGroup = !aParentTransformation.isIdentity(); - if( mbFlipH || mbFlipV || mnRotation != 0 || bInGroup ) + bool bNoTranslation = !aParentTransformation.isIdentity(); + if( mbFlipH || mbFlipV || mnRotation != 0 || bNoTranslation ) { // calculate object's center basegfx::B2DPoint aCenter(0.5, 0.5); @@ -768,7 +770,7 @@ Reference< XShape > const & Shape::createAndInsert( // tdf#106792 Not needed anymore due to the change in SdrPathObj::NbcResize: // tdf#96674: Guard against zero width or height. - if (bIsWriter && bInGroup) + if (bIsWriter && bNoTranslation) // Writer's draw page is in twips, and these points get passed // to core without any unit conversion when Writer // postprocesses only the group shape itself. |