diff options
author | Noel Grandin <noel@peralex.com> | 2014-09-18 15:10:54 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-09-23 17:27:47 +0200 |
commit | 23e1fc277d5651babce17bb74408ef6505f101d2 (patch) | |
tree | edf64a973766400f870095f4ecd25784bfea6ba5 /reportdesign | |
parent | 7f895dfbf5fb084d747e52db678d75e3273cd825 (diff) |
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 <sbergman@redhat.com>,
dropping the GCC-extension, unnecessary use of typeof from tools/rtti.hxx
Change-Id: Iba5ace1aa27e02b34fcc91af1e658c43371afd03
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/filter/xml/xmlCell.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlColumn.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlHelper.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlStyleImport.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlTable.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlfilter.cxx | 2 |
6 files changed, 8 insertions, 8 deletions
diff --git a/reportdesign/source/filter/xml/xmlCell.cxx b/reportdesign/source/filter/xml/xmlCell.cxx index fe00d4a2a06a..d7e7c8df4d41 100644 --- a/reportdesign/source/filter/xml/xmlCell.cxx +++ b/reportdesign/source/filter/xml/xmlCell.cxx @@ -218,7 +218,7 @@ void OXMLCell::EndElement() m_xComponent = xFixedLine.get(); m_pContainer->getSection()->add(m_xComponent.get()); m_pContainer->addCell(m_xComponent); - XMLPropStyleContext* pAutoStyle = PTR_CAST(XMLPropStyleContext,GetImport().GetAutoStyles()->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL,m_sStyleName)); + XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(PTR_CAST(XMLPropStyleContext,GetImport().GetAutoStyles()->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL,m_sStyleName))); if ( pAutoStyle ) { uno::Reference<beans::XPropertySet> xBorderProp = OXMLHelper::createBorderPropertySet(); diff --git a/reportdesign/source/filter/xml/xmlColumn.cxx b/reportdesign/source/filter/xml/xmlColumn.cxx index 7a92e7ce70b8..e9a558bb115d 100644 --- a/reportdesign/source/filter/xml/xmlColumn.cxx +++ b/reportdesign/source/filter/xml/xmlColumn.cxx @@ -136,7 +136,7 @@ void OXMLRowColumn::fillStyle(const OUString& _sStyleName) }; pInfo->add(pMap); Reference<XPropertySet> xProp = GenericPropertySet_CreateInstance(pInfo); - XMLPropStyleContext* pAutoStyle = PTR_CAST(XMLPropStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_COLUMN,_sStyleName)); + XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(PTR_CAST(XMLPropStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_COLUMN,_sStyleName))); if ( pAutoStyle ) { pAutoStyle->FillPropertySet(xProp); @@ -146,7 +146,7 @@ void OXMLRowColumn::fillStyle(const OUString& _sStyleName) } else { - pAutoStyle = PTR_CAST(XMLPropStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_ROW,_sStyleName)); + pAutoStyle = const_cast<XMLPropStyleContext*>(PTR_CAST(XMLPropStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_ROW,_sStyleName))); if ( pAutoStyle ) { pAutoStyle->FillPropertySet(xProp); diff --git a/reportdesign/source/filter/xml/xmlHelper.cxx b/reportdesign/source/filter/xml/xmlHelper.cxx index 669e520c0bd5..e2c57547f17c 100644 --- a/reportdesign/source/filter/xml/xmlHelper.cxx +++ b/reportdesign/source/filter/xml/xmlHelper.cxx @@ -252,7 +252,7 @@ void OXMLHelper::copyStyleElements(const bool _bOld,const OUString& _sStyleName, { if ( !_xProp.is() || _sStyleName.isEmpty() || !_pAutoStyles ) return; - XMLPropStyleContext* pAutoStyle = PTR_CAST(XMLPropStyleContext,_pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL,_sStyleName)); + XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(PTR_CAST(XMLPropStyleContext,_pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL,_sStyleName))); if ( pAutoStyle ) { ::com::sun::star::awt::FontDescriptor aFont; diff --git a/reportdesign/source/filter/xml/xmlStyleImport.cxx b/reportdesign/source/filter/xml/xmlStyleImport.cxx index 9e47479dcd0c..8ee64b0a3c93 100644 --- a/reportdesign/source/filter/xml/xmlStyleImport.cxx +++ b/reportdesign/source/filter/xml/xmlStyleImport.cxx @@ -107,8 +107,8 @@ void OControlStyleContext::FillPropertySet(const Reference< XPropertySet > & rPr { OReportStylesContext* pMyStyles = PTR_CAST(OReportStylesContext,GetOwnImport().GetAutoStyles()); if ( pMyStyles ) - pStyle = PTR_CAST(SvXMLNumFormatContext,pMyStyles-> - FindStyleChildContext(XML_STYLE_FAMILY_DATA_STYLE, m_sDataStyleName, true)); + pStyle = const_cast<SvXMLNumFormatContext*>(PTR_CAST(SvXMLNumFormatContext,pMyStyles-> + FindStyleChildContext(XML_STYLE_FAMILY_DATA_STYLE, m_sDataStyleName, true))); else { OSL_FAIL("not possible to get style"); } diff --git a/reportdesign/source/filter/xml/xmlTable.cxx b/reportdesign/source/filter/xml/xmlTable.cxx index 4cb109d05dca..8af0b1009824 100644 --- a/reportdesign/source/filter/xml/xmlTable.cxx +++ b/reportdesign/source/filter/xml/xmlTable.cxx @@ -171,7 +171,7 @@ void OXMLTable::EndElement() const SvXMLStylesContext* pAutoStyles = GetImport().GetAutoStyles(); if ( pAutoStyles ) { - XMLPropStyleContext* pAutoStyle = PTR_CAST(XMLPropStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_TABLE,m_sStyleName)); + XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(PTR_CAST(XMLPropStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_TABLE,m_sStyleName))); if ( pAutoStyle ) { pAutoStyle->FillPropertySet(m_xSection.get()); diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx index 217a84cdb793..73b361a3f059 100644 --- a/reportdesign/source/filter/xml/xmlfilter.cxx +++ b/reportdesign/source/filter/xml/xmlfilter.cxx @@ -641,7 +641,7 @@ SvXMLImportContext* ORptFilter::CreateContext( sal_uInt16 nPrefix, const SvXMLStylesContext* pAutoStyles = GetAutoStyles(); if ( pAutoStyles ) { - XMLPropStyleContext* pAutoStyle = PTR_CAST(XMLPropStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_PAGE_MASTER,OUString("pm1"))); + XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(PTR_CAST(XMLPropStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_PAGE_MASTER,OUString("pm1")))); if ( pAutoStyle ) { pAutoStyle->FillPropertySet(getReportDefinition().get()); |