From 6138139c4e359eebdbfea75392f8644a457c059f Mon Sep 17 00:00:00 2001 From: "Elen.Subbotina" Date: Wed, 15 Jan 2014 09:59:12 +0000 Subject: [PATCH] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=BF=D1=80=D0=BE=D0=B5=D0=BA=D1=82=20-=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=B4=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD=20"?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D1=80=D1=8B=D0=B9"=20DocxFormat=20(=D1=82?= =?UTF-8?q?=D0=BE=D1=82=20=D0=BA=D0=BE=D1=82=D0=BE=D1=80=D1=8B=D0=B9=20?= =?UTF-8?q?=D1=81=20AVS=20-=20=D0=B1=D0=B5=D0=B7=20=D0=B2=D1=8B=D1=82?= =?UTF-8?q?=D0=B8=D1=80=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=B1=D1=83=D1=81=D1=82?= =?UTF-8?q?=D0=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@53593 954022d7-b5bf-4e40-9824-e11837661b57 --- ASCOfficeOdtFile/ASCOfficeOdtFile2005.sln | 72 +- ASCOfficeOdtFile/Projects/Docx2Odt2005.vcproj | 4 +- .../Projects/DocxFormat2005.vcproj | 5645 +++++++++++++++++ .../Projects/OdtFormat2005.vcproj | 4 +- ASCOfficeOdtFile/Projects/Utility2005.vcproj | 623 ++ ASCOfficeOdtFile/Projects/XML2005.vcproj | 1269 ++++ .../Source/Common/AbstractConverter.h | 53 + ASCOfficeOdtFile/Source/Common/Align.cpp | 107 + ASCOfficeOdtFile/Source/Common/Align.h | 51 + ASCOfficeOdtFile/Source/Common/Color.cpp | 35 + ASCOfficeOdtFile/Source/Common/Color.h | 26 + ASCOfficeOdtFile/Source/Common/Common.h | 16 + ASCOfficeOdtFile/Source/Common/Index.cpp | 89 + ASCOfficeOdtFile/Source/Common/Index.h | 47 + ASCOfficeOdtFile/Source/Common/NumFormat.cpp | 179 + ASCOfficeOdtFile/Source/Common/NumFormat.h | 68 + ASCOfficeOdtFile/Source/Common/Point.h | 71 + ASCOfficeOdtFile/Source/Common/Position.cpp | 71 + ASCOfficeOdtFile/Source/Common/Position.h | 43 + ASCOfficeOdtFile/Source/Common/Size.h | 71 + ASCOfficeOdtFile/Source/Common/Wrap.cpp | 107 + ASCOfficeOdtFile/Source/Common/Wrap.h | 51 + ASCOfficeOdtFile/Source/Common/ZIndex.cpp | 29 + ASCOfficeOdtFile/Source/Common/ZIndex.h | 24 + .../Source/Common/precompiled_common.cpp | 5 + .../Source/Common/precompiled_common.h | 8 + ASCOfficeOdtFile/Source/DocxFormat/App.cpp | 112 + ASCOfficeOdtFile/Source/DocxFormat/App.h | 51 + .../DocxFormat/ContentTypes/Default.cpp | 69 + .../Source/DocxFormat/ContentTypes/Default.h | 35 + .../DocxFormat/ContentTypes/DefaultTable.cpp | 55 + .../DocxFormat/ContentTypes/DefaultTable.h | 31 + .../ContentTypes/ExtensionTable.cpp | 59 + .../DocxFormat/ContentTypes/ExtensionTable.h | 26 + .../Source/DocxFormat/ContentTypes/File.cpp | 63 + .../Source/DocxFormat/ContentTypes/File.h | 38 + .../DocxFormat/ContentTypes/Override.cpp | 69 + .../Source/DocxFormat/ContentTypes/Override.h | 38 + .../DocxFormat/ContentTypes/OverrideTable.cpp | 50 + .../DocxFormat/ContentTypes/OverrideTable.h | 31 + ASCOfficeOdtFile/Source/DocxFormat/Core.cpp | 86 + ASCOfficeOdtFile/Source/DocxFormat/Core.h | 42 + .../Source/DocxFormat/DateTime.cpp | 54 + ASCOfficeOdtFile/Source/DocxFormat/DateTime.h | 32 + .../Source/DocxFormat/Document.cpp | 321 + ASCOfficeOdtFile/Source/DocxFormat/Document.h | 60 + ASCOfficeOdtFile/Source/DocxFormat/Docx.h | 49 + .../Source/DocxFormat/EndNote.cpp | 98 + ASCOfficeOdtFile/Source/DocxFormat/EndNote.h | 67 + .../Source/DocxFormat/EndNote/Note.cpp | 60 + .../Source/DocxFormat/External/External.cpp | 45 + .../Source/DocxFormat/External/External.h | 29 + .../DocxFormat/External/ExternalAudio.cpp | 46 + .../DocxFormat/External/ExternalAudio.h | 24 + .../DocxFormat/External/ExternalImage.cpp | 46 + .../DocxFormat/External/ExternalImage.h | 24 + .../DocxFormat/External/ExternalVideo.cpp | 46 + .../DocxFormat/External/ExternalVideo.h | 24 + .../Source/DocxFormat/External/HyperLink.cpp | 46 + .../Source/DocxFormat/External/HyperLink.h | 24 + ASCOfficeOdtFile/Source/DocxFormat/File.cpp | 21 + ASCOfficeOdtFile/Source/DocxFormat/File.h | 31 + .../Source/DocxFormat/FileFactory.cpp | 90 + .../Source/DocxFormat/FileFactory.h | 17 + .../Source/DocxFormat/FileType.cpp | 71 + ASCOfficeOdtFile/Source/DocxFormat/FileType.h | 40 + .../Source/DocxFormat/FileTypes.h | 238 + ASCOfficeOdtFile/Source/DocxFormat/Folder.cpp | 214 + ASCOfficeOdtFile/Source/DocxFormat/Folder.h | 49 + .../Source/DocxFormat/FontTable.cpp | 53 + .../Source/DocxFormat/FontTable.h | 65 + .../Source/DocxFormat/FontTable/Font.cpp | 73 + .../Source/DocxFormat/FootNote.cpp | 98 + ASCOfficeOdtFile/Source/DocxFormat/FootNote.h | 67 + .../Source/DocxFormat/FootNote/Note.cpp | 60 + ASCOfficeOdtFile/Source/DocxFormat/Footer.cpp | 67 + ASCOfficeOdtFile/Source/DocxFormat/Footer.h | 35 + .../Source/DocxFormat/FormatError.cpp | 26 + .../Source/DocxFormat/FormatError.h | 19 + ASCOfficeOdtFile/Source/DocxFormat/Header.cpp | 67 + ASCOfficeOdtFile/Source/DocxFormat/Header.h | 35 + .../Source/DocxFormat/IFileBuilder.cpp | 21 + .../Source/DocxFormat/IFileBuilder.h | 23 + .../Source/DocxFormat/IFileContainer.cpp | 332 + .../Source/DocxFormat/IFileContainer.h | 105 + ASCOfficeOdtFile/Source/DocxFormat/Item.cpp | 65 + ASCOfficeOdtFile/Source/DocxFormat/Item.h | 33 + .../Source/DocxFormat/ItemProps.cpp | 65 + .../Source/DocxFormat/ItemProps.h | 67 + .../Source/DocxFormat/ItemProps/SchemaRef.cpp | 50 + .../DocxFormat/ItemProps/SchemaRefs.cpp | 47 + .../Source/DocxFormat/Limit/BorderName.cpp | 47 + .../Source/DocxFormat/Limit/BorderName.h | 33 + .../Source/DocxFormat/Limit/BorderValue.cpp | 86 + .../Source/DocxFormat/Limit/BorderValue.h | 34 + .../Source/DocxFormat/Limit/BreakClear.cpp | 26 + .../Source/DocxFormat/Limit/BreakClear.h | 24 + .../Source/DocxFormat/Limit/BreakType.cpp | 25 + .../Source/DocxFormat/Limit/BreakType.h | 24 + .../Source/DocxFormat/Limit/Cap.cpp | 25 + .../Source/DocxFormat/Limit/Cap.h | 24 + .../Source/DocxFormat/Limit/Cmpd.cpp | 26 + .../Source/DocxFormat/Limit/Cmpd.h | 24 + .../Source/DocxFormat/Limit/ComplexExt.cpp | 23 + .../Source/DocxFormat/Limit/ComplexExt.h | 24 + .../Source/DocxFormat/Limit/ConnectType.cpp | 24 + .../Source/DocxFormat/Limit/ConnectType.h | 24 + .../Source/DocxFormat/Limit/Dash.cpp | 28 + .../Source/DocxFormat/Limit/Dash.h | 24 + .../Source/DocxFormat/Limit/DocGridType.cpp | 26 + .../Source/DocxFormat/Limit/DocGridType.h | 24 + .../DocxFormat/Limit/DrawingWrapType.cpp | 27 + .../Source/DocxFormat/Limit/DrawingWrapType.h | 24 + .../Source/DocxFormat/Limit/DropCap.cpp | 25 + .../Source/DocxFormat/Limit/DropCap.h | 24 + .../Source/DocxFormat/Limit/Ext.cpp | 23 + .../Source/DocxFormat/Limit/Ext.h | 24 + .../Source/DocxFormat/Limit/FillType.cpp | 23 + .../Source/DocxFormat/Limit/FillType.h | 24 + .../Source/DocxFormat/Limit/FldCharType.cpp | 25 + .../Source/DocxFormat/Limit/FldCharType.h | 24 + .../Source/DocxFormat/Limit/FontCharset.cpp | 27 + .../Source/DocxFormat/Limit/FontCharset.h | 24 + .../Source/DocxFormat/Limit/FontFamily.cpp | 28 + .../Source/DocxFormat/Limit/FontFamily.h | 24 + .../Source/DocxFormat/Limit/FontName.cpp | 189 + .../Source/DocxFormat/Limit/FontName.h | 24 + .../Source/DocxFormat/Limit/FontPitch.cpp | 24 + .../Source/DocxFormat/Limit/FontPitch.h | 24 + .../Limit/HorizontalAnchorLocation.cpp | 26 + .../Limit/HorizontalAnchorLocation.h | 24 + .../Source/DocxFormat/Limit/InlineName.cpp | 27 + .../Source/DocxFormat/Limit/InlineName.h | 24 + .../Source/DocxFormat/Limit/Join.cpp | 23 + .../Source/DocxFormat/Limit/Join.h | 24 + .../Source/DocxFormat/Limit/Leader.cpp | 28 + .../Source/DocxFormat/Limit/Leader.h | 24 + .../Source/DocxFormat/Limit/LineRule.cpp | 26 + .../Source/DocxFormat/Limit/LineRule.h | 24 + .../Source/DocxFormat/Limit/MsoRelative.cpp | 24 + .../Source/DocxFormat/Limit/MsoRelative.h | 24 + .../Source/DocxFormat/Limit/Orient.cpp | 24 + .../Source/DocxFormat/Limit/Orient.h | 24 + .../Source/DocxFormat/Limit/PictName.cpp | 27 + .../Source/DocxFormat/Limit/PictName.h | 24 + .../Source/DocxFormat/Limit/Position.cpp | 23 + .../Source/DocxFormat/Limit/Position.h | 24 + .../Source/DocxFormat/Limit/Prst.cpp | 23 + .../Source/DocxFormat/Limit/Prst.h | 24 + .../Source/DocxFormat/Limit/PrstClrVal.cpp | 23 + .../Source/DocxFormat/Limit/PrstClrVal.h | 24 + .../Source/DocxFormat/Limit/RelativeFrom.cpp | 24 + .../Source/DocxFormat/Limit/RelativeFrom.h | 24 + .../Source/DocxFormat/Limit/SectPrType.cpp | 27 + .../Source/DocxFormat/Limit/SectPrType.h | 24 + .../Source/DocxFormat/Limit/SeparatorType.cpp | 24 + .../Source/DocxFormat/Limit/SeparatorType.h | 24 + .../Source/DocxFormat/Limit/Suffix.cpp | 25 + .../Source/DocxFormat/Limit/Suffix.h | 24 + .../Source/DocxFormat/Limit/TabVal.cpp | 29 + .../Source/DocxFormat/Limit/TabVal.h | 24 + .../DocxFormat/Limit/TableCellWidthType.cpp | 23 + .../DocxFormat/Limit/TableCellWidthType.h | 24 + .../DocxFormat/Limit/TableRowHeightRule.cpp | 25 + .../DocxFormat/Limit/TableRowHeightRule.h | 24 + .../DocxFormat/Limit/TableStyleType.cpp | 35 + .../Source/DocxFormat/Limit/TableStyleType.h | 24 + .../DocxFormat/Limit/TableWidthType.cpp | 26 + .../Source/DocxFormat/Limit/TableWidthType.h | 24 + .../Source/DocxFormat/Limit/TextAlignment.cpp | 23 + .../Source/DocxFormat/Limit/TextAlignment.h | 24 + .../Source/DocxFormat/Limit/TextFrameType.cpp | 28 + .../Source/DocxFormat/Limit/TextFrameType.h | 24 + .../Source/DocxFormat/Limit/TextWrapType.cpp | 26 + .../Source/DocxFormat/Limit/TextWrapType.h | 24 + .../Source/DocxFormat/Limit/TrueFalse.cpp | 24 + .../Source/DocxFormat/Limit/TrueFalse.h | 24 + .../Source/DocxFormat/Limit/TypeFootHead.cpp | 25 + .../Source/DocxFormat/Limit/TypeFootHead.h | 24 + .../Source/DocxFormat/Limit/UnderType.cpp | 40 + .../Source/DocxFormat/Limit/UnderType.h | 24 + .../Source/DocxFormat/Limit/VMergeVal.cpp | 24 + .../Source/DocxFormat/Limit/VMergeVal.h | 24 + .../Source/DocxFormat/Limit/VerticalAlign.cpp | 25 + .../Source/DocxFormat/Limit/VerticalAlign.h | 24 + .../Limit/VerticalAnchorLocation.cpp | 26 + .../DocxFormat/Limit/VerticalAnchorLocation.h | 24 + .../Source/DocxFormat/Logic/Align.cpp | 76 + .../Source/DocxFormat/Logic/Align.h | 30 + .../Source/DocxFormat/Logic/Background.cpp | 57 + .../Source/DocxFormat/Logic/Background.h | 35 + .../DocxFormat/Logic/BackgroundColor.cpp | 61 + .../Source/DocxFormat/Logic/BackgroundColor.h | 30 + .../Source/DocxFormat/Logic/BookmarkEnd.cpp | 58 + .../Source/DocxFormat/Logic/BookmarkEnd.h | 34 + .../DocxFormat/Logic/BookmarkEndParagraph.cpp | 59 + .../DocxFormat/Logic/BookmarkEndParagraph.h | 34 + .../Source/DocxFormat/Logic/BookmarkStart.cpp | 81 + .../Source/DocxFormat/Logic/BookmarkStart.h | 39 + .../Logic/BookmarkStartParagraph.cpp | 61 + .../DocxFormat/Logic/BookmarkStartParagraph.h | 36 + .../Source/DocxFormat/Logic/Border.cpp | 72 + .../Source/DocxFormat/Logic/Border.h | 35 + .../Source/DocxFormat/Logic/BorderItem.cpp | 23 + .../Source/DocxFormat/Logic/BorderItem.h | 32 + .../Source/DocxFormat/Logic/Bottom.cpp | 62 + .../Source/DocxFormat/Logic/Bottom.h | 38 + .../Source/DocxFormat/Logic/Break.cpp | 82 + .../Source/DocxFormat/Logic/Break.h | 37 + .../DocxFormat/Logic/CellMarginItem.cpp | 30 + .../Source/DocxFormat/Logic/CellMarginItem.h | 28 + .../Source/DocxFormat/Logic/Color.cpp | 86 + .../Source/DocxFormat/Logic/Color.h | 34 + .../Source/DocxFormat/Logic/ColorsTable.cpp | 83 + .../Source/DocxFormat/Logic/ColorsTable.h | 31 + .../Source/DocxFormat/Logic/Column.cpp | 63 + .../Source/DocxFormat/Logic/Column.h | 33 + .../Source/DocxFormat/Logic/Columns.cpp | 65 + .../Source/DocxFormat/Logic/Columns.h | 37 + .../Source/DocxFormat/Logic/Complex.cpp | 50 + .../Source/DocxFormat/Logic/Complex.h | 33 + .../Logic/ContinuationSeparator.cpp | 54 + .../DocxFormat/Logic/ContinuationSeparator.h | 28 + .../Source/DocxFormat/Logic/DelText.cpp | 56 + .../Source/DocxFormat/Logic/DelText.h | 34 + .../Source/DocxFormat/Logic/Delete.cpp | 70 + .../Source/DocxFormat/Logic/Delete.h | 38 + .../Source/DocxFormat/Logic/DocPartObj.cpp | 55 + .../Source/DocxFormat/Logic/DocPartObj.h | 33 + .../Source/DocxFormat/Logic/DocPr.cpp | 57 + .../Source/DocxFormat/Logic/DocPr.h | 35 + .../Source/DocxFormat/Logic/DocumentGrid.cpp | 57 + .../Source/DocxFormat/Logic/DocumentGrid.h | 33 + .../Source/DocxFormat/Logic/Drawing.cpp | 186 + .../Source/DocxFormat/Logic/Drawing.h | 39 + .../Source/DocxFormat/Logic/DrawingWrap.cpp | 114 + .../Source/DocxFormat/Logic/DrawingWrap.h | 44 + .../Source/DocxFormat/Logic/EffectExtent.cpp | 59 + .../Source/DocxFormat/Logic/EffectExtent.h | 36 + .../DocxFormat/Logic/EndNoteProperty.cpp | 63 + .../Source/DocxFormat/Logic/EndNoteProperty.h | 26 + .../Source/DocxFormat/Logic/EndnoteRef.cpp | 54 + .../Source/DocxFormat/Logic/EndnoteRef.h | 28 + .../DocxFormat/Logic/EndnoteReference.cpp | 66 + .../DocxFormat/Logic/EndnoteReference.h | 34 + .../Source/DocxFormat/Logic/Extent.cpp | 54 + .../Source/DocxFormat/Logic/Extent.h | 33 + .../Source/DocxFormat/Logic/Extrusion.cpp | 69 + .../Source/DocxFormat/Logic/Extrusion.h | 42 + .../Source/DocxFormat/Logic/F.cpp | 51 + ASCOfficeOdtFile/Source/DocxFormat/Logic/F.h | 30 + .../Source/DocxFormat/Logic/FieldCodes.cpp | 50 + .../Source/DocxFormat/Logic/FieldCodes.h | 32 + .../Source/DocxFormat/Logic/Fill.cpp | 63 + .../Source/DocxFormat/Logic/Fill.h | 40 + .../Source/DocxFormat/Logic/FillStyle.cpp | 68 + .../Source/DocxFormat/Logic/FillStyle.h | 37 + .../Source/DocxFormat/Logic/FldChar.cpp | 59 + .../Source/DocxFormat/Logic/FldChar.h | 35 + .../Source/DocxFormat/Logic/FldSimple.cpp | 61 + .../Source/DocxFormat/Logic/FldSimple.h | 35 + .../DocxFormat/Logic/FootNoteProperty.cpp | 63 + .../DocxFormat/Logic/FootNoteProperty.h | 27 + .../DocxFormat/Logic/FooterReference.cpp | 61 + .../Source/DocxFormat/Logic/FooterReference.h | 34 + .../Source/DocxFormat/Logic/FootnoteRef.cpp | 54 + .../Source/DocxFormat/Logic/FootnoteRef.h | 28 + .../DocxFormat/Logic/FootnoteReference.cpp | 67 + .../DocxFormat/Logic/FootnoteReference.h | 34 + .../Source/DocxFormat/Logic/Formulas.cpp | 49 + .../Source/DocxFormat/Logic/Formulas.h | 32 + .../Source/DocxFormat/Logic/Graphic.cpp | 57 + .../Source/DocxFormat/Logic/Graphic.h | 34 + .../Source/DocxFormat/Logic/GridColumn.cpp | 45 + .../Source/DocxFormat/Logic/GridColumn.h | 30 + .../Source/DocxFormat/Logic/Group.cpp | 152 + .../Source/DocxFormat/Logic/Group.h | 62 + .../Source/DocxFormat/Logic/H.cpp | 58 + ASCOfficeOdtFile/Source/DocxFormat/Logic/H.h | 35 + .../Source/DocxFormat/Logic/Handles.cpp | 50 + .../Source/DocxFormat/Logic/Handles.h | 34 + .../DocxFormat/Logic/HeaderReference.cpp | 61 + .../Source/DocxFormat/Logic/HeaderReference.h | 35 + .../Source/DocxFormat/Logic/Hyperlink.cpp | 70 + .../Source/DocxFormat/Logic/Hyperlink.h | 40 + .../Source/DocxFormat/Logic/ImageData.cpp | 55 + .../Source/DocxFormat/Logic/ImageData.h | 35 + .../Source/DocxFormat/Logic/Ind.cpp | 88 + .../Source/DocxFormat/Logic/Ind.h | 38 + .../Source/DocxFormat/Logic/Index.cpp | 71 + .../Source/DocxFormat/Logic/Index.h | 30 + .../Source/DocxFormat/Logic/Inline.cpp | 147 + .../Source/DocxFormat/Logic/Inline.h | 74 + .../Source/DocxFormat/Logic/Insert.cpp | 70 + .../Source/DocxFormat/Logic/Insert.h | 38 + .../Source/DocxFormat/Logic/InstrText.cpp | 56 + .../Source/DocxFormat/Logic/InstrText.h | 34 + .../Source/DocxFormat/Logic/Lang.cpp | 57 + .../Source/DocxFormat/Logic/Lang.h | 34 + .../Source/DocxFormat/Logic/Line.cpp | 58 + .../Source/DocxFormat/Logic/Line.h | 47 + .../Source/DocxFormat/Logic/LineStyle.cpp | 99 + .../Source/DocxFormat/Logic/LineStyle.h | 45 + .../Source/DocxFormat/Logic/List.cpp | 103 + .../Source/DocxFormat/Logic/List.h | 44 + .../Source/DocxFormat/Logic/LnNumType.cpp | 52 + .../Source/DocxFormat/Logic/LnNumType.h | 32 + .../Source/DocxFormat/Logic/Lock.cpp | 59 + .../Source/DocxFormat/Logic/Lock.h | 37 + .../Source/DocxFormat/Logic/NoteProperty.cpp | 23 + .../Source/DocxFormat/Logic/NoteProperty.h | 25 + .../Source/DocxFormat/Logic/NullRun.cpp | 54 + .../Source/DocxFormat/Logic/NullRun.h | 28 + .../Source/DocxFormat/Logic/NumFormat.cpp | 126 + .../Source/DocxFormat/Logic/NumFormat.h | 40 + .../Source/DocxFormat/Logic/NumPr.cpp | 55 + .../Source/DocxFormat/Logic/NumPr.h | 33 + .../Source/DocxFormat/Logic/OleObject.cpp | 66 + .../Source/DocxFormat/Logic/OleObject.h | 43 + .../Source/DocxFormat/Logic/OleWrap.cpp | 98 + .../Source/DocxFormat/Logic/OleWrap.h | 35 + .../Source/DocxFormat/Logic/OleZIndex.cpp | 38 + .../Source/DocxFormat/Logic/OleZIndex.h | 25 + .../Source/DocxFormat/Logic/Oval.cpp | 55 + .../Source/DocxFormat/Logic/Oval.h | 44 + .../Source/DocxFormat/Logic/PageBorders.cpp | 53 + .../Source/DocxFormat/Logic/PageBorders.h | 35 + .../Source/DocxFormat/Logic/PageMargin.cpp | 65 + .../Source/DocxFormat/Logic/PageMargin.h | 38 + .../Source/DocxFormat/Logic/PageSize.cpp | 51 + .../Source/DocxFormat/Logic/PageSize.h | 35 + .../Source/DocxFormat/Logic/Paragraph.cpp | 274 + .../Source/DocxFormat/Logic/Paragraph.h | 74 + .../DocxFormat/Logic/ParagraphBorder.cpp | 58 + .../Source/DocxFormat/Logic/ParagraphBorder.h | 34 + .../Source/DocxFormat/Logic/ParagraphItem.cpp | 97 + .../Source/DocxFormat/Logic/ParagraphItem.h | 44 + .../DocxFormat/Logic/ParagraphItemBase.cpp | 14 + .../DocxFormat/Logic/ParagraphItemBase.h | 21 + .../DocxFormat/Logic/ParagraphProperty.cpp | 126 + .../DocxFormat/Logic/ParagraphProperty.h | 71 + .../Logic/ParagraphPropertyChange.cpp | 58 + .../Logic/ParagraphPropertyChange.h | 35 + .../Source/DocxFormat/Logic/Path.cpp | 70 + .../Source/DocxFormat/Logic/Path.h | 43 + .../Source/DocxFormat/Logic/Pic.cpp | 97 + .../Source/DocxFormat/Logic/Pic.h | 44 + .../Source/DocxFormat/Logic/Pict.cpp | 86 + .../Source/DocxFormat/Logic/Pict.h | 55 + .../Source/DocxFormat/Logic/Point2D.cpp | 55 + .../Source/DocxFormat/Logic/Point2D.h | 33 + .../Source/DocxFormat/Logic/RFonts.cpp | 195 + .../Source/DocxFormat/Logic/RFonts.h | 52 + .../Source/DocxFormat/Logic/Rect.cpp | 55 + .../Source/DocxFormat/Logic/Rect.h | 44 + .../Source/DocxFormat/Logic/Roundrect.cpp | 56 + .../Source/DocxFormat/Logic/Roundrect.h | 46 + .../Source/DocxFormat/Logic/Run.cpp | 159 + .../Source/DocxFormat/Logic/Run.h | 53 + .../Source/DocxFormat/Logic/RunItem.cpp | 134 + .../Source/DocxFormat/Logic/RunItem.h | 41 + .../Source/DocxFormat/Logic/RunItemBase.cpp | 15 + .../Source/DocxFormat/Logic/RunItemBase.h | 21 + .../Source/DocxFormat/Logic/RunProperty.cpp | 310 + .../Source/DocxFormat/Logic/RunProperty.h | 77 + .../DocxFormat/Logic/RunPropertyChange.cpp | 58 + .../DocxFormat/Logic/RunPropertyChange.h | 35 + .../Source/DocxFormat/Logic/Sdt.cpp | 56 + .../Source/DocxFormat/Logic/Sdt.h | 37 + .../Source/DocxFormat/Logic/SdtContent.cpp | 50 + .../Source/DocxFormat/Logic/SdtContent.h | 34 + .../DocxFormat/Logic/SdtEndProperty.cpp | 59 + .../Source/DocxFormat/Logic/SdtEndProperty.h | 35 + .../Source/DocxFormat/Logic/SdtProperty.cpp | 55 + .../Source/DocxFormat/Logic/SdtProperty.h | 33 + .../DocxFormat/Logic/SectorProperty.cpp | 86 + .../Source/DocxFormat/Logic/SectorProperty.h | 55 + .../Source/DocxFormat/Logic/Separator.cpp | 54 + .../Source/DocxFormat/Logic/Separator.h | 28 + .../Source/DocxFormat/Logic/Shading.cpp | 51 + .../Source/DocxFormat/Logic/Shading.h | 34 + .../Source/DocxFormat/Logic/Shadow.cpp | 69 + .../Source/DocxFormat/Logic/Shadow.h | 41 + .../Source/DocxFormat/Logic/Shape.cpp | 85 + .../Source/DocxFormat/Logic/Shape.h | 59 + .../Source/DocxFormat/Logic/ShapeStyle.cpp | 212 + .../Source/DocxFormat/Logic/ShapeStyle.h | 64 + .../Source/DocxFormat/Logic/ShapeType.cpp | 77 + .../Source/DocxFormat/Logic/ShapeType.h | 54 + .../Source/DocxFormat/Logic/Spacing.cpp | 92 + .../Source/DocxFormat/Logic/Spacing.h | 47 + .../Source/DocxFormat/Logic/Stroke.cpp | 48 + .../Source/DocxFormat/Logic/Stroke.h | 33 + .../Source/DocxFormat/Logic/Symbol.cpp | 81 + .../Source/DocxFormat/Logic/Symbol.h | 35 + .../Source/DocxFormat/Logic/TCMar.cpp | 54 + .../Source/DocxFormat/Logic/TCMar.h | 35 + .../Source/DocxFormat/Logic/Tab.cpp | 72 + .../Source/DocxFormat/Logic/Tab.h | 31 + .../Source/DocxFormat/Logic/TabProperty.cpp | 62 + .../Source/DocxFormat/Logic/TabProperty.h | 36 + .../Source/DocxFormat/Logic/Table.cpp | 72 + .../Source/DocxFormat/Logic/Table.h | 39 + .../Source/DocxFormat/Logic/TableBorders.cpp | 57 + .../Source/DocxFormat/Logic/TableBorders.h | 151 + .../Source/DocxFormat/Logic/TableCell.cpp | 90 + .../Source/DocxFormat/Logic/TableCell.h | 47 + .../DocxFormat/Logic/TableCellBorders.cpp | 55 + .../DocxFormat/Logic/TableCellBorders.h | 151 + .../Source/DocxFormat/Logic/TableCellMar.cpp | 59 + .../Source/DocxFormat/Logic/TableCellMar.h | 34 + .../DocxFormat/Logic/TableCellMargin.cpp | 63 + .../Source/DocxFormat/Logic/TableCellMargin.h | 33 + .../DocxFormat/Logic/TableCellProperties.cpp | 62 + .../DocxFormat/Logic/TableCellProperties.h | 45 + .../DocxFormat/Logic/TableCellWidth.cpp | 55 + .../Source/DocxFormat/Logic/TableCellWidth.h | 35 + .../Source/DocxFormat/Logic/TableGrid.cpp | 45 + .../Source/DocxFormat/Logic/TableGrid.h | 32 + .../Source/DocxFormat/Logic/TableInd.cpp | 55 + .../Source/DocxFormat/Logic/TableInd.h | 33 + .../Source/DocxFormat/Logic/TableProperty.cpp | 100 + .../Source/DocxFormat/Logic/TableProperty.h | 52 + .../Source/DocxFormat/Logic/TableRow.cpp | 104 + .../Source/DocxFormat/Logic/TableRow.h | 40 + .../DocxFormat/Logic/TableRowHeight.cpp | 55 + .../Source/DocxFormat/Logic/TableRowHeight.h | 35 + .../DocxFormat/Logic/TableRowProperties.cpp | 54 + .../DocxFormat/Logic/TableRowProperties.h | 32 + .../Source/DocxFormat/Logic/TableStyle.cpp | 69 + .../Source/DocxFormat/Logic/TableStyle.h | 34 + .../DocxFormat/Logic/TableStyleProperties.cpp | 57 + .../DocxFormat/Logic/TableStyleProperties.h | 41 + .../Source/DocxFormat/Logic/TableWidth.cpp | 55 + .../Source/DocxFormat/Logic/TableWidth.h | 33 + .../Source/DocxFormat/Logic/TabsProperty.cpp | 53 + .../Source/DocxFormat/Logic/TabsProperty.h | 33 + .../Source/DocxFormat/Logic/Text.cpp | 77 + .../Source/DocxFormat/Logic/Text.h | 34 + .../Source/DocxFormat/Logic/TextBox.cpp | 47 + .../Source/DocxFormat/Logic/TextBox.h | 33 + .../DocxFormat/Logic/TextBoxContent.cpp | 53 + .../Source/DocxFormat/Logic/TextBoxContent.h | 32 + .../DocxFormat/Logic/TextFrameProperties.cpp | 95 + .../DocxFormat/Logic/TextFrameProperties.h | 47 + .../Source/DocxFormat/Logic/TextItem.cpp | 113 + .../Source/DocxFormat/Logic/TextItem.h | 50 + .../Source/DocxFormat/Logic/TextItemBase.cpp | 14 + .../Source/DocxFormat/Logic/TextItemBase.h | 18 + .../Source/DocxFormat/Logic/TextPath.cpp | 63 + .../Source/DocxFormat/Logic/TextPath.h | 39 + .../Source/DocxFormat/Logic/VMerge.cpp | 50 + .../Source/DocxFormat/Logic/VMerge.h | 33 + .../Source/DocxFormat/Logic/Wrap.cpp | 51 + .../Source/DocxFormat/Logic/Wrap.h | 32 + .../Source/DocxFormat/Logic/WrapPath.cpp | 57 + .../Source/DocxFormat/Logic/WrapPath.h | 35 + .../Source/DocxFormat/Media/Audio.cpp | 46 + .../Source/DocxFormat/Media/Audio.h | 24 + .../Source/DocxFormat/Media/Image.cpp | 78 + .../Source/DocxFormat/Media/Image.h | 27 + .../Source/DocxFormat/Media/Media.cpp | 73 + .../Source/DocxFormat/Media/Media.h | 30 + .../Source/DocxFormat/Media/OleObject.cpp | 59 + .../Source/DocxFormat/Media/OleObject.h | 27 + .../Source/DocxFormat/Media/Video.cpp | 46 + .../Source/DocxFormat/Media/Video.h | 24 + .../Source/DocxFormat/NamespaceOwn.cpp | 12 + .../Source/DocxFormat/NamespaceOwn.h | 16 + .../Source/DocxFormat/Namespaces.cpp | 48 + .../Source/DocxFormat/Namespaces.h | 52 + .../Source/DocxFormat/Numbering.cpp | 95 + .../Source/DocxFormat/Numbering.h | 136 + .../DocxFormat/Numbering/AbstractNum.cpp | 71 + .../Source/DocxFormat/Numbering/Level.cpp | 68 + .../DocxFormat/Numbering/LevelOverride.cpp | 54 + .../Source/DocxFormat/Numbering/Num.cpp | 54 + ASCOfficeOdtFile/Source/DocxFormat/RId.cpp | 128 + ASCOfficeOdtFile/Source/DocxFormat/RId.h | 40 + .../Source/DocxFormat/Rels/File.cpp | 110 + .../Source/DocxFormat/Rels/File.h | 42 + .../Source/DocxFormat/Rels/RelationShip.cpp | 112 + .../Source/DocxFormat/Rels/RelationShip.h | 53 + .../Source/DocxFormat/Rels/RelationTable.cpp | 50 + .../Source/DocxFormat/Rels/RelationTable.h | 32 + .../DocxFormat/Settings/ClrSchemeMapping.cpp | 76 + .../DocxFormat/Settings/ClrSchemeMapping.h | 42 + .../Source/DocxFormat/Settings/Endnote.cpp | 50 + .../Source/DocxFormat/Settings/Endnote.h | 30 + .../Source/DocxFormat/Settings/EndnotePr.cpp | 53 + .../Source/DocxFormat/Settings/EndnotePr.h | 32 + .../Source/DocxFormat/Settings/File.cpp | 99 + .../Source/DocxFormat/Settings/File.h | 61 + .../Source/DocxFormat/Settings/Footnote.cpp | 50 + .../Source/DocxFormat/Settings/Footnote.h | 30 + .../Source/DocxFormat/Settings/FootnotePr.cpp | 53 + .../Source/DocxFormat/Settings/FootnotePr.h | 32 + .../DocxFormat/Settings/HdrShapeDefaults.cpp | 53 + .../DocxFormat/Settings/HdrShapeDefaults.h | 31 + .../Source/DocxFormat/Settings/IdMap.cpp | 55 + .../Source/DocxFormat/Settings/IdMap.h | 32 + .../Source/DocxFormat/Settings/MathPr.cpp | 74 + .../Source/DocxFormat/Settings/MathPr.h | 43 + .../Source/DocxFormat/Settings/ProofState.cpp | 55 + .../Source/DocxFormat/Settings/ProofState.h | 33 + .../Source/DocxFormat/Settings/Rule.cpp | 57 + .../Source/DocxFormat/Settings/Rule.h | 33 + .../Source/DocxFormat/Settings/Rules.cpp | 56 + .../Source/DocxFormat/Settings/Rules.h | 33 + .../DocxFormat/Settings/ShapeDefaults.cpp | 55 + .../DocxFormat/Settings/ShapeDefaults.h | 34 + .../DocxFormat/Settings/Shapedefault.cpp | 55 + .../Source/DocxFormat/Settings/Shapedefault.h | 33 + .../DocxFormat/Settings/Shapelayout.cpp | 57 + .../Source/DocxFormat/Settings/Shapelayout.h | 35 + .../Source/DocxFormat/Settings/Zoom.cpp | 55 + .../Source/DocxFormat/Settings/Zoom.h | 32 + ASCOfficeOdtFile/Source/DocxFormat/Styles.cpp | 102 + ASCOfficeOdtFile/Source/DocxFormat/Styles.h | 140 + .../Source/DocxFormat/Styles/DocDefaults.cpp | 55 + .../DocxFormat/Styles/LattentStyles.cpp | 62 + .../Source/DocxFormat/Styles/LsdException.cpp | 58 + .../Source/DocxFormat/Styles/Style.cpp | 79 + .../Source/DocxFormat/Theme/BevelT.cpp | 55 + .../Source/DocxFormat/Theme/BevelT.h | 31 + .../DocxFormat/Theme/BgFillStyleLst.cpp | 55 + .../Source/DocxFormat/Theme/BgFillStyleLst.h | 34 + .../Source/DocxFormat/Theme/Camera.cpp | 55 + .../Source/DocxFormat/Theme/Camera.h | 33 + .../Source/DocxFormat/Theme/ClrScheme.cpp | 55 + .../Source/DocxFormat/Theme/ClrScheme.h | 34 + .../Source/DocxFormat/Theme/ClrSchemeItem.cpp | 60 + .../Source/DocxFormat/Theme/ClrSchemeItem.h | 33 + .../Source/DocxFormat/Theme/EffectLst.cpp | 57 + .../Source/DocxFormat/Theme/EffectLst.h | 36 + .../Source/DocxFormat/Theme/EffectStyle.cpp | 57 + .../Source/DocxFormat/Theme/EffectStyle.h | 36 + .../DocxFormat/Theme/EffectStyleLst.cpp | 53 + .../Source/DocxFormat/Theme/EffectStyleLst.h | 32 + .../DocxFormat/Theme/ExtraClrSchemeLst.cpp | 49 + .../DocxFormat/Theme/ExtraClrSchemeLst.h | 27 + .../Source/DocxFormat/Theme/File.cpp | 94 + .../Source/DocxFormat/Theme/File.h | 44 + .../Source/DocxFormat/Theme/FillStyleLst.cpp | 55 + .../Source/DocxFormat/Theme/FillStyleLst.h | 34 + .../Source/DocxFormat/Theme/FillToRect.cpp | 59 + .../Source/DocxFormat/Theme/FillToRect.h | 34 + .../Source/DocxFormat/Theme/FmtScheme.cpp | 61 + .../Source/DocxFormat/Theme/FmtScheme.h | 39 + .../Source/DocxFormat/Theme/Font.cpp | 55 + .../Source/DocxFormat/Theme/Font.h | 32 + .../Source/DocxFormat/Theme/FontScheme.cpp | 57 + .../Source/DocxFormat/Theme/FontScheme.h | 35 + .../Source/DocxFormat/Theme/GradFill.cpp | 59 + .../Source/DocxFormat/Theme/GradFill.h | 37 + .../Source/DocxFormat/Theme/Gs.cpp | 55 + ASCOfficeOdtFile/Source/DocxFormat/Theme/Gs.h | 32 + .../Source/DocxFormat/Theme/GsLst.cpp | 53 + .../Source/DocxFormat/Theme/GsLst.h | 32 + .../Source/DocxFormat/Theme/LightRig.cpp | 57 + .../Source/DocxFormat/Theme/LightRig.h | 34 + .../Source/DocxFormat/Theme/Lin.cpp | 55 + .../Source/DocxFormat/Theme/Lin.h | 31 + .../Source/DocxFormat/Theme/Ln.cpp | 63 + ASCOfficeOdtFile/Source/DocxFormat/Theme/Ln.h | 37 + .../Source/DocxFormat/Theme/LnStyleLst.cpp | 53 + .../Source/DocxFormat/Theme/LnStyleLst.h | 32 + .../Source/DocxFormat/Theme/MajorFont.cpp | 59 + .../Source/DocxFormat/Theme/MajorFont.h | 36 + .../Source/DocxFormat/Theme/MinorFont.cpp | 59 + .../Source/DocxFormat/Theme/MinorFont.h | 36 + .../DocxFormat/Theme/ObjectDefaults.cpp | 49 + .../Source/DocxFormat/Theme/ObjectDefaults.h | 27 + .../Source/DocxFormat/Theme/OuterShdw.cpp | 62 + .../Source/DocxFormat/Theme/OuterShdw.h | 35 + .../Source/DocxFormat/Theme/Path.cpp | 57 + .../Source/DocxFormat/Theme/Path.h | 34 + .../Source/DocxFormat/Theme/Rot.cpp | 57 + .../Source/DocxFormat/Theme/Rot.h | 32 + .../Source/DocxFormat/Theme/Scene3d.cpp | 55 + .../Source/DocxFormat/Theme/Scene3d.h | 33 + .../Source/DocxFormat/Theme/SchemeClr.cpp | 59 + .../Source/DocxFormat/Theme/SchemeClr.h | 35 + .../Source/DocxFormat/Theme/SolidFill.cpp | 53 + .../Source/DocxFormat/Theme/SolidFill.h | 31 + .../Source/DocxFormat/Theme/Sp3d.cpp | 53 + .../Source/DocxFormat/Theme/Sp3d.h | 31 + .../Source/DocxFormat/Theme/SrgbClr.cpp | 55 + .../Source/DocxFormat/Theme/SrgbClr.h | 33 + .../Source/DocxFormat/Theme/SysClr.cpp | 55 + .../Source/DocxFormat/Theme/SysClr.h | 32 + .../Source/DocxFormat/Theme/ThemeElements.cpp | 57 + .../Source/DocxFormat/Theme/ThemeElements.h | 35 + ASCOfficeOdtFile/Source/DocxFormat/Unit.h | 17 + .../Source/DocxFormat/UnknowTypeFile.cpp | 50 + .../Source/DocxFormat/UnknowTypeFile.h | 27 + .../Source/DocxFormat/WebSettings.cpp | 61 + .../Source/DocxFormat/WebSettings.h | 28 + .../Source/DocxFormat/WritingElement.h | 31 + .../Source/DocxFormat/WritingVector.h | 42 + .../DocxFormat/precompiled_docxformat.cpp | 6 + .../DocxFormat/precompiled_docxformat.h | 22 + .../OdtFormat/precompiled_odtformat.cpp | 2 +- ASCOfficeOdtFile/Source/Utility/ASCStlUtils.h | 106 + ASCOfficeOdtFile/Source/Utility/DateTime.cpp | 74 + ASCOfficeOdtFile/Source/Utility/DateTime.h | 33 + ASCOfficeOdtFile/Source/Utility/Encoding.cpp | 76 + ASCOfficeOdtFile/Source/Utility/Encoding.h | 26 + .../Source/Utility/Exception/UnitError.cpp | 12 + .../Source/Utility/Exception/UnitError.h | 15 + .../Exception/log_invalid_argument.cpp | 14 + .../Utility/Exception/log_invalid_argument.h | 15 + .../Source/Utility/Exception/log_not_find.cpp | 12 + .../Source/Utility/Exception/log_not_find.h | 15 + .../Utility/Exception/log_not_implement.cpp | 14 + .../Utility/Exception/log_not_implement.h | 15 + .../Exception/log_not_init_nullable.cpp | 21 + .../Utility/Exception/log_not_init_nullable.h | 16 + .../Utility/Exception/log_range_error.cpp | 21 + .../Utility/Exception/log_range_error.h | 16 + .../Utility/Exception/log_runtime_error.cpp | 14 + .../Utility/Exception/log_runtime_error.h | 15 + .../Utility/Exception/not_implement.cpp | 18 + .../Source/Utility/Exception/not_implement.h | 16 + .../Utility/Exception/not_init_nullable.cpp | 18 + .../Utility/Exception/not_init_nullable.h | 16 + .../Source/Utility/FileNameUtility.cpp | 57 + .../Source/Utility/FileNameUtility.h | 18 + ASCOfficeOdtFile/Source/Utility/Getter.h | 47 + ASCOfficeOdtFile/Source/Utility/IDictonary.h | 36 + ASCOfficeOdtFile/Source/Utility/IEnumerable.h | 53 + ASCOfficeOdtFile/Source/Utility/IItemable.h | 51 + ASCOfficeOdtFile/Source/Utility/Log.cpp | 59 + ASCOfficeOdtFile/Source/Utility/Log.h | 25 + .../Source/Utility/LogDetails.cpp | 114 + ASCOfficeOdtFile/Source/Utility/LogDetails.h | 40 + ASCOfficeOdtFile/Source/Utility/Parse.cpp | 115 + ASCOfficeOdtFile/Source/Utility/Parse.h | 31 + ASCOfficeOdtFile/Source/Utility/Setter.h | 185 + ASCOfficeOdtFile/Source/Utility/ToString.cpp | 202 + ASCOfficeOdtFile/Source/Utility/ToString.h | 45 + ASCOfficeOdtFile/Source/Utility/TxtFile.cpp | 346 + ASCOfficeOdtFile/Source/Utility/TxtFile.h | 47 + ASCOfficeOdtFile/Source/Utility/Unit.h | 966 +++ .../Source/Utility/UniversalUnit.cpp | 445 ++ .../Source/Utility/UniversalUnit.h | 198 + ASCOfficeOdtFile/Source/Utility/Utility.h | 50 + ASCOfficeOdtFile/Source/Utility/codecvt.cpp | 199 + ASCOfficeOdtFile/Source/Utility/codecvt.h | 86 + ASCOfficeOdtFile/Source/Utility/nullable.h | 249 + .../Source/Utility/nullable_property.h | 321 + .../Source/Utility/precompiled_utility.cpp | 6 + .../Source/Utility/precompiled_utility.h | 26 + ASCOfficeOdtFile/Source/Utility/property.h | 268 + .../Source/XML/Exception/Base.cpp | 18 + ASCOfficeOdtFile/Source/XML/Exception/Base.h | 21 + .../Source/XML/Exception/Declaration.cpp | 18 + .../Source/XML/Exception/Declaration.h | 20 + .../Source/XML/Exception/Namespace.cpp | 18 + .../Source/XML/Exception/Namespace.h | 20 + .../Source/XML/Exception/Parse.cpp | 18 + ASCOfficeOdtFile/Source/XML/Exception/Parse.h | 20 + ASCOfficeOdtFile/Source/XML/Extension/Fill.h | 334 + .../Source/XML/Extension/FillFromAttribute.h | 42 + .../Source/XML/Extension/Write.cpp | 17 + ASCOfficeOdtFile/Source/XML/Extension/Write.h | 199 + .../Source/XML/Extension/WriteIf.cpp | 139 + .../Source/XML/Extension/WriteIf.h | 37 + .../Source/XML/Limit/Encoding.cpp | 25 + ASCOfficeOdtFile/Source/XML/Limit/Encoding.h | 22 + .../Source/XML/Limit/Standalone.cpp | 25 + .../Source/XML/Limit/Standalone.h | 22 + ASCOfficeOdtFile/Source/XML/Limit/Version.cpp | 24 + ASCOfficeOdtFile/Source/XML/Limit/Version.h | 22 + .../Source/XML/Private/Attribute.cpp | 83 + .../Source/XML/Private/Attribute.h | 45 + .../Source/XML/Private/Comment.cpp | 78 + ASCOfficeOdtFile/Source/XML/Private/Comment.h | 41 + .../Source/XML/Private/Element.cpp | 458 ++ ASCOfficeOdtFile/Source/XML/Private/Element.h | 88 + .../Source/XML/Private/Filter/Element.h | 26 + .../Source/XML/Private/Filter/Text.h | 26 + .../Source/XML/Private/Lexigraph.cpp | 206 + .../Source/XML/Private/Lexigraph.h | 24 + .../Source/XML/Private/Namespace.cpp | 111 + .../Source/XML/Private/Namespace.h | 45 + ASCOfficeOdtFile/Source/XML/Private/Node.cpp | 15 + ASCOfficeOdtFile/Source/XML/Private/Node.h | 32 + .../Source/XML/Private/NodeContainer.cpp | 303 + .../Source/XML/Private/NodeContainer.h | 88 + ASCOfficeOdtFile/Source/XML/Private/Null.cpp | 22 + ASCOfficeOdtFile/Source/XML/Private/Null.h | 20 + .../Source/XML/Private/NullAttribute.cpp | 18 + .../Source/XML/Private/NullAttribute.h | 20 + .../Source/XML/Private/NullElement.cpp | 26 + .../Source/XML/Private/NullElement.h | 22 + .../Source/XML/Private/NullNamespace.cpp | 20 + .../Source/XML/Private/NullNamespace.h | 20 + .../Source/XML/Private/NullText.cpp | 16 + .../Source/XML/Private/NullText.h | 21 + .../Source/XML/Private/NullXAttribute.cpp | 24 + .../Source/XML/Private/NullXAttribute.h | 23 + .../Source/XML/Private/NullXElement.cpp | 23 + .../Source/XML/Private/NullXElement.h | 23 + .../Source/XML/Private/NullXNamespace.cpp | 20 + .../Source/XML/Private/NullXNamespace.h | 19 + ASCOfficeOdtFile/Source/XML/Private/Text.cpp | 74 + ASCOfficeOdtFile/Source/XML/Private/Text.h | 41 + .../XML/Private/XAttributeContainer.cpp | 120 + .../Source/XML/Private/XAttributeContainer.h | 42 + .../Source/XML/Private/XContainer.h | 159 + .../Source/XML/Private/XDeclaration.cpp | 82 + .../Source/XML/Private/XDeclaration.h | 42 + .../Source/XML/Private/XElementContainer.cpp | 183 + .../Source/XML/Private/XElementContainer.h | 67 + .../Source/XML/Private/XFileSource.cpp | 40 + .../Source/XML/Private/XFileSource.h | 31 + ASCOfficeOdtFile/Source/XML/Private/XList.cpp | 123 + ASCOfficeOdtFile/Source/XML/Private/XList.h | 149 + .../XML/Private/XNamespaceContainer.cpp | 98 + .../Source/XML/Private/XNamespaceContainer.h | 40 + .../Source/XML/Private/XNodeContainer.cpp | 102 + .../Source/XML/Private/XNodeContainer.h | 62 + .../Source/XML/Private/XPointer.h | 43 + .../Source/XML/Private/XSingleSource.cpp | 170 + .../Source/XML/Private/XSingleSource.h | 49 + .../Source/XML/Private/XSpace.cpp | 57 + ASCOfficeOdtFile/Source/XML/Private/XSpace.h | 33 + .../Source/XML/Private/XString.cpp | 186 + ASCOfficeOdtFile/Source/XML/Private/XString.h | 212 + .../Source/XML/Private/XStringSource.cpp | 33 + .../Source/XML/Private/XStringSource.h | 29 + .../Source/XML/Private/XTextContainer.cpp | 88 + .../Source/XML/Private/XTextContainer.h | 56 + .../Source/XML/Private/XWFileSource.cpp | 43 + .../Source/XML/Private/XWFileSource.h | 31 + .../Source/XML/Private/XWStringSource.cpp | 34 + .../Source/XML/Private/XWStringSource.h | 29 + .../Source/XML/Private/XWideSource.cpp | 211 + .../Source/XML/Private/XWideSource.h | 57 + ASCOfficeOdtFile/Source/XML/XAttribute.cpp | 57 + ASCOfficeOdtFile/Source/XML/XAttribute.h | 52 + ASCOfficeOdtFile/Source/XML/XComment.cpp | 21 + ASCOfficeOdtFile/Source/XML/XComment.h | 35 + ASCOfficeOdtFile/Source/XML/XContainer.cpp | 69 + ASCOfficeOdtFile/Source/XML/XContainer.h | 53 + ASCOfficeOdtFile/Source/XML/XDocument.cpp | 245 + ASCOfficeOdtFile/Source/XML/XDocument.h | 52 + ASCOfficeOdtFile/Source/XML/XElement.cpp | 274 + ASCOfficeOdtFile/Source/XML/XElement.h | 150 + ASCOfficeOdtFile/Source/XML/XML.h | 35 + ASCOfficeOdtFile/Source/XML/XName.cpp | 112 + ASCOfficeOdtFile/Source/XML/XName.h | 45 + ASCOfficeOdtFile/Source/XML/XNamespace.cpp | 86 + ASCOfficeOdtFile/Source/XML/XNamespace.h | 41 + ASCOfficeOdtFile/Source/XML/XNode.cpp | 86 + ASCOfficeOdtFile/Source/XML/XNode.h | 40 + ASCOfficeOdtFile/Source/XML/XObject.cpp | 21 + ASCOfficeOdtFile/Source/XML/XObject.h | 25 + ASCOfficeOdtFile/Source/XML/XText.cpp | 21 + ASCOfficeOdtFile/Source/XML/XText.h | 51 + .../Source/XML/precompiled_xml.cpp | 6 + ASCOfficeOdtFile/Source/XML/precompiled_xml.h | 23 + .../Source/boost_filesystem/operations.cpp | 1365 ++++ .../Source/boost_filesystem/path.cpp | 159 + .../Source/boost_filesystem/portability.cpp | 115 + .../boost_filesystem/utf8_codecvt_facet.cpp | 20 + .../boost_filesystem/utf8_codecvt_facet.hpp | 24 + .../Source/boost_system/error_code.cpp | 433 ++ ASCOfficeOdtFile/version.h | 6 +- 770 files changed, 52252 insertions(+), 48 deletions(-) create mode 100644 ASCOfficeOdtFile/Projects/DocxFormat2005.vcproj create mode 100644 ASCOfficeOdtFile/Projects/Utility2005.vcproj create mode 100644 ASCOfficeOdtFile/Projects/XML2005.vcproj create mode 100644 ASCOfficeOdtFile/Source/Common/AbstractConverter.h create mode 100644 ASCOfficeOdtFile/Source/Common/Align.cpp create mode 100644 ASCOfficeOdtFile/Source/Common/Align.h create mode 100644 ASCOfficeOdtFile/Source/Common/Color.cpp create mode 100644 ASCOfficeOdtFile/Source/Common/Color.h create mode 100644 ASCOfficeOdtFile/Source/Common/Common.h create mode 100644 ASCOfficeOdtFile/Source/Common/Index.cpp create mode 100644 ASCOfficeOdtFile/Source/Common/Index.h create mode 100644 ASCOfficeOdtFile/Source/Common/NumFormat.cpp create mode 100644 ASCOfficeOdtFile/Source/Common/NumFormat.h create mode 100644 ASCOfficeOdtFile/Source/Common/Point.h create mode 100644 ASCOfficeOdtFile/Source/Common/Position.cpp create mode 100644 ASCOfficeOdtFile/Source/Common/Position.h create mode 100644 ASCOfficeOdtFile/Source/Common/Size.h create mode 100644 ASCOfficeOdtFile/Source/Common/Wrap.cpp create mode 100644 ASCOfficeOdtFile/Source/Common/Wrap.h create mode 100644 ASCOfficeOdtFile/Source/Common/ZIndex.cpp create mode 100644 ASCOfficeOdtFile/Source/Common/ZIndex.h create mode 100644 ASCOfficeOdtFile/Source/Common/precompiled_common.cpp create mode 100644 ASCOfficeOdtFile/Source/Common/precompiled_common.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/App.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/App.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/Default.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/Default.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/DefaultTable.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/DefaultTable.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/ExtensionTable.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/ExtensionTable.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/File.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/File.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/Override.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/Override.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/OverrideTable.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/OverrideTable.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Core.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Core.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/DateTime.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/DateTime.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Document.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Document.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Docx.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/EndNote.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/EndNote.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/EndNote/Note.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/External/External.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/External/External.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/External/ExternalAudio.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/External/ExternalAudio.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/External/ExternalImage.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/External/ExternalImage.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/External/ExternalVideo.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/External/ExternalVideo.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/External/HyperLink.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/External/HyperLink.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/File.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/File.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/FileFactory.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/FileFactory.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/FileType.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/FileType.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/FileTypes.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Folder.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Folder.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/FontTable.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/FontTable.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/FontTable/Font.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/FootNote.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/FootNote.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/FootNote/Note.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Footer.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Footer.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/FormatError.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/FormatError.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Header.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Header.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/IFileBuilder.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/IFileBuilder.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/IFileContainer.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/IFileContainer.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Item.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Item.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/ItemProps.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/ItemProps.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/ItemProps/SchemaRef.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/ItemProps/SchemaRefs.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/BorderName.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/BorderName.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/BorderValue.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/BorderValue.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/BreakClear.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/BreakClear.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/BreakType.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/BreakType.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/Cap.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/Cap.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/Cmpd.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/Cmpd.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/ComplexExt.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/ComplexExt.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/ConnectType.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/ConnectType.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/Dash.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/Dash.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/DocGridType.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/DocGridType.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/DrawingWrapType.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/DrawingWrapType.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/DropCap.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/DropCap.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/Ext.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/Ext.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/FillType.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/FillType.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/FldCharType.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/FldCharType.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/FontCharset.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/FontCharset.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/FontFamily.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/FontFamily.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/FontName.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/FontName.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/FontPitch.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/FontPitch.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/HorizontalAnchorLocation.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/HorizontalAnchorLocation.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/InlineName.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/InlineName.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/Join.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/Join.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/Leader.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/Leader.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/LineRule.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/LineRule.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/MsoRelative.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/MsoRelative.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/Orient.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/Orient.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/PictName.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/PictName.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/Position.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/Position.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/Prst.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/Prst.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/PrstClrVal.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/PrstClrVal.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/RelativeFrom.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/RelativeFrom.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/SectPrType.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/SectPrType.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/SeparatorType.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/SeparatorType.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/Suffix.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/Suffix.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/TabVal.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/TabVal.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/TableCellWidthType.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/TableCellWidthType.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/TableRowHeightRule.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/TableRowHeightRule.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/TableStyleType.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/TableStyleType.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/TableWidthType.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/TableWidthType.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/TextAlignment.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/TextAlignment.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/TextFrameType.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/TextFrameType.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/TextWrapType.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/TextWrapType.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/TrueFalse.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/TrueFalse.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/TypeFootHead.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/TypeFootHead.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/UnderType.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/UnderType.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/VMergeVal.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/VMergeVal.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/VerticalAlign.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/VerticalAlign.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/VerticalAnchorLocation.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Limit/VerticalAnchorLocation.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Align.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Align.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Background.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Background.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/BackgroundColor.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/BackgroundColor.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkEnd.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkEnd.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkEndParagraph.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkEndParagraph.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkStart.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkStart.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkStartParagraph.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkStartParagraph.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Border.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Border.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/BorderItem.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/BorderItem.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Bottom.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Bottom.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Break.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Break.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/CellMarginItem.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/CellMarginItem.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Color.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Color.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/ColorsTable.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/ColorsTable.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Column.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Column.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Columns.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Columns.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Complex.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Complex.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/ContinuationSeparator.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/ContinuationSeparator.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/DelText.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/DelText.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Delete.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Delete.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/DocPartObj.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/DocPartObj.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/DocPr.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/DocPr.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/DocumentGrid.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/DocumentGrid.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Drawing.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Drawing.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/DrawingWrap.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/DrawingWrap.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/EffectExtent.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/EffectExtent.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/EndNoteProperty.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/EndNoteProperty.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/EndnoteRef.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/EndnoteRef.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/EndnoteReference.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/EndnoteReference.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Extent.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Extent.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Extrusion.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Extrusion.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/F.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/F.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/FieldCodes.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/FieldCodes.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Fill.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Fill.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/FillStyle.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/FillStyle.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/FldChar.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/FldChar.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/FldSimple.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/FldSimple.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/FootNoteProperty.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/FootNoteProperty.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/FooterReference.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/FooterReference.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/FootnoteRef.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/FootnoteRef.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/FootnoteReference.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/FootnoteReference.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Formulas.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Formulas.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Graphic.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Graphic.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/GridColumn.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/GridColumn.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Group.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Group.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/H.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/H.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Handles.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Handles.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/HeaderReference.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/HeaderReference.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Hyperlink.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Hyperlink.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/ImageData.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/ImageData.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Ind.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Ind.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Index.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Index.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Inline.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Inline.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Insert.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Insert.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/InstrText.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/InstrText.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Lang.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Lang.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Line.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Line.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/LineStyle.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/LineStyle.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/List.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/List.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/LnNumType.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/LnNumType.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Lock.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Lock.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/NoteProperty.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/NoteProperty.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/NullRun.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/NullRun.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/NumFormat.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/NumFormat.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/NumPr.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/NumPr.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/OleObject.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/OleObject.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/OleWrap.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/OleWrap.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/OleZIndex.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/OleZIndex.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Oval.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Oval.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/PageBorders.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/PageBorders.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/PageMargin.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/PageMargin.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/PageSize.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/PageSize.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Paragraph.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Paragraph.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphBorder.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphBorder.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphItem.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphItem.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphItemBase.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphItemBase.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphProperty.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphProperty.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphPropertyChange.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphPropertyChange.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Path.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Path.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Pic.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Pic.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Pict.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Pict.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Point2D.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Point2D.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/RFonts.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/RFonts.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Rect.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Rect.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Roundrect.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Roundrect.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Run.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Run.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/RunItem.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/RunItem.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/RunItemBase.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/RunItemBase.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/RunProperty.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/RunProperty.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/RunPropertyChange.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/RunPropertyChange.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Sdt.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Sdt.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/SdtContent.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/SdtContent.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/SdtEndProperty.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/SdtEndProperty.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/SdtProperty.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/SdtProperty.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/SectorProperty.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/SectorProperty.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Separator.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Separator.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Shading.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Shading.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Shadow.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Shadow.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Shape.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Shape.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/ShapeStyle.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/ShapeStyle.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/ShapeType.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/ShapeType.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Spacing.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Spacing.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Stroke.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Stroke.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Symbol.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Symbol.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TCMar.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TCMar.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Tab.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Tab.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TabProperty.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TabProperty.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Table.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Table.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableBorders.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableBorders.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCell.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCell.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellBorders.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellBorders.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellMar.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellMar.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellMargin.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellMargin.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellProperties.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellProperties.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellWidth.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellWidth.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableGrid.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableGrid.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableInd.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableInd.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableProperty.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableProperty.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableRow.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableRow.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableRowHeight.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableRowHeight.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableRowProperties.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableRowProperties.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableStyle.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableStyle.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableStyleProperties.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableStyleProperties.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableWidth.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TableWidth.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TabsProperty.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TabsProperty.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Text.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Text.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TextBox.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TextBox.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TextBoxContent.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TextBoxContent.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TextFrameProperties.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TextFrameProperties.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TextItem.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TextItem.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TextItemBase.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TextItemBase.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TextPath.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/TextPath.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/VMerge.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/VMerge.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Wrap.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/Wrap.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/WrapPath.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Logic/WrapPath.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Media/Audio.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Media/Audio.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Media/Image.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Media/Image.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Media/Media.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Media/Media.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Media/OleObject.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Media/OleObject.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Media/Video.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Media/Video.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/NamespaceOwn.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/NamespaceOwn.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Namespaces.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Namespaces.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Numbering.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Numbering.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Numbering/AbstractNum.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Numbering/Level.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Numbering/LevelOverride.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Numbering/Num.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/RId.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/RId.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Rels/File.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Rels/File.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Rels/RelationShip.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Rels/RelationShip.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Rels/RelationTable.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Rels/RelationTable.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/ClrSchemeMapping.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/ClrSchemeMapping.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/Endnote.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/Endnote.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/EndnotePr.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/EndnotePr.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/File.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/File.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/Footnote.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/Footnote.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/FootnotePr.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/FootnotePr.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/HdrShapeDefaults.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/HdrShapeDefaults.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/IdMap.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/IdMap.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/MathPr.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/MathPr.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/ProofState.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/ProofState.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/Rule.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/Rule.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/Rules.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/Rules.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/ShapeDefaults.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/ShapeDefaults.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/Shapedefault.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/Shapedefault.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/Shapelayout.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/Shapelayout.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/Zoom.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Settings/Zoom.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Styles.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Styles.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Styles/DocDefaults.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Styles/LattentStyles.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Styles/LsdException.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Styles/Style.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/BevelT.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/BevelT.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/BgFillStyleLst.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/BgFillStyleLst.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/Camera.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/Camera.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/ClrScheme.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/ClrScheme.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/ClrSchemeItem.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/ClrSchemeItem.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/EffectLst.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/EffectLst.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/EffectStyle.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/EffectStyle.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/EffectStyleLst.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/EffectStyleLst.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/ExtraClrSchemeLst.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/ExtraClrSchemeLst.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/File.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/File.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/FillStyleLst.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/FillStyleLst.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/FillToRect.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/FillToRect.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/FmtScheme.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/FmtScheme.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/Font.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/Font.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/FontScheme.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/FontScheme.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/GradFill.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/GradFill.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/Gs.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/Gs.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/GsLst.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/GsLst.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/LightRig.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/LightRig.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/Lin.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/Lin.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/Ln.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/Ln.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/LnStyleLst.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/LnStyleLst.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/MajorFont.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/MajorFont.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/MinorFont.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/MinorFont.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/ObjectDefaults.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/ObjectDefaults.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/OuterShdw.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/OuterShdw.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/Path.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/Path.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/Rot.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/Rot.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/Scene3d.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/Scene3d.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/SchemeClr.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/SchemeClr.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/SolidFill.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/SolidFill.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/Sp3d.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/Sp3d.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/SrgbClr.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/SrgbClr.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/SysClr.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/SysClr.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/ThemeElements.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Theme/ThemeElements.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/Unit.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/UnknowTypeFile.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/UnknowTypeFile.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/WebSettings.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/WebSettings.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/WritingElement.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/WritingVector.h create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/precompiled_docxformat.cpp create mode 100644 ASCOfficeOdtFile/Source/DocxFormat/precompiled_docxformat.h create mode 100644 ASCOfficeOdtFile/Source/Utility/ASCStlUtils.h create mode 100644 ASCOfficeOdtFile/Source/Utility/DateTime.cpp create mode 100644 ASCOfficeOdtFile/Source/Utility/DateTime.h create mode 100644 ASCOfficeOdtFile/Source/Utility/Encoding.cpp create mode 100644 ASCOfficeOdtFile/Source/Utility/Encoding.h create mode 100644 ASCOfficeOdtFile/Source/Utility/Exception/UnitError.cpp create mode 100644 ASCOfficeOdtFile/Source/Utility/Exception/UnitError.h create mode 100644 ASCOfficeOdtFile/Source/Utility/Exception/log_invalid_argument.cpp create mode 100644 ASCOfficeOdtFile/Source/Utility/Exception/log_invalid_argument.h create mode 100644 ASCOfficeOdtFile/Source/Utility/Exception/log_not_find.cpp create mode 100644 ASCOfficeOdtFile/Source/Utility/Exception/log_not_find.h create mode 100644 ASCOfficeOdtFile/Source/Utility/Exception/log_not_implement.cpp create mode 100644 ASCOfficeOdtFile/Source/Utility/Exception/log_not_implement.h create mode 100644 ASCOfficeOdtFile/Source/Utility/Exception/log_not_init_nullable.cpp create mode 100644 ASCOfficeOdtFile/Source/Utility/Exception/log_not_init_nullable.h create mode 100644 ASCOfficeOdtFile/Source/Utility/Exception/log_range_error.cpp create mode 100644 ASCOfficeOdtFile/Source/Utility/Exception/log_range_error.h create mode 100644 ASCOfficeOdtFile/Source/Utility/Exception/log_runtime_error.cpp create mode 100644 ASCOfficeOdtFile/Source/Utility/Exception/log_runtime_error.h create mode 100644 ASCOfficeOdtFile/Source/Utility/Exception/not_implement.cpp create mode 100644 ASCOfficeOdtFile/Source/Utility/Exception/not_implement.h create mode 100644 ASCOfficeOdtFile/Source/Utility/Exception/not_init_nullable.cpp create mode 100644 ASCOfficeOdtFile/Source/Utility/Exception/not_init_nullable.h create mode 100644 ASCOfficeOdtFile/Source/Utility/FileNameUtility.cpp create mode 100644 ASCOfficeOdtFile/Source/Utility/FileNameUtility.h create mode 100644 ASCOfficeOdtFile/Source/Utility/Getter.h create mode 100644 ASCOfficeOdtFile/Source/Utility/IDictonary.h create mode 100644 ASCOfficeOdtFile/Source/Utility/IEnumerable.h create mode 100644 ASCOfficeOdtFile/Source/Utility/IItemable.h create mode 100644 ASCOfficeOdtFile/Source/Utility/Log.cpp create mode 100644 ASCOfficeOdtFile/Source/Utility/Log.h create mode 100644 ASCOfficeOdtFile/Source/Utility/LogDetails.cpp create mode 100644 ASCOfficeOdtFile/Source/Utility/LogDetails.h create mode 100644 ASCOfficeOdtFile/Source/Utility/Parse.cpp create mode 100644 ASCOfficeOdtFile/Source/Utility/Parse.h create mode 100644 ASCOfficeOdtFile/Source/Utility/Setter.h create mode 100644 ASCOfficeOdtFile/Source/Utility/ToString.cpp create mode 100644 ASCOfficeOdtFile/Source/Utility/ToString.h create mode 100644 ASCOfficeOdtFile/Source/Utility/TxtFile.cpp create mode 100644 ASCOfficeOdtFile/Source/Utility/TxtFile.h create mode 100644 ASCOfficeOdtFile/Source/Utility/Unit.h create mode 100644 ASCOfficeOdtFile/Source/Utility/UniversalUnit.cpp create mode 100644 ASCOfficeOdtFile/Source/Utility/UniversalUnit.h create mode 100644 ASCOfficeOdtFile/Source/Utility/Utility.h create mode 100644 ASCOfficeOdtFile/Source/Utility/codecvt.cpp create mode 100644 ASCOfficeOdtFile/Source/Utility/codecvt.h create mode 100644 ASCOfficeOdtFile/Source/Utility/nullable.h create mode 100644 ASCOfficeOdtFile/Source/Utility/nullable_property.h create mode 100644 ASCOfficeOdtFile/Source/Utility/precompiled_utility.cpp create mode 100644 ASCOfficeOdtFile/Source/Utility/precompiled_utility.h create mode 100644 ASCOfficeOdtFile/Source/Utility/property.h create mode 100644 ASCOfficeOdtFile/Source/XML/Exception/Base.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Exception/Base.h create mode 100644 ASCOfficeOdtFile/Source/XML/Exception/Declaration.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Exception/Declaration.h create mode 100644 ASCOfficeOdtFile/Source/XML/Exception/Namespace.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Exception/Namespace.h create mode 100644 ASCOfficeOdtFile/Source/XML/Exception/Parse.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Exception/Parse.h create mode 100644 ASCOfficeOdtFile/Source/XML/Extension/Fill.h create mode 100644 ASCOfficeOdtFile/Source/XML/Extension/FillFromAttribute.h create mode 100644 ASCOfficeOdtFile/Source/XML/Extension/Write.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Extension/Write.h create mode 100644 ASCOfficeOdtFile/Source/XML/Extension/WriteIf.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Extension/WriteIf.h create mode 100644 ASCOfficeOdtFile/Source/XML/Limit/Encoding.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Limit/Encoding.h create mode 100644 ASCOfficeOdtFile/Source/XML/Limit/Standalone.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Limit/Standalone.h create mode 100644 ASCOfficeOdtFile/Source/XML/Limit/Version.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Limit/Version.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/Attribute.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/Attribute.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/Comment.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/Comment.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/Element.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/Element.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/Filter/Element.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/Filter/Text.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/Lexigraph.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/Lexigraph.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/Namespace.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/Namespace.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/Node.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/Node.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/NodeContainer.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/NodeContainer.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/Null.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/Null.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/NullAttribute.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/NullAttribute.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/NullElement.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/NullElement.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/NullNamespace.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/NullNamespace.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/NullText.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/NullText.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/NullXAttribute.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/NullXAttribute.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/NullXElement.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/NullXElement.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/NullXNamespace.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/NullXNamespace.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/Text.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/Text.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XAttributeContainer.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XAttributeContainer.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XContainer.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XDeclaration.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XDeclaration.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XElementContainer.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XElementContainer.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XFileSource.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XFileSource.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XList.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XList.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XNamespaceContainer.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XNamespaceContainer.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XNodeContainer.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XNodeContainer.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XPointer.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XSingleSource.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XSingleSource.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XSpace.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XSpace.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XString.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XString.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XStringSource.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XStringSource.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XTextContainer.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XTextContainer.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XWFileSource.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XWFileSource.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XWStringSource.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XWStringSource.h create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XWideSource.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/Private/XWideSource.h create mode 100644 ASCOfficeOdtFile/Source/XML/XAttribute.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/XAttribute.h create mode 100644 ASCOfficeOdtFile/Source/XML/XComment.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/XComment.h create mode 100644 ASCOfficeOdtFile/Source/XML/XContainer.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/XContainer.h create mode 100644 ASCOfficeOdtFile/Source/XML/XDocument.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/XDocument.h create mode 100644 ASCOfficeOdtFile/Source/XML/XElement.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/XElement.h create mode 100644 ASCOfficeOdtFile/Source/XML/XML.h create mode 100644 ASCOfficeOdtFile/Source/XML/XName.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/XName.h create mode 100644 ASCOfficeOdtFile/Source/XML/XNamespace.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/XNamespace.h create mode 100644 ASCOfficeOdtFile/Source/XML/XNode.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/XNode.h create mode 100644 ASCOfficeOdtFile/Source/XML/XObject.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/XObject.h create mode 100644 ASCOfficeOdtFile/Source/XML/XText.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/XText.h create mode 100644 ASCOfficeOdtFile/Source/XML/precompiled_xml.cpp create mode 100644 ASCOfficeOdtFile/Source/XML/precompiled_xml.h create mode 100644 ASCOfficeOdtFile/Source/boost_filesystem/operations.cpp create mode 100644 ASCOfficeOdtFile/Source/boost_filesystem/path.cpp create mode 100644 ASCOfficeOdtFile/Source/boost_filesystem/portability.cpp create mode 100644 ASCOfficeOdtFile/Source/boost_filesystem/utf8_codecvt_facet.cpp create mode 100644 ASCOfficeOdtFile/Source/boost_filesystem/utf8_codecvt_facet.hpp create mode 100644 ASCOfficeOdtFile/Source/boost_system/error_code.cpp diff --git a/ASCOfficeOdtFile/ASCOfficeOdtFile2005.sln b/ASCOfficeOdtFile/ASCOfficeOdtFile2005.sln index 6b5b3d735f..6ed57a99c5 100644 --- a/ASCOfficeOdtFile/ASCOfficeOdtFile2005.sln +++ b/ASCOfficeOdtFile/ASCOfficeOdtFile2005.sln @@ -31,26 +31,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OdtFormat", "Projects\OdtFo {399893AA-3617-4CD8-A980-7F15CDAFA3D2} = {399893AA-3617-4CD8-A980-7F15CDAFA3D2} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocxFormat", "..\Common\ASCDocxFormat\Projects\DocxFormat2005.vcproj", "{A100103A-353E-45E8-A9B8-90B87CC5C0B0}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection - ProjectSection(ProjectDependencies) = postProject - {C1587C15-6268-4451-9263-937E63A945F6} = {C1587C15-6268-4451-9263-937E63A945F6} - {7B9F3647-32D3-4F82-8CA5-A43E490E1457} = {7B9F3647-32D3-4F82-8CA5-A43E490E1457} - {399893AA-3617-4CD8-A980-7F15CDAFA3D2} = {399893AA-3617-4CD8-A980-7F15CDAFA3D2} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XML", "..\Common\ASCDocxFormat\Projects\XML2005.vcproj", "{C1587C15-6268-4451-9263-937E63A945F6}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection - ProjectSection(ProjectDependencies) = postProject - {7B9F3647-32D3-4F82-8CA5-A43E490E1457} = {7B9F3647-32D3-4F82-8CA5-A43E490E1457} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "..\Common\ASCDocxFormat\Projects\Common2005.vcproj", "{399893AA-3617-4CD8-A980-7F15CDAFA3D2}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" @@ -61,13 +41,25 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "..\Common\ASCDocx {7B9F3647-32D3-4F82-8CA5-A43E490E1457} = {7B9F3647-32D3-4F82-8CA5-A43E490E1457} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Utility", "..\Common\ASCDocxFormat\Projects\Utility2005.vcproj", "{7B9F3647-32D3-4F82-8CA5-A43E490E1457}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeOdtFileTest", "ASCOfficeOdtFileTest\ASCOfficeOdfFileTest.vcproj", "{C2882DDD-07E6-4314-AD4B-48F43F38D722}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeOdtFileTest", "ASCOfficeOdtFileTest\ASCOfficeOdfFileTest.vcproj", "{C2882DDD-07E6-4314-AD4B-48F43F38D722}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XML", "Projects\XML2005.vcproj", "{C1587C15-6268-4451-9263-937E63A945F6}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Utility", "Projects\Utility2005.vcproj", "{7B9F3647-32D3-4F82-8CA5-A43E490E1457}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocxFormat", "Projects\DocxFormat2005.vcproj", "{A100103A-353E-45E8-A9B8-90B87CC5C0B0}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" @@ -98,36 +90,36 @@ Global {4F34ADFD-D168-420C-A497-7EF74155EFBE}.Release|Win32.Build.0 = Release|Win32 {4F34ADFD-D168-420C-A497-7EF74155EFBE}.ReleaseASC|Win32.ActiveCfg = Release|Win32 {4F34ADFD-D168-420C-A497-7EF74155EFBE}.ReleaseASC|Win32.Build.0 = Release|Win32 - {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug|Win32.ActiveCfg = Debug|Win32 - {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug|Win32.Build.0 = Debug|Win32 - {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release|Win32.ActiveCfg = Release|Win32 - {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release|Win32.Build.0 = Release|Win32 - {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.ReleaseASC|Win32.ActiveCfg = Release|Win32 - {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.ReleaseASC|Win32.Build.0 = Release|Win32 - {C1587C15-6268-4451-9263-937E63A945F6}.Debug|Win32.ActiveCfg = Debug|Win32 - {C1587C15-6268-4451-9263-937E63A945F6}.Debug|Win32.Build.0 = Debug|Win32 - {C1587C15-6268-4451-9263-937E63A945F6}.Release|Win32.ActiveCfg = Release|Win32 - {C1587C15-6268-4451-9263-937E63A945F6}.Release|Win32.Build.0 = Release|Win32 - {C1587C15-6268-4451-9263-937E63A945F6}.ReleaseASC|Win32.ActiveCfg = Release|Win32 - {C1587C15-6268-4451-9263-937E63A945F6}.ReleaseASC|Win32.Build.0 = Release|Win32 {399893AA-3617-4CD8-A980-7F15CDAFA3D2}.Debug|Win32.ActiveCfg = Debug|Win32 {399893AA-3617-4CD8-A980-7F15CDAFA3D2}.Debug|Win32.Build.0 = Debug|Win32 {399893AA-3617-4CD8-A980-7F15CDAFA3D2}.Release|Win32.ActiveCfg = Release|Win32 {399893AA-3617-4CD8-A980-7F15CDAFA3D2}.Release|Win32.Build.0 = Release|Win32 {399893AA-3617-4CD8-A980-7F15CDAFA3D2}.ReleaseASC|Win32.ActiveCfg = Release|Win32 {399893AA-3617-4CD8-A980-7F15CDAFA3D2}.ReleaseASC|Win32.Build.0 = Release|Win32 - {7B9F3647-32D3-4F82-8CA5-A43E490E1457}.Debug|Win32.ActiveCfg = Debug|Win32 - {7B9F3647-32D3-4F82-8CA5-A43E490E1457}.Debug|Win32.Build.0 = Debug|Win32 - {7B9F3647-32D3-4F82-8CA5-A43E490E1457}.Release|Win32.ActiveCfg = Release|Win32 - {7B9F3647-32D3-4F82-8CA5-A43E490E1457}.Release|Win32.Build.0 = Release|Win32 - {7B9F3647-32D3-4F82-8CA5-A43E490E1457}.ReleaseASC|Win32.ActiveCfg = Release|Win32 - {7B9F3647-32D3-4F82-8CA5-A43E490E1457}.ReleaseASC|Win32.Build.0 = Release|Win32 {C2882DDD-07E6-4314-AD4B-48F43F38D722}.Debug|Win32.ActiveCfg = Debug|Win32 {C2882DDD-07E6-4314-AD4B-48F43F38D722}.Debug|Win32.Build.0 = Debug|Win32 {C2882DDD-07E6-4314-AD4B-48F43F38D722}.Release|Win32.ActiveCfg = Release|Win32 {C2882DDD-07E6-4314-AD4B-48F43F38D722}.Release|Win32.Build.0 = Release|Win32 {C2882DDD-07E6-4314-AD4B-48F43F38D722}.ReleaseASC|Win32.ActiveCfg = Release|Win32 {C2882DDD-07E6-4314-AD4B-48F43F38D722}.ReleaseASC|Win32.Build.0 = Release|Win32 + {C1587C15-6268-4451-9263-937E63A945F6}.Debug|Win32.ActiveCfg = Debug|Win32 + {C1587C15-6268-4451-9263-937E63A945F6}.Debug|Win32.Build.0 = Debug|Win32 + {C1587C15-6268-4451-9263-937E63A945F6}.Release|Win32.ActiveCfg = Release|Win32 + {C1587C15-6268-4451-9263-937E63A945F6}.Release|Win32.Build.0 = Release|Win32 + {C1587C15-6268-4451-9263-937E63A945F6}.ReleaseASC|Win32.ActiveCfg = Release|Win32 + {C1587C15-6268-4451-9263-937E63A945F6}.ReleaseASC|Win32.Build.0 = Release|Win32 + {7B9F3647-32D3-4F82-8CA5-A43E490E1457}.Debug|Win32.ActiveCfg = Debug|Win32 + {7B9F3647-32D3-4F82-8CA5-A43E490E1457}.Debug|Win32.Build.0 = Debug|Win32 + {7B9F3647-32D3-4F82-8CA5-A43E490E1457}.Release|Win32.ActiveCfg = Release|Win32 + {7B9F3647-32D3-4F82-8CA5-A43E490E1457}.Release|Win32.Build.0 = Release|Win32 + {7B9F3647-32D3-4F82-8CA5-A43E490E1457}.ReleaseASC|Win32.ActiveCfg = Release|Win32 + {7B9F3647-32D3-4F82-8CA5-A43E490E1457}.ReleaseASC|Win32.Build.0 = Release|Win32 + {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug|Win32.ActiveCfg = Debug|Win32 + {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug|Win32.Build.0 = Debug|Win32 + {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release|Win32.ActiveCfg = Release|Win32 + {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release|Win32.Build.0 = Release|Win32 + {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.ReleaseASC|Win32.ActiveCfg = Release|Win32 + {A100103A-353E-45E8-A9B8-90B87CC5C0B0}.ReleaseASC|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/ASCOfficeOdtFile/Projects/Docx2Odt2005.vcproj b/ASCOfficeOdtFile/Projects/Docx2Odt2005.vcproj index 06ec2aaf3c..62cb938691 100644 --- a/ASCOfficeOdtFile/Projects/Docx2Odt2005.vcproj +++ b/ASCOfficeOdtFile/Projects/Docx2Odt2005.vcproj @@ -40,7 +40,7 @@ Name="VCCLCompilerTool" AdditionalOptions="-Zm2000" Optimization="0" - AdditionalIncludeDirectories=".\..\..\Common;.\..\..\Common\ASCDocxFormat\Source\Utility;.\..\..\Common\ASCDocxFormat\Source\XML;.\..\..\Common\ASCDocxFormat\Source\Common;.\..\..\Common\ASCDocxFormat\Source\DocxFormat;.\..\Source\OdtFormat;.\..\..\Common\ASCDocxFormat\Source\;.\..\Source\" + AdditionalIncludeDirectories=".\..\..\Common;.\..\Source\Utility;.\..\Source\XML;.\..\Source\Common;.\..\Source\DocxFormat;.\..\Source\OdtFormat;.\..\Source\" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -105,7 +105,7 @@ AdditionalOptions="-Zm512" Optimization="2" EnableIntrinsicFunctions="true" - AdditionalIncludeDirectories=".\..\..\Common;.\..\..\Common\ASCDocxFormat\Source\Utility;.\..\..\Common\ASCDocxFormat\Source\XML;.\..\..\Common\ASCDocxFormat\Source\Common;.\..\..\Common\ASCDocxFormat\Source\DocxFormat;.\..\Source\OdtFormat;.\..\..\Common\ASCDocxFormat\Source\;.\..\Source\" + AdditionalIncludeDirectories=".\..\..\Common;.\..\Source\Utility;.\..\Source\XML;.\..\Source\Common;.\..\Source\DocxFormat;.\..\Source\OdtFormat;.\..\Source\" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="2" diff --git a/ASCOfficeOdtFile/Projects/DocxFormat2005.vcproj b/ASCOfficeOdtFile/Projects/DocxFormat2005.vcproj new file mode 100644 index 0000000000..f5473e7afb --- /dev/null +++ b/ASCOfficeOdtFile/Projects/DocxFormat2005.vcproj @@ -0,0 +1,5645 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ASCOfficeOdtFile/Projects/OdtFormat2005.vcproj b/ASCOfficeOdtFile/Projects/OdtFormat2005.vcproj index 976f0c58b4..62974e87e5 100644 --- a/ASCOfficeOdtFile/Projects/OdtFormat2005.vcproj +++ b/ASCOfficeOdtFile/Projects/OdtFormat2005.vcproj @@ -39,7 +39,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ASCOfficeOdtFile/Projects/XML2005.vcproj b/ASCOfficeOdtFile/Projects/XML2005.vcproj new file mode 100644 index 0000000000..364950d0b5 --- /dev/null +++ b/ASCOfficeOdtFile/Projects/XML2005.vcproj @@ -0,0 +1,1269 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ASCOfficeOdtFile/Source/Common/AbstractConverter.h b/ASCOfficeOdtFile/Source/Common/AbstractConverter.h new file mode 100644 index 0000000000..e741ea04ec --- /dev/null +++ b/ASCOfficeOdtFile/Source/Common/AbstractConverter.h @@ -0,0 +1,53 @@ +#pragma once +#ifndef ABSTRACT_CONVERTER_INCLUDE_H_ +#define ABSTRACT_CONVERTER_INCLUDE_H_ + +#include +#include + + +template +class AbstractConverter : private boost::noncopyable +{ +public: + AbstractConverter(const boost::filesystem::wpath& originPath) + { + m_origin.read(originPath); + } + +public: + const bool isInputValid(const boost::filesystem::wpath& path) const + { + return m_input.isValid(path); + } + + const bool isOriginValid(const boost::filesystem::wpath& path) const + { + return m_origin.isValid(path); + } + + const bool isOutputValid(const boost::filesystem::wpath& path) const + { + return m_output.isValid(path); + } + + void read(const boost::filesystem::wpath& path) + { + m_input.read(path); + } + + void write(const boost::filesystem::wpath& path) const + { + m_output.write(path); + } + +protected: + typedef AbstractConverter base; + +protected: + Input m_input; + Output m_output; + Output m_origin; +}; + +#endif // ABSTRACT_CONVERTER_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Common/Align.cpp b/ASCOfficeOdtFile/Source/Common/Align.cpp new file mode 100644 index 0000000000..4cd90cf3cc --- /dev/null +++ b/ASCOfficeOdtFile/Source/Common/Align.cpp @@ -0,0 +1,107 @@ + +// auto inserted precompiled begin +#include "precompiled_common.h" +// auto inserted precompiled end + +#include "Align.h" + + +namespace Common +{ + + Align::Align() + : m_type(right) + { + } + + + const Align::Type Align::type() const + { + return m_type; + } + + + const Align Align::Right() + { + return Align(right); + } + + + const Align Align::Left() + { + return Align(left); + } + + + const Align Align::Center() + { + return Align(center); + } + + + const Align Align::Both() + { + return Align(both); + } + + + const bool Align::isRight() const + { + return m_type == right; + } + + + const bool Align::isLeft() const + { + return m_type == left; + } + + + const bool Align::isCenter() const + { + return m_type == center; + } + + + const bool Align::isBoth() const + { + return m_type == both; + } + + + void Align::setRight() + { + m_type = right; + } + + + void Align::setLeft() + { + m_type = left; + } + + + void Align::setCenter() + { + m_type = center; + } + + + void Align::setBoth() + { + m_type = both; + } + + + Align::Align(const Align::Type type) + : m_type(type) + { + } + + + void Align::fromBase(const Align& align) + { + m_type = align.m_type; + } + +} // namespace Common \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Common/Align.h b/ASCOfficeOdtFile/Source/Common/Align.h new file mode 100644 index 0000000000..871a53b3f5 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Common/Align.h @@ -0,0 +1,51 @@ +#pragma once +#ifndef COMMON_ALIGN_INCLUDE_H_ +#define COMMON_ALIGN_INCLUDE_H_ + + +namespace Common +{ + class Align + { + public: + Align(); + + enum Type + { + right, + left, + center, + both + }; + + public: + const Type type() const; + + public: + static const Align Right(); + static const Align Left(); + static const Align Center(); + static const Align Both(); + + public: + const bool isRight() const; + const bool isLeft() const; + const bool isCenter() const; + const bool isBoth() const; + + public: + void setRight(); + void setLeft(); + void setCenter(); + void setBoth(); + + protected: + Type m_type; + + protected: + Align(const Type type); + void fromBase(const Align& align); + }; +} // namespace Common + +#endif // COMMON_ALIGN_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Common/Color.cpp b/ASCOfficeOdtFile/Source/Common/Color.cpp new file mode 100644 index 0000000000..823071a96c --- /dev/null +++ b/ASCOfficeOdtFile/Source/Common/Color.cpp @@ -0,0 +1,35 @@ + +// auto inserted precompiled begin +#include "precompiled_common.h" +// auto inserted precompiled end + +#include "Color.h" + + +namespace Common +{ + + Color::Color() + : Red(0x00), + Green(0x00), + Blue(0x00) + { + } + + + Color::Color(const int red, const int green, const int blue) + : Red(red), + Green(green), + Blue(blue) + { + } + + + void Color::fromBase(const Color& color) + { + Red = color.Red; + Green = color.Green; + Blue = color.Blue; + } + +} // namespace Common \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Common/Color.h b/ASCOfficeOdtFile/Source/Common/Color.h new file mode 100644 index 0000000000..fb2e846c0a --- /dev/null +++ b/ASCOfficeOdtFile/Source/Common/Color.h @@ -0,0 +1,26 @@ +#pragma once +#ifndef COMMON_COLOR_INCLUDE_H_ +#define COMMON_COLOR_INCLUDE_H_ + +#include "property.h" + + +namespace Common +{ + class Color + { + public: + Color(); + Color(const int red, const int green, const int blue); + + public: + property > Red; + property > Green; + property > Blue; + + protected: + void fromBase(const Color& color); + }; +} // namespace Common + +#endif // COMMON_COLOR_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Common/Common.h b/ASCOfficeOdtFile/Source/Common/Common.h new file mode 100644 index 0000000000..bd8c961638 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Common/Common.h @@ -0,0 +1,16 @@ +#pragma once +#ifndef COMMON_COMMON_INCLUDE_H_ +#define COMMON_COMMON_INCLUDE_H_ + +#include "Align.h" +#include "Color.h" +#include "Index.h" +#include "Point.h" +#include "Size.h" +#include "NumFormat.h" +#include "Position.h" +#include "Wrap.h" +#include "ZIndex.h" + + +#endif // COMMON_COMMON_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Common/Index.cpp b/ASCOfficeOdtFile/Source/Common/Index.cpp new file mode 100644 index 0000000000..231aa8dbc1 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Common/Index.cpp @@ -0,0 +1,89 @@ + +// auto inserted precompiled begin +#include "precompiled_common.h" +// auto inserted precompiled end + +#include "Index.h" + + +namespace Common +{ + + Index::Index() + : m_type(normal) + { + } + + + const Index::Type Index::type() const + { + return m_type; + } + + + const Index Index::Super() + { + return Index(super); + } + + + const Index Index::Normal() + { + return Index(normal); + } + + + const Index Index::Sub() + { + return Index(sub); + } + + + const bool Index::isSuper() const + { + return m_type == super; + } + + + const bool Index::isNormal() const + { + return m_type == normal; + } + + + const bool Index::isSub() const + { + return m_type == sub; + } + + + void Index::setSuper() + { + m_type = super; + } + + + void Index::setNormal() + { + m_type = normal; + } + + + void Index::setSub() + { + m_type = sub; + } + + + Index::Index(const Index::Type type) + : m_type(type) + { + } + + + void Index::fromBase(const Index& index) + { + m_type = index.m_type; + } + +} // namespace Common \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Common/Index.h b/ASCOfficeOdtFile/Source/Common/Index.h new file mode 100644 index 0000000000..e913d9e3af --- /dev/null +++ b/ASCOfficeOdtFile/Source/Common/Index.h @@ -0,0 +1,47 @@ +#pragma once +#ifndef COMMON_INDEX_INCLUDE_H_ +#define COMMON_INDEX_INCLUDE_H_ + + +namespace Common +{ + class Index + { + public: + Index(); + + enum Type + { + super, + normal, + sub + }; + + public: + const Type type() const; + + public: + static const Index Super(); + static const Index Normal(); + static const Index Sub(); + + public: + const bool isSuper() const; + const bool isNormal() const; + const bool isSub() const; + + public: + void setSuper(); + void setNormal(); + void setSub(); + + protected: + Type m_type; + + protected: + Index(const Type type); + void fromBase(const Index& index); + }; +} // namespace Common + +#endif // COMMON_INDEX_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Common/NumFormat.cpp b/ASCOfficeOdtFile/Source/Common/NumFormat.cpp new file mode 100644 index 0000000000..758e194a3a --- /dev/null +++ b/ASCOfficeOdtFile/Source/Common/NumFormat.cpp @@ -0,0 +1,179 @@ + +// auto inserted precompiled begin +#include "precompiled_common.h" +// auto inserted precompiled end + +#include "NumFormat.h" + + +namespace Common +{ + + NumFormat::NumFormat() + : m_type(decimal) + { + } + + + const NumFormat::Type NumFormat::type() const + { + return m_type; + } + + + const NumFormat NumFormat::UpperLetter() + { + return NumFormat(upperLetter); + } + + + const NumFormat NumFormat::LowerLetter() + { + return NumFormat(lowerLetter); + } + + + const NumFormat NumFormat::UpperRoman() + { + return NumFormat(upperRoman); + } + + + const NumFormat NumFormat::LowerRoman() + { + return NumFormat(lowerRoman); + } + + + const NumFormat NumFormat::Decimal() + { + return NumFormat(decimal); + } + + + const NumFormat NumFormat::Symbol() + { + return NumFormat(symbol); + } + + + const NumFormat NumFormat::Bullet() + { + return NumFormat(bullet); + } + + + const NumFormat NumFormat::Chicago() + { + return NumFormat(chicago); + } + + + const bool NumFormat::isUpperLetter() const + { + return m_type == upperLetter; + } + + + const bool NumFormat::isLowerLetter() const + { + return m_type == lowerLetter; + } + + + const bool NumFormat::isUpperRoman() const + { + return m_type == upperRoman; + } + + + const bool NumFormat::isLowerRoman() const + { + return m_type == lowerRoman; + } + + + const bool NumFormat::isDecimal() const + { + return m_type == decimal; + } + + + const bool NumFormat::isSymbol() const + { + return m_type == symbol; + } + + + const bool NumFormat::isBullet() const + { + return m_type == bullet; + } + + + const bool NumFormat::isChicago() const + { + return m_type == chicago; + } + + + void NumFormat::setUpperLetter() + { + m_type = upperLetter; + } + + + void NumFormat::setLowerLetter() + { + m_type = lowerLetter; + } + + + void NumFormat::setUpperRoman() + { + m_type = upperRoman; + } + + + void NumFormat::setLowerRoman() + { + m_type = lowerRoman; + } + + + void NumFormat::setDecimal() + { + m_type = decimal; + } + + + void NumFormat::setSymbol() + { + m_type = symbol; + } + + + void NumFormat::setBullet() + { + m_type = bullet; + } + + + void NumFormat::setChicago() + { + m_type = chicago; + } + + + NumFormat::NumFormat(const NumFormat::Type type) + : m_type(type) + { + } + + + void NumFormat::fromBase(const NumFormat& numFormat) + { + m_type = numFormat.m_type; + } + +} // namespace Common \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Common/NumFormat.h b/ASCOfficeOdtFile/Source/Common/NumFormat.h new file mode 100644 index 0000000000..db438f8e25 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Common/NumFormat.h @@ -0,0 +1,68 @@ +#pragma once +#ifndef COMMON_NUM_FORMAT_INCLUDE_H_ +#define COMMON_NUM_FORMAT_INCLUDE_H_ + + +namespace Common +{ + class NumFormat + { + public: + NumFormat(); + + //TODO: Add other types + enum Type + { + upperLetter, + lowerLetter, + upperRoman, + lowerRoman, + decimal, + symbol, + bullet, + chicago + }; + + public: + const Type type() const; + + public: + static const NumFormat UpperLetter(); + static const NumFormat LowerLetter(); + static const NumFormat UpperRoman(); + static const NumFormat LowerRoman(); + static const NumFormat Decimal(); + static const NumFormat Symbol(); + static const NumFormat Bullet(); + static const NumFormat Chicago(); + + public: + const bool isUpperLetter() const; + const bool isLowerLetter() const; + const bool isUpperRoman() const; + const bool isLowerRoman() const; + const bool isDecimal() const; + const bool isSymbol() const; + const bool isBullet() const; + const bool isChicago() const; + + public: + void setUpperLetter(); + void setLowerLetter(); + void setUpperRoman(); + void setLowerRoman(); + void setDecimal(); + void setSymbol(); + void setBullet(); + void setChicago(); + + protected: + Type m_type; + + protected: + NumFormat(const Type type); + void fromBase(const NumFormat& numFormat); + }; +} // namespace Common + +#endif // COMMON_NUM_FORMAT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Common/Point.h b/ASCOfficeOdtFile/Source/Common/Point.h new file mode 100644 index 0000000000..285bc50168 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Common/Point.h @@ -0,0 +1,71 @@ +#pragma once +#ifndef COMMON_POINT_INCLUDE_H_ +#define COMMON_POINT_INCLUDE_H_ + +#include "Unit.h" +#include "property.h" +#include "nullable_property.h" +#include "XML.h" + + +namespace Common +{ + template + class Point + { + public: + Point() {}; + + template + Point(const XType& x, const YType& y) + : X(x), Y(y) + { + } + + template + Point(const OtherUnit& rhs) + : X(rhs.X), Y(rhs.Y) + { + } + + template + const Point& operator =(const OtherUnit& rhs) + { + X = ths.X; + Y = ths.Y; + return *this; + } + + public: + property X; + property Y; + }; +} // namespace Common + + +namespace XML +{ + template + const Common::Point XElement2Point(const XML::XElement& element, const std::string& x, const std::string& y) + { + Common::Point point; + point.X = element.attribute(x).value().ToString(); + point.Y = element.attribute(y).value().ToString(); + return point; + } + + template + const nullable > XElement2NullablePoint(const XML::XElement& element, const std::string& x, const std::string& y) + { + nullable > point; + if (element.attribute(x).exist() || element.attribute(y).exist()) + point.init(); + if (element.attribute(x).exist()) + point->X = element.attribute(x).value().ToString(); + if (element.attribute(y).exist()) + point->Y = element.attribute(y).value().ToString(); + return point; + } +} // namespace XML + +#endif // COMMON_POINT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Common/Position.cpp b/ASCOfficeOdtFile/Source/Common/Position.cpp new file mode 100644 index 0000000000..b0b337b16c --- /dev/null +++ b/ASCOfficeOdtFile/Source/Common/Position.cpp @@ -0,0 +1,71 @@ + +// auto inserted precompiled begin +#include "precompiled_common.h" +// auto inserted precompiled end + +#include "Position.h" + + +namespace Common +{ + + Position::Position() + : m_type(foreground) + { + } + + + const Position::Type Position::type() const + { + return m_type; + } + + + const Position Position::Background() + { + return Position(background); + } + + + const Position Position::Foreground() + { + return Position(foreground); + } + + + const bool Position::isBackground() const + { + return m_type == background; + } + + + const bool Position::isForeground() const + { + return m_type == foreground; + } + + + void Position::setBackground() + { + m_type = background; + } + + + void Position::setForeground() + { + m_type = foreground; + } + + + Position::Position(const Position::Type type) + : m_type(type) + { + } + + + void Position::fromBase(const Position& position) + { + m_type = position.m_type; + } + +} // namespace Common \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Common/Position.h b/ASCOfficeOdtFile/Source/Common/Position.h new file mode 100644 index 0000000000..9f6fa30351 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Common/Position.h @@ -0,0 +1,43 @@ +#pragma once +#ifndef COMMON_POSITION_INCLUDE_H_ +#define COMMON_POSITION_INCLUDE_H_ + + +namespace Common +{ + class Position + { + public: + Position(); + + enum Type + { + background, + foreground + }; + + public: + const Type type() const; + + public: + static const Position Background(); + static const Position Foreground(); + + public: + const bool isBackground() const; + const bool isForeground() const; + + public: + void setBackground(); + void setForeground(); + + protected: + Type m_type; + + protected: + Position(const Type type); + void fromBase(const Position& position); + }; +} // namespace Common + +#endif // COMMON_POSITION_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Common/Size.h b/ASCOfficeOdtFile/Source/Common/Size.h new file mode 100644 index 0000000000..db2e6cc170 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Common/Size.h @@ -0,0 +1,71 @@ +#pragma once +#ifndef COMMON_SIZE_INCLUDE_H_ +#define COMMON_SIZE_INCLUDE_H_ + +#include "Unit.h" +#include "property.h" +#include "nullable_property.h" +#include "XML.h" + + +namespace Common +{ + template + class Size + { + public: + Size() {} + + template + Size(const HeightType& height, WidthType width) + : Height(height), Width(width) + { + } + + template + Size(const OtherUnit& rhs) + : Height(rhs.Height), Width(rhs.Width) + { + } + + template + const Size& operator =(const OtherUnit& rhs) + { + Height = ths.Height; + Width = ths.Width; + return *this; + } + + public: + property Height; + property Width; + }; +} // namespace Common + + +namespace XML +{ + template + const Common::Size XElement2Size(const XML::XElement& element, const std::string& height, const std::string& width) + { + Common::Size size; + size.Height = element.attribute(height).value().ToString(); + size.Width = element.attribute(width).value().ToString(); + return size; + } + + template + const nullable > XElement2NullableSize(const XML::XElement& element, const std::string& height, const std::string& width) + { + nullable > size; + if (element.attribute(height).exist() || element.attribute(width).exist()) + size.init(); + if (element.attribute(height).exist()) + size->Height = element.attribute(height).value().ToString(); + if (element.attribute(width).exist()) + size->Width = element.attribute(width).value().ToString(); + return size; + } +} // namespace XML + +#endif // COMMON_SIZE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Common/Wrap.cpp b/ASCOfficeOdtFile/Source/Common/Wrap.cpp new file mode 100644 index 0000000000..a89505e546 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Common/Wrap.cpp @@ -0,0 +1,107 @@ + +// auto inserted precompiled begin +#include "precompiled_common.h" +// auto inserted precompiled end + +#include "Wrap.h" + + +namespace Common +{ + + Wrap::Wrap() + : m_type(square) + { + } + + + const Wrap::Type Wrap::type() const + { + return m_type; + } + + + const Wrap Wrap::Square() + { + return Wrap(square); + } + + + const Wrap Wrap::Tight() + { + return Wrap(tight); + } + + + const Wrap Wrap::TopAndBottom() + { + return Wrap(topAndBottom); + } + + + const Wrap Wrap::None() + { + return Wrap(none); + } + + + const bool Wrap::isSquare() const + { + return m_type == square; + } + + + const bool Wrap::isTight() const + { + return m_type == tight; + } + + + const bool Wrap::isTopAndBottom() const + { + return m_type == topAndBottom; + } + + + const bool Wrap::isNone() const + { + return m_type == none; + } + + + void Wrap::setSquare() + { + m_type = square; + } + + + void Wrap::setTight() + { + m_type = tight; + } + + + void Wrap::setTopAndBottom() + { + m_type = topAndBottom; + } + + + void Wrap::setNone() + { + m_type = none; + } + + + Wrap::Wrap(const Wrap::Type type) + : m_type(type) + { + } + + + void Wrap::fromBase(const Wrap& wrap) + { + m_type = wrap.m_type; + } + +} // namespace Common \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Common/Wrap.h b/ASCOfficeOdtFile/Source/Common/Wrap.h new file mode 100644 index 0000000000..b7b4483d4b --- /dev/null +++ b/ASCOfficeOdtFile/Source/Common/Wrap.h @@ -0,0 +1,51 @@ +#pragma once +#ifndef COMMON_WRAP_INCLUDE_H_ +#define COMMON_WRAP_INCLUDE_H_ + + +namespace Common +{ + class Wrap + { + public: + Wrap(); + + enum Type + { + square, + tight, + topAndBottom, + none + }; + + public: + const Type type() const; + + public: + static const Wrap Square(); + static const Wrap Tight(); + static const Wrap TopAndBottom(); + static const Wrap None(); + + public: + const bool isSquare() const; + const bool isTight() const; + const bool isTopAndBottom() const; + const bool isNone() const; + + public: + void setSquare(); + void setTight(); + void setTopAndBottom(); + void setNone(); + + protected: + Type m_type; + + protected: + Wrap(const Type type); + void fromBase(const Wrap& wrap); + }; +} // namespace Common + +#endif // COMMON_WRAP_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Common/ZIndex.cpp b/ASCOfficeOdtFile/Source/Common/ZIndex.cpp new file mode 100644 index 0000000000..9e1c5d3882 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Common/ZIndex.cpp @@ -0,0 +1,29 @@ + +// auto inserted precompiled begin +#include "precompiled_common.h" +// auto inserted precompiled end + +#include "ZIndex.h" + + +namespace Common +{ + + ZIndex::ZIndex() + : Index(0) + { + } + + + ZIndex::ZIndex(const int& index) + : Index(index) + { + } + + + void ZIndex::fromBase(const ZIndex& zIndex) + { + Index = zIndex.Index; + } + +} // namespace Common \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Common/ZIndex.h b/ASCOfficeOdtFile/Source/Common/ZIndex.h new file mode 100644 index 0000000000..6048e12efe --- /dev/null +++ b/ASCOfficeOdtFile/Source/Common/ZIndex.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef COMMON_Z_INDEX_INCLUDE_H_ +#define COMMON_Z_INDEX_INCLUDE_H_ + +#include "property.h" + + +namespace Common +{ + class ZIndex + { + public: + ZIndex(); + ZIndex(const int& index); + + public: + property Index; + + protected: + void fromBase(const ZIndex& zIndex); + }; +} // namespace Common + +#endif // COMMON_Z_INDEX_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Common/precompiled_common.cpp b/ASCOfficeOdtFile/Source/Common/precompiled_common.cpp new file mode 100644 index 0000000000..f2f02a3088 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Common/precompiled_common.cpp @@ -0,0 +1,5 @@ + +// auto inserted precompiled begin +#include "precompiled_common.h" +// auto inserted precompiled end + diff --git a/ASCOfficeOdtFile/Source/Common/precompiled_common.h b/ASCOfficeOdtFile/Source/Common/precompiled_common.h new file mode 100644 index 0000000000..dc99046065 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Common/precompiled_common.h @@ -0,0 +1,8 @@ +#pragma once + +#include +#include + +#include "unit.h" +#include "property.h" +#include "nullable_property.h" diff --git a/ASCOfficeOdtFile/Source/DocxFormat/App.cpp b/ASCOfficeOdtFile/Source/DocxFormat/App.cpp new file mode 100644 index 0000000000..b64a5e1c16 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/App.cpp @@ -0,0 +1,112 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "App.h" +#include "FileTypes.h" + + +namespace OOX +{ + + App::App() + { + } + + + App::App(const boost::filesystem::wpath& filename) + { + read(filename); + } + + + App::~App() + { + } + + + void App::read(const boost::filesystem::wpath& filename) + { + const XML::XDocument document(filename); + + m_template = document.Root.element("Template").text(); + m_totalTime = document.Root.element("TotalTime").text(); + Pages = document.Root.element("Pages").text(); + Words = document.Root.element("Words").text(); + Characters = document.Root.element("Characters").text(); + m_appllication= document.Root.element("Application").text(); + m_docSecurity = document.Root.element("DocSecurity").text(); + m_lines = document.Root.element("Lines").text(); + Paragraphs = document.Root.element("Paragraphs").text(); + m_scaleCrop = document.Root.element("ScaleCrop").text(); + m_company = document.Root.element("Company").text(); + m_linksUpToDate = document.Root.element("LinksUpToDate").text(); + CharactersWithSpaces = document.Root.element("CharactersWithSpaces").text(); + m_shareDoc = document.Root.element("SharedDoc").text(); + m_hyperLinksChanged = document.Root.element("HyperlinksChanged").text(); + m_appVersion = document.Root.element("AppVersion").text(); + } + + + void App::write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const + { + XML::XElement element = XML::XElement("Properties", + XML::XNamespace("xmlns", "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties")); + if (m_template.is_init()) + element.Add(XML::XElement("Template", XML::XText(m_template))); + if (m_totalTime.is_init()) + element.Add(XML::XElement("TotalTime", XML::XText(m_totalTime))); + if (Pages.is_init()) + element.Add(XML::XElement("Pages", XML::XText(Pages))); + if (Words.is_init()) + element.Add(XML::XElement("Words", XML::XText(Words))); + if (Characters.is_init()) + element.Add(XML::XElement("Characters", XML::XText(Characters))); + if (m_appllication.is_init()) + element.Add(XML::XElement("Application", XML::XText(m_appllication))); + if (m_docSecurity.is_init()) + element.Add(XML::XElement("DocSecurity", XML::XText(m_docSecurity))); + if (m_template.is_init()) + element.Add(XML::XElement("Lines", XML::XText(m_lines))); + if (Paragraphs.is_init()) + element.Add(XML::XElement("Paragraphs", XML::XText(Paragraphs))); + if (m_scaleCrop.is_init()) + element.Add(XML::XElement("ScaleCrop", XML::XText(m_scaleCrop))); + if (m_company.is_init()) + element.Add(XML::XElement("Company", XML::XText(m_company))); + if (m_linksUpToDate.is_init()) + element.Add(XML::XElement("LinksUpToDate", XML::XText(m_linksUpToDate))); + if (CharactersWithSpaces.is_init()) + element.Add(XML::XElement("CharactersWithSpaces", XML::XText(CharactersWithSpaces))); + if (m_shareDoc.is_init()) + element.Add(XML::XElement("SharedDoc", XML::XText(m_shareDoc))); + if (m_hyperLinksChanged.is_init()) + element.Add(XML::XElement("HyperlinksChanged", XML::XText(m_hyperLinksChanged))); + if (m_appVersion.is_init()) + element.Add(XML::XElement("AppVersion", XML::XText(m_appVersion))); + element.Save(filename); + + + content.registration(type().OverrideType(), directory, filename); + } + + + const FileType App::type() const + { + return FileTypes::App; + } + + + const boost::filesystem::wpath App::DefaultDirectory() const + { + return type().DefaultDirectory(); + } + + + const boost::filesystem::wpath App::DefaultFileName() const + { + return type().DefaultFileName(); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/App.h b/ASCOfficeOdtFile/Source/DocxFormat/App.h new file mode 100644 index 0000000000..2230cfdf63 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/App.h @@ -0,0 +1,51 @@ +#pragma once +#ifndef OOX_APP_INCLUDE_H_ +#define OOX_APP_INCLUDE_H_ + +#include "File.h" +#include "property.h" +#include "nullable.h" + + +namespace OOX +{ + class App : public OOX::File + { + public: + App(); + App(const boost::filesystem::wpath& filename); + virtual ~App(); + + public: + virtual void read(const boost::filesystem::wpath& filename); + virtual void write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const; + + public: + virtual const FileType type() const; + virtual const boost::filesystem::wpath DefaultDirectory() const; + virtual const boost::filesystem::wpath DefaultFileName() const; + + public: + nullable_property > Pages; + nullable_property > Words; + nullable_property > Paragraphs; + nullable_property > Characters; + nullable_property > CharactersWithSpaces; + + private: + nullable m_template; + nullable m_totalTime; + nullable m_appllication; + nullable m_docSecurity; + nullable m_lines; + nullable m_paragraphs; + nullable m_scaleCrop; + nullable m_company; + nullable m_linksUpToDate; + nullable m_shareDoc; + nullable m_hyperLinksChanged; + nullable m_appVersion; + }; +} // namespace OOX + +#endif // OOX_APP_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/Default.cpp b/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/Default.cpp new file mode 100644 index 0000000000..18ff6ec4d8 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/Default.cpp @@ -0,0 +1,69 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Default.h" +#include "Extensiontable.h" + + +namespace OOX +{ + namespace ContentTypes + { + + Default::Default(const std::wstring& extension) + : m_extension(extension) + { + } + + + Default::Default(const wchar_t* extension) + : m_extension(extension) + { + } + + + Default::~Default() + { + } + + + Default::Default(const XML::XNode& node) + { + fromXML(node); + } + + + const Default& Default::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Default::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_extension = element.attribute("Extension").value(); + } + + + const XML::XNode Default::toXML() const + { + static const ExtensionTable table; + return + XML::XElement("Default", + XML::XAttribute("Extension", m_extension) + + XML::XAttribute("ContentType", table[m_extension]) + ); + } + + + const bool Default::operator ==(const std::wstring& rhs) const + { + return m_extension == rhs; + } + + } // namespace ContentTypes +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/Default.h b/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/Default.h new file mode 100644 index 0000000000..554d2f0f15 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/Default.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef OOX_CONTENT_TYPES_DEFAULT_INCLUDE_H_ +#define OOX_CONTENT_TYPES_DEFAULT_INCLUDE_H_ + +#include "./../WritingElement.h" +#include + + +namespace OOX +{ + namespace ContentTypes + { + class Default : public WritingElement + { + public: + Default(const std::wstring& extension); + Default(const wchar_t* extension); + virtual ~Default(); + explicit Default(const XML::XNode& node); + const Default& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + const bool operator ==(const std::wstring& rhs) const; + + private: + std::wstring m_extension; + }; + } // namespace ContentTypes +} // namespace OOX + +#endif // OOX_CONTENT_TYPES_DEFAULT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/DefaultTable.cpp b/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/DefaultTable.cpp new file mode 100644 index 0000000000..615b0c7084 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/DefaultTable.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "DefaultTable.h" +#include + + +namespace OOX +{ + namespace ContentTypes + { + + DefaultTable::DefaultTable() + { + m_items.push_back(L"rels"); + m_items.push_back(L"xml"); + } + + + DefaultTable::~DefaultTable() + { + } + + + DefaultTable::DefaultTable(const XML::XNode& node) + { + fromXML(node); + } + + + const DefaultTable& DefaultTable::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void DefaultTable::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + XML::Fill(m_items, element, "Default"); + } + + + void DefaultTable::add(const boost::filesystem::wpath& path) + { + const std::wstring extension = path.extension().substr(1); + if (std::find(begin(), end(), extension) == end()) + m_items.push_back(extension); + } + + } // namespace ContentTypes +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/DefaultTable.h b/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/DefaultTable.h new file mode 100644 index 0000000000..41ec3783e0 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/DefaultTable.h @@ -0,0 +1,31 @@ +#pragma once +#ifndef OOX_CONTENT_TYPES_DEFAULT_TABLE_INCLUDE_H_ +#define OOX_CONTENT_TYPES_DEFAULT_TABLE_INCLUDE_H_ + +#include "./../WritingVector.h" +#include "Default.h" +#include + + +namespace OOX +{ + namespace ContentTypes + { + class DefaultTable : public WritingVector + { + public: + DefaultTable(); + virtual ~DefaultTable(); + explicit DefaultTable(const XML::XNode& node); + const DefaultTable& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + + public: + void add(const boost::filesystem::wpath& path); + }; + } // namespace ContentTypes +} // namespace OOX + +#endif // OOX_CONTENT)TYPES_DEFAULT_TABLE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/ExtensionTable.cpp b/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/ExtensionTable.cpp new file mode 100644 index 0000000000..a865bd879c --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/ExtensionTable.cpp @@ -0,0 +1,59 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ExtensionTable.h" +#include "Exception/log_range_error.h" +#include "ToString.h" + + +namespace OOX +{ + namespace ContentTypes + { + + ExtensionTable::ExtensionTable() + { + m_table.insert(std::make_pair(L"gif", "image/gif")); + m_table.insert(std::make_pair(L"png", "image/png")); + m_table.insert(std::make_pair(L"tif", "image/tiff")); + m_table.insert(std::make_pair(L"tiff", "image/tiff")); + m_table.insert(std::make_pair(L"jpeg", "image/jpeg")); + m_table.insert(std::make_pair(L"jpg", "image/jpeg")); + m_table.insert(std::make_pair(L"jpe", "image/jpeg")); + m_table.insert(std::make_pair(L"jfif", "image/jpeg")); + m_table.insert(std::make_pair(L"rels", "application/vnd.openxmlformats-package.relationships+xml")); + m_table.insert(std::make_pair(L"bin", "application/vnd.openxmlformats-officedocument.oleObject")); + m_table.insert(std::make_pair(L"xml", "application/xml")); + m_table.insert(std::make_pair(L"emf", "image/x-emf")); + m_table.insert(std::make_pair(L"emz", "image/x-emz")); + m_table.insert(std::make_pair(L"wmf", "image/x-wmf")); + m_table.insert(std::make_pair(L"svm", "image/svm")); + m_table.insert(std::make_pair(L"wav", "audio/wav")); + m_table.insert(std::make_pair(L"xls", "application/vnd.ms-excel")); + m_table.insert(std::make_pair(L"xlsm", "application/vnd.ms-excel.sheet.macroEnabled.12")); + m_table.insert(std::make_pair(L"xlsb", "application/vnd.ms-excel.sheet.binary.macroEnabled.12")); + m_table.insert(std::make_pair(L"xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")); + m_table.insert(std::make_pair(L"ppt", "application/vnd.ms-powerpoint")); + m_table.insert(std::make_pair(L"pptm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12")); + m_table.insert(std::make_pair(L"pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation")); + m_table.insert(std::make_pair(L"sldm", "application/vnd.ms-powerpoint.slide.macroEnabled.12")); + m_table.insert(std::make_pair(L"sldx", "application/vnd.openxmlformats-officedocument.presentationml.slide")); + m_table.insert(std::make_pair(L"doc", "application/msword")); + m_table.insert(std::make_pair(L"docm", "aapplication/vnd.ms-word.document.macroEnabled.12")); + m_table.insert(std::make_pair(L"docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document")); + m_table.insert(std::make_pair(L"vml", "application/vnd.openxmlformats-officedocument.vmlDrawing")); + } + + + const std::string& ExtensionTable::operator[] (const std::wstring& extension) const + { + std::map::const_iterator iter = m_table.find(ToLower(extension)); + if (iter == m_table.end()) + throw log_range_error(L"not found " + extension + L" in extension table"); + return iter->second; + } + + } // namespace ContentTypes +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/ExtensionTable.h b/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/ExtensionTable.h new file mode 100644 index 0000000000..f6e5c9ebc8 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/ExtensionTable.h @@ -0,0 +1,26 @@ +#pragma once +#ifndef OOX_CONTENT_TYPES_EXTENSION_TABLE_INCLUDE_H_ +#define OOX_CONTENT_TYPES_EXTENSION_TABLE_INCLUDE_H_ + +#include +#include +#include + + +namespace OOX +{ + namespace ContentTypes + { + class ExtensionTable : private boost::noncopyable + { + public: + ExtensionTable(); + const std::string& operator[] (const std::wstring& extention) const; + + private: + std::map m_table; + }; + } // namespace ContentTypes +} // namespace OOX + +#endif // OOX_CONTENT_TYPES_EXTENSION_TABLE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/File.cpp b/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/File.cpp new file mode 100644 index 0000000000..3491480447 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/File.cpp @@ -0,0 +1,63 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "File.h" +#include "./../FileTypes.h" + + +namespace OOX +{ + namespace ContentTypes + { + static const boost::filesystem::wpath s_filename = L"[Content_Types].xml"; + + File::File() + { + } + + + File::File(const boost::filesystem::wpath& path) + { + read(path); + } + + + File::~File() + { + } + + + void File::read(const boost::filesystem::wpath& path) + { + const XML::XDocument document(path / s_filename); + Default = document.Root; + Override = document.Root; + } + + + void File::write(const boost::filesystem::wpath& path) const + { + XML::XElement("Types", + XML::XNamespace("xmlns", "http://schemas.openxmlformats.org/package/2006/content-types") + + XML::Write(Default) + + XML::Write(Override) + ).Save(path / s_filename); + } + + + const bool File::isValid() const + { + return true; + } + + + void File::registration(const std::string& type, const boost::filesystem::wpath& directory, const boost::filesystem::wpath& filename) + { + Override->add(type, directory / filename.filename()); + Default->add(directory / filename.filename()); + } + + } // namespace ContentTypes +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/File.h b/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/File.h new file mode 100644 index 0000000000..07df49bb6a --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/File.h @@ -0,0 +1,38 @@ +#pragma once +#ifndef OOX_CONTENT_TYPES_FILE_INCLUDE_H_ +#define OOX_CONTENT_TYPES_FILE_INCLUDE_H_ + +#include "property.h" +#include +#include "OverrideTable.h" +#include "DefaultTable.h" +#include "./../FileType.h" + + +namespace OOX +{ + namespace ContentTypes + { + class File + { + public: + File(); + File(const boost::filesystem::wpath& path); + virtual ~File(); + + public: + virtual void read(const boost::filesystem::wpath& path); + virtual void write(const boost::filesystem::wpath& path) const; + virtual const bool isValid() const; + + public: + void registration(const std::string& type, const boost::filesystem::wpath& directory, const boost::filesystem::wpath& filename); + + public: + property Override; + property Default; + }; + } // namespace ContentTypes +} // namespace OOX + +#endif // DOCX_CONTENT_TYPES_FILE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/Override.cpp b/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/Override.cpp new file mode 100644 index 0000000000..6c767cf5cb --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/Override.cpp @@ -0,0 +1,69 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Override.h" + + +namespace OOX +{ + namespace ContentTypes + { + + Override::Override(const std::string& type, const boost::filesystem::wpath& path) + : m_part(path), + m_type(type) + { + } + + + Override::~Override() + { + } + + + Override::Override(const XML::XNode& node) + { + fromXML(node); + } + + + const Override& Override::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Override::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_part = element.attribute("PartName").value(); + m_type = element.attribute("ContentType").value(); + } + + + const XML::XNode Override::toXML() const + { + return + XML::XElement("Override", + XML::XAttribute("PartName", L"/" + m_part.string()) + + XML::XAttribute("ContentType", m_type) + ); + } + + + const std::string Override::type() const + { + return m_type; + } + + + const boost::filesystem::wpath Override::filename() const + { + return m_part; + } + + } // namespace ContentTypes +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/Override.h b/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/Override.h new file mode 100644 index 0000000000..309b979ceb --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/Override.h @@ -0,0 +1,38 @@ +#pragma once +#ifndef OOX_CONTENT_TYPES_OVERRIDE_INCLUDE_H_ +#define OOX_CONTENT_TYPES_OVERRIDE_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include +#include + + +namespace OOX +{ + namespace ContentTypes + { + class Override : public WritingElement + { + public: + Override(const std::string& type, const boost::filesystem::wpath& path); + virtual ~Override(); + explicit Override(const XML::XNode& node); + const Override& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + const std::string type() const; + const boost::filesystem::wpath filename() const; + + private: + std::string m_type; + boost::filesystem::wpath m_part; + }; + } // namespace ContentTypes +} // namespace OOX + +#endif // OOX_CONTENT_TYPES_OVERRIDE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/OverrideTable.cpp b/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/OverrideTable.cpp new file mode 100644 index 0000000000..7486af8e14 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/OverrideTable.cpp @@ -0,0 +1,50 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "OverrideTable.h" + + +namespace OOX +{ + namespace ContentTypes + { + + OverrideTable::OverrideTable() + { + } + + + OverrideTable::~OverrideTable() + { + } + + + OverrideTable::OverrideTable(const XML::XNode& node) + { + fromXML(node); + } + + + const OverrideTable& OverrideTable::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void OverrideTable::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + XML::Fill(m_items, element, "Override"); + } + + + void OverrideTable::add(const std::string& type, const boost::filesystem::wpath& path) + { + m_items.push_back(Override(type, path)); + } + + } // namespace ContentTypes +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/OverrideTable.h b/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/OverrideTable.h new file mode 100644 index 0000000000..d7d9d6dea4 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/ContentTypes/OverrideTable.h @@ -0,0 +1,31 @@ +#pragma once +#ifndef OOX_CONTENT_TYPES_OVERRIDE_TABLE_INCLUDE_H_ +#define OOX_CONTENT_TYPES_OVERRIDE_TABLE_INCLUDE_H_ + +#include "./../WritingVector.h" +#include "Override.h" +#include + + +namespace OOX +{ + namespace ContentTypes + { + class OverrideTable : public WritingVector + { + public: + OverrideTable(); + virtual ~OverrideTable(); + explicit OverrideTable(const XML::XNode& node); + const OverrideTable& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + + public: + void add(const std::string& type, const boost::filesystem::wpath& path); + }; + } // namespace ContentTypes +} // namespace OOX + +#endif // OOX_CONTENT_TYPES_OVERRIDE_TABLE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Core.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Core.cpp new file mode 100644 index 0000000000..4f3a6a9501 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Core.cpp @@ -0,0 +1,86 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Core.h" +#include "FileTypes.h" + + +namespace OOX +{ + + Core::Core() + { + } + + + Core::Core(const boost::filesystem::wpath& filename) + { + read(filename); + } + + + Core::~Core() + { + } + + + void Core::read(const boost::filesystem::wpath& filename) + { + const XML::XDocument document(filename); + + m_title = document.Root.element("title").text(); + m_subject = document.Root.element("subject").text(); + m_creator = document.Root.element("creator").text(); + m_keywords = document.Root.element("keywords").text(); + m_description = document.Root.element("description").text(); + m_lastModifiedBy = document.Root.element("lastModifiedBy").text(); + m_revision = 1; + } + + + void Core::write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const + { + XML::XElement(ns.cp + "coreProperties", + XML::XElement(ns.dc + "title", XML::XText(m_title)) + + XML::XElement(ns.dc + "subject", XML::XText(m_subject)) + + XML::XElement(ns.dc + "creator", XML::XText(m_creator)) + + XML::XElement(ns.cp + "keywords", XML::XText(m_keywords)) + + XML::XElement(ns.dc + "description", XML::XText(m_description)) + + XML::XElement(ns.cp + "lastModifiedBy", XML::XText(m_lastModifiedBy)) + + XML::XElement(ns.cp + "revision", XML::XText(m_revision)) + + XML::WriteIf(XML::XElement(ns.dcterms + "created", + XML::XAttribute(ns.xsi + "type", "dcterms:W3CDTF") + + XML::XText(m_created)), + m_created.is_init() + ) + + XML::WriteIf(XML::XElement(ns.dcterms + "modified", + XML::XAttribute(ns.xsi + "type", "dcterms:W3CDTF") + + XML::XText(m_modified)), + m_modified.is_init() + ) + ).Save(filename); + + content.registration(type().OverrideType(), directory, filename); + } + + + const FileType Core::type() const + { + return FileTypes::Core; + } + + + const boost::filesystem::wpath Core::DefaultDirectory() const + { + return type().DefaultDirectory(); + } + + + const boost::filesystem::wpath Core::DefaultFileName() const + { + return type().DefaultFileName(); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Core.h b/ASCOfficeOdtFile/Source/DocxFormat/Core.h new file mode 100644 index 0000000000..af4649e078 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Core.h @@ -0,0 +1,42 @@ +#pragma once +#ifndef OOX_CORE_INCLUDE_H_ +#define OOX_CORE_INCLUDE_H_ + +#include "File.h" +#include "DateTime.h" +#include "nullable.h" +#include "property.h" + + +namespace OOX +{ + class Core : public OOX::File + { + public: + Core(); + Core(const boost::filesystem::wpath& filename); + virtual ~Core(); + + public: + virtual void read(const boost::filesystem::wpath& filename); + virtual void write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const; + + public: + virtual const FileType type() const; + virtual const boost::filesystem::wpath DefaultDirectory() const; + virtual const boost::filesystem::wpath DefaultFileName() const; + + private: + nullable m_title; + nullable m_subject; + nullable m_creator; + nullable m_keywords; + nullable m_description; + nullable m_lastModifiedBy; + nullable m_revision; + nullable m_created; + nullable m_modified; + }; +} // namespace OOX + +#endif // OOX_CORE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/DateTime.cpp b/ASCOfficeOdtFile/Source/DocxFormat/DateTime.cpp new file mode 100644 index 0000000000..6ace544bde --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/DateTime.cpp @@ -0,0 +1,54 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "DateTime.h" + + +namespace OOX +{ + + const std::string DateTime::s_pattern("%YYYY-%MM-%DDT%hh:%mm:%ssZ"); + + DateTime::DateTime() + { + } + + + DateTime::DateTime(const std::string& value) + : m_datetime(value, s_pattern) + { + } + + + DateTime::DateTime(const ::DateTime& dt) + : m_datetime(dt) + { + } + + + const std::string DateTime::ToString() const + { + return m_datetime.ToString(s_pattern); + } + + + const DateTime DateTime::Parse(const std::string& value) + { + return DateTime(value); + } + + + ::DateTime& DateTime::datetime() + { + return m_datetime; + } + + + const ::DateTime& DateTime::datetime() const + { + return m_datetime; + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/DateTime.h b/ASCOfficeOdtFile/Source/DocxFormat/DateTime.h new file mode 100644 index 0000000000..af221bf52c --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/DateTime.h @@ -0,0 +1,32 @@ +#pragma once +#ifndef OOX_DATE_TIME_INCLUDE_H_ +#define OOX_DATE_TIME_INCLUDE_H_ + +#include +#include "Utility.h" + + +namespace OOX +{ + class DateTime + { + public: + DateTime(); + explicit DateTime(const std::string& value); + explicit DateTime(const ::DateTime& dt); + + public: + const std::string ToString() const; + static const DateTime Parse(const std::string& value); + + public: + ::DateTime& datetime(); + const ::DateTime& datetime() const; + + private: + static const std::string s_pattern; + ::DateTime m_datetime; + }; +} // namespace OOX + +#endif // OOX_DATE_TIME_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Document.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Document.cpp new file mode 100644 index 0000000000..ad9c738931 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Document.cpp @@ -0,0 +1,321 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Document.h" +#include "FileTypes.h" +#include "Media/Image.h" +#include "Logic/Paragraph.h" +#include "Encoding.h" +#include "External/HyperLink.h" + + +namespace OOX +{ + + Document::Document() + { + } + + + Document::Document(const boost::filesystem::wpath& filename) + { + read(filename); + } + + + Document::~Document() + { + } + + + void Document::read(const boost::filesystem::wpath& filename) + { + IFileContainer::read(filename); + + const XML::XDocument document(filename); + const XML::XElement element = document.Root.element("body"); + SectorProperty = element.element("sectPr"); + Background = document.Root.element("background"); + + std::map ListsAndCounts; + ListsAndCounts.clear(); + for (XML::const_element_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + const XML::XElement element(*i); + if (element.XName == "p" || element.XName == "tbl" || element.XName == "sdt" || element.XName == "bookmarkStart" || element.XName == "bookmarkEnd") + { + Logic::TextItem text(*i); + if((text.is()) && (text.as().isInList())) + { + int listnum = text.as().GetListNum(); + if(ListsAndCounts.find(listnum) == ListsAndCounts.end()) + { + ListsAndCounts.insert(std::make_pair(listnum, 1)); + text.as().CountInList = 1; + } + else + { + ListsAndCounts[listnum]++; + text.as().CountInList = ListsAndCounts[listnum]; + } + } + else if(text.is()) + { + text.as().CountInList = 0; + } + Items->push_back(text); + } + } + } + + + void Document::write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const + { + XML::XElement(ns.w + "document", + XML::Write(Background) + + XML::XElement(ns.w + "body", + XML::Write(Items) + + XML::Write(SectorProperty) + ) + ).Save(filename); + + content.registration(type().OverrideType(), directory, filename); + IFileContainer::write(filename, directory, content); + } + + + const FileType Document::type() const + { + return FileTypes::Document; + } + + + const boost::filesystem::wpath Document::DefaultDirectory() const + { + return type().DefaultDirectory(); + } + + + const boost::filesystem::wpath Document::DefaultFileName() const + { + return type().DefaultFileName(); + } + + + void Document::addImage(const boost::filesystem::wpath& imagePath, const long width, const long height) + { + Image* image = new Image(imagePath); + const RId rId = add(boost::shared_ptr(image)); + Logic::Paragraph paragraph(rId, imagePath, width, height); + Items->push_back(paragraph); + } + + void Document::addImage(const boost::filesystem::wpath& imagePath, const long xEmu, const std::string& hRelativeFrom, const long yEmu , const std::string& vRelativeFrom, const long widthEmu, const long heightEmu) + { + Image* image = new Image(imagePath); + const RId rId = add(boost::shared_ptr(image)); + Logic::Paragraph paragraph(rId, imagePath, xEmu, hRelativeFrom, yEmu, vRelativeFrom, widthEmu, heightEmu); + Items->push_back(paragraph); + } + + void Document::addImageInBegin(const boost::filesystem::wpath& imagePath, const long width, const long height) + { + Items->clear(); + Image* image = new Image(imagePath); + const RId rId = add(boost::shared_ptr(image)); + Logic::Paragraph paragraph(rId, imagePath, width, height); + Items->push_back(paragraph); + } + + + void Document::addSpaceToLast(const int count) + { + if (!Items->empty() && Items->back().is()) + { + Items->back().as().AddSpace(count); + } + } + + + void Document::addPageBreak() + { + Logic::Paragraph paragraph; + paragraph.AddBreak("page"); + Items->push_back(paragraph); + } + + + void Document::addText(const std::wstring& text) + { + Logic::Paragraph paragraph; + paragraph.AddText(Encoding::unicode2utf8(text)); + Items->push_back(paragraph); + } + + + void Document::addText(const std::string& text) + { + Logic::Paragraph paragraph; + paragraph.AddText(text); + Items->push_back(paragraph); + } + + + void Document::addTextToLast(const std::wstring& text) + { + if (!Items->empty() && Items->back().is()) + { + Items->back().as().AddText(Encoding::unicode2utf8(text)); + } + } + + + void Document::addTextToLast(const std::string& text) + { + if (!Items->empty() && Items->back().is()) + { + Items->back().as().AddText(text); + } + } + + + void Document::addHyperlink(const std::wstring& nameHref, const std::wstring& text) + { + Logic::Paragraph paragraph; + boost::shared_ptr hyperlink = boost::shared_ptr(new OOX::HyperLink(nameHref)); + const OOX::RId rId = add(hyperlink); + paragraph.AddHyperlink(rId, Encoding::unicode2utf8(text)); + Items->push_back(paragraph); + } + + + void Document::addHyperlink(const std::string& nameHref, const std::string& text) + { + Logic::Paragraph paragraph; + boost::shared_ptr hyperlink = boost::shared_ptr(new OOX::HyperLink(Encoding::utf82unicode(nameHref))); + const OOX::RId rId = add(hyperlink); + paragraph.AddHyperlink(rId, text); + Items->push_back(paragraph); + } + + + void Document::addHyperlinkToLast(const std::wstring& nameHref, const std::wstring& text) + { + if (!Items->empty() && Items->back().is()) + { + boost::shared_ptr hyperlink = boost::shared_ptr(new OOX::HyperLink(nameHref)); + const OOX::RId rId = add(hyperlink); + Items->back().as().AddHyperlink(rId, Encoding::unicode2utf8(text)); + } + } + + + void Document::addHyperlinkToLast(const std::string& nameHref, const std::string& text) + { + if (!Items->empty() && Items->back().is()) + { + boost::shared_ptr hyperlink = boost::shared_ptr(new OOX::HyperLink(Encoding::utf82unicode(nameHref))); + const OOX::RId rId = add(hyperlink); + Items->back().as().AddHyperlink(rId, text); + } + } + + + void Document::Commit(const boost::filesystem::wpath& path) + { + std::string xmlString; + + if ( !boost::filesystem::exists(path) ) + { + XML::Private::XDeclaration xDeclaration; + Namespaces namespaces; + + xmlString = xDeclaration.ToString(); + + xmlString += "ToString() + " " ); + xmlString += ( namespaces.wp->ToString() + " " ); + xmlString += ( namespaces.a->ToString() + " " ); + xmlString += ( namespaces.pic->ToString() + " " ); + xmlString += ( namespaces.r->ToString() + " " ); + xmlString += ( namespaces.v->ToString() + " " ); + xmlString += namespaces.w10->ToString(); + + xmlString += ">"; + + if ( Background.is_init() ) + { + xmlString += XML::Write(Background).ToString(); + } + + xmlString += ""; + } + + xmlString += XML::Write(Items).ToString(); + + std::ofstream file(path.string().c_str(), std::ios_base::app); + + if (!file.bad()) + { + file <clear(); + } + } + + + void Document::Finalize(const boost::filesystem::wpath& path, const boost::filesystem::wpath& directory, ContentTypes::File& content) + { + std::string xmlString; + + if ( !boost::filesystem::exists(path) ) + { + XML::Private::XDeclaration xDeclaration; + Namespaces namespaces; + + xmlString = xDeclaration.ToString(); + + xmlString += "ToString() + " " ); + xmlString += ( namespaces.wp->ToString() + " " ); + xmlString += ( namespaces.a->ToString() + " " ); + xmlString += ( namespaces.pic->ToString() + " " ); + xmlString += ( namespaces.r->ToString() + " " ); + xmlString += ( namespaces.v->ToString() + " " ); + xmlString += namespaces.w10->ToString(); + + xmlString += ">"; + + if ( Background.is_init() ) + { + xmlString += XML::Write(Background).ToString(); + } + + xmlString += ""; + } + + xmlString += XML::Write(Items).ToString(); + xmlString += XML::Write(SectorProperty).ToString(); + xmlString += ( "" ); + xmlString += ( "" ); + + std::ofstream file(path.string().c_str(), std::ios_base::app); + + if (!file.bad()) + { + file <clear(); + } + + content.registration(type().OverrideType(), directory, path); + IFileContainer::Finalize(path, directory, content); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Document.h b/ASCOfficeOdtFile/Source/DocxFormat/Document.h new file mode 100644 index 0000000000..56a2104e8f --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Document.h @@ -0,0 +1,60 @@ +#pragma once +#ifndef OOX_DOCUMENT_FILE_INCLUDE_H_ +#define OOX_DOCUMENT_FILE_INCLUDE_H_ + +#include "File.h" +#include "IFileContainer.h" +#include "property.h" +#include "Logic/TextItem.h" +#include "Logic/SectorProperty.h" +#include "Logic/Background.h" +#include "IFileBuilder.h" + + +namespace OOX +{ + class Document : public OOX::File, public IFileContainer, public IFileBuilder + { + public: + Document(); + Document(const boost::filesystem::wpath& filename); + virtual ~Document(); + + public: + virtual void read(const boost::filesystem::wpath& filename); + virtual void write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const; + + public: + virtual const FileType type() const; + virtual const boost::filesystem::wpath DefaultDirectory() const; + virtual const boost::filesystem::wpath DefaultFileName() const; + + public: + virtual void Commit(const boost::filesystem::wpath& path); + virtual void Finalize(const boost::filesystem::wpath& path, const boost::filesystem::wpath& directory, ContentTypes::File& content); + + public: + void addImage(const boost::filesystem::wpath& imagePath, const long width, const long height); + void addImage(const boost::filesystem::wpath& imagePath, const long xEmu, const std::string& hRelativeFrom, const long yEmu , const std::string& vRelativeFrom, const long widthEmu, const long heightEmu); + void addImageInBegin(const boost::filesystem::wpath& imagePath, const long width, const long height); + void addSpaceToLast(const int count); + void addPageBreak(); + void addText(const std::wstring& text); + void addText(const std::string& text); + void addTextToLast(const std::wstring& text); + void addTextToLast(const std::string& text); + void addHyperlink(const std::wstring& nameHref, const std::wstring& text); + void addHyperlink(const std::string& nameHref, const std::string& text); + void addHyperlinkToLast(const std::wstring& nameHref, const std::wstring& text); + void addHyperlinkToLast(const std::string& nameHref, const std::string& text); + + public: + property SectorProperty; + property > Items; + nullable_property Background; + //private: + // std::map ListsAndCounts; + }; +} // namespace OOX + +#endif // OOX_DOCUMENT_FILE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Docx.h b/ASCOfficeOdtFile/Source/DocxFormat/Docx.h new file mode 100644 index 0000000000..bac04dc1fc --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Docx.h @@ -0,0 +1,49 @@ +#pragma once +#ifndef OOX_INCLUDE_H_ +#define OOX_INCLUDE_H_ + +#include "Folder.h" +#include "Logic\Table.h" +#include "Logic\Sdt.h" +#include "Logic\BookmarkStart.h" +#include "Logic\BookmarkEnd.h" +#include "Logic\List.h" +#include "Logic\Text.h" +#include "Logic\Symbol.h" +#include "Logic\Tab.h" +#include "Logic\Break.h" +#include "Logic\Pict.h" +#include "Logic\Drawing.h" +#include "Logic\Inline.h" +#include "Logic\FootnoteReference.h" +#include "Logic\EndnoteReference.h" +#include "Logic\FootnoteRef.h" +#include "Logic\EndnoteRef.h" +#include "Logic\Separator.h" +#include "Logic\ContinuationSeparator.h" +#include "Logic\FldChar.h" +#include "Logic\InstrText.h" +#include "Logic\DelText.h" +#include "Logic\NullRun.h" +#include "Logic\ColorsTable.h" + + +#include "FileTypes.h" +#include "App.h" +#include "Core.h" +#include "Document.h" +#include "FontTable.h" +#include "Numbering.h" +#include "Styles.h" +#include "Settings/File.h" +#include "FootNote.h" +#include "EndNote.h" +#include "WebSettings.h" +#include "External\HyperLink.h" +#include "Media\Image.h" +#include "Media\OleObject.h" +#include "Header.h" +#include "Footer.h" +#include "Theme/File.h" + +#endif // OOX_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/EndNote.cpp b/ASCOfficeOdtFile/Source/DocxFormat/EndNote.cpp new file mode 100644 index 0000000000..fbfba99ffd --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/EndNote.cpp @@ -0,0 +1,98 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "EndNote.h" +#include "Log.h" +#include +#include +#include "Exception/log_range_error.h" +#include "FileTypes.h" + + +namespace OOX +{ + + EndNote::EndNote() + { + } + + + EndNote::EndNote(const boost::filesystem::wpath& filename) + { + read(filename); + } + + + EndNote::~EndNote() + { + } + + + void EndNote::read(const boost::filesystem::wpath& filename) + { + IFileContainer::read(filename); + + const XML::XDocument document(filename); + XML::Fill(Notes, document.Root, "endnote"); + } + + + void EndNote::write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const + { + XML::XElement(ns.w + "endnotes", + XML::Write(Notes) + ).Save(filename); + + content.registration(type().OverrideType(), directory, filename); + IFileContainer::write(filename, directory, content); + } + + + const FileType EndNote::type() const + { + return FileTypes::EndNote; + } + + + const boost::filesystem::wpath EndNote::DefaultDirectory() const + { + return type().DefaultDirectory(); + } + + + const boost::filesystem::wpath EndNote::DefaultFileName() const + { + return type().DefaultFileName(); + } + + + const EndNote::Note EndNote::find(const Logic::EndnoteReference& reference) const + { + std::vector::const_iterator it = std::find_if(Notes->begin(), Notes->end(), + boost::bind(&Note::Id, _1) == *reference.Id); + if (it == Notes->end()) + throw log_range_error("endnote"); + return *it; + } + + + void EndNote::add(const EndNote::Note& endnote) + { + push_back(endnote); + } + + + void EndNote::push_back(const EndNote::Note& endnote) + { + Notes->push_back(endnote); + } + + + const size_t EndNote::size() const + { + return Notes->size(); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/EndNote.h b/ASCOfficeOdtFile/Source/DocxFormat/EndNote.h new file mode 100644 index 0000000000..a270b35d7d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/EndNote.h @@ -0,0 +1,67 @@ +#pragma once +#ifndef OOX_ENDNOTE_INCLUDE_H_ +#define OOX_ENDNOTE_INCLUDE_H_ + +#include "File.h" +#include "IFileContainer.h" +#include +#include "property.h" +#include "nullable_property.h" +#include "Logic/EndnoteReference.h" +#include "WritingElement.h" +#include "Logic/TextItem.h" +#include "Limit/SeparatorType.h" + + +namespace OOX +{ + class EndNote : public OOX::File, public IFileContainer + { + public: + class Note : public WritingElement + { + public: + Note(); + virtual ~Note(); + explicit Note(const XML::XNode& node); + const Note& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + void push_back(const OOX::Logic::Paragraph& paragraph); + + public: + nullable_property Type; + property Id; + property > Items; + }; + + public: + EndNote(); + EndNote(const boost::filesystem::wpath& filename); + virtual ~EndNote(); + + public: + virtual void read(const boost::filesystem::wpath& filename); + virtual void write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const; + + public: + virtual const FileType type() const; + virtual const boost::filesystem::wpath DefaultDirectory() const; + virtual const boost::filesystem::wpath DefaultFileName() const; + + public: + const EndNote::Note find(const Logic::EndnoteReference& reference) const; + void add(const EndNote::Note& endnote); + void push_back(const EndNote::Note& endnote); + const size_t size() const; + + public: + property > Notes; + }; +} // namespace OOX + +#endif // OOX_ENDNOTE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/EndNote/Note.cpp b/ASCOfficeOdtFile/Source/DocxFormat/EndNote/Note.cpp new file mode 100644 index 0000000000..0eb0f12db9 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/EndNote/Note.cpp @@ -0,0 +1,60 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "./../EndNote.h" + + +namespace OOX +{ + + EndNote::Note::Note() + { + } + + + EndNote::Note::~Note() + { + } + + + EndNote::Note::Note(const XML::XNode& node) + { + fromXML(node); + } + + + const EndNote::Note& EndNote::Note::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void EndNote::Note::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Type = element.attribute("type").value(); + Id = element.attribute("id").value(); + XML::Fill(Items, element , "p", "tbl"); + } + + + const XML::XNode EndNote::Note::toXML() const + { + return + XML::XElement(ns.w + "endnote", + XML::XAttribute(ns.w + "type", Type) + + XML::XAttribute(ns.w + "id", Id) + + XML::Write(Items) + ); + } + + + void EndNote::Note::push_back(const OOX::Logic::Paragraph& paragraph) + { + Items->push_back(paragraph); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/External/External.cpp b/ASCOfficeOdtFile/Source/DocxFormat/External/External.cpp new file mode 100644 index 0000000000..58fc2120c3 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/External/External.cpp @@ -0,0 +1,45 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "External.h" +#include "../FileTypes.h" + + +namespace OOX +{ + + External::External() + { + } + + + External::External(const boost::filesystem::wpath& uri) + { + read(uri); + } + + + External::~External() + { + } + + + void External::read(const boost::filesystem::wpath& uri) + { + m_uri = uri; + } + + + void External::write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const + { + } + + + const boost::filesystem::wpath External::Uri() const + { + return m_uri; + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/External/External.h b/ASCOfficeOdtFile/Source/DocxFormat/External/External.h new file mode 100644 index 0000000000..0182cc20b3 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/External/External.h @@ -0,0 +1,29 @@ +#pragma once +#ifndef OOX_EXTERNAL_INCLUDE_H_ +#define OOX_EXTERNAL_INCLUDE_H_ + +#include "..\File.h" + + +namespace OOX +{ + class External : public File + { + public: + External(); + External(const boost::filesystem::wpath& uri); + ~External(); + + public: + virtual void read(const boost::filesystem::wpath& uri); + virtual void write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const; + + public: + const boost::filesystem::wpath Uri() const; + + protected: + boost::filesystem::wpath m_uri; + }; +} // namespace OOX + +#endif // OOX_EXTERNAL_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/External/ExternalAudio.cpp b/ASCOfficeOdtFile/Source/DocxFormat/External/ExternalAudio.cpp new file mode 100644 index 0000000000..5ed9ef0cef --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/External/ExternalAudio.cpp @@ -0,0 +1,46 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ExternalAudio.h" +#include "..\FileTypes.h" + + +namespace OOX +{ + + ExternalAudio::ExternalAudio() + { + } + + + ExternalAudio::ExternalAudio(const boost::filesystem::wpath& uri) + { + read(uri); + } + + + ExternalAudio::~ExternalAudio() + { + } + + + const FileType ExternalAudio::type() const + { + return FileTypes::ExternalAudio; + } + + + const boost::filesystem::wpath ExternalAudio::DefaultDirectory() const + { + return type().DefaultDirectory(); + } + + + const boost::filesystem::wpath ExternalAudio::DefaultFileName() const + { + return type().DefaultFileName(); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/External/ExternalAudio.h b/ASCOfficeOdtFile/Source/DocxFormat/External/ExternalAudio.h new file mode 100644 index 0000000000..10409a8b95 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/External/ExternalAudio.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_EXTERNALAUDIO_INCLUDE_H_ +#define OOX_EXTERNALAUDIO_INCLUDE_H_ + +#include "External.h" + + +namespace OOX +{ + class ExternalAudio : public External + { + public: + ExternalAudio(); + ExternalAudio(const boost::filesystem::wpath& uri); + ~ExternalAudio(); + + public: + virtual const FileType type() const; + virtual const boost::filesystem::wpath DefaultDirectory() const; + virtual const boost::filesystem::wpath DefaultFileName() const; + }; +} // namespace OOX + +#endif // OOX_EXTERNALAUDIO_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/External/ExternalImage.cpp b/ASCOfficeOdtFile/Source/DocxFormat/External/ExternalImage.cpp new file mode 100644 index 0000000000..8e0ad80dfb --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/External/ExternalImage.cpp @@ -0,0 +1,46 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ExternalImage.h" +#include "..\FileTypes.h" + + +namespace OOX +{ + + ExternalImage::ExternalImage() + { + } + + + ExternalImage::ExternalImage(const boost::filesystem::wpath& uri) + { + read(uri); + } + + + ExternalImage::~ExternalImage() + { + } + + + const FileType ExternalImage::type() const + { + return FileTypes::ExternalImage; + } + + + const boost::filesystem::wpath ExternalImage::DefaultDirectory() const + { + return type().DefaultDirectory(); + } + + + const boost::filesystem::wpath ExternalImage::DefaultFileName() const + { + return type().DefaultFileName(); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/External/ExternalImage.h b/ASCOfficeOdtFile/Source/DocxFormat/External/ExternalImage.h new file mode 100644 index 0000000000..d2fa2e8e47 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/External/ExternalImage.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_EXTERNALIMAGE_INCLUDE_H_ +#define OOX_EXTERNALIMAGE_INCLUDE_H_ + +#include "External.h" + + +namespace OOX +{ + class ExternalImage : public External + { + public: + ExternalImage(); + ExternalImage(const boost::filesystem::wpath& uri); + ~ExternalImage(); + + public: + virtual const FileType type() const; + virtual const boost::filesystem::wpath DefaultDirectory() const; + virtual const boost::filesystem::wpath DefaultFileName() const; + }; +} // namespace OOX + +#endif // OOX_EXTERNALIMAGE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/External/ExternalVideo.cpp b/ASCOfficeOdtFile/Source/DocxFormat/External/ExternalVideo.cpp new file mode 100644 index 0000000000..90f6f5ff94 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/External/ExternalVideo.cpp @@ -0,0 +1,46 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ExternalVideo.h" +#include "..\FileTypes.h" + + +namespace OOX +{ + + ExternalVideo::ExternalVideo() + { + } + + + ExternalVideo::ExternalVideo(const boost::filesystem::wpath& uri) + { + read(uri); + } + + + ExternalVideo::~ExternalVideo() + { + } + + + const FileType ExternalVideo::type() const + { + return FileTypes::ExternalVideo; + } + + + const boost::filesystem::wpath ExternalVideo::DefaultDirectory() const + { + return type().DefaultDirectory(); + } + + + const boost::filesystem::wpath ExternalVideo::DefaultFileName() const + { + return type().DefaultFileName(); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/External/ExternalVideo.h b/ASCOfficeOdtFile/Source/DocxFormat/External/ExternalVideo.h new file mode 100644 index 0000000000..b5ffb5e9fa --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/External/ExternalVideo.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_EXTERNALVIDEO_INCLUDE_H_ +#define OOX_EXTERNALVIDEO_INCLUDE_H_ + +#include "External.h" + + +namespace OOX +{ + class ExternalVideo : public External + { + public: + ExternalVideo(); + ExternalVideo(const boost::filesystem::wpath& uri); + ~ExternalVideo(); + + public: + virtual const FileType type() const; + virtual const boost::filesystem::wpath DefaultDirectory() const; + virtual const boost::filesystem::wpath DefaultFileName() const; + }; +} // namespace OOX + +#endif // OOX_EXTERNALVIDEO_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/External/HyperLink.cpp b/ASCOfficeOdtFile/Source/DocxFormat/External/HyperLink.cpp new file mode 100644 index 0000000000..89ff533b4a --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/External/HyperLink.cpp @@ -0,0 +1,46 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "HyperLink.h" +#include "..\FileTypes.h" + + +namespace OOX +{ + + HyperLink::HyperLink() + { + } + + + HyperLink::HyperLink(const boost::filesystem::wpath& uri) + { + read(uri); + } + + + HyperLink::~HyperLink() + { + } + + + const FileType HyperLink::type() const + { + return FileTypes::HyperLink; + } + + + const boost::filesystem::wpath HyperLink::DefaultDirectory() const + { + return type().DefaultDirectory(); + } + + + const boost::filesystem::wpath HyperLink::DefaultFileName() const + { + return type().DefaultFileName(); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/External/HyperLink.h b/ASCOfficeOdtFile/Source/DocxFormat/External/HyperLink.h new file mode 100644 index 0000000000..69762ba8b3 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/External/HyperLink.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_HYPERLINK_INCLUDE_H_ +#define OOX_HYPERLINK_INCLUDE_H_ + +#include "External.h" + + +namespace OOX +{ + class HyperLink : public External + { + public: + HyperLink(); + HyperLink(const boost::filesystem::wpath& uri); + ~HyperLink(); + + public: + virtual const FileType type() const; + virtual const boost::filesystem::wpath DefaultDirectory() const; + virtual const boost::filesystem::wpath DefaultFileName() const; + }; +} // namespace OOX + +#endif // OOX_HYPERLINK_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/File.cpp b/ASCOfficeOdtFile/Source/DocxFormat/File.cpp new file mode 100644 index 0000000000..dc4cd2a919 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/File.cpp @@ -0,0 +1,21 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "File.h" + + +namespace OOX +{ + + File::File() + { + } + + + File::~File() + { + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/File.h b/ASCOfficeOdtFile/Source/DocxFormat/File.h new file mode 100644 index 0000000000..2a09b53c3d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/File.h @@ -0,0 +1,31 @@ +#pragma once +#ifndef OOX_FILE_INCLUDE_H_ +#define OOX_FILE_INCLUDE_H_ + +#include "NamespaceOwn.h" +#include +#include +#include "ContentTypes/File.h" +#include "FileType.h" + + +namespace OOX +{ + class File : public NamespaceOwn + { + public: + File(); + virtual ~File(); + + public: + virtual void read(const boost::filesystem::wpath& filename) = 0; + virtual void write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const = 0; + + public: + virtual const OOX::FileType type() const = 0; + virtual const boost::filesystem::wpath DefaultDirectory() const = 0; + virtual const boost::filesystem::wpath DefaultFileName() const = 0; + }; +} // namespace OOX + +#endif // OOX_FILE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/FileFactory.cpp b/ASCOfficeOdtFile/Source/DocxFormat/FileFactory.cpp new file mode 100644 index 0000000000..1c23710edd --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/FileFactory.cpp @@ -0,0 +1,90 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "FileFactory.h" +#include "File.h" +#include "FileTypes.h" +#include "Rels/RelationShip.h" +#include "App.h" +#include "Core.h" +#include "Document.h" +#include "Theme/File.h" +#include "Settings/File.h" +#include "FontTable.h" +#include "Styles.h" +#include "Item.h" +#include "FootNote.h" +#include "EndNote.h" +#include "WebSettings.h" +#include "Media\Image.h" +#include "Media\OleObject.h" +#include "Media\Audio.h" +#include "Media\Video.h" +#include "External\HyperLink.h" +#include "External\ExternalVideo.h" +#include "External\ExternalAudio.h" +#include "External\ExternalImage.h" +#include "Header.h" +#include "Footer.h" +#include "Numbering.h" +#include "UnknowTypeFile.h" + + +namespace OOX +{ + + const boost::shared_ptr CreateFile(const boost::filesystem::wpath& path, const Rels::RelationShip& relation) + { + boost::filesystem::wpath filename = path / relation.filename(); + + if (relation.type() == FileTypes::App) + return boost::shared_ptr(new App(filename)); + else if (relation.type() == FileTypes::Core) + return boost::shared_ptr(new Core(filename)); + else if (relation.type() == FileTypes::Document) + return boost::shared_ptr(new Document(filename)); + else if (relation.type() == FileTypes::Theme) + return boost::shared_ptr(new Theme::File(filename)); + else if (relation.type() == FileTypes::Setting) + return boost::shared_ptr(new Settings::File(filename)); + else if (relation.type() == FileTypes::FontTable) + return boost::shared_ptr(new FontTable(filename)); + else if (relation.type() == FileTypes::Style) + return boost::shared_ptr(new Styles(filename)); + //else if (relation.type() == FileTypes::Item) // TODO : ïàäåíèå ïàðñåðà - èñïðàâèòü + // return boost::shared_ptr(new Item(filename)); + else if (relation.type() == FileTypes::FootNote) + return boost::shared_ptr(new FootNote(filename)); + else if (relation.type() == FileTypes::EndNote) + return boost::shared_ptr(new EndNote(filename)); + else if (relation.type() == FileTypes::WebSetting) + return boost::shared_ptr(new WebSettings(filename)); + else if (relation.type() == FileTypes::HyperLink) + return boost::shared_ptr(new HyperLink(relation.target())); + else if ((relation.type() == FileTypes::ExternalVideo) && (relation.isExternal())) + return boost::shared_ptr(new ExternalVideo(relation.target())); + else if ((relation.type() == FileTypes::ExternalAudio) && (relation.isExternal())) + return boost::shared_ptr(new ExternalAudio(relation.target())); + else if ((relation.type() == FileTypes::ExternalImage) && (relation.isExternal())) + return boost::shared_ptr(new ExternalImage(relation.target())); + else if (relation.type() == FileTypes::Image) + return boost::shared_ptr(new Image(filename)); + else if (relation.type() == FileTypes::OleObject) + return boost::shared_ptr(new OleObject(filename)); + else if (relation.type() == FileTypes::Audio) + return boost::shared_ptr(new Audio(filename)); + else if (relation.type() == FileTypes::Video) + return boost::shared_ptr(new Video(filename)); + else if (relation.type() == FileTypes::Numbering) + return boost::shared_ptr(new Numbering(filename)); + else if (relation.type() == FileTypes::Header) + return boost::shared_ptr(new Header(filename)); + else if (relation.type() == FileTypes::Footer) + return boost::shared_ptr(new Footer(filename)); + + return boost::shared_ptr(new UnknowTypeFile()); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/FileFactory.h b/ASCOfficeOdtFile/Source/DocxFormat/FileFactory.h new file mode 100644 index 0000000000..80a21cc072 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/FileFactory.h @@ -0,0 +1,17 @@ +#pragma once +#ifndef OOX_FILE_FACTORY_INCLUDE_H_ +#define OOX_FILE_FACTORY_INCLUDE_H_ + +#include +#include + + +namespace OOX +{ + class File; + namespace Rels {class RelationShip;} + + const boost::shared_ptr CreateFile(const boost::filesystem::wpath& path, const Rels::RelationShip& relation); +} // namespace OOX + +#endif // OOX_FILE_FACTORY_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/FileType.cpp b/ASCOfficeOdtFile/Source/DocxFormat/FileType.cpp new file mode 100644 index 0000000000..a59c4d0188 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/FileType.cpp @@ -0,0 +1,71 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "FileType.h" + + +namespace OOX +{ + + FileType::FileType( const boost::filesystem::wpath& defaultDirectory, + const boost::filesystem::wpath& defaultFileName, + const std::string& overrideType, + const std::string& relationType) + : m_defaultDirectory(defaultDirectory), + m_defaultFileName(defaultFileName), + m_overrideType(overrideType), + m_relationType(relationType) + { + } + + + FileType::~FileType() + { + } + + + const bool FileType::operator ==(const FileType& rhs) const + { + return m_relationType == rhs.m_relationType; + + } + + + const std::string FileType::OverrideType() const + { + return m_overrideType; + } + + + const std::string FileType::RelationType() const + { + return m_relationType; + } + + + const boost::filesystem::wpath FileType::DefaultDirectory() const + { + return m_defaultDirectory; + } + + + const boost::filesystem::wpath FileType::DefaultFileName() const + { + return m_defaultFileName; + } + + + const bool operator ==(const std::string& type, const FileType& file) + { + return type == file.RelationType(); + } + + + const bool operator ==(const FileType& file, const std::string& type) + { + return file.RelationType() == type; + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/FileType.h b/ASCOfficeOdtFile/Source/DocxFormat/FileType.h new file mode 100644 index 0000000000..cde41a6a0b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/FileType.h @@ -0,0 +1,40 @@ +#pragma once +#ifndef OOX_FILE_TYPE_INCLUDE_H_ +#define OOX_FILE_TYPE_INCLUDE_H_ + +#include +#include + + +namespace OOX +{ + class FileType + { + public: + FileType( const boost::filesystem::wpath& defaultDirectory, + const boost::filesystem::wpath& defaultFileName, + const std::string& overrideType, + const std::string& relationType); + ~FileType(); + + public: + const bool operator ==(const FileType& rhs) const; + + public: + const std::string OverrideType() const; + const std::string RelationType() const; + const boost::filesystem::wpath DefaultDirectory() const; + const boost::filesystem::wpath DefaultFileName() const; + + private: + std::string m_overrideType; + std::string m_relationType; + boost::filesystem::wpath m_defaultDirectory; + boost::filesystem::wpath m_defaultFileName; + }; + + const bool operator ==(const std::string& type, const FileType& file); + const bool operator ==(const FileType& file, const std::string& type); +} // namespace OOX + +#endif // OOX_FILE_TYPE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/FileTypes.h b/ASCOfficeOdtFile/Source/DocxFormat/FileTypes.h new file mode 100644 index 0000000000..c2cdd4d998 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/FileTypes.h @@ -0,0 +1,238 @@ +#pragma once +#ifndef OOX_FILE_TYPES_INCLUDE_H_ +#define OOX_FILE_TYPES_INCLUDE_H_ + +#include "FileType.h" + + +namespace OOX +{ + namespace FileTypes + { + const FileType App(L"docProps", L"app.xml", + "application/vnd.openxmlformats-officedocument.extended-properties+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties"); + + const FileType Core(L"docProps", L"core.xml", + "application/vnd.openxmlformats-package.core-properties+xml", + "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties"); + + const FileType Document(L"word", L"document.xml", + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"); + + const FileType Theme(L"theme", L"theme.xml", + "application/vnd.openxmlformats-officedocument.theme+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"); + + const FileType Setting(L"", L"settings.xml", + "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings"); + + const FileType FontTable(L"", L"fontTable.xml", + "application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable"); + + const FileType Style(L"", L"styles.xml", + "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"); + + const FileType Item(L"customXml", L"item.xml", + "WARNING not implement", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml"); + + const FileType FootNote(L"", L"footnotes.xml", + "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes"); + + const FileType EndNote(L"", L"endnotes.xml", + "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes"); + + const FileType WebSetting(L"", L"webSettings.xml", + "application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings"); + + const FileType Header(L"", L"header.xml", + "application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header"); + + const FileType Footer(L"", L"footer.xml", + "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer"); + + const FileType Numbering(L"", L"numbering.xml", + "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering"); + + const FileType ItemProp(L"customXml", L"itemProps.xml", + "application/vnd.openxmlformats-officedocument.customXmlProperties+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps"); + + const FileType HyperLink(L"", L"", + "", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink"); + + const FileType ExternalImage(L"", L"", + "", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"); + + const FileType ExternalAudio(L"", L"", + "", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/audio"); + + const FileType ExternalVideo(L"", L"", + "", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/video"); + + const FileType Image(L"media", L"image", + "", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"); + + const FileType Audio(L"media", L"audio", + "", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/audio"); + + const FileType Video(L"media", L"video", + "", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/video"); + + const FileType Data(L"diagrams", L"data.xml", + "application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramData"); + + const FileType Layout(L"diagrams", L"layout.xml", + "application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramLayout"); + + const FileType Colors(L"diagrams", L"colors.xml", + "application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramColors"); + + const FileType QuickStyle(L"diagrams", L"quickStyle.xml", + "application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramQuickStyle"); + + const FileType Chart(L"charts", L"chart.xml", + "application/vnd.openxmlformats-officedocument.drawingml.chart+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart"); + + + const FileType MicrosoftOfficeExcelWorksheet(L"embeddings", L"Microsoft_Office_Excel_Worksheet.xlsx", + "", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); + + const FileType MicrosoftOfficeExcel_97_2003_Worksheet(L"embeddings", L"Microsoft_Office_Excel_97-2003_Worksheet.xls", + "", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"); + + const FileType MicrosoftOfficeExcelBinaryWorksheet(L"embeddings", L"Microsoft_Office_Excel_Binary_Worksheet.xlsb", + "", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); + + const FileType MicrosoftOfficeExcelMacro_EnabledWorksheet(L"embeddings", L"Microsoft_Office_Excel_Macro-Enabled_Worksheet.xlsm", + "", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); + + const FileType MicrosoftOfficeExcelChart(L"embeddings", L"Microsoft_Office_Excel_Chart.xlsx", + "", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"); + + + const FileType MicrosoftOfficeWordDocument(L"embeddings", L"Microsoft_Office_Word_Document.docx", + "", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); + + const FileType MicrosoftOfficeWord_97_2003_Document(L"embeddings", L"Microsoft_Office_Word_97_-_2003_Document.doc", + "", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"); + + const FileType MicrosoftOfficeWordMacro_EnabledDocument(L"embeddings", L"Microsoft_Office_Word_Macro-Enabled_Document.docm", + "", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); + + + const FileType MicrosoftOfficePowerPointPresentation(L"embeddings", L"Microsoft_Office_PowerPoint_Presentation.pptx", + "", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); + + const FileType MicrosoftOfficePowerPoint_97_2003_Presentation(L"embeddings", L"Microsoft_Office_PowerPoint_97-2003_Presentation.xlsx", + "", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"); + + const FileType MicrosoftOfficePowerPointMacro_EnabledPresentation(L"embeddings", L"Microsoft_Office_PowerPoint_Macro-Enabled_Presentation.pptm", + "", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); + + + const FileType MicrosoftOfficePowerPointSlide(L"embeddings", L"Microsoft_Office_PowerPoint_Slide.sldx", + "", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); + + const FileType MicrosoftOfficePowerPointMacro_EnabledSlide(L"embeddings", L"Microsoft_Office_PowerPoint_Macro-Enabled_Slide.sldm", + "", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"); + + + const FileType OleObject(L"embeddings", L"oleObject.bin", + "", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"); + + const FileType Glossary(L"glossary", L"document.xml", + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/glossaryDocument"); + + const FileType Slide(L"", L"slide.xml", + "application/vnd.openxmlformats-officedocument.presentationml.slide+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide"); + + const FileType SlideLayout(L"", L"slideLayout.xml", + "application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout"); + + const FileType SlideMaster(L"", L"slideMaster.xml", + "application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster"); + + const FileType NotesSlide(L"", L"notesSlide.xml", + "application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide"); + + const FileType NotesMaster(L"", L"notesMaster.xml", + "application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster"); + + const FileType HandoutMaster(L"", L"handoutMaster.xml", + "application/vnd.openxmlformats-officedocument.presentationml.handoutMaster+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/handoutMaster"); + + const FileType Presentation(L"ppt", L"presentation.xml", + "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"); + + const FileType PresProps(L"", L"presProps.xml", + "application/vnd.openxmlformats-officedocument.presentationml.presProps+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps"); + + const FileType TableStyles(L"", L"tableStyles.xml", + "application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles"); + + const FileType ViewProps(L"", L"viewProps.xml", + "application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps"); + + const FileType ThemePPTX(L"", L"theme.xml", + "application/vnd.openxmlformats-officedocument.theme+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"); + + const FileType VmlDrawing(L"", L"vmlDrawing.vml", + "", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing"); + + const FileType Unknow(L"", L"", "", ""); + + } // namespace FileTypes +} // namespace OOX + +#endif // OOX_FILE_TYPES_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Folder.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Folder.cpp new file mode 100644 index 0000000000..8e9979dbb1 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Folder.cpp @@ -0,0 +1,214 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Folder.h" +#include "Rels/File.h" +#include "Document.h" + + +namespace Docx +{ + + Folder::Folder() + { + } + + + Folder::Folder(const boost::filesystem::wpath& path) + { + read(path); + } + + + void Folder::read(const boost::filesystem::wpath& path) + { + OOX::Rels::File rels(path / L"/"); + IFileContainer::read(rels, path); + } + + + void Folder::write(const boost::filesystem::wpath& path) const + { + boost::filesystem::create_directories(path); + + OOX::Rels::File rels; + OOX::ContentTypes::File content; + + IFileContainer::write(rels, path, L"", content); + + rels.write(path / L"/"); + content.write(path); + } + + + void Folder::createFromTemplate(const boost::filesystem::wpath& path) + { + read(path); + } + + + void Folder::Commit(const boost::filesystem::wpath& path) + { + boost::filesystem::create_directories(path); + + IFileContainer::Commit(path); + } + + + void Folder::Finalize(const boost::filesystem::wpath& path) + { + boost::filesystem::create_directories(path); + + OOX::Rels::File rels; + OOX::ContentTypes::File content; + + IFileContainer::Finalize(rels, path, L"", content); + + rels.write(path / L"/"); + content.write(path); + } + + + const bool Folder::isValid(const boost::filesystem::wpath& path) const + { + return true; + } + + + void Folder::extractPictures(const boost::filesystem::wpath& path) + { + boost::filesystem::create_directories(path); + OOX::IFileContainer::extractPictures(path); + } + + + void Folder::extractPictures(const boost::filesystem::wpath& source, const boost::filesystem::wpath& path) + { + read(source); + extractPictures(path); + } + + + void Folder::addImage(const boost::filesystem::wpath& imagePath, const long width, const long height) + { + if (exist()) + { + OOX::Document& document = find(); + document.addImage(imagePath, width, height); + } + } + + + void Folder::addImageInBegin(const boost::filesystem::wpath& imagePath, const long width, const long height) + { + if (exist()) + { + OOX::Document& document = find(); + document.addImageInBegin(imagePath, width, height); + } + } + + + void Folder::addSpaceToLast(const int count) + { + if (exist()) + { + OOX::Document& document = find(); + document.addSpaceToLast(count); + } + } + + + void Folder::addPageBreak() + { + if (exist()) + { + OOX::Document& document = find(); + document.addPageBreak(); + } + } + + + + void Folder::addText(const std::wstring& text) + { + if (exist()) + { + OOX::Document& document = find(); + document.addText(text); + } + } + + + void Folder::addText(const std::string& text) + { + if (exist()) + { + OOX::Document& document = find(); + document.addText(text); + } + } + + + void Folder::addTextToLast(const std::wstring& text) + { + if (exist()) + { + OOX::Document& document = find(); + document.addTextToLast(text); + } + } + + + void Folder::addTextToLast(const std::string& text) + { + if (exist()) + { + OOX::Document& document = find(); + document.addTextToLast(text); + } + } + + + void Folder::addHyperlink(const std::wstring& nameHref, const std::wstring& text) + { + if (exist()) + { + OOX::Document& document = find(); + document.addHyperlink(nameHref, text); + } + } + + + void Folder::addHyperlink(const std::string& nameHref, const std::string& text) + { + if (exist()) + { + OOX::Document& document = find(); + document.addHyperlink(nameHref, text); + } + } + + + void Folder::addHyperlinkToLast(const std::wstring& nameHref, const std::wstring& text) + { + if (exist()) + { + OOX::Document& document = find(); + document.addHyperlinkToLast(nameHref, text); + } + } + + + void Folder::addHyperlinkToLast(const std::string& nameHref, const std::string& text) + { + if (exist()) + { + OOX::Document& document = find(); + document.addHyperlinkToLast(nameHref, text); + } + } + +} // namespace Docx \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Folder.h b/ASCOfficeOdtFile/Source/DocxFormat/Folder.h new file mode 100644 index 0000000000..ce0ff1607d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Folder.h @@ -0,0 +1,49 @@ +#pragma once +#ifndef DOCX_FOLDER_INCLUDE_H_ +#define DOCX_FOLDER_INCLUDE_H_ + +#include "IFileContainer.h" +#include "RId.h" + + +namespace Docx +{ + class Folder : public OOX::IFileContainer + { + public: + Folder(); + Folder(const boost::filesystem::wpath& path); + + public: + void read(const boost::filesystem::wpath& path); + void write(const boost::filesystem::wpath& path) const; + void createFromTemplate(const boost::filesystem::wpath& path); + + public: + void Commit(const boost::filesystem::wpath& path); + void Finalize(const boost::filesystem::wpath& path); + + public: + const bool isValid(const boost::filesystem::wpath& path) const; + + public: + void extractPictures(const boost::filesystem::wpath& path); + void extractPictures(const boost::filesystem::wpath& source, const boost::filesystem::wpath& path); + + public: + void addImage(const boost::filesystem::wpath& imagePath, const long width, const long height); + void addImageInBegin(const boost::filesystem::wpath& imagePath, const long width, const long height); + void addSpaceToLast(const int count); + void addPageBreak(); + void addText(const std::wstring& text); + void addText(const std::string& text); + void addTextToLast(const std::wstring& text); + void addTextToLast(const std::string& text); + void addHyperlink(const std::wstring& nameHref, const std::wstring& text); + void addHyperlink(const std::string& nameHref, const std::string& text); + void addHyperlinkToLast(const std::wstring& nameHref, const std::wstring& text); + void addHyperlinkToLast(const std::string& nameHref, const std::string& text); + }; +} // namespace Docx + +#endif //Docx_FOLDER_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/FontTable.cpp b/ASCOfficeOdtFile/Source/DocxFormat/FontTable.cpp new file mode 100644 index 0000000000..d250bb8d53 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/FontTable.cpp @@ -0,0 +1,53 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "FontTable.h" +#include "FileTypes.h" + +namespace OOX +{ + FontTable::FontTable() + { + + } + + FontTable::FontTable(const boost::filesystem::wpath& filename) + { + read(filename); + } + + FontTable::~FontTable() + { + + } + + void FontTable::read(const boost::filesystem::wpath& filename) + { + const XML::XDocument document(filename); + XML::Fill(Fonts, document.Root); + } + + void FontTable::write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const + { + XML::XElement(ns.w + "fonts", XML::Write(Fonts)).Save(filename); + content.registration(type().OverrideType(), directory, filename); + } + + const FileType FontTable::type() const + { + return FileTypes::FontTable; + } + + const boost::filesystem::wpath FontTable::DefaultDirectory() const + { + return type().DefaultDirectory(); + } + + const boost::filesystem::wpath FontTable::DefaultFileName() const + { + return type().DefaultFileName(); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/FontTable.h b/ASCOfficeOdtFile/Source/DocxFormat/FontTable.h new file mode 100644 index 0000000000..87d3c10a93 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/FontTable.h @@ -0,0 +1,65 @@ +#pragma once +#ifndef OOX_FONTTABLE_INCLUDE_H_ +#define OOX_FONTTABLE_INCLUDE_H_ + +#include "File.h" +#include +#include "property.h" +#include "nullable_property.h" +#include "Limit/FontName.h" +#include "Limit/FontFamily.h" +#include "Limit/FontCharset.h" +#include "Limit/FontPitch.h" + +namespace OOX +{ + class FontTable : public OOX::File + { + public: + class Font : public WritingElement + { + public: + Font(); + virtual ~Font(); + explicit Font(const XML::XNode& node); + const Font& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Name; + property Family; + nullable_property Charset; + property Pitch; + nullable_property Panose1; + nullable_property Usb0; + nullable_property Usb1; + nullable_property Usb2; + nullable_property Usb3; + nullable_property Csb0; + nullable_property Csb1; + }; + + public: + + FontTable(); + FontTable(const boost::filesystem::wpath& filename); + virtual ~FontTable(); + + public: + virtual void read(const boost::filesystem::wpath& filename); + virtual void write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const; + + public: + virtual const FileType type() const; + virtual const boost::filesystem::wpath DefaultDirectory() const; + virtual const boost::filesystem::wpath DefaultFileName() const; + + public: + property > Fonts; + }; +} // namespace OOX + +#endif // OOX_FONTTABLE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/FontTable/Font.cpp b/ASCOfficeOdtFile/Source/DocxFormat/FontTable/Font.cpp new file mode 100644 index 0000000000..65559e1825 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/FontTable/Font.cpp @@ -0,0 +1,73 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "./../FontTable.h" + + +namespace OOX +{ + + FontTable::Font::Font() + { + } + + + FontTable::Font::~Font() + { + } + + + FontTable::Font::Font(const XML::XNode& node) + { + fromXML(node); + } + + + const FontTable::Font& FontTable::Font::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void FontTable::Font::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Name = element.attribute("name").value(); + Panose1 = element.element("panose1").attribute("val").value(); + Charset = element.element("charset").attribute("val").value(); + Family = element.element("family").attribute("val").value(); + Pitch = element.element("pitch").attribute("val").value(); + Usb0 = element.element("sig").attribute("usb0").value(); + Usb1 = element.element("sig").attribute("usb1").value(); + Usb2 = element.element("sig").attribute("usb2").value(); + Usb3 = element.element("sig").attribute("usb3").value(); + Csb0 = element.element("sig").attribute("csb0").value(); + Csb1 = element.element("sig").attribute("csb1").value(); + } + + + const XML::XNode FontTable::Font::toXML() const + { + return + XML::XElement(ns.w + "font", + XML::XAttribute(ns.w + "name", Name) + + XML::XElement(ns.w + "panose1", XML::XAttribute(ns.w + "val", Panose1)) + + XML::XElement(ns.w + "charset", XML::XAttribute(ns.w + "val", Charset)) + + XML::XElement(ns.w + "family", XML::XAttribute(ns.w + "val", Family)) + + XML::XElement(ns.w + "pitch", XML::XAttribute(ns.w + "val", Pitch)) + + WriteIf(XML::XElement(ns.w + "sig", + XML::XAttribute(ns.w + "usb0", Usb0)+ + XML::XAttribute(ns.w + "usb1", Usb1) + + XML::XAttribute(ns.w + "usb2", Usb2) + + XML::XAttribute(ns.w + "usb3", Usb3) + + XML::XAttribute(ns.w + "csb0", Csb0) + + XML::XAttribute(ns.w + "csb1", Csb1)), + ((Usb0.is_init()) || (Usb1.is_init()) || (Usb2.is_init()) || (Usb3.is_init()) || (Csb0.is_init()) || (Csb1.is_init())) + ) + ); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/FootNote.cpp b/ASCOfficeOdtFile/Source/DocxFormat/FootNote.cpp new file mode 100644 index 0000000000..a1dbdb2f8a --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/FootNote.cpp @@ -0,0 +1,98 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "FootNote.h" +#include "Log.h" +#include +#include +#include "Exception/log_range_error.h" +#include "FileTypes.h" + + +namespace OOX +{ + + FootNote::FootNote() + { + } + + + FootNote::FootNote(const boost::filesystem::wpath& filename) + { + read(filename); + } + + + FootNote::~FootNote() + { + } + + + void FootNote::read(const boost::filesystem::wpath& filename) + { + IFileContainer::read(filename); + + const XML::XDocument document(filename); + XML::Fill(Notes, document.Root, "footnote"); + } + + + void FootNote::write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const + { + XML::XElement(ns.w + "footnotes", + XML::Write(Notes) + ).Save(filename); + + content.registration(type().OverrideType(), directory, filename); + IFileContainer::write(filename, directory, content); + } + + + const FileType FootNote::type() const + { + return FileTypes::FootNote; + } + + + const boost::filesystem::wpath FootNote::DefaultDirectory() const + { + return type().DefaultDirectory(); + } + + + const boost::filesystem::wpath FootNote::DefaultFileName() const + { + return type().DefaultFileName(); + } + + + const FootNote::Note FootNote::find(const Logic::FootnoteReference& reference) const + { + std::vector::const_iterator it = std::find_if(Notes->begin(), Notes->end(), + boost::bind(&Note::Id, _1) == *reference.Id); + if (it == Notes->end()) + throw log_range_error("footnote"); + return *it; + } + + + void FootNote::add(const FootNote::Note& footnote) + { + push_back(footnote); + } + + + void FootNote::push_back(const FootNote::Note& footnote) + { + Notes->push_back(footnote); + } + + + const size_t FootNote::size() const + { + return Notes->size(); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/FootNote.h b/ASCOfficeOdtFile/Source/DocxFormat/FootNote.h new file mode 100644 index 0000000000..3febf770b2 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/FootNote.h @@ -0,0 +1,67 @@ +#pragma once +#ifndef OOX_FOOTNOTE_INCLUDE_H_ +#define OOX_FOOTNOTE_INCLUDE_H_ + +#include "File.h" +#include "IFileContainer.h" +#include +#include "property.h" +#include "nullable_property.h" +#include "Logic/FootnoteReference.h" +#include "WritingElement.h" +#include "Logic/TextItem.h" +#include "Limit/SeparatorType.h" + + +namespace OOX +{ + class FootNote : public OOX::File, public IFileContainer + { + public: + class Note : public WritingElement + { + public: + Note(); + virtual ~Note(); + explicit Note(const XML::XNode& node); + const Note& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + void push_back(const OOX::Logic::Paragraph& paragraph); + + public: + nullable_property Type; + property Id; + property > Items; + }; + + public: + FootNote(); + FootNote(const boost::filesystem::wpath& filename); + virtual ~FootNote(); + + public: + virtual void read(const boost::filesystem::wpath& filename); + virtual void write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const; + + public: + virtual const FileType type() const; + virtual const boost::filesystem::wpath DefaultDirectory() const; + virtual const boost::filesystem::wpath DefaultFileName() const; + + public: + const FootNote::Note find(const Logic::FootnoteReference& reference) const; + void add(const FootNote::Note& note); + void push_back(const FootNote::Note& note); + const size_t size() const; + + public: + property > Notes; + }; +} // namespace OOX + +#endif // OOX_FOOTNOTE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/FootNote/Note.cpp b/ASCOfficeOdtFile/Source/DocxFormat/FootNote/Note.cpp new file mode 100644 index 0000000000..89ee57684a --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/FootNote/Note.cpp @@ -0,0 +1,60 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "./../FootNote.h" + + +namespace OOX +{ + + FootNote::Note::Note() + { + } + + + FootNote::Note::~Note() + { + } + + + FootNote::Note::Note(const XML::XNode& node) + { + fromXML(node); + } + + + const FootNote::Note& FootNote::Note::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void FootNote::Note::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Type = element.attribute("type").value(); + Id = element.attribute("id").value(); + XML::Fill(Items, element , "p", "tbl"); + } + + + const XML::XNode FootNote::Note::toXML() const + { + return + XML::XElement(ns.w + "footnote", + XML::XAttribute(ns.w + "type", Type) + + XML::XAttribute(ns.w + "id", Id) + + XML::Write(Items) + ); + } + + + void FootNote::Note::push_back(const OOX::Logic::Paragraph& paragraph) + { + Items->push_back(paragraph); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Footer.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Footer.cpp new file mode 100644 index 0000000000..4261f3a933 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Footer.cpp @@ -0,0 +1,67 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Footer.h" +#include "exception\not_implement.h" +#include "FileTypes.h" + + +namespace OOX +{ + + Footer::Footer() + { + } + + + Footer::Footer(const boost::filesystem::wpath& filename) + { + read(filename); + } + + + Footer::~Footer() + { + } + + + void Footer::read(const boost::filesystem::wpath& filename) + { + IFileContainer::read(filename); + + const XML::XDocument document(filename); + XML::Fill(Items, document.Root, "p", "tbl", "sdt"); + } + + + void Footer::write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const + { + XML::XElement(ns.w + "ftr", + XML::Write(Items) + ).Save(filename); + + content.registration(type().OverrideType(), directory, filename); + IFileContainer::write(filename, directory, content); + } + + + const FileType Footer::type() const + { + return FileTypes::Footer; + } + + + const boost::filesystem::wpath Footer::DefaultDirectory() const + { + return type().DefaultDirectory(); + } + + + const boost::filesystem::wpath Footer::DefaultFileName() const + { + return type().DefaultFileName(); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Footer.h b/ASCOfficeOdtFile/Source/DocxFormat/Footer.h new file mode 100644 index 0000000000..7f89132c26 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Footer.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef OOX_FOOTER_INCLUDE_H_ +#define OOX_FOOTER_INCLUDE_H_ + +#include "File.h" +#include "IFileContainer.h" +#include "Logic/TextItem.h" +#include +#include "property.h" + + +namespace OOX +{ + class Footer : public OOX::File, public IFileContainer + { + public: + Footer(); + Footer(const boost::filesystem::wpath& filename); + virtual ~Footer(); + + public: + virtual void read(const boost::filesystem::wpath& filename); + virtual void write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const; + + public: + virtual const FileType type() const; + virtual const boost::filesystem::wpath DefaultDirectory() const; + virtual const boost::filesystem::wpath DefaultFileName() const; + + public: + property > Items; + }; +} // namespace OOX + +#endif // OOX_FOOTER_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/FormatError.cpp b/ASCOfficeOdtFile/Source/DocxFormat/FormatError.cpp new file mode 100644 index 0000000000..28b003681f --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/FormatError.cpp @@ -0,0 +1,26 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "FormatError.h" +#include "Log.h" + + +namespace OOX +{ + + FormatError::FormatError(const std::string& message) + : runtime_error(message) + { + Log::error(message); + } + + + FormatError::FormatError(const std::wstring& message) + : runtime_error("docx format error") + { + Log::error(message); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/FormatError.h b/ASCOfficeOdtFile/Source/DocxFormat/FormatError.h new file mode 100644 index 0000000000..11317dd853 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/FormatError.h @@ -0,0 +1,19 @@ +#pragma once +#ifndef OOX_FORMAT_ERROR_INCLUDE_H_ +#define OOX_FORMAT_ERROR_INCLUDE_H_ + +#include +#include + + +namespace OOX +{ + class FormatError : public std::runtime_error + { + public: + explicit FormatError(const std::string& message); + explicit FormatError(const std::wstring& message); + }; +} // namesapce OOX + +#endif // OOX_FORMAT_ERROR_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Header.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Header.cpp new file mode 100644 index 0000000000..73dbb38f03 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Header.cpp @@ -0,0 +1,67 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Header.h" +#include "exception\not_implement.h" +#include "FileTypes.h" + + +namespace OOX +{ + + Header::Header() + { + } + + + Header::Header(const boost::filesystem::wpath& filename) + { + read(filename); + } + + + Header::~Header() + { + } + + + void Header::read(const boost::filesystem::wpath& filename) + { + IFileContainer::read(filename); + + const XML::XDocument document(filename); + XML::Fill(Items, document.Root, "p", "tbl", "sdt"); + } + + + void Header::write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const + { + XML::XElement(ns.w + "hdr", + XML::Write(Items) + ).Save(filename); + + content.registration(type().OverrideType(), directory, filename); + IFileContainer::write(filename, directory, content); + } + + + const FileType Header::type() const + { + return FileTypes::Header; + } + + + const boost::filesystem::wpath Header::DefaultDirectory() const + { + return type().DefaultDirectory(); + } + + + const boost::filesystem::wpath Header::DefaultFileName() const + { + return type().DefaultFileName(); + } + +} // namespace OOXFile \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Header.h b/ASCOfficeOdtFile/Source/DocxFormat/Header.h new file mode 100644 index 0000000000..1034d2a3bc --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Header.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef OOX_HEADER_INCLUDE_H_ +#define OOX_HEADER_INCLUDE_H_ + +#include "File.h" +#include "IFileContainer.h" +#include "Logic/TextItem.h" +#include +#include "property.h" + + +namespace OOX +{ + class Header : public OOX::File, public IFileContainer + { + public: + Header(); + Header(const boost::filesystem::wpath& filename); + virtual ~Header(); + + public: + virtual void read(const boost::filesystem::wpath& filename); + virtual void write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const; + + public: + virtual const FileType type() const; + virtual const boost::filesystem::wpath DefaultDirectory() const; + virtual const boost::filesystem::wpath DefaultFileName() const; + + public: + property > Items; + }; +} // namespace OOX + +#endif // OOX_HEADER_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/IFileBuilder.cpp b/ASCOfficeOdtFile/Source/DocxFormat/IFileBuilder.cpp new file mode 100644 index 0000000000..e1b2e8cd55 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/IFileBuilder.cpp @@ -0,0 +1,21 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "IFileBuilder.h" + + +namespace OOX +{ + + IFileBuilder::IFileBuilder() + { + } + + + IFileBuilder::~IFileBuilder() + { + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/IFileBuilder.h b/ASCOfficeOdtFile/Source/DocxFormat/IFileBuilder.h new file mode 100644 index 0000000000..52f890d6e8 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/IFileBuilder.h @@ -0,0 +1,23 @@ +#pragma once +#ifndef OOX_FILE_BUILDER_INCLUDE_H_ +#define OOX_FILE_BUILDER_INCLUDE_H_ + +#include +#include "ContentTypes/File.h" + + +namespace OOX +{ + class IFileBuilder + { + public: + IFileBuilder(); + virtual ~IFileBuilder(); + + public: + virtual void Commit(const boost::filesystem::wpath& path) = 0; + virtual void Finalize(const boost::filesystem::wpath& path, const boost::filesystem::wpath& directory, ContentTypes::File& content) = 0; + }; +} // namespace OOX + +#endif // OOX_FILE_BUILDER_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/IFileContainer.cpp b/ASCOfficeOdtFile/Source/DocxFormat/IFileContainer.cpp new file mode 100644 index 0000000000..6a14adaa2d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/IFileContainer.cpp @@ -0,0 +1,332 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "IFileContainer.h" +#include +#include "Rels/File.h" +#include "FileFactory.h" +#include "ContentTypes/File.h" +#include "FileType.h" +#include "External\External.h" +#include "External\HyperLink.h" +#include "Media\Image.h" +#include "Media\OleObject.h" +#include "FileNameUtility.h" +#include "FileTypes.h" + + +namespace OOX +{ + UnknowTypeFile IFileContainer::unknow; + + void IFileContainer::read(const boost::filesystem::wpath& filename) + { + OOX::Rels::File rels(filename); + const boost::filesystem::wpath path = filename.parent_path(); + read(rels, path); + } + + + void IFileContainer::read(const Rels::File& rels, const boost::filesystem::wpath& path) + { +#ifndef NODOCX + BOOST_FOREACH(const OOX::Rels::RelationShip& relation, *rels.Relations) + { + add(relation.rId(), OOX::CreateFile(path, relation)); + } +#endif + } + + + void IFileContainer::write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const + { + OOX::Rels::File rels; + const boost::filesystem::wpath current = filename.parent_path(); + write(rels, current, directory, content); + rels.write(filename); + } + + + void IFileContainer::write(Rels::File& rels, const boost::filesystem::wpath& curdir, const boost::filesystem::wpath& directory, ContentTypes::File& content) const + { + std::map namepair; + BOOST_FOREACH(const RIdFilePair& pair, m_container) + { +// if (dynamic_cast(pair.second.get()) == 0) + if (boost::shared_dynamic_cast(pair.second) == 0) + { + const boost::filesystem::wpath defdir = pair.second->DefaultDirectory(); + boost::filesystem::wpath name = pair.second->DefaultFileName(); + if (namepair[name]++ != 0) + name = name + namepair[name]; + + boost::filesystem::create_directories(curdir / defdir); + pair.second->write(curdir / defdir / name, directory / defdir, content); + rels.registration(pair.first, pair.second->type(), defdir / name); + } + else + { +// const HyperLink hyperlink = static_cast(*pair.second); +// rels.registration(pair.first, hyperlink); + rels.registration(pair.first, boost::shared_dynamic_cast(pair.second)); + } + } + } + + + void IFileContainer::Commit(const boost::filesystem::wpath& path) + { + std::map namepair; + BOOST_FOREACH(const RIdFilePair& pair, m_container) + { + if (boost::shared_dynamic_cast(pair.second) == 0) + { + const boost::filesystem::wpath defdir = pair.second->DefaultDirectory(); + boost::filesystem::wpath name = pair.second->DefaultFileName(); + if (namepair[name]++ != 0) + name = name + namepair[name]; + + boost::filesystem::create_directories(path / defdir); + + OOX::IFileBuilder* fileBuilder = dynamic_cast(pair.second.get()); + + if ( fileBuilder != NULL ) + { + fileBuilder->Commit(path / defdir / name); + } + } + } + } + + + void IFileContainer::Finalize(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) + { + OOX::Rels::File rels; + const boost::filesystem::wpath current = filename.parent_path(); + Finalize(rels, current, directory, content); + rels.write(filename); + } + + + void IFileContainer::Finalize(Rels::File& rels, const boost::filesystem::wpath& curdir, const boost::filesystem::wpath& directory, ContentTypes::File& content) + { + std::map namepair; + BOOST_FOREACH(const RIdFilePair& pair, m_container) + { + if (boost::shared_dynamic_cast(pair.second) == 0) + { + const boost::filesystem::wpath defdir = pair.second->DefaultDirectory(); + boost::filesystem::wpath name = pair.second->DefaultFileName(); + if (namepair[name]++ != 0) + name = name + namepair[name]; + + boost::filesystem::create_directories(curdir / defdir); + + OOX::IFileBuilder* fileBuilder = dynamic_cast(pair.second.get()); + + if ( fileBuilder != NULL ) + { + fileBuilder->Finalize(curdir / defdir / name, directory / defdir, content); + } + else + { + pair.second->write(curdir / defdir / name, directory / defdir, content); + } + + rels.registration(pair.first, pair.second->type(), defdir / name); + } + else + { + rels.registration(pair.first, boost::shared_dynamic_cast(pair.second)); + } + } + } + + + void IFileContainer::extractPictures(const boost::filesystem::wpath& path) const + { + BOOST_FOREACH(const RIdFilePair& pair, m_container) + { + if (dynamic_cast(pair.second.get()) != 0) + { + const Image& image = static_cast(*pair.second); + image.copy_to(path); + } + else if (dynamic_cast(pair.second.get()) != 0) + { + const IFileContainer& container = dynamic_cast(*pair.second); + container.extractPictures(path); + } + } + } + + + Image& IFileContainer::image(const RId rId) + { + // pog: no-const by th use of const + return const_cast( static_cast(this)->image(rId) ); + //return dynamic_cast(*m_container[rId]); + } + + + const Image& IFileContainer::image(const RId rId) const + { + if (m_container.count(rId)) + { + + if (OOX::File * file = m_container.find(rId)->second.get()) + { + if (const Image * image = dynamic_cast(file)) + return *image; + else + throw std::runtime_error("invalid rel type"); + + } + else + throw std::runtime_error("invalid rel"); + } + else + throw std::runtime_error("invalid rId"); + } + + + + HyperLink& IFileContainer::hyperlink(const RId rId) + { + return dynamic_cast(*m_container[rId]); + } + + + const HyperLink& IFileContainer::hyperlink(const RId rId) const + { + return dynamic_cast(*m_container.find(rId)->second); + } + + + OleObject& IFileContainer::oleObject(const RId rId) + { + return dynamic_cast(*m_container[rId]); + } + + + const OleObject& IFileContainer::oleObject(const RId rId) const + { + return dynamic_cast(*m_container.find(rId)->second); + } + + + const bool IFileContainer::exist(const FileType& type) const + { + BOOST_FOREACH(const RIdFilePair& pair, m_container) + { + if (pair.second->type() == type) + return true; + } + return false; + } + + + const bool IFileContainer::exist(const RId& rId) const + { + return m_container.find(rId) != m_container.end(); + } + + + const bool IFileContainer::isExternal(const OOX::RId& rId) const + { + if(m_container.find(rId) != m_container.end()) + { + std::string type = m_container.find(rId)->second->type().RelationType(); + std::wstring name = m_container.find(rId)->second->type().DefaultFileName().string(); + return (((type == OOX::FileTypes::ExternalAudio.RelationType()) || (type == OOX::FileTypes::ExternalImage.RelationType()) + || (type == OOX::FileTypes::ExternalVideo.RelationType())) && (name == L"")); + } + return true; + } + + + const boost::shared_ptr IFileContainer::get(const FileType& type) const + { + BOOST_FOREACH(const RIdFilePair& pair, m_container) + { + if (pair.second->type() == type) + return pair.second; + } + return boost::shared_ptr(new UnknowTypeFile(unknow)); + } + + + const RId IFileContainer::add(const boost::shared_ptr& file) + { + const RId rId = maxRId().next(); + add(rId, file); + return rId; + } + + + void IFileContainer::add(const OOX::RId rId, const boost::shared_ptr& file) + { + IDictonary::add(rId, file); + } + + + File& IFileContainer::find(const FileType& type) + { + BOOST_FOREACH(const RIdFilePair& pair, m_container) + { + if (pair.second->type() == type) + return *pair.second; + } + return unknow; + } + + + const File& IFileContainer::find(const FileType& type) const + { + BOOST_FOREACH(const RIdFilePair& pair, m_container) + { + if (pair.second->type() == type) + return *pair.second; + } + return unknow; + } + + + boost::shared_ptr IFileContainer::operator [](const OOX::RId rId) + { + return m_container[rId]; + } + + + const boost::shared_ptr IFileContainer::operator [](const OOX::RId rId) const + { + return m_container.find(rId)->second; + } + + + File& IFileContainer::operator [](const FileType& type) + { + return find(type); + } + + + const File& IFileContainer::operator [](const FileType& type) const + { + return find(type); + } + + + const RId IFileContainer::maxRId() const + { + RId rId; + BOOST_FOREACH(const RIdFilePair& pair, m_container) + { + if (rId < pair.first) + rId = pair.first; + } + return rId; + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/IFileContainer.h b/ASCOfficeOdtFile/Source/DocxFormat/IFileContainer.h new file mode 100644 index 0000000000..c51077f2dc --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/IFileContainer.h @@ -0,0 +1,105 @@ +#pragma once +#ifndef OOX_IFILE_CONTAINER_INCLUDE_H_ +#define OOX_IFILE_CONTAINER_INCLUDE_H_ + +#include "IDictonary.h" +#include +#include +#include "RId.h" +#include "UnknowTypeFile.h" +#include "IFileBuilder.h" + +namespace OOX {class File;} +namespace OOX {class FileType;} +namespace OOX {namespace Rels {class File;}} +namespace OOX {namespace ContentTypes {class File;}} +namespace OOX {class Image;} +namespace OOX {class HyperLink;} +namespace OOX {class OleObject;} + + +namespace OOX +{ + class IFileContainer : public IDictonary > + { + protected: + void read(const boost::filesystem::wpath& filename); + void read(const Rels::File& rels, const boost::filesystem::wpath& path); + void write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const; + void write(Rels::File& rels, const boost::filesystem::wpath& current, const boost::filesystem::wpath& directory, ContentTypes::File& content) const; + + protected: + void Commit(const boost::filesystem::wpath& path); + void Finalize(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content); + void Finalize(Rels::File& rels, const boost::filesystem::wpath& current, const boost::filesystem::wpath& directory, ContentTypes::File& content); + + public: + typedef std::pair > RIdFilePair; + + public: + void extractPictures(const boost::filesystem::wpath& path) const; + + public: + Image& image(const RId rId); + const Image& image(const RId rId) const; + + HyperLink& hyperlink(const RId rId); + const HyperLink& hyperlink(const RId rId) const; + + OleObject& oleObject(const RId rId); + const OleObject& oleObject(const RId rId) const; + + public: + template const bool exist() const; + const bool exist(const FileType& type) const; + const bool exist(const OOX::RId& rId) const; + const bool isExternal(const OOX::RId& rId) const; + + const boost::shared_ptr get(const FileType& type) const; + const RId add(const boost::shared_ptr& file); + void add(const OOX::RId rId, const boost::shared_ptr& file); + + File& find(const FileType& type); + const File& find(const FileType& type) const; + + boost::shared_ptr operator [](const OOX::RId rId); + const boost::shared_ptr operator [](const OOX::RId rId) const; + + File& operator [](const FileType& type); + const File& operator [](const FileType& type) const; + + template T& find(); + template const T& find() const; + + protected: + static UnknowTypeFile unknow; + + private: + const RId maxRId() const; + }; + + + template + const bool IFileContainer::exist() const + { + T file; + return exist(file.type()); + } + + template + T& IFileContainer::find() + { + T file; + return dynamic_cast(find(file.type())); + } + + template + const T& IFileContainer::find() const + { + T file; + return dynamic_cast(find(file.type())); + } + +} // namespace OOX + +#endif // OOX_IFILE_CONTAINER_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Item.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Item.cpp new file mode 100644 index 0000000000..2719bb7302 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Item.cpp @@ -0,0 +1,65 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Item.h" +#include "FileTypes.h" + + +namespace OOX +{ + + Item::Item() + { + } + + + Item::Item(const boost::filesystem::wpath& filename) + { + read(filename); + } + + + Item::~Item() + { + } + + + void Item::read(const boost::filesystem::wpath& filename) + { + const XML::XDocument document(filename); + SelectedStyle = document.Root.attribute("SelectedStyle").value(); + StyleName = document.Root.attribute("StyleName").value(); + } + + + void Item::write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const + { + XML::XElement(ns.b + "Sources", + XML::XAttribute("SelectedStyle", SelectedStyle) + + XML::XAttribute("StyleName", StyleName) + ).Save(filename); + + content.registration(type().OverrideType(), directory, filename); + } + + + const FileType Item::type() const + { + return FileTypes::Item; + } + + + const boost::filesystem::wpath Item::DefaultDirectory() const + { + return type().DefaultDirectory(); + } + + + const boost::filesystem::wpath Item::DefaultFileName() const + { + return type().DefaultFileName(); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Item.h b/ASCOfficeOdtFile/Source/DocxFormat/Item.h new file mode 100644 index 0000000000..340c4d6478 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Item.h @@ -0,0 +1,33 @@ +#pragma once +#ifndef OOX_ITEM_INCLUDE_H_ +#define OOX_ITEM_INCLUDE_H_ + +#include "File.h" +#include "nullable_property.h" + + +namespace OOX +{ + class Item : public OOX::File + { + public: + Item(); + Item(const boost::filesystem::wpath& filename); + virtual ~Item(); + + public: + virtual void read(const boost::filesystem::wpath& filename); + virtual void write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const; + + public: + virtual const FileType type() const; + virtual const boost::filesystem::wpath DefaultDirectory() const; + virtual const boost::filesystem::wpath DefaultFileName() const; + + private: + nullable_property SelectedStyle; + nullable_property StyleName; + }; +} // namespace OOX + +#endif // OOX_ITEM_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/ItemProps.cpp b/ASCOfficeOdtFile/Source/DocxFormat/ItemProps.cpp new file mode 100644 index 0000000000..994c8f3ee8 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/ItemProps.cpp @@ -0,0 +1,65 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ItemProps.h" +#include "FileTypes.h" + + +namespace OOX +{ + + ItemProps::ItemProps() + { + } + + + ItemProps::ItemProps(const boost::filesystem::wpath& filename) + { + read(filename); + } + + + ItemProps::~ItemProps() + { + } + + + void ItemProps::read(const boost::filesystem::wpath& filename) + { + const XML::XDocument document(filename); + Refs = document.Root.element("schemaRefs"); + ItemID = document.Root.attribute("itemID").value(); + } + + + void ItemProps::write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const + { + XML::XElement(ns.ds + "datastoreItem", + XML::XAttribute(ns.ds + "itemID", ItemID) + + XML::Write(Refs) + ).Save(filename); + + content.registration(type().OverrideType(), directory, filename); + } + + + const FileType ItemProps::type() const + { + return FileTypes::ItemProp; + } + + + const boost::filesystem::wpath ItemProps::DefaultDirectory() const + { + return type().DefaultDirectory(); + } + + + const boost::filesystem::wpath ItemProps::DefaultFileName() const + { + return type().DefaultFileName(); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/ItemProps.h b/ASCOfficeOdtFile/Source/DocxFormat/ItemProps.h new file mode 100644 index 0000000000..e388aa88e9 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/ItemProps.h @@ -0,0 +1,67 @@ +#pragma once +#ifndef OOX_ITEM_PROPS_INCLUDE_H_ +#define OOX_ITEM_PROPS_INCLUDE_H_ + +#include "File.h" +#include "property.h" +#include +#include + + +namespace OOX +{ + class ItemProps : public OOX::File + { + public: + class SchemaRef : public WritingElement + { + public: + SchemaRef(); + virtual ~SchemaRef(); + explicit SchemaRef(const XML::XNode& node); + const SchemaRef& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Uri; + }; + class SchemaRefs : public WritingElement + { + public: + SchemaRefs(); + virtual ~SchemaRefs(); + explicit SchemaRefs(const XML::XNode& node); + const SchemaRefs& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + std::vector SchemaRef; + }; + + public: + ItemProps(); + ItemProps(const boost::filesystem::wpath& filename); + virtual ~ItemProps(); + + public: + virtual void read(const boost::filesystem::wpath& filename); + virtual void write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const; + + public: + virtual const FileType type() const; + virtual const boost::filesystem::wpath DefaultDirectory() const; + virtual const boost::filesystem::wpath DefaultFileName() const; + + private: + property Refs; + property ItemID; + }; +} // namespace OOX + +#endif // OOX_ITEM_PROPS_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/ItemProps/SchemaRef.cpp b/ASCOfficeOdtFile/Source/DocxFormat/ItemProps/SchemaRef.cpp new file mode 100644 index 0000000000..7f7bbcda77 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/ItemProps/SchemaRef.cpp @@ -0,0 +1,50 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "./../ItemProps.h" + + +namespace OOX +{ + + ItemProps::SchemaRef::SchemaRef() + { + } + + + ItemProps::SchemaRef::~SchemaRef() + { + } + + + ItemProps::SchemaRef::SchemaRef (const XML::XNode& node) + { + fromXML(node); + } + + + const ItemProps::SchemaRef& ItemProps::SchemaRef::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void ItemProps::SchemaRef::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Uri = element.attribute("uri").value(); + } + + + const XML::XNode ItemProps::SchemaRef::toXML() const + { + return + XML::XElement(ns.ds + "schemaRef", + XML::XAttribute(ns.ds + "uri", Uri) + ); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/ItemProps/SchemaRefs.cpp b/ASCOfficeOdtFile/Source/DocxFormat/ItemProps/SchemaRefs.cpp new file mode 100644 index 0000000000..0c7dca08a3 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/ItemProps/SchemaRefs.cpp @@ -0,0 +1,47 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "./../ItemProps.h" + + +namespace OOX +{ + + ItemProps::SchemaRefs::SchemaRefs() + { + } + + + ItemProps::SchemaRefs::~SchemaRefs() + { + } + + + ItemProps::SchemaRefs::SchemaRefs(const XML::XNode& node) + { + fromXML(node); + } + + + const ItemProps::SchemaRefs& ItemProps::SchemaRefs::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void ItemProps::SchemaRefs::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + XML::Fill(SchemaRef, element); + } + + + const XML::XNode ItemProps::SchemaRefs::toXML() const + { + return XML::XElement(ns.ds + "schemaRefs", XML::Write(SchemaRef)); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/BorderName.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/BorderName.cpp new file mode 100644 index 0000000000..55310f2d0f --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/BorderName.cpp @@ -0,0 +1,47 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "BorderName.h" + + +namespace OOX +{ + namespace Limit + { + BorderNameSet::BorderNameSet() + { + _list.insert("top"); + _list.insert("left"); + _list.insert("bottom"); + _list.insert("right"); + _list.insert("insideH"); + _list.insert("insideV"); + } + + BorderName::BorderName() + { + //add("top"); + //add("left"); + //add("bottom"); + //add("right"); + //add("insideH"); + //add("insideV"); + } + + BorderNameSet BorderName::_set; + const std::string BorderName::no_find() const + { + return "top"; + } + + void BorderName::operator()(std::string& _value, Parameter value) + { + if (_set._list.find(value) != _set._list.end()) + _value = value; + else + _value = no_find(); + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/BorderName.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/BorderName.h new file mode 100644 index 0000000000..26286944b3 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/BorderName.h @@ -0,0 +1,33 @@ +#pragma once +#ifndef OOX_LIMIT_BORDER_NAME_INCLUDE_H_ +#define OOX_LIMIT_BORDER_NAME_INCLUDE_H_ + +#include "setter.h" +#include + +namespace OOX +{ + namespace Limit + { + class BorderNameSet + { + public: + BorderNameSet(); + std::set _list; + }; + + class BorderName : public setter::base_setter//from + { + public: + BorderName(); + + void operator()(std::string& _value, Parameter value); + public: + static BorderNameSet _set; + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_BORDER_NAME_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/BorderValue.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/BorderValue.cpp new file mode 100644 index 0000000000..1822e0ee5a --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/BorderValue.cpp @@ -0,0 +1,86 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "BorderValue.h" + + +namespace OOX +{ + namespace Limit + { + BorderValueSet::BorderValueSet() + { + _list.insert("single"); + _list.insert("none"); + _list.insert("nil"); + _list.insert("candyCorn"); + _list.insert("dashed"); + _list.insert("dotDash"); + _list.insert("dotDotDash"); + _list.insert("double"); + _list.insert("triple"); + _list.insert("thinThickSmallGap"); + _list.insert("thickThinSmallGap"); + _list.insert("thinThickThinSmallGap"); + _list.insert("thinThickMediumGap"); + _list.insert("thickThinMediumGap"); + _list.insert("thinThickThinMediumGap"); + _list.insert("thinThickLargeGap"); + _list.insert("thickThinLargeGap"); + _list.insert("thinThickThinLargeGap"); + _list.insert("wave"); + _list.insert("doubleWave"); + _list.insert("dashDotStroked"); + _list.insert("threeDEmboss"); + _list.insert("threeDEngrave"); + _list.insert("outset"); + _list.insert("inset"); + } + + BorderValue::BorderValue() + { + //add("single"); + //add("none"); + //add("nil"); + //add("candyCorn"); + //add("dashed"); + //add("dotDash"); + //add("dotDotDash"); + //add("double"); + //add("triple"); + //add("thinThickSmallGap"); + //add("thickThinSmallGap"); + //add("thinThickThinSmallGap"); + //add("thinThickMediumGap"); + //add("thickThinMediumGap"); + //add("thinThickThinMediumGap"); + //add("thinThickLargeGap"); + //add("thickThinLargeGap"); + //add("thinThickThinLargeGap"); + //add("wave"); + //add("doubleWave"); + //add("dashDotStroked"); + //add("threeDEmboss"); + //add("threeDEngrave"); + //add("outset"); + //add("inset"); + } + BorderValueSet BorderValue::_set; + + const std::string BorderValue::no_find() const + { + return "none"; + } + + void BorderValue::operator()(std::string& _value, Parameter value) + { + if (_set._list.find(value) != _set._list.end()) + _value = value; + else + _value = no_find(); + } + + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/BorderValue.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/BorderValue.h new file mode 100644 index 0000000000..a657bcf422 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/BorderValue.h @@ -0,0 +1,34 @@ +#pragma once +#ifndef OOX_LIMIT_BORDER_VALUE_INCLUDE_H_ +#define OOX_LIMIT_BORDER_VALUE_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class BorderValueSet + { + public: + BorderValueSet(); + std::set _list; + }; + + class BorderValue : public setter::base_setter//from + { + public: + BorderValue(); + + void operator()(std::string& _value, Parameter value); + public: + static BorderValueSet _set; + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_BORDER_VALUE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/BreakClear.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/BreakClear.cpp new file mode 100644 index 0000000000..1e67a5856f --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/BreakClear.cpp @@ -0,0 +1,26 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "BreakClear.h" + + +namespace OOX +{ + namespace Limit + { + BreakClear::BreakClear() + { + add("all"); + add("left"); + add("none"); + add("right"); + } + + const std::string BreakClear::no_find() const + { + return "all"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/BreakClear.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/BreakClear.h new file mode 100644 index 0000000000..1913a1588c --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/BreakClear.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_BREAK_CLEAR_INCLUDE_H_ +#define OOX_LIMIT_BREAK_CLEAR_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class BreakClear : public setter::from + { + public: + BreakClear(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_BREAK_CLEAR_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/BreakType.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/BreakType.cpp new file mode 100644 index 0000000000..520858505f --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/BreakType.cpp @@ -0,0 +1,25 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "BreakType.h" + + +namespace OOX +{ + namespace Limit + { + BreakType::BreakType() + { + add("page"); + add("column"); + add("textWrapping"); + } + + const std::string BreakType::no_find() const + { + return "page"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/BreakType.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/BreakType.h new file mode 100644 index 0000000000..6d9e58a5f1 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/BreakType.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_BREAK_TYPE_INCLUDE_H_ +#define OOX_LIMIT_BREAK_TYPE_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class BreakType : public setter::from + { + public: + BreakType(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_BREAK_TYPE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/Cap.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Cap.cpp new file mode 100644 index 0000000000..c9f35bdbf2 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Cap.cpp @@ -0,0 +1,25 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Cap.h" + + +namespace OOX +{ + namespace Limit + { + Cap::Cap() + { + add("rnd"); + add("sq"); + add("flat"); + } + + const std::string Cap::no_find() const + { + return "rnd"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/Cap.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Cap.h new file mode 100644 index 0000000000..e11e66d111 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Cap.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_CAP_INCLUDE_H_ +#define OOX_LIMIT_CAP_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class Cap : public setter::from + { + public: + Cap(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_CAP_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/Cmpd.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Cmpd.cpp new file mode 100644 index 0000000000..e231d9c645 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Cmpd.cpp @@ -0,0 +1,26 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Cmpd.h" + + +namespace OOX +{ + namespace Limit + { + Cmpd::Cmpd() + { + add("sng"); + add("thickThin"); + add("tri"); + add("dbl"); + } + + const std::string Cmpd::no_find() const + { + return "sng"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/Cmpd.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Cmpd.h new file mode 100644 index 0000000000..b43457455b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Cmpd.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_CMPD_INCLUDE_H_ +#define OOX_LIMIT_CMPD_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class Cmpd : public setter::from + { + public: + Cmpd(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_CMPD_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/ComplexExt.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/ComplexExt.cpp new file mode 100644 index 0000000000..4dfa661350 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/ComplexExt.cpp @@ -0,0 +1,23 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ComplexExt.h" + + +namespace OOX +{ + namespace Limit + { + ComplexExt::ComplexExt() + { + add("view"); + } + + const std::string ComplexExt::no_find() const + { + return "view"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/ComplexExt.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/ComplexExt.h new file mode 100644 index 0000000000..e3363995e0 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/ComplexExt.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_COMPLEX_EXT_INCLUDE_H_ +#define OOX_LIMIT_COMPLEX_EXT_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class ComplexExt : public setter::from + { + public: + ComplexExt(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_COMPLEX_EXT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/ConnectType.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/ConnectType.cpp new file mode 100644 index 0000000000..5612b4aef0 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/ConnectType.cpp @@ -0,0 +1,24 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ConnectType.h" + + +namespace OOX +{ + namespace Limit + { + ConnectType::ConnectType() + { + add("rect"); + add("custom"); + } + + const std::string ConnectType::no_find() const + { + return "rect"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/ConnectType.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/ConnectType.h new file mode 100644 index 0000000000..f91c169872 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/ConnectType.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_CONNECT_TYPE_INCLUDE_H_ +#define OOX_LIMIT_CONNECT_TYPE_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class ConnectType : public setter::from + { + public: + ConnectType(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_CONNECT_TYPE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/Dash.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Dash.cpp new file mode 100644 index 0000000000..6ad1434e34 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Dash.cpp @@ -0,0 +1,28 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Dash.h" + + +namespace OOX +{ + namespace Limit + { + Dash::Dash() + { + add("solid"); + add("sysDash"); + add("sysDot"); + add("dash"); + add("lgDash"); + add("lgDashDot"); + } + + const std::string Dash::no_find() const + { + return "solid"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/Dash.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Dash.h new file mode 100644 index 0000000000..2ce47ffb55 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Dash.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_DASH_INCLUDE_H_ +#define OOX_LIMIT_DASH_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class Dash : public setter::from + { + public: + Dash(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_DASH_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/DocGridType.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/DocGridType.cpp new file mode 100644 index 0000000000..f39476f8e9 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/DocGridType.cpp @@ -0,0 +1,26 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "DocGridType.h" + + +namespace OOX +{ + namespace Limit + { + DocGridType::DocGridType() + { + add("Default"); + add("lines"); + add("linesAndChars"); + add("snapToChars"); + } + + const std::string DocGridType::no_find() const + { + return "Default"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/DocGridType.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/DocGridType.h new file mode 100644 index 0000000000..3d2f3a9882 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/DocGridType.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_DOC_GRID_TYPE_INCLUDE_H_ +#define OOX_LIMIT_DOC_GRID_TYPE_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class DocGridType : public setter::from + { + public: + DocGridType(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_DOC_GRID_TYPE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/DrawingWrapType.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/DrawingWrapType.cpp new file mode 100644 index 0000000000..5673f7bf2d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/DrawingWrapType.cpp @@ -0,0 +1,27 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "DrawingWrapType.h" + + +namespace OOX +{ + namespace Limit + { + DrawingWrapType::DrawingWrapType() + { + add("wrapNone"); + add("wrapSquare"); + add("wrapTight"); + add("wrapThrough"); + add("wrapTopAndBottom"); + } + + const std::string DrawingWrapType::no_find() const + { + return "wrapTopAndBottom"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/DrawingWrapType.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/DrawingWrapType.h new file mode 100644 index 0000000000..6f3a1a77f8 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/DrawingWrapType.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_DRAWINGWRAPTYPE_INCLUDE_H_ +#define OOX_LIMIT_DRAWINGWRAPTYPE_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class DrawingWrapType : public setter::from + { + public: + DrawingWrapType(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_DRAWINGWRAPTYPE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/DropCap.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/DropCap.cpp new file mode 100644 index 0000000000..62c7f67c50 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/DropCap.cpp @@ -0,0 +1,25 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "DropCap.h" + + +namespace OOX +{ + namespace Limit + { + DropCap::DropCap() + { + add("drop"); + add("margin"); + add("none"); + } + + const std::string DropCap::no_find() const + { + return "none"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/DropCap.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/DropCap.h new file mode 100644 index 0000000000..d026fc8736 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/DropCap.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_DROP_CAP_INCLUDE_H_ +#define OOX_LIMIT_DROP_CAP_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class DropCap : public setter::from + { + public: + DropCap(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_DROP_CAP_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/Ext.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Ext.cpp new file mode 100644 index 0000000000..9d7a36a08b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Ext.cpp @@ -0,0 +1,23 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Ext.h" + + +namespace OOX +{ + namespace Limit + { + Ext::Ext() + { + add("edit"); + } + + const std::string Ext::no_find() const + { + return "edit"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/Ext.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Ext.h new file mode 100644 index 0000000000..8e729a60c5 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Ext.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_EXT_INCLUDE_H_ +#define OOX_LIMIT_EXT_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class Ext : public setter::from + { + public: + Ext(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_EXT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/FillType.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/FillType.cpp new file mode 100644 index 0000000000..8ca461d4c2 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/FillType.cpp @@ -0,0 +1,23 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "FillType.h" + + +namespace OOX +{ + namespace Limit + { + FillType::FillType() + { + add("gradient"); + } + + const std::string FillType::no_find() const + { + return "gradient"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/FillType.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/FillType.h new file mode 100644 index 0000000000..b4a9e4c60c --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/FillType.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_FILL_TYPE_INCLUDE_H_ +#define OOX_LIMIT_FILL_TYPE_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class FillType : public setter::from + { + public: + FillType(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_EXT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/FldCharType.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/FldCharType.cpp new file mode 100644 index 0000000000..b5baa84c7f --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/FldCharType.cpp @@ -0,0 +1,25 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "FldCharType.h" + + +namespace OOX +{ + namespace Limit + { + FldCharType::FldCharType() + { + add("begin"); + add("end"); + add("separate"); + } + + const std::string FldCharType::no_find() const + { + return "begin"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/FldCharType.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/FldCharType.h new file mode 100644 index 0000000000..33468e427b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/FldCharType.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_FLD_CHAR_TYPE_INCLUDE_H_ +#define OOX_LIMIT_FLD_CHAR_TYPE_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class FldCharType : public setter::from + { + public: + FldCharType(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_FLD_CHAR_TYPE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/FontCharset.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/FontCharset.cpp new file mode 100644 index 0000000000..e0e10b8977 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/FontCharset.cpp @@ -0,0 +1,27 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "FontCharset.h" + + +namespace OOX +{ + namespace Limit + { + FontCharset::FontCharset() + { + add("CC"); + add("00"); + add("02"); + add("80"); + add("86"); + } + + const std::string FontCharset::no_find() const + { + return "CC"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/FontCharset.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/FontCharset.h new file mode 100644 index 0000000000..7971343f59 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/FontCharset.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_FONT_CHARSET_INCLUDE_H_ +#define OOX_LIMIT_FONT_CHARSET_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class FontCharset : public setter::from + { + public: + FontCharset(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_FONT_CHARSET_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/FontFamily.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/FontFamily.cpp new file mode 100644 index 0000000000..169edfa9fb --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/FontFamily.cpp @@ -0,0 +1,28 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "FontFamily.h" + + +namespace OOX +{ + namespace Limit + { + FontFamily::FontFamily() + { + add("swiss"); + add("roman"); + add("decorative"); + add("auto"); + add("script"); + add("modern"); + } + + const std::string FontFamily::no_find() const + { + return "swiss"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/FontFamily.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/FontFamily.h new file mode 100644 index 0000000000..19bce77b56 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/FontFamily.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_FONT_FAMILY_INCLUDE_H_ +#define OOX_LIMIT_FONT_FAMILY_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class FontFamily : public setter::from + { + public: + FontFamily(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_FONT_FAMILY_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/FontName.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/FontName.cpp new file mode 100644 index 0000000000..cd6b86196d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/FontName.cpp @@ -0,0 +1,189 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "FontName.h" + + +namespace OOX +{ + namespace Limit + { + + FontName::FontName() + { + add("Calibri"); + add("Times New Roman"); + add("Agency FB"); + add("Arial"); + add("Algerian"); + add("Arial Black"); + add("Arial Narrow"); + add("Arial Rounded MT Bold"); + add("Arial Unicode MS"); + add("Aston-F1"); + add("Baskerville Old Face"); + add("Bauhaus 93"); + add("Bell MT"); + add("Berlin Sans FB"); + add("Berlin Sans FB Demi"); + add("Bernard MT Condensed"); + add("Blackadder ITC"); + add("Bodoni MT"); + add("Bodoni MT Black"); + add("Bodoni MT Condensed"); + add("Bodoni MT Poster Compressed"); + add("Book Antiqua"); + add("Bookman Old Style"); + add("Bookshelf Symbol 7"); + add("Bradley Hand ITC"); + add("Britannic Bold"); + add("Broadway"); + add("Brush Script MT"); + add("Californian FB"); + add("Calisto MT"); + add("Cambria"); + add("Cambria Math"); + add("Candara"); + add("Castellar"); + add("Centaur"); + add("Century"); + add("Century Gothic"); + add("Century Schoolbook"); + add("Chiller"); + add("Colonna MT"); + add("Comic Sans MS"); + add("Consolas"); + add("Constantia"); + add("Cooper Black"); + add("Copperplate Gothic Bold"); + add("Copperplate Gothic Light"); + add("Corbel"); + add("Courier New"); + add("Curlz MT"); + add("Edwardian Script ITC"); + add("Elephant"); + add("Engravers MT"); + add("Eras Bold ITC"); + add("Eras Demi ITC"); + add("Eras Light ITC"); + add("Eras Medium ITC"); + add("Estrangelo Edessa"); + add("Felix Titling"); + add("Footlight MT Light"); + add("Forte"); + add("Franklin Gothic Book"); + add("Franklin Gothic Demi"); + add("Franklin Gothic Demi Cond"); + add("Franklin Gothic Heavy"); + add("Franklin Gothic Medium"); + add("Franklin Gothic Medium Cond"); + add("Freestyle Script"); + add("French Script MT"); + add("Garamond"); + add("Gautami"); + add("Georgia"); + add("Gigi"); + add("Gill Sans MT"); + add("Gill Sans MT Condensed"); + add("Gill Sans MT Ext Condensed Bold"); + add("Gill Sans Ultra Bold"); + add("Gill Sans Ultra Bold Condensed"); + add("Gloucester MT Extra Condensed"); + add("Goudy Old Style"); + add("Goudy Stout"); + add("Haettenschweiler"); + add("Harlow Solid Italic"); + add("Harrington"); + add("High Tower Text"); + add("Impact"); + add("Imprint MT Shadow"); + add("Informal Roman"); + add("Jokerman"); + add("Juice ITC"); + add("Kristen ITC"); + add("Kunstler Script"); + add("Latha"); + add("Lucida Bright"); + add("Lucida Calligraphy"); + add("Lucida Console"); + add("Lucida Fax"); + add("Lucida Handwriting"); + add("Lucida Sans"); + add("Lucida Sans Typewriter"); + add("Lucida Sans Unicode"); + add("Magneto"); + add("Maiandra GD"); + add("Mangal"); + add("Marlett"); + add("Matura MT Script Capitals"); + add("Microsoft Sans Serif"); + add("Mistral"); + add("Modern No. 20"); + add("Monotype Corsiva"); + add("MS Mincho"); + add("MS Outlook"); + add("MS Reference Sans Serif"); + add("MS Reference Specialty"); + add("MT Extra"); + add("MV Boli"); + add("Niagara Engraved"); + add("Niagara Solid"); + add("OCR A Extended"); + add("Old English Text MT"); + add("Onyx"); + add("OpenSymbol"); + add("Palace Script MT"); + add("Palatino Linotype"); + add("Papyrus"); + add("Parchment"); + add("Perpetua"); + add("Perpetua Titling MT"); + add("Playbill"); + add("Poor Richard"); + add("Pristina"); + add("Raavi"); + add("Rage Italic"); + add("Ravie"); + add("Rockwell"); + add("Rockwell Condensed"); + add("Rockwell Extra Bold"); + add("Script MT Bold"); + add("Segoe Print"); + add("Segoe Script"); + add("Segoe UI"); + add("Showcard Gothic"); + add("Shruti"); + add("SimHei"); + add("Snap ITC"); + add("Stencil"); + add("Sylfaen"); + add("Symbol"); + add("Tahoma"); + add("Tempus Sans ITC"); + add("Thorndale"); + add("Trebuchet MS"); + add("Tunga"); + add("Tw Cen MT"); + add("Tw Cen MT Condensed"); + add("Tw Cen MT Condensed Extra Bold"); + add("Verdana"); + add("Viner Hand ITC"); + add("Vivaldi"); + add("Vladimir Script"); + add("Webdings"); + add("Wide Latin"); + add("Wingdings"); + add("Wingdings 2"); + add("Wingdings 3"); + } + + + const std::string FontName::no_find() const + { + return "Times New Roman"; + } + + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/FontName.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/FontName.h new file mode 100644 index 0000000000..a08640bd8d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/FontName.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_FONT_NAME_INCLUDE_H_ +#define OOX_LIMIT_FONT_NAME_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class FontName : public setter::from + { + public: + FontName(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_FONT_NAME_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/FontPitch.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/FontPitch.cpp new file mode 100644 index 0000000000..70b503d24a --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/FontPitch.cpp @@ -0,0 +1,24 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "FontPitch.h" + + +namespace OOX +{ + namespace Limit + { + FontPitch::FontPitch() + { + add("variable"); + add("fixed"); + } + + const std::string FontPitch::no_find() const + { + return "variable"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/FontPitch.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/FontPitch.h new file mode 100644 index 0000000000..663c367824 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/FontPitch.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_FONT_PITCH_INCLUDE_H_ +#define OOX_LIMIT_FONT_PITCH_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class FontPitch : public setter::from + { + public: + FontPitch(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_FONT_PITCH_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/HorizontalAnchorLocation.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/HorizontalAnchorLocation.cpp new file mode 100644 index 0000000000..8e1c1bd59d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/HorizontalAnchorLocation.cpp @@ -0,0 +1,26 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "HorizontalAnchorLocation.h" + + +namespace OOX +{ + namespace Limit + { + HorizontalAnchorLocation::HorizontalAnchorLocation() + { + add("margin"); + add("page"); + add("text"); + add("none"); + } + + const std::string HorizontalAnchorLocation::no_find() const + { + return "text"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/HorizontalAnchorLocation.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/HorizontalAnchorLocation.h new file mode 100644 index 0000000000..f879490066 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/HorizontalAnchorLocation.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_HORIZONTAL_ANCHOR_LOCATION_INCLUDE_H_ +#define OOX_LIMIT_HORIZONTAL_ANCHOR_LOCATION_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class HorizontalAnchorLocation : public setter::from + { + public: + HorizontalAnchorLocation(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_HORIZONTAL_ANCHOR_LOCATION_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/InlineName.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/InlineName.cpp new file mode 100644 index 0000000000..5d504ef353 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/InlineName.cpp @@ -0,0 +1,27 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "InlineName.h" + + +namespace OOX +{ + namespace Limit + { + + InlineName::InlineName() + { + add("inline"); + add("anchor"); + } + + + const std::string InlineName::no_find() const + { + return "inline"; + } + + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/InlineName.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/InlineName.h new file mode 100644 index 0000000000..e242ee1112 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/InlineName.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_INLINE_NAME_INCLUDE_H_ +#define OOX_LIMIT_INLINE_NAME_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class InlineName : public setter::from + { + public: + InlineName(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_INLINE_NAME_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/Join.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Join.cpp new file mode 100644 index 0000000000..50190707ab --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Join.cpp @@ -0,0 +1,23 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Join.h" + + +namespace OOX +{ + namespace Limit + { + Join::Join() + { + add("miter"); + } + + const std::string Join::no_find() const + { + return "miter"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/Join.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Join.h new file mode 100644 index 0000000000..56173cb520 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Join.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_JOIN_INCLUDE_H_ +#define OOX_LIMIT_JOIN_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class Join : public setter::from + { + public: + Join(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_JOIN_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/Leader.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Leader.cpp new file mode 100644 index 0000000000..9f8b806286 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Leader.cpp @@ -0,0 +1,28 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Leader.h" + + +namespace OOX +{ + namespace Limit + { + Leader::Leader() + { + add("dot"); + add("heavy"); + add("hyphen"); + add("middleDot"); + add("none"); + add("underscore"); + } + + const std::string Leader::no_find() const + { + return "none"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/Leader.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Leader.h new file mode 100644 index 0000000000..5e506496f9 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Leader.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_LEADER_INCLUDE_H_ +#define OOX_LIMIT_LEADER_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class Leader : public setter::from + { + public: + Leader(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_LEADER_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/LineRule.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/LineRule.cpp new file mode 100644 index 0000000000..deee3f2d94 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/LineRule.cpp @@ -0,0 +1,26 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "LineRule.h" + + +namespace OOX +{ + namespace Limit + { + LineRule::LineRule() + { + add("auto"); + add("atLeast"); + add("exact"); + add("exactly"); + } + + const std::string LineRule::no_find() const + { + return "auto"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/LineRule.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/LineRule.h new file mode 100644 index 0000000000..5c20e80c0d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/LineRule.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_LINE_RULE_INCLUDE_H_ +#define OOX_LIMIT_LINE_RULE_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class LineRule : public setter::from + { + public: + LineRule(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_LINE_RULE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/MsoRelative.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/MsoRelative.cpp new file mode 100644 index 0000000000..2aa80a6ea7 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/MsoRelative.cpp @@ -0,0 +1,24 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "MsoRelative.h" + + +namespace OOX +{ + namespace Limit + { + MsoRelative::MsoRelative() + { + add("margin"); + add("page"); + } + + const std::string MsoRelative::no_find() const + { + return "margin"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/MsoRelative.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/MsoRelative.h new file mode 100644 index 0000000000..cddb00d291 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/MsoRelative.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_MSO_RELATIVE_INCLUDE_H_ +#define OOX_LIMIT_MSO_RELATIVE_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class MsoRelative : public setter::from + { + public: + MsoRelative(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_MSO_RELATIVE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/Orient.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Orient.cpp new file mode 100644 index 0000000000..e05a05f6f6 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Orient.cpp @@ -0,0 +1,24 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Orient.h" + + +namespace OOX +{ + namespace Limit + { + Orient::Orient() + { + add("portrait"); + add("landscape"); + } + + const std::string Orient::no_find() const + { + return "portrait"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/Orient.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Orient.h new file mode 100644 index 0000000000..7670fedb28 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Orient.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_ORIENT_INCLUDE_H_ +#define OOX_LIMIT_ORIENT_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class Orient : public setter::from + { + public: + Orient(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_ORIENT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/PictName.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/PictName.cpp new file mode 100644 index 0000000000..e30846f7a6 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/PictName.cpp @@ -0,0 +1,27 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "PictName.h" + + +namespace OOX +{ + namespace Limit + { + + PictName::PictName() + { + add("pict"); + add("object"); + } + + + const std::string PictName::no_find() const + { + return "pict"; + } + + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/PictName.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/PictName.h new file mode 100644 index 0000000000..297afb57bf --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/PictName.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_PICT_NAME_INCLUDE_H_ +#define OOX_LIMIT_PICT_NAME_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class PictName : public setter::from + { + public: + PictName(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_PICT_NAME_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/Position.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Position.cpp new file mode 100644 index 0000000000..17bfabcd2e --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Position.cpp @@ -0,0 +1,23 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Position.h" + + +namespace OOX +{ + namespace Limit + { + Position::Position() + { + add("absolute"); + } + + const std::string Position::no_find() const + { + return "absolute"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/Position.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Position.h new file mode 100644 index 0000000000..03068f90a6 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Position.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_POSITION_INCLUDE_H_ +#define OOX_LIMIT_POSITION_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class Position : public setter::from + { + public: + Position(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_POSITION_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/Prst.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Prst.cpp new file mode 100644 index 0000000000..ef51dc0dba --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Prst.cpp @@ -0,0 +1,23 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Prst.h" + + +namespace OOX +{ + namespace Limit + { + Prst::Prst() + { + add("rect"); + } + + const std::string Prst::no_find() const + { + return "rect"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/Prst.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Prst.h new file mode 100644 index 0000000000..118d5bd6e8 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Prst.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_PRST_INCLUDE_H_ +#define OOX_LIMIT_PRST_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class Prst : public setter::from + { + public: + Prst(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_PRST_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/PrstClrVal.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/PrstClrVal.cpp new file mode 100644 index 0000000000..13725af414 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/PrstClrVal.cpp @@ -0,0 +1,23 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "PrstClrVal.h" + + +namespace OOX +{ + namespace Limit + { + PrstClrVal::PrstClrVal() + { + add("black"); + } + + const std::string PrstClrVal::no_find() const + { + return "black"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/PrstClrVal.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/PrstClrVal.h new file mode 100644 index 0000000000..dbdee1765b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/PrstClrVal.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_PRST_CLR_VAL_INCLUDE_H_ +#define OOX_LIMIT_PRST_CLR_VAL_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class PrstClrVal : public setter::from + { + public: + PrstClrVal(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_PRST_CLR_VAL_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/RelativeFrom.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/RelativeFrom.cpp new file mode 100644 index 0000000000..f3e0dc77bc --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/RelativeFrom.cpp @@ -0,0 +1,24 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "RelativeFrom.h" + + +namespace OOX +{ + namespace Limit + { + RelativeFrom::RelativeFrom() + { + add("column"); + add("paragraph"); + } + + const std::string RelativeFrom::no_find() const + { + return "column"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/RelativeFrom.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/RelativeFrom.h new file mode 100644 index 0000000000..c6f5fc0fe8 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/RelativeFrom.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_RELATIVE_FROM_INCLUDE_H_ +#define OOX_LIMIT_RELATIVE_FROM_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class RelativeFrom : public setter::from + { + public: + RelativeFrom(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_RELATIVE_FROM_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/SectPrType.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/SectPrType.cpp new file mode 100644 index 0000000000..c7a50cc019 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/SectPrType.cpp @@ -0,0 +1,27 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "SectPrType.h" + + +namespace OOX +{ + namespace Limit + { + SectPrType::SectPrType() + { + add("continuous"); + add("nextColumn"); + add("nextPage"); + add("evenPage"); + add("oddPage"); + } + + const std::string SectPrType::no_find() const + { + return "nextPage"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/SectPrType.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/SectPrType.h new file mode 100644 index 0000000000..bdfc93a688 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/SectPrType.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_SECT_PR_TYPE_INCLUDE_H_ +#define OOX_LIMIT_SECT_PR_TYPE_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class SectPrType : public setter::from + { + public: + SectPrType(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_SECT_PR_TYPE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/SeparatorType.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/SeparatorType.cpp new file mode 100644 index 0000000000..d1961f1d96 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/SeparatorType.cpp @@ -0,0 +1,24 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "SeparatorType.h" + + +namespace OOX +{ + namespace Limit + { + SeparatorType::SeparatorType() + { + add("separator"); + add("continuationSeparator"); + } + + const std::string SeparatorType::no_find() const + { + return "separator"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/SeparatorType.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/SeparatorType.h new file mode 100644 index 0000000000..a3a6d8b706 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/SeparatorType.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_SEPARATOR_TYPE_INCLUDE_H_ +#define OOX_LIMIT_SEPARATOR_TYPE_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class SeparatorType : public setter::from + { + public: + SeparatorType(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_SEPARATOR_TYPE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/Suffix.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Suffix.cpp new file mode 100644 index 0000000000..8b13bf2bc7 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Suffix.cpp @@ -0,0 +1,25 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Suffix.h" + + +namespace OOX +{ + namespace Limit + { + Suffix::Suffix() + { + add("tab"); + add("space"); + add("nothing"); + } + + const std::string Suffix::no_find() const + { + return "nothing"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/Suffix.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Suffix.h new file mode 100644 index 0000000000..a9a3bcbb44 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/Suffix.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_SUFFIX_INCLUDE_H_ +#define OOX_LIMIT_SUFFIX_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class Suffix : public setter::from + { + public: + Suffix(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_SUFFIX_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/TabVal.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TabVal.cpp new file mode 100644 index 0000000000..78d7584371 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TabVal.cpp @@ -0,0 +1,29 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TabVal.h" + + +namespace OOX +{ + namespace Limit + { + TabVal::TabVal() + { + add("bar"); + add("center"); + add("clear"); + add("decimal"); + add("left"); + add("num"); + add("right"); + } + + const std::string TabVal::no_find() const + { + return "clear"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/TabVal.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TabVal.h new file mode 100644 index 0000000000..a3f9179af1 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TabVal.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_TAB_VAL_INCLUDE_H_ +#define OOX_LIMIT_TAB_VAL_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class TabVal : public setter::from + { + public: + TabVal(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_TAB_VAL_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/TableCellWidthType.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TableCellWidthType.cpp new file mode 100644 index 0000000000..c19944d202 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TableCellWidthType.cpp @@ -0,0 +1,23 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TableCellWidthType.h" + + +namespace OOX +{ + namespace Limit + { + TableCellWidthType::TableCellWidthType() + { + add("dxa"); + } + + const std::string TableCellWidthType::no_find() const + { + return "dxa"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/TableCellWidthType.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TableCellWidthType.h new file mode 100644 index 0000000000..9b0cbbe379 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TableCellWidthType.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_TABLE_CELL_WIDTH_TYPE_INCLUDE_H_ +#define OOX_LIMIT_TABLE_CELL_WIDTH_TYPE_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class TableCellWidthType : public setter::from + { + public: + TableCellWidthType(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_TABLE_CELL_WIDTH_TYPE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/TableRowHeightRule.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TableRowHeightRule.cpp new file mode 100644 index 0000000000..934034a95b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TableRowHeightRule.cpp @@ -0,0 +1,25 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TableRowHeightRule.h" + + +namespace OOX +{ + namespace Limit + { + TableRowHeightRule::TableRowHeightRule() + { + add("auto"); + add("atLeast"); + add("exact"); + } + + const std::string TableRowHeightRule::no_find() const + { + return "auto"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/TableRowHeightRule.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TableRowHeightRule.h new file mode 100644 index 0000000000..818b5286f9 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TableRowHeightRule.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_TABLE_ROW_HEIGHT_RULE_INCLUDE_H_ +#define OOX_LIMIT_TABLE_ROW_HEIGHT_RULE_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class TableRowHeightRule : public setter::from + { + public: + TableRowHeightRule(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_TABLE_ROW_HEIGHT_RULE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/TableStyleType.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TableStyleType.cpp new file mode 100644 index 0000000000..f21da0d773 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TableStyleType.cpp @@ -0,0 +1,35 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TableStyleType.h" + + +namespace OOX +{ + namespace Limit + { + TableStyleType::TableStyleType() + { + add("band1Horz"); + add("band1Vert"); + add("band2Horz"); + add("band2Vert"); + add("firstCol"); + add("firstRow"); + add("lastCol"); + add("lastRow"); + add("neCell"); + add("nwCell"); + add("seCell"); + add("swCell"); + add("wholeTable"); + } + + const std::string TableStyleType::no_find() const + { + return "wholeTable"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/TableStyleType.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TableStyleType.h new file mode 100644 index 0000000000..19a9aece50 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TableStyleType.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_TABLE_STYLE_TYPE_INCLUDE_H_ +#define OOX_LIMIT_TABLE_STYLE_TYPE_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class TableStyleType : public setter::from + { + public: + TableStyleType(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_TABLE_STYLE_TYPE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/TableWidthType.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TableWidthType.cpp new file mode 100644 index 0000000000..25b48d01ad --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TableWidthType.cpp @@ -0,0 +1,26 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TableWidthType.h" + + +namespace OOX +{ + namespace Limit + { + TableWidthType::TableWidthType() + { + add( "nil" ); + add( "auto" ); + add( "pct" ); + add( "dxa" ); + } + + const std::string TableWidthType::no_find() const + { + return "auto"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/TableWidthType.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TableWidthType.h new file mode 100644 index 0000000000..2dfd688cad --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TableWidthType.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_TABLE_WIDTH_TYPE_INCLUDE_H_ +#define OOX_LIMIT_TABLE_WIDTH_TYPE_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class TableWidthType : public setter::from + { + public: + TableWidthType(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_TABLE_WIDTH_TYPE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/TextAlignment.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TextAlignment.cpp new file mode 100644 index 0000000000..124f5d246e --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TextAlignment.cpp @@ -0,0 +1,23 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TextAlignment.h" + + +namespace OOX +{ + namespace Limit + { + TextAlignment::TextAlignment() + { + add("baseline"); + } + + const std::string TextAlignment::no_find() const + { + return "none"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/TextAlignment.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TextAlignment.h new file mode 100644 index 0000000000..5922416657 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TextAlignment.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_TEXT_ALIGNMENT_INCLUDE_H_ +#define OOX_LIMIT_TEXT_ALIGNMENT_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class TextAlignment : public setter::from + { + public: + TextAlignment(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_TEXT_ALIGNMENT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/TextFrameType.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TextFrameType.cpp new file mode 100644 index 0000000000..008c70b2fa --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TextFrameType.cpp @@ -0,0 +1,28 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TextFrameType.h" + + +namespace OOX +{ + namespace Limit + { + TextFrameType::TextFrameType() + { + add("auto"); + add("notBeside"); + add("around"); + add("none"); + add("tight"); + add("through"); + } + + const std::string TextFrameType::no_find() const + { + return "none"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/TextFrameType.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TextFrameType.h new file mode 100644 index 0000000000..72aba7cdfe --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TextFrameType.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_TEXT_FRAME_TYPE_INCLUDE_H_ +#define OOX_LIMIT_TEXT_FRAME_TYPE_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class TextFrameType : public setter::from + { + public: + TextFrameType(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_TEXT_FRAME_TYPE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/TextWrapType.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TextWrapType.cpp new file mode 100644 index 0000000000..6e7a2005ec --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TextWrapType.cpp @@ -0,0 +1,26 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TextWrapType.h" + + +namespace OOX +{ + namespace Limit + { + TextWrapType::TextWrapType() + { + add("bothSides"); + add("left"); + add("right"); + add("largest"); + } + + const std::string TextWrapType::no_find() const + { + return "bothSides"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/TextWrapType.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TextWrapType.h new file mode 100644 index 0000000000..52239c141c --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TextWrapType.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_TEXTWRAPTYPE_INCLUDE_H_ +#define OOX_LIMIT_TEXTWRAPTYPE_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class TextWrapType : public setter::from + { + public: + TextWrapType(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_TEXTWRAPTYPE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/TrueFalse.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TrueFalse.cpp new file mode 100644 index 0000000000..6872a2aa25 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TrueFalse.cpp @@ -0,0 +1,24 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TrueFalse.h" + + +namespace OOX +{ + namespace Limit + { + TrueFalse::TrueFalse() + { + add("t"); + add("f"); + } + + const std::string TrueFalse::no_find() const + { + return "f"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/TrueFalse.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TrueFalse.h new file mode 100644 index 0000000000..40e9cef24a --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TrueFalse.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_TRUE_FALSE_INCLUDE_H_ +#define OOX_LIMIT_TRUE_FALSE_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class TrueFalse : public setter::from + { + public: + TrueFalse(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_TRUE_FALSE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/TypeFootHead.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TypeFootHead.cpp new file mode 100644 index 0000000000..e1ebaf31d2 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TypeFootHead.cpp @@ -0,0 +1,25 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TypeFootHead.h" + + +namespace OOX +{ + namespace Limit + { + TypeFootHead::TypeFootHead() + { + add("even"); + add("default"); + add("first"); + } + + const std::string TypeFootHead::no_find() const + { + return "default"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/TypeFootHead.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TypeFootHead.h new file mode 100644 index 0000000000..99a8ae5160 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/TypeFootHead.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_TYPE_FOOT_HEAD_INCLUDE_H_ +#define OOX_LIMIT_TYPE_FOOT_HEAD_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class TypeFootHead : public setter::from + { + public: + TypeFootHead(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_TYPE_FOOT_HEAD_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/UnderType.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/UnderType.cpp new file mode 100644 index 0000000000..ca36d8d785 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/UnderType.cpp @@ -0,0 +1,40 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "UnderType.h" + + +namespace OOX +{ + namespace Limit + { + UnderType::UnderType() + { + add("single"); + add("words"); + add("double"); + add("thick"); + add("dotted"); + add("dottedHeavy"); + add("dash"); + add("dashedHeavy"); + add("dashLong"); + add("dashLongHeavy"); + add("dotDash"); + add("dashDotHeavy"); + add("dotDotDash"); + add("dashDotDotHeavy"); + add("wave"); + add("wavyHeavy"); + add("wavyDouble"); + add("none"); + } + + const std::string UnderType::no_find() const + { + return "none"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/UnderType.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/UnderType.h new file mode 100644 index 0000000000..8b255d9601 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/UnderType.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_UNDERTYPE_INCLUDE_H_ +#define OOX_LIMIT_UNDERTYPE_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class UnderType : public setter::from + { + public: + UnderType(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_UNDERTYPE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/VMergeVal.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/VMergeVal.cpp new file mode 100644 index 0000000000..f83187b0bd --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/VMergeVal.cpp @@ -0,0 +1,24 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "VMergeVal.h" + + +namespace OOX +{ + namespace Limit + { + VMergeVal::VMergeVal() + { + add("restart"); + add("continue"); + } + + const std::string VMergeVal::no_find() const + { + return "restart"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/VMergeVal.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/VMergeVal.h new file mode 100644 index 0000000000..a79662b4d7 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/VMergeVal.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_V_MERGE_VAL_INCLUDE_H_ +#define OOX_LIMIT_V_MERGE_VAL_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class VMergeVal : public setter::from + { + public: + VMergeVal(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_V_MERGE_VAL_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/VerticalAlign.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/VerticalAlign.cpp new file mode 100644 index 0000000000..3623168496 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/VerticalAlign.cpp @@ -0,0 +1,25 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "VerticalAlign.h" + + +namespace OOX +{ + namespace Limit + { + VerticalAlign::VerticalAlign() + { + add("top"); + add("center"); + add("bottom"); + } + + const std::string VerticalAlign::no_find() const + { + return "top"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/VerticalAlign.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/VerticalAlign.h new file mode 100644 index 0000000000..5248d746e6 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/VerticalAlign.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_VERTICAL_ALIGN_INCLUDE_H_ +#define OOX_LIMIT_VERTICAL_ALIGN_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class VerticalAlign : public setter::from + { + public: + VerticalAlign(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_VERTICAL_ALIGN_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/VerticalAnchorLocation.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Limit/VerticalAnchorLocation.cpp new file mode 100644 index 0000000000..7ee102c731 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/VerticalAnchorLocation.cpp @@ -0,0 +1,26 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "VerticalAnchorLocation.h" + + +namespace OOX +{ + namespace Limit + { + VerticalAnchorLocation::VerticalAnchorLocation() + { + add("margin"); + add("page"); + add("text"); + add("none"); + } + + const std::string VerticalAnchorLocation::no_find() const + { + return "text"; + } + } // namespace Limit +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Limit/VerticalAnchorLocation.h b/ASCOfficeOdtFile/Source/DocxFormat/Limit/VerticalAnchorLocation.h new file mode 100644 index 0000000000..16a3fa52ef --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Limit/VerticalAnchorLocation.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_LIMIT_VERTICAL_ANCHOR_LOCATION_INCLUDE_H_ +#define OOX_LIMIT_VERTICAL_ANCHOR_LOCATION_INCLUDE_H_ + +#include "setter.h" +#include + + +namespace OOX +{ + namespace Limit + { + class VerticalAnchorLocation : public setter::from + { + public: + VerticalAnchorLocation(); + + private: + virtual const std::string no_find() const; + }; + } // namespace Limit +} // namespace OOX + +#endif // OOX_LIMIT_VERTICAL_ANCHOR_LOCATION_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Align.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Align.cpp new file mode 100644 index 0000000000..d3e70b3173 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Align.cpp @@ -0,0 +1,76 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Align.h" + + +namespace OOX +{ + namespace Logic + { + + Align::Align() + { + } + + + Align::Align(const Common::Align& align) + { + fromBase(align); + } + + + Align::Align(const std::string& value) + { + fromString(value); + } + + + const Align& Align::operator= (const Common::Align& align) + { + fromBase(align); + return *this; + } + + + const Align& Align::operator= (const std::string& value) + { + fromString(value); + return *this; + } + + + const std::string Align::ToString() const + { + switch (type()) + { + case left: + return "left"; + case center: + return "center"; + case right: + return "right"; + case both: + return "both"; + default: + return "left"; + } + } + + + void Align::fromString(const std::string& value) + { + if (value == "center") + setCenter(); + else if (value == "right") + setRight(); + else if (value == "both") + setBoth(); + else + setLeft(); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Align.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Align.h new file mode 100644 index 0000000000..45d93a554b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Align.h @@ -0,0 +1,30 @@ +#pragma once +#ifndef OOX_LOGIC_ALIGN_INCLUDE_H_ +#define OOX_LOGIC_ALIGN_INCLUDE_H_ + +#include +#include "Common.h" + + +namespace OOX +{ + namespace Logic + { + class Align : public Common::Align + { + public: + Align(); + Align(const Common::Align& align); + Align(const std::string& value); + + const Align& operator= (const Common::Align& align); + const Align& operator= (const std::string& value); + + public: + const std::string ToString() const; + void fromString(const std::string& value); + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_ALIGN_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Background.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Background.cpp new file mode 100644 index 0000000000..a9c1c036da --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Background.cpp @@ -0,0 +1,57 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Background.h" + + +namespace OOX +{ + namespace Logic + { + + Background::Background() + { + } + + + Background::~Background() + { + } + + + Background::Background(const XML::XNode& node) + { + fromXML(node); + } + + + const Background& Background::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Background::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Color = element.attribute("color").value(); + ThemeColor = element.attribute("themeColor").value(); + ThemeShade = element.attribute("themeShade").value(); + } + + + const XML::XNode Background::toXML() const + { + return + XML::XElement(ns.w + "background", + XML::XAttribute(ns.w + "color", Color) + + XML::XAttribute(ns.w + "themeColor", ThemeColor) + + XML::XAttribute(ns.w + "themeShade", ThemeShade) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Background.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Background.h new file mode 100644 index 0000000000..66dc859e3c --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Background.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef OOX_LOGIC_BACKGROUND_INCLUDE_H_ +#define OOX_LOGIC_BACKGROUND_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "property.h" +#include "Color.h" + + +namespace OOX +{ + namespace Logic + { + class Background : public WritingElement + { + public: + Background(); + virtual ~Background(); + explicit Background(const XML::XNode& node); + const Background& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Color; + nullable_property ThemeColor; + nullable_property ThemeShade; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_BACKGROUND_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/BackgroundColor.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/BackgroundColor.cpp new file mode 100644 index 0000000000..c147939e0f --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/BackgroundColor.cpp @@ -0,0 +1,61 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "BackgroundColor.h" +#include "ColorsTable.h" + + +namespace OOX +{ + namespace Logic + { + + static const ColorsTable s_colors; + + + BackgroundColor::BackgroundColor() + { + } + + + BackgroundColor::BackgroundColor(const Common::Color& color) + { + fromBase(color); + } + + + BackgroundColor::BackgroundColor(const std::string& value) + { + fromString(value); + } + + + const BackgroundColor& BackgroundColor::operator= (const Common::Color& color) + { + fromBase(color); + return *this; + } + + + const BackgroundColor& BackgroundColor::operator= (const std::string& value) + { + fromString(value); + return *this; + } + + + const std::string BackgroundColor::ToString() const + { + return s_colors.fromColor(*this); + } + + + void BackgroundColor::fromString(const std::string& value) + { + *this = s_colors.fromName(value); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/BackgroundColor.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/BackgroundColor.h new file mode 100644 index 0000000000..71fbcd8d14 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/BackgroundColor.h @@ -0,0 +1,30 @@ +#pragma once +#ifndef OOX_LOGIC_BACKGROUND_COLOR_INCLUDE_H_ +#define OOX_LOGIC_BACKGROUND_COLOR_INCLUDE_H_ + +#include "Common.h" +#include + + +namespace OOX +{ + namespace Logic + { + class BackgroundColor : public Common::Color + { + public: + BackgroundColor(); + BackgroundColor(const Common::Color& color); + BackgroundColor(const std::string& value); + + const BackgroundColor& operator= (const Common::Color& color); + const BackgroundColor& operator= (const std::string& value); + + public: + const std::string ToString() const; + void fromString(const std::string& value); + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_BACKGROUND_COLOR_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkEnd.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkEnd.cpp new file mode 100644 index 0000000000..566938de27 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkEnd.cpp @@ -0,0 +1,58 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "BookmarkEnd.h" + + +namespace OOX +{ + namespace Logic + { + + BookmarkEnd::BookmarkEnd() + { + } + + + BookmarkEnd::~BookmarkEnd() + { + } + + + BookmarkEnd::BookmarkEnd(const XML::XNode& node) + { + fromXML(node); + } + + + const BookmarkEnd& BookmarkEnd::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void BookmarkEnd::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Id = element.attribute("id").value(); + } + + + const XML::XNode BookmarkEnd::toXML() const + { + return + XML::XElement(ns.w + "bookmarkEnd", + XML::XAttribute(ns.w + "id", Id) + ); + } + + + const std::string BookmarkEnd::toTxt() const + { + return ""; + } + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkEnd.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkEnd.h new file mode 100644 index 0000000000..cb00b990fa --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkEnd.h @@ -0,0 +1,34 @@ +#pragma once +#ifndef OOX_LOGIC_BOOKMARK_END_INCLUDE_H_ +#define OOX_LOGIC_BOOKMARK_END_INCLUDE_H_ + +#include "ParagraphItemBase.h" +#include "property.h" + + +namespace OOX +{ + namespace Logic + { + class BookmarkEnd : public ParagraphItemBase + { + public: + BookmarkEnd(); + virtual ~BookmarkEnd(); + explicit BookmarkEnd(const XML::XNode& node); + const BookmarkEnd& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + virtual const std::string toTxt() const; + + public: + property Id; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_BOOKMARK_END_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkEndParagraph.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkEndParagraph.cpp new file mode 100644 index 0000000000..bc9c8c02a8 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkEndParagraph.cpp @@ -0,0 +1,59 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "BookmarkEndParagraph.h" + + +namespace OOX +{ + namespace Logic + { + + BookmarkEndParagraph::BookmarkEndParagraph() + { + } + + + BookmarkEndParagraph::~BookmarkEndParagraph() + { + } + + + BookmarkEndParagraph::BookmarkEndParagraph(const XML::XNode& node) + { + fromXML(node); + } + + + const BookmarkEndParagraph& BookmarkEndParagraph::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void BookmarkEndParagraph::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Id = element.attribute("id").value(); + } + + + const XML::XNode BookmarkEndParagraph::toXML() const + { + return + XML::XElement(ns.w + "bookmarkEnd", + XML::XAttribute(ns.w + "id", Id) + ); + } + + + const std::string BookmarkEndParagraph::toTxt() const + { + return ""; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkEndParagraph.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkEndParagraph.h new file mode 100644 index 0000000000..233ca1d16f --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkEndParagraph.h @@ -0,0 +1,34 @@ +#pragma once +#ifndef OOX_LOGIC_BOOKMARK_END_PARAGRAPH_INCLUDE_H_ +#define OOX_LOGIC_BOOKMARK_END_PARAGRAPH_INCLUDE_H_ + +#include "TextItemBase.h" +#include "property.h" + + +namespace OOX +{ + namespace Logic + { + class BookmarkEndParagraph : public TextItemBase + { + public: + BookmarkEndParagraph(); + virtual ~BookmarkEndParagraph(); + explicit BookmarkEndParagraph(const XML::XNode& node); + const BookmarkEndParagraph& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + virtual const std::string toTxt() const; + + public: + property Id; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_BOOKMARK_END_PARAGRAPH_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkStart.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkStart.cpp new file mode 100644 index 0000000000..8f9480c993 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkStart.cpp @@ -0,0 +1,81 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "BookmarkStart.h" + + +namespace OOX +{ + namespace Logic + { + + BookmarkStart::BookmarkStart() + { + } + + + BookmarkStart::~BookmarkStart() + { + } + + + + BookmarkStart::BookmarkStart(const std::string& text) + { + fromTxt(text); + } + + + BookmarkStart::BookmarkStart(const XML::XNode& node) + { + fromXML(node); + } + + + const BookmarkStart& BookmarkStart::operator =(const std::string& text) + { + fromTxt(text); + return *this; + } + + + const BookmarkStart& BookmarkStart::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void BookmarkStart::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Id = element.attribute("id").value(); + Name = element.attribute("name").value(); + } + + + const XML::XNode BookmarkStart::toXML() const + { + return + XML::XElement(ns.w + "bookmarkStart", + XML::XAttribute(ns.w + "id", Id) + + XML::XAttribute(ns.w + "name", Name) + ); + } + + + void BookmarkStart::fromTxt(const std::string& text) + { + Name = text; + } + + + const std::string BookmarkStart::toTxt() const + { + return ""; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkStart.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkStart.h new file mode 100644 index 0000000000..2b0a7787d1 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkStart.h @@ -0,0 +1,39 @@ +#pragma once +#ifndef OOX_LOGIC_BOOKMARK_START_INCLUDE_H_ +#define OOX_LOGIC_BOOKMARK_START_INCLUDE_H_ + +#include "ParagraphItemBase.h" +#include "property.h" +#include + + +namespace OOX +{ + namespace Logic + { + class BookmarkStart : public ParagraphItemBase + { + public: + BookmarkStart(); + virtual ~BookmarkStart(); + explicit BookmarkStart(const std::string& text); + explicit BookmarkStart(const XML::XNode& node); + const BookmarkStart& operator =(const std::string& text); + const BookmarkStart& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + virtual void fromTxt(const std::string& text); + virtual const std::string toTxt() const; + + public: + property Id; + property Name; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_BOOKMARK_START_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkStartParagraph.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkStartParagraph.cpp new file mode 100644 index 0000000000..b52231ffa8 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkStartParagraph.cpp @@ -0,0 +1,61 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "BookmarkStartParagraph.h" + + +namespace OOX +{ + namespace Logic + { + + BookmarkStartParagraph::BookmarkStartParagraph() + { + } + + + BookmarkStartParagraph::~BookmarkStartParagraph() + { + } + + + BookmarkStartParagraph::BookmarkStartParagraph(const XML::XNode& node) + { + fromXML(node); + } + + + const BookmarkStartParagraph& BookmarkStartParagraph::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void BookmarkStartParagraph::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Id = element.attribute("id").value(); + Name = element.attribute("name").value(); + } + + + const XML::XNode BookmarkStartParagraph::toXML() const + { + return + XML::XElement(ns.w + "bookmarkStart", + XML::XAttribute(ns.w + "id", Id) + + XML::XAttribute(ns.w + "name", Name) + ); + } + + + const std::string BookmarkStartParagraph::toTxt() const + { + return ""; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkStartParagraph.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkStartParagraph.h new file mode 100644 index 0000000000..ce5e7442eb --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/BookmarkStartParagraph.h @@ -0,0 +1,36 @@ +#pragma once +#ifndef OOX_LOGIC_BOOKMARK_START_PARAGRAPH_INCLUDE_H_ +#define OOX_LOGIC_BOOKMARK_START_PARAGRAPH_INCLUDE_H_ + +#include "TextItemBase.h" +#include "property.h" +#include + + +namespace OOX +{ + namespace Logic + { + class BookmarkStartParagraph : public TextItemBase + { + public: + BookmarkStartParagraph(); + virtual ~BookmarkStartParagraph(); + explicit BookmarkStartParagraph(const XML::XNode& node); + const BookmarkStartParagraph& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + virtual const std::string toTxt() const; + + public: + property Id; + property Name; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_BOOKMARK_START_PARAGRAPH_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Border.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Border.cpp new file mode 100644 index 0000000000..a92f487271 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Border.cpp @@ -0,0 +1,72 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Border.h" + + +namespace OOX +{ + namespace Logic + { + + Border::Border() + { + } + + + Border::~Border() + { + } + + + Border::Border(const XML::XNode& node) + { + fromXML(node); + } + + + Border::Border(const std::string& name, const BorderItem& border) + : Name(name), + Bdr(border) + { + } + + + const Border& Border::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Border::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Name = element.XName->Name; + Bdr->Value = element.attribute("val").value(); + if (element.attribute("sz").value().ToString() == "auto") + Bdr->Sz = 0; + else + Bdr->Sz = element.attribute("sz").value(); + Bdr->Space = element.attribute("space").value(); + Bdr->Color = element.attribute("color").value(); + Bdr->ThemeColor = element.attribute("themeColor").value(); + } + + + const XML::XNode Border::toXML() const + { + return + XML::XElement(ns.w + Name.ToString(), + XML::XAttribute(ns.w + "val", Bdr->Value) + + XML::XAttribute(ns.w + "sz", Bdr->Sz) + + XML::XAttribute(ns.w + "space", Bdr->Space) + + XML::XAttribute(ns.w + "color", Bdr->Color) + + XML::XAttribute(ns.w + "themeColor", Bdr->ThemeColor) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Border.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Border.h new file mode 100644 index 0000000000..ae9b799e6c --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Border.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef OOX_LOGIC_TABLE_BORDER_INCLUDE_H_ +#define OOX_LOGIC_TABLE_BORDER_INCLUDE_H_ + +#include "property.h" +#include "./../WritingElement.h" + +#include "BorderItem.h" +#include "./../Limit/BorderName.h" + +namespace OOX +{ + namespace Logic + { + class Border : public WritingElement + { + public: + Border(); + virtual ~Border(); + explicit Border(const XML::XNode& node); + Border(const std::string& name, const BorderItem& border); + const Border& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Name; + property Bdr; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_TABLE_BORDER_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/BorderItem.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/BorderItem.cpp new file mode 100644 index 0000000000..2afb1ae759 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/BorderItem.cpp @@ -0,0 +1,23 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "BorderItem.h" + + +namespace OOX +{ + namespace Logic + { + + BorderItem::BorderItem() + { + } + + + BorderItem::~BorderItem() + { + } + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/BorderItem.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/BorderItem.h new file mode 100644 index 0000000000..ba1647b87b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/BorderItem.h @@ -0,0 +1,32 @@ +#pragma once +#ifndef OOX_LOGIC_BORDER_ITEM_INCLUDE_H_ +#define OOX_LOGIC_BORDER_ITEM_INCLUDE_H_ + +#include +#include "Color.h" +#include "./../Limit/BorderValue.h" +#include "./../Unit.h" +#include "property.h" +#include "nullable_property.h" + +namespace OOX +{ + namespace Logic + { + class BorderItem + { + public: + BorderItem(); + ~BorderItem(); + + public: + property Value; + nullable_property Sz; + nullable_property Space; + nullable_property Color; + nullable_property ThemeColor; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_BORDER_ITEM_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Bottom.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Bottom.cpp new file mode 100644 index 0000000000..f7deaa58e7 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Bottom.cpp @@ -0,0 +1,62 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Bottom.h" + + +namespace OOX +{ + namespace Logic + { + + Bottom::Bottom() + { + } + + + Bottom::~Bottom() + { + } + + + Bottom::Bottom(const XML::XNode& node) + { + fromXML(node); + } + + + const Bottom& Bottom::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Bottom::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Value = element.attribute("val").value(); + Space = element.attribute("space").value(); + Size = element.attribute("sz").value(); + Color = element.attribute("color").value(); + ThemeColor = element.attribute("themeColor").value(); + ThemeShade = element.attribute("themeShade").value(); + } + + + const XML::XNode Bottom::toXML() const + { + return + XML::XElement(ns.w + "bottom", + XML::XAttribute(ns.w + "val", Value) + + XML::XAttribute(ns.w + "space", Space) + + XML::XAttribute(ns.w + "sz", Size) + + XML::XAttribute(ns.w + "color", Color) + + XML::XAttribute(ns.w + "themeColor", ThemeColor) + + XML::XAttribute(ns.w + "themeShade", ThemeShade) + ); + } + } // namespace Logic +} // namespace OOX diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Bottom.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Bottom.h new file mode 100644 index 0000000000..34df680936 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Bottom.h @@ -0,0 +1,38 @@ +#pragma once +#ifndef OOX_LOGIC_BOTTOM_INCLUDE_H_ +#define OOX_LOGIC_BOTTOM_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "Color.h" +#include "nullable.h" + + +namespace OOX +{ + namespace Logic + { + class Bottom : public WritingElement + { + public: + Bottom(); + virtual ~Bottom(); + explicit Bottom(const XML::XNode& node); + const Bottom& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property Value; + nullable_property Space; + nullable_property Size; + nullable_property Color; + nullable_property ThemeColor; + nullable_property ThemeShade; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_BOTTOM_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Break.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Break.cpp new file mode 100644 index 0000000000..578decfa6b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Break.cpp @@ -0,0 +1,82 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Break.h" + + +namespace OOX +{ + namespace Logic + { + + Break::Break() + { + } + + + Break::~Break() + { + } + + + Break::Break(const std::string& text) + { + fromTxt(text); + } + + + Break::Break(const XML::XNode& node) + { + fromXML(node); + } + + + const Break& Break::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + const Break& Break::operator =(const std::string& text) + { + fromTxt(text); + return *this; + } + + + void Break::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Type = element.attribute("type").value(); + Clear = element.attribute("clear").value(); + } + + + void Break::fromTxt(const std::string& text) + { + Type = text; + } + + + const XML::XNode Break::toXML() const + { + return + XML::XElement(ns.w + "br", + XML::XAttribute(ns.w + "type", Type) + + XML::XAttribute(ns.w + "clear", Clear) + ); + } + + + const std::string Break::toTxt() const + { + if (!Type.is_init()) + return "\n"; + return ""; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Break.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Break.h new file mode 100644 index 0000000000..ee3450702f --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Break.h @@ -0,0 +1,37 @@ +#pragma once +#ifndef OOX_LOGIC_BREAK_INCLUDE_H_ +#define OOX_LOGIC_BREAK_INCLUDE_H_ + +#include "RunItemBase.h" +#include "./../Limit/BreakType.h" +#include "./../Limit/BreakClear.h" + + +namespace OOX +{ + namespace Logic + { + class Break : public RunItemBase + { + public: + Break(); + virtual ~Break(); + explicit Break(const std::string& text); + explicit Break(const XML::XNode& node); + const Break& operator =(const XML::XNode& node); + const Break& operator =(const std::string& text); + + public: + virtual void fromXML(const XML::XNode& node); + virtual void fromTxt(const std::string& text); + virtual const XML::XNode toXML() const; + virtual const std::string toTxt() const; + + public: + nullable_property Type; + nullable_property Clear; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_BREAK_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/CellMarginItem.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/CellMarginItem.cpp new file mode 100644 index 0000000000..5c6f030cb2 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/CellMarginItem.cpp @@ -0,0 +1,30 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "CellMarginItem.h" + + +namespace OOX +{ + namespace Logic + { + + CellMarginItem::CellMarginItem() + { + } + + CellMarginItem::CellMarginItem(int width, const std::string& typeMar) + :W(width), + Type(typeMar) + { + } + + + + CellMarginItem::~CellMarginItem() + { + } + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/CellMarginItem.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/CellMarginItem.h new file mode 100644 index 0000000000..5622ebdeb6 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/CellMarginItem.h @@ -0,0 +1,28 @@ +#pragma once +#ifndef OOX_LOGIC_CELL_MARGIN_ITEM_INCLUDE_H_ +#define OOX_LOGIC_CELL_MARGIN_ITEM_INCLUDE_H_ + +#include +#include "./../Unit.h" +#include "property.h" + + +namespace OOX +{ + namespace Logic + { + class CellMarginItem + { + public: + CellMarginItem(); + CellMarginItem(int width, const std::string& typeMar); + ~CellMarginItem(); + + public: + property W; + property Type; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_CELL_MARGIN_ITEM_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Color.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Color.cpp new file mode 100644 index 0000000000..f414319624 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Color.cpp @@ -0,0 +1,86 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Color.h" +#include +#include "Parse.h" +#include "ColorsTable.h" + + +namespace OOX +{ + namespace Logic + { + static const ColorsTable s_colors; + + Color::Color() : m_Auto(false) + { + } + + + Color::Color(const Common::Color& color) : m_Auto(false) + { + fromBase(color); + } + + + Color::Color(const std::string& value) : m_Auto(false) + { + fromString(value); + } + + + const Color& Color::operator= (const Common::Color& color) + { + m_Auto = false; + fromBase(color); + return *this; + } + + const Color& Color::operator= (const Color& color) + { + m_Auto = color.m_Auto; + fromBase(color); + return *this; + } + + const Color& Color::operator= (const std::string& value) + { + fromString(value); + return *this; + } + + + const std::string Color::ToString() const + { + if (m_Auto) + { + return "auto"; + } + else + return (boost::format("%02x%02x%02x") % Red % Green % Blue).str(); + } + + + void Color::fromString(const std::string& value) + { + if (value == "auto") + { + m_Auto = true; + } + else if(s_colors.isFromName(value)) + { + *this = s_colors.fromName(value); + } + else + { + Red = HexString2Int(value.substr(0, 2)); + Green = HexString2Int(value.substr(2, 2)); + Blue = HexString2Int(value.substr(4, 2)); + } + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Color.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Color.h new file mode 100644 index 0000000000..7756f6f7ea --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Color.h @@ -0,0 +1,34 @@ +#pragma once +#ifndef OOX_LOGIC_COLOR_INCLUDE_H_ +#define OOX_LOGIC_COLOR_INCLUDE_H_ + +#include +#include "Common.h" + +namespace OOX +{ + namespace Logic + { + class Color : public Common::Color + { + public: + Color(); + Color(const Common::Color& color); + Color(const std::string& value); + + const Color& operator= (const Color& color); + const Color& operator= (const Common::Color& color); + const Color& operator= (const std::string& value); + + bool isAuto() const { return m_Auto; } + + public: + const std::string ToString() const; + void fromString(const std::string& value); + private: + bool m_Auto; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_COLOR_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/ColorsTable.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ColorsTable.cpp new file mode 100644 index 0000000000..1503b9aa01 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ColorsTable.cpp @@ -0,0 +1,83 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ColorsTable.h" +#include +#include "math.h" + + +namespace OOX +{ + namespace Logic + { + ColorsTable::ColorsTable() + { + m_storage.push_back(std::make_pair("black", Common::Color(0x00, 0x00, 0x00))); + m_storage.push_back(std::make_pair("blue", Common::Color(0x00, 0x00, 0xFF))); + m_storage.push_back(std::make_pair("cyan", Common::Color(0x00, 0xFF, 0xFF))); + m_storage.push_back(std::make_pair("green", Common::Color(0x00, 0x80, 0x00))); + m_storage.push_back(std::make_pair("magenta", Common::Color(0xFF, 0x00, 0xFF))); + m_storage.push_back(std::make_pair("red", Common::Color(0xFF, 0x00, 0x00))); + m_storage.push_back(std::make_pair("yellow", Common::Color(0xFF, 0xFF, 0x00))); + m_storage.push_back(std::make_pair("white", Common::Color(0xFF, 0xFF, 0xFF))); + m_storage.push_back(std::make_pair("darkBlue", Common::Color(0x00, 0x00, 0x8B))); + m_storage.push_back(std::make_pair("darkCyan", Common::Color(0x00, 0x8B, 0x8B))); + m_storage.push_back(std::make_pair("darkGreen", Common::Color(0x00, 0x64, 0x00))); + m_storage.push_back(std::make_pair("darkMagenta", Common::Color(0x8B, 0x00, 0x8B))); + m_storage.push_back(std::make_pair("darkRed", Common::Color(0x8B, 0x00, 0x00))); + m_storage.push_back(std::make_pair("darkYellow", Common::Color(0x80, 0x80, 0x00))); + m_storage.push_back(std::make_pair("darkGray", Common::Color(0xA9, 0xA9, 0xA9))); + m_storage.push_back(std::make_pair("lightGray", Common::Color(0xD3, 0xD3, 0xD3))); + m_storage.push_back(std::make_pair("auto", Common::Color(0x00, 0x00, 0x00))); + } + + + const Common::Color ColorsTable::fromName(const std::string& name) const + { + typedef std::pair pair; + BOOST_FOREACH(const pair& value, m_storage) + { + if (value.first == name) + return value.second; + } + return Common::Color(0xFF, 0xFF, 0xFF); + } + + + const bool ColorsTable::isFromName(const std::string& name) const + { + typedef std::pair pair; + BOOST_FOREACH(const pair& value, m_storage) + { + if (value.first == name) + return true; + } + return false; + } + + + const std::string ColorsTable::fromColor(const Common::Color& color) const + { + std::string name; + int diff = 255 * 255 * 3; + + typedef std::pair pair; + BOOST_FOREACH(const pair& value, m_storage) + { + int new_diff = (color.Red - value.second.Red) * (color.Red - value.second.Red) + + (color.Green - value.second.Green) * (color.Green - value.second.Green) + + (color.Blue - value.second.Blue) * (color.Blue - value.second.Blue); + + if (new_diff < diff) + { + diff = new_diff; + name = value.first; + } + } + return name; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/ColorsTable.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ColorsTable.h new file mode 100644 index 0000000000..34f75cb643 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ColorsTable.h @@ -0,0 +1,31 @@ +#pragma once +#ifndef OOX_LOGIC_COLORS_TABLE_INCLUDE_H_ +#define OOX_LOGIC_COLORS_TABLE_INCLUDE_H_ + +#include +#include "Common.h" +#include +#include + +namespace OOX +{ + namespace Logic + { + class ColorsTable : private boost::noncopyable + { + public: + ColorsTable(); + + public: + const Common::Color fromName(const std::string& name) const; + const std::string fromColor(const Common::Color& color) const ; + + const bool isFromName(const std::string& name) const; + + private: + std::vector > m_storage; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_COLORS_TABLE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Column.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Column.cpp new file mode 100644 index 0000000000..eddf0aa3b1 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Column.cpp @@ -0,0 +1,63 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Column.h" + + +namespace OOX +{ + namespace Logic + { + + Column::Column() + { + } + + + Column::~Column() + { + } + + + Column::Column(const XML::XNode& node) + { + fromXML(node); + } + + + const Column& Column::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Column::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + //if(element.attribute("w").exist()) + //{ + int width = element.attribute("w").value().ToInt(); + Width = UniversalUnit(width, UniversalUnit::Dx); + //} + if(element.attribute("space").exist()) + { + int space = element.attribute("space").value().ToInt(); + Space = UniversalUnit(space, UniversalUnit::Dx); + } + } + + + const XML::XNode Column::toXML() const + { + return + XML::XElement(ns.w + "col", + XML::XAttribute(ns.w + "w", Width) + + XML::XAttribute(ns.w + "space", Space) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Column.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Column.h new file mode 100644 index 0000000000..dcc1b7d43c --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Column.h @@ -0,0 +1,33 @@ +#ifndef OOX_LOGIC_COLUMN_INCLUDE_H_ +#define OOX_LOGIC_COLUMN_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "Utility.h" +#include "property.h" +#include "nullable_property.h" + + +namespace OOX +{ + namespace Logic + { + class Column : public WritingElement + { + public: + Column(); + virtual ~Column(); + explicit Column(const XML::XNode& node); + const Column& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Width; + nullable_property Space; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_COLUMN_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Columns.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Columns.cpp new file mode 100644 index 0000000000..cfc88f64cd --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Columns.cpp @@ -0,0 +1,65 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Columns.h" + + +namespace OOX +{ + namespace Logic + { + + Columns::Columns() + { + } + + + Columns::~Columns() + { + } + + + Columns::Columns(const XML::XNode& node) + { + fromXML(node); + } + + + const Columns& Columns::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Columns::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Num = element.attribute("num").value(); + if(element.attribute("space").exist()) + { + int space = element.attribute("space").value().ToInt(); + Space = UniversalUnit(space, UniversalUnit::Dx); + } + EqualWidth = element.attribute("equalWidth").value(); + Sep = element.attribute("sep").value(); + Fill(Items, element, "col"); + } + + + const XML::XNode Columns::toXML() const + { + return + XML::XElement(ns.w + "cols", + XML::XAttribute(ns.w + "num", Num) + + XML::XAttribute(ns.w + "sep", Sep) + + XML::XAttribute(ns.w + "space", Space) + + XML::XAttribute(ns.w + "equalWidth", EqualWidth) + + XML::Write(Items) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Columns.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Columns.h new file mode 100644 index 0000000000..07f9e6458f --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Columns.h @@ -0,0 +1,37 @@ +#ifndef OOX_LOGIC_COLUMNS_INCLUDE_H_ +#define OOX_LOGIC_COLUMNS_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "Utility.h" +#include "property.h" +#include "nullable_property.h" +#include "Column.h" + +namespace OOX +{ + namespace Logic + { + class Columns : public WritingElement + { + public: + Columns(); + virtual ~Columns(); + explicit Columns(const XML::XNode& node); + const Columns& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property Num; + nullable_property Space; + nullable_property EqualWidth; + nullable_property Sep; + property > Items; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_COLUMNS_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Complex.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Complex.cpp new file mode 100644 index 0000000000..264a5d0870 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Complex.cpp @@ -0,0 +1,50 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Complex.h" + + +namespace OOX +{ + namespace Logic + { + + Complex::Complex() + { + } + + + Complex::~Complex() + { + } + + + Complex::Complex(const XML::XNode& node) + { + fromXML(node); + } + + + const Complex& Complex::operator = (const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Complex::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Ext = element.attribute("ext").value(); + } + + + const XML::XNode Complex::toXML() const + { + return XML::XElement(ns.o + "complex", XML::XAttribute(ns.v + "ext", Ext)); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Complex.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Complex.h new file mode 100644 index 0000000000..821af7b0e5 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Complex.h @@ -0,0 +1,33 @@ +#pragma once +#ifndef OOX_LOGIC_COMPLEX_INCLUDE_H_ +#define OOX_LOGIC_COMPLEX_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include "./../Limit/ComplexExt.h" + + +// TODO ïîïðîáîâàòü ïåðåíåñòè â âûçûâàåìûé êëàññ +namespace OOX +{ + namespace Logic + { + class Complex : public WritingElement + { + public: + Complex(); + virtual ~Complex(); + explicit Complex(const XML::XNode& node); + const Complex& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Ext; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_COMPLEX_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/ContinuationSeparator.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ContinuationSeparator.cpp new file mode 100644 index 0000000000..8f4a81de7d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ContinuationSeparator.cpp @@ -0,0 +1,54 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ContinuationSeparator.h" + + +namespace OOX +{ + namespace Logic + { + + ContinuationSeparator::ContinuationSeparator() + { + } + + + ContinuationSeparator::~ContinuationSeparator() + { + } + + + ContinuationSeparator::ContinuationSeparator(const XML::XNode& node) + { + fromXML(node); + } + + + const ContinuationSeparator& ContinuationSeparator::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void ContinuationSeparator::fromXML(const XML::XNode& node) + { + } + + + const XML::XNode ContinuationSeparator::toXML() const + { + return XML::XElement(ns.w + "continuationSeparator"); + } + + + const std::string ContinuationSeparator::toTxt() const + { + return ""; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/ContinuationSeparator.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ContinuationSeparator.h new file mode 100644 index 0000000000..202f87902f --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ContinuationSeparator.h @@ -0,0 +1,28 @@ +#pragma once +#ifndef OOX_LOGIC_CONTINUATION_SEPARATOR_INCLUDE_H_ +#define OOX_LOGIC_CONTINUATION_SEPARATOR_INCLUDE_H_ + +#include "RunItemBase.h" + + +namespace OOX +{ + namespace Logic + { + class ContinuationSeparator : public RunItemBase + { + public: + ContinuationSeparator(); + virtual ~ContinuationSeparator(); + explicit ContinuationSeparator(const XML::XNode& node); + const ContinuationSeparator& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + virtual const std::string toTxt() const; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_CONTINUATION_SEPARATOR_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/DelText.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/DelText.cpp new file mode 100644 index 0000000000..205b42e4fc --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/DelText.cpp @@ -0,0 +1,56 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "DelText.h" + + +namespace OOX +{ + namespace Logic + { + + DelText::DelText() + { + } + + + DelText::~DelText() + { + } + + + DelText::DelText(const XML::XNode& node) + { + fromXML(node); + } + + + const DelText& DelText::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void DelText::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Text = element.text(); + } + + + const XML::XNode DelText::toXML() const + { + return XML::XElement(ns.w + "delText", XML::XText(Text)); + } + + + const std::string DelText::toTxt() const + { + return Text; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/DelText.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/DelText.h new file mode 100644 index 0000000000..0f85cf44a4 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/DelText.h @@ -0,0 +1,34 @@ +#pragma once +#ifndef OOX_LOGIC_DEL_TEXT_INCLUDE_H_ +#define OOX_LOGIC_DEL_TEXT_INCLUDE_H_ + +#include "RunItemBase.h" +#include "nullable_property.h" + + +namespace OOX +{ + namespace Logic + { + class DelText : public RunItemBase + { + public: + DelText(); + virtual ~DelText(); + explicit DelText(const XML::XNode& node); + const DelText& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + virtual const std::string toTxt() const; + + public: + nullable_property Text; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_DEL_TEXT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Delete.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Delete.cpp new file mode 100644 index 0000000000..7dd3fd5f0d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Delete.cpp @@ -0,0 +1,70 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Delete.h" + + +namespace OOX +{ + namespace Logic + { + + Delete::Delete() + { + } + + + Delete::~Delete() + { + } + + + Delete::Delete(const XML::XNode& node) + { + fromXML(node); + } + + + const Delete& Delete::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Delete::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + Id = element.attribute("id").value(); + Author = element.attribute("author").value(); + Date = element.attribute("date").value(); + + XML::Fill(Runs, element, "r"); + } + + + const XML::XNode Delete::toXML() const + { + return + XML::XElement(ns.w + "del", + XML::XAttribute(ns.w + "id", Id) + + XML::XAttribute(ns.w + "author", Author) + + XML::XAttribute(ns.w + "date", Date) + + XML::Write(Runs) + ); + } + + + const std::string Delete::toTxt() const + { + std::string text; + BOOST_FOREACH(const Run& run, *Runs) + text += run.toTxt(); + return text; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Delete.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Delete.h new file mode 100644 index 0000000000..b3e1b3b2c1 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Delete.h @@ -0,0 +1,38 @@ +#pragma once +#ifndef OOX_LOGIC_DELETE_INCLUDE_H_ +#define OOX_LOGIC_DELETE_INCLUDE_H_ + +#include "ParagraphItemBase.h" +#include "Run.h" +#include "property.h" +#include "nullable_property.h" +#include + + +namespace OOX +{ + namespace Logic + { + class Delete : public ParagraphItemBase + { + public: + Delete(); + virtual ~Delete(); + explicit Delete(const XML::XNode& node); + const Delete& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + virtual const std::string toTxt() const; + + public: + nullable_property Id; + nullable_property Author; + nullable_property Date; + property > Runs; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_DELETE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/DocPartObj.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/DocPartObj.cpp new file mode 100644 index 0000000000..1810a2cde3 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/DocPartObj.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "DocPartObj.h" + + +namespace OOX +{ + namespace Logic + { + + DocPartObj::DocPartObj() + { + } + + + DocPartObj::~DocPartObj() + { + } + + + DocPartObj::DocPartObj(const XML::XNode& node) + { + fromXML(node); + } + + + const DocPartObj& DocPartObj::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void DocPartObj::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Gallery = element.element("docPartGallery").attribute("val").value(); + Unique = element.element("docPartUnique").exist(); + } + + + const XML::XNode DocPartObj::toXML() const + { + return + XML::XElement(ns.w + "docPartObj", + XML::Write(ns.w + "docPartGallery", ns.w + "val", Gallery) + + XML::WriteIf(XML::XElement(ns.w + "docPartUnique"), Unique) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/DocPartObj.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/DocPartObj.h new file mode 100644 index 0000000000..9b6325ea8f --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/DocPartObj.h @@ -0,0 +1,33 @@ +#pragma once +#ifndef OOX_LOGIC_DOC_PART_OBJ_INCLUDE_H_ +#define OOX_LOGIC_DOC_PART_OBJ_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include "nullable_property.h" + + +namespace OOX +{ + namespace Logic + { + class DocPartObj : public WritingElement + { + public: + DocPartObj(); + virtual ~DocPartObj(); + explicit DocPartObj(const XML::XNode& node); + const DocPartObj& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property Gallery; + property Unique; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_DOC_PART_OBJ_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/DocPr.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/DocPr.cpp new file mode 100644 index 0000000000..d797c6f865 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/DocPr.cpp @@ -0,0 +1,57 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "DocPr.h" + + +namespace OOX +{ + namespace Logic + { + + DocPr::DocPr() + { + } + + + DocPr::~DocPr() + { + } + + + DocPr::DocPr(const XML::XNode& node) + { + fromXML(node); + } + + + const DocPr& DocPr::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void DocPr::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Id = element.attribute("id").value(); + Name = element.attribute("name").value(); + Descr = element.attribute("descr").value(); + } + + + const XML::XNode DocPr::toXML() const + { + return + XML::XElement(ns.wp + "docPr", + XML::XAttribute("id", Id) + + XML::XAttribute("name", Name) + + XML::XAttribute("descr", Descr) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/DocPr.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/DocPr.h new file mode 100644 index 0000000000..e3c2066700 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/DocPr.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef OOX_LOGIC_DOC_PROPERTIES_INCLUDE_H_ +#define OOX_LOGIC_DOC_PROPERTIES_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "property.h" +#include "nullable_property.h" + + +namespace OOX +{ + namespace Logic + { + class DocPr : public WritingElement + { + public: + DocPr(); + virtual ~DocPr(); + explicit DocPr(const XML::XNode& node); + const DocPr& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Id; + property Name; + nullable_property Descr; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_DOC_PROPERTIES_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/DocumentGrid.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/DocumentGrid.cpp new file mode 100644 index 0000000000..82f3b66f66 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/DocumentGrid.cpp @@ -0,0 +1,57 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "DocumentGrid.h" + + +namespace OOX +{ + namespace Logic + { + + DocumentGrid::DocumentGrid() + { + } + + + DocumentGrid::~DocumentGrid() + { + } + + + DocumentGrid::DocumentGrid(const XML::XNode& node) + { + fromXML(node); + } + + + const DocumentGrid& DocumentGrid::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void DocumentGrid::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + LinePitch = element.attribute("linePitch").value(); + CharSpace = element.attribute("charSpace").value(); + Type = element.attribute("type").value(); + } + + + const XML::XNode DocumentGrid::toXML() const + { + return + XML::XElement(ns.w + "docGrid", + XML::XAttribute(ns.w + "linePitch", LinePitch) + + XML::XAttribute(ns.w + "charSpace", CharSpace) + + XML::XAttribute(ns.w + "type", Type) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/DocumentGrid.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/DocumentGrid.h new file mode 100644 index 0000000000..78e5f97033 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/DocumentGrid.h @@ -0,0 +1,33 @@ +#ifndef OOX_LOGIC_DOCUMENT_GRID_INCLUDE_H_ +#define OOX_LOGIC_DOCUMENT_GRID_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "nullable_property.h" +#include "./../Limit/DocGridType.h" + + +namespace OOX +{ + namespace Logic + { + class DocumentGrid : public WritingElement + { + public: + DocumentGrid(); + virtual ~DocumentGrid(); + explicit DocumentGrid(const XML::XNode& node); + const DocumentGrid& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property LinePitch; + nullable_property CharSpace; + nullable_property Type; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_DOCUMENT_GRID_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Drawing.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Drawing.cpp new file mode 100644 index 0000000000..9ee5f38b6e --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Drawing.cpp @@ -0,0 +1,186 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Drawing.h" +#include "Inline.h" + + +namespace OOX +{ + namespace Logic + { + + Drawing::Drawing() : haveAnchor(false) + { + } + + + Drawing::~Drawing() + { + } + + + Drawing::Drawing(const RId& rId, const boost::filesystem::wpath& filename, const long width, const long height) + { + haveAnchor = false; + + Inline->DistT = 0; + Inline->DistB = 0; + Inline->DistL = 0; + Inline->DistR = 0; + + Inline->Extent = Extent(); + + int newH; + int newW; + int dpi = 96; + double heightPage = 25.7;//in cm + double widthPage = 16.5;//in cm + double maximum = std::max(width / (widthPage / 2.54 * dpi), height / (heightPage / 2.54 * dpi)); + + if (maximum < 1) + { + newW = (int) ( width * 2.54 * 72 * 100.0 * 1000.0 / 20.0 / 96.0); // from px to sx + newH = (int) ( height * 2.54 * 72 * 100.0 * 1000.0 / 20.0 / 96.0); // from px to sx + } + else + { + newW = (int) ( width / maximum * 2.54 * 72.0 * 100.0 * 1000.0 / 20.0 / 96.0); // from px to sx + newH = (int) ( height / maximum * 2.54 * 72.0 * 100.0 * 1000.0 / 20.0 / 96.0); // from px to sx + } + + Inline->Extent->Size->Width = newW; + Inline->Extent->Size->Height = newH; + + Inline->EffectExtent->Left = 19050; + Inline->EffectExtent->Top = 0; + Inline->EffectExtent->Right = 3175; + Inline->EffectExtent->Bottom = 0; + + Inline->DocPr = DocPr(); + Inline->DocPr->Id = 1; + Inline->DocPr->Name = "Image 0"; + Inline->DocPr->Descr = Encoding::unicode2utf8(filename.filename()); + + Inline->NoChangeAspect = 1; + Inline->Graphic->Uri = "http://schemas.openxmlformats.org/drawingml/2006/picture"; + + Inline->Graphic->Pic->Id = 0; + Inline->Graphic->Pic->Name = Encoding::unicode2utf8(filename.filename()); + Inline->Graphic->Pic->rId = rId; + + Inline->Graphic->Pic->Off.init(); + Inline->Graphic->Pic->Off->X = 0; + Inline->Graphic->Pic->Off->Y = 0; + + Inline->Graphic->Pic->Ext.init(); + Inline->Graphic->Pic->Ext->Width = newW; + Inline->Graphic->Pic->Ext->Height = newH; + Inline->Graphic->Pic->Prst = "rect"; + } + + Drawing::Drawing(const RId& rId, const boost::filesystem::wpath& filename, const long xEmu, const std::string& hRelativeFrom, const long yEmu, const std::string& vRelativeFrom, const long widthEmu, const long heightEmu) + { + Inline->Name = "anchor"; + + Inline->DistT = 0; + Inline->DistB = 0; + Inline->DistL = 0; + Inline->DistR = 0; + + Inline->positionH = xEmu; + Inline->positionHRelativeFrom = hRelativeFrom; + Inline->positionV = yEmu; + Inline->positionVRelativeFrom = vRelativeFrom; + + DrawingWrap wrap; + wrap.Type = "wrapTopAndBottom"; + wrap.TextWrap = "bothSides"; + Inline->Wrap = wrap; + + Point2D simplePos; + simplePos.name = "simplePos"; + simplePos.x = 0; + simplePos.y = 0; + + Inline->SimplePos = false; + Inline->RelativeHeight = 0; + Inline->BehindDoc = false; + Inline->Locked = false; + Inline->LayoutInCell = true; + Inline->AllowOverlap = true; + + Inline->SimplePosPoint = simplePos; + + Inline->Extent = Extent(); + + Inline->Extent->Size->Width = widthEmu; + Inline->Extent->Size->Height = heightEmu; + + Inline->EffectExtent->Left = 19050; + Inline->EffectExtent->Top = 0; + Inline->EffectExtent->Right = 3175; + Inline->EffectExtent->Bottom = 0; + + Inline->DocPr = DocPr(); + Inline->DocPr->Id = 1; + Inline->DocPr->Name = "Image 0"; + Inline->DocPr->Descr = Encoding::unicode2utf8(filename.filename()); + + Inline->NoChangeAspect = 1; + Inline->Graphic->Uri = "http://schemas.openxmlformats.org/drawingml/2006/picture"; + + Inline->Graphic->Pic->Id = 0; + Inline->Graphic->Pic->Name = Encoding::unicode2utf8(filename.filename()); + Inline->Graphic->Pic->rId = rId; + + Inline->Graphic->Pic->Off.init(); + Inline->Graphic->Pic->Off->X = 0; + Inline->Graphic->Pic->Off->Y = 0; + + Inline->Graphic->Pic->Ext.init(); + Inline->Graphic->Pic->Ext->Width = widthEmu; + Inline->Graphic->Pic->Ext->Height = heightEmu; + Inline->Graphic->Pic->Prst = "rect"; + } + + Drawing::Drawing(const XML::XNode& node) + { + fromXML(node); + } + + const Drawing& Drawing::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void Drawing::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + if (element.element("inline").exist()) + { + Inline = element.element("inline"); + haveAnchor = false; + } + else if (element.element("anchor").exist()) + { + Inline = element.element("anchor"); + haveAnchor = true; + } + } + + const XML::XNode Drawing::toXML() const + { + return XML::XElement(ns.w + "drawing", XML::Write(Inline)); + } + + const std::string Drawing::toTxt() const + { + return "[image]"; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Drawing.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Drawing.h new file mode 100644 index 0000000000..d63d8d2d1e --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Drawing.h @@ -0,0 +1,39 @@ +#pragma once +#ifndef OOX_LOGIC_DRAWING_INCLUDE_H_ +#define OOX_LOGIC_DRAWING_INCLUDE_H_ + +#include "RunItemBase.h" +#include +#include "Inline.h" +#include "property.h" +#include "./../RId.h" +#include + + +namespace OOX +{ + namespace Logic + { + class Drawing : public RunItemBase + { + public: + Drawing(); + virtual ~Drawing(); + Drawing(const RId& rId, const boost::filesystem::wpath& filename, const long width, const long height); + Drawing(const RId& rId, const boost::filesystem::wpath& filename, const long xEmu, const std::string& hRelativeFrom, const long yEmu, const std::string& vRelativeFrom, const long widthEmu, const long heightEmu); + explicit Drawing(const XML::XNode& node); + const Drawing& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + const std::string toTxt() const; + + public: + bool haveAnchor; + property Inline; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_DRAWING_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/DrawingWrap.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/DrawingWrap.cpp new file mode 100644 index 0000000000..fef63f16e2 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/DrawingWrap.cpp @@ -0,0 +1,114 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "DrawingWrap.h" + + +namespace OOX +{ + namespace Logic + { + DrawingWrap::DrawingWrap() + { + + } + + DrawingWrap::~DrawingWrap() + { + + } + + DrawingWrap::DrawingWrap(const XML::XNode& node) + { + fromXML(node); + } + + const DrawingWrap& DrawingWrap::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void DrawingWrap::fromXML(const XML::XNode& node) + { + const XML::XElement element (node); + if (element.element("wrapSquare").exist()) + { + Type = "wrapSquare"; + TextWrap = element.element("wrapSquare").attribute("wrapText").value(); + } + else if(element.element("wrapTight").exist()) + { + Type = "wrapTight"; + TextWrap = element.element("wrapTight").attribute("wrapText").value(); + } + else if(element.element("wrapThrough").exist()) + { + Type = "wrapThrough"; + TextWrap = element.element("wrapThrough").attribute("wrapText").value(); + } + else if(element.element("wrapTopAndBottom").exist()) + { + Type = "wrapTopAndBottom"; + TextWrap = "bothSides"; + } + else + { + Type = "wrapNone"; + TextWrap = "bothSides"; + } + + DistT = element.attribute("distT").value(); + DistB = element.attribute("distB").value(); + DistL = element.attribute("distL").value(); + DistR = element.attribute("distR").value(); + EffectExtent = element.element("effectExtent"); + WrapPath = element.element("wrapPolygon"); + } + + const XML::XNode DrawingWrap::toXML() const + { + if (*Type == "wrapSquare") + { + return XML::XElement(ns.wp + "wrapSquare", + XML::XAttribute("wrapText", TextWrap) + + XML::XAttribute("distT", DistT) + + XML::XAttribute("distB", DistB) + + XML::XAttribute("distL", DistL) + + XML::XAttribute("distR", DistR) + + XML::Write(EffectExtent) + ); + } + else if (*Type == "wrapTopAndBottom") + { + return XML::XElement(ns.wp + "wrapTopAndBottom", + XML::XAttribute("distT", DistT) + + XML::XAttribute("distB", DistB) + + XML::Write(EffectExtent) + ); + } + else if (*Type == "wrapTight") + { + return XML::XElement(ns.wp + "wrapTight", + XML::XAttribute("wrapText", TextWrap) + + XML::XAttribute("distL", DistL) + + XML::XAttribute("distR", DistR) + + XML::Write(WrapPath) + ); + } + else if (*Type == "wrapThrough") + { + return XML::XElement(ns.wp + "wrapThrough", + XML::XAttribute("wrapText", TextWrap) + + XML::XAttribute("distL", DistL) + + XML::XAttribute("distR", DistR) + + XML::Write(WrapPath) + ); + } + + return XML::XElement(ns.wp + "wrapNone"); + } + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/DrawingWrap.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/DrawingWrap.h new file mode 100644 index 0000000000..c7ab176b13 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/DrawingWrap.h @@ -0,0 +1,44 @@ +#pragma once + +#ifndef OOX_LOGIC_DRAWINGWRAP_INCLUDE_H_ +#define OOX_LOGIC_DRAWINGWRAP_INCLUDE_H_ + +#include "property.h" +#include "nullable_property.h" +#include "./../WritingElement.h" +#include "./../Limit/TextWrapType.h" +#include "./../Limit/DrawingWrapType.h" +#include "WrapPath.h" +#include "EffectExtent.h" + +namespace OOX +{ + namespace Logic + { + class DrawingWrap : public WritingElement + { + public: + DrawingWrap(); + virtual ~DrawingWrap(); + explicit DrawingWrap(const XML::XNode& node); + const DrawingWrap& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + + property Type; + property TextWrap; + nullable_property DistT; + nullable_property DistB; + nullable_property DistL; + nullable_property DistR; + nullable_property EffectExtent; + nullable_property WrapPath; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_DRAWINGWRAP_INCLUDE_H \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/EffectExtent.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/EffectExtent.cpp new file mode 100644 index 0000000000..e897ade0d0 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/EffectExtent.cpp @@ -0,0 +1,59 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "EffectExtent.h" + + +namespace OOX +{ + namespace Logic + { + + EffectExtent::EffectExtent() + { + } + + + EffectExtent::~EffectExtent() + { + } + + + EffectExtent::EffectExtent(const XML::XNode& node) + { + fromXML(node); + } + + + const EffectExtent& EffectExtent::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void EffectExtent::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Left = element.attribute("l").value().ToString(); + Top = element.attribute("t").value().ToString(); + Right = element.attribute("r").value().ToString(); + Bottom = element.attribute("b").value().ToString(); + } + + + const XML::XNode EffectExtent::toXML() const + { + return + XML::XElement(ns.wp + "effectExtent", + XML::XAttribute("l", Left) + + XML::XAttribute("t", Top) + + XML::XAttribute("r", Right) + + XML::XAttribute("b", Bottom) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/EffectExtent.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/EffectExtent.h new file mode 100644 index 0000000000..37971b9cee --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/EffectExtent.h @@ -0,0 +1,36 @@ +#pragma once +#ifndef OOX_LOGIC_EFFECT_EXTENT_INCLUDE_H_ +#define OOX_LOGIC_EFFECT_EXTENT_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include "./../Unit.h" + + +namespace OOX +{ + namespace Logic + { + class EffectExtent : public WritingElement + { + public: + EffectExtent(); + virtual ~EffectExtent(); + explicit EffectExtent(const XML::XNode& node); + const EffectExtent& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + // TODO ïîïðîáîâàòü äîáàâèòü òèï Padding èëè Margin + public: + property Left; + property Top; + property Right; + property Bottom; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_EFFECT_EXTENT_INCLUDE_H \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/EndNoteProperty.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/EndNoteProperty.cpp new file mode 100644 index 0000000000..1cef6c86b5 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/EndNoteProperty.cpp @@ -0,0 +1,63 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "EndNoteProperty.h" + + +namespace OOX +{ + namespace Logic + { + + EndNoteProperty::EndNoteProperty() + { + } + + + EndNoteProperty::~EndNoteProperty() + { + } + + + EndNoteProperty::EndNoteProperty(const XML::XNode& node) + { + fromXML(node); + } + + + const EndNoteProperty& EndNoteProperty::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void EndNoteProperty::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + if(element.element("numFmt").exist()) + NumFormat = element.element("numFmt"); + else + NumFormat->setLowerRoman(); + + if(element.element("numStart").exist()) + NumStart = element.element("numStart").attribute("val").value(); + else + NumStart = 1; + } + + + const XML::XNode EndNoteProperty::toXML() const + { + return + XML::XElement(ns.w + "endnotePr", + XML::Write(NumFormat) + + XML::Write(ns.w + "numStart", ns.w + "val", NumStart) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/EndNoteProperty.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/EndNoteProperty.h new file mode 100644 index 0000000000..aca129be0a --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/EndNoteProperty.h @@ -0,0 +1,26 @@ +#ifndef OOX_LOGIC_ENDNOTE_PROPERTY_INCLUDE_H_ +#define OOX_LOGIC_ENDNOTE_PROPERTY_INCLUDE_H_ + +#include "NoteProperty.h" + + +namespace OOX +{ + namespace Logic + { + class EndNoteProperty : public NoteProperty, public WritingElement + { + public: + EndNoteProperty(); + virtual ~EndNoteProperty(); + explicit EndNoteProperty(const XML::XNode& node); + const EndNoteProperty& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_ENDNOTE_PROPERTY_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/EndnoteRef.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/EndnoteRef.cpp new file mode 100644 index 0000000000..8f2f20aae8 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/EndnoteRef.cpp @@ -0,0 +1,54 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "EndnoteRef.h" + + +namespace OOX +{ + namespace Logic + { + + EndnoteRef::EndnoteRef() + { + } + + + EndnoteRef::~EndnoteRef() + { + } + + + EndnoteRef::EndnoteRef(const XML::XNode& node) + { + fromXML(node); + } + + + const EndnoteRef& EndnoteRef::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void EndnoteRef::fromXML(const XML::XNode& node) + { + } + + + const XML::XNode EndnoteRef::toXML() const + { + return XML::XElement(ns.w + "endnoteRef"); + } + + + const std::string EndnoteRef::toTxt() const + { + return ""; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/EndnoteRef.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/EndnoteRef.h new file mode 100644 index 0000000000..cb063ec797 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/EndnoteRef.h @@ -0,0 +1,28 @@ +#pragma once +#ifndef OOX_LOGIC_ENDNOTE_REF_INCLUDE_H_ +#define OOX_LOGIC_ENDNOTE_REF_INCLUDE_H_ + +#include "RunItemBase.h" + + +namespace OOX +{ + namespace Logic + { + class EndnoteRef : public RunItemBase + { + public: + EndnoteRef(); + virtual ~EndnoteRef(); + explicit EndnoteRef(const XML::XNode& node); + const EndnoteRef& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + virtual const std::string toTxt() const; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_ENDNOTE_REF_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/EndnoteReference.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/EndnoteReference.cpp new file mode 100644 index 0000000000..d11fb159df --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/EndnoteReference.cpp @@ -0,0 +1,66 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "EndnoteReference.h" + + +namespace OOX +{ + namespace Logic + { + + EndnoteReference::EndnoteReference() + { + } + + + EndnoteReference::~EndnoteReference() + { + } + + + EndnoteReference::EndnoteReference(const size_t index) + { + Id = index; + } + + + EndnoteReference::EndnoteReference(const XML::XNode& node) + { + fromXML(node); + } + + + const EndnoteReference& EndnoteReference::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void EndnoteReference::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Id = element.attribute("id").value(); + CustomMarkFollows = element.attribute("customMarkFollows").value(); + } + + + const XML::XNode EndnoteReference::toXML() const + { + return XML::XElement(ns.w + "endnoteReference", + XML::XAttribute(ns.w + "customMarkFollows", CustomMarkFollows) + + XML::XAttribute(ns.w + "id", Id) + ); + } + + const std::string EndnoteReference::toTxt() const + { + //return "[endnote]"; + return "[_]"; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/EndnoteReference.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/EndnoteReference.h new file mode 100644 index 0000000000..75456a4713 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/EndnoteReference.h @@ -0,0 +1,34 @@ +#pragma once +#ifndef OOX_LOGIC_ENDNOTE_REFERENCE_INCLUDE_H_ +#define OOX_LOGIC_ENDNOTE_REFERENCE_INCLUDE_H_ + +#include "RunItemBase.h" +#include "property.h" + + +namespace OOX +{ + namespace Logic + { + class EndnoteReference : public RunItemBase + { + public: + EndnoteReference(); + virtual ~EndnoteReference(); + explicit EndnoteReference(const size_t index); + explicit EndnoteReference(const XML::XNode& node); + const EndnoteReference& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + virtual const std::string toTxt() const; + + public: + property Id; + nullable_property CustomMarkFollows; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_ENDNOTE_REFERENCE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Extent.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Extent.cpp new file mode 100644 index 0000000000..50a4dba6c6 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Extent.cpp @@ -0,0 +1,54 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Extent.h" + + +namespace OOX +{ + namespace Logic + { + + Extent::Extent() + { + } + + + Extent::~Extent() + { + } + + + Extent::Extent(const XML::XNode& node) + { + fromXML(node); + } + + + const Extent& Extent::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Extent::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Size = XML::XElement2Size(element, "cy", "cx"); + } + + + const XML::XNode Extent::toXML() const + { + return + XML::XElement(ns.wp + "extent", + XML::XAttribute("cx", Size->Width) + + XML::XAttribute("cy", Size->Height) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Extent.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Extent.h new file mode 100644 index 0000000000..92c95e99f1 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Extent.h @@ -0,0 +1,33 @@ +#pragma once +#ifndef OOX_LOGIC_EXTENT_INCLUDE_H_ +#define OOX_LOGIC_EXTENT_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include "./../Unit.h" +#include "Common.h" + + +namespace OOX +{ + namespace Logic + { + class Extent : public WritingElement + { + public: + Extent(); + virtual ~Extent(); + explicit Extent(const XML::XNode& node); + const Extent& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property > Size; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_EXTENT_INCLUDE_H \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Extrusion.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Extrusion.cpp new file mode 100644 index 0000000000..bd3206408d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Extrusion.cpp @@ -0,0 +1,69 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Extrusion.h" + + +namespace OOX +{ + namespace Logic + { + + Extrusion::Extrusion() + { + } + + + Extrusion::~Extrusion() + { + } + + + Extrusion::Extrusion(const XML::XNode& node) + { + fromXML(node); + } + + + const Extrusion& Extrusion::operator = (const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Extrusion::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + On = element.attribute("on").value(); + Ext = element.attribute("ext").value(); + BackDepth = element.attribute("backdepth").value(); + ViewPoint = element.attribute("viewpoint").value(); + ViewPointOrigin = element.attribute("viewpointorigin").value(); + SkewAngle = element.attribute("skewangle").value(); + LightPosition = element.attribute("lightposition").value(); + LightPosition2 = element.attribute("lightposition2").value(); + Type = element.attribute("type").value(); + } + + + const XML::XNode Extrusion::toXML() const + { + return + XML::XElement(ns.o + "extrusion", + XML::XAttribute("on", On) + + XML::XAttribute(ns.v + "ext", Ext) + + XML::XAttribute("backdepth", BackDepth) + + XML::XAttribute("viewpoint", ViewPoint) + + XML::XAttribute("viewpointorigin", ViewPointOrigin) + + XML::XAttribute("skewangle", SkewAngle) + + XML::XAttribute("lightposition", LightPosition) + + XML::XAttribute("lightposition2", LightPosition2) + + XML::XAttribute("type", Type) + ); + } + + } // namespace Logic +} // namespace OOX diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Extrusion.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Extrusion.h new file mode 100644 index 0000000000..f1228c9997 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Extrusion.h @@ -0,0 +1,42 @@ +#pragma once +#ifndef OOX_LOGIC_EXTRUSION_INCLUDE_H_ +#define OOX_LOGIC_EXTRUSION_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "./../Limit/TrueFalse.h" +#include +#include "nullable_property.h" + + +namespace OOX +{ + namespace Logic + { + class Extrusion : public WritingElement + { + public: + Extrusion(); + virtual ~Extrusion(); + explicit Extrusion(const XML::XNode& node); + const Extrusion& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + + nullable_property On; + nullable_property Ext; + nullable_property BackDepth; + nullable_property ViewPoint; + nullable_property ViewPointOrigin; + nullable_property SkewAngle; + nullable_property LightPosition; + nullable_property LightPosition2; + nullable_property Type; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_EXTRUSION_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/F.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/F.cpp new file mode 100644 index 0000000000..e68973ff53 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/F.cpp @@ -0,0 +1,51 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "F.h" + + +namespace OOX +{ + namespace Logic + { + + F::F() + { + } + + + F::~F() + { + } + + + F::F(const XML::XNode& node) + { + fromXML(node); + } + + + const F& F::operator = (const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void F::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Eqn = element.attribute("eqn").value(); + } + + + const XML::XNode F::toXML() const + { + return XML::XElement("f",XML::XAttribute("eqn", Eqn)); + //return XML::XElement(ns.v + "f",XML::XAttribute("eqn", Eqn)); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/F.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/F.h new file mode 100644 index 0000000000..1632c97e3d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/F.h @@ -0,0 +1,30 @@ +#pragma once +#ifndef OOX_LOGIC_F_INCLUDE_H_ +#define OOX_LOGIC_F_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" + +namespace OOX +{ + namespace Logic + { + class F : public WritingElement + { + public: + F(); + virtual ~F(); + explicit F(const XML::XNode& node); + const F& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Eqn; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_F_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/FieldCodes.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FieldCodes.cpp new file mode 100644 index 0000000000..4074d8fa99 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FieldCodes.cpp @@ -0,0 +1,50 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "FieldCodes.h" + + +namespace OOX +{ + namespace Logic + { + + FieldCodes::FieldCodes() + { + } + + + FieldCodes::~FieldCodes() + { + } + + + FieldCodes::FieldCodes(const XML::XNode& node) + { + fromXML(node); + } + + + const FieldCodes& FieldCodes::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void FieldCodes::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Text = element.text(); + } + + + const XML::XNode FieldCodes::toXML() const + { + return XML::XElement(ns.o + "FieldCodes", XML::XText(Text)); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/FieldCodes.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FieldCodes.h new file mode 100644 index 0000000000..5ff19d959e --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FieldCodes.h @@ -0,0 +1,32 @@ +#pragma once +#ifndef OOX_LOGIC_FIELD_CODES_INCLUDE_H_ +#define OOX_LOGIC_FIELD_CODES_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "property.h" + + +namespace OOX +{ + namespace Logic + { + class FieldCodes : public WritingElement + { + public: + FieldCodes(); + virtual ~FieldCodes(); + explicit FieldCodes(const XML::XNode& node); + const FieldCodes& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Text; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_FIELD_CODES_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Fill.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Fill.cpp new file mode 100644 index 0000000000..fae083c69f --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Fill.cpp @@ -0,0 +1,63 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Fill.h" + + +namespace OOX +{ + namespace Logic + { + + Fill::Fill() + { + } + + + Fill::~Fill() + { + } + + + Fill::Fill(const XML::XNode& node) + { + fromXML(node); + } + + + const Fill& Fill::operator = (const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Fill::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Color = element.attribute("color2").value(); + Colors = element.attribute("colors").value(); + Method = element.attribute("method").value(); + Rotate = element.attribute("rotate").value(); + Focus = element.attribute("focus").value(); + Type = element.attribute("type").value(); + } + + + const XML::XNode Fill::toXML() const + { + return + XML::XElement(ns.v + "fill", + XML::XAttribute("color2", Color) + + XML::XAttribute("rotate", Rotate) + + XML::XAttribute("colors", Colors) + + XML::XAttribute("method", Method) + + XML::XAttribute("focus", Focus) + + XML::XAttribute("type", Type) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Fill.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Fill.h new file mode 100644 index 0000000000..3867ed1efe --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Fill.h @@ -0,0 +1,40 @@ +#pragma once +#ifndef OOX_LOGIC_FILL_INCLUDE_H_ +#define OOX_LOGIC_FILL_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include "nullable_property.h" +#include +#include "./../Limit/FillType.h" +#include "./../Unit.h" + + +namespace OOX +{ + namespace Logic + { + class Fill : public WritingElement + { + public: + Fill(); + virtual ~Fill(); + explicit Fill(const XML::XNode& node); + const Fill& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Color; + nullable_property Method; + nullable_property Colors; + nullable_property Rotate; + nullable_property Focus; + nullable_property Type; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_FILL_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/FillStyle.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FillStyle.cpp new file mode 100644 index 0000000000..78d667f2d6 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FillStyle.cpp @@ -0,0 +1,68 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "FillStyle.h" + +namespace OOX +{ + namespace Logic + { + FillStyle::FillStyle() + { + + } + + FillStyle::~FillStyle() + { + + } + + FillStyle::FillStyle(const XML::XNode& node) + { + fromXML(node); + } + + const FillStyle& FillStyle::operator = (const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void FillStyle::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + if (element.attribute("filled").exist()) + filled = element.attribute("filled").value(); + if (element.attribute("fillcolor").exist()) + fillcolor = element.attribute("fillcolor").value(); + + const XML::XElement fillXML = element.element("fill"); + if (fillXML.is_init()) + { + if (fillXML.attribute("opacity").exist()) + opacity = fillXML.attribute ("opacity").value(); + if (fillXML.attribute("id").exist()) + Id = fillXML.attribute("id").value(); + if (fillXML.attribute("type").exist()) + type = fillXML.attribute("type").value(); + if (fillXML.attribute("recolor").exist()) + recolor = fillXML.attribute("recolor").value(); + if (fillXML.attribute("rotate").exist()) + rotate = fillXML.attribute("rotate").value(); + } + + if (element.attribute("color").exist()) + fillcolor = element.attribute("color").value(); + if (element.attribute("opacity").exist()) + opacity = element.attribute("opacity").value(); + } + + const XML::XNode FillStyle::toXML() const + { + return XML::XElement(); + } + } +} diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/FillStyle.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FillStyle.h new file mode 100644 index 0000000000..e862a37f43 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FillStyle.h @@ -0,0 +1,37 @@ +#pragma once + +#include + +#include "property.h" +#include "nullable_property.h" + +#include ".\..\WritingElement.h" + +namespace OOX +{ + namespace Logic + { + class FillStyle : public WritingElement + { + public: + FillStyle(); + virtual ~FillStyle(); + explicit FillStyle(const XML::XNode& node); + const FillStyle& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property filled; + nullable_property fillcolor; + nullable_property opacity; + + nullable_property Id; // image id + nullable_property type; + nullable_property recolor; + nullable_property rotate; + }; + } +} diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/FldChar.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FldChar.cpp new file mode 100644 index 0000000000..effb9ea2d4 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FldChar.cpp @@ -0,0 +1,59 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "FldChar.h" + + +namespace OOX +{ + namespace Logic + { + + FldChar::FldChar() + { + } + + + FldChar::~FldChar() + { + } + + + FldChar::FldChar(const XML::XNode& node) + { + fromXML(node); + } + + + const FldChar& FldChar::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void FldChar::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + FldCharType = element.attribute("fldCharType").value(); + } + + + const XML::XNode FldChar::toXML() const + { + return + XML::XElement(ns.w + "fldChar", + XML::XAttribute(ns.w + "fldCharType", FldCharType) + ); + } + + + const std::string FldChar::toTxt() const + { + return ""; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/FldChar.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FldChar.h new file mode 100644 index 0000000000..6ac056403a --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FldChar.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef OOX_LOGIC_FLD_CHAR_INCLUDE_H_ +#define OOX_LOGIC_FLD_CHAR_INCLUDE_H_ + +#include "RunItemBase.h" +#include "property.h" +#include "./../Limit/FldCharType.h" + + +namespace OOX +{ + namespace Logic + { + class FldChar : public RunItemBase + { + public: + FldChar(); + virtual ~FldChar(); + explicit FldChar(const XML::XNode& node); + const FldChar& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + virtual const std::string toTxt() const; + + public: + property FldCharType; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_FLD_CHAR_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/FldSimple.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FldSimple.cpp new file mode 100644 index 0000000000..ee197ff926 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FldSimple.cpp @@ -0,0 +1,61 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "FldSimple.h" + + +namespace OOX +{ + namespace Logic + { + + FldSimple::FldSimple() + { + } + + + FldSimple::~FldSimple() + { + } + + + FldSimple::FldSimple(const XML::XNode& node) + { + fromXML(node); + } + + + const FldSimple& FldSimple::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void FldSimple::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Run = element.element("r"); + Instr = element.attribute("instr").value(); + } + + + const XML::XNode FldSimple::toXML() const + { + return + XML::XElement(ns.w + "fldSimple", + XML::XAttribute(ns.w + "instr", Instr) + + XML::Write(Run) + ); + } + + + const std::string FldSimple::toTxt() const + { + return Run->toTxt(); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/FldSimple.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FldSimple.h new file mode 100644 index 0000000000..4288f992be --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FldSimple.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef OOX_LOGIC_FIELD_SIMPLE_INCLUDE_H_ +#define OOX_LOGIC_FIELD_SIMPLE_INCLUDE_H_ + +#include "ParagraphItemBase.h" +#include "Run.h" +#include "property.h" +#include + + +namespace OOX +{ + namespace Logic + { + class FldSimple : public ParagraphItemBase + { + public: + FldSimple(); + virtual ~FldSimple(); + explicit FldSimple(const XML::XNode& node); + const FldSimple& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + virtual const std::string toTxt() const; + + public: + property Run; + property Instr; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_FIELD_SIMPLE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/FootNoteProperty.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FootNoteProperty.cpp new file mode 100644 index 0000000000..b93831f8ff --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FootNoteProperty.cpp @@ -0,0 +1,63 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "FootNoteProperty.h" + + +namespace OOX +{ + namespace Logic + { + + FootNoteProperty::FootNoteProperty() + { + } + + + FootNoteProperty::~FootNoteProperty() + { + } + + + FootNoteProperty::FootNoteProperty(const XML::XNode& node) + { + fromXML(node); + } + + + const FootNoteProperty& FootNoteProperty::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void FootNoteProperty::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + if(element.element("numFmt").exist()) + NumFormat = element.element("numFmt"); + else + NumFormat->setDecimal(); + + if(element.element("numStart").exist()) + NumStart = element.element("numStart").attribute("val").value(); + else + NumStart = 1; + } + + + const XML::XNode FootNoteProperty::toXML() const + { + return + XML::XElement(ns.w + "footnotePr", + XML::Write(NumFormat) + + XML::Write(ns.w + "numStart", ns.w + "val", NumStart) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/FootNoteProperty.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FootNoteProperty.h new file mode 100644 index 0000000000..a7e55f0714 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FootNoteProperty.h @@ -0,0 +1,27 @@ +#ifndef OOX_LOGIC_FOOTNOTE_PROPERTY_INCLUDE_H_ +#define OOX_LOGIC_FOOTNOTE_PROPERTY_INLCUDE_H_ + +#include "NoteProperty.h" + + +namespace OOX +{ + namespace Logic + { + class FootNoteProperty : public NoteProperty, public WritingElement + { + public: + FootNoteProperty(); + virtual ~FootNoteProperty(); + explicit FootNoteProperty(const XML::XNode& node); + const FootNoteProperty& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_FOOTNOTE_PROPERTY_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/FooterReference.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FooterReference.cpp new file mode 100644 index 0000000000..7ce0076102 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FooterReference.cpp @@ -0,0 +1,61 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "FooterReference.h" + + +namespace OOX +{ + namespace Logic + { + + FooterReference::FooterReference() + { + } + + + FooterReference::~FooterReference() + { + } + + + FooterReference::FooterReference(const XML::XNode& node) + { + fromXML(node); + } + + + const FooterReference& FooterReference::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void FooterReference::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + rId = element.attribute("id").value().ToString(); + Type = element.attribute("type").value(); + } + + + const XML::XNode FooterReference::toXML() const + { + return + XML::XElement(ns.w + "footerReference", + XML::XAttribute(ns.r + "id", rId) + + XML::XAttribute(ns.w + "type", Type) + ); + } + + + const std::string FooterReference::toTxt() const + { + return ""; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/FooterReference.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FooterReference.h new file mode 100644 index 0000000000..d1a16babbb --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FooterReference.h @@ -0,0 +1,34 @@ +#ifndef OOX_LOGIC_FOOTER_REFERENCE_INCLUDE_H_ +#define OOX_LOGIC_FOOTER_REFERENCE_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "./../RId.h" +#include "property.h" +#include "./../Limit/TypeFootHead.h" + + +namespace OOX +{ + namespace Logic + { + class FooterReference : public WritingElement + { + public: + FooterReference(); + virtual ~FooterReference(); + explicit FooterReference(const XML::XNode& node); + const FooterReference& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + virtual const std::string toTxt() const; + + public: + property rId; + property Type; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_FOOTER_REFERENCE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/FootnoteRef.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FootnoteRef.cpp new file mode 100644 index 0000000000..a18404424d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FootnoteRef.cpp @@ -0,0 +1,54 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "FootnoteRef.h" + + +namespace OOX +{ + namespace Logic + { + + FootnoteRef::FootnoteRef() + { + } + + + FootnoteRef::~FootnoteRef() + { + } + + + FootnoteRef::FootnoteRef(const XML::XNode& node) + { + fromXML(node); + } + + + const FootnoteRef& FootnoteRef::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void FootnoteRef::fromXML(const XML::XNode& node) + { + } + + + const XML::XNode FootnoteRef::toXML() const + { + return XML::XElement(ns.w + "footnoteRef"); + } + + + const std::string FootnoteRef::toTxt() const + { + return ""; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/FootnoteRef.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FootnoteRef.h new file mode 100644 index 0000000000..a1e79e345b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FootnoteRef.h @@ -0,0 +1,28 @@ +#pragma once +#ifndef OOX_LOGIC_FOOTNOTE_REF_INCLUDE_H_ +#define OOX_LOGIC_FOOTNOTE_REF_INCLUDE_H_ + +#include "RunItemBase.h" + + +namespace OOX +{ + namespace Logic + { + class FootnoteRef : public RunItemBase + { + public: + FootnoteRef(); + virtual ~FootnoteRef(); + explicit FootnoteRef(const XML::XNode& node); + const FootnoteRef& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + virtual const std::string toTxt() const; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_FOOTNOTE_REF_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/FootnoteReference.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FootnoteReference.cpp new file mode 100644 index 0000000000..e696cb5f0e --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FootnoteReference.cpp @@ -0,0 +1,67 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "FootnoteReference.h" + + +namespace OOX +{ + namespace Logic + { + + FootnoteReference::FootnoteReference() + { + } + + + FootnoteReference::~FootnoteReference() + { + } + + + FootnoteReference::FootnoteReference(const size_t index) + { + Id = index; + } + + + FootnoteReference::FootnoteReference(const XML::XNode& node) + { + fromXML(node); + } + + + const FootnoteReference& FootnoteReference::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void FootnoteReference::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Id = element.attribute("id").value(); + CustomMarkFollows = element.attribute("customMarkFollows").value(); + } + + + const XML::XNode FootnoteReference::toXML() const + { + return XML::XElement(ns.w + "footnoteReference", + XML::XAttribute(ns.w + "customMarkFollows", CustomMarkFollows) + + XML::XAttribute(ns.w + "id", Id) + ); + } + + + const std::string FootnoteReference::toTxt() const + { + //return "[footnote]"; + return "[_]"; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/FootnoteReference.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FootnoteReference.h new file mode 100644 index 0000000000..c8b9a513d9 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/FootnoteReference.h @@ -0,0 +1,34 @@ +#pragma once +#ifndef OOX_LOGIC_FOOTNOTE_REFERENCE_INCLUDE_H_ +#define OOX_LOGIC_FOOTNOTE_REFERENCE_INCLUDE_H_ + +#include "RunItemBase.h" +#include "property.h" + + +namespace OOX +{ + namespace Logic + { + class FootnoteReference : public RunItemBase + { + public: + FootnoteReference(); + virtual ~FootnoteReference(); + explicit FootnoteReference(const size_t index); + explicit FootnoteReference(const XML::XNode& node); + const FootnoteReference& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + virtual const std::string toTxt() const; + + public: + property Id; + nullable_property CustomMarkFollows; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_FOOTNOTE_REFERENCE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Formulas.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Formulas.cpp new file mode 100644 index 0000000000..224bcf888e --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Formulas.cpp @@ -0,0 +1,49 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Formulas.h" + +namespace OOX +{ + namespace Logic + { + + Formulas::Formulas() + { + } + + + Formulas::~Formulas() + { + } + + + Formulas::Formulas(const XML::XNode& node) + { + fromXML(node); + } + + + const Formulas& Formulas::operator = (const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Formulas::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Fill(Fs, element, "f"); + } + + const XML::XNode Formulas::toXML() const + { + //return XML::XElement(ns.v + "formulas", XML::Write(Fs)); + return XML::XElement("formulas", XML::Write(Fs)); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Formulas.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Formulas.h new file mode 100644 index 0000000000..9ad425457c --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Formulas.h @@ -0,0 +1,32 @@ +#pragma once +#ifndef OOX_LOGIC_FORMULAS_INCLUDE_H_ +#define OOX_LOGIC_FORMULAS_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "property.h" +#include "F.h" + +namespace OOX +{ + namespace Logic + { + class Formulas : public WritingElement + { + public: + Formulas(); + virtual ~Formulas(); + explicit Formulas(const XML::XNode& node); + const Formulas& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property > Fs; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_FORMULAS_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Graphic.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Graphic.cpp new file mode 100644 index 0000000000..9f67aa0588 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Graphic.cpp @@ -0,0 +1,57 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Graphic.h" + + +namespace OOX +{ + namespace Logic + { + + Graphic::Graphic() + { + } + + + Graphic::~Graphic() + { + } + + + Graphic::Graphic(const XML::XNode& node) + { + fromXML(node); + } + + + const Graphic& Graphic::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Graphic::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Uri = element.element("graphicData").attribute("uri").value(); + Pic = element.element("graphicData").element("pic"); + } + + + const XML::XNode Graphic::toXML() const + { + return + XML::XElement(ns.a + "graphic", + XML::XElement(ns.a + "graphicData", + XML::XAttribute("uri", Uri) + + XML::Write(Pic) + ) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Graphic.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Graphic.h new file mode 100644 index 0000000000..5498327018 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Graphic.h @@ -0,0 +1,34 @@ +#pragma once +#ifndef OOX_LOGIC_GRAPHIC_INCLUDE_H_ +#define OOX_LOGIC_GRAPHIC_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include "nullable_property.h" +#include "string.h" +#include "Pic.h" + +namespace OOX +{ + namespace Logic + { + class Graphic : public WritingElement + { + public: + Graphic(); + virtual ~Graphic(); + explicit Graphic(const XML::XNode& node); + const Graphic& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property Uri; + property Pic; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_GRAPHIC_INCLUDE_H \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/GridColumn.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/GridColumn.cpp new file mode 100644 index 0000000000..89eb0893b9 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/GridColumn.cpp @@ -0,0 +1,45 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "GridColumn.h" + +namespace OOX +{ + namespace Logic + { + GridColumn::GridColumn() + { + + } + + GridColumn::~GridColumn() + { + + } + + GridColumn::GridColumn(const XML::XNode& node) + { + fromXML(node); + } + + const GridColumn& GridColumn::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void GridColumn::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Width = element.attribute("w").value().ToString(); + } + + const XML::XNode GridColumn::toXML() const + { + return XML::XElement(ns.w + "gridCol", XML::XAttribute(ns.w + "w", Width)); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/GridColumn.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/GridColumn.h new file mode 100644 index 0000000000..d268e034fa --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/GridColumn.h @@ -0,0 +1,30 @@ +#pragma once +#ifndef OOX_LOGIC_GRID_COLUMN_INCLUDE_H_ +#define OOX_LOGIC_GRID_COLUMN_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "./../Unit.h" + +namespace OOX +{ + namespace Logic + { + class GridColumn : public WritingElement + { + public: + GridColumn(); + virtual ~GridColumn(); + explicit GridColumn(const XML::XNode& node); + const GridColumn& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Width; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_GRID_COLUMN_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Group.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Group.cpp new file mode 100644 index 0000000000..8a082506e6 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Group.cpp @@ -0,0 +1,152 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Shape.h" +#include "ShapeType.h" +#include "Rect.h" +#include "Oval.h" +#include "Roundrect.h" +#include "Line.h" + +#include "Group.h" + +namespace OOX +{ + namespace Logic + { + GroupItem::GroupItem() + { + + } + + GroupItem::GroupItem(const Oval& elem) : IItemable(new Oval(elem)) + { + + } + + GroupItem::GroupItem(const Rect& elem) : IItemable(new Rect(elem)) + { + } + + + GroupItem::GroupItem(const Roundrect& elem) : IItemable(new Roundrect(elem)) + { + + } + + GroupItem::GroupItem(const ShapeType& elem) : IItemable(new ShapeType(elem)) + { + + } + + GroupItem::GroupItem(const Shape& elem) : IItemable(new Shape(elem)) + { + + } + + GroupItem::GroupItem(const Line& elem) : IItemable(new Line(elem)) + { + + } + + GroupItem::GroupItem(const Group& elem) : IItemable(new Group(elem)) + { + + } + + GroupItem::~GroupItem() + { + + } + + GroupItem::GroupItem(const XML::XNode& node) + { + fromXML(node); + } + + const GroupItem& GroupItem::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void GroupItem::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + if (element.XName == "oval") + m_item.reset(new Oval(element)); + if (element.XName == "rect") + m_item.reset (new Rect(element)); + if (element.XName == "roundrect") + m_item.reset (new Roundrect(element)); + if (element.XName == "shapetype") + m_item.reset (new ShapeType(element)); + if (element.XName == "shape") + m_item.reset (new Shape(element)); + if (element.XName == "line") + m_item.reset (new Line(element)); + if (element.XName == "group") + m_item.reset (new Group(element)); + } + + const XML::XNode GroupItem::toXML() const + { + return XML::Write(m_item); + } + } + + namespace Logic + { + Group::Group() + { + + } + + Group::~Group() + { + + } + + Group::Group(const XML::XNode& node) + { + fromXML(node); + } + + void Group::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + id = element.attribute("id").value(); + spid = element.attribute("spid").value(); + style = element.attribute("style").value(); + coordorigin = element.attribute("coordorigin").value(); + coordsize = element.attribute("coordsize").value(); + + for (XML::const_node_iterator i = element.Nodes.begin(); i != element.Nodes.end(); ++i) + { + if (i->isElement()) + { + const XML::XElement grelement(*i); + + //std::string strName = grelement.XName; + //if (element.XName == "group") + { + + } + //else + { + items->push_back(GroupItem(*i)); + } + } + } + } + + const XML::XNode Group::toXML() const + { + return XML::XElement(); + } + } +} \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Group.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Group.h new file mode 100644 index 0000000000..2c919c6be5 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Group.h @@ -0,0 +1,62 @@ +#pragma once +#ifndef OOX_LOGIC_GROUP_INCLUDE_H_ +#define OOX_LOGIC_GROUP_INCLUDE_H_ + +#include + +#include "./../WritingElement.h" +#include "ShapeStyle.h" +#include "property.h" +#include "nullable_property.h" +#include "IItemable.h" + +namespace OOX +{ + namespace Logic + { + class Group; + class GroupItem : public WritingElement, public IItemable + { + public: + GroupItem(); + GroupItem(const Oval& elem); + GroupItem(const Rect& elem); + GroupItem(const Roundrect& elem); + GroupItem(const ShapeType& elem); + GroupItem(const Shape& elem); + GroupItem(const Line& elem); + GroupItem(const Group& elem); + + virtual ~GroupItem(); + explicit GroupItem(const XML::XNode& node); + const GroupItem& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + }; + + class Group : public WritingElement + { + public: + Group(); + virtual ~Group(); + explicit Group(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property id; + property spid; + property style; + property coordorigin; + property coordsize; + + property> items; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_GROUP_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/H.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/H.cpp new file mode 100644 index 0000000000..84c70541c6 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/H.cpp @@ -0,0 +1,58 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "H.h" + + +namespace OOX +{ + namespace Logic + { + + H::H() + { + } + + + H::~H() + { + } + + + H::H(const XML::XNode& node) + { + fromXML(node); + } + + + const H& H::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void H::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Position = element.attribute("position").value(); + XRange = element.attribute("xrange").value(); + YRange = element.attribute("yrange").value(); + } + + + const XML::XNode H::toXML() const + { + return + XML::XElement(ns.v + "h", + XML::XAttribute("position", Position) + + XML::XAttribute("xrange", XRange) + + XML::XAttribute("yrange", YRange) + + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/H.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/H.h new file mode 100644 index 0000000000..c367215d24 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/H.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef OOX_LOGIC_H_INCLUDE_H_ +#define OOX_LOGIC_H_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include "nullable_property.h" +#include + + +namespace OOX +{ + namespace Logic + { + class H : public WritingElement + { + public: + H(); + virtual ~H(); + explicit H(const XML::XNode& node); + const H& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Position; + nullable_property XRange; + nullable_property YRange; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_H_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Handles.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Handles.cpp new file mode 100644 index 0000000000..9aedd751d7 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Handles.cpp @@ -0,0 +1,50 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Handles.h" + + +namespace OOX +{ + namespace Logic + { + + Handles::Handles() + { + } + + + Handles::~Handles() + { + } + + + Handles::Handles(const XML::XNode& node) + { + fromXML(node); + } + + + const Handles& Handles::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Handles::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Fill(Hs, element, "h"); + } + + + const XML::XNode Handles::toXML() const + { + return XML::XElement(ns.v + "handles", XML::Write(Hs)); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Handles.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Handles.h new file mode 100644 index 0000000000..46e2c06ac8 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Handles.h @@ -0,0 +1,34 @@ +#pragma once +#ifndef OOX_LOGIC_HANDLES_INCLUDE_H_ +#define OOX_LOGIC_HANDLES_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include +#include "H.h" +#include + + +namespace OOX +{ + namespace Logic + { + class Handles : public WritingElement + { + public: + Handles(); + virtual ~Handles(); + explicit Handles(const XML::XNode& node); + const Handles& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property > Hs; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_HANDLES_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/HeaderReference.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/HeaderReference.cpp new file mode 100644 index 0000000000..a51f4e8c02 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/HeaderReference.cpp @@ -0,0 +1,61 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "HeaderReference.h" + + +namespace OOX +{ + namespace Logic + { + + HeaderReference::HeaderReference() + { + } + + + HeaderReference::~HeaderReference() + { + } + + + HeaderReference::HeaderReference(const XML::XNode& node) + { + fromXML(node); + } + + + const HeaderReference& HeaderReference::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void HeaderReference::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + rId = element.attribute("id").value().ToString(); + Type = element.attribute("type").value(); + } + + + const XML::XNode HeaderReference::toXML() const + { + return + XML::XElement(ns.w + "headerReference", + XML::XAttribute(ns.r + "id", rId) + + XML::XAttribute(ns.w + "type", Type) + ); + } + + + const std::string HeaderReference::toTxt() const + { + return ""; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/HeaderReference.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/HeaderReference.h new file mode 100644 index 0000000000..aff0a2583b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/HeaderReference.h @@ -0,0 +1,35 @@ +#ifndef OOX_LOGIC_HEADER_REFERENCE_INCLUDE_H_ +#define OOX_LOGIC_HEADER_REFERENCE_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "./../RId.h" +#include "property.h" +#include +#include "./../Limit/TypeFootHead.h" + + +namespace OOX +{ + namespace Logic + { + class HeaderReference : public WritingElement + { + public: + HeaderReference(); + virtual ~HeaderReference(); + explicit HeaderReference(const XML::XNode& node); + const HeaderReference& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + virtual const std::string toTxt() const; + + public: + property rId; + property Type; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_HEADER_REFERENCE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Hyperlink.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Hyperlink.cpp new file mode 100644 index 0000000000..fb130ecfdc --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Hyperlink.cpp @@ -0,0 +1,70 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Hyperlink.h" + + +namespace OOX +{ + namespace Logic + { + + Hyperlink::Hyperlink() + { + } + + + Hyperlink::~Hyperlink() + { + } + + + Hyperlink::Hyperlink(const XML::XNode& node) + { + fromXML(node); + } + + + const Hyperlink& Hyperlink::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Hyperlink::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + if (element.attribute("id").exist()) + rId = element.attribute("id").value().ToString(); + Anchor = element.attribute("anchor").value(); + History = element.attribute("history").value(); + XML::Fill(Runs, element, "r"); + } + + + const XML::XNode Hyperlink::toXML() const + { + return + XML::XElement(ns.w + "hyperlink", + XML::XAttribute(ns.r + "id", rId) + + XML::XAttribute(ns.w + "anchor", Anchor) + + XML::XAttribute(ns.w + "history", History) + + XML::Write(Runs) + ); + } + + + const std::string Hyperlink::toTxt() const + { + std::string text; + BOOST_FOREACH(const Run& run, *Runs) + text += run.toTxt(); + return text; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Hyperlink.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Hyperlink.h new file mode 100644 index 0000000000..1209a0a9e9 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Hyperlink.h @@ -0,0 +1,40 @@ +#pragma once +#ifndef OOX_LOGIC_HYPERLINK_INCLUDE_H_ +#define OOX_LOGIC_HYPERLINK_INCLUDE_H_ + +#include "ParagraphItemBase.h" +#include "Run.h" +#include "property.h" +#include "nullable_property.h" +#include "./../RId.h" +#include +#include + + +namespace OOX +{ + namespace Logic + { + class Hyperlink : public ParagraphItemBase + { + public: + Hyperlink(); + virtual ~Hyperlink(); + explicit Hyperlink(const XML::XNode& node); + const Hyperlink& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + virtual const std::string toTxt() const; + + public: + nullable_property rId; + property > Runs; + nullable_property Anchor; + nullable_property History; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_HYPERLINK_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/ImageData.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ImageData.cpp new file mode 100644 index 0000000000..37ae2f1f61 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ImageData.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ImageData.h" + + +namespace OOX +{ + namespace Logic + { + + ImageData::ImageData() + { + } + + + ImageData::~ImageData() + { + } + + + ImageData::ImageData(const XML::XNode& node) + { + fromXML(node); + } + + + const ImageData& ImageData::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void ImageData::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + rId = element.attribute("id").value().ToString(); + Title = element.attribute("title").value(); + } + + + const XML::XNode ImageData::toXML() const + { + return + XML::XElement(ns.v + "imagedata", + XML::XAttribute(ns.r + "id", rId) + + XML::XAttribute(ns.o + "title", Title) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/ImageData.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ImageData.h new file mode 100644 index 0000000000..ce2de20483 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ImageData.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef OOX_LOGIC_IMAGE_DATA_INCLUDE_H_ +#define OOX_LOGIC_IMAGE_DATA_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include "nullable_property.h" +#include +#include "./../RId.h" + + +namespace OOX +{ + namespace Logic + { + class ImageData : public WritingElement + { + public: + ImageData(); + virtual ~ImageData(); + explicit ImageData(const XML::XNode& node); + const ImageData& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property rId; + nullable_property Title; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_IMAGE_DATA_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Ind.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Ind.cpp new file mode 100644 index 0000000000..e9f54cabf0 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Ind.cpp @@ -0,0 +1,88 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Ind.h" + + +namespace OOX +{ + namespace Logic + { + + Ind::Ind() + { + } + + + Ind::~Ind() + { + } + + + Ind::Ind(const XML::XNode& node) + { + fromXML(node); + } + + + const Ind& Ind::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Ind::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + //Left = element.attribute("left").value(); + if (element.attribute("left").exist()) + { + int left = element.attribute("left").value(); + UniversalUnit value(left, UniversalUnit::Dx); + Left = value; + } + //Right = element.attribute("right").value(); + if (element.attribute("right").exist()) + { + int right = element.attribute("right").value(); + UniversalUnit value(right, UniversalUnit::Dx); + Right = value; + } + if (element.attribute("hanging").exist()) + { + int hanging = element.attribute("hanging").value(); + UniversalUnit value(hanging, UniversalUnit::Dx); + Hanging = value; + } + //Hanging = element.attribute("hanging").value(); + if (element.attribute("firstLine").exist()) + { + int first = element.attribute("firstLine").value(); + UniversalUnit value(first, UniversalUnit::Dx); + FirstLine = value; + } + } + + + const XML::XNode Ind::toXML() const + { + return + XML::XElement(ns.w + "ind", + XML::XAttribute(ns.w + "left", Left) + + XML::XAttribute(ns.w + "right", Right) + + XML::XAttribute(ns.w + "hanging", Hanging) + + XML::XAttribute(ns.w + "firstLine", FirstLine) + ); + } + + + const bool Ind::isSimple() const + { + return (!Left.is_init() && !Right.is_init() && !Hanging.is_init() && !FirstLine.is_init()); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Ind.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Ind.h new file mode 100644 index 0000000000..ce78541d65 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Ind.h @@ -0,0 +1,38 @@ +#pragma once +#ifndef OOX_LOGIC_IND_INCLUDE_H_ +#define OOX_LOGIC_IND_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "nullable_property.h" +#include "./../Unit.h" + + +namespace OOX +{ + namespace Logic + { + class Ind : public WritingElement + { + public: + Ind(); + virtual ~Ind(); + explicit Ind(const XML::XNode& node); + const Ind& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + const bool isSimple() const; + + public: + nullable_property Left; + nullable_property Right; + nullable_property Hanging; + nullable_property FirstLine; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_IND_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Index.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Index.cpp new file mode 100644 index 0000000000..ceeddae919 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Index.cpp @@ -0,0 +1,71 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Index.h" + + +namespace OOX +{ + namespace Logic + { + + Index::Index() + { + } + + + Index::Index(const Common::Index& index) + { + fromBase(index); + } + + + Index::Index(const std::string& value) + { + fromString(value); + } + + + const Index& Index::operator= (const Common::Index& index) + { + fromBase(index); + return *this; + } + + + const Index& Index::operator= (const std::string& value) + { + fromString(value); + return *this; + } + + + const std::string Index::ToString() const + { + switch (type()) + { + case super: + return "superscript"; + case normal: + return ""; + case sub: + return "subscript"; + default: + return ""; + } + } + + + void Index::fromString(const std::string& value) + { + if (value == "superscript") + setSuper(); + else if (value == "subscript") + setSub(); + else + setNormal(); + } + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Index.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Index.h new file mode 100644 index 0000000000..c1bd948b62 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Index.h @@ -0,0 +1,30 @@ +#pragma once +#ifndef OOX_LOGIC_INDEX_INCLUDE_H_ +#define OOX_LOGIC_INDEX_INCLUDE_H_ + +#include "Common.h" +#include + + +namespace OOX +{ + namespace Logic + { + class Index : public Common::Index + { + public: + Index(); + Index(const Common::Index& index); + Index(const std::string& value); + + const Index& operator= (const Common::Index& index); + const Index& operator= (const std::string& value); + + public: + const std::string ToString() const; + void fromString(const std::string& value); + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_INDEX_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Inline.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Inline.cpp new file mode 100644 index 0000000000..9c5e2e0eae --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Inline.cpp @@ -0,0 +1,147 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Inline.h" + +namespace OOX +{ + namespace Logic + { + Inline::Inline() + { + + } + + Inline::~Inline() + { + + } + + Inline::Inline(const XML::XNode& node) + { + fromXML(node); + } + + const Inline& Inline::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void Inline::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + distanceLeftTop.init(); + + distanceLeftTop->X = element.attribute("distL").value().ToString(); + distanceLeftTop->Y = element.attribute("distT").value().ToString(); + + distanceRightBottom.init(); + + distanceRightBottom->X = element.attribute("distR").value().ToString(); + distanceRightBottom->Y = element.attribute("distB").value().ToString(); + + Name = element.XName->Name; + + if (element.attribute("distT").exist()) + DistT = element.attribute("distT").value(); + if (element.attribute("distB").exist()) + DistB = element.attribute("distB").value(); + if (element.attribute("distL").exist()) + DistL = element.attribute("distL").value(); + if (element.attribute("distR").exist()) + DistR = element.attribute("distR").value(); + + Extent = element.element("extent"); + DocPr = element.element("docPr"); + NoChangeAspect = element.element("cNvGraphicFramePr").element("graphicFrameLocks").attribute("noChangeAspect").value(); + Graphic = element.element("graphic"); + + anchorXY.init(); + anchorXY->X = 0; + anchorXY->Y = 0; + + if (element.element("positionH").exist()) + { + anchorXY->X = element.element("positionH").element("posOffset").text().ToString(); + + positionH = element.element("positionH").element("posOffset").text(); + positionHAlign = element.element("positionH").element("align").text(); + positionHRelativeFrom = element.element("positionH").attribute("relativeFrom").value(); + } + + if (element.element("positionV").exist()) + { + anchorXY->Y = element.element("positionV").element("posOffset").text().ToString(); + + positionV = element.element("positionV").element("posOffset").text(); + positionVAlign = element.element("positionV").element("align").text(); + positionVRelativeFrom = element.element("positionV").attribute("relativeFrom").value(); + } + + Wrap = element; + + SimplePos = element.attribute("simplePos").value(); + SimplePosPoint = element.element("simplePos"); + RelativeHeight = element.attribute("relativeHeight").value(); + BehindDoc = element.attribute("behindDoc").value(); + Locked = element.attribute("locked").value(); + LayoutInCell = element.attribute("layoutInCell").value(); + AllowOverlap = element.attribute("allowOverlap").value(); + } + + const XML::XNode Inline::toXML() const + { + return + XML::XElement(ns.wp + Name.ToString(), + XML::XAttribute("distT", DistT) + + XML::XAttribute("distB", DistB) + + XML::XAttribute("distL", DistL) + + XML::XAttribute("distR", DistR) + + + XML::XAttribute("simplePos", SimplePos) + + XML::XAttribute("relativeHeight", RelativeHeight) + + XML::XAttribute("behindDoc", BehindDoc) + + XML::XAttribute("locked", Locked) + + XML::XAttribute("layoutInCell", LayoutInCell) + + XML::XAttribute("allowOverlap", AllowOverlap) + + + XML::Write(SimplePosPoint) + + WriteIf( + XML::XElement(ns.wp + "positionH", + XML::XAttribute("relativeFrom", positionHRelativeFrom.get_value_or("column")) + + WriteIf( XML::XElement(ns.wp + "posOffset", + XML::XText(positionH) + ), positionH.is_init()) + + WriteIf( XML::XElement(ns.wp + "align", + XML::XText(positionHAlign) + ), positionHAlign.is_init()) + ), positionH.is_init() || positionHAlign.is_init()) + + WriteIf( + XML::XElement(ns.wp + "positionV", + XML::XAttribute("relativeFrom", positionVRelativeFrom.get_value_or("paragraph")) + + WriteIf( XML::XElement(ns.wp + "posOffset", + XML::XText(positionV) + ), positionV.is_init()) + + WriteIf( XML::XElement(ns.wp + "align", + XML::XText(positionVAlign) + ), positionVAlign.is_init()) + ), positionV.is_init() || positionVAlign.is_init()) + + XML::Write(Extent) + + XML::Write(EffectExtent) + + XML::Write(Wrap) + + XML::Write(DocPr) + + XML::XElement(ns.wp + "cNvGraphicFramePr", + XML::XElement(ns.a + "graphicFrameLocks", + XML::XAttribute("noChangeAspect", NoChangeAspect) + ) + ) + + XML::Write(Graphic) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Inline.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Inline.h new file mode 100644 index 0000000000..d38855e507 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Inline.h @@ -0,0 +1,74 @@ +#pragma once +#ifndef OOX_LOGIC_INLINE_INCLUDE_H_ +#define OOX_LOGIC_INLINE_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "Extent.h" +#include "EffectExtent.h" +#include "DocPr.h" +#include "Graphic.h" +#include "property.h" +#include "nullable_property.h" +#include "./../Limit/InlineName.h" +#include "DrawingWrap.h" +#include "Point2D.h" + +namespace OOX +{ + namespace Logic + { + class Inline : public WritingElement + { + public: + Inline(); + virtual ~Inline(); + explicit Inline(const XML::XNode& node); + const Inline& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Name; + + nullable> distanceLeftTop; + nullable> distanceRightBottom; + + nullable_property DistT; + nullable_property DistB; + nullable_property DistL; + nullable_property DistR; + nullable_property Extent; + property EffectExtent; + nullable_property DocPr; + nullable_property NoChangeAspect; + property Graphic; + + // anchor only + + nullable> anchorXY; + + nullable_property positionV; + nullable_property positionVRelativeFrom; + nullable_property positionVAlign; + nullable_property positionH; + nullable_property positionHRelativeFrom; + nullable_property positionHAlign; + + nullable_property Wrap; + + // required in anchor + + nullable_property SimplePos; + nullable_property SimplePosPoint; + nullable_property RelativeHeight; + nullable_property BehindDoc; + nullable_property Locked; + nullable_property LayoutInCell; + nullable_property AllowOverlap; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_INLINE_INCLUDE_H \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Insert.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Insert.cpp new file mode 100644 index 0000000000..04456584a3 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Insert.cpp @@ -0,0 +1,70 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Insert.h" + + +namespace OOX +{ + namespace Logic + { + + Insert::Insert() + { + } + + + Insert::~Insert() + { + } + + + Insert::Insert(const XML::XNode& node) + { + fromXML(node); + } + + + const Insert& Insert::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Insert::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + Id = element.attribute("id").value(); + Author = element.attribute("author").value(); + Date = element.attribute("date").value(); + + XML::Fill(Runs, element, "r"); + } + + + const XML::XNode Insert::toXML() const + { + return + XML::XElement(ns.w + "ins", + XML::XAttribute(ns.w + "id", Id) + + XML::XAttribute(ns.w + "author", Author) + + XML::XAttribute(ns.w + "date", Date) + + XML::Write(Runs) + ); + } + + + const std::string Insert::toTxt() const + { + std::string text; + BOOST_FOREACH(const Run& run, *Runs) + text += run.toTxt(); + return text; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Insert.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Insert.h new file mode 100644 index 0000000000..d4bfe8d63a --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Insert.h @@ -0,0 +1,38 @@ +#pragma once +#ifndef OOX_LOGIC_INSERT_INCLUDE_H_ +#define OOX_LOGIC_INSERT_INCLUDE_H_ + +#include "ParagraphItemBase.h" +#include "Run.h" +#include "property.h" +#include "nullable_property.h" +#include + + +namespace OOX +{ + namespace Logic + { + class Insert : public ParagraphItemBase + { + public: + Insert(); + virtual ~Insert(); + explicit Insert(const XML::XNode& node); + const Insert& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + virtual const std::string toTxt() const; + + public: + nullable_property Id; + nullable_property Author; + nullable_property Date; + property > Runs; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_INSERT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/InstrText.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/InstrText.cpp new file mode 100644 index 0000000000..74c1c072c6 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/InstrText.cpp @@ -0,0 +1,56 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "InstrText.h" + + +namespace OOX +{ + namespace Logic + { + + InstrText::InstrText() + { + } + + + InstrText::~InstrText() + { + } + + + InstrText::InstrText(const XML::XNode& node) + { + fromXML(node); + } + + + const InstrText& InstrText::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void InstrText::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Text = element.text(); + } + + + const XML::XNode InstrText::toXML() const + { + return XML::XElement(ns.w + "instrText", XML::XText(Text)); + } + + + const std::string InstrText::toTxt() const + { + return Text; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/InstrText.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/InstrText.h new file mode 100644 index 0000000000..bfdeb0d131 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/InstrText.h @@ -0,0 +1,34 @@ +#pragma once +#ifndef OOX_LOGIC_INSTR_TEXT_INCLUDE_H_ +#define OOX_LOGIC_INSTR_TEXT_INCLUDE_H_ + +#include "RunItemBase.h" +#include "nullable_property.h" + + +namespace OOX +{ + namespace Logic + { + class InstrText : public RunItemBase + { + public: + InstrText(); + virtual ~InstrText(); + explicit InstrText(const XML::XNode& node); + const InstrText& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + virtual const std::string toTxt() const; + + public: + nullable_property Text; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_INSTR_TEXT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Lang.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Lang.cpp new file mode 100644 index 0000000000..6ae678ae65 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Lang.cpp @@ -0,0 +1,57 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Lang.h" + + +namespace OOX +{ + namespace Logic + { + + Lang::Lang() + { + } + + + Lang::~Lang() + { + } + + + Lang::Lang(const XML::XNode& node) + { + fromXML(node); + } + + + const Lang& Lang::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Lang::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Value = element.attribute("val").value(); + EastAsia = element.attribute("eastAsia").value(); + Bidi = element.attribute("bidi").value(); + } + + + const XML::XNode Lang::toXML() const + { + return + XML::XElement(ns.w + "lang", + XML::XAttribute(ns.w + "val", Value) + + XML::XAttribute(ns.w + "eastAsia", EastAsia) + + XML::XAttribute(ns.w + "bidi", Bidi) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Lang.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Lang.h new file mode 100644 index 0000000000..1570a35f21 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Lang.h @@ -0,0 +1,34 @@ +#pragma once +#ifndef OOX_LOGIC_LANG_INCLUDE_H_ +#define OOX_LOGIC_LANG_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "nullable_property.h" + + +namespace OOX +{ + namespace Logic + { + class Lang : public WritingElement + { + public: + Lang(); + virtual ~Lang(); + explicit Lang(const XML::XNode& node); + const Lang& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property Value; + nullable_property EastAsia; + nullable_property Bidi; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_LANG_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Line.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Line.cpp new file mode 100644 index 0000000000..8f7fee9ef3 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Line.cpp @@ -0,0 +1,58 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Line.h" + +namespace OOX +{ + namespace Logic + { + Line::Line() + { + + } + + Line::~Line() + { + + } + + Line::Line(const XML::XNode& node) + { + fromXML(node); + } + + const Line& Line::operator = (const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void Line::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + Id = element.attribute("id").value(); + style = element.attribute("style").value(); + Wrap = element.element("wrap"); + anchorlock = element.element("anchorlock"); + + fillstyle = element; + linestyle = element; + shadow = element.element("shadow"); + + if (element.attribute("from").exist()) + from = element.attribute("from").value(); + if (element.attribute("to").exist()) + to = element.attribute("to").value(); + } + + const XML::XNode Line::toXML() const + { + return XML::XNode(); + } + + } // namespace Logic +} // namespace OOX diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Line.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Line.h new file mode 100644 index 0000000000..47b4c7f5ba --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Line.h @@ -0,0 +1,47 @@ +#pragma once +#ifndef OOX_LOGIC_LINE_INCLUDE_H_ +#define OOX_LOGIC_LINE_INCLUDE_H_ + +#include "Wrap.h" +#include "Shadow.h" +#include "TextBox.h" +#include "LineStyle.h" +#include "FillStyle.h" +#include "ShapeStyle.h" + +namespace OOX +{ + namespace Logic + { + class Line : public WritingElement + { + public: + Line(); + virtual ~Line(); + explicit Line(const XML::XNode& node); + const Line& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Id; + property style; + + nullable_property Wrap; + nullable_property anchorlock; + + nullable_property fillstyle; + nullable_property linestyle; + nullable_property shadow; + + nullable_property from; + nullable_property to; + + nullable_property textbox; // none + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_LINE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/LineStyle.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/LineStyle.cpp new file mode 100644 index 0000000000..422f7e2dbe --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/LineStyle.cpp @@ -0,0 +1,99 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "LineStyle.h" + +namespace OOX +{ + namespace Logic + { + LineStyle::LineStyle() + { + + } + + LineStyle::~LineStyle() + { + + } + + LineStyle::LineStyle(const XML::XNode& node) + { + fromXML(node); + } + + const LineStyle& LineStyle::operator = (const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void LineStyle::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + if (element.attribute("stroked").exist()) + stroked = element.attribute("stroked").value(); + + if (element.attribute("strokecolor").exist()) + strokeColor = element.attribute("strokecolor").value(); + + if (element.attribute("strokeweight").exist()) + strokeWeight = element.attribute("strokeweight").value(); + + const XML::XElement strokeXML = element.element("stroke"); + if (strokeXML.is_init()) + { + if (strokeXML.attribute("linestyle").exist()) + lineStyle = strokeXML.attribute ("linestyle").value(); + if (strokeXML.attribute("dashstyle").exist()) + dashStyle = strokeXML.attribute ("dashstyle").value(); + if (strokeXML.attribute("opacity").exist()) + opacity = strokeXML.attribute ("opacity").value(); + if (strokeXML.attribute("endcap").exist()) + endcap = strokeXML.attribute ("endcap").value(); + if (strokeXML.attribute("startarrow").exist()) + startarrow = strokeXML.attribute ("startarrow").value(); + if (strokeXML.attribute("endarrow").exist()) + endarrow = strokeXML.attribute ("endarrow").value(); + if (strokeXML.attribute("startarrowwidth").exist()) + startarrowwidth = strokeXML.attribute ("startarrowwidth").value(); + if (strokeXML.attribute("startarrowlength").exist()) + startarrowlength = strokeXML.attribute ("startarrowlength").value(); + if (strokeXML.attribute("endarrowwidth").exist()) + endarrowwidth = strokeXML.attribute ("endarrowwidth").value(); + if (strokeXML.attribute("endarrowlength").exist()) + endarrowlength = strokeXML.attribute ("endarrowlength").value(); + } + + if (element.attribute("color").exist()) + strokeColor = element.attribute("color").value(); + if (element.attribute("opacity").exist()) + strokeColor = element.attribute("opacity").value(); + if (element.attribute("weight").exist()) + strokeWeight = element.attribute("weight").value(); + if (element.attribute("endcap").exist()) + endcap = element.attribute("endcap").value(); + if (element.attribute("startarrow").exist()) + startarrow = element.attribute ("startarrow").value(); + if (element.attribute("endarrow").exist()) + endarrow = element.attribute ("endarrow").value(); + if (element.attribute("startarrowwidth").exist()) + startarrowwidth = element.attribute ("startarrowwidth").value(); + if (element.attribute("startarrowlength").exist()) + startarrowlength = element.attribute ("startarrowlength").value(); + if (element.attribute("endarrowwidth").exist()) + endarrowwidth = element.attribute ("endarrowwidth").value(); + if (element.attribute("endarrowlength").exist()) + endarrowlength = element.attribute ("endarrowlength").value(); + } + + const XML::XNode LineStyle::toXML() const + { + return XML::XElement(); + } + + } // namespace Logic +} // namespace OOX diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/LineStyle.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/LineStyle.h new file mode 100644 index 0000000000..5e0e0170d8 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/LineStyle.h @@ -0,0 +1,45 @@ +#pragma once +#ifndef OOX_LOGIC_LINE_STYLE_INCLUDE_H_ +#define OOX_LOGIC_LINE_STYLE_INCLUDE_H_ + +#include + +#include "./../WritingElement.h" +#include "property.h" +#include "nullable_property.h" + +namespace OOX +{ + namespace Logic + { + class LineStyle : public WritingElement + { + public: + LineStyle(); + virtual ~LineStyle(); + explicit LineStyle(const XML::XNode& node); + const LineStyle& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property strokeColor; + nullable_property stroked; + nullable_property strokeWeight; + nullable_property lineStyle; + nullable_property dashStyle; + nullable_property opacity; + nullable_property endcap; + nullable_property startarrow; + nullable_property startarrowwidth; + nullable_property startarrowlength; + nullable_property endarrow; + nullable_property endarrowwidth; + nullable_property endarrowlength; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_LINE_STYLE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/List.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/List.cpp new file mode 100644 index 0000000000..08c575a8c6 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/List.cpp @@ -0,0 +1,103 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "List.h" +#include "Paragraph.h" + + +namespace OOX +{ + namespace Logic + { + + List::List() + { + Num = 0; + } + + + List::~List() + { + } + + + //List::List(const XML::XNode& node) + //{ + // add(node); + //} + + + //const List& List::operator =(const XML::XNode& node) + //{ + // add(node); + // return *this; + //} + + + //void List::fromXML(const XML::XNode& node) + //{ + //} + + + //const XML::XNode List::toXML() const + //{ + // return XML::XContainer(XML::Write(Items)); + //} + + +// void List::add(const XML::XNode& node) +// { +// const XML::XElement element(node); +// if (Items->empty()) +// { +// Num = element.element("pPr").element("numPr").element("numId").attribute("val").value(); +// Level = element.element("pPr").element("numPr").element("ilvl").attribute("val").value(); +// } +// if (element.element("pPr").element("numPr").element("ilvl").attribute("val").value() == Level) +// { +// TextItem text(element); +//// text.inList(); +// ListItem listItem; +// listItem.Items->push_back(text); +// Items->push_back(listItem); +// } +// else +// Items->back().add(element); +// } + + + //void List::add(const TextItem& text) + //{ + // Items->back().add(text); + //} + + + void List::add(const Paragraph& text) + { + if(Items->empty()) + { + int num = text.GetListNum(); + if(num > 0) + { + Num = num; + Items->push_back(text); + } + } + else + { + int num = text.GetListNum(); + if(*Num == num) + Items->push_back(text); + } + } + + + const bool List::elementFromThisList(const XML::XNode& node) const + { + const XML::XElement element(node); + return (element.element("pPr").element("numPr").element("numId").attribute("val").value() == Num); + } + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/List.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/List.h new file mode 100644 index 0000000000..b8daf3d7ad --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/List.h @@ -0,0 +1,44 @@ +#pragma once +#ifndef OOX_LOGIC_LIST_INCLUDE_H_ +#define OOX_LOGIC_LIST_INCLUDE_H_ + +//#include "TextItemBase.h" +#include +//#include "ListItem.h" +//#include "TextItem.h" +#include "Paragraph.h" + + +namespace OOX +{ + namespace Logic + { + class List //: public TextItemBase + { + public: + List(); + virtual ~List(); + //explicit List(const XML::XNode& node); + //const List& operator =(const XML::XNode& node); + + //public: + // virtual void fromXML(const XML::XNode& node); + // virtual const XML::XNode toXML() const; + + public: + //void add(const XML::XNode& node);//äîáàâëåíèå ýëåìåíòà ñ íîìåðîì + //void add(const TextItem& text); //äîáàâëåíèå ýëåìåíòà áåç íîìåðà + void add(const Paragraph& text); + + public: + const bool elementFromThisList(const XML::XNode& node) const; + + public: + property > Items; + //property Level; + property Num; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_LIST_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/LnNumType.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/LnNumType.cpp new file mode 100644 index 0000000000..92064946ef --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/LnNumType.cpp @@ -0,0 +1,52 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "LnNumType.h" + +namespace OOX +{ + namespace Logic + { + LnNumType::LnNumType() + { + + } + + LnNumType::~LnNumType() + { + + } + + LnNumType::LnNumType(const XML::XNode& node) + { + fromXML(node); + } + + const LnNumType& LnNumType::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void LnNumType::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + countBy = element.attribute("countBy").value(); + start = element.attribute("start").value(); + //distance = element.attribute("distance").value(); + restart = element.attribute("restart").value(); + } + + const XML::XNode LnNumType::toXML() const + { + return XML::XElement(ns.w + "lnNumType", + XML::XAttribute(ns.w + "countBy", countBy) + + XML::XAttribute(ns.w + "start", start) + + //XML::XAttribute(ns.w + "distance", distance) + + XML::XAttribute(ns.w + "restart", restart) ); + } + } +} \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/LnNumType.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/LnNumType.h new file mode 100644 index 0000000000..0f5bda485c --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/LnNumType.h @@ -0,0 +1,32 @@ +#pragma once + +#include + +#include "./../WritingElement.h" +#include "property.h" +#include "nullable_property.h" + +namespace OOX +{ + namespace Logic + { + class LnNumType : public WritingElement + { + public: + LnNumType(); + virtual ~LnNumType(); + explicit LnNumType(const XML::XNode& node); + const LnNumType& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property start; + nullable_property countBy; + nullable_property distance; + nullable_property restart; + }; + } +} \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Lock.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Lock.cpp new file mode 100644 index 0000000000..f347e9812a --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Lock.cpp @@ -0,0 +1,59 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Lock.h" + + +namespace OOX +{ + namespace Logic + { + + Lock::Lock() + { + } + + + Lock::~Lock() + { + } + + + Lock::Lock(const XML::XNode& node) + { + fromXML(node); + } + + + const Lock& Lock::operator = (const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Lock::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Aspectratio = element.attribute("aspectratio").value(); + Ext = element.attribute("ext").value(); + Text = element.attribute("text").value(); + ShapeType = element.attribute("shapetype").value(); + } + + + const XML::XNode Lock::toXML() const + { + return + XML::XElement(ns.o + "lock", + XML::XAttribute("aspectratio", Aspectratio) + + XML::XAttribute(ns.v + "ext", Ext) + + XML::XAttribute("text", Text) + + XML::XAttribute("shapetype", ShapeType) + ); + } + + } // namespace Logic +} // namespace OOX diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Lock.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Lock.h new file mode 100644 index 0000000000..9034eb4554 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Lock.h @@ -0,0 +1,37 @@ +#pragma once +#ifndef OOX_LOGIC_LOCK_INCLUDE_H_ +#define OOX_LOGIC_LOCK_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "property.h" +#include "./../Limit/TrueFalse.h" +#include "./../Limit/Ext.h" + + +namespace OOX +{ + namespace Logic + { + class Lock : public WritingElement + { + public: + Lock(); + virtual ~Lock(); + explicit Lock(const XML::XNode& node); + const Lock& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Ext; + nullable_property Aspectratio; + nullable_property Text; + nullable_property ShapeType; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_LOCK_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/NoteProperty.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/NoteProperty.cpp new file mode 100644 index 0000000000..3329ab1473 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/NoteProperty.cpp @@ -0,0 +1,23 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "NoteProperty.h" + + +namespace OOX +{ + namespace Logic + { + + NoteProperty::NoteProperty() + { + } + + + NoteProperty::~NoteProperty() + { + } + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/NoteProperty.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/NoteProperty.h new file mode 100644 index 0000000000..e2c87b08ff --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/NoteProperty.h @@ -0,0 +1,25 @@ +#ifndef OOX_LOGIC_NOTE_PROPERTY_INCLUDE_H_ +#define OOX_LOGIC_NOTE_PROPERTY_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "NumFormat.h" + + +namespace OOX +{ + namespace Logic + { + class NoteProperty + { + public: + NoteProperty(); + ~NoteProperty(); + + public: + property NumFormat; + property NumStart; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_NOTE_PROPERTY_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/NullRun.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/NullRun.cpp new file mode 100644 index 0000000000..d8321d7b06 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/NullRun.cpp @@ -0,0 +1,54 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "NullRun.h" + + +namespace OOX +{ + namespace Logic + { + + NullRun::NullRun() + { + } + + + NullRun::~NullRun() + { + } + + + NullRun::NullRun(const XML::XNode& node) + { + fromXML(node); + } + + + const NullRun& NullRun::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void NullRun::fromXML(const XML::XNode& node) + { + } + + + const XML::XNode NullRun::toXML() const + { + return XML::XNode(); + } + + + const std::string NullRun::toTxt() const + { + return ""; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/NullRun.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/NullRun.h new file mode 100644 index 0000000000..1cd06594ed --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/NullRun.h @@ -0,0 +1,28 @@ +#pragma once +#ifndef OOX_LOGIC_NULL_RUN_INCLUDE_H_ +#define OOX_LOGIC_NULL_RUN_INCLUDE_H_ + +#include "RunItemBase.h" + + +namespace OOX +{ + namespace Logic + { + class NullRun : public RunItemBase + { + public: + NullRun(); + virtual ~NullRun(); + explicit NullRun(const XML::XNode& node); + const NullRun& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + virtual const std::string toTxt() const; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_NULL_RUN_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/NumFormat.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/NumFormat.cpp new file mode 100644 index 0000000000..ab2100c535 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/NumFormat.cpp @@ -0,0 +1,126 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "NumFormat.h" + + +namespace OOX +{ + namespace Logic + { + + NumFormat::NumFormat() + { + } + + + NumFormat::~NumFormat() + { + } + + + NumFormat::NumFormat(const Common::NumFormat& numFormat) + { + fromBase(numFormat); + } + + + NumFormat::NumFormat(const XML::XNode& node) + { + fromXML(node); + } + + + NumFormat::NumFormat(const std::string& format) + { + fromString(format); + } + + + const NumFormat& NumFormat::operator = (const Common::NumFormat& numFormat) + { + fromBase(numFormat); + return *this; + } + + + const NumFormat& NumFormat::operator = (const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + const NumFormat& NumFormat::operator = (const std::string& format) + { + fromString(format); + return *this; + } + + + void NumFormat::fromXML(const XML::XNode& node) + { + XML::XElement element(node); + fromString(element.attribute("val").value()); + } + + + const XML::XNode NumFormat::toXML() const + { + return + XML::XElement(ns.w + "numFmt", + XML::XAttribute(ns.w + "val", ToString()) + ); + } + + + const std::string NumFormat::ToString() const + { + switch (type()) + { + case upperLetter: + return "upperLetter"; + case lowerLetter: + return "lowerLetter"; + case upperRoman: + return "upperRoman"; + case lowerRoman: + return "lowerRoman"; + case decimal: + return "decimal"; + case symbol: + return "symbol"; + case bullet: + return "bullet"; + case chicago: + return "chicago"; + default: + return "decimal"; + } + } + + + void NumFormat::fromString(const std::string& value) + { + if (value == "upperLetter") + setUpperLetter(); + else if (value == "lowerLetter") + setLowerLetter(); + else if (value == "upperRoman") + setUpperRoman(); + else if (value == "lowerRoman") + setLowerRoman(); + else if (value == "symbol") + setSymbol(); + else if (value == "bullet") + setBullet(); + else if (value == "chicago") + setChicago(); + else + setDecimal(); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/NumFormat.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/NumFormat.h new file mode 100644 index 0000000000..c6c806b1be --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/NumFormat.h @@ -0,0 +1,40 @@ +#pragma once +#ifndef OOX_LOGIC_NUM_FORMAT_INCLUDE_H_ +#define OOX_LOGIC_NUM_FORMAT_INCLUDE_H_ + +#include +#include "Common.h" +#include "./../Namespaces.h" +#include "./../WritingElement.h" + + +namespace OOX +{ + namespace Logic + { + class NumFormat : public Common::NumFormat, public WritingElement + { + public: + NumFormat(); + virtual ~NumFormat(); + explicit NumFormat(const Common::NumFormat& numFormat); + explicit NumFormat(const XML::XNode& node); + explicit NumFormat(const std::string& format); + + public: + const NumFormat& operator =(const Common::NumFormat& numFormat); + const NumFormat& operator =(const XML::XNode& node); + const NumFormat& operator =(const std::string& format); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + const std::string ToString() const; + void fromString(const std::string& value); + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_NUM_FORMAT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/NumPr.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/NumPr.cpp new file mode 100644 index 0000000000..7b59b09b3e --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/NumPr.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "NumPr.h" + + +namespace OOX +{ + namespace Logic + { + + NumPr::NumPr() + { + } + + + NumPr::~NumPr() + { + } + + + NumPr::NumPr(const XML::XNode& node) + { + fromXML(node); + } + + + const NumPr& NumPr::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void NumPr::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Ilvl = element.element("ilvl").attribute("val").value(); + NumId = element.element("numId").attribute("val").value(); + } + + + const XML::XNode NumPr::toXML() const + { + return + XML::XElement(ns.w + "numPr", + XML::Write(ns.w + "ilvl", ns.w + "val", Ilvl) + + XML::XElement(ns.w + "numId", XML::XAttribute(ns.w + "val", NumId)) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/NumPr.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/NumPr.h new file mode 100644 index 0000000000..51c1222968 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/NumPr.h @@ -0,0 +1,33 @@ +#pragma once +#ifndef OOX_LOGIC_NUMPR_INCLUDE_H_ +#define OOX_LOGIC_NUMPR_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include "nullable_property.h" + + +namespace OOX +{ + namespace Logic + { + class NumPr : public WritingElement + { + public: + NumPr(); + virtual ~NumPr(); + explicit NumPr(const XML::XNode& node); + const NumPr& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property Ilvl; + nullable_property NumId; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_NUMPR_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/OleObject.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/OleObject.cpp new file mode 100644 index 0000000000..583fd3bde0 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/OleObject.cpp @@ -0,0 +1,66 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "OleObject.h" +#include "./../Folder.h" + + +namespace OOX +{ + namespace Logic + { + + OleObject::OleObject() + { + } + + + OleObject::~OleObject() + { + } + + + OleObject::OleObject(const XML::XNode& node) + { + fromXML(node); + } + + + const OleObject& OleObject::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void OleObject::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Type = element.attribute("Type").value(); + ProgId = element.attribute("ProgID").value(); + ShapeId = element.attribute("ShapeID").value(); + DrawAspect = element.attribute("DrawAspect").value(); + ObjectId = element.attribute("ObjectID").value(); + rId = element.attribute("id").value().ToString(); + FieldCodes = element.element("FieldCodes"); + } + + + const XML::XNode OleObject::toXML() const + { + return + XML::XElement(ns.o + "OLEObject", + XML::XAttribute("Type", Type) + + XML::XAttribute("ProgID", ProgId) + + XML::XAttribute("ShapeID", ShapeId) + + XML::XAttribute("DrawAspect", DrawAspect) + + XML::XAttribute("ObjectID", ObjectId) + + XML::XAttribute(ns.r + "id", rId) + + XML::Write(FieldCodes) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/OleObject.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/OleObject.h new file mode 100644 index 0000000000..8e8f967292 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/OleObject.h @@ -0,0 +1,43 @@ +#pragma once +#ifndef OOX_LOGIC_OLE_OBJECT_INCLUDE_H_ +#define OOX_LOGIC_OLE_OBJECT_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include +#include "FieldCodes.h" +#include "nullable.h" +#include "property.h" +#include "./../RId.h" + + +namespace OOX +{ + namespace Logic + { + class OleObject : public WritingElement + { + public: + OleObject(); + virtual ~OleObject(); + explicit OleObject(const XML::XNode& node); + const OleObject& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Type; + property ProgId; + property ShapeId; + property DrawAspect; + property ObjectId; + property rId; + property TargetId; + nullable_property FieldCodes; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_OLE_OBJECT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/OleWrap.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/OleWrap.cpp new file mode 100644 index 0000000000..05538cb3fa --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/OleWrap.cpp @@ -0,0 +1,98 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "OleWrap.h" +#include "Wrap.h" + + +namespace OOX +{ + namespace Logic + { + + OleWrap::OleWrap() + { + } + + + OleWrap::OleWrap(const Common::Wrap& wrap) + { + fromBase(wrap); + } + + + OleWrap::OleWrap(const std::string& value) + { + fromString(value); + } + + + OleWrap::OleWrap(const XML::XElement& element) + { + // TODO çà÷åì èñïîëüçîâàòü OOX::Logic::Wrap, åñëè ýòî ïîïûòêà îò íåãî èçáàâèòüñÿ + nullable_property wrap; + wrap = element.element("wrap"); + + + nullable_property wrapCoords; + wrapCoords = element.attribute("wrapcoords").value(); + + if(wrapCoords.is_init()) + WrapCoords = wrapCoords; + if(wrap.is_init()) + OleWrap(wrap->Type); + else + OleWrap("none"); + + } + + + const OleWrap& OleWrap::operator = (const Common::Wrap& wrap) + { + fromBase(wrap); + return *this; + } + + + const OleWrap& OleWrap::operator = (const std::string& value) + { + fromString(value); + return *this; + } + + + const std::string OleWrap::ToString() const + { + switch (type()) + { + case square: + return "square"; + case tight: + return "tight"; + case topAndBottom: + return "topAndBottom"; + case none: + return "none"; + default: + return "square"; + } + } + + + void OleWrap::fromString(const std::string& value) + { + if (value == "square") + setSquare(); + else if (value == "tight") + setTight(); + else if (value == "topAndBottom") + setTopAndBottom(); + else if (value == "none") + setNone(); + else + setSquare(); + } + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/OleWrap.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/OleWrap.h new file mode 100644 index 0000000000..d97de158f5 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/OleWrap.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef OOX_LOGIC_OLE_WRAP_INCLUDE_H_ +#define OOX_LOGIC_OLE_WRAP_INCLUDE_H_ + +#include +#include "./../Namespaces.h" +#include "Common.h" +#include "nullable_property.h" + +namespace OOX +{ + namespace Logic + { + class OleWrap : public Common::Wrap + { + public: + OleWrap(); + explicit OleWrap(const Common::Wrap& wrap); + explicit OleWrap(const std::string& value); + explicit OleWrap(const XML::XElement& element); + + const OleWrap& operator = (const Common::Wrap& wrap); + const OleWrap& operator = (const std::string& value); + + public: + const std::string ToString() const; + void fromString(const std::string& value); + + public: + nullable_property WrapCoords; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_OLE_WRAP_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/OleZIndex.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/OleZIndex.cpp new file mode 100644 index 0000000000..9defb8b8aa --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/OleZIndex.cpp @@ -0,0 +1,38 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "OleZIndex.h" + + +namespace OOX +{ + namespace Logic + { + + OleZIndex::OleZIndex() + { + } + + + OleZIndex::OleZIndex(const Common::ZIndex& zIndex) + { + fromBase(zIndex); + } + + + const std::string OleZIndex::toString() const + { + return "z-index:" + Index.ToString(); + } + + + const OleZIndex& OleZIndex::operator= (const Common::ZIndex& zIndex) + { + fromBase(zIndex); + return *this; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/OleZIndex.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/OleZIndex.h new file mode 100644 index 0000000000..6ca5ae449c --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/OleZIndex.h @@ -0,0 +1,25 @@ +#pragma once +#ifndef OOX_LOGIC_OLE_Z_INDEX_INCLUDE_H_ +#define OOX_LOGIC_OLE_Z_INDEX_INCLUDE_H_ + +#include "Common.h" +#include "./../Namespaces.h" +#include "./../Unit.h" + + +namespace OOX +{ + namespace Logic + { + class OleZIndex : public Common::ZIndex + { + public: + OleZIndex(); + explicit OleZIndex(const Common::ZIndex& zIndex); + const std::string toString() const; + const OleZIndex& operator = (const Common::ZIndex& zIndex); + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_OLE_Z_INDEX_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Oval.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Oval.cpp new file mode 100644 index 0000000000..7c3c7e8037 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Oval.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Oval.h" + +namespace OOX +{ + namespace Logic + { + Oval::Oval() + { + + } + + Oval::~Oval() + { + + } + + Oval::Oval(const XML::XNode& node) + { + fromXML(node); + } + + const Oval& Oval::operator = (const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void Oval::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + Id = element.attribute("id").value(); + style = element.attribute("style").value(); + Wrap = element.element("wrap"); + anchorlock = element.element("anchorlock"); + + fillstyle = element; + linestyle = element; + shadow = element.element("shadow"); + + textbox = element.element("textbox"); + } + + const XML::XNode Oval::toXML() const + { + return XML::XElement(ns.v + "oval", XML::XAttribute("id", Id) + XML::XAttribute("style", style.ToString()) + XML::Write(Wrap)); + } + + } // namespace Logic +} // namespace OOX diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Oval.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Oval.h new file mode 100644 index 0000000000..182b1bfa0e --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Oval.h @@ -0,0 +1,44 @@ +#pragma once +#ifndef OOX_LOGIC_OVAL_INCLUDE_H_ +#define OOX_LOGIC_OVAL_INCLUDE_H_ + +#include "Wrap.h" +#include "Shadow.h" +#include "TextBox.h" +#include "LineStyle.h" +#include "FillStyle.h" +#include "ShapeStyle.h" + +namespace OOX +{ + namespace Logic + { + class Oval : public WritingElement + { + public: + Oval(); + virtual ~Oval(); + explicit Oval(const XML::XNode& node); + const Oval& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Id; + property style; + + nullable_property Wrap; + nullable_property anchorlock; + + nullable_property fillstyle; + nullable_property linestyle; + nullable_property shadow; + + nullable_property textbox; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_OVAL_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/PageBorders.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/PageBorders.cpp new file mode 100644 index 0000000000..2ee097077d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/PageBorders.cpp @@ -0,0 +1,53 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "PageBorders.h" + + +namespace OOX +{ + namespace Logic + { + PageBorders::PageBorders() + { + + } + + PageBorders::~PageBorders() + { + + } + + PageBorders::PageBorders(const XML::XNode& node) + { + fromXML(node); + } + + const PageBorders& PageBorders::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void PageBorders::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + Top = element.element("top"); + Bottom = element.element("bottom"); + Left = element.element("left"); + Right = element.element("right"); + OffsetFrom = element.attribute("offsetFrom").value(); + } + + const XML::XNode PageBorders::toXML() const + { + return XML::XElement(ns.w + "pgBorders", + XML::XAttribute(ns.w + "offsetFrom", OffsetFrom) + + XML::Write(Top) + XML::Write(Bottom) + XML::Write(Left) + XML::Write(Right)); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/PageBorders.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/PageBorders.h new file mode 100644 index 0000000000..4703a684f2 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/PageBorders.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef OOX_LOGIC_PAGE_BORDERS_INCLUDE_H_ +#define OOX_LOGIC_PAGE_BORDERS_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "Border.h" + + +namespace OOX +{ + namespace Logic + { + class PageBorders : public WritingElement + { + public: + PageBorders(); + virtual ~PageBorders(); + explicit PageBorders(const XML::XNode& node); + const PageBorders& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property Top; + nullable_property Bottom; + nullable_property Left; + nullable_property Right; + nullable_property OffsetFrom; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_PAGE_BORDERS_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/PageMargin.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/PageMargin.cpp new file mode 100644 index 0000000000..29a1bda186 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/PageMargin.cpp @@ -0,0 +1,65 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "PageMargin.h" + + +namespace OOX +{ + namespace Logic + { + + PageMargin::PageMargin() + { + } + + + PageMargin::~PageMargin() + { + } + + + PageMargin::PageMargin(const XML::XNode& node) + { + fromXML(node); + } + + + const PageMargin& PageMargin::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void PageMargin::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Top = element.attribute("top").value();//.ToString(); + Right = element.attribute("right").value();//.ToString(); + Bottom = element.attribute("bottom").value();//.ToString(); + Left = element.attribute("left").value();//.ToString(); + Header = element.attribute("header").value(); + Footer = element.attribute("footer").value(); + Gutter = element.attribute("gutter").value(); + } + + + const XML::XNode PageMargin::toXML() const + { + return + XML::XElement(ns.w + "pgMar", + XML::XAttribute(ns.w + "top", Top) + + XML::XAttribute(ns.w + "right", Right) + + XML::XAttribute(ns.w + "bottom", Bottom) + + XML::XAttribute(ns.w + "left", Left) + + XML::XAttribute(ns.w + "header", Header) + + XML::XAttribute(ns.w + "footer", Footer) + + XML::XAttribute(ns.w + "gutter", Gutter) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/PageMargin.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/PageMargin.h new file mode 100644 index 0000000000..6b01e3a913 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/PageMargin.h @@ -0,0 +1,38 @@ +#ifndef OOX_LOGIC_PAGE_MARGIN_INCLUDE_H_ +#define OOX_LOGIC_PAGE_MARGIN_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include "nullable_property.h" +#include "./../Unit.h" + + +namespace OOX +{ + namespace Logic + { + class PageMargin : public WritingElement + { + public: + PageMargin(); + virtual ~PageMargin(); + explicit PageMargin(const XML::XNode& node); + const PageMargin& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property > Top; + property > Right; + property > Bottom; + property > Left; + nullable_property Header; + nullable_property Footer; + nullable_property Gutter; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_PAGE_MARGIN_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/PageSize.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/PageSize.cpp new file mode 100644 index 0000000000..8106e06758 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/PageSize.cpp @@ -0,0 +1,51 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "PageSize.h" + +namespace OOX +{ + namespace Logic + { + PageSize::PageSize() + { + + } + + PageSize::~PageSize() + { + + } + + PageSize::PageSize(const XML::XNode& node) + { + fromXML(node); + } + + const PageSize& PageSize::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void PageSize::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + Width = element.attribute("w").value(); + Height = element.attribute("h").value(); + Orient = element.attribute("orient").value(); + } + + const XML::XNode PageSize::toXML() const + { + return XML::XElement(ns.w + "pgSz", + XML::XAttribute(ns.w + "w", Width) + + XML::XAttribute(ns.w + "h", Height) + + XML::XAttribute(ns.w + "orient", Orient)); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/PageSize.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/PageSize.h new file mode 100644 index 0000000000..6927603578 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/PageSize.h @@ -0,0 +1,35 @@ +#ifndef OOX_LOGIC_PAGE_SIZE_INCLUDE_H_ +#define OOX_LOGIC_PAGE_SIZE_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include "nullable_property.h" +//#include "./../Unit.h" +#include "./../Limit/Orient.h" + + +namespace OOX +{ + namespace Logic + { + class PageSize : public WritingElement + { + public: + PageSize(); + virtual ~PageSize(); + explicit PageSize(const XML::XNode& node); + const PageSize& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property > Width; + property > Height; + nullable_property Orient; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_PAGE_SIZE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Paragraph.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Paragraph.cpp new file mode 100644 index 0000000000..54e1cfe587 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Paragraph.cpp @@ -0,0 +1,274 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Paragraph.h" +#include "RunProperty.h" +#include "Exception/log_runtime_error.h" +#include "Run.h" +#include "Drawing.h" +#include "Tab.h" +#include "Break.h" +#include "Text.h" +#include "Symbol.h" + + +namespace OOX +{ + namespace Logic + { + + Paragraph::Paragraph() +// : m_inList(false) + { + } + + + Paragraph::~Paragraph() + { + } + + + Paragraph::Paragraph(const XML::XNode& node) + { + fromXML(node); + } + + + Paragraph::Paragraph(const RId& rId, const boost::filesystem::wpath& filename, const long width, const long height) +// : m_inList(false) + { + RunItemBase* drawing = new Drawing(rId, filename, width, height); + Run run; + run.add(drawing); + Items->push_back(run); + } + + Paragraph::Paragraph(const RId& rId, const boost::filesystem::wpath& filename, const long xEmu, const std::string& hRelativeFrom, const long yEmu, const std::string& vRelativeFrom, const long widthEmu, const long heightEmu) +// : m_inList(false) + { + RunItemBase* drawing = new Drawing(rId, filename, xEmu, hRelativeFrom, yEmu, vRelativeFrom, widthEmu, heightEmu); + Run run; + run.add(drawing); + Items->push_back(run); + } + + + const Paragraph& Paragraph::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Paragraph::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); +// m_inList = false; + Property = element.element("pPr"); + for (XML::const_element_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + const XML::XElement element(*i); + if (element.XName == "r" || element.XName == "hyperlink" || element.XName == "bookmarkStart" || + element.XName == "bookmarkEnd" || element.XName == "fldSimple" || element.XName == "ins" || + element.XName == "del") + { + Items->push_back(ParagraphItem(*i)); + } + } + + //if(Property.is_init() && Property->NumPr.is_init() && Property->NumPr->NumId.is_init()) + // m_nList = true; + } + + + const XML::XNode Paragraph::toXML() const + { + return + XML::XElement(ns.w + "p", + XML::Write(Property) + + XML::Write(Items) + ); + } + + + void Paragraph::Add(const Run& run) + { + AddRun(run); + } + + + void Paragraph::AddRun(const Run& run) + { + Items->push_back(run); + } + + + void Paragraph::AddText(const std::string& text) + { + Run run(text); + Items->push_back(run); + } + + + void Paragraph::AddText(const std::string& text, const nullable& property) + { + Run run(text); + run.Property = property; + Items->push_back(run); + } + + + void Paragraph::AddTab() + { + Run run; + run.add(); + Items->push_back(run); + } + + + void Paragraph::AddTab(const nullable& property) + { + Run run; + run.add(); + run.Property = property; + Items->push_back(run); + } + + + void Paragraph::AddLineBreak() + { + Run run; + run.add(); + Items->push_back(run); + } + + + void Paragraph::AddBreak(const std::string& type) + { + if (type == "page" || type == "line" || type == "column") + { + Run run; + Break* br = new Break(); + br->Type = type; + run.add(br); + Items->push_back(run); + } + } + + + void Paragraph::AddSpace(const size_t count) + { + Run run; + RunItemBase* text = new Text(std::string(count, ' ')); + run.add(text); + Items->push_back(run); + } + + + void Paragraph::AddSpace(const size_t count, const nullable& property) + { + Run run; + RunItemBase* text = new Text(std::string(count, ' ')); + run.Property = property; + run.add(text); + Items->push_back(run); + } + + + void Paragraph::AddHyperlink(const RId& rId, const std::string& text) + { + RunProperty runPr; + runPr.Under = true; + runPr.UnderType = "single"; + runPr.FontColor = "0000FF"; + Run run(text, runPr); + Hyperlink hyperlink; + hyperlink.rId = rId; + hyperlink.Runs->push_back(run); + Items->push_back(hyperlink); + } + + + void Paragraph::AddHyperlink(const std::string& nameHref, const std::string& text) + { + RunProperty runPr; + runPr.RStyle = "Hyperlink"; + Run run(text, runPr); + Hyperlink hyperlink; + hyperlink.Anchor = nameHref; + hyperlink.History = 1; // TODO åùå îäíà ìàãè÷åñêàÿ öèôðà, íå ñ÷åò÷èê + hyperlink.Runs->push_back(run); + Items->push_back(hyperlink); + } + + + void Paragraph::AddBookmarkStart(const std::string& name) + { + BookmarkStart bookmark(name); + Items->push_back(bookmark); + } + + + void Paragraph::AddBookmarkEnd(const std::string& name) + { + BookmarkEnd bookmark; + Items->push_back(bookmark); + } + + + void Paragraph::AddDrawing(const Drawing& drawing) + { + // TODO text +// Run run; +// run.createDrawing(drawing); +// Items->push_back(run); + } + + + void Paragraph::setRunProperty(const OOX::Logic::RunProperty& property) + { + if (!Property.is_init()) + Property = ParagraphProperty(); + Property->RunProperty = property; + } + + + const bool Paragraph::isInList() const + { + if(!Property.is_init()) + return false; + if(!Property->NumPr.is_init()) + return false; + if(!Property->NumPr->NumId.is_init()) + return false; + return true; + //return m_inList; + } + + + const int Paragraph::GetListNum() const + { + if(!Property.is_init()) + return 0; + if(!Property->NumPr.is_init()) + return 0; + return Property->NumPr->NumId.get_value_or(0); + //m_inList = true; + } + + + const int Paragraph::GetLevel() const + { + if(!Property.is_init()) + return 0; + if(!Property->NumPr.is_init()) + return 0; + if(!Property->NumPr->Ilvl.is_init()) + return 0; + return Property->NumPr->Ilvl.get() + 1; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Paragraph.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Paragraph.h new file mode 100644 index 0000000000..1e0ae52d73 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Paragraph.h @@ -0,0 +1,74 @@ +#pragma once +#ifndef OOX_LOGIC_PARAGRAPH_INCLUDE_H_ +#define OOX_LOGIC_PARAGRAPH_INCLUDE_H_ + +#include "TextItemBase.h" +#include +#include +#include "ParagraphItem.h" +#include "ParagraphProperty.h" +#include "RunProperty.h" +#include "property.h" +#include "nullable_property.h" +#include "Run.h" +#include "Shape.h" +#include "OLEObject.h" +#include "./../RId.h" +#include "Drawing.h" +#include + + +namespace OOX +{ + namespace Logic + { + class Paragraph : public TextItemBase + { + public: + Paragraph(); + virtual ~Paragraph(); + explicit Paragraph(const XML::XNode& node); + explicit Paragraph(const RId& rId, const boost::filesystem::wpath& imagePath, const long width, const long height); + explicit Paragraph(const RId& rId, const boost::filesystem::wpath& filename, const long xEmu, const std::string& hRelativeFrom, const long yEmu, const std::string& vRelativeFrom, const long widthEmu, const long heightEmu); + const Paragraph& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + // TODO ïîïðîáîâàòü óáðàòü âñå Add + void Add(const Run& run); + void AddRun(const Run& run); + void AddText(const std::string& text); + void AddText(const std::string& text, const nullable& property); + void AddTab(); + void AddTab(const nullable& property); + void AddLineBreak(); + void AddBreak(const std::string& type); + void AddSpace(const size_t count); + void AddSpace(const size_t count, const nullable& property); + void AddHyperlink(const RId& rId, const std::string& text); + void AddHyperlink(const std::string& nameHref, const std::string& text); + void AddDrawing(const Drawing& drawing); + + void AddBookmarkStart(const std::string& name); + void AddBookmarkEnd(const std::string& name); + + public: + void setRunProperty(const RunProperty& property); + + public: + const bool isInList() const; + const int GetListNum() const; + const int GetLevel() const; + + public: + nullable_property Property; + property > Items; + property CountInList; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_PARAGRAPH_INCLUDE_H_ diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphBorder.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphBorder.cpp new file mode 100644 index 0000000000..ff5dbbc059 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphBorder.cpp @@ -0,0 +1,58 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ParagraphBorder.h" + + +namespace OOX +{ + namespace Logic + { + + ParagraphBorder::ParagraphBorder() + { + } + + + ParagraphBorder::~ParagraphBorder() + { + } + + + ParagraphBorder::ParagraphBorder(const XML::XNode& node) + { + fromXML(node); + } + + + const ParagraphBorder& ParagraphBorder::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void ParagraphBorder::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Top = element.element("top"); + Bottom = element.element("bottom"); + Left = element.element("left"); + Right = element.element("right"); + } + + + const XML::XNode ParagraphBorder::toXML() const + { + return XML::XElement(ns.w + "pBdr", + XML::Write(Top) + + XML::Write(Bottom) + + XML::Write(Left) + + XML::Write(Right) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphBorder.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphBorder.h new file mode 100644 index 0000000000..18755f187f --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphBorder.h @@ -0,0 +1,34 @@ +#pragma once +#ifndef OOX_LOGIC_PARAGRAPH_BORDER_INCLUDE_H_ +#define OOX_LOGIC_PARAGRAPH_BORDER_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "Border.h" + + +namespace OOX +{ + namespace Logic + { + class ParagraphBorder : public WritingElement + { + public: + ParagraphBorder(); + virtual ~ParagraphBorder(); + explicit ParagraphBorder(const XML::XNode& node); + const ParagraphBorder& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property Top; + nullable_property Bottom; + nullable_property Left; + nullable_property Right; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_PARAGRAPH_BORDER_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphItem.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphItem.cpp new file mode 100644 index 0000000000..0ee1c2f07d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphItem.cpp @@ -0,0 +1,97 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ParagraphItem.h" +#include "./../FormatError.h" + + +namespace OOX +{ + namespace Logic + { + + ParagraphItem::ParagraphItem() + { + } + + + ParagraphItem::ParagraphItem(const Run& run) + : IItemable(new Run(run)) + { + } + + + ParagraphItem::ParagraphItem(const Hyperlink& hyperlink) + : IItemable(new Hyperlink(hyperlink)) + { + } + + + ParagraphItem::ParagraphItem(const BookmarkStart& start) + : IItemable(new BookmarkStart(start)) + { + } + + + ParagraphItem::ParagraphItem(const BookmarkEnd& end) + : IItemable(new BookmarkEnd(end)) + { + } + + + ParagraphItem::~ParagraphItem() + { + } + + + ParagraphItem::ParagraphItem(const XML::XNode& node) + { + fromXML(node); + } + + + const ParagraphItem& ParagraphItem::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void ParagraphItem::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + if (element.XName == "r") + m_item.reset(new Run(element)); + else if (element.XName == ("hyperlink")) + m_item.reset(new Hyperlink(element)); + else if (element.XName == ("bookmarkStart")) + m_item.reset(new BookmarkStart(element)); + else if (element.XName == ("bookmarkEnd")) + m_item.reset(new BookmarkEnd(element)); + else if (element.XName == ("fldSimple")) + m_item.reset(new FldSimple(element)); + else if (element.XName == ("ins")) + m_item.reset(new Insert(element)); + else if (element.XName == ("del")) + m_item.reset(new Delete(element)); + else + throw FormatError("bad ParagraphItem type"); + } + + + const XML::XNode ParagraphItem::toXML() const + { + return XML::Write(m_item); + } + + + const std::string ParagraphItem::toTxt() const + { + return m_item->toTxt(); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphItem.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphItem.h new file mode 100644 index 0000000000..9cc09f8ef9 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphItem.h @@ -0,0 +1,44 @@ +#pragma once +#ifndef OOX_LOGIC_PARAGRAPH_ITEM_INCLUDE_H_ +#define OOX_LOGIC_PARAGRAPH_ITEM_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "IItemable.h" +#include "ParagraphItemBase.h" +#include +#include "Run.h" +#include "Hyperlink.h" +#include "BookmarkStart.h" +#include "BookmarkEnd.h" +#include "FldSimple.h" +#include "Insert.h" +#include "Delete.h" + + +namespace OOX +{ + namespace Logic + { + class ParagraphItem : public WritingElement, public IItemable + { + public: + ParagraphItem(); + ParagraphItem(const Run& run); + ParagraphItem(const Hyperlink& hyperlink); + ParagraphItem(const BookmarkStart& start); + ParagraphItem(const BookmarkEnd& end); + virtual ~ParagraphItem(); + explicit ParagraphItem(const XML::XNode& node); + const ParagraphItem& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + const std::string toTxt() const; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_PARAGRAPH_ITEM_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphItemBase.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphItemBase.cpp new file mode 100644 index 0000000000..25cb06db76 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphItemBase.cpp @@ -0,0 +1,14 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ParagraphItemBase.h" + + +namespace OOX +{ + namespace Logic + { + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphItemBase.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphItemBase.h new file mode 100644 index 0000000000..baa4ef42ae --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphItemBase.h @@ -0,0 +1,21 @@ +#pragma once +#ifndef OOX_LOGIC_PARAGRAPH_ITEM_BASE_INCLUDE_H_ +#define OOX_LOGIC_PARAGRAPH_ITEM_BASE_INCLUDE_H_ + +#include "./../WritingElement.h" +#include + + +namespace OOX +{ + namespace Logic + { + class ParagraphItemBase : public WritingElement + { + public: + virtual const std::string toTxt() const = 0; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_PARAGRAPH_ITEM_BASE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphProperty.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphProperty.cpp new file mode 100644 index 0000000000..e026e2b92f --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphProperty.cpp @@ -0,0 +1,126 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ParagraphProperty.h" + +namespace OOX +{ + namespace Logic + { + ParagraphProperty::ParagraphProperty() + { + pageBreakBefore = false; + } + + ParagraphProperty::~ParagraphProperty() + { + + } + + ParagraphProperty::ParagraphProperty(const XML::XNode& node) + { + fromXML(node); + } + + const ParagraphProperty& ParagraphProperty::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void ParagraphProperty::fromXML(const XML::XNode& node) + { + pageBreakBefore = false; + + const XML::XElement element(node); + + PStyle = element.element("pStyle").attribute("val").value(); + RunProperty = element.element("rPr"); + Align = element.element("jc").attribute("val").value(); + //Background = element.element("shd").attribute("fill").value(); + Shading = element.element("shd"); + TextFrameProperties = element.element("framePr"); + OutlineLvl = element.element("outlineLvl").attribute("val").value(); + TextAlignment = element.element("textAlignment ").attribute("val").value(); + Ind = element.element("ind"); + Spacing = element.element("spacing"); + NumPr = element.element("numPr"); + ParagraphBorder = element.element("pBdr"); + SectorProperty = element.element("sectPr"); + Tabs = element.element("tabs"); + KeepNext = element.element("keepNext").exist(); + KeepLines = element.element("keepLines").exist(); + + if (element.element("pageBreakBefore").exist()) + { + if (element.element("pageBreakBefore").attribute("val").exist()) + { + pageBreakBefore = element.element("pageBreakBefore").attribute("val").value(); + } + } + + ContextualSpacing = element.element("contextualSpacing").exist(); + SuppressLineNumbers = element.element("suppressLineNumbers").exist(); + WidowControl = element.element("widowControl").attribute("val").value(); + PropertyChange = element.element("pPrChange"); + } + + const XML::XNode ParagraphProperty::toXML() const + { + return XML::XElement(ns.w + "pPr", + XML::Write(RunProperty) + + XML::Write(SectorProperty) + + XML::Write(ns.w + "pStyle", ns.w + "val", PStyle) + + XML::WriteIf(XML::XElement(ns.w + "keepNext"), KeepNext) + + XML::WriteIf(XML::XElement(ns.w + "keepLines"), KeepLines) + + XML::WriteIf(XML::XElement(ns.w + "pageBreakBefore"), pageBreakBefore) + + XML::Write(TextFrameProperties) + + XML::Write(ns.w + "widowControl", ns.w + "val", WidowControl) + + XML::Write(NumPr) + + XML::Write(Spacing) + + XML::WriteIf(XML::XElement(ns.w + "suppressLineNumbers"), SuppressLineNumbers) + + XML::Write(ParagraphBorder) + + //XML::Write(ns.w + "shd", ns.w + "fill", Background) + + XML::Write(Shading) + + XML::Write(Tabs) + + XML::Write(Ind) + + XML::WriteIf(XML::XElement(ns.w + "contextualSpacing"), ContextualSpacing) + + XML::Write(ns.w + "jc", ns.w + "val", Align) + + XML::Write(ns.w + "textAlignment", ns.w + "val", TextAlignment) + + XML::Write(ns.w + "outlineLvl", ns.w + "val", OutlineLvl) + + XML::Write(PropertyChange)); + } + + const bool ParagraphProperty::isSimple() const + { + if (PStyle.is_init()) + return false; + if (Align.is_init()) + return false; + // if (Background.is_init()) return false; + if (Shading.is_init()) + return false; + if (TextFrameProperties.is_init()) + return false; + if (NumPr.is_init()) + return false; + if (Ind.is_init()) + return false; + if (Spacing.is_init()) + return false; + if(*KeepLines) + return false; + if(*KeepNext) + return false; + if(*SuppressLineNumbers) + return false; + if (!RunProperty.is_init()) + return true; + if (PropertyChange.is_init()) + return false; + return RunProperty->isSimple(); + } + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphProperty.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphProperty.h new file mode 100644 index 0000000000..153be2e61a --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphProperty.h @@ -0,0 +1,71 @@ +#pragma once +#ifndef OOX_LOGIC_PARAGRAPH_PROPERTY_INCLUDE_H_ +#define OOX_LOGIC_PARAGRAPH_PROPERTY_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "RunProperty.h" +#include "Spacing.h" +#include +#include "nullable_property.h" +#include "Color.h" +#include "Align.h" +#include "NumPr.h" +#include "ParagraphBorder.h" +#include "Ind.h" +#include "TabsProperty.h" +#include "Shading.h" +#include "TextFrameProperties.h" +#include "ParagraphPropertyChange.h" +#include "./../Document.h" +#include "./../Limit/TextAlignment.h" + +namespace OOX +{ + namespace Logic + { + class ParagraphProperty : public WritingElement + { + public: + ParagraphProperty(); + virtual ~ParagraphProperty(); + explicit ParagraphProperty(const XML::XNode& node); + const ParagraphProperty& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + const bool isSimple() const; + + public: + nullable_property PStyle; + nullable_property RunProperty; + + nullable_property Align; + //nullable_property Background; + nullable_property Spacing; + nullable_property NumPr; + nullable_property ParagraphBorder; + nullable_property Ind; + + nullable_property Shading; //TODO: Read only now + nullable_property TextFrameProperties; + + nullable_property SectorProperty; + nullable_property OutlineLvl; + nullable_property Tabs; + property KeepNext; + property KeepLines; + property pageBreakBefore; + property ContextualSpacing; + property SuppressLineNumbers; + nullable_property WidowControl; + + nullable_property TextAlignment; + nullable_property PropertyChange; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_PARAGRAPH_PROPERTY_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphPropertyChange.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphPropertyChange.cpp new file mode 100644 index 0000000000..96c5a5e9bc --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphPropertyChange.cpp @@ -0,0 +1,58 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ParagraphPropertyChange.h" + + +namespace OOX +{ + namespace Logic + { + + ParagraphPropertyChange::ParagraphPropertyChange() + { + } + + + ParagraphPropertyChange::~ParagraphPropertyChange() + { + } + + + ParagraphPropertyChange::ParagraphPropertyChange(const XML::XNode& node) + { + fromXML(node); + } + + + const ParagraphPropertyChange& ParagraphPropertyChange::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void ParagraphPropertyChange::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + Id = element.attribute("id").value(); + Author = element.attribute("author").value(); + Date = element.attribute("date").value(); + } + + + const XML::XNode ParagraphPropertyChange::toXML() const + { + return + XML::XElement(ns.w + "pPrChange", + XML::XAttribute(ns.w + "id", Id) + + XML::XAttribute(ns.w + "author", Author) + + XML::XAttribute(ns.w + "date", Date) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphPropertyChange.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphPropertyChange.h new file mode 100644 index 0000000000..5ee84c6372 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ParagraphPropertyChange.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef OOX_LOGIC_PARAGRAPH_PROPERTY_CHANGE_INCLUDE_H_ +#define OOX_LOGIC_PARAGRAPH_PROPERTY_CHANGE_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "nullable_property.h" + + +namespace OOX +{ + namespace Logic + { + class ParagraphPropertyChange : public WritingElement + { + public: + ParagraphPropertyChange(); + virtual ~ParagraphPropertyChange(); + explicit ParagraphPropertyChange(const XML::XNode& node); + const ParagraphPropertyChange& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property Id; + nullable_property Author; + nullable_property Date; + + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_PARAGRAPH_PROPERTY_CHANGE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Path.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Path.cpp new file mode 100644 index 0000000000..f63a0d74ac --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Path.cpp @@ -0,0 +1,70 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Path.h" + + +namespace OOX +{ + namespace Logic + { + + Path::Path() + { + } + + + Path::~Path() + { + } + + + Path::Path(const XML::XNode& node) + { + fromXML(node); + } + + + const Path& Path::operator = (const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Path::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + GradientShapeOk = element.attribute("gradientshapeok").value(); + ConnectType = element.attribute("connecttype").value(); + ConnectLocs = element.attribute("connectlocs").value(); + TextBoxRect = element.attribute("textboxrect").value(); + ConnectAngles = element.attribute("connectangles").value(); + TextPathOk = element.attribute("textpathok").value(); + Limo = element.attribute("limo").value(); + ArrowOk = element.attribute("arrowok").value(); + ExtrusionOk = element.attribute("extrusionok").value(); + } + + + const XML::XNode Path::toXML() const + { + return + XML::XElement(ns.v + "shape", + XML::XAttribute("arrowok", ArrowOk) + + XML::XAttribute(ns.o + "extrusionok", ExtrusionOk) + + XML::XAttribute("gradientshapeok", GradientShapeOk) + + XML::XAttribute("textpathok", TextPathOk) + + XML::XAttribute(ns.o + "connecttype", ConnectType) + + XML::XAttribute(ns.o + "connectlocs", ConnectLocs) + + XML::XAttribute("textboxrect", TextBoxRect) + + XML::XAttribute("limo", Limo) + + XML::XAttribute(ns.o + "connectangles", ConnectAngles) + ); + } + + } // namespace Logic +} // namespace OOX diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Path.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Path.h new file mode 100644 index 0000000000..8ad24544f1 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Path.h @@ -0,0 +1,43 @@ +#pragma once +#ifndef OOX_LOGIC_PATH_INCLUDE_H_ +#define OOX_LOGIC_PATH_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "./../Limit/TrueFalse.h" +#include "./../Limit/ConnectType.h" +#include +#include "property.h" + + +namespace OOX +{ + namespace Logic + { + class Path : public WritingElement + { + public: + Path(); + virtual ~Path(); + explicit Path(const XML::XNode& node); + const Path& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + + nullable_property ArrowOk; + nullable_property ExtrusionOk; + nullable_property GradientShapeOk; + nullable_property TextPathOk; + nullable_property ConnectType; + nullable_property ConnectLocs; + nullable_property TextBoxRect; + nullable_property ConnectAngles; + nullable_property Limo; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_PATH_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Pic.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Pic.cpp new file mode 100644 index 0000000000..71972999ca --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Pic.cpp @@ -0,0 +1,97 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Pic.h" + +namespace OOX +{ + namespace Logic + { + Pic::Pic() + { + + } + + Pic::~Pic() + { + + } + + Pic::Pic(const XML::XNode& node) + { + fromXML(node); + } + + const Pic& Pic::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void Pic::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Id = element.element("nvPicPr").element("cNvPr").attribute("id").value(); + Name = element.element("nvPicPr").element("cNvPr").attribute("name").value(); + + if (element.element("blipFill").element("blip").attribute("embed").exist()) + rId = element.element("blipFill").element("blip").attribute("embed").value().ToString(); + + Off = XML::XElement2NullablePoint(element.element("spPr").element("xfrm").element("off"), "x", "y"); + Ext = XML::XElement2NullableSize(element.element("spPr").element("xfrm").element("ext"), "cy", "cx"); + Prst = element.element("spPr").element("prstGeom").attribute("prst").value(); + + if (element.element("spPr").element("xfrm").attribute("rot").exist()) + rot = element.element("spPr").element("xfrm").attribute("rot").value().ToString(); + + if (element.element("spPr").element("xfrm").attribute("flipH").exist()) + flipH = element.element("spPr").element("xfrm").attribute("flipH").value().ToString(); + + if (element.element("spPr").element("xfrm").attribute("flipV").exist()) + flipV = element.element("spPr").element("xfrm").attribute("flipV").value().ToString(); + } + + const XML::XNode Pic::toXML() const + { + return + XML::XElement(ns.pic + "pic", + XML::XElement(ns.pic + "nvPicPr", + XML::XElement(ns.pic + "cNvPr", + XML::XAttribute("id", Id) + + XML::XAttribute("name", Name) + ) + + XML::XElement(ns.pic + "cNvPicPr") + ) + + XML::XElement(ns.pic + "blipFill", + XML::XElement(ns.a + "blip", XML::XAttribute(ns.r + "embed", rId)) + + XML::XElement(ns.a + "stretch", + XML::XElement(ns.a + "fillRect") + ) + ) + + XML::XElement(ns.pic + "spPr", + XML::XElement(ns.a + "xfrm", + XML::WriteIf( // TODO èñïðàâèòü, ïîñëå ñîçäàíèÿ íîðìàëüíûõ Size è Point + XML::XElement(ns.a + "off", + XML::XAttribute("x", Off.get_value_or_default().X) + + XML::XAttribute("y", Off.get_value_or_default().Y) + ), Off.is_init() + ) + + XML::WriteIf( // TODO èñïðàâèòü, ïîñëå ñîçäàíèÿ íîðìàëüíûõ Size è Point + XML::XElement(ns.a + "ext", + XML::XAttribute("cx", Ext.get_value_or_default().Width) + + XML::XAttribute("cy", Ext.get_value_or_default().Height) + ), Ext.is_init() + ) + ) + + XML::XElement(ns.a + "prstGeom", + XML::XAttribute("prst", Prst) + + XML::XElement(ns.a + "avLst") + ) + ) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Pic.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Pic.h new file mode 100644 index 0000000000..2c5631bbd2 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Pic.h @@ -0,0 +1,44 @@ +#pragma once +#ifndef OOX_LOGIC_PICTURE_INCLUDE_H_ +#define OOX_LOGIC_PICTURE_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "Common.h" +#include "property.h" +#include "nullable_property.h" +#include "./../RId.h" +#include "./../Unit.h" + + +namespace OOX +{ + namespace Logic + { + class Pic : public WritingElement + { + public: + Pic(); + virtual ~Pic(); + explicit Pic(const XML::XNode& node); + const Pic& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property Id; + nullable_property Name; + nullable_property rId; + nullable_property > Off; + nullable_property > Ext; + nullable_property Prst; + nullable_property rot; + nullable_property flipH; + nullable_property flipV; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_PICTURE_INCLUDE_H \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Pict.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Pict.cpp new file mode 100644 index 0000000000..4524b2a014 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Pict.cpp @@ -0,0 +1,86 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Pict.h" + +namespace OOX +{ + namespace Logic + { + Pict::Pict() + { + + } + + Pict::~Pict() + { + + } + + Pict::Pict(const XML::XNode& node) + { + fromXML(node); + } + + void Pict::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + name = element.XName->Name; + shape = element.element("shape"); + group = element.element("group"); + rect = element.element("rect"); + oval = element.element("oval"); + line = element.element("line"); + roundrect = element.element("roundrect"); + + if (element.element("shapetype").exist()) + { + shapetype = element.element("shapetype"); + } + else + { + if (element.element("shape").exist()) + shapetype = element.element("shape"); + } + + DxaOrig = element.attribute("dxaOrig").value(); + DyaOrig = element.attribute("dyaOrig").value(); + OleObject = element.element("OLEObject"); + } + + const XML::XNode Pict::toXML() const + { + return + XML::XElement(ns.w + name.ToString(), + XML::XAttribute(ns.w + "dxaOrig", DxaOrig) + + XML::XAttribute(ns.w + "dyaOrig", DyaOrig) + + XML::Write(shapetype) + + XML::Write(shape) + + XML::Write(rect) + + XML::Write(oval) + + XML::Write(line) + + XML::Write(roundrect) + + XML::Write(OleObject) + ); + } + + const std::string Pict::toTxt() const + { + return "[pict]"; + } + + const bool Pict::hasPictures() const + { + return shape.is_init() && shape->imageData.is_init(); + } + + const bool Pict::isOle() const + { + return OleObject.is_init(); + } + + } // namespace Logic +} // namespace OOX diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Pict.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Pict.h new file mode 100644 index 0000000000..82ae0a403f --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Pict.h @@ -0,0 +1,55 @@ +#pragma once +#ifndef OOX_LOGIC_PICT_INCLUDE_H_ +#define OOX_LOGIC_PICT_INCLUDE_H_ + +#include "RunItemBase.h" +#include "Shape.h" +#include "ShapeType.h" +#include "Rect.h" +#include "Oval.h" +#include "Line.h" +#include "Roundrect.h" +#include "OleObject.h" +#include "Group.h" +#include "./../Limit/PictName.h" + +namespace OOX +{ + namespace Logic + { + class Pict : public RunItemBase + { + public: + Pict(); + virtual ~Pict(); + explicit Pict(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + const std::string toTxt() const; + + public: + const bool hasPictures() const; + const bool isOle() const; + + public: + + property name; + + nullable_property shape; + nullable_property shapetype; + nullable_property rect; + nullable_property oval; + nullable_property line; + nullable_property roundrect; + nullable_property group; + + nullable_property DxaOrig; + nullable_property DyaOrig; + nullable_property OleObject; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_PICT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Point2D.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Point2D.cpp new file mode 100644 index 0000000000..5b3ac8ae1a --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Point2D.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Point2D.h" + + +namespace OOX +{ + namespace Logic + { + + Point2D::Point2D() + { + } + + + Point2D::~Point2D() + { + } + + + Point2D::Point2D(const XML::XNode& node) + { + fromXML(node); + } + + + const Point2D& Point2D::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Point2D::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + name = element.XName->Name; + x = element.attribute("x").value(); + y = element.attribute("y").value(); + } + + + const XML::XNode Point2D::toXML() const + { + return XML::XElement(ns.wp + *name, + XML::XAttribute("x", x) + + XML::XAttribute("y", y) + ); + } + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Point2D.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Point2D.h new file mode 100644 index 0000000000..b7b16357fc --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Point2D.h @@ -0,0 +1,33 @@ +#pragma once +#ifndef OOX_LOGIC_POINT2D_INCLUDE_H_ +#define OOX_LOGIC_POINT2D_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include "nullable_property.h" + + +namespace OOX +{ + namespace Logic + { + class Point2D : public WritingElement + { + public: + Point2D(); + virtual ~Point2D(); + explicit Point2D(const XML::XNode& node); + const Point2D& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + public: + property x; + property y; + property name; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_POINT2D_INCLUDE_H \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/RFonts.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/RFonts.cpp new file mode 100644 index 0000000000..30d98157d5 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/RFonts.cpp @@ -0,0 +1,195 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "RFonts.h" + +namespace OOX +{ + namespace Logic + { + RFonts::RFonts() + { + + } + + RFonts::~RFonts() + { + + } + + RFonts::RFonts(const XML::XNode& node) + { + fromXML(node); + } + + const RFonts& RFonts::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void RFonts::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + AsciiTheme = element.attribute("asciiTheme").value(); + EastAsiaTheme = element.attribute("eastAsiaTheme").value(); + HAnsiTheme = element.attribute("hAnsiTheme").value(); + Cstheme = element.attribute("cstheme").value(); + Hint = element.attribute("hint").value(); + ascii = element.attribute("ascii").value(); + EastAsia = element.attribute("eastAsia").value(); + hAnsi = element.attribute("hAnsi").value(); + Cs = element.attribute("cs").value(); + } + + const XML::XNode RFonts::toXML() const + { + return + XML::XElement(ns.w + "rFonts", + XML::XAttribute(ns.w + "asciiTheme", AsciiTheme) + + XML::XAttribute(ns.w + "eastAsiaTheme", EastAsiaTheme) + + XML::XAttribute(ns.w + "hAnsiTheme", HAnsiTheme) + + XML::XAttribute(ns.w + "cstheme", Cstheme) + + XML::XAttribute(ns.w + "hint", Hint) + + XML::XAttribute(ns.w + "ascii", ascii) + + XML::XAttribute(ns.w + "eastAsia", EastAsia) + + XML::XAttribute(ns.w + "hAnsi", hAnsi) + + XML::XAttribute(ns.w + "cs", Cs) + ); + } + + void RFonts::setFontName(const nullable& fontName) + { + ascii = fontName; + hAnsi = fontName; + EastAsia = fontName; + Cs = fontName; + } + + const std::string RFonts::fontType() const + { + if (ascii.is_init() || hAnsi.is_init() || Cs.is_init() || EastAsia.is_init()) + { + return "fontName"; + } + else if (AsciiTheme.is_init()) + { + if (AsciiTheme->find("minor") != std::string::npos) + return "minor"; + else if (AsciiTheme->find("major") != std::string::npos) + return "major"; + else + return "none"; + } + else if (EastAsiaTheme.is_init()) + { + if (EastAsiaTheme->find("minor") != std::string::npos) + return "minor"; + else if (EastAsiaTheme->find("major") != std::string::npos) + return "major"; + else + return "none"; + } + else if (HAnsiTheme.is_init()) + { + if (HAnsiTheme->find("minor") != std::string::npos) + return "minor"; + else if (HAnsiTheme->find("major") != std::string::npos) + return "major"; + else + return "none"; + } + else if (Cstheme.is_init()) + { + if (Cstheme->find("minor") != std::string::npos) + return "minor"; + else if (Cstheme->find("major") != std::string::npos) + return "major"; + else + return "none"; + } + else + { + return "none"; + } + } + + const std::string RFonts::fontTypeAscii() const + { + if (AsciiTheme.is_init()) + { + if (AsciiTheme->find("minor") != std::string::npos) + return "minor"; + else if (AsciiTheme->find("major") != std::string::npos) + return "major"; + } + else if (ascii.is_init()) + return "fontName"; + else + return "none"; + return ""; + } + + const std::string RFonts::fontTypeHAnsi() const + { + if (HAnsiTheme.is_init()) + { + if (HAnsiTheme->find("minor") != std::string::npos) + return "minor"; + else if (HAnsiTheme->find("major") != std::string::npos) + return "major"; + } + else if (hAnsi.is_init()) + return "fontName"; + else + return "none"; + return ""; + } + + const std::string RFonts::fontTypeEA() const + { + if (EastAsiaTheme.is_init()) + { + if (EastAsiaTheme->find("minor") != std::string::npos) + return "minor"; + else if (EastAsiaTheme->find("major") != std::string::npos) + return "major"; + } + else if (EastAsia.is_init()) + return "fontName"; + else + return "none"; + return ""; + } + + const std::string RFonts::fontTypeCS() const + { + if (Cstheme.is_init()) + { + if (Cstheme->find("minor") != std::string::npos) + return "minor"; + else if (Cstheme->find("major") != std::string::npos) + return "major"; + } + else if (Cs.is_init()) + return "fontName"; + else + return "none"; + return ""; + } + + const nullable RFonts::fontName() const + { + if (ascii.is_init()) return ascii; + if (hAnsi.is_init()) return hAnsi; + if (EastAsia.is_init()) return EastAsia; + if (Cs.is_init()) return Cs; + + return nullable(); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/RFonts.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/RFonts.h new file mode 100644 index 0000000000..379d610b41 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/RFonts.h @@ -0,0 +1,52 @@ +#pragma once +#ifndef OOX_LOGIC_RFONTS_INCLUDE_H_ +#define OOX_LOGIC_RFONTS_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "nullable_property.h" + + +namespace OOX +{ + namespace Logic + { + class RFonts : public WritingElement + { + public: + RFonts(); + virtual ~RFonts(); + explicit RFonts(const XML::XNode& node); + const RFonts& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + void setFontName(const nullable& fontName); + const std::string fontType() const; + const std::string fontTypeAscii() const; + const std::string fontTypeHAnsi() const; + const std::string fontTypeEA() const; + const std::string fontTypeCS() const; + const nullable fontName() const; + + public: + nullable_property AsciiTheme; + nullable_property EastAsiaTheme; + nullable_property HAnsiTheme; + nullable_property Cstheme; + + nullable_property Hint; + + nullable_property ascii; + nullable_property hAnsi; + + nullable_property EastAsia; + nullable_property Cs; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_RFONTS_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Rect.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Rect.cpp new file mode 100644 index 0000000000..1de5e412b8 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Rect.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Rect.h" + +namespace OOX +{ + namespace Logic + { + Rect::Rect() + { + + } + + Rect::~Rect() + { + + } + + Rect::Rect(const XML::XNode& node) + { + fromXML(node); + } + + const Rect& Rect::operator = (const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void Rect::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + Id = element.attribute("id").value(); + style = element.attribute("style").value(); + Wrap = element.element("wrap"); + anchorlock = element.element("anchorlock"); + + fillstyle = element; + linestyle = element; + shadow = element.element("shadow"); + + textbox = element.element("textbox"); + } + + const XML::XNode Rect::toXML() const + { + return XML::XElement(ns.v + "rect", XML::XAttribute("id", Id) + XML::XAttribute("style", style.ToString()) + XML::Write(Wrap)); + } + + } // namespace Logic +} // namespace OOX diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Rect.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Rect.h new file mode 100644 index 0000000000..b29b5201fe --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Rect.h @@ -0,0 +1,44 @@ +#pragma once +#ifndef OOX_LOGIC_RECT_INCLUDE_H_ +#define OOX_LOGIC_RECT_INCLUDE_H_ + +#include "Wrap.h" +#include "Shadow.h" +#include "TextBox.h" +#include "LineStyle.h" +#include "FillStyle.h" +#include "ShapeStyle.h" + +namespace OOX +{ + namespace Logic + { + class Rect : public WritingElement + { + public: + Rect(); + virtual ~Rect(); + explicit Rect(const XML::XNode& node); + const Rect& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Id; + property style; + + nullable_property Wrap; + nullable_property anchorlock; + + nullable_property fillstyle; + nullable_property linestyle; + nullable_property shadow; + + nullable_property textbox; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_RECT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Roundrect.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Roundrect.cpp new file mode 100644 index 0000000000..4756b594c8 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Roundrect.cpp @@ -0,0 +1,56 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Roundrect.h" + +namespace OOX +{ + namespace Logic + { + Roundrect::Roundrect() + { + + } + + Roundrect::~Roundrect() + { + + } + + Roundrect::Roundrect (const XML::XNode& node) + { + fromXML(node); + } + + const Roundrect& Roundrect::operator = (const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void Roundrect::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + Id = element.attribute("id").value(); + style = element.attribute("style").value(); + arcsize = element.attribute("arcsize").value(); + Wrap = element.element("wrap"); + anchorlock = element.element("anchorlock"); + + fillstyle = element; + linestyle = element; + shadow = element.element("shadow"); + + textbox = element.element("textbox"); + } + + const XML::XNode Roundrect::toXML() const + { + return XML::XElement(ns.v + "rect", XML::XAttribute("id", Id) + XML::XAttribute("style", style.ToString()) + XML::XAttribute("arcsize", arcsize) + XML::Write(Wrap)); + } + + } // namespace Logic +} // namespace OOX diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Roundrect.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Roundrect.h new file mode 100644 index 0000000000..ceedda25f4 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Roundrect.h @@ -0,0 +1,46 @@ +#pragma once +#ifndef OOX_LOGIC_ROUNDRECT_INCLUDE_H_ +#define OOX_LOGIC_ROUNDRECT_INCLUDE_H_ + +#include "Wrap.h" +#include "Shadow.h" +#include "TextBox.h" +#include "LineStyle.h" +#include "FillStyle.h" +#include "ShapeStyle.h" + +namespace OOX +{ + namespace Logic + { + class Roundrect : public WritingElement + { + public: + Roundrect(); + virtual ~Roundrect(); + explicit Roundrect(const XML::XNode& node); + const Roundrect& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + + property Id; + property style; + + nullable_property Wrap; + nullable_property anchorlock; + nullable_property arcsize; + + nullable_property fillstyle; + nullable_property linestyle; + nullable_property shadow; + + nullable_property textbox; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_ROUNDRECT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Run.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Run.cpp new file mode 100644 index 0000000000..224d42fd79 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Run.cpp @@ -0,0 +1,159 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Run.h" +#include "./../FormatError.h" +#include "Utility.h" +#include +#include +#include "Text.h" +#include "Symbol.h" + + +namespace OOX +{ + namespace Logic + { + + Run::Run() + { + } + + + Run::~Run() + { + } + + + Run::Run(const XML::XNode& node) + { + fromXML(node); + } + + + Run::Run(const std::string& text) + { + fromTxt(text); + } + + + Run::Run(const std::string& text, const RunProperty& runProperty) + { + fromTxt(text); + Property = runProperty; + } + + + const Run& Run::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + const Run& Run::operator =(const std::string& text) + { + fromTxt(text); + return *this; + } + + + void Run::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Property = element.element("rPr"); + + for (XML::const_node_iterator i = element.Nodes.begin(); i != element.Nodes.end(); ++i) + { + if (i->isElement()) + { + const XML::XElement element(*i); + + if (element.XName == "AlternateContent") + { + for (XML::const_element_iterator j = element.Elements.begin(); j != element.Elements.end(); ++j) + { + const XML::XElement oElement(*j); + if (oElement.XName == "Fallback") + { + for (XML::const_element_iterator j = element.Elements.begin(); j != element.Elements.end(); ++j) + fromXML (*j); + + break; + } + } + } + + if (element.XName == "t" ||element.XName == "tab" || element.XName == "br" || + element.XName == "drawing" || element.XName == "pict" || element.XName == "footnoteRef" || + element.XName == "endnoteRef" || element.XName == "continuationSeparator" || + element.XName == "separator" || element.XName == "footnoteReference" || + element.XName == "endnoteReference" || element.XName == "object" || + element.XName == "fldChar" || element.XName == "instrText" || element.XName == "sym") + { + Items->push_back(RunItem(*i)); + } + } + else if (i->isText()) + { + XML::XText text(*i); + Items->push_back(RunItem(text.Value)); + } + } + } + + + void Run::fromTxt(const std::string& text) + { + add(text); + } + + + const XML::XNode Run::toXML() const + { + return + XML::XElement(ns.w + "r", + XML::Write(Property) + + XML::Write(Items) + ); + } + + + const std::string Run::toTxt() const + { + std::string text; + BOOST_FOREACH(const RunItem& item, *Items) + { + text += item.toTxt(); + } + return text; + } + + + const bool Run::empty() const + { + return Items->empty(); + } + + + void Run::clear() + { + Items->clear(); + } + + + void Run::add(RunItemBase* item) + { + Items->push_back(RunItem(item)); + } + + + void Run::add(const std::string& text) + { + Items->push_back(RunItem(new Text(text))); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Run.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Run.h new file mode 100644 index 0000000000..2b5909faea --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Run.h @@ -0,0 +1,53 @@ +#pragma once +#ifndef OOX_LOGIC_RUN_INCLUDE_H_ +#define OOX_LOGIC_RUN_INCLUDE_H_ + +#include "ParagraphItemBase.h" +#include "RunProperty.h" +#include "nullable_property.h" +#include +#include "RunItem.h" +#include "./../RId.h" +#include + + +namespace OOX +{ + namespace Logic + { + class Run : public ParagraphItemBase + { + public: + Run(); + virtual ~Run(); + explicit Run(const XML::XNode& node); + explicit Run(const std::string& text); + Run(const std::string& text, const RunProperty& runProperty); + const Run& operator =(const XML::XNode& node); + const Run& operator =(const std::string& text); + + public: + virtual void fromXML(const XML::XNode& node); + virtual void fromTxt(const std::string& text); + virtual const XML::XNode toXML() const; + virtual const std::string toTxt() const; + + public: + const bool empty() const; + void clear(); + + public: + nullable_property Property; + property > Items; + + public: + template void add() {Items->push_back(RunItem(new T()));} + template void add(const T& item) {Items->push_back(RunItem(new T(item)));}; + template void add(T* item) {Items->push_back(RunItem(item));} + void add(RunItemBase* item); + void add(const std::string& text); + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_RUN_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/RunItem.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/RunItem.cpp new file mode 100644 index 0000000000..d61559ee79 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/RunItem.cpp @@ -0,0 +1,134 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "RunItem.h" +#include "Text.h" +#include "Symbol.h" +#include "Drawing.h" +#include "Pict.h" +#include "ContinuationSeparator.h" +#include "FootnoteRef.h" +#include "EndnoteRef.h" +#include "Separator.h" +#include "Tab.h" +#include "Break.h" +#include "FootnoteReference.h" +#include "EndnoteReference.h" + +#include "Pict.h" +#include "FldChar.h" +#include "InstrText.h" +#include "DelText.h" +#include "NullRun.h" + +namespace OOX +{ + namespace Logic + { + RunItem::RunItem() + { + + } + + RunItem::~RunItem() + { + + } + + RunItem::RunItem(RunItemBase* item) + { + fromItem(item); + } + + RunItem::RunItem(const XML::XNode& node) + { + fromXML(node); + } + + RunItem::RunItem(const std::string& text) + { + fromTxt(text); + } + + const RunItem& RunItem::operator =(RunItemBase* item) + { + fromItem(item); + return *this; + } + + const RunItem& RunItem::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + const RunItem& RunItem::operator =(const std::string& text) + { + fromTxt(text); + return *this; + } + + void RunItem::fromItem(RunItemBase* item) + { + m_item.reset(item); + } + + void RunItem::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + if (element.XName == "t") + fromItem(new Text(node)); + else if (element.XName == "tab") + fromItem(new Tab(node)); + else if (element.XName == "br") + fromItem(new Break(node)); + else if (element.XName == "drawing") + fromItem(new Drawing(node)); + else if (element.XName == "pict" || element.XName == "object") + fromItem(new Pict(node)); + else if (element.XName == "footnoteRef") + fromItem(new FootnoteRef(node)); + else if (element.XName == "endnoteRef") + fromItem(new EndnoteRef(node)); + else if (element.XName == "continuationSeparator") + fromItem(new ContinuationSeparator(node)); + else if (element.XName == "separator") + fromItem(new Separator(node)); + else if (element.XName == "footnoteReference") + fromItem(new FootnoteReference(node)); + else if (element.XName == "endnoteReference") + fromItem(new EndnoteReference(node)); + /*else if (element.XName == "object") + fromItem(new Object(node));*/ + else if (element.XName == "fldChar") + fromItem(new FldChar(node)); + else if (element.XName == "instrText") + fromItem(new InstrText(node)); + else if (element.XName == "sym") + fromItem(new Symbol(node)); + else if (element.XName == "delText") + fromItem(new DelText(node)); + else + fromItem(new NullRun(node)); + } + + const XML::XNode RunItem::toXML() const + { + return XML::Write(m_item); + } + + void RunItem::fromTxt(const std::string& text) + { + m_item.reset(new Text(text)); + } + + const std::string RunItem::toTxt() const + { + return m_item->toTxt(); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/RunItem.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/RunItem.h new file mode 100644 index 0000000000..222c34e091 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/RunItem.h @@ -0,0 +1,41 @@ +#pragma once +#ifndef OOX_LOGIC_RUN_ITEM_INCLUDE_H_ +#define OOX_LOGIC_RUN_ITEM_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "IItemable.h" +#include +#include "RunItemBase.h" + + +namespace OOX +{ + namespace Logic + { + class RunItem : public WritingElement, public IItemable + { + public: + RunItem(); + virtual ~RunItem(); + explicit RunItem(RunItemBase* item); + explicit RunItem(const XML::XNode& node); + explicit RunItem(const std::string& text); + const RunItem& operator =(RunItemBase* item); + const RunItem& operator =(const XML::XNode& node); + const RunItem& operator =(const std::string& text); + + public: + void fromItem(RunItemBase* item); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + void fromTxt(const std::string& text); + const std::string toTxt() const; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_RUN_ITEM_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/RunItemBase.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/RunItemBase.cpp new file mode 100644 index 0000000000..300de4d815 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/RunItemBase.cpp @@ -0,0 +1,15 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "RunItemBase.h" + + +namespace OOX +{ + namespace Logic + { + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/RunItemBase.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/RunItemBase.h new file mode 100644 index 0000000000..0f74cac657 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/RunItemBase.h @@ -0,0 +1,21 @@ +#pragma once +#ifndef OOX_LOGIC_RUN_ITEM_BASE_INCLUDE_H_ +#define OOX_LOGIC_RUN_ITEM_BASE_INCLUDE_H_ + +#include "./../WritingElement.h" +#include + + +namespace OOX +{ + namespace Logic + { + class RunItemBase : public WritingElement + { + public: + virtual const std::string toTxt() const = 0; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_RUN_ITEM_BASE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/RunProperty.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/RunProperty.cpp new file mode 100644 index 0000000000..a29ecca968 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/RunProperty.cpp @@ -0,0 +1,310 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "RunProperty.h" +#include + + +namespace OOX +{ + namespace Logic + { + + RunProperty::RunProperty() + { + } + + + RunProperty::~RunProperty() + { + } + + + RunProperty::RunProperty(const XML::XNode& node) + { + fromXML(node); + } + + + const RunProperty& RunProperty::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void RunProperty::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + + if (element.element("b").exist()) + { + if (!(element.element("b").attribute("val").exist() && element.element("b").attribute("val").value().ToBool() == false)) + Bold = true; + else + Bold = false; + } + + if (element.element("i").exist()) + { + if (!(element.element("i").attribute("val").exist() && element.element("i").attribute("val").value().ToBool() == false)) + Italic = true; + else + Italic = false; + } + + if (element.element("u").exist()) + { + Under = true; + UnderType = element.element("u").attribute("val").value(); + } + + if (element.element("strike").exist()) + { + if(!(element.element("strike").attribute("val").exist() && element.element("strike").attribute("val").value().ToBool() == false)) + Strike = true; + else + Strike = false; + } + + if (element.element("dstrike").exist()) + { + if (!(element.element("dstrike").attribute("val").exist() && element.element("dstrike").attribute("val").value().ToBool() == false)) + DStrike = true; + else + DStrike = false; + } + + if (element.element("smallCaps").exist()) + { + if(!(element.element("smallCaps").attribute("val").exist() && element.element("smallCaps").attribute("val").value().ToBool() == false)) + SmallCaps = true; + else + SmallCaps = false; + } + + if (element.element("caps").exist()) + { + if (!(element.element("caps").attribute("val").exist() && element.element("caps").attribute("val").value().ToBool() == false)) + Caps = true; + else + Caps = false; + } + + if (element.element("emboss").exist()) + { + if (!(element.element("emboss").attribute("val").exist() && element.element("emboss").attribute("val").value().ToBool() == false)) + Emboss = true; + else + Emboss = false; + } + + if (element.element("imprint").exist()) + { + if (!(element.element("imprint").attribute("val").exist() && element.element("imprint").attribute("val").value().ToBool() == false)) + Imprint = true; + else + Imprint = false; + } + + if (element.element("outline").exist()) + { + if (!(element.element("outline").attribute("val").exist() && element.element("outline").attribute("val").value().ToBool() == false)) + Outline = true; + else + Outline = false; + } + + if (element.element("shadow").exist()) + { + if (!(element.element("shadow").attribute("val").exist() && element.element("shadow").attribute("val").value().ToBool() == false)) + Shadow = true; + else + Shadow = false; + } + + if (element.element("vanish").exist()) + { + if (!(element.element("vanish").attribute("val").exist() && element.element("vanish").attribute("val").value().ToBool() == false)) + Vanish = true; + else + Vanish = false; + } + + WebHidden = element.element("webHidden").exist(); + Lang = element.element("lang"); + rFonts = element.element("rFonts"); + RStyle = element.element("rStyle").attribute("val").value(); + FontSize = element.element("sz").attribute("val").value(); + Index = element.element("vertAlign").attribute("val").value(); + FontColor = element.element("color").attribute("val").value(); + //Background = element.element("shd").attribute("fill").value(); + Highlight = element.element("highlight").attribute("val").value(); + Shading = element.element("shd"); + Spacing = element.element("spacing").attribute("val").value(); + Kern = element.element("kern").attribute("val").value(); + Position = element.element("position").attribute("val").value(); + Scale = element.element("w").attribute("val").value(); + Border = element.element("bdr"); + PropertyChange = element.element("rPrChange"); + } + + + const XML::XNode RunProperty::toXML() const + { + return + XML::XElement(ns.w + "rPr", + //XML::WriteIf(XML::XElement(ns.w + "b"), Bold) + + //XML::WriteIf(XML::XElement(ns.w + "i"), Italic) + + XML::WriteIf(XML::XElement(ns.w + "b", XML::XAttribute(ns.w + "val", Bold)), Bold.is_init()) + + XML::WriteIf(XML::XElement(ns.w + "i", XML::XAttribute(ns.w + "val", Italic)), Italic.is_init()) + + //XML::WriteIf(XML::XElement(ns.w + "strike"), Strike) + + //XML::WriteIf(XML::XElement(ns.w + "dstrike"), DStrike) + + XML::WriteIf(XML::XElement(ns.w + "strike", XML::XAttribute(ns.w + "val", Strike)), Strike.is_init()) + + XML::WriteIf(XML::XElement(ns.w + "dstrike", XML::XAttribute(ns.w + "val", DStrike)), DStrike.is_init()) + + + XML::WriteIf(XML::XElement(ns.w + "u", XML::XAttribute(ns.w + "val", UnderType.get_value_or("single"))), Under) + + //XML::WriteIf(XML::XElement(ns.w + "smallCaps"), SmallCaps) + + //XML::WriteIf(XML::XElement(ns.w + "caps"), Caps) + + //XML::WriteIf(XML::XElement(ns.w + "emboss"), Emboss) + + //XML::WriteIf(XML::XElement(ns.w + "imprint"), Imprint) + + //XML::WriteIf(XML::XElement(ns.w + "outline"), Outline) + + //XML::WriteIf(XML::XElement(ns.w + "shadow"), Shadow) + + //XML::WriteIf(XML::XElement(ns.w + "vanish"), Vanish) + + //XML::WriteIf(XML::XElement(ns.w + "webHidden"), WebHidden) + + XML::WriteIf(XML::XElement(ns.w + "smallCaps", XML::XAttribute(ns.w + "val", SmallCaps)), SmallCaps.is_init()) + + XML::WriteIf(XML::XElement(ns.w + "caps", XML::XAttribute(ns.w + "val", Caps)), Caps.is_init()) + + XML::WriteIf(XML::XElement(ns.w + "emboss", XML::XAttribute(ns.w + "val", Emboss)), Emboss.is_init()) + + XML::WriteIf(XML::XElement(ns.w + "imprint", XML::XAttribute(ns.w + "val", Imprint)), Imprint.is_init()) + + XML::WriteIf(XML::XElement(ns.w + "outline", XML::XAttribute(ns.w + "val", Outline)), Outline.is_init()) + + XML::WriteIf(XML::XElement(ns.w + "shadow", XML::XAttribute(ns.w + "val", Shadow)), Shadow.is_init()) + + XML::WriteIf(XML::XElement(ns.w + "vanish", XML::XAttribute(ns.w + "val", Vanish)), Vanish.is_init()) + + XML::WriteIf(XML::XElement(ns.w + "webHidden", XML::XAttribute(ns.w + "val", WebHidden)), WebHidden.is_init()) + + + XML::Write(ns.w + "sz", ns.w + "val", FontSize) + + XML::Write(ns.w + "szCs", ns.w + "val", FontSize) + + XML::Write(ns.w + "rStyle", ns.w + "val", RStyle) + + XML::Write(Lang) + + XML::Write(rFonts) + + XML::WriteIf(XML::XElement(ns.w + "vertAlign", XML::XAttribute(ns.w + "val", Index)), Index.is_init() && (Index->isSub() || Index->isSuper())) + + XML::Write(ns.w + "color", ns.w + "val", FontColor) + + XML::Write(ns.w + "highlight", ns.w + "val", Highlight) + + //XML::Write(ns.w + "shd", ns.w + "fill", Background) + + XML::Write(Shading) + + XML::Write(ns.w + "spacing", ns.w + "val", Spacing) + + XML::Write(ns.w + "kern", ns.w + "val", Kern) + + XML::Write(ns.w + "position", ns.w + "val", Position) + + XML::Write(ns.w + "w", ns.w + "val", Scale) + + XML::Write(Border) + + XML::Write(PropertyChange) + ); + } + + + const bool RunProperty::isSimple() const + { + /*const bool bold = Bold; + const bool italic = Italic; + const bool under = Under; + const bool strike = Strike; + const bool dstrike = DStrike; + const bool smallCaps = SmallCaps; + const bool caps = Caps; + const bool emboss = Emboss; + const bool imprint = Imprint; + const bool outline = Outline; + const bool shadow = Shadow; + const bool vanish = Vanish;*/ + + if (RStyle.is_init()) + return false; + if (Spacing.is_init()) + return false; + if (rFonts.is_init()) + return false; + if (FontSize.is_init()) + return false; + if (Index.is_init()) + return false; + if (FontColor.is_init()) + return false; + //if (Background.is_init()) + //return false; + if (Shading.is_init()) + return false; + if (Bold.is_init()) + return false; + if (Italic.is_init()) + return false; + if (Under.is_init() && UnderType != "none") + return false; + if (Strike.is_init()) + return false; + if (DStrike.is_init()) + return false; + if (SmallCaps.is_init()) + return false; + if (Caps.is_init()) + return false; + if (Emboss.is_init()) + return false; + if (Imprint.is_init()) + return false; + if (Outline.is_init()) + return false; + if (Shadow.is_init()) + return false; + if (Vanish.is_init()) + return false; + if (Kern.is_init()) + return false; + if (Position.is_init()) + return false; + if (Scale.is_init()) + return false; + if (Border.is_init()) + return false; + if (PropertyChange.is_init()) + return false; + + return true; + } + + const RunProperty RunProperty::merge(const RunProperty& prev, const RunProperty& current) + { + RunProperty properties; + properties.Bold = ::merge(prev.Bold, current.Bold); + properties.Italic = ::merge(prev.Italic, current.Italic); + properties.Under = ::merge(prev.Under, current.Under); + properties.Strike = ::merge(prev.Strike, current.Strike); + properties.DStrike = ::merge(prev.DStrike, current.DStrike); + properties.SmallCaps = ::merge(prev.SmallCaps, current.SmallCaps); + properties.Caps = ::merge(prev.Caps, current.Caps); + properties.Emboss = ::merge(prev.Emboss, current.Emboss); + properties.Imprint = ::merge(prev.Imprint, current.Imprint); + properties.Outline = ::merge(prev.Outline, current.Outline); + properties.Shadow = ::merge(prev.Shadow, current.Shadow); + properties.Vanish = ::merge(prev.Vanish, current.Vanish); + properties.WebHidden = ::merge(prev.WebHidden, current.WebHidden); + properties.FontSize = ::merge(prev.FontSize, current.FontSize); + properties.RStyle = ::merge(prev.RStyle, current.RStyle); + properties.Lang = ::merge(prev.Lang, current.Lang); + properties.Index = ::merge(prev.Index, current.Index); + properties.FontColor = ::merge(prev.FontColor, current.FontColor); + //properties.Background = ::merge(prev.Background, current.Background); + properties.Shading = ::merge(prev.Shading, current.Shading); + properties.rFonts = ::merge(prev.rFonts, current.rFonts); + properties.Spacing = ::merge(prev.Spacing, current.Spacing); + properties.Kern = ::merge(prev.Kern, current.Kern); + properties.Position = ::merge(prev.Position, current.Position); + properties.Scale = ::merge(prev.Scale, current.Scale); + properties.Border = ::merge(prev.Border, current.Border); + properties.PropertyChange = ::merge(prev.PropertyChange, current.PropertyChange); + return properties; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/RunProperty.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/RunProperty.h new file mode 100644 index 0000000000..fd71e1f178 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/RunProperty.h @@ -0,0 +1,77 @@ +#pragma once +#ifndef OOX_LOGIC_RUN_PROPERTY_INCLUDE_H_ +#define OOX_LOGIC_RUN_PROPERTY_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "property.h" +#include "nullable_property.h" +#include "Color.h" +#include "BackgroundColor.h" +#include "Index.h" +#include "Lang.h" +#include "RFonts.h" +#include "Shading.h" +#include "Border.h" +#include "RunPropertyChange.h" +#include "./../Unit.h" +#include "./../Limit/UnderType.h" + +namespace OOX +{ + namespace Logic + { + class RunProperty : public WritingElement + { + public: + RunProperty(); + virtual ~RunProperty(); + explicit RunProperty(const XML::XNode& node); + const RunProperty& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + static const RunProperty merge(const RunProperty& prev, const RunProperty& current); + + public: + const bool isSimple() const; + + public: + nullable_property Bold; + nullable_property Italic; + nullable_property Under; + nullable_property Strike; + nullable_property DStrike; + nullable_property UnderType; + nullable_property SmallCaps; + nullable_property Caps; + nullable_property Emboss; + nullable_property Imprint; + nullable_property Outline; + nullable_property Shadow; + nullable_property Vanish; + nullable_property WebHidden; + nullable_property FontSize; + nullable_property RStyle; + nullable_property Lang; + nullable_property Index; + nullable_property FontColor; + //nullable_property Background; + nullable_property Highlight; + nullable_property Shading; + nullable_property rFonts; + nullable_property Spacing; + nullable_property > Kern; + nullable_property > Position; + nullable_property > Scale; + nullable_property Border; + nullable_property PropertyChange; + + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_RUN_PROPERTY_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/RunPropertyChange.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/RunPropertyChange.cpp new file mode 100644 index 0000000000..ec39a22d9d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/RunPropertyChange.cpp @@ -0,0 +1,58 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "RunPropertyChange.h" + + +namespace OOX +{ + namespace Logic + { + + RunPropertyChange::RunPropertyChange() + { + } + + + RunPropertyChange::~RunPropertyChange() + { + } + + + RunPropertyChange::RunPropertyChange(const XML::XNode& node) + { + fromXML(node); + } + + + const RunPropertyChange& RunPropertyChange::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void RunPropertyChange::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + Id = element.attribute("id").value(); + Author = element.attribute("author").value(); + Date = element.attribute("date").value(); + } + + + const XML::XNode RunPropertyChange::toXML() const + { + return + XML::XElement(ns.w + "rPrChange", + XML::XAttribute(ns.w + "id", Id) + + XML::XAttribute(ns.w + "author", Author) + + XML::XAttribute(ns.w + "date", Date) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/RunPropertyChange.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/RunPropertyChange.h new file mode 100644 index 0000000000..ae9d3a5f45 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/RunPropertyChange.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef OOX_LOGIC_RUN_PROPERTY_CHANGE_INCLUDE_H_ +#define OOX_LOGIC_RUN_PROPERTY_CHANGE_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "nullable_property.h" + + +namespace OOX +{ + namespace Logic + { + class RunPropertyChange : public WritingElement + { + public: + RunPropertyChange(); + virtual ~RunPropertyChange(); + explicit RunPropertyChange(const XML::XNode& node); + const RunPropertyChange& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property Id; + nullable_property Author; + nullable_property Date; + + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_RUN_PROPERTY_CHANGE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Sdt.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Sdt.cpp new file mode 100644 index 0000000000..2a0ad16586 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Sdt.cpp @@ -0,0 +1,56 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Sdt.h" + + +namespace OOX +{ + namespace Logic + { + + Sdt::Sdt() + { + } + + + Sdt::~Sdt() + { + } + + + Sdt::Sdt(const XML::XNode& node) + { + fromXML(node); + } + + + const Sdt& Sdt::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Sdt::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Property = element.element("sdtPr"); + EndProperty = element.element("sdtEndPr"); + Content = element.element("sdtContent"); + } + + + const XML::XNode Sdt::toXML() const + { + return + XML::XElement(ns.w + "sdt", + XML::Write(Property) + + XML::Write(EndProperty) + + XML::Write(Content) + ); + } + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Sdt.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Sdt.h new file mode 100644 index 0000000000..f0238d6166 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Sdt.h @@ -0,0 +1,37 @@ +#pragma once +#ifndef OOX_LOGIC_SDT_INCLUDE_H_ +#define OOX_LOGIC_SDT_INCLUDE_H_ + +#include "TextItemBase.h" +#include "property.h" +#include "nullable_property.h" +#include "SdtProperty.h" +#include "SdtEndProperty.h" +#include "SdtContent.h" + + +namespace OOX +{ + namespace Logic + { + class Sdt : public TextItemBase + { + public: + Sdt(); + virtual ~Sdt(); + explicit Sdt(const XML::XNode& node); + const Sdt& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property Property; + nullable_property EndProperty; + property Content; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_SDT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/SdtContent.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/SdtContent.cpp new file mode 100644 index 0000000000..22c2835327 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/SdtContent.cpp @@ -0,0 +1,50 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "SdtContent.h" + + +namespace OOX +{ + namespace Logic + { + + SdtContent::SdtContent() + { + } + + + SdtContent::~SdtContent() + { + } + + + SdtContent::SdtContent(const XML::XNode& node) + { + fromXML(node); + } + + + const SdtContent& SdtContent::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void SdtContent::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + XML::Fill(Items, element, "p", "tbl"); + } + + + const XML::XNode SdtContent::toXML() const + { + return XML::XElement(ns.w + "sdtContent", XML::Write(Items)); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/SdtContent.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/SdtContent.h new file mode 100644 index 0000000000..df1b9144f7 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/SdtContent.h @@ -0,0 +1,34 @@ +#pragma once +#ifndef OOX_LOGIC_SDT_CONTENT_INCLUDE_H_ +#define OOX_LOGIC_SDT_CONTENT_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include "./../Logic/TextItem.h" +#include + + +namespace OOX +{ + namespace Logic + { + // TODO ïîïðîáîâàòü ïåðåâåñòè â âûçûâàåìûé êëàññ + class SdtContent : public WritingElement + { + public: + SdtContent(); + virtual ~SdtContent(); + explicit SdtContent(const XML::XNode& node); + const SdtContent& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property > Items; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_SDT_CONTENT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/SdtEndProperty.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/SdtEndProperty.cpp new file mode 100644 index 0000000000..a971337c37 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/SdtEndProperty.cpp @@ -0,0 +1,59 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "SdtEndProperty.h" + + +namespace OOX +{ + namespace Logic + { + + SdtEndProperty::SdtEndProperty() + { + } + + + SdtEndProperty::~SdtEndProperty() + { + } + + + SdtEndProperty::SdtEndProperty(const XML::XNode& node) + { + fromXML(node); + } + + + const SdtEndProperty& SdtEndProperty::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void SdtEndProperty::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + RunProperty = element.element("rPr"); + Id = element.element("id").attribute("val").value(); + Temporary = element.attribute("temporary").exist(); + ShowingPlcHdr = element.attribute("showingPlcHdr").exist();; + } + + + const XML::XNode SdtEndProperty::toXML() const + { + return + XML::XElement(ns.w + "sdtEndPr", + XML::Write(RunProperty) + + XML::Write(ns.w + "id", ns.w + "val", Id) + + XML::WriteIf(XML::XElement(ns.w + "temporary"), Temporary) + + XML::WriteIf(XML::XElement(ns.w + "showingPlcHdr"), ShowingPlcHdr) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/SdtEndProperty.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/SdtEndProperty.h new file mode 100644 index 0000000000..2a3c0689eb --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/SdtEndProperty.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef OOX_LOGIC_SDT_END_PROPERTY_INCLUDE_H_ +#define OOX_LOGIC_SDT_END_PROPERTY_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include "RunProperty.h" + + +namespace OOX +{ + namespace Logic + { + class SdtEndProperty : public WritingElement + { + public: + SdtEndProperty(); + virtual ~SdtEndProperty(); + explicit SdtEndProperty(const XML::XNode& node); + const SdtEndProperty& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property RunProperty; + nullable_property Id; + property Temporary; + property ShowingPlcHdr; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_SDT_END_PROPERTY_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/SdtProperty.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/SdtProperty.cpp new file mode 100644 index 0000000000..2b6ee59aee --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/SdtProperty.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "SdtProperty.h" + + +namespace OOX +{ + namespace Logic + { + + SdtProperty::SdtProperty() + { + } + + + SdtProperty::~SdtProperty() + { + } + + + SdtProperty::SdtProperty(const XML::XNode& node) + { + fromXML(node); + } + + + const SdtProperty& SdtProperty::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void SdtProperty::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Id = element.element("id").attribute("val").value(); + DocPartObj = element.element("docPartObj"); + } + + + const XML::XNode SdtProperty::toXML() const + { + return + XML::XElement(ns.w + "sdtPr", + XML::Write(ns.w + "id", ns.w + "val", Id) + + XML::Write(DocPartObj) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/SdtProperty.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/SdtProperty.h new file mode 100644 index 0000000000..506daad0e2 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/SdtProperty.h @@ -0,0 +1,33 @@ +#pragma once +#ifndef OOX_LOGIC_SDT_PROPERTY_INCLUDE_H_ +#define OOX_LOGIC_SDT_PROPERTY_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include "DocPartObj.h" + + +namespace OOX +{ + namespace Logic + { + class SdtProperty : public WritingElement + { + public: + SdtProperty(); + virtual ~SdtProperty(); + explicit SdtProperty(const XML::XNode& node); + const SdtProperty& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Id; + property DocPartObj; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_SDT_PROPERTY_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/SectorProperty.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/SectorProperty.cpp new file mode 100644 index 0000000000..ffdfc19351 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/SectorProperty.cpp @@ -0,0 +1,86 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "SectorProperty.h" +#include "NumFormat.h" + +namespace OOX +{ + namespace Logic + { + SectorProperty::SectorProperty() + { + + } + + SectorProperty::~SectorProperty() + { + + } + + SectorProperty::SectorProperty(const XML::XNode& node) + { + fromXML(node); + } + + const SectorProperty& SectorProperty::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void SectorProperty::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + PageSize = element.element("pgSz"); + PageMargin = element.element("pgMar"); + LnNumType = element.element("lnNumType"); + Columns = element.element("cols"); + DocumentGrid = element.element("docGrid"); + TitlePage = element.element("titlePg").exist(); + Type = element.element("type").attribute("val").value(); + PageBorders = element.element("pgBorders"); + + if (false == element.element("pgSz").exist()) + { + if (element.element("pgBorders").element("pgSz").exist()) + PageSize = element.element("pgBorders").element("pgSz"); + } + + XML::Fill(Footers, element, "footerReference"); + XML::Fill(Headers, element, "headerReference"); + + // TODO èñïðàâèòü, ìîãóò áûòü íå âñåãäà + if (element.element("footnotePr").exist()) + { + FootNoteProperty = element.element("footnotePr"); + } + + if (element.element("endnotePr").exist()) + { + EndNoteProperty = element.element("endnotePr"); + } + } + + const XML::XNode SectorProperty::toXML() const + { + return XML::XElement(ns.w + "sectPr", + XML::Write(FootNoteProperty) + + XML::Write(EndNoteProperty) + + XML::Write(PageSize) + + XML::Write(PageMargin) + + XML::Write(LnNumType) + + XML::Write(Columns) + + XML::Write(DocumentGrid) + + XML::Write(Footers) + + XML::Write(Headers) + + XML::Write(PageBorders) + + XML::Write(ns.w + "type", ns.w + "val", Type) + + XML::WriteIf(XML::XElement(ns.w + "titlePg"), TitlePage)); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/SectorProperty.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/SectorProperty.h new file mode 100644 index 0000000000..db65fa7745 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/SectorProperty.h @@ -0,0 +1,55 @@ +#ifndef OOX_LOGIC_SECTOR_PROPERTY_INCLUDE_H_ +#define OOX_LOGIC_SECTOR_PROPERTY_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include "nullable_property.h" +#include "PageSize.h" +#include "LnNumType.h" +#include "PageMargin.h" +#include "Columns.h" +#include "DocumentGrid.h" +#include "HeaderReference.h" +#include "FooterReference.h" +#include "FootNoteProperty.h" +#include "EndNoteProperty.h" +#include "./../Limit/SectPrType.h" +#include "PageBorders.h" + + +namespace OOX +{ + namespace Logic + { + class SectorProperty : public WritingElement + { + public: + SectorProperty(); + virtual ~SectorProperty(); + explicit SectorProperty(const XML::XNode& node); + const SectorProperty& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property PageSize; + property PageMargin; + property LnNumType; + nullable_property Columns; + nullable_property DocumentGrid; + nullable_property Type; + property > Headers; + property > Footers; + property TitlePage; + nullable_property PageBorders; + + // TODO èñïðàâèòü, ìîãóò áûòü íå âñåãäà + nullable_property FootNoteProperty; + nullable_property EndNoteProperty; + }; + } // namespace Logic +}// namespace OOX + +#endif // OOX_LOGIC_SECTOR_PROPERTY_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Separator.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Separator.cpp new file mode 100644 index 0000000000..7f42c53a95 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Separator.cpp @@ -0,0 +1,54 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Separator.h" + + +namespace OOX +{ + namespace Logic + { + + Separator::Separator() + { + } + + + Separator::~Separator() + { + } + + + Separator::Separator(const XML::XNode& node) + { + fromXML(node); + } + + + const Separator& Separator::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Separator::fromXML(const XML::XNode& node) + { + } + + + const XML::XNode Separator::toXML() const + { + return XML::XElement(ns.w + "separator"); + } + + + const std::string Separator::toTxt() const + { + return ""; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Separator.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Separator.h new file mode 100644 index 0000000000..180563bebb --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Separator.h @@ -0,0 +1,28 @@ +#pragma once +#ifndef OOX_LOGIC_SEPARATOR_INCLUDE_H_ +#define OOX_LOGIC_SEPARATOR_INCLUDE_H_ + +#include "RunItemBase.h" + + +namespace OOX +{ + namespace Logic + { + class Separator : public RunItemBase + { + public: + Separator(); + virtual ~Separator(); + explicit Separator(const XML::XNode& node); + const Separator& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + virtual const std::string toTxt() const; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_SEPARATOR_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Shading.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Shading.cpp new file mode 100644 index 0000000000..accc80b026 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Shading.cpp @@ -0,0 +1,51 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Shading.h" + +namespace OOX +{ + namespace Logic + { + Shading::Shading() + { + + } + + Shading::~Shading() + { + + } + + Shading::Shading(const XML::XNode& node) + { + fromXML(node); + } + + const Shading& Shading::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void Shading::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + value = element.attribute("val").value(); + color = element.attribute("color").value(); + fill = element.attribute("fill").value(); + } + + const XML::XNode Shading::toXML() const + { + return XML::XElement(ns.w + "shd", + XML::XAttribute(ns.w + "val", value) + + XML::XAttribute(ns.w + "color", color) + + XML::XAttribute(ns.w + "fill", fill)); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Shading.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Shading.h new file mode 100644 index 0000000000..78d60f134c --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Shading.h @@ -0,0 +1,34 @@ +#pragma once +#ifndef OOX_LOGIC_SHADING_INCLUDE_H_ +#define OOX_LOGIC_SHADING_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "nullable_property.h" + +namespace OOX +{ + namespace Logic + { + class Shading : public WritingElement + { + public: + Shading(); + virtual ~Shading(); + explicit Shading(const XML::XNode& node); + const Shading& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + + nullable_property value; + nullable_property color; + nullable_property fill; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_SHADING_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Shadow.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Shadow.cpp new file mode 100644 index 0000000000..ed1986e300 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Shadow.cpp @@ -0,0 +1,69 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Shadow.h" + + +namespace OOX +{ + namespace Logic + { + + Shadow::Shadow() + { + } + + + Shadow::~Shadow() + { + } + + + Shadow::Shadow(const XML::XNode& node) + { + fromXML(node); + } + + + const Shadow& Shadow::operator = (const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Shadow::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + On = element.attribute("on").value(); + Type = element.attribute("type").value(); + Color = element.attribute("color").value(); + Color2 = element.attribute("color2").value(); + Offset = element.attribute("offset").value(); + Offset2 = element.attribute("offset2").value(); + Opacity = element.attribute("opacity").value(); + Origin = element.attribute("origin").value(); + Matrix = element.attribute("matrix").value(); + } + + + const XML::XNode Shadow::toXML() const + { + return + XML::XElement(ns.v + "shadow", + XML::XAttribute("on", On) + + XML::XAttribute("type", Type) + + XML::XAttribute("color", Color) + + XML::XAttribute("color2", Color2) + + XML::XAttribute("offset", Offset) + + XML::XAttribute("offset2", Offset2) + + XML::XAttribute("opacity", Opacity) + + XML::XAttribute("origin", Origin) + + XML::XAttribute("matrix", Matrix) + ); + } + + } // namespace Logic +} // namespace OOX diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Shadow.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Shadow.h new file mode 100644 index 0000000000..9a9a1c6712 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Shadow.h @@ -0,0 +1,41 @@ +#pragma once +#ifndef OOX_LOGIC_SHADOW_INCLUDE_H_ +#define OOX_LOGIC_SHADOW_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "./../Limit/TrueFalse.h" +#include +#include "nullable_property.h" + +namespace OOX +{ + namespace Logic + { + class Shadow : public WritingElement + { + public: + Shadow(); + virtual ~Shadow(); + explicit Shadow(const XML::XNode& node); + const Shadow& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + + nullable_property On; + nullable_property Type; + nullable_property Opacity; + nullable_property Origin; + nullable_property Matrix; + nullable_property Color; + nullable_property Color2; + nullable_property Offset; + nullable_property Offset2; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_SHADOW_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Shape.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Shape.cpp new file mode 100644 index 0000000000..c2323a6365 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Shape.cpp @@ -0,0 +1,85 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Shape.h" + +namespace OOX +{ + namespace Logic + { + Shape::Shape() + { + + } + + Shape::~Shape() + { + + } + + Shape::Shape(const XML::XNode& node) + { + fromXML(node); + } + + const Shape& Shape::operator = (const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void Shape::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + Id = element.attribute("id").value(); + Type = element.attribute("type").value(); + style = element.attribute("style").value(); + adj = element.attribute("adj").value(); + AllowInCell = element.attribute("allowincell").value(); + Ole = element.attribute("ole").value(); + coordsize = element.attribute("coordsize").value(); + path = element.attribute("path").value(); + imageData = element.element("imagedata"); + TextPath = element.element("textpath"); + Wrap = element.element("wrap"); + Extrusion = element.element("extrusion"); + anchorlock = element.element("anchorlock"); + + fillstyle = element; + linestyle = element; + shadow = element.element("shadow"); + + textbox = element.element("textbox"); + + if (element.element("fill").exist()) + fillstyle->fromXML(element.element("fill")); + + if (element.element("stroke").exist()) + linestyle->fromXML(element.element("stroke")); + } + + const XML::XNode Shape::toXML() const + { + return + XML::XElement(ns.v + "shape", + XML::XAttribute("id", Id) + + XML::XAttribute("type", Type) + + XML::XAttribute("style", style.ToString()) + + XML::XAttribute("adj", adj) + + XML::XAttribute("allowincell", AllowInCell) + + XML::XAttribute(ns.o + "ole", Ole) + + XML::XAttribute("coordsize", coordsize) + + XML::XAttribute("path", path) + + XML::Write(shadow) + + XML::Write(textbox) + + XML::Write(imageData) + + XML::Write(TextPath) + + XML::Write(Wrap) + + XML::Write(Extrusion)); + } + + } // namespace Logic +} // namespace OOX diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Shape.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Shape.h new file mode 100644 index 0000000000..2f1f1015ff --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Shape.h @@ -0,0 +1,59 @@ +#pragma once +#ifndef OOX_LOGIC_SPAPE_INCLUDE_H_ +#define OOX_LOGIC_SPAPE_INCLUDE_H_ + +#include "Fill.h" +#include "Wrap.h" +#include "Shadow.h" +#include "TextBox.h" +#include "TextPath.h" +#include "ImageData.h" +#include "Extrusion.h" +#include "LineStyle.h" +#include "FillStyle.h" +#include "ShapeStyle.h" + +namespace OOX +{ + namespace Logic + { + class Shape : public WritingElement + { + public: + Shape(); + virtual ~Shape(); + explicit Shape(const XML::XNode& node); + const Shape& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Id; + property Type; + property style; + + nullable_property TextPath; + nullable_property adj; + nullable_property Ole; + + nullable_property imageData; + nullable_property AllowInCell; + nullable_property Wrap; + nullable_property Extrusion; + nullable_property coordsize; + + nullable_property anchorlock; + + nullable_property fillstyle; + nullable_property linestyle; + nullable_property shadow; + + nullable_property path; + nullable_property textbox; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_SPAPE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/ShapeStyle.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ShapeStyle.cpp new file mode 100644 index 0000000000..0ab76a6313 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ShapeStyle.cpp @@ -0,0 +1,212 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ShapeStyle.h" +#include +#include +#include +#include + +namespace OOX +{ + namespace Logic + { + ShapeStyle::ShapeStyle() + { + + } + + ShapeStyle::ShapeStyle(const std::string& value) + { + FromString(value); + } + + const ShapeStyle& ShapeStyle::operator =(const std::string& value) + { + FromString(value); + return *this; + } + + const std::string ShapeStyle::ToString () const + { + return std::string(""); + } + + void ShapeStyle::FromString(const std::string& value) + { + std::vector container; + boost::split(container, value, boost::is_any_of(";")); + + distanceLeftTop.init(); + distanceLeftTop->X = 0; + distanceLeftTop->X = 0; + + distanceRightBottom.init(); + distanceRightBottom->X = 0; + distanceRightBottom->Y = 0; + + leftTop.init(); + leftTop->X = 0; + leftTop->Y = 0; + + msoWidthPercent = std::string(""); + msoHeightPercent = std::string(""); + msoPositionHorizontal = std::string(""); + msoPositionVertical = std::string(""); + msoPositionHorizontalRelative = std::string(""); + msoPositionVerticalRelative = std::string(""); + textAnchor = std::string(""); + + isLocalUnit = false; + + BOOST_FOREACH(const std::string& item, container) + { + std::vector pair; + boost::split(pair, item, boost::is_any_of(":")); + std::string name = pair.front(); + + std::string::size_type start = name.find_first_not_of(" "); + std::string::size_type end = name.find_last_not_of(" "); + + if (start != std::string::npos && end != std::string::npos) + name = name.substr(start, end - start + 1); + + if (name == "position") + { + Position = pair.back(); + } + else if (name == "visibility") + { + visibility = pair.back(); + } + else if (name == "margin-left") + { + Point.init(); + Point->X = pair.back(); + } + else if (name == "margin-top") + { + Point.init(); + Point->Y = pair.back(); + } + else if (name == "width") + { + Size->Width = pair.back(); + + if ((std::string::npos == pair.back().find("pt")) && + (std::string::npos == pair.back().find("mm")) && + (std::string::npos == pair.back().find("cm")) && + (std::string::npos == pair.back().find("px")) && + (std::string::npos == pair.back().find("in")) && + (std::string::npos == pair.back().find("%")) && + (std::string::npos == pair.back().find("*")) ) + { + isLocalUnit = true; + } + } + else if (name == "height") + { + Size->Height = pair.back(); + + if ((std::string::npos == pair.back().find("pt")) && + (std::string::npos == pair.back().find("mm")) && + (std::string::npos == pair.back().find("cm")) && + (std::string::npos == pair.back().find("px")) && + (std::string::npos == pair.back().find("in")) && + (std::string::npos == pair.back().find("%")) && + (std::string::npos == pair.back().find("*")) ) + { + isLocalUnit = true; + } + } + else if (name == "z-index") + { + ZIndex = pair.back(); + } + else if (name == "mso-width-relative") + { + WidthRelative = pair.back(); + } + else if (name == "mso-height-relative") + { + HeightRelative = pair.back(); + } + else if (name == "rotation") + { + rotation = pair.back(); + } + // MSO-HW + else if (name == "mso-width-percent") + msoWidthPercent = pair.back(); + else if (name == "mso-height-percent") + msoHeightPercent = pair.back(); + // MSO - POSITION + else if (name == "mso-position-horizontal") + msoPositionHorizontal = pair.back(); + else if (name == "mso-position-vertical") + msoPositionVertical = pair.back(); + else if (name == "mso-position-horizontal-relative") + msoPositionHorizontalRelative = pair.back(); + else if (name == "mso-position-vertical-relative") + msoPositionVerticalRelative = pair.back(); + // TEXT + else if (name == "v-text-anchor") + textAnchor = pair.back(); + + else if ("mso-wrap-distance-left" == name) + { + distanceLeftTop->X = pair.back(); + } + else if ("mso-wrap-distance-top" == name) + { + distanceLeftTop->Y = pair.back(); + } + else if ("mso-wrap-distance-right" == name) + { + distanceRightBottom->X = pair.back(); + } + else if ("mso-wrap-distance-bottom" == name) + { + distanceRightBottom->Y = pair.back(); + } + else if (name == "flip") + { + flip = pair.back(); + } + else if (name == "left") + { + leftTop->X = pair.back(); + + if ((std::string::npos == pair.back().find("pt")) && + (std::string::npos == pair.back().find("mm")) && + (std::string::npos == pair.back().find("cm")) && + (std::string::npos == pair.back().find("px")) && + (std::string::npos == pair.back().find("in")) && + (std::string::npos == pair.back().find("%")) && + (std::string::npos == pair.back().find("*")) ) + { + isLocalUnit = true; + } + } + else if (name == "top") + { + leftTop->Y = pair.back(); + + if ((std::string::npos == pair.back().find("pt")) && + (std::string::npos == pair.back().find("mm")) && + (std::string::npos == pair.back().find("cm")) && + (std::string::npos == pair.back().find("px")) && + (std::string::npos == pair.back().find("in")) && + (std::string::npos == pair.back().find("%")) && + (std::string::npos == pair.back().find("*")) ) + { + isLocalUnit = true; + } + } + } + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/ShapeStyle.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ShapeStyle.h new file mode 100644 index 0000000000..3c8cf68ca4 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ShapeStyle.h @@ -0,0 +1,64 @@ +#pragma once +#ifndef OOX_LOGIC_SHAPE_STYLE_INCLUDE_H_ +#define OOX_LOGIC_SHAPE_STYLE_INCLUDE_H_ + +#include + +#include "Common.h" +#include "property.h" +#include "Utility.h" +#include "nullable_property.h" + +#include "./../Limit/Position.h" +#include "./../Limit/MsoRelative.h" + +namespace OOX +{ + namespace Logic + { + class ShapeStyle + { + public: + ShapeStyle(); + explicit ShapeStyle(const std::string& value); + const ShapeStyle& operator=(const std::string& value); + + public: + const std::string ToString() const; + void FromString(const std::string& value); + + public: + + property > > Size; + nullable_property > > Point; + nullable_property Position; + + nullable_property flip; + nullable_property ZIndex; + nullable_property rotation; + nullable_property visibility; + + nullable_property msoWidthPercent; + nullable_property msoHeightPercent; + + nullable_property msoPositionHorizontal; + nullable_property msoPositionVertical; + nullable_property msoPositionHorizontalRelative; + nullable_property msoPositionVerticalRelative; + + nullable_property textAnchor; + + nullable_property WidthRelative; + nullable_property HeightRelative; + + nullable >> distanceLeftTop; + nullable >> distanceRightBottom; + + // group + nullable >> leftTop; + bool isLocalUnit; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_SHAPE_STYLE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/ShapeType.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ShapeType.cpp new file mode 100644 index 0000000000..516301fc2a --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ShapeType.cpp @@ -0,0 +1,77 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ShapeType.h" + +namespace OOX +{ + namespace Logic + { + ShapeType::ShapeType() + { + + } + + ShapeType::~ShapeType() + { + + } + + ShapeType::ShapeType(const XML::XNode& node) + { + fromXML(node); + } + + const ShapeType& ShapeType::operator = (const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void ShapeType::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + Id = element.attribute("id").value(); + coordsize = element.attribute("coordsize").value(); + Spt = element.attribute("spt").value(); + path = element.attribute("path").value(); + Filled = element.attribute("filled").value(); + Stroked = element.attribute("stroked").value(); + Stroke = element.element("stroke"); + formulas = element.element("formulas"); + Lock = element.element("lock"); + PathElement = element.element("path"); + Handles = element.element("handles"); + TextPath = element.element("textpath"); + Complex = element.element("complex"); + adj = element.attribute("adj").value(); + Preferrelative = element.attribute("preferrelative").value(); + } + + const XML::XNode ShapeType::toXML() const + { + return + XML::XElement(ns.v + "shapetype", + XML::XAttribute("id", Id) + + XML::XAttribute("coordsize", coordsize) + + XML::XAttribute(ns.o + "spt", Spt) + + XML::XAttribute(ns.o + "preferrelative", Preferrelative) + + XML::XAttribute("adj", adj) + + XML::XAttribute("path", path) + + XML::XAttribute("filled", Filled) + + XML::XAttribute("stroked", Stroked) + + XML::Write(Stroke) + + XML::Write(formulas) + + XML::Write(PathElement) + + XML::Write(TextPath) + + XML::Write(Handles) + + XML::Write(Lock) + + XML::Write(Complex) + ); + } + + } // namespace Logic +} // namespace OOX diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/ShapeType.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ShapeType.h new file mode 100644 index 0000000000..782feab45d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/ShapeType.h @@ -0,0 +1,54 @@ +#pragma once +#ifndef OOX_LOGIC_SPAPE_TYPE_INCLUDE_H_ +#define OOX_LOGIC_SPAPE_TYPE_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "property.h" +#include "nullable_property.h" +#include "./../Limit/TrueFalse.h" +#include "Stroke.h" +#include "Formulas.h" +#include "Lock.h" +#include "Path.h" +#include "Handles.h" +#include "Complex.h" +#include "textPath.h" + +namespace OOX +{ + namespace Logic + { + class ShapeType : public WritingElement + { + public: + ShapeType(); + virtual ~ShapeType(); + explicit ShapeType(const XML::XNode& node); + const ShapeType& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Id; + property coordsize; + property Spt; + property path; + nullable_property Stroke; + nullable_property formulas; + nullable_property Lock; + nullable_property PathElement; + nullable_property Handles; + nullable_property TextPath; + nullable_property adj; + nullable_property Filled; + nullable_property Stroked; + nullable_property Preferrelative; + nullable_property Complex; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_SPAPE_TYPE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Spacing.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Spacing.cpp new file mode 100644 index 0000000000..923dfa0590 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Spacing.cpp @@ -0,0 +1,92 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Spacing.h" + + +namespace OOX +{ + namespace Logic + { + + Spacing::Spacing() + { + } + + + Spacing::~Spacing() + { + } + + + Spacing::Spacing(const XML::XNode& node) + { + fromXML(node); + } + + + const Spacing& Spacing::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Spacing::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + if (element.attribute("after").exist()) + { + int after = element.attribute("after").value(); + After = UniversalUnit(after, UniversalUnit::Dx); + } + + if (element.attribute("before").exist()) + { + int before = element.attribute("before").value(); + Before = UniversalUnit(before, UniversalUnit::Dx); + } + + AfterLines = element.attribute("afterLines").value(); + BeforeLines = element.attribute("beforeLines").value(); + LineRule = element.attribute("lineRule").value(); + + if (element.attribute("line").exist()) + { + int line = element.attribute("line").value(); + Line = UniversalUnit(line, UniversalUnit::Dx); + } + + BeforeAutospacing = element.attribute("beforeAutospacing").value(); + AfterAutospacing = element.attribute("afterAutospacing").value(); + } + + + const XML::XNode Spacing::toXML() const + { + return + XML::XElement(ns.w + "spacing", + XML::XAttribute(ns.w + "after", After) + + XML::XAttribute(ns.w + "afterAutospacing", AfterAutospacing) + + XML::XAttribute(ns.w + "afterLines", AfterLines) + + XML::XAttribute(ns.w + "before", Before) + + XML::XAttribute(ns.w + "beforeAutospacing", BeforeAutospacing) + + XML::XAttribute(ns.w + "beforeLines", BeforeLines) + + XML::XAttribute(ns.w + "line", Line) + + XML::XAttribute(ns.w + "lineRule", LineRule) + ); + } + + + const bool Spacing::isSimple() const + { + return true; + //return (!After.is_init() && !Before.is_init() && !Line.is_init() && !AfterLines.is_init() && !BeforeLines.is_init() && !LineRule.is_init() + // && !BeforeAutospacing.is_init() && !AfterAutospacing.is_init()); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Spacing.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Spacing.h new file mode 100644 index 0000000000..625b4dd4d7 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Spacing.h @@ -0,0 +1,47 @@ +#pragma once +#ifndef OOX_LOGIC_SPACING_INCLUDE_H_ +#define OOX_LOGIC_SPACING_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "nullable_property.h" +#include "../Limit/LineRule.h" +#include "./../Unit.h" + +namespace OOX +{ + namespace Logic + { + class Spacing : public WritingElement + { + public: + Spacing(); + virtual ~Spacing(); + explicit Spacing(const XML::XNode& node); + const Spacing& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + const bool isSimple() const; + + public: + nullable_property After; + nullable_property Before; + nullable_property Line; + + nullable_property AfterLines; + nullable_property BeforeLines; + + nullable_property LineRule; + + nullable_property BeforeAutospacing; + nullable_property AfterAutospacing; + + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_SPACING_INCLUDE_H \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Stroke.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Stroke.cpp new file mode 100644 index 0000000000..67aebec74e --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Stroke.cpp @@ -0,0 +1,48 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Stroke.h" + +namespace OOX +{ + namespace Logic + { + Stroke::Stroke() + { + + } + + Stroke::~Stroke() + { + + } + + Stroke::Stroke(const XML::XNode& node) + { + fromXML(node); + } + + const Stroke& Stroke::operator = (const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void Stroke::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + Join = element.attribute("joinstyle").value(); + DashStyle = element.attribute("dashstyle").value(); + EndCap = element.attribute("endcap").value(); + } + + const XML::XNode Stroke::toXML() const + { + return XML::XElement(ns.v + "stroke", XML::XAttribute("joinstyle", Join) + XML::XAttribute("dashstyle", DashStyle) + XML::XAttribute("endcap", EndCap)); + } + + } // namespace Logic +} // namespace OOX diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Stroke.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Stroke.h new file mode 100644 index 0000000000..c1894cfe5b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Stroke.h @@ -0,0 +1,33 @@ +#pragma once +#ifndef OOX_LOGIC_STROKE_INCLUDE_H_ +#define OOX_LOGIC_STROKE_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "./../Limit/Join.h" + +namespace OOX +{ + namespace Logic + { + class Stroke : public WritingElement + { + public: + Stroke(); + virtual ~Stroke(); + explicit Stroke(const XML::XNode& node); + const Stroke& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Join; + nullable_property DashStyle; + nullable_property EndCap; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_STROKE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Symbol.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Symbol.cpp new file mode 100644 index 0000000000..bb3cfccdce --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Symbol.cpp @@ -0,0 +1,81 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Symbol.h" + + +namespace OOX +{ + namespace Logic + { + + Symbol::Symbol() + { + } + + + Symbol::~Symbol() + { + } + + + Symbol::Symbol(const std::string& text) + { + fromTxt(text); + } + + + Symbol::Symbol(const XML::XNode& node) + { + fromXML(node); + } + + + const Symbol& Symbol::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + const Symbol& Symbol::operator =(const std::string& text) + { + fromTxt(text); + return *this; + } + + + void Symbol::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Font = element.attribute("font").value(); + Char = element.attribute("char").value(); + } + + + void Symbol::fromTxt(const std::string& text) + { + //TODO + } + + + const XML::XNode Symbol::toXML() const + { + return + XML::XElement(ns.w + "sym", + XML::XAttribute(ns.w + "font", Font) + + XML::XAttribute(ns.w + "char", Char) + ); + } + + + const std::string Symbol::toTxt() const + { + //TODO + return ""; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Symbol.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Symbol.h new file mode 100644 index 0000000000..bfc809d11c --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Symbol.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef OOX_LOGIC_SYMBOL_INCLUDE_H_ +#define OOX_LOGIC_SYMBOL_INCLUDE_H_ + +#include "RunItemBase.h" + + +namespace OOX +{ + namespace Logic + { + class Symbol : public RunItemBase + { + public: + Symbol(); + virtual ~Symbol(); + explicit Symbol(const std::string& text); + explicit Symbol(const XML::XNode& node); + const Symbol& operator =(const XML::XNode& node); + const Symbol& operator =(const std::string& text); + + public: + virtual void fromXML(const XML::XNode& node); + virtual void fromTxt(const std::string& text); + virtual const XML::XNode toXML() const; + virtual const std::string toTxt() const; + + public: + nullable_property Font; + nullable_property Char; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_SYMBOL_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TCMar.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TCMar.cpp new file mode 100644 index 0000000000..5a2e11164c --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TCMar.cpp @@ -0,0 +1,54 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TCMar.h" + +namespace OOX +{ + namespace Logic + { + TCMar::TCMar() + { + + } + + TCMar::~TCMar() + { + + } + + TCMar::TCMar(const XML::XNode& node) + { + fromXML(node); + } + + const TCMar& TCMar::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void TCMar::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + Top = element.element("top"); + Left = element.element("left"); + Bottom = element.element("bottom"); + Right = element.element("right"); + } + + const XML::XNode TCMar::toXML() const + { + return + XML::XElement(ns.w + "tcMar", + XML::Write(Top) + + XML::Write(Left) + + XML::Write(Bottom) + + XML::Write(Right)); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TCMar.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TCMar.h new file mode 100644 index 0000000000..ef5cea2841 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TCMar.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef OOX_STYLES_TC_MAR_INCLUDE_H_ +#define OOX_STYLES_TC_MAR_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "nullable_property.h" +#include "TableCellMargin.h" + +namespace OOX +{ + namespace Logic + { + class TCMar : public WritingElement + { + public: + TCMar(); + virtual ~TCMar(); + explicit TCMar(const XML::XNode& node); + const TCMar& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property Top; + nullable_property Left; + nullable_property Bottom; + nullable_property Right; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_STYLES_TC_MAR_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Tab.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Tab.cpp new file mode 100644 index 0000000000..76bae0d718 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Tab.cpp @@ -0,0 +1,72 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Tab.h" + + +namespace OOX +{ + namespace Logic + { + + Tab::Tab() + { + } + + + Tab::~Tab() + { + } + + + Tab::Tab(const std::string& text) + { + fromTxt(text); + } + + + Tab::Tab(const XML::XNode& node) + { + fromXML(node); + } + + + const Tab& Tab::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + const Tab& Tab::operator =(const std::string& text) + { + fromTxt(text); + return *this; + } + + + void Tab::fromXML(const XML::XNode& node) + { + } + + + void Tab::fromTxt(const std::string& text) + { + } + + + const XML::XNode Tab::toXML() const + { + return XML::XElement(ns.w + "tab"); + } + + + const std::string Tab::toTxt() const + { + return "\t"; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Tab.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Tab.h new file mode 100644 index 0000000000..c4471b97db --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Tab.h @@ -0,0 +1,31 @@ +#pragma once +#ifndef OOX_LOGIC_TAB_INCLUDE_H_ +#define OOX_LOGIC_TAB_INCLUDE_H_ + +#include "RunItemBase.h" + + +namespace OOX +{ + namespace Logic + { + class Tab : public RunItemBase + { + public: + Tab(); + virtual ~Tab(); + explicit Tab(const std::string& text); + explicit Tab(const XML::XNode& node); + const Tab& operator =(const XML::XNode& node); + const Tab& operator =(const std::string& text); + + public: + virtual void fromXML(const XML::XNode& node); + virtual void fromTxt(const std::string& text); + virtual const XML::XNode toXML() const; + virtual const std::string toTxt() const; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_TAB_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TabProperty.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TabProperty.cpp new file mode 100644 index 0000000000..9b8b71ed51 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TabProperty.cpp @@ -0,0 +1,62 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TabProperty.h" + + +namespace OOX +{ + namespace Logic + { + + TabProperty::TabProperty() + { + } + + + TabProperty::~TabProperty() + { + } + + + TabProperty::TabProperty(const XML::XNode& node) + { + fromXML(node); + } + + + const TabProperty& TabProperty::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void TabProperty::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Val = element.attribute("val").value(); + Leader = element.attribute("leader").value(); + //Pos = element.attribute("pos").value().ToString(); + if (element.attribute("pos").exist()) + { + int pos = element.attribute("pos").value(); + UniversalUnit value(pos, UniversalUnit::Dx); + Pos = value; + } + } + + + const XML::XNode TabProperty::toXML() const + { + return + XML::XElement(ns.w + "tab", + XML::XAttribute(ns.w + "val", Val) + + XML::XAttribute(ns.w + "leader", Leader) + + XML::XAttribute(ns.w + "pos", Pos) + ); + } + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TabProperty.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TabProperty.h new file mode 100644 index 0000000000..8eb9ed959c --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TabProperty.h @@ -0,0 +1,36 @@ +#pragma once +#ifndef OOX_LOGIC_TAB_PROPERTY_INCLUDE_H_ +#define OOX_LOGIC_TAB_PROPERTY_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include "./../Limit/TabVal.h" +#include "./../Limit/Leader.h" +#include "./../Unit.h" + + +namespace OOX +{ + namespace Logic + { + class TabProperty : public WritingElement + { + public: + TabProperty(); + virtual ~TabProperty(); + explicit TabProperty(const XML::XNode& node); + const TabProperty& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Val; + nullable_property Leader; + property Pos; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_TAB_PROPERTY_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Table.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Table.cpp new file mode 100644 index 0000000000..5a5765975b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Table.cpp @@ -0,0 +1,72 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Table.h" + +namespace OOX +{ + namespace Logic + { + Table::Table() + { + + } + + Table::~Table() + { + + } + + Table::Table(const XML::XNode& node) + { + fromXML(node); + } + + const Table& Table::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void Table::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + tblPr = element.element("tblPr"); + tblGrid = element.element("tblGrid"); + + XML::Fill(Rows, element, "tr"); + SetCountsVMerged(); + } + + const XML::XNode Table::toXML() const + { + return XML::XElement(ns.w + "tbl", XML::Write(tblPr) + XML::Write(tblGrid) + XML::Write(Rows)); + } + + void Table::SetCountsVMerged() + { + for (size_t j = 0; j != Rows->size(); ++j) + { + for (size_t i = 0; i != Rows->at(j).Cells->size(); ++i) + { + if (Rows->at(j).Cells->at(i).isFirstFromVMerged()) + { + TableCell cell = Rows->at(j).Cells->at(i); + for (size_t k = j + 1; k != Rows->size(); ++k) + { + if (Rows->at(k).isCellByNumCol(cell.NumCol) && Rows->at(k).getCellByNumCol(cell.NumCol).isFromVMergedButNotFirst()) + ++(*cell.Properties->CountVMerge); + else + break; + } + Rows->at(j).Cells->at(i) = cell; + } + } + } + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Table.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Table.h new file mode 100644 index 0000000000..f59352d3c0 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Table.h @@ -0,0 +1,39 @@ +#pragma once +#ifndef OOX_LOGIC_TABLE_INCLUDE_H_ +#define OOX_LOGIC_TABLE_INCLUDE_H_ + +#include "TextItemBase.h" +#include "TableProperty.h" +#include "TableGrid.h" +#include "TableRow.h" + +namespace OOX +{ + namespace Logic + { + class Table : public TextItemBase + { + public: + Table(); + virtual ~Table(); + explicit Table(const XML::XNode& node); + const Table& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + void SetCountsVMerged(); + + public: + + property tblPr; + property tblGrid; + + property > Rows; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_TABLE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableBorders.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableBorders.cpp new file mode 100644 index 0000000000..2b45844006 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableBorders.cpp @@ -0,0 +1,57 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TableBorders.h" + +namespace OOX +{ + namespace Logic + { + TableBorders::TableBorders() + { + + } + + TableBorders::~TableBorders() + { + + } + + TableBorders::TableBorders(const XML::XNode& node) + { + fromXML(node); + } + + const TableBorders& TableBorders::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void TableBorders::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + top = element.element("top"); + bottom = element.element("bottom"); + left = element.element("left"); + right = element.element("right"); + insideV = element.element("insideV"); + insideH = element.element("insideH"); + } + + const XML::XNode TableBorders::toXML() const + { + return XML::XElement(ns.w + "tblBorders", + XML::Write(top) + + XML::Write(bottom) + + XML::Write(left) + + XML::Write(right) + + XML::Write(insideV) + + XML::Write(insideH)); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableBorders.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableBorders.h new file mode 100644 index 0000000000..907824dde3 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableBorders.h @@ -0,0 +1,151 @@ +#pragma once +#ifndef OOX_LOGIC_TABLE_BORDERS_INCLUDE_H_ +#define OOX_LOGIC_TABLE_BORDERS_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "Border.h" + +namespace OOX +{ + namespace Logic + { + class TableBorders : public WritingElement + { + public: + TableBorders(); + virtual ~TableBorders(); + explicit TableBorders(const XML::XNode& node); + const TableBorders& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + // + + inline bool GetBorder (int nInd, Border& oBorder) const + { + if (0 == nInd) + { + if (top.is_init()) + { + oBorder = top; + return true; + } + } + + if (1 == nInd) + { + if (bottom.is_init()) + { + oBorder = bottom; + return true; + } + } + + if (2 == nInd) + { + if (left.is_init()) + { + oBorder = left; + return true; + } + } + + if (3 == nInd) + { + if (right.is_init()) + { + oBorder = right; + return true; + } + } + + if (4 == nInd) + { + if (insideH.is_init()) + { + oBorder = insideH; + return true; + } + } + + if (5 == nInd) + { + if (insideV.is_init()) + { + oBorder = insideV; + return true; + } + } + + return false; + } + + inline bool ValidBorder (int nInd) const + { + if (0 == nInd) + { + if (top.is_init()) + return true; + + return false; + } + + if (1 == nInd) + { + if (bottom.is_init()) + return true; + + return false; + } + + if (2 == nInd) + { + if (left.is_init()) + return true; + + return false; + } + + if (3 == nInd) + { + if (right.is_init()) + return true; + + return false; + } + + if (4 == nInd) + { + if (insideH.is_init()) + return true; + + return false; + } + + if (5 == nInd) + { + if (insideV.is_init()) + return true; + + return false; + } + + return false; + } + + + public: + + nullable_property top; + nullable_property bottom; + nullable_property left; + nullable_property right; + nullable_property insideH; + nullable_property insideV; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_TABLE_BORDERS_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCell.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCell.cpp new file mode 100644 index 0000000000..d1a67b704b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCell.cpp @@ -0,0 +1,90 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TableCell.h" +#include + + +namespace OOX +{ + namespace Logic + { + + TableCell::TableCell() + { + } + + + TableCell::~TableCell() + { + } + + + TableCell::TableCell(const XML::XNode& node) + { + fromXML(node); + } + + + const TableCell& TableCell::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void TableCell::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Properties = element.element("tcPr"); + XML::Fill(Items, element , "p", "tbl"); + } + + + const XML::XNode TableCell::toXML() const + { + return + XML::XElement(ns.w + "tc", + XML::Write(Properties) + + XML::Write(Items) + + XML::WriteIf(XML::XElement(ns.w + "p"), !hasParagraph()) + ); + } + + + const bool TableCell::isFromHMerged() const + { + return Properties->GridSpan.is_init(); + } + + + const bool TableCell::isFromVMergedButNotFirst() const + { + if (Properties->VMerge.is_init()) + return !Properties->VMerge->Value.is_init(); + return false; + } + + + const bool TableCell::isFirstFromVMerged() const + { + if (Properties->VMerge.is_init()) + return Properties->VMerge->Value.is_init(); + return false; + } + + + const bool TableCell::hasParagraph() const + { + BOOST_FOREACH(const TextItem& item, *Items) + { + if (item.is()) + return true; + } + return false; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCell.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCell.h new file mode 100644 index 0000000000..c17b1a51a9 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCell.h @@ -0,0 +1,47 @@ +#pragma once +#ifndef OOX_LOGIC_TABLE_CELL_INCLUDE_H_ +#define OOX_LOGIC_TABLE_CELL_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "TableCellProperties.h" +#include "../Logic/Paragraph.h" +#include "property.h" +#include +#include "TextItem.h" + + +namespace OOX +{ + namespace Logic + { + class TableCell : public WritingElement + { + public: + TableCell(); + virtual ~TableCell(); + explicit TableCell(const XML::XNode& node); + const TableCell& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + const bool isFromHMerged() const; + const bool isFromVMergedButNotFirst() const; + const bool isFirstFromVMerged() const; + + public: + property NumCol; + + public: + property Properties; + property > Items; + + private: + const bool hasParagraph() const; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_TABLE_CELL_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellBorders.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellBorders.cpp new file mode 100644 index 0000000000..e63f340789 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellBorders.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TableCellBorders.h" + +namespace OOX +{ + namespace Logic + { + TableCellBorders::TableCellBorders() + { + + } + + TableCellBorders::~TableCellBorders() + { + + } + + TableCellBorders::TableCellBorders(const XML::XNode& node) + { + fromXML(node); + } + + const TableCellBorders& TableCellBorders::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void TableCellBorders::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + top = element.element("top"); + bottom = element.element("bottom"); + left = element.element("left"); + right = element.element("right"); + insideH = element.element("insideH"); + insideV = element.element("insideV"); + } + + const XML::XNode TableCellBorders::toXML() const + { + return XML::XElement(ns.w + "tcBorders", + XML::Write(top) + + XML::Write(bottom) + + XML::Write(left) + + XML::Write(right)); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellBorders.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellBorders.h new file mode 100644 index 0000000000..9971d4255a --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellBorders.h @@ -0,0 +1,151 @@ +#pragma once +#ifndef OOX_LOGIC_TABLE_CELL_BORDERS_INCLUDE_H_ +#define OOX_LOGIC_TABLE_CELL_BORDERS_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "Border.h" +#include "nullable_property.h" + +namespace OOX +{ + namespace Logic + { + class TableCellBorders : public WritingElement + { + public: + TableCellBorders(); + virtual ~TableCellBorders(); + explicit TableCellBorders(const XML::XNode& node); + const TableCellBorders& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + // + + inline bool GetBorder (int nInd, Border& oBorder) const + { + if (0 == nInd) + { + if (top.is_init()) + { + oBorder = top; + return true; + } + } + + if (1 == nInd) + { + if (bottom.is_init()) + { + oBorder = bottom; + return true; + } + } + + if (2 == nInd) + { + if (left.is_init()) + { + oBorder = left; + return true; + } + } + + if (3 == nInd) + { + if (right.is_init()) + { + oBorder = right; + return true; + } + } + + if (4 == nInd) + { + if (insideH.is_init()) + { + oBorder = insideH; + return true; + } + } + + if (5 == nInd) + { + if (insideV.is_init()) + { + oBorder = insideV; + return true; + } + } + + return false; + } + + inline bool ValidBorder (int nInd) const + { + if (0 == nInd) + { + if (top.is_init()) + return true; + + return false; + } + + if (1 == nInd) + { + if (bottom.is_init()) + return true; + + return false; + } + + if (2 == nInd) + { + if (left.is_init()) + return true; + + return false; + } + + if (3 == nInd) + { + if (right.is_init()) + return true; + + return false; + } + + if (4 == nInd) + { + if (insideH.is_init()) + return true; + + return false; + } + + if (5 == nInd) + { + if (insideV.is_init()) + return true; + + return false; + } + + return false; + } + + public: + + nullable_property top; + nullable_property bottom; + nullable_property left; + nullable_property right; + nullable_property insideH; + nullable_property insideV; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_TABLE_CELL_BORDERS_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellMar.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellMar.cpp new file mode 100644 index 0000000000..89d967c72d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellMar.cpp @@ -0,0 +1,59 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TableCellMar.h" + + +namespace OOX +{ + namespace Logic + { + + TableCellMar::TableCellMar() + { + } + + + TableCellMar::~TableCellMar() + { + } + + + TableCellMar::TableCellMar(const XML::XNode& node) + { + fromXML(node); + } + + + const TableCellMar& TableCellMar::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void TableCellMar::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Top = element.element("top"); + Left = element.element("left"); + Bottom = element.element("bottom"); + Right = element.element("right"); + } + + + const XML::XNode TableCellMar::toXML() const + { + return + XML::XElement(ns.w + "tblCellMar", + XML::Write(Top) + + XML::Write(Left) + + XML::Write(Bottom) + + XML::Write(Right) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellMar.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellMar.h new file mode 100644 index 0000000000..b428f9d970 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellMar.h @@ -0,0 +1,34 @@ +#pragma once +#ifndef OOX_STYLES_TABLE_CELL_MAR_INCLUDE_H_ +#define OOX_STYLES_TABLE_CELL_MAR_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "nullable_property.h" +#include "TableCellMargin.h" + +namespace OOX +{ + namespace Logic + { + class TableCellMar : public WritingElement + { + public: + TableCellMar(); + virtual ~TableCellMar(); + explicit TableCellMar(const XML::XNode& node); + const TableCellMar& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property Top; + nullable_property Left; + nullable_property Bottom; + nullable_property Right; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_STYLES_TABLE_CELL_MAR_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellMargin.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellMargin.cpp new file mode 100644 index 0000000000..30ec835f99 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellMargin.cpp @@ -0,0 +1,63 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TableCellMargin.h" + + +namespace OOX +{ + namespace Logic + { + + TableCellMargin::TableCellMargin() + { + } + + + TableCellMargin::~TableCellMargin() + { + } + + + TableCellMargin::TableCellMargin(const XML::XNode& node) + { + fromXML(node); + } + + + TableCellMargin::TableCellMargin(const std::string& name, const CellMarginItem& margin) + : Name(name), + Margin(margin) + { + } + + + const TableCellMargin& TableCellMargin::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void TableCellMargin::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Name = element.XName->Name; + Margin->W = element.attribute("w").value(); + Margin->Type = element.attribute("type").value(); + } + + + const XML::XNode TableCellMargin::toXML() const + { + return + XML::XElement(ns.w + Name.ToString(), + XML::XAttribute(ns.w + "w", Margin->W) + + XML::XAttribute(ns.w + "type", Margin->Type) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellMargin.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellMargin.h new file mode 100644 index 0000000000..dd510c0d65 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellMargin.h @@ -0,0 +1,33 @@ +#pragma once +#ifndef OOX_LOGIC_TABLE_CELL_MARGIN_INCLUDE_H_ +#define OOX_LOGIC_TABLE_CELL_MARGIN_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "CellMarginItem.h" +#include "property.h" + +namespace OOX +{ + namespace Logic + { + class TableCellMargin : public WritingElement + { + public: + TableCellMargin(); + virtual ~TableCellMargin(); + explicit TableCellMargin(const XML::XNode& node); + TableCellMargin(const std::string& name, const CellMarginItem& margin); + const TableCellMargin& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Name; + property Margin; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_TABLE_CELL_MARGIN_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellProperties.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellProperties.cpp new file mode 100644 index 0000000000..1d917f7bca --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellProperties.cpp @@ -0,0 +1,62 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TableCellProperties.h" + +namespace OOX +{ + namespace Logic + { + TableCellProperties::TableCellProperties() + { + + } + + TableCellProperties::~TableCellProperties() + { + + } + + TableCellProperties::TableCellProperties(const XML::XNode& node) + { + fromXML(node); + } + + const TableCellProperties& TableCellProperties::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void TableCellProperties::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + Width = element.element("tcW"); + tblBorders = element.element("tcBorders"); + VMerge = element.element("vMerge"); + Shading = element.element("shd"); + Background = element.element("shd").attribute("fill").value(); + GridSpan = element.element("gridSpan").attribute("val").value(); + CellMar = element.element("tcMar"); + VAlign = element.element("vAlign").attribute("val").value(); + CountVMerge = 1; // TODO ??? + } + + const XML::XNode TableCellProperties::toXML() const + { + return XML::XElement(ns.w + "tcPr", + XML::Write(Width) + + XML::Write(tblBorders) + + XML::Write(CellMar) + + XML::Write(VMerge) + + //XML::Write(ns.w + "shd", ns.w + "fill", Background) + + XML::Write(Shading) + + XML::Write(ns.w + "gridSpan", ns.w + "val", GridSpan) + + XML::Write(ns.w + "vAlign", ns.w + "val", VAlign)); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellProperties.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellProperties.h new file mode 100644 index 0000000000..553b6fe000 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellProperties.h @@ -0,0 +1,45 @@ +#pragma once +#ifndef OOX_LOGIC_TABLE_CELL_PROPERTIES_INCLUDE_H_ +#define OOX_LOGIC_TABLE_CELL_PROPERTIES_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "TableCellWidth.h" +#include "TableCellBorders.h" +#include "Color.h" +#include "property.h" +#include "VMerge.h" +#include "TCMar.h" +#include "Shading.h" +#include "./../Limit/VerticalAlign.h" + +namespace OOX +{ + namespace Logic + { + class TableCellProperties : public WritingElement + { + public: + TableCellProperties(); + virtual ~TableCellProperties(); + explicit TableCellProperties(const XML::XNode& node); + const TableCellProperties& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Width; + nullable_property tblBorders; + nullable_property Background; + nullable_property Shading; //TODO: Read only now + nullable_property VMerge; + nullable_property GridSpan; + property CountVMerge; + nullable_property CellMar; + nullable_property VAlign; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_TABLE_CELL_PROPERTIES_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellWidth.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellWidth.cpp new file mode 100644 index 0000000000..16211dd8fa --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellWidth.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TableCellWidth.h" + + +namespace OOX +{ + namespace Logic + { + + TableCellWidth::TableCellWidth() + { + } + + + TableCellWidth::~TableCellWidth() + { + } + + + TableCellWidth::TableCellWidth(const XML::XNode& node) + { + fromXML(node); + } + + + const TableCellWidth& TableCellWidth::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void TableCellWidth::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Width = element.attribute("w").value().ToString(); + Type = element.attribute("type").value(); + } + + + const XML::XNode TableCellWidth::toXML() const + { + return + XML::XElement(ns.w + "tcW", + XML::XAttribute(ns.w + "w", Width) + + XML::XAttribute(ns.w + "type", Type) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellWidth.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellWidth.h new file mode 100644 index 0000000000..2d0bbc6b14 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableCellWidth.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef OOX_LOGIC_TABLE_CELL_WIDTH_INCLUDE_H_ +#define OOX_LOGIC_TABLE_CELL_WIDTH_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "property.h" +#include "./../Unit.h" +#include "./../Limit/TableCellWidthType.h" + + +namespace OOX +{ + namespace Logic + { + class TableCellWidth : public WritingElement + { + public: + TableCellWidth(); + virtual ~TableCellWidth(); + explicit TableCellWidth(const XML::XNode& node); + const TableCellWidth& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Width; + property Type; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_TABLE_CELL_WIDTH_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableGrid.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableGrid.cpp new file mode 100644 index 0000000000..e3d61f5a75 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableGrid.cpp @@ -0,0 +1,45 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TableGrid.h" + +namespace OOX +{ + namespace Logic + { + TableGrid::TableGrid() + { + + } + + TableGrid::~TableGrid() + { + + } + + TableGrid::TableGrid(const XML::XNode& node) + { + fromXML(node); + } + + const TableGrid& TableGrid::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void TableGrid::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + XML::Fill(Columns, element); + } + + const XML::XNode TableGrid::toXML() const + { + return XML::XElement(ns.w + "tblGrid", XML::Write(Columns)); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableGrid.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableGrid.h new file mode 100644 index 0000000000..cf375de80c --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableGrid.h @@ -0,0 +1,32 @@ +#pragma once +#ifndef OOX_LOGIC_TABLE_GRID_INCLUDE_H_ +#define OOX_LOGIC_TABLE_GRID_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "property.h" +#include "GridColumn.h" + +namespace OOX +{ + namespace Logic + { + class TableGrid : public WritingElement + { + public: + TableGrid(); + virtual ~TableGrid(); + explicit TableGrid(const XML::XNode& node); + const TableGrid& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property > Columns; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_TABLE_GRID_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableInd.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableInd.cpp new file mode 100644 index 0000000000..40f27e54e7 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableInd.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TableInd.h" + + +namespace OOX +{ + namespace Logic + { + + TableInd::TableInd() + { + } + + + TableInd::~TableInd() + { + } + + + TableInd::TableInd(const XML::XNode& node) + { + fromXML(node); + } + + + const TableInd& TableInd::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void TableInd::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Width = element.attribute("w").value(); + Type = element.attribute("type").value(); + } + + + const XML::XNode TableInd::toXML() const + { + return + XML::XElement(ns.w + "tblInd", + XML::XAttribute(ns.w + "w", Width) + + XML::XAttribute(ns.w + "type", Type) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableInd.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableInd.h new file mode 100644 index 0000000000..e763b3ee1b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableInd.h @@ -0,0 +1,33 @@ +#pragma once +#ifndef OOX_LOGIC_TABLE_IND_INCLUDE_H_ +#define OOX_LOGIC_TABLE_IND_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "property.h" + + +namespace OOX +{ + namespace Logic + { + class TableInd : public WritingElement + { + public: + TableInd(); + virtual ~TableInd(); + explicit TableInd(const XML::XNode& node); + const TableInd& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Width; + property Type; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_STYLES_TABLE_IND_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableProperty.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableProperty.cpp new file mode 100644 index 0000000000..f3eee05ecf --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableProperty.cpp @@ -0,0 +1,100 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TableProperty.h" + +namespace OOX +{ + namespace Logic + { + TableProperty::TableProperty() + { + tblStyleRowBandSize = 1; + tblStyleColBandSize = 1; + + firstRow = 0; + lastRow = 0; + firstColumn = 0; + lastColumn = 0; + noHBand = 0; + noVBand = 0; + } + + TableProperty::~TableProperty() + { + + } + + TableProperty::TableProperty(const XML::XNode& node) + { + fromXML(node); + } + + const TableProperty& TableProperty::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void TableProperty::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + Style = element.element("tblStyle").attribute("val").value(); + Width = element.element("tblW"); + Look = element.element("tblLook").attribute("val").value(); + Ind = element.element("tblInd"); + CellMar = element.element("tblCellMar"); + tblBorders = element.element("tblBorders"); + Layout = element.element("tblLayout").attribute("type").value(); + + if (element.element("tblStyleRowBandSize").exist()) + tblStyleRowBandSize = element.element("tblStyleRowBandSize").attribute("val").value().ToInt(); + if (element.element("tblStyleColBandSize").exist()) + tblStyleColBandSize = element.element("tblStyleColBandSize").attribute("val").value().ToInt(); + + if (element.element("tblLook").exist()) + { + firstRow = element.element("tblLook").attribute("firstRow").value().ToInt(); + lastRow = element.element("tblLook").attribute("lastRow").value().ToInt(); + firstColumn = element.element("tblLook").attribute("firstColumn").value().ToInt(); + lastColumn = element.element("tblLook").attribute("lastColumn").value().ToInt(); + noHBand = element.element("tblLook").attribute("noHBand").value().ToInt(); + noVBand = element.element("tblLook").attribute("noVBand").value().ToInt(); + + if (element.element("tblLook").attribute("val").exist()) + { + std::string str = element.element("tblLook").attribute("val").value().ToString(); + + int nVal = 0; + if (str.length()) + { + nVal = HexString2Int (str); + } + + firstRow = (0 != (nVal & 0x0020)); + lastRow = (0 != (nVal & 0x0040)); + firstColumn = (0 != (nVal & 0x0080)); + lastColumn = (0 != (nVal & 0x0100)); + noHBand = (0 != (nVal & 0x0200)); + noVBand = (0 != (nVal & 0x0400)); + } + } + } + + const XML::XNode TableProperty::toXML() const + { + return XML::XElement(ns.w + "tblPr", + XML::Write(ns.w + "tblStyle", ns.w + "val", Style) + + XML::Write(Width) + + XML::Write(ns.w + "tblLayout", ns.w + "type", Layout) + + XML::Write(ns.w + "tblLook", ns.w + "val", Look) + + XML::Write(Ind) + + XML::Write(CellMar) + + XML::Write(tblBorders)); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableProperty.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableProperty.h new file mode 100644 index 0000000000..00c3646bb6 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableProperty.h @@ -0,0 +1,52 @@ +#pragma once +#ifndef OOX_LOGIC_TABLE_PROPERTY_INCLUDE_H_ +#define OOX_LOGIC_TABLE_PROPERTY_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "TableWidth.h" +#include "TableBorders.h" +#include "TableInd.h" +#include "TableCellMar.h" +#include "nullable_property.h" + +namespace OOX +{ + namespace Logic + { + class TableProperty : public WritingElement + { + public: + TableProperty(); + virtual ~TableProperty(); + explicit TableProperty(const XML::XNode& node); + const TableProperty& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + + nullable_property Style; + nullable_property Width; + nullable_property Look; + nullable_property Ind; + nullable_property CellMar; + nullable_property Layout; + + nullable_property tblBorders; + + int tblStyleRowBandSize; + int tblStyleColBandSize; + + int firstRow; + int lastRow; + int firstColumn; + int lastColumn; + int noHBand; + int noVBand; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_TABLE_PROPERTY_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableRow.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableRow.cpp new file mode 100644 index 0000000000..a6fa489d8d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableRow.cpp @@ -0,0 +1,104 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TableRow.h" +#include "Exception/log_runtime_error.h" + +namespace OOX +{ + namespace Logic + { + TableRow::TableRow() + { + + } + + TableRow::~TableRow() + { + + } + + TableRow::TableRow(const XML::XNode& node) + { + fromXML(node); + } + + const TableRow& TableRow::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void TableRow::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + Properties = element.element("trPr"); + int numCol = 0; + for (XML::const_element_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + XML::XElement element(*i); + if (element.XName == "tc") + { + TableCell cell(*i); + cell.NumCol = numCol; + Cells->push_back(cell); + + int count = cell.Properties->GridSpan.get_value_or(1); + + // TODO, óáðàòü öèêë, ïîñòàâèòü âìåñòî àðèôìåòè÷åñêîå äåéñòâèå + while(count-- > 0) + numCol++; + } + else if (element.XName == "sdt") + { + if(element.element("sdtContent").exist()) + { + if(element.element("sdtContent").element("tc").exist()) + { + //TableCell cell(*i); + TableCell cell(element.element("sdtContent").element("tc")); + cell.NumCol = numCol; + Cells->push_back(cell); + + int count = cell.Properties->GridSpan.get_value_or(1); + + // TODO, óáðàòü öèêë, ïîñòàâèòü âìåñòî àðèôìåòè÷åñêîå äåéñòâèå + while(count-- > 0) + numCol++; + } + } + } + } + } + + const XML::XNode TableRow::toXML() const + { + return XML::XElement(ns.w + "tr", XML::Write(Properties) + XML::Write(Cells)); + } + + const TableCell TableRow::getCellByNumCol(const int num) const + { + BOOST_FOREACH(const TableCell& cell, *Cells) + { + if (cell.NumCol == num) + return cell; + } + throw log_runtime_error("bad num column"); + } + + const bool TableRow::isCellByNumCol(const int num) const + { + BOOST_FOREACH(const TableCell& cell, *Cells) + { + if (cell.NumCol == num) + return true; + } + + return false; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableRow.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableRow.h new file mode 100644 index 0000000000..752c756a3e --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableRow.h @@ -0,0 +1,40 @@ +#pragma once +#ifndef OOX_LOGIC_TABLE_ROW_INCLUDE_H_ +#define OOX_LOGIC_TABLE_ROW_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include +#include "property.h" +#include "TableCell.h" +#include "TableRowProperties.h" + + +namespace OOX +{ + namespace Logic + { + class TableRow : public WritingElement + { + public: + TableRow(); + virtual ~TableRow(); + explicit TableRow(const XML::XNode& node); + const TableRow& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + const TableCell getCellByNumCol(const int num) const; + const bool isCellByNumCol(const int num) const; + + public: + property > Cells; + nullable_property Properties; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_TABLE_ROW_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableRowHeight.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableRowHeight.cpp new file mode 100644 index 0000000000..7185e9a81f --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableRowHeight.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TableRowHeight.h" + + +namespace OOX +{ + namespace Logic + { + + TableRowHeight::TableRowHeight() + { + } + + + TableRowHeight::~TableRowHeight() + { + } + + + TableRowHeight::TableRowHeight(const XML::XNode& node) + { + fromXML(node); + } + + + const TableRowHeight& TableRowHeight::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void TableRowHeight::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Height = element.attribute("val").value().ToString(); + Type = element.attribute("hRule").value(); + } + + + const XML::XNode TableRowHeight::toXML() const + { + return + XML::XElement(ns.w + "trHeight", + XML::XAttribute(ns.w + "val", Height) + + XML::XAttribute(ns.w + "hRule", Type) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableRowHeight.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableRowHeight.h new file mode 100644 index 0000000000..de50752635 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableRowHeight.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef OOX_LOGIC_TABLE_ROW_HEIGHT_INCLUDE_H_ +#define OOX_LOGIC_TABLE_ROW_HEIGHT_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "property.h" +#include "./../Unit.h" +#include "./../Limit/TableRowHeightRule.h" + + +namespace OOX +{ + namespace Logic + { + class TableRowHeight : public WritingElement + { + public: + TableRowHeight(); + virtual ~TableRowHeight(); + explicit TableRowHeight(const XML::XNode& node); + const TableRowHeight& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Height; + nullable_property Type; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_TABLE_ROW_HEIGHT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableRowProperties.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableRowProperties.cpp new file mode 100644 index 0000000000..3269218098 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableRowProperties.cpp @@ -0,0 +1,54 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TableRowProperties.h" + + +namespace OOX +{ + namespace Logic + { + + TableRowProperties::TableRowProperties() + { + } + + + TableRowProperties::~TableRowProperties() + { + } + + + TableRowProperties::TableRowProperties(const XML::XNode& node) + { + fromXML(node); + } + + + const TableRowProperties& TableRowProperties::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void TableRowProperties::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Height = element.element("trHeight"); + + } + + + const XML::XNode TableRowProperties::toXML() const + { + return + XML::XElement(ns.w + "trPr", + XML::Write(Height) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableRowProperties.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableRowProperties.h new file mode 100644 index 0000000000..27f66ac32d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableRowProperties.h @@ -0,0 +1,32 @@ +#pragma once +#ifndef OOX_LOGIC_TABLE_ROW_PROPERTIES_INCLUDE_H_ +#define OOX_LOGIC_TABLE_ROW_PROPERTIES_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include "TableRowHeight.h" + + +namespace OOX +{ + namespace Logic + { + class TableRowProperties : public WritingElement + { + public: + TableRowProperties(); + virtual ~TableRowProperties(); + explicit TableRowProperties(const XML::XNode& node); + const TableRowProperties& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Height; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_TABLE_ROW_PROPERTIES_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableStyle.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableStyle.cpp new file mode 100644 index 0000000000..80567bde1b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableStyle.cpp @@ -0,0 +1,69 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TableStyle.h" +#include +#include + +namespace OOX +{ + namespace Logic + { + TableStyle::TableStyle() + { + + } + + TableStyle::~TableStyle() + { + + } + + TableStyle::TableStyle(const XML::XNode& node) + { + fromXML(node); + } + + const TableStyle& TableStyle::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void TableStyle::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + XML::Fill(m_items, element, "tblStylePr"); + } + + const bool TableStyle::exist(const std::string& type) const + { + return std::find_if(begin(), end(), boost::bind(&TableStyleProperties::Type, _1) == type) != end(); + } + + const TableStyleProperties& TableStyle::operator[](const std::string& type) const + { + return find(type); + } + + TableStyleProperties& TableStyle::operator[](const std::string& type) + { + return find(type); + } + + const TableStyleProperties& TableStyle::find(const std::string& type) const + { + return *Odt::find_if(begin(), end(), boost::bind(&TableStyleProperties::Type, _1) == type); + //return *std::find_if(begin(), end(), boost::bind(&TableStyleProperties::Type, _1) == type); + } + + TableStyleProperties& TableStyle::find(const std::string& type) + { + return *Odt::find_if(begin(), end(), boost::bind(&TableStyleProperties::Type, _1) == type); + //return *std::find_if(begin(), end(), boost::bind(&TableStyleProperties::Type, _1) == type); + } + }//namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableStyle.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableStyle.h new file mode 100644 index 0000000000..54921e4f57 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableStyle.h @@ -0,0 +1,34 @@ +#pragma once +#ifndef OOX_LOGIC_TABLE_STYLE_INCLUDE_H_ +#define OOX_LOGIC_TABLE_STYLE_INCLUDE_H_ + +#include "./../WritingVector.h" +#include "TableStyleProperties.h" + +namespace OOX +{ + namespace Logic + { + class TableStyle : public OOX::WritingVector + { + public: + TableStyle(); + virtual ~TableStyle(); + explicit TableStyle(const XML::XNode& node); + const TableStyle& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + + public: + const bool exist(const std::string& type) const; + const TableStyleProperties& operator[](const std::string& type) const; + TableStyleProperties& operator[](const std::string& type); + + const TableStyleProperties& find(const std::string& type) const; + TableStyleProperties& find(const std::string& type); + }; + }//namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_TABLE_STYLE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableStyleProperties.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableStyleProperties.cpp new file mode 100644 index 0000000000..b8663cc574 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableStyleProperties.cpp @@ -0,0 +1,57 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TableStyleProperties.h" + +namespace OOX +{ + namespace Logic + { + TableStyleProperties::TableStyleProperties() + { + + } + + TableStyleProperties::~TableStyleProperties() + { + + } + + TableStyleProperties::TableStyleProperties(const XML::XNode& node) + { + fromXML(node); + } + + const TableStyleProperties& TableStyleProperties::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void TableStyleProperties::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + Type = element.attribute("type").value(); + ParagraphProperty = element.element("pPr"); + RunProperty = element.element("rPr"); + TableProperty = element.element("tblPr"); + TableRowProperties = element.element("trPr"); + tcPr = element.element("tcPr"); + } + + const XML::XNode TableStyleProperties::toXML() const + { + return XML::XElement(ns.w + "tblStylePr", + XML::XAttribute(ns.w + "type", Type) + + XML::Write(ParagraphProperty) + + XML::Write(RunProperty) + + XML::Write(TableProperty) + + XML::Write(TableRowProperties) + + XML::Write(tcPr)); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableStyleProperties.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableStyleProperties.h new file mode 100644 index 0000000000..5db8737b45 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableStyleProperties.h @@ -0,0 +1,41 @@ +#pragma once +#ifndef OOX_LOGIC_TABLE_STYLE_PROPERTIES_INCLUDE_H_ +#define OOX_LOGIC_TABLE_STYLE_PROPERTIES_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "nullable_property.h" +#include "ParagraphProperty.h" +#include "RunProperty.h" +#include "TableProperty.h" +#include "TableRowProperties.h" +#include "TableCellProperties.h" +#include "../Limit/TableStyleType.h" + +namespace OOX +{ + namespace Logic + { + class TableStyleProperties : public WritingElement + { + public: + TableStyleProperties(); + virtual ~TableStyleProperties(); + explicit TableStyleProperties(const XML::XNode& node); + const TableStyleProperties& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Type; + nullable_property ParagraphProperty; + nullable_property RunProperty; + nullable_property TableProperty; + nullable_property TableRowProperties; + nullable_property tcPr; // cell properties + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_TABLE_STYLE_PROPERTIES_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableWidth.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableWidth.cpp new file mode 100644 index 0000000000..fb029ec1ed --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableWidth.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TableWidth.h" + + +namespace OOX +{ + namespace Logic + { + + TableWidth::TableWidth() + { + } + + + TableWidth::~TableWidth() + { + } + + + TableWidth::TableWidth(const XML::XNode& node) + { + fromXML(node); + } + + + const TableWidth& TableWidth::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void TableWidth::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Width = element.attribute("w").value().ToString(); + Type = element.attribute("type").value(); + } + + + const XML::XNode TableWidth::toXML() const + { + return + XML::XElement(ns.w + "tblW", + XML::XAttribute(ns.w + "w", Width) + + XML::XAttribute(ns.w + "type", Type) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableWidth.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableWidth.h new file mode 100644 index 0000000000..b4ede8e5b5 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TableWidth.h @@ -0,0 +1,33 @@ +#pragma once +#ifndef OOX_LOGIC_TABLE_WIDTH_INCLUDE_H_ +#define OOX_LOGIC_TABLE_WIDTH_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include "./../Limit/TableWidthType.h" +#include "./../Unit.h" + +namespace OOX +{ + namespace Logic + { + class TableWidth : public WritingElement + { + public: + TableWidth(); + virtual ~TableWidth(); + explicit TableWidth(const XML::XNode& node); + const TableWidth& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Width; + property Type; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_TABLE_WIDTH_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TabsProperty.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TabsProperty.cpp new file mode 100644 index 0000000000..d58e570109 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TabsProperty.cpp @@ -0,0 +1,53 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TabsProperty.h" + + +namespace OOX +{ + namespace Logic + { + + TabsProperty::TabsProperty() + { + } + + + TabsProperty::~TabsProperty() + { + } + + + TabsProperty::TabsProperty(const XML::XNode& node) + { + fromXML(node); + } + + + const TabsProperty& TabsProperty::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void TabsProperty::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Fill(Tabs, element, "tab"); + } + + + const XML::XNode TabsProperty::toXML() const + { + return + XML::XElement(ns.w + "tabs", + XML::Write(Tabs) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TabsProperty.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TabsProperty.h new file mode 100644 index 0000000000..a99a12fa19 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TabsProperty.h @@ -0,0 +1,33 @@ +#pragma once +#ifndef OOX_LOGIC_TABS_PROPERTY_INCLUDE_H_ +#define OOX_LOGIC_TABS_PROPERTY_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include "TabProperty.h" +#include + + +namespace OOX +{ + namespace Logic + { + class TabsProperty : public WritingElement + { + public: + TabsProperty(); + virtual ~TabsProperty(); + explicit TabsProperty(const XML::XNode& node); + const TabsProperty& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property > Tabs; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_TABS_PROPERTY_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Text.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Text.cpp new file mode 100644 index 0000000000..d97d62f1a3 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Text.cpp @@ -0,0 +1,77 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Text.h" + + +namespace OOX +{ + namespace Logic + { + + Text::Text() + { + } + + + Text::~Text() + { + } + + + Text::Text(const std::string& text) + { + fromTxt(text); + } + + + Text::Text(const XML::XNode& node) + { + fromXML(node); + } + + + const Text& Text::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + const Text& Text::operator =(const std::string& text) + { + fromTxt(text); + return *this; + } + + + void Text::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_text = element.text(); + } + + + void Text::fromTxt(const std::string& text) + { + m_text = text; + } + + + const XML::XNode Text::toXML() const + { + XML::XElement element = XML::XElement(ns.w + "t", XML::XText(m_text)); + element.Space = true; + return element; + } + + + const std::string Text::toTxt() const + { + return m_text; + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Text.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Text.h new file mode 100644 index 0000000000..c05098c54b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Text.h @@ -0,0 +1,34 @@ +#pragma once +#ifndef OOX_LOGIC_TEXT_INCLUDE_H_ +#define OOX_LOGIC_TEXT_INCLUDE_H_ + +#include "RunItemBase.h" + + +namespace OOX +{ + namespace Logic + { + class Text : public RunItemBase + { + public: + Text(); + virtual ~Text(); + explicit Text(const std::string& text); + explicit Text(const XML::XNode& node); + const Text& operator =(const XML::XNode& node); + const Text& operator =(const std::string& text); + + public: + virtual void fromXML(const XML::XNode& node); + virtual void fromTxt(const std::string& text); + virtual const XML::XNode toXML() const; + virtual const std::string toTxt() const; + + private: + std::string m_text; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_TEXT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextBox.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextBox.cpp new file mode 100644 index 0000000000..77a5871235 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextBox.cpp @@ -0,0 +1,47 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TextBox.h" + +namespace OOX +{ + namespace Logic + { + TextBox::TextBox() + { + + } + + TextBox::~TextBox() + { + + } + + TextBox::TextBox(const XML::XNode& node) + { + fromXML(node); + } + + const TextBox& TextBox::operator = (const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void TextBox::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + content = element.element("txbxContent"); + style = element.attribute("style").value(); + inset = element.attribute("inset").value(); + } + + const XML::XNode TextBox::toXML() const + { + return XML::XElement(ns.v + "textbox", XML::XAttribute("style", style) + XML::XAttribute("inset", inset) + XML::Write(content)); + } + } // namespace Logic +} // namespace OOX diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextBox.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextBox.h new file mode 100644 index 0000000000..53ec769998 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextBox.h @@ -0,0 +1,33 @@ +#pragma once +#ifndef OOX_LOGIC_TEXT_BOX_INCLUDE_H_ +#define OOX_LOGIC_TEXT_BOX_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include "TextBoxContent.h" + +namespace OOX +{ + namespace Logic + { + class TextBox : public WritingElement + { + public: + TextBox(); + virtual ~TextBox(); + explicit TextBox(const XML::XNode& node); + const TextBox& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property content; + nullable_property style; + nullable_property inset; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_TEXT_BOX_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextBoxContent.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextBoxContent.cpp new file mode 100644 index 0000000000..7cd59a4621 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextBoxContent.cpp @@ -0,0 +1,53 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TextBoxContent.h" + +namespace OOX +{ + namespace Logic + { + TextBoxContent::TextBoxContent() + { + + } + + TextBoxContent::~TextBoxContent() + { + + } + + TextBoxContent::TextBoxContent(const XML::XNode& node) + { + fromXML(node); + } + + const TextBoxContent& TextBoxContent::operator = (const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void TextBoxContent::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + for (XML::const_element_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + const XML::XElement element(*i); + if (element.XName == "p" || element.XName == "tbl" || element.XName == "sdt" || element.XName == "bookmarkStart" || element.XName == "bookmarkEnd") + { + Logic::TextItem text(*i); + items->push_back(text); + } + } + } + + const XML::XNode TextBoxContent::toXML() const + { + return XML::XElement(ns.w + "txbxContent", XML::Write(items)); + } + + } // namespace Logic +} // namespace OOX diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextBoxContent.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextBoxContent.h new file mode 100644 index 0000000000..5da0faa661 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextBoxContent.h @@ -0,0 +1,32 @@ +#pragma once +#ifndef OOX_LOGIC_TEXT_BOX_CONTENT_INCLUDE_H_ +#define OOX_LOGIC_TEXT_BOX_CONTENT_INCLUDE_H_ + +#include +#include "./../WritingElement.h" +#include "property.h" +#include "TextItem.h" + +namespace OOX +{ + namespace Logic + { + class TextBoxContent : public WritingElement + { + public: + TextBoxContent(); + virtual ~TextBoxContent(); + explicit TextBoxContent(const XML::XNode& node); + const TextBoxContent& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property > items; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_TEXT_BOX_CONTENT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextFrameProperties.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextFrameProperties.cpp new file mode 100644 index 0000000000..1f24f27139 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextFrameProperties.cpp @@ -0,0 +1,95 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TextFrameProperties.h" + + +namespace OOX +{ + namespace Logic + { + + TextFrameProperties::TextFrameProperties() + { + } + + + TextFrameProperties::~TextFrameProperties() + { + } + + + TextFrameProperties::TextFrameProperties(const XML::XNode& node) + { + fromXML(node); + } + + + const TextFrameProperties& TextFrameProperties::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void TextFrameProperties::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + HAnchor = element.attribute("hAnchor").value(); + VAnchor = element.attribute("vAnchor").value(); + Wrap = element.attribute("wrap").value(); + if (element.attribute("x").exist()) + { + int x = element.attribute("x").value(); + X = UniversalUnit(x, UniversalUnit::Dx); + } + if (element.attribute("y").exist()) + { + int y = element.attribute("y").value(); + Y = UniversalUnit(y, UniversalUnit::Dx); + } + if (element.attribute("h").exist()) + { + int h = element.attribute("h").value(); + H = UniversalUnit(h, UniversalUnit::Dx); + } + if (element.attribute("w").exist()) + { + int w = element.attribute("w").value(); + W = UniversalUnit(w, UniversalUnit::Dx); + } + if (element.attribute("hSpace").exist()) + { + int hSpace = element.attribute("hSpace").value(); + HSpace = UniversalUnit(hSpace, UniversalUnit::Dx); + } + if (element.attribute("vSpace").exist()) + { + int vSpace = element.attribute("vSpace").value(); + VSpace = UniversalUnit(vSpace, UniversalUnit::Dx); + } + Lines = element.attribute("lines").value(); + DropCap = element.attribute("dropCap").value(); + } + + + const XML::XNode TextFrameProperties::toXML() const + { + return + XML::XElement(ns.w + "framePr", + XML::XAttribute(ns.w + "hAnchor", HAnchor) + + XML::XAttribute(ns.w + "vAnchor", VAnchor) + + XML::XAttribute(ns.w + "wrap", Wrap) + + XML::XAttribute(ns.w + "x", X) + + XML::XAttribute(ns.w + "y", Y) + + XML::XAttribute(ns.w + "h", H) + + XML::XAttribute(ns.w + "w", W) + + XML::XAttribute(ns.w + "hSpace", HSpace) + + XML::XAttribute(ns.w + "vSpace", VSpace) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextFrameProperties.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextFrameProperties.h new file mode 100644 index 0000000000..06a41da3c8 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextFrameProperties.h @@ -0,0 +1,47 @@ +#ifndef OOX_LOGIC_TEXT_FRAME_PROPERTIES_INCLUDE_H_ +#define OOX_LOGIC_TEXT_FRAME_PROPERTIES_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include "nullable_property.h" +#include "./../Unit.h" +#include "./../Limit/HorizontalAnchorLocation.h" +#include "./../Limit/VerticalAnchorLocation.h" +#include "./../Limit/TextFrameType.h" +#include "./../Limit/DropCap.h" + + + +namespace OOX +{ + namespace Logic + { + class TextFrameProperties : public WritingElement + { + public: + TextFrameProperties(); + virtual ~TextFrameProperties(); + explicit TextFrameProperties(const XML::XNode& node); + const TextFrameProperties& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property HAnchor; + nullable_property VAnchor; + nullable_property Wrap; + nullable_property X; + nullable_property Y; + nullable_property H; + nullable_property W; + nullable_property HSpace; + nullable_property VSpace; + nullable_property Lines; + nullable_property DropCap; + }; + } // namespace Logic +}// namespace OOX + +#endif // OOX_LOGIC_TEXT_FRAME_PROPERTIES_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextItem.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextItem.cpp new file mode 100644 index 0000000000..8ec6ff5a34 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextItem.cpp @@ -0,0 +1,113 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TextItem.h" +#include "Paragraph.h" +#include "Table.h" +#include "Sdt.h" +#include "BookmarkStartParagraph.h" +#include "BookmarkEndParagraph.h" + + +namespace OOX +{ + namespace Logic + { + + TextItem::TextItem() + { + } + + + TextItem::~TextItem() + { + } + + + TextItem::TextItem(const Paragraph& paragraph) + : m_item(new Paragraph(paragraph)) + { + } + + + TextItem::TextItem(const Table& table) + : m_item(new Table(table)) + { + } + + + TextItem::TextItem(const Sdt& sdt) + : m_item(new Sdt(sdt)) + { + } + + + TextItem::TextItem(const BookmarkStartParagraph& bookmark) + : m_item(new BookmarkStartParagraph(bookmark)) + { + } + + + TextItem::TextItem(const BookmarkEndParagraph& bookmark) + : m_item(new BookmarkEndParagraph(bookmark)) + { + } + + + TextItem::TextItem(const XML::XNode& node) + { + fromXML(node); + } + + + const TextItem& TextItem::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void TextItem::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + if (element->XName == "p") + { + m_item.reset(new Paragraph(node)); + } + else if (element->XName == "tbl") + { + m_item.reset(new Table(node)); + } + else if (element->XName == "sdt") + { + m_item.reset(new Sdt(node)); + } + else if (element->XName == "bookmarkStart") + { + m_item.reset(new BookmarkStartParagraph(node)); + } + else if (element->XName == "bookmarkEnd") + { + m_item.reset(new BookmarkEndParagraph(node)); + } + + } + + + const XML::XNode TextItem::toXML() const + { + return m_item->toXML(); + } + + + //void TextItem::inList() + //{ + // if (is()) + // as().inList(); + //} + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextItem.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextItem.h new file mode 100644 index 0000000000..c9505216dc --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextItem.h @@ -0,0 +1,50 @@ +#pragma once +#ifndef OOX_LOGIC_TEXT_ITEM_INCLUDE_H_ +#define OOX_LOGIC_TEXT_ITEM_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "TextItemBase.h" + +namespace OOX +{ + namespace Logic + { + class Paragraph; + class Table; + class Sdt; + class BookmarkStartParagraph; + class BookmarkEndParagraph; + + class TextItem : public WritingElement + { + public: + TextItem(); + virtual ~TextItem(); + TextItem(const Paragraph& paragraph); + TextItem(const Table& table); + TextItem(const Sdt& sdt); + TextItem(const BookmarkStartParagraph& bookmark); + TextItem(const BookmarkEndParagraph& bookmark); + explicit TextItem(const XML::XNode& node); + const TextItem& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + template const bool is() const { return typeid(*m_item) == typeid(T);} + template T& as() {return static_cast(*m_item);} + template const T& as() const {return static_cast(*m_item);} + + //public: + // void inList(); + + private: + boost::shared_ptr m_item; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_TEXT_ITEM_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextItemBase.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextItemBase.cpp new file mode 100644 index 0000000000..4802f04add --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextItemBase.cpp @@ -0,0 +1,14 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TextItemBase.h" + + +namespace OOX +{ + namespace Logic + { + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextItemBase.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextItemBase.h new file mode 100644 index 0000000000..2b14247944 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextItemBase.h @@ -0,0 +1,18 @@ +#pragma once +#ifndef OOX_LOGIC_TEXT_ITEM_BASE_INCLUDE_H_ +#define OOX_LOGIC_TEXT_ITEM_BASE_INCLUDE_H_ + +#include "./../WritingElement.h" + +namespace OOX +{ + namespace Logic + { + class TextItemBase : public WritingElement + { + + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_TEXT_ITEM_BASE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextPath.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextPath.cpp new file mode 100644 index 0000000000..f234ebd098 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextPath.cpp @@ -0,0 +1,63 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "TextPath.h" + + +namespace OOX +{ + namespace Logic + { + + TextPath::TextPath() + { + } + + + TextPath::~TextPath() + { + } + + + TextPath::TextPath(const XML::XNode& node) + { + fromXML(node); + } + + + const TextPath& TextPath::operator = (const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void TextPath::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + On = element.attribute("on").value(); + FitShape = element.attribute("fitshape").value(); + Trim = element.attribute("trim").value(); + String = element.attribute("string").value(); + Style = element.attribute("style").value(); + FitPath = element.attribute("fitpath").value(); + } + + + const XML::XNode TextPath::toXML() const + { + return + XML::XElement(ns.v + "textpath", + XML::XAttribute("style", Style) + + XML::XAttribute("on", On) + + XML::XAttribute("fitshape", FitShape) + + XML::XAttribute("trim", Trim) + + XML::XAttribute("fitpath", FitPath) + + XML::XAttribute("string", String) + ); + } + + } // namespace Logic +} // namespace OOX diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextPath.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextPath.h new file mode 100644 index 0000000000..d7cfb806e1 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/TextPath.h @@ -0,0 +1,39 @@ +#pragma once +#ifndef OOX_LOGIC_TEXT_PATH_INCLUDE_H_ +#define OOX_LOGIC_TEXT_PATH_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "property.h" +#include "nullable_property.h" +#include "./../Limit/TrueFalse.h" + + +namespace OOX +{ + namespace Logic + { + class TextPath : public WritingElement + { + public: + TextPath(); + virtual ~TextPath(); + explicit TextPath(const XML::XNode& node); + const TextPath& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property FitShape; + nullable_property Style; + nullable_property On; + nullable_property Trim; + nullable_property FitPath; + nullable_property String; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_TEXT_PATH_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/VMerge.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/VMerge.cpp new file mode 100644 index 0000000000..b2927e622b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/VMerge.cpp @@ -0,0 +1,50 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "VMerge.h" + + +namespace OOX +{ + namespace Logic + { + + VMerge::VMerge() + { + } + + + VMerge::~VMerge() + { + } + + + VMerge::VMerge(const XML::XNode& node) + { + fromXML(node); + } + + + const VMerge& VMerge::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void VMerge::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Value = element.attribute("val").value(); + } + + + const XML::XNode VMerge::toXML() const + { + return XML::XElement(ns.w + "vMerge", XML::XAttribute(ns.w + "val", Value)); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/VMerge.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/VMerge.h new file mode 100644 index 0000000000..b013c00d54 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/VMerge.h @@ -0,0 +1,33 @@ +#pragma once +#ifndef OOX_LOGIC_V_MERGE_INCLUDE_H_ +#define OOX_LOGIC_V_MERGE_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "nullable_property.h" +#include "./../Limit/VMergeVal.h" + + +namespace OOX +{ + namespace Logic + { + class VMerge : public WritingElement + { + public: + VMerge(); + virtual ~VMerge(); + explicit VMerge(const XML::XNode& node); + const VMerge& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property Value; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_V_MERGE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Wrap.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Wrap.cpp new file mode 100644 index 0000000000..f6be771faa --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Wrap.cpp @@ -0,0 +1,51 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Wrap.h" + +namespace OOX +{ + namespace Logic + { + Wrap::Wrap() + { + + } + + Wrap::~Wrap() + { + + } + + Wrap::Wrap(const XML::XNode& node) + { + fromXML(node); + } + + const Wrap& Wrap::operator = (const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void Wrap::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + Type = element.attribute("type").value(); + AnchorX = element.attribute("anchorx").value(); + AnchorY = element.attribute("anchory").value(); + } + + const XML::XNode Wrap::toXML() const + { + return XML::XElement(ns.w10 + "wrap", + XML::XAttribute("type", Type) + + XML::XAttribute("anchorx", AnchorX) + + XML::XAttribute("anchory", AnchorY)); + } + + } // namespace Logic +} // namespace OOX diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/Wrap.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Wrap.h new file mode 100644 index 0000000000..c030f77c7e --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/Wrap.h @@ -0,0 +1,32 @@ +#pragma once +#ifndef OOX_LOGIC_WRAP_INCLUDE_H_ +#define OOX_LOGIC_WRAP_INCLUDE_H_ + +#include +#include "./../WritingElement.h" + +namespace OOX +{ + namespace Logic + { + class Wrap : public WritingElement + { + public: + Wrap(); + virtual ~Wrap(); + explicit Wrap(const XML::XNode& node); + const Wrap& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Type; + nullable_property AnchorX; + nullable_property AnchorY; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_WRAP_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/WrapPath.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Logic/WrapPath.cpp new file mode 100644 index 0000000000..48b1b7ca78 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/WrapPath.cpp @@ -0,0 +1,57 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "WrapPath.h" + + +namespace OOX +{ + namespace Logic + { + + WrapPath::WrapPath() + { + } + + + WrapPath::~WrapPath() + { + } + + + WrapPath::WrapPath(const XML::XNode& node) + { + fromXML(node); + } + + + const WrapPath& WrapPath::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void WrapPath::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + start = element.element("start"); + XML::Fill(points, element, "lineTo"); + edited = element.attribute("edited").value(); + } + + + const XML::XNode WrapPath::toXML() const + { + return XML::XElement(ns.wp + "wrapPolygon", + XML::XAttribute("edited", edited) + + XML::Write(start) + + XML::Write(points) + ); + } + + } // namespace Logic +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Logic/WrapPath.h b/ASCOfficeOdtFile/Source/DocxFormat/Logic/WrapPath.h new file mode 100644 index 0000000000..2d7b5cb7d2 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Logic/WrapPath.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef OOX_LOGIC_WRAPPATH_INCLUDE_H_ +#define OOX_LOGIC_WRAPPATH_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include +#include "Point2D.h" + + +namespace OOX +{ + namespace Logic + { + class WrapPath : public WritingElement + { + public: + WrapPath(); + virtual ~WrapPath(); + explicit WrapPath(const XML::XNode& node); + const WrapPath& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property start; + property > points; + nullable_property edited; + }; + } // namespace Logic +} // namespace OOX + +#endif // OOX_LOGIC_WRAPPATH_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Media/Audio.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Media/Audio.cpp new file mode 100644 index 0000000000..37e32fcd8b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Media/Audio.cpp @@ -0,0 +1,46 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Audio.h" +#include "..\FileTypes.h" + + +namespace OOX +{ + + Audio::Audio() + { + } + + + Audio::Audio(const boost::filesystem::wpath& filename) + { + read(filename); + } + + + Audio::~Audio() + { + } + + + const FileType Audio::type() const + { + return FileTypes::Audio; + } + + + const boost::filesystem::wpath Audio::DefaultDirectory() const + { + return type().DefaultDirectory(); + } + + + const boost::filesystem::wpath Audio::DefaultFileName() const + { + return m_filename.filename(); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Media/Audio.h b/ASCOfficeOdtFile/Source/DocxFormat/Media/Audio.h new file mode 100644 index 0000000000..26693303e6 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Media/Audio.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_AUDIO_INCLUDE_H_ +#define OOX_AUDIO_INCLUDE_H_ + +#include "Media.h" + + +namespace OOX +{ + class Audio : public Media + { + public: + Audio(); + Audio(const boost::filesystem::wpath& filename); + virtual ~Audio(); + + public: + virtual const FileType type() const; + virtual const boost::filesystem::wpath DefaultDirectory() const; + virtual const boost::filesystem::wpath DefaultFileName() const; + }; +} // namespace OOX + +#endif // OOX_AUDIO_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Media/Image.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Media/Image.cpp new file mode 100644 index 0000000000..233d41f7ea --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Media/Image.cpp @@ -0,0 +1,78 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Image.h" +#include "..\FileTypes.h" +#include +//#include "OfficeSvmFile.h" +//#include "SvmConverter.h" +#include "FileNameUtility.h" + + +namespace OOX +{ + + Image::Image() + { + } + + + Image::Image(const boost::filesystem::wpath& filename) + { + read(filename); + } + + + Image::~Image() + { + } + + + void Image::write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const + { + std::wstring newFilename = filename.filename(); + boost::filesystem::wpath newFilePath = filename.parent_path(); + boost::replace_all(newFilename, L" ", L"_"); + if (boost::filesystem::exists(m_filename) && !boost::filesystem::exists(newFilePath/newFilename)) + { +/* if (m_filename.extension() == L".svm") + { + ConvertSvmToImage(m_filename, replace_extension(newFilePath/newFilename, L"png")); + } + else */if (m_filename.extension() != L"") + { + boost::filesystem::copy_file(m_filename, newFilePath/newFilename); + } + else + { + newFilename += L".wmf"; + boost::filesystem::copy_file(m_filename, newFilePath/newFilename); + } + } + if (m_filename.extension() == L".svm") + content.Default->add(replace_extension(newFilePath/newFilename, L"png")); + else + content.Default->add(newFilePath/newFilename); + } + + + const FileType Image::type() const + { + return FileTypes::Image; + } + + + const boost::filesystem::wpath Image::DefaultDirectory() const + { + return type().DefaultDirectory(); + } + + + const boost::filesystem::wpath Image::DefaultFileName() const + { + return m_filename.filename(); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Media/Image.h b/ASCOfficeOdtFile/Source/DocxFormat/Media/Image.h new file mode 100644 index 0000000000..1735999d99 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Media/Image.h @@ -0,0 +1,27 @@ +#pragma once +#ifndef OOX_IMAGE_INCLUDE_H_ +#define OOX_IMAGE_INCLUDE_H_ + +#include "Media.h" + + +namespace OOX +{ + class Image : public Media + { + public: + Image(); + Image(const boost::filesystem::wpath& filename); + virtual ~Image(); + + public: + virtual void write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const; + + public: + virtual const FileType type() const; + virtual const boost::filesystem::wpath DefaultDirectory() const; + virtual const boost::filesystem::wpath DefaultFileName() const; + }; +} // namespace OOX + +#endif // OOX_IMAGE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Media/Media.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Media/Media.cpp new file mode 100644 index 0000000000..308ce27413 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Media/Media.cpp @@ -0,0 +1,73 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Media.h" +#include "..\FileTypes.h" +//#include "OfficeSvmFile.h" +//#include "SvmConverter.h" +#include "FileNameUtility.h" +#include + + +namespace OOX +{ + + Media::Media() + { + } + + + Media::Media(const boost::filesystem::wpath& filename) + { + read(filename); + } + + + Media::~Media() + { + } + + + void Media::read(const boost::filesystem::wpath& filename) + { + m_filename = filename; + } + + + void Media::write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const + { + std::wstring newFilename = filename.filename(); + boost::filesystem::wpath newFilePath = filename.parent_path(); + boost::replace_all(newFilename, L" ", L"_"); + if (boost::filesystem::exists(m_filename) && !boost::filesystem::exists(newFilePath/newFilename)) + { + //if (m_filename.extension() == L".svm") + // ConvertSvmToImage(m_filename, replace_extension(newFilePath/newFilename, L"png")); + //else + boost::filesystem::copy_file(m_filename, newFilePath/newFilename); + } + //if (m_filename.extension() == L".svm") + // content.Default->add(replace_extension(newFilePath/newFilename, L"png")); + //else + content.Default->add(m_filename); + } + + + const boost::filesystem::wpath Media::filename() const + { + return m_filename; + } + + + void Media::copy_to(const boost::filesystem::wpath& path) const + { + std::wstring newFilename = m_filename.filename(); + boost::replace_all(newFilename, L" ", L"_"); + + if (boost::filesystem::exists(m_filename) && !boost::filesystem::exists(path/m_filename.filename())) + boost::filesystem::copy_file(m_filename, path/newFilename); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Media/Media.h b/ASCOfficeOdtFile/Source/DocxFormat/Media/Media.h new file mode 100644 index 0000000000..ccf409e7b7 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Media/Media.h @@ -0,0 +1,30 @@ +#pragma once +#ifndef OOX_MEDIA_INCLUDE_H_ +#define OOX_MEDIA_INCLUDE_H_ + +#include "..\File.h" + + +namespace OOX +{ + class Media : public File + { + public: + Media(); + Media(const boost::filesystem::wpath& filename); + virtual ~Media(); + + public: + virtual void read(const boost::filesystem::wpath& filename); + virtual void write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const; + + public: + const boost::filesystem::wpath filename() const; + void copy_to(const boost::filesystem::wpath& path) const; + + protected: + boost::filesystem::wpath m_filename; + }; +} // namespace OOX + +#endif // OOX_MEDIA_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Media/OleObject.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Media/OleObject.cpp new file mode 100644 index 0000000000..2e482f32d5 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Media/OleObject.cpp @@ -0,0 +1,59 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "OleObject.h" +#include "..\FileTypes.h" +#include + + +namespace OOX +{ + + OleObject::OleObject() + { + } + + + OleObject::OleObject(const boost::filesystem::wpath& filename) + { + read(filename); + } + + + OleObject::~OleObject() + { + } + + void OleObject::write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const + { + std::wstring newFilename = filename.filename(); + boost::filesystem::wpath newFilePath = filename.parent_path(); + boost::replace_all(newFilename, L" ", L"_"); + if (m_filename.extension() != L".bin") + newFilename += L".bin" ; + + boost::filesystem::copy_file(m_filename, newFilePath/newFilename); + content.Default->add(newFilePath/newFilename); + } + + + const FileType OleObject::type() const + { + return FileTypes::OleObject; + } + + + const boost::filesystem::wpath OleObject::DefaultDirectory() const + { + return type().DefaultDirectory(); + } + + + const boost::filesystem::wpath OleObject::DefaultFileName() const + { + return m_filename.filename(); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Media/OleObject.h b/ASCOfficeOdtFile/Source/DocxFormat/Media/OleObject.h new file mode 100644 index 0000000000..763f73e096 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Media/OleObject.h @@ -0,0 +1,27 @@ +#pragma once +#ifndef OOX_OLE_OBJECT_INCLUDE_H_ +#define OOX_OLE_OBJECT_INCLUDE_H_ + +#include "Media.h" + + +namespace OOX +{ + class OleObject : public Media + { + public: + OleObject(); + OleObject(const boost::filesystem::wpath& filename); + virtual ~OleObject(); + + public: + virtual void write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const; + + public: + virtual const FileType type() const; + virtual const boost::filesystem::wpath DefaultDirectory() const; + virtual const boost::filesystem::wpath DefaultFileName() const; + }; +} // namespace OOX + +#endif // OOX_OLE_OBJECT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Media/Video.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Media/Video.cpp new file mode 100644 index 0000000000..f21846a6e4 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Media/Video.cpp @@ -0,0 +1,46 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Video.h" +#include "..\FileTypes.h" + + +namespace OOX +{ + + Video::Video() + { + } + + + Video::Video(const boost::filesystem::wpath& filename) + { + read(filename); + } + + + Video::~Video() + { + } + + + const FileType Video::type() const + { + return FileTypes::Video; + } + + + const boost::filesystem::wpath Video::DefaultDirectory() const + { + return type().DefaultDirectory(); + } + + + const boost::filesystem::wpath Video::DefaultFileName() const + { + return m_filename.filename(); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Media/Video.h b/ASCOfficeOdtFile/Source/DocxFormat/Media/Video.h new file mode 100644 index 0000000000..27f486b3b4 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Media/Video.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef OOX_VIDEO_INCLUDE_H_ +#define OOX_VIDEO_INCLUDE_H_ + +#include "Media.h" + + +namespace OOX +{ + class Video : public Media + { + public: + Video(); + Video(const boost::filesystem::wpath& filename); + virtual ~Video(); + + public: + virtual const FileType type() const; + virtual const boost::filesystem::wpath DefaultDirectory() const; + virtual const boost::filesystem::wpath DefaultFileName() const; + }; +} // namespace OOX + +#endif // OOX_VIDEO_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/NamespaceOwn.cpp b/ASCOfficeOdtFile/Source/DocxFormat/NamespaceOwn.cpp new file mode 100644 index 0000000000..a31bcc3396 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/NamespaceOwn.cpp @@ -0,0 +1,12 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "NamespaceOwn.h" + + +namespace OOX +{ + const Namespaces NamespaceOwn::ns; +} \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/NamespaceOwn.h b/ASCOfficeOdtFile/Source/DocxFormat/NamespaceOwn.h new file mode 100644 index 0000000000..ae3359fa57 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/NamespaceOwn.h @@ -0,0 +1,16 @@ +#pragma once +#ifndef OOX_NAMESPACE_OWN_INCLUDE_H_ +#define OOX_NAMESPACE_OWN_INCLUDE_H_ + +#include "Namespaces.h" + +namespace OOX +{ + class NamespaceOwn + { + protected: + static const Namespaces ns; + }; +} // namespace OOX + +#endif // OOX_NAMESPACE_OWN_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Namespaces.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Namespaces.cpp new file mode 100644 index 0000000000..ebd337d136 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Namespaces.cpp @@ -0,0 +1,48 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Namespaces.h" + + +namespace OOX +{ + Namespaces::Namespaces() + : a("a", "http://schemas.openxmlformats.org/drawingml/2006/main"), + b("b", "http://schemas.openxmlformats.org/officeDocument/2006/bibliography"), + cdr("cdr", "http://schemas.openxmlformats.org/drawingml/2006/chartDrawing"), + cp("cp", "http://schemas.openxmlformats.org/package/2006/metadata/core-properties"), + dc("dc", "http://purl.org/dc/elements/1.1/"), + dchrt("dchrt", "http://schemas.openxmlformats.org/drawingml/2006/chart"), + dcmitype("dcmitype", "http://purl.org/dc/dcmitype/"), + dcterms("dcterms", "http://purl.org/dc/terms/"), + ddgrm("ddgrm", "http://schemas.openxmlformats.org/drawingml/2006/diagram"), + dgm("dgm", "http://schemas.openxmlformats.org/drawingml/2006/diagram"), + dlckcnv("dlckcnv", "http://schemas.openxmlformats.org/drawingml/2006/lockedCanvas"), + dpct("dpct", "http://schemas.openxmlformats.org/drawingml/2006/picture"), + ds("ds", "http://schemas.openxmlformats.org/officeDocument/2006/customXml"), + m("m", "http://schemas.openxmlformats.org/officeDocument/2006/math"), + o("o", "urn:schemas-microsoft-com:office:office"), + p("p", "http://schemas.openxmlformats.org/presentationml/2006/main"), + pic("pic", "http://schemas.openxmlformats.org/drawingml/2006/picture"), + pvml("pvml", "urn:schemas-microsoft-com:office:powerpoint"), + r("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), + s("s", "http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"), + sl("sl", "http://schemas.openxmlformats.org/schemaLibrary/2006/main"), + v("v", "urn:schemas-microsoft-com:vml"), + ve("ve", "http://schemas.openxmlformats.org/markup-compatibility/2006"), + vp("vp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"), + vt("vt", "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"), + w("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main"), + w10("w10", "urn:schemas-microsoft-com:office:word"), + wne("wne", "http://schemas.microsoft.com/office/word/2006/wordml"), + wp("wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"), + x("x", "urn:schemas-microsoft-com:office:excel"), + xdr("xdr", "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"), + xmlns("xmlns", "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"), + xsd("xsd", "http://www.w3.org/2001/XMLSchema"), + xsi("xsi", "http://www.w3.org/2001/XMLSchema-instance") + { + } +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Namespaces.h b/ASCOfficeOdtFile/Source/DocxFormat/Namespaces.h new file mode 100644 index 0000000000..1aaff18bc8 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Namespaces.h @@ -0,0 +1,52 @@ +#pragma once +#ifndef OOX_NAMESPACES_INCLUDE_H_ +#define OOX_NAMESPACES_INCLUDE_H_ + +#include "XML.h" + +namespace OOX +{ + class Namespaces + { + public: + Namespaces(); + + public: + const XML::XNamespace a; + const XML::XNamespace b; + const XML::XNamespace cdr; + const XML::XNamespace cp; + const XML::XNamespace dc; + const XML::XNamespace dchrt; + const XML::XNamespace dcmitype; + const XML::XNamespace dcterms; + const XML::XNamespace ddgrm; + const XML::XNamespace dgm; + const XML::XNamespace dlckcnv; + const XML::XNamespace dpct; + const XML::XNamespace ds; + const XML::XNamespace m; + const XML::XNamespace o; + const XML::XNamespace p; + const XML::XNamespace pic; + const XML::XNamespace pvml; + const XML::XNamespace r; + const XML::XNamespace s; + const XML::XNamespace sl; + const XML::XNamespace v; + const XML::XNamespace ve; + const XML::XNamespace vp; + const XML::XNamespace vt; + const XML::XNamespace w; + const XML::XNamespace w10; + const XML::XNamespace wne; + const XML::XNamespace wp; + const XML::XNamespace x; + const XML::XNamespace xdr; + const XML::XNamespace xmlns; + const XML::XNamespace xsd; + const XML::XNamespace xsi; + }; +} // namespace OOX + +#endif // OOX_NAMESPACES_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Numbering.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Numbering.cpp new file mode 100644 index 0000000000..2315a2a478 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Numbering.cpp @@ -0,0 +1,95 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Numbering.h" +#include "Exception/log_runtime_error.h" +#include "FileTypes.h" + + +namespace OOX +{ + + Numbering::Numbering() + { + } + + + Numbering::Numbering(const boost::filesystem::wpath& filename) + { + read(filename); + } + + + Numbering::~Numbering() + { + } + + + void Numbering::read(const boost::filesystem::wpath& filename) + { + const XML::XDocument document(filename); + XML::Fill(AbstractNums, document.Root, "abstractNum"); + XML::Fill(Nums, document.Root, "num"); + } + + + void Numbering::write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const + { + XML::XElement(ns.w + "numbering", + XML::Write(AbstractNums) + + XML::Write(Nums) + ).Save(filename); + + content.registration(type().OverrideType(), directory, filename); + } + + + void Numbering::clear() + { + AbstractNums->clear(); + Nums->clear(); + } + + + const int Numbering::getAbstractNumId(const int numId) const + { + BOOST_FOREACH(const Numbering::Num& num, *Nums) + { + if (num.NumId == numId) + return num.AbstractNumId; + } + throw log_runtime_error("bad numID"); + } + + + const Numbering::AbstractNum Numbering::getAbstractNum(const int abstractNumId) const + { + BOOST_FOREACH(const Numbering::AbstractNum& abstractNum, *AbstractNums) + { + if (abstractNum.Id == abstractNumId) + return abstractNum; + } + throw log_runtime_error("bad abstractNumId"); + } + + + const FileType Numbering::type() const + { + return FileTypes::Numbering; + } + + + const boost::filesystem::wpath Numbering::DefaultDirectory() const + { + return type().DefaultDirectory(); + } + + + const boost::filesystem::wpath Numbering::DefaultFileName() const + { + return type().DefaultFileName(); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Numbering.h b/ASCOfficeOdtFile/Source/DocxFormat/Numbering.h new file mode 100644 index 0000000000..4acf03079f --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Numbering.h @@ -0,0 +1,136 @@ +#pragma once +#ifndef OOX_NUMBERING_FILE_INCLUDE_H_ +#define OOX_NUMBERING_FILE_INCLUDE_H_ + +#include "File.h" +#include "property.h" +#include "nullable_property.h" +#include +#include +#include "Logic/Align.h" +#include "Logic/ParagraphProperty.h" +#include "Logic/RunProperty.h" +#include "Logic/NumFormat.h" +#include "Limit/Suffix.h" + + +namespace OOX +{ + class Numbering : public OOX::File + { + public: + class Level : public WritingElement + { + public: + Level(); + virtual ~Level(); + explicit Level(const XML::XNode& node); + const Level& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Ilvl; + nullable_property Tplc; + property Start; + property NumFmt; + nullable_property Suffix; + property Text; + nullable_property Align; + nullable_property ParagraphProperty; + nullable_property RunProperty; + nullable_property Tentative; + }; + + class AbstractNum : public WritingElement + { + public: + AbstractNum(); + virtual ~AbstractNum(); + explicit AbstractNum(const XML::XNode& node); + const AbstractNum& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + const Level getLevel(const int numLevel) const; + + public: + property > Levels; + property Id; + nullable_property Nsid; + property MultiLevelType; + nullable_property Tmpl; + nullable_property numStyleLink; + }; + + class LevelOverride : public WritingElement + { + public: + LevelOverride(); + virtual ~LevelOverride(); + explicit LevelOverride(const XML::XNode& node); + const LevelOverride& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Ilvl; + nullable_property StartOverride; + nullable_property Level; + }; + + + class Num : public WritingElement + { + public: + Num(); + virtual ~Num(); + explicit Num(const XML::XNode& node); + const Num& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property NumId; + property AbstractNumId; + property > LevelOverrides; + }; + + + public: + Numbering(); + Numbering(const boost::filesystem::wpath& filename); + virtual ~Numbering(); + + public: + virtual void read(const boost::filesystem::wpath& filename); + virtual void write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const; + + public: + virtual const FileType type() const; + virtual const boost::filesystem::wpath DefaultDirectory() const; + virtual const boost::filesystem::wpath DefaultFileName() const; + + public: + void clear(); + + public: + const int getAbstractNumId(const int numId) const; + const AbstractNum getAbstractNum(const int abstractNumId) const; + + public: + property > AbstractNums; + property > Nums; + }; +} // namespace OOX + +#endif // OOX_NUMBERING_FILE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Numbering/AbstractNum.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Numbering/AbstractNum.cpp new file mode 100644 index 0000000000..c7f6a0a945 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Numbering/AbstractNum.cpp @@ -0,0 +1,71 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "./../Numbering.h" +#include "Exception/log_runtime_error.h" + +namespace OOX +{ + Numbering::AbstractNum::AbstractNum() + { + + } + + Numbering::AbstractNum::~AbstractNum() + { + + } + + Numbering::AbstractNum::AbstractNum(const XML::XNode& node) + { + fromXML(node); + } + + const Numbering::AbstractNum& Numbering::AbstractNum::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void Numbering::AbstractNum::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + Id = element.attribute("abstractNumId").value(); + Nsid = element.element("nsid").attribute("val").value(); + MultiLevelType = element.element("multiLevelType").attribute("val").value(); + Tmpl = element.element("tmpl").attribute("val").value(); + + if (element.element("numStyleLink").exist()) + { + if (element.element("numStyleLink").attribute("val").exist()) + numStyleLink = element.element("numStyleLink").attribute("val").value(); + } + + XML::Fill(Levels, element, "lvl"); + } + + const XML::XNode Numbering::AbstractNum::toXML() const + { + return + XML::XElement(ns.w + "abstractNum", + XML::XAttribute(ns.w + "abstractNumId", Id) + + XML::Write(ns.w + "multiLevelType", ns.w + "val", MultiLevelType) + + XML::Write(Levels) + + XML::Write(ns.w + "tmpl", ns.w + "val", Tmpl) + + XML::Write(ns.w + "nsid", ns.w + "val", Nsid)); + } + + const Numbering::Level Numbering::AbstractNum::getLevel(const int numLevel) const + { + BOOST_FOREACH(const Level& level, *Levels) + { + if (level.Ilvl == numLevel) + return level; + } + throw log_runtime_error("bad abstractNum"); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Numbering/Level.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Numbering/Level.cpp new file mode 100644 index 0000000000..996bcd084b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Numbering/Level.cpp @@ -0,0 +1,68 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "./../Numbering.h" + + +namespace OOX +{ + + Numbering::Level::Level() + { + } + + + Numbering::Level::~Level() + { + } + + + Numbering::Level::Level(const XML::XNode& node) + { + fromXML(node); + } + + + const Numbering::Level& Numbering::Level::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Numbering::Level::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Ilvl = element.attribute("ilvl").value(); + Tplc = element.attribute("tplc").value(); + Start = element.element("start").attribute("val").value(); + NumFmt = element.element("numFmt"); + Suffix = element.element("suff").attribute("val").value(); + Text = element.element("lvlText").attribute("val").value(); + Align = element.element("lvlJc").attribute("val").value(); + ParagraphProperty = element.element("pPr"); + RunProperty = element.element("rPr"); + Tentative = element.attribute("tentative").value(); + } + + + const XML::XNode Numbering::Level::toXML() const + { + return + XML::XElement(ns.w + "lvl", + XML::XAttribute(ns.w + "ilvl", Ilvl) + + XML::XAttribute(ns.w + "tplc", Tplc) + + XML::XAttribute(ns.w + "tentative", Tentative) + + XML::Write(ns.w + "start", ns.w + "val", Start) + + XML::Write(NumFmt) + + XML::Write(ns.w + "suff", ns.w + "val", Suffix) + + XML::Write(ns.w + "lvlText", ns.w + "val", Text)+ + XML::Write(ParagraphProperty) + + XML::Write(RunProperty) + + XML::Write(ns.w + "lvlJc", ns.w + "val", Align) + ); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Numbering/LevelOverride.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Numbering/LevelOverride.cpp new file mode 100644 index 0000000000..edff9b53c2 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Numbering/LevelOverride.cpp @@ -0,0 +1,54 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "./../Numbering.h" + + +namespace OOX +{ + + Numbering::LevelOverride::LevelOverride() + { + } + + + Numbering::LevelOverride::~LevelOverride() + { + } + + + Numbering::LevelOverride::LevelOverride(const XML::XNode& node) + { + fromXML(node); + } + + + const Numbering::LevelOverride& Numbering::LevelOverride::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Numbering::LevelOverride::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Ilvl = element.attribute("ilvl").value(); + StartOverride = element.element("startOverride").attribute("val").value(); + Level = element.element("lvl"); + } + + + const XML::XNode Numbering::LevelOverride::toXML() const + { + return + XML::XElement(ns.w + "lvlOverride", + XML::XAttribute(ns.w + "ilvl", Ilvl) + + XML::Write(ns.w + "startOverride", ns.w + "val", StartOverride) + + XML::Write(Level) + ); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Numbering/Num.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Numbering/Num.cpp new file mode 100644 index 0000000000..ce5fb57032 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Numbering/Num.cpp @@ -0,0 +1,54 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "./../Numbering.h" + + +namespace OOX +{ + + Numbering::Num::Num() + { + } + + + Numbering::Num::~Num() + { + } + + + Numbering::Num::Num(const XML::XNode& node) + { + fromXML(node); + } + + + const Numbering::Num& Numbering::Num::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Numbering::Num::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + NumId = element.attribute("numId").value(); + AbstractNumId = element.element("abstractNumId").attribute("val").value(); + XML::Fill(LevelOverrides, element, "lvlOverride"); + } + + + const XML::XNode Numbering::Num::toXML() const + { + return + XML::XElement(ns.w + "num", + XML::XAttribute(ns.w + "numId", NumId) + + XML::XElement(ns.w + "abstractNumId", XML::XAttribute(ns.w + "val", AbstractNumId)) + + XML::Write(LevelOverrides) + ); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/RId.cpp b/ASCOfficeOdtFile/Source/DocxFormat/RId.cpp new file mode 100644 index 0000000000..9043d83b61 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/RId.cpp @@ -0,0 +1,128 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "RId.h" +#include "ToString.h" +#include "Parse.h" +#include + +namespace +{ + // Âåðíóòü ñëåäóþùèé Id ïî òåêóùåìó + /* + _ASSERTE(nextId("rId1") == "rId2" ); + _ASSERTE(nextId("rId234sf") == "rId235sf" ); + _ASSERTE(nextId("rId2sf4") == "rId3sf4" ); + _ASSERTE(nextId("rIdHp2") == "rIdHp3" ); + _ASSERTE(nextId("rIdMyId") == "rIdMyId1" ); + */ + + std::string nextId(const std::string & id) + { + std::locale loc; + std::string::const_iterator i; + + std::string prefix; + int numId = 0; + std::string suffix; + for (i = id.begin(); i != id.end() && !std::isdigit(*i, loc); ++i); + + prefix = std::string(id.begin(), i); + if (i != id.end()) + { + std::stringstream strm(std::string(i, id.end())); + strm >> numId; + strm >> suffix; + } + + return prefix + (boost::lexical_cast(numId+1)) + suffix; + } +} + +namespace OOX +{ + RId::RId() + { + } + + + RId::RId(const size_t id) + : m_id("rId" + boost::lexical_cast(id)) + { + } + + + RId::RId(const std::string& rid) + { + //m_id = Parse(rid.substr(3)); + m_id = rid; + } + + + const RId& RId::operator= (const size_t id) + { + m_id = "rId" + boost::lexical_cast(id); + return *this; + } + + + const RId& RId::operator= (const std::string& rid) + { + //m_id = Parse(rid.substr(3)); + m_id = rid; + return *this; + } + + + const bool RId::operator ==(const RId& lhs) const + { + return m_id == lhs.m_id; + } + + + const bool RId::operator !=(const RId& lhs) const + { + return m_id != lhs.m_id; + } + + + const bool RId::operator < (const RId& lhs) const + { + return m_id < lhs.m_id; + } + + + const bool RId::operator <=(const RId& lhs) const + { + return m_id <= lhs.m_id; + } + + + const bool RId::operator >(const RId& lhs) const + { + return m_id > lhs.m_id; + } + + + const bool RId::operator >=(const RId& lhs) const + { + return m_id >= lhs.m_id; + } + + + const RId RId::next() const + { + //return RId(m_id + 1); + return RId(nextId(m_id)); + } + + + const std::string RId::ToString() const + { + //return "rId" + ::ToString(m_id); + return m_id; + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/RId.h b/ASCOfficeOdtFile/Source/DocxFormat/RId.h new file mode 100644 index 0000000000..1a1318bc25 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/RId.h @@ -0,0 +1,40 @@ +#pragma once +#ifndef OOX_RID_INCLUDE_H_ +#define OOX_RID_INCLUDE_H_ + +#include + + +namespace OOX +{ + class RId + { + public: + RId(); + RId(const size_t id); + RId(const std::string& rid); + + public: + const RId& operator= (const size_t id); + const RId& operator= (const std::string& rid); + + public: + const bool operator ==(const RId& lhs) const; + const bool operator !=(const RId& lhs) const; + const bool operator < (const RId& lhs) const; + const bool operator <=(const RId& lhs) const; + const bool operator > (const RId& lhs) const; + const bool operator >=(const RId& lhs) const; + + public: + const RId next() const; + + public: + const std::string ToString() const; + + private: + std::string m_id; + }; +} // namespace OOX + +#endif // OOX_RID_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Rels/File.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Rels/File.cpp new file mode 100644 index 0000000000..b6e8b4722c --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Rels/File.cpp @@ -0,0 +1,110 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "File.h" +#include "./../FileTypes.h" +#include "FileNameUtility.h" + + +namespace OOX +{ + namespace Rels + { + + File::File() + { + } + + + File::File(const boost::filesystem::wpath& filename) + { + read(filename); + } + + + File::~File() + { + } + + + void File::read(const boost::filesystem::wpath& filename) + { + const boost::filesystem::wpath file = createFileName(filename); + + if (boost::filesystem::exists(file)) + { + const XML::XDocument document(file); + Relations = document.Root; + } + } + + + void File::write(const boost::filesystem::wpath& filename) const + { + if (!Relations->empty()) + { + const boost::filesystem::wpath file = createFileName(filename); + boost::filesystem::create_directories(file.parent_path()); + + XML::XElement("Relationships", + XML::XNamespace("xmlns", "http://schemas.openxmlformats.org/package/2006/relationships") + + XML::Write(Relations) + ).Save(file); + } + } + + + const bool File::isValid() const + { + return true; + } + + + void File::registration(const RId& rId, const FileType& type, const boost::filesystem::wpath& filename) + { + if(!(type == FileTypes::Unknow)) + { + std::wstring newFilename = filename.filename(); + boost::filesystem::wpath newFilePath = filename.parent_path(); + std::wstring ext = filename.extension(); + if (filename.extension() == L"") + { + if (type.RelationType() =="http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject") + { + newFilename += L".bin" ; + Relations->registration(rId, type.RelationType(), newFilePath/newFilename); + } + else if (type.RelationType() =="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image") + { + newFilename += L".wmf" ; + Relations->registration(rId, type.RelationType(), newFilePath/newFilename); + } + } + else + { + Relations->registration(rId, type.RelationType(), replace_extension(filename, L"svm", L"png")); + } + } + } + + + void File::registration(const RId& rId, const boost::shared_ptr external) + { + Relations->registration(rId, external); + } + + + const boost::filesystem::wpath File::createFileName(const boost::filesystem::wpath& filename) const + { + boost::filesystem::wpath name = filename.parent_path() / L"_rels"; + if (filename.filename() == L".") + name /= L".rels"; + else + name /= filename.filename() + L".rels"; + return name; + } + + } // namespace Rels +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Rels/File.h b/ASCOfficeOdtFile/Source/DocxFormat/Rels/File.h new file mode 100644 index 0000000000..bf202af8c7 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Rels/File.h @@ -0,0 +1,42 @@ +#pragma once +#ifndef OOX_RELS_FILE_INCLUDE_H_ +#define OOX_RELS_FILE_INCLUDE_H_ + +#include "property.h" +#include "RelationTable.h" +#include "./../FileType.h" +#include "./../RId.h" +#include "./../External/External.h" +#include + + +namespace OOX +{ + namespace Rels + { + class File + { + public: + File(); + File(const boost::filesystem::wpath& filename); + ~File(); + + public: + void read(const boost::filesystem::wpath& filename); + void write(const boost::filesystem::wpath& filename) const; + const bool isValid() const; + + public: + void registration(const RId& rId, const FileType& type, const boost::filesystem::wpath& filename); + void registration(const RId& rId, const boost::shared_ptr external); + + private: + const boost::filesystem::wpath createFileName(const boost::filesystem::wpath& filename) const; + + public: + property Relations; + }; + } // namespace Rels +} // namespace OOX + +#endif // OOX_RELS_FILE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Rels/RelationShip.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Rels/RelationShip.cpp new file mode 100644 index 0000000000..ca1168263c --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Rels/RelationShip.cpp @@ -0,0 +1,112 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "RelationShip.h" +#include "./../External/External.h" +#include + + +namespace OOX +{ + namespace Rels + { + + RelationShip::RelationShip(const RId& rId, const std::string& type, const boost::filesystem::wpath& filename) + : m_rId(rId), + m_target(filename), + m_type(type) + { + std::wstring newFilename = filename.string(); + boost::replace_all(newFilename, L" ", L"_"); + m_target = newFilename; + } + + + RelationShip::RelationShip(const RId& rId, const boost::shared_ptr external) + : m_rId(rId), + m_target(external->Uri()), + m_type(external->type().RelationType()), + m_mode("External") + { + } + + + RelationShip::~RelationShip() + { + } + + + RelationShip::RelationShip(const XML::XNode& node) + { + fromXML(node); + } + + + const RelationShip& RelationShip::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void RelationShip::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_rId = element.attribute("Id").value().ToString(); + m_target = element.attribute("Target").value(); + m_type = element.attribute("Type").value(); + m_mode = element.attribute("TargetMode").value(); + } + + + const XML::XNode RelationShip::toXML() const + { + return + XML::XElement("Relationship", + XML::XAttribute("Id", m_rId) + + XML::XAttribute("Type", m_type) + + XML::XAttribute("Target", m_target) + + XML::XAttribute("TargetMode", m_mode) + ); + } + + + const bool RelationShip::operator <(const RelationShip& rhs) const + { + return m_rId < rhs.m_rId; + } + + + const std::string RelationShip::type() const + { + return m_type; + } + + + const boost::filesystem::wpath RelationShip::filename() const + { + return m_target; + } + + + const boost::filesystem::wpath RelationShip::target() const + { + return m_target; + } + + + const bool RelationShip::isExternal()const + { + return (m_mode.get_value_or("Internal") == "External"); + } + + + const RId RelationShip::rId() const + { + return m_rId; + } + + } // namespace Rels +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Rels/RelationShip.h b/ASCOfficeOdtFile/Source/DocxFormat/Rels/RelationShip.h new file mode 100644 index 0000000000..8abc70af1f --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Rels/RelationShip.h @@ -0,0 +1,53 @@ +#pragma once +#ifndef OOX_RELS_RELATION_SHIP_INCLUDE_H_ +#define OOX_RELS_RELATION_SHIP_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "property.h" +#include "nullable_property.h" +#include "./../RId.h" +#include +#include +#include + + +namespace OOX {class External;} + + +namespace OOX +{ + namespace Rels + { + class RelationShip : public WritingElement + { + public: + RelationShip(const RId& rId, const std::string& type, const boost::filesystem::wpath& filename); + RelationShip(const RId& rId, const boost::shared_ptr external); + virtual ~RelationShip(); + explicit RelationShip(const XML::XNode& node); + const RelationShip& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + const bool operator <(const RelationShip& rhs) const; + + public: + const std::string type() const; + const boost::filesystem::wpath filename() const; + const boost::filesystem::wpath target() const; + const bool isExternal()const; + const RId rId() const; + + private: + RId m_rId; + boost::filesystem::wpath m_target; + std::string m_type; + nullable m_mode; + }; + } // namespace Rels +} // namespace OOX + +#endif // OOX_RELS_RELATION_SHIP_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Rels/RelationTable.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Rels/RelationTable.cpp new file mode 100644 index 0000000000..03b770b214 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Rels/RelationTable.cpp @@ -0,0 +1,50 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "RelationTable.h" +#include + + +namespace OOX +{ + namespace Rels + { + + RelationTable::RelationTable() + { + } + + + RelationTable::~RelationTable() + { + } + + + RelationTable::RelationTable(const XML::XNode& node) + { + fromXML(node); + } + + + const RelationTable& RelationTable::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void RelationTable::registration(const RId& rId, const std::string& type, const boost::filesystem::wpath& filename) + { + m_items.push_back(RelationShip(rId, type, filename)); + } + + + void RelationTable::registration(const RId& rId, const boost::shared_ptr external) + { + m_items.push_back(RelationShip(rId, external)); + } + + } // namespace Rels +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Rels/RelationTable.h b/ASCOfficeOdtFile/Source/DocxFormat/Rels/RelationTable.h new file mode 100644 index 0000000000..3aab8b496b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Rels/RelationTable.h @@ -0,0 +1,32 @@ +#pragma once +#ifndef OOX_RELS_RELATION_TABLE_INCLUDE_H_ +#define OOX_RELS_RELATION_TABLE_INCLUDE_H_ + +#include "./../WritingVector.h" +#include "RelationShip.h" +#include +#include +#include "./../RId.h" + +namespace OOX {class External;} + +namespace OOX +{ + namespace Rels + { + class RelationTable : public WritingVector + { + public: + RelationTable(); + virtual ~RelationTable(); + explicit RelationTable(const XML::XNode& node); + const RelationTable& operator =(const XML::XNode& node); + + public: + void registration(const RId& rId, const std::string& type, const boost::filesystem::wpath& filename); + void registration(const RId& rId, const boost::shared_ptr external); + }; + } // namespace Rels +} // namespace OOX + +#endif // OOX_RELS_RELATION_TABLE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/ClrSchemeMapping.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Settings/ClrSchemeMapping.cpp new file mode 100644 index 0000000000..0e239d7baa --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/ClrSchemeMapping.cpp @@ -0,0 +1,76 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ClrSchemeMapping.h" + + +namespace OOX +{ + namespace Settings + { + + ClrSchemeMapping::ClrSchemeMapping() + { + } + + + ClrSchemeMapping::~ClrSchemeMapping() + { + } + + + ClrSchemeMapping::ClrSchemeMapping(const XML::XNode& node) + { + fromXML(node); + } + + + const ClrSchemeMapping& ClrSchemeMapping::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void ClrSchemeMapping::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_bg1 = element.attribute("bg1").value(); + m_t1 = element.attribute("t1").value(); + m_bg2 = element.attribute("bg2").value(); + m_t2 = element.attribute("t2").value(); + m_accent1 = element.attribute("accent1").value(); + m_accent2 = element.attribute("accent2").value(); + m_accent3 = element.attribute("accent3").value(); + m_accent4 = element.attribute("accent4").value(); + m_accent5 = element.attribute("accent5").value(); + m_accent6 = element.attribute("accent6").value(); + m_hyperlink = element.attribute("hyperlink").value(); + m_followedHyperlink = element.attribute("followedHyperlink").value(); + + } + + + const XML::XNode ClrSchemeMapping::toXML() const + { + return + XML::XElement(ns.w + "clrSchemeMapping", + XML::XAttribute(ns.w + "bg1", m_bg1) + + XML::XAttribute(ns.w + "t1", m_t1) + + XML::XAttribute(ns.w + "bg2", m_bg2) + + XML::XAttribute(ns.w + "t2", m_t2) + + XML::XAttribute(ns.w + "accent1", m_accent1) + + XML::XAttribute(ns.w + "accent2", m_accent2) + + XML::XAttribute(ns.w + "accent3", m_accent3) + + XML::XAttribute(ns.w + "accent4", m_accent4) + + XML::XAttribute(ns.w + "accent5", m_accent5) + + XML::XAttribute(ns.w + "accent6", m_accent6) + + XML::XAttribute(ns.w + "hyperlink", m_hyperlink) + + XML::XAttribute(ns.w + "followedHyperlink", m_followedHyperlink) + ); + } + + } // namespace Settings +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/ClrSchemeMapping.h b/ASCOfficeOdtFile/Source/DocxFormat/Settings/ClrSchemeMapping.h new file mode 100644 index 0000000000..01276e8694 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/ClrSchemeMapping.h @@ -0,0 +1,42 @@ +#pragma once +#ifndef OOX_SETTINGS_CLR_SCHEME_MAPPING_INCLUDE_H_ +#define OOX_SETTINGS_CLR_SCHEME_MAPPING_INCLUDE_H_ + +#include "./../WritingElement.h" +#include + + +namespace OOX +{ + namespace Settings + { + class ClrSchemeMapping : public WritingElement + { + public: + ClrSchemeMapping(); + virtual ~ClrSchemeMapping(); + explicit ClrSchemeMapping(const XML::XNode& node); + const ClrSchemeMapping& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + std::string m_bg1; + std::string m_t1; + std::string m_bg2; + std::string m_t2; + std::string m_accent1; + std::string m_accent2; + std::string m_accent3; + std::string m_accent4; + std::string m_accent5; + std::string m_accent6; + std::string m_hyperlink; + std::string m_followedHyperlink; + }; + } // namespace Settings +} // namespace OOX + +#endif // OOX_SETTINGS_CLR_SCHEME_MAPPING_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/Endnote.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Endnote.cpp new file mode 100644 index 0000000000..e8273124bb --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Endnote.cpp @@ -0,0 +1,50 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Endnote.h" + + +namespace OOX +{ + namespace Settings + { + + Endnote::Endnote() + { + } + + + Endnote::~Endnote() + { + } + + + Endnote::Endnote(const XML::XNode& node) + { + fromXML(node); + } + + + const Endnote& Endnote::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Endnote::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_id = element.attribute("id").value(); + } + + + const XML::XNode Endnote::toXML() const + { + return XML::XElement(ns.w + "endnote", XML::XAttribute(ns.w + "id", m_id)); + } + + } // namespace Settings +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/Endnote.h b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Endnote.h new file mode 100644 index 0000000000..300281f8fe --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Endnote.h @@ -0,0 +1,30 @@ +#pragma once +#ifndef OOX_SETTINGS_ENDNOTE_INCLUDE_H_ +#define OOX_SETTINGS_ENDNOTE_INCLUDE_H_ + +#include "./../WritingElement.h" + + +namespace OOX +{ + namespace Settings + { + class Endnote : public WritingElement + { + public: + Endnote(); + virtual ~Endnote(); + explicit Endnote(const XML::XNode& node); + const Endnote& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + int m_id; + }; + } // namespace Settings +} // namespace OOX + +#endif // OOX_SETTINGS_ENDNOTE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/EndnotePr.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Settings/EndnotePr.cpp new file mode 100644 index 0000000000..f8be7c2317 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/EndnotePr.cpp @@ -0,0 +1,53 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "EndnotePr.h" + + +namespace OOX +{ + namespace Settings + { + + EndnotePr::EndnotePr() + { + } + + + EndnotePr::~EndnotePr() + { + } + + + EndnotePr::EndnotePr(const XML::XNode& node) + { + fromXML(node); + } + + + const EndnotePr& EndnotePr::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void EndnotePr::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + XML::Fill(m_endnotes, element, "endnote"); + } + + + const XML::XNode EndnotePr::toXML() const + { + return + XML::XElement(ns.w + "endnotePr", + XML::Write(m_endnotes) + ); + } + + } // namespace Settings +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/EndnotePr.h b/ASCOfficeOdtFile/Source/DocxFormat/Settings/EndnotePr.h new file mode 100644 index 0000000000..59e82b82ee --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/EndnotePr.h @@ -0,0 +1,32 @@ +#pragma once +#ifndef OOX_SETTINGS_ENDNOTE_PR_INCLUDE_H_ +#define OOX_SETTINGS_ENDNOTE_PR_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "Endnote.h" + + +namespace OOX +{ + namespace Settings + { + class EndnotePr : public WritingElement + { + public: + EndnotePr(); + virtual ~EndnotePr(); + explicit EndnotePr(const XML::XNode& node); + const EndnotePr& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + std::vector m_endnotes; + }; + } // namespace Settings +} // namespace OOX + +#endif // OOX_SETTINGS_ENDNOTE_PR_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/File.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Settings/File.cpp new file mode 100644 index 0000000000..76dfc9c497 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/File.cpp @@ -0,0 +1,99 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "File.h" +#include "./../FileTypes.h" + + +namespace OOX +{ + namespace Settings + { + + File::File() + { + } + + + File::File(const boost::filesystem::wpath& filename) + { + read(filename); + } + + + File::~File() + { + } + + + void File::read(const boost::filesystem::wpath& filename) + { + const XML::XDocument document(filename); + + m_zoom = document.Root.element("zoom"); + m_proofState = document.Root.element("proofState"); + m_defaultTabStop = document.Root.element("defaultTabStop").attribute("val").value(); + m_characterSpacingControl = document.Root.element("characterSpacingControl").attribute("val").value(); + m_compat = document.Root.element("compat").attribute("val").value(); + m_mathPr = document.Root.element("mathPr"); + m_footnotePr = document.Root.element("footnotePr"); + m_endnotePr = document.Root.element("endnotePr"); + m_themeFontLang = document.Root.element("themeFontLang").attribute("val").value(); + m_clrSchemeMapping = document.Root.element("clrSchemeMapping"); + m_shapeDefaults = document.Root.element("shapeDefaults"); + m_decimalSymbol = document.Root.element("decimalSymbol").attribute("val").value(); + m_listSeparator = document.Root.element("listSeparator").attribute("val").value(); + EvenAndOddHeaders = document.Root.element("evenAndOddHeaders").exist(); + m_hdrShapeDefaults = document.Root.element("hdrShapeDefaults"); + m_drawingGridHorizontalSpacing = document.Root.element("drawingGridHorizontalSpacing").attribute("val").value();; + m_displayHorizontalDrawingGridEvery = document.Root.element("displayHorizontalDrawingGridEvery").attribute("val").value(); + } + + + void File::write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const + { + XML::XElement(ns.w + "settings", + XML::Write(m_zoom) + + XML::Write(m_proofState) + + XML::XElement(ns.w + "defaultTabStop", XML::XAttribute(ns.w + "val", m_defaultTabStop)) + + XML::XElement(ns.w + "drawingGridHorizontalSpacing", XML::XAttribute(ns.w + "val", m_drawingGridHorizontalSpacing)) + + XML::XElement(ns.w + "displayHorizontalDrawingGridEvery", XML::XAttribute(ns.w + "val", m_displayHorizontalDrawingGridEvery)) + + XML::XElement(ns.w + "characterSpacingControl", XML::XAttribute(ns.w + "val", m_characterSpacingControl)) + + XML::WriteIf(XML::XElement(ns.w + "evenAndOddHeaders"), EvenAndOddHeaders) + + XML::Write(m_hdrShapeDefaults) + + XML::Write(m_footnotePr) + + XML::Write(m_endnotePr) + + XML::XElement(ns.w + "compat", XML::XAttribute(ns.w + "val", m_compat)) + + XML::Write(m_mathPr) + + XML::XElement(ns.w + "themeFontLang", XML::XAttribute(ns.w + "val", m_themeFontLang)) + + XML::Write(m_clrSchemeMapping) + + XML::Write(m_shapeDefaults) + + XML::XElement(ns.w + "decimalSymbol", XML::XAttribute(ns.w + "val", m_decimalSymbol)) + + XML::XElement(ns.w + "listSeparator", XML::XAttribute(ns.w + "val", m_listSeparator)) + ).Save(filename); + + content.registration(type().OverrideType(), directory, filename); + } + + + const FileType File::type() const + { + return FileTypes::Setting; + } + + + const boost::filesystem::wpath File::DefaultDirectory() const + { + return type().DefaultDirectory(); + } + + + const boost::filesystem::wpath File::DefaultFileName() const + { + return type().DefaultFileName(); + } + + } // namespace Settings +} // namespace OOXFile \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/File.h b/ASCOfficeOdtFile/Source/DocxFormat/Settings/File.h new file mode 100644 index 0000000000..9603b4d98e --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/File.h @@ -0,0 +1,61 @@ +#pragma once +#ifndef OOX_SETTINGS_FILE_INCLUDE_H_ +#define OOX_SETTINGS_FILE_INCLUDE_H_ + +#include "./../File.h" +#include "Zoom.h" +#include "ProofState.h" +#include "MathPr.h" +#include "ClrSchemeMapping.h" +#include "ShapeDefaults.h" +#include "property.h" +#include "FootnotePr.h" +#include "EndnotePr.h" +#include "HdrShapeDefaults.h" + + +namespace OOX +{ + namespace Settings + { + class File : public OOX::File + { + public: + File(); + File(const boost::filesystem::wpath& filename); + virtual ~File(); + + public: + virtual void read(const boost::filesystem::wpath& filename); + virtual void write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const; + + public: + virtual const FileType type() const; + virtual const boost::filesystem::wpath DefaultDirectory() const; + virtual const boost::filesystem::wpath DefaultFileName() const; + + public: + nullable EvenAndOddHeaders; + + private: + nullable m_zoom; + nullable m_proofState; + nullable m_defaultTabStop; + nullable m_characterSpacingControl; + nullable m_compat; + nullable m_mathPr; + nullable m_footnotePr; + nullable m_endnotePr; + nullable m_themeFontLang; + nullable m_clrSchemeMapping; + nullable m_shapeDefaults; + nullable m_decimalSymbol; + nullable m_listSeparator; + nullable m_hdrShapeDefaults; + nullable m_drawingGridHorizontalSpacing; + nullable m_displayHorizontalDrawingGridEvery; + }; + } // namespace Settings +} // namespace OOX + +#endif // OOX_SETTING_FILE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/Footnote.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Footnote.cpp new file mode 100644 index 0000000000..e9893884a4 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Footnote.cpp @@ -0,0 +1,50 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Footnote.h" + + +namespace OOX +{ + namespace Settings + { + + Footnote::Footnote() + { + } + + + Footnote::~Footnote() + { + } + + + Footnote::Footnote(const XML::XNode& node) + { + fromXML(node); + } + + + const Footnote& Footnote::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Footnote::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_id = element.attribute("id").value(); + } + + + const XML::XNode Footnote::toXML() const + { + return XML::XElement(ns.w + "footnote", XML::XAttribute(ns.w + "id", m_id)); + } + + } // namespace Settings +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/Footnote.h b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Footnote.h new file mode 100644 index 0000000000..52493a9ee7 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Footnote.h @@ -0,0 +1,30 @@ +#pragma once +#ifndef OOX_SETTINGS_FOOTNOTE_INCLUDE_H_ +#define OOX_SETTINGS_FOOTNOTE_INCLUDE_H_ + +#include "./../WritingElement.h" + + +namespace OOX +{ + namespace Settings + { + class Footnote : public WritingElement + { + public: + Footnote(); + virtual ~Footnote(); + explicit Footnote(const XML::XNode& node); + const Footnote& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + int m_id; + }; + } // namespace Settings +} // namespace OOX + +#endif // OOX_SETTINGS_FOOTNOTE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/FootnotePr.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Settings/FootnotePr.cpp new file mode 100644 index 0000000000..ffc9122d17 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/FootnotePr.cpp @@ -0,0 +1,53 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "FootnotePr.h" + + +namespace OOX +{ + namespace Settings + { + + FootnotePr::FootnotePr() + { + } + + + FootnotePr::~FootnotePr() + { + } + + + FootnotePr::FootnotePr(const XML::XNode& node) + { + fromXML(node); + } + + + const FootnotePr& FootnotePr::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void FootnotePr::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + XML::Fill(m_footnotes, element, "footnote"); + } + + + const XML::XNode FootnotePr::toXML() const + { + return + XML::XElement(ns.m + "footnotePr", + XML::Write(m_footnotes) + ); + } + + } // namespace Settings +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/FootnotePr.h b/ASCOfficeOdtFile/Source/DocxFormat/Settings/FootnotePr.h new file mode 100644 index 0000000000..18775d88ff --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/FootnotePr.h @@ -0,0 +1,32 @@ +#pragma once +#ifndef OOX_SETTINGS_FOOTNOTE_PR_INCLUDE_H_ +#define OOX_SETTINGS_FOOTNOTE_PR_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "Footnote.h" + + +namespace OOX +{ + namespace Settings + { + class FootnotePr : public WritingElement + { + public: + FootnotePr(); + virtual ~FootnotePr(); + explicit FootnotePr(const XML::XNode& node); + const FootnotePr& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + std::vector m_footnotes; + }; + } // namespace Settings +} // namespace OOX + +#endif // OOX_SETTINGS_FOOTNOTE_PR_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/HdrShapeDefaults.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Settings/HdrShapeDefaults.cpp new file mode 100644 index 0000000000..d60814e6de --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/HdrShapeDefaults.cpp @@ -0,0 +1,53 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "HdrShapeDefaults.h" + + +namespace OOX +{ + namespace Settings + { + + HdrShapeDefaults::HdrShapeDefaults() + { + } + + + HdrShapeDefaults::~HdrShapeDefaults() + { + } + + + HdrShapeDefaults::HdrShapeDefaults(const XML::XNode& node) + { + fromXML(node); + } + + + const HdrShapeDefaults& HdrShapeDefaults::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void HdrShapeDefaults::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_shapeDefault = element.element("shapedefaults"); + } + + + const XML::XNode HdrShapeDefaults::toXML() const + { + return + XML::XElement(ns.m + "hdrShapeDefaults", + XML::Write(m_shapeDefault) + ); + } + + } // namespace Settings +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/HdrShapeDefaults.h b/ASCOfficeOdtFile/Source/DocxFormat/Settings/HdrShapeDefaults.h new file mode 100644 index 0000000000..effbab8007 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/HdrShapeDefaults.h @@ -0,0 +1,31 @@ +#pragma once +#ifndef OOX_SETTINGS_HDR_SHAPE_DEFAULTS_INCLUDE_H_ +#define OOX_SETTINGS_HDR_SHAPE_DEFAULTS_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "ShapeDefault.h" + + +namespace OOX +{ + namespace Settings + { + class HdrShapeDefaults : public WritingElement + { + public: + HdrShapeDefaults(); + virtual ~HdrShapeDefaults(); + explicit HdrShapeDefaults(const XML::XNode& node); + const HdrShapeDefaults& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + ShapeDefault m_shapeDefault; + }; + } // namespace Settings +} // namespace OOX + +#endif // OOX_SETTINGS_HDR_SHAPE_DEFAULTS_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/IdMap.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Settings/IdMap.cpp new file mode 100644 index 0000000000..92b2e4a4b0 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/IdMap.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "IdMap.h" + + +namespace OOX +{ + namespace Settings + { + + IdMap::IdMap() + { + } + + + IdMap::~IdMap() + { + } + + + IdMap::IdMap(const XML::XNode& node) + { + fromXML(node); + } + + + const IdMap& IdMap::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void IdMap::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_ext = element.attribute("ext").value(); + m_data = element.attribute("data").value(); + } + + + const XML::XNode IdMap::toXML() const + { + return + XML::XElement(ns.o + "idmap", + XML::XAttribute(ns.v + "ext", m_ext) + + XML::XAttribute("data", m_data) + ); + } + + } // namespace Settings +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/IdMap.h b/ASCOfficeOdtFile/Source/DocxFormat/Settings/IdMap.h new file mode 100644 index 0000000000..941270d4e8 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/IdMap.h @@ -0,0 +1,32 @@ +#pragma once +#ifndef OOX_SETTINGS_ID_MAP_INCLUDE_H_ +#define OOX_SETTINGS_ID_MAP_INCLUDE_H_ + +#include "./../WritingElement.h" +#include + + +namespace OOX +{ + namespace Settings + { + class IdMap : public WritingElement + { + public: + IdMap(); + virtual ~IdMap(); + explicit IdMap(const XML::XNode& node); + const IdMap& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + std::string m_ext; + int m_data; + }; + } // namespace Settings +} // namespace OOX + +#endif // OOX_SETTINGS_SHAPE_LAYOUT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/MathPr.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Settings/MathPr.cpp new file mode 100644 index 0000000000..29d55de63c --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/MathPr.cpp @@ -0,0 +1,74 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "MathPr.h" + + +namespace OOX +{ + namespace Settings + { + + MathPr::MathPr() + { + } + + + MathPr::~MathPr() + { + } + + + MathPr::MathPr(const XML::XNode& node) + { + fromXML(node); + } + + + const MathPr& MathPr::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void MathPr::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_mathFont = element.element("mathFont").attribute("val").value(); + m_brkBin = element.element("brkBin").attribute("val").value(); + m_brkBinSub = element.element("brkBinSub").attribute("val").value(); + m_smallFrac = element.element("smallFrac").attribute("val").value(); + m_dispDef = element.element("dispDef").attribute("val").value(); + m_lMargin = element.element("lMargin").attribute("val").value(); + m_rMargin = element.element("rMargin").attribute("val").value(); + m_defJc = element.element("defJc").attribute("val").value(); + m_wrapIndent= element.element("wrapIndent").attribute("val").value(); + m_intLim = element.element("intLim").attribute("val").value(); + m_naryLim = element.element("naryLim").attribute("val").value(); + + } + + + const XML::XNode MathPr::toXML() const + { + return + XML::XElement(ns.m + "mathPr", + XML::XElement(ns.m + "mathFont", XML::XAttribute(ns.m + "val", m_mathFont)) + + XML::XElement(ns.m + "brkBin", XML::XAttribute(ns.m + "val", m_brkBin)) + + XML::XElement(ns.m + "brkBinSub", XML::XAttribute(ns.m + "val", m_brkBinSub)) + + XML::XElement(ns.m + "smallFrac", XML::XAttribute(ns.m + "val", m_smallFrac)) + + XML::XElement(ns.m + "dispDef", XML::XAttribute(ns.m + "val", m_dispDef)) + + XML::XElement(ns.m + "lMargin", XML::XAttribute(ns.m + "val", m_lMargin)) + + XML::XElement(ns.m + "rMargin", XML::XAttribute(ns.m + "val", m_rMargin)) + + XML::XElement(ns.m + "defJc", XML::XAttribute(ns.m + "val", m_defJc)) + + XML::XElement(ns.m + "wrapIndent", XML::XAttribute(ns.m + "val", m_wrapIndent)) + + XML::XElement(ns.m + "intLim", XML::XAttribute(ns.m + "val", m_intLim)) + + XML::XElement(ns.m + "naryLim", XML::XAttribute(ns.m + "val", m_naryLim)) + ); + } + + } // namespace Settings +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/MathPr.h b/ASCOfficeOdtFile/Source/DocxFormat/Settings/MathPr.h new file mode 100644 index 0000000000..893fb463f4 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/MathPr.h @@ -0,0 +1,43 @@ +#pragma once +#ifndef OOX_SETTINGS_MATH_PR_INCLUDE_H_ +#define OOX_SETTINGS_MATH_PR_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "property.h" +#include "nullable.h" + + +namespace OOX +{ + namespace Settings + { + class MathPr : public WritingElement + { + public: + MathPr(); + virtual ~MathPr(); + explicit MathPr(const XML::XNode& node); + const MathPr& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + std::string m_mathFont; + std::string m_brkBin; + std::string m_brkBinSub; + std::string m_smallFrac; + nullable m_dispDef; + int m_lMargin; + int m_rMargin; + std::string m_defJc; + int m_wrapIndent; + std::string m_intLim; + std::string m_naryLim; + }; + } // namespace Settings +} // namespace OOX + +#endif // OOX_SETTINGS_MATH_PR_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/ProofState.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Settings/ProofState.cpp new file mode 100644 index 0000000000..2b4dbc02de --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/ProofState.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ProofState.h" + + +namespace OOX +{ + namespace Settings + { + + ProofState::ProofState() + { + } + + + ProofState::~ProofState() + { + } + + + ProofState::ProofState(const XML::XNode& node) + { + fromXML(node); + } + + + const ProofState& ProofState::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void ProofState::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_spelling = element.attribute("spelling").value(); + m_grammar = element.attribute("grammar").value(); + } + + + const XML::XNode ProofState::toXML() const + { + return + XML::XElement(ns.w + "proofState", + XML::XAttribute(ns.w + "spelling", m_spelling) + + XML::XAttribute(ns.w + "grammar", m_grammar) + ); + } + + } // namespace Settings +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/ProofState.h b/ASCOfficeOdtFile/Source/DocxFormat/Settings/ProofState.h new file mode 100644 index 0000000000..e23b632df0 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/ProofState.h @@ -0,0 +1,33 @@ +#pragma once +#ifndef OOX_SETTINGS_PROOF_STATE_INCLUDE_H_ +#define OOX_SETTINGS_PROOF_STATE_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "nullable.h" + + +namespace OOX +{ + namespace Settings + { + class ProofState : public WritingElement + { + public: + ProofState(); + virtual ~ProofState(); + explicit ProofState(const XML::XNode& node); + const ProofState& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + nullable m_spelling; + std::string m_grammar; + }; + } // namespace Settings +} // namespace OOX + +#endif // OOX_SETTINGS_PROOF_STATE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/Rule.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Rule.cpp new file mode 100644 index 0000000000..8868eea24e --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Rule.cpp @@ -0,0 +1,57 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Rule.h" + + +namespace OOX +{ + namespace Settings + { + + Rule::Rule() + { + } + + + Rule::~Rule() + { + } + + + Rule::Rule(const XML::XNode& node) + { + fromXML(node); + } + + + const Rule& Rule::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Rule::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_id = element.attribute("id").value(); + m_type = element.attribute("type").value(); + m_idref = element.attribute("idref").value(); + } + + + const XML::XNode Rule::toXML() const + { + return + XML::XElement(ns.o + "r", + XML::XAttribute("id", m_id) + + XML::XAttribute("type", m_type) + + XML::XAttribute("idref", m_idref) + ); + } + + } // namespace Settings +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/Rule.h b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Rule.h new file mode 100644 index 0000000000..27cc7aa793 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Rule.h @@ -0,0 +1,33 @@ +#pragma once +#ifndef OOX_SETTINGS_RULE_INCLUDE_H_ +#define OOX_SETTINGS_RULE_INCLUDE_H_ + +#include "./../WritingElement.h" +#include + + +namespace OOX +{ + namespace Settings + { + class Rule : public WritingElement + { + public: + Rule(); + virtual ~Rule(); + explicit Rule(const XML::XNode& node); + const Rule& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + std::string m_id; + std::string m_type; + std::string m_idref; + }; + } // namespace Settings +} // namespace OOX + +#endif // OOX_SETTINGS_RULE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/Rules.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Rules.cpp new file mode 100644 index 0000000000..8f8949e851 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Rules.cpp @@ -0,0 +1,56 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Rules.h" + + +namespace OOX +{ + namespace Settings + { + + Rules::Rules() + { + } + + + Rules::~Rules() + { + } + + + Rules::Rules(const XML::XNode& node) + { + fromXML(node); + } + + + const Rules& Rules::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Rules::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Fill(m_rules, element, "r"); + m_ext = element.attribute("ext").value(); + + } + + + const XML::XNode Rules::toXML() const + { + return + XML::XElement(ns.o + "rules", + XML::XAttribute(ns.v + "ext", m_ext) + + XML::Write(m_rules) + ); + } + + } // namespace Settings +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/Rules.h b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Rules.h new file mode 100644 index 0000000000..7cc989522d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Rules.h @@ -0,0 +1,33 @@ +#pragma once +#ifndef OOX_SETTINGS_RULES_INCLUDE_H_ +#define OOX_SETTINGS_RULES_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "Rule.h" +#include + + +namespace OOX +{ + namespace Settings + { + class Rules : public WritingElement + { + public: + Rules(); + virtual ~Rules(); + explicit Rules(const XML::XNode& node); + const Rules& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + std::vector m_rules; + std::string m_ext; + }; + } // namespace Settings +} // namespace OOX + +#endif // OOX_SETTINGS_RULES_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/ShapeDefaults.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Settings/ShapeDefaults.cpp new file mode 100644 index 0000000000..080712b806 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/ShapeDefaults.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ShapeDefaults.h" + + +namespace OOX +{ + namespace Settings + { + + ShapeDefaults::ShapeDefaults() + { + } + + + ShapeDefaults::~ShapeDefaults() + { + } + + + ShapeDefaults::ShapeDefaults(const XML::XNode& node) + { + fromXML(node); + } + + + const ShapeDefaults& ShapeDefaults::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void ShapeDefaults::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_shapeDefault = element.element("shapedefaults"); + m_shapeLayout = element.element("shapelayout"); + } + + + const XML::XNode ShapeDefaults::toXML() const + { + return + XML::XElement(ns.w + "shapeDefaults", + XML::Write(m_shapeDefault) + + XML::Write(m_shapeLayout) + ); + } + + } // namespace Settings +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/ShapeDefaults.h b/ASCOfficeOdtFile/Source/DocxFormat/Settings/ShapeDefaults.h new file mode 100644 index 0000000000..6a7d2bda10 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/ShapeDefaults.h @@ -0,0 +1,34 @@ +#pragma once +#ifndef OOX_SETTINGS_SHAPE_DEFAULTS_INCLUDE_H_ +#define OOX_SETTINGS_SHAPE_DEFAULTS_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "ShapeLayout.h" +#include "ShapeDefault.h" + + +namespace OOX +{ + namespace Settings + { + class ShapeDefaults : public WritingElement + { + public: + ShapeDefaults(); + virtual ~ShapeDefaults(); + explicit ShapeDefaults(const XML::XNode& node); + const ShapeDefaults& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + ShapeDefault m_shapeDefault; + ShapeLayout m_shapeLayout; + }; + } // namespace Settings +} // namespace OOX + +#endif // OOX_SETTINGS_SHAPE_DEFAULTS_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/Shapedefault.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Shapedefault.cpp new file mode 100644 index 0000000000..07f62e1fd3 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Shapedefault.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ShapeDefault.h" + + +namespace OOX +{ + namespace Settings + { + + ShapeDefault::ShapeDefault() + { + } + + + ShapeDefault::~ShapeDefault() + { + } + + + ShapeDefault::ShapeDefault(const XML::XNode& node) + { + fromXML(node); + } + + + const ShapeDefault& ShapeDefault::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void ShapeDefault::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_ext = element.attribute("ext").value(); + m_spidmax = element.attribute("spidmax").value().ToString(); + } + + + const XML::XNode ShapeDefault::toXML() const + { + return + XML::XElement(ns.o + "shapedefaults", + XML::XAttribute(ns.v + "ext", m_ext) + + XML::XAttribute("spidmax", m_spidmax) + ); + } + + } // namespace Settings +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/Shapedefault.h b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Shapedefault.h new file mode 100644 index 0000000000..9ffb040411 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Shapedefault.h @@ -0,0 +1,33 @@ +#pragma once +#ifndef OOX_SETTINGS_SHAPE_DEFAULT_INCLUDE_H_ +#define OOX_SETTINGS_SHAPE_DEFAULT_INCLUDE_H_ + +#include "./../WritingElement.h" + +#include "./../Unit.h" + + +namespace OOX +{ + namespace Settings + { + class ShapeDefault : public WritingElement + { + public: + ShapeDefault(); + virtual ~ShapeDefault(); + explicit ShapeDefault(const XML::XNode& node); + const ShapeDefault& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + std::string m_ext; + UnitDx m_spidmax; + }; + } // namespace Settings +} // namespace OOX + +#endif // OOX_SETTINGS_SHAPE_DEFAULT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/Shapelayout.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Shapelayout.cpp new file mode 100644 index 0000000000..a43c3d5228 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Shapelayout.cpp @@ -0,0 +1,57 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ShapeLayout.h" + + +namespace OOX +{ + namespace Settings + { + + ShapeLayout::ShapeLayout() + { + } + + + ShapeLayout::~ShapeLayout() + { + } + + + ShapeLayout::ShapeLayout(const XML::XNode& node) + { + fromXML(node); + } + + + const ShapeLayout& ShapeLayout::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void ShapeLayout::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_ext = element.attribute("ext").value(); + m_idMap = element.element("idmap"); + m_rules = element.element("rules"); + } + + + const XML::XNode ShapeLayout::toXML() const + { + return + XML::XElement(ns.o + "shapelayout", + XML::XAttribute(ns.v + "ext", m_ext) + + XML::Write(m_idMap) + + XML::Write(m_rules) + ); + } + + } // namespace Settings +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/Shapelayout.h b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Shapelayout.h new file mode 100644 index 0000000000..39c4926a5a --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Shapelayout.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef OOX_SETTINGS_SHAPE_LAYOUT_INCLUDE_H_ +#define OOX_SETTINGS_SHAPE_LAYOUT_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "IdMap.h" +#include "Rules.h" + + +namespace OOX +{ + namespace Settings + { + class ShapeLayout : public WritingElement + { + public: + ShapeLayout(); + virtual ~ShapeLayout(); + explicit ShapeLayout(const XML::XNode& node); + const ShapeLayout& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + std::string m_ext; + IdMap m_idMap; + Rules m_rules; + }; + } // namespace Settings +} // namespace OOX + +#endif // OOX_SETTINGS_SHAPE_LAYOUT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/Zoom.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Zoom.cpp new file mode 100644 index 0000000000..ef371153da --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Zoom.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Zoom.h" + + +namespace OOX +{ + namespace Settings + { + + Zoom::Zoom() + { + } + + + Zoom::~Zoom() + { + } + + + Zoom::Zoom(const XML::XNode& node) + { + fromXML(node); + } + + + const Zoom& Zoom::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Zoom::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_value = element.attribute("val").value(); + m_percent = element.attribute("percent").value(); + } + + + const XML::XNode Zoom::toXML() const + { + return + XML::XElement(ns.w + "zoom", + XML::XAttribute(ns.w + "val", m_value) + + XML::XAttribute(ns.w + "percent", m_percent) + ); + } + + } // namespace Settings +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Settings/Zoom.h b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Zoom.h new file mode 100644 index 0000000000..aae7f67dd8 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Settings/Zoom.h @@ -0,0 +1,32 @@ +#pragma once +#ifndef OOX_SETTINGS_ZOOM_INCLUDE_H_ +#define OOX_SETTINGS_ZOOM_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "nullable.h" + + +namespace OOX +{ + namespace Settings + { + class Zoom : public WritingElement + { + public: + Zoom(); + virtual ~Zoom(); + explicit Zoom(const XML::XNode& node); + const Zoom& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + nullable m_value; + int m_percent; + }; + } // namespace Settings +} // namespace OOX + +#endif // OOX_SETTINGS_ZOOM_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Styles.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Styles.cpp new file mode 100644 index 0000000000..efbdf10fe8 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Styles.cpp @@ -0,0 +1,102 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Styles.h" +#include "FileTypes.h" + +namespace OOX +{ + Styles::Styles() + { + + } + + Styles::Styles(const boost::filesystem::wpath& filename) + { + read(filename); + } + + Styles::~Styles() + { + + } + + void Styles::read(const boost::filesystem::wpath& filename) + { + const XML::XDocument document(filename); + + Default = document.Root.element("docDefaults"); + Lattent = document.Root.element("latentStyles"); + + Fill(Named, document.Root, "style"); + } + + void Styles::write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const + { + XML::XElement(ns.w + "styles", + XML::Write(Default) + + XML::Write(Lattent) + + XML::Write(Named) + ).Save(filename); + + content.registration(type().OverrideType(), directory, filename); + } + + const FileType Styles::type() const + { + return FileTypes::Style; + } + + const boost::filesystem::wpath Styles::DefaultDirectory() const + { + return type().DefaultDirectory(); + } + + const boost::filesystem::wpath Styles::DefaultFileName() const + { + return type().DefaultFileName(); + } + + const OOX::Styles::Style Styles::GetStyleById(const std::string& strStyleId) const + { + for (size_t i = 0; i < Named->size(); ++i) + { + if ( Named->operator [](i).StyleId == strStyleId) + return Named->operator [](i); + } + + return OOX::Styles::Style(); + } + + const OOX::Styles::Style Styles::GetDefaultStyle(const std::string& Type) const + { + OOX::Styles::Style defaultStyle; + + BOOST_FOREACH( const OOX::Styles::Style& style, *Named ) + { + if ( ( style.Type == Type ) && style.Default.is_init() && ( *style.Default == 1 ) ) + { + defaultStyle = style; + } + } + + return defaultStyle; + } + + const OOX::Styles::Style Styles::GetStyleWithTypeAndName (const std::string& Type, const std::string& Name) const + { + OOX::Styles::Style defaultStyle; + BOOST_FOREACH( const OOX::Styles::Style& style, *Named ) + { + if ( (style.Type == Type) && (style.name == Name) ) + { + defaultStyle = style; + } + } + + return defaultStyle; + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Styles.h b/ASCOfficeOdtFile/Source/DocxFormat/Styles.h new file mode 100644 index 0000000000..1faa0b4046 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Styles.h @@ -0,0 +1,140 @@ +#pragma once +#ifndef OOX_STYLES_INCLUDE_H_ +#define OOX_STYLES_INCLUDE_H_ + +#include "File.h" +#include "property.h" +#include "nullable_property.h" +#include "WritingElement.h" +#include "Logic/TableProperty.h" +#include "Logic/TableCellProperties.h" +#include "Logic/RunProperty.h" +#include "Logic/ParagraphProperty.h" +#include "Logic/TableStyle.h" +#include + +namespace OOX +{ + class Styles : public OOX::File + { + public: + class Style : public WritingElement + { + public: + Style(); + virtual ~Style(); + explicit Style(const XML::XNode& node); + const Style& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property name; + nullable_property RunProperty; + nullable_property ParagraphProperty; + nullable_property tblPr; + nullable_property tcPr; + property tableStyles; + property StyleId; + nullable_property BasedOn; + nullable_property Next; + property Type; + nullable_property Default; + nullable_property CustomStyle; + nullable_property Link; + nullable_property UiPriority; + property QFormat; + property SemiHidden; + property UnhideWhenUsed; + property AutoRedefine; + }; + + class DocDefaults : public WritingElement + { + public: + DocDefaults(); + virtual ~DocDefaults(); + explicit DocDefaults(const XML::XNode& node); + const DocDefaults& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property ParagraphProperty; + property RunProperty; + }; + + class LsdException : public WritingElement + { + public: + LsdException(); + virtual ~LsdException(); + explicit LsdException(const XML::XNode& node); + const LsdException& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property Name; + nullable_property SemiHidden; + nullable_property UiPriority; + nullable_property UnhideWhenUsed; + nullable_property QFormat; + }; + + class LattentStyles : public WritingElement + { + public: + LattentStyles(); + virtual ~LattentStyles(); + explicit LattentStyles(const XML::XNode& node); + const LattentStyles& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property DefLockedState; + property DefUIPriority; + property DefSemiHidden; + property DefUnhideWhenUsed; + property DefQFormat; + property Count; + property > LsdExceptions; + }; + + public: + + Styles(); + Styles(const boost::filesystem::wpath& filename); + virtual ~Styles(); + + public: + virtual void read(const boost::filesystem::wpath& filename); + virtual void write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const; + + public: + virtual const FileType type() const; + virtual const boost::filesystem::wpath DefaultDirectory() const; + virtual const boost::filesystem::wpath DefaultFileName() const; + + public: + const OOX::Styles::Style GetStyleById( const std::string& StyleId ) const; + const OOX::Styles::Style GetDefaultStyle( const std::string& Type ) const; + const OOX::Styles::Style Styles::GetStyleWithTypeAndName (const std::string& Type, const std::string& Name) const; + + public: + property > Named; + property Default; + nullable_property Lattent; + }; +} // namespace OOX + +#endif // OOX_STYLES_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Styles/DocDefaults.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Styles/DocDefaults.cpp new file mode 100644 index 0000000000..7caa3cb41b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Styles/DocDefaults.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "./../Styles.h" +#include "XML.h" + + +namespace OOX +{ + + Styles::DocDefaults::DocDefaults() + { + } + + + Styles::DocDefaults::~DocDefaults() + { + } + + + Styles::DocDefaults::DocDefaults(const XML::XNode& node) + { + fromXML(node); + } + + + const Styles::DocDefaults& Styles::DocDefaults::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Styles::DocDefaults::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + ParagraphProperty = element.element("pPrDefault").element("pPr"); + RunProperty = element.element("rPrDefault").element("rPr"); + } + + + const XML::XNode Styles::DocDefaults::toXML() const + { + return + XML::XElement(ns.w + "docDefaults", + XML::XElement(ns.w + "rPrDefault", + XML::Write(RunProperty)) + + XML::XElement(ns.w + "pPrDefault", + XML::Write(ParagraphProperty)) + ); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Styles/LattentStyles.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Styles/LattentStyles.cpp new file mode 100644 index 0000000000..efd1bfbe97 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Styles/LattentStyles.cpp @@ -0,0 +1,62 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "./../Styles.h" + + +namespace OOX +{ + + Styles::LattentStyles::LattentStyles() + { + } + + + Styles::LattentStyles::~LattentStyles() + { + } + + + Styles::LattentStyles::LattentStyles(const XML::XNode& node) + { + fromXML(node); + } + + + const Styles::LattentStyles& Styles::LattentStyles::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Styles::LattentStyles::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + DefLockedState = element.attribute("defLockedState").value(); + DefUIPriority = element.attribute("defUIPriority").value(); + DefSemiHidden = element.attribute("defSemiHidden").value(); + DefUnhideWhenUsed = element.attribute("defUnhideWhenUsed").value(); + DefQFormat = element.attribute("defQFormat").value(); + Count = element.attribute("count").value(); + XML::Fill(LsdExceptions, element); + } + + + const XML::XNode Styles::LattentStyles::toXML() const + { + return + XML::XElement(ns.w + "latentStyles", + XML::XAttribute(ns.w + "defLockedState", DefLockedState) + + XML::XAttribute(ns.w + "defUIPriority", DefUIPriority) + + XML::XAttribute(ns.w + "defSemiHidden", DefSemiHidden) + + XML::XAttribute(ns.w + "defUnhideWhenUsed", DefUnhideWhenUsed) + + XML::XAttribute(ns.w + "defQFormat", DefQFormat) + + XML::XAttribute(ns.w + "count", Count) + + XML::Write(LsdExceptions) + ); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Styles/LsdException.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Styles/LsdException.cpp new file mode 100644 index 0000000000..8dc5b71522 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Styles/LsdException.cpp @@ -0,0 +1,58 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "./../Styles.h" + + +namespace OOX +{ + + Styles::LsdException::LsdException() + { + } + + + Styles::LsdException::~LsdException() + { + } + + + Styles::LsdException::LsdException(const XML::XNode& node) + { + fromXML(node); + } + + + const Styles::LsdException& Styles::LsdException::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Styles::LsdException::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + Name = element.attribute("name").value(); + SemiHidden = element.attribute("semiHidden").value(); + UiPriority = element.attribute("uiPriority").value(); + UnhideWhenUsed = element.attribute("unhideWhenUsed").value(); + QFormat = element.attribute("qFormat").value(); + } + + + const XML::XNode Styles::LsdException::toXML() const + { + return + XML::XElement(ns.w + "lsdException", + XML::XAttribute(ns.w + "name", Name) + + XML::XAttribute(ns.w + "semiHidden", SemiHidden) + + XML::XAttribute(ns.w + "uiPriority", UiPriority) + + XML::XAttribute(ns.w + "unhideWhenUsed", UnhideWhenUsed) + + XML::XAttribute(ns.w + "qFormat", QFormat) + ); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Styles/Style.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Styles/Style.cpp new file mode 100644 index 0000000000..8ee36bd739 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Styles/Style.cpp @@ -0,0 +1,79 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "./../Styles.h" + +namespace OOX +{ + Styles::Style::Style() + { + + } + + Styles::Style::~Style() + { + + } + + Styles::Style::Style(const XML::XNode& node) + { + fromXML(node); + } + + const Styles::Style& Styles::Style::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + void Styles::Style::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + + Default = element.attribute("default").value(); + CustomStyle = element.attribute("customStyle").value(); + tblPr = element.element("tblPr"); + tcPr = element.element("tcPr"); + tableStyles = element; + Link = element.element("link").attribute("val").value(); + UiPriority = element.element("uiPriority").attribute("val").value(); + Type = element.attribute("type").value(); + StyleId = element.attribute("styleId").value(); + BasedOn = element.element("basedOn").attribute("val").value(); + Next = element.element("next").attribute("val").value(); + ParagraphProperty = element.element("pPr"); + RunProperty = element.element("rPr"); + name = element.element("name").attribute("val").value(); + QFormat = element.element("qFormat").exist(); + AutoRedefine = element.element("autoRedefine").exist(); + SemiHidden = element.element("semiHidden").exist(); + UnhideWhenUsed = element.element("unhideWhenUsed").exist(); + } + + const XML::XNode Styles::Style::toXML() const + { + return + XML::XElement(ns.w + "style", + XML::XAttribute(ns.w + "type", Type) + + XML::XAttribute(ns.w + "default", Default) + + XML::XAttribute(ns.w + "customStyle", CustomStyle) + + XML::XAttribute(ns.w + "styleId", StyleId) + + XML::Write(ns.w + "name", ns.w + "val", name) + + XML::WriteIf(XML::XElement(ns.w + "semiHidden"), SemiHidden) + + XML::WriteIf(XML::XElement(ns.w + "unhideWhenUsed"), UnhideWhenUsed) + + XML::WriteIf(XML::XElement(ns.w + "qFormat"), QFormat) + + XML::WriteIf(XML::XElement(ns.w + "autoRedefine"), AutoRedefine) + + XML::Write(ns.w + "basedOn", ns.w + "val", BasedOn) + + XML::Write(ns.w + "next", ns.w + "val", Next) + + XML::Write(ns.w + "link", ns.w + "val", Link) + + XML::Write(ns.w + "uiPriority", ns.w + "val", UiPriority) + + XML::Write(ParagraphProperty) + + XML::Write(RunProperty) + + XML::Write(tblPr) + + XML::Write(tcPr) + + XML::Write(tableStyles)); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/BevelT.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/BevelT.cpp new file mode 100644 index 0000000000..24a5e2e192 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/BevelT.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "BevelT.h" + + +namespace OOX +{ + namespace Theme + { + + BevelT::BevelT() + { + } + + + BevelT::~BevelT() + { + } + + + BevelT::BevelT(const XML::XNode& node) + { + fromXML(node); + } + + + const BevelT& BevelT::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void BevelT::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_w = element.attribute("w").value(); + m_h = element.attribute("h").value(); + } + + + const XML::XNode BevelT::toXML() const + { + return + XML::XElement(ns.a + "bevelT", + XML::XAttribute("w", m_w) + + XML::XAttribute("h", m_h) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/BevelT.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/BevelT.h new file mode 100644 index 0000000000..a296a3da30 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/BevelT.h @@ -0,0 +1,31 @@ +#pragma once +#ifndef OOX_THEME_BEVELT_INCLUDE_H_ +#define OOX_THEME_BEVELT_INCLUDE_H_ + +#include "./../WritingElement.h" + + +namespace OOX +{ + namespace Theme + { + class BevelT : public WritingElement + { + public: + BevelT(); + virtual ~BevelT(); + explicit BevelT(const XML::XNode& node); + const BevelT& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + int m_w; + int m_h; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_BEVELT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/BgFillStyleLst.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/BgFillStyleLst.cpp new file mode 100644 index 0000000000..5fdb4abe5f --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/BgFillStyleLst.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "BgFillStyleLst.h" + + +namespace OOX +{ + namespace Theme + { + + BgFillStyleLst::BgFillStyleLst() + { + } + + + BgFillStyleLst::~BgFillStyleLst() + { + } + + + BgFillStyleLst::BgFillStyleLst(const XML::XNode& node) + { + fromXML(node); + } + + + const BgFillStyleLst& BgFillStyleLst::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void BgFillStyleLst::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_solidFill = element.element("solidFill"); + XML::Fill(m_gradFills, element, "gradFill"); + } + + + const XML::XNode BgFillStyleLst::toXML() const + { + return + XML::XElement(ns.a + "bgFillStyleLst", + XML::Write(m_solidFill) + + XML::Write(m_gradFills) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/BgFillStyleLst.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/BgFillStyleLst.h new file mode 100644 index 0000000000..43656fffc5 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/BgFillStyleLst.h @@ -0,0 +1,34 @@ +#pragma once +#ifndef OOX_THEME_BG_FILL_STYLE_LST_INCLUDE_H_ +#define OOX_THEME_BG_FILL_STYLE_LST_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "SolidFill.h" +#include +#include "GradFill.h" + + +namespace OOX +{ + namespace Theme + { + class BgFillStyleLst : public WritingElement + { + public: + BgFillStyleLst(); + virtual ~BgFillStyleLst(); + explicit BgFillStyleLst(const XML::XNode& node); + const BgFillStyleLst& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + SolidFill m_solidFill; + std::vector m_gradFills; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_BG_FILL_STYLE_LST_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/Camera.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Camera.cpp new file mode 100644 index 0000000000..5b67b2e59f --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Camera.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Camera.h" + + +namespace OOX +{ + namespace Theme + { + + Camera::Camera() + { + } + + + Camera::~Camera() + { + } + + + Camera::Camera(const XML::XNode& node) + { + fromXML(node); + } + + + const Camera& Camera::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Camera::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_prst = element.attribute("prst").value(); + m_rot = element.element("rot"); + } + + + const XML::XNode Camera::toXML() const + { + return + XML::XElement(ns.a + "camera ", + XML::XAttribute("prst", m_prst) + + XML::Write(m_rot) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/Camera.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Camera.h new file mode 100644 index 0000000000..86b28ac052 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Camera.h @@ -0,0 +1,33 @@ +#pragma once +#ifndef OOX_THEME_CAMERA_INCLUDE_H_ +#define OOX_THEME_CAMERA_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "Rot.h" + + +namespace OOX +{ + namespace Theme + { + class Camera : public WritingElement + { + public: + Camera(); + virtual ~Camera(); + explicit Camera(const XML::XNode& node); + const Camera& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + std::string m_prst; + Rot m_rot; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_CAMERA_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/ClrScheme.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/ClrScheme.cpp new file mode 100644 index 0000000000..95437fb5dc --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/ClrScheme.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ClrScheme.h" + + +namespace OOX +{ + namespace Theme + { + + ClrScheme::ClrScheme() + { + } + + + ClrScheme::~ClrScheme() + { + } + + + ClrScheme::ClrScheme(const XML::XNode& node) + { + fromXML(node); + } + + + const ClrScheme& ClrScheme::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void ClrScheme::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + name = element.attribute("name").value(); + XML::Fill(clrSchemeItems, element); + } + + + const XML::XNode ClrScheme::toXML() const + { + return + XML::XElement(ns.a + "clrScheme", + XML::XAttribute("name", name) + + XML::Write(clrSchemeItems) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/ClrScheme.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/ClrScheme.h new file mode 100644 index 0000000000..b258891123 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/ClrScheme.h @@ -0,0 +1,34 @@ +#pragma once +#ifndef OOX_THEME_CLR_SCHEME_INCLUDE_H_ +#define OOX_THEME_CLR_SCHEME_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include +#include "ClrSchemeItem.h" + + +namespace OOX +{ + namespace Theme + { + class ClrScheme : public WritingElement + { + public: + ClrScheme(); + virtual ~ClrScheme(); + explicit ClrScheme(const XML::XNode& node); + const ClrScheme& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property name; + property> clrSchemeItems; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_CLR_SCHEME_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/ClrSchemeItem.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/ClrSchemeItem.cpp new file mode 100644 index 0000000000..89f430305c --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/ClrSchemeItem.cpp @@ -0,0 +1,60 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ClrSchemeItem.h" +#include "SysClr.h" +#include "SrgbClr.h" +#include "./../FormatError.h" + + +namespace OOX +{ + namespace Theme + { + + ClrSchemeItem::ClrSchemeItem() + { + } + + + ClrSchemeItem::~ClrSchemeItem() + { + } + + + ClrSchemeItem::ClrSchemeItem(const XML::XNode& node) + { + fromXML(node); + } + + + const ClrSchemeItem& ClrSchemeItem::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void ClrSchemeItem::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + name = element.XName->Name; + + if (element.element("sysClr").exist()) + item->reset(new SysClr(element.element("sysClr"))); + else if (element.element("srgbClr").exist()) + item->reset(new SrgbClr(element.element("srgbClr"))); + else + throw FormatError("unknow element " + *name); + } + + + const XML::XNode ClrSchemeItem::toXML() const + { + return XML::XElement(ns.a + *name, XML::Write(*item)); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/ClrSchemeItem.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/ClrSchemeItem.h new file mode 100644 index 0000000000..118acec17b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/ClrSchemeItem.h @@ -0,0 +1,33 @@ +#pragma once +#ifndef OOX_THEME_CLR_SCHEME_ITEM_INCLUDE_H_ +#define OOX_THEME_CLR_SCHEME_ITEM_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include + + +namespace OOX +{ + namespace Theme + { + class ClrSchemeItem : public WritingElement + { + public: + ClrSchemeItem(); + virtual ~ClrSchemeItem(); + explicit ClrSchemeItem(const XML::XNode& node); + const ClrSchemeItem& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + property name; + property> item; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_CLR_SCHEME_ITEM_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/EffectLst.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/EffectLst.cpp new file mode 100644 index 0000000000..aa545d857c --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/EffectLst.cpp @@ -0,0 +1,57 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "EffectLst.h" + + +namespace OOX +{ + namespace Theme + { + + EffectLst::EffectLst() + { + } + + + EffectLst::~EffectLst() + { + } + + + EffectLst::EffectLst(const XML::XNode& node) + { + fromXML(node); + } + + + const EffectLst& EffectLst::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void EffectLst::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_outerShdw = element.element("outerShdw"); + m_scene3d = element.element("scene3d"); + m_sp3d = element.element("sp3d"); + } + + + const XML::XNode EffectLst::toXML() const + { + return + XML::XElement(ns.a + "effectLst", + XML::Write(m_outerShdw) + + XML::Write(m_scene3d) + + XML::Write(m_sp3d) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/EffectLst.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/EffectLst.h new file mode 100644 index 0000000000..1b768dc9ac --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/EffectLst.h @@ -0,0 +1,36 @@ +#pragma once +#ifndef OOX_THEME_EFFECT_LST_INCLUDE_H_ +#define OOX_THEME_EFFECT_LST_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "OuterShdw.h" +#include "Scene3d.h" +#include "Sp3d.h" +#include "property.h" + + +namespace OOX +{ + namespace Theme + { + class EffectLst : public WritingElement + { + public: + EffectLst(); + virtual ~EffectLst(); + explicit EffectLst(const XML::XNode& node); + const EffectLst& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + OuterShdw m_outerShdw; + nullable m_scene3d; + nullable m_sp3d; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_EFFECT_LST_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/EffectStyle.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/EffectStyle.cpp new file mode 100644 index 0000000000..200eb7833b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/EffectStyle.cpp @@ -0,0 +1,57 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "EffectStyle.h" + + +namespace OOX +{ + namespace Theme + { + + EffectStyle::EffectStyle() + { + } + + + EffectStyle::~EffectStyle() + { + } + + + EffectStyle::EffectStyle(const XML::XNode& node) + { + fromXML(node); + } + + + const EffectStyle& EffectStyle::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void EffectStyle::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_effestLst = element.element("effectLst"); + m_scene3d = element.element("scene3d"); + m_sp3d = element.element("sp3d"); + } + + + const XML::XNode EffectStyle::toXML() const + { + return + XML::XElement(ns.a + "effectStyle", + XML::Write(m_effestLst) + + XML::Write(m_scene3d) + + XML::Write(m_sp3d) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/EffectStyle.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/EffectStyle.h new file mode 100644 index 0000000000..20e414e78a --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/EffectStyle.h @@ -0,0 +1,36 @@ +#pragma once +#ifndef OOX_THEME_EFFECT_STYLE_INCLUDE_H_ +#define OOX_THEME_EFFECT_STYLE_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "EffectLst.h" +#include "Scene3d.h" +#include "Sp3d.h" +#include "property.h" + + +namespace OOX +{ + namespace Theme + { + class EffectStyle : public WritingElement + { + public: + EffectStyle(); + virtual ~EffectStyle(); + explicit EffectStyle(const XML::XNode& node); + const EffectStyle& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + EffectLst m_effestLst; + nullable m_scene3d; + nullable m_sp3d; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_EFFECT_STYLE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/EffectStyleLst.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/EffectStyleLst.cpp new file mode 100644 index 0000000000..b2e405527d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/EffectStyleLst.cpp @@ -0,0 +1,53 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "EffectStyleLst.h" + + +namespace OOX +{ + namespace Theme + { + + EffectStyleLst::EffectStyleLst() + { + } + + + EffectStyleLst::~EffectStyleLst() + { + } + + + EffectStyleLst::EffectStyleLst(const XML::XNode& node) + { + fromXML(node); + } + + + const EffectStyleLst& EffectStyleLst::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void EffectStyleLst::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + XML::Fill(m_effectStyles, element); + } + + + const XML::XNode EffectStyleLst::toXML() const + { + return + XML::XElement(ns.a + "effectStyleLst", + XML::Write(m_effectStyles) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/EffectStyleLst.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/EffectStyleLst.h new file mode 100644 index 0000000000..f67709ad57 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/EffectStyleLst.h @@ -0,0 +1,32 @@ +#pragma once +#ifndef OOX_THEME_EFFECT_STYLE_LST_INCLUDE_H_ +#define OOX_THEME_EFFECT_STYLE_LST_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "EffectStyle.h" + + +namespace OOX +{ + namespace Theme + { + class EffectStyleLst : public WritingElement + { + public: + EffectStyleLst(); + virtual ~EffectStyleLst(); + explicit EffectStyleLst(const XML::XNode& node); + const EffectStyleLst& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + std::vector m_effectStyles; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_EFFECT_STYLE_LST_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/ExtraClrSchemeLst.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/ExtraClrSchemeLst.cpp new file mode 100644 index 0000000000..0b7ca7efc4 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/ExtraClrSchemeLst.cpp @@ -0,0 +1,49 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ExtraClrSchemeLst.h" + + +namespace OOX +{ + namespace Theme + { + + ExtraClrSchemeLst::ExtraClrSchemeLst() + { + } + + + ExtraClrSchemeLst::~ExtraClrSchemeLst() + { + } + + + ExtraClrSchemeLst::ExtraClrSchemeLst(const XML::XNode& node) + { + fromXML(node); + } + + + const ExtraClrSchemeLst& ExtraClrSchemeLst::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void ExtraClrSchemeLst::fromXML(const XML::XNode& node) + { + } + + + const XML::XNode ExtraClrSchemeLst::toXML() const + { + return + XML::XElement(ns.a + "extraClrSchemeLst"); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/ExtraClrSchemeLst.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/ExtraClrSchemeLst.h new file mode 100644 index 0000000000..29a85826a0 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/ExtraClrSchemeLst.h @@ -0,0 +1,27 @@ +#pragma once +#ifndef OOX_THEME_EXTRA_CLR_SCHEME_LST_INCLUDE_H_ +#define OOX_THEME_EXTRA_CLR_SCHEME_LST_INCLUDE_H_ + +#include "./../WritingElement.h" + + +namespace OOX +{ + namespace Theme + { + class ExtraClrSchemeLst : public WritingElement + { + public: + ExtraClrSchemeLst(); + virtual ~ExtraClrSchemeLst(); + explicit ExtraClrSchemeLst(const XML::XNode& node); + const ExtraClrSchemeLst& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_EXTRA_CLR_SCHEME_LST_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/File.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/File.cpp new file mode 100644 index 0000000000..5e31712057 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/File.cpp @@ -0,0 +1,94 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "File.h" +#include "./../FileTypes.h" + + +namespace OOX +{ + namespace Theme + { + + File::File() + { + } + + + File::File(const boost::filesystem::wpath& filename) + { + read(filename); + } + + + File::~File() + { + } + + + void File::read(const boost::filesystem::wpath& filename) + { + const XML::XDocument document(filename); + name = document.Root.attribute("name").value(); + themeElements = document.Root.element("themeElements"); + objectDefaults = document.Root.element("objectDefaults"); + extraClrSchemeLst = document.Root.element("extraClrSchemeLst"); + } + + + void File::write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const + { + XML::XElement(ns.a + "theme", + XML::XAttribute("name", name) + + XML::Write(themeElements) + + XML::Write(objectDefaults) + + XML::Write(extraClrSchemeLst) + ).Save(filename); + + content.registration(type().OverrideType(), directory, filename); + } + + + const FileType File::type() const + { + return FileTypes::Theme; + } + + + const boost::filesystem::wpath File::DefaultDirectory() const + { + return type().DefaultDirectory(); + } + + + const boost::filesystem::wpath File::DefaultFileName() const + { + return type().DefaultFileName(); + } + + + const std::string File::GetMajorFont() const + { + if (themeElements.is_init() + && themeElements->fontScheme.is_init() + && themeElements->fontScheme->majorFont.is_init()) + return themeElements->fontScheme->majorFont->latin.get_value_or("Times New Roman"); + else + return "Times New Roman"; + } + + + const std::string File::GetMinorFont() const + { + if (themeElements.is_init() + && themeElements->fontScheme.is_init() + && themeElements->fontScheme->minorFont.is_init()) + return themeElements->fontScheme->minorFont->latin.get_value_or("Times New Roman"); + else + return "Times New Roman"; + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/File.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/File.h new file mode 100644 index 0000000000..ff5c14d78e --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/File.h @@ -0,0 +1,44 @@ +#pragma once +#ifndef OOX_THEME_FILE_INCLUDE_H_ +#define OOX_THEME_FILE_INCLUDE_H_ + +#include "./../File.h" +#include "ThemeElements.h" +#include "ObjectDefaults.h" +#include "ExtraClrSchemeLst.h" + + +namespace OOX +{ + namespace Theme + { + class File : public OOX::File + { + public: + File(); + File(const boost::filesystem::wpath& filename); + virtual ~File(); + + public: + virtual void read(const boost::filesystem::wpath& filename); + virtual void write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const; + + public: + virtual const FileType type() const; + virtual const boost::filesystem::wpath DefaultDirectory() const; + virtual const boost::filesystem::wpath DefaultFileName() const; + + public: + const std::string GetMajorFont() const; + const std::string GetMinorFont() const; + + public: + nullable_property name; + nullable_property themeElements; + nullable_property objectDefaults; + nullable_property extraClrSchemeLst; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_FILE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/FillStyleLst.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/FillStyleLst.cpp new file mode 100644 index 0000000000..bd4dcba4cd --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/FillStyleLst.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "FillStyleLst.h" + + +namespace OOX +{ + namespace Theme + { + + FillStyleLst::FillStyleLst() + { + } + + + FillStyleLst::~FillStyleLst() + { + } + + + FillStyleLst::FillStyleLst(const XML::XNode& node) + { + fromXML(node); + } + + + const FillStyleLst& FillStyleLst::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void FillStyleLst::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_solidFill = element.element("solidFill"); + XML::Fill(m_gradFills, element, "gradFill"); + } + + + const XML::XNode FillStyleLst::toXML() const + { + return + XML::XElement(ns.a + "fillStyleLst", + XML::Write(m_solidFill) + + XML::Write(m_gradFills) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/FillStyleLst.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/FillStyleLst.h new file mode 100644 index 0000000000..d794a7bc99 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/FillStyleLst.h @@ -0,0 +1,34 @@ +#pragma once +#ifndef OOX_THEME_FILL_STYLE_LST_INCLUDE_H_ +#define OOX_THEME_FILL_STYLE_LST_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "SolidFill.h" +#include +#include "GradFill.h" + + +namespace OOX +{ + namespace Theme + { + class FillStyleLst : public WritingElement + { + public: + FillStyleLst(); + virtual ~FillStyleLst(); + explicit FillStyleLst(const XML::XNode& node); + const FillStyleLst& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + SolidFill m_solidFill; + std::vector m_gradFills; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_FILL_STYLE_LST_INCLUDE_H_ diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/FillToRect.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/FillToRect.cpp new file mode 100644 index 0000000000..c619bc5814 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/FillToRect.cpp @@ -0,0 +1,59 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "FillToRect.h" + + +namespace OOX +{ + namespace Theme + { + + FillToRect::FillToRect() + { + } + + + FillToRect::~FillToRect() + { + } + + + FillToRect::FillToRect(const XML::XNode& node) + { + fromXML(node); + } + + + const FillToRect& FillToRect::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void FillToRect::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_l = element.attribute("l").value(); + m_t = element.attribute("t").value(); + m_r = element.attribute("r").value(); + m_b = element.attribute("b").value(); + } + + + const XML::XNode FillToRect::toXML() const + { + return + XML::XElement(ns.a + "fillToRect", + XML::XAttribute("l", m_l) + + XML::XAttribute("t", m_t) + + XML::XAttribute("r", m_r) + + XML::XAttribute("b", m_b) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/FillToRect.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/FillToRect.h new file mode 100644 index 0000000000..e740957bb2 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/FillToRect.h @@ -0,0 +1,34 @@ +#pragma once +#ifndef OOX_THEME_FILL_TO_RECT_INCLUDE_H_ +#define OOX_THEME_FILL_TO_RECT_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "nullable.h" + + +namespace OOX +{ + namespace Theme + { + class FillToRect : public WritingElement + { + public: + FillToRect(); + virtual ~FillToRect(); + explicit FillToRect(const XML::XNode& node); + const FillToRect& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + nullable m_l; + nullable m_t; + nullable m_r; + nullable m_b; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_FILL_TO_RECT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/FmtScheme.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/FmtScheme.cpp new file mode 100644 index 0000000000..d2bf4b99c4 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/FmtScheme.cpp @@ -0,0 +1,61 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "FmtScheme.h" + + +namespace OOX +{ + namespace Theme + { + + FmtScheme::FmtScheme() + { + } + + + FmtScheme::~FmtScheme() + { + } + + + FmtScheme::FmtScheme(const XML::XNode& node) + { + fromXML(node); + } + + + const FmtScheme& FmtScheme::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void FmtScheme::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + name = element.attribute("name").value(); + fillStyleLst = element.element("fillStyleLst"); + lnStyleLst = element.element("lnStyleLst"); + effectStyleLst = element.element("effectStyleLst"); + bgFillStyleLst = element.element("bgFillStyleLst"); + } + + + const XML::XNode FmtScheme::toXML() const + { + return + XML::XElement(ns.a + "fmtScheme", + XML::XAttribute("name", name) + + XML::Write(fillStyleLst) + + XML::Write(lnStyleLst) + + XML::Write(effectStyleLst) + + XML::Write(bgFillStyleLst) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/FmtScheme.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/FmtScheme.h new file mode 100644 index 0000000000..51a1d99896 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/FmtScheme.h @@ -0,0 +1,39 @@ +#pragma once +#ifndef OOX_THEME_FMT_SCHEME_INCLUDE_H_ +#define OOX_THEME_FMT_SCHEME_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "FillStyleLst.h" +#include "LnStyleLst.h" +#include "EffectStyleLst.h" +#include "BgFillStyleLst.h" + + +namespace OOX +{ + namespace Theme + { + class FmtScheme : public WritingElement + { + public: + FmtScheme(); + virtual ~FmtScheme(); + explicit FmtScheme(const XML::XNode& node); + const FmtScheme& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property name; + nullable_property fillStyleLst; + nullable_property lnStyleLst; + nullable_property effectStyleLst; + nullable_property bgFillStyleLst; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_FMT_SCHEME_INCLUDE_H_ diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/Font.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Font.cpp new file mode 100644 index 0000000000..f01ab52b6d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Font.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Font.h" + + +namespace OOX +{ + namespace Theme + { + + Font::Font() + { + } + + + Font::~Font() + { + } + + + Font::Font(const XML::XNode& node) + { + fromXML(node); + } + + + const Font& Font::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Font::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_script = element.attribute("script").value(); + m_typeface = element.attribute("typeface").value(); + } + + + const XML::XNode Font::toXML() const + { + return + XML::XElement(ns.a + "font", + XML::XAttribute("script", m_script) + + XML::XAttribute("typeface", m_typeface) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/Font.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Font.h new file mode 100644 index 0000000000..c8c2d2f19b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Font.h @@ -0,0 +1,32 @@ +#pragma once +#ifndef OOX_THEME_FONT_INCLUDE_H_ +#define OOX_THEME_FONT_INCLUDE_H_ + +#include "./../WritingElement.h" +#include + + +namespace OOX +{ + namespace Theme + { + class Font : public WritingElement + { + public: + Font(); + virtual ~Font(); + explicit Font(const XML::XNode& node); + const Font& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + std::string m_script; + std::string m_typeface; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_FONT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/FontScheme.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/FontScheme.cpp new file mode 100644 index 0000000000..3402c1d825 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/FontScheme.cpp @@ -0,0 +1,57 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "FontScheme.h" + + +namespace OOX +{ + namespace Theme + { + + FontScheme::FontScheme() + { + } + + + FontScheme::~FontScheme() + { + } + + + FontScheme::FontScheme(const XML::XNode& node) + { + fromXML(node); + } + + + const FontScheme& FontScheme::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void FontScheme::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + name = element.attribute("name").value(); + majorFont = element.element("majorFont"); + minorFont = element.element("minorFont"); + } + + + const XML::XNode FontScheme::toXML() const + { + return + XML::XElement(ns.a + "fontScheme", + XML::XAttribute("name", name) + + XML::Write(majorFont) + + XML::Write(minorFont) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/FontScheme.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/FontScheme.h new file mode 100644 index 0000000000..653819ecfa --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/FontScheme.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef OOX_THEME_FONT_SCHEME_INCLUDE_H_ +#define OOX_THEME_FONT_SCHEME_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "MajorFont.h" +#include "MinorFont.h" + + +namespace OOX +{ + namespace Theme + { + class FontScheme : public WritingElement + { + public: + FontScheme(); + virtual ~FontScheme(); + explicit FontScheme(const XML::XNode& node); + const FontScheme& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property name; + nullable_property majorFont; + nullable_property minorFont; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_FONT_SCHEME_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/GradFill.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/GradFill.cpp new file mode 100644 index 0000000000..332ce0e6b1 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/GradFill.cpp @@ -0,0 +1,59 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "GradFill.h" + + +namespace OOX +{ + namespace Theme + { + + GradFill::GradFill() + { + } + + + GradFill::~GradFill() + { + } + + + GradFill::GradFill(const XML::XNode& node) + { + fromXML(node); + } + + + const GradFill& GradFill::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void GradFill::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_rotWithShape = element.attribute("rotWithShape").value(); + m_gsLst = element.element("gsLst"); + m_lin = element.element("lin"); + m_path = element.element("path"); + } + + + const XML::XNode GradFill::toXML() const + { + return + XML::XElement(ns.a + "gradFill", + XML::XAttribute("rotWithShape", m_rotWithShape) + + XML::Write(m_gsLst) + + XML::Write(m_lin) + + XML::Write(m_path) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/GradFill.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/GradFill.h new file mode 100644 index 0000000000..4c1e474b6e --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/GradFill.h @@ -0,0 +1,37 @@ +#pragma once +#ifndef OOX_STYLES_GRAD_FILL_INCLUDE_H_ +#define OOX_STYLES_GRAD_FILL_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "GsLst.h" +#include "Lin.h" +#include "Path.h" +#include "property.h" + + +namespace OOX +{ + namespace Theme + { + class GradFill : public WritingElement + { + public: + GradFill(); + virtual ~GradFill(); + explicit GradFill(const XML::XNode& node); + const GradFill& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + int m_rotWithShape; + GsLst m_gsLst; + nullable m_lin; + nullable m_path; + }; + } // namespace Theme +} // OOX + +#endif // OOX_STYLES_GRAD_FILL_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/Gs.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Gs.cpp new file mode 100644 index 0000000000..f74bcd09b9 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Gs.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Gs.h" + + +namespace OOX +{ + namespace Theme + { + + Gs::Gs() + { + } + + + Gs::~Gs() + { + } + + + Gs::Gs(const XML::XNode& node) + { + fromXML(node); + } + + + const Gs& Gs::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Gs::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_pos = element.attribute("pos").value(); + m_schemeClr = element.element("schemeClr"); + } + + + const XML::XNode Gs::toXML() const + { + return + XML::XElement(ns.a + "gs", + XML::XAttribute("pos", m_pos) + + XML::Write(m_schemeClr) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/Gs.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Gs.h new file mode 100644 index 0000000000..32b949fbe9 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Gs.h @@ -0,0 +1,32 @@ +#pragma once +#ifndef OOX_STYLES_GS_INCLUDE_H_ +#define OOX_STYLES_GS_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "SchemeClr.h" + + +namespace OOX +{ + namespace Theme + { + class Gs : public WritingElement + { + public: + Gs(); + virtual ~Gs(); + explicit Gs(const XML::XNode& node); + const Gs& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + int m_pos; + SchemeClr m_schemeClr; + }; + } // namespace Theme +} // OOX + +#endif // OOX_STYLES_GS_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/GsLst.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/GsLst.cpp new file mode 100644 index 0000000000..8e8fef907e --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/GsLst.cpp @@ -0,0 +1,53 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "GsLst.h" + + +namespace OOX +{ + namespace Theme + { + + GsLst::GsLst() + { + } + + + GsLst::~GsLst() + { + } + + + GsLst::GsLst(const XML::XNode& node) + { + fromXML(node); + } + + + const GsLst& GsLst::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void GsLst::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + XML::Fill(m_gss, element); + } + + + const XML::XNode GsLst::toXML() const + { + return + XML::XElement(ns.a + "gsLst", + XML::Write(m_gss) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/GsLst.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/GsLst.h new file mode 100644 index 0000000000..04cdccacf3 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/GsLst.h @@ -0,0 +1,32 @@ +#pragma once +#ifndef OOX_STYLES_GS_LST_INCLUDE_H_ +#define OOX_STYLES_GS_LST_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "Gs.h" + + +namespace OOX +{ + namespace Theme + { + class GsLst : public WritingElement + { + public: + GsLst(); + virtual ~GsLst(); + explicit GsLst(const XML::XNode& node); + const GsLst& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + std::vector m_gss; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_STYLES_GS_LST_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/LightRig.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/LightRig.cpp new file mode 100644 index 0000000000..57beb84046 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/LightRig.cpp @@ -0,0 +1,57 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "LightRig.h" + + +namespace OOX +{ + namespace Theme + { + + LightRig::LightRig() + { + } + + + LightRig::~LightRig() + { + } + + + LightRig::LightRig(const XML::XNode& node) + { + fromXML(node); + } + + + const LightRig& LightRig::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void LightRig::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_rig = element.attribute("rig").value(); + m_dir = element.attribute("dir").value(); + m_rot = element.element("rot"); + } + + + const XML::XNode LightRig::toXML() const + { + return + XML::XElement(ns.a + "lightRig", + XML::XAttribute("rig", m_rig) + + XML::XAttribute("dir", m_dir) + + XML::Write(m_rot) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/LightRig.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/LightRig.h new file mode 100644 index 0000000000..452b3da9eb --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/LightRig.h @@ -0,0 +1,34 @@ +#pragma once +#ifndef OOX_THEME_LIGHT_RIG_INCLUDE_H_ +#define OOX_THEME_LIGHT_RIG_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "Rot.h" + + +namespace OOX +{ + namespace Theme + { + class LightRig : public WritingElement + { + public: + LightRig(); + virtual ~LightRig(); + explicit LightRig(const XML::XNode& node); + const LightRig& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + std::string m_rig; + std::string m_dir; + Rot m_rot; + }; + } // namspace Theme +} // namespace OOX + +#endif // OOX_THEME_LIGHT_RIG_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/Lin.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Lin.cpp new file mode 100644 index 0000000000..e861964fbd --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Lin.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Lin.h" + + +namespace OOX +{ + namespace Theme + { + + Lin::Lin() + { + } + + + Lin::~Lin() + { + } + + + Lin::Lin(const XML::XNode& node) + { + fromXML(node); + } + + + const Lin& Lin::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Lin::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_ang = element.attribute("ang").value(); + m_scaled = element.attribute("scaled").value(); + } + + + const XML::XNode Lin::toXML() const + { + return + XML::XElement(ns.a + "lin", + XML::XAttribute("ang", m_ang) + + XML::XAttribute("scaled", m_scaled) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/Lin.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Lin.h new file mode 100644 index 0000000000..d7b34eb4e3 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Lin.h @@ -0,0 +1,31 @@ +#pragma once +#ifndef OOX_STYLES_LIN_INCLUDE_H_ +#define OOX_STYLES_LIN_INCLUDE_H_ + +#include "./../WritingElement.h" + + +namespace OOX +{ + namespace Theme + { + class Lin : public WritingElement + { + public: + Lin(); + virtual ~Lin(); + explicit Lin(const XML::XNode& node); + const Lin& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + int m_ang; + int m_scaled; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_STYLES_LIN_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/Ln.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Ln.cpp new file mode 100644 index 0000000000..45edc56ce1 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Ln.cpp @@ -0,0 +1,63 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Ln.h" + + +namespace OOX +{ + namespace Theme + { + + Ln::Ln() + { + } + + + Ln::~Ln() + { + } + + + Ln::Ln(const XML::XNode& node) + { + fromXML(node); + } + + + const Ln& Ln::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Ln::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_w = element.attribute("w").value(); + m_cap = element.attribute("cap").value(); + m_cmpd = element.attribute("cmpd").value(); + m_algn = element.attribute("algn").value(); + m_solidFill = element.element("solidFill"); + m_prstDash = element.element("prstDash").attribute("val").value(); + } + + + const XML::XNode Ln::toXML() const + { + return + XML::XElement(ns.a + "ln", + XML::XAttribute("w", m_w) + + XML::XAttribute("cap", m_cap) + + XML::XAttribute("cmpd", m_cmpd) + + XML::XAttribute("algn", m_algn) + + XML::Write(m_solidFill) + + XML::Write(ns.a + "prstDash", "val", m_prstDash) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/Ln.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Ln.h new file mode 100644 index 0000000000..b47061fbe9 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Ln.h @@ -0,0 +1,37 @@ +#pragma once +#ifndef OOX_THEME_LN_INCLUDE_H_ +#define OOX_THEME_LN_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "SolidFill.h" + + +namespace OOX +{ + namespace Theme + { + class Ln : public WritingElement + { + public: + Ln(); + virtual ~Ln(); + explicit Ln(const XML::XNode& node); + const Ln& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + int m_w; + std::string m_cap; + std::string m_cmpd; + std::string m_algn; + SolidFill m_solidFill; + std::string m_prstDash; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_LN_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/LnStyleLst.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/LnStyleLst.cpp new file mode 100644 index 0000000000..3051a97015 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/LnStyleLst.cpp @@ -0,0 +1,53 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "LnStyleLst.h" + + +namespace OOX +{ + namespace Theme + { + + LnStyleLst::LnStyleLst() + { + } + + + LnStyleLst::~LnStyleLst() + { + } + + + LnStyleLst::LnStyleLst(const XML::XNode& node) + { + fromXML(node); + } + + + const LnStyleLst& LnStyleLst::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void LnStyleLst::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + XML::Fill(m_lns, element); + } + + + const XML::XNode LnStyleLst::toXML() const + { + return + XML::XElement(ns.a + "lnStyleLst", + XML::Write(m_lns) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/LnStyleLst.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/LnStyleLst.h new file mode 100644 index 0000000000..a31d933125 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/LnStyleLst.h @@ -0,0 +1,32 @@ +#pragma once +#ifndef OOX_STYLES_LN_STYLE_LST_INCLUDE_H_ +#define OOX_STYLES_LN_STYLE_LST_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "Ln.h" + + +namespace OOX +{ + namespace Theme + { + class LnStyleLst : public WritingElement + { + public: + LnStyleLst(); + virtual ~LnStyleLst(); + explicit LnStyleLst(const XML::XNode& node); + const LnStyleLst& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + std::vector m_lns; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_STYLES_LN_STYLE_LST_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/MajorFont.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/MajorFont.cpp new file mode 100644 index 0000000000..929bdbdc3f --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/MajorFont.cpp @@ -0,0 +1,59 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "MajorFont.h" + + +namespace OOX +{ + namespace Theme + { + + MajorFont::MajorFont() + { + } + + + MajorFont::~MajorFont() + { + } + + + MajorFont::MajorFont(const XML::XNode& node) + { + fromXML(node); + } + + + const MajorFont& MajorFont::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void MajorFont::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + latin = element.element("latin").attribute("typeface").value(); + ea = element.element("ea").attribute("typeface").value(); + cs = element.element("cs").attribute("typeface").value(); + XML::Fill(fonts, element, "font"); + } + + + const XML::XNode MajorFont::toXML() const + { + return + XML::XElement(ns.a + "majorFont", + XML::XElement(ns.a + "latin", XML::XAttribute("typeface", latin)) + + XML::XElement(ns.a + "ea", XML::XAttribute("typeface", ea)) + + XML::XElement(ns.a + "cs", XML::XAttribute("typeface", cs)) + + XML::Write(fonts) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/MajorFont.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/MajorFont.h new file mode 100644 index 0000000000..a2f46ac844 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/MajorFont.h @@ -0,0 +1,36 @@ +#pragma once +#ifndef OOX_THEME_MAJOR_FONT_INCLUDE_H_ +#define OOX_THEME_MAJOR_FONT_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "Font.h" +#include +#include + + +namespace OOX +{ + namespace Theme + { + class MajorFont : public WritingElement + { + public: + MajorFont(); + virtual ~MajorFont(); + explicit MajorFont(const XML::XNode& node); + const MajorFont& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property latin; + nullable_property ea; + nullable_property cs; + property> fonts; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_MAJOR_FONT_INCLUDE_H \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/MinorFont.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/MinorFont.cpp new file mode 100644 index 0000000000..a30aa3256b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/MinorFont.cpp @@ -0,0 +1,59 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "MinorFont.h" + + +namespace OOX +{ + namespace Theme + { + + MinorFont::MinorFont() + { + } + + + MinorFont::~MinorFont() + { + } + + + MinorFont::MinorFont(const XML::XNode& node) + { + fromXML(node); + } + + + const MinorFont& MinorFont::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void MinorFont::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + latin = element.element("latin").attribute("typeface").value(); + ea = element.element("ea").attribute("typeface").value(); + cs = element.element("cs").attribute("typeface").value(); + XML::Fill(fonts, element, "font"); + } + + + const XML::XNode MinorFont::toXML() const + { + return + XML::XElement(ns.a + "minorFont", + XML::XElement(ns.a + "latin", XML::XAttribute("typeface", latin)) + + XML::XElement(ns.a + "ea", XML::XAttribute("typeface", ea)) + + XML::XElement(ns.a + "cs", XML::XAttribute("typeface", cs)) + + XML::Write(fonts) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/MinorFont.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/MinorFont.h new file mode 100644 index 0000000000..6580e07e58 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/MinorFont.h @@ -0,0 +1,36 @@ +#pragma once +#ifndef OOX_THEME_MINOR_FONT_INCLUDE_H_ +#define OOX_THEME_MINIR_FONT_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "Font.h" +#include +#include + + +namespace OOX +{ + namespace Theme + { + class MinorFont : public WritingElement + { + public: + MinorFont(); + virtual ~MinorFont(); + explicit MinorFont(const XML::XNode& node); + const MinorFont& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property latin; + nullable_property ea; + nullable_property cs; + property> fonts; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_MINOR_FONT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/ObjectDefaults.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/ObjectDefaults.cpp new file mode 100644 index 0000000000..3e795ec91f --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/ObjectDefaults.cpp @@ -0,0 +1,49 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ObjectDefaults.h" + + +namespace OOX +{ + namespace Theme + { + + ObjectDefaults::ObjectDefaults() + { + } + + + ObjectDefaults::~ObjectDefaults() + { + } + + + ObjectDefaults::ObjectDefaults(const XML::XNode& node) + { + fromXML(node); + } + + + const ObjectDefaults& ObjectDefaults::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void ObjectDefaults::fromXML(const XML::XNode& node) + { + } + + + const XML::XNode ObjectDefaults::toXML() const + { + return + XML::XElement(ns.a + "objectDefaults"); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/ObjectDefaults.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/ObjectDefaults.h new file mode 100644 index 0000000000..d8989dc6a1 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/ObjectDefaults.h @@ -0,0 +1,27 @@ +#pragma once +#ifndef OOX_THEME_OBJECT_DEFAULTS_INCLUDE_H_ +#define OOX_THEME_OBJECT_DEFAULTS_INCLUDE_H_ + +#include "./../WritingElement.h" + + +namespace OOX +{ + namespace Theme + { + class ObjectDefaults : public WritingElement + { + public: + ObjectDefaults(); + virtual ~ObjectDefaults(); + explicit ObjectDefaults(const XML::XNode& node); + const ObjectDefaults& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_OBJECT_DEFAULTS_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/OuterShdw.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/OuterShdw.cpp new file mode 100644 index 0000000000..b60b120238 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/OuterShdw.cpp @@ -0,0 +1,62 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "OuterShdw.h" + + +namespace OOX +{ + namespace Theme + { + + OuterShdw::OuterShdw() + { + } + + + OuterShdw::~OuterShdw() + { + } + + + OuterShdw::OuterShdw(const XML::XNode& node) + { + fromXML(node); + } + + + const OuterShdw& OuterShdw::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void OuterShdw::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_blurRad = element.attribute("blurRad").value(); + m_dist = element.attribute("dist").value(); + m_dir = element.attribute("dir").value(); + m_rotWithShare = element.attribute("rotWithShape").value(); + m_srgbClr = element.element("srgbClr"); + + } + + + const XML::XNode OuterShdw::toXML() const + { + return + XML::XElement(ns.a + "outerShdw", + XML::XAttribute("blurRad", m_blurRad) + + XML::XAttribute("dist", m_dist) + + XML::XAttribute("dir", m_dir) + + XML::XAttribute("rotWithShape", m_rotWithShare) + + XML::Write(m_srgbClr) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/OuterShdw.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/OuterShdw.h new file mode 100644 index 0000000000..c515301dd4 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/OuterShdw.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef OOX_THEME_OUTER_SHDW_INCLUDE_H_ +#define OOX_THEME_OUTER_SHDW_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "SrgbClr.h" + + +namespace OOX +{ + namespace Theme + { + class OuterShdw : public WritingElement + { + public: + OuterShdw(); + virtual ~OuterShdw(); + explicit OuterShdw(const XML::XNode& node); + const OuterShdw& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + int m_blurRad; + int m_dist; + int m_dir; + int m_rotWithShare; + SrgbClr m_srgbClr; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_OUTER_SHDW_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/Path.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Path.cpp new file mode 100644 index 0000000000..b84dcee08b --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Path.cpp @@ -0,0 +1,57 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Path.h" + + +namespace OOX +{ + namespace Theme + { + + Path::Path() + { + } + + + Path::~Path() + { + } + + + Path::Path(const XML::XNode& node) + { + fromXML(node); + } + + + const Path& Path::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Path::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_path = element.attribute("path").value(); + + if (element.element("fillToRect").exist()) + m_fillToRect = element.element("fillToRect"); + } + + + const XML::XNode Path::toXML() const + { + return + XML::XElement(ns.a + "path", + XML::XAttribute("path", m_path) + + XML::Write(m_fillToRect) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/Path.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Path.h new file mode 100644 index 0000000000..8cb747f0cb --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Path.h @@ -0,0 +1,34 @@ +#pragma once +#ifndef OOX_THEME_PATH_INCLUDE_H_ +#define OOX_THEME_PATH_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "FillToRect.h" +#include "nullable.h" +#include + + +namespace OOX +{ + namespace Theme + { + class Path : public WritingElement + { + public: + Path(); + virtual ~Path(); + explicit Path(const XML::XNode& node); + const Path& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + std::string m_path; + nullable m_fillToRect; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_PATH_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/Rot.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Rot.cpp new file mode 100644 index 0000000000..aa1173c531 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Rot.cpp @@ -0,0 +1,57 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Rot.h" + + +namespace OOX +{ + namespace Theme + { + + Rot::Rot() + { + } + + + Rot::~Rot() + { + } + + + Rot::Rot(const XML::XNode& node) + { + fromXML(node); + } + + + const Rot& Rot::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Rot::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_lat = element.attribute("lat").value(); + m_lon = element.attribute("lon").value(); + m_rev = element.attribute("rev").value(); + } + + + const XML::XNode Rot::toXML() const + { + return + XML::XElement(ns.a + "rot", + XML::XAttribute("lat", m_lat) + + XML::XAttribute("lon", m_lon) + + XML::XAttribute("rev", m_rev) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/Rot.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Rot.h new file mode 100644 index 0000000000..557e9483c8 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Rot.h @@ -0,0 +1,32 @@ +#pragma once +#ifndef OOX_THEME_ROT_INCLUDE_H_ +#define OOX_THEME_ROT_INCLUDE_H_ + +#include "./../WritingElement.h" + + +namespace OOX +{ + namespace Theme + { + class Rot : public WritingElement + { + public: + Rot(); + virtual ~Rot(); + explicit Rot(const XML::XNode& node); + const Rot& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + int m_lat; + int m_lon; + int m_rev; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_ROT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/Scene3d.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Scene3d.cpp new file mode 100644 index 0000000000..7732a993d7 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Scene3d.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Scene3d.h" + + +namespace OOX +{ + namespace Theme + { + + Scene3d::Scene3d() + { + } + + + Scene3d::~Scene3d() + { + } + + + Scene3d::Scene3d(const XML::XNode& node) + { + fromXML(node); + } + + + const Scene3d& Scene3d::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Scene3d::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_camera = element.element("camera"); + m_lightRig = element.element("lightRig"); + } + + + const XML::XNode Scene3d::toXML() const + { + return + XML::XElement(ns.a + "scene3d", + XML::Write(m_camera) + + XML::Write(m_lightRig) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/Scene3d.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Scene3d.h new file mode 100644 index 0000000000..5c1a7d949e --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Scene3d.h @@ -0,0 +1,33 @@ +#pragma once +#ifndef OOX_THEME_SCENE3D_INCLUDE_H_ +#define OOX_THEME_SCENE3D_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "Camera.h" +#include "LightRig.h" + + +namespace OOX +{ + namespace Theme + { + class Scene3d : public WritingElement + { + public: + Scene3d(); + virtual ~Scene3d(); + explicit Scene3d(const XML::XNode& node); + const Scene3d& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + Camera m_camera; + LightRig m_lightRig; + }; + } // namespace Theme +} // namespace OOXFileTheme + +#endif // OOX_THEME_SCENE3D_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/SchemeClr.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/SchemeClr.cpp new file mode 100644 index 0000000000..1ae63d88cc --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/SchemeClr.cpp @@ -0,0 +1,59 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "SchemeClr.h" + + +namespace OOX +{ + namespace Theme + { + + SchemeClr::SchemeClr() + { + } + + + SchemeClr::~SchemeClr() + { + } + + + SchemeClr::SchemeClr(const XML::XNode& node) + { + fromXML(node); + } + + + const SchemeClr& SchemeClr::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void SchemeClr::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_value = element.attribute("val").value(); + m_tint = element.element("tint").attribute("val").value(); + m_shade = element.element("shade").attribute("val").value(); + m_satMod = element.element("satMod").attribute("val").value(); + } + + + const XML::XNode SchemeClr::toXML() const + { + return + XML::XElement(ns.a + "schemeClr", + XML::XAttribute("val", m_value) + + XML::Write(ns.a + "tint", "val", m_tint) + + XML::Write(ns.a + "shade", "val", m_shade) + + XML::Write(ns.a + "satMod", "val", m_satMod) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/SchemeClr.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/SchemeClr.h new file mode 100644 index 0000000000..1be35563c4 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/SchemeClr.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef OOX_THEME_SCHEME_CLR_INCLUDE_H_ +#define OOX_THEME_SCHEME_CLR_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "nullable.h" + + +namespace OOX +{ + namespace Theme + { + class SchemeClr : public WritingElement + { + public: + SchemeClr(); + virtual ~SchemeClr(); + explicit SchemeClr(const XML::XNode& node); + const SchemeClr& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + std::string m_value; + nullable m_tint; + nullable m_shade; + nullable m_satMod; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_SCHEME_CLR_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/SolidFill.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/SolidFill.cpp new file mode 100644 index 0000000000..fa6f7b1aed --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/SolidFill.cpp @@ -0,0 +1,53 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "SolidFill.h" + + +namespace OOX +{ + namespace Theme + { + + SolidFill::SolidFill() + { + } + + + SolidFill::~SolidFill() + { + } + + + SolidFill::SolidFill(const XML::XNode& node) + { + fromXML(node); + } + + + const SolidFill& SolidFill::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void SolidFill::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_schemeClr = element.element("schemeClr"); + } + + + const XML::XNode SolidFill::toXML() const + { + return + XML::XElement(ns.a + "solidFill", + XML::Write(m_schemeClr) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/SolidFill.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/SolidFill.h new file mode 100644 index 0000000000..9bd09819e9 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/SolidFill.h @@ -0,0 +1,31 @@ +#pragma once +#ifndef OOX_STYLES_SOLID_FILL_INCLUDE_H_ +#define OOX_STYLES_SOLID_FILL_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "SchemeClr.h" + + +namespace OOX +{ + namespace Theme + { + class SolidFill : public WritingElement + { + public: + SolidFill(); + virtual ~SolidFill(); + explicit SolidFill(const XML::XNode& node); + const SolidFill& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + SchemeClr m_schemeClr; + }; + } // namespace Theme +} // OOX + +#endif // OOX_STYLES_SOLID_FILL_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/Sp3d.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Sp3d.cpp new file mode 100644 index 0000000000..4ab07e40bd --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Sp3d.cpp @@ -0,0 +1,53 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "Sp3d.h" + + +namespace OOX +{ + namespace Theme + { + + Sp3d::Sp3d() + { + } + + + Sp3d::~Sp3d() + { + } + + + Sp3d::Sp3d(const XML::XNode& node) + { + fromXML(node); + } + + + const Sp3d& Sp3d::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void Sp3d::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_bevelT = element.element("bevelT"); + } + + + const XML::XNode Sp3d::toXML() const + { + return + XML::XElement(ns.a + "sp3d", + XML::Write(m_bevelT) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/Sp3d.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Sp3d.h new file mode 100644 index 0000000000..547716858c --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/Sp3d.h @@ -0,0 +1,31 @@ +#pragma once +#ifndef OOX_THEME_SP3D_INCLUDE_H_ +#define OOX_THEME_SP3D_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "BevelT.h" + + +namespace OOX +{ + namespace Theme + { + class Sp3d : public WritingElement + { + public: + Sp3d(); + virtual ~Sp3d(); + explicit Sp3d(const XML::XNode& node); + const Sp3d& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + BevelT m_bevelT; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_SP3D_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/SrgbClr.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/SrgbClr.cpp new file mode 100644 index 0000000000..012e6d0a03 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/SrgbClr.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "SrgbClr.h" + + +namespace OOX +{ + namespace Theme + { + + SrgbClr::SrgbClr() + { + } + + + SrgbClr::~SrgbClr() + { + } + + + SrgbClr::SrgbClr(const XML::XNode& node) + { + fromXML(node); + } + + + const SrgbClr& SrgbClr::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void SrgbClr::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_value = element.attribute("val").value(); + m_alpha = element.element("alpha").attribute("val").value(); + } + + + const XML::XNode SrgbClr::toXML() const + { + return + XML::XElement(ns.a + "srgbClr", + XML::XAttribute("val", m_value) + + XML::Write(ns.a + "alpha", "val", m_alpha) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/SrgbClr.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/SrgbClr.h new file mode 100644 index 0000000000..787819596e --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/SrgbClr.h @@ -0,0 +1,33 @@ +#pragma once +#ifndef OOX_THEME_SRGBCLR_INCLUDE_H_ +#define OOX_THEME_SRGBCLR_INCLUDE_H_ + +#include "./../WritingElement.h" +#include +#include "nullable.h" + + +namespace OOX +{ + namespace Theme + { + class SrgbClr : public WritingElement + { + public: + SrgbClr(); + virtual ~SrgbClr(); + explicit SrgbClr(const XML::XNode& node); + const SrgbClr& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + std::string m_value; + nullable m_alpha; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_SRGBCLR_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/SysClr.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/SysClr.cpp new file mode 100644 index 0000000000..cb05889ad8 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/SysClr.cpp @@ -0,0 +1,55 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "SysClr.h" + + +namespace OOX +{ + namespace Theme + { + + SysClr::SysClr() + { + } + + + SysClr::~SysClr() + { + } + + + SysClr::SysClr(const XML::XNode& node) + { + fromXML(node); + } + + + const SysClr& SysClr::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void SysClr::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + m_value = element.attribute("val").value(); + m_lastClr = element.attribute("lastClr").value(); + } + + + const XML::XNode SysClr::toXML() const + { + return + XML::XElement(ns.a + "sysClr", + XML::XAttribute("val", m_value) + + XML::XAttribute("lastClr", m_lastClr) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/SysClr.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/SysClr.h new file mode 100644 index 0000000000..79f9e8cc4f --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/SysClr.h @@ -0,0 +1,32 @@ +#pragma once +#ifndef OOX_THEME_SYSCLR_INCLUDE_H_ +#define OOX_THEME_SYSCLR_INCLUDE_H_ + +#include "./../WritingElement.h" +#include + + +namespace OOX +{ + namespace Theme + { + class SysClr : public WritingElement + { + public: + SysClr(); + virtual ~SysClr(); + explicit SysClr(const XML::XNode& node); + const SysClr& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + private: + std::string m_value; + std::string m_lastClr; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_SYSCLR_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/ThemeElements.cpp b/ASCOfficeOdtFile/Source/DocxFormat/Theme/ThemeElements.cpp new file mode 100644 index 0000000000..5683f5ba0d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/ThemeElements.cpp @@ -0,0 +1,57 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "ThemeElements.h" + + +namespace OOX +{ + namespace Theme + { + + ThemeElements::ThemeElements() + { + } + + + ThemeElements::~ThemeElements() + { + } + + + ThemeElements::ThemeElements(const XML::XNode& node) + { + fromXML(node); + } + + + const ThemeElements& ThemeElements::operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + + void ThemeElements::fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + clrScheme = element.element("clrScheme"); + fontScheme = element.element("fontScheme"); + fmtScheme = element.element("fmtScheme"); + } + + + const XML::XNode ThemeElements::toXML() const + { + return + XML::XElement(ns.a + "themeElements", + XML::Write(clrScheme) + + XML::Write(fontScheme) + + XML::Write(fmtScheme) + ); + } + + } // namespace Theme +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Theme/ThemeElements.h b/ASCOfficeOdtFile/Source/DocxFormat/Theme/ThemeElements.h new file mode 100644 index 0000000000..54a261e2dc --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Theme/ThemeElements.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef OOX_THEME_THEME_ELEMENTS_INCLUDE_H_ +#define OOX_THEME_THEME_ELEMENTS_INCLUDE_H_ + +#include "./../WritingElement.h" +#include "ClrScheme.h" +#include "FontScheme.h" +#include "FmtScheme.h" + + +namespace OOX +{ + namespace Theme + { + class ThemeElements : public WritingElement + { + public: + ThemeElements(); + virtual ~ThemeElements(); + explicit ThemeElements(const XML::XNode& node); + const ThemeElements& operator =(const XML::XNode& node); + + public: + virtual void fromXML(const XML::XNode& node); + virtual const XML::XNode toXML() const; + + public: + nullable_property clrScheme; + nullable_property fontScheme; + nullable_property fmtScheme; + }; + } // namespace Theme +} // namespace OOX + +#endif // OOX_THEME_THEME_ELEMENTS_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/Unit.h b/ASCOfficeOdtFile/Source/DocxFormat/Unit.h new file mode 100644 index 0000000000..0e3d26b3ef --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/Unit.h @@ -0,0 +1,17 @@ +#pragma once +#ifndef OOX_UNIT_INCLUDE_H_ +#define OOX_UNIT_INCLUDE_H_ + +#include "Utility.h" + +namespace OOX +{ + typedef Unit UnitCm; + typedef Unit UnitPt; + typedef Unit UnitDx; + typedef Unit UnitSx; + typedef Unit UnitPercent; + +} // namespace OOX + +#endif // OOX_UNIT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/UnknowTypeFile.cpp b/ASCOfficeOdtFile/Source/DocxFormat/UnknowTypeFile.cpp new file mode 100644 index 0000000000..bb3a678b5d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/UnknowTypeFile.cpp @@ -0,0 +1,50 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "UnknowTypeFile.h" +#include "FileTypes.h" + + +namespace OOX +{ + + UnknowTypeFile::UnknowTypeFile() + { + } + + + UnknowTypeFile::~UnknowTypeFile() + { + } + + + void UnknowTypeFile::read(const boost::filesystem::wpath& filename) + { + } + + + void UnknowTypeFile::write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const + { + } + + + const FileType UnknowTypeFile::type() const + { + return FileTypes::Unknow; + } + + + const boost::filesystem::wpath UnknowTypeFile::DefaultDirectory() const + { + return type().DefaultDirectory(); + } + + + const boost::filesystem::wpath UnknowTypeFile::DefaultFileName() const + { + return type().DefaultFileName(); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/UnknowTypeFile.h b/ASCOfficeOdtFile/Source/DocxFormat/UnknowTypeFile.h new file mode 100644 index 0000000000..c0b2d20fab --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/UnknowTypeFile.h @@ -0,0 +1,27 @@ +#pragma once +#ifndef OOX_UNKNOW_TYPE_FILE_INCLUDE_H_ +#define OOX_UNKNOW_TYPE_FILE_INCLUDE_H_ + +#include "File.h" + + +namespace OOX +{ + class UnknowTypeFile : public File + { + public: + UnknowTypeFile(); + virtual ~UnknowTypeFile(); + + public: + virtual void read(const boost::filesystem::wpath& filename); + virtual void write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const; + + public: + virtual const FileType type() const; + virtual const boost::filesystem::wpath DefaultDirectory() const; + virtual const boost::filesystem::wpath DefaultFileName() const; + }; +} // namespace OOX + +#endif // OOX_UNKNOW_TYPE_FILE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/WebSettings.cpp b/ASCOfficeOdtFile/Source/DocxFormat/WebSettings.cpp new file mode 100644 index 0000000000..d303553ee2 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/WebSettings.cpp @@ -0,0 +1,61 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "WebSettings.h" +#include "FileTypes.h" + + +namespace OOX +{ + + WebSettings::WebSettings() + { + } + + + WebSettings::WebSettings(const boost::filesystem::wpath& filename) + { + read(filename); + } + + + WebSettings::~WebSettings() + { + } + + + void WebSettings::read(const boost::filesystem::wpath& filename) + { + } + + + void WebSettings::write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const + { + XML::XElement(ns.w + "webSettings", + XML::XElement(ns.w + "optimizeForBrowser") + ).Save(filename); + + content.registration(type().OverrideType(), directory, filename); + } + + + const FileType WebSettings::type() const + { + return FileTypes::WebSetting; + } + + + const boost::filesystem::wpath WebSettings::DefaultDirectory() const + { + return type().DefaultDirectory(); + } + + + const boost::filesystem::wpath WebSettings::DefaultFileName() const + { + return type().DefaultFileName(); + } + +} // namespace OOX \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/WebSettings.h b/ASCOfficeOdtFile/Source/DocxFormat/WebSettings.h new file mode 100644 index 0000000000..21f9bbc2c6 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/WebSettings.h @@ -0,0 +1,28 @@ +#pragma once +#ifndef OOX_WEBSETTINGS_INCLUDE_H_ +#define OOX_WEBSETTINGS_INCLUDE_H_ + +#include "File.h" + + +namespace OOX +{ + class WebSettings : public OOX::File + { + public: + WebSettings(); + WebSettings(const boost::filesystem::wpath& filename); + virtual ~WebSettings(); + + public: + virtual void read(const boost::filesystem::wpath& filename); + virtual void write(const boost::filesystem::wpath& filename, const boost::filesystem::wpath& directory, ContentTypes::File& content) const; + + public: + virtual const FileType type() const; + virtual const boost::filesystem::wpath DefaultDirectory() const; + virtual const boost::filesystem::wpath DefaultFileName() const; + }; +} // namespace OOX + +#endif // OOX_WEBSETTING_INCLDUE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/WritingElement.h b/ASCOfficeOdtFile/Source/DocxFormat/WritingElement.h new file mode 100644 index 0000000000..4307a9295d --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/WritingElement.h @@ -0,0 +1,31 @@ +#pragma once +#ifndef OOX_WRITING_ELEMENT_INCLUDE_H_ +#define OOX_WRITING_ELEMENT_INCLUDE_H_ + +#include "NamespaceOwn.h" +#include "XML.h" + +namespace OOX +{ + class WritingElement : public NamespaceOwn, public XML::XObject + { + public: + WritingElement(){}; + virtual ~WritingElement() = 0 {}; + }; + + class NullElement : public WritingElement + { + public: + NullElement() {} + virtual ~NullElement() {} + explicit NullElement(const XML::XNode& node) { fromXML(node); } + const NullElement& operator =(const XML::XNode& node) { return *this; } + public: + virtual void fromXML(const XML::XNode& node) {} + virtual const XML::XNode toXML() const { return XML::XElement(); } + }; + +} // namespace OOX + +#endif // OOX_WRITING_ELEMENT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/WritingVector.h b/ASCOfficeOdtFile/Source/DocxFormat/WritingVector.h new file mode 100644 index 0000000000..f5b0dad13c --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/WritingVector.h @@ -0,0 +1,42 @@ +#pragma once +#ifndef OOX_WRITING_VECTOR_INCLUDE_H_ +#define OOX_WRITING_VECTOR_INCLUDE_H_ + +#include "WritingElement.h" +#include "IEnumerable.h" + + +namespace OOX +{ + template + class WritingVector : public WritingElement, public IEnumerable + { + public: + WritingVector() {} + virtual ~WritingVector() {} + explicit WritingVector(const XML::XNode& node) + { + fromXML(node); + } + + const WritingVector& operator =(const XML::XNode& node) + { + fromXML(node); + return *this; + } + + public: + virtual void fromXML(const XML::XNode& node) + { + const XML::XElement element(node); + XML::Fill(m_items, element); + } + + virtual const XML::XNode toXML() const + { + return XML::Write(m_items); + } + }; +} // namespace OOX + +#endif // OOX_WRITING_VECTOR_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/precompiled_docxformat.cpp b/ASCOfficeOdtFile/Source/DocxFormat/precompiled_docxformat.cpp new file mode 100644 index 0000000000..b8f3017532 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/precompiled_docxformat.cpp @@ -0,0 +1,6 @@ + +// auto inserted precompiled begin +#include "precompiled_docxformat.h" +// auto inserted precompiled end + +#include "precompiled_docxformat.h" \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/DocxFormat/precompiled_docxformat.h b/ASCOfficeOdtFile/Source/DocxFormat/precompiled_docxformat.h new file mode 100644 index 0000000000..5b9198b677 --- /dev/null +++ b/ASCOfficeOdtFile/Source/DocxFormat/precompiled_docxformat.h @@ -0,0 +1,22 @@ +#pragma once + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "Utility.h" +#include "Log.h" +#include "XML.h" +#include "property.h" +#include "nullable.h" +#include "ToString.h" +#include "nullable_property.h" +#include "setter.h" +#include "getter.h" +#include "Common.h" \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/OdtFormat/precompiled_odtformat.cpp b/ASCOfficeOdtFile/Source/OdtFormat/precompiled_odtformat.cpp index 2a815c967a..49cc6f69f4 100644 --- a/ASCOfficeOdtFile/Source/OdtFormat/precompiled_odtformat.cpp +++ b/ASCOfficeOdtFile/Source/OdtFormat/precompiled_odtformat.cpp @@ -1,6 +1,6 @@ // auto inserted precompiled begin -#include "precompiled_odtformat.h" +//#include "precompiled_odtformat.h" // auto inserted precompiled end #include "precompiled_odtformat.h" \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/ASCStlUtils.h b/ASCOfficeOdtFile/Source/Utility/ASCStlUtils.h new file mode 100644 index 0000000000..2c72f5af0a --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/ASCStlUtils.h @@ -0,0 +1,106 @@ +#pragma once + +#ifndef ASC_STL_UTILS_INCLUDE_H_ +#define ASC_STL_UTILS_INCLUDE_H_ + +#include +#include +#include +#include + +namespace StlUtils +{ + static inline std::wstring ReplaceString(std::wstring subject, const std::wstring& search, const std::wstring& replace) + { + size_t pos = 0; + + while ((pos = subject.find(search, pos)) != std::string::npos) + { + subject.replace(pos, search.length(), replace); + pos += replace.length(); + } + + return subject; + } + + static inline std::string ReplaceString(std::string subject, const std::string& search, const std::string& replace) + { + size_t pos = 0; + + while ((pos = subject.find(search, pos)) != std::string::npos) + { + subject.replace(pos, search.length(), replace); + pos += replace.length(); + } + + return subject; + } + + static inline std::vector& Split(const std::string& s, char delim, std::vector& elems) + { + std::stringstream ss(s); + std::string item; + + while (std::getline(ss, item, delim)) + elems.push_back(item); + + return elems; + } + + static inline bool SplitStrings(std::vector& elems, const std::string& s, char delim) + { + StlUtils::Split(s, delim, elems); + return (0 != elems.size()); + } + + // + static inline std::wstring IntToWideString(int value, int radix = 10) + { + wchar_t strValue[256]; + _itow_s(value, strValue, 256, radix); + return std::wstring(strValue); + } + + static inline std::wstring DoubleToWideString(double value) + { + wchar_t strValue[256]; + swprintf_s(strValue, 256, L"%f", value); + return std::wstring(strValue); + } + + static inline std::string IntToString(int value, int radix = 10) + { + char strValue[256]; + _itoa_s(value, strValue, 256, radix); + return std::string(strValue); + } + + static inline std::string DoubleToString(double value) + { + char strValue[256]; + sprintf_s(strValue, 256, "%f", value); + return std::string(strValue); + } + + static int ToInteger(const std::string& strValue) + { + return atoi(strValue.c_str()); + } + + static int ToInteger(const std::wstring& strValue) + { + return _wtoi(strValue.c_str()); + } + + static double ToDouble(const std::string& strValue) + { + return atof(strValue.c_str()); + } + + static double ToDouble(const std::wstring& strValue) + { + return _wtof(strValue.c_str()); + } +} + +#endif // ASC_STL_UTILS_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/DateTime.cpp b/ASCOfficeOdtFile/Source/Utility/DateTime.cpp new file mode 100644 index 0000000000..6111c91992 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/DateTime.cpp @@ -0,0 +1,74 @@ + +// auto inserted precompiled begin +#include "precompiled_utility.h" +// auto inserted precompiled end + +#include "DateTime.h" +#include +#include +#include "time.h" +#include +#include + + +DateTime::DateTime() +{ + time_t now; + tm local; + time(&now); + localtime_s(&local, &now); + + m_year = local.tm_year + 1900; + m_month = local.tm_mon + 1; + m_day = local.tm_mday; + m_hour = local.tm_hour; + m_minute = local.tm_min; + m_second = local.tm_sec; + m_millisecond = 0; +} + + +DateTime::DateTime(const std::string& value, const std::string& pattern) + : + m_year (ParseValue(value, pattern, "%YYYY")), + m_month (ParseValue(value, pattern, "%MM")), + m_day (ParseValue(value, pattern, "%DD")), + m_hour (ParseValue(value, pattern, "%hh")), + m_minute (ParseValue(value, pattern, "%mm")), + m_second (ParseValue(value, pattern, "%ss")), + m_millisecond (ParseValue(value, pattern, "%ms")) +{ +} + + +const std::string DateTime::ToString(const std::string& pattern) const +{ + std::string result = pattern; + boost::replace_all(result, "%YYYY", (boost::format("%04d") % m_year).str()); + boost::replace_all(result, "%MM", (boost::format("%02d") % m_month).str()); + boost::replace_all(result, "%DD", (boost::format("%02d") % m_day).str()); + boost::replace_all(result, "%hh", (boost::format("%02d") % m_hour).str()); + boost::replace_all(result, "%mm", (boost::format("%02d") % m_minute).str()); + boost::replace_all(result, "%ss", (boost::format("%02d") % m_second).str()); + boost::replace_all(result, "%ms", (boost::format("%02d") % m_millisecond).str()); + return result; +} + + +const DateTime DateTime::Parse(const std::string& value, const std::string& pattern) +{ + return DateTime(value, pattern); +} + + +const int DateTime::ParseValue(const std::string& value, const std::string& pattern, const std::string& element) +{ + const int pos = pattern.find(element); + if (pos != std::string::npos) + { + const int sepCount = std::count(pattern.begin(), pattern.begin() + pos, '%'); + const std::string numeric = value.substr(pos - sepCount , element.size() - 1); + return boost::lexical_cast(numeric); + } + return 0; +} \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/DateTime.h b/ASCOfficeOdtFile/Source/Utility/DateTime.h new file mode 100644 index 0000000000..c6a8927507 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/DateTime.h @@ -0,0 +1,33 @@ +#pragma once +#ifndef UTILITY_DATE_TIME_INCLUDE_H_ +#define UTILITY_DATE_TIME_INCLUDE_H_ + +#include + + +class DateTime +{ +public: + DateTime(); + DateTime(const std::string& value, const std::string& pattern); + +public: + const std::string ToString(const std::string& pattern) const; + +public: + static const DateTime Parse(const std::string& value, const std::string& pattern); + +private: + static const int ParseValue(const std::string& value, const std::string& pattern, const std::string& element); + +private: + int m_year; + int m_month; + int m_day; + int m_hour; + int m_minute; + int m_second; + int m_millisecond; +}; + +#endif // UTILITY_DATE_TIME_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/Encoding.cpp b/ASCOfficeOdtFile/Source/Utility/Encoding.cpp new file mode 100644 index 0000000000..fae38449b9 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Encoding.cpp @@ -0,0 +1,76 @@ + +// auto inserted precompiled begin +#include "precompiled_utility.h" +// auto inserted precompiled end + +#include "Encoding.h" +#include "windows.h" +#include "Utility.h" +#include + + +const std::string Encoding::ansi2utf8(const std::string& line) +{ + return wstring2string(string2wstring(line, CP_ACP), CP_UTF8); +} + +const std::string Encoding::cp2utf8(const std::string& line, const unsigned int codePage) +{ + return wstring2string(string2wstring(line, codePage), CP_UTF8); +} + +const std::wstring Encoding::ansi2unicode(const std::string& line) +{ + return string2wstring(line, CP_ACP); +} + +const std::wstring Encoding::cp2unicode(const std::string& line, const unsigned int codePage) +{ + return string2wstring(line, codePage); +} + +const std::string Encoding::utf82ansi(const std::string& line) +{ + return wstring2string(string2wstring(line, CP_UTF8), CP_ACP); +} + + +const std::wstring Encoding::utf82unicode(const std::string& line) +{ + return string2wstring(line, CP_UTF8); +} + + +const std::string Encoding::unicode2ansi(const std::wstring& line) +{ + return wstring2string(line, CP_ACP); +} + + +const std::string Encoding::unicode2utf8(const std::wstring& line) +{ + return wstring2string(line, CP_UTF8); +} + + +const std::string Encoding::wstring2string(const std::wstring& wline, const unsigned int codePage) +{ + boost::scoped_array sline(new char[wline.size() * 4]); + const int size = WideCharToMultiByte(codePage, 0, wline.c_str(), wline.size(), sline.get(), wline.size() * 4, NULL, NULL); + return std::string(sline.get(), size); +} + + +const std::wstring Encoding::string2wstring(const std::string& sline, const unsigned int codePage) +{ + boost::scoped_array wline(new wchar_t[sline.size()]); + const int size = MultiByteToWideChar(codePage, 0, sline.c_str(), sline.size(), wline.get(), sline.size()); + return std::wstring(wline.get(), size); +} +const std::wstring Encoding::string2wstring2(const std::string& sline, const unsigned int codePage) +{ + int nBufSize = MultiByteToWideChar(codePage, 0, sline.c_str(), -1, NULL, NULL); + boost::scoped_array wline(new wchar_t[nBufSize]); + MultiByteToWideChar(codePage, 0, sline.c_str(), -1, wline.get(), nBufSize); + return std::wstring(wline.get(), nBufSize-1); +} diff --git a/ASCOfficeOdtFile/Source/Utility/Encoding.h b/ASCOfficeOdtFile/Source/Utility/Encoding.h new file mode 100644 index 0000000000..8094da432a --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Encoding.h @@ -0,0 +1,26 @@ +#pragma once +#ifndef UTILITY_ENCODING_INCLUDE_H_ +#define UTILITY_ENCODING_INCLUDE_H_ + +#include + + +class Encoding +{ +public: + static const std::string ansi2utf8(const std::string& line); + static const std::string cp2utf8(const std::string& line, const unsigned int codePage); + static const std::wstring ansi2unicode(const std::string& line); + static const std::wstring cp2unicode(const std::string& line, const unsigned int codePage); + static const std::string utf82ansi(const std::string& line); + static const std::wstring utf82unicode(const std::string& line); + static const std::string unicode2ansi(const std::wstring& line); + static const std::string unicode2utf8(const std::wstring& line); + +private: + static const std::string wstring2string(const std::wstring& line, const unsigned int codePage); + static const std::wstring string2wstring(const std::string& line, const unsigned int codePage); + static const std::wstring string2wstring2(const std::string& line, const unsigned int codePage); +}; + +#endif // UTILITY_ENCODING_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/Exception/UnitError.cpp b/ASCOfficeOdtFile/Source/Utility/Exception/UnitError.cpp new file mode 100644 index 0000000000..79226fd0b9 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Exception/UnitError.cpp @@ -0,0 +1,12 @@ + +// auto inserted precompiled begin +#include "precompiled_utility.h" +// auto inserted precompiled end + +#include "UnitError.h" + + +UnitError::UnitError(const std::string& message) + : log_invalid_argument(message) +{ +} \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/Exception/UnitError.h b/ASCOfficeOdtFile/Source/Utility/Exception/UnitError.h new file mode 100644 index 0000000000..931a3d2c9f --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Exception/UnitError.h @@ -0,0 +1,15 @@ +#pragma once +#ifndef UNIT_ERROR_INCLUDE_H_ +#define UNIT_ERROR_INCLUDE_H_ + +#include "log_invalid_argument.h" +#include + + +class UnitError : public log_invalid_argument +{ +public: + UnitError(const std::string& message); +}; + +#endif // UNIT_ERROR_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/Exception/log_invalid_argument.cpp b/ASCOfficeOdtFile/Source/Utility/Exception/log_invalid_argument.cpp new file mode 100644 index 0000000000..ab639645d5 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Exception/log_invalid_argument.cpp @@ -0,0 +1,14 @@ + +// auto inserted precompiled begin +#include "precompiled_utility.h" +// auto inserted precompiled end + +#include "log_invalid_argument.h" +#include "./../Log.h" + + +log_invalid_argument::log_invalid_argument(const std::string& message) + : std::invalid_argument(message) +{ + Log::error(message); +} diff --git a/ASCOfficeOdtFile/Source/Utility/Exception/log_invalid_argument.h b/ASCOfficeOdtFile/Source/Utility/Exception/log_invalid_argument.h new file mode 100644 index 0000000000..e1dc21a58b --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Exception/log_invalid_argument.h @@ -0,0 +1,15 @@ +#pragma once +#ifndef LOG_INVALID_ARGUMENT_INCLUDE_H_ +#define LOG_INVALID_ARGUMENT_INCLUDE_H_ + +#include +#include + + +class log_invalid_argument : public std::invalid_argument +{ +public: + explicit log_invalid_argument(const std::string& message); +}; + +#endif // LOG_INVALID_ARGUMENT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/Exception/log_not_find.cpp b/ASCOfficeOdtFile/Source/Utility/Exception/log_not_find.cpp new file mode 100644 index 0000000000..8ce470834a --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Exception/log_not_find.cpp @@ -0,0 +1,12 @@ + +// auto inserted precompiled begin +#include "precompiled_utility.h" +// auto inserted precompiled end + +#include "log_not_find.h" + + +log_not_find::log_not_find(const std::string& what, const std::string& where) +: log_runtime_error("not find " + what + " in " + where) +{ +} \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/Exception/log_not_find.h b/ASCOfficeOdtFile/Source/Utility/Exception/log_not_find.h new file mode 100644 index 0000000000..6440a9c360 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Exception/log_not_find.h @@ -0,0 +1,15 @@ +#pragma once +#ifndef LOG_NOT_FIND_INCLUDE_H_ +#define LOG_NOT_FIND_INCLUDE_H_ + +#include "log_runtime_error.h" +#include + + +class log_not_find : public log_runtime_error +{ +public: + log_not_find(const std::string& what, const std::string& where); +}; + +#endif // LOG_NOT_FIND_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/Exception/log_not_implement.cpp b/ASCOfficeOdtFile/Source/Utility/Exception/log_not_implement.cpp new file mode 100644 index 0000000000..dc774f66e6 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Exception/log_not_implement.cpp @@ -0,0 +1,14 @@ + +// auto inserted precompiled begin +#include "precompiled_utility.h" +// auto inserted precompiled end + +#include "log_not_implement.h" +#include "./../Log.h" + + +log_not_implement::log_not_implement(const std::string& message) + : std::runtime_error(message) +{ + Log::error(message); +} \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/Exception/log_not_implement.h b/ASCOfficeOdtFile/Source/Utility/Exception/log_not_implement.h new file mode 100644 index 0000000000..035aea96ba --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Exception/log_not_implement.h @@ -0,0 +1,15 @@ +#pragma once +#ifndef LOG_NOT_IMPLEMENT_INCLUDE_H_ +#define LOG_NOT_IMPLEMENT_INCLUDE_H_ + +#include +#include + + +class log_not_implement : public std::runtime_error +{ +public: + explicit log_not_implement(const std::string& message); +}; + +#endif // LOG_NOT_IMPLEMENT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/Exception/log_not_init_nullable.cpp b/ASCOfficeOdtFile/Source/Utility/Exception/log_not_init_nullable.cpp new file mode 100644 index 0000000000..02f706fdd3 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Exception/log_not_init_nullable.cpp @@ -0,0 +1,21 @@ + +// auto inserted precompiled begin +#include "precompiled_utility.h" +// auto inserted precompiled end + +#include "log_not_init_nullable.h" +#include "./../Log.h" + + +log_not_init_nullable::log_not_init_nullable() + : std::runtime_error("not_init_nullable") +{ + Log::error("not_init_nullable"); +} + + +log_not_init_nullable::log_not_init_nullable(const std::string& message) + : std::runtime_error(message) +{ + Log::error(message); +} \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/Exception/log_not_init_nullable.h b/ASCOfficeOdtFile/Source/Utility/Exception/log_not_init_nullable.h new file mode 100644 index 0000000000..28ff18a16b --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Exception/log_not_init_nullable.h @@ -0,0 +1,16 @@ +#pragma once +#ifndef LOG_NOT_INIT_NULLABLE_INCLUDE_H_ +#define LOG_NOT_INIT_NULLABLE_INCLUDE_H_ + +#include +#include + + +class log_not_init_nullable : public std::runtime_error +{ +public: + explicit log_not_init_nullable(); + explicit log_not_init_nullable(const std::string& message); +}; + +#endif // LOG_NOT_INIT_NULLABLE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/Exception/log_range_error.cpp b/ASCOfficeOdtFile/Source/Utility/Exception/log_range_error.cpp new file mode 100644 index 0000000000..ffaedda6e5 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Exception/log_range_error.cpp @@ -0,0 +1,21 @@ + +// auto inserted precompiled begin +#include "precompiled_utility.h" +// auto inserted precompiled end + +#include "log_range_error.h" +#include "./../Log.h" + + +log_range_error::log_range_error(const std::string& message) + : std::range_error(message) +{ + Log::error(message); +} + + +log_range_error::log_range_error(const std::wstring& message) + : std::range_error("") +{ + Log::error(message); +} \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/Exception/log_range_error.h b/ASCOfficeOdtFile/Source/Utility/Exception/log_range_error.h new file mode 100644 index 0000000000..c4754c5a00 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Exception/log_range_error.h @@ -0,0 +1,16 @@ +#pragma once +#ifndef LOG_RANGE_ERROR_INCLUDE_H_ +#define LOG_RANGE_ERROR_INCLUDE_H_ + +#include +#include + + +class log_range_error : public std::range_error +{ +public: + explicit log_range_error(const std::string& message); + explicit log_range_error(const std::wstring& message); +}; + +#endif // LOG_RANGE_ERROR_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/Exception/log_runtime_error.cpp b/ASCOfficeOdtFile/Source/Utility/Exception/log_runtime_error.cpp new file mode 100644 index 0000000000..294b1a87b2 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Exception/log_runtime_error.cpp @@ -0,0 +1,14 @@ + +// auto inserted precompiled begin +#include "precompiled_utility.h" +// auto inserted precompiled end + +#include "log_runtime_error.h" +#include "./../Log.h" + + +log_runtime_error::log_runtime_error(const std::string& message) + : std::runtime_error(message) +{ + Log::error(message); +} diff --git a/ASCOfficeOdtFile/Source/Utility/Exception/log_runtime_error.h b/ASCOfficeOdtFile/Source/Utility/Exception/log_runtime_error.h new file mode 100644 index 0000000000..099548ab0f --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Exception/log_runtime_error.h @@ -0,0 +1,15 @@ +#pragma once +#ifndef LOG_RUNTIME_ERROR_INCLUDE_H_ +#define LOG_RUNTIME_ERROR_INCLUDE_H_ + +#include +#include + + +class log_runtime_error : public std::runtime_error +{ +public: + explicit log_runtime_error(const std::string& message); +}; + +#endif // LOG_RUNTIME_ERROR_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/Exception/not_implement.cpp b/ASCOfficeOdtFile/Source/Utility/Exception/not_implement.cpp new file mode 100644 index 0000000000..a41ee7241f --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Exception/not_implement.cpp @@ -0,0 +1,18 @@ + +// auto inserted precompiled begin +#include "precompiled_utility.h" +// auto inserted precompiled end + +#include "not_implement.h" + + +not_implement::not_implement() + : std::runtime_error("") +{ +} + + +not_implement::not_implement(const std::string& message) + : std::runtime_error(message) +{ +} \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/Exception/not_implement.h b/ASCOfficeOdtFile/Source/Utility/Exception/not_implement.h new file mode 100644 index 0000000000..4984e50701 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Exception/not_implement.h @@ -0,0 +1,16 @@ +#pragma once +#ifndef NOT_IMPLEMENT_INCLUDE_H_ +#define NOT_IMPLEMENT_INCLUDE_H_ + +#include +#include + + +class not_implement : public std::runtime_error +{ +public: + not_implement(); + explicit not_implement(const std::string& message); +}; + +#endif // NOT_IMPLEMENT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/Exception/not_init_nullable.cpp b/ASCOfficeOdtFile/Source/Utility/Exception/not_init_nullable.cpp new file mode 100644 index 0000000000..74f5d0676b --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Exception/not_init_nullable.cpp @@ -0,0 +1,18 @@ + +// auto inserted precompiled begin +#include "precompiled_utility.h" +// auto inserted precompiled end + +#include "not_init_nullable.h" + + +not_init_nullable::not_init_nullable() + : std::runtime_error("not_init_nullable") +{ +} + + +not_init_nullable::not_init_nullable(const std::string& message) + : std::runtime_error(message) +{ +} \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/Exception/not_init_nullable.h b/ASCOfficeOdtFile/Source/Utility/Exception/not_init_nullable.h new file mode 100644 index 0000000000..a32538bcd2 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Exception/not_init_nullable.h @@ -0,0 +1,16 @@ +#pragma once +#ifndef NOT_INIT_NULLABLE_INCLUDE_H_ +#define NOT_INIT_NULLABLE_INCLUDE_H_ + +#include +#include + + +class not_init_nullable : public std::runtime_error +{ +public: + explicit not_init_nullable(); + explicit not_init_nullable(const std::string& message); +}; + +#endif // NOT_INIT_NULLABLE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/FileNameUtility.cpp b/ASCOfficeOdtFile/Source/Utility/FileNameUtility.cpp new file mode 100644 index 0000000000..2c03b386a3 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/FileNameUtility.cpp @@ -0,0 +1,57 @@ + +// auto inserted precompiled begin +#include "precompiled_utility.h" +// auto inserted precompiled end + +#include "FileNameUtility.h" +#include "ToString.h" + + +const boost::filesystem::path operator +(boost::filesystem::path filename, const int index) +{ + const std::string extension = filename.extension(); + return filename.replace_extension().string() + ToString(index) + extension; +} + + +const boost::filesystem::wpath operator +(boost::filesystem::wpath filename, const int index) +{ + const std::wstring extension = filename.extension(); + return filename.replace_extension().string() + ToWString(index) + extension; +} + + +const boost::filesystem::wpath replace_extension(const boost::filesystem::wpath& filename, const std::wstring& extension) +{ + boost::filesystem::wpath convert = filename; + convert.replace_extension(extension); + return convert; +} + + +const boost::filesystem::wpath replace_extension(const boost::filesystem::wpath& filename, const std::wstring& old_extension, const std::wstring& new_extension) +{ + if (filename.extension() == L"." + old_extension) + return replace_extension(filename, new_extension); + return filename; +} + +const size_t max_name_index(const boost::filesystem::wpath& path, const std::wstring& filename) +{ + boost::filesystem::wpath file(filename); + size_t index = 1; + while(boost::filesystem::exists(path/(file + index))) + { + index++; + } + + return index; +} + + +const std::wstring max_name(const boost::filesystem::wpath& path, const std::wstring& filename) +{ + boost::filesystem::wpath file(filename); + file = file + max_name_index(path, filename); + return file.string(); +} diff --git a/ASCOfficeOdtFile/Source/Utility/FileNameUtility.h b/ASCOfficeOdtFile/Source/Utility/FileNameUtility.h new file mode 100644 index 0000000000..703f00c683 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/FileNameUtility.h @@ -0,0 +1,18 @@ +#pragma once +#ifndef UTILITY_FILE_NAME_UTILITY_INCLUDE_H_ +#define UTILITY_FILE_NAME_UTILITY_INCLUDE_H_ + +#include +#include + + +const boost::filesystem::path operator +(boost::filesystem::path filename, const int index); +const boost::filesystem::wpath operator +(boost::filesystem::wpath filename, const int index); + +const boost::filesystem::wpath replace_extension(const boost::filesystem::wpath& filename, const std::wstring& extension); +const boost::filesystem::wpath replace_extension(const boost::filesystem::wpath& filename, const std::wstring& old_extension, const std::wstring& new_extension); + +const size_t max_name_index(const boost::filesystem::wpath& path, const std::wstring& filename); +const std::wstring max_name(const boost::filesystem::wpath& path, const std::wstring& filename); + +#endif // UTILITY_FILE_NAME_UTILITY_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/Getter.h b/ASCOfficeOdtFile/Source/Utility/Getter.h new file mode 100644 index 0000000000..378e059fcb --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Getter.h @@ -0,0 +1,47 @@ +#pragma once +#ifndef UTILITY_GETTER_INCLUDE_H_ +#define UTILITY_GETTER_INCLUDE_H_ + +#include +#include + + +namespace getter +{ + template + class base_getter + { + protected: + typedef typename boost::call_traits::param_type Parameter; + public: + const Type operator()(Parameter _value) const + { + must_release(); + } + }; + + + template + class simple : private base_getter + { + public: + const Type operator ()(Parameter _value) const + { + return _value; + } + }; + + + template + class write_only : private base_getter + { + public: + const Type operator()(Parameter _value) const + { + it_is_write_only(); + } + }; + +} // namespace getter + +#endif // UTILITY_GETTER_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/IDictonary.h b/ASCOfficeOdtFile/Source/Utility/IDictonary.h new file mode 100644 index 0000000000..baa90e0035 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/IDictonary.h @@ -0,0 +1,36 @@ +#pragma once +#ifndef IDICTONARY_INCLUDE_H_ +#define IDICTONARY_INCLUDE_H_ + +#include + + +template +class IDictonary +{ +public: + const size_t size() const {return m_container.size();} + void add(const Key& key, const Value& value) {m_container.insert(std::make_pair(key, value));} + const bool empty() const {return m_container.empty();} + +public: + Value& operator [](const Key& key) {return m_container[key];} + const Value& operator [](const Key& key) const {return m_container[key];} + +public: + typedef typename std::map::iterator iterator; + typedef typename std::map::const_iterator const_iterator; + +public: + iterator begin() {return m_container.begin();} + iterator end() {return m_container.end();} + const_iterator begin() const {return m_container.begin();} + const_iterator end() const {return m_container.end();} + iterator find(const Key& key) {return m_container.find(key);} + const_iterator find(const Key& key) const {return m_container.find(key);} + +protected: + std::map m_container; +}; + +#endif // IDICTONARY_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/IEnumerable.h b/ASCOfficeOdtFile/Source/Utility/IEnumerable.h new file mode 100644 index 0000000000..d9e2ce7f18 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/IEnumerable.h @@ -0,0 +1,53 @@ +#pragma once +#ifndef IENUMERABLE_INCLUDE_H_ +#define IENUMERABLE_INCLUDE_H_ + +#include + + +template class Container = std::vector, class Allocator = std::allocator > +class IEnumerable +{ +public: + IEnumerable() {} + ~IEnumerable() {} + +public: + void add(const Type& value) {push_back(value);} + void push_back(const Type& value) {m_items.push_back(value);} + void clear() {m_items.clear();} + const size_t size() const {return m_items.size();} + const bool empty() const {return m_items.empty();} + +public: + typedef typename Container::iterator iterator; + typedef typename Container::const_iterator const_iterator; + +public: + iterator begin() {return m_items.begin();} + iterator end() {return m_items.end();} + const_iterator begin() const {return m_items.begin();} + const_iterator end() const {return m_items.end();} + +protected: + Container m_items; +}; + +namespace Odt +{ + template + _Iter find_if(_Iter iterBegin, _Iter iterEnd, _Pred pred) + { + _Iter iter = std::find_if(iterBegin, iterEnd, pred); + + if (iter < iterBegin || iter >= iterEnd) + { + //assert(false); + return iterBegin; + } + + return iter; + } +} + +#endif // IENUMERABLE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/IItemable.h b/ASCOfficeOdtFile/Source/Utility/IItemable.h new file mode 100644 index 0000000000..51cb4ef15e --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/IItemable.h @@ -0,0 +1,51 @@ +#pragma once +#ifndef IITEMABLE_INCLUDE_H_ +#define IITEMABLE_INCLUDE_H_ + +#include + + +template +class IItemable +{ +public: + IItemable() {}; + IItemable(Item* item) : m_item(item) {}; + ~IItemable() {} + + +public: + template const bool is() const + { + if (m_item == 0) + return false; + return typeid(*m_item) == typeid(T); + } + + template T& as() + { + return static_cast(*m_item); + } + + template const T& as() const + { + return static_cast(*m_item); + } + + +public: + template void create() + { + m_item.reset(new T()); + } + + template void create(const T& value) + { + m_item.reset(new T(value)); + } + +protected: + boost::shared_ptr m_item; +}; + +#endif // IITEMABLE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/Log.cpp b/ASCOfficeOdtFile/Source/Utility/Log.cpp new file mode 100644 index 0000000000..569f0f953f --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Log.cpp @@ -0,0 +1,59 @@ + +// auto inserted precompiled begin +#include "precompiled_utility.h" +// auto inserted precompiled end + +#include "Log.h" +#include +#include + + +Details::Log Log::s_loger("converter.log", "converter.err"); + + +void Log::event(const std::string& message) +{ + s_loger.event(message); +} + + +void Log::event(const std::wstring& message) +{ + s_loger.event(message); +} + + +void Log::warning(const std::string& message) +{ + s_loger.warning(message); +} + + +void Log::warning(const std::wstring& message) +{ + s_loger.warning(message); +} + + +void Log::error(const std::string& message) +{ + s_loger.error(message); +} + + +void Log::error(const std::wstring& message) +{ + s_loger.error(message); +} + + +void Log::message(const std::string& message) +{ + s_loger.message(message); +} + + +void Log::message(const std::wstring& message) +{ + s_loger.message(message); +} \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/Log.h b/ASCOfficeOdtFile/Source/Utility/Log.h new file mode 100644 index 0000000000..b1ccddf295 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Log.h @@ -0,0 +1,25 @@ +#pragma once +#ifndef UTILITY_LOG_INCLUDE_H_ +#define UTILITY_LOG_INCLUDE_H_ + +#include +#include "LogDetails.h" + + +class Log +{ +public: + static void event(const std::string& message); + static void event(const std::wstring& message); + static void message(const std::string& message); + static void message(const std::wstring& message); + static void warning(const std::string& message); + static void warning(const std::wstring& message); + static void error(const std::string& message); + static void error(const std::wstring& message); + +private: + static Details::Log s_loger; +}; + +#endif // UTILITY_LOG_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/LogDetails.cpp b/ASCOfficeOdtFile/Source/Utility/LogDetails.cpp new file mode 100644 index 0000000000..c780cb0eb5 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/LogDetails.cpp @@ -0,0 +1,114 @@ + +// auto inserted precompiled begin +#include "precompiled_utility.h" +// auto inserted precompiled end + +#include "LogDetails.h" +#include +#include "DateTime.h" +#include "assert.h" + + +namespace Details +{ + const std::string Log::s_dtPattern("%hh:%mm:%ss"); + + + Log::Log(const std::string& log_file, const std::string& err_file) +#ifdef _DEBUG + : m_log(log_file.c_str()), + m_err(err_file.c_str()) +#endif + { + } + + + Log::~Log() + { +#ifdef _DEBUG + m_log << std::flush; + m_err << std::flush; + m_log.close(); + m_err.close(); +#endif + } + + + void Log::event(const std::string& message) + { + toLog(" EVENT: " + message); + } + + + void Log::event(const std::wstring& message) + { + toLog(L" EVENT: " + message); + } + + + void Log::message(const std::string& message) + { + toLog(" MESSAGE: " + message); + } + + + void Log::message(const std::wstring& message) + { + toLog(L" MESSAGE: " + message); + } + + + void Log::warning(const std::string& message) + { + toLog(" WARNING: " + message); + } + + + void Log::warning(const std::wstring& message) + { + toLog(L" WARNING: " + message); + } + + + void Log::error(const std::string& message) + { +#ifdef _DEBUG + DateTime dt; + m_log << std::flush; + m_err << dt.ToString(s_dtPattern).c_str() << " ERROR: " << message.c_str() << std::endl; + std::cout << dt.ToString(s_dtPattern) << " ERROR: " << message << std::endl; +#endif + } + + + void Log::error(const std::wstring& message) + { +#ifdef _DEBUG + DateTime dt; + m_log << std::flush; + m_err << dt.ToString(s_dtPattern).c_str() << L" ERROR: " << message << std::endl; + std::wcout << dt.ToString(s_dtPattern).c_str() << L" ERROR: " << message << std::endl; +#endif + } + + + void Log::toLog(const std::string& str) + { +#ifdef _DEBUG + DateTime dt; + m_log << dt.ToString(s_dtPattern).c_str() << str.c_str() << "\n"; + std::cout << dt.ToString(s_dtPattern) << str << std::endl; +#endif + } + + + void Log::toLog(const std::wstring& str) + { +#ifdef _DEBUG + DateTime dt; + m_log << dt.ToString(s_dtPattern).c_str() << str << "\n"; + std::wcout << dt.ToString(s_dtPattern).c_str() << str << std::endl; +#endif + } + +} // namespace Details \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/LogDetails.h b/ASCOfficeOdtFile/Source/Utility/LogDetails.h new file mode 100644 index 0000000000..52a02449e9 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/LogDetails.h @@ -0,0 +1,40 @@ +#pragma once +#ifndef UTILITY_LOG_DETAILS_INCLUDE_H_ +#define UTILITY_LOG_DETAILS_INCLUDE_H_ + +#include +#include + + +namespace Details +{ + class Log + { + public: + Log(const std::string& log_file, const std::string& err_file); + ~Log(); + + public: + void event(const std::string& message); + void event(const std::wstring& message); + void message(const std::string& message); + void message(const std::wstring& message); + void warning(const std::string& message); + void warning(const std::wstring& message); + void error(const std::string& message); + void error(const std::wstring& message); + + private: + std::wofstream m_log; + std::wofstream m_err; + + private: + void toLog(const std::string& str); + void toLog(const std::wstring& str); + + private: + static const std::string s_dtPattern; + }; +} // namespace Details + +#endif // UTILITY_LOG_DETAILS_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/Parse.cpp b/ASCOfficeOdtFile/Source/Utility/Parse.cpp new file mode 100644 index 0000000000..2864a64c0a --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Parse.cpp @@ -0,0 +1,115 @@ + +// auto inserted precompiled begin +#include "precompiled_utility.h" +// auto inserted precompiled end + +#include "Parse.h" +#include "Encoding.h" +#include + + +template<> const bool Parse(const std::string& str) +{ + return str == "true" || str == "1" || str == "t" || str == "on"; +} + + +template<> const int Parse(const std::string& str) +{ + if (str.length() == 0) + return 0; + return boost::lexical_cast(str); +} + + +template<> const size_t Parse(const std::string& str) +{ + return boost::lexical_cast(str); +} + + +template<> const double Parse(const std::string& str) +{ + return boost::lexical_cast(str); +} + + +template<> const std::wstring Parse(const std::string& str) +{ + return Encoding::utf82unicode(str); +} + + +template<> const boost::filesystem::path Parse(const std::string& str) +{ + return str; +} + + +template<> const boost::filesystem::wpath Parse(const std::string& str) +{ + return Encoding::utf82unicode(str); +} + + +template<> const bool Parse(const std::wstring& str) +{ + return str == L"true" || str == L"1" || str == L"t" || str == L"on"; +} + + +template<> const int Parse(const std::wstring& str) +{ + return boost::lexical_cast(str); +} + + +template<> const size_t Parse(const std::wstring& str) +{ + return boost::lexical_cast(str); +} + + +template<> const double Parse(const std::wstring& str) +{ + return boost::lexical_cast(str); +} + + +template<> const std::string Parse(const std::wstring& str) +{ + return Encoding::unicode2utf8(str); +} + + +template<> const boost::filesystem::path Parse(const std::wstring& str) +{ + return Encoding::unicode2utf8(str); +} + + +template<> const boost::filesystem::wpath Parse(const std::wstring& str) +{ + return str; +} + + +const int HexChar2Int(const char value) +{ + if (value >= '0' && value <= '9') + return value - '0'; + if (value >= 'a' && value <= 'f') + return 10 + value - 'a'; + if (value >= 'A' && value <= 'F') + return 10 + value - 'A'; + return 0; +} + +const int HexString2Int(const std::string& value) +{ + int summa = 0; + for (int i = 0; i != value.size(); ++i) + summa += HexChar2Int(value[i]) << (4 * (value.size() - i - 1)); + + return summa; +} \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/Parse.h b/ASCOfficeOdtFile/Source/Utility/Parse.h new file mode 100644 index 0000000000..3ad314624f --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Parse.h @@ -0,0 +1,31 @@ +#pragma once +#ifndef UTILITY_PARSE_INCLUDE_H_ +#define UTILITY_PARSE_INCLUDE_H_ + +#include +#include + + +template const T Parse(const std::string& str) {return str;} +template const T Parse(const std::wstring& str) {return str;} + +template<> const bool Parse(const std::string& str); +template<> const int Parse(const std::string& str); +template<> const size_t Parse(const std::string& str); +template<> const double Parse(const std::string& str); +template<> const std::wstring Parse(const std::string& str); +template<> const boost::filesystem::path Parse(const std::string& str); +template<> const boost::filesystem::wpath Parse(const std::string& str); + +template<> const bool Parse(const std::wstring& str); +template<> const int Parse(const std::wstring& str); +template<> const size_t Parse(const std::wstring& str); +template<> const double Parse(const std::wstring& str); +template<> const std::string Parse(const std::wstring& str); +template<> const boost::filesystem::path Parse(const std::wstring& str); +template<> const boost::filesystem::wpath Parse(const std::wstring& str); + +const int HexChar2Int(const char value); +const int HexString2Int(const std::string& value); + +#endif // UTILITY_PARSE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/Setter.h b/ASCOfficeOdtFile/Source/Utility/Setter.h new file mode 100644 index 0000000000..b938170ad2 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Setter.h @@ -0,0 +1,185 @@ +#pragma once +#ifndef UTILITY_SETTER_INCLUDE_H_ +#define UTILITY_SETTER_INCLUDE_H_ + +#include +#include +#include +#include + + +namespace setter +{ + + template + class base_setter + { + protected: + typedef typename boost::call_traits::param_type Parameter; + public: + void operator()(Type& _value, Parameter value) + { + must_release(); + } + }; + + + class none + { + public: + template + void operator()(T, E) + { + } + }; + + + template + class simple : private base_setter + { + public: + void operator()(Type& _value, Parameter value) + { + _value = value; + } + }; + + + class read_only + { + public: + template + void operator()(T, E) + { + it_is_read_only(); + } + }; + + + template + class only_positive : private base_setter + { + public: + void operator()(Type& _value, Parameter value) + { + _value = value < static_cast(0) ? static_cast(0) : value; + } + }; + + + template + class between : private base_setter + { + public: + void operator()(Type& _value, Parameter value) + { + if (value < min_value) + _value = min_value; + else if (max_value < value) + _value = max_value; + else + _value = value; + } + }; + + + template + class between_throw : private base_setter + { + public: + void operator()(Type& _value, Parameter value) + { + if (value < min_value) + throw std::range_error("between error"); + else if (max_value < value) + throw std::range_error("between error"); + else + _value = value; + } + }; + + + template + class interval : private base_setter + { + public: + interval(Parameter min, Parameter max) + : _min(min), + _max(max) + { + if (_max < _min) + std::swap(_min, _max); + } + + void operator()(Type& _value, Parameter value) + { + if (value < _min) + _value = _min; + else if (_max < value) + _value = _max; + else + _value = value; + } + + private: + Type _min; + Type _max; + }; + + + template + class interval_throw : private base_setter + { + public: + interval_throw(Parameter min, Parameter max) + : _min(min), + _max(max) + { + if (_max < _min) + std::swap(_min, _max); + } + + void operator()(Type& _value, Parameter value) + { + if (value < _min) + throw std::range_error("interval error"); + else if (_max < value) + throw std::range_error("interval error"); + else + _value = value; + } + + private: + Type _min; + Type _max; + }; + + + template + class from : private base_setter + { + protected: + void add(Parameter value) + { + _list.insert(value); + } + + private: + virtual const Type no_find() const = 0; + + public: + void operator()(Type& _value, Parameter value) + { + if (_list.find(value) != _list.end()) + _value = value; + else + _value = no_find(); + } + + private: + std::set _list; + }; + +} // namespace setter + +#endif // UTILITY_SETTER_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/ToString.cpp b/ASCOfficeOdtFile/Source/Utility/ToString.cpp new file mode 100644 index 0000000000..84ea1d7498 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/ToString.cpp @@ -0,0 +1,202 @@ + +// auto inserted precompiled begin +#include "precompiled_utility.h" +// auto inserted precompiled end + +#include "ToString.h" +#include +#include "Encoding.h" +//#include +#include + + +const std::string ToString(const bool value) +{ + if (value) + return "true"; + return "false"; +} + + +const std::wstring ToWString(const bool value) +{ + if (value) + return L"true"; + return L"false"; +} + + +const std::string ToString(const int value) +{ + return boost::lexical_cast(value); +} + + +const std::wstring ToWString(const int value) +{ + return boost::lexical_cast(value); +} + + +const std::string ToString(const size_t value) +{ + return boost::lexical_cast(value); +} + + +const std::string ToString(const std::wstring& value) +{ + return Encoding::unicode2utf8(value); +} + + +const std::string ToString(const wchar_t* value) +{ + return Encoding::unicode2utf8(value); +} + + +const std::string ToString(const boost::filesystem::path& value) +{ + return value.string(); +} + + +const std::string ToString(const boost::filesystem::wpath& value) +{ + return Encoding::unicode2utf8(value.string()); +} + + +const std::wstring ToWString(const size_t value) +{ + return boost::lexical_cast(value); +} + + +const std::string ToString(const double value) +{ + return boost::lexical_cast(value); +} + + +const std::wstring ToWString(const double value) +{ + return boost::lexical_cast(value); +} + + +const std::string ToString(const std::string& value) +{ + return value; +} + + +const std::wstring ToWString(const std::wstring& value) +{ + return value; +} + + +const std::wstring ToWString(const std::string& value) +{ + return Encoding::utf82unicode(value); +} + + +const std::wstring ToWString(const char* value) +{ + return Encoding::utf82unicode(value); +} + + +const std::string ToString(const char* value) +{ + return value; +} + + +const std::wstring ToWString(const wchar_t* value) +{ + return value; +} + + +const std::wstring ToWString(const boost::filesystem::path& value) +{ + return Encoding::utf82unicode(value.string()); +} + + +const std::wstring ToWString(const boost::filesystem::wpath& value) +{ + return value.string(); +} + + +const std::string ToUpper(const char* value) +{ + return ToUpper(ToString(value)); +} + + +const std::string ToUpper(const std::string& value) +{ + std::string result = ""; + result.reserve(value.size()); + for(size_t i = 0; i < value.size(); i++) + result += char(towupper(value[i])); + //boost::to_upper(value); + return result; +} + + +const std::wstring ToUpper(const wchar_t* value) +{ + return ToUpper(ToWString(value)); +} + + +const std::wstring ToUpper(const std::wstring& value) +{ + std::wstring result = L""; + result.reserve(value.size()); + for(size_t i = 0; i < value.size(); i++) + result += wchar_t(towupper(value[i])); + //boost::to_upper(value); + return result; +} + + +const std::string ToLower(const char* value) +{ + return ToLower(ToString(value)); +} + + +const std::string ToLower(std::string value) +{ + std::string result = ""; + result.reserve(value.size()); + for(size_t i = 0; i < value.size(); i++) + result += char(towlower(value[i])); + //boost::to_lower(value); + return result; +} + + +const std::wstring ToLower(const wchar_t* value) +{ + return ToLower(ToWString(value)); +} + + +const std::wstring ToLower(std::wstring value) +{ + std::wstring result = L""; + result.reserve(value.size()); + for(size_t i = 0; i < value.size(); i++) + result += wchar_t(towlower(value[i])); + //boost::to_lower(value); + return result; +} \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/ToString.h b/ASCOfficeOdtFile/Source/Utility/ToString.h new file mode 100644 index 0000000000..670613791f --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/ToString.h @@ -0,0 +1,45 @@ +#pragma once +#ifndef UTILITY_TO_STRING_INCLUDE_H_ +#define UTILITY_TO_STRING_INCLUDE_H_ + +#include +#include + + +const std::string ToString(const bool value); +const std::string ToString(const int value); +const std::string ToString(const size_t value); +const std::string ToString(const double value); +const std::string ToString(const std::string& value); +const std::string ToString(const char* value); +const std::string ToString(const std::wstring& value); +const std::string ToString(const wchar_t* value); +const std::string ToString(const boost::filesystem::path& value); +const std::string ToString(const boost::filesystem::wpath& value); + +const std::wstring ToWString(const bool value); +const std::wstring ToWString(const int value); +const std::wstring ToWString(const size_t value); +const std::wstring ToWString(const double value); +const std::wstring ToWString(const std::string& value); +const std::wstring ToWString(const char* value); +const std::wstring ToWString(const std::wstring& value); +const std::wstring ToWString(const wchar_t* value); +const std::wstring ToWString(const boost::filesystem::path& value); +const std::wstring ToWString(const boost::filesystem::wpath& value); + +template const std::string ToString(const T& value) {return value.ToString();} +template const std::wstring ToWString(const T& value) {return value.ToWString();} + + +const std::string ToUpper(const char* value); +const std::string ToUpper(const std::string& value); +const std::wstring ToUpper(const wchar_t* value); +const std::wstring ToUpper(const std::wstring& value); + +const std::string ToLower(const char* value); +const std::string ToLower(std::string value); +const std::wstring ToLower(const wchar_t* value); +const std::wstring ToLower(std::wstring value); + +#endif // UTILITY_TO_STRING_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/TxtFile.cpp b/ASCOfficeOdtFile/Source/Utility/TxtFile.cpp new file mode 100644 index 0000000000..7bd019d7cf --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/TxtFile.cpp @@ -0,0 +1,346 @@ + +// auto inserted precompiled begin +#include "precompiled_utility.h" +// auto inserted precompiled end + +#include "TxtFile.h" +#include "Encoding.h" +#include "Utility.h" +#include "Exception/log_runtime_error.h" +#include +#include "codecvt.h" +#include +#include + +static const std::string BadSymbols = "\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19"; + +TxtFile::TxtFile(const boost::filesystem::wpath& path) + : m_path(path) +{ +} + + +const std::list TxtFile::readAnsi() const +{ + std::ifstream file(m_path.string().c_str()); + if (file.bad()) + throw log_runtime_error("can't open text file"); + + std::list result; + while (!file.eof() && EOF != file.peek() ) + { + std::string str; + std::getline(file, str); + + size_t pos = str.find_first_of(BadSymbols); + while(pos != str.npos) + { + str.erase(pos, 1); + pos = str.find_first_of(BadSymbols, pos); + } + +/* + boost::erase_all(str, "\x0A"); + boost::erase_all(str, "\x0B"); + boost::erase_all(str, "\x0C"); + boost::erase_all(str, "\x0D"); + boost::erase_all(str, "\x0E"); + boost::erase_all(str, "\x0F"); + boost::erase_all(str, "\x10"); + boost::erase_all(str, "\x11"); + boost::erase_all(str, "\x12"); + boost::erase_all(str, "\x13"); + boost::erase_all(str, "\x14"); + boost::erase_all(str, "\x15"); + boost::erase_all(str, "\x16"); + boost::erase_all(str, "\x17"); + boost::erase_all(str, "\x18"); + boost::erase_all(str, "\x19"); +*/ + result.push_back(str); + } + return result; +} + + +const std::list TxtFile::readUnicode() const +{ + std::wifstream file(m_path.string().c_str(), std::ios_base::binary); + if (file.bad()) + throw log_runtime_error("can't open text file"); + + file.imbue(std::locale(std::locale(), new ucs2_conversion())); + std::list result; + + while (!file.eof()) + { + std::wstring str; + file.ignore(); + std::getline(file, str, L'\x0D'); + result.push_back(str); + } + return result; +} + + +const std::list TxtFile::readUnicodeWithOutBOM() const +{ + std::wifstream file(m_path.string().c_str(), std::ios_base::binary); + if (file.bad()) + throw log_runtime_error("can't open text file"); + + file.imbue(std::locale(std::locale(), new ucs2_conversion())); + std::list result; + + while (!file.eof()) + { + std::wstring str; + std::getline(file, str, L'\x0D'); + file.ignore(); + result.push_back(str); + } + return result; +} + + +const std::list TxtFile::readBigEndian() const +{ + std::wifstream file(m_path.string().c_str(), std::ios_base::binary); + if (file.bad()) + throw log_runtime_error("can't open text file"); + + file.imbue(std::locale(std::locale(), new ube_conversion())); + std::list result; + + while (!file.eof()) + { + std::wstring str; + file.ignore(); + std::getline(file, str, L'\x0D'); + result.push_back(str); + } + return result; +} + + +const std::list TxtFile::readUtf8() const +{ + std::ifstream file(m_path.string().c_str()); + if (file.bad()) + throw log_runtime_error("can't open text file"); + + std::list result; + file.ignore(3); + + while (!file.eof()) + { + std::string str; + std::getline(file, str); + result.push_back(str); + } + return result; +} + + +const std::list TxtFile::readUtf8withoutPref() const +{ + std::ifstream file(m_path.string().c_str()); + if (file.bad()) + throw log_runtime_error("can't open text file"); + + std::list result; + + while (!file.eof()) + { + std::string str; + std::getline(file, str); + result.push_back(str); + } + return result; +} + + +void TxtFile::writeAnsi(const std::list& content) const +{ + setAnsiStamp(); + std::ofstream file(m_path.string().c_str()); + + if (file.bad()) + throw log_runtime_error("can't create text file"); + + BOOST_FOREACH(const std::string& line, content) + { + file << line << std::endl; + } +} + + +void TxtFile::writeUnicode(const std::list& content) const +{ + setUnicodeStamp(); + std::wofstream file(m_path.string().c_str(), std::ios_base::binary | std::ios_base::app); + + if (file.bad()) + throw log_runtime_error("can't create text file"); + + file.imbue(std::locale(std::locale(), new ucs2_conversion())); + BOOST_FOREACH(const std::wstring& line, content) + { + file << line << L'\x0D' << L'\x0A'; + } +} + + +void TxtFile::writeBigEndian(const std::list& content) const +{ + setBigEndianStamp(); + std::wofstream file(m_path.string().c_str(), std::ios_base::binary | std::ios_base::app); + + if (file.bad()) + throw log_runtime_error("can't create text file"); + + file.imbue(std::locale(std::locale(), new ube_conversion())); + BOOST_FOREACH(const std::wstring& line, content) + { + file << line << L'\x0D' << L'\x0A'; + } +} + + +void TxtFile::writeUtf8(const std::list& content) const +{ + setUtf8Stamp(); + std::ofstream file(m_path.string().c_str(), std::ios_base::app); + + if (file.bad()) + throw log_runtime_error("can't create text file"); + + BOOST_FOREACH(const std::string& line, content) + { + file << line << std::endl; + } +} + + +void TxtFile::writeUtf8withoutPref(const std::list& content) const +{ + std::ofstream file(m_path.string().c_str()); + + if (file.bad()) + throw log_runtime_error("can't create text file"); + + BOOST_FOREACH(const std::string& line, content) + { + file << line << std::endl; + } +} + + +const bool TxtFile::isAnsi() const +{ + return true; +} + + +const bool TxtFile::isUnicode() const +{ + std::ifstream file(m_path.string().c_str(), std::ios_base::binary); + if (file.bad()) + throw log_runtime_error("can't open text file"); + + char symbol; + + file >> symbol; + if (symbol != '\xFF') + return false; + + file >> symbol; + if (symbol != '\xFE') + return false; + + return true; +} + + +const bool TxtFile::isUnicodeWithOutBOM() const +{ + std::ifstream file(m_path.string().c_str(), std::ios_base::binary); + if (file.bad()) + throw log_runtime_error("can't open text file"); + + std::string str; + std::getline(file, str, '\x0A'); + bool bUnicode = (str.find('\x0') != str.npos); + + return bUnicode; +} + + +const bool TxtFile::isBigEndian() const +{ + std::ifstream file(m_path.string().c_str(), std::ios_base::binary); + if (file.bad()) + throw log_runtime_error("can't open text file"); + + char symbol; + + file >> symbol; + if (symbol != '\xFE') + return false; + + file >> symbol; + if (symbol != '\xFF') + return false; + + return true; +} + + +const bool TxtFile::isUtf8() const +{ + std::ifstream file(m_path.string().c_str(), std::ios_base::binary); + if (file.bad()) + throw log_runtime_error("can't open text file"); + + char symbol; + + file >> symbol; + if (symbol != '\xEF') + return false; + + file >> symbol; + if (symbol != '\xBB') + return false; + + file >> symbol; + if (symbol != '\xBF') + return false; + + return true; +} + + +void TxtFile::setAnsiStamp() const +{ +} + + +void TxtFile::setUnicodeStamp() const +{ + std::wofstream file(m_path.string().c_str(), std::ios_base::binary); + file << '\xFF' << '\xFE'; +} + + +void TxtFile::setBigEndianStamp() const +{ + std::wofstream file(m_path.string().c_str(), std::ios_base::binary); + file << '\xFE' << '\xFF'; +} + + +void TxtFile::setUtf8Stamp() const +{ + std::wofstream file(m_path.string().c_str(), std::ios_base::binary); + file << '\xEF' << '\xBB' << '\xBF'; +} \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/TxtFile.h b/ASCOfficeOdtFile/Source/Utility/TxtFile.h new file mode 100644 index 0000000000..0891997a08 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/TxtFile.h @@ -0,0 +1,47 @@ +#pragma once +#ifndef UTILITY_TXT_FILE_INCLUDE_H_ +#define UTILITY_TXT_FILE_INCLUDE_H_ + +#include +#include +#include + + +class TxtFile +{ +public: + TxtFile(const boost::filesystem::wpath& path); + +public: + const std::list readAnsi() const; + const std::list readUnicode() const; + const std::list readUnicodeWithOutBOM() const; + const std::list readBigEndian() const; + const std::list readUtf8() const; + const std::list readUtf8withoutPref() const; + +public: + void writeAnsi(const std::list& content) const; + void writeUnicode(const std::list& content) const; + void writeBigEndian(const std::list& content) const; + void writeUtf8(const std::list& content) const; + void writeUtf8withoutPref(const std::list& content) const; + +public: + const bool isAnsi() const; + const bool isUnicode() const; + const bool isUnicodeWithOutBOM() const; + const bool isBigEndian() const; + const bool isUtf8() const; + +private: + void setAnsiStamp() const; + void setUnicodeStamp() const; + void setBigEndianStamp() const; + void setUtf8Stamp() const; + +private: + boost::filesystem::wpath m_path; +}; + +#endif // UTILITY_TXT_FILE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/Unit.h b/ASCOfficeOdtFile/Source/Utility/Unit.h new file mode 100644 index 0000000000..6a3c8121a2 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Unit.h @@ -0,0 +1,966 @@ +#pragma once +#ifndef UTILITY_UNIT_INCLUDE_H_ +#define UTILITY_UNIT_INCLUDE_H_ + +#include +#include +#include "Exception/UnitError.h" +#include + + +template class UnitConverter; +template class UnitFactory; + + +template +class Unit +{ +public: + Unit() + : m_value() + { + U::it_not_unit_type(); + } + + + Unit(const V& value) + : m_value(value) + { + U::it_not_unit_type(); + } + + const Unit& operator =(const V& value) + { + m_value = value; + return *this; + } + + + Unit(const std::string& value) + { + U::it_not_unit_type(); + fromString(value); + } + + const Unit& operator =(const std::string& value) + { + fromString(value); + return *this; + } + + + template + Unit(const Unit& unit) + { + fromUnit(unit); + } + + template + const Unit& operator =(const Unit& unit) + { + fromUnit(unit); + return *this; + } + + + operator const V() const + { + return m_value; + } + + + const Unit& operator -=(const Unit& rhs) + { + m_value -= rhs.m_value; + return *this; + } + + const Unit& operator +=(const Unit& rhs) + { + m_value += rhs.m_value; + return *this; + } + + const Unit& operator +=(const V rhs) + { + m_value += rhs; + return *this; + } + + const Unit& operator -=(const V rhs) + { + m_value -= rhs; + return *this; + } + + const Unit& operator /=(const V rhs) + { + m_value /= rhs; + return *this; + } + + const Unit& operator *=(const V rhs) + { + m_value *= rhs; + return *this; + } + + const Unit operator -(const Unit& rhs) const + { + Unit result(*this); + return result -= rhs; + } + + const Unit operator +(const Unit& rhs) const + { + Unit result(*this); + return result += rhs; + } + + const Unit operator +(const V& rhs) const + { + Unit result(*this); + return result += rhs; + } + + const Unit operator -(const V& rhs) const + { + Unit result(*this); + return result -= rhs; + } + + const Unit operator /(const V& rhs) const + { + Unit result(*this); + return result /= rhs; + } + + const Unit operator *(const V& rhs) const + { + Unit result(*this); + return result *= rhs; + } + + const Unit operator-() const + { + Unit value = -m_value; + return value; + } + + template + const Unit& operator +=(const Unit& rhs) + { + return *this += Unit(rhs); + } + + template + const Unit& operator -=(const Unit& rhs) + { + return *this -= Unit(rhs); + } + + template + const Unit operator +(const Unit& rhs) + { + Unit result(*this); + return result += rhs; + } + + template + const Unit operator -(const Unit& rhs) + { + Unit result(*this); + return result -= rhs; + } + +public: + const std::string ToString() const + { + return ToString(m_value) + U::ToString(); + } + + const V value() const + { + return m_value; + } + +private: + void fromString(const std::string& value) + { + if (value.empty()) + m_value = V(); + else + { + *this = UnitFactory::create(value); + } + } + + + template + const std::string ToString(const T value) const + { + return boost::lexical_cast(m_value); + } + + const std::string ToString(const double value) const + { + return (boost::format("%0." + boost::lexical_cast(P) + "f") % value).str(); + } + + template + void fromUnit(const Unit& unit) + { + m_value = UnitConverter::convert(unit.value()); + } + + +private: + V m_value; +}; + + +class Cm +{ +public: + static void it_not_unit_type() {} + static const std::string ToString() {return "cm";} +}; + + +class Pt +{ +public: + static void it_not_unit_type() {} + static const std::string ToString() {return "pt";} +}; + + +class Px +{ +public: + static void it_not_unit_type() {} + static const std::string ToString() {return "px";} +}; + + +class Mm +{ +public: + static void it_not_unit_type() {} + static const std::string ToString() {return "mm";} +}; + + +class Dx +{ +public: + static void it_not_unit_type() {} + static const std::string ToString() {return "";} +}; + + +class Sx +{ +public: + static void it_not_unit_type() {} + static const std::string ToString() {return "";} +}; + + +class Multi +{ +public: + static void it_not_unit_type() {} + static const std::string ToString() {return "*";} +}; + + +class Percent +{ +public: + static void it_not_unit_type() {} + static const std::string ToString() {return "%";} +}; + + +class Inch +{ +public: + static void it_not_unit_type() {} + static const std::string ToString() {return "in";} +}; + + +template +class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 10); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 72 / 2.54); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 72 * 4 / 3 / 2.54); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value / 2.54); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 72 * 20 / 2.54); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 72 * 100 * 1000 / 20); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 72 * 20 / 2.54); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value / 10); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 72 / 10 / 2.54); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 72 * 4 / 3 / 10 / 2.54); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value / 2.54 / 10); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 72 * 20 / 10 / 2.54); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 72 * 100 * 1000 / 10 / 20); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 72 * 20 / 10 / 2.54); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 2.54 / 72); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 2.54 * 10 / 72); + } +}; + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 4 / 3); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value / 72); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 20); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 2.54 * 100 * 1000 / 20); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 20); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 2.54 * 3/ 72 / 4); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 2.54 * 10 * 3/ 72 /4); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 3 / 4); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 3 / 72 / 4); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 20 * 3 / 4); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 2.54 * 100 * 1000 * 3/ 20 / 4); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 20 * 3 / 4); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 2.54); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 2.54 * 10); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 72); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 72 * 4 / 3); + } +}; + + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 72 * 20); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 1000 * 100 * 2.54 * 72 / 20 ); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 72 * 20); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 2.54 / 72 / 20); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 2.54 * 10 / 72 / 20); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value / 20); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 4 / 3 / 20); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value / 20 / 72); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 1000 * 1000 * 2.54 / 100 / 1000 ); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 20 / 72 / 100 / 1000); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 20 / 72 / 100 / 1000 * 10); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 20 / 100 / 1000 / 2.54); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 20 * 4 / 3 / 100 / 1000 / 2.54); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 20 / 2.54 / 72 / 100 / 1000); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 20 * 20 / 2.54 / 100 / 1000); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 20 * 20 / 2.54 / 100 / 1000); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 2.54 / 72 / 20); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 2.54 * 10 / 72 / 20); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value / 20); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 4 / 3 / 20); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value / 20 / 72); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value * 1000 * 1000 * 2.54 / 100 / 1000 ); + } +}; + + +template<> class UnitConverter +{ +public: + template + static const V convert(const double value) + { + return static_cast(value); + } +}; + + +template +class UnitFactory +{ +public: + static const Unit create(const std::string& str) + { + try + { + const size_t pos = str.find_first_not_of("-.0123456789"); + if (pos == std::string::npos) + return Unit(boost::lexical_cast(str)); + + const std::string unit = str.substr(pos, str.size() - pos); + + if (0 == pos) + { + return Unit(0); + } + const V value = boost::lexical_cast(str.substr(0, pos)); + + if (unit == Cm::ToString()) + return Unit(value); + else if (unit == Mm::ToString()) + return Unit(value); + else if (unit == Pt::ToString()) + return Unit(value); + else if (unit == Px::ToString()) + return Unit(value); + else if (unit == Multi::ToString()) + return Unit(value); + else if (unit == Percent::ToString()) + return Unit(value); + else if (unit == Inch::ToString()) + return Unit(value); + else + throw UnitError("Bad unit"); + } + catch (/*boost::bad_lexical_cast*/...) + { + return Unit(0); + } + } +}; + +#endif // UTILITY_UNIT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/UniversalUnit.cpp b/ASCOfficeOdtFile/Source/Utility/UniversalUnit.cpp new file mode 100644 index 0000000000..f83e622bbe --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/UniversalUnit.cpp @@ -0,0 +1,445 @@ + +// auto inserted precompiled begin +#include "precompiled_utility.h" +// auto inserted precompiled end + +#include "UniversalUnit.h" +#include +#include +#include "ToString.h" + + +const double UniversalUnit::MminEmu = 1.0 / EmuinMm; +const double UniversalUnit::CminEmu = 1.0 / EmuinCm; +const double UniversalUnit::PtinEmu = 1.0 / EmuinPt; +const double UniversalUnit::InchinEmu = 1.0 / EmuinInch; +const double UniversalUnit::PercentforRead = 1.0 / PercentforWrite; +const double UniversalUnit::DxinEmu = 1.0 / EmuinDx; + + +UniversalUnit::UniversalUnit() + : m_value(0), + Type(Emu), + Precesion(3) +{ +} + + +UniversalUnit::UniversalUnit(const int value) + : m_value(static_cast(value)), + Type(Emu), + Precesion(3) +{ +} + + +UniversalUnit::UniversalUnit(const long value) + : m_value(value), + Type(Emu), + Precesion(3) +{ +} + + +UniversalUnit::UniversalUnit(const size_t value) + : m_value(static_cast(value)), + Type(Emu), + Precesion(3) +{ +} + + +UniversalUnit::UniversalUnit(const double value) + : m_value(static_cast(value)), + Type(Emu), + Precesion(3) +{ +} + + +UniversalUnit::UniversalUnit(const std::string& value) + : Precesion(3) +{ + fromString(value); +} + + +UniversalUnit::UniversalUnit(const char* value) + : Precesion(3) +{ + fromString(value); +} + + +UniversalUnit::UniversalUnit(const UniversalUnit& rhs) + : m_value(rhs.m_value), + Type(rhs.Type), + Precesion(rhs.Precesion) +{ +} + + +UniversalUnit::UniversalUnit(const UnitType type) + : m_value(0), + Type(type), + Precesion(3) +{ +} + + +UniversalUnit::UniversalUnit(const long value, const UnitType type) + : m_value(toEmu(value, type)), + Type(type), + Precesion(3) +{ +} + + +const UniversalUnit& UniversalUnit::operator =(const std::string& value) +{ + fromString(value); + return *this; +} + + +const UniversalUnit& UniversalUnit::operator =(const char* value) +{ + fromString(value); + return *this; +} + +const UniversalUnit& UniversalUnit::operator =(const UniversalUnit& rhs) +{ + m_value = rhs.m_value; + if (Type == Emu) + Type = rhs.Type; + return *this; +} + + +UniversalUnit::operator const double()const +{ + return fromEmu(); +} + + +const bool UniversalUnit::operator ==(const UniversalUnit& rhs) const +{ + return m_value == rhs.m_value; +} + + +const bool UniversalUnit::operator !=(const UniversalUnit& rhs) const +{ + return m_value != rhs.m_value; +} + + +const bool UniversalUnit::operator > (const UniversalUnit& rhs) const +{ + return m_value > rhs.m_value; +} + + +const bool UniversalUnit::operator >=(const UniversalUnit& rhs) const +{ + return m_value >= rhs.m_value; +} + + +const bool UniversalUnit::operator < (const UniversalUnit& rhs) const +{ + return m_value < rhs.m_value; +} + + +const bool UniversalUnit::operator <=(const UniversalUnit& rhs) const +{ + return m_value <= rhs.m_value; +} + + +void UniversalUnit::apply(const UniversalUnit& unit) +{ + if (Type == Percent) + { + m_value = unit.m_value * (m_value * PercentforRead / 100); + Type = unit.Type; + } +} + + +const double UniversalUnit::value(const UnitType& type) const +{ + return fromEmu(m_value, type); +} + + +const std::string UniversalUnit::ToString() const +{ + if (Type != Emu) + { + std::string numeric = (boost::format("%0." + boost::lexical_cast(Precesion) + "f") % fromEmu()).str(); + switch (Type) + { + case Mm: + return numeric + "mm"; + case Cm: + return numeric + "cm"; + case Pt: + return numeric + "pt"; + case Inch: + return numeric + "in"; + case Percent: + return numeric + "%"; + case Multi: + return numeric + "*"; + case Dx: + return numeric.substr(0, numeric.find(".")); + default: + return numeric; + } + } + else + { + return boost::lexical_cast(m_value); + } +} + + +const long UniversalUnit::toEmu(const double value, const UnitType type) +{ + switch(type) + { + case Mm: + return static_cast(value * EmuinMm); + case Cm: + return static_cast(value * EmuinCm); + case Pt: + return static_cast(value * EmuinPt); + case Inch: + return static_cast(value * EmuinInch); + case Percent: + return static_cast(value * PercentforWrite); + case Multi: + return static_cast(value); + case Dx: + return static_cast(value) * EmuinDx; + default: + return static_cast(value); + } +} + + +const double UniversalUnit::fromEmu(const long value, const UnitType type) +{ + switch(type) + { + case Mm: + return value * MminEmu; + case Cm: + return value * CminEmu; + case Pt: + return value * PtinEmu; + case Inch: + return value * InchinEmu; + case Percent: + return value * PercentforRead; + case Multi: + return value; + case Dx: + return value * DxinEmu; + default: + return value; + } +} + + +void UniversalUnit::toEmu(const double value) +{ + m_value = toEmu(value, Type); +} + + +const double UniversalUnit::fromEmu() const +{ + return fromEmu(m_value, Type); +} + + +void UniversalUnit::fromString(const std::string& str) +{ + const size_t pos = str.find_first_not_of("-.0123456789"); + if (pos == std::string::npos) + { + Type = Emu; + if (0 != str.length()) + m_value = static_cast(boost::lexical_cast(str)); + else + m_value = 0; + return; + } + + const std::string unit = str.substr(pos, str.size() - pos); + double value; + try + { + if (0 != pos) + value = boost::lexical_cast(str.substr(0, pos)); + else + value = 0.0; + } + catch(boost::bad_lexical_cast) + { + value = 0.0; + } + + if (unit == ToLower("mm")) + Type = Mm; + else if (unit == ToLower("cm")) + Type = Cm; + else if (unit == ToLower("pt")) + Type = Pt; + else if (unit == ToLower("in")) + Type = Inch; + else if (unit == "%") + Type = Percent; + else if (unit == "*") + Type = Multi; + else + Type = Emu; + + toEmu(value); +} + + +const UniversalUnit UniversalUnit::operator -() const +{ + UniversalUnit unit(-m_value); + unit.Type = Type; + return unit; +} + + +const UniversalUnit& UniversalUnit::operator +=(const UniversalUnit& rhs) +{ + m_value += rhs.m_value; + return *this; +} + + +const UniversalUnit& UniversalUnit::operator -=(const UniversalUnit& rhs) +{ + m_value -= rhs.m_value; + return *this; +} + + +const UniversalUnit UniversalUnit::operator +(const UniversalUnit& rhs) const +{ + UniversalUnit unit(m_value + rhs.m_value); + unit.Type = Type; + return unit; +} + + +const UniversalUnit UniversalUnit::operator -(const UniversalUnit& rhs) const +{ + UniversalUnit unit(m_value - rhs.m_value); + unit.Type = Type; + return unit; +} + + +const UniversalUnit operator +(const double lhs, const UniversalUnit& rhs) +{ + UniversalUnit unit(UniversalUnit::toEmu(lhs, rhs.Type) + rhs.m_value); + unit.Type = rhs.Type; + return unit; +} + + +const UniversalUnit operator -(const double lhs, const UniversalUnit& rhs) +{ + UniversalUnit unit(UniversalUnit::toEmu(lhs, rhs.Type) - rhs.m_value); + unit.Type = rhs.Type; + return unit; +} + + +const UniversalUnit operator *(const double lhs, const UniversalUnit& rhs) +{ + UniversalUnit unit(lhs * rhs.m_value); + unit.Type = rhs.Type; + return unit; +} + + +const UniversalUnit operator /(const double lhs, const UniversalUnit& rhs) +{ + UniversalUnit unit(lhs / rhs.m_value); + unit.Type = rhs.Type; + return unit; +} + +const UniversalUnit operator +(const int lhs, const UniversalUnit& rhs) +{ + UniversalUnit unit(UniversalUnit::toEmu(lhs, rhs.Type) + rhs.m_value); + unit.Type = rhs.Type; + return unit; +} + + +const UniversalUnit operator -(const int lhs, const UniversalUnit& rhs) +{ + UniversalUnit unit(UniversalUnit::toEmu(lhs, rhs.Type) - rhs.m_value); + unit.Type = rhs.Type; + return unit; +} + + +const UniversalUnit operator *(const int lhs, const UniversalUnit& rhs) +{ + UniversalUnit unit(lhs * rhs.m_value); + unit.Type = rhs.Type; + return unit; +} + + +const UniversalUnit operator /(const int lhs, const UniversalUnit& rhs) +{ + UniversalUnit unit(lhs / rhs.m_value); + unit.Type = rhs.Type; + return unit; +} + +const UniversalUnit operator +(const long lhs, const UniversalUnit& rhs) +{ + UniversalUnit unit(UniversalUnit::toEmu(lhs, rhs.Type) + rhs.m_value); + unit.Type = rhs.Type; + return unit; +} + + +const UniversalUnit operator -(const long lhs, const UniversalUnit& rhs) +{ + UniversalUnit unit(UniversalUnit::toEmu(lhs, rhs.Type) - rhs.m_value); + unit.Type = rhs.Type; + return unit; +} + + +const UniversalUnit operator *(const long lhs, const UniversalUnit& rhs) +{ + UniversalUnit unit(lhs * rhs.m_value); + unit.Type = rhs.Type; + return unit; +} + + +const UniversalUnit operator /(const long lhs, const UniversalUnit& rhs) +{ + UniversalUnit unit(lhs / rhs.m_value); + unit.Type = rhs.Type; + return unit; +} diff --git a/ASCOfficeOdtFile/Source/Utility/UniversalUnit.h b/ASCOfficeOdtFile/Source/Utility/UniversalUnit.h new file mode 100644 index 0000000000..9bbbe3dbfd --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/UniversalUnit.h @@ -0,0 +1,198 @@ +#pragma once +#ifndef UTILITY_UNIVERSAL_UNIT_INCLUDE_H_ +#define UTILITY_UNIVERSAL_UNIT_INCLUDE_H_ + +#include +#include "property.h" +#include "setter.h" + + +class UniversalUnit +{ +public: + enum UnitType {Emu, Cm, Mm, Inch, Pt, Percent, Multi, Dx}; + +public: + UniversalUnit(); + UniversalUnit(const int value); + UniversalUnit(const long value); + UniversalUnit(const size_t value); + UniversalUnit(const double value); + + explicit UniversalUnit(const std::string& value); + UniversalUnit(const char* value); + UniversalUnit(const UniversalUnit& rhs); + UniversalUnit(const UnitType type); + UniversalUnit(const long value, const UnitType type); + + template const UniversalUnit& operator =(const T value) {toEmu(value); return *this;} + const UniversalUnit& operator =(const std::string& value); + const UniversalUnit& operator =(const char* value); + const UniversalUnit& operator =(const UniversalUnit& rhs); + +public: + operator const double() const; + +public: + const bool operator ==(const UniversalUnit& rhs) const; + const bool operator !=(const UniversalUnit& rhs) const; + const bool operator > (const UniversalUnit& rhs) const; + const bool operator >=(const UniversalUnit& rhs) const; + const bool operator < (const UniversalUnit& rhs) const; + const bool operator <=(const UniversalUnit& rhs) const; + + template const bool operator ==(const T value) const {return m_value == toEmu(value, Type);} + template const bool operator !=(const T value) const {return m_value != toEmu(value, Type);} + template const bool operator > (const T value) const {return m_value > toEmu(value, Type);} + template const bool operator >=(const T value) const {return m_value >= toEmu(value, Type);} + template const bool operator < (const T value) const {return m_value < toEmu(value, Type);} + template const bool operator <=(const T value) const {return m_value <= toEmu(value, Type);} + +public: + const UniversalUnit operator -() const; + const UniversalUnit& operator +=(const UniversalUnit& rhs); + const UniversalUnit& operator -=(const UniversalUnit& rhs); + template const UniversalUnit& operator +=(const T value) {m_value += toEmu(value, Type); return *this;} + template const UniversalUnit& operator -=(const T value) {m_value -= toEmu(value, Type); return *this;} + template const UniversalUnit& operator *=(const T value) {m_value *= value; return *this;} + template const UniversalUnit& operator /=(const T value) {m_value /= value; return *this;} + + const UniversalUnit operator +(const UniversalUnit& rhs) const; + const UniversalUnit operator -(const UniversalUnit& rhs) const; + template const UniversalUnit operator +(const T rhs) const; + template const UniversalUnit operator -(const T rhs) const; + template const UniversalUnit operator *(const T rhs) const; + template const UniversalUnit operator /(const T rhs) const; + + friend const UniversalUnit operator +(const double lhs, const UniversalUnit& rhs); + friend const UniversalUnit operator -(const double lhs, const UniversalUnit& rhs); + friend const UniversalUnit operator *(const double lhs, const UniversalUnit& rhs); + friend const UniversalUnit operator /(const double lhs, const UniversalUnit& rhs); + + friend const UniversalUnit operator +(const int lhs, const UniversalUnit& rhs); + friend const UniversalUnit operator -(const int lhs, const UniversalUnit& rhs); + friend const UniversalUnit operator *(const int lhs, const UniversalUnit& rhs); + friend const UniversalUnit operator /(const int lhs, const UniversalUnit& rhs); + + friend const UniversalUnit operator +(const long lhs, const UniversalUnit& rhs); + friend const UniversalUnit operator -(const long lhs, const UniversalUnit& rhs); + friend const UniversalUnit operator *(const long lhs, const UniversalUnit& rhs); + friend const UniversalUnit operator /(const long lhs, const UniversalUnit& rhs); + +public: + void apply(const UniversalUnit& unit); + const double value(const UnitType& type) const; + +public: + const std::string ToString() const; + +public: + property > Precesion; + property Type; + +private: + long m_value; + +private: + static const long toEmu(const double value, const UnitType type); + static const double fromEmu(const long value, const UnitType type); + + void toEmu(const double value); + const double fromEmu() const; + +private: + void fromString(const std::string& str); + +private: + +#pragma warning(disable:4244) + static const long EmuinMm = 72 / 2 * 1000; + static const long EmuinCm = 72 / 2 * 1000 * 10; + static const long EmuinPt = 1000 * 25.4 / 2; + static const long EmuinInch = 72 / 2 * 1000 * 25.4; + static const long EmuinDx = 1000 / 4 * 2.54; + static const long PercentforWrite = 100; +#pragma warning(default:4244) + + static const double MminEmu; + static const double CminEmu; + static const double PtinEmu; + static const double InchinEmu; + static const double DxinEmu; + static const double PercentforRead; +}; + + +const UniversalUnit operator +(const double lhs, const UniversalUnit& rhs); +const UniversalUnit operator -(const double lhs, const UniversalUnit& rhs); +const UniversalUnit operator *(const double lhs, const UniversalUnit& rhs); +const UniversalUnit operator /(const double lhs, const UniversalUnit& rhs); + +const UniversalUnit operator +(const int lhs, const UniversalUnit& rhs); +const UniversalUnit operator -(const int lhs, const UniversalUnit& rhs); +const UniversalUnit operator *(const int lhs, const UniversalUnit& rhs); +const UniversalUnit operator /(const int lhs, const UniversalUnit& rhs); + +const UniversalUnit operator +(const long lhs, const UniversalUnit& rhs); +const UniversalUnit operator -(const long lhs, const UniversalUnit& rhs); +const UniversalUnit operator *(const long lhs, const UniversalUnit& rhs); +const UniversalUnit operator /(const long lhs, const UniversalUnit& rhs); + + +template const UniversalUnit UniversalUnit::operator +(const T rhs) const +{ + UniversalUnit unit(m_value + UniversalUnit::toEmu(rhs, Type)); + unit.Type = Type; + return unit; +} + +template const UniversalUnit UniversalUnit::operator -(const T rhs) const +{ + UniversalUnit unit(m_value - UniversalUnit::toEmu(rhs, Type)); + unit.Type = Type; + return unit; +} + +template const UniversalUnit UniversalUnit::operator *(const T rhs) const +{ + UniversalUnit unit(m_value * rhs); + unit.Type = Type; + return unit; +} + +template const UniversalUnit UniversalUnit::operator /(const T rhs) const +{ + UniversalUnit unit(m_value / rhs); + unit.Type = Type; + return unit; +} +/* +template const UniversalUnit operator +(const T lhs, const UniversalUnit& rhs) +{ + UniversalUnit unit(UniversalUnit::toEmu(lsh, rhs.Type) + rhs.m_value); + unit.Type = rhs.Type; + return unit; +} + +template const UniversalUnit operator -(const T lhs, const UniversalUnit& rhs) +{ + UniversalUnit unit(UniversalUnit::toEmu(lsh, rhs.Type) - rhs.m_value); + unit.Type = rhs.Type; + return unit; +} + +template const UniversalUnit operator *(const T lhs, const UniversalUnit& rhs) +{ + UniversalUnit unit(lhs * rhs.m_value); + unit.Type = rhs.Type; + return unit; +} + +template const UniversalUnit operator /(const T lhs, const UniversalUnit& rhs) +{ + UniversalUnit unit(lhs / rhs.m_value); + unit.Type = rhs.Type; + return unit; +} +*/ +#endif // UTILITY_UNIVERSAL_UNIT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/Utility.h b/ASCOfficeOdtFile/Source/Utility/Utility.h new file mode 100644 index 0000000000..cb8ea57261 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/Utility.h @@ -0,0 +1,50 @@ +#pragma once +#ifndef UTILITY_UTILITY_INCLUDE_H_ +#define UTILITY_UTILITY_INCLUDE_H_ + +#include "DateTime.h" +#include "Parse.h" +#include "ToString.h" +#include "Unit.h" +#include "Encoding.h" +#include "TxtFile.h" +#include +#include "UniversalUnit.h" +#include "FileNameUtility.h" + + +template +static const std::vector transform(const std::vector& lines, const Out(*func)(const In&)) +{ + std::vector result; + BOOST_FOREACH(const In& line, lines) + { + result.push_back(func(line)); + } + return result; +} + + +template +static const std::list transform(const std::list& lines, const Out(*func)(const In&)) +{ + std::list result; + BOOST_FOREACH(const In& line, lines) + { + result.push_back(func(line)); + } + return result; +} + + +template +static const std::list transform2(const std::list& lines, const int codepage, const Out(*func)(const In&, const In2 codePage)) +{ + std::list result; + BOOST_FOREACH(const In& line, lines) + { + result.push_back(func(line, codepage)); + } + return result; +} +#endif // UTILITY_UTILITY_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/codecvt.cpp b/ASCOfficeOdtFile/Source/Utility/codecvt.cpp new file mode 100644 index 0000000000..069b96b3f8 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/codecvt.cpp @@ -0,0 +1,199 @@ + +// auto inserted precompiled begin +#include "precompiled_utility.h" +// auto inserted precompiled end + +#include "codecvt.h" + +using namespace std; + + +ucs2_conversion::result +ucs2_conversion::do_in(mbstate_t&, + const char* from, const char* from_end, const char*& from_next, + wchar_t* to, wchar_t* to_limit, wchar_t*& to_next) const +{ + const int max_input = (from_end - from) & ~1; + const int max_output = (to_limit - to); + int count = min(max_input / 2, max_output); // TODO ïîïðîáîâàòü îïòèìèçèðîâàòü, çàìåíèâ äåëåíèå íà ñäâèã + + from_next = from; + to_next = to; + + for (;count--; from_next += 2, ++to_next) + { + unsigned char c1 = *from_next; + unsigned char c2 = *(from_next + 1); + *to_next = c1 | c2 << 8; + } + + if (to_next == to && from_next == from_end - 1) + return partial; + return ok; +} + + +ucs2_conversion::result +ucs2_conversion::do_out(mbstate_t&, + const wchar_t* from, const wchar_t* from_end, const wchar_t*& from_next, + char* to, char* to_limit, char*& to_next) const +{ + const int max_input = (from_end - from); + const int max_output = (to_limit - to) & ~1; + int count = min(max_input, max_output / 2); // TODO ïîïðîáîâàòü îïòèìèçèðîâàòü, çàìåíèâ äåëåíèå íà ñäâèã + + from_next = from; + to_next = to; + + for (;count--; ++from_next, to_next += 2) + { + *(to_next + 0) = *from_next & 0xFF; + *(to_next + 1) = *from_next >> 8 & 0xFF; + } + return ok; +} + + + +ube_conversion::result +ube_conversion::do_in(mbstate_t&, + const char* from, const char* from_end, const char*& from_next, + wchar_t* to, wchar_t* to_limit, wchar_t*& to_next) const +{ + const int max_input = (from_end - from) & ~1; + const int max_output = (to_limit - to); + int count = min(max_input / 2, max_output); // TODO ïîïðîáîâàòü îïòèìèçèðîâàòü, çàìåíèâ äåëåíèå íà ñäâèã + + from_next = from; + to_next = to; + + for (;count--; from_next += 2, ++to_next) + { + unsigned char c1 = *from_next; + unsigned char c2 = *(from_next + 1); + *to_next = c2 | c1 << 8; + } + + if (to_next == to && from_next == from_end - 1) + return partial; + return ok; +} + +ube_conversion::result +ube_conversion::do_out(mbstate_t&, + const wchar_t* from, const wchar_t* from_end, const wchar_t*& from_next, + char* to, char* to_limit, char*& to_next) const +{ + const int max_input = (from_end - from); + const int max_output = (to_limit - to) & ~1; + int count = min(max_input, max_output / 2); // TODO ïîïðîáîâàòü îïòèìèçèðîâàòü, çàìåíèâ äåëåíèå íà ñäâèã + + from_next = from; + to_next = to; + + for (;count--; ++from_next, to_next += 2) + { + *(to_next + 1) = *from_next & 0xFF; + *(to_next + 0) = *from_next >> 8 & 0xFF; + } + return ok; +} + + +utf8_conversion::result +utf8_conversion::do_in(mbstate_t&, + const char* from, const char* from_end, const char*& from_next, + wchar_t* to, wchar_t* to_limit, wchar_t*& to_next) const +{ + from_next = from; + to_next = to; + + for(; to_next < to_limit && from_next < from_end; ++to_next) + { + if (static_cast(*from_next) < 0x80) + { + *to_next = static_cast(*from_next++); + } + else + { + const int zero_bit_pos = most_signifant_bit_position(~*from_next); + int extra_bytes = 7 - zero_bit_pos; + + if (from_end - from_next < extra_bytes + 1) + return partial; + + *to_next = static_cast(*from_next++) & ((1 << zero_bit_pos - 1) - 1); + for (;extra_bytes--; ++from_next) + { + *to_next = *to_next << 6 | static_cast(*from_next) & 63; + } + } + } + return ok; +} + + +// TODO ìîæíî îïòèìèçèðîâàòü, ñ÷èòàÿ ÷òî â utf8 ìàêñèìàëüíîå çíà÷åíèå áàéò íà ñèìâîë 4. +// È ïîñëå çàìåíèâ äåëåíèå è óìíîæåíèå íà ñäâèãè +utf8_conversion::result +utf8_conversion::do_out(mbstate_t&, + const wchar_t* from, const wchar_t* from_end, const wchar_t*& from_next, + char* to, char* to_limit, char*& to_next) const +{ + from_next = from; + to_next = to; + + for (;from_next < from_end; ++from_next) + { + const unsigned symbol = *from_next; + + if (symbol < 0x7F) + { + if (to_next < to_limit) + *to_next++ = static_cast(symbol); + else + return ok; + } + else + { + const size_t msb_pos = most_signifant_bit_position(symbol); + int extra_bytes = msb_pos / 6; + + if (to_limit - to_next >= extra_bytes + 1) + { + *to_next = static_cast(0xFF80 >> extra_bytes); + *to_next++ |= take_6_bits(symbol, extra_bytes * 6); + + for(;extra_bytes--;) + *to_next++ = 0x80 | take_6_bits(symbol, extra_bytes * 6); + } + else + { + return ok; + } + } + } + return ok; +} + + +const unsigned char +utf8_conversion::take_6_bits(const int unsigned value, const size_t right_position) const +{ + return (value >> right_position) & 63; +} + + +const size_t +utf8_conversion::most_signifant_bit_position(const unsigned int value) const +{ + size_t result = 0; + size_t half = 16; + + for(; half > 0; half >>= 1) + { + if (1u << (result + half) <= value ) + result += half; + } + return result + 1; +} diff --git a/ASCOfficeOdtFile/Source/Utility/codecvt.h b/ASCOfficeOdtFile/Source/Utility/codecvt.h new file mode 100644 index 0000000000..8ef37d2bed --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/codecvt.h @@ -0,0 +1,86 @@ +#pragma once +#ifndef UTILITY_CODECVT_INCLUDE_H_ +#define UTILITY_CODECVT_INCLUDE_H_ + +/** Several code conversions facets. + + E.g. this is how to convert UCS-2 to UTF-8 + + @code + wifstream ifs("input", ios_base::binary); + wofstream ofs("output", ios_base::binary); + + ifs.rdbuf()->pubimbue(locale(locale(), new ucs2_conversion())); + ofs.rbbuf()->pubimbue(locale(locale(), new utf8_conversion())); + ofs << ifs.rdbuf(); + @endcode + + @author Vladimir Prus + + @file +*/ +#include + + +/** Conversion facet that allows to use Unicode files in UCS-2 encoding */ +class ucs2_conversion : public std::codecvt +{ +protected: + result do_in(std::mbstate_t& state, + const char* from, const char* from_end, const char*& from_next, + wchar_t* to, wchar_t* to_limit, wchar_t*& to_next) const; + + result do_out(std::mbstate_t& state, + const wchar_t* from, const wchar_t* from_end, const wchar_t*& from_next, + char* to, char* to_limit, char*& to_next) const; + + bool do_always_noconv() const throw() { return false; } + int do_encoding() const throw() { return 2; } +}; + + +class ube_conversion : public std::codecvt +{ +protected: + result do_in(std::mbstate_t& state, + const char* from, const char* from_end, const char*& from_next, + wchar_t* to, wchar_t* to_limit, wchar_t*& to_next) const; + + result do_out(std::mbstate_t& state, + const wchar_t* from, const wchar_t* from_end, const wchar_t*& from_next, + char* to, char* to_limit, char*& to_next) const; + + bool do_always_noconv() const throw() { return false; } + int do_encoding() const throw() { return 2; } +}; + + +/** Conversion facet that allows to read Unicode files in UTF-8 encoding */ +class utf8_conversion : public std::codecvt +{ +protected: + result do_in(std::mbstate_t& state, + const char* from, const char* from_end, const char*& from_next, + wchar_t* to, wchar_t* to_limit, wchar_t*& to_next) const; + + result in(std::mbstate_t& state, + const char* from, const char* from_end, const char*& from_next, + wchar_t* to, wchar_t* to_limit, wchar_t*& to_next) const; + + result do_out(std::mbstate_t& state, + const wchar_t* from, const wchar_t* from_end, const wchar_t*& from_next, + char* to, char* to_limit, char*& to_next) const; + + result out(std::mbstate_t& state, + const wchar_t* from, const wchar_t* from_end, const wchar_t*& from_next, + char* to, char* to_limit, char*& to_next) const; + + bool do_always_noconv() const throw() { return false; } + int do_encoding() const throw() { return 2; } + +private: + const unsigned char take_6_bits(const unsigned int value, const size_t right_position) const; + const size_t most_signifant_bit_position(const unsigned int value) const; +}; + +#endif // UTILITY_CODECVT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/nullable.h b/ASCOfficeOdtFile/Source/Utility/nullable.h new file mode 100644 index 0000000000..5b623c3c77 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/nullable.h @@ -0,0 +1,249 @@ +#pragma once +#ifndef UTILITY_NULLABLE_INCLUDE_H_ +#define UTILITY_NULLABLE_INCLUDE_H_ + +#include +#include +#include +#include +#include "ToString.h" +#include "Exception/not_init_nullable.h" + + +template +class nullable +{ +private: + typedef typename boost::call_traits::param_type Parameter; + +public: + nullable() {} + nullable(Parameter value) : _value(value) {} + + template + const nullable& operator =(const U& value) + { + return ::nullable_setter(*this, value); + } + template + const nullable& nullable_setter(const U& value) + { + _value = static_cast(value); + return *this; + } + const nullable& nullable_setter(const nullable& value) + { + _value = value; + return *this; + } + + operator Parameter() const {return _value.get();} + + Parameter get() const + { + if (!is_init()) + throw not_init_nullable(); + return _value.get(); + } + + Parameter get_value_or(Parameter value) const + { + return _value.get_value_or(value); + } + + const T get_value_or_default() const + { + return get_value_or(T()); + } + + T const* operator->() const + { + if (!is_init()) + throw not_init_nullable(); + return _value.get_ptr(); + } + + T* operator->() + { + if (!is_init()) + throw not_init_nullable(); + return _value.get_ptr(); + } + + T const* get_ptr() const + { + if (!is_init()) + throw not_init_nullable(); + return _value.get_ptr(); + } + + T* get_ptr() + { + if (!is_init()) + throw not_init_nullable(); + return _value.get_ptr(); + } + + T const& operator*() const + { + if (!is_init()) + throw not_init_nullable(); + return *_value; + } + + T& operator*() + { + if (!is_init()) + throw not_init_nullable(); + return *_value; + } + + const bool is_init() const + { + return _value.is_init(); + } + + void reset() + { + _value.reset(); + } + + void init() + { + if (!is_init()) + _value = T(); + } + + const std::string ToString() const + { + return ::ToString(get()); + } + + const bool operator ==(nullable const& rhs) const {return _value.get() == rhs._value.get();} + const bool operator !=(nullable const& rhs) const {return _value.get() != rhs._value.get();} + const bool operator < (nullable const& rhs) const {return _value.get() < rhs._value.get();} + const bool operator > (nullable const& rhs) const {return _value.get() > rhs._value.get();} + const bool operator <=(nullable const& rhs) const {return _value.get() <= rhs._value.get();} + const bool operator >=(nullable const& rhs) const {return _value.get() >= rhs._value.get();} + + const bool operator ==(Parameter rhs) const {return _value.get() == rhs;} + const bool operator !=(Parameter rhs) const {return _value.get() != rhs;} + const bool operator < (Parameter rhs) const {return _value.get() < rhs;} + const bool operator > (Parameter rhs) const {return _value.get() > rhs;} + const bool operator <=(Parameter rhs) const {return _value.get() <= rhs;} + const bool operator >=(Parameter rhs) const {return _value.get() >= rhs;} + + template const bool operator ==(const T rhs) const {return _value.get() == rhs;} + template const bool operator !=(const T rhs) const {return _value.get() != rhs;} + template const bool operator < (const T rhs) const {return _value.get() < rhs;} + template const bool operator > (const T rhs) const {return _value.get() > rhs;} + template const bool operator <=(const T rhs) const {return _value.get() <= rhs;} + template const bool operator >=(const T rhs) const {return _value.get() >= rhs;} + +private: + template + class _nullable + { + private: + typedef typename boost::call_traits::param_type Parameter; + + public: + _nullable() {} + _nullable(Parameter value) : _value(new T(value)) {} + + void operator =(Parameter value) { _value.reset(new T(value));} + void operator =(const nullable& value) + { + if (value.is_init()) + _value.reset(new T(value)); + else + _value = boost::shared_ptr(); + } + + Parameter get() const {return *_value;} + Parameter get_value_or(Parameter value) const {return is_init() ? get() : value;} + + const bool is_init() const {return _value != 0;} + void reset() {_value.reset();} + + T const* get_ptr() const {return _value.get();} + T* get_ptr() {return _value.get();} + + T const& operator*() const {return *_value;} + T& operator*() {return *_value;} + + private: + boost::shared_ptr _value; + }; + + + template + class _nullable + { + private: + typedef typename boost::call_traits::param_type Parameter; + + public: + _nullable() {} + _nullable(Parameter value) : _value(value) {} + + void operator =(Parameter value) {_value = value;} + void operator =(const nullable& value) + { + if (value.is_init()) + _value = value; + else + _value = boost::optional(); + } + + Parameter get() const {return _value.get();} + Parameter get_value_or(Parameter value) const {return _value.get_value_or(value);} + + const bool is_init() const {return _value.is_initialized();} + void reset() {_value.reset();} + + T const* get_ptr() const {return _value.get_ptr();} + T* get_ptr() {return _value.get_ptr();} + + T const& operator*() const {return *_value;} + T& operator*() {return *_value;} + + private: + boost::optional _value; + }; + +private: + static const int size_of_big_object = 128; + + _nullable= 1> _value; +}; + + +template const bool operator== (const T x, nullable const& y) {return y == x;} +template const bool operator!= (const T x, nullable const& y) {return y != x;} +template const bool operator< (const T x, nullable const& y) {return y >= x;} +template const bool operator> (const T x, nullable const& y) {return y <= x;} +template const bool operator<= (const T x, nullable const& y) {return y > x;} +template const bool operator>= (const T x, nullable const& y) {return y < x;} + +template const bool operator ==(const V x, nullable const& y) {return y == x;} +template const bool operator !=(const V x, nullable const& y) {return y != x;} +template const bool operator < (const V x, nullable const& y) {return y < x;} +template const bool operator > (const V x, nullable const& y) {return y > x;} +template const bool operator <=(const V x, nullable const& y) {return y <= x;} +template const bool operator >=(const V x, nullable const& y) {return y >= x;} + + +template +const nullable& nullable_setter(nullable& lhs, const U& rhs) +{ + return lhs.nullable_setter(rhs); +} + + +template const std::string ToString(const nullable& value) +{ + return value.ToString(); +} + +#endif // UTILITY_NULLABLE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/nullable_property.h b/ASCOfficeOdtFile/Source/Utility/nullable_property.h new file mode 100644 index 0000000000..e8b554a07e --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/nullable_property.h @@ -0,0 +1,321 @@ +#pragma once +#ifndef UTILITY_NULLABLE_PROPERTY_INCLUDE_H_ +#define UTILITY_NULLABLE_PROPERTY_INCLUDE_H_ + +#include "Setter.h" +#include "Getter.h" +#include "nullable.h" +#include +#include +#include +#include "ToString.h" + + +template, class Getter = getter::simple > +class nullable_property +{ +private: + typedef typename boost::call_traits::param_type Parameter; + +public: + nullable_property() {} + nullable_property(const Setter& setter, const Getter& getter = Getter()) : _value(setter, getter) {} + nullable_property(Parameter value, const Setter& setter = Setter(), const Getter& getter = Getter()) + : _value (value, setter, getter) {} + template + nullable_property(nullable_property const& rhs, const Setter& setter = Setter(), const Getter& getter = Getter()) + : _value(rhs, setter, getter) {} + nullable_property(const nullable& value) : _value(value) {} + + + template + const nullable_property& operator =(const U& value) + { + return ::nullable_property_setter(*this, value); + } + const nullable_property& operator =(const nullable_property& value) + { + return ::nullable_property_setter(*this, value); + } + + template + const nullable_property& nullable_property_setter(const U& value) + { + _value = static_cast(value); + return *this; + } + const nullable_property& nullable_property_setter(const nullable_property& value) + { + _value = value; + return *this; + } + template + const nullable_property& nullable_property_setter(const nullable_property& value) + { + _value = value; + return *this; + } + const nullable_property& nullable_property_setter(const nullable& value) + { + _value = value; + return *this; + } + + + operator const Type() const {return get();} + operator const nullable() const {return _value.get_nullable();} + const Type get() const {return _value.get();} + const Type operator*() const {return get();} + const Type get_value_or(Parameter value) const {return _value.is_init() ? get() : value;} + const Type get_value_or_default() const {return get_value_or(Type());} + + Type const* const operator->() const {return _value.get_ptr();} + Type* operator->() {return _value.get_ptr();} + + Type& operator*() {return *_value;} + + const bool is_init() const {return _value.is_init();} + void reset() {_value.reset();} + void init() {_value.init();} + + const std::string ToString() const {return ::ToString(get());} + + const bool operator ==(nullable_property const& rhs) const {return get() == rhs.get()} + const bool operator !=(nullable_property const& rhs) const {return get() != rhs.get();} + const bool operator < (nullable_property const& rhs) const {return get() < rhs.get();} + const bool operator > (nullable_property const& rhs) const {return get() > rhs.get();} + const bool operator <=(nullable_property const& rhs) const {return get() <= rhs.get();} + const bool operator >=(nullable_property const& rhs) const {return get() >= rhs.get();} + + const bool operator ==(Parameter rhs) const {return get() == rhs;} + const bool operator !=(Parameter rhs) const {return get() != rhs;} + const bool operator < (Parameter rhs) const {return get() < rhs;} + const bool operator > (Parameter rhs) const {return get() > rhs;} + const bool operator <=(Parameter rhs) const {return get() <= rhs;} + const bool operator >=(Parameter rhs) const {return get() >= rhs;} + + template const bool operator ==(const T rhs) const {return get() == rhs;} + template const bool operator !=(const T rhs) const {return get() != rhs;} + template const bool operator < (const T rhs) const {return get() < rhs;} + template const bool operator > (const T rhs) const {return get() > rhs;} + template const bool operator <=(const T rhs) const {return get() <= rhs;} + template const bool operator >=(const T rhs) const {return get() >= rhs;} + +private: + + template + class _nullable_property + { + private: + typedef typename boost::call_traits::param_type Parameter; + + public: + _nullable_property() {} + _nullable_property(Parameter value, const Setter&, const Getter&) + : _value(value) {Setter()(*_value, value);} + _nullable_property(const nullable& value) + { + if (value.is_init()) + { + _value = value; + Setter()(*_value, value.get()); + } + } + + + void operator =(Parameter value) + { + _value = value; + Setter()(*_value, value); + } + template + void operator =(const nullable_property& rhs) + { + if (rhs.is_init()) + { + _value = rhs.get(); + Setter()(*_value, rhs.get()); + } + else + { + _value = nullable(); + } + } + void operator =(const nullable& value) + { + if (value.is_init()) + { + _value = value; + Setter()(*_value, value.get()); + } + else + { + _value = nullable(); + } + } + + + const Type get() const {return Getter()(*_value);} + const nullable get_nullable() const {return is_init() ? nullable(get()) : nullable();} + Type const* const get_ptr() const {return _value.get_ptr();} + Type* get_ptr() {return _value.get_ptr();} + + Type& operator*() {return *_value;} + + const bool is_init() const {return _value.is_init();} + void reset() {_value.reset();} + void init() {_value.init();} + + private: + nullable _value; + }; + + template + class _nullable_property + { + private: + typedef typename boost::call_traits::param_type Parameter; + + public: + _nullable_property() {} + _nullable_property(const Setter& setter, const Getter& getter) + : + _setter(setter), + _getter(getter) + { + } + _nullable_property(Parameter value, const Setter& setter, const Getter& getter) + : + _value(value), + _setter(setter), + _getter(getter) + { + _setter(*_value, value); + } + template + _nullable_property(nullable_property const& rhs, const Setter& setter, const Getter& getter) + : + _setter(setter), + _getter(getter) + { + if (rhs.is_init()) + { + _value = rhs.get(); + _setter(*_value, rhs.get()); + } + } + _nullable_property(const nullable& value) + { + if (value.is_init()) + { + _value = value; + _setter(*_value, value.get()); + } + } + + + void operator =(Parameter value) + { + _value = value; + _setter(*_value, value); + } + template + void operator =(const nullable_property& rhs) + { + if (rhs.is_init()) + { + _value = rhs.get(); + _setter(*_value, rhs.get()); + } + else + { + _value = nullable(); + } + } + void operator =(const nullable& value) + { + if (value.is_init()) + { + _value = value; + _setter(*_value, value.get()); + } + else + { + _value = nullable(); + } + } + + + const Type get() const {return _getter(*_value);} + const nullable get_nullable() const {return is_init() ? nullable(get()) : nullable();} + Type const* const get_ptr() const {return _value.get_ptr();} + Type* get_ptr() {return _value.get_ptr();} + + Type& operator*() {return *_value;} + + const bool is_init() const {return _value.is_init();} + void reset() {_value.reset();} + void init() {_value.init();} + + private: + nullable _value; + Setter _setter; + Getter _getter; + }; + +private: + _nullable_property::value && + boost::has_trivial_constructor::value> _value; +}; + + +template const bool operator ==(const T x, nullable_property const& y) {return y == x;} +template const bool operator !=(const T x, nullable_property const& y) {return y != x;} +template const bool operator < (const T x, nullable_property const& y) {return y >= x;} +template const bool operator > (const T x, nullable_property const& y) {return y <= x;} +template const bool operator <=(const T x, nullable_property const& y) {return y > x;} +template const bool operator >=(const T x, nullable_property const& y) {return y < x;} + +template const bool operator ==(const V x, nullable_property const& y) {return y == x;} +template const bool operator !=(const V x, nullable_property const& y) {return y != x;} +template const bool operator < (const V x, nullable_property const& y) {return y < x;} +template const bool operator > (const V x, nullable_property const& y) {return y > x;} +template const bool operator <=(const V x, nullable_property const& y) {return y <= x;} +template const bool operator >=(const V x, nullable_property const& y) {return y >= x;} + + +template +const nullable_property& nullable_property_setter(nullable_property& lhs, const U& rhs) +{ + return lhs.nullable_property_setter(rhs); +} + + +template +const nullable& nullable_setter(nullable& lhs, const nullable_property& rhs) +{ + if (rhs.is_init()) + return lhs.nullable_setter(rhs); + else + return lhs; +} + + + +template +const std::string ToString(const nullable_property& value) +{ + return value.ToString(); +} + + +template +const nullable_property merge(const nullable_property& prev, const nullable_property& current) +{ + if (!current.is_init()) + return prev; + return current; +} + +#endif // UTILITY_NULLABLE_PROPERTY_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/precompiled_utility.cpp b/ASCOfficeOdtFile/Source/Utility/precompiled_utility.cpp new file mode 100644 index 0000000000..6a09b6ebfa --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/precompiled_utility.cpp @@ -0,0 +1,6 @@ + +// auto inserted precompiled begin +#include "precompiled_utility.h" +// auto inserted precompiled end + +#include "precompiled_utility.h" \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/Utility/precompiled_utility.h b/ASCOfficeOdtFile/Source/Utility/precompiled_utility.h new file mode 100644 index 0000000000..d074db2440 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/precompiled_utility.h @@ -0,0 +1,26 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + diff --git a/ASCOfficeOdtFile/Source/Utility/property.h b/ASCOfficeOdtFile/Source/Utility/property.h new file mode 100644 index 0000000000..ac2a866810 --- /dev/null +++ b/ASCOfficeOdtFile/Source/Utility/property.h @@ -0,0 +1,268 @@ +#pragma once +#ifndef UTILITY_PROPERTY_INCLUDE_H_ +#define UTILITY_PROPERTY_INCLUDE_H_ + +#include "Setter.h" +#include "Getter.h" +#include +#include +#include +#include "ToString.h" + + +template, class Getter = getter::simple > +class property +{ +private: + typedef typename boost::call_traits::param_type Parameter; + +public: + property() : _value() {} + property(const Setter& setter, const Getter& getter = Getter()) : _value(setter, getter) {} + property(Parameter value, const Setter& setter = Setter(), const Getter& getter = Getter()) + : _value(value, setter, getter) {} + + template + property(property const& rhs, const Setter& setter = Setter(), const Getter& getter = Getter()) + : _value(rhs, setter, getter) {} + + + template + const property& operator =(const U& value) + { + return ::property_setter(*this, value); + } + const property& operator =(const property& value) + { + return ::property_setter(*this, value); + } + + + template + const property& property_setter(const U& value) + { + _value = static_cast(value); + return *this; + } + const property& property_setter(const property& value) + { + _value = value; + return *this; + } + template + const property& operator =(const property& value) + { + _value = value; + return *this; + } + + operator const Type() const {return get();} + + const Type get() const {return _value.get();} + Type& get() {return _value.get();} + + const Type operator*() const {return get();} + Type& operator*() {return get();} + + Type const* const operator->() const {return _value.get_ptr();} + Type* operator->() {return _value.get_ptr();} + + + const std::string ToString() const {return ::ToString(get());} + + const bool operator ==(property const& rhs) const {return get() == rhs.get();} + const bool operator !=(property const& rhs) const {return get() != rhs.get();} + const bool operator < (property const& rhs) const {return get() < rhs.get();} + const bool operator > (property const& rhs) const {return get() > rhs.get();} + const bool operator <=(property const& rhs) const {return get() <= rhs.get();} + const bool operator >=(property const& rhs) const {return get() >= rhs.get();} + + const bool operator ==(Parameter rhs) const {return get() == rhs;} + const bool operator !=(Parameter rhs) const {return get() != rhs;} + const bool operator < (Parameter rhs) const {return get() < rhs;} + const bool operator > (Parameter rhs) const {return get() > rhs;} + const bool operator <=(Parameter rhs) const {return get() <= rhs;} + const bool operator >=(Parameter rhs) const {return get() >= rhs;} + + template const bool operator ==(const T rhs) const {return get() == rhs;} + template const bool operator !=(const T rhs) const {return get() != rhs;} + template const bool operator < (const T rhs) const {return get() < rhs;} + template const bool operator > (const T rhs) const {return get() > rhs;} + template const bool operator <=(const T rhs) const {return get() <= rhs;} + template const bool operator >=(const T rhs) const {return get() >= rhs;} + + template const property& operator +=(const T value) {_value += value; return *this;} + template const property& operator -=(const T value) {_value -= value; return *this;} + template const property& operator *=(const T value) {_value *= value; return *this;} + template const property& operator /=(const T value) {_value /= value; return *this;} + + template const Type operator +(const T rhs) const {return _value + rhs;} + template const Type operator -(const T rhs) const {return _value - rhs;} + template const Type operator *(const T rhs) const {return _value * rhs;} + template const Type operator /(const T rhs) const {return _value / rhs;} + + template const Type operator +(const property& rhs) const {return _value + rhs.get();} + template const Type operator -(const property& rhs) const {return _value - rhs.get();} + template const Type operator *(const property& rhs) const {return _value * rhs.get();} + template const Type operator /(const property& rhs) const {return _value / rhs.get();} + + +private: + + template + class _property + { + private: + typedef typename boost::call_traits::param_type Parameter; + + public: + _property() {Setter()(_value, Type());} + _property(Parameter value, const Setter&, const Getter&) + : _value(value) + { + Setter()(_value, value); + } + + template + _property(property const& rhs, const Setter&, const Getter&) + : _value(rhs.get()) + { + Setter()(_value, rhs.get()); + } + + + void operator =(Parameter value) {Setter()(_value, value);} + + const Type get() const {return Getter()(_value);} + Type& get() {return _value;} + + + Type const* const get_ptr() const {return &_value;} + Type* get_ptr() {return &_value;} + + template void operator +=(const T value) {Setter()(_value, _value + value);} + template void operator -=(const T value) {Setter()(_value, _value - value);} + template void operator *=(const T value) {Setter()(_value, _value * value);} + template void operator /=(const T value) {Setter()(_value, _value / value);} + + template const Type operator +(const T value) const {return _value + value;} + template const Type operator -(const T value) const {return _value - value;} + template const Type operator *(const T value) const {return _value * value;} + template const Type operator /(const T value) const {return _value / value;} + + private: + Type _value; + }; + + + template + class _property + { + private: + typedef typename boost::call_traits::param_type Parameter; + + public: + _property() {_setter(_value, Type());} + + _property(const Setter& setter, const Getter& getter) + : + _setter(setter), + _getter(getter) + { + _setter(_value, Type()); + } + + _property(Parameter value, const Setter& setter, const Getter& getter) + : + _value(value), + _setter(setter), + _getter(getter) + { + _setter(_value, value); + } + + template + _property(property const& rhs, const Setter& setter, const Getter& getter) + : + _value(rhs.get()), + _setter(setter), + _getter(getter) + { + _setter(_value, rhs.get()); + } + + + void operator =(Parameter value) {_setter(_value, value);} + void operator =(const _property& rhs) + { + if(this != &rhs) + { + _setter(_value, rhs.get()); + } + return *this; + } + template void operator =(const property & rhs) + { + _setter(_value, rhs.get()); + } + + + const Type get() const {return _getter(_value);} + Type& get() {return _value;} + + Type const* const get_ptr() const {return &_value;} + Type* get_ptr() {return &_value;} + + template void operator +=(const T value) {_setter(_value, _value + value);} + template void operator -=(const T value) {_setter(_value, _value - value);} + template void operator *=(const T value) {_setter(_value, _value * value);} + template void operator /=(const T value) {_setter(_value, _value / value);} + + template const Type operator +(const T value) const {return _value + value;} + template const Type operator -(const T value) const {return _value - value;} + template const Type operator *(const T value) const {return _value * value;} + template const Type operator /(const T value) const {return _value / value;} + + private: + Type _value; + Setter _setter; + Getter _getter; + }; + +private: + _property::value && + boost::has_trivial_constructor::value> _value; + +}; + + +template const bool operator ==(const T x, property const& y) {return y == x;} +template const bool operator !=(const T x, property const& y) {return y != x;} +template const bool operator < (const T x, property const& y) {return y >= x;} +template const bool operator > (const T x, property const& y) {return y <= x;} +template const bool operator <=(const T x, property const& y) {return y > x;} +template const bool operator >=(const T x, property const& y) {return y < x;} + +template const bool operator ==(const V x, property const& y) {return y == x;} +template const bool operator !=(const V x, property const& y) {return y != x;} +template const bool operator < (const V x, property const& y) {return y < x;} +template const bool operator > (const V x, property const& y) {return y > x;} +template const bool operator <=(const V x, property const& y) {return y <= x;} +template const bool operator >=(const V x, property const& y) {return y >= x;} + + +template +const property& property_setter(property& lhs, const U& rhs) +{ + return lhs.property_setter(rhs); +} + + +template +const std::string ToString(const property& value) +{ + return value.ToString(); +} + +#endif // UTILITY_PROPERTY_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Exception/Base.cpp b/ASCOfficeOdtFile/Source/XML/Exception/Base.cpp new file mode 100644 index 0000000000..c9b2000f35 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Exception/Base.cpp @@ -0,0 +1,18 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "Base.h" + + +namespace XML +{ + namespace Exception + { + Base::Base(const std::string& message) + : log_invalid_argument(message) + { + } + } // namespace Exception +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Exception/Base.h b/ASCOfficeOdtFile/Source/XML/Exception/Base.h new file mode 100644 index 0000000000..6bd0c7e3d6 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Exception/Base.h @@ -0,0 +1,21 @@ +#pragma once +#ifndef XML_EXCEPTION_BASE_INCLUDE_H_ +#define XML_EXCEPTION_BASE_INCLUDE_H_ + +#include "Exception/log_invalid_argument.h" +#include + + +namespace XML +{ + namespace Exception + { + class Base : public log_invalid_argument + { + public: + Base(const std::string& message); + }; + } // namespace Exception +} // namespace XML + +#endif // XML_EXCEPTION_BASE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Exception/Declaration.cpp b/ASCOfficeOdtFile/Source/XML/Exception/Declaration.cpp new file mode 100644 index 0000000000..6a110f0490 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Exception/Declaration.cpp @@ -0,0 +1,18 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "Declaration.h" + + +namespace XML +{ + namespace Exception + { + Declaration::Declaration(const std::string& message) + : Base(message) + { + } + } // namespace Exception +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Exception/Declaration.h b/ASCOfficeOdtFile/Source/XML/Exception/Declaration.h new file mode 100644 index 0000000000..34369e0e7b --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Exception/Declaration.h @@ -0,0 +1,20 @@ +#pragma once +#ifndef XML_EXCEPTION_DECLARATION_INCLUDE_H_ +#define XML_EXCEPTION_DECLARATION_INCLUDE_H_ + +#include "Base.h" + + +namespace XML +{ + namespace Exception + { + class Declaration : public Base + { + public: + Declaration(const std::string& message); + }; + } // namespace Exception +} // namespace XML + +#endif // XML_EXCEPTION_DECLARATION_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Exception/Namespace.cpp b/ASCOfficeOdtFile/Source/XML/Exception/Namespace.cpp new file mode 100644 index 0000000000..20d1137dd9 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Exception/Namespace.cpp @@ -0,0 +1,18 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "Namespace.h" + + +namespace XML +{ + namespace Exception + { + Namespace::Namespace(const std::string& message) + : Base(message) + { + } + } // namespace Exception +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Exception/Namespace.h b/ASCOfficeOdtFile/Source/XML/Exception/Namespace.h new file mode 100644 index 0000000000..50f37ea6af --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Exception/Namespace.h @@ -0,0 +1,20 @@ +#pragma once +#ifndef XML_EXCEPTION_NAMESPACE_INCLUDE_H_ +#define XML_EXCEPTION_NAMESPACE_INCLUDE_H_ + +#include "Base.h" + + +namespace XML +{ + namespace Exception + { + class Namespace : public Base + { + public: + Namespace(const std::string& message); + }; + } // namespace Exception +} // namespace XML + +#endif // XML_EXCEPTION_NAMESPACE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Exception/Parse.cpp b/ASCOfficeOdtFile/Source/XML/Exception/Parse.cpp new file mode 100644 index 0000000000..df7539511f --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Exception/Parse.cpp @@ -0,0 +1,18 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "Parse.h" + + +namespace XML +{ + namespace Exception + { + Parse::Parse(const std::string& message) + : Base(message) + { + } + } // namespace Exception +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Exception/Parse.h b/ASCOfficeOdtFile/Source/XML/Exception/Parse.h new file mode 100644 index 0000000000..d5065f8606 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Exception/Parse.h @@ -0,0 +1,20 @@ +#pragma once +#ifndef XML_EXCEPTION_PARSE_INCLUDE_H_ +#define XML_EXCEPTION_PARSE_INCLUDE_H_ + +#include "Base.h" + + +namespace XML +{ + namespace Exception + { + class Parse : public Base + { + public: + Parse(const std::string& message); + }; + } // namespace Exception +} // namespace XML + +#endif // XML_EXCEPTION_PARSE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Extension/Fill.h b/ASCOfficeOdtFile/Source/XML/Extension/Fill.h new file mode 100644 index 0000000000..f78f461d17 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Extension/Fill.h @@ -0,0 +1,334 @@ +#pragma once +#ifndef XML_FILL_INCLUDE_H_ +#define XML_FILL_INCLUDE_H_ + +#include "property.h" +#include "./../XElement.h" +#include "./../Private/XElementContainer.h" + + +namespace XML +{ + + template + void Fill(T& container, const XML::XElement& element) + { + for (Private::XElementContainer::const_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + container.push_back(T::value_type(XElement(*i))); + container.back().this_is_not_xobject_class(); + } + } + + + template + void Fill(property& container, const XML::XElement& element) + { + for (Private::XElementContainer::const_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + container->push_back(T::value_type(XElement(*i))); + container->back().this_is_not_xobject_class(); + } + } + + + template + void Fill(T& container, const XML::XElement& element, const std::string& name) + { + for (Private::XElementContainer::const_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + if (XElement(*i)->XName == name) + { + container.push_back(T::value_type(XElement(*i))); + container.back().this_is_not_xobject_class(); + } + } + } + + + template + void Fill(property& container, const XML::XElement& element, const std::string& name) + { + for (Private::XElementContainer::const_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + if (XElement(*i)->XName == name) + { + container->push_back(T::value_type(XElement(*i))); + container->back().this_is_not_xobject_class(); + } + } + } + + + template + void Fill(T& container, const XML::XElement& element, const std::string& name1, const std::string& name2) + { + for (Private::XElementContainer::const_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + const std::string name = XElement(*i)->XName->Name; + if (name == name1 || name == name2) + { + container.push_back(T::value_type(XElement(*i))); + container.back().this_is_not_xobject_class(); + } + } + } + + + template + void Fill(property& container, const XML::XElement& element, const std::string& name1, const std::string& name2) + { + for (Private::XElementContainer::const_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + const std::string name = XElement(*i)->XName->Name; + if (name == name1 || name == name2) + { + container->push_back(T::value_type(XElement(*i))); + container->back().this_is_not_xobject_class(); + } + } + } + + + template + void Fill(T& container, const XML::XElement& element, const std::string& name1, const std::string& name2, const std::string& name3) + { + for (Private::XElementContainer::const_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + const std::string name = XElement(*i)->XName->Name; + if (name == name1 || name == name2 || name == name3) + { + container.push_back(T::value_type(XElement(*i))); + container.back().this_is_not_xobject_class(); + } + } + } + + + template + void Fill(property& container, const XML::XElement& element, const std::string& name1, const std::string& name2, const std::string& name3) + { + for (Private::XElementContainer::const_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + const std::string name = XElement(*i)->XName->Name; + if (name == name1 || name == name2 || name == name3) + { + container->push_back(T::value_type(XElement(*i))); + container->back().this_is_not_xobject_class(); + } + } + } + + + template + void Fill(T& container, const XML::XElement& element, const std::string& name1, const std::string& name2, const std::string& name3, const std::string& name4) + { + for (Private::XElementContainer::const_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + const std::string name = XElement(*i)->XName->Name; + if (name == name1 || name == name2 || name == name3 || name == name4) + { + container.push_back(T::value_type(XElement(*i))); + container.back().this_is_not_xobject_class(); + } + } + } + + + template + void Fill(property& container, const XML::XElement& element, const std::string& name1, const std::string& name2, const std::string& name3, const std::string& name4) + { + for (Private::XElementContainer::const_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + const std::string name = XElement(*i)->XName->Name; + if (name == name1 || name == name2 || name == name3 || name == name4) + { + container->push_back(T::value_type(XElement(*i))); + container->back().this_is_not_xobject_class(); + } + } + } + + + template + void Fill(T& container, const XML::XElement& element, const std::string& name1, const std::string& name2, const std::string& name3, const std::string& name4, const std::string& name5) + { + for (Private::XElementContainer::const_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + const std::string name = XElement(*i)->XName->Name; + if (name == name1 || name == name2 || name == name3 || name == name4 || name == name5) + { + container.push_back(T::value_type(XElement(*i))); + container.back().this_is_not_xobject_class(); + } + } + } + + + template + void Fill(property& container, const XML::XElement& element, const std::string& name1, const std::string& name2, const std::string& name3, const std::string& name4, const std::string& name5) + { + for (Private::XElementContainer::const_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + const std::string name = XElement(*i)->XName->Name; + if (name == name1 || name == name2 || name == name3 || name == name4 || name == name5) + { + container->push_back(T::value_type(XElement(*i))); + container->back().this_is_not_xobject_class(); + } + } + } + + + template + void Fill(T& container, const XML::XElement& element, const std::string& name1, const std::string& name2, const std::string& name3, const std::string& name4, const std::string& name5, const std::string& name6) + { + for (Private::XElementContainer::const_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + const std::string name = XElement(*i)->XName->Name; + if (name == name1 || name == name2 || name == name3 || name == name4 || name == name5 || name == name6) + { + container.push_back(T::value_type(XElement(*i))); + container.back().this_is_not_xobject_class(); + } + } + } + + + template + void Fill(property& container, const XML::XElement& element, const std::string& name1, const std::string& name2, const std::string& name3, const std::string& name4, const std::string& name5, const std::string& name6) + { + for (Private::XElementContainer::const_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + const std::string name = XElement(*i)->XName->Name; + if (name == name1 || name == name2 || name == name3 || name == name4 || name == name5 || name == name6) + { + container->push_back(T::value_type(XElement(*i))); + container->back().this_is_not_xobject_class(); + } + } + } + + + template + void Fill(T& container, const XML::XElement& element, const std::string& name1, const std::string& name2, const std::string& name3, const std::string& name4, const std::string& name5, const std::string& name6, const std::string& name7) + { + for (Private::XElementContainer::const_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + const std::string name = XElement(*i)->XName->Name; + if (name == name1 || name == name2 || name == name3 || name == name4 || name == name5 || name == name6 || name == name7) + { + container.push_back(T::value_type(XElement(*i))); + container.back().this_is_not_xobject_class(); + } + } + } + + + template + void Fill(property& container, const XML::XElement& element, const std::string& name1, const std::string& name2, const std::string& name3, const std::string& name4, const std::string& name5, const std::string& name6, const std::string& name7) + { + for (Private::XElementContainer::const_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + const std::string name = XElement(*i)->XName->Name; + if (name == name1 || name == name2 || name == name3 || name == name4 || name == name5 || name == name6 || name == name7) + { + container->push_back(T::value_type(XElement(*i))); + container->back().this_is_not_xobject_class(); + } + } + } + + + template + void Fill(T& container, const XML::XElement& element, const std::string& name1, const std::string& name2, const std::string& name3, const std::string& name4, const std::string& name5, const std::string& name6, const std::string& name7, const std::string& name8) + { + for (Private::XElementContainer::const_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + const std::string name = XElement(*i)->XName->Name; + if (name == name1 || name == name2 || name == name3 || name == name4 || name == name5 || name == name6 || name == name7 || name == name8) + { + container.push_back(T::value_type(XElement(*i))); + container.back().this_is_not_xobject_class(); + } + } + } + + + template + void Fill(property& container, const XML::XElement& element, const std::string& name1, const std::string& name2, const std::string& name3, const std::string& name4, const std::string& name5, const std::string& name6, const std::string& name7, const std::string& name8) + { + for (Private::XElementContainer::const_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + const std::string name = XElement(*i)->XName->Name; + if (name == name1 || name == name2 || name == name3 || name == name4 || name == name5 || name == name6 || name == name7 || name == name8) + { + container->push_back(T::value_type(XElement(*i))); + container->back().this_is_not_xobject_class(); + } + } + } + + + template + void Fill(T& container, const XML::XElement& element, const std::string& name1, const std::string& name2, const std::string& name3, const std::string& name4, const std::string& name5, const std::string& name6, const std::string& name7, const std::string& name8, const std::string& name9) + { + for (Private::XElementContainer::const_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + const std::string name = XElement(*i)->XName->Name; + if (name == name1 || name == name2 || name == name3 || name == name4 || name == name5 || name == name6 || name == name7 || name == name8 || name == name9) + { + container.push_back(T::value_type(XElement(*i))); + container.back().this_is_not_xobject_class(); + } + } + } + + + template + void Fill(property& container, const XML::XElement& element, const std::string& name1, const std::string& name2, const std::string& name3, const std::string& name4, const std::string& name5, const std::string& name6, const std::string& name7, const std::string& name8, const std::string& name9) + { + for (Private::XElementContainer::const_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + const std::string name = XElement(*i)->XName->Name; + if (name == name1 || name == name2 || name == name3 || name == name4 || name == name5 || name == name6 || name == name7 || name == name8 || name == name9) + { + container->push_back(T::value_type(XElement(*i))); + container->back().this_is_not_xobject_class(); + } + } + } + + + template + void Fill(T& container, const XML::XElement& element, const std::string& name1, const std::string& name2, const std::string& name3, const std::string& name4, const std::string& name5, const std::string& name6, const std::string& name7, const std::string& name8, const std::string& name9, const std::string& name10) + { + for (Private::XElementContainer::const_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + const std::string name = XElement(*i)->XName->Name; + if (name == name1 || name == name2 || name == name3 || name == name4 || name == name5 || name == name6 || name == name7 || name == name8 || name == name9 || name == name10) + { + container.push_back(T::value_type(XElement(*i))); + container.back().this_is_not_xobject_class(); + } + } + } + + + template + void Fill(property& container, const XML::XElement& element, const std::string& name1, const std::string& name2, const std::string& name3, const std::string& name4, const std::string& name5, const std::string& name6, const std::string& name7, const std::string& name8, const std::string& name9, const std::string& name10) + { + for (Private::XElementContainer::const_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + const std::string name = XElement(*i)->XName->Name; + if (name == name1 || name == name2 || name == name3 || name == name4 || name == name5 || name == name6 || name == name7 || name == name8 || name == name9 || name == name10) + { + container->push_back(T::value_type(XElement(*i))); + container->back().this_is_not_xobject_class(); + } + } + } + +} // namespace XML + +#endif // XML_FILL_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Extension/FillFromAttribute.h b/ASCOfficeOdtFile/Source/XML/Extension/FillFromAttribute.h new file mode 100644 index 0000000000..313144536d --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Extension/FillFromAttribute.h @@ -0,0 +1,42 @@ +#pragma once +#ifndef XML_FILL_FROM_ATTRIBUTE_INCLUDE_H_ +#define XML_FILL_FROM_ATTRIBUTE_INCLUDE_H_ + +#include "property.h" +#include "./../XML.h" +#include + + +namespace XML +{ + template + void FillFromAttribute(T& container, const XML::XElement& element, const XML::XName& xname, typename boost::call_traits::param_type value) + { + for (XML::const_element_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + XElement element(*i); + if (element.attribute(xname).exist() && element.attribute(name).value() == value) + { + container.push_back(T::value_type(XElement(*i))); + container.back().this_is_not_xobject_class(); + } + } + } + + + template + void FillFromAttribute(property& container, const XML::XElement& element, const XML::XName& xname, typename boost::call_traits::param_type value) + { + for (XML::const_element_iterator i = element.Elements.begin(); i != element.Elements.end(); ++i) + { + XElement element(*i); + if (element.attribute(name).exist() && element.attribute(name).value() == value) + { + container.push_back(T::value_type(XElement(*i))); + container.back().this_is_not_xobject_class(); + } + } + } +} // namespace XML + +#endif // XML_FILL_FROM_ATTRIBUTE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Extension/Write.cpp b/ASCOfficeOdtFile/Source/XML/Extension/Write.cpp new file mode 100644 index 0000000000..87937cb903 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Extension/Write.cpp @@ -0,0 +1,17 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "Write.h" +#include "./../XObject.h" +#include "./../XElement.h" + + +namespace XML +{ + const XNode Write(const XObject& object) + { + return object.toXML(); + } +} \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Extension/Write.h b/ASCOfficeOdtFile/Source/XML/Extension/Write.h new file mode 100644 index 0000000000..776f7fcaf1 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Extension/Write.h @@ -0,0 +1,199 @@ +#pragma once +#ifndef XML_EXTENSION_WRITE_INCLUDE_H_ +#define XML_EXTENSION_WRITE_INCLUDE_H_ + +#include "nullable.h" +#include "property.h" +#include "nullable_property.h" +#include +#include "./../XNode.h" +#include "./../XName.h" +#include +#include + + +namespace XML +{ + class XObject; + + const XNode Write(const XObject& object); + + template + const XNode Write(const O& object, const T& value) + { + return object.toXML(value); + } + + + template + const XNode Write(const nullable& object) + { + if (object.is_init()) + { + object->this_is_not_xobject_class(); + return object->toXML(); + } + return XNode(); + } + + + template + const XNode Write(const property& object) + { + object->this_is_not_xobject_class(); + return object->toXML(); + } + + + template + const XNode Write(const property& object, const V& value) + { + object->this_is_not_xobject_class(); + return object->toXML(value); + } + + + template + const XNode Write(const nullable_property& object) + { + if (object.is_init()) + { + object->this_is_not_xobject_class(); + return object->toXML(); + } + return XNode(); + } + + + template + const XNode Write(const nullable_property& object, const V& value) + { + if (object.is_init()) + { + object->this_is_not_xobject_class(); + return object->toXML(value); + } + return XNode(); + } + + + template + const XNode Write(T* object) + { + if (object != 0) + { + object->this_is_not_xobject_class(); + return object->toXML(); + } + return XNode(); + } + + + template + const XNode Write(T* object, const V& value) + { + if (object != 0) + { + object->this_is_not_xobject_class(); + return object->toXML(value); + } + return XNode(); + } + + + template + const XNode Write(const boost::shared_ptr& object) + { + if (object != 0) + { + object->this_is_not_xobject_class(); + return object->toXML(); + } + return XNode(); + } + + + template + const XNode Write(const boost::shared_ptr& object, const V& value) + { + if (object != 0) + { + object->this_is_not_xobject_class(); + return object->toXML(value); + } + return XNode(); + } + + + template class C, typename T, class A> + const XNode Write(const C& container) + { + return XContainer(container); + } + + + template class C, typename T, class A, typename V> + const XNode Write(const C& container, const V& value) + { + XContainer xcontainer; + BOOST_FOREACH(const T& object, container) + { + xcontainer.Add(object.toXML(value)); + } + return xcontainer; + } + + + template class C, typename T, class A> + const XNode Write(const property >& container) + { + return XContainer(container); + } + + + template class C, typename T, class A, typename V> + const XNode Write(const property >& container, const V& value) + { + XContainer xcontainer; + BOOST_FOREACH(const T& object, *container) + { + xcontainer.Add(object.toXML(value)); + } + return xcontainer; + } + + + template + const XML::XNode Write(const XML::XName& element, const XML::XName& attribute, const T& value) + { + return XML::XElement(element, XML::XAttribute(attribute, value)); + } + + + template + const XML::XNode Write(const XML::XName& element, const XML::XName& attribute, const nullable& value) + { + if (value.is_init()) + return XML::XElement(element, XML::XAttribute(attribute, *value)); + return XML::XNode(); + } + + + template + const XML::XNode Write(const XML::XName& element, const XML::XName& attribute, const property& value) + { + return XML::XElement(element, XML::XAttribute(attribute, value)); + } + + + template + const XML::XNode Write(const XML::XName& element, const XML::XName& attribute, const nullable_property& value) + { + if (value.is_init()) + return XML::XElement(element, XML::XAttribute(attribute, value)); + return XML::XNode(); + } + +} // namespace XML + +#endif // XMK_EXTENSION_WRITE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Extension/WriteIf.cpp b/ASCOfficeOdtFile/Source/XML/Extension/WriteIf.cpp new file mode 100644 index 0000000000..1d2c2889ae --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Extension/WriteIf.cpp @@ -0,0 +1,139 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "WriteIf.h" + + +namespace XML +{ + + const XML::XNode WriteIf(const XName& xname, const bool write) + { + if (write) + return XML::XElement(xname); + return XML::XNode(); + } + + + const XML::XNode WriteIf(const XName& xname, const nullable write) + { + if (write.get_value_or(false)) + return XML::XElement(xname); + return XML::XNode(); + } + + + const XML::XNode WriteIf(const XName& xname, const property write) + { + if (write) + return XML::XElement(xname); + return XML::XNode(); + } + + + const XML::XNode WriteIf(const XName& xname, const nullable_property write) + { + if (write.get_value_or(false)) + return XML::XElement(xname); + return XML::XNode(); + } + + + const XML::XNode WriteIf(const XML::XElement& element, const bool write) + { + if (write) + return element; + return XML::XNode(); + } + + + const XML::XNode WriteIf(const XML::XElement& element, const nullable write) + { + if (write.get_value_or(false)) + return element; + return XML::XNode(); + } + + + const XML::XNode WriteIf(const XML::XElement& element, const property write) + { + if (write) + return element; + return XML::XNode(); + } + + + const XML::XNode WriteIf(const XML::XElement& element, const nullable_property write) + { + if (write.get_value_or(false)) + return element; + return XML::XNode(); + } + + + const XML::XNode WriteIf(const XML::XNode& node, const bool write) + { + if (write) + return node; + return XML::XNode(); + } + + + const XML::XNode WriteIf(const XML::XNode& node, const nullable write) + { + if (write.get_value_or(write)) + return node; + return XML::XNode(); + } + + + const XML::XNode WriteIf(const XML::XNode& node, const property write) + { + if (write) + return node; + return XML::XNode(); + } + + + const XML::XNode WriteIf(const XML::XNode& node, const nullable_property write) + { + if (write.get_value_or(false)) + return node; + return XML::XNode(); + } + + + const XML::XAttribute WriteIf(const XML::XAttribute& attribute, const bool write) + { + if (write) + return attribute; + return XML::XAttribute(); + } + + + const XML::XAttribute WriteIf(const XML::XAttribute& attribute, const nullable write) + { + if (write.get_value_or(false)) + return attribute; + return XML::XAttribute(); + } + + + const XML::XAttribute WriteIf(const XML::XAttribute& attribute, const property write) + { + if (write) + return attribute; + return XML::XAttribute(); + } + + + const XML::XAttribute WriteIf(const XML::XAttribute& attribute, const nullable_property write) + { + if (write.get_value_or(false)) + return attribute; + return XML::XAttribute(); + } + +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Extension/WriteIf.h b/ASCOfficeOdtFile/Source/XML/Extension/WriteIf.h new file mode 100644 index 0000000000..486d541bb0 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Extension/WriteIf.h @@ -0,0 +1,37 @@ +#pragma once +#ifndef XML_EXTENSION_WRITE_IF_INCLUDE_H_ +#define XML_EXTENSION_WRITE_IF_INCLUDE_H_ + +#include "nullable.h" +#include "property.h" +#include "nullable_property.h" +#include "./../XName.h" +#include "./../XNode.h" +#include "./../XElement.h" +#include "./../XAttribute.h" + + +namespace XML +{ + const XML::XNode WriteIf(const XName& xname, const bool write); + const XML::XNode WriteIf(const XName& xname, const nullable write); + const XML::XNode WriteIf(const XName& xname, const property write); + const XML::XNode WriteIf(const XName& xname, const nullable_property write); + + const XML::XNode WriteIf(const XML::XElement& element, const bool write); + const XML::XNode WriteIf(const XML::XElement& element, const nullable write); + const XML::XNode WriteIf(const XML::XElement& element, const property write); + const XML::XNode WriteIf(const XML::XElement& element, const nullable_property write); + + const XML::XNode WriteIf(const XML::XNode& node, const bool write); + const XML::XNode WriteIf(const XML::XNode& node, const nullable write); + const XML::XNode WriteIf(const XML::XNode& node, const property write); + const XML::XNode WriteIf(const XML::XNode& node, const nullable_property write); + + const XML::XAttribute WriteIf(const XML::XAttribute& attribute, const bool write); + const XML::XAttribute WriteIf(const XML::XAttribute& attribute, const nullable write); + const XML::XAttribute WriteIf(const XML::XAttribute& attribute, const property write); + const XML::XAttribute WriteIf(const XML::XAttribute& attribute, const nullable_property write); +} // namespace XML + +#endif // XML_EXTENSION_WRITE_IF_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Limit/Encoding.cpp b/ASCOfficeOdtFile/Source/XML/Limit/Encoding.cpp new file mode 100644 index 0000000000..54ba49abb1 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Limit/Encoding.cpp @@ -0,0 +1,25 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "Encoding.h" +#include "./../Exception/Declaration.h" + + +namespace XML +{ + namespace Limit + { + Encoding::Encoding() + { + add("UTF-8"); + add("utf-8"); + } + + const std::string Encoding::no_find() const + { + throw Exception::Declaration("declaration encoding error"); + } + } // namespace Limit +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Limit/Encoding.h b/ASCOfficeOdtFile/Source/XML/Limit/Encoding.h new file mode 100644 index 0000000000..43cfe880c0 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Limit/Encoding.h @@ -0,0 +1,22 @@ +#pragma once +#ifndef XML_LIMIT_ENCODING_INCLUDE_H_ +#define XML_LIMIT_ENCODING_INCLUDE_H_ + +#include +#include "setter.h" + + +namespace XML +{ + namespace Limit + { + class Encoding : public setter::from + { + public: + Encoding(); + const std::string no_find() const; + }; + } // namespace Limit +} // namespace XML + +#endif // XML_LIMIT_ENCODING_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Limit/Standalone.cpp b/ASCOfficeOdtFile/Source/XML/Limit/Standalone.cpp new file mode 100644 index 0000000000..9ab0fe211d --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Limit/Standalone.cpp @@ -0,0 +1,25 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "Standalone.h" +#include "./../Exception/Declaration.h" + + +namespace XML +{ + namespace Limit + { + Standalone::Standalone() + { + add("yes"); + add("no"); + } + + const std::string Standalone::no_find() const + { + throw Exception::Declaration("declaration standalone error"); + } + } // namespace Limit +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Limit/Standalone.h b/ASCOfficeOdtFile/Source/XML/Limit/Standalone.h new file mode 100644 index 0000000000..3d5a3d16ed --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Limit/Standalone.h @@ -0,0 +1,22 @@ +#pragma once +#ifndef XML_LIMIT_STANDALONE_INCLUDE_H_ +#define XML_LIMIT_STANDALONE_INCLUDE_H_ + +#include +#include "setter.h" + + +namespace XML +{ + namespace Limit + { + class Standalone : public setter::from + { + public: + Standalone(); + const std::string no_find() const; + }; + } // namespace Limit +} // namespace XML + +#endif // XML_LIMIT_STANDALONE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Limit/Version.cpp b/ASCOfficeOdtFile/Source/XML/Limit/Version.cpp new file mode 100644 index 0000000000..6fc82fc5e7 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Limit/Version.cpp @@ -0,0 +1,24 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "Version.h" +#include "./../Exception/Declaration.h" + + +namespace XML +{ + namespace Limit + { + Version::Version() + { + add("1.0"); + } + + const std::string Version::no_find() const + { + throw Exception::Declaration("declaration version error"); + } + } // namespace Limit +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Limit/Version.h b/ASCOfficeOdtFile/Source/XML/Limit/Version.h new file mode 100644 index 0000000000..aaa08323cd --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Limit/Version.h @@ -0,0 +1,22 @@ +#pragma once +#ifndef XML_LIMIT_VERSION_INCLUDE_H_ +#define XML_LIMIT_VERSION_INCLUDE_H_ + +#include +#include "setter.h" + + +namespace XML +{ + namespace Limit + { + class Version : public setter::from + { + public: + Version(); + const std::string no_find() const; + }; + } // namespace Limit +} // namespace XML + +#endif // XML_LIMIT_VERSION_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/Attribute.cpp b/ASCOfficeOdtFile/Source/XML/Private/Attribute.cpp new file mode 100644 index 0000000000..b65c329eca --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/Attribute.cpp @@ -0,0 +1,83 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "Attribute.h" +#include "Lexigraph.h" +#include "Encoding.h" + + +namespace XML +{ + namespace Private + { + + Attribute::Attribute(const XML::XName& xname, const std::string& value) + : XName(xname), + Value(value) + { + } + + + Attribute::Attribute() + { + } + + + const bool Attribute::operator ==(const Attribute& rhs) const + { + //return ((XName == rhs.XName) || (XName->Equal(*rhs.XName)));// && Value == rhs.Value; + return (XName->Equal(*rhs.XName)); + } + + + const bool Attribute::operator <(const Attribute& rhs) const + { + return ((*XName->Name) < (*rhs.XName->Name)); + } + + + const bool Attribute::exist() const + { + return true; + } + + + const std::string Attribute::ToString() const + { + return XName->ToString() + "=\"" + Private::Lexigraph::toSource(Value->ToString()) + "\""; + } + + + const std::wstring Attribute::ToWString() const + { + return XName->ToWString() + L"=\"" + Encoding::utf82unicode(Private::Lexigraph::toSource(Value->ToString())) + L"\""; + } + + + void Attribute::SaveToStringList(std::list& strList)const + { + XName->SaveToStringList(strList); + strList.push_back("=\""); + strList.push_back(Private::Lexigraph::toSource(Value->ToString())); + strList.push_back("\""); + } + + + void Attribute::SaveToWStringList(std::list& strList)const + { + XName->SaveToWStringList(strList); + strList.push_back(L"=\""); + strList.push_back(Encoding::utf82unicode(Private::Lexigraph::toSource(Value->ToString()))); + strList.push_back(L"\""); + } + + + const XString Attribute::value() const + { + return *Value; + } + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/Attribute.h b/ASCOfficeOdtFile/Source/XML/Private/Attribute.h new file mode 100644 index 0000000000..4d29baab62 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/Attribute.h @@ -0,0 +1,45 @@ +#pragma once +#ifndef XML_PRIVATE_XATTRIBUTE_INCLUDE_H_ +#define XML_PRIVATE_XATTRIBUTE_INNLUDE_H_ + +#include +#include "XString.h" +#include "./../XName.h" +#include "property.h" +#include + + +namespace XML +{ + namespace Private + { + class Attribute + { + public: + Attribute(const XName& xname, const std::string& value); + + public: + const bool operator ==(const Attribute& rhs) const; + const bool operator <(const Attribute& rhs) const; + virtual const bool exist() const; + + public: + const std::string ToString() const; + const std::wstring ToWString() const; + virtual void SaveToStringList(std::list& strList)const; + virtual void SaveToWStringList(std::list& strList)const; + + public: + const XString value() const; + + public: + property XName; + property Value; + + protected: + Attribute(); + }; + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_ATTRIBUTE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/Comment.cpp b/ASCOfficeOdtFile/Source/XML/Private/Comment.cpp new file mode 100644 index 0000000000..cd88194b0d --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/Comment.cpp @@ -0,0 +1,78 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "Comment.h" +#include "Lexigraph.h" +#include "Encoding.h" + + +namespace XML +{ + namespace Private + { + + Comment::Comment() + { + } + + + Comment::Comment(const std::string& value) + : Value(value) + { + } + + + Comment::~Comment() + { + } + + + const bool Comment::isElement() const + { + return false; + } + + + const bool Comment::isText() const + { + return false; + } + + + const bool Comment::isComment() const + { + return true; + } + + + const std::string Comment::ToString() const + { + return ""; + } + + + const std::wstring Comment::ToWString() const + { + return L""; + } + + + void Comment::SaveToStringList(std::list& strList)const + { + strList.push_back(""); + } + + + void Comment::SaveToWStringList(std::list& strList)const + { + strList.push_back(L""); + } + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/Comment.h b/ASCOfficeOdtFile/Source/XML/Private/Comment.h new file mode 100644 index 0000000000..3fc3004bf4 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/Comment.h @@ -0,0 +1,41 @@ +#pragma once +#ifndef XML_PRIVATE_COMMENT_INCLUDE_H_ +#define XML_PRIVATE_COMMENT_INCLUDE_H_ + +#include "Node.h" +#include +#include "XString.h" +#include "property.h" + + +namespace XML +{ + namespace Private + { + class Comment : public Node + { + public: + explicit Comment(const std::string& value); + virtual ~Comment(); + + public: + virtual const bool isElement() const; + virtual const bool isText() const; + virtual const bool isComment() const; + + public: + virtual const std::string ToString() const; + virtual const std::wstring ToWString() const; + virtual void SaveToStringList(std::list& strList)const; + virtual void SaveToWStringList(std::list& strList)const; + + public: + XString Value; + + protected: + Comment(); + }; + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_COMMENT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/Element.cpp b/ASCOfficeOdtFile/Source/XML/Private/Element.cpp new file mode 100644 index 0000000000..c68ca1171b --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/Element.cpp @@ -0,0 +1,458 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "Element.h" +#include "XList.h" +#include "./../Exception/Parse.h" +#include "./../Exception/Namespace.h" +#include +#include "Namespace.h" +#include "./../XAttribute.h" +#include "./../XAttribute.h" +#include "./../XNode.h" +#include "./../XElement.h" +#include "./../XText.h" +#include "./../XContainer.h" +#include +#include +#include "Exception/not_implement.h" +#include "Utility.h" + + +namespace XML +{ + namespace Private + { + + Element::Element() + { + } + + + Element::Element(const XML::XName& xname) + : XName(xname) + { + } + + + Element::Element(const XML::XName& xname, const XList& list) + : NodeContainer(list.Nodes), + XName(xname), + Attributes(list.Attributes), + Namespaces(list.Namespaces) + { + } + + + Element::Element(boost::shared_ptr source, const XNamespaceContainer& ns, const XSpace& space) + : Space(space) + { + fromSource(source, ns, Space); + } + + + Element::Element(boost::shared_ptr source, const XNamespaceContainer& ns, const XSpace& space) + : Space(space) + { + fromSource(source, ns, Space); + } + + + Element::~Element() + { + } + + + const bool Element::isElement() const + { + return true; + } + + + const bool Element::isText() const + { + return false; + } + + + const bool Element::isComment() const + { + return false; + } + + + void Element::fromSource(boost::shared_ptr source, const XNamespaceContainer& defineNamespaces, const XSpace& space) + { + Space = space; + source->skipSpace(); + + const std::pair name = source->getName(); + source->skipSpace(); + std::list, std::string> > attributes; + + while (source->get() != '/' && source->get() != '>') + { + const std::pair, const std::string> attribute = source->getAttribute(); + + if (attribute.first.first == "xmlns" || attribute.first.first.empty() && attribute.first.second == "xmlns") + { + Namespaces->push_back(XNamespace(attribute.first.second, attribute.second)); + } + else if (attribute.first.first == "xml") + { + if (attribute.first.second == "space") + { + if (attribute.second == "default") + Space->setDefault(); + else if (attribute.second == "preserve") + Space->setPreserve(); + else + throw Exception::Parse("bad space parametr"); + } + } + else + { + attributes.push_back(attribute); + } + source->skipSpace(); + } + + typedef std::pair, std::string> attribute_type; + BOOST_FOREACH(const attribute_type& attribute, attributes) + { + if (attribute.first.first.empty()) + { + Attributes.push_back(XAttribute(attribute.first.second, attribute.second)); + } + else + { + XNamespace thisNs = Namespaces[attribute.first.first]; + XNamespace defineNs = defineNamespaces[attribute.first.first]; + + if (thisNs.exist()) + Attributes.push_back(XAttribute(thisNs + attribute.first.second, attribute.second)); + else if (defineNs.exist()) + Attributes.push_back(XAttribute(defineNs + attribute.first.second, attribute.second)); + else + { + //Attributes.push_back(XAttribute(attribute.first.second, attribute.second)); + //throw Exception::Namespace("not define namespace"); + } + } + } + + XName->Name = name.second; + + if (!name.first.empty()) + { + XNamespace thisNs = Namespaces[name.first]; + XNamespace defineNs = defineNamespaces[name.first]; + + if (thisNs.exist()) + XName->Ns = thisNs; + else if (defineNs.exist()) + XName->Ns = defineNs; + else + { + //throw Exception::Namespace("not define namespace"); + } + } + + if (source->get() == '/') + { + source->findAndSkip('>'); + } + else + { + source->findAndSkip('>'); + XNamespaceContainer summaryNamespaces = Namespaces; + summaryNamespaces.merge(defineNamespaces); + NodeContainer::fromSource(source, summaryNamespaces, Space); + source->skipSpace(); + const std::pair name = source->getName(); + source->findAndSkip('>'); + } + } + + + void Element::fromSource(boost::shared_ptr source, const XNamespaceContainer& defineNamespaces, const XSpace& space) + { + Space = space; + source->skipSpace(); + + const std::pair name = source->getName(); + source->skipSpace(); + std::list, std::wstring> > attributes; + + while (source->get() != L'/' && source->get() != L'>') + { + const std::pair, const std::wstring> attribute = source->getAttribute(); + + if ((attribute.first.first == L"xmlns") || ((attribute.first.first.empty()) && (attribute.first.second == L"xmlns"))) + { + Namespaces->push_back(XNamespace(Encoding::unicode2utf8(attribute.first.second), Encoding::unicode2utf8(attribute.second))); + } + else if (attribute.first.first == L"xml") + { + if (attribute.first.second == L"space") + { + if (attribute.second == L"default") + Space->setDefault(); + else if (attribute.second == L"preserve") + Space->setPreserve(); + else + throw Exception::Parse("bad space parametr"); + } + } + else + { + attributes.push_back(attribute); + } + source->skipSpace(); + } + + typedef std::pair, std::wstring> attribute_type; + BOOST_FOREACH(const attribute_type& attribute, attributes) + { + if (attribute.first.first.empty()) + { + Attributes.push_back(XAttribute(Encoding::unicode2utf8(attribute.first.second), Encoding::unicode2utf8(attribute.second))); + } + else + { + XNamespace thisNs = Namespaces[Encoding::unicode2utf8(attribute.first.first)]; + XNamespace defineNs = defineNamespaces[Encoding::unicode2utf8(attribute.first.first)]; + + if (thisNs.exist()) + Attributes.push_back(XAttribute(thisNs + Encoding::unicode2utf8(attribute.first.second), Encoding::unicode2utf8(attribute.second))); + else if (defineNs.exist()) + Attributes.push_back(XAttribute(defineNs + Encoding::unicode2utf8(attribute.first.second), Encoding::unicode2utf8(attribute.second))); + else + throw Exception::Namespace("not define namespace"); + } + } + + XName->Name = Encoding::unicode2utf8(name.second); + + if (!name.first.empty()) + { + XNamespace thisNs = Namespaces[Encoding::unicode2utf8(name.first)]; + XNamespace defineNs = defineNamespaces[Encoding::unicode2utf8(name.first)]; + + if (thisNs.exist()) + XName->Ns = thisNs; + else if (defineNs.exist()) + XName->Ns = defineNs; + else + throw Exception::Namespace("not define namespace"); + } + + if (source->get() == L'/') + { + source->findAndSkip(L'>'); + } + else + { + source->findAndSkip(L'>'); + XNamespaceContainer summaryNamespaces = Namespaces; + summaryNamespaces.merge(defineNamespaces); + NodeContainer::fromSource(source, summaryNamespaces, Space); + source->skipSpace(); + const std::pair name = source->getName(); + source->findAndSkip(L'>'); + } + } + + + const std::string Element::ToString() const + { + std::string node; + node += "<" + XName->ToString(); + if (Space->isPreserve()) + node += " xml:space=\"preserve\" "; + node += Namespaces->ToString(); + node += Attributes->ToString(); + + if (Nodes->empty()) + node += "/>"; + else + node += ">" + Nodes->ToString() + "ToString() + ">"; + + return node; + } + + + const std::wstring Element::ToWString() const + { + std::wstring node; + node += L"<" + XName->ToWString(); + if (Space->isPreserve()) + node += L" xml:space=\"preserve\" "; + node += Namespaces->ToWString(); + node += Attributes->ToWString(); + + if (Nodes->empty()) + node += L"/>"; + else + node += L">" + Nodes->ToWString() + L"ToWString() + L">"; + + return node; + } + + + void Element::SaveToStringList(std::list& strList)const + { + //const std::string name = XName->ToString(); + strList.push_back("<");// + name); + XName->SaveToStringList(strList); + //strList.push_back(name); + if (Space->isPreserve()) + strList.push_back(" xml:space=\"preserve\" "); + Namespaces->SaveToStringList(strList); + Attributes->SaveToStringList(strList); + + if (Nodes->empty()) + strList.push_back("/>"); + else + { + strList.push_back(">"); + Nodes->SaveToStringList(strList); + strList.push_back(""); + XName->SaveToStringList(strList); + strList.push_back(">"); + } + } + + + void Element::SaveToWStringList(std::list& strList)const + { + //const std::string name = XName->ToString(); + strList.push_back(L"<");// + name); + XName->SaveToWStringList(strList); + //strList.push_back(name); + if (Space->isPreserve()) + strList.push_back(L" xml:space=\"preserve\" "); + Namespaces->SaveToWStringList(strList); + Attributes->SaveToWStringList(strList); + + if (Nodes->empty()) + strList.push_back(L"/>"); + else + { + strList.push_back(L">"); + Nodes->SaveToWStringList(strList); + strList.push_back(L""); + XName->SaveToWStringList(strList); + strList.push_back(L">"); + } + } + + + const bool Element::exist() const + { + return true; + } + + + const XString Element::text() const + { + return Texts->text(); + } + + + void Element::Add(const XAttribute& attribute) + { + Attributes.Add(attribute); + } + + + void Element::Add(const XNamespace& ns) + { + Namespaces.Add(ns); + } + + + void Element::Add(const XNode& node) + { + Nodes.Add(node); + } + + + void Element::Add(const XElement& element) + { + Nodes.Add(element); + } + + + void Element::Add(const XText& text) + { + Nodes.Add(text); + } + + + void Element::Add(const XML::XContainer& container) + { + Nodes.Add(container); + } + + + void Element::Add(const XML::Private::XList& list) + { + Attributes->merge(list.Attributes); + Namespaces->merge(list.Namespaces); + Nodes->merge(list.Nodes); + } + + + const XNamespaceContainer Element::usedNamespace() const + { + XNamespaceContainer container; + if (XName->Ns.is_init()) + container.push_back(XName->Ns); + + container.merge(Attributes.usedNamespace()); + container.merge(Elements.usedNamespace()); + + return container; + } + + + XAttribute& Element::attribute(const XML::XName& xname) + { + return Attributes[xname]; + } + + + const XAttribute& Element::attribute(const XML::XName& xname) const + { + return Attributes[xname]; + } + + + XElement Element::element(const XML::XName& xname) + { + return Elements[xname]; + } + + + const XElement Element::element(const XML::XName& xname) const + { + return Elements[xname]; + } + + + XElement Element::element(const XML::XName& xname, const std::string& value) + { + return Elements.get(xname, value); + } + + + const XElement Element::element(const XML::XName& xname, const std::string& value) const + { + return Elements.get(xname, value); + } + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/Element.h b/ASCOfficeOdtFile/Source/XML/Private/Element.h new file mode 100644 index 0000000000..f90e11055c --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/Element.h @@ -0,0 +1,88 @@ +#pragma once +#ifndef XML_PRIVATE_ELEMENT_INCLUDE_H_ +#define XML_PRIVATE_XELEMENT_INCLUDE_H_ + +#include "NodeContainer.h" +#include "property.h" +#include "XAttributeContainer.h" +#include "XNamespaceContainer.h" +#include "./../XName.h" +#include +#include "XString.h" +#include "XSpace.h" +//#include "XSource.h" +#include "XSingleSource.h" +#include "XWideSource.h" +#include + + +namespace XML +{ + class XAttribute; + class XNamespace; + class XNode; + class XText; + class XContainer; + + namespace Private + { + class XList; + + class Element : public NodeContainer + { + public: + Element(); + Element(const XML::XName& xname); + Element(const XML::XName& xname, const XList& list); + Element(boost::shared_ptr source, const XNamespaceContainer& ns, const XSpace& space); + Element(boost::shared_ptr source, const XNamespaceContainer& ns, const XSpace& space); + + virtual ~Element(); + + public: + virtual const bool isElement() const; + virtual const bool isText() const; + virtual const bool isComment() const; + + public: + void fromSource(boost::shared_ptr source, const XNamespaceContainer& defineNamespaces, const XSpace& space); + void fromSource(boost::shared_ptr source, const XNamespaceContainer& defineNamespaces, const XSpace& space); + virtual const std::string ToString() const; + virtual const std::wstring ToWString() const; + virtual void SaveToStringList(std::list& strList)const; + virtual void SaveToWStringList(std::list& strList)const; + + public: + virtual const bool exist() const; + virtual const XString text() const; + const XNamespaceContainer usedNamespace() const; + + public: + void Add(const XAttribute& attribute); + void Add(const XNamespace& ns); + void Add(const XNode& node); + void Add(const XElement& element); + void Add(const XText& text); + void Add(const XML::XContainer& container); + void Add(const XML::Private::XList& list); + + public: + XAttribute& attribute(const XName& xname); + const XAttribute& attribute(const XName& xname) const; + + XElement element(const XName& xname); + const XElement element(const XName& xname) const; + + XElement element(const XName& xname, const std::string& value); + const XElement element(const XName& xname, const std::string& value) const; + + public: + property XName; + XAttributeContainer Attributes; + XNamespaceContainer Namespaces; + property Space; + }; + } // namespace Private +} // namespace XML + +#endif // XML_XELEMENT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/Filter/Element.h b/ASCOfficeOdtFile/Source/XML/Private/Filter/Element.h new file mode 100644 index 0000000000..03937c4235 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/Filter/Element.h @@ -0,0 +1,26 @@ +#pragma once +#ifndef XML_PRIVATE_FILTER_ELEMENT_INCLUDE_H_ +#define XML_PRIVATE_FILTER_ELEMENT_INCLUDE_H_ + +#include +#include "./../../XNode.h" + + +namespace XML +{ + namespace Private + { + namespace Filter + { + struct Element : public std::unary_function + { + const bool operator ()(const XNode& xnode) const + { + return xnode.isElement(); + } + }; + } + } +} + +#endif // XML_PRIVATE_FILTER_ELEMENT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/Filter/Text.h b/ASCOfficeOdtFile/Source/XML/Private/Filter/Text.h new file mode 100644 index 0000000000..a3c98e7133 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/Filter/Text.h @@ -0,0 +1,26 @@ +#pragma once +#ifndef XML_PRIVATE_FILTER_TEXT_INCLUDE_H_ +#define XML_PRIVATE_FILTER_TEXT_INCLUDE_H_ + +#include +#include "./../../XNode.h" + + +namespace XML +{ + namespace Private + { + namespace Filter + { + struct Text : public std::unary_function + { + const bool operator ()(const XNode& xnode) const + { + return xnode.isText(); + } + }; + } + } +} + +#endif // XML_PRIVATE_FILTER_TEXT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/Lexigraph.cpp b/ASCOfficeOdtFile/Source/XML/Private/Lexigraph.cpp new file mode 100644 index 0000000000..7918f0cbaf --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/Lexigraph.cpp @@ -0,0 +1,206 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "Lexigraph.h" +//#include +//#include + + +namespace XML +{ + namespace Private + { + + const std::string Lexigraph::fromSource(const std::string& input) + { + std::string output = input; + + size_t pos = output.find("<"); + while(pos != output.npos) + { + output.replace(pos, 4, "<"); + pos = output.find("<", pos + 1); + } + + pos = output.find(">"); + while(pos != output.npos) + { + output.replace(pos, 4, ">"); + pos = output.find(">", pos + 1); + } + + pos = output.find("'"); + while(pos != output.npos) + { + output.replace(pos, 6, "\'"); + pos = output.find("'", pos + 1); + } + + pos = output.find("""); + while(pos != output.npos) + { + output.replace(pos, 6, "\""); + pos = output.find(""", pos + 1); + } + + pos = output.find("&"); + while(pos != output.npos) + { + output.replace(pos, 5, "&"); + pos = output.find("&", pos + 1); + } + + //boost::replace_all(output, "&", "&"); + //boost::replace_all(output, "<", "<"); + //boost::replace_all(output, ">", ">"); + //boost::replace_all(output, "'", "'"); + //boost::replace_all(output, """, "\""); + return output; + } + + + const std::string Lexigraph::toSource(const std::string& input) + { + std::string output = input; + size_t pos = output.find('&'); + while(pos != output.npos) + { + output.replace(pos, 1, "&"); + pos = output.find('&', pos + 1); + } + + pos = output.find('<'); + while(pos != output.npos) + { + output.replace(pos, 1, "<"); + pos = output.find('<', pos + 1); + } + + pos = output.find('>'); + while(pos != output.npos) + { + output.replace(pos, 1, ">"); + pos = output.find('>', pos + 1); + } + + pos = output.find('\''); + while(pos != output.npos) + { + output.replace(pos, 1, "'"); + pos = output.find('\'', pos + 1); + } + + pos = output.find('\"'); + while(pos != output.npos) + { + output.replace(pos, 1, """); + pos = output.find('\"', pos + 1); + } + + //boost::replace_all(output, "&", "&"); + //boost::replace_all(output, "<", "<"); + //boost::replace_all(output, ">", ">"); + //boost::replace_all(output, "'", "'"); + //boost::replace_all(output, "\"", """); + return output; + } + + + const std::wstring Lexigraph::fromSource(const std::wstring& input) + { + std::wstring output = input; + + size_t pos = output.find(L"<"); + while(pos != output.npos) + { + output.replace(pos, 4, L"<"); + pos = output.find(L"<", pos + 1); + } + + pos = output.find(L">"); + while(pos != output.npos) + { + output.replace(pos, 4, L">"); + pos = output.find(L">", pos + 1); + } + + pos = output.find(L"'"); + while(pos != output.npos) + { + output.replace(pos, 6, L"\'"); + pos = output.find(L"'", pos + 1); + } + + pos = output.find(L"""); + while(pos != output.npos) + { + output.replace(pos, 6, L"\""); + pos = output.find(L""", pos + 1); + } + + pos = output.find(L"&"); + while(pos != output.npos) + { + output.replace(pos, 5, L"&"); + pos = output.find(L"&", pos + 1); + } + + //boost::replace_all(output, "&", "&"); + //boost::replace_all(output, "<", "<"); + //boost::replace_all(output, ">", ">"); + //boost::replace_all(output, "'", "'"); + //boost::replace_all(output, """, "\""); + return output; + } + + + const std::wstring Lexigraph::toSource(const std::wstring& input) + { + std::wstring output = input; + size_t pos = output.find(L'&'); + while(pos != output.npos) + { + output.replace(pos, 1, L"&"); + pos = output.find(L'&', pos + 1); + } + + pos = output.find(L'<'); + while(pos != output.npos) + { + output.replace(pos, 1, L"<"); + pos = output.find(L'<', pos + 1); + } + + pos = output.find(L'>'); + while(pos != output.npos) + { + output.replace(pos, 1, L">"); + pos = output.find(L'>', pos + 1); + } + + pos = output.find(L'\''); + while(pos != output.npos) + { + output.replace(pos, 1, L"'"); + pos = output.find(L'\'', pos + 1); + } + + pos = output.find(L'\"'); + while(pos != output.npos) + { + output.replace(pos, 1, L"""); + pos = output.find(L'\"', pos + 1); + } + + //boost::replace_all(output, "&", "&"); + //boost::replace_all(output, "<", "<"); + //boost::replace_all(output, ">", ">"); + //boost::replace_all(output, "'", "'"); + //boost::replace_all(output, "\"", """); + return output; + } + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/Lexigraph.h b/ASCOfficeOdtFile/Source/XML/Private/Lexigraph.h new file mode 100644 index 0000000000..0ffa9a26f3 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/Lexigraph.h @@ -0,0 +1,24 @@ +#pragma once +#ifndef XML_PRIVATE_LEXIGRAPH_INCLUDE_H_ +#define XML_PRIVATE_LEXIGRAPH_INCLUDE_H_ + +#include + + +namespace XML +{ + namespace Private + { + class Lexigraph + { + public: + static const std::string fromSource(const std::string& input); + static const std::string toSource(const std::string& input); + + static const std::wstring fromSource(const std::wstring& input); + static const std::wstring toSource(const std::wstring& input); + }; + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_LEXIGRAPH_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/Namespace.cpp b/ASCOfficeOdtFile/Source/XML/Private/Namespace.cpp new file mode 100644 index 0000000000..08de3a4e72 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/Namespace.cpp @@ -0,0 +1,111 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "Namespace.h" +#include "Lexigraph.h" +#include "Encoding.h" + + +namespace XML +{ + namespace Private + { + //static const std::string strEmpty = ""; + + Namespace::Namespace() + //: Name(strEmpty) + { + } + + + Namespace::Namespace(const std::string& prefix, const std::string& name) + : Prefix(prefix), + Name(name) + { + } + + + const bool Namespace::operator ==(const Namespace& rhs) const + { + return Prefix == rhs.Prefix; + } + + + const bool Namespace::operator <(const Namespace& rhs) const + { + return Prefix < rhs.Prefix; + } + + + const bool Namespace::exist() const + { + return true; + } + + + const std::string Namespace::ToString() const + { + if (Prefix != "xmlns") + return "xmlns:" + (/***/Prefix)/*.ToString()*/ + "=\"" + Private::Lexigraph::toSource(/***/Name/*.ToString()*/) + "\""; + return "xmlns=\"" + Private::Lexigraph::toSource(/***/Name/*.ToString()*/) + "\""; + } + + + const std::wstring Namespace::ToWString() const + { + if (Prefix != "xmlns") + return L"xmlns:" + Encoding::utf82unicode(/***/Prefix/*.ToString()*/) + L"=\"" + + Encoding::utf82unicode(Private::Lexigraph::toSource(/***/Name/*.ToString()*/)) + L"\""; + return L"xmlns=\"" + Encoding::utf82unicode(Private::Lexigraph::toSource(/***/Name/*.ToString()*/)) + L"\""; + } + + + void Namespace::SaveToStringList(std::list& strList)const + { + if (Prefix != "xmlns") + { + strList.push_back("xmlns:"); + strList.push_back(Prefix); + strList.push_back("=\""); + strList.push_back(Private::Lexigraph::toSource(Name)); + strList.push_back("\""); + return; + } + strList.push_back("xmlns=\""); + strList.push_back(Private::Lexigraph::toSource(Name)); + strList.push_back("\""); + } + + + void Namespace::SaveToWStringList(std::list& strList)const + { + if (Prefix != "xmlns") + { + strList.push_back(L"xmlns:"); + strList.push_back(Encoding::utf82unicode(Prefix)); + strList.push_back(L"=\""); + strList.push_back(Encoding::utf82unicode(Private::Lexigraph::toSource(Name))); + strList.push_back(L"\""); + return; + } + strList.push_back(L"xmlns=\""); + strList.push_back(Encoding::utf82unicode(Private::Lexigraph::toSource(Name))); + strList.push_back(L"\""); + } + + + const std::string Namespace::GetPrefix()const + { + return Prefix; + } + + + const std::string Namespace::GetName()const + { + return Name; + } + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/Namespace.h b/ASCOfficeOdtFile/Source/XML/Private/Namespace.h new file mode 100644 index 0000000000..efce1aa7fb --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/Namespace.h @@ -0,0 +1,45 @@ +#pragma once +#ifndef XML_PRIVATE_INCLUDE_H_ +#define XML_PRIVATE_INCLUDE_H_ + +#include +#include +#include "property.h" +#include + + +namespace XML +{ + namespace Private + { + class Namespace : private boost::totally_ordered + { + public: + Namespace(const std::string& prefix, const std::string& name); + const bool operator==(const Namespace& rhs) const; + const bool operator<(const Namespace& rhs) const; + + public: + virtual const bool exist() const; + const std::string ToString() const; + const std::wstring ToWString() const; + virtual void SaveToStringList(std::list& strList)const; + virtual void SaveToWStringList(std::list& strList)const; + + //public: + //property Prefix; + //property Name; + private: + std::string Prefix; + std::string Name; + public: + const std::string GetPrefix()const; + const std::string GetName()const; + + protected: + Namespace(); + }; + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/Node.cpp b/ASCOfficeOdtFile/Source/XML/Private/Node.cpp new file mode 100644 index 0000000000..abb704ca8e --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/Node.cpp @@ -0,0 +1,15 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "Node.h" + + +namespace XML +{ + namespace Private + { + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/Node.h b/ASCOfficeOdtFile/Source/XML/Private/Node.h new file mode 100644 index 0000000000..849e0013eb --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/Node.h @@ -0,0 +1,32 @@ +#pragma once +#ifndef XML_PRIVATE_NODE_INCLUDE_H_ +#define XML_PRIVATE_NODE_INCLUDE_H_ + +#include +#include + + +namespace XML +{ + namespace Private + { + class Node + { + public: + virtual ~Node() = 0 {}; + + public: + virtual const bool isElement() const = 0; + virtual const bool isText() const = 0; + virtual const bool isComment() const = 0; + + public: + virtual const std::string ToString() const = 0; + virtual const std::wstring ToWString() const = 0; + virtual void SaveToStringList(std::list& strList)const = 0; + virtual void SaveToWStringList(std::list& strList)const = 0; + }; + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_NODE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/NodeContainer.cpp b/ASCOfficeOdtFile/Source/XML/Private/NodeContainer.cpp new file mode 100644 index 0000000000..037d23ac6c --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/NodeContainer.cpp @@ -0,0 +1,303 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "NodeContainer.h" +#include "./../XElement.h" +#include "./../XComment.h" +#include "./../XText.h" +#include "XList.h" +#include "XNamespaceContainer.h" +#include "Exception/not_implement.h" +#include "Utility.h" + + +namespace XML +{ + namespace Private + { + + NodeContainer::NodeContainer() + : Nodes(), + Elements(Nodes), + Texts(Nodes) + { + } + + + NodeContainer::NodeContainer(const XNodeContainer& nodes) + : Nodes(nodes), + Elements(Nodes), + Texts(Nodes) + { + } + + + NodeContainer::~NodeContainer() + { + } + + + NodeContainer::NodeContainer(const XElement& element) + : Nodes(), + Elements(Nodes), + Texts(Nodes) + { + Elements.Add(element); + } + + + NodeContainer::NodeContainer(const XText& text) + : Nodes(), + Elements(Nodes), + Texts(Nodes) + { + Texts.Add(text); + } + + + NodeContainer::NodeContainer(const XComment& comment) + : Nodes(), + Elements(Nodes), + Texts(Nodes) + { + Nodes.Add(comment); + } + + + NodeContainer::NodeContainer(const XList& list) + : Nodes(), + Elements(Nodes), + Texts(Nodes) + { + Nodes.merge(list.Nodes); + } + + + const bool NodeContainer::isElement() const + { + return false; + } + + + const bool NodeContainer::isText() const + { + return false; + } + + + const bool NodeContainer::isComment() const + { + return false; + } + + + void NodeContainer::fromSource(boost::shared_ptr source, const XNamespaceContainer& ns, const XSpace& space) + { + if (space.isDefault()) + source->skipSpace(); + + while (true) + { + if (source->get() == '<') + { + source->next(); + if (source->get() == '/') + break; + if (isComment(source)) + insertComment(source); + else + Nodes.push_back(XElement(source, ns, space)); + } + else + { + Nodes.push_back(XText(source->getString('<'))); + } + if (space.isDefault()) + source->skipSpace(); + } + source->next(); + } + + + void NodeContainer::fromSource(boost::shared_ptr source, const XNamespaceContainer& ns, const XSpace& space) + { + if (space.isDefault()) + source->skipSpace(); + + while (true) + { + if (source->get() == L'<') + { + source->next(); + if (source->get() == L'/') + break; + if (isComment(source)) + insertComment(source); + else + Nodes.push_back(XElement(source, ns, space)); + } + else + { + Nodes.push_back(XText(Encoding::unicode2utf8(source->getString(L'<')))); + } + if (space.isDefault()) + source->skipSpace(); + } + source->next(); + } + + + const std::string NodeContainer::ToString() const + { + return Nodes.ToString(); + } + + + const std::wstring NodeContainer::ToWString() const + { + // TODO not implement + throw not_implement(); + } + + + void NodeContainer::SaveToStringList(std::list& strList) const + { + Nodes.SaveToStringList(strList); + } + + + void NodeContainer::SaveToWStringList(std::list& strList) const + { + Nodes.SaveToWStringList(strList); + } + + + void NodeContainer::Add(const XNode& node) + { + Nodes.Add(node); + } + + + void NodeContainer::Add(const XElement& element) + { + Elements.Add(element); + } + + + void NodeContainer::Add(const XText& text) + { + Texts.Add(text); + } + + + void NodeContainer::Add(const XComment& comment) + { + Nodes.Add(comment); + } + + + void NodeContainer::Add(const XList& list) + { + Nodes.merge(list.Nodes); + } + + + const bool NodeContainer::isComment(boost::shared_ptr source) + { + if (source->get() == '!') + { + source->next(); + if (source->get() == '-') + { + source->next(); + if (source->get() == '-') + { + source->next(); + return true; + } + } + } + return false; + } + + + void NodeContainer::insertComment(boost::shared_ptr source) + { + std::string comment; + while(true) + { + comment += source->getString('-'); + source->next(); + if (source->get() == '-') + { + source->next(); + if (source->get() == '>') + { + source->next(); + break; + } + else + { + comment += "--"; + } + } + else + { + comment += "-"; + } + } + Nodes.push_back(XComment(comment)); + } + + + const bool NodeContainer::isComment(boost::shared_ptr source) + { + if (source->get() == L'!') + { + source->next(); + if (source->get() == L'-') + { + source->next(); + if (source->get() == L'-') + { + source->next(); + return true; + } + } + } + return false; + } + + + void NodeContainer::insertComment(boost::shared_ptr source) + { + std::wstring comment; + while(true) + { + comment += source->getString(L'-'); + source->next(); + if (source->get() == L'-') + { + source->next(); + if (source->get() == L'>') + { + source->next(); + break; + } + else + { + comment += L"--"; + } + } + else + { + comment += L"-"; + } + } + Nodes.push_back(XComment(Encoding::unicode2utf8(comment))); + } + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/NodeContainer.h b/ASCOfficeOdtFile/Source/XML/Private/NodeContainer.h new file mode 100644 index 0000000000..4ef3fdac71 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/NodeContainer.h @@ -0,0 +1,88 @@ +#pragma once +#ifndef XML_PRIVATE_NODE_CONTAINER_INCLUDE_H_ +#define XML_PRIVATE_NODE_CONTAINER_INCLUDE_H_ + +#include "Node.h" +#include +#include "XNodeContainer.h" +#include "XElementContainer.h" +#include "XTextContainer.h" +#include "property.h" +#include "./../Extension/Write.h" +#include "XSpace.h" +//#include "XSource.h" +#include "XSingleSource.h" +#include "XWideSource.h" +#include + + +namespace XML +{ + class XElement; + class XComment; + class XText; + + namespace Private + { + class XNamespaceContainer; + class XList; + + class NodeContainer : public Node + { + public: + NodeContainer(); + NodeContainer(const XNodeContainer& nodes); + virtual ~NodeContainer(); + + public: + explicit NodeContainer(const XElement& element); + explicit NodeContainer(const XText& text); + explicit NodeContainer(const XComment& comment); + explicit NodeContainer(const XList& list); + + public: + virtual const bool isElement() const; + virtual const bool isText() const; + virtual const bool isComment() const; + + public: + void fromSource(boost::shared_ptr source, const XNamespaceContainer& ns, const XSpace& space); + void fromSource(boost::shared_ptr source, const XNamespaceContainer& ns, const XSpace& space); + virtual const std::string ToString() const; + virtual const std::wstring ToWString() const; + virtual void SaveToStringList(std::list& strList)const; + virtual void SaveToWStringList(std::list& strList)const; + + public: + template class C, typename T, typename A> + explicit NodeContainer(const C& container) + : Nodes(), + Elements(Nodes), + Texts(Nodes) + { + for (C::const_iterator i = container.begin(); i != container.end(); ++i) + Nodes.push_back(Write(*i)); + } + + public: + void Add(const XNode& node); + void Add(const XElement& node); + void Add(const XText& text); + void Add(const XComment& comment); + void Add(const XList& list); + + private: + const bool isComment(boost::shared_ptr source); + void insertComment(boost::shared_ptr source); + const bool isComment(boost::shared_ptr source); + void insertComment(boost::shared_ptr source); + + public: + XNodeContainer Nodes; + XElementContainer Elements; + XTextContainer Texts; + }; + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_NODE_CONTAINER_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/Null.cpp b/ASCOfficeOdtFile/Source/XML/Private/Null.cpp new file mode 100644 index 0000000000..2d73176383 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/Null.cpp @@ -0,0 +1,22 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "Null.h" +#include "NullText.h" + + +namespace XML +{ + namespace Private + { + + NullText& Null::Text() + { + static NullText text; + return text; + } + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/Null.h b/ASCOfficeOdtFile/Source/XML/Private/Null.h new file mode 100644 index 0000000000..0e980abecf --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/Null.h @@ -0,0 +1,20 @@ +#pragma once +#ifndef XML_PRIVATE_NULL_INCLUDE_H_ +#define XML_PRIVATE_NULL_INCLUDE_H_ + + +namespace XML +{ + namespace Private + { + class NullText; + + class Null + { + public: + static NullText& Text(); + }; + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_NULL_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/NullAttribute.cpp b/ASCOfficeOdtFile/Source/XML/Private/NullAttribute.cpp new file mode 100644 index 0000000000..1549cc7d95 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/NullAttribute.cpp @@ -0,0 +1,18 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "NullAttribute.h" + + +namespace XML +{ + namespace Private + { + const bool NullAttribute::exist() const + { + return false; + } + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/NullAttribute.h b/ASCOfficeOdtFile/Source/XML/Private/NullAttribute.h new file mode 100644 index 0000000000..0917fea700 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/NullAttribute.h @@ -0,0 +1,20 @@ +#pragma once +#ifndef XML_PRIVATE_NULL_ATTRIBUTE_INCLUDE_H_ +#define XML_PRIVATE_NULL_ATTRIBUTE_INCLUDE_H_ + +#include "Attribute.h" + + +namespace XML +{ + namespace Private + { + class NullAttribute : public Attribute + { + public: + virtual const bool exist() const; + }; + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_NULL_ATTRIBUTE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/NullElement.cpp b/ASCOfficeOdtFile/Source/XML/Private/NullElement.cpp new file mode 100644 index 0000000000..eeabac7054 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/NullElement.cpp @@ -0,0 +1,26 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "NullElement.h" + + +namespace XML +{ + namespace Private + { + + const bool NullElement::exist() const + { + return false; + } + + + const XString NullElement::text() const + { + return XString(); + } + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/NullElement.h b/ASCOfficeOdtFile/Source/XML/Private/NullElement.h new file mode 100644 index 0000000000..433669c726 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/NullElement.h @@ -0,0 +1,22 @@ +#pragma once +#ifndef XML_PRIVATE_NULL_ELEMENT_INCLUDE_H_ +#define XML_PRIVATE_NULL_ELEMENT_INCLUDE_H_ + + +#include "Element.h" + + +namespace XML +{ + namespace Private + { + class NullElement : public Element + { + public: + virtual const bool exist() const; + virtual const XString text() const; + }; + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_NULL_ELEMENT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/NullNamespace.cpp b/ASCOfficeOdtFile/Source/XML/Private/NullNamespace.cpp new file mode 100644 index 0000000000..f83b9e894e --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/NullNamespace.cpp @@ -0,0 +1,20 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "NullNamespace.h" + + +namespace XML +{ + namespace Private + { + + const bool NullNamespace::exist() const + { + return false; + } + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/NullNamespace.h b/ASCOfficeOdtFile/Source/XML/Private/NullNamespace.h new file mode 100644 index 0000000000..8f91b729df --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/NullNamespace.h @@ -0,0 +1,20 @@ +#pragma once +#ifndef XML_PRIVATE_NULL_NAMESPACE_INCLUDE_H_ +#define XML_PRIVATE_NULL_NAMESPACE_INCLUDE_H_ + +#include "Namespace.h" + + +namespace XML +{ + namespace Private + { + class NullNamespace : public Namespace + { + public: + virtual const bool exist() const; + }; + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_NULL_NAMESPACE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/NullText.cpp b/ASCOfficeOdtFile/Source/XML/Private/NullText.cpp new file mode 100644 index 0000000000..0c75a0bca6 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/NullText.cpp @@ -0,0 +1,16 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "NullText.h" + + +namespace XML +{ + namespace Private + { + + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/NullText.h b/ASCOfficeOdtFile/Source/XML/Private/NullText.h new file mode 100644 index 0000000000..b8c64b54d2 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/NullText.h @@ -0,0 +1,21 @@ +#pragma once +#ifndef XML_PRIVATE_NULL_TEXT_INCLUDE_H_ +#define XML_PRIVATE_NULL_TEXT_INCLUDE_H_ + +#include "Text.h" + + +namespace XML +{ + namespace Private + { + class NullText : public Text + { + }; + + static NullText nullText; + + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_NULL_TEXT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/NullXAttribute.cpp b/ASCOfficeOdtFile/Source/XML/Private/NullXAttribute.cpp new file mode 100644 index 0000000000..be64509ec6 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/NullXAttribute.cpp @@ -0,0 +1,24 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "NullXAttribute.h" +#include "NullAttribute.h" + + +namespace XML +{ + namespace Private + { + NullXAttribute::NullXAttribute() + : XAttribute(NullAttribute()) + { + } + + const bool NullXAttribute::exist() const + { + return false; + } + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/NullXAttribute.h b/ASCOfficeOdtFile/Source/XML/Private/NullXAttribute.h new file mode 100644 index 0000000000..47530d2ce6 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/NullXAttribute.h @@ -0,0 +1,23 @@ +#pragma once +#ifndef XML_PRIVATE_NULL_XATTRIBUTE_INCLUDE_H_ +#define XML_PRIVATE_NULL_XATTRIBUTE_INCLUDE_H_ + +#include "./../XAttribute.h" + + +namespace XML +{ + namespace Private + { + class NullXAttribute : public XAttribute + { + public: + NullXAttribute(); + + public: + virtual const bool exist() const; + }; + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_NULL_XATTRIBUTE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/NullXElement.cpp b/ASCOfficeOdtFile/Source/XML/Private/NullXElement.cpp new file mode 100644 index 0000000000..e461e367b6 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/NullXElement.cpp @@ -0,0 +1,23 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "NullXElement.h" + +namespace XML +{ + namespace Private + { + NullXElement::NullXElement() : XElement(*this) // Ïåðåäà÷à òèïà, à íå çíà÷åíèÿ + { + + } + + const bool NullXElement::exist() const + { + return false; + } + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/NullXElement.h b/ASCOfficeOdtFile/Source/XML/Private/NullXElement.h new file mode 100644 index 0000000000..043bbfc49b --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/NullXElement.h @@ -0,0 +1,23 @@ +#pragma once +#ifndef XML_PRIVATE_NULL_XELEMENT_INCLUDE_H_ +#define XML_PRIVATE_NULL_XELEMENT_INCLUDE_H_ + +#include "./../XElement.h" + + +namespace XML +{ + namespace Private + { + class NullXElement : public XElement + { + public: + NullXElement(); + + public: + virtual const bool exist() const; + }; + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_NULL_XELEMENT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/NullXNamespace.cpp b/ASCOfficeOdtFile/Source/XML/Private/NullXNamespace.cpp new file mode 100644 index 0000000000..1469973a2e --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/NullXNamespace.cpp @@ -0,0 +1,20 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "NullXNamespace.h" + + +namespace XML +{ + namespace Private + { + + const bool NullXNamespace::exist() const + { + return false; + } + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/NullXNamespace.h b/ASCOfficeOdtFile/Source/XML/Private/NullXNamespace.h new file mode 100644 index 0000000000..4cede46459 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/NullXNamespace.h @@ -0,0 +1,19 @@ +#pragma once +#ifndef XML_PRIVATE_NULL_XNAMESPACE_INCLUDE_H_ +#define XML_PRIVATE_NULL_XNAMESPACE_INCLUDE_H_ + +#include "./../XNamespace.h" + + +namespace XML +{ + namespace Private + { + class NullXNamespace : public XNamespace + { + virtual const bool exist() const; + }; + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_NULL_XNAMESPACE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/Text.cpp b/ASCOfficeOdtFile/Source/XML/Private/Text.cpp new file mode 100644 index 0000000000..2f4dc32912 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/Text.cpp @@ -0,0 +1,74 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "Text.h" +#include "Lexigraph.h" +#include "Encoding.h" + + +namespace XML +{ + namespace Private + { + + Text::Text() + { + } + + + Text::Text(const std::string& value) + : Value(value) + { + } + + + Text::~Text() + { + } + + + const bool Text::isElement() const + { + return false; + } + + + const bool Text::isText() const + { + return true; + } + + + const bool Text::isComment() const + { + return false; + } + + + const std::string Text::ToString() const + { + return Private::Lexigraph::toSource(Value.ToString()); + } + + + const std::wstring Text::ToWString() const + { + return Private::Lexigraph::toSource(Value.ToWString()); + } + + + void Text::SaveToStringList(std::list& strList)const + { + strList.push_back(Private::Lexigraph::toSource(Value.ToString())); + } + + + void Text::SaveToWStringList(std::list& strList)const + { + strList.push_back(Private::Lexigraph::toSource(Value.ToWString())); + } + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/Text.h b/ASCOfficeOdtFile/Source/XML/Private/Text.h new file mode 100644 index 0000000000..ac795548cc --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/Text.h @@ -0,0 +1,41 @@ +#pragma once +#ifndef XML_PRIVATE_TEXT_INCLUDE_H_ +#define XML_PRIVATE_TEXT_INCLUDE_H_ + +#include "Node.h" +#include +#include "XString.h" +#include "property.h" + + +namespace XML +{ + namespace Private + { + class Text : public Node + { + public: + explicit Text(const std::string& value); + virtual ~Text(); + + public: + virtual const bool isElement() const; + virtual const bool isText() const; + virtual const bool isComment() const; + + public: + virtual const std::string ToString() const; + virtual const std::wstring ToWString() const; + virtual void SaveToStringList(std::list& strList)const; + virtual void SaveToWStringList(std::list& strList)const; + + public: + XString Value; + + protected: + Text(); + }; + } // namespace Private +} // namespace XML + +#endif // XML_XTEXT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XAttributeContainer.cpp b/ASCOfficeOdtFile/Source/XML/Private/XAttributeContainer.cpp new file mode 100644 index 0000000000..d43880b139 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XAttributeContainer.cpp @@ -0,0 +1,120 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "XAttributeContainer.h" +#include "./../XName.h" +#include +#include +#include +#include "NullXAttribute.h" + + +namespace XML +{ + namespace Private + { + static NullXAttribute nullXAttribute; + + + const bool XAttributeContainer::exist(const XName& xname) const + { + //BOOST_FOREACH(const XAttribute& current, m_container) + for(const_iterator current = begin(); current != end(); current++) + { + if ((*current)->XName->Equal(xname)) + return true; + } + //BOOST_FOREACH(const XAttribute& current, m_container) + for(const_iterator current = begin(); current != end(); current++) + { + if ((*current)->XName == xname) + return true; + } + return false; + } + + + XAttribute& XAttributeContainer::operator[] (const XName& xname) + { + //BOOST_FOREACH(XAttribute& current, m_container) + for(iterator current = begin(); current != end(); current++) + { + if ((*current)->XName->Equal(xname)) + return *current; + } + //BOOST_FOREACH(XAttribute& current, m_container) + for(iterator current = begin(); current != end(); current++) + { + if ((*current)->XName == xname) + return *current; + } + return nullXAttribute; + } + + + const XAttribute& XAttributeContainer::operator[] (const XName& xname) const + { + //BOOST_FOREACH(const XAttribute& current, m_container) + for(const_iterator current = begin(); current != end(); current++) + { + if ((*current)->XName->Equal(xname)) + return *current; + } + //BOOST_FOREACH(const XAttribute& current, m_container) + for(const_iterator current = begin(); current != end(); current++) + { + if ((*current)->XName == xname) + return *current; + } + return nullXAttribute; + } + + + const XNamespaceContainer XAttributeContainer::usedNamespace() const + { + XNamespaceContainer container; + + //BOOST_FOREACH(const XAttribute& current, m_container) + //{ + // if (current->XName->Ns.is_init()) + // container.Add(current->XName->Ns); + //} + //for(std::set::const_iterator current = m_container.begin(); current != m_container.end(); current++) + //for(std::list::const_iterator current = m_container.begin(); current != m_container.end(); current++) + for(const_iterator current = begin(); current != end(); current++) + { + if ((*current)->XName->Ns.is_init()) + container.Add((*current)->XName->Ns); + } + + return container; + } + + + XAttributeContainer::iterator XAttributeContainer:: begin() + { + return m_container.begin(); + } + + + XAttributeContainer::iterator XAttributeContainer::end() + { + return m_container.end(); + } + + + XAttributeContainer::const_iterator XAttributeContainer::begin() const + { + return m_container.begin(); + } + + + XAttributeContainer::const_iterator XAttributeContainer::end() const + { + return m_container.end(); + } + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XAttributeContainer.h b/ASCOfficeOdtFile/Source/XML/Private/XAttributeContainer.h new file mode 100644 index 0000000000..cf1b63ef94 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XAttributeContainer.h @@ -0,0 +1,42 @@ +#pragma once +#ifndef XML_PRIVATE_XATTRIBUTE_CONTAINER_INCLUDE_H_ +#define XML_PRIVATE_XATTRIBUTE_CONTAINER_INCLUDE_H_ + +#include "XContainer.h" +#include "./../XAttribute.h" +#include "XNamespaceContainer.h" + + +namespace XML +{ + class XName; + + namespace Private + { + class XAttributeContainer : public XContainer + { + public: + const bool exist(const XName& xname) const; + + XAttributeContainer const* const operator->() const {return this;} + XAttributeContainer* operator->() {return this;} + + XAttribute& operator[] (const XName& xname); + const XAttribute& operator[] (const XName& xname) const; + + const XNamespaceContainer usedNamespace() const; + + public: + typedef std::list::iterator iterator; + typedef std::list::const_iterator const_iterator; + + public: + iterator begin(); + iterator end(); + const_iterator begin() const; + const_iterator end() const; + }; + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_XATTRIBUTE_CONTAINER_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XContainer.h b/ASCOfficeOdtFile/Source/XML/Private/XContainer.h new file mode 100644 index 0000000000..1bbfb2e905 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XContainer.h @@ -0,0 +1,159 @@ +#pragma once +#ifndef XML_PRIVATE_XCONTAINER_INCLUDE_H_ +#define XML_PRIVATE_XCONTAINER_INCLUDE_H_ + +//#include +#include +#include +//#include +#include +#include +//#include + + +namespace XML +{ + namespace Private + { + template + class XContainer + { + public: + void push_back(const T& value); + void Add(const T& value); + const bool content(const T& other) const; + void merge(const XContainer& other); + + const size_t size() const; + const bool empty() const; + + XContainer const* const operator->() const {return this;} + XContainer* operator->() {return this;} + + public: + const std::string ToString() const; + const std::wstring ToWString() const; + virtual void SaveToStringList(std::list& strList)const; + virtual void SaveToWStringList(std::list& strList)const; + + protected: + std::list m_container; + //std::set m_container; + }; + + + template + void XContainer::push_back(const T& value) + { + if (value.is_init() && !content(value)) + /*this->*/m_container.push_back(value); + //m_container.insert(value); + } + + + template + void XContainer::Add(const T& value) + { + push_back(value); + } + + + template + const bool XContainer::content(const T& other) const + { + //BOOST_FOREACH(const T& current, m_container) + //{ + // if (*current == *other) + // return true; + //} + //return false; + for(std::list::const_iterator current = m_container.begin(); current != m_container.end(); current++) + { + if(*(*current) == *other) + return true; + } + return false; + //return (m_container.find(other) != m_container.end()); + } + + + template + void XContainer::merge(const XContainer& other) + { + //std::for_each(other.m_container.begin(), other.m_container.end(), + // boost::bind(&XContainer::push_back, this, _1)); + //for(std::set::const_iterator current = other.m_container.begin(); current != other.m_container.end(); current++) + for(std::list::const_iterator current = other.m_container.begin(); current != other.m_container.end(); current++) + push_back(*current); + } + + + template + const size_t XContainer::size() const + { + return m_container.size(); + } + + + template + const bool XContainer::empty() const + { + return m_container.empty(); + } + + + template + const std::string XContainer::ToString() const + { + std::string result; + BOOST_FOREACH(const T& current, m_container) + { + result += " "; + result += current->ToString(); + } + return result; + } + + + template + const std::wstring XContainer::ToWString() const + { + std::wstring result; + BOOST_FOREACH(const T& current, m_container) + { + result += L" "; + result += current->ToWString(); + } + return result; + } + + + template + void XContainer::SaveToStringList(std::list& strList)const + { + //BOOST_FOREACH(const T& current, m_container) + //for(std::set::const_iterator current = m_container.begin(); current != m_container.end(); current++) + for(std::list::const_iterator current = m_container.begin(); current != m_container.end(); current++) + { + strList.push_back(" "); + (*current)->SaveToStringList(strList); + } + } + + + template + void XContainer::SaveToWStringList(std::list& strList)const + { + //BOOST_FOREACH(const T& current, m_container) + //for(std::set::const_iterator current = m_container.begin(); current != m_container.end(); current++) + for(std::list::const_iterator current = m_container.begin(); current != m_container.end(); current++) + { + strList.push_back(L" "); + (*current)->SaveToWStringList(strList); + } + } + + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_XCONTAINER_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XDeclaration.cpp b/ASCOfficeOdtFile/Source/XML/Private/XDeclaration.cpp new file mode 100644 index 0000000000..2d7a59762a --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XDeclaration.cpp @@ -0,0 +1,82 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "XDeclaration.h" +#include "Encoding.h" + + +namespace XML +{ + namespace Private + { + + XDeclaration::XDeclaration() + : Version("1.0"), + Encoding("UTF-8"), + Standalone("yes") + { + } + + + void XDeclaration::fromSource(boost::shared_ptr source) + { + source->find('?'); + source->next(); + source->skipSpace(); + + while (source->get() != '?') + { + const std::pair pair = source->getPair(); + setValue(pair.first, pair.second); + source->skipSpace(); + } + source->find('>'); + source->next(); + } + + + void XDeclaration::fromSource(boost::shared_ptr source) + { + source->find(L'?'); + source->next(); + source->skipSpace(); + + while (source->get() != L'?') + { + const std::pair pair = source->getPair(); + setValue(Encoding::unicode2utf8(pair.first), Encoding::unicode2utf8(pair.second)); + source->skipSpace(); + } + source->find(L'>'); + source->next(); + } + + + const std::string XDeclaration::ToString() const + { + return ""; + } + + + const std::wstring XDeclaration::ToWString() const + { + return L""; + } + + + void XDeclaration::setValue(const std::string& name, const std::string& value) + { + if (name == "version") + Version = value; + else if (name == "encoding") + Encoding = value; + else if (name == "standalone") + Standalone = value; + } + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XDeclaration.h b/ASCOfficeOdtFile/Source/XML/Private/XDeclaration.h new file mode 100644 index 0000000000..9ace310906 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XDeclaration.h @@ -0,0 +1,42 @@ +#pragma once +#ifndef XML_XDECLARATION_INCLUDE_H_ +#define XML_XDECLARATION_INCLUDE_H_ + +#include +#include "property.h" +#include "nullable_property.h" +#include "./../Limit/Version.h" +#include "./../Limit/Encoding.h" +#include "./../Limit/Standalone.h" +//#include "XSource.h" +#include "XSingleSource.h" +#include "XWideSource.h" + + +namespace XML +{ + namespace Private + { + class XDeclaration + { + public: + XDeclaration(); + + public: + void fromSource(boost::shared_ptr source); + void fromSource(boost::shared_ptr source); + const std::string ToString() const; + const std::wstring ToWString() const; + + public: + property Version; + property Encoding; + nullable_property Standalone; + + private: + void setValue(const std::string& name, const std::string& value); + }; + } // namespace Private +} // namespace XML + +#endif // XML_XDECLARATION_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XElementContainer.cpp b/ASCOfficeOdtFile/Source/XML/Private/XElementContainer.cpp new file mode 100644 index 0000000000..f806bb4a03 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XElementContainer.cpp @@ -0,0 +1,183 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "XElementContainer.h" +#include "XNodeContainer.h" +#include "./../XNode.h" +#include "./../XElement.h" +#include "./../XName.h" +#include +#include "NullXElement.h" + + +namespace XML +{ + namespace Private + { + static NullXElement nullXElement; + + + XElementContainer::XElementContainer(const XNodeContainer& nodes) + : m_container(nodes.container()) + { + } + + + const bool XElementContainer::empty() const + { + return size() == 0; + } + + + const size_t XElementContainer::size() const + { + size_t size = 0; + for (const_iterator i = begin(); i != end(); ++i) + ++size; + return size; + } + + + void XElementContainer::push_back(const XElement& element) + { + if (element.is_init() && element.exist()) + { + m_container->push_back(element); + } + } + + + void XElementContainer::Add(const XElement& element) + { + push_back(element); + } + + + const bool XElementContainer::exist(const XName& xname) const + { + //for (const_iterator i = begin(); i != end(); ++i) + //{ + for (std::list::iterator i = m_container->begin(); i != m_container->end(); ++i) + { + if(i->isElement()) + { + if (XElement(*i)->XName == xname) + return true; + } + } + return false; + } + + + XElement XElementContainer::operator[] (const XName& xname) + { + //for (iterator i = begin(); i != end(); ++i) + for (std::list::iterator i = m_container->begin(); i != m_container->end(); ++i) + { + if(i->isElement()) + { + if (XElement(*i)->XName->Equal(xname)) + return *i; + } + } + //for (iterator i = begin(); i != end(); ++i) + for (std::list::iterator i = m_container->begin(); i != m_container->end(); ++i) + { + if(i->isElement()) + { + if (XElement(*i)->XName == xname) + return *i; + } + } + return nullXElement; + } + + + const XElement XElementContainer::operator[] (const XName& xname) const + { + //for (const_iterator i = begin(); i != end(); ++i) + //{ + for (std::list::iterator i = m_container->begin(); i != m_container->end(); ++i) + { + if(i->isElement()) + { + if (XElement(*i)->XName->Equal(xname)) + return *i; + } + } + //for (const_iterator i = begin(); i != end(); ++i) + //{ + for (std::list::iterator i = m_container->begin(); i != m_container->end(); ++i) + { + if(i->isElement()) + { + if (XElement(*i)->XName == xname) + return *i; + } + } + return nullXElement; + } + + + XElement XElementContainer::get(const XName& xname, const std::string& value) + { + for (iterator i = begin(); i != end(); ++i) + { + XElement element(*i); + if (element.Attributes.exist(xname) && element.Attributes[xname].value().ToString() == value) + return *i; + } + return nullXElement; + } + + + const XElement XElementContainer::get(const XName& xname, const std::string& value) const + { + for (const_iterator i = begin(); i != end(); ++i) + { + XElement element(*i); + if (element.Attributes.exist(xname) && element.Attributes[xname].value().ToString() == value) + return *i; + } + return nullXElement; + } + + + XElementContainer::iterator XElementContainer:: begin() + { + return iterator(m_container->begin(), m_container->end()); + } + + + XElementContainer::iterator XElementContainer::end() + { + return iterator(m_container->end(), m_container->end()); + } + + + XElementContainer::const_iterator XElementContainer::begin() const + { + return const_iterator(m_container->begin(), m_container->end()); + } + + + XElementContainer::const_iterator XElementContainer::end() const + { + return const_iterator(m_container->end(), m_container->end()); + } + + + const XNamespaceContainer XElementContainer::usedNamespace() const + { + XNamespaceContainer container; + + for (const_iterator i = begin(); i != end(); ++i) + container.merge(XElement(*i)->usedNamespace()); + + return container; + } + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XElementContainer.h b/ASCOfficeOdtFile/Source/XML/Private/XElementContainer.h new file mode 100644 index 0000000000..4fd9624ec5 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XElementContainer.h @@ -0,0 +1,67 @@ +#pragma once +#ifndef XML_PRIVATE_XELEMENT_CONTAINER_INCLUDE_H_ +#define XML_PRIVATE_XELEMENT_CONTAINER_INCLUDE_H_ + +#include +//#include +#include +#include +#include "Filter/Element.h" +#include "XNamespaceContainer.h" + + +namespace XML +{ + class XNode; + class XElement; + class XName; + + namespace Private + { + class XNodeContainer; + + class XElementContainer + { + public: + XElementContainer(const XNodeContainer& nodes); + + public: + const bool empty() const; + const size_t size() const; + void push_back(const XElement& element); + void Add(const XElement& element); + + public: + //typedef boost::filter_iterator::iterator> iterator; + //typedef boost::filter_iterator::const_iterator> const_iterator; + typedef boost::filter_iterator::iterator> iterator; + typedef boost::filter_iterator::const_iterator> const_iterator; + + public: + XElementContainer const* const operator->() const {return this;} + XElementContainer* operator->() {return this;} + + const bool exist(const XName& xname) const; + XElement operator[] (const XName& xname); + const XElement operator[] (const XName& xname) const; + + XElement get(const XName& xname, const std::string& value); + const XElement get(const XName& xname, const std::string& value) const; + + const XNamespaceContainer usedNamespace() const; + + public: + iterator begin(); + iterator end(); + const_iterator begin() const; + const_iterator end() const; + + private: + //boost::shared_ptr > m_container; + boost::shared_ptr > m_container; + }; + + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_XELEMENT_CONTAINER_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XFileSource.cpp b/ASCOfficeOdtFile/Source/XML/Private/XFileSource.cpp new file mode 100644 index 0000000000..1f5f4ebfa7 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XFileSource.cpp @@ -0,0 +1,40 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "XFileSource.h" +#include "Exception\not_implement.h" + + +namespace XML +{ + namespace Private + { + + XFileSource::XFileSource(const boost::filesystem::path& path) + : m_stream(path.string().c_str()) + { + setBegin(); + } + + + XFileSource::XFileSource(const boost::filesystem::wpath& path) + : m_stream(path.string().c_str()) + { + setBegin(); + } + + + XFileSource::~XFileSource() + { + } + + + void XFileSource::setBegin() + { + m_iterator = m_stream; + } + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XFileSource.h b/ASCOfficeOdtFile/Source/XML/Private/XFileSource.h new file mode 100644 index 0000000000..73d3f3ef29 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XFileSource.h @@ -0,0 +1,31 @@ +#pragma once +#ifndef XML_PRIVATE_XFILE_SOURCE_INCLUDE_H_ +#define XML_PRIVATE_XFILE_SOURCE_INCLUDE_H_ + +#include "XSingleSource.h" +#include +#include +#include + + +namespace XML +{ + namespace Private + { + class XFileSource : public XSingleSource + { + public: + XFileSource(const boost::filesystem::path& path); + XFileSource(const boost::filesystem::wpath& path); + virtual ~XFileSource(); + + private: + void setBegin(); + + private: + std::ifstream m_stream; + }; + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_XFILE_SOURCE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XList.cpp b/ASCOfficeOdtFile/Source/XML/Private/XList.cpp new file mode 100644 index 0000000000..66c4be43e0 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XList.cpp @@ -0,0 +1,123 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "XList.h" +#include "./../XText.h" +#include "./../XElement.h" +#include "./../XComment.h" +#include "./../XContainer.h" + + +namespace XML +{ + namespace Private + { + + XList::XList() + { + } + + + XList::XList(const XAttribute& attribute) + { + Attributes->push_back(attribute); + } + + + XList::XList(const XNamespace& ns) + { + Namespaces->push_back(ns); + } + + + XList::XList(const XText& text) + { + Nodes->push_back(text); + } + + + XList::XList(const XElement& element) + { + Nodes->push_back(element); + } + + + XList::XList(const XComment& comment) + { + Nodes->push_back(comment); + } + + + XList::XList(const XML::XContainer& container) + { + Nodes = container->Nodes; + } + + + XList::XList(const XNode& node) + { + Nodes->push_back(node); + } + + + XList& XList::Add(const XList& list) + { + Attributes->merge(list.Attributes); + Namespaces->merge(list.Namespaces); + Nodes->merge(list.Nodes); + return *this; + } + + + XList& XList::Add(const XAttribute& attribute) + { + Attributes->push_back(attribute); + return *this; + } + + + XList& XList::Add(const XNamespace& ns) + { + Namespaces->push_back(ns); + return *this; + } + + + XList& XList::Add(const XText& text) + { + Nodes->push_back(text); + return *this; + } + + + XList& XList::Add(const XElement& element) + { + Nodes->push_back(element); + return *this; + } + + + XList& XList::Add(const XComment& comment) + { + Nodes->push_back(comment); + return *this; + } + + + XList& XList::Add(const XML::XContainer& container) + { + Nodes->push_back(container); + return *this; + } + + + XList& XList::Add(const XNode& node) + { + Nodes->push_back(node); + return *this; + } + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XList.h b/ASCOfficeOdtFile/Source/XML/Private/XList.h new file mode 100644 index 0000000000..23a4e53326 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XList.h @@ -0,0 +1,149 @@ +#pragma once +#ifndef XML_PRIVATE_XLIST_INCLUDE_H_ +#define XML_PRIVATE_XLIST_INCLUDE_H_ + +#include "XAttributeContainer.h" +#include "XNamespaceContainer.h" +#include "XNodeContainer.h" +#include "property.h" + + +namespace XML +{ + class XText; + class XElement; + class XComment; + class XContainer; + class XNode; + + namespace Private + { + class XList + { + public: + XList(); + XList(const XAttribute& attribute); + XList(const XNamespace& ns); + XList(const XText& text); + XList(const XElement& element); + XList(const XComment& comment); + XList(const XML::XContainer& container); + XList(const XNode& node); + + public: + XList& Add(const XList& list); + XList& Add(const XAttribute& attribute); + XList& Add(const XNamespace& ns); + XList& Add(const XText& text); + XList& Add(const XElement& element); + XList& Add(const XComment& comment); + XList& Add(const XML::XContainer& container); + XList& Add(const XNode& node); + + public: + property Attributes; + property Namespaces; + property Nodes; + }; + } // namespace Private + + template + Private::XList& operator ,(Private::XList& rhs, const T& lhs) + { + return rhs.Add(lhs); + } + + template + Private::XList operator ,(const XNamespace& rhs, const T& lhs) + { + return Private::XList(rhs).Add(lhs); + } + + template + Private::XList operator ,(const XAttribute& rhs, const T& lhs) + { + return Private::XList(rhs).Add(lhs); + } + + template + Private::XList operator ,(const XText& rhs, const T& lhs) + { + return Private::XList(rhs).Add(lhs); + } + + template + Private::XList operator ,(const XElement& rhs, const T& lhs) + { + return Private::XList(rhs).Add(lhs); + } + + template + Private::XList operator ,(const XComment& rhs, const T& lhs) + { + return Private::XList(rhs).Add(lhs); + } + + template + Private::XList operator ,(const XContainer& rhs, const T& lhs) + { + return Private::XList(rhs).Add(lhs); + } + + template + Private::XList operator ,(const XNode& rhs, const T& lhs) + { + return Private::XList(rhs).Add(lhs); + } + + + template + Private::XList& operator +(Private::XList& rhs, const T& lhs) + { + return rhs.Add(lhs); + } + + template + Private::XList operator +(const XAttribute& rhs, const T& lhs) + { + return Private::XList(rhs).Add(lhs); + } + + template + Private::XList operator +(const XNamespace& rhs, const T& lhs) + { + return Private::XList(rhs).Add(lhs); + } + + template + Private::XList operator +(const XText& rhs, const T& lhs) + { + return Private::XList(rhs).Add(lhs); + } + + template + Private::XList operator +(const XElement& rhs, const T& lhs) + { + return Private::XList(rhs).Add(lhs); + } + + template + Private::XList operator +(const XComment& rhs, const T& lhs) + { + return Private::XList(rhs).Add(lhs); + } + + template + Private::XList operator +(const XContainer& rhs, const T& lhs) + { + return Private::XList(rhs).Add(lhs); + } + + template + Private::XList operator +(const XNode& rhs, const T& lhs) + { + return Private::XList(rhs).Add(lhs); + } + +} // namespace XML + +#endif // XML_PRIVATE_XLIST_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XNamespaceContainer.cpp b/ASCOfficeOdtFile/Source/XML/Private/XNamespaceContainer.cpp new file mode 100644 index 0000000000..5ae5bfb9d2 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XNamespaceContainer.cpp @@ -0,0 +1,98 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "XNamespaceContainer.h" +#include "NullXNamespace.h" + + +namespace XML +{ + namespace Private + { + static NullXNamespace nullXNamespace; + + + const bool XNamespaceContainer::exist(const std::string& name) const + { + BOOST_FOREACH(const XNamespace& current, m_container) + { + if (current->GetPrefix() == name) + return true; + } + return false; + } + + + + XNamespace& XNamespaceContainer::operator[] (const std::string& name) + { + BOOST_FOREACH(XNamespace& current, m_container) + { + if (current->GetPrefix() == name) + return current; + } + return nullXNamespace; + } + + + const XNamespace& XNamespaceContainer::operator[] (const std::string& name) const + { + BOOST_FOREACH(const XNamespace& current, m_container) + { + if (current->GetPrefix() == name) + return current; + } + return nullXNamespace; + } + + + void XNamespaceContainer::erase(const std::string& name) + { + //for (std::set::iterator i = m_container.begin(); i != m_container.end(); ++i) + for (std::list::iterator i = m_container.begin(); i != m_container.end(); ++i) + { + if ((*i)->GetPrefix() == name) + { + m_container.erase(i); + return; + } + } + } + + + void XNamespaceContainer::erase(const XNamespaceContainer& rhs) + { + BOOST_FOREACH(const XNamespace& current, rhs.m_container) + { + erase(current->GetPrefix()); + } + } + + + XNamespaceContainer::iterator XNamespaceContainer:: begin() + { + return m_container.begin(); + } + + + XNamespaceContainer::iterator XNamespaceContainer::end() + { + return m_container.end(); + } + + + XNamespaceContainer::const_iterator XNamespaceContainer::begin() const + { + return m_container.begin(); + } + + + XNamespaceContainer::const_iterator XNamespaceContainer::end() const + { + return m_container.end(); + } + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XNamespaceContainer.h b/ASCOfficeOdtFile/Source/XML/Private/XNamespaceContainer.h new file mode 100644 index 0000000000..a377fcea4c --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XNamespaceContainer.h @@ -0,0 +1,40 @@ +#pragma once +#ifndef XML_PRIVATE_XNAMESPACE_CONTAINER_INCLUDE_H_ +#define XML_PRIVATE_XNAMESPACE_CONTAINER_INCLUDE_H_ + +#include "XContainer.h" +#include "./../XNamespace.h" +#include + + +namespace XML +{ + namespace Private + { + class XNamespaceContainer : public XContainer + { + public: + const bool exist(const std::string& name) const; + + XNamespaceContainer const* const operator->() const {return this;} + XNamespaceContainer* operator->() {return this;} + + XNamespace& operator[] (const std::string& name); + const XNamespace& operator[] (const std::string& name) const; + + void erase(const std::string& name); + void erase(const XNamespaceContainer& rhs); + public: + typedef std::list::iterator iterator; + typedef std::list::const_iterator const_iterator; + + public: + iterator begin(); + iterator end(); + const_iterator begin() const; + const_iterator end() const; + }; + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_XNAMESPACE_CONTAINER_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XNodeContainer.cpp b/ASCOfficeOdtFile/Source/XML/Private/XNodeContainer.cpp new file mode 100644 index 0000000000..0e540cd931 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XNodeContainer.cpp @@ -0,0 +1,102 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "XNodeContainer.h" +#include +#include +#include +#include "./../XNode.h" +#include "./../XContainer.h" + + +namespace XML +{ + namespace Private + { + + XNodeContainer::XNodeContainer() + : m_container(new std::list()) + { + } + + + const bool XNodeContainer::empty() const + { + return m_container->empty(); + } + + + const size_t XNodeContainer::size() const + { + return m_container->size(); + } + + + void XNodeContainer::Add(const XNode& node) + { + push_back(node); + } + + + void XNodeContainer::push_back(const XNode& node) + { + if (node.is_init()) + { + if (node.isElement() || node.isText() || node.isComment()) + m_container->push_back(node); + else + merge(XML::XContainer(node)->Nodes); + } + } + + + void XNodeContainer::merge(const XNodeContainer& other) + { + //std::for_each(other.m_container->begin(), other.m_container->end(), + // boost::bind(&XNodeContainer::push_back, this, _1)); + for(std::list::const_iterator current = other.m_container->begin(); current != other.m_container->end(); current++) + push_back(*current); + } + + + const std::string XNodeContainer::ToString() const + { + return std::accumulate(m_container->begin(), m_container->end(), std::string(), + boost::bind(std::plus(), _1, boost::bind(&XNode::ToString, _2))); + } + + + const std::wstring XNodeContainer::ToWString() const + { + return std::accumulate(m_container->begin(), m_container->end(), std::wstring(), + boost::bind(std::plus(), _1, boost::bind(&XNode::ToWString, _2))); + } + + + void XNodeContainer::SaveToStringList(std::list& strList)const + { + for(std::list::const_iterator iter = m_container->begin(); iter != m_container->end(); iter++) + { + iter->SaveToStringList(strList); + } + } + + + void XNodeContainer::SaveToWStringList(std::list& strList)const + { + for(std::list::const_iterator iter = m_container->begin(); iter != m_container->end(); iter++) + { + iter->SaveToWStringList(strList); + } + } + + + const boost::shared_ptr > XNodeContainer::container() const + { + return m_container; + } + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XNodeContainer.h b/ASCOfficeOdtFile/Source/XML/Private/XNodeContainer.h new file mode 100644 index 0000000000..30a61b66a5 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XNodeContainer.h @@ -0,0 +1,62 @@ +#ifndef XML_PRIVATE_XNODE_CONTAINER_INCLUDE_H_ +#define XML_PRIVATE_XNODE_CONTAINER_INCLUDE_H_ + +#include +#include +#include +#include + + +namespace XML +{ + class XNode; + + namespace Private + { + class XNodeContainer + { + public: + XNodeContainer(); + + public: + const bool empty() const; + const size_t size() const; + void Add(const XNode& node); + void push_back(const XNode& node); + void merge(const XNodeContainer& other); + + public: + //typedef std::vector::iterator iterator; + //typedef std::vector::const_iterator const_iterator; + typedef std::list::iterator iterator; + typedef std::list::const_iterator const_iterator; + + + public: + XNodeContainer const* const operator->() const {return this;} + XNodeContainer* operator->() {return this;} + + public: + const std::string ToString() const; + const std::wstring ToWString() const; + virtual void SaveToStringList(std::list& strList)const; + virtual void SaveToWStringList(std::list& strList)const; + + public: + iterator begin() {return m_container->begin();} + iterator end() {return m_container->end();} + const_iterator begin() const {return m_container->begin();} + const_iterator end() const {return m_container->end();} + + public: + //const boost::shared_ptr > container() const; + const boost::shared_ptr > container() const; + + private: + //boost::shared_ptr > m_container; + boost::shared_ptr > m_container; + }; + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_XNODE_CONTAINER_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XPointer.h b/ASCOfficeOdtFile/Source/XML/Private/XPointer.h new file mode 100644 index 0000000000..b7d0baaeae --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XPointer.h @@ -0,0 +1,43 @@ +#pragma once +#ifndef XML_PRIVATE_XPOINTER_INCLUDE_H_ +#define XML_PRIVATE_XPOINTER_INCLUDE_H_ + +#include + + +namespace XML +{ + namespace Private + { + template + class XPointer + { + public: + XPointer() {} + XPointer(T* ptr) : m_ptr(ptr) {} + XPointer(const boost::shared_ptr& ptr) : m_ptr(ptr) {} + + template + XPointer(const XPointer& rhs) : m_ptr(boost::dynamic_pointer_cast(rhs.get_ptr())) {} + + boost::shared_ptr get_ptr() const {return m_ptr;} + + public: + T const* const operator->() const {return m_ptr.get();} + T* operator->() {return m_ptr.get();} + + const T& operator*() const {return *m_ptr;} + T& operator*() {return *m_ptr;} + + const bool is_init() const {return m_ptr != 0;} + + protected: + boost::shared_ptr m_ptr; + + protected: + typedef XPointer base; + }; + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_XPOINTER_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XSingleSource.cpp b/ASCOfficeOdtFile/Source/XML/Private/XSingleSource.cpp new file mode 100644 index 0000000000..e2bcc687cf --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XSingleSource.cpp @@ -0,0 +1,170 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "XSingleSource.h" +#include "Lexigraph.h" +#include "Exception\not_implement.h" + + +namespace XML +{ + namespace Private + { + + XSingleSource::~XSingleSource() + { + } + + + void XSingleSource::next() + { + ++m_iterator; + } + + + void XSingleSource::skipSpace() + { + for (; isSpace() ; ++m_iterator); + } + + + void XSingleSource::find(const char value) + { + //if (NULL == m_iterator._Mycont) + // return; + for (; *m_iterator != value; ++m_iterator); + } + + + void XSingleSource::find(const char value1, const char value2) + { + for (; ((*m_iterator != value1) && (*m_iterator != value2)); ++m_iterator); + } + + + void XSingleSource::findAndSkip(const char value) + { + find(value); + next(); + } + + + const char XSingleSource::get() const + { + //if (NULL == m_iterator._Mycont) + // return 0; + return *m_iterator; + } + + + const std::string XSingleSource::getString(const char separator) + { + std::string result; + while (*m_iterator != separator) + result += *m_iterator++; + return Lexigraph::fromSource(result); + } + + + const std::string XSingleSource::getString(const char separator1, const char separator2) + { + std::string result; + while ((*m_iterator != separator1) && (*m_iterator != separator2)) + result += *m_iterator++; + return Lexigraph::fromSource(result); + } + + + const std::pair XSingleSource::getName() + { + std::string prefix = getToSeparator(':'); + std::string name; + if (get() == ':') + { + next(); + name = getToSeparator(); + } + else + { + std::swap(prefix, name); + } + return std::make_pair(prefix, name); + } + + + const std::pair XSingleSource::getPair() + { + const std::string name = get(' ', '='); + const std::string value = getValue(); + return std::make_pair(name, value); + } + + + const std::pair, const std::string> XSingleSource::getAttribute() + { + const std::pair name = getName(); + const std::string value = getValue(); + return std::make_pair(name, value); + } + + + const bool XSingleSource::isSpace() const + { + if (*m_iterator == ' ' || *m_iterator == '\n' || *m_iterator == '\r' || *m_iterator == '\t') + return true; + return false; + } + + + const bool XSingleSource::isSeparator() const + { + if (*m_iterator == '<' || *m_iterator == '>' || *m_iterator == '=' || *m_iterator == '/') + return true; + return false; + } + + + const std::string XSingleSource::get(const char separator1, const char separator2) + { + skipSpace(); + std::string result; + while (*m_iterator != separator1 && *m_iterator != separator2) + result += *m_iterator++; + return result; + } + + + const std::string XSingleSource::getToSeparator() + { + skipSpace(); + std::string result; + while (!isSeparator() && !isSpace()) + result += *m_iterator++; + return result; + } + + + const std::string XSingleSource::getToSeparator(const char separator) + { + skipSpace(); + std::string result; + while (!isSeparator() && !isSpace() && *m_iterator != separator) + result += *m_iterator++; + return result; + } + + + const std::string XSingleSource::getValue() + { + find('"', '\''); + char EndChar = *m_iterator; + next(); + const std::string value = getString(EndChar);//Çíà÷åíèå àòòðèáóòà - ýòî òî, ÷òî çàêëþ÷åíî ìåæäó _îäèíàêîâûìè_ êàâû÷êàìè + next(); + return value; + } + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XSingleSource.h b/ASCOfficeOdtFile/Source/XML/Private/XSingleSource.h new file mode 100644 index 0000000000..81e0d4af57 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XSingleSource.h @@ -0,0 +1,49 @@ +#pragma once +#ifndef XML_PRIVATE_XSINGLE_SOURCE_INCLUDE_H_ +#define XML_PRIVATE_XSINGLE_SOURCE_INCLUDE_H_ + +//#include "XSource.h" +#include +#include + + +namespace XML +{ + namespace Private + { + class XSingleSource// : public XSource + { + public: + virtual ~XSingleSource(); + + public: + virtual void next(); + virtual void skipSpace(); + virtual void find(const char value); + virtual void find(const char value1, const char value2); + virtual void findAndSkip(const char value); + virtual const char get() const; + virtual const std::string getString(const char separator); + virtual const std::string getString(const char separator1, const char separator2); + + public: + virtual const std::pair getName(); + virtual const std::pair getPair(); + virtual const std::pair, const std::string> getAttribute(); + + private: + const bool isSpace() const; + const bool isSeparator() const; + + const std::string get(const char separator1, const char separator2); + const std::string getToSeparator(); + const std::string getToSeparator(const char separator); + const std::string getValue(); + + protected: + std::istreambuf_iterator m_iterator; + }; + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_XSINGLE_SOURCE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XSpace.cpp b/ASCOfficeOdtFile/Source/XML/Private/XSpace.cpp new file mode 100644 index 0000000000..1641f968d3 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XSpace.cpp @@ -0,0 +1,57 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "XSpace.h" + + +namespace XML +{ + namespace Private + { + + XSpace::XSpace() + : m_space(false) + { + } + + + XSpace::XSpace(const bool space) + : m_space(space) + { + } + + + const XSpace& XSpace::operator =(const bool rhs) + { + m_space = rhs; + return *this; + } + + + void XSpace::setDefault() + { + m_space = false; + } + + + void XSpace::setPreserve() + { + m_space = true; + } + + + const bool XSpace::isDefault() const + { + return m_space == false; + } + + + const bool XSpace::isPreserve() const + { + return m_space == true; + } + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XSpace.h b/ASCOfficeOdtFile/Source/XML/Private/XSpace.h new file mode 100644 index 0000000000..8d8d69f639 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XSpace.h @@ -0,0 +1,33 @@ +#pragma once +#ifndef XML_PRIVATE_XSPACE_INCLUDE_H_ +#define XML_PRIVATE_XSPACE_INCLUDE_H_ + + +namespace XML +{ + namespace Private + { + class XSpace + { + public: + XSpace(); + XSpace(const bool space); + + public: + const XSpace& operator =(const bool rhs); + + public: + void setDefault(); + void setPreserve(); + + public: + const bool isDefault() const; + const bool isPreserve() const; + + private: + bool m_space; + }; + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_XSPACE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XString.cpp b/ASCOfficeOdtFile/Source/XML/Private/XString.cpp new file mode 100644 index 0000000000..d988f5c9d3 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XString.cpp @@ -0,0 +1,186 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "XString.h" +#include +#include "Encoding.h" + + +namespace XML +{ + namespace Private + { + + XString::XString() + { + } + + + XString::XString(const char* value) + : m_value(value) + { + } + + + XString::XString(const std::string& value) + : m_value(value) + { + } + + + const bool XString::operator ==(const XString& rhs) const + { + return m_value == rhs.m_value; + } + + + const bool XString::operator !=(const XString& rhs) const + { + return m_value != rhs.m_value; + } + + + const bool XString::operator ==(const std::string& rhs) const + { + return m_value.get_value_or("") == rhs; + } + + + const bool XString::operator !=(const std::string& rhs) const + { + return m_value.get_value_or("") != rhs; + } + + + const bool XString::operator ==(const char* rhs) const + { + return m_value.get_value_or("") == rhs; + } + + + const bool XString::operator !=(const char* rhs) const + { + return m_value.get_value_or("") != rhs; + } + + + const bool XString::ToBool() const + { + if (!m_value.is_init()) + return false; + if (m_value == "true" || m_value == "t" || m_value == "1") + return true; + return false; + } + + + const int XString::ToInt() const + { + //return boost::lexical_cast(m_value.get_value_or("0")); + try + { + std::string str = m_value.get_value_or("0"); + return atoi(str.c_str()); + } + catch(...) + { + } + return 0; + } + + + const size_t XString::ToSizet() const + { + //return boost::lexical_cast(m_value.get_value_or("0")); + try + { + std::string str = m_value.get_value_or("0"); + return (size_t)atoi(str.c_str()); + } + catch(...) + { + } + return 0; + } + + + const double XString::ToDouble() const + { + //return boost::lexical_cast(m_value.get_value_or("0")); + std::string str = m_value.get_value_or("0"); + double d = 0; + try + { + sscanf(str.c_str(), "%lf", &d); + } + catch(...) + { + d = 0; + } + return d; + } + + + const std::string XString::ToString() const + { + return m_value.get_value_or_default(); + } + + + const std::wstring XString::ToWString() const + { + return Encoding::utf82unicode(m_value.get_value_or_default()); + } + + + const boost::filesystem::path XString::ToPath() const + { + return m_value.get_value_or_default(); + } + + + const boost::filesystem::wpath XString::ToWPath() const + { + return Encoding::utf82unicode(m_value.get_value_or_default()); + } + + + XString::operator const bool() const + { + return ToBool(); + } + + + XString::operator const int() const + { + return ToInt(); + } + + + XString::operator const size_t() const + { + return ToSizet(); + } + + + XString::operator const double() const + { + return ToDouble(); + } + + + XString::operator const std::string() const + { + return ToString(); + } + + + XString::operator const std::wstring() const + { + return ToWString(); + } + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XString.h b/ASCOfficeOdtFile/Source/XML/Private/XString.h new file mode 100644 index 0000000000..3a46ad45f2 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XString.h @@ -0,0 +1,212 @@ +#pragma once +#ifndef XML_PRIVATE_XSTRING_INCLUDE_H_ +#define XML_PRIVATE_XSTRING_INCLUDE_H_ + +#include +#include +#include +#include "nullable.h" +#include "property.h" +#include "nullable_property.h" +#include "Parse.h" + + +namespace XML +{ + namespace Private + { + class XString + { + public: + XString(); + XString(const char* value); + XString(const std::string& value); + + public: + const bool operator ==(const XString& rhs) const; + const bool operator !=(const XString& rhs) const; + const bool operator ==(const std::string& rhs) const; + const bool operator !=(const std::string& rhs) const; + const bool operator ==(const char* rhs) const; + const bool operator !=(const char* rhs) const; + + public: + const bool ToBool() const; + const int ToInt() const; + const size_t ToSizet() const; + const double ToDouble() const; + const std::string ToString() const; + const std::wstring ToWString() const; + const boost::filesystem::path ToPath() const; + const boost::filesystem::wpath ToWPath() const; + + operator const bool() const; + operator const int() const; + operator const size_t() const; + operator const double() const; + operator const std::string() const; + operator const std::wstring() const; + + template + operator const nullable() const + { + if (m_value.is_init()) + return Parse(m_value); + return nullable(); + } + + template + operator const nullable_property() const + { + if (m_value.is_init()) + return Parse(m_value); + return nullable_property(); + } + + public: + template const bool operator ==(const T value) const + { + return static_cast(*this) == value; + } + + template const bool operator !=(const T value) const + { + return static_cast(*this) != value; + } + + template const bool operator > (const T value) const + { + return static_cast(*this) > value; + } + + template const bool operator < (const T value) const + { + return static_cast(*this) < value; + } + + template const bool operator >=(const T value) const + { + return static_cast(*this) >= value; + } + + template const bool operator <=(const T value) const + { + return static_cast(*this) <= value; + } + + template const bool operator ==(const property value) const + { + return static_cast(*this) == *value; + } + + template const bool operator !=(const property value) const + { + return static_cast(*this) != *vlaue; + } + + template const bool operator > (const property value) const + { + return static_cast(*this) > *value; + } + + template const bool operator < (const property value) const + { + return static_cast(*this) < *value; + } + + template const bool operator >=(const property value) const + { + return static_cast(*this) >= *value; + } + + template const bool operator <=(const property value) const + { + return static_cast(*this) <= *value; + } + + template const bool operator ==(const nullable value) const + { + return static_cast(*this) == *value; + } + + template const bool operator !=(const nullable value) const + { + return static_cast(*this) != *value; + } + + template const bool operator > (const nullable value) const + { + return static_cast(*this) > *value; + } + + template const bool operator < (const nullable value) const + { + return static_cast(*this) < *value; + } + + template const bool operator >=(const nullable value) const + { + return static_cast(*this) >= *value; + } + + template const bool operator <=(const nullable value) const + { + return static_cast(*this) <= *value; + } + + template const bool operator ==(const nullable_property value) const + { + return static_cast(*this) == *value; + } + + template const bool operator !=(const nullable_property value) const + { + return static_cast(*this) != *vlaue; + } + + template const bool operator > (const nullable_property value) const + { + return static_cast(*this) > *value; + } + + template const bool operator < (const nullable_property value) const + { + return static_cast(*this) < *value; + } + + template const bool operator >=(const nullable_property value) const + { + return static_cast(*this) >= *value; + } + + template const bool operator <=(const nullable_property value) const + { + return static_cast(*this) <= *value; + } + + private: + nullable m_value; + }; + } // namespace Private +} // namespace XML + + +template +const nullable& nullable_setter(nullable& lhs, const XML::Private::XString& rhs) +{ + return ::nullable_setter(lhs, nullable(rhs)); +} + +template +const property& property_setter(property& lhs, const XML::Private::XString& rhs) +{ + return ::property_setter(lhs, T(rhs)); +} + +template +const nullable_property& nullable_property_setter(nullable_property& lhs, const XML::Private::XString& rhs) +{ + return ::nullable_property_setter(lhs, nullable_property(rhs)); +} + +#endif // XML_PRIVATE_XSTRING_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XStringSource.cpp b/ASCOfficeOdtFile/Source/XML/Private/XStringSource.cpp new file mode 100644 index 0000000000..96ea363bd9 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XStringSource.cpp @@ -0,0 +1,33 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "XStringSource.h" +#include "Exception\not_implement.h" + + +namespace XML +{ + namespace Private + { + + XStringSource::XStringSource(const std::string& source) + : m_stream(source) + { + setBegin(); + } + + + XStringSource::~XStringSource() + { + } + + + void XStringSource::setBegin() + { + m_iterator = m_stream; + } + + } // namespace Prviate +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XStringSource.h b/ASCOfficeOdtFile/Source/XML/Private/XStringSource.h new file mode 100644 index 0000000000..e614517d47 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XStringSource.h @@ -0,0 +1,29 @@ +#pragma once +#ifndef XML_PRIVATE_XSTRING_SOURCE_INCLUDE_H_ +#define XML_PRIVATE_XSTRING_SOURCE_INCLUDE_H_ + +#include "XSingleSource.h" +#include +#include + + +namespace XML +{ + namespace Private + { + class XStringSource : public XSingleSource + { + public: + XStringSource(const std::string& source); + virtual ~XStringSource(); + + private: + void setBegin(); + + private: + std::istringstream m_stream; + }; + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_XSTRING_SOURCE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XTextContainer.cpp b/ASCOfficeOdtFile/Source/XML/Private/XTextContainer.cpp new file mode 100644 index 0000000000..c14799c3d6 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XTextContainer.cpp @@ -0,0 +1,88 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "XTextContainer.h" +#include "XNodeContainer.h" +#include "./../XText.h" + + +namespace XML +{ + namespace Private + { + + XTextContainer::XTextContainer(const XNodeContainer& nodes) + : m_container(nodes.container()) + { + } + + + const bool XTextContainer::empty() const + { + return size() == 0; + } + + + const size_t XTextContainer::size() const + { + size_t size = 0; + for (const_iterator i = begin(); i != end(); ++i) + ++size; + return size; + } + + + void XTextContainer::push_back(const XText& text) + { + if (text.is_init()) + { + m_container->push_back(text); + } + } + + + void XTextContainer::Add(const XML::XText& text) + { + push_back(text); + } + + + const XString XTextContainer::text() const + { + std::string text; + for (const_iterator i = begin(); i != end(); ++i) + { + text += XText(*i)->Value; + } + return text.empty() ? XString() : text; + } + + + XTextContainer::iterator XTextContainer:: begin() + { + return iterator(m_container->begin(), m_container->end()); + } + + + XTextContainer::iterator XTextContainer::end() + { + return iterator(m_container->end(), m_container->end()); + } + + + XTextContainer::const_iterator XTextContainer::begin() const + { + return const_iterator(m_container->begin(), m_container->end()); + } + + + XTextContainer::const_iterator XTextContainer::end() const + { + return const_iterator(m_container->end(), m_container->end()); + } + + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XTextContainer.h b/ASCOfficeOdtFile/Source/XML/Private/XTextContainer.h new file mode 100644 index 0000000000..651973561d --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XTextContainer.h @@ -0,0 +1,56 @@ +#pragma once +#ifndef XML_PRIVATE_XTEXT_CONTAINER_INCLUDE_H_ +#define XML_PRIVATE_XTEXT_CONTAINER_INCLUDE_H_ + +#include +//#include +#include +#include +#include "Filter/Text.h" +#include "XString.h" + + +namespace XML +{ + namespace Private + { + class XNodeContainer; + + class XTextContainer + { + public: + XTextContainer(const XNodeContainer& nodes); + + public: + const bool empty() const; + const size_t size() const; + void push_back(const XText& text); + void Add(const XText& text); + + const XString text() const; + + public: + //typedef boost::filter_iterator::iterator> iterator; + //typedef boost::filter_iterator::const_iterator> const_iterator; + typedef boost::filter_iterator::iterator> iterator; + typedef boost::filter_iterator::const_iterator> const_iterator; + + public: + XTextContainer const* const operator->() const {return this;} + XTextContainer* operator->() {return this;} + + public: + iterator begin(); + iterator end(); + const_iterator begin() const; + const_iterator end() const; + + private: + //boost::shared_ptr > m_container; + boost::shared_ptr > m_container; + }; + } // namespace Private +} // namespace XML + + +#endif // XML_PRIVATE_XTEXT_CONTAINER_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XWFileSource.cpp b/ASCOfficeOdtFile/Source/XML/Private/XWFileSource.cpp new file mode 100644 index 0000000000..431e99c860 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XWFileSource.cpp @@ -0,0 +1,43 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "XWFileSource.h" +#include "Exception\not_implement.h" + + +namespace XML +{ + namespace Private + { + + XWFileSource::XWFileSource(const boost::filesystem::path& path, XWideSource::eSourceType type) + : m_stream(path.string().c_str()) + , XWideSource(type) + { + setBegin(); + } + + + XWFileSource::XWFileSource(const boost::filesystem::wpath& path, XWideSource::eSourceType type) + : m_stream(path.string().c_str()) + , XWideSource(type) + { + setBegin(); + } + + + XWFileSource::~XWFileSource() + { + } + + + void XWFileSource::setBegin() + { + m_iterator = m_stream; + } + + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XWFileSource.h b/ASCOfficeOdtFile/Source/XML/Private/XWFileSource.h new file mode 100644 index 0000000000..9a8780c7ef --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XWFileSource.h @@ -0,0 +1,31 @@ +#pragma once +#ifndef XML_PRIVATE_XWFILE_SOURCE_INCLUDE_H_ +#define XML_PRIVATE_XWFILE_SOURCE_INCLUDE_H_ + +#include "XWideSource.h" +#include +#include +#include + + +namespace XML +{ + namespace Private + { + class XWFileSource : public XWideSource + { + public: + XWFileSource(const boost::filesystem::path& path, XWideSource::eSourceType type); + XWFileSource(const boost::filesystem::wpath& path, XWideSource::eSourceType type); + virtual ~XWFileSource(); + + private: + void setBegin(); + + private: + std::wifstream m_stream; + }; + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_XWFILE_SOURCE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XWStringSource.cpp b/ASCOfficeOdtFile/Source/XML/Private/XWStringSource.cpp new file mode 100644 index 0000000000..756f9ab171 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XWStringSource.cpp @@ -0,0 +1,34 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "XWStringSource.h" +#include "Exception\not_implement.h" + + +namespace XML +{ + namespace Private + { + + XWStringSource::XWStringSource(const std::wstring& source) + : m_stream(source) + , XWideSource(XWideSource::estStringSource) + { + setBegin(); + } + + + XWStringSource::~XWStringSource() + { + } + + + void XWStringSource::setBegin() + { + m_iterator = m_stream; + } + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XWStringSource.h b/ASCOfficeOdtFile/Source/XML/Private/XWStringSource.h new file mode 100644 index 0000000000..50be811711 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XWStringSource.h @@ -0,0 +1,29 @@ +#pragma once +#ifndef XML_PRIVATE_XWSTRING_SOURCE_INCLUDE_H_ +#define XML_PRIVATE_XWSTRING_SOURCE_INCLUDE_H_ + +#include "XWideSource.h" +#include +#include + + +namespace XML +{ + namespace Private + { + class XWStringSource : public XWideSource + { + public: + XWStringSource(const std::wstring& source); + virtual ~XWStringSource(); + + private: + void setBegin(); + + private: + std::wistringstream m_stream; + }; + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_XWSTRING_SOURCE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XWideSource.cpp b/ASCOfficeOdtFile/Source/XML/Private/XWideSource.cpp new file mode 100644 index 0000000000..70ea8da8eb --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XWideSource.cpp @@ -0,0 +1,211 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "XWideSource.h" +#include "Lexigraph.h" +#include "Encoding.h" +#include "Exception\not_implement.h" + + +namespace XML +{ + namespace Private + { + XWideSource::XWideSource(eSourceType type) + : m_SourceType(type) + , m_current(0) + { + } + + + XWideSource::~XWideSource() + { + } + + + void XWideSource::next() + { + if(m_SourceType == estLittleEndian) + { + m_current = *m_iterator; + ++m_iterator; + m_current = ((*m_iterator)<<8) + m_current; + ++m_iterator; + } + else if(m_SourceType == estBigEndian) + { + m_current = *m_iterator; + ++m_iterator; + m_current = (m_current << 8) + (*m_iterator); + ++m_iterator; + } + else + { + m_current = *m_iterator; + ++m_iterator; + } + } + + + void XWideSource::skipSpace() + { + for (; isSpace() ; next()/*++m_iterator*/); + } + + + void XWideSource::find(const wchar_t value) + { + for (; /**m_iterator*/m_current != value; next()/*++m_iterator*/); + } + + + void XWideSource::find(const wchar_t value1, const wchar_t value2) + { + for (; ((/**m_iterator*/m_current != value1) && (/**m_iterator*/m_current != value2)); next()/*++m_iterator*/); + } + + + void XWideSource::findAndSkip(const wchar_t value) + { + find(value); + next(); + } + + + const std::pair XWideSource::getName() + { + std::wstring prefix = getToSeparator(L':'); + std::wstring name; + if (get() == L':') + { + next(); + name = getToSeparator(); + } + else + { + std::swap(prefix, name); + } + return std::make_pair(prefix, name); + } + + + const std::pair XWideSource::getPair() + { + const std::wstring name = get(L' ', L'='); + const std::wstring value = getValue(); + return std::make_pair(name, value); + } + + + const std::pair, const std::wstring> XWideSource::getAttribute() + { + const std::pair name = getName(); + const std::wstring value = getValue(); + return std::make_pair(name, value); + } + + + const wchar_t XWideSource::get() const + { + return m_current; + } + + + const std::wstring XWideSource::getString(const wchar_t separator) + { + std::wstring result; + while (m_current != separator) + //result += *m_iterator++; + { + result += m_current; + next(); + } + return Lexigraph::fromSource(result); + } + + + const std::wstring XWideSource::getString(const wchar_t separator1, const wchar_t separator2) + { + std::wstring result; + while ((m_current != separator1) && (m_current != separator2)) + // result += *m_iterator++; + { + result += m_current; + next(); + } + return Lexigraph::fromSource(result); + } + + + const bool XWideSource::isSpace() const + { + if (/**m_iterator*/m_current == L' ' || /**m_iterator*/m_current == L'\n' || /**m_iterator*/m_current == L'\r' || /**m_iterator*/m_current == L'\t') + return true; + return false; + } + + + const bool XWideSource::isSeparator() const + { + if (/**m_iterator*/m_current == L'<' || /**m_iterator*/m_current == L'>' || /**m_iterator*/m_current == L'=' || /**m_iterator*/m_current == L'/') + return true; + return false; + } + + + const std::wstring XWideSource::get(const wchar_t separator1, const wchar_t separator2) + { + skipSpace(); + std::wstring result; + while (/**m_iterator*/m_current != separator1 && /**m_iterator*/m_current != separator2) + // result += *m_iterator++; + { + result += m_current; + next(); + } + return result; + } + + + const std::wstring XWideSource::getToSeparator() + { + skipSpace(); + std::wstring result; + while (!isSeparator() && !isSpace()) + { + result += m_current; + next(); + } + // result += *m_iterator++; + return result; + } + + + const std::wstring XWideSource::getToSeparator(const wchar_t separator) + { + skipSpace(); + std::wstring result; + while (!isSeparator() && !isSpace() && /**m_iterator*/m_current != separator) + { + result += m_current; + next(); + //result += *m_iterator++; + } + return result; + } + + + const std::wstring XWideSource::getValue() + { + find(L'"', L'\''); + wchar_t EndChar = get();//*m_iterator; + next(); + const std::wstring value = getString(EndChar);//Çíà÷åíèå àòòðèáóòà - ýòî òî, ÷òî çàêëþ÷åíî ìåæäó _îäèíàêîâûìè_ êàâû÷êàìè + next(); + return value; + } + + } // namespace Private +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/Private/XWideSource.h b/ASCOfficeOdtFile/Source/XML/Private/XWideSource.h new file mode 100644 index 0000000000..24de91580c --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/Private/XWideSource.h @@ -0,0 +1,57 @@ +#pragma once +#ifndef XML_PRIVATE_XWIDE_SOURCE_INCLUDE_H_ +#define XML_PRIVATE_XWIDE_SOURCE_INCLUDE_H_ + +//#include "XSource.h" +#include +#include + + +namespace XML +{ + namespace Private + { + class XWideSource //: public XSource + { + public: + enum eSourceType {estLittleEndian, estBigEndian, estStringSource}; + public: + XWideSource(eSourceType type); + ~XWideSource(); + + public: + virtual void next(); + virtual void skipSpace(); + virtual void find(const wchar_t value); + virtual void find(const wchar_t value1, const wchar_t value2); + virtual void findAndSkip(const wchar_t value); + + public: + virtual const std::pair getName(); + virtual const std::pair getPair(); + virtual const std::pair, const std::wstring> getAttribute(); + + public: + virtual const wchar_t get() const; + virtual const std::wstring getString(const wchar_t separator); + virtual const std::wstring getString(const wchar_t separator1, const wchar_t separator2); + + private: + const bool isSpace() const; + const bool isSeparator() const; + + const std::wstring get(const wchar_t separator1, const wchar_t separator2); + const std::wstring getToSeparator(); + const std::wstring getToSeparator(const wchar_t separator); + const std::wstring getValue(); + + protected: + std::istreambuf_iterator m_iterator; + wchar_t m_current; + //bool m_littleEndian; + eSourceType m_SourceType; + }; + } // namespace Private +} // namespace XML + +#endif // XML_PRIVATE_XWIDE_SOURCE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/XAttribute.cpp b/ASCOfficeOdtFile/Source/XML/XAttribute.cpp new file mode 100644 index 0000000000..98f371b2c9 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/XAttribute.cpp @@ -0,0 +1,57 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "XAttribute.h" +#include "Private/NullAttribute.h" +#include "Private/NullXAttribute.h" + + +namespace XML +{ + + XAttribute::XAttribute() + : base(0) + { + } + + + XAttribute::XAttribute(Private::NullAttribute) + : base(new Private::NullAttribute) + { + } + + + const bool XAttribute::exist() const + { + return m_ptr->exist(); + } + + + const Private::XString XAttribute::value() const + { + return m_ptr->value(); + } + + + const Private::XString XAttribute::get_value_or(const std::string& def)const + { + if(exist()) + return value(); + return Private::XString(def); + } + + + const bool XAttribute::operator ==(const XAttribute& rhs) const + { + return ((*m_ptr) == (*rhs.m_ptr)); + } + + + const bool XAttribute::operator <(const XAttribute& rhs) const + { + return ((*m_ptr) < (*rhs.m_ptr)); + } + +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/XAttribute.h b/ASCOfficeOdtFile/Source/XML/XAttribute.h new file mode 100644 index 0000000000..370abb9cf7 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/XAttribute.h @@ -0,0 +1,52 @@ +#pragma once +#ifndef XML_XATTRIBUTE_INCLUDE_H_ +#define XML_XATTRIBUTE_INNLUDE_H_ + +#include "Private/XPointer.h" +#include "Private/Attribute.h" +#include "Private/XString.h" + +namespace XML +{ + namespace Private + { + class NullAttribute; + } + + class XAttribute : public Private::XPointer + { + public: + XAttribute(); + + template + XAttribute(const XName& name, const Type& value) + : base(new Private::Attribute(name, ToString(value))) + { + } + + template + XAttribute(const XName& name, const nullable& value) + : base(value.is_init() ? new Private::Attribute(name, ToString(value)) : 0) + { + } + + template + XAttribute(const XName& name, const nullable_property& value) + : base(value.is_init() ? new Private::Attribute(name, ToString(value)) : 0) + { + } + + protected: + XAttribute(Private::NullAttribute); + + public: + virtual const bool exist() const; + virtual const Private::XString value() const; + virtual const Private::XString get_value_or(const std::string& def)const; + const bool operator ==(const XAttribute& rhs) const; + const bool operator <(const XAttribute& rhs) const; + + }; +} // namespace XML + +#endif // XML_XATTRIBUTE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/XComment.cpp b/ASCOfficeOdtFile/Source/XML/XComment.cpp new file mode 100644 index 0000000000..2b968ad078 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/XComment.cpp @@ -0,0 +1,21 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "XComment.h" +#include "XNode.h" +#include + + +namespace XML +{ + + XComment::XComment(const XNode& xnode) + : base(boost::dynamic_pointer_cast(xnode.get_ptr())), + Value(m_ptr->Value) + { + } + + +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/XComment.h b/ASCOfficeOdtFile/Source/XML/XComment.h new file mode 100644 index 0000000000..e7a0fa4ce2 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/XComment.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef XML_XCOMMENT_INCLUDE_H_ +#define XML_XCOMMENT_INCLUDE_H_ + +#include "Private/XPointer.h" +#include "Private/Comment.h" +#include "nullable.h" +#include "property.h" +#include "nullable_property.h" +#include "Private/XString.h" +#include "Private/Lexigraph.h" + + +namespace XML +{ + class XNode; + + class XComment : public Private::XPointer + { + public: + template + explicit XComment(const T& value) + : base(new Private::Comment(ToString(value))), + Value(m_ptr->Value) + { + } + + XComment(const XNode& xnode); + + public: + Private::XString& Value; + }; +} // namespace XML + +#endif // XML_XCOMMENT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/XContainer.cpp b/ASCOfficeOdtFile/Source/XML/XContainer.cpp new file mode 100644 index 0000000000..20ada81f43 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/XContainer.cpp @@ -0,0 +1,69 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "XContainer.h" +#include "XNode.h" +#include "XElement.h" +#include "XText.h" +#include "Private/XList.h" + + +namespace XML +{ + + XContainer::XContainer() + : base(new Private::NodeContainer()) + { + } + + + XContainer::XContainer(const XNode& xnode) + : base(boost::dynamic_pointer_cast(xnode.get_ptr())) + { + } + + + XContainer::XContainer(const XElement& element) + : base(new Private::NodeContainer(element)) + { + } + + + XContainer::XContainer(const XText& text) + : base(new Private::NodeContainer(text)) + { + } + + + XContainer::XContainer(const Private::XList& list) + : base(new Private::NodeContainer(list)) + { + } + + + void XContainer::Add(const XNode& node) + { + m_ptr->Add(node); + } + + + void XContainer::Add(const XElement& element) + { + m_ptr->Add(element); + } + + + void XContainer::Add(const XText& text) + { + m_ptr->Add(text); + } + + + void XContainer::Add(const Private::XList& list) + { + m_ptr->Add(list); + } + +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/XContainer.h b/ASCOfficeOdtFile/Source/XML/XContainer.h new file mode 100644 index 0000000000..30e7884ea4 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/XContainer.h @@ -0,0 +1,53 @@ +#pragma once +#ifndef XML_XCONTAINER_INCLUDE_H_ +#define XML_XCONTAINER_INCLUDE_H_ + +#include "property.h" +#include "Private/XPointer.h" +#include "Private/NodeContainer.h" + + +namespace XML +{ + class XNode; + class XElement; + class XText; + + namespace Private + { + class XList; + } + + class XContainer : public Private::XPointer + { + public: + XContainer(); + XContainer(const XNode& node); + + public: + explicit XContainer(const XElement& element); + explicit XContainer(const XText& text); + explicit XContainer(const Private::XList& list); + + public: + template class C, class S, class G, class T, class A> + explicit XContainer(const property, S, G>& container) + : base(new Private::NodeContainer(*container)) + { + } + + template class C, typename T, typename A> + explicit XContainer(const C& container) + : base(new Private::NodeContainer(container)) + { + } + + public: + void Add(const XNode& node); + void Add(const XElement& element); + void Add(const XText& text); + void Add(const Private::XList& list); + }; +} // namespace XML + +#endif // XML_XCONTAINER_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/XDocument.cpp b/ASCOfficeOdtFile/Source/XML/XDocument.cpp new file mode 100644 index 0000000000..248887d87d --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/XDocument.cpp @@ -0,0 +1,245 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "XDocument.h" +#include "Private/XSpace.h" +#include "Exception/not_implement.h" +#include "Private/XFileSource.h" +#include "Private/XWFileSource.h" +#include "Private/XStringSource.h" +#include "Private/XWStringSource.h" +#include +#include "Utility.h" + + +namespace XML +{ + + XDocument::XDocument(const XElement& element) + : Root(element) + { + } + + + XDocument::XDocument(const char* source, const bool space) + { + //boost::filesystem::path path(source); + boost::filesystem::wpath path(Encoding::utf82unicode(std::string(source))); + TxtFile text(path); + if(text.isUnicode()) + { + boost::shared_ptr xsource(new Private::XWFileSource(path, Private::XWideSource::estLittleEndian)); + Load(xsource, space); + } + else if((text.isBigEndian()) || (text.isUnicodeWithOutBOM())) + { + boost::shared_ptr xsource(new Private::XWFileSource(path, Private::XWideSource::estBigEndian)); + Load(xsource, space); + } + else + { + boost::shared_ptr xsource(new Private::XFileSource(path)); + Load(xsource, space); + } + } + + + XDocument::XDocument(const wchar_t* source, const bool space) + { + boost::filesystem::wpath path(source); + TxtFile text(path); + if(text.isUnicode()) + { + boost::shared_ptr xsource(new Private::XWFileSource(path, Private::XWideSource::estLittleEndian)); + Load(xsource, space); + } + else if((text.isBigEndian()) || (text.isUnicodeWithOutBOM())) + { + boost::shared_ptr xsource(new Private::XWFileSource(path, Private::XWideSource::estBigEndian)); + Load(xsource, space); + } + else + { + boost::shared_ptr xsource(new Private::XFileSource(path)); + Load(xsource, space); + } +// boost::shared_ptr xsource(new Private::XFileSource(path)); +// Load(xsource, space); + } + + + XDocument::XDocument(const std::string& source, const bool space) + { + boost::shared_ptr xsource(new Private::XStringSource(source)); + Load(xsource, space); + } + + + XDocument::XDocument(const std::wstring& source, const bool space) + { + boost::shared_ptr xsource(new Private::XWStringSource(source)); + Load(xsource, space); + } + + + XDocument::XDocument(const boost::filesystem::path& source, const bool space) + { + boost::filesystem::wpath path(Encoding::utf82unicode(source.string())); + TxtFile text(path); + if(text.isUnicode()) + { + boost::shared_ptr xsource(new Private::XWFileSource(source, Private::XWideSource::estLittleEndian)); + Load(xsource, space); + } + else if((text.isBigEndian()) || (text.isUnicodeWithOutBOM())) + { + boost::shared_ptr xsource(new Private::XWFileSource(source, Private::XWideSource::estBigEndian)); + Load(xsource, space); + } + else + { + boost::shared_ptr xsource(new Private::XFileSource(path)); + Load(xsource, space); + } + //boost::shared_ptr xsource(new Private::XFileSource(source)); + //Load(xsource, space); + } + + + XDocument::XDocument(const boost::filesystem::wpath& source, const bool space) + { + TxtFile text(source); + if(text.isUnicode()) + { + boost::shared_ptr xsource(new Private::XWFileSource(source, Private::XWideSource::estLittleEndian)); + Load(xsource, space); + } + else if((text.isBigEndian()) || (text.isUnicodeWithOutBOM())) + { + boost::shared_ptr xsource(new Private::XWFileSource(source, Private::XWideSource::estBigEndian)); + Load(xsource, space); + } + else + { + boost::shared_ptr xsource(new Private::XFileSource(source)); + Load(xsource, space); + } + //boost::shared_ptr xsource(new Private::XFileSource(source)); + //Load(xsource, space); + } + + + const std::string XDocument::ToString() + { + Root->Namespaces.merge(Root->usedNamespace()); + + std::list strList; + strList.push_back(Declaration->ToString()); + Root->SaveToStringList(strList); + + std::string result = ""; + size_t length = 0; + for(std::list::const_iterator iter = strList.begin(); iter != strList.end(); iter++) + { + length += iter->length(); + } + result.reserve(length); + for(std::list::const_iterator iter = strList.begin(); iter != strList.end(); iter++) + { + result += *iter; + } + + return result; + //return Declaration->ToString() + Root->ToString(); + } + + + const std::wstring XDocument::ToWString() + { + Root->Namespaces.merge(Root->usedNamespace()); + + std::list strList; + strList.push_back(Declaration->ToWString()); + Root->SaveToWStringList(strList); + + std::wstring result = L""; + size_t length = 0; + for(std::list::const_iterator iter = strList.begin(); iter != strList.end(); iter++) + { + length += iter->length(); + } + result.reserve(length); + for(std::list::const_iterator iter = strList.begin(); iter != strList.end(); iter++) + { + result += *iter; + } + + return result; + //return Declaration->ToWString() + Root->ToWString(); + } + + + void XDocument::Load(boost::shared_ptr source, const bool space) + { + source->findAndSkip('<'); + if (source->get() == '?') + { + Declaration->fromSource(source); + source->findAndSkip('<'); + } + source->skipSpace(); + Root->fromSource(source, Root->Namespaces, space); + } + + + void XDocument::Load(boost::shared_ptr source, const bool space) + { + source->findAndSkip(L'<'); + if (source->get() == L'?') + { + Declaration->fromSource(source); + source->findAndSkip(L'<'); + } + source->skipSpace(); + Root->fromSource(source, Root->Namespaces, space); + } + + + void XDocument::Save(const boost::filesystem::path& path) + { + std::ofstream file(path.string().c_str()); + if (!file.bad()) + { + file << ToString(); + file.close(); + } + } + + + void XDocument::Save(const boost::filesystem::wpath& path) + { + std::ofstream file(path.string().c_str()); + if (!file.bad()) + { + file << ToString(); + file.close(); + } + } + + + void XDocument::Save(std::string& source) + { + source.clear(); + source = ToString(); + } + + + void XDocument::Save(std::wstring& source) + { + source.clear(); + source = ToWString(); + } + +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/XDocument.h b/ASCOfficeOdtFile/Source/XML/XDocument.h new file mode 100644 index 0000000000..327054cfb7 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/XDocument.h @@ -0,0 +1,52 @@ +#pragma once +#ifndef XML_XDOCUMENT_INCLUDE_H_ +#define XML_XDOCUMNET_INCLUDE_H_ + +#include "property.h" +#include "XElement.h" +#include "Private/XDeclaration.h" +#include +//#include "Private/XSource.h" +#include "Private/XSingleSource.h" +#include "Private/XWideSource.h" +#include + + +namespace XML +{ + class XDocument + { + public: + explicit XDocument(const XElement& element); + explicit XDocument(const char* source, const bool space = false); + explicit XDocument(const wchar_t* source, const bool space = false); + explicit XDocument(const std::string& source, const bool space = false); + explicit XDocument(const std::wstring& source, const bool space = false); + explicit XDocument(const boost::filesystem::path& source, const bool space = false); + explicit XDocument(const boost::filesystem::wpath& source, const bool space = false); + + public: + XDocument const* const operator->() const {return this;} + XDocument* operator->() {return this;} + + public: + const std::string ToString(); + const std::wstring ToWString(); + + public: + void Save(const boost::filesystem::path& path); + void Save(const boost::filesystem::wpath& path); + void Save(std::string& source); + void Save(std::wstring& source); + + public: + property Declaration; + XElement Root; + + private: + void Load(boost::shared_ptr source, const bool space = false); + void Load(boost::shared_ptr source, const bool space = false); + }; +} // namespace XML + +#endif // XML_XDOCUMENT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/XElement.cpp b/ASCOfficeOdtFile/Source/XML/XElement.cpp new file mode 100644 index 0000000000..30fe4c97d1 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/XElement.cpp @@ -0,0 +1,274 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "XElement.h" +#include "XName.h" +#include "Private/XList.h" +#include "XDocument.h" +#include "Private/XNamespaceContainer.h" +#include "Private/XAttributeContainer.h" +#include "Private/XNodeContainer.h" +#include "Private/XElementContainer.h" +#include "XNode.h" +#include "XText.h" +#include +#include "Private/NullXElement.h" +#include "Private/NullElement.h" +#include "XAttribute.h" +#include "Exception/not_implement.h" + + +namespace XML +{ + + XElement::XElement() + : base(new Private::Element()), + XName(m_ptr->XName), + Namespaces(m_ptr->Namespaces), + Attributes(m_ptr->Attributes), + Nodes(m_ptr->Nodes), + Elements(m_ptr->Elements), + Texts(m_ptr->Texts), + Space(m_ptr->Space) + { + } + + + XElement::XElement(const Private::NullXElement&) + : base(new Private::NullElement()), + XName(m_ptr->XName), + Namespaces(m_ptr->Namespaces), + Attributes(m_ptr->Attributes), + Nodes(m_ptr->Nodes), + Elements(m_ptr->Elements), + Texts(m_ptr->Texts), + Space(m_ptr->Space) + { + } + + + XElement::XElement(const XML::XName& xname) + : base(new Private::Element(xname)), + XName(m_ptr->XName), + Namespaces(m_ptr->Namespaces), + Attributes(m_ptr->Attributes), + Nodes(m_ptr->Nodes), + Elements(m_ptr->Elements), + Texts(m_ptr->Texts), + Space(m_ptr->Space) + { + } + + + XElement::XElement(const XML::XName& xname, const Private::XList& list) + : base(new Private::Element(xname, list)), + XName(m_ptr->XName), + Namespaces(m_ptr->Namespaces), + Attributes(m_ptr->Attributes), + Nodes(m_ptr->Nodes), + Elements(m_ptr->Elements), + Texts(m_ptr->Texts), + Space(m_ptr->Space) + { + } + + + XElement::XElement(boost::shared_ptr source, const Private::XNamespaceContainer& ns, const Private::XSpace& space) + : base(new Private::Element(source, ns, space)), + XName(m_ptr->XName), + Namespaces(m_ptr->Namespaces), + Attributes(m_ptr->Attributes), + Nodes(m_ptr->Nodes), + Elements(m_ptr->Elements), + Texts(m_ptr->Texts), + Space(m_ptr->Space) + { + } + + + XElement::XElement(boost::shared_ptr source, const Private::XNamespaceContainer& ns, const Private::XSpace& space) + : base(new Private::Element(source, ns, space)), + XName(m_ptr->XName), + Namespaces(m_ptr->Namespaces), + Attributes(m_ptr->Attributes), + Nodes(m_ptr->Nodes), + Elements(m_ptr->Elements), + Texts(m_ptr->Texts), + Space(m_ptr->Space) + { + } + + + const XElement& XElement::operator =(const XElement& rhs) + { + m_ptr = rhs.m_ptr; + XName = rhs.XName; + Namespaces = rhs.Namespaces; + Attributes = rhs.Attributes; + Nodes = rhs.Nodes; + Elements = rhs.Elements; + Texts = rhs.Texts; + Space = rhs.Space; + return *this; + } + + + XElement::XElement(const XNode& xnode) + : base(boost::dynamic_pointer_cast(xnode.get_ptr())), + XName(m_ptr->XName), + Namespaces(m_ptr->Namespaces), + Attributes(m_ptr->Attributes), + Nodes(m_ptr->Nodes), + Elements(m_ptr->Elements), + Texts(m_ptr->Texts), + Space(m_ptr->Space) + { + } + + + void XElement::Save(const boost::filesystem::path& path) const + { + XDocument(*this).Save(path); + } + + + void XElement::Save(const boost::filesystem::wpath& path) const + { + XDocument(*this).Save(path); + } + + + void XElement::fromSource(boost::shared_ptr source, const Private::XNamespaceContainer& ns, const Private::XSpace& space) + { + m_ptr->fromSource(source, ns, space); + } + + + void XElement::fromSource(boost::shared_ptr source, const Private::XNamespaceContainer& ns, const Private::XSpace& space) + { + m_ptr->fromSource(source, ns, space); + } + + + const std::string XElement::ToString() const + { + return m_ptr->ToString(); + } + + + const std::wstring XElement::ToWString() const + { + return m_ptr->ToWString(); + } + + + void XElement::SaveToStringList(std::list& strList)const + { + m_ptr->SaveToStringList(strList); + } + + + void XElement::SaveToWStringList(std::list& strList)const + { + m_ptr->SaveToWStringList(strList); + } + + + const bool XElement::exist() const + { + return m_ptr->exist(); + } + + + const Private::XNamespaceContainer XElement::usedNamespace() const + { + return m_ptr->usedNamespace(); + } + + + const Private::XString XElement::text() const + { + return m_ptr->text(); + } + + + void XElement::Add(const XAttribute& attribute) + { + m_ptr->Add(attribute); + } + + + void XElement::Add(const XNamespace& ns) + { + m_ptr->Add(ns); + } + + + void XElement::Add(const XNode& node) + { + m_ptr->Add(node); + } + + + void XElement::Add(const XElement& element) + { + m_ptr->Add(element); + } + + + void XElement::Add(const XText& text) + { + m_ptr->Add(text); + } + + + void XElement::Add(const XContainer& container) + { + m_ptr->Add(container); + } + + + void XElement::Add(const Private::XList& list) + { + m_ptr->Add(list); + } + + + XAttribute& XElement::attribute(const XML::XName& xname) + { + return m_ptr->attribute(xname); + } + + + const XAttribute& XElement::attribute(const XML::XName& xname) const + { + return m_ptr->attribute(xname); + } + + + XElement XElement::element(const XML::XName& xname) + { + return m_ptr->element(xname); + } + + + const XElement XElement::element(const XML::XName& xname) const + { + return m_ptr->element(xname); + } + + + XElement XElement::element(const XML::XName& xname, const std::string& value) + { + return m_ptr->element(xname, value); + } + + + const XElement XElement::element(const XML::XName& xname, const std::string& value) const + { + return m_ptr->element(xname, value); + } + +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/XElement.h b/ASCOfficeOdtFile/Source/XML/XElement.h new file mode 100644 index 0000000000..f1d171c5c9 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/XElement.h @@ -0,0 +1,150 @@ +#pragma once +#ifndef XML_XELEMENT_INCLUDE_H_ +#define XML_XELEMENT_INCLUDE_H_ + +#include +#include "Private/XPointer.h" +#include "Private/Element.h" +#include "property.h" +#include "setter.h" +#include "getter.h" +#include +#include "Private/XString.h" +#include "Private/XNamespaceContainer.h" +#include "Private/XSpace.h" +#include +//#include "Private/XSource.h" +#include "Private/XSingleSource.h" +#include "Private/XWideSource.h" +#include + + +namespace XML +{ + class XAttribute; + class XNamespace; + class XName; + class XNode; + class XText; + class XContainer; + class XObject; + + namespace Private + { + class XList; + class XAttributeContainer; + class XNodeContainer; + class XElementContainer; + class XTextContainer; + class NullXElement; + } + + class XElement : public Private::XPointer + { + public: + XElement(); + XElement(const Private::NullXElement&); + explicit XElement(const XName& xname); + XElement(const XName& xname, const Private::XList& list); + XElement(boost::shared_ptr source, const Private::XNamespaceContainer& ns, const Private::XSpace& space); + XElement(boost::shared_ptr source, const Private::XNamespaceContainer& ns, const Private::XSpace& space); + const XElement& operator= (const XElement& rhs); + XElement(const XNode& xnode); + + public: + template + operator const nullable() const + { + if (exist()) + return T(*this); + return nullable(); + } + + template + operator const property() const + { + return T(*this); + } + + template + operator const nullable_property() const + { + if (exist()) + return T(*this); + return nullable_property(); + } + + public: + XElement const* const operator->() const {return this;} + XElement* operator->() {return this;} + + public: + void Save(const boost::filesystem::path& path) const; + void Save(const boost::filesystem::wpath& path) const; + + public: + void fromSource(boost::shared_ptr source, const Private::XNamespaceContainer& ns, const Private::XSpace& space); + void fromSource(boost::shared_ptr source, const Private::XNamespaceContainer& ns, const Private::XSpace& space); + const std::string ToString() const; + const std::wstring ToWString() const; + virtual void SaveToStringList(std::list& strList)const; + virtual void SaveToWStringList(std::list& strList)const; + + public: + const bool exist() const; + const Private::XString text() const; + const Private::XNamespaceContainer usedNamespace() const; + + public: + void Add(const XAttribute& attribute); + void Add(const XNamespace& ns); + void Add(const XNode& node); + void Add(const XElement& element); + void Add(const XText& text); + void Add(const XContainer& container); + void Add(const Private::XList& list); + + public: + XAttribute& attribute(const XName& xname); + const XAttribute& attribute(const XName& xname) const; + + XElement element(const XName& xname); + const XElement element(const XName& xname) const; + + XElement element(const XName& xname, const std::string& value); + const XElement element(const XName& xname, const std::string& value) const; + + public: + property& XName; + Private::XNamespaceContainer& Namespaces; + Private::XAttributeContainer& Attributes; + Private::XNodeContainer& Nodes; + Private::XElementContainer& Elements; + Private::XTextContainer& Texts; + property& Space; + }; +} // namespace XML + + +template +const nullable& nullable_setter(nullable& lhs, const XML::XElement& rhs) +{ + return ::nullable_setter(lhs, nullable(rhs)); +} + + +template +const property& property_setter(property& lhs, const XML::XElement& rhs) +{ + return ::property_setter(lhs, T(rhs)); +} + + +template +const nullable_property& nullable_property_setter(nullable_property& lhs, const XML::XElement& rhs) +{ + return ::nullable_property_setter(lhs, nullable_property(rhs)); +} + + +#endif // XML_XELEMENT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/XML.h b/ASCOfficeOdtFile/Source/XML/XML.h new file mode 100644 index 0000000000..24e9092c80 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/XML.h @@ -0,0 +1,35 @@ +#pragma once +#ifndef XML_INCLUDE_H_ +#define XML_INCLUDE_H_ + +#include "XAttribute.h" +#include "XNamespace.h" +#include "XText.h" +#include "XContainer.h" +#include "XElement.h" +#include "XNode.h" +#include "XDocument.h" +#include "Private/XList.h" +#include "Extension/Write.h" +#include "Extension/WriteIf.h" +#include "Extension/Fill.h" +#include "Extension/FillFromAttribute.h" +#include "XObject.h" +#include "XComment.h" + + +namespace XML +{ + typedef XML::Private::XAttributeContainer::iterator attribute_iterator; + typedef XML::Private::XAttributeContainer::const_iterator const_attribute_iterator; + typedef XML::Private::XNamespaceContainer::iterator namespace_iterator; + typedef XML::Private::XNamespaceContainer::const_iterator const_namespace_iterator; + typedef XML::Private::XNodeContainer::iterator node_iterator; + typedef XML::Private::XNodeContainer::const_iterator const_node_iterator; + typedef XML::Private::XElementContainer::iterator element_iterator; + typedef XML::Private::XElementContainer::const_iterator const_element_iterator; + typedef XML::Private::XTextContainer::iterator text_iterator; + typedef XML::Private::XTextContainer::const_iterator const_text_iterator; +} // namespace XML + +#endif // XML_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/XName.cpp b/ASCOfficeOdtFile/Source/XML/XName.cpp new file mode 100644 index 0000000000..7ef4b9fc81 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/XName.cpp @@ -0,0 +1,112 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "XName.h" +#include +#include "Encoding.h" +#include "ToString.h" + + +namespace XML +{ + + XName::XName() + { + } + + + XName::XName(const char* name) + : Name(name) + { + } + + + XName::XName(const std::string& name) + : Name(name) + { + } + + + XName::XName(const XNamespace& ns, const std::string& name) + : Ns(ns), + Name(name) + { + } + + + const bool XName::Equal(const XName& rhs) const + { + if (rhs.Ns.is_init() && Ns.is_init()) + return ((/*ToUpper(*/rhs.Ns->GetPrefix()/*.ToString()* /)*/ == /*ToUpper(*/Ns->GetPrefix()/*.ToString()* /)*/) && + (/*ToUpper(*/rhs.Name.ToString()/*)*/ == /*ToUpper(*/Name.ToString()/*)*/)); + if (!rhs.Ns.is_init() && !Ns.is_init()) + return /*ToUpper(*/rhs.Name.ToString()/*)*/ == /*ToUpper(*/Name.ToString()/*)*/; + return false; + } + + + const bool XName::operator ==(const XName& rhs) const + { + if (!rhs.Ns.is_init() || !Ns.is_init()) + return /*ToUpper(*/Name.ToString()/*)*/ == /*ToUpper(*/rhs.Name.ToString()/*)*/; + return ((/*ToUpper(*/Ns->GetPrefix()/*.ToString()* /)*/ == /*ToUpper(*/rhs.Ns->GetPrefix()/*.ToString()* /)*/) && + (/*ToUpper(*/Name.ToString()/*)*/ == /*ToUpper(*/rhs.Name.ToString()/*)*/)); + } + + + const std::string XName::ToString() const + { + if (!Ns.is_init()) + return Name; + return Ns->GetPrefix()/*.ToString()*/ + ":" + Name.ToString(); + } + + + const std::wstring XName::ToWString() const + { + if (!Ns.is_init()) + return Encoding::utf82unicode(Name.ToString()); + return Encoding::utf82unicode(Ns->GetPrefix()/*.ToString()*/) + L":" + Encoding::utf82unicode(Name.ToString()); + } + + + void XName::SaveToStringList(std::list& strList)const + { + if (!Ns.is_init()) + { + strList.push_back(*Name); + return; + } + strList.push_back(Ns->GetPrefix()/*.ToString()*/);// + ":" + *Name); + strList.push_back(":"); + strList.push_back(*Name); + } + + + void XName::SaveToWStringList(std::list& strList)const + { + if (!Ns.is_init()) + { + strList.push_back(Encoding::utf82unicode(*Name)); + return; + } + strList.push_back(Encoding::utf82unicode(Ns->GetPrefix())/*.ToString()*/);// + ":" + *Name); + strList.push_back(L":"); + strList.push_back(Encoding::utf82unicode(*Name)); + } + + + const XName operator +(const XNamespace& ns, const std::string& name) + { + return XName(ns, name); + } + + + const XName operator +(const XNamespace& ns, const char* name) + { + return XName(ns, name); + } + +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/XName.h b/ASCOfficeOdtFile/Source/XML/XName.h new file mode 100644 index 0000000000..bbf3968ca0 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/XName.h @@ -0,0 +1,45 @@ +#pragma once +#ifndef XML_XNAME_INCLUDE_H_ +#define XML_XNAME_INCLUDE_H_ + +#include +#include +#include +#include "property.h" +#include "nullable_property.h" +#include "XNamespace.h" + + +namespace XML +{ + class XName : private boost::equality_comparable + { + public: + XName(); + XName(const char* name); + XName(const std::string& name); + XName(const XNamespace& ns, const std::string& name); + + public: + const bool Equal(const XName& rhs) const; + const bool operator ==(const XName& rhs) const; + + XName const* const operator->() const {return this;} + XName* operator->() {return this;} + + public: + const std::string ToString() const; + const std::wstring ToWString() const; + virtual void SaveToStringList(std::list& strList)const; + virtual void SaveToWStringList(std::list& strList)const; + + public: + nullable_property Ns; + property Name; + }; + + const XName operator +(const XNamespace& ns, const std::string& name); + const XName operator +(const XNamespace& ns, const char* name); +} // namespace XML + +#endif // XML_XNAME_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/XNamespace.cpp b/ASCOfficeOdtFile/Source/XML/XNamespace.cpp new file mode 100644 index 0000000000..a78385b7dd --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/XNamespace.cpp @@ -0,0 +1,86 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "XNamespace.h" +#include "Private/NullNamespace.h" + + +namespace XML +{ + + XNamespace::XNamespace() + : base(new Private::NullNamespace())//, + //Prefix(m_ptr->Prefix), + //Name(m_ptr->Name) + //Prefix(m_ptr->GetPrefix()), + //Name(m_ptr->GetName()) + { + } + + + XNamespace::XNamespace(const std::string& prefix, const std::string& name) + : base(new Private::Namespace(prefix, name))//, + //Prefix(new std::string(prefix)), + //Name(new std::string(name)) + //Prefix(m_ptr->Prefix), + //Name(m_ptr->Name) + //Prefix(m_ptr->GetPrefix()), + //Name(m_ptr->GetName()) + { + } + + + XNamespace::XNamespace(const XNamespace& ns) + : base(ns.m_ptr)//, + //Prefix(ns.Prefix), + //Name(ns.Name) + { + } + + + const XNamespace& XNamespace::operator =(const XNamespace& rhs) + { + if (this != &rhs) + { + m_ptr = rhs.m_ptr; + //Prefix = rhs.Prefix; + //Name = rhs.Name; + //Prefix = m_ptr->GetPrefix(); + //Name = m_ptr->GetName(); + } + return *this; + } + + + const bool XNamespace::operator==(const XNamespace& rhs) const + { + return ((*m_ptr) == (*rhs.m_ptr)); + } + + + const bool XNamespace::operator<(const XNamespace& rhs) const + { + return ((*m_ptr) < (*rhs.m_ptr)); + } + + + const bool XNamespace::exist() const + { + return m_ptr->exist(); + } + + + const std::string XNamespace::GetPrefix()const + { + return m_ptr->GetPrefix(); + } + + + const std::string XNamespace::GetName()const + { + return m_ptr->GetName(); + } + +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/XNamespace.h b/ASCOfficeOdtFile/Source/XML/XNamespace.h new file mode 100644 index 0000000000..629abd3e03 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/XNamespace.h @@ -0,0 +1,41 @@ +#pragma once +#ifndef XML_XNAMESPACE_INCLUDE_H_ +#define XML_XNAMESPACE_INCLUDE_H_ + +#include "Private/XPointer.h" +#include "Private/Namespace.h" + + +namespace XML +{ + class XNamespace : public Private::XPointer + { + public: + XNamespace(const std::string& prefix, const std::string& name); + XNamespace(const XNamespace& ns); + + public: + const XNamespace& operator= (const XNamespace& rhs); + const bool operator==(const XNamespace& rhs) const; + const bool operator<(const XNamespace& rhs) const; + + + public: + virtual const bool exist() const; + + //public: + // property& Prefix; + // property& Name; + //private: + // boost::shared_ptr Prefix; + // boost::shared_ptr Name; + public: + const std::string GetPrefix()const; + const std::string GetName()const; + + protected: + XNamespace(); + }; +} // namespace XML + +#endif // XML_XNAMESPACE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/XNode.cpp b/ASCOfficeOdtFile/Source/XML/XNode.cpp new file mode 100644 index 0000000000..39f7767552 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/XNode.cpp @@ -0,0 +1,86 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "XNode.h" +#include "XText.h" +#include "XComment.h" +#include "XElement.h" +#include "XContainer.h" + + +namespace XML +{ + + XNode::XNode() + { + } + + + XNode::XNode(const XText& text) + : base(text) + { + } + + + XNode::XNode(const XElement& element) + : base(element) + { + } + + + XNode::XNode(const XComment& comment) + : base(comment) + { + } + + + XNode::XNode(const XContainer& container) + : base(container) + { + } + + + const bool XNode::isElement() const + { + return m_ptr->isElement(); + } + + + const bool XNode::isText() const + { + return m_ptr->isText(); + } + + + const bool XNode::isComment() const + { + return m_ptr->isComment(); + } + + + const std::string XNode::ToString() const + { + return m_ptr->ToString(); + } + + + const std::wstring XNode::ToWString() const + { + return m_ptr->ToWString(); + } + + + void XNode::SaveToStringList(std::list& strList)const + { + m_ptr->SaveToStringList(strList); + } + + + void XNode::SaveToWStringList(std::list& strList)const + { + m_ptr->SaveToWStringList(strList); + } + +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/XNode.h b/ASCOfficeOdtFile/Source/XML/XNode.h new file mode 100644 index 0000000000..378ce30452 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/XNode.h @@ -0,0 +1,40 @@ +#pragma once +#ifndef XML_XNODE_INCLUDE_H_ +#define XML_XNODE_INCLUDE_H_ + +#include "Private/XPointer.h" +#include "Private/Node.h" +#include +#include + + +namespace XML +{ + class XText; + class XElement; + class XComment; + class XContainer; + + class XNode : public Private::XPointer + { + public: + XNode(); + XNode(const XText& text); + XNode(const XElement& element); + XNode(const XComment& comment); + XNode(const XContainer& container); + + public: + const bool isElement() const; + const bool isText() const; + const bool isComment() const; + + public: + const std::string ToString() const; + const std::wstring ToWString() const; + virtual void SaveToStringList(std::list& strList)const; + virtual void SaveToWStringList(std::list& strList)const; + }; +} // namespace XML + +#endif // XML_XNODE_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/XObject.cpp b/ASCOfficeOdtFile/Source/XML/XObject.cpp new file mode 100644 index 0000000000..ef9568b618 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/XObject.cpp @@ -0,0 +1,21 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "XObject.h" + + +namespace XML +{ + + XObject::XObject() + { + } + + + XObject::~XObject() + { + } + +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/XObject.h b/ASCOfficeOdtFile/Source/XML/XObject.h new file mode 100644 index 0000000000..b81f4520ab --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/XObject.h @@ -0,0 +1,25 @@ +#pragma once +#ifndef XML_XOBJECT_INCLUDE_H_ +#define XML_XOBJECT_INCLUDE_H_ + +#include "XNode.h" + + +namespace XML +{ + class XObject + { + public: + XObject(); + virtual ~XObject(); + + public: + virtual void fromXML(const XNode& node) = 0; + virtual const XNode toXML() const = 0; + + public: + void this_is_not_xobject_class() const {}; + }; +} // namespace XML + +#endif // XML_XOBJECT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/XText.cpp b/ASCOfficeOdtFile/Source/XML/XText.cpp new file mode 100644 index 0000000000..df31a048a2 --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/XText.cpp @@ -0,0 +1,21 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "XText.h" +#include "XNode.h" +#include + + +namespace XML +{ + + XText::XText(const XNode& xnode) + : base(boost::dynamic_pointer_cast(xnode.get_ptr())), + Value(m_ptr->Value) + { + } + + +} // namespace XML \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/XText.h b/ASCOfficeOdtFile/Source/XML/XText.h new file mode 100644 index 0000000000..789cf71c5a --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/XText.h @@ -0,0 +1,51 @@ +#pragma once +#ifndef XML_XTEXT_INCLUDE_H_ +#define XML_XTEXT_INCLUDE_H_ + +#include "Private/XPointer.h" +#include "Private/Text.h" +#include "Private/NullText.h" +#include "Private/Null.h" +#include "nullable.h" +#include "property.h" +#include "nullable_property.h" +#include "Private/XString.h" +#include "Private/Lexigraph.h" + + +namespace XML +{ + class XNode; + + class XText : public Private::XPointer + { + public: + template + explicit XText(const T& value) + : base(new Private::Text(ToString(value))), + Value(m_ptr->Value) + { + } + + template + explicit XText(const nullable& value) + : base(value.is_init() ? new Private::Text(ToString(value)) : 0), + Value(value.is_init() ? m_ptr->Value : Private::Null::Text().Value) + { + } + + template + explicit XText(const nullable_property& value) + : base(value.is_init() ? new Private::Text(ToString(value)) : 0), + Value(value.is_init() ? m_ptr->Value : Private::Null::Text().Value) + { + } + + XText(const XNode& xnode); + + public: + Private::XString& Value; + }; +} // namespace XML + +#endif // XML_XTEXT_INCLUDE_H_ \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/precompiled_xml.cpp b/ASCOfficeOdtFile/Source/XML/precompiled_xml.cpp new file mode 100644 index 0000000000..9b85b3943c --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/precompiled_xml.cpp @@ -0,0 +1,6 @@ + +// auto inserted precompiled begin +#include "precompiled_xml.h" +// auto inserted precompiled end + +#include "precompiled_xml.h" \ No newline at end of file diff --git a/ASCOfficeOdtFile/Source/XML/precompiled_xml.h b/ASCOfficeOdtFile/Source/XML/precompiled_xml.h new file mode 100644 index 0000000000..d9cc9803df --- /dev/null +++ b/ASCOfficeOdtFile/Source/XML/precompiled_xml.h @@ -0,0 +1,23 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "setter.h" +#include "getter.h" +#include "nullable.h" +#include "property.h" +#include "nullable_property.h" +#include "parse.h" diff --git a/ASCOfficeOdtFile/Source/boost_filesystem/operations.cpp b/ASCOfficeOdtFile/Source/boost_filesystem/operations.cpp new file mode 100644 index 0000000000..a03da904d4 --- /dev/null +++ b/ASCOfficeOdtFile/Source/boost_filesystem/operations.cpp @@ -0,0 +1,1365 @@ +// operations.cpp ----------------------------------------------------------// + +// Copyright 2002-2005 Beman Dawes +// Copyright 2001 Dietmar Kuehl +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy +// at http://www.boost.org/LICENSE_1_0.txt) + +// See library home page at http://www.boost.org/libs/filesystem + +//----------------------------------------------------------------------------// + +// define BOOST_FILESYSTEM_SOURCE so that knows +// the library is being built (possibly exporting rather than importing code) +#define BOOST_FILESYSTEM_SOURCE + +#define _POSIX_PTHREAD_SEMANTICS // Sun readdir_r() needs this + +// enable the XPG-compliant version of readdir_r() on AIX +#if defined(_AIX) +# define _LINUX_SOURCE_COMPAT +#endif + +#if !(defined(__HP_aCC) && defined(_ILP32) && \ + !defined(_STATVFS_ACPP_PROBLEMS_FIXED)) +#define _FILE_OFFSET_BITS 64 // at worst, these defines may have no effect, +#endif +#define __USE_FILE_OFFSET64 // but that is harmless on Windows and on POSIX + // 64-bit systems or on 32-bit systems which don't have files larger + // than can be represented by a traditional POSIX/UNIX off_t type. + // OTOH, defining them should kick in 64-bit off_t's (and thus + // st_size) on 32-bit systems that provide the Large File + // Support (LFS) interface, such as Linux, Solaris, and IRIX. + // The defines are given before any headers are included to + // ensure that they are available to all included headers. + // That is required at least on Solaris, and possibly on other + // systems as well. + +// for some compilers (CodeWarrior, for example), windows.h +// is getting included by some other boost header, so do this early: +#if !defined(_WIN32_WINNT) +#define _WIN32_WINNT 0x0500 // Default to Windows 2K or later +#endif + + +#include +#include +#include +#include + +namespace fs = boost::filesystem; +using boost::system::error_code; +using boost::system::system_category; + +# if defined(BOOST_WINDOWS_API) +# include +# if defined(__BORLANDC__) || defined(__MWERKS__) +# if defined(__BORLANDC__) + using std::time_t; +# endif +# include +# else +# include +# endif + +# else // BOOST_POSIX_API +# include +# if !defined(__APPLE__) && !defined(__OpenBSD__) +# include +# define BOOST_STATVFS statvfs +# define BOOST_STATVFS_F_FRSIZE vfs.f_frsize +# else +#ifdef __OpenBSD__ +# include +#endif +# include +# define BOOST_STATVFS statfs +# define BOOST_STATVFS_F_FRSIZE static_cast( vfs.f_bsize ) +# endif +# include +# include +# include +# include +# include "limits.h" +# endif + +// BOOST_FILESYSTEM_STATUS_CACHE enables file_status cache in +// dir_itr_increment. The config tests are placed here because some of the +// macros being tested come from dirent.h. +// +// TODO: find out what macros indicate dirent::d_type present in more libraries +# if defined(BOOST_WINDOWS_API) \ + || defined(_DIRENT_HAVE_D_TYPE) // defined by GNU C library if d_type present +# define BOOST_FILESYSTEM_STATUS_CACHE +# endif + +#include // even on Windows some functions use stat() +#include +#include +#include // for remove, rename +#include +#include +// #include // for debugging only; comment out when not in use + +#ifdef BOOST_NO_STDC_NAMESPACE +namespace std { using ::strcmp; using ::remove; using ::rename; } +#endif + +// helpers -----------------------------------------------------------------// + +namespace +{ + const error_code ok; + + bool is_empty_directory( const std::string & dir_path ) + { + static const fs::directory_iterator end_itr; + return fs::directory_iterator(fs::path(dir_path)) == end_itr; + } + +#ifdef BOOST_WINDOWS_API + +// For Windows, the xxxA form of various function names is used to avoid +// inadvertently getting wide forms of the functions. (The undecorated +// forms are actually macros, so can misfire if the user has various +// other macros defined. There was a bug report of this happening.) + + inline DWORD get_file_attributes( const char * ph ) + { return ::GetFileAttributesA( ph ); } + +# ifndef BOOST_FILESYSTEM_NARROW_ONLY + + inline DWORD get_file_attributes( const wchar_t * ph ) + { return ::GetFileAttributesW( ph ); } + + bool is_empty_directory( const std::wstring & dir_path ) + { + static const fs::wdirectory_iterator wend_itr; + return fs::wdirectory_iterator(fs::wpath(dir_path)) == wend_itr; + } + + inline BOOL get_file_attributes_ex( const wchar_t * ph, + WIN32_FILE_ATTRIBUTE_DATA & fad ) + { return ::GetFileAttributesExW( ph, ::GetFileExInfoStandard, &fad ); } + + HANDLE create_file( const wchar_t * ph, DWORD dwDesiredAccess, + DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, + DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, + HANDLE hTemplateFile ) + { + return ::CreateFileW( ph, dwDesiredAccess, dwShareMode, + lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, + hTemplateFile ); + } + + inline DWORD get_current_directory( DWORD sz, wchar_t * buf ) + { return ::GetCurrentDirectoryW( sz, buf ); } + + inline bool set_current_directory( const wchar_t * buf ) + { return ::SetCurrentDirectoryW( buf ) != 0 ; } + + inline bool get_free_disk_space( const std::wstring & ph, + PULARGE_INTEGER avail, PULARGE_INTEGER total, PULARGE_INTEGER free ) + { return ::GetDiskFreeSpaceExW( ph.c_str(), avail, total, free ) != 0; } + + inline std::size_t get_full_path_name( + const std::wstring & ph, std::size_t len, wchar_t * buf, wchar_t ** p ) + { + return static_cast( + ::GetFullPathNameW( ph.c_str(), + static_cast(len), buf, p )); + } + + inline bool remove_directory( const std::wstring & ph ) + { return ::RemoveDirectoryW( ph.c_str() ) != 0; } + + inline bool delete_file( const std::wstring & ph ) + { return ::DeleteFileW( ph.c_str() ) != 0; } + + inline bool create_directory( const std::wstring & dir ) + { return ::CreateDirectoryW( dir.c_str(), 0 ) != 0; } + +#if _WIN32_WINNT >= 0x500 + inline bool create_hard_link( const std::wstring & to_ph, + const std::wstring & from_ph ) + { return ::CreateHardLinkW( from_ph.c_str(), to_ph.c_str(), 0 ) != 0; } +#endif + +# endif // ifndef BOOST_FILESYSTEM_NARROW_ONLY + + template< class String > + fs::file_status status_template( const String & ph, error_code & ec ) + { + DWORD attr( get_file_attributes( ph.c_str() ) ); + if ( attr == 0xFFFFFFFF ) + { + ec = error_code( ::GetLastError(), system_category ); + if ((ec.value() == ERROR_FILE_NOT_FOUND) + || (ec.value() == ERROR_PATH_NOT_FOUND) + || (ec.value() == ERROR_INVALID_NAME) // "tools/jam/src/:sys:stat.h", "//foo" + || (ec.value() == ERROR_INVALID_PARAMETER) // ":sys:stat.h" + || (ec.value() == ERROR_BAD_PATHNAME) // "//nosuch" on Win64 + || (ec.value() == ERROR_BAD_NETPATH)) // "//nosuch" on Win32 + { + ec = ok; // these are not considered errors; + // the status is considered not found + return fs::file_status( fs::file_not_found ); + } + else if ((ec.value() == ERROR_SHARING_VIOLATION)) + { + ec = ok; // these are not considered errors; + // the file exists but the type is not known + return fs::file_status( fs::type_unknown ); + } + return fs::file_status( fs::status_unknown ); + } + ec = ok;; + return (attr & FILE_ATTRIBUTE_DIRECTORY) + ? fs::file_status( fs::directory_file ) + : fs::file_status( fs::regular_file ); + } + + BOOL get_file_attributes_ex( const char * ph, + WIN32_FILE_ATTRIBUTE_DATA & fad ) + { return ::GetFileAttributesExA( ph, ::GetFileExInfoStandard, &fad ); } + + template< class String > + boost::filesystem::detail::query_pair + is_empty_template( const String & ph ) + { + WIN32_FILE_ATTRIBUTE_DATA fad; + if ( get_file_attributes_ex( ph.c_str(), fad ) == 0 ) + return std::make_pair( error_code( ::GetLastError(), system_category ), false ); + return std::make_pair( ok, + ( fad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) + ? is_empty_directory( ph ) + :( !fad.nFileSizeHigh && !fad.nFileSizeLow ) ); + } + + HANDLE create_file( const char * ph, DWORD dwDesiredAccess, + DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, + DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, + HANDLE hTemplateFile ) + { + return ::CreateFileA( ph, dwDesiredAccess, dwShareMode, + lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, + hTemplateFile ); + } + + // Thanks to Jeremy Maitin-Shepard for much help and for permission to + // base the equivalent() implementation on portions of his + // file-equivalence-win32.cpp experimental code. + struct handle_wrapper + { + HANDLE handle; + handle_wrapper( HANDLE h ) + : handle(h) {} + ~handle_wrapper() + { + if ( handle != INVALID_HANDLE_VALUE ) + ::CloseHandle(handle); + } + }; + + template< class String > + boost::filesystem::detail::query_pair + equivalent_template( const String & ph1, const String & ph2 ) + { + // Note well: Physical location on external media is part of the + // equivalence criteria. If there are no open handles, physical location + // can change due to defragmentation or other relocations. Thus handles + // must be held open until location information for both paths has + // been retrieved. + handle_wrapper p1( + create_file( + ph1.c_str(), + 0, + FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, + 0, + OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, + 0 ) ); + int error1(0); // save error code in case we have to throw + if ( p1.handle == INVALID_HANDLE_VALUE ) + error1 = ::GetLastError(); + handle_wrapper p2( + create_file( + ph2.c_str(), + 0, + FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, + 0, + OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, + 0 ) ); + if ( p1.handle == INVALID_HANDLE_VALUE + || p2.handle == INVALID_HANDLE_VALUE ) + { + if ( p1.handle != INVALID_HANDLE_VALUE + || p2.handle != INVALID_HANDLE_VALUE ) + { return std::make_pair( ok, false ); } + assert( p1.handle == INVALID_HANDLE_VALUE + && p2.handle == INVALID_HANDLE_VALUE ); + { return std::make_pair( error_code( error1, system_category), false ); } + } + // at this point, both handles are known to be valid + BY_HANDLE_FILE_INFORMATION info1, info2; + if ( !::GetFileInformationByHandle( p1.handle, &info1 ) ) + { return std::make_pair( error_code( ::GetLastError(), system_category ), false ); } + if ( !::GetFileInformationByHandle( p2.handle, &info2 ) ) + { return std::make_pair( error_code( ::GetLastError(), system_category ), false ); } + // In theory, volume serial numbers are sufficient to distinguish between + // devices, but in practice VSN's are sometimes duplicated, so last write + // time and file size are also checked. + return std::make_pair( ok, + info1.dwVolumeSerialNumber == info2.dwVolumeSerialNumber + && info1.nFileIndexHigh == info2.nFileIndexHigh + && info1.nFileIndexLow == info2.nFileIndexLow + && info1.nFileSizeHigh == info2.nFileSizeHigh + && info1.nFileSizeLow == info2.nFileSizeLow + && info1.ftLastWriteTime.dwLowDateTime + == info2.ftLastWriteTime.dwLowDateTime + && info1.ftLastWriteTime.dwHighDateTime + == info2.ftLastWriteTime.dwHighDateTime ); + } + + template< class String > + boost::filesystem::detail::uintmax_pair + file_size_template( const String & ph ) + { + WIN32_FILE_ATTRIBUTE_DATA fad; + // by now, intmax_t is 64-bits on all Windows compilers + if ( get_file_attributes_ex( ph.c_str(), fad ) == 0 ) + return std::make_pair( error_code( ::GetLastError(), system_category ), 0 ); + if ( (fad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) !=0 ) + return std::make_pair( error_code( ERROR_FILE_NOT_FOUND, system_category), 0 ); + return std::make_pair( ok, + (static_cast(fad.nFileSizeHigh) + << (sizeof(fad.nFileSizeLow)*8)) + + fad.nFileSizeLow ); + } + + inline bool get_free_disk_space( const std::string & ph, + PULARGE_INTEGER avail, PULARGE_INTEGER total, PULARGE_INTEGER free ) + { return ::GetDiskFreeSpaceExA( ph.c_str(), avail, total, free ) != 0; } + + template< class String > + boost::filesystem::detail::space_pair + space_template( String & ph ) + { + ULARGE_INTEGER avail, total, free; + boost::filesystem::detail::space_pair result; + if ( get_free_disk_space( ph, &avail, &total, &free ) ) + { + result.first = ok; + result.second.capacity + = (static_cast(total.HighPart) << 32) + + total.LowPart; + result.second.free + = (static_cast(free.HighPart) << 32) + + free.LowPart; + result.second.available + = (static_cast(avail.HighPart) << 32) + + avail.LowPart; + } + else + { + result.first = error_code( ::GetLastError(), system_category ); + result.second.capacity = result.second.free + = result.second.available = 0; + } + return result; + } + + inline DWORD get_current_directory( DWORD sz, char * buf ) + { return ::GetCurrentDirectoryA( sz, buf ); } + + template< class String > + error_code + get_current_path_template( String & ph ) + { + DWORD sz; + if ( (sz = get_current_directory( 0, + static_cast(0) )) == 0 ) + { sz = 1; } + typedef typename String::value_type value_type; + boost::scoped_array buf( new value_type[sz] ); + if ( get_current_directory( sz, buf.get() ) == 0 ) + return error_code( ::GetLastError(), system_category ); + ph = buf.get(); + return ok; + } + + inline bool set_current_directory( const char * buf ) + { return ::SetCurrentDirectoryA( buf ) != 0; } + + template< class String > + error_code + set_current_path_template( const String & ph ) + { + return error_code( set_current_directory( ph.c_str() ) + ? 0 : ::GetLastError(), system_category ); + } + + inline std::size_t get_full_path_name( + const std::string & ph, std::size_t len, char * buf, char ** p ) + { + return static_cast( + ::GetFullPathNameA( ph.c_str(), + static_cast(len), buf, p )); + } + + const std::size_t buf_size( 128 ); + + template + error_code + get_full_path_name_template( const String & ph, String & target ) + { + typename String::value_type buf[buf_size]; + typename String::value_type * pfn; + std::size_t len = get_full_path_name( ph, + buf_size , buf, &pfn ); + if ( len == 0 ) return error_code( ::GetLastError(), system_category ); + if ( len > buf_size ) + { + typedef typename String::value_type value_type; + boost::scoped_array big_buf( new value_type[len] ); + if ( (len=get_full_path_name( ph, len , big_buf.get(), &pfn )) + == 0 ) return error_code( ::GetLastError(), system_category ); + big_buf[len] = '\0'; + target = big_buf.get(); + return ok; + } + buf[len] = '\0'; + target = buf; + return ok; + } + + template + error_code + get_file_write_time( const String & ph, FILETIME & last_write_time ) + { + handle_wrapper hw( + create_file( ph.c_str(), 0, + FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, 0, + OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0 ) ); + if ( hw.handle == INVALID_HANDLE_VALUE ) + return error_code( ::GetLastError(), system_category ); + return error_code( ::GetFileTime( hw.handle, 0, 0, &last_write_time ) != 0 + ? 0 : ::GetLastError(), system_category ); + } + + template + error_code + set_file_write_time( const String & ph, const FILETIME & last_write_time ) + { + handle_wrapper hw( + create_file( ph.c_str(), FILE_WRITE_ATTRIBUTES, + FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, 0, + OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0 ) ); + if ( hw.handle == INVALID_HANDLE_VALUE ) + return error_code( ::GetLastError(), system_category ); + return error_code( ::SetFileTime( hw.handle, 0, 0, &last_write_time ) != 0 + ? 0 : ::GetLastError(), system_category ); + } + + // these constants come from inspecting some Microsoft sample code + std::time_t to_time_t( const FILETIME & ft ) + { + __int64 t = (static_cast<__int64>( ft.dwHighDateTime ) << 32) + + ft.dwLowDateTime; +# if !defined( BOOST_MSVC ) || BOOST_MSVC > 1300 // > VC++ 7.0 + t -= 116444736000000000LL; +# else + t -= 116444736000000000; +# endif + t /= 10000000; + return static_cast( t ); + } + + void to_FILETIME( std::time_t t, FILETIME & ft ) + { + __int64 temp = t; + temp *= 10000000; +# if !defined( BOOST_MSVC ) || BOOST_MSVC > 1300 // > VC++ 7.0 + temp += 116444736000000000LL; +# else + temp += 116444736000000000; +# endif + ft.dwLowDateTime = static_cast( temp ); + ft.dwHighDateTime = static_cast( temp >> 32 ); + } + + template + boost::filesystem::detail::time_pair + last_write_time_template( const String & ph ) + { + FILETIME lwt; + error_code ec( + get_file_write_time( ph, lwt ) ); + return std::make_pair( ec, to_time_t( lwt ) ); + } + + template + error_code + last_write_time_template( const String & ph, const std::time_t new_time ) + { + FILETIME lwt; + to_FILETIME( new_time, lwt ); + return set_file_write_time( ph, lwt ); + } + + bool remove_directory( const std::string & ph ) + { return ::RemoveDirectoryA( ph.c_str() ) != 0; } + + bool delete_file( const std::string & ph ) + { return ::DeleteFileA( ph.c_str() ) != 0; } + + template + error_code + remove_template( const String & ph ) + { + // TODO: test this code in the presence of Vista symlinks, + // including dangling, self-referal, and cyclic symlinks + error_code ec; + fs::file_status sf( fs::detail::status_api( ph, ec ) ); + if ( ec ) + return ec; + if ( sf.type() == fs::file_not_found ) + return ok; + if ( fs::is_directory( sf ) ) + { + if ( !remove_directory( ph ) ) + return error_code(::GetLastError(), system_category); + } + else + { + if ( !delete_file( ph ) ) return error_code(::GetLastError(), system_category); + } + return ok; + } + + inline bool create_directory( const std::string & dir ) + { return ::CreateDirectoryA( dir.c_str(), 0 ) != 0; } + + template + boost::filesystem::detail::query_pair + create_directory_template( const String & dir_ph ) + { + error_code error, dummy; + if ( create_directory( dir_ph ) ) return std::make_pair( error, true ); + error = error_code( ::GetLastError(), system_category ); + // an error here may simply mean the postcondition is already met + if ( error.value() == ERROR_ALREADY_EXISTS + && fs::is_directory( fs::detail::status_api( dir_ph, dummy ) ) ) + return std::make_pair( ok, false ); + return std::make_pair( error, false ); + } + +#if _WIN32_WINNT >= 0x500 + inline bool create_hard_link( const std::string & to_ph, + const std::string & from_ph ) + { return ::CreateHardLinkA( from_ph.c_str(), to_ph.c_str(), 0 ) != 0; } +#endif + +#if _WIN32_WINNT >= 0x500 + template + error_code + create_hard_link_template( const String & to_ph, + const String & from_ph ) + { + return error_code( create_hard_link( to_ph.c_str(), from_ph.c_str() ) + ? 0 : ::GetLastError(), system_category ); + } +#endif + +#else // BOOST_POSIX_API + + int posix_remove( const char * p ) + { +# if defined(__QNXNTO__) || (defined(__MSL__) && (defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__))) + // Some Metrowerks C library versions fail on directories because of a + // known Metrowerks coding error in ::remove. Workaround is to call + // rmdir() or unlink() as indicated. + // Same bug also reported for QNX, with the same fix. + int err = ::unlink( p ); + if ( err == 0 || errno != EPERM ) + return err; + return ::rmdir( p ); +# else + return std::remove( p ); +# endif + } + +#endif +} // unnamed namespace + +namespace boost +{ + namespace filesystem + { + namespace detail + { + BOOST_FILESYSTEM_DECL system::error_code throws; + +// free functions ----------------------------------------------------------// + + BOOST_FILESYSTEM_DECL error_code not_found_error() + { +# ifdef BOOST_WINDOWS_API + return error_code(ERROR_PATH_NOT_FOUND, system_category); +# else + return error_code(ENOENT, system_category); +# endif + } + + BOOST_FILESYSTEM_DECL bool possible_large_file_size_support() + { +# ifdef BOOST_POSIX_API + struct stat lcl_stat; + return sizeof( lcl_stat.st_size ) > 4; +# else + return true; +# endif + } + +# ifdef BOOST_WINDOWS_API + + BOOST_FILESYSTEM_DECL fs::file_status + status_api( const std::string & ph, error_code & ec ) + { return status_template( ph, ec ); } + +# ifndef BOOST_FILESYSTEM_NARROW_ONLY + + BOOST_FILESYSTEM_DECL fs::file_status + status_api( const std::wstring & ph, error_code & ec ) + { return status_template( ph, ec ); } + + BOOST_FILESYSTEM_DECL bool symbolic_link_exists_api( const std::wstring & ) + { return false; } + + BOOST_FILESYSTEM_DECL + fs::detail::query_pair is_empty_api( const std::wstring & ph ) + { return is_empty_template( ph ); } + + BOOST_FILESYSTEM_DECL + fs::detail::query_pair + equivalent_api( const std::wstring & ph1, const std::wstring & ph2 ) + { return equivalent_template( ph1, ph2 ); } + + BOOST_FILESYSTEM_DECL + fs::detail::uintmax_pair file_size_api( const std::wstring & ph ) + { return file_size_template( ph ); } + + BOOST_FILESYSTEM_DECL + fs::detail::space_pair space_api( const std::wstring & ph ) + { return space_template( ph ); } + + BOOST_FILESYSTEM_DECL + error_code + get_current_path_api( std::wstring & ph ) + { return get_current_path_template( ph ); } + + BOOST_FILESYSTEM_DECL + error_code + set_current_path_api( const std::wstring & ph ) + { return set_current_path_template( ph ); } + + BOOST_FILESYSTEM_DECL error_code + get_full_path_name_api( const std::wstring & ph, std::wstring & target ) + { return get_full_path_name_template( ph, target ); } + + BOOST_FILESYSTEM_DECL time_pair + last_write_time_api( const std::wstring & ph ) + { return last_write_time_template( ph ); } + + BOOST_FILESYSTEM_DECL error_code + last_write_time_api( const std::wstring & ph, std::time_t new_value ) + { return last_write_time_template( ph, new_value ); } + + BOOST_FILESYSTEM_DECL fs::detail::query_pair + create_directory_api( const std::wstring & ph ) + { return create_directory_template( ph ); } + +#if _WIN32_WINNT >= 0x500 + BOOST_FILESYSTEM_DECL error_code + create_hard_link_api( const std::wstring & to_ph, + const std::wstring & from_ph ) + { return create_hard_link_template( to_ph, from_ph ); } +#endif + + BOOST_FILESYSTEM_DECL error_code + create_symlink_api( const std::wstring & /*to_ph*/, + const std::wstring & /*from_ph*/ ) + { return error_code( ERROR_NOT_SUPPORTED, system_category ); } + + BOOST_FILESYSTEM_DECL error_code + remove_api( const std::wstring & ph ) { return remove_template( ph ); } + + BOOST_FILESYSTEM_DECL error_code + rename_api( const std::wstring & from, const std::wstring & to ) + { + return error_code( ::MoveFileW( from.c_str(), to.c_str() ) + ? 0 : ::GetLastError(), system_category ); + } + + BOOST_FILESYSTEM_DECL error_code + copy_file_api( const std::wstring & from, const std::wstring & to ) + { + return error_code( ::CopyFileW( from.c_str(), to.c_str(), /*fail_if_exists=*/true ) + ? 0 : ::GetLastError(), system_category ); + } + + BOOST_FILESYSTEM_DECL bool create_file_api( const std::wstring & ph, + std::ios_base::openmode mode ) // true if succeeds + { + DWORD access( + ((mode & std::ios_base::in) == 0 ? 0 : GENERIC_READ) + | ((mode & std::ios_base::out) == 0 ? 0 : GENERIC_WRITE) ); + + DWORD disposition(0); // see 27.8.1.3 Table 92 + if ( (mode&~std::ios_base::binary) + == (std::ios_base::out|std::ios_base::app) ) + disposition = OPEN_ALWAYS; + else if ( (mode&~(std::ios_base::binary|std::ios_base::out)) + == std::ios_base::in ) disposition = OPEN_EXISTING; + else if ( ((mode&~(std::ios_base::binary|std::ios_base::trunc)) + == std::ios_base::out ) + || ((mode&~std::ios_base::binary) + == (std::ios_base::in|std::ios_base::out|std::ios_base::trunc)) ) + disposition = CREATE_ALWAYS; + else assert( 0 && "invalid mode argument" ); + + HANDLE handle ( ::CreateFileW( ph.c_str(), access, + FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, 0, + disposition, (mode &std::ios_base::out) != 0 + ? FILE_ATTRIBUTE_ARCHIVE : FILE_ATTRIBUTE_NORMAL, 0 ) ); + if ( handle == INVALID_HANDLE_VALUE ) return false; + ::CloseHandle( handle ); + return true; + } + + BOOST_FILESYSTEM_DECL std::string narrow_path_api( + const std::wstring & ph ) // return is empty if fails + { + std::string narrow_short_form; + std::wstring short_form; + for ( DWORD buf_sz( static_cast( ph.size()+1 ));; ) + { + boost::scoped_array buf( new wchar_t[buf_sz] ); + DWORD sz( ::GetShortPathNameW( ph.c_str(), buf.get(), buf_sz ) ); + if ( sz == 0 ) return narrow_short_form; + if ( sz <= buf_sz ) + { + short_form += buf.get(); + break; + } + buf_sz = sz + 1; + } + // contributed by Takeshi Mouri: + int narrow_sz( ::WideCharToMultiByte( CP_ACP, 0, + short_form.c_str(), static_cast(short_form.size()), 0, 0, 0, 0 ) ); + boost::scoped_array narrow_buf( new char[narrow_sz] ); + ::WideCharToMultiByte( CP_ACP, 0, + short_form.c_str(), static_cast(short_form.size()), + narrow_buf.get(), narrow_sz, 0, 0 ); + narrow_short_form.assign(narrow_buf.get(), narrow_sz); + + return narrow_short_form; + } + + BOOST_FILESYSTEM_DECL error_code + dir_itr_first( void *& handle, const std::wstring & dir, + std::wstring & target, file_status & sf, file_status & symlink_sf ) + { + // use a form of search Sebastian Martel reports will work with Win98 + std::wstring dirpath( dir ); + dirpath += (dirpath.empty() + || dirpath[dirpath.size()-1] != L'\\') ? L"\\*" : L"*"; + + WIN32_FIND_DATAW data; + if ( (handle = ::FindFirstFileW( dirpath.c_str(), &data )) + == INVALID_HANDLE_VALUE ) + { + handle = 0; + return error_code( ::GetLastError() == ERROR_FILE_NOT_FOUND + ? 0 : ::GetLastError(), system_category ); + } + target = data.cFileName; + if ( data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) + { sf.type( directory_file ); symlink_sf.type( directory_file ); } + else { sf.type( regular_file ); symlink_sf.type( regular_file ); } + return ok; + } + + BOOST_FILESYSTEM_DECL error_code + dir_itr_increment( void *& handle, std::wstring & target, + file_status & sf, file_status & symlink_sf ) + { + WIN32_FIND_DATAW data; + if ( ::FindNextFileW( handle, &data ) == 0 ) // fails + { + int error = ::GetLastError(); + dir_itr_close( handle ); + return error_code( error == ERROR_NO_MORE_FILES ? 0 : error, system_category ); + } + target = data.cFileName; + if ( data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) + { sf.type( directory_file ); symlink_sf.type( directory_file ); } + else { sf.type( regular_file ); symlink_sf.type( regular_file ); } + return ok; + } + +# endif // ifndef BOOST_FILESYSTEM_NARROW_ONLY + + // suggested by Walter Landry + BOOST_FILESYSTEM_DECL bool symbolic_link_exists_api( const std::string & ) + { return false; } + + BOOST_FILESYSTEM_DECL + fs::detail::query_pair is_empty_api( const std::string & ph ) + { return is_empty_template( ph ); } + + BOOST_FILESYSTEM_DECL + fs::detail::query_pair + equivalent_api( const std::string & ph1, const std::string & ph2 ) + { return equivalent_template( ph1, ph2 ); } + + BOOST_FILESYSTEM_DECL + fs::detail::uintmax_pair file_size_api( const std::string & ph ) + { return file_size_template( ph ); } + + BOOST_FILESYSTEM_DECL + fs::detail::space_pair space_api( const std::string & ph ) + { return space_template( ph ); } + + BOOST_FILESYSTEM_DECL + error_code + get_current_path_api( std::string & ph ) + { return get_current_path_template( ph ); } + + BOOST_FILESYSTEM_DECL + error_code + set_current_path_api( const std::string & ph ) + { return set_current_path_template( ph ); } + + BOOST_FILESYSTEM_DECL error_code + get_full_path_name_api( const std::string & ph, std::string & target ) + { return get_full_path_name_template( ph, target ); } + + BOOST_FILESYSTEM_DECL time_pair + last_write_time_api( const std::string & ph ) + { return last_write_time_template( ph ); } + + BOOST_FILESYSTEM_DECL error_code + last_write_time_api( const std::string & ph, std::time_t new_value ) + { return last_write_time_template( ph, new_value ); } + + BOOST_FILESYSTEM_DECL fs::detail::query_pair + create_directory_api( const std::string & ph ) + { return create_directory_template( ph ); } + +#if _WIN32_WINNT >= 0x500 + BOOST_FILESYSTEM_DECL error_code + create_hard_link_api( const std::string & to_ph, + const std::string & from_ph ) + { + return create_hard_link_template( to_ph, from_ph ); + } +#endif + + BOOST_FILESYSTEM_DECL error_code + create_symlink_api( const std::string & /*to_ph*/, + const std::string & /*from_ph*/ ) + { return error_code( ERROR_NOT_SUPPORTED, system_category ); } + + BOOST_FILESYSTEM_DECL error_code + remove_api( const std::string & ph ) { return remove_template( ph ); } + + BOOST_FILESYSTEM_DECL error_code + rename_api( const std::string & from, const std::string & to ) + { + return error_code( ::MoveFileA( from.c_str(), to.c_str() ) + ? 0 : ::GetLastError(), system_category ); + } + + BOOST_FILESYSTEM_DECL error_code + copy_file_api( const std::string & from, const std::string & to ) + { + return error_code( ::CopyFileA( from.c_str(), to.c_str(), /*fail_if_exists=*/true ) + ? 0 : ::GetLastError(), system_category ); + } + + BOOST_FILESYSTEM_DECL error_code + dir_itr_first( void *& handle, const std::string & dir, + std::string & target, file_status & sf, file_status & symlink_sf ) + // Note: an empty root directory has no "." or ".." entries, so this + // causes a ERROR_FILE_NOT_FOUND error which we do not considered an + // error. It is treated as eof instead. + { + // use a form of search Sebastian Martel reports will work with Win98 + std::string dirpath( dir ); + dirpath += (dirpath.empty() + || (dirpath[dirpath.size()-1] != '\\' + && dirpath[dirpath.size()-1] != ':')) ? "\\*" : "*"; + + WIN32_FIND_DATAA data; + if ( (handle = ::FindFirstFileA( dirpath.c_str(), &data )) + == INVALID_HANDLE_VALUE ) + { + handle = 0; + return error_code( ::GetLastError() == ERROR_FILE_NOT_FOUND + ? 0 : ::GetLastError(), system_category ); + } + target = data.cFileName; + if ( data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) + { sf.type( directory_file ); symlink_sf.type( directory_file ); } + else { sf.type( regular_file ); symlink_sf.type( regular_file ); } + return ok; + } + + BOOST_FILESYSTEM_DECL error_code + dir_itr_close( void *& handle ) + { + if ( handle != 0 ) + { + bool ok = ::FindClose( handle ) != 0; + handle = 0; + return error_code( ok ? 0 : ::GetLastError(), system_category ); + } + return ok; + } + + BOOST_FILESYSTEM_DECL error_code + dir_itr_increment( void *& handle, std::string & target, + file_status & sf, file_status & symlink_sf ) + { + WIN32_FIND_DATAA data; + if ( ::FindNextFileA( handle, &data ) == 0 ) // fails + { + int error = ::GetLastError(); + dir_itr_close( handle ); + return error_code( error == ERROR_NO_MORE_FILES ? 0 : error, system_category ); + } + target = data.cFileName; + if ( data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) + { sf.type( directory_file ); symlink_sf.type( directory_file ); } + else { sf.type( regular_file ); symlink_sf.type( regular_file ); } + return ok; + } + +# else // BOOST_POSIX_API + + BOOST_FILESYSTEM_DECL fs::file_status + status_api( const std::string & ph, error_code & ec ) + { + struct stat path_stat; + if ( ::stat( ph.c_str(), &path_stat ) != 0 ) + { + if ( errno == ENOENT || errno == ENOTDIR ) + { + ec = ok; + return fs::file_status( fs::file_not_found ); + } + ec = error_code( errno, system_category ); + return fs::file_status( fs::status_unknown ); + } + ec = ok; + if ( S_ISDIR( path_stat.st_mode ) ) + return fs::file_status( fs::directory_file ); + if ( S_ISREG( path_stat.st_mode ) ) + return fs::file_status( fs::regular_file ); + if ( S_ISBLK( path_stat.st_mode ) ) + return fs::file_status( fs::block_file ); + if ( S_ISCHR( path_stat.st_mode ) ) + return fs::file_status( fs::character_file ); + if ( S_ISFIFO( path_stat.st_mode ) ) + return fs::file_status( fs::fifo_file ); + if ( S_ISSOCK( path_stat.st_mode ) ) + return fs::file_status( fs::socket_file ); + return fs::file_status( fs::type_unknown ); + } + + BOOST_FILESYSTEM_DECL fs::file_status + symlink_status_api( const std::string & ph, error_code & ec ) + { + struct stat path_stat; + if ( ::lstat( ph.c_str(), &path_stat ) != 0 ) + { + if ( errno == ENOENT || errno == ENOTDIR ) + { + ec = ok; + return fs::file_status( fs::file_not_found ); + } + ec = error_code( errno, system_category ); + return fs::file_status( fs::status_unknown ); + } + ec = ok; + if ( S_ISREG( path_stat.st_mode ) ) + return fs::file_status( fs::regular_file ); + if ( S_ISDIR( path_stat.st_mode ) ) + return fs::file_status( fs::directory_file ); + if ( S_ISLNK( path_stat.st_mode ) ) + return fs::file_status( fs::symlink_file ); + if ( S_ISBLK( path_stat.st_mode ) ) + return fs::file_status( fs::block_file ); + if ( S_ISCHR( path_stat.st_mode ) ) + return fs::file_status( fs::character_file ); + if ( S_ISFIFO( path_stat.st_mode ) ) + return fs::file_status( fs::fifo_file ); + if ( S_ISSOCK( path_stat.st_mode ) ) + return fs::file_status( fs::socket_file ); + return fs::file_status( fs::type_unknown ); + } + + // suggested by Walter Landry + BOOST_FILESYSTEM_DECL bool + symbolic_link_exists_api( const std::string & ph ) + { + struct stat path_stat; + return ::lstat( ph.c_str(), &path_stat ) == 0 + && S_ISLNK( path_stat.st_mode ); + } + + BOOST_FILESYSTEM_DECL query_pair + is_empty_api( const std::string & ph ) + { + struct stat path_stat; + if ( (::stat( ph.c_str(), &path_stat )) != 0 ) + return std::make_pair( error_code( errno, system_category ), false ); + return std::make_pair( ok, S_ISDIR( path_stat.st_mode ) + ? is_empty_directory( ph ) + : path_stat.st_size == 0 ); + } + + BOOST_FILESYSTEM_DECL query_pair + equivalent_api( const std::string & ph1, const std::string & ph2 ) + { + struct stat s2; + int e2( ::stat( ph2.c_str(), &s2 ) ); + struct stat s1; + int e1( ::stat( ph1.c_str(), &s1 ) ); + if ( e1 != 0 || e2 != 0 ) + return std::make_pair( error_code( e1 != 0 && e2 != 0 ? errno : 0, system_category ), false ); + // at this point, both stats are known to be valid + return std::make_pair( ok, + s1.st_dev == s2.st_dev + && s1.st_ino == s2.st_ino + // According to the POSIX stat specs, "The st_ino and st_dev fields + // taken together uniquely identify the file within the system." + // Just to be sure, size and mod time are also checked. + && s1.st_size == s2.st_size + && s1.st_mtime == s2.st_mtime ); + } + + BOOST_FILESYSTEM_DECL uintmax_pair + file_size_api( const std::string & ph ) + { + struct stat path_stat; + if ( ::stat( ph.c_str(), &path_stat ) != 0 ) + return std::make_pair( error_code( errno, system_category ), 0 ); + if ( !S_ISREG( path_stat.st_mode ) ) + return std::make_pair( error_code( EPERM, system_category ), 0 ); + return std::make_pair( ok, + static_cast(path_stat.st_size) ); + } + + BOOST_FILESYSTEM_DECL space_pair + space_api( const std::string & ph ) + { + struct BOOST_STATVFS vfs; + space_pair result; + if ( ::BOOST_STATVFS( ph.c_str(), &vfs ) != 0 ) + { + result.first = error_code( errno, system_category ); + result.second.capacity = result.second.free + = result.second.available = 0; + } + else + { + result.first = ok; + result.second.capacity + = static_cast(vfs.f_blocks) * BOOST_STATVFS_F_FRSIZE; + result.second.free + = static_cast(vfs.f_bfree) * BOOST_STATVFS_F_FRSIZE; + result.second.available + = static_cast(vfs.f_bavail) * BOOST_STATVFS_F_FRSIZE; + } + return result; + } + + BOOST_FILESYSTEM_DECL time_pair + last_write_time_api( const std::string & ph ) + { + struct stat path_stat; + if ( ::stat( ph.c_str(), &path_stat ) != 0 ) + return std::make_pair( error_code( errno, system_category ), 0 ); + return std::make_pair( ok, path_stat.st_mtime ); + } + + BOOST_FILESYSTEM_DECL error_code + last_write_time_api( const std::string & ph, std::time_t new_value ) + { + struct stat path_stat; + if ( ::stat( ph.c_str(), &path_stat ) != 0 ) + return error_code( errno, system_category ); + ::utimbuf buf; + buf.actime = path_stat.st_atime; // utime() updates access time too:-( + buf.modtime = new_value; + return error_code( ::utime( ph.c_str(), &buf ) != 0 ? errno : 0, system_category ); + } + + BOOST_FILESYSTEM_DECL error_code + get_current_path_api( std::string & ph ) + { + for ( long path_max = 32;; path_max *=2 ) // loop 'til buffer large enough + { + boost::scoped_array + buf( new char[static_cast(path_max)] ); + if ( ::getcwd( buf.get(), static_cast(path_max) ) == 0 ) + { + if ( errno != ERANGE + // bug in some versions of the Metrowerks C lib on the Mac: wrong errno set +# if defined(__MSL__) && (defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)) + && errno != 0 +# endif + ) return error_code( errno, system_category ); + } + else + { + ph = buf.get(); + break; + } + } + return ok; + } + + BOOST_FILESYSTEM_DECL error_code + set_current_path_api( const std::string & ph ) + { + return error_code( ::chdir( ph.c_str() ) + ? errno : 0, system_category ); + } + + BOOST_FILESYSTEM_DECL fs::detail::query_pair + create_directory_api( const std::string & ph ) + { + if ( ::mkdir( ph.c_str(), S_IRWXU|S_IRWXG|S_IRWXO ) == 0 ) + { return std::make_pair( ok, true ); } + int ec=errno; + error_code dummy; + if ( ec != EEXIST + || !fs::is_directory( status_api( ph, dummy ) ) ) + { return std::make_pair( error_code( ec, system_category ), false ); } + return std::make_pair( ok, false ); + } + + BOOST_FILESYSTEM_DECL error_code + create_hard_link_api( const std::string & to_ph, + const std::string & from_ph ) + { + return error_code( ::link( to_ph.c_str(), from_ph.c_str() ) == 0 + ? 0 : errno, system_category ); + } + + BOOST_FILESYSTEM_DECL error_code + create_symlink_api( const std::string & to_ph, + const std::string & from_ph ) + { + return error_code( ::symlink( to_ph.c_str(), from_ph.c_str() ) == 0 + ? 0 : errno, system_category ); + } + + BOOST_FILESYSTEM_DECL error_code + remove_api( const std::string & ph ) + { + if ( posix_remove( ph.c_str() ) == 0 ) + return ok; + int error = errno; + // POSIX says "If the directory is not an empty directory, rmdir() + // shall fail and set errno to EEXIST or ENOTEMPTY." + // Linux uses ENOTEMPTY, Solaris uses EEXIST. + if ( error == EEXIST ) error = ENOTEMPTY; + + error_code ec; + + // ignore errors if post-condition satisfied + return status_api(ph, ec).type() == file_not_found + ? ok : error_code( error, system_category ) ; + } + + BOOST_FILESYSTEM_DECL error_code + rename_api( const std::string & from, const std::string & to ) + { + // POSIX is too permissive so must check + error_code dummy; + if ( fs::exists( status_api( to, dummy ) ) ) + return error_code( EEXIST, system_category ); + return error_code( std::rename( from.c_str(), to.c_str() ) != 0 + ? errno : 0, system_category ); + } + + BOOST_FILESYSTEM_DECL error_code + copy_file_api( const std::string & from_file_ph, + const std::string & to_file_ph ) + { + const std::size_t buf_sz = 32768; + boost::scoped_array buf( new char [buf_sz] ); + int infile=-1, outfile=-1; // -1 means not open + struct stat from_stat; + + if ( ::stat( from_file_ph.c_str(), &from_stat ) != 0 + || (infile = ::open( from_file_ph.c_str(), + O_RDONLY )) < 0 + || (outfile = ::open( to_file_ph.c_str(), + O_WRONLY | O_CREAT | O_EXCL, + from_stat.st_mode )) < 0 ) + { + if ( infile >= 0 ) ::close( infile ); + return error_code( errno, system_category ); + } + + ssize_t sz, sz_read=1, sz_write; + while ( sz_read > 0 + && (sz_read = ::read( infile, buf.get(), buf_sz )) > 0 ) + { + // Allow for partial writes - see Advanced Unix Programming (2nd Ed.), + // Marc Rochkind, Addison-Wesley, 2004, page 94 + sz_write = 0; + do + { + if ( (sz = ::write( outfile, buf.get() + sz_write, + sz_read - sz_write )) < 0 ) + { + sz_read = sz; // cause read loop termination + break; // and error to be thrown after closes + } + sz_write += sz; + } while ( sz_write < sz_read ); + } + + if ( ::close( infile) < 0 ) sz_read = -1; + if ( ::close( outfile) < 0 ) sz_read = -1; + + return error_code( sz_read < 0 ? errno : 0, system_category ); + } + + // this code is based on Stevens and Rago, Advanced Programming in the + // UNIX envirnment, 2nd Ed., ISBN 0-201-43307-9, page 49 + error_code path_max( std::size_t & result ) + { +# ifdef PATH_MAX + static std::size_t max = PATH_MAX; +# else + static std::size_t max = 0; +# endif + if ( max == 0 ) + { + errno = 0; + long tmp = ::pathconf( "/", _PC_NAME_MAX ); + if ( tmp < 0 ) + { + if ( errno == 0 ) // indeterminate + max = 4096; // guess + else return error_code( errno, system_category ); + } + else max = static_cast( tmp + 1 ); // relative root + } + result = max; + return ok; + } + + BOOST_FILESYSTEM_DECL error_code + dir_itr_first( void *& handle, void *& buffer, + const std::string & dir, std::string & target, + file_status &, file_status & ) + { + if ( (handle = ::opendir( dir.c_str() )) == 0 ) + return error_code( errno, system_category ); + target = std::string( "." ); // string was static but caused trouble + // when iteration called from dtor, after + // static had already been destroyed + std::size_t path_size; + error_code ec = path_max( path_size ); + if ( ec ) return ec; + dirent de; + buffer = std::malloc( (sizeof(dirent) - sizeof(de.d_name)) + + path_size + 1 ); // + 1 for "/0" + return ok; + } + + BOOST_FILESYSTEM_DECL error_code + dir_itr_close( void *& handle, void*& buffer ) + { + std::free( buffer ); + buffer = 0; + if ( handle == 0 ) return ok; + DIR * h( static_cast(handle) ); + handle = 0; + return error_code( ::closedir( h ) == 0 ? 0 : errno, system_category ); + } + + // warning: the only dirent member updated is d_name + inline int readdir_r_simulator( DIR * dirp, struct dirent * entry, + struct dirent ** result ) // *result set to 0 on end of directory + { + errno = 0; + + # if !defined(__CYGWIN__) \ + && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \ + && defined(_SC_THREAD_SAFE_FUNCTIONS) \ + && (_POSIX_THREAD_SAFE_FUNCTIONS+0 >= 0) \ + && (!defined(__hpux) || (defined(__hpux) && defined(_REENTRANT))) + if ( ::sysconf( _SC_THREAD_SAFE_FUNCTIONS ) >= 0 ) + { return ::readdir_r( dirp, entry, result ); } + # endif + + struct dirent * p; + *result = 0; + if ( (p = ::readdir( dirp )) == 0 ) + return errno; + std::strcpy( entry->d_name, p->d_name ); + *result = entry; + return 0; + } + + BOOST_FILESYSTEM_DECL error_code + dir_itr_increment( void *& handle, void *& buffer, + std::string & target, file_status & sf, file_status & symlink_sf ) + { + BOOST_ASSERT( buffer != 0 ); + dirent * entry( static_cast(buffer) ); + dirent * result; + int return_code; + if ( (return_code = readdir_r_simulator( static_cast(handle), + entry, &result )) != 0 ) return error_code( errno, system_category ); + if ( result == 0 ) return dir_itr_close( handle, buffer ); + target = entry->d_name; +# ifdef BOOST_FILESYSTEM_STATUS_CACHE + if ( entry->d_type == DT_UNKNOWN ) // filesystem does not supply d_type value + { + sf = symlink_sf = fs::file_status(fs::status_unknown); + } + else // filesystem supplies d_type value + { + if ( entry->d_type == DT_DIR ) + sf = symlink_sf = fs::file_status( fs::directory_file ); + else if ( entry->d_type == DT_REG ) + sf = symlink_sf = fs::file_status( fs::regular_file ); + else if ( entry->d_type == DT_LNK ) + { + sf = fs::file_status( fs::status_unknown ); + symlink_sf = fs::file_status( fs::symlink_file ); + } + else sf = symlink_sf = fs::file_status( fs::status_unknown ); + } +# else + sf = symlink_sf = fs::file_status( fs::status_unknown ); +# endif + return ok; + } + +# endif + } // namespace detail + } // namespace filesystem +} // namespace boost diff --git a/ASCOfficeOdtFile/Source/boost_filesystem/path.cpp b/ASCOfficeOdtFile/Source/boost_filesystem/path.cpp new file mode 100644 index 0000000000..76787a8e41 --- /dev/null +++ b/ASCOfficeOdtFile/Source/boost_filesystem/path.cpp @@ -0,0 +1,159 @@ +// path.cpp ----------------------------------------------------------------// + +// Copyright 2005 Beman Dawes + +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See library home page at http://www.boost.org/libs/filesystem + +//----------------------------------------------------------------------------// + +// define BOOST_FILESYSTEM_SOURCE so that knows +// the library is being built (possibly exporting rather than importing code) +#define BOOST_FILESYSTEM_SOURCE + +#include + +#ifndef BOOST_FILESYSTEM_NARROW_ONLY + +#include +#include + +#include +#include +#include + +#include // for std::mbstate_t + +namespace +{ + // std::locale construction can throw (if LC_MESSAGES is wrong, for example), + // so a static at function scope is used to ensure that exceptions can be + // caught. (A previous version was at namespace scope, so initialization + // occurred before main(), preventing exceptions from being caught.) + std::locale & loc() + { + // ISO C calls this "the locale-specific native environment": + static std::locale lc(""); + return lc; + } + + const std::codecvt *& + converter() + { + static const std::codecvt * + cvtr( + &std::use_facet > + ( loc() ) ); + return cvtr; + } + + bool locked(false); +} // unnamed namespace + +namespace boost +{ + namespace filesystem + { + bool wpath_traits::imbue( const std::locale & new_loc, const std::nothrow_t & ) + { + if ( locked ) return false; + locked = true; + loc() = new_loc; + converter() = &std::use_facet + >( loc() ); + return true; + } + + void wpath_traits::imbue( const std::locale & new_loc ) + { + if ( locked ) boost::throw_exception( + wfilesystem_error( + "boost::filesystem::wpath_traits::imbue() after lockdown", + make_error_code( system::posix::not_supported ) ) ); + imbue( new_loc, std::nothrow ); + } + + //namespace detail + //{ + // BOOST_FILESYSTEM_DECL + // const char * what( const char * sys_err_what, + // const path & path1, const path & path2, std::string & target) + // { + // try + // { + // if ( target.empty() ) + // { + // target = sys_err_what; + // if ( !path1.empty() ) + // { + // target += ": \""; + // target += path1.file_string(); + // target += "\""; + // } + // if ( !path2.empty() ) + // { + // target += ", \""; + // target += path2.file_string(); + // target += "\""; + // } + // } + // return target.c_str(); + // } + // catch (...) + // { + // return sys_err_what; + // } + // } + //} + +# ifdef BOOST_POSIX_API + +// Because this is POSIX only code, we don't have to worry about ABI issues +// described in http://www.boost.org/more/separate_compilation.html + + wpath_traits::external_string_type + wpath_traits::to_external( const wpath & ph, + const internal_string_type & src ) + { + locked = true; + std::size_t work_size( converter()->max_length() * (src.size()+1) ); + boost::scoped_array work( new char[ work_size ] ); + std::mbstate_t state = std::mbstate_t(); // perhaps unneeded, but cuts bug reports + const internal_string_type::value_type * from_next; + external_string_type::value_type * to_next; + if ( converter()->out( + state, src.c_str(), src.c_str()+src.size(), from_next, work.get(), + work.get()+work_size, to_next ) != std::codecvt_base::ok ) + boost::throw_exception( boost::filesystem::wfilesystem_error( + "boost::filesystem::wpath::to_external conversion error", + ph, system::error_code( system::posix::invalid_argument, system::system_category ) ) ); + *to_next = '\0'; + return external_string_type( work.get() ); + } + + wpath_traits::internal_string_type + wpath_traits::to_internal( const external_string_type & src ) + { + locked = true; + std::size_t work_size( src.size()+1 ); + boost::scoped_array work( new wchar_t[ work_size ] ); + std::mbstate_t state = std::mbstate_t(); // perhaps unneeded, but cuts bug reports + const external_string_type::value_type * from_next; + internal_string_type::value_type * to_next; + if ( converter()->in( + state, src.c_str(), src.c_str()+src.size(), from_next, work.get(), + work.get()+work_size, to_next ) != std::codecvt_base::ok ) + boost::throw_exception( boost::filesystem::wfilesystem_error( + "boost::filesystem::wpath::to_internal conversion error", + system::error_code( system::posix::invalid_argument, system::system_category ) ) ); + *to_next = L'\0'; + return internal_string_type( work.get() ); + } +# endif // BOOST_POSIX_API + + } // namespace filesystem +} // namespace boost + +#endif // ifndef BOOST_FILESYSTEM_NARROW_ONLY diff --git a/ASCOfficeOdtFile/Source/boost_filesystem/portability.cpp b/ASCOfficeOdtFile/Source/boost_filesystem/portability.cpp new file mode 100644 index 0000000000..7e5cd1666e --- /dev/null +++ b/ASCOfficeOdtFile/Source/boost_filesystem/portability.cpp @@ -0,0 +1,115 @@ +// portability.cpp ---------------------------------------------------------// + +// Copyright 2002-2005 Beman Dawes +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy +// at http://www.boost.org/LICENSE_1_0.txt) + +// See library home page at http://www.boost.org/libs/filesystem + +//----------------------------------------------------------------------------// + +// define BOOST_FILESYSTEM_SOURCE so that knows +// the library is being built (possibly exporting rather than importing code) +#define BOOST_FILESYSTEM_SOURCE + +#include +#include + +namespace fs = boost::filesystem; + +#include // SGI MIPSpro compilers need this + +# ifdef BOOST_NO_STDC_NAMESPACE + namespace std { using ::strerror; } +# endif + +//----------------------------------------------------------------------------// + +namespace +{ + const char invalid_chars[] = + "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F" + "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F" + "<>:\"/\\|"; + // note that the terminating '\0' is part of the string - thus the size below + // is sizeof(invalid_chars) rather than sizeof(invalid_chars)-1. I + const std::string windows_invalid_chars( invalid_chars, sizeof(invalid_chars) ); + + const std::string valid_posix( + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-" ); + +} // unnamed namespace + +namespace boost +{ + namespace filesystem + { + + // name_check functions ----------------------------------------------// + +# ifdef BOOST_WINDOWS + BOOST_FILESYSTEM_DECL bool native( const std::string & name ) + { + return windows_name( name ); + } +# else + BOOST_FILESYSTEM_DECL bool native( const std::string & name ) + { + return name.size() != 0 + && name[0] != ' ' + && name.find('/') == std::string::npos; + } +# endif + + BOOST_FILESYSTEM_DECL bool portable_posix_name( const std::string & name ) + { + return name.size() != 0 + && name.find_first_not_of( valid_posix ) == std::string::npos; + } + + BOOST_FILESYSTEM_DECL bool windows_name( const std::string & name ) + { + return name.size() != 0 + && name[0] != ' ' + && name.find_first_of( windows_invalid_chars ) == std::string::npos + && *(name.end()-1) != ' ' + && (*(name.end()-1) != '.' + || name.length() == 1 || name == ".."); + } + + BOOST_FILESYSTEM_DECL bool portable_name( const std::string & name ) + { + return + name.size() != 0 + && ( name == "." + || name == ".." + || (windows_name( name ) + && portable_posix_name( name ) + && name[0] != '.' && name[0] != '-')); + } + + BOOST_FILESYSTEM_DECL bool portable_directory_name( const std::string & name ) + { + return + name == "." + || name == ".." + || (portable_name( name ) + && name.find('.') == std::string::npos); + } + + BOOST_FILESYSTEM_DECL bool portable_file_name( const std::string & name ) + { + std::string::size_type pos; + return + portable_name( name ) + && name != "." + && name != ".." + && ( (pos = name.find( '.' )) == std::string::npos + || (name.find( '.', pos+1 ) == std::string::npos + && (pos + 5) > name.length() )) + ; + } + + } // namespace filesystem +} // namespace boost diff --git a/ASCOfficeOdtFile/Source/boost_filesystem/utf8_codecvt_facet.cpp b/ASCOfficeOdtFile/Source/boost_filesystem/utf8_codecvt_facet.cpp new file mode 100644 index 0000000000..5cbcc1be03 --- /dev/null +++ b/ASCOfficeOdtFile/Source/boost_filesystem/utf8_codecvt_facet.cpp @@ -0,0 +1,20 @@ +// Copyright Vladimir Prus 2004. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +#define BOOST_FILESYSTEM_SOURCE +#include + +#define BOOST_UTF8_BEGIN_NAMESPACE \ + namespace boost { namespace filesystem { namespace detail { + +#define BOOST_UTF8_END_NAMESPACE }}} +#define BOOST_UTF8_DECL BOOST_FILESYSTEM_DECL + +#include "libs/detail/utf8_codecvt_facet.cpp" + + +#undef BOOST_UTF8_BEGIN_NAMESPACE +#undef BOOST_UTF8_END_NAMESPACE +#undef BOOST_UTF8_DECL diff --git a/ASCOfficeOdtFile/Source/boost_filesystem/utf8_codecvt_facet.hpp b/ASCOfficeOdtFile/Source/boost_filesystem/utf8_codecvt_facet.hpp new file mode 100644 index 0000000000..291aace713 --- /dev/null +++ b/ASCOfficeOdtFile/Source/boost_filesystem/utf8_codecvt_facet.hpp @@ -0,0 +1,24 @@ +// Copyright (c) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu) +// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu). + +// Distributed under the Boost Software License, Version 1.0. +// (See http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_FILESYSTEM_UTF8_CODECVT_FACET_HPP +#define BOOST_FILESYSTEM_UTF8_CODECVT_FACET_HPP + +#include + +#define BOOST_UTF8_BEGIN_NAMESPACE \ + namespace boost { namespace filesystem { namespace detail { + +#define BOOST_UTF8_END_NAMESPACE }}} +#define BOOST_UTF8_DECL BOOST_FILESYSTEM_DECL + +#include + +#undef BOOST_UTF8_BEGIN_NAMESPACE +#undef BOOST_UTF8_END_NAMESPACE +#undef BOOST_UTF8_DECL + +#endif diff --git a/ASCOfficeOdtFile/Source/boost_system/error_code.cpp b/ASCOfficeOdtFile/Source/boost_system/error_code.cpp new file mode 100644 index 0000000000..a7fe08bdad --- /dev/null +++ b/ASCOfficeOdtFile/Source/boost_system/error_code.cpp @@ -0,0 +1,433 @@ +// error_code support implementation file ----------------------------------// + +// Copyright Beman Dawes 2002, 2006 + +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See library home page at http://www.boost.org/libs/system + +//----------------------------------------------------------------------------// + +#include + +// define BOOST_SYSTEM_SOURCE so that knows +// the library is being built (possibly exporting rather than importing code) +#define BOOST_SYSTEM_SOURCE + +#include +#include +#include +#include +#include +#include + +using namespace boost::system; +using namespace boost::system::posix_error; + +#include // for strerror/strerror_r + +# if defined( BOOST_WINDOWS_API ) +# include +# ifndef ERROR_INCORRECT_SIZE +# define ERROR_INCORRECT_SIZE ERROR_BAD_ARGUMENTS +# endif +# endif + +//----------------------------------------------------------------------------// + +namespace +{ + // standard error categories ---------------------------------------------// + + class generic_error_category : public error_category + { + public: + generic_error_category(){} + const char * name() const; + std::string message( int ev ) const; + }; + + class system_error_category : public error_category + { + public: + system_error_category(){} + const char * name() const; + std::string message( int ev ) const; + error_condition default_error_condition( int ev ) const; + }; + + // generic_error_category implementation ---------------------------------// + + const char * generic_error_category::name() const + { + return "generic"; + } + + std::string generic_error_category::message( int ev ) const + { + static std::string unknown_err( "Unknown error" ); + // strerror_r is preferred because it is always thread safe, + // however, we fallback to strerror in certain cases because: + // -- Windows doesn't provide strerror_r. + // -- HP and Sundo provide strerror_r on newer systems, but there is + // no way to tell if is available at runtime and in any case their + // versions of strerror are thread safe anyhow. + // -- Linux only sometimes provides strerror_r. + // -- Tru64 provides strerror_r only when compiled -pthread. + // -- VMS doesn't provide strerror_r, but on this platform, strerror is + // thread safe. + # if defined(BOOST_WINDOWS_API) || defined(__hpux) || defined(__sun)\ + || (defined(__linux) && (!defined(__USE_XOPEN2K) || defined(BOOST_SYSTEM_USE_STRERROR)))\ + || (defined(__osf__) && !defined(_REENTRANT))\ + || (defined(__vms))\ + || (defined(__QNXNTO__)) + const char * c_str = std::strerror( ev ); + return c_str + ? std::string( c_str ) + : unknown_err; + # else // use strerror_r + char buf[64]; + char * bp = buf; + std::size_t sz = sizeof(buf); + # if defined(__CYGWIN__) || defined(__USE_GNU) + // Oddball version of strerror_r + const char * c_str = strerror_r( ev, bp, sz ); + return c_str + ? std::string( c_str ) + : unknown_err; + # else + // POSIX version of strerror_r + int result; + for (;;) + { + // strerror_r returns 0 on success, otherwise ERANGE if buffer too small, + // invalid_argument if ev not a valid error number + # if defined (__sgi) + const char * c_str = strerror( ev ); + result = 0; + return c_str + ? std::string( c_str ) + : unknown_err; + # else + result = strerror_r( ev, bp, sz ); + # endif + if (result == 0 ) + break; + else + { + # if defined(__linux) + // Linux strerror_r returns -1 on error, with error number in errno + result = errno; + # endif + if ( result != ERANGE ) break; + if ( sz > sizeof(buf) ) std::free( bp ); + sz *= 2; + if ( (bp = static_cast(std::malloc( sz ))) == 0 ) + return std::string( "ENOMEM" ); + } + } + std::string msg; + try + { + msg = ( ( result == invalid_argument ) ? "Unknown error" : bp ); + } + +# ifndef BOOST_NO_EXCEPTIONS + // See ticket #2098 + catch(...) + { + // just eat the exception + } +# endif + + if ( sz > sizeof(buf) ) std::free( bp ); + sz = 0; + return msg; + # endif // else POSIX version of strerror_r + # endif // else use strerror_r + } + // system_error_category implementation --------------------------------// + + const char * system_error_category::name() const + { + return "system"; + } + + error_condition system_error_category::default_error_condition( int ev ) const + { + switch ( ev ) + { + case 0: return make_error_condition( success ); + # if defined(BOOST_POSIX_API) + // POSIX-like O/S -> posix_errno decode table ---------------------------// + case E2BIG: return make_error_condition( argument_list_too_long ); + case EACCES: return make_error_condition( permission_denied ); + case EADDRINUSE: return make_error_condition( address_in_use ); + case EADDRNOTAVAIL: return make_error_condition( address_not_available ); + case EAFNOSUPPORT: return make_error_condition( address_family_not_supported ); + case EAGAIN: return make_error_condition( resource_unavailable_try_again ); +# if EALREADY != EBUSY // EALREADY and EBUSY are the same on QNX Neutrino + case EALREADY: return make_error_condition( connection_already_in_progress ); +# endif + case EBADF: return make_error_condition( bad_file_descriptor ); + case EBADMSG: return make_error_condition( bad_message ); + case EBUSY: return make_error_condition( device_or_resource_busy ); + case ECANCELED: return make_error_condition( operation_canceled ); + case ECHILD: return make_error_condition( no_child_process ); + case ECONNABORTED: return make_error_condition( connection_aborted ); + case ECONNREFUSED: return make_error_condition( connection_refused ); + case ECONNRESET: return make_error_condition( connection_reset ); + case EDEADLK: return make_error_condition( resource_deadlock_would_occur ); + case EDESTADDRREQ: return make_error_condition( destination_address_required ); + case EDOM: return make_error_condition( argument_out_of_domain ); + case EEXIST: return make_error_condition( file_exists ); + case EFAULT: return make_error_condition( bad_address ); + case EFBIG: return make_error_condition( file_too_large ); + case EHOSTUNREACH: return make_error_condition( host_unreachable ); + case EIDRM: return make_error_condition( identifier_removed ); + case EILSEQ: return make_error_condition( illegal_byte_sequence ); + case EINPROGRESS: return make_error_condition( operation_in_progress ); + case EINTR: return make_error_condition( interrupted ); + case EINVAL: return make_error_condition( invalid_argument ); + case EIO: return make_error_condition( io_error ); + case EISCONN: return make_error_condition( already_connected ); + case EISDIR: return make_error_condition( is_a_directory ); + case ELOOP: return make_error_condition( too_many_synbolic_link_levels ); + case EMFILE: return make_error_condition( too_many_files_open ); + case EMLINK: return make_error_condition( too_many_links ); + case EMSGSIZE: return make_error_condition( message_size ); + case ENAMETOOLONG: return make_error_condition( filename_too_long ); + case ENETDOWN: return make_error_condition( network_down ); + case ENETRESET: return make_error_condition( network_reset ); + case ENETUNREACH: return make_error_condition( network_unreachable ); + case ENFILE: return make_error_condition( too_many_files_open_in_system ); + case ENOBUFS: return make_error_condition( no_buffer_space ); + case ENODATA: return make_error_condition( no_message_available ); + case ENODEV: return make_error_condition( no_such_device ); + case ENOENT: return make_error_condition( no_such_file_or_directory ); + case ENOEXEC: return make_error_condition( executable_format_error ); + case ENOLCK: return make_error_condition( no_lock_available ); + case ENOLINK: return make_error_condition( no_link ); + case ENOMEM: return make_error_condition( not_enough_memory ); + case ENOMSG: return make_error_condition( no_message ); + case ENOPROTOOPT: return make_error_condition( no_protocol_option ); + case ENOSPC: return make_error_condition( no_space_on_device ); + case ENOSR: return make_error_condition( no_stream_resources ); + case ENOSTR: return make_error_condition( not_a_stream ); + case ENOSYS: return make_error_condition( function_not_supported ); + case ENOTCONN: return make_error_condition( not_connected ); + case ENOTDIR: return make_error_condition( not_a_directory ); + # if ENOTEMPTY != EEXIST // AIX treats ENOTEMPTY and EEXIST as the same value + case ENOTEMPTY: return make_error_condition( directory_not_empty ); + # endif // ENOTEMPTY != EEXIST + case ENOTRECOVERABLE: return make_error_condition( state_not_recoverable ); + case ENOTSOCK: return make_error_condition( not_a_socket ); + case ENOTSUP: return make_error_condition( not_supported ); + case ENOTTY: return make_error_condition( inappropriate_io_control_operation ); + case ENXIO: return make_error_condition( no_such_device_or_address ); + # if EOPNOTSUPP != ENOTSUP + case EOPNOTSUPP: return make_error_condition( operation_not_supported ); + # endif // EOPNOTSUPP != ENOTSUP + case EOVERFLOW: return make_error_condition( value_too_large ); + case EOWNERDEAD: return make_error_condition( owner_dead ); + case EPERM: return make_error_condition( operation_not_permitted ); + case EPIPE: return make_error_condition( broken_pipe ); + case EPROTO: return make_error_condition( protocol_error ); + case EPROTONOSUPPORT: return make_error_condition( protocol_not_supported ); + case EPROTOTYPE: return make_error_condition( wrong_protocol_type ); + case ERANGE: return make_error_condition( result_out_of_range ); + case EROFS: return make_error_condition( read_only_file_system ); + case ESPIPE: return make_error_condition( invalid_seek ); + case ESRCH: return make_error_condition( no_such_process ); + case ETIME: return make_error_condition( stream_timeout ); + case ETIMEDOUT: return make_error_condition( timed_out ); + case ETXTBSY: return make_error_condition( text_file_busy ); + # if EAGAIN != EWOULDBLOCK + case EWOULDBLOCK: return make_error_condition( operation_would_block ); + # endif // EAGAIN != EWOULDBLOCK + case EXDEV: return make_error_condition( cross_device_link ); + #else + // Windows system -> posix_errno decode table ---------------------------// + // see WinError.h comments for descriptions of errors + case ERROR_ACCESS_DENIED: return make_error_condition( permission_denied ); + case ERROR_ALREADY_EXISTS: return make_error_condition( file_exists ); + case ERROR_BAD_UNIT: return make_error_condition( no_such_device ); + case ERROR_BUFFER_OVERFLOW: return make_error_condition( filename_too_long ); + case ERROR_BUSY: return make_error_condition( device_or_resource_busy ); + case ERROR_BUSY_DRIVE: return make_error_condition( device_or_resource_busy ); + case ERROR_CANNOT_MAKE: return make_error_condition( permission_denied ); + case ERROR_CANTOPEN: return make_error_condition( io_error ); + case ERROR_CANTREAD: return make_error_condition( io_error ); + case ERROR_CANTWRITE: return make_error_condition( io_error ); + case ERROR_CURRENT_DIRECTORY: return make_error_condition( permission_denied ); + case ERROR_DEV_NOT_EXIST: return make_error_condition( no_such_device ); + case ERROR_DEVICE_IN_USE: return make_error_condition( device_or_resource_busy ); + case ERROR_DIR_NOT_EMPTY: return make_error_condition( directory_not_empty ); + case ERROR_DIRECTORY: return make_error_condition( invalid_argument ); // WinError.h: "The directory name is invalid" + case ERROR_DISK_FULL: return make_error_condition( no_space_on_device ); + case ERROR_FILE_EXISTS: return make_error_condition( file_exists ); + case ERROR_FILE_NOT_FOUND: return make_error_condition( no_such_file_or_directory ); + case ERROR_HANDLE_DISK_FULL: return make_error_condition( no_space_on_device ); + case ERROR_INVALID_ACCESS: return make_error_condition( permission_denied ); + case ERROR_INVALID_DRIVE: return make_error_condition( no_such_device ); + case ERROR_INVALID_FUNCTION: return make_error_condition( function_not_supported ); + case ERROR_INVALID_HANDLE: return make_error_condition( invalid_argument ); + case ERROR_INVALID_NAME: return make_error_condition( invalid_argument ); + case ERROR_LOCK_VIOLATION: return make_error_condition( no_lock_available ); + case ERROR_LOCKED: return make_error_condition( no_lock_available ); + case ERROR_NEGATIVE_SEEK: return make_error_condition( invalid_argument ); + case ERROR_NOACCESS: return make_error_condition( permission_denied ); + case ERROR_NOT_ENOUGH_MEMORY: return make_error_condition( not_enough_memory ); + case ERROR_NOT_READY: return make_error_condition( resource_unavailable_try_again ); + case ERROR_NOT_SAME_DEVICE: return make_error_condition( cross_device_link ); + case ERROR_OPEN_FAILED: return make_error_condition( io_error ); + case ERROR_OPEN_FILES: return make_error_condition( device_or_resource_busy ); + case ERROR_OPERATION_ABORTED: return make_error_condition( operation_canceled ); + case ERROR_OUTOFMEMORY: return make_error_condition( not_enough_memory ); + case ERROR_PATH_NOT_FOUND: return make_error_condition( no_such_file_or_directory ); + case ERROR_READ_FAULT: return make_error_condition( io_error ); + case ERROR_RETRY: return make_error_condition( resource_unavailable_try_again ); + case ERROR_SEEK: return make_error_condition( io_error ); + case ERROR_SHARING_VIOLATION: return make_error_condition( permission_denied ); + case ERROR_TOO_MANY_OPEN_FILES: return make_error_condition( too_many_files_open ); + case ERROR_WRITE_FAULT: return make_error_condition( io_error ); + case ERROR_WRITE_PROTECT: return make_error_condition( permission_denied ); + case WSAEACCES: return make_error_condition( permission_denied ); + case WSAEADDRINUSE: return make_error_condition( address_in_use ); + case WSAEADDRNOTAVAIL: return make_error_condition( address_not_available ); + case WSAEAFNOSUPPORT: return make_error_condition( address_family_not_supported ); + case WSAEALREADY: return make_error_condition( connection_already_in_progress ); + case WSAEBADF: return make_error_condition( bad_file_descriptor ); + case WSAECONNABORTED: return make_error_condition( connection_aborted ); + case WSAECONNREFUSED: return make_error_condition( connection_refused ); + case WSAECONNRESET: return make_error_condition( connection_reset ); + case WSAEDESTADDRREQ: return make_error_condition( destination_address_required ); + case WSAEFAULT: return make_error_condition( bad_address ); + case WSAEHOSTUNREACH: return make_error_condition( host_unreachable ); + case WSAEINPROGRESS: return make_error_condition( operation_in_progress ); + case WSAEINTR: return make_error_condition( interrupted ); + case WSAEINVAL: return make_error_condition( invalid_argument ); + case WSAEISCONN: return make_error_condition( already_connected ); + case WSAEMFILE: return make_error_condition( too_many_files_open ); + case WSAEMSGSIZE: return make_error_condition( message_size ); + case WSAENAMETOOLONG: return make_error_condition( filename_too_long ); + case WSAENETDOWN: return make_error_condition( network_down ); + case WSAENETRESET: return make_error_condition( network_reset ); + case WSAENETUNREACH: return make_error_condition( network_unreachable ); + case WSAENOBUFS: return make_error_condition( no_buffer_space ); + case WSAENOPROTOOPT: return make_error_condition( no_protocol_option ); + case WSAENOTCONN: return make_error_condition( not_connected ); + case WSAENOTSOCK: return make_error_condition( not_a_socket ); + case WSAEOPNOTSUPP: return make_error_condition( operation_not_supported ); + case WSAEPROTONOSUPPORT: return make_error_condition( protocol_not_supported ); + case WSAEPROTOTYPE: return make_error_condition( wrong_protocol_type ); + case WSAETIMEDOUT: return make_error_condition( timed_out ); + case WSAEWOULDBLOCK: return make_error_condition( operation_would_block ); + #endif + default: return error_condition( ev, system_category ); + } + } + +# if !defined( BOOST_WINDOWS_API ) + + std::string system_error_category::message( int ev ) const + { + return generic_category.message( ev ); + } +# else +// TODO: + +//Some quick notes on the implementation (sorry for the noise if +//someone has already mentioned them): +// +//- The ::LocalFree() usage isn't exception safe. +// +//See: +// +// +// +//in the implementation of what() for an example. +// +//Cheers, +//Chris + std::string system_error_category::message( int ev ) const + { +# ifndef BOOST_NO_ANSI_APIS + LPVOID lpMsgBuf; + DWORD retval = ::FormatMessageA( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + ev, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language + (LPSTR) &lpMsgBuf, + 0, + NULL + ); + if (retval == 0) + return std::string("Unknown error"); + + std::string str( static_cast(lpMsgBuf) ); + ::LocalFree( lpMsgBuf ); // free the buffer +# else // WinCE workaround + LPVOID lpMsgBuf; + DWORD retval = ::FormatMessageW( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + ev, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language + (LPWSTR) &lpMsgBuf, + 0, + NULL + ); + if (retval == 0) + return std::string("Unknown error"); + + int num_chars = (wcslen( static_cast(lpMsgBuf) ) + 1) * 2; + LPSTR narrow_buffer = (LPSTR)_alloca( num_chars ); + if (::WideCharToMultiByte(CP_ACP, 0, static_cast(lpMsgBuf), -1, narrow_buffer, num_chars, NULL, NULL) == 0) + return std::string("Unknown error"); + + std::string str( narrow_buffer ); + ::LocalFree( lpMsgBuf ); // free the buffer +# endif + while ( str.size() + && (str[str.size()-1] == '\n' || str[str.size()-1] == '\r') ) + str.erase( str.size()-1 ); + if ( str.size() && str[str.size()-1] == '.' ) + { str.erase( str.size()-1 ); } + return str; + } +# endif + +} // unnamed namespace + +namespace boost +{ + namespace system + { + + BOOST_SYSTEM_DECL error_code throws; // "throw on error" special error_code; + // note that it doesn't matter if this + // isn't initialized before use since + // the only use is to take its + // address for comparison purposes + + BOOST_SYSTEM_DECL const error_category & get_system_category() + { + static const system_error_category system_category_const; + return system_category_const; + } + + BOOST_SYSTEM_DECL const error_category & get_generic_category() + { + static const generic_error_category generic_category_const; + return generic_category_const; + } + + } // namespace system +} // namespace boost diff --git a/ASCOfficeOdtFile/version.h b/ASCOfficeOdtFile/version.h index 7ae261fb5e..d468b31235 100644 --- a/ASCOfficeOdtFile/version.h +++ b/ASCOfficeOdtFile/version.h @@ -2,6 +2,6 @@ //1 //0 //1 -//103 -#define INTVER 1,0,1,103 -#define STRVER "1,0,1,103\0" +//104 +#define INTVER 1,0,1,104 +#define STRVER "1,0,1,104\0"