summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMaxime de Roucy <mderoucy@linagora.com>2012-06-26 15:52:41 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-06-26 15:59:17 +0100
commit7db0ac29c0962932bbcd8b460dc51c9e5009dbfa (patch)
tree5bb5cae6aaf566faec3ee2ffcdc0f3977f1d6609 /sfx2
parent512b195910a7f73206c50a89ec5fc62cced49ace (diff)
Prevent print settings dialog to show help button
Prevent the printer settings dialog to show help button when it's called from the help. Add a PrinterController property : HideHelpButton Change-Id: I45585a30a2f429659f554747f93c650cb048711f
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/view/viewprn.cxx15
1 files changed, 11 insertions, 4 deletions
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 239c3007a8ca..cb8a2e8a994d 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -671,8 +671,6 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
bSilent = pSilentItem && pSilentItem->GetValue();
}
- //FIXME: how to transport "bPrintOnHelp"?
-
// no help button in dialogs if called from the help window
// (pressing help button would exchange the current page inside the help
// document that is going to be printed!)
@@ -744,6 +742,11 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
}
}
+ // we will add the "PrintSelectionOnly" or "HideHelpButton" properties
+ // we have to increase the capacity of aProps
+ sal_Int32 nLen = aProps.getLength();
+ aProps.realloc( nLen + 1 );
+
// HACK: writer sets the SID_SELECTION item when printing directly and expects
// to get only the selection document in that case (see getSelectionObject)
// however it also reacts to the PrintContent property. We need this distinction here, too,
@@ -755,11 +758,15 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
SFX_REQUEST_ARG(rReq, pSelectItem, SfxBoolItem, SID_SELECTION, sal_False);
sal_Bool bSelection = ( pSelectItem != NULL && pSelectItem->GetValue() );
- sal_Int32 nLen = aProps.getLength();
- aProps.realloc( nLen + 1 );
aProps[nLen].Name = rtl::OUString( "PrintSelectionOnly" );
aProps[nLen].Value = makeAny( bSelection );
}
+ else // if nId == SID_PRINTDOC ; nothing to do with the previous HACK
+ {
+ // should the printer selection and properties dialogue display an help button
+ aProps[nLen].Name = rtl::OUString( "HideHelpButton" );
+ aProps[nLen].Value = makeAny( bPrintOnHelp );
+ }
ExecPrint( aProps, bIsAPI, (nId == SID_PRINTDOCDIRECT) );