~ubuntu-branches/ubuntu/hardy/xxdiff/hardy

« back to all changes in this revision

Viewing changes to src/resParser.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Tomas Pospisek
  • Date: 2005-03-29 08:43:56 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050329084356-nkwv8jf18nc7u5qf
Tags: 1:3.1-3
re-upload

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- c-file-style: "xxdiff" -*- */
1
2
/******************************************************************************\
2
 
 * $Id: resParser.cpp,v 1.56 2002/02/27 02:46:54 blais Exp $
3
 
 * $Date: 2002/02/27 02:46:54 $
 
3
 * $RCSfile: resParser.cpp,v $
4
4
 *
5
 
 * Copyright (C) 1999-2001  Martin Blais <blais@iro.umontreal.ca>
 
5
 * Copyright (C) 1999-2003  Martin Blais <blais@furius.ca>
6
6
 *
7
7
 * This program is free software; you can redistribute it and/or modify
8
8
 * it under the terms of the GNU General Public License as published by
28
28
 
29
29
#include <resParser.h>
30
30
#include <exceptions.h>
 
31
#include <util.h>
31
32
#include <help.h>
32
33
 
33
34
#ifndef INCL_RESPARSER_Y
35
36
#define INCL_RESPARSER_Y
36
37
#endif
37
38
 
 
39
#include <kdeSupport.h>
 
40
 
38
41
#include <qaccel.h>
39
42
#include <qapplication.h>
40
43
#include <qfont.h>
41
44
#include <qfile.h>
42
45
#include <qfileinfo.h>
 
46
#include <qstring.h>
 
47
#if (QT_VERSION >= 0x030000)
 
48
#include <qstylefactory.h>
 
49
#endif
43
50
 
44
51
#include <stdexcept>
45
52
#include <iostream>
50
57
#include <fcntl.h>
51
58
#include <unistd.h>
52
59
 
 
60
 
53
61
/*==============================================================================
54
62
 * LOCAL DECLARATIONS
55
63
 *============================================================================*/
