I would have thought that the airline staff would give the op-up to "their own" first and only resort to the code shares if there was no other option?
This would make sense but since we are talking airlines here I would quickly forget about this theory.