diff options
author | Akash Shetye <shetyeakash@gmail.com> | 2013-08-01 23:45:58 +0530 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-08-05 14:30:26 -0400 |
commit | 9387d68fec054cbd74835fcf35f1dba915e2dc92 (patch) | |
tree | 07f254c90a1cdbc4831d8d1f0e35fe2db59caea1 | |
parent | d1ec73988405eeaae1e9f1019a7577e30e9d962d (diff) |
Corrected a redundant if statement to do what it should
Not proud of this patch :D
Change-Id: I9d08a48188d1bd086ae0135b1044cd56ee141951
-rw-r--r-- | sc/inc/dbdata.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/dbdata.cxx | 11 | ||||
-rw-r--r-- | sc/source/filter/excel/xestyle.cxx | 3 |
3 files changed, 11 insertions, 5 deletions
diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx index 89ed6440b238..a87f72fe584a 100644 --- a/sc/inc/dbdata.hxx +++ b/sc/inc/dbdata.hxx @@ -58,6 +58,7 @@ private: bool bDoSize; bool bKeepFmt; bool bStripData; + bool bHasFormatting; /// QueryParam bool bIsAdvanced; ///< true if created by advanced filter @@ -107,6 +108,7 @@ public: void SetKeepFmt(bool bSet) { bKeepFmt = bSet; } bool IsStripData() const { return bStripData; } void SetStripData(bool bSet) { bStripData = bSet; } + bool HasFormatting() { return bHasFormatting; } OUString GetSourceString() const; OUString GetOperations() const; diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx index d7cff5db5314..ccddddb6dbf4 100644 --- a/sc/source/core/tool/dbdata.cxx +++ b/sc/source/core/tool/dbdata.cxx @@ -71,7 +71,8 @@ ScDBData::ScDBData( const OUString& rName, bDBSelection(false), nIndex (0), bAutoFilter (false), - bModified (false) + bModified (false), + bHasFormatting(false) { aUpper = ScGlobal::pCharClass->uppercase(aUpper); } @@ -99,7 +100,8 @@ ScDBData::ScDBData( const ScDBData& rData ) : bDBSelection (rData.bDBSelection), nIndex (rData.nIndex), bAutoFilter (rData.bAutoFilter), - bModified (rData.bModified) + bModified (rData.bModified), + bHasFormatting (rData.bHasFormatting) { } @@ -126,7 +128,8 @@ ScDBData::ScDBData( const OUString& rName, const ScDBData& rData ) : bDBSelection (rData.bDBSelection), nIndex (rData.nIndex), bAutoFilter (rData.bAutoFilter), - bModified (rData.bModified) + bModified (rData.bModified), + bHasFormatting (rData.bHasFormatting) { aUpper = ScGlobal::pCharClass->uppercase(aUpper); } @@ -155,6 +158,7 @@ ScDBData& ScDBData::operator= (const ScDBData& rData) bDBSelection = rData.bDBSelection; nIndex = rData.nIndex; bAutoFilter = rData.bAutoFilter; + bHasFormatting = rData.bHasFormatting; return *this; } @@ -410,6 +414,7 @@ void ScDBData::SetImportParam(const ScImportParam& rImportParam) //Methods to get and set ScDBDataFormatting instance void ScDBData::SetTableFormatting( const ScDBDataFormatting& rTableFormatData ) { + bHasFormatting = true; mpTableFormatData.reset( new ScDBDataFormatting( rTableFormatData ) ); } diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index a6587336a6e4..c52ff30c9a0e 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -3235,8 +3235,7 @@ XclExpTableStyles::XclExpTableStyles( const XclExpRoot& rRoot, XclExpDxfs& rDxfs the named DBs for table style information. */ ScDBDataFormatting aDBFormatting; - (*itr).GetTableFormatting( aDBFormatting ); - if( &(aDBFormatting)!=NULL )//Probably non-standard? + if( (*itr).HasFormatting() ) { miCount++; maStyleContainer.push_back( new XclExpTableStyle( rRoot, aDBFormatting, rDxfs ) ); |