+2001-01-26 Dekel Tsur <dekelts@tau.ac.il>
+
+ * vspace.C (isValidLength): Fix for empty input string.
+
2001-01-26 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* LyXAction.C (init): change description of LFUN_FIGURE to
+2001-01-26 Dekel Tsur <dekelts@tau.ac.il>
+
+ * dlg/lengthentry.C: Move the '#include <config.h>' to the top
+ (fix compilation with lyxstring).
+
+ * FormPrint.h: Fix for namespace-less compilers.
+
+ * refdlg.C (RefDialog): Use InsetRef::types.
+
+ * FormRef.C (update, apply): Use InsetRef::getName and
+ InsetRef::getType.
+
2000-01-24 John Levon <moz@compsoc.man.ac.uk>
* FormParagraph.C: update readonly in correct
class LyXView;
class PrintDialog;
+#ifdef SIGC_CXX_NAMESPACES
+using SigC::Connection;
+#endif
+
class FormPrint : public DialogBase, public noncopyable {
public:
/**@name Constructors and Destructors */
Dialogs * d_;
/// Hide connection.
- SigC::Connection h_;
+ Connection h_;
/// Update connection.
- SigC::Connection u_;
+ Connection u_;
};
#endif
#include "lyxfunc.h"
#include "refdlg.h"
#include "debug.h"
+#include "insets/insetref.h"
#include <qtooltip.h>
FormRef::FormRef(LyXView *v, Dialogs *d)
: dialog_(0), lv_(v), d_(d), inset_(0), h_(0), u_(0), ih_(0),
- sort(0), gotowhere(GOTOREF), type(REF), refs(0)
+ sort(0), gotowhere(GOTOREF), refs(0)
{
// let the dialog be shown
// This is a permanent connection so we won't bother
dialog_->reference->setText(params.getContents().c_str());
dialog_->refname->setText(params.getOptions().c_str());
- if (params.getCmdName()=="pageref") {
- type = PAGEREF;
- dialog_->type->setCurrentItem(1);
- } else if (params.getCmdName()=="vref") {
- type = VREF;
- dialog_->type->setCurrentItem(2);
- } else if (params.getCmdName()=="vpageref") {
- type = VPAGEREF;
- dialog_->type->setCurrentItem(3);
- } else if (params.getCmdName()=="prettyref") {
- type = PRETTYREF;
- dialog_->type->setCurrentItem(4);
- } else {
- type = REF;
- dialog_->type->setCurrentItem(0);
- }
+ if (inset_)
+ dialog_->type->setCurrentItem(InsetRef::getType(params.getCmdName()));
dialog_->buttonGoto->setText(_("&Goto reference"));
QToolTip::remove(dialog_->buttonGoto);
if (!lv_->view()->available())
return;
- switch (dialog_->type->currentItem()) {
- case 0:
- params.setCmdName("ref");
- break;
- case 1:
- params.setCmdName("pageref");
- break;
- case 2:
- params.setCmdName("vref");
- break;
- case 3:
- params.setCmdName("vpageref");
- break;
- case 4:
- params.setCmdName("prettyref");
- break;
- default:
- lyxerr[Debug::GUI] << "Unknown Ref Type" << endl;
- }
-
+ params.setCmdName(InsetRef::getName(dialog_->type->currentItem()));
params.setContents(dialog_->reference->text());
params.setOptions(dialog_->refname->text());
void close();
private:
- enum Type {
- REF, PAGEREF, VREF, VPAGEREF, PRETTYREF
- };
-
enum GotoType {
GOTOREF, GOTOBACK
};
/// where to go
GotoType gotowhere;
- /// current type
- Type type;
-
/// available references
std::vector< string > refs;
};
* John Levon, moz@compsoc.man.ac.uk
*/
+#include <config.h>
+
#include "lengthentry.h"
#include <qlayout.h>
#include <qcombobox.h>
#include "support/lstrings.h"
-
-#include <config.h>
#include <gettext.h>
#include "debug.h"
string val;
lyxerr[Debug::GUI] << "setFromLengthStr: " << str << endl;
-
+
string::size_type i = str.find_first_not_of("0123456789.,");
setValue(strToDbl(str.substr(0, i)));
#include <config.h>
#include "refdlg.h"
-
#include "dlg/helpers.h"
+#include "insets/insetref.h"
+
#ifdef CXX_WORKING_NAMESPACES
using kde_helpers::setSizeHint;
sort->setMaximumSize(sort->sizeHint());
type = new QComboBox(this);
- type->insertItem(_("Reference"));
- type->insertItem(_("Page number"));
- type->insertItem(_("Ref on page xxx"));
- type->insertItem(_("on page xxx"));
- type->insertItem(_("Pretty reference"));
+ for (int i = 0; !InsetRef::types[i].latex_name.empty(); ++i)
+ type->insertItem(_(InsetRef::types[i].gui_name.c_str()));
setSizeHint(type);
labeltype = new QLabel(this);
+2001-01-26 Dekel Tsur <dekelts@tau.ac.il>
+
+ * lyxstring.C: Fix some assertions.
+
2001-01-23 Dekel Tsur <dekelts@tau.ac.il>
* lstrings.C (strip): Add a fix for compilers with broken
lyxstring::size_type lyxstring::find_first_of(lyxstring const & a,
size_type i) const
{
- Assert(i < rep->sz); // OURS!
+ Assert(i <= rep->sz); // OURS!
TestlyxstringInvariant(this);
for (size_type t = i; t < rep->sz; ++t) {
size_type i,
size_type n) const
{
- Assert(ptr && i < rep->sz); // OURS!
+ Assert(ptr && i <= rep->sz); // OURS!
TestlyxstringInvariant(this);
if (!n) return npos;
lyxstring::size_type lyxstring::find_first_of(value_type const * ptr,
size_type i) const
{
- Assert(ptr && i < rep->sz); // OURS!
+ Assert(ptr && i <= rep->sz); // OURS!
TestlyxstringInvariant(this);
for (size_type t = i; t < rep->sz; ++t) {
lyxstring::size_type lyxstring::find_first_of(value_type c, size_type i) const
{
- Assert(i < rep->sz); // OURS!
+ Assert(i <= rep->sz); // OURS!
TestlyxstringInvariant(this);
for (size_type t = i; t < rep->sz; ++t) {
TestlyxstringInvariant(this);
if (!rep->sz) return npos;
- Assert(i < rep->sz);
+ Assert(i <= rep->sz);
for (size_type t = i; t < rep->sz; ++t) {
if (a.find(rep->s[t]) == npos) return t;
}
size_type i,
size_type n) const
{
- Assert(ptr && i < rep->sz); // OURS!
+ Assert(ptr && i <= rep->sz); // OURS!
TestlyxstringInvariant(this);
if (!n) return (i < rep->sz) ? i : npos;
lyxstring::size_type lyxstring::find_first_not_of(value_type const * ptr,
size_type i) const
{
- Assert(ptr && i < rep->sz); // OURS!
+ Assert(ptr && i <= rep->sz); // OURS!
TestlyxstringInvariant(this);
for (size_type t = i; t < rep->sz; ++t) {
size_type i) const
{
if (!rep->sz) return npos;
- Assert(i < rep->sz); // OURS!
+ Assert(i <= rep->sz); // OURS!
TestlyxstringInvariant(this);
for (size_type t = i; t < rep->sz; ++t) {
lyxstring & lyxstring::replace(size_type i, size_type n,
value_type const * p, size_type n2)
{
- Assert(p && i < rep->sz); // OURS!
+ Assert(p && i <= rep->sz); // OURS!
TestlyxstringInvariant(this);
rep = rep->get_own_copy();
lyxstring & lyxstring::replace(size_type i, size_type n, value_type const * p)
{
- Assert(p && i < rep->sz); // OURS!
+ Assert(p && i <= rep->sz); // OURS!
TestlyxstringInvariant(this);
return replace(i, min(n, rep->sz), p, (!p) ? 0 : strlen(p));
/// The parser may seem overkill for lengths without
/// glue, but since we already have it, using it is
/// easier than writing something from scratch.
+ if (data.empty())
+ return true;
string buffer(data);
int pattern_index = 0;