summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-07-24 10:57:27 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-07-24 21:33:38 +0200
commitbb6f5ae90332fee2eb650398d1ae0b554ac89ce2 (patch)
tree964b3e33f5879e7c00922602edc08eb4af6897ef /sdext
parent1779f7fcbaf11428e9064653a61045dc267778be (diff)
cid#1448446 Unchecked dynamic_cast
Change-Id: I790f55e5edfce37b28dfc8b915970e123425f434 Reviewed-on: https://gerrit.libreoffice.org/76244 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sdext')
-rw-r--r--sdext/source/pdfimport/tree/writertreevisiting.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sdext/source/pdfimport/tree/writertreevisiting.cxx b/sdext/source/pdfimport/tree/writertreevisiting.cxx
index b84e5f2fcb07..96b9e4bcfab9 100644
--- a/sdext/source/pdfimport/tree/writertreevisiting.cxx
+++ b/sdext/source/pdfimport/tree/writertreevisiting.cxx
@@ -671,8 +671,8 @@ void WriterXmlOptimizer::checkHeaderAndFooter( PageElement& rElem )
auto it = std::find_if(rElem.Children.begin(), rElem.Children.end(), isParagraphElement);
if (it != rElem.Children.end())
{
- ParagraphElement* pPara = dynamic_cast<ParagraphElement*>(it->get());
- if( pPara->y+pPara->h < rElem.h*0.15 && pPara->isSingleLined( m_rProcessor ) )
+ ParagraphElement& rPara = dynamic_cast<ParagraphElement&>(*it->get());
+ if( rPara.y+rPara.h < rElem.h*0.15 && rPara.isSingleLined( m_rProcessor ) )
{
auto next_it = it;
ParagraphElement* pNextPara = nullptr;
@@ -680,10 +680,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.HeaderElement = std::move(*it);
- pPara->Parent = nullptr;
+ rPara.Parent = nullptr;
rElem.Children.erase( it );
}
}