summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-03-03 16:42:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-03-06 06:00:38 +0000
commit7139563afe073b0e4e819fdaf7fe285e597f4c5f (patch)
tree927396085af6961ae7fbe7f3bb5f2821a5c35f0e /sc
parentaadf790bbceb1cde94c2a6fe8edfb9951edca0a0 (diff)
make use of the SfxItemSet::GetItem<T> method
Change-Id: I8201429993129b019a6dd51c203a9f8dcbb2253e Reviewed-on: https://gerrit.libreoffice.org/34867 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/excel/xlchart.cxx10
-rw-r--r--sc/source/filter/excel/xlroot.cxx2
-rw-r--r--sc/source/filter/orcus/orcusfiltersimpl.cxx2
-rw-r--r--sc/source/filter/xml/xmlwrap.cxx2
-rw-r--r--sc/source/ui/docshell/docsh.cxx3
5 files changed, 9 insertions, 10 deletions
diff --git a/sc/source/filter/excel/xlchart.cxx b/sc/source/filter/excel/xlchart.cxx
index d4ad17ed2d1e..c78811f10987 100644
--- a/sc/source/filter/excel/xlchart.cxx
+++ b/sc/source/filter/excel/xlchart.cxx
@@ -1015,17 +1015,17 @@ void XclChPropSetHelper::WriteEscherProperties( ScfPropertySet& rPropSet,
{
if( rEscherFmt.mxItemSet )
{
- if( const XFillStyleItem* pStyleItem = static_cast< const XFillStyleItem* >( rEscherFmt.mxItemSet->GetItem( XATTR_FILLSTYLE, false ) ) )
+ if( const XFillStyleItem* pStyleItem = rEscherFmt.mxItemSet->GetItem<XFillStyleItem>( XATTR_FILLSTYLE, false ) )
{
switch( pStyleItem->GetValue() )
{
case drawing::FillStyle_SOLID:
// #i84812# Excel 2007 writes Escher properties for solid fill
- if( const XFillColorItem* pColorItem = static_cast< const XFillColorItem* >( rEscherFmt.mxItemSet->GetItem( XATTR_FILLCOLOR, false ) ) )
+ if( const XFillColorItem* pColorItem = rEscherFmt.mxItemSet->GetItem<XFillColorItem>( XATTR_FILLCOLOR, false ) )
{
namespace cssd = ::com::sun::star::drawing;
// get solid transparence too
- const XFillTransparenceItem* pTranspItem = static_cast< const XFillTransparenceItem* >( rEscherFmt.mxItemSet->GetItem( XATTR_FILLTRANSPARENCE, false ) );
+ const XFillTransparenceItem* pTranspItem = rEscherFmt.mxItemSet->GetItem<XFillTransparenceItem>( XATTR_FILLTRANSPARENCE, false );
sal_uInt16 nTransp = pTranspItem ? pTranspItem->GetValue() : 0;
ScfPropSetHelper& rAreaHlp = GetAreaHelper( ePropMode );
rAreaHlp.InitializeWrite();
@@ -1034,7 +1034,7 @@ void XclChPropSetHelper::WriteEscherProperties( ScfPropertySet& rPropSet,
}
break;
case drawing::FillStyle_GRADIENT:
- if( const XFillGradientItem* pGradItem = static_cast< const XFillGradientItem* >( rEscherFmt.mxItemSet->GetItem( XATTR_FILLGRADIENT, false ) ) )
+ if( const XFillGradientItem* pGradItem = rEscherFmt.mxItemSet->GetItem<XFillGradientItem>( XATTR_FILLGRADIENT, false ) )
{
Any aGradientAny;
if( pGradItem->QueryValue( aGradientAny, MID_FILLGRADIENT ) )
@@ -1052,7 +1052,7 @@ void XclChPropSetHelper::WriteEscherProperties( ScfPropertySet& rPropSet,
}
break;
case drawing::FillStyle_BITMAP:
- if( const XFillBitmapItem* pBmpItem = static_cast< const XFillBitmapItem* >( rEscherFmt.mxItemSet->GetItem( XATTR_FILLBITMAP, false ) ) )
+ if( const XFillBitmapItem* pBmpItem = rEscherFmt.mxItemSet->GetItem<XFillBitmapItem>( XATTR_FILLBITMAP, false ) )
{
Any aBitmapAny;
if( pBmpItem->QueryValue( aBitmapAny, MID_GRAFURL ) )
diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx
index 58f37e30bb71..4754fa6f82a9 100644
--- a/sc/source/filter/excel/xlroot.cxx
+++ b/sc/source/filter/excel/xlroot.cxx
@@ -125,7 +125,7 @@ XclRootData::XclRootData( XclBiff eBiff, SfxMedium& rMedium,
// document URL and path
if( const SfxItemSet* pItemSet = mrMedium.GetItemSet() )
- if( const SfxStringItem* pItem = static_cast< const SfxStringItem* >( pItemSet->GetItem( SID_FILE_NAME ) ) )
+ if( const SfxStringItem* pItem = pItemSet->GetItem<SfxStringItem>( SID_FILE_NAME ) )
maDocUrl = pItem->GetValue();
maBasePath = maDocUrl.copy( 0, maDocUrl.lastIndexOf( '/' ) + 1 );
diff --git a/sc/source/filter/orcus/orcusfiltersimpl.cxx b/sc/source/filter/orcus/orcusfiltersimpl.cxx
index a27f2707e154..6bac0e9d3576 100644
--- a/sc/source/filter/orcus/orcusfiltersimpl.cxx
+++ b/sc/source/filter/orcus/orcusfiltersimpl.cxx
@@ -48,7 +48,7 @@ uno::Reference<task::XStatusIndicator> getStatusIndicator(SfxMedium& rMedium)
SfxItemSet* pSet = rMedium.GetItemSet();
if (pSet)
{
- const SfxUnoAnyItem* pItem = static_cast<const SfxUsrAnyItem*>(pSet->GetItem(SID_PROGRESS_STATUSBAR_CONTROL));
+ const SfxUnoAnyItem* pItem = pSet->GetItem<SfxUsrAnyItem>(SID_PROGRESS_STATUSBAR_CONTROL);
if (pItem)
xStatusIndicator.set(pItem->GetValue(), uno::UNO_QUERY);
}
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index 579c7f0abce9..668531eccb51 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -87,7 +87,7 @@ uno::Reference <task::XStatusIndicator> ScXMLImportWrapper::GetStatusIndicator()
SfxItemSet* pSet = pMedium->GetItemSet();
if (pSet)
{
- const SfxUnoAnyItem* pItem = static_cast<const SfxUnoAnyItem*>(pSet->GetItem(SID_PROGRESS_STATUSBAR_CONTROL));
+ const SfxUnoAnyItem* pItem = pSet->GetItem<SfxUnoAnyItem>(SID_PROGRESS_STATUSBAR_CONTROL);
if (pItem)
xStatusIndicator.set(pItem->GetValue(), uno::UNO_QUERY);
}
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 377fe43cad7c..f8baa2e50126 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2380,8 +2380,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
bRet = true;
if ( bHasMemo )
{
- const SfxStringItem* pNameItem =
- static_cast<const SfxStringItem*>( rMed.GetItemSet()->GetItem( SID_FILE_NAME ) );
+ const SfxStringItem* pNameItem = rMed.GetItemSet()->GetItem<SfxStringItem>( SID_FILE_NAME );
INetURLObject aDbtFile( pNameItem->GetValue(), INetProtocol::File );
aDbtFile.setExtension("dbt");
if ( IsDocument( aDbtFile ) && !KillFile( aDbtFile ) )