summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/docbm.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/doc/docbm.cxx')
-rw-r--r--sw/source/core/doc/docbm.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index d6d3d27e4df4..9567c3ab7606 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -29,6 +29,7 @@
#include <doc.hxx>
#include <IDocumentRedlineAccess.hxx>
#include <IDocumentState.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <xmloff/odffields.hxx>
#include <editsh.hxx>
@@ -49,6 +50,7 @@
#include <sfx2/linkmgr.hxx>
#include <swserv.hxx>
#include <swundo.hxx>
+#include <UndoBookmark.hxx>
#include <unocrsr.hxx>
#include <viscrs.hxx>
#include <edimp.hxx>
@@ -550,12 +552,18 @@ namespace sw { namespace mark
return false;
if (::sw::mark::MarkBase* pMarkBase = dynamic_cast< ::sw::mark::MarkBase* >(io_pMark))
{
- m_aMarkNamesSet.erase(pMarkBase->GetName());
+ const OUString sOldName(pMarkBase->GetName());
+ m_aMarkNamesSet.erase(sOldName);
m_aMarkNamesSet.insert(rNewName);
pMarkBase->SetName(rNewName);
- // fdo#51741 Bookmark should mark document as modified when renamed
- if (dynamic_cast< ::sw::mark::Bookmark* >(io_pMark)) {
+ if (dynamic_cast< ::sw::mark::Bookmark* >(io_pMark))
+ {
+ if (m_pDoc->GetIDocumentUndoRedo().DoesUndo())
+ {
+ m_pDoc->GetIDocumentUndoRedo().AppendUndo(
+ new SwUndoRenameBookmark(sOldName, rNewName));
+ }
m_pDoc->getIDocumentState().SetModified();
}
}