diff options
author | Kurt Zenker <kz@openoffice.org> | 2007-05-10 08:39:58 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2007-05-10 08:39:58 +0000 |
commit | 42fa2e75a845bd7f384df0d6771e6d1860a73702 (patch) | |
tree | ee37429d5420d93a8a0edebeb91abdffa830fec4 /toolkit | |
parent | 5b603d4293b1c4bbcb8e0a273b888bc03f5e9942 (diff) |
INTEGRATION: CWS dba23a (1.72.16); FILE MERGED
2007/03/07 11:23:44 fs 1.72.16.1: draw: Always use PaintToDevice, nowadays the old hacks are not necessary anymore (and hurt in case of #i74694# and #i74895#)
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxwindow.cxx | 85 |
1 files changed, 20 insertions, 65 deletions
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index d4363daadf6f..94f6f8179018 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -4,9 +4,9 @@ * * $RCSfile: vclxwindow.cxx,v $ * - * $Revision: 1.72 $ + * $Revision: 1.73 $ * - * last change: $Author: vg $ $Date: 2007-01-15 13:41:53 $ + * last change: $Author: kz $ $Date: 2007-05-10 09:39:58 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -2345,74 +2345,29 @@ void VCLXWindow::draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno: ::vos::OGuard aGuard( GetMutex() ); Window* pWindow = GetWindow(); + if ( !pWindow ) + return; - if ( pWindow ) - { - OutputDevice* pDev = VCLUnoHelper::GetOutputDevice( mxViewGraphics ); - Point aPos( nX, nY ); - - if ( !pDev ) - pDev = pWindow->GetParent(); - - if ( pWindow->GetParent() && !pWindow->IsSystemWindow() && ( pWindow->GetParent() == pDev ) ) - { - // #i40647# don't draw here if this is a recursive call - // sometimes this is called recursively, because the Update call on the parent - // (strangely) triggers another paint. Prevent a stack overflow here - // Yes, this is only fixing symptoms for the moment .... - // #i40647# / 2005-01-18 / frank.schoenheit@sun.com - if ( !mbDrawingOntoParent ) - { - FlagGuard aDrawingflagGuard( mbDrawingOntoParent ); - - BOOL bWasVisible = pWindow->IsVisible(); - Point aOldPos( pWindow->GetPosPixel() ); - - if ( bWasVisible && aOldPos == aPos ) - { - pWindow->Update(); - return; - } - - pWindow->SetPosPixel( aPos ); + OutputDevice* pDev = VCLUnoHelper::GetOutputDevice( mxViewGraphics ); + if ( !pDev ) + pDev = pWindow->GetParent(); + if ( !pDev) + return; - // Erstmal ein Update auf den Parent, damit nicht beim Update - // auf dieses Fenster noch ein Paint vom Parent abgearbeitet wird, - // wo dann ggf. dieses Fenster sofort wieder gehidet wird. - if( pWindow->GetParent() ) - pWindow->GetParent()->Update(); + Size aSize = pWindow->GetSizePixel(); + aSize = pDev->PixelToLogic( aSize ); - pWindow->Show(); - pWindow->Update(); - pWindow->SetParentUpdateMode( sal_False ); - pWindow->Hide(); - pWindow->SetParentUpdateMode( sal_True ); + Point aPos = pDev->PixelToLogic( Point( nX, nY ) ); - pWindow->SetPosPixel( aOldPos ); - if ( bWasVisible ) - pWindow->Show( TRUE ); - } - } - else if ( pDev ) - { - Size aSz = pWindow->GetSizePixel(); - aSz = pDev->PixelToLogic( aSz ); - Point aP = pDev->PixelToLogic( aPos ); + vcl::PDFExtOutDevData* pPDFExport = dynamic_cast<vcl::PDFExtOutDevData*>(pDev->GetExtOutDevData()); + bool bDrawSimplified = ( pDev->GetOutDevType() == OUTDEV_PRINTER ) + || ( pDev->GetOutDevViewType() == OUTDEV_VIEWTYPE_PRINTPREVIEW ) + || ( pPDFExport && ! pPDFExport->GetIsExportFormFields() ); - vcl::PDFExtOutDevData* pPDFExport = dynamic_cast<vcl::PDFExtOutDevData*>(pDev->GetExtOutDevData()); - bool bDrawSimple = ( pDev->GetOutDevType() == OUTDEV_PRINTER ) - || ( pDev->GetOutDevViewType() == OUTDEV_VIEWTYPE_PRINTPREVIEW ) - || ( pPDFExport && ! pPDFExport->GetIsExportFormFields() ); - if ( bDrawSimple ) - { - pWindow->Draw( pDev, aP, aSz, WINDOW_DRAW_NOCONTROLS ); - } - else - { - pWindow->PaintToDevice( pDev, aP, aSz ); - } - } - } + if ( bDrawSimplified ) + pWindow->Draw( pDev, aPos, aSize, WINDOW_DRAW_NOCONTROLS ); + else + pWindow->PaintToDevice( pDev, aPos, aSize ); } void VCLXWindow::setZoom( float fZoomX, float /*fZoomY*/ ) throw(::com::sun::star::uno::RuntimeException) |