[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/inc sd/source

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 9 13:19:45 UTC 2020


 sd/inc/Outliner.hxx            |    7 -------
 sd/source/ui/view/Outliner.cxx |   20 +++++++++++++-------
 2 files changed, 13 insertions(+), 14 deletions(-)

New commits:
commit 5bc2314a95199337e796de9be23650a71dff9294
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 9 15:18:43 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.
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95307
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
    (cherry picked from commit 14b55b3a8de070935489acd4f6f8be7b6a3d96a4)
    
    Change-Id: I867dc4f465a694e61b6102b19f8e54ce623e2858
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95918
    Tested-by: Tomaž Vajngerl <quikee at gmail.com>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/sd/inc/Outliner.hxx b/sd/inc/Outliner.hxx
index 39e2720f6a01..3e6514f16b80 100644
--- a/sd/inc/Outliner.hxx
+++ b/sd/inc/Outliner.hxx
@@ -411,13 +411,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 6e982f3d25f7..e77e60c5d305 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -1024,6 +1024,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
@@ -1069,7 +1081,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)
@@ -1237,12 +1249,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