Commit Graph

444 Commits

Author SHA1 Message Date
Richard Heck
8b2aab9b3d Style. 2012-06-04 13:42:46 -04:00
Richard Heck
7ef8df460a Fix crash reported by Tommaso:
http://marc.info/?l=lyx-devel&m=133876924408431&w=2
The problem here is that the copy_params() routine in FindAndReplace.cpp
created a new DocumentClass, but it never updated its Buffer to reflect
that new DocumentClass. So its Paragraphs still contained points to the
Layouts in the old DocumentClass which, since ead697d4b6, gets garbage
collected once it is no longer needed. So the Layout doesn't exist, and
we crash.
2012-06-04 13:39:24 -04:00
Richard Heck
ead697d4b6 Deal with memory issue reported some time ago in connection with DocumentClass
objects. The problem that led to the leak is that these objects can be held in
memory long after the Buffer that created them is gone, mostly due to their
use in the CutStack. So they were previously held in a storage facility, the
DocumentClassBundle. Unfortunately, they were now being created too often,
especially by cloning. It's not really a leak, because they're accessible, but
we weren't ever destroying them.

This new approach uses a shared_ptr instead.

Thanks to Vincent for pointing out const_pointer_cast.
2012-05-31 12:34:29 -04:00
Vincent van Ravesteijn
d20cb73b87 Fix bug #8166: Crash on clicking away from empty last paragraph
This reverts the previous fix in [0a33374c/lyxgit] and fixes it
differently.

We always have to call 'notifyCursorLeaves', but we only have to make sure
that we call the 'fixIfBroken()' functions first.
2012-05-23 08:02:40 +02:00
Vincent van Ravesteijn
0a33374c0d Fix bug #8166: Crash on clicking away from empty paragraph
We rely on the 'or' operator to prevent us from calling
'notifyCursorLeaves' if one of the two cursors is broken. This doesn't
work when using the '|' operator. The compiler 'optimizes' the code in
such a way that we always call notifyCursorLeaves anyway. Using the '||'
operator fixes this.
2012-05-23 01:31:43 +02:00
Enrico Forestieri
9825621798 Fix bug #8140: Crash with math macros and input completion
When clicking away in the same math inset after hitting '\', the
cursor may be broken and all of its instances have to be fixed.
2012-04-30 23:55:34 +02:00
Vincent van Ravesteijn
3a395ca0f5 BufferView::dispatch(): add a missing break 2012-04-29 14:51:24 +02:00
Stephan Witt
42dfd71197 #7789 unify and fix buffer statistics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40602 a592a061-630c-0410-9148-cb99ea01b6c8
2012-01-12 07:03:24 +00:00
Tommaso Cucinotta
7422c56d67 Fixing consistency of replace actions in GUI with readonly status of target document buffer
(i.e., it was possible to replace in readonly buffers!)
See also http://comments.gmane.org/gmane.editors.lyx.devel/140074


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40548 a592a061-630c-0410-9148-cb99ea01b6c8
2011-12-30 15:31:56 +00:00
Jean-Marc Lasgouttes
84c603255d further fix to #7909
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40505 a592a061-630c-0410-9148-cb99ea01b6c8
2011-12-16 14:36:31 +00:00
Pavel Sanda
278498f81b Experimental search for highest upper bound of inset-forall reported by user.
Fixes #7945.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40501 a592a061-630c-0410-9148-cb99ea01b6c8
2011-12-15 16:39:35 +00:00
Vincent van Ravesteijn
7d98d770b1 Cleanup r40377
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40379 a592a061-630c-0410-9148-cb99ea01b6c8
2011-12-05 13:41:15 +00:00
Vincent van Ravesteijn
a35e512e90 Fix bug #7916: Undo warning message when inserting plaintext file
LFUN_INSERT_PLAINTEXT is handled in GuiView because it might need to ask for a filename. But if the filename is given as a paramater we can handle it in BufferView immediately. Also, when we've asked for the filename in GuiView we should dispatch the LFUN to BufferView in order to properly use the Undo mechanism.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40377 a592a061-630c-0410-9148-cb99ea01b6c8
2011-12-05 13:12:57 +00:00
Jean-Marc Lasgouttes
9928a67e32 Fix bug #7909: mark-on selection is lost during screen-down and screen-up
The trick is to rely on Cursor::selHandle instead of fiddling with the selection


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40372 a592a061-630c-0410-9148-cb99ea01b6c8
2011-12-05 08:35:55 +00:00
Richard Heck
66e633811e There's no need to separate this logic out if it's only called
from the one place.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40359 a592a061-630c-0410-9148-cb99ea01b6c8
2011-12-04 02:38:00 +00:00
Richard Heck
210a440609 Attempt to fix #7673 in a more "interesting" way than in branch (where
we will be cautious, of course). The problem was that we were issuing
the Buffer::changed() signal before we did updateBuffer(), and this
caused an inconsistency. The idea here is to defer issuing this signal
until we call processUpdateFlags(). We know we need a redraw if we've
deleted a whole paragraph.

