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

Marco Cecchetti marco.cecchetti at collabora.com
Thu Jan 7 01:56:35 PST 2016


 sd/source/ui/view/Outliner.cxx |   17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

New commits:
commit f4bf83f6670999b4ef2406fd6fc5fd4e78b3e1ed
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date:   Wed Jan 6 17:00:09 2016 +0100

    lool - search all - 2nd search does not work - fixed
    
    warning: now table are skipped because current implementation is not
    able to iterate through table cells and when a match occurs on the first
    cell the text object iterator stops working;
    
    Change-Id: I36ca4dabe88b0eb8fd89d3fe3dcc6951e5c03d0e
    Reviewed-on: https://gerrit.libreoffice.org/21166
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 0d4913e..f32c8ed 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -41,6 +41,7 @@
 #include <sfx2/printer.hxx>
 #include <svx/svxerr.hxx>
 #include <svx/svdotext.hxx>
+#include <svx/svdotable.hxx>
 #include <editeng/unolingu.hxx>
 #include <svx/svditer.hxx>
 #include <comphelper/extract.hxx>
@@ -630,12 +631,13 @@ bool Outliner::SearchAndReplaceAll()
     {
         // Go to beginning/end of document.
         maObjectIterator = ::sd::outliner::OutlinerContainer(this).begin();
-        // Switch to the current object only if it is a valid text object.
-        ::sd::outliner::IteratorPosition aNewPosition (*maObjectIterator);
-        if (IsValidTextObject (aNewPosition))
+        // Switch to the first object which contains the search string.
+        ProvideNextTextObject();
+        if( !mbStringFound  )
         {
-            maCurrentPosition = aNewPosition;
-            SetObject (maCurrentPosition);
+            RestoreStartPosition ();
+            mnStartPageIndex = (sal_uInt16)-1;
+            return true;
         }
 
         // Search/replace until the end of the document is reached.
@@ -1234,6 +1236,11 @@ bool Outliner::ShowWrapArroundDialog()
 
 bool Outliner::IsValidTextObject (const ::sd::outliner::IteratorPosition& rPosition)
 {
+    // TODO implement iteration through table cells and remove this workaround
+    ::sdr::table::SdrTableObj* pTableObject = dynamic_cast< ::sdr::table::SdrTableObj* >( rPosition.mxObject.get() );
+    if( pTableObject != nullptr )
+        return false;
+
     SdrTextObj* pObject = dynamic_cast< SdrTextObj* >( rPosition.mxObject.get() );
     return (pObject != NULL) && pObject->HasText() && ! pObject->IsEmptyPresObj();
 }


More information about the Libreoffice-commits mailing list