]> git.lyx.org Git - features.git/commitdiff
have row information on state line + one more bformat variant
authorLars Gullik Bjønnes <larsbj@gullik.org>
Thu, 4 Sep 2003 14:33:16 +0000 (14:33 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Thu, 4 Sep 2003 14:33:16 +0000 (14:33 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7663 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/bufferview_funcs.C
src/support/ChangeLog
src/support/lstrings.C
src/support/lstrings.h

index 37e4989ef8fd203d8acd3cd367cacfb011db935b..741491691f6a080fb4b1dce22f184d93ddb61ecc 100644 (file)
        up the dialogs. Cursor has to be in front of the inset (i.e.
        start of row) for this to function.
 
        up the dialogs. Cursor has to be in front of the inset (i.e.
        start of row) for this to function.
 
+2003-09-04  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * bufferview_funcs.C (currentState): output row information
+
 2003-09-04  Lars Gullik Bjønnes  <larsbj@lyx.org>
 
        * bufferview_funcs.C (currentState): output paragraph position
 2003-09-04  Lars Gullik Bjønnes  <larsbj@lyx.org>
 
        * bufferview_funcs.C (currentState): output paragraph position
index 6dc8b3fff80fdc539dcdebc17850f05ff12068ef..8896f345b68857b5e549b9bbee27378b636a0fac 100644 (file)
@@ -364,6 +364,8 @@ string const currentState(BufferView * bv)
 #ifdef DEVEL_VERSION
        state << _(", Paragraph: ") << text->cursor.par()->id();
        state << _(", Position: ") << text->cursor.pos();
 #ifdef DEVEL_VERSION
        state << _(", Paragraph: ") << text->cursor.par()->id();
        state << _(", Position: ") << text->cursor.pos();
+       RowList::iterator rit = text->cursorRow();
+       state << bformat(_(", Row b:%1$d e:%2$d"), rit->pos(), rit->end());
        state << _(", Inset: ") <<
                (text->cursor.par()->inInset() ? text->cursor.par()->inInset()->id() : -1);
 #endif
        state << _(", Inset: ") <<
                (text->cursor.par()->inInset() ? text->cursor.par()->inInset()->id() : -1);
 #endif
index a8a4424459b2ea5d4aaa1cc199bcb00bc3a8dd3d..25583f252ef06236b50106469ade3dd6cfea4395 100644 (file)
@@ -1,3 +1,7 @@
+2003-09-04  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * lstrings.[Ch] (bformat): add a variant taking two ints.
+
 2003-09-04  Angus Leeming  <leeming@lyx.org>
 
        * filetools.h:
 2003-09-04  Angus Leeming  <leeming@lyx.org>
 
        * filetools.h:
index 5cf4c4b8e26f47d4e150c40c2edc69635c7f223e..2654413b382da62b428ed896000b246c524d350f 100644 (file)
@@ -627,6 +627,12 @@ string bformat(string const & fmt, string const & arg1, string const & arg2)
 }
 
 
 }
 
 
+string bformat(string const & fmt, int arg1, int arg2)
+{
+       return STRCONV((boost::format(STRCONV(fmt)) % arg1 % arg2).str());
+}
+
+
 string bformat(string const & fmt, string const & arg1, string const & arg2,
        string const & arg3)
 {
 string bformat(string const & fmt, string const & arg1, string const & arg2,
        string const & arg3)
 {
@@ -671,6 +677,16 @@ string bformat(string const & fmt, string const & arg1, string const & arg2)
 }
 
 
 }
 
 
+string bformat(string const & fmt, int arg1, int arg2)
+{
+       Assert(contains(fmt, "%1$d"));
+       Assert(contains(fmt, "%2$d"));
+       string str = subst(fmt, "%1$d", arg1);
+       str = subst(str, "%2$d", arg2);
+       return subst(str, "%%", "%");
+}
+
+
 string bformat(string const & fmt, string const & arg1, string const & arg2,
        string const & arg3)
 {
 string bformat(string const & fmt, string const & arg1, string const & arg2,
        string const & arg3)
 {
index 5dd8cfd02c824633451a6569014dd6fef91a5b02..837658a13d3e18c29f237ea9609ae83c09c503b3 100644 (file)
@@ -206,6 +206,8 @@ string const getStringFromVector(std::vector<string> const & vec,
 string bformat(string const & fmt, string const & arg1);
 // arguments %1$s and %2$s
 string bformat(string const & fmt, string const & arg1, string const & arg2);
 string bformat(string const & fmt, string const & arg1);
 // arguments %1$s and %2$s
 string bformat(string const & fmt, string const & arg1, string const & arg2);
+// arguments %1$d and %2$d
+string bformat(string const & fmt, int arg1, int arg2);
 // arguments %1$s and %2$s and %3$s
 string bformat(string const & fmt, string const & arg1, string const & arg2,
                string const & arg3);
 // arguments %1$s and %2$s and %3$s
 string bformat(string const & fmt, string const & arg1, string const & arg2,
                string const & arg3);