71
79
     "Preferred geometry upon initialization.  Format is the same a X geometry \
72
80
specification, plus you can also use `Maximize' to maximize on startup" },
73
81
 
 
82
   { "Style", STYLE,
 
83
     "Preferred Qt style, see Qt documentation for more details. The style can \
 
84
otherwise be specified through command-line arguments." },
 
85
 
74
86
   { "Accel", ACCEL,
75
87
   "Accelerators for most functionality. The name of the accelerator should be \
76
88
explicit enough that you can find which function it is bound to." },
130
142
   { "VerticalLinePosition", VERTICAL_LINE_POS, 
131
143
     "Initial column to draw vertical alignment line." },
132
144
 
133
 
   { "ClipboardFormat", CLIPBOARD_FORMAT, 
134
 
     "Format of formatted clipboard text." },
 
145
   { "ClipboardHeaderFormat", CLIPBOARD_HEAD_FORMAT, 
 
146
     "Format of header for selection of text for formatted clipboard text." },
 
147
 
 
148
   { "ClipboardLineFormat", CLIPBOARD_LINE_FORMAT, 
 
149
     "Format of each selection line for formatted clipboard text." },
135
150
 
136
151
   { "HorizontalDiffType", HORDIFF_TYPE,
137
152
     "Type of horizontal diffs display.  Can be one of \
174
189
   { "ExitIfNoConflicts", EXIT_IF_NO_CONFLICTS,
175
190
     "If true, exit if after an automatic merge there are no conflicts." },
176
191
 
 
192
   { "ExitWithMergeStatus", EXIT_WITH_MERGE_STATUS,
 
193
     "If true, exit with error code 0 if all merges selected and saved." },
 
194
 
177
195
   { "AutoSelectMerge", SELECT_MERGE,
178
196
     "Pre-selected non-conflictual regions as an automatic merge would." },
179
197
 
180
198
   { "IgnoreHorizontalWhitespace", IGNORE_HORIZONTAL_WS, 
181
199
     "Ignore horizontal whitespace in horizontal diffs." },
182
200
 
 
201
   { "IgnorePerHunkWhitespace", IGNORE_PERHUNK_WS, 
 
202
     "For each hunk, ignore hunk if there are only whitespace and line break \
 
203
changes within that hunk. This can be useful for ignoring code reformatting \
 
204
for certain source code languages that allow it (e.g. C++)." },
 
205
 
183
206
   { "FormatClipboardText", FORMAT_CLIPBOARD_TEXT, 
184
 
     "Enables clipboard (copy-paste) formatting.  If disable, text that goes \
 
207
     "Enables clipboard (copy-paste) formatting.  If disabled, text that goes \
185
208
in the clipboard is simply left unformatted." },
186
209
 
187
210
   { "IgnoreErrors", IGNORE_ERRORS,
193
216
   { "DisableCursorDisplay", DISABLE_CURSOR_DISPLAY, 
194
217
     "Disables displaying the line cursor." },
195
218
 
 
219
   { "DrawPatternInFillerLines", DRAW_PATTERN_IN_FILLER_LINES, 
 
220
     "Some people like to have a pattern drawn for filler lines to make it \
 
221
really dead obvious that they are not real lines, but just inserted for \
 
222
display purpose. This setting enables it." },
 
223
 
196
224
   { "HideCarriageReturns", HIDE_CR, 
197
225
     "Hides CR characters found in files created under DOS/Windows." },
198
226
 
203
231
   { "DirDiffBuildSolelyFromOutput", DIRDIFF_BUILD_FROM_OUTPUT, 
204
232
     "In directory diffs, building diffs only from output, not checking \
205
233
against actual directory contents.  This is a self-verification feature \
206
 
only, and unless you're doing developemnt you should leave this to default \
 
234
only, and unless you're doing development you should leave this to default \
207
235
(true)." },
208
236
 
209
237
   { "DirDiffRecursive", DIRDIFF_RECURSIVE,
213
241
     "(Not implemented) Use internal diff computation, does not spawn external \
214
242
diff program." }
215
243
 
216
 
#ifdef XX_ENABLE_FORCE_SAVE_MERGED_FILE
217
 
   { "ForceSaveMergedFIle", FORCE_SAVE_MERGED_FILE,
218
 
     "Put xxdiff in a mode where it is forced to save to the merged file. This \
219
 
option is made available as a resource because it was easy but you\'ll most \
220
 
likely want to use it rather from the command line." }
221
 
#endif
222
 
 
223
244
};
224
245
 
225
246
/* Be careful: order must be the same as for token declaration. */
226
247
XxBoolOpt boolMap[] = {
227
248
   BOOL_EXIT_ON_SAME,
228
249
   BOOL_EXIT_IF_NO_CONFLICTS,
 
250
   BOOL_EXIT_WITH_MERGE_STATUS,
229
251
   BOOL_SELECT_MERGE,
230
252
   BOOL_IGNORE_HORIZONTAL_WS,
 
253
   BOOL_IGNORE_PERHUNK_WS,
231
254
   BOOL_FORMAT_CLIPBOARD_TEXT,
232
255
   BOOL_IGNORE_ERRORS,
233
256
   BOOL_WARN_ABOUT_UNSAVED,
234
257
   BOOL_DISABLE_CURSOR_DISPLAY,
 
258
   BOOL_DRAW_PATTERN_IN_FILLER_LINES,
235
259
   BOOL_HIDE_CR,
236
260
   BOOL_DIRDIFF_IGNORE_FILE_CHANGES,
237
261
   BOOL_DIRDIFF_BUILD_FROM_OUTPUT,
238
262
   BOOL_DIRDIFF_RECURSIVE,
239
263
   BOOL_USE_INTERNAL_DIFF
240
 
#ifdef XX_ENABLE_FORCE_SAVE_MERGED_FILE
241
 
   BOOL_FORCE_SAVE_MERGED_FILE
242
 
#endif
243
264
};
244
265
 
245
266
StringToken accelList[] = {
246
267
   { "Exit", ACCEL_EXIT, 0 },
 
268
   { "ExitAccept", ACCEL_EXIT_ACCEPT, 0 },
 
269
   { "ExitMerged", ACCEL_EXIT_MERGED, 0 },
 
270
   { "ExitReject", ACCEL_EXIT_REJECT, 0 },
247
271
   { "OpenLeft", ACCEL_OPEN_LEFT, 0 },
248
272
   { "OpenMiddle", ACCEL_OPEN_MIDDLE, 0 },
249
273
   { "OpenRight", ACCEL_OPEN_RIGHT, 0 },
250
274
   { "SaveAsLeft", ACCEL_SAVE_AS_LEFT, 0 },
251
275
   { "SaveAsMiddle", ACCEL_SAVE_AS_MIDDLE, 0 },
252
276
   { "SaveAsRight", ACCEL_SAVE_AS_RIGHT, 0 },
 
277
   { "SaveAsMerged", ACCEL_SAVE_AS_MERGED, 0 },
253
278
   { "SaveAs", ACCEL_SAVE_AS, 0 },
254
279
   { "SaveSelectedOnly", ACCEL_SAVE_SELECTED_ONLY, 0 },
255
280
   { "EditLeft", ACCEL_EDIT_LEFT, 0 },
256
281
   { "EditMiddle", ACCEL_EDIT_MIDDLE, 0 },
257
282
   { "EditRight", ACCEL_EDIT_RIGHT, 0 },
 
283
   { "SaveOptions", ACCEL_SAVE_OPTIONS, 0 },
258
284
   { "Search", ACCEL_SEARCH, 0 },
259
285
   { "SearchForward", ACCEL_SEARCH_FORWARD, 0 },
260
286
   { "SearchBackward", ACCEL_SEARCH_BACKWARD, 0 },
268
294
   { "EditDiffOptions", ACCEL_EDIT_DIFF_OPTIONS, 0 },
269
295
   { "EditDisplayOptions", ACCEL_EDIT_DISPLAY_OPTIONS, 0 },
270
296
   { "DiffFilesAtCursor", ACCEL_DIFF_FILES_AT_CURSOR, 0 },
 
297
   { "NextAndDiffFiles", ACCEL_NEXT_AND_DIFF_FILES, 0 },
271
298
   { "CopyFileRightToLeft", ACCEL_COPY_RIGHT_TO_LEFT, 0 },
272
299
   { "CopyFileLeftToRight", ACCEL_COPY_LEFT_TO_RIGHT, 0 },
273
300
   { "RemoveFileLeft", ACCEL_REMOVE_LEFT, 0 },
328
355
   { "HorizontalDiffSingle", ACCEL_HORDIFF_SINGLE, 0 },
329
356
   { "HorizontalDiffMultiple", ACCEL_HORDIFF_MULTIPLE, 0 },
330
357
   { "ToggleIgnoreHorizontalWhitespace", ACCEL_TOGGLE_IGNORE_HORIZONTAL_WS, 0 },
 
358
   { "ToggleIgnorePerHunkWhitespace", ACCEL_TOGGLE_IGNORE_PERHUNK_WS, 0 },
331
359
   { "ToggleFormatClipboardText", ACCEL_TOGGLE_FORMAT_CLIPBOARD_TEXT, 0 },
332
360
   { "IgnoreFileNone", ACCEL_IGNORE_FILE_NONE, 0 },
333
361
   { "IgnoreFileLeft", ACCEL_IGNORE_FILE_LEFT, 0 },
335
363
   { "IgnoreFileRight", ACCEL_IGNORE_FILE_RIGHT, 0 },
336
364
   { "HelpManPage", ACCEL_HELP_MAN_PAGE, 0 },
337
365
   { "HelpOnContext", ACCEL_HELP_ON_CONTEXT, 0 },
338
 
   { "HelpGenInitFile", ACCEL_HELP_GEN_INIT_FILE, 0 },
339
366
   { "HelpAbout", ACCEL_HELP_ABOUT, 0 },
340
 
   { "MergedClose", ACCEL_MERGED_CLOSE, 0 }
 
367
   { "MergedClose", ACCEL_MERGED_CLOSE, 0 },
 
368
   { "FontResizeBigger", ACCEL_FONT_RESIZE_BIGGER, 0 },
 
369
   { "FontResizeSmaller", ACCEL_FONT_RESIZE_SMALLER, 0 },
341
370
};
342
371
 
343
372
StringToken colorList[] = {
344
373
 
345
374
   { "Same", COLOR_SAME,
346
375
     " Identical text " },
 
376
   { "SameBlank", COLOR_SAME_BLANK,
 
377
     " Identical text (blank side, for filler lines when ignore-blank-lines "
 
378
     "is enabled) " },
347
379
 
348
380
   { "Insert", COLOR_INSERT,
349
381
     " Insert text (side with text) " },
396
428
     " Selected text " },
397
429
   { "SelectedSup", COLOR_SELECTED_SUP,
398
430
     " Selected text (shadowed) " },
 
431
 
 
432
   { "IgnoreDisplay", COLOR_IGNORE_DISPLAY,
 
433
     " Ignored for display purposes " },
 
434
   { "IgnoreDisplaySup", COLOR_IGNORE_DISPLAY_SUP,
 
435
     " Ignored for display purposes (shadowed) " },
 
436
   { "IgnoreDisplayOnly", COLOR_IGNORE_DISPLAY_ONLY,
 
437
     " Ignored for display purposes (only text on lines) " },
 
438
   { "IgnoreDisplayNonly", COLOR_IGNORE_DISPLAY_NONLY,
 
439
     " Ignored for display purposes (blank side) " },
399
440
                                      
400
441
   { "Deleted", COLOR_DELETED,
401
442
     " Deleted text " },
429
470
   { "Cursor", COLOR_CURSOR,
430
471
     " Line cursor color " },
431
472
   { "VerticalLine", COLOR_VERTICAL_LINE,
432
 
     " Vertical line color " }
 
473
     " Vertical line color " },
 
474
   { "TextSelection", COLOR_TEXT_SELECTION,
 
475
     " Color of text region selection " }
433
476
};
434
477
 
435
478
StringToken commandList[] = {
595
638
//
596
639
bool readGeometry( const QString& val, QRect& geometry )
597
640
{
598
 
   QWidget* desktop = QApplication::desktop();
 
641
   QWidget* desktop = QkApplication::desktop();
599
642
   XX_ASSERT( desktop != 0 );
600
643
   QSize dsize = desktop->size();
601
644
 
602
645
   // Reads in a value.  Returns true if successful, false if the resource was
603
646
   // not the specified type and left untouched.
604
 
 
 
647
   
605
648
   int l = -1;
606
649
   int t = -1;
607
650
   int w = -1;
619
662
   else if ( sscanf( vchar, "%dx%d-%d-%d", &w, &h, &l, &t ) == 4 ) {
620
663
      geometry = QRect( dsize.width()-l-w, dsize.height()-t-h, w, h );
621
664
   }
 
665
   else if ( sscanf( vchar, "+%d+%d", &l, &t ) == 2 ) {
 
666
      QRect defGeom = XxResources::getDefaultGeometry();
 
667
      geometry = QRect( l, t, defGeom.width(), defGeom.height() );
 
668
   }
 
669
   else if ( sscanf( vchar, "-%d+%d", &l, &t ) == 2 ) {
 
670
      QRect defGeom = XxResources::getDefaultGeometry();
 
671
      w = defGeom.width();
 
672
      geometry = QRect( dsize.width()-l-w, t, defGeom.width(), defGeom.height() );
 
673
   }
 
674
   else if ( sscanf( vchar, "+%d-%d", &l, &t ) == 2 ) {
 
675
      QRect defGeom = XxResources::getDefaultGeometry();
 
676
      h = defGeom.height();
 
677
      geometry = QRect( l, dsize.height()-t-h, defGeom.width(), defGeom.height() );
 
678
   }
 
679
   else if ( sscanf( vchar, "-%d-%d", &l, &t ) == 2 ) {
 
680
      QRect defGeom = XxResources::getDefaultGeometry();
 
681
      w = defGeom.width();
 
682
      h = defGeom.height();
 
683
      geometry = QRect( dsize.width()-l-w, dsize.height()-t-h, 
 
684
                        defGeom.width(), defGeom.height() );
 
685
   }
622
686
   else if ( sscanf( vchar, "%dx%d", &w, &h ) == 2 ) {
623
687
      geometry = QRect( -1, -1, w, h );
624
688
   }
625
689
   else {
626
690
      return false;
627
691
   }
 
692
 
628
693
   if ( w <= 0 ) {
629
694
      geometry = QRect( 0, geometry.top(), dsize.width(), geometry.height() );
630
695
   }
760
825
#pragma reset woff 1506
761
826
#endif
762
827
 
763
 
// Prevent warning under IRIX and Linux.
 
828
#ifdef COMPILER_MIPSPRO
 
829
// Prevent warning under IRIX.
764
830
char* dummy_full_match = yy_full_match;
 
831
#endif
765
832
 
766
833
//------------------------------------------------------------------------------
767
834
//
925
992
      yylineno = 1; // Reset lineno.
926
993
   
927
994
      yyrestart( 0 );
928
 
      YY_FLUSH_BUFFER;
 
995
      // YY_FLUSH_BUFFER is undef'ed, use its definition to flush the buffer.
 
996
      yy_flush_buffer( YY_CURRENT_BUFFER );
929
997
      BEGIN(INITIAL);
930
998
      yyparse( &resources );
931
999
   }
997
1065
   // Perhaps we should change the default init geometry here to use the actual
998
1066
   // application geometry.
999
1067
 
 
1068
   QString styleKey = res1.getStyleKey();
 
1069
   if ( styleKey != res2.getStyleKey() ) {
 
1070
      os << searchTokenName( STPARAM(kwdList), STYLE ) 
 
1071
         << ": \"" << styleKey << "\"" << endl;
 
1072
   }
 
1073
 
1000
1074
   int nbaccel = sizeof(accelList)/sizeof(StringToken);
1001
1075
   const char* accelStr = searchTokenName( STPARAM(kwdList), ACCEL );
1002
1076
   for ( ii = 0; ii < nbaccel; ++ii ) {
1015
1089
   const QFont& fontApp = res1.getFontApp();
1016
1090
   if ( !XxResources::compareFonts( fontApp, res2.getFontApp() ) ) {
1017
1091
      os << searchTokenName( STPARAM(kwdList), FONT_APP )
1018
 
         << ": \"" << fontApp.rawName() << "\"" << endl;
 
1092
         << ": \"" 
 
1093
#if (QT_VERSION >= 0x030000)
 
1094
         << fontApp.toString()
 
1095
#else
 
1096
         << fontApp.rawName()
 
1097
#endif
 
1098
         << "\"" << endl;
1019
1099
   }
1020
1100
 
1021
1101
   const QFont& fontText = res1.getFontText();
1022
1102
   if ( !XxResources::compareFonts( fontText, res2.getFontText() ) ) {
1023
1103
      os << searchTokenName( STPARAM(kwdList), FONT_TEXT ) 
1024
 
         << ": \"" << fontText.rawName() << "\"" << endl;
 
1104
         << ": \""
 
1105
#if (QT_VERSION >= 0x030000)
 
1106
         << fontText.toString()
 
1107
#else
 
1108
         << fontText.rawName()
 
1109
#endif
 
1110
         << "\"" << endl;
1025
1111
   }
1026
1112
 
1027
1113
   int nbcolors = sizeof(colorList)/sizeof(StringToken);
1129
1215
      }
1130
1216
   }
1131
1217
 
1132
 
   if ( res1.getClipboardFormat() != res2.getClipboardFormat() ) {
1133
 
      os << searchTokenName( STPARAM(kwdList), CLIPBOARD_FORMAT ) << ": \""
1134
 
         << res1.getClipboardFormat() << "\"" << endl;
 
1218
   if ( res1.getClipboardHeadFormat() !=
 
1219
        res2.getClipboardHeadFormat() ) {
 
1220
      os << searchTokenName( STPARAM(kwdList), CLIPBOARD_HEAD_FORMAT ) << ": \""
 
1221
         << XxUtil::escapeChars( res1.getClipboardHeadFormat() ) << "\"" << endl;
 
1222
   }
 
1223
   if ( res1.getClipboardLineFormat() !=
 
1224
        res2.getClipboardLineFormat() ) {
 
1225
      os << searchTokenName( STPARAM(kwdList), CLIPBOARD_LINE_FORMAT ) << ": \""
 
1226
         << XxUtil::escapeChars( res1.getClipboardLineFormat() ) << "\"" << endl;
1135
1227
   }
1136
1228
 
1137
1229
   if ( res1.getHordiffType() != res2.getHordiffType() ) {
1175
1267
   os << searchTokenName( STPARAM(kwdList), PREFGEOMETRY ) << ": "
1176
1268
      << formatGeometry( res.getPreferredGeometry() ) << endl;
1177
1269
 
 
1270
   os << searchTokenName( STPARAM(kwdList), STYLE ) 
 
1271
      << ": \"" << res.getStyleKey() << "\"" << endl;
 
1272
 
1178
1273
   int nbaccel = sizeof(accelList)/sizeof(StringToken);
1179
1274
   const char* accelStr = searchTokenName( STPARAM(kwdList), ACCEL );
1180
1275
   for ( ii = 0; ii < nbaccel; ++ii ) {
1190
1285
 
1191
1286
   const QFont& fontApp = res.getFontApp();
1192
1287
   os << searchTokenName( STPARAM(kwdList), FONT_APP )
1193
 
      << ": \"" << fontApp.rawName().latin1() << "\"" << endl;
 
1288
      << ": \"" 
 
1289
#if (QT_VERSION >= 0x030000)
 
1290
      << fontApp.toString()
 
1291
#else
 
1292
      << fontApp.rawName()
 
1293
#endif
 
1294
      << "\"" << endl;
1194
1295
 
1195
1296
   const QFont& fontText = res.getFontText();
1196
1297
   os << searchTokenName( STPARAM(kwdList), FONT_TEXT ) 
1197
 
      << ": \"" << fontText.rawName().latin1() << "\"" << endl;
 
1298
      << ": \""
 
1299
#if (QT_VERSION >= 0x030000)
 
1300
      << fontText.toString()
 
1301
#else
 
1302
      << fontText.rawName()
 
1303
#endif
 
1304
      << "\"" << endl;
1198
1305
 
1199
1306
   int nbcolors = sizeof(colorList)/sizeof(StringToken);
1200
1307
   const char* colorStr = searchTokenName( STPARAM(kwdList), COLOR );
1274
1381
         << b1.latin1() << "\"" << endl;
1275
1382
   }
1276
1383
 
1277
 
   os << searchTokenName( STPARAM(kwdList), CLIPBOARD_FORMAT ) << ": \""
1278
 
      << res.getClipboardFormat() << "\"" << endl;
 
1384
   os << searchTokenName( STPARAM(kwdList), CLIPBOARD_HEAD_FORMAT ) << ": \""
 
1385
      << XxUtil::escapeChars( res.getClipboardHeadFormat() ) << "\"" << endl;
 
1386
   os << searchTokenName( STPARAM(kwdList), CLIPBOARD_LINE_FORMAT ) << ": \""
 
1387
      << XxUtil::escapeChars( res.getClipboardLineFormat() ) << "\"" << endl;
1279
1388
 
1280
1389
   const char* hdtstr[3] = { "None", "Single", "Multiple" };
1281
1390
   os << searchTokenName( STPARAM(kwdList), HORDIFF_TYPE ) << ": "
1328
1437
 
1329
1438
   {
1330
1439
      drbegin( os );
 
1440
      const StringToken* tok = searchToken( STPARAM(kwdList), STYLE );
 
1441
      os << tok->_name << ": \"" << res.getStyleKey() << "\"" << endl;
 
1442
      drend( os );
 
1443
      ddbegin( os );
 
1444
      os << tok->_desc << endl;
 
1445
      ddend( os );
 
1446
   }
 
1447
 
 
1448
   {
 
1449
      drbegin( os );
1331
1450
      int nbaccel = sizeof(accelList)/sizeof(StringToken);
1332
1451
      const StringToken* tok = searchToken( STPARAM(kwdList), ACCEL );
1333
1452
      os << tok->_name << "." << "[NAME]." << ": \"[ACCELERATOR]\"" << endl;
1361
1480
      const QFont& fontApp = res.getFontApp();
1362
1481
      os << tok->_name << ": \"";
1363
1482
      if ( qApp != 0 ) {
1364
 
         os << XxHelp::xmlize( fontApp.rawName() );
 
1483
         os << XxHelp::xmlize( 
 
1484
#if (QT_VERSION >= 0x030000)
 
1485
            fontApp.toString()
 
1486
#else
 
1487
            fontApp.rawName()
 
1488
#endif
 
1489
         );
1365
1490
      }
1366
1491
      else {
1367
1492
         os << "&lt;xfld-font-spec&gt;";
1379
1504
      const QFont& fontText = res.getFontText();
1380
1505
      os << tok->_name << ": \"";
1381
1506
      if ( qApp != 0 ) {
1382
 
         os << XxHelp::xmlize( fontText.rawName() );
 
1507
         os << XxHelp::xmlize(
 
1508
#if (QT_VERSION >= 0x030000)
 
1509
            fontText.toString()
 
1510
#else
 
1511
            fontText.rawName()
 
1512
#endif
 
1513
         );
1383
1514
      }
1384
1515
      else {
1385
1516
         os << "&lt;xfld-font-spec&gt;";
1606
1737
   {
1607
1738
      drbegin( os );
1608
1739
      const StringToken* tok =
1609
 
         searchToken( STPARAM(kwdList), CLIPBOARD_FORMAT );
1610
 
      QString cf = XxHelp::xmlize( res.getClipboardFormat() );
 
1740
         searchToken( STPARAM(kwdList), CLIPBOARD_HEAD_FORMAT );
 
1741
      QString cf = XxHelp::xmlize( res.getClipboardHeadFormat() );
 
1742
      os << tok->_name << ": \"" << cf << "\"" << endl;
 
1743
      drend( os );
 
1744
      ddbegin( os );
 
1745
      os << tok->_desc << endl;
 
1746
      ddend( os );
 
1747
   }
 
1748
   {
 
1749
      drbegin( os );
 
1750
      const StringToken* tok =
 
1751
         searchToken( STPARAM(kwdList), CLIPBOARD_LINE_FORMAT );
 
1752
      QString cf = XxHelp::xmlize( res.getClipboardLineFormat() );
1611
1753
      os << tok->_name << ": \"" << cf << "\"" << endl;
1612
1754
      drend( os );
1613
1755
      ddbegin( os );
1686
1828
 
1687
1829
//------------------------------------------------------------------------------
1688
1830
//
 
1831
QString XxResParser::getShowOptName( XxShowOpt bo )
 
1832
{
 
1833
   const char* stoken =
 
1834
      searchTokenName( STPARAM(showList), int(bo) );
 
1835
   return getKwdName( SHOW ) + "." + QString( stoken );
 
1836
}
 
1837
 
 
1838
//------------------------------------------------------------------------------
 
1839
//
1689
1840
QString XxResParser::getBoolOptName( XxBoolOpt bo )
1690
1841
{
1691
1842
   const char* stoken =