[Libreoffice-commits] core.git: 5 commits - basic/source chart2/source connectivity/source cui/source dbaccess/source editeng/source extensions/source formula/source idl/source include/sfx2 include/sot include/svl sc/source sd/source sfx2/source sot/source svl/qa svl/source svtools/source svx/source sw/inc sw/source uui/source xmloff/source
Noel Grandin
noel at peralex.com
Wed Feb 25 00:35:05 PST 2015
basic/source/runtime/methods.cxx | 8
basic/source/runtime/runtime.cxx | 2
basic/source/sbx/sbxdate.cxx | 4
chart2/source/controller/dialogs/tp_Scale.cxx | 18 -
connectivity/source/drivers/flat/ETable.cxx | 6
cui/source/options/optupdt.cxx | 4
dbaccess/source/ui/misc/UITools.cxx | 2
editeng/source/items/flditem.cxx | 4
extensions/source/propctrlr/standardcontrol.cxx | 2
extensions/source/propctrlr/usercontrol.cxx | 26 -
formula/source/core/api/FormulaCompiler.cxx | 28 -
idl/source/objects/object.cxx | 2
idl/source/objects/slot.cxx | 16 -
include/sfx2/ctrlitem.hxx | 5
include/sfx2/msg.hxx | 100 +++---
include/sot/exchange.hxx | 62 +---
include/svl/zforlist.hxx | 25 -
include/svl/zformat.hxx | 8
sc/source/core/data/clipcontext.cxx | 2
sc/source/core/data/column.cxx | 2
sc/source/core/data/column3.cxx | 14
sc/source/core/data/dbdocutl.cxx | 10
sc/source/core/data/dociter.cxx | 10
sc/source/core/data/documen4.cxx | 8
sc/source/core/data/document.cxx | 6
sc/source/core/data/dpcache.cxx | 4
sc/source/core/data/dpobject.cxx | 10
sc/source/core/data/dputil.cxx | 4
sc/source/core/data/formulacell.cxx | 20 -
sc/source/core/data/stlsheet.cxx | 2
sc/source/core/data/table3.cxx | 6
sc/source/core/data/table4.cxx | 2
sc/source/core/tool/chartpos.cxx | 2
sc/source/core/tool/compiler.cxx | 6
sc/source/core/tool/interpr1.cxx | 72 ++--
sc/source/core/tool/interpr2.cxx | 56 +--
sc/source/core/tool/interpr4.cxx | 54 +--
sc/source/core/tool/interpr5.cxx | 64 ++--
sc/source/core/tool/interpr6.cxx | 18 -
sc/source/core/tool/scmatrix.cxx | 4
sc/source/filter/dif/difimp.cxx | 2
sc/source/filter/excel/xelink.cxx | 2
sc/source/filter/excel/xepivot.cxx | 4
sc/source/filter/excel/xestyle.cxx | 4
sc/source/filter/excel/xetable.cxx | 18 -
sc/source/filter/excel/xipivot.cxx | 6
sc/source/filter/excel/xistyle.cxx | 2
sc/source/filter/lotus/tool.cxx | 42 +-
sc/source/filter/rtf/eeimpars.cxx | 2
sc/source/filter/xcl97/XclImpChangeTrack.cxx | 2
sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx | 8
sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx | 10
sc/source/filter/xml/XMLTrackedChangesContext.cxx | 10
sc/source/ui/app/inputhdl.cxx | 2
sc/source/ui/dbgui/filtdlg.cxx | 2
sc/source/ui/docshell/docsh8.cxx | 8
sc/source/ui/docshell/externalrefmgr.cxx | 4
sc/source/ui/docshell/impex.cxx | 4
sc/source/ui/unoobj/cellsuno.cxx | 8
sc/source/ui/view/cellsh1.cxx | 8
sc/source/ui/view/cellsh2.cxx | 4
sc/source/ui/view/dbfunc3.cxx | 2
sc/source/ui/view/formatsh.cxx | 138 ++++-----
sc/source/ui/view/viewfun6.cxx | 52 +--
sc/source/ui/view/viewfunc.cxx | 4
sd/source/ui/dlg/PaneShells.cxx | 4
sfx2/source/appl/appdispatchprovider.cxx | 4
sfx2/source/appl/appuno.cxx | 8
sfx2/source/appl/fileobj.cxx | 2
sfx2/source/control/bindings.cxx | 6
sfx2/source/control/ctrlitem.cxx | 2
sfx2/source/control/dispatch.cxx | 16 -
sfx2/source/control/request.cxx | 10
sfx2/source/control/shell.cxx | 2
sfx2/source/menu/mnuitem.cxx | 2
sfx2/source/menu/virtmenu.cxx | 4
sfx2/source/view/sfxbasecontroller.cxx | 8
sot/source/base/formats.cxx | 44 +-
svl/qa/unit/svl.cxx | 4
svl/source/numbers/numfmuno.cxx | 6
svl/source/numbers/zforfind.cxx | 250 ++++++++---------
svl/source/numbers/zforlist.cxx | 180 ++++++------
svl/source/numbers/zformat.cxx | 72 ++--
svl/source/numbers/zforscan.cxx | 180 ++++++------
svtools/source/control/fmtfield.cxx | 8
svx/source/items/numfmtsh.cxx | 98 +++---
svx/source/toolbars/extrusionbar.cxx | 2
svx/source/toolbars/fontworkbar.cxx | 2
sw/inc/cellatr.hxx | 2
sw/source/core/doc/docsort.cxx | 2
sw/source/core/docnode/ndtbl.cxx | 2
sw/source/core/edit/edtab.cxx | 2
sw/source/core/fields/cellfml.cxx | 6
sw/source/core/fields/fldbas.cxx | 6
sw/source/core/table/swtable.cxx | 22 -
sw/source/core/text/EnhancedPDFExportHelper.cxx | 2
sw/source/core/undo/untbl.cxx | 4
sw/source/core/unocore/unotbl.cxx | 4
sw/source/filter/html/htmlfld.cxx | 4
sw/source/filter/ww8/writerwordglue.cxx | 2
sw/source/filter/ww8/ww8par5.cxx | 22 -
sw/source/filter/xml/xmlfmte.cxx | 2
sw/source/filter/xml/xmltble.cxx | 2
sw/source/ui/dbui/dbinsdlg.cxx | 4
sw/source/ui/fldui/flddinf.cxx | 16 -
sw/source/ui/fldui/flddok.cxx | 6
sw/source/ui/fldui/fldvar.cxx | 4
sw/source/uibase/dochdl/swdtflvr.cxx | 101 +++---
sw/source/uibase/docvw/edtdd.cxx | 40 +-
sw/source/uibase/docvw/edtwin.cxx | 7
sw/source/uibase/fldui/fldmgr.cxx | 6
sw/source/uibase/inc/edtwin.hxx | 4
sw/source/uibase/inc/swdtflvr.hxx | 6
sw/source/uibase/inc/view.hxx | 3
sw/source/uibase/shells/tabsh.cxx | 14
sw/source/uibase/uiview/view.cxx | 10
sw/source/uibase/uiview/viewstat.cxx | 4
sw/source/uibase/utlui/numfmtlb.cxx | 48 +--
uui/source/iahndl-ssl.cxx | 4
xmloff/source/style/xmlnumfe.cxx | 62 ++--
xmloff/source/style/xmlnumfi.cxx | 2
121 files changed, 1177 insertions(+), 1208 deletions(-)
New commits:
commit 2f928b2d0982af44b3d45f1d3c8919c0b0655b4f
Author: Noel Grandin <noel at peralex.com>
Date: Wed Feb 25 09:49:59 2015 +0200
remove NUMBERFORMAT_ constants
.. in favour of just using the underlying constants from
css::util::NumberFormat
Change-Id: I0c6b128b66c91b268f5ae300f9c17c7792df5e99
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index a86a743..713611c 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -2159,9 +2159,9 @@ RTLFUNC(DateValue)
nType = aFormatter.GetType( nIndex );
}
- if(bSuccess && (nType==NUMBERFORMAT_DATE || nType==NUMBERFORMAT_DATETIME))
+ if(bSuccess && (nType==css::util::NumberFormat::DATE || nType==css::util::NumberFormat::DATETIME))
{
- if ( nType == NUMBERFORMAT_DATETIME )
+ if ( nType == css::util::NumberFormat::DATETIME )
{
// cut time
if ( fResult > 0.0 )
@@ -2212,9 +2212,9 @@ RTLFUNC(TimeValue)
bool bSuccess = pFormatter->IsNumberFormat( rPar.Get(1)->GetOUString(),
nIndex, fResult );
short nType = pFormatter->GetType(nIndex);
- if(bSuccess && (nType==NUMBERFORMAT_TIME||nType==NUMBERFORMAT_DATETIME))
+ if(bSuccess && (nType==css::util::NumberFormat::TIME||nType==css::util::NumberFormat::DATETIME))
{
- if ( nType == NUMBERFORMAT_DATETIME )
+ if ( nType == css::util::NumberFormat::DATETIME )
{
// cut days
fResult = fmod( fResult, 1 );
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 21d1cb8..0334521 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -417,7 +417,7 @@ void SbiInstance::PrepareNumberFormatter( SvNumberFormatter*& rpNumberFormatter,
rpNumberFormatter = new SvNumberFormatter( comphelper::getProcessComponentContext(), eLangType );
sal_Int32 nCheckPos = 0; short nType;
- rnStdTimeIdx = rpNumberFormatter->GetStandardFormat( NUMBERFORMAT_TIME, eLangType );
+ rnStdTimeIdx = rpNumberFormatter->GetStandardFormat( css::util::NumberFormat::TIME, eLangType );
// the formatter's standard templates have only got a two-digit date
// -> registering an own format
diff --git a/basic/source/sbx/sbxdate.cxx b/basic/source/sbx/sbxdate.cxx
index 5f0bcca..7b5df49 100644
--- a/basic/source/sbx/sbxdate.cxx
+++ b/basic/source/sbx/sbxdate.cxx
@@ -134,8 +134,8 @@ double ImpGetDate( const SbxValues* p )
if ( bSuccess )
{
short nType_ = pFormatter->GetType( nIndex );
- if(!(nType_ & ( NUMBERFORMAT_DATETIME | NUMBERFORMAT_DATE |
- NUMBERFORMAT_TIME | NUMBERFORMAT_DEFINED )))
+ if(!(nType_ & ( css::util::NumberFormat::DATETIME | css::util::NumberFormat::DATE |
+ css::util::NumberFormat::TIME | css::util::NumberFormat::DEFINED )))
{
bSuccess = false;
}
diff --git a/chart2/source/controller/dialogs/tp_Scale.cxx b/chart2/source/controller/dialogs/tp_Scale.cxx
index 6b22257..bb92e78 100644
--- a/chart2/source/controller/dialogs/tp_Scale.cxx
+++ b/chart2/source/controller/dialogs/tp_Scale.cxx
@@ -393,11 +393,11 @@ int ScaleTabPage::DeactivatePage(SfxItemSet* pItemSet)
bool bDateAxis = chart2::AxisType::DATE == m_nAxisType;
sal_uInt32 nMinMaxOriginFmt = m_pFmtFldMax->GetFormatKey();
- if ((pNumFormatter->GetType(nMinMaxOriginFmt) &~ NUMBERFORMAT_DEFINED) == NUMBERFORMAT_TEXT)
+ if ((pNumFormatter->GetType(nMinMaxOriginFmt) & ~css::util::NumberFormat::DEFINED) == css::util::NumberFormat::TEXT)
nMinMaxOriginFmt = 0;
// numberformat_text cause numbers to fail being numbers... Shouldn't happen, but can.
sal_uInt32 nStepFmt = m_pFmtFldStepMain->GetFormatKey();
- if ((pNumFormatter->GetType(nStepFmt) &~NUMBERFORMAT_DEFINED) == NUMBERFORMAT_TEXT)
+ if ((pNumFormatter->GetType(nStepFmt) & ~css::util::NumberFormat::DEFINED) == css::util::NumberFormat::TEXT)
nStepFmt = 0;
Control* pControl = NULL;
@@ -536,7 +536,7 @@ void ScaleTabPage::SetNumFormat()
if( pNumFormatter )
{
short eType = pNumFormatter->GetType( nFmt );
- if( eType == NUMBERFORMAT_DATE )
+ if( eType == css::util::NumberFormat::DATE )
{
// for intervals use standard format for dates (so you can enter a number of days)
const SvNumberformat* pFormat = pNumFormatter->GetEntry( nFmt );
@@ -545,23 +545,23 @@ void ScaleTabPage::SetNumFormat()
else
nFmt = pNumFormatter->GetStandardIndex();
}
- else if( eType == NUMBERFORMAT_DATETIME )
+ else if( eType == css::util::NumberFormat::DATETIME )
{
// for intervals use time format for date times
const SvNumberformat* pFormat = pNumFormatter->GetEntry( nFmt );
if( pFormat )
- nFmt = pNumFormatter->GetStandardFormat( NUMBERFORMAT_TIME, pFormat->GetLanguage() );
+ nFmt = pNumFormatter->GetStandardFormat( css::util::NumberFormat::TIME, pFormat->GetLanguage() );
else
- nFmt = pNumFormatter->GetStandardFormat( NUMBERFORMAT_TIME );
+ nFmt = pNumFormatter->GetStandardFormat( css::util::NumberFormat::TIME );
}
- if( chart2::AxisType::DATE == m_nAxisType && ( eType != NUMBERFORMAT_DATE && eType != NUMBERFORMAT_DATETIME) )
+ if( chart2::AxisType::DATE == m_nAxisType && ( eType != css::util::NumberFormat::DATE && eType != css::util::NumberFormat::DATETIME) )
{
const SvNumberformat* pFormat = pNumFormatter->GetEntry( nFmt );
if( pFormat )
- nFmt = pNumFormatter->GetStandardFormat( NUMBERFORMAT_DATE, pFormat->GetLanguage() );
+ nFmt = pNumFormatter->GetStandardFormat( css::util::NumberFormat::DATE, pFormat->GetLanguage() );
else
- nFmt = pNumFormatter->GetStandardFormat( NUMBERFORMAT_DATE );
+ nFmt = pNumFormatter->GetStandardFormat( css::util::NumberFormat::DATE );
m_pFmtFldMax->SetFormatKey( nFmt );
m_pFmtFldMin->SetFormatKey( nFmt );
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx
index b1335b9..7ca90d6 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -353,15 +353,15 @@ void OFlatTable::impl_fillColumnInfo_nothrow(QuotedTokenizedString& aFirstLine,
{
switch (comphelper::getNumberFormatType(m_xNumberFormatter,nIndex))
{
- case NUMBERFORMAT_DATE:
+ case css::util::NumberFormat::DATE:
io_nType = DataType::DATE;
o_sTypeName = "DATE";
break;
- case NUMBERFORMAT_DATETIME:
+ case css::util::NumberFormat::DATETIME:
io_nType = DataType::TIMESTAMP;
o_sTypeName = "TIMESTAMP";
break;
- case NUMBERFORMAT_TIME:
+ case css::util::NumberFormat::TIME:
io_nType = DataType::TIME;
o_sTypeName = "TIME";
break;
diff --git a/cui/source/options/optupdt.cxx b/cui/source/options/optupdt.cxx
index 3a7c6715..e44e760 100644
--- a/cui/source/options/optupdt.cxx
+++ b/cui/source/options/optupdt.cxx
@@ -123,11 +123,11 @@ void SvxOnlineUpdateTabPage::UpdateLastCheckedText()
SvNumberFormatter *pNumberFormatter = new SvNumberFormatter( ::comphelper::getProcessComponentContext(), eUILang );
Color* pColor = NULL;
Date* pNullDate = pNumberFormatter->GetNullDate();
- sal_uInt32 nFormat = pNumberFormatter->GetStandardFormat( NUMBERFORMAT_DATE, eUILang );
+ sal_uInt32 nFormat = pNumberFormatter->GetStandardFormat( css::util::NumberFormat::DATE, eUILang );
pNumberFormatter->GetOutputString( aDate - *pNullDate, nFormat, aDateStr, &pColor );
- nFormat = pNumberFormatter->GetStandardFormat( NUMBERFORMAT_TIME, eUILang );
+ nFormat = pNumberFormatter->GetStandardFormat( css::util::NumberFormat::TIME, eUILang );
pNumberFormatter->GetOutputString( aTime.GetTimeInDays(), nFormat, aTimeStr, &pColor );
delete pColor;
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index ed5fb08..f83050c 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -838,7 +838,7 @@ bool callColumnFormatDialog(vcl::Window* _pParent,
pFormatDescriptor->Put(SfxBoolItem(SID_ATTR_NUMBERFORMAT_ONE_AREA, true));
if (!_pFormatter->IsTextFormat(_nFormatKey))
// text fields can only have text formats
- _nFormatKey = _pFormatter->GetStandardFormat(NUMBERFORMAT_TEXT,_pParent->GetSettings().GetLanguageTag().getLanguageType());
+ _nFormatKey = _pFormatter->GetStandardFormat(css::util::NumberFormat::TEXT,_pParent->GetSettings().GetLanguageTag().getLanguageType());
}
pFormatDescriptor->Put(SfxUInt32Item(SBA_DEF_FMTVALUE, _nFormatKey));
diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index 9155c27..7371b6c 100644
--- a/editeng/source/items/flditem.cxx
+++ b/editeng/source/items/flditem.cxx
@@ -499,7 +499,7 @@ OUString SvxDateField::GetFormatted( Date& aDate, SvxDateFormat eFormat, SvNumbe
nFormatKey = rFormatter.GetFormatIndex( NF_DATE_SYS_NNNNDMMMMYYYY, eLang );
break;
default:
- nFormatKey = rFormatter.GetStandardFormat( NUMBERFORMAT_DATE, eLang );
+ nFormatKey = rFormatter.GetStandardFormat( css::util::NumberFormat::DATE, eLang );
}
double fDiffDate = aDate - *(rFormatter.GetNullDate());
@@ -915,7 +915,7 @@ OUString SvxExtTimeField::GetFormatted( tools::Time& aTime, SvxTimeFormat eForma
break;
case SVXTIMEFORMAT_STANDARD:
default:
- nFormatKey = rFormatter.GetStandardFormat( NUMBERFORMAT_TIME, eLang );
+ nFormatKey = rFormatter.GetStandardFormat( css::util::NumberFormat::TIME, eLang );
}
double fFracTime = aTime.GetTimeInDays();
diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx
index cb54296..bb78921 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -261,7 +261,7 @@ namespace pcr
getTypedControlWindow()->SetFormatter( getTypedControlWindow()->StandardFormatter() );
SvNumberFormatter* pFormatter = getTypedControlWindow()->GetFormatter();
- sal_uLong nStandardDateTimeFormat = pFormatter->GetStandardFormat( NUMBERFORMAT_DATETIME, eSysLanguage );
+ sal_uLong nStandardDateTimeFormat = pFormatter->GetStandardFormat( css::util::NumberFormat::DATETIME, eSysLanguage );
getTypedControlWindow()->SetFormatKey( nStandardDateTimeFormat );
}
diff --git a/extensions/source/propctrlr/usercontrol.cxx b/extensions/source/propctrlr/usercontrol.cxx
index 783e43c..0c42e18 100644
--- a/extensions/source/propctrlr/usercontrol.cxx
+++ b/extensions/source/propctrlr/usercontrol.cxx
@@ -118,17 +118,17 @@ namespace pcr
double OFormatSampleControl::getPreviewValue( const SvNumberformat& i_rEntry )
{
double nValue = 1234.56789;
- switch ( i_rEntry.GetType() & ~NUMBERFORMAT_DEFINED )
+ switch ( i_rEntry.GetType() & ~css::util::NumberFormat::DEFINED )
{
- case NUMBERFORMAT_DATE:
+ case css::util::NumberFormat::DATE:
{
Date aCurrentDate( Date::SYSTEM );
static ::com::sun::star::util::Date STANDARD_DB_DATE(30,12,1899);
nValue = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toDate(static_cast<sal_Int32>(aCurrentDate.GetDate())),STANDARD_DB_DATE);
}
break;
- case NUMBERFORMAT_TIME:
- case NUMBERFORMAT_DATETIME:
+ case css::util::NumberFormat::TIME:
+ case css::util::NumberFormat::DATETIME:
{
tools::Time aCurrentTime( tools::Time::SYSTEM );
nValue = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toTime(aCurrentTime.GetTime()));
@@ -225,18 +225,18 @@ namespace pcr
DBG_ASSERT( pEntry, "OFormattedNumericControl::SetFormatDescription: invalid format key!" );
if ( pEntry )
{
- switch (pEntry->GetType() & ~NUMBERFORMAT_DEFINED)
+ switch (pEntry->GetType() & ~css::util::NumberFormat::DEFINED)
{
- case NUMBERFORMAT_NUMBER:
- case NUMBERFORMAT_CURRENCY:
- case NUMBERFORMAT_SCIENTIFIC:
- case NUMBERFORMAT_FRACTION:
- case NUMBERFORMAT_PERCENT:
+ case css::util::NumberFormat::NUMBER:
+ case css::util::NumberFormat::CURRENCY:
+ case css::util::NumberFormat::SCIENTIFIC:
+ case css::util::NumberFormat::FRACTION:
+ case css::util::NumberFormat::PERCENT:
m_nLastDecimalDigits = getTypedControlWindow()->GetDecimalDigits();
break;
- case NUMBERFORMAT_DATETIME:
- case NUMBERFORMAT_DATE:
- case NUMBERFORMAT_TIME:
+ case css::util::NumberFormat::DATETIME:
+ case css::util::NumberFormat::DATE:
+ case css::util::NumberFormat::TIME:
m_nLastDecimalDigits = 7;
break;
default:
diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx
index 98bec75..f81a97b 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -83,15 +83,15 @@ short lcl_GetRetFormat( OpCode eOpCode )
case ocIsEven:
case ocIsOdd:
case ocExact:
- return NUMBERFORMAT_LOGICAL;
+ return css::util::NumberFormat::LOGICAL;
case ocGetActDate:
case ocGetDate:
case ocEasterSunday :
- return NUMBERFORMAT_DATE;
+ return css::util::NumberFormat::DATE;
case ocGetActTime:
- return NUMBERFORMAT_DATETIME;
+ return css::util::NumberFormat::DATETIME;
case ocGetTime:
- return NUMBERFORMAT_TIME;
+ return css::util::NumberFormat::TIME;
case ocNPV:
case ocPV:
case ocSYD:
@@ -105,7 +105,7 @@ short lcl_GetRetFormat( OpCode eOpCode )
case ocPpmt:
case ocCumIpmt:
case ocCumPrinc:
- return NUMBERFORMAT_CURRENCY;
+ return css::util::NumberFormat::CURRENCY;
case ocRate:
case ocIRR:
case ocMIRR:
@@ -113,9 +113,9 @@ short lcl_GetRetFormat( OpCode eOpCode )
case ocEffective:
case ocNominal:
case ocPercentSign:
- return NUMBERFORMAT_PERCENT;
+ return css::util::NumberFormat::PERCENT;
default:
- return NUMBERFORMAT_NUMBER;
+ return css::util::NumberFormat::NUMBER;
}
}
@@ -532,7 +532,7 @@ FormulaCompiler::FormulaCompiler( FormulaTokenArray& rArr )
pStack( NULL ),
eLastOp( ocPush ),
nRecursion( 0 ),
- nNumFmt( NUMBERFORMAT_UNDEFINED ),
+ nNumFmt( css::util::NumberFormat::UNDEFINED ),
pc( 0 ),
meGrammar( formula::FormulaGrammar::GRAM_UNSPECIFIED ),
bAutoCorrect( false ),
@@ -550,7 +550,7 @@ FormulaCompiler::FormulaCompiler()
pStack( NULL ),
eLastOp( ocPush ),
nRecursion(0),
- nNumFmt( NUMBERFORMAT_UNDEFINED ),
+ nNumFmt( css::util::NumberFormat::UNDEFINED ),
pc( 0 ),
meGrammar( formula::FormulaGrammar::GRAM_UNSPECIFIED ),
bAutoCorrect( false ),
@@ -1174,7 +1174,7 @@ void FormulaCompiler::Factor()
}
else
{
- if( nNumFmt == NUMBERFORMAT_UNDEFINED )
+ if( nNumFmt == css::util::NumberFormat::UNDEFINED )
nNumFmt = lcl_GetRetFormat( eOp );
if ( IsOpCodeVolatile( eOp) )
@@ -1238,8 +1238,8 @@ void FormulaCompiler::Factor()
{
pFacToken = mpToken;
eOp = NextToken();
- if( nNumFmt == NUMBERFORMAT_UNDEFINED && eOp == ocNot )
- nNumFmt = NUMBERFORMAT_LOGICAL;
+ if( nNumFmt == css::util::NumberFormat::UNDEFINED && eOp == ocNot )
+ nNumFmt = css::util::NumberFormat::LOGICAL;
if (eOp == ocOpen)
{
NextToken();
@@ -1688,8 +1688,8 @@ bool FormulaCompiler::CompileTokenArray()
if ( bWasForced )
pArr->SetRecalcModeForced();
}
- if( nNumFmt == NUMBERFORMAT_UNDEFINED )
- nNumFmt = NUMBERFORMAT_NUMBER;
+ if( nNumFmt == css::util::NumberFormat::UNDEFINED )
+ nNumFmt = css::util::NumberFormat::NUMBER;
return glSubTotal;
}
diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx
index 4683f1d..f9a116b 100644
--- a/include/svl/zforlist.hxx
+++ b/include/svl/zforlist.hxx
@@ -26,6 +26,7 @@
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/i18n/NumberFormatCode.hpp>
+#include <com/sun/star/util/NumberFormat.hpp>
#include <unotools/localedatawrapper.hxx>
#include <unotools/numberformatcodewrapper.hxx>
#include <tools/link.hxx>
@@ -53,24 +54,6 @@ namespace com { namespace sun { namespace star {
#define SV_COUNTRY_LANGUAGE_OFFSET 10000 // Max count of formats per country/language
#define SV_MAX_ANZ_STANDARD_FORMATE 100 // Max count of builtin default formats per CL
-// Format types
-#ifndef NUMBERFORMAT_ALL
-// also defined in com/sun/star/util/NumberFormat.hpp
-//! => put in single .idl file and include here
-#define NUMBERFORMAT_ALL 0x000 /// Just for Output of total list, not a real format type
-#define NUMBERFORMAT_DEFINED 0x001 /// Format defined by user
-#define NUMBERFORMAT_DATE 0x002 /// Number as date
-#define NUMBERFORMAT_TIME 0x004 /// Number as time
-#define NUMBERFORMAT_CURRENCY 0x008 /// Number as currency
-#define NUMBERFORMAT_NUMBER 0x010 /// Any "normal" number format
-#define NUMBERFORMAT_SCIENTIFIC 0x020 /// Number as scientific
-#define NUMBERFORMAT_FRACTION 0x040 /// Number as fraction
-#define NUMBERFORMAT_PERCENT 0x080 /// Number as percent
-#define NUMBERFORMAT_TEXT 0x100 /// Text format
-#define NUMBERFORMAT_DATETIME 0x006 /// Number as date and time
-#define NUMBERFORMAT_LOGICAL 0x400 /// Number as boolean value
-#define NUMBERFORMAT_UNDEFINED 0x800 /// Format undefined yet in analyzing
-#endif
#define NUMBERFORMAT_ENTRY_NOT_FOUND (sal_uInt32)(0xffffffff) /// MAX_ULONG
@@ -597,8 +580,8 @@ public:
sal_uInt16 GetStandardPrec();
/// Return whether zero suppression is switched on
bool GetNoZero();
- /** Get the type of a format (or NUMBERFORMAT_UNDEFINED if no entry),
- but with NUMBERFORMAT_DEFINED masked out */
+ /** Get the type of a format (or css::util::NumberFormat::UNDEFINED if no entry),
+ but with css::util::NumberFormat::DEFINED masked out */
short GetType(sal_uInt32 nFIndex);
/// As the name says
@@ -720,7 +703,7 @@ public:
sal_uInt16 GetCurrencyFormatStrings( NfWSStringsDtor&, const NfCurrencyEntry&,
bool bBank ) const;
- /** Whether nFormat is of type NUMBERFORMAT_CURRENCY and the format code
+ /** Whether nFormat is of type css::util::NumberFormat::CURRENCY and the format code
contains a new SYMBOLTYPE_CURRENCY and if so which one [$xxx-nnn].
If ppEntry is not NULL and exactly one entry is found, a [$xxx-nnn] is
returned, even if the format code only contains [$xxx] !
diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx
index 631a20b..e6d4bf9 100644
--- a/include/svl/zformat.hxx
+++ b/include/svl/zformat.hxx
@@ -179,7 +179,7 @@ public:
~SvNumberformat();
- /// Get type of format, may include NUMBERFORMAT_DEFINED bit
+ /// Get type of format, may include css::util::NumberFormat::DEFINED bit
short GetType() const { return eType; }
void SetType(const short eSetType) { eType = eSetType; }
@@ -215,12 +215,12 @@ public:
bool GetOutputString( const OUString& sString, OUString& OutString, Color** ppColor );
// True if type text
- bool IsTextFormat() const { return (eType & NUMBERFORMAT_TEXT) != 0; }
+ bool IsTextFormat() const { return (eType & css::util::NumberFormat::TEXT) != 0; }
// True if 4th subformat present
bool HasTextFormat() const
{
return (NumFor[3].GetCount() > 0) ||
- (NumFor[3].Info().eScannedType == NUMBERFORMAT_TEXT);
+ (NumFor[3].Info().eScannedType == css::util::NumberFormat::TEXT);
}
void GetFormatSpecialInfo(bool& bThousand,
@@ -316,7 +316,7 @@ public:
bool bQuoteSymbol );
// If a new SYMBOLTYPE_CURRENCY is contained if the format is of type
- // NUMBERFORMAT_CURRENCY, and if so the symbol xxx and the extension nnn
+ // css::util::NumberFormat::CURRENCY, and if so the symbol xxx and the extension nnn
// of [$xxx-nnn] are returned
bool GetNewCurrencySymbol( OUString& rSymbol, OUString& rExtension ) const;
diff --git a/sc/source/core/data/clipcontext.cxx b/sc/source/core/data/clipcontext.cxx
index 654bad7..9988a48 100644
--- a/sc/source/core/data/clipcontext.cxx
+++ b/sc/source/core/data/clipcontext.cxx
@@ -323,7 +323,7 @@ bool CopyFromClipContext::isDateCell( const ScColumn& rCol, SCROW nRow ) const
{
sal_uLong nNumIndex = static_cast<const SfxUInt32Item*>(rCol.GetAttr(nRow, ATTR_VALUE_FORMAT))->GetValue();
short nType = mpClipDoc->GetFormatTable()->GetType(nNumIndex);
- return (nType == NUMBERFORMAT_DATE) || (nType == NUMBERFORMAT_TIME) || (nType == NUMBERFORMAT_DATETIME);
+ return (nType == css::util::NumberFormat::DATE) || (nType == css::util::NumberFormat::TIME) || (nType == css::util::NumberFormat::DATETIME);
}
CopyToClipContext::CopyToClipContext(
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 111b254..ab7cd69 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1225,7 +1225,7 @@ bool canCopyValue(const ScDocument& rDoc, const ScAddress& rPos, InsertDeleteFla
{
sal_uInt32 nNumIndex = static_cast<const SfxUInt32Item*>(rDoc.GetAttr(rPos, ATTR_VALUE_FORMAT))->GetValue();
short nType = rDoc.GetFormatTable()->GetType(nNumIndex);
- if ((nType == NUMBERFORMAT_DATE) || (nType == NUMBERFORMAT_TIME) || (nType == NUMBERFORMAT_DATETIME))
+ if ((nType == css::util::NumberFormat::DATE) || (nType == css::util::NumberFormat::TIME) || (nType == css::util::NumberFormat::DATETIME))
return ((nFlags & IDF_DATETIME) != IDF_NONE);
return (nFlags & IDF_VALUE) != IDF_NONE;
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index b8c99c5..4c0bf2a 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -1588,7 +1588,7 @@ namespace {
void applyTextNumFormat( ScColumn& rCol, SCROW nRow, SvNumberFormatter* pFormatter )
{
- sal_uInt32 nFormat = pFormatter->GetStandardFormat(NUMBERFORMAT_TEXT);
+ sal_uInt32 nFormat = pFormatter->GetStandardFormat(css::util::NumberFormat::TEXT);
ScPatternAttr aNewAttrs(rCol.GetDoc().GetPool());
SfxItemSet& rSet = aNewAttrs.GetItemSet();
rSet.Put(SfxUInt32Item(ATTR_VALUE_FORMAT, nFormat));
@@ -1620,7 +1620,7 @@ bool ScColumn::ParseString(
nIndex = nOldIndex = GetNumberFormat( nRow );
if ( rString.getLength() > 1
- && aParam.mpNumFormatter->GetType(nIndex) != NUMBERFORMAT_TEXT )
+ && aParam.mpNumFormatter->GetType(nIndex) != css::util::NumberFormat::TEXT )
cFirstChar = rString[0];
else
cFirstChar = 0; // Text
@@ -1690,9 +1690,9 @@ bool ScColumn::ParseString(
bool bOverwrite = false;
if ( pOldFormat )
{
- short nOldType = pOldFormat->GetType() & ~NUMBERFORMAT_DEFINED;
- if ( nOldType == NUMBERFORMAT_NUMBER || nOldType == NUMBERFORMAT_DATE ||
- nOldType == NUMBERFORMAT_TIME || nOldType == NUMBERFORMAT_LOGICAL )
+ short nOldType = pOldFormat->GetType() & ~css::util::NumberFormat::DEFINED;
+ if ( nOldType == css::util::NumberFormat::NUMBER || nOldType == css::util::NumberFormat::DATE ||
+ nOldType == css::util::NumberFormat::TIME || nOldType == css::util::NumberFormat::LOGICAL )
{
if ( nOldIndex == aParam.mpNumFormatter->GetStandardFormat(
nOldType, pOldFormat->GetLanguage() ) )
@@ -1701,7 +1701,7 @@ bool ScColumn::ParseString(
}
}
}
- if ( !bOverwrite && aParam.mpNumFormatter->GetType( nIndex ) == NUMBERFORMAT_LOGICAL )
+ if ( !bOverwrite && aParam.mpNumFormatter->GetType( nIndex ) == css::util::NumberFormat::LOGICAL )
{
bOverwrite = true; // overwrite anything if boolean was detected
}
@@ -2013,7 +2013,7 @@ class FilterEntriesHandler
short nType = pFormatter->GetType(nFormat);
bool bDate = false;
- if ((nType & NUMBERFORMAT_DATE) && !(nType & NUMBERFORMAT_TIME))
+ if ((nType & css::util::NumberFormat::DATE) && !(nType & css::util::NumberFormat::TIME))
{
// special case for date values. Disregard the time
// element if the number format is of date type.
diff --git a/sc/source/core/data/dbdocutl.cxx b/sc/source/core/data/dbdocutl.cxx
index 5d51fe8..caf30c8 100644
--- a/sc/source/core/data/dbdocutl.cxx
+++ b/sc/source/core/data/dbdocutl.cxx
@@ -56,7 +56,7 @@ void ScDatabaseDocUtil::PutData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB
case sdbc::DataType::BOOLEAN:
//TODO: use language from doc (here, date/time and currency)?
nFormatIndex = pDoc->GetFormatTable()->GetStandardFormat(
- NUMBERFORMAT_LOGICAL, ScGlobal::eLnge );
+ css::util::NumberFormat::LOGICAL, ScGlobal::eLnge );
nVal = (xRow->getBoolean(nRowPos) ? 1 : 0);
bEmptyFlag = ( nVal == 0.0 ) && xRow->wasNull();
bValue = true;
@@ -88,7 +88,7 @@ void ScDatabaseDocUtil::PutData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB
{
SvNumberFormatter* pFormTable = pDoc->GetFormatTable();
nFormatIndex = pFormTable->GetStandardFormat(
- NUMBERFORMAT_DATE, ScGlobal::eLnge );
+ css::util::NumberFormat::DATE, ScGlobal::eLnge );
util::Date aDate = xRow->getDate(nRowPos);
nVal = Date( aDate.Day, aDate.Month, aDate.Year ) -
@@ -102,7 +102,7 @@ void ScDatabaseDocUtil::PutData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB
{
SvNumberFormatter* pFormTable = pDoc->GetFormatTable();
nFormatIndex = pFormTable->GetStandardFormat(
- NUMBERFORMAT_TIME, ScGlobal::eLnge );
+ css::util::NumberFormat::TIME, ScGlobal::eLnge );
util::Time aTime = xRow->getTime(nRowPos);
nVal = aTime.Hours / static_cast<double>(::tools::Time::hourPerDay) +
@@ -118,7 +118,7 @@ void ScDatabaseDocUtil::PutData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB
{
SvNumberFormatter* pFormTable = pDoc->GetFormatTable();
nFormatIndex = pFormTable->GetStandardFormat(
- NUMBERFORMAT_DATETIME, ScGlobal::eLnge );
+ css::util::NumberFormat::DATETIME, ScGlobal::eLnge );
util::DateTime aStamp = xRow->getTimestamp(nRowPos);
nVal = ( Date( aStamp.Day, aStamp.Month, aStamp.Year ) -
@@ -150,7 +150,7 @@ void ScDatabaseDocUtil::PutData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB
if ( bValue && bCurrency )
nFormatIndex = pDoc->GetFormatTable()->GetStandardFormat(
- NUMBERFORMAT_CURRENCY, ScGlobal::eLnge );
+ css::util::NumberFormat::CURRENCY, ScGlobal::eLnge );
ScAddress aPos(nCol, nRow, nTab);
if (bEmptyFlag)
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index 168f929..77cf693 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -109,7 +109,7 @@ ScValueIterator::ScValueIterator( ScDocument* pDocument, const ScRange& rRange,
, mnTab(0)
, nAttrEndRow(0)
, mnSubTotalFlags(nSubTotalFlags)
- , nNumFmtType(NUMBERFORMAT_UNDEFINED)
+ , nNumFmtType(css::util::NumberFormat::UNDEFINED)
, bNumValid(false)
, bCalcAsShown(pDocument->GetDocOptions().IsCalcAsShown())
, bTextAsZero(bTextZero)
@@ -253,7 +253,7 @@ bool ScValueIterator::GetThis(double& rValue, sal_uInt16& rErr)
{
rErr = 0;
rValue = 0.0;
- nNumFmtType = NUMBERFORMAT_NUMBER;
+ nNumFmtType = css::util::NumberFormat::NUMBER;
nNumFmtIndex = 0;
bNumValid = true;
return true;
@@ -427,7 +427,7 @@ bool ScDBQueryDataIterator::DataAccessInternal::getCurrent(Value& rValue)
nAttrEndRow, pNewAttrArray, nRow, mpDoc );
rValue.mfValue = mpDoc->RoundValueAsShown( rValue.mfValue, nNumFormat );
}
- nNumFmtType = NUMBERFORMAT_NUMBER;
+ nNumFmtType = css::util::NumberFormat::NUMBER;
nNumFmtIndex = 0;
rValue.mnError = 0;
return true; // Found it!
@@ -2109,7 +2109,7 @@ ScHorizontalValueIterator::ScHorizontalValueIterator( ScDocument* pDocument,
pDoc( pDocument ),
nNumFmtIndex(0),
nEndTab( rRange.aEnd.Tab() ),
- nNumFmtType( NUMBERFORMAT_UNDEFINED ),
+ nNumFmtType( css::util::NumberFormat::UNDEFINED ),
bNumValid( false ),
bCalcAsShown( pDocument->GetDocOptions().IsCalcAsShown() ),
bTextAsZero( bTextZero )
@@ -2204,7 +2204,7 @@ bool ScHorizontalValueIterator::GetNext( double& rValue, sal_uInt16& rErr )
{
rErr = 0;
rValue = 0.0;
- nNumFmtType = NUMBERFORMAT_NUMBER;
+ nNumFmtType = css::util::NumberFormat::NUMBER;
nNumFmtIndex = 0;
bNumValid = true;
bFound = true;
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index 01667c3..6d0c89d 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -655,8 +655,8 @@ bool ScDocument::GetSelectionFunction( ScSubTotalFunc eFunc,
double ScDocument::RoundValueAsShown( double fVal, sal_uInt32 nFormat ) const
{
short nType;
- if ( (nType = GetFormatTable()->GetType( nFormat )) != NUMBERFORMAT_DATE
- && nType != NUMBERFORMAT_TIME && nType != NUMBERFORMAT_DATETIME )
+ if ( (nType = GetFormatTable()->GetType( nFormat )) != css::util::NumberFormat::DATE
+ && nType != css::util::NumberFormat::TIME && nType != css::util::NumberFormat::DATETIME )
{
short nPrecision;
if ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0)
@@ -664,10 +664,10 @@ double ScDocument::RoundValueAsShown( double fVal, sal_uInt32 nFormat ) const
nPrecision = (short)GetFormatTable()->GetFormatPrecision( nFormat );
switch ( nType )
{
- case NUMBERFORMAT_PERCENT: // 0.41% == 0.0041
+ case css::util::NumberFormat::PERCENT: // 0.41% == 0.0041
nPrecision += 2;
break;
- case NUMBERFORMAT_SCIENTIFIC: // 1.23e-3 == 0.00123
+ case css::util::NumberFormat::SCIENTIFIC: // 1.23e-3 == 0.00123
{
if ( fVal > 0.0 )
nPrecision = sal::static_int_cast<short>( nPrecision - (short)floor( log10( fVal ) ) );
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 9e099ef..e964f2a 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -3412,7 +3412,7 @@ sal_uInt16 ScDocument::GetStringForFormula( const ScAddress& rPos, OUString& rSt
{
double fVal = pFCell->GetValue();
sal_uInt32 nIndex = pFormatter->GetStandardFormat(
- NUMBERFORMAT_NUMBER,
+ css::util::NumberFormat::NUMBER,
ScGlobal::eLnge);
pFormatter->GetInputLineString(fVal, nIndex, aStr);
}
@@ -3424,7 +3424,7 @@ sal_uInt16 ScDocument::GetStringForFormula( const ScAddress& rPos, OUString& rSt
{
double fVal = aCell.mfValue;
sal_uInt32 nIndex = pFormatter->GetStandardFormat(
- NUMBERFORMAT_NUMBER,
+ css::util::NumberFormat::NUMBER,
ScGlobal::eLnge);
pFormatter->GetInputLineString(fVal, nIndex, aStr);
}
@@ -3541,7 +3541,7 @@ void ScDocument::GetNumberFormatInfo( short& nType, sal_uLong& nIndex,
}
else
{
- nType = NUMBERFORMAT_UNDEFINED;
+ nType = css::util::NumberFormat::UNDEFINED;
nIndex = 0;
}
}
diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index c6e8162..77a2848 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -415,7 +415,7 @@ bool ScDPCache::InitFromDataBase(DBConnector& rDB)
SCROW nRow = 0;
do
{
- short nFormatType = NUMBERFORMAT_UNDEFINED;
+ short nFormatType = css::util::NumberFormat::UNDEFINED;
aData.SetEmpty();
rDB.getValue(nCol, aData, nFormatType);
aBuckets.push_back(Bucket(aData, 0, nRow));
@@ -884,7 +884,7 @@ bool ScDPCache::IsDateDimension( long nDim ) const
return false;
short eType = pFormatter->GetType(maFields[nDim].mnNumFormat);
- return (eType == NUMBERFORMAT_DATE) || (eType == NUMBERFORMAT_DATETIME);
+ return (eType == css::util::NumberFormat::DATE) || (eType == css::util::NumberFormat::DATETIME);
}
long ScDPCache::GetDimMemberCount(long nDim) const
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index ed402a2..5e9fd68 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -173,7 +173,7 @@ OUString DBConnector::getColumnLabel(long nCol) const
void DBConnector::getValue(long nCol, ScDPItemData &rData, short& rNumType) const
{
- rNumType = NUMBERFORMAT_NUMBER;
+ rNumType = css::util::NumberFormat::NUMBER;
sal_Int32 nType = mxMetaData->getColumnType(nCol+1);
try
@@ -184,7 +184,7 @@ void DBConnector::getValue(long nCol, ScDPItemData &rData, short& rNumType) cons
case sdbc::DataType::BIT:
case sdbc::DataType::BOOLEAN:
{
- rNumType = NUMBERFORMAT_LOGICAL;
+ rNumType = css::util::NumberFormat::LOGICAL;
fValue = mxRow->getBoolean(nCol+1) ? 1 : 0;
rData.SetValue(fValue);
break;
@@ -206,7 +206,7 @@ void DBConnector::getValue(long nCol, ScDPItemData &rData, short& rNumType) cons
}
case sdbc::DataType::DATE:
{
- rNumType = NUMBERFORMAT_DATE;
+ rNumType = css::util::NumberFormat::DATE;
util::Date aDate = mxRow->getDate(nCol+1);
fValue = Date(aDate.Day, aDate.Month, aDate.Year) - maNullDate;
@@ -215,7 +215,7 @@ void DBConnector::getValue(long nCol, ScDPItemData &rData, short& rNumType) cons
}
case sdbc::DataType::TIME:
{
- rNumType = NUMBERFORMAT_TIME;
+ rNumType = css::util::NumberFormat::TIME;
util::Time aTime = mxRow->getTime(nCol+1);
fValue = aTime.Hours / static_cast<double>(::tools::Time::hourPerDay) +
@@ -227,7 +227,7 @@ void DBConnector::getValue(long nCol, ScDPItemData &rData, short& rNumType) cons
}
case sdbc::DataType::TIMESTAMP:
{
- rNumType = NUMBERFORMAT_DATETIME;
+ rNumType = css::util::NumberFormat::DATETIME;
util::DateTime aStamp = mxRow->getTimestamp(nCol+1);
fValue = ( Date( aStamp.Day, aStamp.Month, aStamp.Year ) - maNullDate ) +
diff --git a/sc/source/core/data/dputil.cxx b/sc/source/core/data/dputil.cxx
index c8a18e9..9e857cc 100644
--- a/sc/source/core/data/dputil.cxx
+++ b/sc/source/core/data/dputil.cxx
@@ -39,7 +39,7 @@ OUString getTwoDigitString(sal_Int32 nValue)
void appendDateStr(OUStringBuffer& rBuffer, double fValue, SvNumberFormatter* pFormatter)
{
- sal_uLong nFormat = pFormatter->GetStandardFormat( NUMBERFORMAT_DATE, ScGlobal::eLnge );
+ sal_uLong nFormat = pFormatter->GetStandardFormat( css::util::NumberFormat::DATE, ScGlobal::eLnge );
OUString aString;
pFormatter->GetInputLineString(fValue, nFormat, aString);
rBuffer.append(aString);
@@ -195,7 +195,7 @@ namespace {
void lcl_AppendDateStr( OUStringBuffer& rBuffer, double fValue, SvNumberFormatter* pFormatter )
{
- sal_uLong nFormat = pFormatter->GetStandardFormat( NUMBERFORMAT_DATE, ScGlobal::eLnge );
+ sal_uLong nFormat = pFormatter->GetStandardFormat( css::util::NumberFormat::DATE, ScGlobal::eLnge );
OUString aString;
pFormatter->GetInputLineString( fValue, nFormat, aString );
rBuffer.append( aString );
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 2d3522d..d4bba7d 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -454,7 +454,7 @@ ScFormulaCellGroup::ScFormulaCellGroup() :
mpCompiledFormula(NULL),
mpTopCell(NULL),
mnLength(0),
- mnFormatType(NUMBERFORMAT_NUMBER),
+ mnFormatType(css::util::NumberFormat::NUMBER),
mbInvariant(false),
mbSubTotal(false),
meCalcState(sc::GroupCalcEnabled),
@@ -595,7 +595,7 @@ ScFormulaCell::ScFormulaCell( ScDocument* pDoc, const ScAddress& rPos ) :
pPreviousTrack(0),
pNextTrack(0),
nSeenInIteration(0),
- nFormatType(NUMBERFORMAT_NUMBER),
+ nFormatType(css::util::NumberFormat::NUMBER),
cMatrixFlag(MM_NONE),
bDirty(false),
bChanged(false),
@@ -625,7 +625,7 @@ ScFormulaCell::ScFormulaCell( ScDocument* pDoc, const ScAddress& rPos,
pPreviousTrack(0),
pNextTrack(0),
nSeenInIteration(0),
- nFormatType ( NUMBERFORMAT_NUMBER ),
+ nFormatType ( css::util::NumberFormat::NUMBER ),
cMatrixFlag ( cMatInd ),
bDirty( true ), // -> Because of the use of the Auto Pilot Function was: cMatInd != 0
bChanged( false ),
@@ -659,7 +659,7 @@ ScFormulaCell::ScFormulaCell(
pPreviousTrack(0),
pNextTrack(0),
nSeenInIteration(0),
- nFormatType ( NUMBERFORMAT_NUMBER ),
+ nFormatType ( css::util::NumberFormat::NUMBER ),
cMatrixFlag ( cMatInd ),
bDirty( true ),
bChanged( false ),
@@ -708,7 +708,7 @@ ScFormulaCell::ScFormulaCell(
pPreviousTrack(0),
pNextTrack(0),
nSeenInIteration(0),
- nFormatType ( NUMBERFORMAT_NUMBER ),
+ nFormatType ( css::util::NumberFormat::NUMBER ),
cMatrixFlag ( cMatInd ),
bDirty( true ),
bChanged( false ),
@@ -1795,7 +1795,7 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
sal_Int32 nFormatIndex = p->GetRetFormatIndex();
// don't set text format as hard format
- if(nFormatType == NUMBERFORMAT_TEXT)
+ if(nFormatType == css::util::NumberFormat::TEXT)
nFormatIndex = 0;
else if((nFormatIndex % SV_COUNTRY_LANGUAGE_OFFSET) == 0)
nFormatIndex = ScGlobal::GetStandardFormat(*pDocument->GetFormatTable(),
@@ -1880,9 +1880,9 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
// Precision as shown?
if ( aResult.IsValue() && !p->GetError()
&& pDocument->GetDocOptions().IsCalcAsShown()
- && nFormatType != NUMBERFORMAT_DATE
- && nFormatType != NUMBERFORMAT_TIME
- && nFormatType != NUMBERFORMAT_DATETIME )
+ && nFormatType != css::util::NumberFormat::DATE
+ && nFormatType != css::util::NumberFormat::TIME
+ && nFormatType != css::util::NumberFormat::DATETIME )
{
sal_uLong nFormat = pDocument->GetNumberFormat( aPos );
aResult.SetDouble( pDocument->RoundValueAsShown(
@@ -2298,7 +2298,7 @@ void ScFormulaCell::GetURLResult( OUString& rURL, OUString& rCellText )
sal_uLong nCellFormat = pDocument->GetNumberFormat( aPos );
SvNumberFormatter* pFormatter = pDocument->GetFormatTable();
- sal_uLong nURLFormat = ScGlobal::GetStandardFormat( *pFormatter, nCellFormat, NUMBERFORMAT_NUMBER);
+ sal_uLong nURLFormat = ScGlobal::GetStandardFormat( *pFormatter, nCellFormat, css::util::NumberFormat::NUMBER);
if ( IsValue() )
{
diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx
index 30f397a..116371a 100644
--- a/sc/source/core/data/stlsheet.cxx
+++ b/sc/source/core/data/stlsheet.cxx
@@ -228,7 +228,7 @@ SfxItemSet& ScStyleSheet::GetItemSet()
ScDocument* pDoc = static_cast<ScStyleSheetPool&>(GetPool()).GetDocument();
if ( pDoc )
{
- sal_uLong nNumFmt = pDoc->GetFormatTable()->GetStandardFormat( NUMBERFORMAT_CURRENCY,ScGlobal::eLnge );
+ sal_uLong nNumFmt = pDoc->GetFormatTable()->GetStandardFormat( css::util::NumberFormat::CURRENCY,ScGlobal::eLnge );
pSet->Put( SfxUInt32Item( ATTR_VALUE_FORMAT, nNumFmt ) );
}
}
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 22528bd..a482546 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2337,12 +2337,12 @@ public:
{
short nNumFmtType = pEntry->GetType();
/* NOTE: Omitting the check for absence of
- * NUMBERFORMAT_TIME would include also date+time formatted
+ * css::util::NumberFormat::TIME would include also date+time formatted
* values of the same day. That may be desired in some
* cases, querying all time values of a day, but confusing
* in other cases. A user can always setup a standard
* filter query for x >= date AND x < date+1 */
- if ((nNumFmtType & NUMBERFORMAT_DATE) && !(nNumFmtType & NUMBERFORMAT_TIME))
+ if ((nNumFmtType & css::util::NumberFormat::DATE) && !(nNumFmtType & css::util::NumberFormat::TIME))
{
// The format is of date type. Strip off the time
// element.
@@ -2871,7 +2871,7 @@ public:
if (pEntry)
{
short nNumFmtType = pEntry->GetType();
- if (!((nNumFmtType & NUMBERFORMAT_DATE) && !(nNumFmtType & NUMBERFORMAT_TIME)))
+ if (!((nNumFmtType & css::util::NumberFormat::DATE) && !(nNumFmtType & css::util::NumberFormat::TIME)))
rItem.meType = ScQueryEntry::ByValue; // not a date only
}
else
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index 1fc9884..e3952bc 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -227,7 +227,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
if (eCellType == CELLTYPE_VALUE)
{
sal_uInt32 nFormat = static_cast<const SfxUInt32Item*>(GetAttr(nCol,nRow,ATTR_VALUE_FORMAT))->GetValue();
- bool bDate = ( pDocument->GetFormatTable()->GetType(nFormat) == NUMBERFORMAT_DATE );
+ bool bDate = ( pDocument->GetFormatTable()->GetType(nFormat) == css::util::NumberFormat::DATE );
if (bDate)
{
if (nCount > 1)
diff --git a/sc/source/core/tool/chartpos.cxx b/sc/source/core/tool/chartpos.cxx
index 8debf6b..494fd43 100644
--- a/sc/source/core/tool/chartpos.cxx
+++ b/sc/source/core/tool/chartpos.cxx
@@ -34,7 +34,7 @@ namespace
//treat dates like text #i25706#
sal_uInt32 nNumberFormat = pDocument->GetNumberFormat( ScAddress( nCol, nRow, nTab ) );
short nType = pDocument->GetFormatTable()->GetType(nNumberFormat);
- bool bIsDate = (nType & NUMBERFORMAT_DATE);
+ bool bIsDate = (nType & css::util::NumberFormat::DATE);
bReturn = !bIsDate;
}
return bReturn;
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 926e56b..84611ee 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -2553,10 +2553,10 @@ bool ScCompiler::IsValue( const OUString& rSym )
// to serial, because the serial would be wrong if null-date changed.
// Usually it wouldn't be accepted anyway because the date separator
// clashed with other separators or operators.
- if (nType & (NUMBERFORMAT_TIME | NUMBERFORMAT_DATE))
+ if (nType & (css::util::NumberFormat::TIME | css::util::NumberFormat::DATE))
return false;
- if (nType == NUMBERFORMAT_LOGICAL)
+ if (nType == css::util::NumberFormat::LOGICAL)
{
const sal_Unicode* p = aFormula.getStr() + nSrcPos;
while( *p == ' ' )
@@ -2565,7 +2565,7 @@ bool ScCompiler::IsValue( const OUString& rSym )
return false; // Boolean function instead.
}
- if( nType == NUMBERFORMAT_TEXT )
+ if( nType == css::util::NumberFormat::TEXT )
// HACK: number too big!
SetError( errIllegalArgument );
maRawToken.SetDouble( fVal );
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 12f77a6..a5ac375 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -195,7 +195,7 @@ void ScInterpreter::ScIfJump()
}
else
{ // no parameter given for THEN
- nFuncFmtType = NUMBERFORMAT_LOGICAL;
+ nFuncFmtType = css::util::NumberFormat::LOGICAL;
PushInt(1);
aCode.Jump( pJump[ nJumpCount ], pJump[ nJumpCount ] );
}
@@ -208,7 +208,7 @@ void ScInterpreter::ScIfJump()
}
else
{ // no parameter given for ELSE
- nFuncFmtType = NUMBERFORMAT_LOGICAL;
+ nFuncFmtType = css::util::NumberFormat::LOGICAL;
PushInt(0);
aCode.Jump( pJump[ nJumpCount ], pJump[ nJumpCount ] );
}
@@ -888,7 +888,7 @@ double ScInterpreter::Compare()
}
if( nGlobalError )
return 0;
- nCurFmtType = nFuncFmtType = NUMBERFORMAT_LOGICAL;
+ nCurFmtType = nFuncFmtType = css::util::NumberFormat::LOGICAL;
return sc::CompareFunc(aComp.maCells[0], aComp.maCells[1], aComp.mbIgnoreCase);
}
@@ -958,7 +958,7 @@ sc::RangeMatrix ScInterpreter::CompareMat( ScQueryOp eOp, sc::CompareOptions* pO
if (nGlobalError)
{
- nCurFmtType = nFuncFmtType = NUMBERFORMAT_LOGICAL;
+ nCurFmtType = nFuncFmtType = css::util::NumberFormat::LOGICAL;
return aRes;
}
@@ -1049,7 +1049,7 @@ sc::RangeMatrix ScInterpreter::CompareMat( ScQueryOp eOp, sc::CompareOptions* pO
return aRes;
}
- nCurFmtType = nFuncFmtType = NUMBERFORMAT_LOGICAL;
+ nCurFmtType = nFuncFmtType = css::util::NumberFormat::LOGICAL;
return aRes;
}
@@ -1179,7 +1179,7 @@ void ScInterpreter::ScGreaterEqual()
void ScInterpreter::ScAnd()
{
- nFuncFmtType = NUMBERFORMAT_LOGICAL;
+ nFuncFmtType = css::util::NumberFormat::LOGICAL;
short nParamCount = GetByte();
if ( MustHaveParamCountMin( nParamCount, 1 ) )
{
@@ -1278,7 +1278,7 @@ void ScInterpreter::ScAnd()
void ScInterpreter::ScOr()
{
- nFuncFmtType = NUMBERFORMAT_LOGICAL;
+ nFuncFmtType = css::util::NumberFormat::LOGICAL;
short nParamCount = GetByte();
if ( MustHaveParamCountMin( nParamCount, 1 ) )
{
@@ -1379,7 +1379,7 @@ void ScInterpreter::ScOr()
void ScInterpreter::ScXor()
{
- nFuncFmtType = NUMBERFORMAT_LOGICAL;
+ nFuncFmtType = css::util::NumberFormat::LOGICAL;
short nParamCount = GetByte();
if ( MustHaveParamCountMin( nParamCount, 1 ) )
{
@@ -1523,7 +1523,7 @@ void ScInterpreter::ScNeg()
void ScInterpreter::ScPercentSign()
{
- nFuncFmtType = NUMBERFORMAT_PERCENT;
+ nFuncFmtType = css::util::NumberFormat::PERCENT;
const FormulaToken* pSaveCur = pCur;
sal_uInt8 nSavePar = cPar;
PushInt( 100 );
@@ -1537,7 +1537,7 @@ void ScInterpreter::ScPercentSign()
void ScInterpreter::ScNot()
{
- nFuncFmtType = NUMBERFORMAT_LOGICAL;
+ nFuncFmtType = css::util::NumberFormat::LOGICAL;
switch ( GetStackType() )
{
case svMatrix :
@@ -1678,13 +1678,13 @@ void ScInterpreter::ScRandom()
void ScInterpreter::ScTrue()
{
- nFuncFmtType = NUMBERFORMAT_LOGICAL;
+ nFuncFmtType = css::util::NumberFormat::LOGICAL;
PushInt(1);
}
void ScInterpreter::ScFalse()
{
- nFuncFmtType = NUMBERFORMAT_LOGICAL;
+ nFuncFmtType = css::util::NumberFormat::LOGICAL;
PushInt(0);
}
@@ -1827,7 +1827,7 @@ void ScInterpreter::ScSqrt()
void ScInterpreter::ScIsEmpty()
{
short nRes = 0;
- nFuncFmtType = NUMBERFORMAT_LOGICAL;
+ nFuncFmtType = css::util::NumberFormat::LOGICAL;
switch ( GetRawStackType() )
{
case svEmptyCell:
@@ -1881,7 +1881,7 @@ void ScInterpreter::ScIsEmpty()
bool ScInterpreter::IsString()
{
- nFuncFmtType = NUMBERFORMAT_LOGICAL;
+ nFuncFmtType = css::util::NumberFormat::LOGICAL;
bool nRes = false;
switch ( GetRawStackType() )
{
@@ -1968,7 +1968,7 @@ void ScInterpreter::ScIsLogical()
if (aCell.hasNumeric())
{
sal_uLong nFormat = GetCellNumberFormat(aAdr, aCell);
- nRes = (pFormatter->GetType(nFormat) == NUMBERFORMAT_LOGICAL);
+ nRes = (pFormatter->GetType(nFormat) == css::util::NumberFormat::LOGICAL);
}
}
}
@@ -1980,9 +1980,9 @@ void ScInterpreter::ScIsLogical()
default:
PopError();
if ( !nGlobalError )
- nRes = ( nCurFmtType == NUMBERFORMAT_LOGICAL );
+ nRes = ( nCurFmtType == css::util::NumberFormat::LOGICAL );
}
- nCurFmtType = nFuncFmtType = NUMBERFORMAT_LOGICAL;
+ nCurFmtType = nFuncFmtType = css::util::NumberFormat::LOGICAL;
nGlobalError = 0;
PushInt( int(nRes) );
}
@@ -2013,7 +2013,7 @@ void ScInterpreter::ScType()
case CELLTYPE_VALUE :
{
sal_uLong nFormat = GetCellNumberFormat(aAdr, aCell);
- if (pFormatter->GetType(nFormat) == NUMBERFORMAT_LOGICAL)
+ if (pFormatter->GetType(nFormat) == css::util::NumberFormat::LOGICAL)
nType = 4;
else
nType = 1;
@@ -2086,10 +2086,10 @@ void getFormatString(SvNumberFormatter* pFormatter, sal_uLong nFormat, OUString&
switch( pFormatter->GetType( nFormat ) )
{
- case NUMBERFORMAT_NUMBER: if(bThousand) rFmtStr = ","; else rFmtStr = "F"; break;
- case NUMBERFORMAT_CURRENCY: rFmtStr = "C"; break;
- case NUMBERFORMAT_SCIENTIFIC: rFmtStr = "S"; break;
- case NUMBERFORMAT_PERCENT: rFmtStr = "P"; break;
+ case css::util::NumberFormat::NUMBER: if(bThousand) rFmtStr = ","; else rFmtStr = "F"; break;
+ case css::util::NumberFormat::CURRENCY: rFmtStr = "C"; break;
+ case css::util::NumberFormat::SCIENTIFIC: rFmtStr = "S"; break;
+ case css::util::NumberFormat::PERCENT: rFmtStr = "P"; break;
default:
{
bAppendPrec = false;
@@ -2458,7 +2458,7 @@ void ScInterpreter::ScCellExternal()
void ScInterpreter::ScIsRef()
{
- nFuncFmtType = NUMBERFORMAT_LOGICAL;
+ nFuncFmtType = css::util::NumberFormat::LOGICAL;
bool nRes = false;
switch ( GetStackType() )
{
@@ -2494,7 +2494,7 @@ void ScInterpreter::ScIsRef()
void ScInterpreter::ScIsValue()
{
- nFuncFmtType = NUMBERFORMAT_LOGICAL;
+ nFuncFmtType = css::util::NumberFormat::LOGICAL;
bool nRes = false;
switch ( GetRawStackType() )
{
@@ -2557,7 +2557,7 @@ void ScInterpreter::ScIsValue()
void ScInterpreter::ScIsFormula()
{
- nFuncFmtType = NUMBERFORMAT_LOGICAL;
+ nFuncFmtType = css::util::NumberFormat::LOGICAL;
bool nRes = false;
switch ( GetStackType() )
{
@@ -2611,7 +2611,7 @@ void ScInterpreter::ScFormula()
void ScInterpreter::ScIsNV()
{
- nFuncFmtType = NUMBERFORMAT_LOGICAL;
+ nFuncFmtType = css::util::NumberFormat::LOGICAL;
bool nRes = false;
switch ( GetStackType() )
{
@@ -2659,7 +2659,7 @@ void ScInterpreter::ScIsNV()
void ScInterpreter::ScIsErr()
{
- nFuncFmtType = NUMBERFORMAT_LOGICAL;
+ nFuncFmtType = css::util::NumberFormat::LOGICAL;
bool nRes = false;
switch ( GetStackType() )
{
@@ -2713,7 +2713,7 @@ void ScInterpreter::ScIsErr()
void ScInterpreter::ScIsError()
{
- nFuncFmtType = NUMBERFORMAT_LOGICAL;
+ nFuncFmtType = css::util::NumberFormat::LOGICAL;
bool nRes = false;
switch ( GetStackType() )
{
@@ -2764,7 +2764,7 @@ void ScInterpreter::ScIsError()
bool ScInterpreter::IsEven()
{
- nFuncFmtType = NUMBERFORMAT_LOGICAL;
+ nFuncFmtType = css::util::NumberFormat::LOGICAL;
bool nRes = false;
double fVal = 0.0;
switch ( GetStackType() )
@@ -3333,7 +3333,7 @@ void ScInterpreter::ScMin( bool bTextAsZero )
{
nVal = GetDouble();
if (nMin > nVal) nMin = nVal;
- nFuncFmtType = NUMBERFORMAT_NUMBER;
+ nFuncFmtType = css::util::NumberFormat::NUMBER;
}
break;
case svSingleRef :
@@ -3381,7 +3381,7 @@ void ScInterpreter::ScMin( bool bTextAsZero )
ScMatrixRef pMat = GetMatrix();
if (pMat)
{
- nFuncFmtType = NUMBERFORMAT_NUMBER;
+ nFuncFmtType = css::util::NumberFormat::NUMBER;
nVal = pMat->GetMinValue(bTextAsZero);
if (nMin > nVal)
nMin = nVal;
@@ -3429,7 +3429,7 @@ void ScInterpreter::ScMax( bool bTextAsZero )
{
nVal = GetDouble();
if (nMax < nVal) nMax = nVal;
- nFuncFmtType = NUMBERFORMAT_NUMBER;
+ nFuncFmtType = css::util::NumberFormat::NUMBER;
}
break;
case svSingleRef :
@@ -3477,7 +3477,7 @@ void ScInterpreter::ScMax( bool bTextAsZero )
ScMatrixRef pMat = GetMatrix();
if (pMat)
{
- nFuncFmtType = NUMBERFORMAT_NUMBER;
+ nFuncFmtType = css::util::NumberFormat::NUMBER;
nVal = pMat->GetMaxValue(bTextAsZero);
if (nMax < nVal)
nMax = nVal;
@@ -7650,7 +7650,7 @@ void ScInterpreter::ScCurrency()
if ( fDec < 0.0 )
fDec = 0.0;
sal_uLong nIndex = pFormatter->GetStandardFormat(
- NUMBERFORMAT_CURRENCY,
+ css::util::NumberFormat::CURRENCY,
ScGlobal::eLnge);
if ( (sal_uInt16) fDec != pFormatter->GetFormatPrecision( nIndex ) )
{
@@ -7740,7 +7740,7 @@ void ScInterpreter::ScFixed()
if (fDec < 0.0)
fDec = 0.0;
sal_uLong nIndex = pFormatter->GetStandardFormat(
- NUMBERFORMAT_NUMBER,
+ css::util::NumberFormat::NUMBER,
ScGlobal::eLnge);
OUString sFormatString = pFormatter->GenerateFormat(
nIndex,
@@ -7786,7 +7786,7 @@ void ScInterpreter::ScFind()
void ScInterpreter::ScExact()
{
- nFuncFmtType = NUMBERFORMAT_LOGICAL;
+ nFuncFmtType = css::util::NumberFormat::LOGICAL;
if ( MustHaveParamCount( GetByte(), 2 ) )
{
svl::SharedString s1 = GetString();
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 1114444..94b227f 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -97,7 +97,7 @@ double ScInterpreter::GetDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int1
void ScInterpreter::ScGetActDate()
{
- nFuncFmtType = NUMBERFORMAT_DATE;
+ nFuncFmtType = css::util::NumberFormat::DATE;
Date aActDate( Date::SYSTEM );
long nDiff = aActDate - *(pFormatter->GetNullDate());
PushDouble((double) nDiff);
@@ -105,7 +105,7 @@ void ScInterpreter::ScGetActDate()
void ScInterpreter::ScGetActTime()
{
- nFuncFmtType = NUMBERFORMAT_DATETIME;
+ nFuncFmtType = css::util::NumberFormat::DATETIME;
Date aActDate( Date::SYSTEM );
long nDiff = aActDate - *(pFormatter->GetNullDate());
tools::Time aActTime( tools::Time::SYSTEM );
@@ -169,7 +169,7 @@ void ScInterpreter::ScGetDateValue()
if (pFormatter->IsNumberFormat(aInputString, nFIndex, fVal))
{
short eType = pFormatter->GetType(nFIndex);
- if (eType == NUMBERFORMAT_DATE || eType == NUMBERFORMAT_DATETIME)
+ if (eType == css::util::NumberFormat::DATE || eType == css::util::NumberFormat::DATETIME)
PushDouble(::rtl::math::approxFloor(fVal));
else
PushIllegalArgument();
@@ -219,7 +219,7 @@ void ScInterpreter::ScGetWeekOfYear()
void ScInterpreter::ScEasterSunday()
{
- nFuncFmtType = NUMBERFORMAT_DATE;
+ nFuncFmtType = css::util::NumberFormat::DATE;
if ( MustHaveParamCount( GetByte(), 1 ) )
{
sal_Int16 nDay, nMonth, nYear;
@@ -378,7 +378,7 @@ void ScInterpreter::ScWorkday_MS()
sal_uInt8 nParamCount = GetByte();
if ( MustHaveParamCount( nParamCount, 2, 4 ) )
{
- nFuncFmtType = NUMBERFORMAT_DATE;
+ nFuncFmtType = css::util::NumberFormat::DATE;
vector<double> nSortArray;
bool bWeekendMask[ 7 ];
OUString aWeekendDays;
@@ -436,7 +436,7 @@ void ScInterpreter::ScWorkday_MS()
void ScInterpreter::ScGetDate()
{
- nFuncFmtType = NUMBERFORMAT_DATE;
+ nFuncFmtType = css::util::NumberFormat::DATE;
if ( MustHaveParamCount( GetByte(), 3 ) )
{
sal_Int16 nDay = (sal_Int16) ::rtl::math::approxFloor(GetDouble());
@@ -453,7 +453,7 @@ void ScInterpreter::ScGetDate()
void ScInterpreter::ScGetTime()
{
- nFuncFmtType = NUMBERFORMAT_TIME;
+ nFuncFmtType = css::util::NumberFormat::TIME;
if ( MustHaveParamCount( GetByte(), 3 ) )
{
double nSec = GetDouble();
@@ -725,7 +725,7 @@ void ScInterpreter::ScGetTimeValue()
if (pFormatter->IsNumberFormat(aInputString, nFIndex, fVal))
{
short eType = pFormatter->GetType(nFIndex);
- if (eType == NUMBERFORMAT_TIME || eType == NUMBERFORMAT_DATETIME)
+ if (eType == css::util::NumberFormat::TIME || eType == css::util::NumberFormat::DATETIME)
{
double fDateVal = rtl::math::approxFloor(fVal);
double fTimeVal = fVal - fDateVal;
@@ -959,7 +959,7 @@ void ScInterpreter::ScLog10()
void ScInterpreter::ScNPV()
{
- nFuncFmtType = NUMBERFORMAT_CURRENCY;
+ nFuncFmtType = css::util::NumberFormat::CURRENCY;
short nParamCount = GetByte();
if ( MustHaveParamCount( nParamCount, 2, 31 ) )
{
@@ -1027,7 +1027,7 @@ void ScInterpreter::ScNPV()
void ScInterpreter::ScIRR()
{
double fEstimated;
- nFuncFmtType = NUMBERFORMAT_PERCENT;
+ nFuncFmtType = css::util::NumberFormat::PERCENT;
sal_uInt8 nParamCount = GetByte();
if ( !MustHaveParamCount( nParamCount, 1, 2 ) )
return;
@@ -1092,7 +1092,7 @@ void ScInterpreter::ScIRR()
void ScInterpreter::ScMIRR()
{ // range_of_values ; rate_invest ; rate_reinvest
- nFuncFmtType = NUMBERFORMAT_PERCENT;
+ nFuncFmtType = css::util::NumberFormat::PERCENT;
if( MustHaveParamCount( GetByte(), 3 ) )
{
double fRate1_reinvest = GetDouble() + 1;
@@ -1175,7 +1175,7 @@ double ScInterpreter::ScGetBw(double fInterest, double fZzr, double fRmz,
void ScInterpreter::ScPV()
{
- nFuncFmtType = NUMBERFORMAT_CURRENCY;
+ nFuncFmtType = css::util::NumberFormat::CURRENCY;
double nRmz, nZzr, nInterest, nZw = 0, nFlag = 0;
sal_uInt8 nParamCount = GetByte();
if ( !MustHaveParamCount( nParamCount, 3, 5 ) )
@@ -1192,7 +1192,7 @@ void ScInterpreter::ScPV()
void ScInterpreter::ScSYD()
{
- nFuncFmtType = NUMBERFORMAT_CURRENCY;
+ nFuncFmtType = css::util::NumberFormat::CURRENCY;
if ( MustHaveParamCount( GetByte(), 4 ) )
{
double nZr = GetDouble();
@@ -1233,7 +1233,7 @@ double ScInterpreter::ScGetGDA(double fValue, double fRest, double fTimeLength,
void ScInterpreter::ScDDB()
{
- nFuncFmtType = NUMBERFORMAT_CURRENCY;
+ nFuncFmtType = css::util::NumberFormat::CURRENCY;
sal_uInt8 nParamCount = GetByte();
if ( MustHaveParamCount( nParamCount, 4, 5 ) )
{
@@ -1256,7 +1256,7 @@ void ScInterpreter::ScDDB()
void ScInterpreter::ScDB()
{
- nFuncFmtType = NUMBERFORMAT_CURRENCY;
+ nFuncFmtType = css::util::NumberFormat::CURRENCY;
sal_uInt8 nParamCount = GetByte();
if ( !MustHaveParamCount( nParamCount, 4, 5 ) )
return ;
@@ -1350,7 +1350,7 @@ inline double DblMin( double a, double b )
void ScInterpreter::ScVDB()
{
- nFuncFmtType = NUMBERFORMAT_CURRENCY;
+ nFuncFmtType = css::util::NumberFormat::CURRENCY;
sal_uInt8 nParamCount = GetByte();
if ( MustHaveParamCount( nParamCount, 5, 7 ) )
{
@@ -1436,7 +1436,7 @@ void ScInterpreter::ScDuration()
void ScInterpreter::ScSLN()
{
- nFuncFmtType = NUMBERFORMAT_CURRENCY;
+ nFuncFmtType = css::util::NumberFormat::CURRENCY;
if ( MustHaveParamCount( GetByte(), 3 ) )
{
double nTimeLength = GetDouble();
@@ -1467,7 +1467,7 @@ double ScInterpreter::ScGetRmz(double fRate, double fNper, double fPv,
void ScInterpreter::ScPMT()
{
double nInterest, nZzr, nBw, nZw = 0, nFlag = 0;
- nFuncFmtType = NUMBERFORMAT_CURRENCY;
+ nFuncFmtType = css::util::NumberFormat::CURRENCY;
sal_uInt8 nParamCount = GetByte();
if ( !MustHaveParamCount( nParamCount, 3, 5 ) )
return;
@@ -1483,7 +1483,7 @@ void ScInterpreter::ScPMT()
void ScInterpreter::ScRRI()
{
- nFuncFmtType = NUMBERFORMAT_PERCENT;
+ nFuncFmtType = css::util::NumberFormat::PERCENT;
if ( MustHaveParamCount( GetByte(), 3 ) )
{
double nValueInFuture = GetDouble();
@@ -1513,7 +1513,7 @@ double ScInterpreter::ScGetZw(double fInterest, double fZzr, double fRmz,
void ScInterpreter::ScFV()
{
double nInterest, nZzr, nRmz, nBw = 0, nFlag = 0;
- nFuncFmtType = NUMBERFORMAT_CURRENCY;
+ nFuncFmtType = css::util::NumberFormat::CURRENCY;
sal_uInt8 nParamCount = GetByte();
if ( !MustHaveParamCount( nParamCount, 3, 5 ) )
return;
@@ -1653,7 +1653,7 @@ void ScInterpreter::ScRate()
double fFv = 0, fPayType = 0, fGuess = 0.1, fOrigGuess = 0.1;
bool bValid = true;
bool bDefaultGuess = true;
- nFuncFmtType = NUMBERFORMAT_PERCENT;
+ nFuncFmtType = css::util::NumberFormat::PERCENT;
sal_uInt8 nParamCount = GetByte();
if ( !MustHaveParamCount( nParamCount, 3, 6 ) )
return;
@@ -1714,7 +1714,7 @@ double ScInterpreter::ScGetCompoundInterest(double fInterest, double fZr, double
{
fRmz = ScGetRmz(fInterest, fZzr, fBw, fZw, fF); // fuer kapz auch bei fZr == 1
double fCompoundInterest;
- nFuncFmtType = NUMBERFORMAT_CURRENCY;
+ nFuncFmtType = css::util::NumberFormat::CURRENCY;
if (fZr == 1.0)
{
if (fF > 0.0)
@@ -1735,7 +1735,7 @@ double ScInterpreter::ScGetCompoundInterest(double fInterest, double fZr, double
void ScInterpreter::ScIpmt()
{
double nInterest, nZr, nZzr, nBw, nZw = 0, nFlag = 0;
- nFuncFmtType = NUMBERFORMAT_CURRENCY;
+ nFuncFmtType = css::util::NumberFormat::CURRENCY;
sal_uInt8 nParamCount = GetByte();
if ( !MustHaveParamCount( nParamCount, 4, 6 ) )
return;
@@ -1759,7 +1759,7 @@ void ScInterpreter::ScIpmt()
void ScInterpreter::ScPpmt()
{
double nInterest, nZr, nZzr, nBw, nZw = 0, nFlag = 0;
- nFuncFmtType = NUMBERFORMAT_CURRENCY;
+ nFuncFmtType = css::util::NumberFormat::CURRENCY;
sal_uInt8 nParamCount = GetByte();
if ( !MustHaveParamCount( nParamCount, 4, 6 ) )
return;
@@ -1783,7 +1783,7 @@ void ScInterpreter::ScPpmt()
void ScInterpreter::ScCumIpmt()
{
- nFuncFmtType = NUMBERFORMAT_CURRENCY;
+ nFuncFmtType = css::util::NumberFormat::CURRENCY;
if ( MustHaveParamCount( GetByte(), 6 ) )
{
double fInterest, fZzr, fBw, fStart, fEnd, fF;
@@ -1823,7 +1823,7 @@ void ScInterpreter::ScCumIpmt()
void ScInterpreter::ScCumPrinc()
{
- nFuncFmtType = NUMBERFORMAT_CURRENCY;
+ nFuncFmtType = css::util::NumberFormat::CURRENCY;
if ( MustHaveParamCount( GetByte(), 6 ) )
{
double fInterest, fZzr, fBw, fStart, fEnd, fF;
@@ -1864,7 +1864,7 @@ void ScInterpreter::ScCumPrinc()
void ScInterpreter::ScEffective()
{
- nFuncFmtType = NUMBERFORMAT_PERCENT;
+ nFuncFmtType = css::util::NumberFormat::PERCENT;
if ( MustHaveParamCount( GetByte(), 2 ) )
{
double fPeriods = GetDouble();
@@ -1881,7 +1881,7 @@ void ScInterpreter::ScEffective()
void ScInterpreter::ScNominal()
{
- nFuncFmtType = NUMBERFORMAT_PERCENT;
+ nFuncFmtType = css::util::NumberFormat::PERCENT;
if ( MustHaveParamCount( GetByte(), 2 ) )
{
double fPeriods = GetDouble();
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index c6eff6b..b4c72e4 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -326,7 +326,7 @@ double ScInterpreter::ConvertStringToValue( const OUString& rStr )
sal_Int32 nUnit[done] = {0,0,0,0,0,0,0};
const sal_Int32 nLimit[done] = {0,12,31,0,59,59,0};
State eState = (bDate ? month : minute);
- nCurFmtType = (bDate ? NUMBERFORMAT_DATE : NUMBERFORMAT_TIME);
+ nCurFmtType = (bDate ? css::util::NumberFormat::DATE : css::util::NumberFormat::TIME);
nUnit[eState-1] = aStr.copy( 0, nParseEnd).toInt32();
const sal_Unicode* pLastStart = p;
// Ensure there's no preceding sign. Negative dates
@@ -341,7 +341,7 @@ double ScInterpreter::ConvertStringToValue( const OUString& rStr )
while (p < pStop && !nGlobalError && eState < blank)
{
if (eState == minute)
- nCurFmtType |= NUMBERFORMAT_TIME;
+ nCurFmtType |= css::util::NumberFormat::TIME;
if (rtl::isAsciiDigit(*p))
{
// Maximum 2 digits per unit, except fractions.
@@ -544,7 +544,7 @@ void ScInterpreter::GetCellString( svl::SharedString& rStr, ScRefCellValue& rCel
{
double fVal = pFCell->GetValue();
sal_uLong nIndex = pFormatter->GetStandardFormat(
- NUMBERFORMAT_NUMBER,
+ css::util::NumberFormat::NUMBER,
ScGlobal::eLnge);
OUString aStr;
pFormatter->GetInputLineString(fVal, nIndex, aStr);
@@ -558,7 +558,7 @@ void ScInterpreter::GetCellString( svl::SharedString& rStr, ScRefCellValue& rCel
{
double fVal = rCell.mfValue;
sal_uLong nIndex = pFormatter->GetStandardFormat(
- NUMBERFORMAT_NUMBER,
+ css::util::NumberFormat::NUMBER,
ScGlobal::eLnge);
OUString aStr;
pFormatter->GetInputLineString(fVal, nIndex, aStr);
@@ -883,7 +883,7 @@ void ScInterpreter::PushWithoutError( FormulaToken& r )
SetError( errStackOverflow );
else
{
- nCurFmtType = NUMBERFORMAT_UNDEFINED;
+ nCurFmtType = css::util::NumberFormat::UNDEFINED;
r.IncRef();
if( sp >= maxsp )
maxsp = sp + 1;
@@ -994,7 +994,7 @@ void ScInterpreter::PushCellResultToken( bool bDisplayEmptyAsString,
{
PushError( nErr);
if (pRetTypeExpr)
- *pRetTypeExpr = NUMBERFORMAT_UNDEFINED;
+ *pRetTypeExpr = css::util::NumberFormat::UNDEFINED;
if (pRetIndexExpr)
*pRetIndexExpr = 0;
}
@@ -1004,7 +1004,7 @@ void ScInterpreter::PushCellResultToken( bool bDisplayEmptyAsString,
GetCellString( aRes, aCell);
PushString( aRes);
if (pRetTypeExpr)
- *pRetTypeExpr = NUMBERFORMAT_TEXT;
+ *pRetTypeExpr = css::util::NumberFormat::TEXT;
if (pRetIndexExpr)
*pRetIndexExpr = 0;
}
@@ -1060,7 +1060,7 @@ FormulaTokenRef ScInterpreter::PopToken()
double ScInterpreter::PopDouble()
{
- nCurFmtType = NUMBERFORMAT_NUMBER;
+ nCurFmtType = css::util::NumberFormat::NUMBER;
nCurFmtIndex = 0;
if( sp )
{
@@ -1087,7 +1087,7 @@ double ScInterpreter::PopDouble()
svl::SharedString ScInterpreter::PopString()
{
- nCurFmtType = NUMBERFORMAT_TEXT;
+ nCurFmtType = css::util::NumberFormat::TEXT;
nCurFmtIndex = 0;
if( sp )
{
@@ -1850,7 +1850,7 @@ void ScInterpreter::QueryMatrixType(ScMatrixRef& xMat, short& rRetTypeExpr, sal_
{ // result of empty FALSE jump path
FormulaTokenRef xRes = new FormulaDoubleToken( 0.0);
PushTempToken( new ScMatrixFormulaCellToken(nCols, nRows, xMat, xRes.get()));
- rRetTypeExpr = NUMBERFORMAT_LOGICAL;
+ rRetTypeExpr = css::util::NumberFormat::LOGICAL;
}
else if ( xMat->IsEmptyResult( 0, 0))
{ // empty formula result
@@ -1867,7 +1867,7 @@ void ScInterpreter::QueryMatrixType(ScMatrixRef& xMat, short& rRetTypeExpr, sal_
svl::SharedString aStr( nMatVal.GetString());
FormulaTokenRef xRes = new FormulaStringToken( aStr);
PushTempToken( new ScMatrixFormulaCellToken(nCols, nRows, xMat, xRes.get()));
- rRetTypeExpr = NUMBERFORMAT_TEXT;
+ rRetTypeExpr = css::util::NumberFormat::TEXT;
}
}
else
@@ -1879,8 +1879,8 @@ void ScInterpreter::QueryMatrixType(ScMatrixRef& xMat, short& rRetTypeExpr, sal_
else
xRes = new FormulaDoubleToken( nMatVal.fVal);
PushTempToken( new ScMatrixFormulaCellToken(nCols, nRows, xMat, xRes.get()));
- if ( rRetTypeExpr != NUMBERFORMAT_LOGICAL )
- rRetTypeExpr = NUMBERFORMAT_NUMBER;
+ if ( rRetTypeExpr != css::util::NumberFormat::LOGICAL )
+ rRetTypeExpr = css::util::NumberFormat::NUMBER;
}
rRetIndexExpr = 0;
xMat->SetErrorInterpreter( NULL);
@@ -2283,7 +2283,7 @@ svl::SharedString ScInterpreter::GetString()
{
double fVal = PopDouble();
sal_uLong nIndex = pFormatter->GetStandardFormat(
- NUMBERFORMAT_NUMBER,
+ css::util::NumberFormat::NUMBER,
ScGlobal::eLnge);
OUString aStr;
pFormatter->GetInputLineString(fVal, nIndex, aStr);
@@ -3793,7 +3793,7 @@ double applyImplicitIntersection(const sc::RangeMatrix& rMat, const ScAddress& r
StackVar ScInterpreter::Interpret()
{
- short nRetTypeExpr = NUMBERFORMAT_UNDEFINED;
+ short nRetTypeExpr = css::util::NumberFormat::UNDEFINED;
sal_uLong nRetIndexExpr = 0;
sal_uInt16 nErrorFunction = 0;
sal_uInt16 nErrorFunctionCount = 0;
@@ -3801,8 +3801,8 @@ StackVar ScInterpreter::Interpret()
nGlobalError = 0;
nStackBase = sp = maxsp = 0;
- nRetFmtType = NUMBERFORMAT_UNDEFINED;
- nFuncFmtType = NUMBERFORMAT_UNDEFINED;
+ nRetFmtType = css::util::NumberFormat::UNDEFINED;
+ nFuncFmtType = css::util::NumberFormat::UNDEFINED;
nFuncFmtIndex = nCurFmtIndex = nRetFmtIndex = 0;
xResult = NULL;
pJumpMatrix = NULL;
@@ -3846,7 +3846,7 @@ StackVar ScInterpreter::Interpret()
nCurFmtType = nRetTypeExpr;
nCurFmtIndex = nRetIndexExpr;
// default function's format, others are set if needed
- nFuncFmtType = NUMBERFORMAT_NUMBER;
+ nFuncFmtType = css::util::NumberFormat::NUMBER;
nFuncFmtIndex = 0;
if ( eOp == ocIf || eOp == ocChoose || eOp == ocIfError || eOp == ocIfNA )
@@ -4268,7 +4268,7 @@ StackVar ScInterpreter::Interpret()
case ocBitLshift : ScBitLshift(); break;
case ocTTT : ScTTT(); break;
case ocDebugVar : ScDebugVar(); break;
- case ocNone : nFuncFmtType = NUMBERFORMAT_UNDEFINED; break;
+ case ocNone : nFuncFmtType = css::util::NumberFormat::UNDEFINED; break;
default : PushError( errUnknownOpCode); break;
}
@@ -4289,11 +4289,11 @@ StackVar ScInterpreter::Interpret()
pStack[sp-1]));
// outer function determines format of an expression
- if ( nFuncFmtType != NUMBERFORMAT_UNDEFINED )
+ if ( nFuncFmtType != css::util::NumberFormat::UNDEFINED )
{
nRetTypeExpr = nFuncFmtType;
// inherit the format index only for currency formats
- nRetIndexExpr = ( nFuncFmtType == NUMBERFORMAT_CURRENCY ?
+ nRetIndexExpr = ( nFuncFmtType == css::util::NumberFormat::CURRENCY ?
nFuncFmtIndex : 0 );
}
}
@@ -4392,14 +4392,14 @@ StackVar ScInterpreter::Interpret()
nGlobalError = pCur->GetError();
break;
case svDouble :
- if ( nFuncFmtType == NUMBERFORMAT_UNDEFINED )
+ if ( nFuncFmtType == css::util::NumberFormat::UNDEFINED )
{
- nRetTypeExpr = NUMBERFORMAT_NUMBER;
+ nRetTypeExpr = css::util::NumberFormat::NUMBER;
nRetIndexExpr = 0;
}
break;
case svString :
- nRetTypeExpr = NUMBERFORMAT_TEXT;
+ nRetTypeExpr = css::util::NumberFormat::TEXT;
nRetIndexExpr = 0;
break;
case svSingleRef :
@@ -4485,18 +4485,18 @@ StackVar ScInterpreter::Interpret()
else
SetError( errNoCode);
- if( nRetTypeExpr != NUMBERFORMAT_UNDEFINED )
+ if( nRetTypeExpr != css::util::NumberFormat::UNDEFINED )
{
nRetFmtType = nRetTypeExpr;
nRetFmtIndex = nRetIndexExpr;
}
- else if( nFuncFmtType != NUMBERFORMAT_UNDEFINED )
+ else if( nFuncFmtType != css::util::NumberFormat::UNDEFINED )
{
nRetFmtType = nFuncFmtType;
nRetFmtIndex = nFuncFmtIndex;
}
else
- nRetFmtType = NUMBERFORMAT_NUMBER;
+ nRetFmtType = css::util::NumberFormat::NUMBER;
if (nGlobalError && GetStackType() != svError )
PushError( nGlobalError);
diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx
index e6ca138..38863a0 100644
--- a/sc/source/core/tool/interpr5.cxx
+++ b/sc/source/core/tool/interpr5.cxx
@@ -1160,25 +1160,25 @@ ScMatrixRef ScInterpreter::MatConcat(const ScMatrixRef& pMat1, const ScMatrixRef
// for DATE, TIME, DATETIME
static void lcl_GetDiffDateTimeFmtType( short& nFuncFmt, short nFmt1, short nFmt2 )
{
- if ( nFmt1 != NUMBERFORMAT_UNDEFINED || nFmt2 != NUMBERFORMAT_UNDEFINED )
+ if ( nFmt1 != css::util::NumberFormat::UNDEFINED || nFmt2 != css::util::NumberFormat::UNDEFINED )
{
if ( nFmt1 == nFmt2 )
{
- if ( nFmt1 == NUMBERFORMAT_TIME || nFmt1 == NUMBERFORMAT_DATETIME )
- nFuncFmt = NUMBERFORMAT_TIME; // times result in time
+ if ( nFmt1 == css::util::NumberFormat::TIME || nFmt1 == css::util::NumberFormat::DATETIME )
+ nFuncFmt = css::util::NumberFormat::TIME; // times result in time
// else: nothing special, number (date - date := days)
}
- else if ( nFmt1 == NUMBERFORMAT_UNDEFINED )
+ else if ( nFmt1 == css::util::NumberFormat::UNDEFINED )
nFuncFmt = nFmt2; // e.g. date + days := date
- else if ( nFmt2 == NUMBERFORMAT_UNDEFINED )
+ else if ( nFmt2 == css::util::NumberFormat::UNDEFINED )
nFuncFmt = nFmt1;
else
{
- if ( nFmt1 == NUMBERFORMAT_DATE || nFmt2 == NUMBERFORMAT_DATE ||
- nFmt1 == NUMBERFORMAT_DATETIME || nFmt2 == NUMBERFORMAT_DATETIME )
+ if ( nFmt1 == css::util::NumberFormat::DATE || nFmt2 == css::util::NumberFormat::DATE ||
+ nFmt1 == css::util::NumberFormat::DATETIME || nFmt2 == css::util::NumberFormat::DATETIME )
{
- if ( nFmt1 == NUMBERFORMAT_TIME || nFmt2 == NUMBERFORMAT_TIME )
- nFuncFmt = NUMBERFORMAT_DATETIME; // date + time
+ if ( nFmt1 == css::util::NumberFormat::TIME || nFmt2 == css::util::NumberFormat::TIME )
+ nFuncFmt = css::util::NumberFormat::DATETIME; // date + time
}
}
}
@@ -1199,7 +1199,7 @@ void ScInterpreter::CalculateAddSub(bool _bSub)
ScMatrixRef pMat2 = NULL;
double fVal1 = 0.0, fVal2 = 0.0;
short nFmt1, nFmt2;
- nFmt1 = nFmt2 = NUMBERFORMAT_UNDEFINED;
+ nFmt1 = nFmt2 = css::util::NumberFormat::UNDEFINED;
short nFmtCurrencyType = nCurFmtType;
sal_uLong nFmtCurrencyIndex = nCurFmtIndex;
short nFmtPercentType = nCurFmtType;
@@ -1210,17 +1210,17 @@ void ScInterpreter::CalculateAddSub(bool _bSub)
fVal2 = GetDouble();
switch ( nCurFmtType )
{
- case NUMBERFORMAT_DATE :
- case NUMBERFORMAT_TIME :
- case NUMBERFORMAT_DATETIME :
+ case css::util::NumberFormat::DATE :
+ case css::util::NumberFormat::TIME :
+ case css::util::NumberFormat::DATETIME :
nFmt2 = nCurFmtType;
break;
- case NUMBERFORMAT_CURRENCY :
+ case css::util::NumberFormat::CURRENCY :
nFmtCurrencyType = nCurFmtType;
nFmtCurrencyIndex = nCurFmtIndex;
break;
- case NUMBERFORMAT_PERCENT :
- nFmtPercentType = NUMBERFORMAT_PERCENT;
+ case css::util::NumberFormat::PERCENT :
+ nFmtPercentType = css::util::NumberFormat::PERCENT;
break;
}
}
@@ -1231,17 +1231,17 @@ void ScInterpreter::CalculateAddSub(bool _bSub)
fVal1 = GetDouble();
switch ( nCurFmtType )
{
- case NUMBERFORMAT_DATE :
- case NUMBERFORMAT_TIME :
- case NUMBERFORMAT_DATETIME :
+ case css::util::NumberFormat::DATE :
+ case css::util::NumberFormat::TIME :
+ case css::util::NumberFormat::DATETIME :
nFmt1 = nCurFmtType;
break;
- case NUMBERFORMAT_CURRENCY :
+ case css::util::NumberFormat::CURRENCY :
nFmtCurrencyType = nCurFmtType;
nFmtCurrencyIndex = nCurFmtIndex;
break;
- case NUMBERFORMAT_PERCENT :
- nFmtPercentType = NUMBERFORMAT_PERCENT;
+ case css::util::NumberFormat::PERCENT :
+ nFmtPercentType = css::util::NumberFormat::PERCENT;
break;
}
}
@@ -1308,7 +1308,7 @@ void ScInterpreter::CalculateAddSub(bool _bSub)
PushDouble( ::rtl::math::approxSub( fVal1, fVal2 ) );
else
PushDouble( ::rtl::math::approxAdd( fVal1, fVal2 ) );
- if ( nFmtCurrencyType == NUMBERFORMAT_CURRENCY )
+ if ( nFmtCurrencyType == css::util::NumberFormat::CURRENCY )
{
nFuncFmtType = nFmtCurrencyType;
nFuncFmtIndex = nFmtCurrencyIndex;
@@ -1316,8 +1316,8 @@ void ScInterpreter::CalculateAddSub(bool _bSub)
else
{
lcl_GetDiffDateTimeFmtType( nFuncFmtType, nFmt1, nFmt2 );
- if ( nFmtPercentType == NUMBERFORMAT_PERCENT && nFuncFmtType == NUMBERFORMAT_NUMBER )
- nFuncFmtType = NUMBERFORMAT_PERCENT;
+ if ( nFmtPercentType == css::util::NumberFormat::PERCENT && nFuncFmtType == css::util::NumberFormat::NUMBER )
+ nFuncFmtType = css::util::NumberFormat::PERCENT;
}
}
@@ -1433,7 +1433,7 @@ void ScInterpreter::ScMul()
fVal2 = GetDouble();
switch ( nCurFmtType )
{
- case NUMBERFORMAT_CURRENCY :
+ case css::util::NumberFormat::CURRENCY :
nFmtCurrencyType = nCurFmtType;
nFmtCurrencyIndex = nCurFmtIndex;
break;
@@ -1446,7 +1446,7 @@ void ScInterpreter::ScMul()
fVal1 = GetDouble();
switch ( nCurFmtType )
{
- case NUMBERFORMAT_CURRENCY :
+ case css::util::NumberFormat::CURRENCY :
nFmtCurrencyType = nCurFmtType;
nFmtCurrencyIndex = nCurFmtIndex;
break;
@@ -1489,7 +1489,7 @@ void ScInterpreter::ScMul()
}
else
PushDouble(fVal1 * fVal2);
- if ( nFmtCurrencyType == NUMBERFORMAT_CURRENCY )
+ if ( nFmtCurrencyType == css::util::NumberFormat::CURRENCY )
{
nFuncFmtType = nFmtCurrencyType;
nFuncFmtIndex = nFmtCurrencyIndex;
@@ -1503,7 +1503,7 @@ void ScInterpreter::ScDiv()
double fVal1 = 0.0, fVal2 = 0.0;
short nFmtCurrencyType = nCurFmtType;
sal_uLong nFmtCurrencyIndex = nCurFmtIndex;
- short nFmtCurrencyType2 = NUMBERFORMAT_UNDEFINED;
+ short nFmtCurrencyType2 = css::util::NumberFormat::UNDEFINED;
if ( GetStackType() == svMatrix )
pMat2 = GetMatrix();
else
@@ -1519,7 +1519,7 @@ void ScInterpreter::ScDiv()
fVal1 = GetDouble();
switch ( nCurFmtType )
{
- case NUMBERFORMAT_CURRENCY :
+ case css::util::NumberFormat::CURRENCY :
nFmtCurrencyType = nCurFmtType;
nFmtCurrencyIndex = nCurFmtIndex;
break;
@@ -1578,7 +1578,7 @@ void ScInterpreter::ScDiv()
{
PushDouble( div( fVal1, fVal2) );
}
- if ( nFmtCurrencyType == NUMBERFORMAT_CURRENCY && nFmtCurrencyType2 != NUMBERFORMAT_CURRENCY )
+ if ( nFmtCurrencyType == css::util::NumberFormat::CURRENCY && nFmtCurrencyType2 != css::util::NumberFormat::CURRENCY )
{ // even USD/USD is not USD
nFuncFmtType = nFmtCurrencyType;
nFuncFmtIndex = nFmtCurrencyIndex;
@@ -3220,7 +3220,7 @@ void ScInterpreter::ScMatRef()
{
if (ScMatrix::IsEmptyPathType( nMatValType))
{ // result of empty false jump path
- nFuncFmtType = NUMBERFORMAT_LOGICAL;
+ nFuncFmtType = css::util::NumberFormat::LOGICAL;
PushInt(0);
}
else if (ScMatrix::IsEmptyType( nMatValType))
diff --git a/sc/source/core/tool/interpr6.cxx b/sc/source/core/tool/interpr6.cxx
index 92a6ed3..b3daedd 100644
--- a/sc/source/core/tool/interpr6.cxx
+++ b/sc/source/core/tool/interpr6.cxx
@@ -357,7 +357,7 @@ void IterateMatrix(
return;
// TODO fdo73148 take mnSubTotalFlags into account
- rFuncFmtType = NUMBERFORMAT_NUMBER;
+ rFuncFmtType = css::util::NumberFormat::NUMBER;
switch (eFunc)
{
case ifAVERAGE:
@@ -490,7 +490,7 @@ double ScInterpreter::IterateParameters( ScIterFunc eFunc, bool bTextAsZero )
case ifPRODUCT: fRes *= fVal; break;
default: ; // nothing
}
- nFuncFmtType = NUMBERFORMAT_NUMBER;
+ nFuncFmtType = css::util::NumberFormat::NUMBER;
break;
case svExternalSingleRef:
{
@@ -801,8 +801,8 @@ double ScInterpreter::IterateParameters( ScIterFunc eFunc, bool bTextAsZero )
}
// Bei Summen etc. macht ein bool-Ergebnis keinen Sinn
// und Anzahl ist immer Number (#38345#)
- if( eFunc == ifCOUNT || nFuncFmtType == NUMBERFORMAT_LOGICAL )
- nFuncFmtType = NUMBERFORMAT_NUMBER;
+ if( eFunc == ifCOUNT || nFuncFmtType == css::util::NumberFormat::LOGICAL )
+ nFuncFmtType = css::util::NumberFormat::NUMBER;
return fRes;
}
@@ -837,7 +837,7 @@ void ScInterpreter::ScSum()
case svDouble :
fVal = GetDouble();
fRes += fVal;
- nFuncFmtType = NUMBERFORMAT_NUMBER;
+ nFuncFmtType = css::util::NumberFormat::NUMBER;
break;
case svExternalSingleRef:
{
@@ -938,8 +938,8 @@ void ScInterpreter::ScSum()
}
}
- if (nFuncFmtType == NUMBERFORMAT_LOGICAL)
- nFuncFmtType = NUMBERFORMAT_NUMBER;
+ if (nFuncFmtType == css::util::NumberFormat::LOGICAL)
+ nFuncFmtType = css::util::NumberFormat::NUMBER;
PushDouble(fRes);
}
@@ -989,7 +989,7 @@ void ScInterpreter::ScCount()
case svDouble :
GetDouble();
nCount++;
- nFuncFmtType = NUMBERFORMAT_NUMBER;
+ nFuncFmtType = css::util::NumberFormat::NUMBER;
break;
case svExternalSingleRef:
{
@@ -1103,7 +1103,7 @@ void ScInterpreter::ScCount()
}
}
- nFuncFmtType = NUMBERFORMAT_NUMBER;
+ nFuncFmtType = css::util::NumberFormat::NUMBER;
PushDouble(nCount);
}
diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index 998f562..8273f44 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -595,7 +595,7 @@ svl::SharedString ScMatrixImpl::GetString( SvNumberFormatter& rFormatter, SCSIZE
return svl::SharedString::getEmptyString();
// result of empty FALSE jump path
- sal_uLong nKey = rFormatter.GetStandardFormat( NUMBERFORMAT_LOGICAL,
+ sal_uLong nKey = rFormatter.GetStandardFormat( css::util::NumberFormat::LOGICAL,
ScGlobal::eLnge);
OUString aStr;
Color* pColor = NULL;
@@ -617,7 +617,7 @@ svl::SharedString ScMatrixImpl::GetString( SvNumberFormatter& rFormatter, SCSIZE
return ScGlobal::GetErrorString( nError);
}
- sal_uLong nKey = rFormatter.GetStandardFormat( NUMBERFORMAT_NUMBER,
+ sal_uLong nKey = rFormatter.GetStandardFormat( css::util::NumberFormat::NUMBER,
ScGlobal::eLnge);
OUString aStr;
rFormatter.GetInputLineString( fVal, nKey, aStr);
diff --git a/sc/source/filter/dif/difimp.cxx b/sc/source/filter/dif/difimp.cxx
index f98e050..6efb11a 100644
--- a/sc/source/filter/dif/difimp.cxx
+++ b/sc/source/filter/dif/difimp.cxx
@@ -948,7 +948,7 @@ void DifAttrCache::Apply( ScDocument& rDoc, SCTAB nTab )
{
pPatt.reset(new ScPatternAttr( rDoc.GetPool() ));
pPatt->GetItemSet().Put( SfxUInt32Item( ATTR_VALUE_FORMAT,
- rDoc.GetFormatTable()->GetStandardFormat( NUMBERFORMAT_LOGICAL ) ) );
+ rDoc.GetFormatTable()->GetStandardFormat( css::util::NumberFormat::LOGICAL ) ) );
}
ppCols[ nCol ]->Apply( rDoc, nCol, nTab, *pPatt );
diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx
index 5ac4d84..521d2b6 100644
--- a/sc/source/filter/excel/xelink.cxx
+++ b/sc/source/filter/excel/xelink.cxx
@@ -1355,7 +1355,7 @@ bool XclExpXct::BuildCrnList( XclExpCrnList& rCrnRecs )
if( xToken.get() ) switch( xToken->GetType() )
{
case svDouble:
- bValid = (rFormatter.GetType( nScNumFmt ) == NUMBERFORMAT_LOGICAL) ?
+ bValid = (rFormatter.GetType( nScNumFmt ) == css::util::NumberFormat::LOGICAL) ?
rCrnRecs.InsertValue( nScCol, nScRow, Any( xToken->GetDouble() != 0 ) ) :
rCrnRecs.InsertValue( nScCol, nScRow, Any( xToken->GetDouble() ) );
break;
diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx
index 4b2c13d..5078d31 100644
--- a/sc/source/filter/excel/xepivot.cxx
+++ b/sc/source/filter/excel/xepivot.cxx
@@ -343,9 +343,9 @@ void XclExpPCField::InitStandardField( const ScRange& rRange )
{
double fValue = rDoc.GetValue( aPos );
short nFmtType = rFormatter.GetType( rDoc.GetNumberFormat( aPos ) );
- if( nFmtType == NUMBERFORMAT_LOGICAL )
+ if( nFmtType == css::util::NumberFormat::LOGICAL )
InsertOrigBoolItem( fValue != 0 );
- else if( nFmtType & NUMBERFORMAT_DATETIME )
+ else if( nFmtType & css::util::NumberFormat::DATETIME )
InsertOrigDateTimeItem( GetDateTimeFromDouble( ::std::max( fValue, 0.0 ) ) );
else
InsertOrigDoubleItem( fValue );
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index fcea194..f4cf4cf 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -1290,7 +1290,7 @@ OUString GetNumberFormatCode(XclRoot& rRoot, const sal_uInt16 nScNumFmt, SvNumbe
if( const SvNumberformat* pEntry = rRoot.GetFormatter().GetEntry( nScNumFmt ) )
{
- if( pEntry->GetType() == NUMBERFORMAT_LOGICAL )
+ if( pEntry->GetType() == css::util::NumberFormat::LOGICAL )
{
// build Boolean number format
Color* pColor = 0;
@@ -1306,7 +1306,7 @@ OUString GetNumberFormatCode(XclRoot& rRoot, const sal_uInt16 nScNumFmt, SvNumbe
if( eLang != LANGUAGE_ENGLISH_US )
{
sal_Int32 nCheckPos;
- short nType = NUMBERFORMAT_DEFINED;
+ short nType = css::util::NumberFormat::DEFINED;
sal_uInt32 nKey;
OUString aTemp( pEntry->GetFormatstring() );
xFormatter->PutandConvertEntry( aTemp, nCheckPos, nType, nKey, eLang, LANGUAGE_ENGLISH_US );
diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index 25130af..ba1d24a 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -828,19 +828,19 @@ XclExpFormulaCell::XclExpFormulaCell(
/* #i8640# Don't set text format, if we have string results. */
short nFormatType = mrScFmlaCell.GetFormatType();
if( ((nScNumFmt % SV_COUNTRY_LANGUAGE_OFFSET) == 0) &&
- (nFormatType != NUMBERFORMAT_LOGICAL) &&
- (nFormatType != NUMBERFORMAT_TEXT) )
+ (nFormatType != css::util::NumberFormat::LOGICAL) &&
+ (nFormatType != css::util::NumberFormat::TEXT) )
nAltScNumFmt = nScNumFmt;
/* If cell number format is Boolean and automatic formula
format is Boolean don't write that ugly special format. */
- else if( (nFormatType == NUMBERFORMAT_LOGICAL) &&
- (rFormatter.GetType( nScNumFmt ) == NUMBERFORMAT_LOGICAL) )
+ else if( (nFormatType == css::util::NumberFormat::LOGICAL) &&
+ (rFormatter.GetType( nScNumFmt ) == css::util::NumberFormat::LOGICAL) )
nAltScNumFmt = rNumFmtBfr.GetStandardFormat();
// #i41420# find script type according to result type (always latin for numeric results)
sal_Int16 nScript = ApiScriptType::LATIN;
bool bForceLineBreak = false;
- if( nFormatType == NUMBERFORMAT_TEXT )
+ if( nFormatType == css::util::NumberFormat::TEXT )
{
OUString aResult = mrScFmlaCell.GetString().getString();
bForceLineBreak = mrScFmlaCell.IsMultilineResult();
@@ -981,14 +981,14 @@ void XclExpFormulaCell::WriteContents( XclExpStream& rStrm )
// result of the formula
switch( mrScFmlaCell.GetFormatType() )
{
- case NUMBERFORMAT_NUMBER:
+ case css::util::NumberFormat::NUMBER:
{
// either value or error code
rStrm << mrScFmlaCell.GetValue();
}
break;
- case NUMBERFORMAT_TEXT:
+ case css::util::NumberFormat::TEXT:
{
OUString aResult = mrScFmlaCell.GetString().getString();
if( !aResult.isEmpty() || (rStrm.GetRoot().GetBiff() <= EXC_BIFF5) )
@@ -1002,7 +1002,7 @@ void XclExpFormulaCell::WriteContents( XclExpStream& rStrm )
}
break;
- case NUMBERFORMAT_LOGICAL:
+ case css::util::NumberFormat::LOGICAL:
{
sal_uInt8 nXclValue = (mrScFmlaCell.GetValue() == 0.0) ? 0 : 1;
rStrm << EXC_FORMULA_RES_BOOL << sal_uInt8( 0 )
@@ -2389,7 +2389,7 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) :
if( pPattern && ((fValue == 0.0) || (fValue == 1.0)) )
{
sal_uLong nScNumFmt = GETITEMVALUE( pPattern->GetItemSet(), SfxUInt32Item, ATTR_VALUE_FORMAT, sal_uLong );
- if( rFormatter.GetType( nScNumFmt ) == NUMBERFORMAT_LOGICAL )
+ if( rFormatter.GetType( nScNumFmt ) == css::util::NumberFormat::LOGICAL )
xCell.reset( new XclExpBooleanCell(
GetRoot(), aXclPos, pPattern, nMergeBaseXFId, fValue != 0.0 ) );
}
diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx
index 39f2e87..7b5dd24 100644
--- a/sc/source/filter/excel/xipivot.cxx
+++ b/sc/source/filter/excel/xipivot.cxx
@@ -101,15 +101,15 @@ void XclImpPCItem::WriteToSource( XclImpRoot& rRoot, const ScAddress& rScPos ) c
else if( const sal_Int16* pnValue = GetInteger() )
rDoc.setNumericCell(rScPos, *pnValue);
else if( const bool* pbValue = GetBool() )
- lclSetValue( rRoot, rScPos, *pbValue ? 1.0 : 0.0, NUMBERFORMAT_LOGICAL );
+ lclSetValue( rRoot, rScPos, *pbValue ? 1.0 : 0.0, css::util::NumberFormat::LOGICAL );
else if( const DateTime* pDateTime = GetDateTime() )
{
// set number format date, time, or date/time, depending on the value
double fValue = rRoot.GetDoubleFromDateTime( *pDateTime );
double fInt = 0.0;
double fFrac = modf( fValue, &fInt );
- short nFormatType = ((fFrac == 0.0) && (fInt != 0.0)) ? NUMBERFORMAT_DATE :
- ((fInt == 0.0) ? NUMBERFORMAT_TIME : NUMBERFORMAT_DATETIME);
+ short nFormatType = ((fFrac == 0.0) && (fInt != 0.0)) ? css::util::NumberFormat::DATE :
+ ((fInt == 0.0) ? css::util::NumberFormat::TIME : css::util::NumberFormat::DATETIME);
lclSetValue( rRoot, rScPos, fValue, nFormatType );
}
else if( const sal_uInt16* pnError = GetError() )
diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 5a3196a..56d9936 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -694,7 +694,7 @@ void XclImpNumFmtBuffer::CreateScFormats()
// insert/convert the Excel number format
sal_Int32 nCheckPos;
- short nType = NUMBERFORMAT_DEFINED;
+ short nType = css::util::NumberFormat::DEFINED;
sal_uInt32 nKey;
if( !rNumFmt.maFormat.isEmpty() )
{
diff --git a/sc/source/filter/lotus/tool.cxx b/sc/source/filter/lotus/tool.cxx
index 4bb6655..65759ae 100644
--- a/sc/source/filter/lotus/tool.cxx
+++ b/sc/source/filter/lotus/tool.cxx
@@ -174,7 +174,7 @@ SfxUInt32Item* FormCache::NewAttr( sal_uInt8 nFormat, sal_uInt8 nSt )
sal_uInt8 nL, nH; // Low-/High-Nibble
sal_uInt8 nForm = nFormat;
OUString aFormString;
- sal_Int16 eType = NUMBERFORMAT_ALL;
+ sal_Int16 eType = css::util::NumberFormat::ALL;
sal_uInt32 nIndex1;
sal_uInt32 nHandle;
NfIndexTableOffset eIndexTableOffset = NF_NUMERIC_START;
@@ -193,49 +193,49 @@ SfxUInt32Item* FormCache::NewAttr( sal_uInt8 nFormat, sal_uInt8 nSt )
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list