summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Ballach <sab@openoffice.org>2001-12-05 11:53:42 +0000
committerSascha Ballach <sab@openoffice.org>2001-12-05 11:53:42 +0000
commit43371dd952befa2a36065415be2f028509c05261 (patch)
tree764f6e9a924aebcfef11fa814c9199c0e7a85973
parentdfb0d3bf7c838239ff995a40d361d57edc16ad5d (diff)
#95346#; don't use a list of pointers for the annotation list, because the < operator is not called than
-rw-r--r--sc/source/filter/xml/XMLExportIterator.cxx30
-rw-r--r--sc/source/filter/xml/XMLExportIterator.hxx8
2 files changed, 14 insertions, 24 deletions
diff --git a/sc/source/filter/xml/XMLExportIterator.cxx b/sc/source/filter/xml/XMLExportIterator.cxx
index fab354e225bc..10e7f6a0d651 100644
--- a/sc/source/filter/xml/XMLExportIterator.cxx
+++ b/sc/source/filter/xml/XMLExportIterator.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLExportIterator.cxx,v $
*
- * $Revision: 1.29 $
+ * $Revision: 1.30 $
*
- * last change: $Author: sab $ $Date: 2001-12-04 18:29:45 $
+ * last change: $Author: sab $ $Date: 2001-12-05 12:53:42 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -605,16 +605,7 @@ void ScMyNotEmptyCellsIterator::Clear()
{
if (pCellItr)
delete pCellItr;
- if (!aAnnotations.empty())
- {
- ScMyExportAnnotationList::iterator aItr = aAnnotations.begin();
- ScMyExportAnnotationList::iterator aEndItr = aAnnotations.end();
- while (aItr != aEndItr)
- {
- delete *aItr;
- aItr = aAnnotations.erase(aItr);
- }
- }
+ DBG_ASSERT(aAnnotations.empty(), "not all Annotations saved");
pCellItr = NULL;
pShapes = NULL;
pMergedRanges = NULL;
@@ -668,10 +659,10 @@ void ScMyNotEmptyCellsIterator::HasAnnotation(ScMyCell& aCell)
if (!aAnnotations.empty())
{
ScMyExportAnnotationList::iterator aItr = aAnnotations.begin();
- if ((aCell.aCellAddress.Column == (*aItr)->aCellAddress.Column) &&
- (aCell.aCellAddress.Row == (*aItr)->aCellAddress.Row))
+ if ((aCell.aCellAddress.Column == aItr->aCellAddress.Column) &&
+ (aCell.aCellAddress.Row == aItr->aCellAddress.Row))
{
- aCell.xAnnotation = (*aItr)->xAnnotation;
+ aCell.xAnnotation = aItr->xAnnotation;
uno::Reference<text::XSimpleText> xSimpleText(aCell.xAnnotation, uno::UNO_QUERY);
if (aCell.xAnnotation.is() && xSimpleText.is())
{
@@ -679,7 +670,6 @@ void ScMyNotEmptyCellsIterator::HasAnnotation(ScMyCell& aCell)
if (aCell.sAnnotationText.getLength())
aCell.bHasAnnotation = sal_True;
}
- delete *aItr;
aAnnotations.erase(aItr);
}
}
@@ -716,11 +706,11 @@ void ScMyNotEmptyCellsIterator::SetCurrentTable(const sal_Int32 nTable,
while (xAnnotations->hasMoreElements())
{
uno::Any aAny = xAnnotations->nextElement();
- ScMyExportAnnotation* pAnnotation = new ScMyExportAnnotation();
- if (pAnnotation && (aAny >>= pAnnotation->xAnnotation))
+ ScMyExportAnnotation aAnnotation;
+ if (aAny >>= aAnnotation.xAnnotation)
{
- pAnnotation->aCellAddress = pAnnotation->xAnnotation->getPosition();
- aAnnotations.push_back(pAnnotation);
+ aAnnotation.aCellAddress = aAnnotation.xAnnotation->getPosition();
+ aAnnotations.push_back(aAnnotation);
}
}
if (!aAnnotations.empty())
diff --git a/sc/source/filter/xml/XMLExportIterator.hxx b/sc/source/filter/xml/XMLExportIterator.hxx
index 7a0e73ef3292..d81a3c7c0804 100644
--- a/sc/source/filter/xml/XMLExportIterator.hxx
+++ b/sc/source/filter/xml/XMLExportIterator.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLExportIterator.hxx,v $
*
- * $Revision: 1.22 $
+ * $Revision: 1.23 $
*
- * last change: $Author: sab $ $Date: 2001-12-04 18:29:45 $
+ * last change: $Author: sab $ $Date: 2001-12-05 12:53:42 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -371,10 +371,10 @@ struct ScMyExportAnnotation
{
com::sun::star::uno::Reference<com::sun::star::sheet::XSheetAnnotation> xAnnotation;
com::sun::star::table::CellAddress aCellAddress;
- sal_Bool operator<(const ScMyExportAnnotation& rDetOp);
+ sal_Bool operator<(const ScMyExportAnnotation& rAnno);
};
-typedef ::std::list< ScMyExportAnnotation* > ScMyExportAnnotationList;
+typedef ::std::list< ScMyExportAnnotation > ScMyExportAnnotationList;
class ScMyNotEmptyCellsIterator
{