Added FindTextRunsFor method
This commit is contained in:
Родитель
2ec47f67fb
Коммит
f8d0cb680d
|
@ -23,6 +23,15 @@
|
|||
#include "nsIPresContext.h"
|
||||
#include "nsIFontMetrics.h"
|
||||
|
||||
nsTextRun::nsTextRun()
|
||||
{
|
||||
mNext = nsnull;
|
||||
}
|
||||
|
||||
nsTextRun::~nsTextRun()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
nsTextRun::List(FILE* out, PRInt32 aIndent)
|
||||
{
|
||||
|
@ -99,6 +108,32 @@ nsLineLayout::AddText(nsIFrame* aTextFrame)
|
|||
return NS_OK;/* XXX */
|
||||
}
|
||||
|
||||
nsTextRun*
|
||||
nsLineLayout::FindTextRunFor(nsIFrame* aFrame)
|
||||
{
|
||||
// Only the first-in-flows are present in the text run list so
|
||||
// backup from the argument frame to its first-in-flow.
|
||||
for (;;) {
|
||||
nsIFrame* prevInFlow;
|
||||
aFrame->GetPrevInFlow(prevInFlow);
|
||||
if (nsnull == prevInFlow) {
|
||||
break;
|
||||
}
|
||||
aFrame = prevInFlow;
|
||||
}
|
||||
|
||||
// Now look for the frame in each run
|
||||
nsTextRun* run = mReflowTextRuns;
|
||||
while (nsnull != run) {
|
||||
PRInt32 ix = run->mArray.IndexOf(aFrame);
|
||||
if (ix >= 0) {
|
||||
return run;
|
||||
}
|
||||
run = run->mNext;
|
||||
}
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
nsIFrame*
|
||||
nsLineLayout::FindNextText(nsIFrame* aFrame)
|
||||
{
|
||||
|
|
|
@ -23,6 +23,15 @@
|
|||
#include "nsIPresContext.h"
|
||||
#include "nsIFontMetrics.h"
|
||||
|
||||
nsTextRun::nsTextRun()
|
||||
{
|
||||
mNext = nsnull;
|
||||
}
|
||||
|
||||
nsTextRun::~nsTextRun()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
nsTextRun::List(FILE* out, PRInt32 aIndent)
|
||||
{
|
||||
|
@ -99,6 +108,32 @@ nsLineLayout::AddText(nsIFrame* aTextFrame)
|
|||
return NS_OK;/* XXX */
|
||||
}
|
||||
|
||||
nsTextRun*
|
||||
nsLineLayout::FindTextRunFor(nsIFrame* aFrame)
|
||||
{
|
||||
// Only the first-in-flows are present in the text run list so
|
||||
// backup from the argument frame to its first-in-flow.
|
||||
for (;;) {
|
||||
nsIFrame* prevInFlow;
|
||||
aFrame->GetPrevInFlow(prevInFlow);
|
||||
if (nsnull == prevInFlow) {
|
||||
break;
|
||||
}
|
||||
aFrame = prevInFlow;
|
||||
}
|
||||
|
||||
// Now look for the frame in each run
|
||||
nsTextRun* run = mReflowTextRuns;
|
||||
while (nsnull != run) {
|
||||
PRInt32 ix = run->mArray.IndexOf(aFrame);
|
||||
if (ix >= 0) {
|
||||
return run;
|
||||
}
|
||||
run = run->mNext;
|
||||
}
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
nsIFrame*
|
||||
nsLineLayout::FindNextText(nsIFrame* aFrame)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче