Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hey Julien,

2013/1/20 julien2412 <serval2412@yahoo.fr>:
Hello,

Cppcheck reported this:
sd/source/filter/eppt/pptx-text.cxx
1235    copyCtorPointerCopying  style   Value of pointer 'mpImplTextObj', which
points to allocated memory, is copied in copy constructor instead of
allocating new memory.

   1233 TextObj::TextObj( const TextObj& rTextObj )
   1234 {
   1235     mpImplTextObj =
const_cast<TextObj&amp;>(rTextObj).mpImplTextObj;
   1236     mpImplTextObj->mnRefCount++;
   1237 }

I must recognize I don't know what to think about this since I know too
little about C++.
Something is wrong here or just a false positive?


While the comment is correct it is not really an error in this case.
Someone implemented here manualy ref counting. If you want to remove
the warning you can replace the raw pointer + the ref counting
variable with a  boost::shared_ptr.

Regards,
Markus

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.