[Libreoffice-commits] .: sw/source sw/uiconfig
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Nov 14 07:25:42 PST 2012
sw/source/ui/dialog/wordcountdialog.cxx | 17 ++++++++++-
sw/source/ui/inc/wordcountdialog.hxx | 6 +++
sw/uiconfig/swriter/ui/wordcount.ui | 49 ++++++++++++++++++++++++++++++++
3 files changed, 71 insertions(+), 1 deletion(-)
New commits:
commit 96998ea61d58a4b5c67ab1c7589c069b3ce08d88
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 14 15:25:02 2012 +0000
add asian/non-asian word count to UI when CJK mode is enabled
Change-Id: Ia54ba045a862d17e6967cee0f3f6f7409632233b
diff --git a/sw/source/ui/dialog/wordcountdialog.cxx b/sw/source/ui/dialog/wordcountdialog.cxx
index c8778c9..b74b970 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);
diff --git a/sw/source/ui/inc/wordcountdialog.hxx b/sw/source/ui/inc/wordcountdialog.hxx
index 47e7a98..a0dbe38 100644
--- a/sw/source/ui/inc/wordcountdialog.hxx
+++ b/sw/source/ui/inc/wordcountdialog.hxx
@@ -43,9 +43,15 @@ class SwWordCountFloatDlg : public SfxModelessDialog
FixedText* m_pCurrentWordFT;
FixedText* m_pCurrentCharacterFT;
FixedText* m_pCurrentCharacterExcludingSpacesFT;
+ FixedText* m_pCurrentCjkcharsFT;
+
FixedText* m_pDocWordFT;
FixedText* m_pDocCharacterFT;
FixedText* m_pDocCharacterExcludingSpacesFT;
+ FixedText* m_pDocCjkcharsFT;
+
+ FixedText* m_pCjkcharsLabelFT;
+
PushButton* m_pClosePB;
SW_DLLPRIVATE DECL_LINK( CloseHdl, void* );
diff --git a/sw/uiconfig/swriter/ui/wordcount.ui b/sw/uiconfig/swriter/ui/wordcount.ui
index 0274d99..733f049 100644
--- a/sw/uiconfig/swriter/ui/wordcount.ui
+++ b/sw/uiconfig/swriter/ui/wordcount.ui
@@ -262,6 +262,55 @@
<child>
<placeholder/>
</child>
+ <child>
+ <object class="GtkLabel" id="cjkcharsft">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="xpad">10</property>
+ <property name="label" translatable="yes">Asian characters and Korean syllables</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">4</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="selectcjkchars">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">end</property>
+ <property name="hexpand">True</property>
+ <property name="xalign">1</property>
+ <property name="label"> 0</property>
+ <property name="justify">right</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">4</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="doccjkchars">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">end</property>
+ <property name="hexpand">True</property>
+ <property name="xalign">1</property>
+ <property name="label"> 0</property>
+ <property name="justify">right</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
</object>
</child>
</object>
More information about the Libreoffice-commits
mailing list