openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dam...@apache.org
Subject svn commit: r1746906 - /openoffice/trunk/main/svtools/source/filter/exportdialog.cxx
Date Sun, 05 Jun 2016 12:51:04 GMT
Author: damjan
Date: Sun Jun  5 12:51:04 2016
New Revision: 1746906

URL: http://svn.apache.org/viewvc?rev=1746906&view=rev
Log:
#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


Modified:
    openoffice/trunk/main/svtools/source/filter/exportdialog.cxx

Modified: openoffice/trunk/main/svtools/source/filter/exportdialog.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svtools/source/filter/exportdialog.cxx?rev=1746906&r1=1746905&r2=1746906&view=diff
==============================================================================
--- openoffice/trunk/main/svtools/source/filter/exportdialog.cxx (original)
+++ openoffice/trunk/main/svtools/source/filter/exportdialog.cxx Sun Jun  5 12:51:04 2016
@@ -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 )



Mime
View raw message