[dev] rtl::Reference vs. [com::sun::star::]uno::References

2007-07-10 Thread Kay Ramme - Sun Germany - Hamburg
Hi developers, Ause made me recently aware of the fact, that ambiguities regarding the RTL Reference type (sal/inc/rtl/ref.hxx - rtl::Reference) and the Uno Reference type (cppu/inc/com/sun/star/uno/Reference.h - com::sun::star::uno::Reference) are showing up more frequently, because of some

[dev] rtl::Reference vs. [com::sun::star::]uno::References

2007-07-10 Thread Kay Ramme - Sun Germany - Hamburg
Hi developers, Ause made me recently aware of the fact, that ambiguities regarding the RTL Reference type (sal/inc/rtl/ref.hxx - rtl::Reference) and the Uno Reference type (cppu/inc/com/sun/star/uno/Reference.h - com::sun::star::uno::Reference) are showing up more frequently, because of some

Re: [dev] rtl::Reference vs. [com::sun::star::]uno::References

2007-07-10 Thread Frank Schönheit - Sun Microsystems Germa ny
Hi Kay, > We assume, that people using "using rtl;" mostly intend to use the RTL > string That's my experience, too. Whenever I stumbled upon the problem you described, replacing "using namespace rtl" with "using ::rtl::OUString" fixed it. > and string buffer classes. Therefor we suggest to jus

Re: [dev] rtl::Reference vs. [com::sun::star::]uno::References

2007-07-10 Thread Mathias Bauer
Kay Ramme - Sun Germany - Hamburg wrote: > Hi developers, > > Ause made me recently aware of the fact, that ambiguities regarding the > RTL Reference type (sal/inc/rtl/ref.hxx - rtl::Reference) and the Uno > Reference type (cppu/inc/com/sun/star/uno/Reference.h - > com::sun::star::uno::Referen

Re: [dev] rtl::Reference vs. [com::sun::star::]uno::References

2007-07-10 Thread Andreas Schlüns
Hello, why not preventing "using namespace" in general and using namespace alias instead ... E.g. #include #include #include namespace css = ::com::sun::star; void test() { css::uno::Reference< css::uno::XInterface > xFoo; ::rtl::OUString sFoo; ::rtl::Reference< ...

Re: [dev] rtl::Reference vs. [com::sun::star::]uno::References

2007-07-10 Thread Frank Schönheit - Sun Microsystems Germa ny
Hi Andreas, > why not preventing "using namespace" in general As a general rule? No, I wouldn't like to impose this on everybody, this is an unnecessary restriction, IMO. As a personal habit? Well, why not. > and using namespace alias instead ... > ... Personally, my preferred solution is a seq

Re: [dev] rtl::Reference vs. [com::sun::star::]uno::References

2007-07-10 Thread Andreas Schlüns
Hi Frank, Hi Andreas, why not preventing "using namespace" in general As a general rule? No, I wouldn't like to impose this on everybody, this is an unnecessary restriction, IMO. As a personal habit? Well, why not. It was not realy thought as "general rule" .-) And yes ... it's my preferre

Re: [dev] rtl::Reference vs. [com::sun::star::]uno::References

2007-07-11 Thread Thorsten Behrens
Frank Schönheit - Sun Microsystems Germany <[EMAIL PROTECTED]> writes: > As a related note, I sometimes got the impression (I never was able to > track this to the root cause) that there must be headers involved which > contain a "using namespace ...". I suggest we add this to our coding > guideli

Re: [dev] rtl::Reference vs. [com::sun::star::]uno::References

2007-07-11 Thread Thorsten Behrens
Mathias Bauer <[EMAIL PROTECTED]> writes: > Honestly speaking I doubt that the three letters "rtl" are worth a > "using" declaration at all. I always prefer to use the fully qualified > names. In conjunction with "using namespace com::sun::star" as the only > "using" directive in my files I never

Re: [dev] rtl::Reference vs. [com::sun::star::]uno::References

2007-07-11 Thread Kay Ramme - Sun Germany - Hamburg
Guys, my originally mail was not meant to press anybody into any corset, but just to solve the noticed problems regarding the usage of using "using rtl;" :-) Some of the reasons for the namespace problems we are facing are IMHO simply non optimal placings, e.g. "com::sun::uno::Reference" wou

Re: [dev] rtl::Reference vs. [com::sun::star::]uno::References

