[Libreoffice-commits] core.git: 6 commits - cui/source extensions/source include/rsc rsc/inc rsc/source sc/inc sc/source sd/source vcl/source
Noel Grandin
noel at peralex.com
Mon Oct 27 23:12:47 PDT 2014
cui/source/tabpages/transfrm.cxx | 2
extensions/source/propctrlr/standardcontrol.cxx | 2
include/rsc/rsc-vcl-shared-types.hxx | 2
rsc/inc/rscdb.hxx | 5
rsc/source/parser/rscibas.cxx | 6
sc/inc/drwlayer.hxx | 4
sc/source/core/opencl/openclwrapper.cxx | 4
sc/source/filter/excel/excimp8.cxx | 2
sc/source/filter/excel/tokstack.cxx | 52 ++--
sc/source/filter/excel/xiescher.cxx | 2
sc/source/filter/html/htmlexp.cxx | 56 ++--
sc/source/filter/html/htmlexp2.cxx | 4
sc/source/filter/html/htmlimp.cxx | 26 +-
sc/source/filter/inc/scflt.hxx | 24 +-
sc/source/filter/inc/tokstack.hxx | 2
sc/source/filter/rtf/eeimpars.cxx | 4
sc/source/filter/rtf/rtfexp.cxx | 16 -
sc/source/filter/rtf/rtfimp.cxx | 2
sc/source/filter/rtf/rtfparse.cxx | 6
sc/source/filter/starcalc/scflt.cxx | 10
sc/source/filter/xcl97/XclExpChangeTrack.cxx | 6
sc/source/filter/xcl97/xcl97esc.cxx | 10
sc/source/filter/xcl97/xcl97rec.cxx | 4
sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx | 8
sc/source/ui/attrdlg/attrdlg.cxx | 2
sc/source/ui/attrdlg/tabpages.cxx | 4
sc/source/ui/condformat/colorformat.cxx | 2
sc/source/ui/condformat/condformatdlgentry.cxx | 4
sc/source/ui/dbgui/consdlg.cxx | 8
sc/source/ui/dbgui/filtdlg.cxx | 6
sc/source/ui/dbgui/pfiltdlg.cxx | 6
sc/source/ui/dbgui/scendlg.cxx | 4
sc/source/ui/dbgui/sfiltdlg.cxx | 6
sc/source/ui/dbgui/tpsort.cxx | 16 -
sc/source/ui/dbgui/tpsubt.cxx | 18 -
sc/source/ui/dbgui/validate.cxx | 22 -
sc/source/ui/docshell/docfunc.cxx | 14 -
sc/source/ui/docshell/docsh.cxx | 28 +-
sc/source/ui/docshell/docsh3.cxx | 30 +-
sc/source/ui/docshell/docsh4.cxx | 70 +++---
sc/source/ui/docshell/docsh6.cxx | 4
sc/source/ui/docshell/tablink.cxx | 2
sc/source/ui/drawfunc/drawsh.cxx | 2
sc/source/ui/drawfunc/drawsh2.cxx | 2
sc/source/ui/drawfunc/drawsh4.cxx | 4
sc/source/ui/drawfunc/drawsh5.cxx | 6
sc/source/ui/drawfunc/drtxtob.cxx | 68 ++---
sc/source/ui/drawfunc/drtxtob2.cxx | 6
sc/source/ui/drawfunc/fuconcustomshape.cxx | 6
sc/source/ui/drawfunc/fuconpol.cxx | 2
sc/source/ui/drawfunc/fuconrec.cxx | 10
sc/source/ui/drawfunc/fuconstr.cxx | 2
sc/source/ui/drawfunc/fudraw.cxx | 2
sc/source/ui/drawfunc/fuins1.cxx | 8
sc/source/ui/drawfunc/fuins2.cxx | 6
sc/source/ui/drawfunc/fusel.cxx | 6
sc/source/ui/drawfunc/futext.cxx | 10
sc/source/ui/drawfunc/graphsh.cxx | 22 -
sc/source/ui/formdlg/formula.cxx | 8
sc/source/ui/miscdlgs/acredlin.cxx | 14 -
sc/source/ui/miscdlgs/anyrefdg.cxx | 22 -
sc/source/ui/miscdlgs/autofmt.cxx | 32 +-
sc/source/ui/miscdlgs/crnrdlg.cxx | 16 -
sc/source/ui/miscdlgs/scuiautofmt.cxx | 2
sc/source/ui/miscdlgs/tabbgcolordlg.cxx | 2
sc/source/ui/miscdlgs/textdlgs.cxx | 2
sc/source/ui/navipi/content.cxx | 14 -
sc/source/ui/navipi/navipi.cxx | 4
sc/source/ui/navipi/scenwnd.cxx | 4
sc/source/ui/optdlg/tpcalc.cxx | 2
sc/source/ui/optdlg/tpdefaults.cxx | 2
sc/source/ui/optdlg/tpformula.cxx | 2
sc/source/ui/optdlg/tpprint.cxx | 4
sc/source/ui/optdlg/tpusrlst.cxx | 8
sc/source/ui/optdlg/tpview.cxx | 40 +--
sc/source/ui/pagedlg/areasdlg.cxx | 2
sc/source/ui/pagedlg/hfedtdlg.cxx | 16 -
sc/source/ui/pagedlg/tphf.cxx | 8
sc/source/ui/pagedlg/tphfedit.cxx | 4
sc/source/ui/pagedlg/tptable.cxx | 10
sc/source/ui/sidebar/AlignmentPropertyPanel.cxx | 12 -
sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx | 2
sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx | 4
sc/source/ui/styleui/styledlg.cxx | 10
sc/source/ui/undo/areasave.cxx | 4
sc/source/ui/undo/undobase.cxx | 2
sc/source/ui/undo/undoblk.cxx | 38 +--
sc/source/ui/undo/undoblk2.cxx | 2
sc/source/ui/undo/undoblk3.cxx | 28 +-
sc/source/ui/undo/undocell.cxx | 16 -
sc/source/ui/undo/undodat.cxx | 14 -
sc/source/ui/undo/undotab.cxx | 16 -
sc/source/ui/unoobj/afmtuno.cxx | 4
sc/source/ui/unoobj/cellsuno.cxx | 48 ++--
sc/source/ui/unoobj/chart2uno.cxx | 4
sc/source/ui/unoobj/chartuno.cxx | 8
sc/source/ui/unoobj/datauno.cxx | 2
sc/source/ui/unoobj/docuno.cxx | 8
sc/source/ui/unoobj/editsrc.cxx | 2
sc/source/ui/unoobj/fielduno.cxx | 2
sc/source/ui/unoobj/linkuno.cxx | 8
sc/source/ui/unoobj/notesuno.cxx | 2
sc/source/ui/unoobj/shapeuno.cxx | 28 +-
sc/source/ui/unoobj/styleuno.cxx | 42 +--
sc/source/ui/unoobj/textuno.cxx | 4
sc/source/ui/unoobj/viewuno.cxx | 2
sc/source/ui/vba/excelvbahelper.cxx | 2
sc/source/ui/vba/vbaapplication.cxx | 10
sc/source/ui/vba/vbafont.cxx | 10
sc/source/ui/vba/vbaformat.cxx | 4
sc/source/ui/vba/vbawindow.cxx | 6
sc/source/ui/view/auditsh.cxx | 4
sc/source/ui/view/cellsh1.cxx | 74 +++---
sc/source/ui/view/cellsh2.cxx | 38 +--
sc/source/ui/view/cellsh3.cxx | 26 +-
sc/source/ui/view/cellsh4.cxx | 8
sc/source/ui/view/dbfunc.cxx | 8
sc/source/ui/view/dbfunc4.cxx | 2
sc/source/ui/view/drawvie3.cxx | 6
sc/source/ui/view/drawvie4.cxx | 12 -
sc/source/ui/view/drawview.cxx | 14 -
sc/source/ui/view/editsh.cxx | 38 +--
sc/source/ui/view/formatsh.cxx | 116 +++++-----
sc/source/ui/view/gridwin.cxx | 30 +-
sc/source/ui/view/gridwin4.cxx | 18 -
sc/source/ui/view/gridwin5.cxx | 4
sc/source/ui/view/output.cxx | 48 ++--
sc/source/ui/view/output2.cxx | 84 +++----
sc/source/ui/view/preview.cxx | 18 -
sc/source/ui/view/prevwsh.cxx | 20 -
sc/source/ui/view/prevwsh2.cxx | 8
sc/source/ui/view/printfun.cxx | 78 +++---
sc/source/ui/view/reffact.cxx | 14 -
sc/source/ui/view/tabcont.cxx | 2
sc/source/ui/view/tabview3.cxx | 4
sc/source/ui/view/tabvwsh2.cxx | 4
sc/source/ui/view/tabvwsh3.cxx | 50 ++--
sc/source/ui/view/tabvwsh4.cxx | 22 -
sc/source/ui/view/tabvwsh5.cxx | 10
sc/source/ui/view/tabvwsha.cxx | 16 -
sc/source/ui/view/tabvwshb.cxx | 14 -
sc/source/ui/view/tabvwshe.cxx | 12 -
sc/source/ui/view/tabvwshf.cxx | 22 -
sc/source/ui/view/tabvwshh.cxx | 4
sc/source/ui/view/viewdata.cxx | 18 -
sc/source/ui/view/viewfun2.cxx | 18 -
sc/source/ui/view/viewfun3.cxx | 8
sc/source/ui/view/viewfun7.cxx | 4
sc/source/ui/view/viewfunc.cxx | 34 +-
sd/source/filter/html/pubdlg.cxx | 2
sd/source/ui/dlg/animobjs.cxx | 2
sd/source/ui/dlg/dlgass.cxx | 4
sd/source/ui/dlg/present.cxx | 2
vcl/source/control/field2.cxx | 38 +--
154 files changed, 1095 insertions(+), 1092 deletions(-)
New commits:
commit 17a99a9074a7d25cc7e13bf7aaac0fa11e2174a0
Author: Noel Grandin <noel at peralex.com>
Date: Mon Oct 27 20:41:11 2014 +0200
fdo#84938: replace TIMEF_ constants with enum
Change-Id: Ia6aa4e21fef46b20d1d8996d2f15855b8ba1776e
Reviewed-on: https://gerrit.libreoffice.org/12114
Tested-by: LibreOffice gerrit bot <gerrit at libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx
index 126f24b..60d64a9 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -72,7 +72,7 @@ namespace pcr
:OTimeControl_Base( PropertyControlType::TimeField, pParent, nWinStyle )
{
getTypedControlWindow()->SetStrictFormat( true );
- getTypedControlWindow()->SetFormat( TIMEF_SEC );
+ getTypedControlWindow()->SetFormat( TimeFieldFormat::F_SEC );
getTypedControlWindow()->EnableEmptyFieldValue( true );
}
diff --git a/include/rsc/rsc-vcl-shared-types.hxx b/include/rsc/rsc-vcl-shared-types.hxx
index 203fa73..b93864f 100644
--- a/include/rsc/rsc-vcl-shared-types.hxx
+++ b/include/rsc/rsc-vcl-shared-types.hxx
@@ -23,7 +23,7 @@
#include <sal/types.h>
#include <o3tl/typed_flags_set.hxx>
-enum TimeFieldFormat {TIMEF_NONE, TIMEF_SEC, TIMEF_100TH_SEC, TIMEF_SEC_CS, TimeFieldFormat_FORCE_EQUAL_SIZE=SAL_MAX_ENUM };
+enum class TimeFieldFormat : sal_Int32 { F_NONE, F_SEC, F_100TH_SEC, F_SEC_CS };
enum class KeyFuncType : sal_Int32 { DONTKNOW, NEW, OPEN, SAVE,
SAVEAS, PRINT, CLOSE, QUIT,
diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx
index 6dad375..1212fad 100644
--- a/rsc/inc/rscdb.hxx
+++ b/rsc/inc/rscdb.hxx
@@ -39,6 +39,7 @@ class RscCmdLine;
enum class SymbolType : sal_uInt16;
enum class ToolBoxItemBits;
enum class WindowBorderStyle : sal_uInt16;
+enum class TimeFieldFormat : sal_Int32;
enum class KeyFuncType : sal_Int32;
struct WriteRcContext
@@ -142,11 +143,13 @@ class RscTypCont
void Init(); // Initialisiert Klassen und Tabelle
void SETCONST( RscConst *, const char *, sal_uInt32 );
+ void SETCONST( RscConst *, Atom, sal_uInt32 );
inline void SETCONST( RscConst *p1, const char * p2, SymbolType p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); }
inline void SETCONST( RscConst *p1, Atom p2, ToolBoxItemBits p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); }
inline void SETCONST( RscConst *p1, Atom p2, WindowBorderStyle p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); }
inline void SETCONST( RscConst *p1, const char * p2, KeyFuncType p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); }
- void SETCONST( RscConst *, Atom, sal_uInt32 );
+ inline void SETCONST( RscConst *p1, Atom p2, TimeFieldFormat p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); }
+ inline void SETCONST( RscConst *p1, const char * p2, TimeFieldFormat p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); }
RscEnum * InitLangType();
RscEnum * InitFieldUnitsType();
RscEnum * InitTimeFieldFormat();
diff --git a/rsc/source/parser/rscibas.cxx b/rsc/source/parser/rscibas.cxx
index a7c5c2d..da5d688 100644
--- a/rsc/source/parser/rscibas.cxx
+++ b/rsc/source/parser/rscibas.cxx
@@ -209,9 +209,9 @@ RscEnum * RscTypCont::InitTimeFieldFormat()
pTimeFieldFormat = new RscEnum( pHS->getID( "EnumTimeFieldFormat" ),
RSC_NOTYPE );
- SETCONST( pTimeFieldFormat, "TIMEF_NONE", TIMEF_NONE );
- SETCONST( pTimeFieldFormat, "TIMEF_SEC", TIMEF_SEC );
- SETCONST( pTimeFieldFormat, "TIMEF_100TH_SEC", TIMEF_100TH_SEC );
+ SETCONST( pTimeFieldFormat, "TIMEF_NONE", TimeFieldFormat::F_NONE );
+ SETCONST( pTimeFieldFormat, "TIMEF_SEC", TimeFieldFormat::F_SEC );
+ SETCONST( pTimeFieldFormat, "TIMEF_100TH_SEC", TimeFieldFormat::F_100TH_SEC );
return pTimeFieldFormat;
}
diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx
index 5ddeb2f..9070b75 100644
--- a/sd/source/filter/html/pubdlg.cxx
+++ b/sd/source/filter/html/pubdlg.cxx
@@ -446,7 +446,7 @@ SdPublishingDlg::SdPublishingDlg(vcl::Window* pWindow, DocumentType eDocType)
pPage2_ChgDefault->SetClickHdl(LINK(this,SdPublishingDlg, SlideChgHdl));
pPage2_ChgAuto->SetClickHdl(LINK(this,SdPublishingDlg, SlideChgHdl));
- pPage2_Duration->SetFormat( TIMEF_SEC );
+ pPage2_Duration->SetFormat( TimeFieldFormat::F_SEC );
pPage5_Buttons->SetSelectHdl(LINK(this,SdPublishingDlg, ButtonsHdl ));
pPage5_Buttons->SetStyle( pPage5_Buttons->GetStyle() | WB_VSCROLL );
diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx
index 407bdda..df22072 100644
--- a/sd/source/ui/dlg/animobjs.cxx
+++ b/sd/source/ui/dlg/animobjs.cxx
@@ -170,7 +170,7 @@ AnimationWindow::AnimationWindow( SfxBindings* pInBindings,
pControllerItem = new AnimationControllerItem( SID_ANIMATOR_STATE, this, pBindings );
// as long as not in the resource
- aTimeField.SetFormat( TIMEF_SEC_CS );
+ aTimeField.SetFormat( TimeFieldFormat::F_SEC_CS );
aBtnFirst.SetClickHdl( LINK( this, AnimationWindow, ClickFirstHdl ) );
aBtnReverse.SetClickHdl( LINK( this, AnimationWindow, ClickPlayHdl ) );
diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx
index 08eb6f3..9338dc4 100644
--- a/sd/source/ui/dlg/dlgass.cxx
+++ b/sd/source/ui/dlg/dlgass.cxx
@@ -520,9 +520,9 @@ AssistentDlgImpl::AssistentDlgImpl( vcl::Window* pWindow, const Link& rFinishLin
mpPage3PresTypeLiveRB->Check();
mpPage3PresTypeLiveRB->SetClickHdl( LINK(this,AssistentDlgImpl, PresTypeHdl ));
mpPage3PresTypeKioskRB->SetClickHdl( LINK(this,AssistentDlgImpl, PresTypeHdl ));
- mpPage3PresTimeTMF->SetFormat( TIMEF_SEC );
+ mpPage3PresTimeTMF->SetFormat( TimeFieldFormat::F_SEC );
mpPage3PresTimeTMF->SetTime( ::tools::Time( 0, 0, 10 ) );
- mpPage3BreakTMF->SetFormat( TIMEF_SEC );
+ mpPage3BreakTMF->SetFormat( TimeFieldFormat::F_SEC );
mpPage3BreakTMF->SetTime( ::tools::Time( 0, 0, 10 ) );
mpPage3LogoCB->Check();
diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx
index 21e1fed..c819643 100644
--- a/sd/source/ui/dlg/present.cxx
+++ b/sd/source/ui/dlg/present.cxx
@@ -84,7 +84,7 @@ SdStartPresentationDlg::SdStartPresentationDlg( vcl::Window* pWindow,
aRbtAuto->SetClickHdl( aLink );
aTmfPause->SetModifyHdl( LINK( this, SdStartPresentationDlg, ChangePauseHdl ) );
- aTmfPause->SetFormat( TIMEF_SEC );
+ aTmfPause->SetFormat( TimeFieldFormat::F_SEC );
// fill Listbox with page names
for (std::vector<OUString>::const_iterator pIter = rPageNames.begin(); pIter != rPageNames.end(); ++pIter)
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index fbc74e3..326b946 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -2011,8 +2011,8 @@ static bool ImplTimeProcessKeyInput( Edit*, const KeyEvent& rKEvt,
(rLocaleDataWrapper.getTimePM().indexOf(cChar) != -1) ||
// Accept AM/PM:
(cChar == 'a') || (cChar == 'A') || (cChar == 'm') || (cChar == 'M') || (cChar == 'p') || (cChar == 'P') ||
- ((eFormat == TIMEF_100TH_SEC) && string::equals(rLocaleDataWrapper.getTime100SecSep(), cChar)) ||
- ((eFormat == TIMEF_SEC_CS) && string::equals(rLocaleDataWrapper.getTime100SecSep(), cChar)) ||
+ ((eFormat == TimeFieldFormat::F_100TH_SEC) && string::equals(rLocaleDataWrapper.getTime100SecSep(), cChar)) ||
+ ((eFormat == TimeFieldFormat::F_SEC_CS) && string::equals(rLocaleDataWrapper.getTime100SecSep(), cChar)) ||
(bDuration && (cChar == '-')) )
return false;
else
@@ -2091,7 +2091,7 @@ static bool ImplTimeGetValue( const OUString& rStr, tools::Time& rTime,
sal_Int32 nSepPos = aStr.indexOf( rLocaleDataWrapper.getTimeSep() );
if ( aStr[0] == '-' )
bNegative = true;
- if ( eFormat != TIMEF_SEC_CS )
+ if ( eFormat != TimeFieldFormat::F_SEC_CS )
{
if ( nSepPos < 0 )
nSepPos = aStr.getLength();
@@ -2197,9 +2197,9 @@ static bool ImplTimeGetValue( const OUString& rStr, tools::Time& rTime,
if ( (nMinute > 59) || (nSecond > 59) || (nNanoSec > 1000000000) )
return false;
- if ( eFormat == TIMEF_NONE )
+ if ( eFormat == TimeFieldFormat::F_NONE )
nSecond = nNanoSec = 0;
- else if ( eFormat == TIMEF_SEC )
+ else if ( eFormat == TimeFieldFormat::F_SEC )
nNanoSec = 0;
if ( !bDuration )
@@ -2275,12 +2275,12 @@ bool TimeFormatter::ImplTimeReformat( const OUString& rStr, OUString& rOutStr )
bool bSecond = false;
bool b100Sec = false;
- if ( meFormat != TIMEF_NONE )
+ if ( meFormat != TimeFieldFormat::F_NONE )
bSecond = true;
- if ( meFormat == TIMEF_100TH_SEC )
+ if ( meFormat == TimeFieldFormat::F_100TH_SEC )
b100Sec = true;
- if ( meFormat == TIMEF_SEC_CS )
+ if ( meFormat == TimeFieldFormat::F_SEC_CS )
{
sal_uLong n = aTempTime.GetHour() * 3600L;
n += aTempTime.GetMin() * 60L;
@@ -2331,7 +2331,7 @@ void TimeField::ImplTimeSpinArea( bool bUp )
Selection aSelection( GetField()->GetSelection() );
// Area search
- if ( GetFormat() != TIMEF_SEC_CS )
+ if ( GetFormat() != TimeFieldFormat::F_SEC_CS )
{
//Which area is the cursor in of HH:MM:SS.TT
for ( sal_Int32 i = 1, nPos = 0; i <= 4; i++ )
@@ -2396,7 +2396,7 @@ void TimeField::ImplTimeSpinArea( bool bUp )
void TimeFormatter::ImplInit()
{
- meFormat = TIMEF_NONE;
+ meFormat = TimeFieldFormat::F_NONE;
mbDuration = false;
mnTimeFormat = HOUR_24; // Should become a ExtTimeFieldFormat in next implementation, merge with mbDuration and meFormat
}
@@ -2545,11 +2545,11 @@ void TimeFormatter::ImplSetUserTime( const tools::Time& rNewTime, Selection* pNe
OUString aStr;
bool bSec = false;
bool b100Sec = false;
- if ( meFormat != TIMEF_NONE )
+ if ( meFormat != TimeFieldFormat::F_NONE )
bSec = true;
- if ( meFormat == TIMEF_100TH_SEC || meFormat == TIMEF_SEC_CS )
+ if ( meFormat == TimeFieldFormat::F_100TH_SEC || meFormat == TimeFieldFormat::F_SEC_CS )
b100Sec = true;
- if ( meFormat == TIMEF_SEC_CS )
+ if ( meFormat == TimeFieldFormat::F_SEC_CS )
{
sal_uLong n = aNewTime.GetHour() * 3600L;
n += aNewTime.GetMin() * 60L;
@@ -2782,40 +2782,40 @@ void TimeField::SetExtFormat( ExtTimeFieldFormat eFormat )
{
SetTimeFormat( HOUR_24 );
SetDuration( false );
- SetFormat( TIMEF_NONE );
+ SetFormat( TimeFieldFormat::F_NONE );
}
break;
case EXTTIMEF_24H_LONG:
{
SetTimeFormat( HOUR_24 );
SetDuration( false );
- SetFormat( TIMEF_SEC );
+ SetFormat( TimeFieldFormat::F_SEC );
}
break;
case EXTTIMEF_12H_SHORT:
{
SetTimeFormat( HOUR_12 );
SetDuration( false );
- SetFormat( TIMEF_NONE );
+ SetFormat( TimeFieldFormat::F_NONE );
}
break;
case EXTTIMEF_12H_LONG:
{
SetTimeFormat( HOUR_12 );
SetDuration( false );
- SetFormat( TIMEF_SEC );
+ SetFormat( TimeFieldFormat::F_SEC );
}
break;
case EXTTIMEF_DURATION_SHORT:
{
SetDuration( true );
- SetFormat( TIMEF_NONE );
+ SetFormat( TimeFieldFormat::F_NONE );
}
break;
case EXTTIMEF_DURATION_LONG:
{
SetDuration( true );
- SetFormat( TIMEF_SEC );
+ SetFormat( TimeFieldFormat::F_SEC );
}
break;
default: OSL_FAIL( "ExtTimeFieldFormat unknown!" );
commit 282e954477f904524ca192256c4e33ab0585e2f6
Author: Noel Grandin <noel at peralex.com>
Date: Mon Oct 27 14:18:59 2014 +0200
loplugin: cstylecast
Change-Id: I42cd0be78478536322357ca7a03cf30e624b1afc
diff --git a/sc/source/ui/vba/excelvbahelper.cxx b/sc/source/ui/vba/excelvbahelper.cxx
index 6a74558..a4b345d 100644
--- a/sc/source/ui/vba/excelvbahelper.cxx
+++ b/sc/source/ui/vba/excelvbahelper.cxx
@@ -218,7 +218,7 @@ getDocShell( const css::uno::Reference< css::frame::XModel>& xModel )
ScModelObj* pModel = dynamic_cast< ScModelObj* >( xIf.get() );
ScDocShell* pDocShell = NULL;
if ( pModel )
- pDocShell = (ScDocShell*)pModel->GetEmbeddedObject();
+ pDocShell = static_cast<ScDocShell*>(pModel->GetEmbeddedObject());
return pDocShell;
}
diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx
index 6852923..3cc6dd7 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -468,7 +468,7 @@ ScVbaApplication::wait( double time ) throw (uno::RuntimeException, std::excepti
SbxVariableRef aRef = new SbxVariable;
aRef->PutDouble( time );
aArgs->Put( aRef, 1 );
- SbMethod* pMeth = (SbMethod*)pBasic->GetRtl()->Find( OUString("WaitUntil"), SbxCLASS_METHOD );
+ SbMethod* pMeth = static_cast<SbMethod*>(pBasic->GetRtl()->Find( OUString("WaitUntil"), SbxCLASS_METHOD ));
if ( pMeth )
{
@@ -563,7 +563,7 @@ ScVbaApplication::GoTo( const uno::Any& Reference, const uno::Any& Scroll ) thro
uno::Reference< sheet::XSpreadsheet > xDoc = xSpreadsheet->getActiveSheet();
ScTabViewShell* pShell = excel::getCurrentBestViewShell( mxContext );
- ScGridWindow* gridWindow = (ScGridWindow*)pShell->GetWindow();
+ ScGridWindow* gridWindow = static_cast<ScGridWindow*>(pShell->GetWindow());
try
{
uno::Reference< excel::XRange > xVbaSheetRange = ScVbaRange::getRangeObjectForName(
@@ -605,7 +605,7 @@ ScVbaApplication::GoTo( const uno::Any& Reference, const uno::Any& Scroll ) thro
{
uno::Reference< excel::XRange > xVbaRange( Reference, uno::UNO_QUERY );
ScTabViewShell* pShell = excel::getCurrentBestViewShell( mxContext );
- ScGridWindow* gridWindow = (ScGridWindow*)pShell->GetWindow();
+ ScGridWindow* gridWindow = static_cast<ScGridWindow*>(pShell->GetWindow());
if ( xVbaRange.is() )
{
//TODO bScroll should be using, In this time, it doesenot have effection
@@ -1245,7 +1245,7 @@ ScVbaApplication::getDisplayFormulaBar()
pViewShell->GetState( reqList );
const SfxPoolItem *pItem=0;
if ( reqList.GetItemState( FID_TOGGLEINPUTLINE, false, &pItem ) == SfxItemState::SET )
- bRes = ((SfxBoolItem*)pItem)->GetValue();
+ bRes = static_cast<const SfxBoolItem*>(pItem)->GetValue();
}
return bRes;
}
@@ -1268,7 +1268,7 @@ uno::Any SAL_CALL
ScVbaApplication::Caller( const uno::Any& /*aIndex*/ ) throw ( uno::RuntimeException, std::exception )
{
StarBASIC* pBasic = SfxGetpApp()->GetBasic();
- SbMethod* pMeth = (SbMethod*)pBasic->GetRtl()->Find( OUString("FuncCaller"), SbxCLASS_METHOD );
+ SbMethod* pMeth = static_cast<SbMethod*>(pBasic->GetRtl()->Find( OUString("FuncCaller"), SbxCLASS_METHOD ));
uno::Any aRet;
if ( pMeth )
{
diff --git a/sc/source/ui/vba/vbafont.cxx b/sc/source/ui/vba/vbafont.cxx
index 5d92e70..7d3cde1 100644
--- a/sc/source/ui/vba/vbafont.cxx
+++ b/sc/source/ui/vba/vbafont.cxx
@@ -104,8 +104,8 @@ ScVbaFont::setSuperscript( const uno::Any& aValue ) throw ( uno::RuntimeExceptio
nValue = SUPERSCRIPT;
nValue2 = SUPERSCRIPTHEIGHT;
}
- xProps->setPropertyValue("CharEscapement", ( uno::Any )nValue );
- xProps->setPropertyValue("CharEscapementHeight", ( uno::Any )nValue2 );
+ xProps->setPropertyValue("CharEscapement", uno::Any(nValue) );
+ xProps->setPropertyValue("CharEscapementHeight", uno::Any(nValue2) );
}
uno::Any SAL_CALL
@@ -177,8 +177,8 @@ ScVbaFont::setSubscript( const uno::Any& aValue ) throw ( uno::RuntimeException,
nValue2 = SUBSCRIPTHEIGHT;
}
- xProps->setPropertyValue("CharEscapementHeight", ( uno::Any )nValue2 );
- xProps->setPropertyValue("CharEscapement", ( uno::Any )nValue );
+ xProps->setPropertyValue("CharEscapementHeight", uno::Any(nValue2) );
+ xProps->setPropertyValue("CharEscapement", uno::Any(nValue) );
}
@@ -372,7 +372,7 @@ ScVbaFont::setUnderline( const uno::Any& aValue ) throw ( uno::RuntimeException,
throw uno::RuntimeException("Unknown value for Underline" );
}
- mxFont->setPropertyValue("CharUnderline", ( uno::Any )nValue );
+ mxFont->setPropertyValue("CharUnderline", uno::Any(nValue) );
}
diff --git a/sc/source/ui/vba/vbaformat.cxx b/sc/source/ui/vba/vbaformat.cxx
index 7edec3f..e2cff4b 100644
--- a/sc/source/ui/vba/vbaformat.cxx
+++ b/sc/source/ui/vba/vbaformat.cxx
@@ -554,7 +554,7 @@ ScVbaFormat<Ifc1>::getLocked( ) throw (script::BasicErrorException, uno::Runtim
SfxItemSet* pDataSet = getCurrentDataSet();
if ( pDataSet )
{
- const ScProtectionAttr& rProtAttr = (const ScProtectionAttr &) pDataSet->Get(ATTR_PROTECTION, true);
+ const ScProtectionAttr& rProtAttr = static_cast<const ScProtectionAttr &>( pDataSet->Get(ATTR_PROTECTION, true) );
SfxItemState eState = pDataSet->GetItemState(ATTR_PROTECTION, true, NULL);
if(eState != SfxItemState::DONTCARE)
aCellProtection = uno::makeAny(rProtAttr.GetProtection());
@@ -587,7 +587,7 @@ ScVbaFormat<Ifc1>::getFormulaHidden( ) throw (script::BasicErrorException, uno:
SfxItemSet* pDataSet = getCurrentDataSet();
if ( pDataSet )
{
- const ScProtectionAttr& rProtAttr = (const ScProtectionAttr &) pDataSet->Get(ATTR_PROTECTION, true);
+ const ScProtectionAttr& rProtAttr = static_cast<const ScProtectionAttr &>( pDataSet->Get(ATTR_PROTECTION, true) );
SfxItemState eState = pDataSet->GetItemState(ATTR_PROTECTION, true, NULL);
if(eState != SfxItemState::DONTCARE)
aBoolRet = uno::makeAny(rProtAttr.GetHideFormula());
diff --git a/sc/source/ui/vba/vbawindow.cxx b/sc/source/ui/vba/vbawindow.cxx
index b5daf6c..d6090a8 100644
--- a/sc/source/ui/vba/vbawindow.cxx
+++ b/sc/source/ui/vba/vbawindow.cxx
@@ -102,7 +102,7 @@ public:
ScModelObj* pModel = static_cast< ScModelObj* >( m_xModel.get() );
if ( !pModel )
throw uno::RuntimeException("Cannot obtain current document" );
- ScDocShell* pDocShell = (ScDocShell*)pModel->GetEmbeddedObject();
+ ScDocShell* pDocShell = static_cast<ScDocShell*>(pModel->GetEmbeddedObject());
if ( !pDocShell )
throw uno::RuntimeException("Cannot obtain docshell" );
ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel );
@@ -411,7 +411,7 @@ ScVbaWindow::getWindowState() throw (uno::RuntimeException, std::exception)
// !! TODO !! get view shell from controller
ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel );
SfxViewFrame* pViewFrame = pViewShell -> GetViewFrame();
- WorkWindow* pWork = (WorkWindow*) pViewFrame->GetFrame().GetSystemWindow();
+ WorkWindow* pWork = static_cast<WorkWindow*>( pViewFrame->GetFrame().GetSystemWindow() );
if ( pWork )
{
if ( pWork -> IsMaximized())
@@ -430,7 +430,7 @@ ScVbaWindow::setWindowState( const uno::Any& _windowstate ) throw (uno::RuntimeE
// !! TODO !! get view shell from controller
ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel );
SfxViewFrame* pViewFrame = pViewShell -> GetViewFrame();
- WorkWindow* pWork = (WorkWindow*) pViewFrame->GetFrame().GetSystemWindow();
+ WorkWindow* pWork = static_cast<WorkWindow*>( pViewFrame->GetFrame().GetSystemWindow() );
if ( pWork )
{
if ( nwindowState == xlMaximized)
diff --git a/sc/source/ui/view/auditsh.cxx b/sc/source/ui/view/auditsh.cxx
index ac5b37f..80ccc5f 100644
--- a/sc/source/ui/view/auditsh.cxx
+++ b/sc/source/ui/view/auditsh.cxx
@@ -97,8 +97,8 @@ void ScAuditingShell::Execute( SfxRequest& rReq )
{
OSL_ENSURE( pXItem->ISA(SfxInt16Item) && pYItem->ISA(SfxInt32Item),
"wrong items" );
- SCsCOL nCol = static_cast<SCsCOL>(((const SfxInt16Item*) pXItem)->GetValue());
- SCsROW nRow = static_cast<SCsROW>(((const SfxInt32Item*) pYItem)->GetValue());
+ SCsCOL nCol = static_cast<SCsCOL>(static_cast<const SfxInt16Item*>(pXItem)->GetValue());
+ SCsROW nRow = static_cast<SCsROW>(static_cast<const SfxInt32Item*>(pYItem)->GetValue());
ScViewFunc* pView = pViewData->GetView();
pView->MoveCursorAbs( nCol, nRow, SC_FOLLOW_LINE, false, false );
switch ( nFunction )
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 4440f9c..32c237d 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -181,7 +181,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
OUString aFlags;
if( pReqArgs->HasItem( FID_INS_CELL, &pItem ) )
- aFlags = ((const SfxStringItem*)pItem)->GetValue();
+ aFlags = static_cast<const SfxStringItem*>(pItem)->GetValue();
if( !aFlags.isEmpty() )
{
switch( aFlags[0] )
@@ -250,7 +250,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
OUString aFlags;
if( pReqArgs->HasItem( FID_DELETE_CELL, &pItem ) )
- aFlags = ((const SfxStringItem*)pItem)->GetValue();
+ aFlags = static_cast<const SfxStringItem*>(pItem)->GetValue();
if( !aFlags.isEmpty() )
{
switch( aFlags[0] )
@@ -330,7 +330,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
OUString aFlags('A');
if( pReqArgs->HasItem( SID_DELETE, &pItem ) )
- aFlags = ((const SfxStringItem*)pItem)->GetValue();
+ aFlags = static_cast<const SfxStringItem*>(pItem)->GetValue();
aFlags = aFlags.toAsciiUpperCase();
bool bCont = true;
@@ -441,7 +441,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
OUString aFlags('A');
if( pReqArgs->HasItem( FID_FILL_TAB, &pItem ) )
- aFlags = ((const SfxStringItem*)pItem)->GetValue();
+ aFlags = static_cast<const SfxStringItem*>(pItem)->GetValue();
aFlags = aFlags.toAsciiUpperCase();
bool bCont = true;
@@ -559,17 +559,17 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
bDoIt=false;
if( pReqArgs->HasItem( FID_FILL_SERIES, &pItem ) )
- aFillDir = ((const SfxStringItem*)pItem)->GetValue();
+ aFillDir = static_cast<const SfxStringItem*>(pItem)->GetValue();
if( pReqArgs->HasItem( FN_PARAM_1, &pItem ) )
- aFillCmd = ((const SfxStringItem*)pItem)->GetValue();
+ aFillCmd = static_cast<const SfxStringItem*>(pItem)->GetValue();
if( pReqArgs->HasItem( FN_PARAM_2, &pItem ) )
- aFillDateCmd = ((const SfxStringItem*)pItem)->GetValue();
+ aFillDateCmd = static_cast<const SfxStringItem*>(pItem)->GetValue();
if( pReqArgs->HasItem( FN_PARAM_3, &pItem ) )
- aFillStep = ((const SfxStringItem*)pItem)->GetValue();
+ aFillStep = static_cast<const SfxStringItem*>(pItem)->GetValue();
if( pReqArgs->HasItem( FN_PARAM_4, &pItem ) )
- aFillStart = ((const SfxStringItem*)pItem)->GetValue();
+ aFillStart = static_cast<const SfxStringItem*>(pItem)->GetValue();
if( pReqArgs->HasItem( FN_PARAM_5, &pItem ) )
- aFillMax = ((const SfxStringItem*)pItem)->GetValue();
+ aFillMax = static_cast<const SfxStringItem*>(pItem)->GetValue();
if( !aFillDir.isEmpty() )
switch( aFillDir[0] )
@@ -808,7 +808,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
if( pReqArgs->HasItem( FID_FILL_AUTO, &pItem ) )
{
ScAddress aScAddress;
- OUString aArg = ((const SfxStringItem*)pItem)->GetValue();
+ OUString aArg = static_cast<const SfxStringItem*>(pItem)->GetValue();
if( aScAddress.Parse( aArg, pDoc, pDoc->GetAddressConvention() ) & SCA_VALID )
{
@@ -1106,7 +1106,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
if( pReqArgs->HasItem( SID_OUTLINE_MAKE, &pItem ) )
{
- OUString aCol = ((const SfxStringItem*)pItem)->GetValue();
+ OUString aCol = static_cast<const SfxStringItem*>(pItem)->GetValue();
aCol = aCol.toAsciiUpperCase();
switch( aCol[0] )
@@ -1167,7 +1167,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
if( pReqArgs->HasItem( SID_OUTLINE_REMOVE, &pItem ) )
{
- OUString aCol = ((const SfxStringItem*)pItem)->GetValue();
+ OUString aCol = static_cast<const SfxStringItem*>(pItem)->GetValue();
aCol = aCol.toAsciiUpperCase();
switch (aCol[0])
@@ -1255,7 +1255,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET &&
pItem->ISA(SfxUInt32Item) )
{
- nFormat = ((const SfxUInt32Item*)pItem)->GetValue();
+ nFormat = static_cast<const SfxUInt32Item*>(pItem)->GetValue();
}
if ( nFormat )
@@ -1303,7 +1303,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
OUString aFlags('A');
if( pReqArgs->HasItem( FID_INS_CELL_CONTENTS, &pItem ) )
- aFlags = ((const SfxStringItem*)pItem)->GetValue();
+ aFlags = static_cast<const SfxStringItem*>(pItem)->GetValue();
aFlags = aFlags.toAsciiUpperCase();
bool bCont = true;
@@ -1509,7 +1509,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET &&
pItem->ISA(SfxUInt32Item) )
{
- sal_uLong nFormat = ((const SfxUInt32Item*)pItem)->GetValue();
+ sal_uLong nFormat = static_cast<const SfxUInt32Item*>(pItem)->GetValue();
bool bRet=true;
{
WaitObject aWait( GetViewData()->GetDialogParent() );
@@ -1802,7 +1802,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
pReqArgs->GetItemState( SCITEM_CONSOLIDATEDATA, true, &pItem ) )
{
const ScConsolidateParam& rParam =
- ((const ScConsolidateItem*)pItem)->GetData();
+ static_cast<const ScConsolidateItem*>(pItem)->GetData();
pTabViewShell->Consolidate( rParam );
GetViewData()->GetDocument()->SetConsolidateDlgData( &rParam );
@@ -1818,13 +1818,13 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
case SID_INS_FUNCTION:
{
- const SfxBoolItem* pOkItem = (const SfxBoolItem*)&pReqArgs->Get( SID_DLG_RETOK );
+ const SfxBoolItem* pOkItem = static_cast<const SfxBoolItem*>(&pReqArgs->Get( SID_DLG_RETOK ));
if ( pOkItem->GetValue() ) // OK
{
OUString aFormula;
- const SfxStringItem* pSItem = (const SfxStringItem*)&pReqArgs->Get( SCITEM_STRING );
- const SfxBoolItem* pMatrixItem = (const SfxBoolItem*) &pReqArgs->Get( SID_DLG_MATRIX );
+ const SfxStringItem* pSItem = static_cast<const SfxStringItem*>(&pReqArgs->Get( SCITEM_STRING ));
+ const SfxBoolItem* pMatrixItem = static_cast<const SfxBoolItem*>(&pReqArgs->Get( SID_DLG_MATRIX ));
aFormula += pSItem->GetValue();
pScMod->ActivateInputWindow( &aFormula, pMatrixItem->GetValue() );
@@ -1844,13 +1844,13 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
OUString aName, aSymbol, aAttrib;
if( pReqArgs->HasItem( FID_DEFINE_NAME, &pItem ) )
- aName = ((const SfxStringItem*)pItem)->GetValue();
+ aName = static_cast<const SfxStringItem*>(pItem)->GetValue();
if( pReqArgs->HasItem( FN_PARAM_1, &pItem ) )
- aSymbol = ((const SfxStringItem*)pItem)->GetValue();
+ aSymbol = static_cast<const SfxStringItem*>(pItem)->GetValue();
if( pReqArgs->HasItem( FN_PARAM_2, &pItem ) )
- aAttrib = ((const SfxStringItem*)pItem)->GetValue();
+ aAttrib = static_cast<const SfxStringItem*>(pItem)->GetValue();
if ( !aName.isEmpty() && !aSymbol.isEmpty() )
{
@@ -2043,7 +2043,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
const SfxPoolItem* pItem;
if( pReqArgs->HasItem( SID_UPDATECHART, &pItem ) )
- bAll = ((const SfxBoolItem*)pItem)->GetValue();
+ bAll = static_cast<const SfxBoolItem*>(pItem)->GetValue();
}
pTabViewShell->UpdateCharts( bAll );
@@ -2060,8 +2060,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
if (pReqArgs)
{
const ScTabOpItem& rItem =
- (const ScTabOpItem&)
- pReqArgs->Get( SID_TABOP );
+ static_cast<const ScTabOpItem&>(
+ pReqArgs->Get( SID_TABOP ));
pTabViewShell->TabOp( rItem.GetData() );
@@ -2073,8 +2073,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
if (pReqArgs)
{
const ScSolveItem& rItem =
- (const ScSolveItem&)
- pReqArgs->Get( SCITEM_SOLVEDATA );
+ static_cast<const ScSolveItem&>(
+ pReqArgs->Get( SCITEM_SOLVEDATA ));
pTabViewShell->Solve( rItem.GetData() );
@@ -2123,7 +2123,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
case SID_RANGE_NOTETEXT:
if (pReqArgs)
{
- const SfxStringItem& rTextItem = (const SfxStringItem&)pReqArgs->Get( SID_RANGE_NOTETEXT );
+ const SfxStringItem& rTextItem = static_cast<const SfxStringItem&>(pReqArgs->Get( SID_RANGE_NOTETEXT ));
// always cursor position
ScAddress aPos( GetViewData()->GetCurX(), GetViewData()->GetCurY(), GetViewData()->GetTabNo() );
@@ -2135,9 +2135,9 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
case SID_INSERT_POSTIT:
if ( pReqArgs )
{
- const SvxPostItAuthorItem& rAuthorItem = (const SvxPostItAuthorItem&)pReqArgs->Get( SID_ATTR_POSTIT_AUTHOR );
- const SvxPostItDateItem& rDateItem = (const SvxPostItDateItem&) pReqArgs->Get( SID_ATTR_POSTIT_DATE );
- const SvxPostItTextItem& rTextItem = (const SvxPostItTextItem&) pReqArgs->Get( SID_ATTR_POSTIT_TEXT );
+ const SvxPostItAuthorItem& rAuthorItem = static_cast<const SvxPostItAuthorItem&>(pReqArgs->Get( SID_ATTR_POSTIT_AUTHOR ));
+ const SvxPostItDateItem& rDateItem = static_cast<const SvxPostItDateItem&>(pReqArgs->Get( SID_ATTR_POSTIT_DATE ));
+ const SvxPostItTextItem& rTextItem = static_cast<const SvxPostItTextItem&>(pReqArgs->Get( SID_ATTR_POSTIT_TEXT ));
ScAddress aPos( GetViewData()->GetCurX(), GetViewData()->GetCurY(), GetViewData()->GetTabNo() );
pTabViewShell->ReplaceNote( aPos, rTextItem.GetValue(), &rAuthorItem.GetValue(), &rDateItem.GetValue() );
@@ -2158,7 +2158,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
bool bShow;
const SfxPoolItem* pItem;
if ( pReqArgs && (pReqArgs->GetItemState( FID_NOTE_VISIBLE, true, &pItem ) == SfxItemState::SET) )
- bShow = ((const SfxBoolItem*) pItem)->GetValue();
+ bShow = static_cast<const SfxBoolItem*>(pItem)->GetValue();
else
bShow = !pNote->IsCaptionShown();
@@ -2320,7 +2320,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
if ( pReqArgs )
{
const SfxStringItem* pItem =
- (const SfxStringItem*)&pReqArgs->Get( SID_SELECT_SCENARIO );
+ static_cast<const SfxStringItem*>(&pReqArgs->Get( SID_SELECT_SCENARIO ));
if( pItem )
{
@@ -2343,7 +2343,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
const SfxPoolItem* pItem;
if( pReqArgs->HasItem( SID_HYPERLINK_SETLINK, &pItem ) )
{
- const SvxHyperlinkItem* pHyper = (const SvxHyperlinkItem*) pItem;
+ const SvxHyperlinkItem* pHyper = static_cast<const SvxHyperlinkItem*>(pItem);
const OUString& rName = pHyper->GetName();
const OUString& rURL = pHyper->GetURL();
const OUString& rTarget = pHyper->GetTargetFrame();
@@ -2706,7 +2706,7 @@ void ScCellShell::ExecuteSubtotals(SfxRequest& rReq)
const SfxItemSet* pArgs = rReq.GetArgs();
if ( pArgs )
{
- pTabViewShell->DoSubTotals( ((const ScSubTotalItem&) pArgs->Get( SCITEM_SUBTDATA )).
+ pTabViewShell->DoSubTotals( static_cast<const ScSubTotalItem&>( pArgs->Get( SCITEM_SUBTDATA )).
GetSubTotalData() );
rReq.Done();
return;
@@ -2749,7 +2749,7 @@ void ScCellShell::ExecuteSubtotals(SfxRequest& rReq)
{
pOutSet = pDlg->GetOutputItemSet();
aSubTotalParam =
- ((const ScSubTotalItem&)
+ static_cast<const ScSubTotalItem&>(
pOutSet->Get( SCITEM_SUBTDATA )).
GetSubTotalData();
}
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 68c0bcb..a677101 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -490,7 +490,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
if ( pDlg->Execute() == RET_OK )
{
const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
- const ScSortParam& rOutParam = ((const ScSortItem&)
+ const ScSortParam& rOutParam = static_cast<const ScSortItem&>(
pOutSet->Get( SCITEM_SORTDATA )).GetSortData();
// subtotal when needed new
@@ -549,7 +549,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
if ( pArgs )
{
OSL_FAIL("SID_FILTER with arguments?");
- pTabViewShell->Query( ((const ScQueryItem&)
+ pTabViewShell->Query( static_cast<const ScQueryItem&>(
pArgs->Get( SCITEM_QUERYDATA )).GetQueryData(), NULL, true );
rReq.Done();
}
@@ -570,7 +570,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
if ( pArgs )
{
OSL_FAIL("SID_SPECIAL_FILTER with arguments?");
- pTabViewShell->Query( ((const ScQueryItem&)
+ pTabViewShell->Query( static_cast<const ScQueryItem&>(
pArgs->Get( SCITEM_QUERYDATA )).GetQueryData(), NULL, true );
rReq.Done();
}
@@ -661,7 +661,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
const ScDPObject* pDPObject = pTabViewShell->GetDialogDPObject();
if ( pDPObject )
{
- const ScPivotItem* pPItem = (const ScPivotItem*)pItem;
+ const ScPivotItem* pPItem = static_cast<const ScPivotItem*>(pItem);
bool bSuccess = pTabViewShell->MakePivotTable(
pPItem->GetData(), pPItem->GetDestRange(), pPItem->IsNewSheet(), *pDPObject );
SfxBoolItem aRet(0, bSuccess);
@@ -696,7 +696,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
if ( pReqArgs )
{
const SfxStringItem* pItem =
- (const SfxStringItem*)&pReqArgs->Get( SID_SELECT_DB );
+ static_cast<const SfxStringItem*>(&pReqArgs->Get( SID_SELECT_DB ));
if( pItem )
{
@@ -803,7 +803,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
SCROW nCurY = GetViewData()->GetCurY();
SCTAB nTab = GetViewData()->GetTabNo();
ScAddress aCursorPos( nCurX, nCurY, nTab );
- sal_uLong nIndex = ((SfxUInt32Item*)pDoc->GetAttr(
+ sal_uLong nIndex = static_cast<const SfxUInt32Item*>(pDoc->GetAttr(
nCurX, nCurY, nTab, ATTR_VALIDDATA ))->GetValue();
if ( nIndex )
{
@@ -854,12 +854,12 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
if ( pOutSet->GetItemState( FID_VALID_MODE, true, &pItem ) == SfxItemState::SET )
- eMode = (ScValidationMode) ((const SfxAllEnumItem*)pItem)->GetValue();
+ eMode = (ScValidationMode) static_cast<const SfxAllEnumItem*>(pItem)->GetValue();
if ( pOutSet->GetItemState( FID_VALID_CONDMODE, true, &pItem ) == SfxItemState::SET )
- eOper = (ScConditionMode) ((const SfxAllEnumItem*)pItem)->GetValue();
+ eOper = (ScConditionMode) static_cast<const SfxAllEnumItem*>(pItem)->GetValue();
if ( pOutSet->GetItemState( FID_VALID_VALUE1, true, &pItem ) == SfxItemState::SET )
{
- OUString aTemp1 = ((const SfxStringItem*)pItem)->GetValue();
+ OUString aTemp1 = static_cast<const SfxStringItem*>(pItem)->GetValue();
if (eMode == SC_VALID_DATE || eMode == SC_VALID_TIME)
{
sal_uInt32 nNumIndex = 0;
@@ -876,7 +876,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
}
if ( pOutSet->GetItemState( FID_VALID_VALUE2, true, &pItem ) == SfxItemState::SET )
{
- OUString aTemp2 = ((const SfxStringItem*)pItem)->GetValue();
+ OUString aTemp2 = static_cast<const SfxStringItem*>(pItem)->GetValue();
if (eMode == SC_VALID_DATE || eMode == SC_VALID_TIME)
{
sal_uInt32 nNumIndex = 0;
@@ -893,25 +893,25 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
}
if ( pOutSet->GetItemState( FID_VALID_BLANK, true, &pItem ) == SfxItemState::SET )
- bBlank = ((const SfxBoolItem*)pItem)->GetValue();
+ bBlank = static_cast<const SfxBoolItem*>(pItem)->GetValue();
if ( pOutSet->GetItemState( FID_VALID_LISTTYPE, true, &pItem ) == SfxItemState::SET )
- nListType = ((const SfxInt16Item*)pItem)->GetValue();
+ nListType = static_cast<const SfxInt16Item*>(pItem)->GetValue();
if ( pOutSet->GetItemState( FID_VALID_SHOWHELP, true, &pItem ) == SfxItemState::SET )
- bShowHelp = ((const SfxBoolItem*)pItem)->GetValue();
+ bShowHelp = static_cast<const SfxBoolItem*>(pItem)->GetValue();
if ( pOutSet->GetItemState( FID_VALID_HELPTITLE, true, &pItem ) == SfxItemState::SET )
- aHelpTitle = ((const SfxStringItem*)pItem)->GetValue();
+ aHelpTitle = static_cast<const SfxStringItem*>(pItem)->GetValue();
if ( pOutSet->GetItemState( FID_VALID_HELPTEXT, true, &pItem ) == SfxItemState::SET )
- aHelpText = ((const SfxStringItem*)pItem)->GetValue();
+ aHelpText = static_cast<const SfxStringItem*>(pItem)->GetValue();
if ( pOutSet->GetItemState( FID_VALID_SHOWERR, true, &pItem ) == SfxItemState::SET )
- bShowError = ((const SfxBoolItem*)pItem)->GetValue();
+ bShowError = static_cast<const SfxBoolItem*>(pItem)->GetValue();
if ( pOutSet->GetItemState( FID_VALID_ERRSTYLE, true, &pItem ) == SfxItemState::SET )
- eErrStyle = (ScValidErrorStyle) ((const SfxAllEnumItem*)pItem)->GetValue();
+ eErrStyle = (ScValidErrorStyle) static_cast<const SfxAllEnumItem*>(pItem)->GetValue();
if ( pOutSet->GetItemState( FID_VALID_ERRTITLE, true, &pItem ) == SfxItemState::SET )
- aErrTitle = ((const SfxStringItem*)pItem)->GetValue();
+ aErrTitle = static_cast<const SfxStringItem*>(pItem)->GetValue();
if ( pOutSet->GetItemState( FID_VALID_ERRTEXT, true, &pItem ) == SfxItemState::SET )
- aErrText = ((const SfxStringItem*)pItem)->GetValue();
+ aErrText = static_cast<const SfxStringItem*>(pItem)->GetValue();
ScValidationData aData( eMode, eOper, aExpr1, aExpr2, pDoc, aCursorPos );
aData.SetIgnoreBlank( bBlank );
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 99353aa..a94de11 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -117,7 +117,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
* 1: ER Click extends selection
* 2: ERG Click defines further selection
*/
- sal_uInt16 nMode = ((const SfxUInt16Item&)pReqArgs->Get( nSlot )).GetValue();
+ sal_uInt16 nMode = static_cast<const SfxUInt16Item&>(pReqArgs->Get( nSlot )).GetValue();
switch ( nMode )
{
@@ -178,7 +178,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
{
if ( pReqArgs )
{
- OUString aStr( ((const SfxStringItem&)pReqArgs->
+ OUString aStr( static_cast<const SfxStringItem&>(pReqArgs->
Get( SID_ENTER_STRING )).GetValue() );
pTabViewShell->EnterData( GetViewData()->GetCurX(),
@@ -209,7 +209,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
{
if ( pReqArgs )
{
- OUString aStr = ((const SfxStringItem&)pReqArgs->
+ OUString aStr = static_cast<const SfxStringItem&>(pReqArgs->
Get( SID_INSERT_MATRIX )).GetValue();
ScDocument* pDoc = GetViewData()->GetDocument();
pTabViewShell->EnterMatrix( aStr, pDoc->GetGrammar() );
@@ -226,8 +226,8 @@ void ScCellShell::Execute( SfxRequest& rReq )
break;
const ScInputStatusItem* pStatusItem
- = (const ScInputStatusItem*)&pReqArgs->
- Get( FID_INPUTLINE_STATUS );
+ = static_cast<const ScInputStatusItem*>(&pReqArgs->
+ Get( FID_INPUTLINE_STATUS ));
ScAddress aCursorPos = pStatusItem->GetPos();
OUString aString = pStatusItem->GetString();
@@ -476,9 +476,9 @@ void ScCellShell::Execute( SfxRequest& rReq )
OUString aArgComment;
const SfxPoolItem* pItem;
if ( pReqArgs->GetItemState( SID_SCENARIOS, true, &pItem ) == SfxItemState::SET )
- aArgName = ((const SfxStringItem*)pItem)->GetValue();
+ aArgName = static_cast<const SfxStringItem*>(pItem)->GetValue();
if ( pReqArgs->GetItemState( SID_NEW_TABLENAME, true, &pItem ) == SfxItemState::SET )
- aArgComment = ((const SfxStringItem*)pItem)->GetValue();
+ aArgComment = static_cast<const SfxStringItem*>(pItem)->GetValue();
aColor = Color( COL_LIGHTGRAY ); // Default
nFlags = 0; // not-TwoWay
@@ -525,7 +525,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
{
if ( pReqArgs )
{
- const SfxUInt16Item& rUInt16Item = (const SfxUInt16Item&)pReqArgs->Get( FID_ROW_HEIGHT );
+ const SfxUInt16Item& rUInt16Item = static_cast<const SfxUInt16Item&>(pReqArgs->Get( FID_ROW_HEIGHT ));
// #101390#; the value of the macro is in HMM so use HMMToTwips to convert
pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_DIRECT,
@@ -567,7 +567,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
{
if ( pReqArgs )
{
- const SfxUInt16Item& rUInt16Item = (const SfxUInt16Item&)pReqArgs->Get( FID_ROW_OPT_HEIGHT );
+ const SfxUInt16Item& rUInt16Item = static_cast<const SfxUInt16Item&>(pReqArgs->Get( FID_ROW_OPT_HEIGHT ));
// #101390#; the value of the macro is in HMM so use HMMToTwips to convert
pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_OPTIMAL,
@@ -608,7 +608,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
{
if ( pReqArgs )
{
- const SfxUInt16Item& rUInt16Item = (const SfxUInt16Item&)pReqArgs->Get( FID_COL_WIDTH );
+ const SfxUInt16Item& rUInt16Item = static_cast<const SfxUInt16Item&>(pReqArgs->Get( FID_COL_WIDTH ));
// #101390#; the value of the macro is in HMM so use HMMToTwips to convert
pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_DIRECT,
@@ -649,7 +649,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
{
if ( pReqArgs )
{
- const SfxUInt16Item& rUInt16Item = (const SfxUInt16Item&)pReqArgs->Get( FID_COL_OPT_WIDTH );
+ const SfxUInt16Item& rUInt16Item = static_cast<const SfxUInt16Item&>(pReqArgs->Get( FID_COL_OPT_WIDTH ));
// #101390#; the value of the macro is in HMM so use HMMToTwips to convert
pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_OPTIMAL,
@@ -752,7 +752,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET )
{
OSL_ENSURE(pItem && pItem->ISA(SfxBoolItem), "falsches Item");
- bMoveContents = ((const SfxBoolItem*)pItem)->GetValue();
+ bMoveContents = static_cast<const SfxBoolItem*>(pItem)->GetValue();
}
if (pTabViewShell->MergeCells( bApi, bMoveContents, true, bCenter ))
@@ -799,7 +799,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
{
if ( pReqArgs )
{
- const SfxStringItem& rNameItem = (const SfxStringItem&)pReqArgs->Get( SID_AUTOFORMAT );
+ const SfxStringItem& rNameItem = static_cast<const SfxStringItem&>(pReqArgs->Get( SID_AUTOFORMAT ));
ScAutoFormat* pFormat = ScGlobal::GetOrCreateAutoFormat();
ScAutoFormat::const_iterator it = pFormat->find(rNameItem.GetValue());
ScAutoFormat::const_iterator itBeg = pFormat->begin();
diff --git a/sc/source/ui/view/cellsh4.cxx b/sc/source/ui/view/cellsh4.cxx
index 5c6640b..0cd2a9f 100644
--- a/sc/source/ui/view/cellsh4.cxx
+++ b/sc/source/ui/view/cellsh4.cxx
@@ -44,9 +44,9 @@ void ScCellShell::ExecuteCursor( SfxRequest& rReq )
{
const SfxPoolItem* pItem;
if (pReqArgs->HasItem(FN_PARAM_1, &pItem))
- nRepeat = static_cast<SCsCOLROW>(((const SfxInt16Item*)pItem)->GetValue());
+ nRepeat = static_cast<SCsCOLROW>(static_cast<const SfxInt16Item*>(pItem)->GetValue());
if (pReqArgs->HasItem(FN_PARAM_2, &pItem))
- bSel = ((const SfxBoolItem*)pItem)->GetValue();
+ bSel = static_cast<const SfxBoolItem*>(pItem)->GetValue();
}
else
{
@@ -212,7 +212,7 @@ void ScCellShell::ExecuteCursorSel( SfxRequest& rReq )
{
const SfxPoolItem* pItem;
if (pReqArgs->HasItem(FN_PARAM_1, &pItem))
- nRepeat = static_cast<SCsCOLROW>(((const SfxInt16Item*)pItem)->GetValue());
+ nRepeat = static_cast<SCsCOLROW>(static_cast<const SfxInt16Item*>(pItem)->GetValue());
}
SCsROW nMovY = nRepeat;
@@ -400,7 +400,7 @@ void ScCellShell::ExecutePage( SfxRequest& rReq )
{
const SfxPoolItem* pItem;
if (pReqArgs->HasItem(FN_PARAM_2, &pItem))
- bSel = ((const SfxBoolItem*)pItem)->GetValue();
+ bSel = static_cast<const SfxBoolItem*>(pItem)->GetValue();
}
else
{
diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx
index 06b0f31..b2099de 100644
--- a/sc/source/ui/view/dbfunc.cxx
+++ b/sc/source/ui/view/dbfunc.cxx
@@ -304,7 +304,7 @@ void ScDBFunc::ToggleAutoFilter()
for (nCol=aParam.nCol1; nCol<=aParam.nCol2 && bHasAuto; nCol++)
{
- nFlag = ((ScMergeFlagAttr*) pDoc->
+ nFlag = static_cast<const ScMergeFlagAttr*>( pDoc->
GetAttr( nCol, nRow, nTab, ATTR_MERGE_FLAG ))->GetValue();
if ( (nFlag & SC_MF_AUTO) == 0 )
@@ -317,7 +317,7 @@ void ScDBFunc::ToggleAutoFilter()
for (nCol=aParam.nCol1; nCol<=aParam.nCol2; nCol++)
{
- nFlag = ((ScMergeFlagAttr*) pDoc->
+ nFlag = static_cast<const ScMergeFlagAttr*>( pDoc->
GetAttr( nCol, nRow, nTab, ATTR_MERGE_FLAG ))->GetValue();
pDoc->ApplyAttr( nCol, nRow, nTab, ScMergeFlagAttr( nFlag & ~SC_MF_AUTO ) );
}
@@ -373,7 +373,7 @@ void ScDBFunc::ToggleAutoFilter()
for (nCol=aParam.nCol1; nCol<=aParam.nCol2; nCol++)
{
- nFlag = ((ScMergeFlagAttr*) pDoc->
+ nFlag = static_cast<const ScMergeFlagAttr*>( pDoc->
GetAttr( nCol, nRow, nTab, ATTR_MERGE_FLAG ))->GetValue();
pDoc->ApplyAttr( nCol, nRow, nTab, ScMergeFlagAttr( nFlag | SC_MF_AUTO ) );
}
@@ -418,7 +418,7 @@ void ScDBFunc::HideAutoFilter()
for (SCCOL nCol=nCol1; nCol<=nCol2; nCol++)
{
- sal_Int16 nFlag = ((ScMergeFlagAttr*) rDoc.
+ sal_Int16 nFlag = static_cast<const ScMergeFlagAttr*>( rDoc.
GetAttr( nCol, nRow1, nTab, ATTR_MERGE_FLAG ))->GetValue();
rDoc.ApplyAttr( nCol, nRow1, nTab, ScMergeFlagAttr( nFlag & ~SC_MF_AUTO ) );
}
diff --git a/sc/source/ui/view/dbfunc4.cxx b/sc/source/ui/view/dbfunc4.cxx
index 08ae2b8..13da170 100644
--- a/sc/source/ui/view/dbfunc4.cxx
+++ b/sc/source/ui/view/dbfunc4.cxx
@@ -47,7 +47,7 @@ sal_uInt16 ScDBFunc::DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc, bo
{
if ( pObject->GetObjIdentifier() == OBJ_OLE2 && pDoc->IsChart( pObject ) )
{
- OUString aName = ((SdrOle2Obj*)pObject)->GetPersistName();
+ OUString aName = static_cast<SdrOle2Obj*>(pObject)->GetPersistName();
bool bHit = true;
if ( !bAllCharts )
{
diff --git a/sc/source/ui/view/drawvie3.cxx b/sc/source/ui/view/drawvie3.cxx
index 2d23728..d4bc93a 100644
--- a/sc/source/ui/view/drawvie3.cxx
+++ b/sc/source/ui/view/drawvie3.cxx
@@ -164,7 +164,7 @@ void ScDrawView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
if (dynamic_cast<const ScTabDeletedHint*>(&rHint)) // Tabelle geloescht
{
- SCTAB nDelTab = ((ScTabDeletedHint&)rHint).GetTab();
+ SCTAB nDelTab = static_cast<const ScTabDeletedHint&>(rHint).GetTab();
if (ValidTab(nDelTab))
{
// used to be: HidePagePgNum(nDelTab) - hide only if the deleted sheet is shown here
@@ -174,7 +174,7 @@ void ScDrawView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
else if (dynamic_cast<const ScTabSizeChangedHint*>(&rHint)) // Groesse geaendert
{
- if ( nTab == ((ScTabSizeChangedHint&)rHint).GetTab() )
+ if ( nTab == static_cast<const ScTabSizeChangedHint&>(rHint).GetTab() )
UpdateWorkArea();
}
else if ( const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>( &rHint ) )
@@ -204,7 +204,7 @@ void ScDrawView::UpdateIMap( SdrObject* pObj )
// Grafik vom Objekt besorgen
if ( pObj->ISA( SdrGrafObj ) )
- aGraphic = ( (SdrGrafObj*) pObj )->GetGraphic();
+ aGraphic = static_cast<SdrGrafObj*>(pObj)->GetGraphic();
else
{
const Graphic* pGraphic = static_cast<const SdrOle2Obj*>(pObj)->GetGraphic();
diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx
index 08a3565..b3b6e84 100644
--- a/sc/source/ui/view/drawvie4.cxx
+++ b/sc/source/ui/view/drawvie4.cxx
@@ -474,24 +474,24 @@ void ScDrawView::SetMarkedOriginalSize()
if (nIdent == OBJ_OLE2)
{
// TODO/LEAN: working with visual area can switch object to running state
- uno::Reference < embed::XEmbeddedObject > xObj( ((SdrOle2Obj*)pObj)->GetObjRef(), uno::UNO_QUERY );
+ uno::Reference < embed::XEmbeddedObject > xObj( static_cast<SdrOle2Obj*>(pObj)->GetObjRef(), uno::UNO_QUERY );
if ( xObj.is() ) // NULL for an invalid object that couldn't be loaded
{
- sal_Int64 nAspect = ((SdrOle2Obj*)pObj)->GetAspect();
+ sal_Int64 nAspect = static_cast<SdrOle2Obj*>(pObj)->GetAspect();
if ( nAspect == embed::Aspects::MSOLE_ICON )
{
MapMode aMapMode( MAP_100TH_MM );
- aOriginalSize = ((SdrOle2Obj*)pObj)->GetOrigObjSize( &aMapMode );
+ aOriginalSize = static_cast<SdrOle2Obj*>(pObj)->GetOrigObjSize( &aMapMode );
bDo = true;
}
else
{
- MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( ((SdrOle2Obj*)pObj)->GetAspect() ) );
+ MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( static_cast<SdrOle2Obj*>(pObj)->GetAspect() ) );
awt::Size aSz;
try
{
- aSz = xObj->getVisualAreaSize( ((SdrOle2Obj*)pObj)->GetAspect() );
+ aSz = xObj->getVisualAreaSize( static_cast<SdrOle2Obj*>(pObj)->GetAspect() );
aOriginalSize = OutputDevice::LogicToLogic(
Size( aSz.Width, aSz.Height ),
aUnit, MAP_100TH_MM );
@@ -505,7 +505,7 @@ void ScDrawView::SetMarkedOriginalSize()
}
else if (nIdent == OBJ_GRAF)
{
- const Graphic& rGraphic = ((SdrGrafObj*)pObj)->GetGraphic();
+ const Graphic& rGraphic = static_cast<SdrGrafObj*>(pObj)->GetGraphic();
MapMode aSourceMap = rGraphic.GetPrefMapMode();
MapMode aDestMap( MAP_100TH_MM );
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index 7180910..65e4572 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -369,7 +369,7 @@ void ScDrawView::MarkListHasChanged()
ScModule* pScMod = SC_MOD();
bool bUnoRefDialog = pScMod->IsRefDialogOpen() && pScMod->GetCurRefDlgId() == WID_SIMPLE_REF;
- ScClient* pClient = (ScClient*) pViewSh->GetIPClient();
+ ScClient* pClient = static_cast<ScClient*>( pViewSh->GetIPClient() );
if ( pClient && pClient->IsObjectInPlaceActive() && !bUnoRefDialog )
{
// beim ViewShell::Activate aus dem Reset2Open nicht die Handles anzeigen
@@ -398,7 +398,7 @@ void ScDrawView::MarkListHasChanged()
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
if (pObj->GetObjIdentifier() == OBJ_OLE2)
{
- pOle2Obj = (SdrOle2Obj*) pObj;
+ pOle2Obj = static_cast<SdrOle2Obj*>(pObj);
if (!pDoc->IsChart(pObj) )
pViewSh->SetOleObjectShell(true);
else
@@ -407,7 +407,7 @@ void ScDrawView::MarkListHasChanged()
}
else if (pObj->GetObjIdentifier() == OBJ_GRAF)
{
- pGrafObj = (SdrGrafObj*) pObj;
+ pGrafObj = static_cast<SdrGrafObj*>(pObj);
pViewSh->SetGraphicShell(true);
bSubShellSet = true;
}
@@ -432,7 +432,7 @@ void ScDrawView::MarkListHasChanged()
SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
if ( pObj->ISA( SdrObjGroup ) )
{
- const SdrObjList *pLst = ((SdrObjGroup*)pObj)->GetSubList();
+ const SdrObjList *pLst = static_cast<SdrObjGroup*>(pObj)->GetSubList();
const size_t nListCount = pLst->GetObjCount();
if ( nListCount == 0 )
{
@@ -509,7 +509,7 @@ void ScDrawView::MarkListHasChanged()
if(OUTDEV_WINDOW == rOutDev.GetOutDevType())
{
- ((vcl::Window&)rOutDev).Update();
+ static_cast<vcl::Window&>(rOutDev).Update();
}
}
@@ -901,7 +901,7 @@ void ScDrawView::SyncForGrid( SdrObject* pObj )
// process members of a group shape separately
if ( pObj->ISA( SdrObjGroup ) )
{
- SdrObjList *pLst = ((SdrObjGroup*)pObj)->GetSubList();
+ SdrObjList *pLst = static_cast<SdrObjGroup*>(pObj)->GetSubList();
for ( size_t i = 0, nCount = pLst->GetObjCount(); i < nCount; ++i )
SyncForGrid( pLst->GetObj( i ) );
}
@@ -957,7 +957,7 @@ SdrObject* ScDrawView::ApplyGraphicToObject(
{
if(dynamic_cast< SdrGrafObj* >(&rHitObject))
{
- SdrGrafObj* pNewGrafObj = (SdrGrafObj*)rHitObject.Clone();
+ SdrGrafObj* pNewGrafObj = static_cast<SdrGrafObj*>(rHitObject.Clone());
pNewGrafObj->SetGraphic(rGraphic);
BegUndo(rBeginUndoText);
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 956cea9..c91c1cb 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -197,7 +197,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
case SID_ATTR_INSERT:
if ( pReqArgs )
{
- bIsInsertMode = ((const SfxBoolItem&)pReqArgs->Get(nSlot)).GetValue();
+ bIsInsertMode = static_cast<const SfxBoolItem&>(pReqArgs->Get(nSlot)).GetValue();
pTableView->SetInsertMode( bIsInsertMode );
if (pTopView)
pTopView->SetInsertMode( bIsInsertMode );
@@ -253,7 +253,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET &&
pItem->ISA(SfxUInt32Item) )
{
- nFormat = ((const SfxUInt32Item*)pItem)->GetValue();
+ nFormat = static_cast<const SfxUInt32Item*>(pItem)->GetValue();
}
if ( nFormat )
@@ -337,8 +337,8 @@ void ScEditShell::Execute( SfxRequest& rReq )
sal_uInt16 nFontWhich = ( nScript == SCRIPTTYPE_ASIAN ) ? EE_CHAR_FONTINFO_CJK :
( ( nScript == SCRIPTTYPE_COMPLEX ) ? EE_CHAR_FONTINFO_CTL :
EE_CHAR_FONTINFO );
- const SvxFontItem& rItem = (const SvxFontItem&)
- pTableView->GetAttribs().Get(nFontWhich);
+ const SvxFontItem& rItem = static_cast<const SvxFontItem&>(
+ pTableView->GetAttribs().Get(nFontWhich));
OUString aString;
SvxFontItem aNewItem( EE_CHAR_FONTINFO );
@@ -350,7 +350,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
if ( pItem )
{
- aString = ((const SfxStringItem*)pItem)->GetValue();
+ aString = static_cast<const SfxStringItem*>(pItem)->GetValue();
const SfxPoolItem* pFtItem = NULL;
pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), false, &pFtItem);
const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem );
@@ -512,7 +512,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
const SfxPoolItem* pItem;
if ( pReqArgs->GetItemState( SID_HYPERLINK_SETLINK, true, &pItem ) == SfxItemState::SET )
{
- const SvxHyperlinkItem* pHyper = (const SvxHyperlinkItem*) pItem;
+ const SvxHyperlinkItem* pHyper = static_cast<const SvxHyperlinkItem*>(pItem);
const OUString& rName = pHyper->GetName();
const OUString& rURL = pHyper->GetURL();
const OUString& rTarget = pHyper->GetTargetFrame();
@@ -752,7 +752,7 @@ const SvxURLField* ScEditShell::GetURLField()
{
const SvxFieldData* pField = pFieldItem->GetField();
if ( pField && pField->ISA(SvxURLField) )
- return (const SvxURLField*)pField;
+ return static_cast<const SvxURLField*>(pField);
}
}
@@ -885,7 +885,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
SvxScriptSetItem aOldSetItem( nSlot, rPool );
aOldSetItem.GetItemSet().Put( pEditView->GetAttribs(), false );
const SfxPoolItem* pCore = aOldSetItem.GetItemOfScript( nScript );
- if ( pCore && ((const SvxWeightItem*)pCore)->GetWeight() > WEIGHT_NORMAL )
+ if ( pCore && static_cast<const SvxWeightItem*>(pCore)->GetWeight() > WEIGHT_NORMAL )
bOld = true;
SvxScriptSetItem aSetItem( nSlot, rPool );
@@ -908,7 +908,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
SvxScriptSetItem aOldSetItem( nSlot, rPool );
aOldSetItem.GetItemSet().Put( pEditView->GetAttribs(), false );
const SfxPoolItem* pCore = aOldSetItem.GetItemOfScript( nScript );
- if ( pCore && ((const SvxPostureItem*)pCore)->GetValue() != ITALIC_NONE )
+ if ( pCore && static_cast<const SvxPostureItem*>(pCore)->GetValue() != ITALIC_NONE )
bOld = true;
SvxScriptSetItem aSetItem( nSlot, rPool );
@@ -930,7 +930,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
case SID_ULINE_VAL_DOUBLE:
case SID_ULINE_VAL_DOTTED:
{
- FontUnderline eOld = ((const SvxUnderlineItem&) pEditView->
+ FontUnderline eOld = static_cast<const SvxUnderlineItem&>( pEditView->
GetAttribs().Get(EE_CHAR_UNDERLINE)).GetLineStyle();
FontUnderline eNew = eOld;
switch (nSlot)
@@ -963,7 +963,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
case SID_ATTR_CHAR_OVERLINE:
{
- FontUnderline eOld = ((const SvxOverlineItem&) pEditView->
+ FontUnderline eOld = static_cast<const SvxOverlineItem&>( pEditView->
GetAttribs().Get(EE_CHAR_OVERLINE)).GetLineStyle();
FontUnderline eNew = ( eOld != UNDERLINE_NONE ) ? UNDERLINE_NONE : UNDERLINE_SINGLE;
aSet.Put( SvxOverlineItem( eNew, EE_CHAR_OVERLINE ) );
@@ -973,7 +973,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
case SID_ATTR_CHAR_STRIKEOUT:
{
- bool bOld = ((const SvxCrossedOutItem&)pEditView->GetAttribs().
+ bool bOld = static_cast<const SvxCrossedOutItem&>( pEditView->GetAttribs().
Get(EE_CHAR_STRIKEOUT)).GetValue() != STRIKEOUT_NONE;
aSet.Put( SvxCrossedOutItem( bOld ? STRIKEOUT_NONE : STRIKEOUT_SINGLE, EE_CHAR_STRIKEOUT ) );
rBindings.Invalidate( nSlot );
@@ -982,7 +982,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
case SID_ATTR_CHAR_SHADOWED:
{
- bool bOld = ((const SvxShadowedItem&)pEditView->GetAttribs().
+ bool bOld = static_cast<const SvxShadowedItem&>(pEditView->GetAttribs().
Get(EE_CHAR_SHADOW)).GetValue();
aSet.Put( SvxShadowedItem( !bOld, EE_CHAR_SHADOW ) );
rBindings.Invalidate( nSlot );
@@ -991,7 +991,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
case SID_ATTR_CHAR_CONTOUR:
{
- bool bOld = ((const SvxContourItem&)pEditView->GetAttribs().
+ bool bOld = static_cast<const SvxContourItem&>(pEditView->GetAttribs().
Get(EE_CHAR_OUTLINE)).GetValue();
aSet.Put( SvxContourItem( !bOld, EE_CHAR_OUTLINE ) );
rBindings.Invalidate( nSlot );
@@ -1000,7 +1000,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
case SID_SET_SUPER_SCRIPT:
{
- SvxEscapement eOld = (SvxEscapement) ((const SvxEscapementItem&)
+ SvxEscapement eOld = (SvxEscapement) static_cast<const SvxEscapementItem&>(
pEditView->GetAttribs().Get(EE_CHAR_ESCAPEMENT)).GetEnumValue();
SvxEscapement eNew = (eOld == SVX_ESCAPEMENT_SUPERSCRIPT) ?
SVX_ESCAPEMENT_OFF : SVX_ESCAPEMENT_SUPERSCRIPT;
@@ -1010,7 +1010,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
break;
case SID_SET_SUB_SCRIPT:
{
- SvxEscapement eOld = (SvxEscapement) ((const SvxEscapementItem&)
+ SvxEscapement eOld = (SvxEscapement) static_cast<const SvxEscapementItem&>(
pEditView->GetAttribs().Get(EE_CHAR_ESCAPEMENT)).GetEnumValue();
SvxEscapement eNew = (eOld == SVX_ESCAPEMENT_SUBSCRIPT) ?
SVX_ESCAPEMENT_OFF : SVX_ESCAPEMENT_SUBSCRIPT;
@@ -1093,7 +1093,7 @@ void ScEditShell::GetAttrState(SfxItemSet &rSet)
}
else
{
- FontUnderline eUnderline = ((const SvxUnderlineItem&)
+ FontUnderline eUnderline = static_cast<const SvxUnderlineItem&>(
aAttribs.Get(EE_CHAR_UNDERLINE)).GetLineStyle();
sal_uInt16 nId = SID_ULINE_VAL_NONE;
switch (eUnderline)
@@ -1112,7 +1112,7 @@ void ScEditShell::GetAttrState(SfxItemSet &rSet)
if ( pHdl && pHdl->IsFormulaMode() )
rSet.ClearItem( EE_CHAR_WEIGHT ); // hervorgehobene Klammern hier nicht
- SvxEscapement eEsc = (SvxEscapement) ( (const SvxEscapementItem&)
+ SvxEscapement eEsc = (SvxEscapement) static_cast<const SvxEscapementItem&>(
aAttribs.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
{
@@ -1183,7 +1183,7 @@ void ScEditShell::ExecuteUndo(SfxRequest& rReq)
sal_uInt16 nCount = 1;
const SfxPoolItem* pItem;
if ( pReqArgs && pReqArgs->GetItemState( nSlot, true, &pItem ) == SfxItemState::SET )
- nCount = ((const SfxUInt16Item*)pItem)->GetValue();
+ nCount = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
for (sal_uInt16 i=0; i<nCount; i++)
{
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 70e0337..067a6d6 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -193,8 +193,8 @@ void ScFormatShell::GetStyleState( SfxItemSet& rSet )
{
SCTAB nCurTab = GetViewData()->GetTabNo();
OUString aPageStyle = pDoc->GetPageStyle( nCurTab );
- SfxStyleSheet* pStyleSheet = pStylePool ? (SfxStyleSheet*)pStylePool->
- Find( aPageStyle, SFX_STYLE_FAMILY_PAGE ) : NULL;
+ SfxStyleSheet* pStyleSheet = pStylePool ? static_cast<SfxStyleSheet*>(pStylePool->
+ Find( aPageStyle, SFX_STYLE_FAMILY_PAGE )) : NULL;
if ( pStyleSheet )
rSet.Put( SfxTemplateItem( nSlotId, aPageStyle ) );
@@ -277,11 +277,11 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
SfxStyleFamily eFamily = SFX_STYLE_FAMILY_PARA;
const SfxPoolItem* pFamItem;
if ( pArgs && SfxItemState::SET == pArgs->GetItemState( SID_STYLE_FAMILY, true, &pFamItem ) )
- eFamily = (SfxStyleFamily)((const SfxUInt16Item*)pFamItem)->GetValue();
+ eFamily = (SfxStyleFamily) static_cast<const SfxUInt16Item*>(pFamItem)->GetValue();
const SfxPoolItem* pNameItem;
OUString aStyleName;
if (pArgs && SfxItemState::SET == pArgs->GetItemState( nSlotId, true, &pNameItem ))
- aStyleName = ((const SfxStringItem*)pNameItem)->GetValue();
+ aStyleName = static_cast<const SfxStringItem*>(pNameItem)->GetValue();
if ( eFamily == SFX_STYLE_FAMILY_PARA ) // CellStyles
{
ScMarkData aFuncMark( pViewData->GetMarkData() );
@@ -357,10 +357,10 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
SfxStyleFamily eFamily = SFX_STYLE_FAMILY_PARA;
const SfxPoolItem* pFamItem;
if ( pArgs && SfxItemState::SET == pArgs->GetItemState( SID_STYLE_FAMILY, true, &pFamItem ) )
- eFamily = (SfxStyleFamily)((const SfxUInt16Item*)pFamItem)->GetValue();
+ eFamily = (SfxStyleFamily) static_cast<const SfxUInt16Item*>(pFamItem)->GetValue();
else if ( pArgs && SfxItemState::SET == pArgs->GetItemState( SID_STYLE_FAMILYNAME, true, &pFamItem ) )
{
- OUString sFamily = ((const SfxStringItem*)pFamItem)->GetValue();
+ OUString sFamily = static_cast<const SfxStringItem*>(pFamItem)->GetValue();
if (sFamily.equalsAscii("CellStyles"))
eFamily = SFX_STYLE_FAMILY_PARA;
else if (sFamily.equalsAscii("PageStyles"))
@@ -378,13 +378,13 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
{
const SfxPoolItem* pNameItem;
if (pArgs && SfxItemState::SET == pArgs->GetItemState( nSlotId, true, &pNameItem ))
- aStyleName = ((const SfxStringItem*)pNameItem)->GetValue();
+ aStyleName = static_cast<const SfxStringItem*>(pNameItem)->GetValue();
const SfxPoolItem* pRefItem=NULL;
if (pArgs && SfxItemState::SET == pArgs->GetItemState( SID_STYLE_REFERENCE, true, &pRefItem ))
{
if(pRefItem!=NULL)
- aRefName = ((const SfxStringItem*)pRefItem)->GetValue();
+ aRefName = static_cast<const SfxStringItem*>(pRefItem)->GetValue();
}
pStyleSheet = &(pStylePool->Make( aStyleName, eFamily,
@@ -428,7 +428,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
{
const SfxPoolItem* pNameItem;
if (pArgs && SfxItemState::SET == pArgs->GetItemState( nSlotId, true, &pNameItem ))
- aStyleName = ((const SfxStringItem*)pNameItem)->GetValue();
+ aStyleName = static_cast<const SfxStringItem*>(pNameItem)->GetValue();
pStyleSheet = pStylePool->Find( aStyleName, eFamily );
aOldData.InitFromStyle( pStyleSheet );
@@ -454,7 +454,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
if ( pStyleSheet )
{
- ((ScStyleSheetPool*)pStylePool)->
+ static_cast<ScStyleSheetPool*>(pStylePool)->
SetActualStyleSheet( pStyleSheet );
rReq.Done();
}
@@ -483,7 +483,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
// set new style for WaterCan-Mode
if ( nSlotId == SID_STYLE_APPLY && pScMod->GetIsWaterCan() && pStyleSheet )
- ((ScStyleSheetPool*)pStylePool)->SetActualStyleSheet( pStyleSheet );
+ static_cast<ScStyleSheetPool*>(pStylePool)->SetActualStyleSheet( pStyleSheet );
switch ( eFamily )
{
@@ -526,7 +526,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
if ( pStyleSheet && !pScMod->GetIsWaterCan() )
{
// apply style sheet to document
- pTabViewShell->SetStyleSheetToMarked( (SfxStyleSheet*)pStyleSheet );
+ pTabViewShell->SetStyleSheetToMarked( static_cast<SfxStyleSheet*>(pStyleSheet) );
pTabViewShell->InvalidateAttribs();
rReq.Done();
}
@@ -801,9 +801,9 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
// NumberFormat Value aus Value und Language
// erzeugen und eintueten
sal_uLong nFormat =
- ((SfxUInt32Item*)pItem)->GetValue();
+ static_cast<const SfxUInt32Item*>(pItem)->GetValue();
LanguageType eLang =
- ((SvxLanguageItem*)&rSet.Get(
+ static_cast<const SvxLanguageItem*>(&rSet.Get(
ATTR_LANGUAGE_FORMAT ))->GetLanguage();
sal_uLong nLangFormat = rDoc.GetFormatTable()->
GetFormatForLanguageIfBuiltIn( nFormat, eLang );
@@ -891,9 +891,9 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
if (rDoc.IsStreamValid(nTab))
rDoc.SetStreamValid(nTab, false);
- sal_uLong nOldFormat = ((const SfxUInt32Item&)aOldSet.
+ sal_uLong nOldFormat = static_cast<const SfxUInt32Item&>(aOldSet.
Get( ATTR_VALUE_FORMAT )).GetValue();
- sal_uLong nNewFormat = ((const SfxUInt32Item&)rNewSet.
+ sal_uLong nNewFormat = static_cast<const SfxUInt32Item&>(rNewSet.
Get( ATTR_VALUE_FORMAT )).GetValue();
if ( nNewFormat != nOldFormat )
{
@@ -928,8 +928,8 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
if ( SFX_STYLE_FAMILY_PARA == eFam )
{
pTabViewShell->UpdateNumberFormatter(
- (const SvxNumberInfoItem&)
- *(pDocSh->GetItem(SID_ATTR_NUMBERFORMAT_INFO)) );
+ static_cast<const SvxNumberInfoItem&>(
+ *(pDocSh->GetItem(SID_ATTR_NUMBERFORMAT_INFO)) ));
pTabViewShell->UpdateStyleSheetInUse( pStyleSheet );
pTabViewShell->InvalidateAttribs();
@@ -963,7 +963,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
{
// call SetStyleSheetToMarked after adding the ScUndoModifyStyle,
// so redo will find the modified style
- pTabViewShell->SetStyleSheetToMarked( (SfxStyleSheet*)pStyleSheet );
+ pTabViewShell->SetStyleSheetToMarked( static_cast<SfxStyleSheet*>(pStyleSheet) );
pTabViewShell->InvalidateAttribs();
}
@@ -1131,7 +1131,7 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
if(SfxItemState::SET == pReqArgs->GetItemState(nSlot, true, &pItem) && eType != -1)
{
- OUString aCode = ((const SfxStringItem*)pItem)->GetValue();
+ OUString aCode = static_cast<const SfxStringItem*>(pItem)->GetValue();
sal_uInt16 aLen = aCode.getLength();
OUString* sFormat = new OUString[4];
OUString sTmpStr = "";
@@ -1202,7 +1202,7 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
const SfxPoolItem* pItem;
if ( pReqArgs->GetItemState( nSlot, true, &pItem ) == SfxItemState::SET )
{
- sal_uInt16 nFormat = ((SfxInt16Item *)pItem)->GetValue();
+ sal_uInt16 nFormat = static_cast<const SfxInt16Item *>(pItem)->GetValue();
switch(nFormat)
{
case 0:
@@ -1297,14 +1297,14 @@ void ScFormatShell::ExecuteAlignment( SfxRequest& rReq )
case SID_H_ALIGNCELL:
{
- SvxCellHorJustify eJust = (SvxCellHorJustify)((const SvxHorJustifyItem*)pItem)->GetValue();
+ SvxCellHorJustify eJust = (SvxCellHorJustify)static_cast<const SvxHorJustifyItem*>(pItem)->GetValue();
// #i78476# update alignment of text in cell edit mode
pTabViewShell->UpdateInputHandlerCellAdjust( eJust );
pTabViewShell->ApplyAttr( SvxHorJustifyItem( eJust, ATTR_HOR_JUSTIFY ) );
}
break;
case SID_V_ALIGNCELL:
- pTabViewShell->ApplyAttr( SvxVerJustifyItem( (SvxCellVerJustify)((const SvxVerJustifyItem*)pItem)->GetValue(), ATTR_VER_JUSTIFY ) );
+ pTabViewShell->ApplyAttr( SvxVerJustifyItem( (SvxCellVerJustify)static_cast<const SvxVerJustifyItem*>(pItem)->GetValue(), ATTR_VER_JUSTIFY ) );
break;
default:
OSL_FAIL( "ExecuteAlignment: invalid slot" );
@@ -1382,7 +1382,7 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq )
SvxScriptSetItem aOldSetItem( nSlot, rPool );
aOldSetItem.GetItemSet().Put( pAttrs->GetItemSet(), false );
const SfxPoolItem* pCore = aOldSetItem.GetItemOfScript( nScript );
- if ( pCore && ((const SvxWeightItem*)pCore)->GetWeight() == WEIGHT_BOLD )
+ if ( pCore && static_cast<const SvxWeightItem*>(pCore)->GetWeight() == WEIGHT_BOLD )
eWeight = WEIGHT_NORMAL;
aSetItem.PutItemForScriptType( nScript, SvxWeightItem( eWeight, ATTR_FONT_WEIGHT ) );
@@ -1409,7 +1409,7 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq )
SvxScriptSetItem aOldSetItem( nSlot, rPool );
aOldSetItem.GetItemSet().Put( pAttrs->GetItemSet(), false );
const SfxPoolItem* pCore = aOldSetItem.GetItemOfScript( nScript );
- if ( pCore && ((const SvxPostureItem*)pCore)->GetPosture() == ITALIC_NORMAL )
+ if ( pCore && static_cast<const SvxPostureItem*>(pCore)->GetPosture() == ITALIC_NORMAL )
eItalic = ITALIC_NONE;
aSetItem.PutItemForScriptType( nScript, SvxPostureItem( eItalic, ATTR_FONT_POSTURE ) );
@@ -1444,9 +1444,9 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq )
}
else
{
- SvxUnderlineItem aUnderline( (const SvxUnderlineItem&)
+ SvxUnderlineItem aUnderline( static_cast<const SvxUnderlineItem&>(
pAttrs->GetItem(
- ATTR_FONT_UNDERLINE ) );
+ ATTR_FONT_UNDERLINE ) ) );
eUnderline = (UNDERLINE_NONE != aUnderline.GetLineStyle())
? UNDERLINE_NONE
: UNDERLINE_SINGLE;
@@ -1464,7 +1464,7 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq )
case SID_ULINE_VAL_DOUBLE:
case SID_ULINE_VAL_DOTTED:
{
- FontUnderline eOld = ((const SvxUnderlineItem&)
+ FontUnderline eOld = static_cast<const SvxUnderlineItem&>(
pAttrs->GetItem(ATTR_FONT_UNDERLINE)).GetLineStyle();
FontUnderline eNew = eOld;
switch (nSlot)
@@ -1505,12 +1505,12 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq )
if (rAttrSet.GetItemState(ATTR_HOR_JUSTIFY, true,&pItem ) == SfxItemState::SET)
{
- pHorJustify = (const SvxHorJustifyItem*)pItem;
+ pHorJustify = static_cast<const SvxHorJustifyItem*>(pItem);
eHorJustify = SvxCellHorJustify( pHorJustify->GetValue() );
}
if (rAttrSet.GetItemState(ATTR_VER_JUSTIFY, true,&pItem ) == SfxItemState::SET)
{
- pVerJustify = (const SvxVerJustifyItem*)pItem;
+ pVerJustify = static_cast<const SvxVerJustifyItem*>(pItem);
eVerJustify = SvxCellVerJustify( pVerJustify->GetValue() );
}
@@ -1626,8 +1626,8 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
case SID_BACKGROUND_COLOR:
{
- SvxBrushItem aBrushItem( (const SvxBrushItem&)
- pTabViewShell->GetSelectionPattern()->GetItem( ATTR_BACKGROUND ) );
+ SvxBrushItem aBrushItem( static_cast<const SvxBrushItem&>(
+ pTabViewShell->GetSelectionPattern()->GetItem( ATTR_BACKGROUND ) ) );
aBrushItem.SetColor( COL_TRANSPARENT );
pTabViewShell->ApplyAttr( aBrushItem );
}
@@ -1636,7 +1636,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
case SID_ATTR_ALIGN_LINEBREAK: // ohne Parameter als Toggle
{
const ScPatternAttr* pAttrs = pTabViewShell->GetSelectionPattern();
- bool bOld = ((const SfxBoolItem&)pAttrs->GetItem(ATTR_LINEBREAK)).GetValue();
+ bool bOld = static_cast<const SfxBoolItem&>(pAttrs->GetItem(ATTR_LINEBREAK)).GetValue();
SfxBoolItem aBreakItem( ATTR_LINEBREAK, !bOld );
pTabViewShell->ApplyAttr( aBreakItem );
@@ -1657,7 +1657,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
{
SfxItemPool& rPool = GetPool();
sal_uInt16 nWhich = rPool.GetWhich( nSlot );
- const SvxFontItem& rFont = ( const SvxFontItem&)pNewAttrs->Get( nWhich );
+ const SvxFontItem& rFont = static_cast<const SvxFontItem&>(pNewAttrs->Get( nWhich ));
SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONT, rPool );
sal_uInt8 nScript = pTabViewShell->GetSelectionScriptType();
aSetItem.PutItemForScriptType( nScript, rFont );
@@ -1716,7 +1716,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
{
// Default-Linie aktualisieren
const ::editeng::SvxBorderLine* pLine =
- ((const SvxLineItem&)
+ static_cast<const SvxLineItem&>(
pNewAttrs->Get( SID_FRAME_LINESTYLE )).
GetLine();
@@ -1752,7 +1752,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
case SID_FRAME_LINECOLOR:
{
::editeng::SvxBorderLine* pDefLine = pTabViewShell->GetDefaultFrameLine();
- const Color& rColor = ((const SvxColorItem&)
+ const Color& rColor = static_cast<const SvxColorItem&>(
pNewAttrs->Get( SID_FRAME_LINECOLOR )).
GetValue();
@@ -1802,7 +1802,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
// Macro recording uses a SvxBoxItem with the real values (OutWidth > 0)
// or NULL pointers for no lines.
// -> Substitute existing lines with pDefLine only if widths are 0.
- SvxBoxItem aBoxItem ( *(const SvxBoxItem*)pItem );
+ SvxBoxItem aBoxItem ( *static_cast<const SvxBoxItem*>(pItem ));
if ( aBoxItem.GetTop() && aBoxItem.GetTop()->GetOutWidth() == 0 )
aBoxItem.SetLine( pDefLine, BOX_LINE_TOP );
if ( aBoxItem.GetBottom() && aBoxItem.GetBottom()->GetOutWidth() == 0 )
@@ -1818,7 +1818,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
if ( pNewAttrs->GetItemState( ATTR_BORDER_INNER, true, &pItem )
== SfxItemState::SET )
{
- SvxBoxInfoItem aBoxInfoItem( *(const SvxBoxInfoItem*)pItem );
+ SvxBoxInfoItem aBoxInfoItem( *static_cast<const SvxBoxInfoItem*>(pItem) );
if ( aBoxInfoItem.GetHori() && aBoxInfoItem.GetHori()->GetOutWidth() == 0 )
aBoxInfoItem.SetLine( pDefLine, BOXINFO_LINE_HORI );
if ( aBoxInfoItem.GetVert() && aBoxInfoItem.GetVert()->GetOutWidth() == 0 )
@@ -1852,7 +1852,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
if(SfxItemState::SET == pNewAttrs->GetItemState(ATTR_BORDER_TLBR, true, &pItem))
{
SvxLineItem aItem(ATTR_BORDER_TLBR);
- aItem.SetLine(((const SvxLineItem&)pNewAttrs->Get(ATTR_BORDER_TLBR)).GetLine());
+ aItem.SetLine(static_cast<const SvxLineItem&>(pNewAttrs->Get(ATTR_BORDER_TLBR)).GetLine());
pNewSet->Put(aItem);
rReq.AppendItem(aItem);
pTabViewShell->ApplyAttributes(pNewSet.get(), pOldSet.get());
@@ -1863,7 +1863,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
if(SfxItemState::SET == pNewAttrs->GetItemState(ATTR_BORDER_BLTR, true, &pItem ))
{
SvxLineItem aItem(ATTR_BORDER_BLTR);
- aItem.SetLine(((const SvxLineItem&)pNewAttrs->Get(ATTR_BORDER_BLTR)).GetLine());
+ aItem.SetLine(static_cast<const SvxLineItem&>(pNewAttrs->Get(ATTR_BORDER_BLTR)).GetLine());
pNewSet->Put(aItem);
rReq.AppendItem(aItem);
pTabViewShell->ApplyAttributes(pNewSet.get(), pOldSet.get());
@@ -1878,12 +1878,12 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
// gesetzt werden:
case SID_BACKGROUND_COLOR:
{
- const SvxColorItem rNewColorItem = (const SvxColorItem&)
- pNewAttrs->Get( SID_BACKGROUND_COLOR );
+ const SvxColorItem rNewColorItem = static_cast<const SvxColorItem&>(
+ pNewAttrs->Get( SID_BACKGROUND_COLOR ) );
- SvxBrushItem aBrushItem( (const SvxBrushItem&)
+ SvxBrushItem aBrushItem( static_cast<const SvxBrushItem&>(
pTabViewShell->GetSelectionPattern()->
- GetItem( ATTR_BACKGROUND ) );
+ GetItem( ATTR_BACKGROUND ) ) );
aBrushItem.SetColor( rNewColorItem.GetValue() );
@@ -1893,11 +1893,11 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
case SID_ATTR_BRUSH:
{
- SvxBrushItem aBrushItem( (const SvxBrushItem&)
+ SvxBrushItem aBrushItem( static_cast<const SvxBrushItem&>(
pTabViewShell->GetSelectionPattern()->
- GetItem( ATTR_BACKGROUND ) );
- const SvxBrushItem& rNewBrushItem = (const SvxBrushItem&)
- pNewAttrs->Get( GetPool().GetWhich(nSlot) );
+ GetItem( ATTR_BACKGROUND ) ) );
+ const SvxBrushItem& rNewBrushItem = static_cast<const SvxBrushItem&>(
+ pNewAttrs->Get( GetPool().GetWhich(nSlot) ) );
aBrushItem.SetColor(rNewBrushItem.GetColor());
pTabViewShell->ApplyAttr( aBrushItem );
}
@@ -1905,8 +1905,8 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
case SID_ATTR_BORDER_SHADOW:
{
- const SvxShadowItem& rNewShadowItem = (const SvxShadowItem&)
- pNewAttrs->Get( ATTR_SHADOW );
+ const SvxShadowItem& rNewShadowItem = static_cast<const SvxShadowItem&>(
+ pNewAttrs->Get( ATTR_SHADOW ) );
pTabViewShell->ApplyAttr( rNewShadowItem );
}
break;
@@ -1926,7 +1926,7 @@ void ScFormatShell::GetAttrState( SfxItemSet& rSet )
ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell();
const SfxItemSet& rAttrSet = pTabViewShell->GetSelectionPattern()->GetItemSet();
//const ::editeng::SvxBorderLine* pLine = pTabViewShell->GetDefaultFrameLine();
- const SvxBrushItem& rBrushItem = (const SvxBrushItem&)rAttrSet.Get( ATTR_BACKGROUND );
+ const SvxBrushItem& rBrushItem = static_cast<const SvxBrushItem&>(rAttrSet.Get( ATTR_BACKGROUND ));
SfxWhichIter aIter( rSet );
sal_uInt16 nWhich = aIter.FirstWhich();
@@ -2173,7 +2173,7 @@ void ScFormatShell::GetTextAttrState( SfxItemSet& rSet )
}
else
{
- FontUnderline eUnderline = ((const SvxUnderlineItem&)
+ FontUnderline eUnderline = static_cast<const SvxUnderlineItem&>(
rAttrSet.Get(ATTR_FONT_UNDERLINE)).GetLineStyle();
sal_uInt16 nId = SID_ULINE_VAL_NONE;
switch (eUnderline)
@@ -2343,12 +2343,12 @@ void ScFormatShell::GetAlignState( SfxItemSet& rSet )
SvxCellHorJustify eHAlign = SVX_HOR_JUSTIFY_STANDARD;
bool bHasHAlign = rAttrSet.GetItemState( ATTR_HOR_JUSTIFY ) != SfxItemState::DONTCARE;
if( bHasHAlign )
- eHAlign = (SvxCellHorJustify)((const SvxHorJustifyItem&) rAttrSet.Get( ATTR_HOR_JUSTIFY )).GetValue();
+ eHAlign = (SvxCellHorJustify)static_cast<const SvxHorJustifyItem&>(rAttrSet.Get( ATTR_HOR_JUSTIFY )).GetValue();
SvxCellVerJustify eVAlign = SVX_VER_JUSTIFY_STANDARD;
bool bHasVAlign = rAttrSet.GetItemState( ATTR_VER_JUSTIFY ) != SfxItemState::DONTCARE;
if( bHasVAlign )
- eVAlign = (SvxCellVerJustify)((const SvxVerJustifyItem&) rAttrSet.Get( ATTR_VER_JUSTIFY )).GetValue();
+ eVAlign = (SvxCellVerJustify)static_cast<const SvxVerJustifyItem&>(rAttrSet.Get( ATTR_VER_JUSTIFY )).GetValue();
while ( nWhich )
{
@@ -2420,7 +2420,7 @@ void ScFormatShell::GetNumFormatState( SfxItemSet& rSet )
if(SfxItemState::DONTCARE != rAttrSet.GetItemState(ATTR_VALUE_FORMAT))
{
SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
- sal_uInt32 nNumberFormat = ((const SfxUInt32Item&)rAttrSet.Get(ATTR_VALUE_FORMAT)).GetValue();
+ sal_uInt32 nNumberFormat = static_cast<const SfxUInt32Item&>(rAttrSet.Get(ATTR_VALUE_FORMAT)).GetValue();
bool bThousand(false);
bool bNegRed(false);
sal_uInt16 nPrecision(0);
@@ -2599,15 +2599,15 @@ void ScFormatShell::GetTextDirectionState( SfxItemSet& rSet )
(rAttrSet.GetItemState( ATTR_VERTICAL_ASIAN ) == SfxItemState::DONTCARE) ||
(rAttrSet.GetItemState( ATTR_STACKED ) == SfxItemState::DONTCARE);
bool bLeftRight = !bVertDontCare &&
- !((const SfxBoolItem&) rAttrSet.Get( ATTR_STACKED )).GetValue();
+ !static_cast<const SfxBoolItem&>(rAttrSet.Get( ATTR_STACKED )).GetValue();
bool bTopBottom = !bVertDontCare && !bLeftRight &&
- ((const SfxBoolItem&) rAttrSet.Get( ATTR_VERTICAL_ASIAN )).GetValue();
+ static_cast<const SfxBoolItem&>(rAttrSet.Get( ATTR_VERTICAL_ASIAN )).GetValue();
bool bBidiDontCare = (rAttrSet.GetItemState( ATTR_WRITINGDIR ) == SfxItemState::DONTCARE);
EEHorizontalTextDirection eBidiDir = EE_HTEXTDIR_DEFAULT;
if ( !bBidiDontCare )
{
- SvxFrameDirection eCellDir = (SvxFrameDirection)((const SvxFrameDirectionItem&)
+ SvxFrameDirection eCellDir = (SvxFrameDirection)static_cast<const SvxFrameDirectionItem&>(
rAttrSet.Get( ATTR_WRITINGDIR )).GetValue();
if ( eCellDir == FRMDIR_ENVIRONMENT )
eBidiDir = (EEHorizontalTextDirection)GetViewData()->GetDocument()->
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 60f0c7e..4e0fb78 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -403,9 +403,9 @@ static bool lcl_GetHyperlinkCell(
else
{
const ScPatternAttr* pPattern = pDoc->GetPattern(aPos);
- if ( !((SfxStringItem&)pPattern->GetItem(ATTR_HYPERLINK)).GetValue().isEmpty() )
+ if ( !static_cast<const SfxStringItem&>(pPattern->GetItem(ATTR_HYPERLINK)).GetValue().isEmpty() )
{
- rURL = ((SfxStringItem&)pPattern->GetItem(ATTR_HYPERLINK)).GetValue();
+ rURL = static_cast<const SfxStringItem&>(pPattern->GetItem(ATTR_HYPERLINK)).GetValue();
bFound = true;
}
else if (rCell.meType == CELLTYPE_EDIT)
@@ -1136,7 +1136,7 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow, bool bDataSelec
const size_t nDefCount = SAL_N_ELEMENTS(nDefIDs);
for (i=0; i<nDefCount; i++)
{
- OUString aEntry( (ScResId) nDefIDs[i] );
+ OUString aEntry( static_cast<ScResId>(nDefIDs[i]) );
pFilterBox->InsertEntry( aEntry );
long nTextWidth = pFilterBox->GetTextWidth( aEntry );
if ( nTextWidth > nMaxText )
@@ -1254,7 +1254,7 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow, bool bDataSelec
else
{
- sal_uLong nIndex = ((SfxUInt32Item*)pDoc->GetAttr(
+ sal_uLong nIndex = static_cast<const SfxUInt32Item*>(pDoc->GetAttr(
nCol, nRow, nTab, ATTR_VALIDDATA ))->GetValue();
if ( nIndex )
{
@@ -1850,10 +1850,10 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt, MouseEventSta
SCsCOL nRealPosX;
SCsROW nRealPosY;
pViewData->GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nRealPosX, nRealPosY, false );//the real row/col
- ScMergeFlagAttr* pRealPosAttr = (ScMergeFlagAttr*)
- pDoc->GetAttr( nRealPosX, nRealPosY, nTab, ATTR_MERGE_FLAG );
- ScMergeFlagAttr* pAttr = (ScMergeFlagAttr*)
- pDoc->GetAttr( nPosX, nPosY, nTab, ATTR_MERGE_FLAG );
+ const ScMergeFlagAttr* pRealPosAttr = static_cast<const ScMergeFlagAttr*>(
+ pDoc->GetAttr( nRealPosX, nRealPosY, nTab, ATTR_MERGE_FLAG ));
+ const ScMergeFlagAttr* pAttr = static_cast<const ScMergeFlagAttr*>(
+ pDoc->GetAttr( nPosX, nPosY, nTab, ATTR_MERGE_FLAG ));
if( pRealPosAttr->HasAutoFilter() )
{
SC_MOD()->InputEnterHandler();
@@ -2158,8 +2158,8 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
GetStyleSheetPool());
if ( pStylePool )
{
- SfxStyleSheet* pStyleSheet = (SfxStyleSheet*)
- pStylePool->GetActualStyleSheet();
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list