if (oldValue.equals(BT6)) newValue = BT6;
if (oldValue.equals(BT6)) newValue = BT7;
if (oldValue.equals(BT7)) newValue = BT1;
} else
if (oldValue instanceof PropertyValue){
PropertyValue newVal = new PropertyValue();
newVal.Name = ((PropertyValue)oldValue).Name;
newVal.Value = changePValue(((PropertyValue)oldValue).Value);
newValue = newVal;
} else
if (oldValue instanceof com.sun.star.sheet.ValidationAlertStyle){
com.sun.star.sheet.ValidationAlertStyle VAS1 = com.sun.star.sheet.ValidationAlertStyle.INFO;
com.sun.star.sheet.ValidationAlertStyle VAS2 = com.sun.star.sheet.ValidationAlertStyle.MACRO;
com.sun.star.sheet.ValidationAlertStyle VAS3 = com.sun.star.sheet.ValidationAlertStyle.STOP;
com.sun.star.sheet.ValidationAlertStyle VAS4 = com.sun.star.sheet.ValidationAlertStyle.WARNING;
if (oldValue.equals(VAS1)) newValue = VAS2;
if (oldValue.equals(VAS2)) newValue = VAS3;
if (oldValue.equals(VAS3)) newValue = VAS4;
if (oldValue.equals(VAS4)) newValue = VAS1;
} else
if (oldValue instanceof com.sun.star.sheet.ValidationType){
com.sun.star.sheet.ValidationType VT1 = com.sun.star.sheet.ValidationType.ANY;
com.sun.star.sheet.ValidationType VT2 = com.sun.star.sheet.ValidationType.CUSTOM;
com.sun.star.sheet.ValidationType VT3 = com.sun.star.sheet.ValidationType.DATE;
com.sun.star.sheet.ValidationType VT4 = com.sun.star.sheet.ValidationType.DECIMAL;
com.sun.star.sheet.ValidationType VT5 = com.sun.star.sheet.ValidationType.LIST;
com.sun.star.sheet.ValidationType VT6 = com.sun.star.sheet.ValidationType.TEXT_LEN;
com.sun.star.sheet.ValidationType VT7 = com.sun.star.sheet.ValidationType.TIME;
com.sun.star.sheet.ValidationType VT8 = com.sun.star.sheet.ValidationType.WHOLE;
if (oldValue.equals(VT1)) newValue = VT2;
if (oldValue.equals(VT2)) newValue = VT3;
if (oldValue.equals(VT3)) newValue = VT4;
if (oldValue.equals(VT4)) newValue = VT5;
if (oldValue.equals(VT5)) newValue = VT6;
if (oldValue.equals(VT6)) newValue = VT7;
if (oldValue.equals(VT7)) newValue = VT8;
if (oldValue.equals(VT8)) newValue = VT1;
} else
if (oldValue instanceof com.sun.star.text.WritingMode){
if (oldValue.equals(com.sun.star.text.WritingMode.LR_TB)) {
newValue = com.sun.star.text.WritingMode.TB_RL;
} else {
newValue = com.sun.star.text.WritingMode.LR_TB;
}
} else
if (oldValue instanceof com.sun.star.uno.Enum) {
// universal changer for Enumerations
try {
Class enumClass = oldValue.getClass() ;
Field[] flds = enumClass.getFields() ;
newValue = null ;
for (int i = 0; i < flds.length; i++) {
if (Enum.class.equals(flds[i].getType().getSuperclass())) {
Enum value = (Enum) flds[i].get(null) ;
if (newValue == null && !value.equals(oldValue)) {
newValue = value ;
break ;
}
}
}
} catch (Exception e) {
System.err.println("Exception occured while changing Enumeration value:") ;
e.printStackTrace(System.err) ;
}
if (newValue == null) newValue = oldValue ;
} else
if (oldValue instanceof com.sun.star.style.TabStop[]){
com.sun.star.style.TabStop[] _newValue = (com.sun.star.style.TabStop[]) oldValue;
if (_newValue.length == 0) {
_newValue = new com.sun.star.style.TabStop[1];
}
com.sun.star.style.TabStop sep = new com.sun.star.style.TabStop();
sep.Position += 1;
_newValue[0] = sep;
newValue = _newValue;
} else
if (oldValue instanceof short[]){
short[] oldArr = (short[])oldValue;
int len = oldArr.length;
short[] newArr = new short[len + 1];
for (int i = 0; i < len; i++) {
newArr[i] = (short)(oldArr[i] + 1);
}
newArr[len] = 5;
newValue = newArr;
} else
if (oldValue instanceof String[]){
String[] oldArr = (String[])oldValue;
int len = oldArr.length;
String[] newArr = new String[len + 1];
for (int i = 0; i < len; i++) {
newArr[i] = "_" + oldArr[i];
}
newArr[len] = "_dummy";
newValue = newArr;
} else
if (oldValue instanceof PropertyValue){
PropertyValue newVal = new PropertyValue();
newVal.Name = ((PropertyValue)oldValue).Name;
newVal.Value = changePValue(((PropertyValue)oldValue).Value);
newValue = newVal;
} else
if (oldValue instanceof com.sun.star.util.DateTime) {