]> git.lyx.org Git - lyx.git/blobdiff - src/vspace.C
add missing writeNormal() methods to some insets
[lyx.git] / src / vspace.C
index a3b94aa0547f34f383f5b54154d4f66bf5bf4094..dd2f63a348fca766dd05c959062bd65f7dbbc0a8 100644 (file)
@@ -1,11 +1,10 @@
-// -*- C++ -*-
 /* This file is part of
  * ====================================================== 
  * 
  *           LyX, The Document Processor
  *      
  *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2000 The LyX Team.
+ *           Copyright 1995-2001 The LyX Team.
  *
  * ====================================================== */
 
@@ -15,6 +14,8 @@
 #pragma implementation "vspace.h"
 #endif
 
+#include <stdio.h>
+
 #include "lyx_main.h"
 #include "buffer.h"
 #include "vspace.h"
@@ -51,7 +52,7 @@ int unit_index;
 
 
 inline
-void lyx_advance(string & data, unsigned int n)
+void lyx_advance(string & data, string::size_type n)
 {
        data.erase(0, n);
 }
@@ -325,7 +326,7 @@ LyXLength::LyXLength(string const & data)
 
 string const LyXLength::asString() const
 {
-       std::ostringstream buffer;
+       ostringstream buffer;
        buffer << val << unit_name[uni]; // setw?
        return buffer.str().c_str();
 }
@@ -333,17 +334,17 @@ string const LyXLength::asString() const
 
 string const LyXLength::asLatexString() const
 {
-       std::ostringstream buffer;
+       ostringstream buffer;
        switch(uni) {
        case PW:
        case PE:
-           buffer << "." << abs(static_cast<int>(val)) << "\\columnwidth";
+           buffer << abs(static_cast<int>(val/100)) << "." << abs(static_cast<int>(val)%100) << "\\columnwidth";
            break;
        case PP:
-           buffer << "." << abs(static_cast<int>(val)) << "\\pagewidth";
+           buffer << abs(static_cast<int>(val/100)) << "." << abs(static_cast<int>(val)%100) << "\\pagewidth";
            break;
        case PL:
-           buffer << "." << abs(static_cast<int>(val)) << "\\linewidth";
+           buffer << abs(static_cast<int>(val/100)) << "." << abs(static_cast<int>(val)%100) << "\\linewidth";
            break;
        default:
            buffer << val << unit_name[uni]; // setw?
@@ -375,7 +376,7 @@ LyXGlueLength::LyXGlueLength (string const & data)
 
 string const LyXGlueLength::asString() const
 {
-       std::ostringstream buffer;
+       ostringstream buffer;
 
        if (plus_val != 0.0)
                if (minus_val != 0.0)
@@ -429,7 +430,7 @@ string const LyXGlueLength::asString() const
 
 string const LyXGlueLength::asLatexString() const
 {
-       std::ostringstream buffer;
+       ostringstream buffer;
 
        if (plus_val != 0.0)
                if (minus_val != 0.0)
@@ -466,7 +467,7 @@ VSpace::VSpace (string const & data)
        float   value;
        string input  = strip(data);
 
-       int length = input.length();
+       string::size_type const length = input.length();
 
        if (length > 1 && input[length-1] == '*') {
                kp = true;
@@ -549,7 +550,7 @@ string const VSpace::asLatexCommand(BufferParams const & params) const
 int VSpace::inPixels(BufferView * bv) const
 {
        // Height of a normal line in pixels (zoom factor considered)
-       int height = bv->text->DefaultHeight(); // [pixels]
+       int height = bv->text->defaultHeight(); // [pixels]
        int skip = 0;
        int width = bv->workWidth();
 
@@ -596,7 +597,7 @@ int VSpace::inPixels(int default_height, int default_skip, int default_width) co
                // can't display negative anyway
                result = 0.0;
                value = len.value();
-               short val_sign = value < 0.0 ? -1 : 1;
+               int val_sign = value < 0.0 ? -1 : 1;
                
                switch (len.unit()) {
                case LyXLength::SP: