LibreOffice Module sc (master)  1
tpstat.cxx
Go to the documentation of this file.
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  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #undef SC_DLLIMPLEMENTATION
21 
22 #include <document.hxx>
23 #include <docsh.hxx>
24 
25 #include <tpstat.hxx>
26 
27 // Dokumentinfo-Tabpage:
28 
29 std::unique_ptr<SfxTabPage> ScDocStatPage::Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet )
30 {
31  return std::make_unique<ScDocStatPage>( pPage, pController, *rSet );
32 }
33 
35  : SfxTabPage(pPage, pController, "modules/scalc/ui/statisticsinfopage.ui", "StatisticsInfoPage", &rSet)
36  , m_xFtTables(m_xBuilder->weld_label("nosheets"))
37  , m_xFtCells(m_xBuilder->weld_label("nocells"))
38  , m_xFtPages(m_xBuilder->weld_label("nopages"))
39  , m_xFtFormula(m_xBuilder->weld_label("noformula"))
40  , m_xFrame(m_xBuilder->weld_frame("StatisticsInfoPage"))
41 {
42  ScDocShell* pDocSh = dynamic_cast<ScDocShell*>( SfxObjectShell::Current() );
43  ScDocStat aDocStat;
44 
45  if ( pDocSh )
46  pDocSh->GetDocStat( aDocStat );
47 
48  OUString aInfo = m_xFrame->get_label() + aDocStat.aDocName;
49  m_xFrame->set_label(aInfo);
50  m_xFtTables->set_label( OUString::number( aDocStat.nTableCount ) );
51  m_xFtCells->set_label( OUString::number( aDocStat.nCellCount ) );
52  m_xFtPages->set_label( OUString::number( aDocStat.nPageCount ) );
53  m_xFtFormula->set_label( OUString::number( aDocStat.nFormulaCount ) );
54 
55 }
56 
58 {
59 }
60 
62 {
63  return false;
64 }
65 
66 void ScDocStatPage::Reset( const SfxItemSet* /* rSet */ )
67 {
68 }
69 
70 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uLong nFormulaCount
Definition: document.hxx:279
std::unique_ptr< weld::Frame > m_xFrame
Definition: tpstat.hxx:41
css::uno::Reference< css::lang::XComponent > m_xFrame
static SfxObjectShell * Current()
virtual ~ScDocStatPage() override
Definition: tpstat.cxx:57
sal_uLong nCellCount
Definition: document.hxx:278
SCTAB nTableCount
Definition: document.hxx:277
sal_uInt16 nPageCount
Definition: document.hxx:280
std::unique_ptr< weld::Label > m_xFtCells
Definition: tpstat.hxx:38
std::unique_ptr< weld::Label > m_xFtPages
Definition: tpstat.hxx:39
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: tpstat.cxx:61
std::unique_ptr< weld::Label > m_xFtFormula
Definition: tpstat.hxx:40
virtual void Reset(const SfxItemSet *rSet) override
Definition: tpstat.cxx:66
std::unique_ptr< weld::Label > m_xFtTables
Definition: tpstat.hxx:37
OUString aDocName
Definition: document.hxx:276
void GetDocStat(ScDocStat &rDocStat)
Definition: docsh.cxx:2919
ScDocStatPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: tpstat.cxx:34
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: tpstat.cxx:29