sw/source/core/undo/unbkmk.cxx | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
New commits: commit 43a803ccf8d392561bd168dc3b64695c4dcf93ce Author: Matúš Kukan <matus.ku...@collabora.com> Date: Wed Nov 26 21:26:06 2014 +0100 Use IDocumentMarkAccess::findMark here Presumably, the names should be unique, so it's the same. Change-Id: I74907b97bc25f9512d4f7514162360e8b21ad4a5 diff --git a/sw/source/core/undo/unbkmk.cxx b/sw/source/core/undo/unbkmk.cxx index eb11aa9..3501ed5 100644 --- a/sw/source/core/undo/unbkmk.cxx +++ b/sw/source/core/undo/unbkmk.cxx @@ -118,17 +118,10 @@ SwRewriter SwUndoRenameBookmark::GetRewriter() const void SwUndoRenameBookmark::Rename(::sw::UndoRedoContext & rContext, const OUString& sFrom, const OUString& sTo) { IDocumentMarkAccess* const pMarkAccess = rContext.GetDoc().getIDocumentMarkAccess(); - for ( IDocumentMarkAccess::const_iterator_t ppBkmk = pMarkAccess->getAllMarksBegin(); - ppBkmk != pMarkAccess->getAllMarksEnd(); - ++ppBkmk ) + IDocumentMarkAccess::const_iterator_t ppBkmk = pMarkAccess->findMark(sFrom); + if (ppBkmk != pMarkAccess->getAllMarksEnd()) { - if ( m_nNode == ppBkmk->get()->GetMarkPos().nNode.GetIndex() - && m_nCntnt == ppBkmk->get()->GetMarkPos().nContent.GetIndex() - && sFrom == ppBkmk->get()->GetName() ) - { - pMarkAccess->renameMark( ppBkmk->get(), sTo ); - break; - } + pMarkAccess->renameMark( ppBkmk->get(), sTo ); } }
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits