Commit 8e8c02a7 authored by Dylan Smith's avatar Dylan Smith Committed by Alexandre Julliard

wordpad: Sort tab stops by numeric value rather than as string.

The bug could be seen by inserting tabs stops 1cm, 2cm, & 10cm. The 10cm tab stop would be inserted before 2cm since the comparison isn't based on the numeric value.
parent 0292135a
......@@ -150,7 +150,7 @@ Caption "Tabulatorer"
FONT 8, "MS SHell DLg"
BEGIN
GROUPBOX "Tabulatorstop", -1, 10, 10, 120, 90
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE
DEFPUSHBUTTON "&Tilfj", ID_TAB_ADD, 20, 80, 45, 15
PUSHBUTTON "&Fjern", ID_TAB_DEL, 72, 80, 45, 15
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
......
......@@ -152,7 +152,7 @@ Caption "Tabstopps"
FONT 8, "MS SHell DLg"
BEGIN
GROUPBOX "Tabstoppposition", -1, 10, 10, 120, 90
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE
DEFPUSHBUTTON "&Festlegen", ID_TAB_ADD, 20, 80, 45, 15
PUSHBUTTON "&Löschen", ID_TAB_DEL, 72, 80, 45, 15
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
......
......@@ -150,7 +150,7 @@ Caption "Tabs"
FONT 8, "MS SHell DLg"
BEGIN
GROUPBOX "Tab stops", -1, 10, 10, 120, 90
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE
DEFPUSHBUTTON "&Add", ID_TAB_ADD, 20, 80, 45, 15
PUSHBUTTON "&Remove", ID_TAB_DEL, 72, 80, 45, 15
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
......
......@@ -150,7 +150,7 @@ Caption "Tabulations"
FONT 8, "MS SHell DLg"
BEGIN
GROUPBOX "Arrts de tabulation", -1, 10, 10, 120, 90
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE
DEFPUSHBUTTON "&Ajouter", ID_TAB_ADD, 20, 80, 45, 15
PUSHBUTTON "&Supprimer", ID_TAB_DEL, 72, 80, 45, 15
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
......
......@@ -150,7 +150,7 @@ Caption "Tabs"
FONT 8, "MS SHell DLg"
BEGIN
GROUPBOX "Tab stops", -1, 10, 10, 120, 90
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE
DEFPUSHBUTTON "&Add", ID_TAB_ADD, 20, 80, 45, 15
PUSHBUTTON "&Remove", ID_TAB_DEL, 72, 80, 45, 15
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
......
......@@ -153,7 +153,7 @@ CAPTION "タブの設定"
FONT 9, "MS Shell Dlg"
BEGIN
GROUPBOX "タブの停止位置(&T)", -1, 10, 10, 120, 90
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE
DEFPUSHBUTTON "追加(&A)", ID_TAB_ADD, 20, 80, 45, 15
PUSHBUTTON "削除(&R)", ID_TAB_DEL, 72, 80, 45, 15
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
......
......@@ -152,7 +152,7 @@ Caption "탭"
FONT 9, "MS Shell Dlg"
BEGIN
GROUPBOX "탭 정지", -1, 10, 10, 120, 90
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE
DEFPUSHBUTTON "더하기(&A)", ID_TAB_ADD, 20, 80, 45, 15
PUSHBUTTON "지우기(&R)", ID_TAB_DEL, 72, 80, 45, 15
PUSHBUTTON "확인(&O)", IDOK, 137, 15, 50, 15
......
......@@ -151,7 +151,7 @@ Caption "Tabs"
FONT 8, "MS SHell DLg"
BEGIN
GROUPBOX "Tab stops", -1, 10, 10, 120, 90
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE
DEFPUSHBUTTON "&Toevoegen", ID_TAB_ADD, 20, 80, 45, 15
PUSHBUTTON "&Verwijderen", ID_TAB_DEL, 72, 80, 45, 15
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
......
......@@ -150,7 +150,7 @@ Caption "Tabulatorer"
FONT 8, "MS SHell DLg"
BEGIN
GROUPBOX "Tabulatorstopp", -1, 10, 10, 120, 90
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE
DEFPUSHBUTTON "&Legg til", ID_TAB_ADD, 20, 80, 45, 15
PUSHBUTTON "&Fjern", ID_TAB_DEL, 72, 80, 45, 15
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
......
......@@ -151,7 +151,7 @@ Caption "Tabulatory"
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "Pozycje tabulatorw", -1, 10, 10, 120, 90
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE
DEFPUSHBUTTON "&Dodaj", ID_TAB_ADD, 20, 80, 45, 15
PUSHBUTTON "&Usu", ID_TAB_DEL, 72, 80, 45, 15
PUSHBUTTON "&OK", IDOK, 137, 15, 57, 15
......
......@@ -152,7 +152,7 @@ Caption "Tabulaes"
FONT 8, "MS SHell DLg"
BEGIN
GROUPBOX "Marca de tabulao", -1, 10, 10, 120, 90
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE
DEFPUSHBUTTON "&Adicionar", ID_TAB_ADD, 20, 80, 45, 15
PUSHBUTTON "&Remover", ID_TAB_DEL, 72, 80, 45, 15
PUSHBUTTON "&OK", IDOK, 135, 15, 55, 15
......
......@@ -150,7 +150,7 @@ Caption ""
FONT 8, "MS SHell DLg"
BEGIN
GROUPBOX " ", -1, 10, 10, 120, 90
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE
DEFPUSHBUTTON "&", ID_TAB_ADD, 20, 80, 45, 15
PUSHBUTTON "&", ID_TAB_DEL, 72, 80, 45, 15
PUSHBUTTON "&", IDOK, 137, 15, 50, 15
......
......@@ -152,7 +152,7 @@ Caption "Tabulatorji"
FONT 8, "MS SHell DLg"
BEGIN
GROUPBOX "Položaji tabulatorja", -1, 10, 10, 120, 90
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE
DEFPUSHBUTTON "&Dodaj", ID_TAB_ADD, 20, 80, 45, 15
PUSHBUTTON "&Odstrani", ID_TAB_DEL, 72, 80, 45, 15
PUSHBUTTON "&V redu", IDOK, 137, 15, 50, 15
......
......@@ -152,7 +152,7 @@ Caption "Tabulatorer"
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "Tabulatorstopp", -1, 10, 10, 120, 90
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE
DEFPUSHBUTTON "Lägg &till", ID_TAB_ADD, 20, 80, 45, 15
PUSHBUTTON "Ta &bort", ID_TAB_DEL, 72, 80, 45, 15
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
......
......@@ -152,7 +152,7 @@ Caption "Tabs"
FONT 8, "MS SHell DLg"
BEGIN
GROUPBOX "Tab stops", -1, 10, 10, 120, 90
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE
DEFPUSHBUTTON "&Add", ID_TAB_ADD, 20, 80, 45, 15
PUSHBUTTON "&Remove", ID_TAB_DEL, 72, 80, 45, 15
PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15
......
......@@ -155,7 +155,7 @@ Caption "标签"
FONT 9, "MS Shell Dlg"
BEGIN
GROUPBOX "标签停点", -1, 10, 10, 120, 90
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE
DEFPUSHBUTTON "添加(&A)", ID_TAB_ADD, 20, 80, 45, 15
PUSHBUTTON "删除(&R)", ID_TAB_DEL, 72, 80, 45, 15
PUSHBUTTON "确定(&O)", IDOK, 137, 15, 50, 15
......@@ -380,7 +380,7 @@ Caption "標籤"
FONT 9, "MS Shell Dlg"
BEGIN
GROUPBOX "標籤停點", -1, 10, 10, 120, 90
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT
COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE
DEFPUSHBUTTON "添加(&A)", ID_TAB_ADD, 20, 80, 45, 15
PUSHBUTTON "刪除(&R)", ID_TAB_DEL, 72, 80, 45, 15
PUSHBUTTON "確定(&O)", IDOK, 137, 15, 50, 15
......
......@@ -1646,8 +1646,26 @@ static INT_PTR CALLBACK tabstops_proc(HWND hWnd, UINT message, WPARAM wParam, LP
MessageBoxWithResStringW(hWnd, MAKEINTRESOURCEW(STRING_MAX_TAB_STOPS),
wszAppTitle, MB_OK | MB_ICONINFORMATION);
} else {
SendMessageW(hTabWnd, CB_ADDSTRING, 0, (LPARAM)&buffer);
SetWindowTextW(hTabWnd, 0);
int i;
float next_number = -1;
int next_number_in_twips = -1;
int insert_number = current_units_to_twips(number);
/* linear search for position to insert the string */
for(i = 0; i < item_count; i++)
{
SendMessageW(hTabWnd, CB_GETLBTEXT, i, (LPARAM)&buffer);
number_from_string(buffer, &next_number, TRUE);
next_number_in_twips = current_units_to_twips(next_number);
if (insert_number <= next_number_in_twips)
break;
}
if (insert_number != next_number_in_twips)
{
number_with_units(buffer, insert_number);
SendMessageW(hTabWnd, CB_INSERTSTRING, i, (LPARAM)&buffer);
SetWindowTextW(hTabWnd, 0);
}
}
}
SetFocus(hTabWnd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment