Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
92c1128f
Kaydet (Commit)
92c1128f
authored
Kas 19, 2016
tarafından
Tamás Zolnai
Kaydeden (comit)
Tamás Zolnai
Kas 19, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
PivotMedian: ODS import / export of pivot table median
Change-Id: I3b018f5a76bb3d89bcb6cbc34e4cb2f2057248d5
üst
298ee506
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
1 deletion
+44
-1
pivot-table-median.ods
sc/qa/unit/data/ods/pivot-table-median.ods
+0
-0
subsequent_export-test.cxx
sc/qa/unit/subsequent_export-test.cxx
+37
-0
XMLConverter.cxx
sc/source/filter/xml/XMLConverter.cxx
+7
-1
No files found.
sc/qa/unit/data/ods/pivot-table-median.ods
0 → 100755
Dosyayı görüntüle @
92c1128f
File added
sc/qa/unit/subsequent_export-test.cxx
Dosyayı görüntüle @
92c1128f
...
...
@@ -149,6 +149,7 @@ public:
void
testPivotTableXLSX
();
void
testPivotTableTwoDataFieldsXLSX
();
void
testPivotTableMedian
();
void
testSwappedOutImageExport
();
void
testLinkedGraphicRT
();
...
...
@@ -238,6 +239,7 @@ public:
CPPUNIT_TEST
(
testSheetProtection
);
CPPUNIT_TEST
(
testPivotTableXLSX
);
CPPUNIT_TEST
(
testPivotTableTwoDataFieldsXLSX
);
CPPUNIT_TEST
(
testPivotTableMedian
);
#if !defined(_WIN32)
CPPUNIT_TEST
(
testSupBookVirtualPath
);
#endif
...
...
@@ -2936,6 +2938,41 @@ void ScExportTest::testPivotTableTwoDataFieldsXLSX()
xDocSh2
->
DoClose
();
}
void
ScExportTest
::
testPivotTableMedian
()
{
ScDocShellRef
xDocSh
=
loadDoc
(
"pivot-table-median."
,
FORMAT_ODS
);
CPPUNIT_ASSERT_MESSAGE
(
"Failed to load test document."
,
xDocSh
.
Is
());
// Export the document and import again for a check
ScDocShellRef
xDocSh2
=
saveAndReload
(
xDocSh
.
get
(),
FORMAT_ODS
);
xDocSh
->
DoClose
();
// Check sheet
ScDocument
&
rDoc
=
xDocSh2
->
GetDocument
();
CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"There should be exactly one sheet."
,
sal_Int16
(
1
),
rDoc
.
GetTableCount
());
// Check pivot table
ScDPCollection
*
pDPs
=
rDoc
.
GetDPCollection
();
CPPUNIT_ASSERT_MESSAGE
(
"Failed to get a live ScDPCollection instance."
,
pDPs
);
CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"There should be one pivot table instance."
,
size_t
(
1
),
pDPs
->
GetCount
());
const
ScDPObject
*
pDPObj
=
&
(
*
pDPs
)[
0
];
CPPUNIT_ASSERT_MESSAGE
(
"Failed to get pivot table object."
,
pDPObj
);
const
ScDPSaveData
*
pSaveData
=
pDPObj
->
GetSaveData
();
CPPUNIT_ASSERT_MESSAGE
(
"Failed to get ScDPSaveData instance."
,
pSaveData
);
// Check the data field function.
std
::
vector
<
const
ScDPSaveDimension
*>
aDims
;
pSaveData
->
GetAllDimensionsByOrientation
(
sheet
::
DataPilotFieldOrientation_DATA
,
aDims
);
CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"There should be exactly 1 data field."
,
std
::
vector
<
ScDPSaveDimension
const
*>::
size_type
(
1
),
aDims
.
size
());
const
ScDPSaveDimension
*
pDim
=
aDims
.
back
();
CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"Function for the data field should be COUNT."
,
sal_uInt16
(
sheet
::
GeneralFunction_MEDIAN
),
pDim
->
GetFunction
());
}
void
ScExportTest
::
testFunctionsExcel2010ODS
()
{
//testFunctionsExcel2010(FORMAT_ODS);
...
...
sc/source/filter/xml/XMLConverter.cxx
Dosyayı görüntüle @
92c1128f
...
...
@@ -56,6 +56,8 @@ sheet::GeneralFunction ScXMLConverter::GetFunctionFromString( const OUString& sF
return
sheet
::
GeneralFunction_PRODUCT
;
if
(
IsXMLToken
(
sFunction
,
XML_AVERAGE
)
)
return
sheet
::
GeneralFunction_AVERAGE
;
if
(
IsXMLToken
(
sFunction
,
XML_MEDIAN
)
)
return
sheet
::
GeneralFunction_MEDIAN
;
if
(
IsXMLToken
(
sFunction
,
XML_MAX
)
)
return
sheet
::
GeneralFunction_MAX
;
if
(
IsXMLToken
(
sFunction
,
XML_MIN
)
)
...
...
@@ -83,6 +85,8 @@ ScSubTotalFunc ScXMLConverter::GetSubTotalFuncFromString( const OUString& sFunct
return
SUBTOTAL_FUNC_PROD
;
if
(
IsXMLToken
(
sFunction
,
XML_AVERAGE
)
)
return
SUBTOTAL_FUNC_AVE
;
if
(
IsXMLToken
(
sFunction
,
XML_MEDIAN
)
)
return
SUBTOTAL_FUNC_MED
;
if
(
IsXMLToken
(
sFunction
,
XML_MAX
)
)
return
SUBTOTAL_FUNC_MAX
;
if
(
IsXMLToken
(
sFunction
,
XML_MIN
)
)
...
...
@@ -107,6 +111,7 @@ void ScXMLConverter::GetStringFromFunction(
{
case
sheet
:
:
GeneralFunction_AUTO
:
sFuncStr
=
GetXMLToken
(
XML_AUTO
);
break
;
case
sheet
:
:
GeneralFunction_AVERAGE
:
sFuncStr
=
GetXMLToken
(
XML_AVERAGE
);
break
;
case
sheet
:
:
GeneralFunction_MEDIAN
:
sFuncStr
=
GetXMLToken
(
XML_MEDIAN
);
break
;
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
;
...
...
@@ -120,7 +125,7 @@ void ScXMLConverter::GetStringFromFunction(
case
sheet
:
:
GeneralFunction_VARP
:
sFuncStr
=
GetXMLToken
(
XML_VARP
);
break
;
default
:
{
// added to avoid warnings
assert
(
false
);
}
}
ScRangeStringConverter
::
AssignString
(
rString
,
sFuncStr
,
false
);
...
...
@@ -134,6 +139,7 @@ void ScXMLConverter::GetStringFromFunction(
switch
(
eFunction
)
{
case
SUBTOTAL_FUNC_AVE
:
sFuncStr
=
GetXMLToken
(
XML_AVERAGE
);
break
;
case
SUBTOTAL_FUNC_MED
:
sFuncStr
=
GetXMLToken
(
XML_MEDIAN
);
break
;
case
SUBTOTAL_FUNC_CNT
:
sFuncStr
=
GetXMLToken
(
XML_COUNT
);
break
;
case
SUBTOTAL_FUNC_CNT2
:
sFuncStr
=
GetXMLToken
(
XML_COUNTNUMS
);
break
;
case
SUBTOTAL_FUNC_MAX
:
sFuncStr
=
GetXMLToken
(
XML_MAX
);
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment