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
9263095c
Kaydet (Commit)
9263095c
authored
Mar 22, 2013
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add import test for data bars
Change-Id: Ida98e51a7f9970c7d4c845f5a6ac1566cbed9e3a
üst
b979429f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
0 deletions
+80
-0
databar.ods
sc/qa/unit/data/ods/databar.ods
+0
-0
databar.xlsx
sc/qa/unit/data/xlsx/databar.xlsx
+0
-0
subsequent_filters-test.cxx
sc/qa/unit/subsequent_filters-test.cxx
+80
-0
No files found.
sc/qa/unit/data/ods/databar.ods
0 → 100644
Dosyayı görüntüle @
9263095c
File added
sc/qa/unit/data/xlsx/databar.xlsx
0 → 100644
Dosyayı görüntüle @
9263095c
File added
sc/qa/unit/subsequent_filters-test.cxx
Dosyayı görüntüle @
9263095c
...
@@ -58,6 +58,7 @@
...
@@ -58,6 +58,7 @@
#include "stlsheet.hxx"
#include "stlsheet.hxx"
#include "docfunc.hxx"
#include "docfunc.hxx"
#include "markdata.hxx"
#include "markdata.hxx"
#include "colorscale.hxx"
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/drawing/XControlShape.hpp>
#include <com/sun/star/drawing/XControlShape.hpp>
...
@@ -122,6 +123,7 @@ public:
...
@@ -122,6 +123,7 @@ public:
void
testDataValidityODS
();
void
testDataValidityODS
();
void
testDataBarODS
();
void
testDataBarODS
();
void
testDataBarXLSX
();
void
testNewCondFormatXLSX
();
void
testNewCondFormatXLSX
();
//change this test file only in excel and not in calc
//change this test file only in excel and not in calc
...
@@ -181,6 +183,7 @@ public:
...
@@ -181,6 +183,7 @@ public:
CPPUNIT_TEST
(
testChartImportODS
);
CPPUNIT_TEST
(
testChartImportODS
);
CPPUNIT_TEST
(
testDataBarODS
);
CPPUNIT_TEST
(
testDataBarODS
);
CPPUNIT_TEST
(
testDataBarXLSX
);
CPPUNIT_TEST
(
testNewCondFormatXLSX
);
CPPUNIT_TEST
(
testNewCondFormatXLSX
);
CPPUNIT_TEST
(
testNumberFormatHTML
);
CPPUNIT_TEST
(
testNumberFormatHTML
);
...
@@ -1724,8 +1727,85 @@ void ScFiltersTest::testRichTextContentODS()
...
@@ -1724,8 +1727,85 @@ void ScFiltersTest::testRichTextContentODS()
xDocSh
->
DoClose
();
xDocSh
->
DoClose
();
}
}
namespace
{
struct
FindCondFormatByEnclosingRange
{
FindCondFormatByEnclosingRange
(
const
ScRange
&
rRange
)
:
mrRange
(
rRange
)
{}
bool
operator
()(
const
ScConditionalFormat
&
rFormat
)
{
if
(
rFormat
.
GetRange
().
Combine
()
==
mrRange
)
return
true
;
return
false
;
}
private
:
const
ScRange
&
mrRange
;
};
struct
DataBarData
{
ScRange
aRange
;
ScColorScaleEntryType
eLowerLimitType
;
ScColorScaleEntryType
eUpperLimitType
;
databar
::
ScAxisPostion
eAxisPosition
;
};
DataBarData
aData
[]
=
{
{
ScRange
(
1
,
2
,
0
,
1
,
5
,
0
),
COLORSCALE_AUTO
,
COLORSCALE_AUTO
,
databar
::
AUTOMATIC
},
{
ScRange
(
3
,
2
,
0
,
3
,
5
,
0
),
COLORSCALE_MIN
,
COLORSCALE_MAX
,
databar
::
AUTOMATIC
},
{
ScRange
(
5
,
2
,
0
,
5
,
5
,
0
),
COLORSCALE_PERCENTILE
,
COLORSCALE_PERCENT
,
databar
::
AUTOMATIC
},
{
ScRange
(
7
,
2
,
0
,
7
,
5
,
0
),
COLORSCALE_VALUE
,
COLORSCALE_FORMULA
,
databar
::
AUTOMATIC
},
{
ScRange
(
1
,
9
,
0
,
1
,
12
,
0
),
COLORSCALE_AUTO
,
COLORSCALE_AUTO
,
databar
::
MIDDLE
}
};
void
testDataBar_Impl
(
ScDocument
*
pDoc
)
{
ScConditionalFormatList
*
pList
=
pDoc
->
GetCondFormList
(
0
);
CPPUNIT_ASSERT
(
pList
);
for
(
size_t
i
=
0
;
i
<
SAL_N_ELEMENTS
(
aData
);
++
i
)
{
ScConditionalFormatList
::
const_iterator
itr
=
std
::
find_if
(
pList
->
begin
(),
pList
->
end
(),
FindCondFormatByEnclosingRange
(
aData
[
i
].
aRange
));
CPPUNIT_ASSERT
(
itr
!=
pList
->
end
());
CPPUNIT_ASSERT_EQUAL
(
size_t
(
1
),
itr
->
size
());
const
ScFormatEntry
*
pFormatEntry
=
itr
->
GetEntry
(
0
);
CPPUNIT_ASSERT_EQUAL
(
pFormatEntry
->
GetType
(),
condformat
::
DATABAR
);
const
ScDataBarFormat
*
pDataBar
=
static_cast
<
const
ScDataBarFormat
*>
(
pFormatEntry
);
CPPUNIT_ASSERT
(
pDataBar
);
const
ScDataBarFormatData
*
pDataBarData
=
pDataBar
->
GetDataBarData
();
CPPUNIT_ASSERT_EQUAL
(
aData
[
i
].
eLowerLimitType
,
pDataBarData
->
mpLowerLimit
->
GetType
());
CPPUNIT_ASSERT_EQUAL
(
aData
[
i
].
eUpperLimitType
,
pDataBarData
->
mpUpperLimit
->
GetType
());
CPPUNIT_ASSERT_EQUAL
(
aData
[
i
].
eAxisPosition
,
pDataBarData
->
meAxisPosition
);
}
}
}
void
ScFiltersTest
::
testDataBarODS
()
void
ScFiltersTest
::
testDataBarODS
()
{
{
ScDocShellRef
xDocSh
=
loadDoc
(
"databar."
,
ODS
);
CPPUNIT_ASSERT
(
xDocSh
.
Is
());
ScDocument
*
pDoc
=
xDocSh
->
GetDocument
();
CPPUNIT_ASSERT
(
pDoc
);
testDataBar_Impl
(
pDoc
);
}
void
ScFiltersTest
::
testDataBarXLSX
()
{
ScDocShellRef
xDocSh
=
loadDoc
(
"databar."
,
XLSX
);
CPPUNIT_ASSERT
(
xDocSh
.
Is
());
ScDocument
*
pDoc
=
xDocSh
->
GetDocument
();
CPPUNIT_ASSERT
(
pDoc
);
testDataBar_Impl
(
pDoc
);
}
}
void
ScFiltersTest
::
testNewCondFormatXLSX
()
void
ScFiltersTest
::
testNewCondFormatXLSX
()
...
...
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