diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-05-28 17:21:50 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-05-28 17:37:18 +0200 |
commit | 3c9fb5898159fbda9d5b23f3f518044a5df03f72 (patch) | |
tree | 8a9473d7fb968eb27c567a1a7ec66e6206be455e /libreofficekit | |
parent | 1dc60bc9e99304c58007bfd5a964ff3f78480106 (diff) |
gtktiledviewer: use SearchItem.SearchStartPoint*
Change-Id: If0219eda3a2ca3b97c37bea70e35d47e49d38e02
Diffstat (limited to 'libreofficekit')
-rw-r--r-- | libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx | 10 | ||||
-rw-r--r-- | libreofficekit/source/gtk/lokdocview.cxx | 8 |
2 files changed, 17 insertions, 1 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx index 5fbd3374a843..d20f43d90627 100644 --- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx @@ -158,10 +158,18 @@ static void doSearch(bool bBackwards) aTree.put(boost::property_tree::ptree::path_type("SearchItem.SearchString/value", '/'), pText); aTree.put(boost::property_tree::ptree::path_type("SearchItem.Backward/type", '/'), "boolean"); aTree.put(boost::property_tree::ptree::path_type("SearchItem.Backward/value", '/'), bBackwards); + + LOKDocView* pLOKDocView = LOK_DOCVIEW(pDocView); + GdkRectangle aArea; + lok_docview_get_visarea(pLOKDocView, &aArea); + aTree.put(boost::property_tree::ptree::path_type("SearchItem.SearchStartPointX/type", '/'), "long"); + aTree.put(boost::property_tree::ptree::path_type("SearchItem.SearchStartPointX/value", '/'), aArea.x); + aTree.put(boost::property_tree::ptree::path_type("SearchItem.SearchStartPointY/type", '/'), "long"); + aTree.put(boost::property_tree::ptree::path_type("SearchItem.SearchStartPointY/value", '/'), aArea.y); + std::stringstream aStream; boost::property_tree::write_json(aStream, aTree); - LOKDocView* pLOKDocView = LOK_DOCVIEW(pDocView); lok_docview_post_command(pLOKDocView, ".uno:ExecuteSearch", aStream.str().c_str()); } diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx index e3c03db14bf3..064e53461256 100644 --- a/libreofficekit/source/gtk/lokdocview.cxx +++ b/libreofficekit/source/gtk/lokdocview.cxx @@ -1319,4 +1319,12 @@ SAL_DLLPUBLIC_EXPORT void lok_docview_post_key(GtkWidget* /*pWidget*/, GdkEventK pDocView->m_pImpl->signalKey(pEvent); } +SAL_DLLPUBLIC_EXPORT void lok_docview_get_visarea(LOKDocView* pThis, GdkRectangle* pArea) +{ + GtkAdjustment* pHAdjustment = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(pThis)); + pArea->x = pThis->m_pImpl->pixelToTwip(gtk_adjustment_get_value(pHAdjustment)); + GtkAdjustment* pVAdjustment = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(pThis)); + pArea->y = pThis->m_pImpl->pixelToTwip(gtk_adjustment_get_value(pVAdjustment)); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |