#include <fstream>
#include <iomanip>
-using std::ofstream;
-using std::ifstream;
-using std::fstream;
-using std::ios;
-using std::setw;
-
#include <cstdlib>
#include <unistd.h>
#include "insets/insetspecialchar.h"
#include "insets/figinset.h"
#include "insets/insettext.h"
-#include "insets/insetnumber.h"
+//#include "insets/insetnumber.h"
#include "insets/insetert.h"
#include "insets/insetgraphics.h"
#include "insets/insetfoot.h"
#include "gettext.h"
#include "language.h"
+using std::ostream;
+using std::ofstream;
+using std::ifstream;
+using std::fstream;
+using std::ios;
+using std::setw;
using std::endl;
+using std::pair;
// Uncomment this line to enable a workaround for the weird behaviour
// of the cursor between a displayed inset and last character
}
+string Buffer::getLatexName(bool no_path /* = true */) const
+{
+ return ChangeExtension(MakeLatexName(filename),
+ ".tex", no_path);
+}
+
+
+void Buffer::setReadonly(bool flag /* = true */)
+{
+ if (read_only != flag) {
+ read_only = flag;
+ updateTitles();
+ updateAllVisibleBufferRelatedPopups();
+ }
+ if (read_only) {
+ WarnReadonly(filename);
+ }
+}
+
+
bool Buffer::saveParamsAsDefaults()
{
string fname = AddName(AddPath(user_lyxdir, "templates/"),
}
} else if (token == "\\added_space_top") {
lex.nextToken();
- par->added_space_top = lex.GetString();
+ par->added_space_top = VSpace(lex.GetString());
} else if (token == "\\added_space_bottom") {
lex.nextToken();
- par->added_space_bottom = lex.GetString();
+ par->added_space_bottom = VSpace(lex.GetString());
} else if (token == "\\pextra_type") {
lex.nextToken();
par->pextra_type = lex.GetInteger();
par->InsertInset(pos, inset);
par->SetFont(pos, font);
++pos;
+#if 0
} else if (tmptok == "Number") {
inset = new InsetNumber(this);
inset->Read(lex);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
++pos;
+#endif
} else if (tmptok == "Foot") {
inset = new InsetFoot(this);
inset->Read(lex);
if (!inscmd.getOptions().empty() || !inscmd.getContents().empty()) {
inset = new InsetRef(inscmd, this);
}
-#warning Verify that this else clause is still needed. (Lgb)
+#warning Check if this else clause is still needed. (Lgb)
#if 0
// This condition comes from a
// temporary solution to the latexdel
if ((inset = par->GetInset(i))) {
#if 1
#ifdef HAVE_SSTREAM
- ostringstream ost;
+ std::ostringstream ost;
inset->Latex(ost, -1, free_spc);
h += ost.str().length();
#else
// validate the buffer.
lyxerr[Debug::LATEX] << " Validating buffer..." << endl;
- LaTeXFeatures features(tclass.numLayouts());
+ LaTeXFeatures features(params, tclass.numLayouts());
validate(features);
lyxerr[Debug::LATEX] << " Buffer validation done." << endl;
string preamble, tmppreamble;
// The optional packages;
- preamble = features.getPackages(params);
+ preamble = features.getPackages();
// this might be useful...
preamble += "\n\\makeatletter\n\n";
// Some macros LyX will need
- tmppreamble = features.getMacros(params);
+ tmppreamble = features.getMacros();
if (!tmppreamble.empty()) {
preamble += "\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% "
}
// the text class specific preamble
- tmppreamble = features.getTClassPreamble(params);
+ tmppreamble = features.getTClassPreamble();
if (!tmppreamble.empty()) {
preamble += "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% "
"Textclass specific LaTeX commands.\n"
bool was_title = false;
bool already_title = false;
#ifdef HAVE_SSTREAM
- ostringstream ftnote;
+ std::ostringstream ftnote;
#else
char * tmpholder = 0;
#endif
.NumberOfLayout(params.textclass,
"Caption").second) {
#ifdef HAVE_SSTREAM
- ostringstream ost;
+ std::ostringstream ost;
#else
ostrstream ost;
#endif
if (c == LyXParagraph::META_INSET) {
Inset * inset = par->GetInset(i);
#ifdef HAVE_SSTREAM
- ostringstream ost;
+ std::ostringstream ost;
inset->DocBook(ost);
string tmp_out = ost.str().c_str();
#else
}
if (lyxerr.debugging(Debug::LATEX)) {
- features.showStruct(params);
+ features.showStruct();
}
}
} // end of switch
}
+
+void Buffer::ChangeLanguage(Language const * from, Language const * to)
+{
+
+ LyXParagraph * par = paragraph;
+ while (par) {
+ par->ChangeLanguage(from,to);
+ par = par->next;
+ }
+}
+
+bool Buffer::isMultiLingual()
+{
+
+ LyXParagraph * par = paragraph;
+ while (par) {
+ if (par->isMultiLingual())
+ return true;
+ par = par->next;
+ }
+ return false;
+}