[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jul 22 08:45:38 UTC 2020
include/vcl/weld.hxx | 3 +++
vcl/inc/salvtables.hxx | 4 ++++
vcl/source/app/salvtables.cxx | 10 ++++++++++
vcl/unx/gtk3/gtk3gtkinst.cxx | 10 ++++++++++
4 files changed, 27 insertions(+)
New commits:
commit b132a2868a248177de63142c6d09b0e68169c237
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Jul 21 20:01:26 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Jul 22 10:45:02 2020 +0200
add get/set overwrite mode
Change-Id: I9fa9030665702f517fa5fcb22f29e52d0eda8ff5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99173
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 1c40aea114c6..802e1ae7f138 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -1489,6 +1489,9 @@ public:
virtual void set_message_type(EntryMessageType eType) = 0;
virtual void set_placeholder_text(const OUString& rText) = 0;
+ virtual void set_overwrite_mode(bool bOn) = 0;
+ virtual bool get_overwrite_mode() const = 0;
+
// font size is in points, not pixels, e.g. see Window::[G]etPointFont
virtual void set_font(const vcl::Font& rFont) = 0;
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index cd82c840694f..80c8640f77e3 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -585,6 +585,10 @@ public:
virtual bool get_editable() const override;
+ virtual void set_overwrite_mode(bool bOn) override;
+
+ virtual bool get_overwrite_mode() const override;
+
virtual void set_message_type(weld::EntryMessageType eType) override;
virtual void set_font(const vcl::Font& rFont) override;
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 3581b14a8afb..9765711e3869 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -3097,6 +3097,16 @@ bool SalInstanceEntry::get_editable() const
return !m_xEntry->IsReadOnly();
}
+void SalInstanceEntry::set_overwrite_mode(bool bOn)
+{
+ m_xEntry->SetInsertMode(!bOn);
+}
+
+bool SalInstanceEntry::get_overwrite_mode() const
+{
+ return !m_xEntry->IsInsertMode();
+}
+
void SalInstanceEntry::set_message_type(weld::EntryMessageType eType)
{
if (eType == weld::EntryMessageType::Error)
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index f8fbcb1a9fee..faa07934e57e 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -8827,6 +8827,16 @@ public:
return gtk_editable_get_editable(GTK_EDITABLE(m_pEntry));
}
+ virtual void set_overwrite_mode(bool bOn) override
+ {
+ gtk_entry_set_overwrite_mode(m_pEntry, bOn);
+ }
+
+ virtual bool get_overwrite_mode() const override
+ {
+ return gtk_entry_get_overwrite_mode(m_pEntry);
+ }
+
virtual void set_message_type(weld::EntryMessageType eType) override
{
::set_entry_message_type(m_pEntry, eType);
More information about the Libreoffice-commits
mailing list