Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
30c9adbf
Commit
30c9adbf
authored
May 05, 2015
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wb and xtt bugfix for non ISO8859-1 chars
parent
487a4b4e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
161 additions
and
56 deletions
+161
-56
wb/lib/wb/gtk/wb_watt_gtk.cpp
wb/lib/wb/gtk/wb_watt_gtk.cpp
+44
-22
wb/lib/wb/gtk/wb_watttext_gtk.cpp
wb/lib/wb/gtk/wb_watttext_gtk.cpp
+11
-7
wb/lib/wb/gtk/wb_wda_gtk.cpp
wb/lib/wb/gtk/wb_wda_gtk.cpp
+29
-14
xtt/lib/xtt/gtk/xtt_xatt_gtk.cpp
xtt/lib/xtt/gtk/xtt_xatt_gtk.cpp
+29
-11
xtt/lib/xtt/gtk/xtt_xattone_gtk.cpp
xtt/lib/xtt/gtk/xtt_xattone_gtk.cpp
+11
-2
xtt/lib/xtt/gtk/xtt_xcolwind_gtk.cpp
xtt/lib/xtt/gtk/xtt_xcolwind_gtk.cpp
+37
-0
No files found.
wb/lib/wb/gtk/wb_watt_gtk.cpp
View file @
30c9adbf
...
...
@@ -310,15 +310,17 @@ void WAttGtk::change_value_close()
text
=
g_convert
(
textutf8
,
-
1
,
"ISO8859-1"
,
"UTF-8"
,
NULL
,
NULL
,
NULL
);
g_free
(
textutf8
);
// Replace ctrl characters with space
for
(
s
=
(
unsigned
char
*
)
text
;
*
s
;
s
++
)
{
if
(
*
s
<
' '
&&
*
s
!=
10
&&
*
s
!=
13
)
*
s
=
' '
;
if
(
text
)
{
// Replace ctrl characters with space
for
(
s
=
(
unsigned
char
*
)
text
;
*
s
;
s
++
)
{
if
(
*
s
<
' '
&&
*
s
!=
10
&&
*
s
!=
13
)
*
s
=
' '
;
}
sts
=
wattnav
->
set_attr_value
(
input_node
,
input_name
,
text
);
g_free
(
text
);
}
sts
=
wattnav
->
set_attr_value
(
input_node
,
input_name
,
text
);
g_free
(
text
);
g_object_set
(
cmd_scrolledinput
,
"visible"
,
FALSE
,
NULL
);
set_prompt
(
""
);
input_open
=
0
;
...
...
@@ -329,6 +331,8 @@ void WAttGtk::change_value_close()
wattnav
->
redraw
();
wattnav
->
set_inputfocus
();
if
(
!
text
)
message
(
'E'
,
"Input error, invalid character"
);
}
else
{
char
*
text
,
*
textutf8
;
...
...
@@ -336,9 +340,11 @@ void WAttGtk::change_value_close()
text
=
g_convert
(
textutf8
,
-
1
,
"ISO8859-1"
,
"UTF-8"
,
NULL
,
NULL
,
NULL
);
g_free
(
textutf8
);
sts
=
wattnav
->
set_attr_value
(
input_node
,
input_name
,
text
);
g_free
(
text
);
if
(
text
)
{
sts
=
wattnav
->
set_attr_value
(
input_node
,
input_name
,
text
);
g_free
(
text
);
}
g_object_set
(
cmd_input
,
"visible"
,
FALSE
,
NULL
);
set_prompt
(
""
);
input_open
=
0
;
...
...
@@ -346,6 +352,9 @@ void WAttGtk::change_value_close()
(
redraw_cb
)(
this
);
wattnav
->
set_inputfocus
();
if
(
!
text
)
message
(
'E'
,
"Input error, invalid character"
);
}
if
(
pending_close
)
{
if
(
close_cb
)
...
...
@@ -367,20 +376,27 @@ void WAttGtk::activate_cmd_input( GtkWidget *w, gpointer data)
textutf8
=
gtk_editable_get_chars
(
GTK_EDITABLE
(
w
),
0
,
-
1
);
text
=
g_convert
(
textutf8
,
-
1
,
"ISO8859-1"
,
"UTF-8"
,
NULL
,
NULL
,
NULL
);
g_free
(
textutf8
);
if
(
watt
->
input_open
)
{
sts
=
((
WAttNav
*
)
watt
->
wattnav
)
->
set_attr_value
(
watt
->
input_node
,
watt
->
input_name
,
text
);
if
(
text
)
sts
=
((
WAttNav
*
)
watt
->
wattnav
)
->
set_attr_value
(
watt
->
input_node
,
watt
->
input_name
,
text
);
g_object_set
(
w
,
"visible"
,
FALSE
,
NULL
);
watt
->
set_prompt
(
""
);
watt
->
input_open
=
0
;
if
(
watt
->
redraw_cb
)
(
watt
->
redraw_cb
)(
watt
);
}
g_free
(
text
);
if
(
text
)
g_free
(
text
);
g_object_set
(
watt
->
cmd_prompt
,
"visible"
,
FALSE
,
NULL
);
g_object_set
(
watt
->
cmd_input
,
"visible"
,
FALSE
,
NULL
);
if
(
!
text
)
watt
->
message
(
'E'
,
"Input error, invalid character"
);
if
(
watt
->
pending_close
)
{
if
(
watt
->
close_cb
)
(
watt
->
close_cb
)(
watt
);
...
...
@@ -406,14 +422,16 @@ void WAttGtk::activate_cmd_scrolled_ok( GtkWidget *w, gpointer data)
text
=
g_convert
(
textutf8
,
-
1
,
"ISO8859-1"
,
"UTF-8"
,
NULL
,
NULL
,
NULL
);
g_free
(
textutf8
);
// Replace ctrl characters with space
for
(
s
=
(
unsigned
char
*
)
text
;
*
s
;
s
++
)
{
if
(
*
s
<
' '
&&
*
s
!=
10
&&
*
s
!=
13
)
*
s
=
' '
;
}
if
(
text
)
{
// Replace ctrl characters with space
for
(
s
=
(
unsigned
char
*
)
text
;
*
s
;
s
++
)
{
if
(
*
s
<
' '
&&
*
s
!=
10
&&
*
s
!=
13
)
*
s
=
' '
;
}
sts
=
((
WAttNav
*
)
watt
->
wattnav
)
->
set_attr_value
(
watt
->
input_node
,
watt
->
input_name
,
text
);
sts
=
((
WAttNav
*
)
watt
->
wattnav
)
->
set_attr_value
(
watt
->
input_node
,
watt
->
input_name
,
text
);
}
g_object_set
(
watt
->
cmd_scrolledinput
,
"visible"
,
FALSE
,
NULL
);
watt
->
set_prompt
(
""
);
watt
->
input_open
=
0
;
...
...
@@ -424,7 +442,11 @@ void WAttGtk::activate_cmd_scrolled_ok( GtkWidget *w, gpointer data)
((
WAttNav
*
)
watt
->
wattnav
)
->
redraw
();
((
WAttNav
*
)
watt
->
wattnav
)
->
set_inputfocus
();
g_free
(
text
);
if
(
text
)
g_free
(
text
);
else
watt
->
message
(
'E'
,
"Input error, invalid character"
);
if
(
watt
->
pending_close
)
{
if
(
watt
->
close_cb
)
...
...
wb/lib/wb/gtk/wb_watttext_gtk.cpp
View file @
30c9adbf
...
...
@@ -215,15 +215,19 @@ void WAttTextGtk::set_attr_value()
text
=
g_convert
(
textutf8
,
-
1
,
"ISO8859-1"
,
"UTF-8"
,
NULL
,
NULL
,
NULL
);
g_free
(
textutf8
);
if
(
text
)
{
// Replace ctrl characters with space
for
(
s
=
(
unsigned
char
*
)
text
;
*
s
;
s
++
)
{
if
(
*
s
<
' '
&&
*
s
!=
10
&&
*
s
!=
13
)
*
s
=
' '
;
for
(
s
=
(
unsigned
char
*
)
text
;
*
s
;
s
++
)
{
if
(
*
s
<
' '
&&
*
s
!=
10
&&
*
s
!=
13
)
*
s
=
' '
;
}
sts
=
ldh_SetObjectPar
(
ldhses
,
aref
.
Objid
,
"DevBody"
,
aname
,
text
,
size
);
g_free
(
text
);
}
sts
=
ldh_SetObjectPar
(
ldhses
,
aref
.
Objid
,
"DevBody"
,
aname
,
text
,
size
);
g_free
(
text
);
else
wow
->
DisplayError
(
"Input error"
,
"Invalid character"
);
}
}
...
...
wb/lib/wb/gtk/wb_wda_gtk.cpp
View file @
30c9adbf
...
...
@@ -407,9 +407,11 @@ void WdaGtk::change_value_close()
text
=
g_convert
(
textutf8
,
-
1
,
"ISO8859-1"
,
"UTF-8"
,
NULL
,
NULL
,
NULL
);
g_free
(
textutf8
);
sts
=
wdanav
->
set_attr_value
(
input_node
,
input_name
,
text
);
g_free
(
text
);
if
(
text
)
{
sts
=
wdanav
->
set_attr_value
(
input_node
,
input_name
,
text
);
g_free
(
text
);
}
g_object_set
(
cmd_input
,
"visible"
,
FALSE
,
NULL
);
set_prompt
(
""
);
input_open
=
0
;
...
...
@@ -417,6 +419,9 @@ void WdaGtk::change_value_close()
(
redraw_cb
)(
this
);
wdanav
->
set_inputfocus
();
if
(
!
text
)
message
(
'E'
,
"Input error, invalid character"
);
}
}
}
...
...
@@ -437,15 +442,20 @@ void WdaGtk::activate_cmd_input( GtkWidget *w, gpointer data)
g_free
(
textutf8
);
if
(
wda
->
input_open
)
{
sts
=
wda
->
wdanav
->
set_attr_value
(
wda
->
input_node
,
wda
->
input_name
,
text
);
if
(
text
)
sts
=
wda
->
wdanav
->
set_attr_value
(
wda
->
input_node
,
wda
->
input_name
,
text
);
g_object_set
(
w
,
"visible"
,
FALSE
,
NULL
);
wda
->
set_prompt
(
""
);
wda
->
input_open
=
0
;
if
(
wda
->
redraw_cb
)
(
wda
->
redraw_cb
)(
wda
);
if
(
!
text
)
wda
->
message
(
'E'
,
"Input error, invalid character"
);
}
g_free
(
text
);
if
(
text
)
g_free
(
text
);
}
void
WdaGtk
::
activate_cmd_scrolled_ok
(
GtkWidget
*
w
,
gpointer
data
)
...
...
@@ -465,14 +475,16 @@ void WdaGtk::activate_cmd_scrolled_ok( GtkWidget *w, gpointer data)
text
=
g_convert
(
textutf8
,
-
1
,
"ISO8859-1"
,
"UTF-8"
,
NULL
,
NULL
,
NULL
);
g_free
(
textutf8
);
// Replace ctrl characters with space
for
(
s
=
(
unsigned
char
*
)
text
;
*
s
;
s
++
)
{
if
(
*
s
<
' '
&&
*
s
!=
10
&&
*
s
!=
13
)
*
s
=
' '
;
}
if
(
text
)
{
// Replace ctrl characters with space
for
(
s
=
(
unsigned
char
*
)
text
;
*
s
;
s
++
)
{
if
(
*
s
<
' '
&&
*
s
!=
10
&&
*
s
!=
13
)
*
s
=
' '
;
}
sts
=
wda
->
wdanav
->
set_attr_value
(
wda
->
input_node
,
wda
->
input_name
,
text
);
sts
=
wda
->
wdanav
->
set_attr_value
(
wda
->
input_node
,
wda
->
input_name
,
text
);
}
g_object_set
(
wda
->
cmd_scrolledinput
,
"visible"
,
FALSE
,
NULL
);
wda
->
set_prompt
(
""
);
wda
->
input_open
=
0
;
...
...
@@ -483,7 +495,10 @@ void WdaGtk::activate_cmd_scrolled_ok( GtkWidget *w, gpointer data)
wda
->
wdanav
->
redraw
();
wda
->
wdanav
->
set_inputfocus
();
g_free
(
text
);
if
(
text
)
g_free
(
text
);
else
wda
->
message
(
'E'
,
"Input error, invalid character"
);
}
}
...
...
xtt/lib/xtt/gtk/xtt_xatt_gtk.cpp
View file @
30c9adbf
...
...
@@ -318,9 +318,12 @@ void XAttGtk::change_value_close()
text
=
g_convert
(
textutf8
,
-
1
,
"ISO8859-1"
,
"UTF-8"
,
NULL
,
NULL
,
NULL
);
g_free
(
textutf8
);
sts
=
xattnav
->
set_attr_value
(
input_node
,
input_name
,
text
);
g_free
(
text
);
if
(
text
)
{
sts
=
xattnav
->
set_attr_value
(
input_node
,
input_name
,
text
);
g_free
(
text
);
}
g_object_set
(
cmd_scrolledinput
,
"visible"
,
FALSE
,
NULL
);
set_prompt
(
""
);
input_open
=
0
;
...
...
@@ -331,6 +334,8 @@ void XAttGtk::change_value_close()
xattnav
->
redraw
();
xattnav
->
set_inputfocus
();
if
(
!
text
)
message
(
'E'
,
"Input error, invalid character"
);
}
else
{
char
*
text
,
*
textutf8
;
...
...
@@ -339,9 +344,11 @@ void XAttGtk::change_value_close()
text
=
g_convert
(
textutf8
,
-
1
,
"ISO8859-1"
,
"UTF-8"
,
NULL
,
NULL
,
NULL
);
g_free
(
textutf8
);
sts
=
xattnav
->
set_attr_value
(
input_node
,
if
(
text
)
{
sts
=
xattnav
->
set_attr_value
(
input_node
,
input_name
,
text
);
g_free
(
text
);
g_free
(
text
);
}
g_object_set
(
cmd_input
,
"visible"
,
FALSE
,
NULL
);
set_prompt
(
""
);
input_open
=
0
;
...
...
@@ -349,6 +356,8 @@ void XAttGtk::change_value_close()
(
redraw_cb
)(
this
);
xattnav
->
set_inputfocus
();
if
(
!
text
)
message
(
'E'
,
"Input error, invalid character"
);
}
}
}
...
...
@@ -369,15 +378,19 @@ void XAttGtk::activate_cmd_input( GtkWidget *w, gpointer data)
g_free
(
textutf8
);
if
(
xatt
->
input_open
)
{
sts
=
xatt
->
xattnav
->
set_attr_value
(
xatt
->
input_node
,
xatt
->
input_name
,
text
);
if
(
text
)
sts
=
xatt
->
xattnav
->
set_attr_value
(
xatt
->
input_node
,
xatt
->
input_name
,
text
);
g_object_set
(
w
,
"visible"
,
FALSE
,
NULL
);
xatt
->
set_prompt
(
""
);
xatt
->
input_open
=
0
;
if
(
xatt
->
redraw_cb
)
(
xatt
->
redraw_cb
)(
xatt
);
if
(
!
text
)
xatt
->
message
(
'E'
,
"Input error, invalid character"
);
}
g_free
(
text
);
if
(
text
)
g_free
(
text
);
}
void
XAttGtk
::
activate_cmd_scrolled_ok
(
GtkWidget
*
w
,
gpointer
data
)
...
...
@@ -396,8 +409,12 @@ void XAttGtk::activate_cmd_scrolled_ok( GtkWidget *w, gpointer data)
text
=
g_convert
(
textutf8
,
-
1
,
"ISO8859-1"
,
"UTF-8"
,
NULL
,
NULL
,
NULL
);
g_free
(
textutf8
);
sts
=
xatt
->
xattnav
->
set_attr_value
(
xatt
->
input_node
,
xatt
->
input_name
,
text
);
if
(
text
)
sts
=
xatt
->
xattnav
->
set_attr_value
(
xatt
->
input_node
,
xatt
->
input_name
,
text
);
else
xatt
->
message
(
'E'
,
"Input error, invalid character"
);
g_object_set
(
xatt
->
cmd_scrolledinput
,
"visible"
,
FALSE
,
NULL
);
xatt
->
set_prompt
(
""
);
xatt
->
input_open
=
0
;
...
...
@@ -408,7 +425,8 @@ void XAttGtk::activate_cmd_scrolled_ok( GtkWidget *w, gpointer data)
xatt
->
xattnav
->
redraw
();
xatt
->
xattnav
->
set_inputfocus
();
g_free
(
text
);
if
(
text
)
g_free
(
text
);
}
}
...
...
xtt/lib/xtt/gtk/xtt_xattone_gtk.cpp
View file @
30c9adbf
...
...
@@ -89,6 +89,7 @@ int XAttOneGtk::set_value()
char
*
text
;
int
sts
;
char
buff
[
1024
];
char
*
textutf8
;
if
(
input_open
)
{
if
(
input_multiline
)
{
...
...
@@ -96,13 +97,21 @@ int XAttOneGtk::set_value()
gtk_text_buffer_get_start_iter
(
cmd_scrolled_buffer
,
&
start_iter
);
gtk_text_buffer_get_end_iter
(
cmd_scrolled_buffer
,
&
end_iter
);
text
=
gtk_text_buffer_get_text
(
cmd_scrolled_buffer
,
&
start_iter
,
&
end_iter
,
text
utf8
=
gtk_text_buffer_get_text
(
cmd_scrolled_buffer
,
&
start_iter
,
&
end_iter
,
FALSE
);
}
else
{
text
=
gtk_editable_get_chars
(
GTK_EDITABLE
(
cmd_input
),
0
,
-
1
);
text
utf8
=
gtk_editable_get_chars
(
GTK_EDITABLE
(
cmd_input
),
0
,
-
1
);
}
text
=
g_convert
(
textutf8
,
-
1
,
"ISO8859-1"
,
"UTF-8"
,
NULL
,
NULL
,
NULL
);
g_free
(
textutf8
);
if
(
!
text
)
{
message
(
'E'
,
"Input error, invalid character"
);
return
0
;
}
sts
=
XNav
::
attr_string_to_value
(
atype
,
text
,
buff
,
sizeof
(
buff
),
asize
);
g_free
(
text
);
...
...
xtt/lib/xtt/gtk/xtt_xcolwind_gtk.cpp
View file @
30c9adbf
...
...
@@ -425,6 +425,21 @@ void XColWindGtk::change_value_close()
text
=
g_convert
(
textutf8
,
-
1
,
"ISO8859-1"
,
"UTF-8"
,
NULL
,
NULL
,
NULL
);
g_free
(
textutf8
);
if
(
!
text
)
{
g_object_set
(
cmd_scrolledinput
,
"visible"
,
FALSE
,
NULL
);
set_prompt
(
""
);
input_open
=
0
;
int
w
,
h
;
gdk_drawable_get_size
(
pane
->
window
,
&
w
,
&
h
);
gtk_paned_set_position
(
GTK_PANED
(
pane
),
h
-
50
);
xattnav
->
redraw
();
xattnav
->
set_inputfocus
();
message
(
'E'
,
"Input error, invalid character"
);
return
;
}
sts
=
xattnav
->
set_attr_value
(
input_node
,
input_name
,
text
);
g_free
(
text
);
...
...
@@ -446,6 +461,18 @@ void XColWindGtk::change_value_close()
text
=
g_convert
(
textutf8
,
-
1
,
"ISO8859-1"
,
"UTF-8"
,
NULL
,
NULL
,
NULL
);
g_free
(
textutf8
);
if
(
!
text
)
{
g_free
(
text
);
g_object_set
(
cmd_input
,
"visible"
,
FALSE
,
NULL
);
set_prompt
(
""
);
input_open
=
0
;
if
(
redraw_cb
)
(
redraw_cb
)(
this
);
xattnav
->
set_inputfocus
();
message
(
'E'
,
"Input error, invalid character"
);
return
;
}
sts
=
xattnav
->
set_attr_value
(
input_node
,
input_name
,
text
);
g_free
(
text
);
...
...
@@ -475,6 +502,16 @@ void XColWindGtk::activate_cmd_input( GtkWidget *w, gpointer data)
text
=
g_convert
(
textutf8
,
-
1
,
"ISO8859-1"
,
"UTF-8"
,
NULL
,
NULL
,
NULL
);
g_free
(
textutf8
);
if
(
!
text
)
{
g_object_set
(
w
,
"visible"
,
FALSE
,
NULL
);
xcolwind
->
set_prompt
(
""
);
xcolwind
->
input_open
=
0
;
if
(
xcolwind
->
redraw_cb
)
(
xcolwind
->
redraw_cb
)(
xcolwind
);
xcolwind
->
message
(
'E'
,
"Input error, invalid character"
);
return
;
}
if
(
xcolwind
->
input_open
)
{
sts
=
xcolwind
->
xattnav
->
set_attr_value
(
xcolwind
->
input_node
,
xcolwind
->
input_name
,
text
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment