diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-03-27 05:14:06 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-03-27 05:18:10 +0200 |
commit | 5d123a0b0e827aba59ddb50ef1b961a529a34a15 (patch) | |
tree | 7534f3275d5de37ba5b51d321a81394d87f59b85 | |
parent | 06c16e1e26a0137a0048085cdf1c7758d3ac96cd (diff) |
export all style information to xls/xlsx, fdo#46738
Fixes that if more than 84 empty but formatted rows at the end of a file
have been found the export skipped those rows.
-rw-r--r-- | sc/inc/attarray.hxx | 2 | ||||
-rw-r--r-- | sc/inc/column.hxx | 2 | ||||
-rw-r--r-- | sc/inc/document.hxx | 1 | ||||
-rw-r--r-- | sc/inc/table.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/attarray.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/data/column2.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/data/document.cxx | 13 | ||||
-rw-r--r-- | sc/source/core/data/table1.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/excel/xetable.cxx | 2 |
9 files changed, 24 insertions, 10 deletions
diff --git a/sc/inc/attarray.hxx b/sc/inc/attarray.hxx index 706a1c0c28ff..c6d2affad78b 100644 --- a/sc/inc/attarray.hxx +++ b/sc/inc/attarray.hxx @@ -173,7 +173,7 @@ public: bool IsEmpty() const; bool GetFirstVisibleAttr( SCROW& rFirstRow ) const; - bool GetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData ) const; + bool GetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData, bool bFullFormattedArea = false ) const; bool HasVisibleAttrIn( SCROW nStartRow, SCROW nEndRow ) const; bool IsVisibleEqual( const ScAttrArray& rOther, SCROW nStartRow, SCROW nEndRow ) const; diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index e5030052bce2..4988ffcf6616 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -182,7 +182,7 @@ public: bool HasSelectionMatrixFragment(const ScMarkData& rMark) const; bool GetFirstVisibleAttr( SCROW& rFirstRow ) const; - bool GetLastVisibleAttr( SCROW& rLastRow ) const; + bool GetLastVisibleAttr( SCROW& rLastRow, bool bFullFormattedArea = false ) const; bool HasVisibleAttrIn( SCROW nStartRow, SCROW nEndRow ) const; bool IsVisibleAttrEqual( const ScColumn& rCol, SCROW nStartRow = 0, SCROW nEndRow = MAXROW ) const; diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 0d63e3bad1e6..bc48fabe39d9 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -935,6 +935,7 @@ public: SCCOL& rEndCol, SCROW& rEndRow, bool bIncludeOld, bool bOnlyDown ) const; SC_DLLPUBLIC bool GetCellArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const; SC_DLLPUBLIC bool GetTableArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const; + SC_DLLPUBLIC void GetFormattedAndUsedArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const; SC_DLLPUBLIC bool GetPrintArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow, bool bNotes = true ) const; SC_DLLPUBLIC bool GetPrintAreaHor( SCTAB nTab, SCROW nStartRow, SCROW nEndRow, diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index b99caf8e1589..cec3676f7dd0 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -401,7 +401,7 @@ public: bool GetCellArea( SCCOL& rEndCol, SCROW& rEndRow ) const; // FALSE = empty bool GetTableArea( SCCOL& rEndCol, SCROW& rEndRow ) const; - bool GetPrintArea( SCCOL& rEndCol, SCROW& rEndRow, bool bNotes ) const; + bool GetPrintArea( SCCOL& rEndCol, SCROW& rEndRow, bool bNotes, bool bFullFormattedArea = false ) const; bool GetPrintAreaHor( SCROW nStartRow, SCROW nEndRow, SCCOL& rEndCol, bool bNotes ) const; bool GetPrintAreaVer( SCCOL nStartCol, SCCOL nEndCol, diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index 3b0c9231ebf1..72d08fc0013b 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -1760,7 +1760,7 @@ bool ScAttrArray::GetFirstVisibleAttr( SCROW& rFirstRow ) const const SCROW SC_VISATTR_STOP = 84; -bool ScAttrArray::GetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData ) const +bool ScAttrArray::GetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData, bool bFullFormattedArea ) const { // #i30830# changed behavior: // ignore all attributes starting with the first run of SC_VISATTR_STOP equal rows @@ -1791,7 +1791,7 @@ bool ScAttrArray::GetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData ) const if ( nAttrStartRow <= nLastData ) nAttrStartRow = nLastData + 1; SCROW nAttrSize = pData[nEndPos].nRow + 1 - nAttrStartRow; - if ( nAttrSize >= SC_VISATTR_STOP ) + if ( nAttrSize >= SC_VISATTR_STOP && !bFullFormattedArea ) { bFound = false; // ignore this range and below } diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 1ca582dec35d..393e18e7d1fd 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -1429,14 +1429,14 @@ bool ScColumn::GetFirstVisibleAttr( SCROW& rFirstRow ) const return false; } -bool ScColumn::GetLastVisibleAttr( SCROW& rLastRow ) const +bool ScColumn::GetLastVisibleAttr( SCROW& rLastRow, bool bFullFormattedArea ) const { if (pAttrArray) { // row of last cell is needed SCROW nLastData = GetLastVisDataPos(); // always including notes, 0 if none - return pAttrArray->GetLastVisibleAttr( rLastRow, nLastData ); + return pAttrArray->GetLastVisibleAttr( rLastRow, nLastData, bFullFormattedArea ); } else return false; diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 60ba8189ff73..6e21d910cb3a 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -952,6 +952,19 @@ bool ScDocument::GetTableArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) cons return false; } +void ScDocument::GetFormattedAndUsedArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const +{ + if (VALIDTAB(nTab) && nTab < static_cast<SCTAB> (maTabs.size())) + if (maTabs[nTab]) + { + maTabs[nTab]->GetPrintArea( rEndCol, rEndRow, true, true ); + return; + } + + rEndCol = 0; + rEndRow = 0; +} + bool ScDocument::ShrinkToDataArea(SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow) const { if (!ValidTab(nTab) || nTab >= static_cast<SCTAB> (maTabs.size()) || !maTabs[nTab]) diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index ccae115633c2..31bf5a655c5e 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -568,7 +568,7 @@ bool ScTable::GetTableArea( SCCOL& rEndCol, SCROW& rEndRow ) const const SCCOL SC_COLUMNS_STOP = 30; -bool ScTable::GetPrintArea( SCCOL& rEndCol, SCROW& rEndRow, bool bNotes ) const +bool ScTable::GetPrintArea( SCCOL& rEndCol, SCROW& rEndRow, bool bNotes, bool bFullFormattedArea ) const { bool bFound = false; SCCOL nMaxX = 0; @@ -605,7 +605,7 @@ bool ScTable::GetPrintArea( SCCOL& rEndCol, SCROW& rEndRow, bool bNotes ) const for (i=0; i<=MAXCOL; i++) // Attribute testen { SCROW nLastRow; - if (aCol[i].GetLastVisibleAttr( nLastRow )) + if (aCol[i].GetLastVisibleAttr( nLastRow, bFullFormattedArea )) { bFound = true; nMaxX = i; diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index 955425e870c1..e56942690757 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -2185,7 +2185,7 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) : // find used area (non-empty cells) SCCOL nLastUsedScCol; SCROW nLastUsedScRow; - rDoc.GetTableArea( nScTab, nLastUsedScCol, nLastUsedScRow ); + rDoc.GetFormattedAndUsedArea( nScTab, nLastUsedScCol, nLastUsedScRow ); ScRange aUsedRange( 0, 0, nScTab, nLastUsedScCol, nLastUsedScRow, nScTab ); GetAddressConverter().ValidateRange( aUsedRange, true ); |