diff options
-rw-r--r-- | vcl/aqua/source/gdi/salprn.cxx | 10 | ||||
-rw-r--r-- | vcl/inc/vcl/gdimtf.hxx | 8 | ||||
-rw-r--r-- | vcl/source/control/lstbox.cxx | 46 |
3 files changed, 43 insertions, 21 deletions
diff --git a/vcl/aqua/source/gdi/salprn.cxx b/vcl/aqua/source/gdi/salprn.cxx index cdc11162557e..799a620345d7 100644 --- a/vcl/aqua/source/gdi/salprn.cxx +++ b/vcl/aqua/source/gdi/salprn.cxx @@ -336,11 +336,15 @@ BOOL AquaSalInfoPrinter::SetData( ULONG i_nFlags, ImplJobSetup* io_pSetupData ) if( (i_nFlags & SAL_JOBSET_PAPERSIZE) != 0) { // set paper format - long width = 0, height = 0; + long width = 21000, height = 29700; if( io_pSetupData->mePaperFormat == PAPER_USER ) { - width = io_pSetupData->mnPaperWidth; - height = io_pSetupData->mnPaperHeight; + // #i101108# sanity check + if( io_pSetupData->mnPaperWidth && io_pSetupData->mnPaperHeight ) + { + width = io_pSetupData->mnPaperWidth; + height = io_pSetupData->mnPaperHeight; + } } else { diff --git a/vcl/inc/vcl/gdimtf.hxx b/vcl/inc/vcl/gdimtf.hxx index 48b39d290872..e4acd55439cc 100644 --- a/vcl/inc/vcl/gdimtf.hxx +++ b/vcl/inc/vcl/gdimtf.hxx @@ -165,6 +165,14 @@ public: void Scale( const Fraction& rScaleX, const Fraction& rScaleY ); void Rotate( long nAngle10 ); void Clip( const Rectangle& ); + /* get the bound rect of the contained actions + * caveats: + * - clip actions will limit the contained actions, + * but the current clipregion of the passed OutputDevice will not + * - coordinates of actions will be transformed to preferred mapmode + * - the returned rectangle is relative to the preferred mapmode of the metafile + */ + Rectangle GetBoundRect( OutputDevice& i_rReference ); void Adjust( short nLuminancePercent = 0, short nContrastPercent = 0, short nChannelRPercent = 0, short nChannelGPercent = 0, diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx index 7c9842c278d1..55a5e8bfd282 100644 --- a/vcl/source/control/lstbox.cxx +++ b/vcl/source/control/lstbox.cxx @@ -31,21 +31,21 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" -#ifndef _SV_RC_H -#include <tools/rc.h> -#endif -#include <vcl/svdata.hxx> -#include <vcl/decoview.hxx> -#include <vcl/event.hxx> -#include <vcl/scrbar.hxx> -#include <vcl/button.hxx> -#include <vcl/edit.hxx> -#include <vcl/subedit.hxx> -#include <vcl/ilstbox.hxx> -#include <vcl/lstbox.hxx> -#include <vcl/combobox.hxx> -#include <vcl/controllayout.hxx> -#include <tools/debug.hxx> +#include "tools/rc.h" + +#include "vcl/svdata.hxx" +#include "vcl/decoview.hxx" +#include "vcl/event.hxx" +#include "vcl/scrbar.hxx" +#include "vcl/button.hxx" +#include "vcl/edit.hxx" +#include "vcl/subedit.hxx" +#include "vcl/ilstbox.hxx" +#include "vcl/lstbox.hxx" +#include "vcl/combobox.hxx" +#include "vcl/controllayout.hxx" + +#include "tools/debug.hxx" @@ -128,9 +128,7 @@ void ListBox::ImplInit( Window* pParent, WinBits nStyle ) GetBorder( nLeft, nTop, nRight, nBottom ); mnDDHeight = (USHORT)(GetTextHeight() + nTop + nBottom + 4); - // FIXME: this is currently only on mac/aqua - if( ImplGetSVData()->maNWFData.mbNoFocusRects && - IsNativeWidgetEnabled() && + if( IsNativeWidgetEnabled() && IsNativeControlSupported( CTRL_LISTBOX, PART_ENTIRE_CONTROL ) ) { ImplControlValue aControlValue; @@ -651,6 +649,7 @@ void ListBox::Resize() long nTop = 0; long nBottom = aOutSz.Height(); + // note: in case of no border, pBorder will actually be this Window *pBorder = GetWindow( WINDOW_BORDER ); ImplControlValue aControlValue; Point aPoint; @@ -679,6 +678,17 @@ void ListBox::Resize() // use the themes drop down size Rectangle aContentRect = aContent.GetBoundRect(); + if( ! (GetStyle() & WB_BORDER) && ImplGetSVData()->maNWFData.mbNoFocusRects ) + { + // no border but focus ring behavior -> we have a problem; the + // native rect relies on the border to draw the focus + // let's do the best we can and center vertically, so it doesn't look + // completely wrong. + Size aSz( GetOutputSizePixel() ); + long nDiff = aContentRect.Top() - (aSz.Height() - aContentRect.GetHeight())/2; + aContentRect.Top() -= nDiff; + aContentRect.Bottom() -= nDiff; + } mpImplWin->SetPosSizePixel( aContentRect.TopLeft(), aContentRect.GetSize() ); } else |