Revert all the recent loplugin:unocast changes

...as obsoleted by ef53355355 "Rudimentary support
for dynamic_cast on UNO proxy objects".

This reverts all of:
4cfcc9ac37 "loplugin:unocast (framework::Desktop)"
03efbf72f4 "loplugin:unocast
 (vclcanvas::TextLayout)"
80099fdd51 "loplugin:unocast (SalGtkXWindow)"
cc147f576d "loplugin:unocast
 (sdext::presenter::CachablePresenterView)"
40db42be1d "loplugin:unocast
 (vclcanvas::CanvasFont)"
2d1e7995ea "loplugin:unocast (CairoColorSpace)"
4c0bbe4bd9 "loplugin:unocast
 (canvas::ParametricPolyPolygon)"
8980366662 "loplugin:unocast
 (vclcanas::CanvasBitmap)"
d5e0c2c8db "loplugin:unocast
 (sfx2::DigitalSignatures)"
c0c4519e0d "loplugin:unocast
 (VCLXAccessibleComponent)"
feb8b833a6 "loplugin:unocast (VCLXDialog)"
1fa58cc6cc "loplugin:unocast (VCLXMultiPage)"
f481f036de "loplugin:unocast
 (DocumentSettingsSerializer)"
73df933f5f "loplugin:unocast
 (css::embed::EmbeddedUpdate)"
