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
60b187c7
Kaydet (Commit)
60b187c7
authored
Ock 15, 2014
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
unit test for shared formula row deletion, fdo#72293
Change-Id: I11d3ce087dd0c81c4ff2372bb72f3f6ec7be20e5
üst
42f551d5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
0 deletions
+76
-0
ucalc.hxx
sc/qa/unit/ucalc.hxx
+2
-0
ucalc_sharedformula.cxx
sc/qa/unit/ucalc_sharedformula.cxx
+74
-0
No files found.
sc/qa/unit/ucalc.hxx
Dosyayı görüntüle @
60b187c7
...
...
@@ -245,6 +245,7 @@ public:
void
testSharedFormulas
();
void
testSharedFormulasRefUpdate
();
void
testSharedFormulasRefUpdateRange
();
void
testSharedFormulasDeleteRows
();
void
testSharedFormulasCopyPaste
();
void
testFormulaPosition
();
...
...
@@ -394,6 +395,7 @@ public:
CPPUNIT_TEST
(
testSharedFormulas
);
CPPUNIT_TEST
(
testSharedFormulasRefUpdate
);
CPPUNIT_TEST
(
testSharedFormulasRefUpdateRange
);
CPPUNIT_TEST
(
testSharedFormulasDeleteRows
);
CPPUNIT_TEST
(
testSharedFormulasCopyPaste
);
CPPUNIT_TEST
(
testFormulaPosition
);
CPPUNIT_TEST
(
testJumpToPrecedentsDependents
);
...
...
sc/qa/unit/ucalc_sharedformula.cxx
Dosyayı görüntüle @
60b187c7
...
...
@@ -445,6 +445,80 @@ void Test::testSharedFormulasRefUpdateRange()
m_pDoc
->
DeleteTab
(
0
);
}
void
Test
::
testSharedFormulasDeleteRows
()
{
m_pDoc
->
InsertTab
(
0
,
"Test"
);
FormulaGrammarSwitch
aFGSwitch
(
m_pDoc
,
formula
::
FormulaGrammar
::
GRAM_ENGLISH_XL_R1C1
);
// Fill data cells A1:A10 and formula cells B1:B10
for
(
SCROW
i
=
0
;
i
<=
9
;
++
i
)
{
m_pDoc
->
SetValue
(
0
,
i
,
0
,
i
);
m_pDoc
->
SetString
(
1
,
i
,
0
,
"=RC[-1]+1"
);
}
// Fill data cells A11:A20 and formula cells B11:B20 with a different formula.
for
(
SCROW
i
=
10
;
i
<=
19
;
++
i
)
{
m_pDoc
->
SetValue
(
0
,
i
,
0
,
i
);
m_pDoc
->
SetString
(
1
,
i
,
0
,
"=RC[-1]+11"
);
}
// B1:B10 should be shared.
const
ScFormulaCell
*
pFC
=
m_pDoc
->
GetFormulaCell
(
ScAddress
(
1
,
0
,
0
));
CPPUNIT_ASSERT_MESSAGE
(
"1,0 must be a shared formula cell."
,
pFC
&&
pFC
->
IsShared
());
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
SCROW
>
(
0
),
pFC
->
GetSharedTopRow
());
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
SCROW
>
(
10
),
pFC
->
GetSharedLength
());
// B11:B20 should be shared.
pFC
=
m_pDoc
->
GetFormulaCell
(
ScAddress
(
1
,
10
,
0
));
CPPUNIT_ASSERT_MESSAGE
(
"1,10 must be a shared formula cell."
,
pFC
&&
pFC
->
IsShared
());
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
SCROW
>
(
10
),
pFC
->
GetSharedTopRow
());
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
SCROW
>
(
10
),
pFC
->
GetSharedLength
());
// Delete rows 9:12
m_pDoc
->
DeleteRow
(
ScRange
(
0
,
8
,
0
,
MAXCOL
,
11
,
0
));
// B1:B8 should be shared.
pFC
=
m_pDoc
->
GetFormulaCell
(
ScAddress
(
1
,
0
,
0
));
CPPUNIT_ASSERT_MESSAGE
(
"1,0 must be a shared formula cell."
,
pFC
&&
pFC
->
IsShared
());
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
SCROW
>
(
0
),
pFC
->
GetSharedTopRow
());
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
SCROW
>
(
8
),
pFC
->
GetSharedLength
());
// B9:B16 should be shared.
pFC
=
m_pDoc
->
GetFormulaCell
(
ScAddress
(
1
,
8
,
0
));
CPPUNIT_ASSERT_MESSAGE
(
"1,8 must be a shared formula cell."
,
pFC
&&
pFC
->
IsShared
());
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
SCROW
>
(
8
),
pFC
->
GetSharedTopRow
());
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
SCROW
>
(
8
),
pFC
->
GetSharedLength
());
// Delete row 3
m_pDoc
->
DeleteRow
(
ScRange
(
0
,
2
,
0
,
MAXCOL
,
2
,
0
));
// B1:B7 should be shared.
pFC
=
m_pDoc
->
GetFormulaCell
(
ScAddress
(
1
,
0
,
0
));
CPPUNIT_ASSERT_MESSAGE
(
"1,0 must be a shared formula cell."
,
pFC
&&
pFC
->
IsShared
());
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
SCROW
>
(
0
),
pFC
->
GetSharedTopRow
());
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
SCROW
>
(
7
),
pFC
->
GetSharedLength
());
// B8:B15 should be shared.
pFC
=
m_pDoc
->
GetFormulaCell
(
ScAddress
(
1
,
7
,
0
));
CPPUNIT_ASSERT_MESSAGE
(
"1,7 must be a shared formula cell."
,
pFC
&&
pFC
->
IsShared
());
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
SCROW
>
(
7
),
pFC
->
GetSharedTopRow
());
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
SCROW
>
(
8
),
pFC
->
GetSharedLength
());
// Delete row 5
m_pDoc
->
DeleteRow
(
ScRange
(
0
,
4
,
0
,
MAXCOL
,
4
,
0
));
// B1:B6 should be shared.
pFC
=
m_pDoc
->
GetFormulaCell
(
ScAddress
(
1
,
0
,
0
));
CPPUNIT_ASSERT_MESSAGE
(
"1,0 must be a shared formula cell."
,
pFC
&&
pFC
->
IsShared
());
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
SCROW
>
(
0
),
pFC
->
GetSharedTopRow
());
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
SCROW
>
(
6
),
pFC
->
GetSharedLength
());
// B7:B14 should be shared.
pFC
=
m_pDoc
->
GetFormulaCell
(
ScAddress
(
1
,
6
,
0
));
CPPUNIT_ASSERT_MESSAGE
(
"1,6 must be a shared formula cell."
,
pFC
&&
pFC
->
IsShared
());
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
SCROW
>
(
6
),
pFC
->
GetSharedTopRow
());
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
SCROW
>
(
8
),
pFC
->
GetSharedLength
());
m_pDoc
->
DeleteTab
(
0
);
}
void
Test
::
testSharedFormulasCopyPaste
()
{
m_pDoc
->
InsertTab
(
0
,
"Test"
);
...
...
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