summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAkash Shetye <shetyeakash@gmail.com>2013-07-07 11:39:06 +0530
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-08-05 14:30:22 -0400
commit7d6e550aff6e036ed9ea392796a56d3680ff9d2e (patch)
tree4fb25ee4b5d4eca667184b35117417103e89722a
parentTried to add code for filling in formatting attribute in ScDBData failed (diff)
downloadcore-7d6e550aff6e036ed9ea392796a56d3680ff9d2e.tar.gz
core-7d6e550aff6e036ed9ea392796a56d3680ff9d2e.zip
Done with adding the formatting information to ScDBData objects
Change-Id: I6cf025ce11cbb3be6a45f7a637bc919c0485c9dc
-rw-r--r--sc/inc/datauno.hxx2
-rw-r--r--sc/inc/dbdata.hxx1
-rw-r--r--sc/source/core/tool/dbdata.cxx5
-rw-r--r--sc/source/filter/oox/tablebuffer.cxx5
-rw-r--r--sc/source/filter/oox/workbookhelper.cxx8
-rw-r--r--sc/source/ui/unoobj/datauno.cxx12
6 files changed, 10 insertions, 23 deletions
diff --git a/sc/inc/datauno.hxx b/sc/inc/datauno.hxx
index d0e01b5ed8e4..a2562c21f7bf 100644
--- a/sc/inc/datauno.hxx
+++ b/sc/inc/datauno.hxx
@@ -23,7 +23,6 @@
#include "global.hxx"
#include "queryparam.hxx"
#include "subtotalparam.hxx"
-#include "dbdataformatting.hxx"
#include <com/sun/star/sheet/TableFilterField.hpp>
#include <com/sun/star/sheet/GeneralFunction.hpp>
@@ -625,7 +624,6 @@ public:
virtual void SAL_CALL addNewByName( const OUString& aName,
const ::com::sun::star::table::CellRangeAddress& aRange )
throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL addDatabaseRangeFormatting( const OUString& aName, const ScDBDataFormatting& rTableFormatData ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL removeByName( const OUString& aName )
throw(::com::sun::star::uno::RuntimeException);
diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx
index 89ed6440b238..3522fdf95470 100644
--- a/sc/inc/dbdata.hxx
+++ b/sc/inc/dbdata.hxx
@@ -237,6 +237,7 @@ public:
const ScDBData* GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const;
ScDBData* GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
ScDBData* GetDBNearCursor(SCCOL nCol, SCROW nRow, SCTAB nTab );
+ ScDBData* GetDBByName( const OUString& rName );
void DeleteOnTab( SCTAB nTab );
void UpdateReference(UpdateRefMode eUpdateRefMode,
diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index d7cff5db5314..e2bcbb621698 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -923,6 +923,11 @@ ScDBData* ScDBCollection::GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCO
return NULL;
}
+ScDBData* ScDBCollection::GetDBByName( const OUString& rName )
+{
+ return maNamedDBs.findByUpperName( rName );
+}
+
void ScDBCollection::DeleteOnTab( SCTAB nTab )
{
FindByTable func(nTab);
diff --git a/sc/source/filter/oox/tablebuffer.cxx b/sc/source/filter/oox/tablebuffer.cxx
index b1b930d13406..0fa9e03cd931 100644
--- a/sc/source/filter/oox/tablebuffer.cxx
+++ b/sc/source/filter/oox/tablebuffer.cxx
@@ -116,11 +116,6 @@ void Table::finalizeImport()
aTableFormatting.SetBandedRows( maModel.mbShowRowStripes );
aTableFormatting.SetBandedColumns( maModel.mbShowColumnStripes );
addDatabaseFormatting( maDBRangeName, aTableFormatting );
- //Add this table formatting information to the ScDBData instance.
- //xDatabaseRange->SetTableFormatting( aTableFormatting );
- //Still figuring how to have an ScDBData object out of this
- //xDatabaseRange of type XDatabaseRange... all that needs to be
- //done is call the SetTableFormatting on that ScDBData object
}
catch( Exception& )
{
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index 0c60d8518fcf..cd2461aa390d 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -467,10 +467,10 @@ Reference< XDatabaseRange > WorkbookGlobals::createDatabaseRangeObject( OUString
void WorkbookGlobals::addDatabaseFormatting( const OUString& rName, const ScDBDataFormatting& rDBDataFormatting )
{
- PropertySet aDocProps( mxDoc );
- Reference< XDatabaseRanges > xDatabaseRanges( aDocProps.getAnyProperty( PROP_DatabaseRanges ), UNO_QUERY_THROW );
- //xDatabaseRanges->addDatabaseRangeFormatting( rName, rDBDataFormatting );
- //Need some way to add the formatting information. Stuck here major.
+ //Is such smartness allowed? Or should catch objects and then call for each method call?
+ ScDBData* pDBRange = getScDocument().GetDBCollection()->GetDBByName( rName );
+ if( pDBRange != NULL )
+ pDBRange->SetTableFormatting( rDBDataFormatting );
}
Reference< XDatabaseRange > WorkbookGlobals::createUnnamedDatabaseRangeObject( const CellRangeAddress& rRangeAddr ) const
diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index c2746eedb89b..23cf3da9c0b6 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -2285,18 +2285,6 @@ void SAL_CALL ScDatabaseRangesObj::addNewByName( const OUString& aName,
throw uno::RuntimeException(); // no other exceptions specified
}
-void SAL_CALL ScDatabaseRangesObj::addDatabaseRangeFormatting( const OUString& rName, const ScDBDataFormatting& rTableFormatData ) throw (uno::RuntimeException)
-{
- bool bDone = false;
- if( pDocShell )
- {
- ScDBDocFunc aFunc( *pDocShell );
- bDone = (aFunc.AddDBFormatting( rName, rTableFormatData ));
- }
- if( !bDone )
- throw uno::RuntimeException();
-}
-
void SAL_CALL ScDatabaseRangesObj::removeByName( const OUString& aName )
throw(uno::RuntimeException)
{