Kaydet (Commit) 60f97b07 authored tarafından Caolán McNamara's avatar Caolán McNamara

weld ScDocStatPage

Change-Id: I24d264f6318adfd9f67303d95b3b8fe0987f928a
Reviewed-on: https://gerrit.libreoffice.org/73144
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 63d17d01
......@@ -30,48 +30,37 @@
VclPtr<SfxTabPage> ScDocStatPage::Create( TabPageParent pParent, const SfxItemSet* rSet )
{
return VclPtr<ScDocStatPage>::Create( pParent.pParent, *rSet );
return VclPtr<ScDocStatPage>::Create( pParent, *rSet );
}
ScDocStatPage::ScDocStatPage( vcl::Window *pParent, const SfxItemSet& rSet )
: SfxTabPage( pParent, "StatisticsInfoPage", "modules/scalc/ui/statisticsinfopage.ui", &rSet )
ScDocStatPage::ScDocStatPage(TabPageParent pParent, const SfxItemSet& rSet)
: SfxTabPage(pParent, "modules/scalc/ui/statisticsinfopage.ui", "StatisticsInfoPage", &rSet)
, m_xFtTables(m_xBuilder->weld_label("nosheets"))
, m_xFtCells(m_xBuilder->weld_label("nocells"))
, m_xFtPages(m_xBuilder->weld_label("nopages"))
, m_xFtFormula(m_xBuilder->weld_label("noformula"))
, m_xFrame(m_xBuilder->weld_frame("StatisticsInfoPage"))
{
get(m_pFtTables,"nosheets");
get(m_pFtCells,"nocells");
get(m_pFtPages,"nopages");
get(m_pFtFormula,"noformula");
ScDocShell* pDocSh = dynamic_cast<ScDocShell*>( SfxObjectShell::Current() );
ScDocStat aDocStat;
if ( pDocSh )
pDocSh->GetDocStat( aDocStat );
VclFrame *pFrame = get<VclFrame>("StatisticsInfoPage");
OUString aInfo = pFrame->get_label();
OUString aInfo = m_xFrame->get_label();
aInfo += aDocStat.aDocName;
pFrame->set_label(aInfo);
m_pFtTables ->SetText( OUString::number( aDocStat.nTableCount ) );
m_pFtCells ->SetText( OUString::number( aDocStat.nCellCount ) );
m_pFtPages ->SetText( OUString::number( aDocStat.nPageCount ) );
m_pFtFormula ->SetText( OUString::number( aDocStat.nFormulaCount ) );
m_xFrame->set_label(aInfo);
m_xFtTables->set_label( OUString::number( aDocStat.nTableCount ) );
m_xFtCells->set_label( OUString::number( aDocStat.nCellCount ) );
m_xFtPages->set_label( OUString::number( aDocStat.nPageCount ) );
m_xFtFormula->set_label( OUString::number( aDocStat.nFormulaCount ) );
}
ScDocStatPage::~ScDocStatPage()
{
disposeOnce();
}
void ScDocStatPage::dispose()
{
m_pFtTables.clear();
m_pFtCells.clear();
m_pFtPages.clear();
m_pFtFormula.clear();
SfxTabPage::dispose();
}
bool ScDocStatPage::FillItemSet( SfxItemSet* /* rSet */ )
{
return false;
......
......@@ -21,7 +21,6 @@
#define INCLUDED_SC_SOURCE_UI_INC_TPSTAT_HXX
#include <sfx2/tabdlg.hxx>
#include <vcl/fixed.hxx>
class ScDocStatPage: public SfxTabPage
{
......@@ -29,19 +28,19 @@ class ScDocStatPage: public SfxTabPage
public:
static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet );
virtual ~ScDocStatPage() override;
virtual void dispose() override;
private:
ScDocStatPage( vcl::Window *pParent, const SfxItemSet& rSet );
ScDocStatPage(TabPageParent pParent, const SfxItemSet& rSet);
protected:
virtual bool FillItemSet( SfxItemSet* rSet ) override;
virtual void Reset ( const SfxItemSet* rSet ) override;
private:
VclPtr<FixedText> m_pFtTables;
VclPtr<FixedText> m_pFtCells;
VclPtr<FixedText> m_pFtPages;
VclPtr<FixedText> m_pFtFormula;
std::unique_ptr<weld::Label> m_xFtTables;
std::unique_ptr<weld::Label> m_xFtCells;
std::unique_ptr<weld::Label> m_xFtPages;
std::unique_ptr<weld::Label> m_xFtFormula;
std::unique_ptr<weld::Frame> m_xFrame;
};
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment