summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-05-31 09:58:26 +0200
committerTomaž Vajngerl <quikee@gmail.com>2020-07-30 22:36:19 +0200
commitdead431f4197a278a16782762371a617c5c468f8 (patch)
tree8b1f2905959ebc51dfbbd359069a2b060e5a7e8c
parentsd: Add another test of searching with mixed objects (diff)
downloadcore-dead431f4197a278a16782762371a617c5c468f8.tar.gz
core-dead431f4197a278a16782762371a617c5c468f8.zip
sd: PDF search - reset mpVectorGraphicSearch at more places
and simplify the case when the search doesn't find a match in the vector graphic. Change-Id: I3e086e8e36f8a578711eed6d4dcca65c0c4c6268 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95456 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit f60caab2c867a578b6e6b963ebd5a72b5a12463e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95942 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> (cherry picked from commit f0ef50cbfe6039dc9dd00f89af8596f309223cb7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99811
-rw-r--r--sd/source/ui/view/Outliner.cxx45
1 files changed, 23 insertions, 22 deletions
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 801acc7c6859..441a0d3ac242 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -1187,6 +1187,7 @@ void SdOutliner::ProvideNextTextObject()
mbFoundObject = false;
// reset the vector search
+ mpImpl->mbCurrentIsVectorGraphic = false;
mpImpl->mpVectorGraphicSearch.reset();
mpView->UnmarkAllObj (mpView->GetSdrPageView());
@@ -1222,6 +1223,7 @@ void SdOutliner::ProvideNextTextObject()
bool bForbiddenPage = comphelper::LibreOfficeKit::isActive() && (maCurrentPosition.mePageKind != PageKind::Standard || maCurrentPosition.meEditMode != EditMode::Page);
mpImpl->mbCurrentIsVectorGraphic = false;
+ mpImpl->mpVectorGraphicSearch.reset();
if (!bForbiddenPage)
{
@@ -1255,34 +1257,30 @@ void SdOutliner::ProvideNextTextObject()
OUString const & rString = mpSearchItem->GetSearchString();
mpImpl->mpVectorGraphicSearch = std::make_unique<VectorGraphicSearch>(pGraphicObject->GetGraphic());
- if (mpImpl->mpVectorGraphicSearch->search(rString))
+
+ bool bResult = mpImpl->mpVectorGraphicSearch->search(rString);
+ if (bResult)
+ bResult = mpImpl->mpVectorGraphicSearch->next();
+
+ if (bResult)
{
- bool bResult = mpImpl->mpVectorGraphicSearch->next();
- if (bResult)
- {
- mpObj = SetObject(maCurrentPosition);
+ mpObj = SetObject(maCurrentPosition);
- mbStringFound = true;
- mbMatchMayExist = true;
- mbFoundObject = true;
+ mbStringFound = true;
+ mbMatchMayExist = true;
+ mbFoundObject = true;
- SdrPageView* pPageView = mpView->GetSdrPageView();
- mpView->UnmarkAllObj(pPageView);
+ SdrPageView* pPageView = mpView->GetSdrPageView();
+ mpView->UnmarkAllObj(pPageView);
- std::vector<basegfx::B2DRectangle> aSubSelections;
- basegfx::B2DRectangle aSubSelection = getPDFSelection(mpImpl->mpVectorGraphicSearch, mpObj);
- if (!aSubSelection.isEmpty())
- aSubSelections.push_back(aSubSelection);
+ std::vector<basegfx::B2DRectangle> aSubSelections;
+ basegfx::B2DRectangle aSubSelection = getPDFSelection(mpImpl->mpVectorGraphicSearch, mpObj);
+ if (!aSubSelection.isEmpty())
+ aSubSelections.push_back(aSubSelection);
- mpView->MarkObj(mpObj, pPageView, false, false, aSubSelections);
+ mpView->MarkObj(mpObj, pPageView, false, false, aSubSelections);
- mpDrawDocument->GetDocSh()->SetWaitCursor( false );
- }
- else
- {
- mpImpl->mbCurrentIsVectorGraphic = false;
- mpImpl->mpVectorGraphicSearch.reset();
- }
+ mpDrawDocument->GetDocSh()->SetWaitCursor( false );
}
else
{
@@ -1315,6 +1313,9 @@ void SdOutliner::ProvideNextTextObject()
}
else
{
+ mpImpl->mbCurrentIsVectorGraphic = false;
+ mpImpl->mpVectorGraphicSearch.reset();
+
if (meMode == SEARCH)
// Instead of doing a full-blown SetObject(), which would do the same -- but would also possibly switch pages.
mbStringFound = false;