diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-07-18 18:21:12 +0200 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-07-20 22:10:59 +0200 |
commit | cd3d26b7edbce67805259a71e4118223e02ebdd4 (patch) | |
tree | fbb103d9877275f80eab075f22a8e0753fccf151 /toolkit | |
parent | 8e21a02520cbd2fdc09df1ca675f4aa46a02d5f6 (diff) |
vcl consitent use of long for corrdinate
most of length in vcl are calculated in 'long'
but array of X position tend to be in sal_Int32.
As a prep work to be able to support 'double'
as the base type of Device Coordinate, harmonize
the use of 'long' for non-float coordinate.
Change-Id: I7cb33301ff6a5e2c62247b36a4e07e168a58a323
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxfont.cxx | 7 | ||||
-rw-r--r-- | toolkit/source/awt/vclxgraphics.cxx | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/toolkit/source/awt/vclxfont.cxx b/toolkit/source/awt/vclxfont.cxx index 14174f25b5d7..139defbc1af4 100644 --- a/toolkit/source/awt/vclxfont.cxx +++ b/toolkit/source/awt/vclxfont.cxx @@ -176,8 +176,13 @@ sal_Int32 VCLXFont::getStringWidthArray( const OUString& str, ::com::sun::star:: { Font aOldFont = pOutDev->GetFont(); pOutDev->SetFont( maFont ); + long* pDXA = (long*)alloca(str.getLength() * sizeof(long)); + nRet = pOutDev->GetTextArray( str, pDXA ); rDXArray = ::com::sun::star::uno::Sequence<sal_Int32>( str.getLength() ); - nRet = pOutDev->GetTextArray( str, rDXArray.getArray() ); + for(int i = 0; i < str.getLength(); i++) + { + rDXArray[i] = pDXA[i]; + } pOutDev->SetFont( aOldFont ); } return nRet; diff --git a/toolkit/source/awt/vclxgraphics.cxx b/toolkit/source/awt/vclxgraphics.cxx index 6a3a479a44dc..98b4d022e6ab 100644 --- a/toolkit/source/awt/vclxgraphics.cxx +++ b/toolkit/source/awt/vclxgraphics.cxx @@ -540,7 +540,12 @@ void VCLXGraphics::drawTextArray( sal_Int32 x, sal_Int32 y, const OUString& rTex if( mpOutputDevice ) { InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS|INITOUTDEV_FONT ); - mpOutputDevice->DrawTextArray( Point( x, y ), rText, rLongs.getConstArray() ); + long* pDXA = (long*)alloca(rText.getLength() * sizeof(long)); + for(int i = 0; i < rText.getLength(); i++) + { + pDXA[i] = rLongs[i]; + } + mpOutputDevice->DrawTextArray( Point( x, y ), rText, pDXA ); } } |