diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-07-04 14:23:20 +0200 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2023-07-12 18:52:45 +0200 |
commit | 2e7f0326cc240c48e6e49498dabe9d805c3b89ac (patch) | |
tree | b22915571312260dbdd6bf55d143b4e17f2982b7 /sfx2 | |
parent | 00650e4c794abfeb196a36b59ec53b2dca12ca48 (diff) |
sfx2: fix crash in SfxViewShell::StartPrint
See https://crashreport.libreoffice.org/stats/signature/SfxViewShell::StartPrint(com::sun::star::uno::Sequence%3Ccom::sun::star::beans::PropertyValue%3E%20const%20&,bool,bool)
Change-Id: I3d10414d4cfd027bf80ceaf6692bb7f92269f6c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153965
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
(cherry picked from commit 3502f5147b9102d37459c373ee07e052fd267db7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153990
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit 6737f3c00ce0752977f9159abd080f64640d449a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154007
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/viewprn.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 9476dd22edec..885f1bb31346 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -609,8 +609,11 @@ void SfxViewShell::StartPrint( const uno::Sequence < beans::PropertyValue >& rPr css::beans::PropertyValue* pJobNameVal = xNewController->getValue("JobName"); if (!pJobNameVal) { - xNewController->setValue("JobName", Any(GetObjectShell()->GetTitle(1))); - xNewController->setPrinterModified(mbPrinterSettingsModified); + if (SfxObjectShell* pDoc = GetObjectShell()) + { + xNewController->setValue("JobName", Any(pDoc->GetTitle(1))); + xNewController->setPrinterModified(mbPrinterSettingsModified); + } } } |