configure.ac | 2 - vcl/inc/printdlg.hxx | 6 +++ vcl/source/window/printdlg.cxx | 70 +++++++++++++++++++++++++++++------------ 3 files changed, 57 insertions(+), 21 deletions(-)
New commits: commit fb9ee6f4f7c55154fea5106ac098d3b2d2fa191f Author: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> AuthorDate: Thu Oct 8 08:11:34 2020 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> CommitDate: Thu Oct 8 08:11:34 2020 +0200 Release 6.3.6.6 Change-Id: I6f7a969a030114fc8de2155587f26552b901666a diff --git a/configure.ac b/configure.ac index b262c53d55ae..f84c7b3fcbd2 100644 --- a/configure.ac +++ b/configure.ac @@ -9,7 +9,7 @@ dnl in order to create a configure script. # several non-alphanumeric characters, those are split off and used only for the # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no idea. -AC_INIT([LibreOffice],[6.3.6.5],[],[],[http://documentfoundation.org/]) +AC_INIT([LibreOffice],[6.3.6.6],[],[],[http://documentfoundation.org/]) dnl libnumbertext needs autoconf 2.68, but that can pick up autoconf268 just fine if it is installed dnl whereas aclocal (as run by autogen.sh) insists on using autoconf and fails hard commit 2fcfff9810ecfbe8735173ef317548583a7f985d Author: Juergen Funk <juergen.funk...@cib.de> AuthorDate: Fri Sep 4 10:53:44 2020 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> CommitDate: Wed Oct 7 15:18:36 2020 +0200 tdf#127932 fix wrong page number in print progress - in ctor, reset start pages to non-inflated value after size calculation - update label, _then_ progress in setProgress() Change-Id: I66576e339de814922512b68167e6c0a9b1025378 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102031 Tested-by: Thorsten Behrens <thorsten.behr...@cib.de> Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> (cherry picked from commit 63bf8f042abe3c0f6989f6763d13f5389182b816) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102281 Tested-by: Jenkins diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 5df5961951de..dd88c9b1a9a6 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -2153,6 +2153,15 @@ void PrintDialog::previewBackward() mpPageEdit->Down(); } + +static OUString getNewLabel(const OUString& aLabel, int i_nCurr, int i_nMax) +{ + OUString aNewText( aLabel.replaceFirst( "%p", OUString::number( i_nCurr ) ) ); + aNewText = aNewText.replaceFirst( "%n", OUString::number( i_nMax ) ); + + return aNewText; +} + // PrintProgressDialog PrintProgressDialog::PrintProgressDialog(weld::Window* i_pParent, int i_nMax) : GenericDialogController(i_pParent, "vcl/ui/printprogressdialog.ui", "PrintProgressDialog") @@ -2170,15 +2179,17 @@ PrintProgressDialog::PrintProgressDialog(weld::Window* i_pParent, int i_nMax) //just multiply largest value by 10 and take the width of that string as //the max size we will want - OUString aNewText( maStr.replaceFirst( "%p", OUString::number( mnMax * 10 ) ) ); - aNewText = aNewText.replaceFirst( "%n", OUString::number( mnMax * 10 ) ); - mxText->set_label( aNewText ); + mxText->set_label(getNewLabel(maStr, mnMax * 10, mnMax * 10)); mxText->set_size_request(mxText->get_preferred_size().Width(), -1); //Pick a useful max width mxProgress->set_size_request(mxProgress->get_approximate_digit_width() * 25, -1); mxButton->connect_clicked( LINK( this, PrintProgressDialog, ClickHdl ) ); + + // after this patch f7157f04fab298423e2c4f6a7e5f8e361164b15f, we have seen the calc Max string (sometimes) look above + // now init to the right start vaules + mxText->set_label(getNewLabel(maStr, mnCur, mnMax)); } PrintProgressDialog::~PrintProgressDialog() @@ -2197,11 +2208,10 @@ void PrintProgressDialog::setProgress( int i_nCurrent ) if( mnMax < 1 ) mnMax = 1; - mxProgress->set_percentage(mnCur*100/mnMax); + mxText->set_label(getNewLabel(maStr, mnCur, mnMax)); - OUString aNewText( maStr.replaceFirst( "%p", OUString::number( mnCur ) ) ); - aNewText = aNewText.replaceFirst( "%n", OUString::number( mnMax ) ); - mxText->set_label( aNewText ); + // here view the dialog, with the right label + mxProgress->set_percentage(mnCur*100/mnMax); } void PrintProgressDialog::tick() commit 8f46d8eb881264228ca385b7a3730e002b807e3e Author: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> AuthorDate: Mon Oct 5 11:09:20 2020 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> CommitDate: Wed Oct 7 15:17:13 2020 +0200 Use idle to update preview in print dlg Otherwise UI blocks while the preview is being updated Change-Id: I98c536b83a31e9ea3f72effc8a602ee190a81e68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103951 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> diff --git a/vcl/inc/printdlg.hxx b/vcl/inc/printdlg.hxx index 0fbfcb62bcc1..b6926074e0be 100644 --- a/vcl/inc/printdlg.hxx +++ b/vcl/inc/printdlg.hxx @@ -22,6 +22,7 @@ #include <vcl/dllapi.h> +#include <vcl/idle.hxx> #include <vcl/print.hxx> #include <vcl/dialog.hxx> #include <vcl/fixed.hxx> @@ -219,6 +220,11 @@ namespace vcl DECL_LINK( ToggleHdl, CheckBox&, void ); DECL_LINK( ToggleRadioHdl, RadioButton&, void ); + Idle maUpdatePreviewIdle; + DECL_LINK(updatePreviewIdle, Timer*, void); + Idle maUpdatePreviewNoCacheIdle; + DECL_LINK(updatePreviewNoCacheIdle, Timer*, void); + DECL_LINK( UIOption_CheckHdl, CheckBox&, void ); DECL_LINK( UIOption_RadioHdl, RadioButton&, void ); DECL_LINK( UIOption_SelectHdl, ListBox&, void ); diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 336929525360..5df5961951de 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -529,6 +529,8 @@ PrintDialog::PrintDialog(vcl::Window* i_pWindow, const std::shared_ptr<PrinterCo , mbCollateAlwaysOff(false) , mbShowLayoutFrame( true ) , mbSingleJobs( false ) +, maUpdatePreviewIdle("Print Dialog Update Preview Idle") +, maUpdatePreviewNoCacheIdle("Print Dialog Update Preview (no cache) Idle") { get(mpOKButton, "ok"); get(mpCancelButton, "cancel"); @@ -647,6 +649,11 @@ PrintDialog::PrintDialog(vcl::Window* i_pWindow, const std::shared_ptr<PrinterCo maNupLandscapeSize = Size( aNupSize.Height(), aNupSize.Width() ); } + maUpdatePreviewIdle.SetPriority(TaskPriority::POST_PAINT); + maUpdatePreviewIdle.SetInvokeHandler(LINK( this, PrintDialog, updatePreviewIdle)); + maUpdatePreviewNoCacheIdle.SetPriority(TaskPriority::POST_PAINT); + maUpdatePreviewNoCacheIdle.SetInvokeHandler(LINK(this, PrintDialog, updatePreviewNoCacheIdle)); + initFromMultiPageSetup( maPController->getMultipage() ); // setup optional UI options set by application @@ -933,6 +940,16 @@ void PrintDialog::setPreviewText() mpNumPagesText->SetText( aNewText ); } +IMPL_LINK_NOARG(PrintDialog, updatePreviewIdle, Timer*, void) +{ + preparePreview(true); +} + +IMPL_LINK_NOARG(PrintDialog, updatePreviewNoCacheIdle, Timer*, void) +{ + preparePreview(false); +} + void PrintDialog::preparePreview( bool i_bMayUseCache ) { VclPtr<Printer> aPrt( maPController->getPrinter() ); @@ -1178,7 +1195,10 @@ void PrintDialog::updateNup( bool i_bMayUseCache ) mpNupOrderWin->setValues( aMPS.nOrder, nCols, nRows ); - preparePreview( i_bMayUseCache ); + if (i_bMayUseCache) + maUpdatePreviewIdle.Start(); + else + maUpdatePreviewNoCacheIdle.Start(); } void PrintDialog::updateNupFromPages( bool i_bMayUseCache ) @@ -1822,7 +1842,7 @@ IMPL_LINK ( PrintDialog, ClickHdl, Button*, pButton, void ) } else if ( pButton == mpPreviewBox ) { - preparePreview( true ); + maUpdatePreviewIdle.Start(); } else if( pButton == mpForwardBtn ) { @@ -1843,7 +1863,7 @@ IMPL_LINK ( PrintDialog, ClickHdl, Button*, pButton, void ) checkOptionalControlDependencies(); // update preview and page settings - preparePreview(false); + maUpdatePreviewNoCacheIdle.Start(); } if( mpBrochureBtn->IsChecked() ) { @@ -1874,7 +1894,7 @@ IMPL_LINK ( PrintDialog, ClickHdl, Button*, pButton, void ) maPController->setReversePrint( bChecked ); maPController->setValue( "PrintReverse", makeAny( bChecked ) ); - preparePreview( true ); + maUpdatePreviewIdle.Start(); } else if( pButton == mpBorderCB ) { @@ -1913,7 +1933,7 @@ IMPL_LINK ( PrintDialog, ClickHdl, Button*, pButton, void ) updateOrientationBox( false ); // tdf#63905 don't use cache: page size may change - preparePreview(false); + maUpdatePreviewNoCacheIdle.Start(); } checkControlDependencies(); } @@ -1937,7 +1957,7 @@ IMPL_LINK( PrintDialog, SelectHdl, ListBox&, rBox, void ) mpOKButton->SetText( maPrintText ); updatePrinterText(); setPaperSizes(); - preparePreview(false); + maUpdatePreviewNoCacheIdle.Start(); } else // print to file { @@ -1948,7 +1968,7 @@ IMPL_LINK( PrintDialog, SelectHdl, ListBox&, rBox, void ) setPaperSizes(); updateOrientationBox(); - preparePreview( true ); + maUpdatePreviewIdle.Start(); } setupPaperSidesBox(); @@ -1992,7 +2012,7 @@ IMPL_LINK( PrintDialog, SelectHdl, ListBox&, rBox, void ) checkPaperSize( aPaperSize ); maPController->setPaperSizeFromUser( aPaperSize ); - preparePreview(false); + maUpdatePreviewNoCacheIdle.Start(); } } @@ -2008,7 +2028,7 @@ IMPL_LINK( PrintDialog, ModifyHdl, Edit&, rEdit, void ) else if( &rEdit == mpPageEdit ) { mnCurPage = sal_Int32( mpPageEdit->GetValue() - 1 ); - preparePreview( true ); + maUpdatePreviewIdle.Start(); } else if( &rEdit == mpCopyCountField ) { @@ -2032,7 +2052,7 @@ IMPL_LINK( PrintDialog, UIOption_CheckHdl, CheckBox&, i_rBox, void ) checkOptionalControlDependencies(); // update preview and page settings - preparePreview(false); + maUpdatePreviewNoCacheIdle.Start(); } } @@ -2061,7 +2081,7 @@ IMPL_LINK( PrintDialog, UIOption_RadioHdl, RadioButton&, i_rBtn, void ) checkOptionalControlDependencies(); // update preview and page settings - preparePreview(false); + maUpdatePreviewNoCacheIdle.Start(); } } } @@ -2087,7 +2107,7 @@ IMPL_LINK( PrintDialog, UIOption_SelectHdl, ListBox&, i_rBox, void ) checkOptionalControlDependencies(); // update preview and page settings - preparePreview(false); + maUpdatePreviewNoCacheIdle.Start(); } } @@ -2119,7 +2139,7 @@ IMPL_LINK( PrintDialog, UIOption_ModifyHdl, Edit&, i_rBox, void ) checkOptionalControlDependencies(); // update preview and page settings - preparePreview(false); + maUpdatePreviewNoCacheIdle.Start(); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits