Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / sw / source / uibase / dialog / wordcountwrapper.cxx
blob031d034e26bb7cf122b21338c907de0133b79c39
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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 */
10 #include <swtypes.hxx>
11 #include <wordcountdialog.hxx>
12 #include <docstat.hxx>
13 #include <dialog.hrc>
14 #include <cmdid.h>
16 SFX_IMPL_CHILDWINDOW_WITHID(SwWordCountWrapper, FN_WORDCOUNT_DIALOG)
18 SwWordCountWrapper::SwWordCountWrapper( vcl::Window *pParentWindow,
19 sal_uInt16 nId,
20 SfxBindings* pBindings,
21 SfxChildWinInfo* pInfo ) :
22 SfxChildWindow(pParentWindow, nId)
24 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
25 assert(pFact && "SwAbstractDialogFactory fail!");
26 xAbstDlg.reset(pFact->CreateSwWordCountDialog(pBindings, this, pParentWindow, pInfo));
27 assert(xAbstDlg && "Dialog construction failed!");
28 SetWindow(xAbstDlg->GetWindow());
31 SwWordCountWrapper::~SwWordCountWrapper()
33 xAbstDlg.disposeAndClear();
36 SfxChildWinInfo SwWordCountWrapper::GetInfo() const
38 SfxChildWinInfo aInfo = SfxChildWindow::GetInfo();
39 return aInfo;
42 void SwWordCountWrapper::UpdateCounts()
44 xAbstDlg->UpdateCounts();
47 void SwWordCountWrapper::SetCounts(const SwDocStat &rCurrCnt, const SwDocStat &rDocStat)
49 xAbstDlg->SetCounts(rCurrCnt, rDocStat);
52 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */