diff options
author | Ivan Timofeev <timofeev.i.s@gmail.com> | 2011-09-27 18:52:30 +0400 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-10-03 10:01:40 +0100 |
commit | bd9c699d27f323c9f685560e63e268742ec94802 (patch) | |
tree | bb3b0f3d00156dcce79f9cb9ff4d7ee4ea513f2e /vcl | |
parent | Fix for fdo#41408 - [UI] Need more room for localized string (IV) (diff) | |
download | core-bd9c699d27f323c9f685560e63e268742ec94802.tar.gz core-bd9c699d27f323c9f685560e63e268742ec94802.zip |
Print preview: set frame size to preview size even if there is no preview
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/printdlg.cxx | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 5f01ac28137d..969030c834fe 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -158,21 +158,17 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& ) { long nTextHeight = maHorzDim.GetTextHeight(); Size aSize( GetSizePixel() ); - aSize.Width() -= nTextHeight; - aSize.Height() -= nTextHeight; + Point aOffset( (aSize.Width() - maPreviewSize.Width() + nTextHeight) / 2 , + (aSize.Height() - maPreviewSize.Height() + nTextHeight) / 2 ); + if( maReplacementString.getLength() != 0 ) { // replacement is active Push(); - Rectangle aTextRect( Point( nTextHeight, nTextHeight ), aSize ); - DecorationView aVw( this ); - aVw.DrawFrame( aTextRect, FRAME_DRAW_GROUP ); - aTextRect.Left() += 2; - aTextRect.Top() += 2; - aTextRect.Right() -= 2; - aTextRect.Bottom() -= 2; Font aFont( GetSettings().GetStyleSettings().GetLabelFont() ); SetZoomedPointFont( aFont ); + Rectangle aTextRect( aOffset + Point( 2, 2 ), + Size( maPreviewSize.Width() - 4, maPreviewSize.Height() - 4 ) ); DrawText( aTextRect, maReplacementString, TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER | TEXT_DRAW_WORDBREAK | TEXT_DRAW_MULTILINE ); @@ -182,9 +178,6 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& ) { GDIMetaFile aMtf( maMtf ); - Point aOffset( (aSize.Width() - maPreviewSize.Width()) / 2 + nTextHeight, - (aSize.Height() - maPreviewSize.Height()) / 2 + nTextHeight ); - Size aVDevSize( maPageVDev.GetOutputSizePixel() ); const Size aLogicSize( maPageVDev.PixelToLogic( aVDevSize, MapMode( MAP_100TH_MM ) ) ); Size aOrigSize( maOrigSize ); @@ -213,11 +206,12 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& ) maPageVDev.SetMapMode( MAP_PIXEL ); DrawOutDev( aOffset, maPreviewSize, Point( 0, 0 ), aVDevSize, maPageVDev ); maPageVDev.SetDrawMode( nOldDrawMode ); - - DecorationView aVw( this ); - Rectangle aFrame( aOffset + Point( -1, -1 ), Size( maPreviewSize.Width() + 2, maPreviewSize.Height() + 2 ) ); - aVw.DrawFrame( aFrame, FRAME_DRAW_GROUP ); } + + Rectangle aFrameRect( aOffset + Point( -1, -1 ), + Size( maPreviewSize.Width() + 2, maPreviewSize.Height() + 2 ) ); + DecorationView aVw( this ); + aVw.DrawFrame( aFrameRect, FRAME_DRAW_GROUP ); } void PrintDialog::PrintPreviewWindow::Command( const CommandEvent& rEvt ) |