summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRenato Ferreira <renato.wolp@gmail.com>2014-11-15 00:22:57 -0500
committerMichael Stahl <mstahl@redhat.com>2014-12-02 13:54:41 +0000
commitf0c4cd51cb160492d78c2796f71ecd88da25fa59 (patch)
treeef05e7635290c9d84e88cc8443568db34d0ad32d
parent8eb37e74fff1806608563ee49489b8a1f71fc6b0 (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>
-rw-r--r--sw/source/core/crsr/bookmrk.cxx8
-rw-r--r--sw/source/core/doc/docbm.cxx6
-rw-r--r--sw/source/core/inc/bookmrk.hxx4
-rw-r--r--sw/source/core/unocore/unobkm.cxx1
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 22cef6b83fa1..b06097a1233a 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>
@@ -550,6 +551,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();
}
}