[Libreoffice-commits] core.git: sw/source
Renato Ferreira
renato.wolp at gmail.com
Tue Dec 2 05:55:12 PST 2014
sw/source/core/crsr/bookmrk.cxx | 8 ++++++++
sw/source/core/doc/docbm.cxx | 6 ++++++
sw/source/core/inc/bookmrk.hxx | 4 +++-
sw/source/core/unocore/unobkm.cxx | 1 -
4 files changed, 17 insertions(+), 2 deletions(-)
New commits:
commit f0c4cd51cb160492d78c2796f71ecd88da25fa59
Author: Renato Ferreira <renato.wolp at gmail.com>
Date: Sat Nov 15 00:22:57 2014 -0500
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 at redhat.com>
Tested-by: Michael Stahl <mstahl at redhat.com>
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 35fc43e..d79fffc 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 22cef6b..b06097a 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 b5eef56..d5bc95c 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 3697649..f42beb3 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();
}
}
More information about the Libreoffice-commits
mailing list