commit 37fd7b24ba60d9357fde0c218de051b71e222f80
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Tue Jul 29 11:05:14 2014 +0200

    Use enum instead of int in TextMetrics::getAlign
    
    This is just a code cleanup, no (intented) effect.

diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp
index 2927ca8..eb71f74 100644
--- a/src/TextMetrics.cpp
+++ b/src/TextMetrics.cpp
@@ -506,11 +506,11 @@ bool TextMetrics::redoParagraph(pit_type const pit)
 }
 
 
-int TextMetrics::getAlign(Paragraph const & par, pos_type const pos) const
+LyXAlignment TextMetrics::getAlign(Paragraph const & par, pos_type const pos) 
const
 {
        Layout const & layout = par.layout();
 
-       int align;
+       LyXAlignment align;
        if (par.params().align() == LYX_ALIGN_LAYOUT)
                align = layout.align;
        else
@@ -630,6 +630,12 @@ void TextMetrics::computeRowMetrics(pit_type const pit,
                        row.dimension().wid = width - int(w / 2);
                        row.x += w / 2;
                        break;
+               case LYX_ALIGN_LEFT:
+               case LYX_ALIGN_NONE:
+               case LYX_ALIGN_LAYOUT:
+               case LYX_ALIGN_SPECIAL:
+               case LYX_ALIGN_DECIMAL:
+                       break;
                }
        }
 
diff --git a/src/TextMetrics.h b/src/TextMetrics.h
index 92b1962..4e9fc0d 100644
--- a/src/TextMetrics.h
+++ b/src/TextMetrics.h
@@ -16,6 +16,7 @@
 
 #include "Font.h"
 #include "InsetList.h"
+#include "LayoutEnums.h"
 #include "ParagraphMetrics.h"
 
 #include "support/types.h"
@@ -136,7 +137,7 @@ private:
        void breakRow(Row & row, int right_margin, pit_type const pit) const;
 
        // Expand the alignment of paragraph \param par at position \param pos
-       int getAlign(Paragraph const & par, pos_type pos) const;
+       LyXAlignment getAlign(Paragraph const & par, pos_type pos) const;
        /** this calculates the specified parameters. needed when setting
         * the cursor and when creating a visible row */
        void computeRowMetrics(pit_type pit, Row & row, int width) const;

Reply via email to