[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdewebdev/quanta
From: Andras Mantia <amantia () kde ! org>
Date: 2004-10-08 19:01:07
Message-ID: 20041008190107.E465316B52 () office ! kde ! org
[Download RAW message or body]
CVS commit by amantia:
Case insensitive table reading. Makes possible editing of tables inside broken \
documents with wrong doctype definition.
M +2 -0 ChangeLog 1.312
M +2 -2 quanta.kdevelop 1.251
M +4 -4 components/tableeditor/tableeditor.cpp 1.13
M +14 -14 parsers/tag.cpp 1.69
M +8 -8 parsers/tag.h 1.52
--- kdewebdev/quanta/ChangeLog #1.311:1.312
@@ -29,4 +29,6 @@
- show the right index of the main cell in case of merged rows in a table
- don't crash on column removal form a table
+ - read the tables correctly also if the doctype definition is wrong
+ (for example HTML tables inside XHTML)
- behavioral/user interface changes:
--- kdewebdev/quanta/quanta.kdevelop #1.250:1.251
@@ -244,8 +244,8 @@
<kdevfilecreate>
<filetypes>
- <type icon="" ext="h" create="template" name="C++ header" >
+ <type icon="" ext="h" name="C++ header" create="template" >
<descr>Quanta speicfic header</descr>
</type>
- <type icon="source_cpp" ext="cpp" create="template" name="C++ source" >
+ <type icon="source_cpp" ext="cpp" name="C++ source" create="template" >
<descr>A new empty C++ file.</descr>
</type>
--- kdewebdev/quanta/components/tableeditor/tableeditor.cpp #1.12:1.13
@@ -461,5 +461,5 @@ bool TableEditor::setTableArea( int bLin
tableRowTags.append(tableNode);
}
- QString colspanValue = n->tag->attributeValue("colspan");
+ QString colspanValue = n->tag->attributeValue("colspan", true);
int colValue = 1;
int lastCol = nCol;
@@ -489,5 +489,5 @@ bool TableEditor::setTableArea( int bLin
colValue = 1;
}
- QString rowspanValue = n->tag->attributeValue("rowspan");
+ QString rowspanValue = n->tag->attributeValue("rowspan", true);
if (!rowspanValue.isEmpty())
{
@@ -1200,5 +1200,5 @@ void TableEditor::configureCell(int row,
// Horizontal alignment
Qt::AlignmentFlags flags;
- QString align = node->tag->attributeValue("align");
+ QString align = node->tag->attributeValue("align", true);
if (align == "right")
flags = Qt::AlignRight;
@@ -1213,5 +1213,5 @@ void TableEditor::configureCell(int row,
item->setAlignment(flags);
// Vertical alignment
- QString valign = node->tag->attributeValue("valign");
+ QString valign = node->tag->attributeValue("valign", true);
if (valign == "top")
flags = Qt::AlignTop;
--- kdewebdev/quanta/parsers/tag.cpp #1.68:1.69
@@ -369,5 +369,5 @@ QString Tag::attributeValue(int index)
}
-QString Tag::attributeValue(QString attr)
+QString Tag::attributeValue(const QString &attr, bool ignoreCase)
{
QString val = "";
@@ -376,5 +376,5 @@ QString Tag::attributeValue(QString attr
if ( attr == attrs[i].name ||
- (!m_dtd->caseSensitive && attrs[i].name == attr.lower()))
+ ((!m_dtd->caseSensitive || ignoreCase) && attrs[i].name == attr.lower()))
{
val = attrs[i].value;
@@ -386,10 +386,10 @@ QString Tag::attributeValue(QString attr
/** Check if this tag has the attr attribute defined */
-bool Tag::hasAttribute( const QString &attr )
+bool Tag::hasAttribute(const QString &attr, bool ignoreCase)
{
for (uint i = 0; i < attrs.count(); i++)
{
if ( attrs[i].name == attr ||
- (!m_dtd->caseSensitive && attrs[i].name == attr.lower()))
+ ((!m_dtd->caseSensitive || ignoreCase) && attrs[i].name == attr.lower()))
return true;
}
--- kdewebdev/quanta/parsers/tag.h #1.51:1.52
@@ -84,5 +84,5 @@ public:
QString attributeValue(int index);
/** Return the value of attr*/
- QString attributeValue(QString attr);
+ QString attributeValue(const QString &attr, bool ignoreCase = false);
/** Add an attribute */
void addAttribute(TagAttr attr) {attrs.append(attr);}
@@ -99,5 +99,5 @@ public:
bool isQuotedAttribute(int index) const {return attrs[index].quoted;}
/** Check if this tag has the attr attribute defined */
- bool hasAttribute( const QString &attr );
+ bool hasAttribute(const QString &attr, bool ignoreCase = false);
/** set the coordinates of a tag attribute */
void setAttributePosition(int index, int bLineName, int bColName, int bLineValue, \
int bColValue);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic