We are beginning Klal 4, where the Chyaei Adam discusses the issur of speaking divrei torah in front of ervah. This issur is independent of the problem of a person visualizing someone who is improperly dressed, as that is assur at any time, even when not davening or learning.
In the context of Klal Yisroel going to war, the Torah tells us that the Shechina should not see an ervas davar and therefore leave the encampment (Devarim 23:15). Chazel understand that the Torah uses the words ervas davar, as opposed to simply ervah, to teach us that at a moment in which a person is trying to come close to the Shechinah through speech (dibbur; i.e., learning or davening), it is assur to be opposite ervah.
The Chayei Adam writes that this issur includes not only the ervah of a woman, but also the ervah of another man, or of the person themselves (man or woman) who wish to recite divrei torah. It includes a married or single woman, and a Jewish or non-Jewish person.
The issur as we understand it from the pasuk above is specifically an issur regarding the presence of ervah. It goes without saying that if the person is distracted due to the ervah, there is an issur of hirhur as well.
Summary
- The issur of ervah is to speak words of torah or davening in the presence of ervah, regardless of a man, woman, Jew, non-Jew or even the person themselves.