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
6a816d1f
Kaydet (Commit)
6a816d1f
authored
Tem 30, 2014
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#81330: Write test for this.
Change-Id: Id781b13b180c0622bfb01cf2ca844fa452061b50
üst
52d21ee6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
+44
-0
ucalc.cxx
sc/qa/unit/ucalc.cxx
+42
-0
ucalc.hxx
sc/qa/unit/ucalc.hxx
+2
-0
No files found.
sc/qa/unit/ucalc.cxx
Dosyayı görüntüle @
6a816d1f
...
@@ -3942,6 +3942,48 @@ void Test::testCutPasteRefUndo()
...
@@ -3942,6 +3942,48 @@ void Test::testCutPasteRefUndo()
m_pDoc->DeleteTab(0);
m_pDoc->DeleteTab(0);
}
}
void Test::testMoveRefBetweenSheets()
{
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
m_pDoc->InsertTab(0, "Test1");
m_pDoc->InsertTab(1, "Test2");
m_pDoc->SetValue(ScAddress(0,0,0), 12.0);
m_pDoc->SetValue(ScAddress(1,0,0), 10.0);
m_pDoc->SetValue(ScAddress(2,0,0), 8.0);
m_pDoc->SetString(ScAddress(0,1,0), "=A1");
m_pDoc->SetString(ScAddress(0,2,0), "=SUM(A1:C1)");
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(ScAddress(0,0,0)));
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(ScAddress(0,1,0)));
CPPUNIT_ASSERT_EQUAL(30.0, m_pDoc->GetValue(ScAddress(0,2,0)));
// These formulas should not display the sheet name.
if (!checkFormula(*m_pDoc, ScAddress(0,1,0), "A1"))
CPPUNIT_FAIL("Wrong formula!");
if (!checkFormula(*m_pDoc, ScAddress(0,2,0), "SUM(A1:C1)"))
CPPUNIT_FAIL("Wrong formula!");
// Move Test1.A2:A3 to Test2.A2:A3.
ScDocFunc& rFunc = getDocShell().GetDocFunc();
bool bMoved = rFunc.MoveBlock(ScRange(0,1,0,0,2,0), ScAddress(0,1,1), true, true, false, true);
CPPUNIT_ASSERT(bMoved);
CPPUNIT_ASSERT_MESSAGE("This cell should be empty after the move.", m_pDoc->GetCellType(ScAddress(0,1,0)) == CELLTYPE_NONE);
CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(ScAddress(0,1,1)));
CPPUNIT_ASSERT_EQUAL(30.0, m_pDoc->GetValue(ScAddress(0,2,1)));
// The reference in the pasted formula should display sheet name after the move.
if (!checkFormula(*m_pDoc, ScAddress(0,1,1), "Test1.A1"))
CPPUNIT_FAIL("Wrong formula!");
if (!checkFormula(*m_pDoc, ScAddress(0,2,1), "SUM(Test1.A1:C1)"))
CPPUNIT_FAIL("Wrong formula!");
m_pDoc->DeleteTab(1);
m_pDoc->DeleteTab(0);
}
void Test::testUndoCut()
void Test::testUndoCut()
{
{
m_pDoc->InsertTab(0, "Test");
m_pDoc->InsertTab(0, "Test");
...
...
sc/qa/unit/ucalc.hxx
Dosyayı görüntüle @
6a816d1f
...
@@ -280,6 +280,7 @@ public:
...
@@ -280,6 +280,7 @@ public:
void
testCopyPasteSkipEmpty2
();
void
testCopyPasteSkipEmpty2
();
void
testCopyPasteSkipEmptyConditionalFormatting
();
void
testCopyPasteSkipEmptyConditionalFormatting
();
void
testCutPasteRefUndo
();
void
testCutPasteRefUndo
();
void
testMoveRefBetweenSheets
();
void
testUndoCut
();
void
testUndoCut
();
void
testMoveBlock
();
void
testMoveBlock
();
void
testCopyPasteRelativeFormula
();
void
testCopyPasteRelativeFormula
();
...
@@ -487,6 +488,7 @@ public:
...
@@ -487,6 +488,7 @@ public:
CPPUNIT_TEST
(
testCopyPasteSkipEmpty2
);
CPPUNIT_TEST
(
testCopyPasteSkipEmpty2
);
//CPPUNIT_TEST(testCopyPasteSkipEmptyConditionalFormatting);
//CPPUNIT_TEST(testCopyPasteSkipEmptyConditionalFormatting);
CPPUNIT_TEST
(
testCutPasteRefUndo
);
CPPUNIT_TEST
(
testCutPasteRefUndo
);
CPPUNIT_TEST
(
testMoveRefBetweenSheets
);
CPPUNIT_TEST
(
testUndoCut
);
CPPUNIT_TEST
(
testUndoCut
);
CPPUNIT_TEST
(
testMoveBlock
);
CPPUNIT_TEST
(
testMoveBlock
);
CPPUNIT_TEST
(
testCopyPasteRelativeFormula
);
CPPUNIT_TEST
(
testCopyPasteRelativeFormula
);
...
...
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