vcl/unx/gtk3/app/gtk3gtkinst.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit e728c26e7449b9a672ff0efa8098e4eda3d1ffc0
Author: Eike Rathke <er...@redhat.com>
Date:   Fri Jul 10 22:04:04 2015 +0200

    fix assert when pasting nil clipboard content
    
    This happened when one of our modules had clipboard content and was
    closed, which currently clears the clipboard, and then reopened and
    attempting to paste the content. Apparently the utf-16 mime-type is
    still alive but the content isn't, on which rtl_str_getLength(pText)
    asserts.
    
    Change-Id: I5cc7c20ac1f1a8551a10b033e1f37bf83c5cc202
    (cherry picked from commit 6a6b91da20e936abcc9f527f69aff48d2c23a94e)
    Reviewed-on: https://gerrit.libreoffice.org/16937
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/unx/gtk3/app/gtk3gtkinst.cxx b/vcl/unx/gtk3/app/gtk3gtkinst.cxx
index 2dedd2d..41708923c 100644
--- a/vcl/unx/gtk3/app/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/app/gtk3gtkinst.cxx
@@ -112,9 +112,10 @@ public:
         GtkClipboard* clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
         if (rFlavor.MimeType == "text/plain;charset=utf-16")
         {
+            OUString aStr;
             gchar *pText = gtk_clipboard_wait_for_text(clipboard);
-            OUString aStr(pText, rtl_str_getLength(pText),
-                RTL_TEXTENCODING_UTF8);
+            if (pText)
+                aStr = OUString(pText, rtl_str_getLength(pText), 
RTL_TEXTENCODING_UTF8);
             g_free(pText);
             css::uno::Any aRet;
             aRet <<= aStr.replaceAll("\r\n", "\n");
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to