summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-10-27 14:18:17 +0200
committerNoel Grandin <noel@peralex.com>2014-10-28 08:10:20 +0200
commitd9026e13578e6714b2847a9adc0c0563708a0c74 (patch)
treebc3f5e0cd877e4d7a303686ee7087f26e49befd0 /sc
parent1e21c77561b802bae4cb84631614f8aa612785a6 (diff)
loplugin: cstylecast
Change-Id: I47adf8a3fc72b4a043724ac40f3637b8dc3878be
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx8
-rw-r--r--sc/source/ui/attrdlg/attrdlg.cxx2
-rw-r--r--sc/source/ui/attrdlg/tabpages.cxx4
-rw-r--r--sc/source/ui/condformat/colorformat.cxx2
-rw-r--r--sc/source/ui/condformat/condformatdlgentry.cxx4
-rw-r--r--sc/source/ui/dbgui/consdlg.cxx8
-rw-r--r--sc/source/ui/dbgui/filtdlg.cxx6
-rw-r--r--sc/source/ui/dbgui/pfiltdlg.cxx6
-rw-r--r--sc/source/ui/dbgui/scendlg.cxx4
-rw-r--r--sc/source/ui/dbgui/sfiltdlg.cxx6
-rw-r--r--sc/source/ui/dbgui/tpsort.cxx16
-rw-r--r--sc/source/ui/dbgui/tpsubt.cxx18
-rw-r--r--sc/source/ui/dbgui/validate.cxx22
-rw-r--r--sc/source/ui/docshell/docfunc.cxx14
-rw-r--r--sc/source/ui/docshell/docsh.cxx28
-rw-r--r--sc/source/ui/docshell/docsh3.cxx30
-rw-r--r--sc/source/ui/docshell/docsh4.cxx70
-rw-r--r--sc/source/ui/docshell/docsh6.cxx4
-rw-r--r--sc/source/ui/docshell/tablink.cxx2
19 files changed, 127 insertions, 127 deletions
diff --git a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
index 905f409b5d7b..9e9b5c542f11 100644
--- a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
@@ -163,7 +163,7 @@ void ScRandomNumberGeneratorDialog::SetReference( const ScRange& rReferenceRange
void ScRandomNumberGeneratorDialog::SelectGeneratorAndGenerateNumbers()
{
sal_Int16 aSelectedIndex = mpDistributionCombo-> GetSelectEntryPos();
- sal_Int64 aSelectedId = (sal_Int64) mpDistributionCombo->GetEntryData(aSelectedIndex);
+ sal_Int64 aSelectedId = reinterpret_cast<sal_Int64>(mpDistributionCombo->GetEntryData(aSelectedIndex));
sal_uInt32 seedValue;
@@ -347,7 +347,7 @@ IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, LoseFocusHandler)
IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, Parameter1ValueModified)
{
sal_Int16 aSelectedIndex = mpDistributionCombo-> GetSelectEntryPos();
- sal_Int64 aSelectedId = (sal_Int64) mpDistributionCombo->GetEntryData(aSelectedIndex);
+ sal_Int64 aSelectedId = reinterpret_cast<sal_Int64>( mpDistributionCombo->GetEntryData(aSelectedIndex) );
if (aSelectedId == DIST_UNIFORM ||
aSelectedId == DIST_UNIFORM_INTEGER)
{
@@ -364,7 +364,7 @@ IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, Parameter1ValueModified)
IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, Parameter2ValueModified)
{
sal_Int16 aSelectedIndex = mpDistributionCombo-> GetSelectEntryPos();
- sal_Int64 aSelectedId = (sal_Int64) mpDistributionCombo->GetEntryData(aSelectedIndex);
+ sal_Int64 aSelectedId = reinterpret_cast<sal_Int64>( mpDistributionCombo->GetEntryData(aSelectedIndex) );
if (aSelectedId == DIST_UNIFORM ||
aSelectedId == DIST_UNIFORM_INTEGER)
{
@@ -388,7 +388,7 @@ IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, CheckChanged)
IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, DistributionChanged)
{
sal_Int16 aSelectedIndex = mpDistributionCombo-> GetSelectEntryPos();
- sal_Int64 aSelectedId = (sal_Int64) mpDistributionCombo->GetEntryData(aSelectedIndex);
+ sal_Int64 aSelectedId = reinterpret_cast<sal_Int64>( mpDistributionCombo->GetEntryData(aSelectedIndex) );
mpParameter1Value->SetMin(SAL_MIN_INT64);
mpParameter1Value->SetMax(SAL_MAX_INT64);
diff --git a/sc/source/ui/attrdlg/attrdlg.cxx b/sc/source/ui/attrdlg/attrdlg.cxx
index de389644c4d7..b6bb098af896 100644
--- a/sc/source/ui/attrdlg/attrdlg.cxx
+++ b/sc/source/ui/attrdlg/attrdlg.cxx
@@ -83,7 +83,7 @@ void ScAttrDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage )
OSL_ENSURE( pInfoItem, "FontListItem not found :-(" );
- aSet.Put (SvxFontListItem(((const SvxFontListItem*)pInfoItem)->GetFontList(), SID_ATTR_CHAR_FONTLIST ));
+ aSet.Put (SvxFontListItem(static_cast<const SvxFontListItem*>(pInfoItem)->GetFontList(), SID_ATTR_CHAR_FONTLIST ));
rTabPage.PageCreated(aSet);
}
}
diff --git a/sc/source/ui/attrdlg/tabpages.cxx b/sc/source/ui/attrdlg/tabpages.cxx
index 2989420dfbf8..5c4e6d1d5f5e 100644
--- a/sc/source/ui/attrdlg/tabpages.cxx
+++ b/sc/source/ui/attrdlg/tabpages.cxx
@@ -80,7 +80,7 @@ void ScTabPageProtection::Reset( const SfxItemSet* rCoreAttrs )
// Is this a Default-Item?
if ( eItemState == SfxItemState::DEFAULT )
- pProtAttr = (const ScProtectionAttr*)&(rCoreAttrs->Get(nWhich));
+ pProtAttr = static_cast<const ScProtectionAttr*>(&(rCoreAttrs->Get(nWhich)));
// At SfxItemState::DONTCARE let to 0
bTriEnabled = ( pProtAttr == NULL ); // TriState, when DontCare
@@ -131,7 +131,7 @@ bool ScTabPageProtection::FillItemSet( SfxItemSet* rCoreAttrs )
if ( bTriEnabled )
bAttrsChanged = true; // DontCare -> properly value
else
- bAttrsChanged = !pOldItem || !( aProtAttr == *(const ScProtectionAttr*)pOldItem );
+ bAttrsChanged = !pOldItem || !( aProtAttr == *static_cast<const ScProtectionAttr*>(pOldItem) );
}
if ( bAttrsChanged )
diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx
index 28815b1ed790..623c994ccb39 100644
--- a/sc/source/ui/condformat/colorformat.cxx
+++ b/sc/source/ui/condformat/colorformat.cxx
@@ -117,7 +117,7 @@ void ScDataBarSettingsDlg::Init()
{
const SfxPoolItem* pItem = pDocSh->GetItem( SID_COLOR_TABLE );
if ( pItem != NULL )
- pColorTable = ( (SvxColorListItem*)pItem )->GetColorList();
+ pColorTable = static_cast<const SvxColorListItem*>(pItem)->GetColorList();
}
if ( pColorTable.is() )
{
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index b45f23c20b82..10fd33fbbd8b 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -769,7 +769,7 @@ void ScColorScale2FrmtEntry::Init()
{
const SfxPoolItem* pItem = pDocSh->GetItem( SID_COLOR_TABLE );
if ( pItem != NULL )
- pColorTable = ( (SvxColorListItem*)pItem )->GetColorList();
+ pColorTable = static_cast<const SvxColorListItem*>(pItem) ->GetColorList();
}
if ( pColorTable.is() )
{
@@ -931,7 +931,7 @@ void ScColorScale3FrmtEntry::Init()
{
const SfxPoolItem* pItem = pDocSh->GetItem( SID_COLOR_TABLE );
if ( pItem != NULL )
- pColorTable = ( (SvxColorListItem*)pItem )->GetColorList();
+ pColorTable = static_cast<const SvxColorListItem*>(pItem)->GetColorList();
}
if ( pColorTable.is() )
{
diff --git a/sc/source/ui/dbgui/consdlg.cxx b/sc/source/ui/dbgui/consdlg.cxx
index 45b95629b48c..a8b6c737d010 100644
--- a/sc/source/ui/dbgui/consdlg.cxx
+++ b/sc/source/ui/dbgui/consdlg.cxx
@@ -63,13 +63,13 @@ ScConsolidateDlg::ScConsolidateDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::W
: ScAnyRefDlg ( pB, pCW, pParent, "ConsolidateDialog" , "modules/scalc/ui/consolidatedialog.ui" ),
aStrUndefined ( ScResId( SCSTR_UNDEFINED ) ),
- theConsData ( ((const ScConsolidateItem&)
+ theConsData ( static_cast<const ScConsolidateItem&>(
rArgSet.Get( rArgSet.GetPool()->
GetWhich( SID_CONSOLIDATE ) )
).GetData() ),
- rViewData ( ((ScTabViewShell*)SfxViewShell::Current())->
+ rViewData ( static_cast<ScTabViewShell*>(SfxViewShell::Current())->
GetViewData() ),
- pDoc ( ((ScTabViewShell*)SfxViewShell::Current())->
+ pDoc ( static_cast<ScTabViewShell*>(SfxViewShell::Current())->
GetViewData().GetDocument() ),
pRangeUtil ( new ScRangeUtil ),
pAreaData ( NULL ),
@@ -327,7 +327,7 @@ IMPL_LINK( ScConsolidateDlg, GetFocusHdl, Control*, pCtr )
if ( pCtr ==(Control*)pEdDataArea ||
pCtr ==(Control*)pEdDestArea)
{
- pRefInputEdit = (formula::RefEdit*)pCtr;
+ pRefInputEdit = static_cast<formula::RefEdit*>(pCtr);
}
else if(pCtr ==(Control*)pLbDataArea )
{
diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index 6951e3bbc377..f2776ed5a30d 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -60,7 +60,7 @@ ScFilterDlg::ScFilterDlg(SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pPar
, aStrColumn(SC_RESSTR(SCSTR_COLUMN))
, pOptionsMgr(NULL)
, nWhichQuery(rArgSet.GetPool()->GetWhich(SID_QUERY))
- , theQueryData(((const ScQueryItem&)rArgSet.Get(nWhichQuery)).GetQueryData())
+ , theQueryData(static_cast<const ScQueryItem&>(rArgSet.Get(nWhichQuery)).GetQueryData())
, pOutItem(NULL)
, pViewData(NULL)
, pDoc(NULL)
@@ -170,8 +170,8 @@ ScFilterDlg::~ScFilterDlg()
void ScFilterDlg::Init( const SfxItemSet& rArgSet )
{
- const ScQueryItem& rQueryItem = (const ScQueryItem&)
- rArgSet.Get( nWhichQuery );
+ const ScQueryItem& rQueryItem = static_cast<const ScQueryItem&>(
+ rArgSet.Get( nWhichQuery ));
pBtnOk->SetClickHdl ( LINK( this, ScFilterDlg, EndDlgHdl ) );
pBtnCancel->SetClickHdl ( LINK( this, ScFilterDlg, EndDlgHdl ) );
diff --git a/sc/source/ui/dbgui/pfiltdlg.cxx b/sc/source/ui/dbgui/pfiltdlg.cxx
index 30823d41ecc7..096c9c2e17dd 100644
--- a/sc/source/ui/dbgui/pfiltdlg.cxx
+++ b/sc/source/ui/dbgui/pfiltdlg.cxx
@@ -51,7 +51,7 @@ ScPivotFilterDlg::ScPivotFilterDlg(vcl::Window* pParent, const SfxItemSet& rArgS
aStrColumn ( SC_RESSTR(SCSTR_COLUMN) ),
nWhichQuery ( rArgSet.GetPool()->GetWhich( SID_QUERY ) ),
- theQueryData ( ((const ScQueryItem&)
+ theQueryData ( static_cast<const ScQueryItem&>(
rArgSet.Get( nWhichQuery )).GetQueryData() ),
pOutItem ( NULL ),
pViewData ( NULL ),
@@ -91,8 +91,8 @@ ScPivotFilterDlg::~ScPivotFilterDlg()
void ScPivotFilterDlg::Init( const SfxItemSet& rArgSet )
{
- const ScQueryItem& rQueryItem = (const ScQueryItem&)
- rArgSet.Get( nWhichQuery );
+ const ScQueryItem& rQueryItem = static_cast<const ScQueryItem&>(
+ rArgSet.Get( nWhichQuery ));
m_pBtnCase->SetClickHdl ( LINK( this, ScPivotFilterDlg, CheckBoxHdl ) );
diff --git a/sc/source/ui/dbgui/scendlg.cxx b/sc/source/ui/dbgui/scendlg.cxx
index 8c210054bc23..cd2b3a750fde 100644
--- a/sc/source/ui/dbgui/scendlg.cxx
+++ b/sc/source/ui/dbgui/scendlg.cxx
@@ -64,7 +64,7 @@ ScNewScenarioDlg::ScNewScenarioDlg( vcl::Window* pParent, const OUString& rName,
const SfxPoolItem* pItem = pDocSh->GetItem( SID_COLOR_TABLE );
if ( pItem )
{
- XColorListRef pColorList = ((SvxColorListItem*)pItem)->GetColorList();
+ XColorListRef pColorList = static_cast<const SvxColorListItem*>(pItem)->GetColorList();
if (pColorList.is())
{
m_pLbColor->SetUpdateMode( false );
@@ -147,7 +147,7 @@ void ScNewScenarioDlg::SetScenarioData( const OUString& rName, const OUString& r
IMPL_LINK_NOARG(ScNewScenarioDlg, OkHdl)
{
OUString aName = comphelper::string::strip(m_pEdName->GetText(), ' ');
- ScDocument* pDoc = ((ScTabViewShell*)SfxViewShell::Current())->GetViewData().GetDocument();
+ ScDocument* pDoc = static_cast<ScTabViewShell*>(SfxViewShell::Current())->GetViewData().GetDocument();
m_pEdName->SetText( aName );
diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx
index 4ca889b99426..5f1e33f848d9 100644
--- a/sc/source/ui/dbgui/sfiltdlg.cxx
+++ b/sc/source/ui/dbgui/sfiltdlg.cxx
@@ -50,7 +50,7 @@ ScSpecialFilterDlg::ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, vc
aStrUndefined ( SC_RESSTR(SCSTR_UNDEFINED) ),
pOptionsMgr ( NULL ),
nWhichQuery ( rArgSet.GetPool()->GetWhich( SID_QUERY ) ),
- theQueryData ( ((const ScQueryItem&)
+ theQueryData ( static_cast<const ScQueryItem&>(
rArgSet.Get( nWhichQuery )).GetQueryData() ),
pOutItem ( NULL ),
pViewData ( NULL ),
@@ -114,8 +114,8 @@ ScSpecialFilterDlg::~ScSpecialFilterDlg()
void ScSpecialFilterDlg::Init( const SfxItemSet& rArgSet )
{
- const ScQueryItem& rQueryItem = (const ScQueryItem&)
- rArgSet.Get( nWhichQuery );
+ const ScQueryItem& rQueryItem = static_cast<const ScQueryItem&>(
+ rArgSet.Get( nWhichQuery ));
pBtnOk->SetClickHdl ( LINK( this, ScSpecialFilterDlg, EndDlgHdl ) );
pBtnCancel->SetClickHdl ( LINK( this, ScSpecialFilterDlg, EndDlgHdl ) );
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 8b8a0a8375bd..b6e3a528c977 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -78,9 +78,9 @@ ScTabPageSortFields::ScTabPageSortFields(vcl::Window* pParent,
aStrRow ( SC_RESSTR( SCSTR_ROW ) ),
nWhichSort ( rArgSet.GetPool()->GetWhich( SID_SORT ) ),
- pDlg ( (ScSortDlg*)(GetParentDialog()) ),
+ pDlg ( static_cast<ScSortDlg*>(GetParentDialog()) ),
pViewData ( NULL ),
- aSortData ( ((const ScSortItem&)
+ aSortData ( static_cast<const ScSortItem&>(
rArgSet.Get( nWhichSort )).
GetSortData() ),
nFieldCount ( 0 ),
@@ -117,8 +117,8 @@ ScTabPageSortFields::~ScTabPageSortFields()
void ScTabPageSortFields::Init()
{
- const ScSortItem& rSortItem = (const ScSortItem&)
- GetItemSet().Get( nWhichSort );
+ const ScSortItem& rSortItem = static_cast<const ScSortItem&>(
+ GetItemSet().Get( nWhichSort ));
pViewData = rSortItem.GetViewData();
OSL_ENSURE( pViewData, "ViewData not found!" );
@@ -485,10 +485,10 @@ ScTabPageSortOptions::ScTabPageSortOptions( vcl::Window* pParent,
, aStrColLabel(SC_RESSTR(SCSTR_COL_LABEL))
, aStrUndefined(SC_RESSTR(SCSTR_UNDEFINED))
, nWhichSort(rArgSet.GetPool()->GetWhich(SID_SORT))
- , aSortData(((const ScSortItem&)rArgSet.Get(nWhichSort)).GetSortData())
+ , aSortData(static_cast<const ScSortItem&>(rArgSet.Get(nWhichSort)).GetSortData())
, pViewData(NULL)
, pDoc(NULL)
- , pDlg((ScSortDlg*)(GetParentDialog()))
+ , pDlg(static_cast<ScSortDlg*>(GetParentDialog()))
, pColRes( NULL )
, pColWrap( NULL )
{
@@ -533,8 +533,8 @@ void ScTabPageSortOptions::Init()
//! use CollatorWrapper from document?
pColWrap = new CollatorWrapper( comphelper::getProcessComponentContext() );
- const ScSortItem& rSortItem = (const ScSortItem&)
- GetItemSet().Get( nWhichSort );
+ const ScSortItem& rSortItem = static_cast<const ScSortItem&>(
+ GetItemSet().Get( nWhichSort ));
m_pLbOutPos->SetSelectHdl ( LINK( this, ScTabPageSortOptions, SelOutPosHdl ) );
m_pBtnCopyResult->SetClickHdl( LINK( this, ScTabPageSortOptions, EnableHdl ) );
diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx
index fcddba84506f..6febc35d7227 100644
--- a/sc/source/ui/dbgui/tpsubt.cxx
+++ b/sc/source/ui/dbgui/tpsubt.cxx
@@ -44,7 +44,7 @@ ScTpSubTotalGroup::ScTpSubTotalGroup( vcl::Window* pParent,
pViewData ( NULL ),
pDoc ( NULL ),
nWhichSubTotals ( rArgSet.GetPool()->GetWhich( SID_SUBTOTALS ) ),
- rSubTotalData ( ((const ScSubTotalItem&)
+ rSubTotalData ( static_cast<const ScSubTotalItem&>(
rArgSet.Get( nWhichSubTotals )).
GetSubTotalData() ),
nFieldCount ( 0 )
@@ -85,8 +85,8 @@ ScTpSubTotalGroup::~ScTpSubTotalGroup()
void ScTpSubTotalGroup::Init()
{
- const ScSubTotalItem& rSubTotalItem = (const ScSubTotalItem&)
- GetItemSet().Get( nWhichSubTotals );
+ const ScSubTotalItem& rSubTotalItem = static_cast<const ScSubTotalItem&>(
+ GetItemSet().Get( nWhichSubTotals ));
pViewData = rSubTotalItem.GetViewData();
pDoc = ( pViewData ) ? pViewData->GetDocument() : NULL;
@@ -122,7 +122,7 @@ bool ScTpSubTotalGroup::DoReset( sal_uInt16 nGroupNo,
}
mpLbFunctions->SelectEntryPos( 0 );
- ScSubTotalParam theSubTotalData( ((const ScSubTotalItem&)
+ ScSubTotalParam theSubTotalData( static_cast<const ScSubTotalItem&>(
rArgSet.Get( nWhichSubTotals )).
GetSubTotalData() );
@@ -187,7 +187,7 @@ bool ScTpSubTotalGroup::DoFillItemSet( sal_uInt16 nGroupNo,
const SfxItemSet* pExample = pDlg->GetExampleSet();
const SfxPoolItem* pItem;
if ( pExample && pExample->GetItemState( nWhichSubTotals, true, &pItem ) == SfxItemState::SET )
- theSubTotalData = ((const ScSubTotalItem*)pItem)->GetSubTotalData();
+ theSubTotalData = static_cast<const ScSubTotalItem*>(pItem)->GetSubTotalData();
}
boost::scoped_array<ScSubTotalFunc> pFunctions;
@@ -425,7 +425,7 @@ ScTpSubTotalOptions::ScTpSubTotalOptions( vcl::Window* pParent,
pViewData ( NULL ),
pDoc ( NULL ),
nWhichSubTotals ( rArgSet.GetPool()->GetWhich( SID_SUBTOTALS ) ),
- rSubTotalData ( ((const ScSubTotalItem&)
+ rSubTotalData ( static_cast<const ScSubTotalItem&>(
rArgSet.Get( nWhichSubTotals )).
GetSubTotalData() )
{
@@ -448,8 +448,8 @@ ScTpSubTotalOptions::~ScTpSubTotalOptions()
void ScTpSubTotalOptions::Init()
{
- const ScSubTotalItem& rSubTotalItem = (const ScSubTotalItem&)
- GetItemSet().Get( nWhichSubTotals );
+ const ScSubTotalItem& rSubTotalItem = static_cast<const ScSubTotalItem&>(
+ GetItemSet().Get( nWhichSubTotals ));
pViewData = rSubTotalItem.GetViewData();
pDoc = ( pViewData ) ? pViewData->GetDocument() : NULL;
@@ -502,7 +502,7 @@ bool ScTpSubTotalOptions::FillItemSet( SfxItemSet* rArgSet )
const SfxItemSet* pExample = pDlg->GetExampleSet();
const SfxPoolItem* pItem;
if ( pExample && pExample->GetItemState( nWhichSubTotals, true, &pItem ) == SfxItemState::SET )
- theSubTotalData = ((const ScSubTotalItem*)pItem)->GetSubTotalData();
+ theSubTotalData = static_cast<const ScSubTotalItem*>(pItem)->GetSubTotalData();
}
theSubTotalData.bPagebreak = pBtnPagebreak->IsChecked();
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index ca3333beb2d3..78f7a0f73b7e 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -492,10 +492,10 @@ void ScTPValidationValue::SetupRefDlg()
if( pValidationDlg->SetupRefDlg() )
{
pValidationDlg->SetHandler( this );
- pValidationDlg->SetSetRefHdl( (ScRefHandlerHelper::PFUNCSETREFHDLTYPE)( &ScTPValidationValue::SetReferenceHdl ) );
- pValidationDlg->SetSetActHdl( (ScRefHandlerHelper::PCOMMONHDLTYPE)( &ScTPValidationValue::SetActiveHdl ) );
- pValidationDlg->SetRefInputStartPreHdl( (ScRefHandlerHelper::PINPUTSTARTDLTYPE)( &ScTPValidationValue::RefInputStartPreHdl ) );
- pValidationDlg->SetRefInputDonePostHdl( (ScRefHandlerHelper::PCOMMONHDLTYPE)( &ScTPValidationValue::RefInputDonePostHdl ) );
+ pValidationDlg->SetSetRefHdl( static_cast<ScRefHandlerHelper::PFUNCSETREFHDLTYPE>( &ScTPValidationValue::SetReferenceHdl ) );
+ pValidationDlg->SetSetActHdl( static_cast<ScRefHandlerHelper::PCOMMONHDLTYPE>( &ScTPValidationValue::SetActiveHdl ) );
+ pValidationDlg->SetRefInputStartPreHdl( static_cast<ScRefHandlerHelper::PINPUTSTARTDLTYPE>( &ScTPValidationValue::RefInputStartPreHdl ) );
+ pValidationDlg->SetRefInputDonePostHdl( static_cast<ScRefHandlerHelper::PCOMMONHDLTYPE>( &ScTPValidationValue::RefInputDonePostHdl ) );
vcl::Window *pLabel = NULL;
@@ -672,17 +672,17 @@ void ScTPValidationHelp::Reset( const SfxItemSet* rArgSet )
const SfxPoolItem* pItem;
if ( rArgSet->GetItemState( FID_VALID_SHOWHELP, true, &pItem ) == SfxItemState::SET )
- pTsbHelp->SetState( ((const SfxBoolItem*)pItem)->GetValue() ? TRISTATE_TRUE : TRISTATE_FALSE );
+ pTsbHelp->SetState( static_cast<const SfxBoolItem*>(pItem)->GetValue() ? TRISTATE_TRUE : TRISTATE_FALSE );
else
pTsbHelp->SetState( TRISTATE_FALSE );
if ( rArgSet->GetItemState( FID_VALID_HELPTITLE, true, &pItem ) == SfxItemState::SET )
- pEdtTitle->SetText( ((const SfxStringItem*)pItem)->GetValue() );
+ pEdtTitle->SetText( static_cast<const SfxStringItem*>(pItem)->GetValue() );
else
pEdtTitle->SetText( EMPTY_OUSTRING );
if ( rArgSet->GetItemState( FID_VALID_HELPTEXT, true, &pItem ) == SfxItemState::SET )
- pEdInputHelp->SetText( ((const SfxStringItem*)pItem)->GetValue() );
+ pEdInputHelp->SetText( static_cast<const SfxStringItem*>(pItem)->GetValue() );
else
pEdInputHelp->SetText( EMPTY_OUSTRING );
}
@@ -742,22 +742,22 @@ void ScTPValidationError::Reset( const SfxItemSet* rArgSet )
const SfxPoolItem* pItem;
if ( rArgSet->GetItemState( FID_VALID_SHOWERR, true, &pItem ) == SfxItemState::SET )
- m_pTsbShow->SetState( ((const SfxBoolItem*)pItem)->GetValue() ? TRISTATE_TRUE : TRISTATE_FALSE );
+ m_pTsbShow->SetState( static_cast<const SfxBoolItem*>(pItem)->GetValue() ? TRISTATE_TRUE : TRISTATE_FALSE );
else
m_pTsbShow->SetState( TRISTATE_TRUE ); // check by default
if ( rArgSet->GetItemState( FID_VALID_ERRSTYLE, true, &pItem ) == SfxItemState::SET )
- m_pLbAction->SelectEntryPos( ((const SfxAllEnumItem*)pItem)->GetValue() );
+ m_pLbAction->SelectEntryPos( static_cast<const SfxAllEnumItem*>(pItem)->GetValue() );
else
m_pLbAction->SelectEntryPos( 0 );
if ( rArgSet->GetItemState( FID_VALID_ERRTITLE, true, &pItem ) == SfxItemState::SET )
- m_pEdtTitle->SetText( ((const SfxStringItem*)pItem)->GetValue() );
+ m_pEdtTitle->SetText( static_cast<const SfxStringItem*>(pItem)->GetValue() );
else
m_pEdtTitle->SetText( EMPTY_OUSTRING );
if ( rArgSet->GetItemState( FID_VALID_ERRTEXT, true, &pItem ) == SfxItemState::SET )
- m_pEdError->SetText( ((const SfxStringItem*)pItem)->GetValue() );
+ m_pEdError->SetText( static_cast<const SfxStringItem*>(pItem)->GetValue() );
else
m_pEdError->SetText( EMPTY_OUSTRING );
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 778e29438698..1d5a94f05f41 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -804,7 +804,7 @@ bool ScDocFunc::SetNormalString( bool& o_rbNumFmtSet, const ScAddress& rPos, con
ATTR_VALUE_FORMAT,false,&pItem) )
{
aOldValue.mbHasFormat = true;
- aOldValue.mnFormat = ((const SfxUInt32Item*)pItem)->GetValue();
+ aOldValue.mnFormat = static_cast<const SfxUInt32Item*>(pItem)->GetValue();
}
else
aOldValue.mbHasFormat = false;
@@ -1409,8 +1409,8 @@ bool ScDocFunc::ApplyStyle( const ScMarkData& rMark, const OUString& rStyleName,
return false;
}
- ScStyleSheet* pStyleSheet = (ScStyleSheet*) rDoc.GetStyleSheetPool()->Find(
- rStyleName, SFX_STYLE_FAMILY_PARA );
+ ScStyleSheet* pStyleSheet = static_cast<ScStyleSheet*>( rDoc.GetStyleSheetPool()->Find(
+ rStyleName, SFX_STYLE_FAMILY_PARA ));
if (!pStyleSheet)
return false;
@@ -1817,8 +1817,8 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
const ScMergeFlagAttr* pMergeFlagAttr = NULL;
while ( ( pPattern = aTestIter.GetNext( nTestCol, nTestRow1, nTestRow2 ) ) != NULL )
{
- pMergeFlag = (const ScMergeAttr*) &pPattern->GetItem(ATTR_MERGE);
- pMergeFlagAttr = (const ScMergeFlagAttr*) &pPattern->GetItem(ATTR_MERGE_FLAG);
+ pMergeFlag = static_cast<const ScMergeAttr*>( &pPattern->GetItem(ATTR_MERGE) );
+ pMergeFlagAttr = static_cast<const ScMergeFlagAttr*>( &pPattern->GetItem(ATTR_MERGE_FLAG) );
sal_Int16 nNewFlags = pMergeFlagAttr->GetValue() & ( SC_MF_HOR | SC_MF_VER );
if( ( pMergeFlag && pMergeFlag->IsMerged() ) || nNewFlags == SC_MF_HOR || nNewFlags == SC_MF_VER )
{
@@ -2229,8 +2229,8 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
const ScMergeFlagAttr* pMergeFlagAttr = NULL;
while ( ( pPattern = aTestIter.GetNext( nTestCol, nTestRow1, nTestRow2 ) ) != NULL )
{
- pMergeFlag = (const ScMergeAttr*) &pPattern->GetItem( ATTR_MERGE );
- pMergeFlagAttr = (const ScMergeFlagAttr*) &pPattern->GetItem( ATTR_MERGE_FLAG );
+ pMergeFlag = static_cast<const ScMergeAttr*>( &pPattern->GetItem( ATTR_MERGE ) );
+ pMergeFlagAttr = static_cast<const ScMergeFlagAttr*>( &pPattern->GetItem( ATTR_MERGE_FLAG ) );
sal_Int16 nNewFlags = pMergeFlagAttr->GetValue() & ( SC_MF_HOR | SC_MF_VER );
if( ( pMergeFlag && pMergeFlag->IsMerged() ) || nNewFlags == SC_MF_HOR || nNewFlags == SC_MF_VER )
{
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 0db4a22e40ec..84fd54c89d6f 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -644,7 +644,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
// modifying the document must be asynchronous
// (handled by AddInitial)
- ScAutoStyleHint& rStlHint = (ScAutoStyleHint&)rHint;
+ const ScAutoStyleHint& rStlHint = static_cast<const ScAutoStyleHint&>(rHint);
ScRange aRange = rStlHint.GetRange();
OUString aName1 = rStlHint.GetStyle1();
OUString aName2 = rStlHint.GetStyle2();
@@ -1094,7 +1094,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
if ( pSet && SfxItemState::SET ==
pSet->GetItemState( SID_FILE_FILTEROPTIONS, true, &pItem ) )
{
- sItStr = ((const SfxStringItem*)pItem)->GetValue();
+ sItStr = static_cast<const SfxStringItem*>(pItem)->GetValue();
}
if (sItStr.isEmpty())
@@ -1167,7 +1167,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
if ( pSet && SfxItemState::SET ==
pSet->GetItemState( SID_FILE_FILTEROPTIONS, true, &pItem ) )
{
- aOptions.ReadFromString( ((const SfxStringItem*)pItem)->GetValue() );
+ aOptions.ReadFromString( static_cast<const SfxStringItem*>(pItem)->GetValue() );
bOptInit = true;
}
@@ -1236,7 +1236,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
if ( pSet && SfxItemState::SET ==
pSet->GetItemState( SID_FILE_FILTEROPTIONS, true, &pItem ) )
{
- sItStr = ((const SfxStringItem*)pItem)->GetValue();
+ sItStr = static_cast<const SfxStringItem*>(pItem)->GetValue();
}
if (sItStr.isEmpty())
@@ -1277,7 +1277,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
if ( pSet && SfxItemState::SET ==
pSet->GetItemState( SID_FILE_FILTEROPTIONS, true, &pItem ) )
{
- sItStr = ((const SfxStringItem*)pItem)->GetValue();
+ sItStr = static_cast<const SfxStringItem*>(pItem)->GetValue();
}
if (sItStr.isEmpty())
@@ -1936,8 +1936,8 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
if ( bTabProtect )
{
const ScProtectionAttr* pProtAttr =
- (const ScProtectionAttr*) aDocument.GetAttr(
- nCol, nRow, nTab, ATTR_PROTECTION );
+ static_cast<const ScProtectionAttr*>( aDocument.GetAttr(
+ nCol, nRow, nTab, ATTR_PROTECTION ));
if ( pProtAttr->GetHideCell() ||
( eType == CELLTYPE_FORMULA && bShowFormulas &&
pProtAttr->GetHideFormula() ) )
@@ -2038,7 +2038,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
if ( bFixedWidth )
{
SvxCellHorJustify eHorJust = (SvxCellHorJustify)
- ((const SvxHorJustifyItem*) aDocument.GetAttr( nCol, nRow,
+ static_cast<const SvxHorJustifyItem*>( aDocument.GetAttr( nCol, nRow,
nTab, ATTR_HOR_JUSTIFY ))->GetValue();
lcl_ScDocShell_GetFixedWidthString( aString, aDocument, nTab, nCol,
!bString, eHorJust );
@@ -2276,7 +2276,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
if ( pSet && SfxItemState::SET ==
pSet->GetItemState( SID_FILE_FILTEROPTIONS, true, &pItem ) )
{
- sItStr = ((const SfxStringItem*)pItem)->GetValue();
+ sItStr = static_cast<const SfxStringItem*>(pItem)->GetValue();
}
if ( sItStr.isEmpty() )
@@ -2306,7 +2306,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
if ( pSet && SfxItemState::SET ==
pSet->GetItemState( SID_FILE_FILTEROPTIONS, true, &pItem ) )
{
- sCharSet = ((const SfxStringItem*)pItem)->GetValue();
+ sCharSet = static_cast<const SfxStringItem*>(pItem)->GetValue();
}
if (sCharSet.isEmpty())
@@ -2345,8 +2345,8 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
bRet = true;
if ( bHasMemo )
{
- SfxStringItem* pNameItem =
- (SfxStringItem*) rMed.GetItemSet()->GetItem( SID_FILE_NAME );
+ const SfxStringItem* pNameItem =
+ static_cast<const SfxStringItem*>( rMed.GetItemSet()->GetItem( SID_FILE_NAME ) );
INetURLObject aDbtFile( pNameItem->GetValue(), INET_PROT_FILE );
aDbtFile.setExtension(OUString("dbt"));
if ( IsDocument( aDbtFile ) && !KillFile( aDbtFile ) )
@@ -2373,7 +2373,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
if ( pSet && SfxItemState::SET ==
pSet->GetItemState( SID_FILE_FILTEROPTIONS, true, &pItem ) )
{
- sItStr = ((const SfxStringItem*)pItem)->GetValue();
+ sItStr = static_cast<const SfxStringItem*>(pItem)->GetValue();
}
if (sItStr.isEmpty())
@@ -2421,7 +2421,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
OUString sFilterOptions;
if (pSet->GetItemState(SID_FILE_FILTEROPTIONS, true, &pItem) == SfxItemState::SET)
- sFilterOptions = ((SfxStringItem*)pItem)->GetValue();
+ sFilterOptions = static_cast<const SfxStringItem*>(pItem)->GetValue();
WaitObject aWait(GetActiveDialogParent());
ScImportExport aImExport(&aDocument);
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 74ed3063c01e..950664ac7f18 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -353,8 +353,8 @@ void ScDocShell::CalcOutputFactor()
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789");
long nPrinterWidth = 0;
long nWindowWidth = 0;
- const ScPatternAttr* pPattern = (const ScPatternAttr*)&aDocument.GetPool()->
- GetDefaultItem(ATTR_PATTERN);
+ const ScPatternAttr* pPattern = static_cast<const ScPatternAttr*>(&aDocument.GetPool()->
+ GetDefaultItem(ATTR_PATTERN));
vcl::Font aDefFont;
OutputDevice* pRefDev = GetRefDevice();
@@ -482,7 +482,7 @@ sal_uInt16 ScDocShell::SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlag
SfxViewShell* pSh = pFrame->GetViewShell();
if (pSh && pSh->ISA(ScTabViewShell))
{
- ScTabViewShell* pViewSh = (ScTabViewShell*)pSh;
+ ScTabViewShell* pViewSh = static_cast<ScTabViewShell*>(pSh);
ScInputHandler* pInputHdl = pScMod->GetInputHdl(pViewSh);
if (pInputHdl)
pInputHdl->UpdateRefDevice();
@@ -515,14 +515,14 @@ sal_uInt16 ScDocShell::SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlag
{
OUString aStyle = aDocument.GetPageStyle( GetCurTab() );
ScStyleSheetPool* pStPl = aDocument.GetStyleSheetPool();
- SfxStyleSheet* pStyleSheet = (SfxStyleSheet*)pStPl->Find(aStyle, SFX_STYLE_FAMILY_PAGE);
+ SfxStyleSheet* pStyleSheet = static_cast<SfxStyleSheet*>(pStPl->Find(aStyle, SFX_STYLE_FAMILY_PAGE));
if (pStyleSheet)
{
SfxItemSet& rSet = pStyleSheet->GetItemSet();
if (nDiffFlags & SFX_PRINTER_CHG_ORIENTATION)
{
- const SvxPageItem& rOldItem = (const SvxPageItem&)rSet.Get(ATTR_PAGE);
+ const SvxPageItem& rOldItem = static_cast<const SvxPageItem&>(rSet.Get(ATTR_PAGE));
bool bWasLand = rOldItem.IsLandscape();
bool bNewLand = ( pNewPrinter->GetOrientation() == ORIENTATION_LANDSCAPE );
if (bNewLand != bWasLand)
@@ -532,7 +532,7 @@ sal_uInt16 ScDocShell::SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlag
rSet.Put( aNewItem );
// Groesse umdrehen
- Size aOldSize = ((const SvxSizeItem&)rSet.Get(ATTR_PAGE_SIZE)).GetSize();
+ Size aOldSize = static_cast<const SvxSizeItem&>(rSet.Get(ATTR_PAGE_SIZE)).GetSize();
Size aNewSize(aOldSize.Height(),aOldSize.Width());
SvxSizeItem aNewSItem(ATTR_PAGE_SIZE,aNewSize);
rSet.Put( aNewSItem );
@@ -587,7 +587,7 @@ ScChangeAction* ScDocShell::GetChangeAction( const ScAddress& rPos )
if ( pAction->GetType() == SC_CAT_MOVE )
{
ScRange aRange =
- ((const ScChangeActionMove*)pAction)->
+ static_cast<const ScChangeActionMove*>(pAction)->
GetFromRange().MakeRange();
if ( aRange.In( rPos ) )
{
@@ -846,7 +846,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
case SC_CAT_DELETE_ROWS :
case SC_CAT_DELETE_TABS :
{
- const ScChangeActionDel* pDel = (const ScChangeActionDel*) pThisAction;
+ const ScChangeActionDel* pDel = static_cast<const ScChangeActionDel*>(pThisAction);
if ( pDel->IsTopDelete() && !pDel->IsTabDeleteCol() )
{ // deleted Table enthaelt deleted Cols, die nicht
sal_uLong nStart, nEnd;
@@ -857,7 +857,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
break;
case SC_CAT_MOVE :
{
- const ScChangeActionMove* pMove = (const ScChangeActionMove*) pThisAction;
+ const ScChangeActionMove* pMove = static_cast<const ScChangeActionMove*>(pThisAction);
pSourceTrack->AppendMove( pMove->GetFromRange().MakeRange(),
pMove->GetBigRange().MakeRange(), NULL );
}
@@ -913,7 +913,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
#if OSL_DEBUG_LEVEL > 0
OUString aValue;
if ( eSourceType == SC_CAT_CONTENT )
- ((const ScChangeActionContent*)pSourceAction)->GetNewString( aValue, &aDocument );
+ static_cast<const ScChangeActionContent*>(pSourceAction)->GetNewString( aValue, &aDocument );
OStringBuffer aError(OUStringToOString(aValue,
osl_getThreadTextEncoding()));
aError.append(" weggelassen");
@@ -978,9 +978,9 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
OSL_ENSURE( aSourceRange.aStart == aSourceRange.aEnd, "huch?" );
ScAddress aPos = aSourceRange.aStart;
OUString aValue;
- ((const ScChangeActionContent*)pSourceAction)->GetNewString( aValue, &aDocument );
+ static_cast<const ScChangeActionContent*>(pSourceAction)->GetNewString( aValue, &aDocument );
sal_uInt8 eMatrix = MM_NONE;
- const ScCellValue& rCell = ((const ScChangeActionContent*)pSourceAction)->GetNewCell();
+ const ScCellValue& rCell = static_cast<const ScChangeActionContent*>(pSourceAction)->GetNewCell();
if (rCell.meType == CELLTYPE_FORMULA)
eMatrix = rCell.mpFormula->GetMatrixFlag();
switch ( eMatrix )
@@ -1030,7 +1030,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
break;
case SC_CAT_DELETE_ROWS:
{
- const ScChangeActionDel* pDel = (const ScChangeActionDel*) pSourceAction;
+ const ScChangeActionDel* pDel = static_cast<const ScChangeActionDel*>(pSourceAction);
if ( pDel->IsTopDelete() )
{
aSourceRange = pDel->GetOverAllRange().MakeRange();
@@ -1050,7 +1050,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
break;
case SC_CAT_DELETE_COLS:
{
- const ScChangeActionDel* pDel = (const ScChangeActionDel*) pSourceAction;
+ const ScChangeActionDel* pDel = static_cast<const ScChangeActionDel*>(pSourceAction);
if ( pDel->IsTopDelete() && !pDel->IsTabDeleteCol() )
{ // deleted Table enthaelt deleted Cols, die nicht
aSourceRange = pDel->GetOverAllRange().MakeRange();
@@ -1060,7 +1060,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
break;
case SC_CAT_MOVE :
{
- const ScChangeActionMove* pMove = (const ScChangeActionMove*) pSourceAction;
+ const ScChangeActionMove* pMove = static_cast<const ScChangeActionMove*>(pSourceAction);
ScRange aFromRange( pMove->GetFromRange().MakeRange() );
GetDocFunc().MoveBlock( aFromRange,
aSourceRange.aStart, true, true, false, false );
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index a3dce4dbccec..948e170dffd0 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -100,13 +100,13 @@ using namespace ::com::sun::star;
#include <boost/scoped_ptr.hpp>
#define IS_SHARE_HEADER(set) \
- ((SfxBoolItem&) \
- ((SvxSetItem&)(set).Get(ATTR_PAGE_HEADERSET)).GetItemSet(). \
+ static_cast<const SfxBoolItem&>( \
+ static_cast<const SvxSetItem&>((set).Get(ATTR_PAGE_HEADERSET)).GetItemSet(). \
Get(ATTR_PAGE_SHARED)).GetValue()
#define IS_SHARE_FOOTER(set) \
- ((SfxBoolItem&) \
- ((SvxSetItem&)(set).Get(ATTR_PAGE_FOOTERSET)).GetItemSet(). \
+ static_cast<const SfxBoolItem&>( \
+ static_cast<const SvxSetItem&>((set).Get(ATTR_PAGE_FOOTERSET)).GetItemSet(). \
Get(ATTR_PAGE_SHARED)).GetValue()
#define SC_PREVIEW_SIZE_X 10000
@@ -137,16 +137,16 @@ void ScDocShell::Execute( SfxRequest& rReq )
pReqArgs->HasItem( SID_SC_SETTEXT, &pTextItem ) )
{
// Parameter sind 1-based !!!
- SCCOL nCol = ((SfxInt16Item*)pColItem)->GetValue() - 1;
- SCROW nRow = ((SfxInt32Item*)pRowItem)->GetValue() - 1;
- SCTAB nTab = ((SfxInt16Item*)pTabItem)->GetValue() - 1;
+ SCCOL nCol = static_cast<const SfxInt16Item*>(pColItem)->GetValue() - 1;
+ SCROW nRow = static_cast<const SfxInt32Item*>(pRowItem)->GetValue() - 1;
+ SCTAB nTab = static_cast<const SfxInt16Item*>(pTabItem)->GetValue() - 1;
SCTAB nTabCount = aDocument.GetTableCount();
if ( ValidCol(nCol) && ValidRow(nRow) && ValidTab(nTab,nTabCount) )
{
if ( aDocument.IsBlockEditable( nTab, nCol,nRow, nCol, nRow ) )
{
- OUString aVal = ((const SfxStringItem*)pTextItem)->GetValue();
+ OUString aVal = static_cast<const SfxStringItem*>(pTextItem)->GetValue();
aDocument.SetString( nCol, nRow, nTab, aVal );
PostPaintCell( nCol, nRow, nTab );
@@ -186,11 +186,11 @@ void ScDocShell::Execute( SfxRequest& rReq )
OUString sTarget;
if ( pReqArgs->GetItemState( FN_PARAM_1, true, &pItem ) == SfxItemState::SET )
- sTarget = ((const SfxStringItem*)pItem)->GetValue();
+ sTarget = static_cast<const SfxStringItem*>(pItem)->GetValue();
bool bIsNewArea = true; // Default sal_True (keine Nachfrage)
if ( pReqArgs->GetItemState( FN_PARAM_2, true, &pItem ) == SfxItemState::SET )
- bIsNewArea = ((const SfxBoolItem*)pItem)->GetValue();
+ bIsNewArea = static_cast<const SfxBoolItem*>(pItem)->GetValue();
// bei Bedarf neuen Datenbankbereich anlegen
bool bMakeArea = false;
@@ -268,19 +268,19 @@ void ScDocShell::Execute( SfxRequest& rReq )
bool bAddRange = (nSlot == SID_CHART_ADDSOURCE);
if( pReqArgs->HasItem( SID_CHART_NAME, &pItem ) )
- aChartName = ((const SfxStringItem*)pItem)->GetValue();
+ aChartName = static_cast<const SfxStringItem*>(pItem)->GetValue();
if( pReqArgs->HasItem( SID_CHART_SOURCE, &pItem ) )
- aRangeName = ((const SfxStringItem*)pItem)->GetValue();
+ aRangeName = static_cast<const SfxStringItem*>(pItem)->GetValue();
if( pReqArgs->HasItem( FN_PARAM_1, &pItem ) )
{
- bColHeaders = ((const SfxBoolItem*)pItem)->GetValue();
+ bColHeaders = static_cast<const SfxBoolItem*>(pItem)->GetValue();
bColInit = true;
}
if( pReqArgs->HasItem( FN_PARAM_2, &pItem ) )
{
- bRowHeaders = ((const SfxBoolItem*)pItem)->GetValue();
+ bRowHeaders = static_cast<const SfxBoolItem*>(pItem)->GetValue();
bRowInit = true;
}
@@ -386,7 +386,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
bool bNewVal;
const SfxPoolItem* pItem;
if ( pReqArgs && SfxItemState::SET == pReqArgs->GetItemState( nSlot, true, &pItem ) )
- bNewVal = ((const SfxBoolItem*)pItem)->GetValue();
+ bNewVal = static_cast<const SfxBoolItem*>(pItem)->GetValue();
else
bNewVal = !aDocument.GetAutoCalc(); // Toggle fuer Menue
aDocument.SetAutoCalc( bNewVal );
@@ -547,7 +547,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
case SID_GET_COLORLIST:
{
- SvxColorListItem* pColItem = (SvxColorListItem*)GetItem(SID_COLOR_TABLE);
+ const SvxColorListItem* pColItem = static_cast<const SvxColorListItem*>(GetItem(SID_COLOR_TABLE));
XColorListRef pList = pColItem->GetColorList();
rReq.SetReturnValue(OfaRefItem<XColorList>(SID_GET_COLORLIST, pList));
}
@@ -565,7 +565,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
vcl::Window* pParent = NULL;
const SfxPoolItem* pParentItem;
if( pReqArgs && SfxItemState::SET == pReqArgs->GetItemState( SID_ATTR_XWINDOW, false, &pParentItem ) )
- pParent = ( ( const XWindowItem* ) pParentItem )->GetWindowPtr();
+ pParent = static_cast<const XWindowItem*>( pParentItem )->GetWindowPtr();
// desired state
ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
@@ -624,7 +624,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
vcl::Window* pParent = NULL;
const SfxPoolItem* pParentItem;
if( pReqArgs && SfxItemState::SET == pReqArgs->GetItemState( SID_ATTR_XWINDOW, false, &pParentItem ) )
- pParent = ( ( const XWindowItem* ) pParentItem )->GetWindowPtr();
+ pParent = static_cast<const XWindowItem*>( pParentItem )->GetWindowPtr();
if ( ExecuteChangeProtectionDialog( pParent ) )
{
rReq.Done();
@@ -807,7 +807,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
{
if ( pItem->ISA(SfxStringItem) )
{
- OUString aName = ((const SfxStringItem*)pItem)->GetValue();
+ OUString aName = static_cast<const SfxStringItem*>(pItem)->GetValue();
SCTAB nTab;
if (aDocument.GetTable( aName, nTab ))
{
@@ -835,7 +835,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
{
if ( pItem->ISA(SfxStringItem) )
{
- OUString aName = ((const SfxStringItem*)pItem)->GetValue();
+ OUString aName = static_cast<const SfxStringItem*>(pItem)->GetValue();
SCTAB nTab;
if (aDocument.GetTable( aName, nTab ))
{
@@ -883,7 +883,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
{
if ( pItem->ISA(SfxUInt16Item) )
{
- sal_uInt16 nY2k = ((SfxUInt16Item*)pItem)->GetValue();
+ sal_uInt16 nY2k = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
// immer an den DocOptions setzen, damit das auch fuer SO50
// gespeichert wird (und alle Abfragen bisher auch darauf laufen).
// SetDocOptions propagiert das an den NumberFormatter
@@ -1112,7 +1112,7 @@ void UpdateAcceptChangesDialog()
{
SfxChildWindow* pChild = pViewFrm->GetChildWindow( FID_CHG_ACCEPT );
if ( pChild )
- ((ScAcceptChgDlgWrapper*)pChild)->ReInitDlg();
+ static_cast<ScAcceptChgDlgWrapper*>(pChild)->ReInitDlg();
}
}
@@ -1260,8 +1260,8 @@ void ScDocShell::DoAutoStyle( const ScRange& rRange, const OUString& rStyle )
ScStyleSheet* pStyleSheet =
pStylePool->FindCaseIns( rStyle, SFX_STYLE_FAMILY_PARA );
if (!pStyleSheet)
- pStyleSheet = (ScStyleSheet*)
- pStylePool->Find( ScGlobal::GetRscString(STR_STYLENAME_STANDARD), SFX_STYLE_FAMILY_PARA );
+ pStyleSheet = static_cast<ScStyleSheet*>(
+ pStylePool->Find( ScGlobal::GetRscString(STR_STYLENAME_STANDARD), SFX_STYLE_FAMILY_PARA ));
if (pStyleSheet)
{
OSL_ENSURE(rRange.aStart.Tab() == rRange.aEnd.Tab(),
@@ -1365,8 +1365,8 @@ void ScDocShell::SetPrintZoom( SCTAB nTab, sal_uInt16 nScale, sal_uInt16 nPages
SfxItemSet& rSet = pStyleSheet->GetItemSet();
if (bUndo)
{
- sal_uInt16 nOldScale = ((const SfxUInt16Item&)rSet.Get(ATTR_PAGE_SCALE)).GetValue();
- sal_uInt16 nOldPages = ((const SfxUInt16Item&)rSet.Get(ATTR_PAGE_SCALETOPAGES)).GetValue();
+ sal_uInt16 nOldScale = static_cast<const SfxUInt16Item&>(rSet.Get(ATTR_PAGE_SCALE)).GetValue();
+ sal_uInt16 nOldPages = static_cast<const SfxUInt16Item&>(rSet.Get(ATTR_PAGE_SCALETOPAGES)).GetValue();
GetUndoManager()->AddUndoAction( new ScUndoPrintZoom(
this, nTab, nOldScale, nOldPages, nScale, nPages ) );
}
@@ -1396,9 +1396,9 @@ bool ScDocShell::AdjustPrintZoom( const ScRange& rRange )
if ( pStyleSheet )
{
SfxItemSet& rSet = pStyleSheet->GetItemSet();
- bool bHeaders = ((const SfxBoolItem&)rSet.Get(ATTR_PAGE_HEADERS)).GetValue();
- sal_uInt16 nOldScale = ((const SfxUInt16Item&)rSet.Get(ATTR_PAGE_SCALE)).GetValue();
- sal_uInt16 nOldPages = ((const SfxUInt16Item&)rSet.Get(ATTR_PAGE_SCALETOPAGES)).GetValue();
+ bool bHeaders = static_cast<const SfxBoolItem&>(rSet.Get(ATTR_PAGE_HEADERS)).GetValue();
+ sal_uInt16 nOldScale = static_cast<const SfxUInt16Item&>(rSet.Get(ATTR_PAGE_SCALE)).GetValue();
+ sal_uInt16 nOldPages = static_cast<const SfxUInt16Item&>(rSet.Get(ATTR_PAGE_SCALETOPAGES)).GetValue();
const ScRange* pRepeatCol = aDocument.GetRepeatColRange( nTab );
const ScRange* pRepeatRow = aDocument.GetRepeatRowRange( nTab );
@@ -1608,7 +1608,7 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller,
SfxItemSet& rStyleSet = pStyleSheet->GetItemSet();
SvxPageUsage eUsage =
- SvxPageUsage( ((const SvxPageItem&)
+ SvxPageUsage( static_cast<const SvxPageItem&>(
rStyleSet.Get( ATTR_PAGE )).
GetPageUsage() );
bool bShareHeader = IS_SHARE_HEADER(rStyleSet);
@@ -2042,13 +2042,13 @@ void ScDocShell::GetPageOnFromPageStyleSet( const SfxItemSet* pStyleSet,
const SvxSetItem* pSetItem = NULL;
const SfxItemSet* pSet = NULL;
- pSetItem = (const SvxSetItem*) &pStyleSet->Get( ATTR_PAGE_HEADERSET );
+ pSetItem = static_cast<const SvxSetItem*>( &pStyleSet->Get( ATTR_PAGE_HEADERSET ) );
pSet = &pSetItem->GetItemSet();
- rbHeader = ((const SfxBoolItem&)pSet->Get(ATTR_PAGE_ON)).GetValue();
+ rbHeader = static_cast<const SfxBoolItem&>(pSet->Get(ATTR_PAGE_ON)).GetValue();
- pSetItem = (const SvxSetItem*) &pStyleSet->Get( ATTR_PAGE_FOOTERSET );
+ pSetItem = static_cast<const SvxSetItem*>( &pStyleSet->Get( ATTR_PAGE_FOOTERSET ) );
pSet = &pSetItem->GetItemSet();
- rbFooter = ((const SfxBoolItem&)pSet->Get(ATTR_PAGE_ON)).GetValue();
+ rbFooter = static_cast<const SfxBoolItem&>(pSet->Get(ATTR_PAGE_ON)).GetValue();
}
bool ScDocShell::DdeGetData( const OUString& rItem,
@@ -2229,7 +2229,7 @@ ScDocShell* ScDocShell::GetShellByNum( sal_uInt16 nDocNo ) // static
if ( pShell->Type() == TYPE(ScDocShell) )
{
if ( nShellCnt == nDocNo )
- pFound = (ScDocShell*) pShell;
+ pFound = static_cast<ScDocShell*>(pShell);
else
++nShellCnt;
}
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index 61f97e60cee9..e4cd4b53515d 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -234,14 +234,14 @@ static void lcl_AdjustPool( SfxStyleSheetBasePool* pStylePool )
const SfxPoolItem* pItem;
if (rStyleSet.GetItemState(ATTR_PAGE_HEADERSET,false,&pItem) == SfxItemState::SET)
{
- SfxItemSet& rSrcSet = ((SvxSetItem*)pItem)->GetItemSet();
+ const SfxItemSet& rSrcSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet();
SfxItemSet* pDestSet = new SfxItemSet(*rStyleSet.GetPool(),rSrcSet.GetRanges());
pDestSet->Put(rSrcSet);
rStyleSet.Put(SvxSetItem(ATTR_PAGE_HEADERSET,pDestSet));
}
if (rStyleSet.GetItemState(ATTR_PAGE_FOOTERSET,false,&pItem) == SfxItemState::SET)
{
- SfxItemSet& rSrcSet = ((SvxSetItem*)pItem)->GetItemSet();
+ const SfxItemSet& rSrcSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet();
SfxItemSet* pDestSet = new SfxItemSet(*rStyleSet.GetPool(),rSrcSet.GetRanges());
pDestSet->Put(rSrcSet);
rStyleSet.Put(SvxSetItem(ATTR_PAGE_FOOTERSET,pDestSet));
diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx
index b9a462c6dce9..f8595834abca 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -435,7 +435,7 @@ OUString ScDocumentLoader::GetOptions( SfxMedium& rMedium )
SfxItemSet* pSet = rMedium.GetItemSet();
const SfxPoolItem* pItem;
if ( pSet && SfxItemState::SET == pSet->GetItemState( SID_FILE_FILTEROPTIONS, true, &pItem ) )
- return ((const SfxStringItem*)pItem)->GetValue();
+ return static_cast<const SfxStringItem*>(pItem)->GetValue();
return EMPTY_OUSTRING;
}