summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-07-18 22:47:03 +0200
committerLuboš Luňák <l.lunak@suse.cz>2012-07-19 17:59:37 +0200
commitb8e664a17abac2cad8aae9909dbd8c2da3d8557c (patch)
treeb6e0fa7c450e1ac39361a7203cfa9e4165026e46
parent37d4c94d5e2dc0541ee31a0b660425d81a766f8a (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 Signed-off-by: Luboš Luňák <l.lunak@suse.cz>
-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 e2935992d008..3fb949187c17 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3648,9 +3648,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 d7347e4dc2c3..d42a401de8be 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -364,7 +364,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 46664f54684f..e89a8c7f5fdb 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -326,10 +326,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();
}