I have found this other example similar to the one you mentioned above.
"The accused man refused to speak until he had spoken to the judge."
I think the use of the Past Perfect here is not that of expressing a fact of the past but a non-factual event.
It's like when we say:
"He wishes he had spoken to the judge".
"If I had money, I would fly to Spain" means I don't have money now, but I imagine if I have money (now or in future) I would fly to Spain.
"If I had (had) money, I would have flown to Spain" refers a past incident. I had no money then, so I could not fly to Spain and I regret on that.
I think I am right. If any one has any other meaning, ...