sd/source/console/PresenterPane.cxx        |    3 ++-
 sd/source/console/PresenterPaneBase.cxx    |   11 +----------
 sd/source/console/PresenterPaneBase.hxx    |    5 ++---
 sd/source/console/PresenterPaneFactory.cxx |    2 +-
 sd/source/console/PresenterSlideSorter.cxx |    2 +-
 5 files changed, 7 insertions(+), 16 deletions(-)

New commits:
commit a6ec84dc8745873b9ea09bce8e77b2b589d125e8
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed May 14 00:22:29 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu May 15 06:49:13 2025 +0200

    sd: Drop unnecessary cast + UNO query
    
    Change-Id: Iece230bf7f3dadba2960429c3cda501ef8345354
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185290
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/sd/source/console/PresenterPaneFactory.cxx 
b/sd/source/console/PresenterPaneFactory.cxx
index 97c70b6573dc..8cb39d194c5b 100644
--- a/sd/source/console/PresenterPaneFactory.cxx
+++ b/sd/source/console/PresenterPaneFactory.cxx
@@ -259,7 +259,7 @@ Reference<XResource> PresenterPaneFactory::CreatePane (
         xWindow->setVisible(true);
     }
 
-    return Reference<XResource>(static_cast<XWeak*>(xPane.get()), 
UNO_QUERY_THROW);
+    return xPane;
 }
 
 void PresenterPaneFactory::ThrowIfDisposed() const
commit eb061fccd8132fb2f6aa8d0f3fcb6c035864aca4
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Tue May 13 23:49:48 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu May 15 06:49:07 2025 +0200

    sd: Try to fix PresenterPane visibility check
    
    See previous commit
    
        Change-Id: I933c63303d1f055b4c0eb826f6726df3fe2a7033
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Tue May 13 23:38:34 2025 +0200
    
            sd: Use concrete rtl::Reference<PresenterPaneBorderPainter>
    
    which made clear that PresenterPaneBase::IsVisible
    was effectively always returning false.
    
    Instead, try to query the `mxBorderWindow` for the XWindow2
    interface, and check whether it is visible.
    
    This should presumably be correct, and with a breakpoint set
    there, the checks succeed when starting an Impress presentation
    with the qt6 VCL plugin on Linux, but this is otherwise untested.
    (If this commit results in any issues because of the
    bounding box now actually getting updated and thus
    invalidations taking place, maybe that bounding box/invalidation
    logic should be refined or dropped altogether as it was presumably
    logically dead before this commit.)
    
    Change-Id: I91a45944e65983068463364d08cbc3c68f3a6ad6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185289
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/sd/source/console/PresenterPane.cxx 
b/sd/source/console/PresenterPane.cxx
index 8c65753b0d2d..d6dcba43eb8c 100644
--- a/sd/source/console/PresenterPane.cxx
+++ b/sd/source/console/PresenterPane.cxx
@@ -149,7 +149,8 @@ void PresenterPane::Invalidate (const css::awt::Rectangle& 
rRepaintBox)
 
 void PresenterPane::UpdateBoundingBox()
 {
-    if (mxBorderWindow.is() && IsVisible())
+    uno::Reference<css::awt::XWindow2> xWindow(mxBorderWindow, UNO_QUERY);
+    if (xWindow.is() && xWindow->isVisible())
         maBoundingBox = mxBorderWindow->getPosSize();
     else
         maBoundingBox = awt::Rectangle();
diff --git a/sd/source/console/PresenterPaneBase.cxx 
b/sd/source/console/PresenterPaneBase.cxx
index da629c3f43dc..bd60b2082377 100644
--- a/sd/source/console/PresenterPaneBase.cxx
+++ b/sd/source/console/PresenterPaneBase.cxx
@@ -250,11 +250,6 @@ void PresenterPaneBase::LayoutContextWindow()
         awt::PosSize::POSSIZE);
 }
 
