Kaydet (Commit) f0c4cd51 authored tarafından Renato Ferreira's avatar Renato Ferreira Kaydeden (comit) Michael Stahl

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/12436Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
Tested-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst 8eb37e74
...@@ -272,6 +272,14 @@ namespace sw { namespace mark ...@@ -272,6 +272,14 @@ namespace sw { namespace mark
io_pDoc->getIDocumentState().SetModified(); 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() ::sfx2::IXmlIdRegistry& Bookmark::GetRegistry()
{ {
SwDoc *const pDoc( GetMarkPos().GetDoc() ); SwDoc *const pDoc( GetMarkPos().GetDoc() );
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <dcontact.hxx> #include <dcontact.hxx>
#include <doc.hxx> #include <doc.hxx>
#include <IDocumentRedlineAccess.hxx> #include <IDocumentRedlineAccess.hxx>
#include <IDocumentState.hxx>
#include <docary.hxx> #include <docary.hxx>
#include <xmloff/odffields.hxx> #include <xmloff/odffields.hxx>
#include <editsh.hxx> #include <editsh.hxx>
...@@ -550,6 +551,11 @@ namespace sw { namespace mark ...@@ -550,6 +551,11 @@ namespace sw { namespace mark
m_aMarkNamesSet.erase(pMarkBase->GetName()); m_aMarkNamesSet.erase(pMarkBase->GetName());
m_aMarkNamesSet.insert(rNewName); m_aMarkNamesSet.insert(rNewName);
pMarkBase->SetName(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; return true;
} }
......
...@@ -152,7 +152,7 @@ namespace sw { ...@@ -152,7 +152,7 @@ namespace sw {
void SetRefObject( SwServerObject* pObj ); void SetRefObject( SwServerObject* pObj );
void DeregisterFromDoc(SwDoc* const pDoc); virtual void DeregisterFromDoc(SwDoc* const pDoc);
virtual ~DdeBookmark(); virtual ~DdeBookmark();
private: private:
...@@ -171,6 +171,8 @@ namespace sw { ...@@ -171,6 +171,8 @@ namespace sw {
const OUString& rShortName); const OUString& rShortName);
virtual void InitDoc(SwDoc* const io_Doc) SAL_OVERRIDE; 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 virtual const OUString& GetShortName() const SAL_OVERRIDE
{ return m_sShortName; } { return m_sShortName; }
virtual const vcl::KeyCode& GetKeyCode() const SAL_OVERRIDE virtual const vcl::KeyCode& GetKeyCode() const SAL_OVERRIDE
......
...@@ -357,7 +357,6 @@ throw (uno::RuntimeException, std::exception) ...@@ -357,7 +357,6 @@ throw (uno::RuntimeException, std::exception)
m_pImpl->m_pDoc->GetIDocumentUndoRedo().AppendUndo( m_pImpl->m_pDoc->GetIDocumentUndoRedo().AppendUndo(
new SwUndoRenameBookmark(*m_pImpl->m_pRegisteredBookmark, sOldName)); new SwUndoRenameBookmark(*m_pImpl->m_pRegisteredBookmark, sOldName));
} }
m_pImpl->m_pDoc->getIDocumentState().SetModified();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment