Commit Graph

1916 Commits

Author SHA1 Message Date
Abdelrazak Younes
d075cb25b8 This patch transfer Inset::destroyed signal to InsetText and InsetMathNest thus freeing some memory as normal math chars and symbols won't have it.
It also solve a crash with non disconnect boost::signal and gcc-3.3 or 3.4.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18592 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-31 12:30:17 +00:00
Stefan Schimanski
880b6c4d6e 1. switch LFUN_UP/DOWN handling to a structural approach, i.e. the
dispatchers in mathed and text only do local work, i.e. only try to
move the cursor with their local knowledge, not globally as before in
the Cursor::goUpDown function before. The old approach used one of
brutefind functions as a last way out to really move the cursor up or
down. The result was some strange behavior that the nearest inset was
selected when jumping from math to text, not one in the next line. 
2. removed LFUN_FINISHED_UP/DOWN, as there seem to be no effect and it
seems to be obsolete.
3. target_x is working again, mainly by adding a textTargetOffset_
member to the Cursor which keeps the difference between the target_x
and the actual position of the cursor on screen. As long as
pos+offset=target is fulfilled the target_x is not touched and the
cursor keep the column while going up/down.
4. moved the text cursor up/down code to the Cursor class, in analogy
to the mathed code.
5. For 1 it is necessary to know the cursor position before the
dispatch. So this data is added to the Cursor.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18569 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-29 20:53:32 +00:00
Stefan Schimanski
2c1c1b07a0 * Moving up from lower index shouldn't depend on existance of upper (and other
way round), OK by Uwe and Abdel


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18567 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-29 20:41:31 +00:00
Lars Gullik Bjønnes
897436efbb Whitespace cleanup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18550 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-28 22:27:45 +00:00
Stefan Schimanski
93baf8eb9b * do not lookup the same macro all the time
* only update the representation if anything was changed (this gives a
  huge speedup), fixes #2452
* minor cleanup of the code, especially setting up the coordinate
  cache. Without this can lead to crashes if the macros do not mention
  all the arguments. 
* And a last fix included makes sure that the metrics are always in
  sync with the drawing. Before it was possible to go into the macro
  with the cursor in a way that the metrics were for the viewing mode,
  but the drawing was done for editing.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18489 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-24 16:29:40 +00:00
Stefan Schimanski
96860ffe93 * only antialias the whole polyline or no segment at all
* Sqrt and Root draw their vertical horizontal line with a single line command to make them showup non-antialiased.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18419 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-19 10:52:47 +00:00
Bo Peng
73849af5df InsetListings: change the interface of diaplay function and allow AlignLeft. Applied to InsetListings. Fixes bug 3617, 3618
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18404 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-18 14:32:29 +00:00
Jürgen Spitzmüller
4912255342 * src/mathed/IndetMathNest.cpp (getStatus):
- disable specialchar inset (bug 3590)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18354 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-15 17:33:42 +00:00
Abdelrazak Younes
55a26d72d4 Fix cursor movement inside insets by Dov Feldstern.
* Bidi.[h,cpp]: new helper function reverseDirectionNeeded()

