[Libreoffice-commits] core.git: Branch 'feature/gsoc-calc-enhanced-db-range' - sc/inc sc/Library_sc.mk sc/source

Akash Shetye shetyeakash at gmail.com
Thu Jun 6 11:04:45 PDT 2013


 sc/Library_sc.mk                         |    1 +
 sc/inc/dbdata.hxx                        |    7 +++++++
 sc/inc/dbdataformatting.hxx              |    4 ++--
 sc/source/core/tool/dbdata.cxx           |   11 +++++++++++
 sc/source/core/tool/dbdataformatting.cxx |   22 +++++++++++++++++-----
 5 files changed, 38 insertions(+), 7 deletions(-)

New commits:
commit 9d616c2c56f0bea63d4252ce8c0980a17903361b
Author: Akash Shetye <shetyeakash at gmail.com>
Date:   Thu Jun 6 17:45:05 2013 +0530

    Adds get ans set methods in ScDBData for setting table formatting.
    
    Some changes made in ScDBDataFormatting like adding a copy constructor, changes to the constructor etc. as well.
    
    Change-Id: Ia9799a0cf4b449bfa04092772bea7f28cce1d7cb
    Reviewed-on: https://gerrit.libreoffice.org/4179
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index 373ba8a..7a9e142 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -190,6 +190,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
 	sc/source/core/tool/compiler \
 	sc/source/core/tool/consoli  \
 	sc/source/core/tool/dbdata \
+    sc/source/core/tool/dbdataformatting \
 	sc/source/core/tool/ddelink \
 	sc/source/core/tool/defaultsoptions \
 	sc/source/core/tool/detdata  \
diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx
index fcd5d49..a16e11f 100644
--- a/sc/inc/dbdata.hxx
+++ b/sc/inc/dbdata.hxx
@@ -24,6 +24,7 @@
 #include "refreshtimer.hxx"
 #include "address.hxx"
 #include "global.hxx"
+#include "dbdataformatting.hxx"
 
 #include <boost/ptr_container/ptr_vector.hpp>
 #include <boost/ptr_container/ptr_set.hpp>
@@ -42,6 +43,7 @@ private:
     boost::scoped_ptr<ScQueryParam> mpQueryParam;
     boost::scoped_ptr<ScSubTotalParam> mpSubTotal;
     boost::scoped_ptr<ScImportParam> mpImportParam;
+    boost::scoped_ptr<ScDBDataFormatting> mpTableFormatData;
 
     // DBParam
     const OUString aName;
@@ -123,6 +125,11 @@ public:
     void        GetImportParam(ScImportParam& rImportParam) const;
     void        SetImportParam(const ScImportParam& rImportParam);
 
+    //The getter and setter methods for mpTableFormatData will be called
+    //From the alternating coloring dialog hence SC_DLLPUBLIC.
+    SC_DLLPUBLIC void        SetTableFormatting( const ScDBDataFormatting& rTableFormatData );
+    SC_DLLPUBLIC void        GetTableFormatting( ScDBDataFormatting& rTableFormatData ) const;
+
     bool        IsDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly) const;
     bool        IsDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const;
 
diff --git a/sc/inc/dbdataformatting.hxx b/sc/inc/dbdataformatting.hxx
index d1897ad..aa3bd65 100644
--- a/sc/inc/dbdataformatting.hxx
+++ b/sc/inc/dbdataformatting.hxx
@@ -23,7 +23,6 @@
 
 class ScDBDataFormatting
 {
-    private:
         OUString maFirstRowStripeStyle;
         OUString maSecondRowStripeStyle;
         OUString maFirstColStripeStyle;
@@ -31,7 +30,8 @@ class ScDBDataFormatting
         bool bBandedRows;
         bool bBandedColumns;
     public:
-        ScDBDataFormatting(const OUString& rFirstRowStripeStyle, const OUString& rSecondRowStripeStyle, const OUString& rFirstColStripeStyle, const OUString& rSecondColStripeStyle);
+        ScDBDataFormatting(const OUString& rFirstRowStripeStyle, const OUString& rSecondRowStripeStyle, const OUString& rFirstColStripeStyle, const OUString& rSecondColStripeStyle, bool bBRows, bool bBCols);
+        ScDBDataFormatting( const ScDBDataFormatting& rTableFormatData );
         void SetBandedRows( bool bBRows );
         bool GetBandedRows();
         void SetBandedColumns( bool bBCols );
diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index 163e6fe..33aece7 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -407,6 +407,17 @@ void ScDBData::SetImportParam(const ScImportParam& rImportParam)
     mpImportParam.reset(new ScImportParam(rImportParam));
 }
 
+//Methods to get and set ScDBDataFormatting instance
+void ScDBData::SetTableFormatting( const ScDBDataFormatting& rTableFormatData )
+{
+    mpTableFormatData.reset( new ScDBDataFormatting( rTableFormatData ) );
+}
+
+void ScDBData::GetTableFormatting( ScDBDataFormatting& rTableFormatData ) const
+{
+    rTableFormatData = *mpTableFormatData;
+}
+
 bool ScDBData::IsDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly) const
 {
     if (nTab == nTable)
diff --git a/sc/source/core/tool/dbdataformatting.cxx b/sc/source/core/tool/dbdataformatting.cxx
index 1a84eb0..c398883 100644
--- a/sc/source/core/tool/dbdataformatting.cxx
+++ b/sc/source/core/tool/dbdataformatting.cxx
@@ -20,11 +20,23 @@
 #include "dbdataformatting.hxx"
 #include "rtl/ustring.hxx"
 
-ScDBDataFormatting::ScDBDataFormatting(const OUString& rFirstRowStripeStyle, const OUString& rSecondRowStripeStyle, const OUString& rFirstColStripeStyle, const OUString& rSecondColStripeStyle) :
-maFirstRowStripeStyle    ( rFirstRowStripeStyle),
-maSecondRowStripeStyle   ( rSecondRowStripeStyle ),
-maFirstColStripeStyle    ( rFirstColStripeStyle ),
-maSecondColStripeStyle   ( rSecondColStripeStyle )
+ScDBDataFormatting::ScDBDataFormatting(const OUString& rFirstRowStripeStyle, const OUString& rSecondRowStripeStyle, const OUString& rFirstColStripeStyle, const OUString& rSecondColStripeStyle, bool bBRows, bool bBCols) :
+    maFirstRowStripeStyle   ( rFirstRowStripeStyle),
+    maSecondRowStripeStyle  ( rSecondRowStripeStyle ),
+    maFirstColStripeStyle   ( rFirstColStripeStyle ),
+    maSecondColStripeStyle  ( rSecondColStripeStyle ),
+    bBandedRows             ( bBRows ),
+    bBandedColumns          ( bBCols )
+{
+}
+
+ScDBDataFormatting::ScDBDataFormatting( const ScDBDataFormatting& rTableFormatData ):
+    maFirstRowStripeStyle   ( rTableFormatData.maFirstRowStripeStyle ),
+    maSecondRowStripeStyle  ( rTableFormatData.maSecondRowStripeStyle ),
+    maFirstColStripeStyle   ( rTableFormatData.maFirstColStripeStyle ),
+    maSecondColStripeStyle  ( rTableFormatData.maSecondColStripeStyle ),
+    bBandedRows             ( rTableFormatData.bBandedRows ),
+    bBandedColumns          ( rTableFormatData.bBandedColumns )
 {
 }
 


More information about the Libreoffice-commits mailing list