summaryrefslogtreecommitdiff
path: root/sw/source/ui/dialog/wordcountdialog.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-11-14 15:25:02 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-11-14 15:25:21 +0000
commit96998ea61d58a4b5c67ab1c7589c069b3ce08d88 (patch)
treecb28723f7cf680a84fe05516d48748fd81ff857c /sw/source/ui/dialog/wordcountdialog.cxx
parent57601d3849a7aaaa08dce8d910832892204d2922 (diff)
add asian/non-asian word count to UI when CJK mode is enabled
Change-Id: Ia54ba045a862d17e6967cee0f3f6f7409632233b
Diffstat (limited to 'sw/source/ui/dialog/wordcountdialog.cxx')
-rw-r--r--sw/source/ui/dialog/wordcountdialog.cxx17
1 files changed, 16 insertions, 1 deletions
diff --git a/sw/source/ui/dialog/wordcountdialog.cxx b/sw/source/ui/dialog/wordcountdialog.cxx
index c8778c905089..b74b970ae8f3 100644
--- a/sw/source/ui/dialog/wordcountdialog.cxx
+++ b/sw/source/ui/dialog/wordcountdialog.cxx
@@ -37,6 +37,7 @@
#include <wrtsh.hxx>
#include <comphelper/string.hxx>
#include <sfx2/viewfrm.hxx>
+#include <svl/cjkoptions.hxx>
#include <vcl/msgbox.hxx>
IMPL_LINK_NOARG(SwWordCountFloatDlg, CloseHdl)
@@ -68,12 +69,18 @@ void SwWordCountFloatDlg::SetValues(const SwDocStat& rCurrent, const SwDocStat&
setValue(m_pCurrentWordFT, rCurrent.nWord);
setValue(m_pCurrentCharacterFT, rCurrent.nChar);
setValue(m_pCurrentCharacterExcludingSpacesFT, rCurrent.nCharExcludingSpaces);
+ setValue(m_pCurrentCjkcharsFT, rCurrent.nAsianWord);
setValue(m_pDocWordFT, rDoc.nWord);
setValue(m_pDocCharacterFT, rDoc.nChar);
setValue(m_pDocCharacterExcludingSpacesFT, rDoc.nCharExcludingSpaces);
+ setValue(m_pDocCjkcharsFT, rDoc.nAsianWord);
+
+ bool bShowCJK = (SvtCJKOptions().IsAnyEnabled() || rDoc.nAsianWord);
+ m_pCurrentCjkcharsFT->Show(bShowCJK);
+ m_pDocCjkcharsFT->Show(bShowCJK);
+ m_pCjkcharsLabelFT->Show(bShowCJK);
}
-//TODO, add asian/non-asian word count to UI when CJK mode is enabled.
SwWordCountFloatDlg::SwWordCountFloatDlg(SfxBindings* _pBindings,
SfxChildWindow* pChild,
Window *pParent,
@@ -83,9 +90,15 @@ SwWordCountFloatDlg::SwWordCountFloatDlg(SfxBindings* _pBindings,
get(m_pCurrentWordFT, "selectwords");
get(m_pCurrentCharacterFT, "selectchars");
get(m_pCurrentCharacterExcludingSpacesFT, "selectcharsnospaces");
+ get(m_pCurrentCjkcharsFT, "selectcjkchars");
+
get(m_pDocWordFT, "docwords");
get(m_pDocCharacterFT, "docchars");
get(m_pDocCharacterExcludingSpacesFT, "doccharsnospaces");
+ get(m_pDocCjkcharsFT, "doccjkchars");
+
+ get(m_pCjkcharsLabelFT, "cjkcharsft");
+
get(m_pClosePB, "close");
long nPrefWidth = m_pCurrentWordFT->get_preferred_size().Width();
@@ -93,9 +106,11 @@ SwWordCountFloatDlg::SwWordCountFloatDlg(SfxBindings* _pBindings,
m_pCurrentWordFT->set_width_request(nPrefWidth);
m_pCurrentCharacterFT->set_width_request(nPrefWidth);
m_pCurrentCharacterExcludingSpacesFT->set_width_request(nPrefWidth);
+ m_pCurrentCjkcharsFT->set_width_request(nPrefWidth);
m_pDocWordFT->set_width_request(nPrefWidth);
m_pDocCharacterFT->set_width_request(nPrefWidth);
m_pDocCharacterExcludingSpacesFT->set_width_request(nPrefWidth);
+ m_pDocCjkcharsFT->set_width_request(nPrefWidth);
Initialize(pInfo);