rubyXL 3.4.25 → 3.4.38
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 +4 -4
- data/.circleci/config.yml +24 -13
- data/.rubocop.yml +124 -0
- data/CHANGELOG.md +12 -0
- data/Gemfile +4 -2
- data/README.rdoc +24 -8
- data/VERSION +1 -1
- data/lib/rubyXL/convenience_methods/cell.rb +8 -7
- data/lib/rubyXL/convenience_methods/color.rb +6 -6
- data/lib/rubyXL/convenience_methods/workbook.rb +7 -7
- data/lib/rubyXL/convenience_methods/worksheet.rb +26 -6
- data/lib/rubyXL/objects/border.rb +6 -1
- data/lib/rubyXL/objects/cell_style.rb +1 -0
- data/lib/rubyXL/objects/color.rb +1 -1
- data/lib/rubyXL/objects/column_range.rb +16 -12
- data/lib/rubyXL/objects/document_properties.rb +1 -0
- data/lib/rubyXL/objects/external_links.rb +8 -0
- data/lib/rubyXL/objects/ooxml_object.rb +21 -17
- data/lib/rubyXL/objects/query_table.rb +4 -2
- data/lib/rubyXL/objects/reference.rb +56 -20
- data/lib/rubyXL/objects/relationships.rb +1 -1
- data/lib/rubyXL/objects/root.rb +1 -1
- data/lib/rubyXL/objects/shared_strings.rb +1 -1
- data/lib/rubyXL/objects/sheet_data.rb +11 -6
- data/lib/rubyXL/objects/storage.rb +6 -1
- data/lib/rubyXL/objects/stylesheet.rb +2 -3
- data/lib/rubyXL/objects/text.rb +3 -3
- data/lib/rubyXL/objects/theme.rb +15 -17
- data/lib/rubyXL/objects/workbook.rb +17 -9
- data/lib/rubyXL/objects/worksheet.rb +2 -2
- data/lib/rubyXL/worksheet.rb +11 -3
- data/rdoc/README_rdoc.html +536 -147
- data/rdoc/RubyXL/AExtension.html +605 -85
- data/rdoc/RubyXL/AExtensionStorageArea.html +493 -47
- data/rdoc/RubyXL/ActiveX.html +574 -74
- data/rdoc/RubyXL/ActiveXBinary.html +503 -49
- data/rdoc/RubyXL/AdjustHandleList.html +487 -47
- data/rdoc/RubyXL/Alignment.html +487 -47
- data/rdoc/RubyXL/AlternateContent.html +493 -47
- data/rdoc/RubyXL/AlternateUrls.html +539 -0
- data/rdoc/RubyXL/Authors.html +487 -47
- data/rdoc/RubyXL/AutoFilter.html +487 -47
- data/rdoc/RubyXL/AutoFilterColumn.html +487 -47
- data/rdoc/RubyXL/BinaryImageFile.html +510 -50
- data/rdoc/RubyXL/BodyProperties.html +487 -47
- data/rdoc/RubyXL/BooleanNode.html +493 -47
- data/rdoc/RubyXL/BooleanValue.html +493 -47
- data/rdoc/RubyXL/Border.html +640 -97
- data/rdoc/RubyXL/BorderEdge.html +578 -78
- data/rdoc/RubyXL/Borders.html +540 -68
- data/rdoc/RubyXL/Break.html +487 -47
- data/rdoc/RubyXL/BreakList.html +487 -47
- data/rdoc/RubyXL/CT_AdjPoint2D.html +487 -47
- data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +487 -47
- data/rdoc/RubyXL/CT_AlphaModulateEffect.html +487 -47
- data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +487 -47
- data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +487 -47
- data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +487 -47
- data/rdoc/RubyXL/CT_Backdrop.html +487 -47
- data/rdoc/RubyXL/CT_Bevel.html +487 -47
- data/rdoc/RubyXL/CT_BiLevelEffect.html +487 -47
- data/rdoc/RubyXL/CT_BlendEffect.html +487 -47
- data/rdoc/RubyXL/CT_Blip.html +487 -47
- data/rdoc/RubyXL/CT_BlipFillProperties.html +487 -47
- data/rdoc/RubyXL/CT_BlurEffect.html +487 -47
- data/rdoc/RubyXL/CT_Camera.html +487 -47
- data/rdoc/RubyXL/CT_Color.html +487 -47
- data/rdoc/RubyXL/CT_ColorChangeEffect.html +487 -47
- data/rdoc/RubyXL/CT_ColorMapping.html +487 -47
- data/rdoc/RubyXL/CT_ColorScheme.html +487 -47
- data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +487 -47
- data/rdoc/RubyXL/CT_ConnectionSite.html +487 -47
- data/rdoc/RubyXL/CT_ConnectionSiteList.html +487 -47
- data/rdoc/RubyXL/CT_DashStop.html +487 -47
- data/rdoc/RubyXL/CT_DashStopList.html +487 -47
- data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +487 -47
- data/rdoc/RubyXL/CT_DuotoneEffect.html +487 -47
- data/rdoc/RubyXL/CT_EffectContainer.html +487 -47
- data/rdoc/RubyXL/CT_EffectList.html +487 -47
- data/rdoc/RubyXL/CT_EffectReference.html +487 -47
- data/rdoc/RubyXL/CT_EffectStyleItem.html +487 -47
- data/rdoc/RubyXL/CT_EffectStyleList.html +487 -47
- data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +487 -47
- data/rdoc/RubyXL/CT_FillEffect.html +487 -47
- data/rdoc/RubyXL/CT_FillOverlayEffect.html +487 -47
- data/rdoc/RubyXL/CT_FillStyleList.html +487 -47
- data/rdoc/RubyXL/CT_FlatText.html +487 -47
- data/rdoc/RubyXL/CT_FontCollection.html +487 -47
- data/rdoc/RubyXL/CT_FontReference.html +487 -47
- data/rdoc/RubyXL/CT_GeomGuideList.html +487 -47
- data/rdoc/RubyXL/CT_GlowEffect.html +487 -47
- data/rdoc/RubyXL/CT_GradientFillProperties.html +487 -47
- data/rdoc/RubyXL/CT_GradientStop.html +487 -47
- data/rdoc/RubyXL/CT_GradientStopList.html +487 -47
- data/rdoc/RubyXL/CT_HSLEffect.html +487 -47
- data/rdoc/RubyXL/CT_HslColor.html +487 -47
- data/rdoc/RubyXL/CT_Hyperlink.html +487 -47
- data/rdoc/RubyXL/CT_InnerShadowEffect.html +487 -47
- data/rdoc/RubyXL/CT_LightRig.html +487 -47
- data/rdoc/RubyXL/CT_LineEndProperties.html +487 -47
- data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +487 -47
- data/rdoc/RubyXL/CT_LineProperties.html +487 -47
- data/rdoc/RubyXL/CT_LineStyleList.html +487 -47
- data/rdoc/RubyXL/CT_LinearShadeProperties.html +487 -47
- data/rdoc/RubyXL/CT_LuminanceEffect.html +487 -47
- data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +487 -47
- data/rdoc/RubyXL/CT_OuterShadowEffect.html +487 -47
- data/rdoc/RubyXL/CT_Path2D.html +487 -47
- data/rdoc/RubyXL/CT_Path2DArcTo.html +487 -47
- data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +487 -47
- data/rdoc/RubyXL/CT_Path2DList.html +487 -47
- data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +487 -47
- data/rdoc/RubyXL/CT_Path2DTo.html +487 -47
- data/rdoc/RubyXL/CT_PathShadeProperties.html +487 -47
- data/rdoc/RubyXL/CT_PatternFillProperties.html +487 -47
- data/rdoc/RubyXL/CT_Point3D.html +487 -47
- data/rdoc/RubyXL/CT_PolarAdjustHandle.html +487 -47
- data/rdoc/RubyXL/CT_PresetColor.html +487 -47
- data/rdoc/RubyXL/CT_PresetLineDashProperties.html +487 -47
- data/rdoc/RubyXL/CT_PresetShadowEffect.html +487 -47
- data/rdoc/RubyXL/CT_PresetTextShape.html +487 -47
- data/rdoc/RubyXL/CT_ReflectionEffect.html +487 -47
- data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +487 -47
- data/rdoc/RubyXL/CT_RelativeRect.html +487 -47
- data/rdoc/RubyXL/CT_SRgbColor.html +487 -47
- data/rdoc/RubyXL/CT_ScRgbColor.html +487 -47
- data/rdoc/RubyXL/CT_Scene3D.html +487 -47
- data/rdoc/RubyXL/CT_SchemeColor.html +487 -47
- data/rdoc/RubyXL/CT_Shape3D.html +487 -47
- data/rdoc/RubyXL/CT_ShapeStyle.html +487 -47
- data/rdoc/RubyXL/CT_SoftEdgesEffect.html +487 -47
- data/rdoc/RubyXL/CT_SphereCoords.html +487 -47
- data/rdoc/RubyXL/CT_StretchInfoProperties.html +487 -47
- data/rdoc/RubyXL/CT_StyleMatrix.html +487 -47
- data/rdoc/RubyXL/CT_StyleMatrixReference.html +487 -47
- data/rdoc/RubyXL/CT_SupplementalFont.html +487 -47
- data/rdoc/RubyXL/CT_SystemColor.html +487 -47
- data/rdoc/RubyXL/CT_TextAutonumberBullet.html +487 -47
- data/rdoc/RubyXL/CT_TextBlipBullet.html +487 -47
- data/rdoc/RubyXL/CT_TextCharBullet.html +487 -47
- data/rdoc/RubyXL/CT_TextCharacterProperties.html +487 -47
- data/rdoc/RubyXL/CT_TextFont.html +487 -47
- data/rdoc/RubyXL/CT_TextListStyle.html +487 -47
- data/rdoc/RubyXL/CT_TextNormalAutofit.html +487 -47
- data/rdoc/RubyXL/CT_TextParagraphProperties.html +487 -47
- data/rdoc/RubyXL/CT_TextSpacing.html +487 -47
- data/rdoc/RubyXL/CT_TextTabStop.html +487 -47
- data/rdoc/RubyXL/CT_TextTabStopList.html +487 -47
- data/rdoc/RubyXL/CT_TileInfoProperties.html +487 -47
- data/rdoc/RubyXL/CT_TintEffect.html +487 -47
- data/rdoc/RubyXL/CT_Transform2D.html +487 -47
- data/rdoc/RubyXL/CT_TransformEffect.html +487 -47
- data/rdoc/RubyXL/CT_Vector3D.html +487 -47
- data/rdoc/RubyXL/CT_XYAdjustHandle.html +487 -47
- data/rdoc/RubyXL/CalculationChain.html +557 -71
- data/rdoc/RubyXL/CalculationChainCell.html +487 -47
- data/rdoc/RubyXL/CalculationProperties.html +487 -47
- data/rdoc/RubyXL/Cell.html +1033 -200
- data/rdoc/RubyXL/CellConvenienceMethods.html +1667 -382
- data/rdoc/RubyXL/CellExt.html +487 -47
- data/rdoc/RubyXL/CellSmartTag.html +487 -47
- data/rdoc/RubyXL/CellSmartTagProperty.html +487 -47
- data/rdoc/RubyXL/CellSmartTags.html +487 -47
- data/rdoc/RubyXL/CellStyle.html +487 -47
- data/rdoc/RubyXL/CellStyleXFs.html +540 -68
- data/rdoc/RubyXL/CellStyles.html +540 -68
- data/rdoc/RubyXL/CellValue.html +540 -68
- data/rdoc/RubyXL/CellWatch.html +487 -47
- data/rdoc/RubyXL/CellWatches.html +487 -47
- data/rdoc/RubyXL/CellXFs.html +542 -71
- data/rdoc/RubyXL/ChartColorsFile.html +510 -50
- data/rdoc/RubyXL/ChartFile.html +581 -75
- data/rdoc/RubyXL/ChartStyleFile.html +510 -50
- data/rdoc/RubyXL/ChartUserShapesFile.html +510 -50
- data/rdoc/RubyXL/Chartsheet.html +624 -92
- data/rdoc/RubyXL/ChartsheetPageSetup.html +487 -47
- data/rdoc/RubyXL/ChartsheetProperties.html +487 -47
- data/rdoc/RubyXL/ChartsheetProtection.html +487 -47
- data/rdoc/RubyXL/ChartsheetView.html +487 -47
- data/rdoc/RubyXL/ChartsheetViews.html +487 -47
- data/rdoc/RubyXL/Color.html +550 -70
- data/rdoc/RubyXL/ColorConvenienceClasses/HlsColor.html +626 -94
- data/rdoc/RubyXL/ColorConvenienceClasses/RgbColor.html +671 -105
- data/rdoc/RubyXL/ColorConvenienceClasses.html +482 -45
- data/rdoc/RubyXL/ColorConvenienceMethods.html +534 -65
- data/rdoc/RubyXL/ColorFilter.html +487 -47
- data/rdoc/RubyXL/ColorScale.html +487 -47
- data/rdoc/RubyXL/ColorSet.html +487 -47
- data/rdoc/RubyXL/Colors.html +487 -47
- data/rdoc/RubyXL/ColumnRange.html +685 -92
- data/rdoc/RubyXL/ColumnRanges.html +646 -102
- data/rdoc/RubyXL/Comment.html +487 -47
- data/rdoc/RubyXL/CommentList.html +487 -47
- data/rdoc/RubyXL/CommentsFile.html +570 -76
- data/rdoc/RubyXL/ConditionalFormatValue.html +487 -47
- data/rdoc/RubyXL/ConditionalFormatting.html +487 -47
- data/rdoc/RubyXL/ConditionalFormattingRule.html +487 -47
- data/rdoc/RubyXL/Connection.html +487 -47
- data/rdoc/RubyXL/ConnectionTable.html +487 -47
- data/rdoc/RubyXL/ConnectionTables.html +487 -47
- data/rdoc/RubyXL/ConnectionTextField.html +487 -47
- data/rdoc/RubyXL/ConnectionTextFields.html +487 -47
- data/rdoc/RubyXL/Connections.html +557 -71
- data/rdoc/RubyXL/ContentTypeDefault.html +493 -47
- data/rdoc/RubyXL/ContentTypeOverride.html +493 -47
- data/rdoc/RubyXL/ContentTypes.html +595 -81
- data/rdoc/RubyXL/ControlPropertiesFile.html +510 -50
- data/rdoc/RubyXL/CorePropertiesFile.html +825 -149
- data/rdoc/RubyXL/CustomColor.html +487 -47
- data/rdoc/RubyXL/CustomColorList.html +487 -47
- data/rdoc/RubyXL/CustomFilter.html +487 -47
- data/rdoc/RubyXL/CustomFilters.html +487 -47
- data/rdoc/RubyXL/CustomGeometry.html +487 -47
- data/rdoc/RubyXL/CustomProperties.html +487 -47
- data/rdoc/RubyXL/CustomPropertiesFile.html +510 -50
- data/rdoc/RubyXL/CustomProperty.html +487 -47
- data/rdoc/RubyXL/CustomPropertyFile.html +510 -50
- data/rdoc/RubyXL/CustomSheetView.html +487 -47
- data/rdoc/RubyXL/CustomSheetViews.html +487 -47
- data/rdoc/RubyXL/CustomWorkbookView.html +487 -47
- data/rdoc/RubyXL/CustomWorkbookViews.html +487 -47
- data/rdoc/RubyXL/CustomXMLFile.html +503 -49
- data/rdoc/RubyXL/DXF.html +487 -47
- data/rdoc/RubyXL/DXFs.html +487 -47
- data/rdoc/RubyXL/DataBar.html +487 -47
- data/rdoc/RubyXL/DataConsolidate.html +487 -47
- data/rdoc/RubyXL/DataConsolidationReference.html +487 -47
- data/rdoc/RubyXL/DataConsolidationReferences.html +487 -47
- data/rdoc/RubyXL/DataType.html +528 -53
- data/rdoc/RubyXL/DataValidation.html +487 -47
- data/rdoc/RubyXL/DataValidations.html +487 -47
- data/rdoc/RubyXL/DateGroupItem.html +487 -47
- data/rdoc/RubyXL/DefinedName.html +487 -47
- data/rdoc/RubyXL/DefinedNameExt.html +487 -47
- data/rdoc/RubyXL/DefinedNames.html +564 -47
- data/rdoc/RubyXL/DefinedNamesExt.html +487 -47
- data/rdoc/RubyXL/DocumentPropertiesFile.html +603 -86
- data/rdoc/RubyXL/DrawingFile.html +581 -75
- data/rdoc/RubyXL/DynamicFilter.html +487 -47
- data/rdoc/RubyXL/EmbeddedControl.html +487 -47
- data/rdoc/RubyXL/EmbeddedControls.html +487 -47
- data/rdoc/RubyXL/Extension.html +487 -47
- data/rdoc/RubyXL/ExtensionStorageArea.html +487 -47
- data/rdoc/RubyXL/Extents.html +487 -47
- data/rdoc/RubyXL/ExternalBook.html +487 -47
- data/rdoc/RubyXL/ExternalLinksFile.html +581 -75
- data/rdoc/RubyXL/ExternalReference.html +487 -47
- data/rdoc/RubyXL/ExternalReferences.html +487 -47
- data/rdoc/RubyXL/ExtraColorSchemeList.html +487 -47
- data/rdoc/RubyXL/FieldItem.html +487 -47
- data/rdoc/RubyXL/FileRecoveryProperties.html +487 -47
- data/rdoc/RubyXL/FileSharing.html +487 -47
- data/rdoc/RubyXL/FileVersion.html +487 -47
- data/rdoc/RubyXL/Fill.html +540 -68
- data/rdoc/RubyXL/Fills.html +540 -68
- data/rdoc/RubyXL/FilterContainer.html +487 -47
- data/rdoc/RubyXL/FloatNode.html +493 -47
- data/rdoc/RubyXL/FloatValue.html +493 -47
- data/rdoc/RubyXL/Font.html +551 -71
- data/rdoc/RubyXL/FontConvenienceMethods.html +938 -183
- data/rdoc/RubyXL/FontScheme.html +487 -47
- data/rdoc/RubyXL/Fonts.html +540 -68
- data/rdoc/RubyXL/Formula.html +487 -47
- data/rdoc/RubyXL/FunctionGroup.html +487 -47
- data/rdoc/RubyXL/FunctionGroups.html +487 -47
- data/rdoc/RubyXL/GenericStorageObject.html +671 -103
- data/rdoc/RubyXL/GradientFill.html +487 -47
- data/rdoc/RubyXL/HeaderFooterSettings.html +487 -47
- data/rdoc/RubyXL/Hyperlink.html +487 -47
- data/rdoc/RubyXL/HyperlinkRelFile.html +503 -49
- data/rdoc/RubyXL/Hyperlinks.html +487 -47
- data/rdoc/RubyXL/IconFilter.html +487 -47
- data/rdoc/RubyXL/IconSet.html +487 -47
- data/rdoc/RubyXL/IgnoredError.html +487 -47
- data/rdoc/RubyXL/IgnoredErrors.html +487 -47
- data/rdoc/RubyXL/IndexedColors.html +487 -47
- data/rdoc/RubyXL/InputCells.html +487 -47
- data/rdoc/RubyXL/IntegerNode.html +493 -47
- data/rdoc/RubyXL/IntegerValue.html +493 -47
- data/rdoc/RubyXL/LegacyCell.html +534 -65
- data/rdoc/RubyXL/LegacyWorksheet.html +727 -114
- data/rdoc/RubyXL/MRUColors.html +487 -47
- data/rdoc/RubyXL/MacrosFile.html +510 -50
- data/rdoc/RubyXL/MergedCell.html +487 -47
- data/rdoc/RubyXL/MergedCells.html +487 -47
- data/rdoc/RubyXL/NumFmt.html +487 -47
- data/rdoc/RubyXL/NumberFormat.html +540 -68
- data/rdoc/RubyXL/NumberFormats.html +551 -71
- data/rdoc/RubyXL/OLEObject.html +487 -47
- data/rdoc/RubyXL/OLEObjectFile.html +510 -50
- data/rdoc/RubyXL/OLEObjects.html +487 -47
- data/rdoc/RubyXL/OLESize.html +487 -47
- data/rdoc/RubyXL/OOXMLContainerObject.html +756 -137
- data/rdoc/RubyXL/OOXMLIgnored.html +598 -80
- data/rdoc/RubyXL/OOXMLObject.html +506 -52
- data/rdoc/RubyXL/OOXMLObjectClassMethods.html +741 -151
- data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +834 -169
- data/rdoc/RubyXL/OOXMLRelationshipsFile.html +894 -170
- data/rdoc/RubyXL/OOXMLTopLevelObject.html +735 -131
- data/rdoc/RubyXL/OdbcOleDbProperties.html +487 -47
- data/rdoc/RubyXL/Offset.html +487 -47
- data/rdoc/RubyXL/OlapProperties.html +487 -47
- data/rdoc/RubyXL/OleItem.html +487 -47
- data/rdoc/RubyXL/OleItems.html +487 -47
- data/rdoc/RubyXL/OleLink.html +487 -47
- data/rdoc/RubyXL/OutlineProperties.html +487 -47
- data/rdoc/RubyXL/PageMargins.html +487 -47
- data/rdoc/RubyXL/PageSetup.html +487 -47
- data/rdoc/RubyXL/PageSetupProperties.html +487 -47
- data/rdoc/RubyXL/Pane.html +487 -47
- data/rdoc/RubyXL/Parser.html +578 -78
- data/rdoc/RubyXL/PatternFill.html +487 -47
- data/rdoc/RubyXL/PersonMetadata.html +568 -0
- data/rdoc/RubyXL/PhoneticProperties.html +487 -47
- data/rdoc/RubyXL/PhoneticRun.html +487 -47
- data/rdoc/RubyXL/PivotArea.html +487 -47
- data/rdoc/RubyXL/PivotCache.html +487 -47
- data/rdoc/RubyXL/PivotCacheDefinitionFile.html +529 -55
- data/rdoc/RubyXL/PivotCacheRecordsFile.html +510 -50
- data/rdoc/RubyXL/PivotCaches.html +487 -47
- data/rdoc/RubyXL/PivotReference.html +487 -47
- data/rdoc/RubyXL/PivotReferences.html +487 -47
- data/rdoc/RubyXL/PivotTableFile.html +529 -55
- data/rdoc/RubyXL/PivotTableSelection.html +487 -47
- data/rdoc/RubyXL/PresetGeometry.html +487 -47
- data/rdoc/RubyXL/PrintOptions.html +487 -47
- data/rdoc/RubyXL/PrinterSettingsFile.html +510 -50
- data/rdoc/RubyXL/ProtectedRange.html +487 -47
- data/rdoc/RubyXL/ProtectedRanges.html +487 -47
- data/rdoc/RubyXL/Protection.html +487 -47
- data/rdoc/RubyXL/QueryParameter.html +487 -47
- data/rdoc/RubyXL/QueryParameters.html +487 -47
- data/rdoc/RubyXL/QueryTable.html +575 -75
- data/rdoc/RubyXL/QueryTableDeletedField.html +487 -47
- data/rdoc/RubyXL/QueryTableDeletedFields.html +487 -47
- data/rdoc/RubyXL/QueryTableField.html +487 -47
- data/rdoc/RubyXL/QueryTableFields.html +487 -47
- data/rdoc/RubyXL/QueryTableRefresh.html +487 -47
- data/rdoc/RubyXL/RID.html +493 -47
- data/rdoc/RubyXL/RawOOXML.html +605 -85
- data/rdoc/RubyXL/Reference.html +1109 -207
- data/rdoc/RubyXL/Relationship.html +493 -47
- data/rdoc/RubyXL/RelationshipSupport/ClassMehods.html +540 -65
- data/rdoc/RubyXL/RelationshipSupport.html +745 -126
- data/rdoc/RubyXL/RevisionPointer.html +487 -47
- data/rdoc/RubyXL/RichText.html +542 -70
- data/rdoc/RubyXL/RichTextRun.html +540 -68
- data/rdoc/RubyXL/Row.html +812 -148
- data/rdoc/RubyXL/RowExt.html +487 -47
- data/rdoc/RubyXL/RunProperties.html +487 -47
- data/rdoc/RubyXL/Scenario.html +487 -47
- data/rdoc/RubyXL/Scenarios.html +487 -47
- data/rdoc/RubyXL/Selection.html +540 -68
- data/rdoc/RubyXL/ShapeGuide.html +487 -47
- data/rdoc/RubyXL/ShapeTextRectangle.html +487 -47
- data/rdoc/RubyXL/SharedStringsTable.html +775 -137
- data/rdoc/RubyXL/Sheet.html +487 -47
- data/rdoc/RubyXL/SheetCalculationProperties.html +487 -47
- data/rdoc/RubyXL/SheetData.html +572 -78
- data/rdoc/RubyXL/SheetDataExt.html +487 -47
- data/rdoc/RubyXL/SheetDataSet.html +487 -47
- data/rdoc/RubyXL/SheetMetadata.html +510 -50
- data/rdoc/RubyXL/SheetName.html +487 -47
- data/rdoc/RubyXL/SheetNames.html +487 -47
- data/rdoc/RubyXL/Sheets.html +487 -47
- data/rdoc/RubyXL/SlicerCacheFile.html +510 -50
- data/rdoc/RubyXL/SlicerFile.html +510 -50
- data/rdoc/RubyXL/SmartTagProperties.html +487 -47
- data/rdoc/RubyXL/SmartTagType.html +487 -47
- data/rdoc/RubyXL/SmartTagTypes.html +487 -47
- data/rdoc/RubyXL/SmartTags.html +487 -47
- data/rdoc/RubyXL/SortCondition.html +487 -47
- data/rdoc/RubyXL/SortState.html +487 -47
- data/rdoc/RubyXL/Sqref.html +599 -81
- data/rdoc/RubyXL/Stop.html +487 -47
- data/rdoc/RubyXL/StringNode.html +493 -47
- data/rdoc/RubyXL/StringNodeW3C.html +598 -80
- data/rdoc/RubyXL/StringValue.html +493 -47
- data/rdoc/RubyXL/Stylesheet.html +707 -114
- data/rdoc/RubyXL/TableFile.html +510 -50
- data/rdoc/RubyXL/TableParts.html +493 -47
- data/rdoc/RubyXL/TableStyle.html +487 -47
- data/rdoc/RubyXL/TableStyles.html +487 -47
- data/rdoc/RubyXL/Text.html +591 -83
- data/rdoc/RubyXL/TextImportSettings.html +487 -47
- data/rdoc/RubyXL/Theme.html +651 -103
- data/rdoc/RubyXL/ThemeElements.html +487 -47
- data/rdoc/RubyXL/ThumbnailFile.html +510 -50
- data/rdoc/RubyXL/Top10.html +487 -47
- data/rdoc/RubyXL/VMLDrawingFile.html +530 -56
- data/rdoc/RubyXL/Variant.html +487 -47
- data/rdoc/RubyXL/Vector.html +540 -68
- data/rdoc/RubyXL/VectorValue.html +493 -47
- data/rdoc/RubyXL/VisualProperties.html +487 -47
- data/rdoc/RubyXL/WebPublishObject.html +487 -47
- data/rdoc/RubyXL/WebPublishObjects.html +487 -47
- data/rdoc/RubyXL/WebPublishingItem.html +487 -47
- data/rdoc/RubyXL/WebPublishingItems.html +487 -47
- data/rdoc/RubyXL/WebPublishingProperties.html +487 -47
- data/rdoc/RubyXL/WebQueryProperties.html +487 -47
- data/rdoc/RubyXL/Workbook.html +1560 -367
- data/rdoc/RubyXL/WorkbookConvenienceMethods.html +1069 -226
- data/rdoc/RubyXL/WorkbookProperties.html +487 -47
- data/rdoc/RubyXL/WorkbookProtection.html +487 -47
- data/rdoc/RubyXL/WorkbookRoot.html +741 -123
- data/rdoc/RubyXL/WorkbookView.html +487 -47
- data/rdoc/RubyXL/WorkbookViews.html +487 -47
- data/rdoc/RubyXL/Worksheet.html +840 -154
- data/rdoc/RubyXL/WorksheetConvenienceMethods.html +2725 -699
- data/rdoc/RubyXL/WorksheetDimensions.html +487 -47
- data/rdoc/RubyXL/WorksheetFormatProperties.html +493 -47
- data/rdoc/RubyXL/WorksheetProperties.html +487 -47
- data/rdoc/RubyXL/WorksheetProtection.html +487 -47
- data/rdoc/RubyXL/WorksheetView.html +487 -47
- data/rdoc/RubyXL/WorksheetViews.html +487 -47
- data/rdoc/RubyXL/XF.html +487 -47
- data/rdoc/RubyXL.html +1200 -163
- data/rdoc/created.rid +38 -38
- data/rdoc/css/rdoc.css +1670 -354
- data/rdoc/index.html +418 -433
- data/rdoc/js/aliki.js +511 -0
- data/rdoc/js/bash_highlighter.js +167 -0
- data/rdoc/js/c_highlighter.js +299 -0
- data/rdoc/js/{search.js → search_controller.js} +31 -12
- data/rdoc/js/search_data.js +1 -0
- data/rdoc/js/{navigation.js → search_navigation.js} +10 -10
- data/rdoc/js/search_ranker.js +239 -0
- data/rdoc/js/theme-toggle.js +112 -0
- data/rubyXL.gemspec +27 -70
- data/spec/lib/cell_spec.rb +56 -4
- data/spec/lib/color_spec.rb +7 -0
- data/spec/lib/parser_spec.rb +8 -5
- data/spec/lib/reference_spec.rb +69 -6
- data/spec/lib/rgb_color_spec.rb +2 -0
- data/spec/lib/stylesheet_spec.rb +2 -0
- data/spec/lib/text_spec.rb +3 -1
- data/spec/lib/workbook_spec.rb +6 -4
- data/spec/lib/worksheet_spec.rb +29 -17
- metadata +31 -47
- data/Gemfile.lock +0 -124
- data/rdoc/css/fonts.css +0 -167
- 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/js/darkfish.js +0 -84
- data/rdoc/js/navigation.js.gz +0 -0
- data/rdoc/js/search_index.js +0 -1
- data/rdoc/js/search_index.js.gz +0 -0
- data/rdoc/js/searcher.js +0 -229
- data/rdoc/js/searcher.js.gz +0 -0
- data/rdoc/table_of_contents.html +0 -3010
|
@@ -13,15 +13,17 @@ module RubyXL
|
|
|
13
13
|
# the setter/getter method addresses it in the context of descendant class,
|
|
14
14
|
# which is what we need.
|
|
15
15
|
def obtain_class_variable(var_name, default = nil)
|
|
16
|
-
self.
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
if self.class_variable_defined? var_name
|
|
17
|
+
self.class_variable_get(var_name)
|
|
18
|
+
else
|
|
19
|
+
self.class_variable_set(var_name, default || {})
|
|
20
|
+
end
|
|
19
21
|
end
|
|
20
22
|
|
|
21
23
|
# Defines an attribute of OOXML object.
|
|
22
24
|
# === Parameters
|
|
23
25
|
# * +attribute_name+ - Name of the element attribute as seen in the source XML. Can be either <tt>"String"</tt> or <tt>:Symbol</tt>
|
|
24
|
-
# * Special
|
|
26
|
+
# * Special attribute name <tt>'_'</tt> (underscore) denotes the value of the element rather than attribute.
|
|
25
27
|
# * +attribute_type+ - Specifies the conversion type for the attribute when parsing. Available options are:
|
|
26
28
|
# * +:int+ - <tt>Integer</tt>
|
|
27
29
|
# * +:uint+ - Unsigned <tt>Integer</tt>
|
|
@@ -123,7 +125,9 @@ module RubyXL
|
|
|
123
125
|
end
|
|
124
126
|
|
|
125
127
|
obj = self.new
|
|
126
|
-
|
|
128
|
+
hsh = {}
|
|
129
|
+
node.namespace_definitions.each { |ns| hsh[ns.href] = ns.prefix }
|
|
130
|
+
obj.local_namespaces = hsh
|
|
127
131
|
|
|
128
132
|
known_attributes = obtain_class_variable(:@@ooxml_attributes)
|
|
129
133
|
|
|
@@ -149,8 +153,9 @@ module RubyXL
|
|
|
149
153
|
|
|
150
154
|
node.element_children.each { |child_node|
|
|
151
155
|
ns = child_node.namespace
|
|
152
|
-
|
|
153
|
-
|
|
156
|
+
|
|
157
|
+
prefix = if known_namespaces.has_key?(ns&.href) then known_namespaces[ns&.href]
|
|
158
|
+
else ns&.prefix
|
|
154
159
|
end
|
|
155
160
|
|
|
156
161
|
child_node_name = case prefix
|
|
@@ -254,8 +259,8 @@ module RubyXL
|
|
|
254
259
|
|
|
255
260
|
def ==(other)
|
|
256
261
|
other.is_a?(self.class) &&
|
|
257
|
-
obtain_class_variable(:@@ooxml_attributes).all? { |
|
|
258
|
-
obtain_class_variable(:@@ooxml_child_nodes).all? { |
|
|
262
|
+
obtain_class_variable(:@@ooxml_attributes).all? { |_k, v| self.send(v[:accessor]) == other.send(v[:accessor]) } &&
|
|
263
|
+
obtain_class_variable(:@@ooxml_child_nodes).all? { |_k, v| self.send(v[:accessor]) == other.send(v[:accessor]) }
|
|
259
264
|
end
|
|
260
265
|
|
|
261
266
|
# Recursively write the OOXML object and all its children out as Nokogiri::XML. Immediately before the actual
|
|
@@ -312,12 +317,11 @@ module RubyXL
|
|
|
312
317
|
element_text = attrs.delete('_')
|
|
313
318
|
elem = xml.create_element(node_name_override || obtain_class_variable(:@@ooxml_tag_name), attrs, element_text)
|
|
314
319
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
end
|
|
320
|
+
# First, populate namespaces from the original document
|
|
321
|
+
@local_namespaces&.each_pair { |href, prefix| elem.add_namespace_definition(prefix, href) }
|
|
322
|
+
|
|
323
|
+
# Then, add defaults. Note that if some namespace prefix was already set, Nokogiri will NOT change that namespace.
|
|
324
|
+
obtain_class_variable(:@@ooxml_namespaces).each_pair { |href, prefix| elem.add_namespace_definition(prefix, href) }
|
|
321
325
|
|
|
322
326
|
child_nodes = obtain_class_variable(:@@ooxml_child_nodes)
|
|
323
327
|
child_nodes.each_pair { |child_node_name, child_node_params|
|
|
@@ -355,7 +359,7 @@ module RubyXL
|
|
|
355
359
|
def before_write_xml
|
|
356
360
|
#TODO# This will go away once containers are fully implemented.
|
|
357
361
|
child_nodes = obtain_class_variable(:@@ooxml_child_nodes)
|
|
358
|
-
child_nodes.each_pair { |
|
|
362
|
+
child_nodes.each_pair { |_child_node_name, child_node_params|
|
|
359
363
|
self.count = self.send(child_node_params[:accessor]).size if child_node_params[:is_array] == :with_count
|
|
360
364
|
}
|
|
361
365
|
true
|
|
@@ -369,7 +373,7 @@ module RubyXL
|
|
|
369
373
|
include OOXMLObjectInstanceMethods
|
|
370
374
|
end
|
|
371
375
|
|
|
372
|
-
# Parent class for OOXML
|
|
376
|
+
# Parent class for OOXML container objects (for example,
|
|
373
377
|
# <tt><fonts><font>...</font><font>...</font></fonts></tt>
|
|
374
378
|
# that obscures the top-level container, allowing direct access to the contents as +Array+.
|
|
375
379
|
class OOXMLContainerObject < Array
|
|
@@ -25,7 +25,8 @@ module RubyXL
|
|
|
25
25
|
|
|
26
26
|
# http://www.datypic.com/sc/ooxml/e-ssml_queryTableFields-1.html
|
|
27
27
|
class QueryTableFields < OOXMLObject
|
|
28
|
-
define_child_node(RubyXL::QueryTableField, :collection => :with_count,
|
|
28
|
+
define_child_node(RubyXL::QueryTableField, :collection => :with_count,
|
|
29
|
+
:accessor => :fields, :node_name => :queryTableField)
|
|
29
30
|
define_element_name 'queryTableFields'
|
|
30
31
|
end
|
|
31
32
|
|
|
@@ -38,7 +39,8 @@ module RubyXL
|
|
|
38
39
|
|
|
39
40
|
# http://www.datypic.com/sc/ooxml/e-ssml_queryTableDeletedFields-1.html
|
|
40
41
|
class QueryTableDeletedFields < OOXMLObject
|
|
41
|
-
define_child_node(RubyXL::QueryTableDeletedField, :collection => :with_count,
|
|
42
|
+
define_child_node(RubyXL::QueryTableDeletedField, :collection => :with_count,
|
|
43
|
+
:accessor => :deleted_fields, :node_name => :deletedField)
|
|
42
44
|
define_element_name 'queryTableDeletedFields'
|
|
43
45
|
end
|
|
44
46
|
|
|
@@ -1,24 +1,40 @@
|
|
|
1
1
|
module RubyXL
|
|
2
2
|
class Reference
|
|
3
|
-
ROW_MAX = 1024*1024
|
|
3
|
+
ROW_MAX = 1024 * 1024
|
|
4
4
|
COL_MAX = 16393
|
|
5
5
|
|
|
6
|
-
attr_reader :row_range, :col_range
|
|
6
|
+
attr_reader :row_range, :col_range, :sheet_name
|
|
7
|
+
attr_reader :row_from_absolute, :row_to_absolute, :col_from_absolute, :col_to_absolute
|
|
7
8
|
|
|
8
9
|
# RubyXL::Reference.new(row, col)
|
|
9
10
|
# RubyXL::Reference.new(row_from, row_to, col_from, col_to)
|
|
10
11
|
# RubyXL::Reference.new(reference_string)
|
|
12
|
+
# RubyXL::Reference.new(row_from:, row_to:, col_from:, col_to:)
|
|
11
13
|
def initialize(*params)
|
|
12
14
|
row_from = row_to = col_from = col_to = nil
|
|
15
|
+
@row_from_absolute = @row_to_absolute = @col_from_absolute = @col_to_absolute = false
|
|
13
16
|
|
|
14
17
|
case params.size
|
|
15
18
|
when 4 then row_from, row_to, col_from, col_to = params
|
|
16
19
|
when 2 then row_from, col_from = params
|
|
17
20
|
when 1 then
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
case params.first
|
|
22
|
+
when Hash then
|
|
23
|
+
row_from, row_to, col_from, col_to = params.first.fetch_values(:row_from, :row_to, :col_from, :col_to)
|
|
24
|
+
when String then
|
|
25
|
+
str = params.first
|
|
26
|
+
match_data = str.match(/^('(?<sheet_name1>[^']+)'|(?<sheet_name2>[^']+))!/)
|
|
27
|
+
if match_data then
|
|
28
|
+
@sheet_name = match_data['sheet_name1'] || match_data['sheet_name2']
|
|
29
|
+
str = str[match_data[0].size..-1]
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
from, to = str.split(':')
|
|
33
|
+
row_from, col_from, @row_from_absolute, @col_from_absolute = self.class.ref2ind(from)
|
|
34
|
+
row_to, col_to, @row_to_absolute, @col_to_absolute = self.class.ref2ind(to) unless to.nil?
|
|
35
|
+
else
|
|
36
|
+
raise ArgumentError.new("invalid value for #{self.class}: #{params[0].inspect}") unless params[0].is_a?(String)
|
|
37
|
+
end
|
|
22
38
|
end
|
|
23
39
|
|
|
24
40
|
@row_range = Range.new(row_from || 0, row_to || row_from || ROW_MAX)
|
|
@@ -50,49 +66,69 @@ module RubyXL
|
|
|
50
66
|
end
|
|
51
67
|
|
|
52
68
|
def ==(other)
|
|
53
|
-
!other.nil? && (@
|
|
69
|
+
!other.nil? && (@sheet_name == other.sheet_name) &&
|
|
70
|
+
(@row_range == other.row_range) && (@col_range == other.col_range)
|
|
54
71
|
end
|
|
55
72
|
|
|
56
73
|
def cover?(other)
|
|
57
|
-
!other.nil? && (@row_range.cover?(other.row_range.begin) &&
|
|
58
|
-
@
|
|
74
|
+
!other.nil? && (@row_range.cover?(other.row_range.begin) &&
|
|
75
|
+
@row_range.cover?(other.row_range.end) &&
|
|
76
|
+
@col_range.cover?(other.col_range.begin) &&
|
|
77
|
+
@col_range.cover?(other.col_range.end))
|
|
59
78
|
end
|
|
60
79
|
|
|
61
80
|
def to_s
|
|
81
|
+
result = +''
|
|
82
|
+
|
|
83
|
+
if @sheet_name then
|
|
84
|
+
if @sheet_name.index(' ') then
|
|
85
|
+
result << "'#{@sheet_name}'"
|
|
86
|
+
else
|
|
87
|
+
result << @sheet_name
|
|
88
|
+
end
|
|
89
|
+
result << '!'
|
|
90
|
+
end
|
|
91
|
+
|
|
62
92
|
if single_cell? then
|
|
63
|
-
self.class.ind2ref(@row_range.begin, @col_range.begin)
|
|
93
|
+
result << self.class.ind2ref(@row_range.begin, @col_range.begin, @row_from_absolute, @col_from_absolute)
|
|
64
94
|
else
|
|
65
|
-
self.class.ind2ref(@row_range.begin, @col_range.begin
|
|
95
|
+
result << self.class.ind2ref(@row_range.begin, @col_range.begin, @row_from_absolute, @col_from_absolute)
|
|
96
|
+
result << ':'
|
|
97
|
+
result << self.class.ind2ref(@row_range.end, @col_range.end, @row_to_absolute, @col_to_absolute)
|
|
66
98
|
end
|
|
67
99
|
end
|
|
68
100
|
|
|
69
101
|
def inspect
|
|
70
102
|
if single_cell? then
|
|
71
|
-
"#<#{self.class} @row=#{@row_range.begin} @col=#{@col_range.begin}>"
|
|
103
|
+
"#<#{self.class} @sheet_name=#{@sheet_name} @row=#{@row_range.begin} @col=#{@col_range.begin}>"
|
|
72
104
|
else
|
|
73
|
-
"#<#{self.class} @row_range=#{@row_range} @col_range=#{@col_range}>"
|
|
105
|
+
"#<#{self.class} @sheet_name=#{@sheet_name} @row_range=#{@row_range} @col_range=#{@col_range}>"
|
|
74
106
|
end
|
|
75
107
|
end
|
|
76
108
|
|
|
77
109
|
# Converts +row+ and +col+ zero-based indices to Excel-style cell reference
|
|
78
110
|
# <0> A...Z, AA...AZ, BA... ...ZZ, AAA... ...AZZ, BAA... ...XFD <16383>
|
|
79
|
-
def self.ind2ref(row = 0, col = 0)
|
|
80
|
-
|
|
111
|
+
def self.ind2ref(row = 0, col = 0, row_abs = false, col_abs = false)
|
|
112
|
+
col_ref = ''
|
|
81
113
|
|
|
82
114
|
loop do
|
|
83
115
|
x = col % 26
|
|
84
|
-
|
|
116
|
+
col_ref = ('A'.ord + x).chr + col_ref
|
|
85
117
|
col = (col / 26).floor - 1
|
|
86
118
|
break if col < 0
|
|
87
119
|
end
|
|
88
120
|
|
|
89
|
-
|
|
121
|
+
"#{col_abs ? '$' : ''}#{col_ref}#{row_abs ? '$' : ''}#{row + 1}"
|
|
90
122
|
end
|
|
91
123
|
|
|
92
124
|
# Converts Excel-style cell reference to +row+ and +col+ zero-based indices.
|
|
93
125
|
def self.ref2ind(str)
|
|
94
|
-
|
|
95
|
-
[
|
|
126
|
+
matchdata = str.match(/\A(?<cabs>\$?)(?<col>[A-Z]+)(?<rabs>\$?)(?<row>\d+)\Z/)
|
|
127
|
+
return [ -1, -1 ] unless matchdata
|
|
128
|
+
[ matchdata['row'].to_i - 1,
|
|
129
|
+
matchdata['col'].each_byte.inject(0) { |col, chr| (col * 26) + (chr - 64) } - 1,
|
|
130
|
+
!matchdata['rabs'].empty?,
|
|
131
|
+
!matchdata['cabs'].empty? ]
|
|
96
132
|
end
|
|
97
133
|
end
|
|
98
134
|
|
|
@@ -102,7 +138,7 @@ module RubyXL
|
|
|
102
138
|
end
|
|
103
139
|
|
|
104
140
|
def to_s
|
|
105
|
-
self.collect
|
|
141
|
+
self.collect(&:to_s).join(' ')
|
|
106
142
|
end
|
|
107
143
|
end
|
|
108
144
|
end
|
data/lib/rubyXL/objects/root.rb
CHANGED
|
@@ -33,7 +33,7 @@ module RubyXL
|
|
|
33
33
|
|
|
34
34
|
# Write <tt>.xlsx</tt> to a stream (useful for sending over HTTP)
|
|
35
35
|
def stream
|
|
36
|
-
stream = Zip::OutputStream.write_buffer { |zipstream|
|
|
36
|
+
stream = Zip::OutputStream.write_buffer(suppress_extra_fields: true) { |zipstream|
|
|
37
37
|
self.rels_hash = {}
|
|
38
38
|
self.relationship_container.owner = self
|
|
39
39
|
collect_related_objects.compact.each { |obj|
|
|
@@ -20,7 +20,7 @@ module RubyXL
|
|
|
20
20
|
super
|
|
21
21
|
# So far, going by the structure that the original creator had in mind. However,
|
|
22
22
|
# since the actual implementation is now extracted into a separate class,
|
|
23
|
-
# we will be able to
|
|
23
|
+
# we will be able to transparently change it later if needs be.
|
|
24
24
|
@index_by_content = {}
|
|
25
25
|
end
|
|
26
26
|
|
|
@@ -50,7 +50,7 @@ module RubyXL
|
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
def row
|
|
53
|
-
r
|
|
53
|
+
r&.first_row
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
def row=(v)
|
|
@@ -58,7 +58,7 @@ module RubyXL
|
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
def column
|
|
61
|
-
r
|
|
61
|
+
r&.first_col
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
def column=(v)
|
|
@@ -66,7 +66,7 @@ module RubyXL
|
|
|
66
66
|
end
|
|
67
67
|
|
|
68
68
|
def raw_value
|
|
69
|
-
value_container
|
|
69
|
+
value_container&.value
|
|
70
70
|
end
|
|
71
71
|
|
|
72
72
|
def raw_value=(v)
|
|
@@ -98,8 +98,7 @@ module RubyXL
|
|
|
98
98
|
else false
|
|
99
99
|
end
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
num_fmt && num_fmt.is_date_format?
|
|
101
|
+
self.number_format&.is_date_format?
|
|
103
102
|
end
|
|
104
103
|
|
|
105
104
|
# Gets massaged value of the cell, converting datatypes to those known to Ruby (that includes
|
|
@@ -111,6 +110,8 @@ module RubyXL
|
|
|
111
110
|
when RubyXL::DataType::SHARED_STRING then workbook.shared_strings_container[r.to_i].to_s
|
|
112
111
|
when RubyXL::DataType::INLINE_STRING then is.to_s
|
|
113
112
|
when RubyXL::DataType::RAW_STRING then raw_value
|
|
113
|
+
when RubyXL::DataType::DATE then raw_value && DateTime.parse(raw_value)
|
|
114
|
+
when RubyXL::DataType::ERROR then nil
|
|
114
115
|
else
|
|
115
116
|
if is then is.to_s
|
|
116
117
|
elsif is_date? then workbook.num_to_date(r.to_f)
|
|
@@ -123,6 +124,10 @@ module RubyXL
|
|
|
123
124
|
end
|
|
124
125
|
end
|
|
125
126
|
|
|
127
|
+
def error?
|
|
128
|
+
datatype == RubyXL::DataType::ERROR
|
|
129
|
+
end
|
|
130
|
+
|
|
126
131
|
def inspect
|
|
127
132
|
str = "#<#{self.class}(#{row},#{column}): #{raw_value.inspect}"
|
|
128
133
|
str << " =#{self.formula.expression}" if self.formula
|
|
@@ -133,7 +138,7 @@ module RubyXL
|
|
|
133
138
|
include LegacyCell
|
|
134
139
|
end
|
|
135
140
|
|
|
136
|
-
#TODO
|
|
141
|
+
#TODO# <row r="1" spans="1:1" x14ac:dyDescent="0.25">
|
|
137
142
|
|
|
138
143
|
# http://www.datypic.com/sc/ooxml/e-ssml_row-1.html
|
|
139
144
|
class Row < OOXMLObject
|
|
@@ -11,7 +11,7 @@ module RubyXL
|
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
def self.parse_file(zip_file, file_path)
|
|
14
|
-
(entry = zip_file.find_entry(RubyXL::from_root(file_path))) && self.new(file_path, entry.get_input_stream
|
|
14
|
+
(entry = zip_file.find_entry(RubyXL::from_root(file_path))) && self.new(file_path, entry.get_input_stream(&:read))
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def add_to_zip(zip_stream)
|
|
@@ -169,6 +169,11 @@ module RubyXL
|
|
|
169
169
|
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata'.freeze
|
|
170
170
|
end
|
|
171
171
|
|
|
172
|
+
class PersonMetadata < GenericStorageObject
|
|
173
|
+
CONTENT_TYPE = 'application/vnd.ms-excel.person+xml'.freeze
|
|
174
|
+
REL_TYPE = 'http://schemas.microsoft.com/office/2017/10/relationships/person'.freeze
|
|
175
|
+
end
|
|
176
|
+
|
|
172
177
|
class ActiveX < GenericStorageObject
|
|
173
178
|
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/control'.freeze
|
|
174
179
|
|
|
@@ -79,9 +79,8 @@ module RubyXL
|
|
|
79
79
|
define_element_name 'cellXfs'
|
|
80
80
|
|
|
81
81
|
def self.default
|
|
82
|
-
self.new(:_ => [
|
|
83
|
-
|
|
84
|
-
])
|
|
82
|
+
self.new(:_ => [ RubyXL::XF.new(:num_fmt_id => 0, :font_id => 0, :fill_id => 0,
|
|
83
|
+
:border_id => 0, :xfId => 0) ])
|
|
85
84
|
end
|
|
86
85
|
end
|
|
87
86
|
|
data/lib/rubyXL/objects/text.rb
CHANGED
|
@@ -18,7 +18,7 @@ module RubyXL
|
|
|
18
18
|
|
|
19
19
|
def before_write_xml
|
|
20
20
|
preserve_whitespace
|
|
21
|
-
self.value.gsub
|
|
21
|
+
self.value.gsub(INVALID_XML10_CHARS) { |bad_char| format('_x%04x_', bad_char.ord) }
|
|
22
22
|
true
|
|
23
23
|
end
|
|
24
24
|
|
|
@@ -84,8 +84,8 @@ module RubyXL
|
|
|
84
84
|
|
|
85
85
|
def to_s
|
|
86
86
|
# `dup` here unfreezes the string since it's not a constant but initial value
|
|
87
|
-
str =
|
|
88
|
-
r
|
|
87
|
+
str = t.nil? ? ''.dup : t.to_s
|
|
88
|
+
r&.each { |rtr| str << rtr.to_s if rtr }
|
|
89
89
|
str
|
|
90
90
|
end
|
|
91
91
|
end
|
data/lib/rubyXL/objects/theme.rb
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# encoding: UTF-8 <-- magic comment, need this because of sime fancy fonts in the default scheme below. See http://stackoverflow.com/questions/6444826/ruby-utf-8-file-encoding
|
|
2
|
-
|
|
3
1
|
require 'rubyXL/objects/ooxml_object'
|
|
4
2
|
require 'rubyXL/objects/extensions'
|
|
5
3
|
|
|
@@ -1391,21 +1389,21 @@ module RubyXL
|
|
|
1391
1389
|
end
|
|
1392
1390
|
|
|
1393
1391
|
def get_theme_color(idx)
|
|
1394
|
-
color_scheme = a_theme_elements
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1392
|
+
color_scheme = a_theme_elements&.a_clr_scheme
|
|
1393
|
+
|
|
1394
|
+
return unless color_scheme
|
|
1395
|
+
|
|
1396
|
+
case idx
|
|
1397
|
+
when 0 then color_scheme.a_lt1
|
|
1398
|
+
when 1 then color_scheme.a_dk1
|
|
1399
|
+
when 2 then color_scheme.a_lt2
|
|
1400
|
+
when 3 then color_scheme.a_dk2
|
|
1401
|
+
when 4 then color_scheme.a_accent1
|
|
1402
|
+
when 5 then color_scheme.a_accent2
|
|
1403
|
+
when 6 then color_scheme.a_accent3
|
|
1404
|
+
when 7 then color_scheme.a_accent4
|
|
1405
|
+
when 8 then color_scheme.a_accent5
|
|
1406
|
+
when 9 then color_scheme.a_accent6
|
|
1409
1407
|
end
|
|
1410
1408
|
end
|
|
1411
1409
|
|
|
@@ -146,6 +146,13 @@ module RubyXL
|
|
|
146
146
|
class DefinedNames < OOXMLContainerObject
|
|
147
147
|
define_child_node(RubyXL::DefinedName, :collection => true)
|
|
148
148
|
define_element_name 'definedNames'
|
|
149
|
+
|
|
150
|
+
def [](key)
|
|
151
|
+
case key
|
|
152
|
+
when Integer then super
|
|
153
|
+
when String then self.find { |n| n.name.eql?(key) }
|
|
154
|
+
end
|
|
155
|
+
end
|
|
149
156
|
end
|
|
150
157
|
|
|
151
158
|
# http://www.datypic.com/sc/ooxml/e-ssml_pivotCache-1.html
|
|
@@ -303,7 +310,7 @@ module RubyXL
|
|
|
303
310
|
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument'.freeze
|
|
304
311
|
|
|
305
312
|
# http://www.accountingweb.com/technology/excel/seven-characters-you-cant-use-in-worksheet-names
|
|
306
|
-
SHEET_NAME_FORBIDDEN_CHARS =
|
|
313
|
+
SHEET_NAME_FORBIDDEN_CHARS = %r{[/\\*\[\]:?]}
|
|
307
314
|
|
|
308
315
|
# https://answers.microsoft.com/en-us/msoffice/forum/all/excel-history-is-a-reserved-name-help/f8a398a4-b72c-48e3-82da-4f132c305e91
|
|
309
316
|
SHEET_NAME_FORBIDDEN_NAMES = [ 'History' ]
|
|
@@ -334,6 +341,7 @@ module RubyXL
|
|
|
334
341
|
define_relationship(RubyXL::CustomXMLFile)
|
|
335
342
|
define_relationship(RubyXL::MacrosFile, :macros)
|
|
336
343
|
define_relationship(RubyXL::SlicerCacheFile)
|
|
344
|
+
define_relationship(RubyXL::PersonMetadata)
|
|
337
345
|
|
|
338
346
|
define_child_node(RubyXL::FileVersion)
|
|
339
347
|
define_child_node(RubyXL::FileSharing)
|
|
@@ -410,12 +418,12 @@ module RubyXL
|
|
|
410
418
|
alias_method :write, :save
|
|
411
419
|
|
|
412
420
|
DATE1904 = DateTime.new(1904, 1, 1)
|
|
413
|
-
# Subtracting one day to
|
|
421
|
+
# Subtracting one day to accommodate for erroneous 1900 leap year compatibility only for 1900 based dates
|
|
414
422
|
DATE1899 = DateTime.new(1899, 12, 31) - 1
|
|
415
423
|
MARCH_1_1900 = 61
|
|
416
424
|
|
|
417
425
|
def base_date
|
|
418
|
-
|
|
426
|
+
workbook_properties&.date1904 ? DATE1904 : DATE1899
|
|
419
427
|
end
|
|
420
428
|
private :base_date
|
|
421
429
|
|
|
@@ -431,11 +439,11 @@ module RubyXL
|
|
|
431
439
|
|
|
432
440
|
# Bug-for-bug Excel compatibility (https://support.microsoft.com/kb/214058/)
|
|
433
441
|
if num < MARCH_1_1900 then
|
|
434
|
-
num += 1 unless workbook_properties
|
|
442
|
+
num += 1 unless workbook_properties&.date1904
|
|
435
443
|
end
|
|
436
444
|
|
|
437
445
|
dateparts = num.divmod(1)
|
|
438
|
-
base_date + (dateparts[0] + (dateparts[1] * 86400).round(6) / 86400)
|
|
446
|
+
base_date + (dateparts[0] + ((dateparts[1] * 86400).round(6) / 86400))
|
|
439
447
|
end
|
|
440
448
|
|
|
441
449
|
include Enumerable
|
|
@@ -517,7 +525,7 @@ module RubyXL
|
|
|
517
525
|
end
|
|
518
526
|
|
|
519
527
|
def company
|
|
520
|
-
root.document_properties.company
|
|
528
|
+
root.document_properties.company&.value
|
|
521
529
|
end
|
|
522
530
|
|
|
523
531
|
def company=(v)
|
|
@@ -526,7 +534,7 @@ module RubyXL
|
|
|
526
534
|
end
|
|
527
535
|
|
|
528
536
|
def application
|
|
529
|
-
root.document_properties.application
|
|
537
|
+
root.document_properties.application&.value
|
|
530
538
|
end
|
|
531
539
|
|
|
532
540
|
def application=(v)
|
|
@@ -535,7 +543,7 @@ module RubyXL
|
|
|
535
543
|
end
|
|
536
544
|
|
|
537
545
|
def appversion
|
|
538
|
-
root.document_properties.app_version
|
|
546
|
+
root.document_properties.app_version&.value
|
|
539
547
|
end
|
|
540
548
|
|
|
541
549
|
def appversion=(v)
|
|
@@ -560,7 +568,7 @@ module RubyXL
|
|
|
560
568
|
end
|
|
561
569
|
|
|
562
570
|
def date1904
|
|
563
|
-
workbook_properties
|
|
571
|
+
workbook_properties&.date1904
|
|
564
572
|
end
|
|
565
573
|
|
|
566
574
|
def date1904=(v)
|
|
@@ -173,7 +173,7 @@ module RubyXL
|
|
|
173
173
|
# http://www.datypic.com/sc/ooxml/e-ssml_colorScale-1.html
|
|
174
174
|
class ColorScale < OOXMLObject
|
|
175
175
|
define_child_node(RubyXL::ConditionalFormatValue, :collection => true, :accessor => :cfvo)
|
|
176
|
-
define_child_node(RubyXL::Color)
|
|
176
|
+
define_child_node(RubyXL::Color, :collection => true)
|
|
177
177
|
define_element_name 'colorScale'
|
|
178
178
|
end
|
|
179
179
|
|
|
@@ -183,7 +183,7 @@ module RubyXL
|
|
|
183
183
|
define_attribute(:maxLength, :int, :default => 90)
|
|
184
184
|
define_attribute(:showValue, :bool, :default => true)
|
|
185
185
|
define_child_node(RubyXL::ConditionalFormatValue, :collection => true, :accessor => :cfvo)
|
|
186
|
-
define_child_node(RubyXL::Color)
|
|
186
|
+
define_child_node(RubyXL::Color, :collection => true)
|
|
187
187
|
define_element_name 'dataBar'
|
|
188
188
|
end
|
|
189
189
|
|
data/lib/rubyXL/worksheet.rb
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
module RubyXL
|
|
2
2
|
module LegacyWorksheet
|
|
3
|
+
TEXT_LENGTH_LIMIT_IN_CELL = 32767 # 2 ** 15 - 1
|
|
4
|
+
|
|
3
5
|
include Enumerable
|
|
4
6
|
|
|
5
7
|
def initialize(params = {})
|
|
@@ -50,9 +52,15 @@ module RubyXL
|
|
|
50
52
|
case data
|
|
51
53
|
when Numeric then c.raw_value = data
|
|
52
54
|
when String then
|
|
55
|
+
if data.length > TEXT_LENGTH_LIMIT_IN_CELL
|
|
56
|
+
raise ArgumentError, "The maximum length of cell contents (text) is #{TEXT_LENGTH_LIMIT_IN_CELL} characters"
|
|
57
|
+
end
|
|
53
58
|
c.raw_value = data
|
|
54
59
|
c.datatype = RubyXL::DataType::RAW_STRING
|
|
55
60
|
when RubyXL::RichText then
|
|
61
|
+
if data.to_s.length > TEXT_LENGTH_LIMIT_IN_CELL
|
|
62
|
+
raise ArgumentError, "The maximum length of cell contents (text) is #{TEXT_LENGTH_LIMIT_IN_CELL} characters"
|
|
63
|
+
end
|
|
56
64
|
c.is = data
|
|
57
65
|
c.datatype = RubyXL::DataType::INLINE_STRING
|
|
58
66
|
when Time, Date, DateTime then
|
|
@@ -61,8 +69,8 @@ module RubyXL
|
|
|
61
69
|
end
|
|
62
70
|
end
|
|
63
71
|
|
|
64
|
-
range = cols
|
|
65
|
-
c.style_index = row.style_index ||
|
|
72
|
+
range = cols&.locate_range(column_index)
|
|
73
|
+
c.style_index = row.style_index || range&.style_index || 0
|
|
66
74
|
row.cells[column_index] = c
|
|
67
75
|
end
|
|
68
76
|
|
|
@@ -93,5 +101,5 @@ module RubyXL
|
|
|
93
101
|
raise 'Row and Column arguments must be nonnegative' if row_or_col < 0
|
|
94
102
|
end
|
|
95
103
|
private :validate_nonnegative
|
|
96
|
-
end
|
|
104
|
+
end
|
|
97
105
|
end
|