diff options
author | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2022-07-28 14:01:45 +0200 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2022-08-01 04:23:02 +0200 |
commit | 74918534ee4243d2849f74c4eaf91eb610999413 (patch) | |
tree | 3ebeb708b10fa8702ac8d597a92efd2f87079db8 /sfx2/source/doc/printhelper.cxx | |
parent | 12b3cd8737e1d4ab76eb0eedee8790eb44b1e278 (diff) |
Add 'JobName' to PrintOptions
Allow users to specify a job name which is sent to the printer
(by default this is the current document name).
Usage:
Sub PrintWithCustomJobname
Dim mPOpts(1) As New com.sun.star.beans.PropertyValue
mPOpts(0).Name = "JobName"
mPOpts(0).Value = "My Job Name"
ThisComponent.Print(mPOpts())
End Sub
Change-Id: Id7c1c0da7f581b1c050bb3e6d61dd01b7e8205f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137562
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'sfx2/source/doc/printhelper.cxx')
-rw-r--r-- | sfx2/source/doc/printhelper.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index 64f17e15bd37..1557cc567b2f 100644 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -694,6 +694,15 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >& pCheckedArgs[nProps++].Value <<= bTemp; } + else if ( rProp.Name == "JobName" ) + { + OUString sTemp; + if( !(rProp.Value >>= sTemp) ) + throw css::lang::IllegalArgumentException(); + pCheckedArgs[nProps].Name = rProp.Name; + pCheckedArgs[nProps++].Value <<= sTemp; + } + // Pages-Property else if ( rProp.Name == "Pages" ) { |