From 23e1fc277d5651babce17bb74408ef6505f101d2 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 18 Sep 2014 15:10:54 +0200 Subject: loplugin: cstylecast, update PTR_CAST macro to use static_cast I introduce a template method into the PTR_CAST machinery to maintain constness. There is now a FIXME in sd/../docshell.cxx because I needed to use a dynamic_cast there to work around the games it appears to be playing with OLE in-place activation. Signed-off-by: Stephan Bergmann , dropping the GCC-extension, unnecessary use of typeof from tools/rtti.hxx Change-Id: Iba5ace1aa27e02b34fcc91af1e658c43371afd03 --- sw/source/filter/xml/xmlexpit.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sw/source/filter/xml/xmlexpit.cxx') diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx index cdd9cd0d0f19..40253feaeaf5 100644 --- a/sw/source/filter/xml/xmlexpit.cxx +++ b/sw/source/filter/xml/xmlexpit.cxx @@ -536,7 +536,7 @@ bool SvXMLExportItemMapper::QueryXMLValue( case RES_BOX: { - SvxBoxItem* pBox = PTR_CAST(SvxBoxItem, &rItem); + const SvxBoxItem* pBox = PTR_CAST(SvxBoxItem, &rItem); assert(pBox && "Wrong Which-ID"); if (pBox) { @@ -874,7 +874,7 @@ bool SvXMLExportItemMapper::QueryXMLValue( case RES_KEEP: { - SvxFmtKeepItem* pFmtKeep = PTR_CAST(SvxFmtKeepItem, &rItem); + const SvxFmtKeepItem* pFmtKeep = PTR_CAST(SvxFmtKeepItem, &rItem); assert(pFmtKeep && "Wrong Which-ID"); if (pFmtKeep) { @@ -888,7 +888,7 @@ bool SvXMLExportItemMapper::QueryXMLValue( case RES_BACKGROUND: { - SvxBrushItem* pBrush = PTR_CAST(SvxBrushItem, &rItem); + const SvxBrushItem* pBrush = PTR_CAST(SvxBrushItem, &rItem); OSL_ENSURE( pBrush != NULL, "Wrong Which-ID" ); // note: the graphic is only exported if nMemberId equals @@ -1038,7 +1038,7 @@ bool SvXMLExportItemMapper::QueryXMLValue( case RES_HORI_ORIENT: { - SwFmtHoriOrient* pHoriOrient = PTR_CAST(SwFmtHoriOrient, &rItem); + const SwFmtHoriOrient* pHoriOrient = PTR_CAST(SwFmtHoriOrient, &rItem); assert(pHoriOrient && "Wrong Which-ID"); if (pHoriOrient) { @@ -1051,7 +1051,7 @@ bool SvXMLExportItemMapper::QueryXMLValue( case RES_VERT_ORIENT: { - SwFmtVertOrient* pVertOrient = PTR_CAST(SwFmtVertOrient, &rItem); + const SwFmtVertOrient* pVertOrient = PTR_CAST(SwFmtVertOrient, &rItem); assert(pVertOrient && "Wrong Which-ID"); SvXMLUnitConverter::convertEnum( aOut, pVertOrient->GetVertOrient(), @@ -1062,7 +1062,7 @@ bool SvXMLExportItemMapper::QueryXMLValue( case RES_FRM_SIZE: { - SwFmtFrmSize* pFrmSize = PTR_CAST(SwFmtFrmSize, &rItem); + const SwFmtFrmSize* pFrmSize = PTR_CAST(SwFmtFrmSize, &rItem); OSL_ENSURE( pFrmSize != NULL, "Wrong Which-ID" ); bool bOutHeight = false; -- cgit