svtools/source/filter/exportdialog.cxx | 57 +++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 23 deletions(-)
New commits: commit a064535cb2b65d5042f85e571fe3559820855479 Author: Noel Grandin <[email protected]> AuthorDate: Tue Sep 30 15:54:10 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Tue Sep 30 18:23:17 2025 +0200 tdf#132494 dont resize SVG on the fly when exporting from drawing or we potentially spend vast amounts of time doing resizing work. I am not convinced that this estimated file size thing is a good idea for most of the export formats, but for now, lets just do the minimal fix. Change-Id: Iba986196c060246598d455823886d3f4c7496133 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191668 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/svtools/source/filter/exportdialog.cxx b/svtools/source/filter/exportdialog.cxx index 9216c8a4004a..45982fe99010 100644 --- a/svtools/source/filter/exportdialog.cxx +++ b/svtools/source/filter/exportdialog.cxx @@ -884,6 +884,13 @@ void ExportDialog::setupControls() if (mnMaxFilesizeForRealtimePreview || mbIsPixelFormat) mxInfo->show(); + + // resizing SVG can take a long time + if (mnFormat == FORMAT_SVG) + { + mxFtEstimatedSize->hide(); + mxInfo->hide(); + } } static OUString ImpValueOfInKB( sal_Int64 rVal ) @@ -942,36 +949,40 @@ void ExportDialog::updateControls() if (mpSbCompression && mpSbCompression->get_visible() && mpNfCompression) mpSbCompression->set_value(mpNfCompression->get_value()); - GetGraphicStream(); - - // updating estimated size - sal_Int64 nRealFileSize( mpTempStream->Tell() ); - if ( mbIsPixelFormat ) + // resizing SVG can take a long time + if (mnFormat != FORMAT_SVG) { - OUString aEst( nRealFileSize ? msEstimatedSizePix2 : msEstimatedSizePix1 ); - sal_Int64 nRawFileSize( GetRawFileSize() ); - sal_Int32 nInd = aEst.indexOf( "%" ); - if (nInd != -1) - aEst = aEst.replaceAt( nInd, 2, ImpValueOfInKB( nRawFileSize ) ); + GetGraphicStream(); - if ( nRealFileSize && nInd != -1 ) - { - nInd = aEst.indexOf( "%", nInd ); - if (nInd != -1) - aEst = aEst.replaceAt( nInd, 2, ImpValueOfInKB( nRealFileSize ) ); - } - mxFtEstimatedSize->set_label( aEst ); - } - else - { - if ( mnMaxFilesizeForRealtimePreview ) + // updating estimated size + sal_Int64 nRealFileSize( mpTempStream->Tell() ); + if ( mbIsPixelFormat ) { - OUString aEst( msEstimatedSizeVec ); + OUString aEst( nRealFileSize ? msEstimatedSizePix2 : msEstimatedSizePix1 ); + sal_Int64 nRawFileSize( GetRawFileSize() ); sal_Int32 nInd = aEst.indexOf( "%" ); if (nInd != -1) - aEst = aEst.replaceAt( nInd, 2, ImpValueOfInKB( nRealFileSize ) ); + aEst = aEst.replaceAt( nInd, 2, ImpValueOfInKB( nRawFileSize ) ); + + if ( nRealFileSize && nInd != -1 ) + { + nInd = aEst.indexOf( "%", nInd ); + if (nInd != -1) + aEst = aEst.replaceAt( nInd, 2, ImpValueOfInKB( nRealFileSize ) ); + } mxFtEstimatedSize->set_label( aEst ); } + else + { + if ( mnMaxFilesizeForRealtimePreview ) + { + OUString aEst( msEstimatedSizeVec ); + sal_Int32 nInd = aEst.indexOf( "%" ); + if (nInd != -1) + aEst = aEst.replaceAt( nInd, 2, ImpValueOfInKB( nRealFileSize ) ); + mxFtEstimatedSize->set_label( aEst ); + } + } } // EPS
