summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-07-26 11:57:34 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-07-26 12:55:02 +0200
commite849f5d84a4bc35a241c2d1231b48c57c43ecce4 (patch)
tree6e1f91f212487b53de32b5fc43583160210f319b /writerfilter
parentaf1ce3de97a6c1d583f82558ee18054b7917b03d (diff)
RTF import: fix groupshape import when shapes don't contain text
Without this, the groupshape itself was created, not it had no child shapes. Change-Id: I5d3276498eb3ffe840f3d42dad16661849596da4
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx5
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.hxx1
2 files changed, 5 insertions, 1 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 840c2c263ee7..56e175952183 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1327,6 +1327,7 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
case RTF_SHP:
m_bNeedCrOrig = m_bNeedCr;
m_aStates.top().nDestinationState = DESTINATION_SHAPE;
+ m_aStates.top().bInShape = true;
break;
case RTF_SHPINST:
m_aStates.top().nDestinationState = DESTINATION_SHAPEINSTRUCTION;
@@ -3930,7 +3931,8 @@ int RTFDocumentImpl::popState()
break;
case DESTINATION_PICPROP:
case DESTINATION_SHAPEINSTRUCTION:
- if (!m_bObject && !aState.bInListpicture && !m_aStates.top().bHadShapeText && !m_aStates.top().bInShapeGroup)
+ // 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))
m_pSdrImport->resolve(m_aStates.top().aShape, true);
break;
case DESTINATION_BOOKMARKSTART:
@@ -4808,6 +4810,7 @@ RTFParserState::RTFParserState(RTFDocumentImpl *pDocumentImpl)
bInBackground(false),
bHadShapeText(false),
bInShapeGroup(false),
+ bInShape(false),
bCreatedShapeGroup(false),
bStartedTrackchange(false)
{
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index d55572e74491..86b6912f4df3 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -263,6 +263,7 @@ namespace writerfilter {
bool bHadShapeText;
bool bInShapeGroup; ///< If we're inside a \shpgrp group.
+ bool bInShape; ///< If we're inside a \shp group.
bool bCreatedShapeGroup; ///< A GroupShape was created and pushed to the parent stack.
bool bStartedTrackchange; ///< Track change is started, need to end it before popping.
};