VsdxExport.js 72 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005
  1. /**
  2. * Export mxFile as Vsdx file
  3. */
  4. function VsdxExport(editorUi)
  5. {
  6. var that = this;
  7. var vsdxCanvas = new mxVsdxCanvas2D();
  8. var idsMap = {};
  9. var idsCounter = 1;
  10. /**
  11. * Fill the required files in vsdx format which are constants in our exporter
  12. * @param zip JSZip of vsdx file
  13. * @param pageCount The number of pages in the mxFile
  14. */
  15. function createVsdxSkeleton(zip, pageCount)
  16. {
  17. var files = {
  18. "[Content_Types].xml": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Types xmlns='http://schemas.openxmlformats.org/package/2006/content-types'><Default Extension='png' ContentType='image/png'/><Default Extension='jpg' ContentType='image/jpeg'/><Default Extension='jpeg' ContentType='image/jpeg'/><Default Extension='svg' ContentType='image/svg+xml'/><Default Extension='bmp' ContentType='image/bmp'/><Default Extension='gif' ContentType='image/gif'/><Default Extension='emf' ContentType='image/x-emf' /><Default Extension='rels' ContentType='application/vnd.openxmlformats-package.relationships+xml' /><Default Extension='xml' ContentType='application/xml' /><Override PartName='/docProps/app.xml' ContentType='application/vnd.openxmlformats-officedocument.extended-properties+xml' /><Override PartName='/docProps/core.xml' ContentType='application/vnd.openxmlformats-package.core-properties+xml' /><Override PartName='/docProps/custom.xml' ContentType='application/vnd.openxmlformats-officedocument.custom-properties+xml' /><Override PartName='/visio/document.xml' ContentType='application/vnd.ms-visio.drawing.main+xml' /><Override PartName='/visio/masters/masters.xml' ContentType='application/vnd.ms-visio.masters+xml' /><Override PartName='/visio/masters/master1.xml' ContentType='application/vnd.ms-visio.master+xml'/><Override PartName='/visio/pages/page1.xml' ContentType='application/vnd.ms-visio.page+xml' /><Override PartName='/visio/pages/pages.xml' ContentType='application/vnd.ms-visio.pages+xml' /><Override PartName='/visio/windows.xml' ContentType='application/vnd.ms-visio.windows+xml' /></Types>",
  19. "_rels/.rels" : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Relationships xmlns='http://schemas.openxmlformats.org/package/2006/relationships'><Relationship Id='rId1' Type='http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties' Target='docProps/core.xml' /><Relationship Id='rId2' Type='http://schemas.microsoft.com/visio/2010/relationships/document' Target='visio/document.xml' /><Relationship Id='rId3' Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties' Target='docProps/custom.xml' /><Relationship Id='rId4' Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties' Target='docProps/app.xml' /></Relationships>",
  20. "docProps/app.xml" : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Properties xmlns='http://schemas.openxmlformats.org/officeDocument/2006/extended-properties' xmlns:vt='http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes'><Application>Microsoft Visio</Application><AppVersion>15.0000</AppVersion><Template /><Manager /><Company /><HyperlinkBase /></Properties>",
  21. "docProps/core.xml" : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><cp:coreProperties xmlns:cp='http://schemas.openxmlformats.org/package/2006/metadata/core-properties' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:dcterms='http://purl.org/dc/terms/' xmlns:dcmitype='http://purl.org/dc/dcmitype/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><dc:title /><dc:subject /><dc:creator /><cp:keywords /><dc:description /><cp:category /><dc:language>en-US</dc:language></cp:coreProperties>",
  22. "docProps/custom.xml" : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Properties xmlns='http://schemas.openxmlformats.org/officeDocument/2006/custom-properties' xmlns:vt='http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes' />",
  23. "visio/document.xml": "<?xml version='1.0' encoding='utf-8' ?><VisioDocument xmlns='http://schemas.microsoft.com/office/visio/2012/main' xmlns:r='http://schemas.openxmlformats.org/officeDocument/2006/relationships' xml:space='preserve'><DocumentSettings TopPage='0' DefaultTextStyle='3' DefaultLineStyle='3' DefaultFillStyle='3' DefaultGuideStyle='4'><GlueSettings>9</GlueSettings><SnapSettings>65847</SnapSettings><SnapExtensions>34</SnapExtensions><SnapAngles/><DynamicGridEnabled>1</DynamicGridEnabled><ProtectStyles>0</ProtectStyles><ProtectShapes>0</ProtectShapes><ProtectMasters>0</ProtectMasters><ProtectBkgnds>0</ProtectBkgnds></DocumentSettings><Colors><ColorEntry IX='24' RGB='#000000'/><ColorEntry IX='25' RGB='#FFFFFF'/><ColorEntry IX='26' RGB='#FF0000'/><ColorEntry IX='27' RGB='#00FF00'/><ColorEntry IX='28' RGB='#0000FF'/><ColorEntry IX='29' RGB='#FFFF00'/><ColorEntry IX='30' RGB='#FF00FF'/><ColorEntry IX='31' RGB='#00FFFF'/><ColorEntry IX='32' RGB='#800000'/><ColorEntry IX='33' RGB='#008000'/><ColorEntry IX='34' RGB='#000080'/><ColorEntry IX='35' RGB='#808000'/><ColorEntry IX='36' RGB='#800080'/><ColorEntry IX='37' RGB='#008080'/><ColorEntry IX='38' RGB='#C0C0C0'/><ColorEntry IX='39' RGB='#E6E6E6'/><ColorEntry IX='40' RGB='#CDCDCD'/><ColorEntry IX='41' RGB='#B3B3B3'/><ColorEntry IX='42' RGB='#9A9A9A'/><ColorEntry IX='43' RGB='#808080'/><ColorEntry IX='44' RGB='#666666'/><ColorEntry IX='45' RGB='#4D4D4D'/><ColorEntry IX='46' RGB='#333333'/><ColorEntry IX='47' RGB='#1A1A1A'/><ColorEntry IX='48' RGB='#7F7F7F'/><ColorEntry IX='49' RGB='#99004D'/><ColorEntry IX='50' RGB='#FF0080'/><ColorEntry IX='51' RGB='#CC0066'/></Colors><FaceNames><FaceName NameU='Calibri' UnicodeRanges='-536859905 -1073732485 9 0' CharSets='536871423 0' Panose='2 15 5 2 2 2 4 3 2 4' Flags='325'/></FaceNames><StyleSheets><StyleSheet ID='0' NameU='No Style' IsCustomNameU='1' Name='No Style' IsCustomName='1'><Cell N='EnableLineProps' V='1'/><Cell N='EnableFillProps' V='1'/><Cell N='EnableTextProps' V='1'/><Cell N='HideForApply' V='0'/><Cell N='LineWeight' V='0.01041666666666667'/><Cell N='LineColor' V='0'/><Cell N='LinePattern' V='1'/><Cell N='Rounding' V='0'/><Cell N='EndArrowSize' V='2'/><Cell N='BeginArrow' V='0'/><Cell N='EndArrow' V='0'/><Cell N='LineCap' V='0'/><Cell N='BeginArrowSize' V='2'/><Cell N='LineColorTrans' V='0'/><Cell N='CompoundType' V='0'/><Cell N='FillForegnd' V='1'/><Cell N='FillBkgnd' V='0'/><Cell N='FillPattern' V='1'/><Cell N='ShdwForegnd' V='0'/><Cell N='ShdwPattern' V='0'/><Cell N='FillForegndTrans' V='0'/><Cell N='FillBkgndTrans' V='0'/><Cell N='ShdwForegndTrans' V='0'/><Cell N='ShapeShdwType' V='0'/><Cell N='ShapeShdwOffsetX' V='0'/><Cell N='ShapeShdwOffsetY' V='0'/><Cell N='ShapeShdwObliqueAngle' V='0'/><Cell N='ShapeShdwScaleFactor' V='1'/><Cell N='ShapeShdwBlur' V='0'/><Cell N='ShapeShdwShow' V='0'/><Cell N='LeftMargin' V='0'/><Cell N='RightMargin' V='0'/><Cell N='TopMargin' V='0'/><Cell N='BottomMargin' V='0'/><Cell N='VerticalAlign' V='1'/><Cell N='TextBkgnd' V='0'/><Cell N='DefaultTabStop' V='0.5'/><Cell N='TextDirection' V='0'/><Cell N='TextBkgndTrans' V='0'/><Cell N='LockWidth' V='0'/><Cell N='LockHeight' V='0'/><Cell N='LockMoveX' V='0'/><Cell N='LockMoveY' V='0'/><Cell N='LockAspect' V='0'/><Cell N='LockDelete' V='0'/><Cell N='LockBegin' V='0'/><Cell N='LockEnd' V='0'/><Cell N='LockRotate' V='0'/><Cell N='LockCrop' V='0'/><Cell N='LockVtxEdit' V='0'/><Cell N='LockTextEdit' V='0'/><Cell N='LockFormat' V='0'/><Cell N='LockGroup' V='0'/><Cell N='LockCalcWH' V='0'/><Cell N='LockSelect' V='0'/><Cell N='LockCustProp' V='0'/><Cell N='LockFromGroupFormat' V='0'/><Cell N='LockThemeColors' V='0'/><Cell N='LockThemeEffects' V='0'/><Cell N='LockThemeConnectors' V='0'/><Cell N='LockThemeFonts' V='0'/><Cell N='LockThemeIndex' V='0'/><Cell N='LockReplace' V='0'/><Cell N='LockVariation' V='0'/><Cell N='NoObjHandles' V='0'/><Cell N='NonPrinting' V='0'/><Cell N='NoCtlHandles' V='0'/><Cell N='NoAlignBox' V='0'/><Cell N='UpdateAlignBox' V='0'/><Cell N='HideText' V='0'/><Cell N='DynFeedback' V='0'/><Cell N='GlueType' V='0'/><Cell N='WalkPreference' V='0'/><Cell N='BegTrigger' V='0' F='No Formula'/><Cell N='EndTrigger' V='0' F='No Formula'/><Cell N='ObjType' V='0'/><Cell N='Comment' V=''/><Cell N='IsDropSource' V='0'/><Cell N='NoLiveDynamics' V='0'/><Cell N='LocalizeMerge' V='0'/><Cell N='NoProofing' V='0'/><Cell N='Calendar' V='0'/><Cell N='LangID' V='en-US'/><Cell N='ShapeKeywords' V=''/><Cell N='DropOnPageScale' V='1'/><Cell N='TheData' V='0' F='No Formula'/><Cell N='TheText' V='0' F='No Formula'/><Cell N='EventDblClick' V='0' F='No Formula'/><Cell N='EventXFMod' V='0' F='No Formula'/><Cell N='EventDrop' V='0' F='No Formula'/><Cell N='EventMultiDrop' V='0' F='No Formula'/><Cell N='HelpTopic' V=''/><Cell N='Copyright' V=''/><Cell N='LayerMember' V=''/><Cell N='XRulerDensity' V='32'/><Cell N='YRulerDensity' V='32'/><Cell N='XRulerOrigin' V='0'/><Cell N='YRulerOrigin' V='0'/><Cell N='XGridDensity' V='8'/><Cell N='YGridDensity' V='8'/><Cell N='XGridSpacing' V='0'/><Cell N='YGridSpacing' V='0'/><Cell N='XGridOrigin' V='0'/><Cell N='YGridOrigin' V='0'/><Cell N='Gamma' V='1'/><Cell N='Contrast' V='0.5'/><Cell N='Brightness' V='0.5'/><Cell N='Sharpen' V='0'/><Cell N='Blur' V='0'/><Cell N='Denoise' V='0'/><Cell N='Transparency' V='0'/><Cell N='SelectMode' V='1'/><Cell N='DisplayMode' V='2'/><Cell N='IsDropTarget' V='0'/><Cell N='IsSnapTarget' V='1'/><Cell N='IsTextEditTarget' V='1'/><Cell N='DontMoveChildren' V='0'/><Cell N='ShapePermeableX' V='0'/><Cell N='ShapePermeableY' V='0'/><Cell N='ShapePermeablePlace' V='0'/><Cell N='Relationships' V='0'/><Cell N='ShapeFixedCode' V='0'/><Cell N='ShapePlowCode' V='0'/><Cell N='ShapeRouteStyle' V='0'/><Cell N='ShapePlaceStyle' V='0'/><Cell N='ConFixedCode' V='0'/><Cell N='ConLineJumpCode' V='0'/><Cell N='ConLineJumpStyle' V='0'/><Cell N='ConLineJumpDirX' V='0'/><Cell N='ConLineJumpDirY' V='0'/><Cell N='ShapePlaceFlip' V='0'/><Cell N='ConLineRouteExt' V='0'/><Cell N='ShapeSplit' V='0'/><Cell N='ShapeSplittable' V='0'/><Cell N='DisplayLevel' V='0'/><Cell N='ResizePage' V='0'/><Cell N='EnableGrid' V='0'/><Cell N='DynamicsOff' V='0'/><Cell N='CtrlAsInput' V='0'/><Cell N='AvoidPageBreaks' V='0'/><Cell N='PlaceStyle' V='0'/><Cell N='RouteStyle' V='0'/><Cell N='PlaceDepth' V='0'/><Cell N='PlowCode' V='0'/><Cell N='LineJumpCode' V='1'/><Cell N='LineJumpStyle' V='0'/><Cell N='PageLineJumpDirX' V='0'/><Cell N='PageLineJumpDirY' V='0'/><Cell N='LineToNodeX' V='0.125'/><Cell N='LineToNodeY' V='0.125'/><Cell N='BlockSizeX' V='0.25'/><Cell N='BlockSizeY' V='0.25'/><Cell N='AvenueSizeX' V='0.375'/><Cell N='AvenueSizeY' V='0.375'/><Cell N='LineToLineX' V='0.125'/><Cell N='LineToLineY' V='0.125'/><Cell N='LineJumpFactorX' V='0.66666666666667'/><Cell N='LineJumpFactorY' V='0.66666666666667'/><Cell N='LineAdjustFrom' V='0'/><Cell N='LineAdjustTo' V='0'/><Cell N='PlaceFlip' V='0'/><Cell N='LineRouteExt' V='0'/><Cell N='PageShapeSplit' V='0'/><Cell N='PageLeftMargin' V='0.25'/><Cell N='PageRightMargin' V='0.25'/><Cell N='PageTopMargin' V='0.25'/><Cell N='PageBottomMargin' V='0.25'/><Cell N='ScaleX' V='1'/><Cell N='ScaleY' V='1'/><Cell N='PagesX' V='1'/><Cell N='PagesY' V='1'/><Cell N='CenterX' V='0'/><Cell N='CenterY' V='0'/><Cell N='OnPage' V='0'/><Cell N='PrintGrid' V='0'/><Cell N='PrintPageOrientation' V='1'/><Cell N='PaperKind' V='1'/><Cell N='PaperSource' V='7'/><Cell N='QuickStyleLineColor' V='100'/><Cell N='QuickStyleFillColor' V='100'/><Cell N='QuickStyleShadowColor' V='100'/><Cell N='QuickStyleFontColor' V='100'/><Cell N='QuickStyleLineMatrix' V='100'/><Cell N='QuickStyleFillMatrix' V='100'/><Cell N='QuickStyleEffectsMatrix' V='100'/><Cell N='QuickStyleFontMatrix' V='100'/><Cell N='QuickStyleType' V='0'/><Cell N='QuickStyleVariation' V='0'/><Cell N='LineGradientDir' V='0'/><Cell N='LineGradientAngle' V='1.5707963267949'/><Cell N='FillGradientDir' V='0'/><Cell N='FillGradientAngle' V='1.5707963267949'/><Cell N='LineGradientEnabled' V='0'/><Cell N='FillGradientEnabled' V='0'/><Cell N='RotateGradientWithShape' V='1'/><Cell N='UseGroupGradient' V='0'/><Cell N='BevelTopType' V='0'/><Cell N='BevelTopWidth' V='0'/><Cell N='BevelTopHeight' V='0'/><Cell N='BevelBottomType' V='0'/><Cell N='BevelBottomWidth' V='0'/><Cell N='BevelBottomHeight' V='0'/><Cell N='BevelDepthColor' V='1'/><Cell N='BevelDepthSize' V='0'/><Cell N='BevelContourColor' V='0'/><Cell N='BevelContourSize' V='0'/><Cell N='BevelMaterialType' V='0'/><Cell N='BevelLightingType' V='0'/><Cell N='BevelLightingAngle' V='0'/><Cell N='RotationXAngle' V='0'/><Cell N='RotationYAngle' V='0'/><Cell N='RotationZAngle' V='0'/><Cell N='RotationType' V='0'/><Cell N='Perspective' V='0'/><Cell N='DistanceFromGround' V='0'/><Cell N='KeepTextFlat' V='0'/><Cell N='ReflectionTrans' V='0'/><Cell N='ReflectionSize' V='0'/><Cell N='ReflectionDist' V='0'/><Cell N='ReflectionBlur' V='0'/><Cell N='GlowColor' V='1'/><Cell N='GlowColorTrans' V='0'/><Cell N='GlowSize' V='0'/><Cell N='SoftEdgesSize' V='0'/><Cell N='SketchSeed' V='0'/><Cell N='SketchEnabled' V='0'/><Cell N='SketchAmount' V='5'/><Cell N='SketchLineWeight' V='0.04166666666666666' U='PT'/><Cell N='SketchLineChange' V='0.14'/><Cell N='SketchFillChange' V='0.1'/><Cell N='ColorSchemeIndex' V='0'/><Cell N='EffectSchemeIndex' V='0'/><Cell N='ConnectorSchemeIndex' V='0'/><Cell N='FontSchemeIndex' V='0'/><Cell N='ThemeIndex' V='0'/><Cell N='VariationColorIndex' V='0'/><Cell N='VariationStyleIndex' V='0'/><Cell N='EmbellishmentIndex' V='0'/><Cell N='ReplaceLockShapeData' V='0'/><Cell N='ReplaceLockText' V='0'/><Cell N='ReplaceLockFormat' V='0'/><Cell N='ReplaceCopyCells' V='0' U='BOOL' F='No Formula'/><Cell N='PageWidth' V='0' F='No Formula'/><Cell N='PageHeight' V='0' F='No Formula'/><Cell N='ShdwOffsetX' V='0' F='No Formula'/><Cell N='ShdwOffsetY' V='0' F='No Formula'/><Cell N='PageScale' V='0' U='IN_F' F='No Formula'/><Cell N='DrawingScale' V='0' U='IN_F' F='No Formula'/><Cell N='DrawingSizeType' V='0' F='No Formula'/><Cell N='DrawingScaleType' V='0' F='No Formula'/><Cell N='InhibitSnap' V='0' F='No Formula'/><Cell N='PageLockReplace' V='0' U='BOOL' F='No Formula'/><Cell N='PageLockDuplicate' V='0' U='BOOL' F='No Formula'/><Cell N='UIVisibility' V='0' F='No Formula'/><Cell N='ShdwType' V='0' F='No Formula'/><Cell N='ShdwObliqueAngle' V='0' F='No Formula'/><Cell N='ShdwScaleFactor' V='0' F='No Formula'/><Cell N='DrawingResizeType' V='0' F='No Formula'/><Section N='Character'><Row IX='0'><Cell N='Font' V='Calibri'/><Cell N='Color' V='0'/><Cell N='Style' V='0'/><Cell N='Case' V='0'/><Cell N='Pos' V='0'/><Cell N='FontScale' V='1'/><Cell N='Size' V='0.1666666666666667'/><Cell N='DblUnderline' V='0'/><Cell N='Overline' V='0'/><Cell N='Strikethru' V='0'/><Cell N='DoubleStrikethrough' V='0'/><Cell N='Letterspace' V='0'/><Cell N='ColorTrans' V='0'/><Cell N='AsianFont' V='0'/><Cell N='ComplexScriptFont' V='0'/><Cell N='ComplexScriptSize' V='-1'/><Cell N='LangID' V='en-US'/></Row></Section><Section N='Paragraph'><Row IX='0'><Cell N='IndFirst' V='0'/><Cell N='IndLeft' V='0'/><Cell N='IndRight' V='0'/><Cell N='SpLine' V='-1.2'/><Cell N='SpBefore' V='0'/><Cell N='SpAfter' V='0'/><Cell N='HorzAlign' V='1'/><Cell N='Bullet' V='0'/><Cell N='BulletStr' V=''/><Cell N='BulletFont' V='0'/><Cell N='BulletFontSize' V='-1'/><Cell N='TextPosAfterBullet' V='0'/><Cell N='Flags' V='0'/></Row></Section><Section N='Tabs'><Row IX='0'/></Section><Section N='LineGradient'><Row IX='0'><Cell N='GradientStopColor' V='1'/><Cell N='GradientStopColorTrans' V='0'/><Cell N='GradientStopPosition' V='0'/></Row></Section><Section N='FillGradient'><Row IX='0'><Cell N='GradientStopColor' V='1'/><Cell N='GradientStopColorTrans' V='0'/><Cell N='GradientStopPosition' V='0'/></Row></Section></StyleSheet><StyleSheet ID='1' NameU='Text Only' IsCustomNameU='1' Name='Text Only' IsCustomName='1' LineStyle='3' FillStyle='3' TextStyle='3'><Cell N='EnableLineProps' V='1'/><Cell N='EnableFillProps' V='1'/><Cell N='EnableTextProps' V='1'/><Cell N='HideForApply' V='0'/><Cell N='LineWeight' V='Themed' F='Inh'/><Cell N='LineColor' V='Themed' F='Inh'/><Cell N='LinePattern' V='Themed' F='Inh'/><Cell N='Rounding' V='Themed' F='Inh'/><Cell N='EndArrowSize' V='2' F='Inh'/><Cell N='BeginArrow' V='0' F='Inh'/><Cell N='EndArrow' V='0' F='Inh'/><Cell N='LineCap' V='Themed' F='Inh'/><Cell N='BeginArrowSize' V='2' F='Inh'/><Cell N='LineColorTrans' V='Themed' F='Inh'/><Cell N='CompoundType' V='Themed' F='Inh'/><Cell N='FillForegnd' V='Themed' F='Inh'/><Cell N='FillBkgnd' V='Themed' F='Inh'/><Cell N='FillPattern' V='Themed' F='Inh'/><Cell N='ShdwForegnd' V='Themed' F='Inh'/><Cell N='ShdwPattern' V='Themed' F='Inh'/><Cell N='FillForegndTrans' V='Themed' F='Inh'/><Cell N='FillBkgndTrans' V='Themed' F='Inh'/><Cell N='ShdwForegndTrans' V='Themed' F='Inh'/><Cell N='ShapeShdwType' V='Themed' F='Inh'/><Cell N='ShapeShdwOffsetX' V='Themed' F='Inh'/><Cell N='ShapeShdwOffsetY' V='Themed' F='Inh'/><Cell N='ShapeShdwObliqueAngle' V='Themed' F='Inh'/><Cell N='ShapeShdwScaleFactor' V='Themed' F='Inh'/><Cell N='ShapeShdwBlur' V='Themed' F='Inh'/><Cell N='ShapeShdwShow' V='0' F='Inh'/><Cell N='LeftMargin' V='0'/><Cell N='RightMargin' V='0'/><Cell N='TopMargin' V='0'/><Cell N='BottomMargin' V='0'/><Cell N='VerticalAlign' V='0'/><Cell N='TextBkgnd' V='0'/><Cell N='DefaultTabStop' V='0.5' F='Inh'/><Cell N='TextDirection' V='0' F='Inh'/><Cell N='TextBkgndTrans' V='0' F='Inh'/><Cell N='LineGradientDir' V='Themed' F='Inh'/><Cell N='LineGradientAngle' V='Themed' F='Inh'/><Cell N='FillGradientDir' V='Themed' F='Inh'/><Cell N='FillGradientAngle' V='Themed' F='Inh'/><Cell N='LineGradientEnabled' V='Themed' F='Inh'/><Cell N='FillGradientEnabled' V='Themed' F='Inh'/><Cell N='RotateGradientWithShape' V='Themed' F='Inh'/><Cell N='UseGroupGradient' V='Themed' F='Inh'/><Section N='Paragraph'><Row IX='0'><Cell N='IndFirst' V='0' F='Inh'/><Cell N='IndLeft' V='0' F='Inh'/><Cell N='IndRight' V='0' F='Inh'/><Cell N='SpLine' V='-1.2' F='Inh'/><Cell N='SpBefore' V='0' F='Inh'/><Cell N='SpAfter' V='0' F='Inh'/><Cell N='HorzAlign' V='0'/><Cell N='Bullet' V='0' F='Inh'/><Cell N='BulletStr' V='' F='Inh'/><Cell N='BulletFont' V='0' F='Inh'/><Cell N='BulletFontSize' V='-1' F='Inh'/><Cell N='TextPosAfterBullet' V='0' F='Inh'/><Cell N='Flags' V='0' F='Inh'/></Row></Section></StyleSheet><StyleSheet ID='2' NameU='None' IsCustomNameU='1' Name='None' IsCustomName='1' LineStyle='3' FillStyle='3' TextStyle='3'><Cell N='EnableLineProps' V='1'/><Cell N='EnableFillProps' V='1'/><Cell N='EnableTextProps' V='1'/><Cell N='HideForApply' V='0'/><Cell N='LineWeight' V='Themed' F='Inh'/><Cell N='LineColor' V='Themed' F='Inh'/><Cell N='LinePattern' V='0'/><Cell N='Rounding' V='Themed' F='Inh'/><Cell N='EndArrowSize' V='2' F='Inh'/><Cell N='BeginArrow' V='0' F='Inh'/><Cell N='EndArrow' V='0' F='Inh'/><Cell N='LineCap' V='Themed' F='Inh'/><Cell N='BeginArrowSize' V='2' F='Inh'/><Cell N='LineColorTrans' V='Themed' F='Inh'/><Cell N='CompoundType' V='Themed' F='Inh'/><Cell N='FillForegnd' V='Themed' F='Inh'/><Cell N='FillBkgnd' V='Themed' F='Inh'/><Cell N='FillPattern' V='0'/><Cell N='ShdwForegnd' V='Themed' F='Inh'/><Cell N='ShdwPattern' V='Themed' F='Inh'/><Cell N='FillForegndTrans' V='Themed' F='Inh'/><Cell N='FillBkgndTrans' V='Themed' F='Inh'/><Cell N='ShdwForegndTrans' V='Themed' F='Inh'/><Cell N='ShapeShdwType' V='Themed' F='Inh'/><Cell N='ShapeShdwOffsetX' V='Themed' F='Inh'/><Cell N='ShapeShdwOffsetY' V='Themed' F='Inh'/><Cell N='ShapeShdwObliqueAngle' V='Themed' F='Inh'/><Cell N='ShapeShdwScaleFactor' V='Themed' F='Inh'/><Cell N='ShapeShdwBlur' V='Themed' F='Inh'/><Cell N='ShapeShdwShow' V='0' F='Inh'/><Cell N='LineGradientDir' V='Themed' F='Inh'/><Cell N='LineGradientAngle' V='Themed' F='Inh'/><Cell N='FillGradientDir' V='Themed' F='Inh'/><Cell N='FillGradientAngle' V='Themed' F='Inh'/><Cell N='LineGradientEnabled' V='0'/><Cell N='FillGradientEnabled' V='0'/><Cell N='RotateGradientWithShape' V='Themed' F='Inh'/><Cell N='UseGroupGradient' V='Themed' F='Inh'/><Cell N='QuickStyleLineColor' V='100' F='Inh'/><Cell N='QuickStyleFillColor' V='100' F='Inh'/><Cell N='QuickStyleShadowColor' V='100' F='Inh'/><Cell N='QuickStyleFontColor' V='100' F='Inh'/><Cell N='QuickStyleLineMatrix' V='100' F='Inh'/><Cell N='QuickStyleFillMatrix' V='100' F='Inh'/><Cell N='QuickStyleEffectsMatrix' V='0' F='GUARD(0)'/><Cell N='QuickStyleFontMatrix' V='100' F='Inh'/><Cell N='QuickStyleType' V='0' F='Inh'/><Cell N='QuickStyleVariation' V='2'/></StyleSheet><StyleSheet ID='3' NameU='Normal' IsCustomNameU='1' Name='Normal' IsCustomName='1' LineStyle='6' FillStyle='6' TextStyle='6'><Cell N='EnableLineProps' V='1'/><Cell N='EnableFillProps' V='1'/><Cell N='EnableTextProps' V='1'/><Cell N='HideForApply' V='0'/><Cell N='LeftMargin' V='0.05555555555555555' U='PT'/><Cell N='RightMargin' V='0.05555555555555555' U='PT'/><Cell N='TopMargin' V='0.05555555555555555' U='PT'/><Cell N='BottomMargin' V='0.05555555555555555' U='PT'/><Cell N='VerticalAlign' V='1' F='Inh'/><Cell N='TextBkgnd' V='0' F='Inh'/><Cell N='DefaultTabStop' V='0.5' F='Inh'/><Cell N='TextDirection' V='0' F='Inh'/><Cell N='TextBkgndTrans' V='0' F='Inh'/></StyleSheet><StyleSheet ID='4' NameU='Guide' IsCustomNameU='1' Name='Guide' IsCustomName='1' LineStyle='3' FillStyle='3' TextStyle='3'><Cell N='EnableLineProps' V='1'/><Cell N='EnableFillProps' V='1'/><Cell N='EnableTextProps' V='1'/><Cell N='HideForApply' V='0'/><Cell N='LineWeight' V='0' U='PT'/><Cell N='LineColor' V='#7f7f7f'/><Cell N='LinePattern' V='23'/><Cell N='Rounding' V='Themed' F='Inh'/><Cell N='EndArrowSize' V='2' F='Inh'/><Cell N='BeginArrow' V='0' F='Inh'/><Cell N='EndArrow' V='0' F='Inh'/><Cell N='LineCap' V='Themed' F='Inh'/><Cell N='BeginArrowSize' V='2' F='Inh'/><Cell N='LineColorTrans' V='Themed' F='Inh'/><Cell N='CompoundType' V='Themed' F='Inh'/><Cell N='FillForegnd' V='Themed' F='Inh'/><Cell N='FillBkgnd' V='Themed' F='Inh'/><Cell N='FillPattern' V='0'/><Cell N='ShdwForegnd' V='Themed' F='Inh'/><Cell N='ShdwPattern' V='Themed' F='Inh'/><Cell N='FillForegndTrans' V='Themed' F='Inh'/><Cell N='FillBkgndTrans' V='Themed' F='Inh'/><Cell N='ShdwForegndTrans' V='Themed' F='Inh'/><Cell N='ShapeShdwType' V='Themed' F='Inh'/><Cell N='ShapeShdwOffsetX' V='Themed' F='Inh'/><Cell N='ShapeShdwOffsetY' V='Themed' F='Inh'/><Cell N='ShapeShdwObliqueAngle' V='Themed' F='Inh'/><Cell N='ShapeShdwScaleFactor' V='Themed' F='Inh'/><Cell N='ShapeShdwBlur' V='Themed' F='Inh'/><Cell N='ShapeShdwShow' V='0' F='Inh'/><Cell N='LineGradientDir' V='Themed' F='Inh'/><Cell N='LineGradientAngle' V='Themed' F='Inh'/><Cell N='FillGradientDir' V='Themed' F='Inh'/><Cell N='FillGradientAngle' V='Themed' F='Inh'/><Cell N='LineGradientEnabled' V='0'/><Cell N='FillGradientEnabled' V='0'/><Cell N='RotateGradientWithShape' V='Themed' F='Inh'/><Cell N='UseGroupGradient' V='Themed' F='Inh'/><Cell N='LeftMargin' V='0.05555555555555555' U='PT' F='Inh'/><Cell N='RightMargin' V='0.05555555555555555' U='PT' F='Inh'/><Cell N='TopMargin' V='0'/><Cell N='BottomMargin' V='0'/><Cell N='VerticalAlign' V='2'/><Cell N='TextBkgnd' V='0' F='Inh'/><Cell N='DefaultTabStop' V='0.5' F='Inh'/><Cell N='TextDirection' V='0' F='Inh'/><Cell N='TextBkgndTrans' V='0' F='Inh'/><Cell N='NoObjHandles' V='0' F='Inh'/><Cell N='NonPrinting' V='1'/><Cell N='NoCtlHandles' V='0' F='Inh'/><Cell N='NoAlignBox' V='0' F='Inh'/><Cell N='UpdateAlignBox' V='0' F='Inh'/><Cell N='HideText' V='0' F='Inh'/><Cell N='DynFeedback' V='0' F='Inh'/><Cell N='GlueType' V='0' F='Inh'/><Cell N='WalkPreference' V='0' F='Inh'/><Cell N='BegTrigger' V='0' F='No Formula'/><Cell N='EndTrigger' V='0' F='No Formula'/><Cell N='ObjType' V='0' F='Inh'/><Cell N='Comment' V='' F='Inh'/><Cell N='IsDropSource' V='0' F='Inh'/><Cell N='NoLiveDynamics' V='0' F='Inh'/><Cell N='LocalizeMerge' V='0' F='Inh'/><Cell N='NoProofing' V='0' F='Inh'/><Cell N='Calendar' V='0' F='Inh'/><Cell N='LangID' V='en-US' F='Inh'/><Cell N='ShapeKeywords' V='' F='Inh'/><Cell N='DropOnPageScale' V='1' F='Inh'/><Cell N='ShapePermeableX' V='1'/><Cell N='ShapePermeableY' V='1'/><Cell N='ShapePermeablePlace' V='1'/><Cell N='Relationships' V='0' F='Inh'/><Cell N='ShapeFixedCode' V='0' F='Inh'/><Cell N='ShapePlowCode' V='0' F='Inh'/><Cell N='ShapeRouteStyle' V='0' F='Inh'/><Cell N='ShapePlaceStyle' V='0' F='Inh'/><Cell N='ConFixedCode' V='0' F='Inh'/><Cell N='ConLineJumpCode' V='0' F='Inh'/><Cell N='ConLineJumpStyle' V='0' F='Inh'/><Cell N='ConLineJumpDirX' V='0' F='Inh'/><Cell N='ConLineJumpDirY' V='0' F='Inh'/><Cell N='ShapePlaceFlip' V='0' F='Inh'/><Cell N='ConLineRouteExt' V='0' F='Inh'/><Cell N='ShapeSplit' V='0' F='Inh'/><Cell N='ShapeSplittable' V='0' F='Inh'/><Cell N='DisplayLevel' V='0' F='Inh'/><Section N='Character'><Row IX='0'><Cell N='Font' V='Themed' F='Inh'/><Cell N='Color' V='4'/><Cell N='Style' V='Themed' F='Inh'/><Cell N='Case' V='0' F='Inh'/><Cell N='Pos' V='0' F='Inh'/><Cell N='FontScale' V='1' F='Inh'/><Cell N='Size' V='0.125'/><Cell N='DblUnderline' V='0' F='Inh'/><Cell N='Overline' V='0' F='Inh'/><Cell N='Strikethru' V='0' F='Inh'/><Cell N='DoubleStrikethrough' V='0' F='Inh'/><Cell N='Letterspace' V='0' F='Inh'/><Cell N='ColorTrans' V='0' F='Inh'/><Cell N='AsianFont' V='Themed' F='Inh'/><Cell N='ComplexScriptFont' V='Themed' F='Inh'/><Cell N='ComplexScriptSize' V='-1' F='Inh'/><Cell N='LangID' V='en-US' F='Inh'/></Row></Section></StyleSheet><StyleSheet ID='6' NameU='Theme' IsCustomNameU='1' Name='Theme' IsCustomName='1' LineStyle='0' FillStyle='0' TextStyle='0'><Cell N='EnableLineProps' V='1'/><Cell N='EnableFillProps' V='1'/><Cell N='EnableTextProps' V='1'/><Cell N='HideForApply' V='0'/><Cell N='LineWeight' V='Themed' F='THEMEVAL()'/><Cell N='LineColor' V='Themed' F='THEMEVAL()'/><Cell N='LinePattern' V='Themed' F='THEMEVAL()'/><Cell N='Rounding' V='Themed' F='THEMEVAL()'/><Cell N='EndArrowSize' V='2' F='Inh'/><Cell N='BeginArrow' V='0' F='Inh'/><Cell N='EndArrow' V='0' F='Inh'/><Cell N='LineCap' V='Themed' F='THEMEVAL()'/><Cell N='BeginArrowSize' V='2' F='Inh'/><Cell N='LineColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='CompoundType' V='Themed' F='THEMEVAL()'/><Cell N='FillForegnd' V='Themed' F='THEMEVAL()'/><Cell N='FillBkgnd' V='Themed' F='THEMEVAL()'/><Cell N='FillPattern' V='Themed' F='THEMEVAL()'/><Cell N='ShdwForegnd' V='Themed' F='THEMEVAL()'/><Cell N='ShdwPattern' V='Themed' F='THEMEVAL()'/><Cell N='FillForegndTrans' V='Themed' F='THEMEVAL()'/><Cell N='FillBkgndTrans' V='Themed' F='THEMEVAL()'/><Cell N='ShdwForegndTrans' V='Themed' F='THEMEVAL()'/><Cell N='ShapeShdwType' V='Themed' F='THEMEVAL()'/><Cell N='ShapeShdwOffsetX' V='Themed' F='THEMEVAL()'/><Cell N='ShapeShdwOffsetY' V='Themed' F='THEMEVAL()'/><Cell N='ShapeShdwObliqueAngle' V='Themed' F='THEMEVAL()'/><Cell N='ShapeShdwScaleFactor' V='Themed' F='THEMEVAL()'/><Cell N='ShapeShdwBlur' V='Themed' F='THEMEVAL()'/><Cell N='ShapeShdwShow' V='0' F='Inh'/><Cell N='LineGradientDir' V='Themed' F='THEMEVAL()'/><Cell N='LineGradientAngle' V='Themed' F='THEMEVAL()'/><Cell N='FillGradientDir' V='Themed' F='THEMEVAL()'/><Cell N='FillGradientAngle' V='Themed' F='THEMEVAL()'/><Cell N='LineGradientEnabled' V='Themed' F='THEMEVAL()'/><Cell N='FillGradientEnabled' V='Themed' F='THEMEVAL()'/><Cell N='RotateGradientWithShape' V='Themed' F='THEMEVAL()'/><Cell N='UseGroupGradient' V='Themed' F='THEMEVAL()'/><Cell N='BevelTopType' V='Themed' F='THEMEVAL()'/><Cell N='BevelTopWidth' V='Themed' F='THEMEVAL()'/><Cell N='BevelTopHeight' V='Themed' F='THEMEVAL()'/><Cell N='BevelBottomType' V='0' F='Inh'/><Cell N='BevelBottomWidth' V='0' F='Inh'/><Cell N='BevelBottomHeight' V='0' F='Inh'/><Cell N='BevelDepthColor' V='1' F='Inh'/><Cell N='BevelDepthSize' V='0' F='Inh'/><Cell N='BevelContourColor' V='Themed' F='THEMEVAL()'/><Cell N='BevelContourSize' V='Themed' F='THEMEVAL()'/><Cell N='BevelMaterialType' V='Themed' F='THEMEVAL()'/><Cell N='BevelLightingType' V='Themed' F='THEMEVAL()'/><Cell N='BevelLightingAngle' V='Themed' F='THEMEVAL()'/><Cell N='ReflectionTrans' V='Themed' F='THEMEVAL()'/><Cell N='ReflectionSize' V='Themed' F='THEMEVAL()'/><Cell N='ReflectionDist' V='Themed' F='THEMEVAL()'/><Cell N='ReflectionBlur' V='Themed' F='THEMEVAL()'/><Cell N='GlowColor' V='Themed' F='THEMEVAL()'/><Cell N='GlowColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GlowSize' V='Themed' F='THEMEVAL()'/><Cell N='SoftEdgesSize' V='Themed' F='THEMEVAL()'/><Cell N='SketchSeed' V='0' F='Inh'/><Cell N='SketchEnabled' V='Themed' F='THEMEVAL()'/><Cell N='SketchAmount' V='Themed' F='THEMEVAL()'/><Cell N='SketchLineWeight' V='Themed' F='THEMEVAL()'/><Cell N='SketchLineChange' V='Themed' F='THEMEVAL()'/><Cell N='SketchFillChange' V='Themed' F='THEMEVAL()'/><Cell N='QuickStyleLineColor' V='100'/><Cell N='QuickStyleFillColor' V='100'/><Cell N='QuickStyleShadowColor' V='100'/><Cell N='QuickStyleFontColor' V='100'/><Cell N='QuickStyleLineMatrix' V='100'/><Cell N='QuickStyleFillMatrix' V='100'/><Cell N='QuickStyleEffectsMatrix' V='100'/><Cell N='QuickStyleFontMatrix' V='100'/><Cell N='QuickStyleType' V='0' F='Inh'/><Cell N='QuickStyleVariation' V='0' F='Inh'/><Cell N='ColorSchemeIndex' V='65534'/><Cell N='EffectSchemeIndex' V='65534'/><Cell N='ConnectorSchemeIndex' V='65534'/><Cell N='FontSchemeIndex' V='65534'/><Cell N='ThemeIndex' V='65534'/><Cell N='VariationColorIndex' V='65534'/><Cell N='VariationStyleIndex' V='65534'/><Cell N='EmbellishmentIndex' V='65534'/><Section N='Character'><Row IX='0'><Cell N='Font' V='Themed' F='THEMEVAL()'/><Cell N='Color' V='Themed' F='THEMEVAL()'/><Cell N='Style' V='Themed' F='THEMEVAL()'/><Cell N='Case' V='0' F='Inh'/><Cell N='Pos' V='0' F='Inh'/><Cell N='FontScale' V='1' F='Inh'/><Cell N='Size' V='0.1666666666666667' F='Inh'/><Cell N='DblUnderline' V='0' F='Inh'/><Cell N='Overline' V='0' F='Inh'/><Cell N='Strikethru' V='0' F='Inh'/><Cell N='DoubleStrikethrough' V='0' F='Inh'/><Cell N='Letterspace' V='0' F='Inh'/><Cell N='ColorTrans' V='0' F='Inh'/><Cell N='AsianFont' V='Themed' F='THEMEVAL()'/><Cell N='ComplexScriptFont' V='Themed' F='THEMEVAL()'/><Cell N='ComplexScriptSize' V='-1' F='Inh'/><Cell N='LangID' V='en-US' F='Inh'/></Row></Section><Section N='FillGradient'><Row IX='0'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='1'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='2'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='3'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='4'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='5'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='6'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='7'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='8'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='9'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row></Section><Section N='LineGradient'><Row IX='0'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='1'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='2'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='3'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='4'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='5'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='6'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='7'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='8'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row><Row IX='9'><Cell N='GradientStopColor' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopColorTrans' V='Themed' F='THEMEVAL()'/><Cell N='GradientStopPosition' V='Themed' F='THEMEVAL()'/></Row></Section></StyleSheet><StyleSheet ID='7' NameU='Connector' IsCustomNameU='1' Name='Connector' IsCustomName='1' LineStyle='3' FillStyle='3' TextStyle='3'><Cell N='EnableLineProps' V='1'/><Cell N='EnableFillProps' V='1'/><Cell N='EnableTextProps' V='1'/><Cell N='HideForApply' V='0'/><Cell N='LeftMargin' V='0.05555555555555555' U='PT' F='Inh'/><Cell N='RightMargin' V='0.05555555555555555' U='PT' F='Inh'/><Cell N='TopMargin' V='0.05555555555555555' U='PT' F='Inh'/><Cell N='BottomMargin' V='0.05555555555555555' U='PT' F='Inh'/><Cell N='VerticalAlign' V='1' F='Inh'/><Cell N='TextBkgnd' V='#ffffff' F='THEMEGUARD(THEMEVAL(\"BackgroundColor\")+1)'/><Cell N='DefaultTabStop' V='0.5' F='Inh'/><Cell N='TextDirection' V='0' F='Inh'/><Cell N='TextBkgndTrans' V='0' F='Inh'/><Cell N='NoObjHandles' V='0' F='Inh'/><Cell N='NonPrinting' V='0' F='Inh'/><Cell N='NoCtlHandles' V='0' F='Inh'/><Cell N='NoAlignBox' V='0' F='Inh'/><Cell N='UpdateAlignBox' V='0' F='Inh'/><Cell N='HideText' V='0' F='Inh'/><Cell N='DynFeedback' V='0' F='Inh'/><Cell N='GlueType' V='0' F='Inh'/><Cell N='WalkPreference' V='0' F='Inh'/><Cell N='BegTrigger' V='0' F='No Formula'/><Cell N='EndTrigger' V='0' F='No Formula'/><Cell N='ObjType' V='0' F='Inh'/><Cell N='Comment' V='' F='Inh'/><Cell N='IsDropSource' V='0' F='Inh'/><Cell N='NoLiveDynamics' V='0' F='Inh'/><Cell N='LocalizeMerge' V='0' F='Inh'/><Cell N='NoProofing' V='0' F='Inh'/><Cell N='Calendar' V='0' F='Inh'/><Cell N='LangID' V='en-US' F='Inh'/><Cell N='ShapeKeywords' V='' F='Inh'/><Cell N='DropOnPageScale' V='1' F='Inh'/><Cell N='QuickStyleLineColor' V='100'/><Cell N='QuickStyleFillColor' V='100'/><Cell N='QuickStyleShadowColor' V='100'/><Cell N='QuickStyleFontColor' V='100'/><Cell N='QuickStyleLineMatrix' V='1'/><Cell N='QuickStyleFillMatrix' V='1'/><Cell N='QuickStyleEffectsMatrix' V='1'/><Cell N='QuickStyleFontMatrix' V='1'/><Cell N='QuickStyleType' V='0'/><Cell N='QuickStyleVariation' V='0'/><Cell N='LineWeight' V='Themed' F='Inh'/><Cell N='LineColor' V='Themed' F='Inh'/><Cell N='LinePattern' V='Themed' F='Inh'/><Cell N='Rounding' V='Themed' F='Inh'/><Cell N='EndArrowSize' V='Themed' F='THEMEVAL()'/><Cell N='BeginArrow' V='Themed' F='THEMEVAL()'/><Cell N='EndArrow' V='Themed' F='THEMEVAL()'/><Cell N='LineCap' V='Themed' F='Inh'/><Cell N='BeginArrowSize' V='Themed' F='THEMEVAL()'/><Cell N='LineColorTrans' V='Themed' F='Inh'/><Cell N='CompoundType' V='Themed' F='Inh'/><Section N='Character'><Row IX='0'><Cell N='Font' V='Themed' F='Inh'/><Cell N='Color' V='Themed' F='Inh'/><Cell N='Style' V='Themed' F='Inh'/><Cell N='Case' V='0' F='Inh'/><Cell N='Pos' V='0' F='Inh'/><Cell N='FontScale' V='1' F='Inh'/><Cell N='Size' V='0.1111111111111111'/><Cell N='DblUnderline' V='0' F='Inh'/><Cell N='Overline' V='0' F='Inh'/><Cell N='Strikethru' V='0' F='Inh'/><Cell N='DoubleStrikethrough' V='0' F='Inh'/><Cell N='Letterspace' V='0' F='Inh'/><Cell N='ColorTrans' V='0' F='Inh'/><Cell N='AsianFont' V='Themed' F='Inh'/><Cell N='ComplexScriptFont' V='Themed' F='Inh'/><Cell N='ComplexScriptSize' V='-1' F='Inh'/><Cell N='LangID' V='en-US' F='Inh'/></Row></Section></StyleSheet></StyleSheets><DocumentSheet NameU='TheDoc' IsCustomNameU='1' Name='TheDoc' IsCustomName='1' LineStyle='0' FillStyle='0' TextStyle='0'><Cell N='OutputFormat' V='0'/><Cell N='LockPreview' V='0'/><Cell N='AddMarkup' V='0'/><Cell N='ViewMarkup' V='0'/><Cell N='DocLockReplace' V='0' U='BOOL'/><Cell N='NoCoauth' V='0' U='BOOL'/><Cell N='DocLockDuplicatePage' V='0' U='BOOL'/><Cell N='PreviewQuality' V='0'/><Cell N='PreviewScope' V='0'/><Cell N='DocLangID' V='en-US'/><Section N='User'><Row N='msvNoAutoConnect'><Cell N='Value' V='1'/><Cell N='Prompt' V='' F='No Formula'/></Row></Section></DocumentSheet></VisioDocument>",
  24. "visio/windows.xml" : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Windows ClientWidth='0' ClientHeight='0' xmlns='http://schemas.microsoft.com/office/visio/2012/main' xmlns:r='http://schemas.openxmlformats.org/officeDocument/2006/relationships' xml:space='preserve' />",
  25. "visio/_rels/document.xml.rels" : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Relationships xmlns='http://schemas.openxmlformats.org/package/2006/relationships'><Relationship Id='rId1' Type='http://schemas.microsoft.com/visio/2010/relationships/masters' Target='masters/masters.xml' /><Relationship Id='rId2' Type='http://schemas.microsoft.com/visio/2010/relationships/pages' Target='pages/pages.xml' /><Relationship Id='rId3' Type='http://schemas.microsoft.com/visio/2010/relationships/windows' Target='windows.xml' /></Relationships>",
  26. "visio/masters/_rels/masters.xml.rels" : '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.microsoft.com/visio/2010/relationships/master" Target="master1.xml"/></Relationships>',
  27. "visio/masters/masters.xml" : "<?xml version='1.0' encoding='utf-8' ?><Masters xmlns='http://schemas.microsoft.com/office/visio/2012/main' xmlns:r='http://schemas.openxmlformats.org/officeDocument/2006/relationships' xml:space='preserve'><Master ID='4' NameU='Dynamic connector' IsCustomNameU='1' Name='Dynamic connector' IsCustomName='1' Prompt='This connector automatically routes between the shapes it connects.' IconSize='1' AlignName='2' MatchByName='1' IconUpdate='0' UniqueID='{002A9108-0000-0000-8E40-00608CF305B2}' BaseID='{F7290A45-E3AD-11D2-AE4F-006008C9F5A9}' PatternFlags='0' Hidden='0' MasterType='0'><PageSheet LineStyle='0' FillStyle='0' TextStyle='0'><Cell N='PageWidth' V='3'/><Cell N='PageHeight' V='3'/><Cell N='ShdwOffsetX' V='0.125'/><Cell N='ShdwOffsetY' V='-0.125'/><Cell N='PageScale' V='1' U='IN_F'/><Cell N='DrawingScale' V='1' U='IN_F'/><Cell N='DrawingSizeType' V='4'/><Cell N='DrawingScaleType' V='0'/><Cell N='InhibitSnap' V='0'/><Cell N='PageLockReplace' V='0' U='BOOL'/><Cell N='PageLockDuplicate' V='0' U='BOOL'/><Cell N='UIVisibility' V='0'/><Cell N='ShdwType' V='0'/><Cell N='ShdwObliqueAngle' V='0'/><Cell N='ShdwScaleFactor' V='1'/><Cell N='DrawingResizeType' V='0'/><Section N='Layer'><Row IX='0'><Cell N='Name' V='Connector'/><Cell N='Color' V='255'/><Cell N='Status' V='0'/><Cell N='Visible' V='1'/><Cell N='Print' V='1'/><Cell N='Active' V='0'/><Cell N='Lock' V='0'/><Cell N='Snap' V='1'/><Cell N='Glue' V='1'/><Cell N='NameUniv' V='Connector'/><Cell N='ColorTrans' V='0'/></Row></Section></PageSheet><Rel r:id='rId1'/></Master></Masters>",
  28. "visio/masters/master1.xml" : "<?xml version='1.0' encoding='utf-8' ?><MasterContents xmlns='http://schemas.microsoft.com/office/visio/2012/main' xmlns:r='http://schemas.openxmlformats.org/officeDocument/2006/relationships' xml:space='preserve'><Shapes><Shape ID='5' OriginalID='0' Type='Shape' LineStyle='7' FillStyle='7' TextStyle='7'><Cell N='PinX' V='1.5' F='GUARD((BeginX+EndX)/2)'/><Cell N='PinY' V='1.5' F='GUARD((BeginY+EndY)/2)'/><Cell N='Width' V='1' F='GUARD(EndX-BeginX)'/><Cell N='Height' V='-1' F='GUARD(EndY-BeginY)'/><Cell N='LocPinX' V='0.5' F='GUARD(Width*0.5)'/><Cell N='LocPinY' V='-0.5' F='GUARD(Height*0.5)'/><Cell N='Angle' V='0' F='GUARD(0DA)'/><Cell N='FlipX' V='0' F='GUARD(FALSE)'/><Cell N='FlipY' V='0' F='GUARD(FALSE)'/><Cell N='ResizeMode' V='0'/><Cell N='BeginX' V='1'/><Cell N='BeginY' V='2'/><Cell N='EndX' V='2'/><Cell N='EndY' V='1'/><Cell N='TxtPinX' V='0' F='SETATREF(Controls.TextPosition)'/><Cell N='TxtPinY' V='-1' F='SETATREF(Controls.TextPosition.Y)'/><Cell N='TxtWidth' V='0.5555555555555556' F='MAX(TEXTWIDTH(TheText),5*Char.Size)'/><Cell N='TxtHeight' V='0.2444444444444444' F='TEXTHEIGHT(TheText,TxtWidth)'/><Cell N='TxtLocPinX' V='0.2777777777777778' F='TxtWidth*0.5'/><Cell N='TxtLocPinY' V='0.1222222222222222' F='TxtHeight*0.5'/><Cell N='TxtAngle' V='0'/><Cell N='LockHeight' V='1'/><Cell N='LockCalcWH' V='1'/><Cell N='HelpTopic' V='Vis_SE.chm!#20000'/><Cell N='Copyright' V='Copyright 2001 Microsoft Corporation. All rights reserved.'/><Cell N='NoAlignBox' V='1'/><Cell N='DynFeedback' V='2'/><Cell N='GlueType' V='2'/><Cell N='ObjType' V='2'/><Cell N='NoLiveDynamics' V='1'/><Cell N='ShapeSplittable' V='1'/><Cell N='LayerMember' V='0'/><Section N='Control'><Row N='TextPosition'><Cell N='X' V='0'/><Cell N='Y' V='-1'/><Cell N='XDyn' V='0' F='Controls.TextPosition'/><Cell N='YDyn' V='-1' F='Controls.TextPosition.Y'/><Cell N='XCon' V='5' F='IF(OR(STRSAME(SHAPETEXT(TheText),\"\"),HideText),5,0)'/><Cell N='YCon' V='0'/><Cell N='CanGlue' V='0'/><Cell N='Prompt' V='Reposition Text'/></Row></Section><Section N='Geometry' IX='0'><Cell N='NoFill' V='1'/><Cell N='NoLine' V='0'/><Cell N='NoShow' V='0'/><Cell N='NoSnap' V='0'/><Cell N='NoQuickDrag' V='0'/><Row T='MoveTo' IX='1'><Cell N='X' V='0'/><Cell N='Y' V='0'/></Row><Row T='LineTo' IX='2'><Cell N='X' V='0'/><Cell N='Y' V='-1'/></Row></Section></Shape></Shapes></MasterContents>"
  29. };
  30. for (var id in files)
  31. {
  32. if (pageCount > 1 && id == that.CONTENT_TYPES_XML)
  33. {
  34. //Add the remaining pages
  35. var doc = mxUtils.parseXml(files[id]);
  36. var root = doc.documentElement;
  37. var children = root.children;
  38. var page1 = null;
  39. for (var i = 0; i < children.length; i++)
  40. {
  41. var child = children[i];
  42. if ("/visio/pages/page1.xml" == child.getAttribute(that.PART_NAME))
  43. {
  44. page1 = child;
  45. }
  46. }
  47. for (var i = 2; i <= pageCount; i++)
  48. {
  49. var newPage = page1.cloneNode();
  50. newPage.setAttribute(that.PART_NAME, "/visio/pages/page" + i + ".xml");
  51. root.appendChild(newPage);
  52. }
  53. writeXmlDoc2Zip(zip, id, doc, true);
  54. }
  55. else
  56. {
  57. zip.file(id, files[id]);
  58. }
  59. }
  60. };
  61. function createElt(doc, ns, name)
  62. {
  63. return (doc.createElementNS != null) ? doc.createElementNS(ns, name) : doc.createElement(name);
  64. };
  65. function getCellVsdxId(cellId)
  66. {
  67. var vsdxId = idsMap[cellId];
  68. if (vsdxId == null)
  69. {
  70. vsdxId = idsCounter++;
  71. idsMap[cellId] = vsdxId;
  72. }
  73. return vsdxId;
  74. };
  75. function getGraphAttributes(graph)
  76. {
  77. var attr = {};
  78. try
  79. {
  80. //This doesn't work when pageView is off
  81. // // Computes the horizontal and vertical page count
  82. // var bounds = graph.getGraphBounds();
  83. // var sc = graph.view.scale;
  84. // var bgBounds = graph.view.getBackgroundPageBounds();
  85. //
  86. // var x0 = Math.round((bounds.x - bgBounds.x) / sc);
  87. // var y0 = Math.round((bounds.y - bgBounds.y) / sc);
  88. //
  89. // var hpages = Math.max(1, Math.ceil((bounds.width / sc + x0) / graph.pageFormat.width));
  90. // var vpages = Math.max(1, Math.ceil((bounds.height / sc + y0) / graph.pageFormat.height));
  91. // Computes the horizontal and vertical page count
  92. var bounds = graph.getGraphBounds().clone();
  93. var sc = graph.view.scale;
  94. var tr = graph.view.translate;
  95. var x0 = Math.round(bounds.x / sc) - tr.x;
  96. var y0 = Math.round(bounds.y / sc) - tr.y;
  97. // Store the available page area
  98. var availableWidth = graph.pageFormat.width;
  99. var availableHeight = graph.pageFormat.height;
  100. if (x0 < 0)
  101. {
  102. x0 += Math.ceil((tr.x - bounds.x / sc) / availableWidth) * availableWidth;
  103. }
  104. if (y0 < 0)
  105. {
  106. y0 += Math.ceil((tr.y - bounds.y / sc) / availableHeight) * availableHeight;
  107. }
  108. var hpages = Math.max(1, Math.ceil((bounds.width / sc + x0) / availableWidth));
  109. var vpages = Math.max(1, Math.ceil((bounds.height / sc + y0) / availableHeight));
  110. attr['gridEnabled'] = graph.gridEnabled;
  111. attr['gridSize'] = graph.gridSize;
  112. attr['guidesEnabled'] = graph.graphHandler.guidesEnabled
  113. attr['pageVisible'] = graph.pageVisible;
  114. attr['pageScale'] = graph.pageScale;
  115. attr['pageWidth'] = graph.pageFormat.width * hpages;
  116. attr['pageHeight'] = graph.pageFormat.height * vpages;
  117. attr['backgroundClr'] = graph.background;
  118. attr['mathEnabled'] = graph.mathEnabled;
  119. attr['shadowVisible'] = graph.shadowVisible;
  120. }
  121. catch(e)
  122. {
  123. //nothing
  124. }
  125. return attr;
  126. };
  127. function createCellElemScaled(name, val, xmlDoc, formula)
  128. {
  129. return createCellElem(name, val / that.CONVERSION_FACTOR, xmlDoc, formula);
  130. };
  131. function createCellElem(name, val, xmlDoc, formula)
  132. {
  133. var cell = createElt(xmlDoc, that.XMLNS, "Cell");
  134. cell.setAttribute("N", name);
  135. cell.setAttribute("V", val);
  136. if (formula) cell.setAttribute("F", formula);
  137. return cell;
  138. };
  139. function createRow(type, index, x, y, xmlDoc)
  140. {
  141. var row = createElt(xmlDoc, that.XMLNS, "Row");
  142. row.setAttribute("T", type);
  143. row.setAttribute("IX", index);
  144. row.appendChild(createCellElemScaled("X", x, xmlDoc));
  145. row.appendChild(createCellElemScaled("Y", y, xmlDoc));
  146. return row;
  147. };
  148. function applyMxCellStyle(state, shape, xmlDoc)
  149. {
  150. var fillClr = mxUtils.rgba2hex(state.style[mxConstants.STYLE_FILLCOLOR]);
  151. if (!fillClr || fillClr == "none")
  152. {
  153. shape.appendChild(createCellElem("FillPattern", 0, xmlDoc));
  154. }
  155. else
  156. {
  157. shape.appendChild(createCellElem("FillForegnd", fillClr, xmlDoc));
  158. var gradClr = mxUtils.rgba2hex(state.style[mxConstants.STYLE_GRADIENTCOLOR]);
  159. if (gradClr && gradClr != "none")
  160. {
  161. shape.appendChild(createCellElem("FillBkgnd", gradClr, xmlDoc));
  162. var gradDir = state.style[mxConstants.STYLE_GRADIENT_DIRECTION];
  163. var dir = 28;
  164. if (gradDir)
  165. {
  166. switch(gradDir)
  167. {
  168. case mxConstants.DIRECTION_EAST:
  169. dir = 25;
  170. break
  171. case mxConstants.DIRECTION_WEST:
  172. dir = 27;
  173. break
  174. case mxConstants.DIRECTION_NORTH:
  175. dir = 30;
  176. break
  177. }
  178. }
  179. shape.appendChild(createCellElem("FillPattern", dir, xmlDoc));
  180. }
  181. }
  182. var strokeClr = mxUtils.rgba2hex(state.style[mxConstants.STYLE_STROKECOLOR]);
  183. if (!strokeClr || strokeClr == "none")
  184. shape.appendChild(createCellElem("LinePattern", 0, xmlDoc));
  185. else
  186. shape.appendChild(createCellElem("LineColor", strokeClr, xmlDoc));
  187. var strokeW = state.style[mxConstants.STYLE_STROKEWIDTH];
  188. if (strokeW) shape.appendChild(createCellElemScaled("LineWeight", strokeW, xmlDoc));
  189. var opacity = state.style[mxConstants.STYLE_OPACITY];
  190. var fillOpaq;
  191. var strkOpaq;
  192. if (opacity)
  193. {
  194. fillOpaq = opacity;
  195. strkOpaq = opacity;
  196. }
  197. else
  198. {
  199. fillOpaq = state.style[mxConstants.STYLE_FILL_OPACITY];
  200. strkOpaq = state.style[mxConstants.STYLE_STROKE_OPACITY];
  201. }
  202. if (fillOpaq) shape.appendChild(createCellElem("FillForegndTrans", 1 - parseInt(fillOpaq)/100.0, xmlDoc));
  203. if (strkOpaq) shape.appendChild(createCellElem("LineColorTrans", 1 - parseInt(strkOpaq)/100.0, xmlDoc));
  204. var isDashed = state.style[mxConstants.STYLE_DASHED];
  205. if (isDashed == 1)
  206. {
  207. var dashPatrn = state.style[mxConstants.STYLE_DASH_PATTERN];
  208. var pattern = 9
  209. if (dashPatrn)
  210. {
  211. //We only support the patterns of draw.io UI
  212. switch(dashPatrn)
  213. {
  214. case "1 1":
  215. pattern = 10;
  216. break;
  217. case "1 2":
  218. pattern = 3;
  219. break;
  220. case "1 4":
  221. pattern = 17;
  222. break;
  223. }
  224. }
  225. shape.appendChild(createCellElem("LinePattern", pattern, xmlDoc));
  226. }
  227. var hasShadow = state.style[mxConstants.STYLE_SHADOW];
  228. if (hasShadow == 1)
  229. {
  230. shape.appendChild(createCellElem("ShdwPattern", 1, xmlDoc));
  231. shape.appendChild(createCellElem("ShdwForegnd", '#000000', xmlDoc));
  232. shape.appendChild(createCellElem("ShdwForegndTrans", 0.6, xmlDoc));
  233. shape.appendChild(createCellElem("ShapeShdwType", 1, xmlDoc));
  234. shape.appendChild(createCellElem("ShapeShdwOffsetX", '0.02946278254943948', xmlDoc));
  235. shape.appendChild(createCellElem("ShapeShdwOffsetY", '-0.02946278254943948', xmlDoc));
  236. shape.appendChild(createCellElem("ShapeShdwScaleFactor", '1', xmlDoc));
  237. shape.appendChild(createCellElem("ShapeShdwBlur", '0.05555555555555555', xmlDoc));
  238. shape.appendChild(createCellElem("ShapeShdwShow", 2, xmlDoc));
  239. }
  240. //Probably we don't need margins as the canvas get the modified position?
  241. /*
  242. var topMargin = state.style[mxConstants.STYLE_SPACING_TOP];
  243. if (topMargin) shape.appendChild(createCellElemScaled("TopMargin", parseFloat(topMargin) * 2 + 2.8 , xmlDoc));
  244. /* //Defines label bottom spacing
  245. double bottomMargin = getBottomSpacing() * 100/100;
  246. if (bottomMargin != 0)
  247. {
  248. styleMap.put(mxConstants.STYLE_SPACING_BOTTOM, Double.toString(bottomMargin));
  249. }
  250. //Defines label left spacing
  251. double leftMargin = getLeftSpacing() * 100/100;
  252. if (leftMargin != 0)
  253. {
  254. styleMap.put(mxConstants.STYLE_SPACING_LEFT, Double.toString(leftMargin));
  255. }
  256. //Defines label right spacing
  257. double rightMargin = getRightSpacing() * 100/100;
  258. if(rightMargin !=0)
  259. {
  260. styleMap.put(mxConstants.STYLE_SPACING_RIGHT, Double.toString(rightMargin));
  261. }*/
  262. //Direction is not clear that we need it
  263. /*
  264. var direction = state.style[mxConstants.STYLE_DIRECTION];
  265. if (direction != mxConstants.DIRECTION_EAST)
  266. {
  267. styleMap.put(mxConstants.STYLE_DIRECTION, direction);
  268. }
  269. */
  270. var flibX = state.style[mxConstants.STYLE_FLIPH];
  271. if (flibX == 1) shape.appendChild(createCellElem("FlipX", 1, xmlDoc));
  272. var flibY = state.style[mxConstants.STYLE_FLIPV];
  273. if (flibY == 1) shape.appendChild(createCellElem("FlipY", 1, xmlDoc));
  274. var rounded = state.style[mxConstants.STYLE_ROUNDED];
  275. if (rounded == 1) shape.appendChild(createCellElemScaled("Rounding", state.cell.geometry.width*0.1, xmlDoc));
  276. //TODO for some reason, visio doesn't show the label (text) background color!
  277. //May be we need mxSvgCanvas2D.prototype.addTextBackground = function(node, str, x, y, w, h, align, valign, overflow)
  278. var lbkgnd = mxUtils.rgba2hex(state.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR]);
  279. if (lbkgnd) shape.appendChild(createCellElem("TextBkgnd", lbkgnd, xmlDoc));
  280. };
  281. function createShape(id, geo, layerIndex, xmlDoc, parentHeight, isChild)
  282. {
  283. var shape = createElt(xmlDoc, that.XMLNS, "Shape");
  284. shape.setAttribute("ID", id);
  285. shape.setAttribute("NameU", "Shape" + id);
  286. shape.setAttribute("LineStyle", "0");
  287. shape.setAttribute("FillStyle", "0");
  288. shape.setAttribute("TextStyle", "0");
  289. var hw = geo.width/2, hh = geo.height/2;
  290. shape.appendChild(createCellElemScaled("PinX", geo.x + hw + (isChild? 0 : vsdxCanvas.shiftX), xmlDoc));
  291. shape.appendChild(createCellElemScaled("PinY", parentHeight - geo.y - hh - (isChild? 0 : vsdxCanvas.shiftY), xmlDoc));
  292. shape.appendChild(createCellElemScaled("Width", geo.width, xmlDoc));
  293. shape.appendChild(createCellElemScaled("Height", geo.height, xmlDoc));
  294. shape.appendChild(createCellElemScaled("LocPinX", hw, xmlDoc));
  295. shape.appendChild(createCellElemScaled("LocPinY", hh, xmlDoc));
  296. shape.appendChild(createCellElem("LayerMember", layerIndex + "", xmlDoc));
  297. return shape;
  298. };
  299. function getArrowType(arrow, isFilled)
  300. {
  301. isFilled = isFilled == null? "1" : isFilled;
  302. arrow = arrow == null? "none" : arrow;
  303. var key = arrow + "|" + isFilled;
  304. var type = that.ARROWS_MAP[key];
  305. if (type != null)
  306. return type;
  307. else
  308. return 1;
  309. };
  310. function getArrowSize(size)
  311. {
  312. if (size == null) return 2;
  313. if (size <=2)
  314. return 0;
  315. else if (size <= 3)
  316. return 1;
  317. else if (size <= 5)
  318. return 2;
  319. else if (size <= 7)
  320. return 3;
  321. else if (size <= 9)
  322. return 4;
  323. else if (size <= 22)
  324. return 5;
  325. else
  326. return 6;
  327. };
  328. function createEdge(cell, layerIndex, graph, xmlDoc, parentHeight, isChild)
  329. {
  330. var state = graph.view.getState(cell, true);
  331. if (state == null || state.absolutePoints == null || state.cellBounds == null)
  332. {
  333. return null;
  334. }
  335. var shape = createElt(xmlDoc, that.XMLNS, "Shape");
  336. var vsdxId = getCellVsdxId(cell.id);
  337. shape.setAttribute("ID", vsdxId);
  338. shape.setAttribute("NameU", "Dynamic connector." + vsdxId);
  339. shape.setAttribute("Name", "Dynamic connector." + vsdxId);
  340. shape.setAttribute("Type", "Shape");
  341. shape.setAttribute("Master", "4"); //Dynamic Connector Master
  342. var s = vsdxCanvas.state;
  343. var points = state.absolutePoints;
  344. var bounds = state.cellBounds;
  345. var hw = bounds.width/2, hh = bounds.height/2;
  346. shape.appendChild(createCellElemScaled("PinX", bounds.x + hw + (isChild? 0 : vsdxCanvas.shiftX), xmlDoc));
  347. shape.appendChild(createCellElemScaled("PinY", parentHeight - bounds.y - hh - (isChild? 0 : vsdxCanvas.shiftY), xmlDoc));
  348. shape.appendChild(createCellElemScaled("Width", bounds.width, xmlDoc));
  349. shape.appendChild(createCellElemScaled("Height", bounds.height, xmlDoc));
  350. shape.appendChild(createCellElemScaled("LocPinX", hw, xmlDoc));
  351. shape.appendChild(createCellElemScaled("LocPinY", hh, xmlDoc));
  352. vsdxCanvas.newEdge(shape, state, xmlDoc);
  353. var calcVsdxPoint = function(p, noHeight, withoutShift)
  354. {
  355. var x = p.x, y = p.y;
  356. x = x * s.scale - bounds.x + s.dx + (withoutShift || isChild? 0 : vsdxCanvas.shiftX);
  357. y = (noHeight? 0 : bounds.height) - y * s.scale + bounds.y - s.dy - (withoutShift || isChild? 0 : vsdxCanvas.shiftY);
  358. return {x: x, y: y};
  359. };
  360. var p0 = calcVsdxPoint(points[0], true);
  361. //Formula is used to make the edge dynamic
  362. shape.appendChild(createCellElemScaled("BeginX", bounds.x + p0.x, xmlDoc, "_WALKGLUE(BegTrigger,EndTrigger,WalkPreference)"));
  363. shape.appendChild(createCellElemScaled("BeginY", parentHeight - bounds.y + p0.y, xmlDoc, "_WALKGLUE(BegTrigger,EndTrigger,WalkPreference)"));
  364. var pe = calcVsdxPoint(points[points.length - 1], true);
  365. //Formula is used to make the edge dynamic
  366. shape.appendChild(createCellElemScaled("EndX", bounds.x + pe.x, xmlDoc, "_WALKGLUE(EndTrigger,BegTrigger,WalkPreference)"));
  367. shape.appendChild(createCellElemScaled("EndY", parentHeight - bounds.y + pe.y, xmlDoc, "_WALKGLUE(EndTrigger,BegTrigger,WalkPreference)"));
  368. //Formula is used to make the edge dynamic (specify source id and target id)
  369. shape.appendChild(createCellElem("BegTrigger", "2", xmlDoc, cell.source? "_XFTRIGGER(Sheet."+ getCellVsdxId(cell.source.id) +"!EventXFMod)" : null));
  370. shape.appendChild(createCellElem("EndTrigger", "2", xmlDoc, cell.target? "_XFTRIGGER(Sheet."+ getCellVsdxId(cell.target.id) +"!EventXFMod)" : null));
  371. shape.appendChild(createCellElem("ConFixedCode", "6", xmlDoc));
  372. shape.appendChild(createCellElem("LayerMember", layerIndex + "", xmlDoc));
  373. applyMxCellStyle(state, shape, xmlDoc);
  374. //Edge special styles
  375. var startFill = state.style[mxConstants.STYLE_STARTFILL];
  376. var startArrow = state.style[mxConstants.STYLE_STARTARROW];
  377. var startSize = state.style[mxConstants.STYLE_STARTSIZE];
  378. var type = getArrowType(startArrow, startFill);
  379. shape.appendChild(createCellElem("BeginArrow", type, xmlDoc));
  380. shape.appendChild(createCellElem("BeginArrowSize", getArrowSize(startSize), xmlDoc));
  381. var endFill = state.style[mxConstants.STYLE_ENDFILL];
  382. var endArrow = state.style[mxConstants.STYLE_ENDARROW];
  383. var endSize = state.style[mxConstants.STYLE_ENDSIZE];
  384. var type = getArrowType(endArrow, endFill);
  385. shape.appendChild(createCellElem("EndArrow", type, xmlDoc));
  386. shape.appendChild(createCellElem("EndArrowSize", getArrowSize(endSize), xmlDoc));
  387. //Draw text first to have its shape cell elements before visio geo.
  388. if (state.text != null && state.text.checkBounds())
  389. {
  390. vsdxCanvas.save();
  391. state.text.paint(vsdxCanvas);
  392. vsdxCanvas.restore();
  393. }
  394. var geoSec = createElt(xmlDoc, that.XMLNS, "Section");
  395. geoSec.setAttribute("N", "Geometry");
  396. geoSec.setAttribute("IX", "0");
  397. for (var i = 0; i < points.length; i++)
  398. {
  399. var p = calcVsdxPoint(points[i], false, true);
  400. geoSec.appendChild(createRow(i==0 ? "MoveTo" : "LineTo", (i + 1), p.x, p.y, xmlDoc));
  401. }
  402. geoSec.appendChild(createCellElem("NoFill", "1", xmlDoc));
  403. geoSec.appendChild(createCellElem("NoLine", "0", xmlDoc));
  404. shape.appendChild(geoSec);
  405. return shape;
  406. };
  407. function convertMxCell2Shape(cell, layerIndex, graph, xmlDoc, parentHeight, parentGeo, isChild)
  408. {
  409. var geo = cell.geometry, origGeo = geo;
  410. if (geo != null)
  411. {
  412. try
  413. {
  414. //fix relative geo coordinates
  415. if (geo.relative && parentGeo)
  416. {
  417. origGeo = geo.clone();
  418. geo.x *= parentGeo.width;
  419. geo.y *= parentGeo.height;
  420. if (cell.vertex && geo.offset != null)
  421. {
  422. geo.x += geo.offset.x;
  423. geo.y += geo.offset.y;
  424. }
  425. geo.relative = 0;
  426. }
  427. var vsdxId = getCellVsdxId(cell.id);
  428. if (!cell.treatAsSingle && cell.getChildCount() > 0) //Group
  429. {
  430. //Create group shape as an empty shape with no geo
  431. var shape = createShape(vsdxId + "10000", geo, layerIndex, xmlDoc, parentHeight, isChild);
  432. shape.setAttribute("Type", "Group");
  433. //Create group shape
  434. var gShapes = createElt(xmlDoc, that.XMLNS, "Shapes");
  435. //translate the canvas using the group coordinates
  436. vsdxCanvas.save();
  437. vsdxCanvas.translate(-geo.x, -geo.y);
  438. //Draw the actual group shape as a child (so change its geo coord to 0,0).
  439. // In mxGraph group shape can have styles and stencil
  440. var newGeo = geo.clone();
  441. newGeo.x = 0;
  442. newGeo.y = 0;
  443. cell.setGeometry(newGeo);
  444. cell.treatAsSingle = true;
  445. var subShape = convertMxCell2Shape(cell, layerIndex, graph, xmlDoc, geo.height, geo, true);
  446. delete cell.treatAsSingle;
  447. cell.setGeometry(geo);
  448. if (subShape != null)
  449. {
  450. gShapes.appendChild(subShape);
  451. }
  452. //add group children
  453. for (var i = 0; i < cell.getChildCount(); i++)
  454. {
  455. var child = cell.children[i];
  456. var subShape = convertMxCell2Shape(child, layerIndex, graph, xmlDoc, geo.height, geo, true);
  457. if (subShape != null)
  458. {
  459. gShapes.appendChild(subShape);
  460. }
  461. }
  462. shape.appendChild(gShapes);
  463. //restore the canvas to before group translation
  464. vsdxCanvas.restore();
  465. return shape;
  466. }
  467. else if (cell.vertex)
  468. {
  469. var shape = createShape(vsdxId, geo, layerIndex, xmlDoc, parentHeight, isChild);
  470. var state = graph.view.getState(cell, true);
  471. if (state != null)
  472. {
  473. applyMxCellStyle(state, shape, xmlDoc);
  474. vsdxCanvas.newShape(shape, state, xmlDoc);
  475. //Draw text first to have its shape cell elements before visio geo.
  476. if (state.text != null && state.text.checkBounds())
  477. {
  478. vsdxCanvas.save();
  479. state.text.paint(vsdxCanvas);
  480. vsdxCanvas.restore();
  481. }
  482. if (state.shape != null && state.shape.checkBounds())
  483. {
  484. vsdxCanvas.save();
  485. state.shape.paint(vsdxCanvas);
  486. vsdxCanvas.restore();
  487. }
  488. shape.appendChild(vsdxCanvas.getShapeGeo());
  489. vsdxCanvas.endShape();
  490. shape.setAttribute("Type", vsdxCanvas.getShapeType());
  491. }
  492. return shape;
  493. }
  494. else
  495. {
  496. return createEdge(cell, layerIndex, graph, xmlDoc, parentHeight, isChild);
  497. }
  498. }
  499. finally
  500. {
  501. cell.geometry = origGeo;
  502. }
  503. }
  504. else
  505. {
  506. return null;
  507. }
  508. };
  509. function convertMxModel2Page(graph, modelAttrib)
  510. {
  511. var xmlDoc = mxUtils.createXmlDocument();
  512. var root = createElt(xmlDoc, that.XMLNS, "PageContents");
  513. root.setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns', that.XMLNS);
  514. root.setAttributeNS('http://www.w3.org/2000/xmlns/', "xmlns:r", that.XMLNS_R);
  515. var shapes = createElt(xmlDoc, that.XMLNS, "Shapes");
  516. root.appendChild(shapes);
  517. var model = graph.model;
  518. var t = graph.view.translate;
  519. var s = graph.view.scale;
  520. var bounds = graph.getGraphBounds();
  521. vsdxCanvas.shiftX = 0; vsdxCanvas.shiftY = 0;
  522. //-ve pages
  523. if (bounds.x / s < t.x || bounds.y / s < t.y)
  524. {
  525. vsdxCanvas.shiftX = Math.ceil((t.x - bounds.x / s) / graph.pageFormat.width) * graph.pageFormat.width;
  526. vsdxCanvas.shiftY = Math.ceil((t.y - bounds.y / s) / graph.pageFormat.height) * graph.pageFormat.height;
  527. }
  528. vsdxCanvas.save();
  529. vsdxCanvas.translate(-t.x, -t.y);
  530. vsdxCanvas.scale(1 / s);
  531. vsdxCanvas.newPage();
  532. var layers = graph.model.getChildCells(graph.model.root);
  533. var layerIdsMaps = {};
  534. for (var k = 0; k < layers.length; k++)
  535. {
  536. layerIdsMaps[layers[k].id] = k;
  537. }
  538. for (var id in model.cells)
  539. {
  540. var cell = model.cells[id];
  541. //top-most cells
  542. var layerIndex = cell.parent != null? layerIdsMaps[cell.parent.id] : null;
  543. if (layerIndex != null)
  544. {
  545. var shape = convertMxCell2Shape(cell, layerIndex, graph, xmlDoc, modelAttrib.pageHeight);
  546. if (shape != null)
  547. shapes.appendChild(shape);
  548. }
  549. }
  550. var connects = createElt(xmlDoc, that.XMLNS, "Connects");
  551. root.appendChild(connects);
  552. //Second pass to add edges (connections)
  553. for (var id in model.cells)
  554. {
  555. var cell = model.cells[id];
  556. if (cell.edge)
  557. {
  558. if (cell.source)
  559. {
  560. var connect = createElt(xmlDoc, that.XMLNS, "Connect");
  561. connect.setAttribute("FromSheet", getCellVsdxId(cell.id));
  562. connect.setAttribute("FromCell", "BeginX");
  563. connect.setAttribute("ToSheet", getCellVsdxId(cell.source.id));
  564. connects.appendChild(connect);
  565. }
  566. if (cell.target)
  567. {
  568. var connect = createElt(xmlDoc, that.XMLNS, "Connect");
  569. connect.setAttribute("FromSheet", getCellVsdxId(cell.id));
  570. connect.setAttribute("FromCell", "EndX");
  571. connect.setAttribute("ToSheet", getCellVsdxId(cell.target.id));
  572. connects.appendChild(connect);
  573. }
  574. }
  575. }
  576. xmlDoc.appendChild(root);
  577. vsdxCanvas.restore();
  578. return xmlDoc;
  579. };
  580. function writeXmlDoc2Zip(zip, name, xmlDoc, noHeader)
  581. {
  582. zip.file(name, (noHeader? "" : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>") + mxUtils.getXml(xmlDoc, '\n'));
  583. };
  584. function addPagesXML(zip, pages, pageLayers, modelsAttr)
  585. {
  586. var pagesXmlDoc = mxUtils.createXmlDocument();
  587. var pagesRelsXmlDoc = mxUtils.createXmlDocument();
  588. var pagesRoot = createElt(pagesXmlDoc, that.XMLNS, "Pages");
  589. pagesRoot.setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns', that.XMLNS);
  590. pagesRoot.setAttributeNS('http://www.w3.org/2000/xmlns/', "xmlns:r", that.XMLNS_R);
  591. var pagesRelsRoot = createElt(pagesRelsXmlDoc, that.RELS_XMLNS, "Relationships");
  592. var i = 1;
  593. for (var name in pages)
  594. {
  595. var pageName = "page" + i + ".xml";
  596. var pageE = createElt(pagesXmlDoc, that.XMLNS, "Page");
  597. pageE.setAttribute("ID", i-1);
  598. pageE.setAttribute("NameU", name);
  599. pageE.setAttribute("Name", name);
  600. var pageSheet = createElt(pagesXmlDoc, that.XMLNS, "PageSheet");
  601. var modelAttr = modelsAttr[name];
  602. pageSheet.appendChild(createCellElemScaled("PageWidth", modelAttr['pageWidth'], pagesXmlDoc));
  603. pageSheet.appendChild(createCellElemScaled("PageHeight", modelAttr['pageHeight'], pagesXmlDoc));
  604. pageSheet.appendChild(createCellElem("PageScale", modelAttr['pageScale'], pagesXmlDoc));
  605. pageSheet.appendChild(createCellElem("DrawingScale", 1, pagesXmlDoc));
  606. var relE = createElt(pagesXmlDoc, that.XMLNS,"Rel");
  607. relE.setAttributeNS(that.XMLNS_R, "r:id", "rId" + i);
  608. //Add Layers
  609. var layerSec = createElt(pagesXmlDoc, that.XMLNS, "Section");
  610. layerSec.setAttribute("N", "Layer");
  611. var layers = pageLayers[name];
  612. for (var k = 0; k < layers.length; k++)
  613. {
  614. var layerRow = createElt(pagesXmlDoc, that.XMLNS, "Row");
  615. layerRow.setAttribute("IX", k + "");
  616. layerSec.appendChild(layerRow)
  617. layerRow.appendChild(createCellElem("Name", layers[k].name, pagesXmlDoc));
  618. layerRow.appendChild(createCellElem("Color", '255', pagesXmlDoc));
  619. layerRow.appendChild(createCellElem("Status", '0', pagesXmlDoc));
  620. layerRow.appendChild(createCellElem("Visible", layers[k].visible? '1' : '0', pagesXmlDoc));
  621. layerRow.appendChild(createCellElem("Print", '1', pagesXmlDoc));
  622. layerRow.appendChild(createCellElem("Active", '0', pagesXmlDoc));
  623. layerRow.appendChild(createCellElem("Lock", layers[k].locked? '1' : '0', pagesXmlDoc));
  624. layerRow.appendChild(createCellElem("Snap", '1', pagesXmlDoc));
  625. layerRow.appendChild(createCellElem("Glue", '1', pagesXmlDoc));
  626. layerRow.appendChild(createCellElem("NameUniv", layers[k].name, pagesXmlDoc));
  627. layerRow.appendChild(createCellElem("ColorTrans", '0', pagesXmlDoc));
  628. }
  629. pageSheet.appendChild(layerSec);
  630. pageE.appendChild(pageSheet);
  631. pageE.appendChild(relE);
  632. pagesRoot.appendChild(pageE);
  633. var relationship = createElt(pagesRelsXmlDoc, that.RELS_XMLNS, "Relationship");
  634. relationship.setAttribute("Id", "rId" + i);
  635. relationship.setAttribute("Type", that.PAGES_TYPE);
  636. relationship.setAttribute("Target", pageName);
  637. pagesRelsRoot.appendChild(relationship);
  638. //Note:Each page rels is created with the skeleton as they are constants
  639. //write the page docs
  640. var xmlDoc = pages[name];
  641. writeXmlDoc2Zip(zip, that.VISIO_PAGES + pageName, xmlDoc);
  642. i++;
  643. }
  644. pagesXmlDoc.appendChild(pagesRoot);
  645. pagesRelsXmlDoc.appendChild(pagesRelsRoot);
  646. writeXmlDoc2Zip(zip, that.VISIO_PAGES + "pages.xml", pagesXmlDoc);
  647. writeXmlDoc2Zip(zip, that.VISIO_PAGES + "_rels/pages.xml.rels", pagesRelsXmlDoc);
  648. }
  649. function addImagesRels(zip, pIndex)
  650. {
  651. //create a new page rels file
  652. var fId = that.VISIO_PAGES_RELS + "page" + pIndex + ".xml.rels";
  653. var pageRelDoc = mxUtils.createXmlDocument();
  654. var relationships = createElt(pageRelDoc, that.RELS_XMLNS, "Relationships");
  655. //Add master relationship (rId1)
  656. var relationship = createElt(pageRelDoc, that.RELS_XMLNS, "Relationship");
  657. relationship.setAttribute("Type", "http://schemas.microsoft.com/visio/2010/relationships/master");
  658. relationship.setAttribute("Id", "rId1");
  659. relationship.setAttribute("Target", "../masters/master1.xml");
  660. relationships.appendChild(relationship);
  661. var imgs = vsdxCanvas.images;
  662. //create rels of image files
  663. if (imgs.length > 0)
  664. {
  665. for (var i = 0; i < imgs.length; i++)
  666. {
  667. var relationship = createElt(pageRelDoc, that.RELS_XMLNS, "Relationship");
  668. relationship.setAttribute("Type", that.XMLNS_R + "/image");
  669. relationship.setAttribute("Id", "rId" + (i+2));
  670. relationship.setAttribute("Target", "../media/" + imgs[i]);
  671. relationships.appendChild(relationship);
  672. }
  673. }
  674. pageRelDoc.appendChild(relationships);
  675. writeXmlDoc2Zip(zip, fId, pageRelDoc);
  676. };
  677. /**
  678. *
  679. * Convert current Editor UI pages into a vdsx file
  680. * @return true if successful, false otherwise
  681. */
  682. this.exportCurrentDiagrams = function (currentPageOnly)
  683. {
  684. try
  685. {
  686. if (editorUi.spinner.spin(document.body, mxResources.get('exporting')))
  687. {
  688. var zip = new JSZip();
  689. //init class global variables
  690. vsdxCanvas.init(zip);
  691. idsMap = {};
  692. idsCounter = 1;
  693. var pages = {};
  694. var pageLayers = {};
  695. var modelsAttr = {};
  696. var pagesCount = editorUi.pages != null? editorUi.pages.length : 1;
  697. function collectLayers(graph, diagramName)
  698. {
  699. var layers = graph.model.getChildCells(graph.model.root);
  700. pageLayers[diagramName] = [];
  701. for (var k = 0; k < layers.length; k++)
  702. {
  703. //KNOWN We don't export invisible layers, we may support it later but we need to have a full cell state for invisible cells
  704. if (layers[k].visible)
  705. {
  706. pageLayers[diagramName].push({
  707. name: layers[k].value || 'Background',
  708. visible: layers[k].visible,
  709. locked: layers[k].style && layers[k].style.indexOf('locked=1') >= 0
  710. });
  711. }
  712. }
  713. };
  714. if (editorUi.pages != null)
  715. {
  716. function exportPage(page)
  717. {
  718. var diagramName = page.getName();
  719. var graph = editorUi.editor.graph;
  720. //Handles dark mode
  721. var temp = null;
  722. if (graph.themes != null && graph.defaultThemeName == 'darkTheme')
  723. {
  724. temp = graph.stylesheet;
  725. graph.stylesheet = graph.getDefaultStylesheet();
  726. graph.refresh();
  727. }
  728. try
  729. {
  730. var modelAttrib = getGraphAttributes(graph);
  731. pages[diagramName] = convertMxModel2Page(graph, modelAttrib);
  732. collectLayers(graph, diagramName);
  733. addImagesRels(zip, i+1);
  734. modelsAttr[diagramName] = modelAttrib;
  735. }
  736. finally
  737. {
  738. if (temp != null)
  739. {
  740. graph.stylesheet = temp;
  741. graph.refresh();
  742. }
  743. }
  744. };
  745. var selectedCells = editorUi.editor.graph.getSelectionCells();
  746. var currentPage = editorUi.currentPage;
  747. if (currentPageOnly)
  748. {
  749. exportPage(currentPage);
  750. }
  751. else
  752. {
  753. for (var i=0; i < editorUi.pages.length; i++)
  754. {
  755. var page = editorUi.pages[i];
  756. if (editorUi.currentPage != page)
  757. {
  758. editorUi.selectPage(page, true);
  759. }
  760. exportPage(page);
  761. }
  762. if (currentPage != editorUi.currentPage)
  763. {
  764. editorUi.selectPage(currentPage, true);
  765. }
  766. editorUi.editor.graph.setSelectionCells(selectedCells);
  767. }
  768. }
  769. else
  770. {
  771. var graph = editorUi.editor.graph;
  772. var modelAttrib = getGraphAttributes(graph);
  773. var diagramName = "Page1";
  774. pages[diagramName] = convertMxModel2Page(graph, modelAttrib);
  775. collectLayers(graph, diagramName);
  776. addImagesRels(zip, 1);
  777. modelsAttr[diagramName] = modelAttrib;
  778. }
  779. createVsdxSkeleton(zip, pagesCount);
  780. addPagesXML(zip, pages, pageLayers, modelsAttr);
  781. var createZipFile = function()
  782. {
  783. zip.generateAsync({type:"base64"}).then(
  784. function(content)
  785. {
  786. editorUi.spinner.stop();
  787. var basename = editorUi.getBaseFilename();
  788. editorUi.saveData(basename + ".vsdx", 'vsdx', content,
  789. 'application/vnd.visio2013', true);
  790. }
  791. );
  792. };
  793. if (vsdxCanvas.filesLoading > 0)
  794. {
  795. // wait until all media files are loaded
  796. vsdxCanvas.onFilesLoaded = createZipFile;
  797. }
  798. else
  799. {
  800. createZipFile();
  801. }
  802. }
  803. return true;
  804. }
  805. catch(e)
  806. {
  807. console.log(e);
  808. editorUi.spinner.stop();
  809. return false;
  810. }
  811. };
  812. }
  813. VsdxExport.prototype.CONVERSION_FACTOR = 40 * 2.54; //screenCoordinatesPerCm (40) x CENTIMETERS_PER_INCHES (2.54)
  814. VsdxExport.prototype.PAGES_TYPE = "http://schemas.microsoft.com/visio/2010/relationships/page";
  815. VsdxExport.prototype.RELS_XMLNS = "http://schemas.openxmlformats.org/package/2006/relationships";
  816. VsdxExport.prototype.XML_SPACE = "preserve";
  817. VsdxExport.prototype.XMLNS_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
  818. VsdxExport.prototype.XMLNS = "http://schemas.microsoft.com/office/visio/2012/main";
  819. VsdxExport.prototype.VISIO_PAGES = "visio/pages/";
  820. VsdxExport.prototype.PREFEX = "com/mxgraph/io/vsdx/resources/export/";
  821. VsdxExport.prototype.VSDX_ENC = "ISO-8859-1";
  822. VsdxExport.prototype.PART_NAME = "PartName";
  823. VsdxExport.prototype.CONTENT_TYPES_XML = "[Content_Types].xml";
  824. VsdxExport.prototype.VISIO_PAGES_RELS = "visio/pages/_rels/";
  825. VsdxExport.prototype.ARROWS_MAP = {
  826. "none|1": 0, "none|0": 0, "open|1": 1, "open|0": 1, "block|1": 4, "block|0": 14, "classic|1": 5, "classic|0": 17,
  827. "oval|1": 10, "oval|0": 20, "diamond|1": 11, "diamond|0": 22, "blockThin|1": 2, "blockThin|0": 15, "dash|1": 23, "dash|0": 23,
  828. "ERone|1": 24, "ERone|0": 24, "ERmandOne|1": 25, "ERmandOne|0": 25, "ERmany|1": 27, "ERmany|0": 27, "ERoneToMany|1": 28, "ERoneToMany|0": 28,
  829. "ERzeroToMany|1": 29, "ERzeroToMany|0": 29, "ERzeroToOne|1": 30, "ERzeroToOne|0": 30, "openAsync|1": 9, "openAsync|0": 9
  830. };