This should work properly, so long as checkDepm is called from within
the dispatch mechanism. There may, however, be other paths, and I've
noted one explicitly with a FIXME in Text2.cpp. I've tested a few
different variations, however, and I haven't seen any problems. But if
we do run into problems, we can go ahead and do the update there that we
were previously doing in checkDepm itself.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40352 a592a061-630c-0410-9148-cb99ea01b6c8
2011-12-03 22:42:09 +00:00
Richard Heck
8c69aca339 Add constness in several places.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40338 a592a061-630c-0410-9148-cb99ea01b6c8
2011-12-02 22:41:33 +00:00
Richard Heck
3a03e71c3e Deal with the part of #7872 involving changes of branch activation
from Document>Settings.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40333 a592a061-630c-0410-9148-cb99ea01b6c8
2011-12-02 21:21:30 +00:00
Vincent van Ravesteijn
7287a259c5 Change the type of the context menu name to string
There is no need for GUI-elements to use docstring.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40058 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-29 14:48:55 +00:00
Georg Baum
8e8c214bef Fix some bugs related to spaces in math:
- Interpret argument of LFUN_SPACE_INSERT correctly
- Use InsetMathSpace instead of InsetMathSpecialChar for "\ " (bug # 7728)
- Use InsetMathSpace instead of InsetMathChar for ~ (bug # 7728).
  This fixes also the display in LyX (previously a literal ~ was displayed).
Using InsetMathSpace enables also the "Insert Formatting" menu entries.
No file format change is needed, since the LaTeX export is unchanged.
Note that there are still some bugs related to spaces in math:
#7746, #7747, #7749, #7842


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39947 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-23 20:19:49 +00:00
Enrico Forestieri
21185402cb When changing the document language, also change the language of the
text which is not explicitly marked in a different language, irrespective
of the multilingual status, except for LTR<=>RTL changes.
See discussion in this thread:
http://thread.gmane.org/gmane.editors.lyx.devel/138380


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39702 a592a061-630c-0410-9148-cb99ea01b6c8
2011-09-18 21:18:57 +00:00
Vincent van Ravesteijn
56c59cf4eb Make the scrolling for large insets more naturally (bug #7662)
The patch fixes a case that I had forgotten. Namely, the case that when the height of a row was larger than the height of the screen and that the cursor is already visible. That's why I added a new if case to catch all situations in which the row height is larger than the height of the screen. If we then need scrolling we scroll to height/4 and 3*height/4. In the end, the height_/4 and 3*height_/4 should be replaced by the rowheights in the inset, but we need some extra infrastructure for that.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39697 a592a061-630c-0410-9148-cb99ea01b6c8
2011-09-18 09:35:06 +00:00
Stephan Witt
3a33672980 #7681 adjust the cursor language after document language change had changed the text language
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39564 a592a061-630c-0410-9148-cb99ea01b6c8
2011-08-29 17:25:44 +00:00
Stephan Witt
1a0b35288d #7740 Add undo for change of text language with LFUN_BUFFER_LANGUAGE
When a document is not multi-lingual the text contents is changed
to the new language. This should be recorded for Undo.
Because Undo wants a cursor the implemantation has to be
moved to the BufferView class.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39508 a592a061-630c-0410-9148-cb99ea01b6c8
2011-08-23 10:22:14 +00:00
Vincent van Ravesteijn
d631fe0001 Fix bug #7662: Incorrect scrolling for rows with larger ascent.
- After introducing the displayed vertical alignment for tables, we met for the first time situations in which row.ascent is very large. To make sure the scrolling still works, we have to do the same as we did for rows with a large descent.
- change row.ascent into defaultRowHeight. Before the above mentioned change, row.ascent usually was approximately the same as defaultRowHeight (by chance). However, it is now clear we don't really want row.ascent here.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39486 a592a061-630c-0410-9148-cb99ea01b6c8
2011-08-17 10:44:50 +00:00
Abdelrazak Younes
6056db3212 Header cleanup.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39300 a592a061-630c-0410-9148-cb99ea01b6c8
2011-07-14 17:00:35 +00:00
Abdelrazak Younes
850e4d80c0 Graphics cleanup: get rid of Previews.{h,cpp}
The PreviewLoader is created directly by Buffer on demand. The PreviewLoader cache was complex and unneeded because there is one and only one PreviewLoader per Buffer.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39276 a592a061-630c-0410-9148-cb99ea01b6c8
2011-07-12 12:43:11 +00:00
Richard Heck
318719f001 Potential fix for #7591.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38875 a592a061-630c-0410-9148-cb99ea01b6c8
2011-05-28 14:34:19 +00:00
Richard Heck
3f8ae08390 Fix for bug #7572. The basic problem here is that we are trusting the
viewer to give us sensible information, but that information may be out-
generated. So we need to check and make sure the values we get are
valid.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38859 a592a061-630c-0410-9148-cb99ea01b6c8
2011-05-27 20:37:29 +00:00
Richard Heck
80cb1f7674 Some cleanup and a fix for a potential crash while investigating #7572.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38858 a592a061-630c-0410-9148-cb99ea01b6c8
2011-05-27 19:47:10 +00:00
Richard Heck
45b57a0966 Fix crash reported by John Kennan.
We are missing the updateBuffer() call when we go through
mouseEventDispatch(). A consequence of the massive updateBuffer()
refactoring. Wish it had been caught before...

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38667 a592a061-630c-0410-9148-cb99ea01b6c8
2011-05-09 18:05:31 +00:00
Richard Heck
d4bca04616 Add a FIXME regarding remaining anchor issue.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38390 a592a061-630c-0410-9148-cb99ea01b6c8
2011-04-15 02:26:22 +00:00
Richard Heck
6be4045e0c Fix some more bugs similar to #7394, just fixed by Enrico.
The one remaining question is whether we should also call resetAnchor()
at the end of setCursor().


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38388 a592a061-630c-0410-9148-cb99ea01b6c8
2011-04-15 02:01:28 +00:00
Enrico Forestieri
075804d685 Fix bug #7394 (Crash while selecting texts)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38385 a592a061-630c-0410-9148-cb99ea01b6c8
2011-04-14 22:44:46 +00:00
Richard Heck
c10cd68fba Constify.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38381 a592a061-630c-0410-9148-cb99ea01b6c8
2011-04-14 20:34:18 +00:00
Stephan Witt
934cadd381 improve the method naming for "mark new word position", move the mark operation out of bookmarkEditPosition up one level to LFUN_SELF_INSERT of the text inset dispatch
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38181 a592a061-630c-0410-9148-cb99ea01b6c8
2011-04-01 05:49:04 +00:00
Richard Heck
3f27f951cb This is intended to be a pure renaming of the Inset::name() routine,
preparatory to fixing #7080. Note that mathed uses the same routine, but
for a completely different purpose, so I did not rename it there. I have
seen no difference in behavior after testing, e.g., opening and
exporting Math.lyx, and also re-saving it and looking at the diff.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38109 a592a061-630c-0410-9148-cb99ea01b6c8
2011-03-28 22:33:04 +00:00
Vincent van Ravesteijn
eec88b7e5e Revert wrong previous commit.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37959 a592a061-630c-0410-9148-cb99ea01b6c8
2011-03-19 10:34:59 +00:00
Vincent van Ravesteijn
e52af5f897 Simplify logic in InsetRef::latex().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37958 a592a061-630c-0410-9148-cb99ea01b6c8
2011-03-19 10:31:43 +00:00
Enrico Forestieri
397c03b433 Fix bug #7361 (Assertion when a latex error occurs in the first (empty) paragraph)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37954 a592a061-630c-0410-9148-cb99ea01b6c8
2011-03-18 17:26:17 +00:00
Abdelrazak Younes
076151f508 Trying to fix #7321: add some assertions.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37914 a592a061-630c-0410-9148-cb99ea01b6c8
2011-03-13 16:26:57 +00:00
Enrico Forestieri
624f725acb Fix bug #7316 (Crash editing commands in math mode)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37750 a592a061-630c-0410-9148-cb99ea01b6c8
2011-02-21 15:26:28 +00:00
Vincent van Ravesteijn
5036ca8500 Constify InsetMathNest::setMouseHover and remove the const_cast from BufferView.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37632 a592a061-630c-0410-9148-cb99ea01b6c8
2011-02-13 10:07:00 +00:00
Stephan Witt
f361c26a05 suppress the misspelled marker only when typing in a word the first time
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37463 a592a061-630c-0410-9148-cb99ea01b6c8
2011-02-03 17:27:13 +00:00
Jean-Marc Lasgouttes
370044551c Unify handling of pass thru insets and paragraphs by introducing Paragraph::isPassThru. Many lfuns are now disabled in sweave chunks.
Also, fix #7175 (do not output \noindent in passthru pars)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37328 a592a061-630c-0410-9148-cb99ea01b6c8
2011-01-26 11:04:42 +00:00
Abdelrazak Younes
9cf9f86b8f Move buffer dispatching code from GuiView::dispatchToBufferView() to BufferView::dispatch().
The execution order bv -> doc_bv -> buffer -> doc_buffer was artificial and not important AFAIU.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36734 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-05 01:18:32 +00:00
Enrico Forestieri
eb2600483a Fix bug #7068 (Crash when pressing down arrow in an equation when there is a suggestion)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36617 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-30 03:54:29 +00:00
Tommaso Cucinotta
d5eb8c0968 (finishing patch -- question was restored, but there were still problems)
Restore the wrap-around question when no more hits found while searching with Advanced Search.
The dispatched() flag is used currently in FindAndReplace.cpp in order to discriminate between
match found and not found and, in the latter case, pop-up the wrap-around question dialog.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36279 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-13 12:02:04 +00:00
Tommaso Cucinotta
112246ae9f Restore the wrap-around question when no more hits found while searching with Advanced Search.
The dispatched() flag is used currently in FindAndReplace.cpp in order to discriminate between
match found and not found and, in the latter case, pop-up the wrap-around question dialog.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36277 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-13 11:35:37 +00:00
Vincent van Ravesteijn
afa873dc5f Remove the FileName parameter of Buffer::loadLyXFile and friends. Now, getAutosaveFileNameFor and getEmergencyFileNamefor can be removed too. Last, the call to lyxvc.file_found_hook can now be centralized and can be given the correct parameter (d->filename instead of the name of the emergency/autosave file).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36145 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-05 21:21:01 +00:00