* src/text.C (breakParagraph): setCursor does not set current_font when
applied to a CursorSlice (fixes bug 3143)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17654 a592a061-630c-0410-9148-cb99ea01b6c8
The crash happens on alt+up and alt+down if the position of the cursor
in the moved paragraph is beyond the length of the target paragraph.
To avoid it the Position of the iterators for the target paragraph must
be corrected. I set it to 0 as i assume it is not really used.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17613 a592a061-630c-0410-9148-cb99ea01b6c8
breakParagraph seems to be called five times: in buffer.C, by
insertStringAsLines; and in text3.C, for LFUN_BREAK_PARAGRAPH,
LFUN_BREAK_PARAGRAPH_KEEP_LAYOUT, LFUN_BREAK_PARAGRAPH_SKIP (which
itself calls LFUN_BREAK_PARAGRAPH if a paragraph will be broken), and
for LFUN_FLOAT_LIST. My sense was that the KEEP_LAYOUT version maybe
shouldn't reset the text style. That's why I put it where I did. But I
doubt it matters very much, and I had it in breakParagraph myself at one
point.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17612 a592a061-630c-0410-9148-cb99ea01b6c8
* 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
http://bugzilla.lyx.org/show_bug.cgi?id=2154
This will automatically put the label inset _after_ a numbered section. It is possible to extend the mechanism to any kind of LateX environment.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17010 a592a061-630c-0410-9148-cb99ea01b6c8
* buffer.C: increase LyX format to 257.
* lyxtextclass.C: increase FORMAT format to 3.
* buffer_funcs.C:
- setCaptionLabels(): new recursive function
- setCaptions(): new function
- updateLabels(): call setCaptions() for each paragraph.
* InsetCaption:
- add a virtual destructor
- overload InsetText' getStatus() and wide().
- setLabel(): only set the new private member label_.
- metrics(): don't set label here and correct for title metrics.
- draw(): don't set label here
- latex(): fix optional argument.
- plaintext(): implement!
* InsetText:
- add a virtual destructor
- add virtual to getStatus() and wide().
* output_latex.[Ch]: move latexOptArgInsets() out of anon namespace.
* text3.C: enable LFUN_CAPTION_INSERT
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16948 a592a061-630c-0410-9148-cb99ea01b6c8
* 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
* 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
* 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
LyX instances. This re-enables copy/paste from the internal clipboard on
OS X (currently broken since Clipboard::isInternal() always returns false for
some reason).
* src/insets/insettabular.C
(InsetTabular::doDispatch): adjust to clipboard interface change
(InsetTabular::copySelection): ditto
* src/mathed/InsetMathGrid.C
(InsetMathGrid::doDispatch): ditto
* src/mathed/InsetMathNest.C
(InsetMathNest::doDispatch): ditto
* src/buffer.[Ch]
(Buffer::readString): New method: Read document from a string
(Buffer::readFile): Change return value from bool to enum (needed
for readString). Return wrongversion if we are reading from a string
and the version does not match.
(Buffer::do_writeFile): make public and rename to write
* src/CutAndPaste.C
(putClipboard): New helper, put stuff to the system clipboard
(void copySelectionHelper): Use putClipboard instead of
theClipboard().put()
(void copySelection): ditto
(void pasteClipboard): new method for pasting in text
(void pasteParagraphList):
* src/frontends/Clipboard.h
(Clipboard::get): Rename to getAsText
(Clipboard::getAsLyX): New method for getting the system clipboard
in LyX format
(Clipboard::hasLyXContents): New method telling whether there is LyX
contents in the clipboard
* src/frontends/qt4/GuiClipboard.[Ch]: Implement the new methods
* src/text3.C
(LyXText::dispatch): Use pasteClipboard for pasting the system
clipboard
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16669 a592a061-630c-0410-9148-cb99ea01b6c8
we don't set the selection with qApp->clipboard()->put().
Therefore we get the status of the internal selection from the cursor, and
the empty flag for fake selections is not needed anymore.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16610 a592a061-630c-0410-9148-cb99ea01b6c8
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
* src/lyxtext.h
* src/text3.C
(pasteString): Change argument to bool
* src/text3.C
(LyXText::dispatch): (LFUN_PASTE): Paste plain text as paragraphs,
not as lines
(LyXText::dispatch): Adjust to pasteString change
* lib/bind/cua.bind:
* lib/bind/sciword.bind:
* lib/bind/mac.bind: Move shortcuts from "clipboard-paste paragraph"
and "primary-selection-paste paragraph" to "primary-selection-paste"
and "clipboard-paste", since the "paragaph" versions are used in
LFUN_PASTE and middle-mouse-button paste. Now "primary-selection-paste"
has the same shortcut it always had, and "clipboard-paste" has the
shortcut that was originally assigned to
"primary-selection-paste paragraph".
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16553 a592a061-630c-0410-9148-cb99ea01b6c8
the status quo fixes, I'll send a proposal how to proceed soon.
* src/CutAndPaste.[Ch]
(copySelection): Split into copySelection and copySelectionToStack
* src/text3.C
(LyXText::dispatch): Use copySelectionToStack instead of LFUN_COPY
to copy the selection to the cut buffer for two reasons:
- LFUN_COPY did not work (probably because bv.cursor() was not yet set)
- If it would work it would put the selection to the system clipboard
which is clearly wrong.
Document why we put the selection to the stack.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16534 a592a061-630c-0410-9148-cb99ea01b6c8
* src/insets/insettabular.C
(InsetTabular::doDispatch): Only paste the tabular clipboard if the
system clipboard is not newer, else let the current cell paste the
system clipboard
(InsetTabular::getStatus): Only decide whether to enable LFUN_PASTE
if the tabular clipboard is not empty and the system clipboard is
not newer, else let the current cell decide.
* src/mathed/InsetMathGrid.C
(InsetMathGrid::doDispatch): Use the system clipboard for LFUN_PASTE
if it is newer.
* src/mathed/InsetMathNest.C
(InsetMathNest::doDispatch): Use the system clipboard for LFUN_PASTE
if it is newer.
* src/text3.C
(doInsertInset): Add a "0" argument to LFUN_PASTE, because we always
want to use the internal clipboard here
(LyXText::dispatch): ditto (when handling mouse button 2 press)
(LyXText::dispatch): Use the system clipboard for LFUN_PASTE if it
is newer.
(LyXText::getStatus): Also enable LFUN_PASTE if the system clipboard
is owned by another application
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16498 a592a061-630c-0410-9148-cb99ea01b6c8
The use of top-level lyx::dispatch() ensure that the CoordCache is OK at each step.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16348 a592a061-630c-0410-9148-cb99ea01b6c8
* LyXText::cursorPrevious(): Implement the same check for safety reason.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16092 a592a061-630c-0410-9148-cb99ea01b6c8
* text2.C
- LyXText::cursorUp(): ensure that BufferView::FitCursor() is tested.
- LyXText::cursorDown(): ditto
- LyXText::cursorRight(): ditto
- LyXText::cursorLeft(): ditto
* text3.C
- LyXText::dispatch(): add FIXME and ensure that update flag is at least equal to FitCursor.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16072 a592a061-630c-0410-9148-cb99ea01b6c8
* buffer.h: changed() signal do not have an argument now.
* BufferView.C:
- setBuffer(): changed update() call to updateMetrics().
- update(): sanitize how the flags are used.
- scrollDocView(): add a call to updateMetrics() at the end.
* LyXFunc::dispatch(): adjust changed() signal emission.
* LyXText/text3.C:
- cursorPrevious(): delete BufferView::update call; adjust cursor flag.
- cursorNext(): ditto.
* frontends/LyXView.C: adjust Buffer::changed() signal connection.
* frontends/WorkArea.[Ch]:
- redraw(): no need to re-update the metrics if we don't change views.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15997 a592a061-630c-0410-9148-cb99ea01b6c8
* BufferView:
- update(): returns a pair of bools in order to inform for singlePar cases.
- workAreaDispatch(): ditto and simplify the logic by using cursor update flags.
* text.C
- breakParagraph(): change the cursor update flag as needed.
- insertChar(): ditto.
- erase(): ditto
- redoParagraph(): now returns true if there is a height change.
* text3.C: dispatch():
- initialize the cursor flag at the beginning
- LFUN_MOUSE_PRESS: no need to update.
- LFUN_MOUSE_RELEASE: ditto.
- add some FIXMEs and comments.
* LyXFunc::dispatch(): simplify the BufferView update.
* insets/insetcollapsable.C: clarify and simplify the logic in doDispatch().
* WorkArea::dispatch(): redraw only if needed.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15958 a592a061-630c-0410-9148-cb99ea01b6c8
labelstring_appendix in layout files
* src/text2.C
(LyXText::setLayout): Translate labelwidthstring for paragraph
(LyXText::getStringToIndex): labelwidthstring is now a docstring
* src/buffer.[Ch]
(Buffer::translateLabel): New method for translating a label if it
is not already translated by the user in the layout file
* src/lyxtext.h
(setParagraph): labelwidthstring is now a docstring
* src/support/lstrings.[Ch]
(bool isAscii): New utility function: Determine whether a docstring
contains only pure ascii
* src/text3.C
(LyXText::dispatch): setParagraph() now takes a docstring
* src/lyxlayout.C
(LyXLayout::read): Don't use from_ascii when reading labelstring_,
endlabelstring_ and labelstring_appendix_
* src/buffer_funcs.C
(setLabel): labelwidthstring is now a docstring
(setLabel): Use Buffer::translateLabel instead of Buffer::B_ to
translate labels
(expandLabel): ditto
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15855 a592a061-630c-0410-9148-cb99ea01b6c8
* LyXText
- bv(), bv_owner, : deleted.
- These methods now need a (Buffer const &) argument: getFont(), applyOuterFont(), getLayoutFont(), getLabelFont(), setCharFont(), setLayout(), singleWidth(), leftMargin(), rightMargin(), computeRowMetrics(), isMainText(), spacing(), isRTL(), cursorX(), rowBreakPoint(), setRowWidth(), labelFill(), labelEnd().
- These methods now need a (BufferView const &) argument and are propably candidates for future removal when 1.6 is opened for development: redoParagraph(), x2pos(), getRowNearY(), getColumnNearX(), checkInsetHit(), setHeightOfRow().
- recUndo(): now need a LCursor argument.
* CoordCache::get(LyXText const *, pit_type):
- now const.
- use const_iterator instead of iterator.
* FontIterator:
- add (Buffer const &) argument to ctor
- buffer_: new const reference to applicable BufferView.
* InsetBase
- xo(), yo(), covers() and neverIndent() are now const.
* InsetText::setViewCache(): deleted
All other changes are due to the LyXText and InsetBase API changes.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15618 a592a061-630c-0410-9148-cb99ea01b6c8