sd/source/ui/sidebar/SlideBackground.cxx | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-)
New commits: commit 86abd3ec30bac181df228569b70aaf9086ed5f4a Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Fri Dec 7 11:10:14 2018 +0100 Commit: Katarina Behrens <katarina.behr...@cib.de> CommitDate: Mon Dec 10 10:15:28 2018 +0100 Check pDoc is not null Change-Id: I9a85e6ee0b1d2df36999cbd968d84bf60e62f0a9 Reviewed-on: https://gerrit.libreoffice.org/64758 Tested-by: Jenkins Reviewed-by: Katarina Behrens <katarina.behr...@cib.de> diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx index e1958c1927ad..d1c7bdcdb8ef 100644 --- a/sd/source/ui/sidebar/SlideBackground.cxx +++ b/sd/source/ui/sidebar/SlideBackground.cxx @@ -157,19 +157,22 @@ SlideBackground::SlideBackground( ::sd::DrawDocShell* pDocSh = dynamic_cast<::sd::DrawDocShell*>( SfxObjectShell::Current() ); SdDrawDocument* pDoc = pDocSh ? pDocSh->GetDoc() : nullptr; - SdOptions* pOptions = SD_MOD()->GetSdOptions(pDoc->GetDocumentType()); - if (pOptions) + if (pDoc) { - FieldUnit eMetric = static_cast<FieldUnit>(pOptions->GetMetric()); - if (IsInch(eMetric)) + SdOptions* pOptions = SD_MOD()->GetSdOptions(pDoc->GetDocumentType()); + if (pOptions) { - for (size_t i = 0; i < SAL_N_ELEMENTS(RID_PAGEFORMATPANEL_MARGINS_INCH); ++i) - mpMarginSelectBox->InsertEntry(SdResId(RID_PAGEFORMATPANEL_MARGINS_INCH[i])); + FieldUnit eMetric = static_cast<FieldUnit>(pOptions->GetMetric()); + if (IsInch(eMetric)) + { + for (size_t i = 0; i < SAL_N_ELEMENTS(RID_PAGEFORMATPANEL_MARGINS_INCH); ++i) + mpMarginSelectBox->InsertEntry(SdResId(RID_PAGEFORMATPANEL_MARGINS_INCH[i])); + } + else + { + for (size_t i = 0; i < SAL_N_ELEMENTS(RID_PAGEFORMATPANEL_MARGINS_CM); ++i) + mpMarginSelectBox->InsertEntry(SdResId(RID_PAGEFORMATPANEL_MARGINS_CM[i])); } - else - { - for (size_t i = 0; i < SAL_N_ELEMENTS(RID_PAGEFORMATPANEL_MARGINS_CM); ++i) - mpMarginSelectBox->InsertEntry(SdResId(RID_PAGEFORMATPANEL_MARGINS_CM[i])); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits