diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2019-10-02 18:06:25 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2019-10-10 12:51:43 +0200 |
commit | 0f18a52b0d4aab218f6a87c33508915b3b7d08b7 (patch) | |
tree | f190344b1091427ec83b76951979c06b4b11805d /writerfilter/source | |
parent | 9db25302bfb454dd8f2504e59ca84815f48e5cf4 (diff) |
writerfilter: remove pointless if in appendTextPortion()
Change-Id: Iff8171b48a2687bbadb4e2638675a73de96a7545
Reviewed-on: https://gerrit.libreoffice.org/80074
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'writerfilter/source')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 28 |
1 files changed, 10 insertions, 18 deletions
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)); } } |