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
f0cce530
Kaydet (Commit)
f0cce530
authored
Mar 24, 2016
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
unit test for copying global names to sheet-local names, tdf#75372
Change-Id: Ice179cfcbb81b6455648d67e6f8aec516f7c8576
üst
d2c1bc03
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
ucalc_formula.cxx
sc/qa/unit/ucalc_formula.cxx
+38
-0
No files found.
sc/qa/unit/ucalc_formula.cxx
Dosyayı görüntüle @
f0cce530
...
...
@@ -3143,6 +3143,44 @@ void Test::testFormulaRefUpdateNameCopySheet()
nVal = m_pDoc->GetValue(2, 2, 0);
CPPUNIT_ASSERT_EQUAL(5.0, nVal);
m_pDoc->DeleteTab(2);
m_pDoc->DeleteTab(1);
m_pDoc->DeleteTab(0);
m_pDoc->InsertTab(0, "Test1");
// Global name referencing sheet Test1.
bInserted = m_pDoc->InsertNewRangeName("sheetnumber", ScAddress(0,0,0), "$Test1.$A$1");
CPPUNIT_ASSERT(bInserted);
m_pDoc->SetString(ScAddress(0,0,0), "=SHEET()");
m_pDoc->SetString(ScAddress(1,0,0), "=sheetnumber");
nVal = m_pDoc->GetValue(1,0,0);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Sheet number should be 1", 1.0, nVal);
// Copy sheet after.
m_pDoc->CopyTab(0, 1);
nVal = m_pDoc->GetValue(1,0,1);
CPPUNIT_ASSERT_EQUAL_MESSAGE("New sheet number should be 2", 2.0, nVal);
nVal = m_pDoc->GetValue(1,0,0);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Org sheet number should be 1", 1.0, nVal);
const ScRangeData* pName = m_pDoc->GetRangeName(1)->findByUpperName("SHEETNUMBER");
CPPUNIT_ASSERT_MESSAGE("New sheet-local name should exist", pName);
// Copy sheet before, shifting following now two sheets.
m_pDoc->CopyTab(0, 0);
nVal = m_pDoc->GetValue(1,0,0);
CPPUNIT_ASSERT_EQUAL_MESSAGE("New sheet number should be 1", 1.0, nVal);
pName = m_pDoc->GetRangeName(0)->findByUpperName("SHEETNUMBER");
CPPUNIT_ASSERT_MESSAGE("New sheet-local name should exist", pName);
nVal = m_pDoc->GetValue(1,0,1);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Org sheet number should be 2", 2.0, nVal);
pName = m_pDoc->GetRangeName(1)->findByUpperName("SHEETNUMBER");
CPPUNIT_ASSERT_MESSAGE("Org sheet-local name should not exist", !pName);
nVal = m_pDoc->GetValue(1,0,2);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Old sheet number should be 3", 3.0, nVal);
pName = m_pDoc->GetRangeName(2)->findByUpperName("SHEETNUMBER");
CPPUNIT_ASSERT_MESSAGE("Old sheet-local name should exist", pName);
m_pDoc->DeleteTab(2);
m_pDoc->DeleteTab(1);
m_pDoc->DeleteTab(0);
}
...
...
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