Commit Graph

70 Commits

Author SHA1 Message Date
Thibaut Cuvelier
875f7d42e2 DocBook: avoid generating empty paragraphs instead of new pages.
As this required to first generate the paragraph before outputting it if necessary, tests like XMLStream::isTagOpen no more worked properly. This also refactors table handling to get rid of that case (and make code easier to read).
2020-08-02 04:03:39 +02:00
Thibaut Cuvelier
8d115413c1 DocBook: fix delimitation of bibliographies. 2020-08-02 04:03:39 +02:00
Thibaut Cuvelier
5324566013 DocBook: use the right key when generating bibiomixed. 2020-08-01 03:39:53 +02:00
Thibaut Cuvelier
44ef3fadee DocBook: fix encoding issues with complex ERT. 2020-07-31 20:17:38 +02:00
Thibaut Cuvelier
acdead0487 DocBook: better condition for abstracts. 2020-07-31 01:20:08 +02:00
Thibaut Cuvelier
6434b666bf DocBook: don't output abstract if it would have no content.
Restore a change from e709a662 (reverted by d75ff993) that was mixed into another commit.

Also, add a TODO for InsetIndex.
2020-07-31 00:55:00 +02:00
Thibaut Cuvelier
e153477bca DocBook: Kornel's patch to get rid of many assertions 2020-07-30 23:22:41 +02:00
Thibaut Cuvelier
d75ff9931d Revert "Support the mathbbm font."
This reverts commit e709a6626e.
2020-07-28 18:01:38 +02:00
Thibaut Cuvelier
e709a6626e Support the mathbbm font.
Should just be able to read formulae, not add it from the GUI, as it's mostly redundant with mathds and mathbb.
2020-07-27 03:15:00 +02:00
Thibaut Cuvelier
a874173660 DocBook: can finally generate "Developing LyX" without validation errors.
This also removes many warnings when generating this document.
2020-07-26 04:59:30 +02:00
Thibaut Cuvelier
e0b8bac36e DocBook: fix issues with nested labeling lists. 2020-07-26 04:44:04 +02:00
Thibaut Cuvelier
88e00a0b7b DocBook: fix issues with nested description lists. 2020-07-25 23:51:32 +02:00
Thibaut Cuvelier
459c17fb14 DocBook: use xml:id instead of just id.
Amend 62af830f.
2020-07-25 19:00:56 +02:00
Thibaut Cuvelier
5de60e3c77 DocBook: implementation of LATEX_BIB_ENVIRONMENT.
Fixes endless loops when such environments were used.

Add Kornel's test case that triggers an infinite loop when generating as DocBook 5
2020-07-25 17:37:13 +02:00
Thibaut Cuvelier
e0a4dfa7d3 DocBook: avoid skipping paragraphs in <info>. 2020-07-20 03:41:44 +02:00
Thibaut Cuvelier
fb45f7b8c9 DocBook: don't update counters when generating, as they are not used in DocBook.
This also removes a warning in the console in some cases where counters are updated when they don't exist...
2020-07-20 03:01:41 +02:00
Thibaut Cuvelier
51939801f5 DocBook: better handling of paragraphs containing notes in the abstract. 2020-07-20 03:01:41 +02:00
Thibaut Cuvelier
6b701f945e DocBook fonts: fix issue 1732 2020-07-19 21:00:25 +02:00
Thibaut Cuvelier
af5257b6c3 Fix Coverity false positive for null-pointer dereference 2020-07-09 09:24:35 +02:00
Richard Kimberly Heck
8ae0841826 Whitespace 2020-07-08 12:38:05 -04:00
Thibaut Cuvelier
3883b85f49 New DocBook support 2020-07-08 08:42:16 +02:00
Thibaut Cuvelier
a6b07608d8 Rename XHTMLStream to XMLStream, move it to another file, and prepare for DocBook adoption.
xml.cpp/h also merges functionalities from sgml.cpp/h.
2020-06-15 13:01:56 +02:00
Jean-Marc Lasgouttes
fc5b22a2f1 Get rid of lyx::next uses for RandomAccessList
These uses are inefficient (a loop really) and require that pit_type
is ptrdiff_t.

