[Libreoffice-commits] core.git: 8 commits - basic/source cppcanvas/source drawinglayer/source editeng/source embeddedobj/source extensions/source framework/source hwpfilter/source include/editeng include/sfx2 include/xmloff xmloff/source
Noel Grandin
noel at peralex.com
Wed Oct 1 04:09:31 PDT 2014
basic/source/basmgr/basmgr.cxx | 24 +-
basic/source/runtime/methods.cxx | 18 -
basic/source/runtime/runtime.cxx | 36 +--
cppcanvas/source/mtfrenderer/emfplus.cxx | 16 -
cppcanvas/source/uno/uno_mtfrenderer.cxx | 2
drawinglayer/source/primitive2d/controlprimitive2d.cxx | 2
drawinglayer/source/primitive2d/graphicprimitive2d.cxx | 2
drawinglayer/source/primitive2d/mediaprimitive2d.cxx | 2
editeng/source/accessibility/AccessibleEditableTextPara.cxx | 4
editeng/source/editeng/editattr.cxx | 44 ++--
editeng/source/editeng/editdbg.cxx | 78 ++++----
editeng/source/editeng/editdoc.cxx | 102 +++++-----
editeng/source/editeng/editeng.cxx | 2
editeng/source/editeng/editobj.cxx | 17 -
editeng/source/editeng/editsel.cxx | 2
editeng/source/editeng/editundo.cxx | 10 -
editeng/source/editeng/edtspell.cxx | 8
editeng/source/editeng/eeobj.cxx | 2
editeng/source/editeng/eerdll.cxx | 6
editeng/source/editeng/eertfpar.cxx | 22 +-
editeng/source/editeng/impedit.cxx | 4
editeng/source/editeng/impedit2.cxx | 36 +--
editeng/source/editeng/impedit3.cxx | 52 ++---
editeng/source/editeng/impedit4.cxx | 76 +++----
editeng/source/editeng/impedit5.cxx | 4
editeng/source/editeng/textconv.cxx | 2
editeng/source/items/bulitem.cxx | 2
editeng/source/items/flditem.cxx | 12 -
editeng/source/items/frmitems.cxx | 59 +++---
editeng/source/items/numitem.cxx | 6
editeng/source/items/optitems.cxx | 6
editeng/source/items/paraitem.cxx | 29 +--
editeng/source/items/svdfield.cxx | 2
editeng/source/items/textitem.cxx | 30 +--
editeng/source/items/writingmodeitem.cxx | 2
editeng/source/items/xmlcnitm.cxx | 4
editeng/source/misc/svxacorr.cxx | 2
editeng/source/outliner/outliner.cxx | 22 +-
editeng/source/outliner/outlvw.cxx | 2
editeng/source/rtf/rtfitem.cxx | 22 +-
editeng/source/rtf/svxrtf.cxx | 4
editeng/source/uno/unofdesc.cxx | 4
editeng/source/uno/unofield.cxx | 50 ++---
editeng/source/uno/unonrule.cxx | 2
editeng/source/uno/unotext.cxx | 8
editeng/source/xml/xmltxtimp.cxx | 2
embeddedobj/source/commonembedding/embedobj.cxx | 4
embeddedobj/source/commonembedding/miscobj.cxx | 6
embeddedobj/source/general/dummyobject.cxx | 6
embeddedobj/source/msole/oleembed.cxx | 6
embeddedobj/source/msole/olemisc.cxx | 6
extensions/source/logging/logger.cxx | 2
extensions/source/plugin/base/multiplx.cxx | 2
extensions/source/plugin/base/nfuncs.cxx | 4
extensions/source/plugin/base/xplugin.cxx | 2
extensions/source/propctrlr/cellbindinghelper.cxx | 4
extensions/source/propctrlr/formcomponenthandler.cxx | 8
extensions/source/propctrlr/propertyhandler.cxx | 2
extensions/source/propctrlr/standardcontrol.cxx | 2
extensions/source/propctrlr/taborder.cxx | 4
extensions/source/propctrlr/usercontrol.cxx | 2
framework/source/classes/fwktabwindow.cxx | 2
framework/source/helper/persistentwindowstate.cxx | 6
framework/source/helper/titlebarupdate.cxx | 6
framework/source/inc/pattern/window.hxx | 6
framework/source/layoutmanager/layoutmanager.cxx | 36 +--
framework/source/layoutmanager/toolbarlayoutmanager.cxx | 24 +-
framework/source/services/autorecovery.cxx | 4
framework/source/services/frame.cxx | 8
framework/source/services/tabwindowservice.cxx | 10 -
hwpfilter/source/hwpreader.cxx | 28 +-
include/editeng/lcolitem.hxx | 4
include/editeng/svxrtf.hxx | 4
include/sfx2/app.hxx | 2
include/xmloff/prstylei.hxx | 4
xmloff/source/chart/SchXMLAxisContext.cxx | 4
xmloff/source/chart/SchXMLChartContext.cxx | 4
xmloff/source/chart/SchXMLExport.cxx | 12 -
xmloff/source/chart/SchXMLLegendContext.cxx | 2
xmloff/source/chart/SchXMLPlotAreaContext.cxx | 4
xmloff/source/chart/SchXMLRegressionCurveObjectContext.cxx | 2
xmloff/source/chart/XMLChartStyleContext.cxx | 6
xmloff/source/core/xmlimp.cxx | 28 +-
xmloff/source/draw/XMLShapePropertySetContext.cxx | 2
xmloff/source/draw/sdxmlimp.cxx | 4
xmloff/source/draw/shapeexport.cxx | 2
xmloff/source/draw/xexptran.cxx | 116 ++++++------
xmloff/source/draw/ximp3dscene.cxx | 2
xmloff/source/draw/ximp3dscene.hxx | 4
xmloff/source/draw/ximpbody.hxx | 4
xmloff/source/draw/ximppage.cxx | 12 -
xmloff/source/draw/ximppage.hxx | 4
xmloff/source/draw/ximpstyl.cxx | 16 -
xmloff/source/draw/ximpstyl.hxx | 24 +-
xmloff/source/style/XMLFontStylesContext_impl.hxx | 2
xmloff/source/style/prstylei.cxx | 10 -
xmloff/source/style/xmlnumfi.cxx | 4
xmloff/source/text/XMLIndexTOCContext.cxx | 4
xmloff/source/text/XMLTextListBlockContext.cxx | 4
xmloff/source/text/XMLTextShapeStyleContext.cxx | 2
xmloff/source/text/txtfldi.cxx | 2
xmloff/source/text/txtimp.cxx | 18 -
xmloff/source/text/txtparai.cxx | 14 -
103 files changed, 684 insertions(+), 675 deletions(-)
New commits:
commit 15eceec17e91dd227e9f815a492df88c4aa7175f
Author: Noel Grandin <noel at peralex.com>
Date: Wed Oct 1 13:08:05 2014 +0200
loplugin: cstylecast
Change-Id: I6fb9e1b1d55d5bc8e71bfbae599a4f9744d559f1
diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index 85e4873..f58ec95 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -1288,7 +1288,7 @@ namespace cppcanvas
} else {
rState.isFillColorSet = true;
// extract UseBrush
- EMFPBrush* brush = (EMFPBrush*) aObjects [brushIndexOrColor & 0xff];
+ EMFPBrush* brush = static_cast<EMFPBrush*>( aObjects [brushIndexOrColor & 0xff] );
SAL_INFO("cppcanvas.emf", "EMF+\tbrush fill slot: " << brushIndexOrColor << " (type: " << brush->GetType () << ")");
// give up in case something wrong happened
@@ -1583,7 +1583,7 @@ namespace cppcanvas
void ImplRenderer::EMFPPlusDrawPolygon (const ::basegfx::B2DPolyPolygon& polygon, const ActionFactoryParameters& rParms,
OutDevState& rState, const CanvasSharedPtr& rCanvas, sal_uInt32 penIndex)
{
- EMFPPen* pen = (EMFPPen*) aObjects [penIndex & 0xff];
+ EMFPPen* pen = static_cast<EMFPPen*>( aObjects [penIndex & 0xff] );
SAL_WARN_IF( !pen, "cppcanvas.emf", "emf+ missing pen" );
@@ -1755,7 +1755,7 @@ namespace cppcanvas
double ImplRenderer::setFont (sal_uInt8 objectId, const ActionFactoryParameters& rParms, OutDevState& rState)
{
- EMFPFont *font = (EMFPFont*) aObjects[ objectId ];
+ EMFPFont *font = static_cast<EMFPFont*>( aObjects[ objectId ] );
rendering::FontRequest aFontRequest;
aFontRequest.FontDescription.FamilyName = font->family;
@@ -1921,7 +1921,7 @@ namespace cppcanvas
SAL_INFO("cppcanvas.emf", "EMF+ FillPath slot: " << index);
- EMFPPlusFillPolygon (((EMFPPath*) aObjects [index])->GetPolygon (*this), rFactoryParms, rState, rCanvas, flags & 0x8000, brushIndexOrColor);
+ EMFPPlusFillPolygon( static_cast<EMFPPath*>( aObjects [index])->GetPolygon (*this), rFactoryParms, rState, rCanvas, flags & 0x8000, brushIndexOrColor);
}
break;
case EmfPlusRecordTypeDrawEllipse:
@@ -2045,7 +2045,7 @@ namespace cppcanvas
SAL_INFO("cppcanvas.emf", "EMF+ DrawPath");
SAL_INFO("cppcanvas.emf", "EMF+\tpen: " << penIndex);
- EMFPPath* path = (EMFPPath*) aObjects [flags & 0xff];
+ EMFPPath* path = static_cast<EMFPPath*>( aObjects [flags & 0xff] );
SAL_WARN_IF( !path, "cppcanvas.emf", "EmfPlusRecordTypeDrawPath missing path" );
EMFPPlusDrawPolygon (path->GetPolygon (*this), rFactoryParms, rState, rCanvas, penIndex);
@@ -2064,7 +2064,7 @@ namespace cppcanvas
SAL_INFO("cppcanvas.emf", "EMF+\tTODO: use image attributes");
if (sourceUnit == 2 && aObjects [flags & 0xff]) { // we handle only GraphicsUnit.Pixel now
- EMFPImage& image = *(EMFPImage *) aObjects [flags & 0xff];
+ EMFPImage& image = *static_cast<EMFPImage *>( aObjects [flags & 0xff]);
float sx, sy, sw, sh;
sal_Int32 aCount;
@@ -2350,7 +2350,7 @@ namespace cppcanvas
SAL_INFO("cppcanvas.emf", "EMF+ SetClipPath combine mode: " << combineMode);
SAL_INFO("cppcanvas.emf", "EMF+\tpath in slot: " << (flags & 0xff));
- EMFPPath& path = *(EMFPPath*) aObjects [flags & 0xff];
+ EMFPPath& path = *static_cast<EMFPPath*>( aObjects [flags & 0xff] );
::basegfx::B2DPolyPolygon& clipPoly (path.GetPolygon (*this));
clipPoly.transform (rState.mapModeTransform);
@@ -2375,7 +2375,7 @@ namespace cppcanvas
SAL_INFO("cppcanvas.emf", "EMF+ SetClipRegion");
SAL_INFO("cppcanvas.emf", "EMF+\tregion in slot: " << (flags & 0xff) << " combine mode: " << combineMode);
- EMFPRegion *region = (EMFPRegion*)aObjects [flags & 0xff];
+ EMFPRegion *region = static_cast<EMFPRegion*>(aObjects [flags & 0xff]);
// reset clip
if (region && region->parts == 0 && region->initialState == EmfPlusRegionInitialStateInfinite) {
diff --git a/cppcanvas/source/uno/uno_mtfrenderer.cxx b/cppcanvas/source/uno/uno_mtfrenderer.cxx
index 4a9cc09..a2e2c41 100644
--- a/cppcanvas/source/uno/uno_mtfrenderer.cxx
+++ b/cppcanvas/source/uno/uno_mtfrenderer.cxx
@@ -35,7 +35,7 @@ void MtfRenderer::draw (double fScaleX, double fScaleY) throw (uno::RuntimeExcep
void MtfRenderer::setFastPropertyValue( sal_Int32 nHandle, const uno::Any& aAny) throw (uno::RuntimeException, std::exception)
{
if (nHandle == 0) {
- mpMetafile = (GDIMetaFile*) *reinterpret_cast<const sal_Int64*>(aAny.getValue());
+ mpMetafile = reinterpret_cast<GDIMetaFile*>( *reinterpret_cast<const sal_Int64*>(aAny.getValue()) );
}
}
commit e27ac011c3f1e5ccc178cc5cd8e6d46d73be2e76
Author: Noel Grandin <noel at peralex.com>
Date: Wed Oct 1 12:59:38 2014 +0200
loplugin: cstylecast
Change-Id: I9fca98995131358b3b112b11e0b28feb1a3267d1
diff --git a/embeddedobj/source/commonembedding/embedobj.cxx b/embeddedobj/source/commonembedding/embedobj.cxx
index f61c878..9e24276 100644
--- a/embeddedobj/source/commonembedding/embedobj.cxx
+++ b/embeddedobj/source/commonembedding/embedobj.cxx
@@ -132,9 +132,9 @@ void OCommonEmbeddedObject::StateChangeNotification_Impl( bool bBeforeChange, sa
try
{
if ( bBeforeChange )
- ((embed::XStateChangeListener*)pIterator.next())->changingState( aSource, nOldState, nNewState );
+ static_cast<embed::XStateChangeListener*>(pIterator.next())->changingState( aSource, nOldState, nNewState );
else
- ((embed::XStateChangeListener*)pIterator.next())->stateChanged( aSource, nOldState, nNewState );
+ static_cast<embed::XStateChangeListener*>(pIterator.next())->stateChanged( aSource, nOldState, nNewState );
}
catch( const uno::Exception& )
{
diff --git a/embeddedobj/source/commonembedding/miscobj.cxx b/embeddedobj/source/commonembedding/miscobj.cxx
index de1bee7..f97df51 100644
--- a/embeddedobj/source/commonembedding/miscobj.cxx
+++ b/embeddedobj/source/commonembedding/miscobj.cxx
@@ -334,7 +334,7 @@ void OCommonEmbeddedObject::PostEvent_Impl( const OUString& aEventName )
{
try
{
- ((document::XEventListener *)aIt.next())->notifyEvent( aEvent );
+ static_cast<document::XEventListener *>(aIt.next())->notifyEvent( aEvent );
}
catch( const uno::RuntimeException& )
{
@@ -550,7 +550,7 @@ void SAL_CALL OCommonEmbeddedObject::close( sal_Bool bDeliverOwnership )
{
try
{
- ((util::XCloseListener*)pIterator.next())->queryClosing( aSource, bDeliverOwnership );
+ static_cast<util::XCloseListener*>(pIterator.next())->queryClosing( aSource, bDeliverOwnership );
}
catch( const uno::RuntimeException& )
{
@@ -568,7 +568,7 @@ void SAL_CALL OCommonEmbeddedObject::close( sal_Bool bDeliverOwnership )
{
try
{
- ((util::XCloseListener*)pCloseIterator.next())->notifyClosing( aSource );
+ static_cast<util::XCloseListener*>(pCloseIterator.next())->notifyClosing( aSource );
}
catch( const uno::RuntimeException& )
{
diff --git a/embeddedobj/source/general/dummyobject.cxx b/embeddedobj/source/general/dummyobject.cxx
index 603b8f3..236f12e 100644
--- a/embeddedobj/source/general/dummyobject.cxx
+++ b/embeddedobj/source/general/dummyobject.cxx
@@ -76,7 +76,7 @@ void ODummyEmbeddedObject::PostEvent_Impl( const OUString& aEventName )
{
try
{
- ((document::XEventListener *)aIt.next())->notifyEvent( aEvent );
+ static_cast<document::XEventListener *>(aIt.next())->notifyEvent( aEvent );
}
catch( const uno::RuntimeException& )
{
@@ -634,7 +634,7 @@ void SAL_CALL ODummyEmbeddedObject::close( sal_Bool bDeliverOwnership )
{
try
{
- ((util::XCloseListener*)pIterator.next())->queryClosing( aSource, bDeliverOwnership );
+ static_cast<util::XCloseListener*>(pIterator.next())->queryClosing( aSource, bDeliverOwnership );
}
catch( const uno::RuntimeException& )
{
@@ -652,7 +652,7 @@ void SAL_CALL ODummyEmbeddedObject::close( sal_Bool bDeliverOwnership )
{
try
{
- ((util::XCloseListener*)pCloseIterator.next())->notifyClosing( aSource );
+ static_cast<util::XCloseListener*>(pCloseIterator.next())->notifyClosing( aSource );
}
catch( const uno::RuntimeException& )
{
diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx
index 5c9df30..8151182 100644
--- a/embeddedobj/source/msole/oleembed.cxx
+++ b/embeddedobj/source/msole/oleembed.cxx
@@ -136,7 +136,7 @@ void OleEmbeddedObject::MoveListeners()
{
try
{
- xWrappedObject->addStateChangeListener( (embed::XStateChangeListener*)pIterator.next() );
+ xWrappedObject->addStateChangeListener( static_cast<embed::XStateChangeListener*>(pIterator.next()) );
}
catch( const uno::RuntimeException& )
{
@@ -161,7 +161,7 @@ void OleEmbeddedObject::MoveListeners()
{
try
{
- xWrappedObject->addEventListener( (document::XEventListener*)pIterator.next() );
+ xWrappedObject->addEventListener( static_cast<document::XEventListener*>(pIterator.next()) );
}
catch( const uno::RuntimeException& )
{
@@ -186,7 +186,7 @@ void OleEmbeddedObject::MoveListeners()
{
try
{
- xWrappedObject->addCloseListener( (util::XCloseListener*)pIterator.next() );
+ xWrappedObject->addCloseListener( static_cast<util::XCloseListener*>(pIterator.next()) );
}
catch( const uno::RuntimeException& )
{
diff --git a/embeddedobj/source/msole/olemisc.cxx b/embeddedobj/source/msole/olemisc.cxx
index d2bae48..dd12260 100644
--- a/embeddedobj/source/msole/olemisc.cxx
+++ b/embeddedobj/source/msole/olemisc.cxx
@@ -175,7 +175,7 @@ void OleEmbeddedObject::MakeEventListenerNotification_Impl( const OUString& aEve
{
try
{
- ((document::XEventListener*)pIterator.next())->notifyEvent( aEvent );
+ static_cast<document::XEventListener*>(pIterator.next())->notifyEvent( aEvent );
}
catch( const uno::RuntimeException& )
{
@@ -479,7 +479,7 @@ void SAL_CALL OleEmbeddedObject::close( sal_Bool bDeliverOwnership )
{
try
{
- ((util::XCloseListener*)pIterator.next())->queryClosing( aSource, bDeliverOwnership );
+ static_cast<util::XCloseListener*>(pIterator.next())->queryClosing( aSource, bDeliverOwnership );
}
catch( const uno::RuntimeException& )
{
@@ -497,7 +497,7 @@ void SAL_CALL OleEmbeddedObject::close( sal_Bool bDeliverOwnership )
{
try
{
- ((util::XCloseListener*)pCloseIterator.next())->notifyClosing( aSource );
+ static_cast<util::XCloseListener*>(pCloseIterator.next())->notifyClosing( aSource );
}
catch( const uno::RuntimeException& )
{
diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx
index ec305db..af7b231 100644
--- a/hwpfilter/source/hwpreader.cxx
+++ b/hwpfilter/source/hwpreader.cxx
@@ -2918,7 +2918,7 @@ void HwpReader::make_text_p3(HWPPara * para,bool bParaStart)
}
else if (para->hhstr[n]->hh == CH_FIELD)
{
- FieldCode *hbox = (FieldCode *) para->hhstr[n];
+ FieldCode *hbox = static_cast<FieldCode *>(para->hhstr[n]);
if( hbox->location_info == 1)
{
if( !pstart ) {STARTP;}
@@ -2954,7 +2954,7 @@ void HwpReader::make_text_p3(HWPPara * para,bool bParaStart)
if( !pstart ) {STARTP;}
if( !tstart ) {STARTT;}
makeChars(str);
- makeBookmark((Bookmark *) para->hhstr[n]);
+ makeBookmark(static_cast<Bookmark *>(para->hhstr[n]));
break;
case CH_DATE_FORM: // 7
break;
@@ -2962,7 +2962,7 @@ void HwpReader::make_text_p3(HWPPara * para,bool bParaStart)
if( !pstart ) {STARTP;}
if( !tstart ) {STARTT;}
makeChars(str);
- makeDateCode((DateCode *) para->hhstr[n]);
+ makeDateCode(static_cast<DateCode *>(para->hhstr[n]));
break;
case CH_TAB: // 9
if( !pstart ) {STARTP;}
@@ -2971,12 +2971,12 @@ void HwpReader::make_text_p3(HWPPara * para,bool bParaStart)
if( !tstart ) {STARTT;}
makeChars(str);
}
- makeTab((Tab *) para->hhstr[n]);
+ makeTab(static_cast<Tab *>(para->hhstr[n]));
break;
case CH_TEXT_BOX: /* 10 - í/í
ì¤í¸ë°ì¤/ìì/ë²í¼/íì´í¼í
ì¤í¸ ì */
{
/* ì¼ë¨ì íë§ ì²ë¦¬íê³ , ììì text:pìì ë¤ì´ê°ë ê²ì¼ë¡ ì²ë¦¬. */
- TxtBox *hbox = (TxtBox *) para->hhstr[n];
+ TxtBox *hbox = static_cast<TxtBox *>(para->hhstr[n]);
if( hbox->style.anchor_type == 0 )
{
@@ -3010,7 +3010,7 @@ void HwpReader::make_text_p3(HWPPara * para,bool bParaStart)
}
case CH_PICTURE: // 11
{
- Picture *hbox = (Picture *) para->hhstr[n];
+ Picture *hbox = static_cast<Picture *>(para->hhstr[n]);
if( hbox->style.anchor_type == 0 )
{
if( !pstart ) {STARTP;}
@@ -3032,7 +3032,7 @@ void HwpReader::make_text_p3(HWPPara * para,bool bParaStart)
}
case CH_LINE: // 14
{
- Line *hbox = (Line *) para->hhstr[n];
+ Line *hbox = static_cast<Line *>(para->hhstr[n]);
if (str.size() > 0)
{
if( !pstart ) {STARTP;}
@@ -3049,19 +3049,19 @@ void HwpReader::make_text_p3(HWPPara * para,bool bParaStart)
if( !pstart ) {STARTP;}
if( !tstart ) {STARTT;}
makeChars(str);
- makeHidden((Hidden *) para->hhstr[n]);
+ makeHidden(static_cast<Hidden *>(para->hhstr[n]));
break;
case CH_FOOTNOTE: // 17
if( !pstart ) {STARTP;}
if( !tstart ) {STARTT;}
makeChars(str);
- makeFootnote((Footnote *) para->hhstr[n]);
+ makeFootnote(static_cast<Footnote *>(para->hhstr[n]));
break;
case CH_AUTO_NUM: // 18
if( !pstart ) {STARTP;}
if( !tstart ) {STARTT;}
makeChars(str);
- makeAutoNum((AutoNum *) para->hhstr[n]);
+ makeAutoNum(static_cast<AutoNum *>(para->hhstr[n]));
break;
case CH_NEW_NUM: // 19 -skip
break;
@@ -3071,7 +3071,7 @@ void HwpReader::make_text_p3(HWPPara * para,bool bParaStart)
if( !pstart ) {STARTP;}
if( !tstart ) {STARTT;}
makeChars(str);
- makeMailMerge((MailMerge *) para->hhstr[n]);
+ makeMailMerge(static_cast<MailMerge *>(para->hhstr[n]));
break;
case CH_COMPOSE: /* 23 - ê¸ì겹침 */
break;
@@ -3081,19 +3081,19 @@ void HwpReader::make_text_p3(HWPPara * para,bool bParaStart)
if( !pstart ) {STARTP;}
if( !tstart ) {STARTT;}
makeChars(str);
- makeTocMark((TocMark *) para->hhstr[n]);
+ makeTocMark(static_cast<TocMark *>(para->hhstr[n]));
break;
case CH_INDEX_MARK: // 26
if( !pstart ) {STARTP;}
if( !tstart ) {STARTT;}
makeChars(str);
- makeIndexMark((IndexMark *) para->hhstr[n]);
+ makeIndexMark(static_cast<IndexMark *>(para->hhstr[n]));
break;
case CH_OUTLINE: // 28
if( !pstart ) {STARTP;}
if( !tstart ) {STARTT;}
makeChars(str);
- makeOutline((Outline *) para->hhstr[n]);
+ makeOutline(static_cast<Outline *>(para->hhstr[n]));
break;
case CH_FIXED_SPACE:
case CH_KEEP_SPACE:
commit c190577f754158c9e3b003a838bc97762e4773e8
Author: Noel Grandin <noel at peralex.com>
Date: Wed Oct 1 12:11:52 2014 +0200
loplugin: cstylecast
Change-Id: I25b82a96aace448a8debe90c181b22976ea95414
diff --git a/include/xmloff/prstylei.hxx b/include/xmloff/prstylei.hxx
index 76dab71..3a94650 100644
--- a/include/xmloff/prstylei.hxx
+++ b/include/xmloff/prstylei.hxx
@@ -86,7 +86,7 @@ protected:
virtual void SetAttribute( sal_uInt16 nPrefixKey,
const OUString& rLocalName,
const OUString& rValue ) SAL_OVERRIDE;
- SvXMLStylesContext *GetStyles() { return (SvXMLStylesContext *)&mxStyles; }
+ SvXMLStylesContext *GetStyles() { return static_cast<SvXMLStylesContext *>(&mxStyles); }
::std::vector< XMLPropertyState > & GetProperties() { return maProperties; }
// This methos my be overloaded to create a new style. Its called by
@@ -115,7 +115,7 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet > & rPropSet );
- const SvXMLStylesContext *GetStyles() const { return (const SvXMLStylesContext *)&mxStyles; }
+ const SvXMLStylesContext *GetStyles() const { return static_cast<const SvXMLStylesContext *>(&mxStyles); }
const ::std::vector< XMLPropertyState > & GetProperties() const { return maProperties; }
const ::com::sun::star::uno::Reference <
diff --git a/xmloff/source/chart/SchXMLAxisContext.cxx b/xmloff/source/chart/SchXMLAxisContext.cxx
index 5dc939e..f7192cf 100644
--- a/xmloff/source/chart/SchXMLAxisContext.cxx
+++ b/xmloff/source/chart/SchXMLAxisContext.cxx
@@ -228,7 +228,7 @@ void SchXMLAxisContext::CreateGrid( const OUString& sAutoStyleName, bool bIsMajo
SchXMLImportHelper::GetChartFamilyID(), sAutoStyleName );
if( pStyle && pStyle->ISA( XMLPropStyleContext ))
- (( XMLPropStyleContext* )pStyle )->FillPropertySet( xGridProp );
+ const_cast<XMLPropStyleContext*>( static_cast< const XMLPropStyleContext* >( pStyle ))->FillPropertySet( xGridProp );
}
}
}
@@ -501,7 +501,7 @@ void SchXMLAxisContext::CreateAxis()
if( xAxisSuppl.is() )
{
Reference< beans::XPropertySet > xXAxisProp( xAxisSuppl->getAxis(0), uno::UNO_QUERY );
- (( XMLPropStyleContext* )pStyle )->FillPropertySet( xXAxisProp );
+ const_cast<XMLPropStyleContext*>( static_cast< const XMLPropStyleContext* >( pStyle ))->FillPropertySet( xXAxisProp );
}
//set scale data of added x axis back to default
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx
index df97776..28e338f 100644
--- a/xmloff/source/chart/SchXMLChartContext.cxx
+++ b/xmloff/source/chart/SchXMLChartContext.cxx
@@ -372,7 +372,7 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut
SchXMLImportHelper::GetChartFamilyID(), sAutoStyleName );
if( pStyle && pStyle->ISA( XMLPropStyleContext ))
- (( XMLPropStyleContext* )pStyle )->FillPropertySet( xProp );
+ const_cast<XMLPropStyleContext*>( static_cast< const XMLPropStyleContext* >( pStyle ) )->FillPropertySet( xProp );
}
}
}
@@ -1198,7 +1198,7 @@ void SchXMLTitleContext::StartElement( const uno::Reference< xml::sax::XAttribut
SchXMLImportHelper::GetChartFamilyID(), msAutoStyleName );
if( pStyle && pStyle->ISA( XMLPropStyleContext ))
- (( XMLPropStyleContext* )pStyle )->FillPropertySet( xProp );
+ const_cast<XMLPropStyleContext*>( static_cast< const XMLPropStyleContext* >( pStyle ) )->FillPropertySet( xProp );
}
}
}
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index 4f85439..db5fc9e 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -767,8 +767,8 @@ void lcl_ReorderInternalSequencesAccordingToTheirRangeName(
for( ; nIndex < aIt->first; ++nIndex )
rInOutSequences.push_back(
SchXMLExportHelper_Impl::tDataSequenceCont::value_type(
- (uno::Reference< chart2::data::XDataSequence >)0,
- (uno::Reference< chart2::data::XDataSequence >)0 ));
+ uno::Reference< chart2::data::XDataSequence >(),
+ uno::Reference< chart2::data::XDataSequence >() ));
OSL_ASSERT( nIndex == aIt->first );
rInOutSequences.push_back( aIt->second );
}
@@ -2803,7 +2803,7 @@ void SchXMLExportHelper_Impl::exportSeries(
Reference< chart2::data::XDataSequence > xValues( xSequence->getValues() );
if( lcl_exportDomainForThisSequence( xValues, aFirstXDomainRange, mrExport ) )
m_aDataSequencesToExport.push_back( tLabelValuesDataPair(
- (uno::Reference< chart2::data::XDataSequence >)0, xValues ));
+ uno::Reference< chart2::data::XDataSequence >(), xValues ));
}
else if( nSeriesIdx==0 )
{
@@ -2819,7 +2819,7 @@ void SchXMLExportHelper_Impl::exportSeries(
}
if( xYValuesForBubbleChart.is() )
m_aDataSequencesToExport.push_back( tLabelValuesDataPair(
- (uno::Reference< chart2::data::XDataSequence >)0, xYValuesForBubbleChart ));
+ uno::Reference< chart2::data::XDataSequence >(), xYValuesForBubbleChart ));
}
}
@@ -2922,7 +2922,7 @@ void SchXMLExportHelper_Impl::exportPropertyMapping(
// register range for data table export
m_aDataSequencesToExport.push_back( tLabelValuesDataPair(
- (uno::Reference< chart2::data::XDataSequence >)0, xValues ));
+ uno::Reference< chart2::data::XDataSequence >(), xValues ));
}
}
}
@@ -3108,7 +3108,7 @@ void SchXMLExportHelper_Impl::exportErrorBar( const Reference<beans::XPropertySe
aErrorBarSequences.begin()); aIt != aErrorBarSequences.end(); ++aIt )
{
m_aDataSequencesToExport.push_back( tLabelValuesDataPair(
- (uno::Reference< chart2::data::XDataSequence >)0, *aIt ));
+ uno::Reference< chart2::data::XDataSequence >(), *aIt ));
}
}
diff --git a/xmloff/source/chart/SchXMLLegendContext.cxx b/xmloff/source/chart/SchXMLLegendContext.cxx
index c072ab9..7bb30bf 100644
--- a/xmloff/source/chart/SchXMLLegendContext.cxx
+++ b/xmloff/source/chart/SchXMLLegendContext.cxx
@@ -207,7 +207,7 @@ void SchXMLLegendContext::StartElement( const uno::Reference< xml::sax::XAttribu
SchXMLImportHelper::GetChartFamilyID(), sAutoStyleName );
if( pStyle && pStyle->ISA( XMLPropStyleContext ))
- (( XMLPropStyleContext* )pStyle )->FillPropertySet( xLegendProps );
+ const_cast<XMLPropStyleContext*>( static_cast<const XMLPropStyleContext*>( pStyle ) )->FillPropertySet( xLegendProps );
}
}
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
index e643771..6298cc7 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
@@ -841,7 +841,7 @@ void SchXMLWallFloorContext::StartElement( const uno::Reference< xml::sax::XAttr
SchXMLImportHelper::GetChartFamilyID(), sAutoStyleName );
if( pStyle && pStyle->ISA( XMLPropStyleContext ))
- (( XMLPropStyleContext* )pStyle )->FillPropertySet( xProp );
+ const_cast<XMLPropStyleContext*>( static_cast<const XMLPropStyleContext*>( pStyle ) )->FillPropertySet( xProp );
}
}
}
@@ -911,7 +911,7 @@ void SchXMLStockContext::StartElement( const uno::Reference< xml::sax::XAttribut
SchXMLImportHelper::GetChartFamilyID(), sAutoStyleName );
if( pStyle && pStyle->ISA( XMLPropStyleContext ))
- (( XMLPropStyleContext* )pStyle )->FillPropertySet( xProp );
+ const_cast<XMLPropStyleContext*>( static_cast<const XMLPropStyleContext*>( pStyle ) )->FillPropertySet( xProp );
}
}
}
diff --git a/xmloff/source/chart/SchXMLRegressionCurveObjectContext.cxx b/xmloff/source/chart/SchXMLRegressionCurveObjectContext.cxx
index 32eb725..3cdafbb 100644
--- a/xmloff/source/chart/SchXMLRegressionCurveObjectContext.cxx
+++ b/xmloff/source/chart/SchXMLRegressionCurveObjectContext.cxx
@@ -130,7 +130,7 @@ void SchXMLEquationContext::StartElement( const uno::Reference< xml::sax::XAttri
{
// parse attributes
sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
- SchXMLImport& rImport = ( SchXMLImport& )GetImport();
+ SchXMLImport& rImport = static_cast< SchXMLImport& >(GetImport());
const SvXMLTokenMap& rAttrTokenMap = mrImportHelper.GetRegEquationAttrTokenMap();
OUString sAutoStyleName;
diff --git a/xmloff/source/chart/XMLChartStyleContext.cxx b/xmloff/source/chart/XMLChartStyleContext.cxx
index cc7b285..ca3f36b 100644
--- a/xmloff/source/chart/XMLChartStyleContext.cxx
+++ b/xmloff/source/chart/XMLChartStyleContext.cxx
@@ -80,12 +80,12 @@ void lcl_NumberFormatStyleToProperty( const OUString& rStyleName, const OUString
{
if( !rStyleName.isEmpty())
{
- SvXMLNumFormatContext* pStyle = (SvXMLNumFormatContext *)rStylesContext.FindStyleChildContext(
- XML_STYLE_FAMILY_DATA_STYLE, rStyleName, true );
+ const SvXMLNumFormatContext* pStyle = static_cast<const SvXMLNumFormatContext *>(rStylesContext.FindStyleChildContext(
+ XML_STYLE_FAMILY_DATA_STYLE, rStyleName, true ));
if( pStyle )
{
uno::Any aNumberFormat;
- sal_Int32 nNumberFormat = pStyle->GetKey();
+ sal_Int32 nNumberFormat = const_cast<SvXMLNumFormatContext*>(pStyle)->GetKey();
aNumberFormat <<= nNumberFormat;
rPropSet->setPropertyValue( rPropertyName, aNumberFormat );
}
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index f9f1969..33d84b1 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -584,13 +584,13 @@ void SAL_CALL SvXMLImport::endDocument()
}
if( mxFontDecls.Is() )
- ((SvXMLStylesContext *)&mxFontDecls)->Clear();
+ static_cast<SvXMLStylesContext *>(&mxFontDecls)->Clear();
if( mxStyles.Is() )
- ((SvXMLStylesContext *)&mxStyles)->Clear();
+ static_cast<SvXMLStylesContext *>(&mxStyles)->Clear();
if( mxAutoStyles.Is() )
- ((SvXMLStylesContext *)&mxAutoStyles)->Clear();
+ static_cast<SvXMLStylesContext *>(&mxAutoStyles)->Clear();
if( mxMasterStyles.Is() )
- ((SvXMLStylesContext *)&mxMasterStyles)->Clear();
+ static_cast<SvXMLStylesContext *>(&mxMasterStyles)->Clear();
// possible form-layer related knittings which can only be done when
// the whole document exists
@@ -1538,32 +1538,32 @@ void SvXMLImport::SetMasterStyles( SvXMLStylesContext *pMasterStyles )
XMLFontStylesContext *SvXMLImport::GetFontDecls()
{
- return (XMLFontStylesContext *)&mxFontDecls;
+ return static_cast<XMLFontStylesContext *>(&mxFontDecls);
}
SvXMLStylesContext *SvXMLImport::GetStyles()
{
- return (SvXMLStylesContext *)&mxStyles;
+ return static_cast<SvXMLStylesContext *>(&mxStyles);
}
SvXMLStylesContext *SvXMLImport::GetAutoStyles()
{
- return (SvXMLStylesContext *)&mxAutoStyles;
+ return static_cast<SvXMLStylesContext *>(&mxAutoStyles);
}
const XMLFontStylesContext *SvXMLImport::GetFontDecls() const
{
- return (const XMLFontStylesContext *)&mxFontDecls;
+ return static_cast<const XMLFontStylesContext *>(&mxFontDecls);
}
const SvXMLStylesContext *SvXMLImport::GetStyles() const
{
- return (const SvXMLStylesContext *)&mxStyles;
+ return static_cast<const SvXMLStylesContext *>(&mxStyles);
}
const SvXMLStylesContext *SvXMLImport::GetAutoStyles() const
{
- return (const SvXMLStylesContext *)&mxAutoStyles;
+ return static_cast<const SvXMLStylesContext *>(&mxAutoStyles);
}
OUString SvXMLImport::GetAbsoluteReference(const OUString& rValue) const
@@ -1755,13 +1755,13 @@ void SvXMLImport::SetError(
void SvXMLImport::DisposingModel()
{
if( mxFontDecls.Is() )
- ((SvXMLStylesContext *)&mxFontDecls)->Clear();
+ static_cast<SvXMLStylesContext *>(&mxFontDecls)->Clear();
if( mxStyles.Is() )
- ((SvXMLStylesContext *)&mxStyles)->Clear();
+ static_cast<SvXMLStylesContext *>(&mxStyles)->Clear();
if( mxAutoStyles.Is() )
- ((SvXMLStylesContext *)&mxAutoStyles)->Clear();
+ static_cast<SvXMLStylesContext *>(&mxAutoStyles)->Clear();
if( mxMasterStyles.Is() )
- ((SvXMLStylesContext *)&mxMasterStyles)->Clear();
+ static_cast<SvXMLStylesContext *>(&mxMasterStyles)->Clear();
mxModel.set(0);
mxEventListener.set(NULL);
diff --git a/xmloff/source/draw/XMLShapePropertySetContext.cxx b/xmloff/source/draw/XMLShapePropertySetContext.cxx
index 1aec8f5..e4599f3 100644
--- a/xmloff/source/draw/XMLShapePropertySetContext.cxx
+++ b/xmloff/source/draw/XMLShapePropertySetContext.cxx
@@ -52,7 +52,7 @@ void XMLShapePropertySetContext::EndElement()
Reference< container::XIndexReplace > xNumRule;
if( mxBulletStyle.Is() )
{
- SvxXMLListStyleContext* pBulletStyle = (SvxXMLListStyleContext*)&mxBulletStyle;
+ SvxXMLListStyleContext* pBulletStyle = static_cast<SvxXMLListStyleContext*>(&mxBulletStyle);
xNumRule = SvxXMLListStyleContext::CreateNumRule( GetImport().GetModel() );
if( xNumRule.is() )
pBulletStyle->FillUnoNumRule(xNumRule, NULL /* const SvI18NMap * ??? */ );
diff --git a/xmloff/source/draw/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx
index 6110b25..4b21bca 100644
--- a/xmloff/source/draw/sdxmlimp.cxx
+++ b/xmloff/source/draw/sdxmlimp.cxx
@@ -52,7 +52,7 @@ using namespace ::xmloff::token;
class SdXMLBodyContext_Impl : public SvXMLImportContext
{
- SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
+ SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
public:
@@ -90,7 +90,7 @@ SvXMLImportContext *SdXMLBodyContext_Impl::CreateChildContext(
class SdXMLDocContext_Impl : public virtual SvXMLImportContext
{
protected:
- SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
+ SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
public:
SdXMLDocContext_Impl(
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index 2a83804..c5d09cd 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -1229,7 +1229,7 @@ void XMLShapeExport::ExportGraphicDefaults()
// construct PropertySetMapper
rtl::Reference< SvXMLExportPropertyMapper > xPropertySetMapper( CreateShapePropMapper( mrExport ) );
- ((XMLShapeExportPropertyMapper*)xPropertySetMapper.get())->SetAutoStyles( false );
+ static_cast<XMLShapeExportPropertyMapper*>(xPropertySetMapper.get())->SetAutoStyles( false );
// chain text attributes
xPropertySetMapper->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(mrExport));
diff --git a/xmloff/source/draw/xexptran.cxx b/xmloff/source/draw/xexptran.cxx
index f3968e3..6d9f342 100644
--- a/xmloff/source/draw/xexptran.cxx
+++ b/xmloff/source/draw/xexptran.cxx
@@ -233,32 +233,32 @@ void SdXMLImExTransform2D::EmptyList()
{
case IMP_SDXMLEXP_TRANSOBJ2D_ROTATE :
{
- delete (ImpSdXMLExpTransObj2DRotate*)pObj;
+ delete static_cast<ImpSdXMLExpTransObj2DRotate*>(pObj);
break;
}
case IMP_SDXMLEXP_TRANSOBJ2D_SCALE :
{
- delete (ImpSdXMLExpTransObj2DScale*)pObj;
+ delete static_cast<ImpSdXMLExpTransObj2DScale*>(pObj);
break;
}
case IMP_SDXMLEXP_TRANSOBJ2D_TRANSLATE :
{
- delete (ImpSdXMLExpTransObj2DTranslate*)pObj;
+ delete static_cast<ImpSdXMLExpTransObj2DTranslate*>(pObj);
break;
}
case IMP_SDXMLEXP_TRANSOBJ2D_SKEWX :
{
- delete (ImpSdXMLExpTransObj2DSkewX*)pObj;
+ delete static_cast<ImpSdXMLExpTransObj2DSkewX*>(pObj);
break;
}
case IMP_SDXMLEXP_TRANSOBJ2D_SKEWY :
{
- delete (ImpSdXMLExpTransObj2DSkewY*)pObj;
+ delete static_cast<ImpSdXMLExpTransObj2DSkewY*>(pObj);
break;
}
case IMP_SDXMLEXP_TRANSOBJ2D_MATRIX :
{
- delete (ImpSdXMLExpTransObj2DMatrix*)pObj;
+ delete static_cast<ImpSdXMLExpTransObj2DMatrix*>(pObj);
break;
}
default :
@@ -308,39 +308,39 @@ const OUString& SdXMLImExTransform2D::GetExportString(const SvXMLUnitConverter&
case IMP_SDXMLEXP_TRANSOBJ2D_ROTATE :
{
aNewString += "rotate (";
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DRotate*)pObj)->mfRotate);
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj2DRotate*>(pObj)->mfRotate);
aNewString += aClosingBrace;
break;
}
case IMP_SDXMLEXP_TRANSOBJ2D_SCALE :
{
aNewString += "scale (";
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DScale*)pObj)->maScale.getX());
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj2DScale*>(pObj)->maScale.getX());
aNewString += aEmptySpace;
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DScale*)pObj)->maScale.getY());
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj2DScale*>(pObj)->maScale.getY());
aNewString += aClosingBrace;
break;
}
case IMP_SDXMLEXP_TRANSOBJ2D_TRANSLATE :
{
aNewString += "translate (";
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DTranslate*)pObj)->maTranslate.getX(), true);
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj2DTranslate*>(pObj)->maTranslate.getX(), true);
aNewString += aEmptySpace;
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DTranslate*)pObj)->maTranslate.getY(), true);
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj2DTranslate*>(pObj)->maTranslate.getY(), true);
aNewString += aClosingBrace;
break;
}
case IMP_SDXMLEXP_TRANSOBJ2D_SKEWX :
{
aNewString += "skewX (";
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DSkewX*)pObj)->mfSkewX);
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj2DSkewX*>(pObj)->mfSkewX);
aNewString += aClosingBrace;
break;
}
case IMP_SDXMLEXP_TRANSOBJ2D_SKEWY :
{
aNewString += "skewY (";
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DSkewY*)pObj)->mfSkewY);
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj2DSkewY*>(pObj)->mfSkewY);
aNewString += aClosingBrace;
break;
}
@@ -349,27 +349,27 @@ const OUString& SdXMLImExTransform2D::GetExportString(const SvXMLUnitConverter&
aNewString += "matrix (";
// a
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DMatrix*)pObj)->maMatrix.get(0, 0));
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj2DMatrix*>(pObj)->maMatrix.get(0, 0));
aNewString += aEmptySpace;
// b
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DMatrix*)pObj)->maMatrix.get(1, 0));
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj2DMatrix*>(pObj)->maMatrix.get(1, 0));
aNewString += aEmptySpace;
// c
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DMatrix*)pObj)->maMatrix.get(0, 1));
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj2DMatrix*>(pObj)->maMatrix.get(0, 1));
aNewString += aEmptySpace;
// d
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DMatrix*)pObj)->maMatrix.get(1, 1));
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj2DMatrix*>(pObj)->maMatrix.get(1, 1));
aNewString += aEmptySpace;
// e
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DMatrix*)pObj)->maMatrix.get(0, 2), true);
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj2DMatrix*>(pObj)->maMatrix.get(0, 2), true);
aNewString += aEmptySpace;
// f
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj2DMatrix*)pObj)->maMatrix.get(1, 2), true);
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj2DMatrix*>(pObj)->maMatrix.get(1, 2), true);
aNewString += aClosingBrace;
break;
@@ -546,34 +546,34 @@ void SdXMLImExTransform2D::GetFullTransform(::basegfx::B2DHomMatrix& rFullTrans)
// For the FileFormat there is a follow-up task (#i78698#) to fix this in the next
// ODF FileFormat version. For now - to emulate the old behaviour - it is necessary
// to mirror the value here
- rFullTrans.rotate(((ImpSdXMLExpTransObj2DRotate*)pObj)->mfRotate * -1.0);
+ rFullTrans.rotate(static_cast<ImpSdXMLExpTransObj2DRotate*>(pObj)->mfRotate * -1.0);
break;
}
case IMP_SDXMLEXP_TRANSOBJ2D_SCALE :
{
- const ::basegfx::B2DTuple& rScale = ((ImpSdXMLExpTransObj2DScale*)pObj)->maScale;
+ const ::basegfx::B2DTuple& rScale = static_cast<ImpSdXMLExpTransObj2DScale*>(pObj)->maScale;
rFullTrans.scale(rScale.getX(), rScale.getY());
break;
}
case IMP_SDXMLEXP_TRANSOBJ2D_TRANSLATE :
{
- const ::basegfx::B2DTuple& rTranslate = ((ImpSdXMLExpTransObj2DTranslate*)pObj)->maTranslate;
+ const ::basegfx::B2DTuple& rTranslate = static_cast<ImpSdXMLExpTransObj2DTranslate*>(pObj)->maTranslate;
rFullTrans.translate(rTranslate.getX(), rTranslate.getY());
break;
}
case IMP_SDXMLEXP_TRANSOBJ2D_SKEWX :
{
- rFullTrans.shearX(tan(((ImpSdXMLExpTransObj2DSkewX*)pObj)->mfSkewX));
+ rFullTrans.shearX(tan(static_cast<ImpSdXMLExpTransObj2DSkewX*>(pObj)->mfSkewX));
break;
}
case IMP_SDXMLEXP_TRANSOBJ2D_SKEWY :
{
- rFullTrans.shearY(tan(((ImpSdXMLExpTransObj2DSkewY*)pObj)->mfSkewY));
+ rFullTrans.shearY(tan(static_cast<ImpSdXMLExpTransObj2DSkewY*>(pObj)->mfSkewY));
break;
}
case IMP_SDXMLEXP_TRANSOBJ2D_MATRIX :
{
- rFullTrans *= ((ImpSdXMLExpTransObj2DMatrix*)pObj)->maMatrix;
+ rFullTrans *= static_cast<ImpSdXMLExpTransObj2DMatrix*>(pObj)->maMatrix;
break;
}
default :
@@ -655,32 +655,32 @@ void SdXMLImExTransform3D::EmptyList()
{
case IMP_SDXMLEXP_TRANSOBJ3D_ROTATE_X :
{
- delete (ImpSdXMLExpTransObj3DRotateX*)pObj;
+ delete static_cast<ImpSdXMLExpTransObj3DRotateX*>(pObj);
break;
}
case IMP_SDXMLEXP_TRANSOBJ3D_ROTATE_Y :
{
- delete (ImpSdXMLExpTransObj3DRotateY*)pObj;
+ delete static_cast<ImpSdXMLExpTransObj3DRotateY*>(pObj);
break;
}
case IMP_SDXMLEXP_TRANSOBJ3D_ROTATE_Z :
{
- delete (ImpSdXMLExpTransObj3DRotateZ*)pObj;
+ delete static_cast<ImpSdXMLExpTransObj3DRotateZ*>(pObj);
break;
}
case IMP_SDXMLEXP_TRANSOBJ3D_SCALE :
{
- delete (ImpSdXMLExpTransObj3DScale*)pObj;
+ delete static_cast<ImpSdXMLExpTransObj3DScale*>(pObj);
break;
}
case IMP_SDXMLEXP_TRANSOBJ3D_TRANSLATE :
{
- delete (ImpSdXMLExpTransObj3DTranslate*)pObj;
+ delete static_cast<ImpSdXMLExpTransObj3DTranslate*>(pObj);
break;
}
case IMP_SDXMLEXP_TRANSOBJ3D_MATRIX :
{
- delete (ImpSdXMLExpTransObj3DMatrix*)pObj;
+ delete static_cast<ImpSdXMLExpTransObj3DMatrix*>(pObj);
break;
}
default :
@@ -738,43 +738,43 @@ const OUString& SdXMLImExTransform3D::GetExportString(const SvXMLUnitConverter&
case IMP_SDXMLEXP_TRANSOBJ3D_ROTATE_X :
{
aNewString += "rotatex (";
- Imp_PutDoubleChar(aNewString, rConv, basegfx::rad2deg( ((ImpSdXMLExpTransObj3DRotateX*)pObj)->mfRotateX) );
+ Imp_PutDoubleChar(aNewString, rConv, basegfx::rad2deg( static_cast<ImpSdXMLExpTransObj3DRotateX*>(pObj)->mfRotateX) );
aNewString += aClosingBrace;
break;
}
case IMP_SDXMLEXP_TRANSOBJ3D_ROTATE_Y :
{
aNewString += "rotatey (";
- Imp_PutDoubleChar(aNewString, rConv, basegfx::rad2deg( ((ImpSdXMLExpTransObj3DRotateY*)pObj)->mfRotateY) );
+ Imp_PutDoubleChar(aNewString, rConv, basegfx::rad2deg( static_cast<ImpSdXMLExpTransObj3DRotateY*>(pObj)->mfRotateY) );
aNewString += aClosingBrace;
break;
}
case IMP_SDXMLEXP_TRANSOBJ3D_ROTATE_Z :
{
aNewString += "rotatez (";
- Imp_PutDoubleChar(aNewString, rConv, basegfx::rad2deg( ((ImpSdXMLExpTransObj3DRotateZ*)pObj)->mfRotateZ) );
+ Imp_PutDoubleChar(aNewString, rConv, basegfx::rad2deg( static_cast<ImpSdXMLExpTransObj3DRotateZ*>(pObj)->mfRotateZ) );
aNewString += aClosingBrace;
break;
}
case IMP_SDXMLEXP_TRANSOBJ3D_SCALE :
{
aNewString += "scale (";
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DScale*)pObj)->maScale.getX());
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj3DScale*>(pObj)->maScale.getX());
aNewString += aEmptySpace;
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DScale*)pObj)->maScale.getY());
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj3DScale*>(pObj)->maScale.getY());
aNewString += aEmptySpace;
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DScale*)pObj)->maScale.getZ());
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj3DScale*>(pObj)->maScale.getZ());
aNewString += aClosingBrace;
break;
}
case IMP_SDXMLEXP_TRANSOBJ3D_TRANSLATE :
{
aNewString += "translate (";
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DTranslate*)pObj)->maTranslate.getX(), true);
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj3DTranslate*>(pObj)->maTranslate.getX(), true);
aNewString += aEmptySpace;
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DTranslate*)pObj)->maTranslate.getY(), true);
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj3DTranslate*>(pObj)->maTranslate.getY(), true);
aNewString += aEmptySpace;
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DTranslate*)pObj)->maTranslate.getZ(), true);
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj3DTranslate*>(pObj)->maTranslate.getZ(), true);
aNewString += aClosingBrace;
break;
}
@@ -783,51 +783,51 @@ const OUString& SdXMLImExTransform3D::GetExportString(const SvXMLUnitConverter&
aNewString += "matrix (";
// a
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix.get(0, 0));
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj3DMatrix*>(pObj)->maMatrix.get(0, 0));
aNewString += aEmptySpace;
// b
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix.get(1, 0));
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj3DMatrix*>(pObj)->maMatrix.get(1, 0));
aNewString += aEmptySpace;
// c
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix.get(2, 0));
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj3DMatrix*>(pObj)->maMatrix.get(2, 0));
aNewString += aEmptySpace;
// d
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix.get(0, 1));
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj3DMatrix*>(pObj)->maMatrix.get(0, 1));
aNewString += aEmptySpace;
// e
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix.get(1, 1));
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj3DMatrix*>(pObj)->maMatrix.get(1, 1));
aNewString += aEmptySpace;
// f
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix.get(2, 1));
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj3DMatrix*>(pObj)->maMatrix.get(2, 1));
aNewString += aEmptySpace;
// g
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix.get(0, 2));
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj3DMatrix*>(pObj)->maMatrix.get(0, 2));
aNewString += aEmptySpace;
// h
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix.get(1, 2));
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj3DMatrix*>(pObj)->maMatrix.get(1, 2));
aNewString += aEmptySpace;
// i
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix.get(2, 2));
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj3DMatrix*>(pObj)->maMatrix.get(2, 2));
aNewString += aEmptySpace;
// j
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix.get(0, 3), true);
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj3DMatrix*>(pObj)->maMatrix.get(0, 3), true);
aNewString += aEmptySpace;
// k
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix.get(1, 3), true);
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj3DMatrix*>(pObj)->maMatrix.get(1, 3), true);
aNewString += aEmptySpace;
// l
- Imp_PutDoubleChar(aNewString, rConv, ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix.get(2, 3), true);
+ Imp_PutDoubleChar(aNewString, rConv, static_cast<ImpSdXMLExpTransObj3DMatrix*>(pObj)->maMatrix.get(2, 3), true);
aNewString += aClosingBrace;
break;
@@ -1070,34 +1070,34 @@ void SdXMLImExTransform3D::GetFullTransform(::basegfx::B3DHomMatrix& rFullTrans)
{
case IMP_SDXMLEXP_TRANSOBJ3D_ROTATE_X :
{
- rFullTrans.rotate(((ImpSdXMLExpTransObj3DRotateX*)pObj)->mfRotateX, 0.0, 0.0);
+ rFullTrans.rotate(static_cast<ImpSdXMLExpTransObj3DRotateX*>(pObj)->mfRotateX, 0.0, 0.0);
break;
}
case IMP_SDXMLEXP_TRANSOBJ3D_ROTATE_Y :
{
- rFullTrans.rotate(0.0, ((ImpSdXMLExpTransObj3DRotateY*)pObj)->mfRotateY, 0.0);
+ rFullTrans.rotate(0.0, static_cast<ImpSdXMLExpTransObj3DRotateY*>(pObj)->mfRotateY, 0.0);
break;
}
case IMP_SDXMLEXP_TRANSOBJ3D_ROTATE_Z :
{
- rFullTrans.rotate(0.0, 0.0, ((ImpSdXMLExpTransObj3DRotateZ*)pObj)->mfRotateZ);
+ rFullTrans.rotate(0.0, 0.0, static_cast<ImpSdXMLExpTransObj3DRotateZ*>(pObj)->mfRotateZ);
break;
}
case IMP_SDXMLEXP_TRANSOBJ3D_SCALE :
{
- const ::basegfx::B3DTuple& rScale = ((ImpSdXMLExpTransObj3DScale*)pObj)->maScale;
+ const ::basegfx::B3DTuple& rScale = static_cast<ImpSdXMLExpTransObj3DScale*>(pObj)->maScale;
rFullTrans.scale(rScale.getX(), rScale.getY(), rScale.getZ());
break;
}
case IMP_SDXMLEXP_TRANSOBJ3D_TRANSLATE :
{
- const ::basegfx::B3DTuple& rTranslate = ((ImpSdXMLExpTransObj3DTranslate*)pObj)->maTranslate;
+ const ::basegfx::B3DTuple& rTranslate = static_cast<ImpSdXMLExpTransObj3DTranslate*>(pObj)->maTranslate;
rFullTrans.translate(rTranslate.getX(), rTranslate.getY(), rTranslate.getZ());
break;
}
case IMP_SDXMLEXP_TRANSOBJ3D_MATRIX :
{
- rFullTrans *= ((ImpSdXMLExpTransObj3DMatrix*)pObj)->maMatrix;
+ rFullTrans *= static_cast<ImpSdXMLExpTransObj3DMatrix*>(pObj)->maMatrix;
break;
}
default :
diff --git a/xmloff/source/draw/ximp3dscene.cxx b/xmloff/source/draw/ximp3dscene.cxx
index f1dc679..ce1d863 100644
--- a/xmloff/source/draw/ximp3dscene.cxx
+++ b/xmloff/source/draw/ximp3dscene.cxx
@@ -234,7 +234,7 @@ SvXMLImportContext * SdXML3DSceneAttributesHelper::create3DLightContext( sal_uIn
if(pContext)
{
pContext->AddRef();
- maList.push_back( (SdXML3DLightContext*)pContext );
+ maList.push_back( static_cast<SdXML3DLightContext*>(pContext) );
}
return pContext;
diff --git a/xmloff/source/draw/ximp3dscene.hxx b/xmloff/source/draw/ximp3dscene.hxx
index bbdfac7..b2fd872 100644
--- a/xmloff/source/draw/ximp3dscene.hxx
+++ b/xmloff/source/draw/ximp3dscene.hxx
@@ -35,8 +35,8 @@ class SdXML3DSceneShapeContext : public SdXMLShapeContext, public SdXML3DSceneAt
// this is the scene at the same time
com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > mxChildren;
- const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
- SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
+ const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
+ SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
protected:
void SetLocalShapesContext(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rNew)
diff --git a/xmloff/source/draw/ximpbody.hxx b/xmloff/source/draw/ximpbody.hxx
index 0a0cb16..c57638d 100644
--- a/xmloff/source/draw/ximpbody.hxx
+++ b/xmloff/source/draw/ximpbody.hxx
@@ -53,8 +53,8 @@ public:
class SdXMLBodyContext : public SvXMLImportContext
{
- const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
- SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
+ const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
+ SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
public:
SdXMLBodyContext( SdXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName );
diff --git a/xmloff/source/draw/ximppage.cxx b/xmloff/source/draw/ximppage.cxx
index 11a5a16..a3e2bb9 100644
--- a/xmloff/source/draw/ximppage.cxx
+++ b/xmloff/source/draw/ximppage.cxx
@@ -355,7 +355,7 @@ void SdXMLGenericPageContext::SetStyle( OUString& rStyleName )
if( pContext && pContext->ISA( SvXMLStyleContext ) )
{
- const SdXMLStylesContext* pStyles = (SdXMLStylesContext*)pContext;
+ const SdXMLStylesContext* pStyles = static_cast<const SdXMLStylesContext*>(pContext);
if(pStyles)
{
const SvXMLStyleContext* pStyle = pStyles->FindStyleChildContext(
@@ -363,7 +363,7 @@ void SdXMLGenericPageContext::SetStyle( OUString& rStyleName )
if(pStyle && pStyle->ISA(XMLPropStyleContext))
{
- XMLPropStyleContext* pPropStyle = (XMLPropStyleContext*)pStyle;
+ const XMLPropStyleContext* pPropStyle = static_cast<const XMLPropStyleContext*>(pStyle);
Reference <beans::XPropertySet> xPropSet1(mxShapes, uno::UNO_QUERY);
if(xPropSet1.is())
@@ -392,7 +392,7 @@ void SdXMLGenericPageContext::SetStyle( OUString& rStyleName )
if(xPropSet.is())
{
- pPropStyle->FillPropertySet(xPropSet);
+ const_cast<XMLPropStyleContext*>(pPropStyle)->FillPropertySet(xPropSet);
if( xBackgroundSet.is() )
xPropSet1->setPropertyValue( aBackground, uno::makeAny( xBackgroundSet ) );
@@ -420,14 +420,14 @@ void SdXMLGenericPageContext::SetLayout()
if( pContext && pContext->ISA( SvXMLStyleContext ) )
{
- const SdXMLStylesContext* pStyles = (SdXMLStylesContext*)pContext;
+ const SdXMLStylesContext* pStyles = static_cast<const SdXMLStylesContext*>(pContext);
if(pStyles)
{
const SvXMLStyleContext* pStyle = pStyles->FindStyleChildContext( XML_STYLE_FAMILY_SD_PRESENTATIONPAGELAYOUT_ID, maPageLayoutName);
if(pStyle && pStyle->ISA(SdXMLPresentationPageLayoutContext))
{
- SdXMLPresentationPageLayoutContext* pLayout = (SdXMLPresentationPageLayoutContext*)pStyle;
+ const SdXMLPresentationPageLayoutContext* pLayout = static_cast<const SdXMLPresentationPageLayoutContext*>(pStyle);
nType = pLayout->GetTypeId();
}
}
@@ -489,7 +489,7 @@ void SdXMLGenericPageContext::SetPageMaster( OUString& rsPageMasterName )
if(pStyle && pStyle->ISA(SdXMLPageMasterContext))
{
- const SdXMLPageMasterContext* pPageMaster = (SdXMLPageMasterContext*)pStyle;
+ const SdXMLPageMasterContext* pPageMaster = static_cast<const SdXMLPageMasterContext*>(pStyle);
const SdXMLPageMasterStyleContext* pPageMasterContext = pPageMaster->GetPageMasterStyle();
if(pPageMasterContext)
diff --git a/xmloff/source/draw/ximppage.hxx b/xmloff/source/draw/ximppage.hxx
index 52cf4cc..de944c8 100644
--- a/xmloff/source/draw/ximppage.hxx
+++ b/xmloff/source/draw/ximppage.hxx
@@ -55,8 +55,8 @@ protected:
/** deletes all shapes on this drawing page */
void DeleteAllShapes();
- const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
- SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
+ const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
+ SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
/** sets the properties from a page master style with the given name on this contexts page */
void SetPageMaster( OUString& rsPageMasterName );
diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx
index 83c2c48..3e3ddd3 100644
--- a/xmloff/source/draw/ximpstyl.cxx
+++ b/xmloff/source/draw/ximpstyl.cxx
@@ -439,7 +439,7 @@ SvXMLImportContext *SdXMLPageMasterContext::CreateChildContext(
{
pContext->AddRef();
DBG_ASSERT(!mpPageMasterStyle, "PageMasterStyle is set, there seem to be two of them (!)");
- mpPageMasterStyle = (SdXMLPageMasterStyleContext*)pContext;
+ mpPageMasterStyle = static_cast<SdXMLPageMasterStyleContext*>(pContext);
}
}
@@ -498,7 +498,7 @@ SvXMLImportContext *SdXMLPresentationPageLayoutContext::CreateChildContext(
if(pContext)
{
pContext->AddRef();
- maList.push_back( (SdXMLPresentationPlaceholderContext*)pContext );
+ maList.push_back( static_cast<SdXMLPresentationPlaceholderContext*>(pContext) );
}
}
@@ -885,7 +885,7 @@ void SdXMLMasterPageContext::EndElement()
{
SvXMLImportContext* pContext = GetSdImport().GetShapeImport()->GetStylesContext();
if( pContext && pContext->ISA( SvXMLStyleContext ) )
- ((SdXMLStylesContext*)pContext)->SetMasterPageStyles(*this);
+ static_cast<SdXMLStylesContext*>(pContext)->SetMasterPageStyles(*this);
}
SdXMLGenericPageContext::EndElement();
@@ -1160,7 +1160,7 @@ void SdXMLStylesContext::EndElement()
const SvXMLStyleContext* pStyle = GetStyle(a);
if(pStyle && pStyle->ISA(XMLShapeStyleContext))
{
- XMLShapeStyleContext* pDocStyle = (XMLShapeStyleContext*)pStyle;
+ const XMLShapeStyleContext* pDocStyle = static_cast<const XMLShapeStyleContext*>(pStyle);
SvXMLStylesContext* pStylesContext = GetSdImport().GetShapeImport()->GetStylesContext();
if( pStylesContext )
@@ -1169,10 +1169,10 @@ void SdXMLStylesContext::EndElement()
if(pStyle && pStyle->ISA(XMLShapeStyleContext))
{
- XMLShapeStyleContext* pParentStyle = (XMLShapeStyleContext*)pStyle;
+ const XMLShapeStyleContext* pParentStyle = static_cast<const XMLShapeStyleContext*>(pStyle);
if(pParentStyle->GetStyle().is())
{
- pDocStyle->SetStyle(pParentStyle->GetStyle());
+ const_cast<XMLShapeStyleContext*>(pDocStyle)->SetStyle(pParentStyle->GetStyle());
}
}
}
@@ -1469,7 +1469,7 @@ uno::Reference< container::XNameAccess > SdXMLStylesContext::getPageLayouts() co
if(pStyle && pStyle->ISA(SdXMLPresentationPageLayoutContext))
{
xLayouts->insertByName( pStyle->GetName(), uno::makeAny(
- (sal_Int32)((SdXMLPresentationPageLayoutContext*)pStyle)->GetTypeId() ) );
+ (sal_Int32)static_cast<const SdXMLPresentationPageLayoutContext*>(pStyle)->GetTypeId() ) );
}
}
@@ -1535,7 +1535,7 @@ SvXMLImportContext* SdXMLMasterStylesContext::CreateChildContext(
if(pContext)
{
pContext->AddRef();
- maMasterPageList.push_back( (SdXMLMasterPageContext*)pContext );
+ maMasterPageList.push_back( static_cast<SdXMLMasterPageContext*>(pContext) );
}
}
}
diff --git a/xmloff/source/draw/ximpstyl.hxx b/xmloff/source/draw/ximpstyl.hxx
index 6f88a0a..b1a6938 100644
--- a/xmloff/source/draw/ximpstyl.hxx
+++ b/xmloff/source/draw/ximpstyl.hxx
@@ -42,8 +42,8 @@ class SdXMLPageMasterStyleContext: public SvXMLStyleContext
sal_Int32 mnHeight;
com::sun::star::view::PaperOrientation meOrientation;
- const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
- SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
+ const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
+ SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
public:
TYPEINFO_OVERRIDE();
@@ -71,8 +71,8 @@ class SdXMLPageMasterContext: public SvXMLStyleContext
OUString msName;
SdXMLPageMasterStyleContext*mpPageMasterStyle;
- const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
- SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
+ const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
+ SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
public:
TYPEINFO_OVERRIDE();
@@ -135,8 +135,8 @@ class SdXMLPresentationPlaceholderContext: public SvXMLImportContext
sal_Int32 mnWidth;
sal_Int32 mnHeight;
- const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
- SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
+ const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
+ SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
public:
SdXMLPresentationPlaceholderContext(
@@ -162,8 +162,8 @@ class SdXMLPresentationPageLayoutContext: public SvXMLStyleContext
ImpPlaceholderList maList;
sal_uInt16 mnTypeId;
- const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
- SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
+ const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
+ SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
public:
TYPEINFO_OVERRIDE();
@@ -192,8 +192,8 @@ class SdXMLStylesContext : public SvXMLStylesContext
SvXMLNumFmtHelper* mpNumFmtHelper;
SvNumberFormatter* mpNumFormatter;
- const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
- SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
+ const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
+ SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
void ImpSetGraphicStyles() const;
void ImpSetCellStyles() const;
@@ -243,8 +243,8 @@ class SdXMLMasterStylesContext : public SvXMLImportContext
{
ImpMasterPageList maMasterPageList;
- const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
- SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }
+ const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
+ SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
public:
TYPEINFO_OVERRIDE();
diff --git a/xmloff/source/style/XMLFontStylesContext_impl.hxx b/xmloff/source/style/XMLFontStylesContext_impl.hxx
index 9f8edec..3938aa6 100644
--- a/xmloff/source/style/XMLFontStylesContext_impl.hxx
+++ b/xmloff/source/style/XMLFontStylesContext_impl.hxx
@@ -35,7 +35,7 @@ class XMLFontStyleContextFontFace : public SvXMLStyleContext
XMLFontStylesContext *GetStyles()
{
- return ((XMLFontStylesContext *)&xStyles);
+ return static_cast<XMLFontStylesContext *>(&xStyles);
}
public:
diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx
index 77a2fcf..a8c5aa4 100644
--- a/xmloff/source/style/prstylei.cxx
+++ b/xmloff/source/style/prstylei.cxx
@@ -57,7 +57,7 @@ void XMLPropStyleContext::SetAttribute( sal_uInt16 nPrefixKey,
{
if( XML_NAMESPACE_STYLE == nPrefixKey && IsXMLToken( rLocalName, XML_FAMILY ) )
{
- DBG_ASSERT( GetFamily() == ((SvXMLStylesContext *)&mxStyles)->GetFamily( rValue ), "unexpected style family" );
+ DBG_ASSERT( GetFamily() == static_cast<SvXMLStylesContext *>(&mxStyles)->GetFamily( rValue ), "unexpected style family" );
}
else
{
@@ -193,7 +193,7 @@ SvXMLImportContext *XMLPropStyleContext::CreateChildContext(
if( nFamily )
{
rtl::Reference < SvXMLImportPropertyMapper > xImpPrMap =
- ((SvXMLStylesContext *)&mxStyles)->GetImportPropertyMapper(
+ static_cast<SvXMLStylesContext *>(&mxStyles)->GetImportPropertyMapper(
GetFamily() );
if( xImpPrMap.is() )
pContext = new SvXMLPropertySetContext( GetImport(), nPrefix,
@@ -214,7 +214,7 @@ void XMLPropStyleContext::FillPropertySet(
const Reference< XPropertySet > & rPropSet )
{
rtl::Reference < SvXMLImportPropertyMapper > xImpPrMap =
- ((SvXMLStylesContext *)&mxStyles)->GetImportPropertyMapper(
+ static_cast<SvXMLStylesContext *>(&mxStyles)->GetImportPropertyMapper(
GetFamily() );
DBG_ASSERT( xImpPrMap.is(), "There is the import prop mapper" );
if( xImpPrMap.is() )
@@ -230,7 +230,7 @@ Reference < XStyle > XMLPropStyleContext::Create()
Reference < XStyle > xNewStyle;
OUString sServiceName(
- ((SvXMLStylesContext *)&mxStyles)->GetServiceName( GetFamily() ) );
+ static_cast<SvXMLStylesContext *>(&mxStyles)->GetServiceName( GetFamily() ) );
if( !sServiceName.isEmpty() )
{
Reference< XMultiServiceFactory > xFactory( GetImport().GetModel(),
@@ -438,7 +438,7 @@ void XMLPropStyleContext::Finish( bool bOverwrite )
{
// The families cintaner must exist
Reference < XNameContainer > xFamilies =
- ((SvXMLStylesContext *)&mxStyles)->GetStylesContainer( GetFamily() );
+ static_cast<SvXMLStylesContext *>(&mxStyles)->GetStylesContainer( GetFamily() );
DBG_ASSERT( xFamilies.is(), "Families lost" );
if( !xFamilies.is() )
return;
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index 35778d4..6c9b3f0 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -1568,8 +1568,8 @@ sal_Int32 SvXMLNumFormatContext::CreateAndInsert(SvNumberFormatter* pFormatter)
for (sal_uInt32 i = 0; i < aMyConditions.size(); i++)
{
- SvXMLNumFormatContext* pStyle = (SvXMLNumFormatContext *)pStyles->FindStyleChildContext(
- XML_STYLE_FAMILY_DATA_STYLE, aMyConditions[i].sMapName, false);
+ SvXMLNumFormatContext* pStyle = const_cast<SvXMLNumFormatContext*>( static_cast<const SvXMLNumFormatContext *>(pStyles->FindStyleChildContext(
+ XML_STYLE_FAMILY_DATA_STYLE, aMyConditions[i].sMapName, false)));
if (pStyle)
{
if ((pStyle->PrivateGetKey() > -1)) // don't reset pStyle's bRemoveAfterUse flag
diff --git a/xmloff/source/text/XMLIndexTOCContext.cxx b/xmloff/source/text/XMLIndexTOCContext.cxx
index 0054d6e..e674dac 100644
--- a/xmloff/source/text/XMLIndexTOCContext.cxx
+++ b/xmloff/source/text/XMLIndexTOCContext.cxx
@@ -268,7 +268,7 @@ void XMLIndexTOCContext::EndElement()
// get rid of last paragraph (unless it's the only paragraph)
rHelper->GetCursor()->goRight(1, sal_False);
if( xBodyContextRef.Is() &&
- ((XMLIndexBodyContext*)&xBodyContextRef)->HasContent() )
+ static_cast<XMLIndexBodyContext*>(&xBodyContextRef)->HasContent() )
{
rHelper->GetCursor()->goLeft(1, sal_True);
rHelper->GetText()->insertString(rHelper->GetCursorAsRange(),
@@ -301,7 +301,7 @@ SvXMLImportContext* XMLIndexTOCContext::CreateChildContext(
pContext = new XMLIndexBodyContext(GetImport(), nPrefix,
rLocalName);
if ( !xBodyContextRef.Is() ||
- !((XMLIndexBodyContext*)&xBodyContextRef)->HasContent() )
+ !static_cast<XMLIndexBodyContext*>(&xBodyContextRef)->HasContent() )
{
xBodyContextRef = pContext;
}
diff --git a/xmloff/source/text/XMLTextListBlockContext.cxx b/xmloff/source/text/XMLTextListBlockContext.cxx
index ec0c918..25bab0e 100644
--- a/xmloff/source/text/XMLTextListBlockContext.cxx
+++ b/xmloff/source/text/XMLTextListBlockContext.cxx
@@ -75,7 +75,7 @@ XMLTextListBlockContext::XMLTextListBlockContext(
if( mxParentListBlock.Is() )
{
XMLTextListBlockContext *pParent =
- (XMLTextListBlockContext *)&mxParentListBlock;
+ static_cast<XMLTextListBlockContext *>(&mxParentListBlock);
msListStyleName = pParent->GetListStyleName();
sParentListStyleName = msListStyleName;
mxNumRules = pParent->GetNumRules();
@@ -240,7 +240,7 @@ void XMLTextListBlockContext::EndElement()
// Numbering has not to be restarted if it has been restarted within
// a child list.
XMLTextListBlockContext *pParent =
- (XMLTextListBlockContext *)&mxParentListBlock;
+ static_cast<XMLTextListBlockContext *>(&mxParentListBlock);
if( pParent )
{
pParent->mbRestartNumbering = mbRestartNumbering;
diff --git a/xmloff/source/text/XMLTextShapeStyleContext.cxx b/xmloff/source/text/XMLTextShapeStyleContext.cxx
index 4e29e07..a59f200 100644
--- a/xmloff/source/text/XMLTextShapeStyleContext.cxx
+++ b/xmloff/source/text/XMLTextShapeStyleContext.cxx
@@ -224,7 +224,7 @@ void XMLTextShapeStyleContext::CreateAndInsert( bool bOverwrite )
{
// set event suppplier and release reference to context
Reference<XEventsSupplier> xEventsSupplier(xStyle, UNO_QUERY);
- ((XMLEventsImportContext *)&xEventContext)->SetEvents(xEventsSupplier);
+ static_cast<XMLEventsImportContext *>(&xEventContext)->SetEvents(xEventsSupplier);
xEventContext = 0;
}
}
diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx
index dbf3f09..9136135 100644
--- a/xmloff/source/text/txtfldi.cxx
+++ b/xmloff/source/text/txtfldi.cxx
@@ -2760,7 +2760,7 @@ void XMLMacroFieldImportContext::PrepareField(
{
// get event sequence
XMLEventsImportContext* pEvents =
- (XMLEventsImportContext*)&xEventContext;
+ static_cast<XMLEventsImportContext*>(&xEventContext);
Sequence<PropertyValue> aValues;
pEvents->GetEventSequence( sOnClick, aValues );
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index 52756671..8c95406 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -1221,7 +1221,7 @@ OUString XMLTextImportHelper::ConvertStarFonts( const OUString& rChars,
if (!rStyleName.isEmpty() && m_pImpl->m_xAutoStyles.Is())
{
const SvXMLStyleContext* pTempStyle =
- ((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
+ static_cast<SvXMLStylesContext *>(&m_pImpl->m_xAutoStyles)->
FindStyleChildContext( nFamily, rStyleName,
true );
pStyle = const_cast<XMLTextStyleContext*>(PTR_CAST( XMLTextStyleContext,pTempStyle));
@@ -1233,7 +1233,7 @@ OUString XMLTextImportHelper::ConvertStarFonts( const OUString& rChars,
if( nCount )
{
rtl::Reference < SvXMLImportPropertyMapper > xImpPrMap =
- ((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)
+ static_cast<SvXMLStylesContext *>(&m_pImpl->m_xAutoStyles)
->GetImportPropertyMapper(nFamily);
if( xImpPrMap.is() )
{
@@ -1431,7 +1431,7 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
if (!sStyleName.isEmpty() && m_pImpl->m_xAutoStyles.Is())
{
const SvXMLStyleContext* pTempStyle =
- ((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
+ static_cast<SvXMLStylesContext *>(&m_pImpl->m_xAutoStyles)->
FindStyleChildContext( nFamily, sStyleName, true );
pStyle = const_cast<XMLTextStyleContext*>(PTR_CAST( XMLTextStyleContext,pTempStyle));
}
@@ -2117,7 +2117,7 @@ void XMLTextImportHelper::SetRuby(
if (!rStyleName.isEmpty() && m_pImpl->m_xAutoStyles.Is())
{
const SvXMLStyleContext* pTempStyle =
- ((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
+ static_cast<SvXMLStylesContext *>(&m_pImpl->m_xAutoStyles)->
FindStyleChildContext( XML_STYLE_FAMILY_TEXT_RUBY,
rStyleName, true );
pStyle = const_cast<XMLPropStyleContext*>(PTR_CAST(XMLPropStyleContext,pTempStyle));
@@ -2351,7 +2351,7 @@ sal_Int32 XMLTextImportHelper::GetDataStyleKey(const OUString& sStyleName,
bool* pIsSystemLanguage )
{
const SvXMLStyleContext* pStyle =
- ((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
+ static_cast<SvXMLStylesContext *>(&m_pImpl->m_xAutoStyles)->
FindStyleChildContext( XML_STYLE_FAMILY_DATA_STYLE,
sStyleName, true );
@@ -2387,7 +2387,7 @@ const SvxXMLListStyleContext *XMLTextImportHelper::FindAutoListStyle( const OUSt
if (m_pImpl->m_xAutoStyles.Is())
{
const SvXMLStyleContext* pTempStyle =
- ((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
+ static_cast<SvXMLStylesContext *>(&m_pImpl->m_xAutoStyles)->
FindStyleChildContext( XML_STYLE_FAMILY_TEXT_LIST, rName,
true );
pStyle = PTR_CAST( SvxXMLListStyleContext ,pTempStyle);
@@ -2402,7 +2402,7 @@ XMLPropStyleContext *XMLTextImportHelper::FindAutoFrameStyle( const OUString& rN
if (m_pImpl->m_xAutoStyles.Is())
{
const SvXMLStyleContext* pTempStyle =
- ((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
+ static_cast<SvXMLStylesContext *>(&m_pImpl->m_xAutoStyles)->
FindStyleChildContext( XML_STYLE_FAMILY_SD_GRAPHICS_ID, rName,
true );
pStyle = const_cast<XMLPropStyleContext*>(PTR_CAST( XMLPropStyleContext ,pTempStyle));
@@ -2418,7 +2418,7 @@ XMLPropStyleContext* XMLTextImportHelper::FindSectionStyle(
if (m_pImpl->m_xAutoStyles.Is())
{
const SvXMLStyleContext* pTempStyle =
- ((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
+ static_cast<SvXMLStylesContext *>(&m_pImpl->m_xAutoStyles)->
FindStyleChildContext(
XML_STYLE_FAMILY_TEXT_SECTION,
rName, true );
@@ -2435,7 +2435,7 @@ XMLPropStyleContext* XMLTextImportHelper::FindPageMaster(
if (m_pImpl->m_xAutoStyles.Is())
{
const SvXMLStyleContext* pTempStyle =
- ((SvXMLStylesContext *)&m_pImpl->m_xAutoStyles)->
+ static_cast<SvXMLStylesContext *>(&m_pImpl->m_xAutoStyles)->
FindStyleChildContext(
XML_STYLE_FAMILY_PAGE_MASTER,
rName, true );
diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx
index a7b94e4..3aefc78 100644
--- a/xmloff/source/text/txtparai.cxx
+++ b/xmloff/source/text/txtparai.cxx
@@ -256,7 +256,7 @@ XMLEndReferenceContext_Impl::XMLEndReferenceContext_Impl(
{
XMLHint_Impl *pHint = &rHints[nPos];
if ( pHint->IsReference() &&
- sName.equals( ((XMLReferenceHint_Impl *)pHint)->GetRefName()) )
+ sName.equals( static_cast<XMLReferenceHint_Impl *>(pHint)->GetRefName()) )
{
// set end and stop searching
pHint->SetEnd(GetImport().GetTextImport()->
@@ -1127,7 +1127,7 @@ void XMLIndexMarkImportContext_Impl::StartElement(
XMLHint_Impl *pHint = &rHints[nPos];
if ( pHint->IsIndexMark() &&
sID.equals(
- ((XMLIndexMarkHint_Impl *)pHint)->GetID()) )
+ static_cast<XMLIndexMarkHint_Impl *>(pHint)->GetID()) )
{
// set end and stop searching
pHint->SetEnd(xPos);
@@ -2086,7 +2086,7 @@ XMLParaContext::~XMLParaContext()
case XML_HINT_STYLE:
{
const OUString& rStyleName =
- ((XMLStyleHint_Impl *)pHint)->GetStyleName();
+ static_cast<XMLStyleHint_Impl *>(pHint)->GetStyleName();
if( !rStyleName.isEmpty() )
xTxtImport->SetStyleAndAttrs( GetImport(),
xAttrCursor, rStyleName,
@@ -2096,7 +2096,7 @@ XMLParaContext::~XMLParaContext()
case XML_HINT_REFERENCE:
{
const OUString& rRefName =
- ((XMLReferenceHint_Impl *)pHint)->GetRefName();
+ static_cast<XMLReferenceHint_Impl *>(pHint)->GetRefName();
if( !rRefName.isEmpty() )
{
if( !pHint->GetEnd().is() )
@@ -2115,7 +2115,7 @@ XMLParaContext::~XMLParaContext()
case XML_HINT_HYPERLINK:
{
const XMLHyperlinkHint_Impl *pHHint =
- (const XMLHyperlinkHint_Impl *)pHint;
+ static_cast<const XMLHyperlinkHint_Impl *>(pHint);
xTxtImport->SetHyperlink( GetImport(),
xAttrCursor,
pHHint->GetHRef(),
@@ -2129,7 +2129,7 @@ XMLParaContext::~XMLParaContext()
case XML_HINT_INDEX_MARK:
{
Reference<beans::XPropertySet> xMark(
- ((const XMLIndexMarkHint_Impl *)pHint)->GetMark());
+ static_cast<const XMLIndexMarkHint_Impl *>(pHint)->GetMark());
Reference<XTextContent> xContent(xMark, UNO_QUERY);
xTxtImport->GetText()->insertTextContent(
xAttrCursor, xContent, sal_True );
@@ -2138,7 +2138,7 @@ XMLParaContext::~XMLParaContext()
case XML_HINT_TEXT_FRAME:
{
const XMLTextFrameHint_Impl *pFHint =
- (const XMLTextFrameHint_Impl *)pHint;
+ static_cast<const XMLTextFrameHint_Impl *>(pHint);
// Check for text content (#i33242#)
Reference < XTextContent > xTextContent =
pFHint->GetTextContent();
commit e5bf214ebb58637d1af89ea137c8952a46f14ef4
Author: Noel Grandin <noel at peralex.com>
Date: Wed Oct 1 11:11:44 2014 +0200
loplugin: cstylecast
Change-Id: I6ea98852ba775d85ccd54823b67224ea7f587c65
diff --git a/extensions/source/logging/logger.cxx b/extensions/source/logging/logger.cxx
index 6d7c3f8..d185ee6 100644
--- a/extensions/source/logging/logger.cxx
+++ b/extensions/source/logging/logger.cxx
@@ -301,7 +301,7 @@ namespace logging
::osl::MutexGuard aGuard( m_aMutex );
WeakReference< XLogger >& rLogger( m_aImpl[ _rName ] );
- Reference< XLogger > xLogger( (Reference< XLogger >)rLogger );
+ Reference< XLogger > xLogger( rLogger );
if ( !xLogger.is() )
{
// never requested before, or already dead
diff --git a/extensions/source/plugin/base/multiplx.cxx b/extensions/source/plugin/base/multiplx.cxx
index 1411ead..54ca001 100644
--- a/extensions/source/plugin/base/multiplx.cxx
+++ b/extensions/source/plugin/base/multiplx.cxx
@@ -185,7 +185,7 @@ if( pCont ) \
{ \
if( aIt.hasMoreElements() ) \
{ \
- InterfaceName * pListener = (InterfaceName *)aIt.next(); \
+ InterfaceName * pListener = static_cast<InterfaceName *>(aIt.next()); \
try \
{ \
pListener->MethodName( aEvt ); \
diff --git a/extensions/source/plugin/base/nfuncs.cxx b/extensions/source/plugin/base/nfuncs.cxx
index c5d25be..9adcf37 100644
--- a/extensions/source/plugin/base/nfuncs.cxx
+++ b/extensions/source/plugin/base/nfuncs.cxx
@@ -424,7 +424,7 @@ extern "C" {
if( ! pStream || pStream->getStreamType() != InputStream )
return NPERR_FILE_NOT_FOUND;
- PluginInputStream* pInputStream = (PluginInputStream*)pStream;
+ PluginInputStream* pInputStream = static_cast<PluginInputStream*>(pStream);
boost::scoped_array<sal_Int8> pBytes;
int nBytes = 0;
pPlugin->enterPluginCallback();
@@ -534,7 +534,7 @@ int32_t SAL_CALL NP_LOADDS NPN_Write( NPP instance, NPStream* stream, int32_t l
pImpl->enterPluginCallback();
::com::sun::star::uno::Sequence<sal_Int8> Bytes( (sal_Int8*)buffer, len );
- ((PluginOutputStream*)pStream)->getOutputStream()->writeBytes( Bytes );
+ static_cast<PluginOutputStream*>(pStream)->getOutputStream()->writeBytes( Bytes );
pImpl->leavePluginCallback();
return len;
diff --git a/extensions/source/plugin/base/xplugin.cxx b/extensions/source/plugin/base/xplugin.cxx
index bf201a6..4386de4 100644
--- a/extensions/source/plugin/base/xplugin.cxx
+++ b/extensions/source/plugin/base/xplugin.cxx
@@ -573,7 +573,7 @@ void XPlugin_Impl::loadPlugin()
if (pEnvData->pDisplay) // headless?
{
XSync( (Display*)pEnvData->pDisplay, False );
- m_aNPWindow.window = (void*)pEnvData->aWindow;
+ m_aNPWindow.window = reinterpret_cast<void*>(pEnvData->aWindow);
}
else
{
diff --git a/extensions/source/propctrlr/cellbindinghelper.cxx b/extensions/source/propctrlr/cellbindinghelper.cxx
index b14ddcf..4e4684b 100644
--- a/extensions/source/propctrlr/cellbindinghelper.cxx
+++ b/extensions/source/propctrlr/cellbindinghelper.cxx
@@ -115,8 +115,8 @@ namespace pcr
while ( ( xParentAsForm.is() || xParentAsGrid.is() ) && xCheck.is() )
{
xCheck.set(xCheck->getParent(), css::uno::UNO_QUERY);
- xParentAsForm.set(xCheck.is() ? xCheck->getParent() : (Reference< XInterface >) Reference< XForm >(), css::uno::UNO_QUERY);
- xParentAsGrid.set(xCheck.is() ? xCheck->getParent() : (Reference< XInterface >) Reference< XGridColumnFactory >(), css::uno::UNO_QUERY);
+ xParentAsForm.set(xCheck.is() ? xCheck->getParent() : Reference< XForm >(), css::uno::UNO_QUERY);
+ xParentAsGrid.set(xCheck.is() ? xCheck->getParent() : Reference< XGridColumnFactory >(), css::uno::UNO_QUERY);
}
Reference< XInterface > xFormsCollection( xCheck.is() ? xCheck->getParent() : Reference< XInterface >() );
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index 6b2b1f8..cebf429 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -565,7 +565,7 @@ namespace pcr
else
{
INetURLObject aDocURL( impl_getDocumentURL_nothrow() );
- aPropertyValue <<= (OUString)URIHelper::SmartRel2Abs( aDocURL, sControlValue, Link(), false, true, INetURLObject::WAS_ENCODED, INetURLObject::DECODE_TO_IURI );
+ aPropertyValue <<= URIHelper::SmartRel2Abs( aDocURL, sControlValue, Link(), false, true, INetURLObject::WAS_ENCODED, INetURLObject::DECODE_TO_IURI );
}
}
break;
@@ -2800,7 +2800,7 @@ namespace pcr
bool bSuccess = ( 0 == aFileDlg.Execute() );
if ( bSuccess )
{
- _out_rNewValue <<= (OUString)aFileDlg.GetPath();
+ _out_rNewValue <<= aFileDlg.GetPath();
}
return bSuccess;
}
@@ -2822,7 +2822,7 @@ namespace pcr
_rClearBeforeDialog.clear();
bool bSuccess = ( 0 == aFileDlg.Execute() );
if ( bSuccess )
- _out_rNewValue <<= (OUString)aFileDlg.GetPath();
+ _out_rNewValue <<= aFileDlg.GetPath();
return bSuccess;
}
@@ -2885,7 +2885,7 @@ namespace pcr
_rClearBeforeDialog.clear();
bool bSuccess = ( 0 == aFileDlg.Execute() );
if ( bSuccess )
- _out_rNewValue <<= (OUString)aFileDlg.GetPath();
+ _out_rNewValue <<= aFileDlg.GetPath();
return bSuccess;
}
diff --git a/extensions/source/propctrlr/propertyhandler.cxx b/extensions/source/propctrlr/propertyhandler.cxx
index 6ac121a..5c0927f 100644
--- a/extensions/source/propctrlr/propertyhandler.cxx
+++ b/extensions/source/propctrlr/propertyhandler.cxx
@@ -112,7 +112,7 @@ namespace pcr
m_aSupportedProperties = doDescribeSupportedProperties();
m_bSupportedPropertiesAreKnown = true;
}
- return (Sequence< Property >)m_aSupportedProperties;
+ return m_aSupportedProperties;
}
Sequence< OUString > SAL_CALL PropertyHandler::getSupersededProperties( ) throw (RuntimeException, std::exception)
diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx
index 2e22d16..c7f51d7 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -674,7 +674,7 @@ namespace pcr
if ( pItem )
{
DBG_ASSERT(pItem->ISA(SvxColorListItem), "OColorControl::OColorControl: invalid color item!");
- pColorList = ( (SvxColorListItem*)pItem )->GetColorList();
+ pColorList = static_cast<const SvxColorListItem*>( pItem )->GetColorList();
}
if ( !pColorList.is() )
diff --git a/extensions/source/propctrlr/taborder.cxx b/extensions/source/propctrlr/taborder.cxx
index 554c069..fb28ed3 100644
--- a/extensions/source/propctrlr/taborder.cxx
+++ b/extensions/source/propctrlr/taborder.cxx
@@ -318,7 +318,7 @@ namespace pcr
{
SvTreeListBox::ModelHasMoved( _pSource );
- ((TabOrderDialog*)GetParentDialog())->SetModified();
+ static_cast<TabOrderDialog*>(GetParentDialog())->SetModified();
}
@@ -328,7 +328,7 @@ namespace pcr
Image aImage;
for (long i=0; i<labs(nRelPos); i++)
{
- ((TabOrderDialog*)GetParentDialog())->SetModified();
+ static_cast<TabOrderDialog*>(GetParentDialog())->SetModified();
// move entries
diff --git a/extensions/source/propctrlr/usercontrol.cxx b/extensions/source/propctrlr/usercontrol.cxx
index ed2a27d..f26035c 100644
--- a/extensions/source/propctrlr/usercontrol.cxx
+++ b/extensions/source/propctrlr/usercontrol.cxx
@@ -293,7 +293,7 @@ namespace pcr
{
Any aPropValue;
if ( !getTypedControlWindow()->GetText().isEmpty() )
- aPropValue <<= (OUString)getTypedControlWindow()->GetURL();
+ aPropValue <<= getTypedControlWindow()->GetURL();
return aPropValue;
}
diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx
index 5c456af..41a3130 100644
--- a/include/sfx2/app.hxx
+++ b/include/sfx2/app.hxx
@@ -108,7 +108,7 @@ public:
virtual SfxPoolItem* Clone( SfxItemPool* = 0 ) const SAL_OVERRIDE
{ return new SfxLinkItem( *this ); }
virtual bool operator==( const SfxPoolItem& rL) const SAL_OVERRIDE
- { return ((SfxLinkItem&)rL).aLink == aLink; }
+ { return static_cast<const SfxLinkItem&>(rL).aLink == aLink; }
SfxLinkItem( sal_uInt16 nWhichId, const Link& rValue ) : SfxPoolItem( nWhichId )
{ aLink = rValue; }
const Link& GetValue() const { return aLink; }
commit 4923ac72aaca2f0671aed98de33902eac0810131
Author: Noel Grandin <noel at peralex.com>
Date: Tue Sep 30 09:02:35 2014 +0200
loplugin: cstylecast
Change-Id: I58582059495f7c50880038e2174ea2de026aa1c9
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index b02d4b6..5a37e12 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -1588,7 +1588,7 @@ namespace accessibility
// NumberingLevel
if (rRes.Name == "NumberingLevel")
{
- const SvxNumBulletItem& rNumBullet = ( SvxNumBulletItem& )rCacheTF.GetParaAttribs(GetParagraphIndex()).Get(EE_PARA_NUMBULLET);
+ const SvxNumBulletItem& rNumBullet = static_cast<const SvxNumBulletItem&>(rCacheTF.GetParaAttribs(GetParagraphIndex()).Get(EE_PARA_NUMBULLET));
if(rNumBullet.GetNumRule()->GetLevelCount()==0)
{
rRes.Value <<= (sal_Int16)-1;
@@ -1613,7 +1613,7 @@ namespace accessibility
if (rRes.Name == "NumberingRules")
{
SfxItemSet aAttribs = rCacheTF.GetParaAttribs(GetParagraphIndex());
- bool bVis = ((const SfxUInt16Item&)aAttribs.Get( EE_PARA_BULLETSTATE )).GetValue() ? sal_True : sal_False;
+ bool bVis = static_cast<const SfxUInt16Item&>(aAttribs.Get( EE_PARA_BULLETSTATE )).GetValue() ? true : false;
if(bVis)
{
rRes.Value <<= (sal_Int16)-1;
diff --git a/editeng/source/editeng/editattr.cxx b/editeng/source/editeng/editattr.cxx
index 0f25267..ac55335 100644
--- a/editeng/source/editeng/editattr.cxx
+++ b/editeng/source/editeng/editattr.cxx
@@ -81,7 +81,7 @@ EditCharAttribFont::EditCharAttribFont( const SvxFontItem& rAttr, sal_uInt16 _nS
void EditCharAttribFont::SetFont( SvxFont& rFont, OutputDevice* )
{
- const SvxFontItem& rAttr = (const SvxFontItem&)(*GetItem());
+ const SvxFontItem& rAttr = static_cast<const SvxFontItem&>(*GetItem());
rFont.SetName( rAttr.GetFamilyName() );
rFont.SetFamily( rAttr.GetFamily() );
@@ -100,7 +100,7 @@ EditCharAttribItalic::EditCharAttribItalic( const SvxPostureItem& rAttr, sal_uIn
void EditCharAttribItalic::SetFont( SvxFont& rFont, OutputDevice* )
{
- rFont.SetItalic( ((const SvxPostureItem*)GetItem())->GetPosture() );
+ rFont.SetItalic( static_cast<const SvxPostureItem*>(GetItem())->GetPosture() );
}
@@ -114,7 +114,7 @@ EditCharAttribWeight::EditCharAttribWeight( const SvxWeightItem& rAttr, sal_uInt
void EditCharAttribWeight::SetFont( SvxFont& rFont, OutputDevice* )
{
- rFont.SetWeight( (FontWeight)((const SvxWeightItem*)GetItem())->GetValue() );
+ rFont.SetWeight( (FontWeight)static_cast<const SvxWeightItem*>(GetItem())->GetValue() );
}
@@ -128,10 +128,10 @@ EditCharAttribUnderline::EditCharAttribUnderline( const SvxUnderlineItem& rAttr,
void EditCharAttribUnderline::SetFont( SvxFont& rFont, OutputDevice* pOutDev )
{
- rFont.SetUnderline( (FontUnderline)((const SvxUnderlineItem*)GetItem())->GetValue() );
+ rFont.SetUnderline( (FontUnderline)static_cast<const SvxUnderlineItem*>(GetItem())->GetValue() );
if ( pOutDev )
- pOutDev->SetTextLineColor( ((const SvxUnderlineItem*)GetItem())->GetColor() );
+ pOutDev->SetTextLineColor( static_cast<const SvxUnderlineItem*>(GetItem())->GetColor() );
}
@@ -146,9 +146,9 @@ EditCharAttribOverline::EditCharAttribOverline( const SvxOverlineItem& rAttr, sa
void EditCharAttribOverline::SetFont( SvxFont& rFont, OutputDevice* pOutDev )
{
- rFont.SetOverline( (FontUnderline)((const SvxOverlineItem*)GetItem())->GetValue() );
+ rFont.SetOverline( (FontUnderline)static_cast<const SvxOverlineItem*>(GetItem())->GetValue() );
if ( pOutDev )
- pOutDev->SetOverlineColor( ((const SvxOverlineItem*)GetItem())->GetColor() );
+ pOutDev->SetOverlineColor( static_cast<const SvxOverlineItem*>(GetItem())->GetColor() );
}
@@ -163,7 +163,7 @@ EditCharAttribFontHeight::EditCharAttribFontHeight( const SvxFontHeightItem& rAt
void EditCharAttribFontHeight::SetFont( SvxFont& rFont, OutputDevice* )
{
// Property is ignored
- rFont.SetSize( Size( rFont.GetSize().Width(), ((const SvxFontHeightItem*)GetItem())->GetHeight() ) );
+ rFont.SetSize( Size( rFont.GetSize().Width(), static_cast<const SvxFontHeightItem*>(GetItem())->GetHeight() ) );
}
@@ -191,7 +191,7 @@ EditCharAttribStrikeout::EditCharAttribStrikeout( const SvxCrossedOutItem& rAttr
void EditCharAttribStrikeout::SetFont( SvxFont& rFont, OutputDevice* )
{
- rFont.SetStrikeout( (FontStrikeout)((const SvxCrossedOutItem*)GetItem())->GetValue() );
+ rFont.SetStrikeout( (FontStrikeout)static_cast<const SvxCrossedOutItem*>(GetItem())->GetValue() );
}
@@ -205,7 +205,7 @@ EditCharAttribCaseMap::EditCharAttribCaseMap( const SvxCaseMapItem& rAttr, sal_u
void EditCharAttribCaseMap::SetFont( SvxFont& rFont, OutputDevice* )
{
- rFont.SetCaseMap( ((const SvxCaseMapItem*)GetItem())->GetCaseMap() );
+ rFont.SetCaseMap( static_cast<const SvxCaseMapItem*>(GetItem())->GetCaseMap() );
}
@@ -219,7 +219,7 @@ EditCharAttribColor::EditCharAttribColor( const SvxColorItem& rAttr, sal_uInt16
void EditCharAttribColor::SetFont( SvxFont& rFont, OutputDevice* )
{
- Color aColor = ((const SvxColorItem*)GetItem())->GetValue();
+ Color aColor = static_cast<const SvxColorItem*>(GetItem())->GetValue();
rFont.SetColor( aColor);
//fprintf(stderr, "Called SetFont with Color %d\n", aColor.GetColor());
}
@@ -237,7 +237,7 @@ EditCharAttribBackgroundColor::EditCharAttribBackgroundColor(
void EditCharAttribBackgroundColor::SetFont( SvxFont& rFont, OutputDevice* )
{
- Color aColor = ((const SvxBackgroundColorItem*)GetItem())->GetValue();
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list