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
8cd60590
Kaydet (Commit)
8cd60590
authored
Eki 03, 2014
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Another test case for this feature.
Change-Id: Ia406baec2867605bf515dac0ba090500e2bbd1ce
üst
1b1e50cc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
0 deletions
+77
-0
ucalc.cxx
sc/qa/unit/ucalc.cxx
+75
-0
ucalc.hxx
sc/qa/unit/ucalc.hxx
+2
-0
No files found.
sc/qa/unit/ucalc.cxx
Dosyayı görüntüle @
8cd60590
...
...
@@ -6124,6 +6124,81 @@ void Test::testFormulaToValue()
m_pDoc
->
DeleteTab
(
0
);
}
void
Test
::
testFormulaToValue2
()
{
sc
::
AutoCalcSwitch
aACSwitch
(
*
m_pDoc
,
true
);
FormulaGrammarSwitch
aFGSwitch
(
m_pDoc
,
formula
::
FormulaGrammar
::
GRAM_ENGLISH_XL_R1C1
);
m_pDoc
->
InsertTab
(
0
,
"Test"
);
const
char
*
aData
[][
2
]
=
{
{
"=1"
,
"=ISFORMULA(RC[-1])"
},
{
"=2"
,
"=ISFORMULA(RC[-1])"
},
{
"3"
,
"=ISFORMULA(RC[-1])"
},
{
"=4"
,
"=ISFORMULA(RC[-1])"
},
{
"=5"
,
"=ISFORMULA(RC[-1])"
},
};
// Insert data into B2:C6.
ScAddress
aPos
(
1
,
1
,
0
);
// B2
ScRange
aDataRange
=
insertRangeData
(
m_pDoc
,
aPos
,
aData
,
SAL_N_ELEMENTS
(
aData
));
CPPUNIT_ASSERT_MESSAGE
(
"failed to insert range data at correct position"
,
aDataRange
.
aStart
==
aPos
);
{
// Expected output table content. 0 = empty cell
const
char
*
aOutputCheck
[][
2
]
=
{
{
"1"
,
"TRUE"
},
{
"2"
,
"TRUE"
},
{
"3"
,
"FALSE"
},
{
"4"
,
"TRUE"
},
{
"5"
,
"TRUE"
},
};
bool
bSuccess
=
checkOutput
<
2
>
(
m_pDoc
,
aDataRange
,
aOutputCheck
,
"Initial value"
);
CPPUNIT_ASSERT_MESSAGE
(
"Table output check failed"
,
bSuccess
);
}
// Convert B3:B5 to a value.
ScDocFunc
&
rFunc
=
getDocShell
().
GetDocFunc
();
ScRange
aConvRange
(
1
,
2
,
0
,
1
,
4
,
0
);
// B3:B5
rFunc
.
ConvertFormulaToValue
(
aConvRange
,
true
,
false
);
{
// Expected output table content. 0 = empty cell
const
char
*
aOutputCheck
[][
2
]
=
{
{
"1"
,
"TRUE"
},
{
"2"
,
"FALSE"
},
{
"3"
,
"FALSE"
},
{
"4"
,
"FALSE"
},
{
"5"
,
"TRUE"
},
};
bool
bSuccess
=
checkOutput
<
2
>
(
m_pDoc
,
aDataRange
,
aOutputCheck
,
"Initial value"
);
CPPUNIT_ASSERT_MESSAGE
(
"Table output check failed"
,
bSuccess
);
}
// Undo and check.
SfxUndoManager
*
pUndoMgr
=
m_pDoc
->
GetUndoManager
();
CPPUNIT_ASSERT
(
pUndoMgr
);
pUndoMgr
->
Undo
();
{
// Expected output table content. 0 = empty cell
const
char
*
aOutputCheck
[][
2
]
=
{
{
"1"
,
"TRUE"
},
{
"2"
,
"TRUE"
},
{
"3"
,
"FALSE"
},
{
"4"
,
"TRUE"
},
{
"5"
,
"TRUE"
},
};
bool
bSuccess
=
checkOutput
<
2
>
(
m_pDoc
,
aDataRange
,
aOutputCheck
,
"Initial value"
);
CPPUNIT_ASSERT_MESSAGE
(
"Table output check failed"
,
bSuccess
);
}
m_pDoc
->
DeleteTab
(
0
);
}
void
Test
::
testMixData
()
{
m_pDoc
->
InsertTab
(
0
,
"Test"
);
...
...
sc/qa/unit/ucalc.hxx
Dosyayı görüntüle @
8cd60590
...
...
@@ -388,6 +388,7 @@ public:
void
testTransliterateText
();
void
testFormulaToValue
();
void
testFormulaToValue2
();
void
testColumnFindEditCells
();
...
...
@@ -572,6 +573,7 @@ public:
CPPUNIT_TEST
(
testDeleteContents
);
CPPUNIT_TEST
(
testTransliterateText
);
CPPUNIT_TEST
(
testFormulaToValue
);
CPPUNIT_TEST
(
testFormulaToValue2
);
CPPUNIT_TEST
(
testColumnFindEditCells
);
CPPUNIT_TEST_SUITE_END
();
...
...
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