[Libreoffice-commits] core.git: sd/qa
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jun 7 06:43:49 UTC 2021
sd/qa/unit/data/odp/search-all-notes.odp |binary
sd/qa/unit/uiimpress.cxx | 25 +++++++++++++++++++++++++
2 files changed, 25 insertions(+)
New commits:
commit 7f059ce157da0de40a98f63f61d923cc67d93884
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon Jun 7 10:01:55 2021 +0900
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Mon Jun 7 08:43:12 2021 +0200
tdf#142478 add test that triggers find all and crashes
String "Crash" in document and notes, then trigger "find all",
which produced a crash without the fix in-place.
Change-Id: I8e6e4a9da1afc85643648aee36a03c1fb39ca16d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116769
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/sd/qa/unit/data/odp/search-all-notes.odp b/sd/qa/unit/data/odp/search-all-notes.odp
new file mode 100644
index 000000000000..6c38ecabb0ea
Binary files /dev/null and b/sd/qa/unit/data/odp/search-all-notes.odp differ
diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index 7d0045646876..8fa1622d6197 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -25,6 +25,7 @@
#include <sfx2/request.hxx>
#include <sfx2/viewfrm.hxx>
#include <svl/intitem.hxx>
+#include <svl/srchitem.hxx>
#include <svx/svxids.hrc>
#include <svx/svdoashp.hxx>
#include <svx/svdotable.hxx>
@@ -692,6 +693,30 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf123841)
}
}
+CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testSearchAllInDocumentAndNotes)
+{
+ // tdf#142478
+ // "find all" produces a crash when the search string exists in notes
+ // and the document
+
+ mxComponent = loadFromDesktop(
+ m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/search-all-notes.odp"));
+
+ auto pXImpressDocument = dynamic_cast<SdXImpressDocument*>(mxComponent.get());
+ sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
+ CPPUNIT_ASSERT(pViewShell);
+
+ uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence({
+ { "SearchItem.SearchString", uno::makeAny(OUString("Crash")) },
+ { "SearchItem.Backward", uno::makeAny(false) },
+ { "SearchItem.Command", uno::makeAny(sal_uInt16(SvxSearchCmd::FIND_ALL)) },
+ }));
+
+ dispatchCommand(mxComponent, ".uno:ExecuteSearch", aPropertyValues);
+
+ Scheduler::ProcessEventsToIdle();
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list