diff options
author | Pranav Kant <pranavk@libreoffice.org> | 2015-12-09 21:45:21 +0530 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2015-12-09 16:36:22 +0000 |
commit | 7d7fad258dfde500c5ee99b5f1691172724383bd (patch) | |
tree | 2688915c6cf6534d80922f881a712c5a83881492 /libreofficekit/qa/gtktiledviewer | |
parent | dbc830aecc722d34971d773470da478ef4c38714 (diff) |
tdf#96317: Add API for copy/paste from/to the widget
Change-Id: Iac869ddb65cbdd2227f96d047d83159ca7819f11
Reviewed-on: https://gerrit.libreoffice.org/20534
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'libreofficekit/qa/gtktiledviewer')
-rw-r--r-- | libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx index 8d43737a4b7d..875fefc46400 100644 --- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx @@ -561,9 +561,8 @@ static void doCopy(GtkWidget* pButton, gpointer /*pItem*/) { TiledWindow& rWindow = lcl_getTiledWindow(pButton); LOKDocView* pLOKDocView = LOK_DOC_VIEW(rWindow.m_pDocView); - LibreOfficeKitDocument* pDocument = lok_doc_view_get_document(pLOKDocView); char* pUsedFormat = nullptr; - char* pSelection = pDocument->pClass->getTextSelection(pDocument, "text/html", &pUsedFormat); + char* pSelection = lok_doc_view_copy_selection(pLOKDocView, "text/html", &pUsedFormat); GtkClipboard* pClipboard = gtk_clipboard_get_for_display(gtk_widget_get_display(rWindow.m_pDocView), GDK_SELECTION_CLIPBOARD); std::string aUsedFormat(pUsedFormat); @@ -580,7 +579,6 @@ static void doPaste(GtkWidget* pButton, gpointer /*pItem*/) { TiledWindow& rWindow = lcl_getTiledWindow(pButton); LOKDocView* pLOKDocView = LOK_DOC_VIEW(rWindow.m_pDocView); - LibreOfficeKitDocument* pDocument = lok_doc_view_get_document(pLOKDocView); GtkClipboard* pClipboard = gtk_clipboard_get_for_display(gtk_widget_get_display(rWindow.m_pDocView), GDK_SELECTION_CLIPBOARD); @@ -604,7 +602,7 @@ static void doPaste(GtkWidget* pButton, gpointer /*pItem*/) GtkSelectionData* pSelectionData = gtk_clipboard_wait_for_contents(pClipboard, *oTarget); gint nLength; const guchar* pData = gtk_selection_data_get_data_with_length(pSelectionData, &nLength); - bool bSuccess = pDocument->pClass->paste(pDocument, "text/html", reinterpret_cast<const char*>(pData), nLength); + bool bSuccess = lok_doc_view_paste(pLOKDocView, "text/html", reinterpret_cast<const char*>(pData), nLength); gtk_selection_data_free(pSelectionData); if (bSuccess) return; @@ -612,7 +610,7 @@ static void doPaste(GtkWidget* pButton, gpointer /*pItem*/) gchar* pText = gtk_clipboard_wait_for_text(pClipboard); if (pText) - pDocument->pClass->paste(pDocument, "text/plain;charset=utf-8", pText, strlen(pText)); + lok_doc_view_paste(pLOKDocView, "text/plain;charset=utf-8", pText, strlen(pText)); } /// Click handler for the search next button. |