summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-04-09 15:42:26 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-04-10 07:32:16 +0200
commit7e2a3812ce98942be43ba1be4a4695e9adcf988d (patch)
tree40d63fd4b5f6bff020d6dc43a125b64c3765050d /writerfilter
parent4984bf2a870a1fb7d1f85b1f6ece568a0e05c4cb (diff)
RTF import of new-style frames: avoid fake empty paragraph at the end
Change-Id: I0abd941fbebfc032a3f3827929cfa721a187852e
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 102c0ba3e045..231ccefb1622 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1164,6 +1164,7 @@ void RTFDocumentImpl::text(OUString& rString)
void RTFDocumentImpl::replayBuffer(RTFBuffer_t& rBuffer)
{
+ bool bShapeText = !m_aShapetextBuffer.empty();
while (rBuffer.size())
{
std::pair<RTFBufferTypes, RTFValue::Pointer_t> aPair = rBuffer.front();
@@ -1201,7 +1202,13 @@ void RTFDocumentImpl::replayBuffer(RTFBuffer_t& rBuffer)
else if (aPair.first == BUFFER_ENDRUN)
Mapper().endCharacterGroup();
else if (aPair.first == BUFFER_PAR)
- parBreak();
+ {
+ if (!rBuffer.empty() || !bShapeText)
+ // RTF may have a fake paragraph at the end of the shape text,
+ // that would cause an additional empty paragraph at the end of
+ // the shape text.
+ parBreak();
+ }
else
SAL_WARN("writerfilter", "should not happen");
}