xref: /aoo4110/main/sc/source/ui/docshell/tpstat.cxx (revision b1cdbd2c)
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_sc.hxx"
26 
27 #undef SC_DLLIMPLEMENTATION
28 
29 
30 
31 #include "document.hxx"
32 #include "docsh.hxx"
33 #include "scresid.hxx"
34 #include "tpstat.hrc"
35 
36 #include "tpstat.hxx"
37 
38 
39 //========================================================================
40 // Dokumentinfo-Tabpage:
41 //========================================================================
42 
Create(Window * pParent,const SfxItemSet & rSet)43 SfxTabPage* __EXPORT ScDocStatPage::Create( Window *pParent, const SfxItemSet& rSet )
44 {
45 	return new ScDocStatPage( pParent, rSet );
46 }
47 
48 //------------------------------------------------------------------------
49 
ScDocStatPage(Window * pParent,const SfxItemSet & rSet)50 ScDocStatPage::ScDocStatPage( Window *pParent, const SfxItemSet& rSet )
51 	:	SfxTabPage( pParent, ScResId(RID_SCPAGE_STAT), rSet ),
52         aFlInfo         ( this, ScResId( FL_INFO ) ),
53 		aFtTablesLbl	( this, ScResId( FT_TABLES_LBL ) ),
54 		aFtTables		( this, ScResId( FT_TABLES ) ),
55 		aFtCellsLbl		( this, ScResId( FT_CELLS_LBL ) ),
56 		aFtCells		( this, ScResId( FT_CELLS ) ),
57 		aFtPagesLbl		( this, ScResId( FT_PAGES_LBL ) ),
58 		aFtPages		( this, ScResId( FT_PAGES ) )
59 {
60 	ScDocShell* pDocSh = PTR_CAST( ScDocShell, SfxObjectShell::Current() );
61 	ScDocStat	aDocStat;
62 
63 	if ( pDocSh )
64 		pDocSh->GetDocStat( aDocStat );
65 
66     String aInfo = aFlInfo.GetText();
67 	aInfo += aDocStat.aDocName;
68     aFlInfo     .SetText( aInfo );
69 	aFtTables	.SetText( String::CreateFromInt32( aDocStat.nTableCount ) );
70 	aFtCells	.SetText( String::CreateFromInt32( aDocStat.nCellCount ) );
71 	aFtPages	.SetText( String::CreateFromInt32( aDocStat.nPageCount ) );
72 
73 	FreeResource();
74 }
75 
76 //------------------------------------------------------------------------
77 
~ScDocStatPage()78 __EXPORT ScDocStatPage::~ScDocStatPage()
79 {
80 }
81 
82 //------------------------------------------------------------------------
83 
FillItemSet(SfxItemSet &)84 sal_Bool __EXPORT ScDocStatPage::FillItemSet( SfxItemSet& /* rSet */ )
85 {
86 	return sal_False;
87 }
88 
89 //------------------------------------------------------------------------
90 
Reset(const SfxItemSet &)91 void __EXPORT ScDocStatPage::Reset( const SfxItemSet& /* rSet */ )
92 {
93 }
94 
95 
96 
97 
98