diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2015-12-20 14:28:56 +0200 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2015-12-20 14:48:14 +0200 |
commit | f4fabf4270945beaa62c047056def378c992555c (patch) | |
tree | 47dbb6e785ef5f165fcaa1fb6afe756e53ca06ca /framework | |
parent | d62f22570dfa767cc646f362eb2f6a2f78113874 (diff) |
Probably a better way to detect readonly doc
Change-Id: I91f260ad878eba0bd7459c4246357e768c158765
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/uielement/resourcemenucontroller.cxx | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/framework/source/uielement/resourcemenucontroller.cxx b/framework/source/uielement/resourcemenucontroller.cxx index dcbc607831da..a626e3540353 100644 --- a/framework/source/uielement/resourcemenucontroller.cxx +++ b/framework/source/uielement/resourcemenucontroller.cxx @@ -9,12 +9,13 @@ #include <uielement/menubarmanager.hxx> +#include <cppuhelper/implbase.hxx> #include <svtools/popupmenucontrollerbase.hxx> -#include <unotools/mediadescriptor.hxx> #include <com/sun/star/embed/VerbAttributes.hpp> #include <com/sun/star/embed/VerbDescriptor.hpp> #include <com/sun/star/frame/ModuleManager.hpp> +#include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/ui/theModuleUIConfigurationManagerSupplier.hpp> #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp> #include <com/sun/star/util/URL.hpp> @@ -210,17 +211,11 @@ void ResourceMenuController::addVerbs( const css::uno::Sequence< css::embed::Ver { // Check if the document is read-only. css::uno::Reference< css::frame::XController > xController( m_xFrame->getController() ); - css::uno::Reference< css::frame::XModel > xModel; + css::uno::Reference< css::frame::XStorable > xStorable; if ( xController.is() ) - xModel.set( xController->getModel() ); - - bool bReadOnly = false; - if ( xModel.is() ) - { - utl::MediaDescriptor aMediaDesc( xModel->getArgs() ); - bReadOnly = aMediaDesc.getUnpackedValueOrDefault( utl::MediaDescriptor::PROP_READONLY(), false ); - } + xStorable.set( xController->getModel(), css::uno::UNO_QUERY ); + bool bReadOnly = xStorable.is() && xStorable->isReadonly(); VCLXMenu* pAwtMenu = VCLXMenu::GetImplementation( m_xPopupMenu ); Menu* pVCLMenu = pAwtMenu->GetMenu(); |