Guillaume Munch [Wed, 7 Oct 2015 03:02:40 +0000 (04:02 +0100)]
Splitting otexstream into otexrowstream and otexstream.
otexstream used to count lines to build a TexRow, and some other things. The new
class otexrowstream has the line counting feature of the previous otexstream
without other stuff. otexstream is now a subclass of otexrowstream that has the
same features as before.
This is preliminary work for extending the cursor<->row tracking to math.
Georg Baum [Sun, 18 Oct 2015 18:55:53 +0000 (20:55 +0200)]
Fix language end command
The code that sets open_polyglossia_lang_ is not only executed for polyglossia,
but also for babel, so we have to use the correct language end command.
Uwe Stöhr [Sun, 18 Oct 2015 16:57:15 +0000 (18:57 +0200)]
EmbeddedObjects.lyx: update appendix A
Since a while now we can translate the unit descriptions. For some special applications it is also necessary that the users know the LaTeX command of the relative units.
The context menu did no longer work for some insets, since it requires the
cursor to be in front, and editXY() is also used to determine the inset for
the context menu. Now the cursor is corrected if needed.
Georg Baum [Thu, 15 Oct 2015 18:52:28 +0000 (20:52 +0200)]
Fix std::string docstream output error
This was made visible by aab1b145a57c, since xhtml export for
lib/doc/Additional.lyx caused an exception. However, the cause for this was
already present earlier: All attempts to output a std::string to an
odocstream resulted in trying to change the encoding of the stream instead,
since there is no operator<<(odocstream &, std::string) defined, and an
implicit conversion to SetEnc happened instead.
This is fixed by making the SetEnc constructor explicit and adjusting all
code parts that did not compile anymore after that. The parts of the code
that did use the wrong output operator were the std::string version of
htmlize() from output_xhtml.cpp and all changed parts in the other .cpp files.
I also removed the std::string versions of html::htmlize() and
html::cleanAttr(), since it was difficult to see which encodings were used
with these. Now we are always explcit when using html::cleanAttr() and
html::htmlize().
Uwe Stöhr [Mon, 12 Oct 2015 00:50:07 +0000 (02:50 +0200)]
installer: update the packages list
- there are some new packages required by LyX's supported document classes and example files
(this list is only used when LyX is installed the first time on a PC together with MiKTeX to shorten the installation time)
Georg Baum [Sun, 11 Oct 2015 12:21:45 +0000 (14:21 +0200)]
Fix cursor movement for large logos (#9628)
Previously, if one clicked onto a large non-editable inset like the new LyX
logo inset, the cursor was always positioned in front of the inset, even if
the click was almost at the back edge. Now the cursor is positioned at the
correct edge. I tested this also with RTL contents, where from means right
and back means left, but the inset anchor position anchor point is still
at the left, and the right edge is dim.wid pixels to the right of it.
Georg Baum [Sun, 11 Oct 2015 09:16:09 +0000 (11:16 +0200)]
Comply with rule-of-three
The rule-of-three says that if any of virtual destructor, copy constructor
or assignment operator needs to be manually implemented, then all three
should be implemented. Otherwise you can get subtle bugs which can be
difficult to find. In the changed classes, changing a copy-construction to
an assignment would have had surprising effects. Now they all behave
consistently.
Georg Baum [Sat, 10 Oct 2015 19:15:55 +0000 (21:15 +0200)]
Fix copy-paste leftover
Found by cppcheck: (style) Same expression on both sides of '&&'.
I deduced the correct if-condition from the other places where theLaTeXFonts()
is called.
Georg Baum [Sat, 10 Oct 2015 19:04:28 +0000 (21:04 +0200)]
Add missing intializations
These were found by cppcheck:
Member variable 'x' is not initialized in the constructor.
The crash #9788 would not have happened if this had been done earlier.
Georg Baum [Sat, 10 Oct 2015 16:58:18 +0000 (18:58 +0200)]
Fix multicolumn regression (bug #9788)
The test case did show several problems:
- The alignment argument was not parsed correctly if it was not in braces
- There one column too much created, since I did not take into account that
the current cell must bge replaced by the multicolumn cell
- If the last line of an array contained only an empty multicolumn cell, then
the complete multicolumn was swallowed
- The decision whether to output the column separator & was sometimes wrong
for multicolumns
Uwe Stöhr [Sat, 10 Oct 2015 00:15:09 +0000 (02:15 +0200)]
PDF-comment.lyx: new German translation
- also disable PDF-reply since this never works correctly and it could even destroy the whole PDF and exceeds the TeX capacity
- update the french version accordingly
Georg Baum [Fri, 9 Oct 2015 21:15:54 +0000 (23:15 +0200)]
Initialize member
This fixes the crash of bug #9788. However, the misparsing of \multicolumn
is still there: LyX thinks that the array has three columns, it inserts an
additional one before the multicolumn.
This was a regression from 2.1.x. I failed to copy the horrible hack that was present for the special case of () in Hebrew.
There is a real need for someone who understands RTL language stuff to fix this. Currently () are wrong in .lyx files IMO. We should not have to swap them for display.
Guillaume Munch [Sun, 4 Oct 2015 18:38:47 +0000 (19:38 +0100)]
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.
Improvements to cursor highlighting in the source panel
* TexRow now computes rows from a DocIterator. In practice, the cursor
highlighting is now correct inside insets, it is no longer restricted to the
topmost level. It certainly also makes forward-search more precise.
* Added the option to disable a texrow when not needed, for perf.
* Fixed a bug where the last paragraph was not properly highlighted.
Limitations:
* TexRow still does not handle: math (e.g. multi-cell), sub-captions, inset
arguments.
* 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.
Guillaume Munch [Sat, 29 Aug 2015 00:51:38 +0000 (01:51 +0100)]
Fix bugs #6078 and #9364
Remove unwanted clearSelection()s in MathData::updateMacros(). These calls broke
text selection with keyboard and mouse, search-and-replace, restoring selection
after Undo, etc. in a document with math macros since 1.6.0. (Regression at 6aa54673 and 12314897)
I do not know the purpose of these calls, but the selection code has been worked
on since, and I cannot produce undesired behaviour after removing
them.
Rewrite Cursor::getSurroundingPos without Bidi class
New method TextMetrics::findRowElement, excerpted from CursorX.
Reimplement getSurroundingPos using Row information. This is easy when
the cursor is inside a row element. At row element edges, different
situations can occur; hopefully all these situations are taken into
account.
Rename the old getSurroundingPos to getSurroundingPosOrig and
transform getSurroundingPos into a wrapper that compares the two
methods. This will be removed when we are confident that the new
function is equivalent to the old one.
It will then be possible to remove also the Bidi class (at last!).
Only enable std::regex when the header <regex> is present (fix Mac OS X issue).
Remove support for concept checks. The page
https://gcc.gnu.org/onlinedocs/libstdc++/manual/concept_checking.html
says about concept checking:
Please note that the checks are based on the requirements in the
original C++ standard, many of which were relaxed in the C++11
standard and so valid C++11 code may be incorrectly rejected by the
concept checks. Additionally, some correct C++03 code might be
rejected by the concept checks, for example template argument types
may need to be complete when used in a template definition, rather
than at the point of instantiation. There are no plans to address
these shortcomings.
Therefore it seems reasonable to remove our support for this.
Give a warning when system boost and stdlib-debug are used together
In general this would lead to an immediate runtime crash because the
runtime checks of libstdc++ change the layout of some STL objects.
Therefore, this will only work when the boost libraries have been
compiled with this same flag. At this time, it is not known whether
any linux distribution contains such libraries.
- the long awaited MiKTeX installer is available, this fixes many installation errors in LyX is installed for the first time (I will provide a new installer build as soon as I find more time)
Georg Baum [Sun, 20 Sep 2015 19:39:59 +0000 (21:39 +0200)]
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.
Georg Baum [Sun, 20 Sep 2015 17:43:06 +0000 (19:43 +0200)]
Forbid wrong compiler generated copy constructors
This fixes cppcheck warnings (style) 'class x' does not have a copy constructor
which is recommended since the class contains a pointer to allocated memory.
Georg Baum [Sun, 20 Sep 2015 11:05:30 +0000 (13:05 +0200)]
Create module for paralist.sty
paralist.sty extends the standard list environments by some more compact
versions. Support for this has already been requested 15 years ago, and
now I needed it myself.
Georg Baum [Sun, 20 Sep 2015 08:42:35 +0000 (10:42 +0200)]
Fix cppcheck variable scope warnings
These were all flagged by "(style) The scope of the variable 'x' can be reduced."
Narowing the scope improves readability, and if it is in a loop then the
compiler will be clever enough to produce efficient code, we do not need
manual optimization for POD types.
Georg Baum [Thu, 17 Sep 2015 20:11:18 +0000 (22:11 +0200)]
Refuse to run tex2lyx tests with in-source builds
As Günter found out running the tex2lyx tests overwrites the test references
if the build directory is identical to the source directory. Therefore the
tests would always pass, but git diff would show a non-empty diff if the tests
should have failed. Since it is better anyway to build in a separate directory
we simply do not support srcdir = builddir for the tests and abort with an
error.