summaryrefslogtreecommitdiff
path: root/dw
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-12-08 18:41:23 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-12-08 18:41:23 +0100
commit8c95d423cee2fc3a1666f938c8b7bbcbd0355cbc (patch)
treeaddf91332aa71fbe4f93cae995e15b2c784189fa /dw
parentdd1fe82d94986ca9aea49c803304ca9355cdcbf2 (diff)
add support for CSS property list-style-position
Diffstat (limited to 'dw')
-rw-r--r--dw/listitem.cc6
-rw-r--r--dw/style.cc4
-rw-r--r--dw/style.hh5
3 files changed, 13 insertions, 2 deletions
diff --git a/dw/listitem.cc b/dw/listitem.cc
index 02a91eb7..ed7a2c75 100644
--- a/dw/listitem.cc
+++ b/dw/listitem.cc
@@ -43,7 +43,8 @@ void ListItem::initWithWidget (core::Widget *widget,
hasListitemValue = true;
addWidget (widget, style);
addSpace (style);
- updateValue ();
+ if (style->listStylePosition == core::style::LIST_STYLE_POSITION_OUTSIDE)
+ updateValue ();
}
void ListItem::initWithText (const char *text, core::style::Style *style)
@@ -51,7 +52,8 @@ void ListItem::initWithText (const char *text, core::style::Style *style)
hasListitemValue = true;
addText (text, style);
addSpace (style);
- updateValue ();
+ if (style->listStylePosition == core::style::LIST_STYLE_POSITION_OUTSIDE)
+ updateValue ();
}
int ListItem::getValue ()
diff --git a/dw/style.cc b/dw/style.cc
index d28d1389..6368560f 100644
--- a/dw/style.cc
+++ b/dw/style.cc
@@ -41,6 +41,7 @@ void StyleAttrs::initValues ()
textDecoration = TEXT_DECORATION_NONE;
textAlign = TEXT_ALIGN_LEFT;
textAlignChar = '.';
+ listStylePosition = LIST_STYLE_POSITION_OUTSIDE;
listStyleType = LIST_STYLE_TYPE_DISC;
valign = VALIGN_BASELINE;
backgroundColor = NULL;
@@ -131,6 +132,7 @@ bool StyleAttrs::equals (object::Object *other) {
borderStyle.left == otherAttrs->borderStyle.left &&
display == otherAttrs->display &&
whiteSpace == otherAttrs->whiteSpace &&
+ listStylePosition == otherAttrs->listStylePosition &&
listStyleType == otherAttrs->listStyleType &&
x_link == otherAttrs->x_link &&
x_img == otherAttrs->x_img &&
@@ -162,6 +164,7 @@ int StyleAttrs::hashValue () {
borderStyle.left +
display +
whiteSpace +
+ listStylePosition +
listStyleType +
x_link +
x_img +
@@ -240,6 +243,7 @@ void Style::copyAttrs (StyleAttrs *attrs)
borderStyle = attrs->borderStyle;
display = attrs->display;
whiteSpace = attrs->whiteSpace;
+ listStylePosition = attrs->listStylePosition;
listStyleType = attrs->listStyleType;
cursor = attrs->cursor;
x_link = attrs->x_link;
diff --git a/dw/style.hh b/dw/style.hh
index af6642f9..33be512d 100644
--- a/dw/style.hh
+++ b/dw/style.hh
@@ -256,6 +256,10 @@ enum DisplayType {
DISPLAY_LAST
};
+enum ListStylePosition {
+ LIST_STYLE_POSITION_INSIDE,
+ LIST_STYLE_POSITION_OUTSIDE
+};
enum ListStyleType {
LIST_STYLE_TYPE_DISC,
@@ -427,6 +431,7 @@ public:
DisplayType display;
WhiteSpace whiteSpace;
+ ListStylePosition listStylePosition;
ListStyleType listStyleType;
Cursor cursor;