mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Fix trailing whitespace in cpp files.
This commit is contained in:
parent
51aebc9327
commit
75bfed5507
@ -31,13 +31,13 @@ struct AppleSpellChecker::Private
|
|||||||
SpellChecker::Result toResult(SpellCheckResult status);
|
SpellChecker::Result toResult(SpellCheckResult status);
|
||||||
string toString(SpellCheckResult status);
|
string toString(SpellCheckResult status);
|
||||||
int numDictionaries() const;
|
int numDictionaries() const;
|
||||||
|
|
||||||
/// the speller
|
/// the speller
|
||||||
AppleSpeller speller;
|
AppleSpeller speller;
|
||||||
|
|
||||||
/// language map
|
/// language map
|
||||||
map<string, string> languageMap;
|
map<string, string> languageMap;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -137,7 +137,7 @@ void AppleSpellChecker::suggest(WordLangTuple const & wl,
|
|||||||
{
|
{
|
||||||
suggestions.clear();
|
suggestions.clear();
|
||||||
string const word_str = to_utf8(wl.word());
|
string const word_str = to_utf8(wl.word());
|
||||||
size_t num = AppleSpeller_makeSuggestion(d->speller,
|
size_t num = AppleSpeller_makeSuggestion(d->speller,
|
||||||
word_str.c_str(), wl.lang()->code().c_str());
|
word_str.c_str(), wl.lang()->code().c_str());
|
||||||
for (size_t i = 0; i < num; i++) {
|
for (size_t i = 0; i < num; i++) {
|
||||||
char const * next = AppleSpeller_getSuggestion(d->speller, i);
|
char const * next = AppleSpeller_getSuggestion(d->speller, i);
|
||||||
@ -181,7 +181,7 @@ int AppleSpellChecker::numDictionaries() const
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int AppleSpellChecker::numMisspelledWords() const
|
int AppleSpellChecker::numMisspelledWords() const
|
||||||
{
|
{
|
||||||
return AppleSpeller_numMisspelledWords(d->speller);
|
return AppleSpeller_numMisspelledWords(d->speller);
|
||||||
|
@ -144,7 +144,7 @@ AspellChecker::Private::~Private()
|
|||||||
|
|
||||||
LangPersonalWordList::const_iterator pdit = personal_.begin();
|
LangPersonalWordList::const_iterator pdit = personal_.begin();
|
||||||
LangPersonalWordList::const_iterator pdet = personal_.end();
|
LangPersonalWordList::const_iterator pdet = personal_.end();
|
||||||
|
|
||||||
for (; pdit != pdet; ++pdit) {
|
for (; pdit != pdet; ++pdit) {
|
||||||
if ( 0 == pdit->second)
|
if ( 0 == pdit->second)
|
||||||
continue;
|
continue;
|
||||||
@ -294,7 +294,7 @@ AspellSpeller * AspellChecker::Private::addSpeller(Language const * lang)
|
|||||||
personal_[lang->lang()] = pd;
|
personal_[lang->lang()] = pd;
|
||||||
initSessionDictionary(m, pd);
|
initSessionDictionary(m, pd);
|
||||||
}
|
}
|
||||||
|
|
||||||
spellers_[lang->lang()] = m;
|
spellers_[lang->lang()] = m;
|
||||||
return m.e_speller ? to_aspell_speller(m.e_speller) : 0;
|
return m.e_speller ? to_aspell_speller(m.e_speller) : 0;
|
||||||
}
|
}
|
||||||
@ -352,7 +352,7 @@ string AspellChecker::Private::toAspellWord(docstring const & word) const
|
|||||||
|
|
||||||
|
|
||||||
SpellChecker::Result AspellChecker::Private::check(
|
SpellChecker::Result AspellChecker::Private::check(
|
||||||
AspellSpeller * m, WordLangTuple const & word)
|
AspellSpeller * m, WordLangTuple const & word)
|
||||||
const
|
const
|
||||||
{
|
{
|
||||||
SpellChecker::Result result = WORD_OK;
|
SpellChecker::Result result = WORD_OK;
|
||||||
@ -396,7 +396,7 @@ void AspellChecker::Private::remove(WordLangTuple const & word)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void AspellChecker::Private::insert(WordLangTuple const & word)
|
void AspellChecker::Private::insert(WordLangTuple const & word)
|
||||||
{
|
{
|
||||||
Spellers::iterator it = spellers_.find(word.lang()->lang());
|
Spellers::iterator it = spellers_.find(word.lang()->lang());
|
||||||
@ -431,7 +431,7 @@ AspellChecker::~AspellChecker()
|
|||||||
|
|
||||||
SpellChecker::Result AspellChecker::check(WordLangTuple const & word)
|
SpellChecker::Result AspellChecker::check(WordLangTuple const & word)
|
||||||
{
|
{
|
||||||
|
|
||||||
AspellSpeller * m = d->speller(word.lang());
|
AspellSpeller * m = d->speller(word.lang());
|
||||||
|
|
||||||
if (!m)
|
if (!m)
|
||||||
@ -529,8 +529,8 @@ int AspellChecker::numDictionaries() const
|
|||||||
{
|
{
|
||||||
return d->numDictionaries();
|
return d->numDictionaries();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
docstring const AspellChecker::error()
|
docstring const AspellChecker::error()
|
||||||
{
|
{
|
||||||
Spellers::iterator it = d->spellers_.begin();
|
Spellers::iterator it = d->spellers_.begin();
|
||||||
|
@ -184,7 +184,7 @@ ostream & operator<<(ostream & os, AuthorList const & a)
|
|||||||
|
|
||||||
for (; a_it != a_end; ++a_it) {
|
for (; a_it != a_end; ++a_it) {
|
||||||
if (a_it->used() && a_it->valid())
|
if (a_it->used() && a_it->valid())
|
||||||
os << "\\author " << *a_it << "\n";
|
os << "\\author " << *a_it << "\n";
|
||||||
}
|
}
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
@ -503,8 +503,8 @@ docstring const BibTeXInfo::getAuthorOrEditorList(Buffer const * buf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
docstring const BibTeXInfo::getAuthorList(Buffer const * buf,
|
docstring const BibTeXInfo::getAuthorList(Buffer const * buf,
|
||||||
docstring const & author, bool const full, bool const forceshort,
|
docstring const & author, bool const full, bool const forceshort,
|
||||||
bool const allnames, bool const beginning) const
|
bool const allnames, bool const beginning) const
|
||||||
{
|
{
|
||||||
// Maxnames treshold depend on engine
|
// Maxnames treshold depend on engine
|
||||||
@ -760,7 +760,7 @@ docstring parseOptions(docstring const & format, string & optkey,
|
|||||||
|
|
||||||
/* FIXME
|
/* FIXME
|
||||||
Bug #9131 revealed an oddity in how we are generating citation information
|
Bug #9131 revealed an oddity in how we are generating citation information
|
||||||
when more than one key is given. We end up building a longer and longer format
|
when more than one key is given. We end up building a longer and longer format
|
||||||
string as we go, which we then have to re-parse, over and over and over again,
|
string as we go, which we then have to re-parse, over and over and over again,
|
||||||
rather than generating the information for the individual keys and then putting
|
rather than generating the information for the individual keys and then putting
|
||||||
all of that together. We do that to deal with the way separators work, from what
|
all of that together. We do that to deal with the way separators work, from what
|
||||||
|
@ -536,7 +536,7 @@ Buffer::~Buffer()
|
|||||||
Impl::BufferPositionMap::iterator end = d->children_positions.end();
|
Impl::BufferPositionMap::iterator end = d->children_positions.end();
|
||||||
for (; it != end; ++it) {
|
for (; it != end; ++it) {
|
||||||
Buffer * child = const_cast<Buffer *>(it->first);
|
Buffer * child = const_cast<Buffer *>(it->first);
|
||||||
if (theBufferList().isLoaded(child)) {
|
if (theBufferList().isLoaded(child)) {
|
||||||
if (theBufferList().isOthersChild(this, child))
|
if (theBufferList().isOthersChild(this, child))
|
||||||
child->setParent(0);
|
child->setParent(0);
|
||||||
else
|
else
|
||||||
@ -1934,7 +1934,7 @@ void Buffer::writeLaTeXSource(otexstream & os,
|
|||||||
support::bformat(_("The languages %1$s are only supported by Polyglossia."), langs)
|
support::bformat(_("The languages %1$s are only supported by Polyglossia."), langs)
|
||||||
: support::bformat(_("The language %1$s is only supported by Polyglossia."), langs);
|
: support::bformat(_("The language %1$s is only supported by Polyglossia."), langs);
|
||||||
if (!blangs.empty())
|
if (!blangs.empty())
|
||||||
plangs += "\n";
|
plangs += "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
frontend::Alert::warning(
|
frontend::Alert::warning(
|
||||||
@ -5023,7 +5023,7 @@ void Buffer::updateBuffer(ParIterator & parit, UpdateType utype) const
|
|||||||
// set the counter for this paragraph
|
// set the counter for this paragraph
|
||||||
d->setLabel(parit, utype);
|
d->setLabel(parit, utype);
|
||||||
|
|
||||||
// update change-tracking flag
|
// update change-tracking flag
|
||||||
parit->addChangesToBuffer(*this);
|
parit->addChangesToBuffer(*this);
|
||||||
|
|
||||||
// now the insets
|
// now the insets
|
||||||
|
@ -201,7 +201,7 @@ Buffer * BufferList::next(Buffer const * buf) const
|
|||||||
|
|
||||||
if (bstore.empty())
|
if (bstore.empty())
|
||||||
return 0;
|
return 0;
|
||||||
BufferStorage::const_iterator it =
|
BufferStorage::const_iterator it =
|
||||||
find(bstore.begin(), bstore.end(), buf);
|
find(bstore.begin(), bstore.end(), buf);
|
||||||
LASSERT(it != bstore.end(), return 0);
|
LASSERT(it != bstore.end(), return 0);
|
||||||
++it;
|
++it;
|
||||||
@ -217,7 +217,7 @@ Buffer * BufferList::previous(Buffer const * buf) const
|
|||||||
|
|
||||||
if (bstore.empty())
|
if (bstore.empty())
|
||||||
return 0;
|
return 0;
|
||||||
BufferStorage::const_iterator it =
|
BufferStorage::const_iterator it =
|
||||||
find(bstore.begin(), bstore.end(), buf);
|
find(bstore.begin(), bstore.end(), buf);
|
||||||
LASSERT(it != bstore.end(), return 0);
|
LASSERT(it != bstore.end(), return 0);
|
||||||
|
|
||||||
@ -284,7 +284,7 @@ bool BufferList::isOthersChild(Buffer * parent, Buffer * child)
|
|||||||
LASSERT(parent, return false);
|
LASSERT(parent, return false);
|
||||||
LASSERT(child, return false);
|
LASSERT(child, return false);
|
||||||
LASSERT(parent->isChild(child), return false);
|
LASSERT(parent->isChild(child), return false);
|
||||||
|
|
||||||
// Does child document have a different parent?
|
// Does child document have a different parent?
|
||||||
Buffer const * parent_ = child->parent();
|
Buffer const * parent_ = child->parent();
|
||||||
if (parent_ && parent_ != parent)
|
if (parent_ && parent_ != parent)
|
||||||
|
@ -1553,7 +1553,7 @@ void BufferParams::validate(LaTeXFeatures & features) const
|
|||||||
|
|
||||||
if (useNonTeXFonts && fontsMath() != "auto")
|
if (useNonTeXFonts && fontsMath() != "auto")
|
||||||
features.require("unicode-math");
|
features.require("unicode-math");
|
||||||
|
|
||||||
if (use_microtype)
|
if (use_microtype)
|
||||||
features.require("microtype");
|
features.require("microtype");
|
||||||
|
|
||||||
@ -2578,7 +2578,7 @@ FormatList const & BufferParams::exportableFormats(bool only_viewable) const
|
|||||||
{
|
{
|
||||||
FormatList & cached = only_viewable ?
|
FormatList & cached = only_viewable ?
|
||||||
pimpl_->viewableFormatList : pimpl_->exportableFormatList;
|
pimpl_->viewableFormatList : pimpl_->exportableFormatList;
|
||||||
bool & valid = only_viewable ?
|
bool & valid = only_viewable ?
|
||||||
pimpl_->isViewCacheValid : pimpl_->isExportCacheValid;
|
pimpl_->isViewCacheValid : pimpl_->isExportCacheValid;
|
||||||
if (valid)
|
if (valid)
|
||||||
return cached;
|
return cached;
|
||||||
@ -2593,7 +2593,7 @@ FormatList const & BufferParams::exportableFormats(bool only_viewable) const
|
|||||||
theConverters().getReachable(backs[0], only_viewable, true, excludes);
|
theConverters().getReachable(backs[0], only_viewable, true, excludes);
|
||||||
for (vector<string>::const_iterator it = backs.begin() + 1;
|
for (vector<string>::const_iterator it = backs.begin() + 1;
|
||||||
it != backs.end(); ++it) {
|
it != backs.end(); ++it) {
|
||||||
FormatList r = theConverters().getReachable(*it, only_viewable,
|
FormatList r = theConverters().getReachable(*it, only_viewable,
|
||||||
false, excludes);
|
false, excludes);
|
||||||
result.insert(result.end(), r.begin(), r.end());
|
result.insert(result.end(), r.begin(), r.end());
|
||||||
}
|
}
|
||||||
@ -3368,7 +3368,7 @@ string const BufferParams::loadFonts(LaTeXFeatures & features) const
|
|||||||
Encoding const & BufferParams::encoding() const
|
Encoding const & BufferParams::encoding() const
|
||||||
{
|
{
|
||||||
// Main encoding for LaTeX output.
|
// Main encoding for LaTeX output.
|
||||||
//
|
//
|
||||||
// Exception: XeTeX with 8-bit TeX fonts requires ASCII (see #9740).
|
// Exception: XeTeX with 8-bit TeX fonts requires ASCII (see #9740).
|
||||||
// As the "flavor" is only known once export started, this
|
// As the "flavor" is only known once export started, this
|
||||||
// cannot be handled here. Instead, runparams.encoding is set
|
// cannot be handled here. Instead, runparams.encoding is set
|
||||||
|
@ -1368,7 +1368,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
|
|||||||
// we only need to do this if we have deleted or restored a
|
// we only need to do this if we have deleted or restored a
|
||||||
// BiBTeX inset. but there is no other place to do it. one
|
// BiBTeX inset. but there is no other place to do it. one
|
||||||
// obvious idea is to try to do it in a copy constructor for
|
// obvious idea is to try to do it in a copy constructor for
|
||||||
// InsetBibTeX, but when that is invoked, the buffer_ member
|
// InsetBibTeX, but when that is invoked, the buffer_ member
|
||||||
// is not yet set. another idea is to look at the InsetLists
|
// is not yet set. another idea is to look at the InsetLists
|
||||||
// of the various paragraphs. but we'd have to recurse through
|
// of the various paragraphs. but we'd have to recurse through
|
||||||
// the contained insets to make that work. it doesn't seem to
|
// the contained insets to make that work. it doesn't seem to
|
||||||
|
@ -142,7 +142,7 @@ void Changes::set(Change const & change, pos_type const start, pos_type const en
|
|||||||
{
|
{
|
||||||
if (change.type != Change::UNCHANGED) {
|
if (change.type != Change::UNCHANGED) {
|
||||||
LYXERR(Debug::CHANGES, "setting change (type: " << change.type
|
LYXERR(Debug::CHANGES, "setting change (type: " << change.type
|
||||||
<< ", author: " << change.author
|
<< ", author: " << change.author
|
||||||
<< ", time: " << long(change.changetime)
|
<< ", time: " << long(change.changetime)
|
||||||
<< ") in range (" << start << ", " << end << ")");
|
<< ") in range (" << start << ", " << end << ")");
|
||||||
}
|
}
|
||||||
@ -415,11 +415,11 @@ int Changes::latexMarkChange(otexstream & os, BufferParams const & bparams,
|
|||||||
}
|
}
|
||||||
else if (change.type == Change::INSERTED)
|
else if (change.type == Change::INSERTED)
|
||||||
macro_beg = from_ascii("\\lyxadded{");
|
macro_beg = from_ascii("\\lyxadded{");
|
||||||
|
|
||||||
docstring str = getLaTeXMarkup(macro_beg,
|
docstring str = getLaTeXMarkup(macro_beg,
|
||||||
bparams.authors().get(change.author).name(),
|
bparams.authors().get(change.author).name(),
|
||||||
chgTime, runparams);
|
chgTime, runparams);
|
||||||
|
|
||||||
// signature needed by \lyxsout to correctly strike out display math
|
// signature needed by \lyxsout to correctly strike out display math
|
||||||
if (change.type == Change::DELETED && runparams.inDisplayMath
|
if (change.type == Change::DELETED && runparams.inDisplayMath
|
||||||
&& (!LaTeXFeatures::isAvailable("dvipost")
|
&& (!LaTeXFeatures::isAvailable("dvipost")
|
||||||
|
@ -151,12 +151,12 @@ void CmdDef::release(string const & name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CmdDef::newCmdDefResult CmdDef::newCmdDef(string const & name,
|
CmdDef::newCmdDefResult CmdDef::newCmdDef(string const & name,
|
||||||
string const & def)
|
string const & def)
|
||||||
{
|
{
|
||||||
string const name2 = trim(name);
|
string const name2 = trim(name);
|
||||||
|
|
||||||
if (name2.empty())
|
if (name2.empty())
|
||||||
return CmdDefNameEmpty;
|
return CmdDefNameEmpty;
|
||||||
|
|
||||||
if (cmdDefMap.find(name) != cmdDefMap.end())
|
if (cmdDefMap.find(name) != cmdDefMap.end())
|
||||||
|
@ -90,7 +90,7 @@ RGBColor rgbFromHexName(string const & x11hexname)
|
|||||||
string const outputLaTeXColor(RGBColor const & color)
|
string const outputLaTeXColor(RGBColor const & color)
|
||||||
{
|
{
|
||||||
// this routine returns a LaTeX readable color string in the form
|
// this routine returns a LaTeX readable color string in the form
|
||||||
// "red, green, blue" where the colors are a number in the range 0-1
|
// "red, green, blue" where the colors are a number in the range 0-1
|
||||||
int red = color.r;
|
int red = color.r;
|
||||||
int green = color.g;
|
int green = color.g;
|
||||||
int blue = color.b;
|
int blue = color.b;
|
||||||
@ -152,7 +152,7 @@ RGBColor const RGBColorFromLaTeX(string const & color)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Color::Color(ColorCode base_color) : baseColor(base_color),
|
Color::Color(ColorCode base_color) : baseColor(base_color),
|
||||||
mergeColor(Color_ignore)
|
mergeColor(Color_ignore)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -163,7 +163,7 @@ bool Color::operator==(Color const & color) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Color::operator!=(Color const & color) const
|
bool Color::operator!=(Color const & color) const
|
||||||
{
|
{
|
||||||
return baseColor != color.baseColor;
|
return baseColor != color.baseColor;
|
||||||
}
|
}
|
||||||
|
@ -392,7 +392,7 @@ void Compare::run()
|
|||||||
dest_buffer->params().authors().record(*it);
|
dest_buffer->params().authors().record(*it);
|
||||||
|
|
||||||
// We will need this later
|
// We will need this later
|
||||||
DocumentClassConstPtr const olddc =
|
DocumentClassConstPtr const olddc =
|
||||||
dest_buffer->params().documentClassPtr();
|
dest_buffer->params().documentClassPtr();
|
||||||
// We do not want to share the DocumentClass with the other Buffer.
|
// We do not want to share the DocumentClass with the other Buffer.
|
||||||
// See bug #10295.
|
// See bug #10295.
|
||||||
|
@ -785,7 +785,7 @@ FormatList const Converters::intToFormat(vector<int> const & input)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FormatList const Converters::getReachableTo(string const & target,
|
FormatList const Converters::getReachableTo(string const & target,
|
||||||
bool const clear_visited)
|
bool const clear_visited)
|
||||||
{
|
{
|
||||||
vector<int> const & reachablesto =
|
vector<int> const & reachablesto =
|
||||||
@ -795,8 +795,8 @@ FormatList const Converters::getReachableTo(string const & target,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FormatList const Converters::getReachable(string const & from,
|
FormatList const Converters::getReachable(string const & from,
|
||||||
bool const only_viewable, bool const clear_visited,
|
bool const only_viewable, bool const clear_visited,
|
||||||
set<string> const & excludes)
|
set<string> const & excludes)
|
||||||
{
|
{
|
||||||
set<int> excluded_numbers;
|
set<int> excluded_numbers;
|
||||||
|
@ -254,7 +254,7 @@ void ConverterCache::init()
|
|||||||
|
|
||||||
void ConverterCache::writeIndex() const
|
void ConverterCache::writeIndex() const
|
||||||
{
|
{
|
||||||
if (!lyxrc.use_converter_cache
|
if (!lyxrc.use_converter_cache
|
||||||
|| cache_dir.empty())
|
|| cache_dir.empty())
|
||||||
return;
|
return;
|
||||||
pimpl_->writeIndex();
|
pimpl_->writeIndex();
|
||||||
|
@ -65,7 +65,7 @@ pos_type CursorSlice::lastpos() const
|
|||||||
LBUFERR(inset_);
|
LBUFERR(inset_);
|
||||||
InsetMath const * math = inset_->asInsetMath();
|
InsetMath const * math = inset_->asInsetMath();
|
||||||
bool paramless_macro = math && math->asMacro() && !math->asMacro()->nargs();
|
bool paramless_macro = math && math->asMacro() && !math->asMacro()->nargs();
|
||||||
return math ? (paramless_macro ? 0 : cell().size())
|
return math ? (paramless_macro ? 0 : cell().size())
|
||||||
: (text()->empty() ? 0 : paragraph().size());
|
: (text()->empty() ? 0 : paragraph().size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,7 +243,7 @@ pasteSelectionHelper(DocIterator const & cur, ParagraphList const & parlist,
|
|||||||
|
|
||||||
InsetIterator const i_end = inset_iterator_end(in);
|
InsetIterator const i_end = inset_iterator_end(in);
|
||||||
for (InsetIterator it = inset_iterator_begin(in); it != i_end; ++it) {
|
for (InsetIterator it = inset_iterator_begin(in); it != i_end; ++it) {
|
||||||
// Even though this will also be done later, it has to be done here
|
// Even though this will also be done later, it has to be done here
|
||||||
// since some inset might going to try to access
|
// since some inset might going to try to access
|
||||||
// the buffer() member.
|
// the buffer() member.
|
||||||
it->setBuffer(const_cast<Buffer &>(buffer));
|
it->setBuffer(const_cast<Buffer &>(buffer));
|
||||||
@ -471,7 +471,7 @@ PitPosPair eraseSelectionHelper(BufferParams const & params,
|
|||||||
|
|
||||||
// Separate handling of paragraph break:
|
// Separate handling of paragraph break:
|
||||||
if (merge && pit != endpit &&
|
if (merge && pit != endpit &&
|
||||||
(pit + 1 != endpit
|
(pit + 1 != endpit
|
||||||
|| pars[pit].hasSameLayout(pars[endpit])
|
|| pars[pit].hasSameLayout(pars[endpit])
|
||||||
|| pars[endpit].size() == endpos)) {
|
|| pars[endpit].size() == endpos)) {
|
||||||
if (pit + 1 == endpit)
|
if (pit + 1 == endpit)
|
||||||
@ -536,7 +536,7 @@ Buffer * copyToTempBuffer(ParagraphList const & paragraphs, DocumentClassConstPt
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void putClipboard(ParagraphList const & paragraphs,
|
void putClipboard(ParagraphList const & paragraphs,
|
||||||
DocumentClassConstPtr docclass, docstring const & plaintext)
|
DocumentClassConstPtr docclass, docstring const & plaintext)
|
||||||
{
|
{
|
||||||
Buffer * buffer = copyToTempBuffer(paragraphs, docclass);
|
Buffer * buffer = copyToTempBuffer(paragraphs, docclass);
|
||||||
@ -636,7 +636,7 @@ void copySelectionHelper(Buffer const & buf, Text const & text,
|
|||||||
// latex_language. This is invalid for others, so we
|
// latex_language. This is invalid for others, so we
|
||||||
// need to change it to the buffer language.
|
// need to change it to the buffer language.
|
||||||
if (it->isPassThru())
|
if (it->isPassThru())
|
||||||
it->changeLanguage(buf.params(),
|
it->changeLanguage(buf.params(),
|
||||||
latex_language, buf.language());
|
latex_language, buf.language());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -705,11 +705,11 @@ bool reduceSelectionToOneCell(Cursor & cur)
|
|||||||
// the easy case: do nothing if only one cell is selected
|
// the easy case: do nothing if only one cell is selected
|
||||||
if (i1.idx() == i2.idx())
|
if (i1.idx() == i2.idx())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
cur.top().pos() = 0;
|
cur.top().pos() = 0;
|
||||||
cur.resetAnchor();
|
cur.resetAnchor();
|
||||||
cur.top().pos() = cur.top().lastpos();
|
cur.top().pos() = cur.top().lastpos();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -718,15 +718,15 @@ bool multipleCellsSelected(Cursor const & cur)
|
|||||||
{
|
{
|
||||||
if (!cur.selection() || !cur.inMathed())
|
if (!cur.selection() || !cur.inMathed())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
CursorSlice i1 = cur.selBegin();
|
CursorSlice i1 = cur.selBegin();
|
||||||
CursorSlice i2 = cur.selEnd();
|
CursorSlice i2 = cur.selEnd();
|
||||||
if (!i1.inset().asInsetMath())
|
if (!i1.inset().asInsetMath())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (i1.idx() == i2.idx())
|
if (i1.idx() == i2.idx())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -739,7 +739,7 @@ void switchBetweenClasses(DocumentClassConstPtr oldone,
|
|||||||
LBUFERR(!in.paragraphs().empty());
|
LBUFERR(!in.paragraphs().empty());
|
||||||
if (oldone == newone)
|
if (oldone == newone)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DocumentClass const & oldtc = *oldone;
|
DocumentClass const & oldtc = *oldone;
|
||||||
DocumentClass const & newtc = *newone;
|
DocumentClass const & newtc = *newone;
|
||||||
|
|
||||||
@ -782,7 +782,7 @@ void switchBetweenClasses(DocumentClassConstPtr oldone,
|
|||||||
n == DocumentClass::plainInsetLayout().name();
|
n == DocumentClass::plainInsetLayout().name();
|
||||||
if (!is_undefined)
|
if (!is_undefined)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// The flex inset is undefined in newtc
|
// The flex inset is undefined in newtc
|
||||||
docstring const oldname = from_utf8(oldtc.name());
|
docstring const oldname = from_utf8(oldtc.name());
|
||||||
docstring const newname = from_utf8(newtc.name());
|
docstring const newname = from_utf8(newtc.name());
|
||||||
@ -988,7 +988,7 @@ void copySelectionToStack(Cursor const & cur, CutStack & cutstack)
|
|||||||
// and sel_end cursor
|
// and sel_end cursor
|
||||||
copySelectionHelper(*cur.buffer(), *text,
|
copySelectionHelper(*cur.buffer(), *text,
|
||||||
cur.selBegin().pit(), cur.selEnd().pit(),
|
cur.selBegin().pit(), cur.selEnd().pit(),
|
||||||
cur.selBegin().pos(), cur.selEnd().pos(),
|
cur.selBegin().pos(), cur.selEnd().pos(),
|
||||||
cur.buffer()->params().documentClassPtr(),
|
cur.buffer()->params().documentClassPtr(),
|
||||||
cutstack);
|
cutstack);
|
||||||
// Reset the dirty_tabular_stack_ flag only when something
|
// Reset the dirty_tabular_stack_ flag only when something
|
||||||
@ -1048,7 +1048,7 @@ void saveSelection(Cursor const & cur)
|
|||||||
// This function is called, not when a selection is formed, but when
|
// This function is called, not when a selection is formed, but when
|
||||||
// a selection is cleared. Therefore, multiple keyboard selection
|
// a selection is cleared. Therefore, multiple keyboard selection
|
||||||
// will not repeatively trigger this function (bug 3877).
|
// will not repeatively trigger this function (bug 3877).
|
||||||
if (cur.selection()
|
if (cur.selection()
|
||||||
&& cur.selBegin() == cur.bv().cursor().selBegin()
|
&& cur.selBegin() == cur.bv().cursor().selBegin()
|
||||||
&& cur.selEnd() == cur.bv().cursor().selEnd()) {
|
&& cur.selEnd() == cur.bv().cursor().selEnd()) {
|
||||||
LYXERR(Debug::SELECTION, "saveSelection: '" << cur.selectionAsString(true) << "'");
|
LYXERR(Debug::SELECTION, "saveSelection: '" << cur.selectionAsString(true) << "'");
|
||||||
|
@ -60,7 +60,7 @@ DocIterator::DocIterator(Buffer * buf, Inset * inset)
|
|||||||
|
|
||||||
DocIterator doc_iterator_begin(const Buffer * buf0, const Inset * inset0)
|
DocIterator doc_iterator_begin(const Buffer * buf0, const Inset * inset0)
|
||||||
{
|
{
|
||||||
Buffer * buf = const_cast<Buffer *>(buf0);
|
Buffer * buf = const_cast<Buffer *>(buf0);
|
||||||
Inset * inset = const_cast<Inset *>(inset0);
|
Inset * inset = const_cast<Inset *>(inset0);
|
||||||
DocIterator dit(buf, inset ? inset : &buf->inset());
|
DocIterator dit(buf, inset ? inset : &buf->inset());
|
||||||
dit.forwardPos();
|
dit.forwardPos();
|
||||||
@ -70,7 +70,7 @@ DocIterator doc_iterator_begin(const Buffer * buf0, const Inset * inset0)
|
|||||||
|
|
||||||
DocIterator doc_iterator_end(const Buffer * buf0, const Inset * inset0)
|
DocIterator doc_iterator_end(const Buffer * buf0, const Inset * inset0)
|
||||||
{
|
{
|
||||||
Buffer * buf = const_cast<Buffer *>(buf0);
|
Buffer * buf = const_cast<Buffer *>(buf0);
|
||||||
Inset * inset = const_cast<Inset *>(inset0);
|
Inset * inset = const_cast<Inset *>(inset0);
|
||||||
return DocIterator(buf, inset ? inset : &buf->inset());
|
return DocIterator(buf, inset ? inset : &buf->inset());
|
||||||
}
|
}
|
||||||
@ -96,7 +96,7 @@ DocIterator DocIterator::clone(Buffer * buffer) const
|
|||||||
bool DocIterator::inRegexped() const
|
bool DocIterator::inRegexped() const
|
||||||
{
|
{
|
||||||
InsetMath * im = inset().asInsetMath();
|
InsetMath * im = inset().asInsetMath();
|
||||||
if (!im)
|
if (!im)
|
||||||
return false;
|
return false;
|
||||||
InsetMathHull * hull = im->asHullInset();
|
InsetMathHull * hull = im->asHullInset();
|
||||||
return hull && hull->getType() == hullRegexp;
|
return hull && hull->getType() == hullRegexp;
|
||||||
@ -554,7 +554,7 @@ bool DocIterator::fixIfBroken()
|
|||||||
if (empty())
|
if (empty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Go through the slice stack from the bottom.
|
// Go through the slice stack from the bottom.
|
||||||
// Check that all coordinates (idx, pit, pos) are correct and
|
// Check that all coordinates (idx, pit, pos) are correct and
|
||||||
// that the inset is the one which is claimed to be there
|
// that the inset is the one which is claimed to be there
|
||||||
Inset * inset = &slices_[0].inset();
|
Inset * inset = &slices_[0].inset();
|
||||||
@ -653,7 +653,7 @@ int DocIterator::find(MathData const & cell) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int DocIterator::find(Inset const * inset) const
|
int DocIterator::find(Inset const * inset) const
|
||||||
{
|
{
|
||||||
for (size_t l = 0; l != slices_.size(); ++l) {
|
for (size_t l = 0; l != slices_.size(); ++l) {
|
||||||
if (&slices_[l].inset() == inset)
|
if (&slices_[l].inset() == inset)
|
||||||
@ -676,13 +676,13 @@ void DocIterator::cutOff(int above)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DocIterator::append(vector<CursorSlice> const & x)
|
void DocIterator::append(vector<CursorSlice> const & x)
|
||||||
{
|
{
|
||||||
slices_.insert(slices_.end(), x.begin(), x.end());
|
slices_.insert(slices_.end(), x.begin(), x.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DocIterator::append(DocIterator::idx_type idx, pos_type pos)
|
void DocIterator::append(DocIterator::idx_type idx, pos_type pos)
|
||||||
{
|
{
|
||||||
slices_.push_back(CursorSlice());
|
slices_.push_back(CursorSlice());
|
||||||
top().idx() = idx;
|
top().idx() = idx;
|
||||||
|
@ -35,7 +35,7 @@ struct Speller {
|
|||||||
};
|
};
|
||||||
|
|
||||||
typedef map<string, Speller> Spellers;
|
typedef map<string, Speller> Spellers;
|
||||||
|
|
||||||
} // anon namespace
|
} // anon namespace
|
||||||
|
|
||||||
struct EnchantChecker::Private
|
struct EnchantChecker::Private
|
||||||
@ -92,7 +92,7 @@ enchant::Dict * EnchantChecker::Private::speller(string const & lang)
|
|||||||
Spellers::iterator it = spellers_.find(lang);
|
Spellers::iterator it = spellers_.find(lang);
|
||||||
if (it != spellers_.end())
|
if (it != spellers_.end())
|
||||||
return it->second.speller;
|
return it->second.speller;
|
||||||
|
|
||||||
return addSpeller(lang);
|
return addSpeller(lang);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,8 +141,8 @@ void EnchantChecker::insert(WordLangTuple const & word)
|
|||||||
advanceChangeNumber();
|
advanceChangeNumber();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void EnchantChecker::remove(WordLangTuple const & word)
|
void EnchantChecker::remove(WordLangTuple const & word)
|
||||||
{
|
{
|
||||||
enchant::Dict * m = d->speller(word.lang()->code());
|
enchant::Dict * m = d->speller(word.lang()->code());
|
||||||
@ -176,7 +176,7 @@ void EnchantChecker::suggest(WordLangTuple const & wl,
|
|||||||
|
|
||||||
vector<string> suggs = m->suggest(utf8word);
|
vector<string> suggs = m->suggest(utf8word);
|
||||||
vector<string>::const_iterator it = suggs.begin();
|
vector<string>::const_iterator it = suggs.begin();
|
||||||
|
|
||||||
for (; it != suggs.end(); ++it)
|
for (; it != suggs.end(); ++it)
|
||||||
suggestions.push_back(from_utf8(*it));
|
suggestions.push_back(from_utf8(*it));
|
||||||
}
|
}
|
||||||
@ -195,7 +195,7 @@ int EnchantChecker::numDictionaries() const
|
|||||||
{
|
{
|
||||||
return d->spellers_.size();
|
return d->spellers_.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
docstring const EnchantChecker::error()
|
docstring const EnchantChecker::error()
|
||||||
{
|
{
|
||||||
|
@ -58,7 +58,7 @@ string const & Floating::htmlTag() const
|
|||||||
|
|
||||||
|
|
||||||
string Floating::defaultCSSClass() const
|
string Floating::defaultCSSClass() const
|
||||||
{
|
{
|
||||||
if (!defaultcssclass_.empty())
|
if (!defaultcssclass_.empty())
|
||||||
return defaultcssclass_;
|
return defaultcssclass_;
|
||||||
string d;
|
string d;
|
||||||
|
@ -354,7 +354,7 @@ int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams,
|
|||||||
if (!runparams.pass_thru && bits_.number() == FONT_ON
|
if (!runparams.pass_thru && bits_.number() == FONT_ON
|
||||||
&& prev.fontInfo().number() != FONT_ON
|
&& prev.fontInfo().number() != FONT_ON
|
||||||
&& (language()->lang() == "hebrew"
|
&& (language()->lang() == "hebrew"
|
||||||
|| language()->lang() == "farsi"
|
|| language()->lang() == "farsi"
|
||||||
|| language()->lang() == "arabic_arabi")) {
|
|| language()->lang() == "arabic_arabi")) {
|
||||||
os << "{\\beginL ";
|
os << "{\\beginL ";
|
||||||
count += 9;
|
count += 9;
|
||||||
|
@ -523,12 +523,12 @@ string getSizeCSS(FontSize const & s)
|
|||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace anonymous
|
} // namespace anonymous
|
||||||
|
|
||||||
|
|
||||||
// FIXME This does not yet handle color
|
// FIXME This does not yet handle color
|
||||||
docstring FontInfo::asCSS() const
|
docstring FontInfo::asCSS() const
|
||||||
{
|
{
|
||||||
string retval;
|
string retval;
|
||||||
string tmp = getFamilyCSS(family_);
|
string tmp = getFamilyCSS(family_);
|
||||||
@ -541,7 +541,7 @@ docstring FontInfo::asCSS() const
|
|||||||
tmp = getSizeCSS(size_);
|
tmp = getSizeCSS(size_);
|
||||||
if (!tmp.empty())
|
if (!tmp.empty())
|
||||||
appendSep(retval, makeCSSTag("font-size", tmp));
|
appendSep(retval, makeCSSTag("font-size", tmp));
|
||||||
return from_ascii(retval);
|
return from_ascii(retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ void FontList::erase(pos_type pos)
|
|||||||
iterator it = fontIterator(pos);
|
iterator it = fontIterator(pos);
|
||||||
iterator beg = list_.begin();
|
iterator beg = list_.begin();
|
||||||
if (it != list_.end() && it->pos() == pos
|
if (it != list_.end() && it->pos() == pos
|
||||||
&& (pos == 0
|
&& (pos == 0
|
||||||
|| (it != list_.begin() && prev(it, 1)->pos() == pos - 1))) {
|
|| (it != list_.begin() && prev(it, 1)->pos() == pos - 1))) {
|
||||||
|
|
||||||
// If it is a multi-character font
|
// If it is a multi-character font
|
||||||
@ -135,7 +135,7 @@ void FontList::set(pos_type pos, Font const & font)
|
|||||||
size_t const i = distance(list_.begin(), it);
|
size_t const i = distance(list_.begin(), it);
|
||||||
|
|
||||||
// Is position pos a beginning of a font block?
|
// Is position pos a beginning of a font block?
|
||||||
bool const begin = pos == 0 || !found
|
bool const begin = pos == 0 || !found
|
||||||
|| (i > 0 && list_[i - 1].pos() == pos - 1);
|
|| (i > 0 && list_[i - 1].pos() == pos - 1);
|
||||||
|
|
||||||
// Is position pos at the end of a font block?
|
// Is position pos at the end of a font block?
|
||||||
|
@ -28,7 +28,7 @@ bool Graph::bfs_init(int s, bool clear_visited, queue<int> & Q)
|
|||||||
{
|
{
|
||||||
if (s < 0)
|
if (s < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!Q.empty())
|
if (!Q.empty())
|
||||||
Q = queue<int>();
|
Q = queue<int>();
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ struct HunspellChecker::Private
|
|||||||
const string dictDirectory(void) const { return "dicts"; }
|
const string dictDirectory(void) const { return "dicts"; }
|
||||||
int maxLookupSelector(void) const { return 5; }
|
int maxLookupSelector(void) const { return 5; }
|
||||||
const string HunspellDictionaryName(Language const * lang) {
|
const string HunspellDictionaryName(Language const * lang) {
|
||||||
return lang->variety().empty()
|
return lang->variety().empty()
|
||||||
? lang->code()
|
? lang->code()
|
||||||
: lang->code() + "-" + lang->variety();
|
: lang->code() + "-" + lang->variety();
|
||||||
}
|
}
|
||||||
|
@ -481,7 +481,7 @@ docstring KeyMap::printBindings(FuncRequest const & func,
|
|||||||
Bindings bindings = findBindings(func);
|
Bindings bindings = findBindings(func);
|
||||||
if (bindings.empty())
|
if (bindings.empty())
|
||||||
return docstring();
|
return docstring();
|
||||||
|
|
||||||
odocstringstream res;
|
odocstringstream res;
|
||||||
Bindings::const_iterator cit = bindings.begin();
|
Bindings::const_iterator cit = bindings.begin();
|
||||||
Bindings::const_iterator cit_end = bindings.end();
|
Bindings::const_iterator cit_end = bindings.end();
|
||||||
@ -544,7 +544,7 @@ KeyMap::BindingList KeyMap::listBindings(bool unbound, KeyMap::ItemType tag) con
|
|||||||
}
|
}
|
||||||
if (!has_action)
|
if (!has_action)
|
||||||
list.push_back(Binding(FuncRequest(action), KeySequence(0, 0), tag));
|
list.push_back(Binding(FuncRequest(action), KeySequence(0, 0), tag));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
@ -159,7 +159,7 @@ docstring const KeySequence::print(outputFormat format) const
|
|||||||
buf += "M-";
|
buf += "M-";
|
||||||
if (mod & ShiftModifier)
|
if (mod & ShiftModifier)
|
||||||
buf += "S-";
|
buf += "S-";
|
||||||
|
|
||||||
buf += from_utf8(sequence[i].getSymbolName());
|
buf += from_utf8(sequence[i].getSymbolName());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -348,7 +348,7 @@ int LaTeX::run(TeXErrors & terr)
|
|||||||
} else {
|
} else {
|
||||||
LYXERR(Debug::DEPEND, "Dep. file has NOT changed");
|
LYXERR(Debug::DEPEND, "Dep. file has NOT changed");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3
|
// 3
|
||||||
// rerun bibtex?
|
// rerun bibtex?
|
||||||
// Complex bibliography packages such as Biblatex require
|
// Complex bibliography packages such as Biblatex require
|
||||||
@ -451,7 +451,7 @@ bool LaTeX::runMakeIndex(string const & f, OutputParams const & runparams,
|
|||||||
{
|
{
|
||||||
string tmp = runparams.use_japanese ?
|
string tmp = runparams.use_japanese ?
|
||||||
lyxrc.jindex_command : lyxrc.index_command;
|
lyxrc.jindex_command : lyxrc.index_command;
|
||||||
|
|
||||||
if (!runparams.index_command.empty())
|
if (!runparams.index_command.empty())
|
||||||
tmp = runparams.index_command;
|
tmp = runparams.index_command;
|
||||||
|
|
||||||
|
@ -373,7 +373,7 @@ bool LaTeXFont::readFont(Lexer & lex)
|
|||||||
error = true;
|
error = true;
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch (static_cast<LaTeXFontTags>(le)) {
|
switch (static_cast<LaTeXFontTags>(le)) {
|
||||||
|
@ -95,7 +95,7 @@ enum LayoutTags {
|
|||||||
LT_HTMLITEM,
|
LT_HTMLITEM,
|
||||||
LT_HTMLITEMATTR,
|
LT_HTMLITEMATTR,
|
||||||
LT_HTMLLABEL,
|
LT_HTMLLABEL,
|
||||||
LT_HTMLLABELATTR,
|
LT_HTMLLABELATTR,
|
||||||
LT_HTMLLABELFIRST,
|
LT_HTMLLABELFIRST,
|
||||||
LT_HTMLPREAMBLE,
|
LT_HTMLPREAMBLE,
|
||||||
LT_HTMLSTYLE,
|
LT_HTMLSTYLE,
|
||||||
@ -283,7 +283,7 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass)
|
|||||||
error = true;
|
error = true;
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch (static_cast<LayoutTags>(le)) {
|
switch (static_cast<LayoutTags>(le)) {
|
||||||
@ -328,7 +328,7 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass)
|
|||||||
if (obsoleted_by().empty())
|
if (obsoleted_by().empty())
|
||||||
obsoleted_by_ = style;
|
obsoleted_by_ = style;
|
||||||
} else {
|
} else {
|
||||||
LYXERR0("Cannot replace with unknown style `"
|
LYXERR0("Cannot replace with unknown style `"
|
||||||
<< style << '\'');
|
<< style << '\'');
|
||||||
|
|
||||||
//lex.printError("Cannot replace with"
|
//lex.printError("Cannot replace with"
|
||||||
@ -536,7 +536,7 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass)
|
|||||||
case LT_ALIGN:
|
case LT_ALIGN:
|
||||||
readAlign(lex);
|
readAlign(lex);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_ALIGNPOSSIBLE:
|
case LT_ALIGNPOSSIBLE:
|
||||||
readAlignPossible(lex);
|
readAlignPossible(lex);
|
||||||
break;
|
break;
|
||||||
@ -550,17 +550,17 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_ENDLABELSTRING:
|
case LT_ENDLABELSTRING:
|
||||||
lex >> endlabelstring_;
|
lex >> endlabelstring_;
|
||||||
endlabelstring_ = trim(endlabelstring_);
|
endlabelstring_ = trim(endlabelstring_);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_LABELSTRING_APPENDIX:
|
case LT_LABELSTRING_APPENDIX:
|
||||||
lex >> labelstring_appendix_;
|
lex >> labelstring_appendix_;
|
||||||
labelstring_appendix_ = trim(labelstring_appendix_);
|
labelstring_appendix_ = trim(labelstring_appendix_);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_LABELCOUNTER:
|
case LT_LABELCOUNTER:
|
||||||
lex >> counter;
|
lex >> counter;
|
||||||
counter = trim(counter);
|
counter = trim(counter);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -595,7 +595,7 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass)
|
|||||||
requires_.insert(req.begin(), req.end());
|
requires_.insert(req.begin(), req.end());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case LT_REFPREFIX: {
|
case LT_REFPREFIX: {
|
||||||
docstring arg;
|
docstring arg;
|
||||||
lex >> arg;
|
lex >> arg;
|
||||||
@ -609,7 +609,7 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass)
|
|||||||
case LT_HTMLTAG:
|
case LT_HTMLTAG:
|
||||||
lex >> htmltag_;
|
lex >> htmltag_;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_HTMLATTR:
|
case LT_HTMLATTR:
|
||||||
lex >> htmlattr_;
|
lex >> htmlattr_;
|
||||||
break;
|
break;
|
||||||
@ -617,23 +617,23 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass)
|
|||||||
case LT_HTMLITEM:
|
case LT_HTMLITEM:
|
||||||
lex >> htmlitemtag_;
|
lex >> htmlitemtag_;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_HTMLITEMATTR:
|
case LT_HTMLITEMATTR:
|
||||||
lex >> htmlitemattr_;
|
lex >> htmlitemattr_;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_HTMLLABEL:
|
case LT_HTMLLABEL:
|
||||||
lex >> htmllabeltag_;
|
lex >> htmllabeltag_;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_HTMLLABELATTR:
|
case LT_HTMLLABELATTR:
|
||||||
lex >> htmllabelattr_;
|
lex >> htmllabelattr_;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_HTMLLABELFIRST:
|
case LT_HTMLLABELFIRST:
|
||||||
lex >> htmllabelfirst_;
|
lex >> htmllabelfirst_;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_HTMLSTYLE:
|
case LT_HTMLSTYLE:
|
||||||
htmlstyle_ = lex.getLongString(from_ascii("EndHTMLStyle"));
|
htmlstyle_ = lex.getLongString(from_ascii("EndHTMLStyle"));
|
||||||
break;
|
break;
|
||||||
@ -645,7 +645,7 @@ bool Layout::readIgnoreForcelocal(Lexer & lex, TextClass const & tclass)
|
|||||||
case LT_HTMLPREAMBLE:
|
case LT_HTMLPREAMBLE:
|
||||||
htmlpreamble_ = lex.getLongString(from_ascii("EndPreamble"));
|
htmlpreamble_ = lex.getLongString(from_ascii("EndPreamble"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_HTMLTITLE:
|
case LT_HTMLTITLE:
|
||||||
lex >> htmltitle_;
|
lex >> htmltitle_;
|
||||||
break;
|
break;
|
||||||
@ -1476,40 +1476,40 @@ int Layout::requiredArgs() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string const & Layout::htmltag() const
|
string const & Layout::htmltag() const
|
||||||
{
|
{
|
||||||
if (htmltag_.empty())
|
if (htmltag_.empty())
|
||||||
htmltag_ = "div";
|
htmltag_ = "div";
|
||||||
return htmltag_;
|
return htmltag_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string const & Layout::htmlattr() const
|
string const & Layout::htmlattr() const
|
||||||
{
|
{
|
||||||
if (htmlattr_.empty())
|
if (htmlattr_.empty())
|
||||||
htmlattr_ = "class=\"" + defaultCSSClass() + "\"";
|
htmlattr_ = "class=\"" + defaultCSSClass() + "\"";
|
||||||
return htmlattr_;
|
return htmlattr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string const & Layout::htmlitemtag() const
|
string const & Layout::htmlitemtag() const
|
||||||
{
|
{
|
||||||
if (htmlitemtag_.empty())
|
if (htmlitemtag_.empty())
|
||||||
htmlitemtag_ = "div";
|
htmlitemtag_ = "div";
|
||||||
return htmlitemtag_;
|
return htmlitemtag_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string const & Layout::htmlitemattr() const
|
string const & Layout::htmlitemattr() const
|
||||||
{
|
{
|
||||||
if (htmlitemattr_.empty())
|
if (htmlitemattr_.empty())
|
||||||
htmlitemattr_ = "class=\"" + defaultCSSItemClass() + "\"";
|
htmlitemattr_ = "class=\"" + defaultCSSItemClass() + "\"";
|
||||||
return htmlitemattr_;
|
return htmlitemattr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string const & Layout::htmllabeltag() const
|
string const & Layout::htmllabeltag() const
|
||||||
{
|
{
|
||||||
if (htmllabeltag_.empty()) {
|
if (htmllabeltag_.empty()) {
|
||||||
if (labeltype != LABEL_ABOVE &&
|
if (labeltype != LABEL_ABOVE &&
|
||||||
labeltype != LABEL_CENTERED)
|
labeltype != LABEL_CENTERED)
|
||||||
@ -1517,15 +1517,15 @@ string const & Layout::htmllabeltag() const
|
|||||||
else
|
else
|
||||||
htmllabeltag_ = "div";
|
htmllabeltag_ = "div";
|
||||||
}
|
}
|
||||||
return htmllabeltag_;
|
return htmllabeltag_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string const & Layout::htmllabelattr() const
|
string const & Layout::htmllabelattr() const
|
||||||
{
|
{
|
||||||
if (htmllabelattr_.empty())
|
if (htmllabelattr_.empty())
|
||||||
htmllabelattr_ = "class=\"" + defaultCSSLabelClass() + "\"";
|
htmllabelattr_ = "class=\"" + defaultCSSLabelClass() + "\"";
|
||||||
return htmllabelattr_;
|
return htmllabelattr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1533,7 +1533,7 @@ docstring Layout::htmlstyle() const
|
|||||||
{
|
{
|
||||||
if (!htmlstyle_.empty() && !htmlforcecss_)
|
if (!htmlstyle_.empty() && !htmlforcecss_)
|
||||||
return htmlstyle_;
|
return htmlstyle_;
|
||||||
if (htmldefaultstyle_.empty())
|
if (htmldefaultstyle_.empty())
|
||||||
makeDefaultCSS();
|
makeDefaultCSS();
|
||||||
docstring retval = htmldefaultstyle_;
|
docstring retval = htmldefaultstyle_;
|
||||||
if (!htmlstyle_.empty())
|
if (!htmlstyle_.empty())
|
||||||
@ -1543,7 +1543,7 @@ docstring Layout::htmlstyle() const
|
|||||||
|
|
||||||
|
|
||||||
string Layout::defaultCSSClass() const
|
string Layout::defaultCSSClass() const
|
||||||
{
|
{
|
||||||
if (!defaultcssclass_.empty())
|
if (!defaultcssclass_.empty())
|
||||||
return defaultcssclass_;
|
return defaultcssclass_;
|
||||||
docstring d;
|
docstring d;
|
||||||
@ -1585,12 +1585,12 @@ void Layout::makeDefaultCSS() const
|
|||||||
{
|
{
|
||||||
// this never needs to be redone, since reloading layouts will
|
// this never needs to be redone, since reloading layouts will
|
||||||
// wipe out what we did before.
|
// wipe out what we did before.
|
||||||
if (!htmldefaultstyle_.empty())
|
if (!htmldefaultstyle_.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// main font
|
// main font
|
||||||
htmldefaultstyle_ = font.asCSS();
|
htmldefaultstyle_ = font.asCSS();
|
||||||
|
|
||||||
// bottom margins
|
// bottom margins
|
||||||
string tmp;
|
string tmp;
|
||||||
if (topsep > 0)
|
if (topsep > 0)
|
||||||
@ -1598,7 +1598,7 @@ void Layout::makeDefaultCSS() const
|
|||||||
if (bottomsep > 0)
|
if (bottomsep > 0)
|
||||||
tmp += makeMarginValue("bottom", bottomsep);
|
tmp += makeMarginValue("bottom", bottomsep);
|
||||||
if (!leftmargin.empty()) {
|
if (!leftmargin.empty()) {
|
||||||
// we can't really do what LyX does with the margin, so
|
// we can't really do what LyX does with the margin, so
|
||||||
// we'll just figure out how many characters it is
|
// we'll just figure out how many characters it is
|
||||||
int const len = leftmargin.length();
|
int const len = leftmargin.length();
|
||||||
tmp += makeMarginValue("left", len);
|
tmp += makeMarginValue("left", len);
|
||||||
@ -1607,7 +1607,7 @@ void Layout::makeDefaultCSS() const
|
|||||||
int const len = rightmargin.length();
|
int const len = rightmargin.length();
|
||||||
tmp += makeMarginValue("right", len);
|
tmp += makeMarginValue("right", len);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!tmp.empty()) {
|
if (!tmp.empty()) {
|
||||||
if (!htmldefaultstyle_.empty())
|
if (!htmldefaultstyle_.empty())
|
||||||
htmldefaultstyle_ += from_ascii("\n");
|
htmldefaultstyle_ += from_ascii("\n");
|
||||||
@ -1622,21 +1622,21 @@ void Layout::makeDefaultCSS() const
|
|||||||
|
|
||||||
// wrap up what we have, if anything
|
// wrap up what we have, if anything
|
||||||
if (!htmldefaultstyle_.empty())
|
if (!htmldefaultstyle_.empty())
|
||||||
htmldefaultstyle_ =
|
htmldefaultstyle_ =
|
||||||
from_ascii(htmltag() + "." + defaultCSSClass() + " {\n") +
|
from_ascii(htmltag() + "." + defaultCSSClass() + " {\n") +
|
||||||
htmldefaultstyle_ + from_ascii("\n}\n");
|
htmldefaultstyle_ + from_ascii("\n}\n");
|
||||||
|
|
||||||
if (labeltype == LABEL_NO_LABEL || htmllabeltag() == "NONE")
|
if (labeltype == LABEL_NO_LABEL || htmllabeltag() == "NONE")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
docstring labelCSS;
|
docstring labelCSS;
|
||||||
|
|
||||||
// label font
|
// label font
|
||||||
if (labelfont != font)
|
if (labelfont != font)
|
||||||
labelCSS = labelfont.asCSS() + from_ascii("\n");
|
labelCSS = labelfont.asCSS() + from_ascii("\n");
|
||||||
if (labeltype == LABEL_CENTERED)
|
if (labeltype == LABEL_CENTERED)
|
||||||
labelCSS += from_ascii("text-align: center;\n");
|
labelCSS += from_ascii("text-align: center;\n");
|
||||||
|
|
||||||
if (!labelCSS.empty())
|
if (!labelCSS.empty())
|
||||||
htmldefaultstyle_ +=
|
htmldefaultstyle_ +=
|
||||||
from_ascii(htmllabeltag() + "." + defaultCSSLabelClass() + " {\n") +
|
from_ascii(htmllabeltag() + "." + defaultCSSLabelClass() + " {\n") +
|
||||||
|
@ -41,7 +41,7 @@ namespace lyx {
|
|||||||
|
|
||||||
LayoutFile::LayoutFile(string const & fn, string const & cln,
|
LayoutFile::LayoutFile(string const & fn, string const & cln,
|
||||||
string const & desc, string const & prereq,
|
string const & desc, string const & prereq,
|
||||||
string const & category, bool texclassavail)
|
string const & category, bool texclassavail)
|
||||||
{
|
{
|
||||||
name_ = onlyFileName(fn);
|
name_ = onlyFileName(fn);
|
||||||
path_ = fn.rfind('/') == string::npos ? string() : onlyPath(fn);
|
path_ = fn.rfind('/') == string::npos ? string() : onlyPath(fn);
|
||||||
@ -63,7 +63,7 @@ LayoutFileList::~LayoutFileList()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LayoutFileList & LayoutFileList::get()
|
LayoutFileList & LayoutFileList::get()
|
||||||
{
|
{
|
||||||
static LayoutFileList baseclasslist;
|
static LayoutFileList baseclasslist;
|
||||||
return baseclasslist;
|
return baseclasslist;
|
||||||
@ -129,23 +129,23 @@ bool LayoutFileList::read()
|
|||||||
default:
|
default:
|
||||||
string const fname = lex.getString();
|
string const fname = lex.getString();
|
||||||
LYXERR(Debug::TCLASS, "Fname: " << fname);
|
LYXERR(Debug::TCLASS, "Fname: " << fname);
|
||||||
if (!lex.next())
|
if (!lex.next())
|
||||||
break;
|
break;
|
||||||
string const clname = lex.getString();
|
string const clname = lex.getString();
|
||||||
LYXERR(Debug::TCLASS, "Clname: " << clname);
|
LYXERR(Debug::TCLASS, "Clname: " << clname);
|
||||||
if (!lex.next())
|
if (!lex.next())
|
||||||
break;
|
break;
|
||||||
string const desc = lex.getString();
|
string const desc = lex.getString();
|
||||||
LYXERR(Debug::TCLASS, "Desc: " << desc);
|
LYXERR(Debug::TCLASS, "Desc: " << desc);
|
||||||
if (!lex.next())
|
if (!lex.next())
|
||||||
break;
|
break;
|
||||||
bool avail = lex.getBool();
|
bool avail = lex.getBool();
|
||||||
LYXERR(Debug::TCLASS, "Avail: " << avail);
|
LYXERR(Debug::TCLASS, "Avail: " << avail);
|
||||||
if (!lex.next())
|
if (!lex.next())
|
||||||
break;
|
break;
|
||||||
string const prereq = lex.getString();
|
string const prereq = lex.getString();
|
||||||
LYXERR(Debug::TCLASS, "Prereq: " << prereq);
|
LYXERR(Debug::TCLASS, "Prereq: " << prereq);
|
||||||
if (!lex.next())
|
if (!lex.next())
|
||||||
break;
|
break;
|
||||||
string const category = lex.getString();
|
string const category = lex.getString();
|
||||||
LYXERR(Debug::TCLASS, "Category: " << category);
|
LYXERR(Debug::TCLASS, "Category: " << category);
|
||||||
@ -190,7 +190,7 @@ void LayoutFileList::reset(LayoutFileIndex const & classname)
|
|||||||
LATTEST(haveClass(classname));
|
LATTEST(haveClass(classname));
|
||||||
// safe to continue, since we will make an empty LayoutFile
|
// safe to continue, since we will make an empty LayoutFile
|
||||||
LayoutFile * tc = classmap_[classname];
|
LayoutFile * tc = classmap_[classname];
|
||||||
LayoutFile * tmpl =
|
LayoutFile * tmpl =
|
||||||
new LayoutFile(tc->name(), tc->latexname(), tc->description(),
|
new LayoutFile(tc->name(), tc->latexname(), tc->description(),
|
||||||
tc->prerequisites(), tc->category(),
|
tc->prerequisites(), tc->category(),
|
||||||
tc->isTeXClassAvailable());
|
tc->isTeXClassAvailable());
|
||||||
@ -201,7 +201,7 @@ void LayoutFileList::reset(LayoutFileIndex const & classname)
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
string layoutpost =
|
string layoutpost =
|
||||||
"Columns 1\n"
|
"Columns 1\n"
|
||||||
"Sides 1\n"
|
"Sides 1\n"
|
||||||
"SecNumDepth 2\n"
|
"SecNumDepth 2\n"
|
||||||
@ -218,7 +218,7 @@ string layoutpost =
|
|||||||
" AlignPossible Block, Left, Right, Center\n"
|
" AlignPossible Block, Left, Right, Center\n"
|
||||||
" LabelType No_Label\n"
|
" LabelType No_Label\n"
|
||||||
"End\n";
|
"End\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -229,7 +229,7 @@ LayoutFileIndex LayoutFileList::addEmptyClass(string const & textclass)
|
|||||||
TempFile tempfile("basicXXXXXX.layout");
|
TempFile tempfile("basicXXXXXX.layout");
|
||||||
FileName const tempLayout = tempfile.name();
|
FileName const tempLayout = tempfile.name();
|
||||||
ofstream ofs(tempLayout.toFilesystemEncoding().c_str());
|
ofstream ofs(tempLayout.toFilesystemEncoding().c_str());
|
||||||
// This writes a very basic class, but it also attempts to include
|
// This writes a very basic class, but it also attempts to include
|
||||||
// stdclass.inc. That would give us something moderately usable.
|
// stdclass.inc. That would give us something moderately usable.
|
||||||
ofs << "# This layout is automatically generated\n"
|
ofs << "# This layout is automatically generated\n"
|
||||||
"# \\DeclareLaTeXClass{" << textclass << "}\n\n"
|
"# \\DeclareLaTeXClass{" << textclass << "}\n\n"
|
||||||
@ -241,13 +241,13 @@ LayoutFileIndex LayoutFileList::addEmptyClass(string const & textclass)
|
|||||||
// We do not know if a LaTeX class is available for this document, but setting
|
// We do not know if a LaTeX class is available for this document, but setting
|
||||||
// the last parameter to true will suppress a warning message about missing
|
// the last parameter to true will suppress a warning message about missing
|
||||||
// tex class.
|
// tex class.
|
||||||
LayoutFile * tc = new LayoutFile(textclass, textclass,
|
LayoutFile * tc = new LayoutFile(textclass, textclass,
|
||||||
"Unknown text class " + textclass, textclass + ".cls", "", true);
|
"Unknown text class " + textclass, textclass + ".cls", "", true);
|
||||||
|
|
||||||
if (!tc->load(tempLayout.absFileName())) {
|
if (!tc->load(tempLayout.absFileName())) {
|
||||||
// The only way this happens is because the hardcoded layout file
|
// The only way this happens is because the hardcoded layout file
|
||||||
// above is wrong or stdclass.inc cannot be found. So try again
|
// above is wrong or stdclass.inc cannot be found. So try again
|
||||||
// without stdclass.inc and without stdinsets.inc.
|
// without stdclass.inc and without stdinsets.inc.
|
||||||
ofstream ofs2(tempLayout.toFilesystemEncoding().c_str());
|
ofstream ofs2(tempLayout.toFilesystemEncoding().c_str());
|
||||||
ofs2 << "# This layout is automatically generated\n"
|
ofs2 << "# This layout is automatically generated\n"
|
||||||
"# \\DeclareLaTeXClass{" << textclass << "}\n\n"
|
"# \\DeclareLaTeXClass{" << textclass << "}\n\n"
|
||||||
@ -273,10 +273,10 @@ LayoutFileIndex LayoutFileList::addLocalLayout(
|
|||||||
// FIXME There is a bug here: 4593
|
// FIXME There is a bug here: 4593
|
||||||
//
|
//
|
||||||
// only check for textclass.layout file, .cls can be anywhere in $TEXINPUTS
|
// only check for textclass.layout file, .cls can be anywhere in $TEXINPUTS
|
||||||
// NOTE: latex class name is defined in textclass.layout, which can be
|
// NOTE: latex class name is defined in textclass.layout, which can be
|
||||||
// different from textclass
|
// different from textclass
|
||||||
string fullName = addName(path, textclass + ".layout");
|
string fullName = addName(path, textclass + ".layout");
|
||||||
|
|
||||||
FileName layout_file(fullName);
|
FileName layout_file(fullName);
|
||||||
bool moved = false;
|
bool moved = false;
|
||||||
|
|
||||||
|
@ -29,10 +29,10 @@ namespace lyx {
|
|||||||
|
|
||||||
// the previous document class may have loaded some modules that the
|
// the previous document class may have loaded some modules that the
|
||||||
// new one excludes, and the new class may provide, etc, some that
|
// new one excludes, and the new class may provide, etc, some that
|
||||||
// conflict with ones that were already loaded. So we need to go
|
// conflict with ones that were already loaded. So we need to go
|
||||||
// through the list and fix everything. I suppose there are various
|
// through the list and fix everything. I suppose there are various
|
||||||
// ways this could be done, but the following seems to work at the
|
// ways this could be done, but the following seems to work at the
|
||||||
// moment. (Thanks to Philippe Charpentier for helping work out all
|
// moment. (Thanks to Philippe Charpentier for helping work out all
|
||||||
// the bugs---rgh.)
|
// the bugs---rgh.)
|
||||||
bool LayoutModuleList::adaptToBaseClass(LayoutFile const * const lay,
|
bool LayoutModuleList::adaptToBaseClass(LayoutFile const * const lay,
|
||||||
std::list<string> const & removedModules)
|
std::list<string> const & removedModules)
|
||||||
@ -53,14 +53,14 @@ bool LayoutModuleList::adaptToBaseClass(LayoutFile const * const lay,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LayoutModuleList::moduleCanBeAdded(string const & modName,
|
bool LayoutModuleList::moduleCanBeAdded(string const & modName,
|
||||||
LayoutFile const * const lay) const
|
LayoutFile const * const lay) const
|
||||||
{
|
{
|
||||||
// Is the module already present?
|
// Is the module already present?
|
||||||
const_iterator it = begin();
|
const_iterator it = begin();
|
||||||
const_iterator const en = end();
|
const_iterator const en = end();
|
||||||
for (; it != en; ++it)
|
for (; it != en; ++it)
|
||||||
if (*it == modName)
|
if (*it == modName)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
LyXModule const * const lm = theModuleList[modName];
|
LyXModule const * const lm = theModuleList[modName];
|
||||||
@ -88,7 +88,7 @@ bool LayoutModuleList::moduleCanBeAdded(string const & modName,
|
|||||||
vector<string>::const_iterator ren = reqs.end();
|
vector<string>::const_iterator ren = reqs.end();
|
||||||
bool foundone = false;
|
bool foundone = false;
|
||||||
for (; rit != ren; ++rit) {
|
for (; rit != ren; ++rit) {
|
||||||
if (find(mit, men, *rit) != men ||
|
if (find(mit, men, *rit) != men ||
|
||||||
find(provmodstart, provmodend, *rit) != provmodend) {
|
find(provmodstart, provmodend, *rit) != provmodend) {
|
||||||
foundone = true;
|
foundone = true;
|
||||||
break;
|
break;
|
||||||
@ -147,7 +147,7 @@ void LayoutModuleList::addDefaultModules(LayoutFile const * const lay,
|
|||||||
// make sure the user hasn't removed it
|
// make sure the user hasn't removed it
|
||||||
if (find(removedModules.begin(), removedModules.end(), modName) !=
|
if (find(removedModules.begin(), removedModules.end(), modName) !=
|
||||||
removedModules.end()) {
|
removedModules.end()) {
|
||||||
LYXERR(Debug::TCLASS, "Default module `" << modName <<
|
LYXERR(Debug::TCLASS, "Default module `" << modName <<
|
||||||
"' not added because removed by user.");
|
"' not added because removed by user.");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -155,7 +155,7 @@ void LayoutModuleList::addDefaultModules(LayoutFile const * const lay,
|
|||||||
if (!moduleCanBeAdded(modName, lay)) {
|
if (!moduleCanBeAdded(modName, lay)) {
|
||||||
// FIXME This could be because it's already present, so we should
|
// FIXME This could be because it's already present, so we should
|
||||||
// probably return something indicating that.
|
// probably return something indicating that.
|
||||||
LYXERR(Debug::TCLASS, "Default module `" << modName <<
|
LYXERR(Debug::TCLASS, "Default module `" << modName <<
|
||||||
"' could not be added.");
|
"' could not be added.");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -202,7 +202,7 @@ bool LayoutModuleList::removeBadModules(LayoutFile const * const lay)
|
|||||||
bool excluded = false;
|
bool excluded = false;
|
||||||
for (; !excluded && pit != pen; ++pit) {
|
for (; !excluded && pit != pen; ++pit) {
|
||||||
if (!LyXModule::areCompatible(modname, *pit)) {
|
if (!LyXModule::areCompatible(modname, *pit)) {
|
||||||
LYXERR0("Module " << modname <<
|
LYXERR0("Module " << modname <<
|
||||||
" dropped because it conflicts with provided module `" << *pit << "'.");
|
" dropped because it conflicts with provided module `" << *pit << "'.");
|
||||||
consistent = false;
|
consistent = false;
|
||||||
excluded = true;
|
excluded = true;
|
||||||
@ -219,7 +219,7 @@ bool LayoutModuleList::removeBadModules(LayoutFile const * const lay)
|
|||||||
// Perform a consistency check on the set of modules. We need to make
|
// Perform a consistency check on the set of modules. We need to make
|
||||||
// sure that none of the modules exclude each other and that requires
|
// sure that none of the modules exclude each other and that requires
|
||||||
// are satisfied.
|
// are satisfied.
|
||||||
bool LayoutModuleList::checkModuleConsistency(LayoutFile const * const lay)
|
bool LayoutModuleList::checkModuleConsistency(LayoutFile const * const lay)
|
||||||
{
|
{
|
||||||
bool consistent = true;
|
bool consistent = true;
|
||||||
LayoutModuleList oldModules = *this;
|
LayoutModuleList oldModules = *this;
|
||||||
@ -236,7 +236,7 @@ bool LayoutModuleList::checkModuleConsistency(LayoutFile const * const lay)
|
|||||||
for (; !excluded && lit != len; ++lit) {
|
for (; !excluded && lit != len; ++lit) {
|
||||||
if (!LyXModule::areCompatible(modname, *lit)) {
|
if (!LyXModule::areCompatible(modname, *lit)) {
|
||||||
consistent = false;
|
consistent = false;
|
||||||
LYXERR0("Module " << modname <<
|
LYXERR0("Module " << modname <<
|
||||||
" dropped because it is excluded by prior module " << *lit);
|
" dropped because it is excluded by prior module " << *lit);
|
||||||
excluded = true;
|
excluded = true;
|
||||||
}
|
}
|
||||||
@ -249,11 +249,11 @@ bool LayoutModuleList::checkModuleConsistency(LayoutFile const * const lay)
|
|||||||
// satisfies our requirements
|
// satisfies our requirements
|
||||||
LyXModule const * const oldmod = theModuleList[modname];
|
LyXModule const * const oldmod = theModuleList[modname];
|
||||||
if (!oldmod) {
|
if (!oldmod) {
|
||||||
LYXERR0("Default module " << modname <<
|
LYXERR0("Default module " << modname <<
|
||||||
" added although it is unavailable and can't check requirements.");
|
" added although it is unavailable and can't check requirements.");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<string> const & reqs = oldmod->getRequiredModules();
|
vector<string> const & reqs = oldmod->getRequiredModules();
|
||||||
if (!reqs.empty()) {
|
if (!reqs.empty()) {
|
||||||
// we now set excluded to true, meaning that we haven't
|
// we now set excluded to true, meaning that we haven't
|
||||||
@ -263,7 +263,7 @@ bool LayoutModuleList::checkModuleConsistency(LayoutFile const * const lay)
|
|||||||
vector<string>::const_iterator const ren = reqs.end();
|
vector<string>::const_iterator const ren = reqs.end();
|
||||||
for (; rit != ren; ++rit) {
|
for (; rit != ren; ++rit) {
|
||||||
string const reqmod = *rit;
|
string const reqmod = *rit;
|
||||||
if (find(provmods.begin(), provmods.end(), reqmod) !=
|
if (find(provmods.begin(), provmods.end(), reqmod) !=
|
||||||
provmods.end()) {
|
provmods.end()) {
|
||||||
excluded = false;
|
excluded = false;
|
||||||
break;
|
break;
|
||||||
|
@ -762,7 +762,7 @@ docstring Lexer::getLongString(docstring const & endtoken)
|
|||||||
|
|
||||||
bool Lexer::getBool() const
|
bool Lexer::getBool() const
|
||||||
{
|
{
|
||||||
string const s = pimpl_->getString();
|
string const s = pimpl_->getString();
|
||||||
if (s == "false" || s == "0") {
|
if (s == "false" || s == "0") {
|
||||||
lastReadOk_ = true;
|
lastReadOk_ = true;
|
||||||
return false;
|
return false;
|
||||||
@ -917,7 +917,7 @@ docstring Lexer::quoteString(docstring const & arg)
|
|||||||
{
|
{
|
||||||
docstring res;
|
docstring res;
|
||||||
res += '"';
|
res += '"';
|
||||||
res += subst(subst(arg, from_ascii("\\"), from_ascii("\\\\")),
|
res += subst(subst(arg, from_ascii("\\"), from_ascii("\\\\")),
|
||||||
from_ascii("\""), from_ascii("\\\""));
|
from_ascii("\""), from_ascii("\\\""));
|
||||||
res += '"';
|
res += '"';
|
||||||
return res;
|
return res;
|
||||||
@ -929,7 +929,7 @@ Lexer & Lexer::operator>>(char const * required)
|
|||||||
string token;
|
string token;
|
||||||
*this >> token;
|
*this >> token;
|
||||||
if (token != required) {
|
if (token != required) {
|
||||||
LYXERR0("Missing '" << required << "'-tag in " << pimpl_->context
|
LYXERR0("Missing '" << required << "'-tag in " << pimpl_->context
|
||||||
<< ". Got " << token << " instead. Line: " << lineNumber());
|
<< ". Got " << token << " instead. Line: " << lineNumber());
|
||||||
pushToken(token);
|
pushToken(token);
|
||||||
}
|
}
|
||||||
|
@ -192,7 +192,7 @@ struct LyX::Impl {
|
|||||||
Converters converters_;
|
Converters converters_;
|
||||||
/// The system converters after reading lyxrc.defaults.
|
/// The system converters after reading lyxrc.defaults.
|
||||||
Converters system_converters_;
|
Converters system_converters_;
|
||||||
|
|
||||||
/// Global format information
|
/// Global format information
|
||||||
Formats formats_;
|
Formats formats_;
|
||||||
/// The system formats after reading lyxrc.defaults.
|
/// The system formats after reading lyxrc.defaults.
|
||||||
@ -512,7 +512,7 @@ int LyX::execWithoutGui(int & argc, char * argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Used to keep track of which buffers were explicitly loaded by user request.
|
// Used to keep track of which buffers were explicitly loaded by user request.
|
||||||
// This is necessary because master and child document buffers are loaded, even
|
// This is necessary because master and child document buffers are loaded, even
|
||||||
// if they were not named on the command line. We do not want to dispatch to
|
// if they were not named on the command line. We do not want to dispatch to
|
||||||
// those.
|
// those.
|
||||||
vector<Buffer *> command_line_buffers;
|
vector<Buffer *> command_line_buffers;
|
||||||
|
@ -52,7 +52,7 @@ namespace lyx {
|
|||||||
* The documentation below primarily describes the purpose and syntax
|
* The documentation below primarily describes the purpose and syntax
|
||||||
* of the various LFUNs.
|
* of the various LFUNs.
|
||||||
*
|
*
|
||||||
* The list is alphabetized. Try to keep it that way, and don't forget to add
|
* The list is alphabetized. Try to keep it that way, and don't forget to add
|
||||||
* doxygen commentary. This allows the file LFUNs.lyx to be auto-generated.
|
* doxygen commentary. This allows the file LFUNs.lyx to be auto-generated.
|
||||||
* (If you should want to do that, see the gen_lfuns.py script, which is in
|
* (If you should want to do that, see the gen_lfuns.py script, which is in
|
||||||
* the development/tools/ directory.)
|
* the development/tools/ directory.)
|
||||||
@ -3543,7 +3543,7 @@ void LyXAction::init()
|
|||||||
* \li Action: Inserts various characters into the document.
|
* \li Action: Inserts various characters into the document.
|
||||||
* \li Syntax: specialchar-insert <CHAR>
|
* \li Syntax: specialchar-insert <CHAR>
|
||||||
* \li Params: <CHAR>: hyphenation, allowbreak, ligature-break, slash,
|
* \li Params: <CHAR>: hyphenation, allowbreak, ligature-break, slash,
|
||||||
nobreakdash, dots, end-of-sentence, menu-separator,
|
nobreakdash, dots, end-of-sentence, menu-separator,
|
||||||
lyx, tex, latex, latex2e.
|
lyx, tex, latex, latex2e.
|
||||||
* \li Origin: JSpitzm, 6 Dec 2007
|
* \li Origin: JSpitzm, 6 Dec 2007
|
||||||
* \endvar
|
* \endvar
|
||||||
|
@ -2574,7 +2574,7 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
|
|||||||
|
|
||||||
case RC_FILEFORMAT:
|
case RC_FILEFORMAT:
|
||||||
// New/modified formats
|
// New/modified formats
|
||||||
for (Formats::const_iterator cit = theFormats().begin();
|
for (Formats::const_iterator cit = theFormats().begin();
|
||||||
cit != theFormats().end(); ++cit) {
|
cit != theFormats().end(); ++cit) {
|
||||||
Format const * format =
|
Format const * format =
|
||||||
theSystemFormats().getFormat(cit->name());
|
theSystemFormats().getFormat(cit->name());
|
||||||
@ -2610,7 +2610,7 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Look for deleted formats
|
// Look for deleted formats
|
||||||
for (Formats::const_iterator cit = theSystemFormats().begin();
|
for (Formats::const_iterator cit = theSystemFormats().begin();
|
||||||
cit != theSystemFormats().end(); ++cit)
|
cit != theSystemFormats().end(); ++cit)
|
||||||
if (!theFormats().getFormat(cit->name()))
|
if (!theFormats().getFormat(cit->name()))
|
||||||
os << "\\format \"" << cit->name()
|
os << "\\format \"" << cit->name()
|
||||||
|
@ -447,8 +447,8 @@ bool LyXVC::repoUpdateEnabled() const
|
|||||||
{
|
{
|
||||||
return vcs && vcs->repoUpdateEnabled();
|
return vcs && vcs->repoUpdateEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LyXVC::prepareFileRevision(string const & rev, std::string & f)
|
bool LyXVC::prepareFileRevision(string const & rev, std::string & f)
|
||||||
{
|
{
|
||||||
return vcs && vcs->prepareFileRevision(rev, f);
|
return vcs && vcs->prepareFileRevision(rev, f);
|
||||||
|
@ -157,7 +157,7 @@ ColorCode PainterInfo::backgroundColor(Inset const * inset, bool sel) const
|
|||||||
|
|
||||||
Color PainterInfo::textColor(Color const & color) const
|
Color PainterInfo::textColor(Color const & color) const
|
||||||
{
|
{
|
||||||
if (change_.changed())
|
if (change_.changed())
|
||||||
return change_.color();
|
return change_.color();
|
||||||
if (selected)
|
if (selected)
|
||||||
return Color_selectiontext;
|
return Color_selectiontext;
|
||||||
|
@ -60,7 +60,7 @@ void PDFOptions::writeFile(ostream & os) const
|
|||||||
os << "\\use_hyperref " << convert<string>(use_hyperref) << '\n';
|
os << "\\use_hyperref " << convert<string>(use_hyperref) << '\n';
|
||||||
if (!use_hyperref && empty())
|
if (!use_hyperref && empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!title.empty() )
|
if (!title.empty() )
|
||||||
os << "\\pdf_title " << Lexer::quoteString(title) << '\n';
|
os << "\\pdf_title " << Lexer::quoteString(title) << '\n';
|
||||||
if (!author.empty())
|
if (!author.empty())
|
||||||
@ -69,22 +69,22 @@ void PDFOptions::writeFile(ostream & os) const
|
|||||||
os << "\\pdf_subject " << Lexer::quoteString(subject) << '\n';
|
os << "\\pdf_subject " << Lexer::quoteString(subject) << '\n';
|
||||||
if (!keywords.empty())
|
if (!keywords.empty())
|
||||||
os << "\\pdf_keywords " << Lexer::quoteString(keywords) << '\n';
|
os << "\\pdf_keywords " << Lexer::quoteString(keywords) << '\n';
|
||||||
|
|
||||||
|
|
||||||
os << "\\pdf_bookmarks " << convert<string>(bookmarks) << '\n';
|
os << "\\pdf_bookmarks " << convert<string>(bookmarks) << '\n';
|
||||||
os << "\\pdf_bookmarksnumbered " << convert<string>(bookmarksnumbered) << '\n';
|
os << "\\pdf_bookmarksnumbered " << convert<string>(bookmarksnumbered) << '\n';
|
||||||
os << "\\pdf_bookmarksopen " << convert<string>(bookmarksopen) << '\n';
|
os << "\\pdf_bookmarksopen " << convert<string>(bookmarksopen) << '\n';
|
||||||
os << "\\pdf_bookmarksopenlevel " << bookmarksopenlevel << '\n';
|
os << "\\pdf_bookmarksopenlevel " << bookmarksopenlevel << '\n';
|
||||||
|
|
||||||
os << "\\pdf_breaklinks " << convert<string>(breaklinks) << '\n';
|
os << "\\pdf_breaklinks " << convert<string>(breaklinks) << '\n';
|
||||||
os << "\\pdf_pdfborder " << convert<string>(pdfborder) << '\n';
|
os << "\\pdf_pdfborder " << convert<string>(pdfborder) << '\n';
|
||||||
os << "\\pdf_colorlinks " << convert<string>(colorlinks) << '\n';
|
os << "\\pdf_colorlinks " << convert<string>(colorlinks) << '\n';
|
||||||
os << "\\pdf_backref " << backref << '\n';
|
os << "\\pdf_backref " << backref << '\n';
|
||||||
os << "\\pdf_pdfusetitle " << convert<string>(pdfusetitle) << '\n';
|
os << "\\pdf_pdfusetitle " << convert<string>(pdfusetitle) << '\n';
|
||||||
|
|
||||||
if (!pagemode.empty())
|
if (!pagemode.empty())
|
||||||
os << "\\pdf_pagemode " << pagemode << '\n';
|
os << "\\pdf_pagemode " << pagemode << '\n';
|
||||||
|
|
||||||
if (!quoted_options.empty())
|
if (!quoted_options.empty())
|
||||||
os << "\\pdf_quoted_options " << Lexer::quoteString(quoted_options) << '\n';
|
os << "\\pdf_quoted_options " << Lexer::quoteString(quoted_options) << '\n';
|
||||||
}
|
}
|
||||||
@ -96,7 +96,7 @@ void PDFOptions::writeLaTeX(OutputParams & runparams, otexstream & os,
|
|||||||
// FIXME Unicode
|
// FIXME Unicode
|
||||||
string opt;
|
string opt;
|
||||||
string hyperset;
|
string hyperset;
|
||||||
|
|
||||||
// since LyX uses unicode, also set the PDF strings to unicode strings with the
|
// since LyX uses unicode, also set the PDF strings to unicode strings with the
|
||||||
// hyperref option "unicode"
|
// hyperref option "unicode"
|
||||||
opt += "unicode=true,";
|
opt += "unicode=true,";
|
||||||
@ -133,7 +133,7 @@ void PDFOptions::writeLaTeX(OutputParams & runparams, otexstream & os,
|
|||||||
// LaTeX-errors when using non-latin characters
|
// LaTeX-errors when using non-latin characters
|
||||||
if (!title.empty())
|
if (!title.empty())
|
||||||
hyperset += "pdftitle={" + title + "},";
|
hyperset += "pdftitle={" + title + "},";
|
||||||
if (!author.empty())
|
if (!author.empty())
|
||||||
hyperset += "\n pdfauthor={" + author + "},";
|
hyperset += "\n pdfauthor={" + author + "},";
|
||||||
if (!subject.empty())
|
if (!subject.empty())
|
||||||
hyperset += "\n pdfsubject={" + subject + "},";
|
hyperset += "\n pdfsubject={" + subject + "},";
|
||||||
|
@ -397,7 +397,7 @@ public:
|
|||||||
typedef SkipPositions::const_iterator SkipPositionsIterator;
|
typedef SkipPositions::const_iterator SkipPositionsIterator;
|
||||||
|
|
||||||
void appendSkipPosition(SkipPositions & skips, pos_type const pos) const;
|
void appendSkipPosition(SkipPositions & skips, pos_type const pos) const;
|
||||||
|
|
||||||
Language * getSpellLanguage(pos_type const from) const;
|
Language * getSpellLanguage(pos_type const from) const;
|
||||||
|
|
||||||
Language * locateSpellRange(pos_type & from, pos_type & to,
|
Language * locateSpellRange(pos_type & from, pos_type & to,
|
||||||
@ -412,7 +412,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool ignoreWord(docstring const & word) const ;
|
bool ignoreWord(docstring const & word) const ;
|
||||||
|
|
||||||
void setMisspelled(pos_type from, pos_type to, SpellChecker::Result state)
|
void setMisspelled(pos_type from, pos_type to, SpellChecker::Result state)
|
||||||
{
|
{
|
||||||
pos_type textsize = owner_->size();
|
pos_type textsize = owner_->size();
|
||||||
@ -2967,13 +2967,13 @@ docstring Paragraph::simpleLyXHTMLOnePar(Buffer const & buf,
|
|||||||
FontShape curr_fs = INHERIT_SHAPE;
|
FontShape curr_fs = INHERIT_SHAPE;
|
||||||
FontFamily curr_fam = INHERIT_FAMILY;
|
FontFamily curr_fam = INHERIT_FAMILY;
|
||||||
FontSize curr_size = FONT_SIZE_INHERIT;
|
FontSize curr_size = FONT_SIZE_INHERIT;
|
||||||
|
|
||||||
string const default_family =
|
string const default_family =
|
||||||
buf.masterBuffer()->params().fonts_default_family;
|
buf.masterBuffer()->params().fonts_default_family;
|
||||||
|
|
||||||
vector<html::FontTag> tagsToOpen;
|
vector<html::FontTag> tagsToOpen;
|
||||||
vector<html::EndFontTag> tagsToClose;
|
vector<html::EndFontTag> tagsToClose;
|
||||||
|
|
||||||
// parsing main loop
|
// parsing main loop
|
||||||
for (pos_type i = initial; i < size(); ++i) {
|
for (pos_type i = initial; i < size(); ++i) {
|
||||||
// let's not show deleted material in the output
|
// let's not show deleted material in the output
|
||||||
@ -2996,7 +2996,7 @@ docstring Paragraph::simpleLyXHTMLOnePar(Buffer const & buf,
|
|||||||
curstate = font.fontInfo().underbar();
|
curstate = font.fontInfo().underbar();
|
||||||
if (font_old.underbar() != curstate)
|
if (font_old.underbar() != curstate)
|
||||||
doFontSwitch(tagsToOpen, tagsToClose, ubar_flag, curstate, html::FT_UBAR);
|
doFontSwitch(tagsToOpen, tagsToClose, ubar_flag, curstate, html::FT_UBAR);
|
||||||
|
|
||||||
// strikeout
|
// strikeout
|
||||||
curstate = font.fontInfo().strikeout();
|
curstate = font.fontInfo().strikeout();
|
||||||
if (font_old.strikeout() != curstate)
|
if (font_old.strikeout() != curstate)
|
||||||
@ -3627,7 +3627,7 @@ int Paragraph::fixBiblio(Buffer const & buffer)
|
|||||||
InsetCommandParams(BIBITEM_CODE));
|
InsetCommandParams(BIBITEM_CODE));
|
||||||
|
|
||||||
Font font(inherit_font, buffer.params().language);
|
Font font(inherit_font, buffer.params().language);
|
||||||
insertInset(0, inset, font, Change(track_changes ? Change::INSERTED
|
insertInset(0, inset, font, Change(track_changes ? Change::INSERTED
|
||||||
: Change::UNCHANGED));
|
: Change::UNCHANGED));
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
namespace lyx {
|
namespace lyx {
|
||||||
|
|
||||||
PrinterParams::PrinterParams()
|
PrinterParams::PrinterParams()
|
||||||
{
|
{
|
||||||
target = PRINTER;
|
target = PRINTER;
|
||||||
all_pages = true;
|
all_pages = true;
|
||||||
|
@ -275,7 +275,7 @@ ostream & operator<<(ostream & os, Row const & row)
|
|||||||
<< " ascent: " << row.dim_.asc
|
<< " ascent: " << row.dim_.asc
|
||||||
<< " descent: " << row.dim_.des
|
<< " descent: " << row.dim_.des
|
||||||
<< " separator: " << row.separator
|
<< " separator: " << row.separator
|
||||||
<< " label_hfill: " << row.label_hfill
|
<< " label_hfill: " << row.label_hfill
|
||||||
<< " row_boundary: " << row.right_boundary() << "\n";
|
<< " row_boundary: " << row.right_boundary() << "\n";
|
||||||
double x = row.left_margin;
|
double x = row.left_margin;
|
||||||
Row::Elements::const_iterator it = row.elements_.begin();
|
Row::Elements::const_iterator it = row.elements_.begin();
|
||||||
|
@ -205,7 +205,7 @@ void RowPainter::paintMisspelledMark(Row::Element const & e) const
|
|||||||
if (x1 > x2)
|
if (x1 > x2)
|
||||||
swap(x1, x2);
|
swap(x1, x2);
|
||||||
|
|
||||||
pi_.pain.line(int(x_ + x1), y, int(x_ + x2), y,
|
pi_.pain.line(int(x_ + x1), y, int(x_ + x2), y,
|
||||||
Color_error,
|
Color_error,
|
||||||
Painter::line_onoffdash, thickness);
|
Painter::line_onoffdash, thickness);
|
||||||
pos = range.last + 1;
|
pos = range.last + 1;
|
||||||
|
@ -129,7 +129,7 @@ void LastOpenedSection::read(istream & is)
|
|||||||
lof.file_name = file;
|
lof.file_name = file;
|
||||||
lastopened.push_back(lof);
|
lastopened.push_back(lof);
|
||||||
} else {
|
} else {
|
||||||
LYXERR(Debug::INIT,
|
LYXERR(Debug::INIT,
|
||||||
"LyX: Warning: Ignore last opened file: " << tmp);
|
"LyX: Warning: Ignore last opened file: " << tmp);
|
||||||
}
|
}
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
@ -337,7 +337,7 @@ LastCommandsSection::LastCommandsSection(unsigned int num) :
|
|||||||
setNumberOfLastCommands(num);
|
setNumberOfLastCommands(num);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LastCommandsSection::read(istream & is)
|
void LastCommandsSection::read(istream & is)
|
||||||
{
|
{
|
||||||
string tmp;
|
string tmp;
|
||||||
|
@ -90,7 +90,7 @@ void Spacing::writeFile(ostream & os, bool para) const
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
string envName(Spacing::Space space, bool useSetSpace)
|
string envName(Spacing::Space space, bool useSetSpace)
|
||||||
{
|
{
|
||||||
static char const * const env_names[]
|
static char const * const env_names[]
|
||||||
= { "SingleSpace", "OnehalfSpace", "DoubleSpace", "Spacing", ""};
|
= { "SingleSpace", "OnehalfSpace", "DoubleSpace", "Spacing", ""};
|
||||||
@ -104,9 +104,9 @@ string envName(Spacing::Space space, bool useSetSpace)
|
|||||||
string const Spacing::writeEnvirBegin(bool useSetSpace) const
|
string const Spacing::writeEnvirBegin(bool useSetSpace) const
|
||||||
{
|
{
|
||||||
string const name = envName(space, useSetSpace);
|
string const name = envName(space, useSetSpace);
|
||||||
if (space == Other)
|
if (space == Other)
|
||||||
return "\\begin{" + name + "}{" + getValueAsString() + '}';
|
return "\\begin{" + name + "}{" + getValueAsString() + '}';
|
||||||
else
|
else
|
||||||
return name.empty() ? string() : "\\begin{" + name + '}';
|
return name.empty() ? string() : "\\begin{" + name + '}';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,11 +128,11 @@ string const Spacing::writePreamble(bool useSetSpace) const
|
|||||||
//return "\\singlespacing\n";
|
//return "\\singlespacing\n";
|
||||||
break;
|
break;
|
||||||
case Onehalf:
|
case Onehalf:
|
||||||
preamble = useSetSpace ? "\\OnehalfSpacing\n"
|
preamble = useSetSpace ? "\\OnehalfSpacing\n"
|
||||||
: "\\onehalfspacing\n";
|
: "\\onehalfspacing\n";
|
||||||
break;
|
break;
|
||||||
case Double:
|
case Double:
|
||||||
preamble = useSetSpace ? "\\DoubleSpacing\n"
|
preamble = useSetSpace ? "\\DoubleSpacing\n"
|
||||||
: "\\doublespacing\n";
|
: "\\doublespacing\n";
|
||||||
break;
|
break;
|
||||||
case Other:
|
case Other:
|
||||||
|
@ -295,7 +295,7 @@ void Text::setFont(Cursor & cur, Font const & font, bool toggleall)
|
|||||||
// Ok, we have a selection.
|
// Ok, we have a selection.
|
||||||
Font newfont = font;
|
Font newfont = font;
|
||||||
|
|
||||||
if (toggleall) {
|
if (toggleall) {
|
||||||
// Toggling behaves as follows: We check the first character of the
|
// Toggling behaves as follows: We check the first character of the
|
||||||
// selection. If it's (say) got EMPH on, then we set to off; if off,
|
// selection. If it's (say) got EMPH on, then we set to off; if off,
|
||||||
// then to on. With families and the like, we set it to INHERIT, if
|
// then to on. With families and the like, we set it to INHERIT, if
|
||||||
@ -303,30 +303,30 @@ void Text::setFont(Cursor & cur, Font const & font, bool toggleall)
|
|||||||
CursorSlice const & sl = cur.selBegin();
|
CursorSlice const & sl = cur.selBegin();
|
||||||
Text const & text = *sl.text();
|
Text const & text = *sl.text();
|
||||||
Paragraph const & par = text.getPar(sl.pit());
|
Paragraph const & par = text.getPar(sl.pit());
|
||||||
|
|
||||||
// get font at the position
|
// get font at the position
|
||||||
Font oldfont = par.getFont(cur.bv().buffer().params(), sl.pos(),
|
Font oldfont = par.getFont(cur.bv().buffer().params(), sl.pos(),
|
||||||
text.outerFont(sl.pit()));
|
text.outerFont(sl.pit()));
|
||||||
FontInfo const & oldfi = oldfont.fontInfo();
|
FontInfo const & oldfi = oldfont.fontInfo();
|
||||||
|
|
||||||
FontInfo & newfi = newfont.fontInfo();
|
FontInfo & newfi = newfont.fontInfo();
|
||||||
|
|
||||||
FontFamily newfam = newfi.family();
|
FontFamily newfam = newfi.family();
|
||||||
if (newfam != INHERIT_FAMILY && newfam != IGNORE_FAMILY &&
|
if (newfam != INHERIT_FAMILY && newfam != IGNORE_FAMILY &&
|
||||||
newfam == oldfi.family())
|
newfam == oldfi.family())
|
||||||
newfi.setFamily(INHERIT_FAMILY);
|
newfi.setFamily(INHERIT_FAMILY);
|
||||||
|
|
||||||
FontSeries newser = newfi.series();
|
FontSeries newser = newfi.series();
|
||||||
if (newser == BOLD_SERIES && oldfi.series() == BOLD_SERIES)
|
if (newser == BOLD_SERIES && oldfi.series() == BOLD_SERIES)
|
||||||
newfi.setSeries(INHERIT_SERIES);
|
newfi.setSeries(INHERIT_SERIES);
|
||||||
|
|
||||||
FontShape newshp = newfi.shape();
|
FontShape newshp = newfi.shape();
|
||||||
if (newshp != INHERIT_SHAPE && newshp != IGNORE_SHAPE &&
|
if (newshp != INHERIT_SHAPE && newshp != IGNORE_SHAPE &&
|
||||||
newshp == oldfi.shape())
|
newshp == oldfi.shape())
|
||||||
newfi.setShape(INHERIT_SHAPE);
|
newfi.setShape(INHERIT_SHAPE);
|
||||||
|
|
||||||
ColorCode newcol = newfi.color();
|
ColorCode newcol = newfi.color();
|
||||||
if (newcol != Color_none && newcol != Color_inherit
|
if (newcol != Color_none && newcol != Color_inherit
|
||||||
&& newcol != Color_ignore && newcol == oldfi.color())
|
&& newcol != Color_ignore && newcol == oldfi.color())
|
||||||
newfi.setColor(Color_none);
|
newfi.setColor(Color_none);
|
||||||
|
|
||||||
@ -349,7 +349,7 @@ void Text::setFont(Cursor & cur, Font const & font, bool toggleall)
|
|||||||
newfi.setNumber(oldfi.number() == FONT_OFF ? FONT_ON : FONT_OFF);
|
newfi.setNumber(oldfi.number() == FONT_OFF ? FONT_ON : FONT_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
setFont(cur.bv(), cur.selectionBegin().top(),
|
setFont(cur.bv(), cur.selectionBegin().top(),
|
||||||
cur.selectionEnd().top(), newfont);
|
cur.selectionEnd().top(), newfont);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -379,7 +379,7 @@ void Text::setFont(BufferView const & bv, CursorSlice const & begin,
|
|||||||
Font f = tm.displayFont(pit, pos);
|
Font f = tm.displayFont(pit, pos);
|
||||||
f.update(font, language);
|
f.update(font, language);
|
||||||
setCharFont(pit, pos, f, tm.font_);
|
setCharFont(pit, pos, f, tm.font_);
|
||||||
// font change may change language...
|
// font change may change language...
|
||||||
// spell checker has to know that
|
// spell checker has to know that
|
||||||
pars_[pit].requestSpellCheck(pos);
|
pars_[pit].requestSpellCheck(pos);
|
||||||
}
|
}
|
||||||
@ -451,7 +451,7 @@ docstring Text::getStringToIndex(Cursor const & cur)
|
|||||||
cur.message(_("Cannot index more than one paragraph!"));
|
cur.message(_("Cannot index more than one paragraph!"));
|
||||||
else
|
else
|
||||||
return tmpcur.selectionAsString(false);
|
return tmpcur.selectionAsString(false);
|
||||||
|
|
||||||
return docstring();
|
return docstring();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -610,7 +610,7 @@ bool Text::checkAndActivateInsetVisual(Cursor & cur, bool movingForward, bool mo
|
|||||||
return false;
|
return false;
|
||||||
if (cur.selection() && cur.realAnchor().find(inset) == -1)
|
if (cur.selection() && cur.realAnchor().find(inset) == -1)
|
||||||
return false;
|
return false;
|
||||||
inset->edit(cur, movingForward,
|
inset->edit(cur, movingForward,
|
||||||
movingLeft ? Inset::ENTRY_DIRECTION_RIGHT : Inset::ENTRY_DIRECTION_LEFT);
|
movingLeft ? Inset::ENTRY_DIRECTION_RIGHT : Inset::ENTRY_DIRECTION_LEFT);
|
||||||
cur.setCurrentFont();
|
cur.setCurrentFont();
|
||||||
cur.boundary(false);
|
cur.boundary(false);
|
||||||
@ -645,11 +645,11 @@ bool Text::cursorBackward(Cursor & cur)
|
|||||||
!cur.paragraph().isSeparator(cur.pos() - 1)) {
|
!cur.paragraph().isSeparator(cur.pos() - 1)) {
|
||||||
return setCursor(cur, cur.pit(), cur.pos(), true, true);
|
return setCursor(cur, cur.pit(), cur.pos(), true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// go left and try to enter inset
|
// go left and try to enter inset
|
||||||
if (checkAndActivateInset(cur, false))
|
if (checkAndActivateInset(cur, false))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// normal character left
|
// normal character left
|
||||||
return setCursor(cur, cur.pit(), cur.pos() - 1, true, false);
|
return setCursor(cur, cur.pit(), cur.pos() - 1, true, false);
|
||||||
}
|
}
|
||||||
@ -675,7 +675,7 @@ bool Text::cursorVisLeft(Cursor & cur, bool skip_inset)
|
|||||||
cur = temp_cur;
|
cur = temp_cur;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return setCursor(cur, temp_cur.pit(), temp_cur.pos(),
|
return setCursor(cur, temp_cur.pit(), temp_cur.pos(),
|
||||||
true, temp_cur.boundary());
|
true, temp_cur.boundary());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -710,7 +710,7 @@ bool Text::cursorForward(Cursor & cur)
|
|||||||
if (cur.boundary() && !tm.isRTLBoundary(cur.pit(), cur.pos()))
|
if (cur.boundary() && !tm.isRTLBoundary(cur.pit(), cur.pos()))
|
||||||
return setCursor(cur, cur.pit(), cur.pos(), true, false);
|
return setCursor(cur, cur.pit(), cur.pos(), true, false);
|
||||||
|
|
||||||
// next position is left of boundary,
|
// next position is left of boundary,
|
||||||
// but go to next line for special cases like space, newline, linesep
|
// but go to next line for special cases like space, newline, linesep
|
||||||
#if 0
|
#if 0
|
||||||
// some effectless debug code to see the values in the debugger
|
// some effectless debug code to see the values in the debugger
|
||||||
@ -740,12 +740,12 @@ bool Text::cursorForward(Cursor & cur)
|
|||||||
return setCursor(cur, cur.pit(), cur.pos() + 1, true, true);
|
return setCursor(cur, cur.pit(), cur.pos() + 1, true, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// in front of RTL boundary? Stay on this side of the boundary because:
|
// in front of RTL boundary? Stay on this side of the boundary because:
|
||||||
// ab|cDDEEFFghi -> abc|DDEEFFghi
|
// ab|cDDEEFFghi -> abc|DDEEFFghi
|
||||||
if (tm.isRTLBoundary(cur.pit(), cur.pos() + 1))
|
if (tm.isRTLBoundary(cur.pit(), cur.pos() + 1))
|
||||||
return setCursor(cur, cur.pit(), cur.pos() + 1, true, true);
|
return setCursor(cur, cur.pit(), cur.pos() + 1, true, true);
|
||||||
|
|
||||||
// move right
|
// move right
|
||||||
return setCursor(cur, cur.pit(), cur.pos() + 1, true, false);
|
return setCursor(cur, cur.pit(), cur.pos() + 1, true, false);
|
||||||
}
|
}
|
||||||
@ -839,12 +839,12 @@ bool Text::deleteEmptyParagraphMechanism(Cursor & cur,
|
|||||||
if (&old.inset() == &cur[depth].inset())
|
if (&old.inset() == &cur[depth].inset())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Whether a common inset is found and whether the cursor is still in
|
// Whether a common inset is found and whether the cursor is still in
|
||||||
// the same paragraph (possibly nested).
|
// the same paragraph (possibly nested).
|
||||||
bool const same_par = depth < cur.depth() && old.pit() == cur[depth].pit();
|
bool const same_par = depth < cur.depth() && old.pit() == cur[depth].pit();
|
||||||
bool const same_par_pos = depth == cur.depth() - 1 && same_par
|
bool const same_par_pos = depth == cur.depth() - 1 && same_par
|
||||||
&& old.pos() == cur[depth].pos();
|
&& old.pos() == cur[depth].pos();
|
||||||
|
|
||||||
// If the chars around the old cursor were spaces, delete one of them.
|
// If the chars around the old cursor were spaces, delete one of them.
|
||||||
if (!same_par_pos) {
|
if (!same_par_pos) {
|
||||||
// Only if the cursor has really moved.
|
// Only if the cursor has really moved.
|
||||||
@ -891,7 +891,7 @@ bool Text::deleteEmptyParagraphMechanism(Cursor & cur,
|
|||||||
if (soa && old.pit() < pit_type(plist.size()))
|
if (soa && old.pit() < pit_type(plist.size()))
|
||||||
plist[old.pit()].params().startOfAppendix(true);
|
plist[old.pit()].params().startOfAppendix(true);
|
||||||
|
|
||||||
// see #warning (FIXME?) above
|
// see #warning (FIXME?) above
|
||||||
if (cur.depth() >= old.depth()) {
|
if (cur.depth() >= old.depth()) {
|
||||||
CursorSlice & curslice = cur[old.depth() - 1];
|
CursorSlice & curslice = cur[old.depth() - 1];
|
||||||
if (&curslice.inset() == &old.inset()
|
if (&curslice.inset() == &old.inset()
|
||||||
|
@ -452,7 +452,7 @@ static void outline(OutlineOp mode, Cursor & cur)
|
|||||||
DocumentClass const & tc = buf.params().documentClass();
|
DocumentClass const & tc = buf.params().documentClass();
|
||||||
DocumentClass::const_iterator lit = tc.begin();
|
DocumentClass::const_iterator lit = tc.begin();
|
||||||
DocumentClass::const_iterator len = tc.end();
|
DocumentClass::const_iterator len = tc.end();
|
||||||
int const newtoclevel =
|
int const newtoclevel =
|
||||||
(mode == OutlineIn ? toclevel + 1 : toclevel - 1);
|
(mode == OutlineIn ? toclevel + 1 : toclevel - 1);
|
||||||
LabelType const oldlabeltype = start->layout().labeltype;
|
LabelType const oldlabeltype = start->layout().labeltype;
|
||||||
|
|
||||||
@ -484,9 +484,9 @@ bool Text::isRTL(Paragraph const & par) const
|
|||||||
return par.isRTL(buffer.params());
|
return par.isRTL(buffer.params());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
Language const * getLanguage(Cursor const & cur, string const & lang) {
|
Language const * getLanguage(Cursor const & cur, string const & lang) {
|
||||||
return lang.empty() ? cur.getFont().language() : languages.getLanguage(lang);
|
return lang.empty() ? cur.getFont().language() : languages.getLanguage(lang);
|
||||||
}
|
}
|
||||||
@ -518,7 +518,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
cur.noScreenUpdate();
|
cur.noScreenUpdate();
|
||||||
|
|
||||||
LBUFERR(this == cur.text());
|
LBUFERR(this == cur.text());
|
||||||
|
|
||||||
// NOTE: This should NOT be a reference. See commit 94a5481a.
|
// NOTE: This should NOT be a reference. See commit 94a5481a.
|
||||||
CursorSlice const oldTopSlice = cur.top();
|
CursorSlice const oldTopSlice = cur.top();
|
||||||
bool const oldBoundary = cur.boundary();
|
bool const oldBoundary = cur.boundary();
|
||||||
|
@ -517,9 +517,9 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt)
|
|||||||
error = !readStyle(lexrc, lay);
|
error = !readStyle(lexrc, lay);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool const have_layout = hasLayout(name);
|
bool const have_layout = hasLayout(name);
|
||||||
|
|
||||||
// If the layout already exists, then we want to add it to
|
// If the layout already exists, then we want to add it to
|
||||||
// the existing layout, as long as we are not in an ProvideStyle
|
// the existing layout, as long as we are not in an ProvideStyle
|
||||||
// block.
|
// block.
|
||||||
@ -1788,7 +1788,7 @@ Layout const & DocumentClass::getTOCLayout() const
|
|||||||
for (; lit != len; ++lit) {
|
for (; lit != len; ++lit) {
|
||||||
int const level = lit->toclevel;
|
int const level = lit->toclevel;
|
||||||
// we don't want Part or unnumbered sections
|
// we don't want Part or unnumbered sections
|
||||||
if (level == Layout::NOT_IN_TOC || level < 0
|
if (level == Layout::NOT_IN_TOC || level < 0
|
||||||
|| level >= minlevel || lit->counter.empty())
|
|| level >= minlevel || lit->counter.empty())
|
||||||
continue;
|
continue;
|
||||||
lay = &*lit;
|
lay = &*lit;
|
||||||
|
@ -236,7 +236,7 @@ Thesaurus::Meanings Thesaurus::lookup(WordLangTuple const & wl)
|
|||||||
return meanings;
|
return meanings;
|
||||||
|
|
||||||
string const encoding = mythes->get_th_encoding();
|
string const encoding = mythes->get_th_encoding();
|
||||||
|
|
||||||
mentry * pmean;
|
mentry * pmean;
|
||||||
string const text = to_iconv_encoding(support::lowercase(t), encoding);
|
string const text = to_iconv_encoding(support::lowercase(t), encoding);
|
||||||
int len = strlen(text.c_str());
|
int len = strlen(text.c_str());
|
||||||
|
@ -162,7 +162,7 @@ bool TocBackend::updateItem(DocIterator const & dit_in)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (toc("tableofcontents")->empty()) {
|
if (toc("tableofcontents")->empty()) {
|
||||||
// FIXME: should not happen,
|
// FIXME: should not happen,
|
||||||
// a call to TocBackend::update() is missing somewhere
|
// a call to TocBackend::update() is missing somewhere
|
||||||
LYXERR0("TocBackend::updateItem called but the TOC is empty!");
|
LYXERR0("TocBackend::updateItem called but the TOC is empty!");
|
||||||
return false;
|
return false;
|
||||||
|
@ -183,7 +183,7 @@ docstring const VSpace::asGUIName() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string VSpace::asHTMLLength() const
|
string VSpace::asHTMLLength() const
|
||||||
{
|
{
|
||||||
string result;
|
string result;
|
||||||
switch (kind_) {
|
switch (kind_) {
|
||||||
|
@ -75,7 +75,7 @@ docstring const & WordList::word(size_t idx) const
|
|||||||
{
|
{
|
||||||
Impl::Words::const_iterator it = d->words_.find_summed_weight(idx);
|
Impl::Words::const_iterator it = d->words_.find_summed_weight(idx);
|
||||||
LASSERT(it != d->words_.end(), { static docstring dummy; return dummy; });
|
LASSERT(it != d->words_.end(), { static docstring dummy; return dummy; });
|
||||||
|
|
||||||
// We use the key() method here, and not something like it->first
|
// We use the key() method here, and not something like it->first
|
||||||
// because the btree only returns (iterator-) temporary value pairs.
|
// because the btree only returns (iterator-) temporary value pairs.
|
||||||
// If we returned the first component of those here, we get an
|
// If we returned the first component of those here, we get an
|
||||||
|
@ -186,11 +186,11 @@ Buffer * newUnnamedFile(FileName const & path, string const & prefix,
|
|||||||
FileName filename;
|
FileName filename;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
filename.set(path,
|
filename.set(path,
|
||||||
prefix + convert<string>(++file_number[prefix]) + ".lyx");
|
prefix + convert<string>(++file_number[prefix]) + ".lyx");
|
||||||
}
|
}
|
||||||
while (theBufferList().exists(filename) || filename.isReadableFile());
|
while (theBufferList().exists(filename) || filename.isReadableFile());
|
||||||
|
|
||||||
return newFile(filename.absFileName(), templatename, false);
|
return newFile(filename.absFileName(), templatename, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -283,30 +283,30 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd)
|
|||||||
case NO_CODE:
|
case NO_CODE:
|
||||||
lyxerr << "No such inset '" << name << "'.";
|
lyxerr << "No such inset '" << name << "'.";
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case BIBITEM_CODE: {
|
case BIBITEM_CODE: {
|
||||||
InsetCommandParams icp(code);
|
InsetCommandParams icp(code);
|
||||||
InsetCommand::string2params(to_utf8(cmd.argument()), icp);
|
InsetCommand::string2params(to_utf8(cmd.argument()), icp);
|
||||||
return new InsetBibitem(buf, icp);
|
return new InsetBibitem(buf, icp);
|
||||||
}
|
}
|
||||||
|
|
||||||
case BIBTEX_CODE: {
|
case BIBTEX_CODE: {
|
||||||
InsetCommandParams icp(code);
|
InsetCommandParams icp(code);
|
||||||
InsetCommand::string2params(to_utf8(cmd.argument()), icp);
|
InsetCommand::string2params(to_utf8(cmd.argument()), icp);
|
||||||
return new InsetBibtex(buf, icp);
|
return new InsetBibtex(buf, icp);
|
||||||
}
|
}
|
||||||
|
|
||||||
case CITE_CODE: {
|
case CITE_CODE: {
|
||||||
InsetCommandParams icp(code);
|
InsetCommandParams icp(code);
|
||||||
InsetCommand::string2params(to_utf8(cmd.argument()), icp);
|
InsetCommand::string2params(to_utf8(cmd.argument()), icp);
|
||||||
return new InsetCitation(buf, icp);
|
return new InsetCitation(buf, icp);
|
||||||
}
|
}
|
||||||
|
|
||||||
case ERT_CODE: {
|
case ERT_CODE: {
|
||||||
return new InsetERT(buf,
|
return new InsetERT(buf,
|
||||||
InsetERT::string2params(to_utf8(cmd.argument())));
|
InsetERT::string2params(to_utf8(cmd.argument())));
|
||||||
}
|
}
|
||||||
|
|
||||||
case EXTERNAL_CODE: {
|
case EXTERNAL_CODE: {
|
||||||
InsetExternalParams iep;
|
InsetExternalParams iep;
|
||||||
InsetExternal::string2params(to_utf8(cmd.argument()), *buf, iep);
|
InsetExternal::string2params(to_utf8(cmd.argument()), *buf, iep);
|
||||||
@ -315,7 +315,7 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd)
|
|||||||
inset->setParams(iep);
|
inset->setParams(iep);
|
||||||
return inset.release();
|
return inset.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
case GRAPHICS_CODE: {
|
case GRAPHICS_CODE: {
|
||||||
InsetGraphicsParams igp;
|
InsetGraphicsParams igp;
|
||||||
InsetGraphics::string2params(to_utf8(cmd.argument()), *buf, igp);
|
InsetGraphics::string2params(to_utf8(cmd.argument()), *buf, igp);
|
||||||
@ -323,54 +323,54 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd)
|
|||||||
inset->setParams(igp);
|
inset->setParams(igp);
|
||||||
return inset.release();
|
return inset.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
case HYPERLINK_CODE: {
|
case HYPERLINK_CODE: {
|
||||||
InsetCommandParams icp(code);
|
InsetCommandParams icp(code);
|
||||||
InsetCommand::string2params(to_utf8(cmd.argument()), icp);
|
InsetCommand::string2params(to_utf8(cmd.argument()), icp);
|
||||||
return new InsetHyperlink(buf, icp);
|
return new InsetHyperlink(buf, icp);
|
||||||
}
|
}
|
||||||
|
|
||||||
case INCLUDE_CODE: {
|
case INCLUDE_CODE: {
|
||||||
InsetCommandParams icp(code);
|
InsetCommandParams icp(code);
|
||||||
InsetCommand::string2params(to_utf8(cmd.argument()), icp);
|
InsetCommand::string2params(to_utf8(cmd.argument()), icp);
|
||||||
return new InsetInclude(buf, icp);
|
return new InsetInclude(buf, icp);
|
||||||
}
|
}
|
||||||
|
|
||||||
case INDEX_CODE: {
|
case INDEX_CODE: {
|
||||||
docstring arg = cmd.argument();
|
docstring arg = cmd.argument();
|
||||||
return new InsetIndex(buf, InsetIndexParams(arg));
|
return new InsetIndex(buf, InsetIndexParams(arg));
|
||||||
}
|
}
|
||||||
|
|
||||||
case INDEX_PRINT_CODE: {
|
case INDEX_PRINT_CODE: {
|
||||||
InsetCommandParams icp(code);
|
InsetCommandParams icp(code);
|
||||||
InsetCommand::string2params(to_utf8(cmd.argument()), icp);
|
InsetCommand::string2params(to_utf8(cmd.argument()), icp);
|
||||||
return new InsetPrintIndex(buf, icp);
|
return new InsetPrintIndex(buf, icp);
|
||||||
}
|
}
|
||||||
|
|
||||||
case LABEL_CODE: {
|
case LABEL_CODE: {
|
||||||
InsetCommandParams icp(code);
|
InsetCommandParams icp(code);
|
||||||
InsetCommand::string2params(to_utf8(cmd.argument()), icp);
|
InsetCommand::string2params(to_utf8(cmd.argument()), icp);
|
||||||
return new InsetLabel(buf, icp);
|
return new InsetLabel(buf, icp);
|
||||||
}
|
}
|
||||||
|
|
||||||
case LINE_CODE: {
|
case LINE_CODE: {
|
||||||
InsetCommandParams icp(code);
|
InsetCommandParams icp(code);
|
||||||
InsetCommand::string2params(to_utf8(cmd.argument()), icp);
|
InsetCommand::string2params(to_utf8(cmd.argument()), icp);
|
||||||
return new InsetLine(buf, icp);
|
return new InsetLine(buf, icp);
|
||||||
}
|
}
|
||||||
|
|
||||||
case LISTINGS_CODE: {
|
case LISTINGS_CODE: {
|
||||||
InsetListingsParams par;
|
InsetListingsParams par;
|
||||||
InsetListings::string2params(to_utf8(cmd.argument()), par);
|
InsetListings::string2params(to_utf8(cmd.argument()), par);
|
||||||
return new InsetListings(buf, par);
|
return new InsetListings(buf, par);
|
||||||
}
|
}
|
||||||
|
|
||||||
case NOMENCL_CODE: {
|
case NOMENCL_CODE: {
|
||||||
InsetCommandParams icp(code);
|
InsetCommandParams icp(code);
|
||||||
InsetCommand::string2params(to_utf8(cmd.argument()), icp);
|
InsetCommand::string2params(to_utf8(cmd.argument()), icp);
|
||||||
return new InsetNomencl(buf, icp);
|
return new InsetNomencl(buf, icp);
|
||||||
}
|
}
|
||||||
|
|
||||||
case REF_CODE: {
|
case REF_CODE: {
|
||||||
InsetCommandParams icp(code);
|
InsetCommandParams icp(code);
|
||||||
InsetCommand::string2params(to_utf8(cmd.argument()), icp);
|
InsetCommand::string2params(to_utf8(cmd.argument()), icp);
|
||||||
@ -388,13 +388,13 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd)
|
|||||||
InsetSpace::string2params(to_utf8(cmd.argument()), isp);
|
InsetSpace::string2params(to_utf8(cmd.argument()), isp);
|
||||||
return new InsetSpace(isp);
|
return new InsetSpace(isp);
|
||||||
}
|
}
|
||||||
|
|
||||||
case TOC_CODE: {
|
case TOC_CODE: {
|
||||||
InsetCommandParams icp(code);
|
InsetCommandParams icp(code);
|
||||||
InsetCommand::string2params(to_utf8(cmd.argument()), icp);
|
InsetCommand::string2params(to_utf8(cmd.argument()), icp);
|
||||||
return new InsetTOC(buf, icp);
|
return new InsetTOC(buf, icp);
|
||||||
}
|
}
|
||||||
|
|
||||||
case VSPACE_CODE: {
|
case VSPACE_CODE: {
|
||||||
VSpace vspace;
|
VSpace vspace;
|
||||||
InsetVSpace::string2params(to_utf8(cmd.argument()), vspace);
|
InsetVSpace::string2params(to_utf8(cmd.argument()), vspace);
|
||||||
@ -403,12 +403,12 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd)
|
|||||||
|
|
||||||
case PREVIEW_CODE:
|
case PREVIEW_CODE:
|
||||||
return new InsetPreview(buf);
|
return new InsetPreview(buf);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
lyxerr << "Inset '" << name << "' not permitted with LFUN_INSET_INSERT."
|
lyxerr << "Inset '" << name << "' not permitted with LFUN_INSET_INSERT."
|
||||||
<< endl;
|
<< endl;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
} //end LFUN_INSET_INSERT
|
} //end LFUN_INSET_INSERT
|
||||||
|
|
||||||
@ -521,7 +521,7 @@ Inset * readInset(Lexer & lex, Buffer * buf)
|
|||||||
lex >> tmptok;
|
lex >> tmptok;
|
||||||
|
|
||||||
// test the different insets
|
// test the different insets
|
||||||
|
|
||||||
// FIXME It would be better if we did not have this branch and could
|
// FIXME It would be better if we did not have this branch and could
|
||||||
// just do one massive switch for all insets. But at present, it's
|
// just do one massive switch for all insets. But at present, it's
|
||||||
// easier to do it this way, and we can't do the massive switch until
|
// easier to do it this way, and we can't do the massive switch until
|
||||||
@ -533,9 +533,9 @@ Inset * readInset(Lexer & lex, Buffer * buf)
|
|||||||
lex.next();
|
lex.next();
|
||||||
string const insetType = lex.getString();
|
string const insetType = lex.getString();
|
||||||
lex.pushToken(insetType);
|
lex.pushToken(insetType);
|
||||||
|
|
||||||
InsetCode const code = insetCode(insetType);
|
InsetCode const code = insetCode(insetType);
|
||||||
|
|
||||||
//FIXME If we do the one massive switch, we cannot do this here, since
|
//FIXME If we do the one massive switch, we cannot do this here, since
|
||||||
//we do not know in advance that we're dealing with a command inset.
|
//we do not know in advance that we're dealing with a command inset.
|
||||||
//Worst case, we could put it in each case below. Better, we could
|
//Worst case, we could put it in each case below. Better, we could
|
||||||
@ -550,7 +550,7 @@ Inset * readInset(Lexer & lex, Buffer * buf)
|
|||||||
case BIBTEX_CODE:
|
case BIBTEX_CODE:
|
||||||
inset.reset(new InsetBibtex(buf, inscmd));
|
inset.reset(new InsetBibtex(buf, inscmd));
|
||||||
break;
|
break;
|
||||||
case CITE_CODE:
|
case CITE_CODE:
|
||||||
inset.reset(new InsetCitation(buf, inscmd));
|
inset.reset(new InsetCitation(buf, inscmd));
|
||||||
break;
|
break;
|
||||||
case HYPERLINK_CODE:
|
case HYPERLINK_CODE:
|
||||||
|
@ -610,8 +610,8 @@ void ButtonPolicy::Private::initOkApplyCancelAutoReadOnly()
|
|||||||
state_machine_[AUTOAPPLY_INITIAL][SMI_AUTOAPPLY] = APPLIED;
|
state_machine_[AUTOAPPLY_INITIAL][SMI_AUTOAPPLY] = APPLIED;
|
||||||
state_machine_[AUTOAPPLY_INITIAL][SMI_READ_ONLY] = RO_AUTOAPPLY;
|
state_machine_[AUTOAPPLY_INITIAL][SMI_READ_ONLY] = RO_AUTOAPPLY;
|
||||||
state_machine_[AUTOAPPLY_INITIAL][SMI_VALID] = AUTOAPPLY_CHANGED;
|
state_machine_[AUTOAPPLY_INITIAL][SMI_VALID] = AUTOAPPLY_CHANGED;
|
||||||
state_machine_[AUTOAPPLY_INITIAL][SMI_INVALID] = AUTOAPPLY_CHANGED;
|
state_machine_[AUTOAPPLY_INITIAL][SMI_INVALID] = AUTOAPPLY_CHANGED;
|
||||||
state_machine_[AUTOAPPLY_INITIAL][SMI_READ_WRITE] = AUTOAPPLY_INITIAL;
|
state_machine_[AUTOAPPLY_INITIAL][SMI_READ_WRITE] = AUTOAPPLY_INITIAL;
|
||||||
// State::AUTOAPPLY_CHANGED
|
// State::AUTOAPPLY_CHANGED
|
||||||
state_machine_[AUTOAPPLY_CHANGED][SMI_AUTOAPPLY] = APPLIED;
|
state_machine_[AUTOAPPLY_CHANGED][SMI_AUTOAPPLY] = APPLIED;
|
||||||
state_machine_[AUTOAPPLY_CHANGED][SMI_READ_ONLY] = RO_AUTOAPPLY;
|
state_machine_[AUTOAPPLY_CHANGED][SMI_READ_ONLY] = RO_AUTOAPPLY;
|
||||||
|
@ -55,11 +55,11 @@ public:
|
|||||||
///
|
///
|
||||||
QSize sizeHint(QStyleOptionViewItem const & opt,
|
QSize sizeHint(QStyleOptionViewItem const & opt,
|
||||||
QModelIndex const & index) const;
|
QModelIndex const & index) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
///
|
///
|
||||||
void drawCategoryHeader(QPainter * painter, QStyleOptionViewItem const & opt,
|
void drawCategoryHeader(QPainter * painter, QStyleOptionViewItem const & opt,
|
||||||
QString const & category) const;
|
QString const & category) const;
|
||||||
///
|
///
|
||||||
QString underlineFilter(QString const & s) const;
|
QString underlineFilter(QString const & s) const;
|
||||||
///
|
///
|
||||||
@ -106,8 +106,8 @@ struct CategorizedCombo::Private
|
|||||||
void countCategories();
|
void countCategories();
|
||||||
///
|
///
|
||||||
CategorizedCombo * p;
|
CategorizedCombo * p;
|
||||||
|
|
||||||
/** the layout model:
|
/** the layout model:
|
||||||
* 1st column: translated GUI name,
|
* 1st column: translated GUI name,
|
||||||
* 2nd column: raw item name,
|
* 2nd column: raw item name,
|
||||||
* 3rd column: category,
|
* 3rd column: category,
|
||||||
@ -162,7 +162,7 @@ void CCItemDelegate::paint(QPainter * painter, QStyleOptionViewItem const & opti
|
|||||||
opt.state = state;
|
opt.state = state;
|
||||||
|
|
||||||
// draw category header
|
// draw category header
|
||||||
drawCategoryHeader(painter, opt,
|
drawCategoryHeader(painter, opt,
|
||||||
categoryCC(*index.model(), index.row()));
|
categoryCC(*index.model(), index.row()));
|
||||||
|
|
||||||
// move rect down below header
|
// move rect down below header
|
||||||
@ -317,14 +317,14 @@ void CategorizedCombo::Private::setFilter(QString const & s)
|
|||||||
filter_ = s;
|
filter_ = s;
|
||||||
filterModel_->setFilterRegExp(charFilterRegExpCC(filter_));
|
filterModel_->setFilterRegExp(charFilterRegExpCC(filter_));
|
||||||
countCategories();
|
countCategories();
|
||||||
|
|
||||||
// restore old selection
|
// restore old selection
|
||||||
if (lastSel_ != -1) {
|
if (lastSel_ != -1) {
|
||||||
QModelIndex i = filterModel_->mapFromSource(model_->index(lastSel_, 0));
|
QModelIndex i = filterModel_->mapFromSource(model_->index(lastSel_, 0));
|
||||||
if (i.isValid())
|
if (i.isValid())
|
||||||
p->setCurrentIndex(i.row());
|
p->setCurrentIndex(i.row());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Workaround to resize to content size
|
// Workaround to resize to content size
|
||||||
// FIXME: There must be a better way. The QComboBox::AdjustToContents)
|
// FIXME: There must be a better way. The QComboBox::AdjustToContents)
|
||||||
// does not help.
|
// does not help.
|
||||||
@ -339,7 +339,7 @@ void CategorizedCombo::Private::setFilter(QString const & s)
|
|||||||
p->QComboBox::showPopup();
|
p->QComboBox::showPopup();
|
||||||
inShowPopup_ = false;
|
inShowPopup_ = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
p->view()->setUpdatesEnabled(enabled);
|
p->view()->setUpdatesEnabled(enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -356,7 +356,7 @@ CategorizedCombo::CategorizedCombo(QWidget * parent)
|
|||||||
// for the filtering we have to intercept characters
|
// for the filtering we have to intercept characters
|
||||||
view()->installEventFilter(this);
|
view()->installEventFilter(this);
|
||||||
view()->setItemDelegateForColumn(0, d->CCItemDelegate_);
|
view()->setItemDelegateForColumn(0, d->CCItemDelegate_);
|
||||||
|
|
||||||
updateCombo();
|
updateCombo();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -373,7 +373,7 @@ void CategorizedCombo::Private::countCategories()
|
|||||||
if (n == 0)
|
if (n == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QString prevCat = model_->index(0, 2).data().toString();
|
QString prevCat = model_->index(0, 2).data().toString();
|
||||||
|
|
||||||
// count categories
|
// count categories
|
||||||
for (int i = 1; i < n; ++i) {
|
for (int i = 1; i < n; ++i) {
|
||||||
@ -412,7 +412,7 @@ bool CategorizedCombo::eventFilter(QObject * o, QEvent * e)
|
|||||||
bool modified = (ke->modifiers() == Qt::ControlModifier)
|
bool modified = (ke->modifiers() == Qt::ControlModifier)
|
||||||
|| (ke->modifiers() == Qt::AltModifier)
|
|| (ke->modifiers() == Qt::AltModifier)
|
||||||
|| (ke->modifiers() == Qt::MetaModifier);
|
|| (ke->modifiers() == Qt::MetaModifier);
|
||||||
|
|
||||||
switch (ke->key()) {
|
switch (ke->key()) {
|
||||||
case Qt::Key_Escape:
|
case Qt::Key_Escape:
|
||||||
if (!modified && !d->filter_.isEmpty()) {
|
if (!modified && !d->filter_.isEmpty()) {
|
||||||
@ -520,7 +520,7 @@ void CategorizedCombo::addItemSort(QString const & item, QString const & guiname
|
|||||||
if (sortedByCat) {
|
if (sortedByCat) {
|
||||||
// If sortCats == true, sort categories alphabetically, uncategorized at the end.
|
// If sortCats == true, sort categories alphabetically, uncategorized at the end.
|
||||||
while (i < end && d->model_->item(i, 2)->text() != qcat
|
while (i < end && d->model_->item(i, 2)->text() != qcat
|
||||||
&& (!sortCats
|
&& (!sortCats
|
||||||
|| (!uncategorized && d->model_->item(i, 2)->text().localeAwareCompare(qcat) < 0
|
|| (!uncategorized && d->model_->item(i, 2)->text().localeAwareCompare(qcat) < 0
|
||||||
&& d->model_->item(i, 2)->text() != qt_("Uncategorized"))
|
&& d->model_->item(i, 2)->text() != qt_("Uncategorized"))
|
||||||
|| (uncategorized && d->model_->item(i, 2)->text() != qt_("Uncategorized"))))
|
|| (uncategorized && d->model_->item(i, 2)->text() != qt_("Uncategorized"))))
|
||||||
@ -571,7 +571,7 @@ void CategorizedCombo::reset()
|
|||||||
void CategorizedCombo::updateCombo()
|
void CategorizedCombo::updateCombo()
|
||||||
{
|
{
|
||||||
d->countCategories();
|
d->countCategories();
|
||||||
|
|
||||||
// needed to recalculate size hint
|
// needed to recalculate size hint
|
||||||
hide();
|
hide();
|
||||||
setMinimumWidth(sizeHint().width());
|
setMinimumWidth(sizeHint().width());
|
||||||
|
@ -93,7 +93,7 @@ FileDialog::Result FileDialog::save(QString const & path,
|
|||||||
|
|
||||||
#ifdef USE_NATIVE_FILEDIALOG
|
#ifdef USE_NATIVE_FILEDIALOG
|
||||||
QString const startsWith = makeAbsPath(suggested, path);
|
QString const startsWith = makeAbsPath(suggested, path);
|
||||||
QString const name =
|
QString const name =
|
||||||
QFileDialog::getSaveFileName(qApp->focusWidget(),
|
QFileDialog::getSaveFileName(qApp->focusWidget(),
|
||||||
title_, startsWith, filters.join(";;"),
|
title_, startsWith, filters.join(";;"),
|
||||||
selectedFilter, QFileDialog::DontConfirmOverwrite);
|
selectedFilter, QFileDialog::DontConfirmOverwrite);
|
||||||
|
@ -196,7 +196,7 @@ void doWarning(docstring const & title0, docstring const & message,
|
|||||||
void warning(docstring const & title0, docstring const & message,
|
void warning(docstring const & title0, docstring const & message,
|
||||||
bool const & askshowagain)
|
bool const & askshowagain)
|
||||||
{
|
{
|
||||||
#ifdef EXPORT_in_THREAD
|
#ifdef EXPORT_in_THREAD
|
||||||
InGuiThread<void>().call(&doWarning,
|
InGuiThread<void>().call(&doWarning,
|
||||||
#else
|
#else
|
||||||
doWarning(
|
doWarning(
|
||||||
@ -246,7 +246,7 @@ void doError(docstring const & title0, docstring const & message, bool backtrace
|
|||||||
void error(docstring const & title0, docstring const & message, bool backtrace)
|
void error(docstring const & title0, docstring const & message, bool backtrace)
|
||||||
{
|
{
|
||||||
#ifdef EXPORT_in_THREAD
|
#ifdef EXPORT_in_THREAD
|
||||||
InGuiThread<void>().call(&doError,
|
InGuiThread<void>().call(&doError,
|
||||||
#else
|
#else
|
||||||
doError(
|
doError(
|
||||||
#endif
|
#endif
|
||||||
|
@ -598,7 +598,7 @@ QPixmap getPixmap(QString const & path, QString const & name, QString const & ex
|
|||||||
if (getPixmap(pixmap, fpath)) {
|
if (getPixmap(pixmap, fpath)) {
|
||||||
return pixmap;
|
return pixmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList exts = ext.split(",");
|
QStringList exts = ext.split(",");
|
||||||
fpath = ":/" + path + name + ".";
|
fpath = ":/" + path + name + ".";
|
||||||
for (int i = 0; i < exts.size(); ++i) {
|
for (int i = 0; i < exts.size(); ++i) {
|
||||||
|
@ -342,7 +342,7 @@ void GuiBox::paramsToDialog(Inset const * inset)
|
|||||||
&& halignCO->count() < 4)
|
&& halignCO->count() < 4)
|
||||||
halignCO->addItem(toqstr("Stretch"));
|
halignCO->addItem(toqstr("Stretch"));
|
||||||
else if (inner_type != "makebox" && (type != "Boxed" && inner_type != "none"))
|
else if (inner_type != "makebox" && (type != "Boxed" && inner_type != "none"))
|
||||||
halignCO->removeItem(3);
|
halignCO->removeItem(3);
|
||||||
// pagebreak is only allowed for Boxed without inner box
|
// pagebreak is only allowed for Boxed without inner box
|
||||||
pagebreakCB->setEnabled(!ibox && type == "Boxed");
|
pagebreakCB->setEnabled(!ibox && type == "Boxed");
|
||||||
|
|
||||||
|
@ -80,10 +80,10 @@ GuiBranches::GuiBranches(QWidget * parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool GuiBranches::eventFilter(QObject * obj, QEvent * event)
|
bool GuiBranches::eventFilter(QObject * obj, QEvent * event)
|
||||||
{
|
{
|
||||||
QEvent::Type etype = event->type();
|
QEvent::Type etype = event->type();
|
||||||
if (etype == QEvent::KeyPress
|
if (etype == QEvent::KeyPress
|
||||||
&& obj == newBranchLE
|
&& obj == newBranchLE
|
||||||
&& addBranchPB->isEnabled()) {
|
&& addBranchPB->isEnabled()) {
|
||||||
QKeyEvent * keyEvent = static_cast<QKeyEvent *>(event);
|
QKeyEvent * keyEvent = static_cast<QKeyEvent *>(event);
|
||||||
@ -224,7 +224,7 @@ void GuiBranches::on_renamePB_pressed()
|
|||||||
updateView();
|
updateView();
|
||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
Alert::error(_("Renaming failed"),
|
Alert::error(_("Renaming failed"),
|
||||||
_("The branch could not be renamed."));
|
_("The branch could not be renamed."));
|
||||||
else
|
else
|
||||||
// emit signal
|
// emit signal
|
||||||
@ -352,7 +352,7 @@ void GuiBranches::addUnknown()
|
|||||||
{
|
{
|
||||||
QList<QListWidgetItem *> selItems =
|
QList<QListWidgetItem *> selItems =
|
||||||
undef_->branchesLW->selectedItems();
|
undef_->branchesLW->selectedItems();
|
||||||
|
|
||||||
QList<QListWidgetItem *>::const_iterator it = selItems.begin();
|
QList<QListWidgetItem *>::const_iterator it = selItems.begin();
|
||||||
for (; it != selItems.end() ; ++it) {
|
for (; it != selItems.end() ; ++it) {
|
||||||
QListWidgetItem const * new_branch = *it;
|
QListWidgetItem const * new_branch = *it;
|
||||||
|
@ -128,11 +128,11 @@ GuiCommandBuffer::GuiCommandBuffer(GuiView * view)
|
|||||||
top->setMargin(0);
|
top->setMargin(0);
|
||||||
setFocusProxy(edit_);
|
setFocusProxy(edit_);
|
||||||
|
|
||||||
LastCommandsSection::LastCommands last_commands
|
LastCommandsSection::LastCommands last_commands
|
||||||
= theSession().lastCommands().getcommands();
|
= theSession().lastCommands().getcommands();
|
||||||
LastCommandsSection::LastCommands::const_iterator it
|
LastCommandsSection::LastCommands::const_iterator it
|
||||||
= last_commands.begin();
|
= last_commands.begin();
|
||||||
LastCommandsSection::LastCommands::const_iterator end
|
LastCommandsSection::LastCommands::const_iterator end
|
||||||
= last_commands.end();
|
= last_commands.end();
|
||||||
|
|
||||||
upPB->setEnabled(it != end);
|
upPB->setEnabled(it != end);
|
||||||
@ -252,7 +252,7 @@ void GuiCommandBuffer::down()
|
|||||||
&& history_pos_ != history_.end() - 1);
|
&& history_pos_ != history_.end() - 1);
|
||||||
upPB->setEnabled(history_pos_ != history_.begin());
|
upPB->setEnabled(history_pos_ != history_.begin());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GuiCommandBuffer::hideParent()
|
void GuiCommandBuffer::hideParent()
|
||||||
{
|
{
|
||||||
|
@ -78,7 +78,7 @@ GuiCompare::~GuiCompare()
|
|||||||
|
|
||||||
void GuiCompare::closeEvent(QCloseEvent *)
|
void GuiCompare::closeEvent(QCloseEvent *)
|
||||||
{
|
{
|
||||||
slotCancel();
|
slotCancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -154,7 +154,7 @@ QString GuiCompare::browse(QString const & in_name) const
|
|||||||
QString const title = qt_("Select document");
|
QString const title = qt_("Select document");
|
||||||
|
|
||||||
QStringList const & filters = fileFilters(qt_("LyX Documents (*.lyx)"));
|
QStringList const & filters = fileFilters(qt_("LyX Documents (*.lyx)"));
|
||||||
|
|
||||||
QString filename;
|
QString filename;
|
||||||
if (lyxview().documentBufferView()) {
|
if (lyxview().documentBufferView()) {
|
||||||
QString path = bufferFilePath();
|
QString path = bufferFilePath();
|
||||||
@ -166,7 +166,7 @@ QString GuiCompare::browse(QString const & in_name) const
|
|||||||
qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
|
qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
|
||||||
filename = makeAbsPath(rel_filename, path);
|
filename = makeAbsPath(rel_filename, path);
|
||||||
}
|
}
|
||||||
return filename;
|
return filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -207,7 +207,7 @@ void GuiCompare::finished(bool aborted)
|
|||||||
delete compare_;
|
delete compare_;
|
||||||
compare_ = 0;
|
compare_ = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aborted) {
|
if (aborted) {
|
||||||
if (dest_buffer_) {
|
if (dest_buffer_) {
|
||||||
dest_buffer_->markClean();
|
dest_buffer_->markClean();
|
||||||
|
@ -66,7 +66,7 @@ protected:
|
|||||||
QStyleOptionViewItem opt = setOptions(index, option);
|
QStyleOptionViewItem opt = setOptions(index, option);
|
||||||
QVariant value = index.data(Qt::DisplayRole);
|
QVariant value = index.data(Qt::DisplayRole);
|
||||||
QPixmap pixmap = qvariant_cast<QPixmap>(value);
|
QPixmap pixmap = qvariant_cast<QPixmap>(value);
|
||||||
|
|
||||||
// draw
|
// draw
|
||||||
painter->save();
|
painter->save();
|
||||||
drawBackground(painter, opt, index);
|
drawBackground(painter, opt, index);
|
||||||
@ -128,13 +128,13 @@ public:
|
|||||||
|
|
||||||
if (role != Qt::DisplayRole && role != Qt::EditRole)
|
if (role != Qt::DisplayRole && role != Qt::EditRole)
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
|
||||||
if (index.column() == 0)
|
if (index.column() == 0)
|
||||||
return toqstr(list_->data(index.row()));
|
return toqstr(list_->data(index.row()));
|
||||||
|
|
||||||
if (index.column() != 1)
|
if (index.column() != 1)
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
|
||||||
// get icon from cache
|
// get icon from cache
|
||||||
QPixmap scaled;
|
QPixmap scaled;
|
||||||
QString const name = ":" + toqstr(list_->icon(index.row()));
|
QString const name = ":" + toqstr(list_->icon(index.row()));
|
||||||
@ -145,7 +145,7 @@ public:
|
|||||||
QPixmap p = QPixmap(name);
|
QPixmap p = QPixmap(name);
|
||||||
if (!p.isNull()) {
|
if (!p.isNull()) {
|
||||||
// scale it to 16x16 or smaller
|
// scale it to 16x16 or smaller
|
||||||
scaled = p.scaled(min(16, p.width()), min(16, p.height()),
|
scaled = p.scaled(min(16, p.width()), min(16, p.height()),
|
||||||
Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
}
|
}
|
||||||
QPixmapCache::insert("completion" + name, scaled);
|
QPixmapCache::insert("completion" + name, scaled);
|
||||||
@ -170,7 +170,7 @@ GuiCompleter::GuiCompleter(GuiWorkArea * gui, QObject * parent)
|
|||||||
setCompletionMode(QCompleter::PopupCompletion);
|
setCompletionMode(QCompleter::PopupCompletion);
|
||||||
setCaseSensitivity(Qt::CaseSensitive);
|
setCaseSensitivity(Qt::CaseSensitive);
|
||||||
setWidget(gui_);
|
setWidget(gui_);
|
||||||
|
|
||||||
// create the popup
|
// create the popup
|
||||||
QTreeView *listView = new QTreeView;
|
QTreeView *listView = new QTreeView;
|
||||||
listView->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
listView->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||||
@ -181,10 +181,10 @@ GuiCompleter::GuiCompleter(GuiWorkArea * gui, QObject * parent)
|
|||||||
listView->setIndentation(0);
|
listView->setIndentation(0);
|
||||||
listView->setUniformRowHeights(true);
|
listView->setUniformRowHeights(true);
|
||||||
setPopup(listView);
|
setPopup(listView);
|
||||||
|
|
||||||
itemDelegate_ = new CompleterItemDelegate(this);
|
itemDelegate_ = new CompleterItemDelegate(this);
|
||||||
popup()->setItemDelegate(itemDelegate_);
|
popup()->setItemDelegate(itemDelegate_);
|
||||||
|
|
||||||
// create timeout timers
|
// create timeout timers
|
||||||
popup_timer_.setSingleShot(true);
|
popup_timer_.setSingleShot(true);
|
||||||
inline_timer_.setSingleShot(true);
|
inline_timer_.setSingleShot(true);
|
||||||
@ -219,7 +219,7 @@ bool GuiCompleter::eventFilter(QObject * watched, QEvent * e)
|
|||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return QCompleter::eventFilter(watched, e);
|
return QCompleter::eventFilter(watched, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,7 +247,7 @@ bool GuiCompleter::uniqueCompletionAvailable() const
|
|||||||
if (n > 1 || n == 0)
|
if (n > 1 || n == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// if there is exactly one, we have to check whether it is a
|
// if there is exactly one, we have to check whether it is a
|
||||||
// real completion, i.e. longer than the current prefix.
|
// real completion, i.e. longer than the current prefix.
|
||||||
if (completionPrefix() == currentCompletion())
|
if (completionPrefix() == currentCompletion())
|
||||||
return false;
|
return false;
|
||||||
@ -263,7 +263,7 @@ bool GuiCompleter::completionAvailable() const
|
|||||||
|
|
||||||
size_t n = popup()->model()->rowCount();
|
size_t n = popup()->model()->rowCount();
|
||||||
|
|
||||||
// if there is exactly one, we have to check whether it is a
|
// if there is exactly one, we have to check whether it is a
|
||||||
// real completion, i.e. longer than the current prefix.
|
// real completion, i.e. longer than the current prefix.
|
||||||
if (n == 1 && completionPrefix() == currentCompletion())
|
if (n == 1 && completionPrefix() == currentCompletion())
|
||||||
return false;
|
return false;
|
||||||
@ -338,9 +338,9 @@ void GuiCompleter::updateVisibility(bool start, bool keep)
|
|||||||
{
|
{
|
||||||
Cursor cur = gui_->bufferView().cursor();
|
Cursor cur = gui_->bufferView().cursor();
|
||||||
cur.screenUpdateFlags(Update::None);
|
cur.screenUpdateFlags(Update::None);
|
||||||
|
|
||||||
updateVisibility(cur, start, keep);
|
updateVisibility(cur, start, keep);
|
||||||
|
|
||||||
if (cur.result().screenUpdate())
|
if (cur.result().screenUpdate())
|
||||||
gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
|
gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
|
||||||
}
|
}
|
||||||
@ -352,12 +352,12 @@ void GuiCompleter::updatePrefix(Cursor const & cur)
|
|||||||
QString newPrefix = toqstr(cur.inset().completionPrefix(cur));
|
QString newPrefix = toqstr(cur.inset().completionPrefix(cur));
|
||||||
if (newPrefix == completionPrefix())
|
if (newPrefix == completionPrefix())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// value which should be kept selected
|
// value which should be kept selected
|
||||||
QString old = currentCompletion();
|
QString old = currentCompletion();
|
||||||
if (old.length() == 0)
|
if (old.length() == 0)
|
||||||
old = last_selection_;
|
old = last_selection_;
|
||||||
|
|
||||||
// update completer to new prefix
|
// update completer to new prefix
|
||||||
setCompletionPrefix(newPrefix);
|
setCompletionPrefix(newPrefix);
|
||||||
|
|
||||||
@ -367,7 +367,7 @@ void GuiCompleter::updatePrefix(Cursor const & cur)
|
|||||||
|
|
||||||
// restore old selection
|
// restore old selection
|
||||||
setCurrentCompletion(old);
|
setCurrentCompletion(old);
|
||||||
|
|
||||||
// if popup is not empty, the new selection will
|
// if popup is not empty, the new selection will
|
||||||
// be our last valid one
|
// be our last valid one
|
||||||
QString const & s = currentCompletion();
|
QString const & s = currentCompletion();
|
||||||
@ -389,11 +389,11 @@ void GuiCompleter::updateInline(Cursor const & cur, QString const & completion)
|
|||||||
{
|
{
|
||||||
if (!cur.inset().inlineCompletionSupported(cur))
|
if (!cur.inset().inlineCompletionSupported(cur))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// compute postfix
|
// compute postfix
|
||||||
docstring prefix = cur.inset().completionPrefix(cur);
|
docstring prefix = cur.inset().completionPrefix(cur);
|
||||||
docstring postfix = qstring_to_ucs4(completion.mid(prefix.length()));
|
docstring postfix = qstring_to_ucs4(completion.mid(prefix.length()));
|
||||||
|
|
||||||
// shorten it if necessary
|
// shorten it if necessary
|
||||||
if (lyxrc.completion_inline_dots != -1)
|
if (lyxrc.completion_inline_dots != -1)
|
||||||
support::truncateWithEllipsis(postfix,
|
support::truncateWithEllipsis(postfix,
|
||||||
@ -410,7 +410,7 @@ void GuiCompleter::updatePopup(Cursor const & cur)
|
|||||||
{
|
{
|
||||||
if (!cur.inset().completionSupported(cur))
|
if (!cur.inset().completionSupported(cur))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
popupVisible_ = true;
|
popupVisible_ = true;
|
||||||
|
|
||||||
if (completionCount() == 0) {
|
if (completionCount() == 0) {
|
||||||
@ -436,14 +436,14 @@ void GuiCompleter::asyncUpdatePopup()
|
|||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
cur.inset().completionPosAndDim(cur, x, y, dim);
|
cur.inset().completionPosAndDim(cur, x, y, dim);
|
||||||
|
|
||||||
// and calculate the rect of the popup
|
// and calculate the rect of the popup
|
||||||
QRect rect;
|
QRect rect;
|
||||||
if (popup()->layoutDirection() == Qt::RightToLeft)
|
if (popup()->layoutDirection() == Qt::RightToLeft)
|
||||||
rect = QRect(x + dim.width() - 200, y - dim.ascent() - 3, 200, dim.height() + 6);
|
rect = QRect(x + dim.width() - 200, y - dim.ascent() - 3, 200, dim.height() + 6);
|
||||||
else
|
else
|
||||||
rect = QRect(x, y - dim.ascent() - 3, 200, dim.height() + 6);
|
rect = QRect(x, y - dim.ascent() - 3, 200, dim.height() + 6);
|
||||||
|
|
||||||
// Resize the columns in the popup.
|
// Resize the columns in the popup.
|
||||||
// This should really be in the constructor. But somehow the treeview
|
// This should really be in the constructor. But somehow the treeview
|
||||||
// has a bad memory about it and we have to tell him again and again.
|
// has a bad memory about it and we have to tell him again and again.
|
||||||
@ -452,7 +452,7 @@ void GuiCompleter::asyncUpdatePopup()
|
|||||||
setSectionResizeMode(listView->header(), 0, QHeaderView::Stretch);
|
setSectionResizeMode(listView->header(), 0, QHeaderView::Stretch);
|
||||||
setSectionResizeMode(listView->header(), 1, QHeaderView::Fixed);
|
setSectionResizeMode(listView->header(), 1, QHeaderView::Fixed);
|
||||||
listView->header()->resizeSection(1, 22);
|
listView->header()->resizeSection(1, 22);
|
||||||
|
|
||||||
// show/update popup
|
// show/update popup
|
||||||
complete(rect);
|
complete(rect);
|
||||||
}
|
}
|
||||||
@ -467,10 +467,10 @@ void GuiCompleter::updateAvailability()
|
|||||||
Cursor const & cur = gui_->bufferView().cursor();
|
Cursor const & cur = gui_->bufferView().cursor();
|
||||||
if (!popupPossible(cur) && !inlinePossible(cur))
|
if (!popupPossible(cur) && !inlinePossible(cur))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
updateModel(cur, false, false);
|
updateModel(cur, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GuiCompleter::updateModel(Cursor const & cur, bool popupUpdate, bool inlineUpdate)
|
void GuiCompleter::updateModel(Cursor const & cur, bool popupUpdate, bool inlineUpdate)
|
||||||
{
|
{
|
||||||
@ -509,7 +509,7 @@ void GuiCompleter::updateModel(Cursor const & cur, bool popupUpdate, bool inline
|
|||||||
|
|
||||||
// restore old selection
|
// restore old selection
|
||||||
setCurrentCompletion(old);
|
setCurrentCompletion(old);
|
||||||
|
|
||||||
// if popup is not empty, the new selection will
|
// if popup is not empty, the new selection will
|
||||||
// be our last valid one
|
// be our last valid one
|
||||||
if (popupVisible() || inlineVisible()) {
|
if (popupVisible() || inlineVisible()) {
|
||||||
@ -530,7 +530,7 @@ void GuiCompleter::showPopup(Cursor const & cur)
|
|||||||
{
|
{
|
||||||
if (!popupPossible(cur))
|
if (!popupPossible(cur))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
updateModel(cur, true, inlineVisible());
|
updateModel(cur, true, inlineVisible());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -547,7 +547,7 @@ void GuiCompleter::showInline(Cursor const & cur)
|
|||||||
{
|
{
|
||||||
if (!inlinePossible(cur))
|
if (!inlinePossible(cur))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
updateModel(cur, popupVisible(), true);
|
updateModel(cur, popupVisible(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -556,10 +556,10 @@ void GuiCompleter::hideInline(Cursor const & cur)
|
|||||||
{
|
{
|
||||||
gui_->bufferView().setInlineCompletion(cur, DocIterator(cur.buffer()), docstring());
|
gui_->bufferView().setInlineCompletion(cur, DocIterator(cur.buffer()), docstring());
|
||||||
inlineVisible_ = false;
|
inlineVisible_ = false;
|
||||||
|
|
||||||
if (inline_timer_.isActive())
|
if (inline_timer_.isActive())
|
||||||
inline_timer_.stop();
|
inline_timer_.stop();
|
||||||
|
|
||||||
// Trigger asynchronous part of hideInline. We might be
|
// Trigger asynchronous part of hideInline. We might be
|
||||||
// in a dispatcher here and the setModel call might
|
// in a dispatcher here and the setModel call might
|
||||||
// trigger focus events which is are not healthy here.
|
// trigger focus events which is are not healthy here.
|
||||||
@ -582,7 +582,7 @@ void GuiCompleter::showPopup()
|
|||||||
{
|
{
|
||||||
Cursor cur = gui_->bufferView().cursor();
|
Cursor cur = gui_->bufferView().cursor();
|
||||||
cur.screenUpdateFlags(Update::None);
|
cur.screenUpdateFlags(Update::None);
|
||||||
|
|
||||||
showPopup(cur);
|
showPopup(cur);
|
||||||
|
|
||||||
// redraw if needed
|
// redraw if needed
|
||||||
@ -595,7 +595,7 @@ void GuiCompleter::showInline()
|
|||||||
{
|
{
|
||||||
Cursor cur = gui_->bufferView().cursor();
|
Cursor cur = gui_->bufferView().cursor();
|
||||||
cur.screenUpdateFlags(Update::None);
|
cur.screenUpdateFlags(Update::None);
|
||||||
|
|
||||||
showInline(cur);
|
showInline(cur);
|
||||||
|
|
||||||
// redraw if needed
|
// redraw if needed
|
||||||
@ -617,7 +617,7 @@ void GuiCompleter::hidePopup()
|
|||||||
// yet up to date such that the coord cache has not all insets yet. The
|
// yet up to date such that the coord cache has not all insets yet. The
|
||||||
// cursorPos methods would triggers asserts in the coord cache then.
|
// cursorPos methods would triggers asserts in the coord cache then.
|
||||||
QTimer::singleShot(0, this, SLOT(asyncHidePopup()));
|
QTimer::singleShot(0, this, SLOT(asyncHidePopup()));
|
||||||
|
|
||||||
// mark that the asynchronous part will reset the model
|
// mark that the asynchronous part will reset the model
|
||||||
if (!inlineVisible())
|
if (!inlineVisible())
|
||||||
modelActive_ = false;
|
modelActive_ = false;
|
||||||
@ -628,9 +628,9 @@ void GuiCompleter::hideInline()
|
|||||||
{
|
{
|
||||||
Cursor cur = gui_->bufferView().cursor();
|
Cursor cur = gui_->bufferView().cursor();
|
||||||
cur.screenUpdateFlags(Update::None);
|
cur.screenUpdateFlags(Update::None);
|
||||||
|
|
||||||
hideInline(cur);
|
hideInline(cur);
|
||||||
|
|
||||||
// redraw if needed
|
// redraw if needed
|
||||||
if (cur.result().screenUpdate())
|
if (cur.result().screenUpdate())
|
||||||
gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
|
gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
|
||||||
@ -651,13 +651,13 @@ void GuiCompleter::tab()
|
|||||||
BufferView * bv = &gui_->bufferView();
|
BufferView * bv = &gui_->bufferView();
|
||||||
Cursor cur = bv->cursor();
|
Cursor cur = bv->cursor();
|
||||||
cur.screenUpdateFlags(Update::None);
|
cur.screenUpdateFlags(Update::None);
|
||||||
|
|
||||||
// check that inline completion is active
|
// check that inline completion is active
|
||||||
if (!inlineVisible() && !uniqueCompletionAvailable()) {
|
if (!inlineVisible() && !uniqueCompletionAvailable()) {
|
||||||
// try to activate the inline completion
|
// try to activate the inline completion
|
||||||
if (cur.inset().inlineCompletionSupported(cur)) {
|
if (cur.inset().inlineCompletionSupported(cur)) {
|
||||||
showInline();
|
showInline();
|
||||||
|
|
||||||
// show popup without delay because the completion was not unique
|
// show popup without delay because the completion was not unique
|
||||||
if (lyxrc.completion_popup_after_complete
|
if (lyxrc.completion_popup_after_complete
|
||||||
&& !popupVisible()
|
&& !popupVisible()
|
||||||
@ -671,10 +671,10 @@ void GuiCompleter::tab()
|
|||||||
showPopup();
|
showPopup();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make undo possible
|
// Make undo possible
|
||||||
cur.beginUndoGroup();
|
cur.beginUndoGroup();
|
||||||
cur.recordUndo();
|
cur.recordUndo();
|
||||||
@ -685,7 +685,7 @@ void GuiCompleter::tab()
|
|||||||
if (completion.size() <= prefix.size()) {
|
if (completion.size() <= prefix.size()) {
|
||||||
// finalize completion
|
// finalize completion
|
||||||
cur.inset().insertCompletion(cur, docstring(), true);
|
cur.inset().insertCompletion(cur, docstring(), true);
|
||||||
|
|
||||||
// hide popup and inline completion
|
// hide popup and inline completion
|
||||||
hidePopup();
|
hidePopup();
|
||||||
hideInline(cur);
|
hideInline(cur);
|
||||||
@ -726,7 +726,7 @@ QString GuiCompleter::currentCompletion() const
|
|||||||
if (!popup()->selectionModel()->hasSelection())
|
if (!popup()->selectionModel()->hasSelection())
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
// Not sure if this is bug in Qt: currentIndex() always
|
// Not sure if this is bug in Qt: currentIndex() always
|
||||||
// return the first element in the list.
|
// return the first element in the list.
|
||||||
QModelIndex idx = popup()->currentIndex();
|
QModelIndex idx = popup()->currentIndex();
|
||||||
return popup()->model()->data(idx, Qt::EditRole).toString();
|
return popup()->model()->data(idx, Qt::EditRole).toString();
|
||||||
@ -734,7 +734,7 @@ QString GuiCompleter::currentCompletion() const
|
|||||||
|
|
||||||
|
|
||||||
void GuiCompleter::setCurrentCompletion(QString const & s)
|
void GuiCompleter::setCurrentCompletion(QString const & s)
|
||||||
{
|
{
|
||||||
QAbstractItemModel const & model = *popup()->model();
|
QAbstractItemModel const & model = *popup()->model();
|
||||||
size_t n = model.rowCount();
|
size_t n = model.rowCount();
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
@ -848,7 +848,7 @@ docstring GuiCompleter::longestUniqueCompletion() const
|
|||||||
// get common prefix with the middle string
|
// get common prefix with the middle string
|
||||||
size_t mid = (r + i) / 2;
|
size_t mid = (r + i) / 2;
|
||||||
QString const & mids
|
QString const & mids
|
||||||
= model.data(model.index(mid, 0),
|
= model.data(model.index(mid, 0),
|
||||||
Qt::EditRole).toString();
|
Qt::EditRole).toString();
|
||||||
size_t oldLen = s.length();
|
size_t oldLen = s.length();
|
||||||
size_t len = commonPrefix(mids, s);
|
size_t len = commonPrefix(mids, s);
|
||||||
@ -883,7 +883,7 @@ void GuiCompleter::popupActivated(const QString & completion)
|
|||||||
cur.inset().insertCompletion(cur, postfix, true);
|
cur.inset().insertCompletion(cur, postfix, true);
|
||||||
hidePopup();
|
hidePopup();
|
||||||
hideInline(cur);
|
hideInline(cur);
|
||||||
|
|
||||||
if (cur.result().screenUpdate())
|
if (cur.result().screenUpdate())
|
||||||
gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
|
gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
|
||||||
cur.endUndoGroup();
|
cur.endUndoGroup();
|
||||||
@ -897,10 +897,10 @@ void GuiCompleter::popupHighlighted(const QString & completion)
|
|||||||
|
|
||||||
Cursor cur = gui_->bufferView().cursor();
|
Cursor cur = gui_->bufferView().cursor();
|
||||||
cur.screenUpdateFlags(Update::None);
|
cur.screenUpdateFlags(Update::None);
|
||||||
|
|
||||||
if (inlineVisible())
|
if (inlineVisible())
|
||||||
updateInline(cur, completion);
|
updateInline(cur, completion);
|
||||||
|
|
||||||
if (cur.result().screenUpdate())
|
if (cur.result().screenUpdate())
|
||||||
gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
|
gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ namespace lyx {
|
|||||||
namespace frontend {
|
namespace frontend {
|
||||||
|
|
||||||
GuiDialog::GuiDialog(GuiView & lv, QString const & name, QString const & title)
|
GuiDialog::GuiDialog(GuiView & lv, QString const & name, QString const & title)
|
||||||
: QDialog(&lv), Dialog(lv, name, "LyX: " + title), updating_(false),
|
: QDialog(&lv), Dialog(lv, name, "LyX: " + title), updating_(false),
|
||||||
is_closing_(false)
|
is_closing_(false)
|
||||||
{
|
{
|
||||||
connect(&lv, SIGNAL(bufferViewChanged()),
|
connect(&lv, SIGNAL(bufferViewChanged()),
|
||||||
|
@ -1280,7 +1280,7 @@ GuiDocument::GuiDocument(GuiView & lv)
|
|||||||
connect(mathsModule->MathIndentLengthCO, SIGNAL(activated(int)),
|
connect(mathsModule->MathIndentLengthCO, SIGNAL(activated(int)),
|
||||||
this, SLOT(change_adaptor()));
|
this, SLOT(change_adaptor()));
|
||||||
|
|
||||||
|
|
||||||
mathsModule->MathIndentCO->addItem(qt_("Default"));
|
mathsModule->MathIndentCO->addItem(qt_("Default"));
|
||||||
mathsModule->MathIndentCO->addItem(qt_("Custom"));
|
mathsModule->MathIndentCO->addItem(qt_("Custom"));
|
||||||
mathsModule->MathIndentLE->setValidator(new LengthValidator(
|
mathsModule->MathIndentLE->setValidator(new LengthValidator(
|
||||||
@ -1291,7 +1291,7 @@ GuiDocument::GuiDocument(GuiView & lv)
|
|||||||
mathsModule->MathNumberingPosCO->addItem(qt_("Default"));
|
mathsModule->MathNumberingPosCO->addItem(qt_("Default"));
|
||||||
mathsModule->MathNumberingPosCO->addItem(qt_("Right"));
|
mathsModule->MathNumberingPosCO->addItem(qt_("Right"));
|
||||||
mathsModule->MathNumberingPosCO->setCurrentIndex(1);
|
mathsModule->MathNumberingPosCO->setCurrentIndex(1);
|
||||||
|
|
||||||
|
|
||||||
// latex class
|
// latex class
|
||||||
latexModule = new UiWidget<Ui::LaTeXUi>(this);
|
latexModule = new UiWidget<Ui::LaTeXUi>(this);
|
||||||
@ -3333,7 +3333,7 @@ void GuiDocument::paramsToDialog()
|
|||||||
biblioChanged_ = false;
|
biblioChanged_ = false;
|
||||||
|
|
||||||
// indices
|
// indices
|
||||||
// We may be called when there is no Buffer, e.g., when
|
// We may be called when there is no Buffer, e.g., when
|
||||||
// the last view has just been closed.
|
// the last view has just been closed.
|
||||||
bool const isReadOnly = isBufferAvailable() ? buffer().isReadonly() : false;
|
bool const isReadOnly = isBufferAvailable() ? buffer().isReadonly() : false;
|
||||||
indicesModule->update(bp_, isReadOnly);
|
indicesModule->update(bp_, isReadOnly);
|
||||||
@ -3697,7 +3697,7 @@ void GuiDocument::paramsToDialog()
|
|||||||
toqstr(bp_.fonts_cjk));
|
toqstr(bp_.fonts_cjk));
|
||||||
else
|
else
|
||||||
fontModule->cjkFontLE->setText(QString());
|
fontModule->cjkFontLE->setText(QString());
|
||||||
|
|
||||||
fontModule->microtypeCB->setChecked(bp_.use_microtype);
|
fontModule->microtypeCB->setChecked(bp_.use_microtype);
|
||||||
fontModule->dashesCB->setChecked(bp_.use_dash_ligatures);
|
fontModule->dashesCB->setChecked(bp_.use_dash_ligatures);
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ bool GuiErrorList::initialiseParams(string const & data)
|
|||||||
buf_ = from_master_ ?
|
buf_ = from_master_ ?
|
||||||
bufferview()->buffer().masterBuffer()
|
bufferview()->buffer().masterBuffer()
|
||||||
: &bufferview()->buffer();
|
: &bufferview()->buffer();
|
||||||
name_ = bformat(_("%1$s Errors (%2$s)"),
|
name_ = bformat(_("%1$s Errors (%2$s)"),
|
||||||
_(guiErrorType(error_type)),
|
_(guiErrorType(error_type)),
|
||||||
from_utf8(buf_->absFileName()));
|
from_utf8(buf_->absFileName()));
|
||||||
paramsToDialog();
|
paramsToDialog();
|
||||||
|
@ -301,7 +301,7 @@ QFont makeQFont(FontInfo const & f)
|
|||||||
switch (f.family()) {
|
switch (f.family()) {
|
||||||
case ROMAN_FAMILY: {
|
case ROMAN_FAMILY: {
|
||||||
QString family = makeFontName(toqstr(lyxrc.roman_font_name),
|
QString family = makeFontName(toqstr(lyxrc.roman_font_name),
|
||||||
toqstr(lyxrc.roman_font_foundry));
|
toqstr(lyxrc.roman_font_foundry));
|
||||||
font.setFamily(family);
|
font.setFamily(family);
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
#if QT_VERSION >= 0x040300 //&& QT_VERSION < 0x040800
|
#if QT_VERSION >= 0x040300 //&& QT_VERSION < 0x040800
|
||||||
|
@ -113,7 +113,7 @@ GuiGraphics::GuiGraphics(GuiView & lv)
|
|||||||
: GuiDialog(lv, "graphics", qt_("Graphics")), bbChanged(false)
|
: GuiDialog(lv, "graphics", qt_("Graphics")), bbChanged(false)
|
||||||
{
|
{
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
//main buttons
|
//main buttons
|
||||||
connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
|
connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
|
||||||
connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
|
connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
|
||||||
@ -155,7 +155,7 @@ GuiGraphics::GuiGraphics(GuiView & lv)
|
|||||||
filename->setValidator(new PathValidator(true, filename));
|
filename->setValidator(new PathValidator(true, filename));
|
||||||
setFocusProxy(filename);
|
setFocusProxy(filename);
|
||||||
|
|
||||||
QDoubleValidator * scaleValidator =
|
QDoubleValidator * scaleValidator =
|
||||||
new DoubleAutoValidator(Scale, qt_(autostr));
|
new DoubleAutoValidator(Scale, qt_(autostr));
|
||||||
scaleValidator->setBottom(0);
|
scaleValidator->setBottom(0);
|
||||||
scaleValidator->setDecimals(256); //I guess that will do
|
scaleValidator->setDecimals(256); //I guess that will do
|
||||||
@ -255,12 +255,12 @@ void GuiGraphics::changeGroup(int /* index */)
|
|||||||
{
|
{
|
||||||
QString const new_group = groupCO->itemData(
|
QString const new_group = groupCO->itemData(
|
||||||
groupCO->currentIndex()).toString();
|
groupCO->currentIndex()).toString();
|
||||||
|
|
||||||
// check if the old group consisted only of this member
|
// check if the old group consisted only of this member
|
||||||
if (current_group_ != fromqstr(new_group)
|
if (current_group_ != fromqstr(new_group)
|
||||||
&& graphics::countGroupMembers(buffer(), current_group_) == 1) {
|
&& graphics::countGroupMembers(buffer(), current_group_) == 1) {
|
||||||
if (!new_group.isEmpty()) {
|
if (!new_group.isEmpty()) {
|
||||||
if (Alert::prompt(_("Dissolve previous group?"),
|
if (Alert::prompt(_("Dissolve previous group?"),
|
||||||
bformat(_("If you assign this graphic to group '%2$s',\n"
|
bformat(_("If you assign this graphic to group '%2$s',\n"
|
||||||
"the previously assigned group '%1$s' will be dissolved,\n"
|
"the previously assigned group '%1$s' will be dissolved,\n"
|
||||||
"because this graphic was its only member.\n"
|
"because this graphic was its only member.\n"
|
||||||
@ -276,7 +276,7 @@ void GuiGraphics::changeGroup(int /* index */)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (Alert::prompt(_("Dissolve previous group?"),
|
if (Alert::prompt(_("Dissolve previous group?"),
|
||||||
bformat(_("If you sign off this graphic from group '%1$s',\n"
|
bformat(_("If you sign off this graphic from group '%1$s',\n"
|
||||||
"the group will be dissolved,\n"
|
"the group will be dissolved,\n"
|
||||||
"because this graphic was its only member.\n"
|
"because this graphic was its only member.\n"
|
||||||
@ -292,7 +292,7 @@ void GuiGraphics::changeGroup(int /* index */)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (new_group.isEmpty()) {
|
if (new_group.isEmpty()) {
|
||||||
changed();
|
changed();
|
||||||
@ -305,7 +305,7 @@ void GuiGraphics::changeGroup(int /* index */)
|
|||||||
changed();
|
changed();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// filename might have been changed
|
// filename might have been changed
|
||||||
QString current_filename = filename->text();
|
QString current_filename = filename->text();
|
||||||
|
|
||||||
@ -314,7 +314,7 @@ void GuiGraphics::changeGroup(int /* index */)
|
|||||||
InsetGraphics::string2params(grp, buffer(), params_);
|
InsetGraphics::string2params(grp, buffer(), params_);
|
||||||
paramsToDialog(params_);
|
paramsToDialog(params_);
|
||||||
groupCO->blockSignals(false);
|
groupCO->blockSignals(false);
|
||||||
|
|
||||||
// reset filename
|
// reset filename
|
||||||
filename->setText(current_filename);
|
filename->setText(current_filename);
|
||||||
|
|
||||||
@ -330,7 +330,7 @@ void GuiGraphics::on_newGroupPB_clicked()
|
|||||||
if (newgroup.empty())
|
if (newgroup.empty())
|
||||||
return;
|
return;
|
||||||
if (groupCO->findData(toqstr(newgroup), Qt::MatchExactly) != -1) {
|
if (groupCO->findData(toqstr(newgroup), Qt::MatchExactly) != -1) {
|
||||||
Alert::warning(_("Group already defined!"),
|
Alert::warning(_("Group already defined!"),
|
||||||
bformat(_("A graphics group with the name '%1$s' already exists."),
|
bformat(_("A graphics group with the name '%1$s' already exists."),
|
||||||
newgroup));
|
newgroup));
|
||||||
return;
|
return;
|
||||||
@ -504,7 +504,7 @@ void GuiGraphics::paramsToDialog(InsetGraphicsParams const & igp)
|
|||||||
lbYunit->clear();
|
lbYunit->clear();
|
||||||
rtXunit->clear();
|
rtXunit->clear();
|
||||||
rtYunit->clear();
|
rtYunit->clear();
|
||||||
|
|
||||||
for (size_t i = 0; i < bb_size; i++) {
|
for (size_t i = 0; i < bb_size; i++) {
|
||||||
lbXunit->addItem(qt_(bb_units_gui[i]),
|
lbXunit->addItem(qt_(bb_units_gui[i]),
|
||||||
toqstr(bb_units[i]));
|
toqstr(bb_units[i]));
|
||||||
@ -515,7 +515,7 @@ void GuiGraphics::paramsToDialog(InsetGraphicsParams const & igp)
|
|||||||
rtYunit->addItem(qt_(bb_units_gui[i]),
|
rtYunit->addItem(qt_(bb_units_gui[i]),
|
||||||
toqstr(bb_units[i]));
|
toqstr(bb_units[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
// set the right default unit
|
// set the right default unit
|
||||||
Length::UNIT const defaultUnit = Length::defaultUnit();
|
Length::UNIT const defaultUnit = Length::defaultUnit();
|
||||||
|
|
||||||
@ -788,7 +788,7 @@ QString GuiGraphics::browse(QString const & in_name) const
|
|||||||
clipdir = addName(package().system_support().absFileName(), "clipart");
|
clipdir = addName(package().system_support().absFileName(), "clipart");
|
||||||
|
|
||||||
return browseRelToParent(in_name, bufferFilePath(),
|
return browseRelToParent(in_name, bufferFilePath(),
|
||||||
title, fileFilters(QString()), false,
|
title, fileFilters(QString()), false,
|
||||||
qt_("Clipart|#C#c"), toqstr(clipdir),
|
qt_("Clipart|#C#c"), toqstr(clipdir),
|
||||||
qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
|
qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
|
||||||
}
|
}
|
||||||
|
@ -295,7 +295,7 @@ docstring GuiHSpace::dialogToParams() const
|
|||||||
params.kind = keepCB->isChecked() ?
|
params.kind = keepCB->isChecked() ?
|
||||||
InsetSpaceParams::CUSTOM_PROTECTED : InsetSpaceParams::CUSTOM;
|
InsetSpaceParams::CUSTOM_PROTECTED : InsetSpaceParams::CUSTOM;
|
||||||
params.length = GlueLength(widgetsToLength(valueLE, unitCO));
|
params.length = GlueLength(widgetsToLength(valueLE, unitCO));
|
||||||
} else if (item == "visible")
|
} else if (item == "visible")
|
||||||
params.kind = InsetSpaceParams::VISIBLE;
|
params.kind = InsetSpaceParams::VISIBLE;
|
||||||
|
|
||||||
return from_ascii(InsetSpace::params2string(params));
|
return from_ascii(InsetSpace::params2string(params));
|
||||||
|
@ -42,7 +42,7 @@ QVariant GuiIdListModel::data(QModelIndex const & index, int role) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool GuiIdListModel::setData (QModelIndex const & index,
|
bool GuiIdListModel::setData (QModelIndex const & index,
|
||||||
const QVariant & value, int role)
|
const QVariant & value, int role)
|
||||||
{
|
{
|
||||||
int const row = index.row();
|
int const row = index.row();
|
||||||
@ -70,7 +70,7 @@ bool GuiIdListModel::setData (QModelIndex const & index,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool GuiIdListModel::insertRows(int row, int count,
|
bool GuiIdListModel::insertRows(int row, int count,
|
||||||
QModelIndex const & /*parent*/)
|
QModelIndex const & /*parent*/)
|
||||||
{
|
{
|
||||||
if (!rowIsValid(row))
|
if (!rowIsValid(row))
|
||||||
@ -83,7 +83,7 @@ bool GuiIdListModel::insertRows(int row, int count,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool GuiIdListModel::removeRows(int row, int count,
|
bool GuiIdListModel::removeRows(int row, int count,
|
||||||
QModelIndex const & /*parent*/)
|
QModelIndex const & /*parent*/)
|
||||||
{
|
{
|
||||||
if (!rowIsValid(row) || row + count > int(userData_.size()) ||
|
if (!rowIsValid(row) || row + count > int(userData_.size()) ||
|
||||||
@ -93,20 +93,20 @@ bool GuiIdListModel::removeRows(int row, int count,
|
|||||||
return true;
|
return true;
|
||||||
vector<OurData>::iterator it = userData_.begin() + row;
|
vector<OurData>::iterator it = userData_.begin() + row;
|
||||||
beginRemoveRows(QModelIndex(), row, row + count - 1);
|
beginRemoveRows(QModelIndex(), row, row + count - 1);
|
||||||
userData_.erase(it, it + count);
|
userData_.erase(it, it + count);
|
||||||
endRemoveRows();
|
endRemoveRows();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GuiIdListModel::insertRow(int const i, QString const & uiString,
|
void GuiIdListModel::insertRow(int const i, QString const & uiString,
|
||||||
std::string const & idString)
|
std::string const & idString)
|
||||||
{
|
{
|
||||||
insertRow(i, uiString, idString, uiString);
|
insertRow(i, uiString, idString, uiString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GuiIdListModel::insertRow(int const i, QString const & uiString,
|
void GuiIdListModel::insertRow(int const i, QString const & uiString,
|
||||||
std::string const & idString, QString const & ttString)
|
std::string const & idString, QString const & ttString)
|
||||||
{
|
{
|
||||||
insertRows(i, 1);
|
insertRows(i, 1);
|
||||||
@ -127,7 +127,7 @@ QMap<int, QVariant> GuiIdListModel::itemData(QModelIndex const & index) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int GuiIdListModel::findIDString(std::string const & idString)
|
int GuiIdListModel::findIDString(std::string const & idString)
|
||||||
{
|
{
|
||||||
vector<OurData>::const_iterator it = userData_.begin();
|
vector<OurData>::const_iterator it = userData_.begin();
|
||||||
vector<OurData>::const_iterator end = userData_.end();
|
vector<OurData>::const_iterator end = userData_.end();
|
||||||
|
@ -153,7 +153,7 @@ void GuiInclude::typeChanged(int v)
|
|||||||
listingsGB->setEnabled(false);
|
listingsGB->setEnabled(false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//see this thread
|
//see this thread
|
||||||
// http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg118471.html
|
// http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg118471.html
|
||||||
//for the reason this is here.
|
//for the reason this is here.
|
||||||
okPB->setDefault(true);
|
okPB->setDefault(true);
|
||||||
@ -214,7 +214,7 @@ void GuiInclude::paramsToDialog(InsetCommandParams const & params_)
|
|||||||
if (cap[0] == '{' && cap[cap.size() - 1] == '}') {
|
if (cap[0] == '{' && cap[cap.size() - 1] == '}') {
|
||||||
captionLE->setText(toqstr(cap.substr(1, cap.size() - 2)));
|
captionLE->setText(toqstr(cap.substr(1, cap.size() - 2)));
|
||||||
*it = "";
|
*it = "";
|
||||||
}
|
}
|
||||||
} else if (prefixIs(*it, "label=")) {
|
} else if (prefixIs(*it, "label=")) {
|
||||||
string lbl = it->substr(6);
|
string lbl = it->substr(6);
|
||||||
if (lbl[0] == '{' && lbl[lbl.size()-1] == '}') {
|
if (lbl[0] == '{' && lbl[lbl.size()-1] == '}') {
|
||||||
|
@ -211,9 +211,9 @@ void GuiIndices::on_removePB_pressed()
|
|||||||
if (selItem != 0)
|
if (selItem != 0)
|
||||||
sel_index = selItem->text(0);
|
sel_index = selItem->text(0);
|
||||||
if (!sel_index.isEmpty()) {
|
if (!sel_index.isEmpty()) {
|
||||||
if (indiceslist_.find(qstring_to_ucs4(sel_index)) ==
|
if (indiceslist_.find(qstring_to_ucs4(sel_index)) ==
|
||||||
indiceslist_.findShortcut(from_ascii("idx"))) {
|
indiceslist_.findShortcut(from_ascii("idx"))) {
|
||||||
Alert::error(_("Cannot remove standard index"),
|
Alert::error(_("Cannot remove standard index"),
|
||||||
_("The default index cannot be removed."));
|
_("The default index cannot be removed."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -240,7 +240,7 @@ void GuiIndices::on_renamePB_clicked()
|
|||||||
newIndexLE->clear();
|
newIndexLE->clear();
|
||||||
updateView();
|
updateView();
|
||||||
if (!success)
|
if (!success)
|
||||||
Alert::error(_("Renaming failed"),
|
Alert::error(_("Renaming failed"),
|
||||||
_("The index could not be renamed. "
|
_("The index could not be renamed. "
|
||||||
"Check if the new name already exists."));
|
"Check if the new name already exists."));
|
||||||
}
|
}
|
||||||
|
@ -623,7 +623,7 @@ void setKeySymbol(KeySymbol * sym, QKeyEvent const * ev)
|
|||||||
LYXERR(Debug::KEY, "Getting key " << ev->key() << ", with text '"
|
LYXERR(Debug::KEY, "Getting key " << ev->key() << ", with text '"
|
||||||
<< ev->text() << "'");
|
<< ev->text() << "'");
|
||||||
// This is unsafe because ev->text() is the unicode representation of the
|
// This is unsafe because ev->text() is the unicode representation of the
|
||||||
// key, not the name of the key. For example, Ctrl-x and Alt-x produce
|
// key, not the name of the key. For example, Ctrl-x and Alt-x produce
|
||||||
// different texts.
|
// different texts.
|
||||||
sym->setText(qstring_to_ucs4(ev->text()));
|
sym->setText(qstring_to_ucs4(ev->text()));
|
||||||
LYXERR(Debug::KEY, "Setting key to " << sym->key() << ", "
|
LYXERR(Debug::KEY, "Setting key to " << sym->key() << ", "
|
||||||
@ -714,7 +714,7 @@ docstring const KeySymbol::print(KeyModifier mod, bool forgui) const
|
|||||||
str.replace(QChar(0x2325), qt_("Option-"));
|
str.replace(QChar(0x2325), qt_("Option-"));
|
||||||
str.replace(QChar(0x2318), qt_("Command-"));
|
str.replace(QChar(0x2318), qt_("Command-"));
|
||||||
#else
|
#else
|
||||||
str = seq.toString(QKeySequence::PortableText);
|
str = seq.toString(QKeySequence::PortableText);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,9 +237,9 @@ bool GuiLog::initialiseParams(string const & data)
|
|||||||
|
|
||||||
logTypeCO->setEnabled(logtype == "latex");
|
logTypeCO->setEnabled(logtype == "latex");
|
||||||
logTypeCO->clear();
|
logTypeCO->clear();
|
||||||
|
|
||||||
FileName log(logfile);
|
FileName log(logfile);
|
||||||
|
|
||||||
if (logtype == "latex") {
|
if (logtype == "latex") {
|
||||||
type_ = LatexLog;
|
type_ = LatexLog;
|
||||||
logTypeCO->addItem(qt_("LaTeX"), toqstr(logtype));
|
logTypeCO->addItem(qt_("LaTeX"), toqstr(logtype));
|
||||||
|
@ -131,7 +131,7 @@ void GuiMathMatrix::slotOK()
|
|||||||
// a matrix without a decoration is an array,
|
// a matrix without a decoration is an array,
|
||||||
// otherwise it is an AMS matrix
|
// otherwise it is an AMS matrix
|
||||||
// decorated matrices cannot have a vertical alignment
|
// decorated matrices cannot have a vertical alignment
|
||||||
|
|
||||||
char const c = v_align_c[valignCO->currentIndex()];
|
char const c = v_align_c[valignCO->currentIndex()];
|
||||||
QString const sh = halignED->text();
|
QString const sh = halignED->text();
|
||||||
string const str = fromqstr(
|
string const str = fromqstr(
|
||||||
|
@ -134,15 +134,15 @@ QColor GuiPainter::filterColor(QColor const & col)
|
|||||||
// map into [min,max] interval
|
// map into [min,max] interval
|
||||||
QColor const & min = monochrome_min_.top();
|
QColor const & min = monochrome_min_.top();
|
||||||
QColor const & max = monochrome_max_.top();
|
QColor const & max = monochrome_max_.top();
|
||||||
|
|
||||||
qreal v = col.valueF();
|
qreal v = col.valueF();
|
||||||
v *= v; // make it a bit steeper (i.e. darker)
|
v *= v; // make it a bit steeper (i.e. darker)
|
||||||
|
|
||||||
qreal minr, ming, minb;
|
qreal minr, ming, minb;
|
||||||
qreal maxr, maxg, maxb;
|
qreal maxr, maxg, maxb;
|
||||||
min.getRgbF(&minr, &ming, &minb);
|
min.getRgbF(&minr, &ming, &minb);
|
||||||
max.getRgbF(&maxr, &maxg, &maxb);
|
max.getRgbF(&maxr, &maxg, &maxb);
|
||||||
|
|
||||||
QColor c;
|
QColor c;
|
||||||
c.setRgbF(
|
c.setRgbF(
|
||||||
v * (minr - maxr) + maxr,
|
v * (minr - maxr) + maxr,
|
||||||
|
@ -353,7 +353,7 @@ bool GuiParagraph::haveMultiParSelection() const
|
|||||||
return cur.selection() && cur.selBegin().pit() != cur.selEnd().pit();
|
return cur.selection() && cur.selBegin().pit() != cur.selEnd().pit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool GuiParagraph::canIndent() const
|
bool GuiParagraph::canIndent() const
|
||||||
{
|
{
|
||||||
Layout const lay = bufferview()->cursor().innerParagraph().layout();
|
Layout const lay = bufferview()->cursor().innerParagraph().layout();
|
||||||
|
@ -3534,7 +3534,7 @@ void GuiPreferences::dispatchParams()
|
|||||||
theConverters().update(formats_);
|
theConverters().update(formats_);
|
||||||
theConverters().buildGraph();
|
theConverters().buildGraph();
|
||||||
theBufferList().invalidateConverterCache();
|
theBufferList().invalidateConverterCache();
|
||||||
|
|
||||||
theMovers() = movers_;
|
theMovers() = movers_;
|
||||||
|
|
||||||
vector<string>::const_iterator it = colors_.begin();
|
vector<string>::const_iterator it = colors_.begin();
|
||||||
|
@ -53,7 +53,7 @@ GuiProgress::GuiProgress()
|
|||||||
connect(this, SIGNAL(appendMessage(QString const &)), SLOT(doAppendMessage(QString const &)));
|
connect(this, SIGNAL(appendMessage(QString const &)), SLOT(doAppendMessage(QString const &)));
|
||||||
connect(this, SIGNAL(appendError(QString const &)), SLOT(doAppendError(QString const &)));
|
connect(this, SIGNAL(appendError(QString const &)), SLOT(doAppendError(QString const &)));
|
||||||
connect(this, SIGNAL(clearMessages()), SLOT(doClearMessages()));
|
connect(this, SIGNAL(clearMessages()), SLOT(doClearMessages()));
|
||||||
|
|
||||||
// Alert interface
|
// Alert interface
|
||||||
connect(this, SIGNAL(warning(QString const &, QString const &)),
|
connect(this, SIGNAL(warning(QString const &, QString const &)),
|
||||||
SLOT(doWarning(QString const &, QString const &)));
|
SLOT(doWarning(QString const &, QString const &)));
|
||||||
|
@ -61,7 +61,7 @@ bool DebugSorter(DebugMap const & a, DebugMap const & b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
GuiProgressView::GuiProgressView(GuiView & parent, Qt::DockWidgetArea area,
|
GuiProgressView::GuiProgressView(GuiView & parent, Qt::DockWidgetArea area,
|
||||||
Qt::WindowFlags flags)
|
Qt::WindowFlags flags)
|
||||||
: DockView(parent, "progress", qt_("Progress/Debug Messages"), area, flags)
|
: DockView(parent, "progress", qt_("Progress/Debug Messages"), area, flags)
|
||||||
{
|
{
|
||||||
@ -114,7 +114,7 @@ GuiProgressView::GuiProgressView(GuiView & parent, Qt::DockWidgetArea area,
|
|||||||
connect(widget_->debugMessagesTW,
|
connect(widget_->debugMessagesTW,
|
||||||
SIGNAL(itemActivated(QTreeWidgetItem *, int)),
|
SIGNAL(itemActivated(QTreeWidgetItem *, int)),
|
||||||
this, SLOT(debugMessageActivated(QTreeWidgetItem *, int)));
|
this, SLOT(debugMessageActivated(QTreeWidgetItem *, int)));
|
||||||
|
|
||||||
GuiProgress * progress =
|
GuiProgress * progress =
|
||||||
dynamic_cast<GuiProgress *>(ProgressInterface::instance());
|
dynamic_cast<GuiProgress *>(ProgressInterface::instance());
|
||||||
|
|
||||||
|
@ -146,9 +146,9 @@ void GuiRef::enableView(bool enable)
|
|||||||
|
|
||||||
void GuiRef::enableBoxes()
|
void GuiRef::enableBoxes()
|
||||||
{
|
{
|
||||||
bool const isFormatted =
|
bool const isFormatted =
|
||||||
(InsetRef::getName(typeCO->currentIndex()) == "formatted");
|
(InsetRef::getName(typeCO->currentIndex()) == "formatted");
|
||||||
bool const isLabelOnly =
|
bool const isLabelOnly =
|
||||||
(InsetRef::getName(typeCO->currentIndex()) == "labelonly");
|
(InsetRef::getName(typeCO->currentIndex()) == "labelonly");
|
||||||
bool const usingRefStyle = buffer().params().use_refstyle;
|
bool const usingRefStyle = buffer().params().use_refstyle;
|
||||||
pluralCB->setEnabled(isFormatted && usingRefStyle);
|
pluralCB->setEnabled(isFormatted && usingRefStyle);
|
||||||
@ -170,7 +170,7 @@ void GuiRef::gotoClicked()
|
|||||||
// to which we are going (or from which we are returning) is
|
// to which we are going (or from which we are returning) is
|
||||||
// restored in the dialog. It's a bit of a hack, but it works,
|
// restored in the dialog. It's a bit of a hack, but it works,
|
||||||
// and no-one seems to have any better idea.
|
// and no-one seems to have any better idea.
|
||||||
bool const toggled =
|
bool const toggled =
|
||||||
last_reference_.isEmpty() || last_reference_.isNull();
|
last_reference_.isEmpty() || last_reference_.isNull();
|
||||||
if (toggled)
|
if (toggled)
|
||||||
last_reference_ = referenceED->text();
|
last_reference_ = referenceED->text();
|
||||||
@ -353,11 +353,11 @@ void GuiRef::applyView()
|
|||||||
params_.setCmdName(InsetRef::getName(typeCO->currentIndex()));
|
params_.setCmdName(InsetRef::getName(typeCO->currentIndex()));
|
||||||
params_["reference"] = qstring_to_ucs4(last_reference_);
|
params_["reference"] = qstring_to_ucs4(last_reference_);
|
||||||
params_["name"] = qstring_to_ucs4(nameED->text());
|
params_["name"] = qstring_to_ucs4(nameED->text());
|
||||||
params_["plural"] = pluralCB->isChecked() ?
|
params_["plural"] = pluralCB->isChecked() ?
|
||||||
from_ascii("true") : from_ascii("false");
|
from_ascii("true") : from_ascii("false");
|
||||||
params_["caps"] = capsCB->isChecked() ?
|
params_["caps"] = capsCB->isChecked() ?
|
||||||
from_ascii("true") : from_ascii("false");
|
from_ascii("true") : from_ascii("false");
|
||||||
params_["noprefix"] = noprefixCB->isChecked() ?
|
params_["noprefix"] = noprefixCB->isChecked() ?
|
||||||
from_ascii("true") : from_ascii("false");
|
from_ascii("true") : from_ascii("false");
|
||||||
restored_buffer_ = bufferCO->currentIndex();
|
restored_buffer_ = bufferCO->currentIndex();
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* \author Richard Heck
|
* \author Richard Heck
|
||||||
* \author Et Alia
|
* \author Et Alia
|
||||||
*
|
*
|
||||||
* Some of the material in this file previously appeared in
|
* Some of the material in this file previously appeared in
|
||||||
* GuiCitationDialog.cpp.
|
* GuiCitationDialog.cpp.
|
||||||
*
|
*
|
||||||
* Full author contact details are available in file CREDITS.
|
* Full author contact details are available in file CREDITS.
|
||||||
@ -108,12 +108,12 @@ QModelIndex GuiSelectionManager::getSelectedIndex(int const c) const
|
|||||||
bool const have_avl = !avail.isEmpty();
|
bool const have_avl = !avail.isEmpty();
|
||||||
bool const have_sel = !sel.isEmpty();
|
bool const have_sel = !sel.isEmpty();
|
||||||
|
|
||||||
if (selectedFocused()) {
|
if (selectedFocused()) {
|
||||||
if (have_sel)
|
if (have_sel)
|
||||||
return sel.front();
|
return sel.front();
|
||||||
if (have_avl)
|
if (have_avl)
|
||||||
return avail.front();
|
return avail.front();
|
||||||
}
|
}
|
||||||
else { // available has focus
|
else { // available has focus
|
||||||
if (have_avl)
|
if (have_avl)
|
||||||
return avail.front();
|
return avail.front();
|
||||||
@ -127,7 +127,7 @@ QModelIndex GuiSelectionManager::getSelectedIndex(int const c) const
|
|||||||
void GuiSelectionManager::updateAddPB()
|
void GuiSelectionManager::updateAddPB()
|
||||||
{
|
{
|
||||||
int const arows = availableModel->rowCount();
|
int const arows = availableModel->rowCount();
|
||||||
QModelIndexList const availSels =
|
QModelIndexList const availSels =
|
||||||
availableLV->selectionModel()->selectedIndexes();
|
availableLV->selectionModel()->selectedIndexes();
|
||||||
addPB->setEnabled(arows > 0 &&
|
addPB->setEnabled(arows > 0 &&
|
||||||
!availSels.isEmpty() &&
|
!availSels.isEmpty() &&
|
||||||
@ -142,7 +142,7 @@ void GuiSelectionManager::updateDelPB()
|
|||||||
deletePB->setEnabled(false);
|
deletePB->setEnabled(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QModelIndexList const selSels =
|
QModelIndexList const selSels =
|
||||||
selectedLV->selectionModel()->selectedIndexes();
|
selectedLV->selectionModel()->selectedIndexes();
|
||||||
int const sel_nr = selSels.empty() ? -1 : selSels.first().row();
|
int const sel_nr = selSels.empty() ? -1 : selSels.first().row();
|
||||||
deletePB->setEnabled(sel_nr >= 0);
|
deletePB->setEnabled(sel_nr >= 0);
|
||||||
@ -156,7 +156,7 @@ void GuiSelectionManager::updateUpPB()
|
|||||||
upPB->setEnabled(false);
|
upPB->setEnabled(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QModelIndexList const selSels =
|
QModelIndexList const selSels =
|
||||||
selectedLV->selectionModel()->selectedIndexes();
|
selectedLV->selectionModel()->selectedIndexes();
|
||||||
int const sel_nr = selSels.empty() ? -1 : selSels.first().row();
|
int const sel_nr = selSels.empty() ? -1 : selSels.first().row();
|
||||||
upPB->setEnabled(sel_nr > 0);
|
upPB->setEnabled(sel_nr > 0);
|
||||||
@ -170,7 +170,7 @@ void GuiSelectionManager::updateDownPB()
|
|||||||
downPB->setEnabled(false);
|
downPB->setEnabled(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QModelIndexList const selSels =
|
QModelIndexList const selSels =
|
||||||
selectedLV->selectionModel()->selectedIndexes();
|
selectedLV->selectionModel()->selectedIndexes();
|
||||||
int const sel_nr = selSels.empty() ? -1 : selSels.first().row();
|
int const sel_nr = selSels.empty() ? -1 : selSels.first().row();
|
||||||
downPB->setEnabled(sel_nr >= 0 && sel_nr < srows - 1);
|
downPB->setEnabled(sel_nr >= 0 && sel_nr < srows - 1);
|
||||||
@ -182,7 +182,7 @@ bool GuiSelectionManager::isSelected(const QModelIndex & idx)
|
|||||||
if (selectedModel->rowCount() == 0)
|
if (selectedModel->rowCount() == 0)
|
||||||
return false;
|
return false;
|
||||||
QVariant const & str = availableModel->data(idx, Qt::DisplayRole);
|
QVariant const & str = availableModel->data(idx, Qt::DisplayRole);
|
||||||
QModelIndexList qmil =
|
QModelIndexList qmil =
|
||||||
selectedModel->match(selectedModel->index(0, main_sel_col_),
|
selectedModel->match(selectedModel->index(0, main_sel_col_),
|
||||||
Qt::DisplayRole, str, 1,
|
Qt::DisplayRole, str, 1,
|
||||||
Qt::MatchFlags(Qt::MatchExactly | Qt::MatchWrap));
|
Qt::MatchFlags(Qt::MatchExactly | Qt::MatchWrap));
|
||||||
@ -193,7 +193,7 @@ bool GuiSelectionManager::isSelected(const QModelIndex & idx)
|
|||||||
void GuiSelectionManager::availableChanged(QItemSelection const & qis, QItemSelection const &)
|
void GuiSelectionManager::availableChanged(QItemSelection const & qis, QItemSelection const &)
|
||||||
{
|
{
|
||||||
QModelIndexList il = qis.indexes();
|
QModelIndexList il = qis.indexes();
|
||||||
if (il.empty())
|
if (il.empty())
|
||||||
return;
|
return;
|
||||||
availableChanged(il.front(), QModelIndex());
|
availableChanged(il.front(), QModelIndex());
|
||||||
}
|
}
|
||||||
@ -212,7 +212,7 @@ void GuiSelectionManager::availableChanged(const QModelIndex & idx, const QModel
|
|||||||
void GuiSelectionManager::selectedChanged(QItemSelection const & qis, QItemSelection const &)
|
void GuiSelectionManager::selectedChanged(QItemSelection const & qis, QItemSelection const &)
|
||||||
{
|
{
|
||||||
QModelIndexList il = qis.indexes();
|
QModelIndexList il = qis.indexes();
|
||||||
if (il.empty())
|
if (il.empty())
|
||||||
return;
|
return;
|
||||||
selectedChanged(il.front(), QModelIndex());
|
selectedChanged(il.front(), QModelIndex());
|
||||||
}
|
}
|
||||||
@ -234,7 +234,7 @@ void GuiSelectionManager::selectedEdited()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool GuiSelectionManager::insertRowToSelected(int i,
|
bool GuiSelectionManager::insertRowToSelected(int i,
|
||||||
QMap<int, QVariant> const & itemData)
|
QMap<int, QVariant> const & itemData)
|
||||||
{
|
{
|
||||||
if (i <= -1)
|
if (i <= -1)
|
||||||
@ -377,7 +377,7 @@ void GuiSelectionManager::availableLV_doubleClicked(const QModelIndex & idx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool GuiSelectionManager::eventFilter(QObject * obj, QEvent * event)
|
bool GuiSelectionManager::eventFilter(QObject * obj, QEvent * event)
|
||||||
{
|
{
|
||||||
QEvent::Type etype = event->type();
|
QEvent::Type etype = event->type();
|
||||||
if (obj == availableLV) {
|
if (obj == availableLV) {
|
||||||
|
@ -72,7 +72,7 @@ void GuiSendTo::changed_adaptor()
|
|||||||
|
|
||||||
void GuiSendTo::updateContents()
|
void GuiSendTo::updateContents()
|
||||||
{
|
{
|
||||||
FormatList const & all_formats =
|
FormatList const & all_formats =
|
||||||
buffer().params().exportableFormats(false);
|
buffer().params().exportableFormats(false);
|
||||||
// Save the current selection if any
|
// Save the current selection if any
|
||||||
Format const * current_format = nullptr;
|
Format const * current_format = nullptr;
|
||||||
@ -102,7 +102,7 @@ void GuiSendTo::applyView()
|
|||||||
if (line < 0 || line > formatLW->count())
|
if (line < 0 || line > formatLW->count())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
FormatList const & all_formats =
|
FormatList const & all_formats =
|
||||||
buffer().params().exportableFormats(false);
|
buffer().params().exportableFormats(false);
|
||||||
format_ = all_formats[line];
|
format_ = all_formats[line];
|
||||||
command_ = command;
|
command_ = command;
|
||||||
|
@ -113,7 +113,7 @@ struct SpellcheckerWidget::Private
|
|||||||
SpellcheckerWidget * p;
|
SpellcheckerWidget * p;
|
||||||
///
|
///
|
||||||
DockView * dv_;
|
DockView * dv_;
|
||||||
///
|
///
|
||||||
GuiView * gv_;
|
GuiView * gv_;
|
||||||
/// current word being checked and lang code
|
/// current word being checked and lang code
|
||||||
WordLangTuple word_;
|
WordLangTuple word_;
|
||||||
@ -321,7 +321,7 @@ void SpellcheckerWidget::Private::hide() const
|
|||||||
// restore cursor position
|
// restore cursor position
|
||||||
bvcur.setCursor(start_);
|
bvcur.setCursor(start_);
|
||||||
bvcur.clearSelection();
|
bvcur.clearSelection();
|
||||||
bv->processUpdateFlags(Update::Force | Update::FitCursor);
|
bv->processUpdateFlags(Update::Force | Update::FitCursor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -333,7 +333,7 @@ void SpellcheckerWidget::Private::setSelection(
|
|||||||
DocIterator end = to;
|
DocIterator end = to;
|
||||||
|
|
||||||
if (from.pit() != end.pit()) {
|
if (from.pit() != end.pit()) {
|
||||||
// there are multiple paragraphs in selection
|
// there are multiple paragraphs in selection
|
||||||
Cursor & bvcur = bv->cursor();
|
Cursor & bvcur = bv->cursor();
|
||||||
bvcur.setCursor(from);
|
bvcur.setCursor(from);
|
||||||
bvcur.clearSelection();
|
bvcur.clearSelection();
|
||||||
@ -388,7 +388,7 @@ bool SpellcheckerWidget::initialiseParams(std::string const &)
|
|||||||
BufferView * bv = d->gv_->documentBufferView();
|
BufferView * bv = d->gv_->documentBufferView();
|
||||||
if (bv == 0)
|
if (bv == 0)
|
||||||
return false;
|
return false;
|
||||||
std::set<Language const *> languages =
|
std::set<Language const *> languages =
|
||||||
bv->buffer().masterBuffer()->getLanguages();
|
bv->buffer().masterBuffer()->getLanguages();
|
||||||
if (!languages.empty())
|
if (!languages.empty())
|
||||||
d->setLanguage(*languages.begin());
|
d->setLanguage(*languages.begin());
|
||||||
@ -457,7 +457,7 @@ void SpellcheckerWidget::on_replacePB_clicked()
|
|||||||
return;
|
return;
|
||||||
docstring const textfield = qstring_to_ucs4(d->ui.wordED->text());
|
docstring const textfield = qstring_to_ucs4(d->ui.wordED->text());
|
||||||
docstring const replacement = qstring_to_ucs4(d->ui.replaceCO->currentText());
|
docstring const replacement = qstring_to_ucs4(d->ui.replaceCO->currentText());
|
||||||
docstring const datastring =
|
docstring const datastring =
|
||||||
replace2string(replacement, textfield,
|
replace2string(replacement, textfield,
|
||||||
true, // case sensitive
|
true, // case sensitive
|
||||||
true, // match word
|
true, // match word
|
||||||
@ -531,7 +531,7 @@ void SpellcheckerWidget::Private::check()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
fixPositionsIfBroken();
|
fixPositionsIfBroken();
|
||||||
|
|
||||||
SpellChecker * speller = theSpellChecker();
|
SpellChecker * speller = theSpellChecker();
|
||||||
if (speller && !speller->hasDictionary(bv->buffer().language())) {
|
if (speller && !speller->hasDictionary(bv->buffer().language())) {
|
||||||
int dsize = speller->numDictionaries();
|
int dsize = speller->numDictionaries();
|
||||||
@ -613,8 +613,8 @@ void GuiSpellchecker::updateView()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Dialog * createGuiSpellchecker(GuiView & lv)
|
Dialog * createGuiSpellchecker(GuiView & lv)
|
||||||
{
|
{
|
||||||
GuiSpellchecker * gui = new GuiSpellchecker(lv, Qt::RightDockWidgetArea);
|
GuiSpellchecker * gui = new GuiSpellchecker(lv, Qt::RightDockWidgetArea);
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
gui->setFloating(true);
|
gui->setFloating(true);
|
||||||
|
@ -219,7 +219,7 @@ void GuiTabular::enableWidgets() const
|
|||||||
else if (!multicolumnCB->isChecked() && !multirowCB->isChecked()
|
else if (!multicolumnCB->isChecked() && !multirowCB->isChecked()
|
||||||
&& hAlignCO->findData(toqstr("decimal")) == -1)
|
&& hAlignCO->findData(toqstr("decimal")) == -1)
|
||||||
hAlignCO->addItem(qt_("At Decimal Separator"), toqstr("decimal"));
|
hAlignCO->addItem(qt_("At Decimal Separator"), toqstr("decimal"));
|
||||||
bool const dalign =
|
bool const dalign =
|
||||||
hAlignCO->itemData(hAlignCO->currentIndex()).toString() == QString("decimal");
|
hAlignCO->itemData(hAlignCO->currentIndex()).toString() == QString("decimal");
|
||||||
decimalPointED->setEnabled(dalign);
|
decimalPointED->setEnabled(dalign);
|
||||||
decimalLA->setEnabled(dalign);
|
decimalLA->setEnabled(dalign);
|
||||||
|
@ -101,7 +101,7 @@ void GuiThesaurus::checkStatus()
|
|||||||
}
|
}
|
||||||
updateView();
|
updateView();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiThesaurus::change_adaptor()
|
void GuiThesaurus::change_adaptor()
|
||||||
{
|
{
|
||||||
changed();
|
changed();
|
||||||
|
@ -71,7 +71,7 @@ GuiToolbar::GuiToolbar(ToolbarInfo const & tbinfo, GuiView & owner)
|
|||||||
void GuiToolbar::setVisible(bool visible)
|
void GuiToolbar::setVisible(bool visible)
|
||||||
{
|
{
|
||||||
// This is a hack to find out which toolbars have been restored by
|
// This is a hack to find out which toolbars have been restored by
|
||||||
// MainWindow::restoreState and which toolbars should be initialized
|
// MainWindow::restoreState and which toolbars should be initialized
|
||||||
// by us (i.e., new toolbars)
|
// by us (i.e., new toolbars)
|
||||||
restored_ = true;
|
restored_ = true;
|
||||||
QToolBar::setVisible(visible);
|
QToolBar::setVisible(visible);
|
||||||
@ -91,7 +91,7 @@ void GuiToolbar::fill()
|
|||||||
ToolbarInfo::item_iterator it = tbinfo_.items.begin();
|
ToolbarInfo::item_iterator it = tbinfo_.items.begin();
|
||||||
ToolbarInfo::item_iterator end = tbinfo_.items.end();
|
ToolbarInfo::item_iterator end = tbinfo_.items.end();
|
||||||
for (; it != end; ++it)
|
for (; it != end; ++it)
|
||||||
add(*it);
|
add(*it);
|
||||||
filled_ = true;
|
filled_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -368,7 +368,7 @@ void GuiToolbar::restoreSession()
|
|||||||
if (visibility == error_val || visibility == 0) {
|
if (visibility == error_val || visibility == 0) {
|
||||||
// This should not happen, but in case we use the defaults
|
// This should not happen, but in case we use the defaults
|
||||||
LYXERR(Debug::GUI, "Session settings could not be found! Defaults are used instead.");
|
LYXERR(Debug::GUI, "Session settings could not be found! Defaults are used instead.");
|
||||||
visibility =
|
visibility =
|
||||||
guiApp->toolbars().defaultVisibility(fromqstr(objectName()));
|
guiApp->toolbars().defaultVisibility(fromqstr(objectName()));
|
||||||
}
|
}
|
||||||
setVisibility(visibility);
|
setVisibility(visibility);
|
||||||
|
@ -571,9 +571,9 @@ GuiView::GuiView(int id)
|
|||||||
busyanim->start();
|
busyanim->start();
|
||||||
busylabel->hide();
|
busylabel->hide();
|
||||||
|
|
||||||
connect(&d.processing_thread_watcher_, SIGNAL(started()),
|
connect(&d.processing_thread_watcher_, SIGNAL(started()),
|
||||||
busylabel, SLOT(show()));
|
busylabel, SLOT(show()));
|
||||||
connect(&d.processing_thread_watcher_, SIGNAL(finished()),
|
connect(&d.processing_thread_watcher_, SIGNAL(finished()),
|
||||||
busylabel, SLOT(hide()));
|
busylabel, SLOT(hide()));
|
||||||
|
|
||||||
QFontMetrics const fm(statusBar()->fontMetrics());
|
QFontMetrics const fm(statusBar()->fontMetrics());
|
||||||
@ -691,7 +691,7 @@ void GuiView::processingThreadFinished()
|
|||||||
|
|
||||||
Buffer::ExportStatus const status = watcher->result();
|
Buffer::ExportStatus const status = watcher->result();
|
||||||
handleExportStatus(this, status, d.processing_format);
|
handleExportStatus(this, status, d.processing_format);
|
||||||
|
|
||||||
updateToolbars();
|
updateToolbars();
|
||||||
BufferView const * const bv = currentBufferView();
|
BufferView const * const bv = currentBufferView();
|
||||||
if (bv && !bv->buffer().errorList("Export").empty()) {
|
if (bv && !bv->buffer().errorList("Export").empty()) {
|
||||||
@ -784,7 +784,7 @@ bool GuiView::restoreLayout()
|
|||||||
|
|
||||||
if (!restoreState(settings.value("layout").toByteArray(), 0))
|
if (!restoreState(settings.value("layout").toByteArray(), 0))
|
||||||
initToolbars();
|
initToolbars();
|
||||||
|
|
||||||
// init the toolbars that have not been restored
|
// init the toolbars that have not been restored
|
||||||
Toolbars::Infos::iterator cit = guiApp->toolbars().begin();
|
Toolbars::Infos::iterator cit = guiApp->toolbars().begin();
|
||||||
Toolbars::Infos::iterator end = guiApp->toolbars().end();
|
Toolbars::Infos::iterator end = guiApp->toolbars().end();
|
||||||
@ -990,7 +990,7 @@ void GuiView::closeEvent(QCloseEvent * close_event)
|
|||||||
LYXERR(Debug::DEBUG, "GuiView::closeEvent()");
|
LYXERR(Debug::DEBUG, "GuiView::closeEvent()");
|
||||||
|
|
||||||
if (!GuiViewPrivate::busyBuffers.isEmpty()) {
|
if (!GuiViewPrivate::busyBuffers.isEmpty()) {
|
||||||
Alert::warning(_("Exit LyX"),
|
Alert::warning(_("Exit LyX"),
|
||||||
_("LyX could not be closed because documents are being processed by LyX."));
|
_("LyX could not be closed because documents are being processed by LyX."));
|
||||||
close_event->setAccepted(false);
|
close_event->setAccepted(false);
|
||||||
return;
|
return;
|
||||||
@ -1353,7 +1353,7 @@ void GuiView::setBusy(bool busy)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
updateLayoutList();
|
updateLayoutList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1467,7 +1467,7 @@ void GuiView::setCurrentWorkArea(GuiWorkArea * wa)
|
|||||||
|
|
||||||
theGuiApp()->setCurrentView(this);
|
theGuiApp()->setCurrentView(this);
|
||||||
d.current_work_area_ = wa;
|
d.current_work_area_ = wa;
|
||||||
|
|
||||||
// We need to reset this now, because it will need to be
|
// We need to reset this now, because it will need to be
|
||||||
// right if the tabWorkArea gets reset in the for loop. We
|
// right if the tabWorkArea gets reset in the for loop. We
|
||||||
// will change it back if we aren't in that case.
|
// will change it back if we aren't in that case.
|
||||||
@ -1476,14 +1476,14 @@ void GuiView::setCurrentWorkArea(GuiWorkArea * wa)
|
|||||||
|
|
||||||
for (int i = 0; i != d.splitter_->count(); ++i) {
|
for (int i = 0; i != d.splitter_->count(); ++i) {
|
||||||
if (d.tabWorkArea(i)->setCurrentWorkArea(wa)) {
|
if (d.tabWorkArea(i)->setCurrentWorkArea(wa)) {
|
||||||
LYXERR(Debug::DEBUG, "Current wa: " << currentWorkArea()
|
LYXERR(Debug::DEBUG, "Current wa: " << currentWorkArea()
|
||||||
<< ", Current main wa: " << currentMainWorkArea());
|
<< ", Current main wa: " << currentMainWorkArea());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
d.current_main_work_area_ = old_cmwa;
|
d.current_main_work_area_ = old_cmwa;
|
||||||
|
|
||||||
LYXERR(Debug::DEBUG, "This is not a tabbed wa");
|
LYXERR(Debug::DEBUG, "This is not a tabbed wa");
|
||||||
on_currentWorkAreaChanged(wa);
|
on_currentWorkAreaChanged(wa);
|
||||||
BufferView & bv = wa->bufferView();
|
BufferView & bv = wa->bufferView();
|
||||||
@ -1591,7 +1591,7 @@ void GuiView::setBuffer(Buffer * newBuffer, bool switch_to)
|
|||||||
{
|
{
|
||||||
LYXERR(Debug::DEBUG, "Setting buffer: " << newBuffer << endl);
|
LYXERR(Debug::DEBUG, "Setting buffer: " << newBuffer << endl);
|
||||||
LASSERT(newBuffer, return);
|
LASSERT(newBuffer, return);
|
||||||
|
|
||||||
GuiWorkArea * wa = workArea(*newBuffer);
|
GuiWorkArea * wa = workArea(*newBuffer);
|
||||||
if (wa == 0) {
|
if (wa == 0) {
|
||||||
setBusy(true);
|
setBusy(true);
|
||||||
@ -2880,7 +2880,7 @@ bool GuiView::closeWorkArea(GuiWorkArea * wa, bool close_buffer)
|
|||||||
Buffer & buf = wa->bufferView().buffer();
|
Buffer & buf = wa->bufferView().buffer();
|
||||||
|
|
||||||
if (GuiViewPrivate::busyBuffers.contains(&buf)) {
|
if (GuiViewPrivate::busyBuffers.contains(&buf)) {
|
||||||
Alert::warning(_("Close document"),
|
Alert::warning(_("Close document"),
|
||||||
_("Document could not be closed because it is being processed by LyX."));
|
_("Document could not be closed because it is being processed by LyX."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -3075,7 +3075,7 @@ void GuiView::gotoNextOrPreviousBuffer(NextOrPrevious np, bool const move)
|
|||||||
{
|
{
|
||||||
if (!documentBufferView())
|
if (!documentBufferView())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (TabWorkArea * twa = d.currentTabWorkArea()) {
|
if (TabWorkArea * twa = d.currentTabWorkArea()) {
|
||||||
Buffer * const curbuf = &documentBufferView()->buffer();
|
Buffer * const curbuf = &documentBufferView()->buffer();
|
||||||
int nwa = twa->count();
|
int nwa = twa->count();
|
||||||
@ -3524,12 +3524,12 @@ bool GuiView::GuiViewPrivate::asyncBufferProcessing(
|
|||||||
if (syncFunc) {
|
if (syncFunc) {
|
||||||
status = (used_buffer->*syncFunc)(format, true);
|
status = (used_buffer->*syncFunc)(format, true);
|
||||||
} else if (previewFunc) {
|
} else if (previewFunc) {
|
||||||
status = (used_buffer->*previewFunc)(format);
|
status = (used_buffer->*previewFunc)(format);
|
||||||
} else
|
} else
|
||||||
return false;
|
return false;
|
||||||
handleExportStatus(gv_, status, format);
|
handleExportStatus(gv_, status, format);
|
||||||
(void) asyncFunc;
|
(void) asyncFunc;
|
||||||
return (status == Buffer::ExportSuccess
|
return (status == Buffer::ExportSuccess
|
||||||
|| status == Buffer::PreviewSuccess);
|
|| status == Buffer::PreviewSuccess);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -3766,14 +3766,14 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
|
|||||||
dr.setMessage(_("Absolute filename expected."));
|
dr.setMessage(_("Absolute filename expected."));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileName filename(fname);
|
FileName filename(fname);
|
||||||
if (fname.empty()) {
|
if (fname.empty()) {
|
||||||
FileDialog dlg(qt_("Select file to insert"));
|
FileDialog dlg(qt_("Select file to insert"));
|
||||||
|
|
||||||
FileDialog::Result result = dlg.open(toqstr(bv->buffer().filePath()),
|
FileDialog::Result result = dlg.open(toqstr(bv->buffer().filePath()),
|
||||||
QStringList(qt_("All Files (*)")));
|
QStringList(qt_("All Files (*)")));
|
||||||
|
|
||||||
if (result.first == FileDialog::Later || result.second.isEmpty()) {
|
if (result.first == FileDialog::Later || result.second.isEmpty()) {
|
||||||
dr.setMessage(_("Canceled."));
|
dr.setMessage(_("Canceled."));
|
||||||
break;
|
break;
|
||||||
@ -4136,7 +4136,7 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
|
|||||||
doc_buffer->absFileName(),
|
doc_buffer->absFileName(),
|
||||||
"tex")).mangledFileName()
|
"tex")).mangledFileName()
|
||||||
: doc_buffer->latexName();
|
: doc_buffer->latexName();
|
||||||
string const fulltexname =
|
string const fulltexname =
|
||||||
support::makeAbsPath(texname, doc_master->temppath()).absFileName();
|
support::makeAbsPath(texname, doc_master->temppath()).absFileName();
|
||||||
string const mastername =
|
string const mastername =
|
||||||
removeExtension(doc_master->latexName());
|
removeExtension(doc_master->latexName());
|
||||||
|
@ -212,7 +212,7 @@ public:
|
|||||||
int cursorWidth() const { return cursor_width_; }
|
int cursorWidth() const { return cursor_width_; }
|
||||||
void recomputeWidth() {
|
void recomputeWidth() {
|
||||||
cursor_width_ = lyxrc.cursor_width
|
cursor_width_ = lyxrc.cursor_width
|
||||||
? lyxrc.cursor_width
|
? lyxrc.cursor_width
|
||||||
: 1 + int((lyxrc.currentZoom + 50) / 200.0);
|
: 1 + int((lyxrc.currentZoom + 50) / 200.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,7 +233,7 @@ private:
|
|||||||
QRect rect_;
|
QRect rect_;
|
||||||
/// x position (were the vertical line is drawn)
|
/// x position (were the vertical line is drawn)
|
||||||
int x_;
|
int x_;
|
||||||
|
|
||||||
int cursor_width_;
|
int cursor_width_;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -257,7 +257,7 @@ GuiWorkArea::Private::Private(GuiWorkArea * parent)
|
|||||||
|
|
||||||
|
|
||||||
GuiWorkArea::GuiWorkArea(QWidget * /* w */)
|
GuiWorkArea::GuiWorkArea(QWidget * /* w */)
|
||||||
: d(new Private(this))
|
: d(new Private(this))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -370,7 +370,7 @@ void GuiWorkArea::Private::setCursorShape(Qt::CursorShape shape)
|
|||||||
|
|
||||||
void GuiWorkArea::Private::updateCursorShape()
|
void GuiWorkArea::Private::updateCursorShape()
|
||||||
{
|
{
|
||||||
setCursorShape(buffer_view_->clickableInset()
|
setCursorShape(buffer_view_->clickableInset()
|
||||||
? Qt::PointingHandCursor : Qt::IBeamCursor);
|
? Qt::PointingHandCursor : Qt::IBeamCursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -775,7 +775,7 @@ void GuiWorkArea::contextMenuEvent(QContextMenuEvent * e)
|
|||||||
}
|
}
|
||||||
name = d->buffer_view_->contextMenu(pos.x(), pos.y());
|
name = d->buffer_view_->contextMenu(pos.x(), pos.y());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name.empty()) {
|
if (name.empty()) {
|
||||||
QAbstractScrollArea::contextMenuEvent(e);
|
QAbstractScrollArea::contextMenuEvent(e);
|
||||||
return;
|
return;
|
||||||
@ -891,7 +891,7 @@ void GuiWorkArea::mouseMoveEvent(QMouseEvent * e)
|
|||||||
// in the first place.
|
// in the first place.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
d->synthetic_mouse_event_.restart_timeout = true;
|
d->synthetic_mouse_event_.restart_timeout = true;
|
||||||
d->synthetic_mouse_event_.timeout.start();
|
d->synthetic_mouse_event_.timeout.start();
|
||||||
// Fall through to handle this event...
|
// Fall through to handle this event...
|
||||||
@ -976,7 +976,7 @@ void GuiWorkArea::generateSyntheticMouseEvent()
|
|||||||
if (up || down) {
|
if (up || down) {
|
||||||
int dist = up ? -e_y : e_y - wh;
|
int dist = up ? -e_y : e_y - wh;
|
||||||
time = max(min(200, 250000 / (dist * dist)), 1) ;
|
time = max(min(200, 250000 / (dist * dist)), 1) ;
|
||||||
|
|
||||||
if (time < 40) {
|
if (time < 40) {
|
||||||
step = 80000 / (time * time);
|
step = 80000 / (time * time);
|
||||||
time = 40;
|
time = 40;
|
||||||
@ -1626,7 +1626,7 @@ void TabWorkArea::paintEvent(QPaintEvent * event)
|
|||||||
if (tabBar()->isVisible()) {
|
if (tabBar()->isVisible()) {
|
||||||
QTabWidget::paintEvent(event);
|
QTabWidget::paintEvent(event);
|
||||||
} else {
|
} else {
|
||||||
// Prevent the selected tab to influence the
|
// Prevent the selected tab to influence the
|
||||||
// painting of the frame of the tab widget.
|
// painting of the frame of the tab widget.
|
||||||
// This is needed for gtk style in Qt.
|
// This is needed for gtk style in Qt.
|
||||||
QStylePainter p(this);
|
QStylePainter p(this);
|
||||||
|
@ -100,7 +100,7 @@ void GuiWrap::applyView()
|
|||||||
Length::UNIT overhangUnit = overhangUnitLC->currentLengthItem();
|
Length::UNIT overhangUnit = overhangUnitLC->currentLengthItem();
|
||||||
if (overhangED->text().isEmpty())
|
if (overhangED->text().isEmpty())
|
||||||
overhangUnit = Length::UNIT_NONE;
|
overhangUnit = Length::UNIT_NONE;
|
||||||
|
|
||||||
params_.width = Length(width_value, widthUnit);
|
params_.width = Length(width_value, widthUnit);
|
||||||
|
|
||||||
if (overhangCB->checkState() == Qt::Checked)
|
if (overhangCB->checkState() == Qt::Checked)
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
namespace lyx {
|
namespace lyx {
|
||||||
namespace frontend {
|
namespace frontend {
|
||||||
|
|
||||||
TearOff::TearOff(QWidget * parent)
|
TearOff::TearOff(QWidget * parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
highlighted_ = false;
|
highlighted_ = false;
|
||||||
@ -189,7 +189,7 @@ void IconPalette::showEvent(QShowEvent * /*event*/)
|
|||||||
|
|
||||||
QRect r = rect();
|
QRect r = rect();
|
||||||
r.moveTo(gpos.x() + hoffset, gpos.y() + voffset);
|
r.moveTo(gpos.x() + hoffset, gpos.y() + voffset);
|
||||||
setGeometry(r);
|
setGeometry(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ void IntoGuiThreadMover::callInGuiThread()
|
|||||||
synchronousFunctionCall();
|
synchronousFunctionCall();
|
||||||
} else {
|
} else {
|
||||||
moveToThread(QApplication::instance()->thread());
|
moveToThread(QApplication::instance()->thread());
|
||||||
connect(this, SIGNAL(triggerFunctionCall()),
|
connect(this, SIGNAL(triggerFunctionCall()),
|
||||||
this, SLOT(doFunctionCall()), Qt::QueuedConnection);
|
this, SLOT(doFunctionCall()), Qt::QueuedConnection);
|
||||||
QMutexLocker lock(&sync_mutex_);
|
QMutexLocker lock(&sync_mutex_);
|
||||||
Q_EMIT triggerFunctionCall();
|
Q_EMIT triggerFunctionCall();
|
||||||
|
@ -105,14 +105,14 @@ void LaTeXHighlighter::highlightBlock(QString const & text)
|
|||||||
// %comment
|
// %comment
|
||||||
// Treat a line as a comment starting at a percent sign
|
// Treat a line as a comment starting at a percent sign
|
||||||
// * that is the first character in a line
|
// * that is the first character in a line
|
||||||
// * that is preceded by
|
// * that is preceded by
|
||||||
// ** an even number of backslashes
|
// ** an even number of backslashes
|
||||||
// ** any character other than a backslash
|
// ** any character other than a backslash
|
||||||
QRegExp exprComment("(?:^|[^\\\\])(?:\\\\\\\\)*(%).*$");
|
QRegExp exprComment("(?:^|[^\\\\])(?:\\\\\\\\)*(%).*$");
|
||||||
exprComment.indexIn(text);
|
exprComment.indexIn(text);
|
||||||
index = exprComment.pos(1);
|
index = exprComment.pos(1);
|
||||||
while (index >= 0) {
|
while (index >= 0) {
|
||||||
int const length = exprComment.matchedLength()
|
int const length = exprComment.matchedLength()
|
||||||
- (index - exprComment.pos(0));
|
- (index - exprComment.pos(0));
|
||||||
setFormat(index, length, commentFormat);
|
setFormat(index, length, commentFormat);
|
||||||
exprComment.indexIn(text, index + length);
|
exprComment.indexIn(text, index + length);
|
||||||
|
@ -53,7 +53,7 @@ using namespace lyx::support;
|
|||||||
namespace lyx {
|
namespace lyx {
|
||||||
namespace frontend {
|
namespace frontend {
|
||||||
|
|
||||||
|
|
||||||
class LayoutItemDelegate : public QItemDelegate {
|
class LayoutItemDelegate : public QItemDelegate {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
@ -69,11 +69,11 @@ public:
|
|||||||
///
|
///
|
||||||
QSize sizeHint(QStyleOptionViewItem const & opt,
|
QSize sizeHint(QStyleOptionViewItem const & opt,
|
||||||
QModelIndex const & index) const;
|
QModelIndex const & index) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
///
|
///
|
||||||
void drawCategoryHeader(QPainter * painter, QStyleOptionViewItem const & opt,
|
void drawCategoryHeader(QPainter * painter, QStyleOptionViewItem const & opt,
|
||||||
QString const & category) const;
|
QString const & category) const;
|
||||||
///
|
///
|
||||||
QString underlineFilter(QString const & s) const;
|
QString underlineFilter(QString const & s) const;
|
||||||
///
|
///
|
||||||
@ -87,7 +87,7 @@ public:
|
|||||||
GuiLayoutFilterModel(QObject * parent = 0)
|
GuiLayoutFilterModel(QObject * parent = 0)
|
||||||
: QSortFilterProxyModel(parent)
|
: QSortFilterProxyModel(parent)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
///
|
///
|
||||||
void triggerLayoutChange()
|
void triggerLayoutChange()
|
||||||
{
|
{
|
||||||
@ -136,7 +136,7 @@ public:
|
|||||||
DocumentClassConstPtr text_class_;
|
DocumentClassConstPtr text_class_;
|
||||||
///
|
///
|
||||||
Inset const * inset_;
|
Inset const * inset_;
|
||||||
|
|
||||||
/// the layout model: 1st column translated, 2nd column raw layout name
|
/// the layout model: 1st column translated, 2nd column raw layout name
|
||||||
QStandardItemModel * model_;
|
QStandardItemModel * model_;
|
||||||
/// the proxy model filtering \c model_
|
/// the proxy model filtering \c model_
|
||||||
@ -194,7 +194,7 @@ void LayoutItemDelegate::paint(QPainter * painter, QStyleOptionViewItem const &
|
|||||||
opt.state = state;
|
opt.state = state;
|
||||||
|
|
||||||
// draw category header
|
// draw category header
|
||||||
drawCategoryHeader(painter, opt,
|
drawCategoryHeader(painter, opt,
|
||||||
category(*index.model(), index.row()));
|
category(*index.model(), index.row()));
|
||||||
|
|
||||||
// move rect down below header
|
// move rect down below header
|
||||||
@ -240,7 +240,7 @@ QSize LayoutItemDelegate::sizeHint(QStyleOptionViewItem const & opt,
|
|||||||
QModelIndex const & index) const
|
QModelIndex const & index) const
|
||||||
{
|
{
|
||||||
QSortFilterProxyModel const * model =
|
QSortFilterProxyModel const * model =
|
||||||
static_cast<QSortFilterProxyModel const *>(index.model());
|
static_cast<QSortFilterProxyModel const *>(index.model());
|
||||||
QSize size = QItemDelegate::sizeHint(opt, index);
|
QSize size = QItemDelegate::sizeHint(opt, index);
|
||||||
|
|
||||||
/// QComboBox uses the first row height to estimate the
|
/// QComboBox uses the first row height to estimate the
|
||||||
@ -258,7 +258,7 @@ QSize LayoutItemDelegate::sizeHint(QStyleOptionViewItem const & opt,
|
|||||||
unsigned n = layout_->model()->rowCount();
|
unsigned n = layout_->model()->rowCount();
|
||||||
|
|
||||||
// so the needed average height (rounded upwards) is:
|
// so the needed average height (rounded upwards) is:
|
||||||
size.setHeight((headerHeight(opt) * cats + itemHeight * n + n - 1) / n);
|
size.setHeight((headerHeight(opt) * cats + itemHeight * n + n - 1) / n);
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -370,14 +370,14 @@ void LayoutBox::Private::setFilter(QString const & s)
|
|||||||
filter_ = s;
|
filter_ = s;
|
||||||
filterModel_->setFilterRegExp(charFilterRegExp(filter_));
|
filterModel_->setFilterRegExp(charFilterRegExp(filter_));
|
||||||
countCategories();
|
countCategories();
|
||||||
|
|
||||||
// restore old selection
|
// restore old selection
|
||||||
if (lastSel_ != -1) {
|
if (lastSel_ != -1) {
|
||||||
QModelIndex i = filterModel_->mapFromSource(model_->index(lastSel_, 0));
|
QModelIndex i = filterModel_->mapFromSource(model_->index(lastSel_, 0));
|
||||||
if (i.isValid())
|
if (i.isValid())
|
||||||
p->setCurrentIndex(i.row());
|
p->setCurrentIndex(i.row());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Workaround to resize to content size
|
// Workaround to resize to content size
|
||||||
// FIXME: There must be a better way. The QComboBox::AdjustToContents)
|
// FIXME: There must be a better way. The QComboBox::AdjustToContents)
|
||||||
// does not help.
|
// does not help.
|
||||||
@ -394,7 +394,7 @@ void LayoutBox::Private::setFilter(QString const & s)
|
|||||||
|
|
||||||
// The item delegate hack is off again. So trigger a relayout of the popup.
|
// The item delegate hack is off again. So trigger a relayout of the popup.
|
||||||
filterModel_->triggerLayoutChange();
|
filterModel_->triggerLayoutChange();
|
||||||
|
|
||||||
if (!s.isEmpty())
|
if (!s.isEmpty())
|
||||||
owner_.message(bformat(_("Filtering layouts with \"%1$s\". "
|
owner_.message(bformat(_("Filtering layouts with \"%1$s\". "
|
||||||
"Press ESC to remove filter."),
|
"Press ESC to remove filter."),
|
||||||
@ -402,7 +402,7 @@ void LayoutBox::Private::setFilter(QString const & s)
|
|||||||
else
|
else
|
||||||
owner_.message(_("Enter characters to filter the layout list."));
|
owner_.message(_("Enter characters to filter the layout list."));
|
||||||
}
|
}
|
||||||
|
|
||||||
p->view()->setUpdatesEnabled(enabled);
|
p->view()->setUpdatesEnabled(enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -420,7 +420,7 @@ LayoutBox::LayoutBox(GuiView & owner)
|
|||||||
// for the filtering we have to intercept characters
|
// for the filtering we have to intercept characters
|
||||||
view()->installEventFilter(this);
|
view()->installEventFilter(this);
|
||||||
view()->setItemDelegateForColumn(0, d->layoutItemDelegate_);
|
view()->setItemDelegateForColumn(0, d->layoutItemDelegate_);
|
||||||
|
|
||||||
QObject::connect(this, SIGNAL(activated(int)),
|
QObject::connect(this, SIGNAL(activated(int)),
|
||||||
this, SLOT(selected(int)));
|
this, SLOT(selected(int)));
|
||||||
|
|
||||||
@ -441,7 +441,7 @@ void LayoutBox::Private::countCategories()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// skip the "Standard" category
|
// skip the "Standard" category
|
||||||
QString prevCat = model_->index(0, 2).data().toString();
|
QString prevCat = model_->index(0, 2).data().toString();
|
||||||
|
|
||||||
// count categories
|
// count categories
|
||||||
for (int i = 0; i < n; ++i) {
|
for (int i = 0; i < n; ++i) {
|
||||||
@ -468,10 +468,10 @@ void LayoutBox::showPopup()
|
|||||||
d->inShowPopup_ = true;
|
d->inShowPopup_ = true;
|
||||||
QComboBox::showPopup();
|
QComboBox::showPopup();
|
||||||
d->inShowPopup_ = false;
|
d->inShowPopup_ = false;
|
||||||
|
|
||||||
// The item delegate hack is off again. So trigger a relayout of the popup.
|
// The item delegate hack is off again. So trigger a relayout of the popup.
|
||||||
d->filterModel_->triggerLayoutChange();
|
d->filterModel_->triggerLayoutChange();
|
||||||
|
|
||||||
view()->setUpdatesEnabled(enabled);
|
view()->setUpdatesEnabled(enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -485,7 +485,7 @@ bool LayoutBox::eventFilter(QObject * o, QEvent * e)
|
|||||||
bool modified = (ke->modifiers() == Qt::ControlModifier)
|
bool modified = (ke->modifiers() == Qt::ControlModifier)
|
||||||
|| (ke->modifiers() == Qt::AltModifier)
|
|| (ke->modifiers() == Qt::AltModifier)
|
||||||
|| (ke->modifiers() == Qt::MetaModifier);
|
|| (ke->modifiers() == Qt::MetaModifier);
|
||||||
|
|
||||||
switch (ke->key()) {
|
switch (ke->key()) {
|
||||||
case Qt::Key_Escape:
|
case Qt::Key_Escape:
|
||||||
if (!modified && !d->filter_.isEmpty()) {
|
if (!modified && !d->filter_.isEmpty()) {
|
||||||
@ -524,7 +524,7 @@ bool LayoutBox::eventFilter(QObject * o, QEvent * e)
|
|||||||
return QComboBox::eventFilter(o, e);
|
return QComboBox::eventFilter(o, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LayoutBox::setIconSize(QSize size)
|
void LayoutBox::setIconSize(QSize size)
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
@ -605,7 +605,7 @@ void LayoutBox::addItemSort(docstring const & item, docstring const & category,
|
|||||||
// skip the Standard layout
|
// skip the Standard layout
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
++i;
|
++i;
|
||||||
|
|
||||||
// the simple unsorted case
|
// the simple unsorted case
|
||||||
if (!sorted) {
|
if (!sorted) {
|
||||||
if (sortedByCat) {
|
if (sortedByCat) {
|
||||||
@ -622,7 +622,7 @@ void LayoutBox::addItemSort(docstring const & item, docstring const & category,
|
|||||||
if (i < end) {
|
if (i < end) {
|
||||||
// find alphabetic position
|
// find alphabetic position
|
||||||
while (i != end
|
while (i != end
|
||||||
&& d->model_->item(i, 0)->text().localeAwareCompare(titem) < 0
|
&& d->model_->item(i, 0)->text().localeAwareCompare(titem) < 0
|
||||||
&& (!sortedByCat || d->model_->item(i, 2)->text() == qcat))
|
&& (!sortedByCat || d->model_->item(i, 2)->text() == qcat))
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
@ -672,7 +672,7 @@ void LayoutBox::updateContents(bool reset)
|
|||||||
// obsoleted layouts are skipped as well
|
// obsoleted layouts are skipped as well
|
||||||
if (!lit->obsoleted_by().empty())
|
if (!lit->obsoleted_by().empty())
|
||||||
continue;
|
continue;
|
||||||
addItemSort(name, lit->category(), lyxrc.sort_layouts,
|
addItemSort(name, lit->category(), lyxrc.sort_layouts,
|
||||||
lyxrc.group_layouts, lit->isUnknown());
|
lyxrc.group_layouts, lit->isUnknown());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1829,7 +1829,7 @@ void MenuDefinition::expandQuotes(BufferView const * bv)
|
|||||||
}
|
}
|
||||||
if (!main_langdef_qs) {
|
if (!main_langdef_qs) {
|
||||||
FuncRequest cmd = FuncRequest(LFUN_INSET_MODIFY, subcmd + globalqsc + wildcards);
|
FuncRequest cmd = FuncRequest(LFUN_INSET_MODIFY, subcmd + globalqsc + wildcards);
|
||||||
docstring const desc = (main_dynamic_qs || display_static)
|
docstring const desc = (main_dynamic_qs || display_static)
|
||||||
? bformat(_("Reset to language default (%1$s, %2$s)|l"),
|
? bformat(_("Reset to language default (%1$s, %2$s)|l"),
|
||||||
quoteparams.getGuiLabel(langdefqs), _("static[[Quotes]]"))
|
quoteparams.getGuiLabel(langdefqs), _("static[[Quotes]]"))
|
||||||
: bformat(_("Reset to language default (%1$s)|l"),
|
: bformat(_("Reset to language default (%1$s)|l"),
|
||||||
|
@ -315,7 +315,7 @@ QStringList texFileList(QString const & filename)
|
|||||||
return list;
|
return list;
|
||||||
|
|
||||||
// FIXME Unicode.
|
// FIXME Unicode.
|
||||||
vector<docstring> doclist =
|
vector<docstring> doclist =
|
||||||
getVectorFromString(file.fileContents("UTF-8"), from_ascii("\n"));
|
getVectorFromString(file.fileContents("UTF-8"), from_ascii("\n"));
|
||||||
|
|
||||||
// Normalise paths like /foo//bar ==> /foo/bar
|
// Normalise paths like /foo//bar ==> /foo/bar
|
||||||
@ -349,7 +349,7 @@ QString const externalLineEnding(docstring const & str)
|
|||||||
|
|
||||||
docstring const internalLineEnding(QString const & str)
|
docstring const internalLineEnding(QString const & str)
|
||||||
{
|
{
|
||||||
docstring const s = subst(qstring_to_ucs4(str),
|
docstring const s = subst(qstring_to_ucs4(str),
|
||||||
from_ascii("\r\n"), from_ascii("\n"));
|
from_ascii("\r\n"), from_ascii("\n"));
|
||||||
return subst(s, '\r', '\n');
|
return subst(s, '\r', '\n');
|
||||||
}
|
}
|
||||||
@ -548,7 +548,7 @@ FileFilterList::FileFilterList(docstring const & qt_style_filter)
|
|||||||
string const filter = to_utf8(qt_style_filter)
|
string const filter = to_utf8(qt_style_filter)
|
||||||
+ (qt_style_filter.empty() ? string() : ";;")
|
+ (qt_style_filter.empty() ? string() : ";;")
|
||||||
+ to_utf8(_("All Files "))
|
+ to_utf8(_("All Files "))
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
+ ("(*.*)");
|
+ ("(*.*)");
|
||||||
#else
|
#else
|
||||||
+ ("(*)");
|
+ ("(*)");
|
||||||
|
@ -76,7 +76,7 @@ vector<string> const & Cache::loadableFormats() const
|
|||||||
|
|
||||||
// The formats natively loadable.
|
// The formats natively loadable.
|
||||||
vector<string> nformat = frontend::loadableImageFormats();
|
vector<string> nformat = frontend::loadableImageFormats();
|
||||||
|
|
||||||
vector<string>::const_iterator it = nformat.begin();
|
vector<string>::const_iterator it = nformat.begin();
|
||||||
for (; it != nformat.end(); ++it) {
|
for (; it != nformat.end(); ++it) {
|
||||||
for (Formats::const_iterator fit = begin; fit != end; ++fit) {
|
for (Formats::const_iterator fit = begin; fit != end; ++fit) {
|
||||||
|
@ -305,7 +305,7 @@ void Loader::startLoading() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Loader::reload() const
|
void Loader::reload() const
|
||||||
{
|
{
|
||||||
pimpl_->cached_item_->startLoading();
|
pimpl_->cached_item_->startLoading();
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ Template const * getTemplatePtr(InsetExternalParams const & params)
|
|||||||
|
|
||||||
void editExternal(InsetExternalParams const & params, Buffer const & buffer)
|
void editExternal(InsetExternalParams const & params, Buffer const & buffer)
|
||||||
{
|
{
|
||||||
theFormats().edit(buffer, params.filename,
|
theFormats().edit(buffer, params.filename,
|
||||||
theFormats().getFormatFromFile(params.filename));
|
theFormats().getFormatFromFile(params.filename));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ Buffer & Inset::buffer()
|
|||||||
<< " name: " << iname);
|
<< " name: " << iname);
|
||||||
s << "LyX Code: " << lyxCode() << " name: " << from_ascii(iname);
|
s << "LyX Code: " << lyxCode() << " name: " << from_ascii(iname);
|
||||||
LATTEST(false);
|
LATTEST(false);
|
||||||
throw ExceptionMessage(BufferException,
|
throw ExceptionMessage(BufferException,
|
||||||
from_ascii("Inset::buffer_ member not initialized!"), s.str());
|
from_ascii("Inset::buffer_ member not initialized!"), s.str());
|
||||||
}
|
}
|
||||||
return *buffer_;
|
return *buffer_;
|
||||||
@ -223,7 +223,7 @@ bool Inset::isBufferLoaded() const
|
|||||||
|
|
||||||
bool Inset::isBufferValid() const
|
bool Inset::isBufferValid() const
|
||||||
{
|
{
|
||||||
return buffer_
|
return buffer_
|
||||||
&& (isBufferLoaded() || buffer_->isClone());
|
&& (isBufferLoaded() || buffer_->isClone());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,7 +234,7 @@ docstring Inset::layoutName() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Inset::isFreeSpacing() const
|
bool Inset::isFreeSpacing() const
|
||||||
{
|
{
|
||||||
return getLayout().isFreeSpacing();
|
return getLayout().isFreeSpacing();
|
||||||
}
|
}
|
||||||
@ -298,14 +298,14 @@ InsetCode insetCode(string const & name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string insetName(InsetCode c)
|
string insetName(InsetCode c)
|
||||||
{
|
{
|
||||||
build_translator();
|
build_translator();
|
||||||
return insetnames[c].name;
|
return insetnames[c].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
docstring insetDisplayName(InsetCode c)
|
docstring insetDisplayName(InsetCode c)
|
||||||
{
|
{
|
||||||
build_translator();
|
build_translator();
|
||||||
return insetnames[c].display_name;
|
return insetnames[c].display_name;
|
||||||
@ -316,7 +316,7 @@ void Inset::dispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
{
|
{
|
||||||
if (buffer_ == 0) {
|
if (buffer_ == 0) {
|
||||||
lyxerr << "Unassigned buffer_ member in Inset::dispatch()" << std::endl;
|
lyxerr << "Unassigned buffer_ member in Inset::dispatch()" << std::endl;
|
||||||
lyxerr << "LyX Code: " << lyxCode() << " name: "
|
lyxerr << "LyX Code: " << lyxCode() << " name: "
|
||||||
<< insetName(lyxCode()) << std::endl;
|
<< insetName(lyxCode()) << std::endl;
|
||||||
} else if (cur.buffer() != buffer_)
|
} else if (cur.buffer() != buffer_)
|
||||||
lyxerr << "cur.buffer() != buffer_ in Inset::dispatch()" << std::endl;
|
lyxerr << "cur.buffer() != buffer_ in Inset::dispatch()" << std::endl;
|
||||||
@ -644,7 +644,7 @@ bool Inset::resetFontEdit() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
docstring Inset::completionPrefix(Cursor const &) const
|
docstring Inset::completionPrefix(Cursor const &) const
|
||||||
{
|
{
|
||||||
return docstring();
|
return docstring();
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user