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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Jul 23 08:20:43 UTC 2019


 sdext/source/pdfimport/tree/writertreevisiting.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 00dfa1f2f06bcba5dcd67e8955f9a78b95f16632
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Jul 22 12:15:28 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Jul 23 10:19:51 2019 +0200

    cid#1448446 Unchecked dynamic_cast
    
    Change-Id: I888ca249e0e9551c74611dcfb8ba7c7c1dc36880
    Reviewed-on: https://gerrit.libreoffice.org/76133
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sdext/source/pdfimport/tree/writertreevisiting.cxx b/sdext/source/pdfimport/tree/writertreevisiting.cxx
index 6c0325019c9a..b84e5f2fcb07 100644
--- a/sdext/source/pdfimport/tree/writertreevisiting.cxx
+++ b/sdext/source/pdfimport/tree/writertreevisiting.cxx
@@ -694,8 +694,8 @@ void WriterXmlOptimizer::checkHeaderAndFooter( PageElement& rElem )
     if (rit == rElem.Children.rend())
         return;
 
-    ParagraphElement* pPara = dynamic_cast<ParagraphElement*>(rit->get());
-    if( !(pPara->y > rElem.h*0.85 && pPara->isSingleLined( m_rProcessor )) )
+    ParagraphElement& rPara = dynamic_cast<ParagraphElement&>(*rit->get());
+    if( !(rPara.y > rElem.h*0.85 && rPara.isSingleLined( m_rProcessor )) )
         return;
 
     std::list< std::unique_ptr<Element> >::reverse_iterator next_it = rit;
@@ -704,10 +704,10 @@ void WriterXmlOptimizer::checkHeaderAndFooter( PageElement& rElem )
     {
         pNextPara = dynamic_cast<ParagraphElement*>(next_it->get());
     }
-    if( pNextPara && pNextPara->y < pPara->y-pPara->h*2 )
+    if( pNextPara && pNextPara->y < rPara.y-rPara.h*2 )
     {
         rElem.FooterElement = std::move(*rit);
-        pPara->Parent = nullptr;
+        rPara.Parent = nullptr;
         rElem.Children.erase( std::next(rit).base() );
     }
 }


More information about the Libreoffice-commits mailing list