[Libreoffice-commits] core.git: vcl/inc vcl/unx
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jun 24 07:41:16 UTC 2021
vcl/inc/unx/gtk/gtkinst.hxx | 13 +++++++++++++
vcl/unx/gtk3/gtkinst.cxx | 20 ++++----------------
2 files changed, 17 insertions(+), 16 deletions(-)
New commits:
commit 29c429e636a94cd07117bffd40c25b114d2e620f
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Jun 22 16:24:24 2021 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Jun 24 09:40:19 2021 +0200
rename read_paste_result to read_transfer_result
we'll reuse what worked for clipboard for dnd
Change-Id: If8accc2d236253a734f48929e231bcecbb00741f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117744
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx
index 3aaa03d1ddb6..e13524d8c54e 100644
--- a/vcl/inc/unx/gtk/gtkinst.hxx
+++ b/vcl/inc/unx/gtk/gtkinst.hxx
@@ -55,6 +55,19 @@ class GtkSalFrame;
#if GTK_CHECK_VERSION(4, 0, 0)
gint gtk_dialog_run(GtkDialog *dialog);
+
+struct text_transfer_result
+{
+ OUString sText;
+ bool bDone = false;
+};
+
+struct read_transfer_result
+{
+ css::uno::Sequence<sal_Int8> aSeq;
+ bool bDone = false;
+};
+
#endif
struct VclToGtkHelper
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 40e23ae7d7ac..4d02d6da480e 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -680,22 +680,10 @@ GdkClipboard* clipboard_get(SelectionType eSelection)
#if GTK_CHECK_VERSION(4, 0, 0)
-struct text_paste_result
-{
- OUString sText;
- bool bDone = false;
-};
-
-struct read_paste_result
-{
- Sequence<sal_Int8> aSeq;
- bool bDone = false;
-};
-
void text_async_completed(GObject* source, GAsyncResult* res, gpointer data)
{
GdkClipboard* clipboard = GDK_CLIPBOARD(source);
- text_paste_result* pRes = static_cast<text_paste_result*>(data);
+ text_transfer_result* pRes = static_cast<text_transfer_result*>(data);
gchar* pText = gdk_clipboard_read_text_finish(clipboard, res, nullptr);
pRes->sText = OUString(pText, pText ? strlen(pText) : 0, RTL_TEXTENCODING_UTF8);
@@ -709,7 +697,7 @@ void text_async_completed(GObject* source, GAsyncResult* res, gpointer data)
void read_async_completed(GObject* source, GAsyncResult* res, gpointer data)
{
GdkClipboard* clipboard = GDK_CLIPBOARD(source);
- read_paste_result* pRes = static_cast<read_paste_result*>(data);
+ read_transfer_result* pRes = static_cast<read_transfer_result*>(data);
if (GInputStream* pResult = gdk_clipboard_read_finish(clipboard, res, nullptr, nullptr))
{
@@ -768,7 +756,7 @@ public:
aRet <<= aStr.replaceAll("\r\n", "\n");
#else
SalInstance* pInstance = GetSalData()->m_pInstance;
- text_paste_result aRes;
+ text_transfer_result aRes;
gdk_clipboard_read_text_async(clipboard, nullptr, text_async_completed, &aRes);
while (!aRes.bDone)
pInstance->DoYield(true, false);
@@ -783,7 +771,7 @@ public:
#if GTK_CHECK_VERSION(4, 0, 0)
SalInstance* pInstance = GetSalData()->m_pInstance;
- read_paste_result aRes;
+ read_transfer_result aRes;
const char *mime_types[] = { it->second.getStr(), nullptr };
gdk_clipboard_read_async(clipboard,
mime_types,
More information about the Libreoffice-commits
mailing list