Unclosed bookmarks? (wptools v3.x -> wptools v6.2 problem

  • Hi,

    We've experience some problems with the 'old-style bookmarks.

    In our older application (v4.x) we've using wptools v3.x for several years, in this version we're (ab)using
    bookmarks to add some extra data/info to our documents (which is stored as-is into the database, blob data).
    Recently we've updated our major product to a new major version (v5.x) with this version change
    we've also updated the wptools suite from v3.x to v6.2x. So far so good.

    The 'new' wptools suite have support to add some extra data to the document, so we have to 'convert' and 'delete'
    our old bookmarks and put it into the new style of extra storage.

    All clear and working but... Some of our customers are complaining that the stored data/text from the
    past is 'gone'... :-( After we've done some research to this problem we've found the following
    (which is causing the problem) it looks like it that the text/data is not gone, but it is invisible.

    You may think...hu how is that possible... as far as we can see it looks like it that the 'normal' text
    is now a part of the bookmark text/data, and because we have the property "BodyText(TWPRichText).BookmarkTextAttr.Hidden"
    set to "False" we (and our customers) don't see the text anymore.
    In some odd kind of way it looks to us that the previously stored bookmark (wptools v3.x) is not closed correctly and
    now causing a problem when reopening with wptools v6.2.x.

    This problem already exists when opening the (in the older made up version of wptools) document
    in wptools v6.2.x before we do any converting of the bookmark data.

    I'll attach a bitmap file which contains four screenshots, an attempt to visualize the problem en founding's.
    - Screenshot 1. (fail) Document A. made up in wptools 3.x (unclosed bookmark, with debug data)
    - Screenshot 2. (fail) Document A. made up in wptools 3.x (unclosed bookmark, without debug data)
    - Screenshot 3. (success) Document B. made up in wptools 3.x (closed bookmark, with debug data)
    - Screenshot 4. (success) Document B. made up in wptools 3.x (closed bookmark, without debug data)


    Is the above situation correct, plausible and understandable?
    If so... is there an workaround/fix for this problem? e.g.. how to 'close' unclosed bookmarks for example?

    If there is more information, explanation needed, please let me know ill try to provide it to you.


    Kind regards,

    R. Lichtendahl
    ENK Software BV.
    Europe - The Netherlands (+1GMT)


    [Blockierte Grafik: http://www.enk.nl/screenshot/wpTools6.png]

    • Offizieller Beitrag

    In the file I see that the bookmark is closed, but there is a lot of
    text inbetween and the nesting is wrong.

    Code
    {\tx1560 \ql\li0\fi0\ri0\sb0\sl\sa0{\*\bkmkstart data}\plain\f3\fs22\cf0 M\par}{\*\wptable}{\pard\trowd\trgaph0\trleft0\cellx37\cellx2948\cellx9638\intbl{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs22\cf0\b \cell}\intbl{\tx540 \ql\li0\fi0\ri0\sb0\sl\sa0 {\*\bkmkend data}\plain\f3\fs28\cf0\b OFFERTE\cell}

    Do you expect the bookmarks to be always be closed in the paragraph where they were started?

    In this case it is be possible to fix documents with this code:

    That code lists all Bookmarks and removes the closing Bookmarks which are not in the same paragraph. It then create a new clsoing at the end of the paragraph.

    Regards,
    Julian