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
2bed1867
Kaydet (Commit)
2bed1867
authored
Kas 04, 2015
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
CppunitTest_desktop_lib: test absolute positions for row/column headers
Change-Id: If2526647221fef2c6b18b21b589192239d8a89ad
üst
84dedf4f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
5 deletions
+49
-5
test_desktop_lib.cxx
desktop/qa/desktop_lib/test_desktop_lib.cxx
+49
-5
No files found.
desktop/qa/desktop_lib/test_desktop_lib.cxx
Dosyayı görüntüle @
2bed1867
...
...
@@ -363,6 +363,35 @@ void DesktopLOKTest::testPasteWriter()
void
DesktopLOKTest
::
testRowColumnHeaders
()
{
/*
* Payload example:
*
* {
* "rows": [
* {
* "size": "254.987250637468",
* "text": "1"
* },
* {
* "size": "509.974501274936",
* "text": "2"
* }
* ],
* "columns": [
* {
* "size": "1274.93625318734",
* "text": "A"
* },
* {
* "size": "2549.87250637468",
* "text": "B"
* }
* ]
* }
*
* "size" defines the bottom/right boundary of a row/column in twips (size between 0 and boundary)
* "text" has the header label in UTF-8
*/
LibLODocument_Impl
*
pDocument
=
loadDoc
(
"search.ods"
);
boost
::
property_tree
::
ptree
aTree
;
char
*
pJSON
=
pDocument
->
m_pDocumentClass
->
getCommandValues
(
pDocument
,
".uno:ViewRowColumnHeaders"
);
...
...
@@ -371,23 +400,38 @@ void DesktopLOKTest::testRowColumnHeaders()
CPPUNIT_ASSERT
(
!
aStream
.
str
().
empty
());
boost
::
property_tree
::
read_json
(
aStream
,
aTree
);
sal_Int32
nPrevious
=
0
;
for
(
boost
::
property_tree
::
ptree
::
value_type
&
rValue
:
aTree
.
get_child
(
"rows"
))
{
sal_Int32
nSize
=
OString
(
rValue
.
second
.
get
<
std
::
string
>
(
"size"
).
c_str
()).
toInt32
();
CPPUNIT_ASSERT
(
nSize
>
0
);
OString
aText
(
rValue
.
second
.
get
<
std
::
string
>
(
"text"
).
c_str
());
// This failed, as the first item did not contain the text of the first row.
CPPUNIT_ASSERT_EQUAL
(
OString
(
"1"
),
aText
);
break
;
if
(
!
nPrevious
)
// This failed, as the first item did not contain the text of the first row.
CPPUNIT_ASSERT_EQUAL
(
OString
(
"1"
),
aText
);
else
{
// Make sure that size is absolute: the first two items have the same relative size.
CPPUNIT_ASSERT
(
nPrevious
<
nSize
);
break
;
}
nPrevious
=
nSize
;
}
nPrevious
=
0
;
for
(
boost
::
property_tree
::
ptree
::
value_type
&
rValue
:
aTree
.
get_child
(
"columns"
))
{
sal_Int32
nSize
=
OString
(
rValue
.
second
.
get
<
std
::
string
>
(
"size"
).
c_str
()).
toInt32
();
CPPUNIT_ASSERT
(
nSize
>
0
);
OString
aText
(
rValue
.
second
.
get
<
std
::
string
>
(
"text"
).
c_str
());
CPPUNIT_ASSERT_EQUAL
(
OString
(
"A"
),
aText
);
break
;
if
(
!
nPrevious
)
CPPUNIT_ASSERT_EQUAL
(
OString
(
"A"
),
aText
);
else
{
CPPUNIT_ASSERT
(
nPrevious
<
nSize
);
break
;
}
nPrevious
=
nSize
;
}
}
...
...
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