Commit e64173b1 authored by Jody Goldberg's avatar Jody Goldberg
Browse files

- Some NULL checks - More OPT records.

- Some NULL checks
- More OPT records.
parent 35999838
......@@ -8,8 +8,10 @@
widths.
* ms-obj.c (ms_obj_realize) : Create a visual placeholder for charts.
Check for NULL sheet.
* ms-escher.c (ms_escher_read_ClientData) : Only set the blip type
* ms-escher.c : Lots more OPT record types.
(ms_escher_read_ClientData) : Only set the blip type
if we are a picture.
1999-09-21 Michael Meeks <michael@nuclecu.unam.mx>
......
......@@ -829,6 +829,10 @@ ms_escher_read_Dgg (MSEscherState * state, MSEscherHeader * h)
return FALSE;
}
typedef struct
{
} EscherOption;
static gboolean
ms_escher_read_OPT (MSEscherState * state, MSEscherHeader * h)
{
......@@ -866,12 +870,86 @@ ms_escher_read_OPT (MSEscherState * state, MSEscherHeader * h)
/* 0 : fixed point: 16.16 degrees */
case 4 : name = "long rotation"; break;
/* 0 : id for the text, value determined by the host */
case 128 : name = "long Txid"; break;
/* 1/10 inch : margins relative to shape's inscribed text rectangle (in EMUs) */
case 129 : name = "long dxTextLeft"; break;
/* 1/20 inch : */
case 130 : name = "long dyTextTop"; break;
/* 1/10 inch : */
case 131 : name = "long dxTextRight"; break;
/* 1/20 inch : */
case 132 : name = "long dyTextBottom"; break;
/* FALSE : Wrap text at shape margins */
case 133 : name = "MSOWRAPMODE WrapText"; break;
/* 0 : Text zoom/scale (used if fFitTextToShape) */
case 134 : name = "long scaleText"; break;
/* Top : How to anchor the text */
case 135 : name = "MSOANCHOR anchorText"; break;
/* HorzN : Text flow */
case 136 : name = "MSOTXFL txflTextFlow"; break;
/* msocdir0 : Font rotation */
case 137 : name = "MSOCDIR cdirFont"; break;
/* NULL : ID of the next shape (used by Word for linked textboxes) */
case 138 : name = "MSOHSP hspNext"; break;
/* LTR : Bi-Di Text direction */
case 139 : name = "MSOTXDIR txdir"; break;
/* TRUE : TRUE if single click selects text, FALSE if two clicks */
case 187 : name = "BOOL fSelectText"; break;
/* FALSE : use host's margin calculations */
case 188 : name = "BOOL fAutoTextMargin"; break;
/* FALSE : Rotate text with shape */
case 189 : name = "BOOL fRotateText"; break;
/* FALSE : Size shape to fit text size */
case 190 : name = "BOOL fFitShapeToText"; break;
/* FALSE : Size text to fit shape size */
case 191 : name = "BOOL fFitTextToShape"; break;
/* NULL : UNICODE text string */
case 192 : name = "WCHAR* gtextUNICODE"; break;
/* NULL : RTF text string */
case 193 : name = "char* gtextRTF"; break;
/* Center : alignment on curve */
case 194 : name = "MSOGEOTEXTALIGN gtextAlign"; break;
/* 36<<16 : default point size */
case 195 : name = "LONG gtextSize"; break;
/* 1<<16 : fixed point 16.16 */
case 196 : name = "LONG gtextSpacing"; break;
/* NULL : font family name */
case 197 : name = "WCHAR* gtextFont"; break;
/* FALSE : Reverse row order */
case 240 : name = "BOOL gtextFReverseRows"; break;
/* FALSE : Has text effect */
case 241 : name = "BOOL fGtext"; break;
/* FALSE : Rotate characters */
case 242 : name = "BOOL gtextFVertical"; break;
/* FALSE : Kern characters */
case 243 : name = "BOOL gtextFKern"; break;
/* FALSE : Tightening or tracking */
case 244 : name = "BOOL gtextFTight"; break;
/* FALSE : Stretch to fit shape */
case 245 : name = "BOOL gtextFStretch"; break;
/* FALSE : Char bounding box */
case 246 : name = "BOOL gtextFShrinkFit"; break;
/* FALSE : Scale text-on-path */
case 247 : name = "BOOL gtextFBestFit"; break;
/* FALSE : Stretch char height */
case 248 : name = "BOOL gtextFNormalize"; break;
/* FALSE : Do not measure along path */
case 249 : name = "BOOL gtextFDxMeasure"; break;
/* FALSE : Bold font */
case 250 : name = "BOOL gtextFBold"; break;
/* FALSE : Italic font */
case 251 : name = "BOOL gtextFItalic"; break;
/* FALSE : Underline font */
case 252 : name = "BOOL gtextFUnderline"; break;
/* FALSE : Shadow font */
case 253 : name = "BOOL gtextFShadow"; break;
/* FALSE : Small caps font */
case 254 : name = "BOOL gtextFSmallcaps"; break;
/* FALSE : Strike through font */
case 255 : name = "BOOL gtextFStrikethrough"; break;
/* 0 : 16.16 fraction times total image width or height, as appropriate. */
case 256 : name = "fixed16_16 cropFromTop"; break;
case 257 : name = "fixed16_16 cropFromBottom"; break;
......@@ -879,8 +957,7 @@ ms_escher_read_OPT (MSEscherState * state, MSEscherHeader * h)
case 259 : name = "fixed16_16 cropFromRight"; break;
/* NULL : Blip to display */
case 260 :
name = "Blip * pib";
case 260 : name = "Blip * pib";
h->blip_id = (int)val - 1;
break;
......@@ -937,11 +1014,371 @@ ms_escher_read_OPT (MSEscherState * state, MSEscherHeader * h)
/* FALSE : Server is active (OLE objects only) */
case 319 : name = "bool pictureActive"; break;
/* 0 : Defines the G (geometry) coordinate space. */
case 320 : name = "LONG geoLeft"; break;
/* 0 : */
case 321 : name = "LONG geoTop"; break;
/* 21600 : */
case 322 : name = "LONG geoRight"; break;
/* 21600 : */
case 323 : name = "LONG geoBottom"; break;
/* msoshapeLinesClosed : */
case 324 : name = "MSOSHAPEPATH shapePath"; break;
/* NULL : An array of points, in G units. */
case 325 : name = "IMsoArray pVertices"; break;
/* NULL : */
case 326 : name = "IMsoArray pSegmentInfo"; break;
/* 0 : Adjustment values corresponding to the positions of the
* adjust handles of the shape. The number of values used and
* their allowable ranges vary from shape type to shape type.
*/
case 327 : name = "LONG adjustValue"; break;
/* 0 : */
case 328 : name = "LONG adjust2Value"; break;
/* 0 : */
case 329 : name = "LONG adjust3Value"; break;
/* 0 : */
case 330 : name = "LONG adjust4Value"; break;
/* 0 : */
case 331 : name = "LONG adjust5Value"; break;
/* 0 : */
case 332 : name = "LONG adjust6Value"; break;
/* 0 : */
case 333 : name = "LONG adjust7Value"; break;
/* 0 : */
case 334 : name = "LONG adjust8Value"; break;
/* 0 : */
case 335 : name = "LONG adjust9Value"; break;
/* 0 : */
case 336 : name = "LONG adjust10Value"; break;
/* TRUE : Shadow may be set */
case 378 : name = "BOOL fShadowOK"; break;
/* TRUE : 3D may be set */
case 379 : name = "BOOL f3DOK"; break;
/* TRUE : Line style may be set */
case 380 : name = "BOOL fLineOK"; break;
/* FALSE : Text effect (WordArt) supported */
case 381 : name = "BOOL fGtextOK"; break;
/* FALSE : */
case 382 : name = "BOOL fFillShadeShapeOK"; break;
/* TRUE : OK to fill the shape through the UI or VBA? */
case 383 : name = "BOOL fFillOK"; break;
/* Solid : Type of fill */
case 384 : name = "MSOFILLTYPE fillType"; break;
/* white : Foreground color */
case 385 : name = "Colour fillColor"; break;
case 385 : name = "MSOCLR fillColor"; break;
/* 1<<16 : Fixed 16.16 */
case 386 : name = "LONG fillOpacity"; break;
/* white : Background color */
case 387 : name = "MSOCLR fillBackColor"; break;
/* 1<<16 : Shades only */
case 388 : name = "LONG fillBackOpacity"; break;
/* undefined : Modification for BW views */
case 389 : name = "MSOCLR fillCrMod"; break;
/* NULL : Pattern/texture */
case 390 : name = "IMsoBlip* fillBlip"; break;
/* NULL : Blip file name */
case 391 : name = "WCHAR* fillBlipName"; break;
/* Comment : Blip flags */
case 392 : name = "MSOBLIPFLAGS fillBlipFlags"; break;
/* 0 : How big (A units) to make a metafile texture. */
case 393 : name = "LONG fillWidth"; break;
/* 0 : */
case 394 : name = "LONG fillHeight"; break;
/* 0 : Fade angle - degrees in 16.16 */
case 395 : name = "LONG fillAngle"; break;
/* 0 : Linear shaded fill focus percent */
case 396 : name = "LONG fillFocus"; break;
/* 0 : Fraction 16.16 */
case 397 : name = "LONG fillToLeft"; break;
/* 0 : Fraction 16.16 */
case 398 : name = "LONG fillToTop"; break;
/* 0 : Fraction 16.16 */
case 399 : name = "LONG fillToRight"; break;
/* 0 : Fraction 16.16 */
case 400 : name = "LONG fillToBottom"; break;
/* 0 : For shaded fills, use the specified rectangle instead of
* the shape's bounding rect to define how large the fade is
* going to be. */
case 401 : name = "LONG fillRectLeft"; break;
/* 0 : */
case 402 : name = "LONG fillRectTop"; break;
/* 0 : */
case 403 : name = "LONG fillRectRight"; break;
/* 0 : */
case 404 : name = "LONG fillRectBottom"; break;
/* Default : */
case 405 : name = "MSODZTYPE fillDztype"; break;
/* 0 : Special shades */
case 406 : name = "LONG fillShadePreset"; break;
/* NULL : a preset array of colors */
case 407 : name = "IMsoArray fillShadeColors"; break;
/* 0 : */
case 408 : name = "LONG fillOriginX"; break;
/* 0 : */
case 409 : name = "LONG fillOriginY"; break;
/* 0 : */
case 410 : name = "LONG fillShapeOriginX"; break;
/* 0 : */
case 411 : name = "LONG fillShapeOriginY"; break;
/* Default : Type of shading, if a shaded (gradient) fill. */
case 412 : name = "MSOSHADETYPE fillShadeType"; break;
/* TRUE : Is shape filled? */
case 443 : name = "BOOL fFilled"; break;
/* TRUE : Should we hit test fill? */
case 444 : name = "BOOL fHitTestFill"; break;
/* TRUE : Register pattern on shape */
case 445 : name = "BOOL fillShape"; break;
/* FALSE : Use the large rect? */
case 446 : name = "BOOL fillUseRect"; break;
/* FALSE : Hit test a shape as though filled */
case 447 : name = "BOOL fNoFillHitTest"; break;
/* black : Color of line */
case 448 : name = "Colour lineColor"; break;
case 448 : name = "MSOCLR lineColor"; break;
/* 1<<16 : Not implemented */
case 449 : name = "LONG lineOpacity"; break;
/* white : Background color */
case 450 : name = "MSOCLR lineBackColor"; break;
/* undefined : Modification for BW views */
case 451 : name = "MSOCLR lineCrMod"; break;
/* Solid : Type of line */
case 452 : name = "MSOLINETYPE lineType"; break;
/* NULL : Pattern/texture */
case 453 : name = "IMsoBlip* lineFillBlip"; break;
/* NULL : Blip file name */
case 454 : name = "WCHAR* lineFillBlipName"; break;
/* Comment : Blip flags */
case 455 : name = "MSOBLIPFLAGS lineFillBlipFlags"; break;
/* 0 : How big (A units) to make a metafile texture. */
case 456 : name = "LONG lineFillWidth"; break;
/* 0 : */
case 457 : name = "LONG lineFillHeight"; break;
/* Default : How to interpret fillWidth/Height numbers. */
case 458 : name = "MSODZTYPE lineFillDztype"; break;
/* 9525 : A units; 1pt == 12700 EMUs */
case 459 : name = "LONG lineWidth"; break;
/* 8<<16 : ratio (16.16) of width */
case 460 : name = "LONG lineMiterLimit"; break;
/* Simple : Draw parallel lines? */
case 461 : name = "MSOLINESTYLE lineStyle"; break;
/* Solid : Can be overridden by: */
case 462 : name = "MSOLINEDASHING lineDashing"; break;
/* NULL : As Win32 ExtCreatePen */
case 463 : name = "IMsoArray lineDashStyle"; break;
/* NoEnd : Arrow at start */
case 464 : name = "MSOLINEEND lineStartArrowhead"; break;
/* NoEnd : Arrow at end */
case 465 : name = "MSOLINEEND lineEndArrowhead"; break;
/* MediumWidthArrow : Arrow at start */
case 466 : name = "MSOLINEENDWIDTH lineStartArrowWidth"; break;
/* MediumLenArrow : Arrow at end */
case 467 : name = "MSOLINEENDLENGTH lineStartArrowLength"; break;
/* MediumWidthArrow : Arrow at start */
case 468 : name = "MSOLINEENDWIDTH lineEndArrowWidth"; break;
/* MediumLenArrow : Arrow at end */
case 469 : name = "MSOLINEENDLENGTH lineEndArrowLength"; break;
/* JoinRound : How to join lines */
case 470 : name = "MSOLINEJOIN lineJoinStyle"; break;
/* EndCapFlat : How to end lines */
case 471 : name = "MSOLINECAP lineEndCapStyle"; break;
/* FALSE : Allow arrowheads if prop. is set */
case 507 : name = "BOOL fArrowheadsOK"; break;
/* TRUE : Any line? */
case 508 : name = "BOOL fLine"; break;
/* TRUE : Should we hit test lines? */
case 509 : name = "BOOL fHitTestLine"; break;
/* TRUE : Register pattern on shape */
case 510 : name = "BOOL lineFillShape"; break;
/* FALSE : Draw a dashed line if no line */
case 511 : name = "BOOL fNoLineDrawDash"; break;
/* Offset : Type of effect */
case 512 : name = "MSOSHADOWTYPE shadowType"; break;
/* 0x808080 : Foreground color */
case 513 : name = "MSOCLR shadowColor"; break;
/* 0xCBCBCB : Embossed color */
case 514 : name = "MSOCLR shadowHighlight"; break;
/* undefined : Modification for BW views */
case 515 : name = "MSOCLR shadowCrMod"; break;
/* 1<<16 : Fixed 16.16 */
case 516 : name = "LONG shadowOpacity"; break;
/* 25400 : Offset shadow */
case 517 : name = "LONG shadowOffsetX"; break;
/* 25400 : Offset shadow */
case 518 : name = "LONG shadowOffsetY"; break;
/* 0 : Double offset shadow */
case 519 : name = "LONG shadowSecondOffsetX"; break;
/* 0 : Double offset shadow */
case 520 : name = "LONG shadowSecondOffsetY"; break;
/* 1<<16 : 16.16 */
case 521 : name = "LONG shadowScaleXToX"; break;
/* 0 : 16.16 */
case 522 : name = "LONG shadowScaleYToX"; break;
/* 0 : 16.16 */
case 523 : name = "LONG shadowScaleXToY"; break;
/* 1<<16 : 16.16 */
case 524 : name = "LONG shadowScaleYToY"; break;
/* 0 : 16.16 / weight */
case 525 : name = "LONG shadowPerspectiveX"; break;
/* 0 : 16.16 / weight */
case 526 : name = "LONG shadowPerspectiveY"; break;
/* 1<<8 : scaling factor */
case 527 : name = "LONG shadowWeight"; break;
/* 0 : */
case 528 : name = "LONG shadowOriginX"; break;
/* 0 : */
case 529 : name = "LONG shadowOriginY"; break;
/* FALSE : Any shadow? */
case 574 : name = "BOOL fShadow"; break;
/* FALSE : Excel5-style shadow */
case 575 : name = "BOOL fshadowObscured"; break;
/* Shape : Where transform applies */
case 576 : name = "MSOXFORMTYPE perspectiveType"; break;
/* 0 : The LONG values define a transformation matrix,
* effectively, each value is scaled by the perspectiveWeight
* parameter. */
case 577 : name = "LONG perspectiveOffsetX"; break;
/* 0 : */
case 578 : name = "LONG perspectiveOffsetY"; break;
/* 1<<16 : */
case 579 : name = "LONG perspectiveScaleXToX"; break;
/* 0 : */
case 580 : name = "LONG perspectiveScaleYToX"; break;
/* 0 : */
case 581 : name = "LONG perspectiveScaleXToY"; break;
/* 1<<16 : */
case 582 : name = "LONG perspectiveScaleYToY"; break;
/* 0 : */
case 583 : name = "LONG perspectivePerspectiveX"; break;
/* 0 : */
case 584 : name = "LONG perspectivePerspectiveY"; break;
/* 1<<8 : Scaling factor */
case 585 : name = "LONG perspectiveWeight"; break;
/* 1<<15 : */
case 586 : name = "LONG perspectiveOriginX"; break;
/* 1<<15 : */
case 587 : name = "LONG perspectiveOriginY"; break;
/* FALSE : On/off */
case 639 : name = "BOOL fPerspective"; break;
/* 0 : Fixed-point 16.16 */
case 640 : name = "LONG DSpecularAmt"; break;
/* 65536 : Fixed-point 16.16 */
case 641 : name = "LONG c3DDiffuseAmt"; break;
/* 5 : Default gives OK results */
case 642 : name = "LONG c3DShininess"; break;
/* 12700 : Specular edge thickness */
case 643 : name = "LONG c3DEdgeThickness"; break;
/* 0 : Distance of extrusion in EMUs */
case 644 : name = "LONG c3DExtrudeForward"; break;
/* 457200 : */
case 645 : name = "LONG c3DExtrudeBackward"; break;
/* 0 : Extrusion direction */
case 646 : name = "LONG c3DExtrudePlane"; break;
/* FillThenLine : Basic color of extruded part of shape; the
* lighting model used will determine the exact shades used
* when rendering. */
case 647 : name = "MSOCLR c3DExtrusionColor"; break;
/* undefined : Modification for BW views */
case 648 : name = "MSOCLR c3DCrMod"; break;
/* FALSE : Does this shape have a 3D effect? */
case 700 : name = "BOOL f3D"; break;
/* 0 : Use metallic specularity? */
case 701 : name = "BOOL fc3DMetallic"; break;
/* FALSE : */
case 702 : name = "BOOL fc3DUseExtrusionColor"; break;
/* TRUE : */
case 703 : name = "BOOL fc3DLightFace"; break;
/* 0 : degrees (16.16) about y axis */
case 704 : name = "LONG c3DYRotationAngle"; break;
/* 0 : degrees (16.16) about x axis */
case 705 : name = "LONG c3DXRotationAngle"; break;
/* 100 : These specify the rotation axis; only their relative magnitudes matter. */
case 706 : name = "LONG c3DRotationAxisX"; break;
/* 0 : */
case 707 : name = "LONG c3DRotationAxisY"; break;
/* 0 : */
case 708 : name = "LONG c3DRotationAxisZ"; break;
/* 0 : degrees (16.16) about axis */
case 709 : name = "LONG c3DRotationAngle"; break;
/* 0 : rotation center x (16.16 or g-units) */
case 710 : name = "LONG c3DRotationCenterX"; break;
/* 0 : rotation center y (16.16 or g-units) */
case 711 : name = "LONG c3DRotationCenterY"; break;
/* 0 : rotation center z (absolute (emus)) */
case 712 : name = "LONG c3DRotationCenterZ"; break;
/* FullRender : Full,wireframe, or bcube */
case 713 : name = "MSO3DRENDERMODE c3DRenderMode"; break;
/* 30000 : pixels (16.16) */
case 714 : name = "LONG c3DTolerance"; break;
/* 1250000 : X view point (emus) */
case 715 : name = "LONG c3DXViewpoint"; break;
/* -1250000 : Y view point (emus) */
case 716 : name = "LONG c3DYViewpoint"; break;
/* 9000000 : Z view distance (emus) */
case 717 : name = "LONG c3DZViewpoint"; break;
/* 32768 : */
case 718 : name = "LONG c3DOriginX"; break;
/* -32768 : */
case 719 : name = "LONG c3DOriginY"; break;
/* -8847360 : degree (16.16) skew angle */
case 720 : name = "LONG c3DSkewAngle"; break;
/* 50 : Percentage skew amount */
case 721 : name = "LONG c3DSkewAmount"; break;
/* 20000 : Fixed point intensity */
case 722 : name = "LONG c3DAmbientIntensity"; break;
/* 50000 : Key light source direc- */
case 723 : name = "LONG c3DKeyX"; break;
/* 0 : tion; only their relative */
case 724 : name = "LONG c3DKeyY"; break;
/* 10000 : magnitudes matter */
case 725 : name = "LONG c3DKeyZ"; break;
/* 38000 : Fixed point intensity */
case 726 : name = "LONG c3DKeyIntensity"; break;
/* -50000 : Fill light source direc- */
case 727 : name = "LONG c3DFillX"; break;
/* 0 : tion; only their relative */
case 728 : name = "LONG c3DFillY"; break;
/* 10000 : magnitudes matter */
case 729 : name = "LONG c3DFillZ"; break;
/* 38000 : Fixed point intensity */
case 730 : name = "LONG c3DFillIntensity"; break;
/* TRUE : */
case 763 : name = "BOOL fc3DConstrainRotation"; break;
/* FALSE : */
case 764 : name = "BOOL fc3DRotationCenterAuto"; break;
/* 1 : Parallel projection? */
case 765 : name = "BOOL fc3DParallel"; break;
/* 1 : Is key lighting harsh? */
case 766 : name = "BOOL fc3DKeyHarsh"; break;
/* 0 : Is fill lighting harsh?` */
case 767 : name = "BOOL fc3DFillHarsh"; break;
/* NULL : master shape */
case 769 : name = "MSOHSP pMaster"; break;
/* None : Type of connector */
case 771 : name = "MSOCXSTYLE cxstyle"; break;
/* Automatic : Settings for modifications to be made when in
* different forms of black-and-white mode. */
case 772 : name = "MSOBWMODE bWMode"; break;
/* Automatic : */
case 773 : name = "MSOBWMODE bWModePureBW"; break;
/* Automatic : */
case 774 : name = "MSOBWMODE bWModeBW"; break;
/* FALSE : For OLE objects, whether the object is in icon form */
case 826 : name = "BOOL fOleIcon"; break;
/* FALSE : For UI only. Prefer relative resizing. */
case 827 : name = "BOOL fPreferRelativeResize"; break;
/* FALSE : Lock the shape type (don't allow Change Shape) */
case 828 : name = "BOOL fLockShapeType"; break;
/* FALSE : */
case 830 : name = "BOOL fDeleteAttachedObject"; break;
/* FALSE : If TRUE, this is the background shape. */
case 831 : name = "BOOL fBackground"; break;
default : name = "";
};
......
......@@ -43,6 +43,8 @@ ms_obj_realize (MSObj *obj, ExcelWorkbook *wb, ExcelSheet *sheet)
int *anchor = NULL, i;
float zoom;
g_return_val_if_fail (sheet != NULL, TRUE);
if (obj == NULL)
return TRUE;
......@@ -126,6 +128,8 @@ ms_excel_sheet_realize_objs (ExcelSheet *sheet)
{
GList *l;
g_return_if_fail (sheet != NULL);
for (l = sheet->obj_queue; l; l = g_list_next (l))
ms_obj_realize (l->data, sheet->wb, sheet);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment