Kaydet (Commit) 7db0ac29 authored tarafından Maxime de Roucy's avatar Maxime de Roucy Kaydeden (comit) Caolán McNamara

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
üst 512b1959
...@@ -671,8 +671,6 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) ...@@ -671,8 +671,6 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
bSilent = pSilentItem && pSilentItem->GetValue(); bSilent = pSilentItem && pSilentItem->GetValue();
} }
//FIXME: how to transport "bPrintOnHelp"?
// no help button in dialogs if called from the help window // no help button in dialogs if called from the help window
// (pressing help button would exchange the current page inside the help // (pressing help button would exchange the current page inside the help
// document that is going to be printed!) // document that is going to be printed!)
...@@ -744,6 +742,11 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) ...@@ -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 // HACK: writer sets the SID_SELECTION item when printing directly and expects
// to get only the selection document in that case (see getSelectionObject) // 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, // however it also reacts to the PrintContent property. We need this distinction here, too,
...@@ -755,11 +758,15 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) ...@@ -755,11 +758,15 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
SFX_REQUEST_ARG(rReq, pSelectItem, SfxBoolItem, SID_SELECTION, sal_False); SFX_REQUEST_ARG(rReq, pSelectItem, SfxBoolItem, SID_SELECTION, sal_False);
sal_Bool bSelection = ( pSelectItem != NULL && pSelectItem->GetValue() ); sal_Bool bSelection = ( pSelectItem != NULL && pSelectItem->GetValue() );
sal_Int32 nLen = aProps.getLength();
aProps.realloc( nLen + 1 );
aProps[nLen].Name = rtl::OUString( "PrintSelectionOnly" ); aProps[nLen].Name = rtl::OUString( "PrintSelectionOnly" );
aProps[nLen].Value = makeAny( bSelection ); 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) ); ExecPrint( aProps, bIsAPI, (nId == SID_PRINTDOCDIRECT) );
......
...@@ -902,6 +902,9 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont ...@@ -902,6 +902,9 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont
// setup dependencies // setup dependencies
checkControlDependencies(); checkControlDependencies();
if ( maPController->getBoolProperty( rtl::OUString( "HideHelpButton" ), sal_False ) )
maHelpButton.Hide();
// set initial focus to "Number of copies" // set initial focus to "Number of copies"
maJobPage.maCopyCountField.GrabFocus(); maJobPage.maCopyCountField.GrabFocus();
maJobPage.maCopyCountField.SetSelection( Selection(0, 0xFFFF) ); maJobPage.maCopyCountField.SetSelection( Selection(0, 0xFFFF) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment