[Qt-interest] Is this a bug?

Graham Labdon Graham.Labdon at avalonsciences.com
Tue Oct 18 11:24:44 CEST 2011


Hi
I am looking into writing data from a QTextEdit to a file format of my own design.
During research I looked at the code in QTextOdfWriter.
When this class is wrting a FrameFormat it uses the following code -
    if (format.hasProperty(QTextFormat::BlockTopMargin))
        writer.writeAttribute(foNS, QString::fromLatin1("margin-top"), pixelToPoint(qMax(qreal(0.), format.topMargin())) );
    if (format.hasProperty(QTextFormat::BlockBottomMargin))
        writer.writeAttribute(foNS, QString::fromLatin1("margin-bottom"), pixelToPoint(qMax(qreal(0.), format.bottomMargin())) );
    if (format.hasProperty(QTextFormat::BlockLeftMargin))
        writer.writeAttribute(foNS, QString::fromLatin1("margin-left"), pixelToPoint(qMax(qreal(0.), format.leftMargin())) );
    if (format.hasProperty(QTextFormat::BlockRightMargin))
        writer.writeAttribute(foNS, QString::fromLatin1("margin-right"), pixelToPoint(qMax(qreal(0.), format.rightMargin())) );

Note that is checking BlockTopMargin etc.

Should this in fact be FrameTopMargin etc?

Thanks

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20111018/21daaaac/attachment.html 


More information about the Qt-interest-old mailing list