diff options
author | Renato Ferreira <renato.wolp@gmail.com> | 2014-11-15 00:22:57 -0500 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-12-11 22:31:35 +0100 |
commit | b4000bac50431b75d9e1157b88c2fb137e684591 (patch) | |
tree | 9518e09eba22c458fc614aaf6e9c185634f2c443 | |
parent | 68420e81edb7275cc66bae110d7279b24a8913a6 (diff) |
fdo#51741 Mark document as modified on bookmark rename / delete
Change-Id: I378037ea546d0f2dc4ab9e0b0e6f9bf65c8db5b4
Deletion: overrided DdeBookmark::DeregisterFromDoc in Bookmark
Renaming: in MarkManager::renameMark
Reviewed-on: https://gerrit.libreoffice.org/12436
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
(cherry picked from commit f0c4cd51cb160492d78c2796f71ecd88da25fa59)
-rw-r--r-- | sw/source/core/crsr/bookmrk.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/doc/docbm.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/inc/bookmrk.hxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/unobkm.cxx | 1 |
4 files changed, 17 insertions, 2 deletions
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx index 35fc43e9b996..d79fffc12b0e 100644 --- a/sw/source/core/crsr/bookmrk.cxx +++ b/sw/source/core/crsr/bookmrk.cxx @@ -272,6 +272,14 @@ namespace sw { namespace mark io_pDoc->getIDocumentState().SetModified(); } + void Bookmark::DeregisterFromDoc(SwDoc* const io_pDoc) + { + DdeBookmark::DeregisterFromDoc(io_pDoc); + + // fdo#51741 Bookmark should mark document as modified when deleted + io_pDoc->getIDocumentState().SetModified(); + } + ::sfx2::IXmlIdRegistry& Bookmark::GetRegistry() { SwDoc *const pDoc( GetMarkPos().GetDoc() ); diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index b7487ec9f4bc..d6d3d27e4df4 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -28,6 +28,7 @@ #include <dcontact.hxx> #include <doc.hxx> #include <IDocumentRedlineAccess.hxx> +#include <IDocumentState.hxx> #include <docary.hxx> #include <xmloff/odffields.hxx> #include <editsh.hxx> @@ -552,6 +553,11 @@ namespace sw { namespace mark m_aMarkNamesSet.erase(pMarkBase->GetName()); 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)) { + m_pDoc->getIDocumentState().SetModified(); + } } return true; } diff --git a/sw/source/core/inc/bookmrk.hxx b/sw/source/core/inc/bookmrk.hxx index b5eef562e59a..d5bc95c9af24 100644 --- a/sw/source/core/inc/bookmrk.hxx +++ b/sw/source/core/inc/bookmrk.hxx @@ -152,7 +152,7 @@ namespace sw { void SetRefObject( SwServerObject* pObj ); - void DeregisterFromDoc(SwDoc* const pDoc); + virtual void DeregisterFromDoc(SwDoc* const pDoc); virtual ~DdeBookmark(); private: @@ -171,6 +171,8 @@ namespace sw { const OUString& rShortName); virtual void InitDoc(SwDoc* const io_Doc) SAL_OVERRIDE; + virtual void DeregisterFromDoc(SwDoc* const io_pDoc) SAL_OVERRIDE; + virtual const OUString& GetShortName() const SAL_OVERRIDE { return m_sShortName; } virtual const vcl::KeyCode& GetKeyCode() const SAL_OVERRIDE diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx index 3697649b04a1..f42beb344d57 100644 --- a/sw/source/core/unocore/unobkm.cxx +++ b/sw/source/core/unocore/unobkm.cxx @@ -357,7 +357,6 @@ throw (uno::RuntimeException, std::exception) m_pImpl->m_pDoc->GetIDocumentUndoRedo().AppendUndo( new SwUndoRenameBookmark(*m_pImpl->m_pRegisteredBookmark, sOldName)); } - m_pImpl->m_pDoc->getIDocumentState().SetModified(); } } |