summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-08-14 20:32:26 +0200
committerTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-09-11 12:59:42 +0200
commitaa4ac53ecdb5726a36ec642f860526f790586db9 (patch)
tree8b72344d0baf656650eafe747686e0f0333a6526 /sd
parentd9645bf8a1c1c95aeeb9a90b89387d82795f56dd (diff)
get rid of QUERYINT macro in sd
Change-Id: I058cf5bdd3d11fb28b3e497c1a13e4ffc7e4ed84
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/unoidl/unohelp.hxx4
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx46
-rw-r--r--sd/source/ui/unoidl/unopage.cxx55
3 files changed, 67 insertions, 38 deletions
diff --git a/sd/source/ui/unoidl/unohelp.hxx b/sd/source/ui/unoidl/unohelp.hxx
index 8b435962074f..507d4dde6824 100644
--- a/sd/source/ui/unoidl/unohelp.hxx
+++ b/sd/source/ui/unoidl/unohelp.hxx
@@ -29,10 +29,6 @@ inline void bool2any( bool bBool, ::com::sun::star::uno::Any& rAny )
}
-#define QUERYINT( xint ) \
- if( rType == ::getCppuType((const uno::Reference< xint >*)0) ) \
- aAny <<= uno::Reference< xint >(this)
-
#endif // INCLUDED_SD_SOURCE_UI_UNOIDL_UNOHELP_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index abdda6d62be2..ff86a44f1db2 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -251,24 +251,36 @@ uno::Any SAL_CALL SdXImpressDocument::queryInterface( const uno::Type & rType )
{
uno::Any aAny;
- QUERYINT(lang::XServiceInfo);
- else QUERYINT(beans::XPropertySet);
- else QUERYINT(lang::XMultiServiceFactory);
- else QUERYINT(drawing::XDrawPageDuplicator);
- else QUERYINT(drawing::XLayerSupplier);
- else QUERYINT(drawing::XMasterPagesSupplier);
- else QUERYINT(drawing::XDrawPagesSupplier);
- else QUERYINT(presentation::XHandoutMasterSupplier);
- else QUERYINT(document::XLinkTargetSupplier);
- else QUERYINT(style::XStyleFamiliesSupplier);
- else QUERYINT(com::sun::star::ucb::XAnyCompareFactory);
- else QUERYINT(view::XRenderable);
- else if( mbImpressDoc && rType == cppu::UnoType<presentation::XPresentationSupplier>::get() )
- aAny <<= uno::Reference< presentation::XPresentationSupplier >(this);
- else if( mbImpressDoc && rType == cppu::UnoType<presentation::XCustomPresentationSupplier>::get() )
- aAny <<= uno::Reference< presentation::XCustomPresentationSupplier >(this);
+ if (rType == cppu::UnoType<lang::XServiceInfo>::get())
+ aAny <<= uno::Reference<lang::XServiceInfo>(this);
+ else if (rType == cppu::UnoType<beans::XPropertySet>::get())
+ aAny <<= uno::Reference<beans::XPropertySet>(this);
+ else if (rType == cppu::UnoType<lang::XMultiServiceFactory>::get())
+ aAny <<= uno::Reference<lang::XMultiServiceFactory>(this);
+ else if (rType == cppu::UnoType<drawing::XDrawPageDuplicator>::get())
+ aAny <<= uno::Reference<drawing::XDrawPageDuplicator>(this);
+ else if (rType == cppu::UnoType<drawing::XLayerSupplier>::get())
+ aAny <<= uno::Reference<drawing::XLayerSupplier>(this);
+ else if (rType == cppu::UnoType<drawing::XMasterPagesSupplier>::get())
+ aAny <<= uno::Reference<drawing::XMasterPagesSupplier>(this);
+ else if (rType == cppu::UnoType<drawing::XDrawPagesSupplier>::get())
+ aAny <<= uno::Reference<drawing::XDrawPagesSupplier>(this);
+ else if (rType == cppu::UnoType<presentation::XHandoutMasterSupplier>::get())
+ aAny <<= uno::Reference<presentation::XHandoutMasterSupplier>(this);
+ else if (rType == cppu::UnoType<document::XLinkTargetSupplier>::get())
+ aAny <<= uno::Reference<document::XLinkTargetSupplier>(this);
+ else if (rType == cppu::UnoType<style::XStyleFamiliesSupplier>::get())
+ aAny <<= uno::Reference<style::XStyleFamiliesSupplier>(this);
+ else if (rType == cppu::UnoType<css::ucb::XAnyCompareFactory>::get())
+ aAny <<= uno::Reference<css::ucb::XAnyCompareFactory>(this);
+ else if (rType == cppu::UnoType<view::XRenderable>::get())
+ aAny <<= uno::Reference<view::XRenderable>(this);
+ else if (mbImpressDoc && rType == cppu::UnoType<presentation::XPresentationSupplier>::get())
+ aAny <<= uno::Reference< presentation::XPresentationSupplier >(this);
+ else if (mbImpressDoc && rType == cppu::UnoType<presentation::XCustomPresentationSupplier>::get())
+ aAny <<= uno::Reference< presentation::XCustomPresentationSupplier >(this);
else
- return SfxBaseModel::queryInterface( rType );
+ return SfxBaseModel::queryInterface(rType);
return aAny;
}
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 3c99d4d29979..1ab438f0e03e 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -534,27 +534,48 @@ Any SAL_CALL SdGenericDrawPage::queryInterface( const uno::Type & rType )
{
Any aAny;
- QUERYINT( beans::XPropertySet );
- else QUERYINT( container::XNamed );
- else QUERYINT( util::XReplaceable );
- else QUERYINT( util::XSearchable );
- else QUERYINT( document::XLinkTargetSupplier );
- else QUERYINT( drawing::XShapeCombiner );
- else QUERYINT( drawing::XShapeBinder );
- else QUERYINT( beans::XMultiPropertySet );
- else if( rType == cppu::UnoType<office::XAnnotationAccess>::get() )
+ if (rType == cppu::UnoType<beans::XPropertySet>::get())
{
- return Any( Reference< office::XAnnotationAccess >( this ) );
+ aAny <<= Reference<beans::XPropertySet>(this);
}
- else if( rType == cppu::UnoType<XAnimationNodeSupplier>::get() )
+ else if (rType == cppu::UnoType<container::XNamed>::get())
{
- if( mbIsImpressDocument )
- {
- const PageKind ePageKind = GetPage() ? GetPage()->GetPageKind() : PK_STANDARD;
+ aAny <<= Reference<container::XNamed>(this);
+ }
+ else if (rType == cppu::UnoType<util::XReplaceable>::get())
+ {
+ aAny <<= Reference<util::XReplaceable>(this);
+ }
+ else if (rType == cppu::UnoType<util::XSearchable>::get())
+ {
+ aAny <<= Reference<util::XSearchable>(this);
+ }
+ else if (rType == cppu::UnoType<document::XLinkTargetSupplier>::get())
+ {
+ aAny <<= Reference<document::XLinkTargetSupplier>(this);
+ }
+ else if (rType == cppu::UnoType<drawing::XShapeCombiner>::get())
+ {
+ aAny <<= Reference<drawing::XShapeCombiner>(this);
+ }
+ else if (rType == cppu::UnoType<drawing::XShapeBinder>::get())
+ {
+ aAny <<= Reference<drawing::XShapeBinder>(this);
+ }
+ else if (rType == cppu::UnoType<beans::XMultiPropertySet>::get())
+ {
+ aAny <<= Reference<beans::XMultiPropertySet>(this);
+ }
+ else if (rType == cppu::UnoType<office::XAnnotationAccess>::get())
+ {
+ aAny <<= Reference<office::XAnnotationAccess>(this);
+ }
+ else if (mbIsImpressDocument && rType == cppu::UnoType<XAnimationNodeSupplier>::get())
+ {
+ const PageKind ePageKind = GetPage() ? GetPage()->GetPageKind() : PK_STANDARD;
- if( ePageKind == PK_STANDARD )
- return makeAny( Reference< XAnimationNodeSupplier >( this ) );
- }
+ if( ePageKind == PK_STANDARD )
+ return makeAny( Reference< XAnimationNodeSupplier >( this ) );
}
else
return SvxDrawPage::queryInterface( rType );