About macro VALIDTAB (sc module)

Kohei Yoshida kohei.yoshida at gmail.com
Tue Feb 12 17:09:55 PST 2013


On 02/12/2013 05:36 PM, julien2412 wrote:
> Hello,
>
> Getting this with cppcheck:
> sc/source/core/data/document.cxx
> 760	syntaxError	error	syntax error
>
> Here are the lines:
>      755 bool ScDocument::RenameTab( SCTAB nTab, const rtl::OUString& rName,
> bool /* bUpdateRef */,
>      756         bool bExternalDocument )
>      757 {
>      758     bool    bValid = false;
>      759     SCTAB   i;
>      760     if VALIDTAB(nTab)
>
> Then I get this:
> http://opengrok.libreoffice.org/xref/core/sc/inc/address.hxx#126
>      124 #define VALIDCOL(nCol)                  (ValidCol(nCol))
>      125 #define VALIDROW(nRow)                  (ValidRow(nRow))
>      126 #define VALIDTAB(nTab)                  (ValidTab(nTab))
>      127 #define VALIDCOLROW(nCol,nRow)          (ValidColRow(nCol,nRow))
>
> I suppose there's a reason for these macros but I must recognize I don't get
> it :-(

Actually I don't get the purpose of those macros either.  Anyway, I'm 
pretty sure that those macros are there for none other than some weird 
historical reasons.  I don't use them when writing new code, and try to 
replace them with the real methods whenever I can.  I hope that 
eventually we can totally get rid of them.

Kohei

-- 
Kohei Yoshida, LibreOffice hacker, Calc


More information about the LibreOffice mailing list