summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-08-24 10:44:48 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-08-24 17:16:56 -0400
commitf5abc665e94113a53d450af020bc534756a88072 (patch)
tree229cb1e75920907b30fb91da5744403ccd413b0e
parentdcd8964ca3f05a40b18cf17ab11116011c090abc (diff)
Remove ugly and expensive hack only to see if the cell is an edit cell.
We can do it much simpler now. Change-Id: I913f2a226e1f16fbc9aafaa91af5550f3c7fee05
-rw-r--r--sc/source/filter/xml/XMLExportIterator.cxx7
-rw-r--r--sc/source/filter/xml/XMLExportIterator.hxx1
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx24
-rw-r--r--sc/source/filter/xml/xmlexprt.hxx1
4 files changed, 6 insertions, 27 deletions
diff --git a/sc/source/filter/xml/XMLExportIterator.cxx b/sc/source/filter/xml/XMLExportIterator.cxx
index 697f2aa9dcc3..2cf43250d084 100644
--- a/sc/source/filter/xml/XMLExportIterator.cxx
+++ b/sc/source/filter/xml/XMLExportIterator.cxx
@@ -608,7 +608,6 @@ ScMyCell::ScMyCell() :
bHasDetectiveObj( false ),
bHasDetectiveOp( false ),
bIsEditCell( false ),
- bKnowWhetherIsEditCell( false ),
bHasStringValue( false ),
bHasDoubleValue( false ),
bHasXText( false ),
@@ -682,14 +681,18 @@ void ScMyNotEmptyCellsIterator::UpdateAddress( table::CellAddress& rAddress )
void ScMyNotEmptyCellsIterator::SetCellData( ScMyCell& rMyCell, table::CellAddress& rAddress )
{
+ rMyCell.maBaseCell.clear();
rMyCell.aCellAddress = rAddress;
rMyCell.bHasStringValue = false;
rMyCell.bHasDoubleValue = false;
rMyCell.bHasXText = false;
- rMyCell.bKnowWhetherIsEditCell = false;
rMyCell.bIsEditCell = false;
if( (nCellCol == rAddress.Column) && (nCellRow == rAddress.Row) )
+ {
mpCell = mpCellItr->GetNext(nCellCol, nCellRow);
+ if (mpCell)
+ rMyCell.maBaseCell = *mpCell;
+ }
}
void ScMyNotEmptyCellsIterator::SetMatrixCellData( ScMyCell& rMyCell )
diff --git a/sc/source/filter/xml/XMLExportIterator.hxx b/sc/source/filter/xml/XMLExportIterator.hxx
index 9938b44ab036..98eedf414ad3 100644
--- a/sc/source/filter/xml/XMLExportIterator.hxx
+++ b/sc/source/filter/xml/XMLExportIterator.hxx
@@ -327,7 +327,6 @@ struct ScMyCell
bool bHasDetectiveOp;
bool bIsEditCell;
- bool bKnowWhetherIsEditCell;
bool bHasStringValue;
bool bHasDoubleValue;
bool bHasXText;
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 6815f9551d29..74955eeeabea 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -3590,31 +3590,9 @@ bool ScXMLExport::IsCellTypeEqual (const ScMyCell& aCell1, const ScMyCell& aCell
return (aCell1.nType == aCell2.nType);
}
-bool ScXMLExport::IsEditCell(const com::sun::star::table::CellAddress& aAddress, ScMyCell* pMyCell) const
-{
- ScAddress aCoreAddress(static_cast<SCCOL>(aAddress.Column),
- static_cast<SCROW>(aAddress.Row),
- static_cast<SCTAB>(aAddress.Sheet));
-
- ScRefCellValue aCell;
- aCell.assign(const_cast<ScDocument&>(*GetDocument()), aCoreAddress);
-
- if (pMyCell)
- pMyCell->maBaseCell = aCell;
-
- return (aCell.meType == CELLTYPE_EDIT);
-}
-
bool ScXMLExport::IsEditCell(ScMyCell& rCell) const
{
- if (rCell.bKnowWhetherIsEditCell)
- return rCell.bIsEditCell;
- else
- {
- rCell.bIsEditCell = IsEditCell(rCell.aCellAddress, &rCell);
- rCell.bKnowWhetherIsEditCell = true;
- return rCell.bIsEditCell;
- }
+ return rCell.maBaseCell.meType == CELLTYPE_EDIT;
}
bool ScXMLExport::IsMultiLineFormulaCell(ScMyCell& rCell) const
diff --git a/sc/source/filter/xml/xmlexprt.hxx b/sc/source/filter/xml/xmlexprt.hxx
index f0303e355e54..3f01dfee50b4 100644
--- a/sc/source/filter/xml/xmlexprt.hxx
+++ b/sc/source/filter/xml/xmlexprt.hxx
@@ -187,7 +187,6 @@ class ScXMLExport : public SvXMLExport
void SetRepeatAttribute(sal_Int32 nEqualCellCount, bool bIncProgress);
bool IsCellTypeEqual (const ScMyCell& aCell1, const ScMyCell& aCell2) const;
- bool IsEditCell(const com::sun::star::table::CellAddress& aAddress, ScMyCell* pMyCell = NULL) const;
bool IsEditCell(ScMyCell& rCell) const;
bool IsMultiLineFormulaCell(ScMyCell& rCell) const;
bool IsCellEqual (ScMyCell& aCell1, ScMyCell& aCell2);