summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/app/scmod.cxx4
-rw-r--r--sc/source/ui/condformat/condformatdlgentry.cxx2
-rw-r--r--sc/source/ui/dbgui/filtdlg.cxx18
-rw-r--r--sc/source/ui/dbgui/pfiltdlg.cxx6
-rw-r--r--sc/source/ui/dbgui/validate.cxx2
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx2
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx8
-rw-r--r--sc/source/ui/drawfunc/fuconuno.cxx2
-rw-r--r--sc/source/ui/miscdlgs/acredlin.cxx2
-rw-r--r--sc/source/ui/miscdlgs/highred.cxx2
-rw-r--r--sc/source/ui/miscdlgs/tabopdlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/textdlgs.cxx2
-rw-r--r--sc/source/ui/navipi/content.cxx34
-rw-r--r--sc/source/ui/navipi/navipi.cxx2
-rw-r--r--sc/source/ui/optdlg/calcoptionsdlg.cxx2
-rw-r--r--sc/source/ui/optdlg/tpview.cxx6
-rw-r--r--sc/source/ui/undo/undocell.cxx6
-rw-r--r--sc/source/ui/unoobj/appluno.cxx2
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx4
-rw-r--r--sc/source/ui/unoobj/chartuno.cxx2
-rw-r--r--sc/source/ui/unoobj/confuno.cxx2
-rw-r--r--sc/source/ui/unoobj/dapiuno.cxx8
-rw-r--r--sc/source/ui/unoobj/datauno.cxx15
-rw-r--r--sc/source/ui/unoobj/eventuno.cxx6
-rw-r--r--sc/source/ui/unoobj/fmtuno.cxx16
-rw-r--r--sc/source/ui/unoobj/srchuno.cxx2
-rw-r--r--sc/source/ui/unoobj/targuno.cxx2
-rw-r--r--sc/source/ui/unoobj/viewuno.cxx20
-rw-r--r--sc/source/ui/vba/vbaformat.cxx6
-rw-r--r--sc/source/ui/view/cellsh1.cxx2
-rw-r--r--sc/source/ui/view/cellsh2.cxx6
-rw-r--r--sc/source/ui/view/editsh.cxx8
-rw-r--r--sc/source/ui/view/formatsh.cxx4
-rw-r--r--sc/source/ui/view/output2.cxx2
-rw-r--r--sc/source/ui/view/tabview.cxx2
-rw-r--r--sc/source/ui/view/tabview3.cxx26
-rw-r--r--sc/source/ui/view/tabview4.cxx4
-rw-r--r--sc/source/ui/view/tabview5.cxx6
-rw-r--r--sc/source/ui/view/tabvwsha.cxx2
-rw-r--r--sc/source/ui/view/tabvwshe.cxx2
-rw-r--r--sc/source/ui/view/viewdata.cxx8
41 files changed, 124 insertions, 135 deletions
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index a6c1cd6662bb..6bb119ec345b 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -408,7 +408,7 @@ void ScModule::Execute( SfxRequest& rReq )
const SfxPoolItem* pItem;
if ( pReqArgs && SfxItemState::SET == pReqArgs->GetItemState( nSlot, true, &pItem ) )
{
- FieldUnit eUnit = (FieldUnit)static_cast<const SfxUInt16Item*>(pItem)->GetValue();
+ FieldUnit eUnit = static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>(pItem)->GetValue());
switch( eUnit )
{
case FUNIT_MM: // Just the units that are also in the dialog
@@ -952,7 +952,7 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
if (rOptSet.HasItem(SID_ATTR_METRIC, &pItem))
{
PutItem( *pItem );
- pAppCfg->SetAppMetric( (FieldUnit)static_cast<const SfxUInt16Item*>(pItem)->GetValue() );
+ pAppCfg->SetAppMetric( static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>(pItem)->GetValue()) );
bSaveAppOptions = true;
}
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index b68e99c1d171..230deaa5df6a 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -480,7 +480,7 @@ void StyleSelect( ListBox& rLbStyle, const ScDocument* pDoc, SvxFontPrevWindow&
if(rLbStyle.GetSelectedEntryPos() == 0)
{
// call new style dialog
- SfxUInt16Item aFamilyItem( SID_STYLE_FAMILY, (sal_uInt16) SfxStyleFamily::Para );
+ SfxUInt16Item aFamilyItem( SID_STYLE_FAMILY, sal_uInt16(SfxStyleFamily::Para) );
SfxStringItem aRefItem( SID_STYLE_REFERENCE, ScGlobal::GetRscString(STR_STYLENAME_STANDARD) );
// unlock the dispatcher so SID_STYLE_NEW can be executed
diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index 00fba720a865..53c77d2aa706 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -741,7 +741,7 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox&, rLb, void )
const sal_Int32 nConnect1 = pLbConnect1->GetSelectedEntryPos();
size_t nQE = nOffset;
- theQueryData.GetEntry(nQE).eConnect =(ScQueryConnect)nConnect1;
+ theQueryData.GetEntry(nQE).eConnect =static_cast<ScQueryConnect>(nConnect1);
if (maRefreshExceptQuery.size() < nQE + 1)
maRefreshExceptQuery.resize(nQE + 1, false);
maRefreshExceptQuery[nQE] = true;
@@ -755,7 +755,7 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox&, rLb, void )
const sal_Int32 nConnect2 = pLbConnect2->GetSelectedEntryPos();
size_t nQE = 1+nOffset;
- theQueryData.GetEntry(nQE).eConnect =(ScQueryConnect)nConnect2;
+ theQueryData.GetEntry(nQE).eConnect =static_cast<ScQueryConnect>(nConnect2);
if (maRefreshExceptQuery.size() < nQE + 1)
maRefreshExceptQuery.resize(nQE + 1, false);
maRefreshExceptQuery[nQE]=true;
@@ -768,7 +768,7 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox&, rLb, void )
const sal_Int32 nConnect3 = pLbConnect3->GetSelectedEntryPos();
size_t nQE = 2 + nOffset;
- theQueryData.GetEntry(nQE).eConnect = (ScQueryConnect)nConnect3;
+ theQueryData.GetEntry(nQE).eConnect = static_cast<ScQueryConnect>(nConnect3);
if (maRefreshExceptQuery.size() < nQE + 1)
maRefreshExceptQuery.resize(nQE + 1, false);
maRefreshExceptQuery[nQE] = true;
@@ -782,7 +782,7 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox&, rLb, void )
const sal_Int32 nConnect4 = pLbConnect4->GetSelectedEntryPos();
size_t nQE = 3 + nOffset;
- theQueryData.GetEntry(nQE).eConnect = (ScQueryConnect)nConnect4;
+ theQueryData.GetEntry(nQE).eConnect = static_cast<ScQueryConnect>(nConnect4);
if (maRefreshExceptQuery.size() < nQE + 1)
maRefreshExceptQuery.resize(nQE + 1, false);
maRefreshExceptQuery[nQE] = true;
@@ -959,22 +959,22 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox&, rLb, void )
}
else if ( &rLb == pLbCond1)
{
- theQueryData.GetEntry(nOffset).eOp=(ScQueryOp)rLb.GetSelectedEntryPos();
+ theQueryData.GetEntry(nOffset).eOp=static_cast<ScQueryOp>(rLb.GetSelectedEntryPos());
}
else if ( &rLb == pLbCond2)
{
sal_uInt16 nQ=1+nOffset;
- theQueryData.GetEntry(nQ).eOp=(ScQueryOp)rLb.GetSelectedEntryPos();
+ theQueryData.GetEntry(nQ).eOp=static_cast<ScQueryOp>(rLb.GetSelectedEntryPos());
}
else if ( &rLb == pLbCond3)
{
sal_uInt16 nQ=2+nOffset;
- theQueryData.GetEntry(nQ).eOp=(ScQueryOp)rLb.GetSelectedEntryPos();
+ theQueryData.GetEntry(nQ).eOp=static_cast<ScQueryOp>(rLb.GetSelectedEntryPos());
}
else
{
sal_uInt16 nQ=3+nOffset;
- theQueryData.GetEntry(nQ).eOp=(ScQueryOp)rLb.GetSelectedEntryPos();
+ theQueryData.GetEntry(nQ).eOp=static_cast<ScQueryOp>(rLb.GetSelectedEntryPos());
}
}
@@ -1090,7 +1090,7 @@ IMPL_LINK( ScFilterDlg, ValModifyHdl, Edit&, rEd, void )
rEntry.nField = nField ? (theQueryData.nCol1 +
static_cast<SCCOL>(nField) - 1) : static_cast<SCCOL>(0);
- ScQueryOp eOp = (ScQueryOp)pLbCond->GetSelectedEntryPos();
+ ScQueryOp eOp = static_cast<ScQueryOp>(pLbCond->GetSelectedEntryPos());
rEntry.eOp = eOp;
if (maHasDates[nQE] && !bByEmptyOrNotByEmpty)
rItem.meType = ScQueryEntry::ByDate;
diff --git a/sc/source/ui/dbgui/pfiltdlg.cxx b/sc/source/ui/dbgui/pfiltdlg.cxx
index 6de3a16d1759..331b607df22a 100644
--- a/sc/source/ui/dbgui/pfiltdlg.cxx
+++ b/sc/source/ui/dbgui/pfiltdlg.cxx
@@ -358,7 +358,7 @@ const ScQueryItem& ScPivotFilterDlg::GetOutputItem()
for ( SCSIZE i=0; i<3; i++ )
{
const sal_Int32 nField = aFieldLbArr[i]->GetSelectedEntryPos();
- ScQueryOp eOp = (ScQueryOp)aCondLbArr[i]->GetSelectedEntryPos();
+ ScQueryOp eOp = static_cast<ScQueryOp>(aCondLbArr[i]->GetSelectedEntryPos());
bool bDoThis = (aFieldLbArr[i]->GetSelectedEntryPos() != 0);
theParam.GetEntry(i).bDoQuery = bDoThis;
@@ -399,10 +399,10 @@ const ScQueryItem& ScPivotFilterDlg::GetOutputItem()
}
theParam.GetEntry(1).eConnect = (nConnect1 != LISTBOX_ENTRY_NOTFOUND)
- ? (ScQueryConnect)nConnect1
+ ? static_cast<ScQueryConnect>(nConnect1)
: SC_AND;
theParam.GetEntry(2).eConnect = (nConnect2 != LISTBOX_ENTRY_NOTFOUND)
- ? (ScQueryConnect)nConnect2
+ ? static_cast<ScQueryConnect>(nConnect2)
: SC_AND;
theParam.bInplace = false;
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index 9a0591db642a..15fee73d70b6 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -832,7 +832,7 @@ bool ScTPValidationError::FillItemSet( SfxItemSet* rArgSet )
IMPL_LINK_NOARG(ScTPValidationError, SelectActionHdl, ListBox&, void)
{
- ScValidErrorStyle eStyle = (ScValidErrorStyle) m_pLbAction->GetSelectedEntryPos();
+ ScValidErrorStyle eStyle = static_cast<ScValidErrorStyle>(m_pLbAction->GetSelectedEntryPos());
bool bMacro = ( eStyle == SC_VALERR_MACRO );
m_pBtnSearch->Enable( bMacro );
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index bceb7286dbb7..561d1c6fc60b 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -875,7 +875,7 @@ void ScExternalRefCache::setCellRangeData(sal_uInt16 nFileId, const ScRange& rRa
else
{
FormulaError nErr = GetDoubleErrorValue( pMat->GetDouble(0,0));
- SAL_WARN("sc.ui","ScExternalRefCache::setCellRangeData - matrix error value is " << (int)nErr <<
+ SAL_WARN("sc.ui","ScExternalRefCache::setCellRangeData - matrix error value is " << static_cast<int>(nErr) <<
(nErr == FormulaError::MatrixSize ? ", ok" : ", not ok"));
}
}
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 3e428992b63e..6d718002f33f 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -724,8 +724,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
case SID_SET_SUPER_SCRIPT:
{
SvxEscapementItem aItem(EE_CHAR_ESCAPEMENT);
- SvxEscapement eEsc = (SvxEscapement)
- aEditAttr.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue();
+ SvxEscapement eEsc = static_cast<SvxEscapement>(aEditAttr.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue());
if( eEsc == SvxEscapement::Superscript )
aItem.SetEscapement( SvxEscapement::Off );
@@ -738,8 +737,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
case SID_SET_SUB_SCRIPT:
{
SvxEscapementItem aItem(EE_CHAR_ESCAPEMENT);
- SvxEscapement eEsc = (SvxEscapement)
- aEditAttr.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue();
+ SvxEscapement eEsc = static_cast<SvxEscapement>(aEditAttr.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue());
if( eEsc == SvxEscapement::Subscript )
aItem.SetEscapement( SvxEscapement::Off );
@@ -1096,7 +1094,7 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
// super-/subscript
- SvxEscapement eEsc = (SvxEscapement) aAttrSet.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue();
+ SvxEscapement eEsc = static_cast<SvxEscapement>(aAttrSet.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue());
if( eEsc == SvxEscapement::Superscript )
rDestSet.Put( SfxBoolItem( SID_SET_SUPER_SCRIPT, true ) );
else if( eEsc == SvxEscapement::Subscript )
diff --git a/sc/source/ui/drawfunc/fuconuno.cxx b/sc/source/ui/drawfunc/fuconuno.cxx
index 6fe1bcd9bfae..619ad1c4f79d 100644
--- a/sc/source/ui/drawfunc/fuconuno.cxx
+++ b/sc/source/ui/drawfunc/fuconuno.cxx
@@ -31,7 +31,7 @@ FuConstUnoControl::FuConstUnoControl(ScTabViewShell* pViewSh, vcl::Window* pWin,
const SfxUInt32Item* pInventorItem = rReq.GetArg<SfxUInt32Item>(SID_FM_CONTROL_INVENTOR);
const SfxUInt16Item* pIdentifierItem = rReq.GetArg<SfxUInt16Item>(SID_FM_CONTROL_IDENTIFIER);
if( pInventorItem )
- nInventor = (SdrInventor)pInventorItem->GetValue();
+ nInventor = static_cast<SdrInventor>(pInventorItem->GetValue());
if( pIdentifierItem )
nIdentifier = pIdentifierItem->GetValue();
}
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index c1edb5cc8082..45c75bcd007f 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -220,7 +220,7 @@ void ScAcceptChgDlg::Init()
pTPFilter->SetFirstTime(aChangeViewSet.GetTheFirstDateTime());
pTPFilter->SetLastDate(aChangeViewSet.GetTheLastDateTime());
pTPFilter->SetLastTime(aChangeViewSet.GetTheLastDateTime());
- pTPFilter->SetDateMode((sal_uInt16)aChangeViewSet.GetTheDateMode());
+ pTPFilter->SetDateMode(static_cast<sal_uInt16>(aChangeViewSet.GetTheDateMode()));
pTPFilter->CheckComment(aChangeViewSet.HasComment());
pTPFilter->SetComment(aChangeViewSet.GetTheComment());
diff --git a/sc/source/ui/miscdlgs/highred.cxx b/sc/source/ui/miscdlgs/highred.cxx
index 0a1d7f537f35..9601a7c68195 100644
--- a/sc/source/ui/miscdlgs/highred.cxx
+++ b/sc/source/ui/miscdlgs/highred.cxx
@@ -101,7 +101,7 @@ void ScHighlightChgDlg::Init()
m_pFilterCtr->SetFirstTime(aChangeViewSet.GetTheFirstDateTime());
m_pFilterCtr->SetLastDate(aChangeViewSet.GetTheLastDateTime());
m_pFilterCtr->SetLastTime(aChangeViewSet.GetTheLastDateTime());
- m_pFilterCtr->SetDateMode((sal_uInt16)aChangeViewSet.GetTheDateMode());
+ m_pFilterCtr->SetDateMode(static_cast<sal_uInt16>(aChangeViewSet.GetTheDateMode()));
m_pFilterCtr->CheckAuthor(aChangeViewSet.HasAuthor());
m_pFilterCtr->CheckComment(aChangeViewSet.HasComment());
m_pFilterCtr->SetComment(aChangeViewSet.GetTheComment());
diff --git a/sc/source/ui/miscdlgs/tabopdlg.cxx b/sc/source/ui/miscdlgs/tabopdlg.cxx
index cee7b8ea075c..50bfa8180ec9 100644
--- a/sc/source/ui/miscdlgs/tabopdlg.cxx
+++ b/sc/source/ui/miscdlgs/tabopdlg.cxx
@@ -305,7 +305,7 @@ IMPL_LINK( ScTabOpDlg, BtnHdl, Button*, pBtn, void )
}
if (nError)
- RaiseError( (ScTabOpErr) nError );
+ RaiseError( static_cast<ScTabOpErr>(nError) );
else
{
ScTabOpParam aOutParam(theFormulaCell, theFormulaEnd, theRowCell, theColCell, eMode);
diff --git a/sc/source/ui/miscdlgs/textdlgs.cxx b/sc/source/ui/miscdlgs/textdlgs.cxx
index afaf95393b57..5e06e95ddf6c 100644
--- a/sc/source/ui/miscdlgs/textdlgs.cxx
+++ b/sc/source/ui/miscdlgs/textdlgs.cxx
@@ -85,7 +85,7 @@ void ScParagraphDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
TabulatorDisableFlags const nFlags((TabulatorDisableFlags::TypeMask &~TabulatorDisableFlags::TypeLeft) |
(TabulatorDisableFlags::FillMask &~TabulatorDisableFlags::FillNone));
- aSet.Put(SfxUInt16Item(SID_SVXTABULATORTABPAGE_DISABLEFLAGS, (sal_uInt16)nFlags));
+ aSet.Put(SfxUInt16Item(SID_SVXTABULATORTABPAGE_DISABLEFLAGS, static_cast<sal_uInt16>(nFlags)));
rPage.PageCreated(aSet);
}
}
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 4b14ddf3add9..6f662e16cc4e 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -65,7 +65,7 @@ using namespace com::sun::star;
// order of the categories in navigator -------------------------------------
-static const ScContentId pTypeList[(int)ScContentId::LAST + 1] =
+static const ScContentId pTypeList[int(ScContentId::LAST) + 1] =
{
ScContentId::ROOT, // ROOT (0) has to be at the front
ScContentId::TABLE,
@@ -132,12 +132,12 @@ ScContentTree::ScContentTree(vcl::Window* pParent, ScNavigatorDlg* pNavigatorDlg
, bisInNavigatoeDlg(false)
{
SetQuickSearch(true);
- for (sal_uInt16 i = 0; i <= (int)ScContentId::LAST; ++i)
+ for (sal_uInt16 i = 0; i <= int(ScContentId::LAST); ++i)
pPosList[pTypeList[i]] = i; // inverse for searching
pRootNodes[ScContentId::ROOT] = nullptr;
- for (sal_uInt16 i = 1; i < (int)ScContentId::LAST; ++i)
- InitRoot((ScContentId)i);
+ for (sal_uInt16 i = 1; i < int(ScContentId::LAST); ++i)
+ InitRoot(static_cast<ScContentId>(i));
SetNodeDefaultImages();
@@ -249,9 +249,9 @@ void ScContentTree::InitRoot( ScContentId nType )
return;
}
- BitmapEx aBitmap(aContentBmps[(int)nType - 1]);
+ BitmapEx aBitmap(aContentBmps[static_cast<int>(nType) - 1]);
Image aImage(aBitmap);
- OUString aName(ScResId(SCSTR_CONTENT_ARY[(int)nType]));
+ OUString aName(ScResId(SCSTR_CONTENT_ARY[static_cast<int>(nType)]));
// back to the correct position:
sal_uInt16 nPos = nRootType != ScContentId::ROOT ? 0 : pPosList[nType]-1;
SvTreeListEntry* pNew = InsertEntry( aName, aImage, aImage, nullptr, false, nPos );
@@ -270,8 +270,8 @@ void ScContentTree::ClearAll()
Control::SetUpdateMode(false);
Clear();
Control::SetUpdateMode(bOldUpdate);
- for (sal_uInt16 i=1; i<=(int)ScContentId::LAST; i++)
- InitRoot((ScContentId)i);
+ for (sal_uInt16 i=1; i<=int(ScContentId::LAST); i++)
+ InitRoot(static_cast<ScContentId>(i));
}
void ScContentTree::ClearType(ScContentId nType)
@@ -311,9 +311,9 @@ void ScContentTree::GetEntryIndexes( ScContentId& rnRootIndex, sal_uLong& rnChil
SvTreeListEntry* pParent = GetParent( pEntry );
bool bFound = false;
- for( int i = 1; !bFound && (i <= (int)ScContentId::LAST); ++i )
+ for( int i = 1; !bFound && (i <= int(ScContentId::LAST)); ++i )
{
- ScContentId nRoot = (ScContentId)i;
+ ScContentId nRoot = static_cast<ScContentId>(i);
if( pEntry == pRootNodes[ nRoot ] )
{
rnRootIndex = nRoot;
@@ -1522,9 +1522,9 @@ void ScContentTree::ToggleRoot() // after selection
if (pEntry)
{
SvTreeListEntry* pParent = GetParent(pEntry);
- for (sal_uInt16 i=1; i<=(int)ScContentId::LAST; i++)
- if ( pEntry == pRootNodes[(ScContentId)i] || pParent == pRootNodes[(ScContentId)i] )
- nNew = (ScContentId)i;
+ for (sal_uInt16 i=1; i<=int(ScContentId::LAST); i++)
+ if ( pEntry == pRootNodes[static_cast<ScContentId>(i)] || pParent == pRootNodes[static_cast<ScContentId>(i)] )
+ nNew = static_cast<ScContentId>(i);
}
}
@@ -1671,9 +1671,9 @@ void ScContentTree::ApplyNavigatorSettings()
ScContentId nRootSel = pSettings->GetRootSelected();
sal_uLong nChildSel = pSettings->GetChildSelected();
- for( int i = 1; i <= (int)ScContentId::LAST; ++i )
+ for( int i = 1; i <= int(ScContentId::LAST); ++i )
{
- ScContentId nEntry = (ScContentId)i;
+ ScContentId nEntry = static_cast<ScContentId>(i);
if( pRootNodes[ nEntry ] )
{
// expand
@@ -1704,9 +1704,9 @@ void ScContentTree::StoreNavigatorSettings() const
ScNavigatorSettings* pSettings = ScNavigatorDlg::GetNavigatorSettings();
if( pSettings )
{
- for( int i = 1; i <= (int)ScContentId::LAST; ++i )
+ for( int i = 1; i <= int(ScContentId::LAST); ++i )
{
- ScContentId nEntry = (ScContentId)i;
+ ScContentId nEntry = static_cast<ScContentId>(i);
bool bExp = pRootNodes[ nEntry ] && IsExpanded( pRootNodes[ nEntry ] );
pSettings->SetExpanded( nEntry, bExp );
}
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index 46fc019c6618..bd6c65810f02 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -556,7 +556,7 @@ ScNavigatorDlg::ScNavigatorDlg(SfxBindings* pB, vcl::Window* pParent)
aLbEntries->SetNavigatorDlgFlag(true);
// if scenario was active, switch on
- NavListMode eNavMode = (NavListMode) rCfg.GetListMode();
+ NavListMode eNavMode = static_cast<NavListMode>(rCfg.GetListMode());
if (eNavMode == NAV_LMODE_SCENARIOS)
aTbxCmd->CheckItem(nScenarioId);
else
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx
index 82c74d735f59..4bb17dea3e22 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.cxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx
@@ -143,7 +143,7 @@ IMPL_LINK(ScCalcOptionsDialog, AsZeroModifiedHdl, Button*, pCheckBox, void )
IMPL_LINK(ScCalcOptionsDialog, ConversionModifiedHdl, ListBox&, rConv, void )
{
- maConfig.meStringConversion = (ScCalcConfig::StringConversion)rConv.GetSelectedEntryPos();
+ maConfig.meStringConversion = static_cast<ScCalcConfig::StringConversion>(rConv.GetSelectedEntryPos());
CoupleEmptyAsZeroToStringConversion();
}
diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx
index e9d4a1006693..7a4b999cf969 100644
--- a/sc/source/ui/optdlg/tpview.cxx
+++ b/sc/source/ui/optdlg/tpview.cxx
@@ -528,11 +528,11 @@ void ScTpLayoutOptions::Reset( const SfxItemSet* rCoreSet )
if ( rCoreSet->GetItemState( SID_ATTR_METRIC ) >= SfxItemState::DEFAULT )
{
const SfxUInt16Item& rItem = static_cast<const SfxUInt16Item&>(rCoreSet->Get( SID_ATTR_METRIC ));
- FieldUnit eFieldUnit = (FieldUnit)rItem.GetValue();
+ FieldUnit eFieldUnit = static_cast<FieldUnit>(rItem.GetValue());
for ( sal_Int32 i = 0; i < m_pUnitLB->GetEntryCount(); ++i )
{
- if ( (FieldUnit)reinterpret_cast<sal_IntPtr>(m_pUnitLB->GetEntryData( i )) == eFieldUnit )
+ if ( static_cast<FieldUnit>(reinterpret_cast<sal_IntPtr>(m_pUnitLB->GetEntryData( i ))) == eFieldUnit )
{
m_pUnitLB->SelectEntryPos( i );
break;
@@ -639,7 +639,7 @@ IMPL_LINK_NOARG(ScTpLayoutOptions, MetricHdl, ListBox&, void)
const sal_Int32 nMPos = m_pUnitLB->GetSelectedEntryPos();
if(nMPos != LISTBOX_ENTRY_NOTFOUND)
{
- FieldUnit eFieldUnit = (FieldUnit)reinterpret_cast<sal_IntPtr>(m_pUnitLB->GetEntryData( nMPos ));
+ FieldUnit eFieldUnit = static_cast<FieldUnit>(reinterpret_cast<sal_IntPtr>(m_pUnitLB->GetEntryData( nMPos )));
sal_Int64 nVal =
m_pTabMF->Denormalize( m_pTabMF->GetValue( FUNIT_TWIP ) );
::SetFieldUnit( *m_pTabMF, eFieldUnit );
diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx
index 972b8d76032f..159eb1df675f 100644
--- a/sc/source/ui/undo/undocell.cxx
+++ b/sc/source/ui/undo/undocell.cxx
@@ -890,7 +890,7 @@ OUString ScUndoDetective::GetComment() const
{
const char* pId = STR_UNDO_DETDELALL;
if ( !bIsDelete )
- switch ( (ScDetOpType) nAction )
+ switch ( static_cast<ScDetOpType>(nAction) )
{
case SCDETOP_ADDSUCC: pId = STR_UNDO_DETADDSUCC; break;
case SCDETOP_DELSUCC: pId = STR_UNDO_DETDELSUCC; break;
@@ -923,7 +923,7 @@ void ScUndoDetective::Undo()
{
ScDetOpDataVector& rVec = pList->GetDataVector();
ScDetOpDataVector::iterator it = rVec.begin() + rVec.size() - 1;
- if ( (*it)->GetOperation() == (ScDetOpType) nAction && (*it)->GetPos() == aPos )
+ if ( (*it)->GetOperation() == static_cast<ScDetOpType>(nAction) && (*it)->GetPos() == aPos )
rVec.erase( it);
else
{
@@ -950,7 +950,7 @@ void ScUndoDetective::Redo()
if (bIsDelete)
rDoc.ClearDetectiveOperations();
else
- rDoc.AddDetectiveOperation( ScDetOpData( aPos, (ScDetOpType) nAction ) );
+ rDoc.AddDetectiveOperation( ScDetOpData( aPos, static_cast<ScDetOpType>(nAction) ) );
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
diff --git a/sc/source/ui/unoobj/appluno.cxx b/sc/source/ui/unoobj/appluno.cxx
index ead9147989e5..b7693703dc07 100644
--- a/sc/source/ui/unoobj/appluno.cxx
+++ b/sc/source/ui/unoobj/appluno.cxx
@@ -306,7 +306,7 @@ void SAL_CALL ScSpreadsheetSettings::setPropertyValue(
}
else if (aPropertyName == SC_UNONAME_METRIC)
{
- aAppOpt.SetAppMetric( (FieldUnit) ScUnoHelpFunctions::GetInt16FromAny( aValue ) );
+ aAppOpt.SetAppMetric( static_cast<FieldUnit>(ScUnoHelpFunctions::GetInt16FromAny( aValue )) );
bSaveApp = true;
}
else if (aPropertyName == SC_UNONAME_MOVEDIR)
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index a6c4172c0c80..2ee12640cd04 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -1831,7 +1831,7 @@ double SAL_CALL ScCellRangesBase::computeFunction( sheet::GeneralFunction nFunct
ScAddress aDummy; // if not marked, ignored if it is negative
double fVal;
- ScSubTotalFunc eFunc = ScDPUtil::toSubTotalFunc((ScGeneralFunction)nFunction);
+ ScSubTotalFunc eFunc = ScDPUtil::toSubTotalFunc(static_cast<ScGeneralFunction>(nFunction));
ScDocument& rDoc = pDocShell->GetDocument();
if ( !rDoc.GetSelectionFunction( eFunc, aDummy, aMark, fVal ) )
{
@@ -6436,7 +6436,7 @@ sal_Int32 SAL_CALL ScCellObj::getError()
if (aCell.meType == CELLTYPE_FORMULA)
nError = aCell.mpFormula->GetErrCode();
- return (sal_Int32)nError;
+ return static_cast<sal_Int32>(nError);
}
// XFormulaTokens
diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx
index 556e4aef5bce..105d4e0fbc04 100644
--- a/sc/source/ui/unoobj/chartuno.cxx
+++ b/sc/source/ui/unoobj/chartuno.cxx
@@ -464,7 +464,7 @@ void ScChartObj::GetData_Impl( ScRangeListRef& rRanges, bool& rColHeaders, bool&
if (aPropName == "CellRangeRepresentation")
rProp.Value >>= aRanges;
else if (aPropName == "DataRowSource")
- eDataRowSource = (chart::ChartDataRowSource)ScUnoHelpFunctions::GetEnumFromAny( rProp.Value );
+ eDataRowSource = static_cast<chart::ChartDataRowSource>(ScUnoHelpFunctions::GetEnumFromAny( rProp.Value ));
else if (aPropName == "HasCategories")
bHasCategories = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value );
else if (aPropName == "FirstCellAsLabel")
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx
index 6894813441e4..01528c65697c 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -280,7 +280,7 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue(
{
// Int16 contains CharacterCompressionType values
sal_Int16 nUno = ScUnoHelpFunctions::GetInt16FromAny( aValue );
- rDoc.SetAsianCompression( (CharCompressType) nUno );
+ rDoc.SetAsianCompression( static_cast<CharCompressType>(nUno) );
bUpdateHeights = true;
}
else if ( aPropertyName == SC_UNO_ASIANKERN )
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index a96b35cd0d48..51749deec887 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -1806,13 +1806,12 @@ void SAL_CALL ScDataPilotFieldObj::setPropertyValue( const OUString& aPropertyNa
if ( aPropertyName == SC_UNONAME_FUNCTION )
{
// #i109350# use GetEnumFromAny because it also allows sal_Int32
- ScGeneralFunction eFunction = (ScGeneralFunction)
- ScUnoHelpFunctions::GetEnumFromAny( aValue );
+ ScGeneralFunction eFunction = static_cast<ScGeneralFunction>(ScUnoHelpFunctions::GetEnumFromAny( aValue ));
setFunction( eFunction );
}
else if ( aPropertyName == SC_UNONAME_FUNCTION2 )
{
- ScGeneralFunction eFunction = (ScGeneralFunction)ScUnoHelpFunctions::GetInt16FromAny( aValue );
+ ScGeneralFunction eFunction = static_cast<ScGeneralFunction>(ScUnoHelpFunctions::GetInt16FromAny( aValue ));
setFunction( eFunction );
}
else if ( aPropertyName == SC_UNONAME_SUBTOTALS )
@@ -1845,8 +1844,7 @@ void SAL_CALL ScDataPilotFieldObj::setPropertyValue( const OUString& aPropertyNa
else if ( aPropertyName == SC_UNONAME_ORIENT )
{
//! test for correct enum type?
- DataPilotFieldOrientation eOrient = (DataPilotFieldOrientation)
- ScUnoHelpFunctions::GetEnumFromAny( aValue );
+ DataPilotFieldOrientation eOrient = static_cast<DataPilotFieldOrientation>(ScUnoHelpFunctions::GetEnumFromAny( aValue ));
setOrientation( eOrient );
}
else if ( aPropertyName == SC_UNONAME_SELPAGE )
diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index 4125e91410f7..3127bfee7045 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -231,8 +231,7 @@ void ScImportDescriptor::FillImportParam( ScImportParam& rParam, const uno::Sequ
else if (aPropName == SC_UNONAME_SRCTYPE)
{
//! test for correct enum type?
- sheet::DataImportMode eMode = (sheet::DataImportMode)
- ScUnoHelpFunctions::GetEnumFromAny( rProp.Value );
+ sheet::DataImportMode eMode = static_cast<sheet::DataImportMode>(ScUnoHelpFunctions::GetEnumFromAny( rProp.Value ));
switch (eMode)
{
case sheet::DataImportMode_NONE:
@@ -336,8 +335,7 @@ void ScSortDescriptor::FillSortParam( ScSortParam& rParam, const uno::Sequence<b
if (aPropName == SC_UNONAME_ORIENT)
{
//! test for correct enum type?
- table::TableOrientation eOrient = (table::TableOrientation)
- ScUnoHelpFunctions::GetEnumFromAny( rProp.Value );
+ table::TableOrientation eOrient = static_cast<table::TableOrientation>(ScUnoHelpFunctions::GetEnumFromAny( rProp.Value ));
rParam.bByRow = ( eOrient != table::TableOrientation_COLUMNS );
}
else if (aPropName == SC_UNONAME_ISSORTCOLUMNS)
@@ -518,7 +516,7 @@ void SAL_CALL ScSubTotalFieldObj::setSubTotalColumns(
for (SCCOL i=0; i<nCount; i++)
{
aParam.pSubTotals[nPos][i] = static_cast<SCCOL>(pAry[i].Column);
- aParam.pFunctions[nPos][i] = ScDPUtil::toSubTotalFunc((ScGeneralFunction)pAry[i].Function);
+ aParam.pFunctions[nPos][i] = ScDPUtil::toSubTotalFunc(static_cast<ScGeneralFunction>(pAry[i].Function));
}
}
else
@@ -599,7 +597,7 @@ void SAL_CALL ScSubTotalDescriptorBase::addNew(
for (SCCOL i=0; i<nCount; i++)
{
aParam.pSubTotals[nPos][i] = static_cast<SCCOL>(pAry[i].Column);
- aParam.pFunctions[nPos][i] = ScDPUtil::toSubTotalFunc((ScGeneralFunction)pAry[i].Function);
+ aParam.pFunctions[nPos][i] = ScDPUtil::toSubTotalFunc(static_cast<ScGeneralFunction>(pAry[i].Function));
}
}
else
@@ -839,7 +837,7 @@ sheet::GeneralFunction SAL_CALL ScConsolidationDescriptor::getFunction()
void SAL_CALL ScConsolidationDescriptor::setFunction( sheet::GeneralFunction nFunction )
{
SolarMutexGuard aGuard;
- aParam.eFunction = ScDPUtil::toSubTotalFunc((ScGeneralFunction)nFunction);
+ aParam.eFunction = ScDPUtil::toSubTotalFunc(static_cast<ScGeneralFunction>(nFunction));
}
uno::Sequence<table::CellRangeAddress> SAL_CALL ScConsolidationDescriptor::getSources()
@@ -1414,8 +1412,7 @@ void SAL_CALL ScFilterDescriptorBase::setPropertyValue(
else if (aPropertyName == SC_UNONAME_ORIENT)
{
//! test for correct enum type?
- table::TableOrientation eOrient = (table::TableOrientation)
- ScUnoHelpFunctions::GetEnumFromAny( aValue );
+ table::TableOrientation eOrient = static_cast<table::TableOrientation>(ScUnoHelpFunctions::GetEnumFromAny( aValue ));
aParam.bByRow = ( eOrient != table::TableOrientation_COLUMNS );
}
else if (aPropertyName == SC_UNONAME_OUTPOS)
diff --git a/sc/source/ui/unoobj/eventuno.cxx b/sc/source/ui/unoobj/eventuno.cxx
index 26284a705fe2..6d33ea9c74c5 100644
--- a/sc/source/ui/unoobj/eventuno.cxx
+++ b/sc/source/ui/unoobj/eventuno.cxx
@@ -146,9 +146,9 @@ uno::Any SAL_CALL ScSheetEventsObj::getByName( const OUString& aName )
uno::Sequence<OUString> SAL_CALL ScSheetEventsObj::getElementNames()
{
SolarMutexGuard aGuard;
- auto aNames = uno::Sequence<OUString>((int)ScSheetEventId::COUNT);
- for (sal_Int32 nEvent=0; nEvent<(int)ScSheetEventId::COUNT; ++nEvent)
- aNames[nEvent] = ScSheetEvents::GetEventName((ScSheetEventId)nEvent);
+ auto aNames = uno::Sequence<OUString>(int(ScSheetEventId::COUNT));
+ for (sal_Int32 nEvent=0; nEvent<int(ScSheetEventId::COUNT); ++nEvent)
+ aNames[nEvent] = ScSheetEvents::GetEventName(static_cast<ScSheetEventId>(nEvent));
return aNames;
}
diff --git a/sc/source/ui/unoobj/fmtuno.cxx b/sc/source/ui/unoobj/fmtuno.cxx
index 0c5aef2f3089..7a473cc58c67 100644
--- a/sc/source/ui/unoobj/fmtuno.cxx
+++ b/sc/source/ui/unoobj/fmtuno.cxx
@@ -263,7 +263,7 @@ void SAL_CALL ScTableConditionalFormat::addNew(
if ( rProp.Name == SC_UNONAME_OPERATOR )
{
sal_Int32 eOper = ScUnoHelpFunctions::GetEnumFromAny( rProp.Value );
- aEntry.meMode = ScConditionEntry::GetModeFromApi( (sheet::ConditionOperator)eOper );
+ aEntry.meMode = ScConditionEntry::GetModeFromApi( static_cast<sheet::ConditionOperator>(eOper) );
}
else if ( rProp.Name == SC_UNONAME_FORMULA1 )
{
@@ -521,7 +521,7 @@ sal_Int32 SAL_CALL ScTableConditionalEntry::getConditionOperator()
void SAL_CALL ScTableConditionalEntry::setConditionOperator( sal_Int32 nOperator )
{
SolarMutexGuard aGuard;
- aData.meMode = ScConditionEntry::GetModeFromApi( (sheet::ConditionOperator)nOperator );
+ aData.meMode = ScConditionEntry::GetModeFromApi( static_cast<sheet::ConditionOperator>(nOperator) );
}
OUString SAL_CALL ScTableConditionalEntry::getFormula1()
@@ -625,7 +625,7 @@ ScValidationData* ScTableValidationObj::CreateValidationData( ScDocument* pDoc,
FormulaGrammar::Grammar eGrammar1 = lclResolveGrammar( eGrammar, meGrammar1 );
FormulaGrammar::Grammar eGrammar2 = lclResolveGrammar( eGrammar, meGrammar2 );
- ScValidationData* pRet = new ScValidationData( (ScValidationMode)nValMode,
+ ScValidationData* pRet = new ScValidationData( static_cast<ScValidationMode>(nValMode),
nMode,
aExpr1, aExpr2, pDoc, aSrcPos,
maExprNmsp1, maExprNmsp2,
@@ -651,7 +651,7 @@ ScValidationData* ScTableValidationObj::CreateValidationData( ScDocument* pDoc,
pRet->SetInput( aInputTitle, aInputMessage );
if (!bShowInput)
pRet->ResetInput();
- pRet->SetError( aErrorTitle, aErrorMessage, (ScValidErrorStyle)nErrorStyle );
+ pRet->SetError( aErrorTitle, aErrorMessage, static_cast<ScValidErrorStyle>(nErrorStyle) );
if (!bShowError)
pRet->ResetError();
@@ -709,7 +709,7 @@ sal_Int32 SAL_CALL ScTableValidationObj::getConditionOperator()
void SAL_CALL ScTableValidationObj::setConditionOperator( sal_Int32 nOperator )
{
SolarMutexGuard aGuard;
- nMode = ScConditionEntry::GetModeFromApi( (css::sheet::ConditionOperator)nOperator );
+ nMode = ScConditionEntry::GetModeFromApi( static_cast<css::sheet::ConditionOperator>(nOperator) );
}
OUString SAL_CALL ScTableValidationObj::getFormula1()
@@ -827,8 +827,7 @@ void SAL_CALL ScTableValidationObj::setPropertyValue(
}
else if ( aPropertyName == SC_UNONAME_TYPE )
{
- sheet::ValidationType eType = (sheet::ValidationType)
- ScUnoHelpFunctions::GetEnumFromAny( aValue );
+ sheet::ValidationType eType = static_cast<sheet::ValidationType>(ScUnoHelpFunctions::GetEnumFromAny( aValue ));
switch (eType)
{
case sheet::ValidationType_ANY: nValMode = SC_VALID_ANY; break;
@@ -847,8 +846,7 @@ void SAL_CALL ScTableValidationObj::setPropertyValue(
}
else if ( aPropertyName == SC_UNONAME_ERRALSTY )
{
- sheet::ValidationAlertStyle eStyle = (sheet::ValidationAlertStyle)
- ScUnoHelpFunctions::GetEnumFromAny( aValue );
+ sheet::ValidationAlertStyle eStyle = static_cast<sheet::ValidationAlertStyle>(ScUnoHelpFunctions::GetEnumFromAny( aValue ));
switch (eStyle)
{
case sheet::ValidationAlertStyle_STOP: nErrorStyle = SC_VALERR_STOP; break;
diff --git a/sc/source/ui/unoobj/srchuno.cxx b/sc/source/ui/unoobj/srchuno.cxx
index ffd0b1894ca0..92923e8a296f 100644
--- a/sc/source/ui/unoobj/srchuno.cxx
+++ b/sc/source/ui/unoobj/srchuno.cxx
@@ -169,7 +169,7 @@ uno::Any SAL_CALL ScCellSearchObj::getPropertyValue( const OUString& aPropertyNa
else if (aPropertyName == SC_UNO_SRCHSIMADD) aRet <<= static_cast<sal_Int16>(pSearchItem->GetLEVLonger());
else if (aPropertyName == SC_UNO_SRCHSIMEX) aRet <<= static_cast<sal_Int16>(pSearchItem->GetLEVOther());
else if (aPropertyName == SC_UNO_SRCHSIMREM) aRet <<= static_cast<sal_Int16>(pSearchItem->GetLEVShorter());
- else if (aPropertyName == SC_UNO_SRCHTYPE) aRet <<= (sal_Int16) pSearchItem->GetCellType();
+ else if (aPropertyName == SC_UNO_SRCHTYPE) aRet <<= static_cast<sal_Int16>(pSearchItem->GetCellType());
else if (aPropertyName == SC_UNO_SRCHFILTERED) aRet <<= pSearchItem->IsSearchFiltered();
else if (aPropertyName == SC_UNO_SRCHFORMATTED) aRet <<= pSearchItem->IsSearchFormatted();
diff --git a/sc/source/ui/unoobj/targuno.cxx b/sc/source/ui/unoobj/targuno.cxx
index ed05e87b579c..d3d2deb062de 100644
--- a/sc/source/ui/unoobj/targuno.cxx
+++ b/sc/source/ui/unoobj/targuno.cxx
@@ -229,7 +229,7 @@ void ScLinkTargetTypeObj::SetLinkTargetBitmap( uno::Any& rRet, sal_uInt16 nType
}
if (nImgId != ScContentId::ROOT)
{
- BitmapEx aBitmapEx(aContentBmps[(int)nImgId -1 ]);
+ BitmapEx aBitmapEx(aContentBmps[static_cast<int>(nImgId) -1 ]);
rRet <<= uno::Reference< awt::XBitmap > (VCLUnoHelper::CreateBitmap(aBitmapEx));
}
}
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index 511b14ec3498..e2b27fc09b9e 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -185,7 +185,7 @@ sal_Int32 SAL_CALL ScViewPaneBase::getFirstVisibleColumn()
ScViewData& rViewData = pViewShell->GetViewData();
ScSplitPos eWhich = ( nPane == SC_VIEWPANE_ACTIVE ) ?
rViewData.GetActivePart() :
- (ScSplitPos) nPane;
+ static_cast<ScSplitPos>(nPane);
ScHSplitPos eWhichH = WhichH( eWhich );
return rViewData.GetPosX( eWhichH );
@@ -202,7 +202,7 @@ void SAL_CALL ScViewPaneBase::setFirstVisibleColumn(sal_Int32 nFirstVisibleColum
ScViewData& rViewData = pViewShell->GetViewData();
ScSplitPos eWhich = ( nPane == SC_VIEWPANE_ACTIVE ) ?
rViewData.GetActivePart() :
- (ScSplitPos) nPane;
+ static_cast<ScSplitPos>(nPane);
ScHSplitPos eWhichH = WhichH( eWhich );
long nDeltaX = static_cast<long>(nFirstVisibleColumn) - rViewData.GetPosX( eWhichH );
@@ -218,7 +218,7 @@ sal_Int32 SAL_CALL ScViewPaneBase::getFirstVisibleRow()
ScViewData& rViewData = pViewShell->GetViewData();
ScSplitPos eWhich = ( nPane == SC_VIEWPANE_ACTIVE ) ?
rViewData.GetActivePart() :
- (ScSplitPos) nPane;
+ static_cast<ScSplitPos>(nPane);
ScVSplitPos eWhichV = WhichV( eWhich );
return rViewData.GetPosY( eWhichV );
@@ -235,7 +235,7 @@ void SAL_CALL ScViewPaneBase::setFirstVisibleRow( sal_Int32 nFirstVisibleRow )
ScViewData& rViewData = pViewShell->GetViewData();
ScSplitPos eWhich = ( nPane == SC_VIEWPANE_ACTIVE ) ?
rViewData.GetActivePart() :
- (ScSplitPos) nPane;
+ static_cast<ScSplitPos>(nPane);
ScVSplitPos eWhichV = WhichV( eWhich );
long nDeltaY = static_cast<long>(nFirstVisibleRow) - rViewData.GetPosY( eWhichV );
@@ -252,7 +252,7 @@ table::CellRangeAddress SAL_CALL ScViewPaneBase::getVisibleRange()
ScViewData& rViewData = pViewShell->GetViewData();
ScSplitPos eWhich = ( nPane == SC_VIEWPANE_ACTIVE ) ?
rViewData.GetActivePart() :
- (ScSplitPos) nPane;
+ static_cast<ScSplitPos>(nPane);
ScHSplitPos eWhichH = WhichH( eWhich );
ScVSplitPos eWhichV = WhichV( eWhich );
@@ -304,7 +304,7 @@ namespace
ScViewData& rViewData = _pViewShell->GetViewData();
ScSplitPos eWhich = ( _nPane == SC_VIEWPANE_ACTIVE ) ?
rViewData.GetActivePart() :
- (ScSplitPos) _nPane;
+ static_cast<ScSplitPos>(_nPane);
_rpWindow = _pViewShell->GetWindowByPos( eWhich );
_rpSdrView = _pViewShell->GetSdrView();
_rpFormShell = _pViewShell->GetFormShell();
@@ -380,7 +380,7 @@ awt::Rectangle ScViewPaneBase::GetVisArea() const
{
ScSplitPos eWhich = ( nPane == SC_VIEWPANE_ACTIVE ) ?
pViewShell->GetViewData().GetActivePart() :
- (ScSplitPos) nPane;
+ static_cast<ScSplitPos>(nPane);
ScGridWindow* pWindow = static_cast<ScGridWindow*>(pViewShell->GetWindowByPos(eWhich));
ScDocument* pDoc = pViewShell->GetViewData().GetDocument();
if (pWindow && pDoc)
@@ -1801,7 +1801,7 @@ void SAL_CALL ScTabViewObj::setPropertyValue(
//#i80528# adapt to new range eventually
if(sal_Int16(VOBJ_MODE_HIDE) < nIntVal) nIntVal = sal_Int16(VOBJ_MODE_SHOW);
- aNewOpt.SetObjMode( VOBJ_TYPE_OLE, (ScVObjMode)nIntVal);
+ aNewOpt.SetObjMode( VOBJ_TYPE_OLE, static_cast<ScVObjMode>(nIntVal));
}
}
else if ( aPropertyName == SC_UNO_SHOWCHARTS )
@@ -1812,7 +1812,7 @@ void SAL_CALL ScTabViewObj::setPropertyValue(
//#i80528# adapt to new range eventually
if(sal_Int16(VOBJ_MODE_HIDE) < nIntVal) nIntVal = sal_Int16(VOBJ_MODE_SHOW);
- aNewOpt.SetObjMode( VOBJ_TYPE_CHART, (ScVObjMode)nIntVal);
+ aNewOpt.SetObjMode( VOBJ_TYPE_CHART, static_cast<ScVObjMode>(nIntVal));
}
}
else if ( aPropertyName == SC_UNO_SHOWDRAW )
@@ -1823,7 +1823,7 @@ void SAL_CALL ScTabViewObj::setPropertyValue(
//#i80528# adapt to new range eventually
if(sal_Int16(VOBJ_MODE_HIDE) < nIntVal) nIntVal = sal_Int16(VOBJ_MODE_SHOW);
- aNewOpt.SetObjMode( VOBJ_TYPE_DRAW, (ScVObjMode)nIntVal);
+ aNewOpt.SetObjMode( VOBJ_TYPE_DRAW, static_cast<ScVObjMode>(nIntVal));
}
}
else if ( aPropertyName == SC_UNO_GRIDCOLOR )
diff --git a/sc/source/ui/vba/vbaformat.cxx b/sc/source/ui/vba/vbaformat.cxx
index 941c840d1e94..cc83083d892b 100644
--- a/sc/source/ui/vba/vbaformat.cxx
+++ b/sc/source/ui/vba/vbaformat.cxx
@@ -664,16 +664,16 @@ ScVbaFormat< Ifc... >::setReadingOrder( const uno::Any& ReadingOrder )
switch(nReadingOrder)
{
case excel::Constants::xlLTR:
- aVal <<= (sal_Int16) text::WritingMode_LR_TB;
+ aVal <<= sal_Int16(text::WritingMode_LR_TB);
break;
case excel::Constants::xlRTL:
- aVal <<= (sal_Int16) text::WritingMode_RL_TB;
+ aVal <<= sal_Int16(text::WritingMode_RL_TB);
break;
case excel::Constants::xlContext:
// TODO implement xlContext
// Reading order has to depend on the language of the first letter
// written.
- aVal <<= (sal_Int16) text::WritingMode_LR_TB;
+ aVal <<= sal_Int16(text::WritingMode_LR_TB);
break;
default:
DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString());
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index c77bcb3a409e..414f30bf9cac 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1353,7 +1353,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
if ( pLinkItem )
bAsLink = pLinkItem->GetValue();
if ( pMoveItem )
- eMoveMode = (InsCellCmd) pMoveItem->GetValue();
+ eMoveMode = static_cast<InsCellCmd>(pMoveItem->GetValue());
}
else
{
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 0b0c21627944..ce5fb36a4bb7 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -882,9 +882,9 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
if ( pOutSet->GetItemState( FID_VALID_MODE, true, &pItem ) == SfxItemState::SET )
- eMode = (ScValidationMode) static_cast<const SfxAllEnumItem*>(pItem)->GetValue();
+ eMode = static_cast<ScValidationMode>(static_cast<const SfxAllEnumItem*>(pItem)->GetValue());
if ( pOutSet->GetItemState( FID_VALID_CONDMODE, true, &pItem ) == SfxItemState::SET )
- eOper = (ScConditionMode) static_cast<const SfxAllEnumItem*>(pItem)->GetValue();
+ eOper = static_cast<ScConditionMode>(static_cast<const SfxAllEnumItem*>(pItem)->GetValue());
if ( pOutSet->GetItemState( FID_VALID_VALUE1, true, &pItem ) == SfxItemState::SET )
{
OUString aTemp1 = static_cast<const SfxStringItem*>(pItem)->GetValue();
@@ -951,7 +951,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
if ( pOutSet->GetItemState( FID_VALID_SHOWERR, true, &pItem ) == SfxItemState::SET )
bShowError = static_cast<const SfxBoolItem*>(pItem)->GetValue();
if ( pOutSet->GetItemState( FID_VALID_ERRSTYLE, true, &pItem ) == SfxItemState::SET )
- eErrStyle = (ScValidErrorStyle) static_cast<const SfxAllEnumItem*>(pItem)->GetValue();
+ eErrStyle = static_cast<ScValidErrorStyle>(static_cast<const SfxAllEnumItem*>(pItem)->GetValue());
if ( pOutSet->GetItemState( FID_VALID_ERRTITLE, true, &pItem ) == SfxItemState::SET )
aErrTitle = static_cast<const SfxStringItem*>(pItem)->GetValue();
if ( pOutSet->GetItemState( FID_VALID_ERRTEXT, true, &pItem ) == SfxItemState::SET )
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index bb0496966d4e..0544f5bd08dd 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -1039,8 +1039,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
case SID_SET_SUPER_SCRIPT:
{
- SvxEscapement eOld = (SvxEscapement)
- pEditView->GetAttribs().Get(EE_CHAR_ESCAPEMENT).GetEnumValue();
+ SvxEscapement eOld = static_cast<SvxEscapement>(pEditView->GetAttribs().Get(EE_CHAR_ESCAPEMENT).GetEnumValue());
SvxEscapement eNew = (eOld == SvxEscapement::Superscript) ?
SvxEscapement::Off : SvxEscapement::Superscript;
aSet.Put( SvxEscapementItem( eNew, EE_CHAR_ESCAPEMENT ) );
@@ -1049,8 +1048,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
break;
case SID_SET_SUB_SCRIPT:
{
- SvxEscapement eOld = (SvxEscapement)
- pEditView->GetAttribs().Get(EE_CHAR_ESCAPEMENT).GetEnumValue();
+ SvxEscapement eOld = static_cast<SvxEscapement>(pEditView->GetAttribs().Get(EE_CHAR_ESCAPEMENT).GetEnumValue());
SvxEscapement eNew = (eOld == SvxEscapement::Subscript) ?
SvxEscapement::Off : SvxEscapement::Subscript;
aSet.Put( SvxEscapementItem( eNew, EE_CHAR_ESCAPEMENT ) );
@@ -1161,7 +1159,7 @@ void ScEditShell::GetAttrState(SfxItemSet &rSet)
if ( pHdl && pHdl->IsFormulaMode() )
rSet.ClearItem( EE_CHAR_WEIGHT ); // Highlighted brace not here
- SvxEscapement eEsc = (SvxEscapement) aAttribs.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue();
+ SvxEscapement eEsc = static_cast<SvxEscapement>(aAttribs.Get( EE_CHAR_ESCAPEMENT ).GetEnumValue());
if( eEsc == SvxEscapement::Superscript )
{
rSet.Put( SfxBoolItem( SID_SET_SUPER_SCRIPT, true ) );
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index ba95dba00a56..b7e9be249e63 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -279,7 +279,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
SfxStyleFamily eFamily = SfxStyleFamily::Para;
const SfxPoolItem* pFamItem;
if ( pArgs && SfxItemState::SET == pArgs->GetItemState( SID_STYLE_FAMILY, true, &pFamItem ) )
- eFamily = (SfxStyleFamily) static_cast<const SfxUInt16Item*>(pFamItem)->GetValue();
+ eFamily = static_cast<SfxStyleFamily>(static_cast<const SfxUInt16Item*>(pFamItem)->GetValue());
const SfxPoolItem* pNameItem;
OUString aStyleName;
if (pArgs && SfxItemState::SET == pArgs->GetItemState( nSlotId, true, &pNameItem ))
@@ -359,7 +359,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
SfxStyleFamily eFamily = SfxStyleFamily::Para;
const SfxPoolItem* pFamItem;
if ( pArgs && SfxItemState::SET == pArgs->GetItemState( SID_STYLE_FAMILY, true, &pFamItem ) )
- eFamily = (SfxStyleFamily) static_cast<const SfxUInt16Item*>(pFamItem)->GetValue();
+ eFamily = static_cast<SfxStyleFamily>(static_cast<const SfxUInt16Item*>(pFamItem)->GetValue());
else if ( pArgs && SfxItemState::SET == pArgs->GetItemState( SID_STYLE_FAMILYNAME, true, &pFamItem ) )
{
OUString sFamily = static_cast<const SfxStringItem*>(pFamItem)->GetValue();
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index c4d47392f141..9105c30870ac 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -1250,7 +1250,7 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY
rParam.maClipRect = rParam.maAlignRect;
if ( nNeeded > nMergeSizeX )
{
- SvxCellHorJustify eHorJust = (SvxCellHorJustify)nHorJustify;
+ SvxCellHorJustify eHorJust = static_cast<SvxCellHorJustify>(nHorJustify);
long nMissing = nNeeded - nMergeSizeX;
long nLeftMissing = 0;
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 070fe7dacd4f..1a36f04f2b68 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -936,7 +936,7 @@ ScSplitPos ScTabView::FindWindow( const vcl::Window* pWindow ) const
ScSplitPos eVal = SC_SPLIT_BOTTOMLEFT; // Default
for (sal_uInt16 i=0; i<4; i++)
if ( pGridWin[i] == pWindow )
- eVal = (ScSplitPos) i;
+ eVal = static_cast<ScSplitPos>(i);
return eVal;
}
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 6f40587c4d54..a6b94f86f091 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -1353,7 +1353,7 @@ void ScTabView::MoveCursorEnter( bool bShift ) // bShift -> up/down
SCCOL nMoveX = 0;
SCROW nMoveY = 0;
- switch ((ScDirection)rOpt.GetMoveDir())
+ switch (static_cast<ScDirection>(rOpt.GetMoveDir()))
{
case DIR_BOTTOM:
nMoveY = bShift ? -1 : 1;
@@ -2036,8 +2036,8 @@ void ScTabView::MakeEditView( ScEditEngineDefaulter* pEngine, SCCOL nCol, SCROW
{
if (pGridWin[i] && pGridWin[i]->IsVisible() && !aViewData.HasEditView(ScSplitPos(i)))
{
- ScHSplitPos eHWhich = WhichH( (ScSplitPos) i );
- ScVSplitPos eVWhich = WhichV( (ScSplitPos) i );
+ ScHSplitPos eHWhich = WhichH( static_cast<ScSplitPos>(i) );
+ ScVSplitPos eVWhich = WhichV( static_cast<ScSplitPos>(i) );
SCCOL nScrX = aViewData.GetPosX( eHWhich );
SCROW nScrY = aViewData.GetPosY( eVWhich );
@@ -2049,8 +2049,8 @@ void ScTabView::MakeEditView( ScEditEngineDefaulter* pEngine, SCCOL nCol, SCROW
// so input isn't lost (and the edit view may be scrolled into the visible area)
// #i26433# during spelling, the spelling view must be active
- if ( bPosVisible || aViewData.GetActivePart() == (ScSplitPos) i ||
- ( pSpellingView && aViewData.GetEditView((ScSplitPos) i) == pSpellingView ) )
+ if ( bPosVisible || aViewData.GetActivePart() == static_cast<ScSplitPos>(i) ||
+ ( pSpellingView && aViewData.GetEditView(static_cast<ScSplitPos>(i)) == pSpellingView ) )
{
pGridWin[i]->HideCursor();
@@ -2064,7 +2064,7 @@ void ScTabView::MakeEditView( ScEditEngineDefaulter* pEngine, SCCOL nCol, SCROW
// MapMode must be set after HideCursor
pGridWin[i]->SetMapMode(aViewData.GetLogicMode());
- aViewData.SetEditEngine( (ScSplitPos) i, pEngine, pGridWin[i], nCol, nRow );
+ aViewData.SetEditEngine( static_cast<ScSplitPos>(i), pEngine, pGridWin[i], nCol, nRow );
if ( !bPosVisible )
{
@@ -2115,12 +2115,12 @@ void ScTabView::KillEditView( bool bNoPaint )
nRow1 == aViewData.GetCurY();
for (sal_uInt16 i = 0; i < 4; i++)
{
- bPaint[i] = aViewData.HasEditView( (ScSplitPos) i );
+ bPaint[i] = aViewData.HasEditView( static_cast<ScSplitPos>(i) );
if (bPaint[i])
{
bNotifyAcc = true;
- EditView* pView = aViewData.GetEditView( (ScSplitPos) i );
+ EditView* pView = aViewData.GetEditView( static_cast<ScSplitPos>(i) );
aRectangle[i] = pView->GetInvalidateRect();
}
}
@@ -2250,8 +2250,8 @@ void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCRO
if (!pGridWin[i] || !pGridWin[i]->IsVisible())
continue;
- ScHSplitPos eHWhich = WhichH( (ScSplitPos) i );
- ScVSplitPos eVWhich = WhichV( (ScSplitPos) i );
+ ScHSplitPos eHWhich = WhichH( static_cast<ScSplitPos>(i) );
+ ScVSplitPos eVWhich = WhichV( static_cast<ScSplitPos>(i) );
bool bOut = false;
nCol1 = nStartCol;
@@ -2306,8 +2306,8 @@ void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCRO
bool bLayoutRTL = aViewData.GetDocument()->IsLayoutRTL( aViewData.GetTabNo() );
long nLayoutSign = bLayoutRTL ? -1 : 1;
- Point aStart = aViewData.GetScrPos( nCol1, nRow1, (ScSplitPos) i );
- Point aEnd = aViewData.GetScrPos( nCol2+1, nRow2+1, (ScSplitPos) i );
+ Point aStart = aViewData.GetScrPos( nCol1, nRow1, static_cast<ScSplitPos>(i) );
+ Point aEnd = aViewData.GetScrPos( nCol2+1, nRow2+1, static_cast<ScSplitPos>(i) );
if ( eMode == ScUpdateMode::All )
{
if (bIsTiledRendering)
@@ -2748,7 +2748,7 @@ void ScTabView::ActivateView( bool bActivate, bool bFirst )
{
if ( pGridWin[i] )
{
- eWin = (ScSplitPos) i;
+ eWin = static_cast<ScSplitPos>(i);
break; // for
}
}
diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx
index be95dcbab4b5..1fede34f367b 100644
--- a/sc/source/ui/view/tabview4.cxx
+++ b/sc/source/ui/view/tabview4.cxx
@@ -458,7 +458,7 @@ void ScTabView::UpdateScrollBars( HeaderType eHeaderType )
void ScTabView::InvertHorizontal( ScVSplitPos eWhich, long nDragPos )
{
for (sal_uInt16 i=0; i<4; i++)
- if (WhichV((ScSplitPos)i)==eWhich)
+ if (WhichV(static_cast<ScSplitPos>(i))==eWhich)
{
ScGridWindow* pWin = pGridWin[i].get();
if (pWin)
@@ -473,7 +473,7 @@ void ScTabView::InvertHorizontal( ScVSplitPos eWhich, long nDragPos )
void ScTabView::InvertVertical( ScHSplitPos eWhich, long nDragPos )
{
for (sal_uInt16 i=0; i<4; i++)
- if (WhichH((ScSplitPos)i)==eWhich)
+ if (WhichH(static_cast<ScSplitPos>(i))==eWhich)
{
ScGridWindow* pWin = pGridWin[i].get();
if (pWin)
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index eb76bafe7151..0d6a6a9324d0 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -171,8 +171,8 @@ ScTabView::~ScTabView()
ScViewData& rOtherViewData = pOtherViewShell->GetViewData();
for (int k = 0; k < 4; ++k)
{
- if (rOtherViewData.HasEditView((ScSplitPos)k))
- pThisViewShell->RemoveWindowFromForeignEditView(pOtherViewShell, (ScSplitPos)k);
+ if (rOtherViewData.HasEditView(static_cast<ScSplitPos>(k)))
+ pThisViewShell->RemoveWindowFromForeignEditView(pOtherViewShell, static_cast<ScSplitPos>(k));
}
};
@@ -234,7 +234,7 @@ void ScTabView::MakeDrawView( TriState nForceDesignMode )
for (i=0; i<4; i++)
if (pGridWin[i])
{
- if ( SC_SPLIT_BOTTOMLEFT != (ScSplitPos)i )
+ if ( SC_SPLIT_BOTTOMLEFT != static_cast<ScSplitPos>(i) )
pDrawView->AddWindowToPaintView(pGridWin[i], nullptr);
}
pDrawView->RecalcScale();
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 3c69bb0ce1d4..8b04b067818e 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -79,7 +79,7 @@ bool ScTabViewShell::GetFunction( OUString& rFuncStr, FormulaError nErrCode )
{
if ( !(nFuncs & (1 << nFunc)) )
continue;
- ScSubTotalFunc eFunc = (ScSubTotalFunc)nFunc;
+ ScSubTotalFunc eFunc = static_cast<ScSubTotalFunc>(nFunc);
if (bIgnoreError && (eFunc == SUBTOTAL_FUNC_CNT || eFunc == SUBTOTAL_FUNC_CNT2))
nErrCode = FormulaError::NONE;
diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx
index fe0ae20854f3..d7cac6b903b0 100644
--- a/sc/source/ui/view/tabvwshe.cxx
+++ b/sc/source/ui/view/tabvwshe.cxx
@@ -121,7 +121,7 @@ OUString ScTabViewShell::GetSelectionText( bool bWholeWord )
void ScTabViewShell::InsertURL( const OUString& rName, const OUString& rURL, const OUString& rTarget,
sal_uInt16 nMode )
{
- SvxLinkInsertMode eMode = (SvxLinkInsertMode) nMode;
+ SvxLinkInsertMode eMode = static_cast<SvxLinkInsertMode>(nMode);
bool bAsText = ( eMode != HLINK_BUTTON ); // default is now text
if ( bAsText )
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 90206529602e..8e5d5260fdcb 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -1765,7 +1765,7 @@ void ScViewData::ResetEditView()
{
if (bEditActive[i])
{
- lcl_LOKRemoveWindow(GetViewShell(), (ScSplitPos)i);
+ lcl_LOKRemoveWindow(GetViewShell(), static_cast<ScSplitPos>(i));
pEngine = pEditView[i]->GetEditEngine();
pEngine->RemoveView(pEditView[i]);
pEditView[i]->SetOutputArea( tools::Rectangle() );
@@ -2749,8 +2749,8 @@ void ScViewData::ReadUserData(const OUString& rData)
{
maTabData[nPos]->nCurX = SanitizeCol( static_cast<SCCOL>(aTabOpt.getToken(0,cTabSep).toInt32()));
maTabData[nPos]->nCurY = SanitizeRow( aTabOpt.getToken(1,cTabSep).toInt32());
- maTabData[nPos]->eHSplitMode = (ScSplitMode) aTabOpt.getToken(2,cTabSep).toInt32();
- maTabData[nPos]->eVSplitMode = (ScSplitMode) aTabOpt.getToken(3,cTabSep).toInt32();
+ maTabData[nPos]->eHSplitMode = static_cast<ScSplitMode>(aTabOpt.getToken(2,cTabSep).toInt32());
+ maTabData[nPos]->eVSplitMode = static_cast<ScSplitMode>(aTabOpt.getToken(3,cTabSep).toInt32());
if ( maTabData[nPos]->eHSplitMode == SC_SPLIT_FIX )
{
@@ -2768,7 +2768,7 @@ void ScViewData::ReadUserData(const OUString& rData)
else
maTabData[nPos]->nVSplitPos = aTabOpt.getToken(5,cTabSep).toInt32();
- maTabData[nPos]->eWhichActive = (ScSplitPos) aTabOpt.getToken(6,cTabSep).toInt32();
+ maTabData[nPos]->eWhichActive = static_cast<ScSplitPos>(aTabOpt.getToken(6,cTabSep).toInt32());
maTabData[nPos]->nPosX[0] = SanitizeCol( static_cast<SCCOL>(aTabOpt.getToken(7,cTabSep).toInt32()));
maTabData[nPos]->nPosX[1] = SanitizeCol( static_cast<SCCOL>(aTabOpt.getToken(8,cTabSep).toInt32()));
maTabData[nPos]->nPosY[0] = SanitizeRow( aTabOpt.getToken(9,cTabSep).toInt32());