diff options
author | Justin Luth <jluth@mail.com> | 2023-09-29 11:01:28 -0400 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2023-09-30 11:56:49 +0200 |
commit | ba07ae10e765cb135097dceefd94346ff43bf472 (patch) | |
tree | 31ce36b1eb9d2510e257eb39e824cb7641f5abac /vcl | |
parent | a2b389d3a94e93cbddf5f1bbb1396ccc9031cdd1 (diff) |
pdf-dialog general-tab: set_sensitive if config not read-only
Disable (gray out) Export as PDF options
that are enforced (unchangeable) in the settings,
similar to how optsave does it for tools - options.
It is possible for an config extension to set oor:finalized="true",
which needs to prevent the user from changing the value.
Noticed during the LibreOffice conference in Bucharest, RO.
mxCbExportBookmarks == Export Outlines
Change-Id: I27f28107d1c1dc5d46fc6e2b8a8a83933e30d6ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157408
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/filter/FilterConfigItem.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/vcl/source/filter/FilterConfigItem.cxx b/vcl/source/filter/FilterConfigItem.cxx index 05acd96ae3aa..41eaac04e1d4 100644 --- a/vcl/source/filter/FilterConfigItem.cxx +++ b/vcl/source/filter/FilterConfigItem.cxx @@ -24,6 +24,7 @@ #include <comphelper/propertyvalue.hxx> #include <o3tl/string_view.hxx> #include <osl/diagnose.h> +#include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/configuration/theDefaultProvider.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -247,6 +248,19 @@ bool FilterConfigItem::WritePropertyValue( Sequence< PropertyValue >& rPropSeq, return bRet; } +bool FilterConfigItem::IsReadOnly(const OUString& rName) +{ + if (!xPropSet.is()) + return false; + + const Reference<XPropertySetInfo> xInfo(xPropSet->getPropertySetInfo()); + if (!xInfo.is() || !xInfo->hasPropertyByName(rName)) + return false; + + const css::beans::Property aProp(xInfo->getPropertyByName(rName)); + return (aProp.Attributes & PropertyAttribute::READONLY); +} + bool FilterConfigItem::ReadBool( const OUString& rKey, bool bDefault ) { Any aAny; |