use more concrete UNO types in filter

Change-Id: I5b50a5a3f9e6876717c9ec1579761d137bd54d42
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173384
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2024-09-15 12:26:32 +02:00
parent 827c1fd177
commit 53325c4e54
4 changed files with 12 additions and 15 deletions

View File

@@ -854,9 +854,8 @@ void ImplEESdrWriter::ImplWritePage(
ImplEESdrWriter::~ImplEESdrWriter()
{
DBG_ASSERT( !mpSolverContainer, "ImplEESdrWriter::~ImplEESdrWriter: unwritten SolverContainer" );
Reference<css::lang::XComponent> xComp(mXDrawPage, UNO_QUERY);
if (xComp.is())
xComp->dispose();
if (mXDrawPage.is())
mXDrawPage->dispose();
}
@@ -869,10 +868,10 @@ bool ImplEESdrWriter::ImplInitPage( const SdrPage& rPage )
ImplFlushSolverContainer();
mpSdrPage = nullptr;
Reference<css::lang::XComponent> xOldDrawPage(mXDrawPage, UNO_QUERY);
if (xOldDrawPage.is())
xOldDrawPage->dispose();
mXDrawPage = pSvxDrawPage = new SvxDrawPage( const_cast<SdrPage*>(&rPage) );
if (mXDrawPage.is())
mXDrawPage->dispose();
pSvxDrawPage = new SvxDrawPage( const_cast<SdrPage*>(&rPage) );
mXDrawPage = pSvxDrawPage;
mXShapes = mXDrawPage;
if ( !mXShapes.is() )
return false;
@@ -882,7 +881,7 @@ bool ImplEESdrWriter::ImplInitPage( const SdrPage& rPage )
mpSolverContainer.reset( new EscherSolverContainer );
}
else
pSvxDrawPage = comphelper::getFromUnoTunnel<SvxDrawPage>(mXDrawPage);
pSvxDrawPage = mXDrawPage;
return pSvxDrawPage != nullptr;
}

View File

@@ -19,13 +19,14 @@
#pragma once
#include <filter/msfilter/escherex.hxx>
#include <o3tl/any.hxx>
#include <rtl/ref.hxx>
// fractions of Draw PPTWriter etc.
class ImplEESdrWriter;
class SdrObject;
class SdrPage;
class SvxDrawPage;
class ImplEESdrObject
{
@@ -99,7 +100,7 @@ class EscherExHostAppData;
class ImplEESdrWriter
{
EscherEx* mpEscherEx;
css::uno::Reference< css::drawing::XDrawPage > mXDrawPage;
rtl::Reference< SvxDrawPage > mXDrawPage;
css::uno::Reference< css::drawing::XShapes > mXShapes;
SvStream* mpPicStrm;
// own extensions

View File

@@ -67,8 +67,6 @@ using namespace com::sun::star::system;
using namespace com::sun::star::xml;
using namespace com::sun::star::xml::sax;
namespace {
class GlobalEventListenerImpl : public ::cppu::WeakImplHelper< css::document::XDocumentEventListener >
{
public:
@@ -83,8 +81,6 @@ private:
XMLFilterTestDialog* mpDialog;
};
}
GlobalEventListenerImpl::GlobalEventListenerImpl( XMLFilterTestDialog* pDialog )
: mpDialog( pDialog )
{

View File

@@ -26,6 +26,7 @@
#include <vcl/weld.hxx>
class filter_info_impl;
class GlobalEventListenerImpl;
class XMLFilterTestDialog : public weld::GenericDialogController
{
@@ -54,7 +55,7 @@ private:
private:
css::uno::Reference< css::uno::XComponentContext > mxContext;
css::uno::Reference< css::document::XDocumentEventBroadcaster > mxGlobalBroadcaster;
css::uno::Reference< css::document::XDocumentEventListener > mxGlobalEventListener;
rtl::Reference< GlobalEventListenerImpl > mxGlobalEventListener;
css::uno::WeakReference< css::lang::XComponent > mxLastFocusModel;
OUString m_sImportRecentFile;