diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-09-07 21:52:49 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-09-07 22:00:27 +0200 |
commit | 5adc8ee343e5c32d30095bc4005b7b022016b745 (patch) | |
tree | 8148a23a2b68e26b43a308c71fac3feb43319814 /sw/source/uibase/app/docsh2.cxx | |
parent | 4ff0032528d7aebb0de5cf045a39972a2769029f (diff) |
sw: fix newly created document being modified
After the document is created, an event is dispatched on the main loop
that calls SfxPickList::Notify(), which modifies document properties.
It tries to prevent setting the document to modified by calling
SfxObjectShell::EnableSetModified(false), but Writer cunningly outwits
it by simply having its own independent(?) modified flag that is set
unconditionally in DocumentStatisticsManager::DocInfoChgd().
Let's assume that if the modified flag shouldn't be modified in
SfxObjectShell, it shouldn't be modified in DocumentStatisticsManager.
Somehow in 4.4 and 4.3 the same thing was going on, but it didn't result
in a visibly enabled Save icon in the UI, but with 5.0 it does - cannot
easily bisect why that changed due to tdf#91383.
Change-Id: Id30fd831eb29910c9fb44ed3031bf8da23586bea
Diffstat (limited to 'sw/source/uibase/app/docsh2.cxx')
-rw-r--r-- | sw/source/uibase/app/docsh2.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index 6a7b55d6d1a9..110c9cd64404 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -202,7 +202,7 @@ void SwDocShell::DoFlushDocInfo() m_pWrtShell->StartAllAction(); } - m_pDoc->getIDocumentStatistics().DocInfoChgd(); + m_pDoc->getIDocumentStatistics().DocInfoChgd(IsEnableSetModified()); if (m_pWrtShell) { @@ -291,8 +291,9 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) EnableSetModified( false ); // #i41679# const bool bIsDocModified = m_pDoc->getIDocumentState().IsModified(); + // TODO: is the ResetModified() below because of only the direct call from DocInfoChgd, or does UpdateFields() set it too? - m_pDoc->getIDocumentStatistics().DocInfoChgd( ); + m_pDoc->getIDocumentStatistics().DocInfoChgd(false); // #i41679# if ( !bIsDocModified ) |