[API] Some more cleanup ideas

Michael Stahl mstahl at redhat.com
Thu Nov 29 03:37:31 PST 2012

On 29/11/12 01:54, Thorsten Behrens wrote:
> Hi there,
> ploughing through offapi & cppumaker (the tool that generates the
> c++ headers), and so far did this:
>  * unpublished accessibility API
>  * renamed XAccessibleEventListener methods


>  * cleansed cppumaker of dead code, RTL_CONSTASCII verbosity, and
>    writing out exception specs

iirc we want to remove C++ exception specifications for production code
because they don't make sense there - but would it make sense to keep
them in --enable-dbgutil mode?  could be useful for debugging... after
all if an exception that isn't documented is thrown that's still a
violation of the API contract.

> There remain the following open questions:
>  * should we keep ~MyClass() {} throw() - or rather have just one
>    single proper virtual ~XInterface() {} throw in the base class
>    (note the missing virtual all over the place) - or bin all
>    exception specs unconditionally?

"throw ()" on a destructor does not hurt imho - it is not allowed to
throw anything in practice...
i'm not aware of any problems by relying on default dtor in derived
classes, but i'm sort of a mere user of C++ so what do i know anyway...

>  * should we kill [oneway] in IDL while at it? IIRC it went away in
>    the bridges anyway, via i#116038 or didn't it?
>  * a bit more extreme - kill ::com::sun::star inside office code, by
>    having a ~global "using namespace ::com::sun::star;" or
>    "namespace api = ::com::sun::star;" in e.g. sal/config.h, and
>    writing only _that_ out in the generated c++ headers?
>    (of course keep the old namespace for SDK. And yes, it's no new
>    idea, just a bit less extreme as what's proposed in the wiki)

we'd still need the full namespace in the headers bundled with the SDK,
so how would it work to have different one in headers used by LO build?
generate them twice?

why not have some LO header that is included everywhere contain a
"namespace css = com::sun::star;" and generate headers as before ?

More information about the LibreOffice mailing list