Bugzilla – Attachment 63254 Details for
Bug 50950
modify calc functions WEEKNUM, WEEKNUM_ADD to comply with ODFF1.2
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch sofar, not yet ready for submitting
fdo50950-20120620.diff (text/plain), 26.79 KB, created by
Winfried Donkers
on 2012-06-20 02:23:54 UTC
(
hide
)
Description:
patch sofar, not yet ready for submitting
Filename:
MIME Type:
Creator:
Winfried Donkers
Created:
2012-06-20 02:23:54 UTC
Size:
26.79 KB
patch
obsolete
>diff --git a/formula/inc/formula/compiler.hrc b/formula/inc/formula/compiler.hrc >index 4babe0e..0ede0b0 100644 >--- a/formula/inc/formula/compiler.hrc >+++ b/formula/inc/formula/compiler.hrc >@@ -364,7 +364,7 @@ > #define SC_OPCODE_TABLE_OP 362 > #define SC_OPCODE_BETA_DIST 363 > #define SC_OPCODE_BETA_INV 364 >-#define SC_OPCODE_WEEK 365 /* miscellaneous */ >+#define SC_OPCODE_WEEKNUM 365 /* miscellaneous */ > #define SC_OPCODE_GET_DAY_OF_WEEK 366 > #define SC_OPCODE_NO_NAME 367 > #define SC_OPCODE_STYLE 368 >@@ -401,8 +401,9 @@ > #define SC_OPCODE_BITLSHIFT 399 > #define SC_OPCODE_GET_DATEDIF 400 > #define SC_OPCODE_XOR 401 >-#define SC_OPCODE_STOP_2_PAR 402 >-#define SC_OPCODE_LAST_OPCODE_ID 402 /* last OpCode */ >+#define SC_OPCODE_ISOWEEKNUM 402 >+#define SC_OPCODE_STOP_2_PAR 403 >+#define SC_OPCODE_LAST_OPCODE_ID 403 /* last OpCode */ > > /*** Internal ***/ > #define SC_OPCODE_INTERNAL_BEGIN 9999 >diff --git a/formula/inc/formula/opcode.hxx b/formula/inc/formula/opcode.hxx >index 16b12ec..7a2e49b 100644 >--- a/formula/inc/formula/opcode.hxx >+++ b/formula/inc/formula/opcode.hxx >@@ -376,7 +376,8 @@ enum OpCodeEnum > ocBitRshift = SC_OPCODE_BITRSHIFT, > ocBitLshift = SC_OPCODE_BITLSHIFT, > // miscellaneous >- ocWeek = SC_OPCODE_WEEK, >+ ocWeeknum = SC_OPCODE_WEEKNUM, >+ ocIsoWeeknum = SC_OPCODE_ISOWEEKNUM, > ocGetDayOfWeek = SC_OPCODE_GET_DAY_OF_WEEK, > ocNoName = SC_OPCODE_NO_NAME, > ocStyle = SC_OPCODE_STYLE, >diff --git a/formula/source/core/resource/core_resource.src b/formula/source/core/resource/core_resource.src >index b4ea345..78cb615 100644 >--- a/formula/source/core/resource/core_resource.src >+++ b/formula/source/core/resource/core_resource.src >@@ -326,7 +326,8 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF > String SC_OPCODE_TABLE_OP { Text = "MULTIPLE.OPERATIONS" ; }; > String SC_OPCODE_BETA_DIST { Text = "BETADIST" ; }; > String SC_OPCODE_BETA_INV { Text = "BETAINV" ; }; >- String SC_OPCODE_WEEK { Text = "ISOWEEKNUM" ; }; >+ String SC_OPCODE_WEEKNUM { Text = "WEEKNUM" ; }; >+ String SC_OPCODE_ISOWEEKNUM { Text = "ISOWEEKNUM" ; }; > String SC_OPCODE_EASTERSUNDAY { Text = "ORG.OPENOFFICE.EASTERSUNDAY" ; }; > String SC_OPCODE_GET_DAY_OF_WEEK { Text = "WEEKDAY" ; }; > String SC_OPCODE_NO_NAME { Text = "#NAME!" ; }; >@@ -659,7 +660,8 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH > String SC_OPCODE_TABLE_OP { Text = "TABLE" ; }; > String SC_OPCODE_BETA_DIST { Text = "BETADIST" ; }; > String SC_OPCODE_BETA_INV { Text = "BETAINV" ; }; >- String SC_OPCODE_WEEK { Text = "WEEKNUM" ; }; >+ String SC_OPCODE_WEEKNUM { Text = "WEEKNUM" ; }; >+ String SC_OPCODE_ISOWEEKNUM { Text = "ISOWEEKNUM" ; }; > String SC_OPCODE_EASTERSUNDAY { Text = "EASTERSUNDAY" ; }; > String SC_OPCODE_GET_DAY_OF_WEEK { Text = "WEEKDAY" ; }; > String SC_OPCODE_NO_NAME { Text = "#NAME!" ; }; >@@ -1803,10 +1805,14 @@ Resource RID_STRLIST_FUNCTION_NAMES > { > Text [ en-US ] = "BETAINV" ; > }; >- String SC_OPCODE_WEEK >+ String SC_OPCODE_WEEKNUM > { > Text [ en-US ] = "WEEKNUM" ; > }; >+ String SC_OPCODE_ISOWEEKNUM >+ { >+ Text [ en-US ] = "ISOWEEKNUM" ; >+ }; > String SC_OPCODE_EASTERSUNDAY > { > Text [ en-US ] = "EASTERSUNDAY" ; >diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h >index af03708..94c76dd 100644 >--- a/sc/inc/helpids.h >+++ b/sc/inc/helpids.h >@@ -297,7 +297,6 @@ > #define HID_AAI_FUNC_WORKDAY "SC_HID_AAI_FUNC_WORKDAY" > #define HID_AAI_FUNC_YEARFRAC "SC_HID_AAI_FUNC_YEARFRAC" > #define HID_AAI_FUNC_EDATE "SC_HID_AAI_FUNC_EDATE" >-#define HID_AAI_FUNC_WEEKNUM "SC_HID_AAI_FUNC_WEEKNUM" > #define HID_AAI_FUNC_EOMONTH "SC_HID_AAI_FUNC_EOMONTH" > #define HID_AAI_FUNC_NETWORKDAYS "SC_HID_AAI_FUNC_NETWORKDAYS" > #define HID_AAI_FUNC_AMORDEGRC "SC_HID_AAI_FUNC_AMORDEGRC" >@@ -444,7 +443,8 @@ > #define HID_FUNC_JAHR "SC_HID_FUNC_JAHR" > #define HID_FUNC_TAGE "SC_HID_FUNC_TAGE" > #define HID_FUNC_DATEDIF "SC_HID_FUNC_DATEDIF" >-#define HID_FUNC_KALENDERWOCHE "SC_HID_FUNC_KALENDERWOCHE" >+#define HID_FUNC_WEEKNUM "SC_HID_FUNC_WEEKNUM" >+#define HID_FUNC_ISOWEEKNUM "SC_HID_FUNC_ISOWEEKNUM" > #define HID_FUNC_OSTERSONNTAG "SC_HID_FUNC_OSTERSONNTAG" > > #define HID_FUNC_BW "SC_HID_FUNC_BW" >diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx >index 1db6294..fc06d01 100644 >--- a/sc/qa/unit/ucalc.cxx >+++ b/sc/qa/unit/ucalc.cxx >@@ -3209,6 +3209,7 @@ void Test::testFunctionLists() > "DAYS360", > "EASTERSUNDAY", > "HOUR", >+ "ISOWEEKNUM", > "MINUTE", > "MONTH", > "NOW", >diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx >index de577ca..7e8c562 100644 >--- a/sc/source/core/inc/interpre.hxx >+++ b/sc/source/core/inc/interpre.hxx >@@ -576,6 +576,7 @@ void ScGetMonth(); > void ScGetDay(); > void ScGetDayOfWeek(); > void ScGetWeekOfYear(); >+void ScGetIsoWeekOfYear(); > void ScEasterSunday(); > void ScGetHour(); > void ScGetMin(); >diff --git a/sc/source/core/tool/addinhelpid.cxx b/sc/source/core/tool/addinhelpid.cxx >index 0442b5a..42a9d00 100644 >--- a/sc/source/core/tool/addinhelpid.cxx >+++ b/sc/source/core/tool/addinhelpid.cxx >@@ -138,7 +138,6 @@ const ScUnoAddInHelpId pAnalysisHelpIds[] = > { "getTbilleq" , HID_AAI_FUNC_TBILLEQ }, > { "getTbillprice" , HID_AAI_FUNC_TBILLPRICE }, > { "getTbillyield" , HID_AAI_FUNC_TBILLYIELD }, >- { "getWeeknum" , HID_AAI_FUNC_WEEKNUM }, > { "getWorkday" , HID_AAI_FUNC_WORKDAY }, > { "getXirr" , HID_AAI_FUNC_XIRR }, > { "getXnpv" , HID_AAI_FUNC_XNPV }, >diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx >index e359a3d..2ca123e 100644 >--- a/sc/source/core/tool/interpr2.cxx >+++ b/sc/source/core/tool/interpr2.cxx >@@ -224,19 +224,63 @@ void ScInterpreter::ScGetDayOfWeek() > } > } > >+ >+//fdo50950 calc function WEEKNUM, in complete compliance with ODFF1.2 > void ScInterpreter::ScGetWeekOfYear() > { > RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScGetWeekOfYear" ); > if ( MustHaveParamCount( GetByte(), 2 ) ) > { >- short nFlag = (short) ::rtl::math::approxFloor(GetDouble()); >+ short nMode = (short) ::rtl::math::approxFloor(GetDouble()); >+ >+ Date aDate = *(pFormatter->GetNullDate()); >+ aDate += (long)::rtl::math::approxFloor(GetDouble()); >+ >+ sal_Int32 nMinimumNumberOfDaysInWeek; >+ DayOfWeek eFirstDayOfWeek; >+ switch ( nMode ) >+ { >+ case 1 : >+ case 11 : >+ case 2 : >+ case 12 : >+ case 13 : >+ case 14 : >+ case 15 : >+ case 16 : >+ case 17 : >+ eFirstDayOfWeek = (DayOfWeek) ( ( nMode - 1 ) % 10 ); >+ nMinimumNumberOfDaysInWeek = 1; //the week containing January 1 is week 1 >+ break; >+ case 21 : >+ case 150 : >+ // ISO8601 >+ eFirstDayOfWeek = MONDAY; >+ nMinimumNumberOfDaysInWeek = 4; >+ break; >+ default : >+ PushIllegalArgument(); >+ return; >+ } >+ PushInt( (int) aDate.GetWeekOfYear( eFirstDayOfWeek, nMinimumNumberOfDaysInWeek ) ); >+ } >+} > >+ >+//fdo50950 calc function for ISOWEEKNUM, in complete compliance with ODFF1.2 >+void ScInterpreter::ScGetIsoWeekOfYear() >+{ >+ RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScGetIsoWeekOfYear" ); >+ if ( MustHaveParamCount( GetByte(), 1 ) ) >+ { > Date aDate = *(pFormatter->GetNullDate()); > aDate += (long)::rtl::math::approxFloor(GetDouble()); >- PushInt( (int) aDate.GetWeekOfYear( nFlag == 1 ? SUNDAY : MONDAY )); >+ >+ PushInt( (int) aDate.GetWeekOfYear( MONDAY, 4 ) ); > } > } > >+ > void ScInterpreter::ScEasterSunday() > { > RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScEasterSunday" ); >diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx >index c914daf..ba54c60 100644 >--- a/sc/source/core/tool/interpr4.cxx >+++ b/sc/source/core/tool/interpr4.cxx >@@ -3854,7 +3854,8 @@ StackVar ScInterpreter::Interpret() > case ocGetMonth : ScGetMonth(); break; > case ocGetDay : ScGetDay(); break; > case ocGetDayOfWeek : ScGetDayOfWeek(); break; >- case ocWeek : ScGetWeekOfYear(); break; >+ case ocWeeknum : ScGetWeekOfYear(); break; >+ case ocIsoWeeknum : ScGetIsoWeekOfYear(); break; > case ocEasterSunday : ScEasterSunday(); break; > case ocGetHour : ScGetHour(); break; > case ocGetMin : ScGetMin(); break; >diff --git a/sc/source/core/tool/odffmap.cxx b/sc/source/core/tool/odffmap.cxx >index b61f8ad..e479dfb 100644 >--- a/sc/source/core/tool/odffmap.cxx >+++ b/sc/source/core/tool/odffmap.cxx >@@ -44,7 +44,6 @@ ScCompiler::AddInMap ScCompiler::maAddInMap[] = > { "WORKDAY", "WORKDAY", false, "com.sun.star.sheet.addin.Analysis.getWorkday", "COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETWORKDAY" }, > { "YEARFRAC", "YEARFRAC", false, "com.sun.star.sheet.addin.Analysis.getYearfrac", "COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETYEARFRAC" }, > { "EDATE", "EDATE", false, "com.sun.star.sheet.addin.Analysis.getEdate", "COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETEDATE" }, >- { "WEEKNUM", "WEEKNUM_ADD", false, "com.sun.star.sheet.addin.Analysis.getWeeknum", "COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETWEEKNUM" }, > { "EOMONTH", "EOMONTH", false, "com.sun.star.sheet.addin.Analysis.getEomonth", "COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETEOMONTH" }, > { "NETWORKDAYS", "NETWORKDAYS", false, "com.sun.star.sheet.addin.Analysis.getNetworkdays", "COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETNETWORKDAYS" }, > { "ISEVEN", "ISEVEN_ADD", true, "com.sun.star.sheet.addin.Analysis.getIseven", "COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETISEVEN" }, >diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx >index d299aa2..d52249b 100644 >--- a/sc/source/filter/excel/xlformula.cxx >+++ b/sc/source/filter/excel/xlformula.cxx >@@ -391,7 +391,7 @@ static const XclFunctionInfo saFuncTable_Odf[] = > EXC_FUNCENTRY_ODF( ocGauss, 1, 1, 0, "GAUSS" ), > EXC_FUNCENTRY_ODF( ocNoName, 2, 2, 0, "IFNA" ), > EXC_FUNCENTRY_ODF( ocIsFormula, 1, 1, 0, "ISFORMULA" ), >- EXC_FUNCENTRY_ODF( ocWeek, 1, 2, 0, "ISOWEEKNUM" ), >+ EXC_FUNCENTRY_ODF( ocIsoWeeknum, 1, 1, 0, "ISOWEEKNUM" ), > EXC_FUNCENTRY_ODF( ocMatrixUnit, 1, 1, 0, "MUNIT" ), > EXC_FUNCENTRY_ODF( ocNumberValue, 2, 2, 0, "NUMBERVALUE" ), > EXC_FUNCENTRY_ODF( ocLaufz, 3, 3, 0, "PDURATION" ), >diff --git a/sc/source/filter/inc/formulabase.hxx b/sc/source/filter/inc/formulabase.hxx >index 66ceccd..95ca43d 100644 >--- a/sc/source/filter/inc/formulabase.hxx >+++ b/sc/source/filter/inc/formulabase.hxx >@@ -215,7 +215,6 @@ const sal_uInt16 BIFF_FUNC_EXTERNCALL = 255; /// BIFF function id > const sal_uInt16 BIFF_FUNC_FLOOR = 285; /// Function identifier of the FLOOR function. > const sal_uInt16 BIFF_FUNC_CEILING = 288; /// Function identifier of the CEILING function. > const sal_uInt16 BIFF_FUNC_HYPERLINK = 359; /// Function identifier of the HYPERLINK function. >-const sal_uInt16 BIFF_FUNC_WEEKNUM = 465; /// Function identifier of the WEEKNUM function. > > // Formula type =============================================================== > >diff --git a/sc/source/filter/inc/formulaparser.hxx b/sc/source/filter/inc/formulaparser.hxx >index 6bbe5fc..537d5a0 100644 >--- a/sc/source/filter/inc/formulaparser.hxx >+++ b/sc/source/filter/inc/formulaparser.hxx >@@ -90,7 +90,6 @@ private: > const ApiToken* findParameters( ParameterPosVector& rParams, const ApiToken* pToken, const ApiToken* pTokenEnd ) const; > void appendEmptyParameter( const FunctionInfo& rFuncInfo, size_t nParam ); > void appendCalcOnlyParameter( const FunctionInfo& rFuncInfo, size_t nParam ); >- void appendRequiredParameters( const FunctionInfo& rFuncInfo, size_t nParamCount ); > > bool appendFinalToken( const ApiToken& rToken ); > >diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx >index b80dbfa..7f5b6f1 100644 >--- a/sc/source/filter/oox/formulabase.cxx >+++ b/sc/source/filter/oox/formulabase.cxx >@@ -629,7 +629,6 @@ static const FunctionData saFuncTableBiff4[] = > { "ODDFPRICE", "ODDFPRICE", 462, NOID, 8, 9, V, { RR }, FUNCFLAG_EXTERNAL }, > { "ODDFYIELD", "ODDFYIELD", 463, NOID, 8, 9, V, { RR }, FUNCFLAG_EXTERNAL }, > { "RANDBETWEEN", "RANDBETWEEN", 464, NOID, 2, 2, V, { RR }, FUNCFLAG_VOLATILE | FUNCFLAG_EXTERNAL }, >- { "WEEKNUM", "WEEKNUM", 465, NOID, 1, 2, V, { RR }, FUNCFLAG_EXTERNAL }, > { "AMORDEGRC", "AMORDEGRC", 466, NOID, 6, 7, V, { RR }, FUNCFLAG_EXTERNAL }, > { "AMORLINC", "AMORLINC", 467, NOID, 6, 7, V, { RR }, FUNCFLAG_EXTERNAL }, > { "CONVERT", "CONVERT", 468, NOID, 3, 3, V, { RR }, FUNCFLAG_EXTERNAL }, // Calc: builtin and add-in >@@ -669,6 +668,8 @@ static const FunctionData saFuncTableBiff5[] = > { 0, "DATESTRING", 352, 352, 1, 1, V, { VR }, FUNCFLAG_IMPORTONLY }, // not supported in Calc, missing in OOXML spec > { 0, "NUMBERSTRING", 353, 353, 2, 2, V, { VR }, FUNCFLAG_IMPORTONLY }, // not supported in Calc, missing in OOXML spec > { "ROMAN", "ROMAN", 354, 354, 1, 2, V, { VR }, 0 }, >+ { "WEEKNUM", "WEEKNUM", 465, 465, 1, 2, V, { VR }, 0 }, >+ { "ISOWEEKNUM", "ISOWEEKNUM", 355, 355, 1, 1, V, { VR }, 0 }, > > // *** EuroTool add-in *** > >@@ -750,7 +751,6 @@ static const FunctionData saFuncTableOdf[] = > { "GAUSS", 0, NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_MACROCALLODF }, > { "IFNA", 0, NOID, NOID, 2, 2, V, { VR, RO }, FUNCFLAG_MACROCALLODF }, > { "ISFORMULA", 0, NOID, NOID, 1, 1, V, { RO }, FUNCFLAG_MACROCALLODF }, >- { "ISOWEEKNUM", 0, NOID, NOID, 1, 2, V, { VR }, FUNCFLAG_MACROCALLODF }, > { "MUNIT", 0, NOID, NOID, 1, 1, A, { VR }, FUNCFLAG_MACROCALLODF }, > { "NUMBERVALUE", 0, NOID, NOID, 2, 2, V, { VR }, FUNCFLAG_MACROCALLODF }, > { "PDURATION", 0, NOID, NOID, 3, 3, V, { VR }, FUNCFLAG_MACROCALLODF }, >diff --git a/sc/source/filter/oox/formulaparser.cxx b/sc/source/filter/oox/formulaparser.cxx >index a4e5f71..bc02f2b 100644 >--- a/sc/source/filter/oox/formulaparser.cxx >+++ b/sc/source/filter/oox/formulaparser.cxx >@@ -286,9 +286,6 @@ const ApiToken* FormulaFinalizer::processParameters( > if( aParamInfoIt.isCalcOnlyParam() ) > appendCalcOnlyParameter( *pRealFuncInfo, nLastValidCount ); > >- // add optional parameters that are required in Calc >- appendRequiredParameters( *pRealFuncInfo, nLastValidCount ); >- > // remove last parameter separator token > if( maTokens.back().OpCode == OPCODE_SEP ) > maTokens.pop_back(); >@@ -405,20 +402,6 @@ void FormulaFinalizer::appendCalcOnlyParameter( const FunctionInfo& rFuncInfo, s > } > } > >-void FormulaFinalizer::appendRequiredParameters( const FunctionInfo& rFuncInfo, size_t nParamCount ) >-{ >- switch( rFuncInfo.mnBiff12FuncId ) >- { >- case BIFF_FUNC_WEEKNUM: >- if( nParamCount == 1 ) >- { >- maTokens.append< double >( OPCODE_PUSH, 1.0 ); >- maTokens.append( OPCODE_SEP ); >- } >- break; >- } >-} >- > bool FormulaFinalizer::appendFinalToken( const ApiToken& rToken ) > { > // replace OPCODE_MACRO without macro name with #NAME? error code >diff --git a/sc/source/ui/src/scfuncs.src b/sc/source/ui/src/scfuncs.src >index 039aad6..cbd82a5 100644 >--- a/sc/source/ui/src/scfuncs.src >+++ b/sc/source/ui/src/scfuncs.src >@@ -1018,8 +1018,8 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS1 > Text [ en-US ] = "Interval to be calculated. Can be \"d\", \"m\", \"y\", \"ym\", \"md\" or \"yd\"."; > }; > }; >- // -=*# Resource for function KALENDERWOCHE #*=- >- Resource SC_OPCODE_WEEK >+ // -=*# Resource for function WEEKNUM #*=- >+ Resource SC_OPCODE_WEEKNUM > { > String 1 // Description > { >@@ -1029,7 +1029,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS1 > { > 0; > ID_FUNCTION_GRP_DATETIME; >- U2S( HID_FUNC_KALENDERWOCHE ); >+ U2S( HID_FUNC_WEEKNUM ); > 2; 0; 0; > 0; > }; >@@ -1047,7 +1047,31 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS1 > }; > String 5 // Description of Parameter 2 > { >- Text [ en-US ] = "Indicates the first day of the week (1 = Sunday, other values = Monday)." ; >+ Text [ en-US ] = "Indicates the first day of the week (1 or 11 = Sunday, 2 or 12 = Monday, 13 - 17 = Tuesday - Saturday. Week 1 is the week that contains January 1. Value 21 or 150 calculate according to ISO8601: first day of week is Monday and week 1 is the week where the first Thursday of the year occurs)." ; >+ }; >+ }; >+ // -=*# Resource for function ISOWEEKNUM #*=- >+ Resource SC_OPCODE_ISOWEEKNUM >+ { >+ String 1 // Description >+ { >+ Text [ en-US ] = "Calculates the ISO8601 calender week for the given date. ISO 8601 defines the calendar week as a time interval of seven calendar days starting with a Monday, and the first calendar week of a year as the one that includes the first Thursday of that year." ; >+ }; >+ ExtraData = >+ { >+ 0; >+ ID_FUNCTION_GRP_DATETIME; >+ U2S( HID_FUNC_ISOWEEKNUM ); >+ 1; 0; 0; >+ 0; >+ }; >+ String 2 // Name of Parameter 1 >+ { >+ Text [ en-US ] = "Number" ; >+ }; >+ String 3 // Description of Parameter 1 >+ { >+ Text [ en-US ] = "The internal number of the date." ; > }; > }; > // -=*# Resource for function OSTERSONNTAG #*=- >diff --git a/sc/util/hidother.src b/sc/util/hidother.src >index 9b3c3fb..2c229d2 100644 >--- a/sc/util/hidother.src >+++ b/sc/util/hidother.src >@@ -114,7 +114,8 @@ hidspecial HID_FUNC_WOCHENTAG { HelpID = HID_FUNC_WOCHENTAG; }; > hidspecial HID_FUNC_JAHR { HelpID = HID_FUNC_JAHR; }; > hidspecial HID_FUNC_TAGE { HelpID = HID_FUNC_TAGE; }; > hidspecial HID_FUNC_DATEDIF { HelpID = HID_FUNC_DATEDIF; }; >-hidspecial HID_FUNC_KALENDERWOCHE { HelpID = HID_FUNC_KALENDERWOCHE; }; >+hidspecial HID_FUNC_WEEKNUM { HelpID = HID_FUNC_WEEKNUM; }; >+hidspecial HID_FUNC_ISOWEEKNUM { HelpID = HID_FUNC_ISOWEEKNUM; }; > hidspecial HID_FUNC_OSTERSONNTAG { HelpID = HID_FUNC_OSTERSONNTAG; }; > hidspecial HID_FUNC_BW { HelpID = HID_FUNC_BW; }; > hidspecial HID_FUNC_ZW { HelpID = HID_FUNC_ZW; }; >@@ -380,7 +381,6 @@ hidspecial HID_FUNC_BITLSHIFT { HelpID = HID_FUNC_BITLSHIFT; }; > hidspecial HID_AAI_FUNC_WORKDAY { HelpID = HID_AAI_FUNC_WORKDAY; }; > hidspecial HID_AAI_FUNC_YEARFRAC { HelpID = HID_AAI_FUNC_YEARFRAC; }; > hidspecial HID_AAI_FUNC_EDATE { HelpID = HID_AAI_FUNC_EDATE; }; >-hidspecial HID_AAI_FUNC_WEEKNUM { HelpID = HID_AAI_FUNC_WEEKNUM; }; > hidspecial HID_AAI_FUNC_EOMONTH { HelpID = HID_AAI_FUNC_EOMONTH; }; > hidspecial HID_AAI_FUNC_NETWORKDAYS { HelpID = HID_AAI_FUNC_NETWORKDAYS; }; > hidspecial HID_AAI_FUNC_AMORDEGRC { HelpID = HID_AAI_FUNC_AMORDEGRC; }; >diff --git a/scaddins/idl/com/sun/star/sheet/addin/XAnalysis.idl b/scaddins/idl/com/sun/star/sheet/addin/XAnalysis.idl >index daae62b..70cf065 100644 >--- a/scaddins/idl/com/sun/star/sheet/addin/XAnalysis.idl >+++ b/scaddins/idl/com/sun/star/sheet/addin/XAnalysis.idl >@@ -66,12 +66,6 @@ module addin > [in] long nStartDate, [in] long nNumOfMonths ) > raises( com::sun::star::lang::IllegalArgumentException ); > >- /// weeknum. >- long getWeeknum( >- [in] com::sun::star::beans::XPropertySet xOptions, >- [in] long nStartDate, [in] long nMode ) >- raises( com::sun::star::lang::IllegalArgumentException ); >- > /// eomonth. > long getEomonth( > [in] com::sun::star::beans::XPropertySet xOptions, >diff --git a/scaddins/source/analysis/analysis.cxx b/scaddins/source/analysis/analysis.cxx >index 2215f28..3fee860 100644 >--- a/scaddins/source/analysis/analysis.cxx >+++ b/scaddins/source/analysis/analysis.cxx >@@ -37,6 +37,8 @@ > > #include <tools/resmgr.hxx> > #include <tools/rcid.h> >+//fdo50950 >+#include <tools/date.hxx> > #include "analysis.hrc" > #include "bessel.hxx" > >@@ -596,20 +598,6 @@ sal_Int32 SAL_CALL AnalysisAddIn::getEdate( constREFXPS& xOpt, sal_Int32 nStartD > } > > >-sal_Int32 SAL_CALL AnalysisAddIn::getWeeknum( constREFXPS& xOpt, sal_Int32 nDate, sal_Int32 nMode ) THROWDEF_RTE_IAE >-{ >- nDate += GetNullDate( xOpt ); >- >- sal_uInt16 nDay, nMonth, nYear; >- DaysToDate( nDate, nDay, nMonth, nYear ); >- >- sal_Int32 nFirstInYear = DateToDays( 1, 1, nYear ); >- sal_uInt16 nFirstDayInYear = GetDayOfWeek( nFirstInYear ); >- >- return ( nDate - nFirstInYear + ( ( nMode == 1 )? ( nFirstDayInYear + 1 ) % 7 : nFirstDayInYear ) ) / 7 + 1; >-} >- >- > sal_Int32 SAL_CALL AnalysisAddIn::getEomonth( constREFXPS& xOpt, sal_Int32 nDate, sal_Int32 nMonths ) THROWDEF_RTE_IAE > { > sal_Int32 nNullDate = GetNullDate( xOpt ); >diff --git a/scaddins/source/analysis/analysis.hxx b/scaddins/source/analysis/analysis.hxx >index b6d58e6..61ac329 100644 >--- a/scaddins/source/analysis/analysis.hxx >+++ b/scaddins/source/analysis/analysis.hxx >@@ -126,7 +126,6 @@ public: > virtual sal_Int32 SAL_CALL getWorkday( constREFXPS&, sal_Int32 nStartDate, sal_Int32 nDays, const ANY& aHDay ) THROWDEF_RTE_IAE; > virtual double SAL_CALL getYearfrac( constREFXPS&, sal_Int32 nStartDate, sal_Int32 nEndDate, const ANY& aMode ) THROWDEF_RTE_IAE; > virtual sal_Int32 SAL_CALL getEdate( constREFXPS&, sal_Int32 nStartDate, sal_Int32 nMonths ) THROWDEF_RTE_IAE; >- virtual sal_Int32 SAL_CALL getWeeknum( constREFXPS&, sal_Int32 nStartDate, sal_Int32 nMode ) THROWDEF_RTE_IAE; > virtual sal_Int32 SAL_CALL getEomonth( constREFXPS&, sal_Int32 nStartDate, sal_Int32 nMonths ) THROWDEF_RTE_IAE; > virtual sal_Int32 SAL_CALL getNetworkdays( constREFXPS&, sal_Int32 nStartDate, sal_Int32 nEndDate, const ANY& aHDay ) THROWDEF_RTE_IAE; > >diff --git a/scaddins/source/analysis/analysis.src b/scaddins/source/analysis/analysis.src >index 8e81e3e..d9037e8 100644 >--- a/scaddins/source/analysis/analysis.src >+++ b/scaddins/source/analysis/analysis.src >@@ -133,34 +133,6 @@ Resource RID_ANALYSIS_FUNCTION_DESCRIPTIONS > }; > }; > >- Resource ANALYSIS_Weeknum >- { >- String 1 // description Weeknum_add >- { >- Text [ en-US ] = "Returns the number of the calendar week in which the specified date occurs."; >- }; >- >- String 2 // name of parameter 1 Weeknum_add >- { >- Text [ en-US ] = "Date"; >- }; >- >- String 3 // description of parameter 1 Weeknum_add >- { >- Text [ en-US ] = "The date"; >- }; >- >- String 4 // name of parameter 2 Weeknum_add >- { >- Text [ en-US ] = "Return type"; >- }; >- >- String 5 // description of parameter 2 Weeknum_add >- { >- Text [ en-US ] = "A number from 1 to 3 that specifies the day with which a week begins"; >- }; >- }; >- > Resource ANALYSIS_Eomonth > { > String 1 // description EoMonth >diff --git a/scaddins/source/analysis/analysis_deffuncnames.src b/scaddins/source/analysis/analysis_deffuncnames.src >index cff3b5d..96c0740 100644 >--- a/scaddins/source/analysis/analysis_deffuncnames.src >+++ b/scaddins/source/analysis/analysis_deffuncnames.src >@@ -57,15 +57,6 @@ Resource RID_ANALYSIS_DEFFUNCTION_NAMES > }; > }; > >- StringArray ANALYSIS_DEFFUNCNAME_Weeknum >- { >- ItemList = >- { >- < "KALENDERWOCHE"; >; >- < "WEEKNUM"; >; >- }; >- }; >- > StringArray ANALYSIS_DEFFUNCNAME_Eomonth > { > ItemList = >diff --git a/scaddins/source/analysis/analysis_funcnames.src b/scaddins/source/analysis/analysis_funcnames.src >index fea61a5..f8c584c 100644 >--- a/scaddins/source/analysis/analysis_funcnames.src >+++ b/scaddins/source/analysis/analysis_funcnames.src >@@ -45,11 +45,6 @@ Resource RID_ANALYSIS_FUNCTION_NAMES > Text [ en-US ] = "EDATE"; > }; > >- String ANALYSIS_FUNCNAME_Weeknum >- { >- Text [ en-US ] = "WEEKNUM"; >- }; >- > String ANALYSIS_FUNCNAME_Eomonth > { > Text [ en-US ] = "EOMONTH"; >diff --git a/scaddins/source/analysis/analysishelper.cxx b/scaddins/source/analysis/analysishelper.cxx >index a37632f..277dc1b 100644 >--- a/scaddins/source/analysis/analysishelper.cxx >+++ b/scaddins/source/analysis/analysishelper.cxx >@@ -57,7 +57,6 @@ const FuncDataBase pFuncDatas[] = > FUNCDATA( Workday, UNIQUE, INTPAR, 3, FDCat_DateTime ), > FUNCDATA( Yearfrac, UNIQUE, INTPAR, 3, FDCat_DateTime ), > FUNCDATA( Edate, UNIQUE, INTPAR, 2, FDCat_DateTime ), >- FUNCDATA( Weeknum, DOUBLE, INTPAR, 2, FDCat_DateTime ), > FUNCDATA( Eomonth, UNIQUE, INTPAR, 2, FDCat_DateTime ), > FUNCDATA( Networkdays, UNIQUE, INTPAR, 3, FDCat_DateTime ), > FUNCDATA( Iseven, DOUBLE, STDPAR, 1, FDCat_Inf ),
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 50950
:
63254
|
63255
|
64112
|
64113
|
64281
|
70309