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

Kohei Yoshida kohei at kemper.freedesktop.org
Fri Apr 1 20:58:19 PDT 2011


 sc/inc/dbcolect.hxx              |    2 ++
 sc/source/core/data/documen3.cxx |    9 +--------
 sc/source/core/tool/dbcolect.cxx |   10 ++++++++++
 sc/source/ui/view/tabvwshc.cxx   |   21 ++++++++++++++++-----
 4 files changed, 29 insertions(+), 13 deletions(-)

New commits:
commit 61e32ec187584f418833168addd54131de5ff76e
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Fri Apr 1 23:53:12 2011 -0400

    Store ScDocument* locally.

diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 71bd378..86d302a 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -103,6 +103,8 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
     if(pCW)
         pCW->SetHideNotDelete(sal_True);
 
+    ScDocument* pDoc = GetViewData()->GetDocument();
+
     switch( nSlotId )
     {
         case FID_DEFINE_NAME:
@@ -125,7 +127,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
                                 SCITEM_CONSOLIDATEDATA );
 
             const ScConsolidateParam* pDlgData =
-                            GetViewData()->GetDocument()->GetConsolidateDlgData();
+                            pDoc->GetConsolidateDlgData();
 
             if ( !pDlgData )
             {
@@ -176,7 +178,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
                                      SCITEM_QUERYDATA );
 
             ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, SC_DBSEL_ROW_DOWN);
-            pDBData->ExtendDataArea(GetViewData()->GetDocument());
+            pDBData->ExtendDataArea(pDoc);
             pDBData->GetQueryParam( aQueryParam );
 
             ScRange aArea;
@@ -206,7 +208,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
                                      SCITEM_QUERYDATA );
 
             ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, SC_DBSEL_ROW_DOWN);
-            pDBData->ExtendDataArea(GetViewData()->GetDocument());
+            pDBData->ExtendDataArea(pDoc);
             pDBData->GetQueryParam( aQueryParam );
 
             ScRange aArea;
@@ -262,7 +264,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
             {
                 // Check for an existing datapilot output.
                 ScViewData* pViewData = GetViewData();
-                ScDPObject* pObj = GetViewData()->GetDocument()->GetDPAtCursor(
+                ScDPObject* pObj = pDoc->GetDPAtCursor(
                     pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo());
 
                 GetViewData()->SetRefTabNo( GetViewData()->GetTabNo() );
@@ -281,7 +283,6 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
         {
             ScViewData* pViewData = GetViewData();
 
-            ScDocument* pDoc = pViewData->GetDocument();
             const ScConditionalFormat* pForm = pDoc->GetCondFormat(
                 pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo() );
 
commit 1ff0c03b16e110568b929ea0fa6c061008ef6933
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Fri Apr 1 23:04:45 2011 -0400

    Extend data area for standard and special filters as well.

diff --git a/sc/inc/dbcolect.hxx b/sc/inc/dbcolect.hxx
index d34d383..3c60675 100644
--- a/sc/inc/dbcolect.hxx
+++ b/sc/inc/dbcolect.hxx
@@ -181,6 +181,8 @@ public:
                                 SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
                                 SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
                                 SCsCOL nDx, SCsROW nDy, SCsTAB nDz);
+
+            void ExtendDataArea(ScDocument* pDoc);
 };
 
 
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index d49e48f..e82abc2 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -1348,6 +1348,7 @@ sal_Bool ScDocument::GetFilterEntries(
         ScDBData* pDBData = pDBCollection->GetDBAtCursor(nCol, nRow, nTab, false);	//!??
         if (pDBData)
         {
+            pDBData->ExtendDataArea(this);
             SCTAB nAreaTab;
             SCCOL nStartCol;
             SCROW nStartRow;
@@ -1355,14 +1356,6 @@ sal_Bool ScDocument::GetFilterEntries(
             SCROW nEndRow;
             pDBData->GetArea( nAreaTab, nStartCol, nStartRow, nEndCol, nEndRow );
 
-            // Extend the DB area to include data rows immediately below.
-            // Note that the change is stored back to the DB.
-            SCCOL nCol1a = nStartCol, nCol2a = nEndCol;
-            SCROW nRow1a = nStartRow, nRow2a = nEndRow;
-            GetDataArea(nTab, nCol1a, nRow1a, nCol2a, nRow2a, false, false);
-            nEndRow = nRow2a;
-            pDBData->SetArea(nTab, nStartCol, nStartRow, nEndCol, nEndRow);
-
             if (pDBData->HasHeader())
                 ++nStartRow;
 
diff --git a/sc/source/core/tool/dbcolect.cxx b/sc/source/core/tool/dbcolect.cxx
index 600d987..a96668e 100644
--- a/sc/source/core/tool/dbcolect.cxx
+++ b/sc/source/core/tool/dbcolect.cxx
@@ -652,6 +652,16 @@ void ScDBData::UpdateReference(ScDocument* pDoc, UpdateRefMode eUpdateRefMode,
 
     //!		Testen, ob mitten aus dem Bereich geloescht/eingefuegt wurde !!!
 }
+#include <stdio.h>
+void ScDBData::ExtendDataArea(ScDocument* pDoc)
+{
+    // Extend the DB area to include data rows immediately below.
+    SCCOL nCol1a = nStartCol, nCol2a = nEndCol;
+    SCROW nRow1a = nStartRow, nRow2a = nEndRow;
+    pDoc->GetDataArea(nTable, nCol1a, nRow1a, nCol2a, nRow2a, false, false);
+    nEndRow = nRow2a;
+    fprintf(stdout, "ScDBData::ExtendDataArea:   new end row = %d\n", nEndRow);
+}
 
 namespace {
 
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 6f31b4d..71bd378 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -175,9 +175,14 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
                                      SCITEM_QUERYDATA,
                                      SCITEM_QUERYDATA );
 
-            ScDBData* pDBData = GetDBData(true, SC_DB_MAKE, SC_DBSEL_ROW_DOWN);
+            ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, SC_DBSEL_ROW_DOWN);
+            pDBData->ExtendDataArea(GetViewData()->GetDocument());
             pDBData->GetQueryParam( aQueryParam );
 
+            ScRange aArea;
+            pDBData->GetArea(aArea);
+            MarkRange(aArea, false);
+
             ScQueryItem aItem( SCITEM_QUERYDATA, GetViewData(), &aQueryParam );
             ScRange aAdvSource;
             if (pDBData->GetAdvancedQuerySource(aAdvSource))
@@ -200,9 +205,14 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
                                      SCITEM_QUERYDATA,
                                      SCITEM_QUERYDATA );
 
-            ScDBData* pDBData = GetDBData(true, SC_DB_MAKE, SC_DBSEL_ROW_DOWN);
+            ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, SC_DBSEL_ROW_DOWN);
+            pDBData->ExtendDataArea(GetViewData()->GetDocument());
             pDBData->GetQueryParam( aQueryParam );
 
+            ScRange aArea;
+            pDBData->GetArea(aArea);
+            MarkRange(aArea, false);
+
             aArgSet.Put( ScQueryItem( SCITEM_QUERYDATA,
                                       GetViewData(),
                                       &aQueryParam ) );


More information about the Libreoffice-commits mailing list