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
76115b29
Kaydet (Commit)
76115b29
authored
Mar 29, 2015
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
start work on data property tests
Change-Id: I1f1722aa3566555816df19e68aa7eaa97e7a13d9
üst
af56ed1c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
87 additions
and
0 deletions
+87
-0
new_cond_format.cxx
sc/qa/extras/new_cond_format.cxx
+87
-0
new_cond_format_api.ods
sc/qa/extras/testdocuments/new_cond_format_api.ods
+0
-0
No files found.
sc/qa/extras/new_cond_format.cxx
Dosyayı görüntüle @
76115b29
...
...
@@ -14,6 +14,7 @@
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/sheet/XSpreadsheet.hpp>
#include <com/sun/star/table/CellAddress.hpp>
#include <com/sun/star/sheet/DataBarAxis.hpp>
#include <unonames.hxx>
using
namespace
css
;
...
...
@@ -36,6 +37,7 @@ public:
void
testCondFormatListFormats
();
void
testCondFormatProperties
();
void
testCondFormatXIndex
();
void
testDataBarProperties
();
CPPUNIT_TEST_SUITE
(
ScConditionalFormatTest
);
CPPUNIT_TEST
(
testRequestCondFormatListFromSheet
);
...
...
@@ -43,6 +45,7 @@ public:
CPPUNIT_TEST
(
testCondFormatListFormats
);
CPPUNIT_TEST
(
testCondFormatProperties
);
CPPUNIT_TEST
(
testCondFormatXIndex
);
CPPUNIT_TEST
(
testDataBarProperties
);
CPPUNIT_TEST_SUITE_END
();
private
:
...
...
@@ -174,6 +177,90 @@ void ScConditionalFormatTest::testCondFormatXIndex()
*/
}
namespace
{
void
testAxisPosition
(
uno
::
Reference
<
beans
::
XPropertySet
>
xPropSet
,
sal_Int32
ePos
)
{
sal_Int32
eAxisPos
;
uno
::
Any
aAny
=
xPropSet
->
getPropertyValue
(
"AxisPosition"
);
CPPUNIT_ASSERT
(
aAny
>>=
eAxisPos
);
CPPUNIT_ASSERT_EQUAL
(
ePos
,
eAxisPos
);
}
void
testShowValue
(
uno
::
Reference
<
beans
::
XPropertySet
>
xPropSet
,
bool
bShowVal
)
{
bool
bShow
;
uno
::
Any
aAny
=
xPropSet
->
getPropertyValue
(
"ShowValue"
);
CPPUNIT_ASSERT
(
aAny
>>=
bShow
);
CPPUNIT_ASSERT_EQUAL
(
bShowVal
,
bShow
);
}
void
testUseGradient
(
uno
::
Reference
<
beans
::
XPropertySet
>
xPropSet
,
bool
bUseGradient
)
{
bool
bGradient
;
uno
::
Any
aAny
=
xPropSet
->
getPropertyValue
(
"UseGradient"
);
CPPUNIT_ASSERT
(
aAny
>>=
bGradient
);
CPPUNIT_ASSERT_EQUAL
(
bUseGradient
,
bGradient
);
}
void
testPositiveColor
(
uno
::
Reference
<
beans
::
XPropertySet
>
xPropSet
,
Color
aColor
)
{
sal_Int32
nColor
;
uno
::
Any
aAny
=
xPropSet
->
getPropertyValue
(
"Color"
);
CPPUNIT_ASSERT
(
aAny
>>=
nColor
);
CPPUNIT_ASSERT_EQUAL
(
aColor
.
GetColor
(),
sal_uInt32
(
nColor
));
}
void
testNegativeColor
(
uno
::
Reference
<
beans
::
XPropertySet
>
xPropSet
,
Color
aColor
)
{
sal_Int32
nColor
;
uno
::
Any
aAny
=
xPropSet
->
getPropertyValue
(
"NegativeColor"
);
CPPUNIT_ASSERT
(
aAny
>>=
nColor
);
CPPUNIT_ASSERT_EQUAL
(
aColor
.
GetColor
(),
sal_uInt32
(
nColor
));
}
void
testAxisColor
(
uno
::
Reference
<
beans
::
XPropertySet
>
xPropSet
,
Color
aColor
)
{
sal_Int32
nColor
;
uno
::
Any
aAny
=
xPropSet
->
getPropertyValue
(
"AxisColor"
);
CPPUNIT_ASSERT
(
aAny
>>=
nColor
);
CPPUNIT_ASSERT_EQUAL
(
aColor
.
GetColor
(),
sal_uInt32
(
nColor
));
}
}
void
ScConditionalFormatTest
::
testDataBarProperties
()
{
uno
::
Reference
<
sheet
::
XConditionalFormats
>
xCondFormatList
=
getConditionalFormatList
(
init
(
2
));
uno
::
Sequence
<
uno
::
Reference
<
sheet
::
XConditionalFormat
>
>
xCondFormats
=
xCondFormatList
->
getConditionalFormats
();
CPPUNIT_ASSERT_EQUAL
(
sal_Int32
(
1
),
xCondFormats
.
getLength
());
uno
::
Reference
<
sheet
::
XConditionalFormat
>
xCondFormat
=
xCondFormats
[
0
];
CPPUNIT_ASSERT
(
xCondFormat
.
is
());
uno
::
Type
aType
=
xCondFormat
->
getElementType
();
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"com.sun.star.beans.XPropertySet"
),
aType
.
getTypeName
());
CPPUNIT_ASSERT
(
xCondFormat
->
hasElements
());
CPPUNIT_ASSERT_EQUAL
(
sal_Int32
(
5
),
xCondFormat
->
getCount
());
uno
::
Reference
<
beans
::
XPropertySet
>
xPropSet
;
{
uno
::
Any
aAny
=
xCondFormat
->
getByIndex
(
0
);
CPPUNIT_ASSERT
(
aAny
.
hasValue
());
CPPUNIT_ASSERT
(
aAny
>>=
xPropSet
);
testAxisPosition
(
xPropSet
,
sheet
::
DataBarAxis
::
AXIS_AUTOMATIC
);
testShowValue
(
xPropSet
,
true
);
testUseGradient
(
xPropSet
,
true
);
testPositiveColor
(
xPropSet
,
COL_LIGHTBLUE
);
testNegativeColor
(
xPropSet
,
COL_LIGHTRED
);
testAxisColor
(
xPropSet
,
COL_BLACK
);
}
}
void
ScConditionalFormatTest
::
setUp
()
{
nTest
++
;
...
...
sc/qa/extras/testdocuments/new_cond_format_api.ods
Dosyayı görüntüle @
76115b29
No preview for this file type
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