1
--- vcl/unx/source/app/saldisp.cxx (.../tags/DEV300_m46/vcl) (Revision 271422)
2
+++ vcl/unx/source/app/saldisp.cxx (.../cws/vcl101/vcl) (Revision 271422)
4
int nDisplayScreens = ScreenCount( pDisp_ );
5
m_aScreens = std::vector<ScreenData>(nDisplayScreens);
8
+ mbExactResolution = false;
10
* Xft resolution should take precedence since
11
* it is what modern desktops use.
13
- if ((value = XGetDefault (pDisp_, "Xft", "dpi")))
14
+ const char* pValStr = XGetDefault( pDisp_, "Xft", "dpi" );
15
+ if( pValStr != NULL )
17
- rtl::OString str (value);
18
- long dpi = (long) str.toDouble();
19
- aResolution_ = Pair( dpi, dpi );
20
- mbExactResolution = true;
21
+ const rtl::OString aValStr( pValStr );
22
+ const long nDPI = (long) aValStr.toDouble();
23
+ // guard against insane resolution
24
+ if( (nDPI >= 50) && (nDPI <= 500) )
26
+ aResolution_ = Pair( nDPI, nDPI );
27
+ mbExactResolution = true;
31
+ if( mbExactResolution == false )
34
Pair( DPI( WidthOfScreen( DefaultScreenOfDisplay( pDisp_ ) ), DisplayWidthMM ( pDisp_, m_nDefaultScreen ) ),
35
DPI( HeightOfScreen( DefaultScreenOfDisplay( pDisp_ ) ), DisplayHeightMM( pDisp_, m_nDefaultScreen ) ) );
36
- mbExactResolution = false;
39
nMaxRequestSize_ = XExtendedMaxRequestSize( pDisp_ ) * 4;