summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cui/source/dialogs/SpellDialog.cxx18
-rw-r--r--cui/source/inc/SpellDialog.hxx5
-rw-r--r--cui/uiconfig/ui/spellingdialog.ui11
-rw-r--r--solenv/sanitizers/ui/cui.suppr1
-rw-r--r--vcl/source/window/builder.cxx1
5 files changed, 36 insertions, 0 deletions
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index 68ef370f65e7..0c1ee881a4e8 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -60,6 +60,8 @@
#include <svtools/langtab.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <sal/log.hxx>
+#include <comphelper/lok.hxx>
+#include <sfx2/lokhelper.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -192,9 +194,23 @@ SpellDialog::SpellDialog(SpellDialogChildWindow* pChildWindow,
, m_xOptionsPB(m_xBuilder->weld_button("options"))
, m_xUndoPB(m_xBuilder->weld_button("undo"))
, m_xClosePB(m_xBuilder->weld_button("close"))
+ , m_xHelpPB(m_xBuilder->weld_button("help"))
, m_xToolbar(m_xBuilder->weld_toolbar("toolbar"))
, m_xSentenceEDWeld(new weld::CustomWeld(*m_xBuilder, "sentence", *m_xSentenceED))
+ , m_xMobileError(m_xBuilder->weld_label("mobile-spell-error"))
{
+ m_xSentenceED->SetMobileErrorLabel(m_xMobileError);
+
+ if (comphelper::LibreOfficeKit::isActive()
+ && SfxViewShell::Current() && SfxViewShell::Current()->isLOKMobilePhone())
+ {
+ m_xClosePB->hide();
+ m_xHelpPB->hide();
+ m_xOptionsPB->hide();
+ m_xSentenceEDWeld->hide();
+ m_xMobileError->set_visible(true);
+ }
+
m_xSentenceED->SetSpellDialog(this);
m_xSentenceED->Init(m_xToolbar.get());
@@ -1667,6 +1683,8 @@ bool SentenceEditWindow_Impl::MarkNextError( bool bIgnoreCurrentError, const css
if (pEECharAttrib)
{
ExtractErrorDescription(*pEECharAttrib, aSpellErrorDescription);
+ if (m_xMobileError)
+ m_xMobileError->set_label(aSpellErrorDescription.sErrorText);
bGrammarError = aSpellErrorDescription.bIsGrammarError;
m_nErrorStart = pEECharAttrib->nStart;
diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx
index 30d8627084cb..92d4a9ed6391 100644
--- a/cui/source/inc/SpellDialog.hxx
+++ b/cui/source/inc/SpellDialog.hxx
@@ -65,6 +65,7 @@ class SentenceEditWindow_Impl : public weld::CustomWidgetController
private:
std::unique_ptr<EditEngine> m_xEditEngine;
std::unique_ptr<EditView> m_xEdView;
+ std::shared_ptr<weld::Label> m_xMobileError;
std::set<sal_Int32> m_aIgnoreErrorsAt;
SpellDialog* m_pSpellDialog;
@@ -155,6 +156,8 @@ public:
void MoveErrorEnd(long nOffset);
void ResetIgnoreErrorsAt() { m_aIgnoreErrorsAt.clear(); }
+
+ void SetMobileErrorLabel(std::shared_ptr<weld::Label> xMobileError) { m_xMobileError = xMobileError; }
};
// class SvxSpellDialog ---------------------------------------------
@@ -206,8 +209,10 @@ private:
std::unique_ptr<weld::Button> m_xOptionsPB;
std::unique_ptr<weld::Button> m_xUndoPB;
std::unique_ptr<weld::Button> m_xClosePB;
+ std::unique_ptr<weld::Button> m_xHelpPB;
std::unique_ptr<weld::Toolbar> m_xToolbar;
std::unique_ptr<weld::CustomWeld> m_xSentenceEDWeld;
+ std::shared_ptr<weld::Label> m_xMobileError;
DECL_LINK(ChangeHdl, weld::Button&, void);
DECL_LINK(DoubleClickChangeHdl, weld::TreeView&, void);
diff --git a/cui/uiconfig/ui/spellingdialog.ui b/cui/uiconfig/ui/spellingdialog.ui
index ccc6a30e7a46..f80e6ec80d82 100644
--- a/cui/uiconfig/ui/spellingdialog.ui
+++ b/cui/uiconfig/ui/spellingdialog.ui
@@ -81,6 +81,7 @@
<property name="receives_default">True</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
+ <property name="sensitive">False</property>
</object>
<packing>
<property name="expand">False</property>
@@ -426,6 +427,16 @@
</packing>
</child>
<child>
+ <object class="GtkLabel" id="mobile-spell-error">
+ <property name="visible">False</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
diff --git a/solenv/sanitizers/ui/cui.suppr b/solenv/sanitizers/ui/cui.suppr
index 59f22233ff39..549954c47a90 100644
--- a/solenv/sanitizers/ui/cui.suppr
+++ b/solenv/sanitizers/ui/cui.suppr
@@ -460,6 +460,7 @@ cui/uiconfig/ui/spellingdialog.ui://GtkLabel[@id='explain'] orphan-label
cui/uiconfig/ui/spellingdialog.ui://GtkLabel[@id='resumeft'] orphan-label
cui/uiconfig/ui/spellingdialog.ui://GtkLabel[@id='nosuggestionsft'] orphan-label
cui/uiconfig/ui/spellingdialog.ui://GtkLabel[@id='alttitleft'] orphan-label
+cui/uiconfig/ui/spellingdialog.ui://GtkLabel[@id='mobile-spell-error'] orphan-label
cui/uiconfig/ui/storedwebconnectiondialog.ui://GtkLabel[@id='label1'] orphan-label
cui/uiconfig/ui/storedwebconnectiondialog.ui://GtkLabel[@id='website'] orphan-label
cui/uiconfig/ui/storedwebconnectiondialog.ui://GtkLabel[@id='username'] orphan-label
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index efd46f9adec0..d9786bc4d70b 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -154,6 +154,7 @@ weld::Builder* Application::CreateBuilder(weld::Widget* pParent, const OUString
rUIFile == "modules/scalc/ui/validationcriteriapage.ui" ||
rUIFile == "modules/scalc/ui/validationhelptabpage-mobile.ui" ||
rUIFile == "modules/scalc/ui/erroralerttabpage-mobile.ui" ||
+ rUIFile == "cui/ui/spellingdialog.ui" ||
rUIFile == "modules/swriter/ui/watermarkdialog.ui")
bUseJSBuilder = true;
}