summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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();
}