summaryrefslogtreecommitdiff
path: root/sfx2/source/view
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/view')
-rw-r--r--sfx2/source/view/viewprn.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index b67267a61b53..f9cd9c005c39 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -616,10 +616,14 @@ void SfxViewShell::StartPrint( const uno::Sequence < beans::PropertyValue >& rPr
));
pImpl->m_xPrinterController = xNewController;
- SfxObjectShell *pObjShell = GetObjectShell();
- xNewController->setValue( "JobName",
- makeAny( pObjShell->GetTitle(1) ) );
- xNewController->setPrinterModified( mbPrinterSettingsModified );
+ // When no JobName was specified via com::sun::star::view::PrintOptions::JobName ,
+ // use the document title as default job name
+ css::beans::PropertyValue* pJobNameVal = xNewController->getValue("JobName");
+ if (!pJobNameVal)
+ {
+ xNewController->setValue("JobName", Any(GetObjectShell()->GetTitle(1)));
+ xNewController->setPrinterModified(mbPrinterSettingsModified);
+ }
}
void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rProps, bool bIsAPI, bool bIsDirect )