420165ab0e "loplugin:unocast
 (canvas::tools' StandardColorSpace, StandardNoAlphaColorSpace)"
9abe8ee067 "loplugin:unocast (MutableTreeNode)"
9f3022ceb0 "loplugin:unocast (VCLXTabPage)"
1be70dda02 "loplugin:unocast
 (vcl::unotools::VclCanvasBitmap)"
d6a70bb641 "loplugin:unocast
 (basegfx::unotools::UnoPolyPolygon)"
5a14f009e6 "loplugin:unocast
 (xmlsecurity::Certificate)"
99009c9535 "loplugin:unocast (sd::Annotation)"
0c7585c5fa "loplugin:unocast (sd::TextApiObject)"
24e14afd1b "loplugin:unocast
 (SignatureVerifierImpl)"
1a7ad0c10d "loplugin:unocast
 (pcr::PropertyEventTranslation)"
a97e2d2702 "loplugin:unocast (RangePageBreaks)"
19dfdf86ad "iloplugin:unocast
 (pcr::OFormattedNumericControl)"
f9785ea595 "loplugin:unocast
 (frm::OInterfaceContainer)"
5e5f40a4a9 "loplugin:unocast (ScVbaShapes)"
27b35b2c21 "loplugin:unocast (ScVbaShapeRange)"
cb3108f860 "cid#1517812 Dereference null return
 value"
feba0ddb15 "loplugin:unocast
 (weld::TransportAsXWindow)"
4d6c232165 "loplugin:unocast
 (oox::ForumlaImExportBase)"
4844c096a8 "loplugin:unocast
 (cairocanvas::SurfaceProvider)"
9a0b523e0a "loplugin:unocast
 (cairocanvas::CanvasBitmap)"
8a5648d8e5 "loplugin:unocast
 (cairocanvas::TextLayout)"
28c27a0623 "loplugin:unocast
 (cairocanvas::CanvasFont)"
53bc223cb3 "loplugin:unocast
 (cairocanvas::RepaintTarget)"
5f70b0b9f6 "loplugin:unocast (SvXMLImport)"
068187a898 "loplugin:unocast (VCLXWindow)"
88b4f96620 "loplugin:unocast
 (sfx2::sidebar::SidebarController)"
f1b7a69b28 "loplugin:unocast
 (SvxLineStyleToolBoxControl)"
ba76f0ba7e "loplugin:unocast
 (i18npool::Calendar_gregorian)"
840154daf9 "loplugin:unocast
 (framework::AddonsToolBarWrapper)"
b0e9c4c5f0 "loplugin:unocast
 (GrammarCheckingIterator)"
8ee6cfc965 "loplugin:unocast
 (ucb::ucp::ext::Content)"
5b8cd77c11 "loplugin:unocast
 (basic::SfxScriptLibraryContainer)"
9e73ff9fce "loplugin:unocast
 (sdext::presenter::PresenterNotesView)"
a98acca8fb "loplugin:unocast
 (SelectionChangeHandler)"
c0b59ad6e3 "Consistently use
 comphelper::getSomethingImpl<I>(aIdentifier, this)"
276e3ccbdd "loplugin:unocast
 (vclcanvas::RepaintTarget)"

Change-Id: I37c73e3422a5154bf6cb647640d2d3f23db8bc34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145063
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann 2023-01-04 16:43:40 +01:00
parent 00b62877fa
commit 19691c3b68
180 changed files with 242 additions and 1255 deletions

View file

@ -35,14 +35,12 @@ namespace accessibility
{
class AccessibleListBoxEntry;
using AccessibleListBox_Base = cppu::ImplHelper2<
css::accessibility::XAccessible,
css::accessibility::XAccessibleSelection>;
/** the class OAccessibleListBoxEntry represents the base class for an accessible object of a listbox entry
*/
class AccessibleListBox :
public AccessibleListBox_Base,
public cppu::ImplHelper2<
css::accessibility::XAccessible,
css::accessibility::XAccessibleSelection>,
public VCLXAccessibleComponent
{

View file

@ -58,10 +58,8 @@ namespace accessibility
dispose();
}
}
IMPLEMENT_FORWARD_XINTERFACE2(
AccessibleListBox, VCLXAccessibleComponent, AccessibleListBox_Base);
IMPLEMENT_FORWARD_XTYPEPROVIDER2(
AccessibleListBox, VCLXAccessibleComponent, AccessibleListBox_Base);
IMPLEMENT_FORWARD_XINTERFACE2(AccessibleListBox, VCLXAccessibleComponent, ImplHelper2)
IMPLEMENT_FORWARD_XTYPEPROVIDER2(AccessibleListBox, VCLXAccessibleComponent, ImplHelper2)
void AccessibleListBox::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
{

View file

@ -30,7 +30,6 @@
#include <com/sun/star/rendering/XPolyPolygon2D.hpp>
#include <com/sun/star/rendering/XGraphicDevice.hpp>
#include <com/sun/star/awt/Rectangle.hpp>
#include <comphelper/servicehelper.hxx>
#include <basegfx/utils/unopolypolygon.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/matrix/b3dhommatrix.hxx>
@ -252,7 +251,7 @@ namespace basegfx::unotools
::basegfx::B2DPolyPolygon b2DPolyPolygonFromXPolyPolygon2D( const uno::Reference< rendering::XPolyPolygon2D >& xPoly )
{
::basegfx::unotools::UnoPolyPolygon* pPolyImpl =
comphelper::getFromUnoTunnel< ::basegfx::unotools::UnoPolyPolygon >( xPoly );
dynamic_cast< ::basegfx::unotools::UnoPolyPolygon* >( xPoly.get() );
if( pPolyImpl )
{

View file

@ -27,7 +27,6 @@
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <basegfx/utils/unopolypolygon.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <utility>
@ -61,7 +60,7 @@ namespace basegfx::unotools
}
B2DPolyPolygon aSrcPoly;
const UnoPolyPolygon* pSrc( comphelper::getFromUnoTunnel< UnoPolyPolygon >(polyPolygon) );
const UnoPolyPolygon* pSrc( dynamic_cast< UnoPolyPolygon* >(polyPolygon.get()) );
// try to extract polygon data from interface. First,
// check whether it's the same implementation object,
@ -435,15 +434,6 @@ namespace basegfx::unotools
return { "com.sun.star.rendering.PolyPolygon2D" };
}
sal_Int64 UnoPolyPolygon::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) {
return comphelper::getSomethingImpl(aIdentifier, this);
}
css::uno::Sequence<sal_Int8> const & UnoPolyPolygon::getUnoTunnelId() {
static comphelper::UnoIdInit const id;
return id.getSeq();
}
B2DPolyPolygon UnoPolyPolygon::getPolyPolygon() const
{
std::unique_lock const guard( m_aMutex );

View file

@ -35,7 +35,6 @@
#include <vcl/svapp.hxx>
#include <tools/debug.hxx>
#include <comphelper/diagnose_ex.hxx>
#include <comphelper/servicehelper.hxx>
#include <tools/urlobj.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/documentinfo.hxx>
@ -463,7 +462,7 @@ namespace basic
}
// knit the containers with the BasicManager
LibraryContainerInfo aInfo( xBasicLibs, xDialogLibs, comphelper::getFromUnoTunnel< SfxScriptLibraryContainer >( xBasicLibs ) );
LibraryContainerInfo aInfo( xBasicLibs, xDialogLibs, dynamic_cast< SfxScriptLibraryContainer* >( xBasicLibs.get() ) );
OSL_ENSURE( aInfo.mpOldBasicPassword, "ImplRepository::impl_createManagerForModel: wrong BasicLibraries implementation!" );
_out_rpBasicManager->SetLibraryContainerInfo( aInfo );

View file

@ -21,18 +21,15 @@
#include "namecont.hxx"
#include <basic/basmgr.hxx>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/script/vba/XVBAModuleInfo.hpp>
#include <comphelper/uno3.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/implbase1.hxx>
namespace basic
{
class SfxScriptLibraryContainer final :
public cppu::ImplInheritanceHelper<SfxLibraryContainer, css::lang::XUnoTunnel>
class SfxScriptLibraryContainer final : public SfxLibraryContainer
{
css::uno::Reference< css::container::XNameAccess > mxCodeNameAccess;
@ -102,9 +99,6 @@ public:
// Library password handling for 5.0 documents
void setLibraryPassword( const OUString& rLibraryName, const OUString& rPassword );
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId();
};

View file

@ -30,7 +30,6 @@
#include <com/sun/star/task/ErrorCodeIOException.hpp>
#include <com/sun/star/script/ModuleType.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <comphelper/servicehelper.hxx>
#include <comphelper/storagehelper.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <sal/log.hxx>
@ -108,16 +107,6 @@ void SfxScriptLibraryContainer::setLibraryPassword( const OUString& rLibraryName
catch(const NoSuchElementException& ) {}
}
sal_Int64 SfxScriptLibraryContainer::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier)
{
return comphelper::getSomethingImpl(aIdentifier, this);
}
css::uno::Sequence<sal_Int8> const & SfxScriptLibraryContainer::getUnoTunnelId() {
static comphelper::UnoIdInit const id;
return id.getSeq();
}
// Ctor for service
SfxScriptLibraryContainer::SfxScriptLibraryContainer()
{

View file

@ -20,7 +20,6 @@
#pragma once
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/rendering/XParametricPolyPolygon2D.hpp>
#include <comphelper/compbase.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
@ -37,8 +36,7 @@ namespace com::sun::star::rendering { class XGraphicDevice; }
namespace canvas
{
typedef comphelper::WeakComponentImplHelper< css::rendering::XParametricPolyPolygon2D,
css::lang::XServiceInfo,
css::lang::XUnoTunnel > ParametricPolyPolygon_Base;
css::lang::XServiceInfo > ParametricPolyPolygon_Base;
class CANVASTOOLS_DLLPUBLIC ParametricPolyPolygon final : public ParametricPolyPolygon_Base
{
@ -106,9 +104,6 @@ namespace canvas
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId();
/// Query all defining values of this object atomically
Values getValues() const;

View file

@ -23,7 +23,6 @@
#include <com/sun/star/rendering/RepaintResult.hpp>
#include <utility>
#include <comphelper/diagnose_ex.hxx>
#include <comphelper/servicehelper.hxx>
#include "cairo_cachedbitmap.hxx"
#include "cairo_repainttarget.hxx"
@ -60,7 +59,7 @@ namespace cairocanvas
"CachedBitmap::doRedraw(): base called with changed view transform "
"(told otherwise during construction)" );
RepaintTarget* pTarget = comphelper::getFromUnoTunnel< RepaintTarget >(rTargetCanvas);
RepaintTarget* pTarget = dynamic_cast< RepaintTarget* >(rTargetCanvas.get());
ENSURE_OR_THROW( pTarget,
"CachedBitmap::redraw(): cannot cast target to RepaintTarget" );

View file

@ -24,7 +24,6 @@
#include <com/sun/star/lang/NoSupportException.hpp>
#include <osl/mutex.hxx>
#include <comphelper/diagnose_ex.hxx>
#include <comphelper/servicehelper.hxx>
#include <vcl/sysdata.hxx>
#include <vcl/skia/SkiaHelper.hxx>
#include <cppuhelper/supportsservice.hxx>
@ -129,12 +128,6 @@ namespace cairocanvas
return { getServiceName() };
}
sal_Int64 Canvas::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) {
return comphelper::getSomethingImpl_skipDerived(
aIdentifier, this, comphelper::MixinToGetSomethingOf<SurfaceProvider>{},
comphelper::FallbackToGetSomethingOf<RepaintTarget>{});
}
bool Canvas::repaint( const SurfaceSharedPtr& pSurface,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState )

View file

@ -50,8 +50,7 @@ namespace cairocanvas
css::util::XUpdatable,
css::beans::XPropertySet,
css::lang::XServiceName,
css::lang::XServiceInfo,
css::lang::XUnoTunnel > GraphicDeviceBase_Base;
css::lang::XServiceInfo > GraphicDeviceBase_Base;
typedef ::canvas::GraphicDeviceBase< ::canvas::BaseMutexHelper< GraphicDeviceBase_Base >,
DeviceHelper,
::osl::MutexGuard,
@ -123,9 +122,6 @@ namespace cairocanvas
virtual OUString SAL_CALL getImplementationName() override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
// XUnoTunnel
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
// RepaintTarget
virtual bool repaint( const ::cairo::SurfaceSharedPtr& pSurface,
const css::rendering::ViewState& viewState,

View file

@ -143,17 +143,6 @@ namespace cairocanvas
return aRV;
}
sal_Int64 CanvasBitmap::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) {
return comphelper::getSomethingImpl(
aIdentifier, this, comphelper::MixinToGetSomethingOf<SurfaceProvider>{},
comphelper::FallbackToGetSomethingOf<RepaintTarget>{});
}
css::uno::Sequence<sal_Int8> const & CanvasBitmap::getUnoTunnelId() {
static comphelper::UnoIdInit const id;
return id.getSeq();
}
OUString SAL_CALL CanvasBitmap::getImplementationName( )
{
return "CairoCanvas.CanvasBitmap";

View file

@ -22,7 +22,6 @@
#include <cppuhelper/compbase.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/rendering/XBitmapCanvas.hpp>
#include <com/sun/star/rendering/XIntegerBitmap.hpp>
#include <com/sun/star/beans/XFastPropertySet.hpp>
@ -43,8 +42,7 @@ namespace cairocanvas
typedef ::cppu::WeakComponentImplHelper< css::rendering::XBitmapCanvas,
css::rendering::XIntegerBitmap,
css::lang::XServiceInfo,
css::beans::XFastPropertySet,
css::lang::XUnoTunnel> CanvasBitmapBase_Base;
css::beans::XFastPropertySet > CanvasBitmapBase_Base;
class CanvasBitmapSpriteSurface_Base :
public ::canvas::BaseMutexHelper<CanvasBitmapBase_Base>,
public SurfaceProvider
@ -115,9 +113,6 @@ namespace cairocanvas
virtual css::uno::Any SAL_CALL getFastPropertyValue(sal_Int32 nHandle) override;
virtual void SAL_CALL setFastPropertyValue(sal_Int32, const css::uno::Any&) override {}
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId();
private:
SurfaceProviderRef mpSurfaceProvider;
::cairo::SurfaceSharedPtr mpBufferSurface;

View file

@ -146,12 +146,6 @@ namespace cairocanvas
{
return { "com.sun.star.rendering.CanvasCustomSprite" };
}
sal_Int64 CanvasCustomSprite::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) {
return comphelper::getSomethingImpl_skipDerived(
aIdentifier, this, comphelper::MixinToGetSomethingOf<SurfaceProvider>{},
comphelper::FallbackToGetSomethingOf<RepaintTarget>{});
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -23,7 +23,6 @@
#include <comphelper/uno3.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/rendering/XBitmapCanvas.hpp>
#include <com/sun/star/rendering/XCustomSprite.hpp>
#include <com/sun/star/rendering/XIntegerBitmap.hpp>
@ -47,8 +46,7 @@ namespace cairocanvas
typedef ::cppu::WeakComponentImplHelper< css::rendering::XCustomSprite,
css::rendering::XBitmapCanvas,
css::rendering::XIntegerBitmap,
css::lang::XServiceInfo,
css::lang::XUnoTunnel > CanvasCustomSpriteBase_Base;
css::lang::XServiceInfo > CanvasCustomSpriteBase_Base;
/** Mixin Sprite
Have to mixin the Sprite interface before deriving from
@ -115,9 +113,6 @@ namespace cairocanvas
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
// XUnoTunnel
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
// Sprite
virtual void redraw( const ::cairo::CairoSharedPtr& pCairo,
bool bBufferedUpdate ) const override;

View file

@ -21,7 +21,6 @@
#include <basegfx/numeric/ftools.hxx>
#include <com/sun/star/rendering/PanoseProportion.hpp>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <i18nlangtag/languagetag.hxx>
#include <rtl/math.hxx>
@ -148,15 +147,6 @@ namespace cairocanvas
return { "com.sun.star.rendering.CanvasFont" };
}
sal_Int64 CanvasFont::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) {
return comphelper::getSomethingImpl(aIdentifier, this);
}
css::uno::Sequence<sal_Int8> const & CanvasFont::getUnoTunnelId() {
static comphelper::UnoIdInit const id;
return id.getSeq();
}
vcl::Font const & CanvasFont::getVCLFont() const
{
return *maFont;

View file

@ -23,7 +23,6 @@
#include <cppuhelper/basemutex.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/geometry/Matrix2D.hpp>
#include <com/sun/star/rendering/FontRequest.hpp>
#include <com/sun/star/rendering/XCanvasFont.hpp>
@ -40,8 +39,7 @@
namespace cairocanvas
{
typedef ::cppu::WeakComponentImplHelper< css::rendering::XCanvasFont,
css::lang::XServiceInfo,
css::lang::XUnoTunnel > CanvasFont_Base;
css::lang::XServiceInfo > CanvasFont_Base;
class CanvasFont : public ::cppu::BaseMutex,
public CanvasFont_Base
@ -72,9 +70,6 @@ namespace cairocanvas
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId();
vcl::Font const & getVCLFont() const;
private:

View file

@ -29,7 +29,6 @@
#include <basegfx/utils/canvastools.hxx>
#include <basegfx/utils/keystoplerp.hxx>
#include <basegfx/utils/lerp.hxx>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/rendering/ColorComponentTag.hpp>
#include <com/sun/star/rendering/ColorSpaceType.hpp>
#include <com/sun/star/rendering/CompositeOperation.hpp>
@ -41,7 +40,6 @@
#include <com/sun/star/rendering/XIntegerBitmapColorSpace.hpp>
#include <com/sun/star/util/Endianness.hpp>
#include <comphelper/sequence.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/implbase.hxx>
#include <rtl/math.hxx>
#include <comphelper/diagnose_ex.hxx>
@ -296,12 +294,11 @@ constexpr OUStringLiteral PARAMETRICPOLYPOLYGON_IMPLEMENTATION_NAME = u"Canvas::
**/
static SurfaceSharedPtr surfaceFromXBitmap( const uno::Reference< rendering::XBitmap >& xBitmap )
{
CanvasBitmap* pBitmapImpl = comphelper::getFromUnoTunnel< CanvasBitmap >( xBitmap );
CanvasBitmap* pBitmapImpl = dynamic_cast< CanvasBitmap* >( xBitmap.get() );
if( pBitmapImpl )
return pBitmapImpl->getSurface();
SurfaceProvider* pSurfaceProvider
= comphelper::getFromUnoTunnel<SurfaceProvider>( xBitmap );
SurfaceProvider* pSurfaceProvider = dynamic_cast<SurfaceProvider*>( xBitmap.get() );
if( pSurfaceProvider )
return pSurfaceProvider->getSurface();
@ -1342,7 +1339,7 @@ constexpr OUStringLiteral PARAMETRICPOLYPOLYGON_IMPLEMENTATION_NAME = u"Canvas::
namespace
{
class CairoColorSpace : public cppu::WeakImplHelper< css::rendering::XIntegerBitmapColorSpace, css::lang::XUnoTunnel >
class CairoColorSpace : public cppu::WeakImplHelper< css::rendering::XIntegerBitmapColorSpace >
{
private:
uno::Sequence< sal_Int8 > maComponentTags;
@ -1500,7 +1497,7 @@ constexpr OUStringLiteral PARAMETRICPOLYPOLYGON_IMPLEMENTATION_NAME = u"Canvas::
virtual uno::Sequence<double> SAL_CALL convertFromIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor,
const uno::Reference< rendering::XColorSpace >& targetColorSpace ) override
{
if( comphelper::getFromUnoTunnel<CairoColorSpace>(targetColorSpace) )
if( dynamic_cast<CairoColorSpace*>(targetColorSpace.get()) )
{
const sal_Int8* pIn( deviceColor.getConstArray() );
const std::size_t nLen( deviceColor.getLength() );
@ -1531,7 +1528,7 @@ constexpr OUStringLiteral PARAMETRICPOLYPOLYGON_IMPLEMENTATION_NAME = u"Canvas::
virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertToIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor,
const uno::Reference< rendering::XIntegerBitmapColorSpace >& targetColorSpace ) override
{
if( comphelper::getFromUnoTunnel<CairoColorSpace>(targetColorSpace) )
if( dynamic_cast<CairoColorSpace*>(targetColorSpace.get()) )
{
// it's us, so simply pass-through the data
return deviceColor;
@ -1688,17 +1685,6 @@ constexpr OUStringLiteral PARAMETRICPOLYPOLYGON_IMPLEMENTATION_NAME = u"Canvas::
pBitCounts[2] =
pBitCounts[3] = 8;
}
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier)
override
{
return comphelper::getSomethingImpl(aIdentifier, this);
}
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId() {
static comphelper::UnoIdInit const id;
return id.getSeq();
}
};
class CairoNoAlphaColorSpace : public cppu::WeakImplHelper< css::rendering::XIntegerBitmapColorSpace >
@ -1833,7 +1819,7 @@ constexpr OUStringLiteral PARAMETRICPOLYPOLYGON_IMPLEMENTATION_NAME = u"Canvas::
virtual uno::Sequence<double> SAL_CALL convertFromIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor,
const uno::Reference< rendering::XColorSpace >& targetColorSpace ) override
{
if( comphelper::getFromUnoTunnel<CairoColorSpace>(targetColorSpace) )
if( dynamic_cast<CairoColorSpace*>(targetColorSpace.get()) )
{
const sal_Int8* pIn( deviceColor.getConstArray() );
const std::size_t nLen( deviceColor.getLength() );

View file

@ -24,7 +24,6 @@
#include <rtl/math.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <comphelper/diagnose_ex.hxx>
#include <comphelper/servicehelper.hxx>
#include <vcl/canvastools.hxx>
#include <vcl/metric.hxx>
#include <vcl/virdev.hxx>
@ -173,7 +172,7 @@ namespace cairocanvas
{
setupOutDevState( rOutDev, pOwner, viewState, renderState );
CanvasFont* pFont = comphelper::getFromUnoTunnel< CanvasFont >( xFont );
CanvasFont* pFont = dynamic_cast< CanvasFont* >( xFont.get() );
ENSURE_ARG_OR_THROW( pFont,
"CanvasHelper::setupTextOutput(): Font not compatible with this canvas" );
@ -248,7 +247,7 @@ namespace cairocanvas
// TODO(F2): alpha
mpVirtualDevice->SetLayoutMode( nLayoutMode );
rtl::Reference pTextLayout( new TextLayout(text, textDirection, 0, CanvasFont::Reference(comphelper::getFromUnoTunnel< CanvasFont >( xFont )), mpSurfaceProvider) );
rtl::Reference pTextLayout( new TextLayout(text, textDirection, 0, CanvasFont::Reference(dynamic_cast< CanvasFont* >( xFont.get() )), mpSurfaceProvider) );
pTextLayout->draw(*mpVirtualDevice, aOutpos, viewState, renderState);
}
@ -263,7 +262,7 @@ namespace cairocanvas
ENSURE_ARG_OR_THROW( xLayoutedText.is(),
"CanvasHelper::drawTextLayout(): layout is NULL");
TextLayout* pTextLayout = comphelper::getFromUnoTunnel< TextLayout >( xLayoutedText );
TextLayout* pTextLayout = dynamic_cast< TextLayout* >( xLayoutedText.get() );
if( pTextLayout )
{

View file

@ -21,9 +21,6 @@
#include <com/sun/star/rendering/RenderState.hpp>
#include <com/sun/star/rendering/ViewState.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <comphelper/servicehelper.hxx>
#include <sal/types.h>
#include <vcl/cairo.hxx>
@ -36,7 +33,7 @@ namespace cairocanvas
This interface must be implemented on all canvas
implementations that hand out XCachedPrimitives
*/
class RepaintTarget
class SAL_LOPLUGIN_ANNOTATE("crosscast") RepaintTarget
{
public:
virtual ~RepaintTarget() {}
@ -45,15 +42,6 @@ namespace cairocanvas
virtual bool repaint( const ::cairo::SurfaceSharedPtr& pSurface,
const css::rendering::ViewState& viewState,
const css::rendering::RenderState& renderState ) = 0;
sal_Int64 getSomething(css::uno::Sequence<sal_Int8> const & id) {
return comphelper::getSomethingImpl(id, this);
}
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId() {
static comphelper::UnoIdInit const id;
return id.getSeq();
}
};
}

View file

@ -151,12 +151,6 @@ namespace cairocanvas
return { getServiceName() };
}
sal_Int64 SpriteCanvas::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) {
return comphelper::getSomethingImpl_skipDerived(
aIdentifier, this, comphelper::MixinToGetSomethingOf<SurfaceProvider>{},
comphelper::FallbackToGetSomethingOf<RepaintTarget>{});
}
SurfaceSharedPtr SpriteCanvas::getSurface()
{
return maDeviceHelper.getBufferSurface();

View file

@ -23,7 +23,6 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XServiceName.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/awt/XWindowListener.hpp>
#include <com/sun/star/util/XUpdatable.hpp>
#include <com/sun/star/rendering/XSpriteCanvas.hpp>
@ -55,8 +54,7 @@ namespace cairocanvas
css::util::XUpdatable,
css::beans::XPropertySet,
css::lang::XServiceName,
css::lang::XServiceInfo,
css::lang::XUnoTunnel > WindowGraphicDeviceBase_Base;
css::lang::XServiceInfo > WindowGraphicDeviceBase_Base;
typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::DisambiguationHelper< WindowGraphicDeviceBase_Base >,
SpriteDeviceHelper,
::osl::MutexGuard,
@ -132,9 +130,6 @@ namespace cairocanvas
virtual OUString SAL_CALL getImplementationName() override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
// XUnoTunnel
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
// SurfaceProvider
virtual ::cairo::SurfaceSharedPtr getSurface() override;
virtual ::cairo::SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize, int aContent ) override;

View file

@ -20,10 +20,7 @@
#pragma once
#include <rtl/ref.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/uno/XInterface.hpp>
#include <comphelper/servicehelper.hxx>
#include <sal/types.h>
#include <basegfx/vector/b2isize.hxx>
#include <vcl/cairo.hxx>
@ -40,7 +37,7 @@ namespace cairocanvas
This interface must be implemented on all canvas
implementations that hand out XCachedPrimitives
*/
class SurfaceProvider : public css::uno::XInterface
class SAL_LOPLUGIN_ANNOTATE("crosscast") SurfaceProvider : public css::uno::XInterface
{
public:
virtual ~SurfaceProvider() {}
@ -65,15 +62,6 @@ namespace cairocanvas
/** Provides the underlying vcl outputdevice this surface renders on
*/
virtual OutputDevice* getOutputDevice() = 0;
sal_Int64 getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) {
return comphelper::getSomethingImpl(aIdentifier, this);
}
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId() {
static comphelper::UnoIdInit const id;
return id.getSeq();
}
};
typedef ::rtl::Reference< SurfaceProvider > SurfaceProviderRef;

View file

@ -28,7 +28,6 @@
#include <basegfx/numeric/ftools.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <comphelper/diagnose_ex.hxx>
#include <comphelper/servicehelper.hxx>
#include <utility>
#include <vcl/kernarray.hxx>
#include <vcl/metric.hxx>
@ -345,15 +344,6 @@ namespace cairocanvas
{
return { "com.sun.star.rendering.TextLayout" };
}
sal_Int64 TextLayout::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) {
return comphelper::getSomethingImpl(aIdentifier, this);
}
css::uno::Sequence<sal_Int8> const & TextLayout::getUnoTunnelId() {
static comphelper::UnoIdInit const id;
return id.getSeq();
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -23,7 +23,6 @@
#include <cppuhelper/basemutex.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/rendering/RenderState.hpp>
#include <com/sun/star/rendering/ViewState.hpp>
#include <com/sun/star/rendering/XTextLayout.hpp>
@ -38,8 +37,7 @@
namespace cairocanvas
{
typedef ::cppu::WeakComponentImplHelper< css::rendering::XTextLayout,
css::lang::XServiceInfo,
css::lang::XUnoTunnel > TextLayout_Base;
css::lang::XServiceInfo > TextLayout_Base;
class TextLayout : public ::cppu::BaseMutex,
public TextLayout_Base
@ -82,9 +80,6 @@ namespace cairocanvas
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId();
void draw( OutputDevice& rOutDev,
const Point& rOutpos,
const css::rendering::ViewState& viewState,

View file

@ -21,7 +21,6 @@
#include <rtl/crc.h>
#include <rtl/math.hxx>
#include <comphelper/diagnose_ex.hxx>
#include <comphelper/servicehelper.hxx>
#include <vcl/font.hxx>
#include <vcl/kernarray.hxx>
#include <vcl/metric.hxx>
@ -554,7 +553,7 @@ namespace oglcanvas
// try to cast XParametricPolyPolygon2D reference to
// our implementation class.
::canvas::ParametricPolyPolygon* pGradient =
comphelper::getFromUnoTunnel< ::canvas::ParametricPolyPolygon >( textures[0].Gradient );
dynamic_cast< ::canvas::ParametricPolyPolygon* >( textures[0].Gradient.get() );
if( pGradient )
{

View file

@ -39,7 +39,6 @@
#include <com/sun/star/geometry/AffineMatrix2D.hpp>
#include <com/sun/star/geometry/Matrix2D.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/rendering/ColorComponentTag.hpp>
#include <com/sun/star/rendering/ColorSpaceType.hpp>
#include <com/sun/star/rendering/CompositeOperation.hpp>
@ -55,7 +54,6 @@
#include <sal/log.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <comphelper/diagnose_ex.hxx>
#include <comphelper/servicehelper.hxx>
#include <vcl/canvastools.hxx>
#include <vcl/window.hxx>
@ -178,7 +176,7 @@ namespace canvas::tools
namespace
{
class StandardColorSpace : public cppu::WeakImplHelper< css::rendering::XIntegerBitmapColorSpace, css::lang::XUnoTunnel >
class StandardColorSpace : public cppu::WeakImplHelper< css::rendering::XIntegerBitmapColorSpace >
{
private:
uno::Sequence< sal_Int8 > maComponentTags;
@ -329,7 +327,7 @@ namespace canvas::tools
virtual uno::Sequence<double> SAL_CALL convertFromIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor,
const uno::Reference< rendering::XColorSpace >& targetColorSpace ) override
{
if( comphelper::getFromUnoTunnel<StandardColorSpace>(targetColorSpace) )
if( dynamic_cast<StandardColorSpace*>(targetColorSpace.get()) )
{
const sal_Int8* pIn( deviceColor.getConstArray() );
const std::size_t nLen( deviceColor.getLength() );
@ -360,7 +358,7 @@ namespace canvas::tools
virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertToIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor,
const uno::Reference< rendering::XIntegerBitmapColorSpace >& targetColorSpace ) override
{
if( comphelper::getFromUnoTunnel<StandardColorSpace>(targetColorSpace) )
if( dynamic_cast<StandardColorSpace*>(targetColorSpace.get()) )
{
// it's us, so simply pass-through the data
return deviceColor;
@ -511,20 +509,9 @@ namespace canvas::tools
pBitCounts[2] =
pBitCounts[3] = 8;
}
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier)
override
{
return comphelper::getSomethingImpl(aIdentifier, this);
}
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId() {
static comphelper::UnoIdInit const id;
return id.getSeq();
}
};
class StandardNoAlphaColorSpace : public cppu::WeakImplHelper< css::rendering::XIntegerBitmapColorSpace, css::lang::XUnoTunnel >
class StandardNoAlphaColorSpace : public cppu::WeakImplHelper< css::rendering::XIntegerBitmapColorSpace >
{
private:
uno::Sequence< sal_Int8 > maComponentTags;
@ -674,7 +661,7 @@ namespace canvas::tools
virtual uno::Sequence<double> SAL_CALL convertFromIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor,
const uno::Reference< rendering::XColorSpace >& targetColorSpace ) override
{
if( comphelper::getFromUnoTunnel<StandardNoAlphaColorSpace>(targetColorSpace) )
if( dynamic_cast<StandardNoAlphaColorSpace*>(targetColorSpace.get()) )
{
const sal_Int8* pIn( deviceColor.getConstArray() );
const std::size_t nLen( deviceColor.getLength() );
@ -705,7 +692,7 @@ namespace canvas::tools
virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertToIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor,
const uno::Reference< rendering::XIntegerBitmapColorSpace >& targetColorSpace ) override
{
if( comphelper::getFromUnoTunnel<StandardNoAlphaColorSpace>(targetColorSpace) )
if( dynamic_cast<StandardNoAlphaColorSpace*>(targetColorSpace.get()) )
{
// it's us, so simply pass-through the data
return deviceColor;
@ -853,17 +840,6 @@ namespace canvas::tools
pBitCounts[1] =
pBitCounts[2] = 8;
}
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier)
override
{
return comphelper::getSomethingImpl(aIdentifier, this);
}
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId() {
static comphelper::UnoIdInit const id;
return id.getSeq();
}
};
}

View file

@ -22,7 +22,6 @@
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/range/b2drectangle.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/rendering/XGraphicDevice.hpp>
@ -195,16 +194,6 @@ namespace canvas
return { "com.sun.star.rendering.ParametricPolyPolygon" };
}
sal_Int64 ParametricPolyPolygon::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier)
{
return comphelper::getSomethingImpl(aIdentifier, this);
}
css::uno::Sequence<sal_Int8> const & ParametricPolyPolygon::getUnoTunnelId() {
static comphelper::UnoIdInit const id;
return id.getSeq();
}
ParametricPolyPolygon::~ParametricPolyPolygon()
{
}

View file

@ -23,7 +23,6 @@
#include <com/sun/star/rendering/RepaintResult.hpp>
#include <utility>
#include <comphelper/diagnose_ex.hxx>
#include <comphelper/servicehelper.hxx>
#include "cachedbitmap.hxx"
#include "repainttarget.hxx"
@ -71,7 +70,7 @@ namespace vclcanvas
if( rNewState.Clip != rOldState.Clip )
return rendering::RepaintResult::FAILED;
RepaintTarget* pTarget = comphelper::getFromUnoTunnel< RepaintTarget >(rTargetCanvas);
RepaintTarget* pTarget = dynamic_cast< RepaintTarget* >(rTargetCanvas.get());
ENSURE_OR_THROW( pTarget,
"CachedBitmap::redraw(): cannot cast target to RepaintTarget" );

View file

@ -96,10 +96,6 @@ namespace vclcanvas
return "com.sun.star.rendering.Canvas.VCL";
}
sal_Int64 Canvas::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) {
return RepaintTarget::getSomething(aIdentifier);
}
bool Canvas::repaint( const GraphicObjectSharedPtr& rGrf,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState,

View file

@ -22,7 +22,6 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XServiceName.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/util/XUpdatable.hpp>
#include <com/sun/star/rendering/XBitmapCanvas.hpp>
#include <com/sun/star/rendering/XIntegerBitmap.hpp>
@ -49,8 +48,7 @@ namespace vclcanvas
css::lang::XMultiServiceFactory,
css::util::XUpdatable,
css::beans::XPropertySet,
css::lang::XServiceName,
css::lang::XUnoTunnel> GraphicDeviceBase_Base;
css::lang::XServiceName > GraphicDeviceBase_Base;
typedef ::canvas::GraphicDeviceBase< ::canvas::BaseMutexHelper< GraphicDeviceBase_Base >,
DeviceHelper,
tools::LocalGuard,
@ -98,9 +96,6 @@ namespace vclcanvas
// XServiceName
virtual OUString SAL_CALL getServiceName( ) override;
// XUnoTunnel
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
// RepaintTarget
virtual bool repaint( const GraphicObjectSharedPtr& rGrf,
const css::rendering::ViewState& viewState,

View file

@ -19,7 +19,6 @@
#include <sal/config.h>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include "canvasbitmap.hxx"
@ -85,11 +84,6 @@ namespace vclcanvas
return { "com.sun.star.rendering.CanvasBitmap" };
}
sal_Int64 CanvasBitmap::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) {
return comphelper::getSomethingImpl(
aIdentifier, this, comphelper::FallbackToGetSomethingOf<RepaintTarget>{});
}
BitmapEx CanvasBitmap::getBitmap() const
{
SolarMutexGuard aGuard;

View file

@ -22,7 +22,6 @@
#include <cppuhelper/compbase.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/rendering/XBitmapCanvas.hpp>
#include <com/sun/star/rendering/XIntegerBitmap.hpp>
#include <com/sun/star/beans/XFastPropertySet.hpp>
@ -45,8 +44,7 @@ namespace vclcanvas
typedef ::cppu::WeakComponentImplHelper< css::rendering::XBitmapCanvas,
css::rendering::XIntegerBitmap,
css::lang::XServiceInfo,
css::beans::XFastPropertySet,
css::lang::XUnoTunnel> CanvasBitmapBase_Base;
css::beans::XFastPropertySet > CanvasBitmapBase_Base;
typedef ::canvas::IntegerBitmapBase<
canvas::BitmapCanvasBase2<
::canvas::BaseMutexHelper< CanvasBitmapBase_Base >,
@ -84,9 +82,6 @@ namespace vclcanvas
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
// XUnoTunnel
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
// RepaintTarget interface
virtual bool repaint( const GraphicObjectSharedPtr& rGrf,
const css::rendering::ViewState& viewState,

View file

@ -116,10 +116,6 @@ namespace vclcanvas
return { "com.sun.star.rendering.CanvasCustomSprite" };
}
sal_Int64 CanvasCustomSprite::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) {
return RepaintTarget::getSomething(aIdentifier);
}
// Sprite
void CanvasCustomSprite::redraw( OutputDevice& rOutDev,
bool bBufferedUpdate ) const

