diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2016-01-06 17:00:09 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2016-01-07 09:56:14 +0000 |
commit | f4bf83f6670999b4ef2406fd6fc5fd4e78b3e1ed (patch) | |
tree | 4ad4b9bdd8f7ea3c9b4fc2fae69fe4e65336e70c /sd | |
parent | 7890aabc073e277d43f081a70ee8480741ec4f51 (diff) |
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@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/view/Outliner.cxx | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index 0d4913e0dfe5..f32c8edb2d1a 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(); } |