This commit is contained in:
kipp%netscape.com 1998-10-20 00:23:11 +00:00
Родитель 2ec47f67fb
Коммит f8d0cb680d
2 изменённых файлов: 70 добавлений и 0 удалений

Просмотреть файл

@ -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)
{