[Libreoffice-commits] core.git: sw/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Wed Apr 15 09:27:47 UTC 2020
sw/source/uibase/dialog/watermarkdialog.cxx | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
New commits:
commit 903070a573b87714458c3cb3d18635f5eda6aa15
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Apr 14 15:51:07 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Apr 15 11:27:10 2020 +0200
explicitly set the correct index if the font is in the list
Change-Id: I212a97007b5e69e6a2a6e10c76afe50c45ec283e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92229
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/source/uibase/dialog/watermarkdialog.cxx b/sw/source/uibase/dialog/watermarkdialog.cxx
index 26589813ec18..d558d0c6de8f 100644
--- a/sw/source/uibase/dialog/watermarkdialog.cxx
+++ b/sw/source/uibase/dialog/watermarkdialog.cxx
@@ -74,7 +74,12 @@ void SwWatermarkDialog::InitFields()
const SfxWatermarkItem* pWatermark = static_cast<const SfxWatermarkItem*>( pItem );
const OUString& sText = pWatermark->GetText();
m_xTextInput->set_text(sText);
- m_xFont->set_entry_text(pWatermark->GetFont());
+ OUString sFontName = pWatermark->GetFont();
+ int nFontIndex = m_xFont->find_text(sFontName);
+ if (nFontIndex != -1)
+ m_xFont->set_active(nFontIndex);
+ else
+ m_xFont->set_entry_text(sFontName);
m_xAngle->set_value(pWatermark->GetAngle(), FieldUnit::DEGREE);
m_xColor->SelectEntry( pWatermark->GetColor() );
m_xTransparency->set_value(pWatermark->GetTransparency(), FieldUnit::PERCENT);
More information about the Libreoffice-commits
mailing list