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) ...@@ -80,8 +80,6 @@ bool DataMemberShadow::VisitFieldDecl(FieldDecl const * fieldDecl)
return true; return true;
if (loplugin::isSamePathname(aFileName, SRCDIR "/sd/source/ui/view/viewoverlaymanager.cxx")) if (loplugin::isSamePathname(aFileName, SRCDIR "/sd/source/ui/view/viewoverlaymanager.cxx"))
return true; return true;
if (loplugin::isSamePathname(aFileName, SRCDIR "/sdext/source/presenter/PresenterSpritePane.hxx"))
return true;
if (loplugin::isSamePathname(aFileName, SRCDIR "/store/source/stortree.hxx") if (loplugin::isSamePathname(aFileName, SRCDIR "/store/source/stortree.hxx")
|| loplugin::isSamePathname(aFileName, SRCDIR "/store/source/stordata.hxx")) || loplugin::isSamePathname(aFileName, SRCDIR "/store/source/stordata.hxx"))
return true; return true;
......
...@@ -128,27 +128,26 @@ void SAL_CALL PresenterPane::windowPaint (const awt::PaintEvent& rEvent) ...@@ -128,27 +128,26 @@ void SAL_CALL PresenterPane::windowPaint (const awt::PaintEvent& rEvent)
void PresenterPane::CreateCanvases ( void PresenterPane::CreateCanvases (
const Reference<awt::XWindow>& rxParentWindow,
const Reference<rendering::XSpriteCanvas>& rxParentCanvas) const Reference<rendering::XSpriteCanvas>& rxParentCanvas)
{ {
if ( ! mxPresenterHelper.is()) if ( ! mxPresenterHelper.is())
return; return;
if ( ! rxParentWindow.is()) if ( ! mxParentWindow.is())
return; return;
if ( ! rxParentCanvas.is()) if ( ! rxParentCanvas.is())
return; return;
mxBorderCanvas = mxPresenterHelper->createSharedCanvas( mxBorderCanvas = mxPresenterHelper->createSharedCanvas(
rxParentCanvas, rxParentCanvas,
rxParentWindow, mxParentWindow,
Reference<rendering::XCanvas>(rxParentCanvas, UNO_QUERY), Reference<rendering::XCanvas>(rxParentCanvas, UNO_QUERY),
rxParentWindow, mxParentWindow,
mxBorderWindow); mxBorderWindow);
mxContentCanvas = mxPresenterHelper->createSharedCanvas( mxContentCanvas = mxPresenterHelper->createSharedCanvas(
rxParentCanvas, rxParentCanvas,
rxParentWindow, mxParentWindow,
Reference<rendering::XCanvas>(rxParentCanvas, UNO_QUERY), Reference<rendering::XCanvas>(rxParentCanvas, UNO_QUERY),
rxParentWindow, mxParentWindow,
mxContentWindow); mxContentWindow);
PaintBorder(mxBorderWindow->getPosSize()); PaintBorder(mxBorderWindow->getPosSize());
......
...@@ -76,7 +76,6 @@ private: ...@@ -76,7 +76,6 @@ private:
css::awt::Rectangle maBoundingBox; css::awt::Rectangle maBoundingBox;
virtual void CreateCanvases ( virtual void CreateCanvases (
const css::uno::Reference<css::awt::XWindow>& rxParentWindow,
const css::uno::Reference<css::rendering::XSpriteCanvas>& rxParentCanvas) override; const css::uno::Reference<css::rendering::XSpriteCanvas>& rxParentCanvas) override;
void Invalidate ( void Invalidate (
......
...@@ -197,7 +197,7 @@ void SAL_CALL PresenterPaneBase::initialize (const Sequence<Any>& rArguments) ...@@ -197,7 +197,7 @@ void SAL_CALL PresenterPaneBase::initialize (const Sequence<Any>& rArguments)
5); 5);
} }
CreateWindows(mxParentWindow, bIsWindowVisibleOnCreation); CreateWindows(bIsWindowVisibleOnCreation);
if (mxBorderWindow.is()) if (mxBorderWindow.is())
{ {
...@@ -205,7 +205,7 @@ void SAL_CALL PresenterPaneBase::initialize (const Sequence<Any>& rArguments) ...@@ -205,7 +205,7 @@ void SAL_CALL PresenterPaneBase::initialize (const Sequence<Any>& rArguments)
mxBorderWindow->addPaintListener(this); mxBorderWindow->addPaintListener(this);
} }
CreateCanvases(mxParentWindow, xParentCanvas); CreateCanvases(xParentCanvas);
// Raise new windows. // Raise new windows.
ToTop(); ToTop();
...@@ -265,14 +265,13 @@ void SAL_CALL PresenterPaneBase::disposing (const lang::EventObject& rEvent) ...@@ -265,14 +265,13 @@ void SAL_CALL PresenterPaneBase::disposing (const lang::EventObject& rEvent)
void PresenterPaneBase::CreateWindows ( void PresenterPaneBase::CreateWindows (
const Reference<awt::XWindow>& rxParentWindow,
const bool bIsWindowVisibleOnCreation) const bool bIsWindowVisibleOnCreation)
{ {
if (mxPresenterHelper.is() && rxParentWindow.is()) if (mxPresenterHelper.is() && mxParentWindow.is())
{ {
mxBorderWindow = mxPresenterHelper->createWindow( mxBorderWindow = mxPresenterHelper->createWindow(
rxParentWindow, mxParentWindow,
false, false,
bIsWindowVisibleOnCreation, bIsWindowVisibleOnCreation,
false, false,
......
...@@ -114,11 +114,9 @@ protected: ...@@ -114,11 +114,9 @@ protected:
SharedBitmapDescriptor mpViewBackground; SharedBitmapDescriptor mpViewBackground;
virtual void CreateCanvases ( virtual void CreateCanvases (
const css::uno::Reference<css::awt::XWindow>& rxParentWindow,
const css::uno::Reference<css::rendering::XSpriteCanvas>& rxParentCanvas) = 0; const css::uno::Reference<css::rendering::XSpriteCanvas>& rxParentCanvas) = 0;
void CreateWindows ( void CreateWindows (
const css::uno::Reference<css::awt::XWindow>& rxParentWindow,
const bool bIsWindowVisibleOnCreation); const bool bIsWindowVisibleOnCreation);
void PaintBorder (const css::awt::Rectangle& rUpdateRectangle); void PaintBorder (const css::awt::Rectangle& rUpdateRectangle);
void ToTop(); void ToTop();
......
...@@ -33,7 +33,6 @@ namespace sdext { namespace presenter { ...@@ -33,7 +33,6 @@ namespace sdext { namespace presenter {
PresenterSpritePane::PresenterSpritePane (const Reference<XComponentContext>& rxContext, PresenterSpritePane::PresenterSpritePane (const Reference<XComponentContext>& rxContext,
const ::rtl::Reference<PresenterController>& rpPresenterController) const ::rtl::Reference<PresenterController>& rpPresenterController)
: PresenterPaneBase(rxContext, rpPresenterController), : PresenterPaneBase(rxContext, rpPresenterController),
mxParentWindow(),
mxParentCanvas(), mxParentCanvas(),
mpSprite(new PresenterSprite()) mpSprite(new PresenterSprite())
{ {
...@@ -53,7 +52,6 @@ PresenterSpritePane::~PresenterSpritePane() ...@@ -53,7 +52,6 @@ PresenterSpritePane::~PresenterSpritePane()
void PresenterSpritePane::disposing() void PresenterSpritePane::disposing()
{ {
mpSprite->SetFactory(nullptr); mpSprite->SetFactory(nullptr);
mxParentWindow = nullptr;
mxParentCanvas = nullptr; mxParentCanvas = nullptr;
PresenterPaneBase::disposing(); PresenterPaneBase::disposing();
} }
...@@ -165,12 +163,9 @@ void PresenterSpritePane::UpdateCanvases() ...@@ -165,12 +163,9 @@ void PresenterSpritePane::UpdateCanvases()
} }
void PresenterSpritePane::CreateCanvases ( void PresenterSpritePane::CreateCanvases (
const css::uno::Reference<css::awt::XWindow>& rxParentWindow,
const css::uno::Reference<css::rendering::XSpriteCanvas>& rxParentCanvas) const css::uno::Reference<css::rendering::XSpriteCanvas>& rxParentCanvas)
{ {
OSL_ASSERT(!mxParentWindow.is() || mxParentWindow==rxParentWindow);
OSL_ASSERT(!mxParentCanvas.is() || mxParentCanvas==rxParentCanvas); OSL_ASSERT(!mxParentCanvas.is() || mxParentCanvas==rxParentCanvas);
mxParentWindow = rxParentWindow;
mxParentCanvas = rxParentCanvas; mxParentCanvas = rxParentCanvas;
mpSprite->SetFactory(mxParentCanvas); mpSprite->SetFactory(mxParentCanvas);
......
...@@ -80,12 +80,10 @@ public: ...@@ -80,12 +80,10 @@ public:
virtual void SAL_CALL windowPaint (const css::awt::PaintEvent& rEvent) override; virtual void SAL_CALL windowPaint (const css::awt::PaintEvent& rEvent) override;
private: private:
css::uno::Reference<css::awt::XWindow> mxParentWindow;
css::uno::Reference<css::rendering::XSpriteCanvas> mxParentCanvas; css::uno::Reference<css::rendering::XSpriteCanvas> mxParentCanvas;
std::shared_ptr<PresenterSprite> mpSprite; std::shared_ptr<PresenterSprite> mpSprite;
virtual void CreateCanvases ( virtual void CreateCanvases (
const css::uno::Reference<css::awt::XWindow>& rxParentWindow,
const css::uno::Reference<css::rendering::XSpriteCanvas>& rxParentCanvas) override; const css::uno::Reference<css::rendering::XSpriteCanvas>& rxParentCanvas) override;
void UpdateCanvases(); 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