Kaydet (Commit) 985e7e4f authored tarafından Michael Meeks's avatar Michael Meeks Kaydeden (comit) Markus Mohrhard

fdo#54940 - make editing relative refs more intuitive to me

Change-Id: Ib7681de7b1aad9b6dda183e3c4fa1b1010270d3f
üst 5f32a4a2
......@@ -81,6 +81,7 @@ public:
bool Intersects( const ScRange& ) const;
bool In( const ScRange& ) const;
size_t GetCellCount() const;
ScAddress GetTopLeftCorner() const;
ScRange* Remove(size_t nPos);
void RemoveAll();
......
......@@ -1145,6 +1145,21 @@ void ScRangeList::push_back(ScRange* p)
maRanges.push_back(p);
}
ScAddress ScRangeList::GetTopLeftCorner() const
{
if(empty())
return ScAddress();
ScAddress aAddr = maRanges[0]->aStart;
for(size_t i = 1, n = size(); i < n; ++i)
{
if(maRanges[i]->aStart < aAddr)
aAddr = maRanges[i]->aStart;
}
return aAddr;
}
// === ScRangePairList ========================================================
ScRangePairList::~ScRangePairList()
......
......@@ -77,7 +77,7 @@ String ScCondFormatManagerWindow::createEntryString(const ScConditionalFormat& r
String aStr;
aRange.Format(aStr, SCA_VALID, mpDoc, mpDoc->GetAddressConvention());
aStr += '\t';
aStr += ScCondFormatHelper::GetExpression(rFormat, mrPos);
aStr += ScCondFormatHelper::GetExpression(rFormat, aRange.GetTopLeftCorner());
return aStr;
}
......@@ -209,7 +209,8 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, EditBtnHdl)
if(!pFormat)
return 0;
ScCondFormatDlg* pDlg = new ScCondFormatDlg(this, mpDoc, pFormat, pFormat->GetRange(), maPos);
ScCondFormatDlg* pDlg = new ScCondFormatDlg(this, mpDoc, pFormat, pFormat->GetRange(),
pFormat->GetRange().GetTopLeftCorner());
if(pDlg->Execute() == RET_OK)
{
sal_Int32 nKey = pFormat->GetKey();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment