[Libreoffice-commits] core.git: framework/source
Maxim Monastirsky
momonasmon at gmail.com
Sun Nov 29 13:09:50 PST 2015
framework/source/uielement/saveasmenucontroller.cxx | 66 +-------------------
1 file changed, 5 insertions(+), 61 deletions(-)
New commits:
commit ae3f19564f33039260544a0c28dc99c23ed6f348
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date: Sun Nov 29 23:05:03 2015 +0200
SaveAsMenuController cleanup
Change-Id: Ib4a838619092b47b4eb5304e8d63ab6d7ee8d1c4
diff --git a/framework/source/uielement/saveasmenucontroller.cxx b/framework/source/uielement/saveasmenucontroller.cxx
index 012a630..c0715d6 100644
--- a/framework/source/uielement/saveasmenucontroller.cxx
+++ b/framework/source/uielement/saveasmenucontroller.cxx
@@ -17,33 +17,19 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <classes/resource.hrc>
-#include <classes/fwkresid.hxx>
-
#include <cppuhelper/supportsservice.hxx>
-#include <osl/file.hxx>
-#include <osl/mutex.hxx>
-#include <rtl/ref.hxx>
#include <svtools/popupmenucontrollerbase.hxx>
-#include <tools/urlobj.hxx>
-#include <unotools/historyoptions.hxx>
#include <vcl/menu.hxx>
#include <vcl/svapp.hxx>
using namespace css;
using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
using namespace com::sun::star::frame;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::util;
-using namespace framework;
namespace {
class SaveAsMenuController : public svt::PopupMenuControllerBase
{
- using svt::PopupMenuControllerBase::disposing;
-
public:
explicit SaveAsMenuController( const uno::Reference< uno::XComponentContext >& xContext );
virtual ~SaveAsMenuController();
@@ -71,23 +57,12 @@ public:
// XStatusListener
virtual void SAL_CALL statusChanged( const frame::FeatureStateEvent& Event ) throw ( uno::RuntimeException, std::exception ) override;
- // XMenuListener
- virtual void SAL_CALL itemActivated( const awt::MenuEvent& rEvent ) throw (uno::RuntimeException, std::exception) override;
-
- // XEventListener
- virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) throw ( uno::RuntimeException, std::exception ) override;
-
private:
virtual void impl_setPopupMenu() override;
-
- void fillPopupMenu( css::uno::Reference< css::awt::XPopupMenu >& rPopupMenu );
-
- bool m_bDisabled : 1;
};
SaveAsMenuController::SaveAsMenuController( const uno::Reference< uno::XComponentContext >& xContext ) :
- svt::PopupMenuControllerBase( xContext ),
- m_bDisabled( false )
+ svt::PopupMenuControllerBase( xContext )
{
}
@@ -95,15 +70,13 @@ SaveAsMenuController::~SaveAsMenuController()
{
}
-// private function
-void SaveAsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopupMenu )
+void SaveAsMenuController::impl_setPopupMenu()
{
- VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu *>(VCLXMenu::GetImplementation( rPopupMenu ));
- PopupMenu* pVCLPopupMenu = nullptr;
+ VCLXMenu* pPopupMenu = VCLXMenu::GetImplementation( m_xPopupMenu );
+ Menu* pVCLPopupMenu = nullptr;
SolarMutexGuard aSolarMutexGuard;
- resetPopupMenu( rPopupMenu );
if ( pPopupMenu )
pVCLPopupMenu = static_cast<PopupMenu *>(pPopupMenu->GetMenu());
@@ -114,38 +87,9 @@ void SaveAsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPo
}
}
-// XEventListener
-void SAL_CALL SaveAsMenuController::disposing( const EventObject& ) throw ( RuntimeException, std::exception )
-{
- Reference< css::awt::XMenuListener > xHolder(static_cast<OWeakObject *>(this), UNO_QUERY );
-
- osl::MutexGuard aLock( m_aMutex );
- m_xFrame.clear();
- m_xDispatch.clear();
-
- if ( m_xPopupMenu.is() )
- m_xPopupMenu->removeMenuListener( Reference< css::awt::XMenuListener >(static_cast<OWeakObject *>(this), UNO_QUERY ));
- m_xPopupMenu.clear();
-}
-
// XStatusListener
-void SAL_CALL SaveAsMenuController::statusChanged( const FeatureStateEvent& Event ) throw ( RuntimeException, std::exception )
-{
- osl::MutexGuard aLock( m_aMutex );
- m_bDisabled = !Event.IsEnabled;
-}
-
-void SAL_CALL SaveAsMenuController::itemActivated( const css::awt::MenuEvent& ) throw (RuntimeException, std::exception)
-{
- osl::MutexGuard aLock( m_aMutex );
- impl_setPopupMenu();
-}
-
-// XPopupMenuController
-void SaveAsMenuController::impl_setPopupMenu()
+void SAL_CALL SaveAsMenuController::statusChanged( const FeatureStateEvent& /*Event*/ ) throw ( RuntimeException, std::exception )
{
- if ( m_xPopupMenu.is() )
- fillPopupMenu( m_xPopupMenu );
}
}
More information about the Libreoffice-commits
mailing list