diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-10-07 20:22:42 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-10-08 10:00:03 +0100 |
commit | 463970052cb81124724da71372e9c574d99fe903 (patch) | |
tree | 1c6ae442003cce9915f1de5352c42042c5e6c719 /svtools/source | |
parent | CID#1078685 consider if there is < 3 % (diff) | |
download | core-463970052cb81124724da71372e9c574d99fe903.tar.gz core-463970052cb81124724da71372e9c574d99fe903.zip |
CID#1078684 ensure no -1 uses in replaceAt
Change-Id: Ic3a652aa38efe1bfaba81ba7d9103f40f093ed6a
Diffstat (limited to 'svtools/source')
-rw-r--r-- | svtools/source/filter/exportdialog.cxx | 9 |
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 ); } } |