Commit Graph

396 Commits

Author SHA1 Message Date
Bo Peng
6f005d2efa Validate DocIterator before setting cursor with it, in moveToPosition
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17831 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-16 20:47:40 +00:00
Bo Peng
a390aa8fe7 Bookmarks: use bottom level pit and pos
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17829 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-16 19:01:32 +00:00
Bo Peng
9cf5358d7d lastFilePos: save bottom level pit and pos
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17814 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-15 04:50:42 +00:00
Jürgen Spitzmüller
05c47c5ff7 * src/BufferView.C (mouseSetCursor): update fixes.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17767 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-10 16:50:19 +00:00
Georg Baum
d4e8fdd703 Use FileName instead of strings in support::Package.
This fixes some encoding problems, and hopefully also bug 3410.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17746 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-06 13:09:54 +00:00
Michael Schmitt
1b591e71b2 remove redundant lyxerr.debugging checks; macro LYXERR already checks whether the output is actually needed
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17683 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-01 15:09:08 +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
Bo Peng
6fc7d47a5f Restore old bookmark behaviors (stop using bookmark queue)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17628 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-29 03:41:55 +00:00
Abdelrazak Younes
dace843ddc Re-enable mouse hover detection over insets. This was disable at rev 17589 to fix bug 3144 which has been re-opened for this.
There is a user visible change with this commit: For text insets, the button stays "highlighted" as long as the mouse cursor is within the inset but not within a nested inset. Formerly the button was highlighted only when hovered. This new behaviour is better because we can now imagine funkier behaviour like inset color background change when hovered. Also the small math pink corners can be adapted to react to mouse hover in the future. Ideally we should also "highlight" the button when entering the inset via the keyboard or when the keyboard cursor is just before the inset (because we can then use Ctrl-i).

* BufferView:
  - getCoveringInset(): new method.
  - workAreaDispatch(): use getCoveringInset() instead of LyXText::checkInsetHit()


 

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17610 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-28 14:47:52 +00:00
Bo Peng
84e81fd738 BufferView.C: remove unneeded comment
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17593 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-27 14:39:09 +00:00
Abdelrazak Younes
41d3486222 Fix bug 3144 by Richard Heck (slightly modified by me):
http://bugzilla.lyx.org/show_bug.cgi?id=3144

