xref: /trunk/main/sc/source/ui/docshell/tpstat.cxx (revision a479921a)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_scui.hxx"
26 
27 
28 
29 
30 #include "document.hxx"
31 #include "docsh.hxx"
32 #include "scresid.hxx"
33 #include "tpstat.hrc"
34 
35 #include "tpstat.hxx"
36 
37 
38 //========================================================================
39 // Dokumentinfo-Tabpage:
40 //========================================================================
41 
Create(Window * pParent,const SfxItemSet & rSet)42 SfxTabPage* __EXPORT ScDocStatPage::Create( Window *pParent, const SfxItemSet& rSet )
43 {
44 	return new ScDocStatPage( pParent, rSet );
45 }
46 
47 //------------------------------------------------------------------------
48 
ScDocStatPage(Window * pParent,const SfxItemSet & rSet)49 ScDocStatPage::ScDocStatPage( Window *pParent, const SfxItemSet& rSet )
50 	:	SfxTabPage( pParent, ScResId(RID_SCPAGE_STAT), rSet ),
51         aFlInfo         ( this, ScResId( FL_INFO ) ),
52 		aFtTablesLbl	( this, ScResId( FT_TABLES_LBL ) ),
53 		aFtTables		( this, ScResId( FT_TABLES ) ),
54 		aFtCellsLbl		( this, ScResId( FT_CELLS_LBL ) ),
55 		aFtCells		( this, ScResId( FT_CELLS ) ),
56 		aFtPagesLbl		( this, ScResId( FT_PAGES_LBL ) ),
57 		aFtPages		( this, ScResId( FT_PAGES ) )
58 {
59 	ScDocShell* pDocSh = PTR_CAST( ScDocShell, SfxObjectShell::Current() );
60 	ScDocStat	aDocStat;
61 
62 	if ( pDocSh )
63 		pDocSh->GetDocStat( aDocStat );
64 
65     String aInfo = aFlInfo.GetText();
66 	aInfo += aDocStat.aDocName;
67     aFlInfo     .SetText( aInfo );
68 	aFtTables	.SetText( String::CreateFromInt32( aDocStat.nTableCount ) );
69 	aFtCells	.SetText( String::CreateFromInt32( aDocStat.nCellCount ) );
70 	aFtPages	.SetText( String::CreateFromInt32( aDocStat.nPageCount ) );
71 
72 	FreeResource();
73 }
74 
75 //------------------------------------------------------------------------
76 
~ScDocStatPage()77 __EXPORT ScDocStatPage::~ScDocStatPage()
78 {
79 }
80 
81 //------------------------------------------------------------------------
82 
FillItemSet(SfxItemSet &)83 sal_Bool __EXPORT ScDocStatPage::FillItemSet( SfxItemSet& /* rSet */ )
84 {
85 	return sal_False;
86 }
87 
88 //------------------------------------------------------------------------
89 
Reset(const SfxItemSet &)90 void __EXPORT ScDocStatPage::Reset( const SfxItemSet& /* rSet */ )
91 {
92 }
93 
94 
95 
96 
97