diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:19:10 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:19:10 +0100 |
commit | 99e118af6a7e296b3d6dcb812237f27a344c601a (patch) | |
tree | 0d063d0691f462d7eb32d74a30b09f7821a09108 /oox | |
parent | d1a510c9bde5eb9ca8ec1aa3e81782b0615fc95b (diff) |
More loplugin:cstylecast: oox
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: I8fd61e3220a4b9e08d4f97acde28600f31d448ca
Diffstat (limited to 'oox')
-rw-r--r-- | oox/qa/unit/vba_compression.cxx | 14 | ||||
-rw-r--r-- | oox/qa/unit/vba_encryption.cxx | 2 | ||||
-rw-r--r-- | oox/source/docprop/docprophandler.cxx | 14 | ||||
-rw-r--r-- | oox/source/drawingml/chart/typegroupconverter.cxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/diagram/diagramlayoutatoms.cxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/diagram/layoutatomvisitors.cxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/fillproperties.cxx | 4 | ||||
-rw-r--r-- | oox/source/drawingml/shape.cxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/textbodypropertiescontext.cxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/textcharacterproperties.cxx | 2 | ||||
-rw-r--r-- | oox/source/export/chartexport.cxx | 4 | ||||
-rw-r--r-- | oox/source/export/drawingml.cxx | 18 | ||||
-rw-r--r-- | oox/source/export/shapes.cxx | 2 | ||||
-rw-r--r-- | oox/source/export/vmlexport.cxx | 2 | ||||
-rw-r--r-- | oox/source/helper/propertymap.cxx | 2 | ||||
-rw-r--r-- | oox/source/ole/axcontrol.cxx | 2 | ||||
-rw-r--r-- | oox/source/ole/vbaexport.cxx | 4 | ||||
-rw-r--r-- | oox/source/ppt/comments.cxx | 2 | ||||
-rw-r--r-- | oox/source/ppt/commontimenodecontext.cxx | 2 | ||||
-rw-r--r-- | oox/source/ppt/timenodelistcontext.cxx | 6 |
20 files changed, 45 insertions, 45 deletions
diff --git a/oox/qa/unit/vba_compression.cxx b/oox/qa/unit/vba_compression.cxx index 2c083e8a8c95..420d43d63318 100644 --- a/oox/qa/unit/vba_compression.cxx +++ b/oox/qa/unit/vba_compression.cxx @@ -113,7 +113,7 @@ void TestVbaCompression::testSimple1() aOutputMemoryStream.GetSize()); for (sal_uInt64 i = 0; i < nSize; ++i) { - CPPUNIT_ASSERT_EQUAL((int)pReferenceData[i], (int)pData[i]); + CPPUNIT_ASSERT_EQUAL(static_cast<int>(pReferenceData[i]), static_cast<int>(pData[i])); } } @@ -135,7 +135,7 @@ void TestVbaCompression::testSimple2() aOutputMemoryStream.GetSize()); for (sal_uInt64 i = 0; i < nSize; ++i) { - CPPUNIT_ASSERT_EQUAL((int)pReferenceData[i], (int)pData[i]); + CPPUNIT_ASSERT_EQUAL(static_cast<int>(pReferenceData[i]), static_cast<int>(pData[i])); } } @@ -157,7 +157,7 @@ void TestVbaCompression::testSimple3() aOutputMemoryStream.GetSize()); for (sal_uInt64 i = 0; i < nSize; ++i) { - CPPUNIT_ASSERT_EQUAL((int)pReferenceData[i], (int)pData[i]); + CPPUNIT_ASSERT_EQUAL(static_cast<int>(pReferenceData[i]), static_cast<int>(pData[i])); } } @@ -179,7 +179,7 @@ void TestVbaCompression::testComplex1() aOutputMemoryStream.GetSize()); for (sal_uInt64 i = 0; i < nSize; ++i) { - CPPUNIT_ASSERT_EQUAL((int)pReferenceData[i], (int)pData[i]); + CPPUNIT_ASSERT_EQUAL(static_cast<int>(pReferenceData[i]), static_cast<int>(pData[i])); } } @@ -201,7 +201,7 @@ void TestVbaCompression::testSpec321() aOutputMemoryStream.GetSize()); for (sal_uInt64 i = 0; i < nSize; ++i) { - CPPUNIT_ASSERT_EQUAL((int)pReferenceData[i], (int)pData[i]); + CPPUNIT_ASSERT_EQUAL(static_cast<int>(pReferenceData[i]), static_cast<int>(pData[i])); } } @@ -223,7 +223,7 @@ void TestVbaCompression::testSpec322() aOutputMemoryStream.GetSize()); for (sal_uInt64 i = 0; i < nSize; ++i) { - CPPUNIT_ASSERT_EQUAL((int)pReferenceData[i], (int)pData[i]); + CPPUNIT_ASSERT_EQUAL(static_cast<int>(pReferenceData[i]), static_cast<int>(pData[i])); } } @@ -245,7 +245,7 @@ void TestVbaCompression::testSpec323() aOutputMemoryStream.GetSize()); for (sal_uInt64 i = 0; i < nSize; ++i) { - CPPUNIT_ASSERT_EQUAL((int)pReferenceData[i], (int)pData[i]); + CPPUNIT_ASSERT_EQUAL(static_cast<int>(pReferenceData[i]), static_cast<int>(pData[i])); } } diff --git a/oox/qa/unit/vba_encryption.cxx b/oox/qa/unit/vba_encryption.cxx index 60164cb4bc32..7e8a44cd9c20 100644 --- a/oox/qa/unit/vba_encryption.cxx +++ b/oox/qa/unit/vba_encryption.cxx @@ -75,7 +75,7 @@ void TestVbaEncryption::testProjKey1() { OUString const aProjectID("{917DED54-440B-4FD1-A5C1-74ACF261E600}"); sal_uInt8 nProjKey = VBAEncryption::calculateProjKey(aProjectID); - CPPUNIT_ASSERT_EQUAL((int)0xdf, (int)nProjKey); + CPPUNIT_ASSERT_EQUAL(int(0xdf), static_cast<int>(nProjKey)); } CPPUNIT_TEST_SUITE_REGISTRATION(TestVbaEncryption); diff --git a/oox/source/docprop/docprophandler.cxx b/oox/source/docprop/docprophandler.cxx index 9671ab26d2ca..206455c66307 100644 --- a/oox/source/docprop/docprophandler.cxx +++ b/oox/source/docprop/docprophandler.cxx @@ -98,25 +98,25 @@ util::DateTime OOXMLDocPropHandler::GetDateTimeFromW3CDTF( const OUString& aChar const sal_Int32 nLen = aChars.getLength(); if ( nLen >= 4 ) { - aOslDTime.Year = (sal_Int16)aChars.copy( 0, 4 ).toInt32(); + aOslDTime.Year = static_cast<sal_Int16>(aChars.copy( 0, 4 ).toInt32()); if ( nLen >= 7 && aChars[4] == '-' ) { - aOslDTime.Month = (sal_uInt16)aChars.copy( 5, 2 ).toInt32(); + aOslDTime.Month = static_cast<sal_uInt16>(aChars.copy( 5, 2 ).toInt32()); if ( nLen >= 10 && aChars[7] == '-' ) { - aOslDTime.Day = (sal_uInt16)aChars.copy( 8, 2 ).toInt32(); + aOslDTime.Day = static_cast<sal_uInt16>(aChars.copy( 8, 2 ).toInt32()); if ( nLen >= 16 && aChars[10] == 'T' && aChars[13] == ':' ) { - aOslDTime.Hours = (sal_uInt16)aChars.copy( 11, 2 ).toInt32(); - aOslDTime.Minutes = (sal_uInt16)aChars.copy( 14, 2 ).toInt32(); + aOslDTime.Hours = static_cast<sal_uInt16>(aChars.copy( 11, 2 ).toInt32()); + aOslDTime.Minutes = static_cast<sal_uInt16>(aChars.copy( 14, 2 ).toInt32()); sal_Int32 nOptTime = 0; if ( nLen >= 19 && aChars[16] == ':' ) { - aOslDTime.Seconds = (sal_uInt16)aChars.copy( 17, 2 ).toInt32(); + aOslDTime.Seconds = static_cast<sal_uInt16>(aChars.copy( 17, 2 ).toInt32()); nOptTime += 3; if ( nLen >= 20 && aChars[19] == '.' ) { @@ -634,7 +634,7 @@ void SAL_CALL OOXMLDocPropHandler::characters( const OUString& aChars ) case VT_TOKEN( i1 ): case VT_TOKEN( i2 ): - AddCustomProperty( uno::makeAny( (sal_Int16)aChars.toInt32() ) ); + AddCustomProperty( uno::makeAny( static_cast<sal_Int16>(aChars.toInt32()) ) ); break; case VT_TOKEN( i4 ): diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx index c3809a5146c6..fc14b34d0753 100644 --- a/oox/source/drawingml/chart/typegroupconverter.cxx +++ b/oox/source/drawingml/chart/typegroupconverter.cxx @@ -144,7 +144,7 @@ TypeGroupConverter::TypeGroupConverter( const ConverterRoot& rParent, TypeGroupM TypeId eTypeId = TYPEID_UNKNOWN; switch( mrModel.mnTypeId ) { -#define ENSURE_AXESCOUNT( min, max ) OSL_ENSURE( (min <= (int)mrModel.maAxisIds.size()) && ((int)mrModel.maAxisIds.size() <= max), "TypeGroupConverter::TypeGroupConverter - invalid axes count" ) +#define ENSURE_AXESCOUNT( min, max ) OSL_ENSURE( (min <= static_cast<int>(mrModel.maAxisIds.size())) && (static_cast<int>(mrModel.maAxisIds.size()) <= max), "TypeGroupConverter::TypeGroupConverter - invalid axes count" ) case C_TOKEN( area3DChart ): ENSURE_AXESCOUNT( 2, 3 ); eTypeId = TYPEID_AREA; mb3dChart = true; break; case C_TOKEN( areaChart ): ENSURE_AXESCOUNT( 2, 2 ); eTypeId = TYPEID_AREA; mb3dChart = false; break; case C_TOKEN( bar3DChart ): ENSURE_AXESCOUNT( 2, 3 ); eTypeId = TYPEID_BAR; mb3dChart = true; break; diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx index 1ac76751788d..3c8993bd687d 100644 --- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx +++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx @@ -319,7 +319,7 @@ void AlgAtom::layoutShape( const ShapePtr& rShape, sal_Int32 idx = 0; for (auto & aCurrShape : rShape->getChildren()) { - const double fAngle = (double)idx*nSpanAngle/nShapes + nStartAngle; + const double fAngle = static_cast<double>(idx)*nSpanAngle/nShapes + nStartAngle; const awt::Point aCurrPos( aCenter.Width + nRadius*sin(fAngle*F_PI180) - aChildSize.Width/2, aCenter.Height - nRadius*cos(fAngle*F_PI180) - aChildSize.Height/2); diff --git a/oox/source/drawingml/diagram/layoutatomvisitors.cxx b/oox/source/drawingml/diagram/layoutatomvisitors.cxx index a454d04b53ff..7e951bc20eba 100644 --- a/oox/source/drawingml/diagram/layoutatomvisitors.cxx +++ b/oox/source/drawingml/diagram/layoutatomvisitors.cxx @@ -92,7 +92,7 @@ void ShapeCreationVisitor::visit(LayoutNode& rAtom) // stop processing if it's not a child of previous LayoutNode const DiagramData::PointsNameMap::const_iterator aDataNode = mrDgm.getData()->getPointsPresNameMap().find(rAtom.getName()); - if (aDataNode == mrDgm.getData()->getPointsPresNameMap().end() || mnCurrIdx >= (sal_Int32)aDataNode->second.size()) + if (aDataNode == mrDgm.getData()->getPointsPresNameMap().end() || mnCurrIdx >= static_cast<sal_Int32>(aDataNode->second.size())) return; const dgm::Point* pNewNode = aDataNode->second.at(mnCurrIdx); diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index 50e042d8623b..3d81ec94c71c 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -586,8 +586,8 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap, { awt::Gradient aGrad(aGradient); uno::Any aVal; - aGrad.EndColor = (sal_Int32)( nEndTrans | nEndTrans << 8 | nEndTrans << 16 ); - aGrad.StartColor = (sal_Int32)( nStartTrans | nStartTrans << 8 | nStartTrans << 16 ); + aGrad.EndColor = static_cast<sal_Int32>( nEndTrans | nEndTrans << 8 | nEndTrans << 16 ); + aGrad.StartColor = static_cast<sal_Int32>( nStartTrans | nStartTrans << 8 | nStartTrans << 16 ); aVal <<= aGrad; rPropMap.setProperty( ShapeProperty::GradientTransparency, aGrad ); } diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 82498730ccde..c1944ee7743a 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -525,7 +525,7 @@ Reference< XShape > const & Shape::createAndInsert( } } // rotate around object's center - aTransformation.rotate( F_PI180 * ( (double)mnRotation / 60000.0 ) ); + aTransformation.rotate( F_PI180 * ( static_cast<double>(mnRotation) / 60000.0 ) ); } // move object back from center diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx index 13c50aa1b07a..944ada853ef1 100644 --- a/oox/source/drawingml/textbodypropertiescontext.cxx +++ b/oox/source/drawingml/textbodypropertiescontext.cxx @@ -52,7 +52,7 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler2Helper cons // ST_Coordinate OUString sValue; sal_Int32 aIns[] = { XML_lIns, XML_tIns, XML_rIns, XML_bIns }; - for( sal_Int32 i = 0; i < ( sal_Int32 ) SAL_N_ELEMENTS( aIns ); i++) + for( sal_Int32 i = 0; i < sal_Int32(SAL_N_ELEMENTS( aIns )); i++) { sValue = rAttribs.getString( aIns[i] ).get(); if( !sValue.isEmpty() ) diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx index b389d74c225f..b98757ce35b9 100644 --- a/oox/source/drawingml/textcharacterproperties.cxx +++ b/oox/source/drawingml/textcharacterproperties.cxx @@ -122,7 +122,7 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil rPropMap.setProperty( PROP_CharHeightComplex, fHeight); } - rPropMap.setProperty( PROP_CharKerning, (sal_Int16) GetTextSpacingPoint( moSpacing.get( 0 ) )); + rPropMap.setProperty( PROP_CharKerning, static_cast<sal_Int16>(GetTextSpacingPoint( moSpacing.get( 0 ) ))); rPropMap.setProperty( PROP_CharUnderline, GetFontUnderline( moUnderline.get( XML_none ) )); rPropMap.setProperty( PROP_CharStrikeout, GetFontStrikeout( moStrikeout.get( XML_noStrike ) )); diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index ee86421567a7..3e9376f05662 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -991,8 +991,8 @@ void ChartExport::exportTitle( const Reference< XShape >& xShape ) // awt::Size aSize = xShape->getSize(); awt::Point aPos2 = xShape->getPosition(); - double x = (double)aPos2.X / (double) aPageSize.Width; - double y = (double)aPos2.Y / (double) aPageSize.Height; + double x = static_cast<double>(aPos2.X) / static_cast<double>(aPageSize.Width); + double y = static_cast<double>(aPos2.Y) / static_cast<double>(aPageSize.Height); /* pFS->singleElement(FSNS(XML_c, XML_wMode), XML_val, "edge", diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 34dabd7802c9..3b5b4e699a5e 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -935,7 +935,7 @@ OUString DrawingML::WriteImage( const Graphic& rGraphic , bool bRelPathToMedia ) Reference< XOutputStream > xOutStream = mpFB->openFragmentStream( OUStringBuffer() .appendAscii( GetComponentDir() ) .append( "/media/image" ) - .append( (sal_Int32) mnImageCounter ) + .append( static_cast<sal_Int32>(mnImageCounter) ) .appendAscii( pExtension ) .makeStringAndClear(), sMediaType ); @@ -950,7 +950,7 @@ OUString DrawingML::WriteImage( const Graphic& rGraphic , bool bRelPathToMedia ) OUStringBuffer() .appendAscii( GetRelationCompPrefix() ) .appendAscii( sRelPathToMedia.getStr() ) - .append( (sal_Int32) mnImageCounter ++ ) + .append( static_cast<sal_Int32>(mnImageCounter ++) ) .appendAscii( pExtension ) .makeStringAndClear() ); @@ -1005,7 +1005,7 @@ void DrawingML::WriteMediaNonVisualProperties(const css::uno::Reference<css::dra Reference<XOutputStream> xOutStream = mpFB->openFragmentStream(OUStringBuffer() .appendAscii(GetComponentDir()) .append("/media/media") - .append((sal_Int32) mnImageCounter) + .append(static_cast<sal_Int32>(mnImageCounter)) .append(aExtension) .makeStringAndClear(), aMimeType); @@ -1018,7 +1018,7 @@ void DrawingML::WriteMediaNonVisualProperties(const css::uno::Reference<css::dra // create the relation OUString aPath = OUStringBuffer().appendAscii(GetRelationCompPrefix()) .append("media/media") - .append((sal_Int32) mnImageCounter++) + .append(static_cast<sal_Int32>(mnImageCounter++)) .append(aExtension) .makeStringAndClear(); aVideoFileRelId = mpFB->addRelation(mpFS->getOutputStream(), oox::getRelationship(Relationship::VIDEO), aPath); @@ -1405,7 +1405,7 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool } else if( GETA( CharHeight ) ) { - nSize = (sal_Int32) (100*(*o3tl::doAccess<float>(mAny))); + nSize = static_cast<sal_Int32>(100*(*o3tl::doAccess<float>(mAny))); if ( nElement == XML_rPr ) { rbOverridingCharHeight = true; @@ -1414,7 +1414,7 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool } if( GETA( CharKerning ) ) - nCharKerning = (sal_Int32)(*o3tl::doAccess<sal_Int16>(mAny)); + nCharKerning = static_cast<sal_Int32>(*o3tl::doAccess<sal_Int16>(mAny)); /** While setting values in propertymap, * CharKerning converted using GetTextSpacingPoint * i.e set @ http://opengrok.libreoffice.org/xref/core/oox/source/drawingml/textcharacterproperties.cxx#129 @@ -2035,7 +2035,7 @@ void DrawingML::WriteParagraphNumbering(const Reference< XPropertySet >& rXPropS if( nBulletRelSize && nBulletRelSize != 100 ) mpFS->singleElementNS( XML_a, XML_buSzPct, - XML_val, IS( std::max( (sal_Int32)25000, std::min( (sal_Int32)400000, 1000*( (sal_Int32)nBulletRelSize ) ) ) ), FSEND ); + XML_val, IS( std::max( sal_Int32(25000), std::min( sal_Int32(400000), 1000*( static_cast<sal_Int32>(nBulletRelSize) ) ) ) ), FSEND ); if( bHasFontDesc ) { if ( SVX_NUM_CHAR_SPECIAL == nNumberingType ) @@ -2122,7 +2122,7 @@ void DrawingML::WriteLinespacing( const LineSpacing& rSpacing ) if( rSpacing.Mode == LineSpacingMode::PROP ) { mpFS->singleElementNS( XML_a, XML_spcPct, - XML_val, I32S( ((sal_Int32)rSpacing.Height)*1000 ), + XML_val, I32S( (static_cast<sal_Int32>(rSpacing.Height))*1000 ), FSEND ); } else @@ -2621,7 +2621,7 @@ bool DrawingML::WriteCustomGeometry( const Reference< XShape >& rXShape, const S aSegments = uno::Sequence<drawing::EnhancedCustomShapeSegment>(4); aSegments[0].Count = 1; aSegments[0].Command = drawing::EnhancedCustomShapeSegmentCommand::MOVETO; - aSegments[1].Count = (sal_Int16)std::min( aPairs.getLength() - 1, (sal_Int32)32767 ); + aSegments[1].Count = static_cast<sal_Int16>(std::min( aPairs.getLength() - 1, sal_Int32(32767) )); aSegments[1].Command = drawing::EnhancedCustomShapeSegmentCommand::LINETO; aSegments[2].Count = 0; aSegments[2].Command = drawing::EnhancedCustomShapeSegmentCommand::CLOSESUBPATH; diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index b2a07a2f4ca4..8199221686f3 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -641,7 +641,7 @@ bool lcl_GetHandlePosition( sal_Int32 &nValue, const EnhancedCustomShapeParamete { double fValue(0.0); if ( rParam.Value >>= fValue ) - nValue = (sal_Int32)fValue; + nValue = static_cast<sal_Int32>(fValue); } else rParam.Value >>= nValue; diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index 0e3de4a20dda..2877b9b87b21 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -920,7 +920,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle& sal_uInt32 nSize; if (rProps.GetOpt(ESCHER_Prop_gtextSize, nSize)) { - float nSizeF = (sal_Int32)nSize / 65536.0; + float nSizeF = static_cast<sal_Int32>(nSize) / 65536.0; OUString aSize = OUString::number(nSizeF); aStyle += ";font-size:" + aSize + "pt"; } diff --git a/oox/source/helper/propertymap.cxx b/oox/source/helper/propertymap.cxx index 3b7e8e65a089..15c4c31737e6 100644 --- a/oox/source/helper/propertymap.cxx +++ b/oox/source/helper/propertymap.cxx @@ -544,7 +544,7 @@ static void printParameterPairData(int level, EnhancedCustomShapeParameterPair c printLevel (level + 1); fprintf (stderr, "%s,\n", lclGetEnhancedParameterType(pp.Second.Type)); printLevel (level + 1); - fprintf (stderr, "%d, %d\n", (int)nFirstValue, (int)nSecondValue); + fprintf (stderr, "%d, %d\n", static_cast<int>(nFirstValue), static_cast<int>(nSecondValue)); printLevel (level); fprintf (stderr, "}"); } diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx index a697fddfe33c..db456b58f01d 100644 --- a/oox/source/ole/axcontrol.cxx +++ b/oox/source/ole/axcontrol.cxx @@ -918,7 +918,7 @@ void AxFontDataModel::convertProperties( PropertyMap& rPropMap, const ControlCon void AxFontDataModel::convertFromProperties( PropertySet& rPropSet, const ControlConverter& /*rConv */) { rPropSet.getProperty( maFontData.maFontName, PROP_FontName ); - float fontWeight = (float)0; + float fontWeight = float(0); if ( rPropSet.getProperty(fontWeight, PROP_FontWeight ) ) setFlag( maFontData.mnFontEffects, AxFontFlags::Bold, ( fontWeight == awt::FontWeight::BOLD ) ); FontSlant nSlant = FontSlant_NONE; diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx index 4aeff993b926..658f072497aa 100644 --- a/oox/source/ole/vbaexport.cxx +++ b/oox/source/ole/vbaexport.cxx @@ -170,7 +170,7 @@ void VBACompressionChunk::PackCompressedChunkSize(size_t nSize, sal_uInt16& rHea void VBACompressionChunk::PackCompressedChunkFlag(bool bCompressed, sal_uInt16& rHeader) { sal_uInt16 nTemp1 = rHeader & 0x7FFF; - sal_uInt16 nTemp2 = ((sal_uInt16)bCompressed) << 15; + sal_uInt16 nTemp2 = static_cast<sal_uInt16>(bCompressed) << 15; rHeader = nTemp1 | nTemp2; } @@ -237,7 +237,7 @@ void VBACompressionChunk::compressToken(size_t index, sal_uInt8& nFlagByte) // section 2.4.1.3.18 void VBACompressionChunk::SetFlagBit(size_t index, bool bVal, sal_uInt8& rFlag) { - size_t nTemp1 = ((int)bVal) << index; + size_t nTemp1 = static_cast<int>(bVal) << index; sal_uInt8 nTemp2 = rFlag & (~nTemp1); rFlag = nTemp2 | nTemp1; } diff --git a/oox/source/ppt/comments.cxx b/oox/source/ppt/comments.cxx index ca5c69a92f5e..8a731c550713 100644 --- a/oox/source/ppt/comments.cxx +++ b/oox/source/ppt/comments.cxx @@ -76,7 +76,7 @@ OUString Comment::getAuthor ( const CommentAuthorList& list ) const Comment& CommentList::getCommentAtIndex (int index) { - if(index >= (int)cmLst.size() || index < 0) + if(index >= static_cast<int>(cmLst.size()) || index < 0) throw css::lang::IllegalArgumentException(); return cmLst.at(index) diff --git a/oox/source/ppt/commontimenodecontext.cxx b/oox/source/ppt/commontimenodecontext.cxx index 2ff05df64976..4dfc82ad904c 100644 --- a/oox/source/ppt/commontimenodecontext.cxx +++ b/oox/source/ppt/commontimenodecontext.cxx @@ -656,7 +656,7 @@ OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId, sal_I case PPT_TOKEN( tmPct ): if( mbIterate ) { - double fPercent = (double)rAttribs.getUnsigned( XML_val, 0 ) / 100000.0; + double fPercent = static_cast<double>(rAttribs.getUnsigned( XML_val, 0 )) / 100000.0; mpNode->getNodeProperties()[ NP_ITERATEINTERVAL ] <<= fPercent; } return this; diff --git a/oox/source/ppt/timenodelistcontext.cxx b/oox/source/ppt/timenodelistcontext.cxx index 0ade64b06f55..00841a2c487a 100644 --- a/oox/source/ppt/timenodelistcontext.cxx +++ b/oox/source/ppt/timenodelistcontext.cxx @@ -607,7 +607,7 @@ namespace oox { namespace ppt { // TODO what to do with mbZoomContents mbZoomContents = attribs.getBool( XML_zoomContents, false ); pNode->getNodeProperties()[ NP_TRANSFORMTYPE ] - <<= (sal_Int16)AnimationTransformType::SCALE; + <<= sal_Int16(AnimationTransformType::SCALE); } virtual void onEndElement() override @@ -685,7 +685,7 @@ namespace oox { namespace ppt { AttributeList attribs( xAttribs ); pNode->getNodeProperties()[ NP_TRANSFORMTYPE ] - <<= (sal_Int16)AnimationTransformType::ROTATE; + <<= sal_Int16(AnimationTransformType::ROTATE); // see also DFF_msofbtAnimateRotationData in // sd/source/filter/ppt/pptinanimations.cxx if(attribs.hasAttribute( XML_by ) ) @@ -730,7 +730,7 @@ namespace oox { namespace ppt { : TimeNodeContext( rParent, aElement, pNode ) { pNode->getNodeProperties()[ NP_TRANSFORMTYPE ] - <<= (sal_Int16)AnimationTransformType::TRANSLATE; + <<= sal_Int16(AnimationTransformType::TRANSLATE); AttributeList attribs( xAttribs ); sal_Int32 nOrigin = xAttribs->getOptionalValueToken( XML_origin, 0 ); |