From e67657d5211f6e95ddf8bd621108608573b00d5d Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 6 Aug 2020 13:32:43 +0200 Subject: loplugin:simplifybool more look for expressions like !(a && !b) which can be expanded out Change-Id: I72515a9638762b050f9a258c08da39ebfa2ef8e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100579 Tested-by: Jenkins Reviewed-by: Noel Grandin --- writerfilter/source/rtftok/rtfdocumentimpl.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'writerfilter/source/rtftok/rtfdocumentimpl.cxx') diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 1f4ebda582d7..f4fdde9ca86a 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -653,7 +653,7 @@ void RTFDocumentImpl::sectBreak(bool bFinal) // If there is no paragraph in this section, then insert a dummy one, as required by Writer, // unless this is the end of the doc, we had nothing since the last section break and this is not a continuous one. // Also, when pasting, it's fine to not have any paragraph inside the document at all. - if (m_bNeedPar && !(bFinal && !m_bNeedSect && !bContinuous) && !isSubstream() && m_bIsNewDoc) + if (m_bNeedPar && (!bFinal || m_bNeedSect || bContinuous) && !isSubstream() && m_bIsNewDoc) dispatchSymbol(RTF_PAR); // It's allowed to not have a non-table paragraph at the end of an RTF doc, add it now if required. if (m_bNeedFinalPar && bFinal) @@ -2358,7 +2358,7 @@ RTFError RTFDocumentImpl::beforePopState(RTFParserState& rState) // Do not resolve shape if shape instruction destination is inside other shape instruction } else if (!m_bObject && !rState.getInListpicture() && !rState.getHadShapeText() - && !(rState.getInShapeGroup() && !rState.getInShape())) + && (!rState.getInShapeGroup() || rState.getInShape())) { // Don't trigger a shape import in case we're only leaving the \shpinst of the groupshape itself. RTFSdrImport::ShapeOrPict eType -- cgit v1.2.3