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
3d7976b1
Kaydet (Commit)
3d7976b1
authored
Tem 19, 2013
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add test for no reference error on reference deletion.
Change-Id: I3e6fd2b41c3bbf0ee12769a507fbf484f9ba833b
üst
673ea63d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
ucalc_formula.cxx
sc/qa/unit/ucalc_formula.cxx
+28
-0
No files found.
sc/qa/unit/ucalc_formula.cxx
Dosyayı görüntüle @
3d7976b1
...
@@ -306,9 +306,25 @@ void Test::testFormulaRefUpdate()
...
@@ -306,9 +306,25 @@ void Test::testFormulaRefUpdate()
if
(
!
checkFormula
(
*
m_pDoc
,
aPos
,
"$A$1"
))
if
(
!
checkFormula
(
*
m_pDoc
,
aPos
,
"$A$1"
))
CPPUNIT_FAIL
(
"Wrong formula in C4."
);
CPPUNIT_FAIL
(
"Wrong formula in C4."
);
// Delete row 1 which will delete the value cell (A1).
m_pDoc
->
DeleteRow
(
ScRange
(
0
,
0
,
0
,
MAXCOL
,
0
,
0
));
aPos
=
ScAddress
(
2
,
1
,
0
);
ScFormulaCell
*
pFC
=
m_pDoc
->
GetFormulaCell
(
aPos
);
CPPUNIT_ASSERT_MESSAGE
(
"This should be a formula cell."
,
pFC
);
CPPUNIT_ASSERT_EQUAL
(
ScErrorCodes
::
errNoRef
,
pFC
->
GetErrCode
());
aPos
=
ScAddress
(
2
,
2
,
0
);
pFC
=
m_pDoc
->
GetFormulaCell
(
aPos
);
CPPUNIT_ASSERT_MESSAGE
(
"This should be a formula cell."
,
pFC
);
CPPUNIT_ASSERT_EQUAL
(
ScErrorCodes
::
errNoRef
,
pFC
->
GetErrCode
());
// Clear all and start over.
// Clear all and start over.
clearRange
(
m_pDoc
,
ScRange
(
0
,
0
,
0
,
10
,
10
,
0
));
clearRange
(
m_pDoc
,
ScRange
(
0
,
0
,
0
,
10
,
10
,
0
));
// ------------------------------------------
// Test range updates
// ------------------------------------------
// Fill B2:C3 with values.
// Fill B2:C3 with values.
m_pDoc
->
SetValue
(
ScAddress
(
1
,
1
,
0
),
1
);
m_pDoc
->
SetValue
(
ScAddress
(
1
,
1
,
0
),
1
);
m_pDoc
->
SetValue
(
ScAddress
(
1
,
2
,
0
),
2
);
m_pDoc
->
SetValue
(
ScAddress
(
1
,
2
,
0
),
2
);
...
@@ -410,6 +426,18 @@ void Test::testFormulaRefUpdate()
...
@@ -410,6 +426,18 @@ void Test::testFormulaRefUpdate()
CPPUNIT_ASSERT_EQUAL
(
10.0
,
m_pDoc
->
GetValue
(
ScAddress
(
0
,
5
,
0
)));
CPPUNIT_ASSERT_EQUAL
(
10.0
,
m_pDoc
->
GetValue
(
ScAddress
(
0
,
5
,
0
)));
CPPUNIT_ASSERT_EQUAL
(
10.0
,
m_pDoc
->
GetValue
(
ScAddress
(
0
,
6
,
0
)));
CPPUNIT_ASSERT_EQUAL
(
10.0
,
m_pDoc
->
GetValue
(
ScAddress
(
0
,
6
,
0
)));
// Delete rows 2:3 to completely remove the referenced range.
m_pDoc
->
DeleteRow
(
ScRange
(
0
,
1
,
0
,
MAXCOL
,
2
,
0
));
// Both A4 and A5 should show #REF! errors.
pFC
=
m_pDoc
->
GetFormulaCell
(
ScAddress
(
0
,
3
,
0
));
CPPUNIT_ASSERT_MESSAGE
(
"This should be a formula cell."
,
pFC
);
CPPUNIT_ASSERT_EQUAL
(
ScErrorCodes
::
errNoRef
,
pFC
->
GetErrCode
());
pFC
=
m_pDoc
->
GetFormulaCell
(
ScAddress
(
0
,
4
,
0
));
CPPUNIT_ASSERT_MESSAGE
(
"This should be a formula cell."
,
pFC
);
CPPUNIT_ASSERT_EQUAL
(
ScErrorCodes
::
errNoRef
,
pFC
->
GetErrCode
());
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