summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2015-02-19 15:45:25 +0300
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2015-07-28 08:19:08 +0000
commit611d8ee6fe141f9af39c76a864b365d57776db10 (patch)
treee38de36440c5d52c88a97d9f36b069f19ea06403 /writerfilter
parentcc58fe655918e5fba7d75af1a2652e1210e37dc1 (diff)
tdf#49893: final fix for blank rectangle problem
removed artifacts from invalid shape: nested shape instruction destination now is not drawn on its own. instead it is merged with outer shape instruction. this helps to avoid drawing semi-ready shapes. Change-Id: I45589cc1b742d878e5914dd3f66a8184ecfd044c Reviewed-on: https://gerrit.libreoffice.org/14584 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx19
1 files changed, 17 insertions, 2 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 8b251585704d..7f8f7612b9d7 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -5173,9 +5173,13 @@ RTFError RTFDocumentImpl::popState()
break;
case Destination::PICPROP:
case Destination::SHAPEINSTRUCTION:
- // Don't trigger a shape import in case we're only leaving the \shpinst of the groupshape itself.
- if (!m_bObject && !aState.bInListpicture && !aState.bHadShapeText && !(aState.bInShapeGroup && !aState.bInShape))
+ if (m_aStates.size() > 1 && m_aStates[m_aStates.size() - 2].eDestination == Destination::SHAPEINSTRUCTION)
{
+ // Do not resolve shape if shape instruction destination is inside other shape instruction
+ }
+ else if (!m_bObject && !aState.bInListpicture && !aState.bHadShapeText && !(aState.bInShapeGroup && !aState.bInShape))
+ {
+ // Don't trigger a shape import in case we're only leaving the \shpinst of the groupshape itself.
RTFSdrImport::ShapeOrPict eType = (aState.eDestination == Destination::SHAPEINSTRUCTION) ? RTFSdrImport::SHAPE : RTFSdrImport::PICT;
m_pSdrImport->resolve(m_aStates.top().aShape, true, eType);
}
@@ -5976,6 +5980,17 @@ RTFError RTFDocumentImpl::popState()
m_aStates.top().aCharacterAttributes = aState.aCharacterAttributes;
}
break;
+ case Destination::SHAPEINSTRUCTION:
+ if (!m_aStates.empty() && m_aStates.top().eDestination == Destination::SHAPEINSTRUCTION)
+ {
+ // Shape instruction inside other shape instruction: just copy new shape settings:
+ // it will be resolved on end of topmost shape instruction destination
+ m_aStates.top().aShape = aState.aShape;
+ m_aStates.top().aPicture = aState.aPicture;
+ m_aStates.top().aCharacterSprms = aState.aCharacterSprms;
+ m_aStates.top().aCharacterAttributes = aState.aCharacterAttributes;
+ }
+ break;
case Destination::FLYMAINCONTENT:
case Destination::SHPPICT:
case Destination::SHAPE: