summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-01-17 13:37:44 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-01-17 14:10:41 +0000
commit49f05934edd3723666b7c52eccbf4d0c9a688eb7 (patch)
tree9c303f783065fc6e96c6448187927d5951b5eded /sw
parent64b0c436240a2dbb1ec242dc45f654ef46a0421f (diff)
coverity#1427629 Unchecked return value
Change-Id: If12d57826817d5ca866ecc14d81b21f494ff4487
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/xml/xmlmeta.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/sw/source/filter/xml/xmlmeta.cxx b/sw/source/filter/xml/xmlmeta.cxx
index 0cc6a161197b..c85fff068057 100644
--- a/sw/source/filter/xml/xmlmeta.cxx
+++ b/sw/source/filter/xml/xmlmeta.cxx
@@ -145,11 +145,17 @@ void SwXMLImport::SetStatistics(
// use #pages*10, or guesstimate 250 paragraphs. Additionally
// guesstimate PROGRESS_BAR_STEPS each for meta+settings, styles,
// and autostyles.
- sal_Int32 nProgressReference = 250;
- if( nTokens & XML_TOK_META_STAT_PARA )
+ bool bSetFallback = true;
+ sal_Int32 nProgressReference;
+ if (nTokens & XML_TOK_META_STAT_PARA)
+ {
nProgressReference = static_cast<sal_Int32>(aDocStat.nPara);
- else if ( nTokens & XML_TOK_META_STAT_PAGE )
- o3tl::checked_multiply<sal_Int32>(aDocStat.nPage, 10, nProgressReference);
+ bSetFallback = false;
+ }
+ else if (nTokens & XML_TOK_META_STAT_PAGE)
+ bSetFallback = o3tl::checked_multiply<sal_Int32>(aDocStat.nPage, 10, nProgressReference);
+ if (bSetFallback)
+ nProgressReference = 250;
ProgressBarHelper* pProgress = GetProgressBarHelper();
pProgress->SetReference( nProgressReference + 3*PROGRESS_BAR_STEP );
pProgress->SetValue( 0 );