View | Details | Raw Unified | Return to issue 122027
Collapse All | Expand All

(-)a/main/sc/source/ui/view/formatsh.cxx (-41 / +45 lines)
Lines 1105-1151 void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq ) Link Here
1105
			break;
1105
			break;
1106
1106
1107
		case SID_NUMBER_TYPE_FORMAT:
1107
		case SID_NUMBER_TYPE_FORMAT:
1108
			{
1108
            if ( pReqArgs )
1109
				SfxInt16Item aFormatItem((const SfxInt16Item&)rReq.GetArgs()->Get(nSlot));
1109
            {
1110
				sal_uInt16 nFormat = aFormatItem.GetValue();
1110
                const SfxPoolItem* pItem;
1111
				switch(nFormat)
1111
                if ( pReqArgs->GetItemState( nSlot, sal_True, &pItem ) == SFX_ITEM_SET )
1112
				{
1112
                {
1113
				case 0:
1113
                    sal_uInt16 nFormat = ((SfxInt16Item *)pItem)->GetValue();
1114
					pTabViewShell->SetNumberFormat( NUMBERFORMAT_NUMBER); //Modify
1114
                    switch(nFormat)
1115
					break;
1115
                    {
1116
				case 1:
1116
                    case 0:
1117
					pTabViewShell->SetNumberFormat( NUMBERFORMAT_NUMBER, 2 ); //Modify
1117
                        pTabViewShell->SetNumberFormat( NUMBERFORMAT_NUMBER); //Modify
1118
					break;
1118
                        break;
1119
				case 2:
1119
                    case 1:
1120
					pTabViewShell->SetNumberFormat( NUMBERFORMAT_PERCENT );
1120
                        pTabViewShell->SetNumberFormat( NUMBERFORMAT_NUMBER, 2 ); //Modify
1121
					break;
1121
                        break;
1122
				case 3:
1122
                    case 2:
1123
					pTabViewShell->SetNumberFormat( NUMBERFORMAT_CURRENCY );
1123
                        pTabViewShell->SetNumberFormat( NUMBERFORMAT_PERCENT );
1124
					break;
1124
                        break;
1125
				case 4:
1125
                    case 3:
1126
					pTabViewShell->SetNumberFormat( NUMBERFORMAT_DATE );
1126
                        pTabViewShell->SetNumberFormat( NUMBERFORMAT_CURRENCY );
1127
					break;
1127
                        break;
1128
				case 5:
1128
                    case 4:
1129
					pTabViewShell->SetNumberFormat( NUMBERFORMAT_TIME );
1129
                        pTabViewShell->SetNumberFormat( NUMBERFORMAT_DATE );
1130
					break;
1130
                        break;
1131
				case 6:
1131
                    case 5:
1132
					pTabViewShell->SetNumberFormat( NUMBERFORMAT_SCIENTIFIC );
1132
                        pTabViewShell->SetNumberFormat( NUMBERFORMAT_TIME );
1133
					break;
1133
                        break;
1134
				case 7:
1134
                    case 6:
1135
					pTabViewShell->SetNumberFormat( NUMBERFORMAT_FRACTION );
1135
                        pTabViewShell->SetNumberFormat( NUMBERFORMAT_SCIENTIFIC );
1136
					break;
1136
                        break;
1137
				case 8:
1137
                    case 7:
1138
					pTabViewShell->SetNumberFormat( NUMBERFORMAT_LOGICAL );
1138
                        pTabViewShell->SetNumberFormat( NUMBERFORMAT_FRACTION );
1139
					break;
1139
                        break;
1140
				case 9:
1140
                    case 8:
1141
					pTabViewShell->SetNumberFormat( NUMBERFORMAT_TEXT );
1141
                        pTabViewShell->SetNumberFormat( NUMBERFORMAT_LOGICAL );
1142
					break;
1142
                        break;
1143
				default:
1143
                    case 9:
1144
					;
1144
                        pTabViewShell->SetNumberFormat( NUMBERFORMAT_TEXT );
1145
				}	
1145
                        break;
1146
				rReq.Done();
1146
                    default:
1147
			}
1147
                        ;
1148
			break;
1148
                    }
1149
                    rReq.Done();
1150
                }
1151
            }
1152
            break;
1149
1153
1150
        default:
1154
        default:
1151
			DBG_ERROR("falscher Slot bei ExecuteEdit");
1155
			DBG_ERROR("falscher Slot bei ExecuteEdit");

Return to issue 122027