Hi Stephan,
Stephan Bergmann píše v St 22. 01. 2014 v 10:22 +0100:
I think there is better 
solutions for that, like providing a helper function to be called from 
the typical constructor function,
   css::uno::XInterface * acquire(cppu::OWeakObject * instance) {
     assert(instance != 0);
     instance->acquire();
     return instance;
   }
   css::uno::XInterface * FOO_constructor_function(...) {
     retrun acquire(new FOO(...));
   }
Thank you for reviewing! :-)  My problem with directly providing
arguments to the _constructor_function (and consequently to the C++
constructor) was that it was hard to distinguish whether the code
constructing the instance needs to work on an acquired interface, or
not, so thought that if we 'force' every initialization to work on the
acquired one, it leads to least trouble.
But if this is not a problem, and the implementer should be aware & make
the right choice, I am most happy; actually the resulting constructors
look really beautiful from my POV:
https://gerrit.libreoffice.org/7592
Thanks so much for this suggestion - if you are happy with the patch,
I'd push it ASAP to unbreak the Windows build...
All the best,
Kendy
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.