summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/ui/dialog/wordcountdialog.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/sw/source/ui/dialog/wordcountdialog.cxx b/sw/source/ui/dialog/wordcountdialog.cxx
index ba159d4e6aa6..e7b739ac9a2a 100644
--- a/sw/source/ui/dialog/wordcountdialog.cxx
+++ b/sw/source/ui/dialog/wordcountdialog.cxx
@@ -19,6 +19,7 @@
#include <officecfg/Office/Writer.hxx>
#include <wordcountdialog.hxx>
+#include <docsh.hxx>
#include <docstat.hxx>
#include <swmodule.hxx>
#include <view.hxx>
@@ -133,7 +134,9 @@ void SwWordCountFloatDlg::UpdateCounts()
SwDocStat aCurrCnt;
SwDocStat aDocStat;
{
- SwWait aWait( *::GetActiveView()->GetDocShell(), true );
+ auto& rDocShell(*GetActiveView()->GetDocShell());
+ SwWait aWait(rDocShell, true);
+ auto aLock = rDocShell.LockAllViews();
rSh.StartAction();
rSh.CountWords( aCurrCnt );
aDocStat = rSh.GetUpdatedDocStat();