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
29std::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
66void ScDocStatPage::Reset( const SfxItemSet* /* rSet */ )
67{
68}
69
70/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::lang::XComponent > m_xFrame
void GetDocStat(ScDocStat &rDocStat)
Definition: docsh.cxx:3059
std::unique_ptr< weld::Label > m_xFtCells
Definition: tpstat.hxx:37
ScDocStatPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: tpstat.cxx:34
std::unique_ptr< weld::Label > m_xFtPages
Definition: tpstat.hxx:38
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: tpstat.cxx:61
std::unique_ptr< weld::Label > m_xFtFormula
Definition: tpstat.hxx:39
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: tpstat.cxx:29
virtual void Reset(const SfxItemSet *rSet) override
Definition: tpstat.cxx:66
std::unique_ptr< weld::Frame > m_xFrame
Definition: tpstat.hxx:40
std::unique_ptr< weld::Label > m_xFtTables
Definition: tpstat.hxx:36
virtual ~ScDocStatPage() override
Definition: tpstat.cxx:57
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
static SfxItemSet & rSet
sal_uInt16 nPageCount
Definition: document.hxx:289
OUString aDocName
Definition: document.hxx:285
sal_uInt64 nFormulaCount
Definition: document.hxx:288
sal_uInt64 nCellCount
Definition: document.hxx:287
SCTAB nTableCount
Definition: document.hxx:286