summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkash Shetye <shetyeakash@gmail.com>2013-06-06 17:45:05 +0530
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-08-05 14:30:18 -0400
commit8fe515d6c012201bd6856ead5784dfd27ee3b6e9 (patch)
tree936f9dbc2622b8540bfd5dee8c6130513d5bee4e
parentcbbaaa71d3023b556d0cd2abfbb85ad752fd16d7 (diff)
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@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r--sc/Library_sc.mk1
-rw-r--r--sc/inc/dbdata.hxx7
-rw-r--r--sc/inc/dbdataformatting.hxx4
-rw-r--r--sc/source/core/tool/dbdata.cxx11
-rw-r--r--sc/source/core/tool/dbdataformatting.cxx22
5 files changed, 38 insertions, 7 deletions
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index 6f559f5bad1e..4fd1df13059a 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -204,6 +204,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 c9ecdfb60c62..89ed6440b238 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 d1897ad5fdd9..aa3bd65f9370 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 0b60852fc3e4..d7cff5db5314 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 1a84eb0da80a..c3988839bb70 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 )
{
}