filters
- filters
- kspread
- excel
- sidewinder
29using namespace Swinder;
31class Workbook::Private
34 std::vector<Sheet*> sheets;
36 bool passwordProtected;
37 std::map<int,Format> formats;
43 d = new Workbook::Private();
45 d->passwordProtected = false;
46 d->maxFormatIndex = 0;
58 for( unsigned i=0; i<sheetCount(); i++ )
60 Sheet* s = sheet( i );
66bool Workbook::load( const char* filename )
68 ExcelReader* reader = new ExcelReader;
69 bool result = reader->load( this, filename );
74void Workbook::appendSheet( Sheet* sheet )
76 d->sheets.push_back( sheet );
79unsigned Workbook::sheetCount() const
81 return d->sheets.size();
84Sheet* Workbook::sheet( unsigned index )
86 if( index >= sheetCount() ) return (Sheet*)0;
87 return d->sheets[index];
90int Workbook::indexOf( Sheet *s )
93 for( unsigned i = 0; i < sheetCount(); i++ )
94 if( d->sheets[i] == s )
100bool Workbook::autoCalc() const
105void Workbook::setAutoCalc( bool a )
110void Workbook::setFormat( int index, const Format& format )
112 d->formats[index] = format;
113 if (index > d->maxFormatIndex)
114 d->maxFormatIndex = index;
117const Format& Workbook::format( int index ) const
119 return d->formats[index];
122const int Workbook::maxFormatIndex() const
124 return d->maxFormatIndex;
127bool Workbook::isPasswordProtected() const
129 return d->passwordProtected;
132void Workbook::setPasswordProtected( bool p )
134 d->passwordProtected = p;
|