summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-12-24 20:28:14 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-12-26 09:48:12 +0000
commit8ec545531992251d3670c1bd3b1d1e0c9c998db0 (patch)
treecd3491eeca2cfc5bb467dbb4354b242a8bfc6a75
parent57626f2132f73e4e42b31e364b25c5867336e718 (diff)
what's with the void* + casting
Change-Id: I4e04db86518b9a767da23dda3678002460f6f41d
-rw-r--r--sc/source/filter/inc/condformatbuffer.hxx6
-rw-r--r--sc/source/filter/inc/extlstcontext.hxx10
-rw-r--r--sc/source/filter/inc/worksheethelper.hxx4
-rw-r--r--sc/source/filter/oox/condformatbuffer.cxx10
-rw-r--r--sc/source/filter/oox/extlstcontext.cxx8
5 files changed, 21 insertions, 17 deletions
diff --git a/sc/source/filter/inc/condformatbuffer.hxx b/sc/source/filter/inc/condformatbuffer.hxx
index cdc2553d1053..b3dc63801b20 100644
--- a/sc/source/filter/inc/condformatbuffer.hxx
+++ b/sc/source/filter/inc/condformatbuffer.hxx
@@ -245,9 +245,9 @@ class ExtCfRule
};
ExCfRuleModel maModel;
RuleType mnRuleType;
- void* mpTarget;
+ ScDataBarFormatData* mpTarget;
public:
- ExtCfRule(void* pTarget = NULL ) : mnRuleType( ExtCfRule::UNKNOWN ), mpTarget(pTarget) {}
+ ExtCfRule(ScDataBarFormatData* pTarget = NULL ) : mnRuleType( ExtCfRule::UNKNOWN ), mpTarget(pTarget) {}
void finalizeImport();
void importDataBar( const AttributeList& rAttribs );
void importNegativeFillColor( const AttributeList& rAttribs );
@@ -268,7 +268,7 @@ public:
CondFormatRef importConditionalFormatting( const AttributeList& rAttribs );
/** Imports settings from the CONDFORMATTING record. */
CondFormatRef importCondFormatting( SequenceInputStream& rStrm );
- ExtCfRuleRef createExtCfRule( void* pTarget );
+ ExtCfRuleRef createExtCfRule(ScDataBarFormatData* pTarget);
/** Converts an OOXML condition operator token to the API constant. */
static sal_Int32 convertToApiOperator( sal_Int32 nToken );
diff --git a/sc/source/filter/inc/extlstcontext.hxx b/sc/source/filter/inc/extlstcontext.hxx
index 57675f2690ca..e9ebd264ebcc 100644
--- a/sc/source/filter/inc/extlstcontext.hxx
+++ b/sc/source/filter/inc/extlstcontext.hxx
@@ -13,19 +13,21 @@
#include "excelhandlers.hxx"
#include "worksheetfragment.hxx"
+class ScDataBarFormatData;
+
namespace oox {
namespace xls {
class ExtCfRuleContext : public WorksheetContextBase
{
public:
- explicit ExtCfRuleContext( WorksheetContextBase& rFragment, void* pDataBar );
+ explicit ExtCfRuleContext( WorksheetContextBase& rFragment, ScDataBarFormatData* pDataBar );
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) SAL_OVERRIDE;
virtual void onStartElement( const AttributeList& rAttribs ) SAL_OVERRIDE;
private:
- void* mpTarget;
+ ScDataBarFormatData* mpTarget;
bool mbFirstEntry;
};
@@ -41,7 +43,7 @@ private:
class ExtLstLocalContext : public WorksheetContextBase
{
public:
- explicit ExtLstLocalContext( WorksheetContextBase& rFragment, void* pTarget ); // until now a ExtLst always extends an existing entry
+ explicit ExtLstLocalContext( WorksheetContextBase& rFragment, ScDataBarFormatData* pTarget ); // until now a ExtLst always extends an existing entry
protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) SAL_OVERRIDE;
@@ -49,7 +51,7 @@ protected:
virtual void onCharacters( const OUString& rChars ) SAL_OVERRIDE;
private:
- void* mpTarget;
+ ScDataBarFormatData* mpTarget;
};
/**
diff --git a/sc/source/filter/inc/worksheethelper.hxx b/sc/source/filter/inc/worksheethelper.hxx
index a1bc389bf07a..4b7a927dc30a 100644
--- a/sc/source/filter/inc/worksheethelper.hxx
+++ b/sc/source/filter/inc/worksheethelper.hxx
@@ -26,6 +26,8 @@
#include "addressconverter.hxx"
#include "formulabase.hxx"
+class ScDataBarFormatData;
+
namespace com { namespace sun { namespace star {
namespace awt { struct Point; }
namespace awt { struct Rectangle; }
@@ -57,7 +59,7 @@ class SheetViewSettings;
class VmlDrawing;
class WorksheetSettings;
-typedef ::std::map< OUString, void* > ExtLst;
+typedef ::std::map< OUString, ScDataBarFormatData* > ExtLst;
typedef ::std::map< BinAddress, ApiTokenSequence > SharedFormulaMap;
diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx
index 3edac096a5d9..3b10686bdd27 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -1047,7 +1047,7 @@ CondFormatRef CondFormatBuffer::importCondFormatting( SequenceInputStream& rStrm
return xCondFmt;
}
-ExtCfRuleRef CondFormatBuffer::createExtCfRule( void* pTarget )
+ExtCfRuleRef CondFormatBuffer::createExtCfRule(ScDataBarFormatData* pTarget)
{
ExtCfRuleRef extRule( new ExtCfRule( pTarget ) );
maCfRules.push_back( extRule );
@@ -1104,7 +1104,7 @@ void ExtCfRule::finalizeImport()
{
case DATABAR:
{
- ScDataBarFormatData* pDataBar = static_cast<ScDataBarFormatData*>(mpTarget);
+ ScDataBarFormatData* pDataBar = mpTarget;
if( maModel.maAxisPosition == "none" )
pDataBar->meAxisPosition = databar::NONE;
else if( maModel.maAxisPosition == "middle" )
@@ -1116,19 +1116,19 @@ void ExtCfRule::finalizeImport()
}
case AXISCOLOR:
{
- ScDataBarFormatData* pDataBar = static_cast<ScDataBarFormatData*>(mpTarget);
+ ScDataBarFormatData* pDataBar = mpTarget;
pDataBar->maAxisColor = RgbToRgbComponents(maModel.mnAxisColor);
break;
}
case NEGATIVEFILLCOLOR:
{
- ScDataBarFormatData* pDataBar = static_cast<ScDataBarFormatData*>(mpTarget);
+ ScDataBarFormatData* pDataBar = mpTarget;
pDataBar->mpNegativeColor.reset( new ::Color( RgbToRgbComponents(maModel.mnNegativeColor) ) );
break;
}
case CFVO:
{
- ScDataBarFormatData* pDataBar = static_cast<ScDataBarFormatData*>(mpTarget);
+ ScDataBarFormatData* pDataBar = mpTarget;
ScColorScaleEntry* pEntry = NULL;
if(maModel.mbIsLower)
pEntry = pDataBar->mpLowerLimit.get();
diff --git a/sc/source/filter/oox/extlstcontext.cxx b/sc/source/filter/oox/extlstcontext.cxx
index 52a9e36000cc..4f8f0ff10461 100644
--- a/sc/source/filter/oox/extlstcontext.cxx
+++ b/sc/source/filter/oox/extlstcontext.cxx
@@ -18,7 +18,7 @@ using ::oox::core::ContextHandlerRef;
namespace oox {
namespace xls {
-ExtCfRuleContext::ExtCfRuleContext( WorksheetContextBase& rFragment, void* pTarget ):
+ExtCfRuleContext::ExtCfRuleContext( WorksheetContextBase& rFragment, ScDataBarFormatData* pTarget ):
WorksheetContextBase( rFragment ),
mpTarget( pTarget ),
mbFirstEntry(true)
@@ -65,7 +65,7 @@ void ExtCfRuleContext::onStartElement( const AttributeList& rAttribs )
}
}
-ExtLstLocalContext::ExtLstLocalContext( WorksheetContextBase& rFragment, void* pTarget ):
+ExtLstLocalContext::ExtLstLocalContext( WorksheetContextBase& rFragment, ScDataBarFormatData* pTarget ):
WorksheetContextBase(rFragment),
mpTarget(pTarget)
{
@@ -103,7 +103,7 @@ void ExtLstLocalContext::onCharacters( const OUString& rChars )
{
if (getCurrentElement() == XLS_EXT_TOKEN( id ))
{
- getExtLst().insert( std::pair< OUString, void*>(rChars, mpTarget) );
+ getExtLst().insert( std::pair< OUString, ScDataBarFormatData*>(rChars, mpTarget) );
}
}
@@ -127,7 +127,7 @@ ContextHandlerRef ExtGlobalContext::onCreateContext( sal_Int32 nElement, const A
if(aExt == getExtLst().end())
return NULL;
- void* pInfo = aExt->second;
+ ScDataBarFormatData* pInfo = aExt->second;
if (!pInfo)
{
return NULL;