Add worksheet dimenstion access API

first/last Row/Column
This commit is contained in:
Debao Zhang
2013-10-28 10:08:09 +08:00
parent a54c4433cd
commit 3fefbb2235
3 changed files with 144 additions and 0 deletions
+62
View File
@@ -892,6 +892,68 @@ bool Worksheet::setColumn(int colFirst, int colLast, double width, Format *forma
return true;
}
/*!
* Returns the first row in the sheet that contains a used cell.
*/
int Worksheet::firstRow() const
{
Q_D(const Worksheet);
if (d->dim_rowmax == INT32_MIN) {
//Row dimenstion isn't set.
return 0;
} else {
return d->dim_rowmin;
}
}
/*!
* Returns the zero-based index of the row after the last row in
* the sheet that contains a used cell.
*/
int Worksheet::lastRow() const
{
Q_D(const Worksheet);
if (d->dim_rowmax == INT32_MIN) {
//Row dimenstion isn't set.
return 0;
} else {
return d->dim_rowmax + 1;
}
}
/*!
* Returns the first column in the sheet that contains a used cell.
*/
int Worksheet::firstColumn() const
{
Q_D(const Worksheet);
if (d->dim_colmax == INT32_MIN) {
//Col dimenstion isn't set.
return 0;
} else {
return d->dim_colmin;
}
}
/*!
* Returns the zero-based index of the column after the last column
* in the sheet that contains a used cell.
*/
int Worksheet::lastColumn() const
{
Q_D(const Worksheet);
if (d->dim_colmax == INT32_MIN) {
//Col dimenstion isn't set.
return 0;
} else {
return d->dim_colmax + 1;
}
}
Drawing *Worksheet::drawing() const
{
Q_D(const Worksheet);
+5
View File
@@ -74,6 +74,11 @@ public:
bool setRow(int row, double height, Format* format=0, bool hidden=false);
bool setColumn(int colFirst, int colLast, double width, Format* format=0, bool hidden=false);
int firstRow() const;
int lastRow() const;
int firstColumn() const;
int lastColumn() const;
void setRightToLeft(bool enable);
void setZeroValuesHidden(bool enable);