[Libreoffice-commits] .: sc/source sd/source sfx2/inc sfx2/source starmath/inc starmath/source sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Dec 7 01:32:39 PST 2012


 sc/source/ui/inc/prevwsh.hxx        |    3 ++-
 sc/source/ui/inc/tabvwsh.hxx        |    1 +
 sc/source/ui/view/prevwsh.cxx       |    5 +++++
 sc/source/ui/view/tabvwsh4.cxx      |    5 +++++
 sd/source/ui/inc/ViewShellBase.hxx  |    5 -----
 sd/source/ui/view/ViewShellBase.cxx |   12 ------------
 sfx2/inc/sfx2/viewsh.hxx            |    3 ++-
 sfx2/source/view/viewprn.cxx        |    7 ++++++-
 starmath/inc/view.hxx               |    1 +
 starmath/source/view.cxx            |    4 ++++
 sw/source/ui/inc/pview.hxx          |    3 ++-
 sw/source/ui/inc/view.hxx           |    5 +++--
 sw/source/ui/uiview/pview.cxx       |    5 +++++
 sw/source/ui/uiview/viewprt.cxx     |    5 +++++
 14 files changed, 41 insertions(+), 23 deletions(-)

New commits:
commit d1660f19d5c8c60d8549b594a36d13a5edcf15a3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 6 21:05:57 2012 +0000

    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

diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx
index 60d0872..7530478 100644
--- a/sc/source/ui/inc/prevwsh.hxx
+++ b/sc/source/ui/inc/prevwsh.hxx
@@ -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 );
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 54606fa..d1e53ad 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -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 );
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index 505544e..37e0e86 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -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();
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 799f953..d154b01 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -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();
diff --git a/sd/source/ui/inc/ViewShellBase.hxx b/sd/source/ui/inc/ViewShellBase.hxx
index 9377c83..458896a 100644
--- a/sd/source/ui/inc/ViewShellBase.hxx
+++ b/sd/source/ui/inc/ViewShellBase.hxx
@@ -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 <
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index d732280..0cd5c67 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -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);
diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx
index da8bd20..b7110a6 100644
--- a/sfx2/inc/sfx2/viewsh.hxx
+++ b/sfx2/inc/sfx2/viewsh.hxx
@@ -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;
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 2139008..7b978d3 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -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();
diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx
index f508cf5..cdfb614 100644
--- a/starmath/inc/view.hxx
+++ b/starmath/inc/view.hxx
@@ -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);
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 2c12b3c..f2713f5 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -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)
diff --git a/sw/source/ui/inc/pview.hxx b/sw/source/ui/inc/pview.hxx
index 25d9050..68446c4 100644
--- a/sw/source/ui/inc/pview.hxx
+++ b/sw/source/ui/inc/pview.hxx
@@ -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 );
 
diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx
index ff93acf..473f9c6 100644
--- a/sw/source/ui/inc/view.hxx
+++ b/sw/source/ui/inc/view.hxx
@@ -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 );
diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx
index e064a00..6d0bb70 100644
--- a/sw/source/ui/uiview/pview.cxx
+++ b/sw/source/ui/uiview/pview.cxx
@@ -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 )
 {
diff --git a/sw/source/ui/uiview/viewprt.cxx b/sw/source/ui/uiview/viewprt.cxx
index a98df93..6914319 100644
--- a/sw/source/ui/uiview/viewprt.cxx
+++ b/sw/source/ui/uiview/viewprt.cxx
@@ -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
  --------------------------------------------------------------------*/


More information about the Libreoffice-commits mailing list