Commit Graph

437 Commits

Author SHA1 Message Date
Jean-Marc Lasgouttes
d6337a2488 Remove obsolete code to handle Hebrew and Arabic characters
This is handled by Qt now.

Note that a small optimization (do not draw text that is to the left
of WorkArea) is removed because it cannot be guaranteed to be exact
anymore. It was probably not very useful anyway, and would become
useless once the RowPainter is rewritten to use Row information.

Update 00README_STR_METRICS_BRANCH.
2014-07-08 21:30:06 +02:00
Jean-Marc Lasgouttes
d32f76f7fe Small Inset isXXX methods cleanup
* rename isStretchableSpace to isHfill
 * inline a trivial method
 * remove InsetIPAMacro::isLineSeparator, which has the same value as default.
2014-06-25 17:54:26 +02:00
Richard Heck
5536b0c7fe Flush stream more often to help figure out where the mystery crash
originates.
2014-06-04 09:19:42 -04:00
Juergen Spitzmueller
20bcaec061 Add layout tag that determines if/when a paragraph can be indented.
Fixes: #7327, #7458, #8670
2014-05-29 14:10:32 +02:00
Jean-Marc Lasgouttes
ee7c4db72a Do not forget last word of paragraph in completion
With the old code, the last word of a paragraph would not be added in
the completion list. The key difference is to pass `from' instead of `pos'
to FontList::fontiterator.

Slight cleanup of the code.
2014-05-16 15:22:51 +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
Tommaso Cucinotta
13cb7da11d Merged Paragraph::stringify into asString(). 2014-04-21 11:51:59 -04:00
Richard Heck
0a6ff99f28 Typos and style. 2014-04-21 11:51:59 -04:00
Richard Heck
8b00b355ca Change forToc() to forOutliner(), to avoid confusion. The old name
is left over from when the outliner really did just display a TOC.
2014-04-21 11:51:59 -04:00
Jean-Marc Lasgouttes
f8da042312 Do not store Languages objects in completion words lists
In the current code each paragraph contains a map<Language,
WordList*>, which means that it contains a full copy of the language
object. Since these objects contain translation tables nowadays, this
is a very bad idea.

This patch simply replaces the Language key by a string.

When loading the Userguide on linux/x86_64, the total memory
consumption decreases from 36.27MB to 31.50MB.
2014-04-21 11:51:59 -04:00
Juergen Spitzmueller
0b2d89eaea In Paragraph::changeCase, correctly track the font of the changed characters (fix crash)
Fixes: #7943
2014-04-21 11:51:58 -04:00
Vincent van Ravesteijn
53b60462ac Revert "Fixing #7987: deleted text in change-tracking mode is not found in Advanced F&R any more."
This reverts commit cb351665f4.
2014-03-29 22:21:40 +01:00
Tommaso Cucinotta
cb351665f4 Fixing #7987: deleted text in change-tracking mode is not found in Advanced F&R any more.
Merged Paragraph::stringify into asString().
Added ignore of deleted text to Advanced F&R.
2014-03-27 23:36:15 +00:00
Juergen Spitzmueller
7c1fc6ea75 Include child's own authors when using BufferParams from master. 2014-03-13 06:43:38 +01:00
Vincent van Ravesteijn
795535e44f Do not try to track_change an auto-deleted bibitem
We are not capable of handling two bibitems within one biblio paragraph.
That's why we have functions like Paragraph::brokenBiblio() and
Paragraph::fixBiblio(). So, if we fix the biblio by deleting the second
bibitem, we should not keep it as deleted.

This code caused a crash because the inset was released, but still kept as
deleted.

Fixes-bug: #8646.
2014-02-07 22:55:05 +01:00
Juergen Spitzmueller
50bcd6ed7b Use the master buffer's param when compiling as a child (#8893) 2013-11-18 08:46:50 +01:00
Vincent van Ravesteijn
8164fea772 Encodings: Use BufferEncodings where needed 2013-09-29 15:26:22 +02:00
Juergen Spitzmueller
f9411f1f26 Catch uncodable character problem 2013-08-30 11:28:15 +02:00
Vincent van Ravesteijn
30f5187070 Disallow to insert an inset without a font
Doing so could lead to an assertion in Paragraph::fontSpan.
2013-05-19 12:48:35 +02:00
Vincent van Ravesteijn
cd802e5cf6 Fix assertion: bibitem inset without a font
Move the cursor in front of a bibitem and press enter.
Paragraph::fixBiblio will insert a new bibitem without a font in the new
paragraph. This will make Paragraph::fontSpan assert because the fontlist_
of the new paragraph is empty.
2013-05-19 12:48:32 +02:00
Vincent van Ravesteijn
2d8941eec3 Revert "Fix assertion for InsetInfos of icon types"
Using "Font no_font" in case no font was supplied was wrong. Instantiating a font object without specifying the language lead to a font object having the default_language that is hardcoded to "english". See Language::read().

This caused that there were spurious language changes in the LaTeX output
and made some document uncompilable.