-bool PresenterPaneBase::IsVisible()
-{
-    return false;
-}
-
 void PresenterPaneBase::ThrowIfDisposed()
 {
     if (rBHelper.bDisposed || rBHelper.bInDispose)
diff --git a/sd/source/console/PresenterPaneBase.hxx 
b/sd/source/console/PresenterPaneBase.hxx
index 8d410ae0dbbc..a7308c8e721b 100644
--- a/sd/source/console/PresenterPaneBase.hxx
+++ b/sd/source/console/PresenterPaneBase.hxx
@@ -113,7 +113,6 @@ protected:
     void PaintBorder (const css::awt::Rectangle& rUpdateRectangle);
     void ToTop();
     void LayoutContextWindow();
-    static bool IsVisible();
 
     /** @throws css::lang::DisposedException when the object has already been
         disposed.
commit 30e74e8e2b00dae6dd4bfc6f6ca88d1fd12d7d32
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Tue May 13 23:38:34 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu May 15 06:48:58 2025 +0200

    sd: Use concrete rtl::Reference<PresenterPaneBorderPainter>
    
    After
    
        Change-Id: Iacdd51e0d2d2bde454d66a97d4c468628395a1b5
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Tue May 13 23:24:27 2025 +0200
    
            sd: Implement PresenterPaneBase::initialize without XInitialization
    
    , it is now clear that this is always a
    PresenterPaneBorderPainter, so use that concrete
    type instead of the abstract XPaneBorderPainter
    interface.
    
    This also makes clear that the attempt to query
    for the XWindow2 interface in
    PresenterPaneBase::IsVisible would never succeed,
    so (temporarily) simply return false there.
    This suggests that PresenterPane::UpdateBoundingBox
    which calls PresenterPaneBase::IsVisible might not
    be as useful as it looked like at first glance as
    it seems to always set `maBoundingBox` to an empty
    rectangle...
    
    This will be adjusted in an upcoming commit, but
    for now, leave the behavior as it used to be.
    
    Change-Id: I933c63303d1f055b4c0eb826f6726df3fe2a7033
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185288
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/sd/source/console/PresenterPaneBase.cxx 
b/sd/source/console/PresenterPaneBase.cxx
index 6177ee31e1bb..da629c3f43dc 100644
--- a/sd/source/console/PresenterPaneBase.cxx
+++ b/sd/source/console/PresenterPaneBase.cxx
@@ -99,7 +99,7 @@ const OUString& PresenterPaneBase::GetTitle() const
     return msTitle;
 }
 
-const Reference<drawing::framework::XPaneBorderPainter>&
+const rtl::Reference<PresenterPaneBorderPainter>&
     PresenterPaneBase::GetPaneBorderPainter() const
 {
     return mxBorderPainter;
@@ -250,12 +250,8 @@ void PresenterPaneBase::LayoutContextWindow()
         awt::PosSize::POSSIZE);
 }
 
-bool PresenterPaneBase::IsVisible() const
+bool PresenterPaneBase::IsVisible()
 {
-    Reference<awt::XWindow2> xWindow2 (mxBorderPainter, UNO_QUERY);
-    if (xWindow2.is())
-        return xWindow2->isVisible();
-
     return false;
 }
 
diff --git a/sd/source/console/PresenterPaneBase.hxx 
b/sd/source/console/PresenterPaneBase.hxx
index 5354a9228e53..8d410ae0dbbc 100644
--- a/sd/source/console/PresenterPaneBase.hxx
+++ b/sd/source/console/PresenterPaneBase.hxx
@@ -65,7 +65,7 @@ public:
     const css::uno::Reference<css::awt::XWindow>& GetBorderWindow() const;
     void SetTitle (const OUString& rsTitle);
     const OUString& GetTitle() const;
-    const css::uno::Reference<css::drawing::framework::XPaneBorderPainter>& 
GetPaneBorderPainter() const;
+    const rtl::Reference<PresenterPaneBorderPainter>& GetPaneBorderPainter() 
const;
 
     void initialize(const 
css::uno::Reference<css::drawing::framework::XResourceId>& rxPaneId,
                     const css::uno::Reference<css::awt::XWindow>& 
rxParentWindow,
@@ -101,7 +101,7 @@ protected:
     css::uno::Reference<css::awt::XWindow> mxContentWindow;
     css::uno::Reference<css::rendering::XCanvas> mxContentCanvas;
     css::uno::Reference<css::drawing::framework::XResourceId> mxPaneId;
-    css::uno::Reference<css::drawing::framework::XPaneBorderPainter> 
mxBorderPainter;
+    rtl::Reference<PresenterPaneBorderPainter> mxBorderPainter;
     OUString msTitle;
     css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
 
@@ -113,7 +113,7 @@ protected:
     void PaintBorder (const css::awt::Rectangle& rUpdateRectangle);
     void ToTop();
     void LayoutContextWindow();
-    bool IsVisible() const;
+    static bool IsVisible();
 
     /** @throws css::lang::DisposedException when the object has already been
         disposed.
diff --git a/sd/source/console/PresenterSlideSorter.cxx 
b/sd/source/console/PresenterSlideSorter.cxx
index aa81f3ff1377..77c5d3cf2786 100644
--- a/sd/source/console/PresenterSlideSorter.cxx
+++ b/sd/source/console/PresenterSlideSorter.cxx
@@ -629,7 +629,7 @@ void PresenterSlideSorter::UpdateLayout()
         if ( ! pPane->mxPane.is())
             break;
 
-        Reference<drawing::framework::XPaneBorderPainter> xBorderPainter (
+        rtl::Reference<PresenterPaneBorderPainter> xBorderPainter (
             pPane->mxPane->GetPaneBorderPainter());
         if ( ! xBorderPainter.is())
             break;

Reply via email to