summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-15 09:05:33 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-15 09:05:33 +0100
commitc6a62b3694b8d779f9385c0e15d8f94d5067416d (patch)
treeb3be82eccbfe4ef99479b45684ffa5e9b9aeb222 /forms
parentbb60b49c3ad5203a657ebd0b2a10fa77fc6a9b05 (diff)
More loplugin:cstylecast: forms
Change-Id: Ide91ff51ef5c048272d742547597d6c66fc3abea
Diffstat (limited to 'forms')
-rw-r--r--forms/source/component/Button.cxx10
-rw-r--r--forms/source/component/ComboBox.cxx4
-rw-r--r--forms/source/component/DatabaseForm.cxx24
-rw-r--r--forms/source/component/Grid.cxx2
-rw-r--r--forms/source/component/ImageButton.cxx8
-rw-r--r--forms/source/component/ListBox.cxx4
-rw-r--r--forms/source/component/RadioButton.cxx2
-rw-r--r--forms/source/component/refvaluecomponent.cxx2
8 files changed, 28 insertions, 28 deletions
diff --git a/forms/source/component/Button.cxx b/forms/source/component/Button.cxx
index 65d72c9b87a1..2ec073bc0e8a 100644
--- a/forms/source/component/Button.cxx
+++ b/forms/source/component/Button.cxx
@@ -143,7 +143,7 @@ void OButtonModel::write(const Reference<XObjectOutputStream>& _rxOutStream)
OStreamSection aSection( _rxOutStream.get() );
// this will allow readers to skip unknown bytes in their dtor
- _rxOutStream->writeShort( (sal_uInt16)m_eButtonType );
+ _rxOutStream->writeShort( static_cast<sal_uInt16>(m_eButtonType) );
OUString sTmp = INetURLObject::decode( m_sTargetURL, INetURLObject::DecodeMechanism::Unambiguous);
_rxOutStream << sTmp;
@@ -163,7 +163,7 @@ void OButtonModel::read(const Reference<XObjectInputStream>& _rxInStream)
{
case 0x0001:
{
- m_eButtonType = (FormButtonType)_rxInStream->readShort();
+ m_eButtonType = static_cast<FormButtonType>(_rxInStream->readShort());
_rxInStream >> m_sTargetURL;
_rxInStream >> m_sTargetFrame;
@@ -172,7 +172,7 @@ void OButtonModel::read(const Reference<XObjectInputStream>& _rxInStream)
case 0x0002:
{
- m_eButtonType = (FormButtonType)_rxInStream->readShort();
+ m_eButtonType = static_cast<FormButtonType>(_rxInStream->readShort());
_rxInStream >> m_sTargetURL;
_rxInStream >> m_sTargetFrame;
@@ -186,7 +186,7 @@ void OButtonModel::read(const Reference<XObjectInputStream>& _rxInStream)
// this will skip any unknown bytes in its dtor
// button type
- m_eButtonType = (FormButtonType)_rxInStream->readShort();
+ m_eButtonType = static_cast<FormButtonType>(_rxInStream->readShort());
// URL
_rxInStream >> m_sTargetURL;
@@ -267,7 +267,7 @@ void SAL_CALL OButtonModel::setFastPropertyValue_NoBroadcast( sal_Int32 _nHandle
{
sal_Int16 nDefaultState = sal_Int16(TRISTATE_FALSE);
OSL_VERIFY( _rValue >>= nDefaultState );
- m_eDefaultState = (ToggleState)nDefaultState;
+ m_eDefaultState = static_cast<ToggleState>(nDefaultState);
impl_resetNoBroadcast_nothrow();
}
break;
diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx
index 11398fdc8305..29024717a5d0 100644
--- a/forms/source/component/ComboBox.cxx
+++ b/forms/source/component/ComboBox.cxx
@@ -351,7 +351,7 @@ void SAL_CALL OComboBoxModel::write(const Reference<css::io::XObjectOutputStream
css::uno::Sequence<OUString> aListSourceSeq(&m_aListSource, 1);
_rxOutStream << aListSourceSeq;
- _rxOutStream << (sal_Int16)m_eListSourceType;
+ _rxOutStream << static_cast<sal_Int16>(m_eListSourceType);
if ((nAnyMask & BOUNDCOLUMN) == BOUNDCOLUMN)
{
@@ -423,7 +423,7 @@ void SAL_CALL OComboBoxModel::read(const Reference<css::io::XObjectInputStream>&
sal_Int16 nListSourceType;
_rxInStream >> nListSourceType;
- m_eListSourceType = (ListSourceType)nListSourceType;
+ m_eListSourceType = static_cast<ListSourceType>(nListSourceType);
if ((nAnyMask & BOUNDCOLUMN) == BOUNDCOLUMN)
{
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index 6b623752a684..7bf343e41631 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -2391,7 +2391,7 @@ sal_Bool SAL_CALL ODatabaseForm::getGroupControl()
{
sal_Int32 nCycle = 0;
::cppu::enum2int(nCycle, m_aCycle);
- return (TabulatorCycle)nCycle != TabulatorCycle_PAGE;
+ return static_cast<TabulatorCycle>(nCycle) != TabulatorCycle_PAGE;
}
if (isLoaded() && getConnection().is())
@@ -3801,7 +3801,7 @@ void SAL_CALL ODatabaseForm::write(const Reference<XObjectOutputStream>& _rxOutS
default : OSL_FAIL("ODatabaseForm::write : wrong CommandType !");
}
}
- _rxOutStream->writeShort((sal_Int16)eTranslated); // former DataSelectionType
+ _rxOutStream->writeShort(static_cast<sal_Int16>(eTranslated)); // former DataSelectionType
// very old versions expect a CursorType here
_rxOutStream->writeShort(2); // DatabaseCursorType_KEYSET
@@ -3821,22 +3821,22 @@ void SAL_CALL ODatabaseForm::write(const Reference<XObjectOutputStream>& _rxOutS
// html form stuff
OUString sTmp = INetURLObject::decode( m_aTargetURL, INetURLObject::DecodeMechanism::Unambiguous);
_rxOutStream << sTmp;
- _rxOutStream->writeShort( (sal_Int16)m_eSubmitMethod );
- _rxOutStream->writeShort( (sal_Int16)m_eSubmitEncoding );
+ _rxOutStream->writeShort( static_cast<sal_Int16>(m_eSubmitMethod) );
+ _rxOutStream->writeShort( static_cast<sal_Int16>(m_eSubmitEncoding) );
_rxOutStream << m_aTargetFrame;
// version 2 didn't know some options and the "default" state
- sal_Int32 nCycle = (sal_Int32)TabulatorCycle_RECORDS;
+ sal_Int32 nCycle = sal_Int32(TabulatorCycle_RECORDS);
if (m_aCycle.hasValue())
{
::cppu::enum2int(nCycle, m_aCycle);
if (m_aCycle == TabulatorCycle_PAGE)
// unknown in earlier versions
- nCycle = (sal_Int32)TabulatorCycle_RECORDS;
+ nCycle = sal_Int32(TabulatorCycle_RECORDS);
}
_rxOutStream->writeShort(static_cast<sal_Int16>(nCycle));
- _rxOutStream->writeShort((sal_Int16)m_eNavigation);
+ _rxOutStream->writeShort(static_cast<sal_Int16>(m_eNavigation));
OUString sFilter;
OUString sHaving;
@@ -3895,7 +3895,7 @@ void SAL_CALL ODatabaseForm::read(const Reference<XObjectInputStream>& _rxInStre
sal_Int16 nCursorSourceType = _rxInStream->readShort();
sal_Int32 nCommandType = 0;
- switch ((DataSelectionType)nCursorSourceType)
+ switch (static_cast<DataSelectionType>(nCursorSourceType))
{
case DataSelectionType_TABLE : nCommandType = CommandType::TABLE; break;
case DataSelectionType_QUERY : nCommandType = CommandType::QUERY; break;
@@ -3903,7 +3903,7 @@ void SAL_CALL ODatabaseForm::read(const Reference<XObjectInputStream>& _rxInStre
case DataSelectionType_SQLPASSTHROUGH:
{
nCommandType = CommandType::COMMAND;
- bool bEscapeProcessing = ((DataSelectionType)nCursorSourceType) != DataSelectionType_SQLPASSTHROUGH;
+ bool bEscapeProcessing = static_cast<DataSelectionType>(nCursorSourceType) != DataSelectionType_SQLPASSTHROUGH;
m_xAggregateSet->setPropertyValue(PROPERTY_ESCAPE_PROCESSING, makeAny(bEscapeProcessing));
}
break;
@@ -3933,15 +3933,15 @@ void SAL_CALL ODatabaseForm::read(const Reference<XObjectInputStream>& _rxInStre
OUString sTmp;
_rxInStream >> sTmp;
m_aTargetURL = INetURLObject::decode( sTmp, INetURLObject::DecodeMechanism::Unambiguous);
- m_eSubmitMethod = (FormSubmitMethod)_rxInStream->readShort();
- m_eSubmitEncoding = (FormSubmitEncoding)_rxInStream->readShort();
+ m_eSubmitMethod = static_cast<FormSubmitMethod>(_rxInStream->readShort());
+ m_eSubmitEncoding = static_cast<FormSubmitEncoding>(_rxInStream->readShort());
_rxInStream >> m_aTargetFrame;
if (nVersion > 1)
{
sal_Int32 nCycle = _rxInStream->readShort();
m_aCycle <<= TabulatorCycle(nCycle);
- m_eNavigation = (NavigationBarMode)_rxInStream->readShort();
+ m_eNavigation = static_cast<NavigationBarMode>(_rxInStream->readShort());
_rxInStream >> sAggregateProp;
setPropertyValue(PROPERTY_FILTER, makeAny(sAggregateProp));
diff --git a/forms/source/component/Grid.cxx b/forms/source/component/Grid.cxx
index cd956bbfd470..db2a5b11dba8 100644
--- a/forms/source/component/Grid.cxx
+++ b/forms/source/component/Grid.cxx
@@ -929,7 +929,7 @@ void OGridControlModel::read(const Reference<XObjectInputStream>& _rxInStream)
if ( nAnyMask & FONTATTRIBS )
{
aFont.Weight = static_cast<float>(vcl::unohelper::ConvertFontWeight( _rxInStream->readShort() ));
- aFont.Slant = (FontSlant)_rxInStream->readShort();
+ aFont.Slant = static_cast<FontSlant>(_rxInStream->readShort());
aFont.Underline = _rxInStream->readShort();
aFont.Strikeout = _rxInStream->readShort();
aFont.Orientation = static_cast<float>(_rxInStream->readShort()) / 10;
diff --git a/forms/source/component/ImageButton.cxx b/forms/source/component/ImageButton.cxx
index e4212c5ed46f..d7157894f83b 100644
--- a/forms/source/component/ImageButton.cxx
+++ b/forms/source/component/ImageButton.cxx
@@ -94,7 +94,7 @@ void OImageButtonModel::write(const Reference<XObjectOutputStream>& _rxOutStream
// Version
_rxOutStream->writeShort(0x0003);
- _rxOutStream->writeShort((sal_uInt16)m_eButtonType);
+ _rxOutStream->writeShort(static_cast<sal_uInt16>(m_eButtonType));
OUString sTmp(INetURLObject::decode( m_sTargetURL, INetURLObject::DecodeMechanism::Unambiguous));
_rxOutStream << sTmp;
@@ -113,19 +113,19 @@ void OImageButtonModel::read(const Reference<XObjectInputStream>& _rxInStream)
{
case 0x0001:
{
- m_eButtonType = (FormButtonType)_rxInStream->readShort();
+ m_eButtonType = static_cast<FormButtonType>(_rxInStream->readShort());
}
break;
case 0x0002:
{
- m_eButtonType = (FormButtonType)_rxInStream->readShort();
+ m_eButtonType = static_cast<FormButtonType>(_rxInStream->readShort());
_rxInStream >> m_sTargetURL;
_rxInStream >> m_sTargetFrame;
}
break;
case 0x0003:
{
- m_eButtonType = (FormButtonType)_rxInStream->readShort();
+ m_eButtonType = static_cast<FormButtonType>(_rxInStream->readShort());
_rxInStream >> m_sTargetURL;
_rxInStream >> m_sTargetFrame;
readHelpTextCompatibly(_rxInStream);
diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx
index 850028504128..93b2fd63fc46 100644
--- a/forms/source/component/ListBox.cxx
+++ b/forms/source/component/ListBox.cxx
@@ -571,7 +571,7 @@ namespace frm
_rxOutStream << nAnyMask;
_rxOutStream << lcl_convertToStringSequence( m_aListSourceValues );
- _rxOutStream << (sal_Int16)m_eListSourceType;
+ _rxOutStream << static_cast<sal_Int16>(m_eListSourceType);
_rxOutStream << aDummySeq;
_rxOutStream << m_aDefaultSelectSeq;
@@ -657,7 +657,7 @@ namespace frm
sal_Int16 nListSourceType;
_rxInStream >> nListSourceType;
- m_eListSourceType = (ListSourceType)nListSourceType;
+ m_eListSourceType = static_cast<ListSourceType>(nListSourceType);
Any aListSourceSeqAny;
aListSourceSeqAny <<= aListSourceSeq;
diff --git a/forms/source/component/RadioButton.cxx b/forms/source/component/RadioButton.cxx
index 64a9693fa182..a60d1390ff54 100644
--- a/forms/source/component/RadioButton.cxx
+++ b/forms/source/component/RadioButton.cxx
@@ -304,7 +304,7 @@ void SAL_CALL ORadioButtonModel::read(const Reference<XObjectInputStream>& _rxIn
}
setReferenceValue( sReferenceValue );
- setDefaultChecked( (ToggleState)nDefaultChecked );
+ setDefaultChecked( static_cast<ToggleState>(nDefaultChecked) );
// Display default values after read
if ( !getControlSource().isEmpty() )
diff --git a/forms/source/component/refvaluecomponent.cxx b/forms/source/component/refvaluecomponent.cxx
index f045d119e10e..760fd6f9c164 100644
--- a/forms/source/component/refvaluecomponent.cxx
+++ b/forms/source/component/refvaluecomponent.cxx
@@ -108,7 +108,7 @@ namespace frm
" 0--2"),
css::uno::Reference<css::uno::XInterface>(), -1);
}
- m_eDefaultChecked = (ToggleState)nDefaultChecked;
+ m_eDefaultChecked = static_cast<ToggleState>(nDefaultChecked);
resetNoBroadcast();
}
break;