diff options
Diffstat (limited to 'sc/source/filter/xml/xmlexprt.cxx')
-rw-r--r-- | sc/source/filter/xml/xmlexprt.cxx | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 8cdfb63c1d05..d341e582cac4 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -2113,15 +2113,14 @@ void ScXMLExport::AddStyleFromCells(const uno::Reference<beans::XPropertySet>& x nIndex = pCellStyles->GetIndexOfStyleName(sName, XML_STYLE_FAMILY_TABLE_CELL_STYLES_PREFIX, bIsAutoStyle); uno::Sequence<table::CellRangeAddress> aAddresses(xCellRanges->getRangeAddresses()); - table::CellRangeAddress* pAddresses(aAddresses.getArray()); bool bGetMerge(true); - for (sal_Int32 i = 0; i < aAddresses.getLength(); ++i, ++pAddresses) + for (table::CellRangeAddress const & address : aAddresses) { - pSharedData->SetLastColumn(nTable, pAddresses->EndColumn); - pSharedData->SetLastRow(nTable, pAddresses->EndRow); - pCellStyles->AddRangeStyleName(*pAddresses, nIndex, bIsAutoStyle, nValidationIndex, nNumberFormat); + pSharedData->SetLastColumn(nTable, address.EndColumn); + pSharedData->SetLastRow(nTable, address.EndRow); + pCellStyles->AddRangeStyleName(address, nIndex, bIsAutoStyle, nValidationIndex, nNumberFormat); if (bGetMerge) - bGetMerge = GetMerged(pAddresses, xTable); + bGetMerge = GetMerged(&address, xTable); } } } @@ -2137,17 +2136,16 @@ void ScXMLExport::AddStyleFromCells(const uno::Reference<beans::XPropertySet>& x if ( !pOldName ) { uno::Sequence<table::CellRangeAddress> aAddresses(xCellRanges->getRangeAddresses()); - table::CellRangeAddress* pAddresses(aAddresses.getArray()); bool bGetMerge(true); - for (sal_Int32 i = 0; i < aAddresses.getLength(); ++i, ++pAddresses) + for (table::CellRangeAddress const & address : aAddresses) { if (bGetMerge) - bGetMerge = GetMerged(pAddresses, xTable); - pCellStyles->AddRangeStyleName(*pAddresses, nIndex, false, nValidationIndex, nNumberFormat); + bGetMerge = GetMerged(&address, xTable); + pCellStyles->AddRangeStyleName(address, nIndex, false, nValidationIndex, nNumberFormat); if( sStyleName != "Default" || nValidationIndex != -1 ) { - pSharedData->SetLastColumn(nTable, pAddresses->EndColumn); - pSharedData->SetLastRow(nTable, pAddresses->EndRow); + pSharedData->SetLastColumn(nTable, address.EndColumn); + pSharedData->SetLastRow(nTable, address.EndRow); } } } |