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
3f6f7566
Kaydet (Commit)
3f6f7566
authored
Eki 03, 2013
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Test comparison between simple and rich-text string values.
Change-Id: Icdb9a81b1be80b058b71c23b3fcb58a5e8970e21
üst
875f47cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
0 deletions
+52
-0
ucalc.cxx
sc/qa/unit/ucalc.cxx
+52
-0
No files found.
sc/qa/unit/ucalc.cxx
Dosyayı görüntüle @
3f6f7566
...
@@ -57,6 +57,8 @@
...
@@ -57,6 +57,8 @@
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/brushitem.hxx>
#include <editeng/brushitem.hxx>
#include "editeng/wghtitem.hxx"
#include "editeng/postitem.hxx"
#include <svx/svdograf.hxx>
#include <svx/svdograf.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdpage.hxx>
...
@@ -535,6 +537,56 @@ void Test::testCellStringPool()
...
@@ -535,6 +537,56 @@ void Test::testCellStringPool()
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
size_t
>
(
0
),
rPool
.
getCount
());
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
size_t
>
(
0
),
rPool
.
getCount
());
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
size_t
>
(
0
),
rPool
.
getCountIgnoreCase
());
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
size_t
>
(
0
),
rPool
.
getCountIgnoreCase
());
// Now, compare string and edit text cells.
m_pDoc
->
SetString
(
ScAddress
(
0
,
0
,
0
),
"Andy and Bruce"
);
// A1
ScFieldEditEngine
&
rEE
=
m_pDoc
->
GetEditEngine
();
rEE
.
SetText
(
"Andy and Bruce"
);
ESelection
aSel
;
aSel
.
nStartPara
=
aSel
.
nEndPara
=
0
;
{
// Set 'Andy' bold.
SfxItemSet
aItemSet
=
rEE
.
GetEmptyItemSet
();
aSel
.
nStartPos
=
0
;
aSel
.
nEndPos
=
4
;
SvxWeightItem
aWeight
(
WEIGHT_BOLD
,
EE_CHAR_WEIGHT
);
aItemSet
.
Put
(
aWeight
);
rEE
.
QuickSetAttribs
(
aItemSet
,
aSel
);
}
{
// Set 'Bruce' italic.
SfxItemSet
aItemSet
=
rEE
.
GetEmptyItemSet
();
SvxPostureItem
aItalic
(
ITALIC_NORMAL
,
EE_CHAR_ITALIC
);
aItemSet
.
Put
(
aItalic
);
aSel
.
nStartPos
=
9
;
aSel
.
nEndPos
=
14
;
rEE
.
QuickSetAttribs
(
aItemSet
,
aSel
);
}
m_pDoc
->
SetEditText
(
ScAddress
(
1
,
0
,
0
),
rEE
.
CreateTextObject
());
// B1
// These two should be equal.
nId1
=
m_pDoc
->
GetCellStringID
(
ScAddress
(
0
,
0
,
0
));
nId2
=
m_pDoc
->
GetCellStringID
(
ScAddress
(
1
,
0
,
0
));
CPPUNIT_ASSERT_MESSAGE
(
"Failed to get a valid string ID."
,
nId1
);
CPPUNIT_ASSERT_MESSAGE
(
"Failed to get a valid string ID."
,
nId2
);
CPPUNIT_ASSERT_EQUAL
(
nId1
,
nId2
);
rEE
.
SetText
(
"ANDY and BRUCE"
);
m_pDoc
->
SetEditText
(
ScAddress
(
2
,
0
,
0
),
rEE
.
CreateTextObject
());
// C1
nId2
=
m_pDoc
->
GetCellStringID
(
ScAddress
(
2
,
0
,
0
));
CPPUNIT_ASSERT_MESSAGE
(
"Failed to get a valid string ID."
,
nId2
);
CPPUNIT_ASSERT_MESSAGE
(
"These two should be different when cases are considered."
,
nId1
!=
nId2
);
// But they should be considered equal when cases are ignored.
nId1
=
m_pDoc
->
GetCellStringIDIgnoreCase
(
ScAddress
(
0
,
0
,
0
));
nId2
=
m_pDoc
->
GetCellStringIDIgnoreCase
(
ScAddress
(
2
,
0
,
0
));
CPPUNIT_ASSERT_MESSAGE
(
"Failed to get a valid string ID."
,
nId1
);
CPPUNIT_ASSERT_MESSAGE
(
"Failed to get a valid string ID."
,
nId2
);
CPPUNIT_ASSERT_EQUAL
(
nId1
,
nId2
);
m_pDoc
->
DeleteTab
(
0
);
m_pDoc
->
DeleteTab
(
0
);
}
}
...
...
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