sd/source/ui/view/Outliner.cxx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
New commits: commit fd0be5e94fd4f591cb7746ac5a373b1fa0ca1455 Author: Marco Cecchetti <marco.cecche...@collabora.com> Date: Wed Jan 6 17:00:09 2016 +0100 sd: lool search all - 2nd search did not work - fixed TODO: 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 <ke...@collabora.com> Tested-by: Jan Holesovsky <ke...@collabora.com> diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index a38bf68..72d7bce 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -35,6 +35,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> @@ -615,12 +616,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. @@ -1219,6 +1221,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 != nullptr) && pObject->HasText() && ! pObject->IsEmptyPresObj(); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits