summaryrefslogtreecommitdiff
path: root/src/TextAction.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/TextAction.c')
-rw-r--r--src/TextAction.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/TextAction.c b/src/TextAction.c
index 5eae39e..0e546fb 100644
--- a/src/TextAction.c
+++ b/src/TextAction.c
@@ -950,7 +950,6 @@ ConvertSelection(Widget w, Atom *selection, Atom *target, Atom *type,
TextWidget ctx = (TextWidget)w;
Widget src = ctx->text.source;
XawTextEditType edit_mode;
- Arg args[1];
XawTextSelectionSalt *salt = NULL;
XawTextSelection *s;
@@ -960,9 +959,12 @@ ConvertSelection(Widget w, Atom *selection, Atom *target, Atom *type,
if (SrcCvtSel(src, selection, target, type, value, length, format))
return (True);
+ else {
+ Arg args[1];
- XtSetArg(args[0], XtNeditType,&edit_mode);
- XtGetValues(src, args, 1);
+ XtSetArg(args[0], XtNeditType,&edit_mode);
+ XtGetValues(src, args, 1);
+ }
XmuConvertStandardSelection(w, ctx->text.time, selection,
target, type, (XPointer *)&std_targets,
@@ -2322,11 +2324,10 @@ Indent(Widget w, XEvent *event, String *params _X_UNUSED, Cardinal *num_params _
TextWidget ctx = (TextWidget)w;
TextSrcObject src = (TextSrcObject)ctx->text.source;
XawTextPosition from, to, tmp, end = 0, *pos, *posbuf[32];
- char buf[32];
XawTextBlock text;
int i, spaces = MULT(ctx);
char *lbuf = NULL, *rbuf;
- unsigned llen = 0, rlen, size;
+ unsigned llen = 0;
Bool undo = src->textSrc.enable_undo && src->textSrc.undo_state == False;
Bool format = ctx->text.auto_fill
&& ctx->text.left_column < ctx->text.right_column;
@@ -2370,6 +2371,8 @@ Indent(Widget w, XEvent *event, String *params _X_UNUSED, Cardinal *num_params _
tmp = from;
if (spaces > 0) {
+ char buf[32];
+
text.ptr = XawStackAlloc((unsigned)spaces, buf);
for (i = 0; i < spaces; i++)
text.ptr[i] = ' ';
@@ -2424,7 +2427,9 @@ Indent(Widget w, XEvent *event, String *params _X_UNUSED, Cardinal *num_params _
Tabify(ctx, from, to, pos, (int)src->textSrc.num_text, NULL);
if (undo) {
- rlen = (unsigned)(llen + (ctx->text.lastPos - end));
+ unsigned rlen = (unsigned)(llen + (ctx->text.lastPos - end));
+ unsigned size;
+
rbuf = _XawTextGetText(ctx, from, from + rlen);
text.format = (unsigned long)_XawTextFormat(ctx);
@@ -3520,7 +3525,7 @@ static XawTextPosition
StripOutOldCRs(TextWidget ctx, XawTextPosition from, XawTextPosition to,
XawTextPosition *pos, int num_pos)
{
- XawTextPosition startPos, endPos, eop_begin, eop_end, temp;
+ XawTextPosition startPos, endPos, eop_begin, eop_end;
Widget src = ctx->text.source;
XawTextBlock text;
char *buf;
@@ -3544,6 +3549,8 @@ StripOutOldCRs(TextWidget ctx, XawTextPosition from, XawTextPosition to,
/* CONSTCOND */
while (TRUE) {
+ XawTextPosition temp;
+
endPos=SrcScan(src, startPos, XawstEOL, XawsdRight, 1, False);
temp = SrcScan(src, endPos, XawstWhiteSpace, XawsdLeft, 1, False);