summaryrefslogtreecommitdiff
path: root/svx/source/form
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-12 20:13:55 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-12 20:13:55 +0100
commitc049c76fc521f2b55b39a6e9eb0f0092bcf6ef77 (patch)
tree2bc2c059a6f6a175a0c0e5321887adc077fef419 /svx/source/form
parent0ae2d98d1f6d29c80bd1ee830db4c333e4ee1e1d (diff)
More loplugin:cstylecast: svx
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I100e6c14cbf1d780f0e5ebca6b0c9e71ce1caaf7
Diffstat (limited to 'svx/source/form')
-rw-r--r--svx/source/form/filtnav.cxx6
-rw-r--r--svx/source/form/fmcontrollayout.cxx2
-rw-r--r--svx/source/form/fmobj.cxx2
-rw-r--r--svx/source/form/fmobjfac.cxx4
-rw-r--r--svx/source/form/fmshimp.cxx12
-rw-r--r--svx/source/form/fmsrcimp.cxx4
-rw-r--r--svx/source/form/fmview.cxx2
-rw-r--r--svx/source/form/formcontrolfactory.cxx4
-rw-r--r--svx/source/form/formcontroller.cxx14
-rw-r--r--svx/source/form/navigatortreemodel.cxx4
10 files changed, 27 insertions, 27 deletions
diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index 99c725eef48d..3591a25cc18e 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -426,7 +426,7 @@ void SAL_CALL FmFilterAdapter::disjunctiveTermRemoved( const FilterEvent& Event
return;
::std::vector< FmFilterData* >& rTermItems = pFormItem->GetChildren();
- const bool bValidIndex = ( Event.DisjunctiveTerm >= 0 ) && ( (size_t)Event.DisjunctiveTerm < rTermItems.size() );
+ const bool bValidIndex = ( Event.DisjunctiveTerm >= 0 ) && ( static_cast<size_t>(Event.DisjunctiveTerm) < rTermItems.size() );
OSL_ENSURE( bValidIndex, "FmFilterAdapter::disjunctiveTermRemoved: invalid term index!" );
if ( !bValidIndex )
return;
@@ -461,7 +461,7 @@ void SAL_CALL FmFilterAdapter::disjunctiveTermAdded( const FilterEvent& Event )
return;
const sal_Int32 nInsertPos = Event.DisjunctiveTerm;
- bool bValidIndex = ( nInsertPos >= 0 ) && ( (size_t)nInsertPos <= pFormItem->GetChildren().size() );
+ bool bValidIndex = ( nInsertPos >= 0 ) && ( static_cast<size_t>(nInsertPos) <= pFormItem->GetChildren().size() );
if ( !bValidIndex )
{
OSL_FAIL( "FmFilterAdapter::disjunctiveTermAdded: invalid index!" );
@@ -671,7 +671,7 @@ void FmFilterModel::SetCurrentController(const Reference< XFormController > & xC
{
Reference< XFilterController > xFilterController( m_xController, UNO_QUERY_THROW );
const sal_Int32 nActiveTerm( xFilterController->getActiveTerm() );
- if ( pItem->GetChildren().size() > (size_t)nActiveTerm )
+ if ( pItem->GetChildren().size() > static_cast<size_t>(nActiveTerm) )
{
SetCurrentItems( static_cast< FmFilterItems* >( pItem->GetChildren()[ nActiveTerm ] ) );
}
diff --git a/svx/source/form/fmcontrollayout.cxx b/svx/source/form/fmcontrollayout.cxx
index 4ba08f31c67a..22dfb220feb4 100644
--- a/svx/source/form/fmcontrollayout.cxx
+++ b/svx/source/form/fmcontrollayout.cxx
@@ -263,7 +263,7 @@ namespace svxform
&& ( xPSI->hasPropertyByName( FM_PROP_BORDERCOLOR ) )
)
// light gray flat border
- _rxControlModel->setPropertyValue( FM_PROP_BORDERCOLOR, makeAny( (sal_Int32)0x00C0C0C0 ) );
+ _rxControlModel->setPropertyValue( FM_PROP_BORDERCOLOR, makeAny( sal_Int32(0x00C0C0C0) ) );
}
}
if ( xPSI->hasPropertyByName( FM_PROP_VISUALEFFECT ) )
diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx
index 10a0644669e0..98180032ebbf 100644
--- a/svx/source/form/fmobj.cxx
+++ b/svx/source/form/fmobj.cxx
@@ -456,7 +456,7 @@ Reference< XInterface > FmFormObj::ensureModelEnv(const Reference< XInterface >
do
{
OUString aToken = sAccessPath.getToken( 0, '\\', nTokIndex );
- sal_uInt16 nIndex = (sal_uInt16)aToken.toInt32();
+ sal_uInt16 nIndex = static_cast<sal_uInt16>(aToken.toInt32());
// get the DSS of the source form (we have to find an equivalent for)
DBG_ASSERT(nIndex<xSourceContainer->getCount(), "FmFormObj::ensureModelEnv : invalid access path !");
diff --git a/svx/source/form/fmobjfac.cxx b/svx/source/form/fmobjfac.cxx
index 3244daa434a8..22c9feb11499 100644
--- a/svx/source/form/fmobjfac.cxx
+++ b/svx/source/form/fmobjfac.cxx
@@ -202,12 +202,12 @@ IMPL_STATIC_LINK(
case OBJ_FM_SCROLLBAR:
sServiceSpecifier = FM_SUN_COMPONENT_SCROLLBAR;
- aInitialProperties.emplace_back( FM_PROP_BORDER, makeAny( (sal_Int16)0 ) );
+ aInitialProperties.emplace_back( FM_PROP_BORDER, makeAny( sal_Int16(0) ) );
break;
case OBJ_FM_SPINBUTTON:
sServiceSpecifier = FM_SUN_COMPONENT_SPINBUTTON;
- aInitialProperties.emplace_back( FM_PROP_BORDER, makeAny( (sal_Int16)0 ) );
+ aInitialProperties.emplace_back( FM_PROP_BORDER, makeAny( sal_Int16(0) ) );
break;
}
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index 3f72b3a7a1f5..6eb3385291cd 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -1486,7 +1486,7 @@ void FmXFormShell::ExecuteSearch_Lock()
{
if (m_aSearchForms.at(i) == xActiveForm)
{
- nInitialContext = (sal_Int16)i;
+ nInitialContext = static_cast<sal_Int16>(i);
break;
}
}
@@ -2194,7 +2194,7 @@ IMPL_LINK(FmXFormShell, OnFoundData_Lock, FmFoundRecordInformation&, rfriWhere,
if (impl_checkDisposed_Lock())
return;
- DBG_ASSERT((rfriWhere.nContext >= 0) && (rfriWhere.nContext < (sal_Int16)m_aSearchForms.size()),
+ DBG_ASSERT((rfriWhere.nContext >= 0) && (rfriWhere.nContext < static_cast<sal_Int16>(m_aSearchForms.size())),
"FmXFormShell::OnFoundData : invalid context!");
Reference< XForm> xForm( m_aSearchForms.at(rfriWhere.nContext));
DBG_ASSERT(xForm.is(), "FmXFormShell::OnFoundData : invalid form!");
@@ -2259,7 +2259,7 @@ IMPL_LINK(FmXFormShell, OnFoundData_Lock, FmFoundRecordInformation&, rfriWhere,
m_xLastGridFound = xControlModel;
if ( xGrid.is() )
- xGrid->setCurrentColumnPosition((sal_Int16)nGridColumn);
+ xGrid->setCurrentColumnPosition(static_cast<sal_Int16>(nGridColumn));
}
// As the cursor has been repositioned, I have (in positioned) invalidated
@@ -2277,7 +2277,7 @@ IMPL_LINK(FmXFormShell, OnCanceledNotFound_Lock, FmFoundRecordInformation&, rfri
if (impl_checkDisposed_Lock())
return;
- DBG_ASSERT((rfriWhere.nContext >= 0) && (rfriWhere.nContext < (sal_Int16)m_aSearchForms.size()),
+ DBG_ASSERT((rfriWhere.nContext >= 0) && (rfriWhere.nContext < static_cast<sal_Int16>(m_aSearchForms.size())),
"FmXFormShell::OnCanceledNotFound : invalid context!");
Reference< XForm> xForm( m_aSearchForms.at(rfriWhere.nContext));
DBG_ASSERT(xForm.is(), "FmXFormShell::OnCanceledNotFound : invalid form!");
@@ -2306,7 +2306,7 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest_Lock, FmSearchContext&, rfmscCont
if (impl_checkDisposed_Lock())
return 0;
- DBG_ASSERT(rfmscContextInfo.nContext < (sal_Int16)m_aSearchForms.size(), "FmXFormShell::OnSearchContextRequest : invalid parameter !");
+ DBG_ASSERT(rfmscContextInfo.nContext < static_cast<sal_Int16>(m_aSearchForms.size()), "FmXFormShell::OnSearchContextRequest : invalid parameter !");
Reference< XForm> xForm( m_aSearchForms.at(rfmscContextInfo.nContext));
DBG_ASSERT(xForm.is(), "FmXFormShell::OnSearchContextRequest : unexpected : invalid context !");
@@ -3426,7 +3426,7 @@ void FmXFormShell::CreateExternalView_Lock()
// bound column
pListBoxDescription->Name = FM_PROP_BOUNDCOLUMN;
- pListBoxDescription->Value <<= (sal_Int16)1;
+ pListBoxDescription->Value <<= sal_Int16(1);
++pListBoxDescription;
// content type
diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx
index 9d14412dde93..4612f2563f68 100644
--- a/svx/source/form/fmsrcimp.cxx
+++ b/svx/source/form/fmsrcimp.cxx
@@ -280,7 +280,7 @@ void FmSearchEngine::BuildAndInsertFieldInfo(const Reference< css::container::XI
OUString FmSearchEngine::FormatField(sal_Int32 nWhich)
{
- DBG_ASSERT((sal_uInt32)nWhich < m_aControlTexts.size(), "FmSearchEngine::FormatField(sal_Int32) : invalid position !");
+ DBG_ASSERT(static_cast<sal_uInt32>(nWhich) < m_aControlTexts.size(), "FmSearchEngine::FormatField(sal_Int32) : invalid position !");
DBG_ASSERT(m_aControlTexts[nWhich], "FmSearchEngine::FormatField(sal_Int32) : invalid object in array !");
DBG_ASSERT(m_aControlTexts[nWhich]->getControl().is(), "FmSearchEngine::FormatField : invalid control !");
@@ -291,7 +291,7 @@ OUString FmSearchEngine::FormatField(sal_Int32 nWhich)
nWhich = m_nCurrentFieldIndex;
}
- DBG_ASSERT((nWhich >= 0) && ((sal_uInt32)nWhich < m_aControlTexts.size()),
+ DBG_ASSERT((nWhich >= 0) && (static_cast<sal_uInt32>(nWhich) < m_aControlTexts.size()),
"FmSearchEngine::FormatField : invalid argument nWhich !");
return m_aControlTexts[m_nCurrentFieldIndex == -1 ? nWhich : m_nCurrentFieldIndex]->getCurrentText();
}
diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx
index cc952a1948f7..ed3a1da307b7 100644
--- a/svx/source/form/fmview.cxx
+++ b/svx/source/form/fmview.cxx
@@ -404,7 +404,7 @@ SdrObject* FmFormView::CreateFieldControl(const OUString& rFieldDesc) const
{
OUString sDataSource = rFieldDesc.getToken(0,u'\x000B');
OUString sObjectName = rFieldDesc.getToken(1,u'\x000B');
- sal_uInt16 nObjectType = (sal_uInt16)rFieldDesc.getToken(2,u'\x000B').toInt32();
+ sal_uInt16 nObjectType = static_cast<sal_uInt16>(rFieldDesc.getToken(2,u'\x000B').toInt32());
OUString sFieldName = rFieldDesc.getToken(3,u'\x000B');
if (sFieldName.isEmpty() || sObjectName.isEmpty() || sDataSource.isEmpty())
diff --git a/svx/source/form/formcontrolfactory.cxx b/svx/source/form/formcontrolfactory.cxx
index bd5a1596764a..f0512d2e85b3 100644
--- a/svx/source/form/formcontrolfactory.cxx
+++ b/svx/source/form/formcontrolfactory.cxx
@@ -602,7 +602,7 @@ namespace svxform
// both the minimum and the maximum value properties can be either Long or Double
Property aProperty = xModelPSI->getPropertyByName( FM_PROP_VALUEMIN );
if ( aProperty.Type.getTypeClass() == TypeClass_DOUBLE )
- aValue <<= (double)nMinValue;
+ aValue <<= static_cast<double>(nMinValue);
else if ( aProperty.Type.getTypeClass() == TypeClass_LONG )
aValue <<= nMinValue;
else
@@ -614,7 +614,7 @@ namespace svxform
// both the minimum and the maximum value properties can be either Long or Double
aProperty = xModelPSI->getPropertyByName( FM_PROP_VALUEMAX );
if ( aProperty.Type.getTypeClass() == TypeClass_DOUBLE )
- aValue <<= (double)nMaxValue;
+ aValue <<= static_cast<double>(nMaxValue);
else if ( aProperty.Type.getTypeClass() == TypeClass_LONG )
aValue <<= nMaxValue;
else
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index 3a7524ec8f33..9e68d5601186 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -741,10 +741,10 @@ void FormController::impl_setTextOnAllFilter_throw()
return;
// set the text for all filters
- OSL_ENSURE( m_aFilterRows.size() > (size_t)m_nCurrentFilterPosition,
+ OSL_ENSURE( m_aFilterRows.size() > static_cast<size_t>(m_nCurrentFilterPosition),
"FormController::impl_setTextOnAllFilter_throw: m_nCurrentFilterPosition too big" );
- if ( (size_t)m_nCurrentFilterPosition < m_aFilterRows.size() )
+ if ( static_cast<size_t>(m_nCurrentFilterPosition) < m_aFilterRows.size() )
{
FmFilterRow& rRow = m_aFilterRows[ m_nCurrentFilterPosition ];
for ( FmFilterRow::const_iterator iter2 = rRow.begin();
@@ -1083,7 +1083,7 @@ Any SAL_CALL FormController::getByIndex(sal_Int32 Index)
{
::osl::MutexGuard aGuard( m_aMutex );
if (Index < 0 ||
- Index >= (sal_Int32)m_aChildren.size())
+ Index >= static_cast<sal_Int32>(m_aChildren.size()))
throw IndexOutOfBoundsException();
return makeAny( m_aChildren[ Index ] );
@@ -1452,7 +1452,7 @@ void SAL_CALL FormController::textChanged(const TextEvent& e)
appendEmptyDisjunctiveTerm();
// find the current row
- if ( ( (size_t)m_nCurrentFilterPosition >= m_aFilterRows.size() ) || ( m_nCurrentFilterPosition < 0 ) )
+ if ( ( static_cast<size_t>(m_nCurrentFilterPosition) >= m_aFilterRows.size() ) || ( m_nCurrentFilterPosition < 0 ) )
{
OSL_ENSURE( false, "FormController::textChanged: m_nCurrentFilterPosition is wrong!" );
return;
@@ -1582,7 +1582,7 @@ void FormController::impl_appendEmptyFilterRow( ::osl::ClearableMutexGuard& _rCl
// notify the listeners
FilterEvent aEvent;
aEvent.Source = *this;
- aEvent.DisjunctiveTerm = (sal_Int32)m_aFilterRows.size() - 1;
+ aEvent.DisjunctiveTerm = static_cast<sal_Int32>(m_aFilterRows.size()) - 1;
_rClearBeforeNotify.clear();
// <-- SYNCHRONIZED
m_aFilterListeners.notifyEach( &XFilterControllerListener::disjunctiveTermAdded, aEvent );
@@ -3087,8 +3087,8 @@ void FormController::setFilter(::std::vector<FmFieldInfo>& rFieldInfos)
* works for ASCII separators, but
* pParseNode->parseNodeToPredicateStr() expects a sal_Char. Fix it
* there. */
- sal_Char cDecimalSeparator = (sal_Char)rLocaleWrapper.getNumDecimalSep()[0];
- SAL_WARN_IF( (sal_Unicode)cDecimalSeparator != rLocaleWrapper.getNumDecimalSep()[0],
+ sal_Char cDecimalSeparator = static_cast<sal_Char>(rLocaleWrapper.getNumDecimalSep()[0]);
+ SAL_WARN_IF( static_cast<sal_Unicode>(cDecimalSeparator) != rLocaleWrapper.getNumDecimalSep()[0],
"svx.form", "FormController::setFilter: wrong cast of decimal separator to sal_Char!");
// retrieving the filter
diff --git a/svx/source/form/navigatortreemodel.cxx b/svx/source/form/navigatortreemodel.cxx
index 4d19f399f470..c7f08f09d6d0 100644
--- a/svx/source/form/navigatortreemodel.cxx
+++ b/svx/source/form/navigatortreemodel.cxx
@@ -281,8 +281,8 @@ namespace svxform
m_pFormModel->BegUndo(aUndoStr);
}
- if (nRelPos >= (sal_uInt32)xContainer->getCount())
- nRelPos = (sal_uInt32)xContainer->getCount();
+ if (nRelPos >= static_cast<sal_uInt32>(xContainer->getCount()))
+ nRelPos = static_cast<sal_uInt32>(xContainer->getCount());
// UndoAction
if ( bUndo && m_pPropChangeList->CanUndo())