Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


commit 40c0ff75d2a0f987454b068a663908e6d9b87b9b
Author: Stephan Bergmann <sbergman@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

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.