diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2020-05-27 14:27:30 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2020-07-30 13:36:39 +0200 |
commit | 5a677ca3715b7e1da3f3a2a79083f06958d97aaa (patch) | |
tree | 1d363450c352f56754ebf19cdfd905f97d297955 /sd | |
parent | 81d9bdd146c2e9c5e522c8f5e5cafc2b2ad42721 (diff) |
sd: some style fixes in Outliner.cxx
Also no need to reset the mpImpl in destructor when it will be
reset and destroyed in the next step anyway.
Change-Id: I5027f962efc4159e61aa7eda26619db2e3b9434c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95309
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit 43a6def48f425361d79dff46dca41685d5ee03fa)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95920
(cherry picked from commit 76ba829bf18123daf552afe253a8304a982ceb8d)
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/view/Outliner.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index 42267b3f50e3..ef8204ad5b80 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -228,7 +228,6 @@ SdOutliner::SdOutliner( SdDrawDocument* pDoc, OutlinerMode nMode ) /// Nothing spectacular in the destructor. SdOutliner::~SdOutliner() { - mpImpl.reset(); } /** Prepare find&replace or spellchecking. This distinguishes between three @@ -484,7 +483,9 @@ bool SdOutliner::StartSearchAndReplace (const SvxSearchItem* pSearchItem) const SvxSearchCmd nCommand (mpSearchItem->GetCommand()); if (nCommand == SvxSearchCmd::FIND_ALL || nCommand == SvxSearchCmd::REPLACE_ALL) + { bEndOfSearch = SearchAndReplaceAll (); + } else { RememberStartPosition (); @@ -590,6 +591,7 @@ void SdOutliner::Initialize (bool bDirectionIsForward) bool SdOutliner::SearchAndReplaceAll() { bool bRet = true; + // Save the current position to be restored after having replaced all // matches. RememberStartPosition (); @@ -773,13 +775,13 @@ bool SdOutliner::SearchAndReplaceOnce(std::vector<sd::SearchSelection>* pSelecti pOutlinerView = mpImpl->GetOutlinerView(); } - if (pViewShell != nullptr) + if (pViewShell) { mpView = pViewShell->GetView(); mpWindow = pViewShell->GetActiveWindow(); pOutlinerView->SetWindow(mpWindow); - if( nullptr != dynamic_cast< const sd::DrawViewShell *>( pViewShell.get() )) + if (nullptr != dynamic_cast<const sd::DrawViewShell*>(pViewShell.get())) { // When replacing we first check if there is a selection // indicating a match. If there is then replace it. The @@ -802,7 +804,7 @@ bool SdOutliner::SearchAndReplaceOnce(std::vector<sd::SearchSelection>* pSelecti { ProvideNextTextObject (); - if ( ! mbEndOfSearch) + if (!mbEndOfSearch) { // Remember the current position as the last one with a // text object. @@ -824,7 +826,7 @@ bool SdOutliner::SearchAndReplaceOnce(std::vector<sd::SearchSelection>* pSelecti } } } - else if( nullptr != dynamic_cast< const sd::OutlineViewShell *>( pViewShell.get() )) + else if (nullptr != dynamic_cast<const sd::OutlineViewShell*>(pViewShell.get())) { mpDrawDocument->GetDocSh()->SetWaitCursor(false); // The following loop is executed more than once only when a |