[Libreoffice] Question about using namespace ::com::sun::star::uno
kyoshida at novell.com
Mon Mar 7 12:03:25 PST 2011
On Mon, 2011-03-07 at 20:39 +0100, Bjoern Michaelsen wrote:
> On Mon, 07 Mar 2011 10:45:08 -0500
> Kohei Yoshida <kyoshida at novell.com> wrote:
> > Even with "using namespace ::com::sun::star::uno", it's not clear that
> > we want to remove this from all source files. I would rather we
> > decide on a file-by-file basis, when we get a build issue due to
> > symbol name clash on some platforms.
> For PCH the problem should already be solved by killing all "using
> namespace ::rtl" and "using ::rtl::Reference" and deciding that the
> _only_ "Reference" that is allowed to be imported into the namespace is
> the one from ::c::s::s::u. Still, being explicit about an
> uno::Reference is not bad IMHO.
Yeah, although if you have to type a lot of it along with UNO_QUERY it
becomes a bit cumbersome to type
uno::Reference<container::XFoo> xSomeRef(SomeThing, uno::UNO_QUERY);
Reference<container::XFoo> xSomeRef(SomeThing, UNO_QUERY);
Especially these two symbols are used a lot when you work in a code that
is heavily UNO-centric.
Still, I agree with the removal of using namespace com::sun::star::uno.
I'm just not sure about spelling out the uno::Reference part... My
thinking is that, if the existing file already specifies "using
com::sun::star::uno::Reference", then I'd rather we leave that as-is
rather than replacing each use of Reference with uno::Reference.
Kohei Yoshida, LibreOffice hacker, Calc
<kyoshida at novell.com>
More information about the LibreOffice