framework/inc/uielement/toolbarmanager.hxx    |    1 
 framework/source/uielement/toolbarmanager.cxx |    9 -----
 include/vcl/toolbox.hxx                       |    9 -----
 vcl/source/window/builder.cxx                 |    2 -
 vcl/source/window/toolbox.cxx                 |   40 --------------------------
 5 files changed, 61 deletions(-)

New commits:
commit 2958e4c92f15652c424765f02c87518011eb2406
Author:     Maxim Monastirsky <momonas...@gmail.com>
AuthorDate: Fri Jul 29 00:08:46 2022 +0300
Commit:     Maxim Monastirsky <momonas...@gmail.com>
CommitDate: Tue Aug 30 13:07:36 2022 +0200

    tdf#149956 Remove previous vcl only solution
    
    Change-Id: Id67b75856a230e175ccc6328ec0838c78589191b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139020
    Tested-by: Jenkins
    Reviewed-by: Maxim Monastirsky <momonas...@gmail.com>

diff --git a/framework/inc/uielement/toolbarmanager.hxx 
b/framework/inc/uielement/toolbarmanager.hxx
index 162e14aca4e3..865a1b54d5b4 100644
--- a/framework/inc/uielement/toolbarmanager.hxx
+++ b/framework/inc/uielement/toolbarmanager.hxx
@@ -82,7 +82,6 @@ public:
     virtual void Clear() = 0;
     virtual void SetName(const OUString& rName) = 0;
     virtual void SetHelpId(const OString& rHelpId) = 0;
-    virtual void TrackImageOrientation(const 
css::uno::Reference<css::frame::XFrame>& rFrame) = 0;
     virtual bool WillUsePopupMode() = 0;
     virtual bool IsReallyVisible() = 0;
     virtual void SetIconSize(ToolBoxButtonSize eSize) = 0;
diff --git a/framework/source/uielement/toolbarmanager.cxx 
b/framework/source/uielement/toolbarmanager.cxx
index 86a6c161900d..d1251f96cb84 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -292,11 +292,6 @@ public:
         m_pToolBar->SetHelpId( rHelpId );
     }
 
-    virtual void TrackImageOrientation(const 
css::uno::Reference<css::frame::XFrame>& rFrame) override
-    {
-        m_pToolBar->TrackImageOrientation(rFrame);
-    }
-
     virtual bool WillUsePopupMode() override
     {
         return m_pToolBar->WillUsePopupMode();
@@ -483,8 +478,6 @@ public:
 
     virtual void SetHelpId(const OString& /*rHelpId*/) override {}
 
-    virtual void TrackImageOrientation(const 
css::uno::Reference<css::frame::XFrame>&) override {}
-
     virtual bool WillUsePopupMode() override { return true; }
 
     virtual bool IsReallyVisible() override { return true; }
@@ -1669,8 +1662,6 @@ void ToolBarManager::RequestImages()
         ++pIter;
         ++i;
     }
-
-    m_pImpl->TrackImageOrientation(m_xFrame);
 }
 
 void ToolBarManager::notifyRegisteredControllers( const OUString& 
aUIElementName, const OUString& aCommand )
diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index f89cb335b541..055d82f1e722 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -34,8 +34,6 @@
 #include <vector>
 
 namespace com::sun::star::frame { class XFrame; }
-namespace com::sun::star::frame { struct FeatureStateEvent; }
-template <class T> class VclStatusListener;
 
 class Timer;
 struct ImplToolItem;
@@ -116,7 +114,6 @@ private:
     tools::Long                mnBottomBorder;
     tools::Long                mnLastResizeDY;
     tools::Long                mnActivateCount;
-    Degree10            mnImagesRotationAngle;
     ToolBoxItemId       mnLastFocusItemId;
     ToolBoxItemId       mnHighItemId;
     ToolBoxItemId       mnCurItemId;
@@ -143,7 +140,6 @@ private:
                         mbDragging:1,
                         mbIsKeyEvent:1,
                         mbChangingHighlight:1,
-                        mbImagesMirrored:1,
                         mbLineSpacing:1,
                         mbIsArranged:1;
     WindowAlign         meAlign;
@@ -161,8 +157,6 @@ private:
     Link<ToolBox *, void> maMenuButtonHdl;
     Link<StateChangedType const *, void> maStateChangedHandler;
     Link<DataChangedEvent const *, void> maDataChangedHandler;
-    /** StatusListener. Notifies about rotated images etc */
-    rtl::Reference<VclStatusListener<ToolBox>> mpStatusListener;
 
 public:
     using Window::ImplInit;
@@ -504,14 +498,11 @@ public:
 
 
     void SetToolbarLayoutMode( ToolBoxLayoutMode eLayout );
-    void statusChanged(const css::frame::FeatureStateEvent& rEvent);
 
     void SetToolBoxTextPosition( ToolBoxTextPosition ePosition );
 
     void SetLineSpacing(bool b) { mbLineSpacing = b; }
 
