[Libreoffice-commits] core.git: writerfilter/source

Justin Luth (via logerrit) logerrit at kemper.freedesktop.org
Sat Apr 11 08:11:24 UTC 2020


 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   10 +---------
 writerfilter/source/rtftok/rtfdocumentimpl.cxx    |    1 -
 2 files changed, 1 insertion(+), 10 deletions(-)

New commits:
commit dd2681813d02089c71a8b0f4dc4c8e2bf63d1791
Author:     Justin Luth <justin.luth at collabora.com>
AuthorDate: Fri Apr 10 20:02:20 2020 +0300
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Apr 11 10:10:45 2020 +0200

    NFC writerfilter: remove pointless asserts
    
    In an age where GDB (or whatever other platform debugger
    you prefer) is easy to use, there is no point in
    asserting something that is going to crash anyway, is there?
    
    Asserting is only good in these cases if you follow it using
    an _if_ statement. Noel informed me that it can also be used
    to silence false positive coverity warnings.
    
    Change-Id: I5a5cb7a22019768ec2807f6918d4a8ebb51194de
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92049
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 01eba34e62fa..98e9e77d6c34 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1983,7 +1983,6 @@ 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 (m_nStartGenericField != 0)
                         {
@@ -4287,7 +4286,6 @@ DomainMapper_Impl::StartIndexSectionChecked(const OUString& sServiceName)
             m_bStartedTOC = true;
             uno::Reference<text::XTextCursor> xTOCTextCursor
                 = xTextRange->getText()->createTextCursor();
-            assert(xTOCTextCursor.is());
             xTOCTextCursor->gotoEnd(false);
             m_aTextAppendStack.push(TextAppendContext(xTextAppend, xTOCTextCursor));
         }
@@ -6524,10 +6522,7 @@ void DomainMapper_Impl::SetCurrentRedlineIsRead()
 
 sal_Int32 DomainMapper_Impl::GetCurrentRedlineToken(  ) const
 {
-    sal_Int32 nToken = 0;
-    assert( m_currentRedline.get());
-    nToken = m_currentRedline->m_nToken;
-    return nToken;
+    return m_currentRedline->m_nToken;
 }
 
 void DomainMapper_Impl::SetCurrentRedlineAuthor( const OUString& sAuthor )
@@ -6579,13 +6574,11 @@ void DomainMapper_Impl::SetCurrentRedlineId( sal_Int32 sId )
 
 void DomainMapper_Impl::SetCurrentRedlineToken( sal_Int32 nToken )
 {
-    assert( m_currentRedline.get());
     m_currentRedline->m_nToken = nToken;
 }
 
 void DomainMapper_Impl::SetCurrentRedlineRevertProperties( const uno::Sequence<beans::PropertyValue>& aProperties )
 {
-    assert( m_currentRedline.get());
     m_currentRedline->m_aRevertProperties = aProperties;
 }
 
@@ -6806,7 +6799,6 @@ sal_Int32 DomainMapper_Impl::getNumberingProperty(const sal_Int32 nListId, sal_I
             nNumberingLevel = 0;
 
         auto const pList(GetListTable()->GetList(nListId));
-        assert(pList);
         const OUString aListName = pList->GetStyleName();
         const uno::Reference< style::XStyleFamiliesSupplier > xStylesSupplier(GetTextDocument(), uno::UNO_QUERY_THROW);
         const uno::Reference< container::XNameAccess > xStyleFamilies = xStylesSupplier->getStyleFamilies();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 3de574e75c12..5429489304f6 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2113,7 +2113,6 @@ RTFReferenceTable::Entries_t RTFDocumentImpl::deduplicateStyleTable()
                 auto const pStyleType(
                     static_cast<RTFReferenceProperties&>(*pStyle).getAttributes().find(
                         NS_ooxml::LN_CT_Style_type));
-                assert(pStyleType);
                 int const nStyleType(pStyleType->getInt());
                 RTFSprms const sprms(
                     static_cast<RTFReferenceProperties&>(*pStyle).getSprms().cloneAndDeduplicate(


More information about the Libreoffice-commits mailing list