Reduce copy'n'paste by different nesting of if's.
Reduce copy'n'paste by different nesting of if's.

Change-Id: I9a68d585217550c1d229a2bc66d04e506253d747

JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core