src/frontends/qt2/QVCLog.C
src/frontends/xforms/Alert_pimpl.C
src/frontends/xforms/combox.C
+src/frontends/xforms/FeedbackController.C
src/frontends/xforms/FileDialog.C
src/frontends/xforms/form_aboutlyx.C
src/frontends/xforms/FormAboutlyx.C
-src/frontends/xforms/FormBase.C
src/frontends/xforms/form_bibitem.C
src/frontends/xforms/FormBibitem.C
src/frontends/xforms/form_bibtex.C
src/lyxfunc.C
src/lyx_main.C
src/lyxrc.C
-src/LyXSendto.C
src/lyxtextclasslist.C
src/lyxvc.C
src/LyXView.C
+2002-03-10 Herbert Voss <voss@lyx.org>
+
+ * biblio.C (parseBibTeX): fix bug
+ (familyName): improve parsing
+
+2002-03-09 Herbert Voss <voss@lyx.org>
+
+ * ControlGraphics.[Ch]: adding checkFilename() for testing
+ of non-existing files
+
2002-03-07 Lars Gullik Bjønnes <larsbj@birdstep.com>
* ControlSendto.C (allFormats): fix a iterators are not pointers
2002-03-05 Herbert Voss <voss@lyx.org>
- biblio.C: (getInfo) simplify if using paragraph layout "bibliography".
+ * biblio.C (getInfo): simplify if using paragraph layout
+ "bibliography".
2002-03-05 Angus Leeming <a.leeming@ic.ac.uk>
#include "helper_funcs.h" // for browseFile
#include "support/lstrings.h"
#include "support/filetools.h" // for AddName, zippedFile
+#include "frontends/Alert.h"
#include "BufferView.h"
using std::pair;
}
+void ControlGraphics::checkFilename(string const & fname) {
+ if (!IsFileReadable(fname))
+ Alert::alert(_("Warning!"),
+ _("Filename") + ' '
+ + fname + _(" does not exist!"));
+
+}
string const readBB(string const & file);
/// Control the bb
bool bbChanged;
-
+ /// test if file exist
+ void checkFilename(string const & fname);
private:
/// Dispatch the changed parameters to the kernel.
virtual void applyParamsToInset();
// Very simple parser
string fname = name;
- string::size_type idx = fname.rfind(".");
+ // possible authorname combinations are:
+ // "Surname, FirstName"
+ // "Surname, F."
+ // "FirstName Surname"
+ // "F. Surname"
+ string::size_type idx = fname.find(",");
+ if (idx != string::npos)
+ return frontStrip(fname.substr(0,idx));
+ idx = fname.rfind(".");
if (idx != string::npos)
fname = frontStrip(fname.substr(idx+1));
-
+
return fname;
}
-
-
-
-
// A functor for use with std::sort, leading to case insensitive sorting
struct compareNoCase: public std::binary_function<string, string, bool>
{
string::size_type const idx =
dummy.empty() ? string::npos : dummy.find('%');
if (idx != string::npos) {
+ // ignore lines with a beginning '%'
if (idx > 0) {
- // This is safe. data MUST contain a '%'
data_ += dummy.substr(0,data.find('%'));
}
} else {
data = strip(data, '}');// maybe there is a main closing '}'
// happens, when last keyword
string::size_type const idx =
- data.empty() ? data.find('=') : string::npos;
+ !data.empty() ? data.find('=') : string::npos;
if (idx == string::npos)
return string();
- data = data.substr(idx, data.length() - 1);
+ data = data.substr(idx);
data = frontStrip(strip(data));
if (data.length() < 2 || data[0] != '=') { // a valid entry?
} else {
return data; // no {} and no "", pure data
}
- string tmp = data.substr(keypos, data.length()-1);
+ string tmp = data.substr(keypos);
while (tmp.find('{') != string::npos &&
tmp.find('}') != string::npos &&
tmp.find('{') < tmp.find('}') &&
tmp.find('{') < tmp.find(enclosing)) {
keypos += tmp.find('{') + 1;
- tmp = data.substr(keypos, data.length() - 1);
+ tmp = data.substr(keypos);
keypos += tmp.find('}') + 1;
- tmp = data.substr(keypos, data.length() - 1);
+ tmp = data.substr(keypos);
}
if (tmp.find(enclosing) == string::npos)
return data;
+2002-03-09 Herbert Voss <voss@lyx.org>
+
+ * FormGraphics.C: test if file exists, simplify an if command
+
+2002-03-10 John Levon <moz@compsoc.man.ac.uk>
+
+ * FormToc.C: make goto not reset the dialog
+
2002-03-08 Angus Leeming <a.leeming@ic.ac.uk>
* FeedbackController.[Ch]: new files, providing a standard interface to
#include "input_validators.h"
#include "debug.h" // for lyxerr
#include "support/lstrings.h" // for strToDbl & tostr
-#include "support/FileInfo.h"
#include "support/filetools.h" // for MakeAbsPath etc
#include "insets/insetgraphicsParams.h"
#include "lyxrc.h" // for lyxrc.display_graphics
int const HEIGHT_MAXDIGITS = 10;
int const ROTATE_MAXCHARS = 4;
int const FILENAME_MAXCHARS = 1024;
-string defaultUnit = "cm";
+string defaultUnit("cm");
} // namespace anon
fl_addto_tabfolder(dialog_->tabFolder, _("LaTeX Size"), size_->form);
fl_addto_tabfolder(dialog_->tabFolder, _("Bounding Box"), bbox_->form);
fl_addto_tabfolder(dialog_->tabFolder, _("Extras"), special_->form);
+ // set the right default unit
+ if (lyxrc.default_papersize < 3)
+ defaultUnit = "in";
}
// the file section
igp.filename = getStringFromInput(file_->input_filename);
+ controller().checkFilename(igp.filename);
igp.subcaption = fl_get_button(file_->check_subcaption);
igp.subcaptionText = getStringFromInput(file_->input_subcaption);
igp.rotate = fl_get_button(file_->check_rotate);
void FormGraphics::update() {
- if (lyxrc.default_papersize < 3)
- defaultUnit = string("in");
// Update dialog with details from inset
InsetGraphicsParams & igp = controller().params();
fl_set_input(file_->input_rotate_angle,
tostr(igp.rotateAngle).c_str());
if (igp.rotateOrigin.empty())
- fl_set_choice(file_->choice_origin,0);
+ fl_set_choice(file_->choice_origin,1);
else
fl_set_choice_text(file_->choice_origin,igp.rotateOrigin.c_str());
setEnabled(file_->input_rotate_angle,
break;
}
updateWidgetsFromLength(lyxview_->input_lyxwidth,
- lyxview_->choice_width_lyxwidth, igp.lyxwidth,defaultUnit);
+ lyxview_->choice_width_lyxwidth, igp.lyxwidth, defaultUnit);
updateWidgetsFromLength(lyxview_->input_lyxheight,
- lyxview_->choice_width_lyxheight, igp.lyxheight,defaultUnit);
+ lyxview_->choice_width_lyxheight, igp.lyxheight, defaultUnit);
fl_set_input(lyxview_->input_lyxscale, tostr(igp.lyxscale).c_str());
switch (igp.lyxsize_type) {
case InsetGraphicsParams::DEFAULT_SIZE: {
// the size section
// Update the draft and clip mode
updateWidgetsFromLength(size_->input_width,
- size_->choice_width_units,igp.width,defaultUnit);
+ size_->choice_width_units, igp.width, defaultUnit);
updateWidgetsFromLength(size_->input_height,
- size_->choice_height_units,igp.height,defaultUnit);
+ size_->choice_height_units, igp.height, defaultUnit);
fl_set_input(size_->input_scale, tostr(igp.scale).c_str());
switch (igp.size_type) {
case InsetGraphicsParams::DEFAULT_SIZE: {
setEnabled(lyxview_->choice_width_lyxheight, 0);
setEnabled(lyxview_->input_lyxscale, 1);
} else if (ob == lyxview_->button_latex_values) {
- if (fl_get_choice(size_->choice_width_units) > 3
- && fl_get_choice(size_->choice_width_units) < 8
- || fl_get_choice(size_->choice_height_units) > 3
- && fl_get_choice(size_->choice_height_units) < 8)
- Alert::alert(_("Warning!"),
- _("The units t%, p%, c% and l% are not allowed here."),
- _("Cannot use the values from LaTeX size!"));
+ if (contains(fl_get_choice_text(size_->choice_width_units),'%'))
+ Alert::alert(_("Warning!"),
+ _("The units t%, p%, c% and l% are not allowed here."),
+ _("Cannot use the values from LaTeX size!"));
else {
LyXLength dummy = LyXLength(getLengthFromWidgets(size_->input_width,
size_->choice_width_units));
ButtonPolicy::SMInput FormToc::input(FL_OBJECT * ob, long)
{
+ if (ob == dialog_->browser_toc) {
+ unsigned int const choice = fl_get_browser(dialog_->browser_toc);
+
+ if (choice - 1 < toclist_.size() && choice >= 1) {
+ controller().Goto(toclist_[choice - 1].par->id());
+ }
+ return ButtonPolicy::SMI_VALID;
+ }
+
if (ob != dialog_->choice_toc_type) {
updateType();
}
updateContents();
- unsigned int const choice = fl_get_browser(dialog_->browser_toc);
-
- if (choice - 1 < toclist_.size() && choice >= 1) {
- controller().Goto(toclist_[choice - 1].par->id());
- }
-
return ButtonPolicy::SMI_VALID;
}
+2002-03-11 Kayvan A. Sylvan <kayvan@sylvan.com>
+
+ * lyxsum.C: compilation fix
+
2002-03-02 Herbert Voss <voss@perce.de>
* filetools.C: fix bug for xbm format and added some more debug
#include "support/lyxlib.h"
#include "debug.h"
+using std::endl;
+
// Various implementations of lyx::sum(), depending on what methods
// are available. Order is faster to slowest.
#if defined(HAVE_MMAP) && defined(HAVE_MUNMAP)
#include <sys/mman.h>
using std::ifstream;
-using std::endl;
using std::for_each;
using std::istreambuf_iterator;
using std::istream_iterator;
} // namespace
#if HAVE_DECL_ISTREAMBUF_ITERATOR
+using std::ifstream;
+using std::istreambuf_iterator;
+
unsigned long lyx::sum(string const & file)
{
lyxerr[Debug::FILES] << "lyx::sum() using istreambuf_iterator (fast)"