insert inline object problem

Korinek Pavol <[email protected]> Tue, 16 Nov 2010 10:38:29 +0000
Newsgroups gmane.comp.kde.devel.koffice
Message-ID <[email protected]>
Hello,

I work on problem which can be seen when open file from bug: 244396. Problem is that we can see double stroked line through "Picture 1" text above inserted picture. Fact is that it's not stroked line of that text ! It's stroked line, text-properties, text char format in cursor, of inserted picture !

Reasons of current state:

1. inline object manager uses char format (current text properties)

void KoInlineTextObjectManager::insertInlineObject(QTextCursor &cursor, KoInlineObject *object)
{
    QTextCharFormat oldCf = cursor.charFormat();
    // create a new format out of the old so that the current formatting is
    // also used for the inserted object.  KoVariables render text too ;)
    QTextCharFormat cf(oldCf);
.....

2. we are using default properties from MSWord, which are as default in UI, not as default for text in MSWord (not easy to find default char format for text)

3. Stroked line of picture is shown one line upper. Stroked line should be hidden behind picture. It's not stroked line of text one line upper !


Possible solutions:

1. set default char format for inline object manager - NOT good - we will lost possible format variables -> which variables are used for inline pictures from text properties ??

2. set correct default text properties for "Normal" style. parse correct default text format - not easy to find, or create some kword default text format - ths should be fixed too, because when you start write text anywhere, than it's still double stroked ! MSWord doesn't use default text style which has set in UI ! MSWord uses different default text format !

3. Fix that stroked line of inline object is shown one line upper. This should be fixed ! Is it Qt problem ? Can we ignore it and close bug ?

Which way do you prefer actually ?

Maybe we can also create workaround like don't use stroked line for inline objects, but is just like hide problem number 3

Pavol