Kaydet (Commit) 4c1e2c44 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: fdo#82550 MacOSX GetTextBreak always return -1

so multiline text ends up splitting over a huge number of
lines leading to massively tall dialogs when they contain
text which is supposed to line break

regression from 6ca2d0d6

Change-Id: I51cecd9164112af3208bffced63aed7e261ea9e2
üst 19efa546
...@@ -1428,12 +1428,12 @@ sal_Int32 OutputDevice::GetTextBreak( const OUString& rStr, long nTextWidth, ...@@ -1428,12 +1428,12 @@ sal_Int32 OutputDevice::GetTextBreak( const OUString& rStr, long nTextWidth,
long nWidthFactor = pSalLayout->GetUnitsPerPixel(); long nWidthFactor = pSalLayout->GetUnitsPerPixel();
long nSubPixelFactor = (nWidthFactor < 64 ) ? 64 : 1; long nSubPixelFactor = (nWidthFactor < 64 ) ? 64 : 1;
nTextWidth *= nWidthFactor * nSubPixelFactor; nTextWidth *= nWidthFactor * nSubPixelFactor;
DeviceCoordinate nTextPixelWidth = LogicWidthToDeviceCoordinate( nTextWidth ); long nTextPixelWidth = ImplLogicWidthToDevicePixel( nTextWidth );
DeviceCoordinate nExtraPixelWidth = 0; long nExtraPixelWidth = 0;
if( nCharExtra != 0 ) if( nCharExtra != 0 )
{ {
nCharExtra *= nWidthFactor * nSubPixelFactor; nCharExtra *= nWidthFactor * nSubPixelFactor;
nExtraPixelWidth = LogicWidthToDeviceCoordinate( nCharExtra ); nExtraPixelWidth = ImplLogicWidthToDevicePixel( nCharExtra );
} }
nRetVal = pSalLayout->GetTextBreak( nTextPixelWidth, nExtraPixelWidth, nSubPixelFactor ); nRetVal = pSalLayout->GetTextBreak( nTextPixelWidth, nExtraPixelWidth, nSubPixelFactor );
...@@ -1462,12 +1462,12 @@ sal_Int32 OutputDevice::GetTextBreak( const OUString& rStr, long nTextWidth, ...@@ -1462,12 +1462,12 @@ sal_Int32 OutputDevice::GetTextBreak( const OUString& rStr, long nTextWidth,
long nSubPixelFactor = (nWidthFactor < 64 ) ? 64 : 1; long nSubPixelFactor = (nWidthFactor < 64 ) ? 64 : 1;
nTextWidth *= nWidthFactor * nSubPixelFactor; nTextWidth *= nWidthFactor * nSubPixelFactor;
DeviceCoordinate nTextPixelWidth = LogicWidthToDeviceCoordinate( nTextWidth ); long nTextPixelWidth = ImplLogicWidthToDevicePixel( nTextWidth );
DeviceCoordinate nExtraPixelWidth = 0; long nExtraPixelWidth = 0;
if( nCharExtra != 0 ) if( nCharExtra != 0 )
{ {
nCharExtra *= nWidthFactor * nSubPixelFactor; nCharExtra *= nWidthFactor * nSubPixelFactor;
nExtraPixelWidth = LogicWidthToDeviceCoordinate( nCharExtra ); nExtraPixelWidth = ImplLogicWidthToDevicePixel( nCharExtra );
} }
// calculate un-hyphenated break position // calculate un-hyphenated break position
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment