diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:09:29 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:09:29 +0100 |
commit | dec5264878903ee010e9a6296357750f6c69c844 (patch) | |
tree | e987833003c31730486c95e82b6cc97b960de1a2 /xmloff | |
parent | ab279d30de4188baa4b33688aaed96072f3b4818 (diff) |
More loplugin:cstylecast: xmloff
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: Ic872cef7bb9982305528ec3ce12a1871f055b752
Diffstat (limited to 'xmloff')
75 files changed, 257 insertions, 257 deletions
diff --git a/xmloff/source/chart/PropertyMaps.cxx b/xmloff/source/chart/PropertyMaps.cxx index 54116fcd571a..0808a83721ef 100644 --- a/xmloff/source/chart/PropertyMaps.cxx +++ b/xmloff/source/chart/PropertyMaps.cxx @@ -406,7 +406,7 @@ void XMLChartExportPropertyMapper::handleSpecialItem( { // convert from 100th degrees to degrees (double) rProperty.maValue >>= nValue; - double fVal = (double)nValue / 100.0; + double fVal = static_cast<double>(nValue) / 100.0; ::sax::Converter::convertDouble( sValueBuffer, fVal ); } break; @@ -580,7 +580,7 @@ bool XMLChartImportPropertyMapper::handleSpecialItem( // convert from degrees (double) to 100th degrees (integer) double fVal; ::sax::Converter::convertDouble( fVal, rValue ); - nValue = (sal_Int32)( fVal * 100.0 ); + nValue = static_cast<sal_Int32>( fVal * 100.0 ); rProperty.maValue <<= nValue; } break; diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx index 92f389645d6b..0c7e30ad362e 100644 --- a/xmloff/source/chart/SchXMLTableContext.cxx +++ b/xmloff/source/chart/SchXMLTableContext.cxx @@ -544,7 +544,7 @@ SchXMLTableRowContext::SchXMLTableRowContext( std::vector< SchXMLCell > aNewRow; aNewRow.reserve( mrTable.nNumberOfColsEstimate ); - while( mrTable.aData.size() <= (unsigned long)mrTable.nRowIndex ) + while( mrTable.aData.size() <= static_cast<unsigned long>(mrTable.nRowIndex) ) mrTable.aData.push_back( aNewRow ); } diff --git a/xmloff/source/core/ProgressBarHelper.cxx b/xmloff/source/core/ProgressBarHelper.cxx index 09f12d699850..b16ecc7f0b8f 100644 --- a/xmloff/source/core/ProgressBarHelper.cxx +++ b/xmloff/source/core/ProgressBarHelper.cxx @@ -52,7 +52,7 @@ void ProgressBarHelper::ChangeReference(sal_Int32 nNewReference) { if (nReference) { - double fPercent((double)nNewReference / nReference); + double fPercent(static_cast<double>(nNewReference) / nReference); double fValue(nValue * fPercent); nValue = static_cast<sal_Int32>(fValue); nReference = nNewReference; @@ -91,7 +91,7 @@ void ProgressBarHelper::SetValue(sal_Int32 nTempValue) double fPercent((fNewValue * 100) / nRange); if (fPercent >= (fOldPercent + fProgressStep) || fPercent < fOldPercent) { - xStatusIndicator->setValue((sal_Int32)fNewValue); + xStatusIndicator->setValue(static_cast<sal_Int32>(fNewValue)); fOldPercent = fPercent; } } diff --git a/xmloff/source/core/attrlist.cxx b/xmloff/source/core/attrlist.cxx index 849a595f50f3..5985ef2159be 100644 --- a/xmloff/source/core/attrlist.cxx +++ b/xmloff/source/core/attrlist.cxx @@ -188,7 +188,7 @@ void SvXMLAttributeList::AppendAttributeList( const uno::Reference< css::xml::sa r->getValueByIndex( i )); } - OSL_ASSERT( nTotalSize == (SvXMLAttributeList_Impl::size_type)getLength()); + OSL_ASSERT( nTotalSize == static_cast<SvXMLAttributeList_Impl::size_type>(getLength())); } void SvXMLAttributeList::SetValueByIndex( sal_Int16 i, diff --git a/xmloff/source/core/unoatrcn.cxx b/xmloff/source/core/unoatrcn.cxx index 01a3d1ff6ba4..47d3bb6e9d66 100644 --- a/xmloff/source/core/unoatrcn.cxx +++ b/xmloff/source/core/unoatrcn.cxx @@ -128,7 +128,7 @@ uno::Sequence< OUString > SAL_CALL SvUnoAttributeContainer::getElementNames() { const sal_uInt16 nAttrCount = mpContainer->GetAttrCount(); - uno::Sequence< OUString > aElementNames( (sal_Int32)nAttrCount ); + uno::Sequence< OUString > aElementNames( static_cast<sal_Int32>(nAttrCount) ); OUString *pNames = aElementNames.getArray(); for( sal_uInt16 nAttr = 0; nAttr < nAttrCount; nAttr++ ) diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 3d33a489493a..f1761339481d 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -3344,7 +3344,7 @@ namespace xmloff { namespace token { assert(XML_TOKEN_INVALID < eToken); assert(eToken < XML_TOKEN_END); - const XMLTokenEntry* pToken = &aTokenList[(sal_uInt16)eToken]; + const XMLTokenEntry* pToken = &aTokenList[static_cast<sal_uInt16>(eToken)]; return rString.equalsAsciiL( pToken->pChar, pToken->nLength ); } @@ -3355,7 +3355,7 @@ namespace xmloff { namespace token { assert(XML_TOKEN_INVALID < eToken); assert(eToken < XML_TOKEN_END); - const XMLTokenEntry* pToken = &aTokenList[(sal_uInt16)eToken]; + const XMLTokenEntry* pToken = &aTokenList[static_cast<sal_uInt16>(eToken)]; return aIter.isString( pToken->pChar ); } } diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx index bd0d53e79567..f4819e1c9517 100644 --- a/xmloff/source/core/xmluconv.cxx +++ b/xmloff/source/core/xmluconv.cxx @@ -325,9 +325,9 @@ void SvXMLUnitConverter::convertDateTime( OUStringBuffer& rBuffer, fValue -= nValue; double fCount; if (nValue > 0) - fCount = ::rtl::math::approxFloor (log10((double)nValue)) + 1; + fCount = ::rtl::math::approxFloor (log10(static_cast<double>(nValue))) + 1; else if (nValue < 0) - fCount = ::rtl::math::approxFloor (log10((double)(nValue * -1))) + 1; + fCount = ::rtl::math::approxFloor (log10(static_cast<double>(nValue * -1))) + 1; else fCount = 0.0; sal_Int16 nCount = sal_Int16(fCount); diff --git a/xmloff/source/draw/EnhancedCustomShapeToken.cxx b/xmloff/source/draw/EnhancedCustomShapeToken.cxx index bd4427b4affd..179899619b23 100644 --- a/xmloff/source/draw/EnhancedCustomShapeToken.cxx +++ b/xmloff/source/draw/EnhancedCustomShapeToken.cxx @@ -185,7 +185,7 @@ EnhancedCustomShapeTokenEnum EASGet( const OUString& rShapeType ) int i, nLen = rShapeType.getLength(); std::unique_ptr<char[]> pBuf(new char[ nLen + 1 ]); for ( i = 0; i < nLen; i++ ) - pBuf[ i ] = (char)rShapeType[ i ]; + pBuf[ i ] = static_cast<char>(rShapeType[ i ]); pBuf[ i ] = 0; TypeNameHashMap::iterator aHashIter( pHashMap->find( pBuf.get() ) ); if ( aHashIter != pHashMap->end() ) @@ -196,8 +196,8 @@ EnhancedCustomShapeTokenEnum EASGet( const OUString& rShapeType ) OUString EASGet( const EnhancedCustomShapeTokenEnum eToken ) { sal_uInt32 i = eToken >= EAS_Last - ? (sal_uInt32)EAS_NotFound - : (sal_uInt32)eToken; + ? sal_uInt32(EAS_NotFound) + : static_cast<sal_uInt32>(eToken); return OUString::createFromAscii( pTokenTableArray[ i ].pS ); } diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx index af8875e7056c..2b3c740be2d7 100644 --- a/xmloff/source/draw/animationimport.cxx +++ b/xmloff/source/draw/animationimport.cxx @@ -146,17 +146,17 @@ const SvXMLTokenMap& AnimationsImportHelperImpl::getAnimationNodeTokenMap() { static const SvXMLTokenMapEntry aAnimationNodeTokenMap[] = { - { XML_NAMESPACE_ANIMATION, XML_PAR, (sal_uInt16)AnimationNodeType::PAR }, - { XML_NAMESPACE_ANIMATION, XML_SEQ, (sal_uInt16)AnimationNodeType::SEQ }, - { XML_NAMESPACE_ANIMATION, XML_ITERATE, (sal_uInt16)AnimationNodeType::ITERATE }, - { XML_NAMESPACE_ANIMATION, XML_ANIMATE, (sal_uInt16)AnimationNodeType::ANIMATE }, - { XML_NAMESPACE_ANIMATION, XML_SET, (sal_uInt16)AnimationNodeType::SET }, - { XML_NAMESPACE_ANIMATION, XML_ANIMATEMOTION, (sal_uInt16)AnimationNodeType::ANIMATEMOTION }, - { XML_NAMESPACE_ANIMATION, XML_ANIMATECOLOR, (sal_uInt16)AnimationNodeType::ANIMATECOLOR }, - { XML_NAMESPACE_ANIMATION, XML_ANIMATETRANSFORM, (sal_uInt16)AnimationNodeType::ANIMATETRANSFORM }, - { XML_NAMESPACE_ANIMATION, XML_TRANSITIONFILTER, (sal_uInt16)AnimationNodeType::TRANSITIONFILTER }, - { XML_NAMESPACE_ANIMATION, XML_AUDIO, (sal_uInt16)AnimationNodeType::AUDIO }, - { XML_NAMESPACE_ANIMATION, XML_COMMAND, (sal_uInt16)AnimationNodeType::COMMAND }, + { XML_NAMESPACE_ANIMATION, XML_PAR, sal_uInt16(AnimationNodeType::PAR) }, + { XML_NAMESPACE_ANIMATION, XML_SEQ, sal_uInt16(AnimationNodeType::SEQ) }, + { XML_NAMESPACE_ANIMATION, XML_ITERATE, sal_uInt16(AnimationNodeType::ITERATE) }, + { XML_NAMESPACE_ANIMATION, XML_ANIMATE, sal_uInt16(AnimationNodeType::ANIMATE) }, + { XML_NAMESPACE_ANIMATION, XML_SET, sal_uInt16(AnimationNodeType::SET) }, + { XML_NAMESPACE_ANIMATION, XML_ANIMATEMOTION, sal_uInt16(AnimationNodeType::ANIMATEMOTION) }, + { XML_NAMESPACE_ANIMATION, XML_ANIMATECOLOR, sal_uInt16(AnimationNodeType::ANIMATECOLOR) }, + { XML_NAMESPACE_ANIMATION, XML_ANIMATETRANSFORM, sal_uInt16(AnimationNodeType::ANIMATETRANSFORM) }, + { XML_NAMESPACE_ANIMATION, XML_TRANSITIONFILTER, sal_uInt16(AnimationNodeType::TRANSITIONFILTER) }, + { XML_NAMESPACE_ANIMATION, XML_AUDIO, sal_uInt16(AnimationNodeType::AUDIO) }, + { XML_NAMESPACE_ANIMATION, XML_COMMAND, sal_uInt16(AnimationNodeType::COMMAND) }, XML_TOKEN_MAP_END }; @@ -225,56 +225,56 @@ const SvXMLTokenMap& AnimationsImportHelperImpl::getAnimationNodeAttributeTokenM { static const SvXMLTokenMapEntry aAnimationNodeAttributeTokenMap[] = { - { XML_NAMESPACE_SMIL, XML_BEGIN, (sal_uInt16)ANA_Begin }, - { XML_NAMESPACE_SMIL, XML_DUR, (sal_uInt16)ANA_Dur }, - { XML_NAMESPACE_SMIL, XML_END, (sal_uInt16)ANA_End }, - { XML_NAMESPACE_SMIL, XML_FILL, (sal_uInt16)ANA_Fill }, - { XML_NAMESPACE_SMIL, XML_FILLDEFAULT, (sal_uInt16)ANA_FillDefault }, - { XML_NAMESPACE_SMIL, XML_RESTART, (sal_uInt16)ANA_Restart }, - { XML_NAMESPACE_SMIL, XML_RESTARTDEFAULT, (sal_uInt16)ANA_RestartDefault }, - { XML_NAMESPACE_SMIL, XML_ACCELERATE, (sal_uInt16)ANA_Accelerate }, - { XML_NAMESPACE_SMIL, XML_DECELERATE, (sal_uInt16)ANA_Decelerate }, - { XML_NAMESPACE_SMIL, XML_AUTOREVERSE, (sal_uInt16)ANA_AutoReverse }, - { XML_NAMESPACE_SMIL, XML_REPEATCOUNT, (sal_uInt16)ANA_RepeatCount }, - { XML_NAMESPACE_SMIL, XML_REPEATDUR, (sal_uInt16)ANA_RepeatDur }, - { XML_NAMESPACE_SMIL, XML_ENDSYNC, (sal_uInt16)ANA_EndSync }, - { XML_NAMESPACE_PRESENTATION, XML_NODE_TYPE, (sal_uInt16)ANA_Node_Type }, - { XML_NAMESPACE_PRESENTATION, XML_PRESET_ID, (sal_uInt16)ANA_Preset_ID }, - { XML_NAMESPACE_PRESENTATION, XML_PRESET_SUB_TYPE, (sal_uInt16)ANA_Preset_Sub_Type }, - { XML_NAMESPACE_PRESENTATION, XML_PRESET_CLASS, (sal_uInt16)ANA_Preset_Class }, - { XML_NAMESPACE_PRESENTATION, XML_AFTER_EFFECT, (sal_uInt16)ANA_After_Effect }, - { XML_NAMESPACE_SMIL, XML_TARGETELEMENT, (sal_uInt16)ANA_Target }, - { XML_NAMESPACE_XLINK, XML_HREF, (sal_uInt16)ANA_XLink }, - { XML_NAMESPACE_PRESENTATION, XML_MASTER_ELEMENT, (sal_uInt16)ANA_MasterElement }, - { XML_NAMESPACE_ANIMATION, XML_SUB_ITEM, (sal_uInt16)ANA_SubItem }, - { XML_NAMESPACE_SMIL, XML_ATTRIBUTENAME, (sal_uInt16)ANA_AttributeName }, - { XML_NAMESPACE_SMIL, XML_VALUES, (sal_uInt16)ANA_Values }, - { XML_NAMESPACE_SMIL, XML_FROM, (sal_uInt16)ANA_From }, - { XML_NAMESPACE_SMIL, XML_BY, (sal_uInt16)ANA_By }, - { XML_NAMESPACE_SMIL, XML_TO, (sal_uInt16)ANA_To }, - { XML_NAMESPACE_SMIL, XML_KEYTIMES, (sal_uInt16)ANA_KeyTimes }, - { XML_NAMESPACE_SMIL, XML_CALCMODE, (sal_uInt16)ANA_CalcMode }, - { XML_NAMESPACE_SMIL, XML_ACCUMULATE, (sal_uInt16)ANA_Accumulate }, - { XML_NAMESPACE_PRESENTATION, XML_ADDITIVE, (sal_uInt16)ANA_AdditiveMode }, - { XML_NAMESPACE_SMIL, XML_ADDITIVE, (sal_uInt16)ANA_AdditiveMode }, - { XML_NAMESPACE_SMIL, XML_KEYSPLINES, (sal_uInt16)ANA_KeySplines }, - { XML_NAMESPACE_SVG, XML_PATH, (sal_uInt16)ANA_Path }, - { XML_NAMESPACE_ANIMATION, XML_COLOR_INTERPOLATION, (sal_uInt16)ANA_ColorSpace }, - { XML_NAMESPACE_ANIMATION, XML_COLOR_INTERPOLATION_DIRECTION, (sal_uInt16)ANA_ColorDirection }, - { XML_NAMESPACE_SVG, XML_TYPE, (sal_uInt16)ANA_TransformType }, - { XML_NAMESPACE_SMIL, XML_TYPE, (sal_uInt16)ANA_TransitionType }, - { XML_NAMESPACE_SMIL, XML_SUBTYPE, (sal_uInt16)ANA_TransitionSubType }, - { XML_NAMESPACE_SMIL, XML_MODE, (sal_uInt16)ANA_Mode }, - { XML_NAMESPACE_SMIL, XML_DIRECTION, (sal_uInt16)ANA_Direction }, - { XML_NAMESPACE_SMIL, XML_FADECOLOR, (sal_uInt16)ANA_FadeColor }, - { XML_NAMESPACE_ANIMATION, XML_ITERATE_TYPE, (sal_uInt16)ANA_IterateType }, - { XML_NAMESPACE_ANIMATION, XML_ITERATE_INTERVAL, (sal_uInt16)ANA_IterateInterval }, - { XML_NAMESPACE_ANIMATION, XML_FORMULA, (sal_uInt16)ANA_Formula }, - { XML_NAMESPACE_ANIMATION, XML_ID, (sal_uInt16)ANA_ANIMID }, - { XML_NAMESPACE_XML, XML_ID, (sal_uInt16)ANA_XMLID }, - { XML_NAMESPACE_PRESENTATION, XML_GROUP_ID, (sal_uInt16)ANA_Group_Id }, - { XML_NAMESPACE_ANIMATION, XML_AUDIO_LEVEL, (sal_uInt16)ANA_Volume }, - { XML_NAMESPACE_ANIMATION, XML_COMMAND, (sal_uInt16)ANA_Command }, + { XML_NAMESPACE_SMIL, XML_BEGIN, sal_uInt16(ANA_Begin) }, + { XML_NAMESPACE_SMIL, XML_DUR, sal_uInt16(ANA_Dur) }, + { XML_NAMESPACE_SMIL, XML_END, sal_uInt16(ANA_End) }, + { XML_NAMESPACE_SMIL, XML_FILL, sal_uInt16(ANA_Fill) }, + { XML_NAMESPACE_SMIL, XML_FILLDEFAULT, sal_uInt16(ANA_FillDefault) }, + { XML_NAMESPACE_SMIL, XML_RESTART, sal_uInt16(ANA_Restart) }, + { XML_NAMESPACE_SMIL, XML_RESTARTDEFAULT, sal_uInt16(ANA_RestartDefault) }, + { XML_NAMESPACE_SMIL, XML_ACCELERATE, sal_uInt16(ANA_Accelerate) }, + { XML_NAMESPACE_SMIL, XML_DECELERATE, sal_uInt16(ANA_Decelerate) }, + { XML_NAMESPACE_SMIL, XML_AUTOREVERSE, sal_uInt16(ANA_AutoReverse) }, + { XML_NAMESPACE_SMIL, XML_REPEATCOUNT, sal_uInt16(ANA_RepeatCount) }, + { XML_NAMESPACE_SMIL, XML_REPEATDUR, sal_uInt16(ANA_RepeatDur) }, + { XML_NAMESPACE_SMIL, XML_ENDSYNC, sal_uInt16(ANA_EndSync) }, + { XML_NAMESPACE_PRESENTATION, XML_NODE_TYPE, sal_uInt16(ANA_Node_Type) }, + { XML_NAMESPACE_PRESENTATION, XML_PRESET_ID, sal_uInt16(ANA_Preset_ID) }, + { XML_NAMESPACE_PRESENTATION, XML_PRESET_SUB_TYPE, sal_uInt16(ANA_Preset_Sub_Type) }, + { XML_NAMESPACE_PRESENTATION, XML_PRESET_CLASS, sal_uInt16(ANA_Preset_Class) }, + { XML_NAMESPACE_PRESENTATION, XML_AFTER_EFFECT, sal_uInt16(ANA_After_Effect) }, + { XML_NAMESPACE_SMIL, XML_TARGETELEMENT, sal_uInt16(ANA_Target) }, + { XML_NAMESPACE_XLINK, XML_HREF, sal_uInt16(ANA_XLink) }, + { XML_NAMESPACE_PRESENTATION, XML_MASTER_ELEMENT, sal_uInt16(ANA_MasterElement) }, + { XML_NAMESPACE_ANIMATION, XML_SUB_ITEM, sal_uInt16(ANA_SubItem) }, + { XML_NAMESPACE_SMIL, XML_ATTRIBUTENAME, sal_uInt16(ANA_AttributeName) }, + { XML_NAMESPACE_SMIL, XML_VALUES, sal_uInt16(ANA_Values) }, + { XML_NAMESPACE_SMIL, XML_FROM, sal_uInt16(ANA_From) }, + { XML_NAMESPACE_SMIL, XML_BY, sal_uInt16(ANA_By) }, + { XML_NAMESPACE_SMIL, XML_TO, sal_uInt16(ANA_To) }, + { XML_NAMESPACE_SMIL, XML_KEYTIMES, sal_uInt16(ANA_KeyTimes) }, + { XML_NAMESPACE_SMIL, XML_CALCMODE, sal_uInt16(ANA_CalcMode) }, + { XML_NAMESPACE_SMIL, XML_ACCUMULATE, sal_uInt16(ANA_Accumulate) }, + { XML_NAMESPACE_PRESENTATION, XML_ADDITIVE, sal_uInt16(ANA_AdditiveMode) }, + { XML_NAMESPACE_SMIL, XML_ADDITIVE, sal_uInt16(ANA_AdditiveMode) }, + { XML_NAMESPACE_SMIL, XML_KEYSPLINES, sal_uInt16(ANA_KeySplines) }, + { XML_NAMESPACE_SVG, XML_PATH, sal_uInt16(ANA_Path) }, + { XML_NAMESPACE_ANIMATION, XML_COLOR_INTERPOLATION, sal_uInt16(ANA_ColorSpace) }, + { XML_NAMESPACE_ANIMATION, XML_COLOR_INTERPOLATION_DIRECTION, sal_uInt16(ANA_ColorDirection) }, + { XML_NAMESPACE_SVG, XML_TYPE, sal_uInt16(ANA_TransformType) }, + { XML_NAMESPACE_SMIL, XML_TYPE, sal_uInt16(ANA_TransitionType) }, + { XML_NAMESPACE_SMIL, XML_SUBTYPE, sal_uInt16(ANA_TransitionSubType) }, + { XML_NAMESPACE_SMIL, XML_MODE, sal_uInt16(ANA_Mode) }, + { XML_NAMESPACE_SMIL, XML_DIRECTION, sal_uInt16(ANA_Direction) }, + { XML_NAMESPACE_SMIL, XML_FADECOLOR, sal_uInt16(ANA_FadeColor) }, + { XML_NAMESPACE_ANIMATION, XML_ITERATE_TYPE, sal_uInt16(ANA_IterateType) }, + { XML_NAMESPACE_ANIMATION, XML_ITERATE_INTERVAL, sal_uInt16(ANA_IterateInterval) }, + { XML_NAMESPACE_ANIMATION, XML_FORMULA, sal_uInt16(ANA_Formula) }, + { XML_NAMESPACE_ANIMATION, XML_ID, sal_uInt16(ANA_ANIMID) }, + { XML_NAMESPACE_XML, XML_ID, sal_uInt16(ANA_XMLID) }, + { XML_NAMESPACE_PRESENTATION, XML_GROUP_ID, sal_uInt16(ANA_Group_Id) }, + { XML_NAMESPACE_ANIMATION, XML_AUDIO_LEVEL, sal_uInt16(ANA_Volume) }, + { XML_NAMESPACE_ANIMATION, XML_COMMAND, sal_uInt16(ANA_Command) }, XML_TOKEN_MAP_END }; @@ -644,7 +644,7 @@ AnimationNodeContext::AnimationNodeContext( const sal_Char* pServiceName = nullptr; - sal_Int16 nNodeType = (sal_Int16)mpHelper->getAnimationNodeTokenMap().Get( nPrfx, rLocalName ); + sal_Int16 nNodeType = static_cast<sal_Int16>(mpHelper->getAnimationNodeTokenMap().Get( nPrfx, rLocalName )); switch( nNodeType ) { case AnimationNodeType::SEQ: pServiceName = "com.sun.star.animations.SequenceTimeContainer"; break; diff --git a/xmloff/source/draw/animimp.cxx b/xmloff/source/draw/animimp.cxx index eb4d40bc475c..25ecd4c750c0 100644 --- a/xmloff/source/draw/animimp.cxx +++ b/xmloff/source/draw/animimp.cxx @@ -506,7 +506,7 @@ XMLAnimationsEffectContext::XMLAnimationsEffectContext( SvXMLImport& rImport, s { sal_Int32 nScale; if (::sax::Converter::convertPercent( nScale, sValue )) - mnStartScale = (sal_Int16)nScale; + mnStartScale = static_cast<sal_Int16>(nScale); } else if( IsXMLToken( aLocalName, XML_SPEED ) ) { diff --git a/xmloff/source/draw/eventimp.cxx b/xmloff/source/draw/eventimp.cxx index d89d1cd1baf8..fd5c76714190 100644 --- a/xmloff/source/draw/eventimp.cxx +++ b/xmloff/source/draw/eventimp.cxx @@ -187,7 +187,7 @@ SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, sal_uInt16 nPrfx, cons { sal_Int32 nScale; if (::sax::Converter::convertPercent( nScale, sValue )) - mnStartScale = (sal_Int16)nScale; + mnStartScale = static_cast<sal_Int16>(nScale); } else if( IsXMLToken( aAttrLocalName, XML_SPEED ) ) { diff --git a/xmloff/source/draw/propimp0.cxx b/xmloff/source/draw/propimp0.cxx index a2d911af3352..24613f7e2200 100644 --- a/xmloff/source/draw/propimp0.cxx +++ b/xmloff/source/draw/propimp0.cxx @@ -218,7 +218,7 @@ bool XMLTextAnimationStepPropertyHdl::exportXML( if( nVal < 0 ) { - aOut.append( (sal_Int32)-nVal ); + aOut.append( static_cast<sal_Int32>(-nVal) ); aOut.append( "px" ); } else diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index 931667c57f1b..44021c381ac9 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -260,20 +260,20 @@ ImpXMLAutoLayoutInfo::ImpXMLAutoLayoutInfo(sal_uInt16 nTyp, ImpXMLEXPPageMasterI if(mnType == 21 /* AUTOLAYOUT_NOTES */) { - aTitleSize.Height() = (long) (aTitleSize.Height() / 2.5); + aTitleSize.Height() = static_cast<long>(aTitleSize.Height() / 2.5); Point aPos = aTitlePos; aPos.Y() += long( aTitleSize.Height() * 0.083 ); Size aPartArea = aTitleSize; Size aSize; // scale handout rectangle using actual page size - double fH = (double) aPartArea.Width() / aPageSize.Width(); - double fV = (double) aPartArea.Height() / aPageSize.Height(); + double fH = static_cast<double>(aPartArea.Width()) / aPageSize.Width(); + double fV = static_cast<double>(aPartArea.Height()) / aPageSize.Height(); if ( fH > fV ) fH = fV; - aSize.Width() = (long) (fH * aPageSize.Width()); - aSize.Height() = (long) (fH * aPageSize.Height()); + aSize.Width() = static_cast<long>(fH * aPageSize.Width()); + aSize.Height() = static_cast<long>(fH * aPageSize.Height()); aPos.X() += (aPartArea.Width() - aSize.Width()) / 2; aPos.Y() += (aPartArea.Height()- aSize.Height())/ 2; diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index cbd18580ac79..9679bfe8a669 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -275,7 +275,7 @@ void XMLShapeExport::collectShapeAutoStyles(const uno::Reference< drawing::XShap ImplXMLShapeExportInfoVector& aShapeInfoVector = (*maCurrentShapesIter).second; - if( (sal_Int32)aShapeInfoVector.size() <= nZIndex ) + if( static_cast<sal_Int32>(aShapeInfoVector.size()) <= nZIndex ) { OSL_FAIL( "XMLShapeExport::collectShapeAutoStyles(): no shape info allocated for a given shape" ); return; @@ -644,7 +644,7 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape ImplXMLShapeExportInfoVector& aShapeInfoVector = (*maCurrentShapesIter).second; - if( (sal_Int32)aShapeInfoVector.size() <= nZIndex ) + if( static_cast<sal_Int32>(aShapeInfoVector.size()) <= nZIndex ) { SAL_WARN( "xmloff", "XMLShapeExport::exportShape(): no shape info collected for a given shape" ); return; @@ -1022,7 +1022,7 @@ void XMLShapeExport::seekShapes( const uno::Reference< drawing::XShapes >& xShap if( maCurrentShapesIter == maShapesInfos.end() ) { ImplXMLShapeExportInfoVector aNewInfoVector; - aNewInfoVector.resize( (ShapesInfos::size_type) xShapes->getCount() ); + aNewInfoVector.resize( static_cast<ShapesInfos::size_type>(xShapes->getCount()) ); maShapesInfos[ xShapes ] = aNewInfoVector; maCurrentShapesIter = maShapesInfos.find( xShapes ); @@ -1030,7 +1030,7 @@ void XMLShapeExport::seekShapes( const uno::Reference< drawing::XShapes >& xShap SAL_WARN_IF( maCurrentShapesIter == maShapesInfos.end(), "xmloff", "XMLShapeExport::seekShapes(): insert into stl::map failed" ); } - SAL_WARN_IF( (*maCurrentShapesIter).second.size() != (ShapesInfos::size_type)xShapes->getCount(), "xmloff", "XMLShapeExport::seekShapes(): XShapes size varied between calls" ); + SAL_WARN_IF( (*maCurrentShapesIter).second.size() != static_cast<ShapesInfos::size_type>(xShapes->getCount()), "xmloff", "XMLShapeExport::seekShapes(): XShapes size varied between calls" ); } else @@ -3627,7 +3627,7 @@ void XMLShapeExport::export3DSceneAttributes( const css::uno::Reference< css::be aAny = xPropSet->getPropertyValue("D3DSceneShadowSlant"); sal_Int16 nShadowSlant = 0; aAny >>= nShadowSlant; - mrExport.AddAttribute(XML_NAMESPACE_DR3D, XML_SHADOW_SLANT, OUString::number((sal_Int32)nShadowSlant)); + mrExport.AddAttribute(XML_NAMESPACE_DR3D, XML_SHADOW_SLANT, OUString::number(static_cast<sal_Int32>(nShadowSlant))); // shadeMode aAny = xPropSet->getPropertyValue("D3DSceneShadeMode"); @@ -3825,7 +3825,7 @@ void ImpExportHandles( SvXMLExport& rExport, const uno::Sequence< beans::Propert { bool bPosition = false; const uno::Sequence< beans::PropertyValue >& rPropSeq = rHandles[ i ]; - for ( j = 0; j < (sal_uInt32)rPropSeq.getLength(); j++ ) + for ( j = 0; j < static_cast<sal_uInt32>(rPropSeq.getLength()); j++ ) { const beans::PropertyValue& rPropVal = rPropSeq[ j ]; switch( EASGet( rPropVal.Name ) ) @@ -3990,7 +3990,7 @@ void ImpExportEnhancedPath( SvXMLExport& rExport, break; case 1 : { - aSegment.Count = (sal_Int16)std::min( nCoords - 1, (sal_Int32)32767 ); + aSegment.Count = static_cast<sal_Int16>(std::min( nCoords - 1, sal_Int32(32767) )); aSegment.Command = css::drawing::EnhancedCustomShapeSegmentCommand::LINETO; } break; @@ -4687,9 +4687,9 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean css::uno::Sequence< css::drawing::EnhancedCustomShapeTextFrame > aPathTextFrames; if ( rProp.Value >>= aPathTextFrames ) { - if ( (sal_uInt16)aPathTextFrames.getLength() ) + if ( static_cast<sal_uInt16>(aPathTextFrames.getLength()) ) { - sal_uInt16 k, nElements = (sal_uInt16)aPathTextFrames.getLength(); + sal_uInt16 k, nElements = static_cast<sal_uInt16>(aPathTextFrames.getLength()); for ( k = 0; k < nElements; k++ ) { ExportParameter( aStrBuffer, aPathTextFrames[ k ].TopLeft.First ); diff --git a/xmloff/source/draw/ximp3dscene.cxx b/xmloff/source/draw/ximp3dscene.cxx index cd0a5e991c7f..ea4ed913fc25 100644 --- a/xmloff/source/draw/ximp3dscene.cxx +++ b/xmloff/source/draw/ximp3dscene.cxx @@ -351,7 +351,7 @@ void SdXML3DSceneAttributesHelper::setSceneAttributes( const css::uno::Reference // focalLength xPropSet->setPropertyValue("D3DSceneFocalLength", uno::Any(mnFocalLength)); // shadowSlant - xPropSet->setPropertyValue("D3DSceneShadowSlant", uno::Any((sal_Int16)mnShadowSlant)); + xPropSet->setPropertyValue("D3DSceneShadowSlant", uno::Any(static_cast<sal_Int16>(mnShadowSlant))); // shadeMode xPropSet->setPropertyValue("D3DSceneShadeMode", uno::Any(mxShadeMode)); // ambientColor diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx index 83f3e31e4b06..8fa9cc1915d9 100644 --- a/xmloff/source/draw/ximpcustomshape.cxx +++ b/xmloff/source/draw/ximpcustomshape.cxx @@ -1175,7 +1175,7 @@ void XMLEnhancedCustomShapeContext::EndElement() std::vector< OUString >::iterator aEquationNameEnd = maEquationNames.end(); while( aEquationNameIter != aEquationNameEnd ) { - (*pH)[ *aEquationNameIter ] = (sal_Int32)( aEquationNameIter - maEquationNames.begin() ); + (*pH)[ *aEquationNameIter ] = static_cast<sal_Int32>( aEquationNameIter - maEquationNames.begin() ); ++aEquationNameIter; } diff --git a/xmloff/source/draw/ximppage.cxx b/xmloff/source/draw/ximppage.cxx index ddf42faee6b8..0b670fb0e083 100644 --- a/xmloff/source/draw/ximppage.cxx +++ b/xmloff/source/draw/ximppage.cxx @@ -447,7 +447,7 @@ void SdXMLGenericPageContext::SetLayout() OUString aPropName("Layout"); Reference< beans::XPropertySetInfo > xInfo( xPropSet->getPropertySetInfo() ); if( xInfo.is() && xInfo->hasPropertyByName( aPropName ) ) - xPropSet->setPropertyValue(aPropName, uno::makeAny( (sal_Int16)nType ) ); + xPropSet->setPropertyValue(aPropName, uno::makeAny( static_cast<sal_Int16>(nType) ) ); } } } diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 2ae08aa8b340..03b9d351061f 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -1175,14 +1175,14 @@ void SdXMLEllipseShapeContext::processAttribute( sal_uInt16 nPrefix, const OUStr { double dStartAngle; if (::sax::Converter::convertDouble( dStartAngle, rValue )) - mnStartAngle = (sal_Int32)(dStartAngle * 100.0); + mnStartAngle = static_cast<sal_Int32>(dStartAngle * 100.0); return; } if( IsXMLToken( rLocalName, XML_END_ANGLE ) ) { double dEndAngle; if (::sax::Converter::convertDouble( dEndAngle, rValue )) - mnEndAngle = (sal_Int32)(dEndAngle * 100.0); + mnEndAngle = static_cast<sal_Int32>(dEndAngle * 100.0); return; } } diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx index cbb0ec85908a..fee2f44bd3fe 100644 --- a/xmloff/source/draw/ximpstyl.cxx +++ b/xmloff/source/draw/ximpstyl.cxx @@ -1397,7 +1397,7 @@ uno::Reference< container::XNameAccess > SdXMLStylesContext::getPageLayouts() co const SvXMLStyleContext* pStyle = GetStyle(a); if (const SdXMLPresentationPageLayoutContext* pContext = dynamic_cast<const SdXMLPresentationPageLayoutContext*>(pStyle)) { - xLayouts->insertByName(pStyle->GetName(), uno::makeAny((sal_Int32)pContext->GetTypeId())); + xLayouts->insertByName(pStyle->GetName(), uno::makeAny(static_cast<sal_Int32>(pContext->GetTypeId()))); } } diff --git a/xmloff/source/forms/controlpropertyhdl.cxx b/xmloff/source/forms/controlpropertyhdl.cxx index 1fe91cd88fd2..ba5a27f8661d 100644 --- a/xmloff/source/forms/controlpropertyhdl.cxx +++ b/xmloff/source/forms/controlpropertyhdl.cxx @@ -279,7 +279,7 @@ namespace xmloff bool const bSuccess = ::sax::Converter::convertMeasure( nWidth, _rStrImpValue, util::MeasureUnit::POINT); if (bSuccess) - _rValue <<= (sal_Int16)nWidth; + _rValue <<= static_cast<sal_Int16>(nWidth); return bSuccess; } @@ -311,7 +311,7 @@ namespace xmloff if (bSucces) { fValue *= 10; - _rValue <<= (float)fValue; + _rValue <<= static_cast<float>(fValue); } return bSucces; @@ -325,7 +325,7 @@ namespace xmloff if (bSuccess) { OUStringBuffer sValue; - ::sax::Converter::convertDouble(sValue, ((double)fAngle) / 10); + ::sax::Converter::convertDouble(sValue, static_cast<double>(fAngle) / 10); _rStrExpValue = sValue.makeStringAndClear(); } diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx index ba1eb56f5d79..ccc088d3f3a8 100644 --- a/xmloff/source/forms/elementexport.cxx +++ b/xmloff/source/forms/elementexport.cxx @@ -1300,7 +1300,7 @@ namespace xmloff sal_Int32 nItems = aItems.getLength(); sal_Int32 nValues = aValues.getLength(); - sal_Int16 nMaxLen = (sal_Int16)std::max(nItems, nValues); + sal_Int16 nMaxLen = static_cast<sal_Int16>(std::max(nItems, nValues)); for (sal_Int16 i=0; i<nMaxLen; ++i ) { diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx index 74775302105e..193e771bdc4b 100644 --- a/xmloff/source/forms/elementimport.cxx +++ b/xmloff/source/forms/elementimport.cxx @@ -1208,9 +1208,9 @@ namespace xmloff OSL_ENSURE(_rValue.getLength() == 1, "OPasswordImport::handleAttribute: invalid echo char attribute!"); // we ourself should not have written values other than of length 1 if (_rValue.getLength() >= 1) - aEchoChar.Value <<= (sal_Int16)_rValue[0]; + aEchoChar.Value <<= static_cast<sal_Int16>(_rValue[0]); else - aEchoChar.Value <<= (sal_Int16)0; + aEchoChar.Value <<= sal_Int16(0); implPushBackPropertyValue(aEchoChar); return true; } @@ -1243,7 +1243,7 @@ namespace xmloff // create and store a new PropertyValue PropertyValue aNewValue; aNewValue.Name = pProperty->sPropertyName; - aNewValue.Value <<= (sal_Int16)::cppu::any2bool(aBooleanValue); + aNewValue.Value <<= static_cast<sal_Int16>(::cppu::any2bool(aBooleanValue)); implPushBackPropertyValue(aNewValue); } @@ -1714,7 +1714,7 @@ namespace xmloff OSL_ENSURE((m_aListSource.size() + m_nEmptyListItems) == (m_aValueList.size() + m_nEmptyValueItems), "OListAndComboImport::implSelectCurrentItem: inconsistence between labels and values!"); - sal_Int16 nItemNumber = (sal_Int16)(m_aListSource.size() - 1 + m_nEmptyListItems); + sal_Int16 nItemNumber = static_cast<sal_Int16>(m_aListSource.size() - 1 + m_nEmptyListItems); m_aSelectedSeq.push_back(nItemNumber); } @@ -1723,7 +1723,7 @@ namespace xmloff OSL_ENSURE((m_aListSource.size() + m_nEmptyListItems) == (m_aValueList.size() + m_nEmptyValueItems), "OListAndComboImport::implDefaultSelectCurrentItem: inconsistence between labels and values!"); - sal_Int16 nItemNumber = (sal_Int16)(m_aListSource.size() - 1 + m_nEmptyListItems); + sal_Int16 nItemNumber = static_cast<sal_Int16>(m_aListSource.size() - 1 + m_nEmptyListItems); m_aDefaultSelectedSeq.push_back(nItemNumber); } diff --git a/xmloff/source/forms/formenums.cxx b/xmloff/source/forms/formenums.cxx index 86e23a4220ab..f8a1feb08201 100644 --- a/xmloff/source/forms/formenums.cxx +++ b/xmloff/source/forms/formenums.cxx @@ -106,9 +106,9 @@ const SvXMLEnumMapEntry<TriState> aCheckStateMap[] = }; const SvXMLEnumMapEntry<sal_Int16> aTextAlignMap[] = { - { XML_START, (sal_uInt16)awt::TextAlign::LEFT }, - { XML_CENTER, (sal_uInt16)awt::TextAlign::CENTER }, - { XML_END, (sal_uInt16)awt::TextAlign::RIGHT }, + { XML_START, sal_uInt16(awt::TextAlign::LEFT) }, + { XML_CENTER, sal_uInt16(awt::TextAlign::CENTER) }, + { XML_END, sal_uInt16(awt::TextAlign::RIGHT) }, { XML_JUSTIFY, -1 }, { XML_JUSTIFIED, -1 }, { XML_TOKEN_INVALID, 0 } diff --git a/xmloff/source/forms/layerexport.cxx b/xmloff/source/forms/layerexport.cxx index 455940c553aa..78c54829edd6 100644 --- a/xmloff/source/forms/layerexport.cxx +++ b/xmloff/source/forms/layerexport.cxx @@ -470,8 +470,8 @@ namespace xmloff { OUString sControlId = "control"; - size_t nKnownControlCount = ::std::accumulate( _rAllPagesControlIds.begin(), _rAllPagesControlIds.end(), (size_t)0, AccumulateSize() ); - sControlId += OUString::number( (sal_Int32)nKnownControlCount + 1 ); + size_t nKnownControlCount = ::std::accumulate( _rAllPagesControlIds.begin(), _rAllPagesControlIds.end(), size_t(0), AccumulateSize() ); + sControlId += OUString::number( static_cast<sal_Int32>(nKnownControlCount) + 1 ); #ifdef DBG_UTIL // Check if the id is already used. It shouldn't, as we currently have no mechanism for removing entries diff --git a/xmloff/source/forms/propertyexport.cxx b/xmloff/source/forms/propertyexport.cxx index 5bc13cded759..2f611bc61f8b 100644 --- a/xmloff/source/forms/propertyexport.cxx +++ b/xmloff/source/forms/propertyexport.cxx @@ -360,7 +360,7 @@ namespace xmloff // let the formatter of the export context build a string OUStringBuffer sBuffer; - SvXMLUnitConverter::convertEnum(sBuffer, (sal_uInt16)nCurrentValue, _pValueMap); + SvXMLUnitConverter::convertEnum(sBuffer, static_cast<sal_uInt16>(nCurrentValue), _pValueMap); AddAttribute(_nNamespaceKey, _pAttributeName, sBuffer.makeStringAndClear()); } diff --git a/xmloff/source/forms/propertyimport.cxx b/xmloff/source/forms/propertyimport.cxx index 9bced59ecdd0..0851edf31519 100644 --- a/xmloff/source/forms/propertyimport.cxx +++ b/xmloff/source/forms/propertyimport.cxx @@ -76,7 +76,7 @@ namespace css::util::Date lcl_getDate( double _nValue ) { - Date aToolsDate((sal_uInt32)_nValue); + Date aToolsDate(static_cast<sal_uInt32>(_nValue)); css::util::Date aDate; ::utl::typeConvert(aToolsDate, aDate); return aDate; @@ -114,7 +114,7 @@ Any PropertyConversion::convertString( const css::uno::Type& _rExpectedType, append(OUStringToOString(_rReadCharacters, RTL_TEXTENCODING_ASCII_US)). append("\" into an integer!").getStr()); if (TypeClass_SHORT == _rExpectedType.getTypeClass()) - aReturn <<= (sal_Int16)nValue; + aReturn <<= static_cast<sal_Int16>(nValue); else aReturn <<= nValue; break; @@ -129,11 +129,11 @@ Any PropertyConversion::convertString( const css::uno::Type& _rExpectedType, if (bEnumAsInt) if (TypeClass_SHORT == _rExpectedType.getTypeClass()) - aReturn <<= (sal_Int16)nEnumValue; + aReturn <<= static_cast<sal_Int16>(nEnumValue); else - aReturn <<= (sal_Int32)nEnumValue; + aReturn <<= static_cast<sal_Int32>(nEnumValue); else - aReturn = ::cppu::int2enum((sal_Int32)nEnumValue, _rExpectedType); + aReturn = ::cppu::int2enum(static_cast<sal_Int32>(nEnumValue), _rExpectedType); } break; case TypeClass_HYPER: @@ -182,14 +182,14 @@ Any PropertyConversion::convertString( const css::uno::Type& _rExpectedType, { case TYPE_DATE: { - OSL_ENSURE(((sal_uInt32)nValue) - nValue == 0, + OSL_ENSURE((static_cast<sal_uInt32>(nValue)) - nValue == 0, "PropertyConversion::convertString: a Date value with a fractional part?"); aReturn <<= lcl_getDate(nValue); } break; case TYPE_TIME: { - OSL_ENSURE(((sal_uInt32)nValue) == 0, + OSL_ENSURE((static_cast<sal_uInt32>(nValue)) == 0, "PropertyConversion::convertString: a tools::Time value with more than a fractional part?"); aReturn <<= lcl_getTime(nValue); } diff --git a/xmloff/source/meta/xmlmetae.cxx b/xmloff/source/meta/xmlmetae.cxx index 2528d717d424..821b41960962 100644 --- a/xmloff/source/meta/xmlmetae.cxx +++ b/xmloff/source/meta/xmlmetae.cxx @@ -54,7 +54,7 @@ SvXMLMetaExport::GetISODateTimeString( const util::DateTime& rDateTime ) // return ISO date string "YYYY-MM-DDThh:mm:ss" OUStringBuffer sTmp; - sTmp.append( (sal_Int32) rDateTime.Year ); + sTmp.append( static_cast<sal_Int32>(rDateTime.Year) ); sTmp.append( '-' ); lcl_AddTwoDigits( sTmp, rDateTime.Month ); sTmp.append( '-' ); diff --git a/xmloff/source/style/DashStyle.cxx b/xmloff/source/style/DashStyle.cxx index f68e535d7ebc..e9087b00b8b3 100644 --- a/xmloff/source/style/DashStyle.cxx +++ b/xmloff/source/style/DashStyle.cxx @@ -130,7 +130,7 @@ void XMLDashStyleImport::importXML( } break; case XML_TOK_DASH_DOTS1: - aLineDash.Dots = (sal_Int16)rStrValue.toInt32(); + aLineDash.Dots = static_cast<sal_Int16>(rStrValue.toInt32()); break; case XML_TOK_DASH_DOTS1LEN: @@ -149,7 +149,7 @@ void XMLDashStyleImport::importXML( break; case XML_TOK_DASH_DOTS2: - aLineDash.Dashes = (sal_Int16)rStrValue.toInt32(); + aLineDash.Dashes = static_cast<sal_Int16>(rStrValue.toInt32()); break; case XML_TOK_DASH_DOTS2LEN: diff --git a/xmloff/source/style/EnumPropertyHdl.cxx b/xmloff/source/style/EnumPropertyHdl.cxx index d4b1ee091c4b..5382b60cebf9 100644 --- a/xmloff/source/style/EnumPropertyHdl.cxx +++ b/xmloff/source/style/EnumPropertyHdl.cxx @@ -47,13 +47,13 @@ bool XMLEnumPropertyHdl::importXML( const OUString& rStrImpValue, Any& rValue, c rValue = ::cppu::int2enum( nValue, mrType ); break; case TypeClass_LONG: - rValue <<= (sal_Int32) nValue; + rValue <<= static_cast<sal_Int32>(nValue); break; case TypeClass_SHORT: - rValue <<= (sal_Int16) nValue; + rValue <<= static_cast<sal_Int16>(nValue); break; case TypeClass_BYTE: - rValue <<= (sal_Int8) nValue; + rValue <<= static_cast<sal_Int8>(nValue); break; default: assert(!"Wrong type for enum property handler!"); @@ -74,7 +74,7 @@ bool XMLEnumPropertyHdl::exportXML( OUString& rStrExpValue, const Any& rValue, c OUStringBuffer aOut; - if(!SvXMLUnitConverter::convertEnum( aOut, (sal_uInt16)nValue, mpEnumMap )) + if(!SvXMLUnitConverter::convertEnum( aOut, static_cast<sal_uInt16>(nValue), mpEnumMap )) return false; rStrExpValue = aOut.makeStringAndClear(); diff --git a/xmloff/source/style/MultiPropertySetHelper.cxx b/xmloff/source/style/MultiPropertySetHelper.cxx index 67111bd62e97..4c5367fb3d9f 100644 --- a/xmloff/source/style/MultiPropertySetHelper.cxx +++ b/xmloff/source/style/MultiPropertySetHelper.cxx @@ -117,7 +117,7 @@ void MultiPropertySetHelper::getValues( // re-alloc aValues (if necessary) and fill with values from XPropertySet sal_Int16 nSupportedPropertiesCount = - (sal_Int16)aPropertySequence.getLength(); + static_cast<sal_Int16>(aPropertySequence.getLength()); if ( aValues.getLength() != nSupportedPropertiesCount ) aValues.realloc( nSupportedPropertiesCount ); Any* pMutableArray = aValues.getArray(); diff --git a/xmloff/source/style/TransGradientStyle.cxx b/xmloff/source/style/TransGradientStyle.cxx index 6857950b253b..4162e036ac46 100644 --- a/xmloff/source/style/TransGradientStyle.cxx +++ b/xmloff/source/style/TransGradientStyle.cxx @@ -151,7 +151,7 @@ void XMLTransGradientStyleImport::importXML( ( (100 - aStartTransparency) * 255 ) / 100 ); Color aColor( n, n, n ); - aGradient.StartColor = (sal_Int32)( aColor.GetColor() ); + aGradient.StartColor = static_cast<sal_Int32>( aColor.GetColor() ); } break; case XML_TOK_GRADIENT_END: @@ -163,7 +163,7 @@ void XMLTransGradientStyleImport::importXML( ( (100 - aEndTransparency) * 255 ) / 100 ); Color aColor( n, n, n ); - aGradient.EndColor = (sal_Int32)( aColor.GetColor() ); + aGradient.EndColor = static_cast<sal_Int32>( aColor.GetColor() ); } break; case XML_TOK_GRADIENT_ANGLE: @@ -249,14 +249,14 @@ void XMLTransGradientStyleExport::exportXML( // Transparency start aColor.SetColor( aGradient.StartColor ); - sal_Int32 aStartValue = 100 - (sal_Int32)(((aColor.GetRed() + 1) * 100) / 255); + sal_Int32 aStartValue = 100 - static_cast<sal_Int32>(((aColor.GetRed() + 1) * 100) / 255); ::sax::Converter::convertPercent( aOut, aStartValue ); aStrValue = aOut.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_START, aStrValue ); // Transparency end aColor.SetColor( aGradient.EndColor ); - sal_Int32 aEndValue = 100 - (sal_Int32)(((aColor.GetRed() + 1) * 100) / 255); + sal_Int32 aEndValue = 100 - static_cast<sal_Int32>(((aColor.GetRed() + 1) * 100) / 255); ::sax::Converter::convertPercent( aOut, aEndValue ); aStrValue = aOut.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_END, aStrValue ); diff --git a/xmloff/source/style/XMLConstantsPropertyHandler.cxx b/xmloff/source/style/XMLConstantsPropertyHandler.cxx index 0e86ec7722c8..2fc464b5c064 100644 --- a/xmloff/source/style/XMLConstantsPropertyHandler.cxx +++ b/xmloff/source/style/XMLConstantsPropertyHandler.cxx @@ -41,7 +41,7 @@ bool XMLConstantsPropertyHandler::importXML( nEnum, rStrImpValue, pMap ); if( bRet ) - rValue <<= (sal_Int16)nEnum; + rValue <<= static_cast<sal_Int16>(nEnum); return bRet; } diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx b/xmloff/source/style/XMLFontAutoStylePool.cxx index cbf55e707bba..c33956a591b5 100644 --- a/xmloff/source/style/XMLFontAutoStylePool.cxx +++ b/xmloff/source/style/XMLFontAutoStylePool.cxx @@ -318,17 +318,17 @@ void XMLFontAutoStylePool::exportXML() XML_FONT_ADORNMENTS, rStyleName ); - aAny <<= (sal_Int16)pEntry->GetFamily(); + aAny <<= static_cast<sal_Int16>(pEntry->GetFamily()); if( aFamilyHdl.exportXML( sTmp, aAny, rUnitConv ) ) GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_FONT_FAMILY_GENERIC, sTmp ); - aAny <<= (sal_Int16)pEntry->GetPitch(); + aAny <<= static_cast<sal_Int16>(pEntry->GetPitch()); if( aPitchHdl.exportXML( sTmp, aAny, rUnitConv ) ) GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_FONT_PITCH, sTmp ); - aAny <<= (sal_Int16)pEntry->GetEncoding(); + aAny <<= static_cast<sal_Int16>(pEntry->GetEncoding()); if( aEncHdl.exportXML( sTmp, aAny, rUnitConv ) ) GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_FONT_CHARSET, sTmp ); diff --git a/xmloff/source/style/XMLFontStylesContext.cxx b/xmloff/source/style/XMLFontStylesContext.cxx index d2d08f0973b8..c3272dc720a3 100644 --- a/xmloff/source/style/XMLFontStylesContext.cxx +++ b/xmloff/source/style/XMLFontStylesContext.cxx @@ -89,9 +89,9 @@ XMLFontStyleContextFontFace::XMLFontStyleContextFontFace( SvXMLImport& rImport, { aFamilyName <<= OUString(); aStyleName <<= OUString(); - aFamily <<= (sal_Int16)awt::FontFamily::DONTKNOW; - aPitch <<= (sal_Int16)awt::FontPitch::DONTKNOW; - aEnc <<= (sal_Int16)rStyles.GetDfltCharset(); + aFamily <<= sal_Int16(awt::FontFamily::DONTKNOW); + aPitch <<= sal_Int16(awt::FontPitch::DONTKNOW); + aEnc <<= static_cast<sal_Int16>(rStyles.GetDfltCharset()); } void XMLFontStyleContextFontFace::SetAttribute( sal_uInt16 nPrefixKey, diff --git a/xmloff/source/style/XMLFootnoteSeparatorImport.cxx b/xmloff/source/style/XMLFootnoteSeparatorImport.cxx index c9a7bfb2dd07..f12db97c6c0f 100644 --- a/xmloff/source/style/XMLFootnoteSeparatorImport.cxx +++ b/xmloff/source/style/XMLFootnoteSeparatorImport.cxx @@ -99,7 +99,7 @@ void XMLFootnoteSeparatorImport::StartElement( if (GetImport().GetMM100UnitConverter().convertMeasureToCore( nTmp, sAttrValue)) { - nLineWeight = (sal_Int16)nTmp; + nLineWeight = static_cast<sal_Int16>(nTmp); } } else if (IsXMLToken( sLocalName, XML_DISTANCE_BEFORE_SEP )) @@ -130,7 +130,7 @@ void XMLFootnoteSeparatorImport::StartElement( else if (IsXMLToken( sLocalName, XML_REL_WIDTH )) { if (::sax::Converter::convertPercent(nTmp, sAttrValue)) - nLineRelWidth = (sal_uInt8)nTmp; + nLineRelWidth = static_cast<sal_uInt8>(nTmp); } else if (IsXMLToken( sLocalName, XML_COLOR )) { diff --git a/xmloff/source/style/bordrhdl.cxx b/xmloff/source/style/bordrhdl.cxx index 9311889f88ae..fdd9fba4c9bd 100644 --- a/xmloff/source/style/bordrhdl.cxx +++ b/xmloff/source/style/bordrhdl.cxx @@ -211,7 +211,7 @@ bool XMLBorderHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, co rUnitConverter.convertMeasureToCore( nTemp, aToken, 0, USHRT_MAX ) ) { - nWidth = (sal_uInt16)nTemp; + nWidth = static_cast<sal_uInt16>(nTemp); bHasWidth = true; } else diff --git a/xmloff/source/style/cdouthdl.cxx b/xmloff/source/style/cdouthdl.cxx index 68d14f42539f..9b441742ef5c 100644 --- a/xmloff/source/style/cdouthdl.cxx +++ b/xmloff/source/style/cdouthdl.cxx @@ -119,11 +119,11 @@ bool XMLCrossedOutTypePropHdl::importXML( const OUString& rStrImpValue, uno::Any break; } if( eNewStrikeout != eStrikeout ) - rValue <<= (sal_Int16)eNewStrikeout; + rValue <<= static_cast<sal_Int16>(eNewStrikeout); } else { - rValue <<= (sal_Int16)eNewStrikeout; + rValue <<= static_cast<sal_Int16>(eNewStrikeout); } } @@ -171,7 +171,7 @@ bool XMLCrossedOutStylePropHdl::importXML( const OUString& rStrImpValue, uno::An } else { - rValue <<= (sal_Int16)eNewStrikeout; + rValue <<= static_cast<sal_Int16>(eNewStrikeout); } } @@ -237,11 +237,11 @@ bool XMLCrossedOutWidthPropHdl::importXML( const OUString& rStrImpValue, uno::An break; } if( eNewStrikeout != eStrikeout ) - rValue <<= (sal_Int16)eNewStrikeout; + rValue <<= static_cast<sal_Int16>(eNewStrikeout); } else { - rValue <<= (sal_Int16)eNewStrikeout; + rValue <<= static_cast<sal_Int16>(eNewStrikeout); } } diff --git a/xmloff/source/style/chrhghdl.cxx b/xmloff/source/style/chrhghdl.cxx index 517d9eb33611..bb44b32f8817 100644 --- a/xmloff/source/style/chrhghdl.cxx +++ b/xmloff/source/style/chrhghdl.cxx @@ -49,7 +49,7 @@ bool XMLCharHeightHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue eSrcUnit, util::MeasureUnit::POINT)) { fSize = ::std::max<double>(fSize, 1.0); // fdo#49876: 0pt is invalid - rValue <<= (float)fSize; + rValue <<= static_cast<float>(fSize); return true; } } @@ -65,7 +65,7 @@ bool XMLCharHeightHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue if( rValue >>= fSize ) { fSize = ::std::max<float>(fSize, 1.0f); // fdo#49876: 0pt is invalid - ::sax::Converter::convertDouble(aOut, (double)fSize, true, + ::sax::Converter::convertDouble(aOut, static_cast<double>(fSize), true, util::MeasureUnit::POINT, util::MeasureUnit::POINT); aOut.append( 'p'); aOut.append( 't'); @@ -91,7 +91,7 @@ bool XMLCharHeightPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rV sal_Int32 nPrc = 100; if (::sax::Converter::convertPercent( nPrc, rStrImpValue )) { - rValue <<= (sal_Int16)nPrc; + rValue <<= static_cast<sal_Int16>(nPrc); return true; } } @@ -129,7 +129,7 @@ bool XMLCharHeightDiffHdl::importXML( const OUString& rStrImpValue, uno::Any& rV if (::sax::Converter::convertMeasure( nRel, rStrImpValue, util::MeasureUnit::POINT )) { - rValue <<= (float)nRel; + rValue <<= static_cast<float>(nRel); return true; } diff --git a/xmloff/source/style/csmaphdl.cxx b/xmloff/source/style/csmaphdl.cxx index f24b0806f0c5..d79b967f52d2 100644 --- a/xmloff/source/style/csmaphdl.cxx +++ b/xmloff/source/style/csmaphdl.cxx @@ -84,12 +84,12 @@ bool XMLCaseMapVariantHdl::importXML( const OUString& rStrImpValue, uno::Any& rV if( IsXMLToken( rStrImpValue, XML_CASEMAP_SMALL_CAPS ) ) { - rValue <<= (sal_Int16)style::CaseMap::SMALLCAPS; + rValue <<= sal_Int16(style::CaseMap::SMALLCAPS); bRet = true; } else if( IsXMLToken( rStrImpValue, XML_CASEMAP_NORMAL ) ) { - rValue <<= (sal_Int16)style::CaseMap::NONE; + rValue <<= sal_Int16(style::CaseMap::NONE); bRet = true; } diff --git a/xmloff/source/style/escphdl.cxx b/xmloff/source/style/escphdl.cxx index fdb414f51808..f97ca6ee1f2f 100644 --- a/xmloff/source/style/escphdl.cxx +++ b/xmloff/source/style/escphdl.cxx @@ -66,7 +66,7 @@ bool XMLEscapementPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rV if (!::sax::Converter::convertPercent( nNewEsc, aToken )) return false; - nVal = (sal_Int16) nNewEsc; + nVal = static_cast<sal_Int16>(nNewEsc); } rValue <<= nVal; @@ -124,7 +124,7 @@ bool XMLEscapementHeightPropHdl::importXML( const OUString& rStrImpValue, uno::A sal_Int32 nNewProp; if (!::sax::Converter::convertPercent( nNewProp, aToken )) return false; - nProp = (sal_Int8)nNewProp; + nProp = static_cast<sal_Int8>(nNewProp); } else { @@ -135,7 +135,7 @@ bool XMLEscapementHeightPropHdl::importXML( const OUString& rStrImpValue, uno::A nProp = 100; //if escapement position is zero and no escapement height is given the default height should be 100percent and not something smaller (#i91800#) } else - nProp = (sal_Int8) DFLT_ESC_PROP; + nProp = sal_Int8(DFLT_ESC_PROP); } rValue <<= nProp; diff --git a/xmloff/source/style/fonthdl.cxx b/xmloff/source/style/fonthdl.cxx index 9abd2ab5d95a..794972a2948d 100644 --- a/xmloff/source/style/fonthdl.cxx +++ b/xmloff/source/style/fonthdl.cxx @@ -196,7 +196,7 @@ bool XMLFontFamilyPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rV FontFamily eNewFamily; bool bRet = SvXMLUnitConverter::convertEnum( eNewFamily, rStrImpValue, lcl_getFontFamilyGenericMapping() ); if( bRet ) - rValue <<= (sal_Int16)eNewFamily; + rValue <<= static_cast<sal_Int16>(eNewFamily); return bRet; } @@ -229,7 +229,7 @@ XMLFontEncodingPropHdl::~XMLFontEncodingPropHdl() bool XMLFontEncodingPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& ) const { if( IsXMLToken( rStrImpValue, XML_X_SYMBOL ) ) - rValue <<= (sal_Int16) RTL_TEXTENCODING_SYMBOL; + rValue <<= sal_Int16(RTL_TEXTENCODING_SYMBOL); return true; } @@ -242,7 +242,7 @@ bool XMLFontEncodingPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& if( rValue >>= nSet ) { - if( (rtl_TextEncoding)nSet == RTL_TEXTENCODING_SYMBOL ) + if( static_cast<rtl_TextEncoding>(nSet) == RTL_TEXTENCODING_SYMBOL ) { aOut.append( GetXMLToken(XML_X_SYMBOL) ); rStrExpValue = aOut.makeStringAndClear(); @@ -265,7 +265,7 @@ bool XMLFontPitchPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rVa FontPitch eNewPitch; bool bRet = SvXMLUnitConverter::convertEnum( eNewPitch, rStrImpValue, aFontPitchMapping ); if( bRet ) - rValue <<= (sal_Int16)eNewPitch; + rValue <<= static_cast<sal_Int16>(eNewPitch); return bRet; } diff --git a/xmloff/source/style/impastpl.cxx b/xmloff/source/style/impastpl.cxx index 263388579b21..69ad5d3e05ce 100644 --- a/xmloff/source/style/impastpl.cxx +++ b/xmloff/source/style/impastpl.cxx @@ -282,11 +282,11 @@ bool XMLAutoStylePoolParent::Add( XMLAutoStyleFamily& rFamilyData, const vector< for (size_t n = m_PropertiesList.size(); i < n; ++i) { XMLAutoStylePoolProperties *const pIS = m_PropertiesList[i].get(); - if( nProperties > (sal_Int32)pIS->GetProperties().size() ) + if( nProperties > static_cast<sal_Int32>(pIS->GetProperties().size()) ) { continue; } - else if( nProperties < (sal_Int32)pIS->GetProperties().size() ) + else if( nProperties < static_cast<sal_Int32>(pIS->GetProperties().size()) ) { break; } @@ -325,11 +325,11 @@ bool XMLAutoStylePoolParent::AddNamed( XMLAutoStyleFamily& rFamilyData, const ve for (size_t n = m_PropertiesList.size(); i < n; ++i) { XMLAutoStylePoolProperties *const pIS = m_PropertiesList[i].get(); - if( nProperties > (sal_Int32)pIS->GetProperties().size() ) + if( nProperties > static_cast<sal_Int32>(pIS->GetProperties().size()) ) { continue; } - else if( nProperties < (sal_Int32)pIS->GetProperties().size() ) + else if( nProperties < static_cast<sal_Int32>(pIS->GetProperties().size()) ) { break; } diff --git a/xmloff/source/style/kernihdl.cxx b/xmloff/source/style/kernihdl.cxx index 06d5faeef081..de8de592fc83 100644 --- a/xmloff/source/style/kernihdl.cxx +++ b/xmloff/source/style/kernihdl.cxx @@ -47,7 +47,7 @@ bool XMLKerningPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, co bRet = rUnitConverter.convertMeasureToCore( nKerning, rStrImpValue ); } - rValue <<= (sal_Int16)nKerning; + rValue <<= static_cast<sal_Int16>(nKerning); return bRet; } diff --git a/xmloff/source/style/prhdlfac.cxx b/xmloff/source/style/prhdlfac.cxx index b11c1e9602bf..8fae927244e9 100644 --- a/xmloff/source/style/prhdlfac.cxx +++ b/xmloff/source/style/prhdlfac.cxx @@ -133,7 +133,7 @@ XMLPropertyHandlerFactory::~XMLPropertyHandlerFactory() // Interface const XMLPropertyHandler* XMLPropertyHandlerFactory::GetPropertyHandler( sal_Int32 nType ) const { - SAL_WARN_IF( (nType & ~((sal_uInt32)MID_FLAG_MASK)) != 0, "xmloff", + SAL_WARN_IF( (nType & ~(sal_uInt32(MID_FLAG_MASK))) != 0, "xmloff", "GetPropertyHandler called with flags in type" ); return GetBasicHandler( nType ); } diff --git a/xmloff/source/style/undlihdl.cxx b/xmloff/source/style/undlihdl.cxx index f72352e2d1c9..e360fd584d96 100644 --- a/xmloff/source/style/undlihdl.cxx +++ b/xmloff/source/style/undlihdl.cxx @@ -153,11 +153,11 @@ bool XMLUnderlineTypePropHdl::importXML( const OUString& rStrImpValue, uno::Any& break; } if( eNewUnderline != eUnderline ) - rValue <<= (sal_Int16)eNewUnderline; + rValue <<= static_cast<sal_Int16>(eNewUnderline); } else { - rValue <<= (sal_Int16)eNewUnderline; + rValue <<= static_cast<sal_Int16>(eNewUnderline); } } @@ -245,11 +245,11 @@ bool XMLUnderlineStylePropHdl::importXML( const OUString& rStrImpValue, uno::Any break; } if( eNewUnderline != eUnderline ) - rValue <<= (sal_Int16)eNewUnderline; + rValue <<= static_cast<sal_Int16>(eNewUnderline); } else { - rValue <<= (sal_Int16)eNewUnderline; + rValue <<= static_cast<sal_Int16>(eNewUnderline); } } @@ -336,11 +336,11 @@ bool XMLUnderlineWidthPropHdl::importXML( const OUString& rStrImpValue, uno::Any break; } if( eNewUnderline != eUnderline ) - rValue <<= (sal_Int16)eNewUnderline; + rValue <<= static_cast<sal_Int16>(eNewUnderline); } else { - rValue <<= (sal_Int16)eNewUnderline; + rValue <<= static_cast<sal_Int16>(eNewUnderline); } } diff --git a/xmloff/source/style/weighhdl.cxx b/xmloff/source/style/weighhdl.cxx index 465e93f3e49b..e6ea37a7e4ba 100644 --- a/xmloff/source/style/weighhdl.cxx +++ b/xmloff/source/style/weighhdl.cxx @@ -121,7 +121,7 @@ bool XMLFontWeightPropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, sal_Int32 nValue = 0; if( rValue >>= nValue ) { - fValue = (float)nValue; + fValue = static_cast<float>(nValue); bRet = true; } } diff --git a/xmloff/source/style/xmlbahdl.cxx b/xmloff/source/style/xmlbahdl.cxx index 82993b999451..5831514df60f 100644 --- a/xmloff/source/style/xmlbahdl.cxx +++ b/xmloff/source/style/xmlbahdl.cxx @@ -37,14 +37,14 @@ static void lcl_xmloff_setAny( Any& rValue, sal_Int32 nValue, sal_Int8 nBytes ) nValue = SCHAR_MIN; else if( nValue > SCHAR_MAX ) nValue = SCHAR_MAX; - rValue <<= (sal_Int8)nValue; + rValue <<= static_cast<sal_Int8>(nValue); break; case 2: if( nValue < SHRT_MIN ) nValue = SHRT_MIN; else if( nValue > SHRT_MAX ) nValue = SHRT_MAX; - rValue <<= (sal_Int16)nValue; + rValue <<= static_cast<sal_Int16>(nValue); break; case 4: rValue <<= nValue; @@ -335,7 +335,7 @@ bool XMLDoublePercentPropHdl::importXML( const OUString& rStrImpValue, Any& rVal { sal_Int32 nValue = 0; bRet = ::sax::Converter::convertPercent( nValue, rStrImpValue ); - fValue = ((double)nValue) / 100.0; + fValue = static_cast<double>(nValue) / 100.0; } rValue <<= fValue; @@ -352,7 +352,7 @@ bool XMLDoublePercentPropHdl::exportXML( OUString& rStrExpValue, const Any& rVal fValue *= 100.0; if( fValue > 0 ) fValue += 0.5; else fValue -= 0.5; - sal_Int32 nValue = (sal_Int32)fValue; + sal_Int32 nValue = static_cast<sal_Int32>(fValue); OUStringBuffer aOut; ::sax::Converter::convertPercent( aOut, nValue ); @@ -762,7 +762,7 @@ bool XMLIsAutoColorPropHdl::importXML( const OUString& rStrImpValue, Any& rValue bool bValue; bool const bRet = ::sax::Converter::convertBool( bValue, rStrImpValue ); if( bRet && bValue ) - rValue <<= (sal_Int32)-1; + rValue <<= sal_Int32(-1); return true; } diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx index a119edd360bb..15505f19f7b1 100644 --- a/xmloff/source/style/xmlexppr.cxx +++ b/xmloff/source/style/xmlexppr.cxx @@ -850,7 +850,7 @@ void SvXMLExportPropertyMapper::_exportXML( // we export it later if( pIndexArray ) { - pIndexArray->push_back( (sal_uInt16)nIndex ); + pIndexArray->push_back( static_cast<sal_uInt16>(nIndex) ); } } else diff --git a/xmloff/source/style/xmlnume.cxx b/xmloff/source/style/xmlnume.cxx index 2173faebc0e9..63e5b89ddebc 100644 --- a/xmloff/source/style/xmlnume.cxx +++ b/xmloff/source/style/xmlnume.cxx @@ -152,7 +152,7 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel, sBulletFontStyleName = rFDesc.StyleName; eBulletFontFamily = static_cast< FontFamily >( rFDesc.Family ); eBulletFontPitch = static_cast< FontPitch >( rFDesc.Pitch ); - eBulletFontEncoding = (rtl_TextEncoding)rFDesc.CharSet; + eBulletFontEncoding = static_cast<rtl_TextEncoding>(rFDesc.CharSet); } } else if( rProp.Name == "GraphicURL" ) @@ -337,13 +337,13 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel, if( nStartValue != 1 ) { - sTmp.append( (sal_Int32)nStartValue ); + sTmp.append( static_cast<sal_Int32>(nStartValue) ); GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE, sTmp.makeStringAndClear() ); } if( nDisplayLevels > 1 && NumberingType::NUMBER_NONE != eType ) { - sTmp.append( (sal_Int32)nDisplayLevels ); + sTmp.append( static_cast<sal_Int32>(nDisplayLevels) ); GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_DISPLAY_LEVELS, sTmp.makeStringAndClear() ); } @@ -556,18 +556,18 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel, sBulletFontStyleName ); XMLFontFamilyPropHdl aFamilyHdl; - if( aFamilyHdl.exportXML( sTemp, Any((sal_Int16)eBulletFontFamily), rUnitConv ) ) + if( aFamilyHdl.exportXML( sTemp, Any(static_cast<sal_Int16>(eBulletFontFamily)), rUnitConv ) ) GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_FONT_FAMILY_GENERIC, sTemp ); XMLFontPitchPropHdl aPitchHdl; - if( aPitchHdl.exportXML( sTemp, Any((sal_Int16)eBulletFontPitch), rUnitConv ) ) + if( aPitchHdl.exportXML( sTemp, Any(static_cast<sal_Int16>(eBulletFontPitch)), rUnitConv ) ) GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_FONT_PITCH, sTemp ); XMLFontEncodingPropHdl aEncHdl; - if( aEncHdl.exportXML( sTemp, Any((sal_Int16)eBulletFontEncoding), rUnitConv ) ) + if( aEncHdl.exportXML( sTemp, Any(static_cast<sal_Int16>(eBulletFontEncoding)), rUnitConv ) ) GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_FONT_CHARSET, sTemp ); } diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index 772e2b63dad8..1eedc4000bd3 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -1484,7 +1484,7 @@ SvXMLNumFormatContext::SvXMLNumFormatContext( SvXMLImport& rImport, { aFormatCode.append( "][$-" ); // language code in upper hex: - aFormatCode.append(OUString::number((sal_uInt16)eLang, 16).toAsciiUpperCase()); + aFormatCode.append(OUString::number(static_cast<sal_uInt16>(eLang), 16).toAsciiUpperCase()); } aFormatCode.append( ']' ); } @@ -1831,9 +1831,9 @@ void SvXMLNumFormatContext::AddNumber( const SvXMLNumberInfo& rInfo ) sal_uInt16 nPrec = 0; sal_uInt16 nLeading = 0; if ( rInfo.nDecimals >= 0 ) // < 0 : Default - nPrec = (sal_uInt16) rInfo.nDecimals; + nPrec = static_cast<sal_uInt16>(rInfo.nDecimals); if ( rInfo.nInteger >= 0 ) // < 0 : Default - nLeading = (sal_uInt16) rInfo.nInteger; + nLeading = static_cast<sal_uInt16>(rInfo.nInteger); if ( bAutoDec ) { @@ -1970,7 +1970,7 @@ void SvXMLNumFormatContext::AddNumber( const SvXMLNumberInfo& rInfo ) // test for 1.0 is just for optimization - nSepCount would be 0 // one separator for each factor of 1000 - sal_Int32 nSepCount = (sal_Int32) ::rtl::math::round( log10(rInfo.fDisplayFactor) / 3.0 ); + sal_Int32 nSepCount = static_cast<sal_Int32>(::rtl::math::round( log10(rInfo.fDisplayFactor) / 3.0 )); if ( nSepCount > 0 ) { OUString aSep = pData->GetLocaleData( nFormatLang ).getNumThousandSep(); diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx index aad99be527c1..2003144946b9 100644 --- a/xmloff/source/style/xmlnumi.cxx +++ b/xmloff/source/style/xmlnumi.cxx @@ -342,7 +342,7 @@ SvxXMLListLevelStyleContext_Impl::SvxXMLListLevelStyleContext_Impl( sal_Int32 nTmp = rValue.toInt32(); nNumStartValue = (nTmp < 0) ? 1 : ( (nTmp>SHRT_MAX) ? SHRT_MAX - : (sal_Int16)nTmp ); + : static_cast<sal_Int16>(nTmp) ); } break; case XML_TOK_TEXT_LEVEL_ATTR_DISPLAY_LEVELS: @@ -351,7 +351,7 @@ SvxXMLListLevelStyleContext_Impl::SvxXMLListLevelStyleContext_Impl( sal_Int32 nTmp = rValue.toInt32(); nNumDisplayLevels = (nTmp < 1) ? 1 : ( (nTmp>SHRT_MAX) ? SHRT_MAX - : (sal_Int16)nTmp ); + : static_cast<sal_Int16>(nTmp) ); } break; } @@ -470,7 +470,7 @@ Sequence<beans::PropertyValue> SvxXMLListLevelStyleContext_Impl::GetProperties() pProps[nPos++].Value <<= nFirstLineOffset; pProps[nPos].Name = "SymbolTextDistance"; - pProps[nPos++].Value <<= (sal_Int16)nMinLabelDist; + pProps[nPos++].Value <<= static_cast<sal_Int16>(nMinLabelDist); pProps[nPos].Name = "PositionAndSpaceMode"; pProps[nPos++].Value <<= ePosAndSpaceMode; @@ -740,12 +740,12 @@ SvxXMLListLevelStyleAttrContext_Impl::SvxXMLListLevelStyleAttrContext_Impl( case XML_TOK_STYLE_ATTRIBUTES_ATTR_WINDOW_FONT_COLOR: { if( IsXMLToken( rValue, XML_TRUE ) ) - rListLevel.SetColor( (sal_Int32)0xffffffff ); + rListLevel.SetColor( sal_Int32(0xffffffff) ); } break; case XML_TOK_STYLE_ATTRIBUTES_ATTR_FONT_SIZE: if (::sax::Converter::convertPercent( nVal, rValue )) - rListLevel.SetRelSize( (sal_Int16)nVal ); + rListLevel.SetRelSize( static_cast<sal_Int16>(nVal) ); break; case XML_TOK_STYLE_ATTRIBUTES_ATTR_POSITION_AND_SPACE_MODE: { @@ -1221,7 +1221,7 @@ void SvxXMLListStyleContext::SetDefaultStyle( beans::PropertyValue *pProps = aPropSeq.getArray(); pProps->Name = "NumberingType"; - (pProps++)->Value <<= (sal_Int16)(bOrdered ? NumberingType::ARABIC + (pProps++)->Value <<= static_cast<sal_Int16>(bOrdered ? NumberingType::ARABIC : NumberingType::CHAR_SPECIAL ); if( !bOrdered ) { @@ -1242,7 +1242,7 @@ void SvxXMLListStyleContext::SetDefaultStyle( (pProps++)->Value <<= aFDesc; OUStringBuffer sTmp(1); - sTmp.append( (sal_Unicode)(0xF000 + 149) ); + sTmp.append( sal_Unicode(0xF000 + 149) ); pProps->Name = "BulletChar"; (pProps++)->Value <<= sTmp.makeStringAndClear(); pProps->Name = "CharStyleName"; diff --git a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx index 5f220828632e..31412606573f 100644 --- a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx +++ b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx @@ -246,7 +246,7 @@ void XMLFootnoteConfigurationImportContext::StartElement( sal_Int32 nTmp; if (::sax::Converter::convertNumber(nTmp, sValue)) { - nOffset = (sal_uInt16)nTmp; + nOffset = static_cast<sal_uInt16>(nTmp); } break; } diff --git a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx index e1fff862f104..ef696c540a16 100644 --- a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx +++ b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx @@ -194,7 +194,7 @@ SvXMLImportContextRef XMLIndexBibliographyConfigurationContext::CreateChildConte PropertyValue aNameValue; aNameValue.Name = sSortKey; - aNameValue.Value <<= (sal_Int16)nKey; + aNameValue.Value <<= static_cast<sal_Int16>(nKey); aKey[0] = aNameValue; PropertyValue aSortValue; diff --git a/xmloff/source/text/XMLIndexTOCSourceContext.cxx b/xmloff/source/text/XMLIndexTOCSourceContext.cxx index 4bbff39e76d5..22ccb3487809 100644 --- a/xmloff/source/text/XMLIndexTOCSourceContext.cxx +++ b/xmloff/source/text/XMLIndexTOCSourceContext.cxx @@ -129,7 +129,7 @@ void XMLIndexTOCSourceContext::EndElement() rIndexPropertySet->setPropertyValue("CreateFromOutline", css::uno::Any(bUseOutline)); rIndexPropertySet->setPropertyValue("CreateFromLevelParagraphStyles", css::uno::Any(bUseParagraphStyles)); - rIndexPropertySet->setPropertyValue("Level", css::uno::Any((sal_Int16)nOutlineLevel)); + rIndexPropertySet->setPropertyValue("Level", css::uno::Any(static_cast<sal_Int16>(nOutlineLevel))); // process common attributes XMLIndexSourceBaseContext::EndElement(); diff --git a/xmloff/source/text/XMLLineNumberingImportContext.cxx b/xmloff/source/text/XMLLineNumberingImportContext.cxx index 82eef573c5ea..cfa2350c37d0 100644 --- a/xmloff/source/text/XMLLineNumberingImportContext.cxx +++ b/xmloff/source/text/XMLLineNumberingImportContext.cxx @@ -198,7 +198,7 @@ void XMLLineNumberingImportContext::ProcessAttribute( case XML_TOK_LINENUMBERING_INCREMENT: if (::sax::Converter::convertNumber(nTmp, sValue, 0)) { - nIncrement = (sal_Int16)nTmp; + nIncrement = static_cast<sal_Int16>(nTmp); } break; } diff --git a/xmloff/source/text/XMLLineNumberingSeparatorImportContext.cxx b/xmloff/source/text/XMLLineNumberingSeparatorImportContext.cxx index b86ae0cac3f2..2061ce2172cf 100644 --- a/xmloff/source/text/XMLLineNumberingSeparatorImportContext.cxx +++ b/xmloff/source/text/XMLLineNumberingSeparatorImportContext.cxx @@ -66,7 +66,7 @@ void XMLLineNumberingSeparatorImportContext::StartElement( if (::sax::Converter::convertNumber( nTmp, xAttrList->getValueByIndex(i), 0)) { - rLineNumberingContext.SetSeparatorIncrement((sal_Int16)nTmp); + rLineNumberingContext.SetSeparatorIncrement(static_cast<sal_Int16>(nTmp)); } // else: invalid number -> ignore } diff --git a/xmloff/source/text/XMLTextColumnsContext.cxx b/xmloff/source/text/XMLTextColumnsContext.cxx index 41becc04a2a1..e827b6858ae7 100644 --- a/xmloff/source/text/XMLTextColumnsContext.cxx +++ b/xmloff/source/text/XMLTextColumnsContext.cxx @@ -219,7 +219,7 @@ XMLTextColumnSepContext_Impl::XMLTextColumnSepContext_Impl( case XML_TOK_COLUMN_SEP_HEIGHT: if (::sax::Converter::convertPercent( nVal, rValue ) && nVal >=1 && nVal <= 100 ) - nHeight = (sal_Int8)nVal; + nHeight = static_cast<sal_Int8>(nVal); break; case XML_TOK_COLUMN_SEP_COLOR: ::sax::Converter::convertColor( nColor, rValue ); @@ -272,7 +272,7 @@ XMLTextColumnsContext::XMLTextColumnsContext( if( IsXMLToken( aLocalName, XML_COLUMN_COUNT ) && ::sax::Converter::convertNumber( nVal, rValue, 0, SHRT_MAX )) { - nCount = (sal_Int16)nVal; + nCount = static_cast<sal_Int16>(nVal); } else if( IsXMLToken( aLocalName, XML_COLUMN_GAP ) ) { @@ -339,7 +339,7 @@ void XMLTextColumnsContext::EndElement( ) xColumns->setColumnCount( 1 ); } else if( !bAutomatic && pColumns && - pColumns->size() == (sal_uInt16)nCount ) + pColumns->size() == static_cast<sal_uInt16>(nCount) ) { // if we have column descriptions, one per column, and we don't use // automatic width, then set the column widths @@ -351,7 +351,7 @@ void XMLTextColumnsContext::EndElement( ) for( i = 0; i < nCount; i++ ) { const TextColumn& rColumn = - (*pColumns)[(sal_uInt16)i]->getTextColumn(); + (*pColumns)[static_cast<sal_uInt16>(i)]->getTextColumn(); if( rColumn.Width > 0 ) { nRelWidth += rColumn.Width; @@ -367,7 +367,7 @@ void XMLTextColumnsContext::EndElement( ) for( i=0; i < nCount; i++ ) { TextColumn& rColumn = - (*pColumns)[(sal_uInt16)i]->getTextColumn(); + (*pColumns)[static_cast<sal_uInt16>(i)]->getTextColumn(); if( rColumn.Width == 0 ) { rColumn.Width = nColWidth; @@ -378,10 +378,10 @@ void XMLTextColumnsContext::EndElement( ) } } - Sequence< TextColumn > aColumns( (sal_Int32)nCount ); + Sequence< TextColumn > aColumns( static_cast<sal_Int32>(nCount) ); TextColumn *pTextColumns = aColumns.getArray(); for( i=0; i < nCount; i++ ) - *pTextColumns++ = (*pColumns)[(sal_uInt16)i]->getTextColumn(); + *pTextColumns++ = (*pColumns)[static_cast<sal_uInt16>(i)]->getTextColumn(); xColumns->setColumns( aColumns ); } diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index 5e112a860c3d..63ea2aa937f7 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -873,7 +873,7 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl( { sal_Int32 nTmp; if (::sax::Converter::convertNumber(nTmp, rValue, 1, SHRT_MAX)) - nPage = (sal_Int16)nTmp; + nPage = static_cast<sal_Int16>(nTmp); } break; case XML_TOK_TEXT_FRAME_X: @@ -890,7 +890,7 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl( { sal_Int32 nTmp; ::sax::Converter::convertPercent( nTmp, rValue ); - nRelWidth = (sal_Int16)nTmp; + nRelWidth = static_cast<sal_Int16>(nTmp); } else { @@ -907,7 +907,7 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl( { sal_Int32 nTmp; if (::sax::Converter::convertPercent( nTmp, rValue )) - nRelWidth = (sal_Int16)nTmp; + nRelWidth = static_cast<sal_Int16>(nTmp); } break; case XML_TOK_TEXT_FRAME_MIN_WIDTH: @@ -915,7 +915,7 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl( { sal_Int32 nTmp; ::sax::Converter::convertPercent( nTmp, rValue ); - nRelWidth = (sal_Int16)nTmp; + nRelWidth = static_cast<sal_Int16>(nTmp); } else { @@ -930,7 +930,7 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl( { sal_Int32 nTmp; ::sax::Converter::convertPercent( nTmp, rValue ); - nRelHeight = (sal_Int16)nTmp; + nRelHeight = static_cast<sal_Int16>(nTmp); } else { @@ -952,7 +952,7 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl( { sal_Int32 nTmp; if (::sax::Converter::convertPercent( nTmp, rValue )) - nRelHeight = (sal_Int16)nTmp; + nRelHeight = static_cast<sal_Int16>(nTmp); } break; case XML_TOK_TEXT_FRAME_MIN_HEIGHT: @@ -960,7 +960,7 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl( { sal_Int32 nTmp; ::sax::Converter::convertPercent( nTmp, rValue ); - nRelHeight = (sal_Int16)nTmp; + nRelHeight = static_cast<sal_Int16>(nTmp); } else { diff --git a/xmloff/source/text/XMLTextListAutoStylePool.cxx b/xmloff/source/text/XMLTextListAutoStylePool.cxx index a64489e778b1..eb666622480c 100644 --- a/xmloff/source/text/XMLTextListAutoStylePool.cxx +++ b/xmloff/source/text/XMLTextListAutoStylePool.cxx @@ -108,7 +108,7 @@ XMLTextListAutoStylePoolEntry_Impl::XMLTextListAutoStylePoolEntry_Impl( { rName++; sBuffer.append( rPrefix ); - sBuffer.append( (sal_Int32)rName ); + sBuffer.append( static_cast<sal_Int32>(rName) ); sName = sBuffer.makeStringAndClear(); } while (rNames.find(sName) != rNames.end()); @@ -189,7 +189,7 @@ sal_uInt32 XMLTextListAutoStylePool::Find( XMLTextListAutoStylePoolEntry_Impl* p return it - pPool->begin(); } - return (sal_uInt32)-1; + return sal_uInt32(-1); } OUString XMLTextListAutoStylePool::Add( @@ -199,7 +199,7 @@ OUString XMLTextListAutoStylePool::Add( XMLTextListAutoStylePoolEntry_Impl aTmp( rNumRules ); sal_uInt32 nPos = Find( &aTmp ); - if( nPos != (sal_uInt32)-1 ) + if( nPos != sal_uInt32(-1) ) { sName = (*pPool)[ nPos ]->GetName(); } @@ -223,7 +223,7 @@ OUString XMLTextListAutoStylePool::Find( XMLTextListAutoStylePoolEntry_Impl aTmp( rNumRules ); sal_uInt32 nPos = Find( &aTmp ); - if( nPos != (sal_uInt32)-1 ) + if( nPos != sal_uInt32(-1) ) sName = (*pPool)[ nPos ]->GetName(); return sName; @@ -235,7 +235,7 @@ OUString XMLTextListAutoStylePool::Find( OUString sName; XMLTextListAutoStylePoolEntry_Impl aTmp( rInternalName ); sal_uInt32 nPos = Find( &aTmp ); - if( nPos != (sal_uInt32)-1 ) + if( nPos != sal_uInt32(-1) ) sName = (*pPool)[ nPos ]->GetName(); return sName; diff --git a/xmloff/source/text/XMLTextListItemContext.cxx b/xmloff/source/text/XMLTextListItemContext.cxx index 429865da4887..66edfc6f7df8 100644 --- a/xmloff/source/text/XMLTextListItemContext.cxx +++ b/xmloff/source/text/XMLTextListItemContext.cxx @@ -64,7 +64,7 @@ XMLTextListItemContext::XMLTextListItemContext( { sal_Int32 nTmp = rValue.toInt32(); if( nTmp >= 0 && nTmp <= SHRT_MAX ) - nStartValue = (sal_Int16)nTmp; + nStartValue = static_cast<sal_Int16>(nTmp); } else if ( nPrefix == XML_NAMESPACE_TEXT && IsXMLToken( aLocalName, XML_STYLE_OVERRIDE ) ) diff --git a/xmloff/source/text/XMLTextShapeImportHelper.cxx b/xmloff/source/text/XMLTextShapeImportHelper.cxx index 20eba28436b8..0d42e9a3b183 100644 --- a/xmloff/source/text/XMLTextShapeImportHelper.cxx +++ b/xmloff/source/text/XMLTextShapeImportHelper.cxx @@ -109,7 +109,7 @@ void XMLTextShapeImportHelper::addShape( { sal_Int32 nTmp; if (::sax::Converter::convertNumber(nTmp, rValue, 1, SHRT_MAX)) - nPage = (sal_Int16)nTmp; + nPage = static_cast<sal_Int16>(nTmp); } break; case XML_TOK_TEXT_FRAME_Y: diff --git a/xmloff/source/text/txtdropi.cxx b/xmloff/source/text/txtdropi.cxx index 9101918e4519..25b247880b14 100644 --- a/xmloff/source/text/txtdropi.cxx +++ b/xmloff/source/text/txtdropi.cxx @@ -79,7 +79,7 @@ void XMLTextDropCapImportContext::ProcessAttrs( case XML_TOK_DROP_LINES: if (::sax::Converter::convertNumber( nTmp, rValue, 0, 255 )) { - aFormat.Lines = nTmp < 2 ? 0 : (sal_Int8)nTmp; + aFormat.Lines = nTmp < 2 ? 0 : static_cast<sal_Int8>(nTmp); } break; @@ -91,7 +91,7 @@ void XMLTextDropCapImportContext::ProcessAttrs( else if (::sax::Converter::convertNumber( nTmp, rValue, 1, 255 )) { bWholeWord = false; - aFormat.Count = (sal_Int8)nTmp; + aFormat.Count = static_cast<sal_Int8>(nTmp); } break; @@ -99,7 +99,7 @@ void XMLTextDropCapImportContext::ProcessAttrs( if (GetImport().GetMM100UnitConverter().convertMeasureToCore( nTmp, rValue, 0 )) { - aFormat.Distance = (sal_uInt16)nTmp; + aFormat.Distance = static_cast<sal_uInt16>(nTmp); } break; diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx index dae2d815c1c6..6fd0bc24af1e 100644 --- a/xmloff/source/text/txtexppr.cxx +++ b/xmloff/source/text/txtexppr.cxx @@ -224,7 +224,7 @@ void XMLTextExportPropertySetMapper::ContextFontFilter( if( pFontPitchState && (pFontPitchState->maValue >>= nTmp ) ) nPitch = static_cast< FontPitch >( nTmp ); if( pFontCharsetState && (pFontCharsetState->maValue >>= nTmp ) ) - eEnc = (rtl_TextEncoding)nTmp; + eEnc = static_cast<rtl_TextEncoding>(nTmp); //Resolves: fdo#67665 The purpose here appears to be to replace //FontFamilyName and FontStyleName etc with a single FontName property. The diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index 620c69a6cc75..235637437b58 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -2627,7 +2627,7 @@ void XMLTextFieldExport::ProcessDateTime(enum XMLTokenEnum eName, // handle bOmitDurationIfZero here, because we can precisely compare ints if (!(bIsDuration && (nMinutes==0))) { - ProcessDateTime(eName, (double)nMinutes / (double)(24*60), + ProcessDateTime(eName, static_cast<double>(nMinutes) / double(24*60), bIsDate, bIsDuration); } } @@ -3437,7 +3437,7 @@ OUString XMLTextFieldExport::MakeFootnoteRefName( // generate foot-/endnote ID OUStringBuffer aBuf; aBuf.append("ftn"); - aBuf.append((sal_Int32)nSeqNo); + aBuf.append(static_cast<sal_Int32>(nSeqNo)); return aBuf.makeStringAndClear(); } @@ -3449,7 +3449,7 @@ OUString XMLTextFieldExport::MakeSequenceRefName( OUStringBuffer aBuf; aBuf.append("ref"); aBuf.append(rSeqName); - aBuf.append((sal_Int32)nSeqNo); + aBuf.append(static_cast<sal_Int32>(nSeqNo)); return aBuf.makeStringAndClear(); } diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx index d100263d2fcf..9a0f33cafb96 100644 --- a/xmloff/source/text/txtfldi.cxx +++ b/xmloff/source/text/txtfldi.cxx @@ -819,7 +819,7 @@ void XMLPageNumberImportContext::ProcessAttribute( sal_Int32 nTmp; if (::sax::Converter::convertNumber(nTmp, sAttrValue)) { - nPageAdjust = (sal_Int16)nTmp; + nPageAdjust = static_cast<sal_Int16>(nTmp); } break; } @@ -1022,7 +1022,7 @@ void XMLTimeFieldImportContext::ProcessAttribute( if (::sax::Converter::convertDuration(fTmp, sAttrValue)) { // convert to minutes - nAdjust = (sal_Int32)::rtl::math::approxFloor(fTmp * 60 * 24); + nAdjust = static_cast<sal_Int32>(::rtl::math::approxFloor(fTmp * 60 * 24)); } break; } @@ -2182,7 +2182,7 @@ void XMLChapterImportContext::ProcessAttribute( if (SvXMLUnitConverter::convertEnum(nTmp, sAttrValue, aChapterDisplayMap)) { - nFormat = (sal_Int16)nTmp; + nFormat = static_cast<sal_Int16>(nTmp); } break; } @@ -2195,7 +2195,7 @@ void XMLChapterImportContext::ProcessAttribute( )) { // API numbers 0..9, we number 1..10 - nLevel = (sal_Int8)nTmp; + nLevel = static_cast<sal_Int8>(nTmp); nLevel--; } break; @@ -2393,7 +2393,7 @@ void XMLPageVarSetFieldImportContext::ProcessAttribute( sal_Int32 nTmp(0); if (::sax::Converter::convertNumber(nTmp, sAttrValue)) { - nAdjust = (sal_Int16)nTmp; + nAdjust = static_cast<sal_Int16>(nTmp); } break; } @@ -3087,7 +3087,7 @@ void XMLBibliographyFieldImportContext::StartElement( nTmp, xAttrList->getValueByIndex(i), aBibliographyDataTypeMap)) { - aAny <<= (sal_Int16)nTmp; + aAny <<= static_cast<sal_Int16>(nTmp); aValue.Value = aAny; aValues.push_back(aValue); diff --git a/xmloff/source/text/txtimppr.cxx b/xmloff/source/text/txtimppr.cxx index 2b528bc3b4e9..ee16204c39c2 100644 --- a/xmloff/source/text/txtimppr.cxx +++ b/xmloff/source/text/txtimppr.cxx @@ -210,7 +210,7 @@ void XMLTextImportPropertyMapper::FontDefaultsCheck( if( !pFontFamily ) { - aAny <<= (sal_Int16)css::awt::FontFamily::DONTKNOW; + aAny <<= sal_Int16(css::awt::FontFamily::DONTKNOW); #if OSL_DEBUG_LEVEL > 0 sal_Int16 nTmp = getPropertySetMapper()->GetEntryContextId( @@ -223,7 +223,7 @@ void XMLTextImportPropertyMapper::FontDefaultsCheck( if( !pFontPitch ) { - aAny <<= (sal_Int16)css::awt::FontPitch::DONTKNOW; + aAny <<= sal_Int16(css::awt::FontPitch::DONTKNOW); #if OSL_DEBUG_LEVEL > 0 sal_Int16 nTmp = getPropertySetMapper()->GetEntryContextId( pFontFamilyName->mnIndex + 3 ); @@ -235,7 +235,7 @@ void XMLTextImportPropertyMapper::FontDefaultsCheck( if( !pFontCharSet ) { - aAny <<= (sal_Int16)osl_getThreadTextEncoding(); + aAny <<= static_cast<sal_Int16>(osl_getThreadTextEncoding()); #if OSL_DEBUG_LEVEL > 0 sal_Int16 nTmp = getPropertySetMapper()->GetEntryContextId( pFontFamilyName->mnIndex + 4 ); @@ -809,7 +809,7 @@ void XMLTextImportPropertyMapper::finished( if( nSizeTypeIndex != -1 ) { XMLPropertyState aSizeTypeState( nSizeTypeIndex ); - aSizeTypeState.maValue <<= (sal_Int16)( bHasAnyMinHeight + aSizeTypeState.maValue <<= static_cast<sal_Int16>( bHasAnyMinHeight ? SizeType::MIN : SizeType::FIX); rProperties.push_back( aSizeTypeState ); @@ -837,7 +837,7 @@ void XMLTextImportPropertyMapper::finished( if( nWidthTypeIndex != -1 ) { XMLPropertyState aSizeTypeState( nWidthTypeIndex ); - aSizeTypeState.maValue <<= (sal_Int16)( bHasAnyMinWidth + aSizeTypeState.maValue <<= static_cast<sal_Int16>( bHasAnyMinWidth ? SizeType::MIN : SizeType::FIX); rProperties.push_back( aSizeTypeState ); diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 234fb48c2b2d..40e98eaab5d3 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -1007,7 +1007,7 @@ void XMLTextParagraphExport::exportListChange( if ( rNextInfo.HasStartValue() ) { OUStringBuffer aBuffer; - aBuffer.append( (sal_Int32)rNextInfo.GetStartValue() ); + aBuffer.append( static_cast<sal_Int32>(rNextInfo.GetStartValue()) ); GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE, aBuffer.makeStringAndClear() ); } @@ -1084,7 +1084,7 @@ void XMLTextParagraphExport::exportListChange( if( rNextInfo.HasStartValue() ) { OUStringBuffer aBuffer; - aBuffer.append( (sal_Int32)rNextInfo.GetStartValue() ); + aBuffer.append( static_cast<sal_Int32>(rNextInfo.GetStartValue()) ); GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE, aBuffer.makeStringAndClear() ); } @@ -1093,7 +1093,7 @@ void XMLTextParagraphExport::exportListChange( rNextInfo.GetLevel() == 1 ) { OUStringBuffer aBuffer; - aBuffer.append( (sal_Int32)rNextInfo.GetListLevelStartValue() ); + aBuffer.append( static_cast<sal_Int32>(rNextInfo.GetListLevelStartValue()) ); GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE, aBuffer.makeStringAndClear() ); } diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx index c4a1c05ace24..d57944f89b3c 100644 --- a/xmloff/source/text/txtparai.cxx +++ b/xmloff/source/text/txtparai.cxx @@ -122,7 +122,7 @@ XMLCharContext::XMLCharContext( if( nTmp > USHRT_MAX ) m_nCount = USHRT_MAX; else - m_nCount = (sal_uInt16)nTmp; + m_nCount = static_cast<sal_uInt16>(nTmp); } } } @@ -1286,7 +1286,7 @@ void XMLTOCMarkImportContext_Impl::ProcessAttribute( && nTmp < GetImport().GetTextImport()-> GetChapterNumbering()->getCount() ) { - rPropSet->setPropertyValue("Level", uno::makeAny((sal_Int16)(nTmp - 1))); + rPropSet->setPropertyValue("Level", uno::makeAny(static_cast<sal_Int16>(nTmp - 1))); } // else: value out of range -> ignore } @@ -1833,7 +1833,7 @@ XMLParaContext::XMLParaContext( { if( nTmp > 127 ) nTmp = 127; - nOutlineLevel = (sal_Int8)nTmp; + nOutlineLevel = static_cast<sal_Int8>(nTmp); } // Lost outline numbering in master document (#i73509#) mbOutlineLevelAttrFound = true; diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx index 416585d285f1..f87f0b130675 100644 --- a/xmloff/source/text/txtprhdl.cxx +++ b/xmloff/source/text/txtprhdl.cxx @@ -853,7 +853,7 @@ bool XMLTextEmphasizePropHdl_Impl::importXML( { if( FontEmphasis::NONE != nVal && bBelow ) nVal += 10; - rValue <<= (sal_Int16)nVal; + rValue <<= static_cast<sal_Int16>(nVal); } return bRet; @@ -955,7 +955,7 @@ bool XMLTextRelWidthHeightPropHdl_Impl::importXML( sal_Int32 nValue; bool const bRet = ::sax::Converter::convertPercent( nValue, rStrImpValue ); if( bRet ) - rValue <<= (sal_Int16)nValue; + rValue <<= static_cast<sal_Int16>(nValue); return bRet; } diff --git a/xmloff/source/text/txtvfldi.cxx b/xmloff/source/text/txtvfldi.cxx index eb51be949c48..b47bb9b59654 100644 --- a/xmloff/source/text/txtvfldi.cxx +++ b/xmloff/source/text/txtvfldi.cxx @@ -752,7 +752,7 @@ XMLVariableDeclImportContext::XMLVariableDeclImportContext( } case XML_TOK_TEXTFIELD_NUMBERING_SEPARATOR: cSeparationChar = - (sal_Char)xAttrList->getValueByIndex(i).toChar(); + static_cast<sal_Char>(xAttrList->getValueByIndex(i).toChar()); break; default: diff --git a/xmloff/source/transform/OOo2Oasis.cxx b/xmloff/source/transform/OOo2Oasis.cxx index 7548ccbe5974..45b9279bb66c 100644 --- a/xmloff/source/transform/OOo2Oasis.cxx +++ b/xmloff/source/transform/OOo2Oasis.cxx @@ -1946,7 +1946,7 @@ sal_Int64 SAL_CALL OOo2OasisTransformer::getSomething( const Sequence< sal_Int8 } else { - return (sal_Int64)0; + return sal_Int64(0); } } diff --git a/xmloff/source/transform/Oasis2OOo.cxx b/xmloff/source/transform/Oasis2OOo.cxx index 5a981090c6ff..27aa5aebbb1c 100644 --- a/xmloff/source/transform/Oasis2OOo.cxx +++ b/xmloff/source/transform/Oasis2OOo.cxx @@ -1933,7 +1933,7 @@ sal_Int64 SAL_CALL Oasis2OOoTransformer::getSomething( const Sequence< sal_Int8 } else { - return (sal_Int64)0; + return sal_Int64(0); } } diff --git a/xmloff/source/transform/StyleOASISTContext.cxx b/xmloff/source/transform/StyleOASISTContext.cxx index 151e5367be0a..3546f0bc7377 100644 --- a/xmloff/source/transform/StyleOASISTContext.cxx +++ b/xmloff/source/transform/StyleOASISTContext.cxx @@ -507,7 +507,7 @@ void XMLPropertiesTContext_Impl::StartElement( { sal_Int32 nValue; ::sax::Converter::convertPercent( nValue, rAttrValue ); - const double fValue = ((double)nValue) / 100.0; + const double fValue = static_cast<double>(nValue) / 100.0; pAttrList->AddAttribute( rAttrName, OUString::number( fValue ) ); } break; diff --git a/xmloff/source/transform/StyleOOoTContext.cxx b/xmloff/source/transform/StyleOOoTContext.cxx index 29512be6af94..738f1e7622d7 100644 --- a/xmloff/source/transform/StyleOOoTContext.cxx +++ b/xmloff/source/transform/StyleOOoTContext.cxx @@ -900,7 +900,7 @@ void XMLPropertiesOOoTContext_Impl::StartElement( case XML_ATACTION_GAMMA_OOO: // converts double value to percentage { double fValue = sAttrValue.toDouble(); - sal_Int32 nValue = (sal_Int32)((fValue * 100.0) + ( fValue > 0 ? 0.5 : - 0.5 ) ); + sal_Int32 nValue = static_cast<sal_Int32>((fValue * 100.0) + ( fValue > 0 ? 0.5 : - 0.5 ) ); OUStringBuffer aOut; ::sax::Converter::convertPercent( aOut, nValue ); diff --git a/xmloff/source/transform/TransformerBase.cxx b/xmloff/source/transform/TransformerBase.cxx index 3dafadeb6937..34864459a114 100644 --- a/xmloff/source/transform/TransformerBase.cxx +++ b/xmloff/source/transform/TransformerBase.cxx @@ -567,7 +567,7 @@ XMLMutableAttributeList *XMLTransformerBase::ProcessAttrList( { // #i13778#,#i36248# apply correct twip-to-1/100mm - nMeasure = (sal_Int32)( nMeasure >= 0 + nMeasure = static_cast<sal_Int32>( nMeasure >= 0 ? ((nMeasure*127+36)/72) : ((nMeasure*127-36)/72) ); @@ -735,7 +735,7 @@ XMLMutableAttributeList *XMLTransformerBase::ProcessAttrList( { // #i13778#,#i36248#/ apply correct 1/100mm-to-twip conversion - nMeasure = (sal_Int32)( nMeasure >= 0 + nMeasure = static_cast<sal_Int32>( nMeasure >= 0 ? ((nMeasure*72+63)/127) : ((nMeasure*72-63)/127) ); @@ -816,7 +816,7 @@ XMLMutableAttributeList *XMLTransformerBase::ProcessAttrList( if( (c >= '0') && (c <= '9') ) aBuffer.append( c ); else - aBuffer.append( (sal_Int32)c ); + aBuffer.append( static_cast<sal_Int32>(c) ); } pMutableAttrList->SetValueByIndex( i, aBuffer.makeStringAndClear() ); |