From c7908996ac968e0c10e6b60590d8d54748fe4e69 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 23 Feb 2011 13:19:04 +0100 Subject: [PATCH] vcl119: persistent window state for print dialog --- vcl/source/window/printdlg.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) mode change 100644 => 100755 vcl/source/window/printdlg.cxx diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx old mode 100644 new mode 100755 index 83b1c9513a8d..208e7cacb96d --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -1055,6 +1055,13 @@ void PrintDialog::readFromSettings() } } maOKButton.SetText( maOptionsPage.maToFileBox.IsChecked() ? maPrintToFileText : maPrintText ); + + // persistent window state + rtl::OUString aWinState( pItem->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WindowState" ) ) ) ); + if( aWinState.getLength() ) + SetWindowState( rtl::OUStringToOString( aWinState, RTL_TEXTENCODING_UTF8 ) ); + if( maOptionsPage.maToFileBox.IsChecked() ) { maPController->resetPrinterOptions( true ); @@ -1077,6 +1084,10 @@ void PrintDialog::storeToSettings() pItem->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LastPage" ) ), maTabCtrl.GetPageText( maTabCtrl.GetCurPageId() ) ); + pItem->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WindowState" ) ), + rtl::OStringToOUString( GetWindowState(), RTL_TEXTENCODING_UTF8 ) + ); pItem->Commit(); }