[LyX/master] Fix typo in comment

2017-03-18 Thread Scott Kostyshak
commit 82705a0e8a852a12985b75c4546b3439ad335a1c
Author: Scott Kostyshak 
Date:   Mon Mar 6 22:52:23 2017 -0500

Fix typo in comment
---
 src/FuncRequest.cpp |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/FuncRequest.cpp b/src/FuncRequest.cpp
index a8d8859..224ba27 100644
--- a/src/FuncRequest.cpp
+++ b/src/FuncRequest.cpp
@@ -68,7 +68,7 @@ FuncRequest::FuncRequest(FuncRequest const & cmd, docstring 
const & arg, Origin
 
 namespace {
 
-// Extracts arguments from str into args. Arguments are delimted by
+// Extracts arguments from str into args. Arguments are delimited by
 // whitespace or by double quotes.
 // We extract at most max + 1 arguments, treating args[max] as
 // continuing to eol.


[LyX/master] Use "Prename Surname" format for basic numeric styles.

2017-03-18 Thread Juergen Spitzmueller
commit be945a0656d3e25139948a886570dd55bf4a606e
Author: Juergen Spitzmueller 
Date:   Sat Mar 18 15:35:45 2017 +0100

Use "Prename Surname" format for basic numeric styles.
---
 lib/citeengines/basic.citeengine |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/lib/citeengines/basic.citeengine b/lib/citeengines/basic.citeengine
index 278c3a4..a37a2b7 100644
--- a/lib/citeengines/basic.citeengine
+++ b/lib/citeengines/basic.citeengine
@@ -59,6 +59,10 @@ CiteFormat default
!open [
!sep ,
!close ]
+   # Modify scheme of the first author in the bibliography
+   !firstnameform %prename% %surname%
+   # Modify scheme of other authors in the bibliography
+   !othernameform %prename% %surname%
 
# A link that lets us jump to the bibliography entry in LyXHTML
# %clean:key% will be substituted by the cite key to give a unique id


[LyX/master] Clean up

2017-03-18 Thread Guillaume Munch
commit 340d747fff92fc98907a0285ce22b6c500276505
Author: Guillaume Munch 
Date:   Sat Mar 18 15:08:20 2017 +0100

Clean up

Only keep one dynamic-cast. This fixes coverity warnings.
---
 src/frontends/qt4/GuiView.cpp |1 -
 src/frontends/qt4/GuiWorkArea.cpp |   41 +++--
 src/frontends/qt4/GuiWorkArea.h   |   22 ++-
 3 files changed, 37 insertions(+), 27 deletions(-)

diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index fe2646a..625a424 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -3735,7 +3735,6 @@ void GuiView::dispatch(FuncRequest const & cmd, 
DispatchResult & dr)
if (!doc_buffer->isClean()) {
docstring const file =

makeDisplayPath(doc_buffer->absFileName(), 20);
-   doc_buffer->notifiesExternalModification();
docstring text = 
doc_buffer->notifiesExternalModification() ?
  _("Any changes will be lost. "
"Are you sure you want to load the 
version on disk "
diff --git a/src/frontends/qt4/GuiWorkArea.cpp 
b/src/frontends/qt4/GuiWorkArea.cpp
index 67d9494..b87bb48 100644
--- a/src/frontends/qt4/GuiWorkArea.cpp
+++ b/src/frontends/qt4/GuiWorkArea.cpp
@@ -1683,35 +1683,41 @@ void TabWorkArea::showBar(bool show)
 }
 
 
-GuiWorkArea * TabWorkArea::currentWorkArea()
+GuiWorkAreaContainer * TabWorkArea::widget(int index) const
 {
-   if (count() == 0)
-   return 0;
-
-   GuiWorkAreaContainer * wac =
-   dynamic_cast(currentWidget());
+   QWidget * w = QTabWidget::widget(index);
+   if (!w)
+   return nullptr;
+   GuiWorkAreaContainer * wac = dynamic_cast(w);
LATTEST(wac);
-   GuiWorkArea * wa = wac->workArea();
-   LATTEST(wa);
-   return wa;
+   return wac;
+}
+
+
+GuiWorkAreaContainer * TabWorkArea::currentWidget() const
+{
+   return widget(currentIndex());
 }
 
 
-GuiWorkArea const * TabWorkArea::workArea(int index) const
+GuiWorkArea * TabWorkArea::workArea(int index) const
 {
-   return (dynamic_cast(widget(index)))->workArea();
+   GuiWorkAreaContainer * w = widget(index);
+   if (!w)
+   return nullptr;
+   return w->workArea();
 }
 
 
-GuiWorkArea * TabWorkArea::workArea(int index)
+GuiWorkArea * TabWorkArea::currentWorkArea() const
 {
-   return (dynamic_cast(widget(index)))->workArea();
+   return workArea(currentIndex());
 }
 
 
-GuiWorkArea * TabWorkArea::workArea(Buffer & buffer)
+GuiWorkArea * TabWorkArea::workArea(Buffer & buffer) const
 {
-   // FIXME: this method doesn't work if we have more than work area
+   // FIXME: this method doesn't work if we have more than one work area
// showing the same buffer.
for (int i = 0; i != count(); ++i) {
GuiWorkArea * wa = workArea(i);
@@ -2220,9 +2226,6 @@ GuiWorkAreaContainer::GuiWorkAreaContainer(GuiWorkArea * 
wa, QWidget * parent)
 
 void GuiWorkAreaContainer::updateDisplay()
 {
-   if (!wa_)
-   notificationFrame->hide();
-
Buffer const & buf = wa_->bufferView().buffer();
notificationFrame->setHidden(!buf.notifiesExternalModification());
QString const label = QString("The file \"%1\" changed on disk.")
@@ -2233,8 +2236,6 @@ void GuiWorkAreaContainer::updateDisplay()
 
 void GuiWorkAreaContainer::dispatch(FuncRequest f) const
 {
-   if (!wa_)
-   return;
lyx::dispatch(FuncRequest(LFUN_BUFFER_SWITCH,
  wa_->bufferView().buffer().absFileName()));
lyx::dispatch(f);
diff --git a/src/frontends/qt4/GuiWorkArea.h b/src/frontends/qt4/GuiWorkArea.h
index aa407e1..b22d2a5 100644
--- a/src/frontends/qt4/GuiWorkArea.h
+++ b/src/frontends/qt4/GuiWorkArea.h
@@ -193,6 +193,8 @@ private:
 }; // EmbeddedWorkArea
 
 
+class GuiWorkAreaContainer;
+
 /// A tabbed set of GuiWorkAreas.
 class TabWorkArea : public QTabWidget
 {
@@ -200,6 +202,10 @@ class TabWorkArea : public QTabWidget
 public:
TabWorkArea(QWidget * parent = 0);
 
+   /// hide QTabWidget methods
+   GuiWorkAreaContainer * currentWidget() const;
+   GuiWorkAreaContainer * widget(int index) const;
+
///
void setFullScreen(bool full_screen);
void showBar(bool show);
@@ -207,10 +213,9 @@ public:
bool setCurrentWorkArea(GuiWorkArea *);
GuiWorkArea * addWorkArea(Buffer & buffer, GuiView & view);
bool removeWorkArea(GuiWorkArea *);
-   GuiWorkArea * currentWorkArea();
-   GuiWorkArea * workArea(Buffer & buffer);
-   GuiWorkArea const * workArea(int index) const;
-   GuiWorkArea * workArea(int index);
+   GuiWorkArea * currentWorkArea() const;
+   GuiWorkArea * workArea(Buffer & 

[LyX/master] Input stdciteformats to the cite engines directly

2017-03-18 Thread Juergen Spitzmueller
commit 5b713494506d4212709d4c88c94be1a0b1e4f794
Author: Juergen Spitzmueller 
Date:   Sat Mar 18 11:26:23 2017 +0100

Input stdciteformats to the cite engines directly

not to individual layouts.

Possibly fixes #10582
---
 lib/citeengines/basic.citeengine   |3 +++
 lib/citeengines/biblatex-natbib.citeengine |4 
 lib/citeengines/biblatex.citeengine|4 
 lib/citeengines/jurabib.citeengine |4 
 lib/citeengines/natbib.citeengine  |4 
 lib/layouts/paper.layout   |1 -
 lib/layouts/stdciteformats.inc |   10 +-
 lib/layouts/stdclass.inc   |1 -
 8 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/lib/citeengines/basic.citeengine b/lib/citeengines/basic.citeengine
index 2163641..278c3a4 100644
--- a/lib/citeengines/basic.citeengine
+++ b/lib/citeengines/basic.citeengine
@@ -34,6 +34,9 @@ End
 # CITE FORMAT
 #
 
+# Input standard format definitions for the bibliography
+Input stdciteformats.inc
+
 # The following defines how the commands are represented in the GUI
 # (inset button and citation dialog) as well as in XHTML, docbook and
 # plain text output.
diff --git a/lib/citeengines/biblatex-natbib.citeengine 
b/lib/citeengines/biblatex-natbib.citeengine
index 25b76f6..842b05b 100644
--- a/lib/citeengines/biblatex-natbib.citeengine
+++ b/lib/citeengines/biblatex-natbib.citeengine
@@ -123,6 +123,10 @@ End
 # There are common definitions (default) and specific definitions for
 # either cite engine type (which overwrite existing defaults.
 #
+
+# Input standard format definitions for the bibliography
+Input stdciteformats.inc
+
 CiteFormat default
#
# MACROS
diff --git a/lib/citeengines/biblatex.citeengine 
b/lib/citeengines/biblatex.citeengine
index c58e2be..2b2edb6 100644
--- a/lib/citeengines/biblatex.citeengine
+++ b/lib/citeengines/biblatex.citeengine
@@ -114,6 +114,10 @@ End
 # There are common definitions (default) and specific definitions for
 # either cite engine type (which overwrite existing defaults.
 #
+
+# Input standard format definitions for the bibliography
+Input stdciteformats.inc
+
 CiteFormat default
#
# MACROS
diff --git a/lib/citeengines/jurabib.citeengine 
b/lib/citeengines/jurabib.citeengine
index 0cf07b9..91a4e0b 100644
--- a/lib/citeengines/jurabib.citeengine
+++ b/lib/citeengines/jurabib.citeengine
@@ -106,6 +106,10 @@ End
 # (inset button and citation dialog) as well as in XHTML, docbook and
 # plain text output.
 #
+
+# Input standard format definitions for the bibliography
+Input stdciteformats.inc
+
 CiteFormat authoryear
#
# MACROS
diff --git a/lib/citeengines/natbib.citeengine 
b/lib/citeengines/natbib.citeengine
index 49b8413..1472706 100644
--- a/lib/citeengines/natbib.citeengine
+++ b/lib/citeengines/natbib.citeengine
@@ -104,6 +104,10 @@ End
 # There are common definitions (default) and specific definitions for
 # either cite engine type (which overwrite existing defaults.
 #
+
+# Input standard format definitions for the bibliography
+Input stdciteformats.inc
+
 CiteFormat default
#
# MACROS
diff --git a/lib/layouts/paper.layout b/lib/layouts/paper.layout
index c593d0b..61ba81c 100644
--- a/lib/layouts/paper.layout
+++ b/lib/layouts/paper.layout
@@ -35,7 +35,6 @@ Input stdlayouts.inc
 Input stdfloats.inc
 Input stdlists.inc
 Input stdcounters.inc
-Input stdciteformats.inc
 
 ## All the section headings now use sans serif
 Input stdsections.inc
diff --git a/lib/layouts/stdciteformats.inc b/lib/layouts/stdciteformats.inc
index d8506c0..9657375 100644
--- a/lib/layouts/stdciteformats.inc
+++ b/lib/layouts/stdciteformats.inc
@@ -1,4 +1,12 @@
-# Standard formats for citations.
+# Standard formats for bibliography entries.
+#
+# This defines how LyX displays bibliographic information in the GUI
+# as well as in text/xhtml output. The format of citation references
+# is defined in the *.citeengines files, which might override the
+# default formatting defined here.
+#
+# This file is included by the citation engines, so there is no need
+# to include it in individual classes.
 #
 # Author: Richard Heck 
 # Jürgen Spitzmüller 
diff --git a/lib/layouts/stdclass.inc b/lib/layouts/stdclass.inc
index 7b76b2b..a942aa9 100644
--- a/lib/layouts/stdclass.inc
+++ b/lib/layouts/stdclass.inc
@@ -55,4 +55,3 @@ Input stdtitle.inc
 Input stdstruct.inc
 Input lyxmacros.inc
 Input stdlayouts.inc
-Input stdciteformats.inc