Magnetic field evolution leading to solar flares II. Cases with high magnetic shear and flare-related shear change