View file

@ -23,7 +23,6 @@
#include <comphelper/uno3.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/rendering/XBitmapCanvas.hpp>
#include <com/sun/star/rendering/XCustomSprite.hpp>
#include <com/sun/star/rendering/XIntegerBitmap.hpp>
@ -44,8 +43,7 @@ namespace vclcanvas
typedef ::cppu::WeakComponentImplHelper< css::rendering::XCustomSprite,
css::rendering::XBitmapCanvas,
css::rendering::XIntegerBitmap,
css::lang::XServiceInfo,
css::lang::XUnoTunnel> CanvasCustomSpriteBase_Base;
css::lang::XServiceInfo > CanvasCustomSpriteBase_Base;
/** Mixin Sprite
Have to mixin the Sprite interface before deriving from
@ -98,9 +96,6 @@ namespace vclcanvas
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
// XUnoTunnel
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
// Sprite
virtual void redraw( OutputDevice& rOutDev,
bool bBufferedUpdate ) const override;

View file

@ -22,7 +22,6 @@
#include <basegfx/numeric/ftools.hxx>
#include <canvas/canvastools.hxx>
#include <com/sun/star/rendering/PanoseProportion.hpp>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <i18nlangtag/languagetag.hxx>
#include <rtl/math.hxx>
@ -169,15 +168,6 @@ namespace vclcanvas
return { "com.sun.star.rendering.CanvasFont" };
}
sal_Int64 CanvasFont::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) {
return comphelper::getSomethingImpl(aIdentifier, this);
}
css::uno::Sequence<sal_Int8> const & CanvasFont::getUnoTunnelId() {
static comphelper::UnoIdInit const id;
return id.getSeq();
}
vcl::Font const & CanvasFont::getVCLFont() const
{
return *maFont;

View file

@ -23,7 +23,6 @@
#include <cppuhelper/basemutex.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/geometry/Matrix2D.hpp>
#include <com/sun/star/rendering/FontRequest.hpp>
#include <com/sun/star/rendering/XCanvasFont.hpp>
@ -41,8 +40,7 @@
namespace vclcanvas
{
typedef ::cppu::WeakComponentImplHelper< css::rendering::XCanvasFont,
css::lang::XServiceInfo,
css::lang::XUnoTunnel > CanvasFont_Base;
css::lang::XServiceInfo > CanvasFont_Base;
class CanvasFont : public ::cppu::BaseMutex,
public CanvasFont_Base
@ -75,9 +73,6 @@ namespace vclcanvas
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId();
vcl::Font const & getVCLFont() const;
private:

View file

@ -34,7 +34,6 @@
#include <com/sun/star/rendering/PathJoinType.hpp>
#include <com/sun/star/rendering/TextDirection.hpp>
#include <comphelper/sequence.hxx>
#include <comphelper/servicehelper.hxx>
#include <rtl/math.hxx>
#include <comphelper/diagnose_ex.hxx>
#include <tools/poly.hxx>
@ -613,7 +612,7 @@ namespace vclcanvas
ENSURE_ARG_OR_THROW( xLayoutedText.is(),
"layout is NULL");
TextLayout* pTextLayout = comphelper::getFromUnoTunnel< TextLayout >( xLayoutedText );
TextLayout* pTextLayout = dynamic_cast< TextLayout* >( xLayoutedText.get() );
if( pTextLayout )
{
@ -1112,7 +1111,7 @@ namespace vclcanvas
setupOutDevState( viewState, renderState, TEXT_COLOR );
CanvasFont* pFont = comphelper::getFromUnoTunnel< CanvasFont >( xFont );
CanvasFont* pFont = dynamic_cast< CanvasFont* >( xFont.get() );
ENSURE_ARG_OR_THROW( pFont,
"Font not compatible with this canvas" );

View file

@ -35,7 +35,6 @@
#include <com/sun/star/rendering/TexturingMode.hpp>
#include <rtl/math.hxx>
#include <comphelper/diagnose_ex.hxx>
#include <comphelper/servicehelper.hxx>
#include <tools/poly.hxx>
#include <vcl/bitmapex.hxx>
#include <vcl/canvastools.hxx>
@ -638,7 +637,7 @@ namespace vclcanvas
// try to cast XParametricPolyPolygon2D reference to
// our implementation class.
::canvas::ParametricPolyPolygon* pGradient =
comphelper::getFromUnoTunnel< ::canvas::ParametricPolyPolygon >( textures[0].Gradient );
dynamic_cast< ::canvas::ParametricPolyPolygon* >( textures[0].Gradient.get() );
if( pGradient && pGradient->getValues().maColors.hasElements() )
{

View file

@ -28,7 +28,6 @@
#include <basegfx/tuple/b2dtuple.hxx>
#include <rtl/math.hxx>
#include <comphelper/diagnose_ex.hxx>
#include <comphelper/servicehelper.hxx>
#include <sal/log.hxx>
#include <vcl/bitmapex.hxx>
#include <vcl/canvastools.hxx>
@ -51,7 +50,7 @@ namespace vclcanvas::tools
{
// TODO(F3): CanvasCustomSprite should also be tunnelled
// through (also implements XIntegerBitmap interface)
CanvasBitmap* pBitmapImpl = comphelper::getFromUnoTunnel< CanvasBitmap >( xBitmap );
CanvasBitmap* pBitmapImpl = dynamic_cast< CanvasBitmap* >( xBitmap.get() );
if( pBitmapImpl )
{

View file

@ -19,10 +19,6 @@
#pragma once
#include <com/sun/star/uno/Sequence.hxx>
#include <comphelper/servicehelper.hxx>
#include <sal/types.h>
#include "cachedbitmap.hxx"
class Point;
@ -38,7 +34,7 @@ namespace vclcanvas
This interface must be implemented on all canvas
implementations that hand out XCachedPrimitives
*/
class RepaintTarget
class SAL_LOPLUGIN_ANNOTATE("crosscast") RepaintTarget
{
public:
virtual ~RepaintTarget() {}
@ -50,15 +46,6 @@ namespace vclcanvas
const ::Point& rPt,
const ::Size& rSz,
const GraphicAttr& rAttr ) const = 0;
sal_Int64 getSomething(css::uno::Sequence<sal_Int8> const & id) {
return comphelper::getSomethingImpl(id, this);
}
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId() {
static comphelper::UnoIdInit const id;
return id.getSeq();
}
};
}

