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 @@ ...@@ -30,48 +30,37 @@
VclPtr<SfxTabPage> ScDocStatPage::Create( TabPageParent pParent, const SfxItemSet* rSet ) 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 ) ScDocStatPage::ScDocStatPage(TabPageParent pParent, const SfxItemSet& rSet)
: SfxTabPage( pParent, "StatisticsInfoPage", "modules/scalc/ui/statisticsinfopage.ui", &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() ); ScDocShell* pDocSh = dynamic_cast<ScDocShell*>( SfxObjectShell::Current() );
ScDocStat aDocStat; ScDocStat aDocStat;
if ( pDocSh ) if ( pDocSh )
pDocSh->GetDocStat( aDocStat ); pDocSh->GetDocStat( aDocStat );
VclFrame *pFrame = get<VclFrame>("StatisticsInfoPage"); OUString aInfo = m_xFrame->get_label();
OUString aInfo = pFrame->get_label();
aInfo += aDocStat.aDocName; aInfo += aDocStat.aDocName;
pFrame->set_label(aInfo); m_xFrame->set_label(aInfo);
m_pFtTables ->SetText( OUString::number( aDocStat.nTableCount ) ); m_xFtTables->set_label( OUString::number( aDocStat.nTableCount ) );
m_pFtCells ->SetText( OUString::number( aDocStat.nCellCount ) ); m_xFtCells->set_label( OUString::number( aDocStat.nCellCount ) );
m_pFtPages ->SetText( OUString::number( aDocStat.nPageCount ) ); m_xFtPages->set_label( OUString::number( aDocStat.nPageCount ) );
m_pFtFormula ->SetText( OUString::number( aDocStat.nFormulaCount ) ); m_xFtFormula->set_label( OUString::number( aDocStat.nFormulaCount ) );
} }
ScDocStatPage::~ScDocStatPage() 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 */ ) bool ScDocStatPage::FillItemSet( SfxItemSet* /* rSet */ )
{ {
return false; return false;
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#define INCLUDED_SC_SOURCE_UI_INC_TPSTAT_HXX #define INCLUDED_SC_SOURCE_UI_INC_TPSTAT_HXX
#include <sfx2/tabdlg.hxx> #include <sfx2/tabdlg.hxx>
#include <vcl/fixed.hxx>
class ScDocStatPage: public SfxTabPage class ScDocStatPage: public SfxTabPage
{ {
...@@ -29,19 +28,19 @@ class ScDocStatPage: public SfxTabPage ...@@ -29,19 +28,19 @@ class ScDocStatPage: public SfxTabPage
public: public:
static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet );
virtual ~ScDocStatPage() override; virtual ~ScDocStatPage() override;
virtual void dispose() override;
private: private:
ScDocStatPage( vcl::Window *pParent, const SfxItemSet& rSet ); ScDocStatPage(TabPageParent pParent, const SfxItemSet& rSet);
protected: protected:
virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual bool FillItemSet( SfxItemSet* rSet ) override;
virtual void Reset ( const SfxItemSet* rSet ) override; virtual void Reset ( const SfxItemSet* rSet ) override;
private: private:
VclPtr<FixedText> m_pFtTables; std::unique_ptr<weld::Label> m_xFtTables;
VclPtr<FixedText> m_pFtCells; std::unique_ptr<weld::Label> m_xFtCells;
VclPtr<FixedText> m_pFtPages; std::unique_ptr<weld::Label> m_xFtPages;
VclPtr<FixedText> m_pFtFormula; std::unique_ptr<weld::Label> m_xFtFormula;
std::unique_ptr<weld::Frame> m_xFrame;
}; };
#endif #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