Kaydet (Commit) b7c30884 authored tarafından Khaled Hosny's avatar Khaled Hosny

It is just an innocent hyphen not a hyphenator

Change-Id: I7454d90adfd507aae4c7efd1d4075454f03cddd8
üst 775da618
...@@ -6016,11 +6016,11 @@ sal_Int32 OutputDevice::GetTextBreak( const OUString& rStr, long nTextWidth, ...@@ -6016,11 +6016,11 @@ sal_Int32 OutputDevice::GetTextBreak( const OUString& rStr, long nTextWidth,
} }
sal_Int32 OutputDevice::GetTextBreak( const OUString& rStr, long nTextWidth, sal_Int32 OutputDevice::GetTextBreak( const OUString& rStr, long nTextWidth,
sal_Unicode nHyphenatorChar, sal_Int32& rHyphenatorPos, sal_Unicode nHyphenChar, sal_Int32& rHyphenPos,
sal_Int32 nIndex, sal_Int32 nLen, sal_Int32 nIndex, sal_Int32 nLen,
long nCharExtra ) const long nCharExtra ) const
{ {
rHyphenatorPos = -1; rHyphenPos = -1;
SalLayout* pSalLayout = ImplLayout( rStr, nIndex, nLen ); SalLayout* pSalLayout = ImplLayout( rStr, nIndex, nLen );
sal_Int32 nRetVal = -1; sal_Int32 nRetVal = -1;
...@@ -6046,24 +6046,24 @@ sal_Int32 OutputDevice::GetTextBreak( const OUString& rStr, long nTextWidth, ...@@ -6046,24 +6046,24 @@ sal_Int32 OutputDevice::GetTextBreak( const OUString& rStr, long nTextWidth,
nRetVal = pSalLayout->GetTextBreak( nTextPixelWidth, nExtraPixelWidth, nSubPixelFactor ); nRetVal = pSalLayout->GetTextBreak( nTextPixelWidth, nExtraPixelWidth, nSubPixelFactor );
// calculate hyphenated break position // calculate hyphenated break position
OUString aHyphenatorStr(nHyphenatorChar); OUString aHyphenStr(nHyphenChar);
sal_Int32 nTempLen = 1; sal_Int32 nTempLen = 1;
SalLayout* pHyphenatorLayout = ImplLayout( aHyphenatorStr, 0, nTempLen ); SalLayout* pHyphenLayout = ImplLayout( aHyphenStr, 0, nTempLen );
if( pHyphenatorLayout ) if( pHyphenLayout )
{ {
// calculate subpixel width of hyphenation character // calculate subpixel width of hyphenation character
long nHyphenatorPixelWidth = pHyphenatorLayout->GetTextWidth() * nSubPixelFactor; long nHyphenPixelWidth = pHyphenLayout->GetTextWidth() * nSubPixelFactor;
pHyphenatorLayout->Release(); pHyphenLayout->Release();
// calculate hyphenated break position // calculate hyphenated break position
nTextPixelWidth -= nHyphenatorPixelWidth; nTextPixelWidth -= nHyphenPixelWidth;
if( nExtraPixelWidth > 0 ) if( nExtraPixelWidth > 0 )
nTextPixelWidth -= nExtraPixelWidth; nTextPixelWidth -= nExtraPixelWidth;
rHyphenatorPos = pSalLayout->GetTextBreak(nTextPixelWidth, nExtraPixelWidth, nSubPixelFactor); rHyphenPos = pSalLayout->GetTextBreak(nTextPixelWidth, nExtraPixelWidth, nSubPixelFactor);
if( rHyphenatorPos > nRetVal ) if( rHyphenPos > nRetVal )
rHyphenatorPos = nRetVal; rHyphenPos = nRetVal;
} }
pSalLayout->Release(); pSalLayout->Release();
......
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