-    void TrackImageOrientation(const css::uno::Reference<css::frame::XFrame>& 
rFrame);
-
     virtual void DumpAsPropertyTree(tools::JsonWriter&) override;
 };
 
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index f1a31674e19e..441680aec077 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -2155,8 +2155,6 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window 
*pParent, const OString &
                     m_pParserState->m_aButtonMenuMaps.emplace_back(id, sMenu);
                 setupFromActionName(static_cast<Button*>(xWindow.get()), rMap, 
m_xFrame);
             }
-            else if (xWindow->GetType() == WindowType::TOOLBOX)
-                
static_cast<ToolBox*>(xWindow.get())->TrackImageOrientation(m_xFrame);
         }
     }
 
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 6223173c2d0b..37a4019942f4 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -18,7 +18,6 @@
  */
 
 #include <vcl/toolbox.hxx>
-#include <vcl/commandinfoprovider.hxx>
 #include <vcl/event.hxx>
 #include <vcl/decoview.hxx>
 #include <vcl/toolkit/floatwin.hxx>
@@ -29,13 +28,11 @@
 #include <vcl/layout.hxx>
 #include <vcl/menu.hxx>
 #include <vcl/settings.hxx>
-#include <vclstatuslistener.hxx>
 #include <vcl/ptrstyle.hxx>
 #include <bitmaps.hlst>
 #include <toolbarvalue.hxx>
 
 #include <tools/poly.hxx>
-#include <svl/imageitm.hxx>
 #include <sal/log.hxx>
 #include <o3tl/string_view.hxx>
 #include <osl/diagnose.h>
@@ -1102,15 +1099,6 @@ IMPL_LINK( ImplTBDragMgr, SelectHdl, Accelerator&, 
rAccel, void )
         EndDragging();
 }
 
-void ToolBox::TrackImageOrientation(const 
css::uno::Reference<css::frame::XFrame>& rFrame)
-{
-    if (mpStatusListener.is())
-        mpStatusListener->dispose();
-
-    mpStatusListener = new VclStatusListener<ToolBox>(this, rFrame, 
".uno:ImageOrientation");
-    mpStatusListener->startListening();
-}
-
 void ToolBox::ImplInitToolBoxData()
 {
     // initialize variables
@@ -1153,7 +1141,6 @@ void ToolBox::ImplInitToolBoxData()
     mbDragging            = false;
     mbIsKeyEvent          = false;
     mbChangingHighlight   = false;
-    mbImagesMirrored      = false;
     mbLineSpacing         = false;
     mbIsArranged          = false;
     meButtonType          = ButtonType::SYMBOLONLY;
@@ -1165,7 +1152,6 @@ void ToolBox::ImplInitToolBoxData()
     meTextPosition        = ToolBoxTextPosition::Right;
     mnLastFocusItemId     = ToolBoxItemId(0);
     mnActivateCount       = 0;
-    mnImagesRotationAngle = 0_deg10;
 
     mpIdle.reset(new Idle("vcl::ToolBox maIdle update"));
     mpIdle->SetPriority( TaskPriority::RESIZE );
@@ -1329,9 +1315,6 @@ void ToolBox::dispose()
     delete pSVData->maCtrlData.mpTBDragMgr;
     pSVData->maCtrlData.mpTBDragMgr = nullptr;
 
-    if (mpStatusListener.is())
-        mpStatusListener->dispose();
-
     mpFloatWin.clear();
 
     mpIdle.reset();
@@ -3856,29 +3839,6 @@ void ToolBox::DataChanged( const DataChangedEvent& 
rDCEvt )
     maDataChangedHandler.Call( &rDCEvt );
 }
 
-void ToolBox::statusChanged( const css::frame::FeatureStateEvent& Event )
-{
-    // Update image mirroring/rotation
-    if ( Event.FeatureURL.Complete != ".uno:ImageOrientation" )
-        return;
-
-    SfxImageItem aItem( 1 );
-    aItem.PutValue( Event.State, 0 );
-
-    mbImagesMirrored = aItem.IsMirrored();
-    mnImagesRotationAngle = aItem.GetRotation();
-
-    // update image orientation
-    OUString 
aModuleName(vcl::CommandInfoProvider::GetModuleIdentifier(mpStatusListener->getFrame()));
-    for (auto const& item : mpData->m_aItems)
-    {
-        if (vcl::CommandInfoProvider::IsMirrored(item.maCommandStr, 
aModuleName))
-            SetItemImageMirrorMode(item.mnId, mbImagesMirrored);
-        if (vcl::CommandInfoProvider::IsRotated(item.maCommandStr, 
aModuleName))
-            SetItemImageAngle(item.mnId, mnImagesRotationAngle);
-    }
-}
-
 void ToolBox::SetStyle(WinBits nNewStyle)
 {
     mnWinStyle = nNewStyle;

Reply via email to