From 463970052cb81124724da71372e9c574d99fe903 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 7 Oct 2013 20:22:42 +0100 Subject: CID#1078684 ensure no -1 uses in replaceAt Change-Id: Ic3a652aa38efe1bfaba81ba7d9103f40f093ed6a --- svtools/source/filter/exportdialog.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'svtools') 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 ); } } -- cgit