summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-03-19 15:43:51 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-03-19 22:17:40 +0100
commitb1249cea2e99873605332de888d03f163cba0128 (patch)
treebdedca2e8d7d2f144b72ec9ebc77137375102c90 /vcl
parent531a331ed2d5d8aa75002b271e8c90d108e55388 (diff)
weld SwFieldVarPage
Change-Id: Ifd71cbb4c3ed3baa33136c5b86c042144faa5002 Reviewed-on: https://gerrit.libreoffice.org/69435 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/app/salvtables.cxx5
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx9
2 files changed, 14 insertions, 0 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 7173f8ad5b03..b645b0384ae5 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -2096,6 +2096,11 @@ public:
return rSelection.Len();
}
+ virtual void replace_selection(const OUString& rText) override
+ {
+ m_xEntry->ReplaceSelected(rText);
+ }
+
virtual void set_position(int nCursorPos) override
{
disable_notify_events();
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 2056ea4068e5..e0fda96cafac 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -5190,6 +5190,15 @@ public:
return gtk_editable_get_selection_bounds(GTK_EDITABLE(m_pEntry), &rStartPos, &rEndPos);
}
+ virtual void replace_selection(const OUString& rText) override
+ {
+ gtk_editable_delete_selection(GTK_EDITABLE(m_pEntry));
+ OString sText(OUStringToOString(rText, RTL_TEXTENCODING_UTF8));
+ gint position = gtk_editable_get_position(GTK_EDITABLE(m_pEntry));
+ gtk_editable_insert_text(GTK_EDITABLE(m_pEntry), sText.getStr(), sText.getLength(),
+ &position);
+ }
+
virtual void set_position(int nCursorPos) override
{
disable_notify_events();