summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-10-14 15:39:07 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-10-14 15:44:08 +0200
commit5f0d16b1dc8db77aaca3d13091d61ad862648f49 (patch)
tree8d57a6eaff06f799f222c7957eba33ddf9cce90f /sw
parent3eefa774e41d2f813044b67a363895e8328a76e5 (diff)
LOK: include part numbers in CALLBACK_SEARCH_RESULT_SELECTION payload
Without that, the result in Calc/Impress is ambiguous. Change-Id: I8dfd8dafc996102ed583688fddd721c7600dc48c (cherry picked from commit ad280b67f8fda8f832a6a83bc5665df448c6ad00)
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/tiledrendering/tiledrendering.cxx8
-rw-r--r--sw/source/uibase/uiview/viewsrch.cxx3
2 files changed, 9 insertions, 2 deletions
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index eb59b62b9208..523c9d2a1757 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -73,6 +73,7 @@ private:
OString m_aTextSelection;
bool m_bFound;
std::vector<OString> m_aSearchResultSelection;
+ std::vector<int> m_aSearchResultPart;
};
SwTiledRenderingTest::SwTiledRenderingTest()
@@ -139,7 +140,10 @@ void SwTiledRenderingTest::callbackImpl(int nType, const char* pPayload)
std::stringstream aStream(pPayload);
boost::property_tree::read_json(aStream, aTree);
for (boost::property_tree::ptree::value_type& rValue : aTree.get_child("searchResultSelection"))
- m_aSearchResultSelection.push_back(rValue.second.data().c_str());
+ {
+ m_aSearchResultSelection.push_back(rValue.second.get<std::string>("rectangles").c_str());
+ m_aSearchResultPart.push_back(std::atoi(rValue.second.get<std::string>("part").c_str()));
+ }
}
break;
}
@@ -478,6 +482,8 @@ void SwTiledRenderingTest::testSearchAll()
comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues);
// This was 0; should be 2 results in the body text.
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), m_aSearchResultSelection.size());
+ // Writer documents are always a single part.
+ CPPUNIT_ASSERT_EQUAL(0, m_aSearchResultPart[0]);
comphelper::LibreOfficeKit::setActive(false);
#endif
diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx
index c0a045868d11..30a2d0cf0a39 100644
--- a/sw/source/uibase/uiview/viewsrch.cxx
+++ b/sw/source/uibase/uiview/viewsrch.cxx
@@ -96,7 +96,8 @@ static void lcl_addContainerToJson(boost::property_tree::ptree& rTree, const OSt
for (const OString& rMatch : rMatches)
{
boost::property_tree::ptree aChild;
- aChild.put("", rMatch.getStr());
+ aChild.put("part", "0");
+ aChild.put("rectangles", rMatch.getStr());
aChildren.push_back(std::make_pair("", aChild));
}