summaryrefslogtreecommitdiff
path: root/vcl/source/gdi
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2014-09-06 16:13:09 +0200
committerNorbert Thiebaud <nthiebaud@gmail.com>2014-09-12 01:45:27 +0200
commit1b42acdaeae134f94580d6e1eba89da16741d596 (patch)
tree882710be2c142cdef62823c9600925ee22f8dab7 /vcl/source/gdi
parent43638d8428abb8358a703247651fbfc72e47ff72 (diff)
vcl: use DeviceCoordinate for GetCaretPositions in sallayout
Change-Id: I5a959e1c3806da713e106c1b0fc8690a6578987b
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r--vcl/source/gdi/sallayout.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index c30a99af01fb..a3124c443e37 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -1247,7 +1247,7 @@ void GenericSalLayout::KashidaJustify( long nKashidaIndex, int nKashidaWidth )
}
}
-void GenericSalLayout::GetCaretPositions( int nMaxIndex, long* pCaretXArray ) const
+void GenericSalLayout::GetCaretPositions( int nMaxIndex, DeviceCoordinate* pCaretXArray ) const
{
// initialize result array
long nXPos = -1;
@@ -1990,26 +1990,28 @@ DeviceCoordinate MultiSalLayout::FillDXArray( DeviceCoordinate* pCharWidths ) co
return nMaxWidth;
}
-void MultiSalLayout::GetCaretPositions( int nMaxIndex, long* pCaretXArray ) const
+void MultiSalLayout::GetCaretPositions( int nMaxIndex, DeviceCoordinate* pCaretXArray ) const
{
SalLayout& rLayout = *mpLayouts[ 0 ];
rLayout.GetCaretPositions( nMaxIndex, pCaretXArray );
if( mnLevel > 1 )
{
- long* pTempPos = (long*)alloca( nMaxIndex * sizeof(long) );
+ DeviceCoordinate* pTempPos = (DeviceCoordinate*)alloca( nMaxIndex * sizeof(DeviceCoordinate) );
for( int n = 1; n < mnLevel; ++n )
{
mpLayouts[ n ]->GetCaretPositions( nMaxIndex, pTempPos );
double fUnitMul = mnUnitsPerPixel;
fUnitMul /= mpLayouts[n]->GetUnitsPerPixel();
for( int i = 0; i < nMaxIndex; ++i )
+ {
if( pTempPos[i] >= 0 )
{
- long w = pTempPos[i];
- w = static_cast<long>(w*fUnitMul + 0.5);
+ DeviceCoordinate w = pTempPos[i];
+ w = (DeviceCoordinate)(w * fUnitMul + 0.5);
pCaretXArray[i] = w;
}
+ }
}
}
}