/src/libreoffice/sw/source/uibase/utlui/wordcountctrl.cxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
5 | | * This Source Code Form is subject to the terms of the Mozilla Public |
6 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
7 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
8 | | */ |
9 | | |
10 | | #include <swtypes.hxx> |
11 | | #include <strings.hrc> |
12 | | #include <wordcountctrl.hxx> |
13 | | #include <svl/stritem.hxx> |
14 | | #include <vcl/status.hxx> |
15 | | |
16 | | SFX_IMPL_STATUSBAR_CONTROL(SwWordCountStatusBarControl, SfxStringItem); |
17 | | |
18 | | SwWordCountStatusBarControl::SwWordCountStatusBarControl( |
19 | | sal_uInt16 _nSlotId, |
20 | | sal_uInt16 _nId, |
21 | | StatusBar& rStb) : |
22 | 0 | SfxStatusBarControl(_nSlotId, _nId, rStb) |
23 | 0 | { |
24 | 0 | } |
25 | | |
26 | | SwWordCountStatusBarControl::~SwWordCountStatusBarControl() |
27 | 0 | { |
28 | 0 | } |
29 | | |
30 | | void SwWordCountStatusBarControl::StateChangedAtStatusBarControl( |
31 | | sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState ) |
32 | 0 | { |
33 | 0 | if (eState == SfxItemState::DEFAULT) // Can access pState |
34 | 0 | { |
35 | 0 | GetStatusBar().SetItemText( GetId(), static_cast<const SfxStringItem*>(pState)->GetValue() ); |
36 | 0 | GetStatusBar().SetQuickHelpText(GetId(), SwResId(STR_WORDCOUNT_HINT)); |
37 | 0 | } |
38 | 0 | else |
39 | 0 | { |
40 | 0 | GetStatusBar().SetItemText(GetId(), u""_ustr); |
41 | 0 | GetStatusBar().SetQuickHelpText(GetId(), u""_ustr); |
42 | 0 | } |
43 | 0 | } |
44 | | |
45 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |