diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-22 20:54:13 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-22 21:49:26 -0400 |
commit | a9a7f2501228e0f47085d937fc3727f1a452249f (patch) | |
tree | 41e05808f2e7722c376f68a9a00df5e9f9bedf5e /sc/source/ui/unoobj | |
parent | 0872a719ab85a497ea1d71920e298fd9f1d66766 (diff) |
More on ScCellIterator usage conversion... Still not done.
Change-Id: I5023a57f3a089f1af7cd7fe53f57f82c60eb2b65
Diffstat (limited to 'sc/source/ui/unoobj')
-rw-r--r-- | sc/source/ui/unoobj/funcuno.cxx | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx index 776f946ce164..40fa41c17a41 100644 --- a/sc/source/ui/unoobj/funcuno.cxx +++ b/sc/source/ui/unoobj/funcuno.cxx @@ -175,27 +175,25 @@ static sal_Bool lcl_CopyData( ScDocument* pSrcDoc, const ScRange& rSrcRange, // If the range contains formula cells with default number format, // apply a number format for the formula result ScCellIterator aIter( pClipDoc, rSrcRange ); - ScBaseCell* pCell = aIter.GetFirst(); - while (pCell) + for (bool bHas = aIter.first(); bHas; bHas = aIter.next()) { - if (pCell->GetCellType() == CELLTYPE_FORMULA) + if (aIter.getType() != CELLTYPE_FORMULA) + continue; + + ScAddress aCellPos = aIter.GetPos(); + sal_uInt32 nFormat = pClipDoc->GetNumberFormat(aCellPos); + if ( (nFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0 ) { - ScAddress aCellPos = aIter.GetPos(); - sal_uInt32 nFormat = pClipDoc->GetNumberFormat(aCellPos); - if ( (nFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0 ) + ScFormulaCell* pFCell = aIter.getFormulaCell(); + sal_uInt16 nErrCode = pFCell->GetErrCode(); + if ( nErrCode == 0 && pFCell->IsValue() ) { - ScFormulaCell* pFCell = static_cast<ScFormulaCell*>(pCell); - sal_uInt16 nErrCode = pFCell->GetErrCode(); - if ( nErrCode == 0 && pFCell->IsValue() ) - { - sal_uInt32 nNewFormat = pFCell->GetStandardFormat( *pClipDoc->GetFormatTable(), nFormat ); - if ( nNewFormat != nFormat ) - pClipDoc->ApplyAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), - SfxUInt32Item( ATTR_VALUE_FORMAT, nNewFormat ) ); - } + sal_uInt32 nNewFormat = pFCell->GetStandardFormat( *pClipDoc->GetFormatTable(), nFormat ); + if ( nNewFormat != nFormat ) + pClipDoc->ApplyAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), + SfxUInt32Item( ATTR_VALUE_FORMAT, nNewFormat ) ); } } - pCell = aIter.GetNext(); } ScMarkData aDestMark; |