summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-11-22 19:50:52 +0100
committerEike Rathke <erack@redhat.com>2016-11-22 19:56:33 +0100
commit50244309501d738e7314fa79785db139c826f8d7 (patch)
tree109eba4ff688bfc1762420b261ae3957c857995d
parent8e31d8a27baa76564f3b71e0d31750ae56873c61 (diff)
[API Change] revert incompatible change of enum css::sheet::GeneralFunction
Quick solution before 5-3 branch off without reverting everything related. This will need a new constant value type for API instead of the enum and an internal mapping from/to the enum. Kept the GeneralFunction_MEDIAN at all places in uing code so it can be easily grep'ed for. Change-Id: I95256649f16ded08e467003d2924be0ff5efb87f
-rw-r--r--offapi/com/sun/star/sheet/GeneralFunction.idl7
-rw-r--r--offapi/type_reference/offapi.idl3
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx7
-rw-r--r--sc/source/core/data/dpoutput.cxx3
-rw-r--r--sc/source/core/data/dputil.cxx3
-rw-r--r--sc/source/filter/xml/XMLConverter.cxx6
-rw-r--r--sc/source/ui/unoobj/dapiuno.cxx6
-rw-r--r--sc/source/ui/unoobj/datauno.cxx5
8 files changed, 32 insertions, 8 deletions
diff --git a/offapi/com/sun/star/sheet/GeneralFunction.idl b/offapi/com/sun/star/sheet/GeneralFunction.idl
index a7d3416316a1..ff9615c1a709 100644
--- a/offapi/com/sun/star/sheet/GeneralFunction.idl
+++ b/offapi/com/sun/star/sheet/GeneralFunction.idl
@@ -93,13 +93,8 @@ published enum GeneralFunction
/** variance is calculated based on the entire population.
*/
- VARP,
+ VARP
- /**
- * median of all numerical values is calculated.
- * @since LibreOffice 5.3
- */
- MEDIAN
};
diff --git a/offapi/type_reference/offapi.idl b/offapi/type_reference/offapi.idl
index 04d89e86726e..c7268343d6f5 100644
--- a/offapi/type_reference/offapi.idl
+++ b/offapi/type_reference/offapi.idl
@@ -11492,8 +11492,7 @@ module com {
STDEV = 9,
STDEVP = 10,
VAR = 11,
- VARP = 12,
- MEDIAN = 13
+ VARP = 12
};
/** @deprecated */ published interface XConsolidationDescriptor {
interface ::com::sun::star::uno::XInterface;
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 158f26b31404..9b2441ab17fe 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -2968,9 +2968,16 @@ void ScExportTest::testPivotTableMedian()
std::vector<ScDPSaveDimension const *>::size_type(1), aDims.size());
const ScDPSaveDimension* pDim = aDims.back();
+#if 0
+// disabled because of css::sheet::GeneralFunction API incompatibility
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Function for the data field should be MEDIAN.",
sal_uInt16(sheet::GeneralFunction_MEDIAN), pDim->GetFunction());
+#else
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ "Function for the data field should be MEDIAN.",
+ sal_uInt16(sheet::GeneralFunction_NONE), pDim->GetFunction());
+#endif
xDocSh2->DoClose();
}
diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx
index 39227bf9c051..1bd6a62a5379 100644
--- a/sc/source/core/data/dpoutput.cxx
+++ b/sc/source/core/data/dpoutput.cxx
@@ -1547,7 +1547,10 @@ OUString lcl_GetDataFieldName( const OUString& rSourceName, sheet::GeneralFuncti
case sheet::GeneralFunction_COUNT:
case sheet::GeneralFunction_COUNTNUMS: nStrId = STR_FUN_TEXT_COUNT; break;
case sheet::GeneralFunction_AVERAGE: nStrId = STR_FUN_TEXT_AVG; break;
+#if 0
+// disabled because of css::sheet::GeneralFunction API incompatibility
case sheet::GeneralFunction_MEDIAN: nStrId = STR_FUN_TEXT_MEDIAN; break;
+#endif
case sheet::GeneralFunction_MAX: nStrId = STR_FUN_TEXT_MAX; break;
case sheet::GeneralFunction_MIN: nStrId = STR_FUN_TEXT_MIN; break;
case sheet::GeneralFunction_PRODUCT: nStrId = STR_FUN_TEXT_PRODUCT; break;
diff --git a/sc/source/core/data/dputil.cxx b/sc/source/core/data/dputil.cxx
index b0f868fd779d..d64a5a8dbf67 100644
--- a/sc/source/core/data/dputil.cxx
+++ b/sc/source/core/data/dputil.cxx
@@ -410,7 +410,10 @@ ScSubTotalFunc ScDPUtil::toSubTotalFunc(css::sheet::GeneralFunction eGenFunc)
case sheet::GeneralFunction_SUM: eSubTotal = SUBTOTAL_FUNC_SUM; break;
case sheet::GeneralFunction_COUNT: eSubTotal = SUBTOTAL_FUNC_CNT2; break;
case sheet::GeneralFunction_AVERAGE: eSubTotal = SUBTOTAL_FUNC_AVE; break;
+#if 0
+// disabled because of css::sheet::GeneralFunction API incompatibility
case sheet::GeneralFunction_MEDIAN: eSubTotal = SUBTOTAL_FUNC_MED; break;
+#endif
case sheet::GeneralFunction_MAX: eSubTotal = SUBTOTAL_FUNC_MAX; break;
case sheet::GeneralFunction_MIN: eSubTotal = SUBTOTAL_FUNC_MIN; break;
case sheet::GeneralFunction_PRODUCT: eSubTotal = SUBTOTAL_FUNC_PROD; break;
diff --git a/sc/source/filter/xml/XMLConverter.cxx b/sc/source/filter/xml/XMLConverter.cxx
index 9cd60bb42f27..3c1688036ad9 100644
--- a/sc/source/filter/xml/XMLConverter.cxx
+++ b/sc/source/filter/xml/XMLConverter.cxx
@@ -56,8 +56,11 @@ sheet::GeneralFunction ScXMLConverter::GetFunctionFromString( const OUString& sF
return sheet::GeneralFunction_PRODUCT;
if( IsXMLToken(sFunction, XML_AVERAGE ) )
return sheet::GeneralFunction_AVERAGE;
+#if 0
+// disabled because of css::sheet::GeneralFunction API incompatibility
if( IsXMLToken(sFunction, XML_MEDIAN ) )
return sheet::GeneralFunction_MEDIAN;
+#endif
if( IsXMLToken(sFunction, XML_MAX ) )
return sheet::GeneralFunction_MAX;
if( IsXMLToken(sFunction, XML_MIN ) )
@@ -111,7 +114,10 @@ void ScXMLConverter::GetStringFromFunction(
{
case sheet::GeneralFunction_AUTO: sFuncStr = GetXMLToken( XML_AUTO ); break;
case sheet::GeneralFunction_AVERAGE: sFuncStr = GetXMLToken( XML_AVERAGE ); break;
+#if 0
+// disabled because of css::sheet::GeneralFunction API incompatibility
case sheet::GeneralFunction_MEDIAN: sFuncStr = GetXMLToken( XML_MEDIAN ); break;
+#endif
case sheet::GeneralFunction_COUNT: sFuncStr = GetXMLToken( XML_COUNT ); break;
case sheet::GeneralFunction_COUNTNUMS: sFuncStr = GetXMLToken( XML_COUNTNUMS ); break;
case sheet::GeneralFunction_MAX: sFuncStr = GetXMLToken( XML_MAX ); break;
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index fe2590b09c7c..a09053b4d865 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -184,7 +184,10 @@ GeneralFunction ScDataPilotConversion::FirstFunc( PivotFunc nBits )
if ( nBits & PivotFunc::Sum ) return GeneralFunction_SUM;
if ( nBits & PivotFunc::Count ) return GeneralFunction_COUNT;
if ( nBits & PivotFunc::Average ) return GeneralFunction_AVERAGE;
+#if 0
+// disabled because of css::sheet::GeneralFunction API incompatibility
if ( nBits & PivotFunc::Median ) return GeneralFunction_MEDIAN;
+#endif
if ( nBits & PivotFunc::Max ) return GeneralFunction_MAX;
if ( nBits & PivotFunc::Min ) return GeneralFunction_MIN;
if ( nBits & PivotFunc::Product ) return GeneralFunction_PRODUCT;
@@ -205,7 +208,10 @@ PivotFunc ScDataPilotConversion::FunctionBit( GeneralFunction eFunc )
case GeneralFunction_SUM: nRet = PivotFunc::Sum; break;
case GeneralFunction_COUNT: nRet = PivotFunc::Count; break;
case GeneralFunction_AVERAGE: nRet = PivotFunc::Average; break;
+#if 0
+// disabled because of css::sheet::GeneralFunction API incompatibility
case GeneralFunction_MEDIAN: nRet = PivotFunc::Median; break;
+#endif
case GeneralFunction_MAX: nRet = PivotFunc::Max; break;
case GeneralFunction_MIN: nRet = PivotFunc::Min; break;
case GeneralFunction_PRODUCT: nRet = PivotFunc::Product; break;
diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index 403bb6a461b3..63c5a864c7cb 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -144,7 +144,12 @@ sheet::GeneralFunction ScDataUnoConversion::SubTotalToGeneral( ScSubTotalFunc e
case SUBTOTAL_FUNC_AVE: eGeneral = sheet::GeneralFunction_AVERAGE; break;
case SUBTOTAL_FUNC_CNT: eGeneral = sheet::GeneralFunction_COUNTNUMS; break;
case SUBTOTAL_FUNC_CNT2: eGeneral = sheet::GeneralFunction_COUNT; break;
+#if 0
+// disabled because of css::sheet::GeneralFunction API incompatibility
case SUBTOTAL_FUNC_MED: eGeneral = sheet::GeneralFunction_MEDIAN; break;
+#else
+ case SUBTOTAL_FUNC_MED: eGeneral = sheet::GeneralFunction_NONE; break;
+#endif
case SUBTOTAL_FUNC_MAX: eGeneral = sheet::GeneralFunction_MAX; break;
case SUBTOTAL_FUNC_MIN: eGeneral = sheet::GeneralFunction_MIN; break;
case SUBTOTAL_FUNC_PROD: eGeneral = sheet::GeneralFunction_PRODUCT; break;