Just to follow up the qt series. There shouldn't be anything strange in here either. But please have a quick glance at it.
Index: controllers/ButtonController.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ButtonController.h,v retrieving revision 1.19 diff -u -p -r1.19 ButtonController.h --- controllers/ButtonController.h 5 Sep 2002 15:14:20 -0000 1.19 +++ controllers/ButtonController.h 20 Oct 2002 22:01:38 -0000 @@ -5,7 +5,7 @@ * Licence details can be found in the file COPYING. * * \author Allan Rae - * \author Angus Leeming + * \author Angus Leeming * \author Baruch Even * * Full author contact details are available in file CREDITS @@ -25,8 +25,7 @@ * be #included in the gui-frontend BC class, see e.g. xforms/xformsBC.C */ template <class Button, class Widget> -class GuiBC : public ButtonControllerBase -{ +class GuiBC : public ButtonControllerBase { public: /// GuiBC(string const & cancel, string const & close); @@ -48,7 +47,6 @@ public: void refresh(); /// Refresh the status of any widgets in the read_only list void refreshReadOnly(); - private: /// Enable/Disable a widget virtual void setWidgetEnabled(Widget * obj, bool enable) = 0; @@ -68,8 +66,7 @@ private: template <class BP, class GUIBC> -class ButtonController: public GUIBC -{ +class ButtonController: public GUIBC { public: /// ButtonController(string const & = _("Cancel"), @@ -78,7 +75,6 @@ public: ~ButtonController() {} /// virtual ButtonPolicy & bp() { return bp_; } - protected: /// BP bp_; Index: controllers/ButtonControllerBase.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ButtonControllerBase.C,v retrieving revision 1.9 diff -u -p -r1.9 ButtonControllerBase.C --- controllers/ButtonControllerBase.C 5 Sep 2002 15:14:20 -0000 1.9 +++ controllers/ButtonControllerBase.C 20 Oct 2002 22:01:38 -0000 @@ -32,7 +32,8 @@ void ButtonControllerBase::ok() void ButtonControllerBase::input(ButtonPolicy::SMInput in) { - if (ButtonPolicy::SMI_NOOP == in) return; + if (ButtonPolicy::SMI_NOOP == in) + return; bp().input(in); refresh(); } Index: controllers/ButtonControllerBase.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ButtonControllerBase.h,v retrieving revision 1.9 diff -u -p -r1.9 ButtonControllerBase.h --- controllers/ButtonControllerBase.h 5 Sep 2002 15:14:20 -0000 1.9 +++ controllers/ButtonControllerBase.h 20 Oct 2002 22:01:38 -0000 @@ -29,8 +29,7 @@ * This abstract base class stripped of xforms-specific code by * Angus Leeming <[EMAIL PROTECTED]> */ -class ButtonControllerBase : boost::noncopyable -{ +class ButtonControllerBase : boost::noncopyable { public: /** Constructor. The cancel/close label entries are _not_ managed within the class @@ -70,7 +69,6 @@ public: void valid(bool = true); /// void invalid(); - protected: /// string cancel_label_; Index: controllers/ButtonPolicies.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ButtonPolicies.h,v retrieving revision 1.10 diff -u -p -r1.10 ButtonPolicies.h --- controllers/ButtonPolicies.h 5 Sep 2002 15:14:20 -0000 1.10 +++ controllers/ButtonPolicies.h 20 Oct 2002 22:01:38 -0000 @@ -270,8 +270,7 @@ private: This is based on the value of the bool state of the Button::CANCEL. true == Cancel, false == Close */ -class NoRepeatedApplyReadOnlyPolicy : public ButtonPolicy -{ +class NoRepeatedApplyReadOnlyPolicy : public ButtonPolicy { public: /// NoRepeatedApplyReadOnlyPolicy(); Index: controllers/ControlAboutlyx.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlAboutlyx.C,v retrieving revision 1.11 diff -u -p -r1.11 ControlAboutlyx.C --- controllers/ControlAboutlyx.C 5 Sep 2002 15:14:20 -0000 1.11 +++ controllers/ControlAboutlyx.C 20 Oct 2002 22:01:38 -0000 @@ -10,17 +10,20 @@ */ #include <config.h> -#include <fstream> #ifdef __GNUG__ #pragma implementation #endif #include "ControlAboutlyx.h" -#include "Lsstream.h" #include "gettext.h" #include "support/filetools.h" // FileSearch #include "version.h" +#include "Lsstream.h" + +#include <fstream> + +using std::ostream; // needed for the browser extern string system_lyxdir; @@ -32,7 +35,7 @@ ControlAboutlyx::ControlAboutlyx(LyXView {} -stringstream & ControlAboutlyx::getCredits(stringstream & ss) const +void ControlAboutlyx::getCredits(ostream & ss) const { string const name = FileSearch(system_lyxdir, "CREDITS"); @@ -40,6 +43,7 @@ stringstream & ControlAboutlyx::getCredi if (found) { std::ifstream in(name.c_str()); +#if 0 found = (in.get()); if (found) { @@ -48,6 +52,10 @@ stringstream & ControlAboutlyx::getCredi ss << in.rdbuf(); found = (ss.good()); } +#else + ss << in.rdbuf(); + found = ss.good(); +#endif } if (!found) { @@ -55,8 +63,6 @@ stringstream & ControlAboutlyx::getCredi << _("Please install correctly to estimate the great\n") << _("amount of work other people have done for the LyX project."); } - - return ss; } Index: controllers/ControlAboutlyx.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlAboutlyx.h,v retrieving revision 1.8 diff -u -p -r1.8 ControlAboutlyx.h --- controllers/ControlAboutlyx.h 5 Sep 2002 15:14:20 -0000 1.8 +++ controllers/ControlAboutlyx.h 20 Oct 2002 22:01:38 -0000 @@ -5,7 +5,7 @@ * Licence details can be found in the file COPYING. * * \author Edwin Leuven - * \author Angus Leeming + * \author Angus Leeming * * Full author contact details are available in file CREDITS */ @@ -18,7 +18,6 @@ #endif #include "ControlDialog_impl.h" -#include "Lsstream.h" #include "LString.h" /** A controller for the About LyX dialogs. @@ -29,7 +28,7 @@ public: ControlAboutlyx(LyXView &, Dialogs &); /// - stringstream & getCredits(stringstream &) const; + void getCredits(std::ostream &) const; /// string const getCopyright() const; @@ -42,8 +41,6 @@ public: /// string const getVersion() const; - - private: /// not needed. virtual void apply() {} Index: controllers/ControlBibitem.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlBibitem.h,v retrieving revision 1.13 diff -u -p -r1.13 ControlBibitem.h --- controllers/ControlBibitem.h 5 Sep 2002 15:14:20 -0000 1.13 +++ controllers/ControlBibitem.h 20 Oct 2002 22:01:38 -0000 @@ -25,7 +25,6 @@ class ControlBibitem : public ControlCom public: /// ControlBibitem(LyXView &, Dialogs &); - private: /// Dispatch the changed parameters to the kernel. virtual void applyParamsToInset(); Index: controllers/ControlBibtex.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlBibtex.C,v retrieving revision 1.23 diff -u -p -r1.23 ControlBibtex.C --- controllers/ControlBibtex.C 5 Sep 2002 15:14:20 -0000 1.23 +++ controllers/ControlBibtex.C 20 Oct 2002 22:01:38 -0000 @@ -60,7 +60,8 @@ string const ControlBibtex::Browse(strin string const & title, string const & pattern) { - pair<string, string> dir1(_("Documents|#o#O"), string(lyxrc.document_path)); + pair<string, string> dir1(_("Documents|#o#O"), + string(lyxrc.document_path)); return browseRelFile(&lv_, in_name, buffer()->filePath(), title, pattern, dir1); } Index: controllers/ControlBibtex.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlBibtex.h,v retrieving revision 1.12 diff -u -p -r1.12 ControlBibtex.h --- controllers/ControlBibtex.h 5 Sep 2002 15:14:20 -0000 1.12 +++ controllers/ControlBibtex.h 20 Oct 2002 22:01:38 -0000 @@ -21,8 +21,7 @@ /** A controller for Bibtex dialogs. */ -class ControlBibtex : public ControlCommand -{ +class ControlBibtex : public ControlCommand { public: /// ControlBibtex(LyXView &, Dialogs &); @@ -33,7 +32,6 @@ public: /// build filelists of all availabe bst/cls/sty-files. done through /// kpsewhich and an external script, saved in *Files.lst void rescanBibStyles() const; - private: /// Dispatch the changed parameters to the kernel. virtual void applyParamsToInset(); Index: controllers/ControlButtons.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlButtons.C,v retrieving revision 1.11 diff -u -p -r1.11 ControlButtons.C --- controllers/ControlButtons.C 5 Sep 2002 15:14:20 -0000 1.11 +++ controllers/ControlButtons.C 20 Oct 2002 22:01:39 -0000 @@ -87,4 +87,3 @@ void ControlButtons::setButtonController { bc_ptr_ = &bc; } - Index: controllers/ControlButtons.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlButtons.h,v retrieving revision 1.14 diff -u -p -r1.14 ControlButtons.h --- controllers/ControlButtons.h 5 Sep 2002 15:14:20 -0000 1.14 +++ controllers/ControlButtons.h 20 Oct 2002 22:01:39 -0000 @@ -37,8 +37,7 @@ class ButtonControllerBase; /** Abstract base class for Controllers with a ButtonController. */ -class ControlButtons : boost::noncopyable -{ +class ControlButtons : boost::noncopyable { public: /// ControlButtons(); @@ -67,7 +66,6 @@ public: void setView(ViewBase &); /// void setButtonController(ButtonControllerBase &); - protected: /// ViewBase & view(); @@ -86,7 +84,6 @@ protected: /** This flag can be set by one of the miriad the controller methods to ensure that the dialog is shut down. */ bool emergency_exit_; - private: /// bool is_closing_; Index: controllers/ControlCharacter.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlCharacter.h,v retrieving revision 1.11 diff -u -p -r1.11 ControlCharacter.h --- controllers/ControlCharacter.h 5 Sep 2002 15:14:20 -0000 1.11 +++ controllers/ControlCharacter.h 20 Oct 2002 22:01:39 -0000 @@ -23,8 +23,7 @@ /** A controller for Character dialogs. */ -class ControlCharacter : public ControlDialogBD -{ +class ControlCharacter : public ControlDialogBD { public: /// ControlCharacter(LyXView &, Dialogs &); Index: controllers/ControlCitation.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlCitation.C,v retrieving revision 1.26 diff -u -p -r1.26 ControlCitation.C --- controllers/ControlCitation.C 5 Sep 2002 15:14:20 -0000 1.26 +++ controllers/ControlCitation.C 20 Oct 2002 22:01:39 -0000 @@ -20,6 +20,7 @@ using std::vector; using std::pair; + vector<biblio::CiteStyle> ControlCitation::citeStyles_; @@ -40,7 +41,8 @@ void ControlCitation::setDaughterParams( typedef std::map<string, string>::value_type InfoMapValue; - for (vector<pair<string,string> >::size_type i=0; i<blist.size(); ++i) { + for (vector<pair<string,string> >::size_type i = 0; + i < blist.size(); ++i) { bibkeysInfo_.insert(InfoMapValue(blist[i].first, blist[i].second)); } Index: controllers/ControlCitation.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlCitation.h,v retrieving revision 1.15 diff -u -p -r1.15 ControlCitation.h --- controllers/ControlCitation.h 5 Sep 2002 15:14:20 -0000 1.15 +++ controllers/ControlCitation.h 20 Oct 2002 22:01:39 -0000 @@ -21,8 +21,7 @@ /** A controller for Citation dialogs. */ -class ControlCitation : public ControlCommand -{ +class ControlCitation : public ControlCommand { public: /// ControlCitation(LyXView &, Dialogs &); @@ -36,9 +35,9 @@ public: std::vector<string> const getCiteStrings(string const & key) const; /// available CiteStyle-s (depends on availability of Natbib - static std::vector<biblio::CiteStyle> const & getCiteStyles() - { return citeStyles_; } - + static std::vector<biblio::CiteStyle> const & getCiteStyles() { + return citeStyles_; + } private: /// create the InfoMap of keys and data virtual void setDaughterParams(); Index: controllers/ControlCommand.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlCommand.h,v retrieving revision 1.10 diff -u -p -r1.10 ControlCommand.h --- controllers/ControlCommand.h 5 Sep 2002 15:14:20 -0000 1.10 +++ controllers/ControlCommand.h 20 Oct 2002 22:01:39 -0000 @@ -31,12 +31,12 @@ /** The Inset dialog controller. Connects/disconnects signals, launches GUI-dependent View and returns the output from this View to the kernel. */ -class ControlCommand : public ControlInset<InsetCommand, InsetCommandParams> +class ControlCommand + : public ControlInset<InsetCommand, InsetCommandParams> { public: /// ControlCommand(LyXView &, Dialogs &, kb_action=LFUN_NOACTION); - private: /// Dispatch the changed parameters to the kernel. virtual void applyParamsToInset(); Index: controllers/ControlCommandBuffer.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlCommandBuffer.C,v retrieving revision 1.6 diff -u -p -r1.6 ControlCommandBuffer.C --- controllers/ControlCommandBuffer.C 5 Sep 2002 15:14:20 -0000 1.6 +++ controllers/ControlCommandBuffer.C 20 Oct 2002 22:01:39 -0000 @@ -5,7 +5,7 @@ * * \author Lars * \author Asger and Juergen - * \author John Levon + * \author John Levon * * Full author contact details are available in file CREDITS */ @@ -27,37 +27,37 @@ using std::vector; using std::back_inserter; using std::transform; using std::endl; - + namespace { - + struct prefix_p { string p; - prefix_p(string const & s) + prefix_p(string const & s) : p(s) {} bool operator()(string const & s) const { return prefixIs(s, p); } }; - + } // end of anon namespace - + ControlCommandBuffer::ControlCommandBuffer(LyXFunc & lf) : lyxfunc_(lf), history_pos_(history_.end()) { transform(lyxaction.func_begin(), lyxaction.func_end(), - back_inserter(commands_), lyx::firster()); + back_inserter(commands_), lyx::firster()); } - - + + string const ControlCommandBuffer::historyUp() { if (history_pos_ == history_.begin()) - return ""; + return string(); return *(--history_pos_); } - + string const ControlCommandBuffer::historyDown() { @@ -70,7 +70,8 @@ string const ControlCommandBuffer::histo } -vector<string> const ControlCommandBuffer::completions(string const & prefix, string & new_prefix) +vector<string> const +ControlCommandBuffer::completions(string const & prefix, string & new_prefix) { vector<string> comp; @@ -102,17 +103,17 @@ vector<string> const ControlCommandBuffe } test += tmp[test.length()]; } - + new_prefix = test; return comp; } - + void ControlCommandBuffer::dispatch(string const & str) { if (str.empty()) return; - + history_.push_back(str); history_pos_ = history_.end(); lyxfunc_.dispatch(str, true); Index: controllers/ControlCommandBuffer.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlCommandBuffer.h,v retrieving revision 1.4 diff -u -p -r1.4 ControlCommandBuffer.h --- controllers/ControlCommandBuffer.h 5 Sep 2002 15:14:20 -0000 1.4 +++ controllers/ControlCommandBuffer.h 20 Oct 2002 22:01:39 -0000 @@ -6,7 +6,7 @@ * * \author Lars * \author Asger and Juergen - * \author John Levon + * \author John Levon * * Full author contact details are available in file CREDITS */ @@ -28,12 +28,12 @@ class LyXFunc; * ControlCommandBuffer * * This provides methods for the use of a toolkit's - * minibuffer/command buffer + * minibuffer/command buffer */ class ControlCommandBuffer { public: ControlCommandBuffer(LyXFunc & lf); - + /// return the previous history entry if any string const historyUp(); @@ -41,23 +41,23 @@ public: string const historyDown(); /// return the possible completions - std::vector<string> const completions(string const & prefix, string & new_prefix); - + std::vector<string> const completions(string const & prefix, + string & new_prefix); + /// dispatch a command void dispatch(string const & str); - private: /// controlling lyxfunc LyXFunc & lyxfunc_; - + /// available command names std::vector<string> commands_; - + /// command history std::vector<string> history_; /// current position in command history std::vector<string>::const_iterator history_pos_; }; - + #endif // CONTROLCOMMANDBUFFER_H Index: controllers/ControlConnections.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlConnections.C,v retrieving revision 1.20 diff -u -p -r1.20 ControlConnections.C --- controllers/ControlConnections.C 5 Sep 2002 15:14:20 -0000 1.20 +++ controllers/ControlConnections.C 20 Oct 2002 22:01:39 -0000 @@ -26,6 +26,7 @@ #include <boost/bind.hpp> + ControlConnectBase::ControlConnectBase(LyXView & lv, Dialogs & d) : lv_(lv), d_(d) {} Index: controllers/ControlConnections.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlConnections.h,v retrieving revision 1.18 diff -u -p -r1.18 ControlConnections.h --- controllers/ControlConnections.h 24 Sep 2002 12:43:01 -0000 1.18 +++ controllers/ControlConnections.h 20 Oct 2002 22:01:39 -0000 @@ -46,8 +46,7 @@ class LyXFunc; kernel. It is meant to be used solely as the parent class to ControlConnectBI and ControlConnectBD. */ -class ControlConnectBase : public ControlButtons -{ +class ControlConnectBase : public ControlButtons { public: /// enum DocTypes { @@ -66,7 +65,6 @@ public: bool bufferIsReadonly() const; /// DocTypes docType() const; - protected: /// True if the dialog depends on the buffer, else false. virtual bool isBufferDependent() const = 0; @@ -96,7 +94,6 @@ protected: /// LyXFunc const & lyxfunc() const; - /// LyXView & lv_; /// Contains the signals we have to connect to. @@ -114,12 +111,10 @@ protected: an update() function which is also supported by the Restore button. */ -class ControlConnectBI : public ControlConnectBase -{ +class ControlConnectBI : public ControlConnectBase { public: /// ControlConnectBI(LyXView &, Dialogs &); - protected: /// virtual bool isBufferDependent() const { return false; } @@ -131,12 +126,10 @@ protected: /** Base class to control connection/disconnection of signals with the LyX kernel for Buffer Dependent dialogs. */ -class ControlConnectBD : public ControlConnectBase -{ +class ControlConnectBD : public ControlConnectBase { public: /// ControlConnectBD(LyXView &, Dialogs &); - protected: /// virtual bool isBufferDependent() const { return true; } @@ -144,7 +137,6 @@ protected: virtual void connect(); /// Disconnect signals virtual void disconnect(); - private: /** Slot connected to update signal. Bool indicates if a buffer switch took place. Index: controllers/ControlDialog.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlDialog.h,v retrieving revision 1.6 diff -u -p -r1.6 ControlDialog.h --- controllers/ControlDialog.h 5 Sep 2002 15:14:21 -0000 1.6 +++ controllers/ControlDialog.h 20 Oct 2002 22:01:39 -0000 @@ -4,7 +4,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Angus Leeming + * \author Angus Leeming * * Full author contact details are available in file CREDITS * @@ -25,8 +25,7 @@ class Dialogs; The Base class will be either ControlConnectBI or ControlConnectBD. */ template <class Base> -class ControlDialog : public Base -{ +class ControlDialog : public Base { public: /// ControlDialog(LyXView &, Dialogs &); @@ -35,7 +34,6 @@ public: * Publicly accessible so that it can be invoked by the Dialogs class. */ virtual void show(); - protected: /// Hide the dialog. virtual void hide(); @@ -46,7 +44,6 @@ protected: virtual void clearParams() {} /// set the params before show or update virtual void setParams() {} - private: /// is the dialog built ? bool dialog_built_; Index: controllers/ControlDialog_impl.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlDialog_impl.C,v retrieving revision 1.6 diff -u -p -r1.6 ControlDialog_impl.C --- controllers/ControlDialog_impl.C 5 Sep 2002 15:14:21 -0000 1.6 +++ controllers/ControlDialog_impl.C 20 Oct 2002 22:01:39 -0000 @@ -3,7 +3,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Angus Leeming + * \author Angus Leeming * * Full author contact details are available in file CREDITS */ @@ -12,6 +12,7 @@ #include "ControlDialog_impl.h" #include "ControlDialog.tmpl" + ControlDialogBD::ControlDialogBD(LyXView & lv, Dialogs & d) : ControlDialog<ControlConnectBD>(lv, d) Index: controllers/ControlDialog_impl.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlDialog_impl.h,v retrieving revision 1.6 diff -u -p -r1.6 ControlDialog_impl.h --- controllers/ControlDialog_impl.h 5 Sep 2002 15:14:21 -0000 1.6 +++ controllers/ControlDialog_impl.h 20 Oct 2002 22:01:39 -0000 @@ -4,7 +4,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Angus Leeming + * \author Angus Leeming * * Full author contact details are available in file CREDITS * @@ -22,16 +22,14 @@ class Dialogs; class LyXView; -class ControlDialogBD : public ControlDialog<ControlConnectBD> -{ +class ControlDialogBD : public ControlDialog<ControlConnectBD> { public: /// ControlDialogBD(LyXView &, Dialogs &); }; -class ControlDialogBI : public ControlDialog<ControlConnectBI> -{ +class ControlDialogBI : public ControlDialog<ControlConnectBI> { public: /// ControlDialogBI(LyXView &, Dialogs &); Index: controllers/ControlDocument.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlDocument.C,v retrieving revision 1.3 diff -u -p -r1.3 ControlDocument.C --- controllers/ControlDocument.C 20 Oct 2002 01:48:27 -0000 1.3 +++ controllers/ControlDocument.C 20 Oct 2002 22:01:39 -0000 @@ -49,6 +49,7 @@ void ControlDocument::showPreamble() { } + BufferParams & ControlDocument::params() { lyx::Assert(bp_.get()); @@ -91,6 +92,7 @@ void ControlDocument::setParams() *bp_ = buffer()->params; } + void ControlDocument::setLanguage() { Language const * oldL = buffer()->params.language; @@ -141,6 +143,7 @@ bool ControlDocument::classApply() //lv_.view()->redoCurrentBuffer(); return true; } + void ControlDocument::saveAsDefault() { Index: controllers/ControlERT.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlERT.h,v retrieving revision 1.5 diff -u -p -r1.5 ControlERT.h --- controllers/ControlERT.h 5 Sep 2002 15:14:21 -0000 1.5 +++ controllers/ControlERT.h 20 Oct 2002 22:01:39 -0000 @@ -47,7 +47,6 @@ class ControlERT : public ControlInset<I public: /// ControlERT(LyXView &, Dialogs &); - private: /// Dispatch the changed parameters to the kernel. virtual void applyParamsToInset(); Index: controllers/ControlError.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlError.h,v retrieving revision 1.7 diff -u -p -r1.7 ControlError.h --- controllers/ControlError.h 5 Sep 2002 15:14:21 -0000 1.7 +++ controllers/ControlError.h 20 Oct 2002 22:01:39 -0000 @@ -23,12 +23,10 @@ class InsetError; /** A controller for LaTeX Error dialogs. */ -class ControlError : public ControlInset<InsetError, string> -{ +class ControlError : public ControlInset<InsetError, string> { public: /// ControlError(LyXView &, Dialogs &); - private: /// not needed. virtual void applyParamsToInset() {} Index: controllers/ControlExternal.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlExternal.C,v retrieving revision 1.29 diff -u -p -r1.29 ControlExternal.C --- controllers/ControlExternal.C 5 Sep 2002 15:14:21 -0000 1.29 +++ controllers/ControlExternal.C 20 Oct 2002 22:01:39 -0000 @@ -28,6 +28,7 @@ using std::vector; + ControlExternal::ControlExternal(LyXView & lv, Dialogs & d) : ControlInset<InsetExternal, InsetExternal::Params>(lv, d) {} @@ -38,6 +39,7 @@ InsetExternal::Params const ControlExter return InsetExternal::Params(); } + InsetExternal::Params const ControlExternal::getParams(InsetExternal const & inset) { @@ -51,6 +53,7 @@ void ControlExternal::applyParamsToInset bufferview()->updateInset(inset(), true); } + void ControlExternal::editExternal() { // fill the local, controller's copy of the Params struct with @@ -66,6 +69,7 @@ void ControlExternal::editExternal() ie->editExternal(); } + void ControlExternal::viewExternal() { view().apply(); @@ -77,6 +81,7 @@ void ControlExternal::viewExternal() ie->viewExternal(); } + void ControlExternal::updateExternal() { view().apply(); @@ -88,6 +93,7 @@ void ControlExternal::updateExternal() ie->updateExternal(); } + vector<string> const ControlExternal::getTemplates() const { vector<string> result; @@ -105,15 +111,12 @@ vector<string> const ControlExternal::ge int ControlExternal::getTemplateNumber(string const & name) const { - int i = 0; - ExternalTemplateManager::Templates::const_iterator i1, i2; i1 = ExternalTemplateManager::get().getTemplates().begin(); i2 = ExternalTemplateManager::get().getTemplates().end(); - for (; i1 != i2; ++i1) { + for (int i = 0; i1 != i2; ++i1, ++i) { if (i1->second.lyxName == name) return i; - ++i; } // we can get here if a LyX document has a template not installed @@ -124,11 +127,13 @@ int ControlExternal::getTemplateNumber(s ExternalTemplate ControlExternal::getTemplate(int i) const { - ExternalTemplateManager::Templates::const_iterator i1; - i1 = ExternalTemplateManager::get().getTemplates().begin(); - for (int n = 1; n < i; ++n) - ++i1; - + ExternalTemplateManager::Templates::const_iterator i1 + = ExternalTemplateManager::get().getTemplates().begin(); +#if 0 + for (int n = 1; n < i; ++n, ++i1); +#else + std::advance(i1, i - 1); +#endif return i1->second; } Index: controllers/ControlExternal.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlExternal.h,v retrieving revision 1.7 diff -u -p -r1.7 ControlExternal.h --- controllers/ControlExternal.h 5 Sep 2002 15:14:21 -0000 1.7 +++ controllers/ControlExternal.h 20 Oct 2002 22:01:39 -0000 @@ -44,7 +44,6 @@ public: ExternalTemplate getTemplate(int) const; /// string const Browse(string const &) const; - private: /// virtual void applyParamsToInset(); Index: controllers/ControlForks.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlForks.h,v retrieving revision 1.5 diff -u -p -r1.5 ControlForks.h --- controllers/ControlForks.h 5 Sep 2002 15:14:21 -0000 1.5 +++ controllers/ControlForks.h 20 Oct 2002 22:01:39 -0000 @@ -37,7 +37,6 @@ public: string const getCommand(pid_t) const; /// void kill(pid_t); - private: /// virtual void apply(); Index: controllers/ControlGraphics.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlGraphics.C,v retrieving revision 1.52 diff -u -p -r1.52 ControlGraphics.C --- controllers/ControlGraphics.C 11 Sep 2002 18:37:50 -0000 1.52 +++ controllers/ControlGraphics.C 20 Oct 2002 22:01:39 -0000 @@ -40,6 +40,11 @@ using std::pair; using std::make_pair; using std::vector; +// We need these in the file browser. +extern string system_lyxdir; +extern string user_lyxdir; + + ControlGraphics::ControlGraphics(LyXView & lv, Dialogs & d) : ControlInset<InsetGraphics, InsetGraphicsParams>(lv, d) {} @@ -72,11 +77,6 @@ void ControlGraphics::applyParamsToInset void ControlGraphics::applyParamsNoInset() {} - - -// We need these in the file browser. -extern string system_lyxdir; -extern string user_lyxdir; string const ControlGraphics::Browse(string const & in_name) Index: controllers/ControlGraphics.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlGraphics.h,v retrieving revision 1.14 diff -u -p -r1.14 ControlGraphics.h --- controllers/ControlGraphics.h 5 Sep 2002 15:14:21 -0000 1.14 +++ controllers/ControlGraphics.h 20 Oct 2002 22:01:39 -0000 @@ -59,10 +59,12 @@ private: }; namespace frnt { - /// The (tranlated) GUI string and it's LaTeX equivalent. - typedef std::pair<string, string> RotationOriginPair; - /// - std::vector<RotationOriginPair> getRotationOriginData(); + +/// The (tranlated) GUI string and it's LaTeX equivalent. +typedef std::pair<string, string> RotationOriginPair; +/// +std::vector<RotationOriginPair> getRotationOriginData(); + } // namespace frnt #endif // CONTROLGRAPHICS_H Index: controllers/ControlInclude.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlInclude.C,v retrieving revision 1.29 diff -u -p -r1.29 ControlInclude.C --- controllers/ControlInclude.C 9 Sep 2002 17:32:52 -0000 1.29 +++ controllers/ControlInclude.C 20 Oct 2002 22:01:39 -0000 @@ -5,7 +5,7 @@ * * \author Alejandro Aguilar Sierra * \author John Levon - * \author Angus Leeming + * \author Angus Leeming * * Full author contact details are available in file CREDITS */ @@ -89,6 +89,6 @@ bool ControlInclude::fileExists(string c if (IsFileReadable(fileWithAbsPath)) return true; - + return false; } Index: controllers/ControlInclude.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlInclude.h,v retrieving revision 1.10 diff -u -p -r1.10 ControlInclude.h --- controllers/ControlInclude.h 5 Sep 2002 15:14:21 -0000 1.10 +++ controllers/ControlInclude.h 20 Oct 2002 22:01:39 -0000 @@ -47,7 +47,6 @@ public: /// test if file exist bool fileExists(string const & file); - private: /// Dispatch the changed parameters to the kernel. virtual void applyParamsToInset(); @@ -57,7 +56,9 @@ private: virtual InsetInclude::Params const getParams(string const &) { return InsetInclude::Params(); } /// get the parameters from the inset passed to showInset. - virtual InsetInclude::Params const getParams(InsetInclude const & inset) - { return inset.params(); } + virtual InsetInclude::Params const + getParams(InsetInclude const & inset) { + return inset.params(); + } }; #endif // CONTROLINCLUDE_H Index: controllers/ControlInset.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlInset.h,v retrieving revision 1.27 diff -u -p -r1.27 ControlInset.h --- controllers/ControlInset.h 5 Sep 2002 15:14:21 -0000 1.27 +++ controllers/ControlInset.h 20 Oct 2002 22:01:39 -0000 @@ -24,8 +24,7 @@ class Inset; template <class Inset, class Params> -class ControlInset : public ControlConnectBD -{ +class ControlInset : public ControlConnectBD { public: /// ControlInset(LyXView &, Dialogs &); @@ -39,11 +38,9 @@ public: void createInset(string const &); /// Slot launching dialog to an existing inset. void showInset(Inset *); - protected: /// Allow the daughter methods to access the inset. Inset * inset() const; - private: /** These 7 methods are all that the individual daughter classes should need to instantiate. */ @@ -71,8 +68,6 @@ private: dialog allows multiple citiations to be inserted easily. */ virtual bool disconnectOnApply() { return false; } - - /// Instantiation of ControlButtons virtual methods. /// Get changed parameters and Dispatch them to the kernel. @@ -102,10 +97,8 @@ private: /// is the dialog built ? bool dialog_built_; - }; #include "ControlInset.tmpl" #endif // CONTROLINSET_H - Index: controllers/ControlLog.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlLog.h,v retrieving revision 1.8 diff -u -p -r1.8 ControlLog.h --- controllers/ControlLog.h 5 Sep 2002 15:14:21 -0000 1.8 +++ controllers/ControlLog.h 20 Oct 2002 22:01:39 -0000 @@ -30,9 +30,9 @@ public: /// ControlLog(LyXView &, Dialogs &); /// - std::pair<Buffer::LogType, string> const & logfile() - { return logfile_; } - + std::pair<Buffer::LogType, string> const & logfile() { + return logfile_; + } private: /// virtual void apply() {} Index: controllers/ControlMinipage.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlMinipage.C,v retrieving revision 1.22 diff -u -p -r1.22 ControlMinipage.C --- controllers/ControlMinipage.C 5 Sep 2002 15:14:21 -0000 1.22 +++ controllers/ControlMinipage.C 20 Oct 2002 22:01:39 -0000 @@ -48,6 +48,7 @@ MinipageParams::MinipageParams() : pos(InsetMinipage::top) {} + MinipageParams::MinipageParams(InsetMinipage const & inset) : pageWidth(inset.pageWidth()), pos(inset.pos()) {} Index: controllers/ControlMinipage.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlMinipage.h,v retrieving revision 1.13 diff -u -p -r1.13 ControlMinipage.h --- controllers/ControlMinipage.h 5 Sep 2002 15:14:21 -0000 1.13 +++ controllers/ControlMinipage.h 20 Oct 2002 22:01:39 -0000 @@ -49,7 +49,6 @@ class ControlMinipage : public ControlIn public: /// ControlMinipage(LyXView &, Dialogs &); - private: /// Dispatch the changed parameters to the kernel. virtual void applyParamsToInset(); Index: controllers/ControlParagraph.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlParagraph.C,v retrieving revision 1.12 diff -u -p -r1.12 ControlParagraph.C --- controllers/ControlParagraph.C 20 Oct 2002 01:48:27 -0000 1.12 +++ controllers/ControlParagraph.C 20 Oct 2002 22:01:39 -0000 @@ -117,6 +117,7 @@ void ControlParagraph::setParams() ininset_ = par_->inInset(); } + void ControlParagraph::changedParagraph() { /// get paragraph Index: controllers/ControlParagraph.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlParagraph.h,v retrieving revision 1.6 diff -u -p -r1.6 ControlParagraph.h --- controllers/ControlParagraph.h 5 Sep 2002 15:14:21 -0000 1.6 +++ controllers/ControlParagraph.h 20 Oct 2002 22:01:39 -0000 @@ -4,7 +4,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Edwin Leuven + * \author Edwin Leuven * * Full author contact details are available in file CREDITS */ @@ -25,8 +25,7 @@ class ParagraphParameters; /** A controller for Paragraph dialogs. */ -class ControlParagraph : public ControlDialogBD -{ +class ControlParagraph : public ControlDialogBD { public: /// ControlParagraph(LyXView &, Dialogs &); @@ -42,7 +41,6 @@ public: LyXAlignment alignPossible() const; /// void changedParagraph(); - private: /// Get changed parameters and Dispatch them to the kernel. virtual void apply(); Index: controllers/ControlPreamble.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlPreamble.C,v retrieving revision 1.20 diff -u -p -r1.20 ControlPreamble.C --- controllers/ControlPreamble.C 20 Oct 2002 01:48:27 -0000 1.20 +++ controllers/ControlPreamble.C 20 Oct 2002 22:01:39 -0000 @@ -25,8 +25,7 @@ ControlPreamble::ControlPreamble(LyXView & lv, Dialogs & d) - : ControlDialogBD(lv, d), - params_(0) + : ControlDialogBD(lv, d) {} @@ -43,22 +42,25 @@ void ControlPreamble::apply() } -string & ControlPreamble::params() const +string const & ControlPreamble::params() const { - lyx::Assert(params_); - return *params_; + return params_; +} + + +void ControlPreamble::params(string const & newparams) +{ + params_ = newparams; } void ControlPreamble::setParams() { - delete params_; - params_ = new string(buffer()->params.preamble); + params_ = buffer()->params.preamble; } void ControlPreamble::clearParams() { - delete params_; - params_ = 0; + params_.erase(); } Index: controllers/ControlPreamble.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlPreamble.h,v retrieving revision 1.7 diff -u -p -r1.7 ControlPreamble.h --- controllers/ControlPreamble.h 5 Sep 2002 15:14:21 -0000 1.7 +++ controllers/ControlPreamble.h 20 Oct 2002 22:01:39 -0000 @@ -28,8 +28,9 @@ public: ControlPreamble(LyXView &, Dialogs &); /// - string & params() const; - + string const & params() const; + /// + void params(string const & newparams); private: /// Get changed parameters and Dispatch them to the kernel. virtual void apply(); @@ -39,7 +40,7 @@ private: virtual void clearParams(); /// - string * params_; + string params_; }; #endif // CONTROLPREAMBLE_H Index: controllers/ControlPrint.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlPrint.h,v retrieving revision 1.8 diff -u -p -r1.8 ControlPrint.h --- controllers/ControlPrint.h 5 Sep 2002 15:14:21 -0000 1.8 +++ controllers/ControlPrint.h 20 Oct 2002 22:01:39 -0000 @@ -34,7 +34,6 @@ public: string const Browse(string const &); /// PrinterParams & params() const; - private: /// Get changed parameters and Dispatch them to the kernel. virtual void apply(); Index: controllers/ControlRef.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlRef.h,v retrieving revision 1.11 diff -u -p -r1.11 ControlRef.h --- controllers/ControlRef.h 5 Sep 2002 15:14:21 -0000 1.11 +++ controllers/ControlRef.h 20 Oct 2002 22:01:39 -0000 @@ -24,7 +24,6 @@ class ControlRef : public ControlCommand public: /// ControlRef(LyXView &, Dialogs &); - /// std::vector<string> const getLabelList(string const &) const; /// Index: controllers/ControlSearch.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlSearch.h,v retrieving revision 1.10 diff -u -p -r1.10 ControlSearch.h --- controllers/ControlSearch.h 5 Sep 2002 15:14:21 -0000 1.10 +++ controllers/ControlSearch.h 20 Oct 2002 22:01:39 -0000 @@ -33,7 +33,6 @@ public: /// Replaces occurence of string void replace(string const & search, string const & replace, bool casesensitive, bool matchword, bool all); - private: /// not needed. virtual void apply() {} Index: controllers/ControlSendto.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlSendto.h,v retrieving revision 1.5 diff -u -p -r1.5 ControlSendto.h --- controllers/ControlSendto.h 5 Sep 2002 15:14:21 -0000 1.5 +++ controllers/ControlSendto.h 20 Oct 2002 22:01:40 -0000 @@ -4,7 +4,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Angus Leeming + * \author Angus Leeming * * Full author contact details are available in file CREDITS */ @@ -40,7 +40,6 @@ public: /// The command to be executed string const getCommand() const { return command_; }; void setCommand(string const &); - private: /// virtual void apply(); Index: controllers/ControlShowFile.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlShowFile.C,v retrieving revision 1.7 diff -u -p -r1.7 ControlShowFile.C --- controllers/ControlShowFile.C 5 Sep 2002 15:14:21 -0000 1.7 +++ controllers/ControlShowFile.C 20 Oct 2002 22:01:40 -0000 @@ -3,7 +3,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Herbert Voss + * \author Herbert Voss * * Full author contact details are available in file CREDITS */ Index: controllers/ControlShowFile.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlShowFile.h,v retrieving revision 1.5 diff -u -p -r1.5 ControlShowFile.h --- controllers/ControlShowFile.h 5 Sep 2002 15:14:21 -0000 1.5 +++ controllers/ControlShowFile.h 20 Oct 2002 22:01:40 -0000 @@ -4,7 +4,7 @@ * Licence details can be found in the file COPYING. * * \file ControlShowFile.h - * \author Herbert Voss + * \author Herbert Voss * * Full author contact details are available in file CREDITS */ Index: controllers/ControlSpellchecker.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlSpellchecker.C,v retrieving revision 1.29 diff -u -p -r1.29 ControlSpellchecker.C --- controllers/ControlSpellchecker.C 5 Sep 2002 15:14:21 -0000 1.29 +++ controllers/ControlSpellchecker.C 20 Oct 2002 22:01:40 -0000 @@ -3,7 +3,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Edwin Leuven + * \author Edwin Leuven * * Full author contact details are available in file CREDITS */ @@ -40,39 +40,40 @@ ControlSpellchecker::ControlSpellchecker void ControlSpellchecker::setParams() { - if (!speller_) { - // create spell object - string tmp; + if (speller_) + return; + + // create spell object + string tmp; #ifdef USE_PSPELL - if (lyxrc.use_pspell) { - tmp = (lyxrc.isp_use_alt_lang) ? - lyxrc.isp_alt_lang : buffer()->params.language->code(); - - speller_ = new PSpell(buffer()->params, tmp); - } else { + if (lyxrc.use_pspell) { + tmp = (lyxrc.isp_use_alt_lang) ? + lyxrc.isp_alt_lang : buffer()->params.language->code(); + + speller_ = new PSpell(buffer()->params, tmp); + } else { #endif - tmp = (lyxrc.isp_use_alt_lang) ? - lyxrc.isp_alt_lang : buffer()->params.language->lang(); - - speller_ = new ISpell(buffer()->params, tmp); + tmp = (lyxrc.isp_use_alt_lang) ? + lyxrc.isp_alt_lang : buffer()->params.language->lang(); + + speller_ = new ISpell(buffer()->params, tmp); #ifdef USE_PSPELL - } + } #endif - - if (lyxrc.isp_use_alt_lang) { - Language const * lang = languages.getLanguage(tmp); - if (lang) - rtl_ = lang->RightToLeft(); - } else { - rtl_ = buffer()->params.language->RightToLeft(); - } - - if (!speller_->error().empty()) { - emergency_exit_ = true; - Alert::alert("The spellchecker has failed", speller_->error()); - clearParams(); - return; - } + + if (lyxrc.isp_use_alt_lang) { + Language const * lang = languages.getLanguage(tmp); + if (lang) + rtl_ = lang->RightToLeft(); + } else { + rtl_ = buffer()->params.language->RightToLeft(); + } + + if (!speller_->error().empty()) { + emergency_exit_ = true; + Alert::alert("The spellchecker has failed", speller_->error()); + clearParams(); + return; } } @@ -128,7 +129,7 @@ void ControlSpellchecker::replace(string { bufferview()->replaceWord(replacement); // fix up the count - --count_; + --count_; check(); } Index: controllers/ControlSpellchecker.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlSpellchecker.h,v retrieving revision 1.11 diff -u -p -r1.11 ControlSpellchecker.h --- controllers/ControlSpellchecker.h 5 Sep 2002 15:14:21 -0000 1.11 +++ controllers/ControlSpellchecker.h 20 Oct 2002 22:01:40 -0000 @@ -21,7 +21,7 @@ #include "WordLangTuple.h" class SpellBase; - + /** A controller for Spellchecker dialogs. */ class ControlSpellchecker : public ControlDialogBD { @@ -62,9 +62,7 @@ public: string getMessage() { return message_; } - private: - /// set the params before show or update void setParams(); /// clean-up on hide. Index: controllers/ControlTabularCreate.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlTabularCreate.h,v retrieving revision 1.8 diff -u -p -r1.8 ControlTabularCreate.h --- controllers/ControlTabularCreate.h 5 Sep 2002 15:14:21 -0000 1.8 +++ controllers/ControlTabularCreate.h 20 Oct 2002 22:01:40 -0000 @@ -31,7 +31,6 @@ public: /// rowsCols & params(); - private: /// Apply from dialog virtual void apply(); Index: controllers/ControlTexinfo.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlTexinfo.C,v retrieving revision 1.21 diff -u -p -r1.21 ControlTexinfo.C --- controllers/ControlTexinfo.C 5 Sep 2002 15:14:21 -0000 1.21 +++ controllers/ControlTexinfo.C 20 Oct 2002 22:01:40 -0000 @@ -33,7 +33,7 @@ namespace { string getFileList(ControlTexinfo::texFileSuffix type, bool withFullPath) { switch (type) { - case ControlTexinfo::bst: + case ControlTexinfo::bst: return getTexFileList("bstFiles.lst", withFullPath); break; case ControlTexinfo::cls: @@ -45,8 +45,9 @@ string getFileList(ControlTexinfo::texFi } return string(); } - -} + +} // namespace anon + ControlTexinfo::ControlTexinfo(LyXView & lv, Dialogs & d) : ControlDialogBI(lv, d) Index: controllers/ControlTexinfo.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlTexinfo.h,v retrieving revision 1.9 diff -u -p -r1.9 ControlTexinfo.h --- controllers/ControlTexinfo.h 5 Sep 2002 15:14:21 -0000 1.9 +++ controllers/ControlTexinfo.h 20 Oct 2002 22:01:40 -0000 @@ -37,8 +37,6 @@ public: void runTexhash() const; /// read filecontents string const getContents(texFileSuffix type, bool withPath) const; - - private: /// virtual void apply() {} Index: controllers/ControlToc.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlToc.C,v retrieving revision 1.20 diff -u -p -r1.20 ControlToc.C --- controllers/ControlToc.C 5 Sep 2002 15:14:21 -0000 1.20 +++ controllers/ControlToc.C 20 Oct 2002 22:01:40 -0000 @@ -23,6 +23,7 @@ using std::vector; class Buffer; + ControlToc::ControlToc(LyXView & lv, Dialogs & d) : ControlCommand(lv, d, LFUN_TOC_INSERT) {} Index: controllers/ControlToc.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlToc.h,v retrieving revision 1.7 diff -u -p -r1.7 ControlToc.h --- controllers/ControlToc.h 5 Sep 2002 15:14:21 -0000 1.7 +++ controllers/ControlToc.h 20 Oct 2002 22:01:40 -0000 @@ -22,8 +22,7 @@ /** A controller for TOC dialogs. */ -class ControlToc : public ControlCommand -{ +class ControlToc : public ControlCommand { public: /// ControlToc(LyXView &, Dialogs &); Index: controllers/ControlVCLog.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlVCLog.C,v retrieving revision 1.21 diff -u -p -r1.21 ControlVCLog.C --- controllers/ControlVCLog.C 5 Sep 2002 15:14:21 -0000 1.21 +++ controllers/ControlVCLog.C 20 Oct 2002 22:01:40 -0000 @@ -16,18 +16,17 @@ #endif #include "ControlVCLog.h" -#include "Lsstream.h" #include "ButtonControllerBase.h" #include "buffer.h" #include "lyxrc.h" #include "gettext.h" - #include "support/lyxlib.h" #include <fstream> using std::endl; +using std::ostream; ControlVCLog::ControlVCLog(LyXView & lv, Dialogs & d) @@ -41,12 +40,13 @@ string const ControlVCLog::getBufferFile } -stringstream & ControlVCLog::getVCLogFile(stringstream & ss) const +void ControlVCLog::getVCLogFile(ostream & ss) const { string const name = buffer()->lyxvc.getLogFile(); std::ifstream in(name.c_str()); +#if 0 bool found = (in.get()); if (found) { @@ -55,11 +55,16 @@ stringstream & ControlVCLog::getVCLogFil ss << in.rdbuf(); found = ss.good(); } +#else + bool found(false); + if (in) { + ss << in.rdbuf(); + found = ss.good(); + } +#endif if (!found) ss << _("No version control log file found.") << endl; lyx::unlink(name); - - return ss; } Index: controllers/ControlVCLog.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlVCLog.h,v retrieving revision 1.11 diff -u -p -r1.11 ControlVCLog.h --- controllers/ControlVCLog.h 5 Sep 2002 15:14:21 -0000 1.11 +++ controllers/ControlVCLog.h 20 Oct 2002 22:01:40 -0000 @@ -18,7 +18,8 @@ #endif #include "ControlDialog_impl.h" -#include "Lsstream.h" + +#include "LString.h" /** * A controller for the Version Control log viewer. @@ -27,11 +28,10 @@ class ControlVCLog : public ControlDialo public: /// ControlVCLog(LyXView &, Dialogs &); - /// get a stringstream containing the log file - stringstream & getVCLogFile(stringstream & ss) const; + /// put the log file into the ostream + void getVCLogFile(std::ostream & ss) const; /// get the filename of the buffer string const getBufferFileName() const; - private: /// virtual void apply() {} Index: controllers/ControlWrap.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlWrap.C,v retrieving revision 1.1 diff -u -p -r1.1 ControlWrap.C --- controllers/ControlWrap.C 10 Sep 2002 10:18:57 -0000 1.1 +++ controllers/ControlWrap.C 20 Oct 2002 22:01:40 -0000 @@ -44,11 +44,6 @@ WrapParams const ControlWrap::getParams( } -WrapParams::WrapParams() - : placement("") -{} - - WrapParams::WrapParams(InsetWrap const & inset) : pageWidth(inset.pageWidth()), placement(inset.placement()) Index: controllers/ControlWrap.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlWrap.h,v retrieving revision 1.1 diff -u -p -r1.1 ControlWrap.h --- controllers/ControlWrap.h 10 Sep 2002 10:18:57 -0000 1.1 +++ controllers/ControlWrap.h 20 Oct 2002 22:01:40 -0000 @@ -27,7 +27,7 @@ class InsetWrap; /// struct WrapParams { /// - WrapParams(); + WrapParams() {} /// WrapParams(InsetWrap const &); /// Index: controllers/GUI.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/GUI.h,v retrieving revision 1.41 diff -u -p -r1.41 GUI.h --- controllers/GUI.h 5 Sep 2002 15:14:21 -0000 1.41 +++ controllers/GUI.h 20 Oct 2002 22:01:40 -0000 @@ -4,7 +4,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Angus Leeming + * \author Angus Leeming * * Full author contact details are available in file CREDITS */ @@ -28,7 +28,6 @@ public: Controller & controller() { return controller_; } /// Controller const & controller() const { return controller_; } - private: /// Controller controller_; Index: controllers/ViewBase.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ViewBase.h,v retrieving revision 1.17 diff -u -p -r1.17 ViewBase.h --- controllers/ViewBase.h 5 Sep 2002 15:14:21 -0000 1.17 +++ controllers/ViewBase.h 20 Oct 2002 22:01:40 -0000 @@ -49,20 +49,17 @@ public: * and the view */ void setController(ControlButtons & c) { controller_ptr_ = &c; } - + /// - ControlButtons & getController() - { + ControlButtons & getController() { lyx::Assert(controller_ptr_); return *controller_ptr_; } /// - ControlButtons const & getController() const - { + ControlButtons const & getController() const { lyx::Assert(controller_ptr_); return *controller_ptr_; } - protected: /// We don't own this. ControlButtons * controller_ptr_; Index: controllers/biblio.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/biblio.C,v retrieving revision 1.34 diff -u -p -r1.34 biblio.C --- controllers/biblio.C 5 Sep 2002 15:14:21 -0000 1.34 +++ controllers/biblio.C 20 Oct 2002 22:01:40 -0000 @@ -31,8 +31,7 @@ using std::min; using std::vector; using std::sort; -namespace biblio -{ +namespace biblio { namespace { Index: controllers/biblio.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/biblio.h,v retrieving revision 1.10 diff -u -p -r1.10 biblio.h --- controllers/biblio.h 24 Sep 2002 12:43:01 -0000 1.10 +++ controllers/biblio.h 20 Oct 2002 22:01:40 -0000 @@ -21,138 +21,141 @@ #include <vector> /** Functions of use to citation and bibtex GUI controllers and views */ -namespace biblio -{ +namespace biblio { + +/// +enum CiteStyle { + CITE, + CITET, + CITEP, + CITEALT, + CITEALP, + CITEAUTHOR, + CITEYEAR, + CITEYEARPAR +}; + +/// +enum Search { + /// + SIMPLE, + /// + REGEX +}; + +/// +enum Direction { + /// + FORWARD, + /// + BACKWARD +}; + +/// First entry is the bibliography key, second the data +typedef std::map<string, string> InfoMap; + +/// Returns a vector of bibliography keys +std::vector<string> const getKeys(InfoMap const &); + +/** Returns the BibTeX data associated with a given key. + Empty if no info exists. */ +string const getInfo(InfoMap const &, string const &); + +// rturn the year from the bibtex data record +string const getYear(InfoMap const & map, string const & key); + +/// return the short form of an authorlist +string const getAbbreviatedAuthor(InfoMap const & map, string const & key); + +// return only the family name +string const familyName(string const & name); + +/** Search a BibTeX info field for the given key and return the + associated field. */ +string const parseBibTeX(string data, string const & findkey); + +/** Returns an iterator to the first key that meets the search + criterion, or end() if unsuccessful. + + User supplies : + the InfoMap of bibkeys info, + the vector of keys to be searched, + the search criterion, + an iterator defining the starting point of the search, + an enum defining a Simple or Regex search, + an enum defining the search direction. +*/ + +std::vector<string>::const_iterator +searchKeys(InfoMap const & map, + std::vector<string> const & keys_to_search, + string const & search_expression, + std::vector<string>::const_iterator start, + Search, + Direction, + bool caseSensitive=false); + +/// Type returned by getCitationStyle, below +struct CitationStyle { + /// + CitationStyle() : style(CITE), full(false), forceUCase(false) {} /// - enum CiteStyle { - CITE, - CITET, - CITEP, - CITEALT, - CITEALP, - CITEAUTHOR, - CITEYEAR, - CITEYEARPAR - }; - /// - enum Search { - /// - SIMPLE, - /// - REGEX - }; - /// - enum Direction { - /// - FORWARD, - /// - BACKWARD - }; - - /// First entry is the bibliography key, second the data - typedef std::map<string, string> InfoMap; - - /// Returns a vector of bibliography keys - std::vector<string> const getKeys(InfoMap const &); - - /** Returns the BibTeX data associated with a given key. - Empty if no info exists. */ - string const getInfo(InfoMap const &, string const &); - - // rturn the year from the bibtex data record - string const getYear(InfoMap const & map, string const & key); - - /// return the short form of an authorlist - string const getAbbreviatedAuthor(InfoMap const & map, string const & key); - - // return only the family name - string const familyName(string const & name); - - /** Search a BibTeX info field for the given key and return the - associated field. */ - string const parseBibTeX(string data, string const & findkey); - - /** Returns an iterator to the first key that meets the search - criterion, or end() if unsuccessful. - - User supplies : - the InfoMap of bibkeys info, - the vector of keys to be searched, - the search criterion, - an iterator defining the starting point of the search, - an enum defining a Simple or Regex search, - an enum defining the search direction. - */ - - std::vector<string>::const_iterator - searchKeys(InfoMap const & map, - std::vector<string> const & keys_to_search, - string const & search_expression, - std::vector<string>::const_iterator start, - Search, - Direction, - bool caseSensitive=false); - - /// Type returned by getCitationStyle, below - struct CitationStyle { - /// - CitationStyle() : style(CITE), full(false), forceUCase(false) {} - /// - CiteStyle style; - /// - bool full; - /// - bool forceUCase; - }; - /// Given the LaTeX command, return the appropriate CitationStyle - CitationStyle const getCitationStyle(string const & command); - - /** Returns the LaTeX citation command - - User supplies : - The CiteStyle enum, - a flag forcing the full author list, - a flag forcing upper case, e.g. "della Casa" becomes "Della Case" - */ - string const getCiteCommand(CiteStyle, bool full, bool forceUCase); - - /// Returns a vector of available Citation styles. - std::vector<CiteStyle> const getCiteStyles(bool usingNatbib); - - /** - "Translates" the available Citation Styles into strings for this key. - The returned string is displayed by the GUI. - - - [XX] is used in place of the actual reference - Eg, the vector will contain: [XX], Jones et al. [XX], ... - - User supplies : - the key, - the InfoMap of bibkeys info, - the available citation styles - */ - std::vector<string> const - getNumericalStrings(string const & key, - InfoMap const & map, - std::vector<CiteStyle> const & styles); - - /** - "Translates" the available Citation Styles into strings for this key. - The returned string is displayed by the GUI. - - Eg, the vector will contain: - Jones et al. (1990), (Jones et al. 1990), Jones et al. 1990, ... - - User supplies : - the key, - the InfoMap of bibkeys info, - the available citation styles - */ - std::vector<string> const - getAuthorYearStrings(string const & key, - InfoMap const & map, - std::vector<CiteStyle> const & styles); + CiteStyle style; + /// + bool full; + /// + bool forceUCase; +}; + +/// Given the LaTeX command, return the appropriate CitationStyle +CitationStyle const getCitationStyle(string const & command); + +/** Returns the LaTeX citation command + +User supplies : +The CiteStyle enum, +a flag forcing the full author list, +a flag forcing upper case, e.g. "della Casa" becomes "Della Case" +*/ +string const getCiteCommand(CiteStyle, bool full, bool forceUCase); + +/// Returns a vector of available Citation styles. +std::vector<CiteStyle> const getCiteStyles(bool usingNatbib); + +/** + "Translates" the available Citation Styles into strings for this key. + The returned string is displayed by the GUI. + + + [XX] is used in place of the actual reference + Eg, the vector will contain: [XX], Jones et al. [XX], ... + + User supplies : + the key, + the InfoMap of bibkeys info, + the available citation styles +*/ +std::vector<string> const +getNumericalStrings(string const & key, + InfoMap const & map, + std::vector<CiteStyle> const & styles); + +/** + "Translates" the available Citation Styles into strings for this key. + The returned string is displayed by the GUI. + + Eg, the vector will contain: + Jones et al. (1990), (Jones et al. 1990), Jones et al. 1990, ... + + User supplies : + the key, + the InfoMap of bibkeys info, + the available citation styles +*/ +std::vector<string> const +getAuthorYearStrings(string const & key, + InfoMap const & map, + std::vector<CiteStyle> const & styles); } // namespace biblio #endif // BIBLIOHELPERS_H Index: controllers/character.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/character.C,v retrieving revision 1.12 diff -u -p -r1.12 character.C --- controllers/character.C 5 Sep 2002 15:14:21 -0000 1.12 +++ controllers/character.C 20 Oct 2002 22:01:40 -0000 @@ -27,15 +27,25 @@ vector<FamilyPair> const getFamilyData() vector<FamilyPair> family(5); FamilyPair pr; - pr.first = _("No change"); pr.second = LyXFont::IGNORE_FAMILY; + + pr.first = _("No change"); + pr.second = LyXFont::IGNORE_FAMILY; family[0] = pr; - pr.first = _("Roman"); pr.second = LyXFont::ROMAN_FAMILY; + + pr.first = _("Roman"); + pr.second = LyXFont::ROMAN_FAMILY; family[1] = pr; - pr.first = _("Sans Serif"); pr.second = LyXFont::SANS_FAMILY; + + pr.first = _("Sans Serif"); + pr.second = LyXFont::SANS_FAMILY; family[2] = pr; - pr.first = _("Typewriter"); pr.second = LyXFont::TYPEWRITER_FAMILY; + + pr.first = _("Typewriter"); + pr.second = LyXFont::TYPEWRITER_FAMILY; family[3] = pr; - pr.first = _("Reset"); pr.second = LyXFont::INHERIT_FAMILY; + + pr.first = _("Reset"); + pr.second = LyXFont::INHERIT_FAMILY; family[4] = pr; return family; @@ -47,13 +57,21 @@ vector<SeriesPair> const getSeriesData() vector<SeriesPair> series(4); SeriesPair pr; - pr.first = _("No change"); pr.second = LyXFont::IGNORE_SERIES; + + pr.first = _("No change"); + pr.second = LyXFont::IGNORE_SERIES; series[0] = pr; - pr.first = _("Medium"); pr.second = LyXFont::MEDIUM_SERIES; + + pr.first = _("Medium"); + pr.second = LyXFont::MEDIUM_SERIES; series[1] = pr; - pr.first = _("Bold"); pr.second = LyXFont::BOLD_SERIES; + + pr.first = _("Bold"); + pr.second = LyXFont::BOLD_SERIES; series[2] = pr; - pr.first = _("Reset"); pr.second = LyXFont::INHERIT_SERIES; + + pr.first = _("Reset"); + pr.second = LyXFont::INHERIT_SERIES; series[3] = pr; return series; @@ -65,17 +83,29 @@ vector<ShapePair> const getShapeData() vector<ShapePair> shape(6); ShapePair pr; - pr.first = _("No change"); pr.second = LyXFont::IGNORE_SHAPE; + + pr.first = _("No change"); + pr.second = LyXFont::IGNORE_SHAPE; shape[0] = pr; - pr.first = _("Upright"); pr.second = LyXFont::UP_SHAPE; + + pr.first = _("Upright"); + pr.second = LyXFont::UP_SHAPE; shape[1] = pr; - pr.first = _("Italic"); pr.second = LyXFont::ITALIC_SHAPE; + + pr.first = _("Italic"); + pr.second = LyXFont::ITALIC_SHAPE; shape[2] = pr; - pr.first = _("Slanted"); pr.second = LyXFont::SLANTED_SHAPE; + + pr.first = _("Slanted"); + pr.second = LyXFont::SLANTED_SHAPE; shape[3] = pr; - pr.first = _("Small Caps"); pr.second = LyXFont::SMALLCAPS_SHAPE; + + pr.first = _("Small Caps"); + pr.second = LyXFont::SMALLCAPS_SHAPE; shape[4] = pr; - pr.first = _("Reset"); pr.second = LyXFont::INHERIT_SHAPE; + + pr.first = _("Reset"); + pr.second = LyXFont::INHERIT_SHAPE; shape[5] = pr; return shape; @@ -87,33 +117,61 @@ vector<SizePair> const getSizeData() vector<SizePair> size(14); SizePair pr; - pr.first = _("No change"); pr.second = LyXFont::IGNORE_SIZE; + + pr.first = _("No change"); + pr.second = LyXFont::IGNORE_SIZE; size[0] = pr; - pr.first = _("Tiny"); pr.second = LyXFont::SIZE_TINY; + + pr.first = _("Tiny"); + pr.second = LyXFont::SIZE_TINY; size[1] = pr; - pr.first = _("Smallest"); pr.second = LyXFont::SIZE_SCRIPT; + + pr.first = _("Smallest"); + pr.second = LyXFont::SIZE_SCRIPT; size[2] = pr; - pr.first = _("Smaller"); pr.second = LyXFont::SIZE_FOOTNOTE; + + pr.first = _("Smaller"); + pr.second = LyXFont::SIZE_FOOTNOTE; size[3] = pr; - pr.first = _("Small"); pr.second = LyXFont::SIZE_SMALL; + + pr.first = _("Small"); + pr.second = LyXFont::SIZE_SMALL; size[4] = pr; - pr.first = _("Normal"); pr.second = LyXFont::SIZE_NORMAL; + + pr.first = _("Normal"); + pr.second = LyXFont::SIZE_NORMAL; size[5] = pr; - pr.first = _("Large"); pr.second = LyXFont::SIZE_LARGE; + + pr.first = _("Large"); + pr.second = LyXFont::SIZE_LARGE; size[6] = pr; - pr.first = _("Larger"); pr.second = LyXFont::SIZE_LARGER; + + pr.first = _("Larger"); + pr.second = LyXFont::SIZE_LARGER; size[7] = pr; - pr.first = _("Largest"); pr.second = LyXFont::SIZE_LARGEST; + + pr.first = _("Largest"); + pr.second = LyXFont::SIZE_LARGEST; size[8] = pr; - pr.first = _("Huge"); pr.second = LyXFont::SIZE_HUGE; + + pr.first = _("Huge"); + pr.second = LyXFont::SIZE_HUGE; size[9] = pr; - pr.first = _("Huger"); pr.second = LyXFont::SIZE_HUGER; + + pr.first = _("Huger"); + pr.second = LyXFont::SIZE_HUGER; size[10] = pr; - pr.first = _("Increase"); pr.second = LyXFont::INCREASE_SIZE; + + pr.first = _("Increase"); + pr.second = LyXFont::INCREASE_SIZE; size[11] = pr; - pr.first = _("Decrease"); pr.second = LyXFont::DECREASE_SIZE; + + pr.first = _("Decrease"); + pr.second = LyXFont::DECREASE_SIZE; size[12] = pr; - pr.first = _("Reset"); pr.second = LyXFont::INHERIT_SIZE; + + pr.first = _("Reset"); + pr.second = LyXFont::INHERIT_SIZE; size[13] = pr; return size; @@ -125,15 +183,25 @@ vector<BarPair> const getBarData() vector<BarPair> bar(5); BarPair pr; - pr.first = _("No change"); pr.second = IGNORE; + + pr.first = _("No change"); + pr.second = IGNORE; bar[0] = pr; - pr.first = _("Emph"); pr.second = EMPH_TOGGLE; + + pr.first = _("Emph"); + pr.second = EMPH_TOGGLE; bar[1] = pr; - pr.first = _("Underbar"); pr.second = UNDERBAR_TOGGLE; + + pr.first = _("Underbar"); + pr.second = UNDERBAR_TOGGLE; bar[2] = pr; - pr.first = _("Noun"); pr.second = NOUN_TOGGLE; + + pr.first = _("Noun"); + pr.second = NOUN_TOGGLE; bar[3] = pr; - pr.first = _("Reset"); pr.second = INHERIT; + + pr.first = _("Reset"); + pr.second = INHERIT; bar[4] = pr; return bar; @@ -145,27 +213,49 @@ vector<ColorPair> const getColorData() vector<ColorPair> color(11); ColorPair pr; - pr.first = _("No change"); pr.second = LColor::ignore; + + pr.first = _("No change"); + pr.second = LColor::ignore; color[0] = pr; - pr.first = _("No color"); pr.second = LColor::none; + + pr.first = _("No color"); + pr.second = LColor::none; color[1] = pr; - pr.first = _("Black"); pr.second = LColor::black; + + pr.first = _("Black"); + pr.second = LColor::black; color[2] = pr; - pr.first = _("White"); pr.second = LColor::white; + + pr.first = _("White"); + pr.second = LColor::white; color[3] = pr; - pr.first = _("Red"); pr.second = LColor::red; + + pr.first = _("Red"); + pr.second = LColor::red; color[4] = pr; - pr.first = _("Green"); pr.second = LColor::green; + + pr.first = _("Green"); + pr.second = LColor::green; color[5] = pr; - pr.first = _("Blue"); pr.second = LColor::blue; + + pr.first = _("Blue"); + pr.second = LColor::blue; color[6] = pr; - pr.first = _("Cyan"); pr.second = LColor::cyan; + + pr.first = _("Cyan"); + pr.second = LColor::cyan; color[7] = pr; - pr.first = _("Magenta"); pr.second = LColor::magenta; + + pr.first = _("Magenta"); + pr.second = LColor::magenta; color[8] = pr; - pr.first = _("Yellow"); pr.second = LColor::yellow; + + pr.first = _("Yellow"); + pr.second = LColor::yellow; color[9] = pr; - pr.first = _("Reset"); pr.second = LColor::inherit; + + pr.first = _("Reset"); + pr.second = LColor::inherit; color[10] = pr; return color; Index: controllers/character.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/character.h,v retrieving revision 1.11 diff -u -p -r1.11 character.h --- controllers/character.h 5 Sep 2002 15:14:21 -0000 1.11 +++ controllers/character.h 20 Oct 2002 22:01:40 -0000 @@ -24,45 +24,46 @@ /** Functions of use to the character GUI controller and view */ namespace frnt { - /// - enum FONT_STATE { - /// - IGNORE, - /// - EMPH_TOGGLE, - /// - UNDERBAR_TOGGLE, - /// - NOUN_TOGGLE, - /// - INHERIT - }; +/// +enum FONT_STATE { /// - typedef std::pair<string, LyXFont::FONT_FAMILY> FamilyPair; - /// - typedef std::pair<string, LyXFont::FONT_SERIES> SeriesPair; + IGNORE, /// - typedef std::pair<string, LyXFont::FONT_SHAPE> ShapePair; + EMPH_TOGGLE, /// - typedef std::pair<string, LyXFont::FONT_SIZE> SizePair; + UNDERBAR_TOGGLE, /// - typedef std::pair<string, FONT_STATE> BarPair; + NOUN_TOGGLE, /// - typedef std::pair<string, LColor::color> ColorPair; + INHERIT +}; - /// - std::vector<FamilyPair> const getFamilyData(); - /// - std::vector<SeriesPair> const getSeriesData(); - /// - std::vector<ShapePair> const getShapeData(); - /// - std::vector<SizePair> const getSizeData(); - /// - std::vector<BarPair> const getBarData(); - /// - std::vector<ColorPair> const getColorData(); +/// +typedef std::pair<string, LyXFont::FONT_FAMILY> FamilyPair; +/// +typedef std::pair<string, LyXFont::FONT_SERIES> SeriesPair; +/// +typedef std::pair<string, LyXFont::FONT_SHAPE> ShapePair; +/// +typedef std::pair<string, LyXFont::FONT_SIZE> SizePair; +/// +typedef std::pair<string, FONT_STATE> BarPair; +/// +typedef std::pair<string, LColor::color> ColorPair; + +/// +std::vector<FamilyPair> const getFamilyData(); +/// +std::vector<SeriesPair> const getSeriesData(); +/// +std::vector<ShapePair> const getShapeData(); +/// +std::vector<SizePair> const getSizeData(); +/// +std::vector<BarPair> const getBarData(); +/// +std::vector<ColorPair> const getColorData(); } // namespace frnt Index: controllers/frnt_lang.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/frnt_lang.C,v retrieving revision 1.8 diff -u -p -r1.8 frnt_lang.C --- controllers/frnt_lang.C 5 Sep 2002 15:14:21 -0000 1.8 +++ controllers/frnt_lang.C 20 Oct 2002 22:01:41 -0000 @@ -3,7 +3,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Angus Leeming + * \author Angus Leeming * * Full author contact details are available in file CREDITS */ @@ -26,10 +26,9 @@ namespace { struct Sorter { bool operator()(frnt::LanguagePair const & lhs, - frnt::LanguagePair const & rhs) const - { - return lhs.first < rhs.first; - } + frnt::LanguagePair const & rhs) const { + return lhs.first < rhs.first; + } }; } // namespace anon @@ -44,8 +43,10 @@ vector<LanguagePair> const getLanguageDa vector<LanguagePair> langs(size); if (character_dlg) { - langs[0].first = _("No change"); langs[0].second = "ignore"; - langs[1].first = _("Reset"); langs[1].second = "reset"; + langs[0].first = _("No change"); + langs[0].second = "ignore"; + langs[1].first = _("Reset"); + langs[1].second = "reset"; } vector<string>::size_type i = character_dlg ? 2 : 0; Index: controllers/frnt_lang.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/frnt_lang.h,v retrieving revision 1.5 diff -u -p -r1.5 frnt_lang.h --- controllers/frnt_lang.h 5 Sep 2002 15:14:21 -0000 1.5 +++ controllers/frnt_lang.h 20 Oct 2002 22:01:41 -0000 @@ -4,7 +4,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Angus Leeming + * \author Angus Leeming * * Full author contact details are available in file CREDITS */ @@ -23,12 +23,14 @@ /** Ease the use of internationalised language strings in the dialogs. */ namespace frnt { - /// - typedef std::pair<string, string> LanguagePair; - /** If the caller is the character dialog, add "No change" and "Reset" - * to the vector. - */ - std::vector<LanguagePair> const getLanguageData(bool character_dlg); + +/// +typedef std::pair<string, string> LanguagePair; + +/** If the caller is the character dialog, add "No change" and "Reset" + * to the vector. + */ +std::vector<LanguagePair> const getLanguageData(bool character_dlg); } // namespace frnt Index: controllers/helper_funcs.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/helper_funcs.C,v retrieving revision 1.20 diff -u -p -r1.20 helper_funcs.C --- controllers/helper_funcs.C 5 Sep 2002 15:14:21 -0000 1.20 +++ controllers/helper_funcs.C 20 Oct 2002 22:01:41 -0000 @@ -28,13 +28,14 @@ using std::pair; using std::vector; using std::make_pair; + string const browseFile(LyXView * lv, string const & filename, string const & title, string const & pattern, pair<string,string> const & dir1, pair<string,string> const & dir2) { - string lastPath = "."; + string lastPath("."); if (!filename.empty()) lastPath = OnlyPath(filename); @@ -42,8 +43,9 @@ string const browseFile(LyXView * lv, st FileDialog::Result result; - while (1) { - result = fileDlg.Select(lastPath, pattern, OnlyFilename(filename)); + while (true) { + result = fileDlg.Select(lastPath, pattern, + OnlyFilename(filename)); if (result.second.empty()) return result.second; @@ -87,8 +89,8 @@ extern const char * stringFromUnit(int); vector<string> const getLatexUnits() { vector<string> units; - const char * str; - for(int i=0; (str = stringFromUnit(i)); ++i) + char const * str; + for (int i = 0; (str = stringFromUnit(i)); ++i) units.push_back(str); return units; Index: controllers/helper_funcs.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/helper_funcs.h,v retrieving revision 1.13 diff -u -p -r1.13 helper_funcs.h --- controllers/helper_funcs.h 5 Sep 2002 15:14:21 -0000 1.13 +++ controllers/helper_funcs.h 20 Oct 2002 22:01:41 -0000 @@ -29,11 +29,14 @@ class LyXView; pattern: *.ps etc. dir1 = (name, dir), dir2 = (name, dir): extra buttons on the dialog. */ -string const browseFile(LyXView *lv, string const & filename, - string const & title, - string const & pattern, - std::pair<string,string> const & dir1 = std::make_pair(string(), string()), - std::pair<string,string> const & dir2 = std::make_pair(string(), string())); +string const +browseFile(LyXView *lv, string const & filename, + string const & title, + string const & pattern, + std::pair<string,string> const & dir1 = + std::make_pair(string(), string()), + std::pair<string,string> const & dir2 = + std::make_pair(string(), string())); /* Wrapper around browseFile which tries to provide a filename @@ -42,12 +45,15 @@ string const browseFile(LyXView *lv, str of the form "../baz/foo.txt", an absolute path is returned. This is intended to be useful for insets which encapsulate files/ */ -string const browseRelFile(LyXView *lv, string const & filename, - string const & refpath, - string const & title, - string const & pattern, - std::pair<string,string> const & dir1 = std::make_pair(string(), string()), - std::pair<string,string> const & dir2 = std::make_pair(string(), string())); +string const +browseRelFile(LyXView *lv, string const & filename, + string const & refpath, + string const & title, + string const & pattern, + std::pair<string,string> const & dir1 = + std::make_pair(string(), string()), + std::pair<string,string> const & dir2 = + std::make_pair(string(), string())); /// Returns a vector of units that can be used to create a valid LaTeX length. @@ -58,7 +64,7 @@ std::vector<string> const getLatexUnits( vector<pair<A,B> > */ -namespace hide { +namespace detail { template<class Pair> struct firster { @@ -72,7 +78,7 @@ struct seconder { second_type const & operator()(Pair const & p) { return p.second; } }; -} +} // namespace detail /// template<class Pair> @@ -81,7 +87,7 @@ getFirst(std::vector<Pair> const & pr) { std::vector<typename Pair::first_type> tmp(pr.size()); std::transform(pr.begin(), pr.end(), tmp.begin(), - hide::firster<Pair>()); + detail::firster<Pair>()); return tmp; } @@ -92,7 +98,7 @@ getSecond(std::vector<Pair> const & pr) { std::vector<typename Pair::second_type> tmp(pr.size()); std::transform(pr.begin(), pr.end(), tmp.begin(), - hide::seconder<Pair>()); + detail::seconder<Pair>()); return tmp; } Index: controllers/tex_helpers.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/tex_helpers.C,v retrieving revision 1.6 diff -u -p -r1.6 tex_helpers.C --- controllers/tex_helpers.C 5 Sep 2002 15:14:21 -0000 1.6 +++ controllers/tex_helpers.C 20 Oct 2002 22:01:41 -0000 @@ -3,7 +3,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Herbert Voss + * \author Herbert Voss * * Full author contact details are available in file CREDITS */ @@ -42,12 +42,12 @@ vector<string> listWithoutPath(vector<st { vector<string>::iterator it = dbase.begin(); vector<string>::iterator end = dbase.end(); - for (; it != end; ++it) + for (; it != end; ++it) *it = OnlyFilename(*it); return dbase; } -} +} // namespace anon // build filelists of all availabe bst/cls/sty-files. done through // kpsewhich and an external script, saved in *Files.lst @@ -58,7 +58,6 @@ void rescanTexStyles() Systemcall one; one.startscript(Systemcall::Wait, LibFileSearch("scripts", "TeXFiles.sh")); - p.pop(); } @@ -69,20 +68,20 @@ void texhash() //path to texhash through system Systemcall one; - one.startscript(Systemcall::Wait,"texhash"); - p.pop(); + one.startscript(Systemcall::Wait,"texhash"); } + string const getTexFileList(string const & filename, bool withFullPath) { string const file = LibFileSearch("", filename); if (file.empty()) return string(); - + vector<string> dbase = getVectorFromString(GetFileContents(file), "\n"); - lyx::eliminate_duplicates(dbase); + lyx::eliminate_duplicates(dbase); string const str_out = withFullPath ? getStringFromVector(dbase, "\n") : getStringFromVector(listWithoutPath(dbase), "\n"); @@ -90,8 +89,7 @@ string const getTexFileList(string const } -string const getListOfOptions(string const & classname, - string const & type) +string const getListOfOptions(string const & classname, string const & type) { string const filename = getTexFileFromList(classname,type); string optionList = string(); @@ -110,25 +108,28 @@ string const getListOfOptions(string con } -string const getTexFileFromList(string const & file, +string const getTexFileFromList(string const & file, string const & type) { string const file_ = (type == "cls") ? file + ".cls" : file + ".sty"; - + lyxerr << "Search for classfile " << file_ << endl; - - string const lstfile = (type == "cls") ? "clsFiles.lst" : "styFiles.lst"; - string const allClasses = GetFileContents(LibFileSearch(string(), lstfile)); + + string const lstfile = + ((type == "cls") ? "clsFiles.lst" : "styFiles.lst"); + string const allClasses = GetFileContents(LibFileSearch(string(), + lstfile)); int entries = 0; string classfile = token(allClasses, '\n', entries); int count = 0; - while ((!contains(classfile, file) || + while ((!contains(classfile, file) || (OnlyFilename(classfile) != file)) && (++count < 1000)) { classfile = token(allClasses, '\n', ++entries); } - + // now we have filename with full path lyxerr << "with full path: " << classfile << endl; + return classfile; } Index: controllers/tex_helpers.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/tex_helpers.h,v retrieving revision 1.5 diff -u -p -r1.5 tex_helpers.h --- controllers/tex_helpers.h 5 Sep 2002 15:14:21 -0000 1.5 +++ controllers/tex_helpers.h 20 Oct 2002 22:01:41 -0000 @@ -3,7 +3,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Herbert Voss + * \author Herbert Voss * * Full author contact details are available in file CREDITS */ Index: qt2/QPreamble.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QPreamble.C,v retrieving revision 1.7 diff -u -p -r1.7 QPreamble.C --- qt2/QPreamble.C 20 Oct 2002 01:48:28 -0000 1.7 +++ qt2/QPreamble.C 20 Oct 2002 22:01:41 -0000 @@ -52,5 +52,5 @@ void QPreamble::update_contents() void QPreamble::apply() { - controller().params() = dialog_->preambleLE->text().latin1(); + controller().params(dialog_->preambleLE->text().latin1()); } Index: qt2/QVCLog.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QVCLog.C,v retrieving revision 1.7 diff -u -p -r1.7 QVCLog.C --- qt2/QVCLog.C 20 Oct 2002 01:48:28 -0000 1.7 +++ qt2/QVCLog.C 20 Oct 2002 22:01:41 -0000 @@ -49,7 +49,8 @@ void QVCLog::update_contents() dialog_->vclogTV->setText(""); - stringstream ss; + ostringstream ss; + controller().getVCLogFile(ss); - dialog_->vclogTV->setText(controller().getVCLogFile(ss).str().c_str()); + dialog_->vclogTV->setText(ss.str().c_str()); } Index: xforms/FormAboutlyx.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormAboutlyx.C,v retrieving revision 1.16 diff -u -p -r1.16 FormAboutlyx.C --- xforms/FormAboutlyx.C 3 Oct 2002 17:20:28 -0000 1.16 +++ xforms/FormAboutlyx.C 20 Oct 2002 22:01:41 -0000 @@ -4,7 +4,7 @@ * Licence details can be found in the file COPYING. * * \author Edwin Leuven - * \author Angus Leeming + * \author Angus Leeming * * Full author contact details are available in file CREDITS */ @@ -56,9 +56,11 @@ void FormAboutlyx::build() // create credits credits_.reset(build_aboutlyx_credits(this)); - stringstream ss; + ostringstream ss; + controller().getCredits(ss); + fl_add_browser_line(credits_->browser_credits, - controller().getCredits(ss).str().c_str()); + ss.str().c_str()); // stack tabs fl_addto_tabfolder(dialog_->tabfolder,_("Copyright and Version"), Index: xforms/FormPreamble.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormPreamble.C,v retrieving revision 1.19 diff -u -p -r1.19 FormPreamble.C --- xforms/FormPreamble.C 5 Sep 2002 15:14:22 -0000 1.19 +++ xforms/FormPreamble.C 20 Oct 2002 22:01:41 -0000 @@ -46,7 +46,7 @@ void FormPreamble::build() void FormPreamble::apply() { - controller().params() = fl_get_input(dialog_->input_preamble); + controller().params(fl_get_input(dialog_->input_preamble)); } Index: xforms/FormVCLog.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormVCLog.C,v retrieving revision 1.16 diff -u -p -r1.16 FormVCLog.C --- xforms/FormVCLog.C 5 Sep 2002 15:14:23 -0000 1.16 +++ xforms/FormVCLog.C 20 Oct 2002 22:01:41 -0000 @@ -22,6 +22,7 @@ #include "gettext.h" #include FORMS_H_LOCATION + FormVCLog::FormVCLog() : FormCB<ControlVCLog, FormBrowser>(_("Version Control Log")) {} @@ -32,7 +33,8 @@ void FormVCLog::update() fl_clear_browser(dialog_->browser); stringstream ss; + controller().getVCLogFile(ss); fl_add_browser_line(dialog_->browser, - controller().getVCLogFile(ss).str().c_str()); + ss.str().c_str()); }
-- Lgb