diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-03-10 00:25:29 +0100 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2013-03-11 08:38:03 +0000 |
commit | 4428c7e9d73fd6a9722b262f2aab36c6fb8fd859 (patch) | |
tree | be63409f342c9e573926ec9d635aadd71adc8279 /sc/source/filter/xml/XMLExportIterator.cxx | |
parent | ca65d42e9587845118aee848939fe70791d0452e (diff) |
handle note export correctly, fdo#61165
This code was horribly over-optimized and that actually with an error.
There is a nasty corner cases that has been left out in the code. Note
captions are actually normally not deleted from the document even if the
note is deleted. So we had now wrong note captions in the list that we
should not process but they were screwing up the export code that only
exports captions for existing notes.
When we only add the caption data for existing notes the code becomes so
much cleaner and the bug is immediately gone.
Change-Id: I51f1e9042f88f3f1b2d7aae75942629771d39012
(cherry picked from commit c7937e2a38501266ed658553c19db5b4a2237864)
Reviewed-on: https://gerrit.libreoffice.org/2629
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'sc/source/filter/xml/XMLExportIterator.cxx')
-rw-r--r-- | sc/source/filter/xml/XMLExportIterator.cxx | 40 |
1 files changed, 14 insertions, 26 deletions
diff --git a/sc/source/filter/xml/XMLExportIterator.cxx b/sc/source/filter/xml/XMLExportIterator.cxx index cfbbe540f88d..1662db73621f 100644 --- a/sc/source/filter/xml/XMLExportIterator.cxx +++ b/sc/source/filter/xml/XMLExportIterator.cxx @@ -861,33 +861,21 @@ bool ScMyNotEmptyCellsIterator::GetNext(ScMyCell& aCell, ScFormatRangeStyles* pC table::CellAddress aAddress( nCurrentTable, MAXCOL + 1, MAXROW + 1 ); UpdateAddress( aAddress ); - if( (maNoteExportListItr != maNoteExportList.end()) && IsNoteBeforeNextCell(maNoteExportListItr->nCol, maNoteExportListItr->nRow, aAddress) ) - { - //we have a note before the new cell - aAddress.Column = maNoteExportListItr->nCol; - aAddress.Row = maNoteExportListItr->nRow; - ++maNoteExportListItr; - } - else - { - if(maNoteExportListItr != maNoteExportList.end() && maNoteExportListItr->nCol == aAddress.Column && maNoteExportListItr->nRow == aAddress.Row) - ++maNoteExportListItr; - if( pShapes ) - pShapes->UpdateAddress( aAddress ); - if( pNoteShapes ) - pNoteShapes->UpdateAddress( aAddress ); - if( pEmptyDatabaseRanges ) - pEmptyDatabaseRanges->UpdateAddress( aAddress ); - if( pMergedRanges ) - pMergedRanges->UpdateAddress( aAddress ); - if( pAreaLinks ) - pAreaLinks->UpdateAddress( aAddress ); - if( pDetectiveObj ) - pDetectiveObj->UpdateAddress( aAddress ); - if( pDetectiveOp ) - pDetectiveOp->UpdateAddress( aAddress ); - } + if( pShapes ) + pShapes->UpdateAddress( aAddress ); + if( pNoteShapes ) + pNoteShapes->UpdateAddress( aAddress ); + if( pEmptyDatabaseRanges ) + pEmptyDatabaseRanges->UpdateAddress( aAddress ); + if( pMergedRanges ) + pMergedRanges->UpdateAddress( aAddress ); + if( pAreaLinks ) + pAreaLinks->UpdateAddress( aAddress ); + if( pDetectiveObj ) + pDetectiveObj->UpdateAddress( aAddress ); + if( pDetectiveOp ) + pDetectiveOp->UpdateAddress( aAddress ); bool bFoundCell((aAddress.Column <= MAXCOL) && (aAddress.Row <= MAXROW)); if( bFoundCell ) |