2007-07-11 Thread Takashi Ono
In message "Re: [dev] rtl::Reference vs. [com::sun::star::]uno::References", Andreas_Schl・s wrote... > From my point of view there can be one "general rule" only: >prevent using of "incomplete" namespace declarations. >Means: >- do not use &quo

Re: [dev] rtl::Reference vs. [com::sun::star::]uno::References

2007-07-11 Thread Philipp Lohmann
Hi, just as a side note: which added value does rtl::Reference provide over boost::shared_ptr anyway ? Kind regards, pl -- If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime. -- Author unknown --

Re: [dev] rtl::Reference vs. [com::sun::star::]uno::References

2007-07-11 Thread Stephan Bergmann
Philipp Lohmann wrote: Hi, just as a side note: which added value does rtl::Reference provide over boost::shared_ptr anyway ? rtl::Reference requirs T to have acquire() and release(), whereas boost::shared_ptr manages the refcount externally . That makes rtl::Reference a good fit when hold

Re: [dev] rtl::Reference vs. [com::sun::star::]uno::References

2007-07-11 Thread Hubert Figuiere
On Wed, 2007-07-11 at 18:22 +0200, Stephan Bergmann wrote: > Philipp Lohmann wrote: > > Hi, > > > > just as a side note: which added value does rtl::Reference provide over > > boost::shared_ptr anyway ? > > rtl::Reference requirs T to have acquire() and release(), whereas > boost::shared_ptr ma

Re: [dev] rtl::Reference vs. [com::sun::star::]uno::References

2007-07-11 Thread Thorsten Behrens
Hubert Figuiere <[EMAIL PROTECTED]> writes: > On Wed, 2007-07-11 at 18:22 +0200, Stephan Bergmann wrote: > > Philipp Lohmann wrote: > > > just as a side note: which added value does rtl::Reference provide over > > > boost::shared_ptr anyway ? > > > > rtl::Reference requirs T to have acquire() an

Re: [dev] rtl::Reference vs. [com::sun::star::]uno::References

2007-07-11 Thread Philipp Lohmann
Hi, regarding that example I would normally do Something* pS = new Something(); css::uno::Reference x( pS ); pS->privateNonUnoFunction(); Even if privateNonUnoFunction does somehow influence the refcount of the object this has kept the reference. However you explained the difference between

Re: [dev] rtl::Reference vs. [com::sun::star::]uno::References

2007-07-12 Thread Stephan Bergmann
Philipp Lohmann wrote: Hi, regarding that example I would normally do Something* pS = new Something(); css::uno::Reference x( pS ); pS->privateNonUnoFunction(); I would consider the approach I showed below more robust (code that can throw slipping in between the first two lines, someone remo

Re: [dev] rtl::Reference vs. [com::sun::star::]uno::References

2007-07-12 Thread Takashi Ono
In message "Re: [dev] rtl::Reference vs. [com::sun::star::]uno::References", Stephan Bergmann wrote... >Philipp Lohmann wrote: >> Hi, >> >> regarding that example I would normally do >> >> Something* pS = new Something(); >> css::uno:

Re: [dev] rtl::Reference vs. [com::sun::star::]uno::References

2007-07-13 Thread Oliver Braun
Kay Ramme - Sun Germany - Hamburg wrote: Some of the reasons for the namespace problems we are facing are IMHO simply non optimal placings, e.g. "com::sun::uno::Reference" would have belonged into "cppu" ("cppu::Reference" or may be simply "uno::Reference". As probably most people agree with, t

Re: [dev] rtl::Reference vs. [com::sun::star::]uno::References

2007-07-13 Thread Philipp Lohmann
Ok, for the nitpickers: Something* pS = NULL; css::uno::Reference x( ps = new Something() ); pS->privateNonUnoFunction(); ;-) Kind regards, pl Stephan Bergmann wrote: Philipp Lohmann wrote: Hi, regarding that example I would normally do Something* pS = new Something(); css::uno::Reference

Re: [dev] rtl::Reference vs. [com::sun::star::]uno::References

2007-07-19 Thread Kay Ramme - Sun Germany - Hamburg
Ollie, sorry for not replying earlier. Oliver Braun wrote: Kay Ramme - Sun Germany - Hamburg wrote: Some of the reasons for the namespace problems we are facing are IMHO simply non optimal placings, e.g. "com::sun::uno::Reference" would have belonged into "cppu" ("cppu::Reference" or may be s