an app can have print options without a print options dialog

e.g. draw and impress have print options, but no print options dialog

(It's plausible that we should merge the print options in the print dialog with
the print options in the options... dialog of the printer settings dialog)

Change-Id: I25c029ad8ba482b1e8d8d5974cc8de99584b9a55
This commit is contained in:
Caolán McNamara
2012-12-06 21:05:57 +00:00
parent 8dd1581a4f
commit d1660f19d5
14 changed files with 41 additions and 23 deletions

View File

@@ -110,7 +110,8 @@ public:
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
virtual SfxPrinter* GetPrinter( sal_Bool bCreate = false );
virtual sal_uInt16 SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false );
virtual sal_uInt16 SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false );
virtual bool HasPrintOptionsPage() const;
virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions );
void AddAccessibilityObject( SfxListener& rObject );

View File

@@ -353,6 +353,7 @@ public:
virtual sal_uInt16 SetPrinter( SfxPrinter* pNewPrinter,
sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsApi=false );
virtual bool HasPrintOptionsPage() const;
virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions );
void ConnectObject( SdrOle2Obj* pObj );

View File

@@ -570,6 +570,11 @@ sal_uInt16 ScPreviewShell::SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiff
return pDocShell->SetPrinter( pNewPrinter, nDiffFlags );
}
bool ScPreviewShell::HasPrintOptionsPage() const
{
return true;
}
SfxTabPage* ScPreviewShell::CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions )
{
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();

View File

@@ -1093,6 +1093,11 @@ sal_uInt16 ScTabViewShell::SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiff
return GetViewData()->GetDocShell()->SetPrinter( pNewPrinter, nDiffFlags );
}
bool ScTabViewShell::HasPrintOptionsPage() const
{
return true;
}
SfxTabPage* ScTabViewShell::CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions )
{
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();

View File

@@ -139,11 +139,6 @@ public:
SfxPrinter* pNewPrinter,
sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsApi=false);
/// Forwarded to the print manager.
virtual SfxTabPage* CreatePrintOptionsPage (
::Window *pParent,
const SfxItemSet &rOptions);
/// Forward methods to main sub shell.
virtual void WriteUserDataSequence (
::com::sun::star::uno::Sequence <

View File

@@ -626,18 +626,6 @@ sal_uInt16 ViewShellBase::SetPrinter (
SfxTabPage* ViewShellBase::CreatePrintOptionsPage(
::Window *pParent,
const SfxItemSet &rOptions)
{
(void)pParent;
(void)rOptions;
return NULL;
}
void ViewShellBase::UIActivating( SfxInPlaceClient* pClient )
{
mpImpl->ShowViewTabBar(false);

View File

@@ -214,7 +214,8 @@ public:
// Printing Interface
virtual SfxPrinter* GetPrinter( sal_Bool bCreate = sal_False );
virtual sal_uInt16 SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=sal_False );
virtual sal_uInt16 SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=sal_False );
virtual bool HasPrintOptionsPage() const;
virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions );
virtual JobSetup GetJobSetup() const;
Printer* GetActivePrinter() const;

View File

@@ -829,7 +829,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
// execute PrinterSetupDialog
PrinterSetupDialog* pPrintSetupDlg = new PrinterSetupDialog( GetWindow() );
if (pImp->m_bHasPrintOptions)
if (pImp->m_bHasPrintOptions && HasPrintOptionsPage())
{
// additional controls for dialog
pExecutor = new SfxDialogExecutor_Impl( this, pPrintSetupDlg );
@@ -919,6 +919,11 @@ SfxTabPage* SfxViewShell::CreatePrintOptionsPage
return 0;
}
bool SfxViewShell::HasPrintOptionsPage() const
{
return false;
}
JobSetup SfxViewShell::GetJobSetup() const
{
return JobSetup();

View File

@@ -266,6 +266,7 @@ protected:
bool Insert( SfxMedium& rMedium );
bool InsertFrom(SfxMedium &rMedium);
virtual bool HasPrintOptionsPage() const;
virtual SfxTabPage *CreatePrintOptionsPage(Window *pParent,
const SfxItemSet &rOptions);
virtual void Deactivate(sal_Bool IsMDIActivate);

View File

@@ -1381,6 +1381,10 @@ sal_uInt16 SmViewShell::SetPrinter(SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlag
return 0;
}
bool SmViewShell::HasPrintOptionsPage() const
{
return true;
}
SfxTabPage* SmViewShell::CreatePrintOptionsPage(Window *pParent,
const SfxItemSet &rOptions)

View File

@@ -211,7 +211,8 @@ class SW_DLLPUBLIC SwPagePreView: public SfxViewShell
SW_DLLPRIVATE virtual SfxPrinter* GetPrinter( sal_Bool bCreate = sal_False );
SW_DLLPRIVATE virtual sal_uInt16 SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false );
SW_DLLPRIVATE virtual sal_uInt16 SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false );
SW_DLLPRIVATE virtual bool HasPrintOptionsPage() const;
SW_DLLPRIVATE virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent,
const SfxItemSet &rOptions );

View File

@@ -329,13 +329,14 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
SW_DLLPRIVATE void SpellEnd( SwConversionArgs *pConvArgs = 0 );
SW_DLLPRIVATE void HyphStart( SvxSpellArea eSpell );
SW_DLLPRIVATE sal_Bool CheckSpecialCntnt();
SW_DLLPRIVATE sal_Bool CheckSpecialCntnt();
SW_DLLPRIVATE void SpellKontext(sal_Bool bOn = sal_True)
{ bCenterCrsr = bOn; bAllwaysShowSel = bOn; }
// methods for printing
SW_DLLPRIVATE virtual SfxPrinter* GetPrinter( sal_Bool bCreate = sal_False );
SfxTabPage* CreatePrintOptionsPage( Window* pParent,
SW_DLLPRIVATE virtual bool HasPrintOptionsPage() const;
SW_DLLPRIVATE virtual SfxTabPage* CreatePrintOptionsPage( Window* pParent,
const SfxItemSet& rSet);
// for readonly switching
SW_DLLPRIVATE virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );

View File

@@ -1759,6 +1759,11 @@ sal_uInt16 SwPagePreView::SetPrinter( SfxPrinter *pNew, sal_uInt16 nDiffFlags,
return 0;
}
bool SwPagePreView::HasPrintOptionsPage() const
{
return true;
}
SfxTabPage* SwPagePreView::CreatePrintOptionsPage( Window *pParent,
const SfxItemSet &rOptions )
{

View File

@@ -141,6 +141,11 @@ sal_uInt16 SwView::SetPrinter(SfxPrinter* pNew, sal_uInt16 nDiffFlags, bool )
return 0;
}
bool SwView::HasPrintOptionsPage() const
{
return true;
}
/*--------------------------------------------------------------------
Beschreibung: TabPage fuer applikationsspezifische Druckoptionen
--------------------------------------------------------------------*/