diff options
author | Akash Shetye <shetyeakash@gmail.com> | 2013-08-30 04:39:20 +0530 |
---|---|---|
committer | Akash Shetye <shetyeakash@gmail.com> | 2013-08-30 04:39:20 +0530 |
commit | cc5ab36c5ae3e9145261ec7645e2e798aa2fd95e (patch) | |
tree | 0aed3529ac542c1c38bbafc543a4889718416cff | |
parent | e3995f25d94f74b325e94f41df7e0d3b64adc617 (diff) |
Adds the code to fill info to allow cell colouring.
Change-Id: I5a037c97192ac40be9b76f7eb8ef550a2f7205b0
-rw-r--r-- | sc/source/core/data/fillinfo.cxx | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx index 5f9b6cecdbb3..4a60e68503e6 100644 --- a/sc/source/core/data/fillinfo.cxx +++ b/sc/source/core/data/fillinfo.cxx @@ -41,6 +41,7 @@ #include "stlpool.hxx" #include "cellvalue.hxx" #include "mtvcellfunc.hxx" +#include "dbdata.hxx" const sal_uInt16 ROWINFO_MAX = 1024; @@ -537,6 +538,39 @@ void ScDocument::FillInfo( pThisRowInfo->bEmptyBack = false; } + //Exp Code + //Overwrite this pBackground value + //Get cell style for this cell + if ( pDBCollection ) + { + ScDBCollection::NamedDBs& aNamedDBs = pDBCollection->getNamedDBs(); + ScDBData* pDBData = pDBCollection->GetDBAtCursor( nX, nCurRow, nTab, false ); + if ( pDBData && pDBData->HasFormatting() ) + { + ScDBDataFormatting aDBFormatting; + pDBData->GetTableFormatting( aDBFormatting ); + //Getting the applicable cell style name + //First for banded columns/lowest priority + OUString aCellStyleName; + if ( aDBFormatting.GetBandedColumns() ) + aCellStyleName = pDBData->GetCellStyle( ScAddress( nX, nCurRow, nTab ), false ); + //Second for banded rows/highest priority + if ( aDBFormatting.GetBandedRows() ) + aCellStyleName = pDBData->GetCellStyle( ScAddress( nX, nCurRow, nTab ), true ); + if ( !aCellStyleName.isEmpty() ) + { + SfxStyleSheetBase* pStyleSheet = pStlPool->Find(aCellStyleName, SFX_STYLE_FAMILY_PARA ); + if ( pStyleSheet ) + { + SfxItemSet aStyleSheetItemSet = pStyleSheet->GetItemSet(); + pInfo->pBackground = ( const SvxBrushItem * )aStyleSheetItemSet.GetItem( ATTR_BACKGROUND ); + } + } + } + } + //From the style get the SfxItemSet + //Exp Code ends + if ( bContainsCondFormat ) { bool bFound = false; |