This is what I have figured out so far. It seems to work.
Before generating new code from CubeMX.
Copy the SW4STM32 Directory
Generate new CubeMX code
Delete the SW4STM32 Directory created by CubeMX
Rename or Copy the original Directory back to SW4STM32
Go into the Project Explorer in Eclipse (OpenSTM32) and Refresh the Project (F5).
The project now compiles with the original files and settings.