It could be a number of things causing it. All my life I have had random outbreaks of hives/swelling which usually came and went without ever really determining the cause. However don't discount the Bactrim just because she has been on it for awhile. I have developed several allergies to medications that I had taken for years prior with no reaction. If it does turn out to be a medication allergy, it does not necessarily mean that Maggie can't take the medicine, she may just have to be desensitized to it. I have this done on a pretty regular basis when I go on oral abx because I am allergic to so many.
I hope that you figure it out soon and that Maggie starts to feel better!