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
71cd1ca5
Kaydet (Commit)
71cd1ca5
authored
May 09, 2014
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#77379: Write test for this.
Change-Id: Iccc0b499abae90f5b780aebab17ff6315b5690ec
üst
49752842
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
0 deletions
+57
-0
ucalc.cxx
sc/qa/unit/ucalc.cxx
+55
-0
ucalc.hxx
sc/qa/unit/ucalc.hxx
+2
-0
No files found.
sc/qa/unit/ucalc.cxx
Dosyayı görüntüle @
71cd1ca5
...
...
@@ -5400,6 +5400,61 @@ void Test::testNoteLifeCycle()
m_pDoc->DeleteTab(0);
}
void Test::testNoteCopyPaste()
{
m_pDoc->InsertTab(0, "Test");
// We need a drawing layer in order to create caption objects.
m_pDoc->InitDrawLayer(&getDocShell());
// Insert in B2 a text and cell comment.
ScAddress aPos(1,1,0);
m_pDoc->SetString(aPos, "Text");
ScPostIt* pNote = m_pDoc->GetOrCreateNote(aPos);
CPPUNIT_ASSERT(pNote);
pNote->SetText(aPos, "Note1");
// Insert in B4 a number and cell comment.
aPos.SetRow(3);
m_pDoc->SetValue(aPos, 1.1);
pNote = m_pDoc->GetOrCreateNote(aPos);
CPPUNIT_ASSERT(pNote);
pNote->SetText(aPos, "Note2");
// Copy B2:B4 to clipboard.
ScMarkData aMark;
aMark.SelectOneTable(0);
ScRange aCopyRange(1,1,0,1,3,0);
ScDocument aClipDoc(SCDOCMODE_CLIP);
aClipDoc.ResetClip(m_pDoc, &aMark);
ScClipParam aClipParam(aCopyRange, false);
m_pDoc->CopyToClip(aClipParam, &aClipDoc, &aMark, false, false, false, true, false);
// Make sure the notes are in the clipboard.
pNote = aClipDoc.GetNote(ScAddress(1,1,0));
CPPUNIT_ASSERT(pNote);
CPPUNIT_ASSERT_EQUAL(OUString("Note1"), pNote->GetText());
pNote = aClipDoc.GetNote(ScAddress(1,3,0));
CPPUNIT_ASSERT(pNote);
CPPUNIT_ASSERT_EQUAL(OUString("Note2"), pNote->GetText());
// Paste to B6:B8 but only cell notes.
ScRange aDestRange(1,5,0,1,7,0);
m_pDoc->CopyFromClip(aDestRange, aMark, IDF_NOTE, NULL, &aClipDoc);
// Make sure the notes are there.
pNote = m_pDoc->GetNote(ScAddress(1,5,0));
CPPUNIT_ASSERT(pNote);
CPPUNIT_ASSERT_EQUAL(OUString("Note1"), pNote->GetText());
pNote = m_pDoc->GetNote(ScAddress(1,7,0));
CPPUNIT_ASSERT(pNote);
CPPUNIT_ASSERT_EQUAL(OUString("Note2"), pNote->GetText());
m_pDoc->DeleteTab(0);
}
void Test::testAreasWithNotes()
{
ScDocument* pDoc = getDocShell().GetDocument();
...
...
sc/qa/unit/ucalc.hxx
Dosyayı görüntüle @
71cd1ca5
...
...
@@ -341,6 +341,7 @@ public:
void
testNoteDeleteRow
();
void
testNoteDeleteCol
();
void
testNoteLifeCycle
();
void
testNoteCopyPaste
();
void
testAreasWithNotes
();
void
testAnchoredRotatedShape
();
void
testCellTextWidth
();
...
...
@@ -499,6 +500,7 @@ public:
CPPUNIT_TEST
(
testNoteDeleteRow
);
CPPUNIT_TEST
(
testNoteDeleteCol
);
CPPUNIT_TEST
(
testNoteLifeCycle
);
CPPUNIT_TEST
(
testNoteCopyPaste
);
CPPUNIT_TEST
(
testAreasWithNotes
);
CPPUNIT_TEST
(
testAnchoredRotatedShape
);
CPPUNIT_TEST
(
testCellTextWidth
);
...
...
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