Question on dubious code

Michael Stahl mstahl at redhat.com
Mon Oct 7 07:11:36 PDT 2013


On 05/10/13 19:45, Matteo Casalin wrote:
> 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))

btw this is actually subtly wrong - URI schemes must be matched
case-insenitive whereas startsWith does a case-sensitive match.

there are probably a lot of such bugs in the code.

[don't have anything to add to Caolán's mail]

> 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.

the URL scheme is used in several places that store files inside a ODF
package, i haven't looked but it's possible there is some duplication
that could be abstracted out.




More information about the LibreOffice mailing list