Kaydet (Commit) 8a7cfd2b authored tarafından Herbert Dürr's avatar Herbert Dürr

#i123840# normalize SalFrame resolution type to sal_Int32

üst 9d4445e4
......@@ -430,13 +430,13 @@ void AquaSalGraphics::initResolution( NSWindow* )
mfFakeDPIScale = 1.0;
}
void AquaSalGraphics::GetResolution( long& rDPIX, long& rDPIY )
void AquaSalGraphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY )
{
if( !mnRealDPIY )
initResolution( (mbWindow && mpFrame) ? mpFrame->getNSWindow() : nil );
rDPIX = static_cast<long>(mfFakeDPIScale * mnRealDPIX);
rDPIY = static_cast<long>(mfFakeDPIScale * mnRealDPIY);
rDPIX = lrint( mfFakeDPIScale * mnRealDPIX);
rDPIY = lrint( mfFakeDPIScale * mnRealDPIY);
}
void AquaSalGraphics::copyResolution( AquaSalGraphics& rGraphics )
......
......@@ -407,7 +407,7 @@ void AquaSalInfoPrinter::GetPageInfo( const ImplJobSetup*,
{
if( mpPrintInfo )
{
long nDPIX = 72, nDPIY = 72;
sal_Int32 nDPIX = 72, nDPIY = 72;
mpGraphics->GetResolution( nDPIX, nDPIY );
const double fXScaling = static_cast<double>(nDPIX)/72.0,
fYScaling = static_cast<double>(nDPIY)/72.0;
......
......@@ -1219,7 +1219,7 @@ static Font getFont( NSFont* pFont, long nDPIY, const Font& rDefault )
return aResult;
}
void AquaSalFrame::getResolution( long& o_rDPIX, long& o_rDPIY )
void AquaSalFrame::getResolution( sal_Int32& o_rDPIX, sal_Int32& o_rDPIY )
{
if( ! mpGraphics )
{
......@@ -1264,7 +1264,7 @@ void AquaSalFrame::UpdateSettings( AllSettings& rSettings )
// get the system font settings
Font aAppFont = aStyleSettings.GetAppFont();
long nDPIX = 72, nDPIY = 72;
sal_Int32 nDPIX = 72, nDPIY = 72;
getResolution( nDPIX, nDPIY );
aAppFont = getFont( [NSFont systemFontOfSize: 0], nDPIY, aAppFont );
......
......@@ -179,7 +179,7 @@ public:
NSView* getNSView() const { return mpNSView; }
unsigned int getStyleMask() const { return mnStyleMask; }
void getResolution( long& o_rDPIX, long& o_rDPIY );
void getResolution( sal_Int32& o_rDPIX, sal_Int32& o_rDPIY );
// actually the follwing methods do the same thing: flipping y coordinates
// but having two of them makes clearer what the coordinate system
......
......@@ -248,7 +248,7 @@ public:
Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion );
// get device resolution
virtual void GetResolution( long& rDPIX, long& rDPIY );
virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
// get the depth of the device
virtual sal_uInt16 GetBitCount();
// get the width of the device
......
......@@ -233,7 +233,7 @@ public:
// public SalGraphics methods, the interface to teh independent vcl part
// get device resolution
virtual void GetResolution( long& rDPIX, long& rDPIY );
virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
// get the depth of the device
virtual USHORT GetBitCount();
// get the width of the device
......
......@@ -263,7 +263,7 @@ public:
// public SalGraphics methods, the interface to teh independent vcl part
// get device resolution
virtual void GetResolution( long& rDPIX, long& rDPIY );
virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY );
// get the depth of the device
virtual sal_uInt16 GetBitCount();
// get the width of the device
......
......@@ -151,13 +151,16 @@ static SalColor ImplGetROPSalColor( SalROPColor nROPColor )
// -----------------------------------------------------------------------
void Os2SalGraphics::GetResolution( long& rDPIX, long& rDPIY )
void Os2SalGraphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY )
{
// since OOo asks for DPI, I will query FONT_RES, which seems to be
// more correct than _RESOLUTION fields (on my wide screen lcd)
// and does not require conversion
DevQueryCaps( mhDC, CAPS_HORIZONTAL_FONT_RES, 1, &rDPIX );
DevQueryCaps( mhDC, CAPS_VERTICAL_FONT_RES, 1, &rDPIY );
long nDPIX = 72, nDPIY = 72;
DevQueryCaps( mhDC, CAPS_HORIZONTAL_FONT_RES, 1, &nDPIX );
DevQueryCaps( mhDC, CAPS_VERTICAL_FONT_RES, 1, &nDPIY );
rDPIX = nDPIX;
rDPIY = nDPIY;
}
// -----------------------------------------------------------------------
......
......@@ -1279,10 +1279,8 @@ SalLayout* X11SalGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLe
if (!bDisableGraphite_ &&
GraphiteFontAdaptor::IsGraphiteEnabledFont(*mpServerFont[nFallbackLevel]))
{
sal_Int32 xdpi, ydpi;
xdpi = GetDisplay()->GetResolution().A();
ydpi = GetDisplay()->GetResolution().B();
sal_Int32 xdpi = GetDisplay()->GetResolution().A();
sal_Int32 ydpi = GetDisplay()->GetResolution().B();
GraphiteFontAdaptor * pGrfont = new GraphiteFontAdaptor( *mpServerFont[nFallbackLevel], xdpi, ydpi);
if (!pGrfont) return NULL;
......
......@@ -791,7 +791,7 @@ WinSalGraphics::~WinSalGraphics()
// -----------------------------------------------------------------------
void WinSalGraphics::GetResolution( long& rDPIX, long& rDPIY )
void WinSalGraphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY )
{
rDPIX = GetDeviceCaps( getHDC(), LOGPIXELSX );
rDPIY = GetDeviceCaps( getHDC(), LOGPIXELSY );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment