sd/source/ui/sidebar/SlideBackground.cxx |   16 ++++----
 vcl/inc/salvtables.hxx                   |   15 ++++++++
 vcl/source/app/salvtables.cxx            |   56 +++++++++++++------------------
 3 files changed, 48 insertions(+), 39 deletions(-)

New commits:
commit 0cb4bc34deef43dc18c73daa0344c92717115456
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Wed Oct 20 10:53:53 2021 +0200
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Wed Dec 29 12:01:16 2021 +0100

    Move SalInstanceImage decl to header file
    
    Change-Id: Ic71e10a9cb296e8fed366b7dd622d8875d68f2d9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123876
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127670
    Tested-by: Jenkins

diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index 2340169b193b..e21c9d48780e 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -1926,4 +1926,19 @@ public:
     virtual void sort_native_button_order() override;
 };
 
+class SalInstanceImage : public SalInstanceWidget, public virtual weld::Image
+{
+private:
+    VclPtr<FixedImage> m_xImage;
+
+public:
+    SalInstanceImage(FixedImage* pImage, SalInstanceBuilder* pBuilder, bool 
bTakeOwnership);
+
+    virtual void set_from_icon_name(const OUString& rIconName) override;
+
+    virtual void set_image(VirtualDevice* pDevice) override;
+
+    virtual void set_image(const css::uno::Reference<css::graphic::XGraphic>& 
rImage) override;
+};
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index e2599afe1b0b..95451c9609ce 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -3119,37 +3119,6 @@ public:
     virtual void set_text(const OUString& rText) override { 
m_xProgressBar->SetText(rText); }
 };
 
-class SalInstanceImage : public SalInstanceWidget, public virtual weld::Image
-{
-private:
-    VclPtr<FixedImage> m_xImage;
-
-public:
-    SalInstanceImage(FixedImage* pImage, SalInstanceBuilder* pBuilder, bool 
bTakeOwnership)
-        : SalInstanceWidget(pImage, pBuilder, bTakeOwnership)
-        , m_xImage(pImage)
-    {
-    }
-
-    virtual void set_from_icon_name(const OUString& rIconName) override
-    {
-        m_xImage->SetImage(::Image(StockImage::Yes, rIconName));
-    }
-
-    virtual void set_image(VirtualDevice* pDevice) override
-    {
-        if (pDevice)
-            m_xImage->SetImage(createImage(*pDevice));
-        else
-            m_xImage->SetImage(::Image());
-    }
-
-    virtual void set_image(const css::uno::Reference<css::graphic::XGraphic>& 
rImage) override
-    {
-        m_xImage->SetImage(::Image(rImage));
-    }
-};
-
 class SalInstanceCalendar : public SalInstanceWidget, public virtual 
weld::Calendar
 {
 private:
@@ -3193,6 +3162,31 @@ IMPL_LINK_NOARG(SalInstanceCalendar, ActivateHdl, 
::Calendar*, void)
     signal_activated();
 }
 
+SalInstanceImage::SalInstanceImage(FixedImage* pImage, SalInstanceBuilder* 
pBuilder,
+                                   bool bTakeOwnership)
+    : SalInstanceWidget(pImage, pBuilder, bTakeOwnership)
+    , m_xImage(pImage)
+{
+}
+
+void SalInstanceImage::set_from_icon_name(const OUString& rIconName)
+{
+    m_xImage->SetImage(::Image(StockImage::Yes, rIconName));
+}
+
+void SalInstanceImage::set_image(VirtualDevice* pDevice)
+{
+    if (pDevice)
+        m_xImage->SetImage(createImage(*pDevice));
+    else
+        m_xImage->SetImage(::Image());
+}
+
+void SalInstanceImage::set_image(const 
css::uno::Reference<css::graphic::XGraphic>& rImage)
+{
+    m_xImage->SetImage(::Image(rImage));
+}
+
 WeldTextFilter::WeldTextFilter(Link<OUString&, bool>& rInsertTextHdl)
     : TextFilter(OUString())
     , m_rInsertTextHdl(rInsertTextHdl)
commit 27c815286befeb038a1b8463ba5bd45d3def3305
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Mon Nov 8 14:01:19 2021 +0100
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Wed Dec 29 12:01:01 2021 +0100

    lok: hide useless insert image button in sidebar
    
    do this also in draw, not only in impress
    
    Change-Id: Iaaf2349cfb98b801957b71bd4504f0e9efbfba4e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124840
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124902
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127669
    Tested-by: Jenkins

diff --git a/sd/source/ui/sidebar/SlideBackground.cxx 
b/sd/source/ui/sidebar/SlideBackground.cxx
index 8ae9d0a9b8aa..89c16e0d6fc2 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -326,14 +326,6 @@ void SlideBackground::HandleContextChange(
             mxInsertImage->show();
         }
 
-        // The Insert Image button in the sidebar issues .uno:SelectBackground,
-        // which when invoked without arguments will open the file-open-dialog
-        // to prompt the user to select a file. This is useless in LOOL.
-        // Hide for now so the user will only be able to use the menu to insert
-        // background image, which prompts the user for file selection in the 
browser.
-        if (comphelper::LibreOfficeKit::isActive())
-            mxInsertImage->hide();
-
         // Need to do a relayouting, otherwise the panel size is not updated 
after show / hide controls
         if (m_pPanel)
             m_pPanel->TriggerDeckLayouting();
@@ -357,6 +349,14 @@ void SlideBackground::HandleContextChange(
             mxBackgroundLabel->hide();
         }
     }
+
+    // The Insert Image button in the sidebar issues .uno:SelectBackground,
+    // which when invoked without arguments will open the file-open-dialog
+    // to prompt the user to select a file. This is useless in LOOL.
+    // Hide for now so the user will only be able to use the menu to insert
+    // background image, which prompts the user for file selection in the 
browser.
+    if (comphelper::LibreOfficeKit::isActive())
+        mxInsertImage->hide();
 }
 
 void SlideBackground::Update()

Reply via email to