Skip to content

Commit

Permalink
Bug 1653334 part 1: Remove unused isRangeSelection and isIFrameSelect…
Browse files Browse the repository at this point in the history
…ed. r=jwatt

These unused members are removed from nsIWebBrowserPrint and PPrintingTypes
along with their supporting functions.

Differential Revision: https://phabricator.services.mozilla.com/D85007
  • Loading branch information
bobowen committed Aug 3, 2020
1 parent 8147272 commit d5715ce
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 58 deletions.
18 changes: 0 additions & 18 deletions layout/base/nsDocumentViewer.cpp
Expand Up @@ -3432,24 +3432,6 @@ nsDocumentViewer::GetPrintPreviewNumPages(int32_t* aPrintPreviewNumPages) {
return *aPrintPreviewNumPages > 0 ? NS_OK : NS_ERROR_FAILURE;
}

NS_IMETHODIMP
nsDocumentViewer::GetIsIFrameSelected(bool* aIsIFrameSelected) {
*aIsIFrameSelected = false;
NS_ENSURE_TRUE(mPrintJob, NS_ERROR_FAILURE);

*aIsIFrameSelected = mPrintJob->IsIFrameSelected();
return NS_OK;
}

NS_IMETHODIMP
nsDocumentViewer::GetIsRangeSelection(bool* aIsRangeSelection) {
*aIsRangeSelection = false;
NS_ENSURE_TRUE(mPrintJob, NS_ERROR_FAILURE);

*aIsRangeSelection = mPrintJob->IsRangeSelection();
return NS_OK;
}

//----------------------------------------------------------------------------------
// Printing/Print Preview Helpers
//----------------------------------------------------------------------------------
Expand Down
23 changes: 0 additions & 23 deletions layout/printing/nsPrintJob.cpp
Expand Up @@ -997,29 +997,6 @@ nsresult nsPrintJob::PrintPreview(
return CommonPrint(true, aPrintSettings, aWebProgressListener, aSourceDoc);
}

//----------------------------------------------------------------------------------
bool nsPrintJob::IsIFrameSelected() {
// Get the docshell for this documentviewer
nsCOMPtr<nsIDocShell> docShell(do_QueryReferent(mDocShell));
// Get the currently focused window
nsCOMPtr<nsPIDOMWindowOuter> currentFocusWin = FindFocusedDOMWindow();
if (currentFocusWin && docShell) {
// Get whether the doc contains a frameset
// Also, check to see if the currently focus docshell
// is a child of this docshell
bool isParentFrameSet;
return IsThereAnIFrameSelected(docShell, currentFocusWin, isParentFrameSet);
}
return false;
}

//----------------------------------------------------------------------------------
bool nsPrintJob::IsRangeSelection() {
// Get the currently focused window
nsCOMPtr<nsPIDOMWindowOuter> currentFocusWin = FindFocusedDOMWindow();
return IsThereARangeSelection(currentFocusWin);
}

//----------------------------------------------------------------------------------
int32_t nsPrintJob::GetPrintPreviewNumPages() {
// When calling this function, the FinishPrintPreview() function might not
Expand Down
3 changes: 0 additions & 3 deletions layout/printing/nsPrintJob.h
Expand Up @@ -119,8 +119,6 @@ class nsPrintJob final : public nsIObserver,
bool IsDoingPrint() const { return mIsDoingPrinting; }
bool IsDoingPrintPreview() const { return mIsDoingPrintPreview; }
bool HasEverPrinted() const { return mHasEverPrinted; }
bool IsIFrameSelected();
bool IsRangeSelection();
/// If the returned value is not greater than zero, an error occurred.
int32_t GetPrintPreviewNumPages();
already_AddRefed<nsIPrintSettings> GetCurrentPrintSettings();
Expand Down Expand Up @@ -299,7 +297,6 @@ class nsPrintJob final : public nsIObserver,
bool mIsDestroying = false;
bool mDisallowSelectionPrint = false;
bool mIsForModalWindow = false;
bool mHasMozPrintCallback = false;
};

#endif // nsPrintJob_h
10 changes: 0 additions & 10 deletions toolkit/components/browser/nsIWebBrowserPrint.idl
Expand Up @@ -45,16 +45,6 @@ interface nsIWebBrowserPrint : nsISupports
*/
readonly attribute boolean doingPrintPreview;

/**
* This returns whether there is an IFrame selected
*/
readonly attribute boolean isIFrameSelected;

/**
* This returns whether there is a "range" selection
*/
readonly attribute boolean isRangeSelection;

/**
* This returns the total number of pages for the Print Preview
*/
Expand Down
2 changes: 0 additions & 2 deletions toolkit/components/printingui/ipc/PPrintingTypes.ipdlh
Expand Up @@ -72,8 +72,6 @@ struct PrintData {
nsString deviceName;
double printableWidthInInches;
double printableHeightInInches;
bool isIFrameSelected;
bool isRangeSelection;
uint8_t[] devModeData;

/**
Expand Down
2 changes: 0 additions & 2 deletions widget/nsPrintSettingsService.cpp
Expand Up @@ -166,8 +166,6 @@ nsPrintSettingsService::SerializeToPrintData(nsIPrintSettings* aSettings,
// data->deviceName() default-initializes
data->printableWidthInInches() = 0;
data->printableHeightInInches() = 0;
data->isIFrameSelected() = false;
data->isRangeSelection() = false;
// data->GTKPrintSettings() default-initializes
// data->printJobName() default-initializes
data->printAllPages() = true;
Expand Down

0 comments on commit d5715ce

Please sign in to comment.