diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-12-20 21:22:03 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-12-20 21:25:06 +0100 |
commit | a2dd3acd205cb8df959ac03e99b1d1991cc562a8 (patch) | |
tree | d06eade8f1dba5634581bb28b0031fb9897fff3a /svx/source | |
parent | 11c4f731813843ca269369d262bb5e0f5c47829f (diff) |
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
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/dialog/fntctrl.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx index d520fff34bfd..d32ef0aa171d 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 ) |