summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-09-25 20:52:38 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-09-27 17:43:51 +0200
commit1e2bbf4bc723a9838bb8786908682ea2dd841866 (patch)
tree2611ca888f44351da0baeb79e8ea86edc4014b57
parentd60c14cde375c46f9bfa290423d251577f2db3de (diff)
add test case for fdo#69720
Change-Id: Ib89a596f0e28cacc9ae180d23b9995e524c45b52
-rw-r--r--sc/qa/unit/helper/qahelper.cxx6
-rw-r--r--sc/qa/unit/helper/qahelper.hxx2
-rw-r--r--sc/qa/unit/ucalc.cxx20
-rw-r--r--sc/qa/unit/ucalc.hxx2
4 files changed, 30 insertions, 0 deletions
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 8139363c4079..0de8b6b5098e 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -55,6 +55,12 @@ std::ostream& operator<<(std::ostream& rStrm, const ScRangeList& rList)
return rStrm;
}
+std::ostream& operator<<(std::ostream& rStrm, const Color& rColor)
+{
+ rStrm << "Color: R:" << rColor.GetRed() << " G:" << rColor.GetGreen() << " B: << rColor.GetBlue()";
+ return rStrm;
+}
+
FileFormat aFileFormats[] = {
{ "ods" , "calc8", "", ODS_FORMAT_TYPE },
{ "xls" , "MS Excel 97", "calc_MS_EXCEL_97", XLS_FORMAT_TYPE },
diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx
index 7bcf5197c153..8d0f27df8004 100644
--- a/sc/qa/unit/helper/qahelper.hxx
+++ b/sc/qa/unit/helper/qahelper.hxx
@@ -97,6 +97,8 @@ std::ostream& operator<<(std::ostream& rStrm, const ScRange& rRange);
std::ostream& operator<<(std::ostream& rStrm, const ScRangeList& rList);
+std::ostream& operator<<(std::ostream& rStrm, const Color& rColor);
+
// Why is this here and not in osl, and using the already existing file
// handling APIs? Do we really want to add arbitrary new file handling
// wrappers here and there (and then having to handle the Android (and
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index e5e6198d45a9..433107352f0f 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -56,6 +56,7 @@
#include <basegfx/polygon/b2dpolygon.hxx>
#include <editeng/boxitem.hxx>
+#include <editeng/brushitem.hxx>
#include <svx/svdograf.hxx>
#include <svx/svdpage.hxx>
@@ -3857,6 +3858,25 @@ void Test::testDeleteCol()
pDoc->DeleteTab(0);
}
+void Test::testDeleteArea()
+{
+ ScDocument* pDoc = getDocShell().GetDocument();
+ pDoc->InsertTab(0, "Test");
+
+ pDoc->SetValue(0,0,0,3.2);
+ pDoc->ApplyAttr(0,0,0,SvxBrushItem(Color(COL_LIGHTRED), ATTR_BACKGROUND));
+
+ ScMarkData aMark;
+ ScRange aRange(0,0,0,0,0,0);
+ aMark.SetMarkArea(aRange);
+ pDoc->DeleteArea(0,0,0,0,aMark, IDF_CONTENTS);
+ const SfxPoolItem* pItem = pDoc->GetAttr(0,0,0,ATTR_BACKGROUND);
+ CPPUNIT_ASSERT(pItem);
+ CPPUNIT_ASSERT_EQUAL(Color(COL_LIGHTRED), static_cast<const SvxBrushItem*>(pItem)->GetColor());
+
+ pDoc->DeleteTab(0);
+}
+
void Test::testAnchoredRotatedShape()
{
OUString aTabName("TestTab");
diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx
index e97bb8df24e7..698d6837827b 100644
--- a/sc/qa/unit/ucalc.hxx
+++ b/sc/qa/unit/ucalc.hxx
@@ -267,6 +267,7 @@ public:
void testShiftCells();
void testDeleteRow();
void testDeleteCol();
+ void testDeleteArea();
void testAnchoredRotatedShape();
void testCellTextWidth();
void testEditTextIterator();
@@ -367,6 +368,7 @@ public:
CPPUNIT_TEST(testShiftCells);
CPPUNIT_TEST(testDeleteRow);
CPPUNIT_TEST(testDeleteCol);
+ CPPUNIT_TEST(testDeleteArea);
CPPUNIT_TEST(testAnchoredRotatedShape);
CPPUNIT_TEST(testCellTextWidth);
CPPUNIT_TEST(testEditTextIterator);