Kaydet (Commit) 390fad39 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:datamembershadow in PresenterPane

the subclass field is just a copy of the parent field, so drop the
subclass, and consequently simply the CreateCanvases method, we don't
need to pass the parameter down, can just access the parent field.

Change-Id: I3be448a06b32d01cdda4fc36b78cafb4488e2913
Reviewed-on: https://gerrit.libreoffice.org/48553Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst a626e249
......@@ -80,8 +80,6 @@ bool DataMemberShadow::VisitFieldDecl(FieldDecl const * fieldDecl)
return true;
if (loplugin::isSamePathname(aFileName, SRCDIR "/sd/source/ui/view/viewoverlaymanager.cxx"))
return true;
if (loplugin::isSamePathname(aFileName, SRCDIR "/sdext/source/presenter/PresenterSpritePane.hxx"))
return true;
if (loplugin::isSamePathname(aFileName, SRCDIR "/store/source/stortree.hxx")
|| loplugin::isSamePathname(aFileName, SRCDIR "/store/source/stordata.hxx"))
return true;
......
......@@ -128,27 +128,26 @@ void SAL_CALL PresenterPane::windowPaint (const awt::PaintEvent& rEvent)
void PresenterPane::CreateCanvases (
const Reference<awt::XWindow>& rxParentWindow,
const Reference<rendering::XSpriteCanvas>& rxParentCanvas)
{
if ( ! mxPresenterHelper.is())
return;
if ( ! rxParentWindow.is())
if ( ! mxParentWindow.is())
return;
if ( ! rxParentCanvas.is())
return;
mxBorderCanvas = mxPresenterHelper->createSharedCanvas(
rxParentCanvas,
rxParentWindow,
mxParentWindow,
Reference<rendering::XCanvas>(rxParentCanvas, UNO_QUERY),
rxParentWindow,
mxParentWindow,
mxBorderWindow);
mxContentCanvas = mxPresenterHelper->createSharedCanvas(
rxParentCanvas,
rxParentWindow,
mxParentWindow,
Reference<rendering::XCanvas>(rxParentCanvas, UNO_QUERY),
rxParentWindow,
mxParentWindow,
mxContentWindow);
PaintBorder(mxBorderWindow->getPosSize());
......
......@@ -76,7 +76,6 @@ private:
css::awt::Rectangle maBoundingBox;
virtual void CreateCanvases (
const css::uno::Reference<css::awt::XWindow>& rxParentWindow,
const css::uno::Reference<css::rendering::XSpriteCanvas>& rxParentCanvas) override;
void Invalidate (
......
......@@ -197,7 +197,7 @@ void SAL_CALL PresenterPaneBase::initialize (const Sequence<Any>& rArguments)
5);
}
CreateWindows(mxParentWindow, bIsWindowVisibleOnCreation);
CreateWindows(bIsWindowVisibleOnCreation);
if (mxBorderWindow.is())
{
......@@ -205,7 +205,7 @@ void SAL_CALL PresenterPaneBase::initialize (const Sequence<Any>& rArguments)
mxBorderWindow->addPaintListener(this);
}
CreateCanvases(mxParentWindow, xParentCanvas);
CreateCanvases(xParentCanvas);
// Raise new windows.
ToTop();
......@@ -265,14 +265,13 @@ void SAL_CALL PresenterPaneBase::disposing (const lang::EventObject& rEvent)
void PresenterPaneBase::CreateWindows (
const Reference<awt::XWindow>& rxParentWindow,
const bool bIsWindowVisibleOnCreation)
{
if (mxPresenterHelper.is() && rxParentWindow.is())
if (mxPresenterHelper.is() && mxParentWindow.is())
{
mxBorderWindow = mxPresenterHelper->createWindow(
rxParentWindow,
mxParentWindow,
false,
bIsWindowVisibleOnCreation,
false,
......
......@@ -114,11 +114,9 @@ protected:
SharedBitmapDescriptor mpViewBackground;
virtual void CreateCanvases (
const css::uno::Reference<css::awt::XWindow>& rxParentWindow,
const css::uno::Reference<css::rendering::XSpriteCanvas>& rxParentCanvas) = 0;
void CreateWindows (
const css::uno::Reference<css::awt::XWindow>& rxParentWindow,
const bool bIsWindowVisibleOnCreation);
void PaintBorder (const css::awt::Rectangle& rUpdateRectangle);
void ToTop();
......
......@@ -33,7 +33,6 @@ namespace sdext { namespace presenter {
PresenterSpritePane::PresenterSpritePane (const Reference<XComponentContext>& rxContext,
const ::rtl::Reference<PresenterController>& rpPresenterController)
: PresenterPaneBase(rxContext, rpPresenterController),
mxParentWindow(),
mxParentCanvas(),
mpSprite(new PresenterSprite())
{
......@@ -53,7 +52,6 @@ PresenterSpritePane::~PresenterSpritePane()
void PresenterSpritePane::disposing()
{
mpSprite->SetFactory(nullptr);
mxParentWindow = nullptr;
mxParentCanvas = nullptr;
PresenterPaneBase::disposing();
}
......@@ -165,12 +163,9 @@ void PresenterSpritePane::UpdateCanvases()
}
void PresenterSpritePane::CreateCanvases (
const css::uno::Reference<css::awt::XWindow>& rxParentWindow,
const css::uno::Reference<css::rendering::XSpriteCanvas>& rxParentCanvas)
{
OSL_ASSERT(!mxParentWindow.is() || mxParentWindow==rxParentWindow);
OSL_ASSERT(!mxParentCanvas.is() || mxParentCanvas==rxParentCanvas);
mxParentWindow = rxParentWindow;
mxParentCanvas = rxParentCanvas;
mpSprite->SetFactory(mxParentCanvas);
......
......@@ -80,12 +80,10 @@ public:
virtual void SAL_CALL windowPaint (const css::awt::PaintEvent& rEvent) override;
private:
css::uno::Reference<css::awt::XWindow> mxParentWindow;
css::uno::Reference<css::rendering::XSpriteCanvas> mxParentCanvas;
std::shared_ptr<PresenterSprite> mpSprite;
virtual void CreateCanvases (
const css::uno::Reference<css::awt::XWindow>& rxParentWindow,
const css::uno::Reference<css::rendering::XSpriteCanvas>& rxParentCanvas) override;
void UpdateCanvases();
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment