[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/KDE/3.5/kdelibs/khtml/html
From: Maks Orlovich <maksim () kde ! org>
Date: 2006-03-15 18:25:39
Message-ID: 1142447139.240044.14674.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 518935 by orlovich:
Better avoid reinterpret_cast, and just move these two classes below the sections, etc.
M +124 -123 html_tableimpl.h
--- branches/KDE/3.5/kdelibs/khtml/html/html_tableimpl.h #518934:518935
@@ -49,6 +49,129 @@
// -------------------------------------------------------------------------
+class HTMLTablePartElementImpl : public HTMLElementImpl
+
+{
+public:
+ HTMLTablePartElementImpl(DocumentPtr *doc)
+ : HTMLElementImpl(doc)
+ { }
+
+ virtual void parseAttribute(AttributeImpl *attr);
+};
+
+// -------------------------------------------------------------------------
+
+class HTMLTableSectionElementImpl : public HTMLTablePartElementImpl
+{
+public:
+ HTMLTableSectionElementImpl(DocumentPtr *doc, ushort tagid, bool implicit);
+
+ ~HTMLTableSectionElementImpl();
+
+ virtual Id id() const;
+
+ HTMLElementImpl *insertRow ( long index, int& exceptioncode );
+ void deleteRow ( long index, int& exceptioncode );
+
+ int numRows() const;
+
+protected:
+ ushort _id;
+};
+
+// -------------------------------------------------------------------------
+
+class HTMLTableRowElementImpl : public HTMLTablePartElementImpl
+{
+public:
+ HTMLTableRowElementImpl(DocumentPtr *doc)
+ : HTMLTablePartElementImpl(doc) {}
+
+ virtual Id id() const;
+
+ long rowIndex() const;
+ long sectionRowIndex() const;
+
+ HTMLElementImpl *insertCell ( long index, int &exceptioncode );
+ void deleteCell ( long index, int &exceptioncode );
+
+protected:
+ int ncols;
+};
+
+// -------------------------------------------------------------------------
+
+class HTMLTableCellElementImpl : public HTMLTablePartElementImpl
+{
+public:
+ HTMLTableCellElementImpl(DocumentPtr *doc, int tagId);
+ ~HTMLTableCellElementImpl();
+
+ long cellIndex() const;
+
+ int col() const { return _col; }
+ void setCol(int col) { _col = col; }
+ int row() const { return _row; }
+ void setRow(int r) { _row = r; }
+
+ int colSpan() const { return cSpan; }
+ int rowSpan() const { return rSpan; }
+
+ virtual Id id() const { return _id; }
+ virtual void parseAttribute(AttributeImpl *attr);
+ virtual void attach();
+
+protected:
+ int _row;
+ int _col;
+ int rSpan;
+ int cSpan;
+ int _id;
+ int rowHeight;
+ bool m_solid : 1;
+ bool m_nowrap : 1;
+};
+
+// -------------------------------------------------------------------------
+
+class HTMLTableColElementImpl : public HTMLTablePartElementImpl
+{
+public:
+ HTMLTableColElementImpl(DocumentPtr *doc, ushort i);
+
+ virtual Id id() const;
+
+ void setTable(HTMLTableElementImpl *t) { table = t; }
+
+ // overrides
+ virtual void parseAttribute(AttributeImpl *attr);
+
+ int span() const { return _span; }
+
+protected:
+ // could be ID_COL or ID_COLGROUP ... The DOM is not quite clear on
+ // this, but since both elements work quite similar, we use one
+ // DOMElement for them...
+ ushort _id;
+ int _span;
+ HTMLTableElementImpl *table;
+};
+
+// -------------------------------------------------------------------------
+
+class HTMLTableCaptionElementImpl : public HTMLTablePartElementImpl
+{
+public:
+ HTMLTableCaptionElementImpl(DocumentPtr *doc)
+ : HTMLTablePartElementImpl(doc) {}
+
+ virtual Id id() const;
+ virtual void parseAttribute(AttributeImpl *attr);
+};
+
+// -------------------------------------------------------------------------
+
/*
This class helps memorize pointers to child objects that may be
yanked around via the DOM. It always picks the first pointer of the
@@ -74,7 +197,7 @@
break;
}
}
- return reinterpret_cast<ChildType*>(ptr); //Really static_cast..
+ return static_cast<ChildType*>(ptr);
}
void childAdded(ElementImpl* parent, NodeImpl* child) {
@@ -199,129 +322,7 @@
friend class HTMLTableCellElementImpl;
};
-// -------------------------------------------------------------------------
-class HTMLTablePartElementImpl : public HTMLElementImpl
-
-{
-public:
- HTMLTablePartElementImpl(DocumentPtr *doc)
- : HTMLElementImpl(doc)
- { }
-
- virtual void parseAttribute(AttributeImpl *attr);
-};
-
-// -------------------------------------------------------------------------
-
-class HTMLTableSectionElementImpl : public HTMLTablePartElementImpl
-{
-public:
- HTMLTableSectionElementImpl(DocumentPtr *doc, ushort tagid, bool implicit);
-
- ~HTMLTableSectionElementImpl();
-
- virtual Id id() const;
-
- HTMLElementImpl *insertRow ( long index, int& exceptioncode );
- void deleteRow ( long index, int& exceptioncode );
-
- int numRows() const;
-
-protected:
- ushort _id;
-};
-
-// -------------------------------------------------------------------------
-
-class HTMLTableRowElementImpl : public HTMLTablePartElementImpl
-{
-public:
- HTMLTableRowElementImpl(DocumentPtr *doc)
- : HTMLTablePartElementImpl(doc) {}
-
- virtual Id id() const;
-
- long rowIndex() const;
- long sectionRowIndex() const;
-
- HTMLElementImpl *insertCell ( long index, int &exceptioncode );
- void deleteCell ( long index, int &exceptioncode );
-
-protected:
- int ncols;
-};
-
-// -------------------------------------------------------------------------
-
-class HTMLTableCellElementImpl : public HTMLTablePartElementImpl
-{
-public:
- HTMLTableCellElementImpl(DocumentPtr *doc, int tagId);
- ~HTMLTableCellElementImpl();
-
- long cellIndex() const;
-
- int col() const { return _col; }
- void setCol(int col) { _col = col; }
- int row() const { return _row; }
- void setRow(int r) { _row = r; }
-
- int colSpan() const { return cSpan; }
- int rowSpan() const { return rSpan; }
-
- virtual Id id() const { return _id; }
- virtual void parseAttribute(AttributeImpl *attr);
- virtual void attach();
-
-protected:
- int _row;
- int _col;
- int rSpan;
- int cSpan;
- int _id;
- int rowHeight;
- bool m_solid : 1;
- bool m_nowrap : 1;
-};
-
-// -------------------------------------------------------------------------
-
-class HTMLTableColElementImpl : public HTMLTablePartElementImpl
-{
-public:
- HTMLTableColElementImpl(DocumentPtr *doc, ushort i);
-
- virtual Id id() const;
-
- void setTable(HTMLTableElementImpl *t) { table = t; }
-
- // overrides
- virtual void parseAttribute(AttributeImpl *attr);
-
- int span() const { return _span; }
-
-protected:
- // could be ID_COL or ID_COLGROUP ... The DOM is not quite clear on
- // this, but since both elements work quite similar, we use one
- // DOMElement for them...
- ushort _id;
- int _span;
- HTMLTableElementImpl *table;
-};
-
-// -------------------------------------------------------------------------
-
-class HTMLTableCaptionElementImpl : public HTMLTablePartElementImpl
-{
-public:
- HTMLTableCaptionElementImpl(DocumentPtr *doc)
- : HTMLTablePartElementImpl(doc) {}
-
- virtual Id id() const;
- virtual void parseAttribute(AttributeImpl *attr);
-};
-
} //namespace
#endif
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic