[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: Typo with font-faces in KoOasisStyles.* ?
From: Pinaraf <pinaraf () gmail ! com>
Date: 2007-05-16 23:30:37
Message-ID: 2d74a35c0705161630v2000f2afu6ef15b075ce6f12c () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Hi
I'm currently looking at the KOffice code to get support for font faces in
KWord, and I think I found a typo in KoOasisStyles : it's trying to read xml
nodes named style:font-decl in a font-decls node, while they seem to be
located in nodes named font-face in a font-faces-decl.
The specification doesn't say anything about a font-decl nor about
font-decls.
The font-faces-decl and font-face nodes are explained in the ODF spec,
paragraph 2.6 (Font Face Declarations), page 55.
I attached a quick diff of the changes required...
[Attachment #5 (text/html)]
Hi<br><br>I'm currently looking at the KOffice code to get support for font faces \
in KWord, and I think I found a typo in KoOasisStyles : it's trying to read xml \
nodes named style:font-decl in a font-decls node, while they seem to be located in \
nodes named font-face in a font-faces-decl. <br>The specification doesn't say \
anything about a font-decl nor about font-decls.<br>The font-faces-decl and font-face \
nodes are explained in the ODF spec, paragraph 2.6 (Font Face Declarations), page \
55.<br>I attached a quick diff of the changes required... <br><br>
["font-face.diff" (text/x-diff)]
Index: libs/main/KoOasisStyles.cpp
===================================================================
--- libs/main/KoOasisStyles.cpp (révision 665397)
+++ libs/main/KoOasisStyles.cpp (copie de travail)
@@ -43,7 +43,7 @@
QHash<QString /*family*/, QHash<QString /*name*/, KoXmlElement*> > stylesAutoStyles;
QHash<QString /*family*/, KoXmlElement*> defaultStyles;
- QHash<QString /*name*/, KoXmlElement*> styles; // page-layout, font-decl etc.
+ QHash<QString /*name*/, KoXmlElement*> styles; // page-layout, font-face etc.
QHash<QString /*name*/, KoXmlElement*> masterPages;
QHash<QString /*name*/, KoXmlElement*> listStyles;
QHash<QString /*name*/, KoXmlElement*> drawStyles;
@@ -79,10 +79,10 @@
{
const KoXmlElement docElement = doc.documentElement();
// We used to have the office:version check here, but better let the apps do that
- KoXmlElement fontStyles = KoDom::namedItemNS( docElement, KoXmlNS::office, "font-decls" );
+ KoXmlElement fontStyles = KoDom::namedItemNS( docElement, KoXmlNS::office, "font-face-decls" );
if ( !fontStyles.isNull() ) {
- //kDebug(30003) << "Starting reading in font-decl..." << endl;
+ //kDebug(30003) << "Starting reading in font-face-decls..." << endl;
insertStyles( fontStyles, stylesDotXml ? AutomaticInStyles : AutomaticInContent );
}// else
// kDebug(30003) << "No items found" << endl;
@@ -225,7 +225,7 @@
}
} else if ( ns == KoXmlNS::style && (
localName == "page-layout"
- || localName == "font-decl"
+ || localName == "font-face"
|| localName == "presentation-page-layout" ) )
{
if ( d->styles.contains( name ) )
Index: libs/main/KoOasisStyles.h
===================================================================
--- libs/main/KoOasisStyles.h (révision 665397)
+++ libs/main/KoOasisStyles.h (copie de travail)
@@ -48,7 +48,7 @@
/**
* Look up a style by name.
* This method can find styles defined by the tags "style:page-layout",
- * "style:presentation-page-layout", or "style:font-decl".
+ * "style:presentation-page-layout", or "style:font-face".
* Do NOT use this method for style:style styles.
*
* @param name the style name
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic