[WIP] Remove boost dependency in sc/source/filter/excel/excimp8.cxx

Stephan Bergmann sbergman at redhat.com
Mon Sep 14 02:53:52 PDT 2015


On 09/14/2015 12:07 AM, Daniel wrote:
>> Should i modify it to return XclImpAutoFilterSharePtr instead?
>
> I personally wouldn't. I would use std::shared_ptr::get()
> (http://en.cppreference.com/w/cpp/memory/shared_ptr/get)

Sounds reasonable if the result of GetByTab is only ever used 
immediately afterwards to make calls on the returned 
XclImpAutoFilterData, and not stored away for future use (which indeed 
appears to be the case here).

Two more random comments:

*  I think it is better to avoid trivial typedefs like

> typedef std::shared_ptr<XclImpAutoFilterData> XclImpAutoFilterSharePtr;

and instead spell it out where used (and rather try to keep the number 
of places where to spell it out low with "auto").  Makes it immediately 
obvious to the reader that this is indeed just a std::shared_ptr and not 
some elaborate, home-grown class with semantics subtly different from 
std::shared_ptr.

*  I think it isn't even necessary here to go with shared_ptr, a

   std;;vector<std:;unique_ptr<XclImpAutoFilterData>> maFilters;

should already do (given the above decision to keep returning a raw ptr 
from GetByTab).  (It looks like even a direct

   std::vector<XclImpAutoFilterData> maFilters;

would do, if it were not for the missing 
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4371.html> 
"Minimal incomplete type support for standard containers, revision 2.")


More information about the LibreOffice mailing list