Questions about getCppuType
Noel Grandin
noel at peralex.com
Wed May 7 23:46:40 PDT 2014
On 2014-05-07 23:48, julien2412 wrote:
> In fact, my primary goal was to clean this use of getCppuType because it was
> reported by cppcheck (when they were used in if/else if blocks)
> Then I wanted to remove all of them. The problem is there are 33 Opengrok
> pages of these and I don't know enough about regexp to remove them quickly.
> I tried things like this:
> fgrep -lR 'getCppuType((const sal_Int32*)0)' |xargs -i sed -i
> 's/getCppuType[(][(]const sal_Int32[*])0)/cppu::UnoType<sal_Int32>::get()/g'
> {}
> But it's still too naive to get rid of them. (I wanted to put "const"
> optional but didn't even find how to do it)
>
> Any regexp wizard here?
>
>
This works for me:
git grep -lF "getCppuType((const sal_Int32*)0)" -- *.cxx | xargs perl -pi -w -e "s/getCppuType\(\(const
sal_Int32\*\)0\)/cppu::UnoType\<sal_Int32\>::get\(\)/g;"
Disclaimer: http://www.peralex.com/disclaimer.html
More information about the LibreOffice
mailing list