Paula Badosa defeated Ash Barty in Charleston last month, but the world number one came out on top in the Spanish capital.