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:
Richard Heck 2007-09-18 17:46:14 +00:00
parent ab4c1039c5
commit e020bc1806
13 changed files with 46 additions and 46 deletions

View File

@ -109,7 +109,7 @@ src_header_files = Split('''
TexRow.h TexRow.h
Text.h Text.h
TextClass.h TextClass.h
TextClass_ptr.h TextClassPtr.h
TextClassList.h TextClassList.h
TextMetrics.h TextMetrics.h
Thesaurus.h Thesaurus.h

View File

@ -1215,12 +1215,12 @@ TextClass const & BufferParams::getTextClass() const
} }
TextClass_ptr BufferParams::getTextClass_ptr() const { TextClassPtr BufferParams::getTextClassPtr() const {
return textClass_; return textClass_;
} }
void BufferParams::setTextClass(TextClass_ptr tc) { void BufferParams::setTextClass(TextClassPtr tc) {
textClass_ = tc; textClass_ = tc;
} }

View File

@ -17,7 +17,7 @@
#include "BiblioInfo.h" #include "BiblioInfo.h"
#include "TextClass.h" #include "TextClass.h"
#include "TextClass_ptr.h" #include "TextClassPtr.h"
#include "paper.h" #include "paper.h"
#include "insets/InsetQuotes.h" #include "insets/InsetQuotes.h"
@ -106,8 +106,8 @@ public:
///by modules. ///by modules.
TextClass const & getTextClass() const; TextClass const & getTextClass() const;
///Returns a pointer to the TextClass currently in use: the BaseClass ///Returns a pointer to the TextClass currently in use: the BaseClass
///as modified by modules. (See \file TextClass_ptr.h for the typedef.) ///as modified by modules. (See \file TextClassPtr.h for the typedef.)
TextClass_ptr getTextClass_ptr() const; TextClassPtr getTextClassPtr() const;
///Set the LyX TextClass---layout file---this document is using. ///Set the LyX TextClass---layout file---this document is using.
///This does NOT call makeTextClass() and so should be used with ///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 ///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. /// This bypasses the baseClass and sets the textClass directly.
/// Should be called with care and would be better not being here, /// Should be called with care and would be better not being here,
/// but it seems to be needed by CutAndPaste::putClipboard(). /// but it seems to be needed by CutAndPaste::putClipboard().
void setTextClass(TextClass_ptr); void setTextClass(TextClassPtr);
/// List of modules in use /// List of modules in use
std::vector<std::string> const & getModules() const; std::vector<std::string> const & getModules() const;
/// Add a module to the list of modules in use. /// Add a module to the list of modules in use.
@ -313,7 +313,7 @@ private:
/// the base TextClass associated with the document /// the base TextClass associated with the document
textclass_type baseClass_; textclass_type baseClass_;
/// the possibly modular TextClass actually in use /// the possibly modular TextClass actually in use
TextClass_ptr textClass_; TextClassPtr textClass_;
/// ///
typedef std::vector<std::string> LayoutModuleList; typedef std::vector<std::string> LayoutModuleList;
/// ///

View File

@ -1607,7 +1607,7 @@ void BufferView::menuInsertLyXFile(string const & filenm)
el = buf.errorList("Parse"); el = buf.errorList("Parse");
recordUndo(cursor_); recordUndo(cursor_);
cap::pasteParagraphList(cursor_, buf.paragraphs(), cap::pasteParagraphList(cursor_, buf.paragraphs(),
buf.params().getTextClass_ptr(), el); buf.params().getTextClassPtr(), el);
res = _("Document %1$s inserted."); res = _("Document %1$s inserted.");
} else } else
res = _("Could not insert document %1$s"); res = _("Could not insert document %1$s");

View File

@ -30,7 +30,7 @@
#include "LyXFunc.h" #include "LyXFunc.h"
#include "LyXRC.h" #include "LyXRC.h"
#include "Text.h" #include "Text.h"
#include "TextClass_ptr.h" #include "TextClassPtr.h"
#include "TextClassList.h" #include "TextClassList.h"
#include "Paragraph.h" #include "Paragraph.h"
#include "paragraph_funcs.h" #include "paragraph_funcs.h"
@ -72,7 +72,7 @@ namespace {
typedef std::pair<pit_type, int> PitPosPair; 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); CutStack theCuts(10);
// persistent selection, cleared until the next selection // persistent selection, cleared until the next selection
@ -108,7 +108,7 @@ bool checkPastePossible(int index)
pair<PitPosPair, pit_type> pair<PitPosPair, pit_type>
pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist, pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
TextClass_ptr textclass, ErrorList & errorlist) TextClassPtr textclass, ErrorList & errorlist)
{ {
Buffer const & buffer = cur.buffer(); Buffer const & buffer = cur.buffer();
pit_type pit = cur.pit(); pit_type pit = cur.pit();
@ -122,7 +122,7 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
// Make a copy of the CaP paragraphs. // Make a copy of the CaP paragraphs.
ParagraphList insertion = parlist; 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 // Now remove all out of the pars which is NOT allowed in the
// new environment and set also another font if that is required. // 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) docstring const & plaintext)
{ {
// For some strange reason gcc 3.2 and 3.3 do not accept // 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, void copySelectionHelper(Buffer const & buf, ParagraphList & pars,
pit_type startpit, pit_type endpit, 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 <= start && start <= pars[startpit].size());
BOOST_ASSERT(0 <= end && end <= pars[endpit].size()); BOOST_ASSERT(0 <= end && end <= pars[endpit].size());
@ -403,8 +403,8 @@ docstring grabAndEraseSelection(Cursor & cur)
} }
void switchBetweenClasses(TextClass_ptr const & c1, void switchBetweenClasses(TextClassPtr const & c1,
TextClass_ptr const & c2, InsetText & in, ErrorList & errorlist) TextClassPtr const & c2, InsetText & in, ErrorList & errorlist)
{ {
errorlist.clear(); errorlist.clear();
@ -530,7 +530,7 @@ void cutSelection(Cursor & cur, bool doclear, bool realcut)
text->paragraphs(), text->paragraphs(),
begpit, endpit, begpit, endpit,
cur.selBegin().pos(), endpos, cur.selBegin().pos(), endpos,
bp.getTextClass_ptr(), theCuts); bp.getTextClassPtr(), theCuts);
// Stuff what we got on the clipboard. // Stuff what we got on the clipboard.
// Even if there is no selection. // Even if there is no selection.
putClipboard(theCuts[0].first, theCuts[0].second, 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(), copySelectionHelper(cur.buffer(), pars, par, cur.selEnd().pit(),
pos, cur.selEnd().pos(), pos, cur.selEnd().pos(),
cur.buffer().params().getTextClass_ptr(), cutstack); cur.buffer().params().getTextClassPtr(), cutstack);
dirtyTabularStack(false); dirtyTabularStack(false);
} }
@ -626,7 +626,7 @@ void copySelectionToStack(Cursor & cur, CutStack & cutstack)
par.layout(bp.getTextClass().defaultLayout()); par.layout(bp.getTextClass().defaultLayout());
par.insert(0, grabSelection(cur), Font(), Change(Change::UNCHANGED)); par.insert(0, grabSelection(cur), Font(), Change(Change::UNCHANGED));
pars.push_back(par); 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.layout(bp.getTextClass().defaultLayout());
par.insert(0, plaintext, Font(), Change(Change::UNCHANGED)); par.insert(0, plaintext, Font(), Change(Change::UNCHANGED));
pars.push_back(par); pars.push_back(par);
theCuts.push(make_pair(pars, bp.getTextClass_ptr())); theCuts.push(make_pair(pars, bp.getTextClassPtr()));
} else } else
copySelectionToStack(cur, theCuts); copySelectionToStack(cur, theCuts);
@ -705,7 +705,7 @@ docstring getSelection(Buffer const & buf, size_t sel_index)
void pasteParagraphList(Cursor & cur, ParagraphList const & parlist, void pasteParagraphList(Cursor & cur, ParagraphList const & parlist,
TextClass_ptr textclass, ErrorList & errorList) TextClassPtr textclass, ErrorList & errorList)
{ {
if (cur.inTexted()) { if (cur.inTexted()) {
Text * text = cur.text(); Text * text = cur.text();
@ -759,7 +759,7 @@ void pasteClipboard(Cursor & cur, ErrorList & errorList, bool asParagraphs)
if (buffer.readString(lyx)) { if (buffer.readString(lyx)) {
recordUndo(cur); recordUndo(cur);
pasteParagraphList(cur, buffer.paragraphs(), pasteParagraphList(cur, buffer.paragraphs(),
buffer.params().getTextClass_ptr(), errorList); buffer.params().getTextClassPtr(), errorList);
cur.setSelection(); cur.setSelection();
return; return;
} }

View File

@ -15,7 +15,7 @@
#define CUTANDPASTE_H #define CUTANDPASTE_H
#include "support/docstring.h" #include "support/docstring.h"
#include "TextClass_ptr.h" #include "TextClassPtr.h"
#include <vector> #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. /// Paste the paragraph list \p parlist at the position given by \p cur.
/// Does not handle undo. Does only work in text, not mathed. /// Does not handle undo. Does only work in text, not mathed.
void pasteParagraphList(Cursor & cur, ParagraphList const & parlist, void pasteParagraphList(Cursor & cur, ParagraphList const & parlist,
TextClass_ptr textclass, ErrorList & errorList); TextClassPtr textclass, ErrorList & errorList);
/** Needed to switch between different classes. This works /** Needed to switch between different classes. This works
* for a list of paragraphs beginning with the specified par. * for a list of paragraphs beginning with the specified par.
* It changes layouts and character styles. * It changes layouts and character styles.
*/ */
void switchBetweenClasses(TextClass_ptr const & c1, void switchBetweenClasses(TextClassPtr const & c1,
TextClass_ptr const & c2, InsetText & in, ErrorList &); TextClassPtr const & c2, InsetText & in, ErrorList &);
/// Get the current selection as a string. Does not change the selection. /// Get the current selection as a string. Does not change the selection.
/// Does only work if the whole selection is in mathed. /// Does only work if the whole selection is in mathed.

View File

@ -1751,7 +1751,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
Buffer * buffer = lyx_view_->buffer(); Buffer * buffer = lyx_view_->buffer();
TextClass_ptr oldClass = buffer->params().getTextClass_ptr(); TextClassPtr oldClass = buffer->params().getTextClassPtr();
recordUndoFullDocument(view()); recordUndoFullDocument(view());
istringstream ss(argument); istringstream ss(argument);
@ -1790,7 +1790,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
case LFUN_LAYOUT_MODULES_CLEAR: { case LFUN_LAYOUT_MODULES_CLEAR: {
BOOST_ASSERT(lyx_view_); BOOST_ASSERT(lyx_view_);
Buffer * buffer = lyx_view_->buffer(); Buffer * buffer = lyx_view_->buffer();
TextClass_ptr oldClass = buffer->params().getTextClass_ptr(); TextClassPtr oldClass = buffer->params().getTextClassPtr();
recordUndoFullDocument(view()); recordUndoFullDocument(view());
buffer->params().clearLayoutModules(); buffer->params().clearLayoutModules();
updateLayout(oldClass, buffer); updateLayout(oldClass, buffer);
@ -1801,7 +1801,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
case LFUN_LAYOUT_MODULE_ADD: { case LFUN_LAYOUT_MODULE_ADD: {
BOOST_ASSERT(lyx_view_); BOOST_ASSERT(lyx_view_);
Buffer * buffer = lyx_view_->buffer(); Buffer * buffer = lyx_view_->buffer();
TextClass_ptr oldClass = buffer->params().getTextClass_ptr(); TextClassPtr oldClass = buffer->params().getTextClassPtr();
recordUndoFullDocument(view()); recordUndoFullDocument(view());
buffer->params().addLayoutModule(argument); buffer->params().addLayoutModule(argument);
updateLayout(oldClass, buffer); updateLayout(oldClass, buffer);
@ -1829,7 +1829,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
break; break;
//Save the old, possibly modular, layout for use in conversion. //Save the old, possibly modular, layout for use in conversion.
TextClass_ptr oldClass = buffer->params().getTextClass_ptr(); TextClassPtr oldClass = buffer->params().getTextClassPtr();
recordUndoFullDocument(view()); recordUndoFullDocument(view());
buffer->params().setBaseClass(new_class); buffer->params().setBaseClass(new_class);
updateLayout(oldClass, buffer); updateLayout(oldClass, buffer);
@ -1840,7 +1840,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
case LFUN_LAYOUT_RELOAD: { case LFUN_LAYOUT_RELOAD: {
BOOST_ASSERT(lyx_view_); BOOST_ASSERT(lyx_view_);
Buffer * buffer = lyx_view_->buffer(); Buffer * buffer = lyx_view_->buffer();
TextClass_ptr oldClass = buffer->params().getTextClass_ptr(); TextClassPtr oldClass = buffer->params().getTextClassPtr();
textclass_type const tc = buffer->params().getBaseClass(); textclass_type const tc = buffer->params().getBaseClass();
textclasslist.reset(tc); textclasslist.reset(tc);
buffer->params().setBaseClass(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) Buffer * buffer)
{ {
lyx_view_->message(_("Converting document to new document class...")); lyx_view_->message(_("Converting document to new document class..."));
@ -2314,7 +2314,7 @@ void LyXFunc::updateLayout(TextClass_ptr const & oldlayout,
StableDocIterator backcur(view()->cursor()); StableDocIterator backcur(view()->cursor());
ErrorList & el = buffer->errorList("Class Switch"); ErrorList & el = buffer->errorList("Class Switch");
cap::switchBetweenClasses( cap::switchBetweenClasses(
oldlayout, buffer->params().getTextClass_ptr(), oldlayout, buffer->params().getTextClassPtr(),
static_cast<InsetText &>(buffer->inset()), el); static_cast<InsetText &>(buffer->inset()), el);
view()->setCursor(backcur.asDocIterator(&(buffer->inset()))); view()->setCursor(backcur.asDocIterator(&(buffer->inset())));

View File

@ -17,7 +17,7 @@
#include "KeySequence.h" #include "KeySequence.h"
#include "lfuns.h" #include "lfuns.h"
#include "TextClass_ptr.h" #include "TextClassPtr.h"
#include "support/docstring.h" #include "support/docstring.h"
@ -127,7 +127,7 @@ private:
/// ///
bool ensureBufferClean(BufferView * bv); bool ensureBufferClean(BufferView * bv);
/// ///
void updateLayout(TextClass_ptr const & oldlayout, Buffer * buffer); void updateLayout(TextClassPtr const & oldlayout, Buffer * buffer);
}; };
/// Implementation is in LyX.cpp /// Implementation is in LyX.cpp

View File

@ -1141,7 +1141,7 @@ bool Text::dissolveInset(Cursor & cur) {
b.getLanguage()); b.getLanguage());
} }
pasteParagraphList(cur, plist, b.params().getTextClass_ptr(), pasteParagraphList(cur, plist, b.params().getTextClassPtr(),
b.errorList("Paste")); b.errorList("Paste"));
// restore position // restore position
cur.pit() = std::min(cur.lastpit(), spit); cur.pit() = std::min(cur.lastpit(), spit);

View File

@ -22,7 +22,7 @@ class TextClass;
* for example, will still be able to retain the pointer, even when * for example, will still be able to retain the pointer, even when
* the buffer itself is closed. * the buffer itself is closed.
*/ */
typedef boost::shared_ptr<TextClass> TextClass_ptr; typedef boost::shared_ptr<TextClass> TextClassPtr;
} }
#endif #endif

View File

@ -369,7 +369,7 @@ void LyXView::updateLayoutChoice()
} }
// Update the layout display // Update the layout display
if (toolbars_->updateLayoutList(buffer()->params().getTextClass_ptr())) { if (toolbars_->updateLayoutList(buffer()->params().getTextClassPtr())) {
current_layout = buffer()->params().getTextClass().defaultLayoutName(); current_layout = buffer()->params().getTextClass().defaultLayoutName();
} }

View File

@ -35,7 +35,7 @@ namespace frontend {
Toolbars::Toolbars(LyXView & owner) Toolbars::Toolbars(LyXView & owner)
: owner_(owner), : owner_(owner),
layout_(0), layout_(0),
last_textclass_(TextClass_ptr()) last_textclass_(TextClassPtr())
{} {}
#define TurnOnFlag(x) flags |= ToolbarInfo::x #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 // update the layout display
if (last_textclass_ != textclass) { if (last_textclass_ != textclass) {
@ -308,7 +308,7 @@ void Toolbars::openLayoutList()
void Toolbars::clearLayoutList() void Toolbars::clearLayoutList()
{ {
last_textclass_ = TextClass_ptr(); last_textclass_ = TextClassPtr();
if (layout_) if (layout_)
layout_->clear(); layout_->clear();
} }

View File

@ -4,7 +4,7 @@
* This file is part of LyX, the document processor. * This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING. * Licence details can be found in the file COPYING.
* *
* \author Lars Gullik Bjønnes * \author Lars Gullik Bjønnes
* \author Angus Leeming * \author Angus Leeming
* *
* Full author contact details are available in file CREDITS. * Full author contact details are available in file CREDITS.
@ -23,7 +23,7 @@
#ifndef TOOLBARS_H #ifndef TOOLBARS_H
#define TOOLBARS_H #define TOOLBARS_H
#include "TextClass_ptr.h" #include "TextClassPtr.h"
#include "ToolbarBackend.h" #include "ToolbarBackend.h"
#include "Session.h" #include "Session.h"
@ -119,7 +119,7 @@ public:
/** Populate the layout combox - returns whether we did a full /** Populate the layout combox - returns whether we did a full
* update or not * update or not
*/ */
bool updateLayoutList(TextClass_ptr textclass); bool updateLayoutList(TextClassPtr textclass);
/// Drop down the layout list. /// Drop down the layout list.
void openLayoutList(); void openLayoutList();
@ -154,7 +154,7 @@ private:
ToolbarsMap toolbars_; ToolbarsMap toolbars_;
/// The last textclass layout list in the layout choice selector /// The last textclass layout list in the layout choice selector
TextClass_ptr last_textclass_; TextClassPtr last_textclass_;
// load flags with saved values // load flags with saved values
void initFlags(ToolbarInfo & tbinfo); void initFlags(ToolbarInfo & tbinfo);