From 0b0d41b48fa7c5aebd42bdce60dab77421743ae1 Mon Sep 17 00:00:00 2001 From: Jan-Marek Glogowski Date: Sun, 20 Feb 2022 15:26:25 +0100 Subject: Fix --disable-avmedia build Regression from commit 6f938dce6eaa927cfde39491ef7a0bc1d07df66b ("update video pos and size after change if currently playing"). Change-Id: Ib618fcd7347255d0cae352b7fc90aa85a2c14d32 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130215 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski --- svx/inc/sdr/contact/viewobjectcontactofsdrmediaobj.hxx | 2 +- svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/svx/inc/sdr/contact/viewobjectcontactofsdrmediaobj.hxx b/svx/inc/sdr/contact/viewobjectcontactofsdrmediaobj.hxx index d362048df3db..891c920aed79 100644 --- a/svx/inc/sdr/contact/viewobjectcontactofsdrmediaobj.hxx +++ b/svx/inc/sdr/contact/viewobjectcontactofsdrmediaobj.hxx @@ -54,7 +54,7 @@ namespace sdr::contact virtual void ActionChanged() override; private: - void updateMediaWindow() const; + void updateMediaWindow(bool bShow) const; #if HAVE_FEATURE_AVMEDIA std::unique_ptr mpMediaWindow; diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx index 0241fabd5661..777017472bf6 100644 --- a/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx @@ -87,12 +87,15 @@ Size ViewObjectContactOfSdrMediaObj::getPreferredSize() const void ViewObjectContactOfSdrMediaObj::ActionChanged() { ViewObjectContactOfSdrObj::ActionChanged(); - if (mpMediaWindow && mpMediaWindow->isVisible()) - updateMediaWindow(); + updateMediaWindow(false); } -void ViewObjectContactOfSdrMediaObj::updateMediaWindow() const +void ViewObjectContactOfSdrMediaObj::updateMediaWindow(bool bShow) const { +#if HAVE_FEATURE_AVMEDIA + if (!mpMediaWindow || (!bShow && !mpMediaWindow->isVisible())) + return; + basegfx::B2DRange aViewRange(getObjectRange()); aViewRange.transform(GetObjectContact().getViewInformation2D().getViewTransformation()); @@ -120,6 +123,9 @@ void ViewObjectContactOfSdrMediaObj::updateMediaWindow() const // through to gtk which will now accept it as the underlying // m_pSocket of GtkSalObject::SetPosSize is now visible mpMediaWindow->setPosSize(aViewRectangle); +#else + (void) bShow; +#endif } void ViewObjectContactOfSdrMediaObj::updateMediaItem( ::avmedia::MediaItem& rItem ) const @@ -137,7 +143,7 @@ void ViewObjectContactOfSdrMediaObj::updateMediaItem( ::avmedia::MediaItem& rIte } else { - updateMediaWindow(); + updateMediaWindow(true); } #else (void) rItem; -- cgit v1.2.3