Skip to content

Commit

Permalink
libgui|Font|RichFormat: Revised interpretation of tab stops
Browse files Browse the repository at this point in the history
Each range in the rich format is assigned a tab stop number.
  • Loading branch information
skyjake committed Jun 8, 2013
1 parent 7c6a65e commit d24024f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 0 additions & 4 deletions doomsday/libgui/include/de/gui/font.h
Expand Up @@ -91,10 +91,6 @@ class LIBGUI_PUBLIC Font
AccentColor = 3,
DimAccentColor = 4
};
enum {
NoTabStop = -2,
NextTabStop = -1
};

/**
* Interface for an object providing style information: fonts and
Expand Down
7 changes: 3 additions & 4 deletions doomsday/libgui/src/font.cpp
Expand Up @@ -48,7 +48,7 @@ struct Font::RichFormat::Instance

Format() : sizeFactor(1.f), weight(OriginalWeight),
style(OriginalStyle), colorIndex(-1), markIndent(false),
tabStop(NoTabStop) {}
tabStop(0) {}
};

struct FormatRange
Expand Down Expand Up @@ -89,7 +89,6 @@ struct Font::RichFormat::Instance

// Single range properties.
stack.last().markIndent = false;
stack.last().tabStop = NoTabStop;
}

void handleEscapeSequence(Rangei const &range)
Expand Down Expand Up @@ -126,11 +125,11 @@ struct Font::RichFormat::Instance
break;

case '\t':
stack.last().tabStop = NextTabStop;
stack.last().tabStop++;
break;

case 'T':
stack.last().tabStop = code[1].toLatin1() - 'a';
stack.last().tabStop = de::max(0, code[1].toLatin1() - 'a');
break;

case 'b':
Expand Down

0 comments on commit d24024f

Please sign in to comment.