LyX crashes when backward selecting during formula writing
The problem is basically that the anchor is not set (because there is no
selection going on) and BufferView::mouseSetCursor does not handle this.
* Cursor.cpp (anchor): return immediately when there is no selection.
* BufferView.cpp (mouseSetCursor): reset anchor before setting cursor
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30245 a592a061-630c-0410-9148-cb99ea01b6c8
The row in editXY is corrected when we're scrolling with PgUp and PgDwn to make sure that the row where the cursor is places, is completely in the view.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29752 a592a061-630c-0410-9148-cb99ea01b6c8
* Remove the EDITABLE enum,
* add functions hasSettings() for all insets.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29375 a592a061-630c-0410-9148-cb99ea01b6c8
* Inset
Handle LFUN_INSET_SETTINGS.
* LyXAction
Use the AtPoint command flag.
* BufferView
* Text3
Remove code that handled LFUN_INSET_SETTINGS. The inset/next-inset part is handled by the AtPoint lfun flag. showInsetDialog is called by Inset::doDispatch and getStatus will be handled by all insets themselves.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29171 a592a061-630c-0410-9148-cb99ea01b6c8
This patch enhances the Buffer::dispatch() method to make it a full-fledged
member of the dispatch sequence. The most immediate payoff is that LFUNs that
are handled in Buffer::dispatch() can be used from the command line.
We make better use of the DispatchResult object and return error information
through it, rather than using return values. (This was JMarc's suggestion.) We
also introduce a corresponding Buffer::getStatus() method, and modify
BufferView::getStatus() to return a flag indicating whether a decision has been
made, as is already done in some other cases.
Finally, some LFUNs are moved to Buffer::dispatch(), including LFUN_BUFFER_PRINT.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29125 a592a061-630c-0410-9148-cb99ea01b6c8
Also show the Merge dialog when we are behind the last change.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29111 a592a061-630c-0410-9148-cb99ea01b6c8
Resizing can occur by toggling toolbars (bug 4733), or by creating or closing buffers which causes the tabbar to toggle (e.g. bug 4174, comment 5).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29066 a592a061-630c-0410-9148-cb99ea01b6c8
this case, when the cursor is on a branch inset (using the AtPoint mechanism)
the branch to which the branch inset belongs will be (de)activated.
This functionality can now be used through the branch inset context menu
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28987 a592a061-630c-0410-9148-cb99ea01b6c8
* src/LyXAction.h: introduce new function attribute AtPoint: this is
for lfuns that should first look at cursor postion whether there
is an inset, before dispatching to container inset.
* src/LyXAction.cpp: remove LFUN_NEXT_INSET_TOGGLE;
mark LFUN_INSET_TOGGLE as AtPoint.
* src/BufferView.cpp (dispatch, getStatus): remove handling of
LFUN_NEXT_INSET_TOGGLE.
* src/LyXFunc.cpp (dispatch, getStatus): handle functions marked
AtPoint.
* lib/*/*: replace next-inset-toggle with inset-toggle.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28980 a592a061-630c-0410-9148-cb99ea01b6c8
http://bugzilla.lyx.org/show_bug.cgi?id=4935
* GuiPrefs: Add an option to the Editing dialog.
* BufferView: Scroll below document if the option is set.
* LyXRC: Write/read the option from preferences file.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28947 a592a061-630c-0410-9148-cb99ea01b6c8
http://bugzilla.lyx.org/show_bug.cgi?id=4733
* GuiWorkArea: This adds "buffer_view_->scrollToCursor();" to GuiWorkArea::resizeBufferView() to make sure that the cursor remains visible.
* BufferView: Make sure that we can call the scrollToCursor function without causing a new repaint.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28946 a592a061-630c-0410-9148-cb99ea01b6c8
Crash with completion in mathed.
When deleting an inset, the stored DocIterator might contain a reference to a non-existent Inset and Text. Therefore, if we detect that the depth has changed, we are (for sure) not in the same paragraph, but we should make sure not to ask for the innerParagraph.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28596 a592a061-630c-0410-9148-cb99ea01b6c8
* BufferView.cpp (dispatch): make sure to repaint the document after
jumping to a new change.
* lyxfind.cpp (findNextChange): do not ignore the last character when
a change extends to the end of an inset.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27083 a592a061-630c-0410-9148-cb99ea01b6c8
* BufferView.cpp (setCursorFromInset): do not ignore the first inset
of the document; revert first tentative patch for this bug.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26645 a592a061-630c-0410-9148-cb99ea01b6c8
* BufferView.cpp (setCursorFromInset): new method, useful to find
an inset that is known to be in the document.
* frontends/qt4/GuiView.cpp (dispatch): do a proper recordUndo
befire appplying changes to an inset. The insets are responsible
for recording additional undo steps that could be needed.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26428 a592a061-630c-0410-9148-cb99ea01b6c8
http://bugzilla.lyx.org/show_bug.cgi?id=5065
* BufferView.cpp (setCursorFromScrollbar): makes sure that the mouse is set using mouseSetCursor (so that dEPM can trigger).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26158 a592a061-630c-0410-9148-cb99ea01b6c8
If Trolltech ever fixes this, then we can put an upper bound onto the #if.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25773 a592a061-630c-0410-9148-cb99ea01b6c8
- move Previews singleton to LyX
- LyX.cpp: set singleton to zero at destruction.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25594 a592a061-630c-0410-9148-cb99ea01b6c8
These have been added to BufferView::dispatch() and BufferView::getStatus() for now. Shortly, we'll be making wider use of Buffer::dispatch() and introducing Buffer::getStatus() and moving these and some other LFUNs there.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24979 a592a061-630c-0410-9148-cb99ea01b6c8
Allow LFUN_INSET_SETTINGS with enclosing inset if this particular dialog has been explicitely requested.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24618 a592a061-630c-0410-9148-cb99ea01b6c8
For the record, this developer is sorry that the problems with this code were not noticed much earlier. It's not fun to do so much work and then have it all reverted.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24373 a592a061-630c-0410-9148-cb99ea01b6c8
However, I am not really sure we should care about these. It's not much
difference, except that application shutdown in slower after 'fixing'
them.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24305 a592a061-630c-0410-9148-cb99ea01b6c8
* src/Text3.cpp:
- fix LFUN_INSET_SETTINGS so that it also works at cursor position.
* LyXAction.cpp:
- doxy.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23923 a592a061-630c-0410-9148-cb99ea01b6c8
* src/BufferView.cpp:
* src/FuncCode.h:
* src/LyXAction.cpp:
- new LFUN_NEXT_INSET_MODIFY
* src/insets/InsetBox.{cpp, h}:
* src/insets/InsetCommand.{cpp,h}:
* src/insets/InsetNote.{cpp,h}:
* src/insets/InsetSpace.{cpp,h}:
* src/insets/InsetVSpace.{cpp,h}:
- implement context menu and access to some changes
* lib/ui/stdmenus.ui:
- new context menus for Box, Space, VSpace, Note.
- extend the context menu for InsetRef.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23920 a592a061-630c-0410-9148-cb99ea01b6c8
EmbeddedFile::enable() and EmbeddedFiles::enable() to differentiate different usages.
A member variable bibfiles_ is added to InsetBibtex because it is not efficient to obtain
EmbeddedFileList each time from params()['bibfiles'] and params()['embed'].
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23576 a592a061-630c-0410-9148-cb99ea01b6c8
* Inset and derived class: get rid of getLabelList()
* BufferView::gotoLabel(): Speed up and simplify by using the tocBackend.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23541 a592a061-630c-0410-9148-cb99ea01b6c8
Sorry, Andre, but this broke not only the modules stuff but the general handling of TextClasses. I'm not opposed to doing this sort of thing, but it's going to be a little more complicated. I'll do it when I get a bit of time, or I can explain what the issue is here if you want to do it.
I'll separately re-commit some of the cleanup here.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23189 a592a061-630c-0410-9148-cb99ea01b6c8
Also a few cosmetical changes where I xould not resist.
Would be nice if the 'modules people' could verify that their baby
is strill alive...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23154 a592a061-630c-0410-9148-cb99ea01b6c8
places, i.e.
- BufferView::setMouseCursor,
- BufferView::mouseEventDispatch
- LyXFunc::dispatch
Before it was called from several dispatch handlers in the middle of the
dispatch process. Because the cursor might get invalidated, this is
not a good idea. We had plenty of crashes and odd behaviours because
of this as nobody really understood those cases.
This fixes (at least) #2069 and #4163.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23140 a592a061-630c-0410-9148-cb99ea01b6c8
* completion support for mathed
* experimental completion support for text
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23104 a592a061-630c-0410-9148-cb99ea01b6c8
Warning for the future: *no* painting activity should happen inside a paint event.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23071 a592a061-630c-0410-9148-cb99ea01b6c8
- added toolbars/tabbar/scrollbar toggling
- added text width control
- added GUI preferences & menu & shortcut
Known problems:
- Outliner in Mac is seeking some Mac devie to fix (see hints here:
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg135382.html )
- Toolbars visibility is shared between windows (views)
(needs toolbars overhaul).
- Adding new tab items does not reflect fullscreen mode
(i.e. margins and tabbar get visible)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23069 a592a061-630c-0410-9148-cb99ea01b6c8
from the one posted to the list.
The basic idea has two parts. First, we hard code an "empty layout"
(called PlainLayout, for want of a better name) in TextClass and read it
before doing anything else. It can therefore be customized by classes,
if they want---say, to make it left-aligned. Second, InsetText's are
divided into three types: (i) normal ones, that use the "default" layout
defined by the text class; (ii) highly restrictive ones, such as ERT and
(not quite an inset) table cells, which demand the empty layout; (iii)
middling ones, which default to an empty layout and use the empty layout
in place of the default. (This is so we don't get the same problem we
had with ERT in e.g. footnotes.) The type of inset is signaled by new
methods InsetText::forceEmptyLayout() and InsetText::useEmptyLayout().
(The latter might better be called: useEmptyLayoutInsteadOfDefault(),
but that's silly.) The old InsetText::forceDefaultParagraphs() has been
split into these, plus a new method InsetText::allowParagraphCustomization().
A lot of the changes just adapt to this change.
The other big change is in GuiToolbar: We want to show LyXDefault and
the "default" layout only when they're active.
There are a handful of places where I'm not entirely sure whether we
should be using forceEmptyLayout or !allowParagraphCustomization() or
both. The InsetCaption is one of these. These places, and some others,
are marked with FIXMEs, so I'd appreciate it if people would search
through the patch and let me know whether these need changing. If they
don't, the FIXMEs can be deleted.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22966 a592a061-630c-0410-9148-cb99ea01b6c8
We need some better handling of the case when the cursor is in the
very first line, but the line is not completely visible. If the line
is not heigher than the BufferView we should scroll up to show it
completely.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22790 a592a061-630c-0410-9148-cb99ea01b6c8
* BufferView
- showCursor(DocIterator): new DocIterator argument.
- showCursor(): use above method.
- scrollDocView(): take care of top and bottom special cases early in the method.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22707 a592a061-630c-0410-9148-cb99ea01b6c8
The problem was this: The value in BufferView::scrollDocView(int value) is
relative to the d->scrollbarParameters_.min/max interval and _not_ absolute.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22675 a592a061-630c-0410-9148-cb99ea01b6c8
* BufferView::checkDepm(): update d->cursor_ in case of depm.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22322 a592a061-630c-0410-9148-cb99ea01b6c8
* DocIterator as MacroPosition
* Iterative search for macro in scope until a visible one is found.
This include the ability to resolve macro inside nested text insets.
* Speed up macro lookups by factor 2: only getMacro(name) call, no
further hasMacro(name) call before
* Both way child/master support
* Correct macro scope for multi-paragraph environments
* Correct macro scope for multi-depth-paragraphs
* Buffer::updateMacros made const
* Update macros when loaded (of master and child)
* Do not remove too many braces when unfolding a macro. This could
lead to a data loss because the relationship between arguments of
macros can be mixed up if nested macros are unfold at once.
* Reduce dependencies to MetricsInfo in MathMacro
* Update macros when needed. Normally it's done just before doing
metrics. But in cases without a brace around some constructs (like
\left(bla\right)) there is some help needed.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22241 a592a061-630c-0410-9148-cb99ea01b6c8
- dispatch(): transfer LFUN_FILE_INSERT_PLAINTEXT_* to GuiView::dispatch()
- insertPlaintextFile(): split in BufferView::insertPlaintextFile() and GuiView::insertPlaintextFile()
This patch get rid of FileDialog use in BufferView. Remains Buffer, Converters and LyXFunc.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21930 a592a061-630c-0410-9148-cb99ea01b6c8
- dispatch(): transfer LFUN_FILE_INSERT to GuiView::dispatch()
- menuInsertLyXFile(): split in BufferView::insertLyXFile() and GuiView::insertLyXFile()
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21923 a592a061-630c-0410-9148-cb99ea01b6c8
* BufferView:
- insertPlaintextString(): now accept a FileName.
- contentsOfPlaintextFile(): ditto and use FileName::fileContents().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21915 a592a061-630c-0410-9148-cb99ea01b6c8
Now support/* should have no dependencies on src/* anymore.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21851 a592a061-630c-0410-9148-cb99ea01b6c8
introduce isReadableDirectory
replace isReadable by either isReadableFile or isReadableDirectory
remove isReadable
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21769 a592a061-630c-0410-9148-cb99ea01b6c8
- avoid one redraw on file loading due to a resize event.
- fix the initial offset_ref_ value of BufferView.
- add new TabWorkArea::addWorkArea() method.
- avoid tab bar flashing when only one file is opened.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21674 a592a061-630c-0410-9148-cb99ea01b6c8
* ParagraphMetrics::computeRowSignature(): Integrate row's dimensions and selection status in the row signature.
* TextMetrics::drawParagraph(): compute the row signature here and rely on that to decide if a redraw is needed or not.
* BufferView::Private: get rid of the ViewMetricsInfo member. Just keep the ScreenUpdateStrategy.
* BufferView::draw(): full screen update even for singlePar case because the row signature will detect if something needs to be redrawn.
* Text3.cpp: get rid of hack following architecture update.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21650 a592a061-630c-0410-9148-cb99ea01b6c8
- move the LFUN_OUTLINE_*'s out of here ...
* src/Text3.cpp:
- to this place. This fixes a crash (bug 4330).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21475 a592a061-630c-0410-9148-cb99ea01b6c8
* Painter.h: move isDrawingEnabled() to public Area.
* TextMetrics::drawParagraph(): backup and restore original drawing state of the Painter.
* InsetTabular::draw(): ditto.
* InsetMathNest::drawSelection(): ditto.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21471 a592a061-630c-0410-9148-cb99ea01b6c8
* Font::FontBits -> FontInfo
* Font::FONT_XXX -> all enums transfered to FontEnums.h and renamed to FontXxx
I've replaced Font uses with FontInfo were the language() member was not needed, basically all draw() and metrics methods. There's one problematic cases with InsetQuotes which I solved by taking the Buffer main language.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21240 a592a061-630c-0410-9148-cb99ea01b6c8
In the future, when Cursor has been fixed to work correctly with multiple views of the same Buffer, we could transfer the Undo owner from Buffer to Cursor.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21031 a592a061-630c-0410-9148-cb99ea01b6c8
- get rid of the cached Dimension. Text inset dimensions are saved in ParagraphMetrics and mathed maintain their own dimension where needed.
- width(), ascent(), descent(): deleted.
- dimension(): now needs a valid BufferView.
- metrics(): now void.
* BufferView::getCoveringInset(): simplify.
* ParagraphMetrics(): now cache inset dimensions.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20420 a592a061-630c-0410-9148-cb99ea01b6c8
- first() and last(): change return type because std::pair of reference didn't work (i.e. bug)
* BufferView::workAreaDispatch(): re-enable and fix 'mouse hover' feature.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20372 a592a061-630c-0410-9148-cb99ea01b6c8
* BufferView:
- new scroll(), scrollDown() and scrollUp() method for pixel scrolling.
- new LFUN_SCREEN_UP/DOWN handling.
* TextMetrics: new helper and access methods.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20283 a592a061-630c-0410-9148-cb99ea01b6c8
* ParagraphMetrics::position_: new private member (and associated access method).
* TextMetrics:
- origin_: new screen position cache.
- use origin_ and ParagraphMetrics::position() instead of the parPos cache.
* Cursor:
- comment out buggy bruteFind() method, will work on that later.
* BufferView::updateMetrics(): refactor and simplify to use new cache and to gather everything SinglePar related.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20214 a592a061-630c-0410-9148-cb99ea01b6c8
- implement edit function that opens the inset's dialog.
* src/BufferView.cpp (doDispatch):
- call inset->edit (i.e. open dialog) for EDITABLE insets on next-inset-toggle (bug 2907)
* src/Text3.cpp (doDispatch: INDEX_INSERT):
- move inset->edit to where it belongs.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20193 a592a061-630c-0410-9148-cb99ea01b6c8