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
2873d758
Kaydet (Commit)
2873d758
authored
Tem 07, 2015
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
unit test for copy&paste put reference in order, tdf#92468
Change-Id: I69b2f294011498097372a1a46991e1ca8b6721c1
üst
22935ed0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
ucalc.cxx
sc/qa/unit/ucalc.cxx
+39
-0
ucalc.hxx
sc/qa/unit/ucalc.hxx
+2
-0
No files found.
sc/qa/unit/ucalc.cxx
Dosyayı görüntüle @
2873d758
...
...
@@ -4145,6 +4145,45 @@ void Test::testCopyPasteRepeatOneFormula()
m_pDoc->DeleteTab(0);
}
void Test::testCopyPasteMixedReferenceFormula()
{
sc::AutoCalcSwitch aAC(*m_pDoc, true); // turn on auto calc.
m_pDoc->InsertTab(0, "Test");
// Insert value to C3
m_pDoc->SetValue(2,2,0, 1.0);
// Insert formula to A1 with mixed relative/absolute addressing.
m_pDoc->SetString(0,0,0, "=SUM(B:$C)");
if (!checkFormula(*m_pDoc, ScAddress(0,0,0), "SUM(B:$C)"))
CPPUNIT_FAIL("Wrong formula.");
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(0,0,0));
// Copy formula in A1 to clipboard.
ScRange aRange(ScAddress(0,0,0));
ScDocument aClipDoc(SCDOCMODE_CLIP);
copyToClip(m_pDoc, aRange, &aClipDoc);
// Paste formula to B1.
aRange = ScAddress(1,0,0);
pasteFromClip(m_pDoc, aRange, &aClipDoc);
if (!checkFormula(*m_pDoc, ScAddress(1,0,0), "SUM(C:$C)"))
CPPUNIT_FAIL("Wrong formula.");
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(0,0,0));
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(1,0,0));
// Paste formula to C1. All three results now must be circular reference.
aRange = ScAddress(2,0,0);
pasteFromClip(m_pDoc, aRange, &aClipDoc);
if (!checkFormula(*m_pDoc, ScAddress(2,0,0), "SUM($C:D)")) // reference put in order
CPPUNIT_FAIL("Wrong formula.");
CPPUNIT_ASSERT_EQUAL(OUString("Err:522"), m_pDoc->GetString(0,0,0));
CPPUNIT_ASSERT_EQUAL(OUString("Err:522"), m_pDoc->GetString(1,0,0));
CPPUNIT_ASSERT_EQUAL(OUString("Err:522"), m_pDoc->GetString(2,0,0));
m_pDoc->DeleteTab(0);
}
void Test::testMergedCells()
{
//test merge and unmerge
...
...
sc/qa/unit/ucalc.hxx
Dosyayı görüntüle @
2873d758
...
...
@@ -316,6 +316,7 @@ public:
void
testMoveBlock
();
void
testCopyPasteRelativeFormula
();
void
testCopyPasteRepeatOneFormula
();
void
testCopyPasteMixedReferenceFormula
();
void
testMergedCells
();
void
testUpdateReference
();
void
testSearchCells
();
...
...
@@ -570,6 +571,7 @@ public:
CPPUNIT_TEST
(
testMoveBlock
);
CPPUNIT_TEST
(
testCopyPasteRelativeFormula
);
CPPUNIT_TEST
(
testCopyPasteRepeatOneFormula
);
CPPUNIT_TEST
(
testCopyPasteMixedReferenceFormula
);
CPPUNIT_TEST
(
testMergedCells
);
CPPUNIT_TEST
(
testUpdateReference
);
CPPUNIT_TEST
(
testSearchCells
);
...
...
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