diff -r 30f62d96b898 -r 8d23fe8ae91b windowing/windowserver/nga/CLIENT/RSCRDEV.CPP --- a/windowing/windowserver/nga/CLIENT/RSCRDEV.CPP Thu Apr 08 12:02:10 2010 +0100 +++ b/windowing/windowserver/nga/CLIENT/RSCRDEV.CPP Thu Apr 08 12:06:20 2010 +0100 @@ -254,6 +254,11 @@ TInt64 twips=aTwips; TSize displaySizeInPixels = DisplaySizeInPixels(); TSize physicalScreenSizeInTwips = PhysicalScreenSizeInTwips(); + if (displaySizeInPixels.iWidth <= 0 || + physicalScreenSizeInTwips.iWidth <= 0) + { + return 0; + } twips=(twips*displaySizeInPixels.iWidth+(physicalScreenSizeInTwips.iWidth/2))/physicalScreenSizeInTwips.iWidth; return I64INT(twips); } @@ -267,6 +272,11 @@ TInt64 twips=aTwips; TSize displaySizeInPixels = DisplaySizeInPixels(); TSize physicalScreenSizeInTwips = PhysicalScreenSizeInTwips(); + if (displaySizeInPixels.iHeight <= 0 || + physicalScreenSizeInTwips.iHeight <= 0) + { + return 0; + } twips=(twips*displaySizeInPixels.iHeight+(physicalScreenSizeInTwips.iHeight/2))/physicalScreenSizeInTwips.iHeight; return I64INT(twips); } @@ -280,6 +290,11 @@ TInt64 pixels=aPixels; TSize displaySizeInPixels = DisplaySizeInPixels(); TSize physicalScreenSizeInTwips = PhysicalScreenSizeInTwips(); + if (displaySizeInPixels.iWidth <= 0 || + physicalScreenSizeInTwips.iWidth <= 0) + { + return 0; + } pixels=(pixels*physicalScreenSizeInTwips.iWidth+(displaySizeInPixels.iWidth/2))/displaySizeInPixels.iWidth; return I64INT(pixels); } @@ -294,6 +309,11 @@ TInt64 pixels=aPixels; TSize displaySizeInPixels = DisplaySizeInPixels(); TSize physicalScreenSizeInTwips = PhysicalScreenSizeInTwips(); + if (displaySizeInPixels.iHeight <= 0 || + physicalScreenSizeInTwips.iHeight <= 0) + { + return 0; + } pixels=(pixels*physicalScreenSizeInTwips.iHeight+(displaySizeInPixels.iHeight/2))/displaySizeInPixels.iHeight; return I64INT(pixels); }