[Libreoffice-commits] .: Branch 'libreoffice-3-6' - sc/inc sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Oct 4 08:59:56 PDT 2012


 sc/inc/rangelst.hxx                       |    1 +
 sc/source/core/tool/rangelst.cxx          |   15 +++++++++++++++
 sc/source/ui/condformat/condformatmgr.cxx |    5 +++--
 sc/source/ui/view/cellsh1.cxx             |    2 +-
 4 files changed, 20 insertions(+), 3 deletions(-)

New commits:
commit cf83153902ec9cd7d15782cbdbf01df9f449fdbc
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Fri Sep 28 13:40:47 2012 +0100

    fdo#54940 - make editing relative refs more intuitive to me
    
    Change-Id: Id3aa76010d92e71c5dc417fdafba90c3ea8401c8
    Signed-off-by: Kohei Yoshida <kohei.yoshida at gmail.com>

diff --git a/sc/inc/rangelst.hxx b/sc/inc/rangelst.hxx
index 74bb7be..8bf3bed 100644
--- a/sc/inc/rangelst.hxx
+++ b/sc/inc/rangelst.hxx
@@ -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();
diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx
index 8214c50..19321b5 100644
--- a/sc/source/core/tool/rangelst.cxx
+++ b/sc/source/core/tool/rangelst.cxx
@@ -1135,6 +1135,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()
diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx
index aee8b6f..03fbeb3 100644
--- a/sc/source/ui/condformat/condformatmgr.cxx
+++ b/sc/source/ui/condformat/condformatmgr.cxx
@@ -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();
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 14ed86b..c532945 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2075,7 +2075,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                 }
                 else
                 {
-                    pDlg = pFact->CreateScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, NULL, aRangeList, aPos, RID_SCDLG_CONDFORMAT );
+                    pDlg = pFact->CreateScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, NULL, aRangeList, aRangeList.GetTopLeftCorner(), RID_SCDLG_CONDFORMAT );
                 }
 
                 if(pDlg->Execute() == RET_OK)


More information about the Libreoffice-commits mailing list