[LyX/master] Fix bug #10153: There's a mechanism in XHTML output that defers the output of tags until we know they're needed. In the case of HTML tables, empty cells should of course be output, so we

2016-06-20 Thread Richard Heck
commit 35d449c5dae11bbff53e2a35697a4fc3f03318ba
Author: Richard Heck 
Date:   Mon Jun 20 10:21:22 2016 -0400

Fix bug #10153: There's a mechanism in XHTML output that defers the
output of tags until we know they're needed. In the case of HTML
tables, empty cells should of course be output, so we need to force
the tags to be output.

diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index b5344df..7ad8663 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -3018,7 +3018,7 @@ docstring Tabular::xhtmlRow(XHTMLStream & xs, row_type 
row,
else if (isMultiRow(cell))
attr << " rowspan='" << rowSpan(cell) << "'";
 
-   xs << html::StartTag(celltag, attr.str()) << html::CR();
+   xs << html::StartTag(celltag, attr.str(), true) << html::CR();
ret += cellInset(cell)->xhtml(xs, runparams);
xs << html::EndTag(celltag) << html::CR();
++cell;


[LyX/2.2.x] Fix bug #10153: There's a mechanism in XHTML output that defers the output of tags until we know they're needed. In the case of HTML tables, empty cells should of course be output, so we n

2016-06-20 Thread Richard Heck
commit 8731689d41a96bc6bc954781388b56acc9b1619a
Author: Richard Heck 
Date:   Mon Jun 20 10:21:22 2016 -0400

Fix bug #10153: There's a mechanism in XHTML output that defers the
output of tags until we know they're needed. In the case of HTML
tables, empty cells should of course be output, so we need to force
the tags to be output.

(cherry picked from commit 35d449c5dae11bbff53e2a35697a4fc3f03318ba)

diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index ac63676..3c7f2c2 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -3019,7 +3019,7 @@ docstring Tabular::xhtmlRow(XHTMLStream & xs, row_type 
row,
else if (isMultiRow(cell))
attr << " rowspan='" << rowSpan(cell) << "'";
 
-   xs << html::StartTag(celltag, attr.str()) << html::CR();
+   xs << html::StartTag(celltag, attr.str(), true) << html::CR();
ret += cellInset(cell)->xhtml(xs, runparams);
xs << html::EndTag(celltag) << html::CR();
++cell;
diff --git a/status.22x b/status.22x
index c3eb7d7..90ed5f1 100644
--- a/status.22x
+++ b/status.22x
@@ -69,6 +69,8 @@ What's new
 - Resolve problem on Windows with importing files from directories with
   accented characters on FAT drives (bug 10218).
 
+- Make sure we output all XHTML table cells, even the empty ones (bug 10153).
+
 
 * LYX2LYX
 


[LyX/master] Add new module:

2016-06-20 Thread Richard Heck
commit a9af5333b26d719d0b85dae2c374e32e1190e15d
Author: Richard Heck 
Date:   Mon Jun 20 11:06:31 2016 -0400

Add new module:

Provides two new styles:

1. An "In Premable" style that puts whatever is entered into it into the 
preamble.
   This can be used, if one wishes, to include preamble code in the body of 
the
   LyX document.
2. An "In Title" style that will put its contents into the body of the LaTeX
   document, but before \maketitle is issued. This is useful for making 
branches
   and notes in title-related material. (If you put these in a Standard 
layout,
   this signals to LyX to output \maketitle, which may then come too early.)

Due to the ForceLocal machinery, no format change is needed.

diff --git a/lib/layouts/InStar.module b/lib/layouts/InStar.module
new file mode 100644
index 000..07065d3
--- /dev/null
+++ b/lib/layouts/InStar.module
@@ -0,0 +1,28 @@
+#\DeclareLyXModule{Title and Preamble Hacks}
+#DescriptionBegin
+#Provides two new styles:
+#1. An "In Premable" style that puts whatever is entered into it into the 
preamble.
+#   This can be used, if one wishes, to include preamble code in the body of 
the
+#   LyX document.
+#2. An "In Title" style that will put its contents into the body of the LaTeX 
+#   document, but before \maketitle is issued. This is useful for making 
branches
+#   and notes in title-related material. (If you put these in a Standard 
layout,
+#   this signals to LyX to output \maketitle, which may then come too early.)
+#DescriptionEnd
+#Author: Richard Heck 
+
+Format 60
+
+Style "In Preamble"
+   CopyStyle Standard
+   Category FrontMatter
+   InPreamble 1
+   ForceLocal -1
+End
+
+Style "In Title"
+   CopyStyle Standard
+   Category FrontMatter
+   InTitle 1
+   ForceLocal -1
+End


[LyX/2.2.x] Add new module:

2016-06-20 Thread Richard Heck
commit bf06e9338e41fc7d42e572ceafa0e608cfb64f5b
Author: Richard Heck 
Date:   Mon Jun 20 11:06:31 2016 -0400

Add new module:

Provides two new styles:

1. An "In Premable" style that puts whatever is entered into it into the 
preamble.
   This can be used, if one wishes, to include preamble code in the body of 
the
   LyX document.
2. An "In Title" style that will put its contents into the body of the LaTeX
   document, but before \maketitle is issued. This is useful for making 
branches
   and notes in title-related material. (If you put these in a Standard 
layout,
   this signals to LyX to output \maketitle, which may then come too early.)

The ForceLocal machinery allows the module to be added to stable.

(cherry picked from commit a9af5333b26d719d0b85dae2c374e32e1190e15d)

diff --git a/lib/layouts/InStar.module b/lib/layouts/InStar.module
new file mode 100644
index 000..a735cd0
--- /dev/null
+++ b/lib/layouts/InStar.module
@@ -0,0 +1,28 @@
+#\DeclareLyXModule{Title and Preamble Hacks}
+#DescriptionBegin
+#Provides two new styles:
+#1. An "In Premable" style that puts whatever is entered into it into the 
preamble.
+#   This can be used, if one wishes, to include preamble code in the body of 
the
+#   LyX document.
+#2. An "In Title" style that will put its contents into the body of the LaTeX 
+#   document, but before \maketitle is issued. This is useful for making 
branches
+#   and notes in title-related material. (If you put these in a Standard 
layout,
+#   this signals to LyX to output \maketitle, which may then come too early.)
+#DescriptionEnd
+#Author: Richard Heck 
+
+Format 60
+
+Style "In Preamble"
+   CopyStyle Standard
+   Category FrontMatter
+   InPreamble 1
+   ForceLocal 1
+End
+
+Style "In Title"
+   CopyStyle Standard
+   Category FrontMatter
+   InTitle 1
+   ForceLocal 1
+End
diff --git a/status.22x b/status.22x
index 90ed5f1..383c6b2 100644
--- a/status.22x
+++ b/status.22x
@@ -25,6 +25,8 @@ What's new
 - Syntax highlighting in the preamble and and the source view has been made
   compatible with dark themes (#8325)
 
+- Added a new module "Title and Preamble Hacks".
+
 
 * DOCUMENTATION AND LOCALIZATION
 
@@ -47,10 +49,6 @@ What's new
   cross-reference dialog.
 
 
-* DOCUMENTATION AND LOCALIZATION
-
-
-
 * BUILD/INSTALLATION
 
 


[LyX/2.2.x] Skip paragraph parameters for dash conversion

2016-06-20 Thread Georg Baum
commit 380475f4dbcf1c22f3b411145c5446e16f60
Author: Georg Baum 
Date:   Mon Jun 20 20:19:24 2016 +0200

Skip paragraph parameters for dash conversion

Some of them are directly passed to LaTeX, but for all of them a token
\twohyphens or \threehyphens is not valid. This fixes bug #10243.

diff --git a/lib/lyx2lyx/lyx_2_2.py b/lib/lyx2lyx/lyx_2_2.py
index d969179..6567eb4 100644
--- a/lib/lyx2lyx/lyx_2_2.py
+++ b/lib/lyx2lyx/lyx_2_2.py
@@ -632,6 +632,10 @@ def convert_dashes(document):
 else:
 i = j
 continue
+if len(words) > 0 and words[0] in ["\\leftindent", 
"\\paragraph_spacing", "\\align", "\\labelwidthstring"]:
+# skip paragraph parameters (bug 10243)
+i += 1
+continue
 while True:
 j = document.body[i].find("--")
 if j == -1:
diff --git a/status.22x b/status.22x
index 383c6b2..5054193 100644
--- a/status.22x
+++ b/status.22x
@@ -72,6 +72,8 @@ What's new
 
 * LYX2LYX
 
+- Fix paragraph argument conversion for \labelwidthstring etc (bug 10243).
+
 
 
 * USER INTERFACE


[LyX/master] const correctness

2016-06-20 Thread Georg Baum
commit a4b8094aac6d8b8ad498c02b4f762ee727c43144
Author: Georg Baum 
Date:   Mon Jun 20 22:00:05 2016 +0200

const correctness

It is dangerous to hand out non-const pointers to members from a const 
method.

diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index 7ad8663..54b4158 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -525,7 +525,7 @@ string const featureAsString(Tabular::Feature action)
 }
 
 
-DocIterator separatorPos(InsetTableCell * cell, docstring const & align_d)
+DocIterator separatorPos(InsetTableCell const * cell, docstring const & 
align_d)
 {
DocIterator dit = doc_iterator_begin(&(cell->buffer()), cell);
for (; dit; dit.forwardChar())
@@ -2308,7 +2308,7 @@ void Tabular::TeXCellPreamble(otexstream & os, idx_type 
cell,
// we center in multicol when no decimal point
if (column_info[c].alignment == LYX_ALIGN_DECIMAL) {
docstring const align_d = column_info[c].decimal_point;
-   DocIterator const dit = separatorPos(cellInset(cell).get(), 
align_d);
+   DocIterator const dit = separatorPos(cellInset(cell), align_d);
ismulticol |= !dit;
}
 
@@ -2533,7 +2533,7 @@ void Tabular::TeXRow(otexstream & os, row_type row,
 OutputParams const & runparams) const
 {
idx_type cell = cellIndex(row, 0);
-   shared_ptr inset = cellInset(cell);
+   InsetTableCell const * inset = cellInset(cell);
Paragraph const & par = inset->paragraphs().front();
string const lang = par.getParLanguage(buffer().params())->lang();
 
@@ -2572,7 +2572,7 @@ void Tabular::TeXRow(otexstream & os, row_type row,
}
 
TeXCellPreamble(os, cell, ismulticol, ismultirow);
-   shared_ptr inset = cellInset(cell);
+   InsetTableCell const * inset = cellInset(cell);
 
Paragraph const & par = inset->paragraphs().front();
 
@@ -3321,21 +3321,26 @@ void Tabular::plaintext(odocstringstream & os,
 }
 
 
-shared_ptr Tabular::cellInset(idx_type cell) const
+shared_ptr Tabular::cellInset(idx_type cell)
 {
return cell_info[cellRow(cell)][cellColumn(cell)].inset;
 }
 
 
-shared_ptr Tabular::cellInset(row_type row,
-  col_type column) const
+shared_ptr Tabular::cellInset(row_type row, col_type column)
 {
return cell_info[row][column].inset;
 }
 
 
+InsetTableCell const * Tabular::cellInset(idx_type cell) const
+{
+   return cell_info[cellRow(cell)][cellColumn(cell)].inset.get();
+}
+
+
 void Tabular::setCellInset(row_type row, col_type column,
- shared_ptr ins) const
+   shared_ptr ins)
 {
CellData & cd = cell_info[row][column];
cd.inset = ins;
diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h
index b23fc85..ee5cffc 100644
--- a/src/insets/InsetTabular.h
+++ b/src/insets/InsetTabular.h
@@ -612,13 +612,13 @@ public:
/// returns the VISIBLE cell at r,c, which may be the same as the
/// cell at the previous row or column, if we're dealing with some
/// multirow or multicell.
-   shared_ptr cellInset(idx_type cell) const;
-   shared_ptr cellInset(row_type row,
- col_type column) const;
+   shared_ptr cellInset(idx_type cell);
+   shared_ptr cellInset(row_type row, col_type column);
+   InsetTableCell const * cellInset(idx_type cell) const;
//@}
///
void setCellInset(row_type row, col_type column,
- shared_ptr) const;
+ shared_ptr);
/// Search for \param inset in the tabular, with the
///
void validate(LaTeXFeatures &) const;


[LyX/2.2.x] Fix bug #10195

2016-06-20 Thread Guillaume Munch
commit 41f7f1d237c5f0ffa05c9ef52e21bab671ae57dd
Author: Guillaume Munch 
Date:   Tue Jun 14 00:17:38 2016 +0100

Fix bug #10195

The computation of the index of the main text entry of a row did not take 
into
account the fact that the entry could be optimised away.

(cherry picked from commit 947c34364c7f6a5c12ddfa7286ff504c62a1038a)

diff --git a/src/TexRow.cpp b/src/TexRow.cpp
index 8586a81..400daf3 100644
--- a/src/TexRow.cpp
+++ b/src/TexRow.cpp
@@ -35,8 +35,11 @@ bool TexRow::RowEntryList::addEntry(RowEntry const & entry)
if (!entry.is_math) {
if (text_entry_ < size())
return false;
-   else
+   else {
text_entry_ = size();
+   push_back(entry);
+   return true;
+   }
}
forceAddEntry(entry);
return true;