[Libreoffice] Question about using namespace ::com::sun::star::uno

Julien Nabet serval2412 at yahoo.fr
Sun Mar 6 14:14:50 PST 2011

Le 04/03/2011 23:48, Julien Nabet a écrit :
> Hello,
> I just finished the removing of using reference ::rtl:: in each 
> directory (binfilters included).
> I'd like to be sure of what has to be done for "::com::sun::star::uno" 
> part
> 1) remove "using namespace ::com::sun::star::uno" ok
> 2) replace "Reference" by "uno::Reference" ok
> 3) But what about "use ::com::sun::star" ? Must we replace this :
> using namespace ::com::sun::star::uno
> by this :
> using ::com::sun::star
> ?
> Julien.

I attached a patch which is a first try.
The patched file, sc/source/filter/xml/xmlstyli.cxx already had
using com::sun::star::uno::Reference;
but he had too :
using namespace ::com::sun::star:uno;

So I removed the using namespace and had to add :
using com::sun::star::uno::UNO_QUERY;
for the compilation.
Is this patch ok ?

If it's ok, 2 remarks :
1) this file also has this :
using namespace ::com::sun::star;
using namespace ::com::sun::star::xml::sax;
using namespace ::com::sun::star::style;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
Is the Reference problem which needs the removing of "using namespace 
::com::sun::star::uno" the only one or may there be some others "using 
namespace" to remove ?
I read in some websites that it's better to remove "using namespace" in 
include files to avoid conflicts.

2) like the other replacement (using namespace ::rtl), the changes will 
certainly give some errors that i won't see since, obviously, i don't 
compile with all environments and all the combinations of options. The 
pb is there may be a lot more errors than when i made replacements for 
using namespace ::rtl.

Some ideas/remarks ?

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: commit-7eb6236
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110306/e8d19353/attachment.ksh>

More information about the LibreOffice mailing list