Bug 1313525 - Remove the nsIPrintOptions interface. r=mstange
authorJonathan Watt <jwatt@jwatt.org>
Fri, 28 Oct 2016 00:31:14 +0100
changeset 321913 fba4215e5201bb4028be3b9e93dbbeae767f6ad4
parent 321912 986861e6c5ce12b224d94c3de0b8af6df25a01a4
child 321914 b3d68ce32250fbaeb3ce452fb7e40746cee6d431
push id30937
push usercbook@mozilla.com
push dateThu, 10 Nov 2016 16:00:02 +0000
treeherdermozilla-central@d38d06f85ef5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1313525
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1313525 - Remove the nsIPrintOptions interface. r=mstange
embedding/components/printingui/ipc/PrintDataUtils.cpp
embedding/components/printingui/win/nsPrintDialogUtil.cpp
layout/generic/nsSimplePageSequenceFrame.cpp
layout/generic/nsSimplePageSequenceFrame.h
layout/printing/nsPrintData.h
layout/printing/nsPrintEngine.cpp
widget/cocoa/nsDeviceContextSpecX.mm
widget/gtk/nsDeviceContextSpecG.h
widget/moz.build
widget/nsIPrintOptions.idl
widget/nsIPrinterEnumerator.idl
widget/nsPrintOptionsImpl.cpp
widget/nsPrintOptionsImpl.h
widget/windows/nsDeviceContextSpecWin.h
--- a/embedding/components/printingui/ipc/PrintDataUtils.cpp
+++ b/embedding/components/printingui/ipc/PrintDataUtils.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* vim: set sw=4 ts=8 et tw=80 : */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "PrintDataUtils.h"
-#include "nsIPrintOptions.h"
 #include "nsIPrintSettings.h"
 #include "nsIServiceManager.h"
 #include "nsIWebBrowserPrint.h"
 #include "nsXPIDLString.h"
 
 namespace mozilla {
 namespace embedding {
 
--- a/embedding/components/printingui/win/nsPrintDialogUtil.cpp
+++ b/embedding/components/printingui/win/nsPrintDialogUtil.cpp
@@ -28,17 +28,17 @@ WIN_LIBS=                               
 #include <commdlg.h>
 
 #include "nsIWebBrowserPrint.h"
 #include "nsString.h"
 #include "nsIServiceManager.h"
 #include "nsReadableUtils.h"
 #include "nsIPrintSettings.h"
 #include "nsIPrintSettingsWin.h"
-#include "nsIPrintOptions.h"
+#include "nsIPrinterEnumerator.h"
 
 #include "nsRect.h"
 
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 
 #include "nsCRT.h"
 #include "prenv.h" /* for PR_GetEnv */
--- a/layout/generic/nsSimplePageSequenceFrame.cpp
+++ b/layout/generic/nsSimplePageSequenceFrame.cpp
@@ -23,26 +23,19 @@
 #include "mozilla/dom/HTMLCanvasElement.h"
 #include "nsICanvasRenderingContextInternal.h"
 #include "nsIDateTimeFormat.h"
 #include "nsServiceManagerUtils.h"
 #include <algorithm>
 
 #define OFFSET_NOT_SET -1
 
-// Print Options
-#include "nsIPrintOptions.h"
-
 using namespace mozilla;
 using namespace mozilla::dom;
 
-static const char sPrintOptionsContractID[] = "@mozilla.org/gfx/printsettings-service;1";
-
-//
-
 #include "mozilla/Logging.h"
 mozilla::LazyLogModule gLayoutPrintingLog("printing-layout");
 
 #define PR_PL(_p1)  MOZ_LOG(gLayoutPrintingLog, mozilla::LogLevel::Debug, _p1)
 
 nsSimplePageSequenceFrame*
 NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
@@ -64,19 +57,16 @@ nsSimplePageSequenceFrame::nsSimplePageS
 
   // XXX Unsafe to assume successful allocation
   mPageData = new nsSharedPageData();
   mPageData->mHeadFootFont =
     *PresContext()->GetDefaultFont(kGenericFont_serif,
                                    aContext->StyleFont()->mLanguage);
   mPageData->mHeadFootFont.size = nsPresContext::CSSPointsToAppUnits(10);
 
-  nsresult rv;
-  mPageData->mPrintOptions = do_GetService(sPrintOptionsContractID, &rv);
-
   // Doing this here so we only have to go get these formats once
   SetPageNumberFormat("pagenumber",  "%1$d", true);
   SetPageNumberFormat("pageofpages", "%1$d of %2$d", false);
 }
 
 nsSimplePageSequenceFrame::~nsSimplePageSequenceFrame()
 {
   delete mPageData;
--- a/layout/generic/nsSimplePageSequenceFrame.h
+++ b/layout/generic/nsSimplePageSequenceFrame.h
@@ -4,17 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef nsSimplePageSequenceFrame_h___
 #define nsSimplePageSequenceFrame_h___
 
 #include "mozilla/Attributes.h"
 #include "nsIPageSequenceFrame.h"
 #include "nsContainerFrame.h"
 #include "nsIPrintSettings.h"
-#include "nsIPrintOptions.h"
 
 class nsIDateTimeFormat;
 
 namespace mozilla {
 namespace dom {
 
 class HTMLCanvasElement;
 
@@ -41,17 +40,16 @@ public:
   nsSize      mReflowSize;
   nsMargin    mReflowMargin;
   // Margin for headers and footers; it defaults to 4/100 of an inch on UNIX 
   // and 0 elsewhere; I think it has to do with some inconsistency in page size
   // computations
   nsMargin    mEdgePaperMargin;
 
   nsCOMPtr<nsIPrintSettings> mPrintSettings;
-  nsCOMPtr<nsIPrintOptions> mPrintOptions;
 
   // The scaling ratio we need to apply to make all pages fit horizontally.  It's
   // the minimum "ComputedWidth / OverflowWidth" ratio of all page content frames
   // that overflowed.  It's 1.0 if none overflowed horizontally.
   float mShrinkToFitRatio;
 };
 
 // Simple page sequence frame class. Used when we're in paginated mode
--- a/layout/printing/nsPrintData.h
+++ b/layout/printing/nsPrintData.h
@@ -6,17 +6,17 @@
 #ifndef nsPrintData_h___
 #define nsPrintData_h___
 
 #include "mozilla/Attributes.h"
 
 // Interfaces
 #include "nsDeviceContext.h"
 #include "nsIPrintProgressParams.h"
-#include "nsIPrintOptions.h"
+#include "nsIPrintSettings.h"
 #include "nsTArray.h"
 #include "nsCOMArray.h"
 
 // Classes
 class nsPrintObject;
 class nsPrintPreviewListener;
 class nsIWebProgressListener;
 
--- a/layout/printing/nsPrintEngine.cpp
+++ b/layout/printing/nsPrintEngine.cpp
@@ -21,17 +21,16 @@
 #include "nsError.h"
 
 #include "nsView.h"
 #include <algorithm>
 
 // Print Options
 #include "nsIPrintSettings.h"
 #include "nsIPrintSettingsService.h"
-#include "nsIPrintOptions.h"
 #include "nsIPrintSession.h"
 #include "nsGfxCIID.h"
 #include "nsIServiceManager.h"
 #include "nsGkAtoms.h"
 #include "nsXPCOM.h"
 #include "nsISupportsPrimitives.h"
 
 static const char sPrintSettingsServiceContractID[] = "@mozilla.org/gfx/printsettings-service;1";
--- a/widget/cocoa/nsDeviceContextSpecX.mm
+++ b/widget/cocoa/nsDeviceContextSpecX.mm
@@ -7,17 +7,16 @@
 
 #include "mozilla/gfx/PrintTargetCG.h"
 #include "mozilla/RefPtr.h"
 #include "nsCRT.h"
 #include <unistd.h>
 
 #include "nsQueryObject.h"
 #include "nsIServiceManager.h"
-#include "nsIPrintOptions.h"
 #include "nsPrintSettingsX.h"
 
 // This must be the last include:
 #include "nsObjCExceptions.h"
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 
--- a/widget/gtk/nsDeviceContextSpecG.h
+++ b/widget/gtk/nsDeviceContextSpecG.h
@@ -3,17 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsDeviceContextSpecGTK_h___
 #define nsDeviceContextSpecGTK_h___
 
 #include "nsIDeviceContextSpec.h"
 #include "nsIPrintSettings.h"
-#include "nsIPrintOptions.h" 
+#include "nsIPrinterEnumerator.h"
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "mozilla/Attributes.h"
 
 #include "nsCRT.h" /* should be <limits.h>? */
 
 #include <gtk/gtk.h>
 #include <gtk/gtkunixprint.h>
--- a/widget/moz.build
+++ b/widget/moz.build
@@ -70,17 +70,17 @@ XPIDL_SOURCES += [
     'nsIDragService.idl',
     'nsIDragSession.idl',
     'nsIFilePicker.idl',
     'nsIFormatConverter.idl',
     'nsIGfxInfo.idl',
     'nsIGfxInfoDebug.idl',
     'nsIIdleService.idl',
     'nsIIdleServiceInternal.idl',
-    'nsIPrintOptions.idl',
+    'nsIPrinterEnumerator.idl',
     'nsIPrintSession.idl',
     'nsIPrintSettings.idl',
     'nsIPrintSettingsService.idl',
     'nsIScreen.idl',
     'nsIScreenManager.idl',
     'nsISound.idl',
     'nsITransferable.idl',
 ]
rename from widget/nsIPrintOptions.idl
rename to widget/nsIPrinterEnumerator.idl
--- a/widget/nsIPrintOptions.idl
+++ b/widget/nsIPrinterEnumerator.idl
@@ -3,29 +3,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 #include "nsIPrintSettings.idl"
 
 interface nsIStringEnumerator;
 
-/**
- * Print options interface
- *
- * Do not attempt to freeze this API - it still needs lots of work. Consult
- * John Keiser <jkeiser@netscape.com> and Roland Mainz
- * <roland.mainz@informatik.med.uni-giessen.de> for futher details.
- */
-[scriptable, uuid(2ac74034-700e-40fd-8059-81d33223af58)]
-
-interface nsIPrintOptions : nsISupports
-{
-};
-
 [scriptable, uuid(5e738fff-404c-4c94-9189-e8f2cce93e94)]
 
 interface nsIPrinterEnumerator : nsISupports
 {
   /**
    * The name of the system default printer. This name should also be
    * present in printerNameList below. This is not necessarily gecko's
    * default printer; see nsIPrintSettingsService.defaultPrinterName
--- a/widget/nsPrintOptionsImpl.cpp
+++ b/widget/nsPrintOptionsImpl.cpp
@@ -3,16 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsPrintOptionsImpl.h"
 
 #include "mozilla/embedding/PPrinting.h"
 #include "mozilla/layout/RemotePrintJobChild.h"
 #include "mozilla/RefPtr.h"
+#include "nsIPrinterEnumerator.h"
 #include "nsPrintingProxy.h"
 #include "nsReadableUtils.h"
 #include "nsPrintSettingsImpl.h"
 #include "nsIPrintSession.h"
 #include "nsServiceManagerUtils.h"
 
 #include "nsArray.h"
 #include "nsIDOMWindow.h"
@@ -29,17 +30,17 @@
 #include "nsPrintfCString.h"
 #include "nsIWebBrowserPrint.h"
 
 using namespace mozilla;
 using namespace mozilla::embedding;
 
 typedef mozilla::layout::RemotePrintJobChild RemotePrintJobChild;
 
-NS_IMPL_ISUPPORTS(nsPrintOptions, nsIPrintOptions, nsIPrintSettingsService)
+NS_IMPL_ISUPPORTS(nsPrintOptions, nsIPrintSettingsService)
 
 // Pref Constants
 static const char kMarginTop[]       = "print_margin_top";
 static const char kMarginLeft[]      = "print_margin_left";
 static const char kMarginBottom[]    = "print_margin_bottom";
 static const char kMarginRight[]     = "print_margin_right";
 static const char kEdgeTop[]         = "print_edge_top";
 static const char kEdgeLeft[]        = "print_edge_left";
--- a/widget/nsPrintOptionsImpl.h
+++ b/widget/nsPrintOptionsImpl.h
@@ -4,32 +4,29 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsPrintOptionsImpl_h__
 #define nsPrintOptionsImpl_h__
 
 #include "mozilla/embedding/PPrinting.h"
 #include "nsCOMPtr.h"
-#include "nsIPrintOptions.h"
 #include "nsIPrintSettingsService.h"
 #include "nsString.h"
 #include "nsFont.h"
 
 class nsIPrintSettings;
 
 /**
  *   Class nsPrintOptions
  */
-class nsPrintOptions : public nsIPrintOptions,
-                       public nsIPrintSettingsService
+class nsPrintOptions : public nsIPrintSettingsService
 {
 public:
   NS_DECL_ISUPPORTS
-  NS_DECL_NSIPRINTOPTIONS
   NS_DECL_NSIPRINTSETTINGSSERVICE
 
   /**
    * method Init
    *  Initializes member variables. Every consumer that does manual
    *  creation (instead of do_CreateInstance) needs to call this method
    *  immediately after instantiation.
    */
--- a/widget/windows/nsDeviceContextSpecWin.h
+++ b/widget/windows/nsDeviceContextSpecWin.h
@@ -3,17 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsDeviceContextSpecWin_h___
 #define nsDeviceContextSpecWin_h___
 
 #include "nsCOMPtr.h"
 #include "nsIDeviceContextSpec.h"
-#include "nsIPrintOptions.h" // For nsIPrinterEnumerator
+#include "nsIPrinterEnumerator.h"
 #include "nsIPrintSettings.h"
 #include "nsISupportsPrimitives.h"
 #include <windows.h>
 #include "mozilla/Attributes.h"
 #include "mozilla/RefPtr.h"
 
 class nsIWidget;