summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2016-01-06 17:00:09 +0100
committerJan Holesovsky <kendy@collabora.com>2016-01-07 10:59:21 +0100
commitfd0be5e94fd4f591cb7746ac5a373b1fa0ca1455 (patch)
tree2c1bf98a798f87fc1da251fd6e4bc882b5034a52 /sd
parent098bcbc7dcc5c3506911ea8ab5a44685a9bb35fd (diff)
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 <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/view/Outliner.cxx17
1 files changed, 12 insertions, 5 deletions
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index a38bf683c1e4..72d7bce2756e 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();
}