summaryrefslogtreecommitdiff
path: root/src/TextAction.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/TextAction.c')
-rw-r--r--src/TextAction.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/TextAction.c b/src/TextAction.c
index c3c70f6..01ec48c 100644
--- a/src/TextAction.c
+++ b/src/TextAction.c
@@ -3531,15 +3531,16 @@ StripOutOldCRs(TextWidget ctx, XawTextPosition from, XawTextPosition to,
Widget src = ctx->text.source;
XawTextBlock text;
char *buf;
- static wchar_t wc_two_spaces[3];
int idx;
/* Initialize our TextBlock with two spaces. */
text.firstPos = 0;
text.format = (unsigned long)_XawTextFormat(ctx);
- if (text.format == XawFmt8Bit)
- text.ptr= (char*)" ";
- else {
+ if (text.format == XawFmt8Bit) {
+ text.ptr= (char*)" ";
+ } else {
+ static wchar_t wc_two_spaces[3];
+
wc_two_spaces[0] = _Xaw_atowc(XawSP);
wc_two_spaces[1] = _Xaw_atowc(XawSP);
wc_two_spaces[2] = 0;
@@ -3635,19 +3636,19 @@ static void
InsertNewCRs(TextWidget ctx, XawTextPosition from, XawTextPosition to,
XawTextPosition *pos, int num_pos)
{
- XawTextPosition startPos, endPos, space, eol;
+ XawTextPosition startPos;
XawTextBlock text;
- int i, width, height, len, wwidth, idx;
- char *buf;
- static wchar_t wide_CR[2];
+ int i, width, height, wwidth, idx;
text.firstPos = 0;
text.length = 1;
text.format = (unsigned long)_XawTextFormat(ctx);
- if (text.format == XawFmt8Bit)
+ if (text.format == XawFmt8Bit) {
text.ptr = (char*)"\n";
- else {
+ } else {
+ static wchar_t wide_CR[2];
+
wide_CR[0] = _Xaw_atowc(XawLF);
wide_CR[1] = 0;
text.ptr = (char*)wide_CR;
@@ -3666,6 +3667,10 @@ InsertNewCRs(TextWidget ctx, XawTextPosition from, XawTextPosition to,
/* CONSTCOND */
while (TRUE) {
+ int len;
+ char *buf;
+ XawTextPosition endPos, space, eol;
+
XawTextSinkFindPosition(ctx->text.sink, startPos,
(int)ctx->text.r_margin.left, wwidth,
True, &eol, &width, &height);