From 7db0ac29c0962932bbcd8b460dc51c9e5009dbfa Mon Sep 17 00:00:00 2001 From: Maxime de Roucy Date: Tue, 26 Jun 2012 15:52:41 +0100 Subject: 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 --- sfx2/source/view/viewprn.cxx | 15 +++++++++++---- vcl/source/window/printdlg.cxx | 3 +++ 2 files changed, 14 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) ); diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index d9aa5dd08b94..9c05203934e4 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -902,6 +902,9 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptrgetBoolProperty( rtl::OUString( "HideHelpButton" ), sal_False ) ) + maHelpButton.Hide(); + // set initial focus to "Number of copies" maJobPage.maCopyCountField.GrabFocus(); maJobPage.maCopyCountField.SetSelection( Selection(0, 0xFFFF) ); -- cgit