summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-08-27 16:05:11 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-08-27 16:26:44 +0100
commit5192468dd49f5e1d821239cd51cea42f8bac7a4b (patch)
treea4f52c450a36d9fbf0a3c7cbd28a8be163fed377
parenta59b51a683a21a44e9071e878addc6a7ace3b5a8 (diff)
Related: fdo#51908 reuse the status bar word counts for the dialog
Set the counts directly on the word count dialog when we have them precalculated from updating the status bar Change-Id: Idd64f20097af661dd4938af7fcc8506eca076e9c
-rw-r--r--sw/inc/swabstdlg.hxx1
-rw-r--r--sw/source/ui/dialog/swdlgfact.cxx4
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx1
-rw-r--r--sw/source/ui/dialog/wordcountdialog.cxx5
-rw-r--r--sw/source/ui/dialog/wordcountwrapper.cxx5
-rw-r--r--sw/source/ui/inc/wordcountdialog.hxx3
-rw-r--r--sw/source/ui/uiview/view2.cxx5
7 files changed, 24 insertions, 0 deletions
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index 2962991aae85..016202c96f52 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -203,6 +203,7 @@ class AbstractSwWordCountFloatDlg : public VclAbstractDialog
{
public:
virtual void UpdateCounts() = 0;
+ virtual void SetCounts(const SwDocStat &rCurrCnt, const SwDocStat &rDocStat) = 0;
virtual Window * GetWindow() = 0; //this method is added for return a Window type pointer
};
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index f7c81aa07b46..868b487701b3 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -571,6 +571,10 @@ void AbstractSwWordCountFloatDlg_Impl::UpdateCounts()
pDlg->UpdateCounts();
}
+void AbstractSwWordCountFloatDlg_Impl::SetCounts(const SwDocStat &rCurrCnt, const SwDocStat &rDocStat)
+{
+ pDlg->SetCounts(rCurrCnt, rDocStat);
+}
AbstractMailMergeWizard_Impl::~AbstractMailMergeWizard_Impl()
{
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index f4a24da9fbc1..159f6e3633b0 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -79,6 +79,7 @@ class AbstractSwWordCountFloatDlg_Impl : public AbstractSwWordCountFloatDlg
{
DECL_ABSTDLG_BASE(AbstractSwWordCountFloatDlg_Impl,SwWordCountFloatDlg)
virtual void UpdateCounts();
+ virtual void SetCounts(const SwDocStat &rCurrCnt, const SwDocStat &rDocStat);
virtual Window * GetWindow(); //this method is added for return a Window type pointer
};
diff --git a/sw/source/ui/dialog/wordcountdialog.cxx b/sw/source/ui/dialog/wordcountdialog.cxx
index c34c197b1de7..122d54214de1 100644
--- a/sw/source/ui/dialog/wordcountdialog.cxx
+++ b/sw/source/ui/dialog/wordcountdialog.cxx
@@ -133,4 +133,9 @@ void SwWordCountFloatDlg::UpdateCounts()
aDlg.SetValues(aCurrCnt, aDocStat);
}
+void SwWordCountFloatDlg::SetCounts(const SwDocStat &rCurrCnt, const SwDocStat &rDocStat)
+{
+ aDlg.SetValues(rCurrCnt, rDocStat);
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dialog/wordcountwrapper.cxx b/sw/source/ui/dialog/wordcountwrapper.cxx
index aaca02d8a1c9..2fb4b8da2bf5 100644
--- a/sw/source/ui/dialog/wordcountwrapper.cxx
+++ b/sw/source/ui/dialog/wordcountwrapper.cxx
@@ -58,3 +58,8 @@ void SwWordCountWrapper::UpdateCounts()
{
pAbstDlg->UpdateCounts();
}
+
+void SwWordCountWrapper::SetCounts(const SwDocStat &rCurrCnt, const SwDocStat &rDocStat)
+{
+ pAbstDlg->SetCounts(rCurrCnt, rDocStat);
+}
diff --git a/sw/source/ui/inc/wordcountdialog.hxx b/sw/source/ui/inc/wordcountdialog.hxx
index 19600720620e..f70c6a8bccf9 100644
--- a/sw/source/ui/inc/wordcountdialog.hxx
+++ b/sw/source/ui/inc/wordcountdialog.hxx
@@ -78,6 +78,8 @@ class SwWordCountFloatDlg : public SfxModelessDialog
Window *pParent,
SfxChildWinInfo* pInfo);
void UpdateCounts();
+
+ void SetCounts(const SwDocStat &rCurrCnt, const SwDocStat &rDocStat);
};
class SwWordCountWrapper : public SfxChildWindow
@@ -93,6 +95,7 @@ protected:
public:
void UpdateCounts();
+ void SetCounts(const SwDocStat &rCurrCnt, const SwDocStat &rDocStat);
};
#endif
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index 7dfbe0296b59..770866ac9367 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -140,6 +140,7 @@
#include <svx/ofaitem.hxx>
#include <unomid.h>
#include <docstat.hxx>
+#include <wordcountdialog.hxx>
const char sStatusDelim[] = " : ";
const char sStatusComma[] = " , ";//#outlinelevel, define a Variable for "," add by zhaojianwei
@@ -1215,6 +1216,10 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
wordCount = wordCount.replaceAll("$2", rtl::OUString::valueOf(static_cast<sal_Int64>(selectionStats.nWord)));
}
rSet.Put(SfxStringItem(FN_STAT_WORDCOUNT, wordCount));
+
+ SwWordCountWrapper *pWrdCnt = (SwWordCountWrapper*)GetViewFrame()->GetChildWindow(SwWordCountWrapper::GetChildWindowId());
+ if (pWrdCnt)
+ pWrdCnt->SetCounts(selectionStats, documentStats);
}
break;