Wow! I would never have thought that this could actually be a discussion. There is no way to justify learning a sefer during the Rav’s speach (ESPECIALLY IF HE IS WITHIN EYESIGHT)! If a person feels he is not going to gain anything, Torah-wise, by listening he should listen anyways and thus gain tremendously in the realm of middos.