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


On Thu, 2011-02-24 at 09:57 -0500, Kevin Hunter wrote:
please do spit it back to me with, "you should implement 
it this way instead"

OString baseName =
OString(OUStringToOString( aFileObj.getName(INetURLObject::LAST_SEGMENT,
true, INetURLObject::DECODE_WITH_CHARSET),
RTL_TEXTENCODING_UTF8).getStr());

a) the .getStr() returns a sal_Char* and then you make a OString out of
it, while OUStringToOString already is OString so drop the .getStr()
b) OUStringToOString returns a OString, so drop the intermediate ctor
as well i.e. 
- Foo apple = Foo(...);
+ Foo apple(...);
c) I wouldn't bother with the aFileObj.HasError() and return 0, i.e. I'd
prefer to get some mangled/empty string as
the filename listed in the overwrite dialog, rather than returning out
of the whole method on failure

C.


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.