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
6ed88e6d
Kaydet (Commit)
6ed88e6d
authored
May 01, 2013
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add test for ooxml error bar export
Change-Id: I87f99c8d47770181c3f29c70f1f91a1f3dd421b5
üst
14c2ab30
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
0 deletions
+65
-0
chart2export.cxx
chart2/qa/extras/chart2export.cxx
+65
-0
error_bar.ods
chart2/qa/extras/data/ods/error_bar.ods
+0
-0
No files found.
chart2/qa/extras/chart2export.cxx
Dosyayı görüntüle @
6ed88e6d
...
...
@@ -9,13 +9,20 @@
#include "charttest.hxx"
#include <com/sun/star/chart/ErrorBarStyle.hpp>
using
uno
::
Reference
;
using
beans
::
XPropertySet
;
class
Chart2ExportTest
:
public
ChartTest
{
public
:
void
test
();
void
testErrorBarXLSX
();
CPPUNIT_TEST_SUITE
(
Chart2ExportTest
);
CPPUNIT_TEST
(
test
);
CPPUNIT_TEST
(
testErrorBarXLSX
);
CPPUNIT_TEST_SUITE_END
();
private
:
...
...
@@ -27,6 +34,64 @@ void Chart2ExportTest::test()
reload
(
"Calc Office Open XML"
);
}
namespace
{
void
testErrorBar
(
Reference
<
XPropertySet
>
xErrorBar
)
{
sal_Int32
nErrorBarStyle
;
xErrorBar
->
getPropertyValue
(
"ErrorBarStyle"
)
>>=
nErrorBarStyle
;
CPPUNIT_ASSERT_EQUAL
(
nErrorBarStyle
,
chart
::
ErrorBarStyle
::
RELATIVE
);
bool
bShowPositive
,
bShowNegative
;
xErrorBar
->
getPropertyValue
(
"ShowPositiveError"
)
>>=
bShowPositive
;
CPPUNIT_ASSERT
(
bShowPositive
);
xErrorBar
->
getPropertyValue
(
"ShowNegativeError"
)
>>=
bShowNegative
;
CPPUNIT_ASSERT
(
bShowNegative
);
double
nVal
;
xErrorBar
->
getPropertyValue
(
"PositiveError"
)
>>=
nVal
;
CPPUNIT_ASSERT_DOUBLES_EQUAL
(
nVal
,
10.0
,
1e-10
);
}
}
// improve the test
void
Chart2ExportTest
::
testErrorBarXLSX
()
{
load
(
"/chart2/qa/extras/data/ods/"
,
"error_bar.ods"
);
{
// make sure the ODS import was successful
uno
::
Reference
<
chart2
::
XChartDocument
>
xChartDoc
=
getChartDocFromSheet
(
0
,
mxComponent
);
CPPUNIT_ASSERT
(
xChartDoc
.
is
());
Reference
<
chart2
::
XDataSeries
>
xDataSeries
=
getDataSeriesFromDoc
(
xChartDoc
,
0
);
CPPUNIT_ASSERT
(
xDataSeries
.
is
()
);
Reference
<
beans
::
XPropertySet
>
xPropSet
(
xDataSeries
,
UNO_QUERY_THROW
);
CPPUNIT_ASSERT
(
xPropSet
.
is
()
);
// test that y error bars are there
Reference
<
beans
::
XPropertySet
>
xErrorBarYProps
;
xPropSet
->
getPropertyValue
(
"ErrorBarY"
)
>>=
xErrorBarYProps
;
testErrorBar
(
xErrorBarYProps
);
}
reload
(
"Calc Office Open XML"
);
{
uno
::
Reference
<
chart2
::
XChartDocument
>
xChartDoc
=
getChartDocFromSheet
(
0
,
mxComponent
);
CPPUNIT_ASSERT
(
xChartDoc
.
is
());
Reference
<
chart2
::
XDataSeries
>
xDataSeries
=
getDataSeriesFromDoc
(
xChartDoc
,
0
);
CPPUNIT_ASSERT
(
xDataSeries
.
is
()
);
Reference
<
beans
::
XPropertySet
>
xPropSet
(
xDataSeries
,
UNO_QUERY_THROW
);
CPPUNIT_ASSERT
(
xPropSet
.
is
()
);
// test that y error bars are there
Reference
<
beans
::
XPropertySet
>
xErrorBarYProps
;
xPropSet
->
getPropertyValue
(
"ErrorBarY"
)
>>=
xErrorBarYProps
;
testErrorBar
(
xErrorBarYProps
);
}
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
Chart2ExportTest
);
CPPUNIT_PLUGIN_IMPLEMENT
();
...
...
chart2/qa/extras/data/ods/error_bar.ods
0 → 100644
Dosyayı görüntüle @
6ed88e6d
File added
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