diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/formulacell.hxx | 4 | ||||
-rw-r--r-- | sc/source/core/data/formulacell.cxx | 15 | ||||
-rw-r--r-- | sc/source/core/tool/cellform.cxx | 5 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlexprt.cxx | 29 | ||||
-rw-r--r-- | sc/source/ui/app/transobj.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/unoobj/funcuno.cxx | 24 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsha.cxx | 7 |
7 files changed, 6 insertions, 90 deletions
diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx index c407ae7016e5..c6d3aa7bfdf6 100644 --- a/sc/inc/formulacell.hxx +++ b/sc/inc/formulacell.hxx @@ -243,10 +243,6 @@ public: void SetInChangeTrack( bool bVal ) { bInChangeTrack = bVal; } bool IsInChangeTrack() const { return bInChangeTrack; } - // standard format for type and format - // for format "Standard" possibly the format used in the formula cell - sal_uLong GetStandardFormat( SvNumberFormatter& rFormatter, sal_uLong nFormat ) const; - // For import filters! void AddRecalcMode( formula::ScRecalcMode ); /** For import only: set a double result. */ diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index d3d1b38ba7d5..b75bdcc08f06 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -1495,16 +1495,6 @@ void ScFormulaCell::GetMatColsRows( SCCOL & nCols, SCROW & nRows ) const } -sal_uLong ScFormulaCell::GetStandardFormat( SvNumberFormatter& rFormatter, sal_uLong nFormat ) const -{ - //! not ScFormulaCell::IsValue(), that could reinterpret the formula again. - if ( aResult.IsValue() ) - return ScGlobal::GetStandardFormat( aResult.GetDouble(), rFormatter, nFormat, nFormatType ); - else - return ScGlobal::GetStandardFormat( rFormatter, nFormat, nFormatType ); -} - - void ScFormulaCell::Notify( SvtBroadcaster&, const SfxHint& rHint) { if ( !pDocument->IsInDtorClear() && !pDocument->GetHardRecalcState() ) @@ -1652,10 +1642,7 @@ void ScFormulaCell::GetURLResult( OUString& rURL, OUString& rCellText ) sal_uLong nCellFormat = pDocument->GetNumberFormat( aPos ); SvNumberFormatter* pFormatter = pDocument->GetFormatTable(); - if ( (nCellFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0 ) - nCellFormat = GetStandardFormat( *pFormatter,nCellFormat ); - - sal_uLong nURLFormat = ScGlobal::GetStandardFormat( *pFormatter,nCellFormat, NUMBERFORMAT_NUMBER); + sal_uLong nURLFormat = ScGlobal::GetStandardFormat( *pFormatter, nCellFormat, NUMBERFORMAT_NUMBER); if ( IsValue() ) { diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx index 68468747ab55..a33405f9a05a 100644 --- a/sc/source/core/tool/cellform.cxx +++ b/sc/source/core/tool/cellform.cxx @@ -101,11 +101,6 @@ void ScCellFormat::GetString( ScRefCellValue& rCell, sal_uLong nFormat, OUString { sal_uInt16 nErrCode = pFCell->GetErrCode(); - // get the number format only after interpretation (GetErrCode): - if ( (nFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0 ) - nFormat = pFCell->GetStandardFormat( rFormatter, - nFormat ); - if (nErrCode != 0) rString = ScGlobal::GetErrorString(nErrCode); else if ( pFCell->IsEmptyDisplayedAsString() ) diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index a4cbb407b68f..2b72e894df0e 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -2929,33 +2929,14 @@ void ScXMLExport::WriteCell(ScMyCell& aCell, sal_Int32 nEqualCellCount) bool bIsStandard; OUString sCurrency; GetNumberFormatAttributesExportHelper()->GetCellType(aCell.nNumberFormat, sCurrency, bIsStandard); - if (bIsStandard) + if (pDoc) { - if (pDoc) + GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes( + aCell.nNumberFormat, pDoc->GetValue( aCellPos )); + if( getDefaultVersion() >= SvtSaveOptions::ODFVER_012 ) { GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes( - pFormulaCell->GetStandardFormat(*pDoc->GetFormatTable(), 0), - pDoc->GetValue( aCellPos )); - if( getDefaultVersion() > SvtSaveOptions::ODFVER_012 ) - { - GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes( - pFormulaCell->GetStandardFormat(*pDoc->GetFormatTable(), 0), - pDoc->GetValue( aCellPos ), false, XML_NAMESPACE_CALC_EXT, false); - } - } - } - else - { - if (pDoc) - { - GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes( - aCell.nNumberFormat, pDoc->GetValue( aCellPos )); - if( getDefaultVersion() > SvtSaveOptions::ODFVER_012 ) - { - GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes( - aCell.nNumberFormat, pDoc->GetValue( aCellPos ), false, XML_NAMESPACE_CALC_EXT, false ); - - } + aCell.nNumberFormat, pDoc->GetValue( aCellPos ), false, XML_NAMESPACE_CALC_EXT, false ); } } } diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index a68adf368d41..a2fcc1124221 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -831,18 +831,6 @@ void ScTransferObj::StripRefs( ScDocument* pDoc, pDestDoc->SetString(aPos, aStr); } } - - // number formats - - sal_uLong nOldFormat = ((const SfxUInt32Item*) - pDestDoc->GetAttr(nCol,nRow,nDestTab, ATTR_VALUE_FORMAT))->GetValue(); - if ( (nOldFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0 ) - { - sal_uLong nNewFormat = pFCell->GetStandardFormat( *pFormatter, - nOldFormat ); - pDestDoc->ApplyAttr( nCol,nRow,nDestTab, - SfxUInt32Item(ATTR_VALUE_FORMAT, nNewFormat) ); - } } } } diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx index 22fbf0ecb091..7c57ee919c7f 100644 --- a/sc/source/ui/unoobj/funcuno.cxx +++ b/sc/source/ui/unoobj/funcuno.cxx @@ -173,30 +173,6 @@ static sal_Bool lcl_CopyData( ScDocument* pSrcDoc, const ScRange& rSrcRange, pClipDoc->ApplyPatternAreaTab( 0,0, MAXCOL,MAXROW, nSrcTab, aPattern ); } - // If the range contains formula cells with default number format, - // apply a number format for the formula result - ScCellIterator aIter( pClipDoc, rSrcRange ); - for (bool bHas = aIter.first(); bHas; bHas = aIter.next()) - { - if (aIter.getType() != CELLTYPE_FORMULA) - continue; - - 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() ) - { - sal_uInt32 nNewFormat = pFCell->GetStandardFormat( *pClipDoc->GetFormatTable(), nFormat ); - if ( nNewFormat != nFormat ) - pClipDoc->ApplyAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), - SfxUInt32Item( ATTR_VALUE_FORMAT, nNewFormat ) ); - } - } - } - ScMarkData aDestMark; aDestMark.SelectOneTable( nDestTab ); aDestMark.SetMarkArea( aNewRange ); diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index 1cc39fd33ced..4e2d64517473 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -112,13 +112,6 @@ sal_Bool ScTabViewShell::GetFunction( String& rFuncStr, sal_uInt16 nErrCode ) { // Zahlformat aus Attributen oder Formel pDoc->GetNumberFormat( nPosX, nPosY, nTab, nNumFmt ); - if ( (nNumFmt % SV_COUNTRY_LANGUAGE_OFFSET) == 0 ) - { - ScRefCellValue aCell; - aCell.assign(*pDoc, aCursor); - if (aCell.meType == CELLTYPE_FORMULA) - nNumFmt = aCell.mpFormula->GetStandardFormat(*pFormatter, nNumFmt); - } } String aValStr; |