[Libreoffice-commits] core.git: Branch 'aoo/trunk' - svtools/source
Damjan Jovanovic
damjan at apache.org
Sun Jun 5 16:08:45 UTC 2016
svtools/source/filter/exportdialog.cxx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 48cf17d5fac7e77aa82caa454cd0f26cd10faaa0
Author: Damjan Jovanovic <damjan at apache.org>
Date: Sun Jun 5 12:51:04 2016 +0000
#i124867#: jpg options shows initially wrong estimated file size
File main/svtools/source/filter/exportdialog.cxx
ExportDialog::GetGraphicStream() creates the compressed file from which the
file size is obtained, calling GetFilterData() to obtain the properties used
to save it. GetFilterData() returns image properties, like JPEG colormode
and quality, PNG compression/interlacing/translucence, BMP color and RLE
coding, etc. In the case of JPEG, the quality is read from
maSbCompression.GetThumbPos().
The problem is that in ExportDialog::updateControls(),
maSbCompression.SetThumbPos() is called AFTER GetGraphicStream(), meaning
the stream is created with the old thumb position.
This patches it to call GetGraphicStream() later, immediately before using
that stream, so that its properties such as compression are updated first
and the size is calculated correctly.
Reported by: myspaces at hotmail dot fr
Patch by: me
diff --git a/svtools/source/filter/exportdialog.cxx b/svtools/source/filter/exportdialog.cxx
index 2acf276..61c7e04 100644
--- a/svtools/source/filter/exportdialog.cxx
+++ b/svtools/source/filter/exportdialog.cxx
@@ -1313,8 +1313,6 @@ void ExportDialog::updatePreview()
void ExportDialog::updateControls()
{
- GetGraphicStream();
-
// Size Controls
if ( !mbIsPixelFormat )
{
@@ -1364,6 +1362,8 @@ void ExportDialog::updateControls()
if ( maSbCompression.IsVisible() )
maSbCompression.SetThumbPos( maNfCompression.GetValue() );
+ GetGraphicStream();
+
// updating estimated size
sal_Int64 nRealFileSize( mpTempStream->Tell() );
if ( mbIsPixelFormat )
More information about the Libreoffice-commits
mailing list