summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-02-04 22:37:41 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-02-05 00:29:30 -0500
commit21ab2ba866c8bea31cf2832d1c53227963a6010a (patch)
tree1097fc1c8ec4aae649b1fa1072cfcab1ea1ec923 /sc
parentb55bd1f51c54f560da3956d54e4dd30ad1422252 (diff)
Actually these methods shouldn't be taking a sheet index.
Marked ranges consist of 2-dimensional ranges plus selected sheets. So the selected ranges themselves don't care about sheets. Change-Id: I1c2dfab182282e6b32342b97227b3a7abfaf5179
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/markdata.hxx4
-rw-r--r--sc/qa/unit/ucalc.cxx16
-rw-r--r--sc/source/core/data/markdata.cxx10
-rw-r--r--sc/source/ui/view/viewfun2.cxx3
4 files changed, 13 insertions, 20 deletions
diff --git a/sc/inc/markdata.hxx b/sc/inc/markdata.hxx
index 4002e1f89ad0..c792b31e468a 100644
--- a/sc/inc/markdata.hxx
+++ b/sc/inc/markdata.hxx
@@ -110,8 +110,8 @@ public:
SCCOLROW GetMarkColumnRanges( SCCOLROW* pRanges );
SCCOLROW GetMarkRowRanges( SCCOLROW* pRanges );
- std::vector<sc::ColRowSpan> GetMarkedRowSpans( SCTAB nTab ) const;
- std::vector<sc::ColRowSpan> GetMarkedColSpans( SCTAB nTab ) const;
+ std::vector<sc::ColRowSpan> GetMarkedRowSpans() const;
+ std::vector<sc::ColRowSpan> GetMarkedColSpans() const;
bool IsColumnMarked( SCCOL nCol ) const;
bool IsRowMarked( SCROW nRow ) const;
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 33d13f53e4c3..a8a349f44224 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -614,45 +614,45 @@ void Test::testMarkData()
ScMarkData aMarkData;
// Empty mark. Nothing is selected.
- std::vector<sc::ColRowSpan> aSpans = aMarkData.GetMarkedRowSpans(0);
+ std::vector<sc::ColRowSpan> aSpans = aMarkData.GetMarkedRowSpans();
CPPUNIT_ASSERT_MESSAGE("Span should be empty.", aSpans.empty());
- aSpans = aMarkData.GetMarkedColSpans(0);
+ aSpans = aMarkData.GetMarkedColSpans();
CPPUNIT_ASSERT_MESSAGE("Span should be empty.", aSpans.empty());
// Select B3:F7.
aMarkData.SetMarkArea(ScRange(1,2,0,5,6,0));
- aSpans = aMarkData.GetMarkedRowSpans(0);
+ aSpans = aMarkData.GetMarkedRowSpans();
CPPUNIT_ASSERT_MESSAGE("There should be one selected row span.", aSpans.size() == 1);
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOLROW>(2), aSpans[0].mnStart);
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOLROW>(6), aSpans[0].mnEnd);
- aSpans = aMarkData.GetMarkedColSpans(0);
+ aSpans = aMarkData.GetMarkedColSpans();
CPPUNIT_ASSERT_MESSAGE("There should be one selected column span.", aSpans.size() == 1);
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOLROW>(1), aSpans[0].mnStart);
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOLROW>(5), aSpans[0].mnEnd);
// Select A11:B13.
aMarkData.SetMultiMarkArea(ScRange(0,10,0,1,12,0));
- aSpans = aMarkData.GetMarkedRowSpans(0);
+ aSpans = aMarkData.GetMarkedRowSpans();
CPPUNIT_ASSERT_MESSAGE("There should be 2 selected row spans.", aSpans.size() == 2);
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOLROW>(2), aSpans[0].mnStart);
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOLROW>(6), aSpans[0].mnEnd);
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOLROW>(10), aSpans[1].mnStart);
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOLROW>(12), aSpans[1].mnEnd);
- aSpans = aMarkData.GetMarkedColSpans(0);
+ aSpans = aMarkData.GetMarkedColSpans();
CPPUNIT_ASSERT_MESSAGE("There should be one selected column span.", aSpans.size() == 1);
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOLROW>(0), aSpans[0].mnStart);
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOLROW>(5), aSpans[0].mnEnd);
// Select C8:C10.
aMarkData.SetMultiMarkArea(ScRange(2,7,0,2,9,0));
- aSpans = aMarkData.GetMarkedRowSpans(0);
+ aSpans = aMarkData.GetMarkedRowSpans();
CPPUNIT_ASSERT_MESSAGE("There should be one selected row span.", aSpans.size() == 1);
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOLROW>(2), aSpans[0].mnStart);
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOLROW>(12), aSpans[0].mnEnd);
- aSpans = aMarkData.GetMarkedColSpans(0);
+ aSpans = aMarkData.GetMarkedColSpans();
CPPUNIT_ASSERT_MESSAGE("There should be one selected column span.", aSpans.size() == 1);
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOLROW>(0), aSpans[0].mnStart);
CPPUNIT_ASSERT_EQUAL(static_cast<SCCOLROW>(5), aSpans[0].mnEnd);
diff --git a/sc/source/core/data/markdata.cxx b/sc/source/core/data/markdata.cxx
index 7f58b681b4e3..39ef79213a5f 100644
--- a/sc/source/core/data/markdata.cxx
+++ b/sc/source/core/data/markdata.cxx
@@ -551,7 +551,7 @@ SCCOLROW ScMarkData::GetMarkRowRanges( SCCOLROW* pRanges )
return nRangeCnt;
}
-std::vector<sc::ColRowSpan> ScMarkData::GetMarkedRowSpans( SCTAB nTab ) const
+std::vector<sc::ColRowSpan> ScMarkData::GetMarkedRowSpans() const
{
typedef mdds::flat_segment_tree<SCCOLROW, bool> SpansType;
@@ -562,16 +562,13 @@ std::vector<sc::ColRowSpan> ScMarkData::GetMarkedRowSpans( SCTAB nTab ) const
for (size_t i = 0, n = aRanges.size(); i < n; ++i)
{
const ScRange& r = *aRanges[i];
- if (r.aStart.Tab() != nTab)
- continue;
-
itPos = aSpans.insert(itPos, r.aStart.Row(), r.aEnd.Row()+1, true).first;
}
return sc::toSpanArray<SCCOLROW,sc::ColRowSpan>(aSpans);
}
-std::vector<sc::ColRowSpan> ScMarkData::GetMarkedColSpans( SCTAB nTab ) const
+std::vector<sc::ColRowSpan> ScMarkData::GetMarkedColSpans() const
{
typedef mdds::flat_segment_tree<SCCOLROW, bool> SpansType;
@@ -582,9 +579,6 @@ std::vector<sc::ColRowSpan> ScMarkData::GetMarkedColSpans( SCTAB nTab ) const
for (size_t i = 0, n = aRanges.size(); i < n; ++i)
{
const ScRange& r = *aRanges[i];
- if (r.aStart.Tab() != nTab)
- continue;
-
itPos = aSpans.insert(itPos, r.aStart.Col(), r.aEnd.Col()+1, true).first;
}
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 00e0462c0436..76afd3242fda 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -109,8 +109,7 @@ sal_Bool ScViewFunc::AdjustBlockHeight( sal_Bool bPaint, ScMarkData* pMarkData )
pMarkData = &GetViewData()->GetMarkData();
ScDocument* pDoc = pDocSh->GetDocument();
- std::vector<sc::ColRowSpan> aMarkedRows =
- pMarkData->GetMarkedRowSpans(GetViewData()->GetTabNo());
+ std::vector<sc::ColRowSpan> aMarkedRows = pMarkData->GetMarkedRowSpans();
if (aMarkedRows.empty())
{