summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-03-26 15:32:40 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-03-26 15:33:41 +0100
commitf701cce539c58874c07ef7487075b29143cc9ed1 (patch)
treefac593eb7f7cf06be3763df5c67319a3e977ded0 /xmloff
parentfa683a7020837ee04b8f610490edf08b686cb6b8 (diff)
const_cast: convert some C-style casts and remove some redundant ones
Change-Id: Ib054b36c87c87ae2189b5456bc9b12d7b76c49e7
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/draw/sdxmlexp.cxx2
-rw-r--r--xmloff/source/draw/shapeimport.cxx2
-rw-r--r--xmloff/source/draw/ximpstyl.cxx6
-rw-r--r--xmloff/source/forms/elementimport.cxx2
-rw-r--r--xmloff/source/style/PageMasterPropHdlFactory.cxx2
-rw-r--r--xmloff/source/style/XMLPageExport.cxx2
-rw-r--r--xmloff/source/style/xmlaustp.cxx2
-rw-r--r--xmloff/source/style/xmlnumi.cxx6
-rw-r--r--xmloff/source/style/xmlstyle.cxx20
9 files changed, 22 insertions, 22 deletions
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx
index 9320d384c09b..937191376998 100644
--- a/xmloff/source/draw/sdxmlexp.cxx
+++ b/xmloff/source/draw/sdxmlexp.cxx
@@ -451,7 +451,7 @@ void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent
mpPropertySetMapper->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(*this));
// construct PresPagePropsMapper
- xMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLSDPresPageProps, aFactoryRef, true);
+ xMapper = new XMLPropertySetMapper(aXMLSDPresPageProps, aFactoryRef, true);
mpPresPagePropsMapper = new XMLPageExportPropertyMapper( xMapper, *this );
// set lock to avoid deletion
diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx
index 4522e18e0643..b2688612a53f 100644
--- a/xmloff/source/draw/shapeimport.cxx
+++ b/xmloff/source/draw/shapeimport.cxx
@@ -165,7 +165,7 @@ XMLShapeImportHelper::XMLShapeImportHelper(
mpPropertySetMapper->ChainImportMapper(XMLTextImportHelper::CreateParaDefaultExtPropMapper(rImporter));
// construct PresPagePropsMapper
- xMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLSDPresPageProps, mpSdPropHdlFactory, false);
+ xMapper = new XMLPropertySetMapper(aXMLSDPresPageProps, mpSdPropHdlFactory, false);
mpPresPagePropsMapper = new SvXMLImportPropertyMapper( xMapper, rImporter );
// set lock to avoid deletion
mpPresPagePropsMapper->acquire();
diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx
index 594ac324743d..a490221f8010 100644
--- a/xmloff/source/draw/ximpstyl.cxx
+++ b/xmloff/source/draw/ximpstyl.cxx
@@ -1102,7 +1102,7 @@ rtl::Reference< SvXMLImportPropertyMapper > SdXMLStylesContext::GetImportPropert
if(!xPresImpPropMapper.is())
{
rtl::Reference< XMLShapeImportHelper > aImpHelper = ((SvXMLImport&)GetImport()).GetShapeImport();
- ((SdXMLStylesContext*)this)->xPresImpPropMapper =
+ const_cast<SdXMLStylesContext*>(this)->xPresImpPropMapper =
aImpHelper->GetPresPagePropsMapper();
}
xMapper = xPresImpPropMapper;
@@ -1305,7 +1305,7 @@ void SdXMLStylesContext::ImpSetGraphicStyles( uno::Reference< container::XNameAc
if(nFamily == pStyle->GetFamily() && pStyle->IsDefaultStyle())
{
- ((SvXMLStyleContext*)pStyle)->SetDefaults();
+ const_cast<SvXMLStyleContext*>(pStyle)->SetDefaults();
}
}
@@ -1428,7 +1428,7 @@ void SdXMLStylesContext::ImpSetGraphicStyles( uno::Reference< container::XNameAc
if(xStyle.is())
{
// set parent style name
- OUString sParentStyleDisplayName( const_cast< SvXMLImport& >( GetImport() ).GetStyleDisplayName( pStyle->GetFamily(), pStyle->GetParentName() ) );
+ OUString sParentStyleDisplayName( GetImport().GetStyleDisplayName( pStyle->GetFamily(), pStyle->GetParentName() ) );
if( nPrefLen )
{
sal_Int32 nStylePrefLen = sParentStyleDisplayName.lastIndexOf( '-' ) + 1;
diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx
index 608fcb5c233f..aafd03e5937c 100644
--- a/xmloff/source/forms/elementimport.cxx
+++ b/xmloff/source/forms/elementimport.cxx
@@ -196,7 +196,7 @@ namespace xmloff
new OGridColumnPropertyTranslator( Reference< XMultiPropertySet >( m_xElement, UNO_QUERY ) );
const_cast< XMLTextStyleContext* >( m_pStyleElement )->FillPropertySet( xPropTranslation );
- const OUString sNumberStyleName = const_cast< XMLTextStyleContext* >( m_pStyleElement )->GetDataStyleName( );
+ const OUString sNumberStyleName = m_pStyleElement->GetDataStyleName( );
if ( !sNumberStyleName.isEmpty() )
// the style also has a number (sub) style
m_rContext.applyControlNumberStyle( m_xElement, sNumberStyleName );
diff --git a/xmloff/source/style/PageMasterPropHdlFactory.cxx b/xmloff/source/style/PageMasterPropHdlFactory.cxx
index 52c506fcfd65..67ce53228a43 100644
--- a/xmloff/source/style/PageMasterPropHdlFactory.cxx
+++ b/xmloff/source/style/PageMasterPropHdlFactory.cxx
@@ -69,7 +69,7 @@ const XMLPropertyHandler* XMLPageMasterPropHdlFactory::GetPropertyHandler( sal_I
{
nType &= MID_FLAG_MASK;
- XMLPropertyHandler* pHdl = (XMLPropertyHandler*) XMLPropertyHandlerFactory::GetPropertyHandler( nType );
+ XMLPropertyHandler* pHdl = const_cast<XMLPropertyHandler*>(XMLPropertyHandlerFactory::GetPropertyHandler( nType ));
if( !pHdl )
{
switch( nType )
diff --git a/xmloff/source/style/XMLPageExport.cxx b/xmloff/source/style/XMLPageExport.cxx
index 2c6fe9c9ad04..0bd5d951e469 100644
--- a/xmloff/source/style/XMLPageExport.cxx
+++ b/xmloff/source/style/XMLPageExport.cxx
@@ -157,7 +157,7 @@ XMLPageExport::XMLPageExport( SvXMLExport& rExp ) :
{
xPageMasterPropHdlFactory = new XMLPageMasterPropHdlFactory;
xPageMasterPropSetMapper = new XMLPageMasterPropSetMapper(
- (XMLPropertyMapEntry*) aXMLPageMasterStyleMap,
+ aXMLPageMasterStyleMap,
xPageMasterPropHdlFactory, true );
xPageMasterExportPropMapper = new XMLPageMasterExportPropMapper(
xPageMasterPropSetMapper, rExp);
diff --git a/xmloff/source/style/xmlaustp.cxx b/xmloff/source/style/xmlaustp.cxx
index 96e71a189d47..b541766ac6e6 100644
--- a/xmloff/source/style/xmlaustp.cxx
+++ b/xmloff/source/style/xmlaustp.cxx
@@ -131,7 +131,7 @@ void SvXMLAutoStylePoolP::exportStyleAttributes(
pProp->maValue >>= xNumRule;
if( xNumRule.is() && (xNumRule->getCount() > 0 ) )
{
- const OUString sName(((XMLTextListAutoStylePool*)&GetExport().GetTextParagraphExport()->GetListAutoStylePool())->Add( xNumRule ));
+ const OUString sName(const_cast<XMLTextListAutoStylePool*>(&GetExport().GetTextParagraphExport()->GetListAutoStylePool())->Add( xNumRule ));
GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_LIST_STYLE_NAME, GetExport().EncodeStyleName( sName ) );
}
diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx
index f8994f2bc304..810a7244e5b3 100644
--- a/xmloff/source/style/xmlnumi.cxx
+++ b/xmloff/source/style/xmlnumi.cxx
@@ -1227,13 +1227,13 @@ void SvxXMLListStyleContext::CreateAndInsertAuto() const
const OUString& rName = GetName();
if( bOutline || xNumRules.is() || rName.isEmpty() )
{
- ((SvxXMLListStyleContext *)this)->SetValid( false );
+ const_cast<SvxXMLListStyleContext *>(this)->SetValid( false );
return;
}
- ((SvxXMLListStyleContext *)this)->xNumRules = CreateNumRule(
+ const_cast<SvxXMLListStyleContext *>(this)->xNumRules = CreateNumRule(
GetImport().GetModel() );
- ((SvxXMLListStyleContext *)this)->nLevels = xNumRules->getCount();
+ const_cast<SvxXMLListStyleContext *>(this)->nLevels = xNumRules->getCount();
FillUnoNumRule(xNumRules);
}
diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx
index 40a052d24596..a4600a409c16 100644
--- a/xmloff/source/style/xmlstyle.cxx
+++ b/xmloff/source/style/xmlstyle.cxx
@@ -613,7 +613,7 @@ rtl::Reference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProper
case XML_STYLE_FAMILY_TEXT_PARAGRAPH:
if( !mxParaImpPropMapper.is() )
{
- SvXMLStylesContext * pThis = (SvXMLStylesContext *)this;
+ SvXMLStylesContext * pThis = const_cast<SvXMLStylesContext *>(this);
pThis->mxParaImpPropMapper =
pThis->GetImport().GetTextImport()
->GetParaImportPropertySetMapper();
@@ -623,7 +623,7 @@ rtl::Reference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProper
case XML_STYLE_FAMILY_TEXT_TEXT:
if( !mxTextImpPropMapper.is() )
{
- SvXMLStylesContext * pThis = (SvXMLStylesContext *)this;
+ SvXMLStylesContext * pThis = const_cast<SvXMLStylesContext *>(this);
pThis->mxTextImpPropMapper =
pThis->GetImport().GetTextImport()
->GetTextImportPropertySetMapper();
@@ -635,7 +635,7 @@ rtl::Reference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProper
// don't cache section mapper, as it's rarely used
// *sigh*, cast to non-const, because this is a const method,
// but SvXMLImport::GetTextImport() isn't.
- xMapper = ((SvXMLStylesContext*)this)->GetImport().GetTextImport()->
+ xMapper = const_cast<SvXMLStylesContext*>(this)->GetImport().GetTextImport()->
GetSectionImportPropertySetMapper();
break;
@@ -643,7 +643,7 @@ rtl::Reference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProper
// don't cache section mapper, as it's rarely used
// *sigh*, cast to non-const, because this is a const method,
// but SvXMLImport::GetTextImport() isn't.
- xMapper = ((SvXMLStylesContext*)this)->GetImport().GetTextImport()->
+ xMapper = const_cast<SvXMLStylesContext*>(this)->GetImport().GetTextImport()->
GetRubyImportPropertySetMapper();
break;
@@ -653,7 +653,7 @@ rtl::Reference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProper
if(!mxShapeImpPropMapper.is())
{
rtl::Reference< XMLShapeImportHelper > aImpHelper = ((SvXMLImport&)GetImport()).GetShapeImport();
- ((SvXMLStylesContext*)this)->mxShapeImpPropMapper =
+ const_cast<SvXMLStylesContext*>(this)->mxShapeImpPropMapper =
aImpHelper->GetPropertySetMapper();
}
xMapper = mxShapeImpPropMapper;
@@ -673,7 +673,7 @@ rtl::Reference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProper
new XMLPageMasterPropSetMapper( false );
mxPageImpPropMapper =
new PageMasterImportPropertyMapper( pPropMapper,
- ((SvXMLStylesContext*)this)->GetImport() );
+ const_cast<SvXMLStylesContext*>(this)->GetImport() );
}
xMapper = mxPageImpPropMapper;
break;
@@ -703,9 +703,9 @@ Reference < XAutoStyleFamily > SvXMLStylesContext::GetAutoStyles( sal_uInt16 nFa
Any aAny = xAutoStyleFamilies->getByName( sName );
xAutoStyles = *(Reference<XAutoStyleFamily>*)aAny.getValue();
if( bPara )
- ((SvXMLStylesContext *)this)->mxParaAutoStyles = xAutoStyles;
+ const_cast<SvXMLStylesContext *>(this)->mxParaAutoStyles = xAutoStyles;
else
- ((SvXMLStylesContext *)this)->mxTextAutoStyles = xAutoStyles;
+ const_cast<SvXMLStylesContext *>(this)->mxTextAutoStyles = xAutoStyles;
}
}
}
@@ -747,11 +747,11 @@ Reference < XNameContainer > SvXMLStylesContext::GetStylesContainer(
switch( nFamily )
{
case XML_STYLE_FAMILY_TEXT_PARAGRAPH:
- ((SvXMLStylesContext *)this)->mxParaStyles = xStyles;
+ const_cast<SvXMLStylesContext *>(this)->mxParaStyles = xStyles;
break;
case XML_STYLE_FAMILY_TEXT_TEXT:
- ((SvXMLStylesContext *)this)->mxTextStyles = xStyles;
+ const_cast<SvXMLStylesContext *>(this)->mxTextStyles = xStyles;
break;
}
}