writerfilter/source/dmapper/DomainMapper_Impl.cxx | 28 +++++++--------------- 1 file changed, 10 insertions(+), 18 deletions(-)
New commits: commit 0f18a52b0d4aab218f6a87c33508915b3b7d08b7 Author: Michael Stahl <michael.st...@cib.de> AuthorDate: Wed Oct 2 18:06:25 2019 +0200 Commit: Michael Stahl <michael.st...@cib.de> CommitDate: Thu Oct 10 12:51:43 2019 +0200 writerfilter: remove pointless if in appendTextPortion() Change-Id: Iff8171b48a2687bbadb4e2638675a73de96a7545 Reviewed-on: https://gerrit.libreoffice.org/80074 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@cib.de> diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index cb6eb815c49e..6f6f74457486 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1768,25 +1768,17 @@ void DomainMapper_Impl::appendTextPortion( const OUString& rString, const Proper { m_bStartedTOC = true; uno::Reference< text::XTextCursor > xTOCTextCursor = xTextAppend->getEnd()->getText( )->createTextCursor( ); + assert(xTOCTextCursor.is()); xTOCTextCursor->gotoEnd(false); - if (xTOCTextCursor.is()) - { - if (m_bStartIndex || m_bStartBibliography || m_bStartGenericField) - xTOCTextCursor->goLeft(1, false); - xTextRange = xTextAppend->insertTextPortion(rString, aValues, xTOCTextCursor); - SAL_WARN_IF(!xTextRange.is(), "writerfilter.dmapper", "insertTextPortion failed"); - if (!xTextRange.is()) - throw uno::Exception("insertTextPortion failed", nullptr); - m_bTextInserted = true; - xTOCTextCursor->gotoRange(xTextRange->getEnd(), true); - mxTOCTextCursor = xTOCTextCursor; - } - else - { - xTextRange = xTextAppend->appendTextPortion(rString, aValues); - xTOCTextCursor = xTextAppend->createTextCursor(); - xTOCTextCursor->gotoRange(xTextRange->getEnd(), false); - } + if (m_bStartIndex || m_bStartBibliography || m_bStartGenericField) + xTOCTextCursor->goLeft(1, false); + xTextRange = xTextAppend->insertTextPortion(rString, aValues, xTOCTextCursor); + SAL_WARN_IF(!xTextRange.is(), "writerfilter.dmapper", "insertTextPortion failed"); + if (!xTextRange.is()) + throw uno::Exception("insertTextPortion failed", nullptr); + m_bTextInserted = true; + xTOCTextCursor->gotoRange(xTextRange->getEnd(), true); + mxTOCTextCursor = xTOCTextCursor; m_aTextAppendStack.push(TextAppendContext(xTextAppend, xTOCTextCursor)); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits