[REVIEW-3-5] TextEngine::SeekCursor needs to call SetFont after all

Thomas Arnhold thomas at arnhold.org
Thu Apr 12 02:45:17 PDT 2012


Hi Stephan,

thanks for fixing this! Yes, I didn't see the rFont arg... All of this 
changeset was some kind of dumb. Sorry for this.

Thomas

On 03/13/2012 11:19 AM, Stephan Bergmann wrote:
>> commit 40c0ff75d2a0f987454b068a663908e6d9b87b9b
>> Author: Stephan Bergmann <sbergman at redhat.com>
>> Date: Tue Mar 13 10:33:10 2012 +0100
>>
>> TextEngine::SeekCursor needs to call SetFont after all
>>
>> 10f28d5c9a072bf108a79f3b05ad8247ca0dcea5 "callcatcher: build fixes"
>> had removed
>> this with the comment "SetFont() doesn't do anything" but that is
>> clearly wrong:
>> Without this, e.g. bold text within text fields is not displayed as
>> such (e.g.,
>> "File - New - Templates and Documnets - Templates - Presentation
>> Backgrounds -
>> Black and White": the captions in the right hand pane ("Title:",
>> "Date:", etc.)
>> should be bold).
>>
>> diff --git a/svtools/source/edit/texteng.cxx
>> b/svtools/source/edit/texteng.cxx
>> index 6baf8a9..30aef8f 100644
>> --- a/svtools/source/edit/texteng.cxx
>> +++ b/svtools/source/edit/texteng.cxx
>> @@ -1476,7 +1476,11 @@ void TextEngine::SeekCursor( sal_uLong nPara,
>> sal_uInt16 nPos, Font& rFont, Outp
>> if ( ( ( pAttrib->GetStart() < nPos ) && ( pAttrib->GetEnd() >= nPos ) )
>> || !pNode->GetText().Len() )
>> {
>> - if ( pAttrib->Which() == TEXTATTR_FONTCOLOR )
>> + if ( pAttrib->Which() != TEXTATTR_FONTCOLOR )
>> + {
>> + pAttrib->GetAttr().SetFont(rFont);
>> + }
>> + else
>> {
>> if ( pOutDev )
>> pOutDev->SetTextColor(
>> ((TextAttribFontColor&)pAttrib->GetAttr()).GetColor() );
>
> Please consider this patch for inclusion in libreoffice-3-5.
>
> Thomas, any idea why you thought the call to SetFont was useless? (Maybe
> you just didn't notice rFont was passed on by ref, to be modified within
> SetFont? Or was it something deeper?)
>
> Stephan
>


More information about the LibreOffice mailing list