mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-21 23:09:40 +00:00
Fulfill promise to Andre: TextClass_ptr --> TextClassPtr.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20349 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
ab4c1039c5
commit
e020bc1806
@ -109,7 +109,7 @@ src_header_files = Split('''
|
||||
TexRow.h
|
||||
Text.h
|
||||
TextClass.h
|
||||
TextClass_ptr.h
|
||||
TextClassPtr.h
|
||||
TextClassList.h
|
||||
TextMetrics.h
|
||||
Thesaurus.h
|
||||
|
@ -1215,12 +1215,12 @@ TextClass const & BufferParams::getTextClass() const
|
||||
}
|
||||
|
||||
|
||||
TextClass_ptr BufferParams::getTextClass_ptr() const {
|
||||
TextClassPtr BufferParams::getTextClassPtr() const {
|
||||
return textClass_;
|
||||
}
|
||||
|
||||
|
||||
void BufferParams::setTextClass(TextClass_ptr tc) {
|
||||
void BufferParams::setTextClass(TextClassPtr tc) {
|
||||
textClass_ = tc;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
#include "BiblioInfo.h"
|
||||
#include "TextClass.h"
|
||||
#include "TextClass_ptr.h"
|
||||
#include "TextClassPtr.h"
|
||||
#include "paper.h"
|
||||
|
||||
#include "insets/InsetQuotes.h"
|
||||
@ -106,8 +106,8 @@ public:
|
||||
///by modules.
|
||||
TextClass const & getTextClass() const;
|
||||
///Returns a pointer to the TextClass currently in use: the BaseClass
|
||||
///as modified by modules. (See \file TextClass_ptr.h for the typedef.)
|
||||
TextClass_ptr getTextClass_ptr() const;
|
||||
///as modified by modules. (See \file TextClassPtr.h for the typedef.)
|
||||
TextClassPtr getTextClassPtr() const;
|
||||
///Set the LyX TextClass---layout file---this document is using.
|
||||
///This does NOT call makeTextClass() and so should be used with
|
||||
///care. This is most likely not what you want if you are operating on
|
||||
@ -119,7 +119,7 @@ public:
|
||||
/// This bypasses the baseClass and sets the textClass directly.
|
||||
/// Should be called with care and would be better not being here,
|
||||
/// but it seems to be needed by CutAndPaste::putClipboard().
|
||||
void setTextClass(TextClass_ptr);
|
||||
void setTextClass(TextClassPtr);
|
||||
/// List of modules in use
|
||||
std::vector<std::string> const & getModules() const;
|
||||
/// Add a module to the list of modules in use.
|
||||
@ -313,7 +313,7 @@ private:
|
||||
/// the base TextClass associated with the document
|
||||
textclass_type baseClass_;
|
||||
/// the possibly modular TextClass actually in use
|
||||
TextClass_ptr textClass_;
|
||||
TextClassPtr textClass_;
|
||||
///
|
||||
typedef std::vector<std::string> LayoutModuleList;
|
||||
///
|
||||
|
@ -1607,7 +1607,7 @@ void BufferView::menuInsertLyXFile(string const & filenm)
|
||||
el = buf.errorList("Parse");
|
||||
recordUndo(cursor_);
|
||||
cap::pasteParagraphList(cursor_, buf.paragraphs(),
|
||||
buf.params().getTextClass_ptr(), el);
|
||||
buf.params().getTextClassPtr(), el);
|
||||
res = _("Document %1$s inserted.");
|
||||
} else
|
||||
res = _("Could not insert document %1$s");
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "LyXFunc.h"
|
||||
#include "LyXRC.h"
|
||||
#include "Text.h"
|
||||
#include "TextClass_ptr.h"
|
||||
#include "TextClassPtr.h"
|
||||
#include "TextClassList.h"
|
||||
#include "Paragraph.h"
|
||||
#include "paragraph_funcs.h"
|
||||
@ -72,7 +72,7 @@ namespace {
|
||||
|
||||
typedef std::pair<pit_type, int> PitPosPair;
|
||||
|
||||
typedef limited_stack<pair<ParagraphList, TextClass_ptr> > CutStack;
|
||||
typedef limited_stack<pair<ParagraphList, TextClassPtr> > CutStack;
|
||||
|
||||
CutStack theCuts(10);
|
||||
// persistent selection, cleared until the next selection
|
||||
@ -108,7 +108,7 @@ bool checkPastePossible(int index)
|
||||
|
||||
pair<PitPosPair, pit_type>
|
||||
pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
|
||||
TextClass_ptr textclass, ErrorList & errorlist)
|
||||
TextClassPtr textclass, ErrorList & errorlist)
|
||||
{
|
||||
Buffer const & buffer = cur.buffer();
|
||||
pit_type pit = cur.pit();
|
||||
@ -122,7 +122,7 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
|
||||
|
||||
// Make a copy of the CaP paragraphs.
|
||||
ParagraphList insertion = parlist;
|
||||
TextClass_ptr const tc = buffer.params().getTextClass_ptr();
|
||||
TextClassPtr const tc = buffer.params().getTextClassPtr();
|
||||
|
||||
// Now remove all out of the pars which is NOT allowed in the
|
||||
// new environment and set also another font if that is required.
|
||||
@ -327,7 +327,7 @@ PitPosPair eraseSelectionHelper(BufferParams const & params,
|
||||
}
|
||||
|
||||
|
||||
void putClipboard(ParagraphList const & paragraphs, TextClass_ptr textclass,
|
||||
void putClipboard(ParagraphList const & paragraphs, TextClassPtr textclass,
|
||||
docstring const & plaintext)
|
||||
{
|
||||
// For some strange reason gcc 3.2 and 3.3 do not accept
|
||||
@ -346,7 +346,7 @@ void putClipboard(ParagraphList const & paragraphs, TextClass_ptr textclass,
|
||||
|
||||
void copySelectionHelper(Buffer const & buf, ParagraphList & pars,
|
||||
pit_type startpit, pit_type endpit,
|
||||
int start, int end, TextClass_ptr tc, CutStack & cutstack)
|
||||
int start, int end, TextClassPtr tc, CutStack & cutstack)
|
||||
{
|
||||
BOOST_ASSERT(0 <= start && start <= pars[startpit].size());
|
||||
BOOST_ASSERT(0 <= end && end <= pars[endpit].size());
|
||||
@ -403,8 +403,8 @@ docstring grabAndEraseSelection(Cursor & cur)
|
||||
}
|
||||
|
||||
|
||||
void switchBetweenClasses(TextClass_ptr const & c1,
|
||||
TextClass_ptr const & c2, InsetText & in, ErrorList & errorlist)
|
||||
void switchBetweenClasses(TextClassPtr const & c1,
|
||||
TextClassPtr const & c2, InsetText & in, ErrorList & errorlist)
|
||||
{
|
||||
errorlist.clear();
|
||||
|
||||
@ -530,7 +530,7 @@ void cutSelection(Cursor & cur, bool doclear, bool realcut)
|
||||
text->paragraphs(),
|
||||
begpit, endpit,
|
||||
cur.selBegin().pos(), endpos,
|
||||
bp.getTextClass_ptr(), theCuts);
|
||||
bp.getTextClassPtr(), theCuts);
|
||||
// Stuff what we got on the clipboard.
|
||||
// Even if there is no selection.
|
||||
putClipboard(theCuts[0].first, theCuts[0].second,
|
||||
@ -614,7 +614,7 @@ void copySelectionToStack(Cursor & cur, CutStack & cutstack)
|
||||
|
||||
copySelectionHelper(cur.buffer(), pars, par, cur.selEnd().pit(),
|
||||
pos, cur.selEnd().pos(),
|
||||
cur.buffer().params().getTextClass_ptr(), cutstack);
|
||||
cur.buffer().params().getTextClassPtr(), cutstack);
|
||||
dirtyTabularStack(false);
|
||||
}
|
||||
|
||||
@ -626,7 +626,7 @@ void copySelectionToStack(Cursor & cur, CutStack & cutstack)
|
||||
par.layout(bp.getTextClass().defaultLayout());
|
||||
par.insert(0, grabSelection(cur), Font(), Change(Change::UNCHANGED));
|
||||
pars.push_back(par);
|
||||
cutstack.push(make_pair(pars, bp.getTextClass_ptr()));
|
||||
cutstack.push(make_pair(pars, bp.getTextClassPtr()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -653,7 +653,7 @@ void copySelection(Cursor & cur, docstring const & plaintext)
|
||||
par.layout(bp.getTextClass().defaultLayout());
|
||||
par.insert(0, plaintext, Font(), Change(Change::UNCHANGED));
|
||||
pars.push_back(par);
|
||||
theCuts.push(make_pair(pars, bp.getTextClass_ptr()));
|
||||
theCuts.push(make_pair(pars, bp.getTextClassPtr()));
|
||||
} else
|
||||
copySelectionToStack(cur, theCuts);
|
||||
|
||||
@ -705,7 +705,7 @@ docstring getSelection(Buffer const & buf, size_t sel_index)
|
||||
|
||||
|
||||
void pasteParagraphList(Cursor & cur, ParagraphList const & parlist,
|
||||
TextClass_ptr textclass, ErrorList & errorList)
|
||||
TextClassPtr textclass, ErrorList & errorList)
|
||||
{
|
||||
if (cur.inTexted()) {
|
||||
Text * text = cur.text();
|
||||
@ -759,7 +759,7 @@ void pasteClipboard(Cursor & cur, ErrorList & errorList, bool asParagraphs)
|
||||
if (buffer.readString(lyx)) {
|
||||
recordUndo(cur);
|
||||
pasteParagraphList(cur, buffer.paragraphs(),
|
||||
buffer.params().getTextClass_ptr(), errorList);
|
||||
buffer.params().getTextClassPtr(), errorList);
|
||||
cur.setSelection();
|
||||
return;
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
#define CUTANDPASTE_H
|
||||
|
||||
#include "support/docstring.h"
|
||||
#include "TextClass_ptr.h"
|
||||
#include "TextClassPtr.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
@ -92,15 +92,15 @@ void pasteFromStack(Cursor & cur, ErrorList & errorList, size_t sel_index);
|
||||
/// Paste the paragraph list \p parlist at the position given by \p cur.
|
||||
/// Does not handle undo. Does only work in text, not mathed.
|
||||
void pasteParagraphList(Cursor & cur, ParagraphList const & parlist,
|
||||
TextClass_ptr textclass, ErrorList & errorList);
|
||||
TextClassPtr textclass, ErrorList & errorList);
|
||||
|
||||
|
||||
/** Needed to switch between different classes. This works
|
||||
* for a list of paragraphs beginning with the specified par.
|
||||
* It changes layouts and character styles.
|
||||
*/
|
||||
void switchBetweenClasses(TextClass_ptr const & c1,
|
||||
TextClass_ptr const & c2, InsetText & in, ErrorList &);
|
||||
void switchBetweenClasses(TextClassPtr const & c1,
|
||||
TextClassPtr const & c2, InsetText & in, ErrorList &);
|
||||
|
||||
/// Get the current selection as a string. Does not change the selection.
|
||||
/// Does only work if the whole selection is in mathed.
|
||||
|
@ -1751,7 +1751,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
|
||||
|
||||
Buffer * buffer = lyx_view_->buffer();
|
||||
|
||||
TextClass_ptr oldClass = buffer->params().getTextClass_ptr();
|
||||
TextClassPtr oldClass = buffer->params().getTextClassPtr();
|
||||
recordUndoFullDocument(view());
|
||||
|
||||
istringstream ss(argument);
|
||||
@ -1790,7 +1790,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
|
||||
case LFUN_LAYOUT_MODULES_CLEAR: {
|
||||
BOOST_ASSERT(lyx_view_);
|
||||
Buffer * buffer = lyx_view_->buffer();
|
||||
TextClass_ptr oldClass = buffer->params().getTextClass_ptr();
|
||||
TextClassPtr oldClass = buffer->params().getTextClassPtr();
|
||||
recordUndoFullDocument(view());
|
||||
buffer->params().clearLayoutModules();
|
||||
updateLayout(oldClass, buffer);
|
||||
@ -1801,7 +1801,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
|
||||
case LFUN_LAYOUT_MODULE_ADD: {
|
||||
BOOST_ASSERT(lyx_view_);
|
||||
Buffer * buffer = lyx_view_->buffer();
|
||||
TextClass_ptr oldClass = buffer->params().getTextClass_ptr();
|
||||
TextClassPtr oldClass = buffer->params().getTextClassPtr();
|
||||
recordUndoFullDocument(view());
|
||||
buffer->params().addLayoutModule(argument);
|
||||
updateLayout(oldClass, buffer);
|
||||
@ -1829,7 +1829,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
|
||||
break;
|
||||
|
||||
//Save the old, possibly modular, layout for use in conversion.
|
||||
TextClass_ptr oldClass = buffer->params().getTextClass_ptr();
|
||||
TextClassPtr oldClass = buffer->params().getTextClassPtr();
|
||||
recordUndoFullDocument(view());
|
||||
buffer->params().setBaseClass(new_class);
|
||||
updateLayout(oldClass, buffer);
|
||||
@ -1840,7 +1840,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
|
||||
case LFUN_LAYOUT_RELOAD: {
|
||||
BOOST_ASSERT(lyx_view_);
|
||||
Buffer * buffer = lyx_view_->buffer();
|
||||
TextClass_ptr oldClass = buffer->params().getTextClass_ptr();
|
||||
TextClassPtr oldClass = buffer->params().getTextClassPtr();
|
||||
textclass_type const tc = buffer->params().getBaseClass();
|
||||
textclasslist.reset(tc);
|
||||
buffer->params().setBaseClass(tc);
|
||||
@ -2306,7 +2306,7 @@ bool LyXFunc::wasMetaKey() const
|
||||
}
|
||||
|
||||
|
||||
void LyXFunc::updateLayout(TextClass_ptr const & oldlayout,
|
||||
void LyXFunc::updateLayout(TextClassPtr const & oldlayout,
|
||||
Buffer * buffer)
|
||||
{
|
||||
lyx_view_->message(_("Converting document to new document class..."));
|
||||
@ -2314,7 +2314,7 @@ void LyXFunc::updateLayout(TextClass_ptr const & oldlayout,
|
||||
StableDocIterator backcur(view()->cursor());
|
||||
ErrorList & el = buffer->errorList("Class Switch");
|
||||
cap::switchBetweenClasses(
|
||||
oldlayout, buffer->params().getTextClass_ptr(),
|
||||
oldlayout, buffer->params().getTextClassPtr(),
|
||||
static_cast<InsetText &>(buffer->inset()), el);
|
||||
|
||||
view()->setCursor(backcur.asDocIterator(&(buffer->inset())));
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
#include "KeySequence.h"
|
||||
#include "lfuns.h"
|
||||
#include "TextClass_ptr.h"
|
||||
#include "TextClassPtr.h"
|
||||
|
||||
#include "support/docstring.h"
|
||||
|
||||
@ -127,7 +127,7 @@ private:
|
||||
///
|
||||
bool ensureBufferClean(BufferView * bv);
|
||||
///
|
||||
void updateLayout(TextClass_ptr const & oldlayout, Buffer * buffer);
|
||||
void updateLayout(TextClassPtr const & oldlayout, Buffer * buffer);
|
||||
};
|
||||
|
||||
/// Implementation is in LyX.cpp
|
||||
|
@ -1141,7 +1141,7 @@ bool Text::dissolveInset(Cursor & cur) {
|
||||
b.getLanguage());
|
||||
}
|
||||
|
||||
pasteParagraphList(cur, plist, b.params().getTextClass_ptr(),
|
||||
pasteParagraphList(cur, plist, b.params().getTextClassPtr(),
|
||||
b.errorList("Paste"));
|
||||
// restore position
|
||||
cur.pit() = std::min(cur.lastpit(), spit);
|
||||
|
@ -22,7 +22,7 @@ class TextClass;
|
||||
* for example, will still be able to retain the pointer, even when
|
||||
* the buffer itself is closed.
|
||||
*/
|
||||
typedef boost::shared_ptr<TextClass> TextClass_ptr;
|
||||
typedef boost::shared_ptr<TextClass> TextClassPtr;
|
||||
|
||||
}
|
||||
#endif
|
@ -369,7 +369,7 @@ void LyXView::updateLayoutChoice()
|
||||
}
|
||||
|
||||
// Update the layout display
|
||||
if (toolbars_->updateLayoutList(buffer()->params().getTextClass_ptr())) {
|
||||
if (toolbars_->updateLayoutList(buffer()->params().getTextClassPtr())) {
|
||||
current_layout = buffer()->params().getTextClass().defaultLayoutName();
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ namespace frontend {
|
||||
Toolbars::Toolbars(LyXView & owner)
|
||||
: owner_(owner),
|
||||
layout_(0),
|
||||
last_textclass_(TextClass_ptr())
|
||||
last_textclass_(TextClassPtr())
|
||||
{}
|
||||
|
||||
#define TurnOnFlag(x) flags |= ToolbarInfo::x
|
||||
@ -286,7 +286,7 @@ void Toolbars::setLayout(docstring const & layout)
|
||||
}
|
||||
|
||||
|
||||
bool Toolbars::updateLayoutList(TextClass_ptr textclass)
|
||||
bool Toolbars::updateLayoutList(TextClassPtr textclass)
|
||||
{
|
||||
// update the layout display
|
||||
if (last_textclass_ != textclass) {
|
||||
@ -308,7 +308,7 @@ void Toolbars::openLayoutList()
|
||||
|
||||
void Toolbars::clearLayoutList()
|
||||
{
|
||||
last_textclass_ = TextClass_ptr();
|
||||
last_textclass_ = TextClassPtr();
|
||||
if (layout_)
|
||||
layout_->clear();
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
*
|
||||
* \author Lars Gullik Bjønnes
|
||||
* \author Lars Gullik Bjønnes
|
||||
* \author Angus Leeming
|
||||
*
|
||||
* Full author contact details are available in file CREDITS.
|
||||
@ -23,7 +23,7 @@
|
||||
#ifndef TOOLBARS_H
|
||||
#define TOOLBARS_H
|
||||
|
||||
#include "TextClass_ptr.h"
|
||||
#include "TextClassPtr.h"
|
||||
#include "ToolbarBackend.h"
|
||||
#include "Session.h"
|
||||
|
||||
@ -119,7 +119,7 @@ public:
|
||||
/** Populate the layout combox - returns whether we did a full
|
||||
* update or not
|
||||
*/
|
||||
bool updateLayoutList(TextClass_ptr textclass);
|
||||
bool updateLayoutList(TextClassPtr textclass);
|
||||
|
||||
/// Drop down the layout list.
|
||||
void openLayoutList();
|
||||
@ -154,7 +154,7 @@ private:
|
||||
ToolbarsMap toolbars_;
|
||||
|
||||
/// The last textclass layout list in the layout choice selector
|
||||
TextClass_ptr last_textclass_;
|
||||
TextClassPtr last_textclass_;
|
||||
|
||||
// load flags with saved values
|
||||
void initFlags(ToolbarInfo & tbinfo);
|
||||
|
Loading…
x
Reference in New Issue
Block a user