diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-06-04 15:06:14 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-06-04 15:06:14 +0000 |
commit | f9278148dc944e947fa8ed2b786098bcdba39004 (patch) | |
tree | 87ab1c5352b57526c3bcf3e34c5a4a4ad98ea453 /vcl/aqua | |
parent | cf1a66987abce026206ef2be5089847dcca1ae88 (diff) |
CWS-TOOLING: integrate CWS vcl102
pl: resync to m49
pl: #i102082# correct index access
pl: #i102082# correct index access
pl: merge tag
pl: #i101674# update selection background markers for toolbars and menus
pl: fix debug compile
pl: #i101461# improve xdg functionality (thanks oblin)
pl: #i100501# get IsAddStream from configuration setting in direct export case
pl: #i100725# check for null ptr
pl: #i100617# fix got lost in merge
Diffstat (limited to 'vcl/aqua')
-rw-r--r-- | vcl/aqua/source/a11y/aqua11ywrapper.mm | 8 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/salgdi.cxx | 90 |
2 files changed, 58 insertions, 40 deletions
diff --git a/vcl/aqua/source/a11y/aqua11ywrapper.mm b/vcl/aqua/source/a11y/aqua11ywrapper.mm index 066748cc1525..d6f99c7020d6 100644 --- a/vcl/aqua/source/a11y/aqua11ywrapper.mm +++ b/vcl/aqua/source/a11y/aqua11ywrapper.mm @@ -178,9 +178,11 @@ static MacOSBOOL isPopupMenuOpen = NO; -(Reference < XAccessible >)getFirstRadioButtonInGroup { Reference < XAccessibleRelationSet > rxAccessibleRelationSet = [ self accessibleContext ] -> getAccessibleRelationSet(); - AccessibleRelation relationMemberOf = rxAccessibleRelationSet -> getRelationByType ( AccessibleRelationType::MEMBER_OF ); - if ( relationMemberOf.RelationType == AccessibleRelationType::MEMBER_OF && relationMemberOf.TargetSet.hasElements() ) { - return Reference < XAccessible > ( relationMemberOf.TargetSet[0], UNO_QUERY ); + if( rxAccessibleRelationSet.is() ) + { + AccessibleRelation relationMemberOf = rxAccessibleRelationSet -> getRelationByType ( AccessibleRelationType::MEMBER_OF ); + if ( relationMemberOf.RelationType == AccessibleRelationType::MEMBER_OF && relationMemberOf.TargetSet.hasElements() ) + return Reference < XAccessible > ( relationMemberOf.TargetSet[0], UNO_QUERY ); } return Reference < XAccessible > (); } diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx index 314753302534..3ee54afe2fba 100644 --- a/vcl/aqua/source/gdi/salgdi.cxx +++ b/vcl/aqua/source/gdi/salgdi.cxx @@ -346,64 +346,80 @@ void AquaSalGraphics::updateResolution() void AquaSalGraphics::initResolution( NSWindow* pWin ) { - NSScreen* pScreen = nil; + // #i100617# read DPI only once; there is some kind of weird caching going on + // if the main screen changes + // FIXME: this is really unfortunate and needs to be investigated - /* #i91301# - many woes went into the try to have different resolutions - on different screens. The result of these trials is that OOo is not ready - for that yet, vcl and applications would need to be adapted. + SalData* pSalData = GetSalData(); + if( pSalData->mnDPIX == 0 || pSalData->mnDPIY == 0 ) + { + NSScreen* pScreen = nil; - Unfortunately this is not possible in the 3.0 timeframe. - So let's stay with one resolution for all Windows and VirtualDevices - which is the resolution of the main screen + /* #i91301# + many woes went into the try to have different resolutions + on different screens. The result of these trials is that OOo is not ready + for that yet, vcl and applications would need to be adapted. - This of course also means that measurements are exact only on the main screen. - For activating different resolutions again just comment out the two lines below. + Unfortunately this is not possible in the 3.0 timeframe. + So let's stay with one resolution for all Windows and VirtualDevices + which is the resolution of the main screen - if( pWin ) + This of course also means that measurements are exact only on the main screen. + For activating different resolutions again just comment out the two lines below. + + if( pWin ) pScreen = [pWin screen]; - */ - if( pScreen == nil ) - { - NSArray* pScreens = [NSScreen screens]; - if( pScreens ) - pScreen = [pScreens objectAtIndex: 0]; - } + */ + if( pScreen == nil ) + { + NSArray* pScreens = [NSScreen screens]; + if( pScreens ) + pScreen = [pScreens objectAtIndex: 0]; + } - mnRealDPIX = mnRealDPIY = 96; - if( pScreen ) - { - NSDictionary* pDev = [pScreen deviceDescription]; - if( pDev ) + mnRealDPIX = mnRealDPIY = 96; + if( pScreen ) { - NSNumber* pVal = [pDev objectForKey: @"NSScreenNumber"]; - if( pVal ) + NSDictionary* pDev = [pScreen deviceDescription]; + if( pDev ) { - // FIXME: casting a long to CGDirectDisplayID is evil, but - // Apple suggest to do it this way - const CGDirectDisplayID nDisplayID = (CGDirectDisplayID)[pVal longValue]; - const CGSize aSize = CGDisplayScreenSize( nDisplayID ); // => result is in millimeters - mnRealDPIX = static_cast<long>((CGDisplayPixelsWide( nDisplayID ) * 25.4) / aSize.width); - mnRealDPIY = static_cast<long>((CGDisplayPixelsHigh( nDisplayID ) * 25.4) / aSize.height); + NSNumber* pVal = [pDev objectForKey: @"NSScreenNumber"]; + if( pVal ) + { + // FIXME: casting a long to CGDirectDisplayID is evil, but + // Apple suggest to do it this way + const CGDirectDisplayID nDisplayID = (CGDirectDisplayID)[pVal longValue]; + const CGSize aSize = CGDisplayScreenSize( nDisplayID ); // => result is in millimeters + mnRealDPIX = static_cast<long>((CGDisplayPixelsWide( nDisplayID ) * 25.4) / aSize.width); + mnRealDPIY = static_cast<long>((CGDisplayPixelsHigh( nDisplayID ) * 25.4) / aSize.height); + } + else + { + DBG_ERROR( "no resolution found in device description" ); + } } else { - DBG_ERROR( "no resolution found in device description" ); + DBG_ERROR( "no device description" ); } } else { - DBG_ERROR( "no device description" ); + DBG_ERROR( "no screen found" ); } + + // for OSX any anisotropy reported for the display resolution is best ignored (e.g. TripleHead2Go) + mnRealDPIX = mnRealDPIY = (mnRealDPIX + mnRealDPIY + 1) / 2; + + pSalData->mnDPIX = mnRealDPIX; + pSalData->mnDPIY = mnRealDPIY; } else { - DBG_ERROR( "no screen found" ); + mnRealDPIX = pSalData->mnDPIX; + mnRealDPIY = pSalData->mnDPIY; } - // for OSX any anisotropy reported for the display resolution is best ignored (e.g. TripleHead2Go) - mnRealDPIX = mnRealDPIY = (mnRealDPIX + mnRealDPIY + 1) / 2; - mfFakeDPIScale = 1.0; } |