You could move the 

    fIsMine = (pwallet->IsMine(txout) & filter);

to before the if statement (for example to the instantiation of the variable on line 767). This avoids repeating it twice here, and removes the need for the hard-to-read 'assignment in if() clause' below.