diff options
author | Daniel Bankston <daniel.e.bankston@gmail.com> | 2012-06-18 16:04:36 -0500 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-06-20 11:01:25 +0200 |
commit | 2636b44b1d7148ebcbf678c3e01f06875164ac02 (patch) | |
tree | 374acadd602e48dc9863329ae883a49fd51a45b8 /sc | |
parent | f012dba24249f1a500613de0fabf4f847534da5c (diff) |
Use better variable and method names for ScMyTables current cell position
Change-Id: Icdefd17751b61e9c27e3ab4468691bba08e245c0
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/xml/XMLDetectiveContext.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlcelli.cxx | 8 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlsubti.cxx | 46 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlsubti.hxx | 10 |
4 files changed, 33 insertions, 33 deletions
diff --git a/sc/source/filter/xml/XMLDetectiveContext.cxx b/sc/source/filter/xml/XMLDetectiveContext.cxx index e669dae64d46..fbe214300824 100644 --- a/sc/source/filter/xml/XMLDetectiveContext.cxx +++ b/sc/source/filter/xml/XMLDetectiveContext.cxx @@ -241,7 +241,7 @@ ScXMLDetectiveOperationContext::ScXMLDetectiveOperationContext( break; } } - aDetectiveOp.aPosition = rImport.GetTables().GetRealScCellPos(); + aDetectiveOp.aPosition = rImport.GetTables().GetCurrentCellPos(); } ScXMLDetectiveOperationContext::~ScXMLDetectiveOperationContext() diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 6d03fad9ca75..328b8ddbf423 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -299,7 +299,7 @@ bool cellExists( const ScAddress& rCellPos ) void ScXMLTableRowCellContext::SetCursorOnTextImport(const rtl::OUString& rOUTempText) { - ScAddress aCellPos = rXMLImport.GetTables().GetRealScCellPos(); + ScAddress aCellPos = rXMLImport.GetTables().GetCurrentCellPos(); if (cellExists(aCellPos)) { sal_Int32 nCol = static_cast<sal_Int32>( aCellPos.Col() ); @@ -349,7 +349,7 @@ SvXMLImportContext *ScXMLTableRowCellContext::CreateChildContext( sal_uInt16 nPr bIsEmpty = false; bTextP = true; - ScAddress aCellPos = rXMLImport.GetTables().GetRealScCellPos(); + ScAddress aCellPos = rXMLImport.GetTables().GetCurrentCellPos(); if( ((nCellType == util::NumberFormat::TEXT) || bFormulaTextResult) && !rXMLImport.GetTables().IsPartOfMatrix(aCellPos.Col(), aCellPos.Row()) ) @@ -427,7 +427,7 @@ SvXMLImportContext *ScXMLTableRowCellContext::CreateChildContext( sal_uInt16 nPr if (!pContext && !bTextP) { - ScAddress aCellPos = rXMLImport.GetTables().GetRealScCellPos(); + ScAddress aCellPos = rXMLImport.GetTables().GetCurrentCellPos(); uno::Reference<drawing::XShapes> xShapes (rXMLImport.GetTables().GetCurrentXShapes()); if (xShapes.is()) { @@ -1098,7 +1098,7 @@ void ScXMLTableRowCellContext::EndElement() } } - ScAddress aCellPos = rXMLImport.GetTables().GetRealScCellPos(); + ScAddress aCellPos = rXMLImport.GetTables().GetCurrentCellPos(); if( aCellPos.Col() > 0 && nRepeatedRows > 1 ) aCellPos.SetRow( aCellPos.Row() - (nRepeatedRows - 1) ); if( bIsMerged ) diff --git a/sc/source/filter/xml/xmlsubti.cxx b/sc/source/filter/xml/xmlsubti.cxx index feb8435a985f..662f278f16f0 100644 --- a/sc/source/filter/xml/xmlsubti.cxx +++ b/sc/source/filter/xml/xmlsubti.cxx @@ -74,7 +74,7 @@ ScXMLTabProtectionData::ScXMLTabProtectionData() : ScMyTables::ScMyTables(ScXMLImport& rTempImport) : rImport(rTempImport), aFixupOLEs(rTempImport), - maCellPos(ScAddress::INITIALIZE_INVALID), + maCurrentCellPos(ScAddress::INITIALIZE_INVALID), nCurrentColStylePos(0), nCurrentDrawPage( -1 ), nCurrentXShapes( -1 ) @@ -116,22 +116,22 @@ void ScMyTables::NewSheet(const rtl::OUString& sTableName, const rtl::OUString& nCurrentColStylePos = 0; sCurrentSheetName = sTableName; //reset cols and rows for new sheet, but increment tab - maCellPos.SetCol(-1); - maCellPos.SetRow(-1); - maCellPos.SetTab(maCellPos.Tab() + 1); + maCurrentCellPos.SetCol(-1); + maCurrentCellPos.SetRow(-1); + maCurrentCellPos.SetTab(maCurrentCellPos.Tab() + 1); maProtectionData = rProtectData; ScDocument *pDoc = ScXMLConverter::GetScDocument(rImport.GetModel()); // The document contains one sheet when created. So for the first // sheet, we only need to set its name. - if (maCellPos.Tab() > 0) + if (maCurrentCellPos.Tab() > 0) pDoc->AppendTabOnLoad(sTableName); else - pDoc->SetTabNameOnLoad(maCellPos.Tab(), sTableName); + pDoc->SetTabNameOnLoad(maCurrentCellPos.Tab(), sTableName); rImport.SetTableStyle(sStyleName); - xCurrentSheet = getCurrentSheet(rImport.GetModel(), maCellPos.Tab()); + xCurrentSheet = getCurrentSheet(rImport.GetModel(), maCurrentCellPos.Tab()); if (xCurrentSheet.is()) { // We need to set the current cell range here regardless of @@ -172,7 +172,7 @@ void ScMyTables::SetTableStyle(const rtl::OUString& sStyleName) pStyle->FillPropertySet(xProperties); ScSheetSaveData* pSheetData = ScModelObj::getImplementation(rImport.GetModel())->GetSheetSaveData(); - pSheetData->AddTableStyle( sStyleName, ScAddress( 0, 0, maCellPos.Tab() ) ); + pSheetData->AddTableStyle( sStyleName, ScAddress( 0, 0, maCurrentCellPos.Tab() ) ); } } } @@ -182,8 +182,8 @@ void ScMyTables::SetTableStyle(const rtl::OUString& sStyleName) void ScMyTables::AddRow() { - maCellPos.SetRow(maCellPos.Row() + 1); - maCellPos.SetCol(-1); //reset columns for new row + maCurrentCellPos.SetRow(maCurrentCellPos.Row() + 1); + maCurrentCellPos.SetCol(-1); //reset columns for new row } void ScMyTables::SetRowStyle(const rtl::OUString& rCellStyleName) @@ -193,11 +193,11 @@ void ScMyTables::SetRowStyle(const rtl::OUString& rCellStyleName) void ScMyTables::AddColumn(bool bIsCovered) { - maCellPos.SetCol( maCellPos.Col() + 1 ); + maCurrentCellPos.SetCol( maCurrentCellPos.Col() + 1 ); //here only need to set column style if this is the first row and //the cell is not covered. - if(maCellPos.Row() == 0 && !bIsCovered) - rImport.GetStylesImportHelper()->InsertCol(maCellPos.Col(), maCellPos.Tab(), rImport.GetDocument()); + if(maCurrentCellPos.Row() == 0 && !bIsCovered) + rImport.GetStylesImportHelper()->InsertCol(maCurrentCellPos.Col(), maCurrentCellPos.Tab(), rImport.GetDocument()); } void ScMyTables::UpdateRowHeights() @@ -274,7 +274,7 @@ void ScMyTables::DeleteTable() pProtect->setPasswordHash(aHash, maProtectionData.meHash1, maProtectionData.meHash2); pProtect->setOption(ScTableProtection::SELECT_LOCKED_CELLS, maProtectionData.mbSelectProtectedCells); pProtect->setOption(ScTableProtection::SELECT_UNLOCKED_CELLS, maProtectionData.mbSelectUnprotectedCells); - rImport.GetDocument()->SetTabProtection(maCellPos.Tab(), pProtect.get()); + rImport.GetDocument()->SetTabProtection(maCurrentCellPos.Tab(), pProtect.get()); } } @@ -286,24 +286,24 @@ void ScMyTables::AddColStyle(const sal_Int32 nRepeat, const rtl::OUString& rCell uno::Reference< drawing::XDrawPage > ScMyTables::GetCurrentXDrawPage() { - if( (maCellPos.Tab() != nCurrentDrawPage) || !xDrawPage.is() ) + if( (maCurrentCellPos.Tab() != nCurrentDrawPage) || !xDrawPage.is() ) { uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier( xCurrentSheet, uno::UNO_QUERY ); if( xDrawPageSupplier.is() ) xDrawPage.set(xDrawPageSupplier->getDrawPage()); - nCurrentDrawPage = sal::static_int_cast<sal_Int16>(maCellPos.Tab()); + nCurrentDrawPage = sal::static_int_cast<sal_Int16>(maCurrentCellPos.Tab()); } return xDrawPage; } uno::Reference< drawing::XShapes > ScMyTables::GetCurrentXShapes() { - if( (maCellPos.Tab() != nCurrentXShapes) || !xShapes.is() ) + if( (maCurrentCellPos.Tab() != nCurrentXShapes) || !xShapes.is() ) { xShapes.set(GetCurrentXDrawPage(), uno::UNO_QUERY); rImport.GetShapeImport()->startPage(xShapes); rImport.GetShapeImport()->pushGroupForSorting ( xShapes ); - nCurrentXShapes = sal::static_int_cast<sal_Int16>(maCellPos.Tab()); + nCurrentXShapes = sal::static_int_cast<sal_Int16>(maCurrentCellPos.Tab()); return xShapes; } else @@ -312,12 +312,12 @@ uno::Reference< drawing::XShapes > ScMyTables::GetCurrentXShapes() bool ScMyTables::HasDrawPage() { - return !((maCellPos.Tab() != nCurrentDrawPage) || !xDrawPage.is()); + return !((maCurrentCellPos.Tab() != nCurrentDrawPage) || !xDrawPage.is()); } bool ScMyTables::HasXShapes() { - return !((maCellPos.Tab() != nCurrentXShapes) || !xShapes.is()); + return !((maCurrentCellPos.Tab() != nCurrentXShapes) || !xShapes.is()); } void ScMyTables::AddOLE(uno::Reference <drawing::XShape>& rShape, @@ -333,8 +333,8 @@ void ScMyTables::AddMatrixRange( OSL_ENSURE(nEndRow >= nStartRow, "wrong row order"); OSL_ENSURE(nEndColumn >= nStartColumn, "wrong column order"); ScRange aScRange( - nStartColumn, nStartRow, maCellPos.Tab(), - nEndColumn, nEndRow, maCellPos.Tab() + nStartColumn, nStartRow, maCurrentCellPos.Tab(), + nEndColumn, nEndRow, maCurrentCellPos.Tab() ); ScMatrixRange aMRange(aScRange, rFormula, rFormulaNmsp, eGrammar); aMatrixRangeList.push_back(aMRange); @@ -350,7 +350,7 @@ bool ScMyTables::IsPartOfMatrix(const SCCOL nColumn, const SCROW nRow) bool bReady(false); while(!bReady && aItr != aEndItr) { - if (maCellPos.Tab() > aItr->aScRange.aStart.Tab()) + if (maCurrentCellPos.Tab() > aItr->aScRange.aStart.Tab()) { OSL_FAIL("should never hapen, because the list should be cleared in DeleteTable"); aItr = aMatrixRangeList.erase(aItr); diff --git a/sc/source/filter/xml/xmlsubti.hxx b/sc/source/filter/xml/xmlsubti.hxx index 7b69d5ba90e4..971cb69c598d 100644 --- a/sc/source/filter/xml/xmlsubti.hxx +++ b/sc/source/filter/xml/xmlsubti.hxx @@ -88,7 +88,7 @@ private: ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > xDrawPage; ::com::sun::star::uno::Reference < ::com::sun::star::drawing::XShapes > xShapes; rtl::OUString sCurrentSheetName; - ScAddress maCellPos; + ScAddress maCurrentCellPos; ScXMLTabProtectionData maProtectionData; ScMyMatrixRangeList aMatrixRangeList; sal_Int32 nCurrentColStylePos; @@ -112,13 +112,13 @@ public: bool IsOLE(com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape) const { return ScMyOLEFixer::IsOLE(rShape); } void DeleteTable(); - ScAddress GetRealScCellPos() const { return maCellPos; }; + ScAddress GetCurrentCellPos() const { return maCurrentCellPos; }; void AddColStyle(const sal_Int32 nRepeat, const rtl::OUString& rCellStyleName); ScXMLTabProtectionData& GetCurrentProtectionData() { return maProtectionData; } rtl::OUString GetCurrentSheetName() const { return sCurrentSheetName; } - SCTAB GetCurrentSheet() const { return (maCellPos.Tab() >= 0) ? maCellPos.Tab() : 0; } - SCCOL GetCurrentColumn() const { return (maCellPos.Col() >= 0) ? maCellPos.Col() : 0; } - SCROW GetCurrentRow() const { return (maCellPos.Row() >= 0) ? maCellPos.Row() : 0; } + SCTAB GetCurrentSheet() const { return (maCurrentCellPos.Tab() >= 0) ? maCurrentCellPos.Tab() : 0; } + SCCOL GetCurrentColumn() const { return (maCurrentCellPos.Col() >= 0) ? maCurrentCellPos.Col() : 0; } + SCROW GetCurrentRow() const { return (maCurrentCellPos.Row() >= 0) ? maCurrentCellPos.Row() : 0; } ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet > GetCurrentXSheet() const { return xCurrentSheet; } ::com::sun::star::uno::Reference< ::com::sun::star::table::XCellRange > |