]> git.lyx.org Git - lyx.git/commitdiff
Prettify the names of the buffers displayed in the list of buffers.
authorAngus Leeming <leeming@lyx.org>
Mon, 24 Sep 2001 16:55:45 +0000 (16:55 +0000)
committerAngus Leeming <leeming@lyx.org>
Mon, 24 Sep 2001 16:55:45 +0000 (16:55 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2798 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlRef.C

index aef1be6c6f6115a722fe4f6ba3368cfc2e2ee63d..c0635550f05e48f19734fd36eefa3b23c88c573a 100644 (file)
@@ -1,3 +1,8 @@
+2001-09-24  Angus Leeming  <a.leeming@ic.ac.uk>
+
+       * ControlRef.C (getBufferList): use MakeDisplayPath on the list.
+       * (getLabelList): use MakeAbsPath on the buffer name passed to it.
+
 2001-09-21  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * ControlRef.h (disconnectOnApply): new method. Set to true.
index 62148f588a7e01b73a72ff8220cfa31f44d1c087..32a83d19869c1b564fed49add7980ab246849ec7 100644 (file)
@@ -26,6 +26,7 @@
 #include "buffer.h"
 #include "lyxfunc.h"
 #include "bufferlist.h"
+#include "support/filetools.h" // MakeAbsPath, MakeDisplayPath
 
 using SigC::slot;
 using std::vector;
@@ -43,7 +44,7 @@ ControlRef::ControlRef(LyXView & lv, Dialogs & d)
 
 vector<string> const ControlRef::getLabelList(string const & name) const
 {
-       Buffer * buffer = bufferlist.getBuffer(name);
+       Buffer * buffer = bufferlist.getBuffer(MakeAbsPath(name));
        if (!buffer)
                buffer = lv_.buffer();
        return buffer->getLabelList();
@@ -65,7 +66,14 @@ void ControlRef::gotoBookmark() const
 
 vector<string> const ControlRef::getBufferList() const
 {
-       return bufferlist.getFileNames();
+       
+       vector<string> buffers = bufferlist.getFileNames();
+       for (vector<string>::iterator it = buffers.begin();
+            it != buffers.end(); ++it) {
+               *it = MakeDisplayPath(*it);
+       }
+
+       return buffers;
 }