diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2020-08-22 21:45:44 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-08-29 13:14:04 +0200 |
commit | 2ebc26aeefefe33ee6180862509e4971ff2dfc6f (patch) | |
tree | 9540fbb5cf497e907b738c59a83a338ce643e975 /sd/source/ui/view/Outliner.cxx | |
parent | 88e52e539eaf7981441ec3e042f321c2615919ca (diff) |
sd: Make search bound to a view - to allow independent searching
Before if two windows are open, the search is not independent
because Outline class is not independent for a view (because of
FuSearch which remembers the view from when the it was created
and then an instance is stored in the DocShell).
This creates a SearchContext class stored on a View, which stores
the actual View bound FuSearch instance, fix us the calls.
Also move the VectorGraphicSearchContext back into Outline::Impl,
because it doesn't need to be bound to the view anymore.
Change-Id: I6a5ce71efafa378845eee4ac9574e2e4301138d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101224
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sd/source/ui/view/Outliner.cxx')
-rw-r--r-- | sd/source/ui/view/Outliner.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index 98fd0bdc87b2..b1e44ca3630b 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -99,6 +99,8 @@ public: */ void ReleaseOutlinerView(); + sd::VectorGraphicSearchContext& getVectorGraphicSearchContext() { return maVectorGraphicSearchContext; } + private: /** Flag that specifies whether we own the outline view pointed to by <member>mpOutlineView</member> and thus have to @@ -112,6 +114,8 @@ private: <member>mbOwnOutlineView</member> distinguishes between both cases. */ OutlinerView* mpOutlineView; + + sd::VectorGraphicSearchContext maVectorGraphicSearchContext; }; namespace @@ -607,6 +611,8 @@ bool SdOutliner::SearchAndReplaceAll() mnStartPageIndex = sal_uInt16(-1); return true; } + // Reset the iterator back to the beginning + maObjectIterator = sd::outliner::OutlinerContainer(this).begin(); // Search/replace until the end of the document is reached. bool bFoundMatch; @@ -724,7 +730,7 @@ void SdOutliner::sendLOKSearchResultCallback(std::shared_ptr<sd::ViewShell> & pV std::vector<sd::SearchSelection>* pSelections) { std::vector<::tools::Rectangle> aLogicRects; - auto& rVectorGraphicSearchContext = pViewShell->GetView()->getVectorGraphicSearchContext(); + auto& rVectorGraphicSearchContext = mpImpl->getVectorGraphicSearchContext(); if (rVectorGraphicSearchContext.mbCurrentIsVectorGraphic) { basegfx::B2DRectangle aSelectionHMM = getPDFSelection(rVectorGraphicSearchContext.mpVectorGraphicSearch, mpObj); @@ -815,7 +821,7 @@ bool SdOutliner::SearchAndReplaceOnce(std::vector<sd::SearchSelection>* pSelecti mpView = pViewShell->GetView(); mpWindow = pViewShell->GetActiveWindow(); pOutlinerView->SetWindow(mpWindow); - auto& rVectorGraphicSearchContext = mpView->getVectorGraphicSearchContext(); + auto& rVectorGraphicSearchContext = mpImpl->getVectorGraphicSearchContext(); if (nullptr != dynamic_cast<const sd::DrawViewShell*>(pViewShell.get())) { sal_uLong nMatchCount = 0; @@ -1172,7 +1178,7 @@ void SdOutliner::ProvideNextTextObject() mbFoundObject = false; // reset the vector search - auto& rVectorGraphicSearchContext = mpView->getVectorGraphicSearchContext(); + auto& rVectorGraphicSearchContext = mpImpl->getVectorGraphicSearchContext(); rVectorGraphicSearchContext.reset(); mpView->UnmarkAllObj (mpView->GetSdrPageView()); |