Al-Qaasim ibn Salaam, in his book الناسخ والمنسوخ في القرآن والسنة, page 112, reports this hadeeth as evidence for this claim,
حدثنا يزيد بن هارون، عن يحيى بن سعيد، عن حميد بن نافع، أنه سمع زينب بنت أبي سلمة تحدث عن أم سلمة وأم حبيبة أن امرأة أتت النبي صلى الله عليه وسلم فذكرت أن ابنة لها توفي عنها زوجها، واشتكت عينها، فهي تريد أن تكتحلها، فقال رسول الله صلى الله عليه وسلم: قد كانت إحداكن ترمي بالبعرة عند رأس الحول، وإنما هي أربعة أشهر وعشرا.
قال: قال حميد: فسألت زينب: ومارميها بالبعرة؟ فقالت: كانت المرأه في الجاهلية إذا توفي عنها زوجها عمدت إلى شر بيت لها فجلست فيه سنة، فإذا مرت سنة خرجت ورمت ببعرة من ورائها.
قال أبو عبيد: مذهبها في رمي البعرة أن الذي صنعت بنفسها من قعودها أهون عليها من بعرة.
اهـ
Brief translation:
A woman came to the Prophet, peace be upon him, and told him about a daughter of hers who wanted to get out of the house so she can apply eye liner to cure her eye. He said, "You women used to throw dung at year end. No, it's four months and ten days."
The narrator, Hameed, asked Zaynab bint Abi-Salama, the woman who told him this story what is that business of throwing dung. She told him that it was the custom of a widow in the pre-Islamic era to stay at the worst house she can find for a year then after a year throw dung behind her when she leaves it. Meaning, Abu-Ubayd said, that the way she tormented herself in grief means less to her than dung.
This hadeeth is reported by all six top Hadeeth reporters, as well as Maalik, Ibn Hanbal and Al-Hameedi.
The story does not prove that 2:240 was abrogated; it only proves that the pre-Islamic custom of mourning for a year was. 2:240 does not talk about mourning, it talks about provision of finances and housing for the widow. It is 2:234 that talks about mourning and the hadeeth confirms it.