diff options
author | Daniel Bankston <daniel.e.bankston@gmail.com> | 2012-06-09 06:53:23 -0500 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-06-17 17:04:04 +0200 |
commit | 62cab9f5d3852b5baf7fcffb513e7c3e45b191bb (patch) | |
tree | f9ec54438f3d9c7df5d69cd88f6f8887fd29362d /sc | |
parent | 1f2c836e7a93ace9deb1b05bdb5f1a2ff7a42fd2 (diff) |
Remove unused variables and parameters
Change-Id: I8691529e6260ea4d9e9d1d61ce3b1b28de7a676e
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/xml/xmlcelli.cxx | 80 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlcelli.hxx | 6 |
2 files changed, 34 insertions, 52 deletions
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 378de91e682f..95af7109745c 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -812,7 +812,7 @@ void ScXMLTableRowCellContext::AddTextCellToDoc( const ScAddress& rScCurrentPos, bool bDoIncrement = true; if( rXMLImport.GetTables().IsPartOfMatrix(rScCurrentPos.Col(), rScCurrentPos.Row()) ) { - LockSolarMutex(); + LockSolarMutex(); //is this still needed? ScBaseCell* pCell = rXMLImport.GetDocument()->GetCell( rScCurrentPos ); bDoIncrement = ( pCell && pCell->GetCellType() == CELLTYPE_FORMULA ); if ( bDoIncrement ) @@ -830,7 +830,7 @@ void ScXMLTableRowCellContext::AddTextCellToDoc( const ScAddress& rScCurrentPos, } else { - LockSolarMutex(); + LockSolarMutex(); //is this still needed? ScBaseCell* pNewCell = NULL; ScDocument* pDoc = rXMLImport.GetDocument(); if (pOUTextValue && !pOUTextValue->isEmpty()) @@ -856,14 +856,14 @@ void ScXMLTableRowCellContext::AddNumberCellToDoc( const ScAddress& rScCurrentPo { if( rXMLImport.GetTables().IsPartOfMatrix(rScCurrentPos.Col(), rScCurrentPos.Row()) ) { - LockSolarMutex(); + LockSolarMutex(); //is this still needed? ScBaseCell* pCell = rXMLImport.GetDocument()->GetCell( rScCurrentPos ); if ( pCell && pCell->GetCellType() == CELLTYPE_FORMULA ) static_cast<ScFormulaCell*>(pCell)->SetHybridDouble( fValue ); } else { - LockSolarMutex(); + LockSolarMutex(); //is this still needed? // #i62435# Initialize the value cell's script type // if the default style's number format is latin-only. @@ -975,13 +975,13 @@ bool ScXMLTableRowCellContext::CellsAreRepeated() const return ( (nColsRepeated > 1) || (nRepeatedRows > 1) ); } -void ScXMLTableRowCellContext::AddNonFormulaCells( const ScAddress& rScCellPos, const uno::Reference<table::XCellRange>& xCellRange ) +void ScXMLTableRowCellContext::AddNonFormulaCells( const ScAddress& rScCellPos ) { ::boost::optional< rtl::OUString > pOUText; if( nCellType == util::NumberFormat::TEXT ) { - if( xLockable.is() ) + if( xLockable.is() ) //is this still needed? xLockable->removeActionLock(); // #i61702# The formatted text content of xBaseCell / xLockable is invalidated, @@ -1019,7 +1019,7 @@ void ScXMLTableRowCellContext::AddNonFormulaCells( const ScAddress& rScCellPos, void ScXMLTableRowCellContext::AddNonMatrixFormulaCell( const ScAddress& rScCellPos ) { - LockSolarMutex(); + LockSolarMutex(); //is this still needed ScDocument* pDoc = rXMLImport.GetDocument(); @@ -1080,42 +1080,30 @@ void ScXMLTableRowCellContext::AddNonMatrixFormulaCell( const ScAddress& rScCell } } -void ScXMLTableRowCellContext::AddFormulaCell( const ScAddress& rScCellPos, const uno::Reference<table::XCellRange>& xCellRange ) +void ScXMLTableRowCellContext::AddFormulaCell( const ScAddress& rScCellPos ) { if( scCellExists(rScCellPos) ) { - uno::Reference <table::XCell> xCell; - try - { - xCell.set(xCellRange->getCellByPosition(rScCellPos.Col() , rScCellPos.Row())); - } - catch (lang::IndexOutOfBoundsException&) - { - OSL_FAIL("It seems here are to many columns or rows"); - } - if( xCell.is() ) + SetContentValidation( rScCellPos ); + OSL_ENSURE(((nColsRepeated == 1) && (nRepeatedRows == 1)), "repeated cells with formula not possible now"); + rXMLImport.GetStylesImportHelper()->AddCell(rScCellPos); + if (!bIsMatrix) + AddNonMatrixFormulaCell( rScCellPos ); + else { - SetContentValidation( rScCellPos ); - OSL_ENSURE(((nColsRepeated == 1) && (nRepeatedRows == 1)), "repeated cells with formula not possible now"); - rXMLImport.GetStylesImportHelper()->AddCell(rScCellPos); - if (!bIsMatrix) - AddNonMatrixFormulaCell( rScCellPos ); - else + if (nMatrixCols > 0 && nMatrixRows > 0) { - if (nMatrixCols > 0 && nMatrixRows > 0) - { - rXMLImport.GetTables().AddMatrixRange( - rScCellPos.Col(), rScCellPos.Row(), - rScCellPos.Col() + nMatrixCols - 1, - rScCellPos.Row() + nMatrixRows - 1, - pOUFormula->first, pOUFormula->second, eGrammar); - } + rXMLImport.GetTables().AddMatrixRange( + rScCellPos.Col(), rScCellPos.Row(), + rScCellPos.Col() + nMatrixCols - 1, + rScCellPos.Row() + nMatrixRows - 1, + pOUFormula->first, pOUFormula->second, eGrammar); } - SetAnnotation( rScCellPos ); - SetDetectiveObj( rScCellPos ); - SetCellRangeSource( rScCellPos ); - rXMLImport.ProgressBarIncrement(false); } + SetAnnotation( rScCellPos ); + SetDetectiveObj( rScCellPos ); + SetCellRangeSource( rScCellPos ); + rXMLImport.ProgressBarIncrement(false); } else { @@ -1147,18 +1135,14 @@ void ScXMLTableRowCellContext::EndElement() ScAddress aScCellPos = rXMLImport.GetTables().GetRealScCellPos(); if( aScCellPos.Col() > 0 && nRepeatedRows > 1 ) aScCellPos.SetRow( aScCellPos.Row() - (nRepeatedRows - 1) ); - - uno::Reference<table::XCellRange> xCellRange( rXMLImport.GetTables().GetCurrentXCellRange() ); - if( xCellRange.is() ) - { - if( bIsMerged ) - DoMerge( aScCellPos, nMergedCols - 1, nMergedRows - 1 ); - if( !pOUFormula ) - AddNonFormulaCells( aScCellPos, xCellRange ); - else // if ( pOUFormula ) - AddFormulaCell( aScCellPos, xCellRange ); - } - UnlockSolarMutex(); + if( bIsMerged ) + DoMerge( aScCellPos, nMergedCols - 1, nMergedRows - 1 ); + if( !pOUFormula ) + AddNonFormulaCells( aScCellPos ); + else // if ( pOUFormula ) + AddFormulaCell( aScCellPos ); + + UnlockSolarMutex(); //is this still needed? } bIsMerged = false; bHasSubTable = false; diff --git a/sc/source/filter/xml/xmlcelli.hxx b/sc/source/filter/xml/xmlcelli.hxx index 11914b2c4434..978c9c102d94 100644 --- a/sc/source/filter/xml/xmlcelli.hxx +++ b/sc/source/filter/xml/xmlcelli.hxx @@ -101,11 +101,9 @@ class ScXMLTableRowCellContext : public SvXMLImportContext void AddNumberCellToDoc ( const ScAddress& rScCurrentPos ); void AddCellsToTable ( const ScAddress& rScCellPos, const ::boost::optional< rtl::OUString >& pOUText, ScAddress& rScCurrentPos ); - void AddNonFormulaCells ( const ScAddress& rScCellPos, - const com::sun::star::uno::Reference<com::sun::star::table::XCellRange>& xCellRange ); + void AddNonFormulaCells ( const ScAddress& rScCellPos ); void AddNonMatrixFormulaCell ( const ScAddress& rScCurrentPos ); - void AddFormulaCell ( const ScAddress& rScCellPos, - const com::sun::star::uno::Reference<com::sun::star::table::XCellRange>& xCellRange ); + void AddFormulaCell ( const ScAddress& rScCellPos ); public: |