Commit Graph

4614 Commits

Author SHA1 Message Date
Jean-Marc Lasgouttes
1514087389 Revise commit 7a5eff56
Courtesy of the whitespace police.
2015-10-07 11:30:04 +02:00
Pavel Sanda
7a5eff56b0 Set minimal width of fixedwidth collapsable insets.
Intention behind this is actually Box inset being too tiny
to reasonably contain other insets like ERT.

http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg188987.html
2015-10-07 02:15:35 -07:00
Guillaume Munch
68be651e89 Add TOC of external materials. (#7790, partial)
Known issues (non-regressions):

* The TOC is not updated immediately after an external material inset is
  inserted. See TocBackend::updateItem().
2015-10-05 21:16:16 +01:00
Guillaume Munch
bb344452c8 Consistency of ellipses across the UI
Use the function support:truncateWithEllipsis() to shorten a docstring with
... at the end. Actually we use U+2026 HORIZONTAL ELLIPSIS instead of "..." when
automatically shortening strings. This is to be consistent with Qt's own
truncation and is much nicer on the screen.

This includes the bugs #9575 and #9572 regarding broken text elision in the
outliner.

Known issues (non-regressions):

* TocBackend::updateItem() should be rewritten to update all TOCs. (#8386)

* "..." should be replaced with … everywhere else on the interface (including
  translation strings).

* We should prefer to rely on QFontMetrics::elidedText() to truncate strings
  with an ellipsis whenever possible, or an equivalent for the buffer view
  dependent on the font metrics. See the warning in src/support/lstrings.h.
2015-10-05 21:16:16 +01:00
Guillaume Munch
8ea62f226b Amend d5a5fbb8e (cosmetic)
Bug #9579
2015-10-02 19:47:46 +01:00
Guillaume Munch
d5a5fbb8ee Enhancements and bugfixes to the TOCs
* New TOC "math-macro". This means that math macros can now be accessed in the
  outline pane in their order of appearance or in alphabetical order, and can be
  searched using the filter.

* Lists of floats now show subfloats deeper in the navigation menu

* The arbitrary 30 element cut-off after which nothing is shown except "Open
  Navigator..." is removed. Menus now have no limit in size, so Qt may display
  them scrollable. In exchange, we always show "Open outliner..." at the
  beginning. I tested for performance issues with a rather complex document and
  it is fine; but this does not exclude corner cases with lots of TOC entries of
  a certain kind. If necessary, populating the navigation sub-menu should be
  delayed like the main menu.

* Elements that do not contribute to the output (e.g. in a note, a disabled
  branch) are now preceded with a symbol indicating this status. (The machinery
  was already there; I wonder why it was not implemented already.) I have chosen
  U+274E NEGATIVE SQUARED CROSS MARK.

* Fix the contextual menus in the outliner (bug introduced at 94e992c5).

* Toc item now move to the caption when present, but first center on the float,
  to prevent the situation where the caption is at the top of the screen and the
  contents of the float is off-screen above the caption.
  (Internally, the action of the toc items can now be customised)

* Fix the LyXHTML output. Disabled captions no longer appear in the list of
  figures.
2015-10-01 21:44:22 +01:00
Georg Baum
b24664b0ac Remove unused variables found by cppcheck
There are still a few warnings of the kind
(style) Variable 'x' is assigned a value that is never used.
since I did not touch code where I was not sure whether there might be a real
bug, and I kept some for symmetry reasons as well.
2015-09-20 21:39:59 +02:00
Juergen Spitzmueller
02ead6a93a restore crucial float information in note insets (bug #9760) 2015-09-15 22:58:49 +02:00
Guillaume Munch
9b7ccbfc80 New class InsetCaptionable
This generalises the new use of TocBuilder (97e8101) to listings and wraps and
removes some duplicate code.

Make sure that we will never write an empty float type again in the future
(#9760)
2015-09-15 15:25:33 +01:00
Guillaume Munch
94e992c5ed Better construction of the TOC for floats and captions
We introduce TocBuilder for building TOCs that take into account both float
insets and their captions.

* Floats without caption are shown with their content.

* Floats with a caption are shown with their caption, but clicking the entry now
  correctly moves to the float and not to the caption.

* Subsequent captions produce additional entries in the TOC.

* Figures and subfigures are correctly ordered in the outliner.

* New TOC "senseless" for captions appearing alone (a bit like broken references
are still displayed in the menu and outliner).

* Disable LFUN_CAPTION_INSERT if there is already a caption in a listing

Known issues:

* Inconsistent output for includes located inside floats

* We should record the end of the float in addition of the beginning for a more
  accurate cursor -> outliner entry conversion
2015-09-15 15:25:33 +01:00
Guillaume Munch
c02f6bd8a7 Do not show subfigures in the menu (bug #9759)
* More consistent behavour (no 30 elements limit)
* Subfloats are given depth 1
* Only show depth 0
* Always show "Open outliner..."
2015-09-15 15:25:32 +01:00
Georg Baum
699a6db9fa Add some missing member variable initializations
These were all found by cppcheck. Even in constructors that are there "only
because of std containers" the class should be initialized correctly. You can
never know whether such an object does not get used, and then a nice crash
caused by dereferencing a NULL-pointer is better than undefined behaviour.
2015-09-13 19:47:21 +02:00
Georg Baum
c09663d2cb Return reference to this in operator=()
This is the recommendede signature of assignment operators and was found by
cppcheck.
2015-09-13 19:43:44 +02:00
Jean-Marc Lasgouttes
08fe2803c6 Initialize properly two members of InsetTabular
Also rename first_visible_cell to first_visible_cell_. I wonder though whether this variable is still useful.

Coverity issue 23383
2015-09-12 22:54:35 +02:00
Jean-Marc
ab1e642ef1 Fix logic of method
The last return statement was unreachable

Coverity issue 102063.
2015-09-12 19:01:18 +02:00
Jean-Marc
7065406eca image_ready is false at this point
Coverity issue 23299.
2015-09-12 18:33:17 +02:00
Juergen Spitzmueller
9f777d4bfb Do not attempt to select an empty cell before inserting a longtable caption
Fixes: #9692
2015-07-25 12:48:13 +02:00
Georg Baum
0f4c5df9f4 Support Photos in RasterImage template
Actually photos (i.e. .jpg files) where supported previously, but for pdflatex
output an unneeded conversion to png was done. The RasterImage templates
behaves now exactly as InsetGraphics for these files: If the input format is
jpg, use that for pdflatex, else convert to png.
2015-07-20 21:14:45 +02:00
Georg Baum
dc6d201f8f Store InsetGraphics bounding box in parsed form
This is like InsetExternal does it, avoids some string parsing, reduces the
amount of code and makes it more robust.
2015-07-18 17:02:54 +02:00
Georg Baum
81e592603d Support units in external inset bbox
This brings the external inset on par with the graphics insets as far as the
clipping option is concerned. The graphicxs package supports both: A bounding
box without units (which means that bp ia assumed), and a bounding box with
units, so we can simply output the values including the units.
2015-07-16 22:06:35 +02:00
Georg Baum
0cbcc8a166 Remove InsetGraphics noUnzip parameter
Being able to compile document with zipped .eps files was a useful feature of
the graphicxs package 20 years ago, but the LyX support is no longer relevant:
- The flag is ignored if preview is on
- If pdflatex is used then uncompressing happens during the compilation anyway
- If set, the flag prevents LyX from issuing proper error messages if
something with the image is wrong
- For hard disk capacities from 20 years ago not uncompressing is a useful
feature, but for current hard disk capacities it does not matter
- The external inset does not have it, and if we want to merge both insets
one day we would need to implement it there, which is even more difficult
than in InsetGraphics
2015-07-16 20:44:47 +02:00
Jean-Marc Lasgouttes
463bd17d75 Use integer line thickness in painter
There is no need for real-valued line width in painters. Actually, this even leads to uneven dashes for continuous spell checker.

The new code is supposed to be equivalent to the old one, just more readable. From this, we can try to see whether some lines need to be made thicker on HiDPI screens.
2015-07-14 17:42:45 +02:00
Juergen Spitzmueller
406d710131 Force local font switch in caption.
It is needed with polyglossia. With babel, it does not harm (and looks
more sensible).
2015-06-18 14:17:18 +02:00
Enrico Forestieri
11c2b7792c Replacement for commits bc47054b and ad0d0f6d
The strategy adopted in bc47054b had some drawbacks related to the way
instant preview snippets are generated. See the subthread starting at
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg187916.html
for details.

The strategy adopted in this commit is that of adding macro definitions
only for the macros actually used in a preview snippet, independently
of whether some macro was already used in a previous snippet. In this way
the snippets don't need to be changed according to whether they are
compiled as a whole or separately from each other. This fact was causing
the regeneration of a preview snippet whenever the cursor entered the
corresponding inset, even if the generated image would have not changed.
The problem of defining or redefining a macro is taken care by the
python scripts.
2015-06-14 18:10:29 +02:00
Enrico Forestieri
bdec44d614 Revert bc47054b and the related commit ad0d0f6d
As discussed on the devel list. See the subthread starting at
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg187916.html
Soon to be replaced with the same strategy adopted in the stable branch.
2015-06-14 18:05:39 +02:00
Enrico Forestieri
3924030e82 Fix some preview issues reported on the devel list.
* Provide for vector fonts only if needed.
* Make sure microtype doesn't throw a trantum in dvi mode.
* Use correct macro definition in preview insets.
2015-06-03 00:24:54 +02:00
Juergen Spitzmueller
5d41a22ee4 Fix preview of included files in child documents (bug #9583) 2015-06-02 17:23:52 +02:00
Enrico Forestieri
ad0d0f6d69 Really fix bug #9354 2015-05-31 00:53:38 +02:00
Richard Heck
babe9eaeab The way this was done here is inconsistent with how it is done
in other places.
2015-05-28 18:03:27 -04:00
Scott Kostyshak
7399d99c98 Allow SVGs in HTML output (#7441)
This is only a specific part of #7441.

Patch from Julien Rioux.
2015-05-27 11:25:06 -04:00
Juergen Spitzmueller
c60827146f Fix logic in tabular dialog with decimal alignment
Fixes: #9570

Partially reverts [9d05ac5c912/lyxgit].
2015-05-25 15:55:11 +02:00
Juergen Spitzmueller
be6a6d76af InsetFloat: fix typo 2015-05-23 10:38:31 +02:00
Juergen Spitzmueller
47dd9189eb Add more Float tags to allow to disable wide and sideways feature
Fixes: #9557, #9558

This is amended to yesterday's layout format change.
2015-05-22 18:59:17 +02:00
Juergen Spitzmueller
7dc123b790 Add Float tag to determine allowed positioning options (#7752) 2015-05-22 10:37:14 +02:00
Enrico Forestieri
93e131f54f Code simplification. 2015-05-21 18:13:42 +02:00
Juergen Spitzmueller
977bbd9bc3 Add InsertCotext tag also to InsetLayout argument (part of #4745) 2015-05-21 08:53:56 +02:00
Enrico Forestieri
7b0ecf1f38 Also find external material files when the document is moved and origin is known 2015-05-20 16:04:18 +02:00
Enrico Forestieri
a93ac27450 Avoid compiler warning about overloaded virtual function. 2015-05-20 15:49:15 +02:00
Juergen Spitzmueller
4005a4d470 Use trimmed string in [Inset]Layout Requires.
Fixes: #9518
2015-05-19 10:17:34 +02:00
Uwe Stöhr
52a158b6d7 InsetBox.cpp: add visual feedback for frame color
- the idea is to color the box inset frame according to the fame color of the box (if there is any). To keep the WYSIWYM principle the frame thickness and box separation are not taken into account. However this should be possible if anybody would like that.

- besides this, use the correct conversion command for the background color
2015-05-17 23:20:43 +02:00
Uwe Stöhr
95af488798 InsetBox.cpp: fix a bug I introduced in [88593e0e/lyxgit] 2015-05-17 17:36:46 +02:00
Georg Baum
84cca2dd94 Fix indentation 2015-05-17 17:27:27 +02:00
Uwe Stöhr
46671b5836 InsetBox.cpp: code simplification
thanks Pavel for the hint
2015-05-17 03:21:02 +02:00
Enrico Forestieri
62d36bf04d Correctly load documents moved elsewhere after save.
It is now possible opening documents that where manually moved to a
different location after they were saved and still produce an output.
Indeed, (hopefully) all needed included files are now still found.
When the moved document is saved again, all paths are accordingly updated.
Of course, for this to work, a document has to be saved in Format 490,
at least.

As an example, after converting the user guide to the last format, it can
be copied anywhere and opened without the need of adapting the paths of
included files or moving them to a proper place.

There is one glitch I am aware of. When moving a child document (but not
the master) the path to the master is correctly updated but it won't be
recognized as such. This is because LyX checks that the parent actually
includes this document but, of course, being the parent document not
touched, it appears not including this child. Anyway, it will also occur
when saving the child to a different location and the user is warned
on the terminal about this fact when the moved child is loaded.
However, there is no problem when it is the master that has been moved.
2015-05-16 19:52:39 +02:00
Uwe Stöhr
88593e0ec6 support for colored boxes
adds support to set colors for some box types (support for the LaTeX commands \fcolorbox and \colorbox)

fileformat change
2015-05-16 03:22:37 +02:00
Uwe Stöhr
7bb691b8ad InsetBox.cpp: code simplification 2015-05-15 03:59:04 +02:00
Pavel Sanda
915b7c521e Unduplicate box strings. 2015-05-13 00:15:37 -07:00
Richard Heck
fb4c70650c Use const ref instead of passing by value.
Thinko caught by coverity.
2015-05-12 12:52:36 -04:00
Richard Heck
7a0f7b7046 Pass XHTMLStream by reference. Problem found by coverity.
The previous code worked because we are writing to the stream, and
the actual odocstream is a member by reference of XHTMLStream.
2015-05-12 10:13:04 -04:00
Uwe Stöhr
34da634451 BoxUi.ui: update tooltips and tab order
- InsetBox.cpp: constify
2015-05-12 00:28:29 +02:00