Commit Graph

438 Commits

Author SHA1 Message Date
Juergen Spitzmueller
977bbd9bc3 Add InsertCotext tag also to InsetLayout argument (part of #4745) 2015-05-21 08:53:56 +02:00
Jean-Marc Lasgouttes
3176ac365c remove bogus comment
There used to be a showCursor call below the command, sometimes between 2002 and 2007.
2015-05-20 11:24:15 +02:00
Georg Baum
b596330093 Fix compilation with boost 1.58
Newer boost versions use complicated type traits for boost::next and
boost::prior, which do not work with the RandomAccessList iterators.
The long term solution is to use std::next and std::prev, for now supply
simple replacements for compilers that do not support C++11 yet.
2015-05-16 00:05:23 +02:00
Scott Kostyshak
c12dc2feef Fix pasting of PDF from clipboard
The command "paste pdf" was always disabled because the
condition in the following "if" statement always returns false

  if (arg == "pdf" && (type = Clipboard::PdfGraphicsType))

The value of "type" is zero in this case because PdfGraphicsType is
the first enum value (and it is not set explicitly to non-zero).

An alternative patch is to put AnyGraphicsType as the first
element of enum GraphicsType, or to set the first element to a
number greater than 0.

To test the bug that this commit fixes, either copy a PDF and try to
paste with the action "paste pdf", or click on the "Edit" menu and
notice (before this commit) the terminal output "Unrecognized
graphics type: pdf".
2015-05-09 20:46:43 -04:00
Juergen Spitzmueller
760b7cf2b6 Add option to Argument to let it be inserted with a copy of the co-text.
This is useful for classic "Short Titles", where one might want to start
with the full title in the inset.

Addresses: #4745
2015-05-09 12:17:24 +02:00
Scott Kostyshak
02cb5fd374 Assert if unknown argument to internal paste 2015-04-22 19:38:21 -04:00
Scott Kostyshak
73460423ad Update previews after pasting (#6211)
The reason we want to do this is for if there is pasting across buffers.
For within buffer, the previews should already be updated. Calling the
buffer-wide updatePreviews() might seem like overkill, but actually it
should be quick because only the previews that need updating are updated
(and this check feels quick to me, although I did not profile).

If we were to loop through the pasted text and update each preview
individually, this might take more time. When updating previews
together, only one .tex file is compiled.
2015-04-21 02:51:54 -04:00
Juergen Spitzmueller
6fe3dc01e0 Issue a warning if thesaurus dir is not set up (as suggested in #9496) 2015-04-12 15:55:01 +02:00
Scott Kostyshak
032da815fa Fix selection at borders of insets (#9487)
When at the last position in an inset, selecting to the right
should select the entire inset. This only worked if there was
already a selection (i.e. the selection was started not at the
boundary).

The behavior of this bug was changed by commit 73a7bf9d.  Before
that commit, if at the last position of an inset you select to
the right, nothing is selected but the selection is set. If you
select once more to the right, because the selection is set the
needsUpdate condition is satisfied so the whole inset is selected.

Note that everything here applies also to "first position of an
inset" and selecting to the left. By "selecting", I am referring
to LFUN_{CHAR,WORD}_{FORWARD,BACKWARD}_SELECT.
2015-04-03 14:24:28 -04:00
Jean-Marc Lasgouttes
11ca140667 Clean-up the undo API
* Remove the UndoKind parameter in the general interface
* move recordUndoInset to Cursor
* remove one variant of Undo::recordUndo.
* get rid of Text::recUndo.
2015-04-01 14:18:23 +02:00
Jean-Marc Lasgouttes
67ff68bd02 Improve the check for multiple paragraphs in Text::insertStringAsLine.
Rely only on InsetText::allowMultipar() to get this information.

Implement this method for InsetTabular and InsetBox.

Also rely on this method for disabling LFUN_PARAGRAPH_BREAK.
2015-03-31 14:07:45 +02:00
Stephan Witt
73242e0052 #9477 improved argument handling for LFUN_SPELLING_ADD,LFUN_SPELLING_IGNORE and LFUN_SPELLING_REMOVE 2015-03-27 08:07:05 +01:00
Jean-Marc Lasgouttes
ba0b847040 Toggle properly toolbar icons that set layout of a paragraph.
Fixes bug #9463.
2015-03-17 16:40:55 +01:00
Georg Baum
3e9e6e344a Replace automatic logofication with insets
Previously, LyX did replace some words with typeset logos, and there was no
way to prvent this except putting them, in ERT (bug #4752). Now we have
special insets for these words, and standard text is left alone.
2015-03-01 11:16:57 +01:00
Richard Heck
db954b5dc0 Add comment, so that does not happen again. 2015-02-24 20:07:32 -05:00
Richard Heck
94a5481a17 Partially revert b627b870, which broke cursor movement. 2015-02-24 20:04:59 -05:00
Jean-Marc Lasgouttes
b627b8701b Some performance stuff reported by cppcheck 2015-02-24 18:38:20 +01:00
Uwe Stöhr
4a8881c60a text3.cpp: adapt a possible fix to current code 2015-02-15 01:04:41 +01:00
Juergen Spitzmueller
d48e5330be Add pref option to disable middle-mouse-button paste
Fixes: #9399
2015-02-08 17:41:28 +01:00
Richard Heck
935646bf91 Cleanup of outliner moving code. 2015-01-03 11:33:11 -05:00
Jean-Marc Lasgouttes
38f8858671 Fix warnings reported by clang
All these problems have the same root: the address of a reference can never be 0, and it does not make sense to test it.
2014-11-27 19:10:43 +01:00
Jean-Marc Lasgouttes
e52a385493 Reimplement inset-select-all in a generic way
There are 3 possible actions (in order)
* select current cell
* select all calls of inset
* select the inset from outside (in the containing inset)

This fixes completely #7727.
2014-11-01 16:54:23 +01:00
brokenclock
11e679f73e Add LFUN_SERVER_GET_STATISTICS command
This function can be used with the LyX server to obtain the word, character or character+space count in the current document or selection.
2014-10-23 16:06:42 +02:00
Scott Kostyshak
bcbc162665 Select word on double click even when at boundary
Now when double clicking on a boundary of a word, the
word is selected. This also causes single-letter words
to now be selected (fixes #9159).
2014-06-13 10:48:49 -04:00
Scott Kostyshak
4cfc110d4a Combine OutlineIn and OutlineOut blocks
They differ only by adding/subtracting 1.
2014-06-08 03:33:32 -04:00
Enrico Forestieri
d4c21b42dd Allow inserting a blank line also after a nested environment. 2014-05-26 21:29:33 +02:00
Enrico Forestieri
02e7bc18a7 Simplify the test for inserting a parbreak separator.
Instead of simply taking into account the layout of the previous
paragraph, it is better considering the layout of the environment
in which the previous paragraph may be nested. This makes the test
simpler and, at the same time, more robust.
2014-05-22 21:47:10 +02:00
Enrico Forestieri
52ebcd6280 Correct the check for a command. 2014-05-22 11:51:21 +02:00
Enrico Forestieri
2c613d5686 Fix potential crash.
Use the lfun for breaking the paragraph here, such that the metrics
are updated before the call to the next dispatch.
2014-05-22 11:41:23 +02:00
Enrico Forestieri
10d5897327 Don't allow inserting two consecutive separators. 2014-05-18 18:04:53 +02:00
Enrico Forestieri
0616c8fe32 Disregard font properties changes when inserting a separator.
This allows to output a simple blank line instead of strange constructs.
2014-05-18 17:34:11 +02:00
Enrico Forestieri
a919cd8c68 Take into account that a blank line is always output before a command. 2014-05-18 17:31:58 +02:00
Enrico Forestieri
c668ebf611 Fix bugs #8546 and #9055, and introduce new separator inset.
The algorithm used for breaking a paragraph in LaTeX export is changed
for avoiding spurious blank lines causing too much vertical space.
This change is tied to the introduction of a new inset (with two
different specializations) helping in either outputing LaTeX paragraph
breaks or separating environments in LyX. Both of the above goals were
previously achieved by the ---Separator--- layout and can now be
accomplished by the new inset in a more natural way. As an example,
after leaving an environment by hitting the Return key for two times,
a third return automatically inserts a parbreak inset, which is
equivalent to the old separator layout, i.e., it also introduces a
blank line in the output. If this blank line is not wanted, the
parbreak separator can be changed to a plain separator by a right
click of the mouse. Of course, an environment can still be separated
by the following one by using the Alt+P+Return shortcut (or the
corresponding menu key), but now the plain separator inset is used
instead of the old separator layout, such that no blank line occurs in
the LaTeX output.

Old documents are converted such that the LaTeX output remains unchanged.
As a result of this conversion, the old separator layout is replaced by
the new parbreak inset, which may also appear in places where the old
algorithm was introducing blank lines while the new one is not.
Note that not all blank lines were actually affecting the LaTeX output,
because a blank line is simply ignored by the TeX engine when it occurs
in the so called "vertical mode" (e.g., after an alignment environment).
The old ---Separator--- layout is now gone and old layout files using it
are also automatically converted.

Round trip conversions between old and new format should leave a document
unchanged. This means that the new behavior about paragraph breaking is
not "carried back" to the old format. Indeed, this would need introducing
special LaTeX commands in ERT that would accumulate in roundtrip
conversions, horribly cluttering the document. So, when converting a
modified document to old formats, the LaTeX output may slightly differ in
vertical spacing if the document is processed by an old version of LyX.
In other words, forward compatibility is guaranteed, but not backwards.
2014-05-10 23:25:11 +02:00
Richard Heck
0a6ff99f28 Typos and style. 2014-04-21 11:51:59 -04:00
Jean-Marc Lasgouttes
220fe66a67 Remove duplicate call to Cursor::selHandle 2014-03-17 10:55:49 +01:00
Jean-Marc Lasgouttes
a8c05f20be Whitespace only. 2014-03-14 14:22:26 +01:00
Juergen Spitzmueller
0dc4f4636f Enable environment-split for standard classes (#9023) 2014-03-07 08:58:24 +01:00
Jean-Marc Lasgouttes
ad56bded03 Bug #9005: various things that do not work as intended in passthru paragraphs
* disable branch-add-insert in pass thru paragraphs

* when it is not possible to input a quote inset, insert a single
  ascii quote when argument to quote-insert is "single"

* handle "mathspace" dialog in Text::getStatus

* disable insertion of newline inset in pass thru paragraphs

* handle "mathdelimiter" and "mathmatrix" dialogs in GuiView::getStatus.
2014-03-04 11:56:03 +01:00
Richard Heck
7b46aa8fbb Forgot in previous commit to deal with case. As I'm doing it now,
it's easy to use the existing docstring routine, so I've commented
out the string version of lowercase I had introduced. I've left the
code in case someone else needs it later.
2014-02-23 12:04:56 -05:00
Richard Heck
e5ea535952 If the selection is some sort of URL, then make it the target, not
the name, in the hyperlink. Fixes bug #8792.

This also fixes a bug discovered while working on this code: The
params passed to GuiHyperlink were never used.
2014-02-23 11:36:54 -05:00
Jean-Marc Lasgouttes
e7a1cce551 Rename some LFUN names to match their text name
Also, rename copy-label-as-reference to label-copy-as-reference and update LFUNs.lyx accordingly.
2014-02-13 13:50:33 +01:00
Juergen Spitzmueller
5a3f1a731f Extend environment-split to an 'outer' split function
This fixes a major beamer UI flaw reported by several users.
2014-01-27 08:01:24 +01:00
Georg Baum
c0ea37f337 Fix image pasting regression
I introduced a regression in c14b9e67 for pasting images:
If an image is on the clipboard both as PNG and HTML with just an url,
but no plain text, pasting would fail. The reason for this was that
text contents was detected (the HTML code), nd preferred, but actually
pasting it resulted in an empty string, since the HTML import could not
handle the url This error was not checked.
The solution is first to try text paste if both text and image content
is present, and then  try image paste if the text failed.
2013-07-13 22:44:20 +02:00
Vincent van Ravesteijn
97405fa623 Fix bug 7673 by reverting changes to BufferView::checkDepm
This reverts commit 210a4406 and a part of 5577e877.
2013-05-19 22:17:14 +02:00
Richard Heck
d79225ae98 Remove all messages to user related to assertions. We'll just use
a basic message which is defined in lassert.cpp now.
2013-04-27 17:52:55 -04:00
Richard Heck
1b1f8dd235 Audit all the LASSERT calls, and try to do something sensible at
each failure.

There are several places I was not sure what to do. These are marked
by comments beginning "LASSERT:" so they can be found easily. At the
moment, they are at:

Author.cpp:105: // LASSERT: What should we do here?
Author.cpp:121: // LASSERT: What should we do here?
Buffer.cpp:4525:        // LASSERT: Is it safe to continue here, or should we just return?
Cursor.cpp:345:         // LASSERT: Is it safe to continue here, or should we return?
Cursor.cpp:403:         // LASSERT: Is it safe to continue here, or should we return?
Cursor.cpp:1143:                // LASSERT: There have been several bugs around this code, that seem
CursorSlice.cpp:83:     // LASSERT: This should only ever be called from an InsetMath.
CursorSlice.cpp:92:     // LASSERT: This should only ever be called from an InsetMath.
LayoutFile.cpp:303:                     // LASSERT: Why would this fail?
Text.cpp:995:           // LASSERT: Is it safe to continue here?
2013-04-25 17:27:10 -04:00
Georg Baum
c14b9e67bc Implement paste from LaTeX and HTML (bug #3096)
As discussed on the list. No automatic contents detection is done, the user
needs to use the special paste menu instead. I used the new TempFile class
for safe temporary file handling.
The documentation would go into section 2.2 of UserGuide.lyx, but I am not
allowed to edit that document.
2013-04-14 19:45:36 +02:00
Georg Baum
c61ef8b205 Support \caption* (bug #3209)
This was a low hanging fruit which would have to wait for a long time because
of a file format change if it was not implemented before 2.1.
2013-03-22 22:23:38 +01:00
Richard Heck
57d8b059e0 Remove references to Counter LabelType from source code. The
intention is to use Static in its place, and we now expand the
label for these, as well.
2013-02-09 13:44:05 -05:00
Jean-Marc Lasgouttes
db025be5ae Consider deleted text when inserting quote inset.
This bug was reported against the ubuntu build:
  https://bugs.launchpad.net/bugs/1100046

Additionally, some extra code for avoiding double undo entries has
been removed, since this is handled by grouped undo now.
2013-01-21 14:49:45 +01:00