* Cursor::isRTL(): delete unused method



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18350 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-15 17:19:05 +00:00
Bo Peng
dfa6012292 Remove unused var in InsetMathHull.cpp
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18281 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-12 22:51:13 +00:00
Bo Peng
4d0552dd80 add color mathcorners and implement mathbg (partially)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18277 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-12 06:24:46 +00:00
Abdelrazak Younes
b9765984c0 remove unneeded header.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18267 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-11 14:19:59 +00:00
Abdelrazak Younes
bd3e07179f Remove optimization to avoid char and symbol metrics calculation. This was incompatible with the way the font zooming works in LyX.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18266 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-11 14:17:53 +00:00
Bo Peng
e44fc571cc revert wrongly committed patch
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18263 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-11 02:34:56 +00:00
Bo Peng
a8e9fe82d0 lib/lyx2lyx/lyx_1_5.py: fix revert of listings insets
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18262 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-11 02:28:14 +00:00
Abdelrazak Younes
31c9218c7e Fix cursor movement in RTL embedded math insets by Elazar Leibovich.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18241 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-09 09:42:33 +00:00
Edwin Leuven
1f9652587e * do not ignore "requires" field in MathMacro
(fixes http://bugzilla.lyx.org/show_bug.cgi?id=3520)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18199 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-04 15:30:27 +00:00
Michael Schmitt
a746aa5214 "fix" bug #3332 (plain text export depends on the menu language)
Please note that method B_ (translate text to buffer language) is presently broken (at least on Windows)!


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18143 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-01 08:26:40 +00:00
Abdelrazak Younes
2640b21228 * Inset and derivatives: insetName() -> name()
* InsetMath::name(): deleted.

* buffer_funcs.cpp:setCaptions() fix potential bug by using docstring copy instead of reference while using Inset::name.





git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18119 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-30 14:39:09 +00:00
Abdelrazak Younes
9d37c60314 Get rid of GridInsetMailer: this is completely useless and unused and consumes a lot of CPU when editing a file with a lot of macro (which is a heavy user of InsetMathGrid).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18117 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-30 12:27:12 +00:00
Abdelrazak Younes
9fa2880677 revert unrelated change in rev 18110 .
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18111 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-30 10:44:23 +00:00
Abdelrazak Younes
00e1771f94 Now that setPosCache() is in Inset, InsetMathDim is not needed anymore: ERASED!
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18110 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-30 10:31:51 +00:00
André Pönitz
e0d54dd3b4 LyXText -> Text
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18103 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-29 23:33:02 +00:00
André Pönitz
0bf9ac02a8 rename LyXLayout into Layout
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18096 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-29 18:58:28 +00:00
André Pönitz
fc6ce7cd08 rename LyXFont to Font except in tex2lyx
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18095 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-29 18:17:15 +00:00
André Pönitz
d079c908b3 rename LyXServer into Server
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18092 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-29 16:22:46 +00:00
André Pönitz
32871c1284 rename InsetBase to Inset
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18089 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-29 13:39:47 +00:00
Bo Peng
d30304cf84 Rename class RefInset to InsetMathRef
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18077 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-28 20:49:56 +00:00
Bo Peng
e36fba33ab Last (?) batch of renames:
src/frontends/Alert.h src/frontends/alert.h
src/frontends/Alert.cpp src/frontends/alert.cpp
src/frontends/Alert_pimpl.cpp src/frontends/alert_pimpl.cpp
src/frontends/qt4/Alert_pimpl.cpp src/frontends/qt4/alert_pimpl.cpp
src/frontends/controllers/ButtonPolicies.cpp src/frontends/controllers/ButtonPolicy.cpp
src/frontends/controllers/ButtonPolicies.h src/frontends/controllers/ButtonPolicy.h
src/insets/InsetEnv.cpp src/insets/InsetEnvironment.cpp
src/insets/InsetEnv.h src/insets/InsetEnvironment.h
src/mathed/MathMacroTable.h src/mathed/MacroTable.h
src/mathed/MathMacroTable.cpp src/mathed/MacroTable.cpp
src/lyx_cb.h src/callback.h
src/lyx_cb.cpp src/callback.cpp
src/UpdateFlags.h src/update_flags.h


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18076 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-28 20:44:46 +00:00
André Pönitz
8c622e4ff0 rename/merge LyXLength related stuff
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18067 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-28 12:58:49 +00:00
André Pönitz
5008ee540f rename LColor into Color
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18046 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-26 17:34:20 +00:00
André Pönitz
31059d1741 rename MathArray into MathData
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18043 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-26 16:05:57 +00:00
André Pönitz
42123ab8a7 rename LCursor->Cursor
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18040 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-26 14:56:30 +00:00
André Pönitz
39e79d8602 rename LyXLex into Lexer
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18033 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-26 11:30:54 +00:00
Bo Peng
00e305c9d9 Rename .C ==> .cpp for files in src, part one
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18018 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-26 04:41:58 +00:00
Bo Peng
176715bd56 Fix a few rename inconsistencies discovered by JMarc in insets and mathed, step 2
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17992 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-25 16:12:54 +00:00
Bo Peng
6e3a75969b Fix a few rename inconsistencies discovered by JMarc in insets and mathed, step 1
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17991 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-25 16:11:45 +00:00
Bo Peng
f497296c30 Rename files in src/mathed and src/graphics from .C to .cpp, step 2
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17969 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-25 03:03:25 +00:00
Bo Peng
fcfcc3ff6e Rename files in src/mathed and src/graphics from .C to .cpp, step 1
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17968 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-25 03:01:35 +00:00
Bo Peng
b6a2a76700 Rename insets/insetxxx to insets/InsetXxx, part 1
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17964 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-25 01:24:38 +00:00
Abdelrazak Younes
898d0f05dd fix std::endl declaration.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17917 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-23 13:12:23 +00:00
Michael Schmitt
3ac4f80ef4 * src/mathed/BUGS: remove old stuff
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17908 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-22 10:11:16 +00:00
Abdelrazak Younes
058aecf539 fix std declaration.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17901 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-22 08:41:50 +00:00
Abdelrazak Younes
24c8ca10d2 Trying to solve bug-2452, I optimized some of the most significant problems outlined in the profile report attached in there.
This commit avoids unnecessary metrics recalculations by caching the last LyXFont used. I had to cleanup the width(), ascent() and descend() redundancies by transferring that to InsetBase.

InsetMathDim should go now as it is not really needed.

* InsetBase: properly handle inset Dimension.

* InsetOld: get rid of redundant width(), ascent() and descent()

* InsetMathDim: ditto

* InsetMathChar::metrics(): avoid metrics recalculation if font is unchanged.

* InsetMathSymbol::metrics(): ditto

* InsetMathKern: use InsetBase::dim_ instead of local ones.

* InsetMathSpace:
  - use InsetBase::dim_ instead of local ones.
  - space to width transformation transferred to anonymous namespace.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17899 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-22 08:26:06 +00:00
Abdelrazak Younes
e841d41a92 Optimisation: remove the inset mailer used in the dtor because it was far from negligible in profile results with Macro (which is a heavy user of thi MathGrid class). This matrix dialog showing/hiding was not working anyway.
* InsetMathGrid::~InsetMathGrid(): deleted.




git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17896 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-21 22:33:07 +00:00
Abdelrazak Younes
c9dffa27a2 * InsetMathNest::cell(): inlined because of profile.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17895 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-21 22:28:21 +00:00
Edwin Leuven
22fb43fd8f * removal of math panel
some code is moved from QMath 
  to QDelimiterDialog and QMathMatrixDialog
  for the rest pretty mechanical

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17872 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-19 21:42:42 +00:00
Abdelrazak Younes
ab13c59979 commit again the drawing fix of revision 17826. This was accidentally reverted in revision 17841.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17849 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-18 09:59:02 +00:00
Abdelrazak Younes
1d55e044d0 Fix Andre's name.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17842 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-17 16:58:59 +00:00
Abdelrazak Younes
49395dd85e Real fix for bug 1395 by Stefan Schimanski, this commit replace the one done at revision 17836 which was reverted!
Locking counter added to MacroData: it is increased before drawing/
metric calculations and decreased afterwards in InsetMathMacro. If a  
macro is already locked at that point, "Self reference: \foo" is  
drawn instead of the macro definition to avoid endless loops.  
Moreover inside of the arguments of the macro the counter is  
temporarily decreased as those cases do not cause loops. (fixes bug  
#1395)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17841 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-17 16:52:43 +00:00
Abdelrazak Younes
86c1053f51 Revert to revision 17835: I applied the wrong tree!
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17840 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-17 16:49:17 +00:00
Abdelrazak Younes
0a1d3c186a style correction.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17839 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-17 16:35:13 +00:00
Abdelrazak Younes
9450626942 Fix compilation. Use BOOST_ASSERT instead of assert()
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17838 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-17 15:59:47 +00:00
Abdelrazak Younes
71e8668375 Fix bug 1395 by Stefan Schimanski:
Locking counter added to MacroData: it is increased before drawing/
metric calculations and decreased afterwards in InsetMathMacro. If a  
macro is already locked at that point, "Self reference: \foo" is  
drawn instead of the macro definition to avoid endless loops.  
Moreover inside of the arguments of the macro the counter is  
temporarily decreased as those cases do not cause loops. (fixes bug  
#1395)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17836 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-17 13:15:00 +00:00
Abdelrazak Younes
e216ceee77 Fixed bug 3449 by Stefan Schimanski:
http://bugzilla.lyx.org/show_bug.cgi?id=3449

One problem was no metric calculation was done for insets on cursor movement. Of course scrolling or entering character caused the missing metric calls, hence the described behavior in the bug report. This is fixed by re-implementing idxLast(), idxFirst() and notifyCursorLeaves().

Another problem was that 'a' and '1' were drawn at the same position because of a mis-calculation of the x-position in InsetMathMacro::draw().



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17826 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-16 14:42:53 +00:00
Abdelrazak Younes
ab2b590abe fix comment
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17795 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-13 11:49:58 +00:00
Abdelrazak Younes
008287fd3d Fix a missing metrics update when clicking within a previewed formula.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17794 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-13 11:35:11 +00:00
Enrico Forestieri
c58f3252e5 Fix remaining issues with big delimiters
* src/mathed/MathSupport.C:
	add "slash" to the decoration table.

	* src/mathed/InsetMathBig.C
	(InsetMathBig::draw): don't remove backslash delimiter.
	(InsetMathBig::isBigInsetDelim): add "\\" and "\slash" to
	the delimiters table.

	* src/frontends/qt4/QDelimiterDialog.C
	(fix_name): return "\\" instead of "\backslash" as that now
	works after the fixes above.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17771 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-11 00:27:35 +00:00
Enrico Forestieri
5dc60654bb Fix gui for slash and backslash big/variable size delimiters
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17755 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-07 02:07:15 +00:00
Georg Baum
ea1a4a886c Fix dialog interaction with InsetMathRef (leftover from changed
InsetCommandParams)

	* src/mathed/InsetMathCommand.[Ch]
	(CommandInset::createDialogStr): Move to InsetMathRef, since it is
	no longer generic.

	* src/mathed/MathFactory.C
	(createInsetMath_fromDialogStr): Use InsetCommandMailer instead of
	manual parsing. This ensures that the syntax is correct.

	* src/mathed/InsetMathRef.[Ch]
	(InsetMathRef::createDialogStr): Moved here from InsetMathCommand,
	but use InsetCommandMailer.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17738 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-06 08:30:37 +00:00
Abdelrazak Younes
4be4fe2af8 Fix bug 3408 and 3408:
http://bugzilla.lyx.org/show_bug.cgi?id=3408
http://bugzilla.lyx.org/show_bug.cgi?id=3409

The missing redraw was introduced with "Draw only decoration" optimisation in mathed. Setting the flags to Update::Force in case of Preview mode fixes the problem.

* InsetMathHull::notifyCursorLeaves(): set the cursor flags to 'Force'

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17718 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-04 16:17:24 +00:00
Georg Baum
329d50d90d Use new isAlphaASCII and isDigitASCII functions instead of isalpha and
isdigit from ctype.h, because the latter are locale dependant and do not
work with char_type.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17698 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-02 15:21:36 +00:00
André Pönitz
15b343d8f3 better fix for bug #17652
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17676 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-01 13:06:41 +00:00
André Pönitz
83b326d204 avoid evalutation of lyxerr arguments unless really needed
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17675 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-01 10:09:49 +00:00
André Pönitz
d523af4b05 fix #3130
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17652 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-30 19:28:03 +00:00
André Pönitz
69caf3bfb7 revert 17649. This code was only a temporary mean to help fixing #3396. Apart from that it is not needed to get a proper stack trace and clutters the source
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17651 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-30 17:20:27 +00:00
André Pönitz
4ab39351e2 fix 3396
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17650 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-30 17:16:26 +00:00
Abdelrazak Younes
7b5c0b55d8 avoid recursive dump() in case of math parsing problem.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17649 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-30 16:29:35 +00:00
André Pönitz
9d8421b6b3 remove a space
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17635 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-29 22:01:21 +00:00
Enrico Forestieri
33707ecc13 Small refinement to subscript placement
* src/mathed/InsetMathScript.C
	(InsetMathScript::dy01): Make sure that the subscript is placed
	not higher than when it appears alone.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17602 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-28 00:02:15 +00:00
André Pönitz
a3018e8977 This is supposed to fix #3189 basically by avoiding the error condition:
The string representation of math data stored in an undo could not be
read back. Now we store the math directly and do not convert to and from
a string.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17591 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-27 14:33:19 +00:00
Enrico Forestieri
a33f6ed840 Avoid random kerning values.
* src/mathed/MathData.C
	(MathArray::metrics): Explicitly initialize kerning_ as it may
	contain random data when the nucleus is an empty MathFont inset.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17560 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-26 00:05:28 +00:00
Enrico Forestieri
e53e4d0672 Account for kerning when positioning scripts in the MathFontOld and
MathUnknown insets.

	* src/mathed/InsetMathUnknown.C
	(InsetMathUnknown::metrics): Cache kerning of last char.

	* src/mathed/InsetMathUnknown.h
	* src/mathed/InsetMathFontOld.h
	(InsetMathUnknown::kerning): New. Return cached kerning value.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17528 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-23 18:55:50 +00:00
Enrico Forestieri
7fb8a4a595 Correctly implement rule 18a in appendix G of the TeXbook
* src/mathed/InsetMathScript.C
	(isAlphaSymbol): New. Return true if nucleus is a letter or a
	symbol whose type is mathord or mathalpha.
	(InsetMathScript::dy01): Apply rule 18a accounting for nucleus type.

	* src/mathed/MathData.C
	(MathArray::metrics): Account for the fact that some fonts (eg.
	mathcal) do not have a lower case x glyph.

	* src/mathed/InsetMathSymbol.[Ch]
	(InsetMathSymbol::isOrdAlpha): New. Return true if type of symbol
	is mathord or mathalpha.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17518 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-23 02:12:48 +00:00
Enrico Forestieri
5b2d7ec76d Account for real width of nucleus when positioning superscripts in mathed
* src/mathed/MathSupport.[Ch]
	(mathed_char_kerning): New. Compute right kerning for the given
	font and character as the difference between right bearing and
	logical width.

	* src/mathed/InsetMathScript.[Ch]
	(InsetMathScript::dx1, InsetMathScript::metrics): Account for
	nucleus right kerning.
	(InsetMathScript::nker): New. Return the nucleus right kerning
	if positive, zero otherwise.

	* src/mathed/MathData.[Ch]
	(MathArray::metrics): Cache the nucleus right kerning value.
	(MathArray::kerning): New. Return cached right kerning.

	* src/mathed/InsetMathChar.[Ch]
	(InsetMathChar::metrics): Cache the character right kerning.
	(InsetMathChar::kerning): New. Return cached right kerning.

	* src/mathed/InsetMath.h
	(InsetMath::kerning): New virtual method.

	* src/mathed/InsetMathSymbol.[Ch]
	(InsetMathSymbol::metrics): Cache the symbol right kerning.
	(InsetMathSymbol::kerning): New. Return cached right kerning.

	* src/mathed/InsetMathFont.[Ch]
	(InsetMathFont::kerning): New. Return cached right kerning.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17497 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-21 17:21:59 +00:00
Georg Baum
b0cfb6c53b Fix bug 2932 (non-UI part only)
* src/mathed/InsetMathGrid.[Ch]
	(InsetMathGrid::allow_pagebreak_): New member

	* src/mathed/InsetMathGrid.C
	(InsetMathGrid::eolString): Output \\* if allow_pagebreak_ is false

	* src/mathed/MathParser.C
	(addRow): Set allow_pagebreak_ in rowinfo if needed
	(Parser::parse1): Parse '\\*' correctly


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17484 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-19 16:08:17 +00:00
Georg Baum
1716b7323f compile fix (forgot this in rev. 17470)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17483 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-19 15:58:20 +00:00
Georg Baum
ceea696904 silence compiler warning
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17476 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-18 16:52:54 +00:00
Enrico Forestieri
54cd34f60b Fig bug 3335 (http://bugzilla.lyx.org/show_bug.cgi?id=3335)
* src/mathed/InsetMathScript.[Ch]
	(InsetMathScript::dy01): new, jointly account for both superscript
	and subscript according to the rules in Appendix G of the TeXbook.
	(InsetMathScript::dy0, InsetMathScript::dy1): set ascent and descent
	values using dy01 for non-limits super/subscripts.
	(InsetMathScript::metrics): account for the new super/subscript
	placement rules when setting ascent and descent values.

	* src/mathed/MathData.[Ch]
	(MathArray::metrics): cache parameters needed for super/subscript
	placement. When nucleus is not empty, set its ascent value to zero
	such that it is correctly computed later, otherwise ascent values
	less than that of an 'I' are not reported.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17471 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-18 15:00:57 +00:00
Georg Baum
4f1d5e72ef Fix bug 3235
* src/insets/insetcaption.C
	(InsetCaption::latex): Copy back encoding to runparams_in

	* src/insets/insetfoot.C
	(InsetFoot::latex): ditto

	* src/insets/insetnote.C
	(InsetNote::latex): ditto

	* src/exporter.C
	(Exporter::Export): Create runparams with document encoding

	* src/converter.C
	(bool Converters::convert): ditto

	* src/buffer.C
	(Buffer::writeLaTeXSource): Copy back encoding to runparams_in
	(Buffer::runChktex): Create runparams with document encoding
	(Buffer::changeRefsIfUnique): ditto

	* src/outputparams.[Ch]
	(encoding): New member

	* src/lyxfont.C
	(LyXFont::latexWriteStartChanges): Don't switch the encoding anymore.
	This is now done in Paragraph::simpleTeXOnePar.
	(LyXFont::latexWriteEndChanges): Ditto

	* src/output_latex.C
	(TeXOnePar): Ditto

	* src/paragraph.C
	(Paragraph::simpleTeXOnePar): Switch the encoding between font
	changes if needed.

	* All other files: Adjust to the changes above


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17470 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-18 10:59:16 +00:00
André Pönitz
57a68063ad revert 17429
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17436 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-13 15:20:26 +00:00
André Pönitz
8484324f75 Fix #988. Note that this introduces a new translatable message
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17429 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-13 00:48:25 +00:00
André Pönitz
d85978b58f fix #3295
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17428 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-12 23:42:35 +00:00
Georg Baum
f503258258 compile fix
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17364 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-26 15:36:36 +00:00
Michael Schmitt
d6c60193d6 move plaintext() implementation to MathMacroTemplate.C;
support localization


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17338 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-25 09:27:11 +00:00
Georg Baum
87289f4d20 remove unused includes
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17328 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-24 18:00:42 +00:00
Georg Baum
2de83b4598 move plaintext output of math macros where it belongs
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17327 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-24 18:00:13 +00:00
Michael Schmitt
597d0e2146 * src/mathed/InsetMath.C: plaintext(): assert that this
method is never invoked (and tell why)
	* src/mathed/InsetMathFormulaMacro.C:
	* src/mathed/InsetMathHull.C: plaintext(): fix return value
	(= number of output characters)
	* src/mathed/InsetMathFormulaMacro.h
	* src/mathed/InsetMathHull.h: WS changes
	* src/mathed/InsetMathDim.C: implement plaintext() for math macros
	and add a FIXME that this code shouldn't needed!


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17319 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-24 15:06:04 +00:00
Abdelrazak Younes
48ab3bd01e * InsetMathMBox.h:
- encapsulate within MATH_MBOX macro.
  - implement default constructor.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17309 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-23 08:27:03 +00:00
Abdelrazak Younes
36f6966af7 * InsetMathMBox: cleanup in order to avoid Buffer and BufferView dependencies.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17308 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-23 08:10:13 +00:00
Abdelrazak Younes
986786c1c1 * mathed/CMakeLists.txt: do not exclude InsetMathMBox.C
* InsetMathMBox.C: Make it compile.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17307 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-22 21:17:34 +00:00
Michael Schmitt
dc402e30fb * src/mathed/InsetMathRef.*: remove plaintext()
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17287 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-20 21:04:29 +00:00
Michael Schmitt
4ab1692eec * src/mathed/InsetMath.[Ch]: implement plaintext() in a smarter way by
outputting "[math]" rather than nothing 


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17278 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-20 18:19:31 +00:00
Michael Schmitt
0703d88b00 * src/mathed/InsetMath.h: "implement" plaintext() which will become
a virtual method soon in InsetBase


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17216 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-16 09:08:38 +00:00
Uwe Stöhr
9492044ef7 rename label for prettyref inset to fix bug 1134
http://bugzilla.lyx.org/show_bug.cgi?id=1134

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17149 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-12 02:15:04 +00:00
Abdelrazak Younes
8842f9a009 A better fix for bug 3194 (see rev. 17027).
* BufferView::mouseSetCursor(): do not call setTargetX() here because this needs the mathed coordcache which is not ensured to be up to date. Because of this, cursor movement might need some adjustment.

* InsetMathNest::lfunMousePress(): revert commit 17027.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17028 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-02 20:23:56 +00:00
Abdelrazak Younes
0405bfcf04 Fix bug 3194:
http://bugzilla.lyx.org/show_bug.cgi?id=3194

This also seems to fix the annoying mouse cursor movement bug 3023:

http://bugzilla.lyx.org/show_bug.cgi?id=3023


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17027 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-02 15:14:43 +00:00
Bo Peng
8b56166641 Persistent-selection (and fix bug 3162)
* src/CutAndPaste.h/C: add selectionBuffer to save selected text
	* src/text3.C: proper handling of paste
	* src/lyxfind.C: save selection
	* src/BufferView.C: save selection
	* src/text.C: save selection
	* src/cursor.C: save selection
	* src/insets/insettabular.C: save selection
	* src/mathed/InsetMathGrid.C: save selection
	* src/mathed/InsetMathHull.C: save selection
	* src/mathed/InsetMathNest.C: save selection


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17022 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-02 03:10:15 +00:00
Michael Schmitt
2cf58651ed * src/mathed/InsetMathNest.C: simplify call to innerText()
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17018 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-01 20:05:59 +00:00
Michael Schmitt
5d41611407 * BufferView.C:
* BufferView.h:
	* lyxfunc.C:
	* factory.C:
	* mathed/InsetMathNest.C:
	* mathed/InsetMathHull.C:
	* lyx_cb.C:
	* frontends/WorkArea.C: remove BufferView::getLyXText() methods, because their
	names were absolutely misleading; resolve indirection where needed


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17016 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-01 19:27:37 +00:00