diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-02-17 11:44:29 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-02-17 11:44:58 +0000 |
commit | a96acacb91197a04e8fd9114d8c4bcda24372f54 (patch) | |
tree | bfbe3a1326daf0d0bdb2c8f5c2116e262c5cfde6 /cui/source | |
parent | ef966b007deca9e76c24bc2afb74ba94a3173771 (diff) |
Resolves: tdf#89417 disable hardware accel checkbox if property is readonly
Change-Id: Ie99643ba29a3b47dd47d2fb1359d573a52f4c64a
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/options/optgdlg.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 207addc847b7..a4474744e73b 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -78,6 +78,7 @@ #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/beans/NamedValue.hpp> +#include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/util/XChangesBatch.hpp> #include <com/sun/star/uno/Any.hxx> @@ -456,6 +457,7 @@ public: bool IsHardwareAccelerationEnabled() const; bool IsHardwareAccelerationAvailable() const; + bool IsHardwareAccelerationRO() const; void EnabledHardwareAcceleration( bool _bEnabled ) const; private: @@ -583,6 +585,17 @@ bool CanvasSettings::IsHardwareAccelerationEnabled() const return !bForceLastEntry; } +bool CanvasSettings::IsHardwareAccelerationRO() const +{ + Reference< XPropertySet > xSet(mxForceFlagNameAccess, UNO_QUERY); + if (!xSet.is()) + return true; + + Reference< XPropertySetInfo > xInfo = xSet->getPropertySetInfo(); + Property aProp = xInfo->getPropertyByName("ForceSafeServiceImpl"); + return ((aProp.Attributes & css::beans::PropertyAttribute::READONLY ) == css::beans::PropertyAttribute::READONLY); +} + void CanvasSettings::EnabledHardwareAcceleration( bool _bEnabled ) const { Reference< XNameReplace > xNameReplace( @@ -949,6 +962,7 @@ void OfaViewTabPage::Reset( const SfxItemSet* ) if(pCanvasSettings->IsHardwareAccelerationAvailable()) { m_pUseHardwareAccell->Check(pCanvasSettings->IsHardwareAccelerationEnabled()); + m_pUseHardwareAccell->Enable(!pCanvasSettings->IsHardwareAccelerationRO()); } else { |