[Libreoffice-commits] .: Branch 'feature/dp-named-range-source' - sc/inc sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Fri Jan 21 12:51:20 PST 2011


 sc/inc/dpshttab.hxx              |    9 +++++----
 sc/source/core/data/dpobject.cxx |   29 ++++++++++++++++-------------
 sc/source/core/data/dpshttab.cxx |   12 ++++++------
 3 files changed, 27 insertions(+), 23 deletions(-)

New commits:
commit 307e75d13ec1cbe0788dc2dfc1c5313c6d9e2e98
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Fri Jan 21 15:51:06 2011 -0500

    Now all its data members are private.

diff --git a/sc/inc/dpshttab.hxx b/sc/inc/dpshttab.hxx
index d782157..3f98e1c 100644
--- a/sc/inc/dpshttab.hxx
+++ b/sc/inc/dpshttab.hxx
@@ -52,11 +52,7 @@ class ScDPItemData;
  */
 class ScSheetSourceDesc
 {
-private:
-    ScRange         aSourceRange;
-    ::rtl::OUString maRangeName;
 public:
-    ScQueryParam    aQueryParam;
 
     SC_DLLPUBLIC void SetSourceRange(const ScRange& rRange);
     SC_DLLPUBLIC const ScRange& GetSourceRange() const;
@@ -80,6 +76,11 @@ public:
     ScDPTableDataCache* GetCache( ScDocument* pDoc, long nID ) const;
     ScDPTableDataCache* GetExistDPObjectCache ( ScDocument* pDoc ) const;
     long GetCacheId( ScDocument* pDoc, long nID ) const;
+
+private:
+    ScRange         maSourceRange;
+    ::rtl::OUString maRangeName;
+    ScQueryParam    maQueryParam;
 };
 
 // --------------------------------------------------------------------
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 36c5aac..9ad68b7 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -277,11 +277,13 @@ void ScDPObject::SetSheetDesc(const ScSheetSourceDesc& rDesc)
     //	make valid QueryParam
 
     const ScRange& rSrcRange = pSheetDesc->GetSourceRange();
-    pSheetDesc->aQueryParam.nCol1 = rSrcRange.aStart.Col();
-    pSheetDesc->aQueryParam.nRow1 = rSrcRange.aStart.Row();
-    pSheetDesc->aQueryParam.nCol2 = rSrcRange.aEnd.Col();
-    pSheetDesc->aQueryParam.nRow2 = rSrcRange.aEnd.Row();;
-    pSheetDesc->aQueryParam.bHasHeader = TRUE;
+    ScQueryParam aParam = pSheetDesc->GetQueryParam();
+    aParam.nCol1 = rSrcRange.aStart.Col();
+    aParam.nRow1 = rSrcRange.aStart.Row();
+    aParam.nCol2 = rSrcRange.aEnd.Col();
+    aParam.nRow2 = rSrcRange.aEnd.Row();;
+    aParam.bHasHeader = true;
+    pSheetDesc->SetQueryParam(aParam);
 
     InvalidateSource();		// new source must be created
 }
@@ -716,16 +718,17 @@ void ScDPObject::UpdateReference( UpdateRefMode eUpdateRefMode,
             SCsCOL nDiffX = nCol1 - (SCsCOL) pSheetDesc->GetSourceRange().aStart.Col();
             SCsROW nDiffY = nRow1 - (SCsROW) pSheetDesc->GetSourceRange().aStart.Row();
 
-            aNewDesc.aQueryParam = pSheetDesc->aQueryParam;
-            aNewDesc.aQueryParam.nCol1 = sal::static_int_cast<SCCOL>( aNewDesc.aQueryParam.nCol1 + nDiffX );
-            aNewDesc.aQueryParam.nCol2 = sal::static_int_cast<SCCOL>( aNewDesc.aQueryParam.nCol2 + nDiffX );
-            aNewDesc.aQueryParam.nRow1 += nDiffY;	//! used?
-            aNewDesc.aQueryParam.nRow2 += nDiffY;	//! used?
-            SCSIZE nEC = aNewDesc.aQueryParam.GetEntryCount();
+            ScQueryParam aParam = pSheetDesc->GetQueryParam();
+            aParam.nCol1 = sal::static_int_cast<SCCOL>( aParam.nCol1 + nDiffX );
+            aParam.nCol2 = sal::static_int_cast<SCCOL>( aParam.nCol2 + nDiffX );
+            aParam.nRow1 += nDiffY;	//! used?
+            aParam.nRow2 += nDiffY;	//! used?
+            SCSIZE nEC = aParam.GetEntryCount();
             for (SCSIZE i=0; i<nEC; i++)
-                if (aNewDesc.aQueryParam.GetEntry(i).bDoQuery)
-                    aNewDesc.aQueryParam.GetEntry(i).nField += nDiffX;
+                if (aParam.GetEntry(i).bDoQuery)
+                    aParam.GetEntry(i).nField += nDiffX;
 
+            aNewDesc.SetQueryParam(aParam);
             SetSheetDesc( aNewDesc );		// allocates new pSheetDesc
         }
     }
diff --git a/sc/source/core/data/dpshttab.cxx b/sc/source/core/data/dpshttab.cxx
index 176f917..0c7d33d 100644
--- a/sc/source/core/data/dpshttab.cxx
+++ b/sc/source/core/data/dpshttab.cxx
@@ -235,13 +235,13 @@ const ScDPCacheTable& ScSheetDPData::GetCacheTable() const
 
 void ScSheetSourceDesc::SetSourceRange(const ScRange& rRange)
 {
-    aSourceRange = rRange;
+    maSourceRange = rRange;
     maRangeName = OUString(); // overwrite existing range name if any.
 }
 
 const ScRange& ScSheetSourceDesc::GetSourceRange() const
 {
-    return aSourceRange;
+    return maSourceRange;
 }
 
 void ScSheetSourceDesc::SetRangeName(const OUString& rName)
@@ -256,19 +256,19 @@ const OUString& ScSheetSourceDesc::GetRangeName() const
 
 void ScSheetSourceDesc::SetQueryParam(const ScQueryParam& rParam)
 {
-    aQueryParam = rParam;
+    maQueryParam = rParam;
 }
 
 const ScQueryParam& ScSheetSourceDesc::GetQueryParam() const
 {
-    return aQueryParam;
+    return maQueryParam;
 }
 
 bool ScSheetSourceDesc::operator== (const ScSheetSourceDesc& rOther) const
 {
-    return aSourceRange == rOther.aSourceRange && 
+    return maSourceRange == rOther.maSourceRange &&
         maRangeName == rOther.maRangeName && 
-        aQueryParam  == rOther.aQueryParam;
+        maQueryParam  == rOther.maQueryParam;
 }
 
 ScDPTableDataCache* ScSheetSourceDesc::CreateCache( ScDocument* pDoc , long nID ) const


More information about the Libreoffice-commits mailing list