[Libreoffice-commits] core.git: sd/inc sd/source
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jun 2 07:20:41 UTC 2020
sd/inc/Outliner.hxx | 7 -------
sd/source/ui/view/Outliner.cxx | 20 +++++++++++++-------
2 files changed, 13 insertions(+), 14 deletions(-)
New commits:
commit 14b55b3a8de070935489acd4f6f8be7b6a3d96a4
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed May 27 14:13:02 2020 +0200
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Tue Jun 2 09:20:05 2020 +0200
sd: move IsValidTextObject into source as anon. function
IsValidTextObject is only used internally in Outline, so put it
inside the source file as an anonymous function and not as a
member function of Outliner.
Change-Id: I867dc4f465a694e61b6102b19f8e54ce623e2858
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95307
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/sd/inc/Outliner.hxx b/sd/inc/Outliner.hxx
index 79c54c032a03..5a65f3aab4be 100644
--- a/sd/inc/Outliner.hxx
+++ b/sd/inc/Outliner.hxx
@@ -416,13 +416,6 @@ private:
*/
bool ShowWrapArroundDialog();
- /** Check whether the object pointed to by the iterator is a valid text
- object.
- @param aPosition
- The object for which to test whether it is a valid text object.
- */
- static bool IsValidTextObject(const ::sd::outliner::IteratorPosition& rPosition);
-
/** Put text of current text object into outliner so that the text can
be searched/spell checked.
*/
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 0aebe2838e4c..7ce6cab0b0a7 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -1013,6 +1013,18 @@ void SdOutliner::RestoreStartPosition()
}
}
+namespace
+{
+
+bool lclIsValidTextObject(const sd::outliner::IteratorPosition& rPosition)
+{
+ auto* pObject = dynamic_cast< SdrTextObj* >( rPosition.mxObject.get() );
+ return (pObject != nullptr) && pObject->HasText() && ! pObject->IsEmptyPresObj();
+}
+
+} // end anonymous namespace
+
+
/** The main purpose of this method is to iterate over all shape objects of
the search area (current selection, current view, or whole document)
until a text object has been found that contains at least one match or
@@ -1058,7 +1070,7 @@ void SdOutliner::ProvideNextTextObject()
bool bForbiddenPage = comphelper::LibreOfficeKit::isActive() && (maCurrentPosition.mePageKind != PageKind::Standard || maCurrentPosition.meEditMode != EditMode::Page);
// Switch to the current object only if it is a valid text object.
- if (!bForbiddenPage && IsValidTextObject(maCurrentPosition))
+ if (!bForbiddenPage && lclIsValidTextObject(maCurrentPosition))
{
// Don't set yet in case of searching: the text object may not match.
if (meMode != SEARCH)
@@ -1226,12 +1238,6 @@ bool SdOutliner::ShowWrapArroundDialog()
return (nBoxResult == RET_YES);
}
-bool SdOutliner::IsValidTextObject (const sd::outliner::IteratorPosition& rPosition)
-{
- SdrTextObj* pObject = dynamic_cast< SdrTextObj* >( rPosition.mxObject.get() );
- return (pObject != nullptr) && pObject->HasText() && ! pObject->IsEmptyPresObj();
-}
-
void SdOutliner::PutTextIntoOutliner()
{
mpSearchSpellTextObj = dynamic_cast<SdrTextObj*>( mpObj );
More information about the Libreoffice-commits
mailing list