1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
10 #include <swtypes.hxx>
11 #include <wordcountdialog.hxx>
12 #include <docstat.hxx>
16 SFX_IMPL_CHILDWINDOW_WITHID(SwWordCountWrapper
, FN_WORDCOUNT_DIALOG
)
18 SwWordCountWrapper::SwWordCountWrapper( vcl::Window
*pParentWindow
,
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();
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: */