add COLOR function
This function makes property mapping in charts more user friendly. Change-Id: I01cfb31edd749ee474d5078042fa5c4b4a270f86
This commit is contained in:
committed by
Markus Mohrhard
parent
fefad3715a
commit
dd0f844728
@@ -423,6 +423,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
|
||||
/* END defined ERROR.TYPE() values. */
|
||||
String SC_OPCODE_FILTERXML { Text = "COM.MICROSOFT.FILTERXML";};
|
||||
String SC_OPCODE_WEBSERVICE { Text = "COM.MICROSOFT.WEBSERVICE"; };
|
||||
String SC_OPCODE_COLOR { Text = "COLOR"; };
|
||||
String SC_OPCODE_ERF_MS { Text = "COM.MICROSOFT.ERF.PRECISE" ; };
|
||||
String SC_OPCODE_ERFC_MS { Text = "COM.MICROSOFT.ERFC.PRECISE" ; };
|
||||
};
|
||||
@@ -1237,6 +1238,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
|
||||
/* END defined ERROR.TYPE() values. */
|
||||
String SC_OPCODE_FILTERXML { Text = "FILTERXML";};
|
||||
String SC_OPCODE_WEBSERVICE { Text = "WEBSERVICE"; };
|
||||
String SC_OPCODE_COLOR { Text = "COLOR"; };
|
||||
String SC_OPCODE_ERF_MS { Text = "ERF.PRECISE" ; };
|
||||
String SC_OPCODE_ERFC_MS { Text = "ERFC.PRECISE" ; };
|
||||
};
|
||||
@@ -2767,6 +2769,10 @@ Resource RID_STRLIST_FUNCTION_NAMES
|
||||
{
|
||||
Text [ en-US ] = "FILTERXML";
|
||||
};
|
||||
String SC_OPCODE_COLOR
|
||||
{
|
||||
Text [ en-US ] = "COLOR";
|
||||
};
|
||||
String SC_OPCODE_WEBSERVICE
|
||||
{
|
||||
Text [ en-US ] = "WEBSERVICE";
|
||||
|
@@ -468,8 +468,9 @@
|
||||
#define SC_OPCODE_NETWORKDAYS_MS 468
|
||||
#define SC_OPCODE_WORKDAY_MS 469
|
||||
#define SC_OPCODE_AGGREGATE 470
|
||||
#define SC_OPCODE_COLOR 471
|
||||
|
||||
#define SC_OPCODE_STOP_2_PAR 471 /* last function with two or more parameters' OpCode + 1 */
|
||||
#define SC_OPCODE_STOP_2_PAR 472 /* last function with two or more parameters' OpCode + 1 */
|
||||
#define SC_OPCODE_STOP_FUNCTION SC_OPCODE_STOP_2_PAR /* last function's OpCode + 1 */
|
||||
#define SC_OPCODE_LAST_OPCODE_ID (SC_OPCODE_STOP_FUNCTION - 1) /* last OpCode */
|
||||
|
||||
|
@@ -461,6 +461,7 @@ enum OpCodeEnum
|
||||
ocEuroConvert = SC_OPCODE_EUROCONVERT,
|
||||
ocFilterXML = SC_OPCODE_FILTERXML,
|
||||
ocWebservice = SC_OPCODE_WEBSERVICE,
|
||||
ocColor = SC_OPCODE_COLOR,
|
||||
ocErf_MS = SC_OPCODE_ERF_MS,
|
||||
ocErfc_MS = SC_OPCODE_ERFC_MS,
|
||||
// internal stuff
|
||||
|
@@ -646,6 +646,7 @@
|
||||
#define HID_FUNC_BITRSHIFT "SC_HID_FUNC_BITRSHIFT"
|
||||
#define HID_FUNC_FILTERXML "SC_HID_FUNC_FILTERXML"
|
||||
#define HID_FUNC_WEBSERVICE "SC_HID_FUNC_WEBSERVICE"
|
||||
#define HID_FUNC_COLOR "SC_HID_FUNC_COLOR"
|
||||
#define HID_FUNC_COVARIANCE_P "SC_HID_FUNC_COVARIANCE_P"
|
||||
#define HID_FUNC_COVARIANCE_S "SC_HID_FUNC_COVARIANCE_S"
|
||||
#define HID_FUNC_ST_DEV_P_MS "SC_HID_FUNC_ST_DEV_P_MS"
|
||||
|
@@ -2509,6 +2509,7 @@ void Test::testFunctionLists()
|
||||
"BITXOR",
|
||||
"CEILING",
|
||||
"CEILING.PRECISE",
|
||||
"COLOR",
|
||||
"COMBIN",
|
||||
"COMBINA",
|
||||
"CONVERT",
|
||||
|
@@ -833,6 +833,7 @@ void ScMidB();
|
||||
|
||||
void ScFilterXML();
|
||||
void ScWebservice();
|
||||
void ScColor();
|
||||
void ScErf();
|
||||
void ScErfc();
|
||||
|
||||
|
@@ -4088,6 +4088,7 @@ StackVar ScInterpreter::Interpret()
|
||||
case ocZins : ScZins(); break;
|
||||
case ocFilterXML : ScFilterXML(); break;
|
||||
case ocWebservice : ScWebservice(); break;
|
||||
case ocColor : ScColor(); break;
|
||||
case ocErf_MS : ScErf(); break;
|
||||
case ocErfc_MS : ScErfc(); break;
|
||||
case ocZinsZ : ScZinsZ(); break;
|
||||
|
@@ -274,4 +274,48 @@ void ScInterpreter::ScErfc()
|
||||
}
|
||||
}
|
||||
|
||||
void ScInterpreter::ScColor()
|
||||
{
|
||||
sal_uInt8 nParamCount = GetByte();
|
||||
if(MustHaveParamCount(nParamCount, 3, 4))
|
||||
{
|
||||
double nAlpha = 0;
|
||||
if(nParamCount == 4)
|
||||
nAlpha = rtl::math::approxFloor(GetDouble());
|
||||
|
||||
if(nAlpha < 0 || nAlpha > 255)
|
||||
{
|
||||
PushIllegalArgument();
|
||||
return;
|
||||
}
|
||||
|
||||
double nBlue = rtl::math::approxFloor(GetDouble());
|
||||
|
||||
if(nBlue < 0 || nBlue > 255)
|
||||
{
|
||||
PushIllegalArgument();
|
||||
return;
|
||||
}
|
||||
|
||||
double nGreen = rtl::math::approxFloor(GetDouble());
|
||||
|
||||
if(nGreen < 0 || nGreen > 255)
|
||||
{
|
||||
PushIllegalArgument();
|
||||
return;
|
||||
}
|
||||
|
||||
double nRed = rtl::math::approxFloor(GetDouble());
|
||||
|
||||
if(nRed < 0 || nRed > 255)
|
||||
{
|
||||
PushIllegalArgument();
|
||||
return;
|
||||
}
|
||||
|
||||
double nVal = 256*256*256*nAlpha + 256*256*nRed + 256*nGreen + nBlue;
|
||||
PushDouble(nVal);
|
||||
}
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
@@ -11999,6 +11999,53 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
|
||||
Text [ en-US ] = "String containing a valid XPath expression";
|
||||
};
|
||||
};
|
||||
Resource SC_OPCODE_COLOR
|
||||
{
|
||||
ExtraData =
|
||||
{
|
||||
0;
|
||||
ID_FUNCTION_GRP_MATH;
|
||||
U2S( HID_FUNC_COLOR );
|
||||
4; 0; 0; 0; 1;
|
||||
0;
|
||||
};
|
||||
String 1 // Description
|
||||
{
|
||||
Text [ en-US ] = "Returns an implementation defined value representing a RGBA color";
|
||||
};
|
||||
String 2 // Name of Parameter 1
|
||||
{
|
||||
Text [ en-US ] = "Red";
|
||||
};
|
||||
String 3 // Description of Parameter 1
|
||||
{
|
||||
Text [ en-US ] = "Value of red";
|
||||
};
|
||||
String 4 // Name of parameter 2
|
||||
{
|
||||
Text [ en-US ] = "Green";
|
||||
};
|
||||
String 5 // Description of Parameter 2
|
||||
{
|
||||
Text [ en-US ] = "Value of green";
|
||||
};
|
||||
String 6 // Name of Parameter 3
|
||||
{
|
||||
Text [ en-US ] = "Blue";
|
||||
};
|
||||
String 7 // Description of Parameter 3
|
||||
{
|
||||
Text [ en-US ] = "Value of blue";
|
||||
};
|
||||
String 8 // Name of parameter 4
|
||||
{
|
||||
Text [ en-US ] = "Alpha";
|
||||
};
|
||||
String 9 // Description of Parameter 4
|
||||
{
|
||||
Text [ en-US ] = "Value of alpha";
|
||||
};
|
||||
};
|
||||
Resource SC_OPCODE_WEBSERVICE
|
||||
{
|
||||
String 1 // Description
|
||||
|
Reference in New Issue
Block a user