[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: KWord: new font size -1 problem (constructor KWDocument)
From: Nicolas Goutte <nicog () snafu ! de>
Date: 2001-12-08 22:31:04
[Download RAW message or body]
I have found a new font size -1 problem.
To trigger it the file to be loaded in KWord should not have any <STYLES>
element. This does not happend normally with any KWord version. However such
files can be generated by quick&dirty programs, like when you test something
for an import filter (that's how I found it.)
I have found the source of the problem. It is in KWDocument::KWDocument (file
kword/kwdoc.cc line 202)
The code is (in one line):
m_defaultFont.setPointSize( ptToLayoutUnit(
QFontInfo(m_defaultFont).pointSize() ) );
A comment just a line before tells that QFontInfo is used not to have the -1
problem. However, it does not change much and a 0 value (instead of -1) is
returned by QFontInfo::pointSize().
Therefore the standard style is created with a wrong font size.
I suppose that we need something like this instead (not tested):
int size=m_defaultFont.pointSize();
if (size==-1)
size=int(m_default.pixelSize()* 72.0 / QPaintDevice::x11AppDpiY() + 0.5);
m_defaultFont.setPointSize(ptToLayoutUnit(size));
Have a nice day/evening/night!
_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://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