Commit da320081 authored by Sebastian Sauer's avatar Sebastian Sauer
Browse files

* s/QCharFormat/QTextCharFormat/ in dox

* QTextFormat::TextUnderlineColor works fine now, thanks Thomas!


svn path=/trunk/koffice/; revision=648862
parent f72480e2
...@@ -138,6 +138,7 @@ void KoCharacterStyle::applyStyle(QTextCharFormat &format) const { ...@@ -138,6 +138,7 @@ void KoCharacterStyle::applyStyle(QTextCharFormat &format) const {
QTextFormat::TextOutline, QTextFormat::TextOutline,
QTextFormat::BackgroundBrush, QTextFormat::BackgroundBrush,
QTextFormat::ForegroundBrush, QTextFormat::ForegroundBrush,
QTextFormat::TextUnderlineColor,
-1 -1
}; };
...@@ -208,9 +209,12 @@ void KoCharacterStyle::loadOasis(KoStyleStack& styleStack) { ...@@ -208,9 +209,12 @@ void KoCharacterStyle::loadOasis(KoStyleStack& styleStack) {
//in 1.6 this was defined in KoTextFormat::load(KoOasisContext& context) //in 1.6 this was defined in KoTextFormat::load(KoOasisContext& context)
if ( styleStack.hasAttributeNS( KoXmlNS::fo, "color" ) ) { // 3.10.3 if ( styleStack.hasAttributeNS( KoXmlNS::fo, "color" ) ) { // 3.10.3
QBrush brush = foreground(); QColor color(styleStack.attributeNS( KoXmlNS::fo, "color" )); // #rrggbb format
brush.setColor( QColor(styleStack.attributeNS( KoXmlNS::fo, "color" )) ); // #rrggbb format if ( color.isValid() ) {
setForeground(brush); QBrush brush = foreground();
brush.setColor(color);
setForeground(brush);
}
} }
QString fontName; QString fontName;
...@@ -218,8 +222,6 @@ void KoCharacterStyle::loadOasis(KoStyleStack& styleStack) { ...@@ -218,8 +222,6 @@ void KoCharacterStyle::loadOasis(KoStyleStack& styleStack) {
fontName = styleStack.attributeNS( KoXmlNS::fo, "font-family" ); fontName = styleStack.attributeNS( KoXmlNS::fo, "font-family" );
if ( styleStack.hasAttributeNS( KoXmlNS::style, "font-family" ) ) if ( styleStack.hasAttributeNS( KoXmlNS::style, "font-family" ) )
fontName = styleStack.attributeNS( KoXmlNS::style, "font-family" ); fontName = styleStack.attributeNS( KoXmlNS::style, "font-family" );
//if ( styleStack.hasAttributeNS( KoXmlNS::svg, "font-family" ) )
// fontName = styleStack.attributeNS( KoXmlNS::svg, "font-family" );
if ( ! fontName.isNull() ) { if ( ! fontName.isNull() ) {
// Hmm, the remove "'" could break it's in the middle of the fontname... // Hmm, the remove "'" could break it's in the middle of the fontname...
fontName = fontName.remove( "'" ); fontName = fontName.remove( "'" );
......
...@@ -58,71 +58,71 @@ public: ...@@ -58,71 +58,71 @@ public:
return static_cast<QFont> (propertyObject(QTextFormat::FOO)); return static_cast<QFont> (propertyObject(QTextFormat::FOO));
} }
*/ */
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
void setFontFamily (const QString &family) { setProperty(QTextFormat::FontFamily, family); } void setFontFamily (const QString &family) { setProperty(QTextFormat::FontFamily, family); }
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
QString fontFamily () const { return propertyString(QTextFormat::FontFamily); } QString fontFamily () const { return propertyString(QTextFormat::FontFamily); }
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
void setFontPointSize (qreal size) { setProperty(QTextFormat::FontPointSize, size); } void setFontPointSize (qreal size) { setProperty(QTextFormat::FontPointSize, size); }
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
double fontPointSize () const { return propertyDouble(QTextFormat::FontPointSize); } double fontPointSize () const { return propertyDouble(QTextFormat::FontPointSize); }
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
void setFontWeight (int weight) { setProperty(QTextFormat::FontWeight, weight); } void setFontWeight (int weight) { setProperty(QTextFormat::FontWeight, weight); }
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
int fontWeight () const { return propertyInt(QTextFormat::FontWeight); } int fontWeight () const { return propertyInt(QTextFormat::FontWeight); }
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
void setFontItalic (bool italic) { setProperty(QTextFormat::FontItalic, italic); } void setFontItalic (bool italic) { setProperty(QTextFormat::FontItalic, italic); }
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
bool fontItalic () const { return propertyBoolean(QTextFormat::FontItalic); } bool fontItalic () const { return propertyBoolean(QTextFormat::FontItalic); }
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
void setFontOverline (bool overline) { setProperty(QTextFormat::FontOverline, overline); } void setFontOverline (bool overline) { setProperty(QTextFormat::FontOverline, overline); }
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
bool fontOverline () const { return propertyBoolean(QTextFormat::FontOverline); } bool fontOverline () const { return propertyBoolean(QTextFormat::FontOverline); }
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
void setFontStrikeOut (bool strikeOut) { setProperty(QTextFormat::FontStrikeOut, strikeOut); } void setFontStrikeOut (bool strikeOut) { setProperty(QTextFormat::FontStrikeOut, strikeOut); }
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
bool fontStrikeOut () const { return propertyBoolean(QTextFormat::FontStrikeOut); } bool fontStrikeOut () const { return propertyBoolean(QTextFormat::FontStrikeOut); }
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
void setUnderlineColor (const QColor &color) { setProperty(QTextFormat::TextUnderlineColor, color); } void setUnderlineColor (const QColor &color) { setProperty(QTextFormat::TextUnderlineColor, color); }
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
QColor underlineColor () const; QColor underlineColor () const;
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
void setFontFixedPitch (bool fixedPitch) { setProperty(QTextFormat::FontFixedPitch, fixedPitch); } void setFontFixedPitch (bool fixedPitch) { setProperty(QTextFormat::FontFixedPitch, fixedPitch); }
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
bool fontFixedPitch () const { return propertyBoolean(QTextFormat::FontFixedPitch); } bool fontFixedPitch () const { return propertyBoolean(QTextFormat::FontFixedPitch); }
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
void setUnderlineStyle (QTextCharFormat::UnderlineStyle style) { void setUnderlineStyle (QTextCharFormat::UnderlineStyle style) {
setProperty(QTextFormat::TextUnderlineStyle, style); setProperty(QTextFormat::TextUnderlineStyle, style);
} }
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
QTextCharFormat::UnderlineStyle underlineStyle () const { QTextCharFormat::UnderlineStyle underlineStyle () const {
return static_cast<QTextCharFormat::UnderlineStyle> (propertyInt(QTextFormat::TextUnderlineStyle)); return static_cast<QTextCharFormat::UnderlineStyle> (propertyInt(QTextFormat::TextUnderlineStyle));
} }
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
void setVerticalAlignment (QTextCharFormat::VerticalAlignment alignment) { void setVerticalAlignment (QTextCharFormat::VerticalAlignment alignment) {
setProperty(QTextFormat::TextVerticalAlignment, alignment); setProperty(QTextFormat::TextVerticalAlignment, alignment);
} }
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
QTextCharFormat::VerticalAlignment verticalAlignment () const { QTextCharFormat::VerticalAlignment verticalAlignment () const {
return static_cast<QTextCharFormat::VerticalAlignment> (propertyInt(QTextFormat::TextVerticalAlignment)); return static_cast<QTextCharFormat::VerticalAlignment> (propertyInt(QTextFormat::TextVerticalAlignment));
} }
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
void setTextOutline (const QPen &pen) { setProperty(QTextFormat::TextOutline, pen); } void setTextOutline (const QPen &pen) { setProperty(QTextFormat::TextOutline, pen); }
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
QPen textOutline () const; QPen textOutline () const;
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
void setBackground (const QBrush &brush) { setProperty(QTextFormat::BackgroundBrush, brush); } void setBackground (const QBrush &brush) { setProperty(QTextFormat::BackgroundBrush, brush); }
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
QBrush background () const; QBrush background () const;
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
void clearBackground (); void clearBackground ();
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
void setForeground (const QBrush &brush) { setProperty(QTextFormat::ForegroundBrush, brush); } void setForeground (const QBrush &brush) { setProperty(QTextFormat::ForegroundBrush, brush); }
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
QBrush foreground () const; QBrush foreground () const;
/// See similar named method on QCharFormat /// See similar named method on QTextCharFormat
void clearForeground (); void clearForeground ();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment