diff options
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 ); } } |