зеркало из https://github.com/mozilla/gecko-dev.git
Bug 770580 part 1 - Clarify Selection::selectFrames parameter; r=ehsan
This commit is contained in:
Родитель
84043538aa
Коммит
7698ba77ed
|
@ -3981,12 +3981,12 @@ Selection::SelectAllFramesForContent(nsIContentIterator* aInnerIter,
|
|||
}
|
||||
|
||||
/**
|
||||
* The idea of this helper method is to select, deselect "top to bottom"
|
||||
* The idea of this helper method is to select or deselect "top to bottom",
|
||||
* traversing through the frames
|
||||
*/
|
||||
nsresult
|
||||
Selection::selectFrames(nsPresContext* aPresContext, nsRange* aRange,
|
||||
bool aFlags)
|
||||
bool aSelect)
|
||||
{
|
||||
if (!mFrameSelection || !aPresContext || !aPresContext->GetPresShell()) {
|
||||
// nothing to do
|
||||
|
@ -4025,7 +4025,7 @@ Selection::selectFrames(nsPresContext* aPresContext, nsRange* aRange,
|
|||
} else {
|
||||
endOffset = content->Length();
|
||||
}
|
||||
textFrame->SetSelectedRange(startOffset, endOffset, aFlags, mType);
|
||||
textFrame->SetSelectedRange(startOffset, endOffset, aSelect, mType);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4033,7 +4033,7 @@ Selection::selectFrames(nsPresContext* aPresContext, nsRange* aRange,
|
|||
nsCOMPtr<nsIContentIterator> inneriter = NS_NewContentIterator();
|
||||
for (iter->First(); !iter->IsDone(); iter->Next()) {
|
||||
content = do_QueryInterface(iter->GetCurrentNode());
|
||||
SelectAllFramesForContent(inneriter, content, aFlags);
|
||||
SelectAllFramesForContent(inneriter, content, aSelect);
|
||||
}
|
||||
|
||||
// We must now do the last one if it is not the same as the first
|
||||
|
@ -4048,7 +4048,7 @@ Selection::selectFrames(nsPresContext* aPresContext, nsRange* aRange,
|
|||
// The frame could be an SVG text frame, in which case we'll ignore it.
|
||||
if (frame && frame->GetType() == nsGkAtoms::textFrame) {
|
||||
nsTextFrame* textFrame = static_cast<nsTextFrame*>(frame);
|
||||
textFrame->SetSelectedRange(0, aRange->EndOffset(), aFlags, mType);
|
||||
textFrame->SetSelectedRange(0, aRange->EndOffset(), aSelect, mType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче