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


Hi,
today I cleaned up the code in the directory "sw/source/core/attr/"
and saw some things I am not sure about. Since I guess that it will
not cost much time for an experienced LO dev to look at those "curious
facts", I post them here on the list:

(1) Where should I put documentation?
At the moment I just translate every (German) text I find in the
source files into English. But I was wondering if this is useful...
Where does Doxygen look for documentation? Header file declarations or
directly at the function implementation?

=> sw/source/core/attr/calbck.cxx
(2) The two functions "SwClient* SwClientIter::First" and "SwClient*
SwClientIter::Last" seem to differ in their logic. Same seems to be
true for "SwClientIter::Next" and "SwClientIter::Previous". Or is this
marginal change in each case correct? Can please anyone more
experienced than me take a quick look at those functions?

=> sw/source/core/attr/cellatr.cxx
(3) The switch statement in "SwTblBoxFormula::ChangeState" has no
default case. This might be helpful to capture bogus behaviour...
(4) The function "SwTblBoxFormula::Calc" has only an "if" statement
with no "else" case and also no other code outside. Is this intended?
If so, wouldn't it be more readable if the logic is reversed, e.g.
"if( rCalcPara.rCalc.IsCalcError() ) return; //explanation why", and
everything else is written without being in an "if" block?

=> sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx
(5) The switch statement in "SwFmtWrapInfluenceOnObjPos::QueryValue"
has only one case and thus can be replaced by an if/else; same for
switch statement in "SwFmtWrapInfluenceOnObjPos::PutValue".
See <https://gerrit.libreoffice.org/#/c/251/>.

=> sw/source/core/attr/format.cxx
(7) Switch case 0 in "SwFmt::Modify" seems to be strange since it
seems to be unexpected (from the comment) but returns directly without
logging an error or the like...

Hope you all enjoy your weekend!
Cheers,
Philipp

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.