The problem was that we set the cursor even for mouse hover event.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17589 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-27 10:07:53 +00:00
Georg Baum
160c6ef3e9 remove unused variable
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17448 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-15 18:10:16 +00:00
Michael Schmitt
5e5420be30 * src/BufferView.C: call LaTeXFeatures::isAvailable() without an object
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17124 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-09 11:09: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
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
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
Michael Schmitt
5ffb6cfbe2 * src/BufferView.C: make accept/reject-all-changes atomic operations (also fixes a crash)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17003 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-01 13:19:05 +00:00
Abdelrazak Younes
0da3d53269 Fix bug 3148: always update the Labels if a DEPM is triggered.
http://bugzilla.lyx.org/show_bug.cgi?id=3148

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16969 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-31 14:07:37 +00:00
Abdelrazak Younes
b3ced091d2 fix typo in commit 16925
.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16926 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-29 10:05:41 +00:00
Abdelrazak Younes
aa2300a621 Fix bug 3142 (LyX crashes when using mouse wheel)
http://bugzilla.lyx.org/show_bug.cgi?id=3142

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16925 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-29 10:04:02 +00:00
Bo Peng
eb495d2e98 Fix Bug3171: update bookmark after saveCursor
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16919 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-28 21:12:33 +00:00
Abdelrazak Younes
a8d01415d1 Fix bug 3138 (http://bugzilla.lyx.org/show_bug.cgi?id=3138).
* BufferView::setCursorFromScrollbar(): Reset the cursor in any case because bv_funcs::status() does not work when the cursor is within mathed.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16876 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-27 09:04:36 +00:00
Bo Peng
ef17f583f3 Fix compiling errors caused by LyXText::ChangeOp::ACCEPT
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16865 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-26 04:08:27 +00:00
Michael Schmitt
77427d620a * src/lyxtext.h:
* src/text.C: rename acceptOrRejectChange() to acceptOrRejectChanges() because it can handle many changes within the given selection; add acceptChanges() and rejectChanges()

* src/text3.C:
* src/BufferView.C: adjust

* src/insets/insettext.C: accept/rejectChanges() become wrapper methods that call LyXText::acccept/rejectChanges

* src/text2.C: add assertion

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16859 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-25 22:28:15 +00:00
Michael Schmitt
f4cc84d5a6 * src/lyxtext.h: add enum ChangeOp (ACCEPT/REJECT); add deleteEmptyParagraphMechanism()
* src/text.C:
* src/text3.C:
* src/BufferView.C: adjust

* src/insets/insettext.C: acceptChanges() / rejectChanges(): fix pars_size bug introduced in previous commit; call deleteEmptyParagraphMechanism()

* src/text2.C: track changes in DEPM (I am not sure about whether this is actually useful; time will tell..); add deleteEmptyParagraphMechanism(pit_type, pit_type, bool)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16858 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-25 21:18:36 +00:00
Abdelrazak Younes
c347f0467b Remove buggy and redundant BufferView::update() calls.
* BufferView::dispatch() now returns an Update::flags.

* lyx_cb.C::insertPlaintextFile(): delete redundant BufferView::update() call.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16844 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-24 23:10:03 +00:00
Michael Schmitt
2e09a925a5 * src/lyxtext.h:
* src/BufferView.C:
* src/text3.C:
* src/text.C: merge methods acceptChange() and rejectChange() to acceptOrRejectChange() because they share a lot of tricky code

* src/text.C: yet another revision of acceptOrRejectChange()

* src/paragraph.C:
* src/paragraph.h:
* src/paragraph_pimpl.C:
* src/paragraph_pimpl.h:
* src/insets/insettabular.C:
* src/insets/insettabular.h:
* src/insets/insettext.C:
* src/insets/insettext.h:
* src/insets/insetbase.h: pass BufferParams to acceptChanges() and rejectChanges() (needed for paragraph merging)

* src/insets/insettext.C: handle end-of-par in acceptChanges() and rejectChanges()

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16830 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-23 21:53:16 +00:00
Abdelrazak Younes
d6cc04e762 Fix cursor navigation in math.
* metricsinfo.h:
  - ScreenUpdateStrategy: new enum describing the screen update strategy (replace singlepar boolean).

* UpdateFlags.h:
  new Update::Decoration flag.

* BufferView.C
  - update(): takes Decoration flag into account (CoordCache is not cleared out). Fills in metrics_info_.update_strategy

* mathed/InsetMathNest.C: adjust the cursor flags to new strategy.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16774 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-20 01:23:07 +00:00
Jean-Marc Lasgouttes
976d38f7b7 * BufferView.C (mouseSetCursor): if the cursor was in an empty
script inset and the new position is in the nucleus of the inset,
	notifyCursorLeaves will kill the script inset itself. So we check
	all the elements of the cursor to make sure that they are correct
	(bug 2933).



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16729 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-17 15:32:43 +00:00
Abdelrazak Younes
5554e9ee28 replace BufferView::reload() uses with LyXFunc::reloadBuffer().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16727 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-17 14:49:48 +00:00
Abdelrazak Younes
67ae65f430 Fix bug 3101 and 3108
http://bugzilla.lyx.org/show_bug.cgi?id=3101
http://bugzilla.lyx.org/show_bug.cgi?id=3108

* BufferView::setCursor(): delete the call to cursor_.setTargetX(). This is called differently for any LFUN anyway.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16723 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-17 12:29:18 +00:00
Michael Schmitt
1f7a1257f1 * change LFUN file-insert-ascii to file-insert-plaintext
* change LFUN file-insert-ascii-para to file-insert-plaintext-para
* change LyXRC::RC_ASCIIROFF_COMMAND to LyXRC::RC_PLAINTEXT_ROFF_COMMAND
* change LyXRC::RC_ASCII_LINELEN to LyXRC::RC_PLAINTEXT_LINELEN
* replace "ascii" by "plaintext" in method names


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16697 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-15 22:49:14 +00:00
Bo Peng
dbe93457cd Fix bug 3092, use both pit and id to keep track of bookmarks.
* src/session.h/C: save pit instead of id
	* src/lyxfunc.h/C: gotoBookmark function
	* src/BufferView.h/C: proper update of bookmarks


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16647 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-11 16:01:10 +00:00
Abdelrazak Younes
8106f1809f Optimize buffer-switch: do first updateLabels() on opening instead of at each buffer switching.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16645 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-11 08:34:23 +00:00
Abdelrazak Younes
31cbae750d fix cursor movements.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16638 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-10 10:59:18 +00:00
Georg Baum
fed31122c4 Tell X the selection status also after it is changed by the keyboard, since
we got a consensus on this on the list.
Some calls of haveSelection are still missing, but we need to decide the
"persistent selection" question before those can be implemented properly.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16572 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-07 14:44:44 +00:00
Abdelrazak Younes
fc86d802ee update comments.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16558 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-06 23:24:55 +00:00
Abdelrazak Younes
063fdd118b This commit fixes the singlePar optimization which was disabled due to the ParagraphMetrics cleanup.
* rowpainter.C::paintPar(): don't calculate row signature here. Use ParagraphMetrics::rowChangeStatus() instead.

* RowList_fwd.h: RowSignature is now a vector.

* ParagraphMetrics
  - rowChangeStatus(), updateRowChangeStatus(), calculateRowSignature(): new methods.
  - row_signature_: new member
  - rowSignature_: renamed to row_signature_

* TextMetrics::redoParagraph(): call ParagraphMetrics::updateRowChangeStatus()

* BufferView::updateMetrics(): simplify the singlePar case.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16543 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-06 09:15:59 +00:00
Abdelrazak Younes
0b995c888f The bug-fix in revision 16531 introduced another bug. This is the right fix. I did not understood correctly what was anchor_ref_.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16536 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-05 15:35:10 +00:00
Abdelrazak Younes
7d4edd3f79 Fix screen update when deleting insets:
http://bugzilla.lyx.org/show_bug.cgi?id=3071


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16531 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-05 14:31:59 +00:00
Georg Baum
9e49efd593 * src/BufferView.C
(BufferView::clearSelection): Trigger a redraw so that the cleared
	selection becomes visible


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16524 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-05 09:21:30 +00:00
Michael Schmitt
57609ac606 * src/BufferView.C: fix typo in comment
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16514 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-04 19:59:58 +00:00
Bo Peng
a8e914b500 Fix crashes caused by invalid last_inset_ due to keyboard editing
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16485 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-03 23:05:27 +00:00
Abdelrazak Younes
ad84c0ce5d delete unused variables.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16443 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-30 15:53:19 +00:00
Abdelrazak Younes
ceb51f7f76 Sanitize the DEPM!
* BufferView:
  - checkDepm(): new method for DEPM mechanism.
  - mouseSetCursor(): use checkDepm().

* text2.C:
  - use BufferView::checkDepm() instead of using LyXText::deleteEmptyParagraphMechanism() directly.
  - deleteEmptyParagraphMechanism(): prepare for conversion to DocIterator (code transferred to BufferView::checkDepm()).


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16442 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-30 15:05:15 +00:00
Abdelrazak Younes
b2126408cf This commit do the Model/View separation of the LyXText and Paragraph classes. The separation is mostly complete for the Paragraph class but some more transfer should occur for the LyXText class.
* ParagraphMetrics.[Ch]: new files

* TextMetrics.[Ch]: new files.

* lyxtext.h/text2.C/text3.C: some code transferred to the TextMetrics class.

* paragraph.[Ch]: all screen oriented code transfered to ParagraphMetrics class.

* BufferView:
 - text_metrics_: new TextMetrics cache private member.
 - textMetrics(): new access method.
 - parMetrics(): ditto.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16433 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-29 23:54:48 +00:00
Georg Baum
979fdf7456 Fix strange bibtex problem by converting some more functions to use FileName
instead of std::string

	* src/support/lyxlib.h
	* src/support/getcwd.C
	(getcwd): return a FileName, not a std::string in filesystem encoding

	* src/support/filetools.[Ch]
	(makeAbsPath): return a FileName, not a std::string in undefined encoding

	* src/support/lyxlib.h
	* src/support/tempName.C
	(makeAbsPath): return a FileName, not a std::string in undefined encoding

	* many other files: Adjust to the changes above


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16399 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-27 10:56:11 +00:00
Georg Baum
c6f0c8d0b6 convert author names and status messages to docstring
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16363 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-21 13:58:28 +00:00
Bo Peng
7df29f6562 minor style change: use 0 instead of NULL
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16293 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-15 21:39:57 +00:00
Bo Peng
e78b1cf6d7 BufferView.h/C: use member variable last_inset_ instead of static variable in workAreaDispatch to avoid potential mutliple window problems
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16285 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-15 16:48:09 +00:00