Moldavia. Another factor contributing to the Ottoman pullout were the successes of the Russians, leading to their takeover of Chyhyryn and subjugation of Doroshenko. The outcome of the warfare was determined by the campaign of 1676, in conjunction with the negotiations and diplomatic activity that followed. The Ottoman army entered Pokuttya and moving up the Dniester River was confronted by King Sobieski at the Battle of Żurawno. The outnumbered Poles withstood two weeks of enemy assaults, after which a truce was agreed on through French mediation. It had still left Podolia with Kamieniec, Bratslav and other areas in Turkish hands. Ukrainian fortresses had to be given up in light of Ottoman successes in the war with Russia. Therefore, from the Commonwealth point of view, the Żurawno treaty constituted no more than a temporary armistice. Peace with Turkey was however the aim of John III Sobieski, who, faced with a new situation in Europe after the Treaty of the Pyrenees, wished to pursue an ambitious policy in the more crucial for the Commonwealth Baltic Sea area. France had become the greatest European power and seeking further hegemony was looking for alliances against its competitors. The Ottoman Empire and Sweden were already important for France as anti-Habsburg components, and the Commonwealth, in peace with Sweden after the Treaty of Oliva, became the next candidate. Poland had however traditionally been linked to Austria, and trying to break this relationship, which had many magnate supporters, filled the time of the reign of Louis XIV. The pro-French camp was formed in Poland already in the 1660s, in part upon the prodding by Queen Marie Louise, and Jan Sobieski was its member. Their plans of electing a French minded candidate for the Commonwealth crown became frustrated when Michał Korybut Wiśniowiecki married Eleonora Maria of Austria. The protracted Polish-Ottoman fighting suited Vienna politicians well, since protected on the southeastern flank by the Commonwealth's involvement, they were able to commit fully to the war with France. The 1674 election of John Sobieski, married to the French-born Marie Louise, appeared to have strengthened the pro-French faction decisively. A secret Treaty of Yavoriv was signed a year later between the Polish king and Louis XIV, providing for French compensation for a planned war against Frederick William and his Margraviate of Brandenburg, doubled in case of a war also with Austria. Poland was going to cooperate militarily with Sweden and be