Difference between revisions of "VML"

From Apache OpenOffice Wiki
Jump to: navigation, search
Line 53: Line 53:
 
We can get the VML parser under \oox\source\vml, there are several parts for VML shape handler. Including:
 
We can get the VML parser under \oox\source\vml, there are several parts for VML shape handler. Including:
  
     vmldrawing.cxx              -
+
     vmldrawing.cxx              -   Including: class Drawing, the VML drawing page that contains this shape
     vmldrawingfragment.cxx      -
+
     vmldrawingfragment.cxx      -   Including: class DrawingFragment, used to handle the vml shape context
     vmlformatting.cxx          -
+
     vmlformatting.cxx          -  
 
     vmlinputstream.cxx          -
 
     vmlinputstream.cxx          -
     vmlshape.cxx                -
+
     vmlshape.cxx                -   Including: class ShapeBase, used to handle vml shape related properties and create XShape
     vmlshapecontainer.cxx      -
+
     vmlshapecontainer.cxx      -   Including: class ShapeContainer, used to hold all vml related information, like: shape types and shapes
     vmlshapecontext.cxx        -
+
     vmlshapecontext.cxx        -   Including: class ShapeContext, used to be as vml shape context handler to parser vml shape properties from ooxml file
     vmltextbox.cxx              -
+
     vmltextbox.cxx              -   Including: class TextBox, used to handle textbox related information
     vmltextboxcontext.cxx      -
+
     vmltextboxcontext.cxx      -   Including: class TextBoxContext, used to be as vml textbox context handler to parser vml textbox properties from ooxml file
  
 
But the docx import filter is put under \writerfilter. so there are connections for \writerfitler to call \oox to parser the vml shape related.
 
But the docx import filter is put under \writerfilter. so there are connections for \writerfitler to call \oox to parser the vml shape related.

Revision as of 01:46, 18 September 2012

VML is a language for defining graphical objects in cases where DrawingML does not apply in Office Open XML, such as text boxes and shapes in WordprocessingML and comments and controls in SpreadsheetML.

VML is a legacy format originally introduced with Office 2000 and is existing mainly for backwards compatibility reasons. The DrawingML format is a newer and richer format created with the goal of eventually replacing any uses of VML in the Office Open XML formats.

VML Usage in the Office Open XML Format

WordprocessingML OfficeArt Shapes

Office Art shape is defined as a template-based shape in VML.

For example: We have 2 shapes in Word 2007, as below:

Template-BasedShape.png

And the OOXML description for this part is as below:

Tem-baseShapeXML.png

In the OOXML file, the <v:shapetype> defines the shape's path information, and the <v:shape> defines style related information. And also the property type defined in <v:shape> means current shape refer to which of the shape type definition. And also, different shape in one document may refer to the same shape type if they have same layout, but with different style only.

WordprocessingML Text Box

Text Box created in MS Office 2007/2010 are described as VML format also, with the text information embeded in VML shape description.

For example, we have a file with a text box in it:

Textbox.png

And the VML format saved in OOXML files is as blow:

TextboxXML.png

From the OOXML definition above, the <v:textbox> part hold the text information and also format information in it to mark that it's a VML text box in the file

SpreadsheetML Comments

Comments created by Excel 2007/2010 are described as VML format in MS OOXML, and separated from SpreadsheetML.

For example, we have a xlsx file with a comment in as below:

XlsxComments.png

And the comments information saved in the zip file as package\xl\comment[1].xml, and the drawing's information saved in the path as below:

XlsxCommentsXML.png


VML Parser data structure

We can get the VML parser under \oox\source\vml, there are several parts for VML shape handler. Including:

   vmldrawing.cxx              -   Including: class Drawing, the VML drawing page that contains this shape
   vmldrawingfragment.cxx      -   Including: class DrawingFragment, used to handle the vml shape context
   vmlformatting.cxx           -    
   vmlinputstream.cxx          -
   vmlshape.cxx                -   Including: class ShapeBase, used to handle vml shape related properties and create XShape
   vmlshapecontainer.cxx       -   Including: class ShapeContainer, used to hold all vml related information, like: shape types and shapes
   vmlshapecontext.cxx         -   Including: class ShapeContext, used to be as vml shape context handler to parser vml shape properties from ooxml file
   vmltextbox.cxx              -   Including: class TextBox, used to handle textbox related information
   vmltextboxcontext.cxx       -   Including: class TextBoxContext, used to be as vml textbox context handler to parser vml textbox properties from ooxml file

But the docx import filter is put under \writerfilter. so there are connections for \writerfitler to call \oox to parser the vml shape related.

Writerfilter for VML shape import handler

OOX part for VML shape process handler

Personal tools