summaryrefslogtreecommitdiffstats
path: root/svtools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-10-07 20:22:42 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-10-08 10:00:03 +0100
commit463970052cb81124724da71372e9c574d99fe903 (patch)
tree1c6ae442003cce9915f1de5352c42042c5e6c719 /svtools
parentCID#1078685 consider if there is < 3 % (diff)
downloadcore-463970052cb81124724da71372e9c574d99fe903.tar.gz
core-463970052cb81124724da71372e9c574d99fe903.zip
CID#1078684 ensure no -1 uses in replaceAt
Change-Id: Ic3a652aa38efe1bfaba81ba7d9103f40f093ed6a
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/filter/exportdialog.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/svtools/source/filter/exportdialog.cxx b/svtools/source/filter/exportdialog.cxx
index 97b4bf8687fe..706715bec5b1 100644
--- a/svtools/source/filter/exportdialog.cxx
+++ b/svtools/source/filter/exportdialog.cxx
@@ -948,12 +948,14 @@ void ExportDialog::updateControls()
OUString aEst( nRealFileSize ? msEstimatedSizePix2 : msEstimatedSizePix1 );
sal_Int64 nRawFileSize( GetRawFileSize() );
sal_Int32 nInd = aEst.indexOf( "%" );
- aEst = aEst.replaceAt( nInd, 2, ImpValueOfInKB( nRawFileSize ) );
+ if (nInd != -1)
+ aEst = aEst.replaceAt( nInd, 2, ImpValueOfInKB( nRawFileSize ) );
if ( nRealFileSize )
{
nInd = aEst.indexOf( "%", nInd );
- aEst = aEst.replaceAt( nInd, 2, ImpValueOfInKB( nRealFileSize ) );
+ if (nInd != -1)
+ aEst = aEst.replaceAt( nInd, 2, ImpValueOfInKB( nRealFileSize ) );
}
mpFtEstimatedSize->SetText( aEst );
}
@@ -963,7 +965,8 @@ void ExportDialog::updateControls()
{
OUString aEst( msEstimatedSizeVec );
sal_Int32 nInd = aEst.indexOf( "%" );
- aEst = aEst.replaceAt( nInd, 2, ImpValueOfInKB( nRealFileSize ) );
+ if (nInd != -1)
+ aEst = aEst.replaceAt( nInd, 2, ImpValueOfInKB( nRealFileSize ) );
mpFtEstimatedSize->SetText( aEst );
}
}