This reverts commit 3619954590.
2013-05-19 12:48:29 +02:00
Richard Heck
8b858d113f Get font sizes working for XHTML. 2013-05-13 12:22:41 -04:00
Richard Heck
c713030edb Get font families working for XHTML. 2013-05-13 11:58:52 -04:00
Richard Heck
b383d04e07 XHTML support for font shapes. 2013-05-13 10:45:12 -04:00
Richard Heck
5cadeed4d7 Rework that way that font tags are handled in XHTML output. We need
to do this in order to handle span tags properly, when they act as
font tags.
2013-05-13 10:45:12 -04:00
Richard Heck
ad56bb7286 Rework how paragraph ids are handled.
Previously, an empty paragraph would always yield something like:
	<div><a id='magicparid-35' /></div>
because we had no way to "defer" the anchor tag. Now this is wrapped
into the div, in effect, and we abandon it all if there's no content.
2013-05-13 10:45:12 -04:00
Richard Heck
8e23cfdbdc Minor cleanup. 2013-05-02 21:23:11 -04:00
Vincent van Ravesteijn
3619954590 Fix assertion for InsetInfos of icon types
InsetInfo inserted insets in its text without specifying a font. This
caused the fonlist to be incomplete and firing the assertion.
2013-04-28 21:47:37 +02:00
Vincent van Ravesteijn
88eae06611 Fix FontIterator to not access pos >= par.size()
An iterator is typicall incremented passed the valid data into the 'end'
state. However, if this means that other functions are called with invalid
parameter, we should fix this.

This explains why fontSpan was called with pos==size() while this was not
expected to happen.

This patch reverts partly f5ad0c128a (Jean-Marc Lasgouttes; Get rid of
annoying warning message).
2013-04-28 19:12:16 +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
Kornel Benko
06d72d6ca0 Use doctring as LBUFFER() etc parameters 2013-04-27 21:38:01 +02:00
Kornel Benko
07ca50d905 Strings as parameters to LASSERT should not be translatable.
But empty strings are even worse.
2013-04-27 21:13:32 +02:00
Jean-Marc Lasgouttes
f5ad0c128a Get rid of annoying warning message 2013-04-27 20:01:02 +02:00
Richard Heck
78652c98c8 Remove assertion accidentally added during the audit. 2013-04-26 10:42:45 -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
Juergen Spitzmueller
d288b2d628 Revert "Do not pass thru argument of pass-thru layout literally"
This reverts commit 4564c88469.

The bug is actually elsewhere.
2013-04-08 11:07:02 +02:00
Juergen Spitzmueller
4564c88469 Do not pass thru argument of pass-thru layout literally 2013-04-08 08:26:49 +02:00
Richard Heck
82b8723654 Handle other text ranges in XHTML output. 2013-03-27 13:51:26 -04:00
Richard Heck
3057bce3f2 Fix bug #8587 properly, by using local language for translation. 2013-03-19 11:30:36 -04:00
Richard Heck
9548274f39 I'm not absolutely sure about this, but it seems to me as if we
need the master buffer here, too: in looking up fonts during XHTML
output.

I'm half tempted to pass the master buffer to these routines, though
there are times, I think, when we want the actual buffer: e.g., when
looking up branches.
2013-03-18 18:56:38 -04:00
Richard Heck
6633a93b6d Forgot the crucial piece of the last commit!! 2013-03-12 13:12:45 -04:00
Richard Heck
3f748c79c3 Add a for_search member to OutputParams, and use it to limit what
work we do when calling plaintext() for the purpose of generating
material for the advanced search function.

Here again, not only were we parsing BibTeX files, since Julien's
(sensible) introduction of plaintext output for that inset, but we
were in fact writing (to disk) complete plaintext output for
included files every time we did such a search.
2013-03-12 12:45:15 -04:00
Richard Heck
86994bf753 Add a member to TocItem that tells us whether the item in question
is included in output.
2013-03-08 16:38:18 -05:00
Richard Heck
ecef54500d Introduce max_length parameter for plaintext() output routines,
so we can write a limited amount when using this for TOC and
tooltip output.

This should solve the problem with slowness that Kornel noticed,
which was caused by our trying to write an entire plaintext
bibliography every time we updated the TOC. We did that because
he had a bibliography inside a branch, and we use plaintext for
creating the tooltip that goes with the branch list.

Other related bugs were fixed along the way. E.g., it turns out
that, if someone had an InsetInclude inside a branch, then we would
have been writing a *plaintext file* for that inset every time we
updated the TOC. I wonder if some of the other reports of slowness
we have received might be due to this kind of issue?
2013-03-08 15:12:58 -05: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
Juergen Spitzmueller
37f41fd4b5 Support for command argument placement after the workarea argument 2012-12-28 11:21:24 +01:00
Richard Heck
2e764c2c66 Respect InsetLayout's PassThru setting in XHTML export. 2012-12-24 12:11:51 -05:00
Juergen Spitzmueller
53002538fa Pass local font to arguments and assure pass_thru is inherited 2012-11-28 19:02:07 +01:00
Juergen Spitzmueller
4d1b495139 LaTeXParam and Argument do not necessarily exclude each other 2012-11-26 13:09:54 +01:00
Juergen Spitzmueller
6f086763ae Add LeftDelim and RightDelim to the Style and InsetLayout repertoire 2012-11-25 19:10:16 +01:00