rubyXL-ptr 3.3.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +17 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +229 -0
- data/Rakefile +103 -0
- data/VERSION +1 -0
- data/lib/rubyXL.rb +12 -0
- data/lib/rubyXL/cell.rb +54 -0
- data/lib/rubyXL/convenience_methods.rb +1122 -0
- data/lib/rubyXL/objects/border.rb +74 -0
- data/lib/rubyXL/objects/calculation_chain.rb +31 -0
- data/lib/rubyXL/objects/cell_style.rb +65 -0
- data/lib/rubyXL/objects/chartsheet.rb +92 -0
- data/lib/rubyXL/objects/color.rb +27 -0
- data/lib/rubyXL/objects/column_range.rb +92 -0
- data/lib/rubyXL/objects/comments.rb +47 -0
- data/lib/rubyXL/objects/container_nodes.rb +135 -0
- data/lib/rubyXL/objects/content_types.rb +77 -0
- data/lib/rubyXL/objects/data_validation.rb +37 -0
- data/lib/rubyXL/objects/document_properties.rb +159 -0
- data/lib/rubyXL/objects/extensions.rb +40 -0
- data/lib/rubyXL/objects/external_links.rb +85 -0
- data/lib/rubyXL/objects/fill.rb +55 -0
- data/lib/rubyXL/objects/filters.rb +120 -0
- data/lib/rubyXL/objects/font.rb +48 -0
- data/lib/rubyXL/objects/formula.rb +24 -0
- data/lib/rubyXL/objects/ooxml_object.rb +460 -0
- data/lib/rubyXL/objects/reference.rb +110 -0
- data/lib/rubyXL/objects/relationships.rb +213 -0
- data/lib/rubyXL/objects/root.rb +86 -0
- data/lib/rubyXL/objects/shared_strings.rb +70 -0
- data/lib/rubyXL/objects/sheet_common.rb +51 -0
- data/lib/rubyXL/objects/sheet_data.rb +188 -0
- data/lib/rubyXL/objects/simple_types.rb +232 -0
- data/lib/rubyXL/objects/storage.rb +182 -0
- data/lib/rubyXL/objects/stylesheet.rb +232 -0
- data/lib/rubyXL/objects/text.rb +94 -0
- data/lib/rubyXL/objects/theme.rb +1716 -0
- data/lib/rubyXL/objects/workbook.rb +464 -0
- data/lib/rubyXL/objects/worksheet.rb +748 -0
- data/lib/rubyXL/parser.rb +29 -0
- data/lib/rubyXL/worksheet.rb +105 -0
- data/rdoc/README_rdoc.html +475 -0
- data/rdoc/RubyXL.html +598 -0
- data/rdoc/RubyXL/AExtension.html +223 -0
- data/rdoc/RubyXL/AExtensionStorageArea.html +103 -0
- data/rdoc/RubyXL/ActiveX.html +182 -0
- data/rdoc/RubyXL/ActiveXBinary.html +117 -0
- data/rdoc/RubyXL/AdjustHandleList.html +106 -0
- data/rdoc/RubyXL/Alignment.html +106 -0
- data/rdoc/RubyXL/AlternateContent.html +103 -0
- data/rdoc/RubyXL/Authors.html +106 -0
- data/rdoc/RubyXL/AutoFilter.html +106 -0
- data/rdoc/RubyXL/AutoFilterColumn.html +106 -0
- data/rdoc/RubyXL/BinaryImageFile.html +122 -0
- data/rdoc/RubyXL/BodyProperties.html +106 -0
- data/rdoc/RubyXL/BooleanNode.html +103 -0
- data/rdoc/RubyXL/BooleanValue.html +103 -0
- data/rdoc/RubyXL/Border.html +275 -0
- data/rdoc/RubyXL/BorderEdge.html +189 -0
- data/rdoc/RubyXL/Borders.html +157 -0
- data/rdoc/RubyXL/Break.html +106 -0
- data/rdoc/RubyXL/BreakList.html +106 -0
- data/rdoc/RubyXL/CT_AdjPoint2D.html +106 -0
- data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +106 -0
- data/rdoc/RubyXL/CT_AlphaModulateEffect.html +106 -0
- data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +106 -0
- data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +106 -0
- data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +106 -0
- data/rdoc/RubyXL/CT_Backdrop.html +106 -0
- data/rdoc/RubyXL/CT_Bevel.html +106 -0
- data/rdoc/RubyXL/CT_BiLevelEffect.html +106 -0
- data/rdoc/RubyXL/CT_BlendEffect.html +106 -0
- data/rdoc/RubyXL/CT_Blip.html +106 -0
- data/rdoc/RubyXL/CT_BlipFillProperties.html +106 -0
- data/rdoc/RubyXL/CT_BlurEffect.html +106 -0
- data/rdoc/RubyXL/CT_Camera.html +106 -0
- data/rdoc/RubyXL/CT_Color.html +106 -0
- data/rdoc/RubyXL/CT_ColorChangeEffect.html +106 -0
- data/rdoc/RubyXL/CT_ColorMapping.html +106 -0
- data/rdoc/RubyXL/CT_ColorScheme.html +106 -0
- data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +106 -0
- data/rdoc/RubyXL/CT_ConnectionSite.html +106 -0
- data/rdoc/RubyXL/CT_ConnectionSiteList.html +106 -0
- data/rdoc/RubyXL/CT_DashStop.html +106 -0
- data/rdoc/RubyXL/CT_DashStopList.html +106 -0
- data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +106 -0
- data/rdoc/RubyXL/CT_DuotoneEffect.html +106 -0
- data/rdoc/RubyXL/CT_EffectContainer.html +106 -0
- data/rdoc/RubyXL/CT_EffectList.html +106 -0
- data/rdoc/RubyXL/CT_EffectReference.html +106 -0
- data/rdoc/RubyXL/CT_EffectStyleItem.html +106 -0
- data/rdoc/RubyXL/CT_EffectStyleList.html +106 -0
- data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +106 -0
- data/rdoc/RubyXL/CT_FillEffect.html +106 -0
- data/rdoc/RubyXL/CT_FillOverlayEffect.html +106 -0
- data/rdoc/RubyXL/CT_FillStyleList.html +106 -0
- data/rdoc/RubyXL/CT_FlatText.html +106 -0
- data/rdoc/RubyXL/CT_FontCollection.html +106 -0
- data/rdoc/RubyXL/CT_FontReference.html +106 -0
- data/rdoc/RubyXL/CT_GeomGuideList.html +106 -0
- data/rdoc/RubyXL/CT_GlowEffect.html +106 -0
- data/rdoc/RubyXL/CT_GradientFillProperties.html +106 -0
- data/rdoc/RubyXL/CT_GradientStop.html +106 -0
- data/rdoc/RubyXL/CT_GradientStopList.html +106 -0
- data/rdoc/RubyXL/CT_HSLEffect.html +106 -0
- data/rdoc/RubyXL/CT_HslColor.html +106 -0
- data/rdoc/RubyXL/CT_Hyperlink.html +106 -0
- data/rdoc/RubyXL/CT_InnerShadowEffect.html +106 -0
- data/rdoc/RubyXL/CT_LightRig.html +106 -0
- data/rdoc/RubyXL/CT_LineEndProperties.html +106 -0
- data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +106 -0
- data/rdoc/RubyXL/CT_LineProperties.html +106 -0
- data/rdoc/RubyXL/CT_LineStyleList.html +106 -0
- data/rdoc/RubyXL/CT_LinearShadeProperties.html +106 -0
- data/rdoc/RubyXL/CT_LuminanceEffect.html +106 -0
- data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +106 -0
- data/rdoc/RubyXL/CT_OuterShadowEffect.html +106 -0
- data/rdoc/RubyXL/CT_Path2D.html +106 -0
- data/rdoc/RubyXL/CT_Path2DArcTo.html +106 -0
- data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +106 -0
- data/rdoc/RubyXL/CT_Path2DList.html +106 -0
- data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +106 -0
- data/rdoc/RubyXL/CT_Path2DTo.html +106 -0
- data/rdoc/RubyXL/CT_PathShadeProperties.html +106 -0
- data/rdoc/RubyXL/CT_PatternFillProperties.html +106 -0
- data/rdoc/RubyXL/CT_Point3D.html +106 -0
- data/rdoc/RubyXL/CT_PolarAdjustHandle.html +106 -0
- data/rdoc/RubyXL/CT_PresetColor.html +106 -0
- data/rdoc/RubyXL/CT_PresetLineDashProperties.html +106 -0
- data/rdoc/RubyXL/CT_PresetShadowEffect.html +106 -0
- data/rdoc/RubyXL/CT_PresetTextShape.html +106 -0
- data/rdoc/RubyXL/CT_ReflectionEffect.html +106 -0
- data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +106 -0
- data/rdoc/RubyXL/CT_RelativeRect.html +106 -0
- data/rdoc/RubyXL/CT_SRgbColor.html +106 -0
- data/rdoc/RubyXL/CT_ScRgbColor.html +106 -0
- data/rdoc/RubyXL/CT_Scene3D.html +106 -0
- data/rdoc/RubyXL/CT_SchemeColor.html +106 -0
- data/rdoc/RubyXL/CT_Shape3D.html +106 -0
- data/rdoc/RubyXL/CT_ShapeStyle.html +106 -0
- data/rdoc/RubyXL/CT_SoftEdgesEffect.html +106 -0
- data/rdoc/RubyXL/CT_SphereCoords.html +106 -0
- data/rdoc/RubyXL/CT_StretchInfoProperties.html +106 -0
- data/rdoc/RubyXL/CT_StyleMatrix.html +106 -0
- data/rdoc/RubyXL/CT_StyleMatrixReference.html +106 -0
- data/rdoc/RubyXL/CT_SupplementalFont.html +106 -0
- data/rdoc/RubyXL/CT_SystemColor.html +106 -0
- data/rdoc/RubyXL/CT_TextAutonumberBullet.html +106 -0
- data/rdoc/RubyXL/CT_TextBlipBullet.html +106 -0
- data/rdoc/RubyXL/CT_TextCharBullet.html +106 -0
- data/rdoc/RubyXL/CT_TextCharacterProperties.html +106 -0
- data/rdoc/RubyXL/CT_TextFont.html +106 -0
- data/rdoc/RubyXL/CT_TextListStyle.html +106 -0
- data/rdoc/RubyXL/CT_TextNormalAutofit.html +106 -0
- data/rdoc/RubyXL/CT_TextParagraphProperties.html +106 -0
- data/rdoc/RubyXL/CT_TextSpacing.html +106 -0
- data/rdoc/RubyXL/CT_TextTabStop.html +106 -0
- data/rdoc/RubyXL/CT_TextTabStopList.html +106 -0
- data/rdoc/RubyXL/CT_TileInfoProperties.html +106 -0
- data/rdoc/RubyXL/CT_TintEffect.html +106 -0
- data/rdoc/RubyXL/CT_Transform2D.html +106 -0
- data/rdoc/RubyXL/CT_TransformEffect.html +106 -0
- data/rdoc/RubyXL/CT_Vector3D.html +106 -0
- data/rdoc/RubyXL/CT_XYAdjustHandle.html +106 -0
- data/rdoc/RubyXL/CalculationChain.html +176 -0
- data/rdoc/RubyXL/CalculationChainCell.html +106 -0
- data/rdoc/RubyXL/CalculationProperties.html +106 -0
- data/rdoc/RubyXL/Cell.html +558 -0
- data/rdoc/RubyXL/CellConvenienceMethods.html +1211 -0
- data/rdoc/RubyXL/CellExt.html +106 -0
- data/rdoc/RubyXL/CellSmartTag.html +106 -0
- data/rdoc/RubyXL/CellSmartTagProperty.html +106 -0
- data/rdoc/RubyXL/CellSmartTags.html +106 -0
- data/rdoc/RubyXL/CellStyle.html +106 -0
- data/rdoc/RubyXL/CellStyleXFs.html +157 -0
- data/rdoc/RubyXL/CellStyles.html +157 -0
- data/rdoc/RubyXL/CellValue.html +158 -0
- data/rdoc/RubyXL/CellWatch.html +106 -0
- data/rdoc/RubyXL/CellWatches.html +106 -0
- data/rdoc/RubyXL/CellXFs.html +161 -0
- data/rdoc/RubyXL/ChartColorsFile.html +122 -0
- data/rdoc/RubyXL/ChartFile.html +189 -0
- data/rdoc/RubyXL/ChartStyleFile.html +122 -0
- data/rdoc/RubyXL/ChartUserShapesFile.html +122 -0
- data/rdoc/RubyXL/Chartsheet.html +260 -0
- data/rdoc/RubyXL/ChartsheetPageSetup.html +106 -0
- data/rdoc/RubyXL/ChartsheetProperties.html +106 -0
- data/rdoc/RubyXL/ChartsheetProtection.html +106 -0
- data/rdoc/RubyXL/ChartsheetView.html +106 -0
- data/rdoc/RubyXL/ChartsheetViews.html +106 -0
- data/rdoc/RubyXL/Color.html +175 -0
- data/rdoc/RubyXL/ColorFilter.html +106 -0
- data/rdoc/RubyXL/ColorScale.html +106 -0
- data/rdoc/RubyXL/ColorSet.html +106 -0
- data/rdoc/RubyXL/Colors.html +106 -0
- data/rdoc/RubyXL/ColumnRange.html +245 -0
- data/rdoc/RubyXL/ColumnRanges.html +289 -0
- data/rdoc/RubyXL/Comment.html +106 -0
- data/rdoc/RubyXL/CommentList.html +106 -0
- data/rdoc/RubyXL/CommentsFile.html +197 -0
- data/rdoc/RubyXL/ConditionalFormatValue.html +106 -0
- data/rdoc/RubyXL/ConditionalFormatting.html +106 -0
- data/rdoc/RubyXL/ConditionalFormattingRule.html +106 -0
- data/rdoc/RubyXL/ContentTypeDefault.html +103 -0
- data/rdoc/RubyXL/ContentTypeOverride.html +103 -0
- data/rdoc/RubyXL/ContentTypes.html +248 -0
- data/rdoc/RubyXL/ControlPropertiesFile.html +117 -0
- data/rdoc/RubyXL/CorePropertiesFile.html +474 -0
- data/rdoc/RubyXL/CustomColor.html +106 -0
- data/rdoc/RubyXL/CustomColorList.html +106 -0
- data/rdoc/RubyXL/CustomFilter.html +106 -0
- data/rdoc/RubyXL/CustomFilters.html +106 -0
- data/rdoc/RubyXL/CustomGeometry.html +106 -0
- data/rdoc/RubyXL/CustomProperties.html +106 -0
- data/rdoc/RubyXL/CustomPropertiesFile.html +122 -0
- data/rdoc/RubyXL/CustomProperty.html +106 -0
- data/rdoc/RubyXL/CustomSheetView.html +106 -0
- data/rdoc/RubyXL/CustomSheetViews.html +106 -0
- data/rdoc/RubyXL/CustomWorkbookView.html +106 -0
- data/rdoc/RubyXL/CustomWorkbookViews.html +106 -0
- data/rdoc/RubyXL/CustomXMLFile.html +117 -0
- data/rdoc/RubyXL/DXF.html +106 -0
- data/rdoc/RubyXL/DXFs.html +106 -0
- data/rdoc/RubyXL/DataBar.html +106 -0
- data/rdoc/RubyXL/DataConsolidate.html +106 -0
- data/rdoc/RubyXL/DataConsolidationReference.html +106 -0
- data/rdoc/RubyXL/DataConsolidationReferences.html +106 -0
- data/rdoc/RubyXL/DataType.html +143 -0
- data/rdoc/RubyXL/DataValidation.html +106 -0
- data/rdoc/RubyXL/DataValidations.html +106 -0
- data/rdoc/RubyXL/DateGroupItem.html +106 -0
- data/rdoc/RubyXL/DefinedName.html +106 -0
- data/rdoc/RubyXL/DefinedNameExt.html +106 -0
- data/rdoc/RubyXL/DefinedNames.html +106 -0
- data/rdoc/RubyXL/DefinedNamesExt.html +106 -0
- data/rdoc/RubyXL/DocumentPropertiesFile.html +255 -0
- data/rdoc/RubyXL/DrawingFile.html +188 -0
- data/rdoc/RubyXL/DynamicFilter.html +106 -0
- data/rdoc/RubyXL/EmbeddedControl.html +106 -0
- data/rdoc/RubyXL/EmbeddedControls.html +106 -0
- data/rdoc/RubyXL/Extension.html +106 -0
- data/rdoc/RubyXL/ExtensionStorageArea.html +106 -0
- data/rdoc/RubyXL/Extents.html +106 -0
- data/rdoc/RubyXL/ExternalBook.html +106 -0
- data/rdoc/RubyXL/ExternalLinksFile.html +184 -0
- data/rdoc/RubyXL/ExternalReference.html +106 -0
- data/rdoc/RubyXL/ExternalReferences.html +106 -0
- data/rdoc/RubyXL/ExtraColorSchemeList.html +106 -0
- data/rdoc/RubyXL/FieldItem.html +106 -0
- data/rdoc/RubyXL/FileRecoveryProperties.html +106 -0
- data/rdoc/RubyXL/FileSharing.html +106 -0
- data/rdoc/RubyXL/FileVersion.html +106 -0
- data/rdoc/RubyXL/Fill.html +157 -0
- data/rdoc/RubyXL/Fills.html +157 -0
- data/rdoc/RubyXL/FilterContainer.html +106 -0
- data/rdoc/RubyXL/FloatNode.html +103 -0
- data/rdoc/RubyXL/FloatValue.html +103 -0
- data/rdoc/RubyXL/Font.html +184 -0
- data/rdoc/RubyXL/FontConvenienceMethods.html +603 -0
- data/rdoc/RubyXL/FontScheme.html +106 -0
- data/rdoc/RubyXL/Fonts.html +157 -0
- data/rdoc/RubyXL/Formula.html +106 -0
- data/rdoc/RubyXL/FunctionGroup.html +106 -0
- data/rdoc/RubyXL/FunctionGroups.html +106 -0
- data/rdoc/RubyXL/GenericStorageObject.html +298 -0
- data/rdoc/RubyXL/GradientFill.html +106 -0
- data/rdoc/RubyXL/HeaderFooterSettings.html +106 -0
- data/rdoc/RubyXL/Hyperlink.html +106 -0
- data/rdoc/RubyXL/HyperlinkRelFile.html +117 -0
- data/rdoc/RubyXL/Hyperlinks.html +106 -0
- data/rdoc/RubyXL/IconFilter.html +106 -0
- data/rdoc/RubyXL/IconSet.html +106 -0
- data/rdoc/RubyXL/IgnoredError.html +106 -0
- data/rdoc/RubyXL/IgnoredErrors.html +106 -0
- data/rdoc/RubyXL/IndexedColors.html +106 -0
- data/rdoc/RubyXL/InputCells.html +106 -0
- data/rdoc/RubyXL/IntegerNode.html +103 -0
- data/rdoc/RubyXL/IntegerValue.html +103 -0
- data/rdoc/RubyXL/LegacyCell.html +181 -0
- data/rdoc/RubyXL/LegacyWorksheet.html +355 -0
- data/rdoc/RubyXL/MRUColors.html +106 -0
- data/rdoc/RubyXL/MacrosFile.html +122 -0
- data/rdoc/RubyXL/MergedCell.html +106 -0
- data/rdoc/RubyXL/MergedCells.html +106 -0
- data/rdoc/RubyXL/NumFmt.html +106 -0
- data/rdoc/RubyXL/NumberFormat.html +158 -0
- data/rdoc/RubyXL/NumberFormats.html +172 -0
- data/rdoc/RubyXL/OLEObject.html +106 -0
- data/rdoc/RubyXL/OLEObjectFile.html +122 -0
- data/rdoc/RubyXL/OLEObjects.html +106 -0
- data/rdoc/RubyXL/OLESize.html +106 -0
- data/rdoc/RubyXL/OOXMLContainerObject.html +394 -0
- data/rdoc/RubyXL/OOXMLObject.html +118 -0
- data/rdoc/RubyXL/OOXMLObjectClassMethods.html +532 -0
- data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +564 -0
- data/rdoc/RubyXL/OOXMLRelationshipsFile.html +603 -0
- data/rdoc/RubyXL/OOXMLTopLevelObject.html +384 -0
- data/rdoc/RubyXL/Offset.html +106 -0
- data/rdoc/RubyXL/OutlineProperties.html +106 -0
- data/rdoc/RubyXL/PageMargins.html +106 -0
- data/rdoc/RubyXL/PageSetup.html +106 -0
- data/rdoc/RubyXL/PageSetupProperties.html +106 -0
- data/rdoc/RubyXL/Pane.html +106 -0
- data/rdoc/RubyXL/Parser.html +204 -0
- data/rdoc/RubyXL/PatternFill.html +106 -0
- data/rdoc/RubyXL/PhoneticProperties.html +106 -0
- data/rdoc/RubyXL/PhoneticRun.html +106 -0
- data/rdoc/RubyXL/PivotArea.html +106 -0
- data/rdoc/RubyXL/PivotCache.html +106 -0
- data/rdoc/RubyXL/PivotCacheDefinitionFile.html +133 -0
- data/rdoc/RubyXL/PivotCacheRecordsFile.html +122 -0
- data/rdoc/RubyXL/PivotCaches.html +106 -0
- data/rdoc/RubyXL/PivotReference.html +106 -0
- data/rdoc/RubyXL/PivotReferences.html +106 -0
- data/rdoc/RubyXL/PivotTableFile.html +133 -0
- data/rdoc/RubyXL/PivotTableSelection.html +106 -0
- data/rdoc/RubyXL/PresetGeometry.html +106 -0
- data/rdoc/RubyXL/PrintOptions.html +106 -0
- data/rdoc/RubyXL/PrinterSettingsFile.html +122 -0
- data/rdoc/RubyXL/ProtectedRange.html +106 -0
- data/rdoc/RubyXL/ProtectedRanges.html +106 -0
- data/rdoc/RubyXL/Protection.html +106 -0
- data/rdoc/RubyXL/RID.html +103 -0
- data/rdoc/RubyXL/RawOOXML.html +223 -0
- data/rdoc/RubyXL/Reference.html +640 -0
- data/rdoc/RubyXL/Relationship.html +103 -0
- data/rdoc/RubyXL/RelationshipSupport.html +419 -0
- data/rdoc/RubyXL/RelationshipSupport/ClassMehods.html +148 -0
- data/rdoc/RubyXL/RichText.html +159 -0
- data/rdoc/RubyXL/RichTextRun.html +157 -0
- data/rdoc/RubyXL/Row.html +439 -0
- data/rdoc/RubyXL/RowExt.html +106 -0
- data/rdoc/RubyXL/RunProperties.html +106 -0
- data/rdoc/RubyXL/Scenario.html +106 -0
- data/rdoc/RubyXL/Scenarios.html +106 -0
- data/rdoc/RubyXL/Selection.html +165 -0
- data/rdoc/RubyXL/ShapeGuide.html +106 -0
- data/rdoc/RubyXL/ShapeTextRectangle.html +106 -0
- data/rdoc/RubyXL/SharedStringsTable.html +424 -0
- data/rdoc/RubyXL/Sheet.html +106 -0
- data/rdoc/RubyXL/SheetCalculationProperties.html +106 -0
- data/rdoc/RubyXL/SheetData.html +192 -0
- data/rdoc/RubyXL/SheetDataExt.html +106 -0
- data/rdoc/RubyXL/SheetDataSet.html +106 -0
- data/rdoc/RubyXL/SheetName.html +106 -0
- data/rdoc/RubyXL/SheetNames.html +106 -0
- data/rdoc/RubyXL/Sheets.html +106 -0
- data/rdoc/RubyXL/SlicerCacheFile.html +122 -0
- data/rdoc/RubyXL/SlicerFile.html +122 -0
- data/rdoc/RubyXL/SmartTagProperties.html +106 -0
- data/rdoc/RubyXL/SmartTagType.html +106 -0
- data/rdoc/RubyXL/SmartTagTypes.html +106 -0
- data/rdoc/RubyXL/SmartTags.html +106 -0
- data/rdoc/RubyXL/SortCondition.html +106 -0
- data/rdoc/RubyXL/SortState.html +106 -0
- data/rdoc/RubyXL/Sqref.html +197 -0
- data/rdoc/RubyXL/Stop.html +106 -0
- data/rdoc/RubyXL/StringNode.html +103 -0
- data/rdoc/RubyXL/StringNodeW3C.html +197 -0
- data/rdoc/RubyXL/StringValue.html +103 -0
- data/rdoc/RubyXL/Stylesheet.html +354 -0
- data/rdoc/RubyXL/TableFile.html +122 -0
- data/rdoc/RubyXL/TableParts.html +103 -0
- data/rdoc/RubyXL/TableStyle.html +106 -0
- data/rdoc/RubyXL/TableStyles.html +106 -0
- data/rdoc/RubyXL/Text.html +216 -0
- data/rdoc/RubyXL/Theme.html +535 -0
- data/rdoc/RubyXL/ThemeElements.html +106 -0
- data/rdoc/RubyXL/ThumbnailFile.html +122 -0
- data/rdoc/RubyXL/Top10.html +106 -0
- data/rdoc/RubyXL/VMLDrawingFile.html +134 -0
- data/rdoc/RubyXL/Variant.html +106 -0
- data/rdoc/RubyXL/Vector.html +161 -0
- data/rdoc/RubyXL/VectorValue.html +103 -0
- data/rdoc/RubyXL/VisualProperties.html +106 -0
- data/rdoc/RubyXL/WebPublishObject.html +106 -0
- data/rdoc/RubyXL/WebPublishObjects.html +106 -0
- data/rdoc/RubyXL/WebPublishingItem.html +106 -0
- data/rdoc/RubyXL/WebPublishingItems.html +106 -0
- data/rdoc/RubyXL/WebPublishingProperties.html +106 -0
- data/rdoc/RubyXL/Workbook.html +633 -0
- data/rdoc/RubyXL/WorkbookConvenienceMethods.html +1321 -0
- data/rdoc/RubyXL/WorkbookProperties.html +106 -0
- data/rdoc/RubyXL/WorkbookProtection.html +106 -0
- data/rdoc/RubyXL/WorkbookRoot.html +402 -0
- data/rdoc/RubyXL/WorkbookView.html +106 -0
- data/rdoc/RubyXL/WorkbookViews.html +106 -0
- data/rdoc/RubyXL/Worksheet.html +433 -0
- data/rdoc/RubyXL/WorksheetConvenienceMethods.html +2861 -0
- data/rdoc/RubyXL/WorksheetDimensions.html +106 -0
- data/rdoc/RubyXL/WorksheetFormatProperties.html +103 -0
- data/rdoc/RubyXL/WorksheetProperties.html +106 -0
- data/rdoc/RubyXL/WorksheetProtection.html +106 -0
- data/rdoc/RubyXL/WorksheetView.html +106 -0
- data/rdoc/RubyXL/WorksheetViews.html +106 -0
- data/rdoc/RubyXL/XF.html +106 -0
- data/rdoc/created.rid +38 -0
- data/rdoc/css/fonts.css +167 -0
- data/rdoc/css/rdoc.css +590 -0
- data/rdoc/fonts/Lato-Light.ttf +0 -0
- data/rdoc/fonts/Lato-LightItalic.ttf +0 -0
- data/rdoc/fonts/Lato-Regular.ttf +0 -0
- data/rdoc/fonts/Lato-RegularItalic.ttf +0 -0
- data/rdoc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/rdoc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/rdoc/images/add.png +0 -0
- data/rdoc/images/arrow_up.png +0 -0
- data/rdoc/images/brick.png +0 -0
- data/rdoc/images/brick_link.png +0 -0
- data/rdoc/images/bug.png +0 -0
- data/rdoc/images/bullet_black.png +0 -0
- data/rdoc/images/bullet_toggle_minus.png +0 -0
- data/rdoc/images/bullet_toggle_plus.png +0 -0
- data/rdoc/images/date.png +0 -0
- data/rdoc/images/delete.png +0 -0
- data/rdoc/images/find.png +0 -0
- data/rdoc/images/loadingAnimation.gif +0 -0
- data/rdoc/images/macFFBgHack.png +0 -0
- data/rdoc/images/package.png +0 -0
- data/rdoc/images/page_green.png +0 -0
- data/rdoc/images/page_white_text.png +0 -0
- data/rdoc/images/page_white_width.png +0 -0
- data/rdoc/images/plugin.png +0 -0
- data/rdoc/images/ruby.png +0 -0
- data/rdoc/images/tag_blue.png +0 -0
- data/rdoc/images/tag_green.png +0 -0
- data/rdoc/images/transparent.png +0 -0
- data/rdoc/images/wrench.png +0 -0
- data/rdoc/images/wrench_orange.png +0 -0
- data/rdoc/images/zoom.png +0 -0
- data/rdoc/index.html +796 -0
- data/rdoc/js/darkfish.js +161 -0
- data/rdoc/js/jquery.js +4 -0
- data/rdoc/js/navigation.js +142 -0
- data/rdoc/js/navigation.js.gz +0 -0
- data/rdoc/js/search.js +109 -0
- data/rdoc/js/search_index.js +1 -0
- data/rdoc/js/search_index.js.gz +0 -0
- data/rdoc/js/searcher.js +229 -0
- data/rdoc/js/searcher.js.gz +0 -0
- data/rdoc/table_of_contents.html +2758 -0
- data/rubyXL.gemspec +516 -0
- data/spec/lib/cell_spec.rb +515 -0
- data/spec/lib/color_spec.rb +13 -0
- data/spec/lib/parser_spec.rb +118 -0
- data/spec/lib/reference_spec.rb +28 -0
- data/spec/lib/stylesheet_spec.rb +28 -0
- data/spec/lib/text_spec.rb +29 -0
- data/spec/lib/workbook_spec.rb +174 -0
- data/spec/lib/worksheet_spec.rb +1363 -0
- data/spec/spec_helper.rb +11 -0
- data/test/input/.gitkeep +0 -0
- data/test/output/.gitkeep +0 -0
- data/test/test_parse_write.rb +15 -0
- data/tmp/.gitignore +1 -0
- metadata +615 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
module RubyXL
|
|
2
|
+
|
|
3
|
+
class GenericStorageObject
|
|
4
|
+
SAVE_ORDER = 0
|
|
5
|
+
|
|
6
|
+
attr_accessor :xlsx_path, :data, :generic_storage
|
|
7
|
+
|
|
8
|
+
def initialize(file_path, data)
|
|
9
|
+
@xlsx_path = file_path
|
|
10
|
+
@data = data
|
|
11
|
+
@generic_storage = []
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def self.parse_file(zip_file, file_path)
|
|
15
|
+
(entry = zip_file.find_entry(RubyXL::from_root(file_path))) && self.new(file_path, entry.get_input_stream { |f| f.read })
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def add_to_zip(zip_stream)
|
|
19
|
+
return false if @data.nil?
|
|
20
|
+
zip_stream.put_next_entry(RubyXL::from_root(self.xlsx_path))
|
|
21
|
+
zip_stream.write(@data)
|
|
22
|
+
true
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
class PrinterSettingsFile < GenericStorageObject
|
|
27
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings'
|
|
28
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/printerSettings'
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
class DrawingFile < GenericStorageObject
|
|
32
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.drawing+xml'
|
|
33
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing'
|
|
34
|
+
|
|
35
|
+
include RubyXL::RelationshipSupport
|
|
36
|
+
|
|
37
|
+
def attach_relationship(rid, rf)
|
|
38
|
+
case rf
|
|
39
|
+
when RubyXL::ChartFile then store_relationship(rf) # TODO
|
|
40
|
+
when RubyXL::BinaryImageFile then store_relationship(rf) # TODO
|
|
41
|
+
else store_relationship(rf, :unknown)
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
class ChartFile < GenericStorageObject
|
|
48
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.drawingml.chart+xml'
|
|
49
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart'
|
|
50
|
+
|
|
51
|
+
include RubyXL::RelationshipSupport
|
|
52
|
+
|
|
53
|
+
def attach_relationship(rid, rf)
|
|
54
|
+
case rf
|
|
55
|
+
when RubyXL::ChartColorsFile then store_relationship(rf) # TODO
|
|
56
|
+
when RubyXL::ChartStyleFile then store_relationship(rf) # TODO
|
|
57
|
+
when RubyXL::ChartUserShapesFile then store_relationship(rf) # TODO
|
|
58
|
+
else store_relationship(rf, :unknown)
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
class BinaryImageFile < GenericStorageObject
|
|
65
|
+
CONTENT_TYPE = 'image/jpeg'
|
|
66
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image'
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
class VMLDrawingFile < GenericStorageObject
|
|
70
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.vmlDrawing'
|
|
71
|
+
# CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.drawingml.chart+xml'
|
|
72
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing'
|
|
73
|
+
|
|
74
|
+
include RubyXL::RelationshipSupport
|
|
75
|
+
|
|
76
|
+
define_relationship(RubyXL::BinaryImageFile)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
class ChartColorsFile < GenericStorageObject
|
|
80
|
+
CONTENT_TYPE = 'application/vnd.ms-office.chartcolorstyle+xml'
|
|
81
|
+
REL_TYPE = 'http://schemas.microsoft.com/office/2011/relationships/chartColorStyle'
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
class ChartStyleFile < GenericStorageObject
|
|
85
|
+
CONTENT_TYPE = 'application/vnd.ms-office.chartstyle+xml'
|
|
86
|
+
REL_TYPE = 'http://schemas.microsoft.com/office/2011/relationships/chartStyle'
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
class TableFile < GenericStorageObject
|
|
90
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml'
|
|
91
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/table'
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
class ControlPropertiesFile < GenericStorageObject
|
|
95
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/ctrlProp'
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
class PivotCacheRecordsFile < GenericStorageObject
|
|
99
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml'
|
|
100
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheRecords'
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
class PivotCacheDefinitionFile < GenericStorageObject
|
|
104
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml'
|
|
105
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition'
|
|
106
|
+
|
|
107
|
+
include RubyXL::RelationshipSupport
|
|
108
|
+
|
|
109
|
+
define_relationship(RubyXL::PivotCacheRecordsFile)
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
class PivotTableFile < GenericStorageObject
|
|
113
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml'
|
|
114
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable'
|
|
115
|
+
|
|
116
|
+
include RubyXL::RelationshipSupport
|
|
117
|
+
|
|
118
|
+
define_relationship(RubyXL::PivotCacheDefinitionFile)
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
class HyperlinkRelFile < GenericStorageObject
|
|
122
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink'
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
class ThumbnailFile < GenericStorageObject
|
|
126
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail'
|
|
127
|
+
CONTENT_TYPE = 'image/x-wmf'
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
class ChartUserShapesFile < GenericStorageObject
|
|
131
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml'
|
|
132
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartUserShapes'
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
class CustomPropertiesFile < GenericStorageObject
|
|
136
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.custom-properties+xml'
|
|
137
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties'
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
class MacrosFile < GenericStorageObject
|
|
141
|
+
CONTENT_TYPE = 'application/vnd.ms-office.vbaProject'
|
|
142
|
+
REL_TYPE = 'http://schemas.microsoft.com/office/2006/relationships/vbaProject'
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
class CustomXMLFile < GenericStorageObject
|
|
146
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml'
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
class SlicerFile < GenericStorageObject
|
|
150
|
+
CONTENT_TYPE = 'application/vnd.ms-excel.slicer+xml'
|
|
151
|
+
REL_TYPE = 'http://schemas.microsoft.com/office/2007/relationships/slicer'
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
class SlicerCacheFile < GenericStorageObject
|
|
155
|
+
CONTENT_TYPE = 'application/vnd.ms-excel.slicerCache+xml'
|
|
156
|
+
REL_TYPE = 'http://schemas.microsoft.com/office/2007/relationships/slicerCache'
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
class OLEObjectFile < GenericStorageObject
|
|
160
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.oleObject'
|
|
161
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject'
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
class ActiveX < GenericStorageObject
|
|
165
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/control'
|
|
166
|
+
|
|
167
|
+
include RubyXL::RelationshipSupport
|
|
168
|
+
|
|
169
|
+
def attach_relationship(rid, rf)
|
|
170
|
+
case rf
|
|
171
|
+
when RubyXL::ChartFile then store_relationship(rf) # TODO
|
|
172
|
+
else store_relationship(rf, :unknown)
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
class ActiveXBinary < GenericStorageObject
|
|
179
|
+
REL_TYPE = 'http://schemas.microsoft.com/office/2006/relationships/activeXControlBinary'
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
end
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
require 'rubyXL/objects/ooxml_object'
|
|
2
|
+
require 'rubyXL/objects/cell_style'
|
|
3
|
+
require 'rubyXL/objects/font'
|
|
4
|
+
require 'rubyXL/objects/fill'
|
|
5
|
+
require 'rubyXL/objects/border'
|
|
6
|
+
require 'rubyXL/objects/extensions'
|
|
7
|
+
|
|
8
|
+
module RubyXL
|
|
9
|
+
|
|
10
|
+
# http://www.datypic.com/sc/ooxml/e-ssml_numFmt-1.html
|
|
11
|
+
class NumberFormat < OOXMLObject
|
|
12
|
+
define_attribute(:numFmtId, :int, :required => true)
|
|
13
|
+
define_attribute(:formatCode, :string, :required => true)
|
|
14
|
+
define_element_name 'numFmt'
|
|
15
|
+
|
|
16
|
+
def is_date_format?
|
|
17
|
+
# v-------- Toss all the escaped chars -------v v--- and see if any date-related remained
|
|
18
|
+
!!(format_code.gsub(/(\"[^\"]*\"|\[[^\]]*\]|[\\_*].)/i, '') =~ /[dmyhs]/i)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# http://www.datypic.com/sc/ooxml/e-ssml_numFmts-1.html
|
|
24
|
+
class NumberFormats < OOXMLContainerObject
|
|
25
|
+
define_child_node(RubyXL::NumberFormat, :collection => :with_count)
|
|
26
|
+
define_element_name 'numFmts'
|
|
27
|
+
|
|
28
|
+
# https://support.office.com/en-us/article/5026bbd6-04bc-48cd-bf33-80f18b4eae68
|
|
29
|
+
DEFAULT_NUMBER_FORMATS = self.new(:_ => [
|
|
30
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 1, :format_code => '0'),
|
|
31
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 2, :format_code => '0.00'),
|
|
32
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 3, :format_code => '#, ##0'),
|
|
33
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 4, :format_code => '#, ##0.00'),
|
|
34
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 5, :format_code => '$#, ##0_);($#, ##0)'),
|
|
35
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 6, :format_code => '$#, ##0_);[Red]($#, ##0)'),
|
|
36
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 7, :format_code => '$#, ##0.00_);($#, ##0.00)'),
|
|
37
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 8, :format_code => '$#, ##0.00_);[Red]($#, ##0.00)'),
|
|
38
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 9, :format_code => '0%'),
|
|
39
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 10, :format_code => '0.00%'),
|
|
40
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 11, :format_code => '0.00E+00'),
|
|
41
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 12, :format_code => '# ?/?'),
|
|
42
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 13, :format_code => '# ??/??'),
|
|
43
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 14, :format_code => 'm/d/yyyy'),
|
|
44
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 15, :format_code => 'd-mmm-yy'),
|
|
45
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 16, :format_code => 'd-mmm'),
|
|
46
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 17, :format_code => 'mmm-yy'),
|
|
47
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 18, :format_code => 'h:mm AM/PM'),
|
|
48
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 19, :format_code => 'h:mm:ss AM/PM'),
|
|
49
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 20, :format_code => 'h:mm'),
|
|
50
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 21, :format_code => 'h:mm:ss'),
|
|
51
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 22, :format_code => 'm/d/yyyy h:mm'),
|
|
52
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 37, :format_code => '#, ##0_);(#, ##0)'),
|
|
53
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 38, :format_code => '#, ##0_);[Red](#, ##0)'),
|
|
54
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 39, :format_code => '#, ##0.00_);(#, ##0.00)'),
|
|
55
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 40, :format_code => '#, ##0.00_);[Red](#, ##0.00)'),
|
|
56
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 45, :format_code => 'mm:ss'),
|
|
57
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 46, :format_code => '[h]:mm:ss'),
|
|
58
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 47, :format_code => 'mm:ss.0'),
|
|
59
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 48, :format_code => '##0.0E+0'),
|
|
60
|
+
RubyXL::NumberFormat.new(:num_fmt_id => 49, :format_code => '@')
|
|
61
|
+
])
|
|
62
|
+
|
|
63
|
+
def find_by_format_id(format_id)
|
|
64
|
+
self.find { |fmt| fmt.num_fmt_id == format_id }
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# http://www.datypic.com/sc/ooxml/e-ssml_cellStyleXfs-1.html
|
|
70
|
+
class CellStyleXFs < OOXMLContainerObject
|
|
71
|
+
define_child_node(RubyXL::XF, :collection => :with_count)
|
|
72
|
+
define_element_name 'cellStyleXfs'
|
|
73
|
+
|
|
74
|
+
def self.default
|
|
75
|
+
self.new(:_ => [ RubyXL::XF.new(:num_fmt_id => 0, :font_id => 0, :fill_id => 0, :border_id => 0) ])
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# http://www.datypic.com/sc/ooxml/e-ssml_cellXfs-1.html
|
|
80
|
+
class CellXFs < OOXMLContainerObject
|
|
81
|
+
define_child_node(RubyXL::XF, :collection => :with_count)
|
|
82
|
+
define_element_name 'cellXfs'
|
|
83
|
+
|
|
84
|
+
def self.default
|
|
85
|
+
self.new(:_ => [
|
|
86
|
+
RubyXL::XF.new(
|
|
87
|
+
:num_fmt_id => 0, :font_id => 0, :fill_id => 0, :border_id => 0, :xfId => 0
|
|
88
|
+
)
|
|
89
|
+
])
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# http://www.datypic.com/sc/ooxml/e-ssml_cellStyles-1.html
|
|
94
|
+
class CellStyles < OOXMLContainerObject
|
|
95
|
+
define_child_node(RubyXL::CellStyle, :collection => :with_count)
|
|
96
|
+
define_element_name 'cellStyles'
|
|
97
|
+
|
|
98
|
+
def self.default
|
|
99
|
+
self.new(:_ => [ RubyXL::CellStyle.new(:builtin_id => 0, :name => 'Normal', :xf_id => 0) ])
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# http://www.datypic.com/sc/ooxml/e-ssml_dxf-1.html
|
|
104
|
+
class DXF < OOXMLObject
|
|
105
|
+
define_child_node(RubyXL::Font)
|
|
106
|
+
define_child_node(RubyXL::NumberFormat)
|
|
107
|
+
define_child_node(RubyXL::Fill)
|
|
108
|
+
define_child_node(RubyXL::Alignment)
|
|
109
|
+
define_child_node(RubyXL::Border)
|
|
110
|
+
define_child_node(RubyXL::Protection)
|
|
111
|
+
define_child_node(RubyXL::ExtensionStorageArea)
|
|
112
|
+
define_element_name 'dxf'
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# http://www.datypic.com/sc/ooxml/e-ssml_dxfs-1.html
|
|
116
|
+
class DXFs < OOXMLContainerObject
|
|
117
|
+
define_child_node(RubyXL::DXF, :collection => :with_count)
|
|
118
|
+
define_element_name 'dxfs'
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# http://www.datypic.com/sc/ooxml/e-ssml_tableStyle-1.html
|
|
122
|
+
class TableStyle < OOXMLObject
|
|
123
|
+
define_attribute(:name, :string, :required => true)
|
|
124
|
+
define_attribute(:pivot, :bool, :default => true)
|
|
125
|
+
define_attribute(:table, :bool, :default => true)
|
|
126
|
+
define_attribute(:count, :int)
|
|
127
|
+
define_element_name 'tableStyle'
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# http://www.datypic.com/sc/ooxml/e-ssml_tableStyles-1.html
|
|
131
|
+
class TableStyles < OOXMLContainerObject
|
|
132
|
+
define_attribute(:defaultTableStyle, :string)
|
|
133
|
+
define_attribute(:defaultPivotStyle, :string)
|
|
134
|
+
define_child_node(RubyXL::TableStyle, :collection => :with_count)
|
|
135
|
+
define_element_name 'tableStyles'
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# http://www.datypic.com/sc/ooxml/e-ssml_colors-1.html
|
|
139
|
+
class ColorSet < OOXMLObject
|
|
140
|
+
define_child_node(RubyXL::Color, :collection => true)
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# http://www.datypic.com/sc/ooxml/e-ssml_colors-1.html
|
|
144
|
+
class IndexedColors < OOXMLContainerObject
|
|
145
|
+
define_child_node(RubyXL::Color, :collection => true, :node_name => :rgbColor)
|
|
146
|
+
define_element_name 'indexedColors'
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# http://www.datypic.com/sc/ooxml/e-ssml_mruColors-1.html
|
|
150
|
+
class MRUColors < OOXMLContainerObject
|
|
151
|
+
define_child_node(RubyXL::Color, :collection => true)
|
|
152
|
+
define_element_name 'mruColors'
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# http://www.datypic.com/sc/ooxml/e-ssml_colors-1.html
|
|
156
|
+
class Colors < OOXMLObject
|
|
157
|
+
define_child_node(RubyXL::IndexedColors)
|
|
158
|
+
define_child_node(RubyXL::MRUColors)
|
|
159
|
+
define_element_name 'colors'
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# http://www.datypic.com/sc/ooxml/e-ssml_styleSheet.html
|
|
163
|
+
class Stylesheet < OOXMLTopLevelObject
|
|
164
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml'
|
|
165
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles'
|
|
166
|
+
|
|
167
|
+
define_child_node(RubyXL::NumberFormats, :accessor => :number_formats)
|
|
168
|
+
define_child_node(RubyXL::Fonts)
|
|
169
|
+
define_child_node(RubyXL::Fills)
|
|
170
|
+
define_child_node(RubyXL::Borders)
|
|
171
|
+
define_child_node(RubyXL::CellStyleXFs)
|
|
172
|
+
define_child_node(RubyXL::CellXFs)
|
|
173
|
+
define_child_node(RubyXL::CellStyles)
|
|
174
|
+
define_child_node(RubyXL::DXFs)
|
|
175
|
+
define_child_node(RubyXL::TableStyles)
|
|
176
|
+
define_child_node(RubyXL::Colors)
|
|
177
|
+
define_child_node(RubyXL::ExtensionStorageArea)
|
|
178
|
+
define_element_name 'styleSheet'
|
|
179
|
+
set_namespaces('http://schemas.openxmlformats.org/spreadsheetml/2006/main' => nil,
|
|
180
|
+
'http://schemas.openxmlformats.org/officeDocument/2006/relationships' => 'r',
|
|
181
|
+
'http://schemas.openxmlformats.org/markup-compatibility/2006' => 'mc',
|
|
182
|
+
'http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac' => 'x14ac',
|
|
183
|
+
'urn:schemas-microsoft-com:mac:vml' => 'mv')
|
|
184
|
+
|
|
185
|
+
def initialize(*args)
|
|
186
|
+
super
|
|
187
|
+
@format_hash = nil
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
def xlsx_path
|
|
191
|
+
ROOT.join('xl', 'styles.xml')
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
def self.default
|
|
195
|
+
self.new(:fonts => RubyXL::Fonts.default,
|
|
196
|
+
:fills => RubyXL::Fills.default,
|
|
197
|
+
:borders => RubyXL::Borders.default,
|
|
198
|
+
:cell_xfs => RubyXL::CellXFs.default,
|
|
199
|
+
:cell_styles => RubyXL::CellStyles.default,
|
|
200
|
+
:cell_style_xfs => RubyXL::CellStyleXFs.default)
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
def get_number_format_by_id(format_id)
|
|
204
|
+
@format_hash ||= {}
|
|
205
|
+
|
|
206
|
+
if @format_hash[format_id].nil? then
|
|
207
|
+
@format_hash[format_id] = NumberFormats::DEFAULT_NUMBER_FORMATS.find_by_format_id(format_id) ||
|
|
208
|
+
(number_formats && number_formats.find_by_format_id(format_id))
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
@format_hash[format_id]
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
def register_number_format(format_code)
|
|
215
|
+
self.number_formats ||= RubyXL::NumberFormats.new
|
|
216
|
+
|
|
217
|
+
max_fmt_id = 163
|
|
218
|
+
|
|
219
|
+
(NumberFormats::DEFAULT_NUMBER_FORMATS + number_formats).each { |fmt|
|
|
220
|
+
return fmt.num_fmt_id if fmt.format_code == format_code
|
|
221
|
+
max_fmt_id = fmt.num_fmt_id if fmt.num_fmt_id > max_fmt_id
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
max_fmt_id += 1
|
|
225
|
+
number_formats << RubyXL::NumberFormat.new(:num_fmt_id => max_fmt_id, :format_code => format_code)
|
|
226
|
+
|
|
227
|
+
return max_fmt_id
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
end
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
require 'rubyXL/objects/ooxml_object'
|
|
2
|
+
require 'rubyXL/objects/simple_types'
|
|
3
|
+
require 'rubyXL/objects/container_nodes'
|
|
4
|
+
require 'rubyXL/objects/color'
|
|
5
|
+
|
|
6
|
+
module RubyXL
|
|
7
|
+
|
|
8
|
+
# http://www.datypic.com/sc/ooxml/e-ssml_t-1.html
|
|
9
|
+
class Text < OOXMLObject
|
|
10
|
+
define_attribute(:_, :string, :accessor => :value)
|
|
11
|
+
define_attribute(:'xml:space', %w{ preserve })
|
|
12
|
+
define_element_name 't'
|
|
13
|
+
|
|
14
|
+
# http://www.w3.org/TR/REC-xml/#NT-Char:
|
|
15
|
+
# Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
|
|
16
|
+
|
|
17
|
+
INVALID_XML10_CHARS = /([^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}])/
|
|
18
|
+
ESCAPED_UNICODE = /_x([0-9A-F]{4})_/
|
|
19
|
+
|
|
20
|
+
def before_write_xml
|
|
21
|
+
preserve_whitespace
|
|
22
|
+
self.value.gsub!(INVALID_XML10_CHARS) { |c| "_x%04x_" % c.ord }
|
|
23
|
+
true
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def to_s
|
|
27
|
+
value.to_s.gsub(ESCAPED_UNICODE) { |m| $1.hex.chr(::Encoding::UTF_8) }
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# http://www.datypic.com/sc/ooxml/e-ssml_rPr-1.html
|
|
32
|
+
class RunProperties < OOXMLObject
|
|
33
|
+
define_child_node(RubyXL::StringValue, :node_name => :rFont)
|
|
34
|
+
define_child_node(RubyXL::IntegerValue, :node_name => :charset)
|
|
35
|
+
define_child_node(RubyXL::IntegerValue, :node_name => :family)
|
|
36
|
+
define_child_node(RubyXL::BooleanValue, :node_name => :b)
|
|
37
|
+
define_child_node(RubyXL::BooleanValue, :node_name => :i)
|
|
38
|
+
define_child_node(RubyXL::BooleanValue, :node_name => :strike)
|
|
39
|
+
define_child_node(RubyXL::BooleanValue, :node_name => :outline)
|
|
40
|
+
define_child_node(RubyXL::BooleanValue, :node_name => :shadow)
|
|
41
|
+
define_child_node(RubyXL::BooleanValue, :node_name => :condense)
|
|
42
|
+
define_child_node(RubyXL::BooleanValue, :node_name => :extend)
|
|
43
|
+
define_child_node(RubyXL::Color)
|
|
44
|
+
define_child_node(RubyXL::FloatValue, :node_name => :sz)
|
|
45
|
+
define_child_node(RubyXL::BooleanValue, :node_name => :u)
|
|
46
|
+
define_child_node(RubyXL::StringValue, :node_name => :vertAlign)
|
|
47
|
+
define_child_node(RubyXL::StringValue, :node_name => :scheme)
|
|
48
|
+
define_element_name 'rPr'
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# http://www.datypic.com/sc/ooxml/e-ssml_r-2.html
|
|
52
|
+
class RichTextRun < OOXMLObject
|
|
53
|
+
define_child_node(RubyXL::RunProperties)
|
|
54
|
+
define_child_node(RubyXL::Text)
|
|
55
|
+
define_element_name 'r'
|
|
56
|
+
|
|
57
|
+
def to_s
|
|
58
|
+
t.to_s
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# http://www.datypic.com/sc/ooxml/e-ssml_rPh-1.html
|
|
64
|
+
class PhoneticRun < OOXMLObject
|
|
65
|
+
define_attribute(:sb, :int, :required => true)
|
|
66
|
+
define_attribute(:eb, :int, :required => true)
|
|
67
|
+
define_child_node(RubyXL::Text)
|
|
68
|
+
define_element_name 'rPh'
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# http://www.datypic.com/sc/ooxml/e-ssml_phoneticPr-1.html
|
|
72
|
+
class PhoneticProperties < OOXMLObject
|
|
73
|
+
define_attribute(:fontId, :int, :required => true)
|
|
74
|
+
define_attribute(:type, RubyXL::ST_PhoneticType, :default => 'fullwidthKatakana')
|
|
75
|
+
define_attribute(:alignment, RubyXL::ST_PhoneticAlignment, :default => 'left')
|
|
76
|
+
define_element_name 'phoneticPr'
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# http://www.datypic.com/sc/ooxml/e-ssml_is-1.html
|
|
80
|
+
class RichText < OOXMLObject
|
|
81
|
+
define_child_node(RubyXL::Text)
|
|
82
|
+
define_child_node(RubyXL::RichTextRun, :collection => true)
|
|
83
|
+
define_child_node(RubyXL::PhoneticRun, :collection => true)
|
|
84
|
+
define_child_node(RubyXL::PhoneticProperties)
|
|
85
|
+
define_element_name 'is'
|
|
86
|
+
|
|
87
|
+
def to_s
|
|
88
|
+
str = t.to_s
|
|
89
|
+
r && r.each { |rtr| str << rtr.to_s if rtr }
|
|
90
|
+
str
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
end
|