Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi all,
in sw/source/core/graphic/ndgrf.cxx I stepped into the following code in function lcl_GetStreamStorageNames (this is after OUString conversion):

    const OUString aProt( "vnd.sun.star.Package:" );
    if (sUserData.startsWith(aProt))
    {
        // 6.0 (XML) Package
        const sal_Int32 nPos = sUserData.indexOf('/');
        if (nPos<0)
        {
            aNames.sStream = sUserData.copy(aProt.getLength());
        }
        else
        {
            sal_Int32 nPathStart = aProt.getLength();
            if (sUserData.startsWith("./"))
                nPathStart += 2;
aNames.sStorage = sUserData.copy( nPathStart, nPos-nPathStart );
            aNames.sStream = sUserData.copy( nPos+1 );
        }
    }

which looks wrong to me since aUserData cannot start with both aProt and ".". I had a look at older revisions, but the logic remains the same at least from when it was integrated in 2005 with commit 4fdb2d2cb198e7ea85d1293333d96a6c26b50323.

Does anybody knows ho to deal with this (the comparison with "./" should be done after aProt, is completely unnecessary, or something else)?

Thanks and kind regards
Matteo

PS: with OpenGrok I found some other locations in which "vnd.sun.star.Package:" is used, with also #define in two header files:

include/editeng/unoprnms.hxx
include/toolkit/controls/unocontrols.hxx

I don't have the necessary background, but maybe there could be some room for sharing code.

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.