diff options
author | Sebastian Geerken <devnull@localhost> | 2013-01-29 12:17:46 +0100 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2013-01-29 12:17:46 +0100 |
commit | b8270ee350357ef491fa9ba92cf6250258d3099c (patch) | |
tree | da286644b7a034dd5c0d9ec88d1091a276276017 | |
parent | 299cd1cb7319b24f50c68476d28da6a6df1c6963 (diff) |
Some cleanup.
-rw-r--r-- | dw/outofflowmgr.cc | 12 | ||||
-rw-r--r-- | dw/textblock.cc | 5 | ||||
-rw-r--r-- | dw/textblock.hh | 2 |
3 files changed, 6 insertions, 13 deletions
diff --git a/dw/outofflowmgr.cc b/dw/outofflowmgr.cc index e53245e4..756f5997 100644 --- a/dw/outofflowmgr.cc +++ b/dw/outofflowmgr.cc @@ -183,7 +183,7 @@ void OutOfFlowMgr::markSizeChange (int ref) if (isRefFloat (ref)) { // Nothing can be done when the container has not been allocated. - if (containingBlock->asWidget()->wasAllocated()) { + if (containingBlock->wasAllocated()) { Float *vloat; if (isRefLeftFloat (ref)) @@ -248,7 +248,7 @@ void OutOfFlowMgr::tellNoPosition (Widget *widget) int oldY = vloat->y; vloat->y = -1; - if (oldY != -1 && containingBlock->asWidget()->wasAllocated() && + if (oldY != -1 && containingBlock->wasAllocated() && vloat->generatingBlock->wasAllocated()) // ContainingBlock::borderChanged expects coordinates relative // to the container. @@ -596,8 +596,8 @@ int OutOfFlowMgr::calcBorderDiff (Float *vloat) int OutOfFlowMgr::calcLeftBorderDiff (Float *vloat) { - int d = containingBlock->asWidget()->getStyle()->boxOffsetX(); - for (Widget *w = vloat->generatingBlock; w != containingBlock->asWidget(); + int d = containingBlock->getStyle()->boxOffsetX(); + for (Widget *w = vloat->generatingBlock; w != containingBlock; w = w->getParent()) d += w->getStyle()->boxOffsetX(); return d; @@ -605,8 +605,8 @@ int OutOfFlowMgr::calcLeftBorderDiff (Float *vloat) int OutOfFlowMgr::calcRightBorderDiff (Float *vloat) { - int d = containingBlock->asWidget()->getStyle()->boxRestWidth(); - for (Widget *w = vloat->generatingBlock; w != containingBlock->asWidget(); + int d = containingBlock->getStyle()->boxRestWidth(); + for (Widget *w = vloat->generatingBlock; w != containingBlock; w = w->getParent()) d += w->getStyle()->boxRestWidth(); return d; diff --git a/dw/textblock.cc b/dw/textblock.cc index 5bc4a48a..d01e4320 100644 --- a/dw/textblock.cc +++ b/dw/textblock.cc @@ -2407,9 +2407,4 @@ int Textblock::heightOfPossiblyMissingLine (int lineNo) return 1; } -core::Widget *Textblock::asWidget () -{ - return this; -} - } // namespace dw diff --git a/dw/textblock.hh b/dw/textblock.hh index 0d2d1c76..21ec6263 100644 --- a/dw/textblock.hh +++ b/dw/textblock.hh @@ -661,9 +661,7 @@ public: void changeWordStyle (int from, int to, core::style::Style *style, bool includeFirstSpace, bool includeLastSpace); - // From OutOfFlowMgr::ContainingBlock: void borderChanged (int y); - core::Widget *asWidget (); }; } // namespace dw |