summaryrefslogtreecommitdiff
path: root/sw/source/core/text/inftxt.cxx
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-11-19 09:18:11 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-12-06 18:34:57 +0100
commit506d8f1792cd004d97c6d3e84c21da10e68adf08 (patch)
treea650a70d7a95cf931fba01db1b360272c7c6cc3f /sw/source/core/text/inftxt.cxx
parentfd0bb8b743f7b74cb223f41814741cd775a2b4fb (diff)
tdf#128191 Show infobar when hyphenation info for text language is missing
During doc loading it's too early to add infobars, thus add a mechanism to display infobars once view is ready Change-Id: Ie963a304d2101a5bbdd59130c354d581ff7d2e9b Reviewed-on: https://gerrit.libreoffice.org/83161 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sw/source/core/text/inftxt.cxx')
-rw-r--r--sw/source/core/text/inftxt.cxx15
1 files changed, 12 insertions, 3 deletions
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index f0933284feaa..9fc9116fe1e4 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -23,6 +23,7 @@
#include <unotools/lingucfg.hxx>
#include <hintids.hxx>
#include <svl/ctloptions.hxx>
+#include <sfx2/infobar.hxx>
#include <sfx2/printer.hxx>
#include <sal/log.hxx>
#include <editeng/hyphenzoneitem.hxx>
@@ -61,6 +62,8 @@
#include <pam.hxx>
#include <numrule.hxx>
#include <EnhancedPDFExportHelper.hxx>
+#include <docsh.hxx>
+#include <strings.hrc>
using namespace ::com::sun::star;
using namespace ::com::sun::star::linguistic2;
@@ -1450,9 +1453,15 @@ bool SwTextFormatInfo::IsHyphenate() const
if (!xHyph->hasLocale(g_pBreakIt->GetLocale(eTmp)))
{
- // TODO: Add an infobar for this case, tdf#128191
- SAL_WARN("sw", "missing hyphenation package for locale: "
- << g_pBreakIt->GetLocale(eTmp).Language);
+ SfxObjectShell* pShell = m_pFrame->GetDoc().GetDocShell();
+ if (pShell)
+ {
+ pShell->AppendInfoBarWhenReady(
+ "hyphenationmissing", SwResId(STR_HYPH_MISSING),
+ SwResId(STR_HYPH_MISSING_DETAIL)
+ .replaceFirst("%1", g_pBreakIt->GetLocale(eTmp).Language),
+ InfobarType::WARNING);
+ }
}
return xHyph->hasLocale( g_pBreakIt->GetLocale(eTmp) );