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
915b7b5b
Kaydet (Commit)
915b7b5b
authored
Mar 28, 2014
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
rhbz#1080196: Write unit test for this.
Change-Id: I1c83afa40eaf8c81ca3b436c6fb7d22f7eb9f223
üst
37672f11
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
0 deletions
+50
-0
ucalc.cxx
sc/qa/unit/ucalc.cxx
+48
-0
ucalc.hxx
sc/qa/unit/ucalc.hxx
+2
-0
No files found.
sc/qa/unit/ucalc.cxx
Dosyayı görüntüle @
915b7b5b
...
@@ -3414,6 +3414,54 @@ void Test::testCopyPasteTranspose()
...
@@ -3414,6 +3414,54 @@ void Test::testCopyPasteTranspose()
}
}
void Test::testCopyPasteMultiRange()
{
m_pDoc->InsertTab(0, "Test");
// Fill A2:B6 with numbers.
for (SCROW nRow = 1; nRow <= 5; ++nRow)
{
for (SCCOL nCol = 0; nCol <= 1; ++nCol)
{
ScAddress aPos(nCol,nRow,0);
m_pDoc->SetValue(aPos, nRow+nCol);
}
}
// Fill D9:E11 with numbers.
for (SCROW nRow = 8; nRow <= 10; ++nRow)
{
for (SCCOL nCol = 3; nCol <= 4; ++nCol)
{
ScAddress aPos(nCol,nRow,0);
m_pDoc->SetValue(aPos, 10.0);
}
}
ScMarkData aMark;
aMark.SelectOneTable(0);
// Copy A2:B2, A4:B4, and A6:B6 to clipboard.
ScDocument aClipDoc(SCDOCMODE_CLIP);
ScClipParam aClipParam;
aClipParam.maRanges.Append(ScRange(0,1,0,1,1,0)); // A2:B2
aClipParam.maRanges.Append(ScRange(0,3,0,1,3,0)); // A4:B4
aClipParam.maRanges.Append(ScRange(0,5,0,1,5,0)); // A6:B6
aClipParam.meDirection = ScClipParam::Row;
m_pDoc->CopyToClip(aClipParam, &aClipDoc, &aMark);
// Paste to D9:E11, and make sure it won't crash (rhbz#1080196).
m_pDoc->CopyMultiRangeFromClip(ScAddress(3,8,0), aMark, IDF_CONTENTS, &aClipDoc);
CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(ScAddress(3,8,0)));
CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(ScAddress(4,8,0)));
CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(ScAddress(3,9,0)));
CPPUNIT_ASSERT_EQUAL(4.0, m_pDoc->GetValue(ScAddress(4,9,0)));
CPPUNIT_ASSERT_EQUAL(5.0, m_pDoc->GetValue(ScAddress(3,10,0)));
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(4,10,0)));
m_pDoc->DeleteTab(0);
}
void Test::testCopyPasteSkipEmpty()
void Test::testCopyPasteSkipEmpty()
{
{
struct Check
struct Check
...
...
sc/qa/unit/ucalc.hxx
Dosyayı görüntüle @
915b7b5b
...
@@ -255,6 +255,7 @@ public:
...
@@ -255,6 +255,7 @@ public:
void
testCopyPaste
();
void
testCopyPaste
();
void
testCopyPasteAsLink
();
void
testCopyPasteAsLink
();
void
testCopyPasteTranspose
();
void
testCopyPasteTranspose
();
void
testCopyPasteMultiRange
();
void
testCopyPasteSkipEmpty
();
void
testCopyPasteSkipEmpty
();
void
testCopyPasteSkipEmptyConditionalFormatting
();
void
testCopyPasteSkipEmptyConditionalFormatting
();
void
testUndoCut
();
void
testUndoCut
();
...
@@ -435,6 +436,7 @@ public:
...
@@ -435,6 +436,7 @@ public:
CPPUNIT_TEST
(
testCopyPaste
);
CPPUNIT_TEST
(
testCopyPaste
);
CPPUNIT_TEST
(
testCopyPasteAsLink
);
CPPUNIT_TEST
(
testCopyPasteAsLink
);
CPPUNIT_TEST
(
testCopyPasteTranspose
);
CPPUNIT_TEST
(
testCopyPasteTranspose
);
CPPUNIT_TEST
(
testCopyPasteMultiRange
);
CPPUNIT_TEST
(
testCopyPasteSkipEmpty
);
CPPUNIT_TEST
(
testCopyPasteSkipEmpty
);
//CPPUNIT_TEST(testCopyPasteSkipEmptyConditionalFormatting);
//CPPUNIT_TEST(testCopyPasteSkipEmptyConditionalFormatting);
CPPUNIT_TEST
(
testUndoCut
);
CPPUNIT_TEST
(
testUndoCut
);
...
...
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