Bug 321433 - Don't enable selection for printing. r+sr=roc.
git-svn-id: svn://10.0.0.236/trunk@189285 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
b588088110
commit
6e15d1b177
@ -1736,7 +1736,11 @@ PresShell::Init(nsIDocument* aDocument,
|
||||
//SetCaretEnabled(PR_TRUE); // make it show in browser windows
|
||||
#endif
|
||||
//set up selection to be displayed in document
|
||||
SetDisplaySelection(nsISelectionController::SELECTION_DISABLED);
|
||||
// Don't enable selection for print media
|
||||
nsPresContext::nsPresContextType type = aPresContext->Type();
|
||||
if (type != nsPresContext::eContext_PrintPreview &&
|
||||
type != nsPresContext::eContext_Print)
|
||||
SetDisplaySelection(nsISelectionController::SELECTION_DISABLED);
|
||||
|
||||
if (gMaxRCProcessingTime == -1) {
|
||||
gMaxRCProcessingTime =
|
||||
|
||||
@ -2599,15 +2599,15 @@ nsresult nsTextFrame::GetTextInfoForPainting(nsPresContext* aPresConte
|
||||
if (NS_FAILED(rv) || !(*aSelectionController))
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
aIsPaginated = aPresContext->IsPaginated();
|
||||
|
||||
(*aSelectionController)->GetDisplaySelection(&aSelectionValue);
|
||||
|
||||
if (aIsPaginated) {
|
||||
aDisplayingSelection = aPresContext->IsRenderingOnlySelection();
|
||||
if (aPresContext->IsRenderingOnlySelection()) {
|
||||
aIsPaginated = PR_TRUE;
|
||||
aDisplayingSelection = PR_TRUE;
|
||||
} else {
|
||||
//if greater than hidden then we display some kind of selection
|
||||
aDisplayingSelection = (aSelectionValue > nsISelectionController::SELECTION_HIDDEN);
|
||||
aIsPaginated = PR_FALSE;
|
||||
aDisplayingSelection =
|
||||
(aSelectionValue > nsISelectionController::SELECTION_HIDDEN);
|
||||
}
|
||||
|
||||
PRInt16 textSel=0;
|
||||
|
||||
@ -2602,10 +2602,6 @@ nsPrintEngine::ReflowPrintObject(nsPrintObject * aPO, PRBool aDoCalcShrink)
|
||||
return rv;
|
||||
}
|
||||
|
||||
// Don't paint selection stuff for images while printing.
|
||||
// XXXbz should we be painting it for text, even?
|
||||
aPO->mPresShell->SetSelectionFlags(nsISelectionDisplay::DISPLAY_TEXT);
|
||||
|
||||
aPO->mStyleSet->EndUpdate();
|
||||
|
||||
// The pres shell now owns the style set object.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user