diff options
author | Philipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM> | 2011-03-23 18:06:39 +0100 |
---|---|---|
committer | Philipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM> | 2011-03-23 18:06:39 +0100 |
commit | d67e92069b9fb109e33a5133326eef51bf99aeb8 (patch) | |
tree | 8e403c695b28b8ba6adf2dc305a5c62388f7ae01 /vcl/source/window/printdlg.cxx | |
parent | 4617694b3fd830c8560f8d75d5f6afca618a8d65 (diff) | |
parent | 78f80b020fe009bc48e9e5f8b7862de51f1f8381 (diff) |
vcl2gnumake: rebase to DEV300m103
Diffstat (limited to 'vcl/source/window/printdlg.cxx')
-rwxr-xr-x[-rw-r--r--] | vcl/source/window/printdlg.cxx | 44 |
1 files changed, 37 insertions, 7 deletions
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index ffc6a31beb0b..094567c7f15c 100644..100755 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -311,6 +311,7 @@ void PrintDialog::PrintPreviewWindow::Command( const CommandEvent& rEvt ) void PrintDialog::PrintPreviewWindow::setPreview( const GDIMetaFile& i_rNewPreview, const Size& i_rOrigSize, + const rtl::OUString& i_rPaperName, const rtl::OUString& i_rReplacement, sal_Int32 i_nDPIX, sal_Int32 i_nDPIY, @@ -345,6 +346,12 @@ void PrintDialog::PrintPreviewWindow::setPreview( const GDIMetaFile& i_rNewPrevi String aNumText( rLocWrap.getNum( aLogicPaperSize.Width(), nDigits ) ); aBuf.append( aNumText ); aBuf.appendAscii( eUnit == MAP_MM ? "mm" : "in" ); + if( i_rPaperName.getLength() ) + { + aBuf.appendAscii( " (" ); + aBuf.append( i_rPaperName ); + aBuf.append( sal_Unicode(')') ); + } maHorzDim.SetText( aBuf.makeStringAndClear() ); aNumText = rLocWrap.getNum( aLogicPaperSize.Height(), nDigits ); @@ -614,6 +621,7 @@ PrintDialog::JobTabPage::JobTabPage( Window* i_pParent, const ResId& rResId ) , maCopyCountField( this, VclResId( SV_PRINT_COPYCOUNT_FIELD ) ) , maCollateBox( this, VclResId( SV_PRINT_COLLATE ) ) , maCollateImage( this, VclResId( SV_PRINT_COLLATE_IMAGE ) ) + , maReverseOrderBox( this, VclResId( SV_PRINT_OPT_REVERSE ) ) , maCollateImg( VclResId( SV_PRINT_COLLATE_IMG ) ) , maCollateHCImg( VclResId( SV_PRINT_COLLATE_HC_IMG ) ) , maNoCollateImg( VclResId( SV_PRINT_NOCOLLATE_IMG ) ) @@ -742,7 +750,6 @@ PrintDialog::OutputOptPage::OutputOptPage( Window* i_pParent, const ResId& i_rRe , maOptionsLine( this, VclResId( SV_PRINT_OPT_PRINT_FL ) ) , maToFileBox( this, VclResId( SV_PRINT_OPT_TOFILE ) ) , maCollateSingleJobsBox( this, VclResId( SV_PRINT_OPT_SINGLEJOBS ) ) - , maReverseOrderBox( this, VclResId( SV_PRINT_OPT_REVERSE ) ) { FreeResource(); @@ -766,7 +773,6 @@ void PrintDialog::OutputOptPage::setupLayout() mxOptGroup = xCol; xCol->addWindow( &maToFileBox ); xCol->addWindow( &maCollateSingleJobsBox ); - xCol->addWindow( &maReverseOrderBox ); } void PrintDialog::OutputOptPage::readFromSettings() @@ -834,7 +840,7 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont maPageStr = maNumPagesText.GetText(); // init reverse print - maOptionsPage.maReverseOrderBox.Check( maPController->getReversePrint() ); + maJobPage.maReverseOrderBox.Check( maPController->getReversePrint() ); // fill printer listbox const std::vector< rtl::OUString >& rQueues( Printer::GetPrinterQueues() ); @@ -907,7 +913,7 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont maJobPage.maDetailsBtn.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); maNUpPage.maBorderCB.SetClickHdl( LINK( this, PrintDialog, ClickHdl ) ); maOptionsPage.maToFileBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); - maOptionsPage.maReverseOrderBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); + maJobPage.maReverseOrderBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); maOptionsPage.maCollateSingleJobsBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); maNUpPage.maPagesBtn.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); @@ -1056,6 +1062,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 ); @@ -1078,6 +1091,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(); } @@ -1638,6 +1655,16 @@ void PrintDialog::setupOptionalUI() { maJobPage.mxPrintRange->show( false, false ); maJobPage.maCopySpacer.Show( sal_False ); + maJobPage.maReverseOrderBox.Show( sal_False ); + } + else + { + // add an indent to the current column + vcl::Indenter* pIndent = new vcl::Indenter( maJobPage.mxPrintRange.get(), -1 ); + maJobPage.mxPrintRange->addChild( pIndent ); + // and create a column inside the indent + pIndent->setWindow( &maJobPage.maReverseOrderBox ); + maJobPage.maReverseOrderBox.Show( sal_True ); } #ifdef WNT @@ -1883,7 +1910,9 @@ void PrintDialog::preparePreview( bool i_bNewPage, bool i_bMayUseCache ) } Size aCurPageSize = aPrt->PixelToLogic( aPrt->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ); - maPreviewWindow.setPreview( aMtf, aCurPageSize, nPages > 0 ? rtl::OUString() : maNoPageStr, + maPreviewWindow.setPreview( aMtf, aCurPageSize, + aPrt->GetPaperName( false ), + nPages > 0 ? rtl::OUString() : maNoPageStr, aPrt->ImplGetDPIX(), aPrt->ImplGetDPIY(), aPrt->GetPrinterOptions().IsConvertToGreyscales() ); @@ -2079,6 +2108,7 @@ IMPL_LINK( PrintDialog, SelectHdl, ListBox*, pBox ) maPController->resetPrinterOptions( maOptionsPage.maToFileBox.IsChecked() ); // update text fields updatePrinterText(); + preparePreview( true, false ); } else if( pBox == &maNUpPage.maNupOrientationBox || pBox == &maNUpPage.maNupOrderBox ) { @@ -2188,9 +2218,9 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton ) makeAny( sal_Bool(isCollate()) ) ); checkControlDependencies(); } - else if( pButton == &maOptionsPage.maReverseOrderBox ) + else if( pButton == &maJobPage.maReverseOrderBox ) { - sal_Bool bChecked = maOptionsPage.maReverseOrderBox.IsChecked(); + sal_Bool bChecked = maJobPage.maReverseOrderBox.IsChecked(); maPController->setReversePrint( bChecked ); maPController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintReverse" ) ), makeAny( bChecked ) ); |