[Libreoffice-commits] .: Branch 'libreoffice-4-0' - svx/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Dec 20 12:31:08 PST 2012


 svx/source/dialog/fntctrl.cxx |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 1cf4f78955d3a3cd33ff6997d4bd741d0531cf88
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Dec 20 21:22:03 2012 +0100

    fdo#58427: fix another crash in SvxFontPrevWindow::Paint
    
    In Writer, Search&replace -> More options -> Formats  used to have a
    window title of "Example" but not any more;  let's add another fallback
    for the example text to makeRepresentativeTextForFont, which seems to
    give "Lorem ipsum" here.
    
    (regression from widget layout)
    
    Change-Id: I8dd9c099be31ed4390b04e8069a74960b58c6084
    (cherry picked from commit a2dd3acd205cb8df959ac03e99b1d1991cc562a8)

diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index d520fff..d32ef0a 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -656,6 +656,8 @@ void SvxFontPrevWindow::Paint( const Rectangle& )
             pImpl->aText = GetText();
         else if ( !pImpl->bSelection && !pImpl->bTextInited )
         {
+            using namespace com::sun::star::i18n::ScriptType;
+
             SfxViewShell* pSh = SfxViewShell::Current();
 
             if ( pSh && !pImpl->bGetSelection && !pImpl->bUseFontNameAsText )
@@ -668,8 +670,6 @@ void SvxFontPrevWindow::Paint( const Rectangle& )
 
             if ( !pImpl->bSelection || pImpl->bUseFontNameAsText )
             {
-                using namespace com::sun::star::i18n::ScriptType;
-
                 //If we're showing multiple sample texts, then they're all
                 //sample texts. If only showing Latin, continue to use
                 //the fontname as the preview
@@ -696,6 +696,11 @@ void SvxFontPrevWindow::Paint( const Rectangle& )
             if ( !pImpl->aText.Len() )
                 pImpl->aText = GetText();
 
+            if (!pImpl->aText.Len())
+            {   // fdo#58427: still no text? let's try that one...
+                pImpl->aText = makeRepresentativeTextForFont(LATIN, rFont);
+            }
+
             // remove line feeds and carriage returns from string
             bool bNotEmpty = false;
             for ( xub_StrLen i = 0; i < pImpl->aText.Len(); ++i )


More information about the Libreoffice-commits mailing list