Similarly, the person in the middle who makes the exchange possible just finds that his gateway A IOUs turn into gateway B IOUs, two conditions he prefers equally anyway.
This has an embedded assumption that has concerned me a bit about ripple from the start.
Just because I "trust" gateway A and gateway B does NOT necessarily mean that I have no preference over which IOUs I hold. I may well trust A a lot and only begrudgingly extend trust to B because I need to for some specific reason. In that circumstance there's no way I'd want IOUs I hold from A exchanged into ones from B involuntarily just to let someone else avoid having to trust B.
Now I know in theory I can avoid this to an extent - by micro-managing trust. But ideally I should be able to extend trust whilst locking it against being filled by any action other than my own (which would include filling of orders I had placed of course). Or alternatively I should be able to lock specific IOUs in so that they can't be changed to different ones - regardless of what other trust I have extended.
Note that my preference for A over B may not be because of an actual lack of "trust" - it could be for reasons such as A being faster at redeeming IOUs on request or A offering other non-ripple functionality that I used or A offering cheaper cashout. As it stands I can easily see a situation where I'd have to run multiple accounts with different trust profiles just to be able to swap my held IOUs BACK to my preferred debtors.