]> git.lyx.org Git - lyx.git/commitdiff
ws fixes, formatting and some other small changes
authorLars Gullik Bjønnes <larsbj@gullik.org>
Mon, 21 Oct 2002 17:38:09 +0000 (17:38 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Mon, 21 Oct 2002 17:38:09 +0000 (17:38 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5463 a592a061-630c-0410-9148-cb99ea01b6c8

83 files changed:
src/frontends/WorkArea.h
src/frontends/controllers/ButtonController.h
src/frontends/controllers/ButtonControllerBase.C
src/frontends/controllers/ButtonControllerBase.h
src/frontends/controllers/ButtonPolicies.h
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlAboutlyx.C
src/frontends/controllers/ControlAboutlyx.h
src/frontends/controllers/ControlBibitem.h
src/frontends/controllers/ControlBibtex.C
src/frontends/controllers/ControlBibtex.h
src/frontends/controllers/ControlButtons.C
src/frontends/controllers/ControlButtons.h
src/frontends/controllers/ControlCharacter.h
src/frontends/controllers/ControlCitation.C
src/frontends/controllers/ControlCitation.h
src/frontends/controllers/ControlCommand.h
src/frontends/controllers/ControlCommandBuffer.C
src/frontends/controllers/ControlCommandBuffer.h
src/frontends/controllers/ControlConnections.C
src/frontends/controllers/ControlConnections.h
src/frontends/controllers/ControlDialog.h
src/frontends/controllers/ControlDialog_impl.C
src/frontends/controllers/ControlDialog_impl.h
src/frontends/controllers/ControlDocument.C
src/frontends/controllers/ControlERT.h
src/frontends/controllers/ControlError.h
src/frontends/controllers/ControlExternal.C
src/frontends/controllers/ControlExternal.h
src/frontends/controllers/ControlForks.h
src/frontends/controllers/ControlGraphics.C
src/frontends/controllers/ControlGraphics.h
src/frontends/controllers/ControlInclude.C
src/frontends/controllers/ControlInclude.h
src/frontends/controllers/ControlInset.h
src/frontends/controllers/ControlLog.h
src/frontends/controllers/ControlMinipage.C
src/frontends/controllers/ControlMinipage.h
src/frontends/controllers/ControlParagraph.C
src/frontends/controllers/ControlParagraph.h
src/frontends/controllers/ControlPreamble.C
src/frontends/controllers/ControlPreamble.h
src/frontends/controllers/ControlPrint.h
src/frontends/controllers/ControlRef.h
src/frontends/controllers/ControlSearch.h
src/frontends/controllers/ControlSendto.h
src/frontends/controllers/ControlShowFile.C
src/frontends/controllers/ControlShowFile.h
src/frontends/controllers/ControlSpellchecker.C
src/frontends/controllers/ControlSpellchecker.h
src/frontends/controllers/ControlTabularCreate.h
src/frontends/controllers/ControlTexinfo.C
src/frontends/controllers/ControlTexinfo.h
src/frontends/controllers/ControlToc.C
src/frontends/controllers/ControlToc.h
src/frontends/controllers/ControlVCLog.C
src/frontends/controllers/ControlVCLog.h
src/frontends/controllers/ControlWrap.C
src/frontends/controllers/ControlWrap.h
src/frontends/controllers/GUI.h
src/frontends/controllers/ViewBase.h
src/frontends/controllers/biblio.C
src/frontends/controllers/biblio.h
src/frontends/controllers/character.C
src/frontends/controllers/character.h
src/frontends/controllers/frnt_lang.C
src/frontends/controllers/frnt_lang.h
src/frontends/controllers/helper_funcs.C
src/frontends/controllers/helper_funcs.h
src/frontends/controllers/tex_helpers.C
src/frontends/controllers/tex_helpers.h
src/frontends/qt2/ChangeLog
src/frontends/qt2/QPreamble.C
src/frontends/qt2/QVCLog.C
src/frontends/xforms/ChangeLog
src/frontends/xforms/FormAboutlyx.C
src/frontends/xforms/FormLog.C
src/frontends/xforms/FormPreamble.C
src/frontends/xforms/FormVCLog.C
src/frontends/xforms/WorkAreaFactory.C
src/frontends/xforms/XWorkArea.C
src/frontends/xforms/XWorkArea.h
src/frontends/xforms/xfont_loader.C

index 02048ff535898f10d7da0f41552ea8693535751c..cb54cff3c442dee817d9eebb588554ad08f4436e 100644 (file)
@@ -5,7 +5,7 @@
  * Licence details can be found in the file COPYING.
  *
  * \author unknown
- * \author John Levon 
+ * \author John Levon
  *
  * Full author contact details are available in file CREDITS
  */
index 2abda38a1677751bf84194af28b0f12c1c7132b3..53100c2b712d1d7e6ede37f2587f7c7c0f8eb178 100644 (file)
@@ -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 1c8dbed0e1a6906c3fff5a8a0ba1927af1779cc1..729c0a08522dbefb3e4802daecb9850fe8bdac4b 100644 (file)
@@ -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 4885e4e840e1b2fc79b10649efe09159bbbe797f..46dd059c07d2b5015e6920024bcbfc35499c2492 100644 (file)
@@ -29,8 +29,7 @@
  * This abstract base class stripped of xforms-specific code by
  * Angus Leeming <leeming@lyx.org>
  */
-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 c8d510b6c9e888255679bf876290b9cf0839d021..42c10223f3bcf8b91a2ca6f19c627e0d9d80fe15 100644 (file)
@@ -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 dda37955aa211e22a3a5a37c0a96b12593bb854f..a0c8c490f27c3a705a4c8f5415fd7c5f38daa3f6 100644 (file)
@@ -1,3 +1,29 @@
+2002-10-21  Lars Gullik Bjønnes  <larsbj@birdstep.com>
+
+       * tex_helpers.C (rescanTexStyles): don't pop p
+       (texhash): ditto
+
+       * ControlWrap.C (WrapParms): remove initialization of placement,
+       and move empty c-tor to .h class def.
+
+       * ControlVCLog.C (getVCLogFile): operator on std::ostream instead
+       of on stringsteam, return void. Get the file into the stream as
+       fast as possible.
+
+       * ControlPreamble.[Ch] (params): getter and setter for params_, make
+       params_ into a string, not just a pointer to string.
+
+       * ControlExternal.C (getTemplateNumber): put i into the for scope,
+       and use the sequence operator on the last for "parameter"
+       (getTemplate): use std::advance to advance the iterator.
+
+       * ControlAboutlyx.C (getCredits): Operate on s std::ostream
+       instead of on a stringstream, return void. Get the file into the
+       stream as fast as possible.
+       (getVersion): use ostringstream
+
+       * lots of files: ws changes, formatting fixes
+
 2002-10-20  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * ControlCharacter.C (apply): setMinibuffer change
index b1e3d44c0967e45c62ecdc0831ead66eef46cb24..0a2fdf20510c7397f7d2d5667231c43e71f0e29e 100644 (file)
  */
 
 #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 "support/LOstream.h"
+#include "support/filetools.h" // FileSearch
+
+#include <fstream>
+
+using std::ostream;
 
 // needed for the browser
 extern string system_lyxdir;
@@ -32,7 +37,7 @@ ControlAboutlyx::ControlAboutlyx(LyXView & lv, Dialogs & d)
 {}
 
 
-stringstream & ControlAboutlyx::getCredits(stringstream & ss) const
+void ControlAboutlyx::getCredits(ostream & ss) const
 {
        string const name = FileSearch(system_lyxdir, "CREDITS");
 
@@ -40,14 +45,9 @@ stringstream & ControlAboutlyx::getCredits(stringstream & ss) const
 
        if (found) {
                std::ifstream in(name.c_str());
-               found = (in.get());
 
-               if (found) {
-                       in.seekg(0, std::ios::beg); // rewind to the beginning
-
-                       ss << in.rdbuf();
-                       found = (ss.good());
-               }
+               ss << in.rdbuf();
+               found = ss.good();
        }
 
        if (!found) {
@@ -55,8 +55,6 @@ stringstream & ControlAboutlyx::getCredits(stringstream & ss) const
                   << _("Please install correctly to estimate the great\n")
                   << _("amount of work other people have done for the LyX project.");
        }
-
-       return ss;
 }
 
 
@@ -80,7 +78,7 @@ string const ControlAboutlyx::getDisclaimer() const
 
 string const ControlAboutlyx::getVersion() const
 {
-       stringstream ss;
+       ostringstream ss;
 
        ss << _("LyX Version ")
           << lyx_version
index 6126d91f508a0af2b740275f50b09d205d584854..e0b184e098c355adcc291e4538d557e288561a09 100644 (file)
@@ -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
  */
 #endif
 
 #include "ControlDialog_impl.h"
-#include "Lsstream.h"
 #include "LString.h"
 
+#include <iosfwd>
+
 /** A controller for the About LyX dialogs.
  */
 class ControlAboutlyx : public ControlDialogBI {
@@ -29,7 +30,7 @@ public:
        ControlAboutlyx(LyXView &, Dialogs &);
 
        ///
-       stringstream & getCredits(stringstream &) const;
+       void getCredits(std::ostream &) const;
 
        ///
        string const getCopyright() const;
@@ -42,8 +43,6 @@ public:
 
        ///
        string const getVersion() const;
-
-
 private:
        /// not needed.
        virtual void apply() {}
index 3172e3afea6f0fb19e1591b438211fe87dc222e3..9d454d24e44c6ae918f80eec7e51be80f58371e0 100644 (file)
@@ -25,7 +25,6 @@ class ControlBibitem : public ControlCommand {
 public:
        ///
        ControlBibitem(LyXView &, Dialogs &);
-
 private:
        /// Dispatch the changed parameters to the kernel.
        virtual void applyParamsToInset();
index dedfa3ac5508818f0d86b186a6a6456dd531da84..a6833fca2948bf0d9920ef839db62cb1d7fa9c06 100644 (file)
@@ -60,7 +60,8 @@ string const ControlBibtex::Browse(string const & in_name,
                                   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 1a5f0e57f700409bb4b46fccca530ff284633515..7cf7451e99313e61381bf28086761c3f3a2aaf34 100644 (file)
@@ -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 49c198eae4924dc139996c796d28244230fabd39..528df1da578f18183ba7d539691b14116a35c1b6 100644 (file)
@@ -87,4 +87,3 @@ void ControlButtons::setButtonController(ButtonControllerBase & bc)
 {
        bc_ptr_ = &bc;
 }
-
index 59b1cc7356fe0a70004ca257359cdb8781728a0a..f98ced9e7ead88e664558dba4a08c073d2f76f6a 100644 (file)
@@ -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 e32aa3e590c08840a8d75887981d91bc399ad526..e36f42b1b694a28e6f865702a09eca087c589110 100644 (file)
@@ -23,8 +23,7 @@
 
 /** A controller for Character dialogs.
  */
-class ControlCharacter : public ControlDialogBD
-{
+class ControlCharacter : public ControlDialogBD {
 public:
        ///
        ControlCharacter(LyXView &, Dialogs &);
index 789574e5c7a2776c2474c2c59e2bbbded6504d7d..79e55eb9fca2964662a886ee1981a4f7927035e4 100644 (file)
@@ -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 96b40fbb29b373858b15214fd4fea33e50fc287e..e286eac1cc28fbc72f2b9b798884feaa813e7368 100644 (file)
@@ -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 622c5828e32e0a8d8431a2bc75b6bcbe59452c3b..383d5f748e0a2e2eca0995610eb0bdf672998b53 100644 (file)
 /** 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 fe41892aced3412645c5d34dbb9a2480d1a98b97..d4b82c73a426e33fc5efa88663e1c84225ab801e 100644 (file)
@@ -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::historyDown()
 }
 
 
-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 ControlCommandBuffer::completions(string const & prefix, st
                }
                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 796d6b4bf99c8d050c21fb09282c58fc4781e2a6..9c0c13dc7bd9740737fa1e0809d9e49af54ac3de 100644 (file)
@@ -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 4bfbded601b87b674f5679cf81744b5a6885e646..3910341f84865e1657a3f57150d72a84164eb60f 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <boost/bind.hpp>
 
+
 ControlConnectBase::ControlConnectBase(LyXView & lv, Dialogs & d)
        : lv_(lv), d_(d)
 {}
index 7e1ce25b6d4f6e3b73252b18f4fe5107b26055a9..9b1b2ce1f6b62202e2892dcaaf540b34451bcdeb 100644 (file)
@@ -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 f93d5b9f5566c8345127e9d4e0047346a7940ea8..e6a5e3657e4d380fe4b732e74842e0fc5a778806 100644 (file)
@@ -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 6488a9b85590fb60958dcd33a6a85be4ecf0ef05..d3f01ab2eb4a7251df80b99dbed39e96f72f089c 100644 (file)
@@ -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
  */
@@ -13,6 +13,7 @@
 #include "ControlDialog_impl.h"
 #include "ControlDialog.tmpl"
 
+
 ControlDialogBD::ControlDialogBD(LyXView & lv, Dialogs & d)
        : ControlDialog<ControlConnectBD>(lv, d)
 {}
index 4d7bbc1c4800dfd6b587840e780c1987ccf21bbd..8e374d7c5c4910c2769250496e2f629948002eea 100644 (file)
@@ -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 55c05315d1d9d8115c36f816897424396435e812..4a53d336f31e8e076b358092f9c659fd7620e96e 100644 (file)
@@ -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;
@@ -142,6 +144,7 @@ bool ControlDocument::classApply()
        return true;
 }
 
+
 void ControlDocument::saveAsDefault()
 {
        lv_.buffer()->params.preamble = bp_->preamble;
index a75b9efb25e153b11e83fe78accbc83e14656999..d56809a556560428adfa840dce4c3bf6c65cf079 100644 (file)
@@ -47,7 +47,6 @@ class ControlERT : public ControlInset<InsetERT, ERTParams>  {
 public:
        ///
        ControlERT(LyXView &, Dialogs &);
-
 private:
        /// Dispatch the changed parameters to the kernel.
        virtual void applyParamsToInset();
index 2c63406634c5543868bdeddf3e2ebc47e4477c94..dc774f9b62483f2739d9686fb76d7dbba39b494a 100644 (file)
@@ -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 0ddd07102cc51b3143631d858b4b5c01251039be..3c613af0232a455a4b9889b38dc7a4f1d61c2962 100644 (file)
@@ -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 ControlExternal::getParams(string const &)
        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::getTemplates() const
 
 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,10 +127,10 @@ int ControlExternal::getTemplateNumber(string const & name) const
 
 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();
+
+       std::advance(i1,  i);
 
        return i1->second;
 }
index b8c19ca6d7c48a37249e1fb64280f0c5b8732cc3..935515a5819f585580da891f8349a3898e10a815 100644 (file)
@@ -44,7 +44,6 @@ public:
        ExternalTemplate getTemplate(int) const;
        ///
        string const Browse(string const &) const;
-
 private:
        ///
        virtual void applyParamsToInset();
index 0cb0c1fc9b4a272647d0a8a8477f4af0f8732629..148315abec9ebe9af31e5a1d52e3466bbdeebf63 100644 (file)
@@ -37,7 +37,6 @@ public:
        string const getCommand(pid_t) const;
        ///
        void kill(pid_t);
-
 private:
        ///
        virtual void apply();
index 8f48fb765ccf1291c07b89d7d8c43a6d08ed0781..c762a4cb7f331e62132ea0a763fe284c066e7e1c 100644 (file)
@@ -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)
 {}
@@ -74,11 +79,6 @@ 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)
 {
        string const title = _("Select graphics file");
index 13a5e4365a959c43f9fe9b12055639cf92a10957..9387bfd2f700bcd55be704a502d25a4fc51eadec 100644 (file)
@@ -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 d8f9c7d2b16cce9a8b5ce44606277ad6ad347060..3bcb204b7619b6d21c2b08e244abf96738310b69 100644 (file)
@@ -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 const & file)
 
        if (IsFileReadable(fileWithAbsPath))
                return true;
-       
+
        return false;
 }
index 7dc4d3f00445ab8a047288c120264c7b5b5ac14c..3b6fa01c8491a0dfab89cb1280f5e8e484d96c5e 100644 (file)
@@ -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 8a5e8e9b2985ce239a6fffe7664c80bd1ca7b06b..99236cdc84321118cfa7b6a74d938cd4e77a61a3 100644 (file)
@@ -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 464c992da053ab66a49de08beb4078442d669eba..821fa3418481602486e94cfa088eb4ca74755c0f 100644 (file)
@@ -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 67bc51ce199049f9023a6b8e613ce5bd94598dcc..a8db010c82c0b30b7d7067438099383b73ca28a4 100644 (file)
@@ -48,6 +48,7 @@ MinipageParams::MinipageParams()
        : pos(InsetMinipage::top)
 {}
 
+
 MinipageParams::MinipageParams(InsetMinipage const & inset)
        : pageWidth(inset.pageWidth()), pos(inset.pos())
 {}
index f72ba6242d8aa23602944f3dcb64f94bbfc7e580..cbcf82ef428d4dbc4bee9ade51d54552b6b1bb2d 100644 (file)
@@ -49,7 +49,6 @@ class ControlMinipage : public ControlInset<InsetMinipage, MinipageParams>  {
 public:
        ///
        ControlMinipage(LyXView &, Dialogs &);
-
 private:
        /// Dispatch the changed parameters to the kernel.
        virtual void applyParamsToInset();
index 8b41e4b95a1d3aff5f80a07fb15f943a510a2630..958da3e2d9f83515891c0b77388f3cb620132fa5 100644 (file)
@@ -117,6 +117,7 @@ void ControlParagraph::setParams()
        ininset_ = par_->inInset();
 }
 
+
 void ControlParagraph::changedParagraph()
 {
        /// get paragraph
index d9827872e5e09bc95d70e626da3af0ad37b730a5..aba83416412bd4b90315c57f375dca728e08d858 100644 (file)
@@ -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 779c9a7f819ab7d2de0b79238d592ed850731874..4776cbe88646f4d5e69e91d1af4388b20e584fc9 100644 (file)
@@ -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 3f62fbde70a4d40d210e56efbc93ad51dad4511a..2dbc19397d953cb4629cc8d265ccb1193630fd6f 100644 (file)
@@ -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 d0c16fbcc95b1d3de1fd965482074a071d0a5c25..ef42a1cb1a1a8a95edfcb2800a50204a978cdbed 100644 (file)
@@ -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 5882e5a244bee928bc0494500dfa519250003d9b..3deec4d172b2dc7a0a49705305cc5011e2f8be63 100644 (file)
@@ -24,7 +24,6 @@ class ControlRef : public ControlCommand {
 public:
        ///
        ControlRef(LyXView &, Dialogs &);
-
        ///
        std::vector<string> const getLabelList(string const &) const;
        ///
index 14420011f3208d03725f7f24fb5516617db93f13..7cf08414a68dcf6ee45b4102e882a53a7e85a476 100644 (file)
@@ -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 ec8a6361cafc94f3c2fa2c9ca1037b343e8434b7..073e37e066226649c275070d3213bd69100fc20a 100644 (file)
@@ -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 2b0d4063e980694c50b787aa37ef02128567e7d8..b95351316fec4d95c6312baab1610c5b89e7e1d6 100644 (file)
@@ -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 da075fcf45a94faa88de50a5159fcdc84e3bf253..862b37a1b07f862211d25cd8d64c3a2502244920 100644 (file)
@@ -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 2798f52f1b89a21ba7175d9ce51d613195f758cd..49f8c6b877898ec49ceee75950d766401d552f43 100644 (file)
@@ -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(LyXView & lv, Dialogs & d)
 
 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 const & replacement)
 {
        bufferview()->replaceWord(replacement);
        // fix up the count
-       --count_;
+       --count_;
        check();
 }
 
index 92e9a6ab27d6d7b22a2386c7fa3100764b1d52cf..c1444e14f9f0ecfe6fd68861af3b51391a6476a9 100644 (file)
@@ -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 48bfd0720b00033d5a469d96fb9c6b846e807c05..cabeae367c71aaba6752c1a17b19b5920950db56 100644 (file)
@@ -31,7 +31,6 @@ public:
 
        ///
        rowsCols & params();
-
 private:
        /// Apply from dialog
        virtual void apply();
index c0f5e4124e15a92d91d376c209f626b7ddf6f699..5f79eeb5ea0561e0ea1e139acce820c77cf56fcb 100644 (file)
@@ -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::texFileSuffix type, bool withFullPath)
        }
        return string();
 }
-}
+
+} // namespace anon
+
 
 ControlTexinfo::ControlTexinfo(LyXView & lv, Dialogs & d)
        : ControlDialogBI(lv, d)
index c7d38a876a6387dd652f2d514145168c649bcdf4..7b9930e67835115b9be1080683de80bfd41e76c1 100644 (file)
@@ -37,8 +37,6 @@ public:
        void runTexhash() const;
        /// read filecontents
        string const getContents(texFileSuffix type, bool withPath) const;
-
-
 private:
        ///
        virtual void apply() {}
index ff354b19f7ad42639ed5a9dc8dbbfa0d93fe6fd5..24c28b83430e13713c92c85c7720e07951503b54 100644 (file)
@@ -23,6 +23,7 @@ using std::vector;
 
 class Buffer;
 
+
 ControlToc::ControlToc(LyXView & lv, Dialogs & d)
        : ControlCommand(lv, d, LFUN_TOC_INSERT)
 {}
index f55cc602233ec07f83d9c14ef5880f6cb27e6481..edb430db3b8ee802751a1bd698f7cfd1e9640d94 100644 (file)
@@ -22,8 +22,7 @@
 
 /** A controller for TOC dialogs.
  */
-class ControlToc : public ControlCommand
-{
+class ControlToc : public ControlCommand {
 public:
        ///
        ControlToc(LyXView &, Dialogs &);
index 71cdd7814ace3f067f2e12623bb71d7d1ac4aed9..f3aa2417fcd25c0d12a881fc66a67ad090e80d87 100644 (file)
 #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,17 +40,15 @@ string const ControlVCLog::getBufferFileName() const
 }
 
 
-stringstream & ControlVCLog::getVCLogFile(stringstream & ss) const
+void ControlVCLog::getVCLogFile(ostream & ss) const
 {
        string const name = buffer()->lyxvc.getLogFile();
 
        std::ifstream in(name.c_str());
 
-       bool found = (in.get());
-
-       if (found) {
-               in.seekg(0, std::ios::beg); // rewind to the beginning
+       bool found(false);
 
+       if (in) {
                ss << in.rdbuf();
                found = ss.good();
        }
@@ -60,6 +57,4 @@ stringstream & ControlVCLog::getVCLogFile(stringstream & ss) const
                ss << _("No version control log file found.") << endl;
 
        lyx::unlink(name);
-
-       return ss;
 }
index d0d801203393577f3c62100bb0d3bfd11547292a..7955910a42f4e38083942a383a5dd52f805c46e6 100644 (file)
@@ -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 ControlDialogBD {
 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 41b6c83e166673401c83a3ec6c56d3dde4cea7e8..aaccb5ae6777ab482145ec24566045ff0ebb5ec1 100644 (file)
@@ -44,11 +44,6 @@ WrapParams const ControlWrap::getParams(InsetWrap const & inset)
 }
 
 
-WrapParams::WrapParams()
-       : placement("")
-{}
-
-
 WrapParams::WrapParams(InsetWrap const & inset)
        : pageWidth(inset.pageWidth()),
          placement(inset.placement())
index df42b3abad1d0e5177ad6c9e87712b328ea140a5..2615f84fc2469437bf31bf0e37a1883bb6ad73a2 100644 (file)
@@ -27,7 +27,7 @@ class InsetWrap;
 ///
 struct WrapParams {
        ///
-       WrapParams();
+       WrapParams() {}
        ///
        WrapParams(InsetWrap const &);
        ///
index e7d01fe3847e07e2450553cbb19822098cebf06d..b8b364c9d187864ea554cc041fd943591ab8cc10 100644 (file)
@@ -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 4d117feadbb4608d2eb1fbaf0ae4c7f6e5b48914..f20e16a56355733af730b2bd12b619efe272fdf9 100644 (file)
@@ -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 d99d4d70c7b0bb433dc04a57c5cfd33666ce87b4..5c2371a5bc6ad7de6584711f458f1e8d14119416 100644 (file)
@@ -31,8 +31,7 @@ using std::min;
 using std::vector;
 using std::sort;
 
-namespace biblio
-{
+namespace biblio {
 
 namespace {
 
index 6a2c3a2330d6cc4c25984dfc4f624d2ca3400f82..7271b82d0f396bd529abbd9b7e27f84b1ff0858d 100644 (file)
 #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 {
        ///
-       enum CiteStyle {
-               CITE,
-               CITET,
-               CITEP,
-               CITEALT,
-               CITEALP,
-               CITEAUTHOR,
-               CITEYEAR,
-               CITEYEARPAR
-       };
+       SIMPLE,
        ///
-       enum Search {
-               ///
-               SIMPLE,
-               ///
-               REGEX
-       };
+       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 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 5aa9ffc9e1b290bd2c03f0e3484e669410d77014..b4a5f746fed42376561345ae7d688034903e73dd 100644 (file)
@@ -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 67478c143c531083add0d881d2948f889471612b..d145376a232519a2fd05aada463667fc0a8333dd 100644 (file)
 
 /** 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 5ed06b906b14d4d86ed693a07883f2a55f590aae..d49e7c088fef9123e7b9f88207cedeb01ae921d1 100644 (file)
@@ -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 getLanguageData(bool character_dlg)
        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 37e6175293c30a980a96c67da6a46db0cf865267..4cd9d9f5df9984147951ef348f4cc126cc1644ba 100644 (file)
@@ -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
  */
 /** 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 7e33ff95c15a2aa99974d71074f85dcce0209bab..f189856d6db2dfaaa19ceada4a03aab59aa3b20a 100644 (file)
@@ -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, string const & filename,
 
        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 59b1a22f169f4803d177960b0e9c12601f449567..440ebca3fed5d3e513f0270a590382f7516e6d2c 100644 (file)
@@ -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, string const & filename,
    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 59677a859559bcb7f2c2df9e3775afa293502ba7..836c0e0340d64d3a14676ad0d0d40531ebaf3317 100644 (file)
@@ -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<string> & dbase)
 {
        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 & filename, bool withFullPath)
 }
 
 
-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 const & classname,
 }
 
 
-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 60414a39d612fe6591c8a87d2a0505a28b1ed9c9..4c2722749f94f39df95a7ec9177ce8a172e58678 100644 (file)
@@ -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 1273f3ebd3453d4a10145172cd758fd7f2630bdb..a52b583522e3ea65f7613c169d4a0b6f9146e9be 100644 (file)
@@ -1,3 +1,9 @@
+2002-10-21  Lars Gullik Bjønnes  <larsbj@birdstep.com>
+
+       * QVCLog.C (update_contents): modify
+
+       * QPreamble.C (apply): modify
+
 2002-10-21  Dekel Tsur  <dekelts@tau.ac.il>
 
        * qfont_metrics.C (ascent): Fix returned value.
@@ -5,7 +11,7 @@
 2002-10-21  Philippe Elie  <phil.el@wanadoo.fr>
 
        * QContentPane.h:
-       * QContentPane.C: implement wheelEvent  
+       * QContentPane.C: implement wheelEvent
 
 2002-10-20  Dekel Tsur  <dekelts@tau.ac.il>
 
@@ -15,7 +21,7 @@
 
        * ui/QDelimiterDialog.ui: remove two huge XPMs that
          were accidentally built in
+
 2002-10-20  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * Toolbar_pimpl.C (setLayout): initialize i to 0, don't
        * QAbout.C (build_dialog): fill the credits view in a bit more
        elegant way
 
-       * almost all files: clean up formatting and indenting. 
+       * almost all files: clean up formatting and indenting.
 
 2002-10-19  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
index 719a5af6d024e5be13ccfbf8b6bb96f67c54ee96..a0ef5391029b0d23faab4b2213b807d7b53454eb 100644 (file)
@@ -52,5 +52,5 @@ void QPreamble::update_contents()
 
 void QPreamble::apply()
 {
-       controller().params() = dialog_->preambleLE->text().latin1();
+       controller().params(dialog_->preambleLE->text().latin1());
 }
index 986769de202370eae850d716dbc81a676dbe4ab1..2d9592096fcb17ecb5cfc9f702afbd2a070f0af2 100644 (file)
@@ -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 5245395960828411cfaa724b5e73d55bb8f47cc1..ed07eefac432495ba3b19fd5fe319baf855b16bd 100644 (file)
@@ -1,3 +1,13 @@
+2002-10-21  Lars Gullik Bjønnes  <larsbj@birdstep.com>
+
+       * FormVCLog.C (update): modify, use ostringstream
+
+       * FormPreamble.C (apply): modify
+
+       * FormLog.C (update): modify
+
+       * FormAboutlyx.C (build): use ostringstream, modify
+
 2002-10-21  Angus Leeming  <leeming@lyx.org>
 
        * xformsImage.C (rotate): pass ints to flimage_rotate, fixing compiler
index cfb7d625f9910700e776e9d4ed82ad644a33615a..ed3786ae27ac1ed5734cc6789afc7424a07b976f 100644 (file)
@@ -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,9 @@ void FormAboutlyx::build()
 
        // create credits
        credits_.reset(build_aboutlyx_credits(this));
-       stringstream ss;
-       fl_add_browser_line(credits_->browser_credits,
-                           controller().getCredits(ss).str().c_str());
+       ostringstream ss;
+       controller().getCredits(ss);
+       fl_add_browser_line(credits_->browser_credits, ss.str().c_str());
 
        // stack tabs
        fl_addto_tabfolder(dialog_->tabfolder,_("Copyright and Version"),
index c395ddd4019d92300dff1bb9bccb468b8e38ae96..ecba38a962be23f44a2c6233bcb72b24cf80a91b 100644 (file)
@@ -30,18 +30,13 @@ void FormLog::update()
 {
        fl_clear_browser(dialog_->browser);
 
-       if (controller().logfile().first == Buffer::buildlog) {
-               fl_set_form_title(dialog_->form, _("Build log"));
-               if (!fl_load_browser(dialog_->browser,
-                                    controller().logfile().second.c_str()))
-                       fl_add_browser_line(dialog_->browser,
-                                           _("No build log file found"));
-               return;
-       }
-
-       fl_set_form_title(dialog_->form, _("LaTeX Log"));
+       bool buildlog = (controller().logfile().first == Buffer::buildlog);
+
+       fl_set_form_title(dialog_->form,
+                         buildlog ? _("Build log") : _("LaTeX Log"));
        if (!fl_load_browser(dialog_->browser,
                             controller().logfile().second.c_str()))
                fl_add_browser_line(dialog_->browser,
-                                   _("No LaTeX log file found"));
+                                   buildlog ? _("No build log file found")
+                                   : _("No LaTeX log file found"));
 }
index 189ed052fa8d1e7b61455011804e3fe6d867b376..16c15c11cc5476b367dde358b3bfb94dab6ead93 100644 (file)
@@ -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 40be46701568c5fb87f037fdc2319b06d186a563..948afbaf45a189687806fa6189f8bd06333dc8dc 100644 (file)
@@ -22,6 +22,7 @@
 #include "gettext.h"
 #include FORMS_H_LOCATION
 
+
 FormVCLog::FormVCLog()
        : FormCB<ControlVCLog, FormBrowser>(_("Version Control Log"))
 {}
@@ -31,8 +32,9 @@ void FormVCLog::update()
 {
        fl_clear_browser(dialog_->browser);
 
-       stringstream ss;
+       ostringstream ss;
+       controller().getVCLogFile(ss);
 
        fl_add_browser_line(dialog_->browser,
-                           controller().getVCLogFile(ss).str().c_str());
+                           ss.str().c_str());
 }
index ca29cc4d8a9d402bfdc12d95e42f338859d8ac49..061226b01ae7597216c6afb5a316cfb5d53b94f5 100644 (file)
@@ -3,22 +3,22 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author John Levon 
+ * \author John Levon
  *
  * Full author contact details are available in file CREDITS
  */
 
 #include <config.h>
+
 #include "frontends/WorkAreaFactory.h"
+
 #include "XWorkArea.h"
+
 namespace WorkAreaFactory {
+
 WorkArea * create(int x, int y, int w, int h)
 {
        return new XWorkArea(x, y, w, h);
 }
+
 }
index ff3a66e532b4a43ac6b3077a5fe3beb019782d5b..b616c6aa7d627cdcdecbf1ea655a93973a8ddfee 100644 (file)
@@ -4,7 +4,7 @@
  * Licence details can be found in the file COPYING.
  *
  * \author unknown
- * \author John Levon 
+ * \author John Levon
  *
  * Full author contact details are available in file CREDITS
  */
@@ -386,7 +386,7 @@ int XWorkArea::work_area_handler(FL_OBJECT * ob, int event,
                                        ev->xbutton.y - ob->y,
                                        x_button_state(key));
                        area->dispatch(cmd);
-                       
+
                }
                break;
 #if FL_VERSION < 1 && FL_REVISION < 89
index 7136ad8fab7426a9d94e8ea696eeee04d5861e64..b0858f081d8e09a65eaaa756ee6ae5384d728fb7 100644 (file)
@@ -5,7 +5,7 @@
  * Licence details can be found in the file COPYING.
  *
  * \author unknown
- * \author John Levon 
+ * \author John Levon
  *
  * Full author contact details are available in file CREDITS
  */
@@ -69,7 +69,7 @@ private:
 
        /// GC used for copying to the screen
        GC copy_gc;
+
        ///
        FL_OBJECT * backgroundbox;
        /// the workarea free object
index 1e4305ebe75c3b0abf588c894b5bb586586251dd..f31a7e0cdcdb96546d52b30a0965d89dead4abf3 100644 (file)
@@ -282,8 +282,9 @@ XFontStruct * xfont_loader::doLoad(LyXFont::FONT_FAMILY family,
        }
 
        getFontinfo(family, series, shape);
+       // FIXME! CHECK! Should we use 72.0 or 72.27? (Lgb)
        int fsize = int((lyxrc.font_sizes[size] * lyxrc.dpi *
-                         (lyxrc.zoom/100.0)) / 72.27 + 0.5);
+                         (lyxrc.zoom/100.0)) / 72..27 + 0.5);
 
        string font = fontinfo[family][series][shape]->getFontname(fsize);