mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1160847 part 4 - Remove useless lineOffset variable in nsBidiPresUtils::ResolveParagraph. r=jfkthame
MozReview-Commit-ID: 7YRIg9TmExp --HG-- extra : source : 962291a39b4172f341f8e09ae001d5f5ce732740
This commit is contained in:
parent
c353935ab6
commit
8e36f5d113
@ -727,7 +727,6 @@ nsBidiPresUtils::ResolveParagraph(nsBlockFrame* aBlockFrame,
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
int32_t runLength = 0; // the length of the current run of text
|
||||
int32_t lineOffset = 0; // the start of the current run
|
||||
int32_t logicalLimit = 0; // the end of the current run + 1
|
||||
int32_t numRun = -1;
|
||||
int32_t fragmentLength = 0; // the length of the current text frame
|
||||
@ -843,7 +842,7 @@ nsBidiPresUtils::ResolveParagraph(nsBlockFrame* aBlockFrame,
|
||||
if (++numRun >= runCount) {
|
||||
break;
|
||||
}
|
||||
lineOffset = logicalLimit;
|
||||
int32_t lineOffset = logicalLimit;
|
||||
if (NS_FAILED(aBpd->GetLogicalRun(
|
||||
lineOffset, &logicalLimit, &embeddingLevel) ) ) {
|
||||
break;
|
||||
@ -858,7 +857,6 @@ nsBidiPresUtils::ResolveParagraph(nsBlockFrame* aBlockFrame,
|
||||
// have proper embedding level for all those characters, including
|
||||
// them wouldn't affect the final result.
|
||||
precedingControl = std::min(precedingControl, embeddingLevel);
|
||||
++lineOffset;
|
||||
}
|
||||
else {
|
||||
storeBidiDataToFrame();
|
||||
@ -890,8 +888,7 @@ nsBidiPresUtils::ResolveParagraph(nsBlockFrame* aBlockFrame,
|
||||
int32_t newIndex = aBpd->GetLastFrameForContent(content);
|
||||
if (newIndex > frameIndex) {
|
||||
currentLine->MarkDirty();
|
||||
RemoveBidiContinuation(aBpd, frame,
|
||||
frameIndex, newIndex, lineOffset);
|
||||
RemoveBidiContinuation(aBpd, frame, frameIndex, newIndex);
|
||||
frameIndex = newIndex;
|
||||
frame = aBpd->FrameAt(frameIndex);
|
||||
}
|
||||
@ -908,8 +905,7 @@ nsBidiPresUtils::ResolveParagraph(nsBlockFrame* aBlockFrame,
|
||||
aBpd->FrameAt(newIndex) == NS_BIDI_CONTROL_FRAME);
|
||||
if (newIndex < frameCount) {
|
||||
currentLine->MarkDirty();
|
||||
RemoveBidiContinuation(aBpd, frame,
|
||||
frameIndex, newIndex, lineOffset);
|
||||
RemoveBidiContinuation(aBpd, frame, frameIndex, newIndex);
|
||||
}
|
||||
} else if (runLength == fragmentLength) {
|
||||
/*
|
||||
@ -926,9 +922,6 @@ nsBidiPresUtils::ResolveParagraph(nsBlockFrame* aBlockFrame,
|
||||
frame->AdjustOffsetsForBidi(contentOffset, contentOffset + fragmentLength);
|
||||
}
|
||||
} // isTextFrame
|
||||
else {
|
||||
++lineOffset;
|
||||
}
|
||||
} // not bidi control frame
|
||||
int32_t temp = runLength;
|
||||
runLength -= fragmentLength;
|
||||
@ -1760,17 +1753,13 @@ void
|
||||
nsBidiPresUtils::RemoveBidiContinuation(BidiParagraphData *aBpd,
|
||||
nsIFrame* aFrame,
|
||||
int32_t aFirstIndex,
|
||||
int32_t aLastIndex,
|
||||
int32_t& aOffset)
|
||||
int32_t aLastIndex)
|
||||
{
|
||||
FrameBidiData bidiData = nsBidi::GetBidiData(aFrame);
|
||||
bidiData.precedingControl = kBidiLevelNone;
|
||||
for (int32_t index = aFirstIndex + 1; index <= aLastIndex; index++) {
|
||||
nsIFrame* frame = aBpd->FrameAt(index);
|
||||
if (frame == NS_BIDI_CONTROL_FRAME) {
|
||||
++aOffset;
|
||||
}
|
||||
else {
|
||||
if (frame != NS_BIDI_CONTROL_FRAME) {
|
||||
// Make the frame and its continuation ancestors fluid,
|
||||
// so they can be reused or deleted by normal reflow code
|
||||
frame->Properties().Set(nsBidi::BidiDataProperty(), bidiData);
|
||||
|
@ -524,11 +524,6 @@ private:
|
||||
* @param aFrame the frame whose continuations are to be removed
|
||||
* @param aFirstIndex index of aFrame in mLogicalFrames
|
||||
* @param aLastIndex index of the last frame to be removed
|
||||
* @param aOffset [OUT] count of directional frames removed. Since
|
||||
* directional frames have control characters
|
||||
* corresponding to them in mBuffer, the pointers to
|
||||
* mBuffer in Resolve() will need to be updated after
|
||||
* deleting the frames.
|
||||
*
|
||||
* @see Resolve()
|
||||
* @see EnsureBidiContinuation()
|
||||
@ -536,8 +531,7 @@ private:
|
||||
static void RemoveBidiContinuation(BidiParagraphData* aBpd,
|
||||
nsIFrame* aFrame,
|
||||
int32_t aFirstIndex,
|
||||
int32_t aLastIndex,
|
||||
int32_t& aOffset);
|
||||
int32_t aLastIndex);
|
||||
static void CalculateCharType(nsBidi* aBidiEngine,
|
||||
const char16_t* aText,
|
||||
int32_t& aOffset,
|
||||
|
Loading…
Reference in New Issue
Block a user