Instead, RandomAccesslist::constIterator is renamed to iterator_at and
a version adding a non-const iterator is added. Additionally, the
method retirns end() when position is equal to the size of the
container (see #11861).

lyx::next and lyx::prev are removed, and std::prev is used in the few
places where the code requires it (for no good reason IMO).
2020-05-14 10:35:49 +02:00
Jean-Marc Lasgouttes
c756749991 Revert "Get rid of lyx::next uses for RandomAccessList"
This is not ready (see #11861).

This reverts commit 6d97e39934.
2020-05-13 10:45:25 +02:00
Jean-Marc Lasgouttes
6d97e39934 Get rid of lyx::next uses for RandomAccessList
These uses are inefficient (a loop really) and require that pit_type
is ptrdiff_t.

Instead, RandomAccesslist::constIterator is renamed to iterator_at and
a version adding a non-const iterator is added.

lyx::next and lyx::prev are removed, and std::prev is used in the few
places where the code requires it (for no good reason IMO).
2020-05-12 17:29:21 +02:00
Christian Ridderström
e30f3d76d2 Bulk cleanup/fix incorrect annotation at the end of namespaces.
This commit does a bulk fix of incorrect annotations (comments) at the
end of namespaces.

The commit was generated by initially running clang-format, and then
from the diff of the result extracting the hunks corresponding to
fixes of namespace comments. The changes being applied and all the
results have been manually reviewed. The source code successfully
builds on macOS.

Further details on the steps below, in case they're of interest to
someone else in the future.

1. Checkout a fresh and up to date version of src/

    git pull && git checkout -- src && git status src

2. Ensure there's a suitable .clang-format in place, i.e. with options
   to fix the comment at the end of namespaces, including:

    FixNamespaceComments:                           true
    SpacesBeforeTrailingComments:                   1

and that clang-format is >= 5.0.0, by doing e.g.:

    clang-format -dump-config | grep Comments:
    clang-format --version

3. Apply clang-format to the source:

    clang-format -i $(find src -name "*.cpp" -or -name "*.h")

4. Create and filter out hunks related to fixing the namespace

    git diff -U0 src > tmp.patch
    grepdiff '^} // namespace' --output-matching=hunk tmp.patch  > fix_namespace.patch

5. Filter out hunks corresponding to simple fixes into to a separate patch:

    pcregrep -M -e '^diff[^\n]+\nindex[^\n]+\n--- [^\n]+\n\+\+\+ [^\n]+\n'  \
        -e '^@@ -[0-9]+ \+[0-9]+ @@[^\n]*\n-\}[^\n]*\n\+\}[^\n]*\n'         \
        fix_namespace.patch > fix_namespace_simple.patch

6. Manually review the simple patch and then apply it, after first
   restoring the source.

    git checkout -- src
    patch -p1 < fix_namespace_simple.path

7. Manually review the (simple) changes and then stage the changes

    git diff src
    git add src

8. Again apply clang-format and filter out hunks related to any
   remaining fixes to the namespace, this time filter with more
   context. There will be fewer hunks as all the simple cases have
   already been handled:

    clang-format -i $(find src -name "*.cpp" -or -name "*.h")
    git diff src > tmp.patch
    grepdiff '^} // namespace' --output-matching=hunk tmp.patch  > fix_namespace2.patch

9. Manually review/edit the resulting patch file to remove hunks for files
   which need to be dealt with manually, noting the file names and
   line numbers. Then restore files to as before applying clang-format
   and apply the patch:

    git checkout src
    patch -p1 < fix_namespace2.patch

10. Manually fix the files noted in the previous step. Stage files,
    review changes and commit.
2017-07-23 13:11:54 +02:00
Richard Heck
75bfed5507 Fix trailing whitespace in cpp files. 2017-07-03 13:53:14 -04:00
Stephan Witt
ac4cca6ed4 Fix missing includes after change 670efa8f64 2016-07-04 12:11:24 +02:00
Stephan Witt
7e72c1d0d3 Call lyx::next and lyx::prev explicitely. In case libc++ provides
std::next even when not in C++11 mode this is necessary. E.g. with
clang from Xcode7 on Mac OS X.
2016-01-10 18:06:15 +01:00
Georg Baum
d3b5260f45 Remove unused variables
Found by cppcheck: (style) Unused variable: x
2015-10-10 21:28:28 +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
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
Lars Gullik Bjønnes
6b2232a29c src/*.cpp: reformatting to increase consistency 2012-10-28 17:42:07 +01:00
Vincent van Ravesteijn
fa9bd04ea4 Fix bug #7914: Freeze on docbook export of lists and bibliography
The LATEX_LIST_ENVIRONMENT and LATEX_BIB_ENVIRONMENT type paragraphs are
not yet implemented in DocBook export. However, we need to actively skip
these paragraphs in order not to end up in an endless loop.
2012-05-02 15:34:56 +02:00
Richard Heck
f0255dae80 Style. 2012-03-13 12:07:48 -04:00
Vincent van Ravesteijn
db3aadf424 Merge remote-tracking branch 'lyxit/vfr/docbook-fix-7004'
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40089 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-30 11:44:22 +00:00
Pavel Sanda
a5cb2afc1b Next headers
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33976 a592a061-630c-0410-9148-cb99ea01b6c8
2010-03-31 19:38:05 +00:00
Richard Heck
b18bfcf3cc Kill a (public) magic boolean.
The point of this will become clear shortly. I hope.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33133 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-21 18:46:20 +00:00
Abdelrazak Younes
8c053ea10c Move depthHook(), outerHook(), isFirstInSequence(), outerFont() to Text methods.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30957 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-09 18:35:39 +00:00
Abdelrazak Younes
2b9e44cb01 Move contents of paragraph_funcs.* to Text.h and Text.cpp.
The goal is to simplify the code afterwards.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30955 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-09 17:30:41 +00:00
Richard Heck
e40ec704fa Add a note about docbook() problems.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29997 a592a061-630c-0410-9148-cb99ea01b6c8
2009-06-06 14:29:24 +00:00
Richard Heck
92a69bb790 Basic output routines for HTML.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29950 a592a061-630c-0410-9148-cb99ea01b6c8
2009-06-05 17:44:35 +00:00
Uwe Stöhr
8f3acbb484 remove unused includes of convert.h
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29772 a592a061-630c-0410-9148-cb99ea01b6c8
2009-05-21 21:02:14 +00:00
André Pönitz
f1cba8ff64 more latin1..utf8 schanges. all of src/* should be utf8 now
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27425 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-14 15:58:50 +00:00
Jean-Marc Lasgouttes
9b4a26a252 rename assert.h to lassert.h
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24559 a592a061-630c-0410-9148-cb99ea01b6c8
2008-04-30 08:26:40 +00:00
André Pönitz
7f461f4392 infrastructure for 'graceful asserts'
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24216 a592a061-630c-0410-9148-cb99ea01b6c8
2008-04-10 21:49:34 +00:00
Richard Heck
a01cb111a0 Change the interface to a paragraph's layout. We still store a LayoutPtr, but now privately, and make a Layout const & available to clients.
The need for a LayoutPtr arises from the fact that (a) we do not want to give our clients a Layout &, since we do not want them to be able to change our Layout; but (b) we also need to be able to change which layout is ours. So we cannot store a Layout const &. Or so it seems to the compiler.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23522 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-06 21:31:27 +00:00
Richard Heck
f401ce5d29 Changes LayoutList from a vector<LayoutPtr> to a vector<Layout>.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23519 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-06 20:01:30 +00:00
Richard Heck
d8a6b5bfd0 Remove TextClassPtr without losing the type safety it provided.
See these threads:
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg136112.html
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg136062.html
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg135997.html
for some background.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23299 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-28 01:42:02 +00:00
André Pönitz
db8c16d554 progress on buffer-reference-in-insets. beware of instabilities...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23289 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-27 20:43:16 +00:00