[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: koffice
From: Pierre Ducroquet <pinaraf () gmail ! com>
Date: 2007-07-07 12:57:52
Message-ID: 1183813072.970353.9160.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 684869 by ducroquet:
Fix a problem with the Qt underline and strikeout properties being used instead of \
the KoCharacterStyle ones
M +16 -2 libs/kotext/KoTextSelectionHandler.cpp
M +3 -2 shapes/text/TextTool.cpp
--- trunk/koffice/libs/kotext/KoTextSelectionHandler.cpp #684868:684869
@@ -108,7 +108,14 @@
Q_ASSERT(d->caret);
emit startMacro(i18n("Underline"));
QTextCharFormat format;
- format.setFontUnderline(underline);
+ if (underline) {
+ format.setProperty(KoCharacterStyle::UnderlineType, \
KoCharacterStyle::SingleLine); + \
format.setProperty(KoCharacterStyle::UnderlineStyle, KoCharacterStyle::SolidLine); + \
} else { + format.setProperty(KoCharacterStyle::UnderlineType, \
KoCharacterStyle::NoLineType); + \
format.setProperty(KoCharacterStyle::UnderlineStyle, KoCharacterStyle::NoLineStyle); \
+ } + //format.setFontUnderline(underline);
d->caret->mergeCharFormat(format);
emit stopMacro();
}
@@ -117,7 +124,14 @@
Q_ASSERT(d->caret);
emit startMacro(i18n("Strike Out"));
QTextCharFormat format;
- format.setFontStrikeOut(strikeout ? Qt::SolidLine : Qt::NoPen);
+ if (strikeout) {
+ format.setProperty(KoCharacterStyle::StrikeOutType, \
KoCharacterStyle::SingleLine); + \
format.setProperty(KoCharacterStyle::StrikeOutStyle, KoCharacterStyle::SolidLine); + \
} else { + format.setProperty(KoCharacterStyle::StrikeOutType, \
KoCharacterStyle::NoLineType); + \
format.setProperty(KoCharacterStyle::StrikeOutStyle, KoCharacterStyle::NoLineStyle); \
+ } + //format.setFontStrikeOut(strikeout ? Qt::SolidLine : Qt::NoPen);
d->caret->mergeCharFormat(format);
emit stopMacro();
}
--- trunk/koffice/shapes/text/TextTool.cpp #684868:684869
@@ -36,6 +36,7 @@
#include <KoPointerEvent.h>
#include <KoCanvasResourceProvider.h>
+#include <KoCharacterStyle.h>
#include <KoTextDocumentLayout.h>
#include <KoParagraphStyle.h>
#include <KoTextEditingPlugin.h>
@@ -769,8 +770,8 @@
QTextCharFormat cf = m_caret.charFormat();
m_actionFormatBold->setChecked(cf.fontWeight() > QFont::Normal);
m_actionFormatItalic->setChecked(cf.fontItalic());
- m_actionFormatUnderline->setChecked(cf.fontUnderline());
- m_actionFormatStrikeOut->setChecked(cf.fontStrikeOut());
+ m_actionFormatUnderline->setChecked(cf.intProperty(KoCharacterStyle::UnderlineType) \
!= KoCharacterStyle::NoLineType); + \
m_actionFormatStrikeOut->setChecked(cf.intProperty(KoCharacterStyle::StrikeOutType) \
!= KoCharacterStyle::NoLineType); bool super=false, sub=false;
switch(cf.verticalAlignment()) {
case QTextCharFormat::AlignSuperScript: super = true; break;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic