summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-07-18 22:47:03 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-07-19 10:09:31 +0200
commit173d769a9d32af83ea75dcf4d23b7663a5f19cb9 (patch)
tree6dcbda20b6b571ca48170bb26084c2bf68cb32f8 /writerfilter
parentc68afc22fe8b1f90033cbe7d328a74daeae18e22 (diff)
fdo#52066 fix RTF import of rectangle shape without text in it
We used to always add a paragraph on shapes, which breaks import of abused rectangle shapes with minimal height, used as lines. Change-Id: Ice240bad68bc030e7889c46f72c45646307f17e5
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx4
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.hxx2
-rw-r--r--writerfilter/source/rtftok/rtfsdrimport.cxx10
3 files changed, 10 insertions, 6 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index c7b719ec97d4..37da9c015805 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3644,9 +3644,11 @@ void RTFDocumentImpl::setDestinationText(OUString& rString)
m_aStates.top().aDestinationText.append(rString);
}
-void RTFDocumentImpl::replayShapetext()
+bool RTFDocumentImpl::replayShapetext()
{
+ bool bRet = !m_aShapetextBuffer.empty();
replayBuffer(m_aShapetextBuffer);
+ return bRet;
}
bool RTFDocumentImpl::getSkipUnknown()
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 34dddd24d8fc..14ded59a416d 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -370,7 +370,7 @@ namespace writerfilter {
/// Resolve a picture: If not inline, then anchored.
int resolvePict(bool bInline);
void runBreak();
- void replayShapetext();
+ bool replayShapetext();
bool getSkipUnknown();
void setSkipUnknown(bool bSkipUnknown);
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index 9ba957ea5665..ae7b14477ede 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -333,10 +333,12 @@ void RTFSdrImport::resolve(RTFShape& rShape)
// Send it to dmapper
m_rImport.Mapper().startShape(xShape);
m_rImport.Mapper().startParagraphGroup();
- m_rImport.replayShapetext();
- m_rImport.Mapper().startCharacterGroup();
- m_rImport.runBreak();
- m_rImport.Mapper().endCharacterGroup();
+ if (m_rImport.replayShapetext())
+ {
+ m_rImport.Mapper().startCharacterGroup();
+ m_rImport.runBreak();
+ m_rImport.Mapper().endCharacterGroup();
+ }
m_rImport.Mapper().endParagraphGroup();
m_rImport.Mapper().endShape();
}