diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-12-03 12:27:44 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-12-03 16:09:36 +0000 |
commit | d83328b233f51d4a70bfeaae90129a68dccf825b (patch) | |
tree | 82f2aa22d722f744af83fdfb634d6f78be1bbc4e /vcl/aqua/source/gdi | |
parent | f1bd4db85538e4979dea6e0d6d306ac89210ea32 (diff) |
longparas: convert GetTextBreak to sal_Int32
Change-Id: I693e4c9916e1968c33ebd922829662f6efc27bfb
Diffstat (limited to 'vcl/aqua/source/gdi')
-rw-r--r-- | vcl/aqua/source/gdi/atsui/salatslayout.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/vcl/aqua/source/gdi/atsui/salatslayout.cxx b/vcl/aqua/source/gdi/atsui/salatslayout.cxx index 250831cea453..801af6a55801 100644 --- a/vcl/aqua/source/gdi/atsui/salatslayout.cxx +++ b/vcl/aqua/source/gdi/atsui/salatslayout.cxx @@ -748,13 +748,13 @@ long ATSLayout::FillDXArray( sal_Int32* pDXArray ) const * * @return : string index corresponding to the suggested line break **/ -int ATSLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) const +sal_Int32 ATSLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) const { SAL_INFO("vcl.atsui.layout", "GetTextBreak(" << this << ",nMaxWidth=" << nMaxWidth << ",nCharExtra=" << nCharExtra << ",nFactor=" << nFactor << ")" ); if( !maATSULayout ) { - SAL_INFO( "vcl.atsui.layout", "GetTextBreak(): no maATSULayout, returning STRING_LEN" ); - return STRING_LEN; + SAL_INFO( "vcl.atsui.layout", "GetTextBreak(): no maATSULayout, returning -1" ); + return -1; } // the semantics of the legacy use case (nCharExtra!=0) cannot be mapped to ATSUBreakLine() @@ -762,7 +762,7 @@ int ATSLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) cons { // prepare the measurement by layouting and measuring the un-expanded/un-condensed text if( !InitGIA() ) - return STRING_LEN; + return -1; // TODO: use a better way than by testing each the char position ATSUTextMeasurement nATSUSumWidth = 0; @@ -779,7 +779,7 @@ int ATSLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) cons return (mnMinCharPos + i); } - return STRING_LEN; + return -1; } // get a quick overview on what could fit @@ -806,15 +806,15 @@ int ATSLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) cons OSStatus eStatus = ATSUBreakLine( maATSULayout, mnMinCharPos, nATSUMaxWidth, false, &nBreakPos ); if( (eStatus != noErr) && (eStatus != kATSULineBreakInWord) ) - return STRING_LEN; + return -1; // the result from ATSUBreakLine() doesn't match the semantics expected by its // application layer callers from SW+SVX+I18N. Adjust the results to the expectations: // ATSU reports that everything fits even when trailing spaces would break the line - // #i89789# OOo's application layers expect STRING_LEN if everything fits + // #i89789# OOo's application layers expect -1 if everything fits if( nBreakPos >= static_cast<UniCharArrayOffset>(mnEndCharPos) ) - return STRING_LEN; + return -1; // GetTextBreak()'s callers expect it to return the "stupid visual line break". // Returning anything else result.s in subtle problems in the application layers. |