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
2d4a9312
Kaydet (Commit)
2d4a9312
authored
Haz 16, 2015
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
unit test for tdf#91411
Change-Id: I963674ad6c6a4ca95f1a65041f7ced64d7d86a43
üst
a6c07d2c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
0 deletions
+46
-0
ucalc.hxx
sc/qa/unit/ucalc.hxx
+2
-0
ucalc_sharedformula.cxx
sc/qa/unit/ucalc_sharedformula.cxx
+44
-0
No files found.
sc/qa/unit/ucalc.hxx
Dosyayı görüntüle @
2d4a9312
...
...
@@ -337,6 +337,7 @@ public:
void
testSharedFormulaUpdateOnDBChange
();
void
testSharedFormulaAbsCellListener
();
void
testSharedFormulaUnshareAreaListeners
();
void
testSharedFormulaListenerDeleteArea
();
void
testFormulaPosition
();
void
testMixData
();
...
...
@@ -586,6 +587,7 @@ public:
CPPUNIT_TEST
(
testSharedFormulaUpdateOnDBChange
);
CPPUNIT_TEST
(
testSharedFormulaAbsCellListener
);
CPPUNIT_TEST
(
testSharedFormulaUnshareAreaListeners
);
CPPUNIT_TEST
(
testSharedFormulaListenerDeleteArea
);
CPPUNIT_TEST
(
testFormulaPosition
);
CPPUNIT_TEST
(
testMixData
);
CPPUNIT_TEST
(
testJumpToPrecedentsDependents
);
...
...
sc/qa/unit/ucalc_sharedformula.cxx
Dosyayı görüntüle @
2d4a9312
...
...
@@ -1733,4 +1733,48 @@ void Test::testSharedFormulaUnshareAreaListeners()
m_pDoc
->
DeleteTab
(
0
);
}
void
Test
::
testSharedFormulaListenerDeleteArea
()
{
sc
::
AutoCalcSwitch
aACSwitch
(
*
m_pDoc
,
true
);
// turn on auto calc.
m_pDoc
->
InsertTab
(
0
,
"Test0"
);
m_pDoc
->
InsertTab
(
1
,
"Test1"
);
const
char
*
pData0
[][
3
]
=
{
{
""
,
""
,
"=Test1.C1"
},
{
""
,
""
,
"=Test1.C2"
}
};
const
char
*
pData1
[][
3
]
=
{
{
"=Test0.A1"
,
"=Test0.B1"
,
"=SUM(A1:B1)"
},
{
"=Test0.A2"
,
"=Test0.B2"
,
"=SUM(A2:B2)"
},
};
insertRangeData
(
m_pDoc
,
ScAddress
(
0
,
0
,
0
),
pData0
,
SAL_N_ELEMENTS
(
pData0
));
insertRangeData
(
m_pDoc
,
ScAddress
(
0
,
0
,
1
),
pData1
,
SAL_N_ELEMENTS
(
pData1
));
// Check that Test1.A1:A2 and Test1.B1:B2 are formula groups.
const
ScFormulaCell
*
pFC
=
m_pDoc
->
GetFormulaCell
(
ScAddress
(
0
,
0
,
1
));
CPPUNIT_ASSERT
(
pFC
);
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
SCROW
>
(
0
),
pFC
->
GetSharedTopRow
());
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
SCROW
>
(
2
),
pFC
->
GetSharedLength
());
pFC
=
m_pDoc
->
GetFormulaCell
(
ScAddress
(
1
,
0
,
1
));
CPPUNIT_ASSERT
(
pFC
);
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
SCROW
>
(
0
),
pFC
->
GetSharedTopRow
());
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
SCROW
>
(
2
),
pFC
->
GetSharedLength
());
m_pDoc
->
SetValue
(
ScAddress
(
0
,
1
,
0
),
1.0
);
// change value of Test0.A2
m_pDoc
->
SetValue
(
ScAddress
(
1
,
1
,
0
),
2.0
);
// change value of Test0.B2
// Test0.C2 should be recalculated.
CPPUNIT_ASSERT_EQUAL
(
3.0
,
m_pDoc
->
GetValue
(
ScAddress
(
2
,
1
,
0
)));
// Delete Test0.B2
clearRange
(
m_pDoc
,
ScRange
(
1
,
1
,
0
));
// Test0.C2 should be recalculated.
CPPUNIT_ASSERT_EQUAL
(
1.0
,
m_pDoc
->
GetValue
(
ScAddress
(
2
,
1
,
0
)));
m_pDoc
->
DeleteTab
(
1
);
m_pDoc
->
DeleteTab
(
0
);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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