summaryrefslogtreecommitdiff
path: root/vbahelper
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-11-17 11:18:40 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-11-18 07:41:51 +0100
commit5e69b3619d3a2b05930c5b8b8521d7f2938c709d (patch)
tree2bcfb4244223b7fe570e9b0bcee2f7dd3928e226 /vbahelper
parent1d097883541b9d244e50ced7fe49a4d7a0f65cfd (diff)
loplugin:flatten in toolkit..writerfilter
Change-Id: I4da2a768b6b55869c3a3d6f8a8d50dc018709acd Reviewed-on: https://gerrit.libreoffice.org/44865 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vbahelper')
-rw-r--r--vbahelper/source/vbahelper/vbahelper.cxx66
1 files changed, 33 insertions, 33 deletions
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx
index 327986919ab7..82cd2bf197c0 100644
--- a/vbahelper/source/vbahelper/vbahelper.cxx
+++ b/vbahelper/source/vbahelper/vbahelper.cxx
@@ -362,49 +362,49 @@ void PrintOutHelper( SfxViewShell const * pViewShell, const uno::Any& From, cons
SfxViewFrame* pViewFrame = nullptr;
if ( pViewShell )
pViewFrame = pViewShell->GetViewFrame();
- if ( pViewFrame )
- {
- SfxAllItemSet aArgs( SfxGetpApp()->GetPool() );
+ if ( !pViewFrame )
+ return;
- SfxBoolItem sfxCollate( SID_PRINT_COLLATE, bCollate );
- aArgs.Put( sfxCollate, sfxCollate.Which() );
- SfxInt16Item sfxCopies( SID_PRINT_COPIES, nCopies );
- aArgs.Put( sfxCopies, sfxCopies.Which() );
- if ( !sFileName.isEmpty() )
- {
- SfxStringItem sfxFileName( SID_FILE_NAME, sFileName);
- aArgs.Put( sfxFileName, sfxFileName.Which() );
+ SfxAllItemSet aArgs( SfxGetpApp()->GetPool() );
- }
- if ( !sRange.isEmpty() )
- {
- SfxStringItem sfxRange( SID_PRINT_PAGES, sRange );
- aArgs.Put( sfxRange, sfxRange.Which() );
- }
- SfxBoolItem sfxSelection( SID_SELECTION, bSelection );
- aArgs.Put( sfxSelection, sfxSelection.Which() );
- SfxBoolItem sfxAsync( SID_ASYNCHRON, false );
- aArgs.Put( sfxAsync, sfxAsync.Which() );
- SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
+ SfxBoolItem sfxCollate( SID_PRINT_COLLATE, bCollate );
+ aArgs.Put( sfxCollate, sfxCollate.Which() );
+ SfxInt16Item sfxCopies( SID_PRINT_COPIES, nCopies );
+ aArgs.Put( sfxCopies, sfxCopies.Which() );
+ if ( !sFileName.isEmpty() )
+ {
+ SfxStringItem sfxFileName( SID_FILE_NAME, sFileName);
+ aArgs.Put( sfxFileName, sfxFileName.Which() );
- if ( pDispatcher )
+ }
+ if ( !sRange.isEmpty() )
+ {
+ SfxStringItem sfxRange( SID_PRINT_PAGES, sRange );
+ aArgs.Put( sfxRange, sfxRange.Which() );
+ }
+ SfxBoolItem sfxSelection( SID_SELECTION, bSelection );
+ aArgs.Put( sfxSelection, sfxSelection.Which() );
+ SfxBoolItem sfxAsync( SID_ASYNCHRON, false );
+ aArgs.Put( sfxAsync, sfxAsync.Which() );
+ SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
+
+ if ( pDispatcher )
+ {
+ if ( bPreview )
{
- if ( bPreview )
+ if ( !pViewFrame->GetFrame().IsInPlace() )
{
- if ( !pViewFrame->GetFrame().IsInPlace() )
- {
- // #TODO is this necessary ( calc specific )
+ // #TODO is this necessary ( calc specific )
// SC_MOD()->InputEnterHandler();
- pViewFrame->GetDispatcher()->Execute( SID_VIEWSHELL1, SfxCallMode::SYNCHRON );
- WaitUntilPreviewIsClosed( pViewFrame );
- }
+ pViewFrame->GetDispatcher()->Execute( SID_VIEWSHELL1, SfxCallMode::SYNCHRON );
+ WaitUntilPreviewIsClosed( pViewFrame );
}
- else
- pDispatcher->Execute( (sal_uInt16)SID_PRINTDOC, SfxCallMode::SYNCHRON, aArgs );
}
-
+ else
+ pDispatcher->Execute( (sal_uInt16)SID_PRINTDOC, SfxCallMode::SYNCHRON, aArgs );
}
+
// #FIXME #TODO
// 1 ActivePrinter ( how/can we switch a printer via API? )
// 2 PrintToFile ( ms behaviour if this option is specified but no