diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-03-16 21:35:05 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-03-17 02:31:59 +0000 |
commit | 36d7e21c00d59eead018ad8ef339847a782b9734 (patch) | |
tree | 8c556c75873934eea1e44c4a993e80cb88f17d7e /sc | |
parent | d4bdac90c3b12d1de74b99786f2e830ee2ae18dc (diff) |
add test for tdf#106242
Change-Id: I11f67c118617c78fa86b87afed87fcddba4e69e1
Reviewed-on: https://gerrit.libreoffice.org/35295
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/ucalc.hxx | 2 | ||||
-rw-r--r-- | sc/qa/unit/ucalc_condformat.cxx | 33 |
2 files changed, 35 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx index c48a25f126af..fb2390c1f5da 100644 --- a/sc/qa/unit/ucalc.hxx +++ b/sc/qa/unit/ucalc.hxx @@ -468,6 +468,7 @@ public: void testCondCopyPaste(); void testCondCopyPasteSingleCell(); //e.g. fdo#82503 void testCondCopyPasteSingleCellToRange(); //e.g. fdo#82503 + void testCondCopyPasteSingleRowToRange(); //e.g. tdf#106242 void testCondCopyPasteSheetBetweenDoc(); void testCondCopyPasteSheet(); void testIconSet(); @@ -745,6 +746,7 @@ public: CPPUNIT_TEST(testCondCopyPaste); CPPUNIT_TEST(testCondCopyPasteSingleCell); CPPUNIT_TEST(testCondCopyPasteSingleCellToRange); + CPPUNIT_TEST(testCondCopyPasteSingleRowToRange); CPPUNIT_TEST(testCondCopyPasteSheetBetweenDoc); CPPUNIT_TEST(testCondCopyPasteSheet); CPPUNIT_TEST(testCondFormatEndsWithStr); diff --git a/sc/qa/unit/ucalc_condformat.cxx b/sc/qa/unit/ucalc_condformat.cxx index ee0d8abee066..0b0a8a2af97b 100644 --- a/sc/qa/unit/ucalc_condformat.cxx +++ b/sc/qa/unit/ucalc_condformat.cxx @@ -378,6 +378,39 @@ void Test::testCondCopyPasteSingleCellToRange() m_pDoc->DeleteTab(0); } +void Test::testCondCopyPasteSingleRowToRange() +{ + m_pDoc->InsertTab(0, "Test"); + + ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc); + ScRange aCondFormatRange(0,0,0,0,0,0); + ScRangeList aRangeList(aCondFormatRange); + pFormat->SetRange(aRangeList); + + ScCondFormatEntry* pEntry = new ScCondFormatEntry(SC_COND_DIRECT,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT)); + pFormat->AddEntry(pEntry); + m_pDoc->AddCondFormat(pFormat, 0); + + ScDocument aClipDoc(SCDOCMODE_CLIP); + copyToClip(m_pDoc, ScRange(0,0,0,MAXCOL,0,0), &aClipDoc); + ScRange aTargetRange(0,4,0,MAXCOL,4,0); + pasteOneCellFromClip(m_pDoc, aTargetRange, &aClipDoc); + + std::set<sal_uLong> aCondFormatIndices; + + ScConditionalFormat* pNewFormat = m_pDoc->GetCondFormat(0, 4, 0); + CPPUNIT_ASSERT(pNewFormat); + CPPUNIT_ASSERT(pNewFormat->GetKey() != pFormat->GetKey()); + + for (SCCOL nCol = 1; nCol <= MAXCOL; ++nCol) + { + ScConditionalFormat* pNewFormat2 = m_pDoc->GetCondFormat(nCol, 4, 0); + CPPUNIT_ASSERT(!pNewFormat2); + } + + m_pDoc->DeleteTab(0); +} + void Test::testCondCopyPasteSheetBetweenDoc() { m_pDoc->InsertTab(0, "Test"); |