зеркало из https://github.com/mozilla/pjs.git
Partial back of check to look for bloat
This commit is contained in:
Родитель
607d234df7
Коммит
69e5a9f10c
|
@ -554,6 +554,13 @@ public:
|
|||
extern NS_EXPORT nsresult
|
||||
NS_NewGalleyContext(nsIPresContext** aInstancePtrResult);
|
||||
|
||||
// Factory method to create a "paginated" presentation context for
|
||||
// the screen.
|
||||
extern NS_EXPORT nsresult
|
||||
NS_NewPrintPreviewContext(nsIPresContext** aInstancePtrResult);
|
||||
|
||||
|
||||
|
||||
#ifdef MOZ_REFLOW_PERF
|
||||
|
||||
#define DO_GLOBAL_REFLOW_COUNT(_name, _type) \
|
||||
|
|
|
@ -178,7 +178,6 @@
|
|||
static NS_DEFINE_CID(kCSSStyleSheetCID, NS_CSS_STYLESHEET_CID);
|
||||
static NS_DEFINE_CID(kStyleSetCID, NS_STYLESET_CID);
|
||||
static NS_DEFINE_IID(kRangeCID, NS_RANGE_CID);
|
||||
static NS_DEFINE_CID(kPrintPreviewContextCID, NS_PRINT_PREVIEW_CONTEXT_CID);
|
||||
|
||||
// supporting bugs 31816, 20760, 22963
|
||||
// define USE_OVERRIDE to put prefs in as an override stylesheet
|
||||
|
@ -7004,10 +7003,7 @@ PresShell::VerifyIncrementalReflow()
|
|||
PRBool isPaginated = PR_FALSE;
|
||||
mPresContext->IsPaginated(&isPaginated);
|
||||
if (isPaginated) {
|
||||
nsCOMPtr<nsIPrintPreviewContext> ppx = do_CreateInstance(kPrintPreviewContextCID, &rv);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
ppx->QueryInterface(NS_GET_IID(nsIPresContext),(void**)&cx);
|
||||
}
|
||||
rv = NS_NewPrintPreviewContext(&cx);
|
||||
}
|
||||
else {
|
||||
rv = NS_NewGalleyContext(&cx);
|
||||
|
|
|
@ -554,6 +554,13 @@ public:
|
|||
extern NS_EXPORT nsresult
|
||||
NS_NewGalleyContext(nsIPresContext** aInstancePtrResult);
|
||||
|
||||
// Factory method to create a "paginated" presentation context for
|
||||
// the screen.
|
||||
extern NS_EXPORT nsresult
|
||||
NS_NewPrintPreviewContext(nsIPresContext** aInstancePtrResult);
|
||||
|
||||
|
||||
|
||||
#ifdef MOZ_REFLOW_PERF
|
||||
|
||||
#define DO_GLOBAL_REFLOW_COUNT(_name, _type) \
|
||||
|
|
|
@ -554,6 +554,13 @@ public:
|
|||
extern NS_EXPORT nsresult
|
||||
NS_NewGalleyContext(nsIPresContext** aInstancePtrResult);
|
||||
|
||||
// Factory method to create a "paginated" presentation context for
|
||||
// the screen.
|
||||
extern NS_EXPORT nsresult
|
||||
NS_NewPrintPreviewContext(nsIPresContext** aInstancePtrResult);
|
||||
|
||||
|
||||
|
||||
#ifdef MOZ_REFLOW_PERF
|
||||
|
||||
#define DO_GLOBAL_REFLOW_COUNT(_name, _type) \
|
||||
|
|
|
@ -43,9 +43,14 @@
|
|||
#include "nsGfxCIID.h"
|
||||
#include "nsLayoutAtoms.h"
|
||||
#include "prlog.h"
|
||||
#include "nsIPrintSettings.h"
|
||||
|
||||
class PrintPreviewContext : public nsPresContext, nsIPrintPreviewContext {
|
||||
// Print Options
|
||||
#include "nsIPrintOptions.h"
|
||||
#include "nsGfxCIID.h"
|
||||
#include "nsIServiceManager.h"
|
||||
static NS_DEFINE_CID(kPrintOptionsCID, NS_PRINTOPTIONS_CID);
|
||||
|
||||
class PrintPreviewContext : public nsPresContext {
|
||||
public:
|
||||
PrintPreviewContext();
|
||||
~PrintPreviewContext();
|
||||
|
@ -61,13 +66,10 @@ public:
|
|||
NS_IMETHOD GetPaginatedScrolling(PRBool* aResult);
|
||||
NS_IMETHOD GetPageDim(nsRect* aActualRect, nsRect* aAdjRect);
|
||||
NS_IMETHOD SetPageDim(nsRect* aRect);
|
||||
NS_IMETHOD SetPrintSettings(nsIPrintSettings* aPS);
|
||||
NS_IMETHOD GetPrintSettings(nsIPrintSettings** aPS);
|
||||
|
||||
protected:
|
||||
nsRect mPageDim;
|
||||
PRBool mCanPaginatedScroll;
|
||||
nsCOMPtr<nsIPrintSettings> mPrintSettings;
|
||||
};
|
||||
|
||||
PrintPreviewContext::PrintPreviewContext() :
|
||||
|
@ -145,27 +147,8 @@ PrintPreviewContext::SetPageDim(nsRect* aPageDim)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PrintPreviewContext::SetPrintSettings(nsIPrintSettings * aPrintSettings)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aPrintSettings);
|
||||
mPrintSettings = aPrintSettings;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PrintPreviewContext::GetPrintSettings(nsIPrintSettings * *aPrintSettings)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aPrintSettings);
|
||||
|
||||
*aPrintSettings = mPrintSettings;
|
||||
NS_IF_ADDREF(*aPrintSettings);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_EXPORT nsresult
|
||||
NS_NewPrintPreviewContext(nsIPrintPreviewContext** aInstancePtrResult)
|
||||
NS_NewPrintPreviewContext(nsIPresContext** aInstancePtrResult)
|
||||
{
|
||||
if (aInstancePtrResult == nsnull) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
@ -177,5 +160,5 @@ NS_NewPrintPreviewContext(nsIPrintPreviewContext** aInstancePtrResult)
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return it->QueryInterface(NS_GET_IID(nsIPrintPreviewContext), (void **) aInstancePtrResult);
|
||||
return it->QueryInterface(NS_GET_IID(nsIPresContext), (void **) aInstancePtrResult);
|
||||
}
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
#include "nsIPresShell.h"
|
||||
#include "nsIPrintContext.h"
|
||||
#include "nsIPresContext.h"
|
||||
#include "nsIPrintPreviewContext.h"
|
||||
#include "nsIStyleSet.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsHTMLParts.h"
|
||||
|
@ -53,10 +52,9 @@ void XXXNeverCalled()
|
|||
nsIPresShell* ps;
|
||||
NS_NewPresShell(&ps);
|
||||
nsIPresContext* cx;
|
||||
NS_NewGalleyContext(&cx);
|
||||
nsIPrintPreviewContext *ppx;
|
||||
NS_NewPrintPreviewContext(&ppx);
|
||||
nsIPrintContext *px;
|
||||
NS_NewGalleyContext(&cx);
|
||||
NS_NewPrintPreviewContext(&cx);
|
||||
NS_NewPrintContext(&px);
|
||||
nsIFrame* f;
|
||||
NS_NewTextFrame(ps, &f);
|
||||
|
|
|
@ -126,10 +126,6 @@
|
|||
#define NS_PRINTCONTEXT_CID \
|
||||
{ 0xa1fde85f, 0xe802, 0x11d4, { 0x98, 0x85, 0x0, 0xc0, 0x4f, 0xa0, 0xcf, 0x4b } }
|
||||
|
||||
// {A1FDE85F-E802-11d4-9885-00C04FA0CF4B}
|
||||
#define NS_PRINTPREVIEWCONTEXT_CID \
|
||||
{ 0xdfd92dd, 0x19ff, 0x4e62, { 0x83, 0x16, 0x8e, 0x44, 0x3, 0x1a, 0x19, 0x62 } }
|
||||
|
||||
// {95F46161-D177-11d2-BF86-00105A1B0627}
|
||||
#define NS_HTML_CSS_STYLESHEET_CID \
|
||||
{ 0x95f46161, 0xd177, 0x11d2, { 0xbf, 0x86, 0x0, 0x10, 0x5a, 0x1b, 0x6, 0x27 } }
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
#include "nsIPresShell.h"
|
||||
#include "nsIPresState.h"
|
||||
#include "nsIPrintContext.h"
|
||||
#include "nsIPrintPreviewContext.h"
|
||||
#include "nsTextTransformer.h"
|
||||
|
||||
#include "nsXBLAtoms.h" // to addref/release table
|
||||
|
@ -210,6 +209,7 @@ MAKE_CTOR(CreateNewFrameUtil, nsIFrameUtil, NS_NewFrameUtil)
|
|||
MAKE_CTOR(CreateNewLayoutDebugger, nsILayoutDebugger, NS_NewLayoutDebugger)
|
||||
#endif
|
||||
|
||||
MAKE_CTOR(CreateNewPrintPreviewContext, nsIPresContext, NS_NewPrintPreviewContext)
|
||||
MAKE_CTOR(CreateNewCSSFrameConstructor, nsICSSFrameConstructor, NS_CreateCSSFrameConstructor)
|
||||
MAKE_CTOR(CreateNewFrameTraversal, nsIFrameTraversal, NS_CreateFrameTraversal)
|
||||
MAKE_CTOR(CreateNewLayoutHistoryState, nsILayoutHistoryState, NS_NewLayoutHistoryState)
|
||||
|
@ -217,7 +217,6 @@ MAKE_CTOR(CreateNewPresShell, nsIPresShell, NS_NewPresShell)
|
|||
MAKE_CTOR(CreateNewPresState, nsIPresState, NS_NewPresState)
|
||||
MAKE_CTOR(CreateNewGalleyContext, nsIPresContext, NS_NewGalleyContext)
|
||||
MAKE_CTOR(CreateNewPrintContext, nsIPrintContext, NS_NewPrintContext)
|
||||
MAKE_CTOR(CreateNewPrintPreviewContext, nsIPrintPreviewContext, NS_NewPrintPreviewContext)
|
||||
MAKE_CTOR(CreateNewBoxObject, nsIBoxObject, NS_NewBoxObject)
|
||||
MAKE_CTOR(CreateNewTreeBoxObject, nsIBoxObject, NS_NewTreeBoxObject)
|
||||
MAKE_CTOR(CreateNewMenuBoxObject, nsIBoxObject, NS_NewMenuBoxObject)
|
||||
|
@ -283,11 +282,6 @@ static nsModuleComponentInfo gComponents[] = {
|
|||
NS_PRINTCONTEXT_CID,
|
||||
nsnull,
|
||||
CreateNewPrintContext },
|
||||
|
||||
{ "Print Preview context",
|
||||
NS_PRINTPREVIEWCONTEXT_CID,
|
||||
nsnull,
|
||||
CreateNewPrintPreviewContext },
|
||||
// XXX end ick
|
||||
|
||||
{ "XUL Box Object",
|
||||
|
|
|
@ -178,7 +178,6 @@
|
|||
static NS_DEFINE_CID(kCSSStyleSheetCID, NS_CSS_STYLESHEET_CID);
|
||||
static NS_DEFINE_CID(kStyleSetCID, NS_STYLESET_CID);
|
||||
static NS_DEFINE_IID(kRangeCID, NS_RANGE_CID);
|
||||
static NS_DEFINE_CID(kPrintPreviewContextCID, NS_PRINT_PREVIEW_CONTEXT_CID);
|
||||
|
||||
// supporting bugs 31816, 20760, 22963
|
||||
// define USE_OVERRIDE to put prefs in as an override stylesheet
|
||||
|
@ -7004,10 +7003,7 @@ PresShell::VerifyIncrementalReflow()
|
|||
PRBool isPaginated = PR_FALSE;
|
||||
mPresContext->IsPaginated(&isPaginated);
|
||||
if (isPaginated) {
|
||||
nsCOMPtr<nsIPrintPreviewContext> ppx = do_CreateInstance(kPrintPreviewContextCID, &rv);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
ppx->QueryInterface(NS_GET_IID(nsIPresContext),(void**)&cx);
|
||||
}
|
||||
rv = NS_NewPrintPreviewContext(&cx);
|
||||
}
|
||||
else {
|
||||
rv = NS_NewGalleyContext(&cx);
|
||||
|
|
Загрузка…
Ссылка в новой задаче