]> git.lyx.org Git - features.git/commitdiff
revert change from previous commit and remove the FontMetrics access completely in...
authorAbdelrazak Younes <younes@lyx.org>
Sat, 14 Oct 2006 15:31:50 +0000 (15:31 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sat, 14 Oct 2006 15:31:50 +0000 (15:31 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15333 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/insetbibitem.C

index ceff5365db1d49ec197ebf52367202d3926daa2f..6e4ac9f54585a03a4a0320c1db94337a27db0e8a 100644 (file)
@@ -21,8 +21,6 @@
 #include "paragraph.h"
 #include "ParagraphList.h"
 
-#include "frontends/FontMetrics.h"
-
 #include "support/lstrings.h"
 #include "support/std_ostream.h"
 #include "support/convert.h"
@@ -38,10 +36,6 @@ using std::ostream;
 int InsetBibitem::key_counter = 0;
 string const key_prefix = "key-";
 
-namespace lyx {
-extern bool use_gui;
-}
-
 InsetBibitem::InsetBibitem(InsetCommandParams const & p)
        : InsetCommand(p, "bibitem"), counter(1)
 {
@@ -145,11 +139,11 @@ int InsetBibitem::plaintext(Buffer const &, lyx::odocstream & os,
 docstring const bibitemWidest(Buffer const & buffer)
 {
        int w = 0;
-       // Does look like a hack? It is! (but will change at 0.13)
 
        InsetBibitem const * bitem = 0;
+
        // FIXME: this font is used unitialized for now but should  be set to
-       // a proportional font. Here is what Georg has to say about it:
+       // a proportional font. Here is what Georg Baum has to say about it:
        /*
        bibitemWidest() is supposed to find the bibitem with the widest label in the 
        output, because that is needed as an argument of the bibliography 
@@ -178,12 +172,17 @@ docstring const bibitemWidest(Buffer const & buffer)
                if (it->bibitem()) {
                        docstring const label = it->bibitem()->getBibLabel();
             
-                       // FIXME 1: we can't be sure using the following that the GUI
+                       // FIXME: we can't be sure using the following that the GUI
                        // version and the command-line version will give the same 
                        // result.
-                       // FIXME 2: this use_gui test should be transfered to the frontend.
-                       int const wx = lyx::use_gui?
-                               theFontMetrics(font).width(label): label.size();
+                       //
+                       //int const wx = lyx::use_gui?
+                       //      theFontMetrics(font).width(label): label.size();
+                       //
+                       // So for now we just use the label size in order to be sure
+                       // that GUI and no-GUI gives the same bibitem (even if that is 
+                       // potentially the wrong one.
+                       int const wx = label.size();
 
                        if (wx > w) {
                                w = wx;