+2004-12-17 Alfredo Braunstein <abraunst@lyx.org>
+
+ * paragraph.[Ch] (autoBreakRows): remove
+
+ * lyxtext.h: move autoBreakRows_ flag from InsetText to here.
+
+ * buffer.[Ch] (insertStringAsLines): receive an autobreakrows bool to
+ avoid using the paragraph one
+
+ * text2.C (LyXText, insertStringAsLines): adjust
+
2004-12-16 Angus Leeming <leeming@lyx.org>
* bufferlist.C:
// needed to insert the selection
void Buffer::insertStringAsLines(ParagraphList & pars,
pit_type & par, pos_type & pos,
- LyXFont const & fn, string const & str)
+ LyXFont const & fn, string const & str, bool autobreakrows)
{
LyXLayout_ptr const & layout = pars[par].layout();
pars[par].checkInsertChar(font);
// insert the string, don't insert doublespace
bool space_inserted = true;
- bool autobreakrows = pars[par].autoBreakRows();
for (string::const_iterator cit = str.begin();
cit != str.end(); ++cit) {
if (*cit == '\n') {
///
void insertStringAsLines(ParagraphList & plist,
lyx::pit_type &, lyx::pos_type &,
- LyXFont const &, std::string const &);
+ LyXFont const &, std::string const &, bool);
///
ParIterator getParFromID(int id) const;
/// do we have a paragraph with this id?
+
+2004-12-17 Alfredo Braunstein <abraunst@lyx.org>
+
+ * insettext.[Ch] : move autoBreakRows_ bool to LyXText
+
2004-12-15 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* insettabular.C (tabularFeatures): re-enable SET_ALL_LINES and
InsetText::InsetText(BufferParams const & bp)
- : autoBreakRows_(false), drawFrame_(false),
- frame_color_(LColor::insetframe), text_(0)
+ : drawFrame_(false), frame_color_(LColor::insetframe), text_(0)
{
paragraphs().push_back(Paragraph());
paragraphs().back().layout(bp.getLyXTextClass().defaultLayout());
InsetText::InsetText(InsetText const & in)
: UpdatableInset(in), text_(in.text_.bv_owner)
{
- autoBreakRows_ = in.autoBreakRows_;
+ text_.autoBreakRows_ = in.text_.autoBreakRows_;
drawFrame_ = in.drawFrame_;
frame_color_ = in.frame_color_;
text_.paragraphs() = in.text_.paragraphs();
void InsetText::updateLocal(LCursor & cur)
{
- if (!autoBreakRows_ && paragraphs().size() > 1) {
+ if (!text_.autoBreakRows_ && paragraphs().size() > 1) {
// collapse paragraphs
while (paragraphs().size() > 1) {
ParagraphList::iterator const first = paragraphs().begin();
void InsetText::setAutoBreakRows(bool flag)
{
- if (flag != autoBreakRows_) {
- autoBreakRows_ = flag;
+ if (flag != text_.autoBreakRows_) {
+ text_.autoBreakRows_ = flag;
if (!flag)
removeNewlines();
}
///
void setAutoBreakRows(bool);
///
- bool getAutoBreakRows() const { return autoBreakRows_; }
+ bool getAutoBreakRows() const { return text_.autoBreakRows_; }
///
void setDrawFrame(bool);
///
///
void clearInset(Painter &, int x, int y) const;
- ///
- bool autoBreakRows_;
///
bool drawFrame_;
/** We store the LColor::color value as an int to get LColor.h out
/// our 'outermost' Font
LyXFont font_;
+ ///
+ bool autoBreakRows_;
private:
/// return past-the-last paragraph influenced by a layout
/// change on pit
}
-bool Paragraph::autoBreakRows() const
-{
- return inInset() && static_cast<InsetText *>(inInset())->getAutoBreakRows();
-}
-
-
namespace {
// paragraphs inside floats need different alignment tags to avoid
///
InsetBase::Code ownerCode() const;
///
- bool autoBreakRows() const;
- ///
bool forceDefaultParagraphs() const;
///
LyXText::LyXText(BufferView * bv)
: maxwidth_(bv ? bv->workWidth() : 100),
background_color_(LColor::background),
- bv_owner(bv)
+ bv_owner(bv),
+ autoBreakRows_(false)
{}
// only to be sure, should not be neccessary
cur.clearSelection();
- cur.buffer().insertStringAsLines(pars_, pit, pos, current_font, str);
+ cur.buffer().insertStringAsLines(pars_, pit, pos, current_font, str,
+ autoBreakRows_);
cur.resetAnchor();
setCursor(cur, cur.pit(), pos);