summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-12-20 21:22:03 +0100
committerMichael Stahl <mstahl@redhat.com>2012-12-20 21:28:48 +0100
commit1cf4f78955d3a3cd33ff6997d4bd741d0531cf88 (patch)
tree87483070dc69bf2b615ceb74e32ef10a9d95c8e8 /svx/source
parent0bbbdaf1999dd1279b39bceb43ed0a9e2450925f (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 (cherry picked from commit a2dd3acd205cb8df959ac03e99b1d1991cc562a8)
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/dialog/fntctrl.cxx9
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 )