summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core')
-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();
}
}