View file

@ -161,10 +161,6 @@ namespace vclcanvas
return cppu::supportsService(this, sServiceName);
}
sal_Int64 SpriteCanvas::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) {
return RepaintTarget::getSomething(aIdentifier);
}
bool SpriteCanvas::repaint( const GraphicObjectSharedPtr& rGrf,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState,

View file

@ -25,7 +25,6 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XServiceName.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/awt/XWindowListener.hpp>
#include <com/sun/star/util/XUpdatable.hpp>
#include <com/sun/star/rendering/XSpriteCanvas.hpp>
@ -58,8 +57,7 @@ namespace vclcanvas
css::util::XUpdatable,
css::beans::XPropertySet,
css::lang::XServiceName,
css::lang::XServiceInfo,
css::lang::XUnoTunnel > WindowGraphicDeviceBase_Base;
css::lang::XServiceInfo > WindowGraphicDeviceBase_Base;
typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::DisambiguationHelper< WindowGraphicDeviceBase_Base >,
SpriteDeviceHelper,
tools::LocalGuard,
@ -140,9 +138,6 @@ namespace vclcanvas
virtual OUString SAL_CALL getImplementationName() override;
virtual sal_Bool SAL_CALL supportsService(const OUString&) override;
// XUnoTunnel
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
// RepaintTarget
virtual bool repaint( const GraphicObjectSharedPtr& rGrf,
const css::rendering::ViewState& viewState,

View file

@ -29,7 +29,6 @@
#include <com/sun/star/rendering/TextDirection.hpp>
#include <com/sun/star/rendering/ViewState.hpp>
#include <comphelper/sequence.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <utility>
#include <vcl/kernarray.hxx>
@ -421,15 +420,6 @@ namespace vclcanvas
{
return { "com.sun.star.rendering.TextLayout" };
}
sal_Int64 TextLayout::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) {
return comphelper::getSomethingImpl(aIdentifier, this);
}
css::uno::Sequence<sal_Int8> const & TextLayout::getUnoTunnelId() {
static comphelper::UnoIdInit const id;
return id.getSeq();
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -23,7 +23,6 @@
#include <cppuhelper/basemutex.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/rendering/StringContext.hpp>
#include <com/sun/star/rendering/XTextLayout.hpp>
@ -35,8 +34,7 @@
namespace vclcanvas
{
typedef ::cppu::WeakComponentImplHelper< css::rendering::XTextLayout,
css::lang::XServiceInfo,
css::lang::XUnoTunnel > TextLayout_Base;
css::lang::XServiceInfo > TextLayout_Base;
class TextLayout : public ::cppu::BaseMutex,
public TextLayout_Base
@ -80,9 +78,6 @@ namespace vclcanvas
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId();
void draw( OutputDevice& rOutDev,
const Point& rOutpos,
const css::rendering::ViewState& viewState,

View file

@ -377,7 +377,7 @@ void SAL_CALL ChartController::attachFrame(
uno::Reference<ui::XSidebar> xSidebar = getSidebarFromModel(getChartModel());
if (xSidebar.is())
{
auto pSidebar = comphelper::getFromUnoTunnel<sfx2::sidebar::SidebarController>(xSidebar);
auto pSidebar = dynamic_cast<sfx2::sidebar::SidebarController*>(xSidebar.get());
assert(pSidebar);
pSidebar->registerSidebarForFrame(this);
pSidebar->updateModel(getChartModel());
@ -761,7 +761,7 @@ void SAL_CALL ChartController::dispose()
if (getModel().is())
{
uno::Reference<ui::XSidebar> xSidebar = getSidebarFromModel(getChartModel());
if (sfx2::sidebar::SidebarController* pSidebar = comphelper::getFromUnoTunnel<sfx2::sidebar::SidebarController>(xSidebar))
if (sfx2::sidebar::SidebarController* pSidebar = dynamic_cast<sfx2::sidebar::SidebarController*>(xSidebar.get()))
{
pSidebar->unregisterSidebarForFrame(this);
}

View file

@ -23,7 +23,6 @@
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
#include <cppuhelper/exc_hlp.hxx>
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <vcl/weldutils.hxx>
@ -62,7 +61,7 @@ Reference<css::ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement (
Reference<css::frame::XController> xController (aArguments.getOrDefault("Controller", Reference<css::frame::XController>()));
weld::Widget* pParent(nullptr);
if (weld::TransportAsXWindow* pTunnel = comphelper::getFromUnoTunnel<weld::TransportAsXWindow>(xParentWindow))
if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(xParentWindow.get()))
pParent = pTunnel->getWidget();
if (!pParent)

View file

@ -25,7 +25,6 @@
#include <com/sun/star/chart2/XDiagram.hpp>
#include <comphelper/lok.hxx>
#include <comphelper/servicehelper.hxx>
#include <sfx2/viewsh.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
@ -36,7 +35,7 @@ namespace {
SvxLineStyleToolBoxControl* getLineStyleToolBoxControl(const ToolbarUnoDispatcher& rToolBoxColor)
{
css::uno::Reference<css::frame::XToolbarController> xController = rToolBoxColor.GetControllerForCommand(".uno:XLineStyle");
SvxLineStyleToolBoxControl* pToolBoxLineStyleControl = comphelper::getFromUnoTunnel<SvxLineStyleToolBoxControl>(xController);
SvxLineStyleToolBoxControl* pToolBoxLineStyleControl = dynamic_cast<SvxLineStyleToolBoxControl*>(xController.get());
return pToolBoxLineStyleControl;
}

View file

@ -25,13 +25,11 @@
#include <com/sun/star/embed/XInplaceClient.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/lang/NoSupportException.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
#include <com/sun/star/io/TempFile.hpp>
#include <comphelper/multicontainer2.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/storagehelper.hxx>
#include <cppuhelper/queryinterface.hxx>
@ -764,7 +762,6 @@ uno::Sequence<uno::Type> SAL_CALL OCommonEmbeddedObject::getTypes()
cppu::UnoType<lang::XServiceInfo>::get(),
cppu::UnoType<lang::XInitialization>::get(),
cppu::UnoType<lang::XTypeProvider>::get(),
cppu::UnoType<lang::XUnoTunnel>::get(),
};
return aTypes;
}
@ -774,10 +771,6 @@ uno::Sequence<sal_Int8> SAL_CALL OCommonEmbeddedObject::getImplementationId()
return uno::Sequence<sal_Int8>();
}
sal_Int64 OCommonEmbeddedObject::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) {
return comphelper::getSomethingImpl(aIdentifier, static_cast<EmbeddedUpdate *>(this));
}
void SAL_CALL OCommonEmbeddedObject::initialize(const uno::Sequence<uno::Any>& rArguments)
{
if (!rArguments.hasElements())

View file

@ -35,12 +35,11 @@
#include <com/sun/star/io/XTempFile.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <cppuhelper/weak.hxx>
#include <embeddedobj/embeddedupdate.hxx>
#include <rtl/ref.hxx>
#include <map>
#include <memory>
#include <svtools/embeddedupdate.hxx>
#include <svtools/filechangedchecker.hxx>
namespace com::sun::star {
@ -88,7 +87,6 @@ class OCommonEmbeddedObject : public css::embed::XEmbeddedObject
, public css::lang::XServiceInfo
, public css::lang::XInitialization
, public css::lang::XTypeProvider
, public css::lang::XUnoTunnel
, public ::cppu::OWeakObject
{
protected:
@ -436,9 +434,6 @@ public:
// XTypeProvider
css::uno::Sequence<css::uno::Type> SAL_CALL getTypes() override;
css::uno::Sequence<sal_Int8> SAL_CALL getImplementationId() override;
// XUnoTunnel
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -26,7 +26,6 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/propertyvalue.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/string.hxx>
#include <tools/debug.hxx>
#include <comphelper/diagnose_ex.hxx>
@ -111,7 +110,7 @@ namespace pcr
{
m_xControl = rxControl;
auto xWindow = m_xControl->getControlWindow();
if (weld::TransportAsXWindow* pTunnel = comphelper::getFromUnoTunnel<weld::TransportAsXWindow>(xWindow))
if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(xWindow.get()))
m_pControlWindow = pTunnel->getWidget();
else
m_pControlWindow = nullptr;

View file

@ -107,13 +107,13 @@ namespace pcr
@param TControlWindow
a class which is derived from weld::Widget
*/
template < class TControlWindow, class... TControlInterface >
template < class TControlInterface, class TControlWindow >
class CommonBehaviourControl :public ::cppu::BaseMutex
,public ::cppu::WeakComponentImplHelper< TControlInterface... >
,public ::cppu::WeakComponentImplHelper< TControlInterface >
,public CommonBehaviourControlHelper
{
protected:
typedef ::cppu::WeakComponentImplHelper< TControlInterface... > ComponentBaseClass;
typedef ::cppu::WeakComponentImplHelper< TControlInterface > ComponentBaseClass;
inline CommonBehaviourControl(sal_Int16 nControlType,
std::unique_ptr<weld::Builder> xBuilder,
@ -179,8 +179,8 @@ namespace pcr
};
//= CommonBehaviourControl - implementation
template< class TControlWindow, class... TControlInterface >
inline CommonBehaviourControl< TControlWindow, TControlInterface... >::CommonBehaviourControl(sal_Int16 nControlType,
template< class TControlInterface, class TControlWindow >
inline CommonBehaviourControl< TControlInterface, TControlWindow >::CommonBehaviourControl(sal_Int16 nControlType,
std::unique_ptr<weld::Builder> xBuilder,
std::unique_ptr<TControlWindow> xWidget,
bool bReadOnly)
@ -196,8 +196,8 @@ namespace pcr
}
}
template< class TControlWindow, class... TControlInterface >
inline void CommonBehaviourControl< TControlWindow, TControlInterface... >::impl_checkDisposed_throw()
template< class TControlInterface, class TControlWindow >
inline void CommonBehaviourControl< TControlInterface, TControlWindow >::impl_checkDisposed_throw()
{
if ( ComponentBaseClass::rBHelper.bDisposed )
throw css::lang::DisposedException( OUString(), *this );

View file

@ -32,7 +32,6 @@
#include <com/sun/star/xsd/DataTypeClass.hpp>
#include <com/sun/star/form/binding/XListEntrySink.hpp>
#include <comphelper/diagnose_ex.hxx>
#include <comphelper/servicehelper.hxx>
#include <algorithm>
#include <o3tl/functional.hxx>
@ -244,7 +243,7 @@ namespace pcr
::comphelper::OInterfaceIteratorHelper3 aListenerIterator(m_aPropertyListeners);
while ( aListenerIterator.hasMoreElements() )
{
PropertyEventTranslation* pTranslator = comphelper::getFromUnoTunnel< PropertyEventTranslation >( aListenerIterator.next() );
PropertyEventTranslation* pTranslator = dynamic_cast< PropertyEventTranslation* >( aListenerIterator.next().get() );
OSL_ENSURE( pTranslator, "EFormsHelper::impl_toggleBindingPropertyListening_throw: invalid listener element in my container!" );
if ( !pTranslator )
continue;

View file

@ -77,7 +77,6 @@
#include <com/sun/star/text/WritingMode2.hpp>
#include <comphelper/extract.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
#include <connectivity/dbconversion.hxx>
#include <connectivity/dbexception.hxx>
@ -1709,7 +1708,7 @@ namespace pcr
catch( const UnknownPropertyException& ) {}
if ( xControl.is() )
{
OFormattedNumericControl* pControl = comphelper::getFromUnoTunnel< OFormattedNumericControl >( xControl );
OFormattedNumericControl* pControl = dynamic_cast< OFormattedNumericControl* >( xControl.get() );
DBG_ASSERT( pControl, "FormComponentPropertyHandler::actuatingPropertyChanged: invalid control!" );
if (pControl)
{
@ -1755,7 +1754,7 @@ namespace pcr
catch( const UnknownPropertyException& ) {}
if ( xControl.is() )
{
OFormattedNumericControl* pControl = comphelper::getFromUnoTunnel< OFormattedNumericControl >( xControl );
OFormattedNumericControl* pControl = dynamic_cast< OFormattedNumericControl* >( xControl.get() );
DBG_ASSERT( pControl, "FormComponentPropertyHandler::actuatingPropertyChanged: invalid control!" );
if ( pControl )
pControl->SetFormatDescription( aNewDesc );

View file

@ -30,7 +30,6 @@
#include <com/sun/star/inspection/XStringListControl.hpp>
#include <com/sun/star/inspection/XNumericControl.hpp>
#include <comphelper/diagnose_ex.hxx>
#include <comphelper/servicehelper.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
#include <vcl/weldutils.hxx>
@ -292,10 +291,8 @@ namespace pcr
std::unique_ptr<weld::Builder> PropertyHandlerHelper::makeBuilder(const OUString& rUIFile, const Reference<XComponentContext>& rContext)
{
Reference<XWindow> xWindow(rContext->getValueByName("BuilderParent"), UNO_QUERY_THROW);
weld::TransportAsXWindow* pTunnel
= comphelper::getFromUnoTunnel<weld::TransportAsXWindow>(xWindow);
assert(pTunnel && "must exist");
return Application::CreateBuilder(pTunnel->getWidget(), rUIFile);
weld::TransportAsXWindow& rTunnel = dynamic_cast<weld::TransportAsXWindow&>(*xWindow);
return Application::CreateBuilder(rTunnel.getWidget(), rUIFile);
}
void PropertyHandlerHelper::setBuilderParent(const css::uno::Reference<css::uno::XComponentContext>& rContext, weld::Widget* pParent)

View file

@ -38,7 +38,6 @@
#include <com/sun/star/util/VetoException.hpp>
#include <tools/debug.hxx>
#include <comphelper/diagnose_ex.hxx>
#include <comphelper/servicehelper.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
@ -339,7 +338,7 @@ namespace pcr
OUString sUIFile("modules/spropctrlr/ui/formproperties.ui");
std::unique_ptr<weld::Builder> xBuilder;
if (weld::TransportAsXWindow* pTunnel = comphelper::getFromUnoTunnel<weld::TransportAsXWindow>(xContainerWindow))
if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(xContainerWindow.get()))
{
xBuilder = Application::CreateBuilder(pTunnel->getWidget(), sUIFile);
}
@ -1108,7 +1107,7 @@ namespace pcr
// for ui-testing try and distinguish different instances of the controls
auto xWindow = _rDescriptor.Control->getControlWindow();
if (weld::TransportAsXWindow* pTunnel = comphelper::getFromUnoTunnel<weld::TransportAsXWindow>(xWindow))
if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(xWindow.get()))
{
weld::Widget* m_pControlWindow = pTunnel->getWidget();
if (m_pControlWindow)

View file

@ -20,7 +20,6 @@
#include "propeventtranslation.hxx"
#include <com/sun/star/lang/DisposedException.hpp>
#include <comphelper/servicehelper.hxx>
namespace pcr
@ -49,18 +48,6 @@ namespace pcr
}
sal_Int64 PropertyEventTranslation::getSomething(
css::uno::Sequence<sal_Int8> const & aIdentifier)
{
return comphelper::getSomethingImpl(aIdentifier, this);
}
css::uno::Sequence<sal_Int8> const & PropertyEventTranslation::getUnoTunnelId() {
static comphelper::UnoIdInit const id;
return id.getSeq();
}
void SAL_CALL PropertyEventTranslation::propertyChange( const PropertyChangeEvent& evt )
{
if ( !m_xDelegator.is() )

View file

@ -20,7 +20,6 @@
#pragma once
#include <com/sun/star/beans/XPropertyChangeListener.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <cppuhelper/implbase.hxx>
@ -30,7 +29,7 @@ namespace pcr
//= PropertyEventTranslation
typedef ::cppu::WeakImplHelper < css::beans::XPropertyChangeListener, css::lang::XUnoTunnel
typedef ::cppu::WeakImplHelper < css::beans::XPropertyChangeListener
> PropertyEventTranslation_Base;
class PropertyEventTranslation : public PropertyEventTranslation_Base
@ -53,9 +52,6 @@ namespace pcr
const css::uno::Reference< css::beans::XPropertyChangeListener >&
getDelegator() const { return m_xDelegator; }
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId();
protected:
// XPropertyChangeListener
virtual void SAL_CALL propertyChange( const css::beans::PropertyChangeEvent& evt ) override;

View file

@ -33,7 +33,7 @@
namespace pcr
{
//= OTimeControl
typedef CommonBehaviourControl<weld::FormattedSpinButton, css::inspection::XPropertyControl> OTimeControl_Base;
typedef CommonBehaviourControl<css::inspection::XPropertyControl, weld::FormattedSpinButton> OTimeControl_Base;
class OTimeControl : public OTimeControl_Base
{
std::unique_ptr<weld::TimeFormatter> m_xFormatter;
@ -61,7 +61,7 @@ namespace pcr
};
//= ODateControl
typedef CommonBehaviourControl<weld::Container, css::inspection::XPropertyControl> ODateControl_Base;
typedef CommonBehaviourControl<css::inspection::XPropertyControl, weld::Container> ODateControl_Base;
class ODateControl : public ODateControl_Base
{
std::unique_ptr<weld::Entry> m_xEntry;
@ -97,7 +97,7 @@ namespace pcr
};
//= OEditControl
typedef CommonBehaviourControl<weld::Entry, css::inspection::XPropertyControl> OEditControl_Base;
typedef CommonBehaviourControl<css::inspection::XPropertyControl, weld::Entry> OEditControl_Base;
class OEditControl final : public OEditControl_Base
{
bool m_bIsPassword : 1;
@ -123,7 +123,7 @@ namespace pcr
};
//= ODateTimeControl
typedef CommonBehaviourControl<weld::Container, css::inspection::XPropertyControl> ODateTimeControl_Base;
typedef CommonBehaviourControl<css::inspection::XPropertyControl, weld::Container> ODateTimeControl_Base;
class ODateTimeControl : public ODateTimeControl_Base
{
private:
@ -162,7 +162,7 @@ namespace pcr
};
//= OHyperlinkControl
typedef CommonBehaviourControl<weld::Container, css::inspection::XHyperlinkControl> OHyperlinkControl_Base;
typedef CommonBehaviourControl<css::inspection::XHyperlinkControl, weld::Container> OHyperlinkControl_Base;
class OHyperlinkControl final : public OHyperlinkControl_Base
{
private:
@ -203,7 +203,7 @@ namespace pcr
};
//= ONumericControl
typedef CommonBehaviourControl<weld::MetricSpinButton, css::inspection::XNumericControl> ONumericControl_Base;
typedef CommonBehaviourControl<css::inspection::XNumericControl, weld::MetricSpinButton> ONumericControl_Base;
class ONumericControl : public ONumericControl_Base
{
private:
@ -255,7 +255,7 @@ namespace pcr
};
//= OColorControl
typedef CommonBehaviourControl<ColorListBox, css::inspection::XPropertyControl> OColorControl_Base;
typedef CommonBehaviourControl<css::inspection::XPropertyControl, ColorListBox> OColorControl_Base;
class OColorControl : public OColorControl_Base
{
public:
@ -281,7 +281,7 @@ namespace pcr
};
//= OListboxControl
typedef CommonBehaviourControl<weld::ComboBox, css::inspection::XStringListControl> OListboxControl_Base;
typedef CommonBehaviourControl<css::inspection::XStringListControl, weld::ComboBox> OListboxControl_Base;
class OListboxControl : public OListboxControl_Base
{
public:
@ -311,7 +311,7 @@ namespace pcr
};
//= OComboboxControl
typedef CommonBehaviourControl< weld::ComboBox, css::inspection::XStringListControl > OComboboxControl_Base;
typedef CommonBehaviourControl< css::inspection::XStringListControl, weld::ComboBox > OComboboxControl_Base;
class OComboboxControl final : public OComboboxControl_Base
{
public:
@ -351,7 +351,7 @@ namespace pcr
};
//= OMultilineEditControl
typedef CommonBehaviourControl<weld::Container, css::inspection::XPropertyControl> OMultilineEditControl_Base;
typedef CommonBehaviourControl<css::inspection::XPropertyControl, weld::Container> OMultilineEditControl_Base;
class OMultilineEditControl : public OMultilineEditControl_Base
{
private:

View file

@ -20,7 +20,6 @@
#include "usercontrol.hxx"
#include <com/sun/star/inspection/PropertyControlType.hpp>
#include <comphelper/servicehelper.hxx>
#include <svl/numuno.hxx>
#include <vcl/GraphicObject.hxx>
#include <vcl/event.hxx>
@ -200,17 +199,6 @@ namespace pcr
return ::cppu::UnoType<double>::get();
}
sal_Int64 OFormattedNumericControl::getSomething(
css::uno::Sequence<sal_Int8> const & aIdentifier)
{
return comphelper::getSomethingImpl(aIdentifier, this);
}
css::uno::Sequence<sal_Int8> const & OFormattedNumericControl::getUnoTunnelId() {
static comphelper::UnoIdInit const id;
return id.getSeq();
}
void OFormattedNumericControl::SetFormatDescription(const FormatDescription& rDesc)
{
bool bFallback = true;

View file

@ -20,7 +20,6 @@
#pragma once
#include "commoncontrol.hxx"
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <svtools/inettbc.hxx>
#include <svl/zforlist.hxx>
@ -29,7 +28,7 @@ class SvNumberFormatsSupplierObj;
namespace pcr
{
//= OFormatSampleControl
typedef CommonBehaviourControl<weld::Container, css::inspection::XPropertyControl> OFormatSampleControl_Base;
typedef CommonBehaviourControl<css::inspection::XPropertyControl, weld::Container> OFormatSampleControl_Base;
class OFormatSampleControl : public OFormatSampleControl_Base
{
private:
@ -85,7 +84,7 @@ namespace pcr
};
//= OFormattedNumericControl
typedef CommonBehaviourControl<weld::FormattedSpinButton, css::inspection::XPropertyControl, css::lang::XUnoTunnel> OFormattedNumericControl_Base;
typedef CommonBehaviourControl<css::inspection::XPropertyControl, weld::FormattedSpinButton> OFormattedNumericControl_Base;
class OFormattedNumericControl : public OFormattedNumericControl_Base
{
public:
@ -96,9 +95,6 @@ namespace pcr
virtual void SAL_CALL setValue( const css::uno::Any& _value ) override;
virtual css::uno::Type SAL_CALL getValueType() override;
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId();
void SetFormatDescription( const FormatDescription& rDesc );
// make some FormattedField methods available
@ -119,7 +115,7 @@ namespace pcr
};
//= OFileUrlControl
typedef CommonBehaviourControl<SvtURLBox, css::inspection::XPropertyControl> OFileUrlControl_Base;
typedef CommonBehaviourControl<css::inspection::XPropertyControl, SvtURLBox> OFileUrlControl_Base;
class OFileUrlControl : public OFileUrlControl_Base
{
private:

View file

@ -22,7 +22,6 @@
#include <comphelper/uno3.hxx>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/lang/EventObject.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <com/sun/star/io/XPersistObject.hpp>
#include <com/sun/star/beans/XPropertyChangeListener.hpp>
@ -38,7 +37,7 @@
#include <comphelper/interfacecontainer3.hxx>
#include <cppuhelper/component.hxx>
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/implbase9.hxx>
#include <cppuhelper/implbase8.hxx>
#include <unordered_map>
namespace com::sun::star::uno { class XComponentContext; }
@ -73,7 +72,7 @@ typedef std::unordered_multimap< OUString, css::uno::Reference<css::uno::XInterf
// OInterfaceContainer
// implements a container for form components
typedef ::cppu::ImplHelper9 < css::container::XNameContainer
typedef ::cppu::ImplHelper8 < css::container::XNameContainer
, css::container::XIndexContainer
, css::container::XContainer
, css::container::XEnumerationAccess
@ -81,7 +80,6 @@ typedef ::cppu::ImplHelper9 < css::container::XNameContainer
, css::beans::XPropertyChangeListener
, css::io::XPersistObject
, css::util::XCloneable
, css::lang::XUnoTunnel
> OInterfaceContainer_BASE;
class OInterfaceContainer : public OInterfaceContainer_BASE
@ -175,9 +173,6 @@ public:
virtual void SAL_CALL addScriptListener( const css::uno::Reference< css::script::XScriptListener >& xListener ) override;
virtual void SAL_CALL removeScriptListener( const css::uno::Reference< css::script::XScriptListener >& Listener ) override;
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId();
protected:
// helper
virtual void SAL_CALL disposing();

View file

@ -41,7 +41,6 @@
#include <comphelper/eventattachermgr.hxx>
#include <comphelper/property.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <o3tl/safeint.hxx>
@ -835,7 +834,7 @@ void OInterfaceContainer::implInsert(sal_Int32 _nIndex, const Reference< XProper
if ( bHandleVbaEvents )
{
Reference< XEventAttacherManager > xMgr ( pElementMetaData->xInterface, UNO_QUERY );
OInterfaceContainer* pIfcMgr = xMgr.is() ? comphelper::getFromUnoTunnel<OInterfaceContainer>(xMgr) : nullptr;
OInterfaceContainer* pIfcMgr = xMgr.is() ? dynamic_cast<OInterfaceContainer*>(xMgr.get()) : nullptr;
if (pIfcMgr)
{
sal_Int32 nLen = pIfcMgr->getCount();
@ -1237,16 +1236,6 @@ void SAL_CALL OInterfaceContainer::removeScriptListener( const Reference< XScrip
}
sal_Int64 OInterfaceContainer::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) {
return comphelper::getSomethingImpl(aIdentifier, this);
}
css::uno::Sequence<sal_Int8> const & OInterfaceContainer::getUnoTunnelId() {
static comphelper::UnoIdInit const id;
return id.getSeq();
}
//= OFormComponents

View file

@ -22,15 +22,12 @@
#include <helper/uielementwrapperbase.hxx>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <cppuhelper/implbase.hxx>
namespace framework
{
class AddonsToolBarWrapper final :
public cppu::ImplInheritanceHelper<UIElementWrapperBase, css::lang::XUnoTunnel>
class AddonsToolBarWrapper final : public UIElementWrapperBase
{
public:
AddonsToolBarWrapper( const css::uno::Reference< css::uno::XComponentContext >& xContext );
@ -48,9 +45,6 @@ class AddonsToolBarWrapper final :
// cf. ToolbarLayoutManager
void populateImages();
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId();
private:
css::uno::Reference< css::uno::XComponentContext > m_xContext;
css::uno::Reference< css::lang::XComponent > m_xToolBarManager;

View file

@ -34,7 +34,6 @@
#include <com/sun/star/ui/XUIFunctionListener.hpp>
#include <comphelper/propertyvalue.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <o3tl/string_view.hxx>
#include <unotools/cmdoptions.hxx>
@ -669,7 +668,7 @@ bool ToolbarLayoutManager::showToolbar( std::u16string_view rResourceURL )
// Addons appear to need to be populated at start, but we don't
// want to populate them with (scaled) images until later.
AddonsToolBarWrapper *pAddOns;
pAddOns = comphelper::getFromUnoTunnel<AddonsToolBarWrapper>( aUIElement.m_xUIElement);
pAddOns = dynamic_cast<AddonsToolBarWrapper *>( aUIElement.m_xUIElement.get());
if (pAddOns)
pAddOns->populateImages();

View file

@ -50,7 +50,6 @@
#include <comphelper/numberedcollection.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/lok.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <utility>
#include <vcl/svapp.hxx>
@ -336,15 +335,6 @@ void Desktop::shutdown()
xSfxTerminator->notifyTermination(aEvent);
}
sal_Int64 Desktop::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) {
return comphelper::getSomethingImpl(aIdentifier, this);
}
css::uno::Sequence<sal_Int8> const & Desktop::getUnoTunnelId() {
static comphelper::UnoIdInit const id;
return id.getSeq();
}
namespace
{
class QuickstartSuppressor

View file

@ -23,7 +23,6 @@
#include <framework/desktop.hxx>
#include <comphelper/diagnose_ex.hxx>
#include <comphelper/servicehelper.hxx>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/frame/theAutoRecovery.hpp>
@ -343,7 +342,7 @@ void SAL_CALL SessionListener::approveInteraction( sal_Bool bInteractionGranted
css::uno::Reference< css::frame::XDesktop2 > xDesktop = css::frame::Desktop::create( m_xContext );
// honestly: how many implementations of XDesktop will we ever have?
// so casting this directly to the implementation
Desktop* pDesktop(comphelper::getFromUnoTunnel<Desktop>(xDesktop));
Desktop* pDesktop(dynamic_cast<Desktop*>(xDesktop.get()));
if(pDesktop)
{
SAL_INFO("fwk.session", " XDesktop is a framework::Desktop -- good.");

View file

@ -23,7 +23,6 @@
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/ui/UIElementType.hpp>
#include <comphelper/servicehelper.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/svapp.hxx>
@ -41,7 +40,7 @@ namespace framework
{
AddonsToolBarWrapper::AddonsToolBarWrapper( const Reference< XComponentContext >& xContext ) :
ImplInheritanceHelper( UIElementType::TOOLBAR ),
UIElementWrapperBase( UIElementType::TOOLBAR ),
m_xContext( xContext ),
m_bCreatedImages( false )
{
@ -167,15 +166,6 @@ void AddonsToolBarWrapper::populateImages()
}
}
sal_Int64 AddonsToolBarWrapper::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) {
return comphelper::getSomethingImpl(aIdentifier, this);
}
css::uno::Sequence<sal_Int8> const & AddonsToolBarWrapper::getUnoTunnelId() {
static comphelper::UnoIdInit const id;
return id.getSeq();
}
} // namespace framework
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -24,7 +24,6 @@
#include <com/sun/star/ui/UIElementType.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <comphelper/servicehelper.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/svapp.hxx>
@ -154,7 +153,7 @@ void SAL_CALL ToolBarWrapper::initialize( const Sequence< Any >& aArguments )
m_xToolBarManager = pToolBarManager;
pToolBar->WillUsePopupMode( bPopupMode );
}
else if (weld::TransportAsXWindow* pTunnel = comphelper::getFromUnoTunnel<weld::TransportAsXWindow>(xParentWindow))
else if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(xParentWindow.get()))
{
m_xBuilder = Application::CreateBuilder(pTunnel->getWidget(), "svt/ui/managedtoolbar.ui");
m_xTopLevel = m_xBuilder->weld_container("toolbarcontainer");

View file

@ -21,9 +21,7 @@
#include "calendarImpl.hxx"
#include <com/sun/star/i18n/CalendarFieldIndex.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <cppuhelper/implbase.hxx>
#include <unicode/calendar.h>
#include <rtl/ref.hxx>
@ -46,7 +44,7 @@ struct Era {
const sal_Int16 FIELD_INDEX_COUNT = css::i18n::CalendarFieldIndex::FIELD_COUNT2;
class Calendar_gregorian : public cppu::ImplInheritanceHelper<CalendarImpl, css::lang::XUnoTunnel>
class Calendar_gregorian : public CalendarImpl
{
public:
@ -100,9 +98,6 @@ public:
virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
virtual css::uno::Sequence < OUString > SAL_CALL getSupportedServiceNames() override;
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId();
protected:
const Era *eraArray;
std::unique_ptr<icu::Calendar> body;

View file

@ -21,7 +21,6 @@
#include <calendar_gregorian.hxx>
#include <localedata.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
@ -91,7 +90,7 @@ CalendarImpl::loadCalendarTZ( const OUString& uniqueID, const css::lang::Locale&
/* XXX NOTE: currently (2019-06-19) calendar implementations derive
* from Calendar_gregorian, even Hijri and Jewish. If that should
* change in future this should be adapted. */
Calendar_gregorian* pCal = comphelper::getFromUnoTunnel<Calendar_gregorian>(xCalendar);
Calendar_gregorian* pCal = dynamic_cast<Calendar_gregorian*>(xCalendar.get());
bTimeZone = (pCal && pCal->setTimeZone(rTimeZone));
}

View file

@ -26,7 +26,6 @@
#include <com/sun/star/i18n/CalendarDisplayIndex.hpp>
#include <com/sun/star/i18n/NativeNumberMode.hpp>
#include <com/sun/star/i18n/reservedWords.hpp>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <o3tl/sprintf.hxx>
#include <rtl/math.hxx>
@ -1078,15 +1077,6 @@ Calendar_gregorian::getSupportedServiceNames()
return aRet;
}
sal_Int64 Calendar_gregorian::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) {
return comphelper::getSomethingImpl(aIdentifier, this);
}
css::uno::Sequence<sal_Int8> const & Calendar_gregorian::getUnoTunnelId() {
static comphelper::UnoIdInit const id;
return id.getSeq();
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -22,7 +22,6 @@
#include <comphelper/compbase.hxx>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/rendering/FillRule.hpp>
#include <com/sun/star/rendering/XLinePolyPolygon2D.hpp>
#include <com/sun/star/rendering/XBezierPolyPolygon2D.hpp>
@ -35,8 +34,7 @@ namespace basegfx::unotools
typedef comphelper::WeakComponentImplHelper<
css::rendering::XLinePolyPolygon2D,
css::rendering::XBezierPolyPolygon2D,
css::lang::XServiceInfo,
css::lang::XUnoTunnel > UnoPolyPolygonBase;
css::lang::XServiceInfo > UnoPolyPolygonBase;
class BASEGFX_DLLPUBLIC UnoPolyPolygon
: public UnoPolyPolygonBase
@ -70,10 +68,6 @@ namespace basegfx::unotools
SAL_DLLPRIVATE virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
SAL_DLLPRIVATE virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
SAL_DLLPRIVATE sal_Int64 SAL_CALL getSomething(
css::uno::Sequence<sal_Int8> const & aIdentifier) override;
static SAL_DLLPRIVATE css::uno::Sequence<sal_Int8> const & getUnoTunnelId();
SAL_DLLPRIVATE B2DPolyPolygon getPolyPolygon() const;
protected:

View file

@ -82,16 +82,6 @@ namespace comphelper {
&& memcmp(T::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0;
}
template<typename T> struct MixinToGetSomethingOf {
static bool get(css::uno::Sequence<sal_Int8> const & id, T * p, sal_Int64 * result) {
if (!isUnoTunnelId<T>(id)) {
return false;
}
*result = getSomething_cast(p);
return true;
}
};
template <class Base> struct FallbackToGetSomethingOf
{
static sal_Int64 get(const css::uno::Sequence<sal_Int8>& rId, Base* p)
@ -105,85 +95,12 @@ namespace comphelper {
static sal_Int64 get(const css::uno::Sequence<sal_Int8>&, void*) { return 0; }
};
// There are five cases how to implement T::getSomething:
// (1) Delegate to Base:
// Either, if Base has only getUnoTunnelId but no getSomething:
// return getSomethingImpl<Base>(aIdentifier, this);
// Or, if Base has getSomething:
// return Base::getSomething(aIdentifier)
// (2) Check against T::getUnoTunnelId, else return 0:
// return getSomethingImpl(aIdentifier, this);
// (3) Check against T::getUnoTunnelId, else delegate to Base:
// return getSomethingImpl(aIdentifier, this, FallbackToGetSomethingOf<Base>{});
// (4) Check against T::getUnoTunnelId, else check against each Mixins::getUnoTunnelId, else
// delegate to Base:
// return getSomethingImpl(
// aIdentifier, this, MixinToGetSomethingOf<Mixin1>{}, ...,
// MixinToGetSomethingOf<MixinN>{}, FallbackToGetSomethingOf<Base>{});
// (5) Check against each Mixins::getUnoTunnelId, else delegate to Base:
// return getSomethingImpl_skipDerived(
// aIdentifier, this, MixinToGetSomethingOf<Mixin1>{}, ...,
// MixinToGetSomethingOf<MixinN>{}, FallbackToGetSomethingOf<Base>{});
template <class T, class Base = void>
sal_Int64 getSomethingImpl(const css::uno::Sequence<sal_Int8>& rId, T* pThis,
FallbackToGetSomethingOf<Base> = {})
{
sal_Int64 res;
if (MixinToGetSomethingOf<T>::get(rId, pThis, &res)) {
return res;
}
return FallbackToGetSomethingOf<Base>::get(rId, pThis);
}
#if defined _MSC_VER && _MSC_VER < 1930 && !defined __clang__
// Without this additional overload, at least VS 2019 16.11.21 has sometimes issues deducing the
// Base template argument in calls to the "full" getSomethingImpl overload with zero arguments
// substituted for the variadic Mixins parameter:
template <class T, class Mixin, class Base>
sal_Int64 getSomethingImpl(const css::uno::Sequence<sal_Int8>& rId, T* pThis,
MixinToGetSomethingOf<Mixin>,
FallbackToGetSomethingOf<Base>)
{
sal_Int64 res;
if (MixinToGetSomethingOf<T>::get(rId, pThis, &res)
|| MixinToGetSomethingOf<Mixin>::get(rId, pThis, &res))
{
return res;
}
return FallbackToGetSomethingOf<Base>::get(rId, pThis);
}
#endif
template <class T, class Mixin, class... Mixins, class Base>
sal_Int64 getSomethingImpl(const css::uno::Sequence<sal_Int8>& rId, T* pThis,
MixinToGetSomethingOf<Mixin>, MixinToGetSomethingOf<Mixins>...,
FallbackToGetSomethingOf<Base>)
{
sal_Int64 res;
if (((MixinToGetSomethingOf<T>::get(rId, pThis, &res)
|| MixinToGetSomethingOf<Mixin>::get(rId, pThis, &res)) || ...
|| MixinToGetSomethingOf<Mixins>::get(rId, pThis, &res)))
{
return res;
}
return FallbackToGetSomethingOf<Base>::get(rId, pThis);
}
template <class T, class Mixin, class... Mixins, class Base>
sal_Int64 getSomethingImpl_skipDerived(const css::uno::Sequence<sal_Int8>& rId, T* pThis,
MixinToGetSomethingOf<Mixin>, MixinToGetSomethingOf<Mixins>...,
FallbackToGetSomethingOf<Base>)
{
sal_Int64 res;
if ((MixinToGetSomethingOf<Mixin>::get(rId, pThis, &res) || ...
|| MixinToGetSomethingOf<Mixins>::get(rId, pThis, &res)))
{
return res;
}
if (isUnoTunnelId<T>(rId))
return getSomething_cast(pThis);
return FallbackToGetSomethingOf<Base>::get(rId, pThis);
}

View file

@ -9,9 +9,7 @@
#pragma once
#include <com/sun/star/uno/Sequence.hxx>
#include <sal/types.h>
#include <svtools/svtdllapi.h>
#include <embeddedobj/embobjdllapi.h>
namespace com
{
@ -26,7 +24,7 @@ namespace embed
@since LibreOffice 7.4
*/
class SVT_DLLPUBLIC EmbeddedUpdate
class EMBOBJ_DLLPUBLIC SAL_LOPLUGIN_ANNOTATE("crosscast") EmbeddedUpdate
{
/** By "Refresh all" is used to perform an OLE update and a link update.
In the case of a link update, the class OCommonEmbeddedObject is
@ -42,8 +40,6 @@ public:
EmbeddedUpdate() = default;
virtual ~EmbeddedUpdate() = default;
static css::uno::Sequence<sal_Int8> const& getUnoTunnelId();
private:
EmbeddedUpdate(const EmbeddedUpdate&) = delete;
EmbeddedUpdate& operator=(const EmbeddedUpdate&) = delete;

View file

@ -36,7 +36,6 @@
#include <com/sun/star/frame/XFramesSupplier.hpp>
#include <com/sun/star/frame/XFrames.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/frame/XTasksSupplier.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
@ -95,8 +94,7 @@ typedef cppu::WeakComponentImplHelper<
css::frame::XTasksSupplier ,
css::frame::XDispatchResultListener , // => XEventListener
css::task::XInteractionHandler ,
css::frame::XUntitledNumbers,
css::lang::XUnoTunnel > Desktop_BASE;
css::frame::XUntitledNumbers > Desktop_BASE;
class FWK_DLLPUBLIC Desktop final : private cppu::BaseMutex,
public Desktop_BASE,
@ -289,9 +287,6 @@ class FWK_DLLPUBLIC Desktop final : private cppu::BaseMutex,
void shutdown();
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId();
private:
// OPropertySetHelper
virtual sal_Bool SAL_CALL convertFastPropertyValue ( css::uno::Any& aConvertedValue ,

View file

@ -9,14 +9,12 @@
#ifndef INCLUDED_OOX_MATHML_IMEXPORT_HXX
#define INCLUDED_OOX_MATHML_IMEXPORT_HXX
#include <com/sun/star/uno/Sequence.hxx>
#include <oox/core/filterbase.hxx>
#include <oox/dllapi.h>
#include <oox/export/utils.hxx>
#include <rtl/ref.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/textenc.h>
#include <sal/types.h>
#include <sax/fshelper.hxx>
#include <tools/gen.hxx>
@ -45,9 +43,6 @@ public:
virtual void writeFormulaRtf( OStringBuffer& rBuffer, rtl_TextEncoding nEncoding ) = 0;
enum eFormulaAlign { INLINE, CENTER, GROUPEDCENTER, LEFT, RIGHT };
sal_Int64 getSomething(css::uno::Sequence<sal_Int8> const & id);
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId();
protected:
FormulaImExportBase();

View file

@ -12,17 +12,14 @@
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/io/XStream.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/security/XCertificate.hpp>
#include <cppuhelper/implbase.hxx>
#include <sal/types.h>
#include <sfx2/dllapi.h>
namespace sfx2
{
/// Extension of css::security::XDocumentDigitalSignatures for internal purposes.
class SFX2_DLLPUBLIC DigitalSignatures : public cppu::WeakImplHelper<css::lang::XUnoTunnel>
class SAL_NO_VTABLE SAL_DLLPUBLIC_RTTI SAL_LOPLUGIN_ANNOTATE("crosscast") DigitalSignatures
{
public:
/// Same as signDocumentWithCertificate(), but passes the xModel as well.
@ -33,12 +30,8 @@ public:
const css::uno::Reference<css::io::XStream>& xStream)
= 0;
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const& aIdentifier) override;
static css::uno::Sequence<sal_Int8> const& getUnoTunnelId();
protected:
DigitalSignatures();
~DigitalSignatures() override;
~DigitalSignatures() noexcept = default;
};
}

View file

@ -33,7 +33,6 @@
#include <com/sun/star/beans/XPropertyChangeListener.hpp>
#include <com/sun/star/frame/XStatusListener.hpp>
#include <com/sun/star/frame/XFrameActionListener.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/ui/XContextChangeEventListener.hpp>
#include <com/sun/star/ui/XSidebar.hpp>
@ -49,8 +48,7 @@ typedef comphelper::WeakComponentImplHelper <
css::beans::XPropertyChangeListener,
css::ui::XSidebar,
css::frame::XStatusListener,
css::frame::XFrameActionListener,
css::lang::XUnoTunnel
css::frame::XFrameActionListener
> SidebarControllerInterfaceBase;
class SfxSplitWindow;
@ -177,9 +175,6 @@ public:
static SidebarController* GetSidebarControllerForView(const SfxViewShell* pViewShell);
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId();
private:
SidebarController(SidebarDockingWindow* pParentWindow, const SfxViewFrame* pViewFrame);

View file

@ -19,8 +19,6 @@
#ifndef INCLUDED_SVX_LINECTRL_HXX
#define INCLUDED_SVX_LINECTRL_HXX
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <cppuhelper/implbase.hxx>
#include <sfx2/tbxctrl.hxx>
#include <svtools/popupwindowcontroller.hxx>
#include <svx/svxdllapi.h>
@ -37,8 +35,7 @@ typedef std::function<bool(const OUString&, const css::uno::Any&)> LineStyleSele
typedef std::function<void(bool)> LineStyleIsNoneFunction;
// SvxLineStyleController:
class SVXCORE_DLLPUBLIC SvxLineStyleToolBoxControl final :
public cppu::ImplInheritanceHelper<svt::PopupWindowController, css::lang::XUnoTunnel>
class SVXCORE_DLLPUBLIC SvxLineStyleToolBoxControl final : public svt::PopupWindowController
{
private:
std::unique_ptr<svx::ToolboxButtonLineStyleUpdater> m_xBtnUpdater;
@ -56,9 +53,6 @@ public:
virtual OUString SAL_CALL getImplementationName() override;
virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId();
virtual void SAL_CALL execute(sal_Int16 nKeyModifier) override;
virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent& rEvent) override;

View file

@ -22,8 +22,7 @@
#include <toolkit/dllapi.h>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/implbase1.hxx>
#include <comphelper/accimplaccess.hxx>
#include <comphelper/accessiblecomponenthelper.hxx>
@ -43,8 +42,8 @@ class AccessibleRelationSetHelper;
typedef ::cppu::ImplHelper2<
css::lang::XServiceInfo, css::lang::XUnoTunnel > VCLXAccessibleComponent_BASE;
typedef ::cppu::ImplHelper1<
css::lang::XServiceInfo > VCLXAccessibleComponent_BASE;
class TOOLKIT_DLLPUBLIC VCLXAccessibleComponent
:public comphelper::OAccessibleExtendedComponentHelper
@ -90,9 +89,6 @@ public:
virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId();
// css::accessibility::XAccessibleContext
sal_Int64 SAL_CALL getAccessibleChildCount( ) override;
css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override;

View file

@ -21,7 +21,6 @@
#include <exception>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/uno/RuntimeException.hpp>
@ -50,7 +49,7 @@ namespace ooo::vba {
namespace msforms { class XShape; }
}
typedef CollTestImplHelper< ov::msforms::XShapeRange, css::lang::XUnoTunnel > ScVbaShapeRange_BASE;
typedef CollTestImplHelper< ov::msforms::XShapeRange > ScVbaShapeRange_BASE;
class VBAHELPER_DLLPUBLIC ScVbaShapeRange final : public ScVbaShapeRange_BASE
{
@ -97,10 +96,6 @@ public:
//XEnumerationAccess
virtual css::uno::Type SAL_CALL getElementType() override;
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override;
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId();
// ScVbaCollectionBaseImpl
virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ) override;
};

View file

@ -23,7 +23,6 @@
#include <string_view>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/uno/RuntimeException.hpp>
@ -51,7 +50,7 @@ namespace ooo::vba {
namespace msforms { class XShapeRange; }
}
typedef CollTestImplHelper< ov::msforms::XShapes, css::lang::XUnoTunnel > ScVbaShapes_BASE;
typedef CollTestImplHelper< ov::msforms::XShapes > ScVbaShapes_BASE;
class VBAHELPER_DLLPUBLIC ScVbaShapes final : public ScVbaShapes_BASE
{
@ -86,9 +85,6 @@ public:
virtual css::uno::Type SAL_CALL getElementType() override;
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override;
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId();
virtual void SAL_CALL SelectAll() override;
//helper::calc
virtual css::uno::Any SAL_CALL AddLine( sal_Int32 StartX, sal_Int32 StartY, sal_Int32 endX, sal_Int32 endY ) override;

View file

@ -14,11 +14,9 @@
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/XStatusListener.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/uno/Reference.hxx>
#include <comphelper/interfacecontainer4.hxx>
#include <comphelper/compbase.hxx>
#include <comphelper/servicehelper.hxx>
#include <tools/time.hxx>
#include <vcl/dllapi.h>
#include <vcl/formatter.hxx>
@ -35,8 +33,7 @@ class Window;
namespace weld
{
typedef comphelper::WeakComponentImplHelper<css::awt::XWindow, css::lang::XUnoTunnel>
TransportAsXWindow_Base;
typedef comphelper::WeakComponentImplHelper<css::awt::XWindow> TransportAsXWindow_Base;
class VCL_DLLPUBLIC TransportAsXWindow : public TransportAsXWindow_Base
{
@ -171,13 +168,6 @@ public:
std::unique_lock g(m_aMutex);
m_aPaintListeners.removeInterface(g, rListener);
}
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const& aIdentifier) override
{
return comphelper::getSomethingImpl(aIdentifier, this);
}
static css::uno::Sequence<sal_Int8> const& getUnoTunnelId();
};
// don't export to avoid duplicate WeakImplHelper definitions with MSVC

View file

@ -12,10 +12,7 @@
#ifndef INCLUDED_XMLOFF_SETTINGSSTORE_HXX
#define INCLUDED_XMLOFF_SETTINGSSTORE_HXX
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <cppuhelper/implbase.hxx>
#include <xmloff/dllapi.h>
namespace com::sun::star::beans { struct PropertyValue; }
namespace com::sun::star::embed { class XStorage; }
@ -23,9 +20,7 @@ namespace com::sun::star::uno { template <typename > class Reference; }
// Scans list of properties for certain URL properties that could refer
// to internal objects, and initializes from these.
class XMLOFF_DLLPUBLIC DocumentSettingsSerializer:
public cppu::WeakImplHelper<css::lang::XUnoTunnel>
{
class SAL_DLLPUBLIC_RTTI SAL_LOPLUGIN_ANNOTATE("crosscast") DocumentSettingsSerializer {
public:
// Import objects and update properties (eliding URLs)
virtual css::uno::Sequence<css::beans::PropertyValue>
@ -39,11 +34,8 @@ public:
const css::uno::Reference< css::embed::XStorage > &xStorage,
const css::uno::Sequence<css::beans::PropertyValue>& aConfigProps ) = 0;
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId();
protected:
~DocumentSettingsSerializer() override;
~DocumentSettingsSerializer() {}
};
#endif // INCLUDED_XMLOFF_SETTINGSSTORE_HXX

View file

@ -176,7 +176,7 @@ public:
virtual void SAL_CALL setDocumentLocator(const css::uno::Reference< css::xml::sax::XLocator > & xLocator) override;
};
class XMLOFF_DLLPUBLIC SvXMLImport : public cppu::WeakImplHelper<
class XMLOFF_DLLPUBLIC SAL_LOPLUGIN_ANNOTATE("crosscast") SvXMLImport : public cppu::WeakImplHelper<
css::xml::sax::XFastDocumentHandler,
css::lang::XServiceInfo,
css::lang::XInitialization,

View file

@ -50,7 +50,6 @@
#include <i18nlangtag/languagetag.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/propertysequence.hxx>
#include <comphelper/servicehelper.hxx>
#include <tools/debug.hxx>
#include <comphelper/diagnose_ex.hxx>
@ -1168,16 +1167,6 @@ uno::Sequence< OUString > GrammarCheckingIterator::GetServiceList(
}
sal_Int64 GrammarCheckingIterator::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) {
return comphelper::getSomethingImpl(aIdentifier, this);
}
css::uno::Sequence<sal_Int8> const & GrammarCheckingIterator::getUnoTunnelId() {
static comphelper::UnoIdInit const id;
return id.getSeq();
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
linguistic_GrammarCheckingIterator_get_implementation(
css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&)

View file

@ -24,7 +24,6 @@
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/linguistic2/XProofreadingIterator.hpp>
#include <com/sun/star/linguistic2/XLinguServiceEventListener.hpp>
#include <com/sun/star/linguistic2/XLinguServiceEventBroadcaster.hpp>
@ -79,8 +78,7 @@ class GrammarCheckingIterator:
css::linguistic2::XLinguServiceEventListener,
css::linguistic2::XLinguServiceEventBroadcaster,
css::lang::XComponent,
css::lang::XServiceInfo,
css::lang::XUnoTunnel
css::lang::XServiceInfo
>,
public LinguDispatcher
{
@ -181,9 +179,6 @@ public:
// LinguDispatcher
virtual void SetServiceList( const css::lang::Locale &rLocale, const css::uno::Sequence< OUString > &rSvcImplNames ) override;
virtual css::uno::Sequence< OUString > GetServiceList( const css::lang::Locale &rLocale ) const override;
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId();
};

View file

@ -38,7 +38,6 @@
#include <comphelper/interfacecontainer2.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/servicehelper.hxx>
#include <i18nlangtag/lang.h>
#include <i18nlangtag/languagetag.hxx>
#include <cppuhelper/factory.hxx>
@ -891,7 +890,7 @@ void LngSvcMgr::GetGrammarCheckerDsp_Impl( bool bSetSvcList )
if (xGCI.is())
{
mxGrammarDsp = comphelper::getFromUnoTunnel< GrammarCheckingIterator >(xGCI);
mxGrammarDsp = dynamic_cast< GrammarCheckingIterator * >(xGCI.get());
SAL_WARN_IF( mxGrammarDsp == nullptr, "linguistic", "failed to get implementation" );
if (bSetSvcList && mxGrammarDsp.is())
SetCfgServiceLists( *mxGrammarDsp );

View file

@ -57,7 +57,6 @@
#include <comphelper/propertysequence.hxx>
#include <comphelper/propertyvalue.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/diagnose_ex.hxx>
#include <tools/gen.hxx>
#include <tools/globname.hxx>
@ -1157,7 +1156,7 @@ Reference< XShape > const & Shape::createAndInsert(
{
uno::Reference<uno::XInterface> const xMathModel(xObj->getComponent());
oox::FormulaImExportBase *const pMagic(
comphelper::getFromUnoTunnel<oox::FormulaImExportBase>(xMathModel));
dynamic_cast<oox::FormulaImExportBase*>(xMathModel.get()));
assert(pMagic);
pMagic->readFormulaOoxml(*pMathXml);
}

View file

@ -71,7 +71,6 @@
#include <tools/globname.hxx>
#include <comphelper/classids.hxx>
#include <comphelper/propertysequence.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/storagehelper.hxx>
#include <sot/exchange.hxx>
#include <utility>
@ -2474,7 +2473,7 @@ void ShapeExport::WriteMathShape(Reference<XShape> const& xShape)
mpFS->startElementNS(XML_a14, XML_m);
oox::FormulaImExportBase *const pMagic(
comphelper::getFromUnoTunnel<oox::FormulaImExportBase>(xMathModel));
dynamic_cast<oox::FormulaImExportBase*>(xMathModel.get()));
assert(pMagic);
pMagic->writeFormulaOoxml(GetFS(), GetFB()->getVersion(), GetDocumentType(),
FormulaImExportBase::eFormulaAlign::INLINE);

View file

@ -13,7 +13,6 @@
#include <oox/core/contexthandler.hxx>
#include <oox/token/namespaces.hxx>
#include <comphelper/servicehelper.hxx>
#include <drawingml/textparagraph.hxx>
@ -22,15 +21,6 @@ using namespace ::com::sun::star;
namespace oox
{
sal_Int64 FormulaImExportBase::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) {
return comphelper::getSomethingImpl(aIdentifier, this);
}
css::uno::Sequence<sal_Int8> const & FormulaImExportBase::getUnoTunnelId() {
static comphelper::UnoIdInit const id;
return id.getSeq();
}
FormulaImExportBase::FormulaImExportBase()
{
}

View file

@ -28,7 +28,6 @@
#include <com/sun/star/reflection/ProxyFactory.hpp>
#include <comphelper/sequenceashashmap.hxx>
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <utility>
#include <xmloff/attrlist.hxx>
@ -340,7 +339,7 @@ void SAL_CALL ImportDocumentHandler::initialize( const uno::Sequence< uno::Any >
if (!m_xDocumentHandler.is() || !m_xModel.is())
throw uno::Exception("no delegatee and no model", nullptr);
m_xDelegatee.set(new SvXMLLegacyToFastDocHandler(comphelper::getFromUnoTunnel<SvXMLImport>(m_xDocumentHandler)));
m_xDelegatee.set(new SvXMLLegacyToFastDocHandler(dynamic_cast<SvXMLImport*>(m_xDocumentHandler.get())));
m_xDatabaseDataProvider.set(m_xModel->getDataProvider(),uno::UNO_QUERY);
if ( !m_xDatabaseDataProvider.is() )

View file

@ -29,7 +29,6 @@
#include <vcl/weldutils.hxx>
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/supportsservice.hxx>
@ -61,7 +60,7 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement (
SfxBindings* pBindings = reinterpret_cast<SfxBindings*>(nBindingsValue);
weld::Widget* pParent(nullptr);
if (weld::TransportAsXWindow* pTunnel = comphelper::getFromUnoTunnel<weld::TransportAsXWindow>(xParentWindow))
if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(xParentWindow.get()))
pParent = pTunnel->getWidget();
if (!pParent)

View file

@ -22,11 +22,9 @@
#include <cppuhelper/implbase.hxx>
#include <ooo/vba/excel/XWorksheet.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/sheet/XSheetPageBreak.hpp>
#include <com/sun/star/table/XColumnRowRange.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <comphelper/servicehelper.hxx>
#include <utility>
using namespace ::com::sun::star;
@ -34,8 +32,7 @@ using namespace ::ooo::vba;
namespace {
class RangePageBreaks :
public ::cppu::WeakImplHelper<container::XIndexAccess, css::lang::XUnoTunnel >
class RangePageBreaks : public ::cppu::WeakImplHelper<container::XIndexAccess >
{
private:
uno::Reference< XHelperInterface > mxParent;
@ -106,15 +103,6 @@ public:
{
return true;
}
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override {
return comphelper::getSomethingImpl(aIdentifier, this);
}
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId() {
static comphelper::UnoIdInit const id;
return id.getSeq();
}
};
}
@ -233,8 +221,7 @@ ScVbaHPageBreaks::ScVbaHPageBreaks( const uno::Reference< XHelperInterface >& xP
uno::Any SAL_CALL ScVbaHPageBreaks::Add( const uno::Any& Before)
{
RangePageBreaks* pPageBreaks
= comphelper::getFromUnoTunnel< RangePageBreaks >( m_xIndexAccess );
RangePageBreaks* pPageBreaks = dynamic_cast< RangePageBreaks* >( m_xIndexAccess.get() );
if( pPageBreaks )
{
return pPageBreaks->Add( Before );
@ -291,8 +278,7 @@ ScVbaVPageBreaks::~ScVbaVPageBreaks()
uno::Any SAL_CALL
ScVbaVPageBreaks::Add( const uno::Any& Before )
{
RangePageBreaks* pPageBreaks
= comphelper::getFromUnoTunnel< RangePageBreaks >( m_xIndexAccess );
RangePageBreaks* pPageBreaks = dynamic_cast< RangePageBreaks* >( m_xIndexAccess.get() );
if( pPageBreaks )
{
return pPageBreaks->Add( Before );

View file

@ -97,7 +97,6 @@ $(eval $(call gb_Library_use_libraries,sd,\
ucbhelper \
utl \
vcl \
xo \
$(if $(ENABLE_NSS),xmlsecurity) \
))

View file

@ -23,7 +23,6 @@
#include <sal/types.h>
#include <memory>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/office/XAnnotation.hpp>
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/compbase.hxx>
@ -75,8 +74,7 @@ struct SD_DLLPUBLIC CustomAnnotationMarker
};
class Annotation final : private ::cppu::BaseMutex,
public ::cppu::WeakComponentImplHelper<
css::office::XAnnotation, css::lang::XUnoTunnel>,
public ::cppu::WeakComponentImplHelper<css::office::XAnnotation>,
public ::cppu::PropertySetMixin<css::office::XAnnotation>
{
public:
@ -92,8 +90,8 @@ public:
// XInterface:
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const & type) override;
virtual void SAL_CALL acquire() noexcept override { WeakComponentImplHelper::acquire(); }
virtual void SAL_CALL release() noexcept override { WeakComponentImplHelper::release(); }
virtual void SAL_CALL acquire() noexcept override { ::cppu::WeakComponentImplHelper<css::office::XAnnotation>::acquire(); }
virtual void SAL_CALL release() noexcept override { ::cppu::WeakComponentImplHelper<css::office::XAnnotation>::release(); }
// css::beans::XPropertySet:
virtual css::uno::Reference<css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() override;
@ -118,9 +116,6 @@ public:
virtual void SAL_CALL setDateTime(const css::util::DateTime & the_value) override;
virtual css::uno::Reference<css::text::XText> SAL_CALL getTextRange() override;
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId();
void createChangeUndo();
void createCustomAnnotationMarker()

View file

@ -43,8 +43,7 @@ public:
void SetText( OutlinerParaObject const & rText );
OUString GetText() const;
sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) override;
static css::uno::Sequence<sal_Int8> const & getUnoTunnelId();
static TextApiObject* getImplementation( const css::uno::Reference< css::text::XText >& );
private:
std::unique_ptr<TextAPIEditSource> mpSource;

View file

@ -26,7 +26,6 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/lok.hxx>
#include <comphelper/servicehelper.hxx>
#include <unotools/datetime.hxx>
@ -119,7 +118,7 @@ void createAnnotation(uno::Reference<office::XAnnotation>& xAnnotation, SdPage*
sal_uInt32 Annotation::m_nLastId = 1;
Annotation::Annotation( const uno::Reference<uno::XComponentContext>& context, SdPage* pPage )
: WeakComponentImplHelper(m_aMutex)
: ::cppu::WeakComponentImplHelper<office::XAnnotation>(m_aMutex)
, ::cppu::PropertySetMixin<office::XAnnotation>(context, IMPLEMENTS_PROPERTY_SET, uno::Sequence<OUString>())
, m_nId( m_nLastId++ )
, mpPage( pPage )
@ -142,7 +141,7 @@ void SAL_CALL Annotation::disposing()
uno::Any Annotation::queryInterface(css::uno::Type const & type)
{
return WeakComponentImplHelper::queryInterface(type);
return ::cppu::WeakComponentImplHelper<office::XAnnotation>::queryInterface(type);
}
// com.sun.star.beans.XPropertySet:
@ -302,18 +301,9 @@ uno::Reference<text::XText> SAL_CALL Annotation::getTextRange()
return m_TextRange;
}
sal_Int64 Annotation::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) {
return comphelper::getSomethingImpl(aIdentifier, this);
}
css::uno::Sequence<sal_Int8> const & Annotation::getUnoTunnelId() {
static comphelper::UnoIdInit const id;
return id.getSeq();
}
std::unique_ptr<SdrUndoAction> CreateUndoInsertOrRemoveAnnotation( const uno::Reference<office::XAnnotation>& xAnnotation, bool bInsert )
{
Annotation* pAnnotation = comphelper::getFromUnoTunnel< Annotation >( xAnnotation );
Annotation* pAnnotation = dynamic_cast< Annotation* >( xAnnotation.get() );
if( pAnnotation )
{
return std::make_unique< UndoInsertOrRemoveAnnotation >( *pAnnotation, bInsert );
@ -326,14 +316,14 @@ std::unique_ptr<SdrUndoAction> CreateUndoInsertOrRemoveAnnotation( const uno::Re
void CreateChangeUndo(const uno::Reference<office::XAnnotation>& xAnnotation)
{
Annotation* pAnnotation = comphelper::getFromUnoTunnel<Annotation>(xAnnotation);
Annotation* pAnnotation = dynamic_cast<Annotation*>(xAnnotation.get());
if (pAnnotation)
pAnnotation->createChangeUndo();
}
sal_uInt32 getAnnotationId(const uno::Reference<office::XAnnotation>& xAnnotation)
{
Annotation* pAnnotation = comphelper::getFromUnoTunnel<Annotation>(xAnnotation);
Annotation* pAnnotation = dynamic_cast<Annotation*>(xAnnotation.get());
sal_uInt32 nId = 0;
if (pAnnotation)
nId = pAnnotation->GetId();
@ -342,7 +332,7 @@ sal_uInt32 getAnnotationId(const uno::Reference<office::XAnnotation>& xAnnotatio
const SdPage* getAnnotationPage(const uno::Reference<office::XAnnotation>& xAnnotation)
{
Annotation* pAnnotation = comphelper::getFromUnoTunnel<Annotation>(xAnnotation);
Annotation* pAnnotation = dynamic_cast<Annotation*>(xAnnotation.get());
if (pAnnotation)
return pAnnotation->GetPage();
return nullptr;

View file

@ -23,7 +23,6 @@
#include <textapi.hxx>
#include <drawdoc.hxx>
#include <comphelper/servicehelper.hxx>
#include <editeng/eeitem.hxx>
#include <editeng/editeng.hxx>
#include <editeng/outlobj.hxx>
@ -180,14 +179,14 @@ OUString TextApiObject::GetText() const
return mpSource->GetText();
}
sal_Int64 TextApiObject::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) {
return comphelper::getSomethingImpl(
aIdentifier, this, comphelper::FallbackToGetSomethingOf<SvxUnoText>{});
}
TextApiObject* TextApiObject::getImplementation( const css::uno::Reference< css::text::XText >& xText )
{
TextApiObject* pImpl = dynamic_cast< TextApiObject* >( xText.get() );
css::uno::Sequence<sal_Int8> const & TextApiObject::getUnoTunnelId() {
static comphelper::UnoIdInit const id;
return id.getSeq();
if( !pImpl )
pImpl = dynamic_cast< TextApiObject* >( comphelper::getFromUnoTunnel<SvxUnoTextBase>( xText ) );
return pImpl;
}
TextAPIEditSource::TextAPIEditSource(const TextAPIEditSource& rSource)

Some files were not shown because too many files have changed in this diff Show more