[Libreoffice] unusedcode.easy and debug build

Stephan Bergmann stephan.bergmann.secondary at googlemail.com
Sun Aug 28 03:53:02 PDT 2011


On Aug 27, 2011, at 2:04 AM, Markus Mohrhard wrote:
> I just had some problems with my debug build in ucb and discovered that at least one method only needed in a debug build has been removed. It seems it was mentionend on unusedcode.easy, so my question is how we should deal with these cases.
> 
> In this special case I removed the call for now, but I'm not quite sure if this is really what we want to do. Just adding it again won't help because it will be removed next time again. 
> http://cgit.freedesktop.org/libreoffice/core/commit/?id=888a4519c30bed7ca9896f367d5d48fae96bae2d
> 
> Can someone who understands ucb better than me decide if we should add this call again?

One approach would be to add ucbhelper::PropertyValueSet::getLength back in conditional #ifdef DEBUG.  However, in the given case, I think that's overkill:  Looking at Content::getPropertyValues, it looks like each pass through the nProps-for-loop, one value is appended to xRow, so the values displayed for xRow->getLength() and nProps will always be equal, anyway---or what am I missing?  So I would just remove the complete #ifdef DEBUG g_warning here.  (The current code, always printing zero, is of course unacceptable.)

-Stephan


More information about the LibreOffice mailing list