[Libreoffice-commits] libmspub.git: src/lib

Fridrich Å trba fridrich.strba at bluewin.ch
Tue Apr 16 01:15:50 PDT 2013


 src/lib/Fill.cpp        |   11 +++++------
 src/lib/FillType.h      |    8 ++++----
 src/lib/MSPUBParser.cpp |    8 ++++----
 3 files changed, 13 insertions(+), 14 deletions(-)

New commits:
commit 726159305118afcad5086da0249e0e5d01479ae6
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Tue Apr 16 10:15:23 2013 +0200

    Try to use the documentation names

diff --git a/src/lib/Fill.cpp b/src/lib/Fill.cpp
index 358c8af..f563517 100644
--- a/src/lib/Fill.cpp
+++ b/src/lib/Fill.cpp
@@ -27,6 +27,7 @@
  */
 
 #include "Fill.h"
+#include "FillType.h"
 #include "libmspub_utils.h"
 #include "MSPUBCollector.h"
 
@@ -156,11 +157,7 @@ WPXPropertyListVector GradientFill::getProperties(WPXPropertyList *out) const
   out->insert("draw:angle", -m_angle); // draw:angle is clockwise in odf format
   switch (m_type)
   {
-  case 4:
-  case 7:
-    out->insert("libmspub:shade", "normal");
-    break;
-  case 5:
+  case SHADE_CENTER:
     out->insert("libmspub:shade", "center");
     if ((m_fillLeftVal > 0.5) && (m_fillTopVal > 0.5) && (m_fillRightVal > 0.5) && (m_fillBottomVal > 0.5))
       out->insert("libmspub:shade-ref-point", "bottom-right");
@@ -171,9 +168,11 @@ WPXPropertyListVector GradientFill::getProperties(WPXPropertyList *out) const
     else if ((m_fillLeftVal < 0.5) && (m_fillTopVal > 0.5) && (m_fillRightVal < 0.5) && (m_fillBottomVal > 0.5))
       out->insert("libmspub:shade-ref-point", "bottom-left");
     break;
-  case 6:
+  case SHADE_SHAPE:
     out->insert("libmspub:shade", "shape");
     break;
+  case SHADE:
+  case SHADE_SCALE:
   default:
     out->insert("libmspub:shade", "normal");
     break;
diff --git a/src/lib/FillType.h b/src/lib/FillType.h
index adde316..b08e6a3 100644
--- a/src/lib/FillType.h
+++ b/src/lib/FillType.h
@@ -34,13 +34,13 @@ namespace libmspub
 enum FillType
 {
   SOLID,
-  GRADIENT = 0x07, // msofillShadeScale Similar to msofillShade, but the fillAngle
+  SHADE_SCALE = 0x07, // msofillShadeScale Similar to msofillShade, but the fillAngle
   // is additionally scaled by the aspect ratio of
   // the shape. If shape is square, it is the
   // same as msofillShade
-  GRADIENTCENTER = 0x06, // msofillShadeShape  Shade from shape outline to end point
-  GRADIENTSHAPE = 0x05,  // msofillShadeCenter Shade from bounding rectangle to end point
-  GRADIENTNORMAL = 0x04, // msofillShade       Shade from start to end points
+  SHADE_SHAPE = 0x06, // msofillShadeShape  Shade from shape outline to end point
+  SHADE_CENTER = 0x05,  // msofillShadeCenter Shade from bounding rectangle to end point
+  SHADE = 0x04, // msofillShade       Shade from start to end points
   BITMAP = 0x03,
   TEXTURE = 0x02,
   PATTERN = 0x01
diff --git a/src/lib/MSPUBParser.cpp b/src/lib/MSPUBParser.cpp
index 412dc5f..888686a 100644
--- a/src/lib/MSPUBParser.cpp
+++ b/src/lib/MSPUBParser.cpp
@@ -1848,10 +1848,10 @@ boost::shared_ptr<libmspub::Fill> libmspub::MSPUBParser::getNewFill(const std::m
     }
     return boost::shared_ptr<Fill>();
   }
-  case GRADIENTCENTER:
-  case GRADIENTSHAPE:
-  case GRADIENTNORMAL:
-  case GRADIENT:
+  case SHADE_SHAPE:
+  case SHADE_CENTER:
+  case SHADE:
+  case SHADE_SCALE:
   {
     int angle;
     const int *ptr_angle = (const int *)getIfExists_const(foptProperties, FIELDID_FILL_ANGLE);


More information about the Libreoffice-commits mailing list