summaryrefslogtreecommitdiff
path: root/sw/source/uibase/uno/unotxdoc.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/uibase/uno/unotxdoc.cxx')
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index b8f81db2f58b..8ea3697192b4 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -163,6 +163,8 @@
#include <svx/svdpage.hxx>
#include <IDocumentOutlineNodes.hxx>
+#include <SearchResultLocator.hxx>
+#include <boost/property_tree/json_parser.hpp>
#define TWIPS_PER_PIXEL 15
@@ -3390,6 +3392,29 @@ void SwXTextDocument::executeFromFieldEvent(const StringMap& aArguments)
}
}
+std::vector<basegfx::B2DRange>
+SwXTextDocument::getSearchResultRectangles(const char* pPayload)
+{
+ std::vector<basegfx::B2DRange> aRectangles;
+
+ boost::property_tree::ptree aTree;
+ std::stringstream aStream(pPayload);
+ boost::property_tree::read_json(aStream, aTree);
+
+ sw::SearchIndexData aData;
+
+ aData.nNodeIndex = sal_uInt32(aTree.get<int>("node_index"));
+
+ SwDoc* pDoc = m_pDocShell->GetDoc();
+
+ sw::SearchResultLocator aLocator(pDoc);
+ sw::LocationResult aResult = aLocator.find(aData);
+ if (aResult.mbFound)
+ aRectangles = aResult.maRectangles;
+
+ return aRectangles;
+}
+
int SwXTextDocument::getPart()
{
SolarMutexGuard aGuard;