+2000-10-03 Lars Gullik Bjønnes <larsbj@lyx.org>
+
+
+ * src/insets/insettabular.C (setPos): change for loop to not use
+ sequencing operator. Please check this Jürgen.
+
+ * src/frontends/xforms/Menubar_pimpl.C (makeMenubar): use "c"
+ instead of 'c'
+ * src/insets/insetcite.C (getScreenLabel): ditto
+ * src/support/filetools.C (QuoteName): ditto
+ (ChangeExtension): ditto
+
+ * src/BufferView_pimpl.C (scrollCB): make heigt int
+
+ * src/BufferView2.C (insertInset): comment out unused arg
+
+ * boost/Makefile.am (EXTRADIST): new variable
+
+2000-10-03 Dekel Tsur <dekelts@tau.ac.il>
+
+ * src/exporter.C (IsExportable): Fixed
+
+ * lib/configure.m4: Small fix
+
+2000-10-03 Dekel Tsur <dekelts@tau.ac.il>
+
+ * src/insets/insetbutton.C (width): Changed to work with no GUI.
+ * src/insets/insetbib.C (bibitemWidest): ditto.
+ * src/lyx_gui_misc.C (AskQuestion,AskConfirmation,askForText): ditto.
+
2000-10-03 Juergen Vigna <jug@sad.it>
* src/BufferView2.C (theLockingInset): removed const because of
DISTCLEANFILES= *.orig *.rej *~ *.bak core
MAINTAINERCLEANFILES= $(srcdir)/Makefile.in
ETAGS_ARGS = --lang=c++
+
+EXTRADIST = boost libs
# Search something to process a literate document
echo $ac_n "checking for a Literate programming processor""... $ac_c"
-echo "$ac_t""("noweave -delay -index \$\$FName > \$\$OutName")"
+echo "$ac_t""(noweave)"
LITERATE=
-for ac_prog in "noweave -delay -index \$\$FName > \$\$OutName"
+for ac_prog in noweave
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog ; ac_word=$2
LITERATE=none
fi
-if test "$LITERATE" = "none"; then LITERATE_EXT="none"; else LITERATE_EXT="nw"; fi
+test $LITERATE = "noweave" && LITERATE="noweave -delay -index \$\$FName > \$\$OutName"
+LITERATE_EXT="nw"
# Search for a Postscript interpreter
echo $ac_n "checking for a Postscript interpreter""... $ac_c"
PATH=${save_PATH}
# Search something to process a literate document
-SEARCH_PROG([for a Literate programming processor],LITERATE,"noweave -delay -index \$\$FName > \$\$OutName")
-if test "$LITERATE" = "none"; then LITERATE_EXT="none"; else LITERATE_EXT="nw"; fi
+SEARCH_PROG([for a Literate programming processor],LITERATE,noweave)
+test $LITERATE = "noweave" && LITERATE="noweave -delay -index \$\$FName > \$\$OutName"
+LITERATE_EXT="nw"
# Search for a Postscript interpreter
SEARCH_PROG([for a Postscript interpreter],GS, gs)
src/frontends/xforms/form_print.C
src/frontends/xforms/FormRef.C
src/frontends/xforms/form_ref.C
-src/frontends/xforms/forms/form_citation.C
-src/frontends/xforms/forms/form_copyright.C
-src/frontends/xforms/forms/form_document.C
-src/frontends/xforms/forms/form_error.C
-src/frontends/xforms/forms/form_graphics.C
-src/frontends/xforms/forms/form_index.C
-src/frontends/xforms/forms/form_paragraph.C
-src/frontends/xforms/forms/form_preferences.C
-src/frontends/xforms/forms/form_print.C
-src/frontends/xforms/forms/form_ref.C
-src/frontends/xforms/forms/form_tabular.C
-src/frontends/xforms/forms/form_toc.C
-src/frontends/xforms/forms/form_url.C
src/frontends/xforms/FormTabular.C
src/frontends/xforms/form_tabular.C
src/frontends/xforms/FormToc.C
int workWidth() const;
///
UpdatableInset * theLockingInset() const;
+ ///
void theLockingInset(UpdatableInset * inset);
///
void updateInset(Inset * inset, bool mark_dirty);
text->SetCursor(this, texrowpar, tmppos);
}
+
bool BufferView::insertInset(Inset * inset, string const & lout,
- bool no_table)
+ bool /*no_table*/)
{
// if we are in a locking inset we should try to insert the
// inset there otherwise this is a illegal function now
if (cursor_follows_scrollbar) {
LyXText * vbt = bv_->text;
- unsigned int height = vbt->DefaultHeight();
+ int height = vbt->DefaultHeight();
if (vbt->cursor.y() < (int)(bv_->text->first + height)) {
vbt->SetCursorFromCoordinates(bv_, 0,
LyXFont font = text->GetFont(bv_->buffer(),
cursor.par(), cursor.pos());
bool is_rtl = font.isVisibleRightToLeft();
- int start_x, end_x;
+ int start_x;
+ int end_x;
if (is_rtl) {
start_x = cursor.x() - tmpinset->width(bv_, font) + tmpinset->scroll();
LyXFont font = text->GetFont(bv_->buffer(), cursor.par(),
cursor.pos()-1);
bool is_rtl = font.isVisibleRightToLeft();
- int start_x, end_x;
+ int start_x;
+ int end_x;
if (!is_rtl) {
start_x = cursor.x() - tmpinset->width(bv_, font) +
bool Exporter::IsExportable(Buffer const * buffer, string const & format)
{
- // This is not efficient
+#warning This is not efficient (Dekel)
vector<pair<string, string> > const v = GetExportableFormats(buffer);
for (vector<pair<string, string> >::const_iterator it = v.begin();
- it != v.end(); ++it)
- if ((*it).first == format)
+ it != v.end(); ++it) {
+ string format2;
+ split((*it).first, format2, ':');
+ if (format == format2)
return true;
+ }
return false;
}
break;
}
string label = i->label();
- string shortcut = '#' + i->shortcut();
+ string shortcut = "#" + i->shortcut();
int width = string_width(label);
obj = fl_add_button(FL_TOUCH_BUTTON,
air + moffset, yloc,
#include "lyxtext.h"
#include "support/filetools.h"
#include "support/path.h"
+#include "lyxrc.h"
using std::ostream;
using std::ifstream;
// ale070405
-string const bibitemWidest(BufferView * bv)
+string const bibitemWidest(Buffer const * buffer)
{
int w = 0;
// Does look like a hack? It is! (but will change at 0.13)
- LyXParagraph * par = bv->buffer()->paragraph;
+ LyXParagraph * par = buffer->paragraph;
+ BufferView * bv = buffer->getUser();
InsetBibKey * bkey = 0;
LyXFont font;
int width, ascent, descent;
string s = getScreenLabel();
+ if (!bv)
+ return s.length();
if (Editable()) {
bv->painter().buttonText(0, 0, s, font,
if (!getOptions().empty())
label += ", " + getOptions();
- return '[' + label + ']';
+ return "[" + label + "]";
}
// now search the right column
int lx = tabular->GetWidthOfColumn(actcell) -
tabular->GetAdditionalWidth(actcell);
+#warning Jürgen, can you rewrite this to _not_ use the sequencing operator. (Lgb)
+#if 0
for(; !tabular->IsLastCellInRow(actcell) && (lx < x);
++actcell,lx += tabular->GetWidthOfColumn(actcell) +
tabular->GetAdditionalWidth(actcell - 1));
+#else
+ // Jürgen, you should check that this is correct. (Lgb)
+ for (; !tabular->IsLastCellInRow(actcell) && lx < x; ++actcell) {
+ lx += tabular->GetWidthOfColumn(actcell + 1)
+ + tabular->GetAdditionalWidth(actcell);
+ }
+
+#endif
cursor.pos(0);
resetPos(bv);
if ((lx - (tabular->GetWidthOfColumn(actcell) / 2)) < x) {
for(; !tabular->IsFirstCellInRow(c); --c)
;
int lx = tabular->GetWidthOfColumn(cell);
- for(; (c < cell); ++c) {
+ for(; c < cell; ++c) {
lx += tabular->GetWidthOfColumn(c);
}
return (lx - tabular->GetWidthOfColumn(cell) + top_x);
#include "LyXView.h"
#include "bufferview_funcs.h"
#include "support/filetools.h"
+#include "lyxrc.h"
using std::pair;
using std::make_pair;
}
-bool AskQuestion(string const & s1, string const & s2, string const & s3)
+bool AskQuestion(string const & s1, string const & s2, string const & s3,
+ bool default_value)
{
+ if (!lyxrc.use_gui) {
+ lyxerr << "----------------------------------------" << endl
+ << s1 << endl;
+ if (!s2.empty())
+ lyxerr << s2 << endl;
+ if (!s3.empty())
+ lyxerr << s3 << endl;
+ lyxerr << "Assuming answer is "
+ << (default_value ? "yes" : "no")
+ << endl
+ << "----------------------------------------" << endl;
+ return default_value;
+ }
+
fl_set_resource("flQuestion.yes.label", idex(_("Yes|Yy#y")));
fl_set_resource("flQuestion.no.label", idex(_("No|Nn#n")));
return fl_show_question((s1 + "\n" + s2 + "\n" + s3).c_str(), 0);
// Returns 1 for yes, 2 for no, 3 for cancel.
-int AskConfirmation(string const & s1, string const & s2, string const & s3)
+int AskConfirmation(string const & s1, string const & s2, string const & s3,
+ int default_value)
{
+ if (!lyxrc.use_gui) {
+ lyxerr << "----------------------------------------" << endl
+ << s1 << endl;
+ if (!s2.empty())
+ lyxerr << s2 << endl;
+ if (!s3.empty())
+ lyxerr << s3 << endl;
+ lyxerr << "Assuming answer is ";
+ if (default_value == 1)
+ lyxerr << "yes";
+ else if (default_value == 2)
+ lyxerr << "no";
+ else
+ lyxerr << "cancel";
+ lyxerr << endl
+ << "----------------------------------------" << endl;
+ return default_value;
+ }
+
fl_set_choices_shortcut(scex(_("Yes|Yy#y")),
scex(_("No|Nn#n")),
scex(_("Cancel|^[")));
pair<bool, string> const
askForText(string const & msg, string const & dflt)
{
+ if (!lyxrc.use_gui) {
+ lyxerr << "----------------------------------------" << endl
+ << msg << endl
+ << "Assuming answer is " << dflt
+ << "----------------------------------------" << endl;
+ return make_pair<bool, string>(true, dflt);
+ }
+
fl_set_resource("flInput.cancel.label", idex(_("Cancel|^[")));
fl_set_resource("flInput.ok.label", idex(_("OK|#O")));
fl_set_resource("flInput.clear.label", idex(_("Clear|#e")));
/// Asks "Yes" or "No". Returns true for yes, false for no
bool AskQuestion(string const & s1, string const & s2 = string(),
- string const & s3 = string());
+ string const & s3 = string(), bool default_value = true);
/// Asks "Yes", "No" or "Cancel". Returns 1 for yes, 2 for no, 3 for cancel
int AskConfirmation(string const & s1, string const & s2 = string(),
- string const & s3 = string());
+ string const & s3 = string(), int default_value = 1);
/// returns a bool: false=cancelled, true=okay. string contains returned text
std::pair<bool, string> const
// this is a bad idea, but how can LyXParagraph find its buffer to get
// parameters? (JMarc)
extern BufferView * current_view;
-extern string bibitemWidest(BufferView *);
+extern string bibitemWidest(Buffer const *);
// this is a minibuffer
static char minibuffer_char;
} else if (style.labeltype == LABEL_BIBLIO) {
// ale970405
os << "\\begin{" << style.latexname() << "}{"
- << bibitemWidest(current_view)
+ << bibitemWidest(buf)
<< "}\n";
} else if (style.latextype == LATEX_ITEM_ENVIRONMENT) {
#ifdef FANCY_FOOTNOTE_CODE
{
// CHECK Add proper emx support here!
#ifndef __EMX__
- return '\'' + name + '\'';
+ return "\'" + name + "\'";
#else
return name;
#endif
string ext;
// Make sure the extension starts with a dot
if (!extension.empty() && extension[0] != '.')
- ext= '.' + extension;
+ ext= "." + extension;
else
ext = extension;