summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2023-10-01 19:25:45 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2023-10-01 21:10:17 +0200
commitfe2031b993721dbe40d71684f4609ee3cf018958 (patch)
tree48734351f6e862f14eda529523a5a981b3a105e8 /filter
parentfe3fa1699f12eb007d26bbb19f5ff80826bc384f (diff)
cid#1547033 Dereference after null check
Change-Id: Id407ef300fca83167fb9813534fb099c6e56fc0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157449 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/pdf/impdialog.cxx21
-rw-r--r--filter/source/pdf/impdialog.hxx5
2 files changed, 15 insertions, 11 deletions
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index ba412851c393..a036d432e3c3 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -413,7 +413,6 @@ void ImpPDFTabDialog::PageCreated(const OUString& rId, SfxTabPage& rPage)
}
}
-
Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData()
{
// updating the FilterData sequence and storing FilterData to configuration
@@ -859,10 +858,10 @@ void ImpPDFTabGeneralPage::EnableExportNotesPages()
if ( mbIsPresentation )
{
mxCbExportNotesPages->set_sensitive(
- !mxRbSelection->get_active() && !mpParent->maConfigItem.IsReadOnly("ExportNotesPages"));
+ !mxRbSelection->get_active() && !IsReadOnlyProperty("ExportNotesPages"));
mxCbExportOnlyNotesPages->set_sensitive(
!mxRbSelection->get_active() && mxCbExportNotesPages->get_active()
- && !mpParent->maConfigItem.IsReadOnly("ExportOnlyNotesPages"));
+ && !IsReadOnlyProperty("ExportOnlyNotesPages"));
}
}
@@ -873,9 +872,9 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleExportFormFieldsHdl, weld::Toggleabl
mxFormsFrame->set_sensitive(bExportFormFields);
if (bExportFormFields)
{
- if (mpParent->maConfigItem.IsReadOnly("FormsType"))
+ if (IsReadOnlyProperty("FormsType"))
mxLbFormsFormat->set_sensitive(false);
- if (mpParent->maConfigItem.IsReadOnly("AllowDuplicateFieldNames"))
+ if (IsReadOnlyProperty("AllowDuplicateFieldNames"))
mxCbAllowDuplicateFieldNames->set_sensitive(false);
}
}
@@ -884,20 +883,20 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleExportNotesPagesHdl, weld::Toggleabl
{
mxCbExportOnlyNotesPages->set_sensitive(
mxCbExportNotesPages->get_active()
- && !mpParent->maConfigItem.IsReadOnly("ExportOnlyNotesPages"));
+ && !IsReadOnlyProperty("ExportOnlyNotesPages"));
}
IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleCompressionHdl, weld::Toggleable&, void)
{
mxQualityFrame->set_sensitive(
- mxRbJPEGCompression->get_active() && !mpParent->maConfigItem.IsReadOnly("Quality"));
+ mxRbJPEGCompression->get_active() && !IsReadOnlyProperty("Quality"));
}
IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleReduceImageResolutionHdl, weld::Toggleable&, void)
{
mxCoReduceImageResolution->set_sensitive(
mxCbReduceImageResolution->get_active()
- && !mpParent->maConfigItem.IsReadOnly("MaxImageResolution"));
+ && !IsReadOnlyProperty("MaxImageResolution"));
}
IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleWatermarkHdl, weld::Toggleable&, void)
@@ -940,9 +939,9 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, TogglePDFVersionOrUniversalAccessibilityHa
pSecPage->ImplPDFASecurityControl(!bIsPDFA);
mxCbTaggedPDF->set_sensitive(
- !bIsPDFA && !bIsPDFUA && !mpParent->maConfigItem.IsReadOnly("UseTaggedPDF"));
+ !bIsPDFA && !bIsPDFUA && !IsReadOnlyProperty("UseTaggedPDF"));
mxRbPDFAVersion->set_sensitive(
- bIsPDFA && !mpParent->maConfigItem.IsReadOnly("SelectPdfVersion"));
+ bIsPDFA && !IsReadOnlyProperty("SelectPdfVersion"));
if (bIsPDFA || bIsPDFUA)
{
@@ -991,7 +990,7 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, TogglePDFVersionOrUniversalAccessibilityHa
mxCbUseReferenceXObject->set_active(mpParent->mbUseReferenceXObjectUserSelection);
}
mxCbExportBookmarks->set_sensitive(
- !bIsPDFUA && !mpParent->maConfigItem.IsReadOnly("ExportBookmarks"));
+ !bIsPDFUA && !IsReadOnlyProperty("ExportBookmarks"));
mxCbUseReferenceXObject->set_sensitive(!bIsPDFUA);
ImpPDFTabOpnFtrPage *const pOpenPage(mpParent ? mpParent->getOpenPage() : nullptr);
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index 3690c9e61ff9..7a8985ebc807 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -236,6 +236,11 @@ class ImpPDFTabGeneralPage : public SfxTabPage
std::shared_ptr<weld::MessageDialog> mxPasswordUnusedWarnDialog;
+ bool IsReadOnlyProperty(const OUString& rPropertyName) const
+ {
+ return mpParent && mpParent->maConfigItem.IsReadOnly(rPropertyName);
+ }
+
public:
ImpPDFTabGeneralPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);