diff options
-rw-r--r-- | sw/inc/IDocumentStatistics.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/DocumentStatisticsManager.cxx | 7 | ||||
-rw-r--r-- | sw/source/core/inc/DocumentStatisticsManager.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/app/docsh2.cxx | 5 |
4 files changed, 10 insertions, 6 deletions
diff --git a/sw/inc/IDocumentStatistics.hxx b/sw/inc/IDocumentStatistics.hxx index 7cb50ae7e5a9..9f953d485fd9 100644 --- a/sw/inc/IDocumentStatistics.hxx +++ b/sw/inc/IDocumentStatistics.hxx @@ -31,7 +31,7 @@ public: /** DocInfo has changed (notify via DocShell): make required fields update. */ - virtual void DocInfoChgd() = 0; + virtual void DocInfoChgd(bool isEnableSetModified) = 0; /** Document - Statistics */ diff --git a/sw/source/core/doc/DocumentStatisticsManager.cxx b/sw/source/core/doc/DocumentStatisticsManager.cxx index 4fed190ea0e8..8525ab117881 100644 --- a/sw/source/core/doc/DocumentStatisticsManager.cxx +++ b/sw/source/core/doc/DocumentStatisticsManager.cxx @@ -77,11 +77,14 @@ DocumentStatisticsManager::DocumentStatisticsManager( SwDoc& i_rSwdoc ) : m_rDoc maStatsUpdateTimer.SetTimeoutHdl( LINK( this, DocumentStatisticsManager, DoIdleStatsUpdate ) ); } -void DocumentStatisticsManager::DocInfoChgd( ) +void DocumentStatisticsManager::DocInfoChgd(bool const isEnableSetModified) { m_rDoc.getIDocumentFieldsAccess().GetSysFieldType( RES_DOCINFOFLD )->UpdateFields(); m_rDoc.getIDocumentFieldsAccess().GetSysFieldType( RES_TEMPLNAMEFLD )->UpdateFields(); - m_rDoc.getIDocumentState().SetModified(); + if (isEnableSetModified) + { + m_rDoc.getIDocumentState().SetModified(); + } } const SwDocStat& DocumentStatisticsManager::GetDocStat() const diff --git a/sw/source/core/inc/DocumentStatisticsManager.hxx b/sw/source/core/inc/DocumentStatisticsManager.hxx index eef46e8f3188..c62170a348c1 100644 --- a/sw/source/core/inc/DocumentStatisticsManager.hxx +++ b/sw/source/core/inc/DocumentStatisticsManager.hxx @@ -37,7 +37,7 @@ public: DocumentStatisticsManager( SwDoc& i_rSwdoc ); - void DocInfoChgd() SAL_OVERRIDE; + void DocInfoChgd(bool isEnableSetModified) SAL_OVERRIDE; const SwDocStat &GetDocStat() const SAL_OVERRIDE; SwDocStat & GetDocStat(); //Non const version of the above, not part of the interface. const SwDocStat &GetUpdatedDocStat(bool bCompleteAsync = false, bool bFields = true) SAL_OVERRIDE; 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 ) |