Commit Graph

94 Commits

Author SHA1 Message Date
Thibaut Cuvelier
0f145c3ef0 DocBook: use DocBookWrapperMergeWithPrevious in the code. 2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
72c304a629 DocBook: make openParTag/closeTag use paragraphs instead of layouts.
Not useful per se, but will be next with checking whether the wrapper tags should be opened/closed.
2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
c417253d0b DocBook: use DocBookItemTag within paragraphs.
This is at least helpful for AAS, even though it slightly resembles a repurposition of that parameter.
2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
1a09086ec2 Merge findLastParagraph and findLastBibliographyParagraph to lower code duplication.
Maybe these functions should move to ParagraphList.h/cpp?
2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
4d78fe5957 Slight code-consistency improvements. 2020-09-19 20:43:36 +02:00
Thibaut Cuvelier
a852706bf0 DocBook: allow empty paragraphs before the <info> section. 2020-09-19 20:43:36 +02:00
Thibaut Cuvelier
348297520f Revert "DocBook: allow empty paragraphs before the <info> section."
This reverts commit c6937cece9.
2020-08-03 22:58:15 +02:00
Thibaut Cuvelier
ab4f22beb9 Revert "Slight code-consistency improvements."
This reverts commit 6bcc0155b6.
2020-08-03 22:57:41 +02:00
Thibaut Cuvelier
dedeb885f8 Revert "Merge findLastParagraph and findLastBibliographyParagraph to lower code duplication."
This reverts commit 20d65b9d97.
2020-08-03 22:57:22 +02:00
Thibaut Cuvelier
fe8aff31fd Revert "DocBook: use DocBookItemTag within paragraphs."
This reverts commit 49b998f99b.
2020-08-03 22:57:11 +02:00
Thibaut Cuvelier
21c92c8a12 Revert "DocBook: make openParTag/closeTag use paragraphs instead of layouts."
This reverts commit 3d7c802c22.
2020-08-03 22:56:55 +02:00
Thibaut Cuvelier
4c01ab9ecf Revert "DocBook: use DocBookWrapperMergeWithPrevious in the code."
This reverts commit 62c9f4332d.
2020-08-03 22:56:25 +02:00
Thibaut Cuvelier
c2be69187c Revert "DocBook: eat a bit of that spaghetti code."
This reverts commit 25bcbe7666.
2020-08-03 22:56:16 +02:00
Thibaut Cuvelier
42eca3d8d6 Revert "DocBook: simplify code to handle abstracts."
This reverts commit 0199e048ff.
2020-08-03 22:56:06 +02:00
Thibaut Cuvelier
f025538c95 Revert "DocBook: add a layout tag to tell whether an item is the abstract or not."
This reverts commit 5ccd63eff6.
2020-08-03 22:55:52 +02:00
Thibaut Cuvelier
5ccd63eff6 DocBook: add a layout tag to tell whether an item is the abstract or not. 2020-08-03 16:04:58 +02:00
Thibaut Cuvelier
0199e048ff DocBook: simplify code to handle abstracts. 2020-08-03 16:04:58 +02:00
Thibaut Cuvelier
25bcbe7666 DocBook: eat a bit of that spaghetti code. 2020-08-03 16:04:58 +02:00
Thibaut Cuvelier
62c9f4332d DocBook: use DocBookWrapperMergeWithPrevious in the code. 2020-08-03 16:04:58 +02:00
Thibaut Cuvelier
3d7c802c22 DocBook: make openParTag/closeTag use paragraphs instead of layouts.
Not useful per se, but will be next with checking whether the wrapper tags should be opened/closed.
2020-08-03 16:04:58 +02:00
Thibaut Cuvelier
49b998f99b DocBook: use DocBookItemTag within paragraphs.
This is at least helpful for AAS, even though it slightly resembles a repurposition of that parameter.
2020-08-03 16:04:58 +02:00
Thibaut Cuvelier
20d65b9d97 Merge findLastParagraph and findLastBibliographyParagraph to lower code duplication.
Maybe these functions should move to ParagraphList.h/cpp?
2020-08-03 16:04:58 +02:00
Thibaut Cuvelier
6bcc0155b6 Slight code-consistency improvements. 2020-08-03 16:04:57 +02:00
Thibaut Cuvelier
c6937cece9 DocBook: allow empty paragraphs before the <info> section. 2020-08-03 16:04:57 +02:00
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