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
621a7689
Kaydet (Commit)
621a7689
authored
Haz 29, 2015
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
insert/shift unit test for tdf#44419
Change-Id: If056bd05ca8895ad301a45bb078d303b56cd172a
üst
a482d328
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
ucalc_formula.cxx
sc/qa/unit/ucalc_formula.cxx
+39
-0
No files found.
sc/qa/unit/ucalc_formula.cxx
Dosyayı görüntüle @
621a7689
...
...
@@ -1747,6 +1747,14 @@ void Test::testFormulaRefUpdateInsertColumns()
bool
bInserted
=
m_pDoc
->
InsertNewRangeName
(
"RowRelativeRange"
,
aNamePos
,
"$Formula.$B2"
);
CPPUNIT_ASSERT
(
bInserted
);
// Set named range for entire absolute column B.
bInserted
=
m_pDoc
->
InsertNewRangeName
(
"EntireColumn"
,
aNamePos
,
"$B:$B"
);
CPPUNIT_ASSERT
(
bInserted
);
// Set named range for entire absolute row 2.
bInserted
=
m_pDoc
->
InsertNewRangeName
(
"EntireRow"
,
aNamePos
,
"$2:$2"
);
CPPUNIT_ASSERT
(
bInserted
);
// Set values in B1:B3.
m_pDoc
->
SetValue
(
ScAddress
(
1
,
0
,
0
),
1.0
);
m_pDoc
->
SetValue
(
ScAddress
(
1
,
1
,
0
),
2.0
);
...
...
@@ -1760,6 +1768,14 @@ void Test::testFormulaRefUpdateInsertColumns()
m_pDoc
->
SetString
(
ScAddress
(
2
,
1
,
0
),
"=RowRelativeRange"
);
CPPUNIT_ASSERT_EQUAL
(
2.0
,
m_pDoc
->
GetValue
(
ScAddress
(
2
,
1
,
0
)));
// Use named range in C3 to reference column B, values in B1,B2,B3,B4
m_pDoc
->
SetString
(
ScAddress
(
2
,
2
,
0
),
"=SUM(EntireColumn)"
);
CPPUNIT_ASSERT_EQUAL
(
12.0
,
m_pDoc
->
GetValue
(
ScAddress
(
2
,
2
,
0
)));
// Use named range in C4 to reference row 2, values in B2 and C2.
m_pDoc
->
SetString
(
ScAddress
(
2
,
3
,
0
),
"=SUM(EntireRow)"
);
CPPUNIT_ASSERT_EQUAL
(
4.0
,
m_pDoc
->
GetValue
(
ScAddress
(
2
,
3
,
0
)));
// Inert columns over A:B.
ScMarkData
aMark
;
aMark
.
SelectOneTable
(
0
);
...
...
@@ -1784,6 +1800,29 @@ void Test::testFormulaRefUpdateInsertColumns()
CPPUNIT_FAIL
(
"Wrong formula in E2 after column insertion."
);
CPPUNIT_ASSERT_EQUAL
(
2.0
,
m_pDoc
->
GetValue
(
ScAddress
(
4
,
1
,
0
)));
// Check that the named column reference points to the moved column, now D.
pName
=
m_pDoc
->
GetRangeName
()
->
findByUpperName
(
"ENTIRECOLUMN"
);
CPPUNIT_ASSERT
(
pName
);
pName
->
GetSymbol
(
aSymbol
,
aNamePos
,
formula
::
FormulaGrammar
::
GRAM_ENGLISH
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"$D:$D"
),
aSymbol
);
// Check that the formula using the name, now in E3, still has the same result.
if
(
!
checkFormula
(
*
m_pDoc
,
ScAddress
(
4
,
2
,
0
),
"SUM(EntireColumn)"
))
CPPUNIT_FAIL
(
"Wrong formula in E3 after column insertion."
);
CPPUNIT_ASSERT_EQUAL
(
12.0
,
m_pDoc
->
GetValue
(
ScAddress
(
4
,
2
,
0
)));
// Check that the named row reference still points to the same entire row
// and does not have a #REF! error due to inserted columns.
pName
=
m_pDoc
->
GetRangeName
()
->
findByUpperName
(
"ENTIREROW"
);
CPPUNIT_ASSERT
(
pName
);
pName
->
GetSymbol
(
aSymbol
,
aNamePos
,
formula
::
FormulaGrammar
::
GRAM_ENGLISH
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"$2:$2"
),
aSymbol
);
// Check that the formula using the name, now in E4, still has the same result.
if
(
!
checkFormula
(
*
m_pDoc
,
ScAddress
(
4
,
3
,
0
),
"SUM(EntireRow)"
))
CPPUNIT_FAIL
(
"Wrong formula in E4 after column insertion."
);
CPPUNIT_ASSERT_EQUAL
(
4.0
,
m_pDoc
->
GetValue
(
ScAddress
(
4
,
3
,
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