summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2011-11-27 20:03:11 +0100
committerEike Rathke <erack@redhat.com>2011-11-28 15:25:26 +0100
commite2e5ef04347bfb17abd7415dafa72561bd6dbfcf (patch)
tree18e0091868d98781a735e10eee88e2736d26acee /sc/source
parentff75bad6ae119e0532f2e6a653b8272184b2572e (diff)
dr78: #i115641# don't increment progress for empty repeated cells
# HG changeset patch # User Niklas Nebel <nn@openoffice.org> # Date 1290090240 -3600 # Node ID c19d748c11d669e4679736aa6b0f809a773a5fd1 # Parent 12ba194ace3d3cb17c347ff712d9268d8cdabd09
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx20
-rw-r--r--sc/source/filter/xml/xmlexprt.hxx4
2 files changed, 13 insertions, 11 deletions
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 8e0f03450ce3..3ad8b8bab4f3 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -2830,16 +2830,14 @@ void ScXMLExport::WriteTable(sal_Int32 nTable, const Reference<sheet::XSpreadshe
++nEqualCells;
else
{
- SetRepeatAttribute(nEqualCells);
- WriteCell(aPrevCell);
+ WriteCell(aPrevCell, nEqualCells);
nEqualCells = 0;
aPrevCell = aCell;
}
}
else
{
- SetRepeatAttribute(nEqualCells);
- WriteCell(aPrevCell);
+ WriteCell(aPrevCell, nEqualCells);
ExportFormatRanges(aPrevCell.aCellAddress.Column + nEqualCells + 1, aPrevCell.aCellAddress.Row,
aCell.aCellAddress.Column - 1, aCell.aCellAddress.Row, nTable);
nEqualCells = 0;
@@ -2849,8 +2847,7 @@ void ScXMLExport::WriteTable(sal_Int32 nTable, const Reference<sheet::XSpreadshe
}
if (!bIsFirst)
{
- SetRepeatAttribute(nEqualCells);
- WriteCell(aPrevCell);
+ WriteCell(aPrevCell, nEqualCells);
ExportFormatRanges(aPrevCell.aCellAddress.Column + nEqualCells + 1, aPrevCell.aCellAddress.Row,
pSharedData->GetLastColumn(nTable), pSharedData->GetLastRow(nTable), nTable);
}
@@ -2872,8 +2869,11 @@ void ScXMLExport::WriteTable(sal_Int32 nTable, const Reference<sheet::XSpreadshe
}
}
-void ScXMLExport::WriteCell (ScMyCell& aCell)
+void ScXMLExport::WriteCell(ScMyCell& aCell, sal_Int32 nEqualCellCount)
{
+ // nEqualCellCount is the number of additional cells
+ SetRepeatAttribute(nEqualCellCount, (aCell.nType != table::CellContentType_EMPTY));
+
ScAddress aCellPos;
ScUnoConversion::FillScAddress( aCellPos, aCell.aCellAddress );
if (aCell.nStyleIndex != -1)
@@ -3369,14 +3369,16 @@ void ScXMLExport::WriteDetective( const ScMyCell& rMyCell )
}
}
-void ScXMLExport::SetRepeatAttribute (const sal_Int32 nEqualCellCount)
+void ScXMLExport::SetRepeatAttribute(sal_Int32 nEqualCellCount, bool bIncProgress)
{
+ // nEqualCellCount is additional cells, so the attribute value is nEqualCellCount+1
if (nEqualCellCount > 0)
{
sal_Int32 nTemp(nEqualCellCount + 1);
OUString sOUEqualCellCount(OUString::valueOf(nTemp));
AddAttribute(sAttrColumnsRepeated, sOUEqualCellCount);
- IncrementProgressBar(false, nEqualCellCount);
+ if (bIncProgress)
+ IncrementProgressBar(sal_False, nEqualCellCount);
}
}
diff --git a/sc/source/filter/xml/xmlexprt.hxx b/sc/source/filter/xml/xmlexprt.hxx
index b7142a4d0309..5e65953c71aa 100644
--- a/sc/source/filter/xml/xmlexprt.hxx
+++ b/sc/source/filter/xml/xmlexprt.hxx
@@ -183,14 +183,14 @@ class ScXMLExport : public SvXMLExport
bool GetCellText (ScMyCell& rMyCell, const ScAddress& aPos) const;
void WriteTable(sal_Int32 nTable, const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet>& xTable);
- void WriteCell (ScMyCell& aCell);
+ void WriteCell(ScMyCell& aCell, sal_Int32 nEqualCellCount);
void WriteAreaLink(const ScMyCell& rMyCell);
void WriteAnnotation(ScMyCell& rMyCell);
void WriteDetective(const ScMyCell& rMyCell);
void ExportShape(const com::sun::star::uno::Reference < com::sun::star::drawing::XShape >& xShape, com::sun::star::awt::Point* pPoint);
void WriteShapes(const ScMyCell& rMyCell);
void WriteTableShapes();
- void SetRepeatAttribute (const sal_Int32 nEqualCellCount);
+ 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;