Backed out some changes that aren't needed and were fixed with a change

to the frame construction code


git-svn-id: svn://10.0.0.236/trunk@48233 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
troy%netscape.com
1999-09-19 00:59:38 +00:00
parent b25344ebc6
commit 545ba4350f
2 changed files with 16 additions and 36 deletions

View File

@@ -929,10 +929,8 @@ nsTextFrame::PaintUnicodeText(nsIPresContext* aPresContext,
{
nsCOMPtr<nsIDocument> doc(getter_AddRefs(GetDocument(aPresContext)));
PRBool displaySelection = PR_FALSE;
NS_ASSERTION(doc, "PaintUnicodeText: PresContext has no document!");
if (doc)
displaySelection = doc->GetDisplaySelection();
PRBool displaySelection;
displaySelection = doc->GetDisplaySelection();
// Make enough space to transform
PRUnichar wordBufMem[WORD_BUF_SIZE];
@@ -949,8 +947,7 @@ nsTextFrame::PaintUnicodeText(nsIPresContext* aPresContext,
// Transform text from content into renderable form
nsCOMPtr<nsILineBreaker> lb;
if (doc)
doc->GetLineBreaker(getter_AddRefs(lb));
doc->GetLineBreaker(getter_AddRefs(lb));
// nsCOMPtr<nsIWordBreaker> wb;
// doc->GetWordBreaker(getter_AddRefs(wb));
nsTextTransformer tx(wordBufMem, WORD_BUF_SIZE,lb,nsnull);
@@ -2107,8 +2104,8 @@ nsTextFrame::PeekOffset(nsPeekOffsetStruct *aPos)
PrepareUnicodeText(tx, ip, paintBuf, &textLength);
nsIFrame *frameUsed = nsnull;
PRBool keepSearching=PR_FALSE; //if you run out of chars before you hit the end of word, maybe next frame has more text to select?
PRInt32 start=0;
PRBool keepSearching; //if you run out of chars before you hit the end of word, maybe next frame has more text to select?
PRInt32 start;
PRBool found = PR_FALSE;
PRBool isWhitespace;
PRInt32 wordLen, contentLen;
@@ -2392,11 +2389,7 @@ nsTextFrame::Reflow(nsIPresContext& aPresContext,
// Setup text transformer to transform this frames text content
PRUnichar wordBuf[WORD_BUF_SIZE];
nsCOMPtr<nsILineBreaker> lb;
NS_ASSERTION(doc, "Reflow: mContent has no document!");
if (doc)
doc->GetLineBreaker(getter_AddRefs(lb));
if (doc)
doc->GetLineBreaker(getter_AddRefs(lb));
doc->GetLineBreaker(getter_AddRefs(lb));
nsTextTransformer tx(wordBuf, WORD_BUF_SIZE,lb,nsnull);
nsresult rv = tx.Init(this, mContent, startingOffset);
if (NS_OK != rv) {
@@ -2424,7 +2417,7 @@ nsTextFrame::Reflow(nsIPresContext& aPresContext,
PRInt32 prevColumn = column;
mColumn = column;
PRBool breakable = lineLayout.LineIsBreakable();
PRInt32 lastWordLen=0;
PRInt32 lastWordLen;
PRUnichar* bp = nsnull;
PRBool measureText = PR_TRUE;
@@ -3006,10 +2999,7 @@ nsTextFrame::ComputeWordFragmentWidth(nsIPresContext* aPresContext,
PRUint32 breakP=0;
PRBool needMore=PR_TRUE;
nsresult lres = NS_ERROR_FAILURE;
NS_ASSERTION(aLineBreaker, "ComputeWordFragmentWidth: No line breaker!");
if (aLineBreaker)
lres = aLineBreaker->Next(aWordBuf, aWordBufLen+wordLen, 0, &breakP, &needMore);
nsresult lres = aLineBreaker->Next(aWordBuf, aWordBufLen+wordLen, 0, &breakP, &needMore);
if(NS_SUCCEEDED(lres))
{
// when we look at two pieces text together, we might decide to break