lyx.patch 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  1. diff -Naur lyx-1.3.1.orig/src/frontends/qt2/lengthcombo.C lyx-1.3.1/src/frontends/qt2/lengthcombo.C
  2. --- lyx-1.3.1.orig/src/frontends/qt2/lengthcombo.C 2002-12-17 21:37:11.000000000 +0100
  3. +++ lyx-1.3.1/src/frontends/qt2/lengthcombo.C 2003-04-29 20:03:52.378340752 +0200
  4. @@ -35,9 +35,9 @@
  5. }
  6. -LyXLength::UNIT LengthCombo::currentLengthItem() const
  7. +LyXLength::LENUNIT LengthCombo::currentLengthItem() const
  8. {
  9. - return static_cast<LyXLength::UNIT>(currentItem());
  10. + return static_cast<LyXLength::LENUNIT>(currentItem());
  11. }
  12. @@ -47,7 +47,7 @@
  13. }
  14. -void LengthCombo::setCurrentItem(LyXLength::UNIT unit)
  15. +void LengthCombo::setCurrentItem(LyXLength::LENUNIT unit)
  16. {
  17. QComboBox::setCurrentItem(int(unit));
  18. }
  19. diff -Naur lyx-1.3.1.orig/src/frontends/qt2/lengthcombo.h lyx-1.3.1/src/frontends/qt2/lengthcombo.h
  20. --- lyx-1.3.1.orig/src/frontends/qt2/lengthcombo.h 2002-11-17 12:24:08.000000000 +0100
  21. +++ lyx-1.3.1/src/frontends/qt2/lengthcombo.h 2003-04-29 20:03:52.378861522 +0200
  22. @@ -21,7 +21,7 @@
  23. #include "vspace.h"
  24. /**
  25. - * A combo box for selecting LyXLength::UNIT types.
  26. + * A combo box for selecting LyXLength::LENUNIT types.
  27. */
  28. class LengthCombo : public QComboBox {
  29. Q_OBJECT
  30. @@ -29,9 +29,9 @@
  31. LengthCombo(QWidget * parent, char * name);
  32. /// set the current item
  33. - virtual void setCurrentItem(LyXLength::UNIT unit);
  34. + virtual void setCurrentItem(LyXLength::LENUNIT unit);
  35. /// get the current item
  36. - LyXLength::UNIT currentLengthItem() const;
  37. + LyXLength::LENUNIT currentLengthItem() const;
  38. /// enable the widget
  39. virtual void setEnabled(bool b);
  40. @@ -39,7 +39,7 @@
  41. virtual void has_activated(int index);
  42. signals:
  43. /// the current selection has changed
  44. - void selectionChanged(LyXLength::UNIT unit);
  45. + void selectionChanged(LyXLength::LENUNIT unit);
  46. };
  47. diff -Naur lyx-1.3.1.orig/src/frontends/qt2/QDocument.C lyx-1.3.1/src/frontends/qt2/QDocument.C
  48. --- lyx-1.3.1.orig/src/frontends/qt2/QDocument.C 2003-02-12 16:32:01.000000000 +0100
  49. +++ lyx-1.3.1/src/frontends/qt2/QDocument.C 2003-04-29 20:03:52.361659250 +0200
  50. @@ -275,7 +275,7 @@
  51. break;
  52. case 3:
  53. {
  54. - LyXLength::UNIT unit =
  55. + LyXLength::LENUNIT unit =
  56. dialog_->layoutModule->skipLengthCO->
  57. currentLengthItem();
  58. double length =
  59. @@ -382,7 +382,7 @@
  60. // set the default unit
  61. // FIXME: move to controller
  62. - LyXLength::UNIT defaultUnit = LyXLength::CM;
  63. + LyXLength::LENUNIT defaultUnit = LyXLength::CM;
  64. switch (lyxrc.default_papersize) {
  65. case BufferParams::PAPER_DEFAULT: break;
  66. diff -Naur lyx-1.3.1.orig/src/frontends/qt2/QGraphics.C lyx-1.3.1/src/frontends/qt2/QGraphics.C
  67. --- lyx-1.3.1.orig/src/frontends/qt2/QGraphics.C 2002-12-17 21:37:10.000000000 +0100
  68. +++ lyx-1.3.1/src/frontends/qt2/QGraphics.C 2003-04-29 20:03:52.362682905 +0200
  69. @@ -141,7 +141,7 @@
  70. InsetGraphicsParams & igp = controller().params();
  71. // set the right default unit
  72. - LyXLength::UNIT unitDefault = LyXLength::CM;
  73. + LyXLength::LENUNIT unitDefault = LyXLength::CM;
  74. switch (lyxrc.default_papersize) {
  75. case BufferParams::PAPER_DEFAULT: break;
  76. @@ -260,7 +260,7 @@
  77. }
  78. // 2. the height (a lengthgcombo type)
  79. dialog_->height->setText(toqstr(tostr(igp.height.value())));
  80. - LyXLength::UNIT unit_ = (igp.height.value() > 0.0) ?
  81. + LyXLength::LENUNIT unit_ = (igp.height.value() > 0.0) ?
  82. igp.height.unit() : unitDefault;
  83. dialog_->heightUnit->setCurrentItem(unit_);
  84. diff -Naur lyx-1.3.1.orig/src/frontends/qt2/QMinipage.C lyx-1.3.1/src/frontends/qt2/QMinipage.C
  85. --- lyx-1.3.1.orig/src/frontends/qt2/QMinipage.C 2002-12-17 21:37:10.000000000 +0100
  86. +++ lyx-1.3.1/src/frontends/qt2/QMinipage.C 2003-04-29 20:03:52.363209925 +0200
  87. @@ -56,7 +56,7 @@
  88. void QMinipage::apply()
  89. {
  90. double const value = strToDbl(fromqstr(dialog_->widthED->text()));
  91. - LyXLength::UNIT unit = dialog_->unitsLC->currentLengthItem();
  92. + LyXLength::LENUNIT unit = dialog_->unitsLC->currentLengthItem();
  93. if (dialog_->widthED->text().isEmpty())
  94. unit = LyXLength::UNIT_NONE;
  95. diff -Naur lyx-1.3.1.orig/src/frontends/qt2/qt_helpers.C lyx-1.3.1/src/frontends/qt2/qt_helpers.C
  96. --- lyx-1.3.1.orig/src/frontends/qt2/qt_helpers.C 2002-12-17 21:37:11.000000000 +0100
  97. +++ lyx-1.3.1/src/frontends/qt2/qt_helpers.C 2003-04-29 20:03:52.363693126 +0200
  98. @@ -67,14 +67,14 @@
  99. if (isValidGlueLength(fromqstr(length)))
  100. return fromqstr(length);
  101. - LyXLength::UNIT unit = combo->currentLengthItem();
  102. + LyXLength::LENUNIT unit = combo->currentLengthItem();
  103. return LyXLength(length.toDouble(), unit).asString();
  104. }
  105. void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
  106. - string const & len, LyXLength::UNIT defaultUnit)
  107. + string const & len, LyXLength::LENUNIT defaultUnit)
  108. {
  109. if (len.empty()) {
  110. // no length (UNIT_NONE)
  111. diff -Naur lyx-1.3.1.orig/src/frontends/qt2/qt_helpers.h lyx-1.3.1/src/frontends/qt2/qt_helpers.h
  112. --- lyx-1.3.1.orig/src/frontends/qt2/qt_helpers.h 2002-12-17 21:37:11.000000000 +0100
  113. +++ lyx-1.3.1/src/frontends/qt2/qt_helpers.h 2003-04-29 20:03:52.364154800 +0200
  114. @@ -35,7 +35,7 @@
  115. /// method to set widgets from a LyXLength
  116. void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
  117. - string const & len, LyXLength::UNIT default_unit);
  118. + string const & len, LyXLength::LENUNIT default_unit);
  119. /**
  120. * toqstr - convert char * into unicode
  121. diff -Naur lyx-1.3.1.orig/src/frontends/qt2/QTabular.C lyx-1.3.1/src/frontends/qt2/QTabular.C
  122. --- lyx-1.3.1.orig/src/frontends/qt2/QTabular.C 2003-02-07 15:31:40.000000000 +0100
  123. +++ lyx-1.3.1/src/frontends/qt2/QTabular.C 2003-04-29 20:03:52.364906771 +0200
  124. @@ -165,7 +165,7 @@
  125. bool const isReadonly = bc().bp().isReadOnly();
  126. dialog_->specialAlignmentED->setEnabled(!isReadonly);
  127. - LyXLength::UNIT default_unit = controller().metric() ? LyXLength::CM : LyXLength::IN;
  128. + LyXLength::LENUNIT default_unit = controller().metric() ? LyXLength::CM : LyXLength::IN;
  129. if (!pwidth.zero()) {
  130. dialog_->widthED->setText(toqstr(tostr(pwidth.value())));
  131. dialog_->widthUnit->setCurrentItem(pwidth.unit());
  132. diff -Naur lyx-1.3.1.orig/src/frontends/qt2/QWrap.C lyx-1.3.1/src/frontends/qt2/QWrap.C
  133. --- lyx-1.3.1.orig/src/frontends/qt2/QWrap.C 2002-12-17 21:37:10.000000000 +0100
  134. +++ lyx-1.3.1/src/frontends/qt2/QWrap.C 2003-04-29 20:03:52.365432794 +0200
  135. @@ -56,7 +56,7 @@
  136. void QWrap::apply()
  137. {
  138. double const value = strToDbl(fromqstr(dialog_->widthED->text()));
  139. - LyXLength::UNIT unit = dialog_->unitsLC->currentLengthItem();
  140. + LyXLength::LENUNIT unit = dialog_->unitsLC->currentLengthItem();
  141. if (dialog_->widthED->text().isEmpty())
  142. unit = LyXLength::UNIT_NONE;
  143. diff -Naur lyx-1.3.1.orig/src/frontends/qt2/ui/ClassModuleBase.ui lyx-1.3.1/src/frontends/qt2/ui/ClassModuleBase.ui
  144. --- lyx-1.3.1.orig/src/frontends/qt2/ui/ClassModuleBase.ui 2003-02-18 15:02:18.000000000 +0100
  145. +++ lyx-1.3.1/src/frontends/qt2/ui/ClassModuleBase.ui 2003-04-29 20:03:52.366169585 +0200
  146. @@ -322,7 +322,7 @@
  147. <verdata>5</verdata>
  148. </sizepolicy>
  149. <pixmap>image0</pixmap>
  150. - <signal>selectionChanged(LyXLength::UNIT)</signal>
  151. + <signal>selectionChanged(LyXLength::LENUNIT)</signal>
  152. </customwidget>
  153. </customwidgets>
  154. <images>
  155. diff -Naur lyx-1.3.1.orig/src/frontends/qt2/ui/MarginsModuleBase.ui lyx-1.3.1/src/frontends/qt2/ui/MarginsModuleBase.ui
  156. --- lyx-1.3.1.orig/src/frontends/qt2/ui/MarginsModuleBase.ui 2003-02-18 15:02:18.000000000 +0100
  157. +++ lyx-1.3.1/src/frontends/qt2/ui/MarginsModuleBase.ui 2003-04-29 20:03:52.366987455 +0200
  158. @@ -401,7 +401,7 @@
  159. <verdata>5</verdata>
  160. </sizepolicy>
  161. <pixmap>image0</pixmap>
  162. - <signal>selectionChanged(LyXLength::UNIT)</signal>
  163. + <signal>selectionChanged(LyXLength::LENUNIT)</signal>
  164. </customwidget>
  165. </customwidgets>
  166. <images>
  167. diff -Naur lyx-1.3.1.orig/src/frontends/qt2/ui/PaperModuleBase.ui lyx-1.3.1/src/frontends/qt2/ui/PaperModuleBase.ui
  168. --- lyx-1.3.1.orig/src/frontends/qt2/ui/PaperModuleBase.ui 2003-01-23 17:23:39.000000000 +0100
  169. +++ lyx-1.3.1/src/frontends/qt2/ui/PaperModuleBase.ui 2003-04-29 20:03:52.367739413 +0200
  170. @@ -286,7 +286,7 @@
  171. <verdata>5</verdata>
  172. </sizepolicy>
  173. <pixmap>image0</pixmap>
  174. - <signal>selectionChanged(LyXLength::UNIT)</signal>
  175. + <signal>selectionChanged(LyXLength::LENUNIT)</signal>
  176. </customwidget>
  177. </customwidgets>
  178. <images>
  179. diff -Naur lyx-1.3.1.orig/src/frontends/qt2/ui/QGraphicsDialogBase.ui lyx-1.3.1/src/frontends/qt2/ui/QGraphicsDialogBase.ui
  180. --- lyx-1.3.1.orig/src/frontends/qt2/ui/QGraphicsDialogBase.ui 2003-01-23 17:23:40.000000000 +0100
  181. +++ lyx-1.3.1/src/frontends/qt2/ui/QGraphicsDialogBase.ui 2003-04-29 20:03:52.370563925 +0200
  182. @@ -1212,7 +1212,7 @@
  183. <verdata>5</verdata>
  184. </sizepolicy>
  185. <pixmap>image0</pixmap>
  186. - <signal>selectionChanged(LyXLength::UNIT)</signal>
  187. + <signal>selectionChanged(LyXLength::LENUNIT)</signal>
  188. </customwidget>
  189. </customwidgets>
  190. <images>
  191. diff -Naur lyx-1.3.1.orig/src/frontends/qt2/ui/QMinipageDialogBase.ui lyx-1.3.1/src/frontends/qt2/ui/QMinipageDialogBase.ui
  192. --- lyx-1.3.1.orig/src/frontends/qt2/ui/QMinipageDialogBase.ui 2003-02-25 15:10:05.000000000 +0100
  193. +++ lyx-1.3.1/src/frontends/qt2/ui/QMinipageDialogBase.ui 2003-04-29 20:03:52.371717175 +0200
  194. @@ -346,7 +346,7 @@
  195. <verdata>5</verdata>
  196. </sizepolicy>
  197. <pixmap>image0</pixmap>
  198. - <signal>selectionChanged(LyXLength::UNIT)</signal>
  199. + <signal>selectionChanged(LyXLength::LENUNIT)</signal>
  200. </customwidget>
  201. </customwidgets>
  202. <images>
  203. @@ -364,7 +364,7 @@
  204. </connection>
  205. <connection>
  206. <sender>unitsLC</sender>
  207. - <signal>selectionChanged(LyXLength::UNIT)</signal>
  208. + <signal>selectionChanged(LyXLength::LENUNIT)</signal>
  209. <receiver>QMinipageDialogBase</receiver>
  210. <slot>change_adaptor()</slot>
  211. </connection>
  212. diff -Naur lyx-1.3.1.orig/src/frontends/qt2/ui/QTabularDialogBase.ui lyx-1.3.1/src/frontends/qt2/ui/QTabularDialogBase.ui
  213. --- lyx-1.3.1.orig/src/frontends/qt2/ui/QTabularDialogBase.ui 2003-01-23 17:23:40.000000000 +0100
  214. +++ lyx-1.3.1/src/frontends/qt2/ui/QTabularDialogBase.ui 2003-04-29 20:03:52.374644549 +0200
  215. @@ -1356,7 +1356,7 @@
  216. <verdata>5</verdata>
  217. </sizepolicy>
  218. <pixmap>image0</pixmap>
  219. - <signal>selectionChanged(LyXLength::UNIT)</signal>
  220. + <signal>selectionChanged(LyXLength::LENUNIT)</signal>
  221. </customwidget>
  222. <customwidget>
  223. <class>QSetBorder</class>
  224. @@ -1577,7 +1577,7 @@
  225. </connection>
  226. <connection>
  227. <sender>widthUnit</sender>
  228. - <signal>selectionChanged(LyXLength::UNIT)</signal>
  229. + <signal>selectionChanged(LyXLength::LENUNIT)</signal>
  230. <receiver>QTabularDialogBase</receiver>
  231. <slot>width_changed()</slot>
  232. </connection>
  233. diff -Naur lyx-1.3.1.orig/src/frontends/qt2/ui/QWrapDialogBase.ui lyx-1.3.1/src/frontends/qt2/ui/QWrapDialogBase.ui
  234. --- lyx-1.3.1.orig/src/frontends/qt2/ui/QWrapDialogBase.ui 2003-01-13 11:33:23.000000000 +0100
  235. +++ lyx-1.3.1/src/frontends/qt2/ui/QWrapDialogBase.ui 2003-04-29 20:03:52.375768392 +0200
  236. @@ -340,7 +340,7 @@
  237. <verdata>5</verdata>
  238. </sizepolicy>
  239. <pixmap>image0</pixmap>
  240. - <signal>selectionChanged(LyXLength::UNIT)</signal>
  241. + <signal>selectionChanged(LyXLength::LENUNIT)</signal>
  242. </customwidget>
  243. </customwidgets>
  244. <images>
  245. @@ -358,7 +358,7 @@
  246. </connection>
  247. <connection>
  248. <sender>unitsLC</sender>
  249. - <signal>selectionChanged(LyXLength::UNIT)</signal>
  250. + <signal>selectionChanged(LyXLength::LENUNIT)</signal>
  251. <receiver>QWrapDialogBase</receiver>
  252. <slot>change_adaptor()</slot>
  253. </connection>
  254. diff -Naur lyx-1.3.1.orig/src/lengthcommon.C lyx-1.3.1/src/lengthcommon.C
  255. --- lyx-1.3.1.orig/src/lengthcommon.C 2002-11-25 02:15:10.000000000 +0100
  256. +++ lyx-1.3.1/src/lengthcommon.C 2003-04-29 20:03:52.376260266 +0200
  257. @@ -45,10 +45,10 @@
  258. // N_("twidth%"), N_("cwidth%"), N_("pwidth%"), N_("lwidth%"),
  259. // N_("theight%"), N_("pheight%") };
  260. -LyXLength::UNIT unitFromString(string const & data)
  261. +LyXLength::LENUNIT unitFromString(string const & data)
  262. {
  263. int i = 0;
  264. while (i < num_units && data != unit_name[i])
  265. ++i;
  266. - return static_cast<LyXLength::UNIT>(i);
  267. + return static_cast<LyXLength::LENUNIT>(i);
  268. }
  269. diff -Naur lyx-1.3.1.orig/src/lengthcommon.h lyx-1.3.1/src/lengthcommon.h
  270. --- lyx-1.3.1.orig/src/lengthcommon.h 2002-11-17 12:24:08.000000000 +0100
  271. +++ lyx-1.3.1/src/lengthcommon.h 2003-04-29 20:03:52.376643680 +0200
  272. @@ -19,7 +19,7 @@
  273. extern char const * unit_name_ltx[];
  274. /// return the unit given a string representation such as "cm"
  275. -LyXLength::UNIT unitFromString(string const & data);
  276. +LyXLength::LENUNIT unitFromString(string const & data);
  277. #endif // LENGTH_COMMON_H
  278. diff -Naur lyx-1.3.1.orig/src/lyxlength.C lyx-1.3.1/src/lyxlength.C
  279. --- lyx-1.3.1.orig/src/lyxlength.C 2002-12-04 03:57:14.000000000 +0100
  280. +++ lyx-1.3.1/src/lyxlength.C 2003-04-29 20:09:34.116688131 +0200
  281. @@ -31,7 +31,7 @@
  282. {}
  283. -LyXLength::LyXLength(double v, LyXLength::UNIT u)
  284. +LyXLength::LyXLength(double v, LyXLength::LENUNIT u)
  285. : val_(v), unit_(u)
  286. {}
  287. @@ -99,7 +99,7 @@
  288. }
  289. -LyXLength::UNIT LyXLength::unit() const
  290. +LyXLength::LENUNIT LyXLength::unit() const
  291. {
  292. return unit_;
  293. }
  294. @@ -111,7 +111,7 @@
  295. }
  296. -void LyXLength::unit(LyXLength::UNIT u)
  297. +void LyXLength::unit(LyXLength::LENUNIT u)
  298. {
  299. unit_ = u;
  300. }
  301. @@ -156,7 +156,7 @@
  302. double result = 0.0;
  303. switch (unit_) {
  304. - case LyXLength::SP:
  305. + case LyXLength::LYX_SP:
  306. // Scaled point: sp = 1/65536 pt
  307. result = zoom * dpi * val_
  308. / (72.27 * 65536); // 4736286.7
  309. @@ -181,7 +181,7 @@
  310. result = zoom * dpi * val_
  311. / 25.4; // 25.4
  312. break;
  313. - case LyXLength::PC:
  314. + case LyXLength::LYX_PC:
  315. // Pica: 1 pc = 12 pt
  316. result = zoom * dpi * val_
  317. / (72.27 / 12); // 6.0225
  318. diff -Naur lyx-1.3.1.orig/src/lyxlength.h lyx-1.3.1/src/lyxlength.h
  319. --- lyx-1.3.1.orig/src/lyxlength.h 2002-12-04 03:57:14.000000000 +0100
  320. +++ lyx-1.3.1/src/lyxlength.h 2003-04-29 20:05:52.608542869 +0200
  321. @@ -23,13 +23,13 @@
  322. class LyXLength {
  323. public:
  324. /// length units
  325. - enum UNIT {
  326. - SP, ///< Scaled point (65536sp = 1pt) TeX's smallest unit.
  327. + enum LENUNIT {
  328. + LYX_SP, ///< Scaled point (65536sp = 1pt) TeX's smallest unit.
  329. PT, ///< Point = 1/72.27in = 0.351mm
  330. BP, ///< Big point (72bp = 1in), also PostScript point
  331. DD, ///< Didot point = 1/72 of a French inch, = 0.376mm
  332. MM, ///< Millimeter = 2.845pt
  333. - PC, ///< Pica = 12pt = 4.218mm
  334. + LYX_PC, ///< Pica = 12pt = 4.218mm
  335. CC, ///< Cicero = 12dd = 4.531mm
  336. CM, ///< Centimeter = 10mm = 2.371pc
  337. IN, ///< Inch = 25.4mm = 72.27pt = 6.022pc
  338. @@ -48,7 +48,7 @@
  339. ///
  340. LyXLength();
  341. ///
  342. - LyXLength(double v, LyXLength::UNIT u);
  343. + LyXLength(double v, LyXLength::LENUNIT u);
  344. /// "data" must be a decimal number, followed by a unit
  345. explicit LyXLength(string const & data);
  346. @@ -56,11 +56,11 @@
  347. ///
  348. double value() const;
  349. ///
  350. - LyXLength::UNIT unit() const;
  351. + LyXLength::LENUNIT unit() const;
  352. ///
  353. void value(double);
  354. ///
  355. - void unit(LyXLength::UNIT unit);
  356. + void unit(LyXLength::LENUNIT unit);
  357. ///
  358. bool zero() const;
  359. ///
  360. @@ -82,7 +82,7 @@
  361. ///
  362. double val_;
  363. ///
  364. - LyXLength::UNIT unit_;
  365. + LyXLength::LENUNIT unit_;
  366. };
  367. ///
  368. diff -Naur lyx-1.3.1.orig/src/vspace.C lyx-1.3.1/src/vspace.C
  369. --- lyx-1.3.1.orig/src/vspace.C 2002-12-01 23:59:17.000000000 +0100
  370. +++ lyx-1.3.1/src/vspace.C 2003-04-29 20:03:52.379626127 +0200
  371. @@ -32,7 +32,7 @@
  372. /// used to return numeric values in parsing vspace
  373. double number[4] = { 0, 0, 0, 0 };
  374. /// used to return unit types in parsing vspace
  375. -LyXLength::UNIT unit[4] = { LyXLength::UNIT_NONE,
  376. +LyXLength::LENUNIT unit[4] = { LyXLength::UNIT_NONE,
  377. LyXLength::UNIT_NONE,
  378. LyXLength::UNIT_NONE,
  379. LyXLength::UNIT_NONE };