From 10b2b0d3d0303a9a4337bad97d5bd48861b92855 Mon Sep 17 00:00:00 2001 From: Alexander Trofimov Date: Thu, 2 Apr 2026 08:10:57 +0300 Subject: [PATCH 1/5] standardize comments in English --- Apple/IWork.cpp | 4 +- .../html/css/src/CCssCalculator_Private.cpp | 4 +- Common/3dParty/html/css/src/CNode.h | 12 +- .../html/css/src/CUnitMeasureConverter.cpp | 20 +- .../3dParty/html/css/src/StaticFunctions.cpp | 4 +- .../3dParty/html/css/src/StyleProperties.cpp | 8 +- Common/3dParty/html/css/src/StyleProperties.h | 2 +- .../html/css/src/xhtml/CDocumentStyle.cpp | 6 +- Common/3dParty/html/css/tests/test.cpp | 8 +- Common/3dParty/html/htmltoxhtml.cpp | 32 +- Common/3dParty/hunspell/wasm/js/spell.js | 10 +- Common/3dParty/hunspell/wasm/src/engine.h | 2 +- .../3dParty/openssl/common/common_openssl.cpp | 4 +- Common/3dParty/pole/pole.cpp | 2 +- Common/Base64.h | 2 +- Common/FileWriter.h | 6 +- .../src/FileTransporter_curl.cpp | 4 +- .../src/FileTransporter_private.h | 24 +- .../src/FileTransporter_win.cpp | 138 ++--- .../src/socketio/socketio_internal_private.h | 6 +- .../socketio_internal_private_no_tls.h | 6 +- Common/OfficeDefines.h | 26 +- Common/OfficeFileErrorDescription.h | 40 +- Common/OfficeFileFormatChecker2.cpp | 16 +- Common/OfficeFileFormats.h | 2 +- Common/js/README.md | 38 +- DesktopEditor/AllFontsGen/main.cpp | 2 +- .../agg-2.4/include/agg_span_gradient.h | 8 +- .../include/test_grads/custom_gradients.h | 90 +-- DesktopEditor/allthemesgen/main.cpp | 2 +- DesktopEditor/common/ByteBuilder.cpp | 2 +- .../common/CPEncodings/CodePage1361.h | 4 +- .../common/CPEncodings/CodePage932.h | 4 +- .../common/CPEncodings/CodePage936.h | 4 +- .../common/CPEncodings/CodePage949.h | 4 +- .../common/CPEncodings/CodePage950.h | 4 +- DesktopEditor/common/File.cpp | 4 +- DesktopEditor/common/StringBuilder.cpp | 4 +- DesktopEditor/common/StringExt.cpp | 6 +- DesktopEditor/common/StringExt.h | 2 +- DesktopEditor/common/SystemUtils.cpp | 4 +- DesktopEditor/cximage/CxImage/ximabmp.cpp | 4 +- DesktopEditor/cximage/CxImage/ximagif.cpp | 16 +- .../doctrenderer/app_builder/main.cpp | 2 +- .../doctrenderer/app_builder_lib/main.cpp | 2 +- DesktopEditor/doctrenderer/config.h | 2 +- DesktopEditor/doctrenderer/docbuilder_p.cpp | 10 +- DesktopEditor/doctrenderer/docbuilder_p.h | 10 +- DesktopEditor/doctrenderer/drawingfile.h | 8 +- .../doctrenderer/embed/NativeControlEmbed.cpp | 6 +- .../doctrenderer/embed/TextMeasurerEmbed.cpp | 6 +- DesktopEditor/doctrenderer/graphics.cpp | 4 +- DesktopEditor/doctrenderer/graphics.h | 4 +- .../doctrenderer/js_internal/js_base.h | 2 +- .../doctrenderer/js_internal/jsc/jsc_base.mm | 2 +- DesktopEditor/doctrenderer/nativecontrol.h | 14 +- DesktopEditor/fontengine/ApplicationFonts.cpp | 61 +- DesktopEditor/fontengine/ApplicationFonts.h | 8 +- .../fontengine/ApplicationFontsWorker.cpp | 82 +-- .../fontengine/ApplicationFontsWorker.h | 20 +- DesktopEditor/fontengine/FontFile.cpp | 40 +- DesktopEditor/fontengine/FontFile.h | 18 +- DesktopEditor/fontengine/FontManager.cpp | 6 +- DesktopEditor/fontengine/FontManager.h | 2 +- DesktopEditor/fontengine/FontPath.cpp | 8 +- DesktopEditor/fontengine/FontPath.h | 22 +- DesktopEditor/fontengine/GlyphString.cpp | 4 +- DesktopEditor/fontengine/GlyphString.h | 44 +- DesktopEditor/fontengine/MemoryStream.h | 2 +- DesktopEditor/fontengine/TextHyphen.cpp | 4 +- DesktopEditor/fontengine/TextShaper_p.h | 2 +- .../fontengine/fontconverter/Consts.h | 8 +- .../fontconverter/FontConverter.cpp | 38 +- .../fontengine/fontconverter/FontConverter.h | 56 +- .../fontconverter/FontFileTrueType.cpp | 134 ++-- .../fontconverter/FontFileTrueType.h | 44 +- .../fontconverter/FontFileType1.cpp | 68 +-- .../fontengine/fontconverter/FontFileType1.h | 30 +- .../fontconverter/FontFileType1C.cpp | 76 +-- .../fontengine/fontconverter/FontFileType1C.h | 28 +- DesktopEditor/fontengine/fontconverter/Hash.h | 6 +- .../fontengine/fontconverter/MemoryUtils.h | 28 +- .../fontengine/fontconverter/StringExt.cpp | 4 +- .../fontengine/fontconverter/StringExt.h | 68 +-- .../fontengine/fontconverter/Utils.h | 10 +- .../fontengine/fontdictionaryworker.h | 10 +- .../fontengine/js/engine/module_js.js | 20 +- .../freetype_names/FontMaps/FontMaps.cpp | 4 +- DesktopEditor/graphics/BaseThreadMonitor.cpp | 2 +- DesktopEditor/graphics/Brush.h | 8 +- DesktopEditor/graphics/Clip.cpp | 4 +- DesktopEditor/graphics/Graphics.cpp | 16 +- DesktopEditor/graphics/Graphics.h | 20 +- DesktopEditor/graphics/GraphicsPath.cpp | 42 +- DesktopEditor/graphics/GraphicsPath.h | 2 +- DesktopEditor/graphics/GraphicsRenderer.cpp | 22 +- DesktopEditor/graphics/GraphicsRenderer.h | 18 +- DesktopEditor/graphics/IRenderer.h | 32 +- DesktopEditor/graphics/Image.cpp | 2 +- .../graphics/MetafileToGraphicsRenderer.cpp | 2 +- DesktopEditor/graphics/MetafileToRenderer.cpp | 22 +- DesktopEditor/graphics/MetafileToRenderer.h | 2 +- DesktopEditor/graphics/pro/Fonts.h | 18 +- DesktopEditor/graphics/pro/Image.h | 2 +- DesktopEditor/graphics/pro/js/make.py | 2 +- .../graphics/pro/js/wasm/js/raster.js | 10 +- .../pro/js/wasm/src/HTMLRendererText.cpp | 20 +- .../pro/js/wasm/src/HTMLRendererText.h | 12 +- DesktopEditor/graphics/pro/js/wasm/src/Text.h | 32 +- .../graphics/pro/js/wasm/src/drawingfile.cpp | 2 +- .../graphics/pro/js/wasm/src/serialize.h | 12 +- DesktopEditor/graphics/shading_info.h | 76 +-- .../graphics/tests/alphaMask/main.cpp | 20 +- .../graphics/tests/graphicsLayers/main.cpp | 18 +- .../raster/ImageFileFormatChecker.cpp | 2 +- .../raster/JBig2/source/JBig2File.cpp | 10 +- DesktopEditor/raster/Jp2/ArithmeticCoder.h | 12 +- DesktopEditor/raster/Jp2/DWT.h | 40 +- DesktopEditor/raster/Jp2/Image.h | 4 +- DesktopEditor/raster/Jp2/J2k.h | 106 ++-- DesktopEditor/raster/Jp2/J2kFile.cpp | 40 +- DesktopEditor/raster/Jp2/J2kIncludes.h | 8 +- DesktopEditor/raster/Jp2/Jp2.h | 22 +- DesktopEditor/raster/Jp2/Jpt.h | 4 +- DesktopEditor/raster/Jp2/Mj2.h | 40 +- DesktopEditor/raster/Jp2/PacketIterator.h | 10 +- DesktopEditor/raster/Jp2/Reader.cpp | 6 +- DesktopEditor/raster/Jp2/Reader.h | 16 +- DesktopEditor/raster/Jp2/Stream.h | 4 +- DesktopEditor/raster/Jp2/TagTree.h | 2 +- DesktopEditor/raster/Jp2/Tier1.h | 6 +- DesktopEditor/raster/Jp2/Tier2.h | 28 +- DesktopEditor/raster/Jp2/Tile.h | 72 +-- DesktopEditor/raster/Jp2/Types.h | 578 +++++++++--------- DesktopEditor/raster/Jp2/Utils.h | 20 +- DesktopEditor/raster/Metafile/CXmlOutput.cpp | 2 +- DesktopEditor/raster/Metafile/CXmlOutput.h | 4 +- .../raster/Metafile/Common/IOutputDevice.h | 4 +- .../raster/Metafile/Common/MetaFile.h | 2 +- .../raster/Metafile/Common/MetaFileRenderer.h | 48 +- .../raster/Metafile/Common/MetaFileTypes.cpp | 4 +- .../raster/Metafile/Common/MetaFileUtils.cpp | 70 +-- .../raster/Metafile/Common/MetaFileUtils.h | 14 +- .../EmfInterpretator/CEmfInterpretator.cpp | 2 +- .../Emf/EmfInterpretator/CEmfInterpretator.h | 4 +- .../EmfInterpretator/CEmfInterpretatorArray.h | 2 +- .../EmfInterpretator/CEmfInterpretatorBase.h | 2 +- .../CEmfInterpretatorRender.h | 4 +- .../EmfInterpretator/CEmfInterpretatorSvg.cpp | 4 +- .../EmfInterpretator/CEmfInterpretatorSvg.h | 4 +- .../EmfInterpretator/CEmfInterpretatorXml.h | 4 +- .../raster/Metafile/Emf/EmfObjects.cpp | 4 +- .../Metafile/Emf/EmfParser/CEmfParser.cpp | 36 +- .../Metafile/Emf/EmfParser/CEmfParserBase.cpp | 76 +-- .../Metafile/Emf/EmfParser/CEmfParserBase.h | 4 +- .../Metafile/Emf/EmfParser/CEmfPlusParser.cpp | 152 ++--- .../Metafile/Emf/EmfParser/CEmfxParser.cpp | 30 +- .../raster/Metafile/Emf/EmfPlayer.cpp | 8 +- DesktopEditor/raster/Metafile/Emf/EmfPlayer.h | 2 +- DesktopEditor/raster/Metafile/Emf/EmfTypes.h | 2 +- DesktopEditor/raster/Metafile/MetaFile.cpp | 32 +- DesktopEditor/raster/Metafile/MetaFile.h | 4 +- .../raster/Metafile/StarView/SvmFile.cpp | 24 +- .../raster/Metafile/StarView/SvmFile.h | 6 +- .../raster/Metafile/StarView/SvmObjects.cpp | 4 +- .../raster/Metafile/StarView/SvmObjects.h | 2 +- .../raster/Metafile/StarView/SvmPlayer.cpp | 8 +- .../CInterpretatorSvgBase.cpp | 10 +- .../WmfInterpretator/CWmfInterpretatorBase.h | 2 +- .../CWmfInterpretatorRender.h | 4 +- .../WmfInterpretator/CWmfInterpretatorSvg.cpp | 10 +- .../WmfInterpretator/CWmfInterpretatorSvg.h | 4 +- .../Wmf/WmfInterpretator/cwmfinterpretator.h | 2 +- .../raster/Metafile/Wmf/WmfObjects.cpp | 4 +- .../raster/Metafile/Wmf/WmfObjects.h | 8 +- .../Metafile/Wmf/WmfParser/CWmfParser.cpp | 14 +- .../Metafile/Wmf/WmfParser/CWmfParser.h | 2 +- .../Metafile/Wmf/WmfParser/CWmfParserBase.cpp | 58 +- .../Metafile/Wmf/WmfParser/CWmfParserBase.h | 2 +- .../raster/Metafile/Wmf/WmfPlayer.cpp | 4 +- .../raster/Metafile/svg/SVGFramework.cpp | 8 +- .../raster/Metafile/svg/SVGFramework.h | 64 +- .../raster/Metafile/svg/SvgObjects/CImage.cpp | 2 +- .../raster/Metafile/svg/SvgObjects/CLine.cpp | 2 +- .../Metafile/svg/SvgObjects/CObjectBase.cpp | 6 +- .../raster/Metafile/svg/SvgObjects/CPath.h | 2 +- .../Metafile/svg/SvgObjects/CPattern.cpp | 4 +- .../raster/Metafile/svg/SvgObjects/CText.cpp | 8 +- .../Metafile/test/DisplayingXML/CCustomView.h | 2 +- .../test/DisplayingXML/CMetafileTreeWidget.h | 4 +- .../test/DisplayingXML/CRecordCreator.cpp | 4 +- .../DisplayingXML/Common/CColorWidget.cpp | 2 +- .../DisplayingXML/Common/CEmptyWidget.cpp | 2 +- .../Common/CExtSelectClipRgnWidget.cpp | 2 +- .../Common/CExtTextOutWidget.cpp | 2 +- .../DisplayingXML/Common/CFillRgnWidget.cpp | 2 +- .../DisplayingXML/Common/CFrameRgnWidget.cpp | 2 +- .../Common/CGradientFillWidget.cpp | 2 +- .../DisplayingXML/Common/CInvertRgnWidget.cpp | 2 +- .../Common/CLogFontExDvWidget.cpp | 4 +- .../Common/CLogPaletteWidget.cpp | 2 +- .../Common/CPaletteEntriesWidget.cpp | 2 +- .../DisplayingXML/Common/CPointsWidget.cpp | 2 +- .../DisplayingXML/Common/CPolyDrawWidget.cpp | 2 +- .../Common/CPolyTextOutWidget.cpp | 2 +- DesktopEditor/xml/include/xmlencoding.h | 4 +- DesktopEditor/xml/src/xmldom.cpp | 12 +- .../xmlsec/src/osign/lib/src/buffer.cpp | 4 +- DesktopEditor/xmlsec/src/osign/test/main.cpp | 54 +- .../xmlsec/src/src/Certificate_openssl.h | 6 +- DesktopEditor/xmlsec/src/src/OOXMLSigner.cpp | 6 +- .../xmlsec/src/src/OOXMLVerifier.cpp | 10 +- DesktopEditor/xmlsec/src/wasm/all/engine.js | 2 +- .../src/wasm/oform_plugin/module/main.cpp | 2 +- .../Properties/AssemblyInfo.cs | 28 +- DjVuFile/DjVu.h | 2 +- DjVuFile/DjVuFileImplementation.cpp | 8 +- DocxRenderer/DocxRenderer.h | 2 +- DocxRenderer/convert_params.h | 12 +- DocxRenderer/readme.md | 70 +-- DocxRenderer/src/logic/Document.cpp | 28 +- DocxRenderer/src/logic/Page.cpp | 88 +-- DocxRenderer/src/logic/elements/BaseItem.h | 4 +- DocxRenderer/src/logic/elements/ContText.cpp | 20 +- DocxRenderer/src/logic/elements/Paragraph.cpp | 10 +- DocxRenderer/src/logic/elements/Paragraph.h | 10 +- DocxRenderer/src/logic/elements/Shape.cpp | 130 ++-- .../src/logic/managers/FontManager.cpp | 14 +- DocxRenderer/src/logic/managers/FontManager.h | 10 +- .../src/logic/managers/FontStyleManager.cpp | 2 +- .../logic/managers/ParagraphStyleManager.cpp | 2 +- DocxRenderer/src/logic/styles/FontStyle.cpp | 2 +- DocxRenderer/src/resources/ColorTable.h | 4 +- DocxRenderer/src/resources/Constants.h | 2 +- DocxRenderer/test/main.cpp | 2 +- EpubFile/src/CEpubFile.cpp | 14 +- EpubFile/test/main.cpp | 2 +- Fb2File/Fb2File.cpp | 384 ++++++------ Fb2File/test/main.cpp | 14 +- Fb2File/xml/tmp/main.cpp | 68 +-- HtmlFile/HtmlFile.cpp | 44 +- HtmlFile2/HTMLParameters.h | 18 +- HtmlFile2/HTMLReader.cpp | 46 +- HtmlFile2/HTMLReader.h | 12 +- HtmlFile2/MarkdownParameters.h | 6 +- HtmlFile2/Table.cpp | 6 +- HtmlFile2/Table.h | 4 +- HtmlFile2/Tags/MDTags.cpp | 2 +- HtmlFile2/Tags/OOXMLTags.cpp | 28 +- HtmlFile2/Writers/IWriter.h | 6 +- HtmlFile2/Writers/MDWriter.cpp | 4 +- HtmlFile2/Writers/OOXMLWriter.cpp | 66 +- HtmlFile2/Writers/OOXMLWriter.h | 46 +- HtmlFile2/htmlfile2.cpp | 240 ++++---- HtmlFile2/src/Languages.h | 120 ++-- HtmlFile2/test/main.cpp | 12 +- HwpFile/HwpDoc/Common/NodeNames.h | 4 +- HwpFile/HwpDoc/Common/WriterContext.cpp | 2 +- HwpFile/HwpDoc/Conversion/ConversionState.h | 2 +- HwpFile/HwpDoc/Conversion/Converter2OOXML.cpp | 32 +- .../HwpDoc/Conversion/FootnoteConverter.cpp | 2 +- HwpFile/HwpDoc/Conversion/StyleConverter.cpp | 4 +- HwpFile/HwpDoc/Conversion/Transform.h | 2 +- .../HWPElements/HWPRecordBorderFill.cpp | 2 +- .../HwpDoc/HWPElements/HWPRecordBullet.cpp | 2 +- .../HwpDoc/HWPElements/HWPRecordCharShape.cpp | 2 +- .../HwpDoc/HWPElements/HWPRecordCtrlData.cpp | 4 +- .../HWPElements/HWPRecordCtrlHeader.cpp | 2 +- .../HWPElements/HWPRecordFormObject.cpp | 2 +- .../HwpDoc/HWPElements/HWPRecordNumbering.cpp | 8 +- .../HwpDoc/HWPElements/HWPRecordParaShape.cpp | 8 +- .../HwpDoc/HWPElements/HWPRecordParaText.cpp | 2 +- .../HwpDoc/HWPElements/HwpRecordTabDef.cpp | 4 +- HwpFile/HwpDoc/HWPElements/HwpRecordTypes.h | 2 +- HwpFile/HwpDoc/HWPFile.cpp | 12 +- HwpFile/HwpDoc/HWPSection.cpp | 8 +- HwpFile/HwpDoc/HWPStream.cpp | 4 +- HwpFile/HwpDoc/OLEdoc/CompoundFile.cpp | 4 +- HwpFile/HwpDoc/Paragraph/CtrlCommon.cpp | 4 +- HwpFile/HwpDoc/Paragraph/CtrlField.cpp | 2 +- HwpFile/HwpDoc/Paragraph/CtrlGeneralShape.cpp | 2 +- HwpFile/HwpDoc/Paragraph/CtrlHeadFoot.cpp | 2 +- HwpFile/HwpDoc/Paragraph/CtrlNewNumber.cpp | 4 +- HwpFile/HwpDoc/Paragraph/CtrlObjElement.cpp | 2 +- HwpFile/HwpDoc/Paragraph/CtrlSectionDef.cpp | 2 +- .../HwpDoc/Paragraph/CtrlShapeConnectLine.cpp | 2 +- HwpFile/HwpDoc/Paragraph/CtrlShapePic.cpp | 12 +- HwpFile/HwpDoc/Paragraph/CtrlShapeTextArt.cpp | 4 +- HwpFile/HwpDoc/Paragraph/LineSeg.cpp | 2 +- HwpFile/HwpDoc/Section/NoteShape.cpp | 2 +- HwpFile/HwpDoc/Section/NoteShape.h | 4 +- MsBinaryFile/Common/Vba/Records.cpp | 2 +- MsBinaryFile/Common/Vba/VbaBinary.cpp | 2 +- MsBinaryFile/Common/Vml/GraphicsPath.cpp | 4 +- MsBinaryFile/Common/Vml/GraphicsPath.h | 2 +- .../Common/Vml/PPTShape/BinaryReader.cpp | 2 +- .../Common/Vml/PPTShape/BinaryReader.h | 2 +- .../Common/Vml/PPTShape/CustomGeomShape.cpp | 4 +- .../Common/Vml/PPTShape/ElementSettings.cpp | 14 +- .../Common/Vml/PPTShape/ElementSettings.h | 12 +- MsBinaryFile/Common/Vml/PPTShape/Enums.h | 4 +- .../Vml/PPTShape/Ppt2PptxShapeConverter.cpp | 192 +++--- .../Vml/PPTShape/Ppt2PptxShapeConverter.h | 2 +- .../Common/Vml/PPTShape/PptFormula.cpp | 2 +- MsBinaryFile/Common/Vml/PPTShape/PptShape.cpp | 4 +- .../Common/Vml/PPTShape/PptShapeEnum.h | 2 +- .../Vml/PPTXShape/Pptx2PptShapeConverter.cpp | 24 +- .../Common/Vml/PPTXShape/PptxFormula.cpp | 8 +- .../Common/Vml/PPTXShape/PptxShape.cpp | 4 +- MsBinaryFile/Common/Vml/VmlPath.cpp | 6 +- MsBinaryFile/Common/Vml/toVmlConvert.cpp | 2 +- MsBinaryFile/Common/Vml/toVmlConvert.h | 16 +- .../DocFile/CharacterPropertiesMapping.cpp | 6 +- MsBinaryFile/DocFile/DocumentMapping.cpp | 18 +- MsBinaryFile/DocFile/DocumentProperties.cpp | 2 +- MsBinaryFile/DocFile/FontFamilyName.cpp | 2 +- .../DocFile/FormattedDiskPageCHPX.cpp | 2 +- .../DocFile/FormattedDiskPagePAPX.cpp | 2 +- MsBinaryFile/DocFile/Global.h | 2 +- MsBinaryFile/DocFile/NumberingMapping.cpp | 12 +- .../DocFile/OfficeDrawing/RecordFactory.cpp | 2 +- .../DocFile/OfficeDrawing/ShapeOptions.h | 4 +- .../OfficeDrawing/Shapetypes/ArrowType.h | 4 +- .../DocFile/ParagraphPropertiesMapping.cpp | 4 +- MsBinaryFile/DocFile/PictureDescriptor.cpp | 4 +- MsBinaryFile/DocFile/PieceTable.cpp | 2 +- .../DocFile/SectionPropertiesMapping.cpp | 2 +- MsBinaryFile/DocFile/ShadingDescriptor.cpp | 2 +- .../DocFile/SinglePropertyModifier.cpp | 2 +- .../DocFile/TableCellPropertiesMapping.cpp | 2 +- .../DocFile/TablePropertyExceptions.h | 2 +- MsBinaryFile/DocFile/Tbkd.h | 2 +- MsBinaryFile/DocFile/VMLPictureMapping.cpp | 6 +- MsBinaryFile/DocFile/VMLShapeMapping.cpp | 28 +- MsBinaryFile/DocFile/VMLShapeTypeMapping.cpp | 2 +- MsBinaryFile/DocFile/WordDocument.cpp | 2 +- MsBinaryFile/PptFile/Drawing/Animations.h | 6 +- MsBinaryFile/PptFile/Drawing/AudioOverlay.h | 8 +- MsBinaryFile/PptFile/Drawing/Document.h | 4 +- MsBinaryFile/PptFile/Drawing/Element.h | 6 +- MsBinaryFile/PptFile/Drawing/Elements.cpp | 6 +- MsBinaryFile/PptFile/Drawing/Layout.cpp | 2 +- MsBinaryFile/PptFile/Drawing/Metric.h | 2 +- MsBinaryFile/PptFile/Drawing/Shapes/Shape.h | 12 +- MsBinaryFile/PptFile/Drawing/SlideShow.h | 22 +- .../PptFile/Drawing/TextAttributesEx.cpp | 8 +- .../PptFile/Drawing/TextAttributesEx.h | 8 +- MsBinaryFile/PptFile/Drawing/Theme.cpp | 2 +- MsBinaryFile/PptFile/Drawing/Theme.h | 4 +- .../PptFile/Drawing/XmlStringWriter.h | 2 +- MsBinaryFile/PptFile/PPTXWriter/Converter.cpp | 14 +- .../PptFile/PPTXWriter/ShapeWriter.cpp | 28 +- MsBinaryFile/PptFile/PPTXWriter/ShapeWriter.h | 28 +- .../PptFile/PPTXWriter/TableWriter.cpp | 8 +- .../PptFile/Reader/PPTDocumentInfo.cpp | 4 +- .../PptFile/Reader/PPTDocumentInfoOneUser.cpp | 126 ++-- .../PptFile/Reader/PPTDocumentInfoOneUser.h | 8 +- MsBinaryFile/PptFile/Reader/PPTFileReader.cpp | 6 +- .../PptFile/Reader/ReadStructures.cpp | 8 +- MsBinaryFile/PptFile/Reader/Records.cpp | 10 +- MsBinaryFile/PptFile/Reader/Records.h | 2 +- .../Records/Animations/VisualShapeAtom.h | 2 +- .../Records/Animations/VisualSoundAtom.h | 2 +- .../PptFile/Records/DocumentRecords.cpp | 2 +- .../PptFile/Records/Drawing/ArtBlip.cpp | 2 +- .../Records/Drawing/ShapeContainer.cpp | 68 +-- .../Records/Drawing/ShapeProperties.cpp | 4 +- .../PptFile/Records/FontEntityAtom.cpp | 2 +- .../PptFile/Records/SlideContainer.cpp | 2 +- .../PptFile/Records/SlideListWithText.cpp | 4 +- .../PptFile/Records/StyleTextPropAtom.cpp | 6 +- .../PptFile/Records/StyleTextPropAtom.h | 8 +- .../PptFile/Records/TextCFExceptionAtom.cpp | 2 +- .../PptFile/Records/TextMasterStyleAtom.cpp | 4 +- .../PptFile/Records/TextPFExceptionAtom.cpp | 2 +- .../PptFile/Records/TextRulerAtom.cpp | 2 +- .../PptFile/Records/TextSIExceptionAtom.cpp | 2 +- .../PptFile/Records/TextSpecInfoAtom.cpp | 6 +- .../PptFile/Records/TextSpecInfoAtom.h | 4 +- MsBinaryFile/PptFile/Records/ViewInfoAtom.cpp | 2 +- .../XlsFile/Converter/XlsConverter.cpp | 22 +- .../XlsFile/Converter/external_items.h | 2 +- .../Converter/xlsx_conversion_context.cpp | 8 +- .../Converter/xlsx_conversion_context.h | 2 +- .../Converter/xlsx_drawing_context.cpp | 34 +- .../XlsFile/Converter/xlsx_drawing_context.h | 8 +- .../XlsFile/Converter/xlsx_package.cpp | 2 +- .../XlsFile/Converter/xlsx_textcontext.cpp | 26 +- .../XlsFile/Format/Auxiliary/HelpFunc.cpp | 2 +- MsBinaryFile/XlsFile/Format/Binary/CFRecord.h | 2 +- .../Format/Binary/CFStreamCacheReader.cpp | 12 +- .../XlsFile/Format/Logic/Biff_records/BRAI.h | 2 +- .../Logic/Biff_records/BopPopCustom.cpp | 12 +- .../XlsFile/Format/Logic/Biff_records/CF.cpp | 2 +- .../Format/Logic/Biff_records/CF12.cpp | 2 +- .../Format/Logic/Biff_records/Legend.cpp | 2 +- .../Logic/Biff_records/MarkerFormat.cpp | 2 +- .../Format/Logic/Biff_records/MulBlank.cpp | 2 +- .../Format/Logic/Biff_records/ObProj.cpp | 2 +- .../XlsFile/Format/Logic/Biff_records/SST.cpp | 2 +- .../Format/Logic/Biff_records/SXAddl.cpp | 2 +- .../Format/Logic/Biff_records/Scatter.cpp | 2 +- .../XlsFile/Format/Logic/Biff_records/TxO.cpp | 6 +- .../Format/Logic/Biff_records/XFExt.cpp | 2 +- .../Logic/Biff_structures/BiffString.cpp | 4 +- .../Logic/Biff_structures/BorderFillInfo.h | 2 +- .../Biff_structures/ChartParsedFormula.cpp | 2 +- .../Format/Logic/Biff_structures/ExtRst.cpp | 2 +- .../ODRAW/OfficeArtContainer.cpp | 2 +- .../Format/Logic/Biff_structures/PtgList.cpp | 2 +- .../Format/Logic/Biff_structures/PtgNameX.cpp | 2 +- .../XLUnicodeRichExtendedString.cpp | 2 +- .../Logic/Biff_unions/ATTACHEDLABEL_bu.cpp | 4 +- .../Logic/Biff_unions/AUTOFILTER_bu.cpp | 2 +- .../XlsFile/Format/Logic/Biff_unions/AXS.cpp | 2 +- .../Format/Logic/Biff_unions/CELLTABLE.cpp | 2 +- .../Format/Logic/Biff_unions/CELL_bu.cpp | 2 +- .../Format/Logic/Biff_unions/CHARTFOMATS.cpp | 4 +- .../Format/Logic/Biff_unions/CONDFMTS.cpp | 2 +- .../Format/Logic/Biff_unions/CUSTOMVIEW.cpp | 2 +- .../Format/Logic/Biff_unions/DBQUERY.cpp | 2 +- .../XlsFile/Format/Logic/Biff_unions/FDB.cpp | 2 +- .../Format/Logic/Biff_unions/FORMATTING.cpp | 4 +- .../Format/Logic/Biff_unions/PAGESETUP.cpp | 2 +- .../Format/Logic/Biff_unions/PIVOTADDL.cpp | 4 +- .../Format/Logic/Biff_unions/SERIESFORMAT.cpp | 10 +- .../XlsFile/Format/Logic/Biff_unions/SS.cpp | 8 +- .../XlsFile/Format/Logic/Biff_unions/XFS.cpp | 4 +- .../Format/Logic/ChartSheetSubstream.cpp | 20 +- .../XlsFile/Format/Logic/CommonSubstream.h | 2 +- .../Format/Logic/GlobalWorkbookInfo.cpp | 4 +- .../XlsFile/Format/Logic/GlobalsSubstream.cpp | 8 +- .../XlsFile/Format/Logic/GlobalsSubstream.h | 2 +- .../Format/Logic/WorksheetSubstream.cpp | 8 +- OFDFile/src/OFDFile_Private.cpp | 2 +- OFDFile/src/Utils/Utils.h | 8 +- OOXML/Base/Nullable.h | 4 +- OOXML/Base/codecvt.cpp | 12 +- .../Document/BinReader/BinaryReaderD.cpp | 18 +- .../Binary/Document/BinReader/FileWriter.cpp | 2 +- OOXML/Binary/Document/BinReader/FileWriter.h | 4 +- .../Document/BinReader/ReaderClasses.cpp | 6 +- .../Document/BinReader/fontTableWriter.cpp | 2 +- .../Document/BinWriter/BinEquationWriter.cpp | 6 +- .../BinWriter/BinReaderWriterDefines.h | 4 +- .../Document/BinWriter/BinaryWriterD.cpp | 58 +- .../Binary/Document/BinWriter/BinaryWriterD.h | 2 +- .../Document/DocWrapper/ChartSerializer.cpp | 14 +- .../Document/DocWrapper/DocxSerializer.cpp | 14 +- .../Document/DocWrapper/FontProcessor.cpp | 14 +- .../Document/DocWrapper/VsdxSerializer.cpp | 2 +- .../Document/DocWrapper/XlsxSerializer.cpp | 20 +- OOXML/Binary/Draw/BinaryReaderV.cpp | 4 +- OOXML/Binary/Draw/BinaryWriterV.cpp | 12 +- OOXML/Binary/MathEquation/MathEquation.cpp | 32 +- OOXML/Binary/MathEquation/MathEquation.h | 10 +- OOXML/Binary/MathEquation/OutputDev.h | 36 +- OOXML/Binary/MathEquation/Types.h | 178 +++--- .../Presentation/BinaryFileReaderWriter.cpp | 16 +- OOXML/Binary/Presentation/Converter.cpp | 48 +- OOXML/Binary/Presentation/FontCutter.cpp | 2 +- OOXML/Binary/Presentation/FontPicker.cpp | 2 +- OOXML/Binary/Presentation/PPTXWriter.cpp | 22 +- OOXML/Binary/Presentation/XmlWriter.cpp | 2 +- OOXML/Binary/Presentation/imagemanager.cpp | 18 +- OOXML/Binary/Sheets/Common/Common.cpp | 6 +- OOXML/Binary/Sheets/Reader/BinaryWriterS.cpp | 40 +- OOXML/Binary/Sheets/Reader/CSVReader.cpp | 22 +- .../CellFormatController.cpp | 6 +- .../CellFormatController.h | 34 +- .../CellFormatController/CurrencyReader.cpp | 82 +-- .../CellFormatController/CurrencyReader.h | 14 +- .../CellFormatController/DateReader.cpp | 54 +- .../Reader/CellFormatController/DateReader.h | 70 +-- .../CellFormatController/DigitReader.cpp | 4 +- .../Reader/CellFormatController/DigitReader.h | 20 +- .../Reader/CellFormatController/LocalInfo.cpp | 4 +- .../Reader/CellFormatController/LocalInfo.h | 40 +- .../Sheets/Reader/ChartFromToBinary.cpp | 4 +- OOXML/Binary/Sheets/Reader/CommonWriter.cpp | 2 +- .../Reader/XMLReader/XLSXTableController.cpp | 12 +- .../Reader/XMLReader/XLSXTableController.h | 40 +- .../Reader/XMLReader/XML2TableConverter.cpp | 10 +- .../Reader/XMLReader/XML2TableConverter.h | 70 +-- .../Sheets/Reader/XMLReader/XMLConverter2.cpp | 8 +- .../Sheets/Reader/XMLReader/XMLConverter2.h | 80 +-- .../Binary/Sheets/Reader/XMLReader/XMLMap.cpp | 10 +- OOXML/Binary/Sheets/Reader/XMLReader/XMLMap.h | 68 +-- .../Sheets/Reader/XMLReader/XMLReader.cpp | 2 +- .../Sheets/Reader/XMLReader/XMLReader.h | 20 +- .../Sheets/Reader/XMLReader/XMLReader2.cpp | 6 +- .../Reader/XMLReader/columnNamesController.h | 30 +- OOXML/Binary/Sheets/Writer/BinaryReaderS.cpp | 24 +- OOXML/Binary/Sheets/Writer/CSVWriter.cpp | 48 +- OOXML/Common/ComplexTypes.cpp | 2 +- OOXML/Common/ComplexTypes.h | 2 +- OOXML/Common/SimpleTypes_Base.cpp | 8 +- OOXML/Common/SimpleTypes_Base.h | 8 +- OOXML/Common/SimpleTypes_Drawing.cpp | 28 +- OOXML/Common/SimpleTypes_Drawing.h | 12 +- OOXML/Common/SimpleTypes_OMath.cpp | 2 +- OOXML/Common/SimpleTypes_OMath.h | 2 +- OOXML/Common/SimpleTypes_Shared.cpp | 14 +- OOXML/Common/SimpleTypes_Shared.h | 12 +- OOXML/Common/SimpleTypes_Vml.cpp | 14 +- OOXML/Common/SimpleTypes_Vml.h | 20 +- OOXML/Common/SimpleTypes_Word.cpp | 10 +- OOXML/Common/SimpleTypes_Word.h | 8 +- OOXML/DocxFormat/Bibliography.cpp | 2 +- OOXML/DocxFormat/Bibliography.h | 2 +- OOXML/DocxFormat/ContentTypes.cpp | 2 +- OOXML/DocxFormat/Document.cpp | 4 +- OOXML/DocxFormat/Document.h | 2 +- OOXML/DocxFormat/Docx.cpp | 4 +- OOXML/DocxFormat/Docx.h | 20 +- OOXML/DocxFormat/Drawing/Drawing.cpp | 8 +- OOXML/DocxFormat/Drawing/Drawing.h | 6 +- OOXML/DocxFormat/Drawing/DrawingExt.cpp | 2 +- OOXML/DocxFormat/FtnEdn.cpp | 2 +- OOXML/DocxFormat/FtnEdn.h | 6 +- OOXML/DocxFormat/HeaderFooter.h | 2 +- OOXML/DocxFormat/IFileContainer.cpp | 6 +- OOXML/DocxFormat/Logic/AlternateContent.cpp | 6 +- OOXML/DocxFormat/Logic/Annotations.cpp | 20 +- OOXML/DocxFormat/Logic/Bdo.cpp | 4 +- OOXML/DocxFormat/Logic/FldSimple.cpp | 2 +- OOXML/DocxFormat/Logic/Hyperlink.cpp | 2 +- OOXML/DocxFormat/Logic/Paragraph.cpp | 4 +- OOXML/DocxFormat/Logic/Paragraph.h | 4 +- OOXML/DocxFormat/Logic/ParagraphProperty.cpp | 4 +- OOXML/DocxFormat/Logic/Pict.cpp | 12 +- OOXML/DocxFormat/Logic/Pict.h | 2 +- OOXML/DocxFormat/Logic/Run.h | 4 +- OOXML/DocxFormat/Logic/RunContent.h | 2 +- OOXML/DocxFormat/Logic/RunProperty.cpp | 8 +- OOXML/DocxFormat/Logic/RunProperty.h | 2 +- OOXML/DocxFormat/Logic/Sdt.cpp | 2 +- OOXML/DocxFormat/Logic/SectionProperty.cpp | 4 +- OOXML/DocxFormat/Logic/Shape.cpp | 2 +- OOXML/DocxFormat/Logic/SmartTag.cpp | 2 +- OOXML/DocxFormat/Logic/Table.cpp | 8 +- OOXML/DocxFormat/Logic/Table.h | 8 +- OOXML/DocxFormat/Logic/TableProperty.cpp | 20 +- OOXML/DocxFormat/Logic/Vml.cpp | 72 +-- OOXML/DocxFormat/Logic/VmlOfficeDrawing.cpp | 76 +-- OOXML/DocxFormat/Logic/VmlWord.cpp | 4 +- OOXML/DocxFormat/Math/oMath.cpp | 4 +- OOXML/DocxFormat/Math/oMathBottomNodes.h | 2 +- OOXML/DocxFormat/Math/oMathContent.cpp | 6 +- OOXML/DocxFormat/RId.cpp | 4 +- OOXML/DocxFormat/Rels.cpp | 2 +- OOXML/DocxFormat/Settings/Settings.cpp | 60 +- OOXML/DocxFormat/Settings/Settings.h | 8 +- OOXML/DocxFormat/Settings/WebSettings.cpp | 2 +- OOXML/DocxFormat/Settings/WebSettings.h | 2 +- OOXML/DocxFormat/VmlDrawing.cpp | 14 +- OOXML/DocxFormat/VmlDrawing.h | 2 +- OOXML/DocxFormat/WritingElement.h | 2 +- .../ASCOfficeDrawingConverter.cpp | 82 +-- .../ASCOfficeDrawingConverter.h | 2 +- .../ASCOfficePPTXFileRealization.cpp | 6 +- OOXML/PPTXFormat/FileContainer.cpp | 2 +- OOXML/PPTXFormat/LegacyDiagramText.cpp | 14 +- OOXML/PPTXFormat/Logic/BodyPr.cpp | 2 +- OOXML/PPTXFormat/Logic/Bullets/Bullet.cpp | 2 +- OOXML/PPTXFormat/Logic/Colors/ColorBase.h | 10 +- OOXML/PPTXFormat/Logic/EffectDag.cpp | 2 +- OOXML/PPTXFormat/Logic/Fills/Blip.cpp | 2 +- OOXML/PPTXFormat/Logic/Fills/BlipFill.cpp | 6 +- OOXML/PPTXFormat/Logic/GraphicFrame.cpp | 8 +- OOXML/PPTXFormat/Logic/Ln.h | 2 +- OOXML/PPTXFormat/Logic/Media/WavAudioFile.cpp | 2 +- OOXML/PPTXFormat/Logic/Pic.cpp | 4 +- OOXML/PPTXFormat/Logic/Shape.cpp | 2 +- OOXML/PPTXFormat/Logic/SmartArt.cpp | 12 +- OOXML/PPTXFormat/Logic/SpTree.cpp | 4 +- OOXML/PPTXFormat/Logic/TcTxStyle.h | 4 +- OOXML/PPTXFormat/Logic/TextFont.cpp | 2 +- .../Logic/Transitions/TransitionBase.cpp | 4 +- OOXML/PPTXFormat/Logic/UniColor.cpp | 8 +- OOXML/PPTXFormat/Theme/FmtScheme.cpp | 2 +- OOXML/SystemUtility/SystemUtility.cpp | 6 +- OOXML/SystemUtility/SystemUtility.h | 2 +- OOXML/VsdxFormat/Shapes.cpp | 2 +- OOXML/VsdxFormat/VisioDocument.cpp | 2 +- OOXML/XlsbFormat/Biff12_unions/PCDI.cpp | 2 +- OOXML/XlsbFormat/Biff12_unions/PIVOTRULES.cpp | 2 +- .../XlsbFormat/Biff12_unions/PIVOTRULES14.cpp | 2 +- OOXML/XlsbFormat/Biff12_unions/PNPAIRS.cpp | 2 +- OOXML/XlsbFormat/WorkBookStream.cpp | 2 +- OOXML/XlsbFormat/Xlsb.cpp | 10 +- OOXML/XlsxFormat/CalcChain/CalcChain.cpp | 2 +- OOXML/XlsxFormat/CalcChain/CalcChain.h | 2 +- OOXML/XlsxFormat/Chart/ChartDrawing.cpp | 8 +- OOXML/XlsxFormat/Common.cpp | 2 +- OOXML/XlsxFormat/ComplexTypes_Spreadsheet.cpp | 2 +- OOXML/XlsxFormat/Drawing/CellAnchor.cpp | 4 +- OOXML/XlsxFormat/Drawing/CellAnchor.h | 2 +- OOXML/XlsxFormat/Drawing/Pos.cpp | 2 +- OOXML/XlsxFormat/Drawing/Pos.h | 2 +- OOXML/XlsxFormat/Pivot/Pivots.cpp | 6 +- OOXML/XlsxFormat/SharedStrings/PhoneticPr.cpp | 4 +- OOXML/XlsxFormat/SharedStrings/PhoneticPr.h | 2 +- OOXML/XlsxFormat/SharedStrings/Run.h | 2 +- OOXML/XlsxFormat/SharedStrings/Si.cpp | 2 +- OOXML/XlsxFormat/SharedStrings/Si.h | 2 +- OOXML/XlsxFormat/SharedStrings/Text.h | 2 +- OOXML/XlsxFormat/Styles/CellStyles.h | 2 +- OOXML/XlsxFormat/Styles/Colors.cpp | 2 +- OOXML/XlsxFormat/Styles/TableStyles.cpp | 4 +- OOXML/XlsxFormat/Styles/TableStyles.h | 2 +- OOXML/XlsxFormat/Styles/Xfs.cpp | 2 +- OOXML/XlsxFormat/Styles/Xfs.h | 2 +- OOXML/XlsxFormat/Styles/dxf.cpp | 2 +- OOXML/XlsxFormat/Styles/rPr.cpp | 2 +- OOXML/XlsxFormat/Styles/rPr.h | 2 +- OOXML/XlsxFormat/Table/Autofilter.cpp | 28 +- OOXML/XlsxFormat/Table/Table.h | 2 +- OOXML/XlsxFormat/Table/Tables.cpp | 2 +- OOXML/XlsxFormat/Workbook/BookViews.h | 2 +- OOXML/XlsxFormat/Workbook/CalcPr.cpp | 2 +- OOXML/XlsxFormat/Workbook/DefinedNames.h | 2 +- OOXML/XlsxFormat/Workbook/Sheets.h | 2 +- OOXML/XlsxFormat/Workbook/Workbook.cpp | 8 +- OOXML/XlsxFormat/Workbook/Workbook.h | 2 +- OOXML/XlsxFormat/Worksheets/Cols.h | 2 +- .../Worksheets/ConditionalFormatting.cpp | 2 +- .../Worksheets/ConditionalFormatting.h | 4 +- OOXML/XlsxFormat/Worksheets/DataValidation.h | 4 +- OOXML/XlsxFormat/Worksheets/Hyperlinks.h | 2 +- OOXML/XlsxFormat/Worksheets/MergeCells.h | 2 +- OOXML/XlsxFormat/Worksheets/SheetData.cpp | 44 +- OOXML/XlsxFormat/Worksheets/SheetData.h | 12 +- OOXML/XlsxFormat/Worksheets/Worksheet.cpp | 2 +- OOXML/XlsxFormat/Worksheets/Worksheet.h | 2 +- .../Worksheets/WorksheetChildOther.cpp | 4 +- .../Worksheets/WorksheetChildOther.h | 2 +- OOXML/XlsxFormat/Xlsx.cpp | 20 +- OdfFile/Common/CPColorUtils.h | 4 +- OdfFile/Common/CPOptional.h | 2 +- OdfFile/Common/readdocelement.h | 6 +- OdfFile/Common/xml/attributes.cpp | 2 +- .../DataTypes/custom_shape_types_convert.h | 2 +- OdfFile/DataTypes/drawangle.cpp | 4 +- OdfFile/DataTypes/length.cpp | 6 +- OdfFile/DataTypes/stylefamily.h | 2 +- OdfFile/DataTypes/textalign.h | 2 +- OdfFile/Formulas/formulasconvert.h | 8 +- OdfFile/Formulas/formulasconvert_odf.cpp | 24 +- OdfFile/Formulas/formulasconvert_oox.cpp | 12 +- .../Windows/OdfFileWTest/OdfFileWTest.cpp | 2 +- .../SMCustomShape2OOXML/smcustomshapepars.cpp | 2 +- .../StarMath2OOXML/cstarmathpars.cpp | 2 +- .../Converter/StarMath2OOXML/cstarmathpars.h | 2 +- .../Converter/docx_conversion_context.cpp | 42 +- .../Converter/docx_conversion_context.h | 6 +- OdfFile/Reader/Converter/docx_package.cpp | 4 +- .../Reader/Converter/docx_table_context.cpp | 12 +- .../Converter/drawing_object_description.h | 2 +- OdfFile/Reader/Converter/headers_footers.cpp | 2 +- OdfFile/Reader/Converter/hyperlinks.cpp | 2 +- OdfFile/Reader/Converter/mediaitems.cpp | 8 +- OdfFile/Reader/Converter/mediaitems.h | 2 +- OdfFile/Reader/Converter/oox_chart_axis.cpp | 2 +- OdfFile/Reader/Converter/oox_chart_series.cpp | 14 +- OdfFile/Reader/Converter/oox_data_labels.cpp | 2 +- OdfFile/Reader/Converter/oox_drawing.cpp | 4 +- .../Reader/Converter/oox_drawing_fills.cpp | 2 +- OdfFile/Reader/Converter/oox_layout.cpp | 6 +- OdfFile/Reader/Converter/oox_layout.h | 2 +- OdfFile/Reader/Converter/oox_plot_area.cpp | 2 +- OdfFile/Reader/Converter/oox_plot_area.h | 2 +- OdfFile/Reader/Converter/oox_types_chart.cpp | 4 +- OdfFile/Reader/Converter/oox_types_chart.h | 4 +- OdfFile/Reader/Converter/ooxtablerowspanned.h | 2 +- .../Converter/pptx_conversion_context.cpp | 26 +- .../Converter/pptx_conversion_context.h | 2 +- OdfFile/Reader/Converter/pptx_drawing.cpp | 16 +- OdfFile/Reader/Converter/pptx_output_xml.cpp | 2 +- OdfFile/Reader/Converter/pptx_output_xml.h | 4 +- OdfFile/Reader/Converter/pptx_package.cpp | 12 +- .../Reader/Converter/pptx_slide_context.cpp | 24 +- .../Reader/Converter/pptx_table_context.cpp | 12 +- .../Reader/Converter/pptx_text_context.cpp | 34 +- OdfFile/Reader/Converter/xlsx_alignment.cpp | 2 +- OdfFile/Reader/Converter/xlsx_borders.cpp | 2 +- .../Converter/xlsx_complex_number_format.h | 4 +- .../Converter/xlsx_conditionalFormatting.cpp | 2 +- OdfFile/Reader/Converter/xlsx_drawing.cpp | 10 +- .../Reader/Converter/xlsx_drawing_context.cpp | 24 +- .../Reader/Converter/xlsx_drawing_context.h | 2 +- OdfFile/Reader/Converter/xlsx_drawings.cpp | 4 +- OdfFile/Reader/Converter/xlsx_font.cpp | 2 +- OdfFile/Reader/Converter/xlsx_hyperlinks.cpp | 2 +- OdfFile/Reader/Converter/xlsx_numFmts.cpp | 2 +- OdfFile/Reader/Converter/xlsx_output_xml.cpp | 10 +- .../Reader/Converter/xlsx_pivots_context.cpp | 14 +- OdfFile/Reader/Converter/xlsx_table_state.cpp | 16 +- .../Reader/Converter/xlsx_tablecontext.cpp | 6 +- OdfFile/Reader/Converter/xlsx_textcontext.cpp | 24 +- .../Converter/xlsxconversioncontext.cpp | 14 +- OdfFile/Reader/Format/anim_elements.cpp | 8 +- OdfFile/Reader/Format/anim_elements.h | 4 +- OdfFile/Reader/Format/chart_build_oox.cpp | 30 +- OdfFile/Reader/Format/createandread.cpp | 2 +- OdfFile/Reader/Format/draw_common.cpp | 62 +- OdfFile/Reader/Format/draw_frame.cpp | 2 +- OdfFile/Reader/Format/draw_frame_docx.cpp | 36 +- OdfFile/Reader/Format/draw_frame_pptx.cpp | 18 +- OdfFile/Reader/Format/draw_frame_xlsx.cpp | 18 +- OdfFile/Reader/Format/draw_page.cpp | 6 +- OdfFile/Reader/Format/draw_shapes.cpp | 16 +- OdfFile/Reader/Format/draw_shapes.h | 10 +- OdfFile/Reader/Format/draw_shapes_docx.cpp | 6 +- OdfFile/Reader/Format/draw_shapes_pptx.cpp | 8 +- OdfFile/Reader/Format/draw_shapes_xlsx.cpp | 4 +- OdfFile/Reader/Format/list.cpp | 8 +- OdfFile/Reader/Format/math_token_elements.cpp | 4 +- OdfFile/Reader/Format/note.cpp | 2 +- OdfFile/Reader/Format/odf_document_impl.cpp | 10 +- OdfFile/Reader/Format/odfcontext.cpp | 4 +- OdfFile/Reader/Format/odfcontext.h | 4 +- OdfFile/Reader/Format/office_annotation.cpp | 6 +- OdfFile/Reader/Format/office_body.cpp | 2 +- .../Reader/Format/office_elements_create.cpp | 2 +- .../Reader/Format/office_elements_create.h | 12 +- OdfFile/Reader/Format/office_text.cpp | 8 +- OdfFile/Reader/Format/paragraph_elements.cpp | 10 +- OdfFile/Reader/Format/search_table_cell.cpp | 2 +- .../Reader/Format/style_chart_properties.cpp | 2 +- .../Reader/Format/style_chart_properties.h | 2 +- .../Format/style_graphic_properties.cpp | 4 +- .../style_paragraph_properties_docx.cpp | 12 +- .../style_paragraph_properties_pptx.cpp | 4 +- OdfFile/Reader/Format/style_presentation.cpp | 2 +- OdfFile/Reader/Format/style_presentation.h | 4 +- .../Reader/Format/style_text_properties.cpp | 20 +- OdfFile/Reader/Format/styles.cpp | 4 +- OdfFile/Reader/Format/styles.h | 10 +- OdfFile/Reader/Format/styles_list.cpp | 14 +- OdfFile/Reader/Format/svg_parser.cpp | 12 +- OdfFile/Reader/Format/table_docx.cpp | 8 +- OdfFile/Reader/Format/table_xlsx.cpp | 60 +- OdfFile/Reader/Format/templates.cpp | 2 +- OdfFile/Reader/Format/text_elements.cpp | 54 +- OdfFile/Reader/Format/text_elements.h | 2 +- OdfFile/Reader/Format/visitor.h | 46 +- OdfFile/Writer/Converter/ConvertDrawing.cpp | 32 +- OdfFile/Writer/Converter/ConvertVml.cpp | 8 +- OdfFile/Writer/Converter/Converter.cpp | 4 +- OdfFile/Writer/Converter/ConverterChart.cpp | 20 +- OdfFile/Writer/Converter/DocxConverter.cpp | 158 ++--- OdfFile/Writer/Converter/MathConverter.cpp | 6 +- OdfFile/Writer/Converter/PptxConverter.cpp | 26 +- OdfFile/Writer/Converter/XlsxConverter.cpp | 58 +- OdfFile/Writer/Format/anim_elements.cpp | 2 +- OdfFile/Writer/Format/anim_elements.h | 4 +- OdfFile/Writer/Format/draw_frame.cpp | 6 +- OdfFile/Writer/Format/draw_frame.h | 6 +- OdfFile/Writer/Format/draw_shapes.cpp | 12 +- OdfFile/Writer/Format/draw_shapes.h | 18 +- OdfFile/Writer/Format/number_style.cpp | 2 +- OdfFile/Writer/Format/object_package.cpp | 2 +- OdfFile/Writer/Format/odf_chart_context.cpp | 32 +- .../Writer/Format/odf_controls_context.cpp | 2 +- .../Writer/Format/odf_conversion_context.cpp | 12 +- OdfFile/Writer/Format/odf_drawing_context.cpp | 74 +-- OdfFile/Writer/Format/odf_drawing_context.h | 6 +- .../Format/odf_lists_styles_context.cpp | 2 +- OdfFile/Writer/Format/odf_math_context.cpp | 4 +- .../Format/odf_number_styles_context.cpp | 24 +- .../Writer/Format/odf_number_styles_context.h | 2 +- .../Writer/Format/odf_page_layout_context.cpp | 12 +- .../Writer/Format/odf_page_layout_context.h | 6 +- OdfFile/Writer/Format/odf_page_layout_state.h | 2 +- OdfFile/Writer/Format/odf_style_context.cpp | 12 +- OdfFile/Writer/Format/odf_style_context.h | 4 +- OdfFile/Writer/Format/odf_style_state.cpp | 2 +- OdfFile/Writer/Format/odf_style_state.h | 10 +- OdfFile/Writer/Format/odf_table_context.cpp | 8 +- .../Format/odf_table_styles_context.cpp | 12 +- OdfFile/Writer/Format/odf_text_context.cpp | 4 +- OdfFile/Writer/Format/odf_text_context.h | 12 +- .../Writer/Format/odp_conversion_context.cpp | 4 +- OdfFile/Writer/Format/odp_slide_context.cpp | 10 +- .../Writer/Format/ods_conversion_context.cpp | 20 +- OdfFile/Writer/Format/ods_table_context.cpp | 10 +- OdfFile/Writer/Format/ods_table_state.cpp | 38 +- OdfFile/Writer/Format/ods_table_state.h | 6 +- .../Writer/Format/odt_conversion_context.cpp | 58 +- .../Writer/Format/office_elements_create.cpp | 4 +- .../Writer/Format/office_elements_create.h | 14 +- OdfFile/Writer/Format/paragraph_elements.h | 2 +- .../Writer/Format/style_chart_properties.h | 2 +- OdfFile/Writer/Format/style_presentation.h | 4 +- OdfFile/Writer/Format/styles.cpp | 4 +- OdfFile/Writer/Format/styles.h | 10 +- OdfFile/Writer/Format/table.h | 2 +- .../Writer/Format/table_named_expressions.h | 2 +- OdfFile/Writer/Format/text_elements.h | 2 +- OdfFile/Writer/Format/visitor.h | 44 +- OfficeCryptReader/ooxml_crypt/main.cpp | 10 +- OfficeCryptReader/source/CryptTransform.cpp | 12 +- OfficeUtils/js/wasm/js/zlib.js | 20 +- OfficeUtils/src/ZipBuffer.cpp | 22 +- OfficeUtils/src/ZipBuffer.h | 40 +- OfficeUtils/src/ZipFolder.h | 52 +- OfficeUtils/src/ZipUtilsCP.cpp | 2 +- PdfFile/PdfEditor.cpp | 92 +-- PdfFile/PdfEditor.h | 6 +- PdfFile/PdfFile.h | 52 +- PdfFile/PdfReader.cpp | 38 +- PdfFile/PdfReader.h | 2 +- PdfFile/PdfWriter.cpp | 108 ++-- PdfFile/PdfWriter.h | 24 +- PdfFile/Resources/BaseFonts.h | 2 +- PdfFile/SrcReader/Adaptors.cpp | 6 +- PdfFile/SrcReader/Adaptors.h | 2 +- PdfFile/SrcReader/FontsWasm.h | 2 +- PdfFile/SrcReader/JPXStream2.cpp | 2 +- PdfFile/SrcReader/MemoryUtils.h | 8 +- PdfFile/SrcReader/PdfAnnot.cpp | 318 +++++----- PdfFile/SrcReader/PdfAnnot.h | 224 +++---- PdfFile/SrcReader/PdfFont.cpp | 10 +- PdfFile/SrcReader/RendererOutputDev.cpp | 118 ++-- PdfFile/SrcReader/RendererOutputDev.h | 32 +- PdfFile/SrcWriter/Annotation.cpp | 4 +- PdfFile/SrcWriter/Consts.h | 14 +- PdfFile/SrcWriter/Destination.cpp | 8 +- PdfFile/SrcWriter/Document.cpp | 52 +- PdfFile/SrcWriter/Document.h | 2 +- PdfFile/SrcWriter/EncryptDictionary.cpp | 28 +- PdfFile/SrcWriter/EncryptDictionary.h | 10 +- PdfFile/SrcWriter/Field.cpp | 18 +- PdfFile/SrcWriter/Field.h | 2 +- PdfFile/SrcWriter/Font14.cpp | 2 +- PdfFile/SrcWriter/Font14.h | 2 +- PdfFile/SrcWriter/FontCidTT.cpp | 10 +- PdfFile/SrcWriter/FontCidTT.h | 6 +- PdfFile/SrcWriter/FontOTWriter.cpp | 8 +- PdfFile/SrcWriter/FontTT.cpp | 14 +- PdfFile/SrcWriter/FontTTWriter.cpp | 78 +-- PdfFile/SrcWriter/FontTTWriter.h | 8 +- PdfFile/SrcWriter/GState.h | 2 +- PdfFile/SrcWriter/Info.h | 4 +- PdfFile/SrcWriter/Objects.cpp | 66 +- PdfFile/SrcWriter/Pages.cpp | 172 +++--- PdfFile/SrcWriter/Pages.h | 8 +- PdfFile/SrcWriter/RedactOutputDev.cpp | 42 +- PdfFile/SrcWriter/ResourcesDictionary.cpp | 10 +- PdfFile/SrcWriter/Shading.h | 2 +- PdfFile/SrcWriter/States.cpp | 32 +- PdfFile/SrcWriter/States.h | 14 +- PdfFile/SrcWriter/Streams.cpp | 6 +- PdfFile/SrcWriter/Utils.cpp | 46 +- PdfFile/SrcWriter/Utils.h | 16 +- PdfFile/lib/xpdf/Gfx.cc | 8 +- PdfFile/test/test.cpp | 14 +- RtfFile/Format/DestinationCommand.cpp | 126 ++-- RtfFile/Format/DestinationCommand.h | 34 +- RtfFile/Format/Ole1FormatReader.cpp | 4 +- RtfFile/Format/RtfChar.cpp | 12 +- RtfFile/Format/RtfDocument.h | 2 +- RtfFile/Format/RtfField.cpp | 18 +- RtfFile/Format/RtfGlobalTables.cpp | 8 +- RtfFile/Format/RtfLex.cpp | 20 +- RtfFile/Format/RtfLex.h | 4 +- RtfFile/Format/RtfMath.cpp | 8 +- RtfFile/Format/RtfMath.h | 2 +- RtfFile/Format/RtfOldList.cpp | 2 +- RtfFile/Format/RtfOle.cpp | 2 +- RtfFile/Format/RtfOle.h | 2 +- RtfFile/Format/RtfParagraph.cpp | 6 +- RtfFile/Format/RtfParagraph.h | 4 +- RtfFile/Format/RtfPicture.cpp | 6 +- RtfFile/Format/RtfPicture.h | 4 +- RtfFile/Format/RtfProperty.cpp | 58 +- RtfFile/Format/RtfProperty.h | 10 +- RtfFile/Format/RtfReader.cpp | 14 +- RtfFile/Format/RtfReader.h | 4 +- RtfFile/Format/RtfSection.cpp | 14 +- RtfFile/Format/RtfSection.h | 4 +- RtfFile/Format/RtfShape.cpp | 36 +- RtfFile/Format/RtfShape.h | 6 +- RtfFile/Format/RtfTable.cpp | 42 +- RtfFile/Format/RtfTable.h | 2 +- RtfFile/Format/RtfTableCell.cpp | 2 +- RtfFile/Format/RtfWriter.cpp | 44 +- RtfFile/Format/UniversalConverterUtils.cpp | 10 +- RtfFile/Format/UniversalConverterUtils.h | 6 +- RtfFile/Format/Utils.cpp | 12 +- RtfFile/Format/Utils.h | 2 +- RtfFile/OOXml/Reader/OOXBorderReader.cpp | 2 +- RtfFile/OOXml/Reader/OOXColorReader2.cpp | 4 +- RtfFile/OOXml/Reader/OOXDocumentReader.cpp | 10 +- .../OOXml/Reader/OOXDrawingGraphicReader.cpp | 2 +- RtfFile/OOXml/Reader/OOXLevelReader.cpp | 2 +- .../Reader/OOXParagraphElementReaders.cpp | 70 +-- .../OOXml/Reader/OOXPictureAnchorReader.cpp | 2 +- RtfFile/OOXml/Reader/OOXReader.cpp | 2 +- RtfFile/OOXml/Reader/OOXReader.h | 2 +- RtfFile/OOXml/Reader/OOXShapeReader.cpp | 60 +- RtfFile/OOXml/Reader/OOXStyleReader.cpp | 12 +- RtfFile/OOXml/Reader/OOXStyleTableReader.cpp | 2 +- RtfFile/OOXml/Reader/OOXTableReader.cpp | 32 +- RtfFile/OOXml/Reader/OOXTextItemReader.cpp | 6 +- RtfFile/OOXml/Reader/OOXcnfStyleReader.cpp | 22 +- RtfFile/OOXml/Reader/OOXtblPrReader.cpp | 4 +- RtfFile/OOXml/Reader/OOXtcPrReader.cpp | 4 +- RtfFile/OOXml/Writer/OOXDocumentWriter.cpp | 24 +- RtfFile/OOXml/Writer/OOXDocumentWriter.h | 2 +- RtfFile/OOXml/Writer/OOXSettingsWriter.cpp | 6 +- RtfFile/OOXml/Writer/OOXThemeWriter.cpp | 2 +- RtfFile/OOXml/Writer/OOXThemeWriter.h | 2 +- RtfFile/OOXml/Writer/OOXWriter.cpp | 2 +- .../DocxFormatCodeGen/codegen/CodeGen.cs | 28 +- .../DocxFormatCodeGen/codegen/CodeGenPivot.cs | 10 +- .../codegen/CodeGenSlicer.cs | 8 +- .../DocxFormatCodeGen/codegen/CodeGenXmlJS.cs | 8 +- .../DocxFormatCodeGen/codegen/CodegenCPP.cs | 12 +- .../codegen/CodegenXmlJSFiles.cs | 2 +- .../FilesSort/FilesSort/CodeFile1.cs | 2 +- .../PdfSorter/FontEngineTester/Form1.cs | 4 +- Test/Applications/StandardTester/main.cpp | 2 +- .../TestDownloader/downloader.pro | 2 +- .../gradient/Gradient/mainwindow.cpp | 2 +- TxtFile/Source/ConvertTxt2Docx.cpp | 4 +- TxtFile/Source/TxtFormat/File.cpp | 2 +- TxtFile/Source/TxtFormat/File.h | 4 +- TxtFile/Source/TxtFormat/TxtFile.cpp | 4 +- TxtFile/Source/TxtFormat/TxtFile.h | 2 +- X2tConverter/README.md | 2 +- X2tConverter/src/ASCConverters.cpp | 4 +- X2tConverter/src/cextracttools.cpp | 4 +- X2tConverter/src/cextracttools.h | 6 +- X2tConverter/src/lib/crypt.h | 6 +- X2tConverter/src/lib/csv.h | 2 +- X2tConverter/src/lib/docx.h | 2 +- X2tConverter/src/lib/odf.h | 8 +- X2tConverter/src/lib/pdf_image.h | 2 +- X2tConverter/src/lib/pptx.h | 2 +- X2tConverter/src/lib/rtf.h | 2 +- X2tConverter/src/lib/vsdx.h | 2 +- X2tConverter/src/lib/xlsx.h | 4 +- XpsFile/XpsFile.cpp | 4 +- XpsFile/XpsLib/Document.cpp | 6 +- XpsFile/XpsLib/FontList.h | 2 +- XpsFile/XpsLib/StaticResources.cpp | 4 +- XpsFile/XpsLib/Utils.cpp | 64 +- XpsFile/XpsLib/XpsPage.cpp | 20 +- 950 files changed, 7092 insertions(+), 7093 deletions(-) diff --git a/Apple/IWork.cpp b/Apple/IWork.cpp index bf1d9e2f65..3a4d7f8e00 100644 --- a/Apple/IWork.cpp +++ b/Apple/IWork.cpp @@ -53,7 +53,7 @@ bool GetRVNGInputStream(const DATA_TYPE_INPUTFILE& sFile, std::shared_ptrAddStyle(arSelectors[i].m_wsStyle, i + 1, true); - // Скидываем некоторые внешние стили, которые внутри таблицы переопределяются + // Reset some external styles that are overridden inside the table if (bInTable && i < arSelectors.size() - 1) { arSelectors[i].m_pCompiledStyle->m_oFont.GetLineHeight().Clear(); @@ -637,7 +637,7 @@ namespace NSCSS void CCssCalculator_Private::SetPageData(NSProperties::CPage &oPage, const std::map &mData, unsigned int unLevel, bool bHardMode) { - //TODO:: пересмотреть данный метод + //TODO:: review this method m_oStyleStorage.SetPageData(oPage, mData, unLevel, bHardMode); } diff --git a/Common/3dParty/html/css/src/CNode.h b/Common/3dParty/html/css/src/CNode.h index ed939c2cbe..9ed1bd7231 100644 --- a/Common/3dParty/html/css/src/CNode.h +++ b/Common/3dParty/html/css/src/CNode.h @@ -13,12 +13,12 @@ namespace NSCSS class CNode { public: - std::wstring m_wsName; // Имя тэга - std::wstring m_wsClass; // Класс тэга - std::wstring m_wsId; // Id тэга - std::wstring m_wsStyle; // Стиль тэга - std::map m_mAttributes; // Остальные аттрибуты тэга - //TODO:: возможно использование std::wstring излишне + std::wstring m_wsName; // Tag name + std::wstring m_wsClass; // Tag class + std::wstring m_wsId; // Tag id + std::wstring m_wsStyle; // Tag style + std::map m_mAttributes; // Other tag attributes + //TODO:: perhaps using std::wstring is excessive #ifdef CSS_CALCULATOR_WITH_XHTML CCompiledStyle *m_pCompiledStyle; diff --git a/Common/3dParty/html/css/src/CUnitMeasureConverter.cpp b/Common/3dParty/html/css/src/CUnitMeasureConverter.cpp index 374929dcc2..97b60a4eed 100644 --- a/Common/3dParty/html/css/src/CUnitMeasureConverter.cpp +++ b/Common/3dParty/html/css/src/CUnitMeasureConverter.cpp @@ -23,7 +23,7 @@ namespace NSCSS case NSCSS::Inch: return dValue / (double)ushDPI; case NSCSS::Peak: - return dValue * 6. / (double)ushDPI; // 1 дюйм = 6 пик + return dValue * 6. / (double)ushDPI; // 1 inch = 6 picas case NSCSS::Twips: return dValue * 1440. / (double)ushDPI; default: @@ -36,17 +36,17 @@ namespace NSCSS switch (enUnitMeasure) { case NSCSS::Point: - return dValue * 28.3465 ; // 1 см = (2.54 / 72) пункта + return dValue * 28.3465 ; // 1 cm = (2.54 / 72) points case NSCSS::Pixel: return dValue * (double)ushDPI / 2.54; case NSCSS::Millimeter: return dValue * 10.; case NSCSS::Inch: - return dValue / 2.54; // 1 дюйм = 2.54 см + return dValue / 2.54; // 1 inch = 2.54 cm case NSCSS::Peak: return dValue * 2.36; // 2.36 = 6 / 2.54 case NSCSS::Twips: - return dValue * 567.; // 1 см = (1440 / 2.54) твипов + return dValue * 567.; // 1 cm = (1440 / 2.54) twips default: return dValue; } @@ -57,7 +57,7 @@ namespace NSCSS switch (enUnitMeasure) { case NSCSS::Point: - return dValue * 2.8346; // 1 мм = (25.4 / 72) пункта + return dValue * 2.8346; // 1 mm = (25.4 / 72) points case NSCSS::Pixel: return dValue * (double)ushDPI / 25.4; case NSCSS::Cantimeter: @@ -82,7 +82,7 @@ namespace NSCSS case NSCSS::Pixel: return dValue * (double)ushDPI; case NSCSS::Cantimeter: - return dValue * 2.54; // 1 дюйм = 2.54 см + return dValue * 2.54; // 1 inch = 2.54 cm case NSCSS::Millimeter: return dValue * 25.4; case NSCSS::Peak: @@ -105,9 +105,9 @@ namespace NSCSS case NSCSS::Millimeter: return dValue * 0.3528; case NSCSS::Inch: - return dValue / 72.; // 1 дюйм = 72 пункта + return dValue / 72.; // 1 inch = 72 points case NSCSS::Peak: - return dValue * 0.0833; // 0.0833 = 6 / 72 (1 пункт = 1/72 дюйма) + return dValue * 0.0833; // 0.0833 = 6 / 72 (1 point = 1/72 inch) case NSCSS::Twips: return dValue * 20.; // 20 = 1440 / 72 default: @@ -122,7 +122,7 @@ namespace NSCSS case NSCSS::Point: return dValue * 12.; // 12 = 72 / 6 case NSCSS::Pixel: - return dValue * (double)ushDPI / 6.; // 1 дюйм = 6 пика + return dValue * (double)ushDPI / 6.; // 1 inch = 6 picas case NSCSS::Cantimeter: return dValue * 0.423; // 0.423 = 2.54 / 6 case NSCSS::Millimeter: @@ -143,7 +143,7 @@ namespace NSCSS case NSCSS::Point: return dValue * 0.05; // 0.05 = 72. / 1440. case NSCSS::Pixel: - return dValue * (double)ushDPI / 1440.; // 1 дюйм = 1440 твипов + return dValue * (double)ushDPI / 1440.; // 1 inch = 1440 twips case NSCSS::Cantimeter: return dValue * 0.001764; // 0.001764 = 2.54 / 1440 case NSCSS::Millimeter: diff --git a/Common/3dParty/html/css/src/StaticFunctions.cpp b/Common/3dParty/html/css/src/StaticFunctions.cpp index 4ef042783b..d35f10bdf9 100644 --- a/Common/3dParty/html/css/src/StaticFunctions.cpp +++ b/Common/3dParty/html/css/src/StaticFunctions.cpp @@ -16,14 +16,14 @@ namespace NS_STATIC_FUNCTIONS std::string GetContentAsUTF8(const std::wstring& sFileName) { std::string sContent; - // читаем файл как есть. utf-8 тут просто название. + // read file as-is. utf-8 here is just a name. if(!NSFile::CFileBinary::ReadAllTextUtf8A(sFileName, sContent)) return sContent; std::string sEncoding; if (true) { - // определяем кодировку + // determine encoding const std::string::size_type& posCharset = sContent.find("@charset"); if (std::string::npos != posCharset) diff --git a/Common/3dParty/html/css/src/StyleProperties.cpp b/Common/3dParty/html/css/src/StyleProperties.cpp index 045d09195e..078244ee24 100644 --- a/Common/3dParty/html/css/src/StyleProperties.cpp +++ b/Common/3dParty/html/css/src/StyleProperties.cpp @@ -392,8 +392,8 @@ namespace NSCSS std::wstring wsNewValue = wsValue; - const bool bImportant{CutImportant(wsNewValue)}; //TODO:: иногда мы знаем, что "!important" точно не встретится - // возможно стоит добавить ещё метод + const bool bImportant{CutImportant(wsNewValue)}; //TODO:: sometimes we know that "!important" definitely won't occur + // perhaps should add another method if (m_bImportant && !bImportant) return false; @@ -1068,7 +1068,7 @@ namespace NSCSS } case TransformRotate: { - //TODO:: добавить реализацию + //TODO:: add implementation wsValue = L"rotate("; break; } @@ -2547,7 +2547,7 @@ namespace NSCSS bool CFont::SetValue(const std::wstring &wsValue, unsigned int unLevel, bool bHardMode) { - //TODO:: скорее всего стоит переделать парсинг строки со шрифтом + //TODO:: probably should redo font string parsing const std::vector arValues = NSCSS::NS_STATIC_FUNCTIONS::GetWordsW(wsValue, false, L" ,/"); unsigned short ushPosition = 0; diff --git a/Common/3dParty/html/css/src/StyleProperties.h b/Common/3dParty/html/css/src/StyleProperties.h index 8d62be17b6..4ce7d0a258 100644 --- a/Common/3dParty/html/css/src/StyleProperties.h +++ b/Common/3dParty/html/css/src/StyleProperties.h @@ -859,7 +859,7 @@ namespace NSCSS CDigit m_oSize; CDigit m_oLineHeight; CString m_oFamily; - //TODO:: возможно стоит перейти в слудующих переменных на enum + //TODO:: perhaps should switch to enum for the following variables CString m_oStretch; CString m_oStyle; CString m_oVariant; diff --git a/Common/3dParty/html/css/src/xhtml/CDocumentStyle.cpp b/Common/3dParty/html/css/src/xhtml/CDocumentStyle.cpp index a1e048a816..153d2911fc 100644 --- a/Common/3dParty/html/css/src/xhtml/CDocumentStyle.cpp +++ b/Common/3dParty/html/css/src/xhtml/CDocumentStyle.cpp @@ -9,7 +9,7 @@ #include #define DEFAULT_LINEHEIGHT 240 -#define LINEHEIGHTSCALE 10 // Значение LineHeight в OOXML должно быть в 10 раз больше чем указано в стиле +#define LINEHEIGHTSCALE 10 // LineHeight value in OOXML must be 10 times larger than specified in style #define VALUE_TO_INT(value, unit_measure) \ (NSCSS::UnitMeasure::None != value.GetUnitMeasure()) ? \ @@ -454,7 +454,7 @@ namespace NSCSS int nWidth = static_cast(std::round(oBorder.GetWidth().ToDouble(Point) * 8.)); if (L"double" == wsStyle) - nWidth /= 3; // в ooxml double граница формируется из трёх линий + nWidth /= 3; // in ooxml double border is formed from three lines if (nWidth <= 3) nWidth = 2; @@ -497,7 +497,7 @@ namespace NSCSS return bResult; if (!oStyle.m_oFont.GetSize().Empty()) - oXmlElement.AddPropertiesInR(RProperties::R_Sz, std::to_wstring(static_cast(oStyle.m_oFont.GetSize().ToDouble(NSCSS::Point) * 2. * oStyle.m_oTransform.GetMatrix().GetFinalValue().sy() + 0.5))); // Значения шрифта увеличивает на 2 + oXmlElement.AddPropertiesInR(RProperties::R_Sz, std::to_wstring(static_cast(oStyle.m_oFont.GetSize().ToDouble(NSCSS::Point) * 2. * oStyle.m_oTransform.GetMatrix().GetFinalValue().sy() + 0.5))); // Font value is multiplied by 2 if (oStyle.m_oText.GetDecoration().m_oLine.Underline()) oXmlElement.AddPropertiesInR(RProperties::R_U, (!oStyle.m_oText.GetDecoration().m_oStyle.Empty()) ? oStyle.m_oText.GetDecoration().m_oStyle.ToWString() : L"single"); diff --git a/Common/3dParty/html/css/tests/test.cpp b/Common/3dParty/html/css/tests/test.cpp index 2ddf52a0dd..3e8c61fa7c 100644 --- a/Common/3dParty/html/css/tests/test.cpp +++ b/Common/3dParty/html/css/tests/test.cpp @@ -371,10 +371,10 @@ int main(int argc, char *argv[]) } std::cout << "-----END-----" << std::endl; -// Тесты багов +// Bug tests /* - // Стандарный katana_parser не считывает @page - // Также, если заккомитить всё, что было до тестов бага, то всё будет крашиться с ошибкой "-1073741819" + // Standard katana_parser doesn't read @page + // Also, if you uncomment everything before bug tests, it will crash with error "-1073741819" const char* css = "#page{margin:10px; padding:5pt} " "@page{color:white;}"; @@ -382,7 +382,7 @@ int main(int argc, char *argv[]) katana_dump_output(output); katana_destroy_output(output); - // Из-за того, что стандарный katana_parser не считывает @page, не считывает и CCssCalculator + // Because standard katana_parser doesn't read @page, CCssCalculator doesn't read it either std::wstring sFilePath = NSFile::GetProcessDirectory() + L"../../../../cssFiles/test.css"; NSCSS::CCssCalculator oCSS; diff --git a/Common/3dParty/html/htmltoxhtml.cpp b/Common/3dParty/html/htmltoxhtml.cpp index 5b1b9d2d6c..5363122372 100644 --- a/Common/3dParty/html/htmltoxhtml.cpp +++ b/Common/3dParty/html/htmltoxhtml.cpp @@ -233,13 +233,13 @@ static void ReadMht(const std::string& sMhtContent, std::map + // Styles are enclosed in "); } - // Картинки + // Images else if ((NSStringFinder::Find(sContentType, "image") /*|| NSStringFinder::Equals(sExtention, L"gif")*/ || NSStringFinder::Equals(sContentType, "application/octet-stream")) && NSStringFinder::Equals(sContentEncoding, "base64")) { @@ -295,7 +295,7 @@ static std::string mhtTohtml(const std::string& sFileContent) std::map sRes; NSStringUtils::CStringBuilderA oRes; - // Поиск boundary + // Search for boundary NSStringFinder::TFoundedData oData{NSStringFinder::FindProperty(sFileContent, "boundary", {"="}, {"\\r", "\\n", "\""})}; size_t nFound{oData.m_unEndPosition}; @@ -318,7 +318,7 @@ static std::string mhtTohtml(const std::string& sFileContent) nFound = sFileContent.find(sBoundary, nFound) + nBoundaryLength; - // Цикл по boundary + // Loop through boundary while(nFound != std::string::npos) { nFoundEnd = sFileContent.find(sBoundary, nFound + nBoundaryLength); @@ -369,7 +369,7 @@ static std::string mhtTohtml(const std::string& sFileContent) return sFile; } -// Заменяет сущности &,<,> в text +// Replaces entities &,<,> in text static void substitute_xml_entities_into_text(std::string& text) { // replacing & must come first @@ -393,7 +393,7 @@ static void remove_control_symbols(std::string& text) } } -// Заменяет сущности " в text +// Replaces entity " in text static void substitute_xml_entities_into_attributes(std::string& text) { remove_control_symbols(text); @@ -522,7 +522,7 @@ static void prettyprint_contents(GumboNode* node, NSStringUtils::CStringBuilderA remove_control_symbols(val); substitute_xml_entities_into_text(val); - // Избавление от FF + // Remove FF (form feed) size_t found = val.find_first_of("\014"); while(found != std::string::npos) { @@ -541,7 +541,7 @@ static void prettyprint_contents(GumboNode* node, NSStringUtils::CStringBuilderA } else if (child->type != GUMBO_NODE_COMMENT) { - // Сообщение об ошибке + // Error message // Does this actually exist: (child->type == GUMBO_NODE_CDATA) // fprintf(stderr, "unknown element of type: %d\n", child->type); } @@ -600,7 +600,7 @@ static void prettyprint(GumboNode* node, NSStringUtils::CStringBuilderA& oBuilde std::wstring htmlToXhtml(std::string& sFileContent, bool bNeedConvert) { if (bNeedConvert) - { // Определение кодировки + { // Encoding detection std::string sEncoding = NSStringFinder::FindProperty(sFileContent, "charset", {"="}, {";", "\\n", "\\r", " ", "\"", "'"}).m_sValue; if (sEncoding.empty()) @@ -613,18 +613,18 @@ std::wstring htmlToXhtml(std::string& sFileContent, bool bNeedConvert) } } - // Избавляемся от лишних символов до <... + // Remove extra characters before <... boost::regex oRegex("<[a-zA-Z]"); boost::match_results oResult; if (boost::regex_search(sFileContent, oResult, oRegex)) sFileContent.erase(0, oResult.position()); - //Избавление от + //Remove while (NSStringFinder::RemoveEmptyTag(sFileContent, "a")); - //Избавление от + //Remove <title ... /> while (NSStringFinder::RemoveEmptyTag(sFileContent, "title")); - //Избавление от <script ... /> + //Remove <script ... /> while (NSStringFinder::RemoveEmptyTag(sFileContent, "script")); // Gumbo @@ -635,7 +635,7 @@ std::wstring htmlToXhtml(std::string& sFileContent, bool bNeedConvert) NSStringUtils::CStringBuilderA oBuilder; prettyprint(output->document, oBuilder); - // Конвертирование из string utf8 в wstring + // Convert from string utf8 to wstring return UTF8_TO_U(oBuilder.GetData()); } @@ -651,7 +651,7 @@ std::wstring mhtToXhtml(std::string& sFileContent) NSStringUtils::CStringBuilderA oBuilder; prettyprint(output->document, oBuilder); - // Конвертирование из string utf8 в wstring + // Convert from string utf8 to wstring return UTF8_TO_U(oBuilder.GetData()); } } diff --git a/Common/3dParty/hunspell/wasm/js/spell.js b/Common/3dParty/hunspell/wasm/js/spell.js index ebf457785c..a6d193c07c 100644 --- a/Common/3dParty/hunspell/wasm/js/spell.js +++ b/Common/3dParty/hunspell/wasm/js/spell.js @@ -65,7 +65,7 @@ function onMessageEvent(data, port) if (1 < self.spellchecker.messages.length) { - // значит еще грузим что-то + // means we're still loading something return; } @@ -276,7 +276,7 @@ function Spellchecker() var readyLang = this.readyLanguages[lang_key]; if (!readyLang) { - // начнем грузить + // start loading var langToReady = new Dictionary(); langToReady.id = lang_key; langToReady.language = this.languages[lang_key]; @@ -289,20 +289,20 @@ function Spellchecker() } else if (readyLang.status != 2) { - // ждем + // waiting isReady = false; break; } else { - // все готово. + // all ready. continue; } } if (!isReady) { - // ждем + // waiting return; } diff --git a/Common/3dParty/hunspell/wasm/src/engine.h b/Common/3dParty/hunspell/wasm/src/engine.h index 6c489aa2fe..94cb4eae09 100644 --- a/Common/3dParty/hunspell/wasm/src/engine.h +++ b/Common/3dParty/hunspell/wasm/src/engine.h @@ -86,7 +86,7 @@ public: char* pRealloc = (char*)realloc(m_pData, m_lSize * sizeof(char)); if (NULL != pRealloc) { - // реаллок сработал + // realloc succeeded m_pData = pRealloc; m_pDataCur = m_pData + m_lSizeCur; } diff --git a/Common/3dParty/openssl/common/common_openssl.cpp b/Common/3dParty/openssl/common/common_openssl.cpp index 5b73381927..35406e2ad9 100644 --- a/Common/3dParty/openssl/common/common_openssl.cpp +++ b/Common/3dParty/openssl/common/common_openssl.cpp @@ -673,8 +673,8 @@ namespace NSOpenSSL #define GCM_IV_LENGTH 12 #define GCM_TAG_LENGHT 16 - // для того, чтобы мы могли менять алгоритмы, в зависимости от версии - // на шифровке - дописываем хедер. сделано на этом уровне, чтобы лишний раз не выделять/копировать память + // so that we can change algorithms depending on the version + // on encryption - we append header. done at this level to avoid unnecessary memory allocation/copying std::string g_aes_header = "VER2;"; unsigned char* PBKDF2_desktop_GCM(const std::string& pass, const std::string& salt) diff --git a/Common/3dParty/pole/pole.cpp b/Common/3dParty/pole/pole.cpp index fbbd2a4b3d..006f74c28a 100644 --- a/Common/3dParty/pole/pole.cpp +++ b/Common/3dParty/pole/pole.cpp @@ -399,7 +399,7 @@ void Header::load( const unsigned char* buffer ) { num_mbat = readU32( buffer + 0x48 ); // [48H,04] number of SECTs in the DIFAT chain if (threshold == 0) - threshold = 4096; //поле не задано ... файл xls от полльзователя + threshold = 4096; //field not set ... xls file from user for( unsigned int i = 0; i < 8; i++ ) id[i] = buffer[i]; diff --git a/Common/Base64.h b/Common/Base64.h index 4e21fc14dc..05cf8c4ed6 100644 --- a/Common/Base64.h +++ b/Common/Base64.h @@ -287,7 +287,7 @@ static bool Base64Decode(const char* szSrc, int nSrcLen, BYTE *& pbDest, int *pn { unsigned int index= in[i]-43; if (index>=FF_ARRAY_ELEMS(map2) || map2[index] == 0xff) - return false; ///???? было -1 + return false; ///???? was -1 v = (v << 6) + map2[index]; if (i & 3) { if (dst - out < out_size) { diff --git a/Common/FileWriter.h b/Common/FileWriter.h index 9a0c9b8fbf..5154b7cc3f 100644 --- a/Common/FileWriter.h +++ b/Common/FileWriter.h @@ -57,9 +57,9 @@ namespace NFileWriter NSFile::CFileBinary m_oFile; - LONG64 m_lBufferSize; // Размер буффера - BYTE* m_lpBuffer; // Сам буффер - LONG64 m_lWritePointer; // Позиция для записи данных в буффер + LONG64 m_lBufferSize; // Buffer size + BYTE* m_lpBuffer; // The buffer itself + LONG64 m_lWritePointer; // Position for writing data to the buffer public : diff --git a/Common/Network/FileTransporter/src/FileTransporter_curl.cpp b/Common/Network/FileTransporter/src/FileTransporter_curl.cpp index 925201f7cc..c84d44f391 100644 --- a/Common/Network/FileTransporter/src/FileTransporter_curl.cpp +++ b/Common/Network/FileTransporter/src/FileTransporter_curl.cpp @@ -121,7 +121,7 @@ namespace NSNetwork // Install the callback function //curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_func); #if defined(__linux__) - //в linux нет встроенных в систему корневых сертификатов, поэтому отключаем проверку + //linux has no built-in root certificates, so we disable verification //http://curl.haxx.se/docs/sslcerts.html curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); #endif @@ -181,7 +181,7 @@ namespace NSNetwork curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer); #if defined(__linux__) - //в linux нет встроенных в систему корневых сертификатов, поэтому отключаем проверку + //linux has no built-in root certificates, so we disable verification //http://curl.haxx.se/docs/sslcerts.html curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); #endif diff --git a/Common/Network/FileTransporter/src/FileTransporter_private.h b/Common/Network/FileTransporter/src/FileTransporter_private.h index 9de9dd28c2..8d07bf38b1 100644 --- a/Common/Network/FileTransporter/src/FileTransporter_private.h +++ b/Common/Network/FileTransporter/src/FileTransporter_private.h @@ -115,13 +115,13 @@ namespace NSNetwork virtual int UploadData() = 0; public: - std::wstring m_sDownloadFilePath; // Путь к сохраненному файлу на диске - std::wstring m_sDownloadFileUrl;// Ссылка на скачивание файла - std::wstring m_sUploadFilePath; // Путь к файлу для выгрузки на сервер - std::wstring m_sUploadUrl; // URL для выгрузки данных + std::wstring m_sDownloadFilePath; // Path to saved file on disk + std::wstring m_sDownloadFileUrl;// Download file URL + std::wstring m_sUploadFilePath; // Path to file for upload to server + std::wstring m_sUploadUrl; // URL for data upload - bool m_bComplete; // Закачался файл или нет - bool m_bDelete; // Удалять ли файл в деструкторе + bool m_bComplete; // Whether file is downloaded or not + bool m_bDelete; // Delete file in destructor? typedef enum LoadType { @@ -130,12 +130,12 @@ namespace NSNetwork UPLOADDATA } LoadType; - LoadType m_eLoadType; // Тип загрузки/выгрузки данных/файла + LoadType m_eLoadType; // Load/upload type for data/file - const unsigned char* m_cData; // Данные в сыром виде для выгрузки - int m_nSize; // Размер данных + const unsigned char* m_cData; // Raw data for upload + int m_nSize; // Data size - std::wstring m_sResponse = L""; // Ответ сервера + std::wstring m_sResponse = L""; // Server response std::function<void(int)> m_func_onComplete = nullptr; std::function<void(int)> m_func_onProgress = nullptr; @@ -143,13 +143,13 @@ namespace NSNetwork CSession* m_pSession; - // std::atomic<bool>* m_bIsExit; // Для остановки и выхода потока + // std::atomic<bool>* m_bIsExit; // For stopping and exiting the thread }; class CFileTransporter_private : public NSThreads::CBaseThread { protected: - // создаем в зависимости от платформы + // create depending on platform CFileTransporterBase* m_pInternal; public: diff --git a/Common/Network/FileTransporter/src/FileTransporter_win.cpp b/Common/Network/FileTransporter/src/FileTransporter_win.cpp index d3c7340ec9..0be1ffe798 100644 --- a/Common/Network/FileTransporter/src/FileTransporter_win.cpp +++ b/Common/Network/FileTransporter/src/FileTransporter_win.cpp @@ -45,16 +45,16 @@ //------------------------------------------------------------------------------------------------------ -// Константа для максимального числа символов в строке +// Constant for maximum number of characters in a string #define MAX_SIZE 256 -// Константа для максимального числа загружаемых байт +// Constant for maximum number of downloadable bytes #define DOWNLOAD_FILE_SIZE 32768 #define MAX_SINGLE_DOWNLOAD_FILE_SIZE 524288 -// Константа для получения размера файла +// Constant for getting file size #define CONTENT_RANGE L"bytes 0-0/" -// Константа для колличества символов у CONTENT_RANGE +// Constant for CONTENT_RANGE character count #define CONTENT_RANGE_SIZE ( 11/*sizeof ( CONTENT_RANGE )*/ - 1 ) namespace NSNetwork @@ -134,10 +134,10 @@ namespace NSNetwork } protected: - FILE * m_pFile = nullptr; // Хэндл на временный файл + FILE * m_pFile = nullptr; // Handle to temporary file unsigned int _DownloadFile(std::wstring sFileUrl) { - // Проверяем состояние соединения + // Check connection state if ( FALSE == InternetGetConnectedState ( 0, 0 ) ) return S_FALSE; @@ -154,67 +154,67 @@ namespace NSNetwork m_sDownloadFilePath = std::wstring( sTempFile ); - // Открываем сессию + // Open session HINTERNET hInternetSession = InternetOpenW ( L"Mozilla/4.0 (compatible; MSIE 5.0; Windows 98)", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0 ); if ( NULL == hInternetSession ) return S_FALSE; - // Заголовок запроса ( пока содержит 0 байт ( необходимо для проверки ) ) + // Request header (currently contains 0 bytes, needed for verification) std::wstring sHTTPHdr = L"Range: bytes=0-0"; - // Открываем ссылку для проверки на ее существование, а также на возможность чтения частями + // Open URL to check its existence and ability to read in chunks HINTERNET hInternetOpenURL = InternetOpenUrlW ( hInternetSession, sFileUrl.c_str(), sHTTPHdr.c_str(), -1, INTERNET_FLAG_RESYNCHRONIZE, 0 ); if ( NULL != hInternetOpenURL ) { - // Открытие произошло, проверяем ответ + // Opened successfully, check response if ( TRUE == QueryStatusCode ( hInternetOpenURL, TRUE ) ) { - // Запрос прошел удачно, проверяем возможность чтения частями и получаем размер данных + // Request succeeded, check ability to read in chunks and get data size LONGLONG nFileSize = IsAccept_Ranges ( hInternetOpenURL ); - // Закрываем хендл + // Close handle InternetCloseHandle ( hInternetOpenURL ); if ( -1 == nFileSize ) { - // Чтение частями недоступно - // Закрываем хендл соединения + // Reading in chunks is not available + // Close connection handle InternetCloseHandle ( hInternetSession ); - // Закрываем файл (сделается на DownloadAll) - // Попробуем записать его целиком + // Close file (will be done in DownloadAll) + // Try to write it entirely return S_FALSE; } else { - // Чтение частями доступно + // Reading in chunks is available LONGLONG nStartByte = 0; while ( true ) { - // Если закачали весь файл - то выходим + // If entire file is downloaded - exit if ( nStartByte == nFileSize - 1 ) { - // Закрываем хендл соединения + // Close connection handle InternetCloseHandle ( hInternetSession ); return S_OK; } LONGLONG nEndByte = nStartByte + DOWNLOAD_FILE_SIZE; - // Если файл заканчивается, то загружаем меньшее колличество байт ( на 1 меньше, чем размер, т.к. начинается с 0 ) + // If file is ending, download fewer bytes (1 less than size, since it starts from 0) if ( nEndByte >= nFileSize ) nEndByte = nFileSize - 1; - // Буффер для закачки + // Download buffer BYTE arrBuffer [ DOWNLOAD_FILE_SIZE ] = { 0 }; DWORD dwBytesDownload = DownloadFilePath ( hInternetSession, arrBuffer, nStartByte, nEndByte, sFileUrl ); nStartByte = nEndByte; if ( -1 == dwBytesDownload ) { - // Ничего не прочиталось - это плохо!!!! - // Закрываем хендл соединения + // Nothing was read - this is bad!!!! + // Close connection handle InternetCloseHandle ( hInternetSession ); - // Закрываем файл (сделается на DownloadAll) - // Попробуем записать его целиком + // Close file (will be done in DownloadAll) + // Try to write it entirely return S_FALSE; } - // Пишем в файл + // Write to file ::fwrite( (BYTE*)arrBuffer, 1, dwBytesDownload, m_pFile ); ::fflush( m_pFile ); @@ -224,62 +224,62 @@ namespace NSNetwork } else { - // Закрываем хендл соединения + // Close connection handle InternetCloseHandle ( hInternetSession ); - // Закрываем файл (сделается на DownloadAll) - // Попробуем записать его целиком + // Close file (will be done in DownloadAll) + // Try to write it entirely return S_FALSE; } } else { - // Закрываем хендл соединения + // Close connection handle InternetCloseHandle ( hInternetSession ); - // Закрываем файл (сделается на DownloadAll) - // Попробуем записать его целиком + // Close file (will be done in DownloadAll) + // Try to write it entirely return S_FALSE; } - // Закрываем хендл соединения + // Close connection handle InternetCloseHandle ( hInternetSession ); return S_OK; } DWORD DownloadFilePath ( HINTERNET hInternet, LPBYTE pBuffer, LONGLONG nStartByte, LONGLONG nEndByte, std::wstring sFileURL ) { - // Неоткрытая сессия + // Session not opened if ( NULL == hInternet ) return -1; - // Пришли непонятные параметры + // Invalid parameters received if ( nStartByte > nEndByte || !pBuffer ) return -1; - // Заголовок запроса ( содержит nEndByte - nStartByte байт ) + // Request header (contains nEndByte - nStartByte bytes) std::wstring sHTTPHdr = L"Range: bytes=" + std::to_wstring(nStartByte) + L"-" + std::to_wstring(nEndByte); - // Открываем ссылку для закачки + // Open URL for download HINTERNET hInternetOpenURL = InternetOpenUrlW ( hInternet, sFileURL.c_str(), sHTTPHdr.c_str(), -1, INTERNET_FLAG_RESYNCHRONIZE, 0 ); if ( NULL == hInternetOpenURL ) return -1; - // Открытие произошло, проверяем ответ + // Opened successfully, check response if ( FALSE == QueryStatusCode ( hInternetOpenURL, TRUE ) ) { - // Закрываем хендл соединения + // Close connection handle InternetCloseHandle ( hInternetOpenURL ); return -1; } - // Какое колличество байт прочитано + // Number of bytes read DWORD dwBytesRead = 0; - // Читаем файл + // Read file if ( FALSE == InternetReadFile ( hInternetOpenURL, pBuffer, DOWNLOAD_FILE_SIZE, &dwBytesRead ) ) { - // Закрываем хендл соединения + // Close connection handle InternetCloseHandle ( hInternetOpenURL ); return -1; } - // Закрываем хендл соединения + // Close connection handle InternetCloseHandle ( hInternetOpenURL ); return dwBytesRead; @@ -287,93 +287,93 @@ namespace NSNetwork BOOL QueryStatusCode ( HINTERNET hInternet, BOOL bIsRanges ) { - // Зачем проверять у неоткрытой сессии что-то + // Why check anything for an unopened session if ( NULL == hInternet ) return FALSE; - // Результат ответа + // Response result INT nResult = 0; - // Размер данных ответа ( должно быть = 4 ) + // Response data size (should be = 4) DWORD dwLengthDataSize = 4; - // Делаем запрос, если не проходит - то возвращаем FALSE + // Make request, if it fails - return FALSE if ( FALSE == HttpQueryInfo ( hInternet, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &nResult, &dwLengthDataSize, NULL ) ) return FALSE; - // Запрос прошел, теперь проверяем код ответа + // Request succeeded, now check response code if ( HTTP_STATUS_NOT_FOUND == nResult ) { - // Объект не найден, плохая ссылка или что-то еще + // Object not found, bad link or something else return FALSE; } else if ( ( HTTP_STATUS_OK != nResult && FALSE == bIsRanges ) || ( HTTP_STATUS_PARTIAL_CONTENT != nResult && TRUE == bIsRanges ) ) { - // Запрос не прошел по какой-то причине + // Request failed for some reason return FALSE; } - // Все отлично, запрос прошел + // Everything is fine, request succeeded return TRUE; } - // Проверяет, доступно ли для ресурса чтение частями и возвращает -1 если не доступно и размер данных, если доступно + // Checks if resource supports reading in chunks and returns -1 if not available, or data size if available LONGLONG IsAccept_Ranges ( HINTERNET hInternet ) { - // Зачем проверять у неоткрытой сессии что-то + // Why check anything for an unopened session if ( NULL == hInternet ) return -1; - // Результат ответа + // Response result wchar_t arrResult [ MAX_SIZE ] = { 0 }; - // Размер данных ответа + // Response data size DWORD dwLengthDataSize = sizeof ( arrResult ); - // Делаем запрос, если не проходит - то возвращаем FALSE + // Make request, if it fails - return FALSE if ( FALSE == HttpQueryInfoW ( hInternet, HTTP_QUERY_CONTENT_RANGE, &arrResult, &dwLengthDataSize, NULL ) ) { - // Получаем последнюю ошибку + // Get last error DWORD dwLastError = GetLastError (); if ( dwLastError == ERROR_HTTP_HEADER_NOT_FOUND ) { - // Не пришел заголовок, значит ресурс не поддерживает чтение частями + // Header not received, resource doesn't support reading in chunks return -1; } - // Возникла какая-то другая ошибка - возвращаем FALSE + // Some other error occurred - return FALSE return -1; } - // Если размер 0, то заголовка нет + // If size is 0, there is no header if ( 0 >= dwLengthDataSize ) return -1; - // Приведем к std::wstring + // Convert to std::wstring std::wstring strResult ( arrResult ); - // Содержит размер данных + // Contains data size LONGLONG nFileSize = 0; try { - // Ищем индекс размера данных в строке + // Find data size index in string INT nStartIndex = (INT)strResult.find ( CONTENT_RANGE ); if ( -1 == nStartIndex ) return -1; - // Оставляем в строке только размер данных + // Leave only data size in string strResult = strResult.substr( nStartIndex + CONTENT_RANGE_SIZE ); - // Теперь получим размер данных, переводя стринг в LONGLONG + // Now get the data size by converting string to LONGLONG nFileSize = _wtoi64 ( strResult.c_str() ); - // Т.к. реально нумерация с 0 ( поэтому добавляем еще 1 байт ) + // Since numbering starts from 0 (so we add 1 more byte) if ( 0 < nFileSize ) nFileSize += 1; } catch ( ... ) { - // не нашли возвращаем ошибку + // not found, return error return -1; } - // Все отлично, ресурс поддерживает чтение частями, возвращаем размер + // All good, resource supports partial reading, return size return nFileSize; } @@ -388,7 +388,7 @@ namespace NSNetwork DownloadProgress progress; progress.func_checkAborted = m_check_aborted; progress.func_onProgress = m_func_onProgress; - // Скачиваем файл с возвратом процентов состояния + // Download file with progress percentage callback return URLDownloadToFileW (NULL, sFileURL.c_str(), strFileOutput.c_str(), NULL, static_cast<IBindStatusCallback*>(&progress)); } diff --git a/Common/Network/WebSocket/src/socketio/socketio_internal_private.h b/Common/Network/WebSocket/src/socketio/socketio_internal_private.h index a5f68b2c31..76a704dffc 100644 --- a/Common/Network/WebSocket/src/socketio/socketio_internal_private.h +++ b/Common/Network/WebSocket/src/socketio/socketio_internal_private.h @@ -46,7 +46,7 @@ namespace NSNetwork { public: std::shared_ptr<sio::client> m_socket; - // проблема закрытия сокета, пока он не приконнектился + // problem closing socket while it's not yet connected bool m_connecting_in_process; bool m_closing_in_progress; @@ -136,7 +136,7 @@ namespace NSNetwork if (!message) return; - // TODO: пока только текстовые и json команды + // TODO: for now only text and json commands switch (message->get_flag()) { case sio::message::flag_null: @@ -208,7 +208,7 @@ namespace NSNetwork { //CTemporaryCS (&m_internal->m_oCS); - // если json -то надо объект + // if json - then need object if (0 == message_str.find("{") || 0 == message_str.find("[")) { diff --git a/Common/Network/WebSocket/src/socketio/socketio_internal_private_no_tls.h b/Common/Network/WebSocket/src/socketio/socketio_internal_private_no_tls.h index 09854cbdc4..9dfd6a6212 100644 --- a/Common/Network/WebSocket/src/socketio/socketio_internal_private_no_tls.h +++ b/Common/Network/WebSocket/src/socketio/socketio_internal_private_no_tls.h @@ -50,7 +50,7 @@ namespace NSNetwork { public: std::shared_ptr<sio_no_tls::client> m_socket; - // проблема закрытия сокета, пока он не приконнектился + // problem closing socket while it's not yet connected bool m_connecting_in_process; bool m_closing_in_progress; @@ -125,7 +125,7 @@ namespace NSNetwork if (!message) return; - // TODO: пока только текстовые и json команды + // TODO: for now only text and json commands switch (message->get_flag()) { case sio_no_tls::message::flag_null: @@ -197,7 +197,7 @@ namespace NSNetwork { //CTemporaryCS (&m_internal->m_oCS); - // если json -то надо объект + // if json - then need object if (0 == message_str.find("{") || 0 == message_str.find("[")) { diff --git a/Common/OfficeDefines.h b/Common/OfficeDefines.h index b84b907e05..151524e7e1 100644 --- a/Common/OfficeDefines.h +++ b/Common/OfficeDefines.h @@ -54,19 +54,19 @@ namespace EncodingType const int BigEndian = 51; } -#define PERMISSION_PRINT ( 1 << 2 ) // Ограничение печати документа -#define PERMISSION_CHANGE ( 1 << 3 ) // Ограничение на изменение содержимого документа (текст, графика, картинки) -#define PERMISSION_COPY ( 1 << 4 ) // Ограничение на копирование документа и его содержимого +#define PERMISSION_PRINT ( 1 << 2 ) // Restriction on document printing +#define PERMISSION_CHANGE ( 1 << 3 ) // Restriction on changing document content (text, graphics, images) +#define PERMISSION_COPY ( 1 << 4 ) // Restriction on copying document and its content -//Тип печати -const int c_nPrintTypeFit = 0; //вписывать по аспекту -const int c_nPrintTypeStrech = 1; //растягивать -const int c_nPrintType100 = 2; // печатать как есть -//пример xml для функции PrintPage <PrintSettings><Mode ZoomEnable=\"0\" RotateEnable=\"0\" PrintableAreaEnable=\"0\">%d</Mode></PrintSettings> -//enable - 0; diable - 1 ( если атрибут не задан, то он берется как 0 ) -//ZoomEnable растягивать любой документ до размеров страницы -//RotateEnable поворачивать документ,если в повернутом состоянии он будет занимать большую площадь(например при c_nPrintType100) или если в обычном состоянии он не вписывает, а в повернутом вписывается -//PrintableAreaEnable печать только в области печати принтера +//Print type +const int c_nPrintTypeFit = 0; //fit by aspect ratio +const int c_nPrintTypeStrech = 1; //stretch +const int c_nPrintType100 = 2; // print as is +//xml example for PrintPage function <PrintSettings><Mode ZoomEnable=\"0\" RotateEnable=\"0\" PrintableAreaEnable=\"0\">%d</Mode></PrintSettings> +//enable - 0; disable - 1 (if attribute is not set, it defaults to 0) +//ZoomEnable stretch any document to page size +//RotateEnable rotate document if rotated state takes more area (e.g. with c_nPrintType100) or if normal state doesn't fit but rotated does +//PrintableAreaEnable print only in printer's printable area namespace TextFormatting { @@ -75,7 +75,7 @@ namespace TextFormatting const int c_nWordProcessing = 2; } -//additional param сохранения нескольких документов в один для IAVSOfficeFileConverter +//additional param for saving multiple documents into one for IAVSOfficeFileConverter const int c_nSaveModeNone = 0; const int c_nSaveModeStart = 1; const int c_nSaveModeContinue = 2; diff --git a/Common/OfficeFileErrorDescription.h b/Common/OfficeFileErrorDescription.h index 898cb85cf9..692cbb921a 100644 --- a/Common/OfficeFileErrorDescription.h +++ b/Common/OfficeFileErrorDescription.h @@ -48,39 +48,39 @@ // AVSOfficeUniversalConverter 0x0050 - 0x0075 #define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST (AVS_ERROR_FIRST + 0x0050) -#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_XML_FORMAT (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0001) //Входная XML имеет неправильный формат -#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_CREATE_TEMP_DIR (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0002) //Ошибка при создании темповой директории -#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_REMOVE_TEMP_DIR (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0003) //Ошибка при удалении темповой директории -#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_CONVERT_THIS_FORMATS (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0004) //Не поддерживается конвертация данных типов файлов -#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_LOAD_FILE (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0004) //Не поддерживается конвертация данных типов файлов -#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_SAVE_FILE (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0004) //Не поддерживается конвертация данных типов файлов -#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_ADVERTISE (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0005) //при добавлении рекламы -#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_COPY (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0006) //ошибка при копировании source в destination( копируются когда их тип совпадает ) -#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_CREATE_EXTR_DIR (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0007) //ошибка при копировании source в destination( копируются когда их тип совпадает ) +#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_XML_FORMAT (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0001) //Input XML has incorrect format +#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_CREATE_TEMP_DIR (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0002) //Error creating temp directory +#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_REMOVE_TEMP_DIR (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0003) //Error removing temp directory +#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_CONVERT_THIS_FORMATS (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0004) //Conversion of these file types is not supported +#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_LOAD_FILE (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0004) //Conversion of these file types is not supported +#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_SAVE_FILE (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0004) //Conversion of these file types is not supported +#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_ADVERTISE (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0005) //when adding advertisement +#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_COPY (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0006) //error copying source to destination (copied when their types match) +#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_CREATE_EXTR_DIR (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0007) //error copying source to destination (copied when their types match) // AVSOfficeFile 0x0075 - 0x00100 #define AVS_OFFICEFILE_ERROR_FIRST (AVS_ERROR_FIRST + 0x0075) -#define AVS_OFFICEFILE_ERROR_CREATE_TEMP (AVS_OFFICEFILE_ERROR_FIRST + 0x0001) //Ошибка при создании темповой директории или файла -#define AVS_OFFICEFILE_ERROR_UNSUPPORTED_LOAD_FORMAT (AVS_OFFICEFILE_ERROR_FIRST + 0x0002) //Формат файла не поддерживается -#define AVS_OFFICEFILE_ERROR_UNSUPPORTED_SAVE_FORMAT (AVS_OFFICEFILE_ERROR_FIRST + 0x0003) //Формат файла не поддерживается -#define AVS_OFFICEFILE_ERROR_SAVE_EMPTY (AVS_OFFICEFILE_ERROR_FIRST + 0x0004) //Формат файла не поддерживается -#define AVS_OFFICEFILE_ERROR_PRINT_OUT_OF_AREA (AVS_OFFICEFILE_ERROR_FIRST + 0x0005) //печать за границами области печати +#define AVS_OFFICEFILE_ERROR_CREATE_TEMP (AVS_OFFICEFILE_ERROR_FIRST + 0x0001) //Error creating temp directory or file +#define AVS_OFFICEFILE_ERROR_UNSUPPORTED_LOAD_FORMAT (AVS_OFFICEFILE_ERROR_FIRST + 0x0002) //File format is not supported +#define AVS_OFFICEFILE_ERROR_UNSUPPORTED_SAVE_FORMAT (AVS_OFFICEFILE_ERROR_FIRST + 0x0003) //File format is not supported +#define AVS_OFFICEFILE_ERROR_SAVE_EMPTY (AVS_OFFICEFILE_ERROR_FIRST + 0x0004) //File format is not supported +#define AVS_OFFICEFILE_ERROR_PRINT_OUT_OF_AREA (AVS_OFFICEFILE_ERROR_FIRST + 0x0005) //printing outside of print area //AVSOfficeMsFile #define AVS_MSFILE_ERROR_OLDER (AVS_ERROR_FIRST + 0x0090) // AVSOdfFile 0x0100 - 0x0200 -#define AVS_ODTFILE_ERROR_INPUT_FILE (AVS_ERROR_FIRST + 0x0100) // Ошибка в входном файле -#define AVS_ODTFILE_ERROR_ORIGIN_FILE (AVS_ERROR_FIRST + 0x0101) // Ошибка в шаблоном файле -#define AVS_ODTFILE_ERROR_CONVERT (AVS_ERROR_FIRST + 0x0102) // Ошибка при конвертации +#define AVS_ODTFILE_ERROR_INPUT_FILE (AVS_ERROR_FIRST + 0x0100) // Error in input file +#define AVS_ODTFILE_ERROR_ORIGIN_FILE (AVS_ERROR_FIRST + 0x0101) // Error in template file +#define AVS_ODTFILE_ERROR_CONVERT (AVS_ERROR_FIRST + 0x0102) // Error during conversion // AVSTxtFile 0x0200 - 0x0300 -#define AVS_TXTFILE_ERROR_INPUT_FILE (AVS_ERROR_FIRST + 0x0200) // Ошибка в входном файле -#define AVS_TXTFILE_ERROR_ORIGIN_FILE (AVS_ERROR_FIRST + 0x0201) // Ошибка в шаблоном файле -#define AVS_TXTFILE_ERROR_CONVERT (AVS_ERROR_FIRST + 0x0202) // Ошибка при конвертации +#define AVS_TXTFILE_ERROR_INPUT_FILE (AVS_ERROR_FIRST + 0x0200) // Error in input file +#define AVS_TXTFILE_ERROR_ORIGIN_FILE (AVS_ERROR_FIRST + 0x0201) // Error in template file +#define AVS_TXTFILE_ERROR_CONVERT (AVS_ERROR_FIRST + 0x0202) // Error during conversion // AVSOfficePDFWriter 0x0300 - 0x0400 diff --git a/Common/OfficeFileFormatChecker2.cpp b/Common/OfficeFileFormatChecker2.cpp index 1739368979..3571a4113b 100644 --- a/Common/OfficeFileFormatChecker2.cpp +++ b/Common/OfficeFileFormatChecker2.cpp @@ -113,7 +113,7 @@ bool COfficeFileFormatChecker::isMultiPartsHtmlFormatFile(unsigned char *pBuffer return false; const char *contentTypeFormatLine1 = "Content-Type: multipart/related"; - const char *contentTypeFormatLine2 = "Content-Type: text/html"; // может быть и вне заданого буфера (todooo) + const char *contentTypeFormatLine2 = "Content-Type: text/html"; // may be outside the given buffer (todooo) std::string xml_string((char *)pBuffer, dwBytes); @@ -706,7 +706,7 @@ bool COfficeFileFormatChecker::isOfficeFile(const std::wstring &_fileName) std::wstring fileName = _fileName; #endif - // приоритет как оказывается важен + // priority turns out to be important // Metamorphic Manual for windows 28415.doc POLE::Storage storage(fileName.c_str()); if (storage.open()) @@ -719,7 +719,7 @@ bool COfficeFileFormatChecker::isOfficeFile(const std::wstring &_fileName) } else if (isDocFormatFile(&storage)) { - // nFileType внутри + // nFileType inside return true; } else if (isXlsFormatFile(&storage)) @@ -930,7 +930,7 @@ bool COfficeFileFormatChecker::isOfficeFile(const std::wstring &_fileName) //------------------------------------------------------------------------------------------------ if (iXmlFile(fileName)) { - // nFileType внутри + // nFileType inside return true; } //// by Extension @@ -978,7 +978,7 @@ bool COfficeFileFormatChecker::isOfficeFile(const std::wstring &_fileName) nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_HTML; else if (0 == sExt.compare(L".bin")) // base64 string nFileType = AVS_OFFICESTUDIO_FILE_CANVAS_PDF; - else if (0 == sExt.compare(L".doct")) // случай архива с html viewer + else if (0 == sExt.compare(L".doct")) // case of archive with html viewer nFileType = AVS_OFFICESTUDIO_FILE_TEAMLAB_DOCY; else if (0 == sExt.compare(L".txt") || 0 == sExt.compare(L".xml") || 0 == sExt.compare(L".rtf") || 0 == sExt.compare(L".doc") || 0 == sExt.compare(L".docx")) nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_TXT; @@ -1168,7 +1168,7 @@ bool COfficeFileFormatChecker::isDocFormatFile(const std::wstring &fileName) { if (isDocFormatFile(&storage)) { - // nFileType внутри; + // nFileType inside; return true; } } @@ -1191,7 +1191,7 @@ bool COfficeFileFormatChecker::isOnlyOfficeFormatFile(const std::wstring &fileNa { COfficeUtils OfficeUtils(NULL); - ULONG nBufferSize = 128; // ограничим считывание из бинарника + ULONG nBufferSize = 128; // limit reading from binary BYTE *pBuffer = NULL; HRESULT hresult = OfficeUtils.LoadFileFromArchive(fileName, L"Editor.bin", &pBuffer, nBufferSize); @@ -1541,7 +1541,7 @@ bool COfficeFileFormatChecker::isOpenOfficeFormatFile(const std::wstring &fileNa } else { - // если не записан тип смотрим манифест + // if type is not written, check manifest nBufferSize = 0; HRESULT hresult = OfficeUtils.LoadFileFromArchive(fileName, L"META-INF/manifest.xml", &pBuffer, nBufferSize); if (hresult == S_OK && pBuffer != NULL) diff --git a/Common/OfficeFileFormats.h b/Common/OfficeFileFormats.h index 7e1899c9d0..40eb559fd1 100644 --- a/Common/OfficeFileFormats.h +++ b/Common/OfficeFileFormats.h @@ -131,7 +131,7 @@ #define AVS_OFFICESTUDIO_FILE_OTHER_OLD_PRESENTATION AVS_OFFICESTUDIO_FILE_OTHER + 0x0005 #define AVS_OFFICESTUDIO_FILE_OTHER_OLD_DRAWING AVS_OFFICESTUDIO_FILE_OTHER + 0x0006 #define AVS_OFFICESTUDIO_FILE_OTHER_OOXML AVS_OFFICESTUDIO_FILE_OTHER + 0x0007 -#define AVS_OFFICESTUDIO_FILE_OTHER_JSON AVS_OFFICESTUDIO_FILE_OTHER + 0x0008 // Для mail-merge +#define AVS_OFFICESTUDIO_FILE_OTHER_JSON AVS_OFFICESTUDIO_FILE_OTHER + 0x0008 // For mail-merge #define AVS_OFFICESTUDIO_FILE_OTHER_ZIP AVS_OFFICESTUDIO_FILE_OTHER + 0x0009 #define AVS_OFFICESTUDIO_FILE_OTHER_ODF AVS_OFFICESTUDIO_FILE_OTHER + 0x000a #define AVS_OFFICESTUDIO_FILE_OTHER_MS_MITCRYPTO AVS_OFFICESTUDIO_FILE_OTHER + 0x000b diff --git a/Common/js/README.md b/Common/js/README.md index 9a15212d8f..718b1a1977 100644 --- a/Common/js/README.md +++ b/Common/js/README.md @@ -1,19 +1,19 @@ -### Состав .json файла для wasm/asm модуля -- `name` — имя с которым будет собран модуль -- `res_folder` — путь, относительный .json файла, до папки куда будет собран модуль -- `wasm` — требуется ли собрать wasm модуль (*.js и *.wasm) -- `asm` — требуется ли собрать asm модуль (*_ie.js и *.js.mem) -- `run_before` — путь, относительный .json файла, до .py файла который требуется выполнить перед сборкой модуля. Или python in-line код. -- `run_after` — путь, относительный .json файла, до .py файла который требуется выполнить после сборки модуля. Или python in-line код. -- `base_js_content` — путь, относительный .json файла, до .js файла содержащего //module вместо которого будет записан собранный модуль -- `compiler_flags` — массив из флагов и опций компиляции -- `exported_functions` — массив из имён функций, которые будут вызываться из модуля -- `include_path` — массив из путей, относительных .json файла, include-ов для подключаемых файлов -- `define` — массив из дефайнов -- `compile_files_array` — массив из объектов, содержащих: - - `name` — уникальное, относительно других name в массиве compile_files_array, имя - - `folder` — путь, относительный .json файла, до папки с подключаемыми файлами - - `files` — массив из имён подключаемых файлов, расположенных в папке folder (иерархия ../ и ./*/ разрешена) - - `include_path` — необязательный массив из путей, относительных .json файла, include-ов для подключаемых файлов - - `define` — необязательный массив из дефайнов -- `sources` — необязательный массив из путей, относительных .json файла, до файлов, которым не требуется прекомпиляция. Например, .a или .o файлы. +### JSON file structure for wasm/asm module +- `name` — name with which the module will be built +- `res_folder` — path, relative to the .json file, to the folder where the module will be built +- `wasm` — whether to build wasm module (*.js and *.wasm) +- `asm` — whether to build asm module (*_ie.js and *.js.mem) +- `run_before` — path, relative to the .json file, to .py file that needs to be executed before building the module. Or python in-line code. +- `run_after` — path, relative to the .json file, to .py file that needs to be executed after building the module. Or python in-line code. +- `base_js_content` — path, relative to the .json file, to .js file containing //module which will be replaced with the built module +- `compiler_flags` — array of compilation flags and options +- `exported_functions` — array of function names that will be called from the module +- `include_path` — array of paths, relative to the .json file, for include directories +- `define` — array of defines +- `compile_files_array` — array of objects containing: + - `name` — unique name, relative to other names in compile_files_array array + - `folder` — path, relative to the .json file, to folder with included files + - `files` — array of included file names, located in folder (hierarchy ../ and ./*/ allowed) + - `include_path` — optional array of paths, relative to the .json file, for include directories + - `define` — optional array of defines +- `sources` — optional array of paths, relative to the .json file, to files that don't require precompilation. For example, .a or .o files. diff --git a/DesktopEditor/AllFontsGen/main.cpp b/DesktopEditor/AllFontsGen/main.cpp index bfa7b8c2dc..56dcbd977d 100644 --- a/DesktopEditor/AllFontsGen/main.cpp +++ b/DesktopEditor/AllFontsGen/main.cpp @@ -193,7 +193,7 @@ int main(int argc, char** argv) */ CApplicationFontsWorker oWorker; - // это не рабочая папка, где только шрифты + // this is not a working folder with only fonts oWorker.m_bIsCleanDirectory = false; oWorker.m_bIsRemoveOldThumbnails = true; diff --git a/DesktopEditor/agg-2.4/include/agg_span_gradient.h b/DesktopEditor/agg-2.4/include/agg_span_gradient.h index 0b12498763..296f9aab24 100644 --- a/DesktopEditor/agg-2.4/include/agg_span_gradient.h +++ b/DesktopEditor/agg-2.4/include/agg_span_gradient.h @@ -169,8 +169,8 @@ namespace agg private: inline agg::point_d project(const double& x, const double& y) { - // проекция точки (x, y) на прямую, с направляющим вектором (cos, sin) - // перпендикулярная прямая x*m_cos + y*m_sin + c = 0; + // projection of point (x, y) onto a line with direction vector (cos, sin) + // perpendicular line x*m_cos + y*m_sin + c = 0; double c = -(x * m_cos + y * m_sin); point_d ret; ret.x = -c * m_cos; @@ -304,7 +304,7 @@ namespace agg { if (i == 1 && t < m_pPosSubColors[0]) { - // меньше меньшего + // less than minimum m_color_table[index] = m_pSubColors[0]; bFindColor = true; break; @@ -442,7 +442,7 @@ namespace agg { if (i == 1 && t < m_pPosSubColors[0]) { - // меньше меньшего + // less than minimum m_color_table[index] = m_pSubColors[0]; bFindColor = true; break; diff --git a/DesktopEditor/agg-2.4/include/test_grads/custom_gradients.h b/DesktopEditor/agg-2.4/include/test_grads/custom_gradients.h index 98e9fc5dea..f56b1eed3e 100644 --- a/DesktopEditor/agg-2.4/include/test_grads/custom_gradients.h +++ b/DesktopEditor/agg-2.4/include/test_grads/custom_gradients.h @@ -24,20 +24,20 @@ namespace agg { /** - * Основной смысл в том, что есть два этапа обсчета, это параметризация и вычисление цвета. + * The main idea is that there are two calculation stages: parameterization and color computation. * - * В частности радиальный и линейный градиенты, требуют параметризацию, (x,y)-> t, - * чтобы затем перевести параметр в цвет. + * In particular, radial and linear gradients require parameterization, (x,y)-> t, + * to then convert the parameter to color. * - * У шейдеров параметризация опциональная, поэтому для них отдельно есть способ с параметризацией и без нее + * For shaders, parameterization is optional, so there's a separate method with and without parameterization * * */ /** - * Абстрактный класс для параметризации. + * Abstract class for parameterization. * - * Чтобы показать что данный пиксель не надо закрашивать используется nan + * To indicate that a pixel should not be filled, nan is used */ class calcBase { @@ -76,7 +76,7 @@ namespace agg }; /** - * Параметр радисального градиента. + * Radial gradient parameter. */ class calcRadial : public calcBase { @@ -189,7 +189,7 @@ namespace agg }; /** - * Параметр конусного градиента. Не используется в пдф. + * Conical gradient parameter. Not used in PDF. */ class calcConical : public calcBase { @@ -221,7 +221,7 @@ namespace agg }; /** - * Параметр квадратного градиента. Не используется в пдф. + * Diamond gradient parameter. Not used in PDF. */ class calcDiamond : public calcBase { @@ -256,7 +256,7 @@ namespace agg }; /** - * Параметр линейного градиента. + * Linear gradient parameter. */ class calcNewLinear : public calcBase { @@ -292,7 +292,7 @@ namespace agg }; /** - * Треугольный шейдинг, закрашивает всю область. + * Triangle shading, fills the entire area. */ class calcTriangle : public calcBase { @@ -310,7 +310,7 @@ namespace agg } /** - * Вычисляем веса по барицетрическим координатам + * Calculate weights using barycentric coordinates * https://codeplea.com/triangular-interpolation */ static std::vector<float> @@ -328,19 +328,19 @@ namespace agg }; /** - * Шейдинг гладкой поверхности, закрашивает только саму поверхность. + * Smooth surface shading, fills only the surface itself. * - * Алгоритм работы примерно следующий. - * Проходимся по плоскости значений параметра, и для каждой точки закрашиваем квадрат с границой. + * The algorithm works roughly as follows. + * We iterate over the parameter value plane, and for each point fill a square with boundary. * - * P(u,v), P(u + du, u + dv) - углы. + * P(u,v), P(u + du, u + dv) - corners. * - * Это позволяет изьежать вычисления обратной функции, которую можно в общем случаем почтитать только методом Ньютона. + * This allows avoiding inverse function computation, which in general can only be calculated using Newton's method. */ class calcCurve : public calcBase { public: - // В конструкторе происходит весь прекалк, т.е. экзепляр класса полностью готов к работе. + // All precalculation happens in the constructor, i.e. the class instance is fully ready to work. calcCurve(const NSStructures::GradientInfo &_g, bool calculate_tensor_coefs = true) : tensor_size(4) { ginfo = _g; @@ -413,7 +413,7 @@ namespace agg } } - // Заполняем квадрат в один цвет, чтобы небыло пропусков. + // Fill the square with one color to avoid gaps. void fill_square(std::pair<int, int> index1, std::pair<int, int> index2, float t) { for (int i = std::min(index1.first, index2.first); i <= std::max(index1.first, index2.first); i++) @@ -432,13 +432,13 @@ namespace agg { auto i = get_index(x, y); if (i.first > RES - 1 || i.second > RES - 1 || i.first < 0 || i.second < 0) - return NAN_FLOAT; // Не закрашиваем + return NAN_FLOAT; // Don't fill return precalc[i.first][i.second]; } - // Через полинамы такого вида определяется нужная нам поверхность. + // The required surface is defined through polynomials of this kind. static float berstein_polynomial(float t, int i) { switch (i) @@ -469,8 +469,8 @@ namespace agg } /** - * т.к. шестой тип шейдинга по сути является частным случаем седьмого, только с пересчетом некоторый точек. - * Этот метод позволяет вычислить нужные параметры, подробнее в стандарте пдф 208с. + * Since shading type 6 is essentially a special case of type 7, just with recalculation of some points. + * This method allows calculating the required parameters, see PDF standard page 208 for details. */ void calculate_tensor() { @@ -513,7 +513,7 @@ namespace agg /** - * Основной класс отвечающий за градиенты. + * Main class responsible for gradients. */ template <class ColorT> class gradient_base @@ -553,7 +553,7 @@ namespace agg private: - // Параметризация, с некторыми обертками. + // Parameterization with some wrappers. inline float calculate_param(const float &x, const float &y) { float t = calculate->eval(x, y); @@ -582,7 +582,7 @@ namespace agg virtual ~gradient_base() {} /** - * Выбор варианта параметризации. И получение основной инфы о градиенте. + * Selection of parameterization variant. And getting main gradient info. */ void SetGradientInfo(const NSStructures::GradientInfo &_g, Aggplus::BrushType bType) { @@ -640,7 +640,7 @@ namespace agg } /** - * Для старой цветовой функции. + * For old color function. */ void SetSubColors(const color_type *colors, const float *positions, int count) { @@ -650,7 +650,7 @@ namespace agg } /** - * Нужно для функции отрисовки. + * Needed for rendering function. */ void prepare() { @@ -662,7 +662,7 @@ namespace agg } /** - * Генерирует цвет пикселя для рендерной функции. + * Generates pixel color for render function. */ void generate(color_type *span, int x, int y, unsigned len) { @@ -715,7 +715,7 @@ namespace agg } /** - * Выставляем всякую инфу про наш градиент. + * Set various info about our gradient. */ void SetDirection(const agg::rect_d &bounds, const agg::trans_affine &trans, bool bSwapRGB) { @@ -740,7 +740,7 @@ namespace agg protected: /** - * Для старой цветовой функции + * For old color function */ void CalcColor(int index) { @@ -752,7 +752,7 @@ namespace agg { if (i == 1 && t < m_pPosSubColors[0]) { - // меньше меньшего + // less than minimum m_color_table[index] = m_pSubColors[0]; bFindColor = true; break; @@ -776,7 +776,7 @@ namespace agg } /** - * Треугольная пила, нужна для периодических градиентов. + * Triangle wave, needed for periodic gradients. */ inline float triagle_saw(float x) { @@ -784,7 +784,7 @@ namespace agg } - // Нужно для безопасного сложения цветов. + // Needed for safe color addition. int limit8bit(int a) { if (a < 0) @@ -795,12 +795,12 @@ namespace agg } - // Умножение цвета на число (теплейт поэтому не перегрузка *) + // Multiply color by number (template, so not * operator overload) ColorT mul(ColorT c1, float t) { return ColorT(limit8bit(c1.r * t), limit8bit(c1.g * t), limit8bit(c1.b * t), limit8bit(c1.a * t)); } - // Сумма двух цветов + // Sum of two colors ColorT sum(ColorT c1, ColorT c2) { return ColorT(limit8bit(c1.r + c2.r), limit8bit(c1.g + c2.g), @@ -808,8 +808,8 @@ namespace agg } /** - * Треугольная интерполяция на цветовой функции. - * Вычисляется по барицентрическим координатам. + * Triangle interpolation on color function. + * Calculated using barycentric coordinates. */ ColorT triangle(float x, float y) { @@ -826,14 +826,14 @@ namespace agg /** - * Здесь все относящееся к кривой поверхности, будет дублирование кода, зато потом в теории будет проще работать. - * И логика чуть менее запутанная. - * Основной алгоритм - разбить поверхность на множество квадратиков. И забить туда значения сразу. Чтобы обратную фнкцию не считать. + * Everything related to curved surface is here, there will be code duplication, but in theory it will be easier to work with later. + * And the logic is slightly less confusing. + * Main algorithm - split the surface into many small squares. And fill values there immediately. To avoid calculating inverse function. * - * Основня цель повтора - сделать единый интерфейс параметризации и все остальное. - * Т.к. просто добавляя разные параметризации, можно добавить большое количесво нужных градиентов. + * Main goal of repetition - create unified parameterization interface and everything else. + * Since by simply adding different parameterizations, we can add many needed gradients. * - * Все с кривыми работает так же как и параметры, только интерполируется не парамет, а цвет. + * Everything with curves works the same as parameters, only color is interpolated instead of parameter. */ std::vector<std::vector<ColorT>> precalc; @@ -853,7 +853,7 @@ namespace agg ymax_curve = ymin_curve = start_p.y; /* - * Небольшая оптимизация основанная на том, что данная фигура не выходит за границы своих опорных точек. + * Small optimization based on the fact that this shape doesn't go beyond its control points boundaries. * */ for (int i = 0; i < 4; i++) diff --git a/DesktopEditor/allthemesgen/main.cpp b/DesktopEditor/allthemesgen/main.cpp index 103198a7b9..a51d1092d1 100644 --- a/DesktopEditor/allthemesgen/main.cpp +++ b/DesktopEditor/allthemesgen/main.cpp @@ -580,7 +580,7 @@ int main(int argc, char** argv) { NSFile::CFileBinary::SaveToFile(sSrcThemesDir + L"/themes.js", L"AscCommon.g_defaultThemes = " + oBuilderJS.GetData() + L";"); - // теперь нужно пропатчить sdk-all.js + // now need to patch sdk-all.js std::wstring sPathDoctRendererConfig = sX2tPath + L"/DoctRenderer.config"; XmlUtils::CXmlNode oNode; if (bIsNeedCorrectSdkAll && oNode.FromXmlFile(sPathDoctRendererConfig)) diff --git a/DesktopEditor/common/ByteBuilder.cpp b/DesktopEditor/common/ByteBuilder.cpp index 9e1b0016f7..86a84bab89 100644 --- a/DesktopEditor/common/ByteBuilder.cpp +++ b/DesktopEditor/common/ByteBuilder.cpp @@ -70,7 +70,7 @@ namespace NSMemoryUtils BYTE* pRealloc = (BYTE*)realloc(m_pData, m_lSize * sizeof(BYTE)); if (NULL != pRealloc) { - // реаллок сработал + // realloc succeeded m_pData = pRealloc; m_pDataCur = m_pData + m_lSizeCur; } diff --git a/DesktopEditor/common/CPEncodings/CodePage1361.h b/DesktopEditor/common/CPEncodings/CodePage1361.h index efdd6e2e8f..3111856646 100644 --- a/DesktopEditor/common/CPEncodings/CodePage1361.h +++ b/DesktopEditor/common/CPEncodings/CodePage1361.h @@ -37,7 +37,7 @@ namespace NSStringExt //-- CP950 Encoding ----------------------------------------------------------------------------- #define MSCP1361_UNDEFINED 0x0000 -#define MSCP1361_LEAD_CHAR 0xFFFF // —имвол, который означает, что данный код - старший байт +#define MSCP1361_LEAD_CHAR 0xFFFF // Symbol indicating that this code is a lead byte static const unsigned short c_anUnicodeMapCP1361[] = { @@ -17129,7 +17129,7 @@ namespace NSStringExt { 0xFDFC, 0x7A00 }, // <CJK> { 0xFDFD, 0x7FB2 }, // <CJK> { 0xFDFE, 0x8A70 }, // <CJK> - { 0xFFFF, 0xFFFF } //Обозначаем конец списка + { 0xFFFF, 0xFFFF } // Mark end of list }; } diff --git a/DesktopEditor/common/CPEncodings/CodePage932.h b/DesktopEditor/common/CPEncodings/CodePage932.h index ae0db4b758..02e68c0eb0 100644 --- a/DesktopEditor/common/CPEncodings/CodePage932.h +++ b/DesktopEditor/common/CPEncodings/CodePage932.h @@ -37,7 +37,7 @@ namespace NSStringExt //-- CP932 Encoding ----------------------------------------------------------------------------- #define MSCP932_UNDEFINED 0x0000 -#define MSCP932_LEAD_CHAR 0xFFFF // —имвол, который означает, что данный код - старший байт +#define MSCP932_LEAD_CHAR 0xFFFF // Symbol indicating that this code is a lead byte static const unsigned short c_anUnicodeMapCP932[] = { @@ -7801,7 +7801,7 @@ namespace NSStringExt { 0xFC49, 0xFA2D }, //CJK COMPATIBILITY IDEOGRAPH { 0xFC4A, 0x9E19 }, //CJK UNIFIED IDEOGRAPH { 0xFC4B, 0x9ED1 }, //CJK UNIFIED IDEOGRAPH - { 0xFFFF, 0xFFFF } //Обозначаем конец списка + { 0xFFFF, 0xFFFF } // Mark end of list }; } #endif // _BUILD_CPENCODINGS_CODEPAGE932_CROSSPLATFORM_H_ \ No newline at end of file diff --git a/DesktopEditor/common/CPEncodings/CodePage936.h b/DesktopEditor/common/CPEncodings/CodePage936.h index eca85d846a..9162b17429 100644 --- a/DesktopEditor/common/CPEncodings/CodePage936.h +++ b/DesktopEditor/common/CPEncodings/CodePage936.h @@ -37,7 +37,7 @@ namespace NSStringExt //-- CP936 Encoding ----------------------------------------------------------------------------- #define MSCP936_UNDEFINED 0x0000 -#define MSCP936_LEAD_CHAR 0xFFFF // —имвол, который означает, что данный код - старший байт +#define MSCP936_LEAD_CHAR 0xFFFF // Symbol indicating that this code is a lead byte static const unsigned short c_anUnicodeMapCP936[] = { @@ -21868,7 +21868,7 @@ namespace NSStringExt { 0xFE4D, 0xFA27 }, //CJK COMPATIBILITY IDEOGRAPH { 0xFE4E, 0xFA28 }, //CJK COMPATIBILITY IDEOGRAPH { 0xFE4F, 0xFA29 }, //CJK COMPATIBILITY IDEOGRAPH - { 0xFFFF, 0xFFFF } //Обозначаем конец списка + { 0xFFFF, 0xFFFF } // Mark end of list }; } #endif // _BUILD_CPENCODINGS_CODEPAGE936_CROSSPLATFORM_H_ \ No newline at end of file diff --git a/DesktopEditor/common/CPEncodings/CodePage949.h b/DesktopEditor/common/CPEncodings/CodePage949.h index ac053a43a8..6cbd1e1b9b 100644 --- a/DesktopEditor/common/CPEncodings/CodePage949.h +++ b/DesktopEditor/common/CPEncodings/CodePage949.h @@ -37,7 +37,7 @@ namespace NSStringExt //-- CP949 Encoding ----------------------------------------------------------------------------- #define MSCP949_UNDEFINED 0x0000 -#define MSCP949_LEAD_CHAR 0xFFFF // —имвол, который означает, что данный код - старший байт +#define MSCP949_LEAD_CHAR 0xFFFF // Symbol indicating that this code is a lead byte static const unsigned short c_anUnicodeMapCP949[] = { @@ -17125,7 +17125,7 @@ namespace NSStringExt { 0xFDFC, 0x7A00 }, //CJK UNIFIED IDEOGRAPH { 0xFDFD, 0x7FB2 }, //CJK UNIFIED IDEOGRAPH { 0xFDFE, 0x8A70 }, //CJK UNIFIED IDEOGRAPH - { 0xFFFF, 0xFFFF } //Обозначаем конец списка + { 0xFFFF, 0xFFFF } // Mark end of list }; } #endif // _BUILD_CPENCODINGS_CODEPAGE949_CROSSPLATFORM_H_ \ No newline at end of file diff --git a/DesktopEditor/common/CPEncodings/CodePage950.h b/DesktopEditor/common/CPEncodings/CodePage950.h index b497dce8e4..89247d1054 100644 --- a/DesktopEditor/common/CPEncodings/CodePage950.h +++ b/DesktopEditor/common/CPEncodings/CodePage950.h @@ -37,7 +37,7 @@ namespace NSStringExt //-- CP950 Encoding ----------------------------------------------------------------------------- #define MSCP950_UNDEFINED 0x0000 -#define MSCP950_LEAD_CHAR 0xFFFF // —имвол, который означает, что данный код - старший байт +#define MSCP950_LEAD_CHAR 0xFFFF // Symbol indicating that this code is a lead byte static const unsigned short c_anUnicodeMapCP950[] = { @@ -13580,7 +13580,7 @@ namespace NSStringExt { 0xF9FC, 0x2570 }, //BOX DRAWINGS LIGHT ARC UP AND RIGHT { 0xF9FD, 0x256F }, //BOX DRAWINGS LIGHT ARC UP AND LEFT { 0xF9FE, 0x2593 }, //DARK SHADE - { 0xFFFF, 0xFFFF } //Обозначаем конец списка + { 0xFFFF, 0xFFFF } // Mark end of list }; } #endif // _BUILD_CPENCODINGS_CODEPAGE950_CROSSPLATFORM_H_ \ No newline at end of file diff --git a/DesktopEditor/common/File.cpp b/DesktopEditor/common/File.cpp index 1f90016839..979fcec9f4 100644 --- a/DesktopEditor/common/File.cpp +++ b/DesktopEditor/common/File.cpp @@ -77,7 +77,7 @@ #include <unistd.h> #endif -// реализация возможности подмены определения GetTempPath +// implementation of GetTempPath definition override capability std::wstring g_overrideTmpPath = L""; #include "File.h" @@ -1601,7 +1601,7 @@ namespace NSFile } bool CFileBinary::OpenTempFile(std::wstring *pwsName, FILE **ppFile, wchar_t *wsMode, wchar_t *wsExt, wchar_t *wsFolder, wchar_t* wsName) { - // TODO: Реализовать когда wsName != NULL + // TODO: Implement when wsName != NULL std::wstring wsTemp, wsFileName; FILE *pTempFile = NULL; diff --git a/DesktopEditor/common/StringBuilder.cpp b/DesktopEditor/common/StringBuilder.cpp index 9889131f14..7e18124859 100644 --- a/DesktopEditor/common/StringBuilder.cpp +++ b/DesktopEditor/common/StringBuilder.cpp @@ -91,7 +91,7 @@ namespace NSStringUtils char* pRealloc = (char*)realloc(m_pData, m_lSize * sizeof(char)); if (NULL != pRealloc) { - // реаллок сработал + // realloc succeeded m_pData = pRealloc; m_pDataCur = m_pData + m_lSizeCur; } @@ -241,7 +241,7 @@ namespace NSStringUtils wchar_t* pRealloc = (wchar_t*)realloc(m_pData, m_lSize * sizeof(wchar_t)); if (NULL != pRealloc) { - // реаллок сработал + // realloc succeeded m_pData = pRealloc; m_pDataCur = m_pData + m_lSizeCur; } diff --git a/DesktopEditor/common/StringExt.cpp b/DesktopEditor/common/StringExt.cpp index 7f84bf2276..d252167636 100644 --- a/DesktopEditor/common/StringExt.cpp +++ b/DesktopEditor/common/StringExt.cpp @@ -102,7 +102,7 @@ namespace NSStringExt } case SINGLE_BYTE_ENCODING_SYMBOL: { - // Добавляем 0xF000 к кодам всех символов + // Add 0xF000 to all character codes for (long i = 0; i < lCount; ++i) { pUnicode[i] = (wchar_t)(0xF000 | (unsigned char)pData[i]); @@ -317,7 +317,7 @@ namespace NSStringExt } else if (wLeading >= 0xDC00) { - // Такого не должно быть + // This should not happen continue; } else @@ -326,7 +326,7 @@ namespace NSStringExt wTrailing = *wsInput++; if (wTrailing < 0xDC00 || wTrailing > 0xDFFF) { - // Такого не должно быть + // This should not happen continue; } else diff --git a/DesktopEditor/common/StringExt.h b/DesktopEditor/common/StringExt.h index 5b09731617..d960a8f9ef 100644 --- a/DesktopEditor/common/StringExt.h +++ b/DesktopEditor/common/StringExt.h @@ -125,7 +125,7 @@ public: SINGLE_BYTE_ENCODING_CP874 = 0xDE, // THAI_CHARSET 222 (xDE) SINGLE_BYTE_ENCODING_CP1361 = 0x82, // JOHAB_CHARSET 130 (x82) SINGLE_BYTE_ENCODING_CP1258 = 0xA3, // VIETNAMESE_CHARSET 163 (xA3) - SINGLE_BYTE_ENCODING_CP866 = 0xFF // OEM_CHARSET 255 (xFF) // Проверить, что OEM соответствует CP866 + SINGLE_BYTE_ENCODING_CP866 = 0xFF // OEM_CHARSET 255 (xFF) // Verify that OEM corresponds to CP866 } ESingleByteEncoding; static std::wstring GetUnicodeFromSingleByteString(const unsigned char* pData, long lCount, ESingleByteEncoding eType = SINGLE_BYTE_ENCODING_DEFAULT); diff --git a/DesktopEditor/common/SystemUtils.cpp b/DesktopEditor/common/SystemUtils.cpp index 9f13b2c50e..e70e06abbc 100644 --- a/DesktopEditor/common/SystemUtils.cpp +++ b/DesktopEditor/common/SystemUtils.cpp @@ -54,7 +54,7 @@ #include <CoreFoundation/CoreFoundation.h> std::wstring getDirectoryPathMac(const NSSystemUtils::SystemDirectoryType& type) { - // Определяем тип директории + // Determine directory type CFSearchPathDirectory searchPath = kCFDocumentDirectory; switch (type) { case 1: @@ -67,7 +67,7 @@ std::wstring getDirectoryPathMac(const NSSystemUtils::SystemDirectoryType& type) break; } - // Получаем массив путей + // Get array of paths CFArrayRef pathsArray = CFCopySearchPathForDirectoriesInDomains(searchPath, kCFUserDomainMask, true); std::wstring result = L""; diff --git a/DesktopEditor/cximage/CxImage/ximabmp.cpp b/DesktopEditor/cximage/CxImage/ximabmp.cpp index a5991ae242..dba5e3250d 100644 --- a/DesktopEditor/cximage/CxImage/ximabmp.cpp +++ b/DesktopEditor/cximage/CxImage/ximabmp.cpp @@ -227,8 +227,8 @@ bool CxImageBMP::Decode(CxFile * hFile) case 1 : if (off + bf.bfOffBits < bmpHeader.biSize) { - // ОШИБКА - // файлы паттерных заливок автофигур в ppt файлах !!! + // ERROR + // pattern fill files of autoshapes in ppt files !!! } else { diff --git a/DesktopEditor/cximage/CxImage/ximagif.cpp b/DesktopEditor/cximage/CxImage/ximagif.cpp index 4fbcf1eb70..ef4f62840b 100644 --- a/DesktopEditor/cximage/CxImage/ximagif.cpp +++ b/DesktopEditor/cximage/CxImage/ximagif.cpp @@ -149,15 +149,15 @@ namespace NSGeneratePalette Pixel = *((unsigned int*)pBgraColor); RefByDstPixel = pDstPixel; - A = (A & ~15) + 15; // квантуем альфу + A = (A & ~15) + 15; // quantize alpha } }; struct SRect3D { - unsigned char MaxWidth; // максимальная ширина - unsigned char MaxColor; // цвет максимальной ширины: 0 - blue, 1 - green, 2 - red, 3 - alpha + unsigned char MaxWidth; // maximum width + unsigned char MaxColor; // color of maximum width: 0 - blue, 1 - green, 2 - red, 3 - alpha SRect3D() { @@ -191,7 +191,7 @@ namespace NSGeneratePalette ~CBounder() { - // удалять ничего не нужно, так как нет динамических данных + // nothing to delete since there is no dynamic data } @@ -226,7 +226,7 @@ namespace NSGeneratePalette return; } - // нормализуем по точкам, убивая лишние грани... + // normalize by points, removing extra edges... int nMinB, nMaxB; int nMinG, nMaxG; int nMinR, nMaxR; @@ -303,13 +303,13 @@ namespace NSGeneratePalette bool CreateNew( CBounder& bound1, CBounder& bound2 ) const { - // перераспределяем точки в массиве на две части. + // redistribute points in the array into two parts. if( 0 == m_oRect.MaxWidth ) { return FALSE; } - // сначала определяем самую длинную сторону... + // first determine the longest side... int nColorType = m_oRect.MaxColor; unsigned int hist[256]; @@ -439,7 +439,7 @@ namespace NSGeneratePalette if( !nCountImages || pDstPalette == NULL ) return arDst; - // создаём палитру + // create palette unsigned int* pPalette = new unsigned int[256]; *pDstPalette = pPalette; diff --git a/DesktopEditor/doctrenderer/app_builder/main.cpp b/DesktopEditor/doctrenderer/app_builder/main.cpp index c05bfc26a2..9e90d7ab6e 100644 --- a/DesktopEditor/doctrenderer/app_builder/main.cpp +++ b/DesktopEditor/doctrenderer/app_builder/main.cpp @@ -190,7 +190,7 @@ int main(int argc, char *argv[]) { NSDoctRenderer::CDocBuilder oBuilder; - // если отключена эта опция - то она отключится на parse_args + // if this option is disabled - it will be disabled on parse_args oBuilder.SetProperty("--check-fonts", L""); //oBuilder.SetProperty("--use-doctrenderer-scheme", L""); diff --git a/DesktopEditor/doctrenderer/app_builder_lib/main.cpp b/DesktopEditor/doctrenderer/app_builder_lib/main.cpp index 0d3becbf6f..ff85357db4 100644 --- a/DesktopEditor/doctrenderer/app_builder_lib/main.cpp +++ b/DesktopEditor/doctrenderer/app_builder_lib/main.cpp @@ -38,7 +38,7 @@ using namespace NSDoctRenderer; int main(int argc, char *argv[]) { std::wstring sProcessDirectory = NSUtils::GetProcessDirectory(); - // для дебага БЕЗ x2t - подкидываем билдер в папку builder к тестовому примеру + // for debugging WITHOUT x2t - put the builder in the builder folder for the test example std::wstring sWorkDirectory = NSUtils::GetBuilderDirectory(); CDocBuilder::Initialize(sWorkDirectory.c_str()); diff --git a/DesktopEditor/doctrenderer/config.h b/DesktopEditor/doctrenderer/config.h index 3ba073fd1c..a5f12dc855 100644 --- a/DesktopEditor/doctrenderer/config.h +++ b/DesktopEditor/doctrenderer/config.h @@ -166,7 +166,7 @@ namespace NSDoctRenderer m_strAllFonts = sAllFontsPath; } - // на папку может не быть прав + // folder may not have permissions if (!NSFile::CFileBinary::Exists(m_strAllFonts)) { FILE* pFileNative = NSFile::CFileBinary::OpenFileNative(m_strAllFonts, L"wb"); diff --git a/DesktopEditor/doctrenderer/docbuilder_p.cpp b/DesktopEditor/doctrenderer/docbuilder_p.cpp index cc66c310b7..c44e8622f3 100644 --- a/DesktopEditor/doctrenderer/docbuilder_p.cpp +++ b/DesktopEditor/doctrenderer/docbuilder_p.cpp @@ -183,7 +183,7 @@ std::string GetCorrectArgument(const std::string& sInput) { if (nQouteMarkCounter & 1) { - // внутренняя кавычка - ничего не делаем + // internal quote - do nothing } else { @@ -382,7 +382,7 @@ bool CV8RealTimeWorker::SaveFileWithChanges(int type, const std::wstring& _path, else if (type & AVS_OFFICESTUDIO_FILE_IMAGE) { _formatDst = NSDoctRenderer::DoctRendererFormat::IMAGE; - // не поддерживает x2т прямую конвертацию. делаем ***T format + // doesn't support x2t direct conversion. use ***T format switch (m_nFileType) { case 0: { _formatDst = NSDoctRenderer::DoctRendererFormat::DOCT; break; } @@ -1390,7 +1390,7 @@ namespace NSDoctRenderer } std::string sJsCommands = ""; - std::wstring _builder_params[4]; // с запасом + std::wstring _builder_params[4]; // with reserve for (std::list<std::string>::iterator i = _commands.begin(); i != _commands.end(); i++) { const std::string& command = *i; @@ -1506,7 +1506,7 @@ namespace NSDoctRenderer if (m_pInternal->m_oParams.m_bSaveWithDoctrendererMode) { - // перед сохранением в такой схеме нужно скинуть изменения + // before saving in this mode, need to flush changes this->ExecuteCommand(L"Asc.editor.asc_Save();"); } @@ -1539,7 +1539,7 @@ namespace NSDoctRenderer if (!sJsCommands.empty()) { - // Такого быть не должно!!! Так как результат никуда не сохранится. пустое действие. + // This should not happen!!! Since the result won't be saved anywhere. Empty action. std::wstring sUnicodeCommand = NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)sJsCommands.c_str(), (LONG)sJsCommands.length()); bool bIsNoError = this->m_pInternal->ExecuteCommand(sUnicodeCommand.c_str(), NULL, true); sJsCommands = ""; diff --git a/DesktopEditor/doctrenderer/docbuilder_p.h b/DesktopEditor/doctrenderer/docbuilder_p.h index 82491712bb..1c883b872f 100644 --- a/DesktopEditor/doctrenderer/docbuilder_p.h +++ b/DesktopEditor/doctrenderer/docbuilder_p.h @@ -550,7 +550,7 @@ namespace NSDoctRenderer oWorker.m_arAdditionalFolders.push_back(NSFile::GetProcessDirectory() + L"/fonts"); oWorker.m_bIsNeedThumbnails = false; oWorker.m_sDirectory = sDirectory; - // это не рабочая папка, где только шрифты + // this is not a working folder with only fonts oWorker.m_bIsCleanDirectory = false; NSFonts::IApplicationFonts* pFonts = oWorker.Check(); if(pFonts) @@ -679,8 +679,8 @@ namespace NSDoctRenderer int n3 = (int)from.find (L"ftp"); int n4 = (int)from.find (L"https"); - //если nI сранивать не с 0, то будут проблемы - //потому что в инсталяции мы кладем файлы в /var/www... + // if nI is compared not with 0, there will be problems + // because in installation we put files in /var/www... if (0 == n1 || 0 == n2 || 0 == n3 || 0 == n4) { NSNetwork::NSFileTransport::CFileDownloader oDownloader(from, false); @@ -726,7 +726,7 @@ namespace NSDoctRenderer } #endif - // не открываем локальные файлы в серверной версии. + // don't open local files in server version. if (m_bIsServerSafeVersion) return; @@ -883,7 +883,7 @@ namespace NSDoctRenderer if (true) { - // для файлов по ссылке - расширение может быть плохим. + // for files by link - extension may be invalid. const wchar_t* sExtCopyPtr = sExtCopy.c_str(); int nExtCopyLen = sExtCopy.length(); int nValidIndex = 0; diff --git a/DesktopEditor/doctrenderer/drawingfile.h b/DesktopEditor/doctrenderer/drawingfile.h index 9442163c61..9e2b361baf 100644 --- a/DesktopEditor/doctrenderer/drawingfile.h +++ b/DesktopEditor/doctrenderer/drawingfile.h @@ -304,14 +304,14 @@ public: { if (m_nType == 0) { - // Память из CDrawingFileEmbed освобождается сразу после вызова функции, поэтому копируем + // Memory from CDrawingFileEmbed is freed immediately after the function call, so we copy if (bCopy) { BYTE* pCopy = (BYTE*)malloc(size); memcpy(pCopy, data, size); data = pCopy; } - // Захватывает полученную память, будет освобождена либо в деструкторе MemStream, либо free в случае неудачи + // Captures the received memory, will be freed either in MemStream destructor, or via free on failure return ((CPdfFile*)m_pFile)->MergePages(data, size, nMaxID, sPrefixForm); } return false; @@ -326,14 +326,14 @@ public: { if (m_nType == 0) { - // Память из CDrawingFileEmbed освобождается сразу после вызова функции, поэтому копируем + // Memory from CDrawingFileEmbed is freed immediately after the function call, so we copy if (bCopy) { BYTE* pCopy = (BYTE*)malloc(size); memcpy(pCopy, data, size); data = pCopy; } - // Захватывает полученную память data + // Captures the received memory data return ((CPdfFile*)m_pFile)->RedactPage(nPageIndex, arrRedactBox, nLengthX8, data, size); } return false; diff --git a/DesktopEditor/doctrenderer/embed/NativeControlEmbed.cpp b/DesktopEditor/doctrenderer/embed/NativeControlEmbed.cpp index 2da5e64aee..f54a95783c 100644 --- a/DesktopEditor/doctrenderer/embed/NativeControlEmbed.cpp +++ b/DesktopEditor/doctrenderer/embed/NativeControlEmbed.cpp @@ -41,9 +41,9 @@ JSSmart<CJSValue> CNativeControlEmbed::GetFileBinary(JSSmart<CJSValue> file) JSSmart<CJSValue> CNativeControlEmbed::GetFontBinary(JSSmart<CJSValue> file) { // TODO: - // по идее файлы могут совпадать по имени, но лежать в разных директориях. - // и поэтому в AllFonts.js надо бы писать пути полные. - // пока оставим поддержку старой версии тоже + // theoretically files can have the same name but be in different directories. + // so in AllFonts.js we should write full paths. + // for now keep support for the old version as well std::wstring sFile = file->toStringW(); bool bIsFullFilePath = (std::wstring::npos != sFile.find('\\') || std::wstring::npos != sFile.find('/')); if (bIsFullFilePath) diff --git a/DesktopEditor/doctrenderer/embed/TextMeasurerEmbed.cpp b/DesktopEditor/doctrenderer/embed/TextMeasurerEmbed.cpp index 76ceb51259..a7b427fd35 100644 --- a/DesktopEditor/doctrenderer/embed/TextMeasurerEmbed.cpp +++ b/DesktopEditor/doctrenderer/embed/TextMeasurerEmbed.cpp @@ -6,9 +6,9 @@ #define RAW_POINTER(value) ((CPointerEmbedObject*)value->toObject()->getNative())->Data #define POINTER_OBJECT(value) ((CPointerEmbedObject*)value->toObject()->getNative()) -// в js не хотим следить, чтобы в каждом face была ссылка на library - т.е. чтобы -// сначала удалились все face, а потом library - поэтому делаем свой счетчик ссылок -// и следим за library сами. Т.е. используем FT_Library_Reference/FT_Library_UnReference +// in js we don't want to track that each face has a reference to library - i.e. that +// all faces are deleted first and then library - so we make our own reference counter +// and track library ourselves. I.e. we use FT_Library_Reference/FT_Library_UnReference class CExternalPointerJS : public NSShaper::CExternalPointer diff --git a/DesktopEditor/doctrenderer/graphics.cpp b/DesktopEditor/doctrenderer/graphics.cpp index 7e6886242d..086b4486a7 100644 --- a/DesktopEditor/doctrenderer/graphics.cpp +++ b/DesktopEditor/doctrenderer/graphics.cpp @@ -1312,7 +1312,7 @@ namespace NSGraphics #endif if (std::isnan(r0)) { - // линейный + // linear double dAngle = 0; if (fabs(x1 - x0) >= FLT_EPSILON || fabs(y1 - y0) >= FLT_EPSILON) dAngle = atan2(y1 - y0, x1 - x0) * 180 / M_PI; @@ -1322,7 +1322,7 @@ namespace NSGraphics } else { - // радиальный + // radial m_pRenderer->put_BrushType(c_BrushTypePathGradient2); m_pRenderer->put_BrushGradientColors(pColors, pPositions, nCount); } diff --git a/DesktopEditor/doctrenderer/graphics.h b/DesktopEditor/doctrenderer/graphics.h index c8099a0a60..369d3a05dd 100644 --- a/DesktopEditor/doctrenderer/graphics.h +++ b/DesktopEditor/doctrenderer/graphics.h @@ -199,11 +199,11 @@ namespace NSGraphics void drawHorLine (BYTE align, double y, double x, double r, double penW); void drawHorLine2(BYTE align, double y, double x, double r, double penW); void drawVerLine (BYTE align, double x, double y, double b, double penW); - // мега крутые функции для таблиц + // advanced table functions void drawHorLineExt(BYTE align, double y, double x, double r, double penW, double leftMW, double rightMW); void rect (double x, double y, double w, double h); void TableRect(double x, double y, double w, double h); - // функции клиппирования + // clipping functions void AddClipRect(double x, double y, double w, double h); void RemoveClipRect(); void SetClip (double x, double y, double w, double h); diff --git a/DesktopEditor/doctrenderer/js_internal/js_base.h b/DesktopEditor/doctrenderer/js_internal/js_base.h index c9d3fc7ead..e98c3dba76 100644 --- a/DesktopEditor/doctrenderer/js_internal/js_base.h +++ b/DesktopEditor/doctrenderer/js_internal/js_base.h @@ -492,7 +492,7 @@ namespace NSJSBase void Exit(); /** - * Сheck if context is current. + * Check if context is current. * This method is not safe. */ bool IsEntered(); diff --git a/DesktopEditor/doctrenderer/js_internal/jsc/jsc_base.mm b/DesktopEditor/doctrenderer/js_internal/jsc/jsc_base.mm index bf3691d07e..572b50104f 100644 --- a/DesktopEditor/doctrenderer/js_internal/jsc/jsc_base.mm +++ b/DesktopEditor/doctrenderer/js_internal/jsc/jsc_base.mm @@ -6,7 +6,7 @@ using namespace NSJSBase; class CGlobalContext { private: - // считаем, что vector будет небольшим, поэтому он будет быстрее, чем map + // assuming vector will be small, so it will be faster than map std::vector<std::pair<ASC_THREAD_ID, CJSContextPrivate*>> m_contexts; bool m_bIsOldVersion; diff --git a/DesktopEditor/doctrenderer/nativecontrol.h b/DesktopEditor/doctrenderer/nativecontrol.h index ba7ea430cf..2bc5655264 100644 --- a/DesktopEditor/doctrenderer/nativecontrol.h +++ b/DesktopEditor/doctrenderer/nativecontrol.h @@ -254,10 +254,10 @@ namespace NSNativeControl CZipWorker m_oZipWorker; - // для добавления картинок ------------------------------------- + // for adding images ------------------------------------- CImagesWorker* m_pWorker; - // серверная версия билдера + // server version of builder CV8Params m_oParams; std::map<std::wstring, bool> m_map_access_directories; @@ -380,7 +380,7 @@ namespace NSNativeControl { int nNaturalIndex = nDeleteIndex; - // на каждое изменение две кавычки) + // two quotes per each change) nNaturalIndex <<= 1; // not cool realize @@ -415,7 +415,7 @@ namespace NSNativeControl { if (nDeleteIndex < m_nCurrentChangesBuilderIndex) { - // нужно удалить изменения + // need to delete changes DumpRemoveChanges(nDeleteIndex); } m_nCurrentChangesBuilderIndex = nDeleteIndex + nCount; @@ -543,7 +543,7 @@ public: if (nLen <= m_nMaxUnionSize) { - // все убралось - выделяем один кусок + // everything fits - allocate single chunk m_nLen = nLen + 4; } else @@ -678,7 +678,7 @@ public: public: void OpenFull(std::vector<std::wstring>& oFiles) { - // определяем размер + // determine size size_t nCount = oFiles.size(); for (size_t i = 0; i < nCount; ++i) { @@ -736,7 +736,7 @@ public: void OpenFull_excel(std::vector<std::wstring>& oFiles) { - // определяем размер + // determine size size_t nCount = oFiles.size(); for (size_t i = 0; i < nCount; ++i) { diff --git a/DesktopEditor/fontengine/ApplicationFonts.cpp b/DesktopEditor/fontengine/ApplicationFonts.cpp index ed1a01fb1b..eece0ba32c 100644 --- a/DesktopEditor/fontengine/ApplicationFonts.cpp +++ b/DesktopEditor/fontengine/ApplicationFonts.cpp @@ -194,7 +194,7 @@ namespace NSFonts INT bBold = NSBinarySerialize::Read<INT>(pBuffer); INT bFixedWidth = NSBinarySerialize::Read<INT>(pBuffer); - INT lLen = NSBinarySerialize::Read<INT>(pBuffer); // должно быть равно 10 + INT lLen = NSBinarySerialize::Read<INT>(pBuffer); // should be equal to 10 BYTE pPanose[10]; memcpy( (void *)pPanose, (const void *)pBuffer, 10 ); pBuffer += lLen; @@ -294,7 +294,7 @@ namespace NSFonts if (oSerializer.m_nVersion >= 2) { - // вначале пишем длину + // first write the length len += 4; // len len += 2; @@ -431,11 +431,11 @@ namespace NSCharsets static void GetCodePageByCharset(unsigned char unCharset, unsigned int *pulBit, unsigned int *punLongIndex) { - // Данная функция возвращает параметры, которые нужно посылать на вход - // функции AVSFontManager::IsUnicodeRangeAvailable + // This function returns parameters to be passed to + // AVSFontManager::IsUnicodeRangeAvailable function - // Соответствие Charset -> Codepage: http://support.microsoft.com/kb/165478 + // Charset -> Codepage mapping: http://support.microsoft.com/kb/165478 // http://msdn.microsoft.com/en-us/library/cc194829.aspx // Charset Name Charset Value(hex) Codepage number @@ -461,7 +461,7 @@ namespace NSCharsets // VIETNAMESE_CHARSET 163 (xA3) 1258 // MAC_CHARSET 77 (x4D) - // Соответсвие CodePage -> ulCodePageRange1 : http://www.microsoft.com/Typography/otspec/os2.htm#cpr + // CodePage -> ulCodePageRange1 mapping: http://www.microsoft.com/Typography/otspec/os2.htm#cpr if ( punLongIndex ) *punLongIndex = 4; @@ -547,7 +547,7 @@ std::wstring CFontList::GetFontBySymbol(int symbol) /////////////////////////////////////////////////////////////////////////////////// int CFontList::GetCharsetPenalty(UINT ulCandRanges[6], unsigned char unReqCharset) { - // Penalty = 65000 (это самый весомый параметр) + // Penalty = 65000 (this is the most significant parameter) if ( UNKNOWN_CHARSET == unReqCharset ) return 0; @@ -569,8 +569,8 @@ int CFontList::GetSigPenalty(UINT ulCandRanges[6], UINT ulReqRanges[6], double d { double dPenalty = 0; - // Для начала просматриваем сколько вообще различных пространств надо. - // Исходя из их общего количества, находим вес 1 пропущеного пространства. + // First we check how many different ranges are needed. + // Based on the total count, we find the weight of 1 missing range. bool isSuferflouous = (dRangeWeightSuferflouous < 1) ? false : true; int nRangesCount = 0; @@ -605,8 +605,8 @@ int CFontList::GetFixedPitchPenalty(INT bCandFixed, INT bReqFixed) { int nPenalty = 0; - // Если запрашивается моноширинный, а кандидат не моноширинный, то вес 15000 - // Если запрашивается не моноширинный, а кандидат моноширинный, то вес 350 + // If monospace is requested but candidate is not monospace, weight is 15000 + // If non-monospace is requested but candidate is monospace, weight is 350 if ( bReqFixed && !bCandFixed ) nPenalty = 15000; if ( !bReqFixed && bCandFixed ) @@ -740,13 +740,13 @@ int CFontList::GetBoldPenalty(INT bCandBold, INT bReqBold) int CFontList::GetFontFormatPenalty(NSFonts::EFontFormat eCandFormat, NSFonts::EFontFormat eReqFormat) { - // Вообще, на МSDN написано только про TrueType. Но мы будем сравнивать - // все типы форматов и при несовпадении даем вес = 4. Если формат не задан - // то по умолчанию считаем его TrueType. + // MSDN documentation only mentions TrueType. But we will compare + // all format types and give weight = 4 on mismatch. If format is not specified + // we assume it's TrueType by default. if ( eReqFormat == NSFonts::fontUnknown ) { - // Считаем, что когда формат не известен, значит это 100% не TrueType. + // We assume that when format is unknown, it's 100% not TrueType. if ( eCandFormat == NSFonts::fontTrueType ) return 4; else @@ -882,7 +882,7 @@ public: static CFontSelectFormatCorrection* CheckCorrection(NSFonts::CFontSelectFormat& oSelect) { - // пробуем "подправить" настройки + // try to "correct" the settings std::wstring sName = *oSelect.wsName; NSFonts::makeLower(sName); @@ -960,12 +960,12 @@ NSFonts::CFontInfo* CFontList::GetByParams(NSFonts::CFontSelectFormat& oSelect, if (bIsDictionaryUse) { - // дубликат не делаем!!! Серега создает объект только для подбора и дальше его не использует + // don't make a duplicate!!! The object is created only for selection and not used afterwards NSFontDictionary::CorrectParamsFromDictionary(oSelect); } - int nMinIndex = 0; // Номер шрифта в списке с минимальным весом - int nMinPenalty = -1; // Минимальный вес + int nMinIndex = 0; // Index of font with minimum penalty in the list + int nMinPenalty = -1; // Minimum penalty int nDefPenalty = 2147483647; NSFonts::CFontInfo* pInfoMin = NULL; @@ -1040,7 +1040,7 @@ NSFonts::CFontInfo* CFontList::GetByParams(NSFonts::CFontSelectFormat& oSelect, //if ( NULL != oSelect.bItalic ) // nCurPenalty += GetItalicPenalty( pInfo->m_bItalic, *oSelect.bItalic ); - // проверяем всегда!!! иначе только по имени может подобраться болд, и появляется зависимость от порядка шрифтов + // always check!!! otherwise bold may be selected by name only, creating dependency on font order nCurPenalty += GetBoldPenalty( pInfo->m_bBold, (NULL != oSelect.bBold) ? *oSelect.bBold : FALSE ); nCurPenalty += GetItalicPenalty( pInfo->m_bItalic, (NULL != oSelect.bItalic) ? *oSelect.bItalic : FALSE ); @@ -1081,7 +1081,7 @@ NSFonts::CFontInfo* CFontList::GetByParams(NSFonts::CFontSelectFormat& oSelect, nMinPenalty = nCurPenalty; } - // Нашелся шрифт, удовлетворяющий всем параметрам, дальше искать нет смысла + // Found a font satisfying all parameters, no need to search further if ( 0 == nCurPenalty ) break; } @@ -1135,10 +1135,9 @@ void CFontList::Add(FT_Library pLibrary, FT_Parameter* pParams, const std::wstri if (FT_Open_Face( pLibrary, &oOpenArgs, 0, &pFace )) return; - // TO DO: Шрифты, которые нельзя скейлить (т.е. изменять размер - // произвольно) мы не грузим. Возможно в будущем надо будет - // сделать, чтобы работал и такой вариант. (в Word такие шрифты - // не используются) + // TO DO: Fonts that cannot be scaled (i.e. resize arbitrarily) + // are not loaded. In the future we may need to support such fonts + // as well. (Word does not use such fonts) if ( !( pFace->face_flags & FT_FACE_FLAG_SCALABLE ) ) { FT_Done_Face( pFace ); @@ -1213,8 +1212,8 @@ void CFontList::Add(FT_Library pLibrary, FT_Parameter* pParams, const std::wstri if ( true ) { - // Специальная ветка для случаев, когда charset может быть задан не через значения - // ulCodePageRange, а непосредственно через тип Cmap. + // Special branch for cases when charset can be specified not through + // ulCodePageRange values, but directly through Cmap type. // Charset Name Charset Value(hex) Codepage number Platform_ID Encoding_ID Description // ------------------------------------------------------------------------------------------------- @@ -1337,7 +1336,7 @@ void CFontList::Add(FT_Library pLibrary, FT_Parameter* pParams, const std::wstri sEncoding = "UTF-16BE"; break; case TT_MS_ID_UCS_4: - //sEncoding = "UCS4"; // см tt_ + //sEncoding = "UCS4"; // see tt_ sEncoding = "UTF-16BE"; break; //case TT_MS_ID_SJIS: @@ -1455,7 +1454,7 @@ void CFontList::LoadFromArrayFiles(std::vector<std::wstring>& oArray, int nFlag) pParams[3].tag = FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY; pParams[3].data = NULL; - // определяем размер буфера, чтобы не выделять много кусков, а обойтись одним + // determine buffer size to avoid allocating many chunks, use a single one instead int nMaxFontSize = 0; for (size_t nIndex = 0; nIndex < nCount; ++nIndex) { @@ -1465,7 +1464,7 @@ void CFontList::LoadFromArrayFiles(std::vector<std::wstring>& oArray, int nFlag) int nSizeTmp = (int)oFile.GetFileSize(); if (nSizeTmp > 100000000) { - // такие огромные шрифты не учитываем + // skip such huge fonts oArray.erase(oArray.begin() + nIndex, oArray.begin() + nIndex + 1); nIndex--; nCount--; @@ -1743,7 +1742,7 @@ static long GetNextNameValue(HKEY key, const std::wstring& sSubkey, std::wstring std::vector<std::wstring> CApplicationFonts::GetSetupFontFiles(const bool& bIsUseUserFonts) { #if defined(_WIN32) || defined (_WIN64) - // Ищем директорию с фонтами (обычно это C:\Windows\Fonts) + // Find the fonts directory (usually C:\Windows\Fonts) wchar_t wsWinFontDir[MAX_PATH]; wsWinFontDir[0] = (wchar_t)'\0'; diff --git a/DesktopEditor/fontengine/ApplicationFonts.h b/DesktopEditor/fontengine/ApplicationFonts.h index a2fe97849c..aab3f11b1e 100644 --- a/DesktopEditor/fontengine/ApplicationFonts.h +++ b/DesktopEditor/fontengine/ApplicationFonts.h @@ -32,8 +32,8 @@ #ifndef _BUILD_APPLICATIONFONTS_H_ #define _BUILD_APPLICATIONFONTS_H_ -#define UNKNOWN_CHARSET 3 // для случаев, когда задано значение DEFAULT_CHARSET, но -// на самом деле charset не учитывается +#define UNKNOWN_CHARSET 3 // for cases when DEFAULT_CHARSET is set, but +// charset is not actually taken into account #include <vector> #include <list> @@ -182,7 +182,7 @@ public: return IsEqualsFontsAdvanced(name, req) ? 3000 : 10000; } - // не учитываем регистр (латиница) и знаки /-/ /,/ + // ignore case (Latin) and symbols /-/ /,/ static bool IsEqualsFontsAdvanced(const std::wstring& name, const std::wstring& req, bool* bIsOneInAnother = NULL) { int lenName = (int)name.length(); @@ -248,7 +248,7 @@ private: CFontRange* m_pRanges; int m_nRangesCount; - std::list<CFontRange> m_listRanges; // последние использованные (найденные) + std::list<CFontRange> m_listRanges; // last used (found) public: CFontList() diff --git a/DesktopEditor/fontengine/ApplicationFontsWorker.cpp b/DesktopEditor/fontengine/ApplicationFontsWorker.cpp index 816c424f01..e79f90b47c 100644 --- a/DesktopEditor/fontengine/ApplicationFontsWorker.cpp +++ b/DesktopEditor/fontengine/ApplicationFontsWorker.cpp @@ -332,7 +332,7 @@ public: } else { - // для шрифта ASCW3 допускаем маленькую длину range + // for ASCW3 font we allow small range length nPriority = m_nPriority; } @@ -563,7 +563,7 @@ public: std::vector<NSFonts::CFontInfo*>* pList = applicationFonts->GetList()->GetFonts(); int nCount = (int)pList->size(); - // сначала строим массив всех файлов шрифтов + // first build array of all font files std::map<std::wstring, LONG> mapFontFiles; std::map<LONG, std::wstring> mapFontFiles2; LONG lFontFiles = 0; @@ -585,7 +585,7 @@ public: if (CheckBreak()) return; - // теперь строим массив всех шрифтов по имени + // now build array of all fonts by name std::map<std::wstring, CFontInfoJS> mapFonts; std::vector<std::wstring> arrFonts; @@ -685,7 +685,7 @@ public: if (CheckBreak()) return; - // теперь сортируем шрифты по имени ---------- + // now sort fonts by name ---------- size_t nCountFonts = arrFonts.size(); #if 1 @@ -706,7 +706,7 @@ public: #endif std::wstring strFontSelectionBin = L""; - // нужно ли скидывать font_selection.bin + // whether to dump font_selection.bin if (ONLYOFFICE_ALL_FONTS_VERSION == nVersion && !m_bIsCheckThumbnailsMode) { strFontSelectionBin = m_pMain->m_sDirectory + L"/font_selection.bin"; @@ -720,8 +720,8 @@ public: pRangeBuilder->WriteInt(0); } - // и самое главное. Здесь должен скидываться скрипт для работы со всеми шрифтами. - // все объекты, которые позволят не знать о существующих фонтах + // most importantly, the script for working with all fonts should be dumped here. + // all objects that will allow not knowing about existing fonts std::wstring sAllFontsPath = m_pMain->m_sDirectory + L"/AllFonts.js"; if (!m_pMain->m_sAllFontsJSPath.empty()) sAllFontsPath = m_pMain->m_sAllFontsJSPath; @@ -731,7 +731,7 @@ public: if (m_bIsCheckThumbnailsMode) sAllFontsPath = L""; - // AllFonts.js для веба точно такой же, но с другими путями + // AllFonts.js for web is exactly the same, but with different paths std::wstring sFontFilesWeb = L""; size_t nFontFilesWeb1 = 0; size_t nFontFilesWeb2 = 0; @@ -750,7 +750,7 @@ public: nFontFilesWeb1 = oWriterJS.GetCurSize(); - // сначала все файлы + // first all files size_t nCountFiles = mapFontFiles.size(); if (nCountFiles == 0) oWriterJS.WriteString(L"window[\"__fonts_files\"] = []; \n\n"); @@ -896,9 +896,9 @@ public: NSFonts::CApplicationFontsSymbols oApplicationChecker; - // приоритеты шрифтов. по имени (все стили) - // если шрифт из mapFontsPriorityStandard, то приоритет из этого map - // иначе - максимальный размер из файлов-стиля шрифта (max(regular,italic,bold,bolditalic)) + // font priorities by name (all styles) + // if font is from mapFontsPriorityStandard, priority is from that map + // otherwise - maximum size of font style files (max(regular,italic,bold,bolditalic)) std::vector<CFontPriority> arrFontsPriority; for (int index = 0; index < nCountFonts; ++index) { @@ -964,10 +964,10 @@ public: arrFontsPriority.push_back(f); } - // сортируем по приоритету + // sort by priority std::sort(arrFontsPriority.begin(), arrFontsPriority.end(), CFontPriority::Compare); - // для удобства - делаем map + // for convenience - create a map std::map<std::wstring, int> mapFontsPriority; int nIndexPriority = 1; for (std::vector<CFontPriority>::iterator i = arrFontsPriority.begin(); i != arrFontsPriority.end(); i++) @@ -1000,7 +1000,7 @@ public: if (1 == nCounterFonts && !bIsSmallRangesDetect) { - // отключили этот режим (bIsSmallRangesDetect всегда true) + // this mode is disabled (bIsSmallRangesDetect is always true) std::wstring sPathC = L""; int nFaceIndexC = 0; if (-1 != info.m_lIndexR) @@ -1032,8 +1032,8 @@ public: } else { - // каждый шрифт - анализируем на символы. в массив символов (tmp buffer) - - // пишем m_nStyle + // for each font - analyze symbols. write m_nStyle to the + // symbol array (tmp buffer) int nMask = 0; if (-1 != info.m_lIndexR) { @@ -1062,15 +1062,15 @@ public: if (bIsSmallRangesDetect) { - // чекаем все символы, которые есть во ВСЕХ стилях шрифта - // nSumPriority - это добавка для ranges маленькой длины, чтобы если есть - // длинный диапазон но большим приоритетом - то он его перебьет. - // для этого добавка - количество шрифтов. чтобы хватило + // check all symbols that exist in ALL font styles + // nSumPriority - is an addition for small range lengths, so that if there's + // a long range with higher priority - it will override it. + // for this, the addition is the number of fonts to be sufficient oAllChecker.Apply2(nMask, nSumPriority); } else { - // просто чекаем все символы, которые есть во ВСЕХ стилях шрифта + // just check all symbols that exist in ALL font styles oAllChecker.Apply1(nMask); } } @@ -1352,7 +1352,7 @@ public: if (NSFile::CFileBinary::Exists(strThumbnailPath)) continue; - // создаем картинку для табнейлов + // create image for thumbnails double dDpi = 96 * dScale; LONG lH1_px = (LONG)(28 * dScale); LONG lWidthPix = (LONG)(300 * dScale); @@ -1427,9 +1427,9 @@ public: } else if (pFile) { - // у нас режим "без квадратов" - // но есть шрифты, в которых символы есть, но нулевой ширины. - // только из-за таких шрифтов делаем заглушку + // we are in "no squares" mode + // but there are fonts where characters exist but have zero width. + // we create a fallback only for such fonts bool bIsExistEmpty = false; for (NSStringExt::CStringUnicodeIterator oIterator(sFontName); oIterator.Check(); oIterator.Next()) { @@ -1633,7 +1633,7 @@ NSFonts::IApplicationFonts* CApplicationFontsWorker::Check() std::vector<std::string> strFonts; std::wstring strFontsCheckPath = m_sDirectory + L"/fonts.log"; - // читаем "старый" набор шрифтов + // read the "old" font set if (true) { NSFile::CFileBinary oFile; @@ -1686,7 +1686,7 @@ NSFonts::IApplicationFonts* CApplicationFontsWorker::Check() #endif } - // читаем "новый" набор шрифтов + // read the "new" font set NSFonts::IApplicationFonts* pApplicationF = NSFonts::NSApplication::Create(); std::vector<std::wstring> strFontsW_CurSrc; std::vector<std::wstring> strFontsW_Cur; @@ -1699,7 +1699,7 @@ NSFonts::IApplicationFonts* CApplicationFontsWorker::Check() NSDirectory::GetFiles2(*i, strFontsW_CurSrc, true); } - // удаляем папки, которые не нужно парсить + // remove folders that should not be parsed strFontsW_Cur.reserve(strFontsW_CurSrc.size()); for (std::vector<std::wstring>::iterator i = strFontsW_CurSrc.begin(); i != strFontsW_CurSrc.end(); i++) { @@ -1716,18 +1716,18 @@ NSFonts::IApplicationFonts* CApplicationFontsWorker::Check() #endif } - // сортируем (нужно для сравнения для старого набора) + // sort (needed for comparison with the old set) std::sort(strFontsW_Cur.begin(), strFontsW_Cur.end()); bool bIsEqual = true; - // если количество шрифтов в наборах не совпадают - то нужно перегенерировать + // if font counts in sets don't match - regeneration is needed if (strFonts.size() != strFontsW_Cur.size()) bIsEqual = false; if (bIsEqual) { - // если наборы не совпадают - то нужно перегенерировать + // if sets don't match - regeneration is needed int nCount = (int)strFonts.size(); for (int i = 0; i < nCount; ++i) { @@ -1741,8 +1741,8 @@ NSFonts::IApplicationFonts* CApplicationFontsWorker::Check() if (bIsEqual) { - // наборы совпадают - скинут ли font_selection.bin - // если нет - нужно перегенерировать + // sets match - check if font_selection.bin was dumped + // if not - regeneration is needed if (!NSFile::CFileBinary::Exists(strFontsSelectionBin)) bIsEqual = false; } @@ -1762,7 +1762,7 @@ NSFonts::IApplicationFonts* CApplicationFontsWorker::Check() if (!m_bIsUseOpenType) nFlag = 2; - // формируем новый набор шрифтов + // create new font set NSStringUtils::CStringBuilder oFontsLog; #ifdef ONLYOFFICE_FONTS_VERSION oFontsLog.WriteString(L"ONLYOFFICE_FONTS_VERSION_"); @@ -1776,20 +1776,20 @@ NSFonts::IApplicationFonts* CApplicationFontsWorker::Check() oFontsLog.WriteString(L"\n"); } - // читаем шрифты + // read fonts pApplicationF->InitializeFromArrayFiles(strFontsW_Cur, nFlag); - // скидываем все + // dump everything m_pInternal->SaveAllFontsJS(pApplicationF, ONLYOFFICE_ALL_FONTS_VERSION); - // поддержка старой версии AllFonts.js + // support for old AllFonts.js version if (m_bIsUseAllVersions) { for (int nVer = 0; nVer < ONLYOFFICE_ALL_FONTS_VERSION; ++nVer) m_pInternal->SaveAllFontsJS(pApplicationF, nVer); } - // скидываем новый набор шрифтов + // dump new font set if (!m_pInternal->CheckBreak()) NSFile::CFileBinary::SaveToFile(strFontsCheckPath, oFontsLog.GetData()); } @@ -1799,13 +1799,13 @@ NSFonts::IApplicationFonts* CApplicationFontsWorker::Check() if (!m_pInternal->m_pBreaker || m_pInternal->m_pBreaker->IsFontsWorkerRunned()) { - // никаких прерываний не было + // no interruptions occurred pApplicationF = NSFonts::NSApplication::Create(); pApplicationF->InitializeFromFolder(m_sDirectory); } else { - // прервали - подчищаем рабочую директорию + // interrupted - clean up working directory if (m_bIsCleanDirectory) { std::vector<std::wstring> arFiles = NSDirectory::GetFiles(m_sDirectory, false); diff --git a/DesktopEditor/fontengine/ApplicationFontsWorker.h b/DesktopEditor/fontengine/ApplicationFontsWorker.h index 4c509b1820..8a95d9afa8 100644 --- a/DesktopEditor/fontengine/ApplicationFontsWorker.h +++ b/DesktopEditor/fontengine/ApplicationFontsWorker.h @@ -49,33 +49,33 @@ class CApplicationFontsWorker_private; class GRAPHICS_DECL CApplicationFontsWorker { public: - // использовать ли системные шрифты + // whether to use system fonts bool m_bIsUseSystemFonts; bool m_bIsUseSystemUserFonts; - // дополнительные папки с шрифтами + // additional font folders std::vector<std::wstring> m_arAdditionalFolders; - // рабоча директория (сюда скидываем все артефакты) + // working directory (all artifacts are stored here) std::wstring m_sDirectory; - // поддерживать ли opentype шрифты + // whether to support OpenType fonts bool m_bIsUseOpenType; - // поддерживать ли все версии AllFonts.js + // whether to support all AllFonts.js versions bool m_bIsUseAllVersions; - // нужны ли табнейлы + // whether thumbnails are needed bool m_bIsNeedThumbnails; - // какой-то табнейл уже есть - нудно ли все равно удалить и перегенерировать? + // if a thumbnail already exists, should it be deleted and regenerated anyway? bool m_bIsRemoveOldThumbnails; - // генерим табнейлы отдельно + // generate thumbnails separately bool m_bSeparateThumbnails; - // какие масштабы нужны для табнейлов + // which scales are needed for thumbnails std::vector<double> m_arThumbnailsScales; bool m_bIsGenerateThumbnailsEA; - // WEB версия ---- + // WEB version ---- std::wstring m_sThumbnailsDirectory; std::wstring m_sAllFontsJSPath; diff --git a/DesktopEditor/fontengine/FontFile.cpp b/DesktopEditor/fontengine/FontFile.cpp index 4d843a2cd8..3113ef0b7e 100644 --- a/DesktopEditor/fontengine/FontFile.cpp +++ b/DesktopEditor/fontengine/FontFile.cpp @@ -563,8 +563,8 @@ int CFontFile::IsUnicodeRangeAvailable(unsigned long ulBit, unsigned int un4Byte case 5: if ( pOs2->ulCodePageRange2 & ulMult ) nResult = 1; break; } - // Специальная ветка для случаев, когда charset может быть задан не через значения - // ulCodePageRange, а непосредственно через тип Cmap. + // Special branch for cases when charset can be specified not through + // ulCodePageRange values, but directly through Cmap type. // Charset Name Charset Value(hex) Codepage number Platform_ID Encoding_ID Description // ------------------------------------------------------------------------------------------------- @@ -631,42 +631,42 @@ void CFontFile::UpdateStyles(const INT& bBold, const INT& bItalic) { std::string sStyle = GetStyleName(); - // Смотрим какой стиль у исходного шрифта + // Check the original font style INT bSrcBold = (-1 != sStyle.find("Bold")); INT bSrcItalic = (-1 != sStyle.find("Italic")); - if (!bBold) // Нам нужен не жирный шрифт + if (!bBold) // We need a non-bold font { m_bNeedDoBold = false; } - else if (bBold) // Нам нужно сделать шрифт жирным + else if (bBold) // We need to make the font bold { if (bSrcBold) { - // Исходный шрифт уже жирный, поэтому ничего дополнительного делать не надо + // Original font is already bold, no additional action needed m_bNeedDoBold = false; } else { - // Иходный шрифт не жирный, поэтому жирность делаем сами + // Original font is not bold, so we apply boldness ourselves m_bNeedDoBold = true; } } - if (!bItalic) // Нам нужен не наклонный шрифт + if (!bItalic) // We need a non-italic font { SetItalic(false); } - else if (bItalic) // Нам нужно сделать наклонный шрифт + else if (bItalic) // We need to make the font italic { if (bSrcItalic) { - // Исходный шрифт уже наклонный, поэтому ничего дополнительного делать не надо + // Original font is already italic, no additional action needed SetItalic(false); } else { - // Иходный шрифт не наклонный, поэтому делаем его наклонным сами + // Original font is not italic, so we apply italics ourselves SetItalic(true); } } @@ -833,14 +833,14 @@ TFontCacheSizes CFontFile::CacheGlyph(const int& code, const bool& isRaster, CVe if (!m_bStringGID) { - // пробуем подобрать нужный шрифт + // try to select the appropriate font CFontFile* pPickFile = m_pFontManager->GetFontFileBySymbol(this, code); if (!pPickFile) return oSizes; TFontCacheSizes oSizesCheck = pPickFile->CacheGlyph(code, isRaster, pWorker, true); - // файл - в кэше. а тут нужно удалить + // file is in cache, but needs to be deleted here RELEASEINTERFACE(pPickFile); if (oSizesCheck.eState == glyphstateNormal) @@ -953,7 +953,7 @@ TFontCacheSizes CFontFile::CacheGlyph(const int& code, const bool& isRaster, CVe else pBitmap->pData = NULL; - // Все удаляется в кэше (во время очистки или замены) + // Everything is deleted in cache (during cleanup or replacement) pBitmap->bFreeData = FALSE; int nIndex2; @@ -1373,12 +1373,12 @@ static int GlyphPathConicTo(const FT_Vector *pControlPoint, const FT_Vector *pEn double dX3 = (double)pEndPoint->x / 64.0; double dY3 = (double)pEndPoint->y / 64.0; - // Строим кривую Безье второго порядка, с помощью кривой Безье третего порядка. Если p0, pC, p3 - - // начальная, контрольная и конечная точки, соответственно, для кривой Безье второго порядка. Тогда - // для этой же кривой, рассматриваемой как кривая Безье третьего порядка, точки p0, p1, p2, p3 будут - // начальной, две контрольные, конечная точки. Где p1 и p2 рассчитываются по следующим формулам: - // p1 = (1/3) * (p0 + 2pС) - // p2 = (1/3) * (2pС + p3) + // Build a quadratic Bezier curve using a cubic Bezier curve. If p0, pC, p3 are + // the start, control, and end points respectively for a quadratic Bezier curve, then + // for the same curve treated as a cubic Bezier curve, points p0, p1, p2, p3 will be + // the start, two control, and end points. Where p1 and p2 are calculated as follows: + // p1 = (1/3) * (p0 + 2pC) + // p2 = (1/3) * (2pC + p3) double dX1 = (double)(1.0 / 3.0) * (dX0 + (double)2 * dXc); double dY1 = (double)(1.0 / 3.0) * (dY0 + (double)2 * dYc); diff --git a/DesktopEditor/fontengine/FontFile.h b/DesktopEditor/fontengine/FontFile.h index da0ea7ff65..f9b15080fc 100644 --- a/DesktopEditor/fontengine/FontFile.h +++ b/DesktopEditor/fontengine/FontFile.h @@ -86,9 +86,9 @@ static std::wstring GetCorrectSfntName(const char* name) class TFontCacheSizes { public: - int Unicode; // Значение символа в юникоде - EGlyphState eState; // Есть ли символ в шрифте/стандартном шрифте - int nCMapIndex; // Номер таблицы 'cmap', в которой был найден данный символ + int Unicode; // Unicode character value + EGlyphState eState; // Whether character exists in font/standard font + int nCMapIndex; // Index of 'cmap' table where this character was found int GID; @@ -114,7 +114,7 @@ public: #define LOAD_MODE FT_LOAD_NO_HINTING | FT_LOAD_NO_AUTOHINT | FT_LOAD_NO_BITMAP | FT_LOAD_LINEAR_DESIGN -#define FONT_ITALIC_ANGLE 0.3090169943749 // Синус 18 градусов (подбиралось под Word 2007) +#define FONT_ITALIC_ANGLE 0.3090169943749 // Sine of 18 degrees (tuned for Word 2007) #define MAX_UNICODE_VALUE 0x10FFFF #define MAX_UNICODE_COUNT 0x110000 @@ -138,8 +138,8 @@ public: std::map<int, TFontCacheSizes> m_mapGids; std::map<int, TFontCacheSizes> m_mapUnicodes; - // потом гиды поменять на массив из индексов. - // особенно если не так много глифов. быстрота доступа важнее. + // later change gids to array of indices. + // especially if there aren't many glyphs. access speed is more important. CFontFile* m_pFile; @@ -166,9 +166,9 @@ public: bool m_bAntiAliasing; bool m_bUseKerning; - double m_dSize; // Размер шрифта - double m_unHorDpi; // Горизонтальное разрешение - double m_unVerDpi; // Вертикальное разрешение + double m_dSize; // Font size + double m_unHorDpi; // Horizontal resolution + double m_unVerDpi; // Vertical resolution INT m_bNeedDoItalic; INT m_bNeedDoBold; diff --git a/DesktopEditor/fontengine/FontManager.cpp b/DesktopEditor/fontengine/FontManager.cpp index 6db559cd1e..f2f4c2541c 100644 --- a/DesktopEditor/fontengine/FontManager.cpp +++ b/DesktopEditor/fontengine/FontManager.cpp @@ -130,7 +130,7 @@ NSFonts::IFontStream* CApplicationFontStreams::GetStream(const std::wstring &str pStream = (CFontStream*)NSFonts::NSApplicationFontStream::GetGlobalMemoryStorage()->Get(strFile); if (pStream) { - // чтобы удалить и из мапа и из стораджа + // to delete from both the map and the storage pStream->AddRef(); } } @@ -269,7 +269,7 @@ NSFonts::IFontFile* CFontsCache::LockFont(NSFonts::CLibrary& library, const std: } else { - // такого быть не должно + // this should not happen m_mapFiles.erase(_find); } } @@ -919,7 +919,7 @@ CFontFile* CFontManager::GetFontFileBySymbol(CFontFile* pFile, int code) if (sName.empty()) return NULL; - // чтобы не зарелизить при ограниченном кэше + // to avoid releasing when cache is limited CFontFile* pFontOld = m_pFont; m_pFont = NULL; std::wstring sOldName = m_sName; diff --git a/DesktopEditor/fontengine/FontManager.h b/DesktopEditor/fontengine/FontManager.h index 553e8300fd..83f2db6eda 100644 --- a/DesktopEditor/fontengine/FontManager.h +++ b/DesktopEditor/fontengine/FontManager.h @@ -56,7 +56,7 @@ public: class CApplicationFontStreams : public NSFonts::IApplicationFontStreams { private: - // этот мап нужно периодически опрашивать и удалять неиспользуемые стримы + // this map should be periodically checked and unused streams should be removed std::map<std::wstring, CFontStream*> m_mapStreams; public: diff --git a/DesktopEditor/fontengine/FontPath.cpp b/DesktopEditor/fontengine/FontPath.cpp index 137d75a261..7e2917e36f 100644 --- a/DesktopEditor/fontengine/FontPath.cpp +++ b/DesktopEditor/fontengine/FontPath.cpp @@ -35,15 +35,15 @@ // CPath //------------------------------------------------------------------------------------------------------------------------------- -// Path может быть в одном из трех следующий состояний: +// Path can be in one of the following three states: // -// 1. Нет текущей точки -- ни одного или более законченных SubPaths +// 1. No current point -- zero or more finished SubPaths // [m_nCurSubpath == m_nPointsCount] // -// 2. Одна точка в SubPaths +// 2. One point in SubPaths // [m_nCurSubpath == m_nPointsCount - 1] // -// 3. Открытый SubPaths c двумя или более точками +// 3. Open SubPaths with two or more points // [m_nCurSubpath < m_nPointsCount - 1] CFontPath::CFontPath() : NSFonts::IFontPath() diff --git a/DesktopEditor/fontengine/FontPath.h b/DesktopEditor/fontengine/FontPath.h index 8303199ae0..c4de7cbe53 100644 --- a/DesktopEditor/fontengine/FontPath.h +++ b/DesktopEditor/fontengine/FontPath.h @@ -55,16 +55,16 @@ struct TPathPoint // CPath.nFlags //------------------------------------------------------------------------------------------------------------------------------- -// Флаг для первой точки любого subpath +// Flag for first point of any subpath #define PathFirst 0x01 -// Флаг для последней точки любого subpath +// Flag for last point of any subpath #define PathLast 0x02 -// Если subpath замкнутый, тогда его последняя и первая точка должны совпадать, их флаг в данном случае следующий +// If subpath is closed, then its last and first points must coincide, their flag in this case is #define PathClosed 0x04 -// Флаг, означающий, что данная точка является контрольной для кривой Безье +// Flag indicating that this point is a control point for Bezier curve #define PathCurve 0x08 //------------------------------------------------------------------------------------------------------------------------------- @@ -119,7 +119,7 @@ public: INT GetCurPoint(double *pdX, double *pdY); - // Добавляем флаг StrokeAdjust. + // Add the StrokeAdjust flag. void AddStrokeAdjustHint(int nFirstControl, int nSecondControl, int nFirstPoint, int nLastPoint); virtual int ToInterface(NSFonts::ISimpleGraphicsPath* pPath); @@ -143,12 +143,12 @@ private: private: - TPathPoint *m_pPoints; // Массив точек - unsigned char *m_pFlags; // Массив флагов, указыающих значение точки в SubPath - int m_nPointsCount; // Количество точек - int m_nSize; // Непосредственный размер массива - - int m_nCurSubpath; // Номер первой точки последнего SubPath + TPathPoint *m_pPoints; // Array of points + unsigned char *m_pFlags; // Array of flags indicating point value in SubPath + int m_nPointsCount; // Number of points + int m_nSize; // Actual array size + + int m_nCurSubpath; // Index of first point in last SubPath TPathHint *m_pHints; // int m_nHintsCount; diff --git a/DesktopEditor/fontengine/GlyphString.cpp b/DesktopEditor/fontengine/GlyphString.cpp index 7d75da0164..bbc34ca3b0 100644 --- a/DesktopEditor/fontengine/GlyphString.cpp +++ b/DesktopEditor/fontengine/GlyphString.cpp @@ -360,7 +360,7 @@ void CGlyphString::GetBBox(float *pfLeft, float *pfTop, float *pfRight, float *p if ( 0 == nType && !( 1 == m_arrCTM[0] && 0 == m_arrCTM[1] && 0 == m_arrCTM[2] && 1 == m_arrCTM[3] && 0 == m_arrCTM[4] && 0 == m_arrCTM[5] ) ) { - // Применяем глобальную матрицу преобразования и пересчитываем BBox + // Apply global transformation matrix and recalculate BBox float arrfX[4] = { fLeft, fLeft, fRight, fRight }; float arrfY[4] = { fTop, fBottom, fBottom, fTop }; @@ -418,7 +418,7 @@ void CGlyphString::GetBBox2(float *pfLeft, float *pfTop, float *pfRight, float * if ( !( 1 == m_arrCTM[0] && 0 == m_arrCTM[1] && 0 == m_arrCTM[2] && 1 == m_arrCTM[3] && 0 == m_arrCTM[4] && 0 == m_arrCTM[5] ) ) { - // Применяем глобальную матрицу преобразования и пересчитываем BBox + // Apply global transformation matrix and recalculate BBox float arrfX[4] = { fLeft, fLeft, fRight, fRight }; float arrfY[4] = { fTop, fBottom, fBottom, fTop }; diff --git a/DesktopEditor/fontengine/GlyphString.h b/DesktopEditor/fontengine/GlyphString.h index 99388635d5..5b5abfda58 100644 --- a/DesktopEditor/fontengine/GlyphString.h +++ b/DesktopEditor/fontengine/GlyphString.h @@ -46,13 +46,13 @@ class TGlyphBitmap { public: - int nX; // Сдвиг по X начальной точки для рисования символа - int nY; // Сдвиг по Y начальной точки для рисования символа - int nWidth; // Ширина символа - int nHeight; // Высота символа - INT bAA; // Anti-aliased: True означает, что Bitmap 8-битный(т.е. с альфой); False - Bitmap 1-битный - BYTE* pData; // Bitmap data(картинка с символом) - INT bFreeData; // True, если память в pData нужно освободить + int nX; // X offset of starting point for drawing character + int nY; // Y offset of starting point for drawing character + int nWidth; // Character width + int nHeight; // Character height + INT bAA; // Anti-aliased: True means Bitmap is 8-bit (i.e. with alpha); False - Bitmap is 1-bit + BYTE* pData; // Bitmap data (image with character) + INT bFreeData; // True if memory in pData needs to be freed TGlyphBitmap(); ~TGlyphBitmap(); @@ -60,9 +60,9 @@ public: enum EGlyphState { - glyphstateNormal = 0, // символ отрисовался в нужном шрифте - glyphstateDefault, // символ отрисовался в дефолтовом шрифте - glyphstateMiss // символ не отрисовался + glyphstateNormal = 0, // character rendered in required font + glyphstateDefault, // character rendered in default font + glyphstateMiss // character was not rendered }; struct TMetrics @@ -82,9 +82,9 @@ struct TMetrics class TGlyph { public: - unsigned int lUnicode; // Юникод - float fX; // Позиция глифа - float fY; // на BaseLine + unsigned int lUnicode; // Unicode + float fX; // Glyph position + float fY; // on BaseLine float fLeft; // float fTop; // BBox @@ -107,7 +107,7 @@ public: namespace FontConstants { //--------------------------------------------------------------------------------------------------- - // Константы связанные с CharMap: Platform, Encoding ID + // Constants related to CharMap: Platform, Encoding ID //--------------------------------------------------------------------------------------------------- const long c_lUniPlatform = 0; @@ -180,19 +180,19 @@ public: float m_fTransX; float m_fTransY; - float m_fX; // Координаты начальной точки для рисования + float m_fX; // Starting point coordinates for drawing float m_fY; // - float m_fEndX; // Координаты конечной точки + float m_fEndX; // End point coordinates float m_fEndY; // - double m_arrCTM[6]; // Глобальная матрица преобразования - double m_dIDet; // (Детерминант матрицы преобразования)^(-1) - + double m_arrCTM[6]; // Global transformation matrix + double m_dIDet; // (Transformation matrix determinant)^(-1) + private: - TGlyph* m_pGlyphsBuffer; // Символы в данной строке - int m_nGlyphsCount; // Количество символов в строке - int m_nGlyphIndex; // Номер текущего символа + TGlyph* m_pGlyphsBuffer; // Characters in this string + int m_nGlyphsCount; // Number of characters in string + int m_nGlyphIndex; // Current character index }; #endif /* _BUILD_GLYPH_STRING_H */ diff --git a/DesktopEditor/fontengine/MemoryStream.h b/DesktopEditor/fontengine/MemoryStream.h index 4abebc1290..cbb773c3d6 100644 --- a/DesktopEditor/fontengine/MemoryStream.h +++ b/DesktopEditor/fontengine/MemoryStream.h @@ -72,7 +72,7 @@ namespace NSMemoryStream class CMemoryStream : public IGrObject { private: - // сам метафайл + // the metafile itself BYTE* m_pBuffer; BYTE* m_pBufferMem; diff --git a/DesktopEditor/fontengine/TextHyphen.cpp b/DesktopEditor/fontengine/TextHyphen.cpp index 8e4c91c02e..20c3aa1dd0 100644 --- a/DesktopEditor/fontengine/TextHyphen.cpp +++ b/DesktopEditor/fontengine/TextHyphen.cpp @@ -239,7 +239,7 @@ namespace NSHyphen int m_nLastLang; HyphenDict* m_pLastDict; - // работаем всегда в пределах одной памяти + // always work within a single memory block char* m_pHyphenVector; size_t m_nHyphenVectorSize; @@ -350,7 +350,7 @@ namespace NSHyphen } else { - // обнуляем после последнего использования + // reset after last use char* mem = m_pHyphenVector; while (*mem) *mem++ = 0; diff --git a/DesktopEditor/fontengine/TextShaper_p.h b/DesktopEditor/fontengine/TextShaper_p.h index 3c8f0933f1..ee7ad5b727 100644 --- a/DesktopEditor/fontengine/TextShaper_p.h +++ b/DesktopEditor/fontengine/TextShaper_p.h @@ -264,7 +264,7 @@ void CheckUnicodeFaceName(FT_Face pFace, int*& UName, unsigned int& ULen) sEncoding = "UTF-16BE"; break; case TT_MS_ID_UCS_4: - //sEncoding = "UCS4"; // см tt_ + //sEncoding = "UCS4"; // see tt_ sEncoding = "UTF-16BE"; break; //case TT_MS_ID_SJIS: diff --git a/DesktopEditor/fontengine/fontconverter/Consts.h b/DesktopEditor/fontengine/fontconverter/Consts.h index 711f297215..6e5c2e394c 100644 --- a/DesktopEditor/fontengine/fontconverter/Consts.h +++ b/DesktopEditor/fontengine/fontconverter/Consts.h @@ -34,10 +34,10 @@ namespace NSFontConverter { - const long c_lFromAll = 0xFFFF; // Конвертировать из любого формата - const long c_lFromTT = 0x0010; // Конвертировать из TrueType формата - const long c_lFromT1 = 0x0020; // Конвертировать из Type 1 формата - const long c_lFromCFF = 0x0040; // Конвертировать из CFF формата + const long c_lFromAll = 0xFFFF; // Convert from any format + const long c_lFromTT = 0x0010; // Convert from TrueType format + const long c_lFromT1 = 0x0020; // Convert from Type 1 format + const long c_lFromCFF = 0x0040; // Convert from CFF format const long c_lFlagsGids = 0x0080; } diff --git a/DesktopEditor/fontengine/fontconverter/FontConverter.cpp b/DesktopEditor/fontengine/fontconverter/FontConverter.cpp index e3d4ffa03b..09c786fb1b 100644 --- a/DesktopEditor/fontengine/fontconverter/FontConverter.cpp +++ b/DesktopEditor/fontengine/fontconverter/FontConverter.cpp @@ -72,7 +72,7 @@ bool CFontConverter::ToOTF(std::wstring sFontIn, std::wstring sFontOut, unsigned std::string sFontFormat( FT_Get_X11_Font_Format( pFace ) ); - // Проверим флаг конвертации и исходный формат шрифта + // Check conversion flag and source font format bool bNeedConvert = false; if ( nFlag == NSFontConverter::c_lFromAll || @@ -91,18 +91,18 @@ bool CFontConverter::ToOTF(std::wstring sFontIn, std::wstring sFontOut, unsigned NSFontConverter::CFontFileType1C *pT1C = NULL; if ( "Type 1" == sFontFormat ) { - // Сначала сконвертируем Type1 в CFF + // First convert Type1 to CFF NSFontConverter::CFontFileType1* pT1 = NSFontConverter::CFontFileType1::LoadFromFile( sFontIn.c_str() ); pT1->ToCFF( &NSFontConverter::CharBufferWrite, &oCFF ); delete pT1; - // Конвертируем CFF в OpenTypeCFF + // Convert CFF to OpenTypeCFF pT1C = NSFontConverter::CFontFileType1C::LoadFromBuffer( oCFF.sBuffer, oCFF.nLen ); } else { - // FreeType отдает тип шрифта CFF, в случаях когда файл имеет тип OpenType(CFF). - // Если так оно и есть, тогда нам с файлом ничего делать на надо. + // FreeType returns CFF font type in cases when the file is actually OpenType(CFF). + // If that's the case, we don't need to do anything with the file. pT1C = NSFontConverter::CFontFileType1C::LoadFromFile( sFontIn.c_str() ); } @@ -127,7 +127,7 @@ bool CFontConverter::ToOTF(std::wstring sFontIn, std::wstring sFontOut, unsigned if ( pSymbols ) { - // Сначала составим список нужных нами GID + // First build the list of required GIDs unsigned int* pUnicode = pSymbols; unsigned short* pGIDs = new unsigned short[nCount]; int nCMapIndex = 0; @@ -154,7 +154,7 @@ bool CFontConverter::ToOTF(std::wstring sFontIn, std::wstring sFontOut, unsigned pUseGlyfs = new unsigned char[lGlyfsCount]; ::memset( pUseGlyfs, 0x00, lGlyfsCount * sizeof(unsigned char) ); - pUseGlyfs[0] = 1; // нулевой гид всегда записываем + pUseGlyfs[0] = 1; // always write zero GID for ( int nGID = 1; nGID < lGlyfsCount; nGID++ ) { if ( 1 != pUseGlyfs[nGID] ) @@ -169,7 +169,7 @@ bool CFontConverter::ToOTF(std::wstring sFontIn, std::wstring sFontOut, unsigned } } - // Если данный символ составной (CompositeGlyf), тогда мы должны учесть все его дочерные символы (subglyfs) + // If this glyph is composite (CompositeGlyf), we must account for all its child glyphs (subglyfs) if ( bFound && 0 == FT_Load_Glyph( pFace, nGID, FT_LOAD_NO_SCALE | FT_LOAD_NO_RECURSE ) ) { for ( int nSubIndex = 0; nSubIndex < pFace->glyph->num_subglyphs; nSubIndex++ ) @@ -200,14 +200,14 @@ bool CFontConverter::ToOTF(std::wstring sFontIn, std::wstring sFontOut, unsigned else { // error parse font - // Просто копируем файл + // Just copy the file NSFile::CFileBinary::Copy(sFontIn, sFontOut); } } } else { - // Просто копируем файл + // Just copy the file NSFile::CFileBinary::Copy(sFontIn, sFontOut); } @@ -221,7 +221,7 @@ bool CFontConverter::ToOTF(std::wstring sFontIn, std::wstring sFontOut, unsigned bool CFontConverter::ToOTF2(std::wstring sFontIn, unsigned int* pSymbols, int nCount, std::wstring sNameW, long nFlag, long lFaceIndex, unsigned char*& pDstData, int& nDstLen) { - // функция просто скопирована и немного доработана. это все из-за нехватки времени. + // this function is just copied and slightly modified due to time constraints. FT_Library pLibrary = NULL; if ( FT_Init_FreeType( &pLibrary ) ) @@ -254,7 +254,7 @@ bool CFontConverter::ToOTF2(std::wstring sFontIn, unsigned int* pSymbols, int nC std::string sFontFormat( FT_Get_X11_Font_Format( pFace ) ); - // Проверим флаг конвертации и исходный формат шрифта + // Check conversion flag and source font format bool bNeedConvert = false; if ( nFlag == NSFontConverter::c_lFromAll || @@ -276,18 +276,18 @@ bool CFontConverter::ToOTF2(std::wstring sFontIn, unsigned int* pSymbols, int nC NSFontConverter::CFontFileType1C *pT1C = NULL; if ( "Type 1" == sFontFormat ) { - // Сначала сконвертируем Type1 в CFF + // First convert Type1 to CFF NSFontConverter::CFontFileType1* pT1 = NSFontConverter::CFontFileType1::LoadFromFile( sFontIn.c_str() ); pT1->ToCFF( &NSFontConverter::CharBufferWrite, &oCFF ); delete pT1; - // Конвертируем CFF в OpenTypeCFF + // Convert CFF to OpenTypeCFF pT1C = NSFontConverter::CFontFileType1C::LoadFromBuffer( oCFF.sBuffer, oCFF.nLen ); } else { - // FreeType отдает тип шрифта CFF, в случаях когда файл имеет тип OpenType(CFF). - // Если так оно и есть, тогда нам с файлом ничего делать на надо. + // FreeType returns CFF font type in cases when the file is actually OpenType(CFF). + // If that's the case, we don't need to do anything with the file. pT1C = NSFontConverter::CFontFileType1C::LoadFromFile( sFontIn.c_str() ); } @@ -309,7 +309,7 @@ bool CFontConverter::ToOTF2(std::wstring sFontIn, unsigned int* pSymbols, int nC if ( pSymbols ) { - // Сначала составим список нужных нами GID + // First build the list of required GIDs unsigned int* pUnicode = (unsigned int*)pSymbols; unsigned short* pGIDs = new unsigned short[nCount]; int nCMapIndex = 0; @@ -336,7 +336,7 @@ bool CFontConverter::ToOTF2(std::wstring sFontIn, unsigned int* pSymbols, int nC pUseGlyfs = new unsigned char[lGlyfsCount]; ::memset( pUseGlyfs, 0x00, lGlyfsCount * sizeof(unsigned char) ); - pUseGlyfs[0] = 1; // нулевой гид всегда записываем + pUseGlyfs[0] = 1; // always write zero GID for ( int nGID = 1; nGID < lGlyfsCount; nGID++ ) { if ( 1 != pUseGlyfs[nGID] ) @@ -351,7 +351,7 @@ bool CFontConverter::ToOTF2(std::wstring sFontIn, unsigned int* pSymbols, int nC } } - // Если данный символ составной (CompositeGlyf), тогда мы должны учесть все его дочерные символы (subglyfs) + // If this glyph is composite (CompositeGlyf), we must account for all its child glyphs (subglyfs) if ( bFound && 0 == FT_Load_Glyph( pFace, nGID, FT_LOAD_NO_SCALE | FT_LOAD_NO_RECURSE ) ) { for ( int nSubIndex = 0; nSubIndex < pFace->glyph->num_subglyphs; nSubIndex++ ) diff --git a/DesktopEditor/fontengine/fontconverter/FontConverter.h b/DesktopEditor/fontengine/fontconverter/FontConverter.h index b2bc45cfed..75f9f231c9 100644 --- a/DesktopEditor/fontengine/fontconverter/FontConverter.h +++ b/DesktopEditor/fontengine/fontconverter/FontConverter.h @@ -58,7 +58,7 @@ __interface IFontConverter : IDispatch [id(101)] HRESULT ToOTF([in] BSTR bsInFontFile, [in] BSTR pbsFontFileOut, [in, satype("unsigned short")] SAFEARRAY *pUnicode, [in] BSTR bsName, [in] long nFlag ); [id(102)] HRESULT ToOTF2([in] BSTR bsInFontFile, [in, satype("unsigned short")] SAFEARRAY *pUnicode, [in] BSTR bsName, [in] long nFlag, [in] long lSrcFaceIndex, [out, satype("BYTE")] SAFEARRAY** ppFontData); -//----- Для дополнительных функций ---------------------------------------------------------------- +//----- For additional functions ---------------------------------------------------------------- [id(10001)] HRESULT SetAdditionalParam([in] BSTR ParamName, [in] VARIANT ParamValue); [id(10002)] HRESULT GetAdditionalParam([in] BSTR ParamName, [out] VARIANT * ParamValue); @@ -109,18 +109,18 @@ public: FT_Face pFace = NULL; - // открываем файл + // open file HANDLE hFile = CreateFile( (LPCWSTR)bsFontIn, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (INVALID_HANDLE_VALUE == hFile) - return NULL; // Невозможно открыть файл + return NULL; // Cannot open file - // мапим этот файл в память - так быстрее читаются данные из файла + // map this file to memory - this way data is read faster from the file DWORD nFileSize = GetFileSize(hFile, NULL); HANDLE hMapFile = CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, nFileSize, NULL); if (NULL == hMapFile) { CloseHandle( hFile ); - return NULL; // Невозможно создать отображение файла + return NULL; // Cannot create file mapping } void *pBaseAddress = MapViewOfFile( hMapFile, FILE_MAP_READ, 0, 0, 0 ); @@ -150,7 +150,7 @@ public: CString sFontFormat( FT_Get_X11_Font_Format( pFace ) ); - // Проверим флаг конвертации и исходный формат шрифта + // Check conversion flag and source font format bool bNeedConvert = false; if ( nFlag == c_lFromAll || ( _T("TrueType") == sFontFormat && nFlag & c_lFromTT ) || ( _T("CFF") == sFontFormat && nFlag & c_lFromCFF ) || ( _T("Type 1") == sFontFormat && nFlag & c_lFromT1 ) ) @@ -166,18 +166,18 @@ public: CFontFileType1C *pT1C = NULL; if ( _T("Type 1") == sFontFormat ) { - // Сначала сконвертируем Type1 в CFF + // First convert Type1 to CFF CFontFileType1* pT1 = CFontFileType1::LoadFromFile( bsFontIn ); pT1->ToCFF( &CharBufferWrite, &oCFF ); delete pT1; - // Конвертируем CFF в OpenTypeCFF + // Convert CFF to OpenTypeCFF pT1C = CFontFileType1C::LoadFromBuffer( oCFF.sBuffer, oCFF.nLen ); } else { - // FreeType отдает тип шрифта CFF, в случаях когда файл имеет тип OpenType(CFF). - // Если так оно и есть, тогда нам с файлом ничего делать на надо. + // FreeType returns CFF font type when the file is actually OpenType(CFF). + // If that's the case, we don't need to do anything with the file. pT1C = CFontFileType1C::LoadFromFile( bsFontIn ); } @@ -202,7 +202,7 @@ public: if ( pUnicodeArray ) { - // Сначала составим список нужных нами GID + // First compile a list of GIDs we need LONG lCount = pUnicodeArray->rgsabound[0].cElements; unsigned short* pUnicode = (unsigned short*)pUnicodeArray->pvData; unsigned short* pGIDs = new unsigned short[lCount]; @@ -229,7 +229,7 @@ public: pUseGlyfs = new unsigned char[lGlyfsCount]; ::memset( pUseGlyfs, 0x00, lGlyfsCount * sizeof(unsigned char) ); - pUseGlyfs[0] = 1; // нулевой гид всегда записываем + pUseGlyfs[0] = 1; // always write the zero glyph for ( int nGID = 1; nGID < lGlyfsCount; nGID++ ) { if ( 1 != pUseGlyfs[nGID] ) @@ -244,7 +244,7 @@ public: } } - // Если данный символ составной (CompositeGlyf), тогда мы должны учесть все его дочерные символы (subglyfs) + // If this glyph is composite (CompositeGlyf), we must account for all its child glyphs (subglyfs) if ( bFound && 0 == FT_Load_Glyph( pFace, nGID, FT_LOAD_NO_SCALE | FT_LOAD_NO_RECURSE ) ) { for ( int nSubIndex = 0; nSubIndex < pFace->glyph->num_subglyphs; nSubIndex++ ) @@ -274,14 +274,14 @@ public: else { // error parse font - // Просто копируем файл + // Just copy the file CopyFile( bsFontIn, bsFontOut, FALSE ); } } } else { - // Просто копируем файл + // Just copy the file CopyFile( bsFontIn, bsFontOut, FALSE ); } @@ -297,7 +297,7 @@ public: STDMETHOD(ToOTF2)(BSTR bsFontIn, SAFEARRAY *pUnicodeArray, BSTR bsName, long nFlag, long lFaceIndex, SAFEARRAY** ppData) { - // функция просто скопирована и немного доработана. это все из-за нехватки времени. + // function is simply copied and slightly modified. all due to lack of time. FT_Library pLibrary = NULL; if ( FT_Init_FreeType( &pLibrary ) ) @@ -305,18 +305,18 @@ public: FT_Face pFace = NULL; - // открываем файл + // open file HANDLE hFile = CreateFile( (LPCWSTR)bsFontIn, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (INVALID_HANDLE_VALUE == hFile || NULL == ppData) - return NULL; // Невозможно открыть файл + return NULL; // Cannot open file - // мапим этот файл в память - так быстрее читаются данные из файла + // map this file to memory - this way data is read faster from the file DWORD nFileSize = GetFileSize(hFile, NULL); HANDLE hMapFile = CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, nFileSize, NULL); if (NULL == hMapFile) { CloseHandle( hFile ); - return NULL; // Невозможно создать отображение файла + return NULL; // Cannot create file mapping } void *pBaseAddress = MapViewOfFile( hMapFile, FILE_MAP_READ, 0, 0, 0 ); @@ -346,7 +346,7 @@ public: CString sFontFormat( FT_Get_X11_Font_Format( pFace ) ); - // Проверим флаг конвертации и исходный формат шрифта + // Check conversion flag and source font format bool bNeedConvert = false; if ( nFlag == c_lFromAll || ( _T("TrueType") == sFontFormat && nFlag & c_lFromTT ) || ( _T("CFF") == sFontFormat && nFlag & c_lFromCFF ) || ( _T("Type 1") == sFontFormat && nFlag & c_lFromT1 ) ) @@ -365,18 +365,18 @@ public: CFontFileType1C *pT1C = NULL; if ( _T("Type 1") == sFontFormat ) { - // Сначала сконвертируем Type1 в CFF + // First convert Type1 to CFF CFontFileType1* pT1 = CFontFileType1::LoadFromFile( bsFontIn ); pT1->ToCFF( &CharBufferWrite, &oCFF ); delete pT1; - // Конвертируем CFF в OpenTypeCFF + // Convert CFF to OpenTypeCFF pT1C = CFontFileType1C::LoadFromBuffer( oCFF.sBuffer, oCFF.nLen ); } else { - // FreeType отдает тип шрифта CFF, в случаях когда файл имеет тип OpenType(CFF). - // Если так оно и есть, тогда нам с файлом ничего делать на надо. + // FreeType returns CFF font type when the file is actually OpenType(CFF). + // If that's the case, we don't need to do anything with the file. pT1C = CFontFileType1C::LoadFromFile( bsFontIn ); } @@ -399,7 +399,7 @@ public: if ( pUnicodeArray ) { - // Сначала составим список нужных нами GID + // First compile a list of GIDs we need LONG lCount = pUnicodeArray->rgsabound[0].cElements; unsigned short* pUnicode = (unsigned short*)pUnicodeArray->pvData; unsigned short* pGIDs = new unsigned short[lCount]; @@ -426,7 +426,7 @@ public: pUseGlyfs = new unsigned char[lGlyfsCount]; ::memset( pUseGlyfs, 0x00, lGlyfsCount * sizeof(unsigned char) ); - pUseGlyfs[0] = 1; // нулевой гид всегда записываем + pUseGlyfs[0] = 1; // always write the zero glyph for ( int nGID = 1; nGID < lGlyfsCount; nGID++ ) { if ( 1 != pUseGlyfs[nGID] ) @@ -441,7 +441,7 @@ public: } } - // Если данный символ составной (CompositeGlyf), тогда мы должны учесть все его дочерные символы (subglyfs) + // If this glyph is composite (CompositeGlyf), we must account for all its child glyphs (subglyfs) if ( bFound && 0 == FT_Load_Glyph( pFace, nGID, FT_LOAD_NO_SCALE | FT_LOAD_NO_RECURSE ) ) { for ( int nSubIndex = 0; nSubIndex < pFace->glyph->num_subglyphs; nSubIndex++ ) diff --git a/DesktopEditor/fontengine/fontconverter/FontFileTrueType.cpp b/DesktopEditor/fontengine/fontconverter/FontFileTrueType.cpp index 99f2a91eac..03528edcc0 100644 --- a/DesktopEditor/fontengine/fontconverter/FontFileTrueType.cpp +++ b/DesktopEditor/fontengine/fontconverter/FontFileTrueType.cpp @@ -40,16 +40,16 @@ namespace NSFontConverter { // - // Терминология + // Terminology // ----------- // - // character code = номер, используемый как элемент текстовой строки + // character code = number used as an element of a text string // - // character name = glyph name = имя определенного символа фонта + // character name = glyph name = name of a specific font character // - // glyph index = GID = позиция (в предела некоторой внутренней таблицы - // в фонте), где приведены инструкции как рисовать - // данный символ + // glyph index = GID = position (within some internal table + // in the font) where instructions for drawing + // the character are provided // // Type 1 fonts // ------------ @@ -94,8 +94,8 @@ namespace NSFontConverter // //------------------------------------------------------------------------ - // Названия символов в стандартном порядке, который использует Apple для - // своих TrueType фонтов. + // Symbol names in standard order used by Apple for + // their TrueType fonts. static char *c_arrAppleGlyphNames[258] = { ".notdef", "null", "CR", "space", @@ -376,7 +376,7 @@ namespace NSFontConverter if ( m_bOpenTypeCFF ) return; - // пишем заголовок + // write header bool bSuccess = true; seBuffer = StringExt::Format("%!PS-TrueTypeFont-{0:2g}\n", (double)GetS32BE( 0, &bSuccess ) / 65536.0 ); (*pOutputFunc)( pOutputStream, seBuffer->GetBuffer(), seBuffer->GetLength() ); @@ -393,12 +393,12 @@ namespace NSFontConverter delete seBuffer; (*pOutputFunc)( pOutputStream, "/PaintType 0 def\n", 17); - // записываем содержимое библиотеки шрифта + // write font library contents ConvertEncoding( ppEncoding, pOutputFunc, pOutputStream ); ConvertCharStrings( ppEncoding, pCodeToGID, pOutputFunc, pOutputStream); ConvertSfnts( pOutputFunc, pOutputStream, NULL, false ); - // закончили запись библиотеки + // finished writing library (*pOutputFunc)( pOutputStream, "FontName currentdict end definefont pop\n", 40); } @@ -757,11 +757,11 @@ namespace NSFontConverter unsigned int t; int nPos = 0, i, j, k, n; - // Такого не должно быть + // This should not happen if ( m_bOpenTypeCFF ) return; - // Проверяем недостающие таблицы + // Check for missing tables bool bMissingCmap = (nCmapIndex = SeekTable("cmap")) < 0; bool bMissingName = SeekTable("name") < 0; bool bMissingPost = SeekTable("post") < 0; @@ -787,8 +787,8 @@ namespace NSFontConverter { bUnsortedLoca = true; } - // Описание глифа должны быть как минимум 12 байт (nContours, - // xMin, yMin, xMax, yMax, instructionLength - каждый по 2 байта); + // Glyph description must be at least 12 bytes (nContours, + // xMin, yMin, xMax, yMax, instructionLength - each 2 bytes); if (i > 0 && pLocaTable[i].nOrigOffset - pLocaTable[i-1].nOrigOffset > 0 && pLocaTable[i].nOrigOffset - pLocaTable[i-1].nOrigOffset < 12) { pLocaTable[i-1].nOrigOffset = pLocaTable[i].nOrigOffset; @@ -797,7 +797,7 @@ namespace NSFontConverter pLocaTable[i].nIndex = i; } - // Проверяем наличие нулевых таблиц + // Check for null tables nZeroLengthTables = 0; for (i = 0; i < m_nTablesCount; ++i) { @@ -805,7 +805,7 @@ namespace NSFontConverter ++nZeroLengthTables; } - // Проверяем длину таблицы Cmap + // Check Cmap table length badCmapLen = false; nCmapLen = 0; if ( !bMissingCmap ) @@ -825,12 +825,12 @@ namespace NSFontConverter } } - // Проверяем, является ли таблица 'hmtx' сокращенной. + // Check if 'hmtx' table is abbreviated. i = SeekTable("hhea"); nHMetrics = GetU16BE(m_pTables[i].nOffset + 34, &bSuccess); abbrevHMTX = nHMetrics < m_nGlyphs; - // Если все впорядке, и нам не надо переписывать таблицы 'cmap' и 'name', тогда пишем файл TTF как он есть + // If everything is fine and we don't need to rewrite 'cmap' and 'name' tables, write TTF file as is if (!bMissingCmap && !bMissingName && !bMissingPost && !bMissingOS2 && !bUnsortedLoca && !badCmapLen && !abbrevHMTX && nZeroLengthTables == 0 && !sName && !pCodeToGID && !pUseGlyfs ) { (*pOutputFunc)( pOutputStream, (char *)m_sFile, m_nLen); @@ -838,12 +838,12 @@ namespace NSFontConverter return; } - // Сортируем таблицу 'loca': некоторые шрифты содержат неупорядоченную - // таблицу 'loca'; а некоторые шрифты с нормальной таблицей 'loca' - // содержат пустые элементы в середине таблицы, cmpTrueTypeLocaOffset - // использует сдвиги как основной ключ для сортировки, а номера глифов - // как второй ключ (чтобы элементы в таблице, которые имели одинаковую позицию - // шли в том же порядке, как и в исходном шрифте) + // Sort 'loca' table: some fonts contain unsorted 'loca' table; + // and some fonts with normal 'loca' table contain empty elements + // in the middle, cmpTrueTypeLocaOffset uses offsets as primary + // sort key and glyph numbers as secondary key (so elements in + // the table that had the same position go in the same order + // as in the original font) nGlyphLen = 0; if (bUnsortedLoca || pUseGlyfs) { @@ -858,7 +858,7 @@ namespace NSFontConverter for (i = 0; i <= m_nGlyphs; ++i) { - // TO DO: Протестировать тут запись только тех глифов, которые нам нужны + // TO DO: Test here writing only the glyphs we need if ( pUseGlyfs && lGlyfsCount == m_nGlyphs ) { @@ -890,7 +890,7 @@ namespace NSFontConverter nGlyphLen = nPos; } - // Вычисляем чексуммы таблиц 'loca' и 'glyf' + // Calculate checksums for 'loca' and 'glyf' tables nLocaChecksum = nGlyphChecksum = 0; if (bUnsortedLoca || pUseGlyfs) { @@ -927,7 +927,7 @@ namespace NSFontConverter } } - // Строим новую таблицу 'name' + // Build new 'name' table if ( sName ) { n = strlen(sName); @@ -977,7 +977,7 @@ namespace NSFontConverter arrNewNameTable = NULL; } - // Строим новую таблицу 'cmap' + // Build new 'cmap' table if (pCodeToGID) { //nNewCmapLen = 44 + 256 * 2; @@ -986,9 +986,9 @@ namespace NSFontConverter //arrNewCmapTable[1] = 0; // //arrNewCmapTable[2] = 0; // number of encoding tables = 1 //arrNewCmapTable[3] = 1; // - //arrNewCmapTable[4] = 0; // platform ID = 1 (MacOS) // Эти два поля обязательно должны - //arrNewCmapTable[5] = 1; // // иметь таки значения, иначе, Adobe - //arrNewCmapTable[6] = 0; // encoding ID = 0 // Acrobat может открыть данный шрифт. + //arrNewCmapTable[4] = 0; // platform ID = 1 (MacOS) // These two fields must have + //arrNewCmapTable[5] = 1; // // these values, otherwise Adobe + //arrNewCmapTable[6] = 0; // encoding ID = 0 // Acrobat can open this font. //arrNewCmapTable[7] = 0; // // //arrNewCmapTable[8] = 0; // offset of subtable //arrNewCmapTable[9] = 0; // @@ -1038,9 +1038,9 @@ namespace NSFontConverter arrNewCmapTable[1] = 0; // arrNewCmapTable[2] = 0; // number of encoding tables = 1 arrNewCmapTable[3] = 1; // - arrNewCmapTable[4] = 0; // platform ID = 1 (MacOS) // Эти два поля обязательно должны - arrNewCmapTable[5] = 1; // // иметь таки значения, иначе, Adobe - arrNewCmapTable[6] = 0; // encoding ID = 0 // Acrobat может открыть данный шрифт. + arrNewCmapTable[4] = 0; // platform ID = 1 (MacOS) // These two fields must have + arrNewCmapTable[5] = 1; // // these values, otherwise Adobe + arrNewCmapTable[6] = 0; // encoding ID = 0 // Acrobat can open this font. arrNewCmapTable[7] = 0; // // arrNewCmapTable[8] = 0; // offset of subtable arrNewCmapTable[9] = 0; // @@ -1069,7 +1069,7 @@ namespace NSFontConverter arrNewCmapTable = NULL; } - // Генерируем новую таблицу 'hmtx' и обновляем таблицу 'hhea' + // Generate new 'hmtx' table and update 'hhea' table if ( abbrevHMTX ) { i = SeekTable("hhea"); @@ -1113,13 +1113,13 @@ namespace NSFontConverter nNewHHEALen = nNewHMTXLen = 0; } - // Создаем список таблиц: - // - сохраняем исходные ненулевые таблицы - // - переписываем длину таблицы 'cmap', если необходимо - // - добавляем недостающие таблицы - // - сортируем таблицы по тэгам - // - вычисляем новые позиции таблиц, с учетом 4-байтового выравнивания - // - пересчитываем чексуммы таблиц + // Create table list: + // - save original non-null tables + // - rewrite 'cmap' table length if necessary + // - add missing tables + // - sort tables by tags + // - calculate new table positions with 4-byte alignment + // - recalculate table checksums nNewTables = m_nTablesCount - nZeroLengthTables + (bMissingCmap ? 1 : 0) + (bMissingName ? 1 : 0) + (bMissingPost ? 1 : 0) + (bMissingOS2 ? 1 : 0); pNewTables = (TrueTypeTable *)malloc( nNewTables * sizeof(TrueTypeTable) ); j = 0; @@ -1263,7 +1263,7 @@ namespace NSFontConverter } } - // Записываем информацию о таблицах в файле + // Write table information to file arrTableDir = (char *)malloc(12 + nNewReqTables * 16); arrTableDir[0] = 0x00; // sfnt version arrTableDir[1] = 0x01; // @@ -1306,7 +1306,7 @@ namespace NSFontConverter } (*pOutputFunc)( pOutputStream, arrTableDir, 12 + nNewReqTables * 16); - // Вычисляем чексумму файла + // Calculate file checksum nFileChecksum = ComputeTableChecksum((unsigned char *)arrTableDir, 12 + nNewReqTables * 16); for (i = 0; i < nNewTables; ++i) { @@ -1317,7 +1317,7 @@ namespace NSFontConverter } nFileChecksum = 0xb1b0afba - nFileChecksum; - // Записываем сами таблицы + // Write tables themselves for (i = 0; i < nNewTables; ++i) { if ( 1 == pUseTable[i] ) @@ -1441,7 +1441,7 @@ namespace NSFontConverter void CFontFileTrueType::ConvertEncoding (char **ppEncoding, FontFileOutputFunc pOutputFunc, void *pOutputStream) { - // конвертация кодировки в тип Type42 + // encoding conversion to Type42 type char *sName; StringExt *seBuffer; @@ -1488,9 +1488,9 @@ namespace NSFontConverter return; } - // Ставим в соответствие названию символа glyph индекс: - // 1. Используем ppEncoding для отображения имени символа в его номер - // 2. Используем pnCodeToGID для отображения номера символа в glyph индекс + // Map symbol name to glyph index: + // 1. Use ppEncoding to map symbol name to its number + // 2. Use pnCodeToGID to map symbol number to glyph index int nGlyphIndex = 0; for (int nIndex = 255; nIndex >= 0; --nIndex) { @@ -1594,7 +1594,7 @@ namespace NSFontConverter } } - // Создаем новую таблицу 'loca' + // Create new 'loca' table pLocaData = (unsigned char *)MemUtilsMallocArray( m_nGlyphs + 1, (m_nLocaFormat ? 4 : 2) ); for (int nIndex = 0; nIndex <= m_nGlyphs; ++nIndex ) { @@ -1613,7 +1613,7 @@ namespace NSFontConverter } } - // считаем число таблиц + // count number of tables nNewTables = 0; for (int nIndex = 0; nIndex < nT42Tables; ++nIndex ) { @@ -1764,19 +1764,19 @@ namespace NSFontConverter nPos += 16; } - // вычисляем checksum и сохраняем ее в заголовке таблицы + // calculate checksum and save it in table header nChecksum = ComputeTableChecksum( arrTableDir, 12 + nNewTables*16); for (int nIndex = 0; nIndex < nNewTables; ++nIndex) { nChecksum += arrNewTables[ nIndex ].unChecksum; } - nChecksum = 0xb1b0afba - nChecksum; // по спецификации TrueType + nChecksum = 0xb1b0afba - nChecksum; // per TrueType specification pHeadData[ 8] = (unsigned char)(nChecksum >> 24); pHeadData[ 9] = (unsigned char)(nChecksum >> 16); pHeadData[10] = (unsigned char)(nChecksum >> 8); pHeadData[11] = (unsigned char) nChecksum; - // начинаем писать массив sfnts + // start writing sfnts array if ( seName ) { (*pOutputFunc)( pOutputStream, "/", 1); @@ -1790,7 +1790,7 @@ namespace NSFontConverter DumpString( arrTableDir, 12 + nNewTables*16, pOutputFunc, pOutputStream); - // пишем таблицы + // write tables for (int nIndex = 0; nIndex < nNewTables; ++nIndex) { if ( t42HeadTable == nIndex ) @@ -1815,8 +1815,8 @@ namespace NSFontConverter } else { - // nLength == 0 означает, что таблица не найдена, а ошибка уже была выдана - // во время конструирования таблицы + // nLength == 0 means table not found, and error was already issued + // during table construction if ( ( nLength = arrNewTables[nIndex].nLen ) > 0 ) { if ( ( nJ = SeekTable( t42Tables[nIndex].sTag ) ) >= 0 && CheckRegion( m_pTables[nJ].nOffset, m_pTables[nJ].nLen ) ) @@ -1836,7 +1836,7 @@ namespace NSFontConverter } } - // закончили писать массив sfnts + // finished writing sfnts array (*pOutputFunc)( pOutputStream, "] def\n", 6); MemUtilsFree( pLocaData ); @@ -1874,7 +1874,7 @@ namespace NSFontConverter (*pOutputFunc)( pOutputStream, "00", 2); } } - // Добавляем дополнительный нулевой байт, по спецификации Adobe Type 42 + // Add extra null byte per Adobe Type 42 specification (*pOutputFunc)( pOutputStream, "00>\n", 4); } @@ -1913,7 +1913,7 @@ namespace NSFontConverter m_bSuccess = true; - // Проверяем является ли данный файл (TTC) + // Check if this file is (TTC) unsigned int usTopTag = GetU32BE(0, &m_bSuccess); if ( !m_bSuccess ) return; @@ -1927,12 +1927,12 @@ namespace NSFontConverter else nPos = 0; - // Проверяем sfnt версию + // Check sfnt version int nSfntVersion = GetU32BE( nPos, &m_bSuccess); if ( !m_bSuccess ) return; - // Проверяем на формат данных. CCF или нет? + // Check data format. CFF or not? m_bOpenTypeCFF = ( nSfntVersion == 0x4f54544f ); // 'OTTO' m_nTablesCount = GetU16BE( nPos + 4, &m_bSuccess); @@ -1957,14 +1957,14 @@ namespace NSFontConverter if ( !m_bSuccess ) return; - // ищем таблицы необходимые как и для TrueType так и для Type 42 + // find tables needed for both TrueType and Type 42 if ( SeekTable("head") < 0 || SeekTable("hhea") < 0 || SeekTable("maxp") < 0 || SeekTable("hmtx") < 0 || ( !m_bOpenTypeCFF && SeekTable("loca") < 0 ) || ( !m_bOpenTypeCFF && SeekTable("glyf" ) < 0) || ( m_bOpenTypeCFF && SeekTable("CFF " ) < 0 ) ) { m_bSuccess = false; return; } - // читаем таблицы CMaps + // read CMaps tables if ( ( nIndex = SeekTable("cmap") ) >= 0 ) { nPos = m_pTables[nIndex].nOffset + 2; @@ -2012,7 +2012,7 @@ namespace NSFontConverter if (!m_bSuccess) return; - // Проверяем корректность таблицы loca + // Check loca table validity if ( !m_bOpenTypeCFF ) { nIndex = SeekTable("loca"); @@ -2039,7 +2039,7 @@ namespace NSFontConverter return; } - // Читаем таблицу post + // Read post table ReadPostTable(); } diff --git a/DesktopEditor/fontengine/fontconverter/FontFileTrueType.h b/DesktopEditor/fontengine/fontconverter/FontFileTrueType.h index 607c0d726d..3ca105832a 100644 --- a/DesktopEditor/fontengine/fontconverter/FontFileTrueType.h +++ b/DesktopEditor/fontengine/fontconverter/FontFileTrueType.h @@ -118,8 +118,8 @@ namespace NSFontConverter struct T42Table { - char *sTag; // 4-байтовое название - bool bRequired; // Требуется ли по спецификации TrueType? + char *sTag; // 4-byte tag name + bool bRequired; // Required by TrueType specification? }; // TrueType tables to be embedded in Type 42 fonts. @@ -153,16 +153,16 @@ namespace NSFontConverter { public: - // Создаем объект TTF из буфера. + // Create TTF object from buffer. static CFontFileTrueType *LoadFromBuffer(char *sBuffer, int lenA); - // Создаем объект TTF из файла. + // Create TTF object from file. static CFontFileTrueType *LoadFromFile(const wchar_t *wsFileName); virtual ~CFontFileTrueType(); - // TRUE, если данный OpenType фонт содержите данные формата CFF. - // FALSE,если это TrueType фонт ( или OpenType фонт с данными в формате TrueType). + // TRUE if this OpenType font contains CFF format data. + // FALSE if this is a TrueType font (or OpenType font with TrueType format data). bool IsOpenTypeCFF() { return m_bOpenTypeCFF; @@ -176,25 +176,25 @@ namespace NSFontConverter int FindCmap(int nPlatform, int nEncoding); - // Возвращает GID, соответствующий символу <nChar> в <nIndex>ной CMap. + // Returns GID corresponding to character <nChar> in CMap <nIndex>. unsigned short MapCodeToGID(int nCMapIndex, int nChar); - // Возвращает GID, соответствующий <sName> в таблице post. Возвращает 0, - // если символа с таким именем не нашли, или таблицы post нет. + // Returns GID corresponding to <sName> in post table. Returns 0 + // if glyph with this name was not found, or post table doesn't exist. int MapNameToGID(char *sName); - // Возвращает карту CIDs в GIDs, и возваращет количество элементов - // CIDs в *<pnCIDs>. Только для CID фонтов( OpenType CFF ) + // Returns CIDs to GIDs map, and returns the number of CID elements + // in *<pnCIDs>. Only for CID fonts (OpenType CFF). unsigned short *GetCIDToGIDMap(int *pnCIDs); - // Лицензионные ограничения на включение фонта( в соответствие со - // спецификацией True Type): + // Font embedding licensing restrictions (according to + // TrueType specification): - // * 4: таблицы OS/2 не найдена или некорректна - // * 3: разрешено устанавливать - // * 2: разрешено редактировать - // * 1: разрешено просматривать и печатать - // * 0: ограничено лицензией + // * 4: OS/2 table not found or invalid + // * 3: installable embedding allowed + // * 2: editable embedding allowed + // * 1: preview and print embedding allowed + // * 0: restricted by license int GetEmbeddingRestrictions(); // Convert to a Type 42 font, suitable for embedding in a PostScript @@ -239,10 +239,10 @@ namespace NSFontConverter // PostScript font name. (Only useful for OpenType CFF fonts.) void ToType0(char *sPSName, FontFileOutputFunc pOutputFunc, void *pOutputStream); - // Записываем TrueTypeFont File, заполняя недостающие таблицы и корректируя - // различные ошибки. Если задан парметр <sName>, в шрифте переписываем таблицу - // 'name'. Если задан парамтре <pCodeToGID>, тогда в шрифте переписываем - // таблицу 'cmap'. + // Write TrueTypeFont file, filling in missing tables and correcting + // various errors. If <sName> parameter is specified, rewrite the 'name' + // table in the font. If <pCodeToGID> parameter is specified, rewrite + // the 'cmap' table in the font. void WriteTTF(FontFileOutputFunc pOutputFunc, void *pOutputStream, const char *sName = NULL, unsigned short *pCodeToGID = NULL, unsigned char *pUseGlyfs = NULL, long lGlyfsCount = 0) ; private: diff --git a/DesktopEditor/fontengine/fontconverter/FontFileType1.cpp b/DesktopEditor/fontengine/fontconverter/FontFileType1.cpp index 93730a2805..13c2b01943 100644 --- a/DesktopEditor/fontengine/fontconverter/FontFileType1.cpp +++ b/DesktopEditor/fontengine/fontconverter/FontFileType1.cpp @@ -56,7 +56,7 @@ namespace NSFontConverter (ch) == '\f' || \ (ch) == '\0' ) - // Таблица для быстрого конвертирования цифр (десятичных и не десятичных) в числа + // Table for fast conversion of digits (decimal and non-decimal) to numbers static const signed char c_arrCharTable[128] = { /* 0x00 */ @@ -70,7 +70,7 @@ namespace NSFontConverter 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, }; - // Ни один символ больше >= 0x80 не может представлять число + // No character >= 0x80 can represent a number #define OP >= #define WriteChar(Value) \ @@ -214,17 +214,17 @@ namespace NSFontConverter char sBuffer[512]; char *sLine, *sLine2, *sCurChar; - // копируем все до строчки /Encoding + // copy everything up to the /Encoding line for ( sLine = (char *)m_sFile; sLine && strncmp( sLine, "/Encoding", 9); sLine = GetNextLine(sLine) ); if ( !sLine ) { - // не нашли кодировку, тогда копируем целиком фонт файл + // encoding not found, copy the entire font file (*pOutputFunc)( pOutputStream, (char *)m_sFile, m_nLen); return; } (*pOutputFunc)( pOutputStream, (char *)m_sFile, sLine - (char *)m_sFile); - // пишем новую кодировку + // write new encoding (*pOutputFunc)( pOutputStream, "/Encoding 256 array\n", 20); (*pOutputFunc)( pOutputStream, "0 1 255 {1 index exch /.notdef put} for\n", 40); for ( int nIndex = 0; nIndex < 256; ++nIndex ) @@ -255,7 +255,7 @@ namespace NSFontConverter } } - // У некоторых фонтов две записи /Encoding, поэтому проверяем наличие второй записи + // Some fonts have two /Encoding entries, so we check for a second one if ( sLine ) { int nIndex; @@ -282,7 +282,7 @@ namespace NSFontConverter } } - // копируем все после кодировки + // copy everything after the encoding if ( sLine ) { (*pOutputFunc)( pOutputStream, sLine, ((char *)m_sFile + m_nLen) - sLine ); @@ -309,7 +309,7 @@ namespace NSFontConverter void CFontFileType1::Parse() { - // Сначала проверим, если это pfb файл, тогда избавимся от всех его маркеров. + // First check if this is a pfb file, then remove all its markers. Reset(); while( m_nPos < m_nLen && ( ' ' == m_sFile[m_nPos] || '\t' == m_sFile[m_nPos] || '\r' == m_sFile[m_nPos] || '\n' == m_sFile[m_nPos] ) ) @@ -452,16 +452,16 @@ namespace NSFontConverter memcpy( sEexecBuffer, sEexec + 17, nBufferLen ); DecryptEexec( &sEexecBuffer, nBufferLen ); - sEexec = sEexecBuffer + 4; // Первые четыре байта были случайными + sEexec = sEexecBuffer + 4; // First four bytes were random int nEexecLen = nBufferLen - 4; - // Теперь прочитаем содержимое Private Dict + // Now read the contents of Private Dict bool bGlyphsSection = false, bSubrsSection = false; //unsigned short ushChar = ''; std::wstring sToken, sGlyph; int nLength = 0; - // Выставляем значения по умолчанию элементов Private Dict + // Set default values for Private Dict elements m_oPrivateDict.nBlueValues = 0; m_oPrivateDict.nOtherBlues = 0; m_oPrivateDict.nFamilyBlues = 0; @@ -586,7 +586,7 @@ namespace NSFontConverter m_oPrivateDict.nStemSnapV = ReadDoubleArray<type1MaxStemSnap>( sEexec + nIndex + 2, nEexecLen - nIndex - 2, m_oPrivateDict.arrdStemSnapV ); else if ( L"/StdHW" == sToken ) { - // Здесь содержится массив с одним значением + // This contains an array with a single value double dTemp[1]; if ( ReadDoubleArray<1>( sEexec + nIndex + 2, nEexecLen - nIndex - 2, dTemp ) > 0 ) @@ -597,7 +597,7 @@ namespace NSFontConverter } else if ( L"/StdVW" == sToken ) { - // Здесь содержится массив с одним значением + // This contains an array with a single value double dTemp[1]; if ( ReadDoubleArray<1>( sEexec + nIndex + 2, nEexecLen - nIndex - 2, dTemp ) > 0 ) { @@ -620,7 +620,7 @@ namespace NSFontConverter } MemUtilsFree( sEexecBuffer ); - // Проведем сортировку элементов m_arrCharstrings по юникодному значению + // Sort m_arrCharstrings elements by unicode value qsort( m_arrCharstrings.data(), m_arrCharstrings.size(), sizeof(Type1Glyph), CompareType1Glyph ); } @@ -629,8 +629,8 @@ namespace NSFontConverter void CFontFileType1::DecryptEexec(unsigned char** ppEexecBuffer, int nLen) { - // Согласно спецификации Type1, первый байт не должен быть ASCII пробелом - // (пробел, таб, перенос каретки или перенос строки). + // According to Type1 specification, the first byte must not be an ASCII whitespace + // (space, tab, carriage return, or line feed). unsigned char *sCur = (unsigned char*)(*ppEexecBuffer); while( sCur < (unsigned char*)(*ppEexecBuffer) + nLen && ( ' ' == *sCur || '\t' == *sCur || '\r' == *sCur || '\n' == *sCur ) ) { @@ -638,8 +638,8 @@ namespace NSFontConverter --nLen; } - // Теперь нам надо определить в каком формате у нас данные: ASKII или бинарные данные. - // Если первые четыре байта являются шестнадцатиричными символами, значит, кодировка ASCII. + // Now we need to determine the data format: ASCII or binary. + // If the first four bytes are hexadecimal characters, the encoding is ASCII. bool bASCII = false; if ( nLen > 3 && isxdigit( sCur[0] ) && isxdigit( sCur[1] ) && isxdigit( sCur[2] ) && isxdigit( sCur[3] ) ) @@ -682,7 +682,7 @@ namespace NSFontConverter return false; } - // Читаем сам блок данных + // Read the data block itself if ( nBlockLen > 0 ) { if ( !sBuffer ) @@ -722,7 +722,7 @@ namespace NSFontConverter { int nValue = sString[nIndex]; - if ( nValue < 32 ) // команда + if ( nValue < 32 ) // command { int nCommand = 0; @@ -769,7 +769,7 @@ namespace NSFontConverter nWidth = sCharString[1].nValue / sCharString[2].nValue; else { - // TO DO: обработать ошибку + // TODO: handle error nWidth = 0; } @@ -801,7 +801,7 @@ namespace NSFontConverter break; else if ( c_nType1seac == nCommand || c_nType1sbw == nCommand ) { - // TO DO: обработать ошибку + // TODO: handle error } sCharString.push_back( Type1CharstringItem( nCommand, true ) ); @@ -892,7 +892,7 @@ namespace NSFontConverter } else { - // Type1 charstrings используют деления для чисел больших 32000 + // Type1 charstrings use division for numbers greater than 32000 if ( oItem.nValue > 32000 ) { int nDivisor = oCharstring.arrCharstring[nIndex + 1].nValue; @@ -917,10 +917,10 @@ namespace NSFontConverter return; } - // Первые два байта - количество элементов + // First two bytes - number of elements WriteChar( nCount >> 8 ); WriteChar( nCount & 0xFF ); - // Размер сдвигов, ставим по максимуму + // Offset size, set to maximum WriteChar( 0x04 ); int nRelativeOffset = 1; @@ -951,10 +951,10 @@ namespace NSFontConverter return; } - // Первые два байта - количество элементов + // First two bytes - number of elements WriteChar( nCount >> 8 ); WriteChar( nCount & 0xFF ); - // Размер сдвигов, ставим по максимуму + // Offset size, set to maximum WriteChar( 0x04 ); int nRelativeOffset = 1; @@ -999,7 +999,7 @@ namespace NSFontConverter { char nChar = 0; - WriteChar( 0x1e ); // начало десятичного числа + WriteChar( 0x1e ); // start of decimal number std::wstring sValue = std::to_wstring(dValue); bool bFirstNibble = true; @@ -1026,7 +1026,7 @@ namespace NSFontConverter bFirstNibble = !bFirstNibble; } - // Записываем окончаниедесятичного числа + // Write the end of decimal number if ( bFirstNibble ) nChar = (char)0xff; else @@ -1118,7 +1118,7 @@ namespace NSFontConverter // GlobalSubrs TCharBuffer oGlobalSubrs; - aString.clear(); // Записываем пустой массив + aString.clear(); // Write an empty array CFFCreateIndexHeader( CharBufferWrite, &oGlobalSubrs, aString ); // Charset @@ -1248,8 +1248,8 @@ namespace NSFontConverter CFFEncodeNumber( CharBufferWrite, &oTopDict, m_oTopDict.arrdFontBBox[3] ); oTopDict.Write( "\x05", 1 ); - // Теперь оценим размер TopDict: Возьмем текущую длину, добавим к ней (4 * 5 + 3) - // ( 4 числа, которые пишем по 5 байт + 3 байта на 3 команды) + // Now estimate TopDict size: take current length, add (4 * 5 + 3) + // (4 numbers written as 5 bytes each + 3 bytes for 3 commands) int nTopDictLen = oTopDict.nLen + ( 4 * 5 + 3); int nOffset = oHeader.nLen + oName.nLen + nTopDictLen + oStrings.nLen + oGlobalSubrs.nLen; @@ -1265,14 +1265,14 @@ namespace NSFontConverter CFFEncodeNumber( CharBufferWrite, &oTopDict, nOffset, true ); oTopDict.Write( "\x12", 1 ); // Private - // Теперь запишем реальный размер TopDict + // Now write the actual TopDict size int nTopDictDataLen = nTopDictLen - 10; oTopDict.sBuffer[7] = ( nTopDictDataLen >> 24 ) & 0xFF; oTopDict.sBuffer[8] = ( nTopDictDataLen >> 16 ) & 0xFF; oTopDict.sBuffer[9] = ( nTopDictDataLen >> 8 ) & 0xFF; oTopDict.sBuffer[10] = nTopDictDataLen & 0xFF; - // Записываем все в файл + // Write everything to file pOutputFunc( pOutputStream, oHeader.sBuffer, oHeader.nLen ); pOutputFunc( pOutputStream, oName.sBuffer, oName.nLen ); pOutputFunc( pOutputStream, oTopDict.sBuffer, oTopDict.nLen ); diff --git a/DesktopEditor/fontengine/fontconverter/FontFileType1.h b/DesktopEditor/fontengine/fontconverter/FontFileType1.h index cb350c24ef..19966ac94b 100644 --- a/DesktopEditor/fontengine/fontconverter/FontFileType1.h +++ b/DesktopEditor/fontengine/fontconverter/FontFileType1.h @@ -39,8 +39,8 @@ namespace NSFontConverter { - #define type1MaxBlueValues 14 // 7 пар - #define type1MaxOtherBlues 10 // 5 пар + #define type1MaxBlueValues 14 // 7 pairs + #define type1MaxOtherBlues 10 // 5 pairs #define type1MaxStemSnap 12 struct Type1PrivateDict @@ -73,12 +73,12 @@ namespace NSFontConverter struct Type1TopDict { - // TO DO: дополнить данную структуру + // TODO: extend this structure double arrdFontMatrix[6]; double arrdFontBBox[4]; }; - // команды + // commands const int c_nType1hstem = 0x0001; // 'hstem' const int c_nType1vstem = 0x0003; // 'vstem' const int c_nType1vmoveto = 0x0004; // 'vmoveto' @@ -86,10 +86,10 @@ namespace NSFontConverter const int c_nType1hlineto = 0x0006; // 'hlineto' const int c_nType1vlineto = 0x0007; // 'vlineto' const int c_nType1rrcurveto = 0x0008; // 'rrcurveto' - const int c_nType1closepath = 0x0009; // 'closepath' не используется в Type2 + const int c_nType1closepath = 0x0009; // 'closepath' is not used in Type2 const int c_nType1callsubr = 0x000A; // 'callsubr const int c_nType1return = 0x000B; // 'return' - const int c_nType1dotsection = 0x000C; // 'dotsection' не используется в Type2 + const int c_nType1dotsection = 0x000C; // 'dotsection' is not used in Type2 const int c_nType1vstem3 = 0x010C; // 'vstem' const int c_nType1hstem3 = 0x020C; // 'hstem' const int c_nType1seac = 0x060C; // 'seac' Type1 only @@ -98,7 +98,7 @@ namespace NSFontConverter const int c_nType1div = 0x0C0C; // 'div' const int c_nType1callothersubr = 0x100C; // 'callothersubr' const int c_nType1pop = 0x110C; // 'pop' - const int c_nType1setcurrentpoint = 0x210C; // 'setcurrentpoint' не используется в Type2 + const int c_nType1setcurrentpoint = 0x210C; // 'setcurrentpoint' is not used in Type2 const int c_nType1hsbw = 0x000D; // 'hsbw' const int c_nType1endchar = 0x000E; // 'endchar' const int c_nType1rmoveto = 0x0015; // 'rmoveto' @@ -108,8 +108,8 @@ namespace NSFontConverter struct Type1CharstringItem { - int nValue; // Значение - bool bCommand; // TRUE: значение - номер команды, FALSE: значение - параметр команды + int nValue; // Value + bool bCommand; // TRUE: value is command number, FALSE: value is command parameter Type1CharstringItem(int nVal, bool bCom) { @@ -146,10 +146,10 @@ namespace NSFontConverter struct Type1Glyph { - std::wstring sGlyph; // Type1 имя глифа - int nUnicode; // Юникодное значение глифа + std::wstring sGlyph; // Type1 glyph name + int nUnicode; // Unicode value of the glyph Type1Charstring oData; - int nReserved; // Используем для SID при конвертации Type1->Type2 + int nReserved; // Used for SID when converting Type1->Type2 Type1Glyph(std::wstring& sGlyf, int nUni, Type1Charstring &oCharstring) { @@ -247,7 +247,7 @@ namespace NSFontConverter if ( nCount >= nMax ) break; - // Добавляем предыдущее число в массив + // Add the previous number to the array if ( nCount > 0 ) pArray[nCount - 1] = Utils::GetDouble( (const char *)sBuffer ); @@ -313,7 +313,7 @@ namespace NSFontConverter if ( nCount >= nMax ) break; - // Добавляем предыдущее число в массив + // Add the previous number to the array if ( nCount > 0 ) pArray[nCount - 1] = Utils::GetInteger( (const char *)sBuffer ); @@ -335,7 +335,7 @@ namespace NSFontConverter double ReadDouble (unsigned char *sString, int nMaxLen) { - // Смещаемся к первому пробелу (после него идет значение) + // Move to first space (the value follows after it) int nPos = 0; while ( ' ' == sString[nPos] && nPos < nMaxLen ) nPos++; diff --git a/DesktopEditor/fontengine/fontconverter/FontFileType1C.cpp b/DesktopEditor/fontengine/fontconverter/FontFileType1C.cpp index 89c4ac8d08..ae81633f58 100644 --- a/DesktopEditor/fontengine/fontconverter/FontFileType1C.cpp +++ b/DesktopEditor/fontengine/fontconverter/FontFileType1C.cpp @@ -180,8 +180,8 @@ namespace NSFontConverter (*pOutputFunc)( pOutputStream, sBuf, strlen( sBuf )); } (*pOutputFunc)( pOutputStream, "\n", 1); - // Для словаря нужно место для 12 полей: следующие 9 + - // Private и CharStrings (в eexec секции) и FID. + // Dictionary needs space for 12 fields: the following 9 + + // Private and CharStrings (in eexec section) and FID. (*pOutputFunc)( pOutputStream, "12 dict begin\n", 14); (*pOutputFunc)( pOutputStream, "/FontInfo 10 dict dup begin\n", 28); if ( m_oTopDict.nVersionSID != 0 ) @@ -275,7 +275,7 @@ namespace NSFontConverter delete seBuffer; } - // Запись кодировки + // Write encoding (*pOutputFunc)( pOutputStream, "/Encoding ", 10); if ( !ppNewEncoding && m_arrEncoding == c_arrsFontFileType1ExpertEncoding ) { @@ -299,7 +299,7 @@ namespace NSFontConverter } (*pOutputFunc)( pOutputStream, "currentdict end\n", 16); - // Бинарная секция (eexec) + // Binary section (eexec) Type1CEexecBuf oEexecBuffer; (*pOutputFunc)( pOutputStream, "currentfile eexec\n", 18); oEexecBuffer.pOutputFunc = pOutputFunc; @@ -534,7 +534,7 @@ namespace NSFontConverter /* // Cmap Table int nNumCmapTables = 1; - int nStartCmapTable = 4 + nNumCmapTables * 8; // заголовок Cmap + заголовок подтаблицы + int nStartCmapTable = 4 + nNumCmapTables * 8; // Cmap header + subtable header TCharBuffer oCmapTable; oCmapTable.Write( "\x00\x00", 2 ); // version @@ -613,7 +613,7 @@ namespace NSFontConverter // Name Table TCharBuffer oNameTable; - // Пока таблицу с именами сделаем пустой + // For now make name table empty oNameTable.Write( "\x00\x00", 2 ); // format oNameTable.Write( "\x00\x00", 2 ); // number of name records oNameTable.Write( "\x00\x06", 2 ); // offset to start of string storage @@ -631,10 +631,10 @@ namespace NSFontConverter oPostTable.Write( "\x00\x00\x00\x00", 4 ); // min Type 1 memory oPostTable.Write( "\x00\x00\x00\x00", 4 ); // max Type 1 memory - // Создаем каталог с описанием всех таблиц: - // - сортируем талицы по тэгу - // - вычисляем позиции таблиц, учитывая 4-byte alignment - // - вычисляем чексуммы таблиц + // Create table directory with all table descriptions: + // - sort tables by tag + // - calculate table positions with 4-byte alignment + // - calculate table checksums int nRequiredTablesCount = 8; TrueTypeTable *pTables = (TrueTypeTable *)MemUtilsMallocArray( nRequiredTablesCount, sizeof(TrueTypeTable) ); @@ -698,7 +698,7 @@ namespace NSFontConverter } } - // Записываем каталог таблиц + // Write table directory TCharBuffer oTableDir; // 12 + nReqTabCount * 16 oTableDir.Write( "\x4F\x54\x54\x4F", 4 ); // sfnt version oTableDir.Write16( nRequiredTablesCount); // numTables @@ -723,7 +723,7 @@ namespace NSFontConverter } (*pOutputFunc)( pOutputStream, oTableDir.sBuffer, oTableDir.nLen ); - // Вычислим чексумму файла + // Calculate file checksum int nFileChecksum = ComputeTTTableChecksum( (unsigned char *)oTableDir.sBuffer, oTableDir.nLen ); for ( int nIndex = 0; nIndex < nRequiredTablesCount; ++nIndex ) { @@ -731,7 +731,7 @@ namespace NSFontConverter } nFileChecksum = 0xb1b0afba - nFileChecksum; - // Записываем таблицы + // Write tables for ( int nIndex = 0; nIndex < nRequiredTablesCount; ++nIndex ) { switch( pTables[nIndex].unTag ) @@ -765,7 +765,7 @@ namespace NSFontConverter bool bSuccess = true; int nGID = 0, i, j, k; - // Вычислим количество CID и построим отображение CID->GID + // Calculate number of CIDs and build CID->GID mapping int nCIDsCount = 0; for ( i = 0; i < m_nGlyphsCount; ++i ) { @@ -809,7 +809,7 @@ namespace NSFontConverter } charStringOffsets[ nCIDsCount ] = charStrings->GetLength(); - // Вычислим nNeedBytes = количество байт, необходимых для charstring offsets + // Calculate nNeedBytes = number of bytes needed for charstring offsets int nNeedBytes = 0; i = ( nCIDsCount + 1) * 5 + charStrings->GetLength(); if (i < 0x100) @@ -829,7 +829,7 @@ namespace NSFontConverter nNeedBytes = 4; } - // Начинаем запись Font Dictionary + // Start writing Font Dictionary (*pOutputFunc)( pOutputStream, "/CIDInit /ProcSet findresource begin\n", 37); (*pOutputFunc)( pOutputStream, "20 dict begin\n", 14); (*pOutputFunc)( pOutputStream, "/CIDFontName /", 14); @@ -1133,7 +1133,7 @@ namespace NSFontConverter int nCurFD = 0; - // Вычислим количество CID и построим отображение CID->GID + // Calculate number of CIDs and build CID->GID mapping int nCIDsCount = 0; for (int nIndex = 0; nIndex < m_nGlyphsCount; ++nIndex ) { @@ -1152,10 +1152,10 @@ namespace NSFontConverter arrCIDMap[m_pnCharset[ nIndex ]] = nIndex; } - // Запись Type 1 фонта + // Write Type 1 font for (i = 0; i < nCIDsCount; i += 256) { - // Игнорируем CID = 0, т.е. ".notdef" + // Ignore CID = 0, i.e. ".notdef" nCurFD = 0; for ( j = ((i == 0) ? 1 : 0); j < 256 && i+j < nCIDsCount; ++j ) { @@ -1166,7 +1166,7 @@ namespace NSFontConverter } } - // Font Dictionary (незашифрованная часть) + // Font Dictionary (unencrypted part) (*pOutputFunc)( pOutputStream, "16 dict begin\n", 14); (*pOutputFunc)( pOutputStream, "/FontName /", 11); (*pOutputFunc)( pOutputStream, sPSName, strlen(sPSName)); @@ -1671,10 +1671,10 @@ namespace NSFontConverter { // TO DO: error "Too few args to Type 2 callsubr" } - // не очищаем стек + // don't clear stack break; case 0x000b: // return - // не очищаем стек + // don't clear stack break; case 0x000e: // endchar / seac if (m_bFirstOperator) @@ -1708,7 +1708,7 @@ namespace NSFontConverter m_nOperatorsCount = 0; break; case 0x000f: // (obsolete) - // Данная операция игнорируется, но нам нужна ширина символа + // This operation is ignored, but we need the glyph width if (m_bFirstOperator) { ConvertGlyphWidth(m_nOperatorsCount > 0, seCharBuffer, pDict); @@ -1721,7 +1721,7 @@ namespace NSFontConverter m_nOperatorsCount = 0; break; case 0x0012: // hstemhm - // Данная операция игнорируется + // This operation is ignored if (m_bFirstOperator) { ConvertGlyphWidth(m_nOperatorsCount & 1, seCharBuffer, pDict); @@ -1735,7 +1735,7 @@ namespace NSFontConverter m_nOperatorsCount = 0; break; case 0x0013: // hintmask - // Данная операция игнорируется + // This operation is ignored if (m_bFirstOperator) { ConvertGlyphWidth(m_nOperatorsCount & 1, seCharBuffer, pDict); @@ -1753,7 +1753,7 @@ namespace NSFontConverter m_nOperatorsCount = 0; break; case 0x0014: // cntrmask - // Данная операция игнорируется + // This operation is ignored if (m_bFirstOperator) { ConvertGlyphWidth(m_nOperatorsCount & 1, seCharBuffer, pDict); @@ -1810,7 +1810,7 @@ namespace NSFontConverter m_nOperatorsCount = 0; break; case 0x0017: // vstemhm - // Данная операция игнорируется + // This operation is ignored if (m_bFirstOperator) { ConvertGlyphWidth(m_nOperatorsCount & 1, seCharBuffer, pDict); @@ -1947,7 +1947,7 @@ namespace NSFontConverter { // TO DO: error "Too few args to Type 2 callgsubr" } - // не очищаем стек + // don't clear stack break; case 0x001e: // vhcurveto if (m_nOperatorsCount < 4 || !(m_nOperatorsCount % 4 == 0 || (m_nOperatorsCount-1) % 4 == 0)) @@ -2048,7 +2048,7 @@ namespace NSFontConverter m_bOpenPath = true; break; case 0x0c00: // dotsection (should be Type 1 only?) - // игнорируем + // ignore m_nOperatorsCount = 0; break; case 0x0c03: // and @@ -2314,7 +2314,7 @@ namespace NSFontConverter void CFontFileType1C::EexecWriteCharString(Type1CEexecBuf *pEexecBuffer, unsigned char *sBuffer, int nLen) { - // Eexec шифрование + // Eexec encryption for (int nIndex = 0; nIndex < nLen; ++nIndex ) { unsigned nCurChar = sBuffer[nIndex] ^ ( pEexecBuffer->unEncryptionKey >> 8); @@ -2344,7 +2344,7 @@ namespace NSFontConverter m_bSuccessParsed = true; - // некоторые программы включают фонты Type 1C в пробелами в начале + // some programs include Type 1C fonts with leading whitespace if ( m_nLen > 0 && m_sFile[0] != '\x01' ) { ++m_sFile; @@ -2361,7 +2361,7 @@ namespace NSFontConverter m_nGsubrBias = (m_oGsubrIndex.nCount < 1240) ? 107 : (m_oGsubrIndex.nCount < 33900) ? 1131 : 32768; - // считываем первое имя фонта + // read the first font name GetIndexVal( &m_oNameIndex, 0, &oIndexVal, &m_bSuccessParsed); if ( !m_bSuccessParsed ) @@ -2369,7 +2369,7 @@ namespace NSFontConverter m_seName = new StringExt((char *)&m_sFile[ oIndexVal.nPos ], oIndexVal.nLen); - // Считываем самый верхний словарь для первого фонта + // Read the top dictionary for the first font ReadTopDict(); if ( m_oTopDict.nFirstOperator == 0x0c1e ) @@ -2542,8 +2542,8 @@ namespace NSFontConverter } } - // Читаем словарь шрифта (CID Font Dict (FD)). Отсюда вытаскиваем указатель на private dict, - // и читаем private dict. Также вытаксиваем FontMatrix. + // Read font dictionary (CID Font Dict (FD)). Extract private dict pointer from here, + // and read private dict. Also extract FontMatrix. void CFontFileType1C::ReadFD(int nOffset, int nLength, Type1CPrivateDict *pDict) { double arrdFontMatrix[6]; @@ -3091,7 +3091,7 @@ namespace NSFontConverter return nPos; } - // Конвертируем delta-encoded массив операторов в массив ints + // Convert delta-encoded operator array to int array int CFontFileType1C::GetDeltaIntArray(int *pArray, int nMaxLen) { int nCount = 0; @@ -3109,7 +3109,7 @@ namespace NSFontConverter return nCount; } - // Конвертируем delta-encoded массив операторов в массив doubles + // Convert delta-encoded operator array to double array int CFontFileType1C::GetDeltaDoubleArray(double *pArray, int nMaxLen) { int nCount = 0; @@ -3133,7 +3133,7 @@ namespace NSFontConverter pIndex->nCount = GetU16BE( nPos, bSuccess); if ( 0 == pIndex->nCount ) { - // возможны пустые индексы, они содержат только поле length + // empty indexes are possible, they contain only the length field pIndex->nOffsetSize = 0; pIndex->nStartPos = pIndex->nEndPos = nPos + 2; } diff --git a/DesktopEditor/fontengine/fontconverter/FontFileType1C.h b/DesktopEditor/fontengine/fontconverter/FontFileType1C.h index 7772a07633..f0aa993f7c 100644 --- a/DesktopEditor/fontengine/fontconverter/FontFileType1C.h +++ b/DesktopEditor/fontengine/fontconverter/FontFileType1C.h @@ -43,17 +43,17 @@ namespace NSFontConverter struct Type1CIndex { - int nPos; // Позиция в файле от начала файла - int nCount; // Количество вхождений + int nPos; // Position in file from file start + int nCount; // Number of entries int nOffsetSize; // Offset size - int nStartPos; // Начальная позиция index data - 1 - int nEndPos; // Позиция следующего байта после Type1CIndex + int nStartPos; // Start position of index data - 1 + int nEndPos; // Position of next byte after Type1CIndex }; struct Type1CIndexVal { - int nPos; // Позиция в файле от начала файла - int nLen; // Длина в байтах + int nPos; // Position in file from file start + int nLen; // Length in bytes }; struct Type1CTopDict @@ -75,7 +75,7 @@ namespace NSFontConverter int nPaintType; int nCharStringType; double arrdFontMatrix[6]; - bool bHasFontMatrix; // В CID фонтах возможно матрица фонта лежит в FD, а не в верхнем словаре + bool bHasFontMatrix; // In CID fonts the font matrix may be in FD, not in top dict int nUniqueID; double arrdFontBBox[4]; double dStrokeWidth; @@ -150,9 +150,9 @@ namespace NSFontConverter { FontFileOutputFunc pOutputFunc; void *pOutputStream; - bool bASKII; // ASCII кодировка? + bool bASKII; // ASCII encoding? unsigned short unEncryptionKey; // eexec encryption key - int nLine; // количество eexec-символов, оставшихся на текущей строке + int nLine; // number of eexec characters remaining on current line }; //------------------------------------------------------------------------ @@ -172,8 +172,8 @@ namespace NSFontConverter char *GetName(); - // Возвращаем кодировку, как массив 256 имен (некоторые могут быть - // NULL). Используется только для 8-битных фонтов. + // Return encoding as array of 256 names (some may be + // NULL). Used only for 8-bit fonts. char **GetEncoding(); unsigned short *GetCIDToGIDMap(int *arrCIDs); @@ -196,7 +196,7 @@ namespace NSFontConverter // PostScript font name. void ToType0(char *sPSName, FontFileOutputFunc pOutputFunc, void *pOutputStream); - // Конвертируем в OpenType (CFF) + // Convert to OpenType (CFF) void ToOpenTypeCFF(FontFileOutputFunc pOutputFunc, void *pOutputStream, FT_Face pFace); private: @@ -276,9 +276,9 @@ namespace NSFontConverter Type1COperator m_arrOperators[49]; int m_nOperatorsCount; - int m_nHints; // для текущего символа + int m_nHints; // for current symbol bool m_bFirstOperator; - bool m_bOpenPath; // true, если есть незакрытый пат + bool m_bOpenPath; // true if there is an unclosed path }; } diff --git a/DesktopEditor/fontengine/fontconverter/Hash.h b/DesktopEditor/fontengine/fontconverter/Hash.h index e8a9bdb9e0..8392b9c262 100644 --- a/DesktopEditor/fontengine/fontconverter/Hash.h +++ b/DesktopEditor/fontengine/fontconverter/Hash.h @@ -89,9 +89,9 @@ namespace NSFontConverter private: - bool m_bDeleteKeys; // Будем ли удалять имена? set if key strings should be deleted - int m_nBucketsCount; // Количество наборов - int m_nLength; // Количество вхождений + bool m_bDeleteKeys; // Whether to delete names? set if key strings should be deleted + int m_nBucketsCount; // Number of buckets + int m_nLength; // Number of entries THashBucket **m_ppTable; }; diff --git a/DesktopEditor/fontengine/fontconverter/MemoryUtils.h b/DesktopEditor/fontengine/fontconverter/MemoryUtils.h index 23fbf7e168..e9f36c9549 100644 --- a/DesktopEditor/fontengine/fontconverter/MemoryUtils.h +++ b/DesktopEditor/fontengine/fontconverter/MemoryUtils.h @@ -44,7 +44,7 @@ namespace NSFontConverter { //------------------------------------------------------------------------ - // Аналогично malloc, но с обработкой ошибок. + // Similar to malloc, but with error handling. static void *MemUtilsMalloc(int nSize) { void *pResult; @@ -54,14 +54,14 @@ namespace NSFontConverter if ( !( pResult = malloc( nSize ) ) ) { - // TO DO: Выдать ошибку выделения памяти + // TO DO: Report memory allocation error } return pResult; } - // Тоже что и realloc, но с обработкой ошибок. - // Если <pData> NULL, вызывается функция malloc вместо realloc. + // Same as realloc, but with error handling. + // If <pData> is NULL, malloc is called instead of realloc. static void *MemUtilsRealloc(void *pData, int nSize) { void *pResult; @@ -78,17 +78,17 @@ namespace NSFontConverter pResult = malloc( nSize ); if ( !pResult ) { - // TO DO: Выдать ошибку выделения памяти + // TO DO: Report memory allocation error } return pResult; } - // Тоже самое, что и MemUtilsMalloc and MemUtilsRelloc, толькоt - // учитывает количество элементов и размер элемента. В результате - // выделяется память размером nObjectsCount * nObjectSize байт. - // Кроме того присутствует обработка ошибок и проверка того, чтобы - // суммарный размер не превышал предел для int. + // Same as MemUtilsMalloc and MemUtilsRealloc, but + // takes into account the number of elements and element size. As a result + // memory of size nObjectsCount * nObjectSize bytes is allocated. + // Also includes error handling and validation that + // total size does not exceed the limit for int. static void *MemUtilsMallocArray(int nObjectsCount, int nObjectSize) { if ( 0 == nObjectsCount ) @@ -97,12 +97,12 @@ namespace NSFontConverter int nSize = nObjectsCount * nObjectSize; if ( nObjectSize <= 0 || nObjectsCount < 0 || nObjectsCount >= 0x7fffffff / nObjectSize ) { - // TO DO: Выдать ошибку выделения памяти + // TO DO: Report memory allocation error } return MemUtilsMalloc( nSize ); } - // Тоже что и free, но проверяет и игнорирует NULL-указатели. + // Same as free, but checks and ignores NULL pointers. static void MemUtilsFree(void *pData) { if ( pData ) @@ -121,12 +121,12 @@ namespace NSFontConverter if ( nObjectSize <= 0 || nObjectsCount < 0 || nObjectsCount >= 0x7fffffff / nObjectSize ) { - // TO DO: Выдать ошибку выделения памяти + // TO DO: Report memory allocation error } return MemUtilsRealloc( pData, nSize ); } - // Выделяем память и копируем туда строку. + // Allocate memory and copy the string there. static char *CopyString(char *sString) { char *sResult = (char *)MemUtilsMalloc( strlen( sString ) + 1 ); diff --git a/DesktopEditor/fontengine/fontconverter/StringExt.cpp b/DesktopEditor/fontengine/fontconverter/StringExt.cpp index 41f69204b2..f4a58825a5 100644 --- a/DesktopEditor/fontengine/fontconverter/StringExt.cpp +++ b/DesktopEditor/fontengine/fontconverter/StringExt.cpp @@ -285,7 +285,7 @@ namespace NSFontConverter } else { - // Разбираем форматированную строку + // Parse the formatted string if ( !(*pCur >= '0' && *pCur <= '9') ) break; nIndex = *pCur - '0'; @@ -473,7 +473,7 @@ namespace NSFontConverter nWidth = uArg.iValue; break; } - // Добавляем аргумент в нужном формате, с нужным прилеганием + // Add argument in required format with proper alignment if ( !bReverseAlign && nLen < nWidth ) { for (int nCounter = nLen; nCounter < nWidth; ++nCounter ) diff --git a/DesktopEditor/fontengine/fontconverter/StringExt.h b/DesktopEditor/fontengine/fontconverter/StringExt.h index 367aad0f79..d2b1b485e0 100644 --- a/DesktopEditor/fontengine/fontconverter/StringExt.h +++ b/DesktopEditor/fontengine/fontconverter/StringExt.h @@ -37,64 +37,64 @@ namespace NSFontConverter { //--------------------------------------------------------------------------------------- - // класс StringExt - аналог CString + // StringExt class - CString analog //--------------------------------------------------------------------------------------- class StringExt { public: - // Создаем пустую строку. + // Create an empty string. StringExt(); - // Создаем строку из Сишной строки. + // Create a string from a C-style string. StringExt(const char *sString); - // Создаем строку из <nLength> символов в <sString>. Данная строка - // может содержать нулевые символы. + // Create a string from <nLength> characters in <sString>. This string + // may contain null characters. StringExt(const char *sString, int nLength); - // Создаем строку из <nLength> символов, начиная с <nIndex>, строки <seString>. + // Create a string from <nLength> characters starting at <nIndex> of string <seString>. StringExt(StringExt *seString, int nIndex, int nLength); - // Копируем строку. + // Copy the string. StringExt(StringExt *seString); StringExt *Copy() { return new StringExt(this); } - // Соединяем две строки. + // Concatenate two strings. StringExt(StringExt *seString1, StringExt *seString2); - // Переводим целое значение в строку. + // Convert integer value to string. static StringExt *FromInt(int nValue); - // Создаем форматированную строку. Функция подобна printf, но без проблем - // с переполнением строки. Формат выглядит следующим образом: + // Create a formatted string. Function is similar to printf, but without + // buffer overflow problems. Format looks like this: // {<nArg>:[<nWidth>][.<precision>]<type>} - // где: - // - <nArg> номер аргумента (нумерация начинается с 0). - // -- PS: сами аргументы должны идти по порядку, а использовать их можно - // многократно и в любом порядке. - // - <nWidth> ширина поля, если она отрицательна, тогда прилежание будет - // сменено на противоположное, а пустые места будут заполнены нулями. - // - <nPrecision> количество знаков после запятой - // - <nType> тип один из слудющих: - // d, x, o, b -- целое(int) в десятичной, шестнадцатиричной, восьмиричной - // и двоичной системах исчисления - // ud, ux, uo, ub -- тоже самое, только беззнаковое целое(uint) - // ld, lx, lo, lb, uld, ulx, ulo, ulb -- аналогичной long и ulong + // where: + // - <nArg> is argument number (numbering starts from 0). + // -- PS: arguments must be provided in order, but can be used + // multiple times and in any order. + // - <nWidth> is field width, if negative, alignment will be + // changed to opposite, and empty spaces will be filled with zeros. + // - <nPrecision> is number of decimal places + // - <nType> is one of the following types: + // d, x, o, b -- integer(int) in decimal, hexadecimal, octal + // and binary number systems + // ud, ux, uo, ub -- same but unsigned integer(uint) + // ld, lx, lo, lb, uld, ulx, ulo, ulb -- similar for long and ulong // f, g -- double // c -- char // s -- string (char *) // t -- StringExt * - // w -- Пробелы; значение аргументы означает количество пробелов - // Для вывода фигурных скобок надо использовать {{ и }}. + // w -- Spaces; argument value means number of spaces + // To output curly braces use {{ and }}. static StringExt *Format (char *sFormat, ...); static StringExt *FormatV(char *sFormat, va_list sArgList); - // Деструктор. + // Destructor. ~StringExt(); int GetLength() @@ -102,7 +102,7 @@ namespace NSFontConverter return m_nLength; } - // Возвращаем строку в виде char*. + // Return string as char*. char *GetBuffer() { return m_sData; @@ -117,33 +117,33 @@ namespace NSFontConverter m_sData[ nIndex ] = nChar; } - // Очищаем строку. + // Clear the string. StringExt *Clear(); - // Добавляем символ или строку. + // Append a character or string. StringExt *Append(char nChar); StringExt *Append(StringExt *seString); StringExt *Append(const char *sString); StringExt *Append(const char *sString, int nLength); - // Добавляем форматированную строку. + // Append a formatted string. StringExt *AppendFormat (char *sFormat, ...); StringExt *AppendFormatV(char *sFormat, va_list sArgList); - // Вставляем символ или строку. + // Insert a character or string. StringExt *Insert(int nIndex, char nChar); StringExt *Insert(int nIndex, StringExt *seString); StringExt *Insert(int nIndex, const char *sString); StringExt *Insert(int nIndex, const char *sString, int nLength); - // Удаляем один символ или массив символов. + // Delete one character or array of characters. StringExt *Delete(int nIndex, int nCount = 1); - // Делаем в строке все символы большими/маленькими буквами. + // Convert all characters in the string to uppercase/lowercase. StringExt *MakeUpper(); StringExt *MakeLower(); - // Сравнение двух строк: -1:< 0:= +1:> + // Compare two strings: -1:< 0:= +1:> int Compare (StringExt *seString); int CompareN(StringExt *seString, int nCount); int Compare (const char *sString); diff --git a/DesktopEditor/fontengine/fontconverter/Utils.h b/DesktopEditor/fontengine/fontconverter/Utils.h index d8fa71de67..3a943e94f3 100644 --- a/DesktopEditor/fontengine/fontconverter/Utils.h +++ b/DesktopEditor/fontengine/fontconverter/Utils.h @@ -45,9 +45,9 @@ namespace NSFontConverter { struct TCharBuffer { - char *sBuffer; // Буфер - int nSize; // Реальный размер буфера - int nLen; // Фактический размер буфера (т.е. размер используемой части буфера) + char *sBuffer; // Buffer + int nSize; // Actual buffer size + int nLen; // Effective buffer size (i.e., size of the used portion of the buffer) TCharBuffer(int _initsize = 32) { @@ -173,7 +173,7 @@ namespace NSFontConverter } } - // Функция взята из Graphics.dll + // Function taken from Graphics.dll static int SetCMapForCharCode(FT_Face pFace, long lUnicode, int *pnCMapIndex) { *pnCMapIndex = -1; @@ -256,7 +256,7 @@ namespace NSFontConverter if ( NULL == pOs2 || 0xFFFF == pOs2->version ) return -1; - // Проверяем установлен ли 31 бит + // Check if bit 31 is set if ( !( pOs2->ulCodePageRange1 & 0x80000000 ) && !( pOs2->ulCodePageRange1 == 0 && pOs2->ulCodePageRange2 == 0 ) ) return -1; diff --git a/DesktopEditor/fontengine/fontdictionaryworker.h b/DesktopEditor/fontengine/fontdictionaryworker.h index d0d22ba194..78d20620dd 100644 --- a/DesktopEditor/fontengine/fontdictionaryworker.h +++ b/DesktopEditor/fontengine/fontdictionaryworker.h @@ -76,7 +76,7 @@ namespace NSFontDictionary bool bIsEqual = true; for (int j = 1; j < nNameLen; ++j) { - if ('\0' == _name[j]) // короче чем нужно + if ('\0' == _name[j]) // shorter than required { bIsEqual = false; break; @@ -88,7 +88,7 @@ namespace NSFontDictionary } } - if (bIsEqual && _name[nNameLen] == '\0') // чтобы не длиннее, чем нужно + if (bIsEqual && _name[nNameLen] == '\0') // to ensure it's not longer than required { nIndex = i; break; @@ -176,7 +176,7 @@ namespace NSFontDictionary bool bIsEqual = true; for (int j = 1; j < nNameLen; ++j) { - if ('\0' == _name[j]) // короче чем нужно + if ('\0' == _name[j]) // shorter than required { bIsEqual = false; break; @@ -188,7 +188,7 @@ namespace NSFontDictionary } } - if (bIsEqual && _name[nNameLen] == '\0') // чтобы не длиннее, чем нужно + if (bIsEqual && _name[nNameLen] == '\0') // to ensure it's not longer than required { nIndex = i; break; @@ -267,7 +267,7 @@ namespace NSFontDictionary if (NULL == pFont) return false; - // name - делаем ascii, чтобы сработал подбор + // name - convert to ascii to enable matching oFormat.Destroy(true); LONG nLen = (LONG)strlen(pFont->m_name); diff --git a/DesktopEditor/fontengine/js/engine/module_js.js b/DesktopEditor/fontengine/js/engine/module_js.js index c3fca57a62..f13aaebfc2 100644 --- a/DesktopEditor/fontengine/js/engine/module_js.js +++ b/DesktopEditor/fontengine/js/engine/module_js.js @@ -217,7 +217,7 @@ AscFonts.HB_ShapeText = function(fontFile, text, features, script, direction, la */ function ZLib() { - this.engine = 0; // указатель на нативный класс Zlib + this.engine = 0; // pointer to native Zlib class this.files = {}; } @@ -244,17 +244,17 @@ ZLib.prototype.open = function(buf) var arrayBuffer = (undefined !== buf.byteLength) ? new Uint8Array(buf) : buf; - // TODO: открыли архив, и заполнили this.files - // объектами { path : null } + // TODO: opened the archive and filled this.files + // with objects { path : null } - // копируем память в память webasm + // copy memory to webasm memory var FileRawDataSize = arrayBuffer.length; var FileRawData = Module["_Zlib_Malloc"](FileRawDataSize); if (0 == FileRawData) return false; Module["HEAP8"].set(arrayBuffer, FileRawData); - // грузим данные + // load data this.engine = Module["_Zlib_Open"](FileRawData, FileRawDataSize); if (0 == this.engine) { @@ -262,7 +262,7 @@ ZLib.prototype.open = function(buf) return false; } - // получаем пути в архиве + // get paths in archive var pointer = Module["_Zlib_GetPaths"](this.engine); if (0 == pointer) { @@ -352,11 +352,11 @@ ZLib.prototype.getFile = function(path) if (!this.isModuleInit || !this.engine) return null; - // проверяем - есть ли файл вообще? + // check if the file exists at all if (undefined === this.files[path]) return null; - // проверяем - может мы уже его разжимали? + // check if we have already decompressed it if (null !== this.files[path]) { if (this.files[path].l > 0) @@ -406,7 +406,7 @@ ZLib.prototype.addFile = function(path, data) if (!data) return false; - // проверяем - может такой файл уже есть? тогда его надо сначала удалить? + // check if such file already exists - then we need to delete it first if (undefined !== this.files[path]) this.removeFile(path); @@ -444,7 +444,7 @@ ZLib.prototype.removeFile = function(path) if (!this.isModuleInit || !this.engine) return false; - // проверяем - может такого файла и нет? + // check if such file doesn't exist if (undefined === this.files[path]) return false; diff --git a/DesktopEditor/freetype_names/FontMaps/FontMaps.cpp b/DesktopEditor/freetype_names/FontMaps/FontMaps.cpp index 9aa5be48cb..4fe265d2c9 100644 --- a/DesktopEditor/freetype_names/FontMaps/FontMaps.cpp +++ b/DesktopEditor/freetype_names/FontMaps/FontMaps.cpp @@ -118,7 +118,7 @@ int main(int argc, char* argv[]) int nCount = oFonts.GetList()->GetFonts()->GetCount(); - // теперь строим массив всех шрифтов по имени + // now build array of all fonts by name std::map<std::wstring, CFontInfoJS> mapFonts; std::map<std::wstring, CFontInfoJS> mapFontsUnicodes; std::vector<std::wstring> arrFonts; @@ -373,7 +373,7 @@ int main(int argc, char* argv[]) } // ------------------------------------------- - // теперь сортируем шрифты по имени ---------- + // now sort fonts by name ---------- size_t nCountFonts = arrFonts.size(); std::sort(arrFonts.begin(), arrFonts.end()); diff --git a/DesktopEditor/graphics/BaseThreadMonitor.cpp b/DesktopEditor/graphics/BaseThreadMonitor.cpp index b84268b76d..410955c372 100644 --- a/DesktopEditor/graphics/BaseThreadMonitor.cpp +++ b/DesktopEditor/graphics/BaseThreadMonitor.cpp @@ -92,7 +92,7 @@ namespace NSThreads CBaseThread* CBaseThreadMonitor::GetBaseThread(const ASC_THREAD_ID& nThreadId) { - // лист - потому что будет всегда мало записей - и то будет быстрее мапа. двигаем всегда текущий на первое место + // list - because there will always be few records - still faster than map. always move current to first position if (m_listThreads.size() == 0) return NULL; diff --git a/DesktopEditor/graphics/Brush.h b/DesktopEditor/graphics/Brush.h index a0a211ff8e..d4014938e5 100644 --- a/DesktopEditor/graphics/Brush.h +++ b/DesktopEditor/graphics/Brush.h @@ -152,15 +152,15 @@ protected: std::vector<TSubColor> m_subcolors; CMatrix m_matrix; - float m_angle; // угол поворота в градусах базовой линии p1 -> p2 + float m_angle; // rotation angle in degrees of baseline p1 -> p2 CDoubleRect Bounds; Aggplus::WrapMode m_wrap; - INT m_bAngleScalable; // масштабировать угол поворота относительно заданных точек b = arctan( width / height * tan(angle) ); - INT m_bRectable; // в качестве направляющей используется диагональ прямоугольника - INT m_bRelativeCoords; // координаты точек считаются относительно рисуемого примитива + INT m_bAngleScalable; // scale rotation angle relative to given points b = arctan( width / height * tan(angle) ); + INT m_bRectable; // rectangle diagonal is used as guide + INT m_bRelativeCoords; // point coordinates are relative to drawn primitive }; class CBrushTexture : public CBrush diff --git a/DesktopEditor/graphics/Clip.cpp b/DesktopEditor/graphics/Clip.cpp index b755d3c49e..6ccc18e30f 100644 --- a/DesktopEditor/graphics/Clip.cpp +++ b/DesktopEditor/graphics/Clip.cpp @@ -246,7 +246,7 @@ namespace Aggplus if (!m_bIsClip2) { - // смешивать надо с растерайзером + // need to blend with rasterizer pRasterizer->filling_rule(bEvenOdd ? agg::fill_even_odd : agg::fill_non_zero); scanline_type sl1; @@ -259,7 +259,7 @@ namespace Aggplus } else { - // надо смешивать со стораджем + // need to blend with storage pRasterizer->filling_rule(op ? agg::fill_even_odd : agg::fill_non_zero); diff --git a/DesktopEditor/graphics/Graphics.cpp b/DesktopEditor/graphics/Graphics.cpp index a0edd9b748..2b45fc2aaf 100644 --- a/DesktopEditor/graphics/Graphics.cpp +++ b/DesktopEditor/graphics/Graphics.cpp @@ -245,7 +245,7 @@ namespace Aggplus BYTE* pBuffer = pPixels; if (0 > lStride) { - // переворачиваем изображение для GDI+ + // flip the image for GDI+ pBuffer += 4 * lWidth * (lHeight - 1); } @@ -265,8 +265,8 @@ namespace Aggplus Status CGraphics::CreatePart(LONG lLeft, LONG lTop, LONG lWidth, LONG lHeight, CGraphics** ppPart) { - // здесь минимум кода. Просто сделать дубликат - и выставить ему правильные границы. - // а потом уже и dpi и все настройки. + // minimal code here. Just make a duplicate and set the correct bounds for it. + // then set dpi and all other settings. return Ok; } @@ -297,7 +297,7 @@ namespace Aggplus Status CGraphics::SetPageWidth(double lWidth, LONG lUnit) { - // вычисилить dpi и выставить его + // calculate and set dpi switch (lUnit) { case UnitPoint: @@ -327,7 +327,7 @@ namespace Aggplus } Status CGraphics::SetPageHeight(double lHeight, LONG lUnit) { - // вычисилить dpi и выставить его + // calculate and set dpi switch (lUnit) { case UnitPoint: @@ -414,7 +414,7 @@ namespace Aggplus return Ok; } - // функции отсечения + // clipping functions Status CGraphics::SetClipRect(double dLeft, double dTop, double dWidth, double dHeight) { double dx1 = dLeft; @@ -864,7 +864,7 @@ namespace Aggplus } - // отрисовка картинки + // image rendering Status CGraphics::DrawImage(CImage* pImage, double x, double y, double width, double height) { if (!pImage || pImage->GetLastStatus() != Ok) @@ -2376,7 +2376,7 @@ namespace Aggplus void CGraphics::UpdateUnits() { - // здесь - пересчет координат + // coordinate recalculation here m_oCoordTransform.Reset(); double dScaleX = 1.0; diff --git a/DesktopEditor/graphics/Graphics.h b/DesktopEditor/graphics/Graphics.h index 5bb709688d..837744e1c3 100644 --- a/DesktopEditor/graphics/Graphics.h +++ b/DesktopEditor/graphics/Graphics.h @@ -147,11 +147,11 @@ typedef agg::span_allocator<agg::rgba8> span_alloc_type; #define def_flag_G_FromHDC 0x0002 -// Расстояние от центра до контрольных точек Безье для аппроксимации окружности = (4 * (sqrt(2) - 1) / 3) * r +// Distance from center to Bezier control points for circle approximation = (4 * (sqrt(2) - 1) / 3) * r static const double c_dKappa = ((double)0.55228475); static const double c_dKappa_2 = ((double)(0.5 * 0.55228475)); -// Делим 16-битное значение [0, 255*255] на 255, возвращаем 8-битное значение. +// Divide 16-bit value [0, 255*255] by 255, return 8-bit value. static inline unsigned char Div255(int nValue) { return (unsigned char)((nValue + (nValue >> 8) + 0x80) >> 8); @@ -291,7 +291,7 @@ protected: #ifdef _WINDOW_GRAPHIS_USE_ - // для отрисовки картинок - используем Gdiplus + // for image rendering - use Gdiplus Gdiplus::Graphics* m_pGraphics; Gdiplus::Bitmap* m_pBitmap; @@ -352,7 +352,7 @@ public: Status ShearTransform(double shearX, double shearY, MatrixOrder order = MatrixOrderPrepend); Status MultiplyTransform(CMatrix* pMatrix, MatrixOrder order = MatrixOrderPrepend); - // функции отсечения + // clipping functions Status SetClipRect(double dLeft, double dTop, double dWidth, double dHeight); Status SetClipRect2(double dLeft, double dTop, double dWidth, double dHeight); Status SetClipRect3(double dLeft, double dTop, double dWidth, double dHeight); @@ -363,7 +363,7 @@ public: Status CombineClip(CGraphicsPath* pPath, agg::sbool_op_e op, NSStructures::CPen* pPen = NULL); Status InternalClip(CGraphicsPath* pPath, CMatrix* pTransform, agg::sbool_op_e op, NSStructures::CPen* pPen = NULL); - // измерение текста + // text measurement INT MeasureString(const std::wstring& strText, CFontManager* pManager, double* lWidth, double* lHeight); Status Clear(CColor oColor); @@ -378,13 +378,13 @@ public: Status DrawPath(NSStructures::CPen* pPen, CGraphicsPath* pPath, const double& gamma = -1); Status DrawPathNoTransform(NSStructures::CPen* pPen, CGraphicsPath* pPath); - // заливка + // fill Status FillEllipse(CBrush* pBrush, double x, double y, double width, double height); Status FillRectangle(CBrush* pBrush, double x, double y, double width, double height); Status FillPolygon(CBrush* pBrush, double* pPoints, LONG lCount); Status FillPath(CBrush* pBrush, CGraphicsPath* pPath); - // отрисовка картинки + // image rendering Status DrawImage(CImage* pImage, double x, double y, double width, double height); Status DrawMeta(const std::wstring& strFile, double x, double y, double width, double height); @@ -394,14 +394,14 @@ public: INT DrawImageUnscaled(CImage* pImage, double x, double y); - // отрисовка текста + // text rendering INT DrawString(const std::wstring& strText, CFontManager* pFont, CBrush* pBrush, double x, double y); INT DrawString(const unsigned int* pGids, const unsigned int nGidsCount, CFontManager* pFont, CBrush* pBrush, double x, double y); INT DrawStringC(const LONG& lText, CFontManager* pFont, CBrush* pBrush, double x, double y); INT DrawStringPath(const std::wstring& strText, CFontManager* pFont, CBrush* pBrush, double x, double y); INT DrawStringPathC(const LONG& lText, CFontManager* pFont, CBrush* pBrush, double x, double y); - //Работа с альфа-маской + // alpha mask operations Status SetAlphaMask(CAlphaMask* pAlphaMask); Status StartCreatingAlphaMask(); Status EndCreatingAlphaMask(); @@ -410,7 +410,7 @@ public: CSoftMask* CreateSoftMask(bool bAlpha); Status SetSoftMask(CSoftMask* pSoftMask); - //Работа со слоями + // layer operations Status AddLayer(CGraphicsLayer* pGraphicsLayer); Status CreateLayer(); Status BlendLayer(); diff --git a/DesktopEditor/graphics/GraphicsPath.cpp b/DesktopEditor/graphics/GraphicsPath.cpp index 09a8dba702..1bf880bdbd 100644 --- a/DesktopEditor/graphics/GraphicsPath.cpp +++ b/DesktopEditor/graphics/GraphicsPath.cpp @@ -245,7 +245,7 @@ namespace Aggplus Status CGraphicsPath::AddCurve(double* pPoints, int nCount) { - // этим мы не пользуемся. Понадобится - реализую. + // we don't use this. Will implement if needed. return AddBeziers(pPoints, nCount); } @@ -640,26 +640,26 @@ namespace Aggplus double CGraphicsPath::AngToEllPrm(double fAngle, double fXRad, double fYRad) { - // Функция для перевода реального угла в параметрическое задание эллписа - // т.е. x= a cos(t) y = b sin(t) - параметрическое задание эллписа. + // Function to convert real angle to parametric ellipse definition + // i.e. x= a cos(t) y = b sin(t) - parametric ellipse definition. // x = r cos(p), y = r sin(p) => t = atan2( sin(p) / b, cos(p) / a ); return atan2( sin( fAngle ) / fYRad, cos( fAngle ) / fXRad ); } int CGraphicsPath::EllipseArc2(double fX, double fY, double fXRad, double fYRad, double fAngle1, double fAngle2, INT bClockDirection) { - // переведем углы в радианы + // convert angles to radians int nRet = 0; double dAngle1 = fAngle1 * 3.141592 / 180; double dAngle2 = fAngle2 * 3.141592 / 180; - // Выясним в каких четвертях находятся начальная и конечная точки + // Determine which quadrants the start and end points are in unsigned int nFirstPointQuard = int(fAngle1) / 90 + 1; unsigned int nSecondPointQuard = int(fAngle2) / 90 + 1; nSecondPointQuard = std::min( 4, std::max( 1, (int)nSecondPointQuard ) ); nFirstPointQuard = std::min( 4, std::max( 1, (int)nFirstPointQuard ) ); - // Проведем линию в начальную точку дуги + // Draw a line to the arc start point double fStartX = 0.0, fStartY = 0.0, fEndX = 0.0, fEndY = 0.0; fStartX = fX + fXRad * cos( AngToEllPrm( dAngle1, fXRad, fYRad ) ); @@ -667,7 +667,7 @@ namespace Aggplus LineTo(fStartX, fStartY); - // Дальше рисуем по четверям + // Continue drawing by quadrants double fCurX = fStartX, fCurY = fStartY; double dStartAngle = dAngle1; @@ -709,7 +709,7 @@ namespace Aggplus int CGraphicsPath::EllipseArc3(double fX, double fY, double fXRad, double fYRad, double dAngle1, double dAngle2, double *pfXCur, double *pfYCur, INT bClockDirection) { - // Рассчитаем начальную, конечную и контрольные точки + // Calculate start, end and control points double fX1 = 0.0, fX2 = 0.0, fY1 = 0.0, fY2 = 0.0; double fCX1 = 0.0, fCX2 = 0.0, fCY1 = 0.0, fCY2 = 0.0; @@ -770,7 +770,7 @@ namespace Aggplus double fStartX = fX + fWidth / 2.0 + fWidth / 2 * cos( AngToEllPrm( dStartAngle, fWidth / 2, fHeight / 2 ) ); double fStartY = fY + fHeight / 2.0 - fHeight / 2 * sin( AngToEllPrm ( dStartAngle, fWidth / 2, fHeight / 2 ) ); - // В случае, когда эллипс рисуется целиком используется команда AppendEllipse, в которой команда MoveTo уже есть + // When drawing a full ellipse, AppendEllipse command is used which already contains MoveTo if ( fSweepAngle < 360 ) if ( Ok != MoveTo( fStartX, fStartY ) ) return GenericError; @@ -782,11 +782,11 @@ namespace Aggplus if( fSweepAngle > 0 ) bClockDirection = TRUE; - if( fabs(fSweepAngle) >= 360 ) // Целый эллипс + if( fabs(fSweepAngle) >= 360 ) // Full ellipse { return (0 == Ellipse(fX + fWidth / 2, fY + fHeight / 2, fWidth / 2, fHeight / 2)) ? Ok : GenericError; } - else // Дуга эллипса + else // Ellipse arc { return (0 == EllipseArc(fX + fWidth / 2, fY + fHeight / 2, fWidth / 2, fHeight / 2, fSrtAngle, fEndAngle, bClockDirection)) ? Ok : GenericError; } @@ -1383,26 +1383,26 @@ namespace Aggplus double CGraphicsPathSimpleConverter::AngToEllPrm(double fAngle, double fXRad, double fYRad) { - // Функция для перевода реального угла в параметрическое задание эллписа - // т.е. x= a cos(t) y = b sin(t) - параметрическое задание эллписа. + // Function to convert real angle to parametric ellipse definition + // i.e. x= a cos(t) y = b sin(t) - parametric ellipse definition. // x = r cos(p), y = r sin(p) => t = atan2( sin(p) / b, cos(p) / a ); return atan2( sin( fAngle ) / fYRad, cos( fAngle ) / fXRad ); } int CGraphicsPathSimpleConverter::EllipseArc2(double fX, double fY, double fXRad, double fYRad, double fAngle1, double fAngle2, INT bClockDirection) { - // переведем углы в радианы + // convert angles to radians int nRet = 0; double dAngle1 = fAngle1 * 3.141592 / 180; double dAngle2 = fAngle2 * 3.141592 / 180; - // Выясним в каких четвертях находятся начальная и конечная точки + // Determine which quadrants the start and end points are in unsigned int nFirstPointQuard = int(fAngle1) / 90 + 1; unsigned int nSecondPointQuard = int(fAngle2) / 90 + 1; nSecondPointQuard = std::min( 4, std::max( 1, (int)nSecondPointQuard ) ); nFirstPointQuard = std::min( 4, std::max( 1, (int)nFirstPointQuard ) ); - // Проведем линию в начальную точку дуги + // Draw a line to the arc start point double fStartX = 0.0, fStartY = 0.0, fEndX = 0.0, fEndY = 0.0; fStartX = fX + fXRad * cos( AngToEllPrm( dAngle1, fXRad, fYRad ) ); @@ -1410,7 +1410,7 @@ namespace Aggplus _LineTo(fStartX, fStartY); - // Дальше рисуем по четверям + // Continue drawing by quadrants double fCurX = fStartX, fCurY = fStartY; double dStartAngle = dAngle1; @@ -1452,7 +1452,7 @@ namespace Aggplus int CGraphicsPathSimpleConverter::EllipseArc3(double fX, double fY, double fXRad, double fYRad, double dAngle1, double dAngle2, double *pfXCur, double *pfYCur, INT bClockDirection) { - // Рассчитаем начальную, конечную и контрольные точки + // Calculate start, end and control points double fX1 = 0.0, fX2 = 0.0, fY1 = 0.0, fY2 = 0.0; double fCX1 = 0.0, fCX2 = 0.0, fCY1 = 0.0, fCY2 = 0.0; @@ -1513,7 +1513,7 @@ namespace Aggplus double fStartX = fX + fWidth / 2.0 + fWidth / 2 * cos( AngToEllPrm( dStartAngle, fWidth / 2, fHeight / 2 ) ); double fStartY = fY + fHeight / 2.0 - fHeight / 2 * sin( AngToEllPrm ( dStartAngle, fWidth / 2, fHeight / 2 ) ); - // В случае, когда эллипс рисуется целиком используется команда AppendEllipse, в которой команда MoveTo уже есть + // When drawing a full ellipse, AppendEllipse command is used which already contains MoveTo if ( fSweepAngle < 360 ) if ( false == _MoveTo( fStartX, fStartY ) ) return false; @@ -1525,11 +1525,11 @@ namespace Aggplus if( fSweepAngle > 0 ) bClockDirection = TRUE; - if( fabs(fSweepAngle) >= 360 ) // Целый эллипс + if( fabs(fSweepAngle) >= 360 ) // Full ellipse { return (0 == Ellipse(fX + fWidth / 2, fY + fHeight / 2, fWidth / 2, fHeight / 2)) ? true : false; } - else // Дуга эллипса + else // Ellipse arc { return (0 == EllipseArc(fX + fWidth / 2, fY + fHeight / 2, fWidth / 2, fHeight / 2, fSrtAngle, fEndAngle, bClockDirection)) ? true : false; } diff --git a/DesktopEditor/graphics/GraphicsPath.h b/DesktopEditor/graphics/GraphicsPath.h index f067efdb97..52d8968f0b 100644 --- a/DesktopEditor/graphics/GraphicsPath.h +++ b/DesktopEditor/graphics/GraphicsPath.h @@ -64,7 +64,7 @@ namespace Aggplus Status LineTo(double x, double y); Status CurveTo(double x1, double y1, double x2, double y2, double x3, double y3); - // методы, которые просто будем сводить к трем основным + // methods that will simply be reduced to three basic ones Status AddLine(double x1, double y1, double x2, double y2); Status AddLines(double* pPoints, int nCount); Status AddBezier(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4); diff --git a/DesktopEditor/graphics/GraphicsRenderer.cpp b/DesktopEditor/graphics/GraphicsRenderer.cpp index 934709d9bb..dfaa60a63e 100644 --- a/DesktopEditor/graphics/GraphicsRenderer.cpp +++ b/DesktopEditor/graphics/GraphicsRenderer.cpp @@ -317,7 +317,7 @@ void CGraphicsRenderer::UpdateSize() m_pRenderer->SetPageUnit(Aggplus::UnitMillimeter); } -// тип рендерера----------------------------------------------------------------------------- +// renderer type----------------------------------------------------------------------------- HRESULT CGraphicsRenderer::get_Type(LONG* lType) { if (NULL == lType) @@ -326,10 +326,10 @@ HRESULT CGraphicsRenderer::get_Type(LONG* lType) *lType = c_nGrRenderer; return S_OK; } -//-------- Функции для работы со страницей -------------------------------------------------- +//-------- Page functions -------------------------------------------------- HRESULT CGraphicsRenderer::NewPage() { - // ну не влезло так не влезло + // if it doesn't fit, it doesn't fit return S_OK; } HRESULT CGraphicsRenderer::put_Height(const double& dHeight) @@ -741,7 +741,7 @@ HRESULT CGraphicsRenderer::put_FontFaceIndex(const int& lFaceIndex) return S_OK; } -//-------- Функции для вывода текста -------------------------------------------------------- +//-------- Text output functions -------------------------------------------------------- HRESULT CGraphicsRenderer::CommandDrawTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h) { if (c_nHyperlinkType == m_lCurrentCommandType) @@ -809,7 +809,7 @@ HRESULT CGraphicsRenderer::CommandDrawTextEx(const std::wstring& bsUnicodeText, return CommandDrawText(bsUnicodeText, x, y, w, h); } -//-------- Маркеры для команд --------------------------------------------------------------- +//-------- Command markers --------------------------------------------------------------- HRESULT CGraphicsRenderer::BeginCommand(const DWORD& lType) { m_lCurrentCommandType = lType; @@ -883,7 +883,7 @@ HRESULT CGraphicsRenderer::EndCommand(const DWORD& lType) return S_OK; } -//-------- Функции для работы с Graphics Path ----------------------------------------------- +//-------- Graphics Path functions ----------------------------------------------- HRESULT CGraphicsRenderer::PathCommandMoveTo(const double& x, const double& y) { if (!CheckValidate()) @@ -1024,7 +1024,7 @@ HRESULT CGraphicsRenderer::DrawPath(const LONG& nType) oFrame.Decode(pImageData, nDecodeLen); RELEASEARRAYOBJECTS(pImageData); } - // pImage отдается pTextureBrush и освобождается вместе с pBrush + // pImage is passed to pTextureBrush and released together with pBrush Aggplus::CImage* pImage = new Aggplus::CImage(); pImage->Create(oFrame.get_Data(), oFrame.get_Width(), oFrame.get_Height(), oFrame.get_Stride()); oFrame.ClearNoAttack(); @@ -1118,7 +1118,7 @@ HRESULT CGraphicsRenderer::PathCommandTextCHAR(const LONG& c, const double& x, c _SetFont(); - // так как пат рисуется в миллиметрах - надо перевести пункты в миллиметры + // since path is drawn in millimeters - need to convert points to millimeters float fSize = (float)(0.3528 * m_oFont.Size); m_pPath->AddStringC(c, m_pFontManager, x, y); @@ -1131,7 +1131,7 @@ HRESULT CGraphicsRenderer::PathCommandText(const std::wstring& bsText, const dou _SetFont(); - // так как пат рисуется в миллиметрах - надо перевести пункты в миллиметры + // since path is drawn in millimeters - need to convert points to millimeters float fSize = (float)(0.3528 * m_oFont.Size); m_pPath->AddString(bsText, m_pFontManager, x, y); @@ -1159,7 +1159,7 @@ HRESULT CGraphicsRenderer::PathCommandTextEx(const std::wstring& bsUnicodeText, _SetFont(); - // так как пат рисуется в миллиметрах - надо перевести пункты в миллиметры + // since path is drawn in millimeters - need to convert points to millimeters float fSize = (float)(0.3528 * m_oFont.Size); m_pPath->AddString(pGids, nGidsCount, m_pFontManager, x, y); @@ -1170,7 +1170,7 @@ HRESULT CGraphicsRenderer::PathCommandTextEx(const std::wstring& bsUnicodeText, return PathCommandText(bsUnicodeText, x, y, w, h); } -//-------- Функции для вывода изображений --------------------------------------------------- +//-------- Image output functions --------------------------------------------------- HRESULT CGraphicsRenderer::DrawImage(IGrObject* pImage, const double& x, const double& y, const double& w, const double& h) { if (!CheckValidate(TRUE) || NULL == pImage) diff --git a/DesktopEditor/graphics/GraphicsRenderer.h b/DesktopEditor/graphics/GraphicsRenderer.h index 4366d5298d..c60c633872 100644 --- a/DesktopEditor/graphics/GraphicsRenderer.h +++ b/DesktopEditor/graphics/GraphicsRenderer.h @@ -44,7 +44,7 @@ public: IGraphicsRenderer_State() { - // пока не используется + // not used yet Type = 0; } virtual ~IGraphicsRenderer_State() @@ -75,13 +75,13 @@ private: LONG m_lCurrentClipMode; INT m_bIsSetupClip; - // область отсечения + // clipping region LONG m_lClipLeft; LONG m_lClipTop; LONG m_lClipWidth; LONG m_lClipHeight; - // пикселы + // pixels BYTE* m_pPixels; Aggplus::CDIB* m_pDIB; @@ -128,9 +128,9 @@ public: virtual void Restore(); public: -// тип рендерера----------------------------------------------------------------------------- +// renderer type----------------------------------------------------------------------------- virtual HRESULT get_Type(LONG* lType); -//-------- Функции для работы со страницей -------------------------------------------------- +//-------- Page functions -------------------------------------------------- virtual HRESULT NewPage(); virtual HRESULT get_Height(double* dHeight); virtual HRESULT put_Height(const double& dHeight); @@ -213,18 +213,18 @@ public: virtual HRESULT get_FontFaceIndex(int* lFaceIndex); virtual HRESULT put_FontFaceIndex(const int& lFaceIndex); -//-------- Функции для вывода текста -------------------------------------------------------- +//-------- Text output functions -------------------------------------------------------- virtual HRESULT CommandDrawTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h); virtual HRESULT CommandDrawText(const std::wstring& bsText, const double& x, const double& y, const double& w, const double& h); virtual HRESULT CommandDrawTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h); virtual HRESULT CommandDrawTextEx(const std::wstring& bsUnicodeText, const unsigned int* pGids, const unsigned int nGidsCount, const double& x, const double& y, const double& w, const double& h); -//-------- Маркеры для команд --------------------------------------------------------------- +//-------- Command markers --------------------------------------------------------------- virtual HRESULT BeginCommand(const DWORD& lType); virtual HRESULT EndCommand(const DWORD& lType); -//-------- Функции для работы с Graphics Path ----------------------------------------------- +//-------- Graphics Path functions ----------------------------------------------- virtual HRESULT PathCommandMoveTo(const double& x, const double& y); virtual HRESULT PathCommandLineTo(const double& x, const double& y); virtual HRESULT PathCommandLinesTo(double* points, const int& count); @@ -243,7 +243,7 @@ public: virtual HRESULT PathCommandTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h); virtual HRESULT PathCommandTextEx(const std::wstring& sText, const unsigned int* pGids, const unsigned int nGidsCount, const double& x, const double& y, const double& w, const double& h); -//-------- Функции для вывода изображений --------------------------------------------------- +//-------- Image output functions --------------------------------------------------- virtual HRESULT DrawImage(IGrObject* pImage, const double& x, const double& y, const double& w, const double& h); virtual HRESULT DrawImageFromFile(const std::wstring& sFile, const double& x, const double& y, const double& w, const double& h, const BYTE& lAlpha = 255); diff --git a/DesktopEditor/graphics/IRenderer.h b/DesktopEditor/graphics/IRenderer.h index 39200cd0cf..bf6e176eea 100644 --- a/DesktopEditor/graphics/IRenderer.h +++ b/DesktopEditor/graphics/IRenderer.h @@ -40,12 +40,12 @@ #include "structures.h" #include "Matrix.h" -// тип в DrawPath +// type in DrawPath const long c_nStroke = 0x0001; const long c_nWindingFillMode = 0x0100; const long c_nEvenOddFillMode = 0x0200; -// тип в BeginCommand, EndCommand +// type in BeginCommand, EndCommand const long c_nNone = 0x0000; const long c_nPageType = 0x0001; const long c_nTextType = 0x0002; @@ -93,23 +93,23 @@ const long c_nBlockHorzAlign = 0xa033; const long c_nLine = 0xa040; const long c_nBaselineShift = 0xa041; -// типы клипа +// clip types const long c_nClipRegionTypeWinding = 0x0000; const long c_nClipRegionTypeEvenOdd = 0x0001; -// тип преобразования пути для клипов +// path transformation type for clips const long c_nClipToPath = 0x0000; const long c_nClipToStrokePath = 0x0010; -// тип объединения клипов +// clip union type const long c_nClipRegionIntersect = 0x0000; const long c_nClipRegionUnion = 0x0100; const long c_nClipRegionXor = 0x0200; const long c_nClipRegionDiff = 0x0400; -// флаги в CommandDrawTextEx +// flags in CommandDrawTextEx const long c_nFlagNone = 0x0000; const long c_nFlagHyperlink = 0x0001; -// флаги в CommandParams +// flags in CommandParams const long c_nParamFlipX = 0x0001; const long c_nParamFlipY = 0x0002; const long c_nFlipNextRotate = 0x0004; @@ -119,7 +119,7 @@ const long c_nPenWidth0As1px = 0x0020; const long c_nSupportPathTextAsText = 0x0040; const long c_nFontSubstitution = 0x0080; -// типы рендерера +// renderer types const long c_nUnknownRenderer = 0x0000; const long c_nPDFWriter = 0x0001; const long c_nHtmlRendrerer = 0x0002; @@ -137,7 +137,7 @@ const long c_nQRenderer = 0x0013; const int c_nAdditionalParamBreak = 0x00; -// типы команд +// command types const long c_nCommandLongTypeOnlyText = 0x1000; class IAdvancedCommand @@ -148,7 +148,7 @@ public: Hyperlink = 0, Link = 1, DocInfo = 2, - FormField = 3, // Обратная совместимость для docxf + FormField = 3, // Backward compatibility for docxf Annotaion = 4, DeleteAnnot = 5, WidgetsInfo = 6, @@ -187,9 +187,9 @@ public: } public: - // тип рендерера----------------------------------------------------------------------------- + // renderer type----------------------------------------------------------------------------- virtual HRESULT get_Type(LONG* lType) = 0; - //-------- Функции для работы со страницей -------------------------------------------------- + //-------- Page functions -------------------------------------------------- virtual HRESULT NewPage() = 0; virtual HRESULT get_Height(double* dHeight) = 0; virtual HRESULT put_Height(const double& dHeight) = 0; @@ -292,7 +292,7 @@ public: virtual HRESULT get_FontFaceIndex(int* lFaceIndex) = 0; virtual HRESULT put_FontFaceIndex(const int& lFaceIndex) = 0; - //-------- Функции для вывода текста -------------------------------------------------------- + //-------- Text output functions -------------------------------------------------------- virtual HRESULT CommandDrawTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h) = 0; virtual HRESULT CommandDrawText(const std::wstring& bsText, const double& x, const double& y, const double& w, const double& h) = 0; @@ -306,11 +306,11 @@ public: return CommandDrawTextExCHAR(c, (LONG)gid, x, y, w, h); } - //-------- Маркеры для команд --------------------------------------------------------------- + //-------- Command markers --------------------------------------------------------------- virtual HRESULT BeginCommand(const DWORD& lType) = 0; virtual HRESULT EndCommand(const DWORD& lType) = 0; - //-------- Функции для работы с Graphics Path ----------------------------------------------- + //-------- Graphics Path functions ----------------------------------------------- virtual HRESULT PathCommandMoveTo(const double& x, const double& y) = 0; virtual HRESULT PathCommandLineTo(const double& x, const double& y) = 0; virtual HRESULT PathCommandLinesTo(double* points, const int& count) = 0; @@ -331,7 +331,7 @@ public: HRESULT AddPath(const Aggplus::CGraphicsPath& path); - //-------- Функции для вывода изображений --------------------------------------------------- + //-------- Image output functions --------------------------------------------------- virtual HRESULT DrawImage(IGrObject* pImage, const double& x, const double& y, const double& w, const double& h) = 0; virtual HRESULT DrawImageFromFile(const std::wstring&, const double& x, const double& y, const double& w, const double& h, const BYTE& lAlpha = 255) = 0; diff --git a/DesktopEditor/graphics/Image.cpp b/DesktopEditor/graphics/Image.cpp index fbdb7518c2..0f9010fc5a 100644 --- a/DesktopEditor/graphics/Image.cpp +++ b/DesktopEditor/graphics/Image.cpp @@ -113,7 +113,7 @@ namespace Aggplus oBgraFrame.put_Stride(m_nStride); oBgraFrame.put_Data(m_pImgData); bool bRes = oBgraFrame.SaveFile(strFileName, nFileType); - //чтобы не удалялся на destructor + // to prevent deletion in destructor oBgraFrame.put_Data(NULL); return bRes; } diff --git a/DesktopEditor/graphics/MetafileToGraphicsRenderer.cpp b/DesktopEditor/graphics/MetafileToGraphicsRenderer.cpp index d35e840f78..82498be5ed 100644 --- a/DesktopEditor/graphics/MetafileToGraphicsRenderer.cpp +++ b/DesktopEditor/graphics/MetafileToGraphicsRenderer.cpp @@ -48,7 +48,7 @@ namespace NSOnlineOfficeBinToPdf // saveFlags = (save_type & 0xF0) >> 1 // saveType: // 0 - stretch - // 1 - делаем максимально большую картинку с аспектом как у страницы и вписанную в [m_nRasterW x m_nRasterH] + // 1 - create largest image with page aspect ratio fitting within [m_nRasterW x m_nRasterH] // 2 - nRasterW = (int)((pageW * m_internal->m_dDpiX / 25.4) + 0.5); // nRasterH = (int)((pageH * m_internal->m_dDpiY / 25.4) + 0.5); // 3 - special mode for clouds (see code) diff --git a/DesktopEditor/graphics/MetafileToRenderer.cpp b/DesktopEditor/graphics/MetafileToRenderer.cpp index 0b6f8d2ef3..0846665dc8 100644 --- a/DesktopEditor/graphics/MetafileToRenderer.cpp +++ b/DesktopEditor/graphics/MetafileToRenderer.cpp @@ -38,8 +38,8 @@ #include "../common/StringExt.h" #include "GraphicsPath.h" -// этот класс нужно переписать. должно работать как и в js -// а не просто на каждом символе переключаться, если нужно +// this class needs to be rewritten. should work the same as in js +// instead of just switching on each character when needed class CMetafileFontPicker { private: @@ -294,7 +294,7 @@ std::wstring IMetafileToRenderter::GetImagePath(const std::wstring& sPath) if (0 == sImagePath.find(L"file:///")) { - // TODO: под linux код неправильный + // TODO: code is incorrect on linux NSStringExt::Replace(sImagePath, L"file:///", L""); NSStringExt::Replace(sImagePath, L"\\", L"/"); } @@ -344,7 +344,7 @@ namespace NSOnlineOfficeBinToPdf LONG lRendererType = 0; pRenderer->get_Type(&lRendererType); - // из команд js - точные имена + // from js commands - exact names pRenderer->CommandLong(c_nUseDictionaryFonts, 0); CommandType eCommand = ctError; @@ -890,7 +890,7 @@ namespace NSOnlineOfficeBinToPdf } case ctGradientFill: { - // TODO: Эта команда не должна приходить + // TODO: This command should not be received INT32 gradientType = oReader.ReadInt(); std::wstring sXml, sXmlStop; @@ -933,7 +933,7 @@ namespace NSOnlineOfficeBinToPdf } case ctGradientFillXML: { - // TODO: Эта команда не должна приходить + // TODO: This command should not be received INT32 gradientType = oReader.ReadInt(); int nLen = oReader.ReadInt(); std::wstring wsTempString = oReader.ReadString16(nLen); @@ -941,7 +941,7 @@ namespace NSOnlineOfficeBinToPdf } case ctGradientStroke: { - // TODO: Эта команда не должна приходить + // TODO: This command should not be received INT32 gradientType = oReader.ReadInt(); if (0 == gradientType) // linearGradient { @@ -982,14 +982,14 @@ namespace NSOnlineOfficeBinToPdf } case ctGradientStrokeXML: { - // TODO: Эта команда не должна приходить + // TODO: This command should not be received INT32 gradientType = oReader.ReadInt(); int nLen = (int)oReader.ReadInt(); std::wstring wsTempString = oReader.ReadString16(nLen); break; } - // дополнительные команды. из-за совместимости версий не можем менят формат. - // но все следующие - должны быть по одной схеме + // additional commands. cannot change format due to version compatibility. + // but all following should use the same schema case ctHyperlink: { if (S_OK == pRenderer->IsSupportAdvancedCommand(IAdvancedCommand::AdvancedCommandType::Hyperlink)) @@ -1373,7 +1373,7 @@ namespace NSOnlineOfficeBinToPdf case ctGradientStroke: case ctGradientStrokeXML: { - // TODO: Эта команда не должна приходить + // TODO: This command should not be received return; } case ctHyperlink: diff --git a/DesktopEditor/graphics/MetafileToRenderer.h b/DesktopEditor/graphics/MetafileToRenderer.h index 6314e43490..0655391f43 100644 --- a/DesktopEditor/graphics/MetafileToRenderer.h +++ b/DesktopEditor/graphics/MetafileToRenderer.h @@ -101,7 +101,7 @@ namespace NSOnlineOfficeBinToPdf ctBrushColor2 = 23, ctBrushAlpha1 = 24, ctBrushAlpha2 = 25, - ctBrushTexturePathOld = 26, // для совместимости + ctBrushTexturePathOld = 26, // for compatibility ctBrushTextureAlpha = 27, ctBrushTextureMode = 28, ctBrushRectable = 29, diff --git a/DesktopEditor/graphics/pro/Fonts.h b/DesktopEditor/graphics/pro/Fonts.h index 5fc78d93ac..7384662cdf 100644 --- a/DesktopEditor/graphics/pro/Fonts.h +++ b/DesktopEditor/graphics/pro/Fonts.h @@ -84,7 +84,7 @@ namespace NSFonts { fontWindowsFNT = 0, // *.fon fontTrueType = 1, // *.ttf - fontOpenType = 2, // *.ttf, *.otf (CFF формат) + fontOpenType = 2, // *.ttf, *.otf (CFF format) fontUnknown = 3 }; @@ -209,14 +209,14 @@ namespace NSFonts } public: - std::wstring m_wsFontName; // Имя шрифта - std::wstring m_wsFontPath; // Путь к файлу с шрифтом - long m_lIndex; // Номер шрифта в файле(если в файле больше 1 шрифта) + std::wstring m_wsFontName; // Font name + std::wstring m_wsFontPath; // Path to font file + long m_lIndex; // Font index in file (if file contains more than 1 font) std::wstring m_wsStyle; INT m_bBold; // Bold text INT m_bItalic; // Italic text - INT m_bIsFixed; // Моноширинный шрифт? + INT m_bIsFixed; // Monospace font? BYTE m_aPanose[10]; UINT m_ulUnicodeRange1; // Bits 0-31 @@ -233,12 +233,12 @@ namespace NSFonts SHORT m_sFamilyClass; EFontFormat m_eFontFormat; - SHORT m_shAvgCharWidth; // Средняя ширина символов + SHORT m_shAvgCharWidth; // Average character width SHORT m_shAscent; // Ascent SHORT m_shDescent; // Descent - SHORT m_shLineGap; // Межсимвольный интервал - SHORT m_shXHeight; // Высота буквы 'x' (в нижнем регистре) - SHORT m_shCapHeight; // Высота буквы 'H' (в верхнем регистре) + SHORT m_shLineGap; // Line gap + SHORT m_shXHeight; // Height of letter 'x' (lowercase) + SHORT m_shCapHeight; // Height of letter 'H' (uppercase) USHORT m_usType; diff --git a/DesktopEditor/graphics/pro/Image.h b/DesktopEditor/graphics/pro/Image.h index 313ee4f51e..1aca605cb0 100644 --- a/DesktopEditor/graphics/pro/Image.h +++ b/DesktopEditor/graphics/pro/Image.h @@ -134,7 +134,7 @@ namespace MetaFile virtual std::wstring ConvertToSvg(unsigned int unWidth = 0, unsigned int unHeight = 0) = 0; virtual void SetTempDirectory(const std::wstring& dir) = 0; - //Для тестов + // For tests #ifdef METAFILE_SUPPORT_WMF_EMF virtual void ConvertToXml(const wchar_t *wsFilePath) = 0; virtual void ConvertToXmlAndRaster(const wchar_t *wsXmlFilePath, const wchar_t* wsOutFilePath, unsigned int unFileType, int nWidth, int nHeight = -1) = 0; diff --git a/DesktopEditor/graphics/pro/js/make.py b/DesktopEditor/graphics/pro/js/make.py index d9a7610ca4..71c7e9d336 100644 --- a/DesktopEditor/graphics/pro/js/make.py +++ b/DesktopEditor/graphics/pro/js/make.py @@ -70,7 +70,7 @@ if not base.is_dir("freetype-2.10.4"): # compile compiler_flags = ["-O3", - # "-fno-rtti", cryptopp использует typeid + # "-fno-rtti", cryptopp uses typeid "-fexceptions", "-Wno-unused-command-line-argument", "-s WASM=1", diff --git a/DesktopEditor/graphics/pro/js/wasm/js/raster.js b/DesktopEditor/graphics/pro/js/wasm/js/raster.js index bdeb49bb9b..548f5ec850 100644 --- a/DesktopEditor/graphics/pro/js/wasm/js/raster.js +++ b/DesktopEditor/graphics/pro/js/wasm/js/raster.js @@ -45,11 +45,11 @@ function Raster() { if (!this.isInit) { - // не подгружен еще модуль + // module not loaded yet return null; } - // копируем память в память webasm + // copy memory to webasm memory var imageFileRawDataSize = dataBuffer.byteLength; var imageFileRawData = Module["_Raster_Malloc"](imageFileRawDataSize); if (0 === imageFileRawData) @@ -58,7 +58,7 @@ function Raster() var uint8DataBuffer = new Uint8Array(dataBuffer); Module["HEAP8"].set(uint8DataBuffer, imageFileRawData); - // грузим картинку + // load image var imageFile = Module["_Raster_Load"](imageFileRawData, imageFileRawDataSize); if (0 === imageFile) { @@ -66,7 +66,7 @@ function Raster() return null; } - // получаем данные картинки + // get image data var imageW = Module["_Raster_GetWidth"](imageFile); var imageH = Module["_Raster_GetHeight"](imageFile); var imageRGBA = Module["_Raster_GetRGBA"](imageFile); @@ -78,7 +78,7 @@ function Raster() return null; } - // быстро копируем память в канву + // quickly copy memory to canvas var canvas = document.createElement("canvas"); canvas.width = imageW; canvas.height = imageH; diff --git a/DesktopEditor/graphics/pro/js/wasm/src/HTMLRendererText.cpp b/DesktopEditor/graphics/pro/js/wasm/src/HTMLRendererText.cpp index 4177ee8ce3..c04c8202a4 100644 --- a/DesktopEditor/graphics/pro/js/wasm/src/HTMLRendererText.cpp +++ b/DesktopEditor/graphics/pro/js/wasm/src/HTMLRendererText.cpp @@ -49,9 +49,9 @@ namespace NSHtmlRenderer CHText m_oSmartText; NSWasm::CData m_oPage; - int* m_pTempUnicodes; // массив юникодов - int m_nTempUnicodesAlloc; // размер выделенной памяти - int m_nTempUnicodesLen; // размер используемой памяти + int* m_pTempUnicodes; // unicode array + int m_nTempUnicodesAlloc; // allocated memory size + int m_nTempUnicodesLen; // used memory size bool m_bIsFontsInit; @@ -144,7 +144,7 @@ namespace NSHtmlRenderer m_pInternal->m_oPage.ClearNoAttack(); m_pInternal->m_oPage.SkipLen(); - // статистика + // statistics m_pInternal->m_oPage.AddInt(0); m_pInternal->m_oPage.AddInt(0); m_pInternal->m_oPage.AddInt(0); @@ -155,7 +155,7 @@ namespace NSHtmlRenderer m_pInternal->m_oSmartText.ClosePage(); m_pInternal->m_oPage.WriteLen(); - // статистика + // statistics m_pInternal->m_oPage.AddInt(m_pInternal->m_oSmartText.m_nCountParagraphs, 4); m_pInternal->m_oPage.AddInt(m_pInternal->m_oSmartText.m_nCountWords, 8); m_pInternal->m_oPage.AddInt(m_pInternal->m_oSmartText.m_nCountSymbols, 12); @@ -170,7 +170,7 @@ namespace NSHtmlRenderer return S_OK; } - //-------- Функции для работы со страницей -------------------------------------------------- + //-------- Page functions -------------------------------------------------- HRESULT CHTMLRendererText::NewPage() { return S_OK; } HRESULT CHTMLRendererText::get_Height(double* dHeight) { @@ -326,7 +326,7 @@ namespace NSHtmlRenderer return S_OK; } - //-------- Функции для вывода текста -------------------------------------------------------- + //-------- Text output functions -------------------------------------------------------- HRESULT CHTMLRendererText::CommandDrawTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h) { int _c = (int)c; @@ -354,11 +354,11 @@ namespace NSHtmlRenderer return S_OK; } - //-------- Маркеры для команд --------------------------------------------------------------- + //-------- Command markers --------------------------------------------------------------- HRESULT CHTMLRendererText::BeginCommand(const DWORD& lType) { return S_OK; } HRESULT CHTMLRendererText::EndCommand(const DWORD& lType) { return S_OK; } - //-------- Функции для работы с Graphics Path ----------------------------------------------- + //-------- Graphics Path functions ----------------------------------------------- HRESULT CHTMLRendererText::PathCommandMoveTo(const double& x, const double& y) { return S_OK; } HRESULT CHTMLRendererText::PathCommandLineTo(const double& x, const double& y) { return S_OK; } HRESULT CHTMLRendererText::PathCommandLinesTo(double* points, const int& count) { return S_OK; } @@ -375,7 +375,7 @@ namespace NSHtmlRenderer HRESULT CHTMLRendererText::PathCommandTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h) { return S_OK; } HRESULT CHTMLRendererText::PathCommandTextEx(const std::wstring& bsUnicodeText, const unsigned int* pGids, const unsigned int nGidsCount, const double& x, const double& y, const double& w, const double& h) { return S_OK; } - //-------- Функции для вывода изображений --------------------------------------------------- + //-------- Image output functions --------------------------------------------------- HRESULT CHTMLRendererText::DrawImage(IGrObject* pImage, const double& x, const double& y, const double& w, const double& h) { return S_OK; } HRESULT CHTMLRendererText::DrawImageFromFile(const std::wstring& sPath, const double& x, const double& y, const double& w, const double& h, const BYTE& lAlpha) { return S_OK; } diff --git a/DesktopEditor/graphics/pro/js/wasm/src/HTMLRendererText.h b/DesktopEditor/graphics/pro/js/wasm/src/HTMLRendererText.h index 79a4d144f9..6c1175bb59 100644 --- a/DesktopEditor/graphics/pro/js/wasm/src/HTMLRendererText.h +++ b/DesktopEditor/graphics/pro/js/wasm/src/HTMLRendererText.h @@ -56,9 +56,9 @@ namespace NSHtmlRenderer BYTE* GetBuffer(); public: - // тип рендерера----------------------------------------------------------------------------- + // renderer type----------------------------------------------------------------------------- virtual HRESULT get_Type(LONG* lType); - //-------- Функции для работы со страницей -------------------------------------------------- + //-------- Functions for working with page -------------------------------------------------- virtual HRESULT NewPage(); virtual HRESULT get_Height(double* dHeight); virtual HRESULT put_Height(const double& dHeight); @@ -134,18 +134,18 @@ namespace NSHtmlRenderer virtual HRESULT get_FontFaceIndex(int* lFaceIndex); virtual HRESULT put_FontFaceIndex(const int& lFaceIndex); - //-------- Функции для вывода текста -------------------------------------------------------- + //-------- Functions for text output -------------------------------------------------------- virtual HRESULT CommandDrawTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h); virtual HRESULT CommandDrawText(const std::wstring& bsText, const double& x, const double& y, const double& w, const double& h); virtual HRESULT CommandDrawTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h); virtual HRESULT CommandDrawTextEx(const std::wstring& bsUnicodeText, const unsigned int* pGids, const unsigned int nGidsCount, const double& x, const double& y, const double& w, const double& h); - //-------- Маркеры для команд --------------------------------------------------------------- + //-------- Command markers --------------------------------------------------------------- virtual HRESULT BeginCommand(const DWORD& lType); virtual HRESULT EndCommand(const DWORD& lType); - //-------- Функции для работы с Graphics Path ----------------------------------------------- + //-------- Functions for working with Graphics Path ----------------------------------------------- virtual HRESULT PathCommandMoveTo(const double& x, const double& y); virtual HRESULT PathCommandLineTo(const double& x, const double& y); virtual HRESULT PathCommandLinesTo(double* points, const int& count); @@ -164,7 +164,7 @@ namespace NSHtmlRenderer virtual HRESULT PathCommandTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h); virtual HRESULT PathCommandTextEx(const std::wstring& bsUnicodeText, const unsigned int* pGids, const unsigned int nGidsCount, const double& x, const double& y, const double& w, const double& h); - //-------- Функции для вывода изображений --------------------------------------------------- + //-------- Functions for image output --------------------------------------------------- virtual HRESULT DrawImage(IGrObject* pImage, const double& x, const double& y, const double& w, const double& h); virtual HRESULT DrawImageFromFile(const std::wstring&, const double& x, const double& y, const double& w, const double& h, const BYTE& lAlpha = 255); diff --git a/DesktopEditor/graphics/pro/js/wasm/src/Text.h b/DesktopEditor/graphics/pro/js/wasm/src/Text.h index 2f4ef404cf..29041be15e 100644 --- a/DesktopEditor/graphics/pro/js/wasm/src/Text.h +++ b/DesktopEditor/graphics/pro/js/wasm/src/Text.h @@ -162,7 +162,7 @@ namespace NSHtmlRenderer } void CommandText(const int* pUnicodes, const int* pGids, const int& nCount, const double& x, const double& y, bool bIsDumpFont) { - // 1) сначала определяем точку отсчета и направление baseline + // 1) first determine reference point and baseline direction double _x1 = x; double _y1 = y; double _x2 = x + 1; @@ -196,11 +196,11 @@ namespace NSHtmlRenderer else if (!_isConstX && !m_oLine.m_bIsConstX && fabs(_k - m_oLine.m_dK) < 0.001 && fabs(_b - m_oLine.m_dB) < 0.001) bIsNewLine = false; - if (bIsNewLine) // не совпала baseline. поэтому просто скидываем линию в поток + if (bIsNewLine) // baseline didn't match. so just dump line to stream DumpLine(); } - // теперь нужно определить сдвиг по baseline относительно destination точки + // now need to determine offset along baseline relative to destination point double dOffsetX = 0; LONG nCountChars = m_oLine.GetCountChars(); if (0 == nCountChars) @@ -226,14 +226,14 @@ namespace NSHtmlRenderer if (sx * m_oLine.m_ex >= 0 && sy * m_oLine.m_ey >= 0) { - // продолжаем линию + // continue line dOffsetX = len; - // теперь посмотрим, может быть нужно вставить пробел?? + // now let's see if we need to insert a space NSWasm::CHChar* pLastChar = m_oLine.GetTail(); if (dOffsetX > (pLastChar->width + 0.5)) { - // вставляем пробел. Пробел у нас будет не совсем пробел. А специфический + // insert space. Our space will not be a regular space. But a specific one NSWasm::CHChar* pSpaceChar = m_oLine.AddTail(); pLastChar = &m_oLine.m_pChars[m_oLine.m_lCharsTail - 2]; pSpaceChar->x = pLastChar->width; @@ -244,9 +244,9 @@ namespace NSHtmlRenderer } else { - // буква сдвинута влево относительно предыдущей буквы - // на такую ситуацию реагируем просто - просто начинаем новую линию, - // предварительно сбросив старую + // letter is shifted left relative to previous letter + // we react to this situation simply - just start a new line, + // after dumping the old one DumpLine(); m_oLine.m_bIsConstX = _isConstX; @@ -266,7 +266,7 @@ namespace NSHtmlRenderer } if (!Aggplus::CMatrix::IsEqual(m_pLastTransform, m_pTransform, 0.001, true)) - { // смотрим, совпадает ли главная часть матрицы + { // check if main part of matrix matches bIsDumpFont = true; *m_pLastTransform = *m_pTransform; m_oLine.m_bIsSetUpTransform = true; @@ -276,7 +276,7 @@ namespace NSHtmlRenderer m_oLine.m_sy = m_pTransform->sy(); } - // все, baseline установлен. теперь просто продолжаем линию + // done, baseline is set. now just continue the line if (bIsDumpFont) m_oFontManager.LoadCurrentFont(); @@ -334,12 +334,12 @@ namespace NSHtmlRenderer if (m_oLine.m_bIsSetUpTransform) { - // выставится трансформ!!! - // cравнивать нужно с ним!!! + // transform will be set!!! + // need to compare with it!!! m_pLastTransform->SetElements(m_oLine.m_sx, m_oLine.m_shy, m_oLine.m_shx, m_oLine.m_sy); } - // скидываем линию в поток pMeta + // dump line to pMeta stream m_pPageMeta->WriteDouble(m_oLine.m_dX); m_pPageMeta->WriteDouble(m_oLine.m_dY); @@ -392,8 +392,8 @@ namespace NSHtmlRenderer bIsLastSymbol = true; } - m_pPageMeta->AddInt(pChar->unicode); // юникодное значение - m_pPageMeta->WriteDouble(pChar->width); // ширина буквы + m_pPageMeta->AddInt(pChar->unicode); // unicode value + m_pPageMeta->WriteDouble(pChar->width); // letter width } if (bIsLastSymbol) m_nCountWords++; diff --git a/DesktopEditor/graphics/pro/js/wasm/src/drawingfile.cpp b/DesktopEditor/graphics/pro/js/wasm/src/drawingfile.cpp index b88b3aaecf..87737b5f51 100644 --- a/DesktopEditor/graphics/pro/js/wasm/src/drawingfile.cpp +++ b/DesktopEditor/graphics/pro/js/wasm/src/drawingfile.cpp @@ -73,7 +73,7 @@ WASM_EXPORT CDrawingFile* Open(BYTE* data, LONG size, const char* password) if (!g_applicationFonts) g_applicationFonts = NSFonts::NSApplication::Create(); - // всегда пересоздаем сторадж + // always recreate storage CDrawingFile::InitFontsGlobalStorage(); CDrawingFile* pFile = new CDrawingFile(g_applicationFonts); diff --git a/DesktopEditor/graphics/pro/js/wasm/src/serialize.h b/DesktopEditor/graphics/pro/js/wasm/src/serialize.h index 1d36cbbabc..e29ad97cf9 100644 --- a/DesktopEditor/graphics/pro/js/wasm/src/serialize.h +++ b/DesktopEditor/graphics/pro/js/wasm/src/serialize.h @@ -168,7 +168,7 @@ namespace NSWasm } void AddDouble(double value) { - // такой точности хватит + // this precision is sufficient int nV = value * 100; AddInt(nV); } @@ -341,9 +341,9 @@ namespace NSWasm struct CHChar { - int unicode; // юникодное значение - double x; // сдвиг по baseline - double width; // ширина символа (сдвиг до след буквы) + int unicode; // unicode value + double x; // offset along baseline + double width; // character width (offset to next letter) CHChar() : unicode(0), x(0), width(0) {} CHChar(const CHChar& oSrc) { *this = oSrc; } @@ -381,8 +381,8 @@ namespace NSWasm bool m_bIsConstX; // symbols - // не менять на списки. постоянное создание объектов и их удаление - - // плохо влияет на скорость + // do not change to lists. constant object creation and deletion - + // negatively affects performance CHChar* m_pChars; LONG m_lSizeChars; LONG m_lCharsTail; diff --git a/DesktopEditor/graphics/shading_info.h b/DesktopEditor/graphics/shading_info.h index 0c763942d4..e28798e093 100644 --- a/DesktopEditor/graphics/shading_info.h +++ b/DesktopEditor/graphics/shading_info.h @@ -52,25 +52,25 @@ namespace NSStructures template <class ColorT = agg::rgba8> class ColorFunction /** - * Реализацию произвольной функции в рантайме я решил сделать как массив, тк так проще всего - * я еще не совсем понял как точно передается в пдфе функция, но такая реализация, позволяет пользователю - * выбрать любой способ. + * I decided to implement arbitrary function at runtime as an array, since it's the simplest + * I haven't fully understood how exactly the function is passed in PDF, but this implementation allows the user + * to choose any method. * - * Пока все копируется, т.к. в большинсве случаев вектор 2кБ по размеру и проблем нету - * только если использовать двумерную функцию размер возрастает до МБ, но не хочется возится с укузателями - * ради этого, т.к. судя по всему случай исключительный(только 1 шейдинг требует такую функцию). - * Если надо будет, наверно можно будет переписать на юникптр. + * For now everything is copied, since in most cases the vector is 2KB in size and there are no problems + * only when using a 2D function the size grows to MB, but I don't want to deal with pointers + * for this, since apparently the case is exceptional (only 1 shading requires such a function). + * If needed, it can probably be rewritten to unique_ptr. * - * Есть возможность выставить обычную линейную интерполяцию, просто для тестирования - * + так реализуется градиент стандартный. + * There is an option to set regular linear interpolation, just for testing + * + this is how standard gradient is implemented. * - * Пока у меня конструкторы по умолчанию, чтото заполняют, для тестирования опятьже - * потом стоит все убрать, чтобы в кисти не таскать это все, когда оно не нужно, - * если не выделять память то там в сумме будет <100B гдето, не думаю, что это будет так много, - * чтобы писать отдельный интерфейс для кисти + * For now my default constructors fill something, for testing again + * later we should remove all this, so we don't carry all this in the brush when it's not needed, + * if we don't allocate memory then in total it will be <100B somewhere, I don't think it will be so much, + * to write a separate interface for the brush * - * Плюс я вообще не знаю как обрабатывать, внештатные ситуации, в целом, можно вообще просто - * эксепшены кидать если что или ничего не делать. + * Plus I don't even know how to handle edge cases, in general, we can just + * throw exceptions if something goes wrong or do nothing. */ { public: @@ -241,7 +241,7 @@ namespace NSStructures return y_index; } /** - * Линейная интерполяция для построения цветовой функции. + * Linear interpolation for building color function. */ int interpolate_indexes(size_t first, size_t second, size_t line = 0) { @@ -294,7 +294,7 @@ namespace NSStructures /** - * Костыль от ошибок линковки. Чтобы время не терять пока что. + * Workaround for linking errors. To not waste time for now. */ friend Point operator*(const Point &a, float t) { @@ -317,17 +317,17 @@ namespace NSStructures /** - * Тут хранится информация спецефичная для рендера ПДФ. + * This stores information specific to PDF rendering. * - * Взял новую реализацию преобразований, т.к. готовая была на даблах, - * а в такой точности смысла нету особо. + * Used a new transformation implementation, since the existing one was on doubles, + * and there's not much point in such precision. * - * Для шейдеров требуется поддерживать два способа вычисления (с параметром и без), - * поэтому требуется много дополнительной инфы. + * For shaders we need to support two calculation methods (with and without parameter), + * so a lot of additional info is required. * - * Так же шейдер будет получать, в качетве параметров, границы, тут я пока не решил, вообще - * можно оставить соблюдение границ, на откуп пользователю, т.к. все равно заполенение в конечном итоге будет - * выполняться с помощью рисования замкнутого пути и команды Fill + * Also the shader will receive boundaries as parameters, I haven't decided yet, + * we can leave boundary enforcement to the user, since filling will ultimately be done + * by drawing a closed path and the Fill command * */ struct ShadingInfo { @@ -349,11 +349,11 @@ namespace NSStructures } f_type; ColorFunction<agg::rgba8> function; - // Обратное преобразование из картинки в цветовую функцию + // Reverse transformation from image to color function std::vector<float> mapping; std::vector<float> inv_map; - // Линейный градиент задается в pdf 2 точками + // Linear gradient is defined in PDF by 2 points bool set_two_points; Point point1, point2; @@ -364,17 +364,17 @@ namespace NSStructures std::vector<float> triangle_parameters; /** - * Матрица 4 на 4 заполняется как в документации к пдф 7 тип - * Если выбран тип 6 то значения (1,2) (2,1) (1,1) (2,2) - * В массиве игнормруется и заполняются автоматически, следите за переданным типом градинта - * (Нумерация от нуля) + * 4x4 matrix is filled as in PDF documentation type 7 + * If type 6 is selected then values (1,2) (2,1) (1,1) (2,2) + * Are ignored in the array and filled automatically, watch the passed gradient type + * (Numbering from zero) * - * Наверное напишу адаптор который переводит порядок точек из 6 типа в общий. + * I'll probably write an adapter that converts point order from type 6 to general. */ agg::rgba8 fill_color; std::vector<std::vector<Point>> patch; - std::vector<std::vector<agg::rgba8>> patch_colors; // 2 на 2 цвета по углам - std::vector<std::vector<float>> patch_parameters; // 2 на 2 параметра + std::vector<std::vector<agg::rgba8>> patch_colors; // 2x2 colors at corners + std::vector<std::vector<float>> patch_parameters; // 2x2 parameters }; // Containing additional info about gradient @@ -560,9 +560,9 @@ namespace NSStructures /** - * Создает объект класса GradientInfo по заданным параметрам. + * Creates a GradientInfo class object with specified parameters. * - * Цветовую функцию надо заполнять вручную + * Color function needs to be filled manually */ class GInfoConstructor { public: @@ -640,8 +640,8 @@ namespace NSStructures } /** - * Набор из 12 точек для построения границ в порядке указанном в стандарте, - * Порядок цветов или параметров как в стандарте. + * Set of 12 points for building boundaries in the order specified in the standard, + * Color or parameter order as in the standard. */ static GradientInfo get_curve(const std::vector<Point> &curve_points, const std::vector<float> &curve_parametrs, diff --git a/DesktopEditor/graphics/tests/alphaMask/main.cpp b/DesktopEditor/graphics/tests/alphaMask/main.cpp index fc3d30abb3..954325e0ad 100644 --- a/DesktopEditor/graphics/tests/alphaMask/main.cpp +++ b/DesktopEditor/graphics/tests/alphaMask/main.cpp @@ -10,7 +10,7 @@ int main(int argc, char *argv[]) unsigned int unWidth = 1000; unsigned int unHeight = 1000; - // Создание основной картинки + // Create main image BYTE* pData = new BYTE[4 * unWidth * unHeight]; for (unsigned long unIndex = 0; unIndex < unWidth * unHeight; ++unIndex) @@ -42,7 +42,7 @@ int main(int argc, char *argv[]) { case GenerationMask: { - // Генерируем маску + // Generate mask pRasterRenderer->BeginCommand(c_nMaskType); pRasterRenderer->PathCommandStart(); @@ -52,12 +52,12 @@ int main(int argc, char *argv[]) pRasterRenderer->PathCommandLineTo(0, 700); pRasterRenderer->PathCommandClose(); - // Задаем значения для пера и кисти маски + // Set values for mask pen and brush pRasterRenderer->put_PenSize(100); - pRasterRenderer->put_PenColor(16777215); // белый 16777215 + pRasterRenderer->put_PenColor(16777215); // white 16777215 pRasterRenderer->put_BrushAlpha1(255); - pRasterRenderer->put_BrushColor1(8355711); // серый + pRasterRenderer->put_BrushColor1(8355711); // gray pRasterRenderer->Stroke(); pRasterRenderer->Fill(); @@ -97,7 +97,7 @@ int main(int argc, char *argv[]) } } - // Отрисовываем тестовый объект + // Draw test object pRasterRenderer->BeginCommand(c_nPathType); pRasterRenderer->PathCommandStart(); @@ -117,17 +117,17 @@ int main(int argc, char *argv[]) pRasterRenderer->PathCommandLineTo(100, 300); pRasterRenderer->PathCommandClose(); - // Задаем значения для пера и кисти + // Set values for pen and brush pRasterRenderer->put_PenSize(100); - pRasterRenderer->put_PenColor(255); // красный + pRasterRenderer->put_PenColor(255); // red pRasterRenderer->put_BrushAlpha1(255); - pRasterRenderer->put_BrushColor1(65280); // зеленый + pRasterRenderer->put_BrushColor1(65280); // green pRasterRenderer->Stroke(); pRasterRenderer->Fill(); - //Сбрасываем маску + // Reset mask pRasterRenderer->BeginCommand(c_nResetMaskType); pRasterRenderer->EndCommand(c_nResetMaskType); diff --git a/DesktopEditor/graphics/tests/graphicsLayers/main.cpp b/DesktopEditor/graphics/tests/graphicsLayers/main.cpp index 34d875eae6..f94fda76f1 100644 --- a/DesktopEditor/graphics/tests/graphicsLayers/main.cpp +++ b/DesktopEditor/graphics/tests/graphicsLayers/main.cpp @@ -11,7 +11,7 @@ int main(int argc, char *argv[]) const unsigned int unWidth = 1000; const unsigned int unHeight = 1000; - // Создание основной картинки + // Create main image BYTE* pData = new BYTE[4 * unWidth * unHeight]; for (unsigned long unIndex = 0; unIndex < unWidth * unHeight; ++unIndex) @@ -35,11 +35,11 @@ int main(int argc, char *argv[]) pRasterRenderer->BeginCommand(c_nPathType); pRasterRenderer->PathCommandStart(); - // Отрисовываем основной слой + // Draw main layer pRasterRenderer->PathCommandRect(50, 200, 600, 300); pRasterRenderer->put_BrushAlpha1(255); - pRasterRenderer->put_BrushColor1(RGB_TO_INT(255, 0, 0)); // красный + pRasterRenderer->put_BrushColor1(RGB_TO_INT(255, 0, 0)); // red pRasterRenderer->put_PenAlpha(255); pRasterRenderer->put_PenColor(RGB_TO_INT(255, 0, 255)); @@ -50,7 +50,7 @@ int main(int argc, char *argv[]) pRasterRenderer->PathCommandEnd(); pRasterRenderer->EndCommand(c_nPathType); - // Отрисовываем второй слой + // Draw second layer pRasterRenderer->BeginCommand(c_nLayerType); pRasterRenderer->BeginCommand(c_nPathType); @@ -59,7 +59,7 @@ int main(int argc, char *argv[]) pRasterRenderer->PathCommandRect(300, 300, 300, 300); pRasterRenderer->put_BrushAlpha1(255); - pRasterRenderer->put_BrushColor1(RGB_TO_INT(0, 255, 0)); // зеленый + pRasterRenderer->put_BrushColor1(RGB_TO_INT(0, 255, 0)); // green pRasterRenderer->put_PenAlpha(150); pRasterRenderer->put_PenColor(RGB_TO_INT(0, 0, 255)); @@ -72,7 +72,7 @@ int main(int argc, char *argv[]) pRasterRenderer->PathCommandEnd(); pRasterRenderer->EndCommand(c_nPathType); - //Отрисовываем третий слой + // Draw third layer pRasterRenderer->BeginCommand(c_nLayerType); pRasterRenderer->BeginCommand(c_nPathType); @@ -81,7 +81,7 @@ int main(int argc, char *argv[]) pRasterRenderer->PathCommandRect(500, 400, 300, 300); pRasterRenderer->put_BrushAlpha1(150); - pRasterRenderer->put_BrushColor1(RGB_TO_INT(0, 0, 255)); // синий + pRasterRenderer->put_BrushColor1(RGB_TO_INT(0, 0, 255)); // blue pRasterRenderer->put_PenAlpha(255); pRasterRenderer->put_PenColor(RGB_TO_INT(255, 0, 0)); @@ -94,10 +94,10 @@ int main(int argc, char *argv[]) pRasterRenderer->PathCommandEnd(); pRasterRenderer->EndCommand(c_nPathType); - // блитируем трутий слой на второй + // blit third layer onto second pRasterRenderer->EndCommand(c_nLayerType); - // блитируем второй слой на основной + // blit second layer onto main pRasterRenderer->EndCommand(c_nLayerType); oFrame.SaveFile(L"testGraphicsLayers.png", 4); diff --git a/DesktopEditor/raster/ImageFileFormatChecker.cpp b/DesktopEditor/raster/ImageFileFormatChecker.cpp index 9972e2376e..83d28c7eea 100644 --- a/DesktopEditor/raster/ImageFileFormatChecker.cpp +++ b/DesktopEditor/raster/ImageFileFormatChecker.cpp @@ -254,7 +254,7 @@ bool CImageFileFormatChecker::isIcoFile(BYTE* pBuffer,DWORD dwBytes) image_header = (___BITMAPINFOHEADER *)(pBuffer + offset_image); if (width == image_header->biWidth - /*height == image_header->biHeight*/) // в хеадере может быть черестрочная высота + /*height == image_header->biHeight*/) // header may contain interlaced height return true; } } diff --git a/DesktopEditor/raster/JBig2/source/JBig2File.cpp b/DesktopEditor/raster/JBig2/source/JBig2File.cpp index 789c116271..401b277bc3 100644 --- a/DesktopEditor/raster/JBig2/source/JBig2File.cpp +++ b/DesktopEditor/raster/JBig2/source/JBig2File.cpp @@ -43,7 +43,7 @@ bool CJBig2File::MemoryToJBig2(unsigned char* pBufferBGRA ,int BufferSize, int n unsigned char ShiftB = isBGRA ? 0 : 2; for ( int nY = 0; nY < nHeight; nY++ ) { - for ( int nX = 0; nX < nWidth; nX++, pSourceBuffer += 3 )//todooo сделать 3 ? 4 + for ( int nX = 0; nX < nWidth; nX++, pSourceBuffer += 3 )//todooo make 3 ? 4 { pixSetRGBPixel( pSource, nX, nY, pSourceBuffer[ ShiftR ], pSourceBuffer[ ShiftG ], pSourceBuffer[ ShiftB ] ); } @@ -52,10 +52,10 @@ bool CJBig2File::MemoryToJBig2(unsigned char* pBufferBGRA ,int BufferSize, int n jbig2ctx *pContext = jbig2_init( m_dTreshold, 0.5, 0, 0, ! m_bPDFMode, m_bRefine ? 10 : -1 ); - // Пока сделаем запись одной картинки в JBig2 - // TO DO: надо будет сделать запись нескольких картинок в 1 JBig2 файл + // For now write single image to JBig2 + // TODO: need to implement writing multiple images to 1 JBig2 file - // Убираем ColorMap + // Remove ColorMap PIX *pPixL = NULL; if ( NULL == ( pPixL = pixRemoveColormap( pSource, REMOVE_CMAP_BASED_ON_SRC ) ) ) { @@ -122,7 +122,7 @@ bool CJBig2File::MemoryToJBig2(unsigned char* pBufferBGRA ,int BufferSize, int n } if ( !pPixT ) { - // Ничего не делаем + // Do nothing return true; } } diff --git a/DesktopEditor/raster/Jp2/ArithmeticCoder.h b/DesktopEditor/raster/Jp2/ArithmeticCoder.h index 380f287c18..2d3f0c5c92 100644 --- a/DesktopEditor/raster/Jp2/ArithmeticCoder.h +++ b/DesktopEditor/raster/Jp2/ArithmeticCoder.h @@ -7,7 +7,7 @@ namespace Jpeg2000 { //------------------------------------------------------------------------------------------------------------------------------- - // Данный массив содержит все возможные состояния (см. Annex C Table C-2) + // This array contains all possible states (see Annex C Table C-2) static MQCoderState aoMQCoderStates[47 * 2] = { { 0x5601, 0, &aoMQCoderStates[2], &aoMQCoderStates[3] }, @@ -107,7 +107,7 @@ namespace Jpeg2000 }; //------------------------------------------------------------------------------------------------------------------------------- - // Вспомогательные функции + // Helper functions //------------------------------------------------------------------------------------------------------------------------------- static void MQC_ByteOut(MQCoder *pMQCoder) { @@ -305,7 +305,7 @@ namespace Jpeg2000 //------------------------------------------------------------------------------------------------------------------------------- - // Основные функции + // Main functions //------------------------------------------------------------------------------------------------------------------------------- MQCoder* MQC_Create() { @@ -383,7 +383,7 @@ namespace Jpeg2000 } void MQC_BypassInitEncoder(MQCoder *pMQCoder) { - // TO DO: Данная функция не польностью протестирована + // TO DO: This function is not fully tested pMQCoder->nCregister = 0; pMQCoder->nCt = 8; @@ -394,7 +394,7 @@ namespace Jpeg2000 } void MQC_BypassEncoder(MQCoder *pMQCoder, int nValue) { - // TO DO: Данная функция не польностью протестирована + // TO DO: This function is not fully tested pMQCoder->nCt--; pMQCoder->nCregister = pMQCoder->nCregister + (nValue << pMQCoder->nCt); @@ -414,7 +414,7 @@ namespace Jpeg2000 int MQC_BypassFlushEncoder(MQCoder *pMQCoder) { - // TO DO: Данная функция не польностью протестирована + // TO DO: This function is not fully tested unsigned char nBitPadding = 0; if (pMQCoder->nCt != 0) diff --git a/DesktopEditor/raster/Jp2/DWT.h b/DesktopEditor/raster/Jp2/DWT.h index 09396faeb2..dd0584b336 100644 --- a/DesktopEditor/raster/Jp2/DWT.h +++ b/DesktopEditor/raster/Jp2/DWT.h @@ -17,7 +17,7 @@ namespace Jpeg2000 //------------------------------------------------------------------------------------------------------------------------------- - // Таблицы норм для обратимого 5-3 веэвлет-преобразования + // Norm tables for reversible 5-3 wavelet transform static const double c_aDWT_NormsRev[4][10] = { { 1.000, 1.500, 2.750, 5.375, 10.68, 21.34, 42.67, 85.33, 170.7, 341.3 }, @@ -26,7 +26,7 @@ namespace Jpeg2000 { .7186, .9218, 1.586, 3.043, 6.019, 12.01, 24.00, 47.97, 95.93 } }; - // Таблицы норм для необратимого 9-7 веэвлет-преобразования + // Norm tables for irreversible 9-7 wavelet transform static const double c_aDWT_NormsIrr[4][10] = { { 1.000, 1.965, 4.177, 8.403, 16.90, 33.84, 67.69, 135.3, 270.6, 540.9 }, @@ -36,7 +36,7 @@ namespace Jpeg2000 }; //------------------------------------------------------------------------------------------------------------------------------- - // Вспомогательные функции + // Helper functions //------------------------------------------------------------------------------------------------------------------------------- static void DWT_DeinterleaveHor(int *pA, int *pB, int nDn, int nSn, int nCase) @@ -236,7 +236,7 @@ namespace Jpeg2000 } //------------------------------------------------------------------------------------------------------------------------------- - // Основные функции + // Main functions //------------------------------------------------------------------------------------------------------------------------------- void DWT_EncodeRev(TileComp *pTileComponent) { @@ -249,10 +249,10 @@ namespace Jpeg2000 for (int nIndex = 0; nIndex < nLevel; nIndex++) { - int nResW; // Ширина для данного уровня разрешения - int nResH; // Высота для данного уровня разрешения - int nResW1; // Ширина для уровня разрешения на 1 меньше, чем данный - int nResH1; // Высота для уровня разрешения на 1 меньше, чем данный + int nResW; // Width for this resolution level + int nResH; // Height for this resolution level + int nResW1; // Width for resolution level 1 less than this + int nResH1; // Height for resolution level 1 less than this int nCaseCol; // 0 = non inversion on horizontal filtering, 1 = inversion between low-pass and high-pass filtering int nCaseRow; // 0 = non inversion on vertical filtering, 1 = inversion between low-pass and high-pass filtering @@ -315,10 +315,10 @@ namespace Jpeg2000 for (int nIndex = nLevel - 1; nIndex >= nStop; nIndex--) { - int nResW; // Ширина для данного уровня разрешения - int nResH; // Высота для данного уровня разрешения - int nResW1; // Ширина для уровня разрешения на 1 меньше, чем данный - int nResH1; // Высота для уровня разрешения на 1 меньше, чем данный + int nResW; // Width for this resolution level + int nResH; // Height for this resolution level + int nResW1; // Width for resolution level 1 less than this + int nResH1; // Height for resolution level 1 less than this int nCaseCol; // 0 = non inversion on horizontal filtering, 1 = inversion between low-pass and high-pass filtering int nCaseRow; // 0 = non inversion on vertical filtering, 1 = inversion between low-pass and high-pass filtering @@ -395,10 +395,10 @@ namespace Jpeg2000 for (int nIndex = 0; nIndex < nLevel; nIndex++) { - int nResW; // Ширина для данного уровня разрешения - int nResH; // Высота для данного уровня разрешения - int nResW1; // Ширина для уровня разрешения на 1 меньше, чем данный - int nResH1; // Высота для уровня разрешения на 1 меньше, чем данный + int nResW; // Width for this resolution level + int nResH; // Height for this resolution level + int nResW1; // Width for resolution level 1 less than this + int nResH1; // Height for resolution level 1 less than this int nCaseCol; // 0 = non inversion on horizontal filtering, 1 = inversion between low-pass and high-pass filtering int nCaseRow; // 0 = non inversion on vertical filtering, 1 = inversion between low-pass and high-pass filtering @@ -461,10 +461,10 @@ namespace Jpeg2000 for (int nIndex = nLevel - 1; nIndex >= nStop; nIndex--) { - int nResW; // Ширина для данного уровня разрешения - int nResH; // Высота для данного уровня разрешения - int nResW1; // Ширина для уровня разрешения на 1 меньше, чем данный - int nResH1; // Высота для уровня разрешения на 1 меньше, чем данный + int nResW; // Width for this resolution level + int nResH; // Height for this resolution level + int nResW1; // Width for resolution level 1 less than this + int nResH1; // Height for resolution level 1 less than this int nCaseCol; // 0 = non inversion on horizontal filtering, 1 = inversion between low-pass and high-pass filtering int nCaseRow; // 0 = non inversion on vertical filtering, 1 = inversion between low-pass and high-pass filtering diff --git a/DesktopEditor/raster/Jp2/Image.h b/DesktopEditor/raster/Jp2/Image.h index 8747099853..5c627e5255 100644 --- a/DesktopEditor/raster/Jp2/Image.h +++ b/DesktopEditor/raster/Jp2/Image.h @@ -42,7 +42,7 @@ namespace Jpeg2000 pImage->eColorSpace = eColorSpace; pImage->nCsiz = nComponentsCount; - // Выделяем память под компоненты + // Allocate memory for components pImage->pComponents = (ImageComponent*)Malloc(pImage->nCsiz * sizeof(ImageComponent)); if (!pImage->pComponents) @@ -75,7 +75,7 @@ namespace Jpeg2000 } else { - // TO DO: Выдать сообщение об ошибке + // TO DO: Display error message } return pImage; diff --git a/DesktopEditor/raster/Jp2/J2k.h b/DesktopEditor/raster/Jp2/J2k.h index 0b499f5b49..70a54bb7e8 100644 --- a/DesktopEditor/raster/Jp2/J2k.h +++ b/DesktopEditor/raster/Jp2/J2k.h @@ -1,5 +1,5 @@ #pragma once -// Функции в данном файле предназначены для чтения/записи различных частей JPEG2000-codestream: маркеры и данные +// Functions in this file are designed for reading/writing various parts of JPEG2000-codestream: markers and data //------------------------------------------------------------------------------------------------------------------------------- #include "math.h" @@ -98,7 +98,7 @@ namespace Jpeg2000 } //------------------------------------------------------------------------------------------------------------------------------- - // Вспомогательные функции + // Helper functions //------------------------------------------------------------------------------------------------------------------------------- static void J2k_WriteSOC(J2kCodestream *pJ2k) { @@ -188,7 +188,7 @@ namespace Jpeg2000 pImage->pComponents[nIndex].nFactorDiv2 = 0; } - // Считаем количество тайлов по Х и Y + // Calculate number of tiles by X and Y pCodingParams->nXTilesCount = CeilDiv(pImage->nXsiz - pCodingParams->nXTOsiz, pCodingParams->nXTsiz); pCodingParams->nYTilesCount = CeilDiv(pImage->nYsiz - pCodingParams->nYTOsiz, pCodingParams->nYTsiz); @@ -218,7 +218,7 @@ namespace Jpeg2000 pCodingParams->pTCP[nIndex].nFirst = 1; } - // Обнуляем данные для PPM маркера + // Reset data for PPM marker pCodingParams->nPPM = 0; pCodingParams->pPPMData = NULL; pCodingParams->pPPMDataFirst = NULL; @@ -315,7 +315,7 @@ namespace Jpeg2000 int nLen = pStream->Read(2); - // TO DO: Сделать нормальное чтение + // TO DO: Implement proper reading pStream->Skip(nLen - 2); } @@ -665,7 +665,7 @@ namespace Jpeg2000 pTCCP->aoStepSizes[nCurBand].nMantissa = nMantissa; } - // Add : Если тип квантования ScalarImplicit, тогда вычислим коэффициенты квантования для остальных Subbands + // Add : If quantization type is ScalarImplicit, calculate quantization coefficients for remaining Subbands if (pTCCP->nQuantStyle == J2K_CCP_QNTSTY_SIQNT) { for (int nCurBand = 1; nCurBand < J2K_MAXBANDS; nCurBand++) @@ -853,7 +853,7 @@ namespace Jpeg2000 nPacketLen = (nPacketLen << 7) + nAdd; // Iplm_ij if ((nAdd & 0x80) == 0) { - // новый packet + // new packet nPacketLen = 0; } if (nLen <= 0) @@ -877,7 +877,7 @@ namespace Jpeg2000 nPacketLen = (nPacketLen << 7) + nAdd; // Iplt_i if ((nAdd & 0x80) == 0) { - // новый packet + // new packet nPacketLen = 0; } } @@ -909,7 +909,7 @@ namespace Jpeg2000 } int nStore = pCodingParams->nPPMStore; - if (nZppm == 0) // Первый PPM маркер + if (nZppm == 0) // First PPM marker { pCodingParams->pPPMData = (unsigned char *)Malloc(nNppm * sizeof(unsigned char)); if (!pCodingParams->pPPMData) @@ -920,7 +920,7 @@ namespace Jpeg2000 pCodingParams->pPPMDataFirst = pCodingParams->pPPMData; pCodingParams->nPPMLength = nNppm; } - else // Не первый PPM маркер + else // Not first PPM marker { BYTE *pPPMData_new = (BYTE *)Malloc((nNppm + pCodingParams->nPPMStore) * sizeof(unsigned char)); if (!pPPMData_new) @@ -936,14 +936,14 @@ namespace Jpeg2000 pCodingParams->nPPMLength = nNppm + pCodingParams->nPPMStore; } - // Считываем остальные данные + // Read remaining data int nIndex; for (nIndex = nNppm; nIndex > 0; nIndex--) { pCodingParams->pPPMData[nStore] = pStream->Read(1); nStore++; nLen--; - if (nLen == 0) // Случай, когда packet header не закончился в текущем маркере, но закончится в следующем + if (nLen == 0) // Case when packet header didn't end in current marker, but will end in the next one break; } pCodingParams->nPPMPrevious = nIndex - 1; @@ -961,7 +961,7 @@ namespace Jpeg2000 int nZppt = pStream->Read(1); // Zppt pTCP->nPPT = 1; - if (nZppt == 0) // Первый PPT маркер + if (nZppt == 0) // First PPT marker { pTCP->pPPTData = (unsigned char *)Malloc((nLen - 3) * sizeof(unsigned char)); if (!pTCP->pPPTData) @@ -973,7 +973,7 @@ namespace Jpeg2000 pTCP->nPPTStore = 0; pTCP->nPPTLength = nLen - 3; } - else // Не первый PPT маркер + else // Not first PPT marker { BYTE *pPPTData_new = (unsigned char *)Malloc((nLen - 3 + pTCP->nPPTStore) * sizeof(unsigned char)); if (!pPPTData_new) @@ -1010,7 +1010,7 @@ namespace Jpeg2000 pStream->Skip(2); pStream->Write(pJ2k->nCurTileIndex, 2); // Isot - pStream->Skip(4); // Psot (пока оставляем место, сюда пишем в функции J2k_WriteSOD) + pStream->Skip(4); // Psot (leaving space for now, write here in J2k_WriteSOD function) pStream->Write(0, 1); // TPsot pStream->Write(1, 1); // TNsot @@ -1066,7 +1066,7 @@ namespace Jpeg2000 TileCodingParams *pTCP = &pCodingParams->pTCP[pJ2k->nCurTileIndex]; - if (pTCP->nFirst == 1) // Инициализируем PPT + if (pTCP->nFirst == 1) // Initialize PPT { TileCompCodingParams *pTemp = pTCP->pTCCP; memcpy(pTCP, pJ2k->pDefaultTCP, sizeof(TileCodingParams)); @@ -1116,7 +1116,7 @@ namespace Jpeg2000 int nTileDataLen = TCD_EncodeTile(pTCD, pJ2k->nCurTileIndex, (BYTE*)pStream->GetOwner() + pStream->Tell(), pStream->GetLeftSize() - 2, pImageInfo); - // Записываем поле Psot в маркере SOT + // Write Psot field in SOT marker int nTotalLen = pStream->Tell() + nTileDataLen - pJ2k->nSOTStartPos; pStream->Seek(pJ2k->nSOTStartPos + 6); pStream->Write(nTotalLen, 4); // Psot @@ -1134,7 +1134,7 @@ namespace Jpeg2000 if (nLen == pStream->GetLeftSize() + 1) { - nTruncate = 1; // Обрезанный codestream + nTruncate = 1; // Truncated codestream } unsigned char *pData = (unsigned char *)Malloc((pJ2k->pTileLen[nCurTileIndex] + nLen) * sizeof(unsigned char)); @@ -1152,7 +1152,7 @@ namespace Jpeg2000 unsigned char *pDataPointer = pData + pJ2k->pTileLen[nCurTileIndex]; //for ( int nIndex = 0; nIndex < nLen; nIndex++ ) //{ - // pDataPointer[nIndex] = pStream->Read( 1 ); // Считываем закодированные данные текущего тайла + // pDataPointer[nIndex] = pStream->Read( 1 ); // Read encoded data of the current tile //} pStream->Read(pDataPointer, nLen); @@ -1197,7 +1197,7 @@ namespace Jpeg2000 int nLen = pStream->Read(2); // Lrgn int nCurComponent = pStream->Read(nComponentsCount <= 256 ? 1 : 2); // Crgn int nROIStyle = pStream->Read(1); // Srgn - // TO DO: Вставить проверку nROIStyle == 0 + // TO DO: Add check for nROIStyle == 0 pTCP->pTCCP[nCurComponent].nROIShift = pStream->Read(1); // SPrgn } @@ -1247,8 +1247,8 @@ namespace Jpeg2000 } static void J2k_ReadUNK(J2kCodestream *pJ2k) { - // Предполагаем, что неизвестный маркер не пустой, а, значит, - // у него следующие два байта - длина маркера. + // Assume that the unknown marker is not empty, which means + // its next two bytes represent the marker length. CReader *pStream = pJ2k->pStreamIO; int nLen = pStream->Read(2); @@ -1262,12 +1262,12 @@ namespace Jpeg2000 //------------------------------------------------------------------------------------------------------------------------------- - // Таблица связывающая прочтенный маркер - состояние декодера - действие(функция) декодера при прочтении данного маркера + // Table linking marker read - decoder state - decoder action (function) when reading this marker typedef struct TDecoderMSTableEntry { - int nID; // Значение маркера - int nStates; // Состояние декодера, когда появляется данный маркер - void(*pHandler) (J2kCodestream *pJ2k); // Действие связанное с данным маркером + int nID; // Marker value + int nStates; // Decoder state when this marker appears + void(*pHandler) (J2kCodestream *pJ2k); // Action associated with this marker } DecoderMSTableEntry; DecoderMSTableEntry c_aoJ2k_DecoderMSTable[] = @@ -1317,7 +1317,7 @@ namespace Jpeg2000 } //------------------------------------------------------------------------------------------------------------------------------- - // Декодирование потоков J2K / JPT + // Decoding J2K / JPT streams //------------------------------------------------------------------------------------------------------------------------------- J2kCodestream* J2k_CreateDecompress(PCommon pCodecInfo) @@ -1381,7 +1381,7 @@ namespace Jpeg2000 { if (pJ2k && pParameters) { - // Создаем и инициализируем структуру CodingParams + // Create and initialize CodingParams structure CodingParams *pCodingParams = (CodingParams*)Malloc(sizeof(CodingParams)); if (!pCodingParams) { @@ -1401,7 +1401,7 @@ namespace Jpeg2000 pJ2k->pStreamIO = pStream; - // Создаем пустую картинку + // Create an empty image Image *pImage = Image_CreateEmpty(); if (!pImage) { @@ -1433,7 +1433,7 @@ namespace Jpeg2000 return 0; } - // Проверяем ограничение на декодирование + // Check decoding limitation if (pEntry->nID == J2K_MS_SOT && pJ2k->pCodingParams->eLimitDecoding == declimLimitToMainHeader) { Event_Message(EVT_INFO, "Main Header decoded.\n"); @@ -1461,7 +1461,7 @@ namespace Jpeg2000 pCodecInfo->nErrorCode = JP2_ERROR_NO_ERROR; break; } - // Проверяем не появилась ли ошибка + // Check if an error occurred if (JP2_ERROR_NO_ERROR != pCodecInfo->nErrorCode) { Image_Destroy(pImage); @@ -1489,7 +1489,7 @@ namespace Jpeg2000 pJ2k->pStreamIO = pStream; - // Создем пустую картинку + // Create an empty image Image *pImage = Image_CreateEmpty(); if (!pImage) { @@ -1499,10 +1499,10 @@ namespace Jpeg2000 pJ2k->nState = j2kstateMHSOC; - // Инициализируем заголовок + // Initialize the header JPTMessageHeader oHeader; JPT_InitMessageHeader(&oHeader); - // Читаем первый заголовок сообщения + // Read the first message header JPT_ReadMessageHeader(pCodecInfo, pStream, &oHeader); int nPosition = pStream->Tell(); @@ -1574,7 +1574,7 @@ namespace Jpeg2000 } //------------------------------------------------------------------------------------------------------------------------------- - // Кодирование в поток J2K + // Encoding to J2K stream //------------------------------------------------------------------------------------------------------------------------------- J2kCodestream* J2k_CreateCompress(PCommon pCodecInfo) @@ -1637,7 +1637,7 @@ namespace Jpeg2000 return; } - // Создаем и инициализируем структуру Coding parameters + // Create and initialize Coding parameters structure CodingParams *pCodingParams = (CodingParams*)Malloc(sizeof(CodingParams)); if (!pCodingParams) { @@ -1649,7 +1649,7 @@ namespace Jpeg2000 pCodingParams->nXTilesCount = 1; pCodingParams->nYTilesCount = 1; - // Копируем заданные параметры + // Copy the specified parameters pCodingParams->nDistoAlloc = pParameters->nDistoAlloc; pCodingParams->nFixedAlloc = pParameters->nFixedAlloc; @@ -1669,7 +1669,7 @@ namespace Jpeg2000 memcpy(pCodingParams->pMatrix, pParameters->pMatrix, array_size); } - // Создаем ли файл индексации? + // Create index file? pCodingParams->nIndexOn = pParameters->nIndexOn; if (pCodingParams->nIndexOn) { @@ -1702,7 +1702,7 @@ namespace Jpeg2000 } } - // Вычисляем другие параметры кодирования + // Calculate other encoding parameters if (pParameters->bTileSizeOn) { @@ -1790,7 +1790,7 @@ namespace Jpeg2000 for (int nComponentIndex = 0; nComponentIndex < pImage->nCsiz; nComponentIndex++) { TileCompCodingParams *pTCCP = &pTCP->pTCCP[nComponentIndex]; - pTCCP->nCodingStyle = pParameters->nCodingStyle & 0x01; // 0 => одна область || 1 => призвольное количество областей + pTCCP->nCodingStyle = pParameters->nCodingStyle & 0x01; // 0 => one precinct || 1 => arbitrary number of precincts pTCCP->nResolutionsCount = pParameters->nResolutionsCount; pTCCP->nCodeBlockWidth = FloorLog2(pParameters->nCodeBlockWidthInit); pTCCP->nCodeBlockHeight = FloorLog2(pParameters->nCodeBlockHeightInit); @@ -1959,7 +1959,7 @@ namespace Jpeg2000 { for (int nResolutionIndex = 0; nResolutionIndex < pImageInfo->nDecompCount + 1; nResolutionIndex++) { - // Предполагаем, что значения XRsiz, YRsiz одинаковые для всех компонент + // Assuming XRsiz, YRsiz values are the same for all components int nX0 = pImageInfo->nXTOsiz + nTileIndex - (int)floor((float)nTileIndex / (float)pImageInfo->nXTilesCount) * pImageInfo->nXTilesCount * pImageInfo->nXTsiz; int nY0 = pImageInfo->nXTOsiz + (int)floor((float)nTileIndex / (float)pImageInfo->nXTilesCount) * pImageInfo->nYTsiz; int nX1 = nX0 + pImageInfo->nXTsiz; @@ -2001,7 +2001,7 @@ namespace Jpeg2000 } else if (pImageInfo->eProgOrder == poPCRL) { - // Предполагаем, что значения XRsiz, YRsiz одинаковые для всех компонент + // Assuming XRsiz, YRsiz values are the same for all components int nX0 = pImageInfo->nXTOsiz + nTileIndex - (int)floor((float)nTileIndex / (float)pImageInfo->nXTilesCount) * pImageInfo->nXTilesCount * pImageInfo->nXTsiz; int nY0 = pImageInfo->nXTOsiz + (int)floor((float)nTileIndex / (float)pImageInfo->nXTilesCount) * pImageInfo->nYTsiz; int nX1 = nX0 + pImageInfo->nXTsiz; @@ -2047,7 +2047,7 @@ namespace Jpeg2000 { for (int nComponentIndex = 0; nComponentIndex < pImageInfo->nCompCount; nComponentIndex++) { - // Предполагаем, что значения XRsiz, YRsiz одинаковые для всех компонент + // Assuming XRsiz, YRsiz values are the same for all components int nX0 = pImageInfo->nXTOsiz + nTileIndex - (int)floor((float)nTileIndex / (float)pImageInfo->nXTilesCount) * pImageInfo->nXTilesCount * pImageInfo->nXTsiz; int nY0 = pImageInfo->nXTOsiz + (int)floor((float)nTileIndex / (float)pImageInfo->nXTilesCount) * pImageInfo->nYTsiz; int nX1 = nX0 + pImageInfo->nXTsiz; @@ -2113,7 +2113,7 @@ namespace Jpeg2000 } #endif - // Индексация + // Indexing ImageInfo *pImageInfo = pJ2k->pImageInfo; if (pImageInfo && pCodingParams->nIndexOn) { @@ -2151,24 +2151,24 @@ namespace Jpeg2000 J2k_WriteCOM(pJ2k); } - // Индексация + // Indexing if (pImageInfo && pImageInfo->nIndexOn) { pImageInfo->nMainHeadEnd = pStream->Tell() - 1; } //------------- - // Создаем струкртуру для кодирования тайлов + // Create structure for encoding tiles TCD *pTCD = TCD_Create(pJ2k->pCodecInfo); - // Кодируем каждый тайл + // Encode each tile for (int nTileIndex = 0; nTileIndex < pCodingParams->nXTilesCount * pCodingParams->nYTilesCount; nTileIndex++) { Event_Message(EVT_INFO, "tile number %d / %d\n", nTileIndex + 1, pCodingParams->nXTilesCount * pCodingParams->nYTilesCount); pJ2k->nCurTileIndex = nTileIndex; - // Инициализируем перед кодированием + // Initialize before encoding if (0 == nTileIndex) { TCD_MallocEncode(pTCD, pImage, pCodingParams, pJ2k->nCurTileIndex); @@ -2177,14 +2177,14 @@ namespace Jpeg2000 { TCD_InitEncode(pTCD, pImage, pCodingParams, pJ2k->nCurTileIndex); } - // Проверяем ошибку + // Check for errors if (JP2_ERROR_NO_ERROR != pTCD->pCodecInfo->nErrorCode) { TCD_Destroy(pTCD); return false; } - // Индексация + // Indexing if (pImageInfo && pImageInfo->nIndexOn) { pImageInfo->pTile[pJ2k->nCurTileIndex].nTileCount = pJ2k->nCurTileIndex; @@ -2206,7 +2206,7 @@ namespace Jpeg2000 J2k_WriteSOD(pJ2k, pTCD); - // Индексация + // Indexing if (pImageInfo && pImageInfo->nIndexOn) { pImageInfo->pTile[pJ2k->nCurTileIndex].nEndPos = pStream->Tell() + pJ2k->nPosCorrection - 1; @@ -2215,13 +2215,13 @@ namespace Jpeg2000 } - // Удаляем структуру кодирующую тайлы + // Delete the tile encoding structure TCD_FreeEncode(pTCD); TCD_Destroy(pTCD); J2k_WriteEOC(pJ2k); - // Создаем файл с индексацией + // Create index file if (pImageInfo && pImageInfo->nIndexOn) { if (!J2k_CreateIndex(pJ2k, pStream, pImageInfo, sIndex)) diff --git a/DesktopEditor/raster/Jp2/J2kFile.cpp b/DesktopEditor/raster/Jp2/J2kFile.cpp index 6ed96b8aa1..fd1bd5f9a3 100644 --- a/DesktopEditor/raster/Jp2/J2kFile.cpp +++ b/DesktopEditor/raster/Jp2/J2kFile.cpp @@ -101,7 +101,7 @@ namespace Jpeg2000 unsigned char indB = isBGRA ? 0 : 2; Jpeg2000::ImageComponent* pComponents = pImage->pComponents; - // Пишем данные в pBufferPtr + // Write data to pBufferPtr if (pImage->nCsiz == 3 && pImage->pComponents[0].nXRsiz == pImage->pComponents[1].nXRsiz && pImage->pComponents[1].nXRsiz == pImage->pComponents[2].nXRsiz && pImage->pComponents[0].nYRsiz == pImage->pComponents[1].nYRsiz && pImage->pComponents[1].nYRsiz == pImage->pComponents[2].nYRsiz && pImage->pComponents[0].nPrecision == pImage->pComponents[1].nPrecision && pImage->pComponents[1].nPrecision == pImage->pComponents[2].nPrecision) @@ -173,7 +173,7 @@ namespace Jpeg2000 DecoderParams oParameters; - // Установим стандартные значения параметров + // Set default parameter values ApplyDecoderOptions(&oParameters, wsXmlOptions); /////////////////////////////////////////////////////////////////////////////////// @@ -215,7 +215,7 @@ namespace Jpeg2000 DecoderParams oParameters; - // Установим стандартные значения параметров + // Set default parameter values ApplyDecoderOptions(&oParameters, wsXmlOptions); /////////////////////////////////////////////////////////////////////////////////// @@ -252,7 +252,7 @@ namespace Jpeg2000 DecoderParams oParameters; - // Установим стандартные значения параметров + // Set default parameter values ApplyDecoderOptions(&oParameters, wsXmlOptions); /////////////////////////////////////////////////////////////////////////////////// @@ -307,7 +307,7 @@ namespace Jpeg2000 nComponentsCount = pImage->nCsiz; - // Пишем данные в pBufferPtr + // Write data to pBufferPtr for (int nComponent = 1; nComponent < nComponentsCount; nComponent++) { if (pImage->pComponents[0].nXRsiz != pImage->pComponents[nComponent].nXRsiz @@ -338,7 +338,7 @@ namespace Jpeg2000 } bool CJ2kFile::Save(CBgraFrame* pFrame, const std::wstring& wsDstPath, const std::wstring& wsXmlOptions) { - // TODO: Запись не реализована, надо доделать. + // TODO: Writing is not implemented, needs to be completed. return false; if (!pFrame) @@ -349,12 +349,12 @@ namespace Jpeg2000 BYTE* pSourceBuffer = pFrame->get_Data(); LONG lBufferSize = 4 * lWidth * lHeight; - // Далее обрабатываем Xml с параметрами компрессии + // Next process Xml with compression parameters EncoderParams oParameters; int nFormat = ApplyEncoderOptions(&oParameters, wsXmlOptions); - // TODO: Добавить возможность записи альфа-канала - ImageComponentParams aComponentParams[3]; // Пока пусть будет максимально три компоненты (RGB) + // TODO: Add ability to write alpha channel + ImageComponentParams aComponentParams[3]; // For now maximum three components (RGB) Image *pImage = NULL; int nComponentsCount = oParameters.nComponentsCount; @@ -370,7 +370,7 @@ namespace Jpeg2000 aComponentParams[nIndex].nHeight = (int)lHeight; } - // Создаем структуру Image + // Create Image structure pImage = Image_Create(nComponentsCount, &aComponentParams[0], csRGB); if (!pImage) return false; @@ -433,7 +433,7 @@ namespace Jpeg2000 pParameters->nReduce = 0; pParameters->nLayer = 0; - // TODO: Сделать чтение параметров декодирования + // TODO: Implement reading of decoding parameters //if (sXml.GetLength() > 0) //{ // XmlUtils::CXmlNode oMainNode; @@ -475,20 +475,20 @@ namespace Jpeg2000 { EncoderParams* pParameters = (EncoderParams*)pParameters; int nFormat = 0; // J2k - // Сначала выставляем стандартные значения параметров + // First set default parameter values memset(pParameters, 0, sizeof(EncoderParams)); pParameters->nComponentsCount = 3; pParameters->nResolutionsCount = 6; pParameters->nCodeBlockHeightInit = 64; pParameters->nCodeBlockWidthInit = 64; pParameters->eProgOrder = poLRCP; - pParameters->nROIComponentIndex = -1; // Нет ROI + pParameters->nROIComponentIndex = -1; // No ROI pParameters->nSubSamplingDx = 1; pParameters->nSubSamplingDy = 1; pParameters->bTileSizeOn = false; pParameters->sComment = (char*)"Manufactured by Online Media Technologies Ltd."; - // TODO: Сделать чтение параметров кодирования + // TODO: Implement reading of encoding parameters //if (sXml.GetLength() > 0) //{ // XmlUtils::CXmlNode oMainNode; @@ -598,7 +598,7 @@ namespace Jpeg2000 // // SOPmarker // if (oSaveNode.GetNode(_T("SOPmarker"), oCurNode)) // { - // // Пока отключим, потом надо будет добавить - для этого нужно выделять память для стрктуры ImageInfo + // // Disabled for now, needs to be added later - requires allocating memory for ImageInfo structure // //pParameters->nCodingStyle |= 0x02; // } @@ -622,7 +622,7 @@ namespace Jpeg2000 // if (oSaveNode.GetNode(_T("Comment"), oCurNode)) // { // sValue = oCurNode.GetAttribute(_T("value")); - // // TO DO: Неправильное копирование строки + // // TODO: Incorrect string copying // USES_CONVERSION; // pParameters->sComment = W2A(sValue.GetBuffer()); // } @@ -731,13 +731,13 @@ namespace Jpeg2000 //} - // Проверим кооректность введенных параметров + // Check validity of input parameters - // Параметры nDistoAlloc, nFixedQuality, nFixedAlloc нельзя использовать вместе + // Parameters nDistoAlloc, nFixedQuality, nFixedAlloc cannot be used together if ((pParameters->nDistoAlloc || pParameters->nFixedAlloc || pParameters->nFixedQuality) && (!(pParameters->nDistoAlloc ^ pParameters->nFixedAlloc ^ pParameters->nFixedQuality))) return -1; - // Если параметры не заданы, тогда по умолчанию ставим компрессию без потерь + // If parameters are not set, default to lossless compression if (0 == pParameters->nLayersCount) { pParameters->afRates[0] = 0; @@ -751,7 +751,7 @@ namespace Jpeg2000 { if (-1 == pParameters->aoPOC[nIndex].ePpoc) { - // TO DO: Выдать ошибку, что порядок не задан + // TODO: Report error that order is not set } } diff --git a/DesktopEditor/raster/Jp2/J2kIncludes.h b/DesktopEditor/raster/Jp2/J2kIncludes.h index 60842a62f9..1945ea0ffe 100644 --- a/DesktopEditor/raster/Jp2/J2kIncludes.h +++ b/DesktopEditor/raster/Jp2/J2kIncludes.h @@ -51,7 +51,7 @@ namespace Jpeg2000 return NULL; } - Image *pImage = Jp2_Decode((Jp2Stream*)pDInfo->pJp2, pStream); // в случае ошибки pImage = NULL + Image *pImage = Jp2_Decode((Jp2Stream*)pDInfo->pJp2, pStream); // on error pImage = NULL Jp2_DestroyDecompress((Jp2Stream*)pDInfo->pJp2); Free(pDInfo); @@ -82,7 +82,7 @@ namespace Jpeg2000 return NULL; } - Image *pImage = J2k_Decode((J2kCodestream*)pDInfo->pJ2k, pStream); // в случае ошибки pImage = NULL + Image *pImage = J2k_Decode((J2kCodestream*)pDInfo->pJ2k, pStream); // on error pImage = NULL J2k_DestroyDecompress((J2kCodestream*)pDInfo->pJ2k); Free(pDInfo); @@ -114,7 +114,7 @@ namespace Jpeg2000 return NULL; } - Image *pImage = J2k_DecodeJptStream((J2kCodestream*)pDInfo->pJ2k, pStream); // в случае ошибки pImage = NULL + Image *pImage = J2k_DecodeJptStream((J2kCodestream*)pDInfo->pJ2k, pStream); // on error pImage = NULL J2k_DestroyDecompress((J2kCodestream*)pDInfo->pJ2k); Free(pDInfo); @@ -145,7 +145,7 @@ namespace Jpeg2000 return NULL; } - Image *pImage = Mj2_Decode((Mj2_Movie*)pDInfo->pMj2, pStream); // в случае ошибки pImage = NULL + Image *pImage = Mj2_Decode((Mj2_Movie*)pDInfo->pMj2, pStream); // on error pImage = NULL Mj2_DestroyDecompress((Mj2_Movie*)pDInfo->pMj2); Free(pDInfo); diff --git a/DesktopEditor/raster/Jp2/Jp2.h b/DesktopEditor/raster/Jp2/Jp2.h index e4d36b5a6c..6a6a583c45 100644 --- a/DesktopEditor/raster/Jp2/Jp2.h +++ b/DesktopEditor/raster/Jp2/Jp2.h @@ -8,7 +8,7 @@ namespace Jpeg2000 { //------------------------------------------------------------------------------------------------------------------------------- - // Вспомогательные функции + // Helper functions //------------------------------------------------------------------------------------------------------------------------------- static bool Jp2_ReadBoxHeader(PCommon pCodecInfo, CReader *pStream, Jp2Box *pBox) { @@ -111,7 +111,7 @@ namespace Jpeg2000 pStream->Write(pJp2->nWidth, 4); // WIDTH pStream->Write(pJp2->nComponentsCount, 2); // NC pStream->Write(pJp2->nBPC, 1); // BPC - pStream->Write(pJp2->nCompressionType, 1); // C ( это значение всегда равно 7 ) + pStream->Write(pJp2->nCompressionType, 1); // C ( this value is always 7 ) pStream->Write(pJp2->nColorSpaceUnk, 1); // UnkC, colorspace unknown pStream->Write(pJp2->nIPR, 1); // IPR @@ -257,7 +257,7 @@ namespace Jpeg2000 /* ISO/IEC 15444-1:2004 (E), Table I.9 ­ Legal METH values: conforming JP2 reader shall ignore the entire Colour Specification box.*/ //"COLR BOX meth value is not a regular value (%d), so we will ignore the entire Colour Specification box. \n", jp2->meth); - // Пропускаем PROFILE + // Skip PROFILE int nSkipLen = oBox.nInitPos + oBox.nLength - pStream->Tell(); if (nSkipLen < 0) { @@ -364,8 +364,8 @@ namespace Jpeg2000 { // return false; - // По спецификации данный Box является необходимым, но мы все-таки - // попробуем прочитать изображение со стандартными параметрами. + // By spec this Box is required, but we will still + // try to read the image with standard parameters. pStream->Seek(nCurPos); pJp2->nApprox = 0; @@ -547,7 +547,7 @@ namespace Jpeg2000 //------------------------------------------------------------------------------------------------------------------------------- - // Декодирование потока Jp2 + // Decoding Jp2 stream //------------------------------------------------------------------------------------------------------------------------------- void Jp2_DestroyDecompress(Jp2Stream *pJp2) { @@ -597,27 +597,27 @@ namespace Jpeg2000 PCommon pCodecInfo = pJp2->pCodecInfo; - // Декодируем JP2 + // Decode JP2 if (!Jp2_ReadStruct(pJp2, pStream)) { Event_Message(EVT_ERROR, "Failed to decode jp2 structure\n"); return NULL; } - // Декодируем J2K + // Decode J2K Image *pImage = J2k_Decode(pJp2->pJ2k, pStream); if (!pImage) { Event_Message(EVT_ERROR, "Failed to decode J2K image\n"); } - ////приведение цветовой схемы..???? + ////color scheme conversion..???? return pImage; } //------------------------------------------------------------------------------------------------------------------------------- - // Кодирование в поток Jp2 + // Encoding to Jp2 stream //------------------------------------------------------------------------------------------------------------------------------- void Jp2_DestroyCompress(Jp2Stream *pJp2) { @@ -701,7 +701,7 @@ namespace Jpeg2000 if (nDepth0 != depth) pJp2->nBPC = 255; } - pJp2->nCompressionType = 7; // C (всегда 7) + pJp2->nCompressionType = 7; // C (always 7) pJp2->nColorSpaceUnk = 0; // UnkC pJp2->nIPR = 0; // IRP diff --git a/DesktopEditor/raster/Jp2/Jpt.h b/DesktopEditor/raster/Jp2/Jpt.h index 3e0b10b56b..6967695b47 100644 --- a/DesktopEditor/raster/Jp2/Jpt.h +++ b/DesktopEditor/raster/Jp2/Jpt.h @@ -6,7 +6,7 @@ namespace Jpeg2000 { //------------------------------------------------------------------------------------------------------------------------------- - // Вспомогательные функции + // Helper functions //------------------------------------------------------------------------------------------------------------------------------- static unsigned int JPT_ReadVBASInfo(CReader *pStream, unsigned int nValue) { @@ -34,7 +34,7 @@ namespace Jpeg2000 } //------------------------------------------------------------------------------------------------------------------------------- - // Основные функции + // Main functions //------------------------------------------------------------------------------------------------------------------------------- void JPT_InitMessageHeader(JPTMessageHeader *pHeader) { diff --git a/DesktopEditor/raster/Jp2/Mj2.h b/DesktopEditor/raster/Jp2/Mj2.h index fa817f0f93..2ff2ad9ae8 100644 --- a/DesktopEditor/raster/Jp2/Mj2.h +++ b/DesktopEditor/raster/Jp2/Mj2.h @@ -5,7 +5,7 @@ namespace Jpeg2000 { //------------------------------------------------------------------------------------------------------------------------------- - // Данные функции предназначены для чтения Motion JPEG 2000 (MJ2) + // These functions are intended for reading Motion JPEG 2000 (MJ2) //------------------------------------------------------------------------------------------------------------------------------- static bool Mj2_ReadBoxHeader(Mj2_Box* pBox, CReader * pStream) @@ -104,7 +104,7 @@ namespace Jpeg2000 //>>>> - // Достаем первую картинку в потоке MDAT + // Get the first image from the MDAT stream Jp2Box oTempBox; Jp2_ReadBoxHeader(pMovie->pCodecInfo, pStream, &oTempBox); do @@ -124,7 +124,7 @@ namespace Jpeg2000 int nJ2kCodestreamOffset = pStream->Tell(); int nJ2kCodestreamLength = oTempBox.nLength - 8; - // Декодируем J2K + // Decode J2K *ppImage = J2k_Decode(pMovie->pJ2k, pStream); if (!*ppImage) { @@ -159,8 +159,8 @@ namespace Jpeg2000 Event_Message(EVT_ERROR, "Error: Only Version 0 handled in MVHD box\n"); } - // TO DO: Здесь в зависимости от версии разное число байт должно читаться - // см. fcd15444-3.pdf стр.15 + // TO DO: Here different number of bytes should be read depending on version + // see fcd15444-3.pdf page 15 pMovie->unCreationTime = pStream->Read(4); // Creation Time pMovie->unModificationTime = pStream->Read(4); // Modification Time @@ -206,8 +206,8 @@ namespace Jpeg2000 return false; } - // TO DO: Здесь в зависимости от версии разное число байт должно читаться - // см. fcd15444-3.pdf стр.16 + // TO DO: Here different number of bytes should be read depending on version + // see fcd15444-3.pdf page 16 if (0 != pStream->Read(1)) // Version = 0 { @@ -217,7 +217,7 @@ namespace Jpeg2000 int nFlag = pStream->Read(3); - if (!(1 == nFlag || 2 == nFlag || 3 == nFlag || 4 == nFlag)) // nFlags = 1, 2, 3 или 4 + if (!(1 == nFlag || 2 == nFlag || 3 == nFlag || 4 == nFlag)) // nFlags = 1, 2, 3 or 4 { Event_Message(EVT_ERROR, "Error with flag in TKHD box: Expected flag 1,2,3 or 4\n"); return false; @@ -268,7 +268,7 @@ namespace Jpeg2000 return 1; } - // TO DO: Сделать поодержку Version = 1 + // TO DO: Add support for Version = 1 if (0 != pStream->Read(1)) // Version = 0 { Event_Message(EVT_ERROR, "Error: Only Version 0 handled in MDHD box\n"); @@ -486,9 +486,9 @@ namespace Jpeg2000 return false; } - if (1 != pStream->Read(3)) // Если flags = 1, то медиа данные в файле + if (1 != pStream->Read(3)) // If flags = 1, then media data is in file { - // TO DO: Сделать нормальное чтение строк + // TO DO: Implement proper string reading pTrack->pUrl[nUrlNum].anLocation[0] = pStream->Read(4); pTrack->pUrl[nUrlNum].anLocation[1] = pStream->Read(4); pTrack->pUrl[nUrlNum].anLocation[2] = pStream->Read(4); @@ -525,9 +525,9 @@ namespace Jpeg2000 return false; } - if (1 != pStream->Read(3)) // Если flags = 1, то медиа данные в файле + if (1 != pStream->Read(3)) // If flags = 1, then media data is in file { - // TO DO: Сделать нормальное чтение строк + // TO DO: Implement proper string reading pTrack->pUrn[nUrnNum].anName[0] = pStream->Read(4); pTrack->pUrn[nUrnNum].anName[1] = pStream->Read(4); pTrack->pUrn[nUrnNum].anName[2] = pStream->Read(4); @@ -778,7 +778,7 @@ namespace Jpeg2000 int nSampleSize = pStream->Read(4); // SampleSize - if (0 != nSampleSize) // У всех самплов одинаковый размер + if (0 != nSampleSize) // All samples have the same size { pTrack->unSameSampleSize = 1; @@ -857,7 +857,7 @@ namespace Jpeg2000 static bool Mj2_ReadSTCO(Mj2_TrackParams* pTrack, CReader * pStream) { - // TO DO: Сделать чтение 'co64' + // TO DO: Implement reading 'co64' Mj2_Box oBox; Mj2_ReadBoxHeader(&oBox, pStream); if (MJ2_STCO != oBox.nType) @@ -1185,13 +1185,13 @@ namespace Jpeg2000 } else if (1 == pTrack->nTrackType) { - // TO DO: Релизовать + // TO DO: Implement int nSkipLen = pStream->Read(4); pStream->Skip(nSkipLen - 4); } else if (2 == pTrack->nTrackType) { - // TO DO: Реализовать + // TO DO: Implement int nSkipLen = pStream->Read(4); pStream->Skip(nSkipLen - 4); } @@ -1403,7 +1403,7 @@ namespace Jpeg2000 { case MJ2_MDAT: - // TO DO: Связать данные в MDAT с данными MOOV + // TO DO: Link MDAT data with MOOV data if (!Mj2_ReadMDAT(pMovie, pStream, ppImage, oBox)) return false; @@ -1440,7 +1440,7 @@ namespace Jpeg2000 } //------------------------------------------------------------------------------------------------------------------------------- - // Декодирование потока Mj2 + // Mj2 stream decoding //------------------------------------------------------------------------------------------------------------------------------- void Mj2_DestroyDecompress(Mj2_Movie* pMovie) { @@ -1531,7 +1531,7 @@ namespace Jpeg2000 PCommon pCodecInfo = pMovie->pCodecInfo; Image *pImage = NULL; - // Декодируем JP2 + // Decode JP2 if (!Mj2_ReadStruct(pMovie, pStream, &pImage)) { Event_Message(EVT_ERROR, "Failed to decode jp2 structure\n"); diff --git a/DesktopEditor/raster/Jp2/PacketIterator.h b/DesktopEditor/raster/Jp2/PacketIterator.h index 30c6d049c3..e54cc3a9a8 100644 --- a/DesktopEditor/raster/Jp2/PacketIterator.h +++ b/DesktopEditor/raster/Jp2/PacketIterator.h @@ -6,7 +6,7 @@ namespace Jpeg2000 { //------------------------------------------------------------------------------------------------------------------------------- - // Вспомогательные функции + // Helper functions //------------------------------------------------------------------------------------------------------------------------------- static bool PI_NextLRCP(PacketIterator *pPI) { @@ -157,7 +157,7 @@ namespace Jpeg2000 { continue; } - // TO DO: Проверить здесь последнее деление на (1 << nResPX) + // TO DO: Check the last division by (1 << nResPX) here if ((!(pPI->nY % (pComponent->nDy << nResPY) == 0) || (pPI->nY == pPI->nTileY0 && (nTileResY0 << nLevel) % (1 << nResPX)))) { continue; @@ -247,7 +247,7 @@ namespace Jpeg2000 { continue; } - // TO DO: Проверить здесь последнее деление на (1 << nResPX) + // TO DO: Check the last division by (1 << nResPX) here if ((!(pPI->nY % (pComponent->nDy << nResPY) == 0) || (pPI->nY == pPI->nTileY0 && (nTileResY0 << nLevel) % (1 << nResPX)))) { continue; @@ -332,7 +332,7 @@ namespace Jpeg2000 { continue; } - // TO DO: Проверить здесь последнее деление на (1 << nResPX) + // TO DO: Check the last division by (1 << nResPX) here if ((!(pPI->nY % (pComponent->nDy << nResPY) == 0) || (pPI->nY == pPI->nTileY0 && (nTileResY0 << nLevel) % (1 << nResPX)))) { continue; @@ -367,7 +367,7 @@ namespace Jpeg2000 return false; } //------------------------------------------------------------------------------------------------------------------------------- - // Основные функции + // Main functions //------------------------------------------------------------------------------------------------------------------------------- void PI_Destroy(PacketIterator *pPI, CodingParams *pCodingParams, int nTileIndex) { diff --git a/DesktopEditor/raster/Jp2/Reader.cpp b/DesktopEditor/raster/Jp2/Reader.cpp index 9e885649b8..7d8bfeb2ee 100644 --- a/DesktopEditor/raster/Jp2/Reader.cpp +++ b/DesktopEditor/raster/Jp2/Reader.cpp @@ -42,7 +42,7 @@ namespace Jpeg2000 return *pStream->pCurPos++; } //------------------------------------------------------------------------------------------------------------------------------- - // Основные функции + // Main functions //------------------------------------------------------------------------------------------------------------------------------- ByteIO* ByteIO_Open(PCommon pInfo, unsigned char *pBuffer, int nLength) { @@ -62,7 +62,7 @@ namespace Jpeg2000 } else if (!pBuffer && !nLength && pInfo) { - // Выделяем память для закодировнного изображения + // Allocate memory for encoded image pStream->nMode = STREAM_WRITE; switch (pInfo->eCodecFormat) { @@ -90,7 +90,7 @@ namespace Jpeg2000 return NULL; } - // Инициализируем поток + // Initialize stream pStream->pStart = pStream->pBuffer; pStream->pEnd = pStream->pBuffer + pStream->nLength; pStream->pCurPos = pStream->pBuffer; diff --git a/DesktopEditor/raster/Jp2/Reader.h b/DesktopEditor/raster/Jp2/Reader.h index 7b5e25ce3b..d1c283c9b7 100644 --- a/DesktopEditor/raster/Jp2/Reader.h +++ b/DesktopEditor/raster/Jp2/Reader.h @@ -8,18 +8,18 @@ namespace Jpeg2000 // Byte input-output (Stream IO) //------------------------------------------------------------------------------------------------------------------------------- -#define STREAM_READ 0x0001 // Поток открыт для чтения -#define STREAM_WRITE 0x0002 // Поток открыт для записи +#define STREAM_READ 0x0001 // Stream is open for reading +#define STREAM_WRITE 0x0002 // Stream is open for writing typedef struct TByteIO { - int nMode; // Чтение или запись ( STREAM_READ или OPJ_STREAM_WRITE ) - unsigned char *pBuffer; // Указатель на начало буфера - int nLength; // Размер буфера в байтах + int nMode; // Read or write ( STREAM_READ or OPJ_STREAM_WRITE ) + unsigned char *pBuffer; // Pointer to buffer start + int nLength; // Buffer size in bytes - unsigned char *pStart; // Указатель на начало потока - unsigned char *pEnd; // Указатель на конец потока - unsigned char *pCurPos; // Указатель не текущую позицию в потоке + unsigned char *pStart; // Pointer to stream start + unsigned char *pEnd; // Pointer to stream end + unsigned char *pCurPos; // Pointer to current position in stream } ByteIO; diff --git a/DesktopEditor/raster/Jp2/Stream.h b/DesktopEditor/raster/Jp2/Stream.h index 9b6342cf3a..c5612da364 100644 --- a/DesktopEditor/raster/Jp2/Stream.h +++ b/DesktopEditor/raster/Jp2/Stream.h @@ -11,7 +11,7 @@ namespace Jpeg2000 //------------------------------------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------------------------------------------------- - // Вспомогательные функции + // Helper functions //------------------------------------------------------------------------------------------------------------------------------- static int BitIO_ByteOut(BitIO *pBIO) { @@ -61,7 +61,7 @@ namespace Jpeg2000 //------------------------------------------------------------------------------------------------------------------------------- - // Основные функции + // Main functions //------------------------------------------------------------------------------------------------------------------------------- BitIO* BitIO_Create() { diff --git a/DesktopEditor/raster/Jp2/TagTree.h b/DesktopEditor/raster/Jp2/TagTree.h index 95904512e6..bcc31f42a2 100644 --- a/DesktopEditor/raster/Jp2/TagTree.h +++ b/DesktopEditor/raster/Jp2/TagTree.h @@ -39,7 +39,7 @@ namespace Jpeg2000 anVer[nLevelsCount + 1] = (anVer[nLevelsCount] + 1) / 2; pTree->nNodesCount += nCurLevelCount; ++nLevelsCount; - // TO DO: Поставить дополнительную проверку ( nLevelsCount + 1 < 32 ) + // TO DO: Add additional check ( nLevelsCount + 1 < 32 ) } while (nCurLevelCount > 1); // ADD diff --git a/DesktopEditor/raster/Jp2/Tier1.h b/DesktopEditor/raster/Jp2/Tier1.h index 1559a3f5a2..8468a0bb93 100644 --- a/DesktopEditor/raster/Jp2/Tier1.h +++ b/DesktopEditor/raster/Jp2/Tier1.h @@ -7,7 +7,7 @@ namespace Jpeg2000 { //------------------------------------------------------------------------------------------------------------------------------- - // Вспомогательные функции + // Helper functions //------------------------------------------------------------------------------------------------------------------------------- static int Tier1_GetContextIndexZC(Tier1 *pTier1, int nF, int nOrient) @@ -904,7 +904,7 @@ namespace Jpeg2000 //------------------------------------------------------------------------------------------------------------------------------- - // Основные функции + // Main functions //------------------------------------------------------------------------------------------------------------------------------- Tier1* Tier1_Create(PCommon pCodecInfo) { @@ -933,7 +933,7 @@ namespace Jpeg2000 return NULL; } - // Инициализируем таблицы + // Initialize tables Tier1_InitLuts(pTier1); } return pTier1; diff --git a/DesktopEditor/raster/Jp2/Tier2.h b/DesktopEditor/raster/Jp2/Tier2.h index 227ef6a447..460cc32b54 100644 --- a/DesktopEditor/raster/Jp2/Tier2.h +++ b/DesktopEditor/raster/Jp2/Tier2.h @@ -8,7 +8,7 @@ namespace Jpeg2000 { //------------------------------------------------------------------------------------------------------------------------------- - // Вспомогательные функции + // Helper functions //------------------------------------------------------------------------------------------------------------------------------- static void Tier2_PutCommaCode(BitIO *pBIO, int nLen) { @@ -83,7 +83,7 @@ namespace Jpeg2000 unsigned char *pSOP = (unsigned char *)Malloc(6 * sizeof(unsigned char)); pSOP[0] = 255; // ff pSOP[1] = 145; // 91 - pSOP[2] = 0; // Длина всегда 4 байта + pSOP[2] = 0; // Length is always 4 bytes pSOP[3] = 4; // pSOP[4] = (pImageInfo->nPacketCount % 65536) / 256; pSOP[5] = (pImageInfo->nPacketCount % 65536) % 256; @@ -148,13 +148,13 @@ namespace Jpeg2000 BitIO_Write(pBitStream, pLayer->nPassesCount != 0, 1); } - // Если CodeBlock не включен, тогда переходми к следующему CodeBlock + // If CodeBlock is not included, then move to the next CodeBlock if (!pLayer->nPassesCount) { continue; } - // Если это первое появление CodeBlock --> тогда обрабытываем информацию о Zero bit-planes + // If this is the first appearance of CodeBlock --> then process Zero bit-planes information if (!pCodeBlock->nPassesCount) { pCodeBlock->nLenBitsCount = 3; @@ -319,7 +319,7 @@ namespace Jpeg2000 } } - // SOP маркер + // SOP marker if (pTCP->nCodingStyle & J2K_CP_CSTY_SOP) { if ((*pSrcPointer) != 0xff || (*(pSrcPointer + 1) != 0x91)) @@ -331,10 +331,10 @@ namespace Jpeg2000 pSrcPointer += 6; } - // TO DO : Добавить проверку значения Nsop + // TO DO : Add Nsop value validation } - // Когда используются пакеты PPT/PPM, Packet header хранится в маркерах PPT/PPM. + // When PPT/PPM packets are used, Packet header is stored in PPT/PPM markers. BitIO *pBitStream = BitIO_Create(); if (!pBitStream) @@ -350,7 +350,7 @@ namespace Jpeg2000 pBuffer = pTCP->pPPTData; BitIO_InitDecoder(pBitStream, pBuffer, pTCP->nPPTLength); } - else // Обычный случай + else // Normal case { pBuffer = pSrcPointer; BitIO_InitDecoder(pBitStream, pBuffer, pSrc + nLen - pBuffer); @@ -364,7 +364,7 @@ namespace Jpeg2000 pBuffer += BitIO_WrittenBytesCount(pBitStream); BitIO_Destroy(pBitStream); - // EPH маркер + // EPH marker if (pTCP->nCodingStyle & J2K_CP_CSTY_EPH) { if ((*pBuffer) != 0xff || (*(pBuffer + 1) != 0x92)) @@ -407,7 +407,7 @@ namespace Jpeg2000 CodeBlock *pCodeBlock = &pPrecinct->pCodeBlocks[nCodeBlockIndex]; TCDSegment *pSegment = NULL; - // Если CodeBlock не был включен ранее --> TagTree + // If CodeBlock was not included before --> TagTree if (!pCodeBlock->nSegmentsCount) { nIncluded = TGT_Decode(pBitStream, pPrecinct->pInclTree, nCodeBlockIndex, nLayerIndex + 1); @@ -423,7 +423,7 @@ namespace Jpeg2000 continue; } - // Если CodeBlock не был включен ранее --> zero-bitplane tagtree + // If CodeBlock was not included before --> zero-bitplane tagtree if (!pCodeBlock->nSegmentsCount) { int nIndex; @@ -475,7 +475,7 @@ namespace Jpeg2000 pBuffer += BitIO_WrittenBytesCount(pBitStream); BitIO_Destroy(pBitStream); - // EPH маркер + // EPH marker if (pTCP->nCodingStyle & J2K_CP_CSTY_EPH) { if ((*pBuffer) != 0xff || (*(pBuffer + 1) != 0x92)) @@ -568,7 +568,7 @@ namespace Jpeg2000 //------------------------------------------------------------------------------------------------------------------------------- - // Основные функции + // Main functions //------------------------------------------------------------------------------------------------------------------------------- int Tier2_EncodePackets(Tier2 *pTier2, int nTileIndex, Tile *pTile, int nMaxLayers, unsigned char *pDst, int nLen, ImageInfo *pImageInfo) { @@ -605,7 +605,7 @@ namespace Jpeg2000 pDstPointer += nShift; } - // Индексация + // Indexing if (pImageInfo && pImageInfo->nIndexOn) { if (pImageInfo->nIndexWrite) diff --git a/DesktopEditor/raster/Jp2/Tile.h b/DesktopEditor/raster/Jp2/Tile.h index 8bc52c43e1..b4ffdaef1e 100644 --- a/DesktopEditor/raster/Jp2/Tile.h +++ b/DesktopEditor/raster/Jp2/Tile.h @@ -8,7 +8,7 @@ namespace Jpeg2000 { //------------------------------------------------------------------------------------------------------------------------------- - // Основные функции + // Main functions //------------------------------------------------------------------------------------------------------------------------------- void TCD_Dump(FILE *pFile, TCD *pTCD, TCDImage *pTCDImage) @@ -157,13 +157,13 @@ namespace Jpeg2000 { TileCodingParams *pTCP = &pCodingParams->pTCP[nCurTileIndex]; - // См. стр 59 ISO/IEC FDIS15444-1 + // See page 59 ISO/IEC FDIS15444-1 int nP = nCurTileIndex % pCodingParams->nXTilesCount; int nQ = nCurTileIndex / pCodingParams->nXTilesCount; Tile *pTile = pTCD->pTCDImage->pTiles; - // Границы тайла (маштабированные относительно размеров изображения, если необходимо) + // Tile boundaries (scaled relative to image dimensions if necessary) pTile->nX0 = (std::max)(pCodingParams->nXTOsiz + nP * pCodingParams->nXTsiz, pImage->nXOsiz); pTile->nY0 = (std::max)(pCodingParams->nYTOsiz + nQ * pCodingParams->nYTsiz, pImage->nYOsiz); pTile->nX1 = (std::min)(pCodingParams->nXTOsiz + (nP + 1) * pCodingParams->nXTsiz, pImage->nXsiz); @@ -203,7 +203,7 @@ namespace Jpeg2000 TileCompCodingParams *pTCCP = &pTCP->pTCCP[nComponentIndex]; TileComp *pTileComp = &pTile->pComponents[nComponentIndex]; - // Границы каждой тайл-компоненты (глобальные) + // Boundaries of each tile component (global) pTileComp->nX0 = CeilDiv(pTile->nX0, pImage->pComponents[nComponentIndex].nXRsiz); pTileComp->nY0 = CeilDiv(pTile->nY0, pImage->pComponents[nComponentIndex].nYRsiz); pTileComp->nX1 = CeilDiv(pTile->nX1, pImage->pComponents[nComponentIndex].nXRsiz); @@ -232,7 +232,7 @@ namespace Jpeg2000 Resolution *pResolution = &pTileComp->pResolutions[nResolutionIndex]; - // Границы для каждого уровня (глобальные) + // Boundaries for each level (global) pResolution->nX0 = CeilDivPow2(pTileComp->nX0, nLevel); pResolution->nY0 = CeilDivPow2(pTileComp->nY0, nLevel); pResolution->nX1 = CeilDivPow2(pTileComp->nX1, nLevel); @@ -240,7 +240,7 @@ namespace Jpeg2000 pResolution->nBandsCount = (nResolutionIndex == 0 ? 1 : 3); - // См. стр. 35, таблица A-23 ISO/IEC FDIS154444-1 + // See page 35, table A-23 ISO/IEC FDIS154444-1 int nPPx, nPPy; if (pTCCP->nCodingStyle & J2K_CCP_CSTY_PRT) { @@ -253,7 +253,7 @@ namespace Jpeg2000 nPPy = 15; } - // См. стр. 64, Annex-B.6, ISO/IEC FDIS15444-1 + // See page 64, Annex-B.6, ISO/IEC FDIS15444-1 int nFloorTRX0 = FloorDivPow2(pResolution->nX0, nPPx) << nPPx; int nFloorTRY0 = FloorDivPow2(pResolution->nY0, nPPy) << nPPy; int nCeilTRX1 = CeilDivPow2(pResolution->nX1, nPPx) << nPPx; @@ -340,7 +340,7 @@ namespace Jpeg2000 Precinct *pPrecinct = &pBand->pPrecincts[nPrecinctIndex]; - // Размеры области (Precinct) + // Precinct dimensions pPrecinct->nX0 = (std::max)(nGlobalCodeBlockStartX, pBand->nX0); pPrecinct->nY0 = (std::max)(nGlobalCodeBlockStartY, pBand->nY0); pPrecinct->nX1 = (std::min)(nGlobalCodeBlockEndX, pBand->nX1); @@ -373,7 +373,7 @@ namespace Jpeg2000 CodeBlock *pCodeBlock = &pPrecinct->pCodeBlocks[nCodeBlockIndex]; - // Границы CodeBlock (глобальные) + // CodeBlock boundaries (global) pCodeBlock->nX0 = (std::max)(nCodeBlockStartX, pPrecinct->nX0); pCodeBlock->nY0 = (std::max)(nCodeBlockStartY, pPrecinct->nY0); pCodeBlock->nX1 = (std::min)(nCodeBlockEndX, pPrecinct->nX1); @@ -401,13 +401,13 @@ namespace Jpeg2000 { TileCodingParams *pTCP = &pCodingParams->pTCP[nCurTileIndex]; - // См. стр 59 ISO/IEC FDIS15444-1 + // See page 59 ISO/IEC FDIS15444-1 int nP = nCurTileIndex % pCodingParams->nXTilesCount; int nQ = nCurTileIndex / pCodingParams->nXTilesCount; Tile *pTile = pTCD->pTCDImage->pTiles; - // Границы тайла (маштабированные относительно размеров изображения, если необходимо) + // Tile boundaries (scaled relative to image dimensions if necessary) pTile->nX0 = (std::max)(pCodingParams->nXTOsiz + nP * pCodingParams->nXTsiz, pImage->nXOsiz); pTile->nY0 = (std::max)(pCodingParams->nYTOsiz + nQ * pCodingParams->nYTsiz, pImage->nYOsiz); pTile->nX1 = (std::min)(pCodingParams->nXTOsiz + (nP + 1) * pCodingParams->nXTsiz, pImage->nXsiz); @@ -440,7 +440,7 @@ namespace Jpeg2000 TileCompCodingParams *pTCCP = &pTCP->pTCCP[nComponentIndex]; TileComp *pTileComp = &pTile->pComponents[nComponentIndex]; - // Границы каждой тайл-компоненты (глобальные) + // Boundaries of each tile component (global) pTileComp->nX0 = CeilDiv(pTile->nX0, pImage->pComponents[nComponentIndex].nXRsiz); pTileComp->nY0 = CeilDiv(pTile->nY0, pImage->pComponents[nComponentIndex].nYRsiz); pTileComp->nX1 = CeilDiv(pTile->nX1, pImage->pComponents[nComponentIndex].nXRsiz); @@ -462,14 +462,14 @@ namespace Jpeg2000 Resolution *pResolution = &pTileComp->pResolutions[nResolutionIndex]; - // Границы для каждого уровня (глобальные) + // Boundaries for each level (global) pResolution->nX0 = CeilDivPow2(pTileComp->nX0, nLevel); pResolution->nY0 = CeilDivPow2(pTileComp->nY0, nLevel); pResolution->nX1 = CeilDivPow2(pTileComp->nX1, nLevel); pResolution->nY1 = CeilDivPow2(pTileComp->nY1, nLevel); pResolution->nBandsCount = (nResolutionIndex == 0 ? 1 : 3); - // См. стр. 35, таблица A-23 ISO/IEC FDIS154444-1 + // See page 35, table A-23 ISO/IEC FDIS154444-1 int nPPx, nPPy; if (pTCCP->nCodingStyle & J2K_CCP_CSTY_PRT) { @@ -482,7 +482,7 @@ namespace Jpeg2000 nPPy = 15; } - // См. стр. 64, Annex-B.6, ISO/IEC FDIS15444-1 + // See page 64, Annex-B.6, ISO/IEC FDIS15444-1 int nFloorTRX0 = FloorDivPow2(pResolution->nX0, nPPx) << nPPx; int nFloorTRY0 = FloorDivPow2(pResolution->nY0, nPPy) << nPPy; int nCeilTRX1 = CeilDivPow2(pResolution->nX1, nPPx) << nPPx; @@ -556,7 +556,7 @@ namespace Jpeg2000 Precinct *pPrecinct = &pBand->pPrecincts[nPrecinctIndex]; - // Размеры области (Precinct) + // Precinct dimensions pPrecinct->nX0 = (std::max)(nGlobalCodeBlockStartX, pBand->nX0); pPrecinct->nY0 = (std::max)(nGlobalCodeBlockStartY, pBand->nY0); pPrecinct->nX1 = (std::min)(nGlobalCodeBlockEndX, pBand->nX1); @@ -599,7 +599,7 @@ namespace Jpeg2000 CodeBlock *pCodeBlock = &pPrecinct->pCodeBlocks[nCodeBlockIndex]; - // Границы CodeBlock (глобальные) + // CodeBlock boundaries (global) pCodeBlock->nX0 = (std::max)(nCodeBlockStartX, pPrecinct->nX0); pCodeBlock->nY0 = (std::max)(nCodeBlockStartY, pPrecinct->nY0); pCodeBlock->nX1 = (std::min)(nCodeBlockEndX, pPrecinct->nX1); @@ -699,12 +699,12 @@ namespace Jpeg2000 TileCodingParams *pTCP = &(pCodingParams->pTCP[pCodingParams->pTileIndex[nIndex]]); Tile *pTile = &(pTCD->pTCDImage->pTiles[pCodingParams->pTileIndex[nIndex]]); - // См. стр 59 ISO/IEC FDIS15444-1 + // See page 59 ISO/IEC FDIS15444-1 int nTileIndex = pCodingParams->pTileIndex[nIndex]; int nP = nTileIndex % pCodingParams->nXTilesCount; int nQ = nTileIndex / pCodingParams->nXTilesCount; - // Границы тайла (маштабированные относительно размеров изображения, если необходимо) + // Tile boundaries (scaled relative to image dimensions if necessary) pTile->nX0 = (std::max)(pCodingParams->nXTOsiz + nP * pCodingParams->nXTsiz, pImage->nXOsiz); pTile->nY0 = (std::max)(pCodingParams->nYTOsiz + nQ * pCodingParams->nYTsiz, pImage->nYOsiz); pTile->nX1 = (std::min)(pCodingParams->nXTOsiz + (nP + 1) * pCodingParams->nXTsiz, pImage->nXsiz); @@ -724,7 +724,7 @@ namespace Jpeg2000 TileCompCodingParams *pTCCP = &pTCP->pTCCP[nComponentIndex]; TileComp *pTileComp = &pTile->pComponents[nComponentIndex]; - // Границы каждой тайл-компоненты (глобальные) + // Boundaries of each tile component (global) pTileComp->nX0 = CeilDiv(pTile->nX0, pImage->pComponents[nComponentIndex].nXRsiz); pTileComp->nY0 = CeilDiv(pTile->nY0, pImage->pComponents[nComponentIndex].nYRsiz); pTileComp->nX1 = CeilDiv(pTile->nX1, pImage->pComponents[nComponentIndex].nXRsiz); @@ -753,14 +753,14 @@ namespace Jpeg2000 Resolution *pResolution = &pTileComp->pResolutions[nResolutionIndex]; - // Границы для каждого уровня (глобальные) + // Boundaries for each level (global) pResolution->nX0 = CeilDivPow2(pTileComp->nX0, nLevel); pResolution->nY0 = CeilDivPow2(pTileComp->nY0, nLevel); pResolution->nX1 = CeilDivPow2(pTileComp->nX1, nLevel); pResolution->nY1 = CeilDivPow2(pTileComp->nY1, nLevel); pResolution->nBandsCount = (nResolutionIndex == 0 ? 1 : 3); - // См. стр. 35, таблица A-23 ISO/IEC FDIS154444-1 + // See page 35, table A-23 ISO/IEC FDIS154444-1 int nPPx, nPPy; if (pTCCP->nCodingStyle & J2K_CCP_CSTY_PRT) { @@ -773,7 +773,7 @@ namespace Jpeg2000 nPPy = 15; } - // См. стр. 64, Annex-B.6, ISO/IEC FDIS15444-1 + // See page 64, Annex-B.6, ISO/IEC FDIS15444-1 int nFlootTRX0 = FloorDivPow2(pResolution->nX0, nPPx) << nPPx; int nFloorTRY0 = FloorDivPow2(pResolution->nY0, nPPy) << nPPy; int nCeilTRX1 = CeilDivPow2(pResolution->nX1, nPPx) << nPPx; @@ -853,7 +853,7 @@ namespace Jpeg2000 int nGlobalCodeBlockEndY = nGlobalCodeBlockStartY + (1 << nCBHeightExpn); Precinct *pPrecinct = &pBand->pPrecincts[nPrecinctIndex]; - // Размеры области (Precinct) + // Precinct dimensions pPrecinct->nX0 = (std::max)(nGlobalCodeBlockStartX, pBand->nX0); pPrecinct->nY0 = (std::max)(nGlobalCodeBlockStartY, pBand->nY0); pPrecinct->nX1 = (std::min)(nGlobalCodeBlockEndX, pBand->nX1); @@ -884,7 +884,7 @@ namespace Jpeg2000 int nCodeBlockEndX = nCodeBlockStartX + (1 << nXCBa); int nCodeBlockEndY = nCodeBlockStartY + (1 << nYCBa); - // Границы CodeBlock (глобальные) + // CodeBlock boundaries (global) CodeBlock *pCodeBlock = &pPrecinct->pCodeBlocks[nCodeBlockIndex]; pCodeBlock->nX0 = (std::max)(nCodeBlockStartX, pPrecinct->nX0); pCodeBlock->nY0 = (std::max)(nCodeBlockStartY, pPrecinct->nY0); @@ -907,7 +907,7 @@ namespace Jpeg2000 // } //#endif - // Выделяем место для хранения закодированных данных ( = окончательное изображение ). + // Allocate space for storing encoded data ( = final image ). unsigned int nX0 = 0, nY0 = 0, nX1 = 0, nY1 = 0, nWidth, nHeight; @@ -981,7 +981,7 @@ namespace Jpeg2000 CodeBlock *pCodeBlock = &pPrecinct->pCodeBlocks[nCodeBlockIndex]; Layer *pLayer = &pCodeBlock->aLayers[nLayerIndex]; - int nIMSB = pTCD->pImage->pComponents[nComponentIndex].nPrecision - pCodeBlock->nBPSCount; // Количество bit-plan равных 0 + int nIMSB = pTCD->pImage->pComponents[nComponentIndex].nPrecision - pCodeBlock->nBPSCount; // Number of bit-planes equal to 0 if (0 == nLayerIndex) { @@ -1245,7 +1245,7 @@ namespace Jpeg2000 int nSuccess = 0; - // TO DO: Убрать nMaxLen + // TO DO: Remove nMaxLen int nMaxLen = pTCP->afRates[nLayerIndex] ? (std::min)(((int)ceil(pTCP->afRates[nLayerIndex])), nLen) : nLen; double dGoodThreshold = 0; double dDistoTarget = pTile->dDistoTile - ((c_dK * dMaxSE) / pow((float)10, pTCP->afDistoRatio[nLayerIndex] / 10)); @@ -1347,7 +1347,7 @@ namespace Jpeg2000 // << INDEX //---------------TILE-DATA-------------- - double dEncodingTime = Clock(); // Засекаем сколько потребовалось времени для кодирования тайла + double dEncodingTime = Clock(); // Record time needed for tile encoding for (int nComponentIndex = 0; nComponentIndex < pTile->nComponentsCount; nComponentIndex++) { @@ -1359,15 +1359,15 @@ namespace Jpeg2000 int nTileWidth = pTileComp->nX1 - pTileComp->nX0; int nWidth = CeilDiv(pImage->nXsiz - pImage->nXOsiz, pImage->pComponents[nComponentIndex].nXRsiz); - // Извлекаем данные тайла + // Extract tile data if (pTCD_TCP->pTCCP[nComponentIndex].nTransformID == 1) { for (int nY = pTileComp->nY0; nY < pTileComp->nY1; nY++) { - // Иходные данные + // Source data int *pData = &pImage->pComponents[nComponentIndex].pData[(pTileComp->nX0 - nOffsetX) + (nY - nOffsety) * nWidth]; - // Результат + // Result int *pTileData = &pTileComp->pData[(nY - pTileComp->nY0) * nTileWidth]; for (int nX = pTileComp->nX0; nX < pTileComp->nX1; nX++) { @@ -1379,9 +1379,9 @@ namespace Jpeg2000 { for (int nY = pTileComp->nY0; nY < pTileComp->nY1; nY++) { - // Иходные данные + // Source data int *pData = &pImage->pComponents[nComponentIndex].pData[(pTileComp->nX0 - nOffsetX) + (nY - nOffsety) * nWidth]; - // Результат + // Result int *pTileData = &pTileComp->pData[(nY - pTileComp->nY0) * nTileWidth]; for (int nX = pTileComp->nX0; nX < pTileComp->nX1; nX++) { @@ -1460,7 +1460,7 @@ namespace Jpeg2000 Event_Message(EVT_INFO, "- tile encoded in %f s\n", dEncodingTime); - // Освобождаем память + // Free memory for (int nComponentIndex = 0; nComponentIndex < pTile->nComponentsCount; nComponentIndex++) { TileComp *pTileComp = &pTile->pComponents[nComponentIndex]; @@ -1479,7 +1479,7 @@ namespace Jpeg2000 pTCD->pTCP = &(pTCD->pCodingParams->pTCP[nTileIndex]); Tile *pTile = pTCD->pTCDTile; - double dDecodeTime = Clock(); // Время, затраченное на декодирование тайла + double dDecodeTime = Clock(); // Time spent on tile decoding Event_Message(EVT_INFO, "tile %d of %d\n", nTileIndex + 1, pTCD->pCodingParams->nXTilesCount * pTCD->pCodingParams->nYTilesCount); //--------------TIER2--------------------- diff --git a/DesktopEditor/raster/Jp2/Types.h b/DesktopEditor/raster/Jp2/Types.h index 084208d95c..c8bcaa3ef1 100644 --- a/DesktopEditor/raster/Jp2/Types.h +++ b/DesktopEditor/raster/Jp2/Types.h @@ -9,12 +9,12 @@ namespace Jpeg2000 // Constant definitions //------------------------------------------------------------------------------------------------------------------------------- -#define MAX_PATH_LEN 4096 // Максимальная длина для имен файлов +#define MAX_PATH_LEN 4096 // Maximum length for file names -#define J2K_MAXRLVLS 33 // Максимальное число уровней разложения -#define J2K_MAXBANDS (3 * J2K_MAXRLVLS - 2) // Максимальное число обастей, связанных с уровнями разложения +#define J2K_MAXRLVLS 33 // Maximum number of decomposition levels +#define J2K_MAXBANDS (3 * J2K_MAXRLVLS - 2) // Maximum number of bands associated with decomposition levels -#define J2K_MAXSSFTR 2 // Max SubSampling Factor (Значения больше 2 могут привести к ошибке) +#define J2K_MAXSSFTR 2 // Max SubSampling Factor (Values greater than 2 may cause errors) void* Malloc(size_t nSize); @@ -34,7 +34,7 @@ namespace Jpeg2000 // Progression order typedef enum EProgressionOrder { - poUnknown = -1, // Неизвестный порядок + poUnknown = -1, // Unknown order poLRCP = 0, // layer-resolution-component-precinct poRLCP = 1, // resolution-layer-component-precinct poRPCL = 2, // resolution-precinct-component-layer @@ -42,48 +42,48 @@ namespace Jpeg2000 poCPRL = 4 // component-precinct-resolution-layer } ProgressionOrder; - // Поддерживаемые цветовые пространства + // Supported color spaces typedef enum EColorSpace { - csUnknown = -1, // цветовое пространство неопределенно + csUnknown = -1, // color space undefined csRGB = 1, // sRGB csGray = 2, // Grayscale csYUV = 3 // YUV } ColorSpace; - // Поддерживаемые форматы + // Supported formats typedef enum ECodecFormat { - codecUnknown = -1, // неизвестный кодек - codecJ2K = 0, // JPEG-2000 codestream : чтение/запись - codecJPT = 1, // JPT-stream (JPEG 2000, JPIP) : только чтение - codecJP2 = 2, // JPEG-2000 file format (Jp2-wrapper) : чтение/запись + codecUnknown = -1, // unknown codec + codecJ2K = 0, // JPEG-2000 codestream : read/write + codecJPT = 1, // JPT-stream (JPEG 2000, JPIP) : read only + codecJP2 = 2, // JPEG-2000 file format (Jp2-wrapper) : read/write codecMj2 = 3, // Motion JPEG-2000 } CodecFormat; - // Ограничения по декодированию Jpeg2000-Codestream + // Jpeg2000-Codestream decoding limitations typedef enum ELimitDecoding { - declimNoLimitation = 0, // Нет ограничений при декодировании. Декодируем Jpeg2000-codestream полностью - declimLimitToMainHeader = 1 // Декодируем только Main Header + declimNoLimitation = 0, // No decoding limitations. Decode Jpeg2000-codestream completely + declimLimitToMainHeader = 1 // Decode Main Header only } LimitDecoding; //------------------------------------------------------------------------------------------------------------------------------- - // Event (Обработка сообщений) + // Event (Message handling) //------------------------------------------------------------------------------------------------------------------------------- #define EVT_ERROR 1 // Error #define EVT_WARNING 2 // Warning #define EVT_INFO 4 // Debug event -#define MSG_SIZE 512 // Максимальный размер сообщения +#define MSG_SIZE 512 // Maximum message size #define JP2_ERROR_NO_ERROR 0x0000 #define JP2_ERROR_NOT_ENOUGH_MEMORY 0x0001 //------------------------------------------------------------------------------------------------------------------------------- - // Параметры кодека (компрессии/декомпрессии) + // Codec parameters (compression/decompression) //------------------------------------------------------------------------------------------------------------------------------- // Progression order changes (POC) (Annex A.6.6 Table A-32) @@ -99,10 +99,10 @@ namespace Jpeg2000 char sProgOrder[4]; } POC; - // Параметры компрессии + // Compression parameters typedef struct TEncoderParams { - bool bTileSizeOn; // False: размеры тайлов не указаны, true: размеры тайлов указаны + bool bTileSizeOn; // False: tile sizes not specified, true: tile sizes specified int nXTOsiz; // XTOsiz int nYTOsiz; // YTOsiz int nXTsiz; // XTsiz @@ -111,64 +111,64 @@ namespace Jpeg2000 int nFixedAlloc; // allocation by fixed layer int nFixedQuality; // fixed_quality int *pMatrix; // fixed layer - char *sComment; // Комментарий + char *sComment; // Comment int nCodingStyle; // CodingStyle ProgressionOrder eProgOrder; // Progression order (default LRCP) POC aoPOC[32]; // Progression order changes - int nPOCsCount; // Количество progression order changes (POC), default to 0 - int nLayersCount; // Количество лэйеров - float afRates[100]; // Массив норм - float afDistoratio[100]; // Массив искажений - int nResolutionsCount; // Число разрешений(уровней разложения) - int nCodeBlockWidthInit; // Исходная ширина блока (по стандарту 64) - int nCodeBlockHeightInit; // Исходная высота блока (по стандарту 64) + int nPOCsCount; // Number of progression order changes (POC), default to 0 + int nLayersCount; // Number of layers + float afRates[100]; // Rates array + float afDistoratio[100]; // Distortion array + int nResolutionsCount; // Number of resolutions (decomposition levels) + int nCodeBlockWidthInit; // Initial block width (64 by standard) + int nCodeBlockHeightInit; // Initial block height (64 by standard) int nCodeBlockStyle; // CodeBlockStyle - int nTransformId; // 1: необратимое вэйвлет преобразование ( Irreversible DTW ), 0: компрессия без потерь (по стандарту) - int nROIComponentIndex; // Region of interest: затрагиваемые компоненты [0..3], -1 означает, что ROI отсутствует + int nTransformId; // 1: irreversible wavelet transform ( Irreversible DWT ), 0: lossless compression (by standard) + int nROIComponentIndex; // Region of interest: affected components [0..3], -1 means ROI is absent int nROIShift; // Region of interest: shift - int nPrecinctCount; // Количество областей - int anPrecinctWidthInit[J2K_MAXRLVLS]; // Исходные ширины областей - int anPrecinctHeightInit[J2K_MAXRLVLS]; // Исходные высоты областей + int nPrecinctCount; // Number of precincts + int anPrecinctWidthInit[J2K_MAXRLVLS]; // Initial precinct widths + int anPrecinctHeightInit[J2K_MAXRLVLS]; // Initial precinct heights - int nComponentsCount; // Количество компонент в исходном файле - char sInFile[MAX_PATH_LEN]; // Имя исходного файла - char sOutfile[MAX_PATH_LEN]; // Имя результируещего файла - int nIndexOn; // Создаем ли файл с индексайией (по стандарту 0) - char sIndex[MAX_PATH_LEN]; // Файл индексации - int nImageOffsetX0; // Сдиг исходной картинки по Х - int nImageOffsetY0; // Сдиг исходной картинки по Y + int nComponentsCount; // Number of components in source file + char sInFile[MAX_PATH_LEN]; // Source file name + char sOutfile[MAX_PATH_LEN]; // Output file name + int nIndexOn; // Create index file (0 by standard) + char sIndex[MAX_PATH_LEN]; // Index file + int nImageOffsetX0; // Source image offset by X + int nImageOffsetY0; // Source image offset by Y int nSubSamplingDx; // SubSampling X int nSubSamplingDy; // SubSampling Y - int nDecoderFormat; // Формат исходного файла. 0: PGX, 1: PxM, 2: BMP - int nEncoderFormat; // Формат выходного файла. 0: J2K, 1: JP2, 2: JPT + int nDecoderFormat; // Source file format. 0: PGX, 1: PxM, 2: BMP + int nEncoderFormat; // Output file format. 0: J2K, 1: JP2, 2: JPT } EncoderParams; - // Параметры декомпрессии + // Decompression parameters typedef struct TDecoderParams { - int nReduce; // Если != 0, тогда разрешение исходного изображения делится на 2^(nReduce). Если == 0, или не используется, тогда изображение декодируется с полным разрешением. - int nLayer; // Устанавливаем максимальное число лэеров, которые мы будем декодировать. - LimitDecoding eLimitDecoding; // Будем декодировать полностью файл, или только заголовок. + int nReduce; // If != 0, then source image resolution is divided by 2^(nReduce). If == 0, or not used, then image is decoded at full resolution. + int nLayer; // Set maximum number of layers that will be decoded. + LimitDecoding eLimitDecoding; // Decode full file or header only. - char sInFile[MAX_PATH_LEN]; // Имя исходного файла - char sOutfile[MAX_PATH_LEN]; // Имя результируещего файла - int nDecoderFormat; // Формат исходного файла. 0: J2k, 1: Jp2, 2: Jpt - int nEncoderFormat; // Формат выходного файла. 0: PGX, 1: PxM, 2: BMP + char sInFile[MAX_PATH_LEN]; // Source file name + char sOutfile[MAX_PATH_LEN]; // Output file name + int nDecoderFormat; // Source file format. 0: J2k, 1: Jp2, 2: Jpt + int nEncoderFormat; // Output file format. 0: PGX, 1: PxM, 2: BMP } DecoderParams; - // Общие поля для JPEG-2000 компрессии и декомпресии - //EventManager *pEventManager; /* Указатель на обработчик сообщений (events) */\ + // Common fields for JPEG-2000 compression and decompression + //EventManager *pEventManager; /* Pointer to event handler (events) */\ //void *pClientData; /* */\ #define CommonFields \ - bool bIsDecompressor; /* Чтобы узнать компрессия или декомпрессия */\ - ECodecFormat eCodecFormat; /* Выбранный кодек */\ - void *pJ2k; /* Указатель на J2K кодек */\ - void *pJp2; /* Указатель на JP2 кодек */\ - void *pMj2; /* Указатель на JP2 кодек */\ - int nErrorCode /* Номер ошибки */ + bool bIsDecompressor; /* To determine if compression or decompression */\ + ECodecFormat eCodecFormat; /* Selected codec */\ + void *pJ2k; /* Pointer to J2K codec */\ + void *pJp2; /* Pointer to JP2 codec */\ + void *pMj2; /* Pointer to JP2 codec */\ + int nErrorCode /* Error code */ - // Поля, которые исользуются как для чтения, так и для записи + // Fields used for both reading and writing typedef struct TCommonStruct { CommonFields; @@ -176,18 +176,18 @@ namespace Jpeg2000 typedef CommonStruct* PCommon; - // Параметры компрессии + // Compression parameters typedef struct TCInfo { - CommonFields; // Общие поля - // Поля характерные только для компрессии + CommonFields; // Common fields + // Fields specific to compression only } CInfo; - // Параметры декомпрессии + // Decompression parameters typedef struct TDInfo { - CommonFields; // Общие поля - // Поля характерные только для декомпрессии + CommonFields; // Common fields + // Fields specific to decompression only } DInfo; @@ -197,39 +197,39 @@ namespace Jpeg2000 typedef struct TImageComponent { - int nXRsiz; // XRsiz: горизонтальное разделение i-ой компоненты - int nYRsiz; // YRsiz: вертикальное разделение i-ой компоненты - int nWidth; // Ширина картинки - int nHeight; // Высота картинки - int nXOsiz; // Сдвиг компоненты по Х по отношению ко всему изображению - int nYOsiz; // Сдвиг компоненты по У по отношению ко всему изображению + int nXRsiz; // XRsiz: horizontal separation of i-th component + int nYRsiz; // YRsiz: vertical separation of i-th component + int nWidth; // Image width + int nHeight; // Image height + int nXOsiz; // Component offset by X relative to entire image + int nYOsiz; // Component offset by Y relative to entire image int nPrecision; // Precision int nBPP; // Bits Per Pixel int nSigned; // Signed - 1, unsigned - 0 - int nDecodedResCount; // Количество Resolutions в кодированном изображении - int nFactorDiv2; // Количество делений на 2 результирующей картинки, по сравнению с размером исходной - int *pData; // Данные изображения для i-ой компоненты + int nDecodedResCount; // Number of Resolutions in encoded image + int nFactorDiv2; // Number of divisions by 2 of resulting image compared to source size + int *pData; // Image data for i-th component } ImageComponent; typedef struct TImage { - int nXOsiz; // XOsiz: горизонтальный cдвиг от начальной точки всей сетки к области с реальным изображением - int nYOsiz; // YOsiz: вертикальный сдвиг от начальной точки всей сетки к области с реальным изображением - int nXsiz; // Xsiz: ширина сетки - int nYsiz; // Ysiz: высота сетки - int nCsiz; // Csiz: количество компонент в изображении - ColorSpace eColorSpace; // Цветовое пространство: sRGB, Greyscale или YUV - ImageComponent *pComponents; // Компоненты изображения + int nXOsiz; // XOsiz: horizontal offset from grid origin to actual image area + int nYOsiz; // YOsiz: vertical offset from grid origin to actual image area + int nXsiz; // Xsiz: grid width + int nYsiz; // Ysiz: grid height + int nCsiz; // Csiz: number of components in image + ColorSpace eColorSpace; // Color space: sRGB, Greyscale or YUV + ImageComponent *pComponents; // Image components } Image; typedef struct TImageComponentParams { - int nXRsiz; // XRsiz: горизонтальное разделение i-ой компоненты - int nYRsiz; // YRsiz: вертикальное разделение i-ой компоненты - int nWidth; // Ширина - int nHeight; // Высота картинки - int nXoffset; // Сдвиг компоненты по Х по отношению ко всему изображению - int nYoffset; // Сдвиг компоненты по У по отношению ко всему изображению + int nXRsiz; // XRsiz: horizontal separation of i-th component + int nYRsiz; // YRsiz: vertical separation of the i-th component + int nWidth; // Width + int nHeight; // Image height + int nXoffset; // Component X offset relative to the whole image + int nYoffset; // Component Y offset relative to the whole image int nPrecision; // Precision int nBPP; // Bits Per Pixel int nSigned; // Signed - 1, unsigned - 0 @@ -311,21 +311,21 @@ namespace Jpeg2000 //------------------------------------------------------------------------------------------------------------------------------- - // Значения определяющие статус декодирования(когда декодируется Main Header) + // Values defining decoding status (when Main Header is being decoded) typedef enum EJ2kStatus { - j2kstateMHSOC = 0x0001, // SOC маркер - j2kstateMHSIZ = 0x0002, // SIZ маркер - j2kstateMH = 0x0004, // Процесс декодирования находится в Main Header - j2kstateTPHSOT = 0x0008, // Процесс декодирования находится в Tile Part Header, и сейчас читается маркер SOT - j2kstateTPH = 0x0010, // Процесс декодирования находится в Tile Part Header - j2kstateMT = 0x0020, // Только что был прочитан маркер EOC - j2kstateNEOC = 0x0040 // При декодировании не воспринимаем маркер EOC, потому что Сodestream сокращенный + j2kstateMHSOC = 0x0001, // SOC marker + j2kstateMHSIZ = 0x0002, // SIZ marker + j2kstateMH = 0x0004, // Decoding process is in Main Header + j2kstateTPHSOT = 0x0008, // Decoding process is in Tile Part Header, and SOT marker is being read + j2kstateTPH = 0x0010, // Decoding process is in Tile Part Header + j2kstateMT = 0x0020, // EOC marker was just read + j2kstateNEOC = 0x0040 // During decoding we ignore EOC marker because codestream is truncated } J2kStatus; //------------------------------------------------------------------------------------------------------------------------------- - // Размер шага квантования + // Quantization step size typedef struct TQuantStepSize { int nExponent; @@ -340,34 +340,34 @@ namespace Jpeg2000 int nCodeBlockWidth; // Code-block size width int nCodeBlockHeight; // Code-block size height int nCodeBlockStyle; // Code-block context - int nTransformID; // Wavelet-преобразвание - int nQuantStyle; // Тип квантования - QuantStepSize aoStepSizes[J2K_MAXBANDS]; // Размер шага, используемый для квантования + int nTransformID; // Wavelet transform + int nQuantStyle; // Quantization type + QuantStepSize aoStepSizes[J2K_MAXBANDS]; // Step size used for quantization int nGuardBitsCount; // Number of guard bits int nROIShift; // SPrgn: Region Of Interest shift (Table A-25) int anPrecinctWidth[J2K_MAXRLVLS]; // Precinct width int anPrecinctHeight[J2K_MAXRLVLS]; // Precinct height } TileCompCodingParams; - // Tile coding parameters : данная структура используется для хранения параметров кодирования/декодирования одинаковых для всех - // ячеек(tiles) ( подобно информации COD, COC в Main Header ) + // Tile coding parameters : this structure is used to store encoding/decoding parameters common to all + // tiles (similar to COD, COC information in Main Header) typedef struct TTileCodingParams { - int nFirst; // Флаг. 1 : первый part-tile данного tile + int nFirst; // Flag. 1 : first part-tile of this tile int nCodingStyle; // Scod: Coding style (Table A-12) ProgressionOrder eProgOrder; // SPcod, Ppod: Progression order int nLayersCount; // SPcod: Number of layers int nMCT; // SPcod: Multiple component transform - float afRates[100]; // Размеры layers - int nPOCsCount; // Количество POC ( progression order changes ) - int nUsePOC; // Флаг; используем ли маркер POC. 0 - нет, 1 - да. + float afRates[100]; // Layer sizes + int nPOCsCount; // Number of POC (progression order changes) + int nUsePOC; // Flag; whether POC marker is used. 0 - no, 1 - yes. POC aoPOC[32]; // Progression order changes - unsigned char *pPPTData; // Храним указатель на Packet header, чтобы испольщовать его в Tire2 декодировании - unsigned char *pPPTDataFirst; // Указатель на начало первого пакета в PacketHeader, если PPT используется - int nPPT; // Флаг. Если для текущего Tile нашли маркер PPT, тогда флаг равен 1. - int nPPTStore; // Используем, если нашли несколько маркеров PPT (храним их общую длину в байтах здесь) + unsigned char *pPPTData; // Store pointer to Packet header for use in Tier2 decoding + unsigned char *pPPTDataFirst; // Pointer to start of first packet in PacketHeader, if PPT is used + int nPPT; // Flag. If PPT marker was found for current Tile, flag equals 1. + int nPPTStore; // Used if multiple PPT markers were found (store their total length in bytes here) int nPPTLength; // PPM bug 1 - float afDistoRatio[100]; // Добавляем Fixed quality + float afDistoRatio[100]; // Adding Fixed quality TileCompCodingParams *pTCCP; // Tile-component coding parameters } TileCodingParams; @@ -376,94 +376,94 @@ namespace Jpeg2000 { int nDistoAlloc; // allocation by rate/distortion int nFixedAlloc; // allocation by fixed layer - int nFixedQuality; // Добавляем Fixed quality - int nReduceFactor; // Если данное значение отлично от 0, тогда исходное разрешение делим на 2^(nReduceFactor); если равно 0, или не используется, декодируем изображение с полным разрешением - int nLayerFactor; // Если данное значение отлично от 0, тогда декодируем только первый "layer"; если равно 0, или не используется, декодируем все "layers" - LimitDecoding eLimitDecoding; // Ограничения на декодирование. - int nIndexOn; // 0 - нет нумерации, 1 - есть. - int nXTOsiz; // XTOsiz: свдиг по горизонтали первого Tile - int nYTOsiz; // YTOsiz: сдвиг по вертикали первого Tile - int nXTsiz; // XTsiz: ширина одного Tile по отношению к общей сетке - int nYTsiz; // YTsiz: высота одного Tile по отношению к общей сетке - char *sComment; // Комментарий - int nXTilesCount; // Количество Tiles по горизонтали - int nYTilesCount; // Количество Tiles по вертикали - int *pTileIndex; // Порядковые номера Tiles в codestream - int nTileIndexSize; // Размер массива pTileIndex - unsigned char *pPPMData; // Храним указатель на Packet header, чтобы испольщовать его в Tire2 декодировании - unsigned char *pPPMDataFirst; // Указатель на начало первого пакета в PacketHeader, если PPM используется - int nPPM; // Флаг. Если для текущего Tile нашли маркер PPM, тогда флаг равен 1. - int nPPMStore; // Используем, если нашли несколько маркеров PPM (храним их общую длину в байтах здесь) - int nPPMPrevious; // Используем, если нашли несколько маркеров PPM (случай, если предыдущий маркер PPM был еще не закончен) + int nFixedQuality; // Adding Fixed quality + int nReduceFactor; // If this value is not 0, divide original resolution by 2^(nReduceFactor); if 0 or not used, decode image at full resolution + int nLayerFactor; // If this value is not 0, decode only first "layer"; if 0 or not used, decode all "layers" + LimitDecoding eLimitDecoding; // Decoding limitations. + int nIndexOn; // 0 - no indexing, 1 - indexing enabled. + int nXTOsiz; // XTOsiz: horizontal offset of first Tile + int nYTOsiz; // YTOsiz: vertical offset of first Tile + int nXTsiz; // XTsiz: width of one Tile relative to the overall grid + int nYTsiz; // YTsiz: height of one Tile relative to the overall grid + char *sComment; // Comment + int nXTilesCount; // Number of Tiles horizontally + int nYTilesCount; // Number of Tiles vertically + int *pTileIndex; // Sequential numbers of Tiles in codestream + int nTileIndexSize; // Size of pTileIndex array + unsigned char *pPPMData; // Store pointer to Packet header for use in Tier2 decoding + unsigned char *pPPMDataFirst; // Pointer to start of first packet in PacketHeader, if PPM is used + int nPPM; // Flag. If PPM marker was found for current Tile, flag equals 1. + int nPPMStore; // Used if multiple PPM markers were found (store their total length in bytes here) + int nPPMPrevious; // Used if multiple PPM markers were found (case when previous PPM marker was not yet finished) int nPPMLength; // PPM bug 1 TileCodingParams *pTCP; // Tile coding parameters int *pMatrix; // Fixed layer } CodingParams; - // Информация относительно пакета в Tile + // Information about packet in Tile typedef struct TPacketInfo { - int nStartPos; // Начальная позиция - int nEndPos; // Конечная позиция + int nStartPos; // Start position + int nEndPos; // End position double dDisto; } PacketInfo; - // Информация, относящаяся к Tiles внутри изображения + // Information related to Tiles within the image typedef struct TTileInfo { - double *pdThreshold; // Значение порога для каждого layer - int nTileCount; // Общее количество Tiles - int nStartPos; // Начальная позиция - int nEndHeader; // Конечная позиция для заголовка - int nEndPos; // Конечная позиция - int anXPrecinctCount[33]; // Количество областей (precinct) по Х для каждого уровня разрешения (resolution level) - int anYPrecinctCount[33]; // Количество областей (precinct) по Y для каждого уровня разрешения (resolution level) - int anPrecinctWidth[33]; // Ширина области (в степени 2), для какждого уровня разрешения - int anPrecinctHeight[33]; // Высота области (в степени 2), для какждого уровня разрешения + double *pdThreshold; // Threshold value for each layer + int nTileCount; // Total number of Tiles + int nStartPos; // Start position + int nEndHeader; // End position for header + int nEndPos; // End position + int anXPrecinctCount[33]; // Number of precincts along X for each resolution level + int anYPrecinctCount[33]; // Number of precincts along Y for each resolution level + int anPrecinctWidth[33]; // Precinct width (as power of 2), for each resolution level + int anPrecinctHeight[33]; // Precinct height (as power of 2), for each resolution level PacketInfo *pPacket; // PacketInfo - int nNBPix; // Добавляем Fixed Quality - double dDistoTile; // Добавляем Fixed Quality + int nNBPix; // Adding Fixed Quality + double dDistoTile; // Adding Fixed Quality } TileInfo; typedef struct TImageInfo { - int nIndexOn; // 0 - нет нумерации, 1 - есть. - double dDistoMax; // Максимальный уровень сокращения искажений для всего изображения - int nPacketCount; // Количество пакетов + int nIndexOn; // 0 - no indexing, 1 - indexing enabled. + double dDistoMax; // Maximum distortion reduction level for entire image + int nPacketCount; // Number of packets int nIndexWrite; // - int nImageWidth; // Ширина картинки - int nImageHeight; // Высота картинки + int nImageWidth; // Image width + int nImageHeight; // Image height ProgressionOrder eProgOrder; // Progression Order - int nXTsiz; // Размер tile по Х - int nYTsiz; // Размер tile по Y - int nXTOsiz; // Сдвиг первого тайла по Х - int nYTOsiz; // Сдвиг первого тайла по Y - int nXTilesCount; // Количество тайлов по Х - int nYTilesCount; // Количество тайлов по Y - int nCompCount; // Количество компонент - int nLayersCount; // Количество layers - int nDecompCount; // Количество уровней разложения - int nMainHeadEnd; // Позиция окончания Main Header - int nCodestreamSize; // Размер codestream + int nXTsiz; // Tile size by X + int nYTsiz; // Tile size by Y + int nXTOsiz; // First tile offset by X + int nYTOsiz; // First tile offset by Y + int nXTilesCount; // Number of tiles by X + int nYTilesCount; // Number of tiles by Y + int nCompCount; // Number of components + int nLayersCount; // Number of layers + int nDecompCount; // Number of decomposition levels + int nMainHeadEnd; // Main Header end position + int nCodestreamSize; // Codestream size TileInfo *pTile; // TileInfo } ImageInfo; // JPEG-2000 codestream reader/writer typedef struct TJ2kCodestream { - PCommon pCodecInfo; // Общая информация для кодирования и декодирования - int nState; // Здесь хранам текущую позицию декодера Codestream'a ( Main header, Tile header, конец декодирования ) - int nCurTileIndex; // Номер текущего тайла (т.е. который в данный момент кодируется/декодируется) - //unsigned char *pEndOfTile; // Используется для определения позиции конца тайла в codestream (чтобы определить нормальный ли codestream) + PCommon pCodecInfo; // Common info for encoding and decoding + int nState; // Stores current decoder position in Codestream ( Main header, Tile header, end of decoding ) + int nCurTileIndex; // Current tile number (i.e. currently being encoded/decoded) + //unsigned char *pEndOfTile; // Used to determine tile end position in codestream (to check if codestream is valid) int nSizeOfTile; - int nSOTStartPos; // Сохраняем начальную позицию маркера SOT, чтобы после кодирования текущего тайла мы могли вернуться и записать длину данного маркера - int nSODStartPos; // Аналогично, для маркера SOD - int nPosCorrection; // Необходимо для корректировки позиции, поскольку J2k-файл пишется в несколько частей, во время кодирования - unsigned char **ppTileData; // Массив с данными всех тайлов - int *pTileLen; // Массив, хранящий размер данных для каждого тайла - TileCodingParams *pDefaultTCP; // Используется только при декомпрессии: храним общую информацию для всех тайлов ( COD, COC ) - Image *pImage; // Указатель на изображения, которое мы либо кодируем, либо декодируем - CodingParams *pCodingParams; // Указатель на структуру, хранящую информацию о кодировании + int nSOTStartPos; // Save SOT marker start position, so after encoding current tile we can return and write marker length + int nSODStartPos; // Same for SOD marker + int nPosCorrection; // Required for position correction, since J2k file is written in parts during encoding + unsigned char **ppTileData; // Array with data for all tiles + int *pTileLen; // Array storing data size for each tile + TileCodingParams *pDefaultTCP; // Used only for decompression: store common info for all tiles ( COD, COC ) + Image *pImage; // Pointer to image being encoded or decoded + CodingParams *pCodingParams; // Pointer to structure storing encoding info ImageInfo *pImageInfo; // CReader *pStreamIO; // Input / Output stream } J2kCodestream; @@ -492,89 +492,89 @@ namespace Jpeg2000 typedef struct TLayer { - int nPassesCount; // Количество проходов - int nLen; // Длина информации - double dDisto; // Отклонение - unsigned char *pData; // Данные + int nPassesCount; // Number of passes + int nLen; // Information length + double dDisto; // Distortion + unsigned char *pData; // Data } Layer; typedef struct TCodeBlock { - int nX0; // Размеры CodeBlock - int nY0; // (x0, y0) - левый верхний угол - int nX1; // (х1, у1) - правый нижний угол - int nY1; // + int nX0; // CodeBlock dimensions + int nY0; // (x0, y0) - top left corner + int nX1; // (x1, y1) - bottom right corner + int nY1; // int nBPSCount; // int nLenBitsCount; // - int nLen; // Длина - int nPassesCount; // Количество уже завершенных проходов для данного CodeBlock - int nNewPassesCount; // Количество проходов добавленных к данному CodeBlock - int nSegmentsCount; // Количество сегментов - TCDSegment aSegments[100]; // Сами сегменты - unsigned char aData[8192]; // Данные - int nPassesCountInLayers; // Количество проходов в лэйре - Layer aLayers[100]; // Информация о лэйерах - int nTotalPassesCount; // Общее число проходов - TCDPass aPasses[100]; // Информация о проходах + int nLen; // Length + int nPassesCount; // Number of passes already completed for this CodeBlock + int nNewPassesCount; // Number of passes added to this CodeBlock + int nSegmentsCount; // Number of segments + TCDSegment aSegments[100]; // The segments themselves + unsigned char aData[8192]; // Data + int nPassesCountInLayers; // Number of passes in layer + Layer aLayers[100]; // Layer info + int nTotalPassesCount; // Total number of passes + TCDPass aPasses[100]; // Pass info } CodeBlock; typedef struct TPrecinct { - int nX0; // Размеры Precinct - int nY0; // (x0, y0) - левый верхний угол - int nX1; // (х1, у1) - правый нижний угол - int nY1; // - int nCountInWidth; // Количество блоков в ширину - int nCountInHeight; // Количество блоков в высоту + int nX0; // Precinct dimensions + int nY0; // (x0, y0) - top left corner + int nX1; // (x1, y1) - bottom right corner + int nY1; // + int nCountInWidth; // Number of blocks in width + int nCountInHeight; // Number of blocks in height CodeBlock *pCodeBlocks; // CodeBlocks - TagTree *pInclTree; // Дерево включения - TagTree *pIMSBTree; // Дерево IMSB + TagTree *pInclTree; // Inclusion tree + TagTree *pIMSBTree; // IMSB tree } Precinct; typedef struct TBand { - int nX0; // Размеры Band - int nY0; // (x0, y0) - левый верхний угол - int nX1; // (х1, у1) - правый нижний угол - int nY1; // - int nBandIndex; // Номер текущего Band - Precinct *pPrecincts; // Информация о областях(Precinct), входящий в данный Band + int nX0; // Band dimensions + int nY0; // (x0, y0) - top left corner + int nX1; // (x1, y1) - bottom right corner + int nY1; // + int nBandIndex; // Current Band number + Precinct *pPrecincts; // Info about precincts included in this Band int nBPSCount; // float fStepSize; // } Band; typedef struct TResolution { - int nX0; // Размеры Resolution - int nY0; // (x0, y0) - левый верхний угол - int nX1; // (х1, у1) - правый нижний угол - int nY1; // - int nPrecCountW; // Количество областей (Precinct) по ширине - int nPrecCountH; // Количество областей (Precinct) по высоте - int nBandsCount; // Количество Sub-band + int nX0; // Resolution dimensions + int nY0; // (x0, y0) - top left corner + int nX1; // (x1, y1) - bottom right corner + int nY1; // + int nPrecCountW; // Number of precincts by width + int nPrecCountH; // Number of precincts by height + int nBandsCount; // Number of Sub-bands Band aBands[3]; // Sub-bands } Resolution; typedef struct TTileComp { - int nX0; // Размеры TileComp - int nY0; // (x0, y0) - левый верхний угол - int nX1; // (х1, у1) - правый нижний угол - int nY1; // - int nResolutionsCount; // Число разрешений - Resolution *pResolutions; // Разрешения (Resolutions) - int *pData; // Данные компоненты + int nX0; // TileComp dimensions + int nY0; // (x0, y0) - top left corner + int nX1; // (x1, y1) - bottom right corner + int nY1; // + int nResolutionsCount; // Number of resolutions + Resolution *pResolutions; // Resolutions + int *pData; // Component data int nNBPix; // Fixed_quality } TileComp; typedef struct TTile { - int nX0; // Размеры Tile - int nY0; // (x0, y0) - левый верхний угол - int nX1; // (х1, у1) - правый нижний угол - int nY1; // - int nComponentsCount; // Количество компонент - TileComp *pComponents; // Компоненты + int nX0; // Tile dimensions + int nY0; // (x0, y0) - top left corner + int nX1; // (x1, y1) - bottom right corner + int nY1; // + int nComponentsCount; // Number of components + TileComp *pComponents; // Components int nNBPix; // Fixed_quality double dDistoTile; // Fixed_quality double adDistoLayer[100]; // Fixed_quality @@ -582,20 +582,20 @@ namespace Jpeg2000 typedef struct TTCDImage { - int nTilesCountW; // Количество тайлов по ширине - int nTilesCountH; // Количество тайлов по высоте - Tile *pTiles; // Тайлы + int nTilesCountW; // Number of tiles by width + int nTilesCountH; // Number of tiles by height + Tile *pTiles; // Tiles } TCDImage; typedef struct TTCD { - PCommon pCodecInfo; // Информация о кодеке - TCDImage *pTCDImage; // Кодированное Изображение - Image *pImage; // Изображение - CodingParams *pCodingParams; // Параметры - Tile *pTCDTile; // Указатель на текущий кодируемый/декодируемый тайл - TileCodingParams *pTCP; // Параметры кодирования/декодирования для всех тайлов - int nTCDTileIndex; // Номер текущего кодируемого/декодируемого тайла + PCommon pCodecInfo; // Codec info + TCDImage *pTCDImage; // Encoded image + Image *pImage; // Image + CodingParams *pCodingParams; // Parameters + Tile *pTCDTile; // Pointer to currently encoded/decoded tile + TileCodingParams *pTCP; // Encoding/decoding parameters for all tiles + int nTCDTileIndex; // Current encoded/decoded tile number } TCD; //------------------------------------------------------------------------------------------------------------------------------- @@ -642,12 +642,12 @@ namespace Jpeg2000 // Jp2 file format reader/writer typedef struct TJp2Stream { - PCommon pCodecInfo; // Общая информация для кодирования и декодирования - J2kCodestream *pJ2k; // Указатель на структуру для чтения/записи JPEG2000 Codestream + PCommon pCodecInfo; // Common info for encoding and decoding + J2kCodestream *pJ2k; // Pointer to structure for reading/writing JPEG2000 Codestream - unsigned int nWidth; // Ширина изображения - unsigned int nHeight; // Высота изображения - unsigned int nComponentsCount; // Число компонент + unsigned int nWidth; // Image width + unsigned int nHeight; // Image height + unsigned int nComponentsCount; // Number of components unsigned int nBPC; // Bits per component unsigned int nCompressionType; // CompressionType unsigned int nColorSpaceUnk; // Colourspace Unknown @@ -660,7 +660,7 @@ namespace Jpeg2000 unsigned int nBrand; // Brand unsigned int nMinVersion; // MinVersion - unsigned int nCompListLength; // Длина списка Compatibility list + unsigned int nCompListLength; // Compatibility list length unsigned int *pCompList; // Compatibility list Jp2Component *pComponents; @@ -682,16 +682,16 @@ namespace Jpeg2000 // MQ-coder (ArithmeticCoder.h) //------------------------------------------------------------------------------------------------------------------------------- - // См. Annex C. fcd15444-1.pdf ( MQ-coder Encoder/Decoder ) + // See Annex C. fcd15444-1.pdf ( MQ-coder Encoder/Decoder ) #define MQC_NUMCTXS 32 typedef struct TMQCoderState { - unsigned int nLPSValue; // вероятность для наименьшего вероятностного символа (Least Probable Symbol) (0.75->0x8000, 1.5->0xffff) - int nMPS; // наибольший вероятностный символ ( 0 или 1 ) (Most Probable Symbol) - struct TMQCoderState *pNextMPS; // Указатель на следующее состояние, если следующий закодированный символ MPS - struct TMQCoderState *pNextLPS; // Указатель на следующее состояние, если следующий закодированный символ LPS + unsigned int nLPSValue; // probability for Least Probable Symbol (0.75->0x8000, 1.5->0xffff) + int nMPS; // Most Probable Symbol ( 0 or 1 ) + struct TMQCoderState *pNextMPS; // Pointer to next state if next encoded symbol is MPS + struct TMQCoderState *pNextLPS; // Pointer to next state if next encoded symbol is LPS } MQCoderState; // MQ-coder @@ -714,13 +714,13 @@ namespace Jpeg2000 typedef struct TRaw { - unsigned char nBuffer; // Временный буфер, в котором происходит побитовое кодирование/декодирование - unsigned int nFreeBitsCount; // Количество бит, свободных для чтения или записи - unsigned int nMaxLen; // Максимальная длина для декодирования - unsigned int nLen; // Длина декодированной информации - unsigned char *pBufferPointer; // Указатель на текущую позицию в буфере - unsigned char *pBufferStart; // Указатель на начало буфера - unsigned char *pBufferEnd; // Указатель на конец буфера + unsigned char nBuffer; // Temporary buffer for bitwise encoding/decoding + unsigned int nFreeBitsCount; // Number of bits free for reading or writing + unsigned int nMaxLen; // Maximum decoding length + unsigned int nLen; // Decoded information length + unsigned char *pBufferPointer; // Pointer to current buffer position + unsigned char *pBufferStart; // Pointer to buffer start + unsigned char *pBufferEnd; // Pointer to buffer end } Raw; //------------------------------------------------------------------------------------------------------------------------------- @@ -761,24 +761,24 @@ namespace Jpeg2000 typedef struct TPacketIterator { - short int *pInclude; // Флаг, сигнализирующий использовался ли данный пакет (используется в POC) - int nStepLayer; // LayerStep используется для локализации пакета в pInclude - int nStepResolution; // ResoultionStep используется для локализации пакета в pInclude - int nStepComponent; // ComponentStep используется для локализации пакета в pInclude - int nStepPrecinct; // PrecinctStep используется для локализации пакета в pInclude + short int *pInclude; // Flag indicating if this packet was used (used in POC) + int nStepLayer; // LayerStep used to locate packet in pInclude + int nStepResolution; // ResolutionStep used to locate packet in pInclude + int nStepComponent; // ComponentStep used to locate packet in pInclude + int nStepPrecinct; // PrecinctStep used to locate packet in pInclude - int nIndexComponent; // Номер компоненты для определения пакета - int nIndexResolution; // Номер уровня детализации для определения пакета - int nIndexPrecinct; // Номер области для определения пакета - int nIndexLayer; // Номер лэйера для определения пакета + int nIndexComponent; // Component number for packet identification + int nIndexResolution; // Resolution level number for packet identification + int nIndexPrecinct; // Precinct number for packet identification + int nIndexLayer; // Layer number for packet identification - int nFirst; // Флаг, определяющий первый ли это пакет + int nFirst; // Flag indicating if this is the first packet POC oPOC; // Progression Order Change - int nComponentsCount; // Число компонент + int nComponentsCount; // Number of components PacketComponent *pComponents; int nTileX0; // - int nTileY0; // Границы текущего тайла + int nTileY0; // Current tile boundaries int nTileX1; // int nTileY1; // int nX; @@ -788,22 +788,22 @@ namespace Jpeg2000 } PacketIterator; //------------------------------------------------------------------------------------------------------------------------------- - // Tier-1 coding (кодирование коэффициентов) + // Tier-1 coding (coefficient encoding) //------------------------------------------------------------------------------------------------------------------------------- #define T1_NMSEDEC_BITS 7 -#define T1_MAXCBLKW 1024 // Максимальный размер CodeBlock (по ширине) -#define T1_MAXCBLKH 1024 // Максимальный размер CodeBlock (по высоте) +#define T1_MAXCBLKW 1024 // Maximum CodeBlock size (width) +#define T1_MAXCBLKH 1024 // Maximum CodeBlock size (height) -#define T1_SIG_NE 0x0001 // Ориентация контекста : Северо-восточное направление -#define T1_SIG_SE 0x0002 // Ориентация контекста : юго-восточное направление -#define T1_SIG_SW 0x0004 // Ориентация контекста : юго-западное направление -#define T1_SIG_NW 0x0008 // Ориентация контекста : северо-западное направление -#define T1_SIG_N 0x0010 // Ориентация контекста : северное направление -#define T1_SIG_E 0x0020 // Ориентация контекста : восточное направление -#define T1_SIG_S 0x0040 // Ориентация контекста : южное направление -#define T1_SIG_W 0x0080 // Ориентация контекста : западное направление +#define T1_SIG_NE 0x0001 // Context orientation: Northeast direction +#define T1_SIG_SE 0x0002 // Context orientation: Southeast direction +#define T1_SIG_SW 0x0004 // Context orientation: Southwest direction +#define T1_SIG_NW 0x0008 // Context orientation: Northwest direction +#define T1_SIG_N 0x0010 // Context orientation: North direction +#define T1_SIG_E 0x0020 // Context orientation: East direction +#define T1_SIG_S 0x0040 // Context orientation: South direction +#define T1_SIG_W 0x0080 // Context orientation: West direction #define T1_SIG_OTH (T1_SIG_N|T1_SIG_NE|T1_SIG_E|T1_SIG_SE|T1_SIG_S|T1_SIG_SW|T1_SIG_W|T1_SIG_NW) #define T1_SIG_PRIM (T1_SIG_N|T1_SIG_E|T1_SIG_S|T1_SIG_W) @@ -832,16 +832,16 @@ namespace Jpeg2000 #define T1_NMSEDEC_FRACBITS (T1_NMSEDEC_BITS - 1) -#define T1_TYPE_MQ 0 // Нормальное кодирование, с использованием Arithmetic entropy coding (Annex C) -#define T1_TYPE_RAW 1 // Нет никакого кодирования, информация в Codestream содержится в сыром виде +#define T1_TYPE_MQ 0 // Normal encoding using Arithmetic entropy coding (Annex C) +#define T1_TYPE_RAW 1 // No encoding, information in Codestream is in raw form //------------------------------------------------------------------------------------------------------------------------------- typedef struct TTier1 { - PCommon pCodecInfo; // Информация о кодеке - MQCoder *pMQCoder; // Указатель на структуру для чтения/записи MQ-кодированных данных - Raw *pRaw; // Указатель на структуру для чтения/записи некодированных данных + PCommon pCodecInfo; // Codec info + MQCoder *pMQCoder; // Pointer to structure for reading/writing MQ-encoded data + Raw *pRaw; // Pointer to structure for reading/writing unencoded data int lut_ctxno_zc[1024]; int lut_ctxno_sc[256]; @@ -852,8 +852,8 @@ namespace Jpeg2000 int lut_nmsedec_ref[1 << T1_NMSEDEC_BITS]; int lut_nmsedec_ref0[1 << T1_NMSEDEC_BITS]; - int aData[T1_MAXCBLKH][T1_MAXCBLKW]; // Данные codeblock - int aFlags[T1_MAXCBLKH + 2][T1_MAXCBLKH + 2]; // Флаги + int aData[T1_MAXCBLKH][T1_MAXCBLKW]; // Codeblock data + int aFlags[T1_MAXCBLKH + 2][T1_MAXCBLKH + 2]; // Flags } Tier1; @@ -864,7 +864,7 @@ namespace Jpeg2000 typedef struct TTier2 { PCommon pCodecInfo; - Image *pImage; // Encoding: указатель на исходную картинку. Decoding: указатель на результирующую картинку. + Image *pImage; // Encoding: pointer to source image. Decoding: pointer to result image. CodingParams *pCodingParams; } Tier2; @@ -1085,11 +1085,11 @@ namespace Jpeg2000 typedef struct TBitIO { - unsigned char *pStart; // Указатель на начало буфера - unsigned char *pEnd; // Указатель на конец буфера - unsigned char *pCurPos; // Указатель на текущую позицию в буфере - unsigned int nBuffer; // Буфер - int nValidBitsCount; // Coder : число свободных бит для записи - // Decoder : число доступных бит для чтения + unsigned char *pStart; // Pointer to buffer start + unsigned char *pEnd; // Pointer to buffer end + unsigned char *pCurPos; // Pointer to current buffer position + unsigned int nBuffer; // Buffer + int nValidBitsCount; // Coder: number of free bits for writing + // Decoder: number of available bits for reading } BitIO; } diff --git a/DesktopEditor/raster/Jp2/Utils.h b/DesktopEditor/raster/Jp2/Utils.h index 8644f3178d..d14c6922c1 100644 --- a/DesktopEditor/raster/Jp2/Utils.h +++ b/DesktopEditor/raster/Jp2/Utils.h @@ -7,9 +7,9 @@ namespace Jpeg2000 return 0; // LARGE_INTEGER oFreq, oTime; - //// oFreq - скорость часов у CPU + //// oFreq - CPU clock speed // QueryPerformanceFrequency( &oFreq ); - // // oTime - текущее время(в смысле oFreq) + // // oTime - current time (in terms of oFreq) // QueryPerformanceCounter ( &oTime ) ; // return ( oTime.QuadPart /(double) oFreq.QuadPart ) ; } @@ -30,25 +30,25 @@ namespace Jpeg2000 return nValue; } - // Делим nA на nB и округляем в большую сторону + // Divide nA by nB and round up static __inline int CeilDiv(int nA, int nB) { return (nA + nB - 1) / nB; } - // Делим nA на 2^nB и округляем в большую сторону + // Divide nA by 2^nB and round up static __inline int CeilDivPow2(int nA, int nB) { return (nA + (1 << nB) - 1) >> nB; } - // Делим nA на 2^nB и округляем в меньшую сторону + // Divide nA by 2^nB and round down static __inline int FloorDivPow2(int nA, int nB) { return nA >> nB; } - // Берем логарифм по основанию 2 от числа nA и округляем в меньшую сторону + // Take base-2 logarithm of nA and round down static __inline int FloorLog2(int nA) { int nL; @@ -67,7 +67,7 @@ namespace Jpeg2000 static const double c_adNormRCT[3] ={ 1.732, .8292, .8292 }; static const double c_adNormICT[3] ={ 1.732, 1.805, 1.573 }; - // Применяем обратимое много-компонентное преобразование к изображению (Annex G.2.1) + // Apply reversible multi-component transform to image (Annex G.2.1) static void ForwardRCT(int *pRed, int *pGreen, int *pBlue, int nSamplesCount) { for (int nIndex = 0; nIndex < nSamplesCount; nIndex++) @@ -85,7 +85,7 @@ namespace Jpeg2000 } } - // Применяем обратимое много-компонентное обратное преобазование к изображению (Annex G.2.2) + // Apply reversible multi-component inverse transform to image (Annex G.2.2) static void InverseRCT(int *pRed, int *pGreen, int *pBlue, int nSamplesCount) { for (int nIndex = 0; nIndex < nSamplesCount; nIndex++) @@ -109,7 +109,7 @@ namespace Jpeg2000 return c_adNormRCT[nComponentIndex]; } - // Применяем необратимое много-компонентное преобразование к изображению (Annex G.3.1) + // Apply irreversible multi-component transform to image (Annex G.3.1) static void ForwardICT(int *pRed, int *pGreen, int *pBlue, int nSamplesCount) { for (int nIndex = 0; nIndex < nSamplesCount; nIndex++) @@ -127,7 +127,7 @@ namespace Jpeg2000 } } - // Применяем необратимое много-компонентное обратное преобазование к изображению (Annex G.3.2) + // Apply irreversible multi-component inverse transform to image (Annex G.3.2) static void InverseICT(int *pRed, int *pGreen, int *pBlue, int nSamplesCount) { for (int nIndex = 0; nIndex < nSamplesCount; nIndex++) diff --git a/DesktopEditor/raster/Metafile/CXmlOutput.cpp b/DesktopEditor/raster/Metafile/CXmlOutput.cpp index 38f98fbb42..5905f22e4a 100644 --- a/DesktopEditor/raster/Metafile/CXmlOutput.cpp +++ b/DesktopEditor/raster/Metafile/CXmlOutput.cpp @@ -805,7 +805,7 @@ namespace MetaFile *this >> oTEmfAlphaBlend.nYDest; *this >> oTEmfAlphaBlend.nCxDest; *this >> oTEmfAlphaBlend.nCyDest; - //TODO: закончить реализацию при встрече примера + //TODO: finish implementation when example is encountered } diff --git a/DesktopEditor/raster/Metafile/CXmlOutput.h b/DesktopEditor/raster/Metafile/CXmlOutput.h index 2a8689f108..cea7196c00 100644 --- a/DesktopEditor/raster/Metafile/CXmlOutput.h +++ b/DesktopEditor/raster/Metafile/CXmlOutput.h @@ -28,7 +28,7 @@ namespace MetaFile bool IsEmptyNode() const; bool MoveToStart(); - // Запись в Xml файл + // Write to Xml file void WriteString(const std::wstring& wsValue); @@ -118,7 +118,7 @@ namespace MetaFile void WriteNode(const std::wstring& wsNameNode, const unsigned int* pUnValues, const unsigned int& unSize); - // Чтение из Xml файла + // Read from Xml file public: bool ReadFromFile(const std::wstring &wsPathToFile); diff --git a/DesktopEditor/raster/Metafile/Common/IOutputDevice.h b/DesktopEditor/raster/Metafile/Common/IOutputDevice.h index 2e501df386..6cb0d1c200 100644 --- a/DesktopEditor/raster/Metafile/Common/IOutputDevice.h +++ b/DesktopEditor/raster/Metafile/Common/IOutputDevice.h @@ -45,11 +45,11 @@ namespace MetaFile IOutputDevice() {} virtual ~IOutputDevice() {} - // Начало и окончание работы устройства + // Device start and end operations virtual void Begin() = 0; virtual void End() = 0; - // pBuffer - BGRA картинка размерами ulWidth, ulHeight, которую надо нарисовать в заданном ректе + // pBuffer - BGRA image with dimensions ulWidth, ulHeight that needs to be drawn in the specified rect virtual void DrawBitmap(double dX, double dY, double dW, double dH, BYTE* pBuffer, unsigned int unWidth, unsigned int unHeight, unsigned int nBlendMode) = 0; virtual void DrawString(std::wstring& wsText, unsigned int unCharsCount, double dX, double dY, double* pDx, diff --git a/DesktopEditor/raster/Metafile/Common/MetaFile.h b/DesktopEditor/raster/Metafile/Common/MetaFile.h index 4e0d19f671..6637361026 100644 --- a/DesktopEditor/raster/Metafile/Common/MetaFile.h +++ b/DesktopEditor/raster/Metafile/Common/MetaFile.h @@ -55,7 +55,7 @@ namespace MetaFile } virtual void PlayMetaFile() = 0; - virtual void ClearFile() {/*Нельзя делать чисто виртуальной, потому что вызывается в деструкторе*/} + virtual void ClearFile() {/*Cannot be pure virtual because it is called in destructor*/} virtual const TRectL& GetDCBounds() const = 0; virtual const CClip* GetClip() const = 0; virtual double GetPixelHeight() const = 0; diff --git a/DesktopEditor/raster/Metafile/Common/MetaFileRenderer.h b/DesktopEditor/raster/Metafile/Common/MetaFileRenderer.h index 7f8458fc89..ce172d8c95 100644 --- a/DesktopEditor/raster/Metafile/Common/MetaFileRenderer.h +++ b/DesktopEditor/raster/Metafile/Common/MetaFileRenderer.h @@ -66,12 +66,12 @@ namespace MetaFile IMetaFileBase* m_pFile; int m_lDrawPathType; - double m_dX; // Координаты левого верхнего угла + double m_dX; // Upper left corner coordinates double m_dY; // double m_dW; // double m_dH; // - double m_dScaleX; // Коэффициенты сжатия/растяжения, чтобы - double m_dScaleY; // результирующая картинка была нужных размеров. + double m_dScaleX; // Compression/stretch coefficients to make + double m_dScaleY; // the resulting image the required size. bool m_bStartedPath; }; @@ -433,7 +433,7 @@ namespace MetaFile { if (NULL != pDx && wsString.length()) { - // Тогда мы складываем все pDx кроме последнего символа, последний считаем отдельно + // Then we sum all pDx except the last character, the last one is calculated separately double dTempTextW = 0; for (unsigned int unCharIndex = 0; unCharIndex < wsString.length() - 1; unCharIndex++) { @@ -477,7 +477,7 @@ namespace MetaFile if (NULL != pDx && unCharsCount > 1) { - // Тогда мы складываем все pDx кроме последнего символа, последний считаем отдельно + // Then we sum all pDx except the last character, the last one is calculated separately double dTempTextW = 0; for (unsigned int unCharIndex = 0; unCharIndex < unCharsCount - 1; unCharIndex++) { @@ -504,7 +504,7 @@ namespace MetaFile fW = (float)dMmToPt * (oBox.fMaxX - oBox.fMinX); } - // Просчитаем положение подчеркивания + // Calculate underline position pFontManager->GetUnderline(&fUndX1, &fUndY1, &fUndX2, &fUndY2, &fUndSize); fUndY1 *= (float)dMmToPt; fUndY2 *= (float)dMmToPt; @@ -523,7 +523,7 @@ namespace MetaFile dSkipY += dLogicalFontHeight * m_dScaleY * 1.5; - // Найдем начальную точку текста + // Find text starting point unsigned int ulTextAlign = m_pFile->GetTextAlign() & TA_MASK; unsigned int ulVTextAlign = m_pFile->GetTextAlign() >> 8; @@ -535,7 +535,7 @@ namespace MetaFile if (ulTextAlign & TA_BASELINE) { ulTextAlign -= TA_BASELINE; - // Ничего не делаем + // Do nothing } else if (ulTextAlign & TA_BOTTOM || ulVTextAlign == VTA_BOTTOM) { @@ -574,7 +574,7 @@ namespace MetaFile } else //if (ulTextAlign & TA_LEFT) { - // Ничего не делаем + // Do nothing } if (pFont->IsUnderline()) @@ -626,7 +626,7 @@ namespace MetaFile if (0 != pFont->GetEscapement()) { - // TODO: тут реализован только параметр shEscapement, еще нужно реализовать параметр Orientation + // TODO: only shEscapement parameter is implemented here, Orientation parameter still needs to be implemented m_pRenderer->GetTransform(&dM11, &dM12, &dM21, &dM22, &dRx, &dRy); double dOldX = dX; @@ -642,7 +642,7 @@ namespace MetaFile bChangeCTM = true; } - // Для начала нарисуем фон текста + // First draw text background if (OPAQUE == m_pFile->GetTextBgMode()) { m_pRenderer->put_BrushType(c_BrushTypeSolid); @@ -660,7 +660,7 @@ namespace MetaFile m_pRenderer->PathCommandEnd(); } - // Нарисуем подчеркивание + // Draw underline if (pFont->IsUnderline()) { m_pRenderer->put_PenSize((double)fUndSize); @@ -676,7 +676,7 @@ namespace MetaFile m_pRenderer->PathCommandEnd(); } - // Установим цвет текста + // Set text color m_pRenderer->put_BrushType(c_BrushTypeSolid); m_pRenderer->put_BrushColor1(m_pFile->GetTextColor()); m_pRenderer->put_BrushAlpha1(255); @@ -684,7 +684,7 @@ namespace MetaFile if (bUseGID) m_pRenderer->put_FontStringGID(TRUE); - // Рисуем сам текст + // Draw the text itself if (NULL == pDx) m_pRenderer->CommandDrawText(wsString, dX, dY, 0, 0); else @@ -1082,7 +1082,7 @@ namespace MetaFile default: break; } - // TODO: Непонятно почему, но в Hatch все цвета идут не как RGB, а как BGR + // TODO: Unclear why, but in Hatch all colors are BGR, not RGB if (TRANSPARENT == m_pFile->GetTextBgMode()) m_pRenderer->put_BrushAlpha2(0); else @@ -1226,7 +1226,7 @@ namespace MetaFile double dWidth = pPen->GetWidth(); - // Повторение кода из Graphics для вычисления минимальной ширины пера + // Code duplication from Graphics for calculating minimum pen width double dM11, dM12, dM21, dM22, dDx, dDy; m_pRenderer->GetTransform(&dM11, &dM12, &dM21, &dM22, &dDx, &dDy); @@ -1235,8 +1235,8 @@ namespace MetaFile oMatrix.SetElements(dM11, dM12, dM21, dM22, dDx, dDy); oMatrix.Scale(1. / m_dScaleX, 1. / m_dScaleY); - // Вычисление минимально возможной ширины пера - // # Код явялется дублированным из Graphics + // Calculation of minimum possible pen width + // # Code is duplicated from Graphics const double dSqrtDet = sqrt(fabs(oMatrix.Determinant())); const double dWidthMinSize = (dSqrtDet != 0) ? (1.0 / dSqrtDet) : dWidth; @@ -1344,9 +1344,9 @@ namespace MetaFile m_pRenderer->put_PenAlpha(pPen->GetAlpha()); m_pRenderer->put_PenMiterLimit(dMiterLimit); - // TO DO: С текущим интерфейсом AVSRenderer, остальные случаи ushROPMode - // реализовать невозможно. Потому что данный параметр нужно протаскивать - // как параметр Pen'a, и тот кто рисует сам должен разруливать все случаи. + // TO DO: With the current AVSRenderer interface, other ushROPMode cases + // cannot be implemented. Because this parameter needs to be passed + // as a Pen parameter, and the one who draws must handle all cases. switch (m_pFile->GetRop2Mode()) { @@ -1364,12 +1364,12 @@ namespace MetaFile IRenderer* m_pRenderer; IMetaFileBase* m_pFile; int m_lDrawPathType; - double m_dX; // Координаты левого верхнего угла + double m_dX; // Upper left corner coordinates double m_dY; // double m_dW; // double m_dH; // - double m_dScaleX; // Коэффициенты сжатия/растяжения, чтобы - double m_dScaleY; // результирующая картинка была нужных размеров. + double m_dScaleX; // Compression/stretch coefficients to make + double m_dScaleY; // the resulting image the required size. bool m_bStartedPath; bool m_bUpdatedClip; diff --git a/DesktopEditor/raster/Metafile/Common/MetaFileTypes.cpp b/DesktopEditor/raster/Metafile/Common/MetaFileTypes.cpp index 697c9440ff..7f3bdf68ef 100644 --- a/DesktopEditor/raster/Metafile/Common/MetaFileTypes.cpp +++ b/DesktopEditor/raster/Metafile/Common/MetaFileTypes.cpp @@ -156,7 +156,7 @@ namespace MetaFile Init(); else if (MWT_LEFTMULTIPLY == ulMode) { - // oOther слева, текущая матрица справа + // oOther on the left, current matrix on the right double dM11 = oOther.M11 * M11 + oOther.M12 * M21; double dM12 = oOther.M11 * M12 + oOther.M12 * M22; double dM21 = oOther.M21 * M11 + oOther.M22 * M21; @@ -174,7 +174,7 @@ namespace MetaFile } else if (MWT_RIGHTMULTIPLY == ulMode) { - // oOther справа, текущая матрица слева + // oOther on the right, current matrix on the left double dM11 = M11 * oOther.M11 + M12 * oOther.M21; double dM12 = M11 * oOther.M12 + M12 * oOther.M22; double dM21 = M21 * oOther.M11 + M22 * oOther.M21; diff --git a/DesktopEditor/raster/Metafile/Common/MetaFileUtils.cpp b/DesktopEditor/raster/Metafile/Common/MetaFileUtils.cpp index fae53cff48..d019f659c4 100644 --- a/DesktopEditor/raster/Metafile/Common/MetaFileUtils.cpp +++ b/DesktopEditor/raster/Metafile/Common/MetaFileUtils.cpp @@ -66,7 +66,7 @@ namespace MetaFile ulBit = ulBit << 1; unOffset++; - // ограничиваемся 32-битами + // limit to 32 bits if (ulBit & 0x80000000) return 0; } @@ -141,7 +141,7 @@ namespace MetaFile *pulWidth = 0; *pulHeight = 0; - if (BI_BITCOUNT_0 == ushBitCount) // Значит компрессия либо PNG, либо JPEG + if (BI_BITCOUNT_0 == ushBitCount) // Means compression is either PNG or JPEG { if (BI_JPEG != unCompression || BI_PNG != unCompression) return false; @@ -164,13 +164,13 @@ namespace MetaFile CBgraFrame oFrame; oFrame.OpenFile(wsTempFileName); - // TODO: Как будут файлы сделать чтение. + // TODO: Implement reading when files are available. NSFile::CFileBinary::Remove(wsTempFileName); return false; } else if (BI_BITCOUNT_1 == ushBitCount) { - // Двуцветная картинка, значит палитра состоит из 2-х цветов + // Two-color image, so palette consists of 2 colors TRgbQuad oColor1, oColor2; if (oHeaderStream.CanRead() >= 8) @@ -183,7 +183,7 @@ namespace MetaFile oColor2.r = oColor2.g = oColor2.b = 255; } - // Считываем саму картинку + // Read the image itself int lCalcLen = (((nWidth * ushPlanes * ushBitCount + 31) & ~31) / 8) * abs(nHeight); if (lCalcLen > lBufLen) return false; @@ -218,7 +218,7 @@ namespace MetaFile int nAlpha = 255; if (nX == nWidthBytes - 1) { - // Не до конца заполненный байт иногда заполняется странным цветом, поэтому мы делаем его прозрачным + // Partially filled byte is sometimes filled with wrong color, so we make it transparent nBitCount = nLastBitCount; nAlpha = 0; } @@ -254,7 +254,7 @@ namespace MetaFile int nAlpha = 255; if (nX == nWidthBytes - 1) { - // Не до конца заполненный байт иногда заполняется странным цветом, поэтому мы делаем его прозрачным + // Partially filled byte is sometimes filled with wrong color, so we make it transparent nBitCount = nLastBitCount; //nAlpha = 0; } @@ -295,20 +295,20 @@ namespace MetaFile if (oHeaderStream.CanRead() < unColorTableLen * 4) return false; - // Считываем палитру + // Read palette for (unsigned short ushIndex = 0; ushIndex < unColorTableLen; ushIndex++) { oHeaderStream >> oColorTable[ushIndex]; } - // 4 бита - 1 пиксел + // 4 bits - 1 pixel - // Считываем саму картинку + // Read the image itself int lCalcLen = (((nWidth * ushPlanes * ushBitCount + 31) & ~31) / 8) * abs(nHeight); if (lCalcLen != lBufLen) return false; - // Ширина в байтах должна быть кратна 4, значит сама ширина должна быть кратна 8 + // Width in bytes must be divisible by 4, so width itself must be divisible by 8 int nAdd = 0; while (0 != div_t(div(nWidth + nAdd, 8)).rem) { @@ -412,14 +412,14 @@ namespace MetaFile if (oHeaderStream.CanRead() < ushColorTableLen * 4) return false; - // Считываем палитру + // Read palette for (unsigned short ushIndex = 0; ushIndex < ushColorTableLen; ushIndex++) { oHeaderStream >> oColorTable[ushIndex]; } - // 1 байт - 1 пиксел - // Ширина должна быть кратна 4. + // 1 byte - 1 pixel + // Width must be divisible by 4. int nAdd = 0; while (0 != div_t(div(nWidth + nAdd, 4)).rem) { @@ -561,7 +561,7 @@ namespace MetaFile if (BI_RGB == unCompression) { - // Маски, сдвиги и коэффициенты уже заполнены стандартными значениями для масок + // Masks, shifts and coefficients are already filled with default values for masks // 000000000011111 - Red // 000001111100000 - Green // 111110000000000 - Blue @@ -583,13 +583,13 @@ namespace MetaFile else return false; - // Считываем саму картинку + // Read the image itself int lCalcLen = (((nWidth * ushPlanes * ushBitCount + 31) & ~31) / 8) * abs(nHeight); if (lCalcLen != lBufLen) return false; - // 2 байт на все каналы канал - // (Ширина * 3) должна быть кратна 4. + // 2 bytes for all channels + // (Width * 3) must be divisible by 4. int nAdd = 0; while (0 != div_t(div(2 * nWidth + nAdd, 4)).rem) { @@ -656,15 +656,15 @@ namespace MetaFile else if (BI_BITCOUNT_5 == ushBitCount) { if (BI_RGB != unCompression) - return false; // TODO: Сделать данный вариант, как только будет файлы с данным типом + return false; // TODO: Implement this option when files with this type are available - // Считываем саму картинку + // Read the image itself int lCalcLen = (((nWidth * ushPlanes * ushBitCount + 31) & ~31) / 8) * abs(nHeight); if (lCalcLen != lBufLen) return false; - // 1 байт на каждый канал - // (Ширина * 3) должна быть кратна 4. + // 1 byte per channel + // (Width * 3) must be divisible by 4. int nAdd = 0; while (0 != div_t(div(3 * nWidth + nAdd, 4)).rem) { @@ -722,7 +722,7 @@ namespace MetaFile if (BI_RGB == unCompression) { - // Маски, сдвиги и коэффициенты уже заполнены стандартными значениями для масок + // Masks, shifts and coefficients are already filled with standard values for masks } else if (BI_BITFIELDS == unCompression) { @@ -736,13 +736,13 @@ namespace MetaFile else return false; - // Считываем саму картинку + // Read the image itself int lCalcLen = (((nWidth * ushPlanes * ushBitCount + 31) & ~31) / 8) * abs(nHeight); if (lCalcLen != lBufLen) return false; - // 1 байт на каждый канал - // Ширина должна быть кратна 4. + // 1 byte per channel + // Width must be divisible by 4. int nAdd = 0; while (0 != div_t(div(nWidth + nAdd, 4)).rem) { @@ -767,7 +767,7 @@ namespace MetaFile pBgraBuffer[nIndex + 0] = pBuffer[0]; pBuffer++; lBufLen--; pBgraBuffer[nIndex + 1] = pBuffer[0]; pBuffer++; lBufLen--; pBgraBuffer[nIndex + 2] = pBuffer[0]; pBuffer++; lBufLen--; - pBgraBuffer[nIndex + 3] = pBuffer[0]; pBuffer++; lBufLen--; // Если брать значение из картинки, тогда она получается всегда прозрачной + pBgraBuffer[nIndex + 3] = pBuffer[0]; pBuffer++; lBufLen--; // If taking value from image, it always becomes transparent } for (int nX = nWidth; nX < nWidth + nAdd; nX++) { @@ -791,7 +791,7 @@ namespace MetaFile pBgraBuffer[nIndex + 0] = pBuffer[0]; pBuffer++; lBufLen--; pBgraBuffer[nIndex + 1] = pBuffer[0]; pBuffer++; lBufLen--; pBgraBuffer[nIndex + 2] = pBuffer[0]; pBuffer++; lBufLen--; - pBgraBuffer[nIndex + 3] = pBuffer[0]; pBuffer++; lBufLen--; // Если брать значение из картинки, тогда она получается всегда прозрачной + pBgraBuffer[nIndex + 3] = pBuffer[0]; pBuffer++; lBufLen--; // If taking value from image, it always becomes transparent } for (int nX = nWidth; nX < nWidth + nAdd; nX++) @@ -824,7 +824,7 @@ namespace MetaFile CDataStream oHeaderStream; oHeaderStream.SetStream(pHeaderBuffer, ulHeaderBufferLen); - // Считываем заголовок + // Read header unsigned int ulHeaderSize; oHeaderStream >> ulHeaderSize; @@ -843,7 +843,7 @@ namespace MetaFile CDataStream oHeaderStream; oHeaderStream.SetStream(pImageBuffer, unBufferLen); - // Считываем заголовок + // Read header unsigned int unHeaderSize; oHeaderStream >> unHeaderSize; @@ -900,7 +900,7 @@ namespace MetaFile } else { - // TODO: реализовать другие типы цветов + // TODO: implement other color types } } } @@ -909,7 +909,7 @@ namespace MetaFile double dX0 = (nL + nR) / 2.0; double dY0 = (nT + nB) / 2.0; - // Определим квадрант + // Determine quadrant int nQuarter = -1; if (nX >= dX0) { @@ -946,7 +946,7 @@ namespace MetaFile if (NULL == pBgra) return; - // Для битовых операций SRCPAINT и SRCAND сделаем, как будто фон чисто белый. + // For SRCPAINT and SRCAND bit operations, assume the background is pure white. if (0x008800C6 == unRasterOperation) // SRCPAINT { BYTE* pCur = pBgra; @@ -975,7 +975,7 @@ namespace MetaFile } } } - //Точная копия картинки, поэтому делаем alpha канал = 0xff, чтобы нейтрализовать его + // Exact copy of the image, so we set alpha channel = 0xff to neutralize it else if (0x00CC0020 == unRasterOperation) //SRCCOPY { for (unsigned int unIndex = 3; unIndex < unWidth * 4 * unHeight; unIndex += 4) @@ -1093,7 +1093,7 @@ namespace MetaFile { NSStringExt::CConverter::ESingleByteEncoding eCharSet = NSStringExt::CConverter::ESingleByteEncoding::SINGLE_BYTE_ENCODING_DEFAULT;; - // Соответствие Charset -> Codepage: http://support.microsoft.com/kb/165478 + // Charset -> Codepage mapping: http://support.microsoft.com/kb/165478 // http://msdn.microsoft.com/en-us/library/cc194829.aspx // Charset Name Charset Value(hex) Codepage number // ------------------------------------------------------ diff --git a/DesktopEditor/raster/Metafile/Common/MetaFileUtils.h b/DesktopEditor/raster/Metafile/Common/MetaFileUtils.h index 9306fbae1d..de81b67b1d 100644 --- a/DesktopEditor/raster/Metafile/Common/MetaFileUtils.h +++ b/DesktopEditor/raster/Metafile/Common/MetaFileUtils.h @@ -358,7 +358,7 @@ namespace MetaFile *this >> oText.unIGraphicsMode; *this >> oText.dExScale; *this >> oText.dEyScale; - ReadEmrText(oText.oEmrText, 36); // 8 + 28 (8 - тип и размер, 28 - размер данной структуры) + ReadEmrText(oText.oEmrText, 36); // 8 + 28 (8 - type and size, 28 - size of this structure) return *this; } @@ -600,7 +600,7 @@ namespace MetaFile for (unsigned int unIndex = 0; unIndex < oText.unCStrings; unIndex++) { unsigned int nCurPos = Tell(); - ReadEmrText(oText.arEmrText[unIndex], nCurPos - nStartPos + 36); // 8 + 28 (8 - тип и размер, 28 - размер данной структуры) + ReadEmrText(oText.arEmrText[unIndex], nCurPos - nStartPos + 36); // 8 + 28 (8 - type and size, 28 - size of this structure) } } else @@ -869,7 +869,7 @@ namespace MetaFile *this >> pFont->uchQuality; *this >> pFont->uchPitchAndFamily; - // Читаем до тех пор пока не встретим нулевой символ + // Read until we encounter a null character unsigned char unIndex = 0; *this >> pFont->uchFacename[unIndex]; while (0x00 != pFont->uchFacename[unIndex]) @@ -939,7 +939,7 @@ namespace MetaFile *this >> oScan.ushTop; *this >> oScan.ushBottom; - if (oScan.ushCount > 0 && !(oScan.ushCount & 1)) // Должно делиться на 2 + if (oScan.ushCount > 0 && !(oScan.ushCount & 1)) // Must be divisible by 2 { unsigned short ushCount = oScan.ushCount >> 1; oScan.pScanLines = new TWmfScanLine[ushCount]; @@ -1127,14 +1127,14 @@ namespace MetaFile { *this >> oText; - // Читаем OutputString + // Read OutputString oText.unChars = std::min(oText.unChars, (UINT)(CanRead() / sizeof(T))); if (0 == oText.unChars) return; if (oText.unOffString - 40 > unOffset) - Skip(oText.unOffString - (unOffset + 40)); // 40 - размер структуры TEmfEmrText + Skip(oText.unOffString - (unOffset + 40)); // 40 - TEmfEmrText structure size T* pString = new T[oText.unChars + 1]; if (pString) @@ -1144,7 +1144,7 @@ namespace MetaFile oText.pOutputString = pString; } - // Читаем OutputDx + // Read OutputDx if (oText.unChars < (UINT32_MAX / 2) && (oText.unOffDx > oText.unOffString) && (oText.unOffDx - oText.unOffString > 2 * oText.unChars)) Skip(oText.unOffDx - oText.unOffString - 2 * oText.unChars); diff --git a/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretator.cpp b/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretator.cpp index 867c94c94d..a014edb240 100644 --- a/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretator.cpp +++ b/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretator.cpp @@ -506,7 +506,7 @@ namespace MetaFile m_pOutStream->WriteFile((BYTE*)&unExplicitRecordSize, sizeof (int)); m_pOutStream->WriteFile((BYTE*)&unPenIndex, sizeof (unsigned int)); - //Заполняем нулями некоторые поля, так как не используем + // Fill some fields with zeros since we don't use them unsigned int unZero = 0; m_pOutStream->WriteFile((BYTE*)&unExplicitRecordSize, sizeof (unsigned int)); // offBmi m_pOutStream->WriteFile((BYTE*)&unZero, sizeof (unsigned int)); // cbBmi diff --git a/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretator.h b/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretator.h index 233150e119..22461a8ed5 100644 --- a/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretator.h +++ b/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretator.h @@ -101,7 +101,7 @@ namespace MetaFile void HANDLE_EMR_POLYPOLYGON(const TRectL& oBounds, const std::vector<std::vector<TPointS>>& arPoints) override; void HANDLE_EMR_POLYPOLYLINE(const TRectL& oBounds, const std::vector<std::vector<TPointL>>& arPoints) override; void HANDLE_EMR_POLYPOLYLINE(const TRectL& oBounds, const std::vector<std::vector<TPointS>>& arPoints) override; - //TODO: Реализовать сохранение полигонов в полигоне + // TODO: Implement saving polygons within a polygon void HANDLE_EMR_RECTANGLE(const TRectL& oBox) override ; void HANDLE_EMR_ROUNDRECT(const TRectL& oBox, const TSizeL& oCorner) override ; void HANDLE_EMR_SETPIXELV(const TPointL& oPoint, const TRGBA& oColor) override ; @@ -211,7 +211,7 @@ namespace MetaFile void WriteString (const unsigned short arshString[], const unsigned int& unSize); void WriteFloat (const float& fValue); public: - //Следующие методы ничего не делают + // The following methods do nothing void Begin() override {}; void End() override {}; diff --git a/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretatorArray.h b/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretatorArray.h index fd112ab559..595f95ad5f 100644 --- a/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretatorArray.h +++ b/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretatorArray.h @@ -139,7 +139,7 @@ namespace MetaFile void HANDLE_EMR_POLYPOLYGON(const TRectL& oBounds, const std::vector<std::vector<TPointS>>& arPoints) override; void HANDLE_EMR_POLYPOLYLINE(const TRectL& oBounds, const std::vector<std::vector<TPointL>>& arPoints) override; void HANDLE_EMR_POLYPOLYLINE(const TRectL& oBounds, const std::vector<std::vector<TPointS>>& arPoints) override; - //TODO: Реализовать сохранение полигонов в полигоне + //TODO: Implement saving polygons within a polygon void HANDLE_EMR_RECTANGLE(const TRectL& oBox) override; void HANDLE_EMR_ROUNDRECT(const TRectL& oBox, const TSizeL& oCorner) override; void HANDLE_EMR_SETPIXELV(const TPointL& oPoint, const TRGBA& oColor) override; diff --git a/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretatorBase.h b/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretatorBase.h index ec0d527104..f78e8ef57e 100644 --- a/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretatorBase.h +++ b/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretatorBase.h @@ -93,7 +93,7 @@ namespace MetaFile virtual void HANDLE_EMR_POLYPOLYGON(const TRectL&, const std::vector<std::vector<TPointS>>&) = 0; virtual void HANDLE_EMR_POLYPOLYLINE(const TRectL&, const std::vector<std::vector<TPointL>>&) = 0; virtual void HANDLE_EMR_POLYPOLYLINE(const TRectL&, const std::vector<std::vector<TPointS>>&) = 0; - //TODO: Реализовать сохранение полигонов в полигоне + // TODO: Implement saving polygons within a polygon virtual void HANDLE_EMR_RECTANGLE(const TRectL&) = 0; virtual void HANDLE_EMR_ROUNDRECT(const TRectL&, const TSizeL&) = 0; virtual void HANDLE_EMR_SETPIXELV(const TPointL&, const TRGBA&) = 0; diff --git a/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretatorRender.h b/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretatorRender.h index 2fa72ca71b..1bf2e37cf4 100644 --- a/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretatorRender.h +++ b/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretatorRender.h @@ -54,7 +54,7 @@ namespace MetaFile CMetaFileRenderer *m_pMetaFileRenderer; public: - //Следующие методы ничего не делают + // The following methods do nothing void HANDLE_EMR_HEADER(const TEmfHeader& oTEmfHeader) override {}; void HANDLE_EMR_ALPHABLEND(const TEmfAlphaBlend& oTEmfAlphaBlend, CDataStream &oDataStream) override {}; void HANDLE_EMR_STRETCHDIBITS(const TEmfStretchDIBITS& oTEmfStretchDIBITS, CDataStream &oDataStream) override {}; @@ -134,7 +134,7 @@ namespace MetaFile void HANDLE_EMR_POLYPOLYGON(const TRectL& oBounds, const std::vector<std::vector<TPointS>>& arPoints) override {}; void HANDLE_EMR_POLYPOLYLINE(const TRectL& oBounds, const std::vector<std::vector<TPointL>>& arPoints) override {}; void HANDLE_EMR_POLYPOLYLINE(const TRectL& oBounds, const std::vector<std::vector<TPointS>>& arPoints) override {}; - //TODO: Реализовать сохранение полигонов в полигоне + //TODO: Implement saving polygons in polygon void HANDLE_EMR_RECTANGLE(const TRectL& oBox) override {}; void HANDLE_EMR_ROUNDRECT(const TRectL& oBox, const TSizeL& oCorner) override {}; void HANDLE_EMR_SETPIXELV(const TPointL& oPoint, const TRGBA& oColor) override {}; diff --git a/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretatorSvg.cpp b/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretatorSvg.cpp index d33f165bce..ab764e2e13 100644 --- a/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretatorSvg.cpp +++ b/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretatorSvg.cpp @@ -317,7 +317,7 @@ namespace MetaFile void CEmfInterpretatorSvg::HANDLE_EMR_CHORD(const TRectL &oBox, const TPointL &oStart, const TPointL &oEnd) { - //TODO:: реализовать + // TODO: implement } void CEmfInterpretatorSvg::HANDLE_EMR_ELLIPSE(const TRectL &oBox) @@ -1327,7 +1327,7 @@ namespace MetaFile void CEmfInterpretatorSvg::HANDLE_EMFPLUS_DRAWPIE(short shOgjectIndex, double dStartAngle, double dSweepAngle, const TEmfPlusRectF &oRect) { - //TODO: Реализовать при встрече + // TODO: Implement when encountered } void CEmfInterpretatorSvg::HANDLE_EMFPLUS_DRAWRECTS(short shOgjectIndex, const std::vector<TEmfPlusRectF> &arRects) diff --git a/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretatorSvg.h b/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretatorSvg.h index ec4481a595..b8f16886f1 100644 --- a/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretatorSvg.h +++ b/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretatorSvg.h @@ -105,7 +105,7 @@ namespace MetaFile void HANDLE_EMR_POLYPOLYGON(const TRectL& oBounds, const std::vector<std::vector<TPointS>>& arPoints) override; void HANDLE_EMR_POLYPOLYLINE(const TRectL& oBounds, const std::vector<std::vector<TPointL>>& arPoints) override; void HANDLE_EMR_POLYPOLYLINE(const TRectL& oBounds, const std::vector<std::vector<TPointS>>& arPoints) override; - //TODO: Реализовать сохранение полигонов в полигоне + //TODO: Implement saving polygons within a polygon void HANDLE_EMR_RECTANGLE(const TRectL& oBox) override ; void HANDLE_EMR_ROUNDRECT(const TRectL& oBox, const TSizeL& oCorner) override ; void HANDLE_EMR_SETPIXELV(const TPointL& oPoint, const TRGBA& oColor) override ; @@ -197,7 +197,7 @@ namespace MetaFile public: void DrawBitmap(double dX, double dY, double dW, double dH, BYTE* pBuffer, unsigned int unWidth, unsigned int unHeight, unsigned int unBlendMode) override; - //Следующие методы ничего не делают + // The following methods do nothing void Begin() override {}; void End() override {}; diff --git a/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretatorXml.h b/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretatorXml.h index adfe75eea0..dc5b2bbd0d 100644 --- a/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretatorXml.h +++ b/DesktopEditor/raster/Metafile/Emf/EmfInterpretator/CEmfInterpretatorXml.h @@ -115,7 +115,7 @@ namespace MetaFile void HANDLE_EMR_POLYPOLYGON(const TRectL& oBounds, const std::vector<std::vector<TPointS>>& arPoints) override; void HANDLE_EMR_POLYPOLYLINE(const TRectL& oBounds, const std::vector<std::vector<TPointL>>& arPoints) override; void HANDLE_EMR_POLYPOLYLINE(const TRectL& oBounds, const std::vector<std::vector<TPointS>>& arPoints) override; - //TODO: Реализовать сохранение полигонов в полигоне + // TODO: Implement saving polygons within a polygon void HANDLE_EMR_RECTANGLE(const TRectL& oBox) override ; void HANDLE_EMR_ROUNDRECT(const TRectL& oBox, const TSizeL& oCorner) override ; void HANDLE_EMR_SETPIXELV(const TPointL& oPoint, const TRGBA& oColor) override ; @@ -211,7 +211,7 @@ namespace MetaFile public: void Begin() override; void End() override; - //Следующие методы ничего не делают + // The following methods do nothing void DrawBitmap(double dX, double dY, double dW, double dH, BYTE* pBuffer, unsigned int unWidth, unsigned int unHeight, unsigned int unBlendMode) override {}; diff --git a/DesktopEditor/raster/Metafile/Emf/EmfObjects.cpp b/DesktopEditor/raster/Metafile/Emf/EmfObjects.cpp index cd1518e567..cb363d1d49 100644 --- a/DesktopEditor/raster/Metafile/Emf/EmfObjects.cpp +++ b/DesktopEditor/raster/Metafile/Emf/EmfObjects.cpp @@ -77,8 +77,8 @@ namespace MetaFile return; #ifdef METAFILE_DISABLE_FILESYSTEM - // без использования файловой системы пока реализовать не получится при конвертации в растр, - // так как на данный момент картинку кисти передать в рендер можно только с помощью использования файловой системы + // without using the file system, it's not yet possible to implement raster conversion, + // since currently the brush image can only be passed to the renderer using the file system // (CMetaFileRenderer::UpdateBrush()) m_pRenderer->put_BrushTexturePath(pBrush->GetDibPatterPath()); #else std::wstring wsTempFileName = GetTempFilename(); diff --git a/DesktopEditor/raster/Metafile/Emf/EmfParser/CEmfParser.cpp b/DesktopEditor/raster/Metafile/Emf/EmfParser/CEmfParser.cpp index 87f3cc6df3..11a35aa0ce 100644 --- a/DesktopEditor/raster/Metafile/Emf/EmfParser/CEmfParser.cpp +++ b/DesktopEditor/raster/Metafile/Emf/EmfParser/CEmfParser.cpp @@ -353,7 +353,7 @@ namespace MetaFile case EMR_GDICOMMENT: Read_EMR_COMMENT(); break; //----------------------------------------------------------- - // Неизвестные записи + // Unknown records //----------------------------------------------------------- default: { @@ -427,7 +427,7 @@ namespace MetaFile if (ulHeaderSize <= 0 || ulBitsSize <= 0 || lHeaderOffset < 0 || lBitsOffset < 0) { - // TODO: Если попали сюда, значит надо смотреть BitBltRasterOperation + // TODO: If we got here, need to check BitBltRasterOperation if (lHeaderOffset > 0) m_oStream.Skip(lHeaderOffset); @@ -722,7 +722,7 @@ namespace MetaFile pPen->pStyleEntry = NULL; } - // Пропускаем часть с картинкой, если она была + // Skip the image part if it was present m_oStream.Skip(current_size); if (!BanEMFProcesses()) @@ -973,7 +973,7 @@ namespace MetaFile void CEmfParser::Read_EMR_EXCLUDECLIPRECT() { - // TODO: Проверить как найдется файл + // TODO: Check when file is found TRectL oClip; m_oStream >> oClip; @@ -1072,7 +1072,7 @@ namespace MetaFile void CEmfParser::Read_EMR_ANGLEARC() { - // TODO: Как найдутся файлы проверить данную запись. + // TODO: Check this record when files are found. TPointL oCenter; unsigned int unRadius; double dStartAngle, dSweepAngle; @@ -1096,11 +1096,11 @@ namespace MetaFile dStartAngle = GetEllipseAngle(oBox.Left, oBox.Top, oBox.Right, oBox.Bottom, oStart.X, oStart.Y); dSweepAngle = GetEllipseAngle(oBox.Left, oBox.Top, oBox.Right, oBox.Bottom, oEnd.X, oEnd.Y) - dStartAngle; - // TODO: Проверить здесь + // TODO: Check here if (dSweepAngle < 0.001) dSweepAngle += 360; - // TODO: Проверить здесь + // TODO: Check here if (AD_COUNTERCLOCKWISE != m_pDC->GetArcDirection()) { dSweepAngle = dSweepAngle - 360; @@ -1121,7 +1121,7 @@ namespace MetaFile void CEmfParser::Read_EMR_ARCTO() { - // TODO: Как найдутся файлы проверить данную запись. + // TODO: Check this record when files are found. TRectL oBox; TPointL oStart, oEnd; double dStartAngle, dSweep; @@ -1134,7 +1134,7 @@ namespace MetaFile void CEmfParser::Read_EMR_CHORD() { - // TODO: Как найдутся файлы проверить данную запись. + // TODO: Check this record when files are found. TRectL oBox; TPointL oStart, oEnd; double dStartAngle, dSweep; @@ -1157,7 +1157,7 @@ namespace MetaFile void CEmfParser::Read_EMR_EXTTEXTOUTA() { - // TODO: Как найдутся файлы проверить данную запись. + // TODO: Check this record when files are found. TEmfExtTextoutA oText; m_oStream >> oText; @@ -1188,7 +1188,7 @@ namespace MetaFile void CEmfParser::Read_EMR_PIE() { - // TODO: Как найдутся файлы проверить данную запись. + // TODO: Check this record when files are found. TRectL oBox; TPointL oStart, oEnd; double dStartAngle, dSweep; @@ -1281,8 +1281,8 @@ namespace MetaFile template<typename T>void CEmfParser::Read_EMR_POLYDRAW_BASE() { - // TODO: Как найдутся файлы проверить данную запись. - //bug #35006 - не прочитывается весь рекорд ... выравнивание? + // TODO: Check this record when files are found. + // bug #35006 - not all record is read ... alignment? TRectL oBounds; unsigned int unCount; @@ -1464,7 +1464,7 @@ namespace MetaFile unsigned int ulNumberOfPolylines; unsigned int ulTotalPointsCount; - //TODO: сделать сохранение в XML + // TODO: implement XML saving m_oStream >> oBounds; m_oStream >> ulNumberOfPolylines; @@ -1498,10 +1498,10 @@ namespace MetaFile void CEmfParser::Read_EMR_POLYTEXTOUTA() { - // TODO: Как найдутся файлы проверить данную запись. + // TODO: Check this record when files are found. TPolyTextoutA oText; - //TODO: сделать сохранение в XML + // TODO: implement XML saving m_oStream >> oText; @@ -1522,10 +1522,10 @@ namespace MetaFile void CEmfParser::Read_EMR_POLYTEXTOUTW() { - // TODO: Как найдутся файлы проверить данную запись. + // TODO: Check this record when files are found. TPolyTextoutW oText; - //TODO: сделать сохранение в XML + // TODO: implement XML saving m_oStream >> oText; if (0 == oText.unCStrings) diff --git a/DesktopEditor/raster/Metafile/Emf/EmfParser/CEmfParserBase.cpp b/DesktopEditor/raster/Metafile/Emf/EmfParser/CEmfParserBase.cpp index 6e431115b1..7609e3d0d6 100644 --- a/DesktopEditor/raster/Metafile/Emf/EmfParser/CEmfParserBase.cpp +++ b/DesktopEditor/raster/Metafile/Emf/EmfParser/CEmfParserBase.cpp @@ -100,7 +100,7 @@ namespace MetaFile BYTE* pBgraBuffer = NULL; unsigned int ulWidth, ulHeight; - // sizeof использовать нельзя, т.к. мы используем double в структуре TEmfBitBlt, а читаем его 4-байтовым + // Can't use sizeof because we use double in TEmfBitBlt structure but read it as 4-byte unsigned int unEmfBitBltRecordSize = 100; // sizeof(TEmfBitBlt) + 8 if (ReadImage(oTEmfBitBlt.unOffBmiSrc, oTEmfBitBlt.unCbBmiSrc, @@ -115,7 +115,7 @@ namespace MetaFile { if (0x00000042 == oTEmfBitBlt.unBitBltRasterOperation) // BLACKNESS { - // Делаем все черным цветом + // Make everything black pBgraBuffer = new BYTE[4]; pBgraBuffer[0] = 0x00; pBgraBuffer[1] = 0x00; @@ -127,7 +127,7 @@ namespace MetaFile } if (0x00FF0062 == oTEmfBitBlt.unBitBltRasterOperation) // WHITENESS { - // Делаем все черным цветом + // Make everything black pBgraBuffer = new BYTE[4]; pBgraBuffer[0] = 0xff; pBgraBuffer[1] = 0xff; @@ -144,7 +144,7 @@ namespace MetaFile CEmfLogBrushEx* pBrush = (CEmfLogBrushEx*)m_pDC->GetBrush(); if (pBrush) { - // Делаем цветом кисти + // Make with brush color pBgraBuffer = new BYTE[4]; pBgraBuffer[0] = pBrush->oColor.b; pBgraBuffer[1] = pBrush->oColor.g; @@ -174,7 +174,7 @@ namespace MetaFile oTEmfSetDiBitsToDevice.unOffBitsSrc, oTEmfSetDiBitsToDevice.unCbBitsSrc, sizeof(TEmfSetDiBitsToDevice) + 8, &pBgraBuffer, &ulWidth, &ulHeight)) { - // TODO: Нужно реализовать обрезку картинки по параметрам oBitmap.iStartScan и oBitmap.cScans + // TODO: Need to implement image cropping by oBitmap.iStartScan and oBitmap.cScans parameters DrawImage(oTEmfSetDiBitsToDevice.oBounds.Left, oTEmfSetDiBitsToDevice.oBounds.Top, oTEmfSetDiBitsToDevice.oBounds.Right - oTEmfSetDiBitsToDevice.oBounds.Left, oTEmfSetDiBitsToDevice.oBounds.Bottom - oTEmfSetDiBitsToDevice.oBounds.Top, @@ -190,7 +190,7 @@ namespace MetaFile BYTE* pBgraBuffer = NULL; unsigned int ulWidth, ulHeight; - unsigned int unSkip = 108; // sizeof(TEmfStretchBLT) + 8 неправильно считает, из-з TXForm, там double, а в Emf они по 4 байта + unsigned int unSkip = 108; // sizeof(TEmfStretchBLT) + 8 calculates incorrectly because of TXForm - it has double but in Emf they are 4 bytes if (ReadImage(oTEmfStretchBLT.unOffBmiSrc, oTEmfStretchBLT.unCbBmiSrc, oTEmfStretchBLT.unOffBitsSrc, oTEmfStretchBLT.unCbBitsSrc, unSkip, &pBgraBuffer, &ulWidth, &ulHeight)) @@ -392,7 +392,7 @@ namespace MetaFile m_pInterpretator->ArcTo(dL, dT, dR, dB, dStart, dSweep); } - // Пересчет текущей позиции делается в каждой функции отдельно после вызова данной + // Current position recalculation is done in each function separately after calling this one } void CEmfParserBase::DrawPath(bool bStroke, bool bFill, bool bEndPath) @@ -473,7 +473,7 @@ namespace MetaFile { pDx[unIndex] = oText.pOutputDx[unIndex]; - // Пропускаем сдвиги по Y если они есть + // Skip Y offsets if present if (oText.unOptions & ETO_PDY) unIndex++; } @@ -497,7 +497,7 @@ namespace MetaFile int* pDx = NULL; if (oText.pOutputDx && oText.unChars && oText.unChars == wsText.length()) { - // Здесь мы эмулируем конвертацию Utf16 в Utf32, чтобы правильно получить массив pDx + // Here we emulate Utf16 to Utf32 conversion to correctly get pDx array pDx = new int[oText.unChars]; unLen = 0; @@ -514,7 +514,7 @@ namespace MetaFile } else if (wLeading >= 0xDC00) { - // Такого не должно быть + // This should not happen continue; } else @@ -523,7 +523,7 @@ namespace MetaFile wTrailing = pUtf16[unPos++]; if (wTrailing < 0xDC00 || wTrailing > 0xDFFF) { - // Такого не должно быть + // This should not happen continue; } else @@ -531,12 +531,12 @@ namespace MetaFile pDx[unLen++] = oText.pOutputDx[unPos - 2] + oText.pOutputDx[unPos - 1]; } - // Пропускаем сдвиги по Y если они есть + // Skip Y offsets if present if (oText.unOptions & ETO_PDY) unPos++; } - // Пропускаем сдвиги по Y если они есть + // Skip Y offsets if present if (oText.unOptions & ETO_PDY) unPos++; } @@ -842,7 +842,7 @@ namespace MetaFile if (ENHMETA_SIGNATURE != m_oHeader.ulSignature || 0x00010000 != m_oHeader.ulVersion) return SetError(); - // Пропускаем остальную часть заголовка, т.к. она нас пока не интересует + // Skip the rest of the header since we don't need it for now unsigned int ulRemaining = m_ulRecordSize - 80; // sizeof(TEmfHeader) m_oStream.Skip(ulRemaining); @@ -859,7 +859,7 @@ namespace MetaFile int nR = (int)floor(dW + 0.5) + nL; int nB = (int)floor(dH + 0.5) + nT; - // По логике мы должны получать рект, точно такой же как и oBounds, но есть файлы, где это не так. + // Logically we should get a rect exactly like oBounds, but there are files where this is not the case. m_oHeader.oFrameToBounds.Left = nL; m_oHeader.oFrameToBounds.Right = nR; m_oHeader.oFrameToBounds.Top = nT; @@ -1071,7 +1071,7 @@ namespace MetaFile if (!m_pPath) SetError(); - // Иногда MoveTo идет до BeginPath + // Sometimes MoveTo comes before BeginPath TPointL oPoint = m_pDC->GetCurPos(); double dX, dY; TranslatePoint(oPoint, dX, dY); @@ -1082,7 +1082,7 @@ namespace MetaFile { if (NULL != m_pInterpretator) m_pInterpretator->HANDLE_EMR_ENDPATH(); - // Ничего не делаем + // Do nothing } void CEmfParserBase::HANDLE_EMR_CLOSEFIGURE() @@ -1101,12 +1101,12 @@ namespace MetaFile { if (NULL != m_pInterpretator) m_pInterpretator->HANDLE_EMR_FLATTENPATH(); - // Ничего не делаем + // Do nothing } void CEmfParserBase::HANDLE_EMR_WIDENPATH() { - // TODO: реализовать + // TODO: implement if (NULL != m_pInterpretator) m_pInterpretator->HANDLE_EMR_WIDENPATH(); } @@ -1137,7 +1137,7 @@ namespace MetaFile m_pInterpretator->HANDLE_EMR_SETARCDIRECTION(unDirection); m_pDC->SetArcDirection(unDirection); - // Здесь не обновляем DC у Output, т.к. этот параметр разруливается внутри данного класса. + // Don't update DC in Output here since this parameter is handled inside this class. } void CEmfParserBase::HANDLE_EMR_FILLPATH(TRectL &oBounds) @@ -1287,8 +1287,8 @@ namespace MetaFile { TRectD oClipRect, oBB; - // Поскольку мы реализовываем данный тип клипа с помощью разницы внешнего ректа и заданного, и - // пересечением с полученной областью, то нам надо вычесть границу заданного ректа. + // Since we implement this clip type using difference between outer rect and given one, + // and intersection with obtained area, we need to subtract the boundary of given rect. if (oClip.Left < oClip.Right) { oClip.Left--; @@ -1327,8 +1327,8 @@ namespace MetaFile void CEmfParserBase::HANDLE_EMR_EXTSELECTCLIPRGN(unsigned int &unRgnDataSize, unsigned int &unRegionMode) { - // Тут просто сбрасываем текущий клип. Ничего не добавляем в клип, т.е. реализовать регионы с - // текущим интерфейсом рендерера невозможно. + // Here we just reset current clip. Don't add anything to clip, i.e. implementing regions + // with current renderer interface is impossible. m_pDC->GetClip()->Reset(); if (NULL != m_pInterpretator) @@ -1374,7 +1374,7 @@ namespace MetaFile void CEmfParserBase::HANDLE_EMR_REALIZEPALETTE() { - // TODO: Реализовать + // TODO: Implement if (NULL != m_pInterpretator) m_pInterpretator->HANDLE_EMR_REALIZEPALETTE(); } @@ -1395,14 +1395,14 @@ namespace MetaFile { if (NULL != m_pInterpretator) m_pInterpretator->HANDLE_EMR_SETLAYOUT(unLayoutMode); - // TODO: реализовать + // TODO: implement } void CEmfParserBase::HANDLE_EMR_SETBRUSHORGEX(TPointL &oOrigin) { if (NULL != m_pInterpretator) m_pInterpretator->HANDLE_EMR_SETBRUSHORGEX(oOrigin); - // TODO: реализовать + // TODO: implement } void CEmfParserBase::HANDLE_EMR_ANGLEARC(TPointL &oCenter, unsigned int &unRadius, double &dStartAngle, double &dSweepAngle) @@ -1422,17 +1422,17 @@ namespace MetaFile double dStartAngle = GetEllipseAngle(oBox.Left, oBox.Top, oBox.Right, oBox.Bottom, oStart.X, oStart.Y); double dSweepAngle = GetEllipseAngle(oBox.Left, oBox.Top, oBox.Right, oBox.Bottom, oEnd.X, oEnd.Y) - dStartAngle; - // TODO: Проверить здесь + // TODO: Check here // if (dSweepAngle < 0.001) // dSweepAngle += 360; - // TODO: Проверить здесь + // TODO: Check here if (AD_COUNTERCLOCKWISE != m_pDC->GetArcDirection()) { dSweepAngle = dSweepAngle - 360; } - oBox.Update(IsViewportFlippedX(), IsViewportFlippedY()); // Если ширина отрицательная, то не нарисуется + oBox.Update(IsViewportFlippedX(), IsViewportFlippedY()); // Won't draw if width is negative TPointL oStartDraw = GetStartPointForArc(oBox, dStartAngle); @@ -1449,7 +1449,7 @@ namespace MetaFile double dStartAngle = GetEllipseAngle(oBox.Left, oBox.Top, oBox.Right, oBox.Bottom, oStart.X, oStart.Y); double dSweepAngle = GetEllipseAngle(oBox.Left, oBox.Top, oBox.Right, oBox.Bottom, oEnd.X, oEnd.Y) - dStartAngle; - oBox.Update(IsViewportFlippedX(), IsViewportFlippedY()); // Если ширина отрицательная, то не нарисуется + oBox.Update(IsViewportFlippedX(), IsViewportFlippedY()); // Won't draw if width is negative ArcTo(oBox.Left, oBox.Top, oBox.Right, oBox.Bottom, dStartAngle, dSweepAngle); DrawPath(true, false); @@ -1476,7 +1476,7 @@ namespace MetaFile if (NULL != m_pInterpretator && (NULL == m_pPath || Svg != m_pInterpretator->GetType())) m_pInterpretator->HANDLE_EMR_ELLIPSE(oBox); - oBox.Update(IsViewportFlippedX(), IsViewportFlippedY()); // Если ширина отрицательная, то не нарисуется + oBox.Update(IsViewportFlippedX(), IsViewportFlippedY()); // Won't draw if width is negative if (m_pDC->GetArcDirection() == AD_COUNTERCLOCKWISE) ArcTo(oBox.Left, oBox.Top, oBox.Right, oBox.Bottom, 0, 360); @@ -1605,7 +1605,7 @@ namespace MetaFile if (NULL != m_pInterpretator) m_pInterpretator->HANDLE_EMR_SETPIXELV(oPoint, oColor); - // Делаем цветом кисти + // Make with brush color BYTE pBgraBuffer[4]; pBgraBuffer[0] = oColor.b; pBgraBuffer[1] = oColor.g; @@ -1620,7 +1620,7 @@ namespace MetaFile if (NULL != m_pInterpretator) m_pInterpretator->HANDLE_EMR_SMALLTEXTOUT(oText); - // Переводим oText в TEmfEmrText + // Convert oText to TEmfEmrText TEmrTextW oEmrText; oEmrText.unChars = oText.unCChars; @@ -1632,7 +1632,7 @@ namespace MetaFile oEmrText.oReference.Y = oText.nY; oEmrText.pOutputDx = NULL; - // Запись не документированна нормально, остается несколько байт в конце, непонятно почему. + // Record is not properly documented, a few bytes remain at the end, unclear why. unsigned int unSize = oText.GetSize(); if (m_ulRecordSize - unSize > 0) m_oStream.Skip(m_ulRecordSize - unSize); @@ -1641,8 +1641,8 @@ namespace MetaFile DrawTextW(oEmrText, oText.unIGraphicsMode); - // Поскольку мы просто скопировали ссылку на строку, а не скопировали сами строку обнуляем здесь, потому - // что на деструкторе структуры освобождается память. + // Since we just copied string reference not the string itself, null it here because + // memory is freed in structure destructor. oEmrText.pOutputString = NULL; } @@ -1781,7 +1781,7 @@ namespace MetaFile if (NULL != m_pInterpretator) m_pInterpretator->HANDLE_EMR_FRAMERGN(oBounds, unIhBrush, nWidth, nHeight, oRegionDataHeader, arRects); - //TODO: реализовать + // TODO: implement } void CEmfParserBase::HANDLE_EMR_POLYBEZIER(TRectL &oBounds, std::vector<TPointL> &arPoints) diff --git a/DesktopEditor/raster/Metafile/Emf/EmfParser/CEmfParserBase.h b/DesktopEditor/raster/Metafile/Emf/EmfParser/CEmfParserBase.h index 4fc97d1d6d..b9ac582c66 100644 --- a/DesktopEditor/raster/Metafile/Emf/EmfParser/CEmfParserBase.h +++ b/DesktopEditor/raster/Metafile/Emf/EmfParser/CEmfParserBase.h @@ -121,7 +121,7 @@ namespace MetaFile const TRectL& GetBounds() const; CPath* GetPath(); private: - //Работа с изображениями + // Image processing void ImageProcessing(const TEmfAlphaBlend &oTEmfAlphaBlend); void ImageProcessing(const TEmfStretchDIBITS &oTEmfStretchDIBITS); void ImageProcessing(const TEmfBitBlt &oTEmfBitBlt); @@ -408,7 +408,7 @@ namespace MetaFile if (NULL != m_pInterpretator && (NULL == m_pPath || Svg != m_pInterpretator->GetType())) m_pInterpretator->HANDLE_EMR_POLYPOLYLINE(oBounds, arPoints); } - //TODO: Реализовать сохранение полигонов в полигоне + //TODO: Implement saving polygons in polygon void HANDLE_EMR_RECTANGLE(TRectL& oBox); void HANDLE_EMR_ROUNDRECT(TRectL& oBox, TSizeL& oCorner); void HANDLE_EMR_SETPIXELV(TPointL& oPoint, TRGBA& oColor); diff --git a/DesktopEditor/raster/Metafile/Emf/EmfParser/CEmfPlusParser.cpp b/DesktopEditor/raster/Metafile/Emf/EmfParser/CEmfPlusParser.cpp index 82bb9280d2..3941f89c40 100644 --- a/DesktopEditor/raster/Metafile/Emf/EmfParser/CEmfPlusParser.cpp +++ b/DesktopEditor/raster/Metafile/Emf/EmfParser/CEmfPlusParser.cpp @@ -266,22 +266,22 @@ namespace MetaFile switch (unShType) { - //Clipping Record Types (Типы записей отсечения) + //Clipping Record Types case EMRPLUS_OFFSETCLIP: Read_EMRPLUS_OFFSETCLIP(); break; case EMRPLUS_RESETCLIP: Read_EMRPLUS_RESETCLIP(); break; case EMFPLUS_SETCLIPPATH: Read_EMFPLUS_SETCLIPPATH(unShFlags); break; case EMFPLUS_SETCLIPRECT: Read_EMFPLUS_SETCLIPRECT(unShFlags); break; case EMFPLUS_SETCLIPREGION: Read_EMFPLUS_SETCLIPREGION(unShFlags); break; - //Comment Record Types (Типы записей комментариев) + //Comment Record Types case EMFPLUS_COMMENT: Read_EMFPLUS_COMMENT(); break; - //Control Record Types (Типы управляющих записей) + //Control Record Types case EMFPLUS_ENDOFFILE: Read_EMFPLUS_ENDOFFILE(); break; case EMFPLUS_GETDC: Read_EMFPLUS_GETDC(); break; case EMFPLUS_HEADER: Read_EMFPLUS_HEADER(unShFlags); break; - //Drawing Record Types (Типы записей чертежа) + //Drawing Record Types case EMFPLUS_CLEAR: Read_EMFPLUS_CLEAR(); break; case EMFPLUS_DRAWARC: Read_EMFPLUS_DRAWARC(unShFlags); break; case EMFPLUS_DRAWBEZIERS: Read_EMFPLUS_DRAWBEZIERS(unShFlags); break; @@ -304,11 +304,11 @@ namespace MetaFile case EMFPLUS_FILLRECTS: Read_EMFPLUS_FILLRECTS(unShFlags); break; case EMFPLUS_FILLREGION: Read_EMFPLUS_FILLREGION(unShFlags); break; - //Object Record Types (Типы записей объектов) + //Object Record Types case EMFPLUS_OBJECT: Read_EMFPLUS_OBJECT(unShFlags); break; case EMFPLUS_SERIALIZABLEOBJECT:Read_EMFPLUS_SERIALIZABLEOBJECT(unShFlags); break; - //Property Record Types (Типы записей свойств) + //Property Record Types case EMFPLUS_SETANTIALIASMODE: Read_EMFPLUS_SETANTIALIASMODE(unShFlags); break; case EMFPLUS_SETCOMPOSITINGMODE: Read_EMFPLUS_SETCOMPOSITINGMODE(unShFlags); break; case EMFPLUS_SETCOMPOSITINGQUALITY: Read_EMFPLUS_SETCOMPOSITINGQUALITY(unShFlags); break; @@ -318,18 +318,18 @@ namespace MetaFile case EMFPLUS_SETTEXTCONTRAST: Read_EMFPLUS_SETTEXTCONTRAST(unShFlags); break; case EMFPLUS_SETTEXTRENDERINGHINT: Read_EMRPLUS_SETTEXTRENDERINGHINT(unShFlags); break; - //State Record Types (Типы записей состояния) + //State Record Types case EMFPLUS_BEGINCONTAINER: Read_EMFPLUS_BEGINCONTAINER(unShFlags); break; case EMFPLUS_BEGINCONTAINERNOPARAMS: Read_EMFPLUS_BEGINCONTAINERNOPARAMS(); break; case EMFPLUS_ENDCONTAINER: Read_EMFPLUS_ENDCONTAINER(); break; case EMFPLUS_RESTORE: Read_EMFPLUS_RESTORE(); break; case EMFPLUS_SAVE: Read_EMFPLUS_SAVE(); break; - //Terminal Server Record (Запись сервера Терминалов) + //Terminal Server Record case EMFPLUS_SETTSCLIP: Read_EMFPLUS_SETTSCLIP(unShFlags); break; case EMFPLUS_SETTSGRAPHICS: Read_EMFPLUS_SETTSGRAPHICS(unShFlags); break; - //Transform Record Types (Преобразование Типов записей) + //Transform Record Types case EMFPLUS_MULTIPLYWORLDTRANSFORM: Read_EMFPLUS_MULTIPLYWORLDTRANSFORM(unShFlags); break; case EMFPLUS_RESETWORLDTRANSFORM: Read_EMFPLUS_RESETWORLDTRANSFORM(); break; case EMFPLUS_ROTATEWORLDTRANSFORM: Read_EMFPLUS_ROTATEWORLDTRANSFORM(unShFlags); break; @@ -556,7 +556,7 @@ namespace MetaFile } case BrushTypeTextureFill: { - // TODO: так как на данный момент нельзя регулировать повторение заливки, то будет отрисовывать изображение при самой заливки + // TODO: since fill repetition cannot be controlled at the moment, the image will be drawn during the fill itself pEmfPlusBrush->unStyle = BS_PATTERN; unsigned int unBrushDataFlags, unSkip = 16; @@ -590,7 +590,7 @@ namespace MetaFile case BrushTypePathGradient: { // pEmfPlusBrush->Style = BS_PATHGRADIENT; - //TODO: пока что данная кисть будет радиальной, но в дальнейшем необходимо реализовать все возможности данной кисти + //TODO: for now this brush will be radial, but in the future all capabilities of this brush need to be implemented pEmfPlusBrush->unStyle = BS_RADIALGRADIENT; unsigned int unBrushDataFlags; @@ -642,7 +642,7 @@ namespace MetaFile std::vector<TEmfPlusPointF> arPoints = ReadPoints<TEmfPlusPointF>(nCountPoint); - //TODO::реализовать при встрече + //TODO:: implement when encountered } if (BrushDataTransform & unBrushDataFlags) @@ -673,7 +673,7 @@ namespace MetaFile } case BrushTypeLinearGradient: { - //TODO: реализовать + //TODO: implement pEmfPlusBrush->unStyle = BS_LINEARGRADIENT; int nBrushDataFlags; @@ -976,7 +976,7 @@ namespace MetaFile m_oStream >> unLength; - if (unLength > 15) // 30 байта / 2 (размер ushort) = 15 символов максимальная длина имени Unicode шрифта + if (unLength > 15) // 30 bytes / 2 (ushort size) = 15 characters maximum Unicode font name length unLength = 15; unsigned short* pString = new unsigned short[unLength + 1]; @@ -1019,11 +1019,11 @@ namespace MetaFile if ((unPathPointFlags >>(20)) & 1 ) { - //Определен флаг R (С игнорируется) + //Flag R is defined (C is ignored) } else if ((unPathPointFlags >>(14)) & 1 ) { - //Не определен флаг R, но определен флаг С + //Flag R is not defined, but flag C is defined std::vector<TEmfPlusPoint> arPoints = ReadPoints<TEmfPlusPoint>(unPathPointCount); std::vector<char> arPointTypes = ReadPointTypes(unPathPointCount); @@ -1089,9 +1089,9 @@ namespace MetaFile if (unSkip < 4) m_oStream.Skip(unSkip); - //Оба флага не определены + // Both flags are undefined } - //TODO: реализовать + //TODO: implement return pPath; } @@ -1610,7 +1610,7 @@ namespace MetaFile return; unsigned int alfa = 0xffffff; - //дефолтный тон должен быть прозрачным, а не белым + //default tone should be transparent, not white //memset(pBgraData, 0x00, nWidth * nHeight * 4); for (int i = 0; i < nWidth * nHeight; i++) ((unsigned int*)pBgraData)[i] = alfa; @@ -1754,7 +1754,7 @@ namespace MetaFile m_pInterpretator->Begin(); m_pInterpretator->HANDLE_EMFPLUS_HEADER(unEmfPlusFlags, m_unLogicalDpiX, m_unLogicalDpiY); } - //TODO: добавить установление нового Dpi (нужно ли?) + //TODO: add setting new Dpi (is it needed?) } void CEmfPlusParser::Read_EMFPLUS_CLEAR() @@ -1816,18 +1816,18 @@ namespace MetaFile { if ((unShFlags >>(11)) & 1 ) { - //Определен флаг P (С игнорируется) - //Read_EMFPLUS_DRAWBEZIERS_BASE<TEmfPlusPointR>(unShFlags); // относительное расположение + //Flag P is defined (C is ignored) + //Read_EMFPLUS_DRAWBEZIERS_BASE<TEmfPlusPointR>(unShFlags); // relative positioning } else if ((unShFlags >>(14)) & 1 ) { - //Не определен флаг P, но определен флаг С - Read_EMFPLUS_DRAWBEZIERS_BASE<TEmfPlusPoint>(unShFlags); // относительное расположение + //Flag P is not defined, but flag C is defined + Read_EMFPLUS_DRAWBEZIERS_BASE<TEmfPlusPoint>(unShFlags); // relative positioning } else { - //Оба флага не определены - Read_EMFPLUS_DRAWBEZIERS_BASE<TEmfPlusPointF>(unShFlags); // абсолютное расположение + // Both flags are undefined + Read_EMFPLUS_DRAWBEZIERS_BASE<TEmfPlusPointF>(unShFlags); // absolute positioning } } @@ -1875,18 +1875,18 @@ namespace MetaFile { if ((unShFlags >>(11)) & 1 ) { - //Определен флаг P (С игнорируется) - //Read_EMFPLUS_DRAWCLOSEDCURVE_BASE<TEmfPlusPointR>(unShFlags); // относительное расположение + //Flag P is defined (C is ignored) + //Read_EMFPLUS_DRAWCLOSEDCURVE_BASE<TEmfPlusPointR>(unShFlags); // relative positioning } else if ((unShFlags >>(14)) & 1 ) { - //Не определен флаг P, но определен флаг С - Read_EMFPLUS_DRAWCLOSEDCURVE_BASE<TEmfPlusPoint>(unShFlags); // абсолютное расположение с 16-разрядными координатами + //Flag P is not defined, but flag C is defined + Read_EMFPLUS_DRAWCLOSEDCURVE_BASE<TEmfPlusPoint>(unShFlags); // absolute positioning with 16-bit coordinates } else { - //Оба флага не определены - Read_EMFPLUS_DRAWCLOSEDCURVE_BASE<TEmfPlusPointF>(unShFlags); // абсолютное расположение с 32-разрядными координатами. + // Both flags are undefined + Read_EMFPLUS_DRAWCLOSEDCURVE_BASE<TEmfPlusPointF>(unShFlags); // absolute positioning with 32-bit coordinates. } } @@ -2163,18 +2163,18 @@ namespace MetaFile { if ((unShFlags >>(11)) & 1 ) { - //Определен флаг P (С игнорируется) - //Read_EMFPLUS_DRAWIMAGEPOINTS_BASE<TEmfPlusPointR>(unShFlags); // относительное расположение + //Flag P is defined (C is ignored) + //Read_EMFPLUS_DRAWIMAGEPOINTS_BASE<TEmfPlusPointR>(unShFlags); // relative positioning } else if ((unShFlags >>(14)) & 1 ) { - //Не определен флаг P, но определен флаг С - Read_EMFPLUS_DRAWIMAGEPOINTS_BASE<TEmfPlusPoint>(unShFlags); // абсолютное расположение с 16-разрядными целочисленными координатами + //Flag P is not defined, but flag C is defined + Read_EMFPLUS_DRAWIMAGEPOINTS_BASE<TEmfPlusPoint>(unShFlags); // absolute positioning with 16-bit integer coordinates } else { - //Оба флага не определены - Read_EMFPLUS_DRAWIMAGEPOINTS_BASE<TEmfPlusPointF>(unShFlags); // абсолютное расположение с 32-разрядными координатами с плавующей запятой + // Both flags are undefined + Read_EMFPLUS_DRAWIMAGEPOINTS_BASE<TEmfPlusPointF>(unShFlags); // absolute position with 32-bit floating-point coordinates } } @@ -2206,18 +2206,18 @@ namespace MetaFile { if ((unShFlags >>(11)) & 1 ) { - //Определен флаг P (С игнорируется) - //Read_EMFPLUS_DRAWLINES_BASE<TEmfPlusPointR>(unShFlags); // относительное расположение + //Flag P is defined (C is ignored) + //Read_EMFPLUS_DRAWLINES_BASE<TEmfPlusPointR>(unShFlags); // relative positioning } else if ((unShFlags >>(14)) & 1 ) { - //Не определен флаг P, но определен флаг С - Read_EMFPLUS_DRAWLINES_BASE<TEmfPlusPoint>(unShFlags); // абсолютное расположение с 16-разрядными целочисленными координатами + //Flag P is not defined, but flag C is defined + Read_EMFPLUS_DRAWLINES_BASE<TEmfPlusPoint>(unShFlags); // absolute positioning with 16-bit integer coordinates } else { - //Оба флага не определены - Read_EMFPLUS_DRAWLINES_BASE<TEmfPlusPointF>(unShFlags); // абсолютное расположение с 32-разрядными координатами с плавующей запятой + // Both flags are undefined + Read_EMFPLUS_DRAWLINES_BASE<TEmfPlusPointF>(unShFlags); // absolute position with 32-bit floating-point coordinates } } @@ -2322,7 +2322,7 @@ namespace MetaFile if (NULL != m_pInterpretator) m_pInterpretator->HANDLE_EMFPLUS_DRAWPIE(shOgjectIndex, dStartAngle, dSweepAngle, GetConvertedRectangle(oRect)); - //TODO: реализовать + //TODO: implement } void CEmfPlusParser::Read_EMFPLUS_DRAWRECTS(unsigned short unShFlags) @@ -2500,18 +2500,18 @@ namespace MetaFile { if ((unShFlags >>(11)) & 1 ) { - //Определен флаг P (С игнорируется) - //Read_EMFPLUS_FILLCLOSEDCURVE_BASE<TEmfPlusPointR>(unShFlags); // относительное расположение + //Flag P is defined (C is ignored) + //Read_EMFPLUS_FILLCLOSEDCURVE_BASE<TEmfPlusPointR>(unShFlags); // relative positioning } else if ((unShFlags >>(14)) & 1 ) { - //Не определен флаг P, но определен флаг С - Read_EMFPLUS_FILLCLOSEDCURVE_BASE<TEmfPlusPoint>(unShFlags); // абсолютное расположение с 16-разрядными целочисленными координатами + //Flag P is not defined, but flag C is defined + Read_EMFPLUS_FILLCLOSEDCURVE_BASE<TEmfPlusPoint>(unShFlags); // absolute positioning with 16-bit integer coordinates } else { - //Оба флага не определены - Read_EMFPLUS_FILLCLOSEDCURVE_BASE<TEmfPlusPointF>(unShFlags); // абсолютное расположение с 32-разрядными координатами с плавующей запятой + // Both flags are undefined + Read_EMFPLUS_FILLCLOSEDCURVE_BASE<TEmfPlusPointF>(unShFlags); // absolute position with 32-bit floating-point coordinates } } @@ -2532,7 +2532,7 @@ namespace MetaFile } - //TODO: реализовать + //TODO: implement } void CEmfPlusParser::Read_EMFPLUS_FILLELLIPSE(unsigned short unShFlags) @@ -2668,25 +2668,25 @@ namespace MetaFile if (NULL != m_pInterpretator) m_pInterpretator->HANDLE_EMFPLUS_FILLPIE(unBrushId, dStartAngle, dSweepAngle, GetConvertedRectangle(oRect)); - //TODO: реализовать + //TODO: implement } void CEmfPlusParser::Read_EMFPLUS_FILLPOLYGON(unsigned short unShFlags) { if ((unShFlags >>(11)) & 1 ) { - //Определен флаг P (С игнорируется) - //Read_EMFPLUS_FILLPOLYGON_BASE<TEmfPlusPointR>(unShFlags); // относительное расположение + // Flag P is defined (C is ignored) + //Read_EMFPLUS_FILLPOLYGON_BASE<TEmfPlusPointR>(unShFlags); // relative position } else if ((unShFlags >>(14)) & 1 ) { - //Не определен флаг P, но определен флаг С - Read_EMFPLUS_FILLPOLYGON_BASE<TEmfPlusPoint>(unShFlags); // абсолютное расположение с 16-разрядными целочисленными координатами + // Flag P is not defined, but flag C is defined + Read_EMFPLUS_FILLPOLYGON_BASE<TEmfPlusPoint>(unShFlags); // absolute position with 16-bit integer coordinates } else { - //Оба флага не определены - Read_EMFPLUS_FILLPOLYGON_BASE<TEmfPlusPointF>(unShFlags); // абсолютное расположение с 32-разрядными координатами с плавующей запятой + // Both flags are undefined + Read_EMFPLUS_FILLPOLYGON_BASE<TEmfPlusPointF>(unShFlags); // absolute position with 32-bit floating-point coordinates } } @@ -2827,7 +2827,7 @@ namespace MetaFile m_oStream >> unBrushId; - //TODO: реализовать + //TODO: implement } void CEmfPlusParser::Read_EMFPLUS_OBJECT(unsigned short unShFlags) @@ -2965,7 +2965,7 @@ namespace MetaFile return; } } - //TODO: реализовать + //TODO: implement } void CEmfPlusParser::Read_EMFPLUS_SERIALIZABLEOBJECT(unsigned short unShFlags) @@ -2976,41 +2976,41 @@ namespace MetaFile m_oStream >> oGUID; m_oStream >> unBufferSize; - //TODO: реализовать + //TODO: implement } void CEmfPlusParser::Read_EMFPLUS_SETANTIALIASMODE(unsigned short unShFlags) { // short shSmoothingMode = ExpressValue(unShFlags, 1, 7); - //TODO: реализовать + //TODO: implement } void CEmfPlusParser::Read_EMFPLUS_SETCOMPOSITINGMODE(unsigned short unShFlags) { // short shCompositingMode = ExpressValue(unShFlags, 0, 7); - //TODO: реализовать + //TODO: implement } void CEmfPlusParser::Read_EMFPLUS_SETCOMPOSITINGQUALITY(unsigned short unShFlags) { // short shCompositingQuality = ExpressValue(unShFlags, 0, 7); - //TODO: реализовать + //TODO: implement } void CEmfPlusParser::Read_EMFPLUS_SETINTERPOLATIONMODE(unsigned short unShFlags) { // short shInterpolationMode = ExpressValue(unShFlags, 0, 7); - //TODO: реализовать + //TODO: implement } void CEmfPlusParser::Read_EMFPLUS_SETPIXELOFFSETMODE(unsigned short unShFlags) { // short shPixelOffsetMode = ExpressValue(unShFlags, 0, 7); - //TODO: реализовать + //TODO: implement } void CEmfPlusParser::Read_EMFPLUS_SETRENDERINGORIGIN() @@ -3020,20 +3020,20 @@ namespace MetaFile m_oStream >> nX; m_oStream >> nY; - //TODO: реализовать + //TODO: implement } void CEmfPlusParser::Read_EMFPLUS_SETTEXTCONTRAST(unsigned short unShFlags) { // short shTextContrast = ExpressValue(unShFlags, 0, 11); - //TODO: реализовать + //TODO: implement } void CEmfPlusParser::Read_EMRPLUS_SETTEXTRENDERINGHINT(unsigned short unShFlags) { // short shTextRenderingHint = ExpressValue(unShFlags, 0, 7); - //TODO: реализовать + //TODO: implement } void CEmfPlusParser::Read_EMFPLUS_BEGINCONTAINER(unsigned short unShFlags) @@ -3046,7 +3046,7 @@ namespace MetaFile m_oStream >> oSrcRect; m_oStream >> unStackIndex; - //TODO: реализовать + //TODO: implement } void CEmfPlusParser::Read_EMFPLUS_BEGINCONTAINERNOPARAMS() @@ -3055,7 +3055,7 @@ namespace MetaFile m_oStream >> unStackIndex; - //TODO: реализовать + //TODO: implement } void CEmfPlusParser::Read_EMFPLUS_ENDCONTAINER() @@ -3064,7 +3064,7 @@ namespace MetaFile m_oStream >> unStackIndex; - //TODO: реализовать + //TODO: implement } void CEmfPlusParser::Read_EMFPLUS_RESTORE() @@ -3109,7 +3109,7 @@ namespace MetaFile m_oStream >> arRects[unIndex]; } - //TODO: реализовать + //TODO: implement } void CEmfPlusParser::Read_EMFPLUS_SETTSGRAPHICS(unsigned short unShFlags) @@ -3130,7 +3130,7 @@ namespace MetaFile m_oStream >> unChPixelOffset; m_oStream >> oMatrix; - //TODO: реализовать + //TODO: implement } void CEmfPlusParser::Read_EMFPLUS_MULTIPLYWORLDTRANSFORM(unsigned short unShFlags) @@ -3251,7 +3251,7 @@ namespace MetaFile if (NULL != m_pInterpretator) m_pInterpretator->HANDLE_EMFPLUS_OFFSETCLIP(dX, dY); - //TODO: реализовать + //TODO: implement } void CEmfPlusParser::Read_EMRPLUS_RESETCLIP() diff --git a/DesktopEditor/raster/Metafile/Emf/EmfParser/CEmfxParser.cpp b/DesktopEditor/raster/Metafile/Emf/EmfParser/CEmfxParser.cpp index 4b1b1fe326..a9295d3d0f 100644 --- a/DesktopEditor/raster/Metafile/Emf/EmfParser/CEmfxParser.cpp +++ b/DesktopEditor/raster/Metafile/Emf/EmfParser/CEmfxParser.cpp @@ -504,7 +504,7 @@ namespace MetaFile void CEmfxParser::Read_EMR_EXTCREATEFONTINDIRECTW() { - //TODO: переделать чтение из-за отсутствия m_ulRecordSize + //TODO: refactor reading due to missing m_ulRecordSize unsigned int unSize = m_ulRecordSize - 4; bool bFixedLength = unSize <= 0x0140 ? true : false; @@ -557,7 +557,7 @@ namespace MetaFile void CEmfxParser::Read_EMR_EXTCREATEPEN() { - //TODO: переделать чтение из-за отсутствия m_ulRecordSize + //TODO: refactor reading due to missing m_ulRecordSize unsigned int ulPenIndex; @@ -802,7 +802,7 @@ namespace MetaFile void CEmfxParser::Read_EMR_EXCLUDECLIPRECT() { - // TODO: Проверить как найдется файл + // TODO: Check when a file is found TRectL oClip; *m_pOutput >> oClip; @@ -890,7 +890,7 @@ namespace MetaFile void CEmfxParser::Read_EMR_ANGLEARC() { - // TODO: Как найдутся файлы проверить данную запись. + // TODO: Check this record when files are found. TPointL oCenter; unsigned int unRadius; double dStartAngle, dSweepAngle; @@ -922,7 +922,7 @@ namespace MetaFile void CEmfxParser::Read_EMR_ARCTO() { - // TODO: Как найдутся файлы проверить данную запись. + // TODO: Check this record when files are found. TRectL oBox; TPointL oStart, oEnd; @@ -932,7 +932,7 @@ namespace MetaFile void CEmfxParser::Read_EMR_CHORD() { - // TODO: Как найдутся файлы проверить данную запись. + // TODO: Check this record when files are found. TRectL oBox; TPointL oStart, oEnd; @@ -951,7 +951,7 @@ namespace MetaFile void CEmfxParser::Read_EMR_EXTTEXTOUTA() { - // TODO: Как найдутся файлы проверить данную запись. + // TODO: Check this record when files are found. TEmfExtTextoutA oText; *m_pOutput >> oText; @@ -979,7 +979,7 @@ namespace MetaFile void CEmfxParser::Read_EMR_PIE() { - // TODO: Как найдутся файлы проверить данную запись. + // TODO: Check this record when files are found. TRectL oBox; TPointL oStart, oEnd; @@ -1041,8 +1041,8 @@ namespace MetaFile template<typename T>void CEmfxParser::Read_EMR_POLYDRAW_BASE() { - // TODO: Как найдутся файлы проверить данную запись. - //bug #35006 - не прочитывается весь рекорд ... выравнивание? + // TODO: Check this record when files are found. + //bug #35006 - entire record is not read ... alignment? TRectL oBounds; unsigned int unCount; @@ -1183,10 +1183,10 @@ namespace MetaFile void CEmfxParser::Read_EMR_POLYTEXTOUTA() { - // TODO: Как найдутся файлы проверить данную запись. + // TODO: Check this record when files are found. TPolyTextoutA oText; - //TODO: сделать сохранение в XML и чтение из него + //TODO: implement saving to XML and reading from it return; m_oStream >> oText; @@ -1205,10 +1205,10 @@ namespace MetaFile void CEmfxParser::Read_EMR_POLYTEXTOUTW() { - // TODO: Как найдутся файлы проверить данную запись. + // TODO: Check this record when files are found. TPolyTextoutW oText; - //TODO: сделать сохранение в XML и чтение из него + //TODO: implement saving to XML and reading from it return; m_oStream >> oText; @@ -1255,7 +1255,7 @@ namespace MetaFile if (NULL != m_pInterpretator) m_pInterpretator->HANDLE_EMR_SETPIXELV(oPoint, oColor); - // Делаем цветом кисти + // Set as brush color BYTE pBgraBuffer[4]; pBgraBuffer[0] = oColor.b; pBgraBuffer[1] = oColor.g; diff --git a/DesktopEditor/raster/Metafile/Emf/EmfPlayer.cpp b/DesktopEditor/raster/Metafile/Emf/EmfPlayer.cpp index 881e4242cf..6e3496dec0 100644 --- a/DesktopEditor/raster/Metafile/Emf/EmfPlayer.cpp +++ b/DesktopEditor/raster/Metafile/Emf/EmfPlayer.cpp @@ -211,7 +211,7 @@ namespace MetaFile } void CEmfPlayer::DeleteObject(unsigned int ulIndex) { - // TODO: Сделать поиск по DC_BRUSH и DC_PEN + // TODO: Implement search by DC_BRUSH and DC_PEN CEmfObjectMap::const_iterator oPos = m_mObjects.find(ulIndex); if (m_mObjects.end() != oPos) @@ -254,9 +254,9 @@ namespace MetaFile InitStockPen(false, 0xff, 0xff, 0xff, 0x80000006); InitStockPen(false, 0x00, 0x00, 0x00, 0x80000007); InitStockPen(true, 0x00, 0x00, 0x00, 0x80000008); - // TODO: Сделать шрифты + // TODO: Implement fonts - // DC_BRUSH и DC_PEN не надо выставлять + // DC_BRUSH and DC_PEN don't need to be set } void CEmfPlayer::InitStockBrush(bool bNull, unsigned char r, unsigned char g, unsigned char b, unsigned int ulIndex) { @@ -467,7 +467,7 @@ namespace MetaFile { m_oTransform.Multiply(oForm, ulMode); - // Обновляем обратную матрицу + // Update inverse matrix TEmfXForm* pT = &m_oTransform; const double dDet = pT->M11 * pT->M22 - pT->M12 * pT->M21; if (Equals(0., dDet, 0.0001)) diff --git a/DesktopEditor/raster/Metafile/Emf/EmfPlayer.h b/DesktopEditor/raster/Metafile/Emf/EmfPlayer.h index 081ee385ee..e4c2d513e8 100644 --- a/DesktopEditor/raster/Metafile/Emf/EmfPlayer.h +++ b/DesktopEditor/raster/Metafile/Emf/EmfPlayer.h @@ -161,7 +161,7 @@ namespace MetaFile TEmfXForm m_oTransform; TEmfXForm m_oInverseTransform; TEmfXForm m_oFinalTransform; - TEmfXForm m_oFinalTransform2; // Преобразование без учета m_oTransform, т.е. чисто преобразование окна + TEmfXForm m_oFinalTransform2; // Transformation without m_oTransform, i.e. pure window transformation TRGBA m_oTextColor; TRGBA m_oBgColor; unsigned int m_ulTextAlign; diff --git a/DesktopEditor/raster/Metafile/Emf/EmfTypes.h b/DesktopEditor/raster/Metafile/Emf/EmfTypes.h index 1186690425..63d814cb13 100644 --- a/DesktopEditor/raster/Metafile/Emf/EmfTypes.h +++ b/DesktopEditor/raster/Metafile/Emf/EmfTypes.h @@ -335,7 +335,7 @@ namespace MetaFile unsigned int unOptions; TRectL oRectangle; unsigned int unOffDx; - T* pOutputString; // unsinged short* либо unsigned char* + T* pOutputString; // unsigned short* or unsigned char* unsigned int* pOutputDx; TEmrText() : pOutputString(NULL), pOutputDx(NULL){} diff --git a/DesktopEditor/raster/Metafile/MetaFile.cpp b/DesktopEditor/raster/Metafile/MetaFile.cpp index e3acbe2691..a0a5ce1bc4 100644 --- a/DesktopEditor/raster/Metafile/MetaFile.cpp +++ b/DesktopEditor/raster/Metafile/MetaFile.cpp @@ -51,7 +51,7 @@ namespace MetaFile { m_pFontManager = NULL; m_pAppFonts = pAppFonts; - // Создаем менеджер шрифтов с собственным кэшем + // Create font manager with its own cache if (pAppFonts) { m_pFontManager = pAppFonts->GenerateFontManager(); @@ -153,7 +153,7 @@ namespace MetaFile return; unsigned int alfa = 0xffffff; - //дефолтный тон должен быть прозрачным, а не белым + // default tone should be transparent, not white //memset(pBgraData, 0xff, nWidth * nHeight * 4); for (int i = 0; i < nWidth * nHeight; i++) { @@ -275,14 +275,14 @@ namespace MetaFile m_oEmfFile.SetOutputDevice(wsFilePath, InterpretatorType::Emf); m_oEmfFile.PlayMetaFile(); - //TODO:: сохранение в *.emf файл + //TODO:: save to *.emf file } #endif bool CMetaFile::LoadFromFile(const wchar_t *wsFilePath) { - // TODO: Сейчас при загрузке каждой новой картинки мы пересоздаем - // FontManager, потому что сейчас в нем кэш без ограничения. + // TODO: Currently when loading each new image we recreate + // FontManager, because currently its cache has no limit. //------------------------------------------------------ RELEASEINTERFACE(m_pFontManager); @@ -311,7 +311,7 @@ namespace MetaFile //------------------------------------------------------ #ifdef METAFILE_SUPPORT_WMF_EMF - // Сначала пытаемся открыть файл как Wmf + // First try to open file as Wmf if (m_oWmfFile.OpenFromWmfFile(wsFilePath) == true) { m_oWmfFile.Scan(); @@ -323,7 +323,7 @@ namespace MetaFile } m_oWmfFile.Close(); } - // Это не Wmf + // This is not Wmf if (m_oEmfFile.OpenFromEmfFile(wsFilePath) == true) { m_oEmfFile.Scan(); @@ -336,7 +336,7 @@ namespace MetaFile m_oEmfFile.Close(); } #endif - // Это не Emf + // This is not Emf #ifdef METAFILE_SUPPORT_SVM if (m_oSvmFile.OpenFromFile(wsFilePath) == true) { @@ -351,7 +351,7 @@ namespace MetaFile m_oSvmFile.Close(); } #endif - // Это не svm + // This is not svm #ifdef METAFILE_SUPPORT_SVG if (m_oSvgFile.OpenFromFile(wsFilePath) == true) { @@ -369,8 +369,8 @@ namespace MetaFile if (NULL == pBuffer || 0 == unSize) return false; - // TODO: Сейчас при загрузке каждой новой картинки мы пересоздаем - // FontManager, потому что сейчас в нем кэш без ограничения. + // TODO: Currently when loading each new image we recreate + // FontManager, because currently its cache has no limit. //------------------------------------------------------ RELEASEINTERFACE(m_pFontManager); @@ -399,7 +399,7 @@ namespace MetaFile //------------------------------------------------------ #ifdef METAFILE_SUPPORT_WMF_EMF - // Сначала пытаемся открыть файл как Wmf + // First try to open file as Wmf if (m_oWmfFile.ReadFromBuffer(pBuffer, unSize) == true) { m_oWmfFile.Scan(); @@ -411,7 +411,7 @@ namespace MetaFile } m_oWmfFile.Close(); } - // Это не Wmf + // This is not Wmf if (m_oEmfFile.ReadFromBuffer(pBuffer, unSize) == true) { m_oEmfFile.Scan(); @@ -424,7 +424,7 @@ namespace MetaFile m_oEmfFile.Close(); } #endif - // Это не Emf + // This is not Emf #ifdef METAFILE_SUPPORT_SVM if (m_oSvmFile.ReadFromBuffer(pBuffer, unSize) == true) { @@ -439,7 +439,7 @@ namespace MetaFile m_oSvmFile.Close(); } #endif - // Это не svm + // This is not svm #ifdef METAFILE_SUPPORT_SVG if (m_oSvgFile.ReadFromBuffer(pBuffer, unSize) == true) { @@ -661,7 +661,7 @@ namespace MetaFile return; unsigned int alfa = 0xffffff; - //дефолтный тон должен быть прозрачным, а не белым + // default tone should be transparent, not white //memset(pBgraData, 0xff, nWidth * nHeight * 4); for (int i = 0; i < nWidth * nHeight; i++) { diff --git a/DesktopEditor/raster/Metafile/MetaFile.h b/DesktopEditor/raster/Metafile/MetaFile.h index 018e0d1f19..ea42d53e3e 100644 --- a/DesktopEditor/raster/Metafile/MetaFile.h +++ b/DesktopEditor/raster/Metafile/MetaFile.h @@ -73,12 +73,12 @@ namespace MetaFile NSFonts::IFontManager* get_FontManager(); - //конвертация в Svg + // conversion to Svg std::wstring ConvertToSvg(unsigned int unWidth = 0, unsigned int unHeight = 0); void SetTempDirectory(const std::wstring& dir); - //Для тестов + // For tests #ifdef METAFILE_SUPPORT_WMF_EMF void ConvertToXml(const wchar_t *wsFilePath); void ConvertToXmlAndRaster(const wchar_t *wsXmlFilePath, const wchar_t* wsOutFilePath, unsigned int unFileType, int nWidth, int nHeight = -1); diff --git a/DesktopEditor/raster/Metafile/StarView/SvmFile.cpp b/DesktopEditor/raster/Metafile/StarView/SvmFile.cpp index 91f9d9fb6b..3c15473cfe 100644 --- a/DesktopEditor/raster/Metafile/StarView/SvmFile.cpp +++ b/DesktopEditor/raster/Metafile/StarView/SvmFile.cpp @@ -292,7 +292,7 @@ void CSvmFile::Read_SVM_HEADER() m_pDC->SetMapMode(m_oHeader.mapMode, true); - if (m_bMainStream) //из-за 2 идет увеличение самой картинки в 2 раза (содержимое имеет исходный размер, т.е. в 2 раза меньше нужного) + if (m_bMainStream) // due to 2, the image itself is scaled up by 2 (content has original size, i.e. 2 times smaller than needed) { unsigned int unCoef = 1; m_oBoundingBox = m_oHeader.boundRect; @@ -301,7 +301,7 @@ void CSvmFile::Read_SVM_HEADER() m_oBoundingBox.Left = static_cast<int>(m_pDC->m_dPixelWidthPrefered * unCoef * m_oBoundingBox.Left); m_oBoundingBox.Top = static_cast<int>(m_pDC->m_dPixelHeightPrefered * unCoef * m_oBoundingBox.Top); - }// *2 ради повышения качества картинки (если в векторе насамом деле растр - сментся на растровые размеры ниже + }// *2 to improve image quality (if vector actually contains raster - will switch to raster dimensions below) m_bFirstPoint = true; } @@ -647,7 +647,7 @@ void CSvmFile::Read_META_SETFILLCOLOR() if (m_currentActionType == META_GRADIENT_ACTION || m_currentActionType == META_GRADIENTEX_ACTION) { - //поменять основной цвет?? + // change main color?? m_oStream.Skip(m_unRecordSize); return; } @@ -714,7 +714,7 @@ void CSvmFile::Read_META_GRADIENTEX() pBrush->Color.Set(gradient.color1.r>>8, gradient.color1.g>>8, gradient.color1.b>>8); pBrush->Color2.Set(gradient.color2.r>>8, gradient.color2.g>>8, gradient.color2.b>>8); - pBrush->BrushStyleEx = 90 + gradient.angle % 3600; //проверить на разных + pBrush->BrushStyleEx = 90 + gradient.angle % 3600; // verify on different cases m_oPlayer.RegisterObject((CSvmObjectBase*)pBrush); } @@ -778,7 +778,7 @@ void CSvmFile::Read_META_TRANSPARENT() void CSvmFile::Read_META_FLOATTRANSPARENT() { return; - // тут возможен также вариант svg + // SVG variant is also possible here CSvmFile subMetaFile(m_oStream.GetCurPtr() , m_unRecordSize); subMetaFile.m_bMainStream = false; @@ -816,7 +816,7 @@ void CSvmFile::Read_META_FLOATTRANSPARENT() pBrush->Color.Set(gradient.color1.r>>8, gradient.color1.g>>8, gradient.color1.b>>8); pBrush->Color2.Set(gradient.color2.r>>8, gradient.color2.g>>8, gradient.color2.b>>8); - pBrush->BrushStyleEx = 90 + gradient.angle % 3600; //проверить на разных + pBrush->BrushStyleEx = 90 + gradient.angle % 3600; // verify on different cases m_oPlayer.RegisterObject((CSvmObjectBase*)pBrush); @@ -842,7 +842,7 @@ void CSvmFile::Read_META_FLOATTRANSPARENT() // return; // _UINT32 alfa = 0xffffff; - ////дефолтный тон должен быть прозрачным, а не белым + ////default tone should be transparent, not white ////memset(pBgraData, 0xff, nWidth * nHeight * 4); //for (int i = 0; i < nW * nH; i++) //{ @@ -904,7 +904,7 @@ void CSvmFile::Read_META_GRADIENT() pBrush->Color.Set(gradient.color1.r>>8, gradient.color1.g>>8, gradient.color1.b>>8); pBrush->Color2.Set(gradient.color2.r>>8, gradient.color2.g>>8, gradient.color2.b>>8); - pBrush->BrushStyleEx = 90 + gradient.angle % 3600; //проверить на разных + pBrush->BrushStyleEx = 90 + gradient.angle % 3600; // verify on different cases m_oPlayer.RegisterObject((CSvmObjectBase*)pBrush); } @@ -1018,7 +1018,7 @@ void CSvmFile::Read_META_BMP(TSvmBitmap & bitmap_info, BYTE** ppDstBuffer, unsig { if ( 0x4142 == nTmp16 ) { - m_oStream.Skip( 12 );//не то !!! + m_oStream.Skip( 12 );//not correct!!! m_oStream >> nTmp16; m_oStream.Skip( 8 ); m_oStream >> nTmp32; @@ -1101,7 +1101,7 @@ void CSvmFile::Read_META_BMPEX() { bitmap_info.nWidth = ulWidth; } - //иногда наверху неверно вычисляется оригинальный размер - если внутри одиночная картинка + // sometimes the original size is calculated incorrectly above - if there is a single image inside if (bitmap_info.nHeight > (unsigned int)m_oBoundingBox.Bottom && bitmap_info.nWidth > (unsigned int)m_oBoundingBox.Right && !m_pOutput) @@ -1168,7 +1168,7 @@ void CSvmFile::Read_META_BMPEXSCALE() Read_META_BMP(bitmap_info, &pBgraBuffer, &ulWidth, &ulHeight); - //иногда наверху неверно вычисляется оригинальный размер - если внутри одиночная картинка + // sometimes the original size is calculated incorrectly above - if there is a single image inside // if (ulWidth != bitmap_info.nWidth && bitmap_info.nWidth % 2 != 0) { @@ -1240,7 +1240,7 @@ void CSvmFile::Read_META_BMPSCALE() Read_META_BMP(bitmap_info, &pBgraBuffer, &ulWidth, &ulHeight ); - //иногда наверху неверно вычисляется оригинальный размер - если внутри одиночная картинка + // sometimes the original size is calculated incorrectly above - if there is a single image inside //if (ulWidth != bitmap_info.nWidth && bitmap_info.nWidth % 2 != 0) { bitmap_info.nWidth = ulWidth; diff --git a/DesktopEditor/raster/Metafile/StarView/SvmFile.h b/DesktopEditor/raster/Metafile/StarView/SvmFile.h index 4950337f07..3d87d77a36 100644 --- a/DesktopEditor/raster/Metafile/StarView/SvmFile.h +++ b/DesktopEditor/raster/Metafile/StarView/SvmFile.h @@ -283,7 +283,7 @@ class CSvmFile : virtual public IMetaFileBase unsigned int ulBitsSize = cbBits; if (ulHeaderSize <= 0 || ulBitsSize <= 0 || lHeaderOffset < 0 || lBitsOffset < 0) { - // TODO: Если попали сюда, значит надо смотреть BitBltRasterOperation + // TODO: If we got here, need to check BitBltRasterOperation if (lHeaderOffset > 0) m_oStream.Skip(lHeaderOffset); @@ -318,7 +318,7 @@ class CSvmFile : virtual public IMetaFileBase TranslatePoint(nX, nY, dX, dY); TranslatePoint(nX + nW, nY + nH, dR, dB); - //Если каждый 4-ый байт оставить 0, то получим черную картинку + // If every 4th byte is left as 0, we get a black image for (int nIndex = 3, nSize = 4 * unImageW * unImageH; nIndex < nSize; nIndex += 4) pImageBuffer[nIndex] = 255; @@ -447,7 +447,7 @@ class CSvmFile : virtual public IMetaFileBase m_pOutput->ArcTo(dL, dT, dR, dB, dStart, dSweep); } - // Пересчет текущей позиции делается в каждой функции отдельно после вызова данной + // Current position recalculation is done separately in each function after calling this one } void DrawPath(bool bStroke, bool bFill) { diff --git a/DesktopEditor/raster/Metafile/StarView/SvmObjects.cpp b/DesktopEditor/raster/Metafile/StarView/SvmObjects.cpp index 2c774bcbf9..a0ab00be53 100644 --- a/DesktopEditor/raster/Metafile/StarView/SvmObjects.cpp +++ b/DesktopEditor/raster/Metafile/StarView/SvmObjects.cpp @@ -171,7 +171,7 @@ namespace MetaFile else { string = NSStringExt::CConverter::GetUnicodeFromSingleByteString((unsigned char*)stream.GetCurPtr(), length, - (NSStringExt::CConverter::ESingleByteEncoding)charset); //не все + (NSStringExt::CConverter::ESingleByteEncoding)charset); // not all } } stream.Skip(length); @@ -424,7 +424,7 @@ CDataStream& operator>>(CDataStream &stream, TSvmColorEx &c) } else { - //из таблички + // from table } return stream; diff --git a/DesktopEditor/raster/Metafile/StarView/SvmObjects.h b/DesktopEditor/raster/Metafile/StarView/SvmObjects.h index c2aefa243e..263f16b7bc 100644 --- a/DesktopEditor/raster/Metafile/StarView/SvmObjects.h +++ b/DesktopEditor/raster/Metafile/StarView/SvmObjects.h @@ -402,7 +402,7 @@ public: std::wstring sFamilyName; std::wstring sStyle; - // Согласно спецификации длина имени не должна превышать 32 знака с учетом нулевого символа в конце + // According to specification, name length should not exceed 32 characters including null terminator }; class CSvmPen : public CSvmObjectBase, public IPen diff --git a/DesktopEditor/raster/Metafile/StarView/SvmPlayer.cpp b/DesktopEditor/raster/Metafile/StarView/SvmPlayer.cpp index 6a9c1f3481..abeb225bdb 100644 --- a/DesktopEditor/raster/Metafile/StarView/SvmPlayer.cpp +++ b/DesktopEditor/raster/Metafile/StarView/SvmPlayer.cpp @@ -201,7 +201,7 @@ CSvmDC* CSvmPlayer::GetDC() void CSvmPlayer::RegisterObject(CSvmObjectBase* pObject) { - // Найдем наименьший доступный индекс + // Find the smallest available index unsigned short ushIndex = m_ushIndex; int nAvailableIndex = -1; if (m_vAvailableIndexes.size() > 0) @@ -240,7 +240,7 @@ void CSvmPlayer::SetRasterOp(int op) } void CSvmPlayer::InitStockObjects() { - InitStockBrush(false, 0x00, 0x00, 0x00, 0xff); //прозрачный + InitStockBrush(false, 0x00, 0x00, 0x00, 0xff); // transparent InitStockPen(false, 0x00, 0x00, 0x00); } void CSvmPlayer::Pop() @@ -315,7 +315,7 @@ void CSvmPlayer::Pop() //} } -void CSvmPlayer::Push(int nFlags) // объекты с множественной настройкой +void CSvmPlayer::Push(int nFlags) // objects with multiple settings { m_nFlags = nFlags; //if ( nFlags & PUSH_LINECOLOR ) @@ -559,7 +559,7 @@ void CSvmDC::SetMapMode(TSvmMapMode & mapMode, bool prefered ) }break; case MAP_SYSFONT: case MAP_APPFONT: - //хз + // unknown break; case MAP_RELATIVE: SetPixelWidth(dPixel); diff --git a/DesktopEditor/raster/Metafile/Wmf/WmfInterpretator/CInterpretatorSvgBase.cpp b/DesktopEditor/raster/Metafile/Wmf/WmfInterpretator/CInterpretatorSvgBase.cpp index 494bb59148..fc7164de1f 100644 --- a/DesktopEditor/raster/Metafile/Wmf/WmfInterpretator/CInterpretatorSvgBase.cpp +++ b/DesktopEditor/raster/Metafile/Wmf/WmfInterpretator/CInterpretatorSvgBase.cpp @@ -339,7 +339,7 @@ namespace MetaFile else if (pFont->IsStrikeOut()) arNodeAttributes.Add(L"text-decoration", L"line-through"); - //TODO:: разобраться для корректной работы + //TODO:: figure out for correct operation // double dFontCharSpace = pFont->GetCharSet(); // if (dFontCharSpace > 1) @@ -355,7 +355,7 @@ namespace MetaFile if (ulTextAlign & TA_BASELINE) { ulTextAlign -= TA_BASELINE; - // Ничего не делаем + // Do nothing } else if (ulTextAlign & TA_BOTTOM || ulVTextAlign == VTA_BOTTOM) { @@ -389,10 +389,10 @@ namespace MetaFile } else //if (ulTextAlign & TA_LEFT) { - // Ничего не делаем + // Do nothing } - if (oScale.Y < -0.00001) //TODO::Тоже нужно и для dXScale + if (oScale.Y < -0.00001) //TODO:: Also needed for dXScale { dYCoord += dFontHeight; @@ -660,7 +660,7 @@ namespace MetaFile unsigned int ulPenEndCap = unMetaPenStyle & PS_ENDCAP_MASK; unsigned int ulPenJoin = unMetaPenStyle & PS_JOIN_MASK; - // svg не поддерживает разные стили для разных сторон линии + // svg doesn't support different styles for different line sides std::wstring wsLineCap, wsLineJoin; if (PS_ENDCAP_ROUND == ulPenEndCap) diff --git a/DesktopEditor/raster/Metafile/Wmf/WmfInterpretator/CWmfInterpretatorBase.h b/DesktopEditor/raster/Metafile/Wmf/WmfInterpretator/CWmfInterpretatorBase.h index 85404ca032..fe14e6934c 100644 --- a/DesktopEditor/raster/Metafile/Wmf/WmfInterpretator/CWmfInterpretatorBase.h +++ b/DesktopEditor/raster/Metafile/Wmf/WmfInterpretator/CWmfInterpretatorBase.h @@ -95,7 +95,7 @@ namespace MetaFile //----------------------------------------------------------- virtual void HANDLE_META_ESCAPE(unsigned short ushEscapeFunction, unsigned short ushByteCount) = 0; //----------------------------------------------------------- - // Неизвестные записи + // Unknown records //----------------------------------------------------------- virtual void HANDLE_META_UNKNOWN(CDataStream& oDataStream) = 0; }; diff --git a/DesktopEditor/raster/Metafile/Wmf/WmfInterpretator/CWmfInterpretatorRender.h b/DesktopEditor/raster/Metafile/Wmf/WmfInterpretator/CWmfInterpretatorRender.h index 210ea23738..952a2154c8 100644 --- a/DesktopEditor/raster/Metafile/Wmf/WmfInterpretator/CWmfInterpretatorRender.h +++ b/DesktopEditor/raster/Metafile/Wmf/WmfInterpretator/CWmfInterpretatorRender.h @@ -48,7 +48,7 @@ namespace MetaFile private: CMetaFileRenderer *m_pMetaFileRenderer; public: - //Следующие методы ничего не делают + // The following methods do nothing void HANDLE_META_HEADER(const TWmfPlaceable&, const TWmfHeader&) override {}; //----------------------------------------------------------- // 2.3.1 Bitmap records @@ -131,7 +131,7 @@ namespace MetaFile //----------------------------------------------------------- void HANDLE_META_ESCAPE(unsigned short ushEscapeFunction, unsigned short ushByteCount) override {}; //----------------------------------------------------------- - // Неизвестные записи + // Unknown records //----------------------------------------------------------- void HANDLE_META_UNKNOWN(CDataStream& oDataStream) override {}; }; diff --git a/DesktopEditor/raster/Metafile/Wmf/WmfInterpretator/CWmfInterpretatorSvg.cpp b/DesktopEditor/raster/Metafile/Wmf/WmfInterpretator/CWmfInterpretatorSvg.cpp index 0f3ef598e8..3dcead9b9e 100644 --- a/DesktopEditor/raster/Metafile/Wmf/WmfInterpretator/CWmfInterpretatorSvg.cpp +++ b/DesktopEditor/raster/Metafile/Wmf/WmfInterpretator/CWmfInterpretatorSvg.cpp @@ -119,7 +119,7 @@ namespace MetaFile void CWmfInterpretatorSvg::HANDLE_META_CHORD(short shYEndArc, short shXEndArc, short shYStartArc, short shXStartArc, short shBottom, short shRight, short shTop, short shLeft) { - //TODO:: реализовать + // TODO: implement } void CWmfInterpretatorSvg::HANDLE_META_ELLIPSE(short shBottom, short shRight, short shTop, short shLeft) @@ -206,7 +206,7 @@ namespace MetaFile void CWmfInterpretatorSvg::HANDLE_META_FRAMEREGION(unsigned short ushRegionIndex, unsigned short ushBrushIndex, short shHeight, short shWidth) { - //TODO:: реализовать + // TODO: implement } void CWmfInterpretatorSvg::HANDLE_META_INVERTREGION(unsigned short ushRegionIndex) @@ -233,7 +233,7 @@ namespace MetaFile void CWmfInterpretatorSvg::HANDLE_META_PAINTREGION(unsigned short ushRegionIndex) { - //TODO:: реализовать + // TODO: implement } void CWmfInterpretatorSvg::HANDLE_META_PATBLT(unsigned int unRasterOperation, short shH, short shW, short shY, short shX) @@ -390,7 +390,7 @@ namespace MetaFile void CWmfInterpretatorSvg::HANDLE_META_SETPIXEL(const TRGBA &oColor, short shY, short shX) { - //TODO:: реализовать + // TODO: implement } void CWmfInterpretatorSvg::HANDLE_META_TEXTOUT(short shStringLength, unsigned char *pString, short shX, short shY) @@ -403,7 +403,7 @@ namespace MetaFile NSStringExt::CConverter::ESingleByteEncoding eCharSet = NSStringExt::CConverter::ESingleByteEncoding::SINGLE_BYTE_ENCODING_DEFAULT;; if (pFont) { - // Соответствие Charset -> Codepage: http://support.microsoft.com/kb/165478 + // Charset -> Codepage mapping: http://support.microsoft.com/kb/165478 // http://msdn.microsoft.com/en-us/library/cc194829.aspx // Charset Name Charset Value(hex) Codepage number // ------------------------------------------------------ diff --git a/DesktopEditor/raster/Metafile/Wmf/WmfInterpretator/CWmfInterpretatorSvg.h b/DesktopEditor/raster/Metafile/Wmf/WmfInterpretator/CWmfInterpretatorSvg.h index 326a3a3277..fea985be56 100644 --- a/DesktopEditor/raster/Metafile/Wmf/WmfInterpretator/CWmfInterpretatorSvg.h +++ b/DesktopEditor/raster/Metafile/Wmf/WmfInterpretator/CWmfInterpretatorSvg.h @@ -97,14 +97,14 @@ namespace MetaFile //----------------------------------------------------------- void HANDLE_META_ESCAPE(unsigned short ushEscapeFunction, unsigned short ushByteCount) override {}; //----------------------------------------------------------- - // Неизвестные записи + // Unknown records //----------------------------------------------------------- void HANDLE_META_UNKNOWN(CDataStream& oDataStream) override {}; public: void DrawBitmap(double dX, double dY, double dW, double dH, BYTE* pBuffer, unsigned int unWidth, unsigned int unHeight, unsigned int unBlendMode) override; - //Следующие методы ничего не делают + // The following methods do nothing void Begin() override {}; void End() override {}; diff --git a/DesktopEditor/raster/Metafile/Wmf/WmfInterpretator/cwmfinterpretator.h b/DesktopEditor/raster/Metafile/Wmf/WmfInterpretator/cwmfinterpretator.h index bff6cb6dec..d9832526bd 100644 --- a/DesktopEditor/raster/Metafile/Wmf/WmfInterpretator/cwmfinterpretator.h +++ b/DesktopEditor/raster/Metafile/Wmf/WmfInterpretator/cwmfinterpretator.h @@ -9,7 +9,7 @@ namespace MetaFile { public: CWmfInterpretator(); - //TODO:: реализовать + // TODO: implement }; } diff --git a/DesktopEditor/raster/Metafile/Wmf/WmfObjects.cpp b/DesktopEditor/raster/Metafile/Wmf/WmfObjects.cpp index b697d0843a..837ea9d130 100644 --- a/DesktopEditor/raster/Metafile/Wmf/WmfObjects.cpp +++ b/DesktopEditor/raster/Metafile/Wmf/WmfObjects.cpp @@ -75,8 +75,8 @@ namespace MetaFile void CWmfBrush::SetDibPattern(unsigned char* pBuffer, unsigned int ulWidth, unsigned int ulHeight) { #ifdef METAFILE_DISABLE_FILESYSTEM - // без использования файловой системы пока реализовать не получится при конвертации в растр, - // так как на данный момент картинку кисти передать в рендер можно только с помощью использования файловой системы + // without using filesystem this cannot be implemented yet when converting to raster, + // since currently brush image can only be passed to renderer using the filesystem // (CMetaFileRenderer::UpdateBrush()) m_pRenderer->put_BrushTexturePath(pBrush->GetDibPatterPath()); #else diff --git a/DesktopEditor/raster/Metafile/Wmf/WmfObjects.h b/DesktopEditor/raster/Metafile/Wmf/WmfObjects.h index a3a31b3d1a..5692aa70e0 100644 --- a/DesktopEditor/raster/Metafile/Wmf/WmfObjects.h +++ b/DesktopEditor/raster/Metafile/Wmf/WmfObjects.h @@ -127,7 +127,7 @@ namespace MetaFile unsigned char uchClipPrecision; unsigned char uchQuality; unsigned char uchPitchAndFamily; - unsigned char uchFacename[32]; // Согласно спецификации длина имени не должна превышать 32 знака с учетом нулевого символа в конце + unsigned char uchFacename[32]; // According to spec, name length should not exceed 32 chars including null terminator }; class CWmfPalette : public CWmfObjectBase { @@ -169,9 +169,9 @@ namespace MetaFile virtual ~CWmfRegion(); virtual EWmfObjectType GetType() const override; public: - short shNextInChain; // не используется - short shObjectType; // не используется - int shObjectCount; // не используется + short shNextInChain; // not used + short shObjectType; // not used + int shObjectCount; // not used short shRegionSize; short shScanCount; short shMaxScan; diff --git a/DesktopEditor/raster/Metafile/Wmf/WmfParser/CWmfParser.cpp b/DesktopEditor/raster/Metafile/Wmf/WmfParser/CWmfParser.cpp index cada341c75..7feac20b0d 100644 --- a/DesktopEditor/raster/Metafile/Wmf/WmfParser/CWmfParser.cpp +++ b/DesktopEditor/raster/Metafile/Wmf/WmfParser/CWmfParser.cpp @@ -47,7 +47,7 @@ namespace MetaFile m_oStream >> ushType; - m_unRecordSize = unSize * 2; // Размер указан в WORD + m_unRecordSize = unSize * 2; // Size is specified in WORD m_oStream.SetCurrentBlockSize(m_unRecordSize); @@ -145,7 +145,7 @@ namespace MetaFile //----------------------------------------------------------- case META_ESCAPE: Read_META_ESCAPE(); break; //----------------------------------------------------------- - // Неизвестные записи + // Unknown records //----------------------------------------------------------- default: { @@ -157,7 +157,7 @@ namespace MetaFile if (m_bEof) break; - // Пропускаем лишние байты, которые могли быть в записи + // Skip extra bytes that might have been in the record int need_skip = m_unRecordSize - (m_oStream.Tell() - m_unRecordPos); m_oStream.Skip(need_skip); m_oStream.ClearCurrentBlockSize(); @@ -251,7 +251,7 @@ namespace MetaFile TWmfBitmap16 oBitmap16; m_oStream >> oBitmap16; - // TODO: Сделать чтение Bitmap16 + // TODO: Implement Bitmap16 reading } else { @@ -311,7 +311,7 @@ namespace MetaFile TWmfBitmap16 oBitmap16; m_oStream >> oBitmap16; - // TODO: Сделать чтение Bitmap16 + // TODO: Implement Bitmap16 reading } else { @@ -387,7 +387,7 @@ namespace MetaFile short* pDx = NULL; if (shStringLength > 0 && ((GetRecordRemainingBytesCount() >= shStringLength * 2 && !(ushFwOptions & ETO_PDY)) || (GetRecordRemainingBytesCount() >= shStringLength * 4 && ushFwOptions & ETO_PDY))) { - if (shStringLength & 1) // Если длина нечетная, тогда пропускаем 1 байт, т.к. тут прилегание по 2 байта + if (shStringLength & 1) // If length is odd, skip 1 byte because of 2-byte alignment m_oStream.Skip(1); pDx = new short[shStringLength]; @@ -637,7 +637,7 @@ namespace MetaFile TWmfBitmap16 oBitmap16; m_oStream >> oBitmap16; - // TODO: Сделать чтение Bitmap16 + // TODO: Implement Bitmap16 reading } HANDLE_META_CREATEPATTERNBRUSH(*pBrush, m_oStream); diff --git a/DesktopEditor/raster/Metafile/Wmf/WmfParser/CWmfParser.h b/DesktopEditor/raster/Metafile/Wmf/WmfParser/CWmfParser.h index f8d727788a..d946bbd3e4 100644 --- a/DesktopEditor/raster/Metafile/Wmf/WmfParser/CWmfParser.h +++ b/DesktopEditor/raster/Metafile/Wmf/WmfParser/CWmfParser.h @@ -104,7 +104,7 @@ namespace MetaFile //----------------------------------------------------------- void Read_META_ESCAPE(); //----------------------------------------------------------- - // Неизвестные записи + // Unknown records //----------------------------------------------------------- void Read_META_UNKNOWN(); }; diff --git a/DesktopEditor/raster/Metafile/Wmf/WmfParser/CWmfParserBase.cpp b/DesktopEditor/raster/Metafile/Wmf/WmfParser/CWmfParserBase.cpp index 5c8a798c2e..f764fb7d71 100644 --- a/DesktopEditor/raster/Metafile/Wmf/WmfParser/CWmfParserBase.cpp +++ b/DesktopEditor/raster/Metafile/Wmf/WmfParser/CWmfParserBase.cpp @@ -176,7 +176,7 @@ namespace MetaFile { RELEASEOBJECT(m_pInterpretator); - //TODO:: добавить как появится реализация интерпретаторов + //TODO:: add when interpretators implementation appears } CWmfInterpretatorBase* CWmfParserBase::GetInterpretator() @@ -247,7 +247,7 @@ namespace MetaFile m_oDCRect.Bottom = static_cast<int>(std::round(m_oDCRect.Bottom * dKoef)); } - // Иногда m_oPlaceable.BoundingBox задается нулевой ширины и высоты + // Sometimes m_oPlaceable.BoundingBox is set with zero width and height if (abs(m_oDCRect.Right - m_oDCRect.Left) <= 1) { m_oDCRect.Right = m_oBoundingBox.Right; @@ -319,8 +319,8 @@ namespace MetaFile void CWmfParserBase::ArcTo(short shL, short shT, short shR, short shB, double dStart, double dSweep) { - // Тут не делаем пересчет текущей точки, т.к. при вызове данной функции не всегда он нужен (например эллипс). - // Текущая точка обновляется на том уровне, на котором вызывалась данная функция. + // We don't recalculate current point here, because it's not always needed when this function is called (e.g. ellipse). + // Current point is updated at the level where this function was called. if (NULL != m_pInterpretator) { double dL, dT, dR, dB; @@ -330,7 +330,7 @@ namespace MetaFile } else { - // TODO: Возможно нужно регистрировать более точно + // TODO: Perhaps need to register more precisely RegisterPoint(shL, shT); RegisterPoint(shR, shB); } @@ -401,8 +401,8 @@ namespace MetaFile { if (pFont) { - // TODO: Здесь идет точное повторение кода из CMetaFileRenderer->DrawString - // неплохо бы перенести этот пересчет в базовый класс IMetaFileBase. + // TODO: This is an exact copy of code from CMetaFileRenderer->DrawString + // would be good to move this recalculation to base class IMetaFileBase. NSFonts::IFontManager* pFontManager = GetFontManager(); if (pFontManager) { @@ -433,7 +433,7 @@ namespace MetaFile if (NULL != pDx && unCharsCount > 1) { - // Тогда мы складываем все pDx кроме последнего символа, последний считаем отдельно + // Then we sum all pDx except the last character, the last one is calculated separately double dTempTextW = 0; for (unsigned int unCharIndex = 0; unCharIndex < unCharsCount - 1; unCharIndex++) { @@ -473,11 +473,11 @@ namespace MetaFile double dX = (double)nX; double dY = (double)nY; - // Найдем начальную точку текста + // Find the starting point of the text unsigned int ulTextAlign = GetTextAlign(); if (ulTextAlign & TA_BASELINE) { - // Ничего не делаем + // Do nothing } else if (ulTextAlign & TA_BOTTOM) { @@ -506,7 +506,7 @@ namespace MetaFile } else //if (ulTextAlign & TA_LEFT) { - // Ничего не делаем + // Do nothing } double dX0 = dX + fL, dY0 = dY + fT; @@ -542,7 +542,7 @@ namespace MetaFile if (NULL != pDx && unCharsCount > 1) { - // Тогда мы складываем все pDx кроме последнего символа, последний считаем отдельно + // Then we sum all pDx except the last character, the last one is calculated separately double dTempTextW = 0; for (unsigned int unCharIndex = 0; unCharIndex < unCharsCount - 1; unCharIndex++) { @@ -567,11 +567,11 @@ namespace MetaFile double dX = (double)nX; double dY = (double)nY; - // Найдем начальную точку текста + // Find the starting point of the text unsigned int ulTextAlign = GetTextAlign(); if (ulTextAlign & TA_BASELINE) { - // Ничего не делаем + // Do nothing } else if (ulTextAlign & TA_BOTTOM) { @@ -600,7 +600,7 @@ namespace MetaFile } else //if (ulTextAlign & TA_LEFT) { - // Ничего не делаем + // Do nothing } double dX0 = dX + fL, dY0 = dY + fT; @@ -817,8 +817,8 @@ namespace MetaFile } } - // Если у нас не задан Output, значит мы считаем, что идет сканирование метафайла. - // Во время сканирования мы регистрируем все точки и вычисляем BoundingBox + // If Output is not set, we assume the metafile is being scanned. + // During scanning we register all points and calculate BoundingBox if (NULL == m_pInterpretator) m_bFirstPoint = true; @@ -837,7 +837,7 @@ namespace MetaFile unsigned int unRecordSizeDword = m_unRecordSize >> 1; unsigned int unValue = (META_DIBBITBLT >> 8) + 3; - if (unRecordSizeDword == unValue) // похоже на META_PATBLT + if (unRecordSizeDword == unValue) // looks like META_PATBLT { if (0x00F00021 == oWmfBitBlt.unRasterOperation) { @@ -885,7 +885,7 @@ namespace MetaFile TRectL oDestRect(oWmfSetDibToDev.ushXDest, oWmfSetDibToDev.ushYDest, oWmfSetDibToDev.ushXDest + oWmfSetDibToDev.ushWidth, oWmfSetDibToDev.ushYDest + oWmfSetDibToDev.ushHeight); - // TODO: Тут надо делать обрезку в зависимости от ScanCount и StartScan. Как встретится файл сделать. + // TODO: Need to crop depending on ScanCount and StartScan. Do it when a file is found. DrawImage(oDestRect, oDestRect, oWmfSetDibToDev.ushColorUsage, 0); } @@ -1043,7 +1043,7 @@ namespace MetaFile if (NULL != m_pInterpretator) m_pInterpretator->HANDLE_META_INVERTREGION(ushRegionIndex); - //TODO:: реализовать + //TODO:: implement } void CWmfParserBase::HANDLE_META_LINETO(short shY, short shX) @@ -1090,7 +1090,7 @@ namespace MetaFile if (NULL != m_pInterpretator) m_pInterpretator->HANDLE_META_PATBLT(unRasterOperation, shH, shW, shY, shX); - // TODO: Нужно использовать растровую операцию unRasterOperation + // TODO: Need to use raster operation unRasterOperation MoveTo(shX, shY); LineTo(shX + shW, shY); @@ -1111,7 +1111,7 @@ namespace MetaFile double dStartAngle = GetEllipseAngle(shL, shT, shR, shB, shXRadial1, shYRadial1); double dEndAngle = GetEllipseAngle(shL, shT, shR, shB, shXRadial2, shYRadial2); - //TODO: это получается заглушка, поэтому нужно научиться определять угол с учетом направления рисования + //TODO: this is a stub, need to learn how to determine the angle considering the drawing direction if (shXRadial2 >= shCenterX && shYRadial2 <= shCenterY && shXRadial1 >= shCenterX && shYRadial1 >= shCenterY) dEndAngle -= 360; @@ -1330,8 +1330,8 @@ namespace MetaFile if (NULL != m_pInterpretator) m_pInterpretator->HANDLE_META_SELECTCLIPREGION(ushIndex); - // Тут просто сбрасываем текущий клип. Ничего не добавляем в клип, т.е. реализовать регионы с - // текущим интерфейсом рендерера невозможно. + // Here we just reset the current clip. We don't add anything to the clip, + // i.e. implementing regions with the current renderer interface is not possible. m_pDC->GetClip()->Reset(); UpdateOutputDC(); } @@ -1356,8 +1356,8 @@ namespace MetaFile void CWmfParserBase::HANDLE_META_EXCLUDECLIPRECT(short shBottom, short shRight, short shTop, short shLeft) { - // Поскольку мы реализовываем данный тип клипа с помощью разницы внешнего ректа и заданного, и - // пересечением с полученной областью, то нам надо вычесть границу заданного ректа. + // Since we implement this clip type by taking the difference between the outer rect and the given one, + // and intersecting with the resulting area, we need to subtract the boundary of the given rect. if (shLeft < shRight) { shLeft--; @@ -1428,7 +1428,7 @@ namespace MetaFile if (NULL != m_pInterpretator) m_pInterpretator->HANDLE_META_MOVETO(shOffsetX, shOffsetY); - // TODO: Реализовать + // TODO: Implement UpdateOutputDC(); } @@ -1594,7 +1594,7 @@ namespace MetaFile if (NULL != m_pInterpretator) m_pInterpretator->HANDLE_META_SETTEXTJUSTIFICATION(ushBreakCount, ushBreakExtra); - // TODO: Реализовать + // TODO: Implement UpdateOutputDC(); } @@ -1765,7 +1765,7 @@ namespace MetaFile m_oEscapeBuffer.Clear(); } } - // TODO: Реализовать + // TODO: Implement } void CWmfParserBase::HANDLE_META_UNKNOWN(CDataStream &oDataStream) diff --git a/DesktopEditor/raster/Metafile/Wmf/WmfParser/CWmfParserBase.h b/DesktopEditor/raster/Metafile/Wmf/WmfParser/CWmfParserBase.h index 873534a25e..2571ff5b33 100644 --- a/DesktopEditor/raster/Metafile/Wmf/WmfParser/CWmfParserBase.h +++ b/DesktopEditor/raster/Metafile/Wmf/WmfParser/CWmfParserBase.h @@ -313,7 +313,7 @@ namespace MetaFile //----------------------------------------------------------- void HANDLE_META_ESCAPE(unsigned short ushEscapeFunction, unsigned short ushByteCount); //----------------------------------------------------------- - // Неизвестные записи + // Unknown records //----------------------------------------------------------- void HANDLE_META_UNKNOWN(CDataStream& oDataStream); }; diff --git a/DesktopEditor/raster/Metafile/Wmf/WmfPlayer.cpp b/DesktopEditor/raster/Metafile/Wmf/WmfPlayer.cpp index 190125b826..845e2b7513 100644 --- a/DesktopEditor/raster/Metafile/Wmf/WmfPlayer.cpp +++ b/DesktopEditor/raster/Metafile/Wmf/WmfPlayer.cpp @@ -134,7 +134,7 @@ namespace MetaFile } void CWmfPlayer::RegisterObject(CWmfObjectBase* pObject) { - // Найдем наименьший доступный индекс + // Find the smallest available index unsigned short ushIndex = m_ushIndex; int nAvailableIndex = -1; if (m_vAvailableIndexes.size() > 0) @@ -222,7 +222,7 @@ namespace MetaFile { if (std::find(m_vAvailableIndexes.begin(), m_vAvailableIndexes.end(), ushIndex) != m_vAvailableIndexes.end()) { - // Данный индекс уже есть в списке доступных + // This index is already in the available list } else { diff --git a/DesktopEditor/raster/Metafile/svg/SVGFramework.cpp b/DesktopEditor/raster/Metafile/svg/SVGFramework.cpp index fce5a9f5a8..f0f4c72876 100644 --- a/DesktopEditor/raster/Metafile/svg/SVGFramework.cpp +++ b/DesktopEditor/raster/Metafile/svg/SVGFramework.cpp @@ -1586,7 +1586,7 @@ namespace SVG m_render->put_PenLineStartCap(c_ag_LineCapRoundAnchor); if (c_ag_LineJoinBevel == nStrokeLineJoin) - m_render->put_PenLineStartCap(c_ag_LineCapTriangle); // видимо на строне рендера есть проблема с таким стилем + m_render->put_PenLineStartCap(c_ag_LineCapTriangle); // apparently there is a problem with this style on the renderer side if (c_ag_LineJoinMiter == nStrokeLineJoin) m_render->put_PenLineStartCap(c_ag_LineCapSquare); @@ -1655,7 +1655,7 @@ namespace SVG m_render->put_PenLineStartCap(c_ag_LineCapRoundAnchor); if (c_ag_LineJoinBevel == nStrokeLineJoin) - m_render->put_PenLineStartCap(c_ag_LineCapTriangle); // видимо на строне рендера есть проблема с таким стилем + m_render->put_PenLineStartCap(c_ag_LineCapTriangle); // apparently there is a problem with this style on the renderer side if (c_ag_LineJoinMiter == nStrokeLineJoin) m_render->put_PenLineStartCap(c_ag_LineCapSquare); @@ -2308,7 +2308,7 @@ namespace SVG } else { - // сдвинутый тайл + // shifted tile Point move = Point (m_pattern->GetBound().GetX(), m_pattern->GetBound().GetY()); @@ -2330,7 +2330,7 @@ namespace SVG SaveImage(m_pPatternFrame, m_sLivePath); } - // освободим память + // free memory RELEASEINTERFACE(m_render); RELEASEOBJECT(m_pFrame); diff --git a/DesktopEditor/raster/Metafile/svg/SVGFramework.h b/DesktopEditor/raster/Metafile/svg/SVGFramework.h index f83beaa058..d1368e397c 100644 --- a/DesktopEditor/raster/Metafile/svg/SVGFramework.h +++ b/DesktopEditor/raster/Metafile/svg/SVGFramework.h @@ -839,25 +839,25 @@ namespace SVG } inline double AngToEllPrm(double fAngle, double fXRad, double fYRad) { - // Функция для перевода реального угла в параметрическое задание эллписа - // т.е. x= a cos(t) y = b sin(t) - параметрическое задание эллписа. + // Function to convert real angle to parametric ellipse representation + // i.e. x= a cos(t) y = b sin(t) - parametric representation of ellipse. // x = r cos(p), y = r sin(p) => t = atan2( sin(p) / b, cos(p) / a ); return atan2( sin( fAngle ) / fYRad, cos( fAngle ) / fXRad ); } inline int EllipseArc2(double fX, double fY, double fXRad, double fYRad, double fAngle1, double fAngle2, bool bClockDirection) { - // переведем углы в радианы + // convert angles to radians int nRet = 0; double dAngle1 = fAngle1 * 3.141592 / 180; double dAngle2 = fAngle2 * 3.141592 / 180; - // Выясним в каких четвертях находятся начальная и конечная точки + // Determine in which quadrants the start and end points are located unsigned int nFirstPointQuard = int(fAngle1) / 90 + 1; unsigned int nSecondPointQuard = int(fAngle2) / 90 + 1; nSecondPointQuard = std::min( (unsigned int)4, std::max( (unsigned int)1, nSecondPointQuard ) ); nFirstPointQuard = std::min( (unsigned int)4, std::max( (unsigned int)1, nFirstPointQuard ) ); - // Проведем линию в начальную точку дуги + // Draw a line to the starting point of the arc double fStartX = 0.0, fStartY = 0.0, fEndX = 0.0, fEndY = 0.0; fStartX = fX + fXRad * cos( AngToEllPrm( dAngle1, fXRad, fYRad ) ); @@ -865,7 +865,7 @@ namespace SVG // _LineTo(fStartX, fStartY); - // Дальше рисуем по четверям + // Continue drawing by quadrants double fCurX = fStartX, fCurY = fStartY; double dStartAngle = dAngle1; @@ -906,7 +906,7 @@ namespace SVG } inline int EllipseArc3(double fX, double fY, double fXRad, double fYRad, double dAngle1, double dAngle2, double *pfXCur, double *pfYCur, bool bClockDirection = false) { - // Рассчитаем начальную, конечную и контрольные точки + // Calculate start, end and control points double fX1 = 0.0, fX2 = 0.0, fY1 = 0.0, fY2 = 0.0; double fCX1 = 0.0, fCX2 = 0.0, fCY1 = 0.0, fCY2 = 0.0; @@ -1378,7 +1378,7 @@ namespace SVG double m_dOffSetX; double m_dOffSetY; }; - class Style // map добавим по мере надобности + class Style // map will be added as needed { public: Style() @@ -2172,16 +2172,16 @@ namespace SVG inline bool Read (XmlUtils::CXmlNode& oXml, UnitSystem& us, IRefStorage* model, const ColorTable& colors = ColorTable()) { - // TODO: универсальный селектор * {margin:0; padding:0;} - // TODO: селекторами элементов p {font-family: Garamond, serif;} - // TODO: селекторами классов .note {color: red; background: yellow; font-weight: bold;} - // TODO: селекторами идентификаторов #paragraph1 {margin: 0;} - // TODO: селекторами атрибутов a[href="http://www.somesite.com"]{font-weight:bold;} - // TODO: селекторами потомков (контекстными селекторами) div#paragraph1 p.note {color: red;} - // TODO: селекторами дочерних элементов p.note > b {color: green;} - // TODO: селекторами сестринских элементов h1 + p {font-size: 24pt;} - // TODO: селекторами псевдоклассов a:active {color:yellow;} - // TODO: селекторами псевдоэлементов p::first-letter {font-size: 32px;} + // TODO: universal selector * {margin:0; padding:0;} + // TODO: element selectors p {font-family: Garamond, serif;} + // TODO: class selectors .note {color: red; background: yellow; font-weight: bold;} + // TODO: id selectors #paragraph1 {margin: 0;} + // TODO: attribute selectors a[href="http://www.somesite.com"]{font-weight:bold;} + // TODO: descendant selectors (contextual selectors) div#paragraph1 p.note {color: red;} + // TODO: child element selectors p.note > b {color: green;} + // TODO: sibling element selectors h1 + p {font-size: 24pt;} + // TODO: pseudo-class selectors a:active {color:yellow;} + // TODO: pseudo-element selectors p::first-letter {font-size: 32px;} std::wstring source = oXml.GetText(); @@ -2318,11 +2318,11 @@ namespace SVG private: bool m_IsValid; - std::map<std::wstring, Style> m_classStyles; // селекторы классов - Style m_typeStyles[ENodesCount]; // селекторы элементов + std::map<std::wstring, Style> m_classStyles; // class selectors + Style m_typeStyles[ENodesCount]; // element selectors std::vector<std::wstring> m_selectors; - // TODO: остальные типа селекторов + // TODO: other selector types }; } @@ -2622,7 +2622,7 @@ namespace SVG } - inline bool Push(const Matrix& transform, bool combine = true) // каждая последующая трансформация применяется к вершине стэка + inline bool Push(const Matrix& transform, bool combine = true) // each subsequent transformation is applied to the top of the stack { if ((0 == m_transforms.size()) || (false == combine)) { @@ -3032,7 +3032,7 @@ namespace SVG int Ind = -1; while ( 0 != Ind ) - Ind = buffer.Remove ( _T(' ') ); // в некоторых SVG были пробелы + Ind = buffer.Remove ( _T(' ') ); // some SVGs had spaces return CreateImage ( (BYTE*) ( buffer.GetBuffer () ), buffer.GetLength (), EncoderType ); } @@ -3865,7 +3865,7 @@ namespace SVG m_Source = oXmlNode.GetText (); - // стиль может задаваться вообще где то вверху по дереву + // style can be set somewhere up in the tree m_oFontStyle.UpdateStyle ( oXmlNode ); return true; @@ -4132,10 +4132,10 @@ namespace SVG } virtual bool RefreshXLinkSource (IRefStorage* pStorage) { - if (NULL != m_pRefLink) // связь уже есть, нет смысла опять искать соотвествие + if (NULL != m_pRefLink) // link already exists, no need to search for a match again return true; - if (m_bBrokeRefLink) // нету связи + if (m_bBrokeRefLink) // no link return false; if (!m_XLinkRef.empty()) @@ -4239,7 +4239,7 @@ namespace SVG return true; } - inline void AddContent(DrawElement* pReference) // храним данные, поэтому сами и очищаем данные + inline void AddContent(DrawElement* pReference) // we store data, so we also clean up the data ourselves { if (pReference) { @@ -4632,7 +4632,7 @@ namespace SVG class GraphicsContainer : public DrawElement, public IRefStorage { public: - GraphicsContainer(bool bRefMode = false) // подчищает ссылки на объекты + GraphicsContainer(bool bRefMode = false) // cleans up references to objects { m_nodeType = EGraphicsContainer; m_pClip = NULL; @@ -5075,7 +5075,7 @@ namespace SVG m_arFlush.push_back(element); } - // объекты с id могут быть использованы вне описания другими элементами, поэтому их надо учитывать + // objects with id can be used outside the description by other elements, so they need to be tracked InternalHashElements(element); return true; @@ -5172,9 +5172,9 @@ namespace SVG bool m_bAddNormMM; std::vector <ISvgRef*> m_arrGroup; - std::map<std::wstring, ISvgRef*> m_arrRef; // индексация (только хранения ссылок) + std::map<std::wstring, ISvgRef*> m_arrRef; // indexing (only storing references) std::wstring m_sWorkingDirectory; - std::vector<ISvgRef*> m_arFlush; // объекты которые нужно удалять + std::vector<ISvgRef*> m_arFlush; // objects that need to be deleted }; class Painter { @@ -5844,7 +5844,7 @@ namespace SVG if (L"pattern" == strXmlNode && m_bDefinesLayer) readInnerNodes = false; - if (L"symbol" == strXmlNode) // контент хранится в соответствующем классе + if (L"symbol" == strXmlNode) // content is stored in the corresponding class return true; } diff --git a/DesktopEditor/raster/Metafile/svg/SvgObjects/CImage.cpp b/DesktopEditor/raster/Metafile/svg/SvgObjects/CImage.cpp index d2b2e8a0c6..2fa8834e84 100644 --- a/DesktopEditor/raster/Metafile/svg/SvgObjects/CImage.cpp +++ b/DesktopEditor/raster/Metafile/svg/SvgObjects/CImage.cpp @@ -25,7 +25,7 @@ namespace SVG else if ("height" == sName) m_oRect.m_oHeight.SetValue(oReader.GetText()); else if ("href" == sName || "xlink:href" == sName) - m_wsHref = oReader.GetText(); // TODO:: В дальнейшем возможно стоит реализовать отдельный класс CHref для всех типов ссылок + m_wsHref = oReader.GetText(); // TODO:: In the future, it may be worth implementing a separate CHref class for all link types else CRenderedObject::SetAttribute(sName, oReader); } diff --git a/DesktopEditor/raster/Metafile/svg/SvgObjects/CLine.cpp b/DesktopEditor/raster/Metafile/svg/SvgObjects/CLine.cpp index 4e39e68425..adcd8edb45 100644 --- a/DesktopEditor/raster/Metafile/svg/SvgObjects/CLine.cpp +++ b/DesktopEditor/raster/Metafile/svg/SvgObjects/CLine.cpp @@ -11,7 +11,7 @@ namespace SVG void CLine::SetAttribute(const std::string& sName, CSvgReader& oReader) { - //TODO:: не нравится, подумать как можно сделать иначе + //TODO:: not ideal, think of how to do this differently if ("x1" == sName) { CMoveElement* pMoveElement{dynamic_cast<CMoveElement*>(operator[](0))}; diff --git a/DesktopEditor/raster/Metafile/svg/SvgObjects/CObjectBase.cpp b/DesktopEditor/raster/Metafile/svg/SvgObjects/CObjectBase.cpp index 5178e496dd..914ac0eee8 100644 --- a/DesktopEditor/raster/Metafile/svg/SvgObjects/CObjectBase.cpp +++ b/DesktopEditor/raster/Metafile/svg/SvgObjects/CObjectBase.cpp @@ -49,8 +49,8 @@ namespace SVG bool CObject::Marked() const { - //Так как по логике кода объект может храниться только в одном контейнере и в списке маркированных элементов, - //то хватит и такой проверки + //Since by code logic an object can only be stored in one container and in the marked elements list, + //this check is sufficient return 1 != m_lRef; } @@ -79,7 +79,7 @@ namespace SVG void CObject::ReadChildrens(CSvgReader& oReader, CSvgFile* pSvgFile) { - //TODO:: реализовано в классах там, где нужно + //TODO:: implemented in classes where needed } void CObject::SetTransform(const std::map<std::wstring, std::wstring> &mAttributes, unsigned short ushLevel, bool bHardMode) diff --git a/DesktopEditor/raster/Metafile/svg/SvgObjects/CPath.h b/DesktopEditor/raster/Metafile/svg/SvgObjects/CPath.h index f47f22052e..2ec6c65d5d 100644 --- a/DesktopEditor/raster/Metafile/svg/SvgObjects/CPath.h +++ b/DesktopEditor/raster/Metafile/svg/SvgObjects/CPath.h @@ -167,7 +167,7 @@ namespace SVG IPathElement *m_pCurrentElement; unsigned int m_unIndexElement; - // Необходимо при рабое с кривыми Безье + // Required when working with Bezier curves double m_dCurveIndex; double m_dCurveStep; }; diff --git a/DesktopEditor/raster/Metafile/svg/SvgObjects/CPattern.cpp b/DesktopEditor/raster/Metafile/svg/SvgObjects/CPattern.cpp index 436ee6519b..5635c81bfd 100644 --- a/DesktopEditor/raster/Metafile/svg/SvgObjects/CPattern.cpp +++ b/DesktopEditor/raster/Metafile/svg/SvgObjects/CPattern.cpp @@ -60,7 +60,7 @@ namespace SVG return; unsigned int alfa = 0xffffff; - //дефолтный тон должен быть прозрачным, а не белым + //default tone should be transparent, not white //memset(pBgraData, 0xff, nWidth * nHeight * 4); for (int i = 0; i < nWidth * nHeight; i++) ((unsigned int*)pBgraData)[i] = alfa; @@ -80,7 +80,7 @@ namespace SVG pGrRenderer->SetTransform(dMMtoPx, 0., 0., dMMtoPx, 0., 0.); - //Отрисовка + //Rendering m_oContainer.Draw(pGrRenderer, pFile); pGrRenderer->EndCommand(c_nImageType); diff --git a/DesktopEditor/raster/Metafile/svg/SvgObjects/CText.cpp b/DesktopEditor/raster/Metafile/svg/SvgObjects/CText.cpp index b5a1b5d9bf..fa7193ec04 100644 --- a/DesktopEditor/raster/Metafile/svg/SvgObjects/CText.cpp +++ b/DesktopEditor/raster/Metafile/svg/SvgObjects/CText.cpp @@ -290,7 +290,7 @@ namespace SVG if (NULL != m_pFontManager) { - // Вычиления размеров текста + // Calculate text dimensions m_pFontManager->LoadFontByName(wsFontFamily, dFontSize, nStyle, 72., 72.); m_pFontManager->SetCharSpacing(0); @@ -305,7 +305,7 @@ namespace SVG TBBox oBox = m_pFontManager->MeasureString2(); fW = (float)dKoef * (oBox.fMaxX - oBox.fMinX); - // Просчитаем положение подчеркивания + // Calculate underline position m_pFontManager->GetUnderline(&fUndX1, &fUndY1, &fUndX2, &fUndY2, &fUndSize); fUndX1 *= (float)dKoef; fUndY1 *= (float)dKoef; @@ -522,7 +522,7 @@ namespace SVG void CTSpan::CorrectFontFamily(std::wstring &wsFontFamily) const { - //TODO:: необходимо более подробно заняться подбором шрифтов + //TODO:: need to work more on font selection if (L"sans-serif" == wsFontFamily) wsFontFamily = L"Arial"; else if (L"serif" == wsFontFamily) @@ -632,7 +632,7 @@ namespace SVG if (m_oText.Underline()) nStyle |= (1 << 2); - // Вычиления размеров текста + // Calculate text dimensions m_pFontManager->LoadFontByName(wsFontFamily, dFontSize, nStyle, 72., 72.); m_pFontManager->SetCharSpacing(0); diff --git a/DesktopEditor/raster/Metafile/test/DisplayingXML/CCustomView.h b/DesktopEditor/raster/Metafile/test/DisplayingXML/CCustomView.h index 94cfe19686..f12e3107d5 100644 --- a/DesktopEditor/raster/Metafile/test/DisplayingXML/CCustomView.h +++ b/DesktopEditor/raster/Metafile/test/DisplayingXML/CCustomView.h @@ -4,7 +4,7 @@ #include <QGraphicsView> #include <Windows.h> -using namespace std; // устраняет ошибки с min, max при компиляции (связано с подключением gdiplus) +using namespace std; // fixes min, max errors during compilation (related to gdiplus inclusion) #include <gdiplus.h> #pragma comment (lib,"gdiplus.lib") diff --git a/DesktopEditor/raster/Metafile/test/DisplayingXML/CMetafileTreeWidget.h b/DesktopEditor/raster/Metafile/test/DisplayingXML/CMetafileTreeWidget.h index fb6ea82cbd..905d400b7a 100644 --- a/DesktopEditor/raster/Metafile/test/DisplayingXML/CMetafileTreeWidget.h +++ b/DesktopEditor/raster/Metafile/test/DisplayingXML/CMetafileTreeWidget.h @@ -21,7 +21,7 @@ class CMetafileTreeWidget : public QWidget void Clear(); void SetMainWindow(MainWindow *pMainWindow); - //Методы QTreeView + //QTreeView methods void setItemDelegate(CTextEditDelegate *pTextEditDelegate); void expandAll(); void collapseAll(); @@ -33,7 +33,7 @@ class CMetafileTreeWidget : public QWidget void setAnimated(bool bEnable); QHeaderView* header(); - //Методы CMetafileTreeView + //CMetafileTreeView methods void SetMetafile(const std::wstring& wsXmlFilePath); bool IsClearTree(); void SetMode(bool bLightMode); diff --git a/DesktopEditor/raster/Metafile/test/DisplayingXML/CRecordCreator.cpp b/DesktopEditor/raster/Metafile/test/DisplayingXML/CRecordCreator.cpp index ff4a16e747..724a4f03ff 100644 --- a/DesktopEditor/raster/Metafile/test/DisplayingXML/CRecordCreator.cpp +++ b/DesktopEditor/raster/Metafile/test/DisplayingXML/CRecordCreator.cpp @@ -79,7 +79,7 @@ void CRecordCreator::on_selectButton_clicked() m_nSelectedRecord = ui->recordsBox->currentIndex(); ClearData(); - switch (m_nSelectedRecord) //TODO: исправить пустые виджеты + switch (m_nSelectedRecord) //TODO: fix empty widgets { case 0: CreatePointWidgets("EMR_POLYBEZIER"); break; case 1: CreatePointWidgets("EMR_POLYGON"); break; @@ -281,7 +281,7 @@ void CRecordCreator::CreateArcWidgets(const QString &qsName) void CRecordCreator::CreateNotSupportedWidgets(const QString &qsName) { this->setWindowTitle(QString("Create: %1").arg(qsName)); - ui->dataLayout->addWidget(new QLabel("На данный момент создание данной записи не поддерживается")); + ui->dataLayout->addWidget(new QLabel("Creating this record is not currently supported")); } void CRecordCreator::CreateExtTextOutWidget(const QString &qsName) diff --git a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CColorWidget.cpp b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CColorWidget.cpp index 6e140fc519..e4a6284ee6 100644 --- a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CColorWidget.cpp +++ b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CColorWidget.cpp @@ -16,7 +16,7 @@ CColorWidget::CColorWidget(const QString& qsName, QWidget *pParent) : QLabel *pName = new QLabel(QString("%1:").arg(m_qsName)); pName->setStyleSheet("QLabel { text-decoration: underline; }"); - QPushButton *pSelectableButton = new QPushButton("Выбрать цвет"); + QPushButton *pSelectableButton = new QPushButton("Select color"); connect(pSelectableButton, &QPushButton::clicked, this, &CColorWidget::on_select_color_clicked); diff --git a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CEmptyWidget.cpp b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CEmptyWidget.cpp index afa99716eb..94637b893b 100644 --- a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CEmptyWidget.cpp +++ b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CEmptyWidget.cpp @@ -8,7 +8,7 @@ CEmptyWidget::CEmptyWidget(const QString& qsName, QWidget *pParent) : m_qsName(qsName) { QVBoxLayout *pLayout = new QVBoxLayout(); - pLayout->addWidget(new QLabel("Запись не содержит параметров")); + pLayout->addWidget(new QLabel("Record does not contain parameters")); setLayout(pLayout); } diff --git a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CExtSelectClipRgnWidget.cpp b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CExtSelectClipRgnWidget.cpp index 8ee3108260..a2a9b0f7d8 100644 --- a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CExtSelectClipRgnWidget.cpp +++ b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CExtSelectClipRgnWidget.cpp @@ -11,7 +11,7 @@ CExtSelectClipRgnWidget::CExtSelectClipRgnWidget(QWidget *pParent) { QVBoxLayout *pLayout = new QVBoxLayout; - QPushButton *pAddedButton = new QPushButton("Добавить значение"); + QPushButton *pAddedButton = new QPushButton("Add value"); connect(pAddedButton, &QPushButton::clicked, this, &CExtSelectClipRgnWidget::on_createRgnData_clicked); diff --git a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CExtTextOutWidget.cpp b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CExtTextOutWidget.cpp index 6fe2ebf87a..0b719588d9 100644 --- a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CExtTextOutWidget.cpp +++ b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CExtTextOutWidget.cpp @@ -39,7 +39,7 @@ CEmrTextWidget::CEmrTextWidget(unsigned int unIndex, QWidget *pParent) m_pTextWidget = new CFormWidget("Text"); - QPushButton *pCreateDxButton = new QPushButton("Создать поля для Dx значений"); + QPushButton *pCreateDxButton = new QPushButton("Create fields for Dx values"); connect(pCreateDxButton, &QPushButton::clicked, this, &CEmrTextWidget::on_createDx_clicked); diff --git a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CFillRgnWidget.cpp b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CFillRgnWidget.cpp index 7759fbc57e..f920834cec 100644 --- a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CFillRgnWidget.cpp +++ b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CFillRgnWidget.cpp @@ -11,7 +11,7 @@ CFillRgnWidget::CFillRgnWidget(QWidget *pParent) { QVBoxLayout *pLayout = new QVBoxLayout; - QPushButton *pAddedButton = new QPushButton("Добавить значение"); + QPushButton *pAddedButton = new QPushButton("Add value"); connect(pAddedButton, &QPushButton::clicked, this, &CFillRgnWidget::on_createRgnData_clicked); diff --git a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CFrameRgnWidget.cpp b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CFrameRgnWidget.cpp index 67407b924b..26e22f52ff 100644 --- a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CFrameRgnWidget.cpp +++ b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CFrameRgnWidget.cpp @@ -11,7 +11,7 @@ CFrameRgnWidget::CFrameRgnWidget(QWidget *pParent) { QVBoxLayout *pLayout = new QVBoxLayout; - QPushButton *pAddedButton = new QPushButton("Добавить значение"); + QPushButton *pAddedButton = new QPushButton("Add value"); connect(pAddedButton, &QPushButton::clicked, this, &CFrameRgnWidget::on_createRgnData_clicked); diff --git a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CGradientFillWidget.cpp b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CGradientFillWidget.cpp index b5ed1d0fbc..7dc70c4fc9 100644 --- a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CGradientFillWidget.cpp +++ b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CGradientFillWidget.cpp @@ -18,7 +18,7 @@ CGradientFillWidget::CGradientFillWidget(QWidget *pParent) m_pNTriWidget = new CFormWidget("nTri", "0"); m_pUlModeWidget = new CFormWidget("ulMode", "0"); - QPushButton *pCreateObjectsButton = new QPushButton("Создать объекты!"); + QPushButton *pCreateObjectsButton = new QPushButton("Create objects!"); connect(pCreateObjectsButton, &QPushButton::clicked, this, &CGradientFillWidget::on_createObjects_clicked); diff --git a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CInvertRgnWidget.cpp b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CInvertRgnWidget.cpp index 826be2bc3e..4551dcaa2c 100644 --- a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CInvertRgnWidget.cpp +++ b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CInvertRgnWidget.cpp @@ -11,7 +11,7 @@ CInvertRgnWidget::CInvertRgnWidget(QWidget *pParent) { QVBoxLayout *pLayout = new QVBoxLayout(); - QPushButton *pAddedButton = new QPushButton("Добавить значение"); + QPushButton *pAddedButton = new QPushButton("Add value"); connect(pAddedButton, &QPushButton::clicked, this, &CInvertRgnWidget::on_createRgnData_clicked); diff --git a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CLogFontExDvWidget.cpp b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CLogFontExDvWidget.cpp index 955caba138..2b16d137af 100644 --- a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CLogFontExDvWidget.cpp +++ b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CLogFontExDvWidget.cpp @@ -103,7 +103,7 @@ CDesignVectorWidget::CDesignVectorWidget(QWidget *pParent) : QLabel *pName = new QLabel("DesignVector:"); pName->setStyleSheet("QLabel { text-decoration: underline; }"); - QPushButton *pAddedButton = new QPushButton("Добавить значение"); + QPushButton *pAddedButton = new QPushButton("Add value"); connect(pAddedButton, &QPushButton::clicked, this, &CDesignVectorWidget::on_createValue_clicked); @@ -144,7 +144,7 @@ CLinkedUFISWidget::CLinkedUFISWidget(QWidget *pParent) { QVBoxLayout *pLayout = new QVBoxLayout(); - QPushButton *pCreateButton = new QPushButton("Добавить значение"); + QPushButton *pCreateButton = new QPushButton("Add value"); connect(pCreateButton, &QPushButton::clicked, this, &CLinkedUFISWidget::on_createValue_clicked); diff --git a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CLogPaletteWidget.cpp b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CLogPaletteWidget.cpp index 146df558b0..12fa975abf 100644 --- a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CLogPaletteWidget.cpp +++ b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CLogPaletteWidget.cpp @@ -14,7 +14,7 @@ CLogPaletteWidget::CLogPaletteWidget(QWidget *pParent) QLabel *pName = new QLabel("LogPallete"); pName->setStyleSheet("QLabel { text-decoration: underline; }"); - QPushButton *pAddedButton = new QPushButton("Добавить цвет"); + QPushButton *pAddedButton = new QPushButton("Add color"); connect(pAddedButton, &QPushButton::clicked, this, &CLogPaletteWidget::on_CreateColor_clicked); diff --git a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CPaletteEntriesWidget.cpp b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CPaletteEntriesWidget.cpp index fe4732ccb3..0ef95daaac 100644 --- a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CPaletteEntriesWidget.cpp +++ b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CPaletteEntriesWidget.cpp @@ -14,7 +14,7 @@ CPaletteEntriesWidget::CPaletteEntriesWidget(QWidget *pParent) AddWidgets({new CFormWidget("ihPal", "1"), new CFormWidget("Start", "1")}, pLayout); - QPushButton *pAddedButton = new QPushButton("Добавить цвет"); + QPushButton *pAddedButton = new QPushButton("Add color"); connect(pAddedButton, &QPushButton::clicked, this, &CPaletteEntriesWidget::on_CreateColor_clicked); diff --git a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CPointsWidget.cpp b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CPointsWidget.cpp index 86450d92cd..7babe05863 100644 --- a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CPointsWidget.cpp +++ b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CPointsWidget.cpp @@ -16,7 +16,7 @@ CPointsWidget::CPointsWidget(QWidget *pParent): { QVBoxLayout *pLayout = new QVBoxLayout; - QPushButton *pButtonAddPoint = new QPushButton("Добавить точку"); + QPushButton *pButtonAddPoint = new QPushButton("Add point"); connect(pButtonAddPoint, &QPushButton::clicked, this, &CPointsWidget::on_createPoint_clicked); diff --git a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CPolyDrawWidget.cpp b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CPolyDrawWidget.cpp index 576b176026..f20cffbddd 100644 --- a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CPolyDrawWidget.cpp +++ b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CPolyDrawWidget.cpp @@ -12,7 +12,7 @@ CPolyDrawWidget::CPolyDrawWidget(QWidget *pParent) { QVBoxLayout *pLayout = new QVBoxLayout; - QPushButton *pAddedPoint = new QPushButton("Добавить точку"); + QPushButton *pAddedPoint = new QPushButton("Add point"); connect(pAddedPoint, &QPushButton::clicked, this, &CPolyDrawWidget::on_createPoint_clicked); diff --git a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CPolyTextOutWidget.cpp b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CPolyTextOutWidget.cpp index 56ade127f6..a58c16eb10 100644 --- a/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CPolyTextOutWidget.cpp +++ b/DesktopEditor/raster/Metafile/test/DisplayingXML/Common/CPolyTextOutWidget.cpp @@ -16,7 +16,7 @@ CPolyTextOutWidget::CPolyTextOutWidget(QWidget *pParent) new CFormWidget("exScale", "1"), new CFormWidget("eyScale", "1")}, pLayout); - QPushButton *pAddedButton = new QPushButton("Добавить объект текста"); + QPushButton *pAddedButton = new QPushButton("Add text object"); connect(pAddedButton, &QPushButton::clicked, this, &CPolyTextOutWidget::on_createTextOut_clicked); diff --git a/DesktopEditor/xml/include/xmlencoding.h b/DesktopEditor/xml/include/xmlencoding.h index e93f7c8daf..aee1a7ac17 100644 --- a/DesktopEditor/xml/include/xmlencoding.h +++ b/DesktopEditor/xml/include/xmlencoding.h @@ -38,8 +38,8 @@ namespace XmlUtils { - // эта функция считает, что на вход пришла точно хмл. - // надо лишь определить кодировку и отдать строку в utf-8 + // this function assumes that the input is definitely xml. + // only need to determine encoding and return string in utf-8 static std::string GetXmlContentAsUTF8(const std::wstring& sFile) { std::string sXmlSource; diff --git a/DesktopEditor/xml/src/xmldom.cpp b/DesktopEditor/xml/src/xmldom.cpp index dfdf6a8557..3e88fd939d 100644 --- a/DesktopEditor/xml/src/xmldom.cpp +++ b/DesktopEditor/xml/src/xmldom.cpp @@ -186,7 +186,7 @@ namespace XmlUtils } else { - // это m_pCurrentNode + // this is m_pCurrentNode CXmlNodeBase* pNewBase = new CXmlNodeBase(); pNewBase->m_pDocument = this; pNewBase->m_pDocument->AddRef(); @@ -242,7 +242,7 @@ namespace XmlUtils XmlNodeType eNodeType = XmlNodeType_None; int nCurDepth = -1; - // У закрывающего тэга глубина на 1 больше, чем у открывающего + // Closing tag depth is 1 greater than opening tag while (true) { if (1 != xmlTextReaderRead(reader)) @@ -333,9 +333,9 @@ namespace XmlUtils delete m_pDocument; return false; } - // присваиваем m_pBase без AddRef, чтобы при удалении CXmlNode начался удаляться m_pBase(после конструктора RefCount==1, а если сделать AddRef то не удалится) + // assign m_pBase without AddRef, so when CXmlNode is deleted, m_pBase starts to be deleted (after constructor RefCount==1, if we do AddRef it won't be deleted) m_pBase = m_pDocument->m_pNode; - // после Parse все Node из m_pDocument сделали ему AddRef, поэтому можем вызвать Release(потому что напрямую нигде его не используем), а окончательно он удалится после удаления всех Node + // after Parse all Nodes from m_pDocument did AddRef on it, so we can call Release (because we don't use it directly), and it will be finally deleted after all Nodes are deleted m_pDocument->Release(); return true; @@ -359,9 +359,9 @@ namespace XmlUtils delete m_pDocument; return false; } - // присваиваем m_pBase без AddRef, чтобы при удалении CXmlNode начался удаляться m_pBase(после конструктора RefCount==1, а если сделать AddRef то не удалится) + // assign m_pBase without AddRef, so when CXmlNode is deleted, m_pBase starts to be deleted (after constructor RefCount==1, if we do AddRef it won't be deleted) m_pBase = m_pDocument->m_pNode; - // после Parse все Node из m_pDocument сделали ему AddRef, поэтому можем вызвать Release(потому что напрямую нигде его не используем), а окончательно он удалится после удаления всех Node + // after Parse all Nodes from m_pDocument did AddRef on it, so we can call Release (because we don't use it directly), and it will be finally deleted after all Nodes are deleted m_pDocument->Release(); return true; } diff --git a/DesktopEditor/xmlsec/src/osign/lib/src/buffer.cpp b/DesktopEditor/xmlsec/src/osign/lib/src/buffer.cpp index df7c5d7f67..e228a56062 100644 --- a/DesktopEditor/xmlsec/src/osign/lib/src/buffer.cpp +++ b/DesktopEditor/xmlsec/src/osign/lib/src/buffer.cpp @@ -75,7 +75,7 @@ namespace OSign unsigned char* pRealloc = (unsigned char*)realloc(m_data, m_max_size * sizeof(unsigned char)); if (NULL != pRealloc) { - // реаллок сработал + // realloc succeeded m_data = pRealloc; } else @@ -129,7 +129,7 @@ namespace OSign { m_internal = new CStorageBuffer_private(); m_internal->m_data = src.m_internal->m_data; - // всегда сначала + // always from the beginning m_internal->m_pos = 0; } diff --git a/DesktopEditor/xmlsec/src/osign/test/main.cpp b/DesktopEditor/xmlsec/src/osign/test/main.cpp index 2e474e01d2..a35a7a3d43 100644 --- a/DesktopEditor/xmlsec/src/osign/test/main.cpp +++ b/DesktopEditor/xmlsec/src/osign/test/main.cpp @@ -17,53 +17,53 @@ public: } }; -// aes шифрование +// aes encryption TEST_F(COSignTest, crypt_storage_aes_gcm_random_password) { - // создаем случайный пароль длиной 100 символов + // create random password of 100 characters OSign::CStorageBuffer oPassword = OSign::Crypt::GeneratePassword(100); EXPECT_EQ(100, oPassword.GetLength()); - // буфер для шифрования + // buffer for encryption std::string sDataCrypt = "Hello, world!"; OSign::CStorageBuffer oBuffer; oBuffer.Add((const unsigned char*)sDataCrypt.c_str(), sDataCrypt.length()); - // шифруем буфер, соль генерируется случайным образом и дописывается в результат + // encrypt buffer, salt is generated randomly and appended to result OSign::CStorageBuffer oCryptBuffer = OSign::Crypt::Encrypt(oBuffer, oPassword); - // дешифруем буфер + // decrypt buffer OSign::CStorageBuffer oDecryptBuffer = OSign::Crypt::Decrypt(oCryptBuffer, oPassword); - // сравниваем с исходником + // compare with original std::string sDecryptData((char*)oDecryptBuffer.GetData(), oDecryptBuffer.GetLength()); EXPECT_EQ(sDecryptData, sDataCrypt); } TEST_F(COSignTest, crypt_storage_aes_gcm_string_password) { - // создаем случайный пароль из строки + // create random password from string std::string sPassword = "password"; OSign::CStorageBuffer oPassword; oPassword.Add((unsigned char*)sPassword.c_str(), sPassword.length()); - // буфер для шифрования + // buffer for encryption std::string sDataCrypt = "Hello, world!"; OSign::CStorageBuffer oBuffer; oBuffer.Add((const unsigned char*)sDataCrypt.c_str(), sDataCrypt.length()); - // шифруем буфер, соль генерируется случайным образом и дописывается в результат + // encrypt buffer, salt is generated randomly and appended to result OSign::CStorageBuffer oCryptBuffer = OSign::Crypt::Encrypt(oBuffer, oPassword); - // дешифруем буфер + // decrypt buffer OSign::CStorageBuffer oDecryptBuffer = OSign::Crypt::Decrypt(oCryptBuffer, oPassword); - // сравниваем с исходником + // compare with original std::string sDecryptData((char*)oDecryptBuffer.GetData(), oDecryptBuffer.GetLength()); EXPECT_EQ(sDecryptData, sDataCrypt); } -// сериализация буфера +// buffer serialization TEST_F(COSignTest, serialize_buffer_string) { std::string sBuffer = "Hello, world"; @@ -79,50 +79,50 @@ TEST_F(COSignTest, serialize_buffer_string) EXPECT_EQ(sBuffer, sDecodeBuffer); } -// подпись +// signature TEST_F(COSignTest, sign_buffer_string) { - // генерируем новый сертификат + // generate new certificate OSign::CCertificate* pCert = new OSign::CCertificate(); pCert->Generate(); - // буфер для подписи + // buffer for signing std::string sDataBuffer = "Hello, world!"; OSign::CStorageBuffer oBuffer; oBuffer.Add((const unsigned char*)sDataBuffer.c_str(), sDataBuffer.length()); - // подписываем + // sign OSign::CStorageBuffer oBufferSign = pCert->Sign(oBuffer); - // проверяем + // verify bool bIsValid = pCert->Verify(oBuffer, oBufferSign); delete pCert; EXPECT_EQ(bIsValid, true); } -// тест сериализации стораджа через подпись/верификацию +// storage serialization test via sign/verify TEST_F(COSignTest, serialize_storage_by_sign) { - // генерируем новый сертификат + // generate new certificate OSign::CCertificate* pCert = new OSign::CCertificate(); pCert->Generate(); - // создаем сторадж и добавлем сертификат (сторадж сам следит за удалением сертификата) + // create storage and add certificate (storage handles certificate deletion itself) OSign::CStorage oStorage; oStorage.Add(pCert); - // сохраняем сторадж + // save storage OSign::CStorageBuffer oStorageBuffer; oStorage.Save(&oStorageBuffer); OSign::CStorage oStorageLoad; oStorageLoad.Load(&oStorageBuffer); - // буфер для подписи + // buffer for signing std::string sDataBuffer = "Hello, world!"; OSign::CStorageBuffer oBuffer; oBuffer.Add((const unsigned char*)sDataBuffer.c_str(), sDataBuffer.length()); - // подписываем + // sign OSign::CStorageBuffer oBufferSign = pCert->Sign(oBuffer); OSign::CCertificate* pCert2 = oStorage.Get(0); @@ -131,10 +131,10 @@ TEST_F(COSignTest, serialize_storage_by_sign) EXPECT_EQ(bIsValid, true); } -// тест сериализации стораджа через подпись/верификацию +// storage serialization test via sign/verify TEST_F(COSignTest, serialize_storage_by_property) { - // генерируем новый сертификат с настройками + // generate new certificate with settings std::map<std::wstring, std::wstring> properties; properties.insert(std::make_pair(OSign::Properties::Email, L"sign@onlyoffice.com")); properties.insert(std::make_pair(OSign::Properties::Phone, L"+00000000000")); @@ -145,11 +145,11 @@ TEST_F(COSignTest, serialize_storage_by_property) OSign::CCertificate* pCert = new OSign::CCertificate(); pCert->Generate(properties); - // создаем сторадж и добавлем сертификат (сторадж сам следит за удалением сертификата) + // create storage and add certificate (storage handles certificate deletion itself) OSign::CStorage oStorage; oStorage.Add(pCert); - // сохраняем сторадж + // save storage OSign::CStorageBuffer oStorageBuffer; oStorage.Save(&oStorageBuffer); diff --git a/DesktopEditor/xmlsec/src/src/Certificate_openssl.h b/DesktopEditor/xmlsec/src/src/Certificate_openssl.h index 11c09e5bf5..0fecbf3c7a 100644 --- a/DesktopEditor/xmlsec/src/src/Certificate_openssl.h +++ b/DesktopEditor/xmlsec/src/src/Certificate_openssl.h @@ -666,10 +666,10 @@ public: X509_STORE* x509_store = X509_STORE_new(); X509_STORE_add_cert(x509_store, m_cert); - // Нужно ли доверять сертификату, если нет доступа к локальному хранилищу сертификатов? + // Should we trust the certificate if there is no access to the local certificate store? // X509_STORE_set_flags(x509_store, X509_V_FLAG_PARTIAL_CHAIN); - // Получала X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY + // Was getting X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY if (PKCS7_verify(pkcs7, NULL, x509_store, inputbio, out_verify, PKCS7_NOCHAIN | PKCS7_NOSIGS) == 1) { nRes |= (1 << 0); // NOT CHANGED @@ -687,7 +687,7 @@ public: } } - /* Извлечение сертификата из подписи. Работает + /* Extracting certificate from signature. Works PKCS7 *p7enc = d2i_PKCS7_bio(out_verify, NULL); BIO* csr_bio = BIO_new(BIO_s_mem()); if (PKCS7_decrypt(p7enc, m_key, m_cert, csr_bio, 0)) diff --git a/DesktopEditor/xmlsec/src/src/OOXMLSigner.cpp b/DesktopEditor/xmlsec/src/src/OOXMLSigner.cpp index 443b32a152..374356f7a2 100644 --- a/DesktopEditor/xmlsec/src/src/OOXMLSigner.cpp +++ b/DesktopEditor/xmlsec/src/src/OOXMLSigner.cpp @@ -140,7 +140,7 @@ public: { oRels.CheckOriginSigs(file); - // удалим все лишнее + // remove all unnecessary std::vector<COOXMLRelationship>::iterator i = oRels.rels.begin(); while (i != oRels.rels.end()) { @@ -215,7 +215,7 @@ public: m_pFolder->writeXml(sFile, oBuilder.GetData()); - // теперь перебьем все имена файлов + // now update all file names std::vector<std::wstring> arSigs; @@ -229,7 +229,7 @@ public: std::map<std::wstring, bool>::iterator find = arSigFiles.find(sXmlFileName); if (find == arSigFiles.end()) { - // ненужная xml + // unnecessary xml m_pFolder->remove(*iter); continue; } diff --git a/DesktopEditor/xmlsec/src/src/OOXMLVerifier.cpp b/DesktopEditor/xmlsec/src/src/OOXMLVerifier.cpp index 2140fc38b8..44dc873854 100644 --- a/DesktopEditor/xmlsec/src/src/OOXMLVerifier.cpp +++ b/DesktopEditor/xmlsec/src/src/OOXMLVerifier.cpp @@ -325,12 +325,12 @@ public: CSignFolderFiles oFiles; oFiles.Folder_Parse(m_pFolder, true); - // 1) Все рельсы должны быть подписаны - иначе подпись не валидна + // 1) All rels must be signed - otherwise signature is invalid for (std::vector<std::wstring>::const_iterator i = oFiles.m_rels.begin(); i != oFiles.m_rels.end(); i++) { if (m_arFilesInManifest.find(*i) == m_arFilesInManifest.end()) { - // пустые файлы нет смысла добавлять + // no point in adding empty files std::wstring sFile = *i; CManifestFileInfo oInfo; oInfo.m_pFolder = m_pFolder; @@ -348,7 +348,7 @@ public: if (m_valid == OOXML_SIGNATURE_VALID) { - // 2) Парсим все рельсы + // 2) Parse all rels for (std::vector<std::wstring>::const_iterator i = oFiles.m_rels.begin(); i != oFiles.m_rels.end(); i++) { std::wstring sFile = *i; @@ -367,7 +367,7 @@ public: if (curRel.target_mode == L"Internal" && !CSignFolderFiles::CheckNeedSign(curRel.target)) continue; - // если внутренний файл отсутствует - не валидная подпись + // if internal file is missing - signature is invalid if (curRel.target_mode == L"Internal") { std::wstring sFullPath = oInfo.GetHeadPath(curRel.target); @@ -376,7 +376,7 @@ public: m_valid = OOXML_SIGNATURE_INVALID; else { - // если файл в списке, но не подписан - то подпись частичная. + // if file is in the list but not signed - signature is partial. if (m_arFilesInManifest.find(sFullPath) == m_arFilesInManifest.end()) { AddInvalidType(OOXML_SIGNATURE_PARTIALLY); diff --git a/DesktopEditor/xmlsec/src/wasm/all/engine.js b/DesktopEditor/xmlsec/src/wasm/all/engine.js index 51e4e8f3f1..08df5e207d 100644 --- a/DesktopEditor/xmlsec/src/wasm/all/engine.js +++ b/DesktopEditor/xmlsec/src/wasm/all/engine.js @@ -115,7 +115,7 @@ return null; var _file = Module["_XmlSignature_CreateFile"](_filePtr.data, _filePtr.size); - // удалится дата при удалении файла + // data will be deleted when the file is deleted _filePtr.data = 0; _filePtr.size = 0; diff --git a/DesktopEditor/xmlsec/src/wasm/oform_plugin/module/main.cpp b/DesktopEditor/xmlsec/src/wasm/oform_plugin/module/main.cpp index 7017b6565b..d0b641db37 100644 --- a/DesktopEditor/xmlsec/src/wasm/oform_plugin/module/main.cpp +++ b/DesktopEditor/xmlsec/src/wasm/oform_plugin/module/main.cpp @@ -190,7 +190,7 @@ WASM_EXPORT void Crypto_DestroyCertificate(void* cert) #endif // methods for oform signatures -// создаем ключи, приватный шифруем паролем, результат - две base64 строки +// create keys, encrypt private key with password, result - two base64 strings WASM_EXPORT char* Crypto_CreateKeys(const char* alg, const char* password, const char* salt) { std::string publicKey; diff --git a/DesktopEditor/xmlsec/test/windows_list_serts/TestNET/ConsoleApplication1/Properties/AssemblyInfo.cs b/DesktopEditor/xmlsec/test/windows_list_serts/TestNET/ConsoleApplication1/Properties/AssemblyInfo.cs index 97166270ee..c0e0ce89d5 100644 --- a/DesktopEditor/xmlsec/test/windows_list_serts/TestNET/ConsoleApplication1/Properties/AssemblyInfo.cs +++ b/DesktopEditor/xmlsec/test/windows_list_serts/TestNET/ConsoleApplication1/Properties/AssemblyInfo.cs @@ -2,9 +2,9 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// Управление общими сведениями о сборке осуществляется с помощью -// набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения, -// связанные со сборкой. +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. [assembly: AssemblyTitle("Sha1_C14N")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] @@ -14,23 +14,23 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Параметр ComVisible со значением FALSE делает типы в сборке невидимыми -// для COM-компонентов. Если требуется обратиться к типу в этой сборке через -// COM, задайте атрибуту ComVisible значение TRUE для этого типа. +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] -// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM +// The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("a945e071-111a-41e0-8bb0-4f7755ebb77b")] -// Сведения о версии сборки состоят из следующих четырех значений: +// Version information for an assembly consists of the following four values: // -// Основной номер версии -// Дополнительный номер версии -// Номер сборки -// Редакция +// Major Version +// Minor Version +// Build Number +// Revision // -// Можно задать все значения или принять номера сборки и редакции по умолчанию -// используя "*", как показано ниже: +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/DjVuFile/DjVu.h b/DjVuFile/DjVu.h index ba9eac8577..8107eb8c27 100644 --- a/DjVuFile/DjVu.h +++ b/DjVuFile/DjVu.h @@ -41,7 +41,7 @@ #include "../DesktopEditor/graphics/pro/officedrawingfile.h" #include "../DesktopEditor/graphics/pro/Fonts.h" -// работаем через класс CDjVuFileImplementation, чтобы когда цеплялся данный h-файл, ничего лишнего не инклюдилось +// use CDjVuFileImplementation class so that when this header is included, no extra dependencies are pulled in class CDjVuFileImplementation; class DJVU_DECL_EXPORT CDjVuFile : public IOfficeDrawingFile diff --git a/DjVuFile/DjVuFileImplementation.cpp b/DjVuFile/DjVuFileImplementation.cpp index 523c0ab9a9..a5631edebb 100644 --- a/DjVuFile/DjVuFileImplementation.cpp +++ b/DjVuFile/DjVuFileImplementation.cpp @@ -255,7 +255,7 @@ void CDjVuFileImplementation::DrawPageOnRenderer(IRenderer* pRenderer, int nPag } catch (...) { - // белая страница + // blank page } } void CDjVuFileImplementation::ConvertToPdf(const std::wstring& wsDstPath) @@ -426,7 +426,7 @@ BYTE* CDjVuFileImplementation::GetPageLinks(int nPageIndex) { GUTF8String str = map_areas[pos]->url; oRes.WriteString((BYTE*)str.getbuf(), str.length()); - // Верхний левый угол + // Top left corner double x = map_areas[pos]->get_xmin(); double y = dHeight - map_areas[pos]->get_ymax(); oRes.AddDouble(0.0); @@ -635,7 +635,7 @@ void CDjVuFileImplementation::CreatePdfFrame(IRenderer* pRenderer, GP<DjVuImage> } else { - // белый фрейм?? + // blank frame?? //memset(pBufferDst, 0xFF, 4 * lImageWidth * lImageHeight); GRect oRectAll(0, 0, lImageWidth, lImageHeight); GP<GPixmap> pImage = pPage->get_pixmap(oRectAll, oRectAll); @@ -843,7 +843,7 @@ XmlUtils::CXmlNode CDjVuFileImplementation::ParseText(GP<DjVuImage> pPage) } void CDjVuFileImplementation::TextToRenderer(IRenderer* pRenderer, XmlUtils::CXmlNode oTextNode, double dKoef, bool isView) { - // Выставим шрифт пустой (чтобы растягивать по всему ректу) + // Set empty font (to stretch across the entire rect) pRenderer->put_FontName(L"DjvuEmptyFont"); //std::wstring csText = oTextNode.GetXml(); std::vector<XmlUtils::CXmlNode> oLinesNodes = oTextNode.GetNodes(L"LINE"); diff --git a/DocxRenderer/DocxRenderer.h b/DocxRenderer/DocxRenderer.h index 0903f78acc..cb767d8ac7 100644 --- a/DocxRenderer/DocxRenderer.h +++ b/DocxRenderer/DocxRenderer.h @@ -174,7 +174,7 @@ public: virtual HRESULT IsSupportAdvancedCommand(const IAdvancedCommand::AdvancedCommandType& type); virtual HRESULT AdvancedCommand(IAdvancedCommand* command); - // методы, которыми будет пользоваться конвертер + // methods to be used by the converter HRESULT SetTextAssociationType(const NSDocxRenderer::TextAssociationType& eType); int Convert(IOfficeDrawingFile* pFile, const std::wstring& sDstFile, bool bIsOutCompress = true); std::vector<std::wstring> ScanPage(IOfficeDrawingFile* pFile, size_t nPage); diff --git a/DocxRenderer/convert_params.h b/DocxRenderer/convert_params.h index a0d5caef18..4e6c4d51b8 100644 --- a/DocxRenderer/convert_params.h +++ b/DocxRenderer/convert_params.h @@ -35,11 +35,11 @@ namespace NSDocxRenderer { enum class TextAssociationType { - tatBlockChar = 0, // Каждый символ во фрейме - tatBlockLine = 1, // Каждая линия - параграф во фрейме. Линии могут объединяться в рамках одного блока. - tatPlainLine = 2, // Каждая линия - параграф обычный - tatShapeLine = 3, // Каждая линия - параграф в шейпе. Линии могут объединяться в рамках одного блока. - tatPlainParagraph = 4, // Все линии объединяются в параграфы - tatParagraphToShape = 5 // Параграфы записываем в шейпы + tatBlockChar = 0, // Each character in a frame + tatBlockLine = 1, // Each line is a paragraph in a frame. Lines can be merged within one block. + tatPlainLine = 2, // Each line is a plain paragraph + tatShapeLine = 3, // Each line is a paragraph in a shape. Lines can be merged within one block. + tatPlainParagraph = 4, // All lines are merged into paragraphs + tatParagraphToShape = 5 // Paragraphs are written into shapes }; } diff --git a/DocxRenderer/readme.md b/DocxRenderer/readme.md index dfaddbc382..2f62090bf3 100644 --- a/DocxRenderer/readme.md +++ b/DocxRenderer/readme.md @@ -1,39 +1,39 @@ -Логика описана в CPage::ProcessingAndRecordingOfPageData +Logic is described in CPage::ProcessingAndRecordingOfPageData -I Этап +Stage I -1. Собираются шейпы с векторной графикой (DrawPath -> m_arShapes) - - Копируются текущие Pen и Brush, - - определяется тип шейпа VectorTexture или VectorGraphics - - первоначально определяем положение на стронице (перед текстом/позади текста - пока плохо работает, когда удалялись белые прямоугольники было лучше) - - задаются геометрические параметры - - определяется тип графики (Rectangle, Curve, ComplicatedFigure, NoGraphics) и подтип (LongDash, Dash, Dot, Wave) - -2. Собираются шейпы-картинки (WriteImage -> m_arImages) - - задаются геометрические параметры и тип шейпа Picture - -3. Собираются буквы и сразу распределются по текстовым линиям. Отдельно собираются DiacriticalSymbol (CollectTextData -> m_arTextLine, m_arDiacriticalSymbol) - - отбрасываем все пробелы (нужно будет добавить доп юникоды для других типов пробелов) - - работа FontManager - - задаются геометрические параметры - - генерим или проверяем на наличие стиль (копируются и анализируются текущие Font, Brush, PickFontName, PickFontStyle) - -II Этап - Собрали все объекты для текущей страницы. Начинаем анализ. - -1. Анализируем графику - AnalyzeCollectedShapes() - - BuildTables(); - собираем таблицы из шейпов (в разработке) - - DetermineLinesType() - превращаем шейпы в горизонтальные линии в зависимости от геометрии, удаляем обработанные шейпы, определяем тип полученной линии на основании типа графики (Rectangle, Curve, ComplicatedFigure, NoGraphics) и подтипа (LongDash, Dash, Dot, Wave). (2 вложенных цикла m_arShapes - m_arShapes с сортировкой вектора) +1. Vector graphics shapes are collected (DrawPath -> m_arShapes) + - Current Pen and Brush are copied, + - shape type is determined: VectorTexture or VectorGraphics + - initial position on page is determined (before text/behind text - currently works poorly, was better when white rectangles were removed) + - geometric parameters are set + - graphics type is determined (Rectangle, Curve, ComplicatedFigure, NoGraphics) and subtype (LongDash, Dash, Dot, Wave) -2. AnalyzeCollectedTextLines() - добавляем свойства каждому символу отдельно - - Определяем взаимотношения между символами - FontEffects, VertAlignTypeBetweenConts, IsDuplicate (2 вложенных цикла m_arSymbol - m_arSymbol) (удаляем отработанные символы) - - DetermineStrikeoutsUnderlinesHighlights() - определяем взаимоотношения между графикой и символами Strikeouts, Underlines, Highlights, FontEffect (2 вложенных цикла m_arShapes - m_arSymbol) (удаляем отработанные шейпы) - - AddDiacriticalSymbols() - добавляем DiacriticalSymbol - - MergeLinesByVertAlignType() - объединяем линии с определенными eVertAlignType - - DeleteTextClipPage() - удаление линий вне страницы (1 цикл m_arTextLine) - - DetermineTextColumns() - определяем колонки текста и добавляем в таблицу (в разработке) - - BuildLines() - собираем из символов слова, добавляем пробелы - - DetermineDominantGraphics() - нужно, чтобы выделить шейп, который будет использоваться в качестве шейдинга параграфа (2 вложенных цикла m_arTextLine - m_arConts) - - BuildParagraphes() - собираем из текстовых строк параграфы/шейпы и добавляем в m_arOutputObjects +2. Image shapes are collected (WriteImage -> m_arImages) + - geometric parameters and shape type Picture are set -III Этап ToXml +3. Letters are collected and immediately distributed across text lines. DiacriticalSymbols are collected separately (CollectTextData -> m_arTextLine, m_arDiacriticalSymbol) + - all spaces are discarded (additional unicodes for other space types need to be added) + - FontManager work + - geometric parameters are set + - style is generated or checked for existence (current Font, Brush, PickFontName, PickFontStyle are copied and analyzed) + +Stage II + All objects for the current page have been collected. Starting analysis. + +1. Analyze graphics - AnalyzeCollectedShapes() + - BuildTables(); - collect tables from shapes (in development) + - DetermineLinesType() - convert shapes to horizontal lines based on geometry, remove processed shapes, determine resulting line type based on graphics type (Rectangle, Curve, ComplicatedFigure, NoGraphics) and subtype (LongDash, Dash, Dot, Wave). (2 nested loops m_arShapes - m_arShapes with vector sorting) + +2. AnalyzeCollectedTextLines() - add properties to each character individually + - Determine relationships between characters - FontEffects, VertAlignTypeBetweenConts, IsDuplicate (2 nested loops m_arSymbol - m_arSymbol) (remove processed symbols) + - DetermineStrikeoutsUnderlinesHighlights() - determine relationships between graphics and characters: Strikeouts, Underlines, Highlights, FontEffect (2 nested loops m_arShapes - m_arSymbol) (remove processed shapes) + - AddDiacriticalSymbols() - add DiacriticalSymbols + - MergeLinesByVertAlignType() - merge lines with specific eVertAlignType + - DeleteTextClipPage() - delete lines outside the page (1 loop m_arTextLine) + - DetermineTextColumns() - determine text columns and add to table (in development) + - BuildLines() - build words from characters, add spaces + - DetermineDominantGraphics() - needed to highlight the shape that will be used for paragraph shading (2 nested loops m_arTextLine - m_arConts) + - BuildParagraphes() - build paragraphs/shapes from text lines and add to m_arOutputObjects + +Stage III ToXml diff --git a/DocxRenderer/src/logic/Document.cpp b/DocxRenderer/src/logic/Document.cpp index 1a82390327..9c8e137b19 100644 --- a/DocxRenderer/src/logic/Document.cpp +++ b/DocxRenderer/src/logic/Document.cpp @@ -73,7 +73,7 @@ namespace NSDocxRenderer *dDpiY = m_dDpiY; return S_OK; } - //-------- Функции для задания настроек текста ---------------------------------------------- + //-------- Functions for setting text properties -------------------------------------------- // pen -------------------------------------------------------------------------------------- HRESULT CDocument::get_PenColor(LONG* lColor) { @@ -489,7 +489,7 @@ namespace NSDocxRenderer return S_OK; } - //-------- Функции для вывода текста -------------------------------------------------------- + //-------- Functions for text output -------------------------------------------------------- HRESULT CDocument::CommandDrawTextPrivate(const int* pUnicodes, const int* pGids, int nCount, const double& dX, const double& dY, const double& dW, const double& dH, const double& dBaseLineOffset) @@ -497,7 +497,7 @@ namespace NSDocxRenderer double dAngleMatrix = m_oCurrentPage.m_oTransform.z_Rotation(); if (fabs(dAngleMatrix) > 1 || m_oCurrentPage.m_oTransform.sx() < 0 || m_oCurrentPage.m_oTransform.sy() < 0) { - //note У повернутых символов не приходят координаты. + //note Rotated characters don't receive coordinates. _SetFont(); PathCommandEnd(); BeginCommand(c_nPathType); @@ -546,7 +546,7 @@ namespace NSDocxRenderer delete [] pUnicodes; return S_OK; } - //-------- Маркеры для команд --------------------------------------------------------------- + //-------- Command markers ------------------------------------------------------------------ HRESULT CDocument::BeginCommand(DWORD lType) { if (c_nPageType == lType && m_bIsDisablePageCommand) @@ -586,7 +586,7 @@ namespace NSDocxRenderer return S_OK; } - //-------- Функции для работы с Graphics Path ----------------------------------------------- + //-------- Functions for working with Graphics Path ----------------------------------------- HRESULT CDocument::PathCommandMoveTo(double fX, double fY) { if (c_nSimpleGraphicType == m_lCurrentCommandType) @@ -708,7 +708,7 @@ namespace NSDocxRenderer ApplyTransform2(dAngle, dLeft, dTop, dWidth, dHeight, lFlags); return S_OK; } - //-------- Функции для вывода изображений -------------------------------------------------- + //-------- Functions for image output ------------------------------------------------------- HRESULT CDocument::DrawImage(IGrObject* pImage, double fX, double fY, double fWidth, double fHeight) { m_oCurrentPage.WriteImage(m_oImageManager.WriteImage((Aggplus::CImage*)pImage, fX, fY, fWidth, fHeight), fX, fY, fWidth, fHeight); @@ -810,10 +810,10 @@ namespace NSDocxRenderer { Clear(); - // Сбросим кэш шрифтов. По идее можно оставлять кэш для шрифтов "по имени", - // но для шрифтов из темповых папок - нет. Темповая папка для Reader (PDF/XPS/DJVU) - // может быть одной и той же. И создание там файлов функцией создания временных файлов - // может вернуть один и тот же путь. И шрифт возьмется из старого файла. + // Clear font cache. In theory, we could keep the cache for fonts "by name", + // but not for fonts from temp folders. The temp folder for Reader (PDF/XPS/DJVU) + // may be the same. And creating files there using the temp file creation function + // may return the same path. And the font will be taken from an old file. m_oFontSelector.ClearCache(); m_oFontManager.ClearCache(); if (m_pAppFonts && bIsClearStreams) m_pAppFonts->GetStreams()->Clear(); @@ -890,7 +890,7 @@ namespace NSDocxRenderer void CDocument::BuildDocumentXmlRels() { - // сохраним rels (images & docs) + // save rels (images & docs) NSStringUtils::CStringBuilder oWriter; oWriter.WriteString(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\ @@ -921,7 +921,7 @@ namespace NSDocxRenderer void CDocument::BuildFontTableXml() { NSStringUtils::CStringBuilder oWriter; - // сохраним fontTable + // save fontTable oWriter.WriteString(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\ <w:fonts xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \ xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \ @@ -1003,7 +1003,7 @@ namespace NSDocxRenderer { NSStringUtils::CStringBuilder oWriter; - // сохраним styles + // save styles oWriter.WriteString(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\ <w:styles xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \ xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \ @@ -1169,7 +1169,7 @@ namespace NSDocxRenderer oWriter.WriteString(L"<w:uiPriority w:val=\"1\"/>"); oWriter.WriteString(L"<w:semiHidden/>"); oWriter.WriteString(L"<w:unhideWhenUsed/>"); - oWriter.WriteString(L"<w:noProof/>"); //отключение проверки орфографии + oWriter.WriteString(L"<w:noProof/>"); // disable spell checking oWriter.WriteString(L"<w:b w:val=\"0\"/>"); oWriter.WriteString(L"<w:bCs w:val=\"0\"/>"); oWriter.WriteString(L"<w:i w:val=\"0\"/>"); diff --git a/DocxRenderer/src/logic/Page.cpp b/DocxRenderer/src/logic/Page.cpp index 1bdcf1e0c0..8bb69a6efc 100644 --- a/DocxRenderer/src/logic/Page.cpp +++ b/DocxRenderer/src/logic/Page.cpp @@ -313,7 +313,7 @@ namespace NSDocxRenderer if (!CContText::IsUnicodeSymbol(pUnicodes[i])) oText[i] = ' '; - // иногда приходит неверный? размер, нужно перемерить (XPS) + // sometimes incorrect? size comes, need to remeasure (XPS) if (m_bIsRecalcFontSize) { m_oFont.Size *= ((m_oTransform.sx() + m_oTransform.sy()) / 2); @@ -334,7 +334,7 @@ namespace NSDocxRenderer } else { - // такого быть не должно (только из xps) + // this should not happen (only from xps) m_oManagers.pFontManager->SetStringGid(0); m_oManagers.pFontManager->MeasureStringGids(pUnicodes, nCount, dTextX, dTextY, _x, _y, _w, _h, CFontManager::mtPosition); } @@ -490,7 +490,7 @@ namespace NSDocxRenderer } void CPage::ReorderShapesForPptx() { - // переместим nullptr в конец и удалим + // move nullptr to the end and remove auto right = MoveNullptr(m_arShapes.begin(), m_arShapes.end()); m_arShapes.erase(right, m_arShapes.end()); @@ -668,7 +668,7 @@ namespace NSDocxRenderer { for (size_t i = 0; i < m_arShapes.size(); ++i) { - if (!m_arShapes[i] || m_arShapes[i]->m_dHeight > c_dMAX_LINE_HEIGHT_MM || // рассматриваем только тонкие объекты + if (!m_arShapes[i] || m_arShapes[i]->m_dHeight > c_dMAX_LINE_HEIGHT_MM || // consider only thin objects (m_arShapes[i]->m_eGraphicsType != eGraphicsType::gtRectangle && m_arShapes[i]->m_eGraphicsType != eGraphicsType::gtCurve)) { @@ -680,22 +680,22 @@ namespace NSDocxRenderer for (size_t j = i + 1; j < m_arShapes.size(); ++j) { - if (!m_arShapes[j] || m_arShapes[i]->AreObjectsNoCrossingByVertically(m_arShapes[j].get())) // значительно ускоряет работу + if (!m_arShapes[j] || m_arShapes[i]->AreObjectsNoCrossingByVertically(m_arShapes[j].get())) // significantly speeds up the work continue; bool bIf1 = m_arShapes[i]->IsCorrelated(m_arShapes[j]); - // довольно странное поведение - в зависимости от толщины линии информация о графике записывается в разные структуры + // rather strange behavior - depending on line thickness, graphics info is written to different structures bool bIf2 = m_arShapes[i]->m_oBrush.IsEqual(&m_arShapes[j]->m_oBrush); bool bIf3 = m_arShapes[i]->m_oPen.IsEqual(&m_arShapes[j]->m_oPen); - // линия должна быть одного размера по высоте + // line must be the same height bool bIf4 = fabs(m_arShapes[i]->m_dHeight - m_arShapes[j]->m_dHeight) < c_dGRAPHICS_ERROR_IN_LINES_MM; - // все должно быть на одной линии + // everything must be on the same line bool bIf5 = fabs(m_arShapes[i]->m_dBot - m_arShapes[j]->m_dBot) < c_dGRAPHICS_ERROR_IN_LINES_MM * 5; - if (bIf1 && (bIf2 || bIf3) && bIf4 && bIf5) // все должно быть на одной линии + if (bIf1 && (bIf2 || bIf3) && bIf4 && bIf5) // everything must be on the same line curr_shape_indexes.push_back(j); } @@ -813,11 +813,11 @@ namespace NSDocxRenderer if (!line || line == drop_cap_line) continue; - // буквица должна быть левее + // drop cap must be to the left if (line->m_dLeft < drop_cap_cont->m_dLeft) continue; - // если совпадает строка по высоте - берем ее и выходим + // if the line matches by height - take it and exit if (fabs(line->m_dBotWithMaxDescent - drop_cap_cont->m_dBotWithDescent) < c_dTHE_SAME_STRING_Y_PRECISION_MM) { num_of_lines++; @@ -843,7 +843,7 @@ namespace NSDocxRenderer } } - // шейпы из буквиц + // shapes from drop caps for (auto&& drop_cap : drop_caps) { if (!m_bUseDefaultFont) @@ -870,24 +870,24 @@ namespace NSDocxRenderer if (!pCurrCont) continue; - // берем вторую линию, если символ последний - то начиная со следуюущей, иначе с той же + // take second line, if symbol is last - start from next, otherwise from the same for (size_t uNextLineIndex = uCurrContIndex >= pCurrLine->m_arConts.size() - 1 ? uCurrLineIndex + 1 : uCurrLineIndex; uNextLineIndex < m_arTextLines.size(); ++uNextLineIndex) { auto& pNextLine = m_arTextLines[uNextLineIndex]; - // значительно ускоряет работу, то есть если никак не перескается - некст + // significantly speeds up the work, i.e. if no crossing at all - next if (!pNextLine || pCurrLine->AreObjectsNoCrossingByVertically(pNextLine.get())) continue; - // посимвольно смотрим некст линию - если та же то следующий символ, если другая - то с нуля + // check next line char by char - if same then next symbol, if different - from zero for (size_t uNextContIndex = uNextLineIndex != uCurrLineIndex ? 0 : uCurrContIndex + 1; uNextContIndex < pNextLine->m_arConts.size(); ++uNextContIndex) { if (!pCurrCont) break; - // берем символ во второй линии + // take symbol from second line auto& pNextCont = pNextLine->m_arConts[uNextContIndex]; if (!pNextCont) continue; @@ -1032,7 +1032,7 @@ namespace NSDocxRenderer } } - // проверили - удаляем + // checked - remove if (is_smth_true) shape_used = true; } @@ -1051,16 +1051,16 @@ namespace NSDocxRenderer bool bIf1 = pShape->m_eGraphicsType == eGraphicsType::gtRectangle && pShape->m_eLineType != eLineType::ltUnknown; - // Условие пересечения по вертикали + // Vertical crossing condition bool bIf2 = pShape->m_dTop > dTopBorder && pShape->m_dBot < dBotBorder; - // Условие пересечения по горизонтали + // Horizontal crossing condition bool bIf3 = h_type != eHorizontalCrossingType::hctUnknown && h_type != eHorizontalCrossingType::hctCurrentLeftOfNext && h_type != eHorizontalCrossingType::hctNoCrossingCurrentLeftOfNext && h_type != eHorizontalCrossingType::hctNoCrossingCurrentRightOfNext; - // Условие для размеров по высоте + // Height size condition bool bIf4 = pShape->m_dHeight < pCont->m_dHeight && pCont->m_dHeight - pShape->m_dHeight > c_dERROR_FOR_TEXT_WITH_GRAPHICS_MM; @@ -1074,17 +1074,17 @@ namespace NSDocxRenderer pShape->m_eGraphicsType == eGraphicsType::gtCurve) && pShape->m_eLineType != eLineType::ltUnknown; - //Условие по вертикали + // Vertical condition double max_diff = std::min(c_dGRAPHICS_ERROR_MM * 3, pCont->m_dHeight * 0.5); bool bIf2 = fabs(pShape->m_dBot - pCont->m_dBot) < max_diff; - //Условие пересечения по горизонтали + // Horizontal crossing condition bool bIf3 = h_type != eHorizontalCrossingType::hctUnknown && h_type != eHorizontalCrossingType::hctCurrentLeftOfNext && h_type != eHorizontalCrossingType::hctNoCrossingCurrentLeftOfNext && h_type != eHorizontalCrossingType::hctNoCrossingCurrentRightOfNext; - //Условие для размеров по высоте + // Height size condition bool bIf4 = pShape->m_dHeight < pCont->m_dHeight * 0.5 && pCont->m_dHeight - pShape->m_dHeight > c_dERROR_FOR_TEXT_WITH_GRAPHICS_MM; @@ -1101,18 +1101,18 @@ namespace NSDocxRenderer bool bIf1 = pShape->m_eGraphicsType == eGraphicsType::gtRectangle; - //Условие пересечения по вертикали + // Vertical crossing condition bool bIf2 = (dSomeBaseLine1 > pShape->m_dTop && dSomeBaseLine1 < pShape->m_dBot && dSomeBaseLine2 > pShape->m_dTop && dSomeBaseLine2 < pShape->m_dBot && dSomeBaseLine3 > pShape->m_dTop && dSomeBaseLine3 < pShape->m_dBot); - //Условие пересечения по горизонтали + // Horizontal crossing condition bool bIf3 = h_type != eHorizontalCrossingType::hctUnknown && h_type != eHorizontalCrossingType::hctNoCrossingCurrentLeftOfNext && h_type != eHorizontalCrossingType::hctCurrentLeftOfNext && h_type != eHorizontalCrossingType::hctNoCrossingCurrentRightOfNext; - //Цвета должны быть разными + // Colors must be different bool bIf4 = pCont->m_pFontStyle->oBrush.Color1 != pShape->m_oBrush.Color1; bool bIf5 = pShape->m_oBrush.Color1 == c_iBlackColor && pShape->m_oPen.Color == c_iWhiteColor; bool bIf6 = pShape->m_bIsNoFill == false; @@ -1241,7 +1241,7 @@ namespace NSDocxRenderer if (bIsNeedWP) { oWriter.WriteString(L"<w:p>"); - //note при удалении строки откуда-то добавляется <w:p/> в начале страницы (если есть графика и текст), что добавляет дополнительную строку и сдвигает текст + //note when deleting a line, <w:p/> is added somewhere at the beginning of the page (if there's graphics and text), which adds an extra line and shifts the text oWriter.WriteString(L"<w:pPr><w:spacing w:line=\"1\" w:lineRule=\"exact\"/></w:pPr>"); } @@ -1588,14 +1588,14 @@ namespace NSDocxRenderer v_type == eVerticalCrossingType::vctNoCrossingCurrentBelowNext; }; - // линии из которых сделаем шейпы + // lines from which we'll make shapes for (size_t index = 0; index < m_arTextLines.size(); ++index) { auto& curr_line = m_arTextLines[index]; if (!curr_line) continue; - // если линия пересекается с предыдущей линией + // if line intersects with previous line if (index && m_arTextLines[index - 1]) { auto& prev_line = m_arTextLines[index - 1]; @@ -1639,7 +1639,7 @@ namespace NSDocxRenderer double min_left{m_dWidth}; double max_right{0.0}; - // совпадает ли left, right, center со строкой ниже + // does left, right, center match with the line below struct Position { bool left{false}; bool center{false}; @@ -1756,23 +1756,23 @@ namespace NSDocxRenderer }; auto build_paragraphs = [this, add_line, add_paragraph] (const std::vector<text_line_ptr_t>& text_lines) { - // ar_spacing[index]- расстояние строки до строки снизу - // если 0.0 - строка последняя + // ar_spacing[index] - distance from line to line below + // if 0.0 - line is last std::vector<double> ar_spacings(text_lines.size(), 0.0); - // позиции относительно других линий + // positions relative to other lines std::vector<Position> ar_positions(text_lines.size()); - // требуется ли отступ + // is indent required std::vector<bool> ar_indents(text_lines.size(), false); - // если ar_delims[index] == true, после строчки index нужно начинать новый параграф + // if ar_delims[index] == true, new paragraph should start after line index std::vector<bool> ar_delims(text_lines.size(), false); double avg_spacing{0.0}; size_t avg_spacing_n{0}; - // параграф будет набиваться строчками + // paragraph will be filled with lines auto paragraph = std::make_shared<CParagraph>(); // calcs first word widths @@ -1820,7 +1820,7 @@ namespace NSDocxRenderer ar_delims[index] = false; else { - // берем доп строчки сверху и снизу для анализа + // take additional lines above and below for analysis bool same_double_top = false; bool same_double_bot = false; @@ -1837,7 +1837,7 @@ namespace NSDocxRenderer same_double_bot = true; } - // если анализ доп строчек ничего не дал - разбиваем наиболее "вероятным" способом + // if analysis of additional lines gave nothing - split in the most "probable" way if (same_double_top == same_double_bot) { if (spacing_top > spacing_bot) @@ -1845,7 +1845,7 @@ namespace NSDocxRenderer else if (spacing_top < spacing_bot) ar_delims[index] = true; } - // прикрепляем строчку к верху или низу + // attach line to top or bottom else { if (same_double_top) @@ -1880,11 +1880,11 @@ namespace NSDocxRenderer curr_position.right &= position.right; } - // первая строка может быть с отступом + // first line may have indent double first_line_indent = line_top->m_dLeft - line_bot->m_dLeft; if (is_first_line && first_line_indent < c_dMAX_FIRST_LINE_INDENT) { - // если больше трех линий - проверим третью + // if more than three lines - check the third if (index < ar_positions.size() - 2) { if (!ar_delims[index] && !ar_delims[index + 1] && ar_positions[index + 1].left) @@ -1993,7 +1993,7 @@ namespace NSDocxRenderer ar_delims[index] = true; } - // если между линий шейп - делим + // if there's a shape between lines - split for (size_t index = 0; index < ar_positions.size() - 1; ++index) { if (IsHorizontalLineBetween(text_lines[index], text_lines[index + 1])) @@ -2002,7 +2002,7 @@ namespace NSDocxRenderer ar_delims[index] = true; } - // на основе ar_delims разбиваем на параграфы + // split into paragraphs based on ar_delims for (size_t index = 0; index < ar_delims.size(); ++index) { add_line(paragraph, text_lines[index]); @@ -2011,7 +2011,7 @@ namespace NSDocxRenderer } }; - // 1 строчка в параграфе + // 1 line per paragraph if (m_eTextAssociationType == TextAssociationType::tatPlainLine || m_eTextAssociationType == TextAssociationType::tatShapeLine) { diff --git a/DocxRenderer/src/logic/elements/BaseItem.h b/DocxRenderer/src/logic/elements/BaseItem.h index 4f352d9578..7966afeb76 100644 --- a/DocxRenderer/src/logic/elements/BaseItem.h +++ b/DocxRenderer/src/logic/elements/BaseItem.h @@ -8,7 +8,7 @@ namespace NSDocxRenderer { - // взаимное расположение по вертикали со следующим объектом + // Vertical position relative to the next object enum class eVerticalCrossingType { vctUnknown, @@ -24,7 +24,7 @@ namespace NSDocxRenderer vctNoCrossingCurrentBelowNext }; - // взаимное расположение по горизонтали со следующим объектом + // Horizontal position relative to the next object enum class eHorizontalCrossingType { hctUnknown, diff --git a/DocxRenderer/src/logic/elements/ContText.cpp b/DocxRenderer/src/logic/elements/ContText.cpp index 041cf03f5e..f83e477d77 100644 --- a/DocxRenderer/src/logic/elements/ContText.cpp +++ b/DocxRenderer/src/logic/elements/ContText.cpp @@ -306,7 +306,7 @@ namespace NSDocxRenderer if (m_bIsHighlightPresent) { - //note В <w:style это не работает + //note This doesn't work in <w:style ColorTable& colorTable = SingletonInstance<ColorTable>(); if (colorTable.IsStandardColor(m_lHighlightColor)) { @@ -897,19 +897,19 @@ namespace NSDocxRenderer eVerticalCrossingType eVType, eHorizontalCrossingType eHType) { - //Условие пересечения по вертикали + //Vertical intersection condition bool bIf1 = eVType == eVerticalCrossingType::vctCurrentAboveNext; bool bIf2 = eVType == eVerticalCrossingType::vctCurrentBelowNext; - //Условие пересечения по горизонтали + //Horizontal intersection condition bool bIf3 = eHType == eHorizontalCrossingType::hctCurrentLeftOfNext; bool bIf4 = eHType == eHorizontalCrossingType::hctCurrentRightOfNext; - //Размеры шрифта и текст должны бать одинаковыми + //Font sizes and text must be the same bool bIf5 = pFirstCont->m_pFontStyle->dFontSize == pSecondCont->m_pFontStyle->dFontSize; bool bIf6 = pFirstCont->m_oText == pSecondCont->m_oText; - //Цвет тени должен быть серым + //Shadow color must be grey bool bIf7 = pFirstCont->m_pFontStyle->oBrush.Color1 == c_iGreyColor; bool bIf8 = pSecondCont->m_pFontStyle->oBrush.Color1 == c_iGreyColor; @@ -919,7 +919,7 @@ namespace NSDocxRenderer bool bIf11 = pFirstCont->m_pFontStyle->oBrush.Color1 == c_iGreyColor2; bool bIf12 = pSecondCont->m_pFontStyle->oBrush.Color1 == c_iGreyColor2; - // каждый символ с Emboss или Engrave разбиваются на 3 символа с разными цветами + // Each character with Emboss or Engrave is split into 3 characters with different colors if (bIf5 && bIf6) { if (bIf12 && pFirstCont->m_bIsEmbossPresent) @@ -953,7 +953,7 @@ namespace NSDocxRenderer } //Emboss - //Первый проход + //First pass //c_iBlackColor -> c_iBlackColor -> c_iGreyColor2 else if (bIf1 && bIf3 && bIf9) { @@ -994,7 +994,7 @@ namespace NSDocxRenderer eHType == eHorizontalCrossingType::hctCurrentRightOfNext) && fabs(pFirstCont->m_dLeft - pSecondCont->m_dRight) < c_dTHE_STRING_X_PRECISION_MM; - //Размеры шрифта должны бать разными + //Font sizes must be different bool bIf5 = pFirstCont->m_pFontStyle->dFontSize * 0.8 > pSecondCont->m_pFontStyle->dFontSize; bool bIf6 = pFirstCont->m_pFontStyle->dFontSize < pSecondCont->m_pFontStyle->dFontSize * 0.8; @@ -1237,8 +1237,8 @@ namespace NSDocxRenderer pCont->m_dHeight = dHeight; pCont->m_dLeft = dLeft; - // первичное получение стиля для текущего символа - // при дальнейшем анализе может измениться + // Initial style retrieval for the current character + // May change during further analysis pCont->m_pFontStyle = m_pFontStyleManager->GetOrAddFontStyle( oBrush, m_pFontSelector->GetSelectedName(), diff --git a/DocxRenderer/src/logic/elements/Paragraph.cpp b/DocxRenderer/src/logic/elements/Paragraph.cpp index 0f4476d2f9..d7462281ad 100644 --- a/DocxRenderer/src/logic/elements/Paragraph.cpp +++ b/DocxRenderer/src/logic/elements/Paragraph.cpp @@ -43,10 +43,10 @@ namespace NSDocxRenderer { oWriter.WriteString(L" w:line=\""); oWriter.AddInt(static_cast<int>(m_dLineHeight * c_dMMToDx)); - oWriter.WriteString(L"\" w:lineRule=\"exact\""); // exact - точный размер строки + oWriter.WriteString(L"\" w:lineRule=\"exact\""); // exact - precise line height } - oWriter.WriteString(L"/>"); //конец w:spacing + oWriter.WriteString(L"/>"); // end of w:spacing oWriter.WriteString(L"<w:ind"); if (m_dLeftBorder > 0) @@ -58,7 +58,7 @@ namespace NSDocxRenderer if (m_dRightBorder > 0) { oWriter.WriteString(L" w:right=\""); - oWriter.AddInt(static_cast<int>(m_dRightBorder * c_dMMToDx)); //здесь m_dRight - расстояние от правого края + oWriter.AddInt(static_cast<int>(m_dRightBorder * c_dMMToDx)); // here m_dRight is the distance from the right edge oWriter.WriteString(L"\""); } if (m_bIsNeedFirstLineIndent) @@ -76,7 +76,7 @@ namespace NSDocxRenderer oWriter.WriteString(L"\""); } } - oWriter.WriteString(L"/>"); //конец w:ind + oWriter.WriteString(L"/>"); // end of w:ind switch (m_eTextAlignmentType) { @@ -93,7 +93,7 @@ namespace NSDocxRenderer oWriter.WriteString(L"<w:jc w:val=\"begin\"/>"); break; case tatUnknown: - default: //по умолчанию выравнивание по левому краю - можно ничего не добавлять + default: // default is left alignment - nothing needs to be added break; } diff --git a/DocxRenderer/src/logic/elements/Paragraph.h b/DocxRenderer/src/logic/elements/Paragraph.h index 4c4e859cd8..9e4fc1c305 100644 --- a/DocxRenderer/src/logic/elements/Paragraph.h +++ b/DocxRenderer/src/logic/elements/Paragraph.h @@ -23,12 +23,12 @@ namespace NSDocxRenderer TextAlignmentType m_eTextAlignmentType {tatUnknown}; // geometry paragraph - double m_dLeftBorder {0.0}; // сдвиг относительно левого края страницы/шейпа/таблицы - double m_dRightBorder{0.0}; // сдвиг относительно правого края страницы/шейпа/таблицы - double m_dFirstLine {0.0}; // сдвиг относительно m_dLeftBorder + double m_dLeftBorder {0.0}; // offset from left edge of page/shape/table + double m_dRightBorder{0.0}; // offset from right edge of page/shape/table + double m_dFirstLine {0.0}; // offset relative to m_dLeftBorder - double m_dSpaceBefore{0.0}; // по умолчанию выставляется 0, если отсутсвует w:before - double m_dSpaceAfter {0.0}; // в shape по умолчанию выставляется 8pt, если отсутсвует w:after + double m_dSpaceBefore{0.0}; // default is 0 if w:before is absent + double m_dSpaceAfter {0.0}; // in shape default is 8pt if w:after is absent double m_dLineHeight {0.0}; std::vector<std::shared_ptr<CTextLine>> m_arTextLines; diff --git a/DocxRenderer/src/logic/elements/Shape.cpp b/DocxRenderer/src/logic/elements/Shape.cpp index 691299ae19..15055a6c14 100644 --- a/DocxRenderer/src/logic/elements/Shape.cpp +++ b/DocxRenderer/src/logic/elements/Shape.cpp @@ -106,42 +106,42 @@ namespace NSDocxRenderer bool CShape::TryMergeShape(std::shared_ptr<CShape>& pShape) { - // можно попробовать подбирать динамически, например в зависимости от размера + // can try to select dynamically, for example depending on size double dHorNearby = 30; double dVerNearby = 30; if ( - // только для фигур + // only for shapes (pShape->m_eGraphicsType == eGraphicsType::gtComplicatedFigure || pShape->m_eGraphicsType == eGraphicsType::gtRectangle) && (this->m_eGraphicsType == eGraphicsType::gtComplicatedFigure || this->m_eGraphicsType == eGraphicsType::gtRectangle) && - // все совпадает + // everything matches pShape->m_eType == this->m_eType && pShape->m_oPen.IsEqual(&m_oPen) && pShape->m_oBrush.IsEqual(&m_oBrush) && pShape->m_bIsNoFill == m_bIsNoFill && pShape->m_bIsNoStroke == m_bIsNoStroke && - // не картинка + // not an image pShape->m_pImageInfo == nullptr && this->m_pImageInfo == nullptr && - // недалеко друг от друга по горизонтали + // close to each other horizontally (fabs(pShape->m_dRight - this->m_dLeft) < dHorNearby || fabs(pShape->m_dLeft - this->m_dRight) < dHorNearby || - // друг в друге тоже учитываем + // also consider when inside each other fabs(pShape->m_dRight - this->m_dRight) < dHorNearby || fabs(pShape->m_dLeft - this->m_dLeft) < dHorNearby) && - // недалеко друг от друга по вертикали + // close to each other vertically (fabs(pShape->m_dBot - this->m_dTop) < dVerNearby || fabs(pShape->m_dTop - this->m_dBot) < dVerNearby || - // друг в друге + // inside each other fabs(pShape->m_dBot - this->m_dBot) < dVerNearby || fabs(pShape->m_dTop - this->m_dTop) < dVerNearby)) { @@ -245,26 +245,26 @@ namespace NSDocxRenderer { if ((m_bIsNoStroke && m_bIsNoFill) || (m_oBrush.Color1 == c_iWhiteColor && m_oPen.Color == c_iWhiteColor)) m_eGraphicsType = eGraphicsType::gtNoGraphics; - else if ((nPeacks == 5 || nPeacks == 2) && !nCurves) //1 move + 4 Peacks или 2 Peacks + else if ((nPeacks == 5 || nPeacks == 2) && !nCurves) //1 move + 4 Peacks or 2 Peacks { m_eGraphicsType = eGraphicsType::gtRectangle; if (dHeight < 0.7) { - if (dWidth > 2.0) // длинное тире - 2.8mm у times new roman + if (dWidth > 2.0) // long dash - 2.8mm for times new roman m_eSimpleLineType = eSimpleLineType::sltHLongDash; - else if (dWidth > 0.7) // минимальное тире - 0.75mm у dotDotDash + else if (dWidth > 0.7) // minimum dash - 0.75mm for dotDotDash m_eSimpleLineType = eSimpleLineType::sltHDash; else - m_eSimpleLineType = eSimpleLineType::sltHDot; // максимальная точка - 0.5mm + m_eSimpleLineType = eSimpleLineType::sltHDot; // maximum dot - 0.5mm } else if (dWidth < 0.7) { - if (dHeight > 2.0) // длинное тире - 2.8mm у times new roman + if (dHeight > 2.0) // long dash - 2.8mm for times new roman m_eSimpleLineType = eSimpleLineType::sltVLongDash; - else if (dHeight > 0.7) // минимальное тире - 0.75mm у dotDotDash + else if (dHeight > 0.7) // minimum dash - 0.75mm for dotDotDash m_eSimpleLineType = eSimpleLineType::sltVDash; else - m_eSimpleLineType = eSimpleLineType::sltVDot; // максимальна точка - 0.5mm + m_eSimpleLineType = eSimpleLineType::sltVDot; // maximum dot - 0.5mm } } else if (nCurves > 0 && nPeacks <= 1) // 1 move @@ -329,7 +329,7 @@ namespace NSDocxRenderer if (!pFirstShape->IsItFitLine() || !pSecondShape->IsItFitLine() || !pFirstShape->IsCorrelated(pSecondShape) || fabs(pFirstShape->m_dHeight - pSecondShape->m_dHeight) > c_dGRAPHICS_ERROR_IN_LINES_MM) { - return; // линия должна быть одного размера по высоте + return; // line must be the same height } auto set_line_type = [] (std::shared_ptr<CShape>& master, std::shared_ptr<CShape>& slave, eLineType type) { @@ -339,7 +339,7 @@ namespace NSDocxRenderer slave = nullptr; }; - // проверка на двойную линию + // check for double line if (pFirstShape->m_eLineType == eLineType::ltDouble) { if (pFirstShape->m_dTop < pSecondShape->m_dTop) @@ -363,7 +363,7 @@ namespace NSDocxRenderer fabs(pFirstShape->m_dWidth - pSecondShape->m_dWidth) < c_dGRAPHICS_ERROR_IN_LINES_MM && fabs(pFirstShape->m_dLeft - pSecondShape->m_dLeft) < c_dGRAPHICS_ERROR_IN_LINES_MM) { - // условие первого определения + // first definition condition if (pFirstShape->m_eSimpleLineType == eSimpleLineType::sltHLongDash && pSecondShape->m_eSimpleLineType == eSimpleLineType::sltHLongDash) { if (pFirstShape->m_dTop < pSecondShape->m_dTop) @@ -381,10 +381,10 @@ namespace NSDocxRenderer return; } else if (fabs(pFirstShape->m_dTop - pSecondShape->m_dTop) > c_dGRAPHICS_ERROR_IN_LINES_MM) - return; // все должно быть на одной линии + return; // everything must be on one line - // теперь считаем, что графика находится на одной линии - // расстояние между объектами на одной линии должно быть небольшим + // now we assume that graphics are on one line + // distance between objects on one line should be small if (fabs(pFirstShape->m_dLeft + pFirstShape->m_dWidth - pSecondShape->m_dLeft) > c_dGRAPHICS_ERROR_IN_LINES_MM * 5) { if (pFirstShape->m_eLineType == eLineType::ltUnknown && pFirstShape->m_eSimpleLineType == eSimpleLineType::sltHLongDash) @@ -398,7 +398,7 @@ namespace NSDocxRenderer if (bIsLast) { - // если имеем всего 2 шейпа в линии, то нужно специально определять тип + // if we have only 2 shapes in line, need to specifically determine type if (pFirstShape->m_eLineType == eLineType::ltUnknown) { switch (pFirstShape->m_eSimpleLineType) @@ -563,21 +563,21 @@ namespace NSDocxRenderer void CShape::BuildGeneralProperties(NSStringUtils::CStringBuilder &oWriter) const { oWriter.WriteString(L"<wp:anchor"); - oWriter.WriteString(L" distT=\"0\""); //Определяет минимальное расстояние, которое должно сохраняться между краем - oWriter.WriteString(L" distB=\"0\""); //этого объекта рисования и любым последующим текстом в документе, когда - oWriter.WriteString(L" distL=\"0\""); //этот графический объект объект отображается в содержимом документа. + oWriter.WriteString(L" distT=\"0\""); // Specifies the minimum distance to maintain between the edge + oWriter.WriteString(L" distB=\"0\""); // of this drawing object and any subsequent text in document when + oWriter.WriteString(L" distL=\"0\""); // this graphic object is displayed in document content. oWriter.WriteString(L" distR=\"0\""); - oWriter.WriteString(L" simplePos=\"0\""); //true/1 Указывает, что этот объект должен быть позиционирован с использованием информации о позиционировании в дочернем элементе simplePos - oWriter.WriteString(L" relativeHeight=\""); //Определяет относительное упорядочивание по Z всех объектов DrawingML в этом документе. + oWriter.WriteString(L" simplePos=\"0\""); // true/1 Specifies that this object should be positioned using positioning info in simplePos child element + oWriter.WriteString(L" relativeHeight=\""); // Specifies relative Z-ordering of all DrawingML objects in this document. oWriter.AddUInt(m_nRelativeHeight); oWriter.WriteString(L"\""); - oWriter.WriteString(L" behindDoc=\""); //позади текста - 1, перед текстом - 0 + oWriter.WriteString(L" behindDoc=\""); // behind text - 1, in front of text - 0 oWriter.AddUInt(static_cast<UINT>(m_bIsBehindDoc)); oWriter.WriteString(L"\""); - oWriter.WriteString(L" locked=\"0\""); //true/1 Указывает, что местоположение привязки для этого объекта не должно быть изменено во время выполнения, когда приложение редактирует содержимое этого документа. - oWriter.WriteString(L" layoutInCell=\"0\""); //объект будет позиционирован, как указано, но таблица будет изменена в размерах и/или перемещена в документе, как это необходимо для размещения объекта. - oWriter.WriteString(L" allowOverlap=\"1\""); //разрешается перекрывать содержимое другого объекта - oWriter.WriteString(L" hidden=\"0\""); //Определяет, будет ли отображаться данный плавающий объект DrawingML. + oWriter.WriteString(L" locked=\"0\""); // true/1 Specifies that anchor location for this object should not be changed at runtime when app edits document content. + oWriter.WriteString(L" layoutInCell=\"0\""); // object will be positioned as specified, but table will be resized and/or moved in document as needed to accommodate object. + oWriter.WriteString(L" allowOverlap=\"1\""); // allowed to overlap content of another object + oWriter.WriteString(L" hidden=\"0\""); // Specifies whether this floating DrawingML object will be displayed. oWriter.WriteString(L">"); oWriter.WriteString(L"<wp:simplePos x=\"0\" y=\"0\"/>"); @@ -602,7 +602,7 @@ namespace NSDocxRenderer oWriter.WriteString(L"</wp:posOffset>"); oWriter.WriteString(L"</wp:positionV>"); - //координаты конца границы шейпа + // shape boundary end coordinates oWriter.WriteString(L"<wp:extent"); oWriter.WriteString(L" cx=\""); oWriter.AddUInt(static_cast<unsigned int>(width * c_dMMToEMU)); @@ -610,7 +610,7 @@ namespace NSDocxRenderer oWriter.AddUInt(static_cast<unsigned int>(height * c_dMMToEMU)); oWriter.WriteString(L"\"/>"); - oWriter.WriteString(L"<wp:effectExtent l=\"0\" t=\"0\" r=\"0\" b=\"0\"/>"); //Этот элемент определяет дополнительное расстояние, которое должно быть добавлено к каждому краю изображения, чтобы компенсировать любые эффекты рисования, применяемые к объекту DrawingML + oWriter.WriteString(L"<wp:effectExtent l=\"0\" t=\"0\" r=\"0\" b=\"0\"/>"); // This element specifies additional distance to be added to each edge of image to compensate for any drawing effects applied to DrawingML object oWriter.WriteString(L"<wp:wrapNone/>"); oWriter.WriteString(L"<wp:docPr id=\""); @@ -678,7 +678,7 @@ namespace NSDocxRenderer oWriter.WriteString(L"<wps:spPr>"); //shape properties. http://officeopenxml.com/drwSp-SpPr.php - //не работает + // does not work //oWriter.WriteString(L"<wps:style/>"); //shape styles. http://officeopenxml.com/drwSp-styles.php BuildForm(oWriter); BuildGraphicProperties(oWriter); @@ -785,7 +785,7 @@ namespace NSDocxRenderer BuildGraphicProperties(oWriter); oWriter.WriteString(L"</wpg:grpSpPr>"); - //todo довабить любое количество элементов в группе + // todo add any number of elements in group BuildPictureProperties(oWriter); BuildShapeProperties(oWriter); @@ -796,7 +796,7 @@ namespace NSDocxRenderer void CShape::BuildCanvasProperties(NSStringUtils::CStringBuilder &oWriter) const { - //todo добавить реализацию + // todo add implementation oWriter.WriteString(L"<a:graphicData uri=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\">"); } @@ -804,7 +804,7 @@ namespace NSDocxRenderer { std::wstring strPath = PathToWString(); - //Если просто текст без графики + // If just text without graphics if (strPath.empty()) { oWriter.WriteString(L"<a:prstGeom prst=\"rect\">"); @@ -813,7 +813,7 @@ namespace NSDocxRenderer } else { - //Рисуем сложный путь + // Draw complex path oWriter.WriteString(L"<a:custGeom>"); oWriter.WriteString(L"<a:avLst/>"); oWriter.WriteString(L"<a:gdLst/>"); @@ -832,7 +832,7 @@ namespace NSDocxRenderer } else if (m_eType != CShape::eShapeType::stVectorTexture) { - //Есть заливка + // Has fill oWriter.WriteString(L"<a:solidFill>"); oWriter.WriteString(L"<a:srgbClr val=\""); oWriter.WriteHexInt3(static_cast<int>(ConvertColorBGRToRGB(m_oBrush.Color1))); @@ -851,21 +851,21 @@ namespace NSDocxRenderer if (m_bIsNoStroke) { - oWriter.WriteString(L"<a:ln>"); // w - width по умолчанию 0.75pt = 9525 + oWriter.WriteString(L"<a:ln>"); // w - width default is 0.75pt = 9525 oWriter.WriteString(L"<a:noFill/>"); oWriter.WriteString(L"</a:ln>"); } else { oWriter.WriteString(L"<a:ln w=\""); - //todo Некоторые m_oPen.Size приходят увеличенными в 10 раз - oWriter.AddInt(static_cast<int>(m_oPen.Size * c_dMMToEMU)); //note можно писать в мм + // todo Some m_oPen.Size values come multiplied by 10 + oWriter.AddInt(static_cast<int>(m_oPen.Size * c_dMMToEMU)); // note can write in mm oWriter.WriteString(L"\">"); oWriter.WriteString(L"<a:solidFill>"); oWriter.WriteString(L"<a:srgbClr val=\""); - oWriter.WriteHexInt3(static_cast<int>(ConvertColorBGRToRGB(m_oPen.Color))); //note можно вместо цвета использовать слова типа "black" + oWriter.WriteHexInt3(static_cast<int>(ConvertColorBGRToRGB(m_oPen.Color))); // note can use words like "black" instead of color if (0xFF != m_oPen.Alpha) { oWriter.WriteString(L"\"><a:alpha val=\""); @@ -913,7 +913,7 @@ namespace NSDocxRenderer double height = bot - top; double width = right - left; - // отвечает за размеры прямоугольного фрейма шейпа + // responsible for rectangular shape frame dimensions oWriter.WriteString(L"<a:xfrm"); if (fabs(m_dRotation) > c_dMIN_ROTATION) { @@ -948,26 +948,26 @@ namespace NSDocxRenderer void CShape::BuildTextBoxParams(NSStringUtils::CStringBuilder &oWriter) const { - oWriter.WriteString(L" rot=\"0\""); //Определяет поворот, который применяется к тексту в пределах ограничивающей рамки. - oWriter.WriteString(L" spcFirstLastPara=\"0\""); //должен ли соблюдаться интервал между абзацами до и после, заданный пользователем. - oWriter.WriteString(L" vertOverflow=\"overflow\""); //может ли текст выходить за пределы ограничительной рамки по вертикали - oWriter.WriteString(L" horzOverflow=\"overflow\""); //может ли текст выходить за пределы ограничительной рамки по горизонтали. + oWriter.WriteString(L" rot=\"0\""); //Defines the rotation applied to text within the bounding box. + oWriter.WriteString(L" spcFirstLastPara=\"0\""); //Whether user-specified paragraph spacing before and after should be respected. + oWriter.WriteString(L" vertOverflow=\"overflow\""); //Whether text can overflow the bounding box vertically + oWriter.WriteString(L" horzOverflow=\"overflow\""); //Whether text can overflow the bounding box horizontally. oWriter.WriteString(L" vert=\"horz\""); - //oWriter.WriteString(L" wrap=\"none\""); //граница шейпа по ширине текста - oWriter.WriteString(L" wrap=\"square\""); //Определяет параметры обертки, которые будут использоваться для данного текстового тела. - //на сколько граница текста отступает от границы шейпа - oWriter.WriteString(L" lIns=\"0\""); //left по умолчанию 0.25см = 91440 - oWriter.WriteString(L" tIns=\"0\""); //top по умолчанию 0.13см = 45720 - oWriter.WriteString(L" rIns=\"0\""); //right по умолчанию 0.25см - oWriter.WriteString(L" bIns=\"0\""); //bottom по умолчанию 0.13см - oWriter.WriteString(L" numCol=\"1\""); //Определяет количество колонок текста в ограничивающем прямоугольнике. - oWriter.WriteString(L" spcCol=\"0\""); //Определяет пространство между колонками текста в текстовой области (только если numCol >1) - oWriter.WriteString(L" rtlCol=\"0\""); //используются ли столбцы в порядке справа налево (true) или слева направо (false). - oWriter.WriteString(L" fromWordArt=\"0\""); //true/1 текст в этом текстовом поле является преобразованным текстом из объекта WordArt. - oWriter.WriteString(L" anchor=\"t\""); //Вертикальное выравнивание текста в шейпе (t - top, b - bottom, ctr - middle) по умолчанию top - oWriter.WriteString(L" anchorCtr=\"0\""); //true/1 Определяет центрирование текстового поля. - oWriter.WriteString(L" forceAA=\"0\""); //true/1 Заставляет текст отображаться сглаженным независимо от размера шрифта. - oWriter.WriteString(L" compatLnSpc=\"1\""); //межстрочный интервал для данного текста определяется упрощенным способом с помощью сцены шрифта. + //oWriter.WriteString(L" wrap=\"none\""); //Shape boundary by text width + oWriter.WriteString(L" wrap=\"square\""); //Defines wrap parameters to be used for this text body. + //How much the text boundary is indented from the shape boundary + oWriter.WriteString(L" lIns=\"0\""); //left default 0.25cm = 91440 + oWriter.WriteString(L" tIns=\"0\""); //top default 0.13cm = 45720 + oWriter.WriteString(L" rIns=\"0\""); //right default 0.25cm + oWriter.WriteString(L" bIns=\"0\""); //bottom default 0.13cm + oWriter.WriteString(L" numCol=\"1\""); //Defines the number of text columns in the bounding rectangle. + oWriter.WriteString(L" spcCol=\"0\""); //Defines space between text columns in the text area (only if numCol >1) + oWriter.WriteString(L" rtlCol=\"0\""); //Whether columns are used right-to-left (true) or left-to-right (false). + oWriter.WriteString(L" fromWordArt=\"0\""); //true/1 Text in this text box is transformed text from a WordArt object. + oWriter.WriteString(L" anchor=\"t\""); //Vertical text alignment in shape (t - top, b - bottom, ctr - middle) default top + oWriter.WriteString(L" anchorCtr=\"0\""); //true/1 Defines text box centering. + oWriter.WriteString(L" forceAA=\"0\""); //true/1 Forces text to render anti-aliased regardless of font size. + oWriter.WriteString(L" compatLnSpc=\"1\""); //Line spacing for this text is determined in a simplified way using the font scene. oWriter.WriteString(L">"); oWriter.WriteString(L"<a:prstTxWarp prst=\"textNoShape\">"); @@ -990,7 +990,7 @@ namespace NSDocxRenderer oWriter.WriteString(L"</w:txbxContent>"); oWriter.WriteString(L"</wps:txbx>"); - oWriter.WriteString(L"<wps:bodyPr"); //определяет свойства тела текста внутри фигуры + oWriter.WriteString(L"<wps:bodyPr"); //Defines the text body properties inside the shape BuildTextBoxParams(oWriter); oWriter.WriteString(L"</wps:bodyPr>"); } diff --git a/DocxRenderer/src/logic/managers/FontManager.cpp b/DocxRenderer/src/logic/managers/FontManager.cpp index 4e40960c9a..c363757f3c 100644 --- a/DocxRenderer/src/logic/managers/FontManager.cpp +++ b/DocxRenderer/src/logic/managers/FontManager.cpp @@ -200,7 +200,7 @@ namespace NSDocxRenderer void CUnicodeRanges::CheckRange(const int& symbol, BYTE& Range, BYTE& RangeNum) { - // определяем range и двигаем его в начало. + // determine range and move it to the beginning. std::list<CUnicodeRange>::iterator iter = m_arRanges.begin(); while (iter != m_arRanges.end()) { @@ -329,7 +329,7 @@ namespace NSDocxRenderer for(auto it = m_arParamsCache.begin(); it != m_arParamsCache.end(); it++) { - // нашли в кэше, ничего не подбираем, выкинем наверх + // found in cache, no selection needed, return early if(it->oFontSelectParams == oFontSelectParams && it->lRange == lRange && it->lRangeNum == lRangeNum) { m_bIsSelectedBold = it->bIsSelectedBold; @@ -345,7 +345,7 @@ namespace NSDocxRenderer } } - // не нашли... + // not found... CFontSelectInfo oInfoCache; oInfoCache.oFontSelectParams = oFontSelectParams; oInfoCache.lRange = lRange; @@ -374,7 +374,7 @@ namespace NSDocxRenderer } else if (((lRangeNum == 2) && (lRange == 3)) || ((lRangeNum == 1) && (lRange == 31)) || ((lRangeNum == 0) && (lRange == 13))) { - // арабский язык!!! + // Arabic language!!! dwR1 = 1 << 13; dwR2 = 1 << 31; dwR3 = 1 << 3; @@ -435,7 +435,7 @@ namespace NSDocxRenderer m_bIsSelectedItalic = pInfo->m_bItalic; m_wsSelectedName = pInfo->m_wsFontName; - // закинем в кэш, чтобы потом не подбирать + // add to cache to avoid selection later oInfoCache.bIsSelectedBold = m_bIsSelectedBold; oInfoCache.bIsSelectedItalic = m_bIsSelectedItalic; oInfoCache.wsSelectedName = m_wsSelectedName; @@ -643,7 +643,7 @@ namespace NSDocxRenderer dBoxWidth = (double)(bbox.fMaxX - bbox.fMinX); dBoxHeight = (double)(bbox.fMaxY - bbox.fMinY); - // переводим в миллиметры + // convert to millimeters dBoxX *= c_dPixToMM; dBoxY *= c_dPixToMM; dBoxWidth *= c_dPixToMM; @@ -679,7 +679,7 @@ namespace NSDocxRenderer dBoxWidth = (double)(bbox.fMaxX - bbox.fMinX); dBoxHeight = (double)(bbox.fMaxY - bbox.fMinY); - // переводим в миллиметры + // convert to millimeters dBoxX *= c_dPixToMM; dBoxY *= c_dPixToMM; dBoxWidth *= c_dPixToMM; diff --git a/DocxRenderer/src/logic/managers/FontManager.h b/DocxRenderer/src/logic/managers/FontManager.h index 3000d99d00..fa6ffa46fc 100644 --- a/DocxRenderer/src/logic/managers/FontManager.h +++ b/DocxRenderer/src/logic/managers/FontManager.h @@ -20,7 +20,7 @@ namespace NSDocxRenderer CUnicodeRange(const int& _start = 0, const int& _end = 0, const BYTE& _range = 0, const BYTE& _rangenum = 0); }; - // класс для проставления Ranges для подбора шрифта по символу + // class for setting Ranges for font selection by character class CUnicodeRanges { public: @@ -43,7 +43,7 @@ namespace NSDocxRenderer struct CFontSelectParams { - // изначальные параметры, которые могут быть нам известны + // initial parameters that may be known to us std::wstring wsDefaultName{L""}; bool bDefaultBold{false}; bool bDefaultItalic{false}; @@ -60,11 +60,11 @@ namespace NSDocxRenderer bool operator==(const CFontSelectParams& oOther); }; - // подбирает шрифт по параметрам + // selects font by parameters class CFontSelector { public: - // структура для хранения уже подобранных шрифтов + // structure for storing already selected fonts struct CFontSelectInfo { CFontSelectParams oFontSelectParams; @@ -104,7 +104,7 @@ namespace NSDocxRenderer bool CheckFontNameStyle(std::wstring& wsName, const std::wstring& sStyle); }; - // грузит шрифт, его параметры и метрики + измеряет шрифт + // loads font, its parameters and metrics + measures font class CFontManager { public: diff --git a/DocxRenderer/src/logic/managers/FontStyleManager.cpp b/DocxRenderer/src/logic/managers/FontStyleManager.cpp index 737feced25..c01c1237ed 100644 --- a/DocxRenderer/src/logic/managers/FontStyleManager.cpp +++ b/DocxRenderer/src/logic/managers/FontStyleManager.cpp @@ -54,7 +54,7 @@ namespace NSDocxRenderer { auto val = *it; - // в начало списка + // to the beginning of the list if (it != m_arFontStyles.begin()) { m_arFontStyles.erase(it); diff --git a/DocxRenderer/src/logic/managers/ParagraphStyleManager.cpp b/DocxRenderer/src/logic/managers/ParagraphStyleManager.cpp index 1a769eb9e2..fda6f66ade 100644 --- a/DocxRenderer/src/logic/managers/ParagraphStyleManager.cpp +++ b/DocxRenderer/src/logic/managers/ParagraphStyleManager.cpp @@ -4,7 +4,7 @@ namespace NSDocxRenderer { CParagraphStyleManager::CParagraphStyleManager() { - // стандартные стили + // standard styles CParagraphStyle oNormal(L"Normal", L"Normal"); CParagraphStyle oHeading1(L"Heading1", L"Heading 1"); CParagraphStyle oHeading2(L"Heading2", L"Heading 2"); diff --git a/DocxRenderer/src/logic/styles/FontStyle.cpp b/DocxRenderer/src/logic/styles/FontStyle.cpp index ec37821893..31956ff191 100644 --- a/DocxRenderer/src/logic/styles/FontStyle.cpp +++ b/DocxRenderer/src/logic/styles/FontStyle.cpp @@ -73,7 +73,7 @@ namespace NSDocxRenderer oWriter.WriteString(L"\"/>"); oWriter.WriteString(L"<w:basedOn w:val=\""); - oWriter.WriteString(L"DefaultParagraphFont"); //todo сделать дерево зависимостей + oWriter.WriteString(L"DefaultParagraphFont"); //todo create dependency tree oWriter.WriteString(L"\"/>"); //oWriter.WriteString(L"<w:rsid w:val=\"00BB76B0\"/>"); diff --git a/DocxRenderer/src/resources/ColorTable.h b/DocxRenderer/src/resources/ColorTable.h index aafd08683e..53b3a2041d 100644 --- a/DocxRenderer/src/resources/ColorTable.h +++ b/DocxRenderer/src/resources/ColorTable.h @@ -15,7 +15,7 @@ public: auto iter = m_Table.find(sKey); if (iter == m_Table.end()) { - //note если не нашли стандартный цвет, отсылаем что есть + //note if standard color not found, return what we have return L"none"; } else @@ -57,7 +57,7 @@ private: m_Table.insert({0xFFFFFF, L"white" }); m_Table.insert({0xFFFF00, L"yellow" }); - //note Больше цветов здесь + //note More colors here //core\Common\3dParty\html\css\src\ConstValues.h //core\DesktopEditor\agg-2.4\svg\agg_svg_color_parser.cpp } diff --git a/DocxRenderer/src/resources/Constants.h b/DocxRenderer/src/resources/Constants.h index 4162390962..15cbff2140 100644 --- a/DocxRenderer/src/resources/Constants.h +++ b/DocxRenderer/src/resources/Constants.h @@ -6,7 +6,7 @@ #include "../../../DesktopEditor/common/Types.h" -#define USING_DELETE_DUPLICATING_CONTS 0 // 0 - все сточки-дубликаты превращаются в shape, 1 - строчки дубликаты удаляются +#define USING_DELETE_DUPLICATING_CONTS 0 // 0 - all duplicate lines become shapes, 1 - duplicate lines are deleted // #define USE_DEFAULT_FONT_TO_RECALC const double c_dDpiX = 72.0; diff --git a/DocxRenderer/test/main.cpp b/DocxRenderer/test/main.cpp index 8056d743a9..3bac39b44e 100644 --- a/DocxRenderer/test/main.cpp +++ b/DocxRenderer/test/main.cpp @@ -109,7 +109,7 @@ int main(int argc, char *argv[]) for (size_t nIndex = 0; nIndex < sSourceFiles.size(); nIndex++) { - // нужно скинуть тип, чтобы не определялся как OOXML всегда (см чеккер). + // need to reset type so it's not always detected as OOXML (see checker). oChecker.nFileType = 0; if (oChecker.isOfficeFile(sSourceFiles[nIndex])) { diff --git a/EpubFile/src/CEpubFile.cpp b/EpubFile/src/CEpubFile.cpp index 7480b31f53..fa48f95413 100644 --- a/EpubFile/src/CEpubFile.cpp +++ b/EpubFile/src/CEpubFile.cpp @@ -13,7 +13,7 @@ #include <sstream> #include <random> -// Заменяет в строке s все символы s1 на s2 +// Replaces all occurrences of s1 with s2 in string s void replace_all(std::wstring& s, const std::wstring& s1, const std::wstring& s2) { size_t pos = s.find(s1); @@ -367,7 +367,7 @@ HRESULT CEpubFile::FromHtml(const std::wstring& sHtmlFile, const std::wstring& s // index.html std::wstring sIndexHtml; NSFile::CFileBinary::ReadAllTextUtf8(sHtmlFile, sIndexHtml); - // картинки в файл + // images to file size_t nImage = sIndexHtml.find(L"data:image/png;base64, "); int nNumImage = 1; while (nImage != std::wstring::npos) @@ -390,14 +390,14 @@ HRESULT CEpubFile::FromHtml(const std::wstring& sHtmlFile, const std::wstring& s sIndexHtml.replace(nImage, nImageEnd - nImage, L"images/img" + std::to_wstring(nNumImage++) + L".png"); nImage = sIndexHtml.find(L"data:image/png;base64, ", nImage); } - // удаляем   + // remove   nImage = sIndexHtml.find(L" "); while (nImage != std::wstring::npos) { sIndexHtml.replace(nImage, 6, L" "); nImage = sIndexHtml.find(L" ", nImage); } - // заменяем <s> на style=text-decoration:line-through + // replace <s> with style=text-decoration:line-through nImage = sIndexHtml.find(L"<s>"); while (nImage != std::wstring::npos) { @@ -409,7 +409,7 @@ HRESULT CEpubFile::FromHtml(const std::wstring& sHtmlFile, const std::wstring& s sIndexHtml.insert(nEndTag, L";text-decoration:line-through"); nImage = sIndexHtml.find(L"<s>", nImage); } - // удаляем атрибут width у <td> + // remove width attribute from <td> nImage = sIndexHtml.find(L"<td"); while (nImage != std::wstring::npos) { @@ -422,7 +422,7 @@ HRESULT CEpubFile::FromHtml(const std::wstring& sHtmlFile, const std::wstring& s } nImage = sIndexHtml.find(L"<td", nImage); } - // удаляем атрибут clear у <br/> + // remove clear attribute from <br/> nImage = sIndexHtml.find(L"<br"); while (nImage != std::wstring::npos) { @@ -461,7 +461,7 @@ HRESULT CEpubFile::FromHtml(const std::wstring& sHtmlFile, const std::wstring& s replace_all(sTitle, L"\r", L" "); replace_all(sTitle, L"\t", L" "); - // Разделение html по <br> + // Split html by <br> int nFile = 0; nImage = sIndexHtml.find(L"<br"); sIndexHtml.replace(0, 6, L"<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\">"); diff --git a/EpubFile/test/main.cpp b/EpubFile/test/main.cpp index 828b5ad3cc..d5782576fc 100644 --- a/EpubFile/test/main.cpp +++ b/EpubFile/test/main.cpp @@ -29,7 +29,7 @@ int main() std::vector<std::wstring> arFiles = NSDirectory::GetFiles(NSFile::GetProcessDirectory() + L"/../../../Files"); clock_t tTime1 = clock(); - //Русские символы в консоль не выводятся + //Russian characters are not displayed in the console for (const std::wstring& sFileName : arFiles) { clock_t tTimeBegin = clock(); diff --git a/Fb2File/Fb2File.cpp b/Fb2File/Fb2File.cpp index d95598b759..42e4544d68 100644 --- a/Fb2File/Fb2File.cpp +++ b/Fb2File/Fb2File.cpp @@ -24,7 +24,7 @@ #define VALUE2STR(x) VALUE_TO_STRING(x) #endif -// Ячейка таблицы +// Table cell struct CTc { int i; @@ -39,38 +39,38 @@ struct CTc } }; -// Описание информации о произведении. Тэг title-info, src-title-info +// Description of work information. Tag: title-info, src-title-info struct STitleInfo { - std::wstring m_sGenres; // Жанры - std::wstring m_sAuthors; // Авторы - std::wstring m_sBookTitle; // Название - std::wstring m_sKeywords; // Ключевые слова - std::wstring m_sAnnotation;// Аннотация + std::wstring m_sGenres; // Genres + std::wstring m_sAuthors; // Authors + std::wstring m_sBookTitle; // Title + std::wstring m_sKeywords; // Keywords + std::wstring m_sAnnotation;// Annotation /* - std::vector<SAuthor> m_arTranslator; // Переводчики - std::wstring m_sLang; // Язык после перевода + std::vector<SAuthor> m_arTranslator; // Translators + std::wstring m_sLang; // Language after translation - std::pair<std::wstring, std::wstring>* m_pDate; // Дата - std::wstring* m_pSrcLang; // Язык до перевода - std::map<std::wstring, std::wstring> m_mSequence; // Серии книг + std::pair<std::wstring, std::wstring>* m_pDate; // Date + std::wstring* m_pSrcLang; // Language before translation + std::map<std::wstring, std::wstring> m_mSequence; // Book series */ }; -// Описание информации о fb2-документе. Тэг document-info +// Description of fb2-document information. Tag: document-info /* struct SDocumentInfo { - std::vector<SAuthor> m_arAuthors; // Авторы - std::vector<std::wstring> m_arSrcUrl; // URL страницы + std::vector<SAuthor> m_arAuthors; // Authors + std::vector<std::wstring> m_arSrcUrl; // Page URL - std::wstring m_pDate; // Дата - std::wstring m_sId; // Идентификатор - std::wstring m_sVersion; // Версия документа + std::wstring m_pDate; // Date + std::wstring m_sId; // Identifier + std::wstring m_sVersion; // Document version - std::wstring* m_pProgramUsed; // Использованные программы - std::wstring* m_pSrcOcr; // Автор текста - std::wstring* m_pHistory; // История + std::wstring* m_pProgramUsed; // Programs used + std::wstring* m_pSrcOcr; // Text author + std::wstring* m_pHistory; // History SDocumentInfo() { @@ -91,17 +91,17 @@ struct SDocumentInfo }; */ -// Информация о бумажном издании. Тэг publish-info +// Information about print edition. Tag: publish-info /* struct SPublishInfo { - std::wstring* m_pBookName; // Название - std::wstring* m_pPublisher; // Издательство - std::wstring* m_pCity; // Место - std::wstring* m_pYear; // Год + std::wstring* m_pBookName; // Title + std::wstring* m_pPublisher; // Publisher + std::wstring* m_pCity; // City + std::wstring* m_pYear; // Year std::wstring* m_pIsbn; // ISBN - std::map<std::wstring, std::wstring> m_mSequence; // Серии книг + std::map<std::wstring, std::wstring> m_mSequence; // Book series SPublishInfo() { @@ -168,29 +168,29 @@ class CFb2File_Private { public: XmlUtils::CXmlLiteReader m_oLightReader; // SAX Reader - STitleInfo m_oTitleInfo; // Данные о книге - // SDocumentInfo m_oDocumentInfo; // Информация об fb2-документе - // std::wstring m_sTmpFolder; // Рабочая папка - std::map<std::wstring, std::vector<std::wstring>> m_mImages; // Картинки - std::map<std::wstring, std::wstring> m_mFootnotes; // Сноски + STitleInfo m_oTitleInfo; // Book data + // SDocumentInfo m_oDocumentInfo; // fb2-document information + // std::wstring m_sTmpFolder; // Working folder + std::map<std::wstring, std::vector<std::wstring>> m_mImages; // Images + std::map<std::wstring, std::wstring> m_mFootnotes; // Footnotes NSStringUtils::CStringBuilder m_oDocXmlRels; // document.xml.rels NSStringUtils::CStringBuilder m_oNoteXmlRels; // footnotes.xml.rels private: - int m_nContentsId; // ID содержания - int m_nCrossReferenceId; // ID перекрестной ссылки - int m_nHyperlinkId; // ID внешней ссылки - bool m_bFootnote; // Чтение Footnote из html + int m_nContentsId; // Table of contents ID + int m_nCrossReferenceId; // Cross-reference ID + int m_nHyperlinkId; // External link ID + bool m_bFootnote; // Reading Footnote from html bool m_bInP; bool m_bInNote; bool m_bInTable; ParagraphProperties m_arParagraphProperties; - // STitleInfo* m_pSrcTitleInfo; // Данные об исходнике книги - // SPublishInfo* m_pPublishInfo; // Сведения об издании книги - // std::map<std::wstring, std::wstring> m_mCustomInfo; // Произвольная информация + // STitleInfo* m_pSrcTitleInfo; // Source book data + // SPublishInfo* m_pPublishInfo; // Book publication info + // std::map<std::wstring, std::wstring> m_mCustomInfo; // Custom information public: CFb2File_Private() @@ -220,15 +220,15 @@ public: */ } - // wrapper для чтения из файла + // wrapper for reading from file bool OpenFromFile(const std::wstring& sFile) { - // считаем, что это хмл, так как проверка на формат будет раньше (x2t) + // assume this is xml, since format check will happen earlier (x2t) std::string sFileContentUtf8 = XmlUtils::GetXmlContentAsUTF8(sFile); return m_oLightReader.FromStringA(sFileContentUtf8); } - // Проверяет наличие тэга FictionBook + // Checks for presence of FictionBook tag bool isFictionBook() { return m_oLightReader.ReadNextNode() && m_oLightReader.GetName() == L"FictionBook"; @@ -286,11 +286,11 @@ public: } } - // Читает image - // НЕ имеет право писать p + // Reads image + // Does NOT have permission to write p void readImage(NSStringUtils::CStringBuilder& oBuilder) { - // Читаем href + // Read href std::wstring sImageName; while (m_oLightReader.MoveToNextAttribute()) { @@ -313,7 +313,7 @@ public: std::map<std::wstring, std::vector<std::wstring>>::iterator it = m_mImages.find(sImageName); if (it != m_mImages.end()) { - // Пишем картинку в файл + // Write image to file // extent oBuilder += L"<w:r><w:drawing><wp:inline distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\""; oBuilder += it->second[1]; @@ -327,7 +327,7 @@ public: oBuilder += L"\" name=\"\"/><a:graphic xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\"><a:graphicData uri=\"http://schemas.openxmlformats.org/drawingml/2006/picture\"><pic:pic xmlns:pic=\"http://schemas.openxmlformats.org/drawingml/2006/picture\"><pic:nvPicPr><pic:cNvPr id=\""; oBuilder += it->second[0]; // pic:blipFill - // рельсы rPic + id + // relationships rPic + id oBuilder += L"\" name=\"\"/><pic:cNvPicPr></pic:cNvPicPr></pic:nvPicPr><pic:blipFill><a:blip r:embed=\"rPic"; oBuilder += it->second[0]; // pic:spPr @@ -335,12 +335,12 @@ public: oBuilder += it->second[1]; oBuilder += L"\" cy=\""; oBuilder += it->second[2]; - // Конец записи + // End of record oBuilder += L"\"/></a:xfrm><a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom></pic:spPr></pic:pic></a:graphicData></a:graphic></wp:inline></w:drawing></w:r>"; } } - // Читает title + // Reads title void readTitle(const std::wstring& sLevel, NSStringUtils::CStringBuilder& oBuilder) { if (m_oLightReader.IsEmptyNode()) @@ -350,21 +350,21 @@ public: int nDeath = m_oLightReader.GetDepth(); while (m_oLightReader.ReadNextSiblingNode(nDeath)) { - // Пишем заголовок + // Write heading if (m_oLightReader.GetName() == L"p") { - // Пишем title + sLevel + // Write title + sLevel oBuilder += L"<w:p><w:pPr><w:pStyle w:val=\""; oBuilder += sLevel; oBuilder += L"\"/>"; - // Заголовок книги с новой страницы + // Book title starts from new page if (sLevel == L"title" && bFirstP) { oBuilder += L"<w:pageBreakBefore/>"; bFirstP = false; } oBuilder += L"</w:pPr>"; - // Пишем ссылку от оглавления + // Write link from table of contents std::wstring sContentsId; if (sLevel == L"title1") { @@ -376,7 +376,7 @@ public: oBuilder += L"\"/>"; } readP(L"", oBuilder); - // Пишем ссылку от оглавления + // Write link from table of contents if (sLevel == L"title1") { oBuilder += L"<w:bookmarkEnd w:id=\""; @@ -388,7 +388,7 @@ public: } } - // Читает epigraph + // Reads epigraph void readEpigraph(NSStringUtils::CStringBuilder& oBuilder) { readCrossReference(oBuilder); @@ -412,7 +412,7 @@ public: readCite(oBuilder); else if (sName == L"empty-line") oBuilder += L"<w:p><w:pPr><w:pStyle w:val=\"epigraph-p\"/></w:pPr></w:p>"; - // Автор эпиграфа выделяется полужирным + // Epigraph author is highlighted in bold else if (sName == L"text-author") { oBuilder += L"<w:p><w:pPr><w:pStyle w:val=\"epigraph-p\"/></w:pPr>"; @@ -422,9 +422,9 @@ public: } } - // Читает p - // НЕ имеет право писать p - // sRStyle - накопленный стиль + // Reads p + // Does NOT have permission to write p + // sRStyle - accumulated style void readP(const std::wstring& sRStyle, NSStringUtils::CStringBuilder& oBuilder) { readCrossReference(oBuilder); @@ -436,32 +436,32 @@ public: while (m_oLightReader.ReadNextSiblingNode2(nDepth)) { std::wstring sName = m_oLightReader.GetName(); - // Читаем обычный текст + // Read plain text if (sName == L"#text") { - // Стиль текста + // Text style oBuilder += L"<w:r><w:rPr>"; oBuilder += sRStyle; - // Сам текст + // The text itself oBuilder += L"</w:rPr><w:t xml:space=\"preserve\">"; oBuilder.WriteEncodeXmlString(m_oLightReader.GetText()); oBuilder += L"</w:t></w:r>"; } - // Читаем полужирный текст + // Read bold text else if (sName == L"strong") readP(sRStyle + L"<w:b/>", oBuilder); - // Читаем курсивный текст + // Read italic text else if (sName == L"emphasis") readP(sRStyle + L"<w:i/>", oBuilder); - // Читаем стилизованный текст + // Read styled text else if (sName == L"style") readP(sRStyle, oBuilder); - // Читаем ссылку + // Read link else if (sName == L"a") { bool bCross = true, bMsoFootnote = false; - // Читаем href + // Read href std::wstring sRef; while (m_oLightReader.MoveToNextAttribute()) { @@ -493,28 +493,28 @@ public: std::map<std::wstring, std::wstring>::iterator it = m_mFootnotes.find(sRef); if (it != m_mFootnotes.end()) { - // Читаем текст внутри сноски + // Read text inside footnote if (!bMsoFootnote) readP(sRStyle, oBuilder); - // Стиль сноски + // Footnote style oBuilder += L"<w:r><w:rPr><w:rStyle w:val=\"footnote\"/></w:rPr><w:footnoteReference w:id=\""; oBuilder += it->second; oBuilder += L"\"/></w:r>"; } - // Перекрестная ссылка + // Cross-reference else { oBuilder += L"<w:hyperlink w:tooltip=\"Current Document\" w:anchor=\""; oBuilder += sRef; oBuilder += L"\">"; - // Читаем текст внутри ссылки + // Read text inside link readP(sRStyle + L"<w:rStyle w:val=\"cross\"/>", oBuilder); oBuilder += L"</w:hyperlink>"; } } else { - // Пишем рельсы + // Write relationships NSStringUtils::CStringBuilder* oRelationshipXml = &m_oDocXmlRels; if (m_bInNote) oRelationshipXml = &m_oNoteXmlRels; @@ -524,37 +524,37 @@ public: oRelationshipXml->WriteEncodeXmlString(sRef); oRelationshipXml->WriteString(L"\" TargetMode=\"External\"/>"); - // Пишем в document.xml + // Write to document.xml oBuilder.WriteString(L"<w:hyperlink w:tooltip=\""); oBuilder.WriteEncodeXmlString(sRef); oBuilder.WriteString(L"\" r:id=\"rHyp"); oBuilder.WriteString(std::to_wstring(m_nHyperlinkId++)); oBuilder.WriteString(L"\">"); - // Читаем текст внутри ссылки + // Read text inside link readP(sRStyle, oBuilder); oBuilder += L"</w:hyperlink>"; } } - // Читаем вычеркнутый текст + // Read strikethrough text else if (sName == L"strikethrough") readP(sRStyle + L"<w:strike/>", oBuilder); - // Читает нижний текст + // Read subscript text else if (sName == L"sub") readP(sRStyle + L"<w:vertAlign w:val=\"subscript\"/>", oBuilder); - // Читает верхний текст + // Read superscript text else if (sName == L"sup") readP(sRStyle + L"<w:vertAlign w:val=\"superscript\"/>", oBuilder); - // Читает код + // Read code else if (sName == L"code") readP(sRStyle + L"<w:rStyle w:val=\"code\"/>", oBuilder); - // Читает картинку в тексте + // Read inline image else if (sName == L"image") readImage(oBuilder); } } - // Читает poem + // Read poem void readPoem(NSStringUtils::CStringBuilder& oBuilder) { readCrossReference(oBuilder); @@ -589,7 +589,7 @@ public: } } } - // Автор поэмы выделяется полужирным + // Poem author is highlighted in bold else if (sName == L"text-author") { oBuilder += L"<w:p><w:pPr><w:pStyle w:val=\"v-stanza\"/></w:pPr>"; @@ -605,7 +605,7 @@ public: } } - // Читает cite + // Read cite void readCite(NSStringUtils::CStringBuilder& oBuilder) { readCrossReference(oBuilder); @@ -629,7 +629,7 @@ public: readPoem(oBuilder); else if (sName == L"table") readTable(oBuilder); - // Автор цитаты выделяется полужирным + // Quote author is highlighted in bold else if (sName == L"text-author") { oBuilder += L"<w:p><w:pPr><w:pStyle w:val=\"cite-p\"/></w:pPr>"; @@ -639,7 +639,7 @@ public: } } - // Читает table + // Read table void readTable(NSStringUtils::CStringBuilder& oBuilder) { readCrossReference(oBuilder); @@ -647,21 +647,21 @@ public: if (m_oLightReader.IsEmptyNode()) return; - // Стиль таблицы + // Table style oBuilder += L"<w:tbl><w:tblPr><w:tblStyle w:val=\"table-t\"/><w:tblW w:w=\"0\" w:type=\"auto\"/><w:tblLayout w:type=\"fixed\"/></w:tblPr>"; NSStringUtils::CStringBuilder oTmpBuilder; std::vector<CTc> mTable; int nGridCol = 0; - int i = 1; // Строка + int i = 1; // Row int nDeath = m_oLightReader.GetDepth(); while (m_oLightReader.ReadNextSiblingNode(nDeath)) { - // tr - строки в таблице + // tr - rows in table if (m_oLightReader.GetName() != L"tr" || m_oLightReader.IsEmptyNode()) continue; int nTCol = 0; - int j = 1; // Столбец + int j = 1; // Column oTmpBuilder += L"<w:tr>"; int nTrDeath = m_oLightReader.GetDepth(); while (m_oLightReader.ReadNextSiblingNode(nTrDeath)) @@ -677,7 +677,7 @@ public: } m_oLightReader.MoveToElement(); - // Вставляем ячейки до + // Insert cells before std::vector<CTc>::iterator it1 = std::find_if(mTable.begin(), mTable.end(), [i, j](const CTc& item){ return item.i == i && item.j == j; }); std::vector<CTc>::iterator it2 = std::find_if(mTable.begin(), mTable.end(), [j] (const CTc& item){ return item.i == 0 && item.j == j; }); while(it1 != mTable.end() || it2 != mTable.end()) @@ -710,7 +710,7 @@ public: j += nColspan - 1; } oTmpBuilder.WriteString(L"</w:tcPr><w:p>"); - // Читаем th. Ячейка заголовка таблицы. Выравнивание посередине. Выделяется полужирным + // Read th. Table header cell. Center alignment. Bold if (m_oLightReader.GetName() == L"th") { if (++nTCol > nGridCol) @@ -718,7 +718,7 @@ public: oTmpBuilder += L"<w:pPr><w:jc w:val=\"center\"/></w:pPr>"; readP(L"<w:b/>", oTmpBuilder); } - // Читаем td. Ячейка таблицы. Выравнивание вправо + // Read td. Table cell. Right alignment else if (m_oLightReader.GetName() == L"td") { if(++nTCol > nGridCol) @@ -729,7 +729,7 @@ public: oTmpBuilder += L"</w:p></w:tc>"; j++; - // Вставляем ячейки после + // Insert cells after it1 = std::find_if(mTable.begin(), mTable.end(), [i, j](const CTc& item){ return item.i == i && item.j == j; }); it2 = std::find_if(mTable.begin(), mTable.end(), [j] (const CTc& item){ return item.i == 0 && item.j == j; }); while(it1 != mTable.end() || it2 != mTable.end()) @@ -746,7 +746,7 @@ public: oTmpBuilder += L"</w:tr>"; i++; } - // Размеры таблицы + // Table dimensions std::wstring sGridCol; if (nGridCol != 0) sGridCol = std::to_wstring((int)(9570.0 / (double)nGridCol)); @@ -758,10 +758,10 @@ public: oBuilder += L"\"/>"; } oBuilder += L"</w:tblGrid>"; - // Конец таблицы + // End of table oBuilder += oTmpBuilder.GetData(); oBuilder += L"</w:tbl>"; - // Пустая строка после таблицы, чтобы следующий текст не приклеивался + // Empty line after table so next text doesn't stick oBuilder += L"<w:p></w:p>"; } @@ -785,7 +785,7 @@ public: } } - // Читает annotation + // Read annotation void readAnnotation(NSStringUtils::CStringBuilder& oBuilder) { readCrossReference(oBuilder); @@ -814,11 +814,11 @@ public: } } - // Читает перекрестные ссылки + // Read cross-references void readCrossReference(NSStringUtils::CStringBuilder& oBuilder) { bool bPBB = false, bCBB = false; - // id для перекрестных ссылок + // id for cross-references while (m_oLightReader.MoveToNextAttribute()) { std::wstring sAtrName = m_oLightReader.GetName(); @@ -850,7 +850,7 @@ public: } } - // Читает section + // Read section void readSection(int nLevel, NSStringUtils::CStringBuilder& oBuilder) { readCrossReference(oBuilder); @@ -904,7 +904,7 @@ public: } } - // Читает body + // Read body void readBody(NSStringUtils::CStringBuilder& oBuilder) { if (m_oLightReader.IsEmptyNode()) @@ -929,15 +929,15 @@ public: } } - // Читает содержание, binary, body, сноски, description + // Read content, binary, body, footnotes, description bool readText(const std::wstring& sPath, const std::wstring& sMediaDirectory, NSStringUtils::CStringBuilder& oContents, NSStringUtils::CStringBuilder& oFootnotes) { if (!m_oLightReader.IsValid()) { - // Открывает файл на проверку + // Open file for validation if (!OpenFromFile(sPath)) return false; - // Читаем FictionBook + // Read FictionBook if (!isFictionBook()) return false; } @@ -954,10 +954,10 @@ public: while (m_oLightReader.ReadNextSiblingNode(nDeath)) { std::wstring sName = m_oLightReader.GetName(); - // Читаем body + // Read body if (sName == L"body") { - // Сноски + // Footnotes bool bNotes = false; while(m_oLightReader.MoveToNextAttribute()) { @@ -966,14 +966,14 @@ public: bNotes = true; } m_oLightReader.MoveToElement(); - // Читаем сноски + // Read footnotes if (bNotes) readNotes(nFootnoteId, oFootnotes); - // Читаем содержание + // Read contents else readContents(nContentsId, oContents); } - // Читаем картинки + // Read images else if (sName == L"binary") getImage(std::to_wstring(nImageId++), sMediaDirectory); } @@ -981,7 +981,7 @@ public: return true; } - // Читает содержание + // Read contents void readContents(int& nContentsId, NSStringUtils::CStringBuilder& oContents) { if (m_oLightReader.IsEmptyNode()) @@ -991,17 +991,17 @@ public: int nBDeath = m_oLightReader.GetDepth(); while (m_oLightReader.ReadNextSiblingNode(nBDeath)) { - // Читаем section + // Read section if (m_oLightReader.GetName() != L"section" || m_oLightReader.IsEmptyNode()) continue; int nSDeath = m_oLightReader.GetDepth(); while (m_oLightReader.ReadNextSiblingNode(nSDeath)) { - // Читаем title + // Read title if (m_oLightReader.GetName() != L"title" || m_oLightReader.IsEmptyNode()) continue; oContents += L"<w:p><w:pPr><w:pStyle w:val=\"contents\"/><w:tabs><w:tab w:val=\"right\" w:pos=\"9355\" w:leader=\"none\"/></w:tabs>"; - // Абзац с новой страницы + // Paragraph from new page if (bFirstTitle) oContents += L"<w:pageBreakBefore/>"; oContents += L"</w:pPr>"; @@ -1020,7 +1020,7 @@ public: if (m_oLightReader.GetName() == L"p") { readP(L"<w:rStyle w:val=\"contents-p\"/>", oContents); - // Вставляем пробел между словами + // Insert space between words oContents += L"<w:r><w:t xml:space=\"preserve\"> </w:t></w:r>"; } } @@ -1031,7 +1031,7 @@ public: oContents += L"<w:p><w:r><w:fldChar w:fldCharType=\"end\"/></w:r></w:p>"; } - // Читает сноски + // Read footnotes void readNotes(int& nFootnoteId, NSStringUtils::CStringBuilder& oFootnotes) { if (m_oLightReader.IsEmptyNode()) @@ -1043,7 +1043,7 @@ public: { if (m_oLightReader.GetName() != L"section") continue; - // Читаем id + // Read id std::wstring sFootnoteName; while (m_oLightReader.MoveToNextAttribute()) { @@ -1059,12 +1059,12 @@ public: std::wstring sFootnoteId = std::to_wstring(nFootnoteId++); m_mFootnotes.insert(std::make_pair(sFootnoteName, sFootnoteId)); - // Пишем сноску + // Write footnote oFootnotes += L"<w:footnote w:id=\""; oFootnotes += sFootnoteId; oFootnotes += L"\">"; - // Читаем внутренность section + // Read section content int nSDepth = m_oLightReader.GetDepth(); while (m_oLightReader.ReadNextSiblingNode(nSDepth)) { @@ -1092,7 +1092,7 @@ public: while (m_oLightReader.ReadNextSiblingNode(nPDepth)) { std::wstring sPName = m_oLightReader.GetName(); - // Читаем stanza (один или более) + // Read stanza (one or more) if (sPName == L"stanza") { if (m_oLightReader.IsEmptyNode()) @@ -1101,12 +1101,12 @@ public: int nSDeath = m_oLightReader.GetDepth(); while (m_oLightReader.ReadNextSiblingNode(nSDeath)) { - // Читаем v (один или более) + // Read v (one or more) if (m_oLightReader.GetName() == L"v") ReadFootnote(oFootnotes); } } - // Читаем text-author (любое) + // Read text-author (any) else if (sPName == L"text-author") ReadFootnote(oFootnotes); } @@ -1117,14 +1117,14 @@ public: m_bInNote = false; } - // Читает binary + // Read binary void getImage(const std::wstring& sImageId, const std::wstring& sMediaDirectory) { std::wstring sId, sType = L".png"; while (m_oLightReader.MoveToNextAttribute()) { std::wstring sName = m_oLightReader.GetName(); - // Читает id + // Read id if (sName == L"id") sId = m_oLightReader.GetText(); else if (sName == L"content-type") @@ -1134,7 +1134,7 @@ public: if (sId.empty() || m_oLightReader.IsEmptyNode()) return; - // Пишет картинку в файл + // Write image to file NSFile::CFileBinary oImageWriter; std::wstring sImagePath = sMediaDirectory + L"/image" + sImageId + sType; if (oImageWriter.CreateFileW(sImagePath)) @@ -1148,7 +1148,7 @@ public: RELEASEARRAYOBJECTS(pImageData); oImageWriter.CloseFile(); - // Получаем размеры картинки + // Get image dimensions CBgraFrame oBgraFrame; oBgraFrame.OpenFile(sImagePath); int nHy = oBgraFrame.get_Height(); @@ -1180,7 +1180,7 @@ public: vImage.push_back(std::to_wstring(nHy)); m_mImages.insert(std::make_pair(sId, vImage)); - // Запись картинок в рельсы + // Write images to relationships m_oDocXmlRels += L"<Relationship Id=\"rPic"; m_oDocXmlRels += sImageId; m_oDocXmlRels += L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\" Target=\"media/"; @@ -1189,7 +1189,7 @@ public: } } - // Читает description + // Read description void readDescription(NSStringUtils::CStringBuilder& oBuilder) { if (m_oLightReader.IsEmptyNode()) @@ -1198,33 +1198,33 @@ public: int nDepth = m_oLightReader.GetDepth(); while (m_oLightReader.ReadNextSiblingNode(nDepth)) { - // Читаем title-info + // Read title-info if (m_oLightReader.GetName() == L"title-info") getTitleInfo(oBuilder); /* - // Читаем src-title-info (ноль или один) + // Read src-title-info (zero or one) else if(sName == L"src-title-info") { m_pSrcTitleInfo = new STitleInfo(); getTitleInfo(*m_pSrcTitleInfo); } - // Читаем document-info + // Read document-info else if(sName == L"document-info") getDocumentInfo(); - // Читаем publish-info (ноль или один) + // Read publish-info (zero or one) else if(sName == L"publish-info") { m_pPublishInfo = new SPublishInfo(); getPublishInfo(); } - // Читаем custom-info (любое) + // Read custom-info (any) else if(sName == L"custom-info") getCustomInfo(); */ } } - // Читает custom-info + // Read custom-info /* void getCustomInfo() { @@ -1237,7 +1237,7 @@ public: } */ - // Читает publish-info + // Read publish-info /* void getPublishInfo() { @@ -1248,7 +1248,7 @@ public: while(m_oLightReader.ReadNextSiblingNode(nDepth)) { std::wstring sName = m_oLightReader.GetName(); - // Читаем book-name (ноль или один) + // Read book-name (zero or one) if(sName == L"book-name") { if(m_pPublishInfo->m_pBookName) @@ -1256,7 +1256,7 @@ public: m_pPublishInfo->m_pBookName = new std::wstring[1]; *m_pPublishInfo->m_pBookName = content(); } - // Читаем publisher (ноль или один) + // Read publisher (zero or one) else if(sName == L"publisher") { if(m_pPublishInfo->m_pPublisher) @@ -1264,7 +1264,7 @@ public: m_pPublishInfo->m_pPublisher = new std::wstring[1]; *m_pPublishInfo->m_pPublisher = content(); } - // Читаем city (ноль или один) + // Read city (zero or one) else if(sName == L"city") { if(m_pPublishInfo->m_pCity) @@ -1272,7 +1272,7 @@ public: m_pPublishInfo->m_pCity = new std::wstring[1]; *m_pPublishInfo->m_pCity = content(); } - // Читаем year (ноль или один) + // Read year (zero or one) else if(sName == L"year") { if(m_pPublishInfo->m_pYear) @@ -1280,7 +1280,7 @@ public: m_pPublishInfo->m_pYear = new std::wstring[1]; *m_pPublishInfo->m_pYear = content(); } - // Читаем isbn (ноль или один) + // Read isbn (zero or one) else if(sName == L"isbn") { if(m_pPublishInfo->m_pIsbn) @@ -1288,7 +1288,7 @@ public: m_pPublishInfo->m_pIsbn = new std::wstring[1]; *m_pPublishInfo->m_pIsbn = content(); } - // Читаем sequence (любое) + // Read sequence (any) else if(sName == L"sequence") { std::wstring sSName = L""; @@ -1307,7 +1307,7 @@ public: } */ - // Читает document-info + // Read document-info /* void getDocumentInfo() { @@ -1318,10 +1318,10 @@ public: while(m_oLightReader.ReadNextSiblingNode(nDepth)) { std::wstring sName = m_oLightReader.GetName(); - // Читаем author (один или более) + // Read author (one or more) if(sName == L"author") getAuthor(m_oDocumentInfo.m_arAuthors); - // Читаем program-used (ноль или один) + // Read program-used (zero or one) else if(sName == L"program-used") { if(m_oDocumentInfo.m_pProgramUsed) @@ -1329,13 +1329,13 @@ public: m_oDocumentInfo.m_pProgramUsed = new std::wstring[1]; *m_oDocumentInfo.m_pProgramUsed = content(); } - // Читаем date + // Read date else if(sName == L"date") m_oDocumentInfo.m_pDate = content(); - // Читаем src-url (любое) + // Read src-url (any) else if(sName == L"src-url") m_oDocumentInfo.m_arSrcUrl.push_back(content()); - // Читаем src-ocr (ноль или один) + // Read src-ocr (zero or one) else if(sName == L"src-ocr") { if(m_oDocumentInfo.m_pSrcOcr) @@ -1343,13 +1343,13 @@ public: m_oDocumentInfo.m_pSrcOcr = new std::wstring[1]; *m_oDocumentInfo.m_pSrcOcr = content(); } - // Читаем id + // Read id else if(sName == L"id") m_oDocumentInfo.m_sId = content(); - // Читаем version + // Read version else if(sName == L"version") m_oDocumentInfo.m_sVersion = content(); - // Читаем history (ноль или один) + // Read history (zero or one) else if(sName == L"history") { if(m_oDocumentInfo.m_pHistory) @@ -1361,7 +1361,7 @@ public: } */ - // Читает title-info и src-title-info + // Read title-info and src-title-info void getTitleInfo(NSStringUtils::CStringBuilder& oBuilder) { if (m_oLightReader.IsEmptyNode()) @@ -1394,7 +1394,7 @@ public: std::wstring sGenre = content(); m_oTitleInfo.m_sGenres += ((m_oTitleInfo.m_sGenres.empty() ? L"" : L", ") + sGenre); } - // Читает поля автора + // Read author fields else if (sName == L"author") { std::wstring sFirstName, sMiddleName, sLastName, sNickname; @@ -1429,11 +1429,11 @@ public: } else if (sName == L"book-title") m_oTitleInfo.m_sBookTitle = content(); - // Читаем keywords (ноль или один) + // Read keywords (zero or one) else if(sName == L"keywords") m_oTitleInfo.m_sKeywords = content(); /* - // Читаем date (ноль или один) + // Read date (zero or one) else if(sName == L"date") { if(oTitleInfo.m_pDate) @@ -1448,10 +1448,10 @@ public: m_oLightReader.MoveToElement(); *oTitleInfo.m_pDate = make_pair(sDate, content()); } - // Читаем lang + // Read lang else if(sName == L"lang") oTitleInfo.m_sLang = content(); - // Читаем src-lang (ноль или один) + // Read src-lang (zero or one) else if(sName == L"src-lang") { if(oTitleInfo.m_pSrcLang) @@ -1459,10 +1459,10 @@ public: oTitleInfo.m_pSrcLang = new std::wstring[1]; *oTitleInfo.m_pSrcLang = content(); } - // Читаем translator (любое) + // Read translator (any) else if(sName == L"translator") getAuthor(oTitleInfo.m_arTranslator); - // Читаем sequence (любое) + // Read sequence (any) else if(sName == L"sequence") { std::wstring sSName = L""; @@ -1481,7 +1481,7 @@ public: } } - // Возвращает содержание узла + // Returns node content std::wstring content() { if (!m_oLightReader.IsEmptyNode() && m_oLightReader.ReadNextSiblingNode2(m_oLightReader.GetDepth())) @@ -1934,39 +1934,39 @@ CFb2File::~CFb2File() RELEASEOBJECT(m_internal); } -// Проверяет, соответствует ли fb2 файл формату +// Check if fb2 file matches format bool CFb2File::IsFb2File(const std::wstring& sFile) { - // Открывает файл на проверку + // Opens file for validation if (!m_internal->OpenFromFile(sFile)) return false; - // Читаем FictionBook + // Read FictionBook return m_internal->isFictionBook(); } -// Выставление рабочей папки +// Set working folder void CFb2File::SetTmpDirectory(const std::wstring& sFolder) { // m_internal->m_sTmpFolder = sFolder; } -// sPath - путь к файлу fb2, sDirectory - директория, где формируется и создается docx +// sPath - path to fb2 file, sDirectory - directory where docx is formed and created HRESULT CFb2File::Open(const std::wstring& sPath, const std::wstring& sDirectory, CFb2Params* oParams) { - // Копирование шаблона + // Copy template if (!ExtractTemplate(sDirectory)) return S_FALSE; - // Начало файла + // File start NSStringUtils::CStringBuilder oDocument; oDocument += L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:document xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 w15 wp14\"><w:body>"; - // Создаем сноски + // Create footnotes NSStringUtils::CStringBuilder oFootnotes; oFootnotes += L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:footnotes xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" mc:Ignorable=\"w14 w15 wp14\">"; oFootnotes += L"<w:footnote w:type=\"separator\" w:id=\"-1\"><w:p><w:pPr><w:spacing w:lineRule=\"auto\" w:line=\"240\" w:after=\"0\"/></w:pPr><w:r><w:separator/></w:r></w:p></w:footnote><w:footnote w:type=\"continuationSeparator\" w:id=\"0\"><w:p><w:pPr><w:spacing w:lineRule=\"auto\" w:line=\"240\" w:after=\"0\"/></w:pPr><w:r><w:continuationSeparator/></w:r></w:p></w:footnote>"; - // Создаем рельсы + // Create relationships m_internal->m_oDocXmlRels += L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">"; m_internal->m_oDocXmlRels += L"<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles\" Target=\"styles.xml\"/>"; m_internal->m_oDocXmlRels += L"<Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings\" Target=\"settings.xml\"/>"; @@ -1976,7 +1976,7 @@ HRESULT CFb2File::Open(const std::wstring& sPath, const std::wstring& sDirectory m_internal->m_oDocXmlRels += L"<Relationship Id=\"rId6\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes\" Target=\"footnotes.xml\"/>"; m_internal->m_oNoteXmlRels += L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">"; - // Директория картинок + // Images directory std::wstring sMediaDirectory = sDirectory + L"/word/media"; NSDirectory::CreateDirectory(sMediaDirectory); @@ -1984,14 +1984,14 @@ HRESULT CFb2File::Open(const std::wstring& sPath, const std::wstring& sDirectory NSStringUtils::CStringBuilder oDescription; NSStringUtils::CStringBuilder oContents; - // Читаем содержание, картинки, сноски + // Read content, images, footnotes bool bNeedContents = false; if (oParams) bNeedContents = oParams->bNeedContents; if (!m_internal->readText(sPath, sMediaDirectory, oContents, oFootnotes)) return S_FALSE; - // Переходим в начало + // Move to the beginning if (!m_internal->m_oLightReader.MoveToStart()) return S_FALSE; @@ -2017,9 +2017,9 @@ HRESULT CFb2File::Open(const std::wstring& sPath, const std::wstring& sDirectory } } - // Конец сносок + // End of footnotes oFootnotes += L"</w:footnotes>"; - // Пишем сноски в файл + // Write footnotes to file NSFile::CFileBinary oFootnotesWriter; if (oFootnotesWriter.CreateFileW(sDirectory + L"/word/footnotes.xml")) { @@ -2027,16 +2027,16 @@ HRESULT CFb2File::Open(const std::wstring& sPath, const std::wstring& sDirectory oFootnotesWriter.CloseFile(); } - // Вставляем description + // Insert description oDocument += oDescription.GetData(); - // Вставляем содержание + // Insert table of contents if (bNeedContents) oDocument += oContents.GetData(); - // Вставляем основное тело + // Insert main body oDocument += oBuilder.GetData(); - // Конец документа + // End of document oDocument += L"<w:sectPr><w:footnotePr/><w:type w:val=\"nextPage\"/><w:pgSz w:w=\"11906\" w:h=\"16838\" w:orient=\"portrait\"/><w:pgMar w:top=\"1134\" w:right=\"850\" w:bottom=\"1134\" w:left=\"1701\" w:header=\"709\" w:footer=\"709\" w:gutter=\"0\"/><w:cols w:num=\"1\" w:sep=\"0\" w:space=\"708\" w:equalWidth=\"1\"/><w:docGrid w:linePitch=\"360\"/></w:sectPr></w:body></w:document>"; - // Пишем документ в файл + // Write document to file NSFile::CFileBinary oDocumentXmlWriter; if (oDocumentXmlWriter.CreateFileW(sDirectory + L"/word/document.xml")) { @@ -2044,16 +2044,16 @@ HRESULT CFb2File::Open(const std::wstring& sPath, const std::wstring& sDirectory oDocumentXmlWriter.CloseFile(); } - // Директория app и core + // Directory for app and core std::wstring sDocPropsDirectory = sDirectory + L"/docProps"; NSDirectory::CreateDirectory(sDocPropsDirectory); - // Создаем core.xml + // Create core.xml NSStringUtils::CStringBuilder oCore; - // Заголовок + // Header oCore += L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><cp:coreProperties xmlns:cp=\"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:dcmitype=\"http://purl.org/dc/dcmitype/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><dc:title>"; oCore.WriteString(EncodeXmlString(m_internal->m_oTitleInfo.m_sBookTitle)); - // Жанры + // Genres oCore.WriteString(L"</dc:title>"); if (!m_internal->m_oTitleInfo.m_sGenres.empty()) { @@ -2061,14 +2061,14 @@ HRESULT CFb2File::Open(const std::wstring& sPath, const std::wstring& sDirectory oCore.WriteString(EncodeXmlString(m_internal->m_oTitleInfo.m_sGenres)); oCore.WriteString(L"</dc:subject>"); } - // Авторы + // Authors if (!m_internal->m_oTitleInfo.m_sAuthors.empty()) { oCore.WriteString(L"<dc:creator>"); oCore.WriteString(EncodeXmlString(m_internal->m_oTitleInfo.m_sAuthors)); oCore.WriteString(L"</dc:creator>"); } - // Ключевые слова + // Keywords if (!m_internal->m_oTitleInfo.m_sKeywords.empty()) { oCore.WriteString(L"<cp:keywords>"); @@ -2081,9 +2081,9 @@ HRESULT CFb2File::Open(const std::wstring& sPath, const std::wstring& sDirectory oCore.WriteString(EncodeXmlString(m_internal->m_oTitleInfo.m_sAnnotation)); oCore.WriteString(L"</dc:description>"); } - // Конец core + // End of core oCore += L"</cp:coreProperties>"; - // Пишем core в файл + // Write core to file NSFile::CFileBinary oCoreWriter; if (oCoreWriter.CreateFileW(sDocPropsDirectory + L"/core.xml")) { @@ -2091,7 +2091,7 @@ HRESULT CFb2File::Open(const std::wstring& sPath, const std::wstring& sDirectory oCoreWriter.CloseFile(); } - // Получаем версию ONLYOFFICE + // Get ONLYOFFICE version std::wstring sApplication = NSSystemUtils::GetEnvVariable(NSSystemUtils::gc_EnvApplicationName); if (sApplication.empty()) sApplication = NSSystemUtils::gc_EnvApplicationNameDefault; @@ -2100,12 +2100,12 @@ HRESULT CFb2File::Open(const std::wstring& sPath, const std::wstring& sDirectory #endif sApplication += L"/"; sApplication += UTF8_TO_U(sVersion); - // Создаем app.xml + // Create app.xml NSStringUtils::CStringBuilder oApp; oApp += L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Properties xmlns=\"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties\" xmlns:vt=\"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes\"><Application>"; oApp += sApplication; oApp += L"</Application><DocSecurity>0</DocSecurity><HyperlinksChanged>false</HyperlinksChanged><LinksUpToDate>false</LinksUpToDate><ScaleCrop>false</ScaleCrop><SharedDoc>false</SharedDoc></Properties>"; - // Пишем app в файл + // Write app to file NSFile::CFileBinary oAppWriter; if (oAppWriter.CreateFileW(sDocPropsDirectory + L"/app.xml")) { @@ -2113,9 +2113,9 @@ HRESULT CFb2File::Open(const std::wstring& sPath, const std::wstring& sDirectory oAppWriter.CloseFile(); } - // Конец рельсов + // End of relationships m_internal->m_oDocXmlRels += L"</Relationships>"; - // Пишем рельсы в файл + // Write relationships to file NSFile::CFileBinary oRelsWriter; if (oRelsWriter.CreateFileW(sDirectory + L"/word/_rels/document.xml.rels")) { @@ -2129,7 +2129,7 @@ HRESULT CFb2File::Open(const std::wstring& sPath, const std::wstring& sDirectory oRelsWriter.CloseFile(); } - // Архивим в docx + // Archive to docx bool bNeedDocx = false; if (oParams) bNeedDocx = oParams->bNeedDocx; @@ -2141,7 +2141,7 @@ HRESULT CFb2File::Open(const std::wstring& sPath, const std::wstring& sDirectory return S_OK; } -// sHtmlFile - путь к файлу html, sDst - путь к результирующему файлу fb2, sInpTitle - входящий заголовок файла +// sHtmlFile - path to html file, sDst - path to result fb2 file, sInpTitle - input file title HRESULT CFb2File::FromHtml(const std::wstring& sHtmlFile, const std::wstring& sDst, const std::wstring& sInpTitle) { std::wstring sTitle = sInpTitle; @@ -2219,7 +2219,7 @@ HRESULT CFb2File::FromHtml(const std::wstring& sHtmlFile, const std::wstring& sD oRes.WriteString(L"</binary>"); } oRes.WriteString(L"</FictionBook>"); - // Запись в файл + // Write to file NSFile::CFileBinary oWriter; if (oWriter.CreateFileW(sDst)) { diff --git a/Fb2File/test/main.cpp b/Fb2File/test/main.cpp index 06cde940ea..377c4a0782 100644 --- a/Fb2File/test/main.cpp +++ b/Fb2File/test/main.cpp @@ -19,18 +19,18 @@ int main() bool bFromHtml = false; if (bBatchMode) { - // Директория файлов + // Files directory std::wstring sDirectory = NSFile::GetProcessDirectory() + L"/../../../examples/fb2"; - // Вложенные директории + // Subdirectories std::vector<std::wstring> arrDirectory; getDirectories(sDirectory, arrDirectory); - // Параметры конвертации + // Conversion parameters CFb2Params oParams; oParams.bNeedDocx = false; oParams.bNeedContents = true; COfficeUtils oZip; - // Выставляем временную директорию + // Set temporary directory std::wstring sTmp = NSFile::GetProcessDirectory() + L"/tmp"; NSDirectory::DeleteDirectory(sTmp); NSDirectory::CreateDirectory(sTmp); @@ -47,7 +47,7 @@ int main() { std::vector<std::wstring> arrFiles = NSDirectory::GetFiles(sD); - // Директория, где будем создавать docx + // Directory where docx will be created size_t nPos = sD.find(L"/fb2"); sD.insert(nPos + 4, L"-res"); NSDirectory::DeleteDirectory(sD); @@ -90,10 +90,10 @@ int main() { CFb2File oFile; - // Файл, который открываем + // File to open std::wstring sFile = NSFile::GetProcessDirectory() + L"/res.fb2"; - // Директория, где будем создавать docx + // Directory where docx will be created std::wstring sOutputDirectory = NSFile::GetProcessDirectory() + L"/res"; NSDirectory::DeleteDirectory(sOutputDirectory); NSDirectory::CreateDirectory(sOutputDirectory); diff --git a/Fb2File/xml/tmp/main.cpp b/Fb2File/xml/tmp/main.cpp index 8c88bab552..68abb4fef6 100644 --- a/Fb2File/xml/tmp/main.cpp +++ b/Fb2File/xml/tmp/main.cpp @@ -7,66 +7,66 @@ int main() // sax reader XmlUtils::CXmlLiteReader oLightReader; /* - Выводы: - Возвращает успешность открытия файла - Читает файл в поток m_pStream - Длина потока в m_lStreamLen - Формирует reader - После чтения файл закрывается - Мысли: - xmlreader.h - функции работы с xml + Conclusions: + Returns success of file opening + Reads file into m_pStream stream + Stream length in m_lStreamLen + Creates reader + After reading the file is closed + Notes: + xmlreader.h - xml handling functions */ bool res1 = oLightReader.FromFile(NSFile::GetProcessDirectory() + L"/../../../examples/test.xml"); std::wcout << res1 << std::endl; // true /* - Возвращает порядковый номер узла (кажется нет) - Мысли: - Возвращает XmlNodeType_None(0) + Returns node ordinal number (seems not) + Notes: + Returns XmlNodeType_None(0) */ XmlUtils::XmlNodeType res2 = oLightReader.GetNodeType(); - std::wcout << res2<< " " << oLightReader.GetName() << std::endl; // 0 пусто, т.к. текущий узел отсутствует + std::wcout << res2<< " " << oLightReader.GetName() << std::endl; // 0 empty, because current node is absent /* - GetName() - возвращает имя текущего узла - GetDepth() - возвращает глубину текущего узла + GetName() - returns current node name + GetDepth() - returns current node depth */ /* - Возвращает успешность чтения узла указанного типа - По ссылке сохраняет тип узла - Мысли: - Значение XmlNodeType_None(0) преобразуется в XmlNodeType_Element(1) + Returns success of reading node of specified type + Saves node type by reference + Notes: + Value XmlNodeType_None(0) is converted to XmlNodeType_Element(1) */ - bool res3 = oLightReader.Read(res2); // Прочитает company + bool res3 = oLightReader.Read(res2); // Will read company std::wcout << res3 << " " << res2 << " " << oLightReader.GetName() << std::endl; // true 1 /* - Мысли: - Возвращает успешность чтения следующего узла - В reader изменяются глубина depth если узел вложенный - И текущий узел node + Notes: + Returns success of reading next node + In reader depth changes if node is nested + And current node */ - bool res4 = oLightReader.ReadNextNode(); // Прочитает staff + bool res4 = oLightReader.ReadNextNode(); // Will read staff std::wcout << res4 << " " << oLightReader.GetName() << std::endl; // true - bool res5 = oLightReader.ReadNextNode(); // Прочитает firstname + bool res5 = oLightReader.ReadNextNode(); // Will read firstname std::wcout << res5 << " " << oLightReader.GetName() << std::endl; // true /* - Возвращает успешность чтения следующего узла на той же глубине - 1 - Внешний тэг не в счет + Returns success of reading next node at same depth - 1 + Outer tag doesn't count */ - bool res6 = oLightReader.ReadNextSiblingNode(1); // Прочитает lastname + bool res6 = oLightReader.ReadNextSiblingNode(1); // Will read lastname std::wcout << res6 << " " << oLightReader.GetName() << std::endl; // true - //bool res7 = oLightReader.ReadNextSiblingNode(1); // Прочитает staff закрывающий - //std::wcout << res7 << std::endl; // false, т.к. прочитанный узел на другой глубине + //bool res7 = oLightReader.ReadNextSiblingNode(1); // Will read closing staff + //std::wcout << res7 << std::endl; // false, because read node is at different depth /* - Мысли: - Принудительно читает узел на той-же глубине, - Если узла нет, то создает узел text + Notes: + Forcibly reads node at same depth, + If no node, creates text node */ - bool res7 = oLightReader.ReadNextSiblingNode2(1); // Прочитает text (ЧТО ЭТО) родитель parent будет staff + bool res7 = oLightReader.ReadNextSiblingNode2(1); // Will read text (WHAT IS THIS) parent will be staff std::wcout << res7 << " " << oLightReader.GetName() << std::endl; // true return 0; diff --git a/HtmlFile/HtmlFile.cpp b/HtmlFile/HtmlFile.cpp index 4554e8fceb..198d50f429 100644 --- a/HtmlFile/HtmlFile.cpp +++ b/HtmlFile/HtmlFile.cpp @@ -359,7 +359,7 @@ int CHtmlFile::Convert(const std::vector<std::wstring>& arFiles, const std::wstr std::wstring sTmpDir = L""; if (m_internal->m_bIsEpub) { - // чтобы ссылки на картинки остались + // so that image links remain sTmpDir = NSFile::GetDirectoryName(sFilePath); if (!NSDirectory::Exists(sTmpDir)) sTmpDir = NSDirectory::GetTempPath(); @@ -738,7 +738,7 @@ int CHtmlFile::ConvertEpub(const std::wstring& sFolder, std::wstring& sMetaInfo, return 1; std::wstring::size_type findMime = sMimeType.find(L"application/epub+zip"); - if (findMime == std::wstring::npos || findMime > 10) // 10 - просто число. Заглушка под мега епабы + if (findMime == std::wstring::npos || findMime > 10) // 10 - just a number. Workaround for mega epubs return 1; std::wstring sContainer = sFolderWithSlash + L"META-INF/container.xml"; @@ -884,13 +884,13 @@ namespace NSMht std::wstring sRes = pUnicodeConverter->toUnicode(m_sData, sEnc.c_str()); - // дальше конвертим обратно в нужную кодировку, меня пути + // then convert back to the required encoding, changing paths for (std::map<std::wstring, std::wstring>::const_iterator i = sMap.begin(); i != sMap.end(); i++) { std::list<std::wstring> listReplace; listReplace.push_back(i->first); - // корень + // root if (true) { std::wstring::size_type pos = m_sContentLocation.find(L"//"); @@ -910,7 +910,7 @@ namespace NSMht } } - // и относительная + // and relative if (true) { std::wstring::size_type pos = m_sContentLocation.rfind('/'); @@ -1061,7 +1061,7 @@ namespace NSMht m_sFolder = L"D:\\test\\Document\\MHT"; #endif - // под линуксом предыдущая функция создает файл!!! + // on linux the previous function creates a file!!! if (NSFile::CFileBinary::Exists(m_sFolder)) NSFile::CFileBinary::Remove(m_sFolder); @@ -1154,13 +1154,13 @@ namespace NSMht void Convert() { - // сначала делаем мап файлов + // first make a map of files int nNumber = 0; for (std::list<CInnerFile>::iterator i = m_arFiles.begin(); i != m_arFiles.end(); i++) { nNumber++; CInnerFile* pFile = i.operator ->(); - std::wstring sFileExt = L".png"; // L".bin" - обычно это картинки. Так и будем сохранять + std::wstring sFileExt = L".png"; // L".bin" - usually these are images. Will save them this way if (pFile->m_sContentType.find(Names::cssFileType) != std::string::npos) { sFileExt = L".css"; @@ -1310,39 +1310,39 @@ namespace NSMht std::string boundary; std::wstring doc_location; - //пробегаемся по строкам файла MHT + //iterate through MHT file lines for (std::list<std::string>::iterator i = content.begin(); i != content.end();) { - // конвертируем строку с кодировкой файла + // convert string with file encoding std::string sLowerLine = GetLower(*i); - //Ищем инициализацию boundary в шапке документа MHT(boundary - разделитель внутренних файлов) - обязательный параметр + //Find boundary initialization in MHT document header (boundary - separator of internal files) - required parameter if (CheckProperty(sLowerLine, *i, Names::boundary_str, boundary)) { boundary = "--" + boundary; i++; } - //Ищем инициализацию contentLocation в шапке(наименование главного внутренний файла) - может отсутствовать + //Find contentLocation initialization in header (main internal file name) - may be absent else if (CheckPropertyW(sLowerLine, *i, Names::contentLocation_str, doc_location)) { i++; } - //если встретили разделитель, то начинаем считывать новый внутренний файл + //if we encounter a separator, start reading a new internal file else if (*i == boundary && !boundary.empty()) { CInnerFile oInnerFile; - //сначала считывается шапка внутреннего файла, которая отделяется от основного текста файлом как минимум одной пустой строкой + //first read the internal file header, which is separated from the main text by at least one empty line while ( i->length() != 0 ) { sLowerLine = GetLower(*i); - // Проверяем, возможно разделитель поменялся с данного места + // Check if the separator may have changed from this point if (CheckProperty(sLowerLine, *i, Names::boundary_str, boundary)) { boundary = "--" + boundary; } - //тип файла (image/, text/html, text/css) + //file type (image/, text/html, text/css) else if (CheckProperty(sLowerLine, sLowerLine, Names::contentType_str, oInnerFile.m_sContentType)) { if (oInnerFile.m_sContentType.find(Names::htmlFileType) != std::string::npos) @@ -1355,10 +1355,10 @@ namespace NSMht oInnerFile.m_sContentType = "image/jpg"; } } - //наименование файла + //file name else if (CheckPropertyW(sLowerLine, *i, Names::contentLocation_str, oInnerFile.m_sContentLocation)) {} else if (CheckPropertyW(sLowerLine, *i, Names::contentID_str, oInnerFile.m_sContentID)) {} - //кодировка (base64, 8bit, quoted-printable) + //encoding (base64, 8bit, quoted-printable) else if (CheckProperty(sLowerLine, sLowerLine, Names::contentTransferEncoding_str, oInnerFile.m_sContentEncoding)) {} else if (CheckProperty(sLowerLine, sLowerLine, Names::contentCharset_str, oInnerFile.m_sEncoding)) {} i++; @@ -1404,14 +1404,14 @@ namespace NSMht i++; } - //встречаются такие документы, где отсутсвует boundary + //there are documents where boundary is absent if (boundary == "") { for(std::list<std::string>::iterator i = content.begin(); i != content.end();) { CInnerFile oInnerFile; - //сначала считывается шапка внутреннего файла, которая отделяется от основного текста файлом как минимум одной пустой строкой + //first read the internal file header, which is separated from the main text by at least one empty line while ( i->length() != 0 ) { std::string sLowerLine = GetLower(*i); @@ -1428,10 +1428,10 @@ namespace NSMht oInnerFile.m_sContentType = "image/jpg"; } } - //наименование файла + //file name else if (CheckPropertyW(sLowerLine, *i, Names::contentLocation_str, oInnerFile.m_sContentLocation)) {} else if (CheckPropertyW(sLowerLine, *i, Names::contentID_str, oInnerFile.m_sContentID)) {} - //кодировка (base64, 8bit, quoted-printable) + //encoding (base64, 8bit, quoted-printable) else if (CheckProperty(sLowerLine, sLowerLine, Names::contentTransferEncoding_str, oInnerFile.m_sContentEncoding)) {} else if (CheckProperty(sLowerLine, sLowerLine, Names::contentCharset_str, oInnerFile.m_sEncoding)) {} i++; diff --git a/HtmlFile2/HTMLParameters.h b/HtmlFile2/HTMLParameters.h index 22c7a8fc25..2c28401772 100644 --- a/HtmlFile2/HTMLParameters.h +++ b/HtmlFile2/HTMLParameters.h @@ -7,15 +7,15 @@ namespace HTML { struct THTMLParameters { - std::wstring m_sGenres; // Жанры - std::wstring m_sAuthors; // Авторы - std::wstring m_sBookTitle; // Название - std::wstring m_sDate; // Дата - std::wstring m_sDescription; // описание - std::wstring m_sLanguage; // Язык - bool m_bNeedPageBreakBefore; // Новый html с новой страницы - std::wstring m_sdocDefaults; // Стиль docDefaults - std::wstring m_sNormal; // Стиль normal + std::wstring m_sGenres; // Genres + std::wstring m_sAuthors; // Authors + std::wstring m_sBookTitle; // Title + std::wstring m_sDate; // Date + std::wstring m_sDescription; // Description + std::wstring m_sLanguage; // Language + bool m_bNeedPageBreakBefore; // New html from new page + std::wstring m_sdocDefaults; // docDefaults style + std::wstring m_sNormal; // normal style THTMLParameters() : m_bNeedPageBreakBefore(false) {} diff --git a/HtmlFile2/HTMLReader.cpp b/HtmlFile2/HTMLReader.cpp index ee082e3800..abafeffa41 100644 --- a/HtmlFile2/HTMLReader.cpp +++ b/HtmlFile2/HTMLReader.cpp @@ -61,8 +61,8 @@ const static std::map<std::wstring, HtmlTag> m_HTML_TAGS ADD_TAG(L"code", CODE), ADD_TAG(L"col", COL), ADD_TAG(L"colgroup", COLGROUP), - ADD_TAG(L"command", SKIP_TAG), // Данного обозначения нет, но т.к.мы всё равно пропускаем, то делаем script - ADD_TAG(L"comment", SKIP_TAG), // Данного обозначения нет, но т.к.мы всё равно пропускаем, то делаем script + ADD_TAG(L"command", SKIP_TAG), // This tag designation doesn't exist, but since we skip it anyway, we treat it as script + ADD_TAG(L"comment", SKIP_TAG), // This tag designation doesn't exist, but since we skip it anyway, we treat it as script ADD_TAG(L"datalist", DATALIST), ADD_TAG(L"dd", DD), ADD_TAG(L"del", DEL), @@ -519,7 +519,7 @@ bool CHTMLReader::Convert(const std::wstring& wsPath, Convert_Func Convertation) m_oLightReader.ReadNextNode(); ReadStyle(); - // Переходим в начало + // Go to the beginning if(!m_oLightReader.MoveToStart()) return S_FALSE; @@ -544,7 +544,7 @@ void CHTMLReader::ReadStyle() ReadStyle2(); else { - // Стиль по ссылке + // Style by link if(sName == L"link") { while(m_oLightReader.MoveToNextAttribute()) @@ -552,7 +552,7 @@ void CHTMLReader::ReadStyle() m_oLightReader.MoveToElement(); } - // тэг style содержит стили для styles.xml + // style tag contains styles for styles.xml else if(sName == L"style") m_oCSSCalculator.AddStyles(m_oLightReader.GetText2()); else @@ -564,14 +564,14 @@ void CHTMLReader::ReadStyle() void CHTMLReader::ReadStyle2() { const std::wstring wsName = m_oLightReader.GetName(); - // Стиль по ссылке + // Style by link if(wsName == L"link") { while(m_oLightReader.MoveToNextAttribute()) ReadStyleFromNetwork(); m_oLightReader.MoveToElement(); } - // тэг style содержит стили для styles.xml + // style tag contains styles for styles.xml else if(wsName == L"style") m_oCSSCalculator.AddStyles(m_oLightReader.GetText2()); @@ -591,7 +591,7 @@ void CHTMLReader::ReadStyleFromNetwork() if(NSFile::GetFileExtention(sRef) != L"css") return; std::wstring sFName = NSFile::GetFileName(sRef); - // Стиль в сети + // Style from network if(sRef.substr(0, 4) == L"http") { sFName = m_wsTempDirectory + L'/' + sFName; @@ -633,7 +633,7 @@ void CHTMLReader::ReadHead() while (m_oLightReader.ReadNextSiblingNode(nDeath)) { const std::wstring wsName = m_oLightReader.GetName(); - // Базовый адрес + // Base address if (L"base" == wsName) m_wsBaseDirectory = GetArgumentValue(m_oLightReader, L"href"); } @@ -700,7 +700,7 @@ bool CHTMLReader::ReadInside(std::vector<NSCSS::CNode>& arSelectors) if(wsName == L"#text") return ReadText(arSelectors); - //TODO:: обработать все варианты return'а + //TODO:: handle all return variants if (UnreadableNode(wsName) || TagIsUnprocessed(wsName)) return false; @@ -832,7 +832,7 @@ bool CHTMLReader::ReadInside(std::vector<NSCSS::CNode>& arSelectors) case HTML_TAG(STYLE): case HTML_TAG(SCRIPT): { - //Если встретили не обрабатываемые теги, то просто пропускаем + //If we encounter unhandled tags, just skip them arSelectors.pop_back(); return false; } @@ -1021,9 +1021,9 @@ bool CHTMLReader::ReadTable(std::vector<NSCSS::CNode>& arSelectors) if (nullptr != m_pWriter && !m_pWriter->SupportNestedTables()) { - //Временно разруливаем это тут, так как по текущей логике мы сначала - //читаем всю таблицу и её вложенные элементы, а потом приступаем к конвертации, - //поэтому конвертору уже приходят вложенные таблицы, что в MD запрещено + //Temporarily handling this here, because with current logic we first + //read the entire table and its nested elements, then proceed to conversion, + //so the converter receives nested tables which is not allowed in MD for (std::vector<NSCSS::CNode>::const_reverse_iterator itElement{arSelectors.crbegin() + 1}; itElement < arSelectors.crend(); ++itElement) if (L"table" == itElement->m_wsName) return false; @@ -1123,8 +1123,8 @@ bool CHTMLReader::ReadTable(std::vector<NSCSS::CNode>& arSelectors) oTable.SetAlign(pStyle->m_oDisplay.GetHAlign().ToWString()); //------ - //TODO:: переписать работу с таблицами без предварительной конвертации ячеек и хранения их внутренних данных - //Читаем содержимое таблицы -> считаем ячейки -> нормализуем таблицу -> конвертим таблицу + //TODO:: rewrite table handling without pre-converting cells and storing their internal data + //Read table content -> count cells -> normalize table -> convert table int nDeath = m_oLightReader.GetDepth(); while(m_oLightReader.ReadNextSiblingNode(nDeath)) @@ -1308,7 +1308,7 @@ void CHTMLReader::ReadTableRows(CStorageTable& oTable, std::vector<NSCSS::CNode> arRowspanElements.push_back({pCell->GetRowspan(), unColumnIndex, pCell}); } - // Читаем th. Ячейка заголовка таблицы. Выравнивание посередине. Выделяется полужирным + // Read th. Table header cell. Center aligned. Bold text if(m_oLightReader.GetName() == L"th") { if (pCell->GetStyles()->m_wsHAlign.empty()) @@ -1320,7 +1320,7 @@ void CHTMLReader::ReadTableRows(CStorageTable& oTable, std::vector<NSCSS::CNode> ReadStream(arSelectors, true); m_pWriter->RevertDataOutput(); } - // Читаем td. Ячейка таблицы + // Read td. Table cell else if(m_oLightReader.GetName() == L"td") { m_pWriter->SetDataOutput(pCell->GetData()); @@ -1441,7 +1441,7 @@ void CHTMLReader::GetSubClass(std::vector<NSCSS::CNode>& arSelectors) NSCSS::CNode oNode; oNode.m_wsName = m_oLightReader.GetName(); - // Стиль по атрибуту + // Style by attribute std::wstring wsAttributeName; if (m_oLightReader.MoveToFirstAttribute()) @@ -1495,10 +1495,10 @@ inline std::wstring GetArgumentValue(XmlUtils::CXmlLiteReader& oLiteReader, cons return wsValue; } -// Так как CSS калькулятор не знает для какой ноды производится расчет стиля -// и не знает, что некоторые стили предназначены только определенной ноде, -// то проще пока обрабатывать это заранее -// ! Используется для стилей, заданных через аргументы ! +// Since CSS calculator doesn't know which node the style is being calculated for +// and doesn't know that some styles are intended only for a specific node, +// it's easier for now to handle this in advance +// ! Used for styles specified through arguments ! inline bool CheckArgumentMath(const std::wstring& wsNodeName, const std::wstring& wsStyleName) { if (L"border" == wsStyleName && L"table" != wsNodeName) diff --git a/HtmlFile2/HTMLReader.h b/HtmlFile2/HTMLReader.h index dce2cc1b85..d5a7c92244 100644 --- a/HtmlFile2/HTMLReader.h +++ b/HtmlFile2/HTMLReader.h @@ -18,14 +18,14 @@ namespace HTML class CHTMLReader { XmlUtils::CXmlLiteReader m_oLightReader; // SAX Reader - NSCSS::CCssCalculator m_oCSSCalculator; // Css калькулятор + NSCSS::CCssCalculator m_oCSSCalculator; // CSS calculator bool m_bIsTempDirOwner; - std::wstring m_wsTempDirectory; // Temp папка - std::wstring m_wsSrcDirectory; // Директория источника - std::wstring m_wsDstDirectory; // Директория назначения - std::wstring m_wsBaseDirectory; // Полный базовый адрес - std::wstring m_wsCoreDirectory; // Путь до корневого файла (используется для работы с Epub) + std::wstring m_wsTempDirectory; // Temp folder + std::wstring m_wsSrcDirectory; // Source directory + std::wstring m_wsDstDirectory; // Destination directory + std::wstring m_wsBaseDirectory; // Full base address + std::wstring m_wsCoreDirectory; // Path to root file (used for working with Epub) IWriter *m_pWriter; diff --git a/HtmlFile2/MarkdownParameters.h b/HtmlFile2/MarkdownParameters.h index 9398ea983f..a4c18eba2c 100644 --- a/HtmlFile2/MarkdownParameters.h +++ b/HtmlFile2/MarkdownParameters.h @@ -5,9 +5,9 @@ namespace HTML { struct TMarkdownParameters { - bool m_bUseAlternativeHTMLTags = false; //Использовать html теги там, где нет стандартной реализации в md(например для подчеркиваний) - wchar_t m_wchUnorderedList = L'-'; // Возможные варианты в md: -, +, * - wchar_t m_wchOrderedList = L'.'; // Возможные варианты в md: ., ) + bool m_bUseAlternativeHTMLTags = false; //Use HTML tags where there is no standard implementation in md (e.g. for underlines) + wchar_t m_wchUnorderedList = L'-'; // Possible options in md: -, +, * + wchar_t m_wchOrderedList = L'.'; // Possible options in md: ., ) }; } diff --git a/HtmlFile2/Table.cpp b/HtmlFile2/Table.cpp index 7d3f3d260d..142c8a85a4 100644 --- a/HtmlFile2/Table.cpp +++ b/HtmlFile2/Table.cpp @@ -23,8 +23,8 @@ namespace HTML #define ROW_POSITION_MASK 0x000000F0 #define PARSE_MODE_MASK 0x00000F00 -#define DEFAULT_PAGE_WIDTH 12240 // Значение в Twips -#define DEFAULT_PAGE_HEIGHT 15840 // Значение в Twips +#define DEFAULT_PAGE_WIDTH 12240 // Value in Twips +#define DEFAULT_PAGE_HEIGHT 15840 // Value in Twips TTableRowStyle::TTableRowStyle() : m_unMaxIndex(0), m_unMaxHeight(0), m_bIsHeader(false) @@ -621,7 +621,7 @@ void CStorageTable::Shorten() UINT unIndex = 0; CStorageTableCell* pCell = NULL; - UINT unMaxIndex = 0; //Максимальный индекс без учета строк, где имеется только 1 ячейка + UINT unMaxIndex = 0; //Maximum index excluding rows that have only 1 cell for (const CStorageTableRow* pRow : m_arRows) { diff --git a/HtmlFile2/Table.h b/HtmlFile2/Table.h index b3c828ece6..5446564569 100644 --- a/HtmlFile2/Table.h +++ b/HtmlFile2/Table.h @@ -164,7 +164,7 @@ private: UINT m_unWidth; }; -//Необходимые стили таблицы +//Required table styles struct TTableStyles { NSCSS::NSProperties::CIndent m_oPadding; @@ -228,7 +228,7 @@ public: void Shorten(); void CompleteTable(); - //TODO:: переделать на const std::vector<const T*> Get...() const; + //TODO:: refactor to const std::vector<const T*> Get...() const; const std::vector<std::vector<CStorageTableRow*>>& GetHeaders() const; const std::vector<CStorageTableRow*>& GetFoothers() const; const std::vector<CStorageTableRow*>& GetRows() const; diff --git a/HtmlFile2/Tags/MDTags.cpp b/HtmlFile2/Tags/MDTags.cpp index f47aa2ed22..02ee395be5 100644 --- a/HtmlFile2/Tags/MDTags.cpp +++ b/HtmlFile2/Tags/MDTags.cpp @@ -309,7 +309,7 @@ CTable<CMDWriter>::CTable(CMDWriter* pWriter) bool CTable<CMDWriter>::Open(const std::vector<NSCSS::CNode>& arSelectors, const boost::any& oExtraData) { - if (!ValidWriter() /*|| m_pWriter->InTable()*/) //В MD не поддерживаются вложенные таблицы (пока разруливаем в парсере) + if (!ValidWriter() /*|| m_pWriter->InTable()*/) // Nested tables are not supported in MD (for now handled in parser) return false; m_pWriter->WriteBreakLine(); diff --git a/HtmlFile2/Tags/OOXMLTags.cpp b/HtmlFile2/Tags/OOXMLTags.cpp index c29c32b9bb..9d2a3f2dae 100644 --- a/HtmlFile2/Tags/OOXMLTags.cpp +++ b/HtmlFile2/Tags/OOXMLTags.cpp @@ -16,8 +16,8 @@ namespace HTML { -#define DEFAULT_PAGE_WIDTH 12240 // Значение в Twips -#define DEFAULT_PAGE_HEIGHT 15840 // Значение в Twips +#define DEFAULT_PAGE_WIDTH 12240 // Value in Twips +#define DEFAULT_PAGE_HEIGHT 15840 // Value in Twips inline bool ElementInTable(const std::vector<NSCSS::CNode>& arSelectors); @@ -280,7 +280,7 @@ bool CImage<COOXMLWriter>::Open(const std::vector<NSCSS::CNode>& arSelectors, co std::wstring wsExtention; const std::wstring wsImagePath{m_pWriter->GetMediaDir() + L'i' + std::to_wstring(m_arrImages.size())}; - // Предполагаем картинку в Base64 + // Assume Base64-encoded image if (wsSrc.length() > 4 && wsSrc.substr(0, 4) == L"data" && wsSrc.find(L"/", 4) != std::wstring::npos) bRes = ReadBase64(wsSrc, wsImagePath, m_pWriter->GetFonts(), m_pWriter->GetTempDir(), wsExtention); @@ -297,7 +297,7 @@ bool CImage<COOXMLWriter>::Open(const std::vector<NSCSS::CNode>& arSelectors, co } } - // Проверка расширения + // Check extension if (!bRes) { wsExtention = NSFile::GetFileExtention(wsSrc); @@ -311,7 +311,7 @@ bool CImage<COOXMLWriter>::Open(const std::vector<NSCSS::CNode>& arSelectors, co const std::wstring wsBasePath{m_pWriter->GetBasePath()}; - // Предполагаем картинку в сети + // Assume network image if (!bRes && ((!wsBasePath.empty() && wsBasePath.length() > 4 && wsBasePath.substr(0, 4) == L"http") || (wsSrc.length() > 4 && wsSrc.substr(0, 4) == L"http"))) @@ -324,7 +324,7 @@ bool CImage<COOXMLWriter>::Open(const std::vector<NSCSS::CNode>& arSelectors, co const std::wstring wsDst = wsImagePath + L'.' + ((!wsExtention.empty()) ? wsExtention : L"png"); - // Проверка gc_allowNetworkRequest предполагается в kernel_network + // gc_allowNetworkRequest check is assumed in kernel_network NSNetwork::NSFileTransport::CFileDownloader oDownloadImg(m_pWriter->GetBasePath() + wsSrc, false); oDownloadImg.SetFilePath(wsDst); bRes = oDownloadImg.DownloadSync(); @@ -348,7 +348,7 @@ bool CImage<COOXMLWriter>::Open(const std::vector<NSCSS::CNode>& arSelectors, co } else if (wsExtention.empty()) { - //TODO:: лучше узнавать формат изображения из содержимого + //TODO:: better to detect image format from content wsExtention = L"png"; } } @@ -363,7 +363,7 @@ bool CImage<COOXMLWriter>::Open(const std::vector<NSCSS::CNode>& arSelectors, co return true; } - // Проверка на повтор + // Check for duplicate const std::vector<std::wstring>::const_iterator nFind = std::find(m_arrImages.cbegin(), m_arrImages.cend(), wsSrc); if (nFind != m_arrImages.end()) { @@ -372,7 +372,7 @@ bool CImage<COOXMLWriter>::Open(const std::vector<NSCSS::CNode>& arSelectors, co } } - // Предполагаем картинку по локальному пути + // Assume image by local path if (!bRes) { const std::wstring wsDst = wsImagePath + L'.' + wsExtention; @@ -558,7 +558,7 @@ bool CBlockquote<COOXMLWriter>::Open(const std::vector<NSCSS::CNode>& arSelector if (!ValidWriter()) return false; - //TODO:: когда Blockquote в Blockquote, то к первому нужно добавлять <w:divsChild> + //TODO:: when Blockquote inside Blockquote, need to add <w:divsChild> to the first one const std::wstring wsKeyWord{arSelectors.back().m_wsName}; @@ -687,7 +687,7 @@ bool CHorizontalRule<COOXMLWriter>::Open(const std::vector<NSCSS::CNode>& arSele std::wstring wsWidth; - // width измеряется в px или % + // width is measured in px or % if (!oWidth.Empty()) wsWidth = std::to_wstring(static_cast<int>((NSCSS::UnitMeasure::Percent != oWidth.GetUnitMeasure()) ? (NSCSS::CUnitMeasureConverter::ConvertPx(oWidth.ToDouble(), NSCSS::Inch, 96) * 914400.) : oWidth.ToDouble(NSCSS::Inch, unPageWidth))); else @@ -695,7 +695,7 @@ bool CHorizontalRule<COOXMLWriter>::Open(const std::vector<NSCSS::CNode>& arSele std::wstring wsHeight{L"14288"}; - // size измеряется только в px + // size is measured only in px if (!oSize.Empty()) wsHeight = std::to_wstring(static_cast<int>(NSCSS::CUnitMeasureConverter::ConvertPx(oSize.ToDouble(), NSCSS::Inch, 96) * 914400.)); @@ -746,7 +746,7 @@ bool CList<COOXMLWriter>::Open(const std::vector<NSCSS::CNode>& arSelectors, con m_pWriter->CloseP(); - //Нумерованный список + // Numbered list if (L"ol" == arSelectors.back().m_wsName) { const int nStart{NSStringFinder::ToInt(arSelectors.back().GetAttributeValue(L"start"), 1)}; @@ -880,7 +880,7 @@ bool ReadSVG(const std::wstring& wsSvg, NSFonts::IApplicationFonts* pFonts, cons return false; unsigned int alfa = 0xffffff; - //дефолтный тон должен быть прозрачным, а не белым + // default tone should be transparent, not white //memset(pBgraData, 0xff, nWidth * nHeight * 4); for (int i = 0; i < nWidth * nHeight; i++) { diff --git a/HtmlFile2/Writers/IWriter.h b/HtmlFile2/Writers/IWriter.h index efd46f749c..56b820f95b 100644 --- a/HtmlFile2/Writers/IWriter.h +++ b/HtmlFile2/Writers/IWriter.h @@ -24,12 +24,12 @@ public: virtual void BeginBlock() = 0; virtual void EndBlock(bool bAddBlock) = 0; - virtual void SetDataOutput(XmlString* pOutputData) = 0; // Задаем место вывода для интерпретатора - virtual void RevertDataOutput() = 0; // Возвращаем место вывода к исходному + virtual void SetDataOutput(XmlString* pOutputData) = 0; // Set output location for interpreter + virtual void RevertDataOutput() = 0; // Revert output location to original virtual XmlString* GetCurrentDocument() const = 0; - //TODO:: перенести разруливание вложенных таблиц в конвертацию после изменения принципа работы с таблицами + //TODO:: move nested tables handling to conversion after changing how tables work virtual bool SupportNestedTables() const = 0; }; } diff --git a/HtmlFile2/Writers/MDWriter.cpp b/HtmlFile2/Writers/MDWriter.cpp index 99e95b4529..cacb5d6bc1 100644 --- a/HtmlFile2/Writers/MDWriter.cpp +++ b/HtmlFile2/Writers/MDWriter.cpp @@ -56,7 +56,7 @@ bool CMDWriter::WriteText(std::wstring wsText, const std::vector<NSCSS::CNode>& if (!bPreformatted && nullptr != pCompiledStyle) { - // TODO::поведение должно быть немного разное (реализовать) + // TODO:: behavior should be slightly different (implement) switch(pCompiledStyle->m_oDisplay.GetWhiteSpace().ToInt()) { case NSCSS::NSProperties::EWhiteSpace::Pre: @@ -83,7 +83,7 @@ bool CMDWriter::WriteText(std::wstring wsText, const std::vector<NSCSS::CNode>& } } - //Пока корректно работает только для текста (необходимо проверить и с другими нодами) + // For now works correctly only for text (need to check with other nodes) if (m_arStates.top().m_bEmptyLine) { for (UINT unIndex = 0; unIndex < GetLevelBlockquote(); ++unIndex) diff --git a/HtmlFile2/Writers/OOXMLWriter.cpp b/HtmlFile2/Writers/OOXMLWriter.cpp index 5c1ec4379e..ba6c4c7c16 100644 --- a/HtmlFile2/Writers/OOXMLWriter.cpp +++ b/HtmlFile2/Writers/OOXMLWriter.cpp @@ -22,8 +22,8 @@ namespace HTML #define MAXCOLUMNSINTABLE 63 #define MAXROWSINTABLE 32767 -#define DEFAULT_PAGE_WIDTH 12240 // Значение в Twips -#define DEFAULT_PAGE_HEIGHT 15840 // Значение в Twips +#define DEFAULT_PAGE_WIDTH 12240 // Value in Twips +#define DEFAULT_PAGE_HEIGHT 15840 // Value in Twips #define DEFAULT_LANGUAGE std::wstring(L"en-US") #define DEFAULT_FONT_FAMILY std::wstring(L"Times New Roman") @@ -83,7 +83,7 @@ void COOXMLWriter::SetCoreDirectory(const std::wstring& wsPath) void COOXMLWriter::Begin(const std::wstring& wsDst) { - // Создаем пустые папки + // Create empty folders NSDirectory::CreateDirectory(wsDst + L"/_rels"); NSDirectory::CreateDirectory(wsDst + L"/docProps"); NSDirectory::CreateDirectory(wsDst + L"/word"); @@ -156,7 +156,7 @@ void COOXMLWriter::Begin(const std::wstring& wsDst) } // numbering.xml - // Маркированный список + // Bulleted list m_oNumberXml += L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:numbering xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 w15 wp14\"><w:abstractNum w:abstractNumId=\"0\"><w:multiLevelType w:val=\"hybridMultilevel\"/><w:lvl w:ilvl=\"0\"><w:start w:val=\"1\"/><w:numFmt w:val=\"bullet\"/><w:isLgl w:val=\"false\"/><w:suff w:val=\"tab\"/><w:lvlText w:val=\""; m_oNumberXml.AddCharSafe(183); m_oNumberXml += L"\"/><w:lvlJc w:val=\"left\"/><w:pPr><w:ind w:left=\"720\" w:hanging=\"360\"/></w:pPr><w:rPr><w:rFonts w:ascii=\"Symbol\" w:hAnsi=\"Symbol\" w:cs=\"Symbol\" w:eastAsia=\"Symbol\"/></w:rPr></w:lvl><w:lvl w:ilvl=\"1\"><w:start w:val=\"1\"/><w:numFmt w:val=\"bullet\"/><w:isLgl w:val=\"false\"/><w:suff w:val=\"tab\"/><w:lvlText w:val=\"o\"/><w:lvlJc w:val=\"left\"/><w:pPr><w:ind w:left=\"1440\" w:hanging=\"360\"/></w:pPr><w:rPr><w:rFonts w:ascii=\"Courier New\" w:hAnsi=\"Courier New\" w:cs=\"Courier New\" w:eastAsia=\"Courier New\"/></w:rPr></w:lvl><w:lvl w:ilvl=\"2\"><w:start w:val=\"1\"/><w:numFmt w:val=\"bullet\"/><w:isLgl w:val=\"false\"/><w:suff w:val=\"tab\"/><w:lvlText w:val=\""; @@ -224,7 +224,7 @@ void COOXMLWriter::Begin(const std::wstring& wsDst) oCoreWriter.CloseFile(); } - // Начала файлов + // File beginnings m_oDocXmlRels += L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">"; m_oDocXmlRels += L"<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles\" Target=\"styles.xml\"/>"; m_oDocXmlRels += L"<Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings\" Target=\"settings.xml\"/>"; @@ -242,7 +242,7 @@ void COOXMLWriter::Begin(const std::wstring& wsDst) m_nElementId += 7; - // docDefaults по умолчанию + // docDefaults default if(m_pHTMLParameters && !m_pHTMLParameters->m_sdocDefaults.empty()) m_oStylesXml += m_pHTMLParameters->m_sdocDefaults; else @@ -256,7 +256,7 @@ void COOXMLWriter::Begin(const std::wstring& wsDst) // m_oStylesXml += L"<w:pPrDefault><w:pPr><w:spacing w:after=\"200\" w:line=\"276\" w:lineRule=\"auto\"/></w:pPr></w:pPrDefault>"; } - // normal по умолчанию + // normal default if(m_pHTMLParameters && !m_pHTMLParameters->m_sNormal.empty()) m_oStylesXml += m_pHTMLParameters->m_sNormal; else @@ -266,15 +266,15 @@ void COOXMLWriter::Begin(const std::wstring& wsDst) m_oStylesXml += L"</w:rPr></w:style>"; } - // Маркированный список + // Bulleted list m_oStylesXml += L"<w:style w:type=\"paragraph\" w:styleId=\"li\"><w:name w:val=\"List Paragraph\"/><w:basedOn w:val=\"normal\"/><w:qFormat/><w:uiPriority w:val=\"34\"/><w:pPr><w:contextualSpacing w:val=\"true\"/><w:ind w:left=\"720\"/></w:pPr></w:style>"; - // Ссылки + // Links m_oStylesXml += L"<w:style w:type=\"character\" w:styleId=\"a\"><w:name w:val=\"Hyperlink\"/><w:uiPriority w:val=\"99\"/><w:unhideWhenUsed/><w:rPr><w:color w:val=\"0000FF\" w:themeColor=\"hyperlink\"/><w:u w:val=\"single\"/></w:rPr></w:style>"; - // Таблицы + // Tables // m_oStylesXml += L"<w:style w:type=\"table\" w:default=\"1\" w:styleId=\"table-based\"><w:name w:val=\"Normal Table\"/><w:uiPriority w:val=\"99\"/><w:semiHidden/><w:unhideWhenUsed/><w:tblPr><w:tblInd w:w=\"0\" w:type=\"dxa\"/><w:tblCellMar><w:top w:w=\"0\" w:type=\"dxa\"/><w:left w:w=\"108\" w:type=\"dxa\"/><w:bottom w:w=\"0\" w:type=\"dxa\"/><w:right w:w=\"108\" w:type=\"dxa\"/></w:tblCellMar></w:tblPr></w:style><w:style w:type=\"table\" w:styleId=\"table\"><w:name w:val=\"Table Grid\"/><w:basedOn w:val=\"table-based\"/><w:uiPriority w:val=\"59\"/><w:pPr><w:spacing w:lineRule=\"auto\" w:line=\"240\" w:after=\"0\"/></w:pPr><w:tblPr><w:tblBorders><w:top w:val=\"single\" w:sz=\"4\" w:space=\"0\" w:color=\"000000\"/><w:left w:val=\"single\" w:sz=\"4\" w:space=\"0\" w:color=\"000000\"/><w:bottom w:val=\"single\" w:sz=\"4\" w:space=\"0\" w:color=\"000000\"/><w:right w:val=\"single\" w:sz=\"4\" w:space=\"0\" w:color=\"000000\"/><w:insideH w:val=\"single\" w:sz=\"4\" w:space=\"0\" w:color=\"000000\"/><w:insideV w:val=\"single\" w:sz=\"4\" w:space=\"0\" w:color=\"000000\"/></w:tblBorders></w:tblPr></w:style>"; - // Сноски + // Footnotes m_oStylesXml += L"<w:style w:type=\"character\" w:styleId=\"footnote\"><w:name w:val=\"footnote reference\"/><w:uiPriority w:val=\"99\"/><w:unhideWhenUsed/><w:rPr><w:vertAlign w:val=\"superscript\"/></w:rPr></w:style><w:style w:type=\"paragraph\" w:styleId=\"footnote-p\"><w:name w:val=\"footnote text\"/><w:basedOn w:val=\"normal\"/><w:link w:val=\"footnote-c\"/><w:uiPriority w:val=\"99\"/><w:semiHidden/><w:unhideWhenUsed/><w:rPr><w:sz w:val=\"18\"/></w:rPr><w:pPr><w:spacing w:lineRule=\"auto\" w:line=\"240\" w:after=\"40\"/></w:pPr></w:style><w:style w:type=\"character\" w:styleId=\"footnote-c\" w:customStyle=\"1\"><w:name w:val=\"footnote text character\"/><w:link w:val=\"footnote-p\"/><w:uiPriority w:val=\"99\"/><w:rPr><w:sz w:val=\"18\"/></w:rPr></w:style>"; - // Web стиль по-умолчанию + // Web style default m_oStylesXml += L"<w:style w:type=\"paragraph\" w:styleId=\"normal-web\"><w:name w:val=\"Normal (Web)\"/><w:basedOn w:val=\"normal\"/><w:uiPriority w:val=\"99\"/><w:semiHidden/><w:unhideWhenUsed/><w:pPr><w:spacing w:before=\"100\" w:beforeAutospacing=\"1\" w:after=\"100\" w:afterAutospacing=\"1\"/></w:pPr></w:style>"; } @@ -342,9 +342,9 @@ void COOXMLWriter::End(const std::wstring& wsDst) } // numbering.xml - // Маркированный список + // Bulleted list m_oNumberXml.WriteString(L"<w:num w:numId=\"1\"><w:abstractNumId w:val=\"0\"/></w:num>"); - // Нумерованный список + // Numbered list for(int i = 1; i < m_nListId; i++) { m_oNumberXml.WriteString(L"<w:num w:numId=\""); @@ -465,7 +465,7 @@ void COOXMLWriter::CloseHyperlink() m_arStates.top().m_pCurrentDocument->WriteString(L"</w:hyperlink>"); m_arStates.top().m_bInHyperlink = false; - // Сноска + // Footnote if (m_arStates.top().m_wsFootnote.empty()) return; @@ -577,7 +577,7 @@ void COOXMLWriter::SetHyperlinkData(const std::wstring& wsRef, const std::wstrin { CloseHyperlink(); - //TODO:: подумать как лучше сделать работу с гиперссылками + //TODO:: think about how to better handle hyperlinks m_arStates.top().m_wsHref = wsRef; m_arStates.top().m_wsTooltip = wsTooltip; m_arStates.top().m_bISCrossHyperlink = bIsCross; @@ -633,7 +633,7 @@ void COOXMLWriter::OpenExternalHyperlink(const std::wstring& wsRef, const std::w oRelationshipXml.WriteString(L"\" TargetMode=\"External\"/>"); m_arStates.top().m_bInHyperlink = true; - // Пишем в document.xml + // Write to document.xml m_arStates.top().m_pCurrentDocument->WriteString(L"<w:hyperlink w:tooltip=\""); m_arStates.top().m_pCurrentDocument->WriteEncodeXmlString(wsTooltip); m_arStates.top().m_pCurrentDocument->WriteString(L"\" r:id=\"rHyp"); @@ -658,7 +658,7 @@ void COOXMLWriter::CloseCrossHyperlink(const std::vector<NSCSS::CNode>& arSelect bFootnote = oNode.m_wsName == L"p" && oNode.m_wsClass == L"MsoFootnoteText"; } - // Сноска + // Footnote if (!wsFootnote.empty()) { if (!bFootnote) @@ -839,7 +839,7 @@ bool COOXMLWriter::WriteText(std::wstring wsText, const std::vector<NSCSS::CNode if (!bPreformatted && nullptr != arSelectors.back().m_pCompiledStyle) { - // TODO::поведение должно быть немного разное (реализовать) + // TODO:: behavior should be slightly different (implement) switch(pCompiledStyle->m_oDisplay.GetWhiteSpace().ToInt()) { case NSCSS::NSProperties::EWhiteSpace::Pre: @@ -1062,7 +1062,7 @@ void COOXMLWriter::WriteImage(const TImageData& oImageData, const std::wstring& XmlString* pCurrentDocument{m_arStates.top().m_pCurrentDocument}; - // Пишем в document.xml + // Write to document.xml if (oImageData.ZeroSpaces()) { pCurrentDocument->WriteString(L"<w:drawing><wp:inline distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\""); @@ -1336,37 +1336,37 @@ std::wstring StandardizeHeaderId(const std::wstring& wsHeader) std::wstring result; result.reserve(wsHeader.size()); - // Флаг, указывающий, был ли предыдущий символ дефисом + // Flag indicating whether the previous character was a hyphen bool prevWasHyphen = false; bool inWhitespaceSequence = false; wchar_t lowerC; for (wchar_t c : wsHeader) { - // Приведение к нижнему регистру + // Convert to lowercase lowerC = std::tolower(c); - // Проверяем, является ли символ буквой или цифрой + // Check if the character is a letter or digit if (std::iswalnum(lowerC)) { result.push_back(lowerC); prevWasHyphen = false; inWhitespaceSequence = false; } - // Проверяем, является ли символ пробельным (пробел, табуляция и т.д.) + // Check if the character is whitespace (space, tab, etc.) else if (std::iswspace(lowerC)) { - // Заменяем последовательности пробельных символов на один дефис + // Replace sequences of whitespace characters with a single hyphen if (!inWhitespaceSequence && !result.empty()) { result.push_back(L'-'); inWhitespaceSequence = true; } } - // Проверяем, является ли символ дефисом или подчеркиванием + // Check if the character is a hyphen or underscore else if (c == L'-' || c == L'_') { - // Добавляем дефис, если предыдущий символ не был дефисом + // Add hyphen if the previous character was not a hyphen if (!prevWasHyphen && !result.empty()) { result.push_back(L'-'); @@ -1374,19 +1374,19 @@ std::wstring StandardizeHeaderId(const std::wstring& wsHeader) } inWhitespaceSequence = false; } - // Все остальные символы (знаки препинания) пропускаем - // Но если это буква в Unicode, мы можем её обработать + // Skip all other characters (punctuation marks) + // But if it's a Unicode letter, we can process it else if (std::iswalpha(lowerC)) { - // Для Unicode-символов, которые являются буквами + // For Unicode characters that are letters result.push_back(lowerC); prevWasHyphen = false; inWhitespaceSequence = false; } - // Остальные символы игнорируем + // Ignore other characters } - // Удаляем дефисы в начале и конце + // Remove hyphens at the beginning and end size_t start = 0; size_t end = result.length(); @@ -1396,7 +1396,7 @@ std::wstring StandardizeHeaderId(const std::wstring& wsHeader) while (end > start && result[end - 1] == L'-') --end; - // Удаляем последовательные дефисы + // Remove consecutive hyphens std::wstring finalResult; finalResult.reserve(end - start); diff --git a/HtmlFile2/Writers/OOXMLWriter.h b/HtmlFile2/Writers/OOXMLWriter.h index 1f9bd20fa0..3a81fb85ba 100644 --- a/HtmlFile2/Writers/OOXMLWriter.h +++ b/HtmlFile2/Writers/OOXMLWriter.h @@ -39,11 +39,11 @@ struct TImageData class COOXMLWriter : public IWriter { - const std::wstring *m_pDstPath; // Директория назначения - const std::wstring *m_pTempDir; // Temp папка - const std::wstring *m_pSrcPath; // Директория источника - const std::wstring *m_pBasePath; // Полный базовый адрес - const std::wstring *m_pCorePath; // Путь до корневого файла (используется для работы с Epub) + const std::wstring *m_pDstPath; // Destination directory + const std::wstring *m_pTempDir; // Temp folder + const std::wstring *m_pSrcPath; // Source directory + const std::wstring *m_pBasePath; // Full base address + const std::wstring *m_pCorePath; // Path to root file (used for working with Epub) XmlString m_oStylesXml; // styles.xml XmlString m_oDocXmlRels; // document.xml.rels @@ -53,28 +53,28 @@ class COOXMLWriter : public IWriter XmlString m_oNumberXml; // numbering.xml XmlString m_oWebSettings; // webSettings.xml - NSCSS::CDocumentStyle m_oXmlStyle; // Ooxml стиль - NSCSS::NSProperties::CPage m_oPageData; // Стили страницы + NSCSS::CDocumentStyle m_oXmlStyle; // OOXML style + NSCSS::NSProperties::CPage m_oPageData; // Page styles NSCSS::CCssCalculator *m_pStylesCalculator; THTMLParameters *m_pHTMLParameters; struct TState { - bool m_bInP; // <w:p> открыт? - bool m_bInR; // <w:r> открыт? - bool m_bInT; // <w:t> открыт? - bool m_bWasPStyle; // <w:pStyle> записан? - bool m_bWasSpace; // Был пробел? + bool m_bInP; // <w:p> open? + bool m_bInR; // <w:r> open? + bool m_bInT; // <w:t> open? + bool m_bWasPStyle; // <w:pStyle> written? + bool m_bWasSpace; // Was space? - bool m_bInHyperlink; // <w:hyperlink> открыт? + bool m_bInHyperlink; // <w:hyperlink> open? std::wstring m_wsTooltip; std::wstring m_wsHref; std::wstring m_wsFootnote; bool m_bIsFootnote; bool m_bISCrossHyperlink; - XmlString *m_pCurrentDocument; //Текущее место записи + XmlString *m_pCurrentDocument; //Current write location bool m_bRemoveCurrentDocument; TState(XmlString *pCurrentDocument) @@ -99,22 +99,22 @@ class COOXMLWriter : public IWriter std::stack<TState> m_arStates; - int m_nFootnoteId; // ID сноски - int m_nHyperlinkId; // ID ссылки - int m_nListId; // ID списка - int m_nElementId; // ID остальные элементы + int m_nFootnoteId; // Footnote ID + int m_nHyperlinkId; // Hyperlink ID + int m_nListId; // List ID + int m_nElementId; // ID for other elements - bool m_bBanUpdatePageData; // Запретить обновление данных о странице? + bool m_bBanUpdatePageData; // Prohibit page data update? std::stack<std::wstring> m_arDivId; bool m_bWasDivs; - std::map<std::wstring, std::wstring> m_mFootnotes; // Сноски - std::map<std::wstring, UINT> m_mBookmarks; // Закладки + std::map<std::wstring, std::wstring> m_mFootnotes; // Footnotes + std::map<std::wstring, UINT> m_mBookmarks; // Bookmarks using anchors_map = std::map<std::wstring, std::wstring>; - anchors_map m_mAnchors; // Map якорей с индивидуальными id + anchors_map m_mAnchors; // Map of anchors with individual ids - NSFonts::IApplicationFonts* m_pFonts; // Необходимо для оптимизации работы со шрифтами + NSFonts::IApplicationFonts* m_pFonts; // Needed for font handling optimization public: COOXMLWriter(THTMLParameters* pHTMLParameters = nullptr, NSCSS::CCssCalculator* pCSSCalculator = nullptr); diff --git a/HtmlFile2/htmlfile2.cpp b/HtmlFile2/htmlfile2.cpp index cfa58a5047..d5691dcd93 100644 --- a/HtmlFile2/htmlfile2.cpp +++ b/HtmlFile2/htmlfile2.cpp @@ -37,8 +37,8 @@ #define MAXCOLUMNSINTABLE 63 #define MAXROWSINTABLE 32767 -#define DEFAULT_PAGE_WIDTH 12240 // Значение в Twips -#define DEFAULT_PAGE_HEIGHT 15840 // Значение в Twips +#define DEFAULT_PAGE_WIDTH 12240 // Value in Twips +#define DEFAULT_PAGE_HEIGHT 15840 // Value in Twips #define DEFAULT_LANGUAGE std::wstring(L"en-US") #define DEFAULT_FONT_FAMILY std::wstring(L"Times New Roman") @@ -94,8 +94,8 @@ const std::map<std::wstring, HtmlTag> m_HTML_TAGS ADD_TAG(L"code", CODE), ADD_TAG(L"col", COL), ADD_TAG(L"colgroup", COLGROUP), - ADD_TAG(L"command", SKIP_TAG), // Данного обозначения нет, но т.к.мы всё равно пропускаем, то делаем script - ADD_TAG(L"comment", SKIP_TAG), // Данного обозначения нет, но т.к.мы всё равно пропускаем, то делаем script + ADD_TAG(L"command", SKIP_TAG), // This tag designation doesn't exist, but since we skip it anyway, we treat it as script + ADD_TAG(L"comment", SKIP_TAG), // This tag designation doesn't exist, but since we skip it anyway, we treat it as script ADD_TAG(L"datalist", DATALIST), ADD_TAG(L"dd", DD), ADD_TAG(L"del", DEL), @@ -244,7 +244,7 @@ static inline void WriteToStringBuilder(NSStringUtils::CStringBuilder& oSrcStrin } } -// Ячейка таблицы +// Table cell struct CTc { int i; @@ -261,16 +261,16 @@ struct CTc } }; -// Настройки текста +// Text settings struct CTextSettings { - bool bBdo; // Реверс текста - bool bPre; // Сохранение форматирования (Сохранение пробелов, табуляций, переносов строк) - bool bQ; // Цитата - bool bAddSpaces; // Добавлять пробелы перед текстом? - bool bMergeText; // Объединять подряд идущий текст в 1? - int nLi; // Уровень списка - bool bNumberingLi; // Является ли список нумерованным + bool bBdo; // Text reversal + bool bPre; // Preserve formatting (preserve spaces, tabs, line breaks) + bool bQ; // Quote + bool bAddSpaces; // Add spaces before text? + bool bMergeText; // Merge consecutive text into one? + int nLi; // List level + bool bNumberingLi; // Is the list numbered std::wstring sPStyle; @@ -421,7 +421,7 @@ typedef enum ParseModeFoother } ERowParseMode; -//Необходимые стили таблицы +//Required table styles struct TTableStyles { NSCSS::NSProperties::CIndent m_oPadding; @@ -1170,7 +1170,7 @@ public: UINT unIndex = 0; CTableCell* pCell = NULL; - UINT unMaxIndex = 0; //Максимальный индекс без учета строк, где имеется только 1 ячейка + UINT unMaxIndex = 0; //Maximum index excluding rows with only 1 cell for (const CTableRow* pRow : m_arRows) { @@ -1414,37 +1414,37 @@ std::wstring StandardizeHeaderId(const std::wstring& header) std::wstring result; result.reserve(header.size()); - // Флаг, указывающий, был ли предыдущий символ дефисом + // Flag indicating whether previous character was a hyphen bool prevWasHyphen = false; bool inWhitespaceSequence = false; wchar_t lowerC; for (wchar_t c : header) { - // Приведение к нижнему регистру + // Convert to lowercase lowerC = std::tolower(c); - // Проверяем, является ли символ буквой или цифрой + // Check if character is a letter or digit if (std::iswalnum(lowerC)) { result.push_back(lowerC); prevWasHyphen = false; inWhitespaceSequence = false; } - // Проверяем, является ли символ пробельным (пробел, табуляция и т.д.) + // Check if character is whitespace (space, tab, etc.) else if (std::iswspace(lowerC)) { - // Заменяем последовательности пробельных символов на один дефис + // Replace whitespace sequences with a single hyphen if (!inWhitespaceSequence && !result.empty()) { result.push_back(L'-'); inWhitespaceSequence = true; } } - // Проверяем, является ли символ дефисом или подчеркиванием + // Check if character is a hyphen or underscore else if (c == L'-' || c == L'_') { - // Добавляем дефис, если предыдущий символ не был дефисом + // Add hyphen if previous character wasn't a hyphen if (!prevWasHyphen && !result.empty()) { result.push_back(L'-'); @@ -1452,19 +1452,19 @@ std::wstring StandardizeHeaderId(const std::wstring& header) } inWhitespaceSequence = false; } - // Все остальные символы (знаки препинания) пропускаем - // Но если это буква в Unicode, мы можем её обработать + // Skip all other characters (punctuation marks) + // But if it's a Unicode letter, we can process it else if (std::iswalpha(lowerC)) { - // Для Unicode-символов, которые являются буквами + // For Unicode characters that are letters result.push_back(lowerC); prevWasHyphen = false; inWhitespaceSequence = false; } - // Остальные символы игнорируем + // Ignore remaining characters } - // Удаляем дефисы в начале и конце + // Remove hyphens at the beginning and end size_t start = 0; size_t end = result.length(); @@ -1474,7 +1474,7 @@ std::wstring StandardizeHeaderId(const std::wstring& header) while (end > start && result[end - 1] == L'-') --end; - // Удаляем последовательные дефисы + // Remove consecutive hyphens std::wstring finalResult; finalResult.reserve(end - start); @@ -1573,26 +1573,26 @@ class CHtmlFile2_Private { public: XmlUtils::CXmlLiteReader m_oLightReader; // SAX Reader - NSCSS::CCssCalculator m_oStylesCalculator; // Css калькулятор - NSCSS::CDocumentStyle m_oXmlStyle; // Ooxml стиль + NSCSS::CCssCalculator m_oStylesCalculator; // CSS calculator + NSCSS::CDocumentStyle m_oXmlStyle; // OOXML style - NSCSS::NSProperties::CPage m_oPageData; // Стили страницы + NSCSS::NSProperties::CPage m_oPageData; // Page styles - std::wstring m_sTmp; // Temp папка - std::wstring m_sSrc; // Директория источника - std::wstring m_sDst; // Директория назначения - std::wstring m_sBase; // Полный базовый адрес - std::wstring m_sCore; // Путь до корневого файла (используется для работы с Epub) + std::wstring m_sTmp; // Temp folder + std::wstring m_sSrc; // Source directory + std::wstring m_sDst; // Destination directory + std::wstring m_sBase; // Full base address + std::wstring m_sCore; // Path to root file (used for Epub handling) private: - int m_nFootnoteId; // ID сноски - int m_nHyperlinkId; // ID ссылки - int m_nNumberingId; // ID списка - int m_nId; // ID остальные элементы + int m_nFootnoteId; // Footnote ID + int m_nHyperlinkId; // Hyperlink ID + int m_nNumberingId; // List ID + int m_nId; // ID for other elements int m_nShapeId; // Id shape's using anchors_map = std::map<std::wstring, std::wstring>; - anchors_map m_mAnchors; // Map якорей с индивидуальными id + anchors_map m_mAnchors; // Map of anchors with individual IDs NSStringUtils::CStringBuilder m_oStylesXml; // styles.xml NSStringUtils::CStringBuilder m_oDocXmlRels; // document.xml.rels @@ -1604,14 +1604,14 @@ private: struct TState { - bool m_bInP; // <w:p> открыт? - bool m_bInR; // <w:r> открыт? - bool m_bInT; // <w:t> открыт? - bool m_bWasPStyle; // <w:pStyle> записан? - bool m_bWasSpace; // Был пробел? - bool m_bInHyperlink; // <w:hyperlink> открыт? + bool m_bInP; // Is <w:p> open? + bool m_bInR; // Is <w:r> open? + bool m_bInT; // Is <w:t> open? + bool m_bWasPStyle; // Is <w:pStyle> written? + bool m_bWasSpace; // Was there a space? + bool m_bInHyperlink; // Is <w:hyperlink> open? - bool m_bBanUpdatePageData; // Запретить обновление данных о странице? + bool m_bBanUpdatePageData; // Prohibit page data update? HtmlTag m_eLastElement; @@ -1620,12 +1620,12 @@ private: {} } m_oState; - std::vector<std::wstring> m_arrImages; // Картинки - std::map<std::wstring, std::wstring> m_mFootnotes; // Сноски - std::map<std::wstring, UINT> m_mBookmarks; // Закладки - std::map<std::wstring, UINT> m_mDivs; // Div элементы + std::vector<std::wstring> m_arrImages; // Images + std::map<std::wstring, std::wstring> m_mFootnotes; // Footnotes + std::map<std::wstring, UINT> m_mBookmarks; // Bookmarks + std::map<std::wstring, UINT> m_mDivs; // Div elements - NSFonts::IApplicationFonts* m_pFonts; // Необходимо для оптимизации работы со шрифтами + NSFonts::IApplicationFonts* m_pFonts; // Required for font handling optimization public: CHtmlFile2_Private() @@ -1655,16 +1655,16 @@ public: RELEASEINTERFACE(m_pFonts); } - // Проверяет наличие тэга html + // Checks for html tag presence bool isHtml() { return (m_oLightReader.ReadNextNode() ? m_oLightReader.GetName() == L"html" : false); } - // Создаёт основу docx + // Creates docx base structure void CreateDocxEmpty(CHtmlParams* oParams) { - // Создаем пустые папки + // Create empty folders NSDirectory::CreateDirectory(m_sDst + L"/_rels"); NSDirectory::CreateDirectory(m_sDst + L"/docProps"); NSDirectory::CreateDirectory(m_sDst + L"/word"); @@ -1735,7 +1735,7 @@ public: } // numbering.xml - // Маркированный список + // Bulleted list m_oNumberXml += L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:numbering xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 w15 wp14\"><w:abstractNum w:abstractNumId=\"0\"><w:multiLevelType w:val=\"hybridMultilevel\"/><w:lvl w:ilvl=\"0\"><w:start w:val=\"1\"/><w:numFmt w:val=\"bullet\"/><w:isLgl w:val=\"false\"/><w:suff w:val=\"tab\"/><w:lvlText w:val=\""; m_oNumberXml.AddCharSafe(183); m_oNumberXml += L"\"/><w:lvlJc w:val=\"left\"/><w:pPr><w:ind w:left=\"720\" w:hanging=\"360\"/></w:pPr><w:rPr><w:rFonts w:ascii=\"Symbol\" w:hAnsi=\"Symbol\" w:cs=\"Symbol\" w:eastAsia=\"Symbol\"/></w:rPr></w:lvl><w:lvl w:ilvl=\"1\"><w:start w:val=\"1\"/><w:numFmt w:val=\"bullet\"/><w:isLgl w:val=\"false\"/><w:suff w:val=\"tab\"/><w:lvlText w:val=\"o\"/><w:lvlJc w:val=\"left\"/><w:pPr><w:ind w:left=\"1440\" w:hanging=\"360\"/></w:pPr><w:rPr><w:rFonts w:ascii=\"Courier New\" w:hAnsi=\"Courier New\" w:cs=\"Courier New\" w:eastAsia=\"Courier New\"/></w:rPr></w:lvl><w:lvl w:ilvl=\"2\"><w:start w:val=\"1\"/><w:numFmt w:val=\"bullet\"/><w:isLgl w:val=\"false\"/><w:suff w:val=\"tab\"/><w:lvlText w:val=\""; @@ -1803,7 +1803,7 @@ public: oCoreWriter.CloseFile(); } - // Начала файлов + // File beginnings m_oDocXmlRels += L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">"; m_oDocXmlRels += L"<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles\" Target=\"styles.xml\"/>"; m_oDocXmlRels += L"<Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings\" Target=\"settings.xml\"/>"; @@ -1821,7 +1821,7 @@ public: m_nId += 7; - // docDefaults по умолчанию + // docDefaults by default if(oParams && !oParams->m_sdocDefaults.empty()) m_oStylesXml += oParams->m_sdocDefaults; else @@ -1835,7 +1835,7 @@ public: // m_oStylesXml += L"<w:pPrDefault><w:pPr><w:spacing w:after=\"200\" w:line=\"276\" w:lineRule=\"auto\"/></w:pPr></w:pPrDefault>"; } - // normal по умолчанию + // normal by default if(oParams && !oParams->m_sNormal.empty()) m_oStylesXml += oParams->m_sNormal; else @@ -1845,22 +1845,22 @@ public: m_oStylesXml += L"</w:rPr></w:style>"; } - // Маркированный список + // Bulleted list m_oStylesXml += L"<w:style w:type=\"paragraph\" w:styleId=\"li\"><w:name w:val=\"List Paragraph\"/><w:basedOn w:val=\"normal\"/><w:qFormat/><w:uiPriority w:val=\"34\"/><w:pPr><w:contextualSpacing w:val=\"true\"/><w:ind w:left=\"720\"/></w:pPr></w:style>"; - // Ссылки + // Links m_oStylesXml += L"<w:style w:type=\"character\" w:styleId=\"a\"><w:name w:val=\"Hyperlink\"/><w:uiPriority w:val=\"99\"/><w:unhideWhenUsed/><w:rPr><w:color w:val=\"0000FF\" w:themeColor=\"hyperlink\"/><w:u w:val=\"single\"/></w:rPr></w:style>"; - // Таблицы + // Tables // m_oStylesXml += L"<w:style w:type=\"table\" w:default=\"1\" w:styleId=\"table-based\"><w:name w:val=\"Normal Table\"/><w:uiPriority w:val=\"99\"/><w:semiHidden/><w:unhideWhenUsed/><w:tblPr><w:tblInd w:w=\"0\" w:type=\"dxa\"/><w:tblCellMar><w:top w:w=\"0\" w:type=\"dxa\"/><w:left w:w=\"108\" w:type=\"dxa\"/><w:bottom w:w=\"0\" w:type=\"dxa\"/><w:right w:w=\"108\" w:type=\"dxa\"/></w:tblCellMar></w:tblPr></w:style><w:style w:type=\"table\" w:styleId=\"table\"><w:name w:val=\"Table Grid\"/><w:basedOn w:val=\"table-based\"/><w:uiPriority w:val=\"59\"/><w:pPr><w:spacing w:lineRule=\"auto\" w:line=\"240\" w:after=\"0\"/></w:pPr><w:tblPr><w:tblBorders><w:top w:val=\"single\" w:sz=\"4\" w:space=\"0\" w:color=\"000000\"/><w:left w:val=\"single\" w:sz=\"4\" w:space=\"0\" w:color=\"000000\"/><w:bottom w:val=\"single\" w:sz=\"4\" w:space=\"0\" w:color=\"000000\"/><w:right w:val=\"single\" w:sz=\"4\" w:space=\"0\" w:color=\"000000\"/><w:insideH w:val=\"single\" w:sz=\"4\" w:space=\"0\" w:color=\"000000\"/><w:insideV w:val=\"single\" w:sz=\"4\" w:space=\"0\" w:color=\"000000\"/></w:tblBorders></w:tblPr></w:style>"; - // Сноски + // Footnotes m_oStylesXml += L"<w:style w:type=\"character\" w:styleId=\"footnote\"><w:name w:val=\"footnote reference\"/><w:uiPriority w:val=\"99\"/><w:unhideWhenUsed/><w:rPr><w:vertAlign w:val=\"superscript\"/></w:rPr></w:style><w:style w:type=\"paragraph\" w:styleId=\"footnote-p\"><w:name w:val=\"footnote text\"/><w:basedOn w:val=\"normal\"/><w:link w:val=\"footnote-c\"/><w:uiPriority w:val=\"99\"/><w:semiHidden/><w:unhideWhenUsed/><w:rPr><w:sz w:val=\"18\"/></w:rPr><w:pPr><w:spacing w:lineRule=\"auto\" w:line=\"240\" w:after=\"40\"/></w:pPr></w:style><w:style w:type=\"character\" w:styleId=\"footnote-c\" w:customStyle=\"1\"><w:name w:val=\"footnote text character\"/><w:link w:val=\"footnote-p\"/><w:uiPriority w:val=\"99\"/><w:rPr><w:sz w:val=\"18\"/></w:rPr></w:style>"; - // Web стиль по-умолчанию + // Default web style m_oStylesXml += L"<w:style w:type=\"paragraph\" w:styleId=\"normal-web\"><w:name w:val=\"Normal (Web)\"/><w:basedOn w:val=\"normal\"/><w:uiPriority w:val=\"99\"/><w:semiHidden/><w:unhideWhenUsed/><w:pPr><w:spacing w:before=\"100\" w:beforeAutospacing=\"1\" w:after=\"100\" w:afterAutospacing=\"1\"/></w:pPr></w:style>"; } - // Читает файл + // Reads file void readSrc() { - // Читаем html + // Read html m_oLightReader.ReadNextNode(); int nDeath = m_oLightReader.GetDepth(); @@ -1874,7 +1874,7 @@ public: } } - // Дописывает концы docx + // Appends docx endings void write() { m_oDocXmlRels.WriteString(L"</Relationships>"); @@ -1940,9 +1940,9 @@ public: } // numbering.xml - // Маркированный список + // Bulleted list m_oNumberXml.WriteString(L"<w:num w:numId=\"1\"><w:abstractNumId w:val=\"0\"/></w:num>"); - // Нумерованный список + // Numbered list for(int i = 1; i < m_nNumberingId; i++) { m_oNumberXml.WriteString(L"<w:num w:numId=\""); @@ -1972,7 +1972,7 @@ public: } } - // Конвертирует html в xhtml + // Converts html to xhtml bool htmlXhtml(const std::wstring& sSrc) { BYTE* pData; @@ -2023,7 +2023,7 @@ public: return m_oLightReader.FromString(sRes); } - // Конвертирует mht в xhtml + // Converts mht to xhtml bool mhtXhtml(const std::wstring& sSrc) { NSFile::CFileBinary file; @@ -2072,7 +2072,7 @@ public: return bRes; } - // Читает стили + // Reads styles void readStyle() { if(m_oLightReader.IsEmptyNode()) @@ -2087,7 +2087,7 @@ public: readStyle2(); else { - // Стиль по ссылке + // Style by link if(sName == L"link") { while(m_oLightReader.MoveToNextAttribute()) @@ -2098,7 +2098,7 @@ public: if(NSFile::GetFileExtention(sRef) != L"css") continue; std::wstring sFName = NSFile::GetFileName(sRef); - // Стиль в сети + // Style from network if(sRef.substr(0, 4) == L"http") { sFName = m_sTmp + L'/' + sFName; @@ -2118,7 +2118,7 @@ public: } m_oLightReader.MoveToElement(); } - // тэг style содержит стили для styles.xml + // style tag contains styles for styles.xml else if(sName == L"style") m_oStylesCalculator.AddStyles(m_oLightReader.GetText2()); else @@ -2130,7 +2130,7 @@ public: void readStyle2() { std::wstring sName = m_oLightReader.GetName(); - // Стиль по ссылке + // Style by link if(sName == L"link") { while(m_oLightReader.MoveToNextAttribute()) @@ -2141,7 +2141,7 @@ public: if(NSFile::GetFileExtention(sRef) != L"css") continue; std::wstring sFName = NSFile::GetFileName(sRef); - // Стиль в сети + // Style from network if(sRef.substr(0, 4) == L"http") { sFName = m_sTmp + L'/' + sFName; @@ -2161,7 +2161,7 @@ public: } m_oLightReader.MoveToElement(); } - // тэг style содержит стили для styles.xml + // style tag contains styles for styles.xml else if(sName == L"style") m_oStylesCalculator.AddStyles(m_oLightReader.GetText2()); @@ -2211,10 +2211,10 @@ private: return wsValue; } - // Так как CSS калькулятор не знает для какой ноды производится расчет стиля - // и не знает, что некоторые стили предназначены только определенной ноде, - // то проще пока обрабатывать это заранее - // ! Используется для стилей, заданных через аргументы ! + // Since CSS calculator doesn't know which node the style is being calculated for + // and doesn't know that some styles are intended only for a specific node, + // it's easier for now to handle this in advance + // ! Used for styles specified through arguments ! bool CheckArgumentMath(const std::wstring& wsNodeName, const std::wstring& wsStyleName) const { if (L"border" == wsStyleName && L"table" != wsNodeName) @@ -2425,7 +2425,7 @@ private: NSCSS::CNode oNode; std::wstring sNote; oNode.m_wsName = m_oLightReader.GetName(); - // Стиль по атрибуту + // Style by attribute while(m_oLightReader.MoveToNextAttribute()) { std::wstring sName = m_oLightReader.GetName(); @@ -2474,7 +2474,7 @@ private: while (m_oLightReader.ReadNextSiblingNode(nDeath)) { const std::wstring wsName = m_oLightReader.GetName(); - // Базовый адрес + // Base address if (L"base" == wsName) m_sBase = GetArgumentValue(L"href"); } @@ -2532,7 +2532,7 @@ private: { NSCSS::CCompiledStyle* pCompiledStyle{arSelectors.back().m_pCompiledStyle}; - // TODO::поведение должно быть немного разное (реализовать) + // TODO:: behavior should be slightly different (implement) switch(pCompiledStyle->m_oDisplay.GetWhiteSpace().ToInt()) { case NSCSS::NSProperties::EWhiteSpace::Pre: @@ -2559,7 +2559,7 @@ private: GetSubClass(pXml, arSelectors); - //TODO:: сделать так, чтобы параграф (со своими стилями) открывался при чтении сооответствующей ноды, а не при чтении текста + //TODO:: make paragraph (with its styles) open when reading corresponding node, not when reading text OpenP(pXml); NSStringUtils::CStringBuilder oPPr; @@ -3079,7 +3079,7 @@ private: std::wstring wsWidth; - // width измеряется в px или % + // width is measured in px or % if (!oWidth.Empty()) wsWidth = std::to_wstring(static_cast<int>((NSCSS::UnitMeasure::Percent != oWidth.GetUnitMeasure()) ? (NSCSS::CUnitMeasureConverter::ConvertPx(oWidth.ToDouble(), NSCSS::Inch, 96) * 914400.) : oWidth.ToDouble(NSCSS::Inch, unPageWidth))); else @@ -3087,7 +3087,7 @@ private: std::wstring wsHeight{L"14288"}; - // size измеряется только в px + // size is measured only in px if (!oSize.Empty()) wsHeight = std::to_wstring(static_cast<int>(NSCSS::CUnitMeasureConverter::ConvertPx(oSize.ToDouble(), NSCSS::Inch, 96) * 914400.)); @@ -3216,7 +3216,7 @@ private: bool readInside (NSStringUtils::CStringBuilder* oXml, std::vector<NSCSS::CNode>& sSelectors, CTextSettings& oTS, const std::wstring& sName) { - //TODO:: обработать все варианты return'а + //TODO:: handle all return variants if(sName == L"#text") return ReadText(oXml, sSelectors, oTS); @@ -3366,7 +3366,7 @@ private: case HTML_TAG(STYLE): case HTML_TAG(SCRIPT): { - //Если встретили не обрабатываемые теги, то просто пропускаем + //If we encounter unhandled tags, just skip them sSelectors.pop_back(); return false; } @@ -3730,7 +3730,7 @@ private: m_oLightReader.MoveToElement(); m_oState.m_bWasPStyle = false; - // Читаем th. Ячейка заголовка таблицы. Выравнивание посередине. Выделяется полужирным + // Read th. Table header cell. Center aligned. Bold text if(m_oLightReader.GetName() == L"th") { CTextSettings oTSR(oTS); @@ -3742,7 +3742,7 @@ private: readStream(pCell->GetData(), sSelectors, oTSR, true); } - // Читаем td. Ячейка таблицы + // Read td. Table cell else if(m_oLightReader.GetName() == L"td") readStream(pCell->GetData(), sSelectors, oTS, true); @@ -4175,7 +4175,7 @@ private: sSelectors.pop_back(); } - // Нумерованный список + // Numbered list if(!bType) { const std::wstring wsStart(std::to_wstring(nStart)); @@ -4243,7 +4243,7 @@ private: else wrP(oXml, sSelectors, oTS); - // Перекрестная ссылка внутри файла + // Cross-reference within file if(bCross) { m_oState.m_bInHyperlink = true; @@ -4270,10 +4270,10 @@ private: oXml->WriteEncodeXmlString(wsAnchorId); } } - // Внешняя ссылка + // External link else { - // Пишем рельсы + // Write relationships NSStringUtils::CStringBuilder* oRelationshipXml = &m_oDocXmlRels; if (oXml == &m_oNoteXml) oRelationshipXml = &m_oNoteXmlRels; @@ -4284,7 +4284,7 @@ private: oRelationshipXml->WriteString(L"\" TargetMode=\"External\"/>"); m_oState.m_bInHyperlink = true; - // Пишем в document.xml + // Write to document.xml oXml->WriteString(L"<w:hyperlink w:tooltip=\""); oXml->WriteEncodeXmlString(sNote); oXml->WriteString(L"\" r:id=\"rHyp"); @@ -4319,7 +4319,7 @@ private: bFootnote = oNode.m_wsName == L"p" && oNode.m_wsClass == L"MsoFootnoteText"; } - // Сноска + // Footnote if (bCross && !sFootnote.empty()) { if (!bFootnote) @@ -4509,7 +4509,7 @@ private: std::wstring sExtention; - // Предполагаем картинку в Base64 + // Assume image in Base64 if (sSrcM.length() > 4 && sSrcM.substr(0, 4) == L"data" && sSrcM.find(L"/", 4) != std::wstring::npos) bRes = readBase64(sSrcM, sExtention); @@ -4526,7 +4526,7 @@ private: } } - // Проверка расширения + // Check extension if (!bRes) { sExtention = NSFile::GetFileExtention(sSrcM); @@ -4538,14 +4538,14 @@ private: sExtention.erase(itFound, sExtention.cend()); } - // Предполагаем картинку в сети + // Assume image from network if (!bRes && ((!m_sBase.empty() && m_sBase.length() > 4 && m_sBase.substr(0, 4) == L"http") || (sSrcM.length() > 4 && sSrcM.substr(0, 4) == L"http"))) { const std::wstring wsDst = m_sDst + L"/word/media/i" + std::to_wstring(m_arrImages.size()) + L'.' + ((!sExtention.empty()) ? sExtention : L"png"); - // Проверка gc_allowNetworkRequest предполагается в kernel_network + // gc_allowNetworkRequest check is assumed in kernel_network NSNetwork::NSFileTransport::CFileDownloader oDownloadImg(m_sBase + sSrcM, false); oDownloadImg.SetFilePath(wsDst); bRes = oDownloadImg.DownloadSync(); @@ -4568,7 +4568,7 @@ private: } else if (sExtention.empty()) { - //TODO:: лучше узнавать формат изображения из содержимого + //TODO:: better to determine image format from content sExtention = L"png"; } } @@ -4583,7 +4583,7 @@ private: return true; } - // Проверка на повтор + // Check for duplicate std::vector<std::wstring>::iterator nFind = std::find(m_arrImages.begin(), m_arrImages.end(), sSrcM); if (nFind != m_arrImages.end()) { @@ -4592,7 +4592,7 @@ private: } } - // Предполагаем картинку по локальному пути + // Assume image by local path if (!bRes) { const std::wstring wsDst = m_sDst + L"/word/media/i" + std::to_wstring(m_arrImages.size()) + L'.' + sExtention; @@ -4737,7 +4737,7 @@ private: OpenR(pXml); - // Пишем в document.xml + // Write to document.xml if (oImageData.ZeroSpaces()) { pXml->WriteString(L"<w:drawing><wp:inline distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\""); @@ -4829,7 +4829,7 @@ private: NSFile::CFileBinary::Remove(m_sDst + L"/word/media/i" + sImageName); return; } - // Прописать рельсы + // Write relationships if (bNew) { m_arrImages.push_back(sImageSrc); @@ -4970,7 +4970,7 @@ private: return false; unsigned int alfa = 0xffffff; - //дефолтный тон должен быть прозрачным, а не белым + //default tone should be transparent, not white //memset(pBgraData, 0xff, nWidth * nHeight * 4); for (int i = 0; i < nWidth * nHeight; i++) { @@ -5029,19 +5029,19 @@ CHtmlFile2::~CHtmlFile2() #ifdef USE_OLD_HTML_CONVERTER bool CHtmlFile2::IsHtmlFile(const std::wstring& sFile) { - // Конвертируем в xhtml + // Convert to xhtml if(!m_internal->htmlXhtml(sFile)) return false; - // Читаем html + // Read html return m_internal->isHtml(); } bool CHtmlFile2::IsMhtFile(const std::wstring& sFile) { - // Конвертируем в xhtml + // Convert to xhtml if(!m_internal->mhtXhtml(sFile)) return false; - // Читаем html + // Read html return m_internal->isHtml(); } #endif @@ -5081,7 +5081,7 @@ HRESULT CHtmlFile2::ConvertHTML2OOXML(const std::wstring& wsPath, const std::wst m_internal->CreateDocxEmpty(pParametrs); m_internal->readStyle(); - // Переходим в начало + // Go to the beginning if(!m_internal->m_oLightReader.MoveToStart()) return S_FALSE; @@ -5118,7 +5118,7 @@ HRESULT CHtmlFile2::ConvertMHT2OOXML(const std::wstring& wsPath, const std::wstr m_internal->CreateDocxEmpty(oParams); m_internal->readStyle(); - // Переходим в начало + // Go to the beginning if(!m_internal->m_oLightReader.MoveToStart()) return S_FALSE; @@ -5165,7 +5165,7 @@ HRESULT CHtmlFile2::ConvertHTML2OOXML(const std::vector<std::wstring>& arPaths, continue; m_internal->readStyle(); - // Переходим в начало + // Go to the beginning if(m_internal->m_oLightReader.MoveToStart()) { if(oParams && oParams->m_bNeedPageBreakBefore && !bFirst) @@ -5176,10 +5176,10 @@ HRESULT CHtmlFile2::ConvertHTML2OOXML(const std::vector<std::wstring>& arPaths, m_internal->m_sBase.clear(); } - // Очищаем разрешенные файлы стилей - // Это необходимо, чтобы мы не могли взять стили из не подключенного файла, но при этом, чтобы данные оставались, - // т.к. ко многим файлам может быть подключен один и тот же файл (проблема возникает когда он большой) - // и подключать (в нашем случае заново парсить) его будет долго + // Clear allowed style files + // This is necessary so we can't take styles from an unconnected file, but the data remains, + // since many files can have the same file connected (problem occurs when it's large) + // and connecting (in our case reparsing) it will take a long time m_internal->m_oStylesCalculator.ClearAllowedStyleFiles(); m_internal->m_oStylesCalculator.ClearEmbeddedStyles(); } diff --git a/HtmlFile2/src/Languages.h b/HtmlFile2/src/Languages.h index a0449f94ef..b89416b819 100644 --- a/HtmlFile2/src/Languages.h +++ b/HtmlFile2/src/Languages.h @@ -7,66 +7,66 @@ const static std::map<std::wstring, std::wstring> m_Languages_HTML { - //Язык, Регион - {L"en", L"US"}, // Английский - США - {L"ru", L"RU"}, // Русский - Россия - {L"es", L"ES"}, // Испанский - Испания - {L"de", L"DE"}, // Немецкий - Германия - {L"fr", L"FR"}, // Французский - Франция - {L"it", L"IT"}, // Итальянский - Италия - {L"pt", L"PT"}, // Португальский - Португалия - {L"pl", L"PL"}, // Польский - Польша - {L"nl", L"NL"}, // Нидерландский - Нидерланды - {L"sv", L"SE"}, // Шведский - Швеция - {L"nb", L"NO"}, // Норвежский - Новегия - {L"da", L"DK"}, // Датский - Дания - {L"fi", L"FI"}, // Финский - Финляндия - {L"el", L"GR"}, // Греческий - Греция - {L"tr", L"TR"}, // Турецкий - Турция - {L"ar", L"SA"}, // Арабский - Саудовская Аравия - {L"he", L"IL"}, // Иврит - Израиль - {L"ja", L"JP"}, // Японский - Япония - {L"zh", L"CN"}, // Китайский (упрощенный) - Китай - {L"hu", L"HU"}, // Венгерский - Венгрия - {L"cs", L"CZ"}, // Чешский - Чехия - {L"ro", L"RO"}, // Румынский - Румыния - {L"bg", L"BG"}, // Болгарский - Болгария - {L"hr", L"HR"}, // Хорватский - Хорватия - {L"sr", L"Latn-RS"}, //Сербский - Сербия - {L"sl", L"SI"}, // Словенский - Словения - {L"lt", L"LT"}, // Литовский - Литва - {L"lv", L"LV"}, // Латышский - Латвия - {L"et", L"EE"}, // Эстонский - Эстония - {L"uk", L"UA"}, // Украинский - Украина - {L"be", L"BY"}, // Белорусский - Беларусь - {L"kk", L"KZ"}, // Казахский - Казахстан - {L"hi", L"IN"}, // Хинди - Индия - {L"th", L"TH"}, // Тайский - Таиланд - {L"vi", L"VN"}, // Вьетнамский - Вьетнам - {L"id", L"ID"}, // Индонезийский - Индонезия - {L"ms", L"MY"}, // Малайский - Малайзия - {L"fil", L"PH"}, // Филиппинский - Филиппины - {L"ko", L"KR"}, // Корейский - Южная Корея - {L"is", L"IS"}, // Исландский - Исландия - {L"ga", L"IE"}, // Ирландский - Ирландия - {L"cy", L"GB"}, // Валлийский - Великобритания - {L"ca", L"ES"}, // Каталанский - Испания - {L"eu", L"ES"}, // Баскский - Испания - {L"gl", L"ES"}, // Галисийский - Испания - {L"af", L"ZA"}, // Африкаанс - Южная Африка - {L"zu", L"ZA"}, // Зулу - Южная Африка - {L"ha", L"Latn-NG"}, // Хауса - Нигерия - {L"yo", L"NG"}, // Йоруба - Нигерия - {L"sw", L"KE"}, // Суахили - Кения - {L"am", L"ET"}, // Амхарский - Эфиопия - {L"ti", L"ET"}, // Тигринья - Эфиопия - {L"ur", L"PK"}, // Урду - Пакистан - {L"pa", L"IN"}, // Панджаби - Индия - {L"gu", L"IN"}, // Гуджарати - Индия - {L"ta", L"IN"}, // Тамильский - Индия - {L"te", L"IN"}, // Телугу - Индия - {L"ml", L"IN"}, // Малаялам - Индия - {L"kn", L"IN"} // Каннада - Индия + //Language, Region + {L"en", L"US"}, // English - USA + {L"ru", L"RU"}, // Russian - Russia + {L"es", L"ES"}, // Spanish - Spain + {L"de", L"DE"}, // German - Germany + {L"fr", L"FR"}, // French - France + {L"it", L"IT"}, // Italian - Italy + {L"pt", L"PT"}, // Portuguese - Portugal + {L"pl", L"PL"}, // Polish - Poland + {L"nl", L"NL"}, // Dutch - Netherlands + {L"sv", L"SE"}, // Swedish - Sweden + {L"nb", L"NO"}, // Norwegian - Norway + {L"da", L"DK"}, // Danish - Denmark + {L"fi", L"FI"}, // Finnish - Finland + {L"el", L"GR"}, // Greek - Greece + {L"tr", L"TR"}, // Turkish - Turkey + {L"ar", L"SA"}, // Arabic - Saudi Arabia + {L"he", L"IL"}, // Hebrew - Israel + {L"ja", L"JP"}, // Japanese - Japan + {L"zh", L"CN"}, // Chinese (Simplified) - China + {L"hu", L"HU"}, // Hungarian - Hungary + {L"cs", L"CZ"}, // Czech - Czech Republic + {L"ro", L"RO"}, // Romanian - Romania + {L"bg", L"BG"}, // Bulgarian - Bulgaria + {L"hr", L"HR"}, // Croatian - Croatia + {L"sr", L"Latn-RS"}, // Serbian - Serbia + {L"sl", L"SI"}, // Slovenian - Slovenia + {L"lt", L"LT"}, // Lithuanian - Lithuania + {L"lv", L"LV"}, // Latvian - Latvia + {L"et", L"EE"}, // Estonian - Estonia + {L"uk", L"UA"}, // Ukrainian - Ukraine + {L"be", L"BY"}, // Belarusian - Belarus + {L"kk", L"KZ"}, // Kazakh - Kazakhstan + {L"hi", L"IN"}, // Hindi - India + {L"th", L"TH"}, // Thai - Thailand + {L"vi", L"VN"}, // Vietnamese - Vietnam + {L"id", L"ID"}, // Indonesian - Indonesia + {L"ms", L"MY"}, // Malay - Malaysia + {L"fil", L"PH"}, // Filipino - Philippines + {L"ko", L"KR"}, // Korean - South Korea + {L"is", L"IS"}, // Icelandic - Iceland + {L"ga", L"IE"}, // Irish - Ireland + {L"cy", L"GB"}, // Welsh - Great Britain + {L"ca", L"ES"}, // Catalan - Spain + {L"eu", L"ES"}, // Basque - Spain + {L"gl", L"ES"}, // Galician - Spain + {L"af", L"ZA"}, // Afrikaans - South Africa + {L"zu", L"ZA"}, // Zulu - South Africa + {L"ha", L"Latn-NG"}, // Hausa - Nigeria + {L"yo", L"NG"}, // Yoruba - Nigeria + {L"sw", L"KE"}, // Swahili - Kenya + {L"am", L"ET"}, // Amharic - Ethiopia + {L"ti", L"ET"}, // Tigrinya - Ethiopia + {L"ur", L"PK"}, // Urdu - Pakistan + {L"pa", L"IN"}, // Punjabi - India + {L"gu", L"IN"}, // Gujarati - India + {L"ta", L"IN"}, // Tamil - India + {L"te", L"IN"}, // Telugu - India + {L"ml", L"IN"}, // Malayalam - India + {L"kn", L"IN"} // Kannada - India }; static std::wstring IndentifyLanguage(std::wstring wsLanguage) diff --git a/HtmlFile2/test/main.cpp b/HtmlFile2/test/main.cpp index ea6d1abe70..aaeda94db5 100644 --- a/HtmlFile2/test/main.cpp +++ b/HtmlFile2/test/main.cpp @@ -35,13 +35,13 @@ int main() bool bMhtMode = false; if(bBatchMode) { - // Директория файлов + // Files directory std::wstring sDirectory = NSFile::GetProcessDirectory() + L"/../../../examples/html"; - // Вложенные директории + // Nested directories std::vector<std::wstring> arrDirectory; getDirectories(sDirectory, arrDirectory); COfficeUtils oZip; - // Выставляем временную директорию + // Set temporary directory std::wstring sTmp = NSFile::GetProcessDirectory() + L"/tmp"; NSDirectory::DeleteDirectory(sTmp); NSDirectory::CreateDirectory(sTmp); @@ -49,7 +49,7 @@ int main() for(std::wstring sD : arrDirectory) { std::vector<std::wstring> arrFiles = NSDirectory::GetFiles(sD); - // Директория, где будем создавать docx + // Directory where we will create docx size_t nPos = sD.find(L"/html"); std::wstring sOutputDirectory = sD.insert(nPos + 5, L"-res"); NSDirectory::CreateDirectory(sOutputDirectory); @@ -100,7 +100,7 @@ int main() else { HRESULT nResConvert = S_FALSE; - // Директория, где будем создавать docx + // Directory where we will create docx std::wstring sOutputDirectory = NSFile::GetProcessDirectory() + L"/res"; NSDirectory::DeleteDirectory(sOutputDirectory); NSDirectory::CreateDirectory(sOutputDirectory); @@ -112,7 +112,7 @@ int main() oParams.SetDate(L"2010-06-03T04:00:00+00:00"); oParams.SetDescription(L"Description"); - // Файл, который открываем + // File to open std::wstring sFile = L"C:\\ONLYOFFICE\\Files\\html\\test_tag_a_1.html"; CHtmlFile2 oFile; oFile.SetTmpDirectory(sOutputDirectory); diff --git a/HwpFile/HwpDoc/Common/NodeNames.h b/HwpFile/HwpDoc/Common/NodeNames.h index 836cba81fe..0ac24397ab 100644 --- a/HwpFile/HwpDoc/Common/NodeNames.h +++ b/HwpFile/HwpDoc/Common/NodeNames.h @@ -645,7 +645,7 @@ enum class EAttribute #define MAX_ATTRIBUTES 202 -//TODO:: добавить все аргументы +//TODO:: Add all arguments static constexpr const char* ATTRUBUTE_NAMES[MAX_TYPES][MAX_ATTRIBUTES] = { // HWPX @@ -1082,7 +1082,7 @@ inline bool Equals(EAttribute eAttribute, EHanType eType, const std::string& sAt } } -// TODO:: пока всё в одном месте. Возможно стоит лучше разделить по соответствующим классам +// TODO:: Currently everything is in one place. Consider splitting into corresponding classes enum class EValue { None, diff --git a/HwpFile/HwpDoc/Common/WriterContext.cpp b/HwpFile/HwpDoc/Common/WriterContext.cpp index 2524c3895c..3b8511c44f 100644 --- a/HwpFile/HwpDoc/Common/WriterContext.cpp +++ b/HwpFile/HwpDoc/Common/WriterContext.cpp @@ -371,7 +371,7 @@ bool CWriterContext::GetBinBytes(const HWP_STRING& sId, CHWPStream& oBuffer, HWP HWP_STRING CWriterContext::GetBinFormat(const HWP_STRING& sId) { - //TODO::реализовать + //TODO:: Implement return HWP_STRING(); } } diff --git a/HwpFile/HwpDoc/Conversion/ConversionState.h b/HwpFile/HwpDoc/Conversion/ConversionState.h index ae2f1e9389..642003fe19 100644 --- a/HwpFile/HwpDoc/Conversion/ConversionState.h +++ b/HwpFile/HwpDoc/Conversion/ConversionState.h @@ -40,7 +40,7 @@ struct TConversionState } } m_oLastNode; - bool m_bInTextBox; // TODO:: используется, чтобы в wps:txbx не появилась новая фигура (посмотреть этот момент нужно подробнее) + bool m_bInTextBox; // TODO:: Used to prevent new shape appearing in wps:txbx (needs further investigation) unsigned short m_ushLastCharShapeId; unsigned short m_ushSecdIndex; diff --git a/HwpFile/HwpDoc/Conversion/Converter2OOXML.cpp b/HwpFile/HwpDoc/Conversion/Converter2OOXML.cpp index f03bd5e554..948fb07224 100644 --- a/HwpFile/HwpDoc/Conversion/Converter2OOXML.cpp +++ b/HwpFile/HwpDoc/Conversion/Converter2OOXML.cpp @@ -160,7 +160,7 @@ void CConverter2OOXML::CreateEmptyFiles() void CConverter2OOXML::FillDefaultData() { - // Заполняем начало файлов + // Fill in file headers AddRelationship(L"styles", L"styles.xml"); AddRelationship(L"settings", L"settings.xml"); AddRelationship(L"webSettings", L"webSettings.xml"); @@ -181,7 +181,7 @@ void CConverter2OOXML::FillDefaultData() void CConverter2OOXML::Close() { - // Дописываем концы файлов + // Write file endings m_oDocXml.WriteString(L"</w:body></w:document>"); NSFile::CFileBinary oDocumentWriter; @@ -305,7 +305,7 @@ void CConverter2OOXML::WriteCharacter(const CCtrlCharacter* pCharacter, short sh { case ECtrlCharType::PARAGRAPH_BREAK: { - // Таблицы пишутся без тега <w:p>, поэтому для них не открывается параграф + // Tables are written without <w:p> tag, so paragraph is not opened for them if (TConversionState::TLastNode::ELastNodeType::Table == oState.m_oLastNode.m_eType && oState.m_unParaIndex == oState.m_oLastNode.m_unParaIndex && !oState.m_bInTable) { @@ -471,7 +471,7 @@ void CConverter2OOXML::WriteField(const CCtrlField* pShape, short shParaShapeID, oState.m_arOpenedBookmarks.pop(); break; } - //TODO:: как-будто хочется определить тип закрывающей field на этапе парса hwpx + //TODO:: Would be better to determine closing field type at hwpx parsing stage case EFieldType::Unknown: { std::map<unsigned int, const CCtrlField*>::const_iterator itFound = oState.m_mOpenField.find(pShape->GetInstanceID()); @@ -800,8 +800,8 @@ void CConverter2OOXML::WriteTable(const CCtrlTable* pTable, short shParaShapeID, } } - //TODO:: в случаях, когда есть пустые столбцы необходимо добавить возможность удаления данных столбцов - // Например для матрицы 3x2, у которой значения есть только в 2x2, необходимо удалить последний столбец + //TODO:: When there are empty columns, add ability to remove those columns + // For example, for a 3x2 matrix with values only in 2x2, the last column should be removed for (unsigned int unRowIndex = 0; unRowIndex < pTable->GetRows(); ++unRowIndex) { @@ -851,7 +851,7 @@ void CConverter2OOXML::WriteTableProperties(const CCtrlTable* pTable, short shPa oBuilder.WriteString(L"<w:tblPr>"); - // TODO:: сделать вычисление + // TODO:: Implement calculation oBuilder.WriteString(L"<w:tblW w:w=\"0\" w:type=\"auto\"/>"); if (0 != pTable->GetInLSpace() || 0 != pTable->GetInTSpace() || @@ -976,7 +976,7 @@ void CConverter2OOXML::WriteBorder(const TBorder& oBorder, const HWP_STRING& sBo HWP_STRING sType; - //TODO:: проверить стиль линий + //TODO:: Verify line styles switch(oBorder.m_eStyle) { case ELineStyle2::NONE: oBuilder.WriteString(L"<w:" + sBorderName + L" w:val=\"none\"/>"); return; @@ -1001,7 +1001,7 @@ VECTOR<TPoint> ArcToBezier(const TPoint& oStart, const TPoint& oEnd, const TPoin const double dRadiusX = std::abs(oStart.m_nX - oCenter.m_nX); const double dRadiusY = std::abs(oStart.m_nY - oCenter.m_nY); - // Вычисление углов + // Calculate angles double dStartAngle = std::atan2(oStart.m_nY - oCenter.m_nY, oStart.m_nX - oCenter.m_nX); double dEndAngle = std::atan2(oEnd.m_nY - oCenter.m_nY, oEnd.m_nX - oCenter.m_nX); @@ -1269,10 +1269,10 @@ void CConverter2OOXML::WriteEqEditShape(const CCtrlEqEdit* pEqEditShape, short s void CConverter2OOXML::WriteOleShape(const CCtrlShapeOle* pOleShape, short shParaShapeID, short shParaStyleID, NSStringUtils::CStringBuilder& oBuilder, TConversionState& oState) { - //TODO:: добавить конвертацию hwp ole -> ooxml chart - //TODO:: необходимо добавить поддержку формата "Hwp Document File Formats - Charts" (для случаев, когда нет ooxml представления) - // Пока можем вытащить лишь ooxml представление данных - // Реализовать с использованием pole.h? + //TODO:: Add hwp ole -> ooxml chart conversion + //TODO:: Need to add support for "Hwp Document File Formats - Charts" format (for cases without ooxml representation) + // For now we can only extract ooxml data representation + // Implement using pole.h? if (nullptr == m_pContext) return; @@ -1395,7 +1395,7 @@ void CConverter2OOXML::WriteSectionSettings(TConversionState& oState) if (nullptr != oState.m_pColumnDef && 1 < oState.m_pColumnDef->GetColCount()) { - //TODO:: Добавить поддержку остальный свойств + //TODO:: Add support for remaining properties m_oDocXml.WriteString(L"<w:cols w:num=\"" + std::to_wstring(oState.m_pColumnDef->GetColCount()) + L"\" w:space=\"454\""); if (ELineStyle2::NONE != oState.m_pColumnDef->GetColLineStyle()) @@ -1538,7 +1538,7 @@ HWP_STRING CConverter2OOXML::SavePicture(const HWP_STRING& sBinItemId, TConversi if (nullptr == m_pContext || sBinItemId.empty()) return HWP_STRING(); - //TODO:: добавить поддержку устновки размеров изображения из свойств шейпа + //TODO:: Add support for setting image dimensions from shape properties CHWPStream oBuffer; HWP_STRING sFileName; @@ -2138,7 +2138,7 @@ void CConverter2OOXML::WriteAutoNumber(const CCtrlAutoNumber* pAutoNumber, short unsigned short ushValue = 0; HWP_STRING wsType; - //TODO:: лучше перейти не на ручной подсчет, а на автоматический в word (но там есть свои проблемы) + //TODO:: Better to switch from manual counting to automatic in word (but that has its own issues) switch (pAutoNumber->GetNumType()) { case ENumType::PAGE: diff --git a/HwpFile/HwpDoc/Conversion/FootnoteConverter.cpp b/HwpFile/HwpDoc/Conversion/FootnoteConverter.cpp index 4d97ab2d90..e7672003b8 100644 --- a/HwpFile/HwpDoc/Conversion/FootnoteConverter.cpp +++ b/HwpFile/HwpDoc/Conversion/FootnoteConverter.cpp @@ -112,7 +112,7 @@ std::wstring CFootnoteConverter::CreateHeadOrFoot(const CCtrlHeadFoot* pCtrlHead if (arRelationships.empty()) return wsFileName; - // TODO:: пока это копия из Converter2OOXML + // TODO:: For now this is a copy from Converter2OOXML NSFile::CFileBinary oRelsWriter; if (oRelsWriter.CreateFileW(oConverter.GetTempDirectory() + L"/word/_rels/" + wsFileName + L".rels")) { diff --git a/HwpFile/HwpDoc/Conversion/StyleConverter.cpp b/HwpFile/HwpDoc/Conversion/StyleConverter.cpp index 320816826c..916fe1a1ae 100644 --- a/HwpFile/HwpDoc/Conversion/StyleConverter.cpp +++ b/HwpFile/HwpDoc/Conversion/StyleConverter.cpp @@ -205,14 +205,14 @@ CParagraphsStyle CStyleConverter::GenerateParagraphStyle(const CHWPRecordParaSha case 0x01: { oParagraphsStyle.SetSpacingLineRule(ELineRule::Exact); - oParagraphsStyle.SetSpacing(static_cast<int>((double)oParaShape.GetLineSpacing() / 10.)); /*0.352778*/; //(1pt=0.352778mm) //TODO:: проверить, как найдется пример + oParagraphsStyle.SetSpacing(static_cast<int>((double)oParaShape.GetLineSpacing() / 10.)); /*0.352778*/; //(1pt=0.352778mm) //TODO:: verify when an example is found break; } case 0x02: case 0x03: { oParagraphsStyle.SetSpacingLineRule(ELineRule::AtLeast); - oParagraphsStyle.SetSpacing(static_cast<int>((double)oParaShape.GetLineSpacing() / 10.)); //TODO:: проверить, как найдется пример + oParagraphsStyle.SetSpacing(static_cast<int>((double)oParaShape.GetLineSpacing() / 10.)); //TODO:: verify when an example is found break; } default: diff --git a/HwpFile/HwpDoc/Conversion/Transform.h b/HwpFile/HwpDoc/Conversion/Transform.h index 4bc8e20064..b39e3ef721 100644 --- a/HwpFile/HwpDoc/Conversion/Transform.h +++ b/HwpFile/HwpDoc/Conversion/Transform.h @@ -31,7 +31,7 @@ namespace Transform inline short LineWidth2Pt(short shHWPThick) { - //TODO:: проверить + //TODO:: Verify // return (short)std::ceil((double)shHWPThick * 4 * 25.4 / 72.); switch(shHWPThick) diff --git a/HwpFile/HwpDoc/HWPElements/HWPRecordBorderFill.cpp b/HwpFile/HwpDoc/HWPElements/HWPRecordBorderFill.cpp index 8ca3993b70..9f2f19c91a 100644 --- a/HwpFile/HwpDoc/HWPElements/HWPRecordBorderFill.cpp +++ b/HwpFile/HwpDoc/HWPElements/HWPRecordBorderFill.cpp @@ -374,7 +374,7 @@ CHWPRecordBorderFill::CHWPRecordBorderFill(CHWPDocInfo& oDocInfo, int nTagNum, i READ_SIDE(m_oBottom); READ_SIDE(m_oDiagonal); - m_pFill = new CFill(oBuffer, 0, 0); // TODO:: перейти от использования off и size + m_pFill = new CFill(oBuffer, 0, 0); // TODO:: Move away from using off and size } CHWPRecordBorderFill::CHWPRecordBorderFill(CHWPDocInfo& oDocInfo, CXMLReader& oReader, EHanType eType) diff --git a/HwpFile/HwpDoc/HWPElements/HWPRecordBullet.cpp b/HwpFile/HwpDoc/HWPElements/HWPRecordBullet.cpp index eecb4feab7..4cc22ca7cf 100644 --- a/HwpFile/HwpDoc/HWPElements/HWPRecordBullet.cpp +++ b/HwpFile/HwpDoc/HWPElements/HWPRecordBullet.cpp @@ -49,7 +49,7 @@ CHWPRecordBullet::CHWPRecordBullet(CHWPDocInfo& oDocInfo, CXMLReader& oReader, E : CHWPRecord(EHWPTag::HWPTAG_BULLET, 0, 0), m_pParent(&oDocInfo) { if (EHanType::HWPML == eType) - return; // TODO:: реализовать как встретится пример + return; // TODO:: Implement when example is encountered START_READ_ATTRIBUTES(oReader) { diff --git a/HwpFile/HwpDoc/HWPElements/HWPRecordCharShape.cpp b/HwpFile/HwpDoc/HWPElements/HWPRecordCharShape.cpp index 2322c2d21a..2ab369c30b 100644 --- a/HwpFile/HwpDoc/HWPElements/HWPRecordCharShape.cpp +++ b/HwpFile/HwpDoc/HWPElements/HWPRecordCharShape.cpp @@ -19,7 +19,7 @@ EAccent GetAccent(int nValue) } } -//Всречается только в hwpx +//Only found in hwpx EAccent GetAccent(const std::string& sValue) { if (sValue.empty() || "NONE" == sValue) diff --git a/HwpFile/HwpDoc/HWPElements/HWPRecordCtrlData.cpp b/HwpFile/HwpDoc/HWPElements/HWPRecordCtrlData.cpp index 4ede34fb40..9945adfc47 100644 --- a/HwpFile/HwpDoc/HWPElements/HWPRecordCtrlData.cpp +++ b/HwpFile/HwpDoc/HWPElements/HWPRecordCtrlData.cpp @@ -33,8 +33,8 @@ CHWPRecordCtrlData::CHWPRecordCtrlData(int nTagNum, int nLevel, int nSize) int CHWPRecordCtrlData::ParseCtrl(CCtrl& oCtrl, int nSize, CHWPStream& oBuffer, int nOff, int nVersion) { - // TODO:: Вернуться к этому моменту - // Само по себе содержание документа Hankom не позволяет понять, как его интерпретировать. + // TODO:: Return to this later + // The Hancom document content alone does not provide enough information for interpretation. oBuffer.SavePosition(); diff --git a/HwpFile/HwpDoc/HWPElements/HWPRecordCtrlHeader.cpp b/HwpFile/HwpDoc/HWPElements/HWPRecordCtrlHeader.cpp index 7aeca8fc17..a9f79f6d22 100644 --- a/HwpFile/HwpDoc/HWPElements/HWPRecordCtrlHeader.cpp +++ b/HwpFile/HwpDoc/HWPElements/HWPRecordCtrlHeader.cpp @@ -57,7 +57,7 @@ CCtrl* CHWPRecordCtrlHeader::Parse(int nTagNum, int nLevel, int nSize, CHWPStrea } else if (L"cot%" == sCtrlID) { - // Когда содержимое считывается как UTF_16LE, следующее содержимое остается тем же самым + // When content is read as UTF_16LE, the following content remains the same // ¥TableOfContents:set:140:ContentsMake:uint:17 ContentsStyles:wstring:0: ContentsLevel:int:5 ContentsAutoTabRight:int:0 ContentsLeader:int:3 ContentsHyperlink:bool:1 int nTempSize = nSize - oBuffer.GetDistanceToLastPos(); diff --git a/HwpFile/HwpDoc/HWPElements/HWPRecordFormObject.cpp b/HwpFile/HwpDoc/HWPElements/HWPRecordFormObject.cpp index 59e3900b16..2db5f40717 100644 --- a/HwpFile/HwpDoc/HWPElements/HWPRecordFormObject.cpp +++ b/HwpFile/HwpDoc/HWPElements/HWPRecordFormObject.cpp @@ -12,7 +12,7 @@ int CHWPRecordFormObject::ParseCtrl(CCtrlForm& oForm, int nSize, CHWPStream& oBu oBuffer.Skip(4); // tbp+ oBuffer.Skip(4); // tbp+ - oBuffer.Skip(4); // Длина строки? + oBuffer.Skip(4); // String length? short shLen = oBuffer.ReadShort() * 2; oBuffer.Skip(shLen); diff --git a/HwpFile/HwpDoc/HWPElements/HWPRecordNumbering.cpp b/HwpFile/HwpDoc/HWPElements/HWPRecordNumbering.cpp index 85fc244ac1..7814fa4ea5 100644 --- a/HwpFile/HwpDoc/HWPElements/HWPRecordNumbering.cpp +++ b/HwpFile/HwpDoc/HWPElements/HWPRecordNumbering.cpp @@ -27,20 +27,20 @@ CHWPRecordNumbering::CHWPRecordNumbering(CHWPDocInfo& oDocInfo, int nTagNum, int oBuffer.ReadShort(m_shStart); - if (nVersion > 5025 && (nSize > oBuffer.GetDistanceToLastPos())) //TODO:: добавить проверку offset-off < size + if (nVersion > 5025 && (nSize > oBuffer.GetDistanceToLastPos())) //TODO:: Add check offset-off < size { for (int nIndex = 0; nIndex < 7; ++nIndex) oBuffer.ReadInt(m_arNumbering[nIndex].m_nStartNumber); } - if (nVersion > 5100 && (nSize > oBuffer.GetDistanceToLastPos())) //TODO:: добавить проверку offset-off < size + if (nVersion > 5100 && (nSize > oBuffer.GetDistanceToLastPos())) //TODO:: Add check offset-off < size { for (int nIndex = 0; nIndex < 3; ++nIndex) { - //Содержимое неизвестно, но оно содержит 8 байт. + //Content unknown, but it contains 8 bytes. oBuffer.Skip(8); - //Содержимое неизвестно, но оно содержит 4 байт. + //Content unknown, but it contains 4 bytes. oBuffer.Skip(4); short shLen; diff --git a/HwpFile/HwpDoc/HWPElements/HWPRecordParaShape.cpp b/HwpFile/HwpDoc/HWPElements/HWPRecordParaShape.cpp index c3d2fabace..abfe57564c 100644 --- a/HwpFile/HwpDoc/HWPElements/HWPRecordParaShape.cpp +++ b/HwpFile/HwpDoc/HWPElements/HWPRecordParaShape.cpp @@ -160,8 +160,8 @@ CHWPRecordParaShape::CHWPRecordParaShape(CHWPDocInfo& oDocInfo, CXMLReader& oRea m_bConnect(false), m_bIgnoreMargin(false), m_bParaTailShape(false), m_nIndent(0), m_nMarginLeft(0), m_nMarginRight(0), m_nMarginPrev(0), m_nMarginNext(0) { - //В HWPX в данной ноде данный пишутся по типу данный в нодах - //В HWPML в данной ноде данные пишутся по типу данные в аргументах + //In HWPX data in this node is written as node-type data + //In HWPML data in this node is written as argument-type data if (EHanType::HWPX == eType) { @@ -211,7 +211,7 @@ CHWPRecordParaShape::CHWPRecordParaShape(CHWPDocInfo& oDocInfo, CXMLReader& oRea } else if ("BreakNonLatinWord" == sAttributeName) { - //TODO:: проверить соответсвие hwpx и hwpml + //TODO:: Verify hwpx and hwpml correspondence } else if ("Condense" == sAttributeName) m_chCondense = (HWP_BYTE)oReader.GetInt(); @@ -220,7 +220,7 @@ CHWPRecordParaShape::CHWPRecordParaShape(CHWPDocInfo& oDocInfo, CXMLReader& oRea else if ("KeepWithNext" == sAttributeName) m_bKeepWithNext = oReader.GetBool(); else if ("KeepLines" == sAttributeName) - { /*TODO:: проверить соответсвие hwpx и hwpml*/ } + { /*TODO:: verify correspondence between hwpx and hwpml*/ } else if ("PageBreakBefore" == sAttributeName) m_bPageBreakBefore = oReader.GetBool(); else if ("FontLineHeight" == sAttributeName) diff --git a/HwpFile/HwpDoc/HWPElements/HWPRecordParaText.cpp b/HwpFile/HwpDoc/HWPElements/HWPRecordParaText.cpp index 1528a56b4e..5949d7d46d 100644 --- a/HwpFile/HwpDoc/HWPElements/HWPRecordParaText.cpp +++ b/HwpFile/HwpDoc/HWPElements/HWPRecordParaText.cpp @@ -85,7 +85,7 @@ LIST<CCtrl*> CHWPRecordParaText::Parse(int nTagNum, int nLevel, int nSize, CHWPS unInfoLength = 4; else if (sText.length() > unIndex + 7 && sText[unIndex] == sText[unIndex + 7] && sText[unIndex + 1] >= 0x20) unInfoLength = 5; - else if (6 >= unIndex && unIndex > 2) //Случай, когда запись в самом начале + else if (6 >= unIndex && unIndex > 2) //Case when record is at the very beginning { nStartText = -1; sCurrentText.clear(); diff --git a/HwpFile/HwpDoc/HWPElements/HwpRecordTabDef.cpp b/HwpFile/HwpDoc/HWPElements/HwpRecordTabDef.cpp index 73e14a4d7d..420d10b190 100644 --- a/HwpFile/HwpDoc/HWPElements/HwpRecordTabDef.cpp +++ b/HwpFile/HwpDoc/HWPElements/HwpRecordTabDef.cpp @@ -47,7 +47,7 @@ CHwpRecordTabDef::CHwpRecordTabDef(CHWPDocInfo& oDocInfo, int nTagNum, int nLeve oBuffer.ReadInt(nCount); if (nSize - oBuffer.GetDistanceToLastPos() != nCount * 8) - return; // TODO:: ошибка + return; // TODO:: Error TTab *pTab = nullptr; for (unsigned int unIndex = 0; unIndex < nCount; ++unIndex) @@ -93,7 +93,7 @@ CHwpRecordTabDef::CHwpRecordTabDef(CHWPDocInfo& oDocInfo, CXMLReader& oReader, E } END_READ_ATTRIBUTES(oReader) - // Дальнейшая структура встречается лишь в HWPX формате + // The following structure is only found in HWPX format if (EHanType::HWPX != eType) return; diff --git a/HwpFile/HwpDoc/HWPElements/HwpRecordTypes.h b/HwpFile/HwpDoc/HWPElements/HwpRecordTypes.h index 23cf127562..6826a6adcc 100644 --- a/HwpFile/HwpDoc/HWPElements/HwpRecordTypes.h +++ b/HwpFile/HwpDoc/HWPElements/HwpRecordTypes.h @@ -74,7 +74,7 @@ inline ELineStyle1 GetLineStyle1(const std::string& sValue, EHanType eType) if (GetValueName(EValue::SlimThickSlim, eType) == sValue) return ELineStyle1::SLIM_THICK_SLIM; - // Остальные значения встречаются только в hwpx + // Other values are only found in hwpx if (EHanType::HWPX != eType) return ELineStyle1::SOLID; diff --git a/HwpFile/HwpDoc/HWPFile.cpp b/HwpFile/HwpDoc/HWPFile.cpp index 65fd1e7d4f..8eb56dc0d8 100644 --- a/HwpFile/HwpDoc/HWPFile.cpp +++ b/HwpFile/HwpDoc/HWPFile.cpp @@ -60,10 +60,10 @@ bool CHWPFile::Open() if ((m_oFileHeader.SignatureEmpty() || m_oFileHeader.VersionEmpty()) && !Detect()) return false; - //TODO:: добавить отдельный метод StringToInt + //TODO:: Add separate StringToInt method m_nVersion = std::stoi(m_oFileHeader.GetVersion()); - //TODO:: проверить данный момент + //TODO:: Verify this behavior if (m_oFileHeader.PasswordEncrypted()) return false; @@ -141,7 +141,7 @@ CDirectoryEntry* CHWPFile::FindChildEntry(const HWP_STRING& sBasePath, const CDi { if (0x01 == pEntry->GetObjectType()) { - //TODO:: проверить + //TODO:: Verify HWP_STRING sChildPath = sBasePath + FILE_SEPARATOR_STR + pEntry->GetDirectoryEntryName(); return FindChildEntry(sChildPath, *pEntry, sEntryName); } @@ -157,7 +157,7 @@ CDirectoryEntry* CHWPFile::FindChildEntry(const HWP_STRING& sBasePath, const CDi HWP_STRING CHWPFile::SaveChildEntry(const HWP_STRING& sRootPath, const HWP_STRING& sEntryName, ECompressed eCompressed) { - //TODO:: перенести + //TODO:: Move this return HWP_STRING(); } @@ -294,8 +294,8 @@ bool CHWPFile::Unzip(CHWPStream& oInput, CHWPStream& oBuffer) return DEFLATE_OK == nRes || DEFLATE_STREAM_END == nRes; } -// Так как на всех ОС необходимо одинаковое поведение, -// то используем свой рандомайзер +// Since consistent behavior is required across all OSes, +// we use our own randomizer class CRandomizer { diff --git a/HwpFile/HwpDoc/HWPSection.cpp b/HwpFile/HwpDoc/HWPSection.cpp index e22110c54e..5855dbd54b 100644 --- a/HwpFile/HwpDoc/HWPSection.cpp +++ b/HwpFile/HwpDoc/HWPSection.cpp @@ -315,7 +315,7 @@ int CHWPSection::ParseRecurse(CHWPPargraph* pCurrPara, int nRunLevel, CHWPStream } else { - if (1 == nRunLevel) //TODO:: проверить + if (1 == nRunLevel) //TODO:: Verify { oBuffer.Skip(nSize); return oBuffer.GetDistanceToLastPos(true); @@ -517,7 +517,7 @@ int CHWPSection::ParseCtrlRecurse(CCtrl* pCurrCtrl, int nRunLevel, CHWPStream& o CCtrlTable *pCtrlTable = (CCtrlTable*)pCtrl; if (pCtrlTable->HaveCells()) { - //TODO:: проверить + //TODO:: Verify break; } @@ -657,7 +657,7 @@ int CHWPSection::ParseCtrlRecurse(CCtrl* pCurrCtrl, int nRunLevel, CHWPStream& o } else { - //TODO:: проверить + //TODO:: Verify CHWPPargraph *pNewPara = CHWPPargraph::Parse(nTagNum, nLevel, nSize, oBuffer, 0, nVersion); oBuffer.Skip(nSize); ParseRecurse(pNewPara, nLevel, oBuffer, 0, nVersion); @@ -736,7 +736,7 @@ int CHWPSection::ParseCtrlRecurse(CCtrl* pCurrCtrl, int nRunLevel, CHWPStream& o else pParentPara->AddCtrl(pNewCtrl); - //TODO:: проверить + //TODO:: Verify pCtrl = pNewCtrl; } diff --git a/HwpFile/HwpDoc/HWPStream.cpp b/HwpFile/HwpDoc/HWPStream.cpp index faeec092dd..a5b13209b7 100644 --- a/HwpFile/HwpDoc/HWPStream.cpp +++ b/HwpFile/HwpDoc/HWPStream.cpp @@ -103,7 +103,7 @@ bool CHWPStream::ReadChar(HWP_CHAR& chValue) bool CHWPStream::ReadFloat(float& fValue) { - //TODO:: Проверить + //TODO:: Verify int nValue; if (!ReadInt(nValue)) return false; @@ -115,7 +115,7 @@ bool CHWPStream::ReadFloat(float& fValue) bool CHWPStream::ReadDouble(double& dValue) { - //TODO:: реализовать + //TODO:: Implement long long lValue; if (!ReadLong(lValue)) return false; diff --git a/HwpFile/HwpDoc/OLEdoc/CompoundFile.cpp b/HwpFile/HwpDoc/OLEdoc/CompoundFile.cpp index 4786d48da6..d00138c620 100644 --- a/HwpFile/HwpDoc/OLEdoc/CompoundFile.cpp +++ b/HwpFile/HwpDoc/OLEdoc/CompoundFile.cpp @@ -39,7 +39,7 @@ bool CCompoundFile::GetComponent(const HWP_STRING& sEntryName, CHWPStream& oBuff VECTOR<CDirectoryEntry*> CCompoundFile::GetChildEntries(const CDirectoryEntry* pBaseEntry) const { - //TODO:: реализовать + //TODO:: Implement VECTOR<int> arEntryIdx; int nIndex = 0; @@ -613,7 +613,7 @@ bool CCompoundFile::ParseHeader(CHWPStream& oBuffer) m_nMinorVersion = oBuffer.ReadShort(); // if (0x003E != m_nMinorVersion) - // return false; //TODO:: возможно следует просто пропускать такие несоответсвия + // return false; //TODO:: Perhaps such mismatches should just be skipped m_nMajorVersion = oBuffer.ReadShort(); diff --git a/HwpFile/HwpDoc/Paragraph/CtrlCommon.cpp b/HwpFile/HwpDoc/Paragraph/CtrlCommon.cpp index b56c546cce..fa93357199 100644 --- a/HwpFile/HwpDoc/Paragraph/CtrlCommon.cpp +++ b/HwpFile/HwpDoc/Paragraph/CtrlCommon.cpp @@ -676,8 +676,8 @@ namespace HWP oBuffer.Skip(-4); return 0; - //TODO:: проверить данный метод - // в исходном коде есть дальнейшие действия + //TODO:: Verify this method + // The original source code has further actions } int CCtrlCommon::ParseCaption(CCtrlCommon& oObj, int nSize, CHWPStream& oBuffer, int nOff, int nVersion) diff --git a/HwpFile/HwpDoc/Paragraph/CtrlField.cpp b/HwpFile/HwpDoc/Paragraph/CtrlField.cpp index fbfbfb5299..43e19b063d 100644 --- a/HwpFile/HwpDoc/Paragraph/CtrlField.cpp +++ b/HwpFile/HwpDoc/Paragraph/CtrlField.cpp @@ -65,7 +65,7 @@ CCtrlField::CCtrlField(const HWP_STRING& sCtrlID, CXMLReader& oReader, EHanType if (!wsName.empty() && EFieldType::Bookmark == m_eType) AddStringParam(L"bookmarkname", wsName); - // Встречется только в HWPX + // Only found in HWPX if (EHanType::HWPX == eType) { WHILE_READ_NEXT_NODE_WITH_ONE_NAME(oReader, "hp:parameters") diff --git a/HwpFile/HwpDoc/Paragraph/CtrlGeneralShape.cpp b/HwpFile/HwpDoc/Paragraph/CtrlGeneralShape.cpp index f7383a30ff..a9d051a158 100644 --- a/HwpFile/HwpDoc/Paragraph/CtrlGeneralShape.cpp +++ b/HwpFile/HwpDoc/Paragraph/CtrlGeneralShape.cpp @@ -92,7 +92,7 @@ void CCtrlGeneralShape::ParseChildren(CXMLReader& oReader, EHanType eType) const std::string sChildNodeName{oReader.GetName()}; - //TODO:: выглядит не очень. Нужно вернуться и подумать как лучше иначе сделать + //TODO:: This looks suboptimal. Need to revisit and find a better approach if (EHanType::HWPML == eType && "DRAWINGOBJECT" == sChildNodeName) { WHILE_READ_NEXT_NODE_WITH_NAME(oReader) diff --git a/HwpFile/HwpDoc/Paragraph/CtrlHeadFoot.cpp b/HwpFile/HwpDoc/Paragraph/CtrlHeadFoot.cpp index f1adeb5caa..982cc805bf 100644 --- a/HwpFile/HwpDoc/Paragraph/CtrlHeadFoot.cpp +++ b/HwpFile/HwpDoc/Paragraph/CtrlHeadFoot.cpp @@ -84,7 +84,7 @@ void CCtrlHeadFoot::ReadFromHWPML(CXMLReader &oReader) m_nTextHeight = oReader.GetInt(); else if ("TextWidth" == sAttributeName) m_nTextWidth = oReader.GetInt(); - //TODO:: Реализовать HasTextRef и HasTextRef + //TODO:: Implement HasTextRef and HasNumRef } END_READ_ATTRIBUTES(oReader) diff --git a/HwpFile/HwpDoc/Paragraph/CtrlNewNumber.cpp b/HwpFile/HwpDoc/Paragraph/CtrlNewNumber.cpp index e16731519d..d692648d39 100644 --- a/HwpFile/HwpDoc/Paragraph/CtrlNewNumber.cpp +++ b/HwpFile/HwpDoc/Paragraph/CtrlNewNumber.cpp @@ -23,7 +23,7 @@ CCtrlNewNumber::CCtrlNewNumber(const HWP_STRING& sCtrlID, int nSize, CHWPStream& CCtrlNewNumber::CCtrlNewNumber(const HWP_STRING& sCtrlID, CXMLReader& oReader, EHanType eType) : CCtrl(sCtrlID) { - //TODO:: при встрече в файле нужно проверить + //TODO:: Verify when encountered in file START_READ_ATTRIBUTES(oReader) { @@ -31,7 +31,7 @@ CCtrlNewNumber::CCtrlNewNumber(const HWP_STRING& sCtrlID, CXMLReader& oReader, E m_shNum = oReader.GetInt(); else if ("numType" == sAttributeName) m_eNumType = ::HWP::GetNumType(oReader.GetTextA(), eType); - //TODO:: проверить данный момент + //TODO:: Verify this behavior else if ("autoNumFormat" == sAttributeName) m_eNumShape = GetNumberShape2(oReader.GetInt()); } diff --git a/HwpFile/HwpDoc/Paragraph/CtrlObjElement.cpp b/HwpFile/HwpDoc/Paragraph/CtrlObjElement.cpp index 30bf8d55e6..c27f04e4e5 100644 --- a/HwpFile/HwpDoc/Paragraph/CtrlObjElement.cpp +++ b/HwpFile/HwpDoc/Paragraph/CtrlObjElement.cpp @@ -110,7 +110,7 @@ void CCtrlObjElement::ParseRenderingInfo(CXMLReader &oReader, EHanType eType) { WHILE_READ_NEXT_NODE_WITH_NAME(oReader) { - // Сначала идёт 1 hc:transMatrix, а после попарно идут hc:scaMatrix с hc:rotMatrix + // First comes 1 hc:transMatrix, then hc:scaMatrix paired with hc:rotMatrix if (GetNodeName(ENode::TransformMatrix, eType) != sNodeName && GetNodeName(ENode::ScaleMatrix, eType) != sNodeName && diff --git a/HwpFile/HwpDoc/Paragraph/CtrlSectionDef.cpp b/HwpFile/HwpDoc/Paragraph/CtrlSectionDef.cpp index cc79fda792..7776414eff 100644 --- a/HwpFile/HwpDoc/Paragraph/CtrlSectionDef.cpp +++ b/HwpFile/HwpDoc/Paragraph/CtrlSectionDef.cpp @@ -195,7 +195,7 @@ CCtrlSectionDef::CCtrlSectionDef(const HWP_STRING& sCtrlID, CXMLReader& oReader, m_arBorderFills.push_back(new CPageBorderFill(oReader, eType)); else if (GetNodeName(ENode::MasterPage, eType) == sNodeName) { - //TODO:: добавить реализацию + //TODO:: Add implementation } } END_WHILE diff --git a/HwpFile/HwpDoc/Paragraph/CtrlShapeConnectLine.cpp b/HwpFile/HwpDoc/Paragraph/CtrlShapeConnectLine.cpp index a1327b1e9c..47257846cb 100644 --- a/HwpFile/HwpDoc/Paragraph/CtrlShapeConnectLine.cpp +++ b/HwpFile/HwpDoc/Paragraph/CtrlShapeConnectLine.cpp @@ -83,7 +83,7 @@ void CCtrlShapeConnectLine::ReadFromHWPML(CXMLReader &oReader) START_READ_ATTRIBUTES(oReader) { if ("Type" == sAttributeName) - // TODO:: реализовать при встрече + // TODO:: Implement when encountered m_eType = EConnectLineType::STRAIGHT_NOARROW; else if ("StartX" == sAttributeName) m_oStartPt.m_nX = oReader.GetInt(); diff --git a/HwpFile/HwpDoc/Paragraph/CtrlShapePic.cpp b/HwpFile/HwpDoc/Paragraph/CtrlShapePic.cpp index c5e2db0125..181e29ba4d 100644 --- a/HwpFile/HwpDoc/Paragraph/CtrlShapePic.cpp +++ b/HwpFile/HwpDoc/Paragraph/CtrlShapePic.cpp @@ -29,7 +29,7 @@ CPicColor::CPicColor(CHWPStream& oBuffer, int nOff, int nSize) CPicColor::CPicColor(CXMLReader& oReader) { - //TODO:: проверить + //TODO:: Verify m_nType = 0; } @@ -85,7 +85,7 @@ CShadow::CShadow(CXMLReader& oReader, EHanType eType) else if (GetAttributeName(EAttribute::RotationStyle, eType) == sAttributeName) m_nRotation = (int)oReader.GetBool(); - // Далее идут атрибуты, которые встречаются только в HWPML + // The following attributes are only found in HWPML else if (EHanType::HWPML != eType) continue; else if ("SkewX" == sAttributeName) @@ -99,7 +99,7 @@ CShadow::CShadow(CXMLReader& oReader, EHanType eType) } END_READ_ATTRIBUTES(oReader) - // Далее идут ноды, которые встречаются только в HWPX + // The following nodes are only found in HWPX if (EHanType::HWPX != eType) return; @@ -127,7 +127,7 @@ CShadow::CShadow(CXMLReader& oReader, EHanType eType) } END_READ_ATTRIBUTES(oReader) } - // TODO:: реализовать для HWPX и HWPML при встрече + // TODO:: Implement for HWPX and HWPML when encountered else if ("hp:effectsColor" == sNodeName) m_pColor = new CPicColor(oReader); } @@ -231,7 +231,7 @@ CReflect::CReflect(CXMLReader& oReader, EHanType eType) else if (GetAttributeName(EAttribute::FadeDirection, eType) == sAttributeName) m_fOffsetDirection = oReader.GetDouble(); - // Далее идут атрибуты, которые встречаются только в HWPML + // The following attributes are only found in HWPML else if (EHanType::HWPML != eType) continue; else if ("SkewX" == sAttributeName) @@ -253,7 +253,7 @@ CReflect::CReflect(CXMLReader& oReader, EHanType eType) } END_READ_ATTRIBUTES(oReader) - // Далее идут ноды, которые встречаются только в HWPX + // The following nodes are only found in HWPX if (EHanType::HWPX != eType) return; diff --git a/HwpFile/HwpDoc/Paragraph/CtrlShapeTextArt.cpp b/HwpFile/HwpDoc/Paragraph/CtrlShapeTextArt.cpp index 8f0c916871..3a90c5b549 100644 --- a/HwpFile/HwpDoc/Paragraph/CtrlShapeTextArt.cpp +++ b/HwpFile/HwpDoc/Paragraph/CtrlShapeTextArt.cpp @@ -124,7 +124,7 @@ void CCtrlShapeTextArt::ReadTextArtShape(CXMLReader &oReader, EHanType eType) } END_READ_ATTRIBUTES(oReader) - //TODO:: реализовать shadows + //TODO:: Implement shadows } void CCtrlShapeTextArt::ReadOutlineData(CXMLReader &oReader, EHanType eType) @@ -157,7 +157,7 @@ EShapeType CCtrlShapeTextArt::GetShapeType() const int CCtrlShapeTextArt::ParseElement(CCtrlShapeTextArt& oObj, int nSize, CHWPStream& oBuffer, int nOff, int nVersion) { - // TODO:: проверить + // TODO:: Verify // [HWP ambiguous] following 120bytes are unknown. // Document doesn't mention about this at all. diff --git a/HwpFile/HwpDoc/Paragraph/LineSeg.cpp b/HwpFile/HwpDoc/Paragraph/LineSeg.cpp index ec56a22bd6..1245731fe2 100644 --- a/HwpFile/HwpDoc/Paragraph/LineSeg.cpp +++ b/HwpFile/HwpDoc/Paragraph/LineSeg.cpp @@ -22,7 +22,7 @@ CLineSeg::CLineSeg(int nTagNum, int nLevel, int nSize, CHWPStream& oBuffer, int CLineSeg::CLineSeg(CXMLReader& oReader) { - //TODO:: реализовать + //TODO:: Implement START_READ_ATTRIBUTES(oReader) { diff --git a/HwpFile/HwpDoc/Section/NoteShape.cpp b/HwpFile/HwpDoc/Section/NoteShape.cpp index 0f608e8e25..c264989287 100644 --- a/HwpFile/HwpDoc/Section/NoteShape.cpp +++ b/HwpFile/HwpDoc/Section/NoteShape.cpp @@ -19,7 +19,7 @@ CNoteShape::CNoteShape() CNoteShape::CNoteShape(CXMLReader& oReader, EHanType eType) { - //TODO:: реализовать + //TODO:: Implement } CNoteShape* CNoteShape::Parse(int nLevel, int nSize, CHWPStream& oBuffer, int nOff, int nVersion) diff --git a/HwpFile/HwpDoc/Section/NoteShape.h b/HwpFile/HwpDoc/Section/NoteShape.h index 7d62dd3e04..2b2c58721a 100644 --- a/HwpFile/HwpDoc/Section/NoteShape.h +++ b/HwpFile/HwpDoc/Section/NoteShape.h @@ -15,8 +15,8 @@ enum class ENoteNumbering UNKNOWN }; -//TODO:: проверить данный enum -// в олигинале и EachColumn и EndOfDocument имеют одинаковые значения +//TODO:: Verify this enum +// In the original, both EachColumn and EndOfDocument have the same values enum class ENotePlacement { EachColumn, diff --git a/MsBinaryFile/Common/Vba/Records.cpp b/MsBinaryFile/Common/Vba/Records.cpp index 775ed93cfb..fe0152c7d1 100644 --- a/MsBinaryFile/Common/Vba/Records.cpp +++ b/MsBinaryFile/Common/Vba/Records.cpp @@ -117,7 +117,7 @@ namespace VBA return oConverter.toUnicode(buffer, size, nCodePage, true); } else - {//текущая локаль + {//current locale std::locale loc(""); std::ctype<wchar_t> const &facet = std::use_facet<std::ctype<wchar_t> >(loc); diff --git a/MsBinaryFile/Common/Vba/VbaBinary.cpp b/MsBinaryFile/Common/Vba/VbaBinary.cpp index 2b4a956fbb..95be2efc6f 100644 --- a/MsBinaryFile/Common/Vba/VbaBinary.cpp +++ b/MsBinaryFile/Common/Vba/VbaBinary.cpp @@ -158,7 +158,7 @@ CVbaFileStream::CVbaFileStream(POLE::Stream* stream, _UINT32 offset) if ((header & CHUNK_SIGMASK) != CHUNK_SIG) { bCompressed = true; - chunkSize = 4094; //по факту + chunkSize = 4094; //in practice bUnknown = true; } unsigned char *dataNext = dataCur + chunkSize; diff --git a/MsBinaryFile/Common/Vml/GraphicsPath.cpp b/MsBinaryFile/Common/Vml/GraphicsPath.cpp index d64145043e..769bc56514 100644 --- a/MsBinaryFile/Common/Vml/GraphicsPath.cpp +++ b/MsBinaryFile/Common/Vml/GraphicsPath.cpp @@ -103,8 +103,8 @@ namespace ODRAW if (NULL == pRenderer) return; - // вообще можно каждый раз выставл¤ть pen/brush. - // но у нас сейчас pen и brush выставл¤ютс¤ в shape + // generally, pen/brush can be set each time. + // but currently pen and brush are set in shape pRenderer->SetCommandParams(m_dAngle, m_oBounds.left, m_oBounds.top, m_oBounds.GetWidth(), m_oBounds.GetHeight(), m_lFlags); diff --git a/MsBinaryFile/Common/Vml/GraphicsPath.h b/MsBinaryFile/Common/Vml/GraphicsPath.h index 5d81cca316..3f7a2e2326 100644 --- a/MsBinaryFile/Common/Vml/GraphicsPath.h +++ b/MsBinaryFile/Common/Vml/GraphicsPath.h @@ -63,7 +63,7 @@ namespace ODRAW namespace NSBaseShape { - enum ClassType {unknown, pptx, ppt, odp};// Перечисление можно расширять + enum ClassType {unknown, pptx, ppt, odp};// Enum can be extended } enum RulesType diff --git a/MsBinaryFile/Common/Vml/PPTShape/BinaryReader.cpp b/MsBinaryFile/Common/Vml/PPTShape/BinaryReader.cpp index fbeb3025eb..d0004cfc6c 100644 --- a/MsBinaryFile/Common/Vml/PPTShape/BinaryReader.cpp +++ b/MsBinaryFile/Common/Vml/PPTShape/BinaryReader.cpp @@ -47,7 +47,7 @@ namespace ODRAW m_pBuffer = NULL; m_lCount = 0; } - LONG CBinaryReader::ReadLONG() // int32 подразумевается + LONG CBinaryReader::ReadLONG() // int32 implied { DWORD lOldOrigin = m_lOrigin; m_lOrigin += 4; diff --git a/MsBinaryFile/Common/Vml/PPTShape/BinaryReader.h b/MsBinaryFile/Common/Vml/PPTShape/BinaryReader.h index 259699a378..9dbae90bbd 100644 --- a/MsBinaryFile/Common/Vml/PPTShape/BinaryReader.h +++ b/MsBinaryFile/Common/Vml/PPTShape/BinaryReader.h @@ -54,7 +54,7 @@ namespace ODRAW CBinaryReader(BYTE* pBuffer, DWORD lCount); ~CBinaryReader(); - LONG ReadLONG(); // int32 подразумевается + LONG ReadLONG(); // int32 implied DWORD ReadDWORD(); WORD ReadWORD(); SHORT ReadSHORT(); diff --git a/MsBinaryFile/Common/Vml/PPTShape/CustomGeomShape.cpp b/MsBinaryFile/Common/Vml/PPTShape/CustomGeomShape.cpp index a36e34b6a0..d4b79b6dfd 100644 --- a/MsBinaryFile/Common/Vml/PPTShape/CustomGeomShape.cpp +++ b/MsBinaryFile/Common/Vml/PPTShape/CustomGeomShape.cpp @@ -522,7 +522,7 @@ namespace NSCustomVML return; oManager.Clear(); - // сначала заполним формулы + // first fill in the formulas for (size_t nIndex = 0; nIndex < m_arGuides.size(); ++nIndex) { NSGuidesVML::CFormula oF; @@ -864,7 +864,7 @@ namespace NSCustomVML //if (rtClose == oInfo.m_eRuler) //{ - // // проводим линию + // // draw a line // CSegment oInfo2(rtLineTo, 1); // m_arSegments.push_back(oInfo2); //} diff --git a/MsBinaryFile/Common/Vml/PPTShape/ElementSettings.cpp b/MsBinaryFile/Common/Vml/PPTShape/ElementSettings.cpp index b91f8e7450..dcad683fa5 100644 --- a/MsBinaryFile/Common/Vml/PPTShape/ElementSettings.cpp +++ b/MsBinaryFile/Common/Vml/PPTShape/ElementSettings.cpp @@ -39,8 +39,8 @@ #include "../../../PptFile/Records/Drawing/ArtBlip.h" -// это класс, использующийся для передачи свойств объектов, -// например - указатель на картинку... (по PID'у) +// this class is used for passing object properties, +// for example - pointer to an image... (by PID) CProperty::CProperty() { @@ -59,9 +59,9 @@ CProperty::~CProperty() } void CProperty::FromStream(POLE::Stream* pStream) { - // читаем из стрима... - // только пока без учета bComplex - // т.к. Complex - учитывается в контейнере, хранящем все проперти + // reading from stream... + // for now without considering bComplex + // since Complex is handled in the container storing all properties USHORT lMem = StreamUtils::ReadWORD(pStream); m_ePID = (ODRAW::ePropertyId)(lMem & 0x3FFF); @@ -174,8 +174,8 @@ void CProperties::FromStream(POLE::Stream* pStream, long lCount) m_arProperties.push_back(elem); m_arProperties[lIndex].FromStream(pStream); } - // теперь читаем дополнительную информацию - // сортировано по pid'ам (но у нас пока просто по-порядку) + // now reading additional information + // sorted by pids (but for now we just go in order) for (size_t lIndex = 0; lIndex < m_lCount; ++lIndex) { m_arProperties[lIndex].ComplexFromStream(pStream); diff --git a/MsBinaryFile/Common/Vml/PPTShape/ElementSettings.h b/MsBinaryFile/Common/Vml/PPTShape/ElementSettings.h index 119e1604d7..731dcf45a7 100644 --- a/MsBinaryFile/Common/Vml/PPTShape/ElementSettings.h +++ b/MsBinaryFile/Common/Vml/PPTShape/ElementSettings.h @@ -37,8 +37,8 @@ #include <vector> -// это класс, использующийся для передачи свойств объектов, -// например - указатель на картинку... (по PID'у) +// this class is used for passing object properties, +// e.g. pointer to an image... (by PID) class CProperty { @@ -48,7 +48,7 @@ public: bool m_bComplex; _UINT32 m_lValue; unsigned char* m_pOptions; - // чтобы не плодить классы - это value, когда m_bComplex == true + // to avoid creating extra classes - this is value when m_bComplex == true bool m_bIsTruncated; CProperty(); @@ -58,13 +58,13 @@ public: void ComplexFromStream(POLE::Stream* pStream); }; -// А вот контейнер пропертей +// And here's the properties container class CProperties { public: std::vector<CProperty> m_arProperties; - // по идее - это instance, но нам так удобнее, - // тем более это класс - не связанный с RecordHeader + // in theory - this is instance, but it's more convenient for us, + // especially since this class is not related to RecordHeader size_t m_lCount; CProperties(); diff --git a/MsBinaryFile/Common/Vml/PPTShape/Enums.h b/MsBinaryFile/Common/Vml/PPTShape/Enums.h index 8ece607d8f..fa82021b95 100644 --- a/MsBinaryFile/Common/Vml/PPTShape/Enums.h +++ b/MsBinaryFile/Common/Vml/PPTShape/Enums.h @@ -359,7 +359,7 @@ namespace ODRAW }; /////////////////////////////////////////////////////////////// - // а нужно ли...? + // is this needed...? /////////////////////////////////////////////////////////////// /* @@ -403,7 +403,7 @@ namespace ODRAW */ //////////////////////////////////////////////////////////// - // <- а нужно ли...? + // <- is this needed...? //////////////////////////////////////////////////////////// enum eBlipUsage diff --git a/MsBinaryFile/Common/Vml/PPTShape/Ppt2PptxShapeConverter.cpp b/MsBinaryFile/Common/Vml/PPTShape/Ppt2PptxShapeConverter.cpp index c6c4fa7db8..f6017556d0 100644 --- a/MsBinaryFile/Common/Vml/PPTShape/Ppt2PptxShapeConverter.cpp +++ b/MsBinaryFile/Common/Vml/PPTShape/Ppt2PptxShapeConverter.cpp @@ -301,9 +301,9 @@ namespace NSGuidesVML { CSlicePath& oSlice = m_arSlicesPath[i]; - //m_lIndexDst-1 - номер последней записанной формулы - //m_lIndexSrc - номер последнего блока формул - //m_arIndexDst[n] - возвращает номер последней формулы в блоке n + // m_lIndexDst-1 - index of the last written formula + // m_lIndexSrc - index of the last formula block + // m_arIndexDst[n] - returns the index of the last formula in block n //m_arIndexDst[m_lIndexSrc] = m_lIndexDst switch (oSlice.m_eRuler) @@ -387,7 +387,7 @@ namespace NSGuidesVML void CFormulaConverter::ConvertHandle(const std::vector<CHandle_>& arHandles, std::vector<long>& arAdj, PPTShapes::ShapeType oSType) { size_t nHandlesCount = arHandles.size(); - if (oSType == 19) // в пптх не реализована функция изменения размера шейпа при изменении handle + if (oSType == 19) // in pptx the function to change shape size when changing handle is not implemented nHandlesCount = 0; for (size_t i = 0; i < nHandlesCount; ++i) { @@ -418,7 +418,7 @@ namespace NSGuidesVML if (pHnPoint.polar != L"") { - //пришел полярный угол + // polar angle received oHandle.bRefExist.y = false; oHandle.bRefPolarExist.y = true; @@ -434,17 +434,17 @@ namespace NSGuidesVML if (oHandle.gdRefType.y == ptAdjust) { - //угол должен храниться в pptx формате, поэтому придётся его везде заменить + // angle must be stored in pptx format, so it will need to be replaced everywhere std::wstring strNewFmla = GetValue2(m_lIndexDst, ptFormula, true); std::wstring strOldFmla = GetValue2(oHandle.gdRef.y, oHandle.gdRefType.y, false); LONG nIndex = m_lIndexDst; - // TODO: !!! тут медленный код. + // TODO: !!! slow code here. m_oGuidsRes.ReplaceString(strOldFmla, strNewFmla); m_lIndexSrc++; - // TODO: !!! тут медленный код. + // TODO: !!! slow code here. NSBinPptxRW::CXmlWriter memGuidsRes; ConvertProd(oHandle.gdRef.y, oHandle.gdRefType.y, m_oParam.m_lCoef, ptValue, pow3_16, ptValue, false, true, false, memGuidsRes); m_oGuidsRes.m_oWriter.WriteBefore(memGuidsRes.m_oWriter); @@ -456,8 +456,8 @@ namespace NSGuidesVML if (oHandle.gdRef.y >= (int)arAdj.size()) { - // дурацкий код. надо память перевыделить, а старую скопировать - // пока сделаю так, чтобы наверняка + // bad code. need to reallocate memory and copy the old one + // for now doing it this way to be safe int nNewSize = (int)oHandle.gdRef.y + 1; while ((int)arAdj.size() < nNewSize) arAdj.push_back(0); @@ -467,7 +467,7 @@ namespace NSGuidesVML arAdj[oHandle.gdRef.y] = lVal; } - //рассчитаем координаты точки handle + // calculate the handle point coordinates m_lIndexSrc++; ConvertCos(oHandle.gdRef.x, oHandle.gdRefType.x, oHandle.gdRef.y, oHandle.gdRefType.y, false, false, m_oGuidsRes); @@ -486,7 +486,7 @@ namespace NSGuidesVML } } - else//если пришли обычные координаты + else// if regular coordinates received { if ((pHnPoint.xrange != L"" && oHandle.gdRefType.x != ptAdjust && oHandle.gdRefType.y == ptAdjust) || (pHnPoint.yrange != L"" && oHandle.gdRefType.x == ptAdjust && oHandle.gdRefType.y != ptAdjust)) @@ -853,7 +853,7 @@ namespace NSGuidesVML { if ( lValue >= 0x7fffff00 || lValue <= -0x7fffff00) { - lValue = 0; //process(2).ppt - todooo разобраться что за хрень это ваще приплыла + lValue = 0; //process(2).ppt - todooo figure out what this weird thing is } m_arSlicesPath[m_arSlicesPath.size() - 1].AddParam(lValue, eParamType); @@ -917,7 +917,7 @@ namespace NSGuidesVML m_oHandleRes.WriteString(L"\""); } - //min max 1го параметра + // min max of 1st parameter if (oHnd.bMinExist.x) { m_oHandleRes.WriteString(L" minX=\""); @@ -940,7 +940,7 @@ namespace NSGuidesVML m_oHandleRes.WriteString(L"\""); } - //min max 2го параметра + // min max of 2nd parameter if (oHnd.bMinExist.y) { m_oHandleRes.WriteString(L" minY=\""); @@ -1043,7 +1043,7 @@ namespace NSGuidesVML return lVal; else return 0; //??? - //todooo прописать все варианты правильно + //todooo write all variants correctly } else { @@ -1225,12 +1225,12 @@ namespace NSGuidesVML pCurPoint1 = oSlice.m_arPoints[j+1]; pCurPointType1 = oSlice.m_arPointsType[j+1]; - //длина сторон + // side lengths m_lIndexSrc++; ConvertSum(pCurPoint1.x, pCurPointType1.x, 0, ptValue, pCurPoint.x, pCurPointType.x, false, true, false, m_oGuidsRes); ConvertSum(pCurPoint1.y, pCurPointType1.y, 0, ptValue, pCurPoint.y, pCurPointType.y, false, true, false, m_oGuidsRes); m_arIndexDst.push_back(m_lIndexDst-1); - //координаты центра + // center coordinates nIndex = m_arIndexDst[m_lIndexSrc]; m_lIndexSrc++; @@ -1240,8 +1240,8 @@ namespace NSGuidesVML ConvertSum(pCurPoint.x, pCurPointType.x, m_lIndexDst-2, ptFormula, 0, ptValue, false, true, true, m_oGuidsRes); ConvertSum(pCurPoint.y, pCurPointType.y, m_lIndexDst-2, ptFormula, 0, ptValue, false, true, true, m_oGuidsRes); m_arIndexDst.push_back(m_lIndexDst-1); - //рассчет для stAng--------------------------- - //расположение текущей точки по четвертям 3 4 + // calculation for stAng--------------------------- + // current point position by quadrants 3 4 // 2 1 pCurPoint = oSlice.m_arPoints[j+2]; @@ -1254,14 +1254,14 @@ namespace NSGuidesVML ConvertIf(m_lIndexDst-2, ptFormula, 1, ptValue, -1, ptValue, true, true, true, m_oGuidsRes); ConvertIf(m_lIndexDst-2, ptFormula, 1, ptValue, -1, ptValue, true, true, true, m_oGuidsRes); m_arIndexDst.push_back(m_lIndexDst-1); - //угол между Ох и радиус-вектором к точке + // angle between Ox and radius vector to the point nIndex = m_arIndexDst[m_lIndexSrc]; m_lIndexSrc++; ConvertProd(nIndex-2, ptFormula, 1, ptValue, nIndex-3, ptFormula, true, true, true, m_oGuidsRes); ConvertAt2(1, ptValue, m_lIndexDst-1, ptFormula, true, true, m_oGuidsRes); m_arIndexDst.push_back(m_lIndexDst-1); - //радиус к точке + // radius to the point nIndex = m_arIndexDst[m_lIndexSrc]; nIndex1 = m_arIndexDst[m_lIndexSrc-2]; @@ -1280,27 +1280,27 @@ namespace NSGuidesVML ConvertSqrt(m_lIndexDst-1, ptFormula, true, m_oGuidsRes); ConvertProd(nIndex1-3, ptFormula, nIndex1-2, ptFormula, m_lIndexDst-1, ptFormula, true, true, true, m_oGuidsRes);//r m_arIndexDst.push_back(m_lIndexDst-1); - //если точка во 2 и 3 четвертях, прибавляем по 180grad + // if the point is in quadrants 2 and 3, add 180 degrees nIndex = m_arIndexDst[m_lIndexSrc-2]; m_lIndexSrc++; ConvertIf(nIndex-3, ptFormula, 0, ptValue, 10800000, ptValue, true, true, true, m_oGuidsRes); m_arIndexDst.push_back(m_lIndexDst-1); - //угол до 1 точки (stAngle) - nIndex = m_arIndexDst[m_lIndexSrc-2];//угол между ох и радиусом - nIndex1 = m_arIndexDst[m_lIndexSrc-3];//расположение точки по четвертям - nIndex2 = m_arIndexDst[m_lIndexSrc];//прибавка 180 или 0 + // angle to point 1 (stAngle) + nIndex = m_arIndexDst[m_lIndexSrc-2];// angle between ox and radius + nIndex1 = m_arIndexDst[m_lIndexSrc-3];// point position by quadrants + nIndex2 = m_arIndexDst[m_lIndexSrc];// addition of 180 or 0 m_lIndexSrc ++; - ConvertProd(nIndex1-1, ptFormula, nIndex1, ptFormula, 1, ptValue, true, true, true, m_oGuidsRes);//знак у угла + ConvertProd(nIndex1-1, ptFormula, nIndex1, ptFormula, 1, ptValue, true, true, true, m_oGuidsRes);// angle sign ConvertProd(nIndex, ptFormula, -1, ptValue, 1, ptValue, true, true, true, m_oGuidsRes); - ConvertIf(nIndex, ptFormula, nIndex, ptFormula, m_lIndexDst-1, ptFormula, true, true, true, m_oGuidsRes);//угол всегда положительный + ConvertIf(nIndex, ptFormula, nIndex, ptFormula, m_lIndexDst-1, ptFormula, true, true, true, m_oGuidsRes);// angle is always positive - ConvertProd(m_lIndexDst-1, ptFormula, m_lIndexDst-3, ptFormula, 1, ptValue, true, true, true, m_oGuidsRes);//u с нужным знаком + ConvertProd(m_lIndexDst-1, ptFormula, m_lIndexDst-3, ptFormula, 1, ptValue, true, true, true, m_oGuidsRes);// u with the correct sign ConvertSum(m_lIndexDst-1, ptFormula, nIndex2, ptFormula, 0, ptValue, true, true, true, m_oGuidsRes); m_arIndexDst.push_back(m_lIndexDst-1); - //координаты стартовой точки + // start point coordinates nIndex = m_arIndexDst[m_lIndexSrc-2]; nIndex1 = m_arIndexDst[m_lIndexSrc-4]; nIndex2 = m_arIndexDst[m_lIndexSrc-5]; @@ -1311,14 +1311,14 @@ namespace NSGuidesVML ConvertSum(nIndex2-1, ptFormula, m_lIndexDst-1, ptFormula, 0, ptValue, true, true, true, m_oGuidsRes); //x ConvertProd(nIndex-6, ptFormula, -1, ptValue, 1, ptValue, true, true, true, m_oGuidsRes); - ConvertIf(nIndex-6, ptFormula, nIndex-6, ptFormula, m_lIndexDst-1, ptFormula, true, true, true, m_oGuidsRes);//sin теперь всегда>0 + ConvertIf(nIndex-6, ptFormula, nIndex-6, ptFormula, m_lIndexDst-1, ptFormula, true, true, true, m_oGuidsRes);// sin is now always > 0 ConvertProd(nIndex, ptFormula, m_lIndexDst-1, ptFormula, 1, ptValue, true, true, true, m_oGuidsRes);//r*sin ConvertProd(nIndex1, ptFormula, m_lIndexDst-1, ptFormula, 1, ptValue, true, true, true, m_oGuidsRes); ConvertSum(nIndex2, ptFormula, m_lIndexDst-1, ptFormula, 0, ptValue, true, true, true, m_oGuidsRes);//y m_arIndexDst.push_back(m_lIndexDst-1); - //рассчет для swAng--------------------------- - //расположение текущей точки по четвертям 3 4 + //calculation for swAng--------------------------- + // current point position by quadrants 3 4 // 2 1 pCurPoint = oSlice.m_arPoints[j+3]; @@ -1332,14 +1332,14 @@ namespace NSGuidesVML ConvertIf(m_lIndexDst-2, ptFormula, 1, ptValue, -1, ptValue, true, true, true, m_oGuidsRes); ConvertIf(m_lIndexDst-2, ptFormula, 1, ptValue, -1, ptValue, true, true, true, m_oGuidsRes); m_arIndexDst.push_back(m_lIndexDst-1); - //угол между Ох и радиус-вектором к точке + // angle between Ox and radius vector to the point nIndex = m_arIndexDst[m_lIndexSrc]; m_lIndexSrc++; ConvertProd(nIndex-2, ptFormula, 1, ptValue, nIndex-3, ptFormula, true, true, true, m_oGuidsRes); ConvertAt2(1, ptValue, m_lIndexDst-1, ptFormula, true, true, m_oGuidsRes); m_arIndexDst.push_back(m_lIndexDst-1); - //радиус к точке + // radius to the point nIndex = m_arIndexDst[m_lIndexSrc]; nIndex1 = m_arIndexDst[m_lIndexSrc-8]; @@ -1358,27 +1358,27 @@ namespace NSGuidesVML ConvertSqrt(m_lIndexDst-1, ptFormula, true, m_oGuidsRes); ConvertProd(nIndex1-3, ptFormula, nIndex1-2, ptFormula, m_lIndexDst-1, ptFormula, true, true, true, m_oGuidsRes); m_arIndexDst.push_back(m_lIndexDst-1); - //если точка во 2 и 3 четвертях, прибавляем по 180grad + // if the point is in quadrants 2 and 3, add 180 degrees nIndex = m_arIndexDst[m_lIndexSrc-2]; m_lIndexSrc++; ConvertIf(nIndex-3, ptFormula, 0, ptValue, 10800000, ptValue, true, true, true, m_oGuidsRes); m_arIndexDst.push_back(m_lIndexDst-1); - //угол до 2 точки - nIndex = m_arIndexDst[m_lIndexSrc-2];//угол между ох и радиусом - nIndex1 = m_arIndexDst[m_lIndexSrc-3];//расположение точки по четвертям - nIndex2 = m_arIndexDst[m_lIndexSrc];//прибавка 180 или 0 + //angle to point 2 + nIndex = m_arIndexDst[m_lIndexSrc-2];// angle between ox and radius + nIndex1 = m_arIndexDst[m_lIndexSrc-3];// point position by quadrants + nIndex2 = m_arIndexDst[m_lIndexSrc];// addition of 180 or 0 m_lIndexSrc++; - ConvertProd(nIndex1-1, ptFormula, nIndex1, ptFormula, 1, ptValue, true, true, true, m_oGuidsRes);//знак у угла + ConvertProd(nIndex1-1, ptFormula, nIndex1, ptFormula, 1, ptValue, true, true, true, m_oGuidsRes);// angle sign ConvertProd(nIndex, ptFormula, -1, ptValue, 1, ptValue, true, true, true, m_oGuidsRes); - ConvertIf(nIndex, ptFormula, nIndex, ptFormula, m_lIndexDst-1, ptFormula, true, true, true, m_oGuidsRes);//угол всегда положительный + ConvertIf(nIndex, ptFormula, nIndex, ptFormula, m_lIndexDst-1, ptFormula, true, true, true, m_oGuidsRes);// angle is always positive - ConvertProd(m_lIndexDst-1, ptFormula, m_lIndexDst-3, ptFormula, 1, ptValue, true, true, true, m_oGuidsRes);//u с нужным знаком + ConvertProd(m_lIndexDst-1, ptFormula, m_lIndexDst-3, ptFormula, 1, ptValue, true, true, true, m_oGuidsRes);// u with the correct sign ConvertSum(m_lIndexDst-1, ptFormula, nIndex2, ptFormula, 0, ptValue, true, true, true, m_oGuidsRes); m_arIndexDst.push_back(m_lIndexDst-1); - //координаты конечной точки + //end point coordinates nIndex = m_arIndexDst[m_lIndexSrc-2]; nIndex1 = m_arIndexDst[m_lIndexSrc-4]; nIndex2 = m_arIndexDst[m_lIndexSrc-11]; @@ -1389,18 +1389,18 @@ namespace NSGuidesVML ConvertSum(nIndex2-1, ptFormula, m_lIndexDst-1, ptFormula, 0, ptValue, true, true, true, m_oGuidsRes);//x ConvertProd(nIndex-6, ptFormula, -1, ptValue, 1, ptValue, true, true, true, m_oGuidsRes); - ConvertIf(nIndex-6, ptFormula, nIndex-6, ptFormula, m_lIndexDst-1, ptFormula, true, true, true, m_oGuidsRes);//sin теперь всегда>0 + ConvertIf(nIndex-6, ptFormula, nIndex-6, ptFormula, m_lIndexDst-1, ptFormula, true, true, true, m_oGuidsRes);// sin is now always > 0 ConvertProd(nIndex, ptFormula, m_lIndexDst-1, ptFormula, 1, ptValue, true, true, true, m_oGuidsRes);//r*sin(a) ConvertProd(nIndex1, ptFormula, m_lIndexDst-1, ptFormula, 1, ptValue, true, true, true, m_oGuidsRes); ConvertSum(nIndex2, ptFormula, m_lIndexDst-1, ptFormula, 0, ptValue, true, true, true, m_oGuidsRes);//y m_arIndexDst.push_back(m_lIndexDst-1); //swAngle - nIndex = m_arIndexDst[m_lIndexSrc-1]; //2 угол - nIndex1 = m_arIndexDst[m_lIndexSrc-7]; //1 угол + nIndex = m_arIndexDst[m_lIndexSrc-1]; //angle 2 + nIndex1 = m_arIndexDst[m_lIndexSrc-7]; //angle 1 m_lIndexSrc++; - ConvertSum(nIndex1, ptFormula, 0, ptValue, nIndex, ptFormula, true, true, true, m_oGuidsRes); // (1)-(2), если отрицательный то берем его, иначе пересчитываем + ConvertSum(nIndex1, ptFormula, 0, ptValue, nIndex, ptFormula, true, true, true, m_oGuidsRes); // (1)-(2), if negative then use it, otherwise recalculate ConvertProd(m_lIndexDst-1, ptFormula, -1, ptValue, 1, ptValue, true, true, true, m_oGuidsRes); ConvertSum(nIndex1, ptFormula, 21600000, ptValue, nIndex, ptFormula, true, true, true, m_oGuidsRes); @@ -1417,7 +1417,7 @@ namespace NSGuidesVML m_arIndexDst.push_back(m_lIndexDst-1); //--------------------------------------------------------- - nIndex = m_arIndexDst[m_lIndexSrc-8];//координаты стартовой точки + nIndex = m_arIndexDst[m_lIndexSrc-8];// start point coordinates nIndex1 = m_arIndexDst[m_lIndexSrc-9];//stAng nIndex2 = m_arIndexDst[m_lIndexSrc-1];//swAng @@ -1459,14 +1459,14 @@ namespace NSGuidesVML m_oPathRes.WriteString(L"\" />"); } - //старт + //start /* LONG nIndex3 = m_arIndexDst[m_lIndexSrc-14]; strPathRes += L"<a:moveTo><a:pt x=\"0\" y=\"0\" /></a:moveTo><a:lnTo><a:pt x=\"") + GetValue(nIndex3-1, ptFormula, true) + L"\" y=\"") + GetValue(nIndex3, ptFormula, true) + + L"\" /></a:lnTo>"); */ - //текущая точка + //current point nIndex = m_arIndexDst[m_lIndexSrc-2]; ConvertVal(nIndex-5, ptFormula, true, m_oGuidsRes); ConvertVal(nIndex, ptFormula, true, m_oGuidsRes); @@ -1490,12 +1490,12 @@ namespace NSGuidesVML pCurPoint1 = oSlice.m_arPoints[j+1]; pCurPointType1 = oSlice.m_arPointsType[j+1]; - //длина сторон + // side lengths m_lIndexSrc++; ConvertSum(pCurPoint1.x, pCurPointType1.x, 0, ptValue, pCurPoint.x, pCurPointType.x, false, true, false, m_oGuidsRes); ConvertSum(pCurPoint1.y, pCurPointType1.y, 0, ptValue, pCurPoint.y, pCurPointType.y, false, true, false, m_oGuidsRes); m_arIndexDst.push_back(m_lIndexDst-1); - //координаты центра + // center coordinates nIndex = m_arIndexDst[m_lIndexSrc]; m_lIndexSrc++; @@ -1505,8 +1505,8 @@ namespace NSGuidesVML ConvertSum(pCurPoint.x, pCurPointType.x, m_lIndexDst-2, ptFormula, 0, ptValue, false, true, true, m_oGuidsRes); ConvertSum(pCurPoint.y, pCurPointType.y, m_lIndexDst-2, ptFormula, 0, ptValue, false, true, true, m_oGuidsRes); m_arIndexDst.push_back(m_lIndexDst-1); - //рассчет для stAng--------------------------- - //расположение текущей точки по четвертям 3 4 + // calculation for stAng--------------------------- + // current point position by quadrants 3 4 // 2 1 pCurPoint = oSlice.m_arPoints[j+2]; @@ -1519,14 +1519,14 @@ namespace NSGuidesVML ConvertIf(m_lIndexDst-2, ptFormula, 1, ptValue, -1, ptValue, true, true, true, m_oGuidsRes); ConvertIf(m_lIndexDst-2, ptFormula, 1, ptValue, -1, ptValue, true, true, true, m_oGuidsRes); m_arIndexDst.push_back(m_lIndexDst-1); - //угол между Ох и радиус-вектором к точке + // angle between Ox and radius vector to the point nIndex = m_arIndexDst[m_lIndexSrc]; m_lIndexSrc++; ConvertProd(nIndex-2, ptFormula, 1, ptValue, nIndex-3, ptFormula, true, true, true, m_oGuidsRes); ConvertAt2(1, ptValue, m_lIndexDst-1, ptFormula, true, true, m_oGuidsRes); m_arIndexDst.push_back(m_lIndexDst-1); - //радиус к точке + // radius to the point nIndex = m_arIndexDst[m_lIndexSrc]; nIndex1 = m_arIndexDst[m_lIndexSrc-2]; @@ -1545,27 +1545,27 @@ namespace NSGuidesVML ConvertSqrt(m_lIndexDst-1, ptFormula, true, m_oGuidsRes); ConvertProd(nIndex1-3, ptFormula, nIndex1-2, ptFormula, m_lIndexDst-1, ptFormula, true, true, true, m_oGuidsRes);//r m_arIndexDst.push_back(m_lIndexDst-1); - //если точка во 2 и 3 четвертях, прибавляем по 180grad + // if the point is in quadrants 2 and 3, add 180 degrees nIndex = m_arIndexDst[m_lIndexSrc-2]; m_lIndexSrc++; ConvertIf(nIndex-3, ptFormula, 0, ptValue, 10800000, ptValue, true, true, true, m_oGuidsRes); m_arIndexDst.push_back(m_lIndexDst-1); - //угол до 1 точки (stAngle) - nIndex = m_arIndexDst[m_lIndexSrc-2];//угол между ох и радиусом - nIndex1 = m_arIndexDst[m_lIndexSrc-3];//расположение точки по четвертям - nIndex2 = m_arIndexDst[m_lIndexSrc];//прибавка 180 или 0 + // angle to point 1 (stAngle) + nIndex = m_arIndexDst[m_lIndexSrc-2];// angle between ox and radius + nIndex1 = m_arIndexDst[m_lIndexSrc-3];// point position by quadrants + nIndex2 = m_arIndexDst[m_lIndexSrc];// addition of 180 or 0 m_lIndexSrc++; - ConvertProd(nIndex1-1, ptFormula, nIndex1, ptFormula, 1, ptValue, true, true, true, m_oGuidsRes);//знак у угла + ConvertProd(nIndex1-1, ptFormula, nIndex1, ptFormula, 1, ptValue, true, true, true, m_oGuidsRes);// angle sign ConvertProd(nIndex, ptFormula, -1, ptValue, 1, ptValue, true, true, true, m_oGuidsRes); - ConvertIf(nIndex, ptFormula, nIndex, ptFormula, m_lIndexDst-1, ptFormula, true, true, true, m_oGuidsRes);//угол всегда положительный + ConvertIf(nIndex, ptFormula, nIndex, ptFormula, m_lIndexDst-1, ptFormula, true, true, true, m_oGuidsRes);// angle is always positive - ConvertProd ( m_lIndexDst-1, ptFormula, m_lIndexDst-3, ptFormula, 1, ptValue, true, true, true, m_oGuidsRes);//u с нужным знаком + ConvertProd ( m_lIndexDst-1, ptFormula, m_lIndexDst-3, ptFormula, 1, ptValue, true, true, true, m_oGuidsRes);// u with the correct sign ConvertSum ( m_lIndexDst-1, ptFormula, nIndex2, ptFormula, 0, ptValue, true, true, true, m_oGuidsRes); m_arIndexDst.push_back(m_lIndexDst-1); - //координаты стартовой точки + // start point coordinates nIndex = m_arIndexDst[m_lIndexSrc-2]; nIndex1 = m_arIndexDst[m_lIndexSrc-4]; nIndex2 = m_arIndexDst[m_lIndexSrc-5]; @@ -1576,14 +1576,14 @@ namespace NSGuidesVML ConvertSum(nIndex2-1, ptFormula, m_lIndexDst-1, ptFormula, 0, ptValue, true, true, true, m_oGuidsRes); //x ConvertProd(nIndex-6, ptFormula, -1, ptValue, 1, ptValue, true, true, true, m_oGuidsRes); - ConvertIf(nIndex-6, ptFormula, nIndex-6, ptFormula, m_lIndexDst-1, ptFormula, true, true, true, m_oGuidsRes);//sin теперь всегда>0 + ConvertIf(nIndex-6, ptFormula, nIndex-6, ptFormula, m_lIndexDst-1, ptFormula, true, true, true, m_oGuidsRes);// sin is now always > 0 ConvertProd(nIndex, ptFormula, m_lIndexDst-1, ptFormula, 1, ptValue, true, true, true, m_oGuidsRes);//r*sin ConvertProd(nIndex1, ptFormula, m_lIndexDst-1, ptFormula, 1, ptValue, true, true, true, m_oGuidsRes); ConvertSum(nIndex2, ptFormula, m_lIndexDst-1, ptFormula, 0, ptValue, true, true, true, m_oGuidsRes);//y m_arIndexDst.push_back(m_lIndexDst-1); - //рассчет для swAng--------------------------- - //расположение текущей точки по четвертям 3 4 + //calculation for swAng--------------------------- + // current point position by quadrants 3 4 // 2 1 pCurPoint = oSlice.m_arPoints[j+3]; @@ -1597,14 +1597,14 @@ namespace NSGuidesVML ConvertIf(m_lIndexDst-2, ptFormula, 1, ptValue, -1, ptValue, true, true, true, m_oGuidsRes); ConvertIf(m_lIndexDst-2, ptFormula, 1, ptValue, -1, ptValue, true, true, true, m_oGuidsRes); m_arIndexDst.push_back(m_lIndexDst-1); - //угол между Ох и радиус-вектором к точке + // angle between Ox and radius vector to the point nIndex = m_arIndexDst[m_lIndexSrc]; m_lIndexSrc++; ConvertProd(nIndex-2, ptFormula, 1, ptValue, nIndex-3, ptFormula, true, true, true, m_oGuidsRes); ConvertAt2(1, ptValue, m_lIndexDst-1, ptFormula, true, true, m_oGuidsRes); m_arIndexDst.push_back(m_lIndexDst-1); - //радиус к точке + // radius to the point nIndex = m_arIndexDst[m_lIndexSrc]; nIndex1 = m_arIndexDst[m_lIndexSrc-8]; @@ -1623,27 +1623,27 @@ namespace NSGuidesVML ConvertSqrt(m_lIndexDst-1, ptFormula, true, m_oGuidsRes); ConvertProd(nIndex1-3, ptFormula, nIndex1-2, ptFormula, m_lIndexDst-1, ptFormula, true, true, true, m_oGuidsRes); m_arIndexDst.push_back(m_lIndexDst-1); - //если точка во 2 и 3 четвертях, прибавляем по 180grad + // if the point is in quadrants 2 and 3, add 180 degrees nIndex = m_arIndexDst[m_lIndexSrc-2]; m_lIndexSrc++; ConvertIf(nIndex-3, ptFormula, 0, ptValue, 10800000, ptValue, true, true, true, m_oGuidsRes); m_arIndexDst.push_back(m_lIndexDst-1); - //угол до 2 точки - nIndex = m_arIndexDst[m_lIndexSrc-2];//угол между ох и радиусом - nIndex1 = m_arIndexDst[m_lIndexSrc-3];//расположение точки по четвертям - nIndex2 = m_arIndexDst[m_lIndexSrc];//прибавка 180 или 0 + //angle to point 2 + nIndex = m_arIndexDst[m_lIndexSrc-2];// angle between ox and radius + nIndex1 = m_arIndexDst[m_lIndexSrc-3];// point position by quadrants + nIndex2 = m_arIndexDst[m_lIndexSrc];// addition of 180 or 0 m_lIndexSrc ++; - ConvertProd(nIndex1-1, ptFormula, nIndex1, ptFormula, 1, ptValue, true, true, true, m_oGuidsRes);//знак у угла + ConvertProd(nIndex1-1, ptFormula, nIndex1, ptFormula, 1, ptValue, true, true, true, m_oGuidsRes);// angle sign ConvertProd(nIndex, ptFormula, -1, ptValue, 1, ptValue, true, true, true, m_oGuidsRes); - ConvertIf(nIndex, ptFormula, nIndex, ptFormula, m_lIndexDst-1, ptFormula, true, true, true, m_oGuidsRes);//угол всегда положительный + ConvertIf(nIndex, ptFormula, nIndex, ptFormula, m_lIndexDst-1, ptFormula, true, true, true, m_oGuidsRes);// angle is always positive - ConvertProd(m_lIndexDst-1, ptFormula, m_lIndexDst-3, ptFormula, 1, ptValue, true, true, true, m_oGuidsRes);//u с нужным знаком + ConvertProd(m_lIndexDst-1, ptFormula, m_lIndexDst-3, ptFormula, 1, ptValue, true, true, true, m_oGuidsRes);// u with the correct sign ConvertSum(m_lIndexDst-1, ptFormula, nIndex2, ptFormula, 0, ptValue, true, true, true, m_oGuidsRes); m_arIndexDst.push_back(m_lIndexDst-1); - //координаты конечной точки + //end point coordinates nIndex = m_arIndexDst[m_lIndexSrc-2]; nIndex1 = m_arIndexDst[m_lIndexSrc-4]; nIndex2 = m_arIndexDst[m_lIndexSrc-11]; @@ -1654,7 +1654,7 @@ namespace NSGuidesVML ConvertSum(nIndex2-1, ptFormula, m_lIndexDst-1, ptFormula, 0, ptValue, true, true, true, m_oGuidsRes);//x ConvertProd(nIndex-6, ptFormula, -1, ptValue, 1, ptValue, true, true, true, m_oGuidsRes); - ConvertIf(nIndex-6, ptFormula, nIndex-6, ptFormula, m_lIndexDst-1, ptFormula, true, true, true, m_oGuidsRes);//sin теперь всегда>0 + ConvertIf(nIndex-6, ptFormula, nIndex-6, ptFormula, m_lIndexDst-1, ptFormula, true, true, true, m_oGuidsRes);// sin is now always > 0 ConvertProd(nIndex, ptFormula, m_lIndexDst-1, ptFormula, 1, ptValue, true, true, true, m_oGuidsRes);//r*sin(a) ConvertProd(nIndex1, ptFormula, m_lIndexDst-1, ptFormula, 1, ptValue, true, true, true, m_oGuidsRes); @@ -1678,7 +1678,7 @@ namespace NSGuidesVML m_arIndexDst.push_back(m_lIndexDst-1); //--------------------------------------------------------- - nIndex = m_arIndexDst[m_lIndexSrc-8];//координаты стартовой точки + nIndex = m_arIndexDst[m_lIndexSrc-8];// start point coordinates nIndex1 = m_arIndexDst[m_lIndexSrc-9];//stAng nIndex2 = m_arIndexDst[m_lIndexSrc-1];//swAng @@ -1715,7 +1715,7 @@ namespace NSGuidesVML m_oPathRes.WriteString(L"\" />"); } - //текущая точка + //current point nIndex = m_arIndexDst[m_lIndexSrc-2]; ConvertVal(nIndex-5, ptFormula, true, m_oGuidsRes); ConvertVal(nIndex, ptFormula, true, m_oGuidsRes); @@ -1878,13 +1878,13 @@ namespace NSGuidesVML pCurPoint1 = oSlice.m_arPoints[j+2]; pCurPointType1 = oSlice.m_arPointsType[j+2]; - //конвертация углов в pptx формат + //converting angles to pptx format m_lIndexSrc++; - ConvertProd(pCurPoint1.x, pCurPointType1.x, pow3_16, ptValue, m_oParam.m_lParam, m_oParam.m_eType, false, true, true, m_oGuidsRes); //1 угол - ConvertProd(pCurPoint1.y, pCurPointType1.y, pow3_16, ptValue, m_oParam.m_lParam, m_oParam.m_eType, false, true, true, m_oGuidsRes); //2 угол + ConvertProd(pCurPoint1.x, pCurPointType1.x, pow3_16, ptValue, m_oParam.m_lParam, m_oParam.m_eType, false, true, true, m_oGuidsRes); //angle 1 + ConvertProd(pCurPoint1.y, pCurPointType1.y, pow3_16, ptValue, m_oParam.m_lParam, m_oParam.m_eType, false, true, true, m_oGuidsRes); //angle 2 m_arIndexDst.push_back(m_lIndexDst-1); - //wR и hR + //wR and hR nIndex = m_arIndexDst[m_lIndexSrc]; m_lIndexSrc++; @@ -1893,7 +1893,7 @@ namespace NSGuidesVML m_arIndexDst.push_back(m_lIndexDst-1); - //stAng и swAng + //stAng and swAng nIndex = m_arIndexDst[m_lIndexSrc-1]; m_lIndexSrc++; @@ -1902,7 +1902,7 @@ namespace NSGuidesVML ConvertProd(nIndex, ptFormula, -1, ptValue, 1, ptValue, true, true, true, m_oGuidsRes);//swAng m_arIndexDst.push_back(m_lIndexDst-1); - //радиус до стартовой точки + //radius to start point nIndex = m_arIndexDst[m_lIndexSrc]; //stang nIndex1 = m_arIndexDst[m_lIndexSrc-1]; //wr hr @@ -1923,9 +1923,9 @@ namespace NSGuidesVML ConvertProd(nIndex1, ptFormula, nIndex1-1, ptFormula, m_lIndexDst-1, ptFormula, true, true, true, m_oGuidsRes);//r m_arIndexDst.push_back(m_lIndexDst-1); - //координаты конечной точки (она же начальная для эллипса) + //end point coordinates (also the start point for ellipse) - pCurPoint1 = oSlice.m_arPoints[j];//коорд центра + pCurPoint1 = oSlice.m_arPoints[j];//center coordinates pCurPointType1 = oSlice.m_arPointsType[j]; nIndex = m_arIndexDst[m_lIndexSrc-1]; //stang @@ -1941,9 +1941,9 @@ namespace NSGuidesVML m_arIndexDst.push_back(m_lIndexDst-1); //--------------------- - nIndex = m_arIndexDst[m_lIndexSrc];//текущая точка - nIndex1 = m_arIndexDst[m_lIndexSrc-2];//stAng и swAng - nIndex2 = m_arIndexDst[m_lIndexSrc-3];//wR и hR + nIndex = m_arIndexDst[m_lIndexSrc];//current point + nIndex1 = m_arIndexDst[m_lIndexSrc-2];//stAng and swAng + nIndex2 = m_arIndexDst[m_lIndexSrc-3];//wR and hR if (j == 0) strFrmla = L"moveTo"; @@ -1983,7 +1983,7 @@ namespace NSGuidesVML m_oPathRes.WriteString(L"\" />"); } - //текущая точка + //current point nIndex = m_arIndexDst[m_lIndexSrc]; diff --git a/MsBinaryFile/Common/Vml/PPTShape/Ppt2PptxShapeConverter.h b/MsBinaryFile/Common/Vml/PPTShape/Ppt2PptxShapeConverter.h index 01fd1b5bda..657e439fe7 100644 --- a/MsBinaryFile/Common/Vml/PPTShape/Ppt2PptxShapeConverter.h +++ b/MsBinaryFile/Common/Vml/PPTShape/Ppt2PptxShapeConverter.h @@ -197,7 +197,7 @@ public: LONG m_lWidth; LONG m_lHeight; - // все в одно не получится, формулы появляются и при конвертации path/adj и т.д. + // can't do everything in one, formulas also appear during path/adj conversion, etc. NSBinPptxRW::CXmlWriter m_oGuidsRes; NSBinPptxRW::CXmlWriter m_oPathRes; NSBinPptxRW::CXmlWriter m_oHandleRes; diff --git a/MsBinaryFile/Common/Vml/PPTShape/PptFormula.cpp b/MsBinaryFile/Common/Vml/PPTShape/PptFormula.cpp index a79eeb2b0a..7d5bad740a 100644 --- a/MsBinaryFile/Common/Vml/PPTShape/PptFormula.cpp +++ b/MsBinaryFile/Common/Vml/PPTShape/PptFormula.cpp @@ -159,7 +159,7 @@ namespace NSGuidesVML try { - // теперь нужно просто посчитать + // now we just need to calculate switch (m_eFormulaType) { case ftSum: { dRes = a + b - c; break; } diff --git a/MsBinaryFile/Common/Vml/PPTShape/PptShape.cpp b/MsBinaryFile/Common/Vml/PPTShape/PptShape.cpp index e81eb736de..011c4723db 100644 --- a/MsBinaryFile/Common/Vml/PPTShape/PptShape.cpp +++ b/MsBinaryFile/Common/Vml/PPTShape/PptShape.cpp @@ -143,7 +143,7 @@ bool CPPTShape::LoadFromXML(XmlUtils::CXmlNode& oNodePict) return true; } bool CPPTShape::LoadFromXMLShapeType(XmlUtils::CXmlNode& oNodeShapeType) // vml object -{ // из за особенносей форматирования vmlDrawing могут вылезти пустые текстовые значения - value .. +{ // due to vmlDrawing formatting peculiarities, empty text values may appear - value.. std::wstring sId = oNodeShapeType.GetAttribute(L"o:spt"); bool bIsNeedRecalc = true; @@ -639,7 +639,7 @@ CPPTShape* CPPTShape::CreateByShapeType(DocFileFormat::ShapeType* pShapeType) pShape->LoadTextRect(pShapeType->TextBoxRectangle); } - // Handles // todooo - убрать лишнее определение Handle !!! + // Handles // todooo - remove redundant Handle definition !!! for (size_t i = 0; i < pShapeType->Handles.size(); ++i) { CHandle_ oHandle; diff --git a/MsBinaryFile/Common/Vml/PPTShape/PptShapeEnum.h b/MsBinaryFile/Common/Vml/PPTShape/PptShapeEnum.h index bab1bea202..7175ab39c1 100644 --- a/MsBinaryFile/Common/Vml/PPTShape/PptShapeEnum.h +++ b/MsBinaryFile/Common/Vml/PPTShape/PptShapeEnum.h @@ -240,7 +240,7 @@ namespace PPTShapes sptCHostControl = 201,// sptCTextBox = 202,// - //далее номеров не имеют и упорядочены по алфавиту + // the following have no numbers and are sorted alphabetically sptCChartPlus = 203, sptCChartStar, sptCChartX, diff --git a/MsBinaryFile/Common/Vml/PPTXShape/Pptx2PptShapeConverter.cpp b/MsBinaryFile/Common/Vml/PPTXShape/Pptx2PptShapeConverter.cpp index 000f166c6d..0e45272b3d 100644 --- a/MsBinaryFile/Common/Vml/PPTXShape/Pptx2PptShapeConverter.cpp +++ b/MsBinaryFile/Common/Vml/PPTXShape/Pptx2PptShapeConverter.cpp @@ -49,7 +49,7 @@ namespace NSGuidesVML ConvertGuides ( pPPTXShape->FManager.strGuides, pPPTXShape->FManager.mapGuides); ConvertPath( pPPTXShape->m_strPath, pPPTXShape->FManager.strGuides, pPPTXShape->FManager.mapGuides); - //TODO текстовые поля + //TODO text fields //ConvertTextRects ( pPPTXShape->m_arStringTextRects ); ConvertHandles ( pPPTXShape->m_arHandles ); @@ -63,7 +63,7 @@ namespace NSGuidesVML for (size_t nIndex=0; nIndex<arHnd.size(); nIndex++) { CHandle_ oHandle; - //TODO переименовать названия формул и прокинуть текстовые атрибуты topleft, rightbottom в полях хендла + //TODO rename formula names and pass text attributes topleft, rightbottom in handle fields pPPTShape->m_arHandles.push_back(oHandle); } @@ -78,8 +78,8 @@ namespace NSGuidesVML m_arMapAdj.insert(std::pair<std::wstring, LONG>(pPair->first, ++m_lIndexAdj)); pPPTShape->m_arAdjustments.push_back(arAdj[i]); } - //это аджасменты для перевода углов tan(angle, adj) - //тк все угла в формулах считаются в pptx + // these are adjustments for angle conversion tan(angle, adj) + // since all angles in formulas are calculated in pptx //pptx->ppt pPPTShape->m_arAdjustments.push_back(3114601); m_lPPTX2PPT = ++m_lIndexAdj; @@ -110,7 +110,7 @@ namespace NSGuidesVML } void CConverterPPTXPPT::AddSizeGuides (LONG lWidth, LONG lHeight) { - //TODO прокинуть w и h в формулах + //TODO pass w and h in formulas NSGuidesVML::CFormula pNewFmla3; pNewFmla3.m_eFormulaType = ftVal; pNewFmla3.m_lIndex = ++m_lIndexDst; @@ -144,7 +144,7 @@ namespace NSGuidesVML } else if (NumFmla == m_arMapFormula.end()) { - //пришло число + // a number was received if (NumGuides == mapGuides.end()) { lVal = (LONG)XmlUtils::GetInteger(strParam); @@ -163,7 +163,7 @@ namespace NSGuidesVML else eType = ptValue; } - else //пришла стандартная формула из набора, которую надо теперь добавить + else // a standard formula from the set was received, which now needs to be added { LONG lNumGuides = NumGuides->second; @@ -315,7 +315,7 @@ namespace NSGuidesVML } void CConverterPPTXPPT::ConvertGuides ( std::vector<NSGuidesOOXML::CFormula> &strGuides, std::map<std::wstring, long> &mapGuides ) { - //стандартные формулы для пптх будем добавлять, если только они встретятся + // standard formulas for pptx will be added only if they are encountered for (size_t nIndex=32; nIndex < strGuides.size(); ++nIndex) { NSGuidesOOXML::CFormula pFormula = strGuides[nIndex]; @@ -360,7 +360,7 @@ namespace NSGuidesVML XmlUtils::CXmlNode & node = listNode[i]; if(node.IsValid()) { - bool bNum = false; //управляем запятыми + bool bNum = false; // managing commas std::wstring strName = node.GetName(); if (strName == _T("moveTo")) @@ -396,7 +396,7 @@ namespace NSGuidesVML //b ConvertFmla( ftVal, lParam2, eType2); LONG lstAng = m_lIndexDst-3, lswAng = m_lIndexDst-2, la = m_lIndexDst-1, lb = m_lIndexDst; - //радиус эллипса в stAng-------------------- + // ellipse radius at stAng-------------------- //(b*cos)^2 ConvertFmla( ftCos, m_lIndexDst, ptFormula, m_lIndexDst-3, ptFormula); ConvertFmla( ftProduct, m_lIndexDst, ptFormula, m_lIndexDst, ptFormula, 1, ptValue); @@ -419,7 +419,7 @@ namespace NSGuidesVML //endAng ConvertFmla( ftSum, lstAng, ptFormula, lswAng, ptFormula, 0, ptValue); - //радиус эллипса в endAng-------------------- + // ellipse radius at endAng-------------------- //(b*cos)^2 ConvertFmla( ftCos, lb, ptFormula, m_lIndexDst, ptFormula); ConvertFmla( ftProduct, m_lIndexDst, ptFormula, m_lIndexDst, ptFormula, 1, ptValue); @@ -510,7 +510,7 @@ namespace NSGuidesVML if (NumAdj != m_arMapAdj.end()) { eType = ptAdjust; - lVal = NumAdj->second; //индекс в map ??? + lVal = NumAdj->second; // index in map ??? } else if (NumFmla == m_arMapFormula.end()) { diff --git a/MsBinaryFile/Common/Vml/PPTXShape/PptxFormula.cpp b/MsBinaryFile/Common/Vml/PPTXShape/PptxFormula.cpp index 31d0da026c..f4f1b087fd 100644 --- a/MsBinaryFile/Common/Vml/PPTXShape/PptxFormula.cpp +++ b/MsBinaryFile/Common/Vml/PPTXShape/PptxFormula.cpp @@ -126,7 +126,7 @@ namespace NSGuidesOOXML try { - // теперь нужно просто посчитать + // now we just need to calculate switch (m_eFormulaType) { case ftOOXMLSum: { dRes = a + b - c; break; } @@ -158,7 +158,7 @@ namespace NSGuidesOOXML if(m_lIndex < 0) { (*pManager->Guides)[-m_lIndex-1] = dRes; - // переопределим формулу + // redefine the formula pManager->mapGuides.insert(std::pair<std::wstring, long>(m_sName, -m_lIndex-1)); } else @@ -319,8 +319,8 @@ namespace NSGuidesOOXML return; } */ - // формулы могут повторяться!!! - // тогда по мере расчитывания они перетирают друг друга + // formulas can repeat!!! + // then as they are calculated they overwrite each other CFormula formula( -1 -(int)strGuides.size()); formula.m_sName = name; formula.FromString(fmla); diff --git a/MsBinaryFile/Common/Vml/PPTXShape/PptxShape.cpp b/MsBinaryFile/Common/Vml/PPTXShape/PptxShape.cpp index baecdf4725..8d3eab2514 100644 --- a/MsBinaryFile/Common/Vml/PPTXShape/PptxShape.cpp +++ b/MsBinaryFile/Common/Vml/PPTXShape/PptxShape.cpp @@ -166,8 +166,8 @@ bool CPPTXShape::LoadAdjustHandlesList(const std::wstring& xml) else oH.position += _T(" ") + oNodeH.GetAttribute(_T("gdRefY")); } - //TODO разобраться с полярными хендлами - //поля: + //TODO figure out polar handles + //fields: //polar = 10800, 10800 //position = gdrefR, gdrefAng (adj) //radiusrange = minR, maxR diff --git a/MsBinaryFile/Common/Vml/VmlPath.cpp b/MsBinaryFile/Common/Vml/VmlPath.cpp index 868d598814..5d2d518a97 100644 --- a/MsBinaryFile/Common/Vml/VmlPath.cpp +++ b/MsBinaryFile/Common/Vml/VmlPath.cpp @@ -279,7 +279,7 @@ namespace ODRAW { if (2 >= (nCount - nStart)) { - // по идее такого быть не может + // in theory this shouldn't happen for (size_t i = nStart; i < nCount; ++i) { oArray.push_back(arOld[i]); @@ -291,7 +291,7 @@ namespace ODRAW if (4 == (nCount - nStart)) { - // ничего не поделаешь... делаем кривую третьего порядка + // nothing we can do... making a cubic curve oArray.push_back(arOld[nStart]); oArray.push_back(arOld[nStart + 1]); oArray.push_back(arOld[nStart + 2]); @@ -301,7 +301,7 @@ namespace ODRAW break; } - // значит есть еще + // means there are more CGeomShapeInfo::CPointD mem1; mem1.dX = (arOld[nStart].dX + 2 * arOld[nStart + 1].dX) / 3.0; mem1.dY = (arOld[nStart].dY + 2 * arOld[nStart + 1].dY) / 3.0; diff --git a/MsBinaryFile/Common/Vml/toVmlConvert.cpp b/MsBinaryFile/Common/Vml/toVmlConvert.cpp index 2e21680c76..31015058fb 100644 --- a/MsBinaryFile/Common/Vml/toVmlConvert.cpp +++ b/MsBinaryFile/Common/Vml/toVmlConvert.cpp @@ -53,7 +53,7 @@ void COOXToVMLGeometry::_CStringWriter::AddSize(size_t nSize) wchar_t* pRealloc = (wchar_t*)realloc(m_pData, m_lSize * sizeof(wchar_t)); if (NULL != pRealloc) { - // реаллок сработал + // realloc succeeded m_pData = pRealloc; m_pDataCur = m_pData + m_lSizeCur; } diff --git a/MsBinaryFile/Common/Vml/toVmlConvert.h b/MsBinaryFile/Common/Vml/toVmlConvert.h index f49d93b090..d0c18f09d2 100644 --- a/MsBinaryFile/Common/Vml/toVmlConvert.h +++ b/MsBinaryFile/Common/Vml/toVmlConvert.h @@ -114,9 +114,9 @@ private: public: COOXToVMLGeometry(); virtual ~COOXToVMLGeometry(); -// тип рендерера----------------------------------------------------------------------------- +// renderer type----------------------------------------------------------------------------- virtual HRESULT get_Type(LONG* lType){ return S_OK; } -//-------- Функции для работы со страницей -------------------------------------------------- +//-------- Page functions -------------------------------------------------- virtual HRESULT NewPage(){ return S_OK; } virtual HRESULT get_Height(double* dHeight){ return S_OK; } virtual HRESULT put_Height(const double& dHeight) @@ -209,14 +209,14 @@ public: virtual HRESULT get_FontFaceIndex(int* lFaceIndex){ return S_OK; } virtual HRESULT put_FontFaceIndex(const int& lFaceIndex){ return S_OK; } -//-------- Функции для вывода текста -------------------------------------------------------- +//-------- Text output functions -------------------------------------------------------- virtual HRESULT CommandDrawTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h) { return S_OK; } virtual HRESULT CommandDrawText(const std::wstring& bsText, const double& x, const double& y, const double& w, const double& h) { return S_OK; } virtual HRESULT CommandDrawTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h) { return S_OK; } virtual HRESULT CommandDrawTextEx(const std::wstring& bsUnicodeText, const unsigned int* pGids, const unsigned int nGidsCount, const double& x, const double& y, const double& w, const double& h) { return S_OK; } -//-------- Маркеры для команд --------------------------------------------------------------- +//-------- Command markers --------------------------------------------------------------- virtual HRESULT BeginCommand(const DWORD& lType) { m_lCurrentCommandType = lType; @@ -224,7 +224,7 @@ public: } virtual HRESULT EndCommand(const DWORD& lType); -//-------- Функции для работы с Graphics Path ----------------------------------------------- +//-------- Graphics Path functions ----------------------------------------------- virtual HRESULT PathCommandMoveTo(const double& x, const double& y); virtual HRESULT PathCommandLineTo(const double& x, const double& y); virtual HRESULT PathCommandLinesTo(double* points, const int& count); @@ -243,7 +243,7 @@ public: virtual HRESULT PathCommandTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h) { return S_OK; } virtual HRESULT PathCommandTextEx(const std::wstring& sText, const unsigned int* pGids, const unsigned int nGidsCount, const double& x, const double& y, const double& w, const double& h) { return S_OK; } -//-------- Функции для вывода изображений --------------------------------------------------- +//-------- Image output functions --------------------------------------------------- virtual HRESULT DrawImage(IGrObject* pImage, const double& x, const double& y, const double& w, const double& h){ return S_OK; } virtual HRESULT DrawImageFromFile(const std::wstring&, const double& x, const double& y, const double& w, const double& h, const BYTE& lAlpha = 255){ return S_OK; } @@ -278,7 +278,7 @@ private: _CStringWriter m_oWriter; - LONG m_lCurrentCommandType; // текущая команда + LONG m_lCurrentCommandType; // current command inline void MoveTo(const double& dX, const double& dY) { @@ -330,7 +330,7 @@ private: { if (1 >= m_lCountPathCommands) { - // 2007 office имеет проблемы с путями вида moveto-close. + // 2007 office has issues with paths like moveto-close. return; } diff --git a/MsBinaryFile/DocFile/CharacterPropertiesMapping.cpp b/MsBinaryFile/DocFile/CharacterPropertiesMapping.cpp index 59cecea939..78b71c08d4 100644 --- a/MsBinaryFile/DocFile/CharacterPropertiesMapping.cpp +++ b/MsBinaryFile/DocFile/CharacterPropertiesMapping.cpp @@ -111,8 +111,8 @@ namespace DocFileFormat bool CharacterPropertiesMapping::CheckIsSymbolFont() { - //Todo сделать определение симольного шрифта через fontManager - //Заглушка под Google Docs, они пишут bullet в Arial + //Todo implement symbol font detection via fontManager + //Workaround for Google Docs, they write bullet in Arial const std::wstring* fonts[] = {&m_sAsciiFont, &m_sEastAsiaFont, &m_shAnsiFont}; for (const auto& pFont : fonts) { @@ -486,7 +486,7 @@ namespace DocFileFormat std::map<int, int>::iterator it = _doc->PictureBulletsCPsMap.find(nIndex); if (it != _doc->PictureBulletsCPsMap.end()) { - //добавить + //add } } }break; diff --git a/MsBinaryFile/DocFile/DocumentMapping.cpp b/MsBinaryFile/DocFile/DocumentMapping.cpp index 85872cb45a..3cb6dc2e87 100644 --- a/MsBinaryFile/DocFile/DocumentMapping.cpp +++ b/MsBinaryFile/DocFile/DocumentMapping.cpp @@ -168,7 +168,7 @@ namespace DocFileFormat } else { - // -1 //че-нить в лог написать + // -1 //write something to log }*/ oldElem = currentFc; @@ -336,7 +336,7 @@ namespace DocFileFormat } } - if ((chpxs != NULL) && (chpxFcs != NULL) && !chpxFcs->empty())//? второе + if ((chpxs != NULL) && (chpxFcs != NULL) && !chpxFcs->empty())//? the second { size_t i = 0; @@ -361,7 +361,7 @@ namespace DocFileFormat //it's the last chpx and it exceeds the paragraph - if ( ( i == ( chpxs->size() - 1 ) ) && ( fcChpxEnd > fcEnd ) )//todooo убрать обращение к size() !!! + if ( ( i == ( chpxs->size() - 1 ) ) && ( fcChpxEnd > fcEnd ) )//todooo remove call to size() !!! { //so use the FC of the paragraph fcChpxEnd = fcEnd; @@ -831,7 +831,7 @@ namespace DocFileFormat if (!oVmlMapper.m_isEmbedded && oVmlMapper.m_isEquation) { - //нельзя в Run писать oMath + //cannot write oMath inside Run //m_pXmlWriter->WriteString(oVmlMapper.m_equationXml); _writeAfterRun = oVmlMapper.m_equationXml; } @@ -910,7 +910,7 @@ namespace DocFileFormat } } XMLTools::XMLElement elem(L"w:br"); - //СЗ в МРФ Техноград о предоставлении ТП 1 квартал 2019_MO_Q31.doc + //test files: СЗ в МРФ Техноград о предоставлении ТП 1 квартал 2019_MO_Q31.doc //Документ на бланке 2.doc elem.AppendAttribute(L"w:type", L"textWrapping"); elem.AppendAttribute(L"w:clear", L"all"); @@ -1015,7 +1015,7 @@ namespace DocFileFormat //<w:sym w:font="Symbol" w:char="F062"/> - if (false == s.HexValue.empty()) //09FluGuide.doc - поврежденный + if (false == s.HexValue.empty()) //09FluGuide.doc - corrupted { m_pXmlWriter->WriteNodeBegin(L"w:sym", true); if (false == s.FontName.empty()) // ??? default @@ -1097,7 +1097,7 @@ namespace DocFileFormat if (oPicture.shapeContainer) { if (oPicture.shapeContainer->m_nShapeType != msosptPictureFrame) - bPicture = false;//шаблон 1.doc картинка в колонтитуле + bPicture = false;//template 1.doc image in header/footer m_bSkip = oPicture.shapeContainer->m_bSkip; } @@ -1125,7 +1125,7 @@ namespace DocFileFormat } else if (oVmlMapper.m_isEquation) { - //нельзя в Run писать oMath + //cannot write oMath inside Run //m_pXmlWriter->WriteString(oVmlMapper.m_equationXml); _writeAfterRun = oVmlMapper.m_equationXml; bFormula = true; @@ -1225,7 +1225,7 @@ namespace DocFileFormat cp++; } if (std::wstring::npos != text.find(L"EMBED")) - {//если есть мааркер конца поля и маркер замещающей картинки и нету маркера начала + {//if there is field end marker and substitute image marker but no start marker //О реорганизации территориальных органов ПФР с 01.11.2018.doc int cpFieldStart = initialCp; int cpPic = searchNextTextMark(m_document->Text, cpFieldStart, TextMark::Picture); diff --git a/MsBinaryFile/DocFile/DocumentProperties.cpp b/MsBinaryFile/DocFile/DocumentProperties.cpp index 8b5c19185b..b174418a5b 100644 --- a/MsBinaryFile/DocFile/DocumentProperties.cpp +++ b/MsBinaryFile/DocFile/DocumentProperties.cpp @@ -821,4 +821,4 @@ namespace DocFileFormat ilfoMacAtCleanup = 0; } } -//кодировка 1251 +//encoding 1251 diff --git a/MsBinaryFile/DocFile/FontFamilyName.cpp b/MsBinaryFile/DocFile/FontFamilyName.cpp index dddd952668..56280594b3 100644 --- a/MsBinaryFile/DocFile/FontFamilyName.cpp +++ b/MsBinaryFile/DocFile/FontFamilyName.cpp @@ -70,7 +70,7 @@ namespace DocFileFormat newObject->fTrueType = FormatUtils::BitmaskToBool ( ffid, 0x04 ); newObject->ff = (unsigned char) FormatUtils::BitmaskToInt ( ffid, 0x70 ); - //int sz_fonts = 150; //.. нужно генерить уникальное todooo + //int sz_fonts = 150; //.. need to generate unique todooo int szAlt = 0; if (reader->nWordVersion == 2) { diff --git a/MsBinaryFile/DocFile/FormattedDiskPageCHPX.cpp b/MsBinaryFile/DocFile/FormattedDiskPageCHPX.cpp index 61224cc968..882c7f1d03 100644 --- a/MsBinaryFile/DocFile/FormattedDiskPageCHPX.cpp +++ b/MsBinaryFile/DocFile/FormattedDiskPageCHPX.cpp @@ -149,7 +149,7 @@ namespace DocFileFormat int start_chpx = 8; if (fib->m_FibWord97.lcbPlcfBteChpx - 8 > (n - 1) * 4) { - start_chpx += ((n-1) * 4); //дублирование crun + start_chpx += ((n-1) * 4); //crun duplication } //Get the indexed CHPX FKPs diff --git a/MsBinaryFile/DocFile/FormattedDiskPagePAPX.cpp b/MsBinaryFile/DocFile/FormattedDiskPagePAPX.cpp index 29120f3ea9..f29ff58db2 100644 --- a/MsBinaryFile/DocFile/FormattedDiskPagePAPX.cpp +++ b/MsBinaryFile/DocFile/FormattedDiskPagePAPX.cpp @@ -189,7 +189,7 @@ namespace DocFileFormat int start_papx = 8; if (fib->m_FibWord97.lcbPlcfBtePapx - 8 > (n - 1) * 4) { - start_papx += ((n - 1) * 4); //дублирование crun + start_papx += ((n - 1) * 4); //crun duplication } int offset = 0; diff --git a/MsBinaryFile/DocFile/Global.h b/MsBinaryFile/DocFile/Global.h index 0bf5b5e0f1..47d74d1522 100644 --- a/MsBinaryFile/DocFile/Global.h +++ b/MsBinaryFile/DocFile/Global.h @@ -259,7 +259,7 @@ namespace Global { L"lrTb", L"tbRl", - L"lrTb",//его на самом деле нету (2.9.323 TextFlow) + L"lrTb",//it actually doesn't exist (2.9.323 TextFlow) L"btLr", L"lrTbV", L"tbRlV", diff --git a/MsBinaryFile/DocFile/NumberingMapping.cpp b/MsBinaryFile/DocFile/NumberingMapping.cpp index 943ef0cfec..549dd19d13 100644 --- a/MsBinaryFile/DocFile/NumberingMapping.cpp +++ b/MsBinaryFile/DocFile/NumberingMapping.cpp @@ -134,7 +134,7 @@ namespace DocFileFormat //end abstractNum m_pXmlWriter->WriteNodeEnd( L"w:abstractNum" ); } - //write old style numbering (сложносоставных не сущестует) + //write old style numbering (compound numbering does not exist) for (size_t i = 0; i < rglst->listNumbering.size(); ++i) { //start abstractNum @@ -253,7 +253,7 @@ namespace DocFileFormat { wchar_t xchBullet = lvl->xst[0]; - // В символьном шрифте обрезать надо, в других случаях - нет + // In symbol font need to truncate, in other cases - no if (true == bIsSymbol && (xchBullet & 0xF000) != 0) { xchBullet &= 0x0FFF; @@ -306,7 +306,7 @@ namespace DocFileFormat { wchar_t xchBullet = lvl->xst[0]; - // В символьном шрифте обрезать надо, в других случаях - нет + // In symbol font need to truncate, in other cases - no if (bIsSymbol && (xchBullet & 0xF000) != 0) { xchBullet &= 0x0FFF; @@ -565,13 +565,13 @@ namespace DocFileFormat { if (!lvl) return; - XMLTools::CStringXmlWriter oWriterTemp; //Временный writer,что не нарушать последовательность записи + XMLTools::CStringXmlWriter oWriterTemp; //Temporary writer to not break the write sequence //rPr RevisionData rev(lvl->grpprlChpx); CharacterPropertiesMapping cpMapping(&oWriterTemp, m_document, &rev, lvl->grpprlPapx, false); lvl->grpprlChpx->Convert(&cpMapping); -// Проверяем шрифт +// Check font m_pXmlWriter->WriteNodeBegin( L"w:lvl", TRUE ); m_pXmlWriter->WriteAttribute( L"w:ilvl", FormatUtils::IntToWideString(level)); @@ -630,7 +630,7 @@ namespace DocFileFormat ParagraphPropertiesMapping oppMapping(m_pXmlWriter, m_context, m_document, NULL, isBidi, NULL, -1, false); lvl->grpprlPapx->Convert(&oppMapping); -// пишем rPr +// write rPr m_pXmlWriter->WriteString(oWriterTemp.GetXmlString()); diff --git a/MsBinaryFile/DocFile/OfficeDrawing/RecordFactory.cpp b/MsBinaryFile/DocFile/OfficeDrawing/RecordFactory.cpp index f5bfbd7a4c..8dd4b0fc38 100644 --- a/MsBinaryFile/DocFile/OfficeDrawing/RecordFactory.cpp +++ b/MsBinaryFile/DocFile/OfficeDrawing/RecordFactory.cpp @@ -69,7 +69,7 @@ namespace DocFileFormat bool isContainer = ( version == 0xF ); - if (typeCode == 0x01f6) return NULL; //орг диаграмм + if (typeCode == 0x01f6) return NULL; //org diagrams Record* pRecord = NewRecord (typeCode); if (pRecord) diff --git a/MsBinaryFile/DocFile/OfficeDrawing/ShapeOptions.h b/MsBinaryFile/DocFile/OfficeDrawing/ShapeOptions.h index 8ce0f87ed7..125ec06642 100644 --- a/MsBinaryFile/DocFile/OfficeDrawing/ShapeOptions.h +++ b/MsBinaryFile/DocFile/OfficeDrawing/ShapeOptions.h @@ -36,7 +36,7 @@ namespace DocFileFormat { - //!!!TODO: Реальные значения не соответствуют значениям из спецификации!!! + //!!!TODO: Actual values do not match the specification values!!! typedef enum _PositionHorizontal { //msophAbs = 0x1, @@ -55,7 +55,7 @@ namespace DocFileFormat msoprhChar } PositionHorizontalRelative; - //!!!TODO: Реальные значения не соответствуют значениям из спецификации!!! + //!!!TODO: Actual values do not match the specification values!!! typedef enum _PositionVertical { //msopvAbs = 0x1, diff --git a/MsBinaryFile/DocFile/OfficeDrawing/Shapetypes/ArrowType.h b/MsBinaryFile/DocFile/OfficeDrawing/Shapetypes/ArrowType.h index 5dfb2f7688..27145ec447 100644 --- a/MsBinaryFile/DocFile/OfficeDrawing/Shapetypes/ArrowType.h +++ b/MsBinaryFile/DocFile/OfficeDrawing/Shapetypes/ArrowType.h @@ -354,7 +354,7 @@ namespace DocFileFormat } }; - class BentArrow : public ShapeType // фигура превращается не имеет точек изменения + class BentArrow : public ShapeType // shape transforms has no adjustment points { public: BentArrow () : ShapeType(msosptBentArrow) @@ -1340,7 +1340,7 @@ namespace DocFileFormat } }; - class CircularArrow : public ShapeType // фигура превращается не имеет точек изменения + class CircularArrow : public ShapeType // shape transforms has no adjustment points { public: CircularArrow () : ShapeType(msosptCircularArrow) diff --git a/MsBinaryFile/DocFile/ParagraphPropertiesMapping.cpp b/MsBinaryFile/DocFile/ParagraphPropertiesMapping.cpp index 5dbdaf81fb..417336c160 100644 --- a/MsBinaryFile/DocFile/ParagraphPropertiesMapping.cpp +++ b/MsBinaryFile/DocFile/ParagraphPropertiesMapping.cpp @@ -461,7 +461,7 @@ namespace DocFileFormat case sprmPIlfo: { - //Если numbering.xml пустой, то не пищем свойство + //If numbering.xml is empty, do not write the property if (NULL != m_document->listTable && false == m_document->listTable->listData.empty()) { unsigned short numId = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize ); @@ -668,7 +668,7 @@ namespace DocFileFormat if (sectionPropertiesMapping->get_section_type() == L"nextPage") { - //в этом параграфе уже есть разрыв страницы - br на page не нужен + //this paragraph already has a page break - br to page is not needed //Vinci_Customer_Case_Study.doc _isSectionPageBreak = 1; } diff --git a/MsBinaryFile/DocFile/PictureDescriptor.cpp b/MsBinaryFile/DocFile/PictureDescriptor.cpp index af401e075d..5fe3cf8736 100644 --- a/MsBinaryFile/DocFile/PictureDescriptor.cpp +++ b/MsBinaryFile/DocFile/PictureDescriptor.cpp @@ -75,7 +75,7 @@ namespace ImageHelper //if (header_core->bcWidth % 2 != 0 && sz_bitmap < size - offset) // header_core->bcWidth++; - ///???? todooo непонятно .. в biff5 нужно флипать картинку, в biff8 не ясно ( - + ///???? todooo unclear .. in biff5 need to flip image, in biff8 unclear ( - int stride = -(size - offset) / header_core->bcHeight; oFrame.put_Stride (stride/*header_core->bcBitCount * header_core->bcWidth /8 */); @@ -215,7 +215,7 @@ namespace DocFileFormat if (lcb > 10000000) return; - if (lcb > sz && sz != 1 && sz != 2) //bullet picture с неверным размером + if (lcb > sz && sz != 1 && sz != 2) //bullet picture with incorrect size { unsigned char* bytes = reader.ReadBytes(sz - fc - 4, false); if ( bytes ) diff --git a/MsBinaryFile/DocFile/PieceTable.cpp b/MsBinaryFile/DocFile/PieceTable.cpp index 62e85ba31d..08092508e4 100644 --- a/MsBinaryFile/DocFile/PieceTable.cpp +++ b/MsBinaryFile/DocFile/PieceTable.cpp @@ -446,7 +446,7 @@ namespace DocFileFormat } else if (fcEnd < (int)pcd.fc) // this piece is beyond the requested range { - // имеет место быть перескок по стриму, поэтому корректируем начальную позицию + // there is a stream jump, so we adjust the start position //size_t count = encodingChars->size(); //if (count && fcSize > 0) diff --git a/MsBinaryFile/DocFile/SectionPropertiesMapping.cpp b/MsBinaryFile/DocFile/SectionPropertiesMapping.cpp index 8ec7e2ca88..39530eea1f 100644 --- a/MsBinaryFile/DocFile/SectionPropertiesMapping.cpp +++ b/MsBinaryFile/DocFile/SectionPropertiesMapping.cpp @@ -160,7 +160,7 @@ namespace DocFileFormat } } - //MUST be ignored if the section does not have page number restart enabled.([MS-DOC] — v20101113. стр 152) + //MUST be ignored if the section does not have page number restart enabled.([MS-DOC] - v20101113. p.152) bool bWasSprmSFPgnRestart = false; std::wstring wsSprmSPgnStart; int nProperty = 0; // for unknown diff --git a/MsBinaryFile/DocFile/ShadingDescriptor.cpp b/MsBinaryFile/DocFile/ShadingDescriptor.cpp index 0d7f9cb92c..928cfbe8c2 100644 --- a/MsBinaryFile/DocFile/ShadingDescriptor.cpp +++ b/MsBinaryFile/DocFile/ShadingDescriptor.cpp @@ -139,7 +139,7 @@ namespace DocFileFormat else if (0x0F == icoBack) { cvBack = RGB2 (0x80, 0x80, 0x80); } else if (0x10 == icoBack) { cvBack = RGB2 (0xC0, 0xC0, 0xC0); } - // .... если будут документы с такими цветовыми палитрами + // .... if there are documents with such color palettes //if ((cvFore == 0) && (icoFore == 0x0) && (cvBack == 0) && (icoBack == 0x0) && (ipat == Automatic)) //{ diff --git a/MsBinaryFile/DocFile/SinglePropertyModifier.cpp b/MsBinaryFile/DocFile/SinglePropertyModifier.cpp index f5a1b78bd6..6e17f2d6c3 100644 --- a/MsBinaryFile/DocFile/SinglePropertyModifier.cpp +++ b/MsBinaryFile/DocFile/SinglePropertyModifier.cpp @@ -59,7 +59,7 @@ namespace DocFileFormat if (OpCode == 0 && size == 4) { - //так записывается rgb цвет ( + //this is how rgb color is written ( OpCode = sprmCCv; opSize = 3; } diff --git a/MsBinaryFile/DocFile/TableCellPropertiesMapping.cpp b/MsBinaryFile/DocFile/TableCellPropertiesMapping.cpp index db5fe6c953..a6e0284d09 100644 --- a/MsBinaryFile/DocFile/TableCellPropertiesMapping.cpp +++ b/MsBinaryFile/DocFile/TableCellPropertiesMapping.cpp @@ -236,7 +236,7 @@ namespace DocFileFormat break; case sprmTDefTableShd80: { - if (!tapx->IsSkipShading97()) // если такой операнд единственный то учитываем его, иначе скипаем его + if (!tapx->IsSkipShading97()) // if this operand is the only one, take it into account, otherwise skip it { apppendCellShading(iter->Arguments, iter->argumentsSize, _cellIndex); } diff --git a/MsBinaryFile/DocFile/TablePropertyExceptions.h b/MsBinaryFile/DocFile/TablePropertyExceptions.h index e818e92186..ae6c9a9d94 100644 --- a/MsBinaryFile/DocFile/TablePropertyExceptions.h +++ b/MsBinaryFile/DocFile/TablePropertyExceptions.h @@ -54,6 +54,6 @@ namespace DocFileFormat } private: - bool m_bSkipShading97; // пропускать правило от Word97 + bool m_bSkipShading97; // skip Word97 rule }; } diff --git a/MsBinaryFile/DocFile/Tbkd.h b/MsBinaryFile/DocFile/Tbkd.h index 23ec0ac8a8..03787a5596 100644 --- a/MsBinaryFile/DocFile/Tbkd.h +++ b/MsBinaryFile/DocFile/Tbkd.h @@ -97,7 +97,7 @@ namespace DocFileFormat int reusable01; int reusable02; - short fReusable; // ставим в 0 потому что один TbRef привязан к одному элементу + short fReusable; // set to 0 because one TbRef is bound to one element int itxbxsDest; // This field MUST be ignored. int lid; diff --git a/MsBinaryFile/DocFile/VMLPictureMapping.cpp b/MsBinaryFile/DocFile/VMLPictureMapping.cpp index b4dcb13952..03b20a24c8 100644 --- a/MsBinaryFile/DocFile/VMLPictureMapping.cpp +++ b/MsBinaryFile/DocFile/VMLPictureMapping.cpp @@ -301,7 +301,7 @@ namespace DocFileFormat } m_pXmlWriter->WriteNodeBegin(L"v:shape", true); - //m_shapeId = GetShapeID(pShape); - todooo одинаковые картинки (одинаковый spid) - Anexo№3.doc + //m_shapeId = GetShapeID(pShape); - todooo identical images (same spid) - Anexo№3.doc if (m_shapeId.empty()) @@ -314,7 +314,7 @@ namespace DocFileFormat m_pXmlWriter->WriteAttribute(L"type", std::wstring(L"#" + VMLShapeTypeMapping::GenerateTypeId(&type))); - //todooo oбъединить с shape_mapping + //todooo merge with shape_mapping int nColorRGBBase = 0xffffff; for (size_t i = 0; i < options.size(); i++) @@ -339,7 +339,7 @@ namespace DocFileFormat } }break; case ODRAW::metroBlob: - {//встроенная неведомая хуйня + {//embedded unknown data ODRAW::MetroBlob* blob = dynamic_cast<ODRAW::MetroBlob*>(iter.get()); if (blob) { diff --git a/MsBinaryFile/DocFile/VMLShapeMapping.cpp b/MsBinaryFile/DocFile/VMLShapeMapping.cpp index 896e0b742e..4783fadceb 100644 --- a/MsBinaryFile/DocFile/VMLShapeMapping.cpp +++ b/MsBinaryFile/DocFile/VMLShapeMapping.cpp @@ -911,14 +911,14 @@ namespace DocFileFormat switch (iter->op) { case 0: - case 4://обычный + case 4://normal break; case 1: case 3: - case 5://верт (склони голову направо) + case 5://vertical (tilt head right) appendStyleProperty(sTextboxStyle, L"layout-flow", L"vertical"); break; - case 2://верт (склони голову налево) + case 2://vertical (tilt head left) appendStyleProperty(sTextboxStyle, L"layout-flow", L"vertical"); appendStyleProperty(sTextboxStyle, L"mso-layout-flow-alt", L"bottom-to-top"); break; @@ -1195,7 +1195,7 @@ namespace DocFileFormat { if (b3D) { - appendValueAttribute(&m_3dstyle, L"v:ext", L"view" ); //??? вытащить + appendValueAttribute(&m_3dstyle, L"v:ext", L"view" ); //??? extract } appendValueAttribute(&m_3dstyle, L"on", b3D ? L"t" : L"f" ); m_pXmlWriter->WriteString(m_3dstyle.GetXMLString()); @@ -1412,8 +1412,8 @@ namespace DocFileFormat std::wstring VMLShapeMapping::GetLineFrom(const ChildAnchor* pAnchor, bool twistDimensions) const { - //Если линия находится в группе, то координаты должны быть в Twips - //Если линия находится в группе, то координаты должны быть в других единицах измерения (например в twips) + //If line is in a group, coordinates must be in Twips + //If line is in a group, coordinates must be in other units of measurement (e.g. twips) std::wstring strXmlFrom; @@ -1457,7 +1457,7 @@ namespace DocFileFormat std::wstring VMLShapeMapping::GetLineTo(const ChildAnchor* pAnchor, bool twistDimensions) const { - //Если линия находится в группе, то координаты должны быть в других единицах измерения (например в twips) + //If line is in a group, coordinates must be in other units of measurement (e.g. twips) std::wstring strXmlTo; @@ -1580,7 +1580,7 @@ namespace DocFileFormat boost::shared_array<unsigned char>(pData), nData, oBlip->btWin32)); result = true; break; - }//в случае ошибки конвертации -храним оригинальный dib + }//in case of conversion error - keep original dib } m_context->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(oBlip->btWin32), bitBlip->m_pvBits, bitBlip->pvBitsSize, oBlip->btWin32)); @@ -1882,10 +1882,10 @@ namespace DocFileFormat if (booleans->fUsefBehindDocument && booleans->fBehindDocument) { - //за текстом (The shape is behind the text, so the z-index must be negative.) + //behind text (The shape is behind the text, so the z-index must be negative.) m_isInlineShape = false; - if (false == bZIndex/* && false == m_inGroup*/) // Пример.doc + if (false == bZIndex/* && false == m_inGroup*/) // Example.doc { appendStyleProperty(oStyle, L"z-index", FormatUtils::IntToWideString(-zIndex - 0x7ffff)); bZIndex = true; @@ -2060,7 +2060,7 @@ namespace DocFileFormat } else { - //если не написать тип позиции, то будет inline + //if position type is not specified, it will be inline if ( anchor != NULL ) { appendStylePropertyFirst( style, L"position", L"absolute" ); @@ -2068,7 +2068,7 @@ namespace DocFileFormat else if (m_pSpa) { //append size and position ... - //if (m_pSpa->fAnchorLock)//это возможность смены привязки , а не ее тип + //if (m_pSpa->fAnchorLock)//this is anchor change capability, not its type if (m_isInlineShape)/*m_pSpa->bx == TEXT && m_pSpa->by == TEXT*/ { @@ -2351,13 +2351,13 @@ namespace DocFileFormat DrawingPrimitiveCTextBox * callout = dynamic_cast<DrawingPrimitiveCTextBox *>(primitive); if ((callout) && (callout->txbx)) { - //временно обычный текстбокс + //temporarily regular textbox callout->txbx->xa += callout->xa; callout->txbx->ya += callout->ya; WritePrimitiveProps(dynamic_cast<DrawingPrimitive*>(callout->txbx), (index==0?true:false)); } - //todooo нарисовать кастомный шейп + //todooo draw custom shape } else WritePrimitiveProps(primitive, (index==0?true:false)); diff --git a/MsBinaryFile/DocFile/VMLShapeTypeMapping.cpp b/MsBinaryFile/DocFile/VMLShapeTypeMapping.cpp index ce2f2d03d1..0c18a0d960 100644 --- a/MsBinaryFile/DocFile/VMLShapeTypeMapping.cpp +++ b/MsBinaryFile/DocFile/VMLShapeTypeMapping.cpp @@ -94,7 +94,7 @@ namespace DocFileFormat m_pXmlWriter->WriteAttribute( L"o:preferrelative", L"t"); } - m_pXmlWriter->WriteNodeEnd( L"", true, false );//закрытие атрибутов + m_pXmlWriter->WriteNodeEnd( L"", true, false );//closing attributes //Textpath if (!pShape->Textpath.empty()) diff --git a/MsBinaryFile/DocFile/WordDocument.cpp b/MsBinaryFile/DocFile/WordDocument.cpp index 9053894f0a..c2b0abf3fe 100644 --- a/MsBinaryFile/DocFile/WordDocument.cpp +++ b/MsBinaryFile/DocFile/WordDocument.cpp @@ -407,7 +407,7 @@ namespace DocFileFormat BookmarkFirst* pBookmark = static_cast<BookmarkFirst*>(AnnotStartPlex->Elements[i]); if (pBookmark) { - short bmc = *((short*)bookmarks[i]); //0x0100 always тут + short bmc = *((short*)bookmarks[i]); //0x0100 always here _UINT32 lTag = *((_UINT32*)(bookmarks[i] + 2)); if (i < AnnotStartPlex->CharacterPositions.size() - 1 ) diff --git a/MsBinaryFile/PptFile/Drawing/Animations.h b/MsBinaryFile/PptFile/Drawing/Animations.h index f1fe9104c5..a0e84f928b 100644 --- a/MsBinaryFile/PptFile/Drawing/Animations.h +++ b/MsBinaryFile/PptFile/Drawing/Animations.h @@ -399,11 +399,11 @@ namespace PPT // { // Effect.Format ( L"<animateRotate %s />"), FormatXml ()); // } - // else if (9 == pEffect->m_nEffectID || 35 == pEffect->m_nEffectID) // Blink - 36 - мигание + // else if (9 == pEffect->m_nEffectID || 35 == pEffect->m_nEffectID) // Blink - 36 - blinking // { // Effect.Format ( L"<animateAlpha %s />"), FormatXml ()); // } - // else if (26 == pEffect->m_nEffectID) // FlashBulb Effect ( Пульсация ) + // else if (26 == pEffect->m_nEffectID) // FlashBulb Effect ( Pulsation ) // { // Effect.Format ( L"<animateAlpha %s />"), FormatXml ()); // Source += Effect; @@ -413,7 +413,7 @@ namespace PPT // continue; // } - // else if (27 == pEffect->m_nEffectID // Flicker (÷ветовая пульсация) + // else if (27 == pEffect->m_nEffectID // Flicker (color pulsation) // || 1 == pEffect->m_nEffectID // ChangeFillColor - fill color // || 3 == pEffect->m_nEffectID // ChangeFillColor - font color // || 7 == pEffect->m_nEffectID // ChangeFillColor - fill lines diff --git a/MsBinaryFile/PptFile/Drawing/AudioOverlay.h b/MsBinaryFile/PptFile/Drawing/AudioOverlay.h index 7cf6cafaa8..1e933eeeb9 100644 --- a/MsBinaryFile/PptFile/Drawing/AudioOverlay.h +++ b/MsBinaryFile/PptFile/Drawing/AudioOverlay.h @@ -184,7 +184,7 @@ namespace PPT { size_t nCount = m_arParts.size(); - // нормализуем для начала + // normalize first for (size_t i = 0; i < nCount; ++i) { CAudioPart* pPart = &m_arParts[i]; @@ -205,7 +205,7 @@ namespace PPT } } - // пересчет + // recalculation for (size_t i = 0; i < nCount; ++i) { CAudioPart* pPart = &m_arParts[i]; @@ -214,7 +214,7 @@ namespace PPT { if (pPart->m_bStop) { - // нужно остановить всю музыку до этого + // need to stop all music before this for (size_t j = 0; j < nCount; ++j) { if (j == i) @@ -229,7 +229,7 @@ namespace PPT } if (pPart->m_bLoop) { - // зацикливаем до первого встречания аудио + // loop until the first audio encounter double dMin = m_dAllDuration; for (size_t j = 0; j < nCount; ++j) diff --git a/MsBinaryFile/PptFile/Drawing/Document.h b/MsBinaryFile/PptFile/Drawing/Document.h index 62a5c11fbf..f57f0abe2e 100644 --- a/MsBinaryFile/PptFile/Drawing/Document.h +++ b/MsBinaryFile/PptFile/Drawing/Document.h @@ -117,7 +117,7 @@ public: if (NULL != pAudioElem) { - // а другого и быть не может + // and there can be no other if (pAudioElem->m_bWithVideo) { pElement->m_dStartTime = dStartTime; @@ -181,7 +181,7 @@ public: void CalculateEditor(bool bIsPlaceholderSetUp = false) { - // автозамены и поля настраиваем тут во избежания путаницы + // we configure auto-replacements and fields here to avoid confusion size_t nCountThemes = m_arThemes.size(); for (size_t i = 0; i < nCountThemes; ++i) diff --git a/MsBinaryFile/PptFile/Drawing/Element.h b/MsBinaryFile/PptFile/Drawing/Element.h index 3ca24b614a..809a00aeee 100644 --- a/MsBinaryFile/PptFile/Drawing/Element.h +++ b/MsBinaryFile/PptFile/Drawing/Element.h @@ -95,9 +95,9 @@ public: int m_lPlaceholderUserStr; int m_nFormatDate; - double m_dRotate; // угол поворота в градусах - bool m_bFlipH; // симметричное отражение относительно горизонтальной оси - bool m_bFlipV; // симметричное отражение относительно вертикальной оси + double m_dRotate; // rotation angle in degrees + bool m_bFlipH; // symmetric reflection about horizontal axis + bool m_bFlipV; // symmetric reflection about vertical axis bool m_bLine; bool m_bIsFilled; diff --git a/MsBinaryFile/PptFile/Drawing/Elements.cpp b/MsBinaryFile/PptFile/Drawing/Elements.cpp index bcbae43ce2..7711da9d49 100644 --- a/MsBinaryFile/PptFile/Drawing/Elements.cpp +++ b/MsBinaryFile/PptFile/Drawing/Elements.cpp @@ -149,9 +149,9 @@ bool PPT::CShapeElement::SetUpTextPlaceholder(std::wstring newText) bool result = false; PPT::CTextAttributesEx* pText = &m_pShape->m_oText; - for (size_t p = 0; p < pText->m_arParagraphs.size(); p++) //тут по всем -> 1-(33).ppt + for (size_t p = 0; p < pText->m_arParagraphs.size(); p++) // here for all -> 1-(33).ppt { - if (pText->m_arParagraphs[p].m_arSpans.size() > 0)//??? по всем? + if (pText->m_arParagraphs[p].m_arSpans.size() > 0)//??? for all? { int pos = (int)pText->m_arParagraphs[p].m_arSpans[0].m_strText.find(L"*"); @@ -372,7 +372,7 @@ namespace PPT CPPTShape* pPPTShape = dynamic_cast<CPPTShape*>(m_pShape->getBaseShape().get()); if (NULL == pPPTShape) { - // такого быть не может + // this cannot happen return L""; } diff --git a/MsBinaryFile/PptFile/Drawing/Layout.cpp b/MsBinaryFile/PptFile/Drawing/Layout.cpp index e8a11daac1..f42aa152d9 100644 --- a/MsBinaryFile/PptFile/Drawing/Layout.cpp +++ b/MsBinaryFile/PptFile/Drawing/Layout.cpp @@ -101,7 +101,7 @@ void PPT::CLayout::Clear() void PPT::CLayout::CreateDublicateElements() { - // просто из всех своих элементов делаем дубликата + // simply make duplicates of all our elements for (size_t nIndex = 0; nIndex < m_arElements.size(); ++nIndex) { diff --git a/MsBinaryFile/PptFile/Drawing/Metric.h b/MsBinaryFile/PptFile/Drawing/Metric.h index 065a8fd070..735f6bf897 100644 --- a/MsBinaryFile/PptFile/Drawing/Metric.h +++ b/MsBinaryFile/PptFile/Drawing/Metric.h @@ -136,7 +136,7 @@ namespace ODRAW double m_dLimoX; double m_dLimoY; - // нужен для регулировки по аспекту (limo) + // needed for aspect ratio adjustment (limo) CPointD m_oCurPoint; double m_dRotate; diff --git a/MsBinaryFile/PptFile/Drawing/Shapes/Shape.h b/MsBinaryFile/PptFile/Drawing/Shapes/Shape.h index 552b857c5e..ac54cdde78 100644 --- a/MsBinaryFile/PptFile/Drawing/Shapes/Shape.h +++ b/MsBinaryFile/PptFile/Drawing/Shapes/Shape.h @@ -37,10 +37,10 @@ #include "../../../Common/Vml/PPTShape/PptShape.h" /*************************************************************** -вот, создавая автофигуру, или любой другой элемент -officedrawing, наследуясь от этого класса, в конструкторе -задаем все строковые параметры, и вызываем SetProperties, -которые придут, или NULL, но вызов этой функции - ОБяЗАTЕЛЕН!!! +when creating an autoshape, or any other element +officedrawing, inheriting from this class, in the constructor +we set all string parameters, and call SetProperties, +which will come, or NULL, but calling this function is MANDATORY!!! ****************************************************************/ const LONG c_ShapeDrawType_Graphic = 0x01; @@ -71,7 +71,7 @@ public: double m_dXLogic; double m_dYLogic; - /* в миллиметрах!!! */ + /* in millimeters!!! */ double m_dTextMarginX; double m_dTextMarginY; double m_dTextMarginRight; @@ -186,7 +186,7 @@ public: //m_oPen.SetToRenderer(pRenderer); //m_oBrush.SetToRenderer(pRenderer); //m_oShadow.SetToRenderer(pRenderer); - CBrush brush; //копии с уровня выше нужны + CBrush brush; // copies from level above are needed CPen pen; m_pShape->ToRenderer(pRenderer, oGeomInfo, dStartTime, dEndTime, pen, brush); diff --git a/MsBinaryFile/PptFile/Drawing/SlideShow.h b/MsBinaryFile/PptFile/Drawing/SlideShow.h index da032052cb..23e5d1c0e2 100644 --- a/MsBinaryFile/PptFile/Drawing/SlideShow.h +++ b/MsBinaryFile/PptFile/Drawing/SlideShow.h @@ -37,14 +37,14 @@ namespace PPT class CTransition { public: - bool m_bAudioPresent; // есть ли аудио - CAudioElement m_oAudio; // аудио + bool m_bAudioPresent; // is audio present + CAudioElement m_oAudio; // audio - BYTE m_nEffectDirection; // направление эффекта - BYTE m_nEffectType; // тип перехода + BYTE m_nEffectDirection; // effect direction + BYTE m_nEffectType; // transition type - bool m_bLoopSound; // зациклить аудио - bool m_bStopSound; // перед транзишном перестать играть все аудио до этого + bool m_bLoopSound; // loop audio + bool m_bStopSound; // stop playing all previous audio before transition // bool m_bAdvClick; // Attributes for true transition // int m_nAdvTm; @@ -93,13 +93,13 @@ namespace PPT class CSlideShowInfo { public: - double m_dSlideDuration; // длительность слайда (без учета перехода) - bool m_bHidden; // нужно ли НЕ показывать слайд при проигрывании + double m_dSlideDuration; // slide duration (excluding transition) + bool m_bHidden; // whether to NOT show slide during playback - CTransition m_oTransition; // переход + CTransition m_oTransition; // transition - bool m_bAdvClick; // разрешить автопереход по времени - bool m_bManulClick; // переход на следующий по щелчку + bool m_bAdvClick; // allow automatic timed transition + bool m_bManulClick; // advance to next on click CSlideShowInfo() : m_oTransition() { diff --git a/MsBinaryFile/PptFile/Drawing/TextAttributesEx.cpp b/MsBinaryFile/PptFile/Drawing/TextAttributesEx.cpp index 3233438bab..7635e08ed6 100644 --- a/MsBinaryFile/PptFile/Drawing/TextAttributesEx.cpp +++ b/MsBinaryFile/PptFile/Drawing/TextAttributesEx.cpp @@ -123,7 +123,7 @@ void CTextAttributesEx::RecalcParagraphsPPT() (s_size > 1 || (s_size == 1 && m_arParagraphs[i].m_arSpans.size() > 1))) { split_paragraph = true; - // разбиваем параграф + // split paragraph CParagraph oNewPar = m_arParagraphs[i]; if (lCountCFs - (j + 1) > 0) @@ -149,7 +149,7 @@ void CTextAttributesEx::RecalcParagraphsPPT() size_t lFoundBreak = m_arParagraphs[i].m_arSpans[j].m_strText.find((wchar_t)11); if( lFoundBreak != std::wstring::npos) { - // разбиваем span + // split span CSpan next = m_arParagraphs[i].m_arSpans[j]; next.m_strText = next.m_strText.substr(lFoundBreak + 1); @@ -287,7 +287,7 @@ void CTextAttributesEx::RecalcParagraphsPPT() if (bulletChar.is_init() && !bulletFontRef.is_init()) { //Demo-The-Winter-Olympics.ppt - //стоит ли брать с предыдущего уровня? + //should we take from the previous level? } if (!m_arParagraphs[nIndexP].m_oPFRun.hasBullet.is_init()) @@ -355,7 +355,7 @@ void CTextAttributesEx::RecalcParagraphsPPT() } void CTextAttributesEx::ApplyRuler(CTheme* pTheme) { - if (m_oRuler.tabsStops.size() > 0 || m_oRuler.DefaultTabSize.is_init())//presentacio1.ppt слайд 2 + if (m_oRuler.tabsStops.size() > 0 || m_oRuler.DefaultTabSize.is_init())//presentacio1.ppt slide 2 { for (long i = 0; i < 9 ;i++) { diff --git a/MsBinaryFile/PptFile/Drawing/TextAttributesEx.h b/MsBinaryFile/PptFile/Drawing/TextAttributesEx.h index d88d9afd20..ef2204c6a8 100644 --- a/MsBinaryFile/PptFile/Drawing/TextAttributesEx.h +++ b/MsBinaryFile/PptFile/Drawing/TextAttributesEx.h @@ -57,10 +57,10 @@ public: int m_lPlaceholderID; - // граница + // bounds Aggplus::RECT m_oBounds; - // настройки по-умолчанию + // default settings ODRAW::CTextAttributes m_oAttributes; std::vector<CParagraph> m_arParagraphs; std::wstring m_originalText; @@ -74,13 +74,13 @@ public: int m_lWrapMode; // 0 - square, default; 1 - none wrap - // для ппт. чтобы не менять счас ничего + // for ppt. to not change anything now CTextRuler m_oRuler; CTextStyles m_oLayoutStyles; CTextStyles m_oStyles; - // из пптх + // from pptx bool m_bIsSlideFontRef; int m_lFontRef; diff --git a/MsBinaryFile/PptFile/Drawing/Theme.cpp b/MsBinaryFile/PptFile/Drawing/Theme.cpp index 7a031ebf71..02fabc75f0 100644 --- a/MsBinaryFile/PptFile/Drawing/Theme.cpp +++ b/MsBinaryFile/PptFile/Drawing/Theme.cpp @@ -162,7 +162,7 @@ void PPT::CTheme::CalculateStyle(CTheme *pTheme, CTextStyles &oStyle) { LONG lCountColors = (LONG)pTheme->m_arColorScheme.size(); - // пока здесь расчитываются только цвета + // for now only colors are calculated here size_t nLevels = 10; for (size_t i = 0; i < nLevels; ++i) { diff --git a/MsBinaryFile/PptFile/Drawing/Theme.h b/MsBinaryFile/PptFile/Drawing/Theme.h index 8d48f607e3..ed1c3c2bcb 100644 --- a/MsBinaryFile/PptFile/Drawing/Theme.h +++ b/MsBinaryFile/PptFile/Drawing/Theme.h @@ -49,8 +49,8 @@ class CTheme { public: _typeMaster m_eType; - std::map<_UINT64, LONG> m_mapGeomToLayout;// типовые шаблоны - std::map<_UINT32, LONG> m_mapTitleLayout; // заголовочные шаблоны + std::map<_UINT64, LONG> m_mapGeomToLayout;// standard templates + std::map<_UINT32, LONG> m_mapTitleLayout; // header templates std::multimap<int,CElementPtr> m_mapPlaceholders; diff --git a/MsBinaryFile/PptFile/Drawing/XmlStringWriter.h b/MsBinaryFile/PptFile/Drawing/XmlStringWriter.h index 3e7b21297d..cae7a96ac2 100644 --- a/MsBinaryFile/PptFile/Drawing/XmlStringWriter.h +++ b/MsBinaryFile/PptFile/Drawing/XmlStringWriter.h @@ -99,7 +99,7 @@ namespace PPT wchar_t* pRealloc = (wchar_t*)realloc(m_pData, m_lSize * sizeof(wchar_t)); if (NULL != pRealloc) { - // реаллок сработал + // realloc worked m_pData = pRealloc; m_pDataCur = m_pData + m_lSizeCur; diff --git a/MsBinaryFile/PptFile/PPTXWriter/Converter.cpp b/MsBinaryFile/PptFile/PPTXWriter/Converter.cpp index baa6bb3eb4..a47cab65b4 100644 --- a/MsBinaryFile/PptFile/PPTXWriter/Converter.cpp +++ b/MsBinaryFile/PptFile/PPTXWriter/Converter.cpp @@ -851,7 +851,7 @@ namespace PPT for (size_t i = 0; i < pGroupElement->m_pChildElements.size(); ++i) { if (isBodyPlaceholder(pGroupElement->m_pChildElements[i]->m_lPlaceholderType)) - pGroupElement->m_pChildElements[i]->m_lPlaceholderType = 100; //body тип прописывать !! + pGroupElement->m_pChildElements[i]->m_lPlaceholderType = 100; // must set body type !! //if (pGroupElement->m_pChildElements[i]->m_bAnchorEnabled == false && // pGroupElement->m_pChildElements[i]->m_bChildAnchorEnabled == false) @@ -875,7 +875,7 @@ namespace PPT for (size_t i = start_index; i < pTheme->m_arElements.size(); ++i) { if (isBodyPlaceholder(pTheme->m_arElements[i]->m_lPlaceholderType)) - pTheme->m_arElements[i]->m_lPlaceholderType = 100; //body тип прописывать !! + pTheme->m_arElements[i]->m_lPlaceholderType = 100; // must set body type !! //if (pTheme->m_arElements[i]->m_bAnchorEnabled == false && // pTheme->m_arElements[i]->m_bChildAnchorEnabled == false) @@ -1156,7 +1156,7 @@ namespace PPT for (size_t i = 0; i < pGroupElement->m_pChildElements.size(); ++i) { if (isBodyPlaceholder(pGroupElement->m_pChildElements[i]->m_lPlaceholderType)) - pGroupElement->m_pChildElements[i]->m_lPlaceholderType = 100; //body тип прописывать !! + pGroupElement->m_pChildElements[i]->m_lPlaceholderType = 100; // must set body type !! //if (pGroupElement->m_pChildElements[i]->m_bAnchorEnabled == false && // pGroupElement->m_pChildElements[i]->m_bChildAnchorEnabled == false) @@ -1180,7 +1180,7 @@ namespace PPT for (size_t i = start_index; i < pTheme->m_arElements.size(); ++i) { if (isBodyPlaceholder(pTheme->m_arElements[i]->m_lPlaceholderType)) - pTheme->m_arElements[i]->m_lPlaceholderType = 100; //body тип прописывать !! + pTheme->m_arElements[i]->m_lPlaceholderType = 100; // must set body type !! //if (pTheme->m_arElements[i]->m_bAnchorEnabled == false && // pTheme->m_arElements[i]->m_bChildAnchorEnabled == false) @@ -1719,7 +1719,7 @@ xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\"")); } void CPPTXWriter::WriteLayoutAfterTheme(CThemePtr pTheme, const int nIndexTheme, int& nStartLayout) - {//nIndexTheme тут уже +1 + {// nIndexTheme is already +1 here CRelsGenerator oRels(&m_oManager); int nCountLayouts = (int)pTheme->m_arLayouts.size(); oRels.StartMaster(nIndexTheme - 1, nStartLayout, nCountLayouts); @@ -1756,7 +1756,7 @@ xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\"")); for (size_t i = 0; i < pGroupElement->m_pChildElements.size(); ++i) { if (isBodyPlaceholder(pGroupElement->m_pChildElements[i]->m_lPlaceholderType)) - pGroupElement->m_pChildElements[i]->m_lPlaceholderType = 100; //body тип прописывать !! + pGroupElement->m_pChildElements[i]->m_lPlaceholderType = 100; // must set body type !! //if (pGroupElement->m_pChildElements[i]->m_bAnchorEnabled == false && // pGroupElement->m_pChildElements[i]->m_bChildAnchorEnabled == false) @@ -1780,7 +1780,7 @@ xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\"")); for (size_t i = start_index; i < pTheme->m_arElements.size(); ++i) { if (isBodyPlaceholder(pTheme->m_arElements[i]->m_lPlaceholderType)) - pTheme->m_arElements[i]->m_lPlaceholderType = 100; //body тип прописывать !! + pTheme->m_arElements[i]->m_lPlaceholderType = 100; // must set body type !! //if (pTheme->m_arElements[i]->m_bAnchorEnabled == false && // pTheme->m_arElements[i]->m_bChildAnchorEnabled == false) diff --git a/MsBinaryFile/PptFile/PPTXWriter/ShapeWriter.cpp b/MsBinaryFile/PptFile/PPTXWriter/ShapeWriter.cpp index a933d28545..654c7af736 100644 --- a/MsBinaryFile/PptFile/PPTXWriter/ShapeWriter.cpp +++ b/MsBinaryFile/PptFile/PPTXWriter/ShapeWriter.cpp @@ -52,7 +52,7 @@ CStylesWriter::CStylesWriter() : m_pTheme(NULL) {} CStylesWriter::CStylesWriter(PPT::CTheme* pTheme) : m_pTheme(pTheme) {} void CStylesWriter::ConvertStyleLevel(PPT::CTextStyleLevel& oLevel, PPT::CStringWriter& oWriter, const int& nLevel) -{//дублирование CTextPFRun и CTextCFRun с ShapeWriter - todooo - вынести отдельно +{// duplication of CTextPFRun and CTextCFRun with ShapeWriter - todo - extract separately std::wstring str1; if (nLevel == 9) str1 = L"<a:defPPr"; @@ -287,7 +287,7 @@ std::wstring PPT::CShapeWriter::ConvertBrush(CBrush & brush) { if (m_pElement && ( m_pElement->m_etType == etPicture || m_pElement->m_etType == etAudio || - m_pElement->m_etType == etVideo)) //фон для картинки с празрачностью + m_pElement->m_etType == etVideo)) // background for image with transparency { brush_writer.WriteString(L"<a:noFill/>"); } @@ -364,7 +364,7 @@ std::wstring PPT::CShapeWriter::ConvertBrush(CBrush & brush) brush_writer.WriteString(L"</a:gradFill>"); } else if(brush.Type == c_BrushTypePattern) - {//типов нету в ппт - вместо них шаблон-картинка + {// types don't exist in ppt - pattern-image is used instead brush_writer.WriteString(L"<a:pattFill prst=\"pct80\">"); brush_writer.WriteString(L"<a:fgClr>"); brush_writer.WriteString(ConvertColor(brush.Color1, brush.Alpha1)); @@ -572,7 +572,7 @@ void PPT::CShapeWriter::WriteImageInfo() m_oWriter.WriteString(std::wstring(L"\"")); if (!pImageElement->m_sDescription.empty()) - {//бывает всякая разная бяка сохранена + {// sometimes various junk is saved m_oWriter.WriteString(std::wstring(L" descr=\"")); m_oWriter.WriteString(XmlUtils::EncodeXmlStringExtend(pImageElement->m_sDescription, true)); m_oWriter.WriteString(std::wstring(L"\"")); @@ -1197,7 +1197,7 @@ void PPT::CShapeWriter::WriteTextInfo(PPT::CTextCFRun* pLastCF) std::wstring prstTxWarp = oox::Spt2WordArtShapeType((oox::MSOSPT)pShapeElement->m_lShapeType); m_oWriter.WriteString(std::wstring(L"<a:prstTxWarp")); m_oWriter.WriteString(std::wstring(L" prst=\"") + prstTxWarp + L"\">"); - m_oWriter.WriteString(std::wstring(L"<a:avLst>"));//модификаторы + m_oWriter.WriteString(std::wstring(L"<a:avLst>"));// modifiers CPPTShape *pPPTShape = dynamic_cast<CPPTShape *>(pShapeElement->m_pShape->getBaseShape().get()); std::wstring strVal; @@ -1208,7 +1208,7 @@ void PPT::CShapeWriter::WriteTextInfo(PPT::CTextCFRun* pLastCF) { case oox::msosptTextFadeUp: { - double kf = 4.63; //"волшебный" + double kf = 4.63; // "magic" std::wstring strVal = std::to_wstring((int)(kf * pPPTShape->m_arAdjustments[i])); m_oWriter.WriteString(L"<a:gd name=\"adj\" fmla=\"val "); @@ -1364,7 +1364,7 @@ void PPT::CShapeWriter::WriteTextInfo(PPT::CTextCFRun* pLastCF) m_oWriter.WriteString(std::wstring(L">")); if (m_bWordArt) - {//порядок важен - линия, заливка, тень !!! + {// order is important - line, fill, shadow !!! if (pShapeElement->m_bLine) { m_oWriter.WriteString(ConvertLine(pShapeElement->m_oPen)); @@ -2066,7 +2066,7 @@ void PPT::CShapeWriter::ParseXmlAlternative(const std::wstring & xml) // writer.ClearNoAttack(); // if ((shape->txBody.IsInit()) && (shape->txBody->bodyPr.IsInit()) && (shape->txBody->bodyPr->prstTxWarp.IsInit())) - // {//только WordArt + // {// WordArt only // shape->txBody->toXmlWriter(&writer); // m_xmlTxBodyAlternative = writer.GetXmlString(); } @@ -2089,7 +2089,7 @@ std::wstring PPT::CShapeWriter::ConvertImage() if (pImageElement->m_bImagePresent == false) { if (pImageElement->m_sName.empty()) return L""; - //ppt_presentation.ppt - ссылка на файл на диске + // ppt_presentation.ppt - link to file on disk pImageElement->m_strImageFileName.clear(); pImageElement->m_bImagePresent = true; @@ -2268,7 +2268,7 @@ HRESULT PPT::CShapeWriter::get_Type(LONG* lType) *lType = c_nSVGConverter; return S_OK; } -//-------- Функции для работы со страницей -------------------------------------------------- +//-------- Functions for working with page -------------------------------------------------- HRESULT PPT::CShapeWriter::NewPage() { return S_OK; @@ -2728,7 +2728,7 @@ HRESULT PPT::CShapeWriter::put_EdgeDist(double val) m_oEdge.Dist = val; return S_OK; } -//-------- Функции для вывода текста -------------------------------------------------------- +//-------- Functions for text output -------------------------------------------------------- HRESULT PPT::CShapeWriter::CommandDrawText(const std::wstring& bsText, const double& x, const double& y, const double& w, const double& h) { if (c_nHyperlinkType == m_lCurrentCommandType) @@ -2797,7 +2797,7 @@ HRESULT PPT::CShapeWriter::CommandDrawTextEx(const std::wstring& bsUnicodeText, } return S_OK; } -//-------- Маркеры для команд --------------------------------------------------------------- +//-------- Command markers --------------------------------------------------------------- HRESULT PPT::CShapeWriter::BeginCommand(const _UINT32& lType) { if (c_nPathType == lType) @@ -2814,7 +2814,7 @@ HRESULT PPT::CShapeWriter::EndCommand(const _UINT32& lType) m_lCurrentCommandType = -1; return S_OK; } -//-------- Функции для работы с Graphics Path ----------------------------------------------- +//-------- Functions for working with Graphics Path ----------------------------------------------- HRESULT PPT::CShapeWriter::PathCommandMoveTo(const double& x, const double& y) { if (c_nSimpleGraphicType == m_lCurrentCommandType) @@ -2962,7 +2962,7 @@ HRESULT PPT::CShapeWriter::PathCommandTextEx(const std::wstring& bsUnicodeText, m_oFont.StringGID = bGid; return S_OK; } -//-------- Функции для вывода изображений --------------------------------------------------- +//-------- Functions for image output --------------------------------------------------- HRESULT PPT::CShapeWriter::DrawImage(IGrObject* pImage, const double& x, const double& y, const double& w, const double& h) { return S_OK; diff --git a/MsBinaryFile/PptFile/PPTXWriter/ShapeWriter.h b/MsBinaryFile/PptFile/PPTXWriter/ShapeWriter.h index 76cebf1e0f..cd1eae64ec 100644 --- a/MsBinaryFile/PptFile/PPTXWriter/ShapeWriter.h +++ b/MsBinaryFile/PptFile/PPTXWriter/ShapeWriter.h @@ -111,7 +111,7 @@ namespace PPT switch (TypePPTX) { case 0: return L"body"; - case 100: return L"body"; // для master pages + case 100: return L"body"; // for master pages case 1: return L"chart"; case 2: return L"clipArt"; case 3: return L"ctrTitle"; @@ -183,9 +183,9 @@ namespace PPT static std::wstring ConvertColor (CColor & color, long alpha = 255); void ParseXmlAlternative(const std::wstring & xml); -// тип рендерера----------------------------------------------------------------------------- +// renderer type ----------------------------------------------------------------------------- virtual HRESULT get_Type(LONG* lType) ; -//-------- Функции для работы со страницей -------------------------------------------------- +//-------- Functions for working with page -------------------------------------------------- virtual HRESULT NewPage() ; virtual HRESULT get_Height(double* dHeight); virtual HRESULT put_Height(const double& dHeight); @@ -257,18 +257,18 @@ namespace PPT virtual HRESULT get_FontFaceIndex(int* lFaceIndex); virtual HRESULT put_FontFaceIndex(const int& lFaceIndex); -//-------- Функции для вывода текста -------------------------------------------------------- +//-------- Functions for text output -------------------------------------------------------- virtual HRESULT CommandDrawTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h) ; virtual HRESULT CommandDrawText(const std::wstring& bsText, const double& x, const double& y, const double& w, const double& h) ; virtual HRESULT CommandDrawTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h) ; virtual HRESULT CommandDrawTextEx(const std::wstring& bsUnicodeText, const unsigned int* pGids, const unsigned int nGidsCount, const double& x, const double& y, const double& w, const double& h); -//-------- Маркеры для команд --------------------------------------------------------------- +//-------- Command markers --------------------------------------------------------------- virtual HRESULT BeginCommand(const _UINT32& lType); virtual HRESULT EndCommand(const _UINT32& lType) ; -//-------- Функции для работы с Graphics Path ----------------------------------------------- +//-------- Functions for working with Graphics Path ----------------------------------------------- virtual HRESULT PathCommandMoveTo(const double& x, const double& y); virtual HRESULT PathCommandLineTo(const double& x, const double& y); virtual HRESULT PathCommandLinesTo(double* points, const int& count) ; @@ -287,7 +287,7 @@ namespace PPT virtual HRESULT PathCommandTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h); virtual HRESULT PathCommandTextEx(const std::wstring& sText, const unsigned int* pGids, const unsigned int nGidsCount, const double& x, const double& y, const double& w, const double& h) ; -//-------- Функции для вывода изображений --------------------------------------------------- +//-------- Functions for image output --------------------------------------------------- virtual HRESULT DrawImage(IGrObject* pImage, const double& x, const double& y, const double& w, const double& h) ; virtual HRESULT DrawImageFromFile(const std::wstring&, const double& x, const double& y, const double& w, const double& h, const BYTE& lAlpha = 255); @@ -375,23 +375,23 @@ namespace PPT public: - Aggplus::CGraphicsPathSimpleConverter* m_pSimpleGraphicsConverter; // конвертер сложных гафических путей в простые - NSFonts::IFontManager* m_pFontManager; // менеджер шрифтов + Aggplus::CGraphicsPathSimpleConverter* m_pSimpleGraphicsConverter; // converter from complex graphics paths to simple ones + NSFonts::IFontManager* m_pFontManager; // font manager - Aggplus::CMatrix m_oBaseTransform; // матрица перерасчета координатных осей (здесь: миллиметры -> пикселы) - Aggplus::CMatrix m_oTransform; // текущая матрица преобразований рендерера - Aggplus::CMatrix m_oFullTransform; // полная матрица преобразований (m_oBaseTransform * m_oTransform) + Aggplus::CMatrix m_oBaseTransform; // coordinate axis conversion matrix (here: millimeters -> pixels) + Aggplus::CMatrix m_oTransform; // current renderer transformation matrix + Aggplus::CMatrix m_oFullTransform; // full transformation matrix (m_oBaseTransform * m_oTransform) double m_dTransformAngle; - LONG m_lCurrentCommandType; // текущая команда + LONG m_lCurrentCommandType; // current command double m_dDpiX; double m_dDpiY; LONG m_lClipMode; - CPen m_oPen; // настройки всей графики (скопирован ашник из AVSGraphics) + CPen m_oPen; // graphics settings (copied header from AVSGraphics) CBrush m_oBrush; CFont m_oFont; CShadow m_oShadow; diff --git a/MsBinaryFile/PptFile/PPTXWriter/TableWriter.cpp b/MsBinaryFile/PptFile/PPTXWriter/TableWriter.cpp index d20540b458..fa14f5a79f 100644 --- a/MsBinaryFile/PptFile/PPTXWriter/TableWriter.cpp +++ b/MsBinaryFile/PptFile/PPTXWriter/TableWriter.cpp @@ -450,8 +450,8 @@ void TableWriter::FillRow(PPTX::Logic::TableRow &oRow, ProtoTableRow& arrCells) std::wstring TableWriter::getXmlForGraphicFrame(int ID, int idx) const { - //в таблице могут быть линки и ссылки на другние объекты (картинки???) - // yliko_provolis.ppt (+ тут есть смарт арты) + // table may contain links and references to other objects (images???) + // yliko_provolis.ppt (+ smart arts are here) auto& rXml = m_pTableElement->m_xmlRawData; @@ -460,10 +460,10 @@ std::wstring TableWriter::getXmlForGraphicFrame(int ID, int idx) const if (graphic_frame.nvGraphicFramePr.IsInit()) { - graphic_frame.nvGraphicFramePr->cNvPr.id = ID; // или менять в карте связей для анимаций + graphic_frame.nvGraphicFramePr->cNvPr.id = ID; // or change in the relations map for animations if (graphic_frame.nvGraphicFramePr->nvPr.ph.IsInit() && idx >= 0) - {//проверить + {// check graphic_frame.nvGraphicFramePr->nvPr.ph->idx = std::to_wstring(idx); } } diff --git a/MsBinaryFile/PptFile/Reader/PPTDocumentInfo.cpp b/MsBinaryFile/PptFile/Reader/PPTDocumentInfo.cpp index f5623ebbef..df57ac02c8 100644 --- a/MsBinaryFile/PptFile/Reader/PPTDocumentInfo.cpp +++ b/MsBinaryFile/PptFile/Reader/PPTDocumentInfo.cpp @@ -100,7 +100,7 @@ bool CPPTDocumentInfo::ReadFromStream(CRecordCurrentUserAtom *pCurrentUser, POLE } m_arUsers.push_back(pInfo); - // теперь нужно выставить у него параметры для других юзеров + // now need to set parameters for other users pInfo->m_lIndexThisUser = m_arUsers.size() - 1; pInfo = NULL; @@ -142,7 +142,7 @@ bool CPPTDocumentInfo::LoadDocument() try { - m_arUsers[0]->ReadExtenalObjects(); // todooo ???? прочитать по всем (см 66864) + m_arUsers[0]->ReadExtenalObjects(); // todo ???? read for all (see 66864) m_arUsers[0]->FromDocument(); m_bMacroEnabled = m_arUsers[0]->m_bMacroEnabled; diff --git a/MsBinaryFile/PptFile/Reader/PPTDocumentInfoOneUser.cpp b/MsBinaryFile/PptFile/Reader/PPTDocumentInfoOneUser.cpp index 70603dae79..cda4073d5a 100644 --- a/MsBinaryFile/PptFile/Reader/PPTDocumentInfoOneUser.cpp +++ b/MsBinaryFile/PptFile/Reader/PPTDocumentInfoOneUser.cpp @@ -415,7 +415,7 @@ bool CPPTUserInfo::ReadDocumentPersists(POLE::Stream* pStream) //-------------------------------------------------------------------------------------------- void CPPTUserInfo::ReadExtenalObjects() { - // так... теперь берем всю инфу о ExObject ----------------------------- + // so... now we get all info about ExObject ----------------------------- m_oExMedia.m_strPresentationDirectory = m_pDocumentInfo->m_pCommonInfo->tempPath; PPT::CExFilesInfo oInfo; @@ -424,7 +424,7 @@ void CPPTUserInfo::ReadExtenalObjects() oInfo.m_dwID = 0xFFFFFFFF; m_oExMedia.m_arImages.push_back(oInfo); - // читаем все внешние объекты + // read all external objects std::vector<CRecordExObjListContainer*> oArrayExObjects; m_oDocument.GetRecordsByType(&oArrayExObjects, false, true); @@ -434,14 +434,14 @@ void CPPTUserInfo::ReadExtenalObjects() } else { - // прочитать все равно надо, так как там может быть - // транзишн + // we still need to read, as there can be + // transition LoadExternal(NULL); } // ------------------------------------------------------------------- - // а теперь заберем всю информацию о шрифтах + // and now let's get all the font information std::vector<CRecordFontEntityAtom*> oArrayFonts; m_oDocument.GetRecordsByType(&oArrayFonts, true); @@ -582,7 +582,7 @@ void CPPTUserInfo::FromDocument() m_arSlides.push_back(new CSlide()); - // если на слайде есть анимации + // if the slide has animations // std::map <_UINT32, Animations::CSlideTimeLine*>::iterator pTimeLine = m_mapAnimations.find( pPair->first); // if ( m_mapAnimations.end() != pTimeLine ) @@ -662,7 +662,7 @@ void CPPTUserInfo::LoadNotes(_UINT32 dwNoteID, CSlide* pNotes) pRecordSlide->GetRecordsByType(&oArrayNotesAtoms, false, true); if (0 == oArrayNotesAtoms.size()) { - // ошибка!!! + // error!!! return; } bool bMasterColorScheme = oArrayNotesAtoms[0]->m_bMasterScheme; @@ -673,7 +673,7 @@ void CPPTUserInfo::LoadNotes(_UINT32 dwNoteID, CSlide* pNotes) if (pPairSlide == m_mapSlides.end()) { - //????? у заметок нет слайда !!! + //????? notes have no slide !!! } //----------------------------------------------------- size_t index = pPairSlide->second->m_Index; @@ -692,7 +692,7 @@ void CPPTUserInfo::LoadNotes(_UINT32 dwNoteID, CSlide* pNotes) //----------------------------------------------------- std::vector<ODRAW::CColor>* pArrayColorScheme = pTheme ? &pTheme->m_arColorScheme : NULL; - // читаем цветовую схему ----------------------------------------------------------- + // reading color scheme ----------------------------------------------------------- pNotes->m_bUseLayoutColorScheme = true; if (!bMasterColorScheme) { @@ -707,7 +707,7 @@ void CPPTUserInfo::LoadNotes(_UINT32 dwNoteID, CSlide* pNotes) oArrayColors[i]->ToArray(&pNotes->m_arColorScheme); CorrectColorScheme(pNotes->m_arColorScheme); - // проверим на совпадение + // check for match size_t nCountC = pNotes->m_arColorScheme.size(); size_t nIndexC = 0; if (pArrayColorScheme && nCountC == pArrayColorScheme->size()) @@ -807,7 +807,7 @@ void CPPTUserInfo::TestSlide(_UINT32 dwSlideID) pRecordSlide->GetRecordsByType(&oArraySlideAtoms, false, true); if (0 == oArraySlideAtoms.size()) { - // ошибка!!! + // error!!! return; } std::map<_UINT32, LONG>::iterator pFind = m_mapRealUsedMaster.find(oArraySlideAtoms[0]->m_nMasterIDRef); @@ -831,7 +831,7 @@ void CPPTUserInfo::LoadSlide(_UINT32 dwSlideID, CSlide* pSlide) if (NULL == pRecordSlide) return; - // транзишн + // transition CTransition* pTransition = &pSlide->m_oSlideShow.m_oTransition; @@ -850,7 +850,7 @@ void CPPTUserInfo::LoadSlide(_UINT32 dwSlideID, CSlide* pSlide) pTransition->m_bLoopSound = pAtom->m_bLoopSound; pTransition->m_bStopSound = pAtom->m_bStopSound; pTransition->m_nEffectDirection = pAtom->m_nEffectDirection; - pTransition->m_nEffectType = pAtom->m_nEffectType; // тут нужно сконвертить тип // конвертится в Converter.cpp + pTransition->m_nEffectType = pAtom->m_nEffectType; // need to convert the type here // converted in Converter.cpp pTransition->m_nSpeed = pAtom->m_nSpeed; pSlide->m_oSlideShow.m_dSlideDuration = pAtom->m_nSlideTime; @@ -868,7 +868,7 @@ void CPPTUserInfo::LoadSlide(_UINT32 dwSlideID, CSlide* pSlide) AddAudioTransition(pAtom->m_nSoundRef, pTransition, pInfo->m_strFilePath); } - // анимации + // animations pSlide->m_bUseLayoutColorScheme = true; @@ -891,12 +891,12 @@ void CPPTUserInfo::LoadSlide(_UINT32 dwSlideID, CSlide* pSlide) if (pTextAttr) pSlideWrapper->m_arTextPlaceHolders.push_back(*pTextAttr); - // записываем шрифты + // writing fonts std::vector<CRecordSlideAtom*> oArraySlideAtoms; pRecordSlide->GetRecordsByType(&oArraySlideAtoms, false, true); if (0 == oArraySlideAtoms.size()) { - // ошибка!!! + // error!!! return; } bool bMasterColorScheme = oArraySlideAtoms[0]->m_bMasterScheme; @@ -907,7 +907,7 @@ void CPPTUserInfo::LoadSlide(_UINT32 dwSlideID, CSlide* pSlide) if (pPairTheme == m_mapMasterToTheme.end()) { - //????? слайду не присвоена тема !!! + //????? slide is not assigned a theme !!! if (false == m_mapMasterToTheme.empty()) pPairTheme = m_mapMasterToTheme.begin(); else @@ -926,7 +926,7 @@ void CPPTUserInfo::LoadSlide(_UINT32 dwSlideID, CSlide* pSlide) std::map<_UINT32, LONG>::iterator pPairLayoutTitle = pTheme->m_mapTitleLayout.find(oArraySlideAtoms[0]->m_nMasterIDRef); if (pPairLayoutTitle != pTheme->m_mapTitleLayout.end()) { - //основан на заголовочном шаблоне + // based on a header template pSlide->m_bShowMasterShapes = bMasterObjects; pSlide->m_lLayoutID = pPairLayoutTitle->second; pLayout = pTheme->m_arLayouts[pSlide->m_lLayoutID].get(); @@ -934,7 +934,7 @@ void CPPTUserInfo::LoadSlide(_UINT32 dwSlideID, CSlide* pSlide) else { pSlide->m_bShowMasterShapes = true; //??? - //основан на типовом шаблоне + // based on a standard template std::map<_UINT64, LONG>::iterator pPairLayoutGeom = pTheme->m_mapGeomToLayout.find(oArraySlideAtoms[0]->m_oLayout.m_hash); if (pPairLayoutGeom == pTheme->m_mapGeomToLayout.end()) @@ -955,7 +955,7 @@ void CPPTUserInfo::LoadSlide(_UINT32 dwSlideID, CSlide* pSlide) if (!pLayout->m_bUseThemeColorScheme) pArrayColorScheme = &pLayout->m_arColorScheme; - // читаем цветовую схему ----------------------------------------------------------- + // reading color scheme ----------------------------------------------------------- pSlide->m_bUseLayoutColorScheme = true; if (!bMasterColorScheme) { @@ -970,7 +970,7 @@ void CPPTUserInfo::LoadSlide(_UINT32 dwSlideID, CSlide* pSlide) oArrayColors[i]->ToArray(&pSlide->m_arColorScheme); CorrectColorScheme(pSlide->m_arColorScheme); - // проверим на совпадение + // check for match size_t nCountC = pSlide->m_arColorScheme.size(); size_t nIndexC = 0; if (pArrayColorScheme && nCountC == pArrayColorScheme->size()) @@ -1243,7 +1243,7 @@ CElementPtr CPPTUserInfo::AddThemeLayoutPlaceholder(CLayout* pLayout, int place pElement->m_bPlaceholderSet = true; if (pElement->m_lPlaceholderType == 14) - pElement->m_lPlaceholderType = PT_Body_Empty; // для добавления разных типов объектов + pElement->m_lPlaceholderType = PT_Body_Empty; // for adding different types of objects pLayout->m_arElements.push_back(pElement); pLayout->m_mapPlaceholders.insert(std::make_pair(placeholderType, pElement)); @@ -1303,7 +1303,7 @@ int CPPTUserInfo::AddNewLayout(CTheme* pTheme, CRecordSlide* pRecordSlide, bool pRecordSlide->GetRecordsByType(&oArrayStrings, false, false); if (false == addShapes && false == bMasterObjects) return ind; - //далее только для типовых шаблонов + // further only for standard templates pTheme->m_mapGeomToLayout.insert(std::pair<_UINT64, LONG>(layoutRecord.m_hash, ind)); int defObjSize = -1; @@ -1371,7 +1371,7 @@ int CPPTUserInfo::AddNewLayout(CTheme* pTheme, CRecordSlide* pRecordSlide, bool //if (layoutRecord.m_nGeom==0x0F) return ind; // big object only !!! if (false == addShapes) return ind; - //копируем все элементы без idx которые не были прописаны явно + // copy all elements without idx that were not explicitly specified for (std::multimap<int, CElementPtr>::iterator it = pTheme->m_mapPlaceholders.begin(); it != pTheme->m_mapPlaceholders.end(); ++it) { CElementPtr pElemTheme = it->second; @@ -1441,7 +1441,7 @@ void CPPTUserInfo::LoadMainMaster(_UINT32 dwMasterID, bool alwaysLoad) std::map<_UINT32, LONG>::iterator pPair = m_mapMasterToTheme.find(dwMasterID); if (pPair != m_mapMasterToTheme.end()) { - // мастер уже загружен + // master already loaded return; } @@ -1449,12 +1449,12 @@ void CPPTUserInfo::LoadMainMaster(_UINT32 dwMasterID, bool alwaysLoad) std::map<_UINT32, CRecordSlide*>::iterator pPairMaster = m_mapMasters.find(dwMasterID); - if (m_mapMasters.end() == pPairMaster)//??? не может быть + if (m_mapMasters.end() == pPairMaster)//??? cannot happen return; CRecordSlide* pMaster = pPairMaster->second; - if (pMaster == NULL)//??? не может быть + if (pMaster == NULL)//??? cannot happen return; std::vector<CRecordSlideAtom*> oArraySlideAtoms; @@ -1465,18 +1465,18 @@ void CPPTUserInfo::LoadMainMaster(_UINT32 dwMasterID, bool alwaysLoad) _UINT32 dwID = (_UINT32)oArraySlideAtoms[0]->m_nMasterIDRef; if (0 != dwID) { - // этот мастер - не main!!! - // сначала загрузим все main, а потом - title - // title нужно грузить как обычный слайд. + // this master is not main!!! + // first load all main, then - title + // title needs to be loaded as a regular slide. return; } std::vector<RoundTripCompositeMasterId12Atom*> oArrayCompId; pMaster->GetRecordsByType(&oArrayCompId, false, true); if (0 != oArrayCompId.size() && !alwaysLoad) { - // этот мастер - не main!!! - // сначала загрузим все main, а потом - title - // title нужно грузить как обычный слайд. + // this master is not main!!! + // first load all main, then - title + // title needs to be loaded as a regular slide. // 第58课时 绘制频数直方图.ppt return; } @@ -1538,14 +1538,14 @@ void CPPTUserInfo::LoadMainMaster(_UINT32 dwMasterID, bool alwaysLoad) m_arMasterWrapper.push_back(slide_info); CSlideInfo* pMasterWrapper = &m_arMasterWrapper[lIndexTheme]; - // записываем шрифты --------------------------------------------------------------- + // writing fonts --------------------------------------------------------------- for (size_t i = 0; i < m_arrFonts.size(); ++i) { pTheme->m_arFonts.push_back(m_arrFonts[i]); } // --------------------------------------------------------------------------------- - // читаем цветовую схему ----------------------------------------------------------- + // reading color scheme ----------------------------------------------------------- std::vector<CRecordColorSchemeAtom*> oArrayColors; pMaster->GetRecordsByType(&oArrayColors, false); @@ -1600,7 +1600,7 @@ void CPPTUserInfo::LoadMainMaster(_UINT32 dwMasterID, bool alwaysLoad) pMasterWrapper->m_mapFilePictures = &m_pDocumentInfo->m_mapStoreImageFile; - // читаем настройки текстовых стилей ----------------------------------------------- + // reading text style settings ----------------------------------------------- std::vector<CRecordTextMasterStyleAtom*> oArrayTextMasters; pMaster->GetRecordsByType(&oArrayTextMasters, true, false); @@ -1624,7 +1624,7 @@ void CPPTUserInfo::LoadMainMaster(_UINT32 dwMasterID, bool alwaysLoad) CreateDefaultStyle(oPPTDefaultStyle, pTheme); oPPTDefaultStyle.ApplyAfter(m_oDefaultTextStyle); - // выставим стили теме + // set styles for the theme pTheme->m_pStyles[0] = oPPTDefaultStyle; pTheme->m_pStyles[1] = oPPTDefaultStyle; pTheme->m_pStyles[2] = oPPTDefaultStyle; @@ -1639,7 +1639,7 @@ void CPPTUserInfo::LoadMainMaster(_UINT32 dwMasterID, bool alwaysLoad) pTheme->CalculateStyles(); - CLayout* pLayout = NULL; // ну нету тут разметок ...!! + CLayout* pLayout = NULL; // well, there are no layouts here...!! // --------------------------------------------------------------------------------- std::vector<CRecordDrawingContainer*> oArrayDrawing; @@ -1806,14 +1806,14 @@ void CPPTUserInfo::LoadMaster(_typeMaster type, CRecordSlide* pMaster, CSlideInf pMasterWrapper = new CSlideInfo(); - // записываем шрифты --------------------------------------------------------------- + // writing fonts --------------------------------------------------------------- for (size_t i = 0; i < m_arrFonts.size(); ++i) { pTheme->m_arFonts.push_back(m_arrFonts[i]); } // --------------------------------------------------------------------------------- - // читаем цветовую схему ----------------------------------------------------------- + // reading color scheme ----------------------------------------------------------- std::vector<CRecordColorSchemeAtom*> oArrayColors; pMaster->GetRecordsByType(&oArrayColors, false); @@ -1859,14 +1859,14 @@ void CPPTUserInfo::LoadMaster(_typeMaster type, CRecordSlide* pMaster, CSlideInf pMasterWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures; pMasterWrapper->m_mapFilePictures = &m_pDocumentInfo->m_mapStoreImageFile; - //настройки текстовых стилей ----------------------------------------------- + // text style settings ----------------------------------------------- for (size_t i = 0; i < 9 && false == m_arMasterWrapper.empty(); ++i) { pMasterWrapper->m_pStyles[i] = m_arMasterWrapper[0].m_pStyles[i]; //main master } - CLayout* pLayout = NULL; // ну нету тут разметок ...!! + CLayout* pLayout = NULL; // well, there are no layouts here...!! //------------------------------------------------------------------------------------------------------- std::vector<CRecordDrawingContainer*> oArrayDrawing; @@ -1944,14 +1944,14 @@ void CPPTUserInfo::LoadNoMainMaster(_UINT32 dwMasterID) } } - // проверяем, если это MainMaster - то его грузим как мастер + // checking if this is MainMaster - then load it as master if (0 == dwID) { - // он уже загружен как тема !!! + // it is already loaded as theme !!! return; } - // теперь аналог функции LoadSlide + // now the equivalent of the LoadSlide function CSlideInfo elm; m_arMasterWrapper.push_back(elm); @@ -1994,7 +1994,7 @@ void CPPTUserInfo::LoadNoMainMaster(_UINT32 dwMasterID) pTheme->m_mapTitleLayout[dwMasterID] = lLayoutID; std::vector<ODRAW::CColor>* pArrayColorScheme = &pTheme->m_arColorScheme; - // читаем цветовую схему ----------------------------------------------------------- + // reading color scheme ----------------------------------------------------------- if (!bMasterColorScheme) { std::vector<CRecordColorSchemeAtom*> oArrayColors; @@ -2009,7 +2009,7 @@ void CPPTUserInfo::LoadNoMainMaster(_UINT32 dwMasterID) pLayout->m_bUseThemeColorScheme = false; CorrectColorScheme(pLayout->m_arColorScheme); - // проверим на совпадение + // check for match size_t nCountC = pLayout->m_arColorScheme.size(); size_t nIndexC = 0; if (pArrayColorScheme && nCountC == pArrayColorScheme->size()) @@ -2140,7 +2140,7 @@ void CPPTUserInfo::LoadSlideFromPrevUsers(_UINT32 dwSlideID) std::map<_UINT32, CRecordSlide*>::iterator pPairSlide = m_mapSlides.find(dwSlideID); if (pPairSlide != m_mapSlides.end() && pPairSlide->second) - return; //есть + return; // exists size_t lUsersCount = m_pDocumentInfo->m_arUsers.size(); @@ -2178,7 +2178,7 @@ void CPPTUserInfo::LoadMasterFromPrevUsers(_UINT32 dwMasterID) std::map<_UINT32, CRecordSlide*>::iterator pPairMaster = m_mapMasters.find(dwMasterID); if (pPairMaster != m_mapMasters.end() && pPairMaster->second) - return;//есть + return;// exists size_t lUsersCount = m_pDocumentInfo->m_arUsers.size(); @@ -2194,12 +2194,12 @@ void CPPTUserInfo::LoadMasterFromPrevUsers(_UINT32 dwMasterID) { pSlideCur->AddRef(); - //для каждого пользователя СВОИ активные картинки !!! + // each user has their OWN active images !!! pSlideCur->m_IndexUser = lIndexUser; if (pPairMaster != m_mapMasters.end()) { - //был найден ранее нулевым + // was found as null earlier pPairMaster->second = pSlideCur; } else @@ -2219,7 +2219,7 @@ void CPPTUserInfo::LoadNotesFromPrevUsers(_UINT32 dwSlideID) std::map<_UINT32, CRecordSlide*>::iterator pPairSlide = m_mapNotes.find(dwSlideID); if (pPairSlide != m_mapNotes.end() && pPairSlide->second) - return; //есть + return; // exists size_t lUsersCount = m_pDocumentInfo->m_arUsers.size(); @@ -2258,7 +2258,7 @@ void CPPTUserInfo::LoadNotesMasterFromPrevUsers(_UINT32 dwMasterID) std::map<_UINT32, CRecordSlide*>::iterator pPairMaster = m_mapNotesMasters.find(dwMasterID); if (pPairMaster != m_mapNotesMasters.end() && pPairMaster->second) - return;//есть + return;// exists size_t lUsersCount = m_pDocumentInfo->m_arUsers.size(); @@ -2274,12 +2274,12 @@ void CPPTUserInfo::LoadNotesMasterFromPrevUsers(_UINT32 dwMasterID) { pSlideCur->AddRef(); - //для каждого пользователя СВОИ активные картинки !!! + // each user has their OWN active images !!! pSlideCur->m_IndexUser = lIndexUser; if (pPairMaster != m_mapNotesMasters.end()) { - //был найден ранее нулевым + // was found as null earlier pPairMaster->second = pSlideCur; } else @@ -2298,7 +2298,7 @@ void CPPTUserInfo::LoadHandoutMasterFromPrevUsers(_UINT32 dwMasterID) std::map<_UINT32, CRecordSlide*>::iterator pPairMaster = m_mapHandoutMasters.find(dwMasterID); if (pPairMaster != m_mapHandoutMasters.end() && pPairMaster->second) - return;//есть + return;// exists size_t lUsersCount = m_pDocumentInfo->m_arUsers.size(); @@ -2314,12 +2314,12 @@ void CPPTUserInfo::LoadHandoutMasterFromPrevUsers(_UINT32 dwMasterID) { pSlideCur->AddRef(); - //для каждого пользователя СВОИ активные картинки !!! + // each user has their OWN active images !!! pSlideCur->m_IndexUser = lIndexUser; if (pPairMaster != m_mapHandoutMasters.end()) { - //был найден ранее нулевым + // was found as null earlier pPairMaster->second = pSlideCur; } else @@ -2332,7 +2332,7 @@ void CPPTUserInfo::LoadHandoutMasterFromPrevUsers(_UINT32 dwMasterID) } void CPPTUserInfo::LoadExternal(CRecordExObjListContainer* pExObjects) { - // читаем SoundCollection + // reading SoundCollection std::vector<CRecordSoundCollectionContainer*> oArrayCollection; m_oDocument.GetRecordsByType(&oArrayCollection, false, true); @@ -2369,7 +2369,7 @@ void CPPTUserInfo::LoadExternal(CRecordExObjListContainer* pExObjects) if (NULL == pExObjects) return; - // читаем видео ---------------------------------------------- + // reading video ---------------------------------------------- std::vector<CRecordExVideoContainer*> oArrayVideo; pExObjects->GetRecordsByType(&oArrayVideo, true); @@ -2377,7 +2377,7 @@ void CPPTUserInfo::LoadExternal(CRecordExObjListContainer* pExObjects) { LoadExVideo(oArrayVideo[nIndex]); } - // читаем ole ---------------------------------------------- + // reading ole ---------------------------------------------- std::vector<CRecordExOleEmbedContainer*> oArrayObj; pExObjects->GetRecordsByType(&oArrayObj, true); @@ -2388,7 +2388,7 @@ void CPPTUserInfo::LoadExternal(CRecordExObjListContainer* pExObjects) oArrayObj.clear(); // ----------------------------------------------------------- - // читаем аудио ---------------------------------------------- + // reading audio ---------------------------------------------- std::vector<CRecordExCDAudioContainer*> oArrayAudioCD; std::vector<CRecordExMIDIAudioContainer*> oArrayAudioMIDI; std::vector<CRecordWAVAudioLinkContainer*> oArrayWAVLink; @@ -2663,7 +2663,7 @@ void CPPTUserInfo::AddAudioTransition(_UINT32 refID, CTransition* pTransition, c if (strRecord) pTransition->m_oAudio.m_sImageName = audioName; - // ??? недоделка ??? + // ??? unfinished ??? } void CPPTUserInfo::CreateDefaultStyle(PPT::CTextStyles& pStyle, PPT::CTheme* pTheme) diff --git a/MsBinaryFile/PptFile/Reader/PPTDocumentInfoOneUser.h b/MsBinaryFile/PptFile/Reader/PPTDocumentInfoOneUser.h index 3812682dff..e43de582dd 100644 --- a/MsBinaryFile/PptFile/Reader/PPTDocumentInfoOneUser.h +++ b/MsBinaryFile/PptFile/Reader/PPTDocumentInfoOneUser.h @@ -60,7 +60,7 @@ public: std::wstring m_strPassword; CRYPT::ECMADecryptor* m_pDecryptor; POLE::Storage* m_pStorageDecrypt; - std::vector<XLS::CFStreamPtr> m_arStreamDecrypt; // на каждый Persist свой ... оО + std::vector<XLS::CFStreamPtr> m_arStreamDecrypt; // each Persist has its own ... o_O std::map<_UINT32, CRecordSlide*> m_mapSlides; std::map<_UINT32, CRecordSlide*> m_mapMasters; @@ -73,7 +73,7 @@ public: std::vector<_UINT32> m_arrMastersOrder; std::vector<_UINT32> m_arrNotesOrder; - // перевод id мастера в индекс темы/шаблона + // translation of master id to theme/template index std::map<_UINT32, LONG> m_mapMasterToTheme; std::map<_UINT32, LONG> m_mapRealUsedMaster; @@ -110,12 +110,12 @@ public: std::vector<int> m_arOffsetPictures; bool m_bIsSetupEmpty; -// вся инфа о ex - файлах +// all info about ex-files CExMedia m_oExMedia; std::vector<CColor> m_oSchemeColors; - nullable<WORD> m_wLanguage; // язык пользователя (редактора) + nullable<WORD> m_wLanguage; // user (editor) language bool m_bRtl; bool m_bShowComments; diff --git a/MsBinaryFile/PptFile/Reader/PPTFileReader.cpp b/MsBinaryFile/PptFile/Reader/PPTFileReader.cpp index 6515aff979..a271db19f5 100644 --- a/MsBinaryFile/PptFile/Reader/PPTFileReader.cpp +++ b/MsBinaryFile/PptFile/Reader/PPTFileReader.cpp @@ -108,7 +108,7 @@ bool CPPTFileReader::IsPowerPoint() bool CPPTFileReader::IsEncrypted() { if (m_oDocumentInfo.m_arUsers.empty()) - return m_oDocumentInfo.m_oCurrentUser.m_bIsEncrypt; //wps не выставляет флаг! + return m_oDocumentInfo.m_oCurrentUser.m_bIsEncrypt; //wps doesn't set the flag! return m_oDocumentInfo.m_arUsers[0]->m_bEncrypt; } @@ -258,7 +258,7 @@ void CPPTFileReader::ReadPictures() while (true) { - //if (pStream->isEOF()) случаются неверно записанные стримы + //if (pStream->isEOF()) incorrectly written streams occur // break; unsigned long pos = pStream->getStreamPointer(); @@ -285,7 +285,7 @@ void CPPTFileReader::ReadPictures() oHeader.ReadFromStream(pStream->stream_); if (oHeader.RecType == 0 && oHeader.RecLen == 0 ) - break;// окончание стрима забито нулями (выравнивание) + break;// end of stream is padded with zeros (alignment) CRecordOfficeArtBlip art_blip; diff --git a/MsBinaryFile/PptFile/Reader/ReadStructures.cpp b/MsBinaryFile/PptFile/Reader/ReadStructures.cpp index d2c78da625..60b3ffe2be 100644 --- a/MsBinaryFile/PptFile/Reader/ReadStructures.cpp +++ b/MsBinaryFile/PptFile/Reader/ReadStructures.cpp @@ -294,7 +294,7 @@ void CTextPFRunRecord::LoadFromStream(POLE::Stream* pStream, bool bIsIndentation BYTE flag3 = (BYTE)(dwFlags >> 16); BYTE flag4 = (BYTE)(dwFlags >> 24); - //флаги чтения + //read flags bool hasBullet_ = (0x01 == (0x01 & flag1)); bool bulletHasFont_ = (0x02 == (0x02 & flag1)); bool bulletHasColor_ = (0x04 == (0x04 & flag1)); @@ -563,7 +563,7 @@ void CTextCFRunRecord::LoadFromStream(POLE::Stream* pStream, bool bIsIndentation if (BaseLineOffset_) m_oRun.BaseLineOffset = (double)StreamUtils::ReadSHORT(pStream); - // или два последних наоборот???? + // or the last two vice versa???? } @@ -714,7 +714,7 @@ void CMetaHeader::ToEMFHeader(Gdiplus::ENHMETAHEADER3* pHeader) pHeader->rclBounds.right = rcBounds.right; pHeader->rclBounds.bottom = rcBounds.bottom; - // нужно перевести в мм + // need to convert to mm pHeader->rclFrame.left = rcBounds.left; pHeader->rclFrame.top = rcBounds.top; pHeader->rclFrame.right = rcBounds.right; @@ -737,7 +737,7 @@ void CMetaHeader::ToEMFHeader(Gdiplus::ENHMETAHEADER3* pHeader) pHeader->szlDevice.cx = 200; pHeader->szlDevice.cy = 200; - // нужно перевести в мм + // need to convert to mm pHeader->szlMillimeters.cx = 100; pHeader->szlMillimeters.cy = 100; } diff --git a/MsBinaryFile/PptFile/Reader/Records.cpp b/MsBinaryFile/PptFile/Reader/Records.cpp index c8cf143fa5..bdcb7ad3d7 100644 --- a/MsBinaryFile/PptFile/Reader/Records.cpp +++ b/MsBinaryFile/PptFile/Reader/Records.cpp @@ -173,7 +173,7 @@ void CRecordsContainer::ReadFromStream(SRecordHeader & oHeader, const XLS::CFStr } if (lCurLen != m_oHeader.RecLen) { - // нужно разобраться, что тут такое!!! + // need to figure out what this is!!! LONG lPosition = 0; pStream->seekFromBegin(lPosition + m_oHeader.RecLen); } @@ -207,7 +207,7 @@ void CRecordsContainer::ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pS } if (lCurLen != m_oHeader.RecLen) { - // нужно разобраться, что тут такое!!! + // need to figure out what this is!!! LONG lPosition = 0; StreamUtils::StreamSeek(lPosition + m_oHeader.RecLen, pStream); } @@ -575,7 +575,7 @@ IRecord* CreateByType(SRecordHeader oHeader, _commonInfo* commonInfo) CREATE_BY_TYPE(RT_RoundTripColorMapping12Atom, RoundTripColorMapping12Atom) CREATE_BY_TYPE(RT_RoundTripOriginalMainMasterId12Atom, RoundTripOriginalMainMasterId12Atom) CREATE_BY_TYPE(RT_RoundTripCompositeMasterId12Atom, RoundTripCompositeMasterId12Atom) - CREATE_BY_TYPE(RT_RoundTripContentMasterInfo12Atom, RoundTripContentMasterInfo12Atom) // ECMA-376 дубль + CREATE_BY_TYPE(RT_RoundTripContentMasterInfo12Atom, RoundTripContentMasterInfo12Atom) // ECMA-376 duplicate CREATE_BY_TYPE(RT_RoundTripShapeId12Atom, RoundTripShapeId12Atom) CREATE_BY_TYPE(RT_RoundTripContentMasterId12Atom, RoundTripContentMasterId12Atom) CREATE_BY_TYPE(RT_RoundTripOArtTextStyles12Atom, RoundTripOArtTextStyles12Atom) @@ -681,12 +681,12 @@ IRecord* CreateByType(SRecordHeader oHeader, _commonInfo* commonInfo) CREATE_BY_TYPE(RT_List, CRecordDocInfoListContainer) - // интерактив + // interactive CREATE_BY_TYPE(RT_InteractiveInfoAtom, CRecordInteractiveInfoAtom) CREATE_BY_TYPE(RT_TextInteractiveInfoAtom, CRecordTextInteractiveInfoAtom) CREATE_BY_TYPE(RT_InteractiveInfo, CRecordMouseInteractiveInfoContainer) - // читаем для анимации + // read for animation CREATE_BY_TYPE(RT_SoundCollection, CRecordSoundCollectionContainer) CREATE_BY_TYPE(RT_ExternalObjectList, CRecordExObjListContainer) diff --git a/MsBinaryFile/PptFile/Reader/Records.h b/MsBinaryFile/PptFile/Reader/Records.h index 1892ff2f76..aa0d3935a2 100644 --- a/MsBinaryFile/PptFile/Reader/Records.h +++ b/MsBinaryFile/PptFile/Reader/Records.h @@ -123,7 +123,7 @@ public: if (NULL == pArray) return; - // возвращаем указатели, их не удалять наверху!!!! + // returning pointers, don't delete them above!!!! for (size_t nIndex = 0; nIndex < m_arRecords.size(); ++nIndex) { T pRec = dynamic_cast<T>(m_arRecords[nIndex]); diff --git a/MsBinaryFile/PptFile/Records/Animations/VisualShapeAtom.h b/MsBinaryFile/PptFile/Records/Animations/VisualShapeAtom.h index d38649439e..8bef037028 100644 --- a/MsBinaryFile/PptFile/Records/Animations/VisualShapeAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/VisualShapeAtom.h @@ -41,7 +41,7 @@ namespace PPT class CRecordVisualShapeAtom : public CUnknownRecord { public: - // Привязка анимации через этот объект к ID объекту + // Animation binding through this object to object ID virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; diff --git a/MsBinaryFile/PptFile/Records/Animations/VisualSoundAtom.h b/MsBinaryFile/PptFile/Records/Animations/VisualSoundAtom.h index c6427c94ba..0021e25ec2 100644 --- a/MsBinaryFile/PptFile/Records/Animations/VisualSoundAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/VisualSoundAtom.h @@ -41,7 +41,7 @@ namespace PPT class CRecordVisualSoundAtom : public CUnknownRecord { public: - // Привязка звука через этот объект к ID объекту + // Sound binding through this object to object ID virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; diff --git a/MsBinaryFile/PptFile/Records/DocumentRecords.cpp b/MsBinaryFile/PptFile/Records/DocumentRecords.cpp index 07ba0cfd4f..1e1203ca6d 100644 --- a/MsBinaryFile/PptFile/Records/DocumentRecords.cpp +++ b/MsBinaryFile/PptFile/Records/DocumentRecords.cpp @@ -82,7 +82,7 @@ void CRecordDocument::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStre }break; default: { - // этого не может быть... + // this cannot happen... continue; } }; diff --git a/MsBinaryFile/PptFile/Records/Drawing/ArtBlip.cpp b/MsBinaryFile/PptFile/Records/Drawing/ArtBlip.cpp index 1a2d8d2e89..c060a8e24b 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/ArtBlip.cpp +++ b/MsBinaryFile/PptFile/Records/Drawing/ArtBlip.cpp @@ -108,7 +108,7 @@ void CRecordOfficeArtBlip::ReadFromStream(SRecordHeader & oHeader, POLE::Stream* oMetaHeader.ToWMFHeader(&oWmfHeader); LONG lLenHeader = 22; - BYTE* pMetaHeader = new BYTE[lLenHeader]; // удалится в oMetaFile + BYTE* pMetaHeader = new BYTE[lLenHeader]; // will be deleted in oMetaFile memcpy(pMetaHeader, (void*)(&oWmfHeader), lLenHeader); oMetaFile.SetHeader(pMetaHeader, lLenHeader); diff --git a/MsBinaryFile/PptFile/Records/Drawing/ShapeContainer.cpp b/MsBinaryFile/PptFile/Records/Drawing/ShapeContainer.cpp index 8922864748..1ffa606e29 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/ShapeContainer.cpp +++ b/MsBinaryFile/PptFile/Records/Drawing/ShapeContainer.cpp @@ -127,7 +127,7 @@ CColor CPPTElement::CorrectSysColor(int nColorCode, CElementPtr pElement, CTheme if (color.m_lSchemeIndex != -1 && (int)pTheme->m_arColorScheme.size() > color.m_lSchemeIndex) { - //вытащить цвет ( + //extract color ( color = pTheme->m_arColorScheme[color.m_lSchemeIndex]; } @@ -587,7 +587,7 @@ void CPPTElement::SetUpProperty(CElementPtr pElement, CTheme* pTheme, CSlideInfo bool bUseShadowOk = (0x20 == (0x20 & flag3)); //if (bUseLineOk) - // pElement->m_bLine = bLineOk;//?? todooo проверить - не сраюатывает ! 1 (82).ppt + // pElement->m_bLine = bLineOk;//?? todooo check - doesn't work ! 1 (82).ppt if (bUseFillOk) pElement->m_bIsFilled = bFillOk; @@ -724,7 +724,7 @@ void CPPTElement::SetUpProperty(CElementPtr pElement, CTheme* pTheme, CSlideInfo }break; case shadowHighlight: { - //оттенок двойной тени + //double shadow tint }break; case shadowOffsetX: {//signed @@ -770,7 +770,7 @@ void CPPTElement::SetUpProperty(CElementPtr pElement, CTheme* pTheme, CSlideInfo if (!fUsefShadow && fUsefshadowObscured) { - //контурная + //outline pElement->m_oShadow.Visible = fshadowObscured; } }break; @@ -878,7 +878,7 @@ void CPPTElement::SetUpPropertyImage(CElementPtr pElement, CTheme* pTheme, CSlid case pibName: { image_element->m_sImageName = NSFile::CUtf8Converter::GetWStringFromUTF16((unsigned short*)pProperty->m_pOptions, pProperty->m_lValue /2-1); - // TextMining05.ppt, слайд 20 - некорректное имя ( - todooo потом подчистить его + // TextMining05.ppt, slide 20 - incorrect name ( - todooo clean it up later }break; case cropFromTop: { @@ -1187,7 +1187,7 @@ void CPPTElement::SetUpPropertyShape(CElementPtr pElement, CTheme* pTheme, CSlid } case ODRAW::geometryTextBooleanProperties: { - // вот здесь - нужно единицы перевести в пикселы + // here - need to convert units to pixels BYTE flag1 = (BYTE)(pProperty->m_lValue); BYTE flag2 = (BYTE)(pProperty->m_lValue >> 8); BYTE flag3 = (BYTE)(pProperty->m_lValue >> 16); @@ -1592,7 +1592,7 @@ CElementPtr CRecordShapeContainer::GetElement (bool inGroup, CExMedia* pMapIDs, { if (pLayout->m_arElements[nIndex]->m_bPlaceholderSet == false) { - pElementLayout = pLayout->m_arElements[nIndex]; //для переноса настроек + pElementLayout = pLayout->m_arElements[nIndex]; //for transferring settings pElementLayout->m_lID = lMasterID; if (placeholder_id >= 0 && pLayout->m_arElements[nIndex]->m_lPlaceholderID < 0 ) @@ -1631,7 +1631,7 @@ CElementPtr CRecordShapeContainer::GetElement (bool inGroup, CExMedia* pMapIDs, CExFilesInfo oInfo; CExFilesInfo oInfoDefault; - // по умолчанию картинка (или оле объект) + // by default image (or ole object) CExFilesInfo::ExFilesType exType = CExFilesInfo::eftNone; CExFilesInfo* pInfo = pMapIDs->Lock(0xFFFFFFFF, exType); if (NULL != pInfo) @@ -1739,7 +1739,7 @@ CElementPtr CRecordShapeContainer::GetElement (bool inGroup, CExMedia* pMapIDs, pElement->m_lID = oArrayShape[0]->m_nID; pElement->m_lLayoutID = lMasterID; - //---------внешние ссылки + //---------external links { CExFilesInfo::ExFilesType exType = CExFilesInfo::eftNone; CExFilesInfo * pTextureInfo = pMapIDs->Lock(0xFFFFFFFF, exType); @@ -1766,7 +1766,7 @@ CElementPtr CRecordShapeContainer::GetElement (bool inGroup, CExMedia* pMapIDs, // placeholders if (0 < oArrayPlaceHolder.size()) { - pElement->m_bLine = false; //по умолчанию у них нет линий + pElement->m_bLine = false; //by default they have no lines pElement->m_lPlaceholderID = oArrayPlaceHolder[0]->m_nPosition; pElement->m_lPlaceholderType = oArrayPlaceHolder[0]->m_nPlacementID; pElement->m_lPlaceholderSizePreset = oArrayPlaceHolder[0]->m_nSize; @@ -1818,7 +1818,7 @@ CElementPtr CRecordShapeContainer::GetElement (bool inGroup, CExMedia* pMapIDs, if (format_data) { pElement->m_nFormatDate = 1; - //todooo сделать форматированый вывод + //todooo make formatted output } else { @@ -1826,7 +1826,7 @@ CElementPtr CRecordShapeContainer::GetElement (bool inGroup, CExMedia* pMapIDs, pElement->m_nFormatDate = 2; } } - //------------- привязки --------------------------------------------------------------------------------- + //------------- bindings --------------------------------------------------------------------------------- std::vector<CRecordGroupShape*> oArrayGroupShape; this->GetRecordsByType(&oArrayGroupShape, true, true); @@ -1897,7 +1897,7 @@ CElementPtr CRecordShapeContainer::GetElement (bool inGroup, CExMedia* pMapIDs, } - //--------- наличие текста -------------------------------------------------------------------------- + //--------- text presence -------------------------------------------------------------------------- CShapeElement* pShapeElem = dynamic_cast<CShapeElement*>(pElement.get()); if (NULL != pShapeElem) @@ -1909,7 +1909,7 @@ CElementPtr CRecordShapeContainer::GetElement (bool inGroup, CExMedia* pMapIDs, pShapeElem->m_pShape->m_dWidthLogic = ShapeSizeVML; pShapeElem->m_pShape->m_dHeightLogic = ShapeSizeVML; - // проверка на textheader present + // check for textheader present std::vector<CRecordTextHeaderAtom*> oArrayTextHeader; GetRecordsByType(&oArrayTextHeader, true, true); @@ -1926,7 +1926,7 @@ CElementPtr CRecordShapeContainer::GetElement (bool inGroup, CExMedia* pMapIDs, oElementInfo.m_lMasterTextType = NoPresent; } - // проверка на ссылку в персист + // check for persist reference std::vector<CRecordOutlineTextRefAtom*> oArrayTextRefs; GetRecordsByType(&oArrayTextRefs, true, true); @@ -1935,7 +1935,7 @@ CElementPtr CRecordShapeContainer::GetElement (bool inGroup, CExMedia* pMapIDs, oElementInfo.m_lPersistIndex = oArrayTextRefs[0]->m_nIndex; } - // сам текст... + // the text itself... std::vector<CRecordTextBytesAtom*> oArrayTextBytes; GetRecordsByType(&oArrayTextBytes, true, true); if (0 < oArrayTextBytes.size() && strShapeText.empty()) @@ -2220,13 +2220,13 @@ void CRecordShapeContainer::ApplyThemeStyle(CElementPtr pElem, CTheme* pTheme, C } void CRecordShapeContainer::SetUpTextStyle(std::wstring& strText, CTheme* pTheme, CLayout* pLayout, CElementPtr pElem, CSlideInfo* pThemeWrapper, CSlideInfo* pSlideWrapper, CSlide* pSlide, CRecordMasterTextPropAtom* master_levels) { - // сначала проверяем на shape - // затем применяем все настройки по-очереди + // first check for shape + // then apply all settings in order // 1) master + TextMasterStyles // 2) persist + TextMasterStyles - // 3) свои настройки + TextMasterStyles - // причем "свои настройки" - это чисто "продвинутые настройки" - // потому что все общие ( через проперти ) - уже установлены + // 3) own settings + TextMasterStyles + // where "own settings" are purely "advanced settings" + // because all common ones (via properties) - are already set if (NULL == pElem) return; @@ -2240,10 +2240,10 @@ void CRecordShapeContainer::SetUpTextStyle(std::wstring& strText, CTheme* pTheme CTextAttributesEx* pTextSettings = &(pShape->m_pShape->m_oText); - // сначала применим ссылки на masterstyle (для шаблонного элемента) - // как узнать - просто есть ли массивы (т.к. они могли появиться пока только оттуда) - // - теперь этого делать не нужно - т.к. в мастере тоже вызывается эта функция - - // и там все это должно уже примениться + // first apply links to masterstyle (for template element) + // how to know - just check if arrays exist (since they could only appear from there) + // - now this is not needed - since this function is also called in master - + // and everything should already be applied there bool bIsPersistPresentSettings = false; bool bIsOwnPresentSettings = false; @@ -2253,7 +2253,7 @@ void CRecordShapeContainer::SetUpTextStyle(std::wstring& strText, CTheme* pTheme CShapeElement* pElementLayoutPH = NULL; - // выставим тип мастера + // set the master type if (NULL != pSlide) { int ph_type = pShape->m_lPlaceholderType; @@ -2312,7 +2312,7 @@ void CRecordShapeContainer::SetUpTextStyle(std::wstring& strText, CTheme* pTheme if (NULL != oElemInfo.m_pStream && -1 != oElemInfo.m_lOffsetTextStyle) { - // теперь нужно загрузить стили текста из стрима. + // now we need to load text styles from the stream. LONG lPosition = 0; StreamUtils::StreamPosition(lPosition, oElemInfo.m_pStream); StreamUtils::StreamSeek(oElemInfo.m_lOffsetTextStyle - 8, oElemInfo.m_pStream); @@ -2338,7 +2338,7 @@ void CRecordShapeContainer::SetUpTextStyle(std::wstring& strText, CTheme* pTheme // ------------------------------------------------------------------------------ - // теперь выставляем все настройки текста (стили) + // now set all text settings (styles) if (NULL == pSlide) { int nTextMasterType = (int)eTypeMaster; @@ -2429,7 +2429,7 @@ void CRecordShapeContainer::SetUpTextStyle(std::wstring& strText, CTheme* pTheme //} } - // теперь смотрим все остальные стили (persist и own) - просто применяем их к m_oStyles + // now look at all other styles (persist and own) - just apply them to m_oStyles if (eTypePersist != NoPresent && eTypePersist != eTypeMaster) { int nIndexType = (int)eTypePersist; @@ -2498,7 +2498,7 @@ void CRecordShapeContainer::SetUpTextStyle(std::wstring& strText, CTheme* pTheme pTextSettings->m_lStyleThemeIndex = -1; } - // теперь смотрим все остальные стили (persist и own) - просто применяем их к m_oStyles + // now look at all other styles (persist and own) - just apply them to m_oStyles if (eTypePersist != NoPresent && eTypePersist != eTypeMaster) { int nIndexType = (int)eTypePersist; @@ -2531,7 +2531,7 @@ void CRecordShapeContainer::SetUpTextStyle(std::wstring& strText, CTheme* pTheme if ((L"" != strText) && 0 == pTextSettings->m_arParagraphs.size()) { - // значит никаких своих настроек нету. Значит просто пустые свои настройки + // means no own settings. So just empty own settings std::vector<CTextPFRunRecord> oArrayPF; CTextPFRunRecord elm; @@ -2553,7 +2553,7 @@ void CRecordShapeContainer::SetUpTextStyle(std::wstring& strText, CTheme* pTheme if (NULL != oElemInfo.m_pStream && -1 != oElemInfo.m_lOffsetTextProp) { - //языковые настройки текта + //text language settings LONG lPosition = 0; StreamUtils::StreamPosition(lPosition, oElemInfo.m_pStream); StreamUtils::StreamSeek(oElemInfo.m_lOffsetTextProp - 8, oElemInfo.m_pStream); @@ -2579,7 +2579,7 @@ void CRecordShapeContainer::SetUpTextStyle(std::wstring& strText, CTheme* pTheme if (pShape->m_oTextActions.m_bPresent) { - //todooo разобраться нужно ли менять цвет на гиперлинк - 1-(34).ppt + //todooo figure out if we need to change color for hyperlink - 1-(34).ppt ODRAW::CColor oColor; if ((NULL != pSlide) && !pSlide->m_bUseLayoutColorScheme) oColor = pSlide->GetColor(11); else if ((NULL != pLayout) && (!pLayout->m_bUseThemeColorScheme)) oColor = pLayout->GetColor(11); @@ -2591,7 +2591,7 @@ void CRecordShapeContainer::SetUpTextStyle(std::wstring& strText, CTheme* pTheme CPPTShape* pPPTShape = dynamic_cast<CPPTShape*>(pShape->m_pShape->getBaseShape().get()); - if (NULL != pPPTShape) // проверка на wordart + if (NULL != pPPTShape) // check for wordart { switch (pPPTShape->m_eType) { diff --git a/MsBinaryFile/PptFile/Records/Drawing/ShapeProperties.cpp b/MsBinaryFile/PptFile/Records/Drawing/ShapeProperties.cpp index 14f548b180..3f9bc693fc 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/ShapeProperties.cpp +++ b/MsBinaryFile/PptFile/Records/Drawing/ShapeProperties.cpp @@ -53,7 +53,7 @@ void CRecordShapeProperties::ReadFromStream(SRecordHeader &oHeader, POLE::Stream m_oProperties.FromStream(pStream, m_oHeader.RecInstance); // _UINT32 dwLen = m_oProperties.GetLen(); - // это на всякий случай, может там напридумывают проперти с complex - - // которые мы не поддерживаем... + // just in case, they might add complex properties - + // that we don't support... StreamUtils::StreamSeek(lPosition + m_oHeader.RecLen, pStream); } diff --git a/MsBinaryFile/PptFile/Records/FontEntityAtom.cpp b/MsBinaryFile/PptFile/Records/FontEntityAtom.cpp index 5572d24e0d..938dc955f5 100644 --- a/MsBinaryFile/PptFile/Records/FontEntityAtom.cpp +++ b/MsBinaryFile/PptFile/Records/FontEntityAtom.cpp @@ -66,7 +66,7 @@ void CRecordFontEntityAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream } else { - m_strFaceName = std::wstring((wchar_t*)utf16FaceName/*, lReadByte/2*/); // по факту .. нули нам не нужны + m_strFaceName = std::wstring((wchar_t*)utf16FaceName/*, lReadByte/2*/); // in fact.. we don't need the nulls } m_lfCharSet = StreamUtils::ReadBYTE(pStream); diff --git a/MsBinaryFile/PptFile/Records/SlideContainer.cpp b/MsBinaryFile/PptFile/Records/SlideContainer.cpp index bc8069a432..516ef3d66c 100644 --- a/MsBinaryFile/PptFile/Records/SlideContainer.cpp +++ b/MsBinaryFile/PptFile/Records/SlideContainer.cpp @@ -108,7 +108,7 @@ void CRecordSlide::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) } if (lCurLen != m_oHeader.RecLen) { - // нужно разобраться, что тут такое!!! + // need to figure out what this is!!! LONG lPosition = 0; StreamUtils::StreamSeek(lPosition + m_oHeader.RecLen, pStream); } diff --git a/MsBinaryFile/PptFile/Records/SlideListWithText.cpp b/MsBinaryFile/PptFile/Records/SlideListWithText.cpp index 45b5253222..2fb6e30770 100644 --- a/MsBinaryFile/PptFile/Records/SlideListWithText.cpp +++ b/MsBinaryFile/PptFile/Records/SlideListWithText.cpp @@ -49,7 +49,7 @@ void CRecordSlideListWithText::ReadFromStream(SRecordHeader &oHeader, POLE::Stre if (m_oHeader.IsContainer()) { - // а по-другому и быть не могло... + // and it couldn't be otherwise... _UINT32 lSymbolCount = 0; UINT lCurLen = 0; @@ -106,7 +106,7 @@ void CRecordSlideListWithText::ReadFromStream(SRecordHeader &oHeader, POLE::Stre if (0 > nCurrentTextHeader) continue; - // здесь еще настойки кроме текста + // here are more settings besides text if (NULL != pChars) { m_arTextPlaceHolders[nCurrentSlide][nCurrentTextHeader].m_strText = pChars->m_strText; diff --git a/MsBinaryFile/PptFile/Records/StyleTextPropAtom.cpp b/MsBinaryFile/PptFile/Records/StyleTextPropAtom.cpp index 67e2eafa1c..c1fff3e227 100644 --- a/MsBinaryFile/PptFile/Records/StyleTextPropAtom.cpp +++ b/MsBinaryFile/PptFile/Records/StyleTextPropAtom.cpp @@ -81,8 +81,8 @@ void CRecordStyleTextPropAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stre ++lCountItems; } - // на всякий случай... - // здесь когда текст сначала другой (т.е. например - placeholder в мастере) - - // то у нас неправильно выставился m_lCount... + // just in case... + // here when the text is initially different (e.g. placeholder in master) - + // then m_lCount is set incorrectly... StreamUtils::StreamSeek(m_lOffsetInStream + m_oHeader.RecLen, pStream); } diff --git a/MsBinaryFile/PptFile/Records/StyleTextPropAtom.h b/MsBinaryFile/PptFile/Records/StyleTextPropAtom.h index 8639c4b9ef..0758e319dc 100644 --- a/MsBinaryFile/PptFile/Records/StyleTextPropAtom.h +++ b/MsBinaryFile/PptFile/Records/StyleTextPropAtom.h @@ -37,11 +37,11 @@ namespace PPT class CRecordStyleTextPropAtom : public CUnknownRecord { public: - // нужно еще хранить позицию в стриме, - // указатель на начало + // also need to store position in stream, + // pointer to the beginning LONG m_lOffsetInStream; - - // просто данные. будут обновляться по мере прибытия + + // just data. will be updated as it arrives // Text.Bytes/Chars.Atom _UINT32 m_lCount; diff --git a/MsBinaryFile/PptFile/Records/TextCFExceptionAtom.cpp b/MsBinaryFile/PptFile/Records/TextCFExceptionAtom.cpp index 406f83a170..29be42bbac 100644 --- a/MsBinaryFile/PptFile/Records/TextCFExceptionAtom.cpp +++ b/MsBinaryFile/PptFile/Records/TextCFExceptionAtom.cpp @@ -50,6 +50,6 @@ void CRecordTextCFExceptionAtom::ReadFromStream(SRecordHeader &oHeader, POLE::St m_oCFRun.LoadFromStream(pStream, false); - // это на всякий случай... + // just in case... StreamUtils::StreamSeek(lPosition + m_oHeader.RecLen, pStream); } diff --git a/MsBinaryFile/PptFile/Records/TextMasterStyleAtom.cpp b/MsBinaryFile/PptFile/Records/TextMasterStyleAtom.cpp index c18e1f5e1f..0dba6eae9a 100644 --- a/MsBinaryFile/PptFile/Records/TextMasterStyleAtom.cpp +++ b/MsBinaryFile/PptFile/Records/TextMasterStyleAtom.cpp @@ -65,7 +65,7 @@ void CRecordTextMasterStyleAtom::ReadFromStream(SRecordHeader &oHeader, POLE::St if (4 < lLevels) LoadLevel(4, pStream, bIsLevelsPresent); - // походу нужно делать так: ---------------------------------------------- + // it seems we need to do it this way: ---------------------------------------------- if (m_pLevels[0].is_init()) { if (!m_pLevels[1].is_init()) @@ -96,7 +96,7 @@ void CRecordTextMasterStyleAtom::ReadFromStream(SRecordHeader &oHeader, POLE::St } // ----------------------------------------------------------------------- - // это на всякий случай... + // just in case... StreamUtils::StreamSeek(lPosition + m_oHeader.RecLen, pStream); } diff --git a/MsBinaryFile/PptFile/Records/TextPFExceptionAtom.cpp b/MsBinaryFile/PptFile/Records/TextPFExceptionAtom.cpp index ef125c08af..c8b130b4c1 100644 --- a/MsBinaryFile/PptFile/Records/TextPFExceptionAtom.cpp +++ b/MsBinaryFile/PptFile/Records/TextPFExceptionAtom.cpp @@ -50,7 +50,7 @@ void CRecordTextPFExceptionAtom::ReadFromStream(SRecordHeader &oHeader, POLE::St m_oPFRun.LoadFromStream(pStream, m_oHeader.RecLen == 12); - // это на всякий случай... + // just in case... POLE::uint64 current_pos = pStream->tell(); StreamUtils::StreamSeek(lPosition + m_oHeader.RecLen, pStream); } diff --git a/MsBinaryFile/PptFile/Records/TextRulerAtom.cpp b/MsBinaryFile/PptFile/Records/TextRulerAtom.cpp index 28f0fdf1f0..29f0c1c960 100644 --- a/MsBinaryFile/PptFile/Records/TextRulerAtom.cpp +++ b/MsBinaryFile/PptFile/Records/TextRulerAtom.cpp @@ -49,6 +49,6 @@ void CRecordTextRulerAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream * NSStreamReader::Read(pStream, m_oTextRuler); - // на всякий случай... + // just in case... StreamUtils::StreamSeek(lOffset + m_oHeader.RecLen, pStream); } diff --git a/MsBinaryFile/PptFile/Records/TextSIExceptionAtom.cpp b/MsBinaryFile/PptFile/Records/TextSIExceptionAtom.cpp index 5652538fd6..304bd09ec3 100644 --- a/MsBinaryFile/PptFile/Records/TextSIExceptionAtom.cpp +++ b/MsBinaryFile/PptFile/Records/TextSIExceptionAtom.cpp @@ -50,6 +50,6 @@ void CRecordTextSIExceptionAtom::ReadFromStream(SRecordHeader &oHeader, POLE::St NSStreamReader::Read(pStream, m_oSIRun, false); - // это на всякий случай... + // just in case... StreamUtils::StreamSeek(lPosition + m_oHeader.RecLen, pStream); } diff --git a/MsBinaryFile/PptFile/Records/TextSpecInfoAtom.cpp b/MsBinaryFile/PptFile/Records/TextSpecInfoAtom.cpp index e6f7e9b5ae..d025d8de1a 100644 --- a/MsBinaryFile/PptFile/Records/TextSpecInfoAtom.cpp +++ b/MsBinaryFile/PptFile/Records/TextSpecInfoAtom.cpp @@ -64,9 +64,9 @@ void CRecordTextSpecInfoAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Strea break; } - // на всякий случай... - // здесь когда текст сначала другой (т.е. например - placeholder в мастере) - - // то у нас неправильно выставился m_lCount... на число m_lCount пилюем .. берем структур si скока прописано + // just in case... + // here when the text is initially different (e.g. placeholder in master) - + // then m_lCount is set incorrectly... we ignore m_lCount and take as many si structures as specified StreamUtils::StreamSeek(m_lOffsetInStream + m_oHeader.RecLen, pStream); } diff --git a/MsBinaryFile/PptFile/Records/TextSpecInfoAtom.h b/MsBinaryFile/PptFile/Records/TextSpecInfoAtom.h index 07171760a1..f7c27736ae 100644 --- a/MsBinaryFile/PptFile/Records/TextSpecInfoAtom.h +++ b/MsBinaryFile/PptFile/Records/TextSpecInfoAtom.h @@ -39,8 +39,8 @@ namespace PPT class CRecordTextSpecInfoAtom : public CUnknownRecord { public: - // нужно еще хранить позицию в стриме, - // указатель на начало + // also need to store position in stream, + // pointer to the beginning LONG m_lOffsetInStream; _UINT32 m_lCount; diff --git a/MsBinaryFile/PptFile/Records/ViewInfoAtom.cpp b/MsBinaryFile/PptFile/Records/ViewInfoAtom.cpp index 739578ba54..cb20b773ab 100644 --- a/MsBinaryFile/PptFile/Records/ViewInfoAtom.cpp +++ b/MsBinaryFile/PptFile/Records/ViewInfoAtom.cpp @@ -53,6 +53,6 @@ void CRecordViewInfoAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *p m_bZoomToFit = StreamUtils::ReadBYTE(pStream); m_bDraftMode = StreamUtils::ReadBYTE(pStream); - // 2 байта зарезервированы... + // 2 bytes are reserved... StreamUtils::StreamSkip(2, pStream); } diff --git a/MsBinaryFile/XlsFile/Converter/XlsConverter.cpp b/MsBinaryFile/XlsFile/Converter/XlsConverter.cpp index 523ca5b4d3..c801aa07bf 100644 --- a/MsBinaryFile/XlsFile/Converter/XlsConverter.cpp +++ b/MsBinaryFile/XlsFile/Converter/XlsConverter.cpp @@ -980,7 +980,7 @@ std::wstring XlsConverter::WriteMediaFile(char *data, int size, std::wstring typ { if (size < 1 || !data) return L""; - if (id < 0) id = xlsx_context->get_mediaitems().count_image + 1000; // 1000 - встроенные в поток , 3000 - footer/header + if (id < 0) id = xlsx_context->get_mediaitems().count_image + 1000; // 1000 - embedded in stream, 3000 - footer/header xlsx_context->get_mediaitems().create_media_path(xlsx_path); @@ -998,7 +998,7 @@ std::wstring XlsConverter::WriteMediaFile(char *data, int size, std::wstring typ if (header->biWidth > 100000 || header->biHeight > 100000) { //biff8 - //Formulas Matriciais - A Outra Dimensão do Excel.xls 775x20 todoooo найти еще файлы + //Formulas Matriciais - A Outra Dimensão do Excel.xls 775x20 todoooo find more files //Planilha Bastter Blue 7.0 Free.xls 10x3836 //biff 5 //test-picture.xls @@ -1013,7 +1013,7 @@ std::wstring XlsConverter::WriteMediaFile(char *data, int size, std::wstring typ //if (header_core->bcWidth % 2 != 0 && sz_bitmap < size - offset) // header_core->bcWidth++; - ///???? todooo непонятно .. в biff5 нужно флипать картинку, в biff8 не ясно ( - + ///???? todo unclear .. in biff5 need to flip the image, in biff8 it's unclear ( - int stride = - (size - offset) / header_core->bcHeight; frame.put_Stride (stride/*header_core->bcBitCount * header_core->bcWidth /8 */); @@ -1063,7 +1063,7 @@ std::wstring XlsConverter::WriteMediaFile(char *data, int size, std::wstring typ } else if (biSizeImage > 0) { - //тут паттерные картинки + // pattern images here file_name += std::wstring(L".bmp"); NSFile::CFileBinary file; if (file.CreateFileW(xlsx_context->get_mediaitems().media_path() + file_name)) @@ -1379,7 +1379,7 @@ void XlsConverter::convert(XLS::OBJECTS* objects, XLS::WorksheetSubstream * shee //----------------------------------------------------------------------------- if (type_object < 0) continue; if (group_objects.empty()) - break; /// что то с объектами не то ! 2006 02.xls + break; /// something wrong with objects! 2006 02.xls if (type_object == 0) { @@ -1390,7 +1390,7 @@ void XlsConverter::convert(XLS::OBJECTS* objects, XLS::WorksheetSubstream * shee gr.count = gr.spgr ? gr.spgr->child_records.size() : 0; group_objects.push_back(gr); } - else //сюда попадать не должно !!!! + else // should never get here !!!! continue; } if (obj->cmo.fUIObj) @@ -1655,7 +1655,7 @@ void XlsConverter::convert_fill_style(std::vector<ODRAW::OfficeArtFOPTEPtr> & pr std::map<int, std::wstring>::iterator it = xls_global_info->colors_palette.find(color.index); if (it != xls_global_info->colors_palette.end()) { - //убрать 0!!! todooo + // todo remove 0!!! xlsx_context->get_drawing_context().set_fill_color(0, it->second); } } @@ -1679,7 +1679,7 @@ void XlsConverter::convert_fill_style(std::vector<ODRAW::OfficeArtFOPTEPtr> & pr std::map<int, std::wstring>::iterator it = xls_global_info->colors_palette.find(color.index); if (it != xls_global_info->colors_palette.end()) { - //todooo убрать 0 !!! + // todo remove 0 !!! xlsx_context->get_drawing_context().set_fill_color(0, it->second, true ); } } @@ -1780,7 +1780,7 @@ void XlsConverter::convert_line_style(std::vector<ODRAW::OfficeArtFOPTEPtr> & pr std::map<int, std::wstring>::iterator it = xls_global_info->colors_palette.find(color.index); if (it != xls_global_info->colors_palette.end()) { - //todooo убрать 0 !! + // todo remove 0 !! xlsx_context->get_drawing_context().set_line_color(0, it->second); } } @@ -2394,7 +2394,7 @@ void XlsConverter::convert(XLS::Note* note) if (xls_global_info->Version < 0x0600) { - //todooo размеры произвольные .. можно сделать оценку по размеру строки + // todo sizes are arbitrary .. can estimate by string size xlsx_context->get_drawing_context().set_sheet_anchor(0, 0, 0, 0, 0, 0, 0, 0, note->note_sh.x_, note->note_sh.y_, 120 * 12700., 64 * 12700.); xlsx_context->get_drawing_context().set_text(std::wstring(L"<t>") + note->note_sh.stText.value() + std::wstring(L"</t>")); } @@ -2671,7 +2671,7 @@ void XlsConverter::convert(XLS::ChartSheetSubstream* chart) if (chart == NULL) return; chart->serialize(xlsx_context->current_chart().chartData()); - //convert(chart->m_OBJECTSCHART.get());непонятные какие то текстбоксы - пустые и бз привязок + //convert(chart->m_OBJECTSCHART.get()); some unclear textboxes - empty and without bindings } void XlsConverter::convert(XLS::PIVOTVIEW* pivot_view) diff --git a/MsBinaryFile/XlsFile/Converter/external_items.h b/MsBinaryFile/XlsFile/Converter/external_items.h index 635be2dbdc..0620523744 100644 --- a/MsBinaryFile/XlsFile/Converter/external_items.h +++ b/MsBinaryFile/XlsFile/Converter/external_items.h @@ -98,7 +98,7 @@ public: size_t count_embeddings; size_t count_controls; - //std::wstring add_or_find(const std::wstring & href, Type type, bool & isInternal);//возможны ссылки на один и тот же объект + //std::wstring add_or_find(const std::wstring & href, Type type, bool & isInternal);// possible references to the same object std::wstring add_image (const std::wstring & file_name, int bin_id); std::wstring add_chart (std::wstring & oox_target); std::wstring add_embedding (std::wstring & oox_target, const std::wstring & info); diff --git a/MsBinaryFile/XlsFile/Converter/xlsx_conversion_context.cpp b/MsBinaryFile/XlsFile/Converter/xlsx_conversion_context.cpp index 30c18e562f..29ef1e8ebc 100644 --- a/MsBinaryFile/XlsFile/Converter/xlsx_conversion_context.cpp +++ b/MsBinaryFile/XlsFile/Converter/xlsx_conversion_context.cpp @@ -172,9 +172,9 @@ void xlsx_conversion_context::set_sheet_id(int id) void xlsx_conversion_context::start_chart() { charts_.push_back(oox_chart_context::create()); - //добавляем новую форму для диаграммы - //в ней будет информационная часть - и она пишется каждый раз в свою xml (их - по числу диаграмм) - //этот контекст нужно передавать в файл + //add new form for chart + //it will contain informational part - and it's written each time to its own xml (one per chart) + //this context needs to be passed to file } @@ -250,7 +250,7 @@ void xlsx_conversion_context::end_document() { std::wstringstream workbook_content; - //for (size_t i = 0; i < sheets_.size(); i++) нужно по id + //for (size_t i = 0; i < sheets_.size(); i++) need by id for (std::map<int, int>::iterator it = sheets_map_.begin(); it != sheets_map_.end(); ++it) { int i = it->second; diff --git a/MsBinaryFile/XlsFile/Converter/xlsx_conversion_context.h b/MsBinaryFile/XlsFile/Converter/xlsx_conversion_context.h index 87dbbf337b..6c4c1cae57 100644 --- a/MsBinaryFile/XlsFile/Converter/xlsx_conversion_context.h +++ b/MsBinaryFile/XlsFile/Converter/xlsx_conversion_context.h @@ -130,7 +130,7 @@ private: std::vector<oox_external_context_ptr> externals_; std::vector<oox_activeX_context_ptr> activeXs_; - size_t next_vml_file_id_; //используется для footer/header & comments + size_t next_vml_file_id_; // used for footer/header & comments std::map<int, int> sheets_map_; std::vector<xlsx_xml_worksheet_ptr> sheets_; diff --git a/MsBinaryFile/XlsFile/Converter/xlsx_drawing_context.cpp b/MsBinaryFile/XlsFile/Converter/xlsx_drawing_context.cpp index 11e5664e0c..9049fd83f0 100644 --- a/MsBinaryFile/XlsFile/Converter/xlsx_drawing_context.cpp +++ b/MsBinaryFile/XlsFile/Converter/xlsx_drawing_context.cpp @@ -99,7 +99,7 @@ public: } std::pair<std::wstring, std::wstring> add_drawing_xml(std::wstring const & content, xlsx_drawings_rels_ptr rels) - {//todooo отсчеты номеров файлов отдельно + {// todo file number counters separately const std::wstring id = std::to_wstring(next_drawing_id_++); const std::wstring fileName = std::wstring(L"drawing") + id + L".xml"; @@ -203,8 +203,8 @@ _color xlsx_drawing_context::CorrectSysColor(int nColorCode, _drawing_state_ptr if (color.index != -1) { - //вытащить цвет ( - //todoooo сдлать темы !!!!! + // extract color + // todo make themes !!!!! color.nRGB = shemeDefaultColor[color.index]; color.index = -1; color.sRGB = STR::toRGB(color.nRGB); @@ -291,7 +291,7 @@ _color xlsx_drawing_context::CorrectSysColor(int nColorCode, _drawing_state_ptr color.SetRGB(0xff - color.GetR(), 0xff - color.GetG(), 0xff - color.GetB()); //if (color.sRGB.empty()) - //{неверно + // {incorrect // color.nRGB = shemeDefaultColor[nColorIndex]; // color.index = -1; // color.sRGB = STR::toRGB(color.nRGB); @@ -429,7 +429,7 @@ void xlsx_drawing_context::end_group() // { // _drawing_state_ptr & drawing_state = cur_states->front(); - // if (i != 0 || level != current_level) // группа сама себя + // if (i != 0 || level != current_level) // group refers to itself // { // double kf_x = (double)drawing_state->child_anchor.cx / drawing_state->group_anchor.cx; // double kf_y = (double)drawing_state->child_anchor.cy / drawing_state->group_anchor.cy; @@ -981,14 +981,14 @@ void xlsx_drawing_context::end_drawing(_drawing_state_ptr & drawing_state) serialize_shape(drawing_state); drawing_states_objects.push_back(drawing_state); // for serialize in sheet } - if ( drawing_state->type == external_items::typeActiveX) // объекты управления с бинарными свойствами + if ( drawing_state->type == external_items::typeActiveX) // control objects with binary properties { context_.end_activeX(); serialize_shape(drawing_state); drawing_states_controls.push_back(drawing_state); // for serialize in sheet } - if ( drawing_state->type == external_items::typeControl)// объекты управления с xml свойствами + if ( drawing_state->type == external_items::typeControl)// control objects with xml properties { serialize_control(drawing_state); if (drawing_state->objectId.empty()) @@ -1067,14 +1067,14 @@ void xlsx_drawing_context::serialize_group() { CP_XML_STREAM() << drawing_state->xmlFillAlternative; } - //serialize_fill(CP_XML_STREAM(), drawing_state); ???? белый //Family budget (monthly)1.xls + //serialize_fill(CP_XML_STREAM(), drawing_state); ???? white //Family budget (monthly)1.xls //serialize_line(CP_XML_STREAM(), drawing_state); } for (size_t i = 1; i < current_drawing_states->size(); i++) { CP_XML_STREAM() << current_drawing_states->at(i)->shape; - //todooo current_drawing_states->at(i).shape.erase(); // память поэкономить + //todo current_drawing_states->at(i).shape.erase(); // save memory } } } @@ -1393,7 +1393,7 @@ void xlsx_drawing_context::serialize_vml_pic(_drawing_state_ptr & drawing_state) std::wstring style = std::wstring(L"position:absolute;margin-left:0;margin-top:0;"); - //todooo сделать "покороче" значения .. достаточно 2 знаков после запятой + // todo make values "shorter" .. 2 decimal places is enough style += std::wstring(L"width:") + std::to_wstring(drawing_state->child_anchor.cx) + std::wstring(L"pt;"); style += std::wstring(L"height:") + std::to_wstring(drawing_state->child_anchor.cy) + std::wstring(L"pt;"); style += std::wstring(L"z-index:") + std::to_wstring(drawing_state->id) + std::wstring(L";"); @@ -1723,7 +1723,7 @@ void xlsx_drawing_context::serialize_shape(_drawing_state_ptr & drawing_state) { CP_XML_NODE(L"a:avLst") { - // нужен перерасчет + // recalculation needed //for (size_t i = 0; i < drawing_state->custom_adjustValues.size(); i++) //{ // if (drawing_state->custom_adjustValues[i]) @@ -1856,7 +1856,7 @@ std::wstring xlsx_drawing_context::convert_custom_shape(_drawing_state_ptr & dra } for (size_t i = 0 ; i < drawing_state->custom_guides.size(); i++) - {//todooo объеденить/срастить !! + {// todo merge/combine !! NSCustomVML::CGuide guid; guid.m_eType = drawing_state->custom_guides[i].m_eType; @@ -1885,7 +1885,7 @@ std::wstring xlsx_drawing_context::convert_custom_shape(_drawing_state_ptr & dra shape->m_oCustomVML.addSegment(drawing_state->custom_segments[i].m_eRuler , drawing_state->custom_segments[i].m_nCount); } //for (int i = 0; i < drawing_state->custom_adjustHandles.size(); i++) - //{//todooo - ранее этого не было ????? + //{// todo - this wasn't here before ????? // shape->m_oCustomVML.addHandle(i, *drawing_state->custom_adjustHandles[i]); //} for (size_t i = 0; i < drawing_state->custom_adjustValues.size(); i++) @@ -2134,7 +2134,7 @@ void xlsx_drawing_context::serialize_gradient_fill(std::wostream & stream, _draw { CP_XML_ATTR(L"pos", (int)(fill.colorsPosition[i].first * 100000)); serialize_color(CP_XML_STREAM(), fill.colorsPosition[i].second, fill.colorsPosition[i].second.opacity); - //проверить что если тут индексы то они берутся с программных а не с юзерских (см как ниже) + // check that if there are indices here, they are taken from programmatic ones not user ones (see below) } } } @@ -2142,13 +2142,13 @@ void xlsx_drawing_context::serialize_gradient_fill(std::wostream & stream, _draw { CP_XML_NODE(L"a:gs") { - fill.color.bScheme = false; // по общим индексам + fill.color.bScheme = false; // by common indices CP_XML_ATTR(L"pos", 0); serialize_color(CP_XML_STREAM(), fill.color, fill.color.opacity); } CP_XML_NODE(L"a:gs") { - fill.color2.bScheme = false; // по общим индексам + fill.color2.bScheme = false; // by common indices CP_XML_ATTR(L"pos", 100000); serialize_color(CP_XML_STREAM(), fill.color2, fill.color2.opacity); } @@ -2351,7 +2351,7 @@ void xlsx_drawing_context::serialize_text(std::wostream & stream, _drawing_state CP_XML_NODE(L"a:prstTxWarp") { CP_XML_ATTR(L"prst", prstTxWarp); - CP_XML_NODE(L"a:avLst");//модификаторы + CP_XML_NODE(L"a:avLst");// modifiers } } else diff --git a/MsBinaryFile/XlsFile/Converter/xlsx_drawing_context.h b/MsBinaryFile/XlsFile/Converter/xlsx_drawing_context.h index 3b54a6c705..2ba036a06c 100644 --- a/MsBinaryFile/XlsFile/Converter/xlsx_drawing_context.h +++ b/MsBinaryFile/XlsFile/Converter/xlsx_drawing_context.h @@ -224,8 +224,8 @@ public: margins.left = margins.right = 0x00016530; margins.top = margins.bottom = 0x0000b298; } - std::wstring content; //c форматированием oox - std::wstring vml_content; //c форматированием vml + std::wstring content; //with oox formatting + std::wstring vml_content; //with vml formatting int wrap = 0; //square int align = 0; //noset int vert_align = 0; //noset @@ -595,8 +595,8 @@ private: std::vector<_drawing_state_ptr> drawing_states; std::vector<_drawing_state_ptr>* current_drawing_states; - std::vector<_drawing_state_ptr> drawing_states_objects;//копии для сериализации ole - std::vector<_drawing_state_ptr> drawing_states_controls;//копии для сериализации control + std::vector<_drawing_state_ptr> drawing_states_objects;//copies for ole serialization + std::vector<_drawing_state_ptr> drawing_states_controls;//copies for control serialization void end_drawing (_drawing_state_ptr & drawing_state); void reset_fill_pattern (_drawing_state_ptr & drawing_state); diff --git a/MsBinaryFile/XlsFile/Converter/xlsx_package.cpp b/MsBinaryFile/XlsFile/Converter/xlsx_package.cpp index ae754f1f5b..80a93d0dcd 100644 --- a/MsBinaryFile/XlsFile/Converter/xlsx_package.cpp +++ b/MsBinaryFile/XlsFile/Converter/xlsx_package.cpp @@ -630,7 +630,7 @@ void xl_activeX_files::write(const std::wstring & RootPath) if (activeXs_.empty()) return; std::wstring path = RootPath + FILE_SEPARATOR_STR + L"activeX"; - //NSDirectory::CreateDirectory(path.c_str()); уже есть + //NSDirectory::CreateDirectory(path.c_str()); already exists content_type & contentTypes = this->get_main_document()->content_type().get_content_type(); static const std::wstring kWSConType = L"application/vnd.ms-office.activeX+xml"; diff --git a/MsBinaryFile/XlsFile/Converter/xlsx_textcontext.cpp b/MsBinaryFile/XlsFile/Converter/xlsx_textcontext.cpp index d2ec838772..02032b8219 100644 --- a/MsBinaryFile/XlsFile/Converter/xlsx_textcontext.cpp +++ b/MsBinaryFile/XlsFile/Converter/xlsx_textcontext.cpp @@ -76,7 +76,7 @@ public: void ApplyTextProperties(); - void set_local_styles_container();//это если стили объектов содержатся в другом документе + void set_local_styles_container();//this is if object styles are contained in another document bool is_drawing_context(){return in_draw;} @@ -99,12 +99,12 @@ private: std::wstring dump_text(); void write_rPr(std::wostream & strm); - size_t paragraphs_cout_; //???? тока из за начала отсчета? + size_t paragraphs_cout_; //???? only because of start counting? std::wstringstream text_; std::wstringstream output_; - std::wstring paragraph_style_name_;//был вектор ... не нужен, так как в один момент времени может быть тока один стиль параграфа,текста,объекта при приходе нового - дампится + std::wstring paragraph_style_name_;//was vector ... not needed, since at one moment only one paragraph/text/object style can exist, when new one arrives - dumps std::wstring span_style_name_; }; @@ -156,7 +156,7 @@ void xlsx_text_context::Impl::end_paragraph() in_paragraph = false; } -void xlsx_text_context::Impl::start_span(const std::wstring & styleName)//кусок текста в абзаце(параграфе) со своими свойствами - этто может быть и 1 буква +void xlsx_text_context::Impl::start_span(const std::wstring & styleName)//text fragment in paragraph with its own properties - can be just 1 letter { if (!in_comment && !in_draw) { @@ -173,8 +173,8 @@ void xlsx_text_context::Impl::start_span(const std::wstring & styleName)//кус in_span=true; } -void xlsx_text_context::Impl::end_span() //odf корявенько написан - возможны повторы стилей в последовательных кусках текста -//пока с анализом стилей тока комменты - остальные текстовые куски как есть.. с охрененным возможно дубляжом +void xlsx_text_context::Impl::end_span() //odf is written awkwardly - style repeats possible in consecutive text fragments +//for now style analysis only for comments - other text fragments as is.. with possible huge duplication { if (!in_comment && !in_draw) { @@ -222,7 +222,7 @@ void xlsx_text_context::Impl::write_rPr(std::wostream & strm) //oox_serialize_style_text(strm,odf_reader::text_format_properties & properties); CP_XML_NODE(L"a:rPr") { - //стр 3197 + //page 3197 //if (dValFontSize) {CP_XML_ATTR(L"sz", (int)(dValFontSize.get()*100));} //if ((iValFontStyle) && (iValFontStyle.get() >0)) {CP_XML_ATTR(L"i", "1");} //"true");} Exercícios de Aprendizagem.ods //if ((iValFontWeight) && (iValFontWeight.get() >0)) {CP_XML_ATTR(L"b", "1");} //"true");} Exercícios de Aprendizagem.ods @@ -290,9 +290,9 @@ void xlsx_text_context::Impl::start_cell_content() { paragraphs_cout_ = 0; - output_.str(std::wstring());//строка дампа - - text_.str(std::wstring()); //приходящие куски текста + output_.str(std::wstring());//dump string + + text_.str(std::wstring()); //incoming text fragments paragraph_style_name_ = L""; span_style_name_ = L""; @@ -327,7 +327,7 @@ void xlsx_text_context::Impl::start_drawing_content() } std::wstring xlsx_text_context::Impl::end_comment_content() { - dump_text();//если в комменте куча абзацев со одним стилем - сдампится здесь - иначе дампится по мере прихода каждого нового стиля + dump_text();// if comment has many paragraphs with same style - dumps here, otherwise dumps as each new style arrives std::wstring comment= output_.str(); @@ -344,7 +344,7 @@ std::wstring xlsx_text_context::Impl::end_comment_content() } std::wstring xlsx_text_context::Impl::end_drawing_content() { - dump_text();//если в draw куча абзацев со одним стилем - сдампится здесь - иначе дампится по мере прихода каждого нового стиля + dump_text();// if drawing has many paragraphs with same style - dumps here, otherwise dumps as each new style arrives std::wstring draw= output_.str(); @@ -364,7 +364,7 @@ int xlsx_text_context::Impl::end_cell_content(bool need_cache) dump_text(); const int sharedStrId = 0;//output_.str().empty() ? (-1) : static_cast<int>(xlsx_shared_strings_.add(output_.str())); - //???? нужно ли здесь очищать все ????? - проверить стили на кучках - и проверить как меняются стили внутри одной ячейки - то есть здешнее переопределение внешнего стиля + //???? do we need to clear everything here ????? - check styles on batches - and check how styles change inside one cell - i.e. local override of external style in_cell_content = false; return sharedStrId; } diff --git a/MsBinaryFile/XlsFile/Format/Auxiliary/HelpFunc.cpp b/MsBinaryFile/XlsFile/Format/Auxiliary/HelpFunc.cpp index 92ce470349..715090a5f9 100644 --- a/MsBinaryFile/XlsFile/Format/Auxiliary/HelpFunc.cpp +++ b/MsBinaryFile/XlsFile/Format/Auxiliary/HelpFunc.cpp @@ -254,7 +254,7 @@ const std::wstring int2wstr(const int val, const int radix) const std::wstring double2str(const double val) { - return boost::lexical_cast<std::wstring>(val);// std::to_wstring(val); - округление ( + return boost::lexical_cast<std::wstring>(val);// std::to_wstring(val); - rounding ( } diff --git a/MsBinaryFile/XlsFile/Format/Binary/CFRecord.h b/MsBinaryFile/XlsFile/Format/Binary/CFRecord.h index c76e9e2c00..920d39cd6d 100644 --- a/MsBinaryFile/XlsFile/Format/Binary/CFRecord.h +++ b/MsBinaryFile/XlsFile/Format/Binary/CFRecord.h @@ -179,7 +179,7 @@ private: CFRecordType::TypeId type_id_ = 0; size_t size_ = 0; char* data_ = 0; - BYTE sizeOfRecordTypeRecordLength = 0; //размер RecordType и RecordLength + BYTE sizeOfRecordTypeRecordLength = 0; //size of RecordType and RecordLength size_t rdPtr = 0; static char intData[MAX_RECORD_SIZE_XLSB]; diff --git a/MsBinaryFile/XlsFile/Format/Binary/CFStreamCacheReader.cpp b/MsBinaryFile/XlsFile/Format/Binary/CFStreamCacheReader.cpp index 0bb7216af2..e2f8b43924 100644 --- a/MsBinaryFile/XlsFile/Format/Binary/CFStreamCacheReader.cpp +++ b/MsBinaryFile/XlsFile/Format/Binary/CFStreamCacheReader.cpp @@ -153,7 +153,7 @@ CFRecordPtr CFStreamCacheReader::getNextRecord(const CFRecordType::TypeId desira //Log::warning(rec_name); if (desirable_type == rt_MsoDrawingGroup || - desirable_type == rt_GelFrame) // объединяем c rt_Continue в один блок + desirable_type == rt_GelFrame) // merge with rt_Continue into one block { if (checkNextRecord(desirable_type, 1)) { @@ -207,7 +207,7 @@ CFRecordPtr CFStreamCacheReader::getNextRecord(const CFRecordType::TypeId desira if(gen_except) { - // теги разные + // tags are different std::string inType = XLS::CFRecordType::getStringById(desirable_type); std::string outType = CFRecordType::getStringById(what_we_actually_read); @@ -296,7 +296,7 @@ CFRecordPtr FileStreamCacheReader::getNextRecord(const CFRecordType::TypeId desi //Log::warning(rec_name); - if (desirable_type == rt_MsoDrawingGroup) // объединяем rt_MsoDrawingGroup + rt_Continue в один блок + if (desirable_type == rt_MsoDrawingGroup) // merge rt_MsoDrawingGroup + rt_Continue into one block { if (checkNextRecord(desirable_type, 1)) { @@ -353,7 +353,7 @@ CFRecordPtr FileStreamCacheReader::getNextRecord(const CFRecordType::TypeId desi if(gen_except) { - // теги разные + // tags are different std::string inType = XLS::CFRecordType::getStringById(desirable_type); std::string outType = CFRecordType::getStringById(what_we_actually_read); @@ -437,7 +437,7 @@ CFRecordPtr BinaryStreamCacheReader::getNextRecord(const CFRecordType::TypeId de //Log::warning(rec_name); - /*if (desirable_type == rt_MsoDrawingGroup) // объединяем rt_MsoDrawingGroup + rt_Continue в один блок + /*if (desirable_type == rt_MsoDrawingGroup) // merge rt_MsoDrawingGroup + rt_Continue into one block { if (checkNextRecord(desirable_type, 1)) { @@ -494,7 +494,7 @@ CFRecordPtr BinaryStreamCacheReader::getNextRecord(const CFRecordType::TypeId de if(gen_except) { - // теги разные + // tags are different std::string inType = XLS::CFRecordType::getStringById(desirable_type); std::string outType = CFRecordType::getStringById(what_we_actually_read); diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/BRAI.h b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/BRAI.h index 1c936e1ae0..6087fb06c5 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/BRAI.h +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/BRAI.h @@ -62,7 +62,7 @@ public: bool fUnlinkedIfmt = 0; unsigned short ifmt = 0; - ChartParsedFormula formula; //набор диапазонов и ячеек + ChartParsedFormula formula; //set of ranges and cells }; } // namespace XLS diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/BopPopCustom.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/BopPopCustom.cpp index c450021d8e..8f9e198890 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/BopPopCustom.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/BopPopCustom.cpp @@ -93,21 +93,21 @@ void BopPopCustomPiesIndices::load(CFRecord& record) void BopPopCustomPiesIndices::save(CFRecord& record) { - // 1. Сохраняем количество точек + // 1. Save the number of points record << cxi; const unsigned short padding = (8 - (cxi % 8)) % 8; const unsigned short total_bits = padding + cxi + 1; // +1 = final flag bit const unsigned short total_bytes = (total_bits + 7) / 8; - // 2. Создаем массив нулевых байтов + // 2. Create array of zero bytes std::vector<unsigned char> rggrbit(total_bytes, 0); - // 3. Устанавливаем биты точек + // 3. Set the point bits for (unsigned short idx : pie_indices) { if (idx >= cxi) - continue; // игнорируем некорректные индексы + continue; // ignore invalid indices unsigned short bit_pos = padding + idx; unsigned short byte_index = bit_pos / 8; @@ -116,14 +116,14 @@ void BopPopCustomPiesIndices::save(CFRecord& record) rggrbit[byte_index] |= (1 << bit_in_byte); } - // 4. Устанавливаем финальный бит (последний бит последнего байта) + // 4. Set the final bit (last bit of last byte) bool no_secondary = pie_indices.empty(); if (no_secondary) { rggrbit.back() |= 0x01; // LSB = 1 } - // 5. Пишем все байты в поток + // 5. Write all bytes to stream for (unsigned char b : rggrbit) { record << b; diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/CF.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/CF.cpp index 3fdce0d056..fa6751693a 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/CF.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/CF.cpp @@ -141,7 +141,7 @@ int CF::serialize(std::wostream & stream) if ((cfEx) && (cfEx->content.fHasDXF)) { - //cfEx->content.dxf.serialize(CP_XML_STREAM()); - вложенный формат низя? + //cfEx->content.dxf.serialize(CP_XML_STREAM()); - nested format not allowed? if (cfEx->dxfId_ >= 0 ) dxfId_ = cfEx->dxfId_; diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/CF12.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/CF12.cpp index 1e389a0e1d..fb140372d1 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/CF12.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/CF12.cpp @@ -545,7 +545,7 @@ int CF12::serialize(std::wostream & stream) if (rgbCT) rgbCT->serialize(CP_XML_STREAM()); - //что использовать зависит от типа ... todooo + //what to use depends on the type ... todooo std::wstring s = fmlaActive.getAssembledFormula(); std::wstring s1 = rgce1.getAssembledFormula(); std::wstring s2 = rgce2.getAssembledFormula(); diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/Legend.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/Legend.cpp index 73b679e92b..dec4019e96 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/Legend.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/Legend.cpp @@ -129,7 +129,7 @@ int Legend::serialize(std::wostream & _stream, int size) } else { - //нету откровенного смещения + // no explicit offset CP_XML_ATTR(L"val", "l"); dy = dy * size; } diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/MarkerFormat.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/MarkerFormat.cpp index 91d1dcd093..9dd5189198 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/MarkerFormat.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/MarkerFormat.cpp @@ -44,7 +44,7 @@ namespace XLS L"333399", L"000000", L"FFFFFF", L"FF0000", L"00FF00", L"0000FF", L"FFFF00", L"FF00FF", L"00FFFF", L"800000", L"800000", L"800000", L"808000", L"800080", L"808000", L"C0C0C0", L"808080", L"9999FF", L"993366", L"FFFFCC", L"CCFFFF", L"660066", L"FF8080", L"0066CC", L"CCCCFF", - //todoooo - подглядеть какие в мс далее + //todoooo - check which colors MS uses next L"000080", L"FF00FF", L"FFFF00", L"00FFFF", L"800080", L"800000", L"808000", L"0000FF", L"00CCFF", L"CCFFFF", L"CCFFCC", L"FFFF99", L"99CCFF", L"FF99CC", L"CC99FF", L"FFCC99", L"3366FF", L"33CCCC", L"99CC00", L"FFCC00", L"FF9900", L"FF6600", L"666699", L"969696", L"336600", L"339966", L"330000", L"333300", L"993300", L"993366", diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/MulBlank.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/MulBlank.cpp index c35ff468c4..350d4a84e2 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/MulBlank.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/MulBlank.cpp @@ -165,7 +165,7 @@ void IXFCellMulBlankSpecial::load(CFRecord& record, const size_t num_cells) size_t sz = (record.getDataSize() - record.getRdPtr()-2)/2; unsigned short ixfe; - for(size_t i = 0; i < (std::min)(sz, num_cells); ++i) //Lighting Load Calculation.xls - третий лист + for(size_t i = 0; i < (std::min)(sz, num_cells); ++i) //Lighting Load Calculation.xls - third sheet { record >> ixfe; rgixfe.push_back(ixfe); diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/ObProj.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/ObProj.cpp index 7312cc5a58..77b60c74d6 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/ObProj.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/ObProj.cpp @@ -52,7 +52,7 @@ BaseObjectPtr ObProj::clone() void ObProj::readFields(CFRecord& record) { - //vba present in file .. выше .. по наличию собствено стороджа + //vba present in file .. above .. by presence of the storage itself } } // namespace XLS diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/SST.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/SST.cpp index 0dc3ba851d..9f1cdf7125 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/SST.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/SST.cpp @@ -117,7 +117,7 @@ int SST::serialize(std::wostream & stream) { try { - //внутрь не втаскиваем- в некоторых элементах обязательно писать r-rPr-t в некоторых достаточно t + //don't move inside - in some elements you must write r-rPr-t, in others just t is enough if (false == richText->rgRun.empty()) { richText->serialize(CP_XML_STREAM()); diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/SXAddl.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/SXAddl.cpp index 7d77a7dac1..fbf9077cbb 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/SXAddl.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/SXAddl.cpp @@ -137,7 +137,7 @@ BiffStructurePtr SXAddl::createSxcView(CFRecord& record) //case 0x21: result = BiffStructurePtr(new SXAddl_SXCView_SXDCompactRwHdr()); break; //case 0x22: result = BiffStructurePtr(new SXAddl_SXCView_SXDCompactColHdr()); break; case 0x26: - case 0x36: result = BiffStructurePtr(new SXAddl_SXCView_SXDSXPIIvmb()); break; //ошибка в документации??? + case 0x36: result = BiffStructurePtr(new SXAddl_SXCView_SXDSXPIIvmb()); break; //documentation error??? } return result; } diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/Scatter.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/Scatter.cpp index 7372cae70a..7ad86f3985 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/Scatter.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/Scatter.cpp @@ -90,7 +90,7 @@ int Scatter::serialize(std::wostream & _stream) } else { - //CP_XML_NODE(L"c:scatterStyle") - уровнем выше + //CP_XML_NODE(L"c:scatterStyle") - one level up } } diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/TxO.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/TxO.cpp index b4b8aeb49c..f8c67d2908 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/TxO.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/TxO.cpp @@ -130,7 +130,7 @@ void TxO::readFields(CFRecord& record) { XLUnicodeStringNoCch val; - unsigned char fHighByte; //todooo втащить в BufferString + unsigned char fHighByte; //todooo move to BufferString record >> fHighByte; bool is_wide = ((fHighByte & 1) != 0); @@ -269,7 +269,7 @@ int TxO::serialize_vml (std::wostream & _stream) if (run->formatRun.ich > str_.length()) { - //ошибка + //error run->formatRun.ich = 0; } @@ -327,7 +327,7 @@ int TxO::serialize (std::wostream & _stream) if (run->formatRun.ich > str_.length()) { - //ошибка + //error run->formatRun.ich = 0; } diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/XFExt.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/XFExt.cpp index 07f8a1134e..a1dc0ab7a0 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_records/XFExt.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_records/XFExt.cpp @@ -59,7 +59,7 @@ void XFExt::readFields(CFRecord& record) while(!record.isEOF()) { if(record.getRdPtr() + 4 > record.getDataSize()) - break;// миним размер структуры + break;// minimum structure size ExtPropPtr element(new ExtProp); record >> *element; rgExt.push_back(element); diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/BiffString.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/BiffString.cpp index a1928ced18..b8640e8e56 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/BiffString.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/BiffString.cpp @@ -101,7 +101,7 @@ namespace XLS if (reader->GetPosition() + cch > reader->GetSize()) { - //ОШИБКА - нехватило Continue records - нужно найти место где именно и подзагрузить + //ERROR - not enough Continue records - need to find the exact location and load additional data return; } unsigned char* pData = reader->ReadBytes(cch, true); @@ -133,7 +133,7 @@ namespace XLS if (record.checkFitRead(raw_length)==false) { - //ОШИБКА - нехватило Continue records - нужно найти место где именно и подзагрузить + //ERROR - not enough Continue records - need to find the exact location and load additional data return; } diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/BorderFillInfo.h b/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/BorderFillInfo.h index 2aa39e73ba..ad0d4a0454 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/BorderFillInfo.h +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/BorderFillInfo.h @@ -76,7 +76,7 @@ struct FillInfo int serialize(std::wostream & stream); -//additional (сравнение по базовому, расширения тока пишем) +//additional (comparison by base, only writing extensions) FillInfoExt foreFillInfo_; FillInfoExt backFillInfo_; diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/ChartParsedFormula.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/ChartParsedFormula.cpp index 8b2598f32e..9a79a0d941 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/ChartParsedFormula.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/ChartParsedFormula.cpp @@ -78,7 +78,7 @@ void ChartParsedFormula::load(CFRecord& record) if (sheet.size()<1) sheet=c.substr(0, colon); } - //todoooo вернуть листы !! + //todoooo return sheets !! CellRef ref(arCells[0]); if (arCells.size() > 1) diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/ExtRst.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/ExtRst.cpp index 6f82a61286..939873cdb7 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/ExtRst.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/ExtRst.cpp @@ -67,7 +67,7 @@ void ExtRst::load(CFRecord& record) size_t data_end = record.getRdPtr(); if(data_end - data_start != cb) { - //ОШИБКА - нехватило Continue records - нужно найти место где именно и подзагрузить + // ERROR - not enough Continue records - need to find the exact location and load more if ((data_end - data_start) < cb ) record.skipNunBytes( cb - (data_end - data_start)); // trash for unknown reason else diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/ODRAW/OfficeArtContainer.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/ODRAW/OfficeArtContainer.cpp index dd116de631..44d1a4540e 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/ODRAW/OfficeArtContainer.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/ODRAW/OfficeArtContainer.cpp @@ -196,7 +196,7 @@ void OfficeArtContainer::loadFields(XLS::CFRecord& record) OfficeArtRecordPtr test_officeArt = CreateOfficeArt(rh_test.recType); if (!test_officeArt) { - //упс ... и где начало верное??? + //oops ... and where is the correct start??? record.skipNunBytes(record.getDataSize() - record.getRdPtr()); return; } diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/PtgList.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/PtgList.cpp index 56b099153c..f39376efa6 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/PtgList.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/PtgList.cpp @@ -116,7 +116,7 @@ void PtgList::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool ful if (!link.empty()) link += L"!"; } - //formula += link; пока без названия sheet + //formula += link; for now without sheet name formula += tableName; formula += L'['; if(!invalid && !nonresident) diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/PtgNameX.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/PtgNameX.cpp index 547e7bd2c9..6342f6114e 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/PtgNameX.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/PtgNameX.cpp @@ -136,7 +136,7 @@ void PtgNameX::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool fu if (ixti < pFind->second.size() && ixti >= 0) { if (!pFind->second[ixti].empty()) - name = pFind->second[ixti]; //значение + name = pFind->second[ixti]; //value } else { diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/XLUnicodeRichExtendedString.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/XLUnicodeRichExtendedString.cpp index c996767287..1c63165db2 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/XLUnicodeRichExtendedString.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_structures/XLUnicodeRichExtendedString.cpp @@ -109,7 +109,7 @@ BiffStructurePtr XLUnicodeRichExtendedString::clone() int XLUnicodeRichExtendedString::serialize (std::wostream & _stream) { int start_string = 0; - int Fmt = 0; //форматы со сдвигом !!! .. первый - тот что определен в ячейке. + int Fmt = 0; //formats with offset !!! .. the first one is defined in the cell. CP_XML_WRITER(_stream) { diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/ATTACHEDLABEL_bu.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/ATTACHEDLABEL_bu.cpp index 446086413d..e2448fb871 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/ATTACHEDLABEL_bu.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/ATTACHEDLABEL_bu.cpp @@ -307,7 +307,7 @@ int ATTACHEDLABEL::serialize(std::wostream & _stream, bool isPosition) serialize_rPr (CP_XML_STREAM(),font->iFont, rtl, true); } } - if (seriesText)//todoooo сделать вариант с DFTTEXT + if (seriesText)// todo make variant with DFTTEXT { std::wstring & str_ = seriesText->stText.value(); @@ -346,7 +346,7 @@ int ATTACHEDLABEL::serialize(std::wostream & _stream, bool isPosition) { if (run->ich > str_.length()) { - //ошибка + // error run->ich = 0; } diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/AUTOFILTER_bu.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/AUTOFILTER_bu.cpp index 2630bfcbac..735a43842d 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/AUTOFILTER_bu.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/AUTOFILTER_bu.cpp @@ -231,7 +231,7 @@ int AUTOFILTER::serialize(std::wostream & stream) //} //else { - for (size_t i = 0 ; i < m_arFilters.size(); i++)//todooo сделать на оставшиеся - count_columns (hidden) + for (size_t i = 0 ; i < m_arFilters.size(); i++)//todooo do for remaining - count_columns (hidden) { AutoFilter * filter = dynamic_cast<AutoFilter*>(m_arFilters[i].get()); CP_XML_NODE(L"filterColumn") diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/AXS.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/AXS.cpp index cd7d2fb318..b6445bed4a 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/AXS.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/AXS.cpp @@ -247,7 +247,7 @@ int AXS::serialize(std::wostream & _stream) else { CP_XML_ATTR(L"rot", -tick->trot * 60000); - CP_XML_ATTR(L"vert", L"horz"); //(1-333.xls) .. todoooo может тут нужно проверять гоизонт ось или нет + CP_XML_ATTR(L"vert", L"horz"); //(1-333.xls) .. todoooo maybe need to check if horizontal axis or not } diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CELLTABLE.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CELLTABLE.cpp index 04f5180da8..a932a5bb6c 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CELLTABLE.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CELLTABLE.cpp @@ -263,7 +263,7 @@ int CELLTABLE::serialize(std::wostream & stream) if (row->miyRw > 0 && row->miyRw < 0x8000 && row->bValid && ((row->fUnsynced && row->fGhostDirty) || !row->fGhostDirty)) //v8_14A_1b13.xls //Department_Sales_and_Stock_Monthly_Recap_Store_778_2019-09-03.xls - //Уведомления об ознакомлении.xls + // Acquaintance_notifications.xls { CP_XML_ATTR(L"ht", row->miyRw / 20.); if (row->fUnsynced) diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CELL_bu.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CELL_bu.cpp index 3fd4644aae..3d45970954 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CELL_bu.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CELL_bu.cpp @@ -40,7 +40,7 @@ #include "../Biff_records/BoolErr.h" #include "../Biff_records/Number.h" #include "../Biff_records/LabelSst.h" -#include "../Biff_records/Label.h" // глючный файл SchetPrintForm.xls +#include "../Biff_records/Label.h" // buggy file SchetPrintForm.xls namespace XLS { diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CHARTFOMATS.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CHARTFOMATS.cpp index cf107fb925..dec322c521 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CHARTFOMATS.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CHARTFOMATS.cpp @@ -254,7 +254,7 @@ const bool CHARTFORMATS::loadContent(BinProcessor& proc) while(!elements_.empty()) { if ("DataLabExt" == elements_.front()->getClassName()) - {//необязат + {//optional if (cf.dataLabExt) { m_arChartFormats.push_back(cf); @@ -263,7 +263,7 @@ const bool CHARTFORMATS::loadContent(BinProcessor& proc) cf.dataLabExt = elements_.front(); } else if ("ATTACHEDLABEL" == elements_.front()->getClassName()) - {//обязат + {//required if (cf.attachedLABEL) { m_arChartFormats.push_back(cf); diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CONDFMTS.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CONDFMTS.cpp index 339ab5026c..e1f7147b8d 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CONDFMTS.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CONDFMTS.cpp @@ -147,7 +147,7 @@ const bool CONDFMTS::loadContent(BinProcessor& proc) if ((condFmt) && (condFmt->nID == cfEx->nID)) { - if (ind_cf >= CONDFMT_->m_arCF.size() && m_arCFEx[i].cf12)//4-ое и более условия - 5804543.xls + if (ind_cf >= CONDFMT_->m_arCF.size() && m_arCFEx[i].cf12)// 4th and more conditions - 5804543.xls { CONDFMT_->m_arCF.push_back(m_arCFEx[i].cf12); diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CUSTOMVIEW.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CUSTOMVIEW.cpp index 4aad36644b..a99ca75e87 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CUSTOMVIEW.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CUSTOMVIEW.cpp @@ -222,7 +222,7 @@ int CUSTOMVIEW::serialize(std::wostream & stream) { m_VerticalPageBreaks->serialize(CP_XML_STREAM()); } - //todooo пока не понятно как там определяется ref + //todooo not clear yet how ref is determined there //if (m_AUTOFILTER) // m_AUTOFILTER->serialize(CP_XML_STREAM()); } diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/DBQUERY.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/DBQUERY.cpp index 69a79fabff..12571c6559 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/DBQUERY.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/DBQUERY.cpp @@ -277,7 +277,7 @@ int DBQUERY::serialize_connection(std::wstring & name) { name = dcon->rgchConnectionName.strTotal; } - //имена уникальны должны быть!!! + // names must be unique!!! if (name.empty()) name = L"Connection" + std::to_wstring(global_info->connectionId); diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/FDB.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/FDB.cpp index c69af792e1..befba542cb 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/FDB.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/FDB.cpp @@ -279,7 +279,7 @@ int FDB::serialize(std::wostream & strm, bool bSql, bool bDBB) { CP_XML_NODE(L"sharedItems") { - //использовать поля присутствия из xls низя - они частенько записаны неверно!! + //can't use presence fields from xls - they are often written incorrectly!! //if (!fdb->fNonDates) CP_XML_ATTR(L"containsNonDate", fdb->fNonDates); //if (fdb->fDateInField) CP_XML_ATTR(L"containsDate", fdb->fDateInField); //if (fdb->fNumField) CP_XML_ATTR(L"containsNumber", fdb->fNumField); diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/FORMATTING.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/FORMATTING.cpp index 32586d0946..0e124d6459 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/FORMATTING.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/FORMATTING.cpp @@ -134,7 +134,7 @@ const bool FORMATTING::loadContent(BinProcessor& proc) elements_.pop_back(); } - if (proc.optional<THEME>()) // не по стандарту - china_price.xls + if (proc.optional<THEME>()) // not according to standard - china_price.xls { m_THEME = elements_.back(); elements_.pop_back(); @@ -218,7 +218,7 @@ void FORMATTING::update_xfs() break; } } - //for (size_t i = 0; !bFound && i < xfs->m_arCellXFs.size(); i++) небывает совпадений + //for (size_t i = 0; !bFound && i < xfs->m_arCellXFs.size(); i++) no matches occur //{ // XF* xf = dynamic_cast<XF*>(xfs->m_arCellXFs[i].get()); // if (xf->ind_xf == style->ixfe) diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/PAGESETUP.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/PAGESETUP.cpp index c46ae2ec7c..3d6d9e46d6 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/PAGESETUP.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/PAGESETUP.cpp @@ -280,7 +280,7 @@ int PAGESETUP::serialize(std::wostream & stream) if (false == setup->fNoPls) { - CP_XML_NODE(L"pageSetup")// - для chartsheet аккуратнее + CP_XML_NODE(L"pageSetup")// - be careful for chartsheet { CP_XML_ATTR(L"paperSize", setup->iPaperSize); CP_XML_ATTR(L"firstPageNumber", setup->iPageStart); diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/PIVOTADDL.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/PIVOTADDL.cpp index 6417de41ac..3c80e2599b 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/PIVOTADDL.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/PIVOTADDL.cpp @@ -96,7 +96,7 @@ const bool PIVOTADDL::loadContent(BinProcessor& proc) if (level == 0 && addl->bEndElement) { - elements_.pop_back(); //end элемент не нужен в дальнейшем + elements_.pop_back(); //end element not needed later continue; } else if (addl->bEndElement) @@ -124,7 +124,7 @@ const bool PIVOTADDL::loadContent(BinProcessor& proc) } } - elements_.pop_back(); //end элемент не нужен в дальнейшем + elements_.pop_back(); //end element not needed later continue; } else if (level == 0) diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/SERIESFORMAT.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/SERIESFORMAT.cpp index 37ba8d0663..77c9937fb1 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/SERIESFORMAT.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/SERIESFORMAT.cpp @@ -175,7 +175,7 @@ const bool SERIESFORMAT::loadContent(BinProcessor& proc) elements_.pop_back(); count--; } - //доп серии + // additional series if (proc.mandatory<Parenthesis_SERIESFORMAT_1>()) { count = elements_.size(); @@ -202,7 +202,7 @@ const bool SERIESFORMAT::loadContent(BinProcessor& proc) } } - count = proc.repeated<Parenthesis_SERIESFORMAT_2>(0, 0); // это типо "нормальных" + count = proc.repeated<Parenthesis_SERIESFORMAT_2>(0, 0); // these are "normal" type count = elements_.size(); while(count > 0) @@ -296,7 +296,7 @@ int SERIESFORMAT::serialize_legend(std::wostream & _stream, int idx) { CP_XML_NODE(L"c:idx") { - CP_XML_ATTR(L"val", idx); //legendException->iss = oxffff легенда для серий + CP_XML_ATTR(L"val", idx); // legendException->iss = 0xffff legend for series } if (att) { @@ -313,7 +313,7 @@ int SERIESFORMAT::serialize_parent(std::wostream & _stream, CHARTFORMATS* chart_ { if (m_SerParent == NULL) { - for (size_t i = 0; i < m_arSERIESFORMAT_ext.size(); i++) // объединение + for (size_t i = 0; i < m_arSERIESFORMAT_ext.size(); i++) // merge { SERIESFORMAT * series_ext = dynamic_cast<SERIESFORMAT *>(m_arSERIESFORMAT_ext[i].get()); if ((series_ext) && (series_ext->m_SerParent)) @@ -352,7 +352,7 @@ int SERIESFORMAT::serialize_parent(std::wostream & _stream, CHARTFORMATS* chart_ if (series_ss) { series_ss->serialize(CP_XML_STREAM(), CHART_TYPE_Bar, -1); - //тут не надо рисовать маркеры .. а вот fill можно - он просто отбрасывается - по "првильному" нужно выделить отдельный тип чисто линий + // no need to draw markers here.. but fill can be used - it's just discarded - properly should separate pure line type } //CP_XML_NODE(L"c:spPr") //{ diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/SS.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/SS.cpp index a4ee62db98..5126aef704 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/SS.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/SS.cpp @@ -69,7 +69,7 @@ namespace XLS L"333399", L"000000", L"FFFFFF", L"FF0000", L"00FF00", L"0000FF", L"FFFF00", L"FF00FF", L"00FFFF", L"800000", L"800000", L"800000", L"808000", L"800080", L"808000", L"C0C0C0", L"808080", L"9999FF", L"993366", L"FFFFCC", L"CCFFFF", L"660066", L"FF8080", L"0066CC", L"CCCCFF", - //todoooo - подглядеть какие в мс далее + //todoooo - check what MS uses further L"000080", L"FF00FF", L"FFFF00", L"00FFFF", L"800080", L"800000", L"808000", L"0000FF", L"00CCFF", L"CCFFFF", L"CCFFCC", L"FFFF99", L"99CCFF", L"FF99CC", L"CC99FF", L"FFCC99", L"3366FF", L"33CCCC", L"99CC00", L"FFCC00", L"FF9900", L"FF6600", L"666699", L"969696", L"336600", L"339966", L"330000", L"333300", L"993300", L"993366", @@ -118,7 +118,7 @@ const bool SS::loadContent(BinProcessor& proc) { bRead = true; } - if (proc.optional<Begin>()) //при biff5 может быть или нет, biff8 - обязано быть + if (proc.optional<Begin>()) //in biff5 may or may not be present, biff8 - must be present { bRead = true; elements_.pop_back(); @@ -331,7 +331,7 @@ int SS::serialize_default(std::wostream & _stream, int series_type, int ind ) // m_MarkerFormat->serialize(_stream); //else //{ - // //генерация (series_data_format->iss) + // //generation (series_data_format->iss) // //todooo //} if (m_PieFormat && (series_type == CHART_TYPE_Doughnut || @@ -429,7 +429,7 @@ int SS::serialize(std::wostream & _stream, int series_type, int indPt) } else { - //генерация (automatic) + //generation (automatic) if (series_type == CHART_TYPE_Scatter || series_type == CHART_TYPE_Stock) { } diff --git a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/XFS.cpp b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/XFS.cpp index 35e54caea9..0ef77b223c 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/XFS.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/Biff_unions/XFS.cpp @@ -60,12 +60,12 @@ const bool XFS::loadContent(BinProcessor& proc) int cellXfs_count = 0; XF xf(cell_xf_current_id, style_xf_current_id); - int count = proc.repeated(xf , 0, 0); // "Stock symbols comparison1.xls" (второй FORMATING) + int count = proc.repeated(xf , 0, 0); // "Stock symbols comparison1.xls" (second FORMATING) int ind = 0; while (count > 0 && elements_.size() > 0) { - //разделить style & complex + //split style & complex XF* xfs = dynamic_cast<XF*>(elements_.front().get()); xfs->ind_xf = ind++; diff --git a/MsBinaryFile/XlsFile/Format/Logic/ChartSheetSubstream.cpp b/MsBinaryFile/XlsFile/Format/Logic/ChartSheetSubstream.cpp index 29c399ab0b..ee846e642a 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/ChartSheetSubstream.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/ChartSheetSubstream.cpp @@ -236,7 +236,7 @@ const bool ChartSheetSubstream::loadContent(BinProcessor& proc) case rt_Fbi2: { count = proc.repeated<Fbi2>(0, 0); - while(count > 0 && m_arFbi.empty())//??? разделить + while(count > 0 && m_arFbi.empty())//??? split { m_arFbi.insert(m_arFbi.begin(), elements_.back()); elements_.pop_back(); @@ -873,7 +873,7 @@ int ChartSheetSubstream::serialize_legend (std::wostream & _stream, const std::w // dat_ld = dynamic_cast<LD*>(DAT_->m_LD.get()); //} - //todooo разобраться с разными типами в одном чарте .. считать количество серий?? + //todooo figure out different types in one chart.. count number of series?? std::unordered_map< int, std::vector<int>>::iterator it = m_mapTypeChart.begin(); while (it != m_mapTypeChart.end()) { @@ -929,7 +929,7 @@ int ChartSheetSubstream::serialize_plot_area (std::wostream & _stream) CRT * crt = dynamic_cast<CRT*>(parent0->m_arCRT[0].get()); if ((crt) && ( crt->m_iChartType == CHART_TYPE_Radar || crt->m_iChartType == CHART_TYPE_RadarArea || - crt->m_iChartType == CHART_TYPE_Scatter))//еще? + crt->m_iChartType == CHART_TYPE_Scatter))//more? { PlotAreaPos->m_iLayoutTarget = 2; //inner } @@ -1063,7 +1063,7 @@ int ChartSheetSubstream::serialize_plot_area (std::wostream & _stream) CP_XML_STREAM() << stream_dLbls.str(); } } - series_ss->serialize2(CP_XML_STREAM(), crt->m_iChartType); //особенности xlsx ( + series_ss->serialize2(CP_XML_STREAM(), crt->m_iChartType); //xlsx specifics ( } series->serialize_legend(stream_legend_entries, it->second[i]); @@ -1138,7 +1138,7 @@ int ChartSheetSubstream::serialize_plot_area (std::wostream & _stream) } int ChartSheetSubstream::serialize_scatter_style(std::wostream & _stream, CRT *crt) { - bool bMarker = true, bSmooth = false, bLine = true;//todooo - так как есть отдельные настройки + bool bMarker = true, bSmooth = false, bLine = true;//todooo - since there are separate settings CP_XML_WRITER(_stream) { @@ -1196,7 +1196,7 @@ int ChartSheetSubstream::serialize_dPt(std::wostream & _stream, int id, CRT *crt present_idx.insert(std::make_pair(series_data_format->xi, true)); } series_ss->serialize (CP_XML_STREAM(), crt->m_iChartType, series_data_format->xi); - //series_ss->serialize2 (CP_XML_STREAM(), crt->m_iChartType); // 3d shape box не нужен - Book 78 3D.xls + //series_ss->serialize2 (CP_XML_STREAM(), crt->m_iChartType); // 3d shape box not needed - Book 78 3D.xls } } @@ -1291,7 +1291,7 @@ int ChartSheetSubstream::serialize_dLbls (std::wostream & _stream, int id, CRT * add_labels = true; } else if (!labels.empty()) - {//есть лэйблы отдельных точек, а вот общие никак не обозначены + {//there are labels for individual points, but general ones are not marked need_add_labels = true; } } @@ -1335,7 +1335,7 @@ int ChartSheetSubstream::serialize_dLbls (std::wostream & _stream, int id, CRT * CP_XML_NODE(L"c:showCatName") { CP_XML_ATTR (L"val" , 0); } CP_XML_NODE(L"c:showSerName") { CP_XML_ATTR (L"val" , 0); } } - //подписи к точкам (отдельные) + //labels for points (individual) for (size_t i = 0; i < labels.size(); i++) { CP_XML_NODE(L"c:dLbl") @@ -1470,7 +1470,7 @@ int ChartSheetSubstream::serialize_ser (std::wstring sNodeSer, std::wostream & _ CP_XML_NODE(L"c:ptCount") { - CP_XML_ATTR(L"val", count); // count_found использовать нельзя - тут должно быть максимальное всех точек отчета + CP_XML_ATTR(L"val", count); // cannot use count_found - must be maximum of all report points } CP_XML_STREAM() << _stream_cash.str(); @@ -1505,7 +1505,7 @@ int ChartSheetSubstream::serialize_ser (std::wstring sNodeSer, std::wostream & _ { CP_XML_NODE(L"c:ptCount") { - CP_XML_ATTR(L"val", count); // count_found использовать нельзя - тут должно быть максимальное всех точек отчета + CP_XML_ATTR(L"val", count); // cannot use count_found - must be maximum of all report points } CP_XML_STREAM() << _stream_cash.str(); } diff --git a/MsBinaryFile/XlsFile/Format/Logic/CommonSubstream.h b/MsBinaryFile/XlsFile/Format/Logic/CommonSubstream.h index 41028236e2..0e25383214 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/CommonSubstream.h +++ b/MsBinaryFile/XlsFile/Format/Logic/CommonSubstream.h @@ -48,7 +48,7 @@ public: GlobalWorkbookInfoPtr global_info_; size_t ws_index_; - std::vector<BiffStructurePtr> m_arHFPictureDrawing; // тут OfficeArtDgContainer - описания шейпов ... + std::vector<BiffStructurePtr> m_arHFPictureDrawing; // here OfficeArtDgContainer - shape descriptions ... BaseObjectPtr m_PAGESETUP; BaseObjectPtr m_PROTECTION; diff --git a/MsBinaryFile/XlsFile/Format/Logic/GlobalWorkbookInfo.cpp b/MsBinaryFile/XlsFile/Format/Logic/GlobalWorkbookInfo.cpp index 468599e380..1834a2cec3 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/GlobalWorkbookInfo.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/GlobalWorkbookInfo.cpp @@ -299,7 +299,7 @@ void GlobalWorkbookInfo::RegisterNumFormat(BaseObjectPtr element) } else { - //меняем + //changing pFindFormat->second = element; } } @@ -381,7 +381,7 @@ _UINT16 GlobalWorkbookInfo::RegisterNumFormat(_UINT16 ifmt, const std::wstring & std::map<_UINT16, BaseObjectPtr>::iterator pFindFormat = m_mapNumFormats.find(ifmt_used); if (pFindFormat == m_mapNumFormats.end()) { - // генерим хоть что то + // generate something at least Format* fmt = new Format(); fmt->ifmt = ifmt; fmt->ifmt_used = ifmt_used; diff --git a/MsBinaryFile/XlsFile/Format/Logic/GlobalsSubstream.cpp b/MsBinaryFile/XlsFile/Format/Logic/GlobalsSubstream.cpp index dd15425944..df609fd21f 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/GlobalsSubstream.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/GlobalsSubstream.cpp @@ -570,15 +570,15 @@ const bool GlobalsSubstream::loadContent(BinProcessor& proc) case rt_GUIDTypeLib: proc.optional<GUIDTypeLib>(); break; //case rt_XFCRC: - //{//не по спецификации !!! Calculadora.xls + //{//not according to specification !!! Calculadora.xls // if(proc.optional<XFCRC>()) // { - // elements_.pop_back(); // Crc не нужен + // elements_.pop_back(); // Crc not needed // count = proc.repeated<XFExt>(0, 0);//(16, 4050); // while (count > 0) // { - // //перенести в FORMATING/XFS ?? - тогда нужен пересчет там !! + // //move to FORMATING/XFS ?? - then recalculation needed there !! // //if (elements_.empty()) break; // //XFExt* ext = dynamic_cast<XFExt*>(elements_.back().get()); // //m_arXFext.push_back(elements_.front()); @@ -942,7 +942,7 @@ void GlobalsSubstream::UpdateDefineNames() name = L"_xludf." + name; } } - global_info_->arDefineNames.push_back(name);// для имен функций - todooo ... не все функции корректны !! БДИ !! + global_info_->arDefineNames.push_back(name);// for function names - todooo ... not all functions are correct!! WATCH OUT!! } } void GlobalsSubstream::UpdateExternalDefineNames() diff --git a/MsBinaryFile/XlsFile/Format/Logic/GlobalsSubstream.h b/MsBinaryFile/XlsFile/Format/Logic/GlobalsSubstream.h index 22c7861f8f..3ad4198606 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/GlobalsSubstream.h +++ b/MsBinaryFile/XlsFile/Format/Logic/GlobalsSubstream.h @@ -89,7 +89,7 @@ public: std::vector<BaseObjectPtr> m_arPIVOTCACHEDEFINITION; std::vector<BaseObjectPtr> m_arDConn; - std::vector<BiffStructurePtr> m_arHFPictureDrawing; // тут OfficeArtDggContainer - картинки ... + std::vector<BiffStructurePtr> m_arHFPictureDrawing; // here OfficeArtDggContainer - images ... unsigned short code_page_; GlobalWorkbookInfoPtr global_info_; diff --git a/MsBinaryFile/XlsFile/Format/Logic/WorksheetSubstream.cpp b/MsBinaryFile/XlsFile/Format/Logic/WorksheetSubstream.cpp index 16dd00a005..51f7f138ba 100644 --- a/MsBinaryFile/XlsFile/Format/Logic/WorksheetSubstream.cpp +++ b/MsBinaryFile/XlsFile/Format/Logic/WorksheetSubstream.cpp @@ -147,7 +147,7 @@ const bool WorksheetSubstream::loadContent(BinProcessor& proc) { CFRecordType::TypeId type = proc.getNextRecordType(); - if (type == rt_NONE || proc.isBOF(type)) //следующий пошел?? + if (type == rt_NONE || proc.isBOF(type)) //next one started?? break; if (type == rt_EOF) { @@ -172,7 +172,7 @@ const bool WorksheetSubstream::loadContent(BinProcessor& proc) elements_.pop_back(); } }break; - case rt_CalcRefMode://todooo сделать вариативно по всем проверку + case rt_CalcRefMode://todooo make variable check for all case rt_CalcMode: case rt_PrintRowCol: { @@ -533,11 +533,11 @@ const bool WorksheetSubstream::loadContent(BinProcessor& proc) count--; } }break; - case rt_CFEx: //Calculadora.xls не в FORMATING + case rt_CFEx: //Calculadora.xls not in FORMATING { count = proc.repeated<CFEx> (0, 0); }break; - case rt_PLV: //Calculadora.xls не в FORMATING + case rt_PLV: //Calculadora.xls not in FORMATING { if (proc.optional<PLV>()) { diff --git a/OFDFile/src/OFDFile_Private.cpp b/OFDFile/src/OFDFile_Private.cpp index 0e1a66bb6b..7e9a1e7287 100644 --- a/OFDFile/src/OFDFile_Private.cpp +++ b/OFDFile/src/OFDFile_Private.cpp @@ -9,7 +9,7 @@ COFDFile_Private::COFDFile_Private(NSFonts::IApplicationFonts* pFonts) if (nullptr == pFonts) return; - // Создаем менеджер шрифтов с собственным кэшем + // Create font manager with its own cache m_pFontManager = pFonts->GenerateFontManager(); NSFonts::IFontsCache* pMeasurerCache = NSFonts::NSFontCache::Create(); pMeasurerCache->SetStreams(pFonts->GetStreams()); diff --git a/OFDFile/src/Utils/Utils.h b/OFDFile/src/Utils/Utils.h index 5ca390ca04..c708646c74 100644 --- a/OFDFile/src/Utils/Utils.h +++ b/OFDFile/src/Utils/Utils.h @@ -34,7 +34,7 @@ inline std::vector<std::string> Split(const std::string& sValue, char chDelim) inline bool StringToBoolean(const std::string& sValue, bool& bValue) { - //TODO:: скорректировать метод, если возможно чтение не стандартных значений с плавающей запятой + // TODO: adjust method if reading non-standard floating point values is possible if (sValue.empty()) return false; @@ -56,7 +56,7 @@ inline bool StringToBoolean(const std::string& sValue, bool& bValue) inline bool StringToInteger(const std::string& sValue, int& nValue) { - //TODO:: скорректировать метод, если возможно чтение не стандартных значений с плавающей запятой + // TODO: adjust method if reading non-standard floating point values is possible if (sValue.empty()) return false; @@ -72,7 +72,7 @@ inline bool StringToInteger(const std::string& sValue, int& nValue) inline bool StringToUInteger(const std::string& sValue, unsigned int& unValue) { - //TODO:: скорректировать метод, если возможно чтение не стандартных значений с плавающей запятой + // TODO: adjust method if reading non-standard floating point values is possible if (sValue.empty()) return false; @@ -88,7 +88,7 @@ inline bool StringToUInteger(const std::string& sValue, unsigned int& unValue) inline bool StringToDouble(const std::string& sValue, double& dValue) { - //TODO:: скорректировать метод, если возможно чтение не стандартных значений с плавающей запятой + // TODO: adjust method if reading non-standard floating point values is possible if (sValue.empty()) return false; diff --git a/OOXML/Base/Nullable.h b/OOXML/Base/Nullable.h index f04a5f2369..ed6314785d 100644 --- a/OOXML/Base/Nullable.h +++ b/OOXML/Base/Nullable.h @@ -302,8 +302,8 @@ namespace NSCommon { return this->m_pPointer; } - //GetPointerEmptyNullable - небезопасная операция, использовать при крайней необходимости - //Передает указатель и очищает nullable, в дальнейшем память надо удалять самостоятельно + //GetPointerEmptyNullable - unsafe operation, use only when absolutely necessary + //Transfers pointer and clears nullable, memory must be deallocated manually afterwards Type* GetPointerEmptyNullable() { Type* pOldPointer = this->m_pPointer; diff --git a/OOXML/Base/codecvt.cpp b/OOXML/Base/codecvt.cpp index f8df284adb..9137a02a42 100644 --- a/OOXML/Base/codecvt.cpp +++ b/OOXML/Base/codecvt.cpp @@ -42,7 +42,7 @@ ucs2_conversion::do_in(mbstate_t&, { const int max_input = (from_end - from) & ~1; const int max_output = (to_limit - to); - int count = std::min(max_input / 2, max_output); // TODO попробовать оптимизировать, заменив деление на сдвиг + int count = std::min(max_input / 2, max_output); // TODO try to optimize by replacing division with shift from_next = from; to_next = to; @@ -67,7 +67,7 @@ ucs2_conversion::do_out(mbstate_t&, { const int max_input = (from_end - from); const int max_output = (to_limit - to) & ~1; - int count = std::min(max_input, max_output / 2); // TODO попробовать оптимизировать, заменив деление на сдвиг + int count = std::min(max_input, max_output / 2); // TODO try to optimize by replacing division with shift from_next = from; to_next = to; @@ -89,7 +89,7 @@ ube_conversion::do_in(mbstate_t&, { const int max_input = (from_end - from) & ~1; const int max_output = (to_limit - to); - int count = std::min(max_input / 2, max_output); // TODO попробовать оптимизировать, заменив деление на сдвиг + int count = std::min(max_input / 2, max_output); // TODO try to optimize by replacing division with shift from_next = from; to_next = to; @@ -113,7 +113,7 @@ ube_conversion::do_out(mbstate_t&, { const int max_input = (from_end - from); const int max_output = (to_limit - to) & ~1; - int count = std::min(max_input, max_output / 2); // TODO попробовать оптимизировать, заменив деление на сдвиг + int count = std::min(max_input, max_output / 2); // TODO try to optimize by replacing division with shift from_next = from; to_next = to; @@ -160,8 +160,8 @@ utf8_conversion::do_in(mbstate_t&, } -// TODO можно оптимизировать, считая что в utf8 максимальное значение байт на символ 4. -// И после заменив деление и умножение на сдвиги +// TODO can be optimized, assuming UTF-8 has maximum 4 bytes per character. +// And then replacing division and multiplication with shifts utf8_conversion::result utf8_conversion::do_out(mbstate_t&, const wchar_t* from, const wchar_t* from_end, const wchar_t*& from_next, diff --git a/OOXML/Binary/Document/BinReader/BinaryReaderD.cpp b/OOXML/Binary/Document/BinReader/BinaryReaderD.cpp index e46157551b..67fe95e33e 100644 --- a/OOXML/Binary/Document/BinReader/BinaryReaderD.cpp +++ b/OOXML/Binary/Document/BinReader/BinaryReaderD.cpp @@ -2534,7 +2534,7 @@ int Binary_tblPrReader::Read_RowPr(BYTE type, long length, void* poResult) READ2_DEF(length, res, this->ReadAfter, &orowPrAfterBefore); if (true == orowPrAfterBefore.bGridAfter && orowPrAfterBefore.nGridAfter > 0 && false == orowPrAfterBefore.oAfterWidth.bW) { - //ищем по tblGrid + //search by tblGrid long nGridLength = (long)m_aCurTblGrid.size(); if (orowPrAfterBefore.nGridAfter < nGridLength) { @@ -2555,7 +2555,7 @@ int Binary_tblPrReader::Read_RowPr(BYTE type, long length, void* poResult) READ2_DEF(length, res, this->ReadBefore, &orowPrAfterBefore); if (true == orowPrAfterBefore.bGridAfter && orowPrAfterBefore.nGridAfter > 0 && false == orowPrAfterBefore.oAfterWidth.bW) { - //ищем по tblGrid + //search by tblGrid if (orowPrAfterBefore.nGridAfter < (long)m_aCurTblGrid.size()) { double nSumW = 0; @@ -3649,7 +3649,7 @@ int Binary_OtherTableReader::ReadOtherContent(BYTE type, long length, void* poRe } catch(...) { - //todooo в отдельный лог + //todooo log separately } if (false == m_oFileWriter.m_bGlossaryMode) { @@ -7608,7 +7608,7 @@ int Binary_DocumentTableReader::ReadMathMRun(BYTE type, long length, void* poRes if (NULL != m_oFileWriter.m_pComments) { CComment* pComment = m_oFileWriter.m_pComments->get(nId); - if (NULL != pComment) // могут быть и без start/end + if (NULL != pComment) // can be without start/end { GetCurrentStringWriter().WriteString(pComment->writeRef(std::wstring(_T("")), std::wstring(_T("w:commentReference")), std::wstring(_T("")))); } @@ -8453,7 +8453,7 @@ int Binary_DocumentTableReader::ReadRunContent(BYTE type, long length, void* poR if (NULL != m_oFileWriter.m_pComments) { CComment* pComment = m_oFileWriter.m_pComments->get(nId); - if (NULL != pComment) // могут быть и без start/end + if (NULL != pComment) // can be without start/end { GetCurrentStringWriter().WriteString(pComment->writeRef(std::wstring(_T("")), std::wstring(_T("w:commentReference")), std::wstring(_T("")))); } @@ -8846,7 +8846,7 @@ int Binary_DocumentTableReader::ReadCell(BYTE type, long length, void* poResult) { Binary_DocumentTableReader oBinary_DocumentTableReader(m_oBufferedStream, m_oFileWriter, m_oDocumentWriter, m_bOFormRead); READ1_DEF(length, res, this->ReadCellContent, &oBinary_DocumentTableReader); - //Потому что если перед </tc> не идет <p>, то документ считается невалидным + //Because if there is no <p> before </tc>, the document is considered invalid if (c_oSerParType::Par != oBinary_DocumentTableReader.m_byteLastElemType) { GetCurrentStringWriter().WriteString(std::wstring(_T("<w:p/>"))); @@ -8955,7 +8955,7 @@ int Binary_DocumentTableReader::ReadPptxDrawing(BYTE type, long length, void* po pDrawingProperty->bDataLength = true; pDrawingProperty->DataPos = m_oBufferedStream.GetPos(); pDrawingProperty->DataLength = length; - //сейчас пропуская, потому что перед чтение этого поля надо собрать остальные данные + //skipping for now, because other data must be collected before reading this field res = c_oSerConstants::ReadUnknown; } else if (c_oSerImageType2::Chart == type) @@ -10700,13 +10700,13 @@ int BinaryFileReader::ReadMainTable() Writers::CommentsWriter& oCommentsWriter = m_oFileWriter.get_comments_writer(); std::wstring sContent = oComments.writeContent(); - std::wstring sContentEx = oComments.writeContentExt(); //важно чтобы writeContentExt вызывался после writeContent + std::wstring sContentEx = oComments.writeContentExt(); //important that writeContentExt is called after writeContent std::wstring sContentExtensible = oComments.writeContentExtensible(); std::wstring sContentsId = oComments.writeContentsIds(); std::wstring sPeople = oComments.writePeople(); std::wstring sDocumentContent = oBinary_DocumentCommentsTableReader.m_oComments.writeContent(); - std::wstring sDocumentContentEx = oBinary_DocumentCommentsTableReader.m_oComments.writeContentExt(); //важно чтобы writeContentExt вызывался после writeContent + std::wstring sDocumentContentEx = oBinary_DocumentCommentsTableReader.m_oComments.writeContentExt(); //important that writeContentExt is called after writeContent std::wstring sDocumentContentExtensible = oBinary_DocumentCommentsTableReader.m_oComments.writeContentExtensible(); std::wstring sDocumentContentsId = oBinary_DocumentCommentsTableReader.m_oComments.writeContentsIds(); std::wstring sDocumentPeople = oBinary_DocumentCommentsTableReader.m_oComments.writePeople(); diff --git a/OOXML/Binary/Document/BinReader/FileWriter.cpp b/OOXML/Binary/Document/BinReader/FileWriter.cpp index 9b0408e3b3..91fe44a9a5 100644 --- a/OOXML/Binary/Document/BinReader/FileWriter.cpp +++ b/OOXML/Binary/Document/BinReader/FileWriter.cpp @@ -69,7 +69,7 @@ void FileWriter::Write() { m_oMain.Write(); m_oChartWriter.Write(); - //Rels и ContentTypes пишем в конце + //Write Rels and ContentTypes at the end m_oDocumentRelsWriter.Write(); } void FileWriter::WriteGlossary() diff --git a/OOXML/Binary/Document/BinReader/FileWriter.h b/OOXML/Binary/Document/BinReader/FileWriter.h index ae12ee9a4e..3a0271ad3a 100644 --- a/OOXML/Binary/Document/BinReader/FileWriter.h +++ b/OOXML/Binary/Document/BinReader/FileWriter.h @@ -95,10 +95,10 @@ namespace Writers headers_footers.Write(bGlossary); footnotes.Write(bGlossary); endnotes.Write(bGlossary); - //Setting пишем после HeaderFooter, чтобы заполнить evenAndOddHeaders + //Write settings after HeaderFooter to fill evenAndOddHeaders settings.Write(bGlossary); web_settings.Write(bGlossary); - //Document пишем после HeaderFooter, чтобы заполнить sectPr + //Write document after HeaderFooter to fill sectPr document.Write(bGlossary); } diff --git a/OOXML/Binary/Document/BinReader/ReaderClasses.cpp b/OOXML/Binary/Document/BinReader/ReaderClasses.cpp index f89ea3865a..a136366aee 100644 --- a/OOXML/Binary/Document/BinReader/ReaderClasses.cpp +++ b/OOXML/Binary/Document/BinReader/ReaderClasses.cpp @@ -487,7 +487,7 @@ namespace BinDocxRW { std::wstring sTooltip; bool bNextLink = false; bool bNextTooltip = false; - //разбиваем по пробелам, но с учетом кавычек + //split by spaces, but considering quotes std::vector<std::wstring> aItems; std::wstring sCurItem; bool bDQuot = false; @@ -738,7 +738,7 @@ namespace BinDocxRW { w15:paraIdParent=\"" + pComment->sParaIdParent + L"\" w15:done=\"" + sDone + L"\"/>"; else sRes += L"<w15:commentEx w15:paraId=\"" + pComment->sParaId + L"\" w15:done=\"" + sDone + L"\"/>"; - //расставляем paraIdParent + //set paraIdParent for(size_t i = 0; i < pComment->replies.size(); i++) pComment->replies[i]->sParaIdParent = pComment->sParaId; } @@ -1198,7 +1198,7 @@ allowOverlap=\"1\">"; } else { - //для wrapThrough и wrapTight wrapPolygon обязательное поле, если его нет - меняем тип. + //for wrapThrough and wrapTight wrapPolygon is required field, if missing - change type. if ( c_oSerImageType2::WrapSquare == DrawingPropertyWrap.WrappingType || c_oSerImageType2::WrapThrough == DrawingPropertyWrap.WrappingType || c_oSerImageType2::WrapTight == DrawingPropertyWrap.WrappingType) diff --git a/OOXML/Binary/Document/BinReader/fontTableWriter.cpp b/OOXML/Binary/Document/BinReader/fontTableWriter.cpp index 81ef2c5913..531da3d102 100644 --- a/OOXML/Binary/Document/BinReader/fontTableWriter.cpp +++ b/OOXML/Binary/Document/BinReader/fontTableWriter.cpp @@ -57,7 +57,7 @@ namespace Writers { m_oWriter.WriteString(g_string_ft_Start); - //Те шрифты которые всегда пишем в FontTable + //Fonts that are always written to FontTable bool bCalibri = false; bool bTimes = false; bool bCambria = false; diff --git a/OOXML/Binary/Document/BinWriter/BinEquationWriter.cpp b/OOXML/Binary/Document/BinWriter/BinEquationWriter.cpp index a503bd398e..18739615ad 100644 --- a/OOXML/Binary/Document/BinWriter/BinEquationWriter.cpp +++ b/OOXML/Binary/Document/BinWriter/BinEquationWriter.cpp @@ -343,7 +343,7 @@ namespace MathEquation } int BinaryEquationWriter::WriteItemWithLengthStart() { - //Запоминаем позицию чтобы в конце записать туда длину + //Save position to write length at the end int nStartPos = m_pStream->GetPosition(); m_pStream->Skip(4); return nStartPos; @@ -776,7 +776,7 @@ namespace MathEquation nCurPos1 = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::SSupPr); } break; - /*case scriptalignLeft: можно сделать так, но выглядеть будет плохо + /*case scriptalignLeft: can do it this way, but it will look bad { nCurPos = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::SPre); nCurPos1 = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::SPrePr); @@ -922,7 +922,7 @@ namespace MathEquation std::wstring str; switch(eType) { - //todooo проверить запись .. (BYTE)SimpleTypes::ххх + //todo check writing .. (BYTE)SimpleTypes::xxx case integraltypeSingle: str = 0x222B; WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str); diff --git a/OOXML/Binary/Document/BinWriter/BinReaderWriterDefines.h b/OOXML/Binary/Document/BinWriter/BinReaderWriterDefines.h index b98be6ac4c..dca633aaf0 100644 --- a/OOXML/Binary/Document/BinWriter/BinReaderWriterDefines.h +++ b/OOXML/Binary/Document/BinWriter/BinReaderWriterDefines.h @@ -126,8 +126,8 @@ extern int g_nCurFormatVersion; HdrFtr_Even = 3, HdrFtr_Odd = 4, HdrFtr_Content = 5, - HdrFtr_Y2 = 6,//устарел - HdrFtr_Y = 7//устарел + HdrFtr_Y2 = 6,// deprecated + HdrFtr_Y = 7// deprecated };} namespace c_oSerCnf {enum c_oSerCnf { diff --git a/OOXML/Binary/Document/BinWriter/BinaryWriterD.cpp b/OOXML/Binary/Document/BinWriter/BinaryWriterD.cpp index 0e7baf16c9..3c5de5c813 100644 --- a/OOXML/Binary/Document/BinWriter/BinaryWriterD.cpp +++ b/OOXML/Binary/Document/BinWriter/BinaryWriterD.cpp @@ -132,7 +132,7 @@ void BinaryCommonWriter::WriteItemEnd(int nStart) } int BinaryCommonWriter::WriteItemWithLengthStart() { -//Запоминаем позицию чтобы в конце записать туда длину +//Save position to write length at the end int nStartPos = m_oStream.GetPosition(); m_oStream.Skip(4); return nStartPos; @@ -153,7 +153,7 @@ void BinaryCommonWriter::WriteBorder(const BYTE & type, const ComplexTypes::Word WriteItemEnd(nCurPos); } void BinaryCommonWriter::WriteBorder(const ComplexTypes::Word::CBorder& border) -{//todooo сделать все типы бордера +{//todo implement all border types if (border.m_oColor.IsInit()) WriteColor(c_oSerBorderType::Color, border.m_oColor.get()); @@ -400,7 +400,7 @@ void BinaryCommonWriter::WriteFont(std::wstring sFontName, BYTE bType, DocWrappe { if (!sFontName.empty()) { - //Подбор шрифтов + //Font matching sFontName = m_oFontProcessor.getFont(sFontName); if (NULL != m_pEmbeddedFontsManager) m_pEmbeddedFontsManager->CheckFont(sFontName, m_oFontProcessor.getFontManager()); @@ -958,7 +958,7 @@ Binary_pPrWriter::Binary_pPrWriter(ParamsWriter& oParamsWriter, BinaryHeaderFoot void Binary_pPrWriter::Write_pPr(const OOX::Logic::CParagraphProperty& pPr) { int nCurPos = 0; - //Стили надо писать первыми, потому что применение стиля при открытии уничтажаются настройки параграфа + //Styles must be written first, because applying style on open destroys paragraph settings std::wstring sStyleId; if (false != pPr.m_oPStyle.IsInit()) @@ -1021,8 +1021,8 @@ void Binary_pPrWriter::Write_pPr(const OOX::Logic::CParagraphProperty& pPr) m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte); m_oBcw.m_oStream.WriteBOOL(SimpleTypes::onoffTrue == pPr.m_oWidowControl.get().m_oVal.GetValue()); } - //Списки надо писать после стилей, т.к. при открытии в методах добавления списка проверяются стили - //Списки могут быть заданы с стилях.Это надо учитывать. + //Lists must be written after styles, because list addition methods check styles when opening + //Lists can be defined in styles. This must be taken into account. //NumPr if (pPr.m_oNumPr.IsInit() && (pPr.m_oNumPr->m_oNumID.IsInit() || pPr.m_oNumPr->m_oIlvl.IsInit())) { @@ -2443,8 +2443,8 @@ void Binary_tblPrWriter::WriteRowHeight(const ComplexTypes::Word::CHeight& rowHe if (rowHeight.m_oVal.IsInit()) { //HRule - //хотя по спецификации отсутсвие hRule долно трактоваться как auto(17.4.81 trHeight (Table Row Height)) - //word трактует <w:trHeight w:val="542"/> как AtLeast + //although by spec absence of hRule should be treated as auto (17.4.81 trHeight (Table Row Height)) + //word treats <w:trHeight w:val="542"/> as AtLeast SimpleTypes::EHeightRule eHRule = SimpleTypes::heightruleAtLeast; if (rowHeight.m_oHRule.IsInit()) eHRule = rowHeight.m_oHRule->GetValue(); @@ -4363,7 +4363,7 @@ void BinaryDocumentTableWriter::WriteFldSimpleContent(OOX::Logic::CFldSimple* pF { int nCurPos = 0; -//порядок записи важен +//write order is important nCurPos = m_oBcw.WriteItemStart(c_oSer_FldSimpleType::Instr); m_oBcw.m_oStream.WriteStringW3(*pFldSimple->m_sInstr); @@ -4713,7 +4713,7 @@ void BinaryDocumentTableWriter::WriteRun(OOX::Logic::CRun* pRun, bool bHyperlink else nRecordType = c_oSerParType::Run; -//Разбиваем массив по знаку et_w_sym +//Split array by et_w_sym sign for (std::vector<OOX::WritingElement*>::iterator it = nIndexStart; it != nIndexEnd; ++it) { OOX::WritingElement* item = (*it); @@ -4916,7 +4916,7 @@ void BinaryDocumentTableWriter::WriteMathArgNodes(const std::vector<OOX::Writing nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::Matrix); LONG lCol = 0; - //TODO убрать, тк при отсутствии m:mcs, к-во столбцов должно разруливаться динамически в скрипте + //TODO remove, since without m:mcs, column count should be resolved dynamically in script for (std::vector<OOX::WritingElement*>::iterator jt = pMatrix->m_arrItems.begin(); jt != pMatrix->m_arrItems.end(); jt++) { OOX::WritingElement* item = *jt; @@ -5229,7 +5229,7 @@ void BinaryDocumentTableWriter::WriteMathRunContent(OOX::Logic::CMRun* pMRun) OOX::Logic::CSym* oSym = static_cast<OOX::Logic::CSym*>(item); wchar_t ch = 0x0FFF & oSym->m_oChar->GetValue(); std::wstring sText(&ch, 1); - WriteText(sText, c_oSerRunType::run); // todooo определить что писать c_oSerRunType::run или c_oSerRunType::delText - 66333 + WriteText(sText, c_oSerRunType::run); // todooo determine what to write c_oSerRunType::run or c_oSerRunType::delText - 66333 }break; case OOX::et_w_delText: @@ -5445,7 +5445,7 @@ void BinaryDocumentTableWriter::WriteMathBrk(const OOX::Logic::CBrk &pBrk) m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long); m_oBcw.m_oStream.WriteLONG(pBrk.m_alnAt->GetValue()); } - //заглушка для <m:brk> + //stub for <m:brk> else { m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val); @@ -6561,7 +6561,7 @@ void BinaryDocumentTableWriter::WritePreparedRun(OOX::Logic::CRun *pRun, bool bH int nCurPos = 0; OOX::Logic::CRunProperty* oCur_rPr = pRun->m_oRunProperty; -//Если первый элемент символ надо выставить в его настройки шрифт +//If first element is symbol, need to set font in its settings if (start != pRun->m_arrItems.end() && OOX::et_w_sym == (*start)->getType()) { OOX::Logic::CSym* oSym = static_cast<OOX::Logic::CSym*>(*start); @@ -6582,7 +6582,7 @@ void BinaryDocumentTableWriter::WritePreparedRun(OOX::Logic::CRun *pRun, bool bH oCur_rPr->m_oRFonts->m_sHAnsi->append(sFont); } } -//пишем rPr +//write rPr if (NULL != oCur_rPr) { nCurPos = m_oBcw.WriteItemStart(c_oSerRunType::rPr); @@ -6590,7 +6590,7 @@ void BinaryDocumentTableWriter::WritePreparedRun(OOX::Logic::CRun *pRun, bool bH m_oBcw.WriteItemEnd(nCurPos); } - //Content пишется начиная от индекса nIndexStart и заканчивая предшествующим элементом для nIndexStop + //Content is written starting from nIndexStart and ending with preceding element for nIndexStop nCurPos = m_oBcw.WriteItemStart(c_oSerRunType::Content); WriteRunContent( start, end, bHyperlink); m_oBcw.WriteItemWithLengthEnd(nCurPos); @@ -6692,7 +6692,7 @@ void BinaryDocumentTableWriter::WriteRunContent(std::vector<OOX::WritingElement* OOX::Logic::CSym* oSym = static_cast<OOX::Logic::CSym*>(item); wchar_t ch = 0x0FFF & oSym->m_oChar->GetValue(); std::wstring sText(&ch, 1); - WriteText(sText, c_oSerRunType::run); // todooo определить что писать c_oSerRunType::run или c_oSerRunType::delText - 66333 + WriteText(sText, c_oSerRunType::run); // todooo determine what to write c_oSerRunType::run or c_oSerRunType::delText - 66333 break; } case OOX::et_w_delText: @@ -6871,7 +6871,7 @@ bool BinaryDocumentTableWriter::WriteDrawingPptx(OOX::WritingElement* item) { if ((pGraphic) && (pGraphic->contentPart.IsInit())) { - //todooo разобрать по типам вставок + //todooo parse by insertion types res = false; } else @@ -7658,7 +7658,7 @@ void BinaryDocumentTableWriter::WriteDocTable(OOX::Logic::CTbl* tbl) } bool BinaryDocumentTableWriter::ValidateRow(const std::vector<OOX::WritingElement *> & arrItems) { -//Проверяем чтобы не все ячейки в ряду были вертикально замержены +//Check that not all cells in row are vertically merged bool bRes = true; for(size_t i = 0; i < arrItems.size(); ++i) @@ -8007,7 +8007,7 @@ void BinaryDocumentTableWriter::WriteRowContent(const std::vector<OOX::WritingEl void BinaryDocumentTableWriter::WriteCell(OOX::Logic::CTc& tc, OOX::Logic::CTableProperty* pTblPr, int nCurRowIndex, int nCurColIndex) { int nCurPos = 0; -//св-ва ячейки +//cell properties if (NULL != tc.m_pTableCellProperties) { nCurPos = m_oBcw.WriteItemStart(c_oSerDocTableType::Cell_Pr); @@ -8701,7 +8701,7 @@ void BinaryCommentsTableWriter::WriteCommentsContent(OOX::CComments& oComments, } aCommentsToWrite.push_back(pNewCommentWriteTemp); } - //разбираемся с reply и done + //handle reply and done if (NULL != pCommentsExt) { for(size_t i = 0, length = pCommentsExt->m_arrComments.size(); i < length; i++) @@ -9797,10 +9797,10 @@ std::wstring BinaryFileWriter::WriteFileHeader(long nDataSize, int version) } void BinaryFileWriter::WriteMainTableStart(bool bSigTable) { - int nTableCount = 128;//Специально ставим большое число, чтобы не увеличивать его при добавлении очередной таблицы. + int nTableCount = 128;//Intentionally set large number to avoid increasing it when adding next table. m_nRealTableCount = 0; m_nMainTableStart = m_oBcw.m_oStream.GetPosition(); - //вычисляем с какой позиции можно писать таблицы + //calculate from which position we can write tables int nmtItemSize = 5;//5 byte m_nLastFilePos = m_nMainTableStart + nTableCount * nmtItemSize; //Write mtLen @@ -9820,11 +9820,11 @@ void BinaryFileWriter::WriteMainTableStart(bool bSigTable) } void BinaryFileWriter::WriteMainTableEnd() { - //Количество таблиц + //Number of tables m_oBcw.m_oStream.SetPosition(m_nMainTableStart); m_oBcw.m_oStream.WriteBYTE(m_nRealTableCount); - //Seek в конец + //Seek to end m_oBcw.m_oStream.SetPosition(m_nLastFilePos); } int BinaryFileWriter::WriteTableStart(BYTE type, int nStartPos) @@ -9838,18 +9838,18 @@ int BinaryFileWriter::WriteTableStart(BYTE type, int nStartPos) m_oBcw.m_oStream.WriteLONG(m_nLastFilePos); //Write table - //Запоминаем позицию в MainTable + //Remember position in MainTable int nCurPos = m_oBcw.m_oStream.GetPosition(); - //Seek в свободную область + //Seek to free area m_oBcw.m_oStream.SetPosition(m_nLastFilePos); return nCurPos; } void BinaryFileWriter::WriteTableEnd(int nCurPos) { - //сдвигаем позицию куда можно следующую таблицу + //shift position where next table can be written m_nLastFilePos = m_oBcw.m_oStream.GetPosition(); m_nRealTableCount++; - //Seek вобратно в MainTable + //Seek back to MainTable m_oBcw.m_oStream.SetPosition(nCurPos); } void BinaryFileWriter::intoBindoc(const std::wstring& sSrcPath) diff --git a/OOXML/Binary/Document/BinWriter/BinaryWriterD.h b/OOXML/Binary/Document/BinWriter/BinaryWriterD.h index 2e39ec9758..e9466e4d64 100644 --- a/OOXML/Binary/Document/BinWriter/BinaryWriterD.h +++ b/OOXML/Binary/Document/BinWriter/BinaryWriterD.h @@ -320,7 +320,7 @@ namespace BinDocxRW OOX::CDocument* pDocument; OOX::JsaProject* pJsaProject; - bool m_bWriteSectPr;//Записывать ли свойства верхнего уровня в данном экземпляре BinaryOtherTableWriter + bool m_bWriteSectPr;//Whether to write top-level properties in this BinaryOtherTableWriter instance //--------------------------------- BinaryDocumentTableWriter(ParamsWriter& oParamsWriter, ParamsDocumentWriter& oParamsDocumentWriter, std::map<int, bool>* mapIgnoreComments, BinaryHeaderFooterTableWriter* oBinaryHeaderFooterTableWriter); diff --git a/OOXML/Binary/Document/DocWrapper/ChartSerializer.cpp b/OOXML/Binary/Document/DocWrapper/ChartSerializer.cpp index 3bd1805d55..e71f0d084c 100644 --- a/OOXML/Binary/Document/DocWrapper/ChartSerializer.cpp +++ b/OOXML/Binary/Document/DocWrapper/ChartSerializer.cpp @@ -258,7 +258,7 @@ namespace BinXlsxRW{ oXlsx.m_pStyles->m_oDxfs->m_oCount.Init(); oXlsx.m_pStyles->m_oDxfs->m_oCount->SetValue(oXlsx.m_pStyles->m_oDxfs->m_arrItems.size()); //Table - //todo table в случае нескольких sheet или если серии разнесены по sheet + //todo table for multiple sheets or if series are spread across sheets if(m_aTableNames.size() > 0) { OOX::Spreadsheet::CTableFile* pTable = new OOX::Spreadsheet::CTableFile(NULL); @@ -481,7 +481,7 @@ namespace BinXlsxRW{ } } } - //проверяем можем ли создать таблицу + //check if we can create table if(m_mapSheets.size() > 0 && m_nRow1 > 0 && m_nRow2 > 0 && m_nCol1 > 0 && m_nCol2 > 0 && m_nRow1 < m_nRow2) { std::map<int, std::map<int, OOX::Spreadsheet::CCell*>*>* rows = m_mapSheets.begin()->second; @@ -505,7 +505,7 @@ namespace BinXlsxRW{ { int nIndexCell = aIndexesCell[j]; OOX::Spreadsheet::CCell* pCell = cells->at(nIndexCell); - //не должно быть ячеек без m_oValue + //there should be no cells without m_oValue m_aTableNames.push_back(pCell->m_oValue->m_sText); } } @@ -611,12 +611,12 @@ namespace BinXlsxRW{ } else { - //как в CsvReader - подозрительный код + //like in CsvReader - suspicious code WCHAR *pEndPtr; wcstod(val.c_str(), &pEndPtr); if (0 != *pEndPtr) { - // Не число + // Not a number aSharedStrings.push_back(val); pCell->m_oType->SetValue(SimpleTypes::Spreadsheet::celltypeSharedString); pCell->m_oValue->m_sText = std::to_wstring((int)aSharedStrings.size() - 1); @@ -674,7 +674,7 @@ namespace BinXlsxRW{ OOX::Spreadsheet::CCell* ChartWriter::parseCreateCell(const int& nRow, const int& nCol, const std::wstring& val, std::wstring format) { OOX::Spreadsheet::CCell* pNewCell = new OOX::Spreadsheet::CCell(); - //пока добавляем как есть, shared string после записи таблицы + //for now add as is, shared string after table write pNewCell->m_oValue.Init(); pNewCell->m_oValue->m_sText = val; @@ -853,7 +853,7 @@ namespace BinXlsxRW{ } void ChartWriter::parseMultiLvlStrRef(const OOX::Spreadsheet::CT_MultiLvlStrRef* pMultiLvlStrRef, bool bUpdateRange, const wchar_t* cRangeName) { - //todo нужен пример + //todo need an example } void ChartWriter::parseAxDataSource(const OOX::Spreadsheet::CT_AxDataSource* pAxDataSource, bool bUpdateRange, const wchar_t* cRangeName) { diff --git a/OOXML/Binary/Document/DocWrapper/DocxSerializer.cpp b/OOXML/Binary/Document/DocWrapper/DocxSerializer.cpp index 1fca701256..381de54887 100644 --- a/OOXML/Binary/Document/DocWrapper/DocxSerializer.cpp +++ b/OOXML/Binary/Document/DocWrapper/DocxSerializer.cpp @@ -127,7 +127,7 @@ namespace BinDocxRW std::wstring data = oReader.GetInnerXml(); XmlUtils::replace_all(data, L" ", L""); XmlUtils::replace_all(data, L" ", L""); - //todooo убрать "красивую" разметку xml + //todo remove "pretty" xml formatting WriteXmlFile(*name, data); } if (L"pkg:binaryData" == sName) @@ -224,13 +224,13 @@ bool BinDocxRW::CDocxSerializer::saveToFile(const std::wstring& sDstFileName, co pEmbeddedFontsManager = pFontPicker->GetNativeCutter(); - //добавляем весь латинский алфавит для списков. + //add entire latin alphabet for lists. pEmbeddedFontsManager->CheckString(std::wstring(_T("abcdefghijklmnopqrstuvwxyz"))); - //добавим мега шрифт + //add mega font pEmbeddedFontsManager->CheckFont(_T("Wingdings 3"), fp.getFontManager()); pEmbeddedFontsManager->CheckFont(_T("Arial"), fp.getFontManager()); - //pEmbeddedFontsManager добавляются все цифры + //pEmbeddedFontsManager adds all digits } oDrawingConverter.SetFontDir(m_sFontDir); @@ -331,7 +331,7 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const std::wstring& sSrcFileName, oFile.ReadFile(pBase64Data, oFile.GetFileSize(), nBase64DataSize); oFile.CloseFile(); - //проверяем формат + //check format bool bValidFormat = false; std::wstring sSignature(g_sFormatSignature); int nSigLength = (int)sSignature.length(); @@ -346,7 +346,7 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const std::wstring& sSrcFileName, } if (bValidFormat) { - //Читаем из файла версию и длину base64 + //Read version and base64 length from file int nIndex = nSigLength; int nType = 0; std::string version = ""; @@ -417,7 +417,7 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const std::wstring& sSrcFileName, m_pCurFileWriter = new Writers::FileWriter(sDstPath, m_sFontDir, false, nVersion, &oDrawingConverter, sThemePath); - //папка с картинками + //folder with images std::wstring strFileInDir = NSSystemPath::GetDirectoryName(sSrcFileName); std::wstring sFileInDir = strFileInDir.c_str(); diff --git a/OOXML/Binary/Document/DocWrapper/FontProcessor.cpp b/OOXML/Binary/Document/DocWrapper/FontProcessor.cpp index 41218df237..1ea968aea9 100644 --- a/OOXML/Binary/Document/DocWrapper/FontProcessor.cpp +++ b/OOXML/Binary/Document/DocWrapper/FontProcessor.cpp @@ -63,7 +63,7 @@ namespace DocWrapper { } void FontProcessor::setFontTable(OOX::CFontTable* fontTable) { - //подбор перенесен в js + //font matching moved to js return; for (size_t i = 0; i < fontTable->m_arrFonts.size(); ++i) addToFontMap(*fontTable->m_arrFonts[i]); @@ -71,7 +71,7 @@ namespace DocWrapper { std::wstring FontProcessor::getFont(const std::wstring& name) { - //подбор перенесен в js + //font matching moved to js return name; std::wstring fontName = gc_sDefaultFontName; if (fontMap.find(name) != fontMap.end()) @@ -93,7 +93,7 @@ namespace DocWrapper { std::wstring sFontName; if(NULL != pTheme && oScheme.IsInit() && oScheme->m_oFontScheme.IsInit()) { - //берем шрифт из темы + //get font from theme const SimpleTypes::Spreadsheet::EFontScheme eFontScheme = oScheme->m_oFontScheme->GetValue(); if(SimpleTypes::Spreadsheet::fontschemeMajor == eFontScheme) sFontName = pTheme->themeElements.fontScheme.majorFont.latin.typeface; @@ -104,7 +104,7 @@ namespace DocWrapper { sFontName = oRFont->ToString2(); if(sFontName.empty()) sFontName = std::wstring(gc_sNoNameFont); - //подбор перенесен в js + //font matching moved to js return sFontName; oFontSelectFormat.wsName = new std::wstring(sFontName); @@ -112,7 +112,7 @@ namespace DocWrapper { if(oCharset.IsInit() && oCharset->m_oCharset.IsInit()) { SimpleTypes::Spreadsheet::EFontCharset eCharset = oCharset->m_oCharset->GetValue(); - //на серверве на берем в расчет fontcharsetANSI и fontcharsetDefault, потому что он зависит от локали, а dll работает на сервере + //on server we don't take fontcharsetANSI and fontcharsetDefault into account, because they depend on locale, and dll works on server if(SimpleTypes::fontcharsetANSI != eCharset && SimpleTypes::fontcharsetDefault != eCharset) { oFontSelectFormat.unCharset = new BYTE; @@ -153,7 +153,7 @@ namespace DocWrapper { if(font.m_oCharset.IsInit()) { SimpleTypes::EFontCharset eCharset = font.m_oCharset->GetValue(); - //на серверве на берем в расчет fontcharsetANSI и fontcharsetDefault, потому что он зависит от локали, а dll работает на сервере + //on server we don't take fontcharsetANSI and fontcharsetDefault into account, because they depend on locale, and dll works on server if(SimpleTypes::fontcharsetANSI != eCharset && SimpleTypes::fontcharsetDefault != eCharset) { oFontSelectFormat.unCharset = new BYTE; @@ -173,7 +173,7 @@ namespace DocWrapper { { unsigned char cCurVal = font.m_oPanose->Get_Number(i); oFontSelectFormat.pPanose[i] = cCurVal; - // Если хоть одно значение не 0, то используем Panose + // If at least one value is not 0, then use Panose if ( 0 != cCurVal ) bIsPanose = true; } diff --git a/OOXML/Binary/Document/DocWrapper/VsdxSerializer.cpp b/OOXML/Binary/Document/DocWrapper/VsdxSerializer.cpp index 4bc68251a0..90db9c3117 100644 --- a/OOXML/Binary/Document/DocWrapper/VsdxSerializer.cpp +++ b/OOXML/Binary/Document/DocWrapper/VsdxSerializer.cpp @@ -57,7 +57,7 @@ namespace BinVsdxRW OOX::CPath pathMediaDir = sDstPath + FILE_SEPARATOR_STR + _T("visio") + FILE_SEPARATOR_STR + _T("media"); OOX::CPath pathEmbedDir = sDstPath + FILE_SEPARATOR_STR + _T("visio") + FILE_SEPARATOR_STR + _T("embeddings"); - //создавать папку надо даже при сохранении в csv, потому что когда читаем из бинарника тему, она записывается в файл. + // need to create folder even when saving to csv, because when reading theme from binary, it is written to file. OOX::CPath pathVDir = sDstPath + FILE_SEPARATOR_STR + _T("visio"); OOX::CPath pathThemeDir = pathVDir + FILE_SEPARATOR_STR + OOX::FileTypes::Theme.DefaultDirectory().GetPath(); diff --git a/OOXML/Binary/Document/DocWrapper/XlsxSerializer.cpp b/OOXML/Binary/Document/DocWrapper/XlsxSerializer.cpp index b07de0574f..633d6455c6 100644 --- a/OOXML/Binary/Document/DocWrapper/XlsxSerializer.cpp +++ b/OOXML/Binary/Document/DocWrapper/XlsxSerializer.cpp @@ -62,7 +62,7 @@ namespace BinXlsxRW{ OOX::CPath pathMediaDir = sDstPath + FILE_SEPARATOR_STR + _T("xl") + FILE_SEPARATOR_STR + _T("media"); OOX::CPath pathEmbedDir = sDstPath + FILE_SEPARATOR_STR + _T("xl") + FILE_SEPARATOR_STR + _T("embeddings"); - //создавать папку надо даже при сохранении в csv, потому что когда читаем из бинарника тему, она записывается в файл. + //need to create folder even when saving to csv, because when reading theme from binary, it is written to file. OOX::CPath pathXlDir = sDstPath + FILE_SEPARATOR_STR + _T("xl"); OOX::CPath pathThemeDir = pathXlDir + FILE_SEPARATOR_STR + OOX::FileTypes::Theme.DefaultDirectory().GetPath(); @@ -118,17 +118,17 @@ namespace BinXlsxRW{ pFontPicker->SetEmbeddedFontsDirectory(m_sEmbeddedFontsDir); pEmbeddedFontsManager = pFontPicker->GetNativeCutter(); - //добавим мега шрифт + //add mega font pEmbeddedFontsManager->CheckFont(_T("Wingdings 3"), pFontManager); pEmbeddedFontsManager->CheckFont(_T("Arial"), pFontManager); - //pEmbeddedFontsManager добавляются все цифры - //для заголовков + //pEmbeddedFontsManager adds all digits + //for headers pEmbeddedFontsManager->CheckFont(_T("Calibri"), pFontManager); pEmbeddedFontsManager->CheckString(std::wstring(_T("ABCDEFGHIJKLMNOPQRSTUVWXYZ"))); - //дополнение для ошибок "#NULL!", "#DIV/0!"... + //addition for errors "#NULL!", "#DIV/0!"... pEmbeddedFontsManager->CheckString(std::wstring(_T("#!/?"))); - //дополнение для num форматов по умолчанию с id от 0 до 49 + //addition for default num formats with id from 0 to 49 pEmbeddedFontsManager->CheckString(std::wstring(_T(".%E+-():"))); } @@ -296,18 +296,18 @@ namespace BinXlsxRW{ NSCommon::smart_ptr<OOX::Spreadsheet::CChartFile> oChart = file.smart_dynamic_cast<OOX::Spreadsheet::CChartFile>(); if (oChart.IsInit() == false) return false; - //анализируем chart + //analyze chart BinXlsxRW::ChartWriter helper; helper.parseChart(oChart->m_oChartSpace.m_chart); - //создаем temp + //create temp std::wstring sTempDir = NSSystemPath::GetDirectoryName(sDstFile) + FILE_SEPARATOR_STR + NSSystemPath::GetFileName(sDstFile) + L"_TEMP"; NSDirectory::CreateDirectory(sTempDir); OOX::CPath oPath(sTempDir.c_str()); - //шиблонные папки + //template folders std::wstring sMediaPath;// will be filled by 'CreateXlsxFolders' method std::wstring sEmbedPath; // will be filled by 'CreateXlsxFolders' method CreateXlsxFolders (sTempDir, sMediaPath, sEmbedPath); - //заполняем Xlsx + //fill Xlsx OOX::Spreadsheet::CXlsx oXlsx; helper.toXlsx(oXlsx); //write diff --git a/OOXML/Binary/Draw/BinaryReaderV.cpp b/OOXML/Binary/Draw/BinaryReaderV.cpp index be6f7fba99..0ea1575cba 100644 --- a/OOXML/Binary/Draw/BinaryReaderV.cpp +++ b/OOXML/Binary/Draw/BinaryReaderV.cpp @@ -76,7 +76,7 @@ namespace BinVsdxRW oFile.ReadFile(pBase64Data, oFile.GetFileSize(), nBase64DataSize); oFile.CloseFile(); - //проверяем формат + //check format bool bValidFormat = false; std::wstring sSignature(g_sFormatSignature); size_t nSigLength = sSignature.length(); @@ -92,7 +92,7 @@ namespace BinVsdxRW } if (bValidFormat) { - //Читаем из файла версию и длину base64 + //Read version and base64 length from file int nIndex = (int)nSigLength; int nType = 0; std::string version = ""; diff --git a/OOXML/Binary/Draw/BinaryWriterV.cpp b/OOXML/Binary/Draw/BinaryWriterV.cpp index d5aeea83ff..ce96bf7400 100644 --- a/OOXML/Binary/Draw/BinaryWriterV.cpp +++ b/OOXML/Binary/Draw/BinaryWriterV.cpp @@ -103,7 +103,7 @@ _UINT32 BinaryFileWriter::Open(const std::wstring& sInputDir, const std::wstring _UINT32 result = 0; OOX::CPath pathDst(sFileDst); -//создаем папку для media +//create folder for media std::wstring mediaDir = pathDst.GetDirectory() + L"media"; NSDirectory::CreateDirectory(mediaDir); @@ -220,7 +220,7 @@ void BinaryFileWriter::WriteMainTableStart(NSBinPptxRW::CBinaryFileWriter &oBuff m_nRealTableCount = 0; m_nMainTableStart = m_oBcw->m_oStream.GetPosition(); - //вычисляем с какой позиции можно писать таблицы + //calculate from which position we can write tables m_nLastFilePos = m_nMainTableStart + GetMainTableSize(); //Write mtLen m_oBcw->m_oStream.WriteBYTE(0); @@ -247,18 +247,18 @@ int BinaryFileWriter::WriteTableStart(BYTE type, int nStartPos) m_oBcw->m_oStream.WriteLONG(m_nLastFilePos); //Write table - //Запоминаем позицию в MainTable + //Remember position in MainTable int nCurPos = m_oBcw->m_oStream.GetPosition(); - //Seek в свободную область + //Seek to free area m_oBcw->m_oStream.SetPosition(m_nLastFilePos); return nCurPos; } void BinaryFileWriter::WriteTableEnd(int nCurPos) { - //сдвигаем позицию куда можно следующую таблицу + //shift position where next table can be written m_nLastFilePos = m_oBcw->m_oStream.GetPosition(); m_nRealTableCount++; - //Seek вобратно в MainTable + //Seek back to MainTable m_oBcw->m_oStream.SetPosition(nCurPos); } diff --git a/OOXML/Binary/MathEquation/MathEquation.cpp b/OOXML/Binary/MathEquation/MathEquation.cpp index c002ac2a77..0288434910 100644 --- a/OOXML/Binary/MathEquation/MathEquation.cpp +++ b/OOXML/Binary/MathEquation/MathEquation.cpp @@ -56,9 +56,9 @@ CEquationReader::~CEquationReader() void CEquationReader::InitSizes() { - //todo обработать open(true/false) + // todo handle open(true/false) m_oStorage.open(false, false); - // Выставляем размеры текста по умолчанию (если они изменены, тогда ничего не поделаешь, т.к. это не сохраняется в самом файле) + // Set default text sizes (if they are changed, there's nothing we can do, as this is not saved in the file itself) aSizeTable[0] = 12; aSizeTable[1] = 7; aSizeTable[2] = 5; @@ -72,8 +72,8 @@ void CEquationReader::SetOutputDev(IOutputDev *pOutput) } void CEquationReader::InitFonts() { - // Стандартные шрифты для MathEquation со стандартными настройками стилей. - // (если они изменены, тогда ничего не поделаешь, т.к. это не сохраняется в самом файле) + // Standard fonts for MathEquation with default style settings. + // (if they are changed, there's nothing we can do, as this is not saved in the file itself) if (pOutputDev) { @@ -81,14 +81,14 @@ void CEquationReader::InitFonts() { switch(i) { - case 1: pOutputDev->AddFont(i + 128, "Times New Roman", false, false); break; // текст - case 2: pOutputDev->AddFont(i + 128, "Times New Roman", false, false); break; // функция - case 3: pOutputDev->AddFont(i + 128, "Times New Roman", false, true); break; // переменная - case 4: pOutputDev->AddFont(i + 128, "Symbol", false, true); break; // ст. греческие - case 5: pOutputDev->AddFont(i + 128, "Symbol", false, false); break; // пр. греческие - case 6: pOutputDev->AddFont(i + 128, "Symbol", false, false); break; // символ - case 7: pOutputDev->AddFont(i + 128, "Times New Roman", true, false); break; // матрица-вектор - case 8: pOutputDev->AddFont(i + 128, "Times New Roman", false, false); break; // числа + case 1: pOutputDev->AddFont(i + 128, "Times New Roman", false, false); break; // text + case 2: pOutputDev->AddFont(i + 128, "Times New Roman", false, false); break; // function + case 3: pOutputDev->AddFont(i + 128, "Times New Roman", false, true); break; // variable + case 4: pOutputDev->AddFont(i + 128, "Symbol", false, true); break; // lowercase Greek + case 5: pOutputDev->AddFont(i + 128, "Symbol", false, false); break; // uppercase Greek + case 6: pOutputDev->AddFont(i + 128, "Symbol", false, false); break; // symbol + case 7: pOutputDev->AddFont(i + 128, "Times New Roman", true, false); break; // matrix-vector + case 8: pOutputDev->AddFont(i + 128, "Times New Roman", false, false); break; // numbers } } } @@ -96,8 +96,8 @@ void CEquationReader::InitFonts() int CEquationReader::Parse() { - //если смотреть реализацию, то pStm можно удалить после конструтора CLEStream, - //но если не смотреть реализацию,то правильно удалить pStm после pS + // looking at implementation, pStm can be deleted after CLEStream constructor, + // but without looking at implementation, it's correct to delete pStm after pS pStm = new POLE::Stream( &m_oStorage, L"Equation Native"); pS = new CLEStream<Stream>(pStm); if (!pS->IsValid()) @@ -715,7 +715,7 @@ void CEquationReader::HandleSetSize(MTOKENS eType) } case 100: { - // TODO: Проверить эту ветку + // TODO: Check this branch *pS >> nTemp; nSize = nTemp; @@ -725,7 +725,7 @@ void CEquationReader::HandleSetSize(MTOKENS eType) } default: { - // TODO: Проверить эту ветку + // TODO: Check this branch nSize = nTemp; *pS >> nTemp; _UINT16 nTempSize = nTemp - 128; diff --git a/OOXML/Binary/MathEquation/MathEquation.h b/OOXML/Binary/MathEquation/MathEquation.h index 1f2e1f34a8..d611d7bed1 100644 --- a/OOXML/Binary/MathEquation/MathEquation.h +++ b/OOXML/Binary/MathEquation/MathEquation.h @@ -67,11 +67,11 @@ namespace MathEquation RULER = 0x07, FONT = 0x08, SIZE_CUSTOM = 0x09, - SIZE_REGULAR = 0x0a, // обычный - SIZE_BIGSCRIPT = 0x0b, // крунпый индекс - SIZE_SMALLSCRIT = 0x0c, // мелкий индекс - SIZE_BIGSYMBOL = 0x0d, // большой символ - SIZE_SMALLSYMBOL = 0x0e // мелкий символ + SIZE_REGULAR = 0x0a, // regular + SIZE_BIGSCRIPT = 0x0b, // large script + SIZE_SMALLSCRIT = 0x0c, // small script + SIZE_BIGSYMBOL = 0x0d, // large symbol + SIZE_SMALLSYMBOL = 0x0e // small symbol }; private: diff --git a/OOXML/Binary/MathEquation/OutputDev.h b/OOXML/Binary/MathEquation/OutputDev.h index fc123c5676..160567f452 100644 --- a/OOXML/Binary/MathEquation/OutputDev.h +++ b/OOXML/Binary/MathEquation/OutputDev.h @@ -41,72 +41,72 @@ namespace MathEquation { public: - // Начало и конец формулы + // Start and end of equation virtual void BeginEquation() = 0; virtual void EndEquation() = 0; - // Начало и конец блока. + // Start and end of block. virtual void BeginBlock() = 0; virtual void EndBlock() = 0; - // Выставляем размер в текущем блоке + // Set size in current block virtual void SetSize(_UINT16 nSize) = 0; - // Добавляем символ. К символу могут быть добавлены разные элементы. Зачеркивание, добавление акцента и т.д. + // Add symbol. Various elements can be added to symbol. Strikethrough, accent, etc. virtual void BeginChar(unsigned short uChar, unsigned char nTypeFace, bool bSpecialSymbol) = 0; virtual void AddCharEmbel(MEMBELTYPE eType) = 0; virtual void EndChar() = 0; - // Матрица. Количество блоков здесь равно nRows * nCol, посылаются последовательно в обычном порядке (первая строка слева направо, вторая строка слева направо и т.д.) + // Matrix. Number of blocks here equals nRows * nCol, sent sequentially in normal order (first row left to right, second row left to right, etc.) virtual void BeginMatrix(unsigned char nVAlign, MMATRIXHORALIGN eHorAlign, MMATRIXVERALIGN eVerAlign, bool bEqualRows, bool bEqualCols, unsigned char nRows, unsigned char nCols, unsigned char* pVerBorders, unsigned char* pHorBorders) = 0; virtual void EndMatrix () = 0; virtual void StartPile(unsigned char nHAlign, unsigned char nVAlign) = 0; virtual void EndPile() = 0; - // Скобки с элементом внутри + // Brackets with element inside virtual void BeginBrackets(MBRACKETSTYPE eType, bool bOpen, bool bClose) = 0; virtual void EndBrackets (MBRACKETSTYPE eType, bool bOpen, bool bClose) = 0; - // Корень. Первый блок - основание, второй, если есть, степень. + // Root. First block - base, second if present - degree. virtual void BeginRoot(bool bDegree) = 0; virtual void EndRoot () = 0; - // Дроби. Первый блок - числитель, второй блок - знаменатель. + // Fractions. First block - numerator, second block - denominator. virtual void BeginFraction(MFRACTIONTYPES eType, bool bInline) = 0; virtual void EndFraction () = 0; - // Если bInline = true, то последовательность блоков Base, Sub, Sup - // Если bInline = false, то последовательность блоков Sub, Sup, Base + // If bInline = true, then block sequence is Base, Sub, Sup + // If bInline = false, then block sequence is Sub, Sup, Base virtual void BeginScript(MSCRIPTALIGN eAlign, bool bBase = false, bool bSup = false, bool bSub = false, bool bInline = true) = 0; virtual void EndScript () = 0; - // Линия свеху или снизу относительно текста + // Line above or below text virtual void BeginBar(MBARTYPE eType, bool bTop) = 0; virtual void EndBar () = 0; - // Стрелка с надписью сверху или снизу (отличе от BeginBar/EndBar в том, что здесь стрелка основной - // объект, а текст - это небольшая надпись, а у тех функций наоборот) + // Arrow with label above or below (differs from BeginBar/EndBar in that here arrow is main + // object, and text is small label, while those functions are opposite) virtual void BeginArrow(MARROWTYPE eType, bool bTop) = 0; virtual void EndArrow () = 0; - // Интегралы. Последовательность блоков всегда следующая(если блок присутствует) Base, Sub, Sup + // Integrals. Block sequence is always following (if block present) Base, Sub, Sup virtual void BeginIntegral(MINTEGRALTYPE eType) = 0; virtual void EndIntegral () = 0; - // Фигурная скобка с текстом над/под объектом. Сначала идет основной объект, потом надпись фигурной скобки. + // Curly brace with text above/below object. First comes main object, then curly brace label. virtual void BeginVerticalBrace(bool bTop) = 0; virtual void EndVerticalBrace () = 0; - // Сумма, произведение, копроизведение, объединение, пересечение. Последовательность блоков Base, Sub, Sup + // Sum, product, coproduct, union, intersection. Block sequence Base, Sub, Sup virtual void BeingNArray(MNARRAYTYPE eType) = 0; virtual void EndNArray () = 0; - // Деление столбиком. С частным или без. Вначале всегда идет основание, потом если есть частное. + // Long division. With quotient or without. First always comes base, then quotient if present. virtual void BeginLongDivision(MLONGDIVISION eType) = 0; virtual void EndLongDivision () = 0; - // < | > - такой элемент + // < | > - this type of element virtual void BeginAngleBracketsWithSeparator(MANGLEBRACKETSWITHSEPARATORTYPE eType) = 0; virtual void EndAngleBracketsWithSeparator () = 0; diff --git a/OOXML/Binary/MathEquation/Types.h b/OOXML/Binary/MathEquation/Types.h index d960123e71..f2e1ff3ff1 100644 --- a/OOXML/Binary/MathEquation/Types.h +++ b/OOXML/Binary/MathEquation/Types.h @@ -48,14 +48,14 @@ namespace MathEquation enum MBRACKETSTYPE { - bracketsAngle = 0x00, // < > Угловые скобки - bracketsRound = 0x01, // ( ) Круглые скобки - bracketsCurve = 0x02, // { } Фигурные скобки - bracketsSquare = 0x03, // [ ] Квадратные скобки - bracketsLine = 0x04, // | | Скобки в виде линии - bracketsDLine = 0x05, // || ||Скобки в виде двойной линии - bracketsFloor = 0x06, // Скобки с углом внизу - bracketsCeil = 0x07, // Скобки с углом наверху + bracketsAngle = 0x00, // < > Angle brackets + bracketsRound = 0x01, // ( ) Round brackets + bracketsCurve = 0x02, // { } Curly brackets + bracketsSquare = 0x03, // [ ] Square brackets + bracketsLine = 0x04, // | | Line brackets + bracketsDLine = 0x05, // || || Double line brackets + bracketsFloor = 0x06, // Floor brackets (angle at bottom) + bracketsCeil = 0x07, // Ceiling brackets (angle at top) bracketsSquareOpenOpen = 0x08, // [ [ bracketsSquareCloseClose = 0x09, // ] ] bracketsSquareCloseOpen = 0x0a, // ] [ @@ -66,8 +66,8 @@ namespace MathEquation enum MFRACTIONTYPES { - fractionRegular = 0, // Обычная дробь - fractionSlanted = 1 // Наклонная дробь + fractionRegular = 0, // Regular fraction + fractionSlanted = 1 // Slanted fraction }; enum MSCRIPTALIGN @@ -79,91 +79,91 @@ namespace MathEquation enum MBARTYPE { - bartypeLine = 0, // простая линия - bartypeDoubleLine = 1, // двойная линия - bartypeArrowLeft = 2, // стрелка налево - bartypeArrowRight = 3, // стрелка направо - bartypeArrowDouble = 4 // двойная стрелка (и налево, и направо) + bartypeLine = 0, // simple line + bartypeDoubleLine = 1, // double line + bartypeArrowLeft = 2, // left arrow + bartypeArrowRight = 3, // right arrow + bartypeArrowDouble = 4 // double arrow (both left and right) }; enum MARROWTYPE { - arrowtypeLeft = 0, // стрелка налево - arrowtypeRight = 1, // стрелка направо - arrowtypeDouble = 2 // двойная стрелка (и налево, и направо) + arrowtypeLeft = 0, // left arrow + arrowtypeRight = 1, // right arrow + arrowtypeDouble = 2 // double arrow (both left and right) }; enum MINTEGRALTYPE { - integraltypeSingle = 0, // Обычный одинарный интеграл без индексов - integraltypeSingleRSub = 1, // Одинарный интеграл с правым нижним индексом - integraltypeSingleRSubSup = 2, // Одинарный интеграл с правыми верхним и нижним индексами - integraltypeSingleOriented = 3, // Одинарный ориентированный интеграл - integraltypeSingleOrientedRSub = 4, // Одинарный ориентированный интеграл с правым нижним индексом + integraltypeSingle = 0, // Regular single integral without indices + integraltypeSingleRSub = 1, // Single integral with right subscript + integraltypeSingleRSubSup = 2, // Single integral with right subscript and superscript + integraltypeSingleOriented = 3, // Single oriented integral + integraltypeSingleOrientedRSub = 4, // Single oriented integral with right subscript - integraltypeDouble = 5, // Двойной интеграл без индексов - integraltypeDoubleRSub = 6, // Двойной интеграл с правым нижним индексом - integraltypeDoubleOriented = 7, // Двойной ориентированный интеграл - integraltypeDoubleOrientedRSub = 8, // Двойной ориентированный интеграл с правым нижним индексом + integraltypeDouble = 5, // Double integral without indices + integraltypeDoubleRSub = 6, // Double integral with right subscript + integraltypeDoubleOriented = 7, // Double oriented integral + integraltypeDoubleOrientedRSub = 8, // Double oriented integral with right subscript - integraltypeTriple = 9, // Тройной интеграл без индексов - integraltypeTripleRSub = 10, // Тройной интеграл с правым нижним индексом - integraltypeTripleOriented = 11, // Тройной ориентированный интеграл - integraltypeTripleOrientedRSub = 12, // Тройной ориентированный интеграл с правым нижним индексом + integraltypeTriple = 9, // Triple integral without indices + integraltypeTripleRSub = 10, // Triple integral with right subscript + integraltypeTripleOriented = 11, // Triple oriented integral + integraltypeTripleOrientedRSub = 12, // Triple oriented integral with right subscript - integraltypeSingleCSubSup = 13, // Одинарный интеграл с центральными верхним и нижним индексами - integraltypeSingleCSub = 14, // Одинарный интеграл с центральным нижним индексом - integraltypeSingleOrientedCSub = 15, // Одинарный ориентированный интеграл с центральным нижним индексом + integraltypeSingleCSubSup = 13, // Single integral with center subscript and superscript + integraltypeSingleCSub = 14, // Single integral with center subscript + integraltypeSingleOrientedCSub = 15, // Single oriented integral with center subscript - integraltypeDoubleOrientedCSub = 16, // Двойной ориентированный интеграл с центральным нижним индексом - integraltypeDoubleCSub = 17, // Двойной интеграл с центральным нижним индексом + integraltypeDoubleOrientedCSub = 16, // Double oriented integral with center subscript + integraltypeDoubleCSub = 17, // Double integral with center subscript - integraltypeTripleOrientedCSub = 18, // Тройной ориентированный интеграл с центральным нижним индексом - integraltypeTripleCSub = 19 // Тройной интеграл с центральным нижним индексом + integraltypeTripleOrientedCSub = 18, // Triple oriented integral with center subscript + integraltypeTripleCSub = 19 // Triple integral with center subscript }; enum MNARRAYTYPE { - narySumCSub = 0, // Знак суммы с центральным нижним индексом - narySumCSubSup = 1, // Знак суммы с центральными нижним и верхним индексами - narySum = 2, // Знак суммы без индексов + narySumCSub = 0, // Summation sign with center subscript + narySumCSubSup = 1, // Summation sign with center subscript and superscript + narySum = 2, // Summation sign without indices - narySumRSub = 3, // Знак суммы с правым нижним индексом - narySumRSubSup = 4, // Знак суммы с правыми нижним и верхним индексами + narySumRSub = 3, // Summation sign with right subscript + narySumRSubSup = 4, // Summation sign with right subscript and superscript - naryProdCSub = 5, // Знак произведения с центральным нижним индексом - naryProdCSubSup = 6, // Знак произведения с центральными нижним и верхним индексами - naryProd = 7, // Знак произведения без индексов + naryProdCSub = 5, // Product sign with center subscript + naryProdCSubSup = 6, // Product sign with center subscript and superscript + naryProd = 7, // Product sign without indices - naryProdRSub = 8, // Знак произведения с правым нижним индексом - naryProdRSubSup = 9, // Знак произведения с правыми нижним и верхним индексами + naryProdRSub = 8, // Product sign with right subscript + naryProdRSubSup = 9, // Product sign with right subscript and superscript - naryCoProdCSub = 10, // Знак копроизведения с центральным нижним индексом - naryCoProdCSubSup = 11, // Знак копроизведения с центральными нижним и верхним индексами - naryCoProd = 12, // Знак копроизведения без индексов + naryCoProdCSub = 10, // Coproduct sign with center subscript + naryCoProdCSubSup = 11, // Coproduct sign with center subscript and superscript + naryCoProd = 12, // Coproduct sign without indices - naryCoProdRSub = 13, // Знак копроизведения с правым нижним индексом - naryCoProdRSubSup = 14, // Знак копроизведения с правыми нижним и верхним индексами + naryCoProdRSub = 13, // Coproduct sign with right subscript + naryCoProdRSubSup = 14, // Coproduct sign with right subscript and superscript - naryUnionCSub = 15, // Знак объединения с центральным нижним индексом - naryUnionCSubSup = 16, // Знак объединения с центральными нижним и верхним индексами - naryUnion = 17, // Знак объединения без индексов + naryUnionCSub = 15, // Union sign with center subscript + naryUnionCSubSup = 16, // Union sign with center subscript and superscript + naryUnion = 17, // Union sign without indices - naryUnionRSub = 18, // Знак объединения с правым нижним индексом - naryUnionRSubSup = 19, // Знак объединения с правыми нижним и верхним индексами + naryUnionRSub = 18, // Union sign with right subscript + naryUnionRSubSup = 19, // Union sign with right subscript and superscript - naryIntersectCSub = 20, // Знак пересечения с центральным нижним индексом - naryIntersectCSubSup = 21, // Знак пересечения с центральными нижним и верхним индексами - naryIntersect = 22, // Знак пересечения без индексов + naryIntersectCSub = 20, // Intersection sign with center subscript + naryIntersectCSubSup = 21, // Intersection sign with center subscript and superscript + naryIntersect = 22, // Intersection sign without indices - naryIntersectRSub = 23, // Знак пересечения с правым нижним индексом - naryIntersectRSubSup = 24 // Знак пересечения с правыми нижним и верхним индексами + naryIntersectRSub = 23, // Intersection sign with right subscript + naryIntersectRSubSup = 24 // Intersection sign with right subscript and superscript }; enum MLONGDIVISION { - longdivisionWithResult = 0, // Знак деления столбиком без частного - longdivisionRegular = 1 // Знак деления столбиком с частным + longdivisionWithResult = 0, // Long division sign without quotient + longdivisionRegular = 1 // Long division sign with quotient }; enum MANGLEBRACKETSWITHSEPARATORTYPE @@ -175,25 +175,25 @@ namespace MathEquation enum MEMBELTYPE { - embelDot = 0x02, // точка . - embelDDot = 0x03, // две точки .. - embelDDDot = 0x04, // три точки ... - embelPrime = 0x05, // штрих ' - embelDPrime = 0x06, // два штриха " - embelLPrime = 0x07, // штрих слева ' - embelTilde = 0x08, // волна ~ - embelHat = 0x09, // крышка(шляпа) ^ - embelSlash = 0x0a, // косая черта / - embelRArrow = 0x0b, // стрелка вправо <- - embelLArrow = 0x0c, // стрелка влево -> - embelDArrow = 0x0d, // стрелка в обе стороны <-> - embelRHarpoon = 0x0e, // гарпун вправо - embelLHarpoon = 0x0f, // гарпун влево - embelStrikeout = 0x10, // зачеркивание - embelBar = 0x11, // линия - embelTPrime = 0x12, // три штриха ''' - embelFrown = 0x13, // дуга вверх - embelSmile = 0x14, // дуга вниз + embelDot = 0x02, // dot . + embelDDot = 0x03, // two dots .. + embelDDDot = 0x04, // three dots ... + embelPrime = 0x05, // prime ' + embelDPrime = 0x06, // double prime " + embelLPrime = 0x07, // left prime ' + embelTilde = 0x08, // tilde ~ + embelHat = 0x09, // hat (caret) ^ + embelSlash = 0x0a, // slash / + embelRArrow = 0x0b, // right arrow -> + embelLArrow = 0x0c, // left arrow <- + embelDArrow = 0x0d, // double arrow <-> + embelRHarpoon = 0x0e, // right harpoon + embelLHarpoon = 0x0f, // left harpoon + embelStrikeout = 0x10, // strikeout + embelBar = 0x11, // bar + embelTPrime = 0x12, // triple prime ''' + embelFrown = 0x13, // arc up (frown) + embelSmile = 0x14, // arc down (smile) embelMin = 0x02, embelMax = 0x14 @@ -209,11 +209,11 @@ namespace MathEquation enum MMATRIXHORALIGN { - matrixhoralignLeft = 0x00, // прилегание к левому краю - matrixhoralignCenter = 0x01, // прилегание по центру - matrixhoralignRight = 0x02, // прилегание к правому краю - matrixhoralignEqualSign = 0x03, // прилегание по знаку = - matrixhoralignCommaSign = 0x04 // прилегание по знаку , + matrixhoralignLeft = 0x00, // left alignment + matrixhoralignCenter = 0x01, // center alignment + matrixhoralignRight = 0x02, // right alignment + matrixhoralignEqualSign = 0x03, // alignment by = sign + matrixhoralignCommaSign = 0x04 // alignment by , sign }; enum MMATRIXVERALIGN diff --git a/OOXML/Binary/Presentation/BinaryFileReaderWriter.cpp b/OOXML/Binary/Presentation/BinaryFileReaderWriter.cpp index 6150cf8d4f..64a8bd8ad5 100644 --- a/OOXML/Binary/Presentation/BinaryFileReaderWriter.cpp +++ b/OOXML/Binary/Presentation/BinaryFileReaderWriter.cpp @@ -183,7 +183,7 @@ namespace NSBinPptxRW int CImageManager2::IsDisplayedImage(const std::wstring& strInput) { int nRes = 0; - //шаблон display[N]image.ext + //pattern display[N]image.ext std::wstring sFind1 = L"display"; int nIndex1 = (int)strInput.find(sFind1); if (-1 != nIndex1) @@ -612,8 +612,8 @@ namespace NSBinPptxRW size_t n3 = strFile.find(L"ftp"); size_t n4 = strFile.find(L"https://"); - //если nI сранивать не с 0, то будут проблемы - //потому что в инсталяции мы кладем файлы в /var/www... + //if nI is compared not with 0, there will be problems + //because in installation we put files in /var/www... if (0 == n1 || 0 == n2 || 0 == n3 || 0 == n4) return true; return false; @@ -1270,7 +1270,7 @@ namespace NSBinPptxRW StartMainRecord(NSBinPptxRW::NSMainTables::FontsEmbedded); - // добавим мега шрифт + // add mega font m_pCommon->m_pNativePicker->m_oEmbeddedFonts.CheckString(L".)abcdefghijklmnopqrstuvwxyz"); m_pCommon->m_pNativePicker->m_oEmbeddedFonts.CheckFont(L"Wingdings 3", m_pCommon->m_pNativePicker->m_pFontManager); m_pCommon->m_pNativePicker->m_oEmbeddedFonts.CheckFont(L"Arial", m_pCommon->m_pNativePicker->m_pFontManager); @@ -2130,7 +2130,7 @@ namespace NSBinPptxRW _INT32 sz = (_INT32)GetULong(); if (m_lPos + sz > m_lSize) { - //todooo - переделать + //todo - refactor throw; } return sz; @@ -2378,9 +2378,9 @@ namespace NSBinPptxRW { ++m_nCurrentRelsStack; - //чистить текущий m_pRels хорошо при последовательной записи автофигур в word. - //плохо в случае записи перезентаций, с момента перехода на единственный обьект m_pReader. - //пример: презетации записали несколько Rels, записываем chart, вызывается SetDstContentRels и трутся Rels презентаций + //clearing current m_pRels is good for sequential autoshape writing in word. + //bad for presentation writing, since transition to single m_pReader object. + //example: presentations wrote several Rels, writing chart, SetDstContentRels is called and presentation Rels are erased //if (0 == m_pReader->m_nCurrentRelsStack) //{ // m_pReader->m_pRels->Clear(); diff --git a/OOXML/Binary/Presentation/Converter.cpp b/OOXML/Binary/Presentation/Converter.cpp index 09f6f8732f..cd7372eff8 100644 --- a/OOXML/Binary/Presentation/Converter.cpp +++ b/OOXML/Binary/Presentation/Converter.cpp @@ -63,7 +63,7 @@ namespace PPTX2EditorAdvanced if (slideMaster.IsInit() == false) { - //Вебкасты.pptx - неверно назначены rId + //Webcasts.pptx - rId incorrectly assigned continue; } size_t pPointerSM = (size_t)(slideMaster.operator ->()); @@ -71,19 +71,19 @@ namespace PPTX2EditorAdvanced std::map<size_t, LONG>::const_iterator pSearchSM = pCommon->slideMasters.find(pPointerSM); if (pSearchSM != pCommon->slideMasters.end()) { - // такого быть не должно + // this shouldn't happen continue; } oBinaryWriter.m_pCommon->m_oRels.push_back (NSBinPptxRW::_masterSlideInfo()); NSBinPptxRW::_masterSlideInfo& oMasterInfo = oBinaryWriter.m_pCommon->m_oRels[oBinaryWriter.m_pCommon->m_oRels.size() - 1]; - // записываем mainMaster + // write mainMaster LONG lCountSM = (LONG)_slideMasters.size(); pCommon->slideMasters [pPointerSM] = lCountSM; _slideMasters.push_back(slideMaster); - // проверяем theme + // check theme size_t pPointerTh = (size_t)(slideMaster->theme.operator ->()); std::map<size_t, LONG>::const_iterator pSearchTh = pCommon->themes.find (pPointerTh); if (pSearchTh == pCommon->themes.end()) @@ -104,7 +104,7 @@ namespace PPTX2EditorAdvanced std::wstring rId = slideMaster->sldLayoutIdLst[iLayout].rid.get(); smart_ptr<PPTX::SlideLayout> slideLayout = ((*slideMaster)[rId]).smart_dynamic_cast<PPTX::SlideLayout>(); - // проверяем layout + // check layout size_t pPointerL = (size_t)(slideLayout.operator ->()); if (pPointerL == 0 ) @@ -127,14 +127,14 @@ namespace PPTX2EditorAdvanced } } - // записываем все notesMasters + // write all notesMasters size_t nCountNoteMasters = presentation->notesMasterIdLst.size(); for (size_t nNote = 0; nNote < nCountNoteMasters; ++nNote) { smart_ptr<PPTX::NotesMaster> noteMaster = ((*presentation)[presentation->notesMasterIdLst[nNote].rid.get()]).smart_dynamic_cast<PPTX::NotesMaster>(); if (false == noteMaster.IsInit()) { - // такого быть не должно + // this shouldn't happen continue; } size_t pPointerNM = (size_t)(noteMaster.operator ->()); @@ -142,16 +142,16 @@ namespace PPTX2EditorAdvanced std::map<size_t, LONG>::const_iterator pSearchNM = pCommon->notesMasters.find(pPointerNM); if (pSearchNM != pCommon->notesMasters.end()) { - // такого быть не должно + // this shouldn't happen continue; } - // записываем mainMaster + // write mainMaster LONG lCountNM = (LONG)_notesMasters.size(); pCommon->notesMasters[pPointerNM] = lCountNM; _notesMasters.push_back(noteMaster); - // проверяем theme + // check theme size_t pPointerTh = (size_t)(noteMaster->theme_.operator ->()); LONG nNotesMastersRelsIndex = -1; std::map<size_t, LONG>::const_iterator pSearchTh = pCommon->themes.find(pPointerTh); @@ -167,14 +167,14 @@ namespace PPTX2EditorAdvanced oBinaryWriter.m_pCommon->m_oNotesMasters_Rels.push_back(nNotesMastersRelsIndex); } - // записываем все handoutMasters + // write all handoutMasters size_t nCountHandoutMasters = presentation->handoutMasterIdLst.size(); for (size_t nHandout = 0; nHandout < nCountHandoutMasters; ++nHandout) { smart_ptr<PPTX::HandoutMaster> handoutMaster = ((*presentation)[presentation->handoutMasterIdLst[nHandout].rid.get()]).smart_dynamic_cast<PPTX::HandoutMaster>(); if (false == handoutMaster.IsInit()) { - // такого быть не должно + // this shouldn't happen continue; } size_t pPointerNM = (size_t)(handoutMaster.operator ->()); @@ -182,16 +182,16 @@ namespace PPTX2EditorAdvanced std::map<size_t, LONG>::const_iterator pSearchNM = pCommon->handoutMasters.find(pPointerNM); if (pSearchNM != pCommon->handoutMasters.end()) { - // такого быть не должно + // this shouldn't happen continue; } - // записываем mainMaster + // write mainMaster LONG lCountNM = (LONG)_handoutMasters.size(); pCommon->handoutMasters[pPointerNM] = lCountNM; _handoutMasters.push_back(handoutMaster); - // проверяем theme + // check theme size_t pPointerTh = (size_t)(handoutMaster->theme_.operator ->()); LONG nHandoutMastersRelsIndex = -1; std::map<size_t, LONG>::const_iterator pSearchTh = pCommon->themes.find(pPointerTh); @@ -208,7 +208,7 @@ namespace PPTX2EditorAdvanced oBinaryWriter.m_pCommon->m_oHandoutMasters_Rels.push_back(nHandoutMastersRelsIndex); } - // записываем все слайды + // write all slides for (size_t i = 0; i < presentation->sldIdLst.size(); ++i) { std::wstring rId = presentation->sldIdLst[i].rid.get(); @@ -216,14 +216,14 @@ namespace PPTX2EditorAdvanced if (slide.IsInit() == false) { - continue;// странное ... слайд 38 в FY10_September_Partner_Call.pptx + continue;// strange ... slide 38 in FY10_September_Partner_Call.pptx } size_t pPointerS = (size_t)(slide.operator ->()); std::map<size_t, LONG>::const_iterator pSearchS = pCommon->slides.find(pPointerS); if (pSearchS != pCommon->slides.end()) { - // такого быть не должно + // this shouldn't happen continue; } @@ -231,7 +231,7 @@ namespace PPTX2EditorAdvanced std::map<size_t, LONG>::const_iterator pSearchL = pCommon->layouts.find(pPointerL); if (pSearchL == pCommon->layouts.end()) { - // такого быть не должно + // this shouldn't happen oBinaryWriter.m_pCommon->m_oSlide_Layout_Rels.push_back(0); } else @@ -243,7 +243,7 @@ namespace PPTX2EditorAdvanced pCommon->slides [pPointerS] = lCountS; _slides.push_back(slide); - // проверяем note + // check note size_t pPointerN = (size_t)(slide->Note.operator ->()); LONG nNoteIndex = -1; if (NULL != pPointerN) @@ -284,9 +284,9 @@ namespace PPTX2EditorAdvanced oBinaryWriter.WriteStringUtf8(strPrefix); } _UINT32 nStartPos = oBinaryWriter.GetPosition(); - // нужно записать все в maintables. А кроме главных таблиц ничего и нету. Все остальное лежит в них - // на каждую таблицу - 5 байт (тип и сдвиг) - // число таблиц - заранее известно (сделаем 30. если потом не будет хватать - новая версия формата) + // need to write everything to maintables. Besides main tables there's nothing else. Everything else is in them + // 5 bytes per table (type and offset) + // number of tables is known in advance (let's make 30. if not enough later - new format version) oBinaryWriter.WriteReserved(5 * 30); // Main @@ -411,7 +411,7 @@ namespace PPTX2EditorAdvanced for (size_t i = 0; i < _layouts.size(); ++i) { - if (_layouts[i].IsInit() == false) continue; //непонятки с 42 шаблоном в FY10_September_Partner_Call.pptx + if (_layouts[i].IsInit() == false) continue; //issues with template 42 in FY10_September_Partner_Call.pptx _layouts[i]->toPPTY(&oBinaryWriter); } diff --git a/OOXML/Binary/Presentation/FontCutter.cpp b/OOXML/Binary/Presentation/FontCutter.cpp index 6b199c54b4..0ff06c0931 100644 --- a/OOXML/Binary/Presentation/FontCutter.cpp +++ b/OOXML/Binary/Presentation/FontCutter.cpp @@ -134,7 +134,7 @@ namespace NSFontCutter } bool CEmbeddedFontsManager::GenerateSafearray(USHORT **ppArray, size_t& nCount) { - // цифры нужны всем. остальное - каждый + // digits needed for all. rest - each one CheckString(_T("0123456789")); m_CharMap [(WCHAR)0x00B0] = true; m_CharMap [(WCHAR)0x00B7] = true; diff --git a/OOXML/Binary/Presentation/FontPicker.cpp b/OOXML/Binary/Presentation/FontPicker.cpp index 6fb18ec4b1..56d77cd162 100644 --- a/OOXML/Binary/Presentation/FontPicker.cpp +++ b/OOXML/Binary/Presentation/FontPicker.cpp @@ -75,7 +75,7 @@ namespace NSFontCutter if (pPair != m_mapPicks.end()) return pPair->second; - //подбор перенесен в js + //font matching moved to js m_mapPicks.insert(std::pair<std::wstring,std::wstring>(sFind, sFind)); return sFind; diff --git a/OOXML/Binary/Presentation/PPTXWriter.cpp b/OOXML/Binary/Presentation/PPTXWriter.cpp index 6c9f84e64e..75dfa8e204 100644 --- a/OOXML/Binary/Presentation/PPTXWriter.cpp +++ b/OOXML/Binary/Presentation/PPTXWriter.cpp @@ -180,7 +180,7 @@ namespace NSBinPptxRW CXmlWriter oXmlWriter; - // первым делом определим количество необходимого. если хоть одно из этих чисел - ноль, то ппту не корректный + // first determine the required quantity. if any of these numbers is zero, then pptx is invalid LONG nCountThemes = 0; LONG nCountMasters = 0; LONG nCountLayouts = 0; @@ -218,7 +218,7 @@ namespace NSBinPptxRW return; } - // теперь создадим массивы для рельсов + // now create arrays for rels for (LONG i = 0; i < nCountMasters; ++i) { _slideMasterInfo elm; @@ -249,7 +249,7 @@ namespace NSBinPptxRW } } - // нужно проставить всем шаблонам мастер. + // need to set master for all templates. for (LONG i = 0; i < nCountMasters; ++i) { size_t _countL = m_arSlideMasters_Theme[i].m_arLayouts.size(); @@ -264,7 +264,7 @@ namespace NSBinPptxRW } } - // готово, теперь нужно слайдам проставить шаблоны + // done, now need to set templates for slides pPair = m_mainTables.find(NSBinPptxRW::NSMainTables::SlideRels); if (m_mainTables.end() != pPair) { @@ -278,7 +278,7 @@ namespace NSBinPptxRW if (_at == NSBinPptxRW::g_nodeAttributeEnd) break; - //m_arSlides_Layout[_at] = m_oReader.GetULong(); тут прописан не индекс, а тип - смотри - oBinaryWriter.WriteInt1(0, oBinaryWriter.m_pCommon->m_oSlide_Layout_Rels[i]); + //m_arSlides_Layout[_at] = m_oReader.GetULong(); here it's not index but type - see - oBinaryWriter.WriteInt1(0, oBinaryWriter.m_pCommon->m_oSlide_Layout_Rels[i]); if (index < m_arSlides_Layout.size()) m_arSlides_Layout[index++] = m_oReader.GetULong(); } @@ -296,7 +296,7 @@ namespace NSBinPptxRW if (_at == NSBinPptxRW::g_nodeAttributeEnd) break; - //m_arSlides_Layout[_at] = m_oReader.GetULong(); тут прописан не индекс, а тип - смотри - oBinaryWriter.WriteInt1(0, oBinaryWriter.m_pCommon->m_oSlide_Layout_Rels[i]); + //m_arSlides_Layout[_at] = m_oReader.GetULong(); here it's not index but type - see - oBinaryWriter.WriteInt1(0, oBinaryWriter.m_pCommon->m_oSlide_Layout_Rels[i]); if (index < m_arSlides_Notes.size()) m_arSlides_Notes[index++] = m_oReader.GetULong(); } @@ -335,7 +335,7 @@ namespace NSBinPptxRW } } - // теперь нужно удалить все themes, которые не ведут на мастерслайды + // now need to delete all themes that don't lead to master slides std::vector<LONG> arThemes; std::vector<LONG> arThemesDst; std::vector<bool> arThemesSave; @@ -378,7 +378,7 @@ namespace NSBinPptxRW arThemesDst[i] = lCurrectTheme; ++lCurrectTheme; } - // теперь нужно перебить ссылки + // now need to update references for (LONG i = 0; i < nCountMasters && i < arThemesDst.size(); ++i) { m_arSlideMasters_Theme[i].m_lThemeIndex = arThemesDst[i]; @@ -400,7 +400,7 @@ namespace NSBinPptxRW { if (!arThemesSave[i]) { - // это ненужная тема + // this is an unnecessary theme continue; } @@ -592,7 +592,7 @@ namespace NSBinPptxRW m_oReader.Seek(pPair->second); LONG lCount = m_oReader.GetLong(); - if (lCount > 0 || m_arNotesSlides.size() > 0)//один элемент + if (lCount > 0 || m_arNotesSlides.size() > 0)//one element { OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + L"ppt" + FILE_SEPARATOR_STR + L"notesMasters"; OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + L"_rels"; @@ -1023,7 +1023,7 @@ namespace NSBinPptxRW OOX::CPath pathPresentation = pathFolder / m_oPresentation.DefaultFileName(); - // todooo втащить все как сделано для Custom + // todo implement everything as done for Custom //m_oPresentation.write(pathPresentation, m_oPresentation.DefaultDirectory(), *m_oImageManager.m_pContentTypes); oXmlWriter.ClearNoAttack(); m_oPresentation.toXmlWriter(&oXmlWriter); diff --git a/OOXML/Binary/Presentation/XmlWriter.cpp b/OOXML/Binary/Presentation/XmlWriter.cpp index d398abe007..ac00ac97e2 100644 --- a/OOXML/Binary/Presentation/XmlWriter.cpp +++ b/OOXML/Binary/Presentation/XmlWriter.cpp @@ -521,7 +521,7 @@ void CXmlWriter::EndNode(const std::wstring& name) void CXmlWriter::ReplaceString(std::wstring str1, std::wstring str2) { - // ужасная функция. вызывать ее не надо. не для этого класс писался. .. получше .. но все равно не надо !!! + // terrible function. don't call it. class wasn't written for this. .. a bit better .. but still don't !!! std::wstring sCur = m_oWriter.GetData(); XmlUtils::replace_all(sCur, str1, str2); diff --git a/OOXML/Binary/Presentation/imagemanager.cpp b/OOXML/Binary/Presentation/imagemanager.cpp index 0c175ebdab..bd7f00a453 100644 --- a/OOXML/Binary/Presentation/imagemanager.cpp +++ b/OOXML/Binary/Presentation/imagemanager.cpp @@ -82,8 +82,8 @@ namespace NSShapeImageGen int n3 = (int)strFile.find(L"ftp"); int n4 = (int)strFile.find(L"https"); - //если nI сранивать не с 0, то будут проблемы - //потому что в инсталяции мы кладем файлы в /var/www... + //if nI is compared not with 0, there will be problems + //because in installation we put files in /var/www... if (0 == n1 || 0 == n2 || 0 == n3 || 0 == n4) bIsDownload = true; @@ -145,8 +145,8 @@ namespace NSShapeImageGen int n3 = (int)strFile.find (L"ftp"); int n4 = (int)strFile.find (L"https"); - //если nI сранивать не с 0, то будут проблемы - //потому что в инсталяции мы кладем файлы в /var/www... + //if nI is compared not with 0, there will be problems + //because in installation we put files in /var/www... if (0 == n1 || 0 == n2 || 0 == n3 || 0 == n4) bIsDownload = true; @@ -312,7 +312,7 @@ namespace NSShapeImageGen if (false == result) { - //конвертация неудачная - берем оригинальный файл + //conversion failed - use original file OOX::CPath pathOriginal = strFileSrc; //default is itJPG. set itUnknown to use original extension @@ -392,7 +392,7 @@ namespace NSShapeImageGen std::map<DWORD, CMediaInfo>::iterator pPair = m_mapMediaData.find(dwSum); if (m_mapMediaData.end() == pPair) { - // нужно добавить + // need to add ++m_lNextIDImage; oInfo.m_lID = m_lNextIDImage; @@ -515,7 +515,7 @@ namespace NSShapeImageGen if (pMetafile->LoadFromFile(strFileName.c_str())) { - // пробуем сохранить в svg напрямую из метафайлов + // try to save to svg directly from metafiles std::wstring sInternalSvg = pMetafile->ConvertToSvg(lWidth, lHeight); if (!sInternalSvg.empty()) @@ -527,8 +527,8 @@ namespace NSShapeImageGen return oInfo; } - // не смогли сконвертировать в svg. - // пробуем в png + // couldn't convert to svg. + // try png std::wstring strSaveItem = strSaveItemWE + L".png"; pMetafile->ConvertToRaster(strSaveItem.c_str(), 4 /*CXIMAGE_FORMAT_PNG*/, lWidth, lHeight); diff --git a/OOXML/Binary/Sheets/Common/Common.cpp b/OOXML/Binary/Sheets/Common/Common.cpp index c91b5db701..287ba88dc5 100644 --- a/OOXML/Binary/Sheets/Common/Common.cpp +++ b/OOXML/Binary/Sheets/Common/Common.cpp @@ -75,14 +75,14 @@ namespace SerializeCommon std::string sUnicode((char*)pUtf8, nUtf8Size); RELEASEARRAYOBJECTS(pUtf8); - //Убираем "data:image/jpg;base64," + //Remove "data:image/jpg;base64," int nShift = 0; int nIndex = sUnicode.find("base64,"); if(-1 != nIndex) { nShift = nIndex + 7; } - // Получаем размер файла + // Get file size LONG lFileSize = sUnicode.length () - nShift; INT nDstLength = lFileSize; BYTE *pBuffer = new BYTE [lFileSize]; @@ -114,7 +114,7 @@ namespace SerializeCommon void ReadFileType(const std::wstring& sXMLOptions, BYTE& result, UINT& nCodePage, std::wstring& sDelimiter, BYTE& cSaveFileType, _INT32& Lcid) { result = BinXlsxRW::c_oFileTypes::XLSX; - nCodePage = 46; //default 46 временно CP_UTF8 + nCodePage = 46; //default 46 temporarily CP_UTF8 cSaveFileType = BinXlsxRW::c_oFileTypes::XLSX;// default Lcid = -1;// default diff --git a/OOXML/Binary/Sheets/Reader/BinaryWriterS.cpp b/OOXML/Binary/Sheets/Reader/BinaryWriterS.cpp index 1a224bc9b8..975dc4840f 100644 --- a/OOXML/Binary/Sheets/Reader/BinaryWriterS.cpp +++ b/OOXML/Binary/Sheets/Reader/BinaryWriterS.cpp @@ -1698,7 +1698,7 @@ void BinaryStyleTableWriter::WriteFont(const OOX::Spreadsheet::CFont& font, OOX: //RFont if(font.m_oRFont.IsInit() && font.m_oRFont->m_sVal.IsInit()) { - //подбираем шрифт + //select font std::wstring sFont = oFontProcessor.getFont(font.m_oScheme, font.m_oRFont, font.m_oCharset, font.m_oFamily, theme); m_oBcw.m_oStream.WriteBYTE(c_oSerFontTypes::RFont); @@ -4715,7 +4715,7 @@ void BinaryWorksheetTableWriter::Write(OOX::Spreadsheet::CWorkbook& workbook, st void BinaryWorksheetTableWriter::WriteWorksheets(OOX::Spreadsheet::CWorkbook& workbook, std::map<std::wstring, OOX::Spreadsheet::CWorksheet*>& mapWorksheets) { int nCurPos; - //определяем порядок следования .. излишне с vector + //determine order .. redundant with vector if(workbook.m_oSheets.IsInit()) { for(size_t i = 0; i < workbook.m_oSheets->m_arrItems.size(); ++i) @@ -6086,7 +6086,7 @@ void BinaryWorksheetTableWriter::WriteCell(const OOX::Spreadsheet::CCell& oCell) int nCol = 0; if (oCell.isInitRef() && oCell.getRowCol(nRow, nCol)) { - // Пишем теперь не строку, а 2 числа (чтобы не парсить на JavaScript, т.к. на C++ быстрее парсинг). Ускорение открытия файла. + // Now writing 2 numbers instead of string (to avoid parsing in JavaScript, since C++ parsing is faster). File opening speedup. nCurPos = m_oBcw.WriteItemStart(c_oSerCellTypes::RefRowCol); m_oBcw.m_oStream.WriteLONG(nRow); m_oBcw.m_oStream.WriteLONG(nCol); @@ -6298,7 +6298,7 @@ void BinaryWorksheetTableWriter::WriteOleObjects(const OOX::Spreadsheet::CWorksh { pRId = new OOX::RId( pOleObject->m_oRid->GetValue()); - //ищем физический файл ( rId относительно sheet) + //looking for physical file (rId relative to sheet) smart_ptr<OOX::File> pFile = oWorksheet.Find(pRId.get()); pFileOleObject = pFile.smart_dynamic_cast<OOX::OleObject>(); } @@ -6410,7 +6410,7 @@ void BinaryWorksheetTableWriter::WriteOleObjects(const OOX::Spreadsheet::CWorksh if (!sIdImageFileCache.empty()) { - //ищем физический файл ( rId относительно vml_drawing) + //looking for physical file (rId relative to vml_drawing) smart_ptr<OOX::File> pFile = pVmlDrawing->Find(sIdImageFileCache); if (pFile.IsInit() && (OOX::FileTypes::Image == pFile->type())) @@ -6450,7 +6450,7 @@ void BinaryWorksheetTableWriter::WriteOleObjects(const OOX::Spreadsheet::CWorksh olePic->oleObject->m_OleObjectFile->set_filename_cache(pathImage); } - olePic->blipFill.blip->embed = new OOX::RId(sIdImageFileCache); //ваще то тут не важно что - приоритет у того что ниже.. + olePic->blipFill.blip->embed = new OOX::RId(sIdImageFileCache); //actually doesn't matter what's here - priority goes to what's below.. olePic->blipFill.blip->oleFilepathImage = pathImage.GetPath(); } @@ -6486,7 +6486,7 @@ void BinaryWorksheetTableWriter::WriteControls(const OOX::Spreadsheet::CWorkshee if (pControl->m_oRid.IsInit()) { - pFileControl = oWorksheet.Find(OOX::RId(pControl->m_oRid->GetValue()));// rId относительно sheet + pFileControl = oWorksheet.Find(OOX::RId(pControl->m_oRid->GetValue()));// rId relative to sheet } if (false == pFileControl.IsInit()) continue; @@ -6939,7 +6939,7 @@ void BinaryWorksheetTableWriter::WriteDrawings(const OOX::Spreadsheet::CWorkshee OOX::WritingElement* pElemShape = pShape->m_arrItems[j]; if(OOX::et_v_ClientData == pElemShape->getType()) { - //преобразуем ClientData в CellAnchor + //convert ClientData to CellAnchor OOX::Vml::CClientData* pClientData = static_cast<OOX::Vml::CClientData*>(pElemShape); if (pClientData->m_oObjectType.IsInit() && pClientData->m_oObjectType->GetValue() == SimpleTypes::Vml::vmlclientdataobjecttypeNote) @@ -7052,7 +7052,7 @@ void BinaryWorksheetTableWriter::WriteDrawing(const OOX::Spreadsheet::CWorksheet if (pCellAnchor->m_bShapeOle && NULL != pOleObject) { - //ищем физический файл, потому что rId относительно sheet.xml, а SetRelsPath(pVmlDrawing + //looking for physical file, because rId is relative to sheet.xml, and SetRelsPath(pVmlDrawing smart_ptr<OOX::File> pFile = oWorksheet.Find(OOX::RId(pOleObject->m_oRid->GetValue())); pOleObject->m_OleObjectFile = pFile.smart_dynamic_cast<OOX::OleObject>(); @@ -7368,7 +7368,7 @@ void BinaryWorksheetTableWriter::WriteComments(std::map<std::wstring, OOX::Sprea getSavedComment(oComment, aCommentDatas); - //записываем тот обьект, который был в бинарнике, подменяем только текст, который мог быть отредактирован в Excel + //write the object that was in binary, only replace text that could have been edited in Excel nCurPos = m_oBcw.WriteItemStart(c_oSerWorksheetsTypes::Comment); WriteComment(oComment, aCommentDatas); @@ -8166,7 +8166,7 @@ void BinaryWorksheetTableWriter::WriteConditionalFormattingRule(const OOX::Sprea void BinaryWorksheetTableWriter::WriteColorScale(const OOX::Spreadsheet::CColorScale& oColorScale) { - // ToDo более правильно заделать виртуальную функцию, которая будет писать без привидения типов + // ToDo better to implement virtual function that writes without type casting for (size_t i = 0, length = oColorScale.m_arrValues.size(); i < length; ++i) { @@ -9080,7 +9080,7 @@ NSBinPptxRW::CDrawingConverter* pOfficeDrawingConverter, const std::wstring& sXM _UINT32 result = 0; OOX::CPath pathDst(sFileDst); -//создаем папку для media +//create media folder std::wstring mediaDir = pathDst.GetDirectory() + L"media"; NSDirectory::CreateDirectory(mediaDir); @@ -9189,7 +9189,7 @@ NSBinPptxRW::CDrawingConverter* pOfficeDrawingConverter, const std::wstring& sXM if (BinXlsxRW::c_oFileTypes::JSON == saveFileType) { -//todo 46 временно CP_UTF8 +//todo 46 temporarily CP_UTF8 CSVWriter oCSVWriter; oCSVWriter.Xlsx2Csv(sFileDst, *pXlsx, 46, std::wstring(L","), Lcid, true); @@ -9380,7 +9380,7 @@ void BinaryFileWriter::WriteContent(OOX::Document *pDocument, NSFontCutter::CEmb oBinaryOtherTableWriter.Write(); WriteTableEnd(nCurPos); - //Customs from Workbook (todooo - другие) + //Customs from Workbook (todo - others) nCurPos = WriteTableStart(c_oSerTableTypes::Customs); BinaryCustomsTableWriter oBinaryCustomsTableWriter(m_oBcw->m_oStream); oBinaryCustomsTableWriter.Write(pXlsx->m_pWorkbook); @@ -9407,7 +9407,7 @@ void BinaryFileWriter::WriteMainTableStart(NSBinPptxRW::CBinaryFileWriter &oBuff m_nRealTableCount = 0; m_nMainTableStart = m_oBcw->m_oStream.GetPosition(); - //вычисляем с какой позиции можно писать таблицы + //calculate from which position we can write tables m_nLastFilePos = m_nMainTableStart + GetMainTableSize(); //Write mtLen m_oBcw->m_oStream.WriteBYTE(0); @@ -9418,7 +9418,7 @@ int BinaryFileWriter::GetMainTableSize() } void BinaryFileWriter::WriteMainTableEnd() { -//Количество таблиц +//Number of tables m_oBcw->m_oStream.SetPosition(m_nMainTableStart); m_oBcw->m_oStream.WriteBYTE(m_nRealTableCount); @@ -9435,18 +9435,18 @@ int BinaryFileWriter::WriteTableStart(BYTE type, int nStartPos) m_oBcw->m_oStream.WriteLONG(m_nLastFilePos + m_nLastFilePosOffset); //Write table - //Запоминаем позицию в MainTable + //Save position in MainTable int nCurPos = m_oBcw->m_oStream.GetPosition(); - //Seek в свободную область + //Seek to free area m_oBcw->m_oStream.SetPosition(m_nLastFilePos); return nCurPos; } void BinaryFileWriter::WriteTableEnd(int nCurPos) { - //сдвигаем позицию куда можно следующую таблицу + //shift position where next table can be written m_nLastFilePos = m_oBcw->m_oStream.GetPosition(); m_nRealTableCount++; - //Seek вобратно в MainTable + //Seek back to MainTable m_oBcw->m_oStream.SetPosition(nCurPos); } diff --git a/OOXML/Binary/Sheets/Reader/CSVReader.cpp b/OOXML/Binary/Sheets/Reader/CSVReader.cpp index 9a29b39c4e..d136281ca0 100644 --- a/OOXML/Binary/Sheets/Reader/CSVReader.cpp +++ b/OOXML/Binary/Sheets/Reader/CSVReader.cpp @@ -193,14 +193,14 @@ int CSVReader::Impl::AddCell(std::wstring &sText, INT nStartCell, std::stack<INT } size_t length = sText.length(); -// Пустую не пишем +// Don't write empty if ((0 == length) || (sText[0] == L'\0')) return result; OOX::Spreadsheet::CCell *pCell = new OOX::Spreadsheet::CCell(); pCell->m_oType.Init(); - pCell->m_oCacheValue = sText; // как есть + pCell->m_oCacheValue = sText; // as is pCell->setRowCol(nRow, nCol); result = cellFormatController_->ProcessCellType(pCell, sText, bIsWrap); @@ -214,9 +214,9 @@ _UINT32 CSVReader::Impl::Read(const std::wstring &sFileName, OOX::Spreadsheet::C NSFile::CFileBinary oFile; if (false == oFile.OpenFile(sFileName)) return AVS_FILEUTILS_ERROR_CONVERT; //----------------------------------------------------------------------------------- - // Создадим Workbook + // Create Workbook oXlsx.CreateWorkbook(); - // Создадим стили + // Create styles oXlsx.CreateStyles(); cellFormatController_ = std::make_shared<CellFormatController>(oXlsx.m_pStyles, lcid); @@ -278,7 +278,7 @@ _UINT32 CSVReader::Impl::Read(const std::wstring &sFileName, OOX::Spreadsheet::C size_t nSize = sFileDataW.length(); if (nSize < 1 && nInputBufferSize > 0) - {//для синхронности вывода превью и нормального результата + {//for synchronization of preview and normal result output const NSUnicodeConverter::EncodindId& oEncodindId = NSUnicodeConverter::Encodings[nCodePage]; NSUnicodeConverter::CUnicodeConverter oUnicodeConverter; @@ -391,7 +391,7 @@ _UINT32 CSVReader::Impl::Read(const std::wstring &sFileName, OOX::Spreadsheet::C { if (bInQuote) { - // Добавим Wrap + // Add Wrap bIsWrap = true; continue; } @@ -408,7 +408,7 @@ _UINT32 CSVReader::Impl::Read(const std::wstring &sFileName, OOX::Spreadsheet::C if (wcNewLineR == wcCurrent && nIndex + 1 != nSize && wcNewLineN == pTemp[nIndex + 1]) { - // На комбинацию \r\n должен быть только 1 перенос + // For \r\n combination there should be only 1 newline ++nIndex; } @@ -439,7 +439,7 @@ _UINT32 CSVReader::Impl::Read(const std::wstring &sFileName, OOX::Spreadsheet::C if (pWorksheet->m_oSheetData->m_arrItems.size() > 1048576) { bMsLimit = true; - break; // ограниечние мс + break; // MS limit } } else if (wcQuote == wcCurrent) @@ -447,16 +447,16 @@ _UINT32 CSVReader::Impl::Read(const std::wstring &sFileName, OOX::Spreadsheet::C // Quote if (false == bInQuote && nStartCell == nIndex && nIndex + 1 != nSize) { - // Начало новой ячейки (только если мы сразу после разделителя и не в конце файла) + // Start of new cell (only if we're right after delimiter and not at end of file) bInQuote = !bInQuote; nStartCell = nIndex + 1; } else if (bInQuote) { - // Нужно удалить кавычку ограничитель + // Need to remove delimiter quote oDeleteChars.push(nIndex); - // Если следующий символ кавычка, то мы не закончили ограничитель строки (1997,Ford,E350,"Super, ""luxurious"" truck") + // If next character is quote, then we haven't finished string delimiter (1997,Ford,E350,"Super, ""luxurious"" truck") if (nIndex + 1 != nSize && wcQuote == pTemp[nIndex + 1]) ++nIndex; else diff --git a/OOXML/Binary/Sheets/Reader/CellFormatController/CellFormatController.cpp b/OOXML/Binary/Sheets/Reader/CellFormatController/CellFormatController.cpp index a7a54eb01e..6a3fc17012 100644 --- a/OOXML/Binary/Sheets/Reader/CellFormatController/CellFormatController.cpp +++ b/OOXML/Binary/Sheets/Reader/CellFormatController/CellFormatController.cpp @@ -98,7 +98,7 @@ std::vector<std::map<std::wstring, std::wstring>> FormulaController::mapReplacem CellFormatController::CellFormatController(OOX::Spreadsheet::CStyles *styles, _INT32 lcid): m_pStyles{styles}, lcid_{lcid}, dateReader_{lcid_} { - // Добавим стили для wrap-а + // Add styles for wrap m_pStyles->m_oCellXfs.Init(); m_pStyles->m_oCellXfs->m_oCount.Init(); m_pStyles->m_oCellXfs->m_oCount->SetValue(2); @@ -135,7 +135,7 @@ int CellFormatController::ProcessCellType(OOX::Spreadsheet::CCell *pCell, const int result = 0; // ok const auto maxCustomWidthRow = 40; pCell_ = pCell; - /// формат для булева значения в верхнем регистре + /// format for boolean value in upper case if(value == L"true" || value == L"false") { pCell_->m_oType->SetValue(SimpleTypes::Spreadsheet::celltypeInlineStr); @@ -394,7 +394,7 @@ void CellFormatController::addCustomColWidth(OOX::Spreadsheet::CCell *pCell, dou { if(m_pWorksheet == nullptr || pCell == nullptr || !pCell->m_oCol.IsInit()) return; - //не сужаем колонки, только расширяем + // don't shrink columns, only expand if(m_pWorksheet->m_oSheetFormatPr.IsInit() && m_pWorksheet->m_oSheetFormatPr->m_oBaseColWidth.IsInit() && m_pWorksheet->m_oSheetFormatPr->m_oBaseColWidth.get() > width) return; diff --git a/OOXML/Binary/Sheets/Reader/CellFormatController/CellFormatController.h b/OOXML/Binary/Sheets/Reader/CellFormatController/CellFormatController.h index fab4c228f4..6a328003f4 100644 --- a/OOXML/Binary/Sheets/Reader/CellFormatController/CellFormatController.h +++ b/OOXML/Binary/Sheets/Reader/CellFormatController/CellFormatController.h @@ -39,49 +39,49 @@ #include "DigitReader.h" -/// @brief класс определяющий и корректирующий тип данных, помещаемых в ячейки таблицы +/// @brief class that determines and corrects data type for table cell values class CellFormatController { public: - /// @brief конструктор - /// @param styles стили из таблицы + /// @brief constructor + /// @param styles styles from the table CellFormatController(OOX::Spreadsheet::CStyles *styles, _INT32 lcid); - /// @brief обрабатывает вставляемые в ячейку таблицы данные, переводя их в нужный тип, и заполняет ими ячейку - /// @param pCell указатель на ячейку - /// @param value вставляемые в ячейку данные в строковом типе + /// @brief processes data inserted into table cell, converting to required type, and fills the cell + /// @param pCell pointer to cell + /// @param value data to insert in string format int ProcessCellType(OOX::Spreadsheet::CCell *pCell, const std::wstring &value, bool bIsWrap = false); - /// @brief указатель на лист документа + /// @brief pointer to document worksheet OOX::Spreadsheet::CWorksheet *m_pWorksheet = nullptr; private: bool isFormula(const std::wstring& formula); std::wstring ConvertFormulaArguments(const std::wstring& formula); - /// @brief создание стиля для указанного формата - /// @param format формат значения + /// @brief create style for specified format + /// @param format value format void createFormatStyle(const std::wstring &format); - /// @brief Добавление кастомной ширины столбца для ячейки - /// @param pCell ячейка для которой будет добавлена ширина - /// @param width значение ширины которое будет установлено для столбца, если оно больше текущего + /// @brief add custom column width for cell + /// @param pCell cell for which width will be added + /// @param width width value to set for column if it's greater than current void addCustomColWidth(OOX::Spreadsheet::CCell *pCell, double width); - /// @brief указатель на ячейку с которой ведется работа + /// @brief pointer to cell being worked with OOX::Spreadsheet::CCell *pCell_; - /// @brief map с форматами данных + /// @brief map with data formats std::map<std::wstring, unsigned int> mapDataNumber_; - /// @brief указатель на стили документа + /// @brief pointer to document styles OOX::Spreadsheet::CStyles *m_pStyles; - /// @brief указатель на полученное строковое значение + /// @brief pointer to received string value const std::wstring *value_; - /// @brief идентификатор локали + /// @brief locale identifier _INT32 lcid_; DigitReader digitReader_; diff --git a/OOXML/Binary/Sheets/Reader/CellFormatController/CurrencyReader.cpp b/OOXML/Binary/Sheets/Reader/CellFormatController/CurrencyReader.cpp index ac62a5a134..c5f36c144d 100644 --- a/OOXML/Binary/Sheets/Reader/CellFormatController/CurrencyReader.cpp +++ b/OOXML/Binary/Sheets/Reader/CellFormatController/CurrencyReader.cpp @@ -37,68 +37,68 @@ const std::wstring CurrencyFormatTemplate = L"#,##0.00"; const std::set<std::wstring> CurrencySymbols = { - L"\u0024", // Доллар США - L"\u20AC", // Евро - L"\u00A5", // Японская иена - L"\u00A3", // Фунт стерлингов Великобритании - L"\u0024\u0061", // Австралийский доллар - L"\u0024\u0063", // Канадский доллар - L"\u0046\u0072\u002E", // Швейцарский франк - L"\u20BD", // Российский рубль - L"\u20B8", // Казахский тенге - L"\u5143", // Китайский юань - L"\u20B1", // Филиппинское песо - L"\u20B9", // Индийская рупия - L"\u20AA", // Израильский новый шекель - L"\u20A7", // Испанская песета - L"\u0631.\u0633.", //Саудовский риал + L"\u0024", // US Dollar + L"\u20AC", // Euro + L"\u00A5", // Japanese Yen + L"\u00A3", // British Pound Sterling + L"\u0024\u0061", // Australian Dollar + L"\u0024\u0063", // Canadian Dollar + L"\u0046\u0072\u002E", // Swiss Franc + L"\u20BD", // Russian Ruble + L"\u20B8", // Kazakh Tenge + L"\u5143", // Chinese Yuan + L"\u20B1", // Philippine Peso + L"\u20B9", // Indian Rupee + L"\u20AA", // Israeli New Shekel + L"\u20A7", // Spanish Peseta + L"\u0631.\u0633.", // Saudi Riyal L"kr.", L"Ft", - L"\u20A9", // Корейская вона - L"\u007a\u0142",// Польский злотый + L"\u20A9", // Korean Won + L"\u007a\u0142",// Polish Zloty L"R\u0024", L"kr", - L"\u20BA", //Турецкая лира - L"\u20B4",//Украинская гривна - L"\u20AB", //Вьетнамский донг - L"\u20BC", //Азербайджанский манат - L"\u20AE", //Монгольский тугрик - L"\u043B\u0432.", //Болгарский лев + L"\u20BA", // Turkish Lira + L"\u20B4",// Ukrainian Hryvnia + L"\u20AB", // Vietnamese Dong + L"\u20BC", // Azerbaijani Manat + L"\u20AE", // Mongolian Tugrik + L"\u043B\u0432.", // Bulgarian Lev L"NT\u0024", - L"\u004B\u010D", //Чешская крона + L"\u004B\u010D", // Czech Koruna L"Rp", - L"\u062F.\u0639.‏", //Иракский динар + L"\u062F.\u0639.‏", // Iraqi Dinar L"L", - L"\u062C.\u0645.‏", // Египетский фунт + L"\u062C.\u0645.‏", // Egyptian Pound L"HK\u0024", - L"\u062F.\u0644.‏", // Ливийский динар + L"\u062F.\u0644.‏", // Libyan Dinar L"Q", L"KM", - L"\u062F.\u062C.‏", // Алжирский динар - L"\u20A1", //Колон Сальвадора и Коста-рики + L"\u062F.\u062C.‏", // Algerian Dinar + L"\u20A1", // El Salvadoran and Costa Rican Colon L"B/.", - L"\u062F.\u062A.‏", //Тунисский динар + L"\u062F.\u062A.‏", // Tunisian Dinar L"R", L"EC\u0024", - L"\u0631.\u0639.‏", //Оманский риал + L"\u0631.\u0639.‏", // Omani Rial L"Bs.S", - L"\u0631.\u064A.‏", //Йеменский риал + L"\u0631.\u064A.‏", // Yemeni Rial L"FC", L"RSD", - L"\u0434\u0438\u043D.", //сирийский динар - L"\u062F.\u0627.‏", //Дирхам ОАЭ + L"\u0434\u0438\u043D.", // Syrian Dinar + L"\u062F.\u0627.‏", // UAE Dirham L"FCFA", - L"\u0644.\u0644.‏", //Ливанский фунт + L"\u0644.\u0644.‏", // Lebanese Pound L"US\u0024", L"CFA", - L"\u062F.\u0643.‏", //Кувейтский динар - L"\u20B1", // Филлипинское песо - L"\u062F.\u0625.‏", //Иорданский динар + L"\u062F.\u0643.‏", // Kuwaiti Dinar + L"\u20B1", // Philippine Peso + L"\u062F.\u0625.‏", // Jordanian Dinar L"DH", - L"\u062F.\u0628.‏", //Бахрейнский динар - L"\u20B2", //Парагвайский гуарани + L"\u062F.\u0628.‏", // Bahraini Dinar + L"\u20B2", // Paraguayan Guarani L"G", - L"\u0631.\u0648.‏", //Катарский риал + L"\u0631.\u0648.‏", // Qatari Riyal L"Bs", L"RM", L"C\u0024", diff --git a/OOXML/Binary/Sheets/Reader/CellFormatController/CurrencyReader.h b/OOXML/Binary/Sheets/Reader/CellFormatController/CurrencyReader.h index da65b25849..5898b6c08e 100644 --- a/OOXML/Binary/Sheets/Reader/CellFormatController/CurrencyReader.h +++ b/OOXML/Binary/Sheets/Reader/CellFormatController/CurrencyReader.h @@ -40,15 +40,15 @@ class CurrencyReader { public: - /// @brief проверка постфикса на валидность валюте - /// @param postfix проверяющийся на валидность валюте - /// @return true если постфикс валютный иначе false + /// @brief check postfix for currency validity + /// @param postfix being checked for currency validity + /// @return true if postfix is currency otherwise false bool CheckPostfix(const std::wstring &postfix); - /// @brief получение даты в виде числа в формате excel - /// @param inputFormat формат в котором представлено число валюты - /// @param currency валюта формат которой будет проверен - /// @return формат числа с использованием переданной валюты в строковом виде + /// @brief get currency format in excel format + /// @param inputFormat format in which currency number is presented + /// @param currency currency whose format will be checked + /// @return number format with passed currency in string form std::wstring GetCurrencyFormat(const std::wstring &inputFormat,const std::wstring ¤cy); }; diff --git a/OOXML/Binary/Sheets/Reader/CellFormatController/DateReader.cpp b/OOXML/Binary/Sheets/Reader/CellFormatController/DateReader.cpp index 8adfca2b9e..4dbcbfe429 100644 --- a/OOXML/Binary/Sheets/Reader/CellFormatController/DateReader.cpp +++ b/OOXML/Binary/Sheets/Reader/CellFormatController/DateReader.cpp @@ -56,7 +56,7 @@ bool DateReader::GetDigitalDate(const std::wstring &date, double &result, bool & cellCounter_++; return false; } - ///если не было найдено ни одной даты в n ячейках - перестаем их искать + ///if no date was found in n cells - stop searching for them if(!dateFound_ && cellCounter_ > NonDatecellLimit) return false; if(!parseIsoDate(date,time)) @@ -73,10 +73,10 @@ bool DateReader::GetDigitalDate(const std::wstring &date, double &result, bool & Hastime = true; } - //дата без времени + //date without time if(time.tm_year > 0 && time.tm_hour == 0 && time.tm_min == 0 && time.tm_sec == 0) { - //определяем стандартная ли дата + //determine if date is standard if(time.tm_year >= 70) result = getStandartDate(time); else @@ -86,7 +86,7 @@ bool DateReader::GetDigitalDate(const std::wstring &date, double &result, bool & dateFound_ = true; return true; } - //время без даты + //time without date else if(time.tm_year == 0 && time.tm_mday == 0 && time.tm_mon == 0) { result = getStandartTime(time); @@ -95,7 +95,7 @@ bool DateReader::GetDigitalDate(const std::wstring &date, double &result, bool & dateFound_ = true; return true; } - else //дата и время + else //date and time { if(time.tm_year >= 70) @@ -215,12 +215,12 @@ bool DateReader::parseLocalDate(const std::wstring &date, tm &result, bool &Hasd ParsingElem parsingNow = ParsingElem::none; auto cutteddateStr = spaceCut(date); - //разделитель времени отличается только в нескольких локалях + //time separator differs only in a few locales wchar_t timeSeparator = L':'; if(lcid_ == 1035 || lcid_ == 11) timeSeparator = L'.'; - //флаги собранных частей даты + //flags for collected date parts bool bSec = false; bool bMin = false; bool bHour = false; @@ -232,7 +232,7 @@ bool DateReader::parseLocalDate(const std::wstring &date, tm &result, bool &Hasd DateElemTypes PrevType = DateElemTypes::none; std::vector<wchar_t> StringBuf; - //посимвольно парсим дату + //parse date character by character for(auto i = 0; i < cutteddateStr.length(); i++) { auto charElement = cutteddateStr.at(i); @@ -245,7 +245,7 @@ bool DateReader::parseLocalDate(const std::wstring &date, tm &result, bool &Hasd elementType = DateElemTypes::delimeter; else elementType = DateElemTypes::letter; - if(CurrentElementType == DateElemTypes::none)//первый проход + if(CurrentElementType == DateElemTypes::none)// first pass { StringBuf.push_back(charElement); } @@ -253,7 +253,7 @@ bool DateReader::parseLocalDate(const std::wstring &date, tm &result, bool &Hasd { if(CurrentElementType == elementType) { - //проверяем валидность размеров элементов даты + // checking validity of date element sizes if(elementType == DateElemTypes::digit && StringBuf.size() < 4) { StringBuf.push_back(charElement); @@ -276,7 +276,7 @@ bool DateReader::parseLocalDate(const std::wstring &date, tm &result, bool &Hasd { if(timeSeparator != locInf.DateSeparator[0]) { - //парсим часть даты + // parsing date part _INT32 datePart; if(!tryGetInt(StringBuf, datePart)) { @@ -297,7 +297,7 @@ bool DateReader::parseLocalDate(const std::wstring &date, tm &result, bool &Hasd } } - ///todo вариант когда и дата и время разделяются "." + ///todo case when both date and time are separated by "." } if(CurrentElementType == DateElemTypes::letter && elementType == DateElemTypes::delimeter) { @@ -312,7 +312,7 @@ bool DateReader::parseLocalDate(const std::wstring &date, tm &result, bool &Hasd } else if((CurrentElementType == DateElemTypes::delimeter || CurrentElementType == DateElemTypes::space) && elementType != DateElemTypes::space) { - //просто добавляем в буфер то что было за разделителем + // simply add to buffer what was after the delimiter StringBuf.push_back(charElement); } else if(elementType== DateElemTypes::space) @@ -341,7 +341,7 @@ bool DateReader::parseLocalDate(const std::wstring &date, tm &result, bool &Hasd } if(CurrentElementType == DateElemTypes::letter) { - // если это не am pm то в дате может быть буквенным только имя месяца + // if this is not am pm then only month name can be alphabetic in a date if(!parseAmPm(StringBuf, result)) { if(parseMonthName(StringBuf, result)) @@ -354,10 +354,10 @@ bool DateReader::parseLocalDate(const std::wstring &date, tm &result, bool &Hasd } else if(elementType == DateElemTypes::letter) { - //невалидная дата + // invalid date bError = true; } - //анализируем собранный элемент + // analyzing the collected element PrevType = CurrentElementType; } } @@ -366,7 +366,7 @@ bool DateReader::parseLocalDate(const std::wstring &date, tm &result, bool &Hasd if(bError) return false; } - //анализируем последний элемент в буфере + // analyzing the last element in the buffer if(parsingNow == ParsingElem::date) { if(CurrentElementType == DateElemTypes::digit) @@ -405,7 +405,7 @@ bool DateReader::parseLocalDate(const std::wstring &date, tm &result, bool &Hasd StringBuf.clear(); } } - //нормализуем год если он есть + // normalize the year if it exists if(Hasdate) { result.tm_mon--; @@ -419,7 +419,7 @@ bool DateReader::parseLocalDate(const std::wstring &date, tm &result, bool &Hasd bool DateReader::parseIsoDate(const std::wstring &date, tm &result) { std::wregex iso_regex( - LR"(^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$)" // таймзона: Z или ±ч:мин + LR"(^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$)" // timezone: Z or ±h:min ); std::wsmatch match; @@ -461,11 +461,11 @@ bool DateReader::parseIsoDate(const std::wstring &date, tm &result) } _INT32 DateReader::getStandartDate(tm date) { - // обнуление времени, чтобы оно не влияло на дату + // zeroing time so it doesn't affect the date date.tm_hour = 0; date.tm_min = 0; date.tm_sec = 0; - // Преобразование даты в формат excel + // Converting date to Excel format auto timeT = mktime(&date); auto tp = std::chrono::system_clock::from_time_t(timeT); auto excelTime = std::chrono::duration_cast<std::chrono::seconds>(tp.time_since_epoch()).count(); @@ -483,7 +483,7 @@ double DateReader::getStandartTime(tm date) } -// Функция для определения високосного года +// Function to determine leap year bool isLeapYear(int year) { return (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0); } @@ -494,19 +494,19 @@ _INT32 DateReader::getNonUnixDate(tm date) long days = 1; - // Добавляем количество дней за предыдущие годы + // Add the number of days for previous years for (int year = 1900; year < date.tm_year + 1900; ++year) { days += isLeapYear(year) ? 366 : 365; } - // Добавляем количество дней до начала текущего года + // Add the number of days until the start of current year for (int month = 0; month < date.tm_mon; ++month) { days += daysInMonth[month]; if (month == 1 && isLeapYear(date.tm_year + 1900)) - days++; // добавляем 1 день для февраля в високосном году + days++; // add 1 day for February in leap year } - // Добавляем количество дней текущего месяца + // Add the number of days of the current month days += date.tm_mday; return days; @@ -514,7 +514,7 @@ _INT32 DateReader::getNonUnixDate(tm date) _INT32 DateReader::normalizeYear(_INT32 year) { - // год полностью + // full year if(year > 1900) return year - 1900; else if (year < 69) diff --git a/OOXML/Binary/Sheets/Reader/CellFormatController/DateReader.h b/OOXML/Binary/Sheets/Reader/CellFormatController/DateReader.h index f1f3376051..0e11d789aa 100644 --- a/OOXML/Binary/Sheets/Reader/CellFormatController/DateReader.h +++ b/OOXML/Binary/Sheets/Reader/CellFormatController/DateReader.h @@ -41,65 +41,65 @@ class DateReader { public: - /// @brief создание считывателя с указанным id локали - /// @param lcid идентификатор локали в зависимости от которой будет читаться дата + /// @brief create reader with specified locale id + /// @param lcid locale identifier that determines how date will be read DateReader(_INT32 lcid = 9); - /// @brief получение даты в виде числа в формате excel - /// @param date дата в строковом формате - /// @param result результат в формате excel - /// @param return true в случае успешной конвертации, иначе false + /// @brief get date as number in excel format + /// @param date date in string format + /// @param result result in excel format + /// @param return true if conversion successful, otherwise false bool GetDigitalDate(const std::wstring &date, double &result, bool &Hasdate, bool &Hastime); - /// @brief парсинг стандартизированной даты - /// @param date дата в строковом формате - /// @param result в формате tm - /// @param return true в случае успешной конвертации, иначе false + /// @brief parse standardized date + /// @param date date in string format + /// @param result in tm format + /// @param return true if conversion successful, otherwise false bool parseIsoDate(const std::wstring &date, tm &result); - /// @brief парсинг строковой даты с известной локалью - /// @param date дата в строковом формате - /// @param result в формате tm - /// @param return true в случае успешной конвертации, иначе false + /// @brief parse string date with known locale + /// @param date date in string format + /// @param result in tm format + /// @param return true if conversion successful, otherwise false bool parseLocalDate(const std::wstring &date, tm &result, bool &Hasdate, bool &Hastime); private: - /// @brief получение даты в виде числа в формате excel из дат позднее 1900 года - /// @param datetime структура с датой - /// @return дата в формате excel + /// @brief get date as number in excel format from dates after 1900 + /// @param datetime structure with date + /// @return date in excel format _INT32 getStandartDate(tm date); - /// @brief получение времени в виде десятичной части double - /// @param datetime структура с датой и временем - /// @return время в виде десятичной части double числа + /// @brief get time as decimal part of double + /// @param datetime structure with date and time + /// @return time as decimal part of double number double getStandartTime(tm date); - /// @brief получение даты в виде числа в формате excel из дат от 1900 года и до 1970 - /// @param datetime структура с датой - /// @return дата в формате excel + /// @brief get date as number in excel format from dates between 1900 and 1970 + /// @param datetime structure with date + /// @return date in excel format _INT32 getNonUnixDate(tm date); - /// @brief нормализация года под стандарт excel - /// @param year год либо в формате yyyy - 2021 либо в формате yy - 21 - /// @return количество лет прошедших с 1900 года + /// @brief normalize year for excel standard + /// @param year either in yyyy - 2021 or yy - 21 format + /// @return number of years since 1900 _INT32 normalizeYear(_INT32 year); - /// @brief парсинг am и pm частей времени - /// @param буфер с символами - /// @param date структура с датой - /// @return true если строка является частью am или pm + /// @brief parse am and pm parts of time + /// @param stringBuf buffer with characters + /// @param date structure with date + /// @return true if string is am or pm part bool parseAmPm(std::vector<wchar_t> &stringBuf, tm &date); - /// @brief парсинг имени месяца и внесение его в дату - /// @param буфер с символами - /// @param date структура с датой - /// @return true если строка является именем месяца + /// @brief parse month name and add it to date + /// @param stringBuf buffer with characters + /// @param date structure with date + /// @return true if string is month name bool parseMonthName(std::vector<wchar_t> &stringBuf, tm &date); _INT32 lcid_ = 9; - /// @brief счетчик ячеек + /// @brief cell counter _UINT16 cellCounter_ = 0; bool dateFound_ = false; diff --git a/OOXML/Binary/Sheets/Reader/CellFormatController/DigitReader.cpp b/OOXML/Binary/Sheets/Reader/CellFormatController/DigitReader.cpp index deb6822b79..34ef86d179 100644 --- a/OOXML/Binary/Sheets/Reader/CellFormatController/DigitReader.cpp +++ b/OOXML/Binary/Sheets/Reader/CellFormatController/DigitReader.cpp @@ -104,7 +104,7 @@ bool DigitReader::ReadDigit(const std::wstring &value, std::wstring &digit, std: { digit = std::to_wstring(dValue); - // Удаление лишних нулей после запятой + // Remove trailing zeros after decimal point size_t dotPos = digit.find('.'); if (dotPos != std::wstring::npos) { @@ -193,7 +193,7 @@ bool DigitReader::ReadScientific(const std::wstring &value, std::wstring &digit, _INT32 MainPartSize = value.find(L"E"); if(MainPartSize < 1) MainPartSize = value.find(L"e"); - ss.precision(MainPartSize); // Установить точность + ss.precision(MainPartSize); // Set precision ss.setf(std::ios::scientific); ss << doubleVal; digit = ss.str(); diff --git a/OOXML/Binary/Sheets/Reader/CellFormatController/DigitReader.h b/OOXML/Binary/Sheets/Reader/CellFormatController/DigitReader.h index e7fbb0e25b..a4d3061ef9 100644 --- a/OOXML/Binary/Sheets/Reader/CellFormatController/DigitReader.h +++ b/OOXML/Binary/Sheets/Reader/CellFormatController/DigitReader.h @@ -40,18 +40,18 @@ class DigitReader { public: - /// @brief считывание числа - /// @param value считываемое текстовое значение - /// @param digit строка с числовым значением - /// @param format строка с форматом числа - /// @return true значение преобразуется в число, иначе false + /// @brief read number + /// @param value text value being read + /// @param digit string with numeric value + /// @param format string with number format + /// @return true if value converts to number, otherwise false bool ReadDigit(const std::wstring &value, std::wstring &digit, std::wstring &format); - /// @brief считывание числа в формате scientific - /// @param value считываемое текстовое значение - /// @param digit строка с числовым значением - /// @param format строка с форматом числа - /// @return true значение преобразуется в число, иначе false + /// @brief read number in scientific format + /// @param value text value being read + /// @param digit string with numeric value + /// @param format string with number format + /// @return true if value converts to number, otherwise false bool ReadScientific(const std::wstring &value, std::wstring &digit, std::wstring &format); private: diff --git a/OOXML/Binary/Sheets/Reader/CellFormatController/LocalInfo.cpp b/OOXML/Binary/Sheets/Reader/CellFormatController/LocalInfo.cpp index 3c3d7c0682..80b27017f2 100644 --- a/OOXML/Binary/Sheets/Reader/CellFormatController/LocalInfo.cpp +++ b/OOXML/Binary/Sheets/Reader/CellFormatController/LocalInfo.cpp @@ -42,7 +42,7 @@ std::vector<std::vector<std::wstring>> MonthNames{}; std::vector<std::vector<std::wstring>> ShortMonthNames{}; std::map<_INT32, LocalInfo> InfoMap {}; -//инициализируем большие переменные только при необходимости +// initialize large variables only when necessary void InitLocalInfo() { InfoMap = std::map<_INT32, LocalInfo> @@ -296,7 +296,7 @@ LocalInfo getLocalInfo(const _INT32 lcid) //LocalInfo methods -//todo сборка кода формата из сокращенного формата и разделителя +// todo build format code from short format and separator std::wstring LocalInfo::GetShortDateFormat() { std::wstring result; diff --git a/OOXML/Binary/Sheets/Reader/CellFormatController/LocalInfo.h b/OOXML/Binary/Sheets/Reader/CellFormatController/LocalInfo.h index 3ba7c08bee..b0d12303e4 100644 --- a/OOXML/Binary/Sheets/Reader/CellFormatController/LocalInfo.h +++ b/OOXML/Binary/Sheets/Reader/CellFormatController/LocalInfo.h @@ -40,51 +40,51 @@ namespace lcInfo { -/// @brief класс содержащий в себе информацию о локали и используемых в ней стандартах +/// @brief class containing locale information and standards used in it class LocalInfo { public: - /// @brief собрать короткий формат даты из шаблона - /// @return шаблон из номеров определяющих порядок элементов даты где 0-1 дни 2-3 месяцы 4-5 годы + /// @brief build short date format from template + /// @return template with numbers defining date element order where 0-1 days 2-3 months 4-5 years std::wstring GetShortDateFormat(); - /// @brief получить имена месяцев в этой локали - /// @param index номер из списка месяцев - /// @param shortName запрашивается ли сокращенное имя - /// @return вектор имен месяцев начинающихся с января + /// @brief get month names in this locale + /// @param index number from month list + /// @param shortName whether abbreviated name is requested + /// @return vector of month names starting from January std::vector<std::wstring> GetMonthNames(const _INT16 &index, const bool isShortName = false); - /// @brief собрать короткий формат даты из шаблона - /// @return номер месяца начиная от нуля, в случае успеха, отрицательное число в случае неудачи + /// @brief build short date format from template + /// @return month number starting from zero on success, negative number on failure _INT16 GetMonthNumber(const std::wstring &monthName, const bool isShortName = false); - /// @brief получить строковое имя месяца в этой локали - /// @param index номер запрашиваемого месяца - /// @param shortName запрашивается ли сокращенное имя - /// @return имя месяца + /// @brief get string month name in this locale + /// @param index requested month number + /// @param shortName whether abbreviated name is requested + /// @return month name std::wstring GetLocMonthName(const _INT16 &index, bool shortName = false); - /// @brief id локали + /// @brief locale id _INT32 lcid; - /// @brief название локали + /// @brief locale name std::wstring Name; - /// @brief разделитель даты + /// @brief date separator std::wstring DateSeparator; - /// @brief сокращенная дата + /// @brief short date std::wstring ShortDatePattern; - /// @brief локальные имена месяцев + /// @brief local month names _INT16 MonthNamesIndex; - /// @brief максимум символов в сокращенной длине месяца + /// @brief maximum characters in abbreviated month length _INT16 MonthAbrvLen; }; -/// @brief получение информации о локали по её id +/// @brief get locale information by its id LocalInfo getLocalInfo(const _INT32 lcid); } diff --git a/OOXML/Binary/Sheets/Reader/ChartFromToBinary.cpp b/OOXML/Binary/Sheets/Reader/ChartFromToBinary.cpp index 0d451dac47..45d50aaac6 100644 --- a/OOXML/Binary/Sheets/Reader/ChartFromToBinary.cpp +++ b/OOXML/Binary/Sheets/Reader/ChartFromToBinary.cpp @@ -7716,7 +7716,7 @@ namespace BinXlsxRW WriteCT_Boolean(*oVal.m_autoUpdate); m_oBcw.WriteItemEnd(nCurPos); } - //if (NULL != oVal.m_id) - выше + //if (NULL != oVal.m_id) - above } void BinaryChartWriter::WriteCT_DispBlanksAs(CDispBlanksAs& oVal) { @@ -11957,7 +11957,7 @@ namespace BinXlsxRW m_oBcw.m_oStream.WriteBOOL(*pVal->m_autoUpdate); m_oBcw.WriteItemEnd(nCurPos); } - //if (NULL != pVal.m_id) - выше + //if (NULL != pVal.m_id) - above } void BinaryChartWriter::WriteCT_ChartExFormula(OOX::Spreadsheet::ChartEx::CFormula *pVal) { diff --git a/OOXML/Binary/Sheets/Reader/CommonWriter.cpp b/OOXML/Binary/Sheets/Reader/CommonWriter.cpp index 59c4b6bca7..e030296d85 100644 --- a/OOXML/Binary/Sheets/Reader/CommonWriter.cpp +++ b/OOXML/Binary/Sheets/Reader/CommonWriter.cpp @@ -54,7 +54,7 @@ namespace BinXlsxRW } int BinaryCommonWriter::WriteItemWithLengthStart() { - //Запоминаем позицию чтобы в конце записать туда длину + //Save position to write length at the end int nStartPos = m_oStream.GetPosition(); m_oStream.Skip(4); return nStartPos; diff --git a/OOXML/Binary/Sheets/Reader/XMLReader/XLSXTableController.cpp b/OOXML/Binary/Sheets/Reader/XMLReader/XLSXTableController.cpp index 8300ec7a24..6ef261a1cb 100644 --- a/OOXML/Binary/Sheets/Reader/XMLReader/XLSXTableController.cpp +++ b/OOXML/Binary/Sheets/Reader/XMLReader/XLSXTableController.cpp @@ -48,7 +48,7 @@ XLSXTableController::XLSXTableController(OOX::Spreadsheet::CXlsx &book, _INT32 l book_->m_pWorkbook->m_oSheets.Init(); tableRows_.push_back(nullptr); - // Создадим стили + // Create styles book_->CreateStyles(); formates_ = std::make_shared<CellFormatController>(book_->m_pStyles, lcid); @@ -57,7 +57,7 @@ XLSXTableController::XLSXTableController(OOX::Spreadsheet::CXlsx &book, _INT32 l void XLSXTableController::FormBook() { - /// @todo сделать так чтобы блок выполнялся только один раз + /// @todo make this block execute only once if(1) { auto pWorksheet = new OOX::Spreadsheet::CWorksheet(NULL); @@ -75,7 +75,7 @@ void XLSXTableController::AddCell(const std::wstring &sText, INT nRow, INT nCol) { size_t length = sText.length(); - // Пустую не пишем + // Don't write empty if (sText.empty() || (sText[0] == L'\0')) { return; @@ -133,16 +133,16 @@ _UINT32 XLSXTableController::addRow(OOX::Spreadsheet::CRow *pRow, OOX::Spreadshe { if (pWorkSheet->m_oSheetData->m_arrItems.size() > 1048576) { - return AVS_FILEUTILS_ERROR_CONVERT_ROWLIMITS; // ограниечние мс + return AVS_FILEUTILS_ERROR_CONVERT_ROWLIMITS; // MS limitation } pRow->m_oR.Init(); pRow->m_oR->SetValue(nRow); - /// сортируем ячейки в ряду + /// sort cells in the row if(pRow->m_arrItems.size() > 1) { std::sort(pRow->m_arrItems.begin(), pRow->m_arrItems.end(), CompareCells); - // Удаляем дубликаты с помощью алгоритма unique + // Remove duplicates using unique algorithm auto it = std::unique(pRow->m_arrItems.begin(), pRow->m_arrItems.end(), CompareColumns); pRow->m_arrItems.erase(it, pRow->m_arrItems.end()); } diff --git a/OOXML/Binary/Sheets/Reader/XMLReader/XLSXTableController.h b/OOXML/Binary/Sheets/Reader/XMLReader/XLSXTableController.h index 115d3021cb..7e7f89f08b 100644 --- a/OOXML/Binary/Sheets/Reader/XMLReader/XLSXTableController.h +++ b/OOXML/Binary/Sheets/Reader/XMLReader/XLSXTableController.h @@ -40,44 +40,44 @@ #include <string> #include <vector> -/// @brief класс -обертка позволяющий добавлять ячейки в таблицу и создавать документ из созданных ячеек +/// @brief wrapper class that allows adding cells to a table and creating a document from created cells class XLSXTableController { public: - /// @brief инициализация полей объекта - /// @param book объект который будет заполнен данными с помощью метода FormBook - /// @param lcid идентификатор локлаи + /// @brief object fields initialization + /// @param book object that will be filled with data using FormBook method + /// @param lcid locale identifier XLSXTableController(OOX::Spreadsheet::CXlsx &book, _INT32 lcid); - /// @brief добавление ячейки - /// @param sText вставляемый текст - /// @param nRow номер строки - /// @param nCol номер столбца - /// @param bIsWrap признак свернутости + /// @brief add cell + /// @param sText text to insert + /// @param nRow row number + /// @param nCol column number + /// @param bIsWrap wrap flag void AddCell(const std::wstring &sText, INT nRow, INT nCol); - /// @brief получение документа xlsx + /// @brief get xlsx document void FormBook(); private: - /// @brief добавление ряда - /// @param pRow указатель на строку - /// @param pWorkSheet указатель на лист - /// @param nRow номер строки + /// @brief add row + /// @param pRow pointer to row + /// @param pWorkSheet pointer to worksheet + /// @param nRow row number _UINT32 addRow(OOX::Spreadsheet::CRow *pRow, OOX::Spreadsheet::CWorksheet *pWorkSheet, INT nRow); - /// @brief добавление страницы - /// @param page указатель на лист - /// @param pageNumber номер страницы + /// @brief add page + /// @param page pointer to worksheet + /// @param pageNumber page number void addPage(OOX::Spreadsheet::CWorksheet *page, INT pageNumber); - /// @brief документ xlsx + /// @brief xlsx document OOX::Spreadsheet::CXlsx *book_; - /// @brief вектор со строками таблицы + /// @brief vector with table rows std::vector<OOX::Spreadsheet::CRow*> tableRows_; - /// @brief контроллер форматов + /// @brief format controller std::shared_ptr<CellFormatController> formates_; }; diff --git a/OOXML/Binary/Sheets/Reader/XMLReader/XML2TableConverter.cpp b/OOXML/Binary/Sheets/Reader/XMLReader/XML2TableConverter.cpp index 6ce6d735d8..65ef05940e 100644 --- a/OOXML/Binary/Sheets/Reader/XMLReader/XML2TableConverter.cpp +++ b/OOXML/Binary/Sheets/Reader/XMLReader/XML2TableConverter.cpp @@ -64,7 +64,7 @@ bool XML2TableConverter::ReadNextElement(std::map<_UINT32, std::wstring> &string void XML2TableConverter::readAttributes() { - ///@todo проверять нет ли в parents нод с таким же именем для вставки в их столбец вместо создания нового + ///@todo check if parents have nodes with the same name for insertion into their column instead of creating a new one if(!reader_->GetAttributesCount()) { return; @@ -131,7 +131,7 @@ void XML2TableConverter::insertEmptyNode (const std::wstring &key) std::wstring XML2TableConverter::getNodeName(const std::wstring &name, std::set<std::wstring> &names) { - /// ищем среди использовавшихся имён нужное + /// search for the needed name among used names for(auto i = names.begin(); i != names.end(); i++) { if(colNames_.GetXmlName(*i) == name) @@ -139,7 +139,7 @@ std::wstring XML2TableConverter::getNodeName(const std::wstring &name, std::set< return *i; } } - /// если не нашли, создаём его и вставляем + /// if not found, create and insert it auto resultName = name; colNames_.CreateColumnName(resultName); names.insert(resultName); @@ -176,7 +176,7 @@ void XML2TableConverter::processNode(const XmlUtils::XmlNodeType &type) } else if(type == XmlUtils::XmlNodeType::XmlNodeType_EndElement) { - //вставка ноды типа <node></node> + // inserting node of type <node></node> if(prevType_ == XmlUtils::XmlNodeType::XmlNodeType_Element) { insertValue(parents_.back().first, L""); @@ -190,7 +190,7 @@ void XML2TableConverter::processNode(const XmlUtils::XmlNodeType &type) void XML2TableConverter::storeData(const XmlUtils::XmlNodeType &type) { - ///@todo проверять нет ли в parents нод с таким же именем для вставки в их столбец вместо создания нового + ///@todo check if parents have nodes with the same name for insertion into their column instead of creating a new one if(type == XmlUtils::XmlNodeType::XmlNodeType_Text || type == XmlUtils::XmlNodeType::XmlNodeType_CDATA) { auto text = reader_->GetText(); diff --git a/OOXML/Binary/Sheets/Reader/XMLReader/XML2TableConverter.h b/OOXML/Binary/Sheets/Reader/XMLReader/XML2TableConverter.h index c7d67a16da..f90f94955c 100644 --- a/OOXML/Binary/Sheets/Reader/XMLReader/XML2TableConverter.h +++ b/OOXML/Binary/Sheets/Reader/XMLReader/XML2TableConverter.h @@ -43,79 +43,79 @@ #include <map> #include <utility> -/// @brief класс -обертка над xmlLiteReader для превращения xml нод в табличные строки +/// @brief wrapper class over xmlLiteReader for converting xml nodes to table rows class XML2TableConverter { public: - /// @brief конструктор загружающий в обънет reader с прочитанным xml - /// @param reader xmlLiteReader с загруженным в него xml документом + /// @brief constructor that loads reader with parsed xml into the object + /// @param reader xmlLiteReader with loaded xml document XML2TableConverter(XmlUtils::CXmlLiteReader &reader); - /// @brief метод, считывающий следующую строку из xml - /// @param string map со строковыми данными в качестве ключей и номерами их столбцов для вставки в качестве значений - /// @return номер строки в случае успешного считывания или -1 в случае ошибки + /// @brief method that reads the next row from xml + /// @param string map with string data as keys and their column numbers for insertion as values + /// @return row number on successful read or -1 on error bool ReadNextElement(std::map<_UINT32, std::wstring> &string); private: - /// @brief считывает аттрибуты текущей ноды + /// @brief reads attributes of the current node void readAttributes(); - /// @brief обрабатывает текущую ноду - /// @param type тип обрабатываемой ноды - /// @return true если ноды в рамках строки считаны и можно выходить, иначе false + /// @brief processes the current node + /// @param type type of the node being processed + /// @return true if nodes within the row are read and can exit, otherwise false void processNode(const XmlUtils::XmlNodeType &type); - /// @brief проверка ноды на возможность вставить её данные в таблицу с последующей их вставкой в случае успеха - /// @param type тип обрабатываемой ноды + /// @brief checks if node data can be inserted into table and inserts it on success + /// @param type type of the node being processed void storeData(const XmlUtils::XmlNodeType &type); - /// @brief заполняет данными переданный map - /// @param row map в который будут помещены данные и соответствующие им номера столбцов - /// @return номер вставляемой строки + /// @brief fills the passed map with data + /// @param row map where data and corresponding column numbers will be placed + /// @return number of the row being inserted void insertRow(std::map<_UINT32, std::wstring> &row); - /// @brief вставляет значение во временную внутреннюю структуру - /// @param key ключ, по которому будет вставлено значение - /// @param value значение которое нужно вставить + /// @brief inserts value into temporary internal structure + /// @param key key by which the value will be inserted + /// @param value value to insert void insertValue(const std::wstring &key, const std::wstring &value); - /// @brief вставляет имя пустой ноды - /// @param key имя ноды + /// @brief inserts empty node name + /// @param key node name void insertEmptyNode(const std::wstring &key); - /// @brief вставляет атрибут ноды во временную внутреннюю структуру - /// @param key ключ, по которому будет вставлено значение - /// @param value значение которое нужно вставить + /// @brief inserts node attribute into temporary internal structure + /// @param key key by which the value will be inserted + /// @param value value to insert void insertAttribute(const std::wstring &key, const std::wstring &value); - /// @brief заполняет map собранными именами столбцов для их вставки в таблицу - /// @param names map с именами столбцов + /// @brief fills map with collected column names for insertion into table + /// @param names map with column names void insertColumnNames(std::map<_UINT32, std::wstring> &names); - /// @brief Получение уникального имени ноды, либо его поиск в переданном множестве - /// @param name имя ноды, прочитанное из xml - /// @param names set содержащий уникальные имена, среди которых будет осуществляться поиск - /// @return найденное или сгенерированное уникальное имя ноды + /// @brief Gets unique node name or searches for it in the passed set + /// @param name node name read from xml + /// @param names set containing unique names among which the search will be performed + /// @return found or generated unique node name std::wstring getNodeName(const std::wstring &name, std::set<std::wstring> &names); - /// @brief указатель на считавший xml данные reader + /// @brief pointer to reader that read xml data XmlUtils::CXmlLiteReader *reader_; - /// @brief вектор с родительскими нодами и используемыми на их уровнях именами + /// @brief vector with parent nodes and names used at their levels std::vector<std::pair<std::wstring, std::set<std::wstring>>> parents_; - /// @brief map с набором ключей в виде уникальных имен и их значений для вставки в таблицу + /// @brief map with set of unique name keys and their values for insertion into table std::map<std::wstring, std::wstring> keyvalues_; - /// @brief контроллер имен столбцов таблицы + /// @brief table column names controller ColumnNameController colNames_; - /// @brief map в который выводятся данные при прочтении ноды + /// @brief map where data is output when reading a node std::map<_UINT32, std::wstring> stringBuffer_; - /// @brief тип предыдущей ноды(для поиска нод вида <node></node>) + /// @brief type of previous node (for finding nodes like <node></node>) XmlUtils::XmlNodeType prevType_ = XmlUtils::XmlNodeType::XmlNodeType_None; }; \ No newline at end of file diff --git a/OOXML/Binary/Sheets/Reader/XMLReader/XMLConverter2.cpp b/OOXML/Binary/Sheets/Reader/XMLReader/XMLConverter2.cpp index 9ea8c9a758..f52ee6d645 100644 --- a/OOXML/Binary/Sheets/Reader/XMLReader/XMLConverter2.cpp +++ b/OOXML/Binary/Sheets/Reader/XMLReader/XMLConverter2.cpp @@ -71,7 +71,7 @@ void XMLConverter::ConvertXml(XLSXTableController &table) } prevType_ = nodeType; } - ///выписываем однократно содержимое нод, если нет повторяющихся + /// write node contents once if there are no repeating ones if(writingRows_.empty()) { for(auto i :data_) @@ -85,7 +85,7 @@ void XMLConverter::ConvertXml(XLSXTableController &table) auto nodeName = writingRows_.at(nodeCount)->ValueColumnName; auto rowNumber = nodeCount + 2; - /// ищем самую старшую повторяющуюся ноду и заполняем унаследованные атрибуты + /// find the oldest repeating node and fill inherited attributes auto elderNode = writingRows_.at(nodeCount); for(auto i = elderNode; i; i = i->parent) { @@ -219,7 +219,7 @@ void XMLConverter::closeNode() } for (const auto& key : delitingNodes) { - openednodes_.erase(key); // Удаление элемента с указанным ключом + openednodes_.erase(key); // Delete element with specified key } if((!nodePointer_->ValueColumnName.empty() || !nodePointer_->childs.empty()) && closedNode) @@ -251,7 +251,7 @@ void XMLConverter::closeNode() std::wstring XMLConverter::getNodeName(const std::wstring &name) { - /// ищем среди использовавшихся имён нужное + /// search for needed name among used ones for(auto i = nodePointer_->attributes.begin(); i != nodePointer_->attributes.end(); i++) { if(colNames_->GetXmlName(*i) == name) diff --git a/OOXML/Binary/Sheets/Reader/XMLReader/XMLConverter2.h b/OOXML/Binary/Sheets/Reader/XMLReader/XMLConverter2.h index 12841d8b96..b42e59b89e 100644 --- a/OOXML/Binary/Sheets/Reader/XMLReader/XMLConverter2.h +++ b/OOXML/Binary/Sheets/Reader/XMLReader/XMLConverter2.h @@ -43,93 +43,93 @@ #include <set> #include <map> -/// @brief класс -обертка над xmlLiteReader для превращения xml нод в табличные строки +/// @brief Wrapper class over xmlLiteReader for converting xml nodes to table rows class XMLConverter { public: - /// @brief конструктор загружающий в обънет reader с прочитанным xml - /// @param reader xmlLiteReader с загруженным в него xml документом - /// @param xmlStruct указатель на корневую ноду структуры xml документа - /// @param nameController контроллер имен, заполненный именами столбцов - /// @param repeatebleValues множество с повторяющимися столбцами, предназначенное для формирования строк таблицы + /// @brief Constructor that loads the reader with parsed xml + /// @param reader xmlLiteReader with the loaded xml document + /// @param xmlStruct Pointer to the root node of the xml document structure + /// @param nameController Name controller, filled with column names + /// @param repeatebleValues Set with repeatable columns, intended for forming table rows XMLConverter(XmlUtils::CXmlLiteReader &reader, std::shared_ptr<XmlNode> xmlStruct, ColumnNameController &nameController, std::set<std::wstring> &repeatebleValues); - /// @brief метод, конвертирующий xml в табличный вид - /// @param table контроллер таблицы xlsx + /// @brief method that converts xml to table view + /// @param table xlsx table controller void ConvertXml(XLSXTableController &table); private: - /// @brief считывает аттрибуты текущей ноды + /// @brief reads attributes of the current node void readAttributes(); - /// @brief обрабатывает открытие текущей ноды + /// @brief handles opening of the current node void openNode(); - /// @brief обрабатывает закрытие текущей ноды + /// @brief handles closing of the current node void closeNode(); - /// @brief проверка ноды на возможность вставить её данные в таблицу с последующей их вставкой в случае успеха - /// @param type тип обрабатываемой ноды + /// @brief checks if node data can be inserted into the table and inserts it if successful + /// @param type type of node being processed void storeData(const XmlUtils::XmlNodeType &type); - /// @brief заполняет данными переданный map - /// @param row map в который будут помещены данные и соответствующие им номера столбцов - /// @return номер вставляемой строки + /// @brief fills the passed map with data + /// @param row map where data and corresponding column numbers will be placed + /// @return inserted row number void insertRow(std::map<_UINT32, std::wstring> &row); - /// @brief вставляет значение во временную внутреннюю структуру - /// @param key ключ, по которому будет вставлено значение - /// @param value значение которое нужно вставить + /// @brief inserts value into temporary internal structure + /// @param key key by which the value will be inserted + /// @param value value to be inserted void insertValue(const std::wstring &key, const std::wstring &value); - /// @brief Получение уникального имени ноды - /// @param name имя ноды, прочитанное из xml - /// @return найденное или сгенерированное уникальное имя ноды + /// @brief gets unique node name + /// @param name node name read from xml + /// @return found or generated unique node name std::wstring getNodeName(const std::wstring &name); - /// @brief заполняет строку таблицы атрибутами - /// @param table контроллер таблицы xlsx - /// @param attribNode нода из которой возьмутся атрибуты - /// @param filledValues set в котором храняться имена заполненных колонок - /// @param arowNumbe контроллер таблицы xlsx + /// @brief fills table row with attributes + /// @param table xlsx table controller + /// @param attribNode node from which attributes will be taken + /// @param filledValues set containing names of filled columns + /// @param arowNumbe xlsx table controller void fillAttribures(XLSXTableController &table, std::shared_ptr<XmlNode> attribNode, std::set<std::wstring> &filledValues, const _UINT32 &rowNumber); - /// @brief заполнение атрибутов дочерних нод родительскими в случае если родительская нода не идет как самостоятельная строка - /// @param childs дочерние ноды, атрибуты которой нужно заполнить родительскими - /// @param inheritersCount количество нод на которые будут распространены атрибуты родителской + /// @brief fills child nodes' attributes with parent's when parent node doesn't go as a separate row + /// @param childs child nodes whose attributes need to be filled with parent's + /// @param inheritersCount number of nodes that will inherit parent's attributes void moveParentAttributes(const std::shared_ptr<XmlNode> parent, const std::set<std::shared_ptr<XmlNode>>childs, const _UINT32 inheritersCount); - /// @brief указатель на считавший xml данные reader + /// @brief pointer to the reader that read xml data XmlUtils::CXmlLiteReader *reader_; - /// @brief вектор с родительскими нодами + /// @brief vector with parent nodes std::vector<std::shared_ptr<XmlNode>> parents_; - /// @brief map с набором ключей в виде уникальных имен и их значений для вставки в таблицу + /// @brief map with unique name keys and their values for insertion into the table std::map<std::wstring, std::vector<std::wstring>> data_; - /// @brief контроллер имен столбцов таблицы + /// @brief table column names controller ColumnNameController *colNames_; - /// @brief множество содержащее список столбцов ноды которых встречаются несколько раз + /// @brief set containing list of columns whose nodes appear multiple times std::set<std::wstring> *listableColumns_; - /// @brief дерево нод xml документа + /// @brief xml document node tree std::shared_ptr<XmlNode> nodeTree_; - /// @brief указатель на текущую ноду в структуре + /// @brief pointer to current node in structure std::shared_ptr<XmlNode> nodePointer_; - /// @brief тип предыдущей ноды(для поиска нод вида <node></node>) + /// @brief type of previous node (for finding nodes like <node></node>) XmlUtils::XmlNodeType prevType_ = XmlUtils::XmlNodeType::XmlNodeType_None; - /// @brief вектор с нодами записываемых строк + /// @brief vector with nodes of rows being written std::vector<std::shared_ptr<XmlNode>> writingRows_; - /// @brief вектор с указателями на повторяющиеся ноды, которые были открыты в данный момент + /// @brief vector with pointers to repeating nodes that are currently open std::map<std::shared_ptr<XmlNode>, _UINT32> openednodes_; }; diff --git a/OOXML/Binary/Sheets/Reader/XMLReader/XMLMap.cpp b/OOXML/Binary/Sheets/Reader/XMLReader/XMLMap.cpp index 9bdaefb98a..8243809be5 100644 --- a/OOXML/Binary/Sheets/Reader/XMLReader/XMLMap.cpp +++ b/OOXML/Binary/Sheets/Reader/XMLReader/XMLMap.cpp @@ -66,7 +66,7 @@ std::set<std::wstring> &repeatebleValues) void XMLMap::readAttributes() { - ///@todo проверять нет ли в parents нод с таким же именем для вставки в их столбец вместо создания нового + ///@todo check if parents have nodes with the same name to insert into their column instead of creating a new one if(!reader_->GetAttributesCount()) { return; @@ -103,7 +103,7 @@ void XMLMap::insertAttribute(const std::wstring &key) std::wstring XMLMap::getNodeName(const std::wstring &name, std::set<std::wstring> &names) { - /// ищем среди использовавшихся имён нужное + /// search for the needed name among used names for(auto i = names.begin(); i != names.end(); i++) { if(colNames_->GetXmlName(*i) == name) @@ -111,7 +111,7 @@ std::wstring XMLMap::getNodeName(const std::wstring &name, std::set<std::wstring return *i; } } - /// если не нашли, создаём его и вставляем + /// if not found, create and insert it auto resultName = name; colNames_->CreateColumnName(resultName); names.insert(resultName); @@ -175,7 +175,7 @@ void XMLMap::openNode() void XMLMap::closeNode() { - //вставка ноды типа <node></node> + //insert node like <node></node> if(prevType_ == XmlUtils::XmlNodeType::XmlNodeType_Element) { insertValue(); @@ -184,7 +184,7 @@ void XMLMap::closeNode() parents_.pop_back(); parents_.back()->childColumns.insert(lastElem->childColumns.begin(), lastElem->childColumns.end()); parents_.back()->childColumns.insert(lastElem->attributes.begin(), lastElem->attributes.end()); - //вырезаем значение ноды если у неё есть потомки + //remove node value if it has children if(!lastElem->childs.empty()) { lastElem->ValueColumnName = L""; diff --git a/OOXML/Binary/Sheets/Reader/XMLReader/XMLMap.h b/OOXML/Binary/Sheets/Reader/XMLReader/XMLMap.h index 864679f610..b9367a59d0 100644 --- a/OOXML/Binary/Sheets/Reader/XMLReader/XMLMap.h +++ b/OOXML/Binary/Sheets/Reader/XMLReader/XMLMap.h @@ -44,83 +44,83 @@ #include <utility> #include <memory> -/// @brief узел xml дерева +/// @brief XML tree node struct XmlNode { - /// @brief имя ноды + /// @brief node name std::wstring name; - /// @brief предок ноды + /// @brief parent node std::shared_ptr<XmlNode> parent; - /// @brief атрибуты ноды + /// @brief node attributes std::set<std::wstring> attributes; - /// @brief имя столбца с данными ноды, пустое если нода не имеет данных + /// @brief column name with node data, empty if node has no data std::wstring ValueColumnName; - /// @brief наследуемые столбцы ноды + /// @brief inherited columns of the node std::set<std::wstring> childColumns; - /// @brief потомки ноды + /// @brief child nodes std::set<std::shared_ptr<XmlNode>> childs; - /// @brief счетчик повторений ноды, чтобы расширять одну ноду, вместо использования многих с одинаковым именем + /// @brief node repetition counter, to expand one node instead of using many with the same name _UINT32 counter; - /// @brief все ноды предки + /// @brief all ancestor nodes std::set<std::shared_ptr<XmlNode>> parents; }; -/// @brief класс осуществляющий считывание xml файла и построение его табличной структуры для дальнейшей конвертации +/// @brief class that reads XML file and builds its table structure for further conversion class XMLMap { public: - /// @brief метод, считывающий структуру xml файла - /// @param reader xmlLiteReader с загруженным в него xml документом - /// @param nameController контроллер имен в который будут загружаться имена столбцов - /// @param nodeTree указатель на корневой элемент дерева нод, которое будет заполнено этим методом - /// @return true в случае успеха, иначе false + /// @brief method that reads XML file structure + /// @param reader xmlLiteReader with loaded XML document + /// @param nameController name controller where column names will be loaded + /// @param nodeTree pointer to root element of node tree that will be filled by this method + /// @return true on success, false otherwise bool ReadXmlStructure(XmlUtils::CXmlLiteReader &reader, ColumnNameController &nameController, std::shared_ptr<XmlNode> nodeTree, std::set<std::wstring> &repeatebleValues); private: - /// @brief считывает аттрибуты текущей ноды + /// @brief reads attributes of current node void readAttributes(); - /// @brief обрабатывает ноду типа element - /// @param type тип обрабатываемой ноды + /// @brief processes element type node + /// @param type type of node being processed void openNode(); - /// @brief обрабатывает ноду типа endelement - /// @param type тип обрабатываемой ноды + /// @brief processes endelement type node + /// @param type type of node being processed void closeNode(); - /// @brief вставляет значение во временную внутреннюю структуру + /// @brief inserts value into temporary internal structure void insertValue(); - /// @brief вставляет атрибут во временную внутреннюю структуру ноды - /// @param key ключ, по которому будет вставлено значение + /// @brief inserts attribute into temporary internal node structure + /// @param key key by which value will be inserted void insertAttribute(const std::wstring &key); - /// @brief Получение уникального имени ноды, либо его поиск в переданном множестве - /// @param name имя ноды, прочитанное из xml - /// @param names set содержащий уникальные имена, среди которых будет осуществляться поиск - /// @return найденное или сгенерированное уникальное имя ноды + /// @brief gets unique node name or searches for it in provided set + /// @param name node name read from XML + /// @param names set containing unique names to search among + /// @return found or generated unique node name std::wstring getNodeName(const std::wstring &name, std::set<std::wstring> &names); - /// @brief ищет на верхнем уровне ноду с переданным именем, используется для подсчета строк таблицы - /// @param name имя ноды + /// @brief searches for a node with the given name at the top level, used for counting table rows + /// @param name node name std::shared_ptr<XmlNode> searchSameNode(const std::wstring &name); - /// @brief указатель на считавший xml данные reader + /// @brief pointer to the XML data reader XmlUtils::CXmlLiteReader *reader_; - /// @brief указатель на контроллер имен столбцов таблицы + /// @brief pointer to the table column name controller ColumnNameController *colNames_; - /// @brief вектор с родительскими нодами и используемыми на их уровнях именами + /// @brief vector with parent nodes and names used at their levels std::vector<std::shared_ptr<XmlNode>> parents_; - /// @brief тип предыдущей ноды(для поиска нод вида <node></node>) + /// @brief type of previous node (for searching nodes like <node></node>) XmlUtils::XmlNodeType prevType_ = XmlUtils::XmlNodeType::XmlNodeType_None; - /// @brief столбцы значений, ноды которых повторялись более 1 раза + /// @brief value columns whose nodes were repeated more than once std::set<std::wstring> *repeatebleValues_; }; \ No newline at end of file diff --git a/OOXML/Binary/Sheets/Reader/XMLReader/XMLReader.cpp b/OOXML/Binary/Sheets/Reader/XMLReader/XMLReader.cpp index 8fde0f42e2..0513390840 100644 --- a/OOXML/Binary/Sheets/Reader/XMLReader/XMLReader.cpp +++ b/OOXML/Binary/Sheets/Reader/XMLReader/XMLReader.cpp @@ -50,7 +50,7 @@ _UINT32 XMLReader::Read(const std::wstring &sFileName, OOX::Spreadsheet::CXlsx & XML2TableConverter converter = {reader}; XLSXTableController table = {oXlsx, -1}; - // map хранящий текущий номер колонки для записи + // map storing current column number for writing std::map<_UINT32, _UINT32> rowNumbers = {}; std::map<_UINT32, std::wstring> stringData = {}; diff --git a/OOXML/Binary/Sheets/Reader/XMLReader/XMLReader.h b/OOXML/Binary/Sheets/Reader/XMLReader/XMLReader.h index 5d32597058..94058e3ced 100644 --- a/OOXML/Binary/Sheets/Reader/XMLReader/XMLReader.h +++ b/OOXML/Binary/Sheets/Reader/XMLReader/XMLReader.h @@ -33,21 +33,21 @@ #include "../../../../XlsxFormat/Xlsx.h" -/// @brief класс считывающий xml документы в xlsl +/// @brief class that reads xml documents into xlsx class XMLReader { public: - /// @brief Считывание документа - /// @param FileName имя xml файла который будет считан - /// @param oXlsx объект Xlsx таблицы в которую считается xml - /// @return код выполнения операции + /// @brief Read document + /// @param FileName xml file name to be read + /// @param oXlsx Xlsx spreadsheet object where xml will be read into + /// @return operation result code _UINT32 Read(const std::wstring &sFileName, OOX::Spreadsheet::CXlsx &oXlsx); - /// @brief Вторая версия считывающего метода - /// @param FileName имя xml файла который будет считан - /// @param oXlsx объект Xlsx таблицы в которую считается xml - /// @param идентификатор локали для определения форматов дат - /// @return код выполнения операции + /// @brief Second version of reading method + /// @param FileName xml file name to be read + /// @param oXlsx Xlsx spreadsheet object where xml will be read into + /// @param lcid locale identifier for determining date formats + /// @return operation result code _UINT32 Read2(const std::wstring &sFileName, OOX::Spreadsheet::CXlsx &oXlsx, _INT32 lcid = -1); }; diff --git a/OOXML/Binary/Sheets/Reader/XMLReader/XMLReader2.cpp b/OOXML/Binary/Sheets/Reader/XMLReader/XMLReader2.cpp index e9ed9cb4e9..766b4a4aef 100644 --- a/OOXML/Binary/Sheets/Reader/XMLReader/XMLReader2.cpp +++ b/OOXML/Binary/Sheets/Reader/XMLReader/XMLReader2.cpp @@ -51,7 +51,7 @@ _UINT32 XMLReader::Read2(const std::wstring &sFileName, OOX::Spreadsheet::CXlsx return AVS_FILEUTILS_ERROR_CONVERT_READ_FILE; } - ///считываем структуру xml файла + /// read xml file structure XMLMap map{}; auto rootNode = std::make_shared<XmlNode>(); ColumnNameController nameController{}; @@ -59,9 +59,9 @@ _UINT32 XMLReader::Read2(const std::wstring &sFileName, OOX::Spreadsheet::CXlsx map.ReadXmlStructure(reader, nameController, rootNode, repeatableColumns); reader.MoveToStart(); - ///создаем таблицу + /// create table XLSXTableController table = {oXlsx, lcid}; - ///заполняем первый ряд таблицы именами столбцов + /// fill first row of table with column names auto colNames = nameController.GetColumnNames(); std::map<_UINT32, std::wstring> namesMap; for(auto i = colNames.begin(); i != colNames.end(); i++) diff --git a/OOXML/Binary/Sheets/Reader/XMLReader/columnNamesController.h b/OOXML/Binary/Sheets/Reader/XMLReader/columnNamesController.h index 16a90df46a..8b7484782a 100644 --- a/OOXML/Binary/Sheets/Reader/XMLReader/columnNamesController.h +++ b/OOXML/Binary/Sheets/Reader/XMLReader/columnNamesController.h @@ -37,38 +37,38 @@ #include <string> #include <map> -/// @brief класс контролирующий уникальность имен столбцов при открытии xml документов +/// @brief class that controls uniqueness of column names when opening xml documents class ColumnNameController { public: - /// @brief Создание уникального имени столбца и установка его номера - /// @param column строка с именем столбца - /// @return номер, который будет у столбца с этим именем + /// @brief Create unique column name and set its number + /// @param column string with column name + /// @return number that this column will have _UINT32 CreateColumnName(std::wstring &column); - /// @brief Поиск номера столбца с указанным именем - /// @param columnName строка с именем столбца - /// @return номер столбца, если такой есть и -1, если такого столбца нет + /// @brief Search for column number with specified name + /// @param columnName string with column name + /// @return column number if exists, -1 if no such column _INT64 GetColumnNumber(const std::wstring &columnName); - /// @brief попытка поиска и получения изначального имени xml узла по уникальному - /// @param columnName уникальное имя узла, созданное контроллером - /// @return неуникальное имя xml ноды из которого было создано уникальное + /// @brief Try to find and get original xml node name by unique one + /// @param columnName unique node name created by controller + /// @return non-unique xml node name from which unique was created std::wstring GetXmlName(const std::wstring &columnName); - /// @brief Получение всех содержащихся имен и номеров их столбцов - /// @return map с уникальными именами как ключами и номерами столбцов как значениями + /// @brief Get all contained names and their column numbers + /// @return map with unique names as keys and column numbers as values std::map<std::wstring, _UINT32> GetColumnNames(); private: -/// @brief хранит уникальные имена столбцов как ключи и пару неуникальное имя и номер столбца как значение +/// @brief stores unique column names as keys and pair of non-unique name and column number as value std::map<std::wstring, std::pair<std::wstring, _UINT32>> colNames_; -/// @brief цифра добавляющаяся к повторяющимся именам столбцов для их уникальности +/// @brief number added to repeating column names to make them unique _UINT32 colNamePostfix_ = 2; -/// @brief максимальный номер столбца, который присваивается при получении нового имени +/// @brief maximum column number assigned when getting new name _UINT32 colNumber_ = 0; }; diff --git a/OOXML/Binary/Sheets/Writer/BinaryReaderS.cpp b/OOXML/Binary/Sheets/Writer/BinaryReaderS.cpp index 9a84e723fc..fc47b61edd 100644 --- a/OOXML/Binary/Sheets/Writer/BinaryReaderS.cpp +++ b/OOXML/Binary/Sheets/Writer/BinaryReaderS.cpp @@ -2094,7 +2094,7 @@ int BinaryStyleTableReader::ReadDxf(BYTE type, long length, void* poResult) { pDxf->m_oNumFmt.Init(); READ2_DEF_SPREADSHEET(length, res, this->ReadNumFmt, pDxf->m_oNumFmt.GetPointer()); - //todooo в m_mapNumFmtIndex + //todo to m_mapNumFmtIndex } else res = c_oSerConstants::ReadUnknown; @@ -4007,7 +4007,7 @@ int BinaryCommentReader::ReadComment(BYTE type, long length, void* poResult) *((_INT32*)(pWriteBuffer + nSignatureSize)) = (_INT32)length; memcpy(pWriteBuffer + nSignatureSize + nDataLengthSize, pSourceBuffer, length); - //пишем в конце 0, потому что при редактировании Excel меняет посление байты. + //write 0 at the end, because Excel changes the last bytes when editing. memset(pWriteBuffer + nSignatureSize + nDataLengthSize + length, 0, nJunkSize); int nBase64BufferLen = Base64::Base64EncodeGetRequiredLength(nWriteBufferLength, Base64::B64_BASE64_FLAG_NONE); @@ -4018,7 +4018,7 @@ int BinaryCommentReader::ReadComment(BYTE type, long length, void* poResult) { std::wstring strGfxdata = NSFile::CUtf8Converter::GetUnicodeStringFromUTF8(pbBase64Buffer, nBase64BufferLen); sGfxdata = std::wstring(strGfxdata.c_str()); - //важно иначе при редактировании и сохранении в Excel перетирается + //important otherwise it gets overwritten when editing and saving in Excel sGfxdata += L"\r\n"; } RELEASEARRAYOBJECTS(pbBase64Buffer); @@ -4308,7 +4308,7 @@ BinaryWorksheetsTableReader::BinaryWorksheetsTableReader(NSBinPptxRW::CBinaryFil m_mapMedia(mapMedia), m_sDestinationDir(sDestinationDir), m_arWorksheets(arWorksheets), m_mapWorksheets(mapWorksheets), m_pSharedStrings(pSharedStrings),m_mapPivotCacheDefinitions(mapPivotCacheDefinitions) { m_pOfficeDrawingConverter = pOfficeDrawingConverter; - m_nNextObjectId = 0xfffff; // в CDrawingConverter своя нумерация .. + m_nNextObjectId = 0xfffff; // CDrawingConverter has its own numbering .. m_lObjectIdVML = 1024; } int BinaryWorksheetsTableReader::Read() @@ -4322,7 +4322,7 @@ int BinaryWorksheetsTableReader::Read2xlsb(OOX::Spreadsheet::CXlsb &xlsb) { m_pXlsb = &xlsb; int res = c_oSerConstants::ReadOk; - //читаем листы для получения их имен и названий таблиц(используется в формулах) + //read sheets to get their names and table names (used in formulas) auto worksheetsPos = m_oBufferedStream.GetPos(); READ_TABLE_DEF(res, this->ReadWorksheetsCache, this); m_oWorkbook.m_oSheets->m_arrItems.resize(0); @@ -4661,7 +4661,7 @@ int BinaryWorksheetsTableReader::ReadWorksheet(boost::unordered_map<BYTE, std::v SEEK_TO_POS_START(c_oSerWorksheetsTypes::Controls); READ1_DEF(length, res, this->ReadControls, &oControls); - //SEEK_TO_POS_END(oControls); ниже ... + //SEEK_TO_POS_END(oControls); below ... SEEK_TO_POS_END2(); //------------------------------------------------------------------------------------------------------------- OOX::Spreadsheet::CUserProtectedRanges *pUserProtectedRanges = new OOX::Spreadsheet::CUserProtectedRanges(); @@ -5057,7 +5057,7 @@ int BinaryWorksheetsTableReader::ReadWorksheet(boost::unordered_map<BYTE, std::v SEEK_TO_POS_START(c_oSerWorksheetsTypes::Controls); READ1_DEF(length, res, this->ReadControls, &oControls); - //SEEK_TO_POS_END(oControls); ниже ... + //SEEK_TO_POS_END(oControls); below ... SEEK_TO_POS_END2(); //------------------------------------------------------------------------------------------------------------- OOX::CPath pathDrawingsDir = m_sDestinationDir + FILE_SEPARATOR_STR + _T("xl") + FILE_SEPARATOR_STR + _T("drawings"); @@ -7037,7 +7037,7 @@ int BinaryWorksheetsTableReader::ReadCells(BYTE type, long length, void* poResul OOX::Spreadsheet::CCell oCell; READ1_DEF(length, res, this->ReadCell, &oCell); -//текст error и формул пишем +//write error text and formulas if (NULL != m_pSharedStrings && oCell.m_oType.IsInit() && oCell.m_oValue.IsInit()) { SimpleTypes::Spreadsheet::ECellTypeType eCellType = oCell.m_oType->GetValue(); @@ -8589,7 +8589,7 @@ int BinaryOtherTableReader::ReadMediaItem(BYTE type, long length, void* poResult sImageSrc = m_sFileInDir + _T("media/") + sImage; } } - //Проверяем что файл существует + //Check that file exists FILE* pFileNative = oFile.GetFileNative(); if (NULL != pFileNative) { @@ -9598,7 +9598,7 @@ int BinaryFileReader::ReadFile(const std::wstring& sSrcFileName, std::wstring sD oFile.ReadFile(pBase64Data, oFile.GetFileSize(), nBase64DataSize); oFile.CloseFile(); - //проверяем формат + //check format bool bValidFormat = false; std::wstring sSignature(g_sFormatSignature); size_t nSigLength = sSignature.length(); @@ -9614,7 +9614,7 @@ int BinaryFileReader::ReadFile(const std::wstring& sSrcFileName, std::wstring sD } if (bValidFormat) { - //Читаем из файла версию и длину base64 + //Read version and base64 length from file int nIndex = (int)nSigLength; int nType = 0; std::string version = ""; @@ -9687,7 +9687,7 @@ int BinaryFileReader::ReadFile(const std::wstring& sSrcFileName, std::wstring sD _INT32 Lcid; SerializeCommon::ReadFileType(sXMLOptions, fileType, nCodePage, sDelimiter, saveFileType, Lcid); //csv, tsc .. from XmlOptions ! - // Делаем для CSV перебивку пути, иначе создается папка с одинаковым имеем (для rels) и файл не создается. + // For CSV, override the path, otherwise a folder with the same name is created (for rels) and file is not created. if (BinXlsxRW::c_oFileTypes::CSV == fileType) { diff --git a/OOXML/Binary/Sheets/Writer/CSVWriter.cpp b/OOXML/Binary/Sheets/Writer/CSVWriter.cpp index eac77ec32f..4de245c724 100644 --- a/OOXML/Binary/Sheets/Writer/CSVWriter.cpp +++ b/OOXML/Binary/Sheets/Writer/CSVWriter.cpp @@ -91,7 +91,7 @@ private: int m_nColDimension; - bool m_bIsWriteCell; // Нужно только для записи JSON-а + bool m_bIsWriteCell; // Only needed for JSON writing bool m_bStartRow; bool m_bStartCell; @@ -138,9 +138,9 @@ void CSVWriter::Xlsx2Csv(const std::wstring &sFileDst, OOX::Spreadsheet::CXlsx & if (oXlsx.m_pWorkbook) { LONG lActiveSheet = oXlsx.m_pWorkbook->GetActiveSheetIndex(); - std::wstring sSheetRId = _T("Sheet1"); // Читаем не по rId, а по имени листа - // Get active sheet rId (для конвертации в CSV нужно использовать name, т.к. это наш бинарник из js-скриптов и еще нет rId - // А для json-а нужно пользовать rId, т.к. при открытии они используются + std::wstring sSheetRId = _T("Sheet1"); // Read by sheet name, not by rId + // Get active sheet rId (for CSV conversion need to use name, since this is our binary from js-scripts and there's no rId yet + // For json need to use rId, since they are used on opening if (oXlsx.m_pWorkbook->m_oSheets.IsInit() && !oXlsx.m_pWorkbook->m_oSheets->m_arrItems.empty()) { OOX::Spreadsheet::CSheet* pSheet = NULL; @@ -405,12 +405,12 @@ std::wstring CSVWriter::Impl::convert_date_time(const std::wstring & sValue, std } - //currentTime->tm_year = date_.year() - 1900; // Устанавливаем год - //currentTime->tm_mon = date_.month() - 1; // Устанавливаем месяц (от 0 до 11) - //currentTime->tm_mday = date_.day(); // Устанавливаем день + //currentTime->tm_year = date_.year() - 1900; // Set year + //currentTime->tm_mon = date_.month() - 1; // Set month (from 0 to 11) + //currentTime->tm_mday = date_.day(); // Set day - //wss << std::put_time(currentTime, L"%x"); // Формат "%x" - формат даты для текущей локали + //wss << std::put_time(currentTime, L"%x"); // Format "%x" - date format for current locale //date_str = wss.str(); } @@ -421,12 +421,12 @@ std::wstring CSVWriter::Impl::convert_date_time(const std::wstring & sValue, std std::time_t now = std::time(nullptr); std::tm* currentTime = std::localtime(&now); - currentTime->tm_hour = hours; // Устанавливаем часы - currentTime->tm_min = minutes; // Устанавливаем минуты - currentTime->tm_sec = sec; // Устанавливаем секунды + currentTime->tm_hour = hours; // Set hours + currentTime->tm_min = minutes; // Set minutes + currentTime->tm_sec = sec; // Set seconds wss.imbue(loc_); - wss << std::put_time(currentTime, L"%X"); // Формат "%X" - формат времени для текущей локали + wss << std::put_time(currentTime, L"%X"); // Format "%X" - time format for current locale time_str = wss.str(); } @@ -673,8 +673,8 @@ void WriteFile(NSFile::CFileBinary *pFile, wchar_t **pWriteBuffer, int &nCurrent if (nCountChars + nCurrentIndex > c_nSize || bIsEnd) { - // Буффер заполнился, пишем - if (nCodePage == 48 && 2 == sizeof(wchar_t))//todo 48 временно CP_UTF16 + // Buffer is full, write + if (nCodePage == 48 && 2 == sizeof(wchar_t))//todo 48 temporarily CP_UTF16 { pFile->WriteFile((BYTE*)*pWriteBuffer, sizeof(wchar_t) * nCurrentIndex); } @@ -721,18 +721,18 @@ bool CSVWriter::Impl::Start(const std::wstring &sFileDst) bool res = m_oFile.CreateFileW(sFileDst); if (!res) return false; - // Нужно записать шапку - if (46 == m_nCodePage)//todo 46 временно CP_UTF8 + // Need to write header + if (46 == m_nCodePage)//todo 46 temporarily CP_UTF8 { BYTE arUTF8[3] = { 0xEF, 0xBB, 0xBF }; m_oFile.WriteFile(arUTF8, 3); } - else if (48 == m_nCodePage)//todo 48 временно CP_UTF16 + else if (48 == m_nCodePage)//todo 48 temporarily CP_UTF16 { BYTE arUTF16[2] = { 0xFF, 0xFE }; m_oFile.WriteFile(arUTF16, 2); } - else if (49 == m_nCodePage)//todo 49 временно CP_unicodeFFFE + else if (49 == m_nCodePage)//todo 49 temporarily CP_unicodeFFFE { BYTE arBigEndian[2] = { 0xFE, 0xFF }; m_oFile.WriteFile(arBigEndian, 2); @@ -798,7 +798,7 @@ void CSVWriter::Impl::WriteCell(OOX::Spreadsheet::CCell *pCell) { if (m_bJSON && false == m_bIsWriteCell) { - // Запишем пустые строки (для JSON-а) + // Write empty rows (for JSON) WriteFile(&m_oFile, &m_pWriteBuffer, m_nCurrentIndex, g_sDoubleQuote, m_nCodePage); } // Write delimiter @@ -880,7 +880,7 @@ void CSVWriter::Impl::WriteCell(OOX::Spreadsheet::CCell *pCell) } } } - else if(formatTypeIsDateTime) // если формат даты не задан явно, удаляем его и записываем дату в локальном формате + else if(formatTypeIsDateTime) // if date format is not explicitly set, remove it and write date in local format { format_code = L""; } @@ -925,7 +925,7 @@ void CSVWriter::Impl::WriteRowEnd(OOX::Spreadsheet::CRow* pWorksheet, bool bLast WriteFile(&m_oFile, &m_pWriteBuffer, m_nCurrentIndex, g_sEndJson, m_nCodePage); else { - while (m_nColDimension > m_nColCurrent && !bLast) // todooo - прописывать в бинарнике dimension - и данные брать оттуда + while (m_nColDimension > m_nColCurrent && !bLast) // todo - write dimension in binary - and take data from there { // Write delimiter ++m_nColCurrent; @@ -944,7 +944,7 @@ void CSVWriter::Impl::WriteSheetEnd(OOX::Spreadsheet::CWorksheet* pWorksheet) } void CSVWriter::Impl::End() { - // Теперь мы пишем как MS Excel (новую строку записываем в файл) + // Now we write like MS Excel (write new line to file) if (!m_bJSON) { WriteFile(&m_oFile, &m_pWriteBuffer, m_nCurrentIndex, g_sNewLineN, m_nCodePage); @@ -1041,7 +1041,7 @@ void CSVWriter::Impl::GetDefaultFormatCode(int numFmt, std::wstring & format_cod case 47: format_code = L"mmss.0"; format_type = SimpleTypes::Spreadsheet::celltypeTime; break; default: - /////////////////////////////////// с неопределенным format_code .. он задается в файле + /////////////////////////////////// with undefined format_code .. it is set in file if (numFmt >= 5 && numFmt <= 8) format_type = SimpleTypes::Spreadsheet::celltypeCurrency; if (numFmt >= 41 && numFmt <= 44) format_type = SimpleTypes::Spreadsheet::celltypeCurrency; @@ -1067,7 +1067,7 @@ std::wstring CSVWriter::Impl::ConvertValueCellToString(const std::wstring &value { if (false == format_code.empty()) { - format_code.erase(std::remove(format_code.begin(), format_code.end(), L'"'), format_code.end());//удаляем экранирующие кавычки из формата + format_code.erase(std::remove(format_code.begin(), format_code.end(), L'"'), format_code.end());//remove escaping quotes from format std::vector<std::wstring> format_codes; boost::algorithm::split(format_codes, format_code, boost::algorithm::is_any_of(L";"), boost::algorithm::token_compress_on); diff --git a/OOXML/Common/ComplexTypes.cpp b/OOXML/Common/ComplexTypes.cpp index a909bb481b..05aeb81b99 100644 --- a/OOXML/Common/ComplexTypes.cpp +++ b/OOXML/Common/ComplexTypes.cpp @@ -2406,7 +2406,7 @@ namespace Word XmlMacroReadAttributeBase(oNode, L"w:start", m_oStart); XmlMacroReadAttributeBase(oNode, L"w:startChars", m_oStartChars); - // См. 9.2.1.2 Part4 + // See 9.2.1.2 Part4 if (!m_oStart.IsInit()) XmlMacroReadAttributeBase(oNode, L"w:left", m_oStart); if (!m_oStartChars.IsInit()) diff --git a/OOXML/Common/ComplexTypes.h b/OOXML/Common/ComplexTypes.h index d74af9c334..ad3eabd7d4 100644 --- a/OOXML/Common/ComplexTypes.h +++ b/OOXML/Common/ComplexTypes.h @@ -204,7 +204,7 @@ namespace ComplexTypes void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: - // TO DO: сделать парсер языка по спецификации RFC 4646/BCP 47 - CLang + // TODO: implement language parser according to RFC 4646/BCP 47 specification - CLang nullable_string m_oBidi; nullable_string m_oEastAsia; nullable_string m_oVal; diff --git a/OOXML/Common/SimpleTypes_Base.cpp b/OOXML/Common/SimpleTypes_Base.cpp index 152dcd707b..e8a65e6897 100644 --- a/OOXML/Common/SimpleTypes_Base.cpp +++ b/OOXML/Common/SimpleTypes_Base.cpp @@ -118,7 +118,7 @@ namespace SimpleTypes return; } - // Проверим последние два символа + // Check last two characters std::wstring sUnit = sValue.substr( sValue.length() - 2, 2 ); m_bUnit = true; @@ -207,7 +207,7 @@ namespace SimpleTypes } //-------------------------------------------------------------------------------- - // Класс наследуемый от CUniversalMeasure, для которого обычные значения - пункты. + // Class inherited from CUniversalMeasure, for which default values are points. //-------------------------------------------------------------------------------- CPoint::CPoint() {} @@ -238,7 +238,7 @@ namespace SimpleTypes } //-------------------------------------------------------------------------------- - // Класс наследуемый от CUniversalMeasure, для которого обычные значения - emu. + // Class inherited from CUniversalMeasure, for which default values are emu. //-------------------------------------------------------------------------------- CInch::CInch() {} @@ -314,7 +314,7 @@ namespace SimpleTypes } //-------------------------------------------------------------------------------- - // Класс читающий double + // Class reading double //-------------------------------------------------------------------------------- CDouble::CDouble() {} CDouble::~CDouble() {} diff --git a/OOXML/Common/SimpleTypes_Base.h b/OOXML/Common/SimpleTypes_Base.h index b6688ccba3..d5beb11b38 100644 --- a/OOXML/Common/SimpleTypes_Base.h +++ b/OOXML/Common/SimpleTypes_Base.h @@ -169,7 +169,7 @@ namespace SimpleTypes protected: bool m_bUnit = false; - double m_dValue = 0; // Значение в пунктах + double m_dValue = 0; // Value in points }; //-------------------------------------------------------------------------------- @@ -193,7 +193,7 @@ namespace SimpleTypes }; //-------------------------------------------------------------------------------- - // Класс наследуемый от CUniversalMeasure, для которого обычные значения - пункты. + // Class inherited from CUniversalMeasure, for which default values are points. //-------------------------------------------------------------------------------- class CPoint : public CUniversalMeasure @@ -228,7 +228,7 @@ namespace SimpleTypes }; //-------------------------------------------------------------------------------- - // Класс наследуемый от CUniversalMeasure, для которого обычные значения - emu. + // Class inherited from CUniversalMeasure, for which default values are EMU. //-------------------------------------------------------------------------------- class CEmu : public CUniversalMeasure @@ -254,7 +254,7 @@ namespace SimpleTypes }; //-------------------------------------------------------------------------------- - // Класс читающий double + // Class that reads double values //-------------------------------------------------------------------------------- class CDouble diff --git a/OOXML/Common/SimpleTypes_Drawing.cpp b/OOXML/Common/SimpleTypes_Drawing.cpp index d7e04c99aa..1518a4d7d5 100644 --- a/OOXML/Common/SimpleTypes_Drawing.cpp +++ b/OOXML/Common/SimpleTypes_Drawing.cpp @@ -135,7 +135,7 @@ namespace SimpleTypes } else { - // Последние два символа не проверяем + // Don't check last two characters for ( size_t nIndex = 0; nIndex < sValue.length() - 2; nIndex++ ) { if ( !iswdigit( sValue[nIndex] ) && sValue[nIndex] != '.' && sValue[nIndex] != '-' ) @@ -155,7 +155,7 @@ namespace SimpleTypes else { this->m_eValue = adjcoordinateCoord; - // Значение хранится в m_dValue + // Value is stored in m_dValue } } @@ -752,7 +752,7 @@ namespace SimpleTypes { if ( -1 == nPos && nLen > 0) { - // Поправка 12.1.2.1 Part4 + // Amendment 12.1.2.1 Part4 int nValue = (std::min)( 100000, (std::max)( -100000, XmlUtils::GetInteger(sValue)) ); m_dValue = nValue / 1000.0; } @@ -865,7 +865,7 @@ namespace SimpleTypes void CGeomGuideFormula::Parse() { - // TO DO: Сделать разбор формул. См. стр.3244 Part1. + // TO DO: Implement formula parsing. See p.3244 Part1. } //-------------------------------------------------------------------------------- @@ -1393,7 +1393,7 @@ namespace SimpleTypes double CPercentage::FromString(const std::wstring &sValue) { - //todo странно что если пришло значение от 0 до 1, то m_dValue от 0 до 1. В других случаях от 0 до 100 + //todo strange that if value is from 0 to 1, then m_dValue is from 0 to 1. Otherwise from 0 to 100 int nPos = (int)sValue.find( '%' ); int nLen = (int)sValue.length(); if ( -1 == nPos || nPos != (int)sValue.length() - 1 || nLen <= 0 ) @@ -1408,7 +1408,7 @@ namespace SimpleTypes } else { - // Поправка 12.1.2.2 (Part4) + // Amendment 12.1.2.2 (Part4) m_dValue = dValue / 1000.0; } } @@ -1539,7 +1539,7 @@ namespace SimpleTypes { if ( -1 == nPos && nLen > 0) { - // Поправка 12.1.2.3 (Part4) + // Amendment 12.1.2.3 (Part4) int nValue = (std::max)( 0, (std::min)( 100000, XmlUtils::GetInteger(sValue) ) ); m_dValue = nValue / 1000.0; } @@ -1581,7 +1581,7 @@ namespace SimpleTypes { if ( -1 == nPos && nLen > 0) { - // Поправка 12.1.2.4 (Part4) + // Amendment 12.1.2.4 (Part4) int nValue = (std::max)( 0, XmlUtils::GetInteger(sValue) ); m_dValue = nValue / 1000.0; } @@ -3807,7 +3807,7 @@ namespace SimpleTypes { if ( -1 == nPos && nLen > 0) { - // Поправка 12.1.2.5 (Part4) + // Amendment 12.1.2.5 (Part4) int nValue = (std::min)( 100000, (std::max)( 1000, XmlUtils::GetInteger(sValue) ) ); m_dValue = nValue / 1000.0; } @@ -4160,7 +4160,7 @@ namespace SimpleTypes { if ( -1 == nPos && nLen > 0) { - // Поправка 12.1.2.7 (Part4) + // Amendment 12.1.2.7 (Part4) int nValue = (std::min)( 13200000, (std::max)( 0, XmlUtils::GetInteger(sValue) ) ); m_dValue = nValue / 1000.0; } @@ -4397,7 +4397,7 @@ namespace SimpleTypes } // SimpleTypes -// Здесь представлены все простые типы Drawing-Word из спецификации Office Open Xml (20.4.3) +// All simple Drawing-Word types from Office Open Xml specification (20.4.3) are presented here namespace SimpleTypes { //-------------------------------------------------------------------------------- @@ -4686,19 +4686,19 @@ namespace SimpleTypes } // SimpleTypes -// Здесь представлены все простые типы Drawing-Spreadsheet из спецификации Office Open Xml (20.5.3) +// All simple Drawing-Spreadsheet types from Office Open Xml specification (20.5.3) are presented here namespace SimpleTypes { } // SimpleTypes -// Здесь представлены все простые типы Drawing-Charts из спецификации Office Open Xml (21.2.3, 21.3.3) +// All simple Drawing-Charts types from Office Open Xml specification (21.2.3, 21.3.3) are presented here namespace SimpleTypes { } // SimpleTypes -// Здесь представлены все простые типы Drawing-Diagrams из спецификации Office Open Xml (21.4.7) +// All simple Drawing-Diagrams types from Office Open Xml specification (21.4.7) are presented here namespace SimpleTypes { EHueDirType CHueDirType::FromString(const std::wstring &sValue) diff --git a/OOXML/Common/SimpleTypes_Drawing.h b/OOXML/Common/SimpleTypes_Drawing.h index c86195de3d..ba84f17242 100644 --- a/OOXML/Common/SimpleTypes_Drawing.h +++ b/OOXML/Common/SimpleTypes_Drawing.h @@ -33,7 +33,7 @@ #include "SimpleTypes_Base.h" -// Здесь представлены все простые типы Drawing-Main из спецификации Office Open Xml (20.1.10) +// Here are all simple types Drawing-Main from Office Open Xml specification (20.1.10) namespace SimpleTypes { //-------------------------------------------------------------------------------- @@ -1346,7 +1346,7 @@ namespace SimpleTypes ////new////////////// shapetypeBallon, shapetypeRightUpArrow, - //дубирует с WordArd - может задаваться как внутри текстого бокса, так и в виде объекта + //duplicates with WordArt - can be set both inside text box and as an object shapetypeTextArchDownPour, shapetypeTextArchUpPour, shapetypeTextCanDown, @@ -1749,7 +1749,7 @@ namespace SimpleTypes } // SimpleTypes -// Здесь представлены все простые типы Drawing-Word из спецификации Office Open Xml (20.4.3) +// Here are all simple types Drawing-Word from Office Open Xml specification (20.4.3) namespace SimpleTypes { //-------------------------------------------------------------------------------- @@ -1890,19 +1890,19 @@ namespace SimpleTypes } // SimpleTypes -// Здесь представлены все простые типы Drawing-Spreadsheet из спецификации Office Open Xml (20.5.3) +// Here are all simple types Drawing-Spreadsheet from Office Open Xml specification (20.5.3) namespace SimpleTypes { } // SimpleTypes -// Здесь представлены все простые типы Drawing-Charts из спецификации Office Open Xml (21.2.3, 21.3.3) +// Here are all simple types Drawing-Charts from Office Open Xml specification (21.2.3, 21.3.3) namespace SimpleTypes { } // SimpleTypes -// Здесь представлены все простые типы Drawing-Diagrams из спецификации Office Open Xml (21.4.7) +// Here are all simple types Drawing-Diagrams from Office Open Xml specification (21.4.7) namespace SimpleTypes { //-------------------------------------------------------------------------------- diff --git a/OOXML/Common/SimpleTypes_OMath.cpp b/OOXML/Common/SimpleTypes_OMath.cpp index ef252c9182..78e44d1490 100644 --- a/OOXML/Common/SimpleTypes_OMath.cpp +++ b/OOXML/Common/SimpleTypes_OMath.cpp @@ -33,7 +33,7 @@ #include "SimpleTypes_OMath.h" #include "../Base/Unit.h" -// Здесь представлены все простые типы Drawing-Main из спецификации Office Open Xml (22.1.3) +// All simple Drawing-Main types from Office Open Xml specification (22.1.3) are presented here namespace SimpleTypes { EBreakBin CBreakBin::FromString(const std::wstring &sValue) diff --git a/OOXML/Common/SimpleTypes_OMath.h b/OOXML/Common/SimpleTypes_OMath.h index 7f28db0995..d3483c8c58 100644 --- a/OOXML/Common/SimpleTypes_OMath.h +++ b/OOXML/Common/SimpleTypes_OMath.h @@ -33,7 +33,7 @@ #include "SimpleTypes_Base.h" -// Здесь представлены все простые типы Drawing-Main из спецификации Office Open Xml (22.1.3) +// Here are all simple Drawing-Main types from the Office Open XML specification (22.1.3) namespace SimpleTypes { //-------------------------------------------------------------------------------- diff --git a/OOXML/Common/SimpleTypes_Shared.cpp b/OOXML/Common/SimpleTypes_Shared.cpp index 9948523265..16457333c2 100644 --- a/OOXML/Common/SimpleTypes_Shared.cpp +++ b/OOXML/Common/SimpleTypes_Shared.cpp @@ -37,7 +37,7 @@ #include "boost/format.hpp" #include "../Base/Unit.h" -// Здесь представлены все простые типы SharedML из спецификации Office Open Xml (22.8) +// All simple SharedML types from Office Open Xml specification (22.8) are presented here namespace SimpleTypes { const static int shemeDefaultColor[] = @@ -101,7 +101,7 @@ namespace SimpleTypes } // SimpleTypes -// Здесь представлены все простые типы SharedML из спецификации Office Open Xml (22.9) +// All simple SharedML types from Office Open Xml specification (22.9) are presented here namespace SimpleTypes { //-------------------------------------------------------------------------------- @@ -379,7 +379,7 @@ namespace SimpleTypes // Lang 22.9.2.6 (Part 1) //-------------------------------------------------------------------------------- - // TO DO: сделать парсер языка по спецификации RFC 4646/BCP 47 + // TO DO: implement language parser per RFC 4646/BCP 47 specification //class CLang //{ //public: @@ -421,7 +421,7 @@ namespace SimpleTypes // OnOff 22.9.2.7 (Part 1) //-------------------------------------------------------------------------------- - // Согласно части 4 стр. 1459, значений "on" и "off" быть не должно + // According to part 4 p. 1459, values "on" and "off" should not exist COnOff::COnOff(const bool & bVal) { @@ -660,7 +660,7 @@ namespace SimpleTypes // String 22.9.2.13 (Part 1) //-------------------------------------------------------------------------------- - // Ничего не делаем, используем ATL::std::wstring + // Do nothing, use ATL::std::wstring //-------------------------------------------------------------------------------- // TwipsMeasure 22.9.2.14 (Part 1) @@ -672,7 +672,7 @@ namespace SimpleTypes { Parse(sValue, 20); - // В данном типе только положительные числа + // This type only has positive numbers m_dValue = fabs( m_dValue ); return m_dValue; @@ -834,7 +834,7 @@ namespace SimpleTypes } } // SimpleTypes -// Здесь представлены все простые типы SharedML из спецификации Office Open Xml (15.1.2 - part 4) +// All simple SharedML types from Office Open Xml specification (15.1.2 - part 4) are presented here namespace SimpleTypes { //-------------------------------------------------------------------------------- diff --git a/OOXML/Common/SimpleTypes_Shared.h b/OOXML/Common/SimpleTypes_Shared.h index d13a39defb..92780fdf00 100644 --- a/OOXML/Common/SimpleTypes_Shared.h +++ b/OOXML/Common/SimpleTypes_Shared.h @@ -34,7 +34,7 @@ #include "SimpleTypes_Base.h" #include "../../DesktopEditor/common/Types.h" -// Здесь представлены все простые типы SharedML из спецификации Office Open Xml (22.8) +// Here are all simple types SharedML from Office Open Xml specification (22.8) namespace SimpleTypes { //-------------------------------------------------------------------------------- @@ -58,7 +58,7 @@ namespace SimpleTypes }; } // SimpleTypes -// Здесь представлены все простые типы SharedML из спецификации Office Open Xml (22.9) +// Here are all simple types SharedML from Office Open Xml specification (22.9) namespace SimpleTypes { //-------------------------------------------------------------------------------- @@ -163,7 +163,7 @@ namespace SimpleTypes // Lang 22.9.2.6 (Part 1) //-------------------------------------------------------------------------------- - // TO DO: сделать парсер языка по спецификации RFC 4646/BCP 47 + // TO DO: implement language parser according to RFC 4646/BCP 47 specification //class CLang //{ //public: @@ -205,7 +205,7 @@ namespace SimpleTypes // OnOff 22.9.2.7 (Part 1) //-------------------------------------------------------------------------------- - // Согласно части 4 стр. 1459, значений "on" и "off" быть не должно + // According to part 4 page 1459, values "on" and "off" should not exist enum EOnOff { onoffFalse = 0, @@ -276,7 +276,7 @@ namespace SimpleTypes // String 22.9.2.13 (Part 1) //-------------------------------------------------------------------------------- - // Ничего не делаем, используем ATL::std::wstring + // Do nothing, use ATL::std::wstring //-------------------------------------------------------------------------------- // TwipsMeasure 22.9.2.14 (Part 1) @@ -353,7 +353,7 @@ namespace SimpleTypes } // SimpleTypes -// Здесь представлены все простые типы SharedML из спецификации Office Open Xml (15.1.2 - part 4) +// Here are all simple types SharedML from Office Open Xml specification (15.1.2 - part 4) namespace SimpleTypes { //-------------------------------------------------------------------------------- diff --git a/OOXML/Common/SimpleTypes_Vml.cpp b/OOXML/Common/SimpleTypes_Vml.cpp index 075213e0fb..5c673169af 100644 --- a/OOXML/Common/SimpleTypes_Vml.cpp +++ b/OOXML/Common/SimpleTypes_Vml.cpp @@ -1661,7 +1661,7 @@ namespace SimpleTypes } // SimpleTypes -// Дополнительные простые типы, не входящие в спецификацию +// Additional simple types not included in specification namespace SimpleTypes { namespace Vml @@ -1781,7 +1781,7 @@ namespace SimpleTypes std::wstring CVmlPath::FromString(const std::wstring &sValue) { - // TO DO: Сделать парсер пата Part4. 14.2.2.3 + // TO DO: Implement path parser Part4. 14.2.2.3 m_sValue = sValue; return m_sValue; @@ -2373,7 +2373,7 @@ namespace SimpleTypes return; } - // Чтобы избежать большого количества сравнения строк проверим для начала по первым двум символам + // To avoid many string comparisons, first check by first two characters int nChar1 = sProperty[ 0 ]; int nChar2 = sProperty[ 1 ]; @@ -2607,7 +2607,7 @@ namespace SimpleTypes void CCssProperty::ReadValue_Unknown(std::wstring& sValue) { - // Ничего не делаем + // Do nothing } void CCssProperty::ReadValue_Flip(std::wstring& sValue) { @@ -2654,11 +2654,11 @@ namespace SimpleTypes } else if ( -1 != ( nPos = (int)sValue.find( L"em" ) ) ) { - // TO DO: Реализовать единицы 'em' + // TO DO: Implement 'em' units } else if ( -1 != ( nPos = (int)sValue.find( L"ex" ) ) ) { - // TO DO: Реализовать единицы 'ex' + // TO DO: Implement 'ex' units } else if ( -1 != ( nPos = (int)sValue.find( L"pt" ) ) ) { @@ -3896,7 +3896,7 @@ namespace SimpleTypes std::wstring sValue = sValueInput; - // Разделителями могут быть запятые и пробелы + // Delimiters can be commas and spaces XmlUtils::replace_all(sValue, L"@", L""); boost::algorithm::split(arSplit, sValue, boost::algorithm::is_any_of(L", "), boost::algorithm::token_compress_on); diff --git a/OOXML/Common/SimpleTypes_Vml.h b/OOXML/Common/SimpleTypes_Vml.h index 1880b600ac..e17eefcdf8 100644 --- a/OOXML/Common/SimpleTypes_Vml.h +++ b/OOXML/Common/SimpleTypes_Vml.h @@ -315,7 +315,7 @@ namespace SimpleTypes filltypeTile = 8 }; - // Тут разделяем два типа 14.13.4 - m_nType = 0 и 14.2.3.14 - m_nType != 0 + // Here we separate two types 14.13.4 - m_nType = 0 and 14.2.3.14 - m_nType != 0 DEFINE_SIMPLE_TYPE_NSV(CFillType, EFillType, filltypeSolid) @@ -860,7 +860,7 @@ namespace SimpleTypes } // SimpleTypes -// Дополнительные простые типы, не входящие в спецификацию +// Additional simple types not included in the specification namespace SimpleTypes { namespace Vml @@ -1164,7 +1164,7 @@ namespace SimpleTypes csspctMsoTopPercent = 1025, csspctMsoLeftPercent = 1026, - // Для элемента Textbox 14.1.2.22 + // For element Textbox 14.1.2.22 cssptDirection = 1100, cssptLayoutFlow = 1101, cssptMsoDirectionAlt = 1102, @@ -1176,7 +1176,7 @@ namespace SimpleTypes cssptMsoTextScale = 1108, cssptVTextAnchor = 1109, - // Для элемента Textpath 14.1.2.23 + // For element Textpath 14.1.2.23 cssptFont = 1200, cssptFontFamily = 1201, cssptFontSize = 1202, @@ -1212,7 +1212,7 @@ namespace SimpleTypes struct TCssUnitsValue { ECssUnitsType eType; - double dValue; // значение в пунктах + double dValue; // value in points }; enum ECssMsoPosHor { @@ -1504,8 +1504,8 @@ namespace SimpleTypes SimpleTypes_DefaultString(CVml_Vector2D_Units) private: - double m_dX; // В пунктах - double m_dY; // В пунктах + double m_dX; // In points + double m_dY; // In points }; //-------------------------------------------------------------------------------- @@ -1635,10 +1635,10 @@ namespace SimpleTypes EVml_Vector2D_Position m_eTypeX; EVml_Vector2D_Position m_eTypeY; - std::wstring m_sIdX; // Значение для типа Formula иди AdjValue + std::wstring m_sIdX; // Value for type Formula or AdjValue std::wstring m_sIdY; // - double m_dX; // Значение для типа Constant + double m_dX; // Value for type Constant double m_dY; // }; @@ -1678,7 +1678,7 @@ namespace SimpleTypes }; std::vector<TPoint> m_arrPoints; - wchar_t m_wcDelimiter; // Разделитель, по умолчнию пробел ' ' + wchar_t m_wcDelimiter; // Delimiter, default is space ' ' }; //-------------------------------------------------------------------------------- diff --git a/OOXML/Common/SimpleTypes_Word.cpp b/OOXML/Common/SimpleTypes_Word.cpp index 9c3bdfcd4b..398028f1e2 100644 --- a/OOXML/Common/SimpleTypes_Word.cpp +++ b/OOXML/Common/SimpleTypes_Word.cpp @@ -1833,7 +1833,7 @@ namespace SimpleTypes sValue = sValue.substr(1); } - //В документации не написано, что цвет может приходить строкой, но в реальных документах встречается и word это разруливает. + //Documentation doesn't specify that color can come as string, but it occurs in real documents and Word handles this. CPresetColorVal oPresetColorVal; if(oPresetColorVal.FromStringIgnoreCase(sValue)) { @@ -2138,7 +2138,7 @@ namespace SimpleTypes { this->m_eValue = highlightcolorNone; - // Инициализируем цвет + // Initialize color FromString( ToString() ); } @@ -4368,7 +4368,7 @@ namespace SimpleTypes -// Дополнительные типы +// Additional types namespace SimpleTypes { //-------------------------------------------------------------------------------- @@ -4442,13 +4442,13 @@ namespace SimpleTypes if ( '0' == wsChar ) { - // Ничего не делаем + // Do nothing } else if ( '1' == wsChar ) { this->m_eValue ^= nMult; } - else // Неправильный формат + else // Invalid format break; } } diff --git a/OOXML/Common/SimpleTypes_Word.h b/OOXML/Common/SimpleTypes_Word.h index 978c4dd653..2eff0ebc08 100644 --- a/OOXML/Common/SimpleTypes_Word.h +++ b/OOXML/Common/SimpleTypes_Word.h @@ -33,7 +33,7 @@ #include "SimpleTypes_Base.h" -// Здесь представлены все простые типы Word из спецификации Office Open Xml (17.18) +// Here are all simple Word types from the Office Open XML specification (17.18) namespace SimpleTypes { //-------------------------------------------------------------------------------- @@ -52,7 +52,7 @@ namespace SimpleTypes // Border 17.18.2 (Part 1) //-------------------------------------------------------------------------------- - // Значения с 1-го по 25-ый сделаны по таблице 17.4.67 + // Values from 1 to 25 are based on table 17.4.67 enum EBorder { // No Border @@ -390,7 +390,7 @@ namespace SimpleTypes private: double m_dValue; - bool m_bTrailingPercentSign; // Есть ли знак процента в конце? + bool m_bTrailingPercentSign; // Is there a percent sign at the end? }; //-------------------------------------------------------------------------------- @@ -1997,7 +1997,7 @@ namespace SimpleTypes }; // SimpleTypes -// Дополнительные типы +// Additional types namespace SimpleTypes { //-------------------------------------------------------------------------------- diff --git a/OOXML/DocxFormat/Bibliography.cpp b/OOXML/DocxFormat/Bibliography.cpp index 707a3d2b41..63913ca7f1 100644 --- a/OOXML/DocxFormat/Bibliography.cpp +++ b/OOXML/DocxFormat/Bibliography.cpp @@ -112,7 +112,7 @@ namespace OOX } void CBibliography::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("SelectedStyle"), m_sSelectedStyle ) WritingElement_ReadAttributes_Read_else_if( oReader, _T("StyleName"), m_sStyleName ) diff --git a/OOXML/DocxFormat/Bibliography.h b/OOXML/DocxFormat/Bibliography.h index 90abae965a..fd2cbd370d 100644 --- a/OOXML/DocxFormat/Bibliography.h +++ b/OOXML/DocxFormat/Bibliography.h @@ -67,7 +67,7 @@ namespace OOX // Childs - // TO DO: Реализовать полное чтение библиографии + // TO DO: Implement full bibliography reading }; } // namespace OOX diff --git a/OOXML/DocxFormat/ContentTypes.cpp b/OOXML/DocxFormat/ContentTypes.cpp index 5adde7a36e..af67d1f228 100644 --- a/OOXML/DocxFormat/ContentTypes.cpp +++ b/OOXML/DocxFormat/ContentTypes.cpp @@ -131,7 +131,7 @@ namespace OOX } void CDefault::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start(oReader) WritingElement_ReadAttributes_ReadSingle(oReader, L"Extension", m_sExtension) WritingElement_ReadAttributes_End(oReader) diff --git a/OOXML/DocxFormat/Document.cpp b/OOXML/DocxFormat/Document.cpp index 7440d6b27d..f0b4116ee7 100644 --- a/OOXML/DocxFormat/Document.cpp +++ b/OOXML/DocxFormat/Document.cpp @@ -126,7 +126,7 @@ namespace OOX sResult += L"</w:background>"; } else if (m_oBackground.IsInit()) - {//наличие атрибута Color обязательно + {//Color attribute is mandatory sResult += m_oBackground->toXML(); sResult += L"</w:background>"; } @@ -407,7 +407,7 @@ namespace OOX document->m_arrSections.push_back(section); } document->m_arrSections.back().sect = m_oSectPr.GetPointer(); - document->m_arrSections.back().end_elm = document->m_arrItems.size(); //активный рутовый еще не добавлен + document->m_arrSections.back().end_elm = document->m_arrItems.size(); //active root not yet added } } } diff --git a/OOXML/DocxFormat/Document.h b/OOXML/DocxFormat/Document.h index bc804c04c5..18ae3c7d03 100644 --- a/OOXML/DocxFormat/Document.h +++ b/OOXML/DocxFormat/Document.h @@ -180,7 +180,7 @@ namespace OOX size_t end_elm = 0; WritingElement* sect = NULL; }; - std::vector<_section> m_arrSections; // дублирование ... для удобства конвертаций + std::vector<_section> m_arrSections; // duplication ... for conversion convenience }; diff --git a/OOXML/DocxFormat/Docx.cpp b/OOXML/DocxFormat/Docx.cpp index 97b4aa249c..82674cc72b 100644 --- a/OOXML/DocxFormat/Docx.cpp +++ b/OOXML/DocxFormat/Docx.cpp @@ -97,7 +97,7 @@ namespace OOX } bool CDocx::Write(const CPath& oFilePath) { - // Создаем папку + // Create folder std::wstring filePath = oFilePath.GetPath(); NSDirectory::CreateDirectory(filePath); @@ -114,7 +114,7 @@ namespace OOX { m_sDocumentPath = oFilePath.GetPath(); - // Ищем "/_rels/.rels" и читаем все файлы по рельсам + // Find "/_rels/.rels" and read all files by relationships OOX::CRels oRels( oFilePath / FILE_SEPARATOR_STR ); IFileContainer::Read( oRels, oFilePath, oFilePath ); diff --git a/OOXML/DocxFormat/Docx.h b/OOXML/DocxFormat/Docx.h index 3022636d81..4c9cb1d2b9 100644 --- a/OOXML/DocxFormat/Docx.h +++ b/OOXML/DocxFormat/Docx.h @@ -73,14 +73,14 @@ namespace OOX public: struct _part_summary { - OOX::CDocument *document = NULL; // Основной /document.xml - OOX::CFontTable *fontTable = NULL; // Таблица шрифтов /fonttable.xml - OOX::CNumbering *numbering = NULL; // Нумерации /numbering.xml - OOX::CStyles *styles = NULL; // Стили /styles.xml - OOX::CFootnotes *footnotes = NULL; // Сноски /footnotes.xml - OOX::CEndnotes *endnotes = NULL; // Сноски /endnotes.xml - OOX::CSettings *settings = NULL; // Настройки /settings.xml - OOX::CComments *comments = NULL; // Комментарии /comments.xml + OOX::CDocument *document = NULL; // Main document /document.xml + OOX::CFontTable *fontTable = NULL; // Font table /fonttable.xml + OOX::CNumbering *numbering = NULL; // Numbering /numbering.xml + OOX::CStyles *styles = NULL; // Styles /styles.xml + OOX::CFootnotes *footnotes = NULL; // Footnotes /footnotes.xml + OOX::CEndnotes *endnotes = NULL; // Endnotes /endnotes.xml + OOX::CSettings *settings = NULL; // Settings /settings.xml + OOX::CComments *comments = NULL; // Comments /comments.xml void init(); }; @@ -99,10 +99,10 @@ namespace OOX OOX::CApp *m_pApp; OOX::CCore *m_pCore; - _part_summary m_oMain; // Основной документ word/ + _part_summary m_oMain; // Main document word/ _part_summary m_oGlossary; // Glossary Document word/glossary/ - // todooo сделать структурный объект - главный документ и подчиненные - как только появится что то кроме glossary + // todooo create structural object - main document and subordinates - as soon as something other than glossary appears bool m_bGlossaryRead; OOX::CCommentsExt *m_pCommentsExt; // word/commentsExtended.xml diff --git a/OOXML/DocxFormat/Drawing/Drawing.cpp b/OOXML/DocxFormat/Drawing/Drawing.cpp index bb65629857..582592ec22 100644 --- a/OOXML/DocxFormat/Drawing/Drawing.cpp +++ b/OOXML/DocxFormat/Drawing/Drawing.cpp @@ -1041,9 +1041,9 @@ namespace OOX else if ( _T("wp14:sizeRelV") == sName ) m_oSizeRelV = oReader; else if ( _T("mc:AlternateContent") == sName ) - //ПРИВЛЕЧЕНИЕ СРЕДСТВ ИЗ МЕСТНЫХ ИСТОЧНИКОВ.docx - //вариативность на разные версии офиса части параметров - кстати ... это может встретиться в ЛЮБОМ месте - //todooo сделать чтение не обязательно fallback, по выбору версии нужной нам (w14, ..) + //FUNDRAISING FROM LOCAL SOURCES.docx + //variability for different office versions of some parameters - by the way... this can occur ANYWHERE + //todooo implement reading not necessarily fallback, by selecting the version we need (w14, ..) { nCurDepth++; while( oReader.ReadNextSiblingNode( nCurDepth ) ) @@ -1063,7 +1063,7 @@ namespace OOX oSubReader.ReadNextNode();//fallback fromXML(oSubReader); - //break чтобы не читать сразу оба Choice и Fallback + //break to avoid reading both Choice and Fallback at once break; } } diff --git a/OOXML/DocxFormat/Drawing/Drawing.h b/OOXML/DocxFormat/Drawing/Drawing.h index a29c69d43e..9e63132c1e 100644 --- a/OOXML/DocxFormat/Drawing/Drawing.h +++ b/OOXML/DocxFormat/Drawing/Drawing.h @@ -89,7 +89,7 @@ namespace OOX bool IsAlign() const; bool IsPosOffset() const; - bool m_bAlign; // используем Align или (PosOffset или PctOffset) + bool m_bAlign; // use Align or (PosOffset or PctOffset) nullable<SimpleTypes::CRelFromH> m_oRelativeFrom; @@ -121,7 +121,7 @@ namespace OOX bool IsAlign() const; bool IsPosOffset() const; - bool m_bAlign; // используем Align или PosOffset + bool m_bAlign; // use Align or PosOffset nullable<SimpleTypes::CRelFromV> m_oRelativeFrom; @@ -462,7 +462,7 @@ namespace OOX bool IsAnchor() const; bool IsInline() const; - bool m_bAnchor; // используем Anchor или Inline + bool m_bAnchor; // use Anchor or Inline // Childs nullable<OOX::Drawing::CAnchor> m_oAnchor; nullable<OOX::Drawing::CInline> m_oInline; diff --git a/OOXML/DocxFormat/Drawing/DrawingExt.cpp b/OOXML/DocxFormat/Drawing/DrawingExt.cpp index 880a76d2e3..ff15b22134 100644 --- a/OOXML/DocxFormat/Drawing/DrawingExt.cpp +++ b/OOXML/DocxFormat/Drawing/DrawingExt.cpp @@ -656,7 +656,7 @@ namespace OOX } void COfficeArtExtensionList::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать + // TO DO: Implement } void COfficeArtExtensionList::fromXML(XmlUtils::CXmlLiteReader& oReader) { diff --git a/OOXML/DocxFormat/FtnEdn.cpp b/OOXML/DocxFormat/FtnEdn.cpp index a8ae93ca6d..417e4c326e 100644 --- a/OOXML/DocxFormat/FtnEdn.cpp +++ b/OOXML/DocxFormat/FtnEdn.cpp @@ -241,7 +241,7 @@ namespace OOX } void CFtnEdn::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if( oReader, L"w:id", m_oId ) WritingElement_ReadAttributes_Read_else_if( oReader, L"w:type", m_oType ) diff --git a/OOXML/DocxFormat/FtnEdn.h b/OOXML/DocxFormat/FtnEdn.h index 8154cbbcce..abffd5e63c 100644 --- a/OOXML/DocxFormat/FtnEdn.h +++ b/OOXML/DocxFormat/FtnEdn.h @@ -36,7 +36,7 @@ #include "../Common/SimpleTypes_Word.h" -// TO DO: Нехватающие классы: +// TO DO: Missing classes: // <w:customXml> // <w:del> // <w:ins> @@ -65,7 +65,7 @@ namespace OOX virtual std::wstring toXML() const; virtual EElementType getType() const; - OOX::EElementType m_eType; // <w:footnote> или <w:endnote> + OOX::EElementType m_eType; // <w:footnote> or <w:endnote> nullable<SimpleTypes::CDecimalNumber> m_oId; nullable<SimpleTypes::CFtnEdn> m_oType; @@ -95,7 +95,7 @@ namespace OOX void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: - OOX::EElementType m_eType; // <w:footnote> или <w:endnote> + OOX::EElementType m_eType; // <w:footnote> or <w:endnote> nullable<SimpleTypes::CDecimalNumber> m_oId; }; diff --git a/OOXML/DocxFormat/HeaderFooter.h b/OOXML/DocxFormat/HeaderFooter.h index 53991cbcd0..9b00f67067 100644 --- a/OOXML/DocxFormat/HeaderFooter.h +++ b/OOXML/DocxFormat/HeaderFooter.h @@ -39,7 +39,7 @@ #include "../Common/SimpleTypes_Word.h" -// TO DO: Нехватающие классы: +// TO DO: Missing classes: // <w:customXml> // <w:moveFrom> // <w:moveTo> diff --git a/OOXML/DocxFormat/IFileContainer.cpp b/OOXML/DocxFormat/IFileContainer.cpp index fb069e6fbc..a839385d3d 100644 --- a/OOXML/DocxFormat/IFileContainer.cpp +++ b/OOXML/DocxFormat/IFileContainer.cpp @@ -64,7 +64,7 @@ namespace OOX } void IFileContainer::Read (const OOX::CPath& oRootPath, const OOX::CPath& oPath) { - // Находим связи(рельсы) с данным файлом + // Find relationships (rails) with this file m_pCurRels = new OOX::CRels(oPath); if (m_pMainDocument) @@ -74,7 +74,7 @@ namespace OOX m_pMainDocument->m_mapContent.insert(std::make_pair(oPath.GetPath(), pFile)); } - // Читаем все файлы по рельсам + // Read all files by relationships Read( *m_pCurRels, oRootPath, oPath.GetDirectory() ); } @@ -167,7 +167,7 @@ namespace OOX } if(true != pFile->m_bDoNotAddRels) { - if (oDefDir.GetPath().length() > 0)//todooo перенести в CPath + if (oDefDir.GetPath().length() > 0)//todooo move to CPath oRels.Registration( pPair->first, pFile->type(), oDefDir / oName ); else oRels.Registration( pPair->first, pFile->type(), oName ); diff --git a/OOXML/DocxFormat/Logic/AlternateContent.cpp b/OOXML/DocxFormat/Logic/AlternateContent.cpp index fd32ab81e3..547ab7ebf1 100644 --- a/OOXML/DocxFormat/Logic/AlternateContent.cpp +++ b/OOXML/DocxFormat/Logic/AlternateContent.cpp @@ -89,14 +89,14 @@ namespace OOX } } - //без RemoveAll они очистятся вместе с altRun + //without RemoveAll they will be cleared together with altRun altRun.m_arrItems.clear(); } else if ( L"mc:Fallback" == sName ) { //if (m_oChoiceRequires.is_init() && !m_arrChoiceItems.empty()) //{ - // continue; // не зачем баласт читать - берем более современную или оригинальную версию. + // continue; // no need to read ballast - take the more modern or original version. //} CRun altRun; @@ -110,7 +110,7 @@ namespace OOX } } - //без RemoveAll они очистятся вместе с altRun + //without RemoveAll they will be cleared together with altRun altRun.m_arrItems.clear(); } } diff --git a/OOXML/DocxFormat/Logic/Annotations.cpp b/OOXML/DocxFormat/Logic/Annotations.cpp index ce5e672eab..e8591f67f0 100644 --- a/OOXML/DocxFormat/Logic/Annotations.cpp +++ b/OOXML/DocxFormat/Logic/Annotations.cpp @@ -44,7 +44,7 @@ #include "../../Common/SimpleTypes_Word.h" -// TO DO: Нехватающие классы: +// TO DO: Missing classes: // <w:customXml> // <w:subDoc> @@ -175,7 +175,7 @@ namespace OOX } void CCustomXmlDelRangeEnd::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, L"w:id", m_oId ) WritingElement_ReadAttributes_End( oReader ) @@ -284,7 +284,7 @@ namespace OOX } void CCustomXmlInsRangeEnd::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, L"w:id", m_oId ) WritingElement_ReadAttributes_End( oReader ) @@ -568,7 +568,7 @@ namespace OOX } void CCustomXmlMoveToRangeStart::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, L"w:author", m_sAuthor ) WritingElement_ReadAttributes_Read_else_if( oReader, L"w:date", m_oDate ) @@ -612,7 +612,7 @@ namespace OOX } void CMoveFromRangeEnd::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, L"w:displacedbyCustomXml", m_oDisplacedByCustomXml ) WritingElement_ReadAttributes_Read_else_if( oReader, L"w:id", m_oId ) @@ -684,7 +684,7 @@ namespace OOX } void CMoveFromRangeStart::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, L"w:author", m_sAuthor ) WritingElement_ReadAttributes_Read_else_if( oReader, L"w:colFirst", m_oColFirst ) @@ -1198,7 +1198,7 @@ namespace OOX } void CPermEnd::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, L"w:displacedbyCustomXml", m_oDisplacedByCustomXml ) WritingElement_ReadAttributes_Read_else_if( oReader, L"w:id", m_sId ) @@ -1296,7 +1296,7 @@ namespace OOX } void CProofErr::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, L"w:type", m_oType ) WritingElement_ReadAttributes_End( oReader ) @@ -1414,7 +1414,7 @@ namespace OOX } void CIns::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if( oReader, L"w:author", m_sAuthor ) WritingElement_ReadAttributes_Read_else_if( oReader, L"w:date", m_oDate ) @@ -1533,7 +1533,7 @@ namespace OOX } void CDel::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if( oReader, L"w:author", m_sAuthor ) WritingElement_ReadAttributes_Read_else_if( oReader, L"w:date", m_oDate ) diff --git a/OOXML/DocxFormat/Logic/Bdo.cpp b/OOXML/DocxFormat/Logic/Bdo.cpp index cd459a7824..335546f3a1 100644 --- a/OOXML/DocxFormat/Logic/Bdo.cpp +++ b/OOXML/DocxFormat/Logic/Bdo.cpp @@ -41,7 +41,7 @@ #include "../Math/oMathPara.h" #include "../Math/OMath.h" -// TO DO: Нехватающие классы: +// TO DO: Missing classes: // <w:customXml> // <w:moveFrom> // <w:moveTo> @@ -280,7 +280,7 @@ namespace OOX void CBdo::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, _T("w:val"), m_oVal ) WritingElement_ReadAttributes_End( oReader ) diff --git a/OOXML/DocxFormat/Logic/FldSimple.cpp b/OOXML/DocxFormat/Logic/FldSimple.cpp index 8c6def7ded..5e850eda0a 100644 --- a/OOXML/DocxFormat/Logic/FldSimple.cpp +++ b/OOXML/DocxFormat/Logic/FldSimple.cpp @@ -44,7 +44,7 @@ #include "../Math/oMathPara.h" #include "../Math/OMath.h" -// TO DO: Нехватающие классы: +// TO DO: Missing classes: // <w:customXml> // <w:moveFrom> // <w:moveTo> diff --git a/OOXML/DocxFormat/Logic/Hyperlink.cpp b/OOXML/DocxFormat/Logic/Hyperlink.cpp index c256aa3171..dc28493b76 100644 --- a/OOXML/DocxFormat/Logic/Hyperlink.cpp +++ b/OOXML/DocxFormat/Logic/Hyperlink.cpp @@ -48,7 +48,7 @@ #include "../../Common/ComplexTypes.h" -// TO DO: Нехватающие классы: +// TO DO: Missing classes: // <w:customXml> // <w:moveFrom> // <w:moveTo> diff --git a/OOXML/DocxFormat/Logic/Paragraph.cpp b/OOXML/DocxFormat/Logic/Paragraph.cpp index 347854242e..a349db648d 100644 --- a/OOXML/DocxFormat/Logic/Paragraph.cpp +++ b/OOXML/DocxFormat/Logic/Paragraph.cpp @@ -51,7 +51,7 @@ #include "../../Common/SimpleTypes_Word.h" -// TO DO: Нехватающие классы: +// TO DO: Missing classes: // <w:customXml> // <w:moveFrom> // <w:moveTo> @@ -328,7 +328,7 @@ namespace OOX else if (L"permStart" == sName ) pItem = new CPermStart( document ); else if (L"pPr" == sName ) - {// c копией .. для быстрого доступа/анализа + {// with a copy .. for quick access/analysis if (m_oParagraphProperty) { CParagraphProperty prop2(document); diff --git a/OOXML/DocxFormat/Logic/Paragraph.h b/OOXML/DocxFormat/Logic/Paragraph.h index 3284cf8e07..a2499e0685 100644 --- a/OOXML/DocxFormat/Logic/Paragraph.h +++ b/OOXML/DocxFormat/Logic/Paragraph.h @@ -77,8 +77,8 @@ namespace OOX nullable<SimpleTypes::CLongHexNumber> m_oRsidRDefault; nullable<SimpleTypes::CLongHexNumber> m_oRsidRPr; - CParagraphProperty *m_oParagraphProperty; // копия того что в m_arrItems... - для быстрого доступа/анализа - // по идее нужно сделать как в Drawing::Paragraph - то есть единственные подобъекты вынести отдельно + CParagraphProperty *m_oParagraphProperty; // copy of what's in m_arrItems... - for quick access/analysis + // ideally should be done like in Drawing::Paragraph - i.e. move single sub-objects separately WritingElement *m_oParent = NULL; }; } // namespace Logic diff --git a/OOXML/DocxFormat/Logic/ParagraphProperty.cpp b/OOXML/DocxFormat/Logic/ParagraphProperty.cpp index 346700e229..339168c044 100644 --- a/OOXML/DocxFormat/Logic/ParagraphProperty.cpp +++ b/OOXML/DocxFormat/Logic/ParagraphProperty.cpp @@ -527,7 +527,7 @@ namespace OOX m_oWidowControl.IsInit() || m_oWordWrap.IsInit() ); } void CParagraphProperty::fromXML(XmlUtils::CXmlNode& oNode) - {//??? где используется ? + {//??? where is this used? if ( L"w:pPr" != oNode.GetName() ) return; @@ -663,7 +663,7 @@ namespace OOX doc->m_arrSections.push_back(section); } doc->m_arrSections.back().sect = m_oSectPr.GetPointer(); - doc->m_arrSections.back().end_elm = doc->m_arrItems.size() + 1; // порядок выше - сначала читаем, потом добавляем + doc->m_arrSections.back().end_elm = doc->m_arrItems.size() + 1; // order above - first read, then add OOX::CDocument::_section section; section.start_elm = doc->m_arrItems.size() + 1; diff --git a/OOXML/DocxFormat/Logic/Pict.cpp b/OOXML/DocxFormat/Logic/Pict.cpp index 11368b1881..6c0700ea18 100644 --- a/OOXML/DocxFormat/Logic/Pict.cpp +++ b/OOXML/DocxFormat/Logic/Pict.cpp @@ -187,7 +187,7 @@ namespace OOX return; m_sXml.Init(); - *m_sXml = oNode.GetXml(); //для pptx dll + *m_sXml = oNode.GetXml(); //for pptx dll fromStringXML(m_sXml.get()); } @@ -197,7 +197,7 @@ namespace OOX return; m_sXml.Init(); - *m_sXml = oReader.GetOuterXml(); //для pptx dll + *m_sXml = oReader.GetOuterXml(); //for pptx dll fromStringXML(m_sXml.get()); } @@ -558,10 +558,10 @@ namespace OOX return; m_sXml.Init(); - *m_sXml = oReader.GetOuterXml(); //для pptx dll + *m_sXml = oReader.GetOuterXml(); //for pptx dll - //альтернатива pptx - std::wstring sXml; //??? + ole наверно что то (лень ...) + //pptx alternative + std::wstring sXml; //??? + ole probably something (too lazy to check...) sXml += L"<root \ xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \ xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \ @@ -654,7 +654,7 @@ xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\"> break; - case 'O':// собственно это и есть самый главный под-объект + case 'O':// this is actually the main sub-object if (L"o:OLEObject" == sName) m_oOleObject = oSubReader; break; diff --git a/OOXML/DocxFormat/Logic/Pict.h b/OOXML/DocxFormat/Logic/Pict.h index a0973e18fe..47c982f797 100644 --- a/OOXML/DocxFormat/Logic/Pict.h +++ b/OOXML/DocxFormat/Logic/Pict.h @@ -123,7 +123,7 @@ namespace OOX nullable<OOX::WritingElement> m_oShapeElement; nullable<OOX::VmlOffice::COLEObject> m_oOLEObject; - // TO DO: Добавить класс, читающий movie + // TO DO: Add class for reading movie }; //-------------------------------------------------------------------------------- diff --git a/OOXML/DocxFormat/Logic/Run.h b/OOXML/DocxFormat/Logic/Run.h index fe9c8738f9..c4affe0993 100644 --- a/OOXML/DocxFormat/Logic/Run.h +++ b/OOXML/DocxFormat/Logic/Run.h @@ -76,8 +76,8 @@ namespace OOX nullable<SimpleTypes::CLongHexNumber> m_oRsidDel; nullable<SimpleTypes::CLongHexNumber> m_oRsidR; nullable<SimpleTypes::CLongHexNumber> m_oRsidRPr; - OOX::Logic::CRunProperty *m_oRunProperty; // копия того что в m_arrItems... - для быстрого доступа/анализа - // по идее нужно сделать как в Drawing::Run - то есть единственные подобъекты вынести отдельно + OOX::Logic::CRunProperty *m_oRunProperty; // copy of what's in m_arrItems... - for quick access/analysis + // ideally should be done like in Drawing::Run - i.e. move single sub-objects separately WritingElement *m_oParent = NULL; }; } // namespace Logic diff --git a/OOXML/DocxFormat/Logic/RunContent.h b/OOXML/DocxFormat/Logic/RunContent.h index a83211adb0..05f1bed3e3 100644 --- a/OOXML/DocxFormat/Logic/RunContent.h +++ b/OOXML/DocxFormat/Logic/RunContent.h @@ -36,7 +36,7 @@ #include "../../Common/ComplexTypes.h" -// 2. Класс CRuby 17.3.3.25 +// 2. CRuby class 17.3.3.25 namespace PPTX { diff --git a/OOXML/DocxFormat/Logic/RunProperty.cpp b/OOXML/DocxFormat/Logic/RunProperty.cpp index aa1fac8740..24d2300d6f 100644 --- a/OOXML/DocxFormat/Logic/RunProperty.cpp +++ b/OOXML/DocxFormat/Logic/RunProperty.cpp @@ -318,8 +318,8 @@ namespace OOX m_oFontName = oReader; else if ( !m_bRPRChange && L"w:rPrChange" == sName ) m_oRPrChange = oReader; - // В спецификации почему-то написано pStyle, хотя по смыслы, по ссылке в самой - // же спецификации и, в конце концов, по алфавиту тут толжно быть rStyle + // For some reason the specification says pStyle, but by meaning, by reference in the + // same specification, and finally by alphabetical order, it should be rStyle here else if ( L"w:rStyle" == sName ) m_oRStyle = oReader; else if ( !m_oRStyle.IsInit() && L"w:pStyle" == sName ) @@ -490,8 +490,8 @@ namespace OOX if ( !m_bRPRChange && oNode.GetNode( L"w:rPrChange", oChild ) ) m_oRPrChange = oChild; - // В спецификации почему-то написано pStyle, хотя по смыслы, по ссылке в самой - // же спецификации и, в конце концов, по алфавиту тут толжно быть rStyle + // For some reason the specification says pStyle, but by meaning, by reference in the + // same specification, and finally by alphabetical order, it should be rStyle here if ( oNode.GetNode( L"w:rStyle", oChild ) ) m_oRStyle = oChild; diff --git a/OOXML/DocxFormat/Logic/RunProperty.h b/OOXML/DocxFormat/Logic/RunProperty.h index 6eac0099a6..f35211fb30 100644 --- a/OOXML/DocxFormat/Logic/RunProperty.h +++ b/OOXML/DocxFormat/Logic/RunProperty.h @@ -125,7 +125,7 @@ namespace OOX } static const CRunProperty Merge(const CRunProperty& oPrev, const CRunProperty& oCurrent); - bool m_bRPRChange = false; // Является ли данный w:rPr дочерним по отношению к w:rPrChange + bool m_bRPRChange = false; // Is this w:rPr a child of w:rPrChange nullable<ComplexTypes::Word::COnOff2> m_oBold; nullable<ComplexTypes::Word::COnOff2> m_oBoldCs; diff --git a/OOXML/DocxFormat/Logic/Sdt.cpp b/OOXML/DocxFormat/Logic/Sdt.cpp index 1382d12fc9..47c8fee0d6 100644 --- a/OOXML/DocxFormat/Logic/Sdt.cpp +++ b/OOXML/DocxFormat/Logic/Sdt.cpp @@ -45,7 +45,7 @@ #include "../Math/oMathPara.h" #include "../Math/OMath.h" -// TO DO: Нехватающие классы: +// TO DO: Missing classes: // <w:customXml> // <w:moveFrom> // <w:moveTo> diff --git a/OOXML/DocxFormat/Logic/SectionProperty.cpp b/OOXML/DocxFormat/Logic/SectionProperty.cpp index 785c9ab18a..2494dd1fc1 100644 --- a/OOXML/DocxFormat/Logic/SectionProperty.cpp +++ b/OOXML/DocxFormat/Logic/SectionProperty.cpp @@ -146,7 +146,7 @@ namespace ComplexTypes { } void CHdrFtrRef::FromXML(XmlUtils::CXmlNode& oNode) - {//todooo переделать на перебор всех и без неймспейсов + {//todooo refactor to iterate over all without namespaces XmlMacroReadAttributeBase( oNode, L"r:id", m_oId ); XmlMacroReadAttributeBase( oNode, L"w:type", m_oType ); @@ -1819,7 +1819,7 @@ namespace OOX } const CSectionProperty CSectionProperty::Merge(const CSectionProperty& oPrev, const CSectionProperty& oCurrent) { - // ??? ну не хорошо это + // ??? this is not good return oPrev; } diff --git a/OOXML/DocxFormat/Logic/Shape.cpp b/OOXML/DocxFormat/Logic/Shape.cpp index 90f54a8548..51810b00b7 100644 --- a/OOXML/DocxFormat/Logic/Shape.cpp +++ b/OOXML/DocxFormat/Logic/Shape.cpp @@ -72,7 +72,7 @@ namespace OOX } void CTxbxContent::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CTxbxContent::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CTxbxContent::fromXML(XmlUtils::CXmlNode& oNode) } void CTxbxContent::fromXML(XmlUtils::CXmlLiteReader& oReader) { diff --git a/OOXML/DocxFormat/Logic/SmartTag.cpp b/OOXML/DocxFormat/Logic/SmartTag.cpp index 09ec1375b4..1dda096585 100644 --- a/OOXML/DocxFormat/Logic/SmartTag.cpp +++ b/OOXML/DocxFormat/Logic/SmartTag.cpp @@ -45,7 +45,7 @@ #include "../Math/OMath.h" -// TO DO: Нехватающие классы: +// TO DO: Missing classes: // <w:customXml> // <w:moveFrom> // <w:moveTo> diff --git a/OOXML/DocxFormat/Logic/Table.cpp b/OOXML/DocxFormat/Logic/Table.cpp index 0ffabd11e5..c14f1ddea0 100644 --- a/OOXML/DocxFormat/Logic/Table.cpp +++ b/OOXML/DocxFormat/Logic/Table.cpp @@ -78,7 +78,7 @@ namespace ComplexTypes } void CTblGridCol::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, L"w:w", m_oW ) WritingElement_ReadAttributes_End( oReader ) @@ -281,7 +281,7 @@ namespace OOX // CTbl 17.4.38 (Part 1) //-------------------------------------------------------------------------------- -// TO DO: Нехватающие классы: +// TO DO: Missing classes: // <w:customXml> // <w:moveFrom> // <w:moveTo> @@ -538,7 +538,7 @@ namespace OOX // CTr 17.4.79 (Part 1) //-------------------------------------------------------------------------------- -// TO DO: Нехватающие классы: +// TO DO: Missing classes: // <w:customXml> // <w:moveFrom> // <w:moveTo> @@ -854,7 +854,7 @@ namespace OOX // CTc 17.4.66 (Part 1) //-------------------------------------------------------------------------------- -// TO DO: Нехватающие классы: +// TO DO: Missing classes: // <w:customXml> // <w:moveFrom> // <w:moveTo> diff --git a/OOXML/DocxFormat/Logic/Table.h b/OOXML/DocxFormat/Logic/Table.h index 5b490d9c50..a8ecc61b8a 100644 --- a/OOXML/DocxFormat/Logic/Table.h +++ b/OOXML/DocxFormat/Logic/Table.h @@ -378,7 +378,7 @@ namespace OOX int m_nCountRow; nullable<OOX::Logic::CTblGrid> m_oTblGrid; - OOX::Logic::CTableProperty* m_oTableProperties; //todooo - выкинуть из m_arrItems, переделать на nullable<> + OOX::Logic::CTableProperty* m_oTableProperties; //todooo - remove from m_arrItems, refactor to nullable<> }; //-------------------------------------------------------------------------------- @@ -412,7 +412,7 @@ namespace OOX nullable<SimpleTypes::CLongHexNumber> m_oRsidRPr; nullable<SimpleTypes::CLongHexNumber> m_oRsidTr; - OOX::Logic::CTableRowProperties* m_pTableRowProperties; //todooo - выкинуть из m_arrItems, переделать на nullable<> + OOX::Logic::CTableRowProperties* m_pTableRowProperties; //todooo - remove from m_arrItems, refactor to nullable<> }; //-------------------------------------------------------------------------------- @@ -439,9 +439,9 @@ namespace OOX void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: - int m_nNumCol; // Номер колонки + int m_nNumCol; // Column number nullable<std::wstring> m_sId; - OOX::Logic::CTableCellProperties* m_pTableCellProperties; //todooo - выкинуть из m_arrItems, переделать на nullable<> + OOX::Logic::CTableCellProperties* m_pTableCellProperties; //todooo - remove from m_arrItems, refactor to nullable<> }; } // namespace Logic diff --git a/OOXML/DocxFormat/Logic/TableProperty.cpp b/OOXML/DocxFormat/Logic/TableProperty.cpp index ebdcaea3f3..07672fa5b0 100644 --- a/OOXML/DocxFormat/Logic/TableProperty.cpp +++ b/OOXML/DocxFormat/Logic/TableProperty.cpp @@ -88,7 +88,7 @@ namespace ComplexTypes } void CCellMergeTrackChange::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, L"w:author", m_sAuthor ) WritingElement_ReadAttributes_Read_else_if( oReader, L"w:date", m_oDate ) @@ -130,7 +130,7 @@ namespace ComplexTypes } void CHMerge::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, L"w:val", m_oVal ) WritingElement_ReadAttributes_End( oReader ) @@ -167,7 +167,7 @@ namespace ComplexTypes } void CVMerge::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, L"w:val", m_oVal ) WritingElement_ReadAttributes_End( oReader ) @@ -249,7 +249,7 @@ namespace ComplexTypes } void CJcTable::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, L"w:val", m_oVal ) WritingElement_ReadAttributes_End( oReader ) @@ -291,7 +291,7 @@ namespace ComplexTypes } void CTblLayoutType::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, L"w:type", m_oType ) WritingElement_ReadAttributes_End( oReader ) @@ -493,7 +493,7 @@ namespace ComplexTypes } void CTblLook::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, L"w:firstColumn", m_oFirstColumn ) WritingElement_ReadAttributes_Read_else_if( oReader, L"w:firstRow", m_oFirstRow ) @@ -521,7 +521,7 @@ namespace ComplexTypes } void CTblOverlap::FromXML(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, L"w:val", m_oVal ) WritingElement_ReadAttributes_End( oReader ) @@ -685,7 +685,7 @@ namespace ComplexTypes } void CTblPPr::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, L"w:bottomFromText", m_oBottomFromText ) WritingElement_ReadAttributes_Read_else_if( oReader, L"w:horzAnchor", m_oHorzAnchor ) @@ -1826,7 +1826,7 @@ namespace OOX WritingElement_ReadNode( oNode, oChild, L"w:headers", m_oHeaders ); WritingElement_ReadNode( oNode, oChild, L"w:hideMark", m_oHideMark ); - // В списке аттрибутов написано "hMerge", а в примере "hmerge" + // In the attribute list it says "hMerge", but in the example "hmerge" WritingElement_ReadNode( oNode, oChild, L"w:hmerge", m_oHMerge ); if ( !m_oHMerge.IsInit() ) WritingElement_ReadNode( oNode, oChild, L"w:hMerge", m_oHMerge ); @@ -1844,7 +1844,7 @@ namespace OOX WritingElement_ReadNode( oNode, oChild, L"w:textDirection", m_oTextDirection ); WritingElement_ReadNode( oNode, oChild, L"w:vAlign", m_oVAlign ); - // В списке аттрибутов написано "vMerge", а в примере "vmerge" + // In the attribute list it says "vMerge", but in the example "vmerge" WritingElement_ReadNode( oNode, oChild, L"w:vmerge", m_oVMerge ); if ( !m_oVMerge.IsInit() ) WritingElement_ReadNode( oNode, oChild, L"w:vMerge", m_oVMerge ); diff --git a/OOXML/DocxFormat/Logic/Vml.cpp b/OOXML/DocxFormat/Logic/Vml.cpp index 37a5c8972a..af8ad5a78b 100644 --- a/OOXML/DocxFormat/Logic/Vml.cpp +++ b/OOXML/DocxFormat/Logic/Vml.cpp @@ -585,7 +585,7 @@ namespace OOX CArc::~CArc(){} void CArc::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CArc::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CArc::fromXML(XmlUtils::CXmlNode& oNode) } void CArc::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -615,7 +615,7 @@ namespace OOX } void CArc::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes if ( oReader.GetAttributesCount() <= 0 ) return; @@ -654,7 +654,7 @@ namespace OOX CCurve::~CCurve(){} void CCurve::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CCurve::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CCurve::fromXML(XmlUtils::CXmlNode& oNode) } void CCurve::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -685,7 +685,7 @@ namespace OOX } void CCurve::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes if ( oReader.GetAttributesCount() <= 0 ) return; @@ -731,7 +731,7 @@ namespace OOX } void CF::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CF::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CF::fromXML(XmlUtils::CXmlNode& oNode) } void CF::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -775,7 +775,7 @@ namespace OOX } oReader.MoveToElement(); - // TO DO: Сделать парсер формул ( или использовать уже сделанный парсер в OfficeDrawing\Shapes) + // TO DO: Implement formula parser (or use already existing parser in OfficeDrawing\Shapes) } //-------------------------------------------------------------------------------- @@ -896,10 +896,10 @@ namespace OOX } void CPolyLine::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Выставляем значения по умолчанию + // Set default values m_oPoints.SetDelimiter( ' ' ); - // Читаем атрибуты + // Read attributes if ( oReader.GetAttributesCount() <= 0 ) return; @@ -948,7 +948,7 @@ namespace OOX CRect::~CRect(){} void CRect::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CRect::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CRect::fromXML(XmlUtils::CXmlNode& oNode) } void CRect::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -983,7 +983,7 @@ namespace OOX CRoundRect::~CRoundRect(){} void CRoundRect::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CRoundRect::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CRoundRect::fromXML(XmlUtils::CXmlNode& oNode) } void CRoundRect::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1011,10 +1011,10 @@ namespace OOX } void CRoundRect::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Выставляем значения по умолчанию + // Set default values m_oArcSize.SetPercentage( 20 ); - // Читаем атрибуты + // Read attributes if ( oReader.GetAttributesCount() <= 0 ) return; @@ -1216,7 +1216,7 @@ namespace OOX } oReader.MoveToElement(); - // TO DO: Сделать парсер Adj + // TO DO: Implement Adj parser } std::wstring CShape::toXML() const { @@ -1412,7 +1412,7 @@ namespace OOX if (_T("adj") == wsName) m_sAdj = oReader.GetText(); break; case 't': - if (_T("type") == wsName) m_sType = oReader.GetText(); // для некоторых багнутых файлов + if (_T("type") == wsName) m_sType = oReader.GetText(); // for some buggy files break; } @@ -1423,7 +1423,7 @@ namespace OOX } oReader.MoveToElement(); - // TO DO: Сделать парсер Adj + // TO DO: Implement Adj parser } std::wstring CShapeType::toXML() const { @@ -1478,7 +1478,7 @@ namespace OOX } void CClientData::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CShapeType::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CShapeType::fromXML(XmlUtils::CXmlNode& oNode) } void CClientData::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1786,7 +1786,7 @@ namespace OOX } void CTextbox::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CTextbox::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CTextbox::fromXML(XmlUtils::CXmlNode& oNode) } EElementType CTextbox::getType() const { @@ -1851,11 +1851,11 @@ namespace OOX } void CTextbox::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Выставляем значения по умолчанию + // Set default values m_oInset.Init(); m_oInset->Set(7.2, 3.6, 7.2, 3.6 ); - // Читаем атрибуты + // Read attributes if ( oReader.GetAttributesCount() <= 0 ) return; @@ -1900,7 +1900,7 @@ namespace OOX } void CTextPath::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CTextPath::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CTextPath::fromXML(XmlUtils::CXmlNode& oNode) } void CTextPath::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1997,7 +1997,7 @@ namespace OOX } void CFill::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CFill::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CFill::fromXML(XmlUtils::CXmlNode& oNode) } void CFill::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -2179,7 +2179,7 @@ namespace OOX } void CBackground::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CBackground::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CBackground::fromXML(XmlUtils::CXmlNode& oNode) } void CBackground::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -2227,7 +2227,7 @@ namespace OOX } void CFormulas::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CFormulas::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CFormulas::fromXML(XmlUtils::CXmlNode& oNode) } void CFormulas::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -2278,7 +2278,7 @@ namespace OOX } void CStroke::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CStroke::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CStroke::fromXML(XmlUtils::CXmlNode& oNode) } void CStroke::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -2385,7 +2385,7 @@ namespace OOX } oReader.MoveToElement(); - // TO DO: Сделать парсер формул ( или использовать уже сделанный парсер в OfficeDrawing\Shapes) + // TO DO: Implement formula parser (or use already existing parser in OfficeDrawing\Shapes) } std::wstring CStroke::toXML() const { @@ -2498,7 +2498,7 @@ namespace OOX } void CPath::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CPath::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CPath::fromXML(XmlUtils::CXmlNode& oNode) } void CPath::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -2586,7 +2586,7 @@ namespace OOX } oReader.MoveToElement(); - // TO DO: Сделать парсер параметров connectangles, connectlocs + // TO DO: Implement parser for connectangles, connectlocs parameters } std::wstring CPath::toXML() const { @@ -2644,7 +2644,7 @@ namespace OOX CImage::~CImage(){} void CImage::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CImage::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CImage::fromXML(XmlUtils::CXmlNode& oNode) } void CImage::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -2757,7 +2757,7 @@ namespace OOX } void CImageData::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CImageData::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CImageData::fromXML(XmlUtils::CXmlNode& oNode) } void CImageData::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -2945,7 +2945,7 @@ namespace OOX CLine::~CLine(){} void CLine::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CLine::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CLine::fromXML(XmlUtils::CXmlNode& oNode) } void CLine::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -2974,11 +2974,11 @@ namespace OOX } void CLine::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Выставляем значения по умолчанию + // Set default values m_oFrom.SetValue( 0, 0 ); m_oTo.SetValue( 10, 10 ); - // Читаем атрибуты + // Read attributes if ( oReader.GetAttributesCount() <= 0 ) return; @@ -3018,7 +3018,7 @@ namespace OOX COval::~COval(){} void COval::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать COval::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement COval::fromXML(XmlUtils::CXmlNode& oNode) } void COval::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -3055,7 +3055,7 @@ namespace OOX } void CH::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CH::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CH::fromXML(XmlUtils::CXmlNode& oNode) } void CH::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -3165,7 +3165,7 @@ namespace OOX } void CHandles::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CHandles::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CHandles::fromXML(XmlUtils::CXmlNode& oNode) } void CHandles::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -3215,7 +3215,7 @@ namespace OOX } void CShapeDefaults::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CShapeDefaults::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CShapeDefaults::fromXML(XmlUtils::CXmlNode& oNode) } void CShapeDefaults::fromXML(XmlUtils::CXmlLiteReader& oReader) { diff --git a/OOXML/DocxFormat/Logic/VmlOfficeDrawing.cpp b/OOXML/DocxFormat/Logic/VmlOfficeDrawing.cpp index 7434f5faf8..c8810d2ff2 100644 --- a/OOXML/DocxFormat/Logic/VmlOfficeDrawing.cpp +++ b/OOXML/DocxFormat/Logic/VmlOfficeDrawing.cpp @@ -51,7 +51,7 @@ namespace OOX void CStrokeChild::fromXML(XmlUtils::CXmlNode& oNode) { m_eType = et_Unknown; - // TO DO: Реализовать CStrokeChild::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CStrokeChild::fromXML(XmlUtils::CXmlNode& oNode) } void CStrokeChild::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -171,7 +171,7 @@ namespace OOX } void CCallout::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CCallout::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CCallout::fromXML(XmlUtils::CXmlNode& oNode) } void CCallout::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -239,7 +239,7 @@ namespace OOX } void CClipPath::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CClipPath::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CClipPath::fromXML(XmlUtils::CXmlNode& oNode) } void CClipPath::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -276,7 +276,7 @@ namespace OOX } void CColorMenu::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CColorMenu::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CColorMenu::fromXML(XmlUtils::CXmlNode& oNode) } void CColorMenu::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -304,7 +304,7 @@ namespace OOX } void CColorMenu::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Устанавливаем значения по умолчанию + // Set default values m_oExtrusionColor = L"#000000"; m_oFillColor = L"#0000FF"; m_oShadowColor = L"#80800C"; @@ -337,7 +337,7 @@ namespace OOX } void CColorMru::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CColorMru::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CColorMru::fromXML(XmlUtils::CXmlNode& oNode) } void CColorMru::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -371,10 +371,10 @@ namespace OOX } void CColorMru::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Устанавливаем значения по умолчанию + // Set default values std::wstring sColors; - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, L"v:ext", m_oExt ) WritingElement_ReadAttributes_Read_else_if( oReader, L"colors", sColors ) @@ -420,7 +420,7 @@ namespace OOX } void CComplex::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CComplex::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CComplex::fromXML(XmlUtils::CXmlNode& oNode) } void CComplex::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -460,7 +460,7 @@ namespace OOX } void CRelation::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CRelation::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CRelation::fromXML(XmlUtils::CXmlNode& oNode) } void CRelation::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -488,7 +488,7 @@ namespace OOX } void CRelation::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, L"v:ext", m_oExt ) WritingElement_ReadAttributes_Read_else_if( oReader, L"idcntr", m_sIdCntr ) @@ -515,7 +515,7 @@ namespace OOX } void CRelationTable::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CRelationTable::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CRelationTable::fromXML(XmlUtils::CXmlNode& oNode) } void CRelationTable::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -577,7 +577,7 @@ namespace OOX } void CDiagram::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CDiagram::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CDiagram::fromXML(XmlUtils::CXmlNode& oNode) } void CDiagram::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -650,7 +650,7 @@ namespace OOX } void CEntry::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CEntry::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CEntry::fromXML(XmlUtils::CXmlNode& oNode) } void CEntry::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -694,7 +694,7 @@ namespace OOX } void CEquationXml::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CEquationXml::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CEquationXml::fromXML(XmlUtils::CXmlNode& oNode) } void CEquationXml::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -708,7 +708,7 @@ namespace OOX { std::wstring sName = oReader.GetName(); - // TO DO: Сделать чтение формул OOMML и Wc3MathML + // TO DO: Implement reading of OOMML and Wc3MathML formulas } } std::wstring CEquationXml::toXML() const @@ -744,7 +744,7 @@ namespace OOX } void CExtrusion::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CExtrusion::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CExtrusion::fromXML(XmlUtils::CXmlNode& oNode) } void CExtrusion::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -865,7 +865,7 @@ namespace OOX } void CExtrusion::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Устанавливаем значения по умолчанию + // Set default values m_oBackDepth.SetValue( 36 ); m_oBrightness.SetValue( 0.3 ); @@ -933,7 +933,7 @@ namespace OOX } void CFieldCodes::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CFieldCodes::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CFieldCodes::fromXML(XmlUtils::CXmlNode& oNode) } void CFieldCodes::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -964,7 +964,7 @@ namespace OOX } void CFill::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CFill::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CFill::fromXML(XmlUtils::CXmlNode& oNode) } void CFill::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1008,7 +1008,7 @@ namespace OOX } void CIdMap::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CIdMap::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CIdMap::fromXML(XmlUtils::CXmlNode& oNode) } void CIdMap::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1052,7 +1052,7 @@ namespace OOX } void CInk::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CInk::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CInk::fromXML(XmlUtils::CXmlNode& oNode) } void CInk::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1098,7 +1098,7 @@ namespace OOX } void CLinkType::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CLinkType::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CLinkType::fromXML(XmlUtils::CXmlNode& oNode) } void CLinkType::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1130,7 +1130,7 @@ namespace OOX } void CLock::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CLock::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CLock::fromXML(XmlUtils::CXmlNode& oNode) } void CLock::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1216,7 +1216,7 @@ namespace OOX } void CLockedField::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CLockedField::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CLockedField::fromXML(XmlUtils::CXmlNode& oNode) } void CLockedField::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1359,7 +1359,7 @@ namespace OOX } void CProxy::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CProxy::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CProxy::fromXML(XmlUtils::CXmlNode& oNode) } void CProxy::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1411,7 +1411,7 @@ namespace OOX } void CR::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CR::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CR::fromXML(XmlUtils::CXmlNode& oNode) } void CR::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1458,7 +1458,7 @@ namespace OOX } void CR::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, L"how", m_oHow ) WritingElement_ReadAttributes_Read_else_if( oReader, L"id", m_sId ) @@ -1485,7 +1485,7 @@ namespace OOX } void CRegroupTable::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CRegroupTable::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CRegroupTable::fromXML(XmlUtils::CXmlNode& oNode) } void CRegroupTable::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1530,7 +1530,7 @@ namespace OOX } void CRegroupTable::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, L"v:ext", m_oExt ) WritingElement_ReadAttributes_End( oReader ) @@ -1554,7 +1554,7 @@ namespace OOX } void CRules::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CRules::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CRules::fromXML(XmlUtils::CXmlNode& oNode) } void CRules::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1599,7 +1599,7 @@ namespace OOX } void CRules::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, L"v:ext", m_oExt ) WritingElement_ReadAttributes_End( oReader ) @@ -1617,7 +1617,7 @@ namespace OOX } void CShapeLayout::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CShapeLayout::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CShapeLayout::fromXML(XmlUtils::CXmlNode& oNode) } void CShapeLayout::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1665,7 +1665,7 @@ namespace OOX } void CShapeLayout::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, L"v:ext", m_oExt ) WritingElement_ReadAttributes_End( oReader ) @@ -1871,7 +1871,7 @@ namespace OOX } void CSignatureLine::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, L"o:addlxml", m_sAddXml ) WritingElement_ReadAttributes_Read_else_if( oReader, L"allowcomments", m_oAllowComments ) @@ -1901,7 +1901,7 @@ namespace OOX } void CSkew::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CSkew::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CSkew::fromXML(XmlUtils::CXmlNode& oNode) } void CSkew::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1934,7 +1934,7 @@ namespace OOX } void CSkew::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, L"v:ext", m_oExt ) WritingElement_ReadAttributes_Read_else_if( oReader, L"id", m_sId ) @@ -1944,7 +1944,7 @@ namespace OOX WritingElement_ReadAttributes_Read_else_if( oReader, L"origin", m_sOrigin ) WritingElement_ReadAttributes_End( oReader ) - // TO DO: OOX::Vml::CSkew сделать нормальный парсер параметров + // TO DO: OOX::Vml::CSkew implement proper parameter parser } } // namespace Vml diff --git a/OOXML/DocxFormat/Logic/VmlWord.cpp b/OOXML/DocxFormat/Logic/VmlWord.cpp index b1558ac2a7..0ff73344d6 100644 --- a/OOXML/DocxFormat/Logic/VmlWord.cpp +++ b/OOXML/DocxFormat/Logic/VmlWord.cpp @@ -78,7 +78,7 @@ namespace OOX void CBorder::fromXML(XmlUtils::CXmlNode& oNode) { m_eType = et_Unknown; - // TO DO: Реализовать CBorder::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CBorder::fromXML(XmlUtils::CXmlNode& oNode) } void CBorder::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -151,7 +151,7 @@ namespace OOX } void CWrap::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CWrap::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CWrap::fromXML(XmlUtils::CXmlNode& oNode) } void CWrap::fromXML(XmlUtils::CXmlLiteReader& oReader) { diff --git a/OOXML/DocxFormat/Math/oMath.cpp b/OOXML/DocxFormat/Math/oMath.cpp index c6d25f0dc4..3410cf2584 100644 --- a/OOXML/DocxFormat/Math/oMath.cpp +++ b/OOXML/DocxFormat/Math/oMath.cpp @@ -31,7 +31,7 @@ */ #include "oMathPara.h" -// TO DO: Нехватающие классы: +// TO DO: Missing classes: // <w:moveFrom> // <w:moveTo> @@ -354,7 +354,7 @@ namespace OOX return m_eType; } std::wstring CMathArgNodes::GetMathNodeName(const EElementType & enumType) const - {//todooo вытащить в одно место - пересекается с MathBottomNodes + {//todooo extract to one place - overlaps with MathBottomNodes switch(enumType) { case OOX::et_m_deg: return L"m:deg"; diff --git a/OOXML/DocxFormat/Math/oMathBottomNodes.h b/OOXML/DocxFormat/Math/oMathBottomNodes.h index 19c9c7653f..b269530dfa 100644 --- a/OOXML/DocxFormat/Math/oMathBottomNodes.h +++ b/OOXML/DocxFormat/Math/oMathBottomNodes.h @@ -238,7 +238,7 @@ namespace OOX WritingElement_ReadAttributes_End( oReader ) } std::wstring GetMathNodeName(const EElementType & enumType) const - {//todooo вытащить в одно место - пересекается с MathArgNodes + {//todooo extract to one place - overlaps with MathArgNodes switch(enumType) { case OOX::et_m_deg: return L"m:deg"; diff --git a/OOXML/DocxFormat/Math/oMathContent.cpp b/OOXML/DocxFormat/Math/oMathContent.cpp index 551abbdbbd..929e2b3bfd 100644 --- a/OOXML/DocxFormat/Math/oMathContent.cpp +++ b/OOXML/DocxFormat/Math/oMathContent.cpp @@ -2664,7 +2664,7 @@ namespace OOX } void CMIns::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("w:author"), m_sAuthor ) WritingElement_ReadAttributes_Read_else_if( oReader, _T("w:date"), m_oDate ) @@ -4025,7 +4025,7 @@ namespace OOX else if (L"m:e" == sName) { AssignPtrXmlContent(pItem, CElement, oItem) - //нужно заранее знать колисество столбцов для отрисовки + //need to know the number of columns in advance for rendering m_lColumn++; } @@ -4053,7 +4053,7 @@ namespace OOX else if (L"m:e" == sName) { AssignPtrXmlContent(pItem, CElement, oReader) - //нужно заранее знать колисество столбцов для отрисовки + //need to know the number of columns in advance for rendering m_lColumn++; } diff --git a/OOXML/DocxFormat/RId.cpp b/OOXML/DocxFormat/RId.cpp index 93afc24b9d..704f729a96 100644 --- a/OOXML/DocxFormat/RId.cpp +++ b/OOXML/DocxFormat/RId.cpp @@ -52,8 +52,8 @@ namespace OOX } const RId& RId::operator= (const std::wstring& rid) { - //Учитывает только rid начинающиеся с rId, остальные сохраняем так как есть - //Tогда не будет проблем с добавление новый id, мы всегда будем генерировать их с префиксом rId + //Only process rids that start with rId, others are saved as-is + //Then there will be no problems with adding new ids, we always generate them with the rId prefix std::wstring sFindString(L"rId"); if (0 == rid.find(sFindString) && rid.length() > 3 && rid.length() < 11 && 0 != isdigit(rid[3])) diff --git a/OOXML/DocxFormat/Rels.cpp b/OOXML/DocxFormat/Rels.cpp index 43dd4edfbb..195f6e4d21 100644 --- a/OOXML/DocxFormat/Rels.cpp +++ b/OOXML/DocxFormat/Rels.cpp @@ -106,7 +106,7 @@ namespace OOX WritingElement_ReadAttributes_Read_else_if( oReader,L"TargetMode", m_sMode ) WritingElement_ReadAttributes_End( oReader ) - //External rels не нормализуем, иначе искажаются пути в гиперссылках. + //We don't normalize external rels, otherwise paths in hyperlinks get distorted. if(IsExternal()) m_oTarget.SetName(sTempTarget, false); else diff --git a/OOXML/DocxFormat/Settings/Settings.cpp b/OOXML/DocxFormat/Settings/Settings.cpp index 91072ee0d0..fb106ee0b5 100644 --- a/OOXML/DocxFormat/Settings/Settings.cpp +++ b/OOXML/DocxFormat/Settings/Settings.cpp @@ -56,7 +56,7 @@ namespace Settings } void CWritingStyle::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CWritingStyle::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CWritingStyle::fromXML(XmlUtils::CXmlNode& oNode) } void CWritingStyle::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -148,7 +148,7 @@ namespace Settings } void CAutoCaption::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CAutoCaption::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CAutoCaption::fromXML(XmlUtils::CXmlNode& oNode) } void CAutoCaption::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -170,7 +170,7 @@ namespace Settings } void CAutoCaption::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes if ( oReader.GetAttributesCount() <= 0 ) return; @@ -227,7 +227,7 @@ namespace Settings } void CAutoCaptions::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CAutoCaptions::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CAutoCaptions::fromXML(XmlUtils::CXmlNode& oNode) } void CAutoCaptions::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -278,7 +278,7 @@ namespace Settings } void CCaption::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CCaption::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CCaption::fromXML(XmlUtils::CXmlNode& oNode) } void CCaption::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -304,7 +304,7 @@ namespace Settings } void CCaption::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes if ( oReader.GetAttributesCount() <= 0 ) return; @@ -375,7 +375,7 @@ namespace Settings } void CCaptions::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CCaptions::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CCaptions::fromXML(XmlUtils::CXmlNode& oNode) } void CCaptions::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -431,7 +431,7 @@ namespace Settings } void CCharacterSpacing::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CCharacterSpacing::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CCharacterSpacing::fromXML(XmlUtils::CXmlNode& oNode) } void CCharacterSpacing::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -493,7 +493,7 @@ namespace Settings } void CCompatSetting::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CCompatSetting::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CCompatSetting::fromXML(XmlUtils::CXmlNode& oNode) } void CCompatSetting::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -585,7 +585,7 @@ namespace Settings } void CCompat::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CCompat::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CCompat::fromXML(XmlUtils::CXmlNode& oNode) } void CCompat::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -857,7 +857,7 @@ namespace Settings } void CDocProtect::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CDocProtect::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CDocProtect::fromXML(XmlUtils::CXmlNode& oNode) } void CDocProtect::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -973,7 +973,7 @@ namespace Settings } void CDocType::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CDocType::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CDocType::fromXML(XmlUtils::CXmlNode& oNode) } void CDocType::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1035,7 +1035,7 @@ namespace Settings } void CDocVar::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CDocVar::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CDocVar::fromXML(XmlUtils::CXmlNode& oNode) } void CDocVar::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1107,7 +1107,7 @@ namespace Settings } void CDocVars::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CDocVars::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CDocVars::fromXML(XmlUtils::CXmlNode& oNode) } void CDocVars::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1158,7 +1158,7 @@ namespace Settings } void CKinsoku::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CKinsoku::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CKinsoku::fromXML(XmlUtils::CXmlNode& oNode) } void CKinsoku::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1240,7 +1240,7 @@ namespace Settings } void CProof::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CProof::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CProof::fromXML(XmlUtils::CXmlNode& oNode) } void CProof::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1311,7 +1311,7 @@ namespace Settings } void CReadingModeInkLockDown::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CReadingModeInkLockDown::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CReadingModeInkLockDown::fromXML(XmlUtils::CXmlNode& oNode) } void CReadingModeInkLockDown::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1391,7 +1391,7 @@ namespace Settings } void CTrackChangesView::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CTrackChangesView::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CTrackChangesView::fromXML(XmlUtils::CXmlNode& oNode) } void CTrackChangesView::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1480,7 +1480,7 @@ namespace Settings } void CDocRsids::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CDocRsids::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CDocRsids::fromXML(XmlUtils::CXmlNode& oNode) } void CDocRsids::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1542,7 +1542,7 @@ namespace Settings } void CSaveThroughXslt::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CTrackChangesView::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CTrackChangesView::fromXML(XmlUtils::CXmlNode& oNode) } void CSaveThroughXslt::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1586,7 +1586,7 @@ namespace Settings } void CSmartTagType::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CSmartTagType::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CSmartTagType::fromXML(XmlUtils::CXmlNode& oNode) } void CSmartTagType::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1645,7 +1645,7 @@ namespace Settings } void CStylePaneFilter::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CStylePaneFilter::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CStylePaneFilter::fromXML(XmlUtils::CXmlNode& oNode) } void CStylePaneFilter::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1763,7 +1763,7 @@ namespace Settings } void CWriteProtection::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CWriteProtection::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CWriteProtection::fromXML(XmlUtils::CXmlNode& oNode) } void CWriteProtection::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1877,7 +1877,7 @@ namespace Settings } void CZoom::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CZoom::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CZoom::fromXML(XmlUtils::CXmlNode& oNode) } void CZoom::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -1955,7 +1955,7 @@ namespace Settings } void CEdnDocProps::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CEdnDocProps::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CEdnDocProps::fromXML(XmlUtils::CXmlNode& oNode) } EElementType CEdnDocProps::getType() const { @@ -2060,7 +2060,7 @@ namespace Settings } void CFtnDocProps::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CFtnDocProps::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CFtnDocProps::fromXML(XmlUtils::CXmlNode& oNode) } EElementType CFtnDocProps::getType() const { @@ -2158,7 +2158,7 @@ namespace Settings } void CSchema::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CSchema::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CSchema::fromXML(XmlUtils::CXmlNode& oNode) } void CSchema::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -2224,7 +2224,7 @@ namespace Settings } void CSchemaLibrary::fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CSchemaLibrary::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CSchemaLibrary::fromXML(XmlUtils::CXmlNode& oNode) } void CSchemaLibrary::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -2280,7 +2280,7 @@ namespace Settings void CShapeDefaults::fromXML(XmlUtils::CXmlNode& oNode) { m_eType = et_Unknown; - // TO DO: Реализовать CShapeDefaults::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CShapeDefaults::fromXML(XmlUtils::CXmlNode& oNode) } void CShapeDefaults::fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -2814,7 +2814,7 @@ namespace Settings if ( m_oDocumentType.IsInit() ) sXml += m_oDocumentType->toXML(); - // TO DO: Здесь вставить запись w:mailMerge + // TO DO: Insert w:mailMerge record here if ( m_oRevisionView.IsInit() ) sXml += m_oRevisionView->toXML(); diff --git a/OOXML/DocxFormat/Settings/Settings.h b/OOXML/DocxFormat/Settings/Settings.h index 4764af82cb..724f1e535e 100644 --- a/OOXML/DocxFormat/Settings/Settings.h +++ b/OOXML/DocxFormat/Settings/Settings.h @@ -228,7 +228,7 @@ namespace OOX virtual std::wstring toXML() const; virtual EElementType getType() const; - // TO DO: Добавить аттрибуты из 9.7.3 Part4 + // TO DO: Add attributes from 9.7.3 Part4 nullable<ComplexTypes::Word::COnOff2> m_oUseSingleBorderforContiguousCells; nullable<ComplexTypes::Word::COnOff2> m_oWpJustification; @@ -598,7 +598,7 @@ namespace OOX void ReadAttributes(XmlUtils::CXmlLiteReader& oReader); public: - // TO DO: Добавить атрибуты из 9.7.2.4 Part4 + // TO DO: Add attributes from 9.7.2.4 Part4 nullable_bool m_oAllStyles; nullable_bool m_oAlternateStyleNames; @@ -632,7 +632,7 @@ namespace OOX } virtual void fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CStyleSort::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CStyleSort::fromXML(XmlUtils::CXmlNode& oNode) } virtual void fromXML(XmlUtils::CXmlLiteReader& oReader) { @@ -691,7 +691,7 @@ namespace OOX } virtual void fromXML(XmlUtils::CXmlNode& oNode) { - // TO DO: Реализовать CView::fromXML(XmlUtils::CXmlNode& oNode) + // TO DO: Implement CView::fromXML(XmlUtils::CXmlNode& oNode) } virtual void fromXML(XmlUtils::CXmlLiteReader& oReader) { diff --git a/OOXML/DocxFormat/Settings/WebSettings.cpp b/OOXML/DocxFormat/Settings/WebSettings.cpp index 5a1b32f8c5..34b3ada904 100644 --- a/OOXML/DocxFormat/Settings/WebSettings.cpp +++ b/OOXML/DocxFormat/Settings/WebSettings.cpp @@ -75,7 +75,7 @@ namespace ComplexTypes namespace OOX { - // TO DO: Доделать данный класс + // TO DO: Complete this class //-------------------------------------------------------------------------------- // CWebSettings 17.11.15 diff --git a/OOXML/DocxFormat/Settings/WebSettings.h b/OOXML/DocxFormat/Settings/WebSettings.h index dc696427ec..76ac47ecfb 100644 --- a/OOXML/DocxFormat/Settings/WebSettings.h +++ b/OOXML/DocxFormat/Settings/WebSettings.h @@ -65,7 +65,7 @@ namespace ComplexTypes namespace OOX { - // TO DO: Доделать данный класс + // TO DO: Complete this class //-------------------------------------------------------------------------------- // CWebSettings 17.11.15 diff --git a/OOXML/DocxFormat/VmlDrawing.cpp b/OOXML/DocxFormat/VmlDrawing.cpp index 85bf3a1c8e..bcc49ff0c0 100644 --- a/OOXML/DocxFormat/VmlDrawing.cpp +++ b/OOXML/DocxFormat/VmlDrawing.cpp @@ -36,7 +36,7 @@ namespace OOX { -//в файле VmlDrawing могут быть как отобразительная часть комментариев Xlsx, так и просто обычные объекты +//VmlDrawing file can contain both the display part of Xlsx comments and regular objects void CVmlDrawing::ClearShapeTypes() { @@ -63,7 +63,7 @@ namespace OOX ReadAttributes( oReader ); std::wstring elementContent; - bool bReadyElement = false;//собираем все до нахождения собственно элемента + bool bReadyElement = false;//collect everything until we find the actual element if ( !oReader.IsEmptyNode() ) { @@ -77,7 +77,7 @@ namespace OOX strXml += NodeContent; strXml += L"</xml>"; - XmlUtils::CXmlLiteReader oSubReader;//нам нужны xml и сами объекты + XmlUtils::CXmlLiteReader oSubReader;//we need xml and the objects themselves if (oSubReader.FromString(strXml) == false) continue; oSubReader.ReadNextNode(); @@ -88,7 +88,7 @@ namespace OOX while ( oSubReader.ReadNextSiblingNode( nStylesDepth1 ) )// { std::wstring sName = oSubReader.GetName(); - switch (sName[0])// вынесены только объекты .. + switch (sName[0])// only objects are extracted .. { case 'v': { @@ -234,7 +234,7 @@ namespace OOX m_oReadPath = oPath; IFileContainer::Read( oRootPath, oPath ); - //так как это не совсем xml - поправим + //since this is not quite xml - let's fix it NSFile::CFileBinary file; if (file.OpenFile(oPath.GetPath())) @@ -255,12 +255,12 @@ namespace OOX if (false == m_sFileContent.empty()) { - // элементы вида <br> без </br> + // elements like <br> without </br> // test_vml4.xlsx XmlUtils::replace_all(m_sFileContent, L"<br>", L""); - // элементы вида <![if ...]>, <![endif]> + // elements like <![if ...]>, <![endif]> // Zigmunds.pptx while(true) { diff --git a/OOXML/DocxFormat/VmlDrawing.h b/OOXML/DocxFormat/VmlDrawing.h index 1c4021fa2d..7485dadf14 100644 --- a/OOXML/DocxFormat/VmlDrawing.h +++ b/OOXML/DocxFormat/VmlDrawing.h @@ -40,7 +40,7 @@ namespace OOX { -//в файле VmlDrawing могут быть как отобразительная часть комментариев Xlsx, так и просто обычные объекты +//VmlDrawing file can contain both the display part of Xlsx comments and regular objects class CVmlDrawing : public OOX::WritingElementWithChilds<OOX::WritingElement>, public OOX::FileGlobalEnumerated, public OOX::IFileContainer { diff --git a/OOXML/DocxFormat/WritingElement.h b/OOXML/DocxFormat/WritingElement.h index 264e5e6509..ef6ec6ae3f 100644 --- a/OOXML/DocxFormat/WritingElement.h +++ b/OOXML/DocxFormat/WritingElement.h @@ -141,7 +141,7 @@ namespace OOX wsName = Reader.GetName();\ }\ Reader.MoveToElement();}} - // Следующие 3 define используются для чтения аттрибутов через CXmlLiteReader + // The following 3 defines are used for reading attributes via CXmlLiteReader #define WritingElement_ReadAttributes_Start(Reader) \ if ( Reader.GetAttributesCount() <= 0 )\ return;\ diff --git a/OOXML/PPTXFormat/DrawingConverter/ASCOfficeDrawingConverter.cpp b/OOXML/PPTXFormat/DrawingConverter/ASCOfficeDrawingConverter.cpp index 0012e822e0..f868aa19db 100644 --- a/OOXML/PPTXFormat/DrawingConverter/ASCOfficeDrawingConverter.cpp +++ b/OOXML/PPTXFormat/DrawingConverter/ASCOfficeDrawingConverter.cpp @@ -884,7 +884,7 @@ namespace PPTX } void CStringTrimmer::LoadFromString(std::wstring& strParams) { - // здесь не будем плодить тормозов - напишем без всяких Mid, Find, чтобы был только один проход + // let's not create performance bottlenecks - write without Mid, Find to have only one pass wchar_t* pData = (wchar_t*)strParams.c_str(); int nCount = (int) strParams.length(); @@ -938,7 +938,7 @@ namespace PPTX { Clear(); - // здесь не будем плодить тормозов - напишем без всяких Mid, Find, чтобы был только один проход + // let's not create performance bottlenecks - write without Mid, Find to have only one pass wchar_t* pData = (wchar_t*)strParams.c_str(); int nCount = (int) strParams.length(); @@ -964,7 +964,7 @@ namespace PPTX ++nPosition; ++pDataMem; - // пропускаем пробелы + // skip spaces while ((nPosition < nCount) && ((wchar_t(' ') == *pDataMem) || (wchar_t('{') == *pDataMem))) { ++nPosition; @@ -973,7 +973,7 @@ namespace PPTX int nPosOld = nPosition; - // ищем имя настройки + // find setting name while ((nPosition < nCount) && (wchar_t(':') != *pDataMem)) { ++nPosition; @@ -982,16 +982,16 @@ namespace PPTX if (nPosOld == nPosition) { - // нету ни одной настройки + // no settings found break; } std::wstring strName = strParams.substr(nPosOld, nPosition - nPosOld); - // убираем ':' + // remove ':' ++nPosition; ++pDataMem; - // пропускаем пробелы настройки + // skip setting spaces while ((nPosition < nCount) && (wchar_t(' ') == *pDataMem)) { ++nPosition; @@ -1000,7 +1000,7 @@ namespace PPTX nPosOld = nPosition; - // пропускаем пробелы настройки + // skip setting spaces while ((nPosition < nCount) && (wchar_t(';') != *pDataMem) && (wchar_t('}') != *pDataMem)) { ++nPosition; @@ -1024,7 +1024,7 @@ namespace PPTX { Clear(); - // здесь не будем плодить тормозов - напишем без всяких Mid, Find, чтобы был только один проход + // let's not create performance bottlenecks - write without Mid, Find to have only one pass wchar_t* pData = (wchar_t*)strParams.c_str(); int nCount = (int) strParams.length(); @@ -1035,7 +1035,7 @@ namespace PPTX while (true) { - // пропускаем пробелы + // skip spaces while ((nPosition < nCount) && ((wchar_t(' ') == *pDataMem) || (wchar_t('{') == *pDataMem) || (wchar_t(';') == *pDataMem))) { ++nPosition; @@ -1044,7 +1044,7 @@ namespace PPTX int nPosOld = nPosition; - // ищем имя настройки + // find setting name while ((nPosition < nCount) && (wchar_t(':') != *pDataMem)) { ++nPosition; @@ -1053,16 +1053,16 @@ namespace PPTX if (nPosOld == nPosition) { - // нету ни одной настройки + // no settings found break; } std::wstring strName = strParams.substr(nPosOld, nPosition - nPosOld); - // убираем ':' + // remove ':' ++nPosition; ++pDataMem; - // пропускаем пробелы настройки + // skip setting spaces while ((nPosition < nCount) && (wchar_t(' ') == *pDataMem)) { ++nPosition; @@ -1071,7 +1071,7 @@ namespace PPTX nPosOld = nPosition; - // пропускаем пробелы настройки + // skip setting spaces while ((nPosition < nCount) && (wchar_t(';') != *pDataMem) && (wchar_t('}') != *pDataMem)) { ++nPosition; @@ -1330,7 +1330,7 @@ void CDrawingConverter::AddShapeType(XmlUtils::CXmlNode& oNode) } if (strId.empty()) return; - //if (m_mapShapeTypes.find(strId) == m_mapShapeTypes.end())//?? с затиранием ??? + //if (m_mapShapeTypes.find(strId) == m_mapShapeTypes.end())//?? with overwriting ??? { CPPTShape* pShape = new CPPTShape(); pShape->m_bIsShapeType = true; @@ -1435,7 +1435,7 @@ void CDrawingConverter::ConvertVml(const std::wstring& sXml, std::vector<nullabl } else if (strName == L"pict" || strName == L"object") { - //сначала shape type + //shape type first XmlUtils::CXmlNode oNodeST; if (oParseNode.GetNode(L"v:shapetype", oNodeST)) { @@ -1620,7 +1620,7 @@ bool CDrawingConverter::ParceObject(const std::wstring& strXml, std::wstring* pM } else if (strName == L"pict" || strName == L"object") { - //сначала shape type + //shape type first XmlUtils::CXmlNode oNodeST; if (oParseNode.GetNode(L"v:shapetype", oNodeST)) { @@ -1959,7 +1959,7 @@ void CDrawingConverter::ConvertShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::CX } } - // теперь определяем bounds + // now define bounds int _x = INT_MAX; int _y = INT_MAX; int _r = INT_MIN; @@ -2003,7 +2003,7 @@ void CDrawingConverter::ConvertShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::CX pPPTShape = new CPPTShape(); pPPTShape->SetShapeType((PPTShapes::ShapeType)1); - // иначе сохранится рект + // otherwise rect will be preserved pPPTShape->m_eType = PPTShapes::sptCustom; pPPTShape->LoadPathList(strPath); @@ -2062,7 +2062,7 @@ void CDrawingConverter::ConvertShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::CX { pPPTShape = new CPPTShape(); pPPTShape->SetShapeType((PPTShapes::ShapeType)1); - // иначе сохранится рект + // otherwise rect will be preserved pPPTShape->m_eType = PPTShapes::sptCustom; } } @@ -2150,7 +2150,7 @@ void CDrawingConverter::ConvertShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::CX { strXmlPPTX = oShapeElem.ConvertPPTShapeToPPTX(true); - // в старых шейпах текст крутится отдельно + // in old shapes text rotates separately pShape->oTextBoxBodyPr->upright = true; } @@ -2159,7 +2159,7 @@ void CDrawingConverter::ConvertShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::CX std::wstring sTextboxStyle; bool res_text = oNodeShape.GetNode(L"v:textbox", oNodeTextBox); - if (!res_text) res_text = oNodeShape.GetNode(L"w:textbox", oNodeTextBox); // libre 4.0 эту хрень делает + if (!res_text) res_text = oNodeShape.GetNode(L"w:textbox", oNodeTextBox); // libre 4.0 does this stuff if (res_text) { @@ -2232,7 +2232,7 @@ void CDrawingConverter::ConvertShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::CX } if (!sTextboxStyle.empty()) - {//todooo прописать все остальное + {//todooo implement the rest SimpleTypes::Vml::CCssStyle oCssStyle; oCssStyle.FromString(sTextboxStyle); @@ -2281,8 +2281,8 @@ void CDrawingConverter::ConvertShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::CX case SimpleTypes::Vml::cssmsorotate180: val = 180; break; case SimpleTypes::Vml::cssmsorotate270: val = 270; break; } - pShape->oTextBoxBodyPr->rot = val * 60000; //для docx, xlsx - if (pShape->txBody.IsInit() == false) //для pptx + pShape->oTextBoxBodyPr->rot = val * 60000; //for docx, xlsx + if (pShape->txBody.IsInit() == false) //for pptx pShape->txBody = new PPTX::Logic::TxBody(); if (!pShape->txBody->bodyPr.IsInit()) @@ -2296,7 +2296,7 @@ void CDrawingConverter::ConvertShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::CX { if (oCssStyle.m_arrProperties[pFind->second]->get_Value().bValue) { - if (pShape->txBody.IsInit() == false) //для pptx /// todooo схлопнуть + if (pShape->txBody.IsInit() == false) //for pptx /// todooo collapse pShape->txBody = new PPTX::Logic::TxBody(); if (!pShape->txBody->bodyPr.IsInit()) @@ -2311,7 +2311,7 @@ void CDrawingConverter::ConvertShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::CX { if (oCssStyle.m_arrProperties[pFind->second]->get_Value().bValue) { - if (pShape->txBody.IsInit() == false) //для pptx + if (pShape->txBody.IsInit() == false) //for pptx pShape->txBody = new PPTX::Logic::TxBody(); if (!pShape->txBody->bodyPr.IsInit()) @@ -2329,10 +2329,10 @@ void CDrawingConverter::ConvertShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::CX { if (oCssStyle.m_arrProperties[pFind->second]->get_Value().oValue.eType == SimpleTypes::Vml::cssunitstypeUnits) { - pShape->oTextBoxBodyPr->Fit.fontScale = (int)(100 * oCssStyle.m_arrProperties[pFind->second]->get_Value().oValue.dValue); //для docx, xlsx + pShape->oTextBoxBodyPr->Fit.fontScale = (int)(100 * oCssStyle.m_arrProperties[pFind->second]->get_Value().oValue.dValue); //for docx, xlsx pShape->oTextBoxBodyPr->Fit.type = PPTX::Logic::TextFit::FitNormAuto; - if (pShape->txBody.IsInit() == false) //для pptx + if (pShape->txBody.IsInit() == false) //for pptx pShape->txBody = new PPTX::Logic::TxBody(); if (!pShape->txBody->bodyPr.IsInit()) @@ -2691,7 +2691,7 @@ void CDrawingConverter::ConvertWordArtShape(PPTX::Logic::SpTreeElem* elem, XmlUt std::wstring strNameP = XmlUtils::GetNameNoNS(oNodeP.GetName()); if (L"textpath" == strNameP) { - std::wstring tmpString = oNodeP.GetText(); //для обхода пишется дубль в контент + std::wstring tmpString = oNodeP.GetText(); //to bypass , duplicate is written to content if (tmpString.empty()) { @@ -2891,7 +2891,7 @@ void CDrawingConverter::ConvertWordArtShape(PPTX::Logic::SpTreeElem* elem, XmlUt arColors.push_back(oColor); else { - //дублирование + //duplication PPTX::Logic::UniColor *oColor1 = new PPTX::Logic::UniColor(); oColor1->Color = new PPTX::Logic::SrgbClr(); oColor1->Color->SetRGB(color.R, color.G, color.B); @@ -3130,7 +3130,7 @@ void CDrawingConverter::ConvertWordArtShape(PPTX::Logic::SpTreeElem* elem, XmlUt } else { - //не существует в природе + //does not exist in nature } strRPr += L"</w14:textFill>"; @@ -3193,7 +3193,7 @@ void CDrawingConverter::ConvertWordArtShape(PPTX::Logic::SpTreeElem* elem, XmlUt } } - // у старого wordArt никаких отступов + // old wordArt has no padding pShape->oTextBoxBodyPr->lIns = 0; pShape->oTextBoxBodyPr->tIns = 0; pShape->oTextBoxBodyPr->rIns = 0; @@ -3207,7 +3207,7 @@ void CDrawingConverter::ConvertWordArtShape(PPTX::Logic::SpTreeElem* elem, XmlUt if (!pPPTShape->m_textPath.bTrim) { - // нужно для данного размера шейпа выставить отступы сверху и снизу + // need to set top and bottom padding for this shape size // top: Ascent - CapHeight // bottom: Descent } @@ -3223,7 +3223,7 @@ void CDrawingConverter::ConvertGroup(PPTX::Logic::SpTreeElem *result, XmlUtils:: std::vector<XmlUtils::CXmlNode> oNodes; - //сначала shape type + //shape type first if (oNode.GetNodes(L"*", oNodes)) { size_t nCount = oNodes.size(); @@ -4233,7 +4233,7 @@ void CDrawingConverter::CheckBorderShape(PPTX::Logic::SpTreeElem* oElem, XmlUtil if (!pSpPr) return; if ( (pSpPr->ln.IsInit()) && (pSpPr->ln->Fill.m_type != PPTX::Logic::UniFill::noFill) ) - return; //дублирование обрамлением линией + return; //duplication with line framing nullable_string sColorBorder; XmlMacroReadAttributeBase(oNode, L"o:borderleftcolor", sColorBorder); @@ -5522,7 +5522,7 @@ std::wstring CDrawingConverter::SaveObjectBackground(LONG lStart, LONG lLength) if (oElem.is<PPTX::Logic::Shape>()) { - oXmlWriter.m_bIsTop = true; // не забыть скинуть в самом шейпе + oXmlWriter.m_bIsTop = true; // don't forget to reset in the shape itself PPTX::Logic::Shape& oShape = oElem.as<PPTX::Logic::Shape>(); OOX::IFileContainer* rels = GetRelsPtr(); @@ -5540,7 +5540,7 @@ void CDrawingConverter::ConvertPicVML(PPTX::Logic::SpTreeElem& oElem, const std: { ConvertMainPropsToVML(bsMainProps, oWriter, oElem); - oWriter.m_bIsTop = true; // не забыть скинуть в самом шейпе + oWriter.m_bIsTop = true; // don't forget to reset in the shape itself PPTX::Logic::Pic& oPic = oElem.as<PPTX::Logic::Pic>(); oPic.toXmlWriterVML(&oWriter, *m_pTheme, *m_pClrMap); } @@ -5551,7 +5551,7 @@ void CDrawingConverter::ConvertShapeVML(PPTX::Logic::SpTreeElem& oElem, const st if (oElem.is<PPTX::Logic::Shape>()) { - oWriter.m_bIsTop = true; // не забыть скинуть в самом шейпе + oWriter.m_bIsTop = true; // don't forget to reset in the shape itself PPTX::Logic::Shape& oShape = oElem.as<PPTX::Logic::Shape>(); OOX::IFileContainer* rels = GetRelsPtr(); @@ -5565,7 +5565,7 @@ void CDrawingConverter::ConvertGroupVML(PPTX::Logic::SpTreeElem& oElem, const st if (oElem.is<PPTX::Logic::SpTree>()) { - oWriter.m_bIsTop = true; // не забыть скинуть в самом шейпе (вместе с остальными параметрами) + oWriter.m_bIsTop = true; // don't forget to reset in the shape itself (along with other parameters) PPTX::Logic::SpTree& oGroup = oElem.as<PPTX::Logic::SpTree>(); OOX::IFileContainer* rels = GetRelsPtr(); diff --git a/OOXML/PPTXFormat/DrawingConverter/ASCOfficeDrawingConverter.h b/OOXML/PPTXFormat/DrawingConverter/ASCOfficeDrawingConverter.h index 0ea8f2fe31..69756298d9 100644 --- a/OOXML/PPTXFormat/DrawingConverter/ASCOfficeDrawingConverter.h +++ b/OOXML/PPTXFormat/DrawingConverter/ASCOfficeDrawingConverter.h @@ -254,7 +254,7 @@ namespace NSBinPptxRW NSBinPptxRW::CBinaryFileReader* m_pBinaryReader; int m_lNextId; - unsigned int m_nDrawingMaxZIndex = 0; // для смешанных записей pict & Drawing + unsigned int m_nDrawingMaxZIndex = 0; // for mixed pict & Drawing records int m_lCurrentObjectTop; diff --git a/OOXML/PPTXFormat/DrawingConverter/ASCOfficePPTXFileRealization.cpp b/OOXML/PPTXFormat/DrawingConverter/ASCOfficePPTXFileRealization.cpp index 402df66191..98b871e140 100644 --- a/OOXML/PPTXFormat/DrawingConverter/ASCOfficePPTXFileRealization.cpp +++ b/OOXML/PPTXFormat/DrawingConverter/ASCOfficePPTXFileRealization.cpp @@ -37,7 +37,7 @@ #include <shlobj.h> #include <shlwapi.h> #pragma comment( lib, "Rpcrt4.lib" ) - #pragma comment( lib, "shell32.lib" ) // добавить shell32.lib + #pragma comment( lib, "shell32.lib" ) // add shell32.lib #pragma comment( lib, "Shlwapi.lib" ) #else #endif @@ -248,9 +248,9 @@ _UINT32 CPPTXFile::OpenDirectoryToPPTY(std::wstring bsInput, std::wstring bsOutp return S_OK; } -_UINT32 CPPTXFile::ConvertPPTYToPPTX(std::wstring bsInput, std::wstring bsOutput, std::wstring bsThemesFolder)//bsOutput и файл и директория может быть +_UINT32 CPPTXFile::ConvertPPTYToPPTX(std::wstring bsInput, std::wstring bsOutput, std::wstring bsThemesFolder)//bsOutput can be file or directory { - OOX::CPath pathLocalTempDirectory = bsOutput; //выходной файл - папка + OOX::CPath pathLocalTempDirectory = bsOutput; //output file - folder NSBinPptxRW::CPPTXWriter oWriter; oWriter.Init(pathLocalTempDirectory.GetPath(), m_bIsMacro); diff --git a/OOXML/PPTXFormat/FileContainer.cpp b/OOXML/PPTXFormat/FileContainer.cpp index d07461be40..d7ffdf29c8 100644 --- a/OOXML/PPTXFormat/FileContainer.cpp +++ b/OOXML/PPTXFormat/FileContainer.cpp @@ -174,7 +174,7 @@ namespace PPTX if (bIsSlide && (pRelation->Type() == OOX::FileTypes::HyperLink || pRelation->Type() == OOX::Presentation::FileTypes::Slide)) - {// + external audio, video ... - в обычных ... + {// + external audio, video ... - in regular ... smart_ptr<OOX::File> file = smart_ptr<OOX::File>(new OOX::HyperLink(OOX::IFileContainer::m_pMainDocument, pRelation->Target())); diff --git a/OOXML/PPTXFormat/LegacyDiagramText.cpp b/OOXML/PPTXFormat/LegacyDiagramText.cpp index 528564cba1..02a074e922 100644 --- a/OOXML/PPTXFormat/LegacyDiagramText.cpp +++ b/OOXML/PPTXFormat/LegacyDiagramText.cpp @@ -73,13 +73,13 @@ namespace PPTX } Parse(); - // todooo .. разбить строку и создать структуру <a:p>...</a:p><a:p>...</a:p>...<a:p>...</a:p> - // щас используется 'нулевой' вариант - // незабыть поменять в doc_LoadShape (ASCOfficeDrawingConvert.cpp) + // todo .. split string and create structure <a:p>...</a:p><a:p>...</a:p>...<a:p>...</a:p> + // currently 'zero' variant is used + // don't forget to change in doc_LoadShape (ASCOfficeDrawingConvert.cpp) } void LegacyDiagramText::write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content)const { - //старье на запись не поддерживаем + //legacy writing is not supported content.Registration(type().OverrideType(), directory, filename); } LegacyDiagramText& LegacyDiagramText::operator=(const LegacyDiagramText& oSrc) @@ -271,7 +271,7 @@ namespace PPTX else Bulleted = false; } -//todooo протестировано тока align +//todo only align tested if (bulletChar_) { Logic::BuChar *buChar = new Logic::BuChar(); @@ -441,7 +441,7 @@ namespace PPTX bool bIsFontStylePresent = (hasBold || hasItalic || hasUnderline || hasShadow || hasFehint || hasKimi || hasEmboss || hasStyle != 0); -//todooo протестировано тока sz, color +//todo only sz, color tested if (bIsFontStylePresent) { WORD fontStyle = *(_UINT16*)(Data + pos); pos += 2; @@ -513,7 +513,7 @@ namespace PPTX int BaseLineOffset = static_cast<int>((double)(*(_UINT16*)(Data + pos))); pos += 2; } - // или два последних наоборот???? + // or the last two are swapped???? return pos; } diff --git a/OOXML/PPTXFormat/Logic/BodyPr.cpp b/OOXML/PPTXFormat/Logic/BodyPr.cpp index fa62dce529..a7ee7d17a5 100644 --- a/OOXML/PPTXFormat/Logic/BodyPr.cpp +++ b/OOXML/PPTXFormat/Logic/BodyPr.cpp @@ -448,7 +448,7 @@ namespace PPTX } default: { - // пока никаких настроек градиента нет + // no gradient settings yet pReader->SkipRecord(); } } diff --git a/OOXML/PPTXFormat/Logic/Bullets/Bullet.cpp b/OOXML/PPTXFormat/Logic/Bullets/Bullet.cpp index 90956dd769..743427e1d5 100644 --- a/OOXML/PPTXFormat/Logic/Bullets/Bullet.cpp +++ b/OOXML/PPTXFormat/Logic/Bullets/Bullet.cpp @@ -176,7 +176,7 @@ namespace PPTX m_Bullet.reset(pBuBlip); } else - {//??? сбой ??? + {//??? failure ??? delete pBuBlip; Logic::BuChar *pBuChar = new Logic::BuChar(); diff --git a/OOXML/PPTXFormat/Logic/Colors/ColorBase.h b/OOXML/PPTXFormat/Logic/Colors/ColorBase.h index ea040c1d76..6b02ecae91 100644 --- a/OOXML/PPTXFormat/Logic/Colors/ColorBase.h +++ b/OOXML/PPTXFormat/Logic/Colors/ColorBase.h @@ -53,7 +53,7 @@ namespace PPTX ColorBase& operator=(const ColorBase& oSrc); virtual ~ColorBase(); - //Эти функции возвращают цвет с учетом модификаторов + //These functions return color with modifiers applied virtual DWORD GetRGBA(DWORD RGBA) const; virtual DWORD GetARGB(DWORD ARGB) const; virtual DWORD GetBGRA(DWORD BGRA) const; @@ -62,18 +62,18 @@ namespace PPTX virtual DWORD GetRGBColor(NSCommon::smart_ptr<PPTX::Theme>& _oTheme, NSCommon::smart_ptr<PPTX::Logic::ClrMap>& _oClrMap, DWORD ARGB = 0); void SetRGB(const BYTE& R, const BYTE& G, const BYTE& B); - //Надо сделать примерно также для "origin color" и setter'ы - //Нет, нет и нет!!! Setter'ы делать только в УниКолор, т.к. при установке цвета меняется его тип! + //Need to do similar for "origin color" and setters + //No, no and no!!! Setters only in UniColor, because when setting color its type changes! enum ColorType {ctRGBA, ctARGB, ctBGRA, ctABGR}; virtual DWORD ApplyModifiers(const ColorType ct) const; - //Эти функции использовать для заполнения "origin color" + //Use these functions for filling "origin color" void SetRGB2HSL(); void SetHSL2RGB(); - //Эти использовать при применении модификаторов + //Use these when applying modifiers static void RGB2HSL(unsigned char* RGB, unsigned char* HSL); static void HSL2RGB(unsigned char* HSL, unsigned char* RGB); static double Hue_2_RGB(double v1,double v2,double vH); //Function Hue_2_RGB diff --git a/OOXML/PPTXFormat/Logic/EffectDag.cpp b/OOXML/PPTXFormat/Logic/EffectDag.cpp index a985e9b118..2709482d6f 100644 --- a/OOXML/PPTXFormat/Logic/EffectDag.cpp +++ b/OOXML/PPTXFormat/Logic/EffectDag.cpp @@ -106,7 +106,7 @@ namespace PPTX for (size_t i = 0; i < len; ++i) { - pWriter->WriteRecord1(1, Effects[i]); // id неважен + pWriter->WriteRecord1(1, Effects[i]); // id doesn't matter } pWriter->EndRecord(); diff --git a/OOXML/PPTXFormat/Logic/Fills/Blip.cpp b/OOXML/PPTXFormat/Logic/Fills/Blip.cpp index 990a6d023f..4dc2f102f6 100644 --- a/OOXML/PPTXFormat/Logic/Fills/Blip.cpp +++ b/OOXML/PPTXFormat/Logic/Fills/Blip.cpp @@ -297,7 +297,7 @@ namespace PPTX for (ULONG i = 0; i < len; ++i) { - pWriter->WriteRecord1(0, Effects[i]);// id неважен + pWriter->WriteRecord1(0, Effects[i]);// id doesn't matter } pWriter->EndRecord(); diff --git a/OOXML/PPTXFormat/Logic/Fills/BlipFill.cpp b/OOXML/PPTXFormat/Logic/Fills/BlipFill.cpp index 451bf8186a..808452eab7 100644 --- a/OOXML/PPTXFormat/Logic/Fills/BlipFill.cpp +++ b/OOXML/PPTXFormat/Logic/Fills/BlipFill.cpp @@ -363,7 +363,7 @@ namespace PPTX { sImageExtension = detectImageExtension; - //папки media может не быть в случае, когда все картинки base64(поскольку файл временный, папку media не создаем) + //media folder may not exist when all images are base64 (since file is temporary, we don't create media folder) std::wstring tempFilePath = pReader->m_strFolder + FILE_SEPARATOR_STR; OOX::CPath pathTemp = NSFile::CFileBinary::CreateTempFileWithUniqueName(tempFilePath, L"img") + L"." + sImageExtension; @@ -373,10 +373,10 @@ namespace PPTX oTempFile.WriteFile((void*)pDstBuffer, (DWORD)dstLen); oTempFile.CloseFile(); - strImagePath = strTempFile = pathTemp.GetPath(); // strTempFile для удаления + strImagePath = strTempFile = pathTemp.GetPath(); // strTempFile for deletion } else - {// бяка + {// bad data strImagePath.clear(); } if (bBase64) diff --git a/OOXML/PPTXFormat/Logic/GraphicFrame.cpp b/OOXML/PPTXFormat/Logic/GraphicFrame.cpp index 6da2639f1d..615376320e 100644 --- a/OOXML/PPTXFormat/Logic/GraphicFrame.cpp +++ b/OOXML/PPTXFormat/Logic/GraphicFrame.cpp @@ -108,7 +108,7 @@ namespace PPTX } void GraphicFrame::ReadAttributes2(XmlUtils::CXmlLiteReader& oReader) { - //todooo нормальный объект сделать!! + //todo create proper object!! if (!olePic.IsInit()) olePic.Init(); if (!olePic->oleObject.IsInit()) olePic->oleObject.Init(); @@ -212,7 +212,7 @@ namespace PPTX if (strName1 == L"pic") { result = true; - if (!olePic.IsInit()) //создается уровнем выше + if (!olePic.IsInit()) //created at higher level olePic.Init(); olePic->fromXML(oReader); @@ -311,7 +311,7 @@ namespace PPTX } else if (L"oleObj" == strName) { - olePic = oNode.ReadNode(L"p:pic"); //нормальный вариант объекта + olePic = oNode.ReadNode(L"p:pic"); //normal object variant if (olePic.IsInit()) { olePic->fromXMLOle(oNode); @@ -319,7 +319,7 @@ namespace PPTX } else { - olePic.Init(); //старый вариант описания объекта через spid в VmlDrawing + olePic.Init(); //old object description variant via spid in VmlDrawing Logic::PrstGeom* geom = new Logic::PrstGeom(); geom->prst = L"rect"; diff --git a/OOXML/PPTXFormat/Logic/Ln.h b/OOXML/PPTXFormat/Logic/Ln.h index fddddecd83..af6798da7b 100644 --- a/OOXML/PPTXFormat/Logic/Ln.h +++ b/OOXML/PPTXFormat/Logic/Ln.h @@ -68,7 +68,7 @@ namespace PPTX virtual void Merge(Ln& line) const; public: -// OOX::Drawing::ELineDashType m_eDashType; // Тип штриха +// OOX::Drawing::ELineDashType m_eDashType; // Dash type UniFill Fill; EffectProperties Effects; diff --git a/OOXML/PPTXFormat/Logic/Media/WavAudioFile.cpp b/OOXML/PPTXFormat/Logic/Media/WavAudioFile.cpp index 7ac046e345..3159f8492a 100644 --- a/OOXML/PPTXFormat/Logic/Media/WavAudioFile.cpp +++ b/OOXML/PPTXFormat/Logic/Media/WavAudioFile.cpp @@ -57,7 +57,7 @@ namespace PPTX } OOX::EElementType WavAudioFile::getType() const { - return OOX::et_a_snd; //todooo расширить ... + return OOX::et_a_snd; //todo extend ... } void WavAudioFile::fromXML(XmlUtils::CXmlLiteReader& oReader) { diff --git a/OOXML/PPTXFormat/Logic/Pic.cpp b/OOXML/PPTXFormat/Logic/Pic.cpp index 3fde3f8bd5..0034609351 100644 --- a/OOXML/PPTXFormat/Logic/Pic.cpp +++ b/OOXML/PPTXFormat/Logic/Pic.cpp @@ -872,7 +872,7 @@ namespace PPTX if (!sIdImageFileCache.empty()) { - //ищем физический файл ( rId относительно vml_drawing) + //looking for physical file (rId relative to vml_drawing) smart_ptr<OOX::File> pFile = pVml->Find(sIdImageFileCache); if (pFile.IsInit() && ( OOX::FileTypes::Image == pFile->type())) @@ -1351,7 +1351,7 @@ namespace PPTX if ( (mediaFile.IsInit() == false || mediaFile->filename().GetPath() == L"NULL") && !nvPicPr.nvPr.extLst.empty()) { - //todooo - почему везде нулевой то? - сделать поиск по всем uri + //todo - why is it always zero? - implement search through all URIs file = pRels->Find(nvPicPr.nvPr.extLst[0].link_media.get()); } } diff --git a/OOXML/PPTXFormat/Logic/Shape.cpp b/OOXML/PPTXFormat/Logic/Shape.cpp index 8182e6ef79..64df9146c4 100644 --- a/OOXML/PPTXFormat/Logic/Shape.cpp +++ b/OOXML/PPTXFormat/Logic/Shape.cpp @@ -524,7 +524,7 @@ namespace PPTX pWriter->EndRecord(); } } - else if (strTextBoxShape.is_init())//после конвертации старого шейпа (vml) + else if (strTextBoxShape.is_init())//after converting old shape (vml) { long lDataSize = 0; ULONG lPos = pWriter->GetPosition(); diff --git a/OOXML/PPTXFormat/Logic/SmartArt.cpp b/OOXML/PPTXFormat/Logic/SmartArt.cpp index 9462cbde19..837c53e021 100644 --- a/OOXML/PPTXFormat/Logic/SmartArt.cpp +++ b/OOXML/PPTXFormat/Logic/SmartArt.cpp @@ -89,12 +89,12 @@ namespace PPTX { if (!pDiagramData) return NULL; - // easy4cargo1.pptx - слайд 2 - в диаграмме Smart вместо ссылки на drawing.xml ссылка на стороннюю картинку + // easy4cargo1.pptx - slide 2 - in the Smart diagram, instead of a reference to drawing.xml there is a reference to an external image OOX::CPath pathDiagramData = pDiagramData->m_strFilename; int a1 = (int)pathDiagramData.GetFilename().find(L"."); std::wstring strId = pathDiagramData.GetFilename().substr(4, pathDiagramData.GetFilename().length() - 8); - //стандартизированные имена only + //standardized names only OOX::CPath pathDiagramDrawing = pathDiagramData.GetDirectory() + FILE_SEPARATOR_STR + L"drawing" + strId + L".xml"; @@ -118,7 +118,7 @@ namespace PPTX m_pDataContainer = oFileData.smart_dynamic_cast<OOX::IFileContainer>(); - // это smart art ..есть у него drawing или нет - неважно + // this is smart art.. whether it has a drawing or not doesn't matter smart_ptr<OOX::File> oFileDrawing; OOX::CDiagramDrawing* pDiagramDrawing = NULL; @@ -129,8 +129,8 @@ namespace PPTX } else { - //Monetizing_Innovation.pptx (слайд 13) - diagrams/data1.xml не ссылается на diagrams/drawing1.xml - //пробуем по тому же пути с номером data.xml - ниже + //Monetizing_Innovation.pptx (slide 13) - diagrams/data1.xml doesn't reference diagrams/drawing1.xml + //try using the same path with data.xml number - see below } pDiagramDrawing = dynamic_cast<OOX::CDiagramDrawing*>(oFileDrawing.GetPointer()); @@ -338,7 +338,7 @@ namespace PPTX pDiagramData->fromPPTY(pReader); pReader->SaveDstContentRels(strDstDiagram + FILE_SEPARATOR_STR + L"_rels" + FILE_SEPARATOR_STR + pDiagramData->m_sOutputFilename + L".rels"); - // !!! id_drawing что в data пишется относительно контейнера выше + // !!! id_drawing that is written to data is relative to the container above if (pDiagramDrawing.IsInit()) { unsigned int nRId = pReader->m_pRels->WriteRels(pDiagramDrawing->type().RelationType(), pDiagramDrawing->m_sOutputFilename, L""); diff --git a/OOXML/PPTXFormat/Logic/SpTree.cpp b/OOXML/PPTXFormat/Logic/SpTree.cpp index 25c5483d33..c743f14b6c 100644 --- a/OOXML/PPTXFormat/Logic/SpTree.cpp +++ b/OOXML/PPTXFormat/Logic/SpTree.cpp @@ -445,7 +445,7 @@ namespace PPTX { pReader->Skip(1); // type (0) LONG nElemLength = pReader->GetLong(); // len - //SpTreeElem::fromPPTY сразу делает GetChar, а toPPTY ничего не пишет если не инициализирован + //SpTreeElem::fromPPTY immediately calls GetChar, while toPPTY writes nothing if not initialized if (nElemLength > 0) { SpTreeElem elm; @@ -590,7 +590,7 @@ namespace PPTX { pReader->Skip(1); // type (0) LONG nElemLength = pReader->GetLong(); // len - //SpTreeElem::fromPPTY сразу делает GetChar, а toPPTY ничего не пишет если не инициализирован + //SpTreeElem::fromPPTY immediately calls GetChar, while toPPTY writes nothing if not initialized if(nElemLength > 0) { SpTreeElem elm; diff --git a/OOXML/PPTXFormat/Logic/TcTxStyle.h b/OOXML/PPTXFormat/Logic/TcTxStyle.h index d7ddbe35e6..04144c2996 100644 --- a/OOXML/PPTXFormat/Logic/TcTxStyle.h +++ b/OOXML/PPTXFormat/Logic/TcTxStyle.h @@ -59,8 +59,8 @@ namespace PPTX nullable_limit<Limit::OnOff> b; /* font (Font) §20.1.4.2.13 -//Здесь имеется ввиду fontCollection (см. ниже), это еще одна альтернатива для Font -//Данный комментарий оставлен для напоминания +//Here fontCollection is meant (see below), this is another alternative for Font +//This comment is left as a reminder */ nullable<FontRef> fontRef; UniColor Color; diff --git a/OOXML/PPTXFormat/Logic/TextFont.cpp b/OOXML/PPTXFormat/Logic/TextFont.cpp index e9d0e3e93a..b0d1a03c0e 100644 --- a/OOXML/PPTXFormat/Logic/TextFont.cpp +++ b/OOXML/PPTXFormat/Logic/TextFont.cpp @@ -110,7 +110,7 @@ namespace PPTX } void TextFont::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes if ( oReader.GetAttributesCount() <= 0 ) return; diff --git a/OOXML/PPTXFormat/Logic/Transitions/TransitionBase.cpp b/OOXML/PPTXFormat/Logic/Transitions/TransitionBase.cpp index 7089f11985..e8ce4ba6d7 100644 --- a/OOXML/PPTXFormat/Logic/Transitions/TransitionBase.cpp +++ b/OOXML/PPTXFormat/Logic/Transitions/TransitionBase.cpp @@ -140,7 +140,7 @@ namespace PPTX } TransitionSerialize& TransitionSerialize::operator =(const TransitionSerialize& src) { - //проверка на самоприсваивание + //check for self-assignment if (this == &src) { return *this; } @@ -225,7 +225,7 @@ namespace PPTX pWriter->StartAttributes(); - //и нафига тогда листы?? - примем аксиомно что размеры одинаковые + //why use lists then?? - we assume that sizes are the same //size_t c1 = m_strAttributesNames.GetCount(); //size_t c2 = m_strAttributesValues.GetCount(); diff --git a/OOXML/PPTXFormat/Logic/UniColor.cpp b/OOXML/PPTXFormat/Logic/UniColor.cpp index a7255fbf87..c3ae42b6ee 100644 --- a/OOXML/PPTXFormat/Logic/UniColor.cpp +++ b/OOXML/PPTXFormat/Logic/UniColor.cpp @@ -337,25 +337,25 @@ namespace PPTX { if(is_init()) return Color->GetRGBA(RGBA); - return 0; //return 0; - заменить на просмотр настроек по умолчанию + return 0; //return 0; - replace with looking up default settings } DWORD UniColor::GetARGB(DWORD ARGB)const { if(is_init()) return Color->GetARGB(ARGB); - return 0; //return 0; - заменить на просмотр настроек по умолчанию + return 0; //return 0; - replace with looking up default settings } DWORD UniColor::GetBGRA(DWORD BGRA)const { if(is_init()) return Color->GetBGRA(BGRA); - return 0; //return 0; - заменить на просмотр настроек по умолчанию + return 0; //return 0; - replace with looking up default settings } DWORD UniColor::GetABGR(DWORD ABGR)const { if(is_init()) return Color->GetABGR(ABGR); - return 0; //return 0; - заменить на просмотр настроек по умолчанию + return 0; //return 0; - replace with looking up default settings } void UniColor::SetRGBColor(const BYTE& R, const BYTE& G, const BYTE& B) { diff --git a/OOXML/PPTXFormat/Theme/FmtScheme.cpp b/OOXML/PPTXFormat/Theme/FmtScheme.cpp index f1909dcad3..7dba91249c 100644 --- a/OOXML/PPTXFormat/Theme/FmtScheme.cpp +++ b/OOXML/PPTXFormat/Theme/FmtScheme.cpp @@ -106,7 +106,7 @@ namespace PPTX if (effectStyleLst.empty()) { - // вот такой поуерпоинт (эффекты пока не читаем - а они нужны. даже если и не используются нигде) + // PowerPoint quirk (effects are not being read yet - but they are needed, even if not used anywhere) pWriter->WriteString(L"<a:effectStyleLst><a:effectStyle><a:effectLst>\ <a:outerShdw blurRad=\"40000\" dist=\"20000\" dir=\"5400000\" rotWithShape=\"0\"><a:srgbClr val=\"000000\"><a:alpha val=\"38000\"/></a:srgbClr></a:outerShdw>\ </a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\">\ diff --git a/OOXML/SystemUtility/SystemUtility.cpp b/OOXML/SystemUtility/SystemUtility.cpp index 4e4be595cd..eed024923b 100644 --- a/OOXML/SystemUtility/SystemUtility.cpp +++ b/OOXML/SystemUtility/SystemUtility.cpp @@ -67,7 +67,7 @@ namespace OOX CPath::CPath(const CPath& oSrc) { *this = oSrc; - //считаем вызывать ли Normalize решает oSrc + //we consider that oSrc decides whether to call Normalize //Normalize(); } @@ -75,7 +75,7 @@ namespace OOX { m_strFilename = oSrc.m_strFilename; m_bIsRoot = oSrc.m_bIsRoot; - //считаем вызывать ли Normalize решает oSrc + //we consider that oSrc decides whether to call Normalize //Normalize(); return *this; } @@ -103,7 +103,7 @@ namespace OOX if (0 == m_strFilename.length()) return; - //todooo оптимизировать + //todo optimize XmlUtils::replace_all(m_strFilename, L"/", FILE_SEPARATOR_STR); XmlUtils::replace_all(m_strFilename, L"\\", FILE_SEPARATOR_STR); diff --git a/OOXML/SystemUtility/SystemUtility.h b/OOXML/SystemUtility/SystemUtility.h index ad13efc14a..84e25e24b2 100644 --- a/OOXML/SystemUtility/SystemUtility.h +++ b/OOXML/SystemUtility/SystemUtility.h @@ -39,7 +39,7 @@ namespace OOX { public: std::wstring m_strFilename; - //флаг введен, чтобы отличать относительные и абсолютные пути в rels + //flag introduced to distinguish relative and absolute paths in rels bool m_bIsRoot; CPath(); diff --git a/OOXML/VsdxFormat/Shapes.cpp b/OOXML/VsdxFormat/Shapes.cpp index 37647ca804..2b1d639b93 100644 --- a/OOXML/VsdxFormat/Shapes.cpp +++ b/OOXML/VsdxFormat/Shapes.cpp @@ -221,7 +221,7 @@ namespace OOX NSFile::CFileBinary::SaveToFile(out.GetPath() + FILE_SEPARATOR_STR + image_name_new + L".svg", sInternalSvg); } else - {// не смогли сконвертировать в svg - пробуем в png + {// couldn't convert to svg - trying png std::wstring strSaveItem = out.GetPath() + FILE_SEPARATOR_STR + image_name_new + L".png"; pMetafile->ConvertToRaster(strSaveItem.c_str(), 4 /*CXIMAGE_FORMAT_PNG*/, 0, 0); diff --git a/OOXML/VsdxFormat/VisioDocument.cpp b/OOXML/VsdxFormat/VisioDocument.cpp index 059c5f6188..50b855f8e9 100644 --- a/OOXML/VsdxFormat/VisioDocument.cpp +++ b/OOXML/VsdxFormat/VisioDocument.cpp @@ -1756,7 +1756,7 @@ namespace Draw } } if (false == bThemes) - {//некорректный контейнер ??? + {//invalid container ??? OOX::Draw::CVsdx *vsdx = dynamic_cast<OOX::Draw::CVsdx*>(((OOX::File*)this)->m_pMainDocument); if (vsdx && vsdx->m_pContentTypes.IsInit()) diff --git a/OOXML/XlsbFormat/Biff12_unions/PCDI.cpp b/OOXML/XlsbFormat/Biff12_unions/PCDI.cpp index de5128c712..4abf423255 100644 --- a/OOXML/XlsbFormat/Biff12_unions/PCDI.cpp +++ b/OOXML/XlsbFormat/Biff12_unions/PCDI.cpp @@ -58,7 +58,7 @@ namespace XLSB return BaseObjectPtr(new PCDI(*this)); } - //пришлось совместить из-за одинаковых PCDI в EXTERNALCONNECTION и PIVOTCACHEDEF + //had to combine due to identical PCDI in EXTERNALCONNECTION and PIVOTCACHEDEF // PCDI = BrtPCDIMissing / BrtPCDINumber / BrtPCDIBoolean / BrtPCDIError / BrtPCDIString / BrtPCDIDatetime / BrtPCDIIndex / PCDIRUN const bool PCDI::loadContent(BinProcessor& proc) { diff --git a/OOXML/XlsbFormat/Biff12_unions/PIVOTRULES.cpp b/OOXML/XlsbFormat/Biff12_unions/PIVOTRULES.cpp index c310aed658..17ed4e696e 100644 --- a/OOXML/XlsbFormat/Biff12_unions/PIVOTRULES.cpp +++ b/OOXML/XlsbFormat/Biff12_unions/PIVOTRULES.cpp @@ -53,7 +53,7 @@ namespace XLSB return BaseObjectPtr(new PIVOTRULES(*this)); } - //PIVOTRULES = BrtBeginSXRules PIVOTRULE BrtEndSxRules // скорее всего ошибка и должно быть *PIVOTRULE + //PIVOTRULES = BrtBeginSXRules PIVOTRULE BrtEndSxRules // most likely an error, and should be *PIVOTRULE const bool PIVOTRULES::loadContent(BinProcessor& proc) { if (proc.optional<BeginSXRules>()) diff --git a/OOXML/XlsbFormat/Biff12_unions/PIVOTRULES14.cpp b/OOXML/XlsbFormat/Biff12_unions/PIVOTRULES14.cpp index 085429c8c7..bba83c8fa5 100644 --- a/OOXML/XlsbFormat/Biff12_unions/PIVOTRULES14.cpp +++ b/OOXML/XlsbFormat/Biff12_unions/PIVOTRULES14.cpp @@ -53,7 +53,7 @@ namespace XLSB return BaseObjectPtr(new PIVOTRULES14(*this)); } - //PIVOTRULES14 = BrtBeginSXRules14 PIVOTRULE14 BrtEndSXRules14 // возможно ошибка и должно быть *PIVOTRULE14 + //PIVOTRULES14 = BrtBeginSXRules14 PIVOTRULE14 BrtEndSXRules14 // possibly an error, and should be *PIVOTRULE14 const bool PIVOTRULES14::loadContent(BinProcessor& proc) { if (proc.optional<BeginSXRules14>()) diff --git a/OOXML/XlsbFormat/Biff12_unions/PNPAIRS.cpp b/OOXML/XlsbFormat/Biff12_unions/PNPAIRS.cpp index f5245effe0..026085e21d 100644 --- a/OOXML/XlsbFormat/Biff12_unions/PNPAIRS.cpp +++ b/OOXML/XlsbFormat/Biff12_unions/PNPAIRS.cpp @@ -53,7 +53,7 @@ namespace XLSB return BaseObjectPtr(new PNPAIRS(*this)); } - //PNPAIRS = BrtBeginPNPairs PNPAIR BrtEndPNPairs // возможно, ошибка, и должно быть *PNPAIR + //PNPAIRS = BrtBeginPNPairs PNPAIR BrtEndPNPairs // possibly an error, and should be *PNPAIR const bool PNPAIRS::loadContent(BinProcessor& proc) { if (proc.optional<BeginPNPairs>()) diff --git a/OOXML/XlsbFormat/WorkBookStream.cpp b/OOXML/XlsbFormat/WorkBookStream.cpp index affb68bf84..4cf13a6f55 100644 --- a/OOXML/XlsbFormat/WorkBookStream.cpp +++ b/OOXML/XlsbFormat/WorkBookStream.cpp @@ -610,7 +610,7 @@ void WorkBookStream::UpdateDefineNames(XLS::GlobalWorkbookInfo* global_info_) name = L"_xludf." + name; } } - global_info_->arDefineNames.push_back(name);// для имен функций - todooo ... не все функции корректны !! БДИ !! + global_info_->arDefineNames.push_back(name);// for function names - todo ... not all functions are correct !! WATCH OUT !! } } diff --git a/OOXML/XlsbFormat/Xlsb.cpp b/OOXML/XlsbFormat/Xlsb.cpp index b353f6c317..9abc3ea15c 100644 --- a/OOXML/XlsbFormat/Xlsb.cpp +++ b/OOXML/XlsbFormat/Xlsb.cpp @@ -166,7 +166,7 @@ void OOX::Spreadsheet::CXlsb::WriteSheetData() for(auto &worksheet : m_arWorksheets) { - //для оптимизации по памяти сразу записываем в файл все листы + //for memory optimization, write all sheets to file immediately if(m_bWriteToXlsb) { WriteSheet(worksheet); @@ -228,7 +228,7 @@ void OOX::Spreadsheet::CXlsb::PrepareSi() } } -// подготовка гиперссылок для записи в xls +// prepare hyperlinks for writing to xls void OOX::Spreadsheet::CXlsb::PrepareHlinks() { for(auto i : m_arWorksheets) @@ -247,7 +247,7 @@ void OOX::Spreadsheet::CXlsb::PrepareHlinks() } } } -//подготовка шрифтов в richString для конвертации в xlsb +//prepare fonts in richString for conversion to xlsb void OOX::Spreadsheet::CXlsb::PrepareRichStr() { if(m_pStyles && m_pStyles->m_oFonts.IsInit()) @@ -281,7 +281,7 @@ void OOX::Spreadsheet::CXlsb::PrepareRichStr() } } } -//отложенный парсинг SheetData +//deferred parsing of SheetData void OOX::Spreadsheet::CXlsb::ReadSheetData() { for(auto &worksheet : m_arWorksheets) @@ -321,7 +321,7 @@ void OOX::Spreadsheet::CXlsb::ReadSheetData() //auto base = boost::static_pointer_cast<BaseObject>(cell_table_temlate); worksheet->m_oSheetData->fromBin(reader); delete[] m_pStream; - //для оптимизации по памяти сразу записываем в файл все листы + //for memory optimization, write all sheets to file immediately if(m_bWriteToXlsx) { WriteSheet(worksheet); diff --git a/OOXML/XlsxFormat/CalcChain/CalcChain.cpp b/OOXML/XlsxFormat/CalcChain/CalcChain.cpp index ad103a833c..c92ccf3a00 100644 --- a/OOXML/XlsxFormat/CalcChain/CalcChain.cpp +++ b/OOXML/XlsxFormat/CalcChain/CalcChain.cpp @@ -66,7 +66,7 @@ namespace OOX } void CCalcCell::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("a"), m_oArray ) diff --git a/OOXML/XlsxFormat/CalcChain/CalcChain.h b/OOXML/XlsxFormat/CalcChain/CalcChain.h index a848d8d33c..0c9abf542a 100644 --- a/OOXML/XlsxFormat/CalcChain/CalcChain.h +++ b/OOXML/XlsxFormat/CalcChain/CalcChain.h @@ -73,7 +73,7 @@ namespace OOX nullable<SimpleTypes::COnOff> m_oNewThread; }; - //необработанные child: + //not implemented children: //<extLst> class CCalcChain : public OOX::File, public OOX::IFileContainer { diff --git a/OOXML/XlsxFormat/Chart/ChartDrawing.cpp b/OOXML/XlsxFormat/Chart/ChartDrawing.cpp index e0555a5644..1b7f3c665a 100644 --- a/OOXML/XlsxFormat/Chart/ChartDrawing.cpp +++ b/OOXML/XlsxFormat/Chart/ChartDrawing.cpp @@ -228,14 +228,14 @@ namespace OOX // m_nId = shape->nvSpPr.cNvPr.id; // if (shape->nvSpPr.cNvPr.vmlSpid.IsInit()) // { - // //ссылка на объект или шейп в vmlDrawing + // //reference to object or shape in vmlDrawing // m_sVmlSpId = shape->nvSpPr.cNvPr.vmlSpid.get(); // } //} //smart_ptr<PPTX::Logic::GraphicFrame> frame = m_oElement->GetElem().smart_dynamic_cast<PPTX::Logic::GraphicFrame>(); //if ((frame.IsInit()) && (frame->vmlSpid.IsInit())) //{ - // //ссылка на объект или шейп в vmlDrawing + // //reference to object or shape in vmlDrawing // m_sVmlSpId = frame->vmlSpid.get(); //} } @@ -312,14 +312,14 @@ namespace OOX // m_nId = shape->nvSpPr.cNvPr.id; // if (shape->nvSpPr.cNvPr.vmlSpid.IsInit()) // { - // //ссылка на объект или шейп в vmlDrawing + // //reference to object or shape in vmlDrawing // m_sVmlSpId = shape->nvSpPr.cNvPr.vmlSpid.get(); // } //} //smart_ptr<PPTX::Logic::GraphicFrame> frame = m_oElement->GetElem().smart_dynamic_cast<PPTX::Logic::GraphicFrame>(); //if ((frame.IsInit()) && (frame->vmlSpid.IsInit())) //{ - // //ссылка на объект или шейп в vmlDrawing + // //reference to object or shape in vmlDrawing // m_sVmlSpId = frame->vmlSpid.get(); //} } diff --git a/OOXML/XlsxFormat/Common.cpp b/OOXML/XlsxFormat/Common.cpp index 01d69b1a4f..e51a312e9f 100644 --- a/OOXML/XlsxFormat/Common.cpp +++ b/OOXML/XlsxFormat/Common.cpp @@ -53,7 +53,7 @@ char* gcvt(double x, int n, char* b) std::wstring OOX::Spreadsheet::SpreadsheetCommon::WriteDouble(double dVal) { - //согласно http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2005.pdf + //according to http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2005.pdf //DBL_MAX = 15 digits, DBL_MAXDIG10 = 17 digits. char buffer[_CVTBUFSIZE]; _gcvt( dVal, DBL_MAXDIG10, buffer ); diff --git a/OOXML/XlsxFormat/ComplexTypes_Spreadsheet.cpp b/OOXML/XlsxFormat/ComplexTypes_Spreadsheet.cpp index 909678b043..35feb160c7 100644 --- a/OOXML/XlsxFormat/ComplexTypes_Spreadsheet.cpp +++ b/OOXML/XlsxFormat/ComplexTypes_Spreadsheet.cpp @@ -337,7 +337,7 @@ namespace ComplexTypes } void CChartBarGrouping::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, _T("val"), m_oVal ) WritingElement_ReadAttributes_End( oReader ) diff --git a/OOXML/XlsxFormat/Drawing/CellAnchor.cpp b/OOXML/XlsxFormat/Drawing/CellAnchor.cpp index e8b240e7a3..2c3c88c976 100644 --- a/OOXML/XlsxFormat/Drawing/CellAnchor.cpp +++ b/OOXML/XlsxFormat/Drawing/CellAnchor.cpp @@ -228,14 +228,14 @@ namespace OOX m_nId = shape->nvSpPr.cNvPr.id; if (shape->nvSpPr.cNvPr.vmlSpid.IsInit()) { - //ссылка на объект или шейп в vmlDrawing + //reference to object or shape in vmlDrawing m_sVmlSpId = shape->nvSpPr.cNvPr.vmlSpid.get(); } } smart_ptr<PPTX::Logic::GraphicFrame> frame = m_oElement->GetElem().smart_dynamic_cast<PPTX::Logic::GraphicFrame>(); if ((frame.IsInit()) && (frame->vmlSpid.IsInit())) { - //ссылка на объект или шейп в vmlDrawing + //reference to object or shape in vmlDrawing m_sVmlSpId = frame->vmlSpid.get(); } } diff --git a/OOXML/XlsxFormat/Drawing/CellAnchor.h b/OOXML/XlsxFormat/Drawing/CellAnchor.h index 47d89cda35..27a2c179d0 100644 --- a/OOXML/XlsxFormat/Drawing/CellAnchor.h +++ b/OOXML/XlsxFormat/Drawing/CellAnchor.h @@ -119,7 +119,7 @@ namespace OOX nullable<PPTX::Logic::SpTreeElem> m_oElement; - //для удобства + //for convenience nullable<std::wstring> m_sVmlSpId; nullable<int> m_nId; }; diff --git a/OOXML/XlsxFormat/Drawing/Pos.cpp b/OOXML/XlsxFormat/Drawing/Pos.cpp index 05fb2d98ee..e5914d63e3 100644 --- a/OOXML/XlsxFormat/Drawing/Pos.cpp +++ b/OOXML/XlsxFormat/Drawing/Pos.cpp @@ -70,7 +70,7 @@ namespace OOX } void CPos::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("x"), m_oX ) diff --git a/OOXML/XlsxFormat/Drawing/Pos.h b/OOXML/XlsxFormat/Drawing/Pos.h index b06484e5fe..a147289509 100644 --- a/OOXML/XlsxFormat/Drawing/Pos.h +++ b/OOXML/XlsxFormat/Drawing/Pos.h @@ -45,7 +45,7 @@ namespace OOX { namespace Spreadsheet { - //необработано: + //not implemented: //<extLst> class CPos : public WritingElementWithChilds<> { diff --git a/OOXML/XlsxFormat/Pivot/Pivots.cpp b/OOXML/XlsxFormat/Pivot/Pivots.cpp index 34cd0a78ac..ba31c951ef 100644 --- a/OOXML/XlsxFormat/Pivot/Pivots.cpp +++ b/OOXML/XlsxFormat/Pivot/Pivots.cpp @@ -786,7 +786,7 @@ xmlns:xr16=\"http://schemas.microsoft.com/office/spreadsheetml/2017/revision16\" ptr->colFirstData = ptr->ref.columnFirst; } if(m_oCacheId.IsInit()) - ptr->iCache = m_oCacheId->GetValue() +1; //при записи id заменится на index + ptr->iCache = m_oCacheId->GetValue() +1; //during writing, id will be replaced with index ptr->sxaxis4Data.bCol = true; if(m_oDataPosition.IsInit()) ptr->ipos4Data = m_oDataPosition->GetValue(); @@ -4169,7 +4169,7 @@ xmlns:xr16=\"http://schemas.microsoft.com/office/spreadsheetml/2017/revision16\" m_oPivotCashDefinition = oReader; } - IFileContainer::Read( oRootPath, oPath ); //в данном случае порядок считывания важен для xlsb + IFileContainer::Read( oRootPath, oPath ); //in this case reading order is important for xlsb } void CPivotCacheDefinitionFile::write(const CPath& oPath, const CPath& oDirectory, CContentTypes& oContent) const { @@ -7542,7 +7542,7 @@ xmlns:xr16=\"http://schemas.microsoft.com/office/spreadsheetml/2017/revision16\" { BYTE* fileStream = 0; auto fileReader = xlsb->GetFileReader(oPath, fileStream); - ///todo чтение записей из стрима + ///todo reading records from stream m_oPivotCacheRecords.Init(); m_oPivotCacheRecords->fromBin(fileReader); delete[] fileStream; diff --git a/OOXML/XlsxFormat/SharedStrings/PhoneticPr.cpp b/OOXML/XlsxFormat/SharedStrings/PhoneticPr.cpp index 1f0b6bae30..2bd8ae3a98 100644 --- a/OOXML/XlsxFormat/SharedStrings/PhoneticPr.cpp +++ b/OOXML/XlsxFormat/SharedStrings/PhoneticPr.cpp @@ -120,7 +120,7 @@ namespace OOX } void CPhonetic::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("alignment"), m_oAlignment ) @@ -234,7 +234,7 @@ namespace OOX } void CRPh::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("eb"), m_oEb ) diff --git a/OOXML/XlsxFormat/SharedStrings/PhoneticPr.h b/OOXML/XlsxFormat/SharedStrings/PhoneticPr.h index 2c63de3ae1..29d90b9bbe 100644 --- a/OOXML/XlsxFormat/SharedStrings/PhoneticPr.h +++ b/OOXML/XlsxFormat/SharedStrings/PhoneticPr.h @@ -47,7 +47,7 @@ namespace OOX { namespace Spreadsheet { - //необработано: + //not implemented: class CPhonetic : public WritingElement { public: diff --git a/OOXML/XlsxFormat/SharedStrings/Run.h b/OOXML/XlsxFormat/SharedStrings/Run.h index 6cd18133c5..6a339785b7 100644 --- a/OOXML/XlsxFormat/SharedStrings/Run.h +++ b/OOXML/XlsxFormat/SharedStrings/Run.h @@ -38,7 +38,7 @@ namespace OOX { namespace Spreadsheet { - //необработано: + //not implemented: class CRun : public WritingElementWithChilds<CText> { public: diff --git a/OOXML/XlsxFormat/SharedStrings/Si.cpp b/OOXML/XlsxFormat/SharedStrings/Si.cpp index 96abd48d89..f919541572 100644 --- a/OOXML/XlsxFormat/SharedStrings/Si.cpp +++ b/OOXML/XlsxFormat/SharedStrings/Si.cpp @@ -276,7 +276,7 @@ namespace OOX for(auto &strRun : ptr->rgsStrRun) { ++index; - //если сначала пробелы (может, не только для пробелов так) + //if there are leading spaces (possibly not only for spaces) if(index == 1 && strRun.ich != 0) { auto r0 = new CRun(); diff --git a/OOXML/XlsxFormat/SharedStrings/Si.h b/OOXML/XlsxFormat/SharedStrings/Si.h index d8680db278..d96e655715 100644 --- a/OOXML/XlsxFormat/SharedStrings/Si.h +++ b/OOXML/XlsxFormat/SharedStrings/Si.h @@ -44,7 +44,7 @@ namespace OOX { namespace Spreadsheet { - //необработано: + //not implemented: //<extLst> class CSi : public WritingElementWithChilds<> { diff --git a/OOXML/XlsxFormat/SharedStrings/Text.h b/OOXML/XlsxFormat/SharedStrings/Text.h index d44e6648de..b76d956f02 100644 --- a/OOXML/XlsxFormat/SharedStrings/Text.h +++ b/OOXML/XlsxFormat/SharedStrings/Text.h @@ -76,7 +76,7 @@ namespace OOX CStringXLSB m_oValue; }; - //необработано: + //not implemented: class CText : public WritingElement { public: diff --git a/OOXML/XlsxFormat/Styles/CellStyles.h b/OOXML/XlsxFormat/Styles/CellStyles.h index 1dfa493ce7..4c0f093042 100644 --- a/OOXML/XlsxFormat/Styles/CellStyles.h +++ b/OOXML/XlsxFormat/Styles/CellStyles.h @@ -44,7 +44,7 @@ namespace OOX { namespace Spreadsheet { - //нереализован: + //not implemented: //<extLst> class CCellStyle : public WritingElement { diff --git a/OOXML/XlsxFormat/Styles/Colors.cpp b/OOXML/XlsxFormat/Styles/Colors.cpp index 017876997b..2f523d590a 100644 --- a/OOXML/XlsxFormat/Styles/Colors.cpp +++ b/OOXML/XlsxFormat/Styles/Colors.cpp @@ -140,7 +140,7 @@ namespace OOX } void CColors::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("count"), m_oCount ) WritingElement_ReadAttributes_End( oReader ) diff --git a/OOXML/XlsxFormat/Styles/TableStyles.cpp b/OOXML/XlsxFormat/Styles/TableStyles.cpp index 6c72e16eb8..e757b2464e 100644 --- a/OOXML/XlsxFormat/Styles/TableStyles.cpp +++ b/OOXML/XlsxFormat/Styles/TableStyles.cpp @@ -241,7 +241,7 @@ namespace OOX } void CTableStyleElement::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("dxfId"), m_oDxfId ) @@ -573,7 +573,7 @@ namespace OOX } void CTableStyles::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("count"), m_oCount ) diff --git a/OOXML/XlsxFormat/Styles/TableStyles.h b/OOXML/XlsxFormat/Styles/TableStyles.h index 37d44aa13c..57fd72653c 100644 --- a/OOXML/XlsxFormat/Styles/TableStyles.h +++ b/OOXML/XlsxFormat/Styles/TableStyles.h @@ -104,7 +104,7 @@ namespace OOX nullable<std::wstring> m_oName; nullable<SimpleTypes::COnOff> m_oPivot; nullable<SimpleTypes::COnOff> m_oTable; - nullable<std::wstring> m_oDisplayName; // Используется только для дефалтовых стилей + nullable<std::wstring> m_oDisplayName; // Used only for default styles }; class CTableStyles : public WritingElementWithChilds<CTableStyle> diff --git a/OOXML/XlsxFormat/Styles/Xfs.cpp b/OOXML/XlsxFormat/Styles/Xfs.cpp index ae82125af0..610cf1f87d 100644 --- a/OOXML/XlsxFormat/Styles/Xfs.cpp +++ b/OOXML/XlsxFormat/Styles/Xfs.cpp @@ -636,7 +636,7 @@ namespace OOX } void CCellXfs::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("count"), m_oCount ) diff --git a/OOXML/XlsxFormat/Styles/Xfs.h b/OOXML/XlsxFormat/Styles/Xfs.h index 021b367595..54d94c8b8b 100644 --- a/OOXML/XlsxFormat/Styles/Xfs.h +++ b/OOXML/XlsxFormat/Styles/Xfs.h @@ -119,7 +119,7 @@ namespace OOX nullable<SimpleTypes::COnOff> m_oLocked; }; - //нереализован: + //not implemented: //<extLst> class CXfs : public WritingElement { diff --git a/OOXML/XlsxFormat/Styles/dxf.cpp b/OOXML/XlsxFormat/Styles/dxf.cpp index a92eb6cd25..a3a77772e2 100644 --- a/OOXML/XlsxFormat/Styles/dxf.cpp +++ b/OOXML/XlsxFormat/Styles/dxf.cpp @@ -371,7 +371,7 @@ namespace OOX } void CDxfs::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("count"), m_oCount ) WritingElement_ReadAttributes_End( oReader ) diff --git a/OOXML/XlsxFormat/Styles/rPr.cpp b/OOXML/XlsxFormat/Styles/rPr.cpp index f619e72ac7..a461288864 100644 --- a/OOXML/XlsxFormat/Styles/rPr.cpp +++ b/OOXML/XlsxFormat/Styles/rPr.cpp @@ -430,7 +430,7 @@ namespace OOX } void CColor::toXML(NSStringUtils::CStringBuilder& writer) const { - // вызовем по default + // call with default value toXML2(writer, _T("color")); } void CColor::toXML2(NSStringUtils::CStringBuilder& writer, const std::wstring& sName) const diff --git a/OOXML/XlsxFormat/Styles/rPr.h b/OOXML/XlsxFormat/Styles/rPr.h index eeca74526b..4d8d1bd9b2 100644 --- a/OOXML/XlsxFormat/Styles/rPr.h +++ b/OOXML/XlsxFormat/Styles/rPr.h @@ -291,7 +291,7 @@ namespace OOX nullable<SimpleTypes::Spreadsheet::CUnderline> m_oUnderline; }; - //необработано: + //not implemented: class CRPr : public WritingElement { public: diff --git a/OOXML/XlsxFormat/Table/Autofilter.cpp b/OOXML/XlsxFormat/Table/Autofilter.cpp index 398f5b1ee7..76768680d5 100644 --- a/OOXML/XlsxFormat/Table/Autofilter.cpp +++ b/OOXML/XlsxFormat/Table/Autofilter.cpp @@ -230,7 +230,7 @@ namespace OOX } void CSortCondition::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("descending"), m_oDescending ) @@ -460,7 +460,7 @@ namespace OOX } void CSortState::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("ref"), m_oRef ) @@ -545,7 +545,7 @@ namespace OOX } void CColorFilter::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("cellColor"), m_oCellColor ) @@ -703,7 +703,7 @@ namespace OOX } void CDynamicFilter::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("type"), m_oType ) @@ -913,7 +913,7 @@ namespace OOX } void CCustomFilter::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("operator"), m_oOperator ) @@ -1044,7 +1044,7 @@ namespace OOX } void CCustomFilters::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("and"), m_oAnd ) @@ -1125,7 +1125,7 @@ namespace OOX } void CFilter::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("val"), m_oVal ) @@ -1248,7 +1248,7 @@ namespace OOX } void CDateGroupItem::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("dateTimeGrouping"), m_oDateTimeGrouping ) @@ -1392,10 +1392,10 @@ namespace OOX for(auto i: m_arrItems) { if (CFilter* cfilter = dynamic_cast<CFilter*>(i)) { - // Элемент является экземпляром класса CFilter + // Element is an instance of CFilter class ptr->m_arBrtFilter.push_back(cfilter->toBin()); } else if (CDateGroupItem* groupItem = dynamic_cast<CDateGroupItem*>(i)) { - // Элемент является экземпляром класса CDateGroupItem + // Element is an instance of CDateGroupItem class ptr->m_arBrtAFilterDateGroupItem.push_back(groupItem->toBin()); } } @@ -1407,7 +1407,7 @@ namespace OOX } void CFilters::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("blank"), m_oBlank ) @@ -1495,7 +1495,7 @@ namespace OOX } void CTop10::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("filterVal"), m_oFilterVal ) @@ -1652,7 +1652,7 @@ namespace OOX else ptr->ft = 2; //auto dxfn = new XLS::DXFN12; - //todo: сделать копирование структуры dxfn12 из стилей по id + //todo: copy dxfn12 structure from styles by id } else if(m_oFilters.IsInit() || m_oCustomFilters.IsInit()) { @@ -1684,7 +1684,7 @@ namespace OOX } void CFilterColumn::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("colId"), m_oColId ) diff --git a/OOXML/XlsxFormat/Table/Table.h b/OOXML/XlsxFormat/Table/Table.h index ebc132f9d8..83b7d51bcd 100644 --- a/OOXML/XlsxFormat/Table/Table.h +++ b/OOXML/XlsxFormat/Table/Table.h @@ -381,7 +381,7 @@ namespace OOX nullable<SimpleTypes::CUnsignedDecimalNumber> m_oCount; }; - //необработанные child: + //not implemented children: //<extLst> class CTableFile : public OOX::FileGlobalEnumerated, public OOX::IFileContainer { diff --git a/OOXML/XlsxFormat/Table/Tables.cpp b/OOXML/XlsxFormat/Table/Tables.cpp index f551efb58f..f4b1c65bc9 100644 --- a/OOXML/XlsxFormat/Table/Tables.cpp +++ b/OOXML/XlsxFormat/Table/Tables.cpp @@ -318,7 +318,7 @@ namespace Spreadsheet WritingStringNullableAttrEncodeXmlString(L"name", m_oName, *m_oName); WritingStringNullableAttrEncodeXmlString(L"uniqueName", m_oUniqueName, *m_oUniqueName); WritingStringNullableAttrEncodeXmlString(L"totalsRowLabel", m_oTotalsRowLabel, m_oTotalsRowLabel.get()); - //есть такой баг: при сохранениии "sum" и названия таблицы "Table1" (русский excel), выдается ошибка в формулах + //there is a bug: when saving "sum" and table name "Table1" (Russian Excel), a formula error occurs WritingStringNullableAttrString(L"totalsRowFunction", m_oTotalsRowFunction, m_oTotalsRowFunction->ToString()); WritingStringNullableAttrInt(L"queryTableFieldId", m_oQueryTableFieldId, m_oQueryTableFieldId->GetValue()); WritingStringNullableAttrString(L"dataCellStyle", m_oDataCellStyle, *m_oDataCellStyle); diff --git a/OOXML/XlsxFormat/Workbook/BookViews.h b/OOXML/XlsxFormat/Workbook/BookViews.h index 5570c88849..48b8377e53 100644 --- a/OOXML/XlsxFormat/Workbook/BookViews.h +++ b/OOXML/XlsxFormat/Workbook/BookViews.h @@ -50,7 +50,7 @@ namespace OOX { namespace Spreadsheet { - //необработано: + //not implemented: //<extLst> class CWorkbookView : public WritingElement { diff --git a/OOXML/XlsxFormat/Workbook/CalcPr.cpp b/OOXML/XlsxFormat/Workbook/CalcPr.cpp index 739b5cb9dd..d96d611d06 100644 --- a/OOXML/XlsxFormat/Workbook/CalcPr.cpp +++ b/OOXML/XlsxFormat/Workbook/CalcPr.cpp @@ -146,7 +146,7 @@ namespace OOX } void CCalcPr::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("calcId"), m_oCalcId ) diff --git a/OOXML/XlsxFormat/Workbook/DefinedNames.h b/OOXML/XlsxFormat/Workbook/DefinedNames.h index 5ec66e87bc..065afa6e8d 100644 --- a/OOXML/XlsxFormat/Workbook/DefinedNames.h +++ b/OOXML/XlsxFormat/Workbook/DefinedNames.h @@ -44,7 +44,7 @@ namespace OOX { namespace Spreadsheet { - //необработано: + //not implemented: //<extLst> class CDefinedName : public WritingElement { diff --git a/OOXML/XlsxFormat/Workbook/Sheets.h b/OOXML/XlsxFormat/Workbook/Sheets.h index a6b3a467e4..fde41a9bbc 100644 --- a/OOXML/XlsxFormat/Workbook/Sheets.h +++ b/OOXML/XlsxFormat/Workbook/Sheets.h @@ -49,7 +49,7 @@ namespace OOX { namespace Spreadsheet { - //необработано: + //not implemented: //<extLst> class CSheet : public WritingElement { diff --git a/OOXML/XlsxFormat/Workbook/Workbook.cpp b/OOXML/XlsxFormat/Workbook/Workbook.cpp index 5deabdba8b..77f73d5ecf 100644 --- a/OOXML/XlsxFormat/Workbook/Workbook.cpp +++ b/OOXML/XlsxFormat/Workbook/Workbook.cpp @@ -564,7 +564,7 @@ namespace OOX } } - IFileContainer::Read(oRootPath, oPath); //в данном случае порядок считывания важен для xlsb + IFileContainer::Read(oRootPath, oPath); //in this case reading order is important for xlsb CXlsx* xlsx = dynamic_cast<CXlsx*>(File::m_pMainDocument); if (xlsx) @@ -573,7 +573,7 @@ namespace OOX { m_bMacroEnabled = true; } - //дубли листов + //duplicate sheets for (auto elm : this->m_mapContainer) { if (elm.second->type() == OOX::Spreadsheet::FileTypes::Chartsheets || elm.second->type() == OOX::Spreadsheet::FileTypes::Worksheet) @@ -753,7 +753,7 @@ xmlns:xr2=\"http://schemas.microsoft.com/office/spreadsheetml/2015/revision2\"\ //WorkbookPr if (false == m_oWorkbookPr.IsInit()) m_oWorkbookPr.Init(); - //todo если этот параметр выставлен, то берется стандартная тема, а не из файла. + //todo if this parameter is set, then the standard theme is used, not from the file. //if(false == m_oWorkbookPr->m_oDefaultThemeVersion.IsInit()) //{ // m_oWorkbookPr->m_oDefaultThemeVersion.Init(); @@ -792,7 +792,7 @@ xmlns:xr2=\"http://schemas.microsoft.com/office/spreadsheetml/2015/revision2\"\ LONG CWorkbook::GetActiveSheetIndex() { LONG lActiveSheet = 0; - std::wstring sSheetRId = L"Sheet1"; // Читаем не по rId, а по имени листа + std::wstring sSheetRId = L"Sheet1"; // Read by sheet name, not by rId // Get active sheet if (m_oBookViews.IsInit() && !m_oBookViews->m_arrItems.empty()) { diff --git a/OOXML/XlsxFormat/Workbook/Workbook.h b/OOXML/XlsxFormat/Workbook/Workbook.h index f41d5dcf0d..f4b3d48360 100644 --- a/OOXML/XlsxFormat/Workbook/Workbook.h +++ b/OOXML/XlsxFormat/Workbook/Workbook.h @@ -55,7 +55,7 @@ namespace OOX { class CPersonList; - //необработанные child: + //not implemented children: //<customWorkbookViews> //<extLst> //<fileRecoveryPr> diff --git a/OOXML/XlsxFormat/Worksheets/Cols.h b/OOXML/XlsxFormat/Worksheets/Cols.h index f2c2cdc3de..93c4ab9d6e 100644 --- a/OOXML/XlsxFormat/Worksheets/Cols.h +++ b/OOXML/XlsxFormat/Worksheets/Cols.h @@ -45,7 +45,7 @@ namespace OOX { namespace Spreadsheet { - //необработано: + //not implemented: //<extLst> class CCol : public WritingElement { diff --git a/OOXML/XlsxFormat/Worksheets/ConditionalFormatting.cpp b/OOXML/XlsxFormat/Worksheets/ConditionalFormatting.cpp index 107bd901ad..5d4dba1a55 100644 --- a/OOXML/XlsxFormat/Worksheets/ConditionalFormatting.cpp +++ b/OOXML/XlsxFormat/Worksheets/ConditionalFormatting.cpp @@ -787,7 +787,7 @@ void CColorScale::toXML2(NSStringUtils::CStringBuilder& writer, bool bExtendedWr std::wstring sValue; writer.WriteString(L"<colorScale>"); - for ( size_t i = 0; i < m_arrValues.size(); ++i)//todooo - проверить можно ли не чередовать,а как есть записать + for ( size_t i = 0; i < m_arrValues.size(); ++i)//todooo - check if we can write as is without alternating { if ( m_arrValues[i].IsInit() ) { diff --git a/OOXML/XlsxFormat/Worksheets/ConditionalFormatting.h b/OOXML/XlsxFormat/Worksheets/ConditionalFormatting.h index 287c67d8b2..1f1f6bb7c3 100644 --- a/OOXML/XlsxFormat/Worksheets/ConditionalFormatting.h +++ b/OOXML/XlsxFormat/Worksheets/ConditionalFormatting.h @@ -65,7 +65,7 @@ namespace OOX class CDxf; class CColor; - //необработано: + //not implemented: //<extLst> class CFormulaCF : public WritingElement { @@ -395,7 +395,7 @@ namespace OOX public: nullable<SimpleTypes::COnOff> m_oPivot; - nullable<std::wstring > m_oSqRef; // ToDo переделать на тип "sqref" (18.18.76) - последовательность "ref", разделенные пробелом + nullable<std::wstring > m_oSqRef; // ToDo convert to "sqref" type (18.18.76) - sequence of "ref" separated by space }; } //Spreadsheet diff --git a/OOXML/XlsxFormat/Worksheets/DataValidation.h b/OOXML/XlsxFormat/Worksheets/DataValidation.h index bd36656182..b2489552cb 100644 --- a/OOXML/XlsxFormat/Worksheets/DataValidation.h +++ b/OOXML/XlsxFormat/Worksheets/DataValidation.h @@ -53,7 +53,7 @@ namespace OOX { namespace Spreadsheet { - class CDataValidationFormula : public WritingElement //тоже что и CFormulaCF + class CDataValidationFormula : public WritingElement //same as CFormulaCF { public: WritingElement_AdditionMethods(CDataValidationFormula) @@ -115,7 +115,7 @@ namespace OOX nullable<SimpleTypes::COnOff> m_oShowErrorMessage; nullable<SimpleTypes::COnOff> m_oShowInputMessage; - nullable_string m_oSqRef; // ToDo переделать на тип "sqref" (18.18.76) - последовательность "ref", разделенные пробелом + nullable_string m_oSqRef; // ToDo convert to "sqref" type (18.18.76) - sequence of "ref" separated by space nullable_string m_oList; mutable nullable_string m_oUuid; nullable<CDataValidationFormula> m_oFormula1; diff --git a/OOXML/XlsxFormat/Worksheets/Hyperlinks.h b/OOXML/XlsxFormat/Worksheets/Hyperlinks.h index 435d2796e4..bd4b8e6ec0 100644 --- a/OOXML/XlsxFormat/Worksheets/Hyperlinks.h +++ b/OOXML/XlsxFormat/Worksheets/Hyperlinks.h @@ -43,7 +43,7 @@ namespace OOX { namespace Spreadsheet { - //необработано: + //not implemented: //<extLst> class CHyperlink : public WritingElement { diff --git a/OOXML/XlsxFormat/Worksheets/MergeCells.h b/OOXML/XlsxFormat/Worksheets/MergeCells.h index cf3f70b98f..792ebbebbc 100644 --- a/OOXML/XlsxFormat/Worksheets/MergeCells.h +++ b/OOXML/XlsxFormat/Worksheets/MergeCells.h @@ -44,7 +44,7 @@ namespace OOX { namespace Spreadsheet { - //необработано: + //not implemented: //<extLst> class CMergeCell : public WritingElement { diff --git a/OOXML/XlsxFormat/Worksheets/SheetData.cpp b/OOXML/XlsxFormat/Worksheets/SheetData.cpp index 57760939a2..3d9549c70d 100644 --- a/OOXML/XlsxFormat/Worksheets/SheetData.cpp +++ b/OOXML/XlsxFormat/Worksheets/SheetData.cpp @@ -1151,7 +1151,7 @@ namespace OOX } void CFormula::fromBin(XLS::StreamCacheReaderPtr& reader, XLS::CFRecordPtr& record) { - //читаем остатки данных в записи ячейки + //read remaining data in the cell record { XLSB::GrbitFmla flags; *record >> flags; @@ -1214,7 +1214,7 @@ namespace OOX { XLS::CellParsedFormula BinFmla(false); *record >> BinFmla; - //случай если в формуле есть ссылка на другую + //case when the formula contains a reference to another one if(!BinFmla.rgce.isEmpty() && BinFmla.rgce.sequence.begin()->get()->ptg_id.get() == 1 && !BinFmla.rgcb.isEmpty()) { auto rowPart = static_cast<XLS::PtgExp*>(BinFmla.rgce.sequence.begin()->get()); @@ -1494,7 +1494,7 @@ namespace OOX { case SimpleTypes::Spreadsheet::ECellFormulaType::cellformulatypeNormal: { - //пишем флаги для формулы + //write flags for the formula { XLSB::GrbitFmla flags; if(m_oAca.IsInit() && m_oAca->GetValue()) @@ -1756,7 +1756,7 @@ namespace OOX else if ( strcmp("is", sName) == 0 ) m_oRichText = oReader; else if ( strcmp("NamedCell", sName) == 0 ) - {//дублирование имен + {//duplicate names } //o:SmartTags, x:PhoneticText } @@ -2028,7 +2028,7 @@ namespace OOX if (false == xlsx->m_arWorksheets.back()->m_bPrepareForBinaryWriter) return; if (!xlsx->m_pSharedStrings) - { // еще не прочитался rels + { // rels not yet read xlsx->m_arWorksheets.back()->m_bPrepareForBinaryWriter = false; return; } @@ -2054,10 +2054,10 @@ namespace OOX if (NULL != pSi) { int nIndex = pSharedStrings->AddSi(pSi); - //меняем значение ячейки + //change cell value m_oValue.Init(); m_oValue->m_sText = std::to_wstring(nIndex); - //меняем тип ячейки + //change cell type m_oType.Init(); m_oType->SetValue(SimpleTypes::Spreadsheet::celltypeSharedString); } @@ -2071,7 +2071,7 @@ namespace OOX xlsx->CreateSharedStrings(); pSharedStrings = xlsx->m_pSharedStrings; } - //добавляем в SharedStrings + //add to SharedStrings CSi* pSi = new CSi(); CText* pText = new CText(); @@ -2080,10 +2080,10 @@ namespace OOX int nIndex = pSharedStrings->AddSi(pSi); - //меняем значение ячейки + //change cell value m_oValue.Init(); m_oValue->m_sText = std::to_wstring(nIndex); - //меняем тип ячейки + //change cell type if (SimpleTypes::Spreadsheet::celltypeStr == m_oType->GetValue()) { m_oType.Init(); @@ -2098,7 +2098,7 @@ namespace OOX } else if (SimpleTypes::Spreadsheet::celltypeBool == m_oType->GetValue()) { - //обычно пишется 1/0, но встречается, что пишут true/false + //usually written as 1/0, but sometimes true/false is encountered if (m_oValue.IsInit()) { SimpleTypes::COnOff oOnOff; @@ -3091,11 +3091,11 @@ namespace OOX m_oType->SetValue(processCellType(m_oValue.get().m_sText, isReal, realCache)); } auto cellType = m_oType->GetValue(); - //основная запись ячейки + //main cell record CFRecordPtr CellRecord; - // дополнительная запись для shared, array и table формул + // additional record for shared, array, and table formulas CFRecordPtr ExtraRecord; - //обработка celltype datatable + //processing celltype datatable if(m_oFormula.IsInit() && m_oFormula->m_oT.IsInit() && m_oFormula->m_oT->GetValue() == SimpleTypes::Spreadsheet::ECellFormulaType::cellformulatypeDataTable) { ExtraRecord = writer->getNextRecord(XLSB::rt_Table); @@ -3104,7 +3104,7 @@ namespace OOX m_oFormula.reset(); ExtraRecord.reset(); } - //обработка метаданных ячейки + //processing cell metadata if(m_oCellMetadata.IsInit()) { auto metaRecord = writer->getNextRecord(XLSB::rt_CellMeta); @@ -3270,7 +3270,7 @@ namespace OOX SharedFmlaRef = &SharedFormulasRef::sharedRefsLocations->at(m_oFormula->m_oSi->GetValue()); XLS::CellParsedFormula BinFmla(false); - //пишем флаги для формулы + //write flags for the formula { XLSB::GrbitFmla flags; if(m_oFormula->m_oAca.IsInit() && m_oFormula->m_oAca->GetValue()) @@ -3301,7 +3301,7 @@ namespace OOX SharedFmlaRef = &CellReference; } XLS::CellParsedFormula BinFmla(false); - //пишем флаги для формулы + //write flags for the formula { XLSB::GrbitFmla flags; if(m_oFormula->m_oAca.IsInit() && m_oFormula->m_oAca->GetValue()) @@ -4132,7 +4132,7 @@ namespace OOX CCell *pCell = new CCell(m_pMainDocument); if (pCell) { - //пытаемся сжать пустые клетки + //try to compress empty cells pCell->fromXML(oReader); if(!compressCell(pCell)) m_arrItems.push_back(pCell); @@ -4211,7 +4211,7 @@ namespace OOX pCell->m_oRow = m_oR->GetValue()-1; if(pCell->fromBin(reader)) { - //пытаемся сжать пустые клетки + //try to compress empty cells if(!compressCell(pCell)) m_arrItems.push_back(pCell); else @@ -5080,7 +5080,7 @@ namespace OOX { CRow *pRow = new CRow(m_pMainDocument); pRow->fromBin(reader); - //проверяем можно ли сжать пустые строки + //check if we can compress empty rows if(!compressRow(pRow)) m_arrItems.push_back(pRow); else @@ -5230,13 +5230,13 @@ namespace OOX prevRow->m_oRepeated = 1; if(prevRow->m_oR->GetValue() + prevRow->m_oRepeated.get() == pRow->m_oR->GetValue() && prevRow->m_oHt == pRow->m_oHt) { - //случай с пустыми строками + //case with empty rows if(prevRow->m_arrItems.empty() && pRow->m_arrItems.empty()) { prevRow->m_oRepeated = prevRow->m_oRepeated.get() + 1; return true; } - //случай со строками заполненными однотипными сжатыми клетками + //case with rows filled with compressed cells of the same type if(prevRow->m_arrItems.size() == 1 && pRow->m_arrItems.size() == 1 && prevRow->m_arrItems.back()->m_oRepeated.IsInit() && pRow->m_arrItems.back()->m_oRepeated.get() == prevRow->m_arrItems.back()->m_oRepeated.get()) { diff --git a/OOXML/XlsxFormat/Worksheets/SheetData.h b/OOXML/XlsxFormat/Worksheets/SheetData.h index cd4ba8dd7b..6c0969ce74 100644 --- a/OOXML/XlsxFormat/Worksheets/SheetData.h +++ b/OOXML/XlsxFormat/Worksheets/SheetData.h @@ -283,12 +283,12 @@ namespace OOX nullable<CSi> m_oRichText; nullable<CText> m_oValue; //----------------------------- - //число повторов чтобы хранить одинаковые в одной + //repeat count to store identical values in one nullable_uint m_oRepeated; nullable_string m_oCacheValue; }; - //необработано: + //not implemented: //<extLst> class CRow : public WritingElementWithChilds<CCell> { @@ -314,7 +314,7 @@ namespace OOX XLS::BaseObjectPtr toXLS(); void toBin(XLS::StreamCacheWriterPtr& writer); void WriteAttributes(XLS::StreamCacheWriterPtr& writer); - //удалить хранимые ячейки и кэшировать данные для экономии памяти + //delete stored cells and cache data for memory saving void storeXmlCache(); virtual EElementType getType () const; @@ -324,7 +324,7 @@ namespace OOX void ReadAttributes(XLS::BaseObjectPtr& obj); void CheckIndex(); bool compressCell(CCell* pCell); - //xml кэш чтобы не хранить ячеки + //xml cache to avoid storing cells nullable_string m_oDataCache; public: @@ -340,7 +340,7 @@ namespace OOX nullable<SimpleTypes::COnOff> m_oThickBot; nullable<SimpleTypes::COnOff> m_oThickTop; nullable<SimpleTypes::CDouble> m_oDyDescent; - //число повторов для сжатия пустых строк + //repeat count for compressing empty rows nullable_uint m_oRepeated; }; @@ -358,7 +358,7 @@ namespace OOX virtual void toXML(NSStringUtils::CStringBuilder& writer) const; virtual void toXMLStart(NSStringUtils::CStringBuilder& writer) const; virtual void toXMLEnd(NSStringUtils::CStringBuilder& writer) const; - //добавить кэшированное xml значение строки для экономии памяти + //add cached xml row value for memory saving void AddRowToCache(CRow &row); virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); diff --git a/OOXML/XlsxFormat/Worksheets/Worksheet.cpp b/OOXML/XlsxFormat/Worksheets/Worksheet.cpp index 282694945b..79f70e1c66 100644 --- a/OOXML/XlsxFormat/Worksheets/Worksheet.cpp +++ b/OOXML/XlsxFormat/Worksheets/Worksheet.cpp @@ -83,7 +83,7 @@ namespace OOX CXlsx* xlsx = dynamic_cast<CXlsx*>(pMain); if (xlsx) { - m_bPrepareForBinaryWriter = true; // подготовка для бинарника при чтении + m_bPrepareForBinaryWriter = true; // prepare for binary writer during reading xlsx->m_arWorksheets.push_back( this ); //xlsx->m_mapWorksheets.insert( std::make_pair(rId, this) ); diff --git a/OOXML/XlsxFormat/Worksheets/Worksheet.h b/OOXML/XlsxFormat/Worksheets/Worksheet.h index 9e99185e6b..29e772db8f 100644 --- a/OOXML/XlsxFormat/Worksheets/Worksheet.h +++ b/OOXML/XlsxFormat/Worksheets/Worksheet.h @@ -59,7 +59,7 @@ namespace OOX class CChartStyleFile; class CChartColorsFile; -//необработанные child: +//not implemented children: //<customProperties> //<extLst> //<phoneticPr> diff --git a/OOXML/XlsxFormat/Worksheets/WorksheetChildOther.cpp b/OOXML/XlsxFormat/Worksheets/WorksheetChildOther.cpp index f624fe0d27..ca55d8674f 100644 --- a/OOXML/XlsxFormat/Worksheets/WorksheetChildOther.cpp +++ b/OOXML/XlsxFormat/Worksheets/WorksheetChildOther.cpp @@ -1457,7 +1457,7 @@ namespace OOX void CSheetFormatPr::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { WritingElement_ReadAttributes_Start(oReader) - WritingElement_ReadAttributes_Read_if(oReader, (L"baseColWidth"), m_oBaseColWidth) // ToDo Excel не воспринимает значения не uint (мы приводим к uint) + WritingElement_ReadAttributes_Read_if(oReader, (L"baseColWidth"), m_oBaseColWidth) // ToDo Excel does not accept non-uint values (we convert to uint) WritingElement_ReadAttributes_Read_else_if(oReader, (L"customHeight"), m_oCustomHeight) WritingElement_ReadAttributes_Read_else_if(oReader, (L"defaultColWidth"), m_oDefaultColWidth) WritingElement_ReadAttributes_Read_else_if(oReader, (L"defaultRowHeight"), m_oDefaultRowHeight) @@ -2506,7 +2506,7 @@ namespace OOX } void COutlinePr::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты + // Read attributes WritingElement_ReadAttributes_Start(oReader) WritingElement_ReadAttributes_Read_if(oReader, (L"applyStyles"), m_oApplyStyles) WritingElement_ReadAttributes_Read_else_if(oReader, (L"showOutlineSymbols"), m_oShowOutlineSymbols) diff --git a/OOXML/XlsxFormat/Worksheets/WorksheetChildOther.h b/OOXML/XlsxFormat/Worksheets/WorksheetChildOther.h index 32f336b7b5..2ff64c742f 100644 --- a/OOXML/XlsxFormat/Worksheets/WorksheetChildOther.h +++ b/OOXML/XlsxFormat/Worksheets/WorksheetChildOther.h @@ -396,7 +396,7 @@ namespace OOX nullable<SimpleTypes::Spreadsheet::CActivePane> m_oPane; }; - //необработано: + //not implemented: //<extLst> //<pivotSelection> class CSheetView : public WritingElementWithChilds<CSelection> diff --git a/OOXML/XlsxFormat/Xlsx.cpp b/OOXML/XlsxFormat/Xlsx.cpp index 379e22bad8..1e9edc2611 100644 --- a/OOXML/XlsxFormat/Xlsx.cpp +++ b/OOXML/XlsxFormat/Xlsx.cpp @@ -408,7 +408,7 @@ void OOX::Spreadsheet::CXlsx::PrepareWorkbook() m_pWorkbook->m_oBookViews->m_arrItems.push_back(pWorkbookView); } - //добавляем sheet, если нет ни одного + //add sheet if there isn't one if (m_arWorksheets.empty()) { OOX::Spreadsheet::CWorksheet* pWorksheet = new OOX::Spreadsheet::CWorksheet(this); @@ -457,7 +457,7 @@ void OOX::Spreadsheet::CXlsx::PrepareWorkbook() m_pWorkbook->m_oSheets->m_arrItems.push_back(pSheet); } - //делаем так чтобы всегда были нулевые стили и первый font всегда имел шрифт и размер + //ensure that there are always zero styles and the first font always has font name and size if( m_pStyles ) { //Fonts @@ -538,12 +538,12 @@ void OOX::Spreadsheet::CXlsx::PrepareWorkbook() pXfs->m_oNumFmtId->SetValue(0); } } - //переносим теги <is> и ячейки с типом str в sharedString если они не перенеслисьпричтении + //move <is> tags and cells with str type to sharedString if they weren't moved during reading for (size_t i = 0; i < m_arWorksheets.size(); ++i) { PrepareWorksheet(m_arWorksheets[i]); } - //todo парсим даты в формате iso 8601 + //todo parse dates in iso 8601 format } void OOX::Spreadsheet::CXlsx::PrepareWorksheet(CWorksheet* pWorksheet) { @@ -577,10 +577,10 @@ void OOX::Spreadsheet::CXlsx::PrepareWorksheet(CWorksheet* pWorksheet) if(NULL != pSi) { int nIndex = m_pSharedStrings->AddSi(pSi); - //меняем значение ячейки + //change cell value pCell->m_oValue.Init(); pCell->m_oValue->m_sText = std::to_wstring(nIndex); - //меняем тип ячейки + //change cell type pCell->m_oType.Init(); pCell->m_oType->SetValue(SimpleTypes::Spreadsheet::celltypeSharedString); } @@ -591,17 +591,17 @@ void OOX::Spreadsheet::CXlsx::PrepareWorksheet(CWorksheet* pWorksheet) { if(!m_pSharedStrings) CreateSharedStrings(); - //добавляем в SharedStrings + //add to SharedStrings CSi* pSi = new CSi(); CText* pText = new CText(); pText->m_sText = pCell->m_oValue->ToString(); pSi->m_arrItems.push_back(pText); int nIndex = m_pSharedStrings->AddSi(pSi); - //меняем значение ячейки + //change cell value pCell->m_oValue.Init(); pCell->m_oValue->m_sText = std::to_wstring(nIndex); - //меняем тип ячейки + //change cell type if(SimpleTypes::Spreadsheet::celltypeStr == pCell->m_oType->GetValue()) { pCell->m_oType.Init(); @@ -616,7 +616,7 @@ void OOX::Spreadsheet::CXlsx::PrepareWorksheet(CWorksheet* pWorksheet) } else if(SimpleTypes::Spreadsheet::celltypeBool == pCell->m_oType->GetValue()) { - //обычно пишется 1/0, но встречается, что пишут true/false + //usually written as 1/0, but sometimes true/false is encountered if(pCell->m_oValue.IsInit()) { SimpleTypes::COnOff oOnOff; diff --git a/OdfFile/Common/CPColorUtils.h b/OdfFile/Common/CPColorUtils.h index 560cf3a94e..5589119811 100644 --- a/OdfFile/Common/CPColorUtils.h +++ b/OdfFile/Common/CPColorUtils.h @@ -33,11 +33,11 @@ namespace cpdoccore { -// поиск ближайшего цвета из +// find nearest color from // Black, Green, White, Blue, Magenta, Yellow, Cyan, Red std::wstring RGBToString(int r, int g, int b); -// разбор HEX-строки с цветом +// parse HEX string with color bool HEXStringToRGB(std::wstring const & str, int &r, int &g, int &b); } diff --git a/OdfFile/Common/CPOptional.h b/OdfFile/Common/CPOptional.h index a82e427ded..901559f8df 100644 --- a/OdfFile/Common/CPOptional.h +++ b/OdfFile/Common/CPOptional.h @@ -34,7 +34,7 @@ #include <boost/optional/optional_io.hpp> #include <boost/optional.hpp> -/// внешнее объявление для Optional, используем boost::optional +/// external declaration for Optional, using boost::optional template <class T> struct optional diff --git a/OdfFile/Common/readdocelement.h b/OdfFile/Common/readdocelement.h index 1e77428099..ec9d03d616 100644 --- a/OdfFile/Common/readdocelement.h +++ b/OdfFile/Common/readdocelement.h @@ -50,9 +50,9 @@ namespace cpdoccore { namespace common { - // Базовый класс для элемента, который может быть прочитан sax-reader -ом - // Для каждого элемента будут вызваны методы - // add_attributes, add_child_element, add_text как колбеки для чтения соответствующих данных + // Base class for element that can be read by sax-reader + // For each element the methods will be called + // add_attributes, add_child_element, add_text as callbacks for reading corresponding data class read_doc_element { diff --git a/OdfFile/Common/xml/attributes.cpp b/OdfFile/Common/xml/attributes.cpp index 5a5fd0b5a8..15c94ae1ba 100644 --- a/OdfFile/Common/xml/attributes.cpp +++ b/OdfFile/Common/xml/attributes.cpp @@ -40,7 +40,7 @@ namespace cpdoccore { namespace xml { -/// Вектор для обеспечения контроля доступа для всех прочитанных атрибутов +/// Vector for ensuring access control for all read attributes template <class T> class attribute_debug_vector { diff --git a/OdfFile/DataTypes/custom_shape_types_convert.h b/OdfFile/DataTypes/custom_shape_types_convert.h index 31a5c3b773..ceae4a582f 100644 --- a/OdfFile/DataTypes/custom_shape_types_convert.h +++ b/OdfFile/DataTypes/custom_shape_types_convert.h @@ -53,7 +53,7 @@ static const _shape_converter _OO_OOX_custom_shapes[]= {L"hexagon" ,L"hexagon" ,0 ,0 ,0 }, {L"octagon" ,L"octagon" ,0 ,0 ,0 }, {L"star4" ,L"star4" ,1 ,0 ,50000 }, -{L"star5" ,L"star5" ,0 ,0 ,50000 },//??? 19098 неверно +{L"star5" ,L"star5" ,0 ,0 ,50000 },//??? 19098 incorrect {L"star8" ,L"star8" ,0 ,0 ,50000 }, {L"star24" ,L"star24" ,0 ,0 ,50000 }, {L"star6" ,L"star6" ,0 ,0 ,50000 }, diff --git a/OdfFile/DataTypes/drawangle.cpp b/OdfFile/DataTypes/drawangle.cpp index 8818e81d2d..2ac855eb6d 100644 --- a/OdfFile/DataTypes/drawangle.cpp +++ b/OdfFile/DataTypes/drawangle.cpp @@ -39,7 +39,7 @@ namespace cpdoccore { std::wostream & operator << (std::wostream & _Wostream, const draw_angle & _Val) { - _Wostream << (int)(_Val.get_value()) << L"deg"; //?? или округлть до 2 знаков??? + _Wostream << (int)(_Val.get_value()) << L"deg"; //?? or round to 2 decimal places??? return _Wostream; } @@ -64,7 +64,7 @@ namespace cpdoccore { } else // no unit { - //старая версия содержит множитель 10. + // old version contains multiplier 10. } int val = (value * 100); diff --git a/OdfFile/DataTypes/length.cpp b/OdfFile/DataTypes/length.cpp index 35eddc5471..fa0c022390 100644 --- a/OdfFile/DataTypes/length.cpp +++ b/OdfFile/DataTypes/length.cpp @@ -79,7 +79,7 @@ std::wostream & operator<< (std::wostream & _Wostream, const length & _Length) } length operator+ (length _Length1, length _Length2) { - return length(_Length1.get_value() + _Length2.get_value(),_Length1.get_unit()); //проверка на одинаковость типа .. или приведение к одному + return length(_Length1.get_value() + _Length2.get_value(),_Length1.get_unit()); // check for same type.. or convert to one } length operator+ (length _Length1, double val) @@ -88,7 +88,7 @@ length operator+ (length _Length1, double val) } length operator- (length _Length1, length _Length2) { - return length(_Length1.get_value() - _Length2.get_value(), _Length1.get_unit()); //проверка на одинаковость типа .. или приведение к одному + return length(_Length1.get_value() - _Length2.get_value(), _Length1.get_unit()); //check for same unit type .. or convert to one } length operator/ (length _Length1, double val) { @@ -128,7 +128,7 @@ length length::parse(const std::wstring & Str) } //double v = (nSeparator > 0) ? std::stod(Str.substr(0, nSeparator)) : 0; - // вообще предыдущая строчка лучше намного, но сделаю как было (без c++11) + // actually the previous line is much better, but I'll do it as before (without c++11) double v = 0; if (nSeparator > 0) { diff --git a/OdfFile/DataTypes/stylefamily.h b/OdfFile/DataTypes/stylefamily.h index 18ef7eb881..6fe25455e1 100644 --- a/OdfFile/DataTypes/stylefamily.h +++ b/OdfFile/DataTypes/stylefamily.h @@ -58,7 +58,7 @@ public: Presentation, Control, Ruby, -////////////////////////для генерации "красивых" имен и поиска +//////////////////////// for generating "nice" names and searching Gradient, Hatch, Opacity, diff --git a/OdfFile/DataTypes/textalign.h b/OdfFile/DataTypes/textalign.h index 0eb31083ad..b4d97cadc5 100644 --- a/OdfFile/DataTypes/textalign.h +++ b/OdfFile/DataTypes/textalign.h @@ -38,7 +38,7 @@ namespace cpdoccore { namespace odf_types { - // это не только для text_align но и для horizontal_align подходит. .. нет надобности плодить лишнее + // this is suitable not only for text_align but also for horizontal_align.. no need to create extra class text_align { public: diff --git a/OdfFile/Formulas/formulasconvert.h b/OdfFile/Formulas/formulasconvert.h index 6304298acc..3b5008620a 100644 --- a/OdfFile/Formulas/formulasconvert.h +++ b/OdfFile/Formulas/formulasconvert.h @@ -40,8 +40,8 @@ namespace cpdoccore { namespace formulasconvert { -// Работа с форумулами OpenOffice, преобразование. -// Примеры см. в тесте ut_formulasconvert.cpp +// Working with OpenOffice formulas, conversion. +// See examples in ut_formulasconvert.cpp test class odf2oox_converter { public: @@ -51,7 +51,7 @@ public: // of:=SUM([.DDA1:.BA3]) -> SUM(DDA1:BA3) std::wstring convert(std::wstring const & expr); - // $Лист1.$A$1 -> Лист1!$A$1 + // $Sheet1.$A$1 -> Sheet1!$A$1 std::wstring convert_named_ref(std::wstring const & expr, bool withTableName = true, std::wstring separator = L" ", bool bAbsoluteAlways = false); std::wstring get_table_name(); @@ -93,7 +93,7 @@ public: std::wstring convert_conditional_formula(std::wstring const & expr); - // Лист1!$A$1 -> $Лист1.$A$1 + // Sheet1!$A$1 -> $Sheet1.$A$1 std::wstring convert_named_ref(std::wstring const & expr); std::wstring convert_named_formula(std::wstring const & expr); bool is_simple_ref(std::wstring const & expr); diff --git a/OdfFile/Formulas/formulasconvert_odf.cpp b/OdfFile/Formulas/formulasconvert_odf.cpp index 12efd5f6de..3d2671c07e 100644 --- a/OdfFile/Formulas/formulasconvert_odf.cpp +++ b/OdfFile/Formulas/formulasconvert_odf.cpp @@ -456,7 +456,7 @@ namespace formulasconvert { } - // заменяем формат адресации ячеек + // replace cell addressing format // [.A1] -> A1 // [.A1:.B5] -> A1:B5 // [Sheet2.A1:B5] -> Sheet2!A1:B5 @@ -521,7 +521,7 @@ namespace formulasconvert { expr = res; } - // распознаем и заменяем формат формулы + // recognize and replace formula format // of:=(Formula) -> (Formula) bool odf2oox_converter::Impl::check_formula(std::wstring& expr) { @@ -540,7 +540,7 @@ namespace formulasconvert { else return false; } -// заменить точки с запятой во всех вхождениях кроме находящихся в кавычках --*и в фигурных скобках*-- +// replace semicolons in all occurrences except those in quotes --*and in curly braces*-- void odf2oox_converter::Impl::replace_semicolons(std::wstring& expr, bool del_quotes) { const std::wstring res = boost::regex_replace( @@ -574,7 +574,7 @@ namespace formulasconvert { expr = res; } - // заменить вертикальную черту во всех вхождениях в фигурных скобках, но не внутри строк + // replace vertical bar in all occurrences within curly braces, but not inside strings void odf2oox_converter::Impl::replace_vertical(std::wstring& expr) { const std::wstring res = boost::regex_replace( @@ -584,7 +584,7 @@ namespace formulasconvert { boost::match_default | boost::format_all); expr = res; } - // заменить пробел во всех вхождениях на запятую + // replace space with comma in all occurrences void odf2oox_converter::Impl::replace_space(std::wstring& expr) { const std::wstring res = boost::regex_replace( @@ -601,7 +601,7 @@ namespace formulasconvert { bool isFormula = check_formula(workstr); -//экранирование +// escaping mapReplacements.emplace_back(); workstr = boost::regex_replace(workstr, @@ -617,12 +617,12 @@ namespace formulasconvert { if (isFormula) { XmlUtils::replace_all( workstr, L"FDIST(", L"_xlfn.F.DIST("); - // ROUNDUP( - тут в oox 2 параметра - разрядность нужно - ,0) - EV Requirements v2.2.3.ods + // ROUNDUP( - in oox 2 parameters are needed - precision required - ,0) - EV Requirements v2.2.3.ods if (std::wstring::npos != workstr.find(L"CONCATINATE")) { bool l = true; - //могут быть частично заданы диапазоны + // ranges may be partially specified //todooo } //todooo INDEX((A1:C6~A8:C11),2,2,2) - ???? - INDEX_emb.ods @@ -661,7 +661,7 @@ namespace formulasconvert { } //Sheet2.C3:Sheet2.C19 Sheet2.L29:Sheet2.L36 - //в + // to //Sheet2!C3:C19,Sheet2!L27:L34 std::wstring odf2oox_converter::Impl::convert_list_values(const std::wstring& expr) { @@ -732,11 +732,11 @@ namespace formulasconvert { replace_tmp_back( result ); mapReplacements.pop_back(); - return result.substr(0, result.size() - 1);// минус последняя лишняя запятая + return result.substr(0, result.size() - 1);// minus the last extra comma } std::wstring odf2oox_converter::Impl::convert_named_ref(const std::wstring& expr, bool withTableName, std::wstring separator, bool bAbsoluteAlways) { - boost::wregex complexRef(L"('(?!\\s\\'){0,1}.*?')");// поиск того что в апострофах и замена там + boost::wregex complexRef(L"('(?!\\s\\'){0,1}.*?')");// find what's in apostrophes and replace there std::wstring workstr = expr; @@ -789,7 +789,7 @@ namespace formulasconvert { size_t res_find = 0; if ((res_find = workstr.find(L"CONCATINATE")) != std::wstring::npos) { - //могут быть частично заданы диапазоны + // ranges may be partially specified //todooo } diff --git a/OdfFile/Formulas/formulasconvert_oox.cpp b/OdfFile/Formulas/formulasconvert_oox.cpp index 27c81ea306..f2648f5ba8 100644 --- a/OdfFile/Formulas/formulasconvert_oox.cpp +++ b/OdfFile/Formulas/formulasconvert_oox.cpp @@ -455,8 +455,8 @@ void oox2odf_converter::Impl::replace_named_ref(std::wstring & expr) // TODO -// заменить запятые на точки с запятой во всех вхождениях кроме находящихся в кавычках --*и в фигурных скобках*-- -// TODO: проверить как сохраняются кавычки в строке +// replace commas with semicolons in all occurrences except those in quotes --*and in curly braces*-- +// TODO: check how quotes are preserved in the string void oox2odf_converter::Impl::replace_semicolons(std::wstring& expr) { const std::wstring res = boost::regex_replace( @@ -479,7 +479,7 @@ void oox2odf_converter::Impl::replace_semicolons(std::wstring& expr) // expr = res; //} -// заменить вертикальную черту во всех вхождениях в фигурных скобках, но не внутри строк +// replace vertical bar in all occurrences within curly braces, but not inside strings void oox2odf_converter::Impl::replace_vertical(std::wstring& expr) { const std::wstring res = boost::regex_replace( @@ -489,7 +489,7 @@ void oox2odf_converter::Impl::replace_vertical(std::wstring& expr) boost::match_default | boost::format_all); expr = res; } -// заменить запятую во всех вхождениях на пробел +// replace comma with space in all occurrences void oox2odf_converter::Impl::replace_space(std::wstring& expr) { const std::wstring res = boost::regex_replace( @@ -651,7 +651,7 @@ std::wstring oox2odf_converter::Impl::convert_conditional_formula(const std::wst } //Sheet2!C3:C19,Sheet2!L27:L34 -//в +// to //Sheet2.C3:Sheet2.C19 Sheet2.L29:Sheet2.L36 //todooo std::wstring oox2odf_converter::Impl::convert_ref_distances(std::wstring const& expr1, std::wstring const& separator_in, std::wstring const& separator_out) @@ -663,7 +663,7 @@ std::wstring oox2odf_converter::Impl::convert_ref_distances(std::wstring const& res= expr.rfind(L")"); if (res ==expr.size()-2) expr = expr.substr(0, res); - //распарсить по диапазонам - пробел -> separator + // parse by ranges - space -> separator std::vector<std::wstring> distance_inp; std::vector<std::wstring> distance_out; diff --git a/OdfFile/Projects/Windows/OdfFileWTest/OdfFileWTest.cpp b/OdfFile/Projects/Windows/OdfFileWTest/OdfFileWTest.cpp index cb4b0ea117..57daa6d3ce 100644 --- a/OdfFile/Projects/Windows/OdfFileWTest/OdfFileWTest.cpp +++ b/OdfFile/Projects/Windows/OdfFileWTest/OdfFileWTest.cpp @@ -103,7 +103,7 @@ HRESULT convert_single(std::wstring srcFileName) std::wstring srcTempPath = NSDirectory::CreateDirectoryWithUniqueName(outputDir); std::wstring dstTempPath = NSDirectory::CreateDirectoryWithUniqueName(outputDir); - // распаковываем исходник во временную директорию + // unpack source to temporary directory COfficeUtils oCOfficeUtils(NULL); if (S_OK != oCOfficeUtils.ExtractToDirectory(srcFileName.c_str(), srcTempPath.c_str(), NULL, 0)) { diff --git a/OdfFile/Reader/Converter/SMCustomShape2OOXML/smcustomshapepars.cpp b/OdfFile/Reader/Converter/SMCustomShape2OOXML/smcustomshapepars.cpp index 54c0fc828d..ba109ac2de 100644 --- a/OdfFile/Reader/Converter/SMCustomShape2OOXML/smcustomshapepars.cpp +++ b/OdfFile/Reader/Converter/SMCustomShape2OOXML/smcustomshapepars.cpp @@ -352,7 +352,7 @@ namespace OdfCustomShape else return false; } - //Нет сравнения + и / + //No comparison of + and / bool CElementArithmeticOperations::ComparisonSign(const std::wstring& wsSign) { return((m_enTypeSign == TypeElement::multiplication && wsSign == L"/") || (m_enTypeSign == TypeElement::plus && wsSign == L"-")); diff --git a/OdfFile/Reader/Converter/StarMath2OOXML/cstarmathpars.cpp b/OdfFile/Reader/Converter/StarMath2OOXML/cstarmathpars.cpp index 5e0c7961d1..8b9aec6b59 100644 --- a/OdfFile/Reader/Converter/StarMath2OOXML/cstarmathpars.cpp +++ b/OdfFile/Reader/Converter/StarMath2OOXML/cstarmathpars.cpp @@ -675,7 +675,7 @@ namespace StarMath } } -//нет phantom, rgb, 16 , гарнитуры и кегля +//no phantom, rgb, 16, font family and size TypeElement CAttribute::GetTypeColorAttribute(const std::wstring &wsToken) { if(L"hex"==wsToken) return TypeElement::hex; diff --git a/OdfFile/Reader/Converter/StarMath2OOXML/cstarmathpars.h b/OdfFile/Reader/Converter/StarMath2OOXML/cstarmathpars.h index 2358b4a663..2c79ea3fd5 100644 --- a/OdfFile/Reader/Converter/StarMath2OOXML/cstarmathpars.h +++ b/OdfFile/Reader/Converter/StarMath2OOXML/cstarmathpars.h @@ -102,7 +102,7 @@ namespace StarMath unsigned int m_iSize,m_iAlignment; unsigned int m_unCount; }; - //Сlass for working with tokens (reading, defining types, passing) + //Class for working with tokens (reading, defining types, passing) class CStarMathReader { public: diff --git a/OdfFile/Reader/Converter/docx_conversion_context.cpp b/OdfFile/Reader/Converter/docx_conversion_context.cpp index b974a947dd..1b1d5d67ce 100644 --- a/OdfFile/Reader/Converter/docx_conversion_context.cpp +++ b/OdfFile/Reader/Converter/docx_conversion_context.cpp @@ -83,7 +83,7 @@ void text_tracked_context::start_changes_content() void text_tracked_context::end_changes_content() { - docx_context_.finish_run(); //0106GS-GettingStartedWithWriter_el.odt - удаленный заголовок + docx_context_.finish_run(); //0106GS-GettingStartedWithWriter_el.odt - deleted heading current_state_.content.push_back(changes_stream_.str()); @@ -639,7 +639,7 @@ void docx_conversion_context::start_chart(std::wstring name) void docx_conversion_context::end_chart() { //current_chart().set_drawing_link(current_sheet().get_drawing_link()); - //излишняя инфа + //redundant info } oox_chart_context & docx_conversion_context::current_chart() { @@ -750,7 +750,7 @@ void docx_conversion_context::start_document() //apply page-default prop - //пока временно сюда воткнем обработку свойств документа в целом + //temporarily put document-wide properties handling here } @@ -1184,7 +1184,7 @@ void docx_conversion_context::end_office_text() { finish_paragraph(); - if (!delayed_converting_)//иначе возможно зацикливание + if (!delayed_converting_)//otherwise possible infinite loop { docx_convert_delayed(); } @@ -1690,7 +1690,7 @@ void docx_conversion_context::end_process_style_content(bool in_styles) void docx_conversion_context::serialize_paragraph_style(std::wostream & strm, const std::wstring & ParentId, bool in_styles) //in_styles = true -> styles.xml -//почему то конструкция <pPr><rPr/></pPr><rPr/> "не работает" в части в rPr в ms2010 ) +//for some reason the construct <pPr><rPr/></pPr><rPr/> "doesn't work" in the rPr part in ms2010 ) { bool in_drawing = false; @@ -1706,7 +1706,7 @@ void docx_conversion_context::serialize_paragraph_style(std::wostream & strm, co ////Tutor_Charlotte_Tutor_the_Entire_World_.odt //if (get_section_context().dump_.empty() == false && (!ParentId.empty() || get_section_context().get().is_dump_ || in_header_) // && !get_table_context().in_table() && !in_drawing) - //{//две подряд секции или если стиль определен и в заголовки нельзя пихать !!! + //{//two sections in a row or if style is defined and can't push into headers !!! // CP_XML_NODE(L"w:pPr") // { // CP_XML_STREAM() << get_section_context().dump_; @@ -1864,7 +1864,7 @@ void docx_conversion_context::remove_page_properties() if (s.page_properties_.size() > 1) { - //первая общая (если есть) для всего документа - оставляем ее + //first common one (if exists) for the whole document - keep it s.page_properties_.erase(s.page_properties_.begin() + 1, s.page_properties_.begin() + 2); } else if (s.page_properties_.size() == 1) @@ -2055,7 +2055,7 @@ int docx_conversion_context::process_paragraph_style(_CP_OPT(std::wstring) style calc_tab_stops(styleInst, get_tabs_context()); - //вытаскивает rtl c цепочки стилей !! - просто прописать в наследуемом НЕЛЬЗЯ !! + //extracts rtl from style chain !! - can't just write it in inherited style !! odf_reader::paragraph_format_properties properties = odf_reader::calc_paragraph_properties_content(styleInst); if (properties.style_writing_mode_) { @@ -2157,7 +2157,7 @@ int docx_conversion_context::process_paragraph_attr(odf_reader::text::paragraph_ calc_tab_stops(styleInst, get_tabs_context()); - //вытаскивает rtl c цепочки стилей !! - просто прописать в наследуемом НЕЛЬЗЯ !! + //extracts rtl from style chain !! - can't just write it in inherited style !! odf_reader::paragraph_format_properties properties = odf_reader::calc_paragraph_properties_content(styleInst); if (properties.style_writing_mode_) { @@ -2229,7 +2229,7 @@ int docx_conversion_context::process_paragraph_attr(odf_reader::text::paragraph_ { const std::wstring id = styles_map_.get( styleInst->name(), styleInst->type() ); output_stream() << L"<w:pPr>"; - //todooo причесать + //todooo clean up if (!get_section_context().dump_.empty() && !get_table_context().in_table() && (get_process_note() == oox::docx_conversion_context::noNote) @@ -2296,7 +2296,7 @@ int docx_conversion_context::process_paragraph_attr(odf_reader::text::paragraph_ output_stream() << L"<w:pPr>"; output_stream() << get_section_context().dump_; get_section_context().dump_.clear(); - //todooo выяснить реальны ли заголовки без стилей и свойств + //todooo find out if headers without styles and properties are real output_stream() << L"</w:pPr>"; return 3; } @@ -2365,9 +2365,9 @@ void docx_conversion_context::docx_convert_delayed() { if (delayed_elements_.empty()) return; - if (delayed_converting_) return; //зацикливание иначе + if (delayed_converting_) return; //otherwise infinite loop if (get_drawing_context().get_current_level() > 0 ) - return; //вложенный frame + return; //nested frame delayed_converting_ = true; while(!delayed_elements_.empty()) @@ -2406,16 +2406,16 @@ void section_context::remove_section() //sections_.erase(sections_.begin(), sections_.begin() + 1); if (sections_.empty()) { - //после оканчания разметки секциями и начале (возобновлении) основного раздела нужен разрыв (хотя настройки страницы могут и не поменяться) - //щас разрыв на текущей странице - //todooo проверить - может типо если следующий будет заголовок - разорвать + //after section markup ends and main section resumes, break is needed (even if page settings don't change) + //currently break on current page + //todooo check - maybe if next is a heading - break main_section_.is_dump_ = false; } } namespace { - // обработка Header/Footer - // конвертируем содержимое header/footer и сохраняем результат в виде строки + // Header/Footer processing + // convert header/footer content and save result as string void process_one_header_footer(docx_conversion_context & Context, const std::wstring & styleName, odf_reader::office_element *elm, headers_footers::Type type) { if (!elm) return; @@ -2427,7 +2427,7 @@ namespace const std::wstring & dbgStr = newXml->str(); - //слить если есть mediaitems, добавить релсы и обнулить их для основного документа. + //merge mediaitems if any, add rels and reset them for main document. rels internal_rels; Context.get_mediaitems()->dump_rels(internal_rels, oox::header_footer_place); @@ -2455,7 +2455,7 @@ void docx_conversion_context::process_headers_footers() odf_reader::odf_read_context & context = doc->odf_context(); odf_reader::page_layout_container & pageLayouts = context.pageLayoutContainer(); - // проходим по всем page layout + // iterate through all page layouts std::vector<odf_reader::style_master_page*> & master_pages = pageLayouts.master_pages(); bool bOddEvenPages = false; @@ -2490,7 +2490,7 @@ void docx_conversion_context::process_headers_footers() if (!master_pages[i]->style_header_ && !master_pages[i]->style_footer_ && !master_pages[i]->style_header_first_ && !master_pages[i]->style_footer_first_ && !master_pages[i]->style_header_left_ && !master_pages[i]->style_footer_left_) { - //отключенные колонтитулы + //disabled headers/footers rels rels_; get_headers_footers().add(styleName, L"", headers_footers::none, rels_); } diff --git a/OdfFile/Reader/Converter/docx_conversion_context.h b/OdfFile/Reader/Converter/docx_conversion_context.h index 59ec52d60d..2709d12d13 100644 --- a/OdfFile/Reader/Converter/docx_conversion_context.h +++ b/OdfFile/Reader/Converter/docx_conversion_context.h @@ -513,7 +513,7 @@ public: std::vector<int> ref_; private: - rels internal_rels_;//это для гиперлинков или медиа в комментариях + rels internal_rels_;//this is for hyperlinks or media in comments std::map<std::wstring, int> comments_map_; }; @@ -1117,12 +1117,12 @@ private: std::wstring current_alphabetic_index_; int current_margin_left_; int current_outline_level_; - int new_list_style_number_; // счетчик для нумерации имен созданных в процессе конвертации стилей + int new_list_style_number_; // counter for numbering names created during style conversion std::vector<odf_reader::office_element*> delayed_elements_; std::map<std::wstring, text_tracked_context::_state> map_current_changes_; - boost::unordered_map<std::wstring, std::wstring> list_style_renames_;// цепочки переименований нумераций + boost::unordered_map<std::wstring, std::wstring> list_style_renames_;// chains of numbering renames std::map<std::wstring, std::wstring> map_user_fields; std::map<std::wstring, int> mapBookmarks; diff --git a/OdfFile/Reader/Converter/docx_package.cpp b/OdfFile/Reader/Converter/docx_package.cpp index 45916a33dc..54b825c88f 100644 --- a/OdfFile/Reader/Converter/docx_package.cpp +++ b/OdfFile/Reader/Converter/docx_package.cpp @@ -326,7 +326,7 @@ void headers_footers_elements::write(const std::wstring & RootPath) doc->get_content_types_file().content()->add_override(std::wstring(L"/word/") + inst->name_, ContentType); } - //нужно сформировать релсы с объектов + //need to form rels from objects if (!inst->rels_.empty()) { rels_files relFiles; @@ -364,7 +364,7 @@ namespace { std::wstringstream content; - // внимание! L"s - это не ошибка + // note! L"s - this is not a mistake content << L"<w:" << Node << L"s \ xmlns:o=\"urn:schemas-microsoft-com:office:office\" \ xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \ diff --git a/OdfFile/Reader/Converter/docx_table_context.cpp b/OdfFile/Reader/Converter/docx_table_context.cpp index c3d2a03e03..6ca0bc9a75 100644 --- a/OdfFile/Reader/Converter/docx_table_context.cpp +++ b/OdfFile/Reader/Converter/docx_table_context.cpp @@ -128,8 +128,8 @@ bool docx_table_state::start_covered_cell(docx_conversion_context & Context) std::wostream & _Wostream = context_.output_stream(); current_table_column_++; - // обновляем вектор, в котором хранятся информация об объединении строк - // добавляем в него новый столбец + // update the vector that stores row merge information + // add a new column to it if (current_table_column_ >= (int)(rows_spanned_.size())) rows_spanned_.push_back(table_row_spanned()); @@ -156,8 +156,8 @@ bool docx_table_state::start_covered_cell(docx_conversion_context & Context) _Wostream << L"</w:tcPr>"; } - // использовали текущую ячейку, уменьшаем счетчики оставшихся объединенных ячеек - // для столбцов и строк + // used current cell, decrement counters of remaining merged cells + // for columns and rows if (columns_spanned_num_ > 0) columns_spanned_num_--; @@ -165,7 +165,7 @@ bool docx_table_state::start_covered_cell(docx_conversion_context & Context) if (rows_spanned_[current_table_column_].num() > 0) rows_spanned_[current_table_column_].decrease(); - // устанавливаем флаг что ячейка была открыта, записан тег <w:tc> + // set flag that cell was opened, <w:tc> tag was written close_table_covered_cell_ = closeTag; return closeTag; } @@ -175,7 +175,7 @@ void docx_table_state::end_covered_cell() std::wostream & _Wostream = context_.output_stream(); if (close_table_covered_cell_) { - // закрываем открытую ячейку + // close the opened cell _Wostream << L"</w:tc>"; close_table_covered_cell_ = false; } diff --git a/OdfFile/Reader/Converter/drawing_object_description.h b/OdfFile/Reader/Converter/drawing_object_description.h index 38e9cc66d8..13efdaa424 100644 --- a/OdfFile/Reader/Converter/drawing_object_description.h +++ b/OdfFile/Reader/Converter/drawing_object_description.h @@ -80,7 +80,7 @@ struct drawing_object_description std::vector<odf_reader::_property> additional_; //shape properties - std::wstring xlink_href_; //ссылка на внешний объект + std::wstring xlink_href_; //link to external object _oox_fill fill_; diff --git a/OdfFile/Reader/Converter/headers_footers.cpp b/OdfFile/Reader/Converter/headers_footers.cpp index d182b22b33..fe8b1e3841 100644 --- a/OdfFile/Reader/Converter/headers_footers.cpp +++ b/OdfFile/Reader/Converter/headers_footers.cpp @@ -85,7 +85,7 @@ std::wstring get_rel_type(headers_footers::Type _Type) } -void headers_footers::dump_rels(rels & Rels) const//внешние релсы +void headers_footers::dump_rels(rels & Rels) const//external rels { for (boost::unordered_map<std::wstring, instances_array>::const_iterator it = instances_.begin(); it != instances_.end(); ++it) { diff --git a/OdfFile/Reader/Converter/hyperlinks.cpp b/OdfFile/Reader/Converter/hyperlinks.cpp index edd71e5188..b5a8cc573b 100644 --- a/OdfFile/Reader/Converter/hyperlinks.cpp +++ b/OdfFile/Reader/Converter/hyperlinks.cpp @@ -64,7 +64,7 @@ void hyperlinks::dump_rels(rels & Rels, _rels_type_place type_place) size_t i = 0; for (size_t i = 0; i < hrefs_.size(); i++) { - if (hrefs_[i].used_rels)continue; // уже использовали этот релс + if (hrefs_[i].used_rels)continue; // already used this rels if (hrefs_[i].type_place == type_place) { diff --git a/OdfFile/Reader/Converter/mediaitems.cpp b/OdfFile/Reader/Converter/mediaitems.cpp index 5de91800ed..e790daa48b 100644 --- a/OdfFile/Reader/Converter/mediaitems.cpp +++ b/OdfFile/Reader/Converter/mediaitems.cpp @@ -75,7 +75,7 @@ bool is_internal(const std::wstring & uri, const std::wstring & packetRoot) mediaitems::item::item(std::wstring const & _href,_rels_type _type, std::wstring const & _outputName, bool _mediaInternal, std::wstring const & _Id, _rels_type_place type_place_) : href(_href), type(_type), outputName(_outputName), mediaInternal(_mediaInternal), Id(_Id), valid(true), type_place(type_place_) - //вообще говоря даже если файл покоцанный то мы все равно обязаны перенести "объект" + //generally speaking even if the file is corrupted we still must transfer the "object" { count_add = 1; count_used = 0; @@ -227,7 +227,7 @@ std::wstring mediaitems::create_file_name(const std::wstring & uri, _rels_type t if (sExt.empty()) { - //то что есть .. + //what we have .. size_t n = uri.rfind(L"."); if (n != std::wstring::npos) sExt = XmlUtils::GetLower(uri.substr(n)); @@ -361,7 +361,7 @@ std::wstring mediaitems::add_or_find(const std::wstring & href, _rels_type type, outputPath = outputPath.substr(0, n_svm) + L".png"; } //------------------------------------------------ - //if (inputFileName.empty()) return L""; - Book 27.ods - пустые линки на картинки + //if (inputFileName.empty()) return L""; - Book 27.ods - empty links to images id = std::wstring(L"picId") + std::to_wstring(count_image + 1); count_image++; @@ -427,7 +427,7 @@ void mediaitems::dump_rels(rels & Rels, _rels_type_place type_place) if (items_[i].type_place != type_place) continue; - if (items_[i].count_used >= items_[i].count_add) continue; // уже использовали этот релс выше(колонтитул ....) + if (items_[i].count_used >= items_[i].count_add) continue; // already used this rels above (header/footer ....) Rels.add( relationship( items_[i].Id, diff --git a/OdfFile/Reader/Converter/mediaitems.h b/OdfFile/Reader/Converter/mediaitems.h index ac40bf2d6f..2eacaac34d 100644 --- a/OdfFile/Reader/Converter/mediaitems.h +++ b/OdfFile/Reader/Converter/mediaitems.h @@ -88,7 +88,7 @@ public: void set_font_directory(std::wstring pathFonts); NSFonts::IApplicationFonts *applicationFonts() {return applicationFonts_;} - std::wstring add_or_find(const std::wstring & href, _rels_type type, bool & isInternal, _rels_type_place type_place);//возможны ссылки на один и тот же объект + std::wstring add_or_find(const std::wstring & href, _rels_type type, bool & isInternal, _rels_type_place type_place);//links to the same object are possible std::wstring add_or_find(const std::wstring & href, _rels_type type, bool & isInternal, std::wstring & ref, _rels_type_place type_place); std::wstring add_or_find_anim_audio(const std::wstring& href, bool& isInternal, std::wstring& ref); diff --git a/OdfFile/Reader/Converter/oox_chart_axis.cpp b/OdfFile/Reader/Converter/oox_chart_axis.cpp index a807f1e129..e7f0862e0e 100644 --- a/OdfFile/Reader/Converter/oox_chart_axis.cpp +++ b/OdfFile/Reader/Converter/oox_chart_axis.cpp @@ -118,7 +118,7 @@ void oox_axis_content::oox_serialize_content(std::wostream & _Wostream) _CP_OPT(double) doubleVal; oox_title title; - title.set_content(content_.title_);//todo нужно задать понармальному layout + title.set_content(content_.title_);//todo need to set layout properly CP_XML_WRITER(_Wostream) { diff --git a/OdfFile/Reader/Converter/oox_chart_series.cpp b/OdfFile/Reader/Converter/oox_chart_series.cpp index 59bb28d072..99753be233 100644 --- a/OdfFile/Reader/Converter/oox_chart_series.cpp +++ b/OdfFile/Reader/Converter/oox_chart_series.cpp @@ -52,11 +52,11 @@ namespace oox { oox_chart_series::oox_chart_series() { - values_[0].type = L"c:cat";//подписи + values_[0].type = L"c:cat";//labels values_[1].type = L"c:val"; values_[2].type = L"c:xVal"; values_[3].type = L"c:yVal"; - values_[4].type = L"c:bubbleSize";//заместо оси х!!!! + values_[4].type = L"c:bubbleSize";//instead of x-axis!!!! iSymbolMarkerType_ = 0; bCacheOnly_ = false; @@ -112,10 +112,10 @@ void oox_chart_series::parse_properties() iSymbolMarkerType_ = intVal.get() ; if (iSymbolMarkerType_ == 2) { - odf_reader::GetProperty(content_.properties_, L"symbol-name", intVal); // квадратики, звездочки ... + odf_reader::GetProperty(content_.properties_, L"symbol-name", intVal); // squares, stars... if (intVal) iSymbolMarkerType_ = intVal.get() ; - else iSymbolMarkerType_ = 0;//выключим + else iSymbolMarkerType_ = 0;//turn off } } //odf_reader::GetProperty(content_.properties_, L"data-label-symbol", boolVal); @@ -552,10 +552,10 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream) int symbol = intVal.get(); if (symbol == 2) { - odf_reader::GetProperty(content_.points_[i].properties_, L"symbol-name", intVal); // квадратики, звездочки ... + odf_reader::GetProperty(content_.points_[i].properties_, L"symbol-name", intVal); // squares, stars... if (intVal) symbol = intVal.get(); - else symbol = 0;//выключим + else symbol = 0;//turn off } CP_XML_NODE(L"c:marker") { @@ -675,7 +675,7 @@ _CP_PTR(oox_chart_series) oox_pie_series::create() } void oox_pie_series::oox_serialize(std::wostream & _Wostream) { - content_.fill_.clear(); //авто подбор цветов + content_.fill_.clear(); //auto color selection CP_XML_WRITER(_Wostream) { diff --git a/OdfFile/Reader/Converter/oox_data_labels.cpp b/OdfFile/Reader/Converter/oox_data_labels.cpp index 1179d9e442..aa0418ed5d 100644 --- a/OdfFile/Reader/Converter/oox_data_labels.cpp +++ b/OdfFile/Reader/Converter/oox_data_labels.cpp @@ -37,7 +37,7 @@ namespace cpdoccore { namespace oox { -oox_data_labels::oox_data_labels()//подписи на значениях +oox_data_labels::oox_data_labels()//labels on values { showBubbleSize_ = false; showCatName_ = false; diff --git a/OdfFile/Reader/Converter/oox_drawing.cpp b/OdfFile/Reader/Converter/oox_drawing.cpp index 4578dd25ea..50ecee7f8b 100644 --- a/OdfFile/Reader/Converter/oox_drawing.cpp +++ b/OdfFile/Reader/Converter/oox_drawing.cpp @@ -672,7 +672,7 @@ void _oox_drawing::serialize_bodyPr(std::wostream & strm, const std::wstring & n _CP_OPT(int) iWrap; odf_reader::GetProperty(prop, L"text-wrap", iWrap); - if (((iWrap) && (*iWrap == 0))) // для текста устанавливаем значение square. Так у нас визуальное соотвествие при конвертации + if (((iWrap) && (*iWrap == 0))) // for text we set square value. This way we get visual correspondence during conversion CP_XML_ATTR(L"wrap", L"square"); else if((iWrap && *iWrap == 2) || ((is_math_formula) && (*is_math_formula))) { @@ -856,7 +856,7 @@ void _oox_drawing::serialize_shape(std::wostream & strm) shapeGeomPreset = connector_prst; } - CP_XML_NODE(L"a:prstGeom")//автофигура + CP_XML_NODE(L"a:prstGeom")//auto shape { CP_XML_ATTR(L"prst", shapeGeomPreset); if (!bWordArt) diff --git a/OdfFile/Reader/Converter/oox_drawing_fills.cpp b/OdfFile/Reader/Converter/oox_drawing_fills.cpp index 73c9c69066..d9f2b6f75b 100644 --- a/OdfFile/Reader/Converter/oox_drawing_fills.cpp +++ b/OdfFile/Reader/Converter/oox_drawing_fills.cpp @@ -396,7 +396,7 @@ void oox_serialize_hatch_fill(std::wostream & strm, const _oox_fill & val, const CP_XML_NODE(ns + L":pattFill") { CP_XML_ATTR2(ns_att + L"prst", val.hatch->preset); - CP_XML_NODE(ns + L":fgClr")//опять для ms важно что этот цвет перед back + CP_XML_NODE(ns + L":fgClr")//again for MS it's important that this color comes before back { oox_serialize_srgb(CP_XML_STREAM(), val.hatch->color_ref, val.opacity); } diff --git a/OdfFile/Reader/Converter/oox_layout.cpp b/OdfFile/Reader/Converter/oox_layout.cpp index 0b2cf000fd..7a2053a0ba 100644 --- a/OdfFile/Reader/Converter/oox_layout.cpp +++ b/OdfFile/Reader/Converter/oox_layout.cpp @@ -46,11 +46,11 @@ void oox_layout::oox_serialize(std::wostream & _Wostream) { CP_XML_NODE(L"c:layout") { - //CP_XML_NODE(L"c:manualLayout") //вручную созданное описание и место + //CP_XML_NODE(L"c:manualLayout") //manually created description and position //{ - // CP_XML_NODE(L"c:layoutTarget") //вручную созданное описание и место + // CP_XML_NODE(L"c:layoutTarget") //manually created description and position // { - // CP_XML_ATTR(L"val", "inner"); //все позиции относительно внешнего объекта (а не документа в целом) + // CP_XML_ATTR(L"val", "inner"); //all positions relative to outer object (not the whole document) // } // //<c:xMode val="edge"/> // //<c:yMode val="edge"/> diff --git a/OdfFile/Reader/Converter/oox_layout.h b/OdfFile/Reader/Converter/oox_layout.h index e15f888fc3..208f3dc70c 100644 --- a/OdfFile/Reader/Converter/oox_layout.h +++ b/OdfFile/Reader/Converter/oox_layout.h @@ -38,7 +38,7 @@ namespace cpdoccore { namespace oox { -class oox_layout //расположение и формат(бордюрчики к примеру) любой хрени в документе +class oox_layout //position and format (borders for example) of any stuff in document { public: oox_layout(){} diff --git a/OdfFile/Reader/Converter/oox_plot_area.cpp b/OdfFile/Reader/Converter/oox_plot_area.cpp index 9e3c7f7235..329bf59bfa 100644 --- a/OdfFile/Reader/Converter/oox_plot_area.cpp +++ b/OdfFile/Reader/Converter/oox_plot_area.cpp @@ -119,7 +119,7 @@ namespace cpdoccore { { data_table_content_ = content; } - void oox_plot_area::reset_cross_axis()//обязательно после всех добавлений + void oox_plot_area::reset_cross_axis()//must be called after all additions { for (size_t i = 0; i < axis_.size(); i++) { diff --git a/OdfFile/Reader/Converter/oox_plot_area.h b/OdfFile/Reader/Converter/oox_plot_area.h index 8d0bd3b9fa..fcc953070b 100644 --- a/OdfFile/Reader/Converter/oox_plot_area.h +++ b/OdfFile/Reader/Converter/oox_plot_area.h @@ -67,7 +67,7 @@ public: void set_data_table(odf_reader::chart::simple & content); private: odf_reader::chart::simple data_table_content_; - void reset_cross_axis(); //обязательно после всех добавлений + void reset_cross_axis(); //must be called after all additions bool no_used_local_tables_; unsigned int axis_id_ = 0xf2905; }; diff --git a/OdfFile/Reader/Converter/oox_types_chart.cpp b/OdfFile/Reader/Converter/oox_types_chart.cpp index 5ab59349e6..19e45fd8c8 100644 --- a/OdfFile/Reader/Converter/oox_types_chart.cpp +++ b/OdfFile/Reader/Converter/oox_types_chart.cpp @@ -101,7 +101,7 @@ void oox_chart::set_properties(odf_reader::chart_format_properties_ptr & prop) { dispBlanksAs_ = L"gap"; } - //solid-type - трехмерные + //solid-type - 3D } void oox_chart::oox_serialize_common(std::wostream & _Wostream) { @@ -440,7 +440,7 @@ void oox_scatter_chart::set_properties(odf_reader::chart_format_properties_ptr & oox_chart::set_properties(prop); odf_reader::GetProperty(prop, L"regression-type", iRegressionType);// none, linear, logarithmic, exponential, power - //в xl похоже этого нет + //xl doesn't seem to have this } void oox_scatter_chart::oox_serialize(std::wostream & _Wostream) { diff --git a/OdfFile/Reader/Converter/oox_types_chart.h b/OdfFile/Reader/Converter/oox_types_chart.h index 1a09b0f7e7..2e16e673b9 100644 --- a/OdfFile/Reader/Converter/oox_types_chart.h +++ b/OdfFile/Reader/Converter/oox_types_chart.h @@ -215,9 +215,9 @@ class oox_bubble_chart: public oox_chart ~oox_bubble_chart(){} virtual void oox_serialize(std::wostream & _Wostream); - virtual void add_series(int id);//тип серии чотко соответствует типу самого чарта - если нужны смешанные типы - нужно добавлять свой чарт. + virtual void add_series(int id);//series type strictly corresponds to chart type - if mixed types needed - add your own chart virtual void set_properties(odf_reader::chart_format_properties_ptr & prop); - // то есть первична серия - в отличии от одф + // that is, series is primary - unlike odf static _CP_PTR(oox_chart) create(); diff --git a/OdfFile/Reader/Converter/ooxtablerowspanned.h b/OdfFile/Reader/Converter/ooxtablerowspanned.h index 2a69aaaa10..4d795b8ff7 100644 --- a/OdfFile/Reader/Converter/ooxtablerowspanned.h +++ b/OdfFile/Reader/Converter/ooxtablerowspanned.h @@ -37,7 +37,7 @@ namespace cpdoccore { namespace oox { -// контекст для обработки объединения столбцов +// context for handling column merging struct table_row_spanned { diff --git a/OdfFile/Reader/Converter/pptx_conversion_context.cpp b/OdfFile/Reader/Converter/pptx_conversion_context.cpp index 8d20b57cd0..0a7e572891 100644 --- a/OdfFile/Reader/Converter/pptx_conversion_context.cpp +++ b/OdfFile/Reader/Converter/pptx_conversion_context.cpp @@ -100,7 +100,7 @@ namespace cpdoccore { get_text_context().set_process_layouts(true); - //актуальные + //active for (size_t layout_index = 0; layout_index < layouts.content.size(); layout_index++) { start_layout(layout_index); @@ -112,7 +112,7 @@ namespace cpdoccore { { layout->pptx_convert(*this); } - //нужно вытащить footers + //need to extract footers odf_reader::style_master_page* master = root()->odf_context().pageLayoutContainer().master_page_by_name(layouts.content[layout_index].master_name); @@ -154,7 +154,7 @@ namespace cpdoccore { process_masters_ = true; //get_text_context().set_process_layouts(true); - //берем только актуальные + //take only active ones odf_reader::office_element_ptr master_notes_; for (size_t master_index = 0; master_index < masters.content.size(); master_index++) @@ -501,7 +501,7 @@ namespace cpdoccore { // } - else//общий шаблон (насильно пропишем к темам несоответствующие шалоны) + else//common template (forcibly assign non-matching templates to themes) { } @@ -557,7 +557,7 @@ namespace cpdoccore { current_master_page_name_ = L""; current_layout_page_name_ = L""; - process_theme(masters.content[master_index].master_name);//add default theme - одинаковые но под разными именами + process_theme(masters.content[master_index].master_name);//add default theme - same but with different names current_master().add_theme(current_theme().id(), L"tId1"); for (size_t i = 0; i < masters.content[master_index].layouts.size(); i++) @@ -566,7 +566,7 @@ namespace cpdoccore { } //---------------------------------------------------------------------------------- - //размеры страниц в презентации + //page sizes in presentation const std::wstring pageProperties = root()->odf_context().pageLayoutContainer().page_layout_name_by_style(masters.content[master_index].master_name); odf_reader::page_layout_instance* pages_layouts = root()->odf_context().pageLayoutContainer().page_layout_by_name(pageProperties); @@ -594,8 +594,8 @@ namespace cpdoccore { get_slide_context().serialize_animations(current_slide().Timing()); { - // NOTE: При использовании operator<< потока буст пушит туда лишний пробел перед значением. - // С этим пробелом наш редактор onlyoffice на распознает значение. + // NOTE: When using operator<< boost stream pushes extra space before value. + // With this space our onlyoffice editor doesn't recognize the value. // Example: // <p:attrName> ppt_y</p:attrName> // <p:attrName>ppt_y</p:attrName> @@ -637,7 +637,7 @@ namespace cpdoccore { get_slide_context().start_slide(); - process_theme(L"");//add default theme - одинаковые но под разными именами + process_theme(L"");//add default theme - same but with different names current_notesMaster().add_theme(current_theme().id(), L"tId1"); get_slide_context().start_slide(); @@ -711,15 +711,15 @@ namespace cpdoccore { void pptx_conversion_context::start_chart(std::wstring name) { charts_.push_back(oox_chart_context_ptr(new oox_chart_context(get_mediaitems(), name))); - //добавляем новую форму для диаграммы - //в ней будет информационная часть - и она пишется каждый раз в свою xml (их - по числу диаграмм) - //этот контекст нужно передавать в файл + //adding new form for chart + //it will contain info part - and it's written each time to its own xml (count = chart count) + //this context needs to be passed to file } void pptx_conversion_context::end_chart() { //current_chart().set_drawing_link(current_sheet().get_drawing_link()); - //излишняя инфа + //redundant info } void pptx_conversion_context::add_jsaProject(const std::string& content) { diff --git a/OdfFile/Reader/Converter/pptx_conversion_context.h b/OdfFile/Reader/Converter/pptx_conversion_context.h index f208f185d7..93c05b6d95 100644 --- a/OdfFile/Reader/Converter/pptx_conversion_context.h +++ b/OdfFile/Reader/Converter/pptx_conversion_context.h @@ -125,7 +125,7 @@ public: pptx_xml_slideNotes & current_notes(); pptx_xml_slideNotesMaster & current_notesMaster(); - pptx_xml_presentation & current_presentation();//собственно она одна + pptx_xml_presentation & current_presentation();//actually there's only one oox_chart_context & current_chart(); math_context & get_math_context() { return math_context_; } diff --git a/OdfFile/Reader/Converter/pptx_drawing.cpp b/OdfFile/Reader/Converter/pptx_drawing.cpp index 3182caa64b..12d7f5117f 100644 --- a/OdfFile/Reader/Converter/pptx_drawing.cpp +++ b/OdfFile/Reader/Converter/pptx_drawing.cpp @@ -132,7 +132,7 @@ void pptx_serialize_image(std::wostream & strm, _pptx_drawing & val) //_CP_OPT(std::wstring) strTextContent; //odf::GetProperty(properties,L"text-content",strTextContent); //pptx_serialize_text(CP_XML_STREAM(),val.additional); - //на картинке тект нельзя... - выше сменили тип на рект с заливкой + //can't have text on image... - changed type to rect with fill above } } } @@ -219,7 +219,7 @@ void pptx_serialize_media(std::wostream & strm, _pptx_drawing & val) //_CP_OPT(std::wstring) strTextContent; //odf::GetProperty(properties,L"text-content",strTextContent); //pptx_serialize_text(CP_XML_STREAM(),val.additional); - //на картинке тект нельзя... - выше сменили тип на рект с заливкой + //can't have text on image... - changed type to rect with fill above } } } @@ -234,13 +234,13 @@ void pptx_serialize_shape(std::wostream & strm, _pptx_drawing & val) { CP_XML_NODE(L"p:cNvPr") { - CP_XML_ATTR(L"id", val.id);//числовое значение val.rId + CP_XML_ATTR(L"id", val.id);//numeric value of val.rId CP_XML_ATTR(L"name", val.name); if (val.hidden) CP_XML_ATTR(L"hidden", true); oox_serialize_action(CP_XML_STREAM(),val.action); } - CP_XML_NODE(L"p:cNvSpPr")//non visual properies (собственно тока 1 там) + CP_XML_NODE(L"p:cNvSpPr")//non visual properties (actually only 1 there) { if (val.sub_type == 1 || val.sub_type == 2)CP_XML_ATTR(L"txBox", 1); //CP_XML_NODE(L"a:spLocks") @@ -303,13 +303,13 @@ void pptx_serialize_connector(std::wostream & strm, _pptx_drawing & val) { CP_XML_NODE(L"p:cNvPr") { - CP_XML_ATTR(L"id", val.id);//числовое значение val.rId + CP_XML_ATTR(L"id", val.id);//numeric value of val.rId CP_XML_ATTR(L"name", val.name); if (val.hidden) CP_XML_ATTR(L"hidden", true); oox_serialize_action(CP_XML_STREAM(), val.action); } - CP_XML_NODE(L"p:cNvCxnSpPr")//non visual properies (собственно тока 1 там) + CP_XML_NODE(L"p:cNvCxnSpPr")//non visual properties (actually only 1 there) { if (val.sub_type == 1 || val.sub_type == 2)CP_XML_ATTR(L"txBox", 1); //CP_XML_NODE(L"a:spLocks") @@ -456,13 +456,13 @@ void pptx_serialize_control(std::wostream& strm, _pptx_drawing& val) { CP_XML_NODE(L"p:cNvPr") { - CP_XML_ATTR(L"id", val.id);//числовое значение val.rId + CP_XML_ATTR(L"id", val.id);//numeric value of val.rId CP_XML_ATTR(L"name", val.name); if (val.hidden) CP_XML_ATTR(L"hidden", true); oox_serialize_action(CP_XML_STREAM(), val.action); } - CP_XML_NODE(L"p:cNvSpPr")//non visual properies (собственно тока 1 там) + CP_XML_NODE(L"p:cNvSpPr")//non visual properties (actually only 1 there) { CP_XML_ATTR(L"txBox", 1); } diff --git a/OdfFile/Reader/Converter/pptx_output_xml.cpp b/OdfFile/Reader/Converter/pptx_output_xml.cpp index 6daf5f038c..29c9f0f5e7 100644 --- a/OdfFile/Reader/Converter/pptx_output_xml.cpp +++ b/OdfFile/Reader/Converter/pptx_output_xml.cpp @@ -187,7 +187,7 @@ void pptx_xml_slideLayout::write_to(std::wostream & strm) { CP_XML_STREAM() << strmData_.str(); -//в slideLayoutData_ +//in slideLayoutData_ //contentPart (Content Part) §19.3.1.14 //cxnSp (Connection Shape) §19.3.1.19 //extLst (Extension List with Modification Flag) §19.3.1.20 diff --git a/OdfFile/Reader/Converter/pptx_output_xml.h b/OdfFile/Reader/Converter/pptx_output_xml.h index 69cbc813b1..92cade6405 100644 --- a/OdfFile/Reader/Converter/pptx_output_xml.h +++ b/OdfFile/Reader/Converter/pptx_output_xml.h @@ -283,8 +283,8 @@ public: }; void write_to(std::wostream & strm); - std::pair<int,int> add_or_find(std::wstring name);//возвращает 2 индекса - автора - и последний idx от автора - //так как учет индексов идет по всем слайдам, замечаниям, .... + std::pair<int,int> add_or_find(std::wstring name);//returns 2 indices - author - and last idx from author + //since index tracking goes across all slides, comments, .... static pptx_xml_authors_comments_ptr create(); diff --git a/OdfFile/Reader/Converter/pptx_package.cpp b/OdfFile/Reader/Converter/pptx_package.cpp index 2f9a2c5df1..6c0f9a6c76 100644 --- a/OdfFile/Reader/Converter/pptx_package.cpp +++ b/OdfFile/Reader/Converter/pptx_package.cpp @@ -55,7 +55,7 @@ pptx_content_types_file::pptx_content_types_file() content()->add_override(L"/_rels/.rels", L"application/vnd.openxmlformats-package.relationships+xml"); content()->add_override(L"/ppt/presentation.xml",L"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml"); - // content()->add_override(L"/ppt/tableStyles.xml", L"application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml");необяательно + // content()->add_override(L"/ppt/tableStyles.xml", L"application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml");//optional content()->add_override(L"/docProps/app.xml", L"application/vnd.openxmlformats-officedocument.extended-properties+xml"); content()->add_override(L"/docProps/core.xml", L"application/vnd.openxmlformats-package.core-properties+xml"); @@ -143,7 +143,7 @@ void slides_files::write(const std::wstring & RootPath) rels_->add(id, kWSRel, fileRef); } - slides_[i]->get_rel_file()->set_file_name(fileName + L".rels");//внитренние релсы + slides_[i]->get_rel_file()->set_file_name(fileName + L".rels");//internal rels rels_files relFiles; relFiles.add_rel_file(slides_[i]->get_rel_file()); @@ -178,7 +178,7 @@ void notes_files::write(const std::wstring & RootPath) rels_->add(id, kWSRel, fileRef); } - slides_[i]->get_rel_file()->set_file_name(fileName + L".rels");//внитренние релсы + slides_[i]->get_rel_file()->set_file_name(fileName + L".rels");//internal rels rels_files relFiles; relFiles.add_rel_file(slides_[i]->get_rel_file()); @@ -220,7 +220,7 @@ void slideMasters_files::write(const std::wstring & RootPath) rels_->add(id, kWSRel, fileRef); } - slides_[i]->get_rel_file()->set_file_name(fileName + L".rels");//внитренние релсы + slides_[i]->get_rel_file()->set_file_name(fileName + L".rels");//internal rels rels_files relFiles; relFiles.add_rel_file(slides_[i]->get_rel_file()); @@ -254,7 +254,7 @@ void notesMaster_files::write(const std::wstring & RootPath) rels_->add(id, kWSRel, fileRef); } - slides_[i]->get_rel_file()->set_file_name(fileName + L".rels");//внитренние релсы + slides_[i]->get_rel_file()->set_file_name(fileName + L".rels");//internal rels rels_files relFiles; relFiles.add_rel_file(slides_[i]->get_rel_file()); @@ -288,7 +288,7 @@ void slideLayouts_files::write(const std::wstring & RootPath) content_type * contentTypes = get_main_document()->get_content_types_file().content(); contentTypes->add_override(std::wstring(L"/ppt/slideLayouts/") + fileName, kWSConType); - slides_[i]->get_rel_file()->set_file_name(fileName + L".rels");//внитренние релсы + slides_[i]->get_rel_file()->set_file_name(fileName + L".rels");//internal rels rels_files relFiles; relFiles.add_rel_file(slides_[i]->get_rel_file()); diff --git a/OdfFile/Reader/Converter/pptx_slide_context.cpp b/OdfFile/Reader/Converter/pptx_slide_context.cpp index 38a166858a..502398628c 100644 --- a/OdfFile/Reader/Converter/pptx_slide_context.cpp +++ b/OdfFile/Reader/Converter/pptx_slide_context.cpp @@ -255,13 +255,13 @@ void pptx_slide_context::start_slide_animation() impl_->transition_.Dir = boost::none; impl_->transition_.Param = boost::none; - //speed & onClick выставляются ранее + //speed & onClick are set earlier } void pptx_slide_context::set_transitionFilter(std::wstring & type,_CP_OPT(std::wstring) & dir,_CP_OPT(std::wstring) & dop,_CP_OPT(int) & time) { impl_->transition_.Type = type; - impl_->transition_.Time = time; // не путать длительность перехода с длительностью эффекта перехода (в oo его нет) + impl_->transition_.Time = time; // don't confuse transition duration with transition effect duration (OO doesn't have it) impl_->transition_.Dir = dir; impl_->transition_.Param = dop; } @@ -631,7 +631,7 @@ void pptx_slide_context::set_image(const std::wstring & path) if (bSvg) { - impl_->object_description_.xlink_href_ = path; // приоритетная картинка + impl_->object_description_.xlink_href_ = path; // priority image } else if (bPdf) { @@ -739,7 +739,7 @@ void pptx_slide_context::Impl::process_image(drawing_object_description& obj, _p GetProperty(obj.additional_, L"luminance", drawing.fill.bitmap->luminance); GetProperty(obj.additional_, L"contrast", drawing.fill.bitmap->contrast); - if (sTextContent)//в ms office на картинке нельзя сделать надпись - меняем тип на рект с заливкой картинкой + if (sTextContent)//in ms office you can't add text to image - changing type to rect with image fill { drawing.type = typeShape; drawing.sub_type = 2;//rect @@ -749,7 +749,7 @@ void pptx_slide_context::Impl::process_image(drawing_object_description& obj, _p process_crop(drawing.fill, fileName); /////////////////////////////////////////////////////////////////////////////////////////////////// - std::wstring ref;/// это ссылка на выходной внешний объект + std::wstring ref;/// this is a link to output external object bool isMediaInternal = false; drawing.fill.bitmap->rId = get_mediaitems()->add_or_find(obj.xlink_href_, typeImage, isMediaInternal, ref, oox::document_place); @@ -757,17 +757,17 @@ void pptx_slide_context::Impl::process_image(drawing_object_description& obj, _p if (drawing.type == typeShape) { - add_additional_rels(isMediaInternal, drawing.fill.bitmap->rId, ref, typeImage);//собственно это не объект, а доп рел и ref объекта + add_additional_rels(isMediaInternal, drawing.fill.bitmap->rId, ref, typeImage);//actually this is not an object, but additional rel and object ref isMediaInternal = true; std::wstring rId = get_mediaitems()->add_or_find(L"", typeShape, isMediaInternal, ref, oox::document_place); - add_drawing(drawing, isMediaInternal, rId, ref, typeShape);//объект + add_drawing(drawing, isMediaInternal, rId, ref, typeShape);//object } else if (!drawing.fill.bitmap->rId.empty()) { - add_drawing(drawing, isMediaInternal, drawing.fill.bitmap->rId, ref, drawing.type);//объект + add_drawing(drawing, isMediaInternal, drawing.fill.bitmap->rId, ref, drawing.type);//object } } void pptx_slide_context::Impl::process_chart(drawing_object_description & obj, _pptx_drawing & drawing) @@ -845,8 +845,8 @@ void pptx_slide_context::Impl::process_shape(drawing_object_description & obj, _ drawing.sub_type = obj.shape_type_; - // NOTE: Все идентификаторы объектов могут быть неивестны на момент обрабоки коннектора. - // Идентификаторы начального и конечного объекта коннектора будут обновлены после обработки всех объектов на слайде. + // NOTE: All object identifiers may be unknown at connector processing time. + // Start and end connector object identifiers will be updated after processing all objects on slide. drawing.start_connection_shape_id = obj.start_shape_id.get_value_or(L""); drawing.end_connection_shape_id = obj.end_shape_id.get_value_or(L""); @@ -907,7 +907,7 @@ void pptx_slide_context::Impl::process_common_properties(drawing_object_descript if (pic.svg_rect_) { int val; - //todooo непонятки с отрицательными значениями + //todooo confusion with negative values drawing.x = (int)(0.5 + odf_types::length(pic.svg_rect_->x, odf_types::length::pt).get_value_unit(odf_types::length::emu)); drawing.y = (int)(0.5 + odf_types::length(pic.svg_rect_->y, odf_types::length::pt).get_value_unit(odf_types::length::emu)); @@ -1108,7 +1108,7 @@ void pptx_slide_context::serialize_objects(std::wostream & strm) CP_XML_WRITER(strm) { -// дефолтную обязательную noGroup пока воткнем сюда +// put default mandatory noGroup here for now CP_XML_NODE(L"p:nvGrpSpPr") { CP_XML_NODE(L"p:cNvPr") diff --git a/OdfFile/Reader/Converter/pptx_table_context.cpp b/OdfFile/Reader/Converter/pptx_table_context.cpp index cd162f3de9..79d7e817e7 100644 --- a/OdfFile/Reader/Converter/pptx_table_context.cpp +++ b/OdfFile/Reader/Converter/pptx_table_context.cpp @@ -130,8 +130,8 @@ bool pptx_table_state::start_covered_cell(pptx_conversion_context & Context) std::wostream & _Wostream = context_.get_table_context().tableData(); current_table_column_++; - // обновляем вектор, в котором хранятся информация об объединении строк - // добавляем в него новый столбец + // update the vector that stores row merge information + // add a new column to it if (current_table_column_ >= (int)(rows_spanned_.size())) rows_spanned_.push_back(table_row_spanned()); @@ -154,8 +154,8 @@ bool pptx_table_state::start_covered_cell(pptx_conversion_context & Context) context_.root()->odf_context().styleContainer().style_by_name( rows_spanned_[current_table_column_].style(), odf_types::style_family::TableCell, false); - // использовали текущую ячейку, уменьшаем счетчики оставшихся объединенных ячеек - // для столбцов и строк + // used current cell, decrement counters of remaining merged cells + // for columns and rows if (columns_spanned_num_ > 0) columns_spanned_num_--; @@ -189,7 +189,7 @@ void pptx_table_state::end_covered_cell() oox::oox_serialize_tcPr(_Wostream, style_instances, context_); - // закрываем открытую ячейку + // close the opened cell _Wostream << L"</a:tc>"; } @@ -471,7 +471,7 @@ void oox_serialize_tcPr(std::wostream & strm, std::vector<const odf_reader::styl oox_serialize_border(CP_XML_STREAM(), L"a:lnR", right); oox_serialize_border(CP_XML_STREAM(), L"a:lnT", top); oox_serialize_border(CP_XML_STREAM(), L"a:lnB", bottom); - //диагональных в оо нет. + //no diagonals in OO. //////////////////////////////////////////////////////////////////////////////////////////////// oox::_oox_fill fill; diff --git a/OdfFile/Reader/Converter/pptx_text_context.cpp b/OdfFile/Reader/Converter/pptx_text_context.cpp index dc7febea7d..76a3210189 100644 --- a/OdfFile/Reader/Converter/pptx_text_context.cpp +++ b/OdfFile/Reader/Converter/pptx_text_context.cpp @@ -78,7 +78,7 @@ public: void ApplyListProperties (odf_reader::paragraph_format_properties & propertiesOut, int Level); odf_reader::style_list_level_properties* ApplyListProperties (odf_reader::paragraph_format_properties & propertiesOut, odf_reader::text_list_style* text_list_style, int Level); - void set_local_styles_container(odf_reader::styles_container* local_styles_);//это если стили объектов содержатся в другом документе + void set_local_styles_container(odf_reader::styles_container* local_styles_);//this is if object styles are contained in another document hyperlink_data get_hyperlink(); void start_hyperlink(); @@ -146,11 +146,11 @@ private: void dump_run(); void dump_field(); - size_t paragraphs_cout_; //???? тока из за начала отсчета? - - std::wstringstream text_; //приходящий текст - std::wstringstream paragraph_; //перманенто скидываемые параграфы - std::wstringstream run_; //перманенто скидываемые куски с быть может разными свойствами + size_t paragraphs_cout_; //???? only because of counting start? + + std::wstringstream text_; //incoming text + std::wstringstream paragraph_; //permanently dumped paragraphs + std::wstringstream run_; //permanently dumped chunks with possibly different properties std::wstring last_paragraph_style_name_; std::wstring paragraph_style_name_; @@ -167,9 +167,9 @@ private: _CP_OPT(odf_types::length) svg_heightVal; _CP_OPT(odf_types::length) svg_widthVal; - int new_list_style_number_; // счетчик для нумерации имен созданных в процессе конвертации стилей - - boost::unordered_map<std::wstring, std::wstring> list_style_renames_; // цепочки переименований нумераций + int new_list_style_number_; // counter for numbering names created during style conversion + + boost::unordered_map<std::wstring, std::wstring> list_style_renames_; // numbering rename chains void write_list_styles(std::wostream & strm); //void write_list_properties(std::wostream & strm); @@ -218,7 +218,7 @@ void pptx_text_context::Impl::start_paragraph(const std::wstring & styleName) { //if (in_list_ == false || in_comment == true) //{ - //// конец предыдущего абзаца и начало следующего + //// end of previous paragraph and start of next ////text_ << L" "; // text_ << L"\n"; //} @@ -244,7 +244,7 @@ void pptx_text_context::Impl::end_paragraph() in_paragraph = false; } -void pptx_text_context::Impl::start_span(const std::wstring & styleName)//кусок текста в абзаце(параграфе) со своими свойствами - этто может быть и 1 буква +void pptx_text_context::Impl::start_span(const std::wstring & styleName)//text chunk in paragraph with its own properties - this can be even 1 letter { int text_size = text_.str().length(); @@ -275,7 +275,7 @@ std::wstring pptx_text_context::Impl::end_span2() } void pptx_text_context::Impl::start_hyperlink() { - dump_run();//проверить + dump_run();//check } void pptx_text_context::Impl::end_hyperlink() @@ -445,7 +445,7 @@ void pptx_text_context::Impl::write_pPr(std::wostream & strm) odf_reader::paragraph_format_properties paragraph_properties_; ApplyParagraphProperties (paragraph_style_name_, paragraph_properties_, process_layouts_); - ApplyListProperties (paragraph_properties_, level);//выравнивания листа накатим на свойства параграфа + ApplyListProperties (paragraph_properties_, level);//apply list alignment to paragraph properties paragraph_properties_.pptx_convert(pptx_context_); @@ -623,7 +623,7 @@ void pptx_text_context::Impl::dump_field() } else { - //запишем как обычный текст + //write as regular text text_ << content; } } @@ -641,7 +641,7 @@ void pptx_text_context::Impl::dump_run() // return; const std::wstring content = XmlUtils::EncodeXmlString(text_.str()); - //if (content.length() <1 && span_style_name_.length()<1) return ; ... провеить с пустыми строками нужны ли ... + //if (content.length() <1 && span_style_name_.length()<1) return ; ... check if empty lines are needed ... if (content.length() > 0) { @@ -795,7 +795,7 @@ void pptx_text_context::Impl::end_list() { in_list_ = false; - list_style_stack_.pop_back();// пока не стираем .. как сохраним в lstStyles - очистим + list_style_stack_.pop_back();// don't erase yet.. will clear when saved to lstStyles } std::wstring pptx_text_context::Impl::current_list_style() @@ -832,7 +832,7 @@ void pptx_text_context::Impl::start_field(field_type type, const std::wstring & } void pptx_text_context::Impl::start_comment() { - in_comment = true;//отдельная ветка - так как без форматирования + in_comment = true;//separate branch - since without formatting } std::wstring pptx_text_context::Impl::end_comment() { diff --git a/OdfFile/Reader/Converter/xlsx_alignment.cpp b/OdfFile/Reader/Converter/xlsx_alignment.cpp index ed9c12094d..4fb7527e5a 100644 --- a/OdfFile/Reader/Converter/xlsx_alignment.cpp +++ b/OdfFile/Reader/Converter/xlsx_alignment.cpp @@ -183,7 +183,7 @@ xlsx_alignment OdfProperties2XlsxAlignment( xlsx_conversion_context * context, if (angle > 90) angle = angle - 90; if (angle < -90) angle = 90 + angle; - alignment.textRotation = angle; //??? приоритет какой + alignment.textRotation = angle; //??? what priority } if (cellProp->fo_wrap_option_) { diff --git a/OdfFile/Reader/Converter/xlsx_borders.cpp b/OdfFile/Reader/Converter/xlsx_borders.cpp index 0a4b17c8f3..51b4a73e02 100644 --- a/OdfFile/Reader/Converter/xlsx_borders.cpp +++ b/OdfFile/Reader/Converter/xlsx_borders.cpp @@ -50,7 +50,7 @@ namespace oox { namespace { -// TODO надо сделать конвертацию в зависимости от стиля +// TODO need to make conversion depending on style std::wstring convert_border_style(const odf_types::border_style& borderStyle) { std::wstring retVal = L"none"; diff --git a/OdfFile/Reader/Converter/xlsx_complex_number_format.h b/OdfFile/Reader/Converter/xlsx_complex_number_format.h index 4093c4ed2b..c2ffeff617 100644 --- a/OdfFile/Reader/Converter/xlsx_complex_number_format.h +++ b/OdfFile/Reader/Converter/xlsx_complex_number_format.h @@ -44,10 +44,10 @@ public: ~complex_number_format(); void reset(); - // получить результирующий формат + // get the resulting format std::wstring result_value(); - // добавить условный формат числа + // add conditional number format void add_format(std::wstring const & condition, std::wstring const & format); std::wstring name; diff --git a/OdfFile/Reader/Converter/xlsx_conditionalFormatting.cpp b/OdfFile/Reader/Converter/xlsx_conditionalFormatting.cpp index b8975d54e2..7113451a92 100644 --- a/OdfFile/Reader/Converter/xlsx_conditionalFormatting.cpp +++ b/OdfFile/Reader/Converter/xlsx_conditionalFormatting.cpp @@ -592,7 +592,7 @@ void xlsx_conditionalFormatting_context::set_formula(std::wstring f) impl_->conditionalFormattings_.back().rules.back().formula_type = L"expression"; val = f.substr(11, f.size() - 12); - if (0 == (pos = val.find(L"\""))) //Raport_7A.ods или выкинуть ограждающие кавычки с формулы? + if (0 == (pos = val.find(L"\""))) //Raport_7A.ods or remove enclosing quotes from formula? { impl_->conditionalFormattings_.back().rules.back().text = val; val.clear(); diff --git a/OdfFile/Reader/Converter/xlsx_drawing.cpp b/OdfFile/Reader/Converter/xlsx_drawing.cpp index bc58609fe3..538ff5ad2a 100644 --- a/OdfFile/Reader/Converter/xlsx_drawing.cpp +++ b/OdfFile/Reader/Converter/xlsx_drawing.cpp @@ -191,14 +191,14 @@ void xml_serialize_shape(std::wostream & strm, _xlsx_drawing & val, const std::w { CP_XML_NODE(ns + L":cNvPr") { - CP_XML_ATTR(L"id", val.id);//числовое значение val.rId + CP_XML_ATTR(L"id", val.id);// numeric value of val.rId CP_XML_ATTR(L"name", val.name); if (val.hidden) CP_XML_ATTR(L"hidden", 1); oox_serialize_action(CP_XML_STREAM(), val.action); } - CP_XML_NODE(ns + L":cNvSpPr")//non visual properies (собственно тока 1 там) + CP_XML_NODE(ns + L":cNvSpPr")// non visual properties (actually only 1 there) { if (val.sub_type == 1)CP_XML_ATTR(L"txBox", 1); } @@ -218,7 +218,7 @@ void xml_serialize_shape(std::wostream & strm, _xlsx_drawing & val, const std::w } // CP_XML_WRITER } void xml_serialize_object(std::wostream & strm, _xlsx_drawing & val) -{//отображательная часть +{// display part CP_XML_WRITER(strm) { CP_XML_NODE(L"xdr:sp") @@ -227,7 +227,7 @@ void xml_serialize_object(std::wostream & strm, _xlsx_drawing & val) { CP_XML_NODE(L"xdr:cNvPr") { - CP_XML_ATTR(L"id", val.id); //числовое значение val.rId + CP_XML_ATTR(L"id", val.id); // numeric value of val.rId CP_XML_ATTR(L"name", val.name); if (val.hidden) CP_XML_ATTR(L"hidden", 1); @@ -290,7 +290,7 @@ void xml_serialize_group(std::wostream & strm, _xlsx_drawing & val, const std::w } void xml_serialize_chart(std::wostream & strm, _xlsx_drawing & val) -{//отображательная часть +{// display part CP_XML_WRITER(strm) { CP_XML_NODE(L"xdr:graphicFrame") diff --git a/OdfFile/Reader/Converter/xlsx_drawing_context.cpp b/OdfFile/Reader/Converter/xlsx_drawing_context.cpp index 5240b5eb36..58098a76b3 100644 --- a/OdfFile/Reader/Converter/xlsx_drawing_context.cpp +++ b/OdfFile/Reader/Converter/xlsx_drawing_context.cpp @@ -506,7 +506,7 @@ std::wstring xlsx_drawing_context::add_hyperlink(std::wstring const & href) std::wstring href_correct = XmlUtils::EncodeXmlString(href); XmlUtils::replace_all( href_correct, L" .", L".");//1 (130).odt - //корректность написания ссылки важна для ms office и не важна для open office -> + //link spelling correctness matters for ms office but not for open office -> //todooo _hlink_desc desc = {hId, href_correct}; impl_->object_description_.hlinks_.push_back(desc); @@ -559,7 +559,7 @@ void xlsx_drawing_context::process_common_properties(drawing_object_description { _rect & r = obj.svg_rect_.get(); - //todooo непонятно что делать с отрицательными значениями + //todooo unclear what to do with negative values _INT32 val = 0; val = (_INT32) (0.5 + odf_types::length(obj.svg_rect_->x, odf_types::length::pt).get_value_unit(odf_types::length::emu)); @@ -653,7 +653,7 @@ void xlsx_drawing_context::process_image(drawing_object_description & obj, _xlsx GetProperty(obj.additional_, L"luminance", drawing.fill.bitmap->luminance); GetProperty(obj.additional_, L"contrast", drawing.fill.bitmap->contrast); - if (sTextContent)//в ms office на картинке нельзя сделать надпись - меняем тип на рект с заливкой картинкой + if (sTextContent)//in ms office you can't add text to image - changing type to rect with image fill { drawing.type = typeShape; drawing.sub_type = 2;//rect @@ -676,27 +676,27 @@ void xlsx_drawing_context::process_image(drawing_object_description & obj, _xlsx { drawing.fill.bitmap->bStretch = true; } - std::wstring ref;/// это ссылка на выходной внешний объект + std::wstring ref;/// this is a link to output external object bool isMediaInternal = false; drawing.fill.bitmap->rId = impl_->get_mediaitems()->add_or_find(obj.xlink_href_, typeImage, isMediaInternal, ref, oox::document_place); if (drawing.type == typeShape) { - impl_->get_drawings()->add(isMediaInternal, drawing.fill.bitmap->rId, ref, typeImage, false, false);//собственно это не объект, а доп рел и ref объекта + impl_->get_drawings()->add(isMediaInternal, drawing.fill.bitmap->rId, ref, typeImage, false, false);//actually this is not an object, but additional rel and object ref isMediaInternal=true; std::wstring rId = impl_->get_mediaitems()->add_or_find(L"", typeShape, isMediaInternal, ref, oox::document_place); - xlsx_drawings_->add(drawing, isMediaInternal, rId, ref, typeShape);//объект + xlsx_drawings_->add(drawing, isMediaInternal, rId, ref, typeShape);//object } else { - xlsx_drawings_->add(drawing, isMediaInternal, drawing.fill.bitmap->rId , ref, typeImage);//объект + xlsx_drawings_->add(drawing, isMediaInternal, drawing.fill.bitmap->rId , ref, typeImage);//object if (drawing.inGroup) - impl_->get_drawings()->add(isMediaInternal, drawing.fill.bitmap->rId, ref, obj.type_, false, false); // не объект + impl_->get_drawings()->add(isMediaInternal, drawing.fill.bitmap->rId, ref, obj.type_, false, false); // not an object } } @@ -709,7 +709,7 @@ void xlsx_drawing_context::process_chart(drawing_object_description & obj,_xlsx_ xlsx_drawings_->add(drawing, isMediaInternal, drawing.objectId, ref, obj.type_); if (drawing.inGroup) - impl_->get_drawings()->add(isMediaInternal, drawing.objectId, ref, obj.type_, false, false); // не объект + impl_->get_drawings()->add(isMediaInternal, drawing.objectId, ref, obj.type_, false, false); // not an object } void xlsx_drawing_context::process_object(drawing_object_description & obj, xlsx_table_metrics & table_metrics, _xlsx_drawing & drawing, xlsx_drawings_ptr xlsx_drawings_) @@ -719,7 +719,7 @@ void xlsx_drawing_context::process_object(drawing_object_description & obj, xlsx if (drawing.type_anchor == 2) // absolute { - //пересчет нужен + //recalculation needed xlsx_table_position from, to; process_position_properties (obj, table_metrics, from, to); @@ -752,7 +752,7 @@ void xlsx_drawing_context::process_object(drawing_object_description & obj, xlsx } if (drawing.inGroup) - {// не объекты + {// not objects if (obj.type_ == typeControl || obj.type_ == typeComment) impl_->get_drawings()->add(isMediaInternal, drawing.objectId, ref, obj.type_, false, false); else @@ -820,7 +820,7 @@ void xlsx_drawing_context::process_group_objects(std::vector<drawing_object_desc drawing.fill.bitmap->rId = impl_->get_mediaitems()->add_or_find(drawing.fill.bitmap->xlink_href_, typeImage, isMediaInternal, ref, oox::document_place); bool in_sheet = (obj.type_== typeOleObject || obj.type_== typeMsObject) ? true : false; - impl_->get_drawings()->add(isMediaInternal, drawing.fill.bitmap->rId, ref, typeImage, in_sheet, false);//собственно это не объект, а доп рел и ref объекта + impl_->get_drawings()->add(isMediaInternal, drawing.fill.bitmap->rId, ref, typeImage, in_sheet, false);//actually this is not an object, but additional rel and object ref //object dumps in sheet rels !! } diff --git a/OdfFile/Reader/Converter/xlsx_drawing_context.h b/OdfFile/Reader/Converter/xlsx_drawing_context.h index 4cc9fc1822..446c95ce18 100644 --- a/OdfFile/Reader/Converter/xlsx_drawing_context.h +++ b/OdfFile/Reader/Converter/xlsx_drawing_context.h @@ -91,7 +91,7 @@ public: bool isDefault(); - void set_odf_packet_path(std::wstring path){odf_packet_path_ = path;}//для анализа картинок + void set_odf_packet_path(std::wstring path){odf_packet_path_ = path;}//for image analysis void start_drawing (std::wstring const & name); void end_drawing (); diff --git a/OdfFile/Reader/Converter/xlsx_drawings.cpp b/OdfFile/Reader/Converter/xlsx_drawings.cpp index b40e20f39a..d035a901a7 100644 --- a/OdfFile/Reader/Converter/xlsx_drawings.cpp +++ b/OdfFile/Reader/Converter/xlsx_drawings.cpp @@ -44,7 +44,7 @@ namespace oox { class xlsx_drawings::Impl { public: - void add(_xlsx_drawing & d, bool isInternal, std::wstring const & rid, std::wstring const & ref, _rels_type type, bool sheet_rel )//объект + void add(_xlsx_drawing & d, bool isInternal, std::wstring const & rid, std::wstring const & ref, _rels_type type, bool sheet_rel )//object { if ( type == typeControlProps || type == typeComment) { @@ -72,7 +72,7 @@ public: drawing_rels_.push_back(_rel(false, d.action.hId, d.action.hRef, d.action.typeRels)); } } - void add( bool isInternal, std::wstring const & rid, std::wstring const & ref, _rels_type type, bool sheet_rel, bool vml_rel) //не объект + void add( bool isInternal, std::wstring const & rid, std::wstring const & ref, _rels_type type, bool sheet_rel, bool vml_rel) //not an object { bool present = false; diff --git a/OdfFile/Reader/Converter/xlsx_font.cpp b/OdfFile/Reader/Converter/xlsx_font.cpp index 451f65f47c..de1cfd4e86 100644 --- a/OdfFile/Reader/Converter/xlsx_font.cpp +++ b/OdfFile/Reader/Converter/xlsx_font.cpp @@ -355,7 +355,7 @@ xlsx_font::xlsx_font ( const odf_reader::text_format_properties_ptr &textProp, } //else //{ - // sz = 10.;//kDefaultFontSize; //todooo ... вытащить как в math + // sz = 10.;//kDefaultFontSize; //todooo ... extract like in math //} if ((textProp->style_text_underline_type_ && diff --git a/OdfFile/Reader/Converter/xlsx_hyperlinks.cpp b/OdfFile/Reader/Converter/xlsx_hyperlinks.cpp index 8340489cd6..1d18c62b5f 100644 --- a/OdfFile/Reader/Converter/xlsx_hyperlinks.cpp +++ b/OdfFile/Reader/Converter/xlsx_hyperlinks.cpp @@ -84,7 +84,7 @@ public: r.display = display; r.id = std::wstring(L"hId") + std::to_wstring(records_.size()+1); - if (0 == target.find(L"#"))//ссыль на страницу или метку в текущем документе + if (0 == target.find(L"#"))//link to page or bookmark in current document { r.location = converter_.convert_chart_distance(target.substr(1)); r.type = L"Internal"; diff --git a/OdfFile/Reader/Converter/xlsx_numFmts.cpp b/OdfFile/Reader/Converter/xlsx_numFmts.cpp index f69e88710e..9ce8c718bc 100644 --- a/OdfFile/Reader/Converter/xlsx_numFmts.cpp +++ b/OdfFile/Reader/Converter/xlsx_numFmts.cpp @@ -76,7 +76,7 @@ unsigned int xlsx_num_fmts::Impl::add(const std::wstring & format_code, unsigned } else { - //занято id для format_code -> следующий если есть берем + //id is taken for format_code -> take next if available id = add(format_code, ++id); } return id; diff --git a/OdfFile/Reader/Converter/xlsx_output_xml.cpp b/OdfFile/Reader/Converter/xlsx_output_xml.cpp index 1be20e37db..84235176b6 100644 --- a/OdfFile/Reader/Converter/xlsx_output_xml.cpp +++ b/OdfFile/Reader/Converter/xlsx_output_xml.cpp @@ -256,10 +256,10 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm) { CP_XML_STREAM() << protect; } - //оказывается порядок нахождения элементов важен !!! (для office 2010) - //объединенные ячейки раньше чем гиперлинки !!! - - CP_XML_STREAM() << impl_->autofilter_.str(); //автофильтры перед merge !!! + //turns out element order is important!!! (for office 2010) + //merged cells before hyperlinks!!! + + CP_XML_STREAM() << impl_->autofilter_.str(); //autofilters before merge!!! CP_XML_STREAM() << impl_->mergeCells_.str(); @@ -278,7 +278,7 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm) } } CP_XML_STREAM() << impl_->page_props_.str(); - //props выше legacyDrawing !! + //props above legacyDrawing!! CP_XML_STREAM() << impl_->header_footer_.str(); diff --git a/OdfFile/Reader/Converter/xlsx_pivots_context.cpp b/OdfFile/Reader/Converter/xlsx_pivots_context.cpp index ad4f4a98cd..db8471f6c7 100644 --- a/OdfFile/Reader/Converter/xlsx_pivots_context.cpp +++ b/OdfFile/Reader/Converter/xlsx_pivots_context.cpp @@ -191,7 +191,7 @@ public: private: bool clear_header_map(std::map<size_t, size_t> & map) - {//отсев по секонд - нужны тока повторы + {//filter by second - only need duplicates std::map<size_t, size_t> count; size_t max_size = 0; @@ -224,7 +224,7 @@ private: break; } } - //удалим все что не найденое + //remove everything not found std::map<size_t, size_t>::iterator it = map.begin(); while( it != map.end()) { @@ -238,7 +238,7 @@ private: return true; } void clear_header_map2(std::map<size_t, size_t> & map, std::map<size_t, size_t> & map_by) - {//отсев тех кто во втором + {//filter out those in the second for (std::map<size_t, size_t>::iterator it = map_by.begin() ; it != map_by.end(); ++it) { std::map<size_t, size_t>::iterator pFind = map.find(it->second); @@ -454,7 +454,7 @@ void xlsx_pivots_context::Impl::sort_fields() if (current_.fields[k].name == current_.fields[i].source_groups && !current_.fields[i].source_groups.empty()) { if (current_.fields[k].type_groups == 0) - current_.fields[k].base_group = index_current; //опорный (если он и базовый - не писать) + current_.fields[k].base_group = index_current; //base (if it's also the base - don't write) current_.fields[i].base_group = index_group; for (size_t c = 0; !current_.fields[i].groups.empty() && c < current_.fields[k].caches.size(); c++) @@ -1021,9 +1021,9 @@ void xlsx_pivots_context::Impl::serialize_cache(std::wostream & strm) if (used_field_name.end() != used_field_name.find(current_.fields[i].name)) continue; //--------------------------------------------------------------------------- - used_field_name.insert(std::make_pair(current_.fields[i].name, true)); //дублированые поля + used_field_name.insert(std::make_pair(current_.fields[i].name, true)); //duplicated fields - std::wstring name = current_.fields[i].name; // в мс "H" и "h" одно имя ( + std::wstring name = current_.fields[i].name; // in MS "H" and "h" are the same name ( std::wstring name_lower = XmlUtils::GetLower(name); @@ -1506,7 +1506,7 @@ void xlsx_pivots_context::add_field_cache(int index, std::wstring value, bool sh int pos = (int)value.find(L"$"); //$1,33,333.00 _CP_OPT(double) dVal; - if (pos >= 0)//финановый .. todooo общее правило бы... + if (pos >= 0)//financial .. todooo would need a general rule... { //value = value.substr(pos + 1); //XmlUtils::replace_all(value, L",", L""); diff --git a/OdfFile/Reader/Converter/xlsx_table_state.cpp b/OdfFile/Reader/Converter/xlsx_table_state.cpp index bbb21ab9df..ea078b4e37 100644 --- a/OdfFile/Reader/Converter/xlsx_table_state.cpp +++ b/OdfFile/Reader/Converter/xlsx_table_state.cpp @@ -386,7 +386,7 @@ std::wstring xlsx_table_state::default_column_cell_style() const return column_default_cell_style_name_.at(current_table_column_ + 1); else { - //непонятная хрень!! - неправильно сформирован ods??? + //unclear issue!! - incorrectly formed ods??? return L""; } } @@ -406,7 +406,7 @@ void xlsx_table_state::start_cell(size_t columnsSpanned, size_t rowsSpanned) { current_table_column_++; - // в случае если объединение имеет место добавляем запись о нем + // if merge takes place, add a record for it if (columnsSpanned != 0 || rowsSpanned != 0) { xlsx_merge_cells_.add_merge(current_table_column_, current_table_row_, columnsSpanned, rowsSpanned); @@ -419,8 +419,8 @@ void xlsx_table_state::start_cell(size_t columnsSpanned, size_t rowsSpanned) columns_spanned_num_ = static_cast<int>(columnsSpanned); - // обновляем вектор, в котором хранятся информация об объединении строк - // добавляем в него новый столбец + // update the vector that stores row merge information + // add a new column to it for (size_t i = 0; i <= columns_spanned_num_; ++i) @@ -472,14 +472,14 @@ void xlsx_table_state::start_covered_cell() { current_table_column_++; - // обновляем вектор, в котором хранятся информация об объединении строк - // добавляем в него новый столбец + // update the vector that stores row merge information + // add a new column to it if (current_table_column_ >= (int)(rows_spanned_.size())) rows_spanned_.push_back(xlsx_row_spanned()); - // использовали текущую ячейку, уменьшаем счетчики оставшихся объединенных ячеек - // для столбцов и строк + // used current cell, decrement counters of remaining merged cells + // for columns and rows if (columns_spanned_num_ > 0) columns_spanned_num_--; diff --git a/OdfFile/Reader/Converter/xlsx_tablecontext.cpp b/OdfFile/Reader/Converter/xlsx_tablecontext.cpp index e15c13079d..1268447d7f 100644 --- a/OdfFile/Reader/Converter/xlsx_tablecontext.cpp +++ b/OdfFile/Reader/Converter/xlsx_tablecontext.cpp @@ -473,8 +473,8 @@ namespace oox { { if (false == xlsx_data_ranges_[it->second]->bTablePart) continue; - // из за дебелизма мсофис которому ОБЯЗАТЕЛЬНО нужно прописывать имена колонок таблицы (и они должны быть еще - // прописаны и в самих данных таблицы !! + // due to MS Office stupidity which REQUIRES specifying table column names (and they must also be + // specified in the table data itself!! while (xlsx_data_ranges_[it->second]->header_values.size() > xlsx_data_ranges_[it->second]->cell_end.first - xlsx_data_ranges_[it->second]->cell_start.first + 1) @@ -623,7 +623,7 @@ namespace oox { { CP_XML_NODE(L"autoFilter") { - //в автофильтре тока простые диапазоны .. для сложных - tablePart + //autofilter only has simple ranges .. for complex ones - tablePart CP_XML_ATTR(L"ref", getCellAddress(cell_start.first, cell_start.second) + L":" + getCellAddress(cell_end.first, cell_end.second)); //CP_XML_ATTR(L"ref", ref); if (ind_filter != -1) diff --git a/OdfFile/Reader/Converter/xlsx_textcontext.cpp b/OdfFile/Reader/Converter/xlsx_textcontext.cpp index 454f9103dd..41f1023540 100644 --- a/OdfFile/Reader/Converter/xlsx_textcontext.cpp +++ b/OdfFile/Reader/Converter/xlsx_textcontext.cpp @@ -82,7 +82,7 @@ public: void ApplyTextProperties (std::wstring style, std::wstring para_style, odf_reader::text_format_properties & propertiesOut); void ApplyParagraphProperties (std::wstring style, odf_reader::paragraph_format_properties & propertiesOut); - void set_local_styles_container (odf_reader::styles_container* local_styles_);//это если стили объектов содержатся в другом документе + void set_local_styles_container (odf_reader::styles_container* local_styles_);//this is if object styles are contained in another document bool is_drawing_context(){return in_draw;} @@ -110,16 +110,16 @@ private: void write_rPr(std::wostream & strm); void write_pPr(std::wostream & strm); - size_t paragraphs_cout_; //???? тока из за начала отсчета? + size_t paragraphs_cout_; //???? only because of count start? - std::wstringstream text_; //приходящий текст - std::wstringstream paragraph_; //перманенто скидываемые параграфы - std::wstringstream run_; //перманенто скидываемые куски с быть может разными свойствами + std::wstringstream text_; //incoming text + std::wstringstream paragraph_; //permanently dumped paragraphs + std::wstringstream run_; //permanently dumped chunks with possibly different properties std::wstring store_cell_string_; xlsx_shared_strings xlsx_shared_strings_; - std::wstring paragraph_style_name_;//был вектор ... не нужен, так как в один момент времени может быть тока один стиль параграфа,текста,объекта при приходе нового - дампится + std::wstring paragraph_style_name_;//was a vector... not needed, since at one moment there can be only one paragraph/text/object style, when new one arrives - it gets dumped std::wstring span_style_name_; }; @@ -161,7 +161,7 @@ void xlsx_text_context::Impl::start_paragraph(const std::wstring & styleName) if ( in_comment || only_text/* || in_cell_content*/) { //text_ << L" "; - // конец предыдущего абзаца и начало следующего + // end of previous paragraph and start of next text_ << L"\n"; // } else/* (paragraph_style_name_ != styleName)*/ @@ -186,7 +186,7 @@ void xlsx_text_context::Impl::end_paragraph() in_paragraph = false; } -void xlsx_text_context::Impl::start_span(const std::wstring & styleName)//кусок текста в абзаце(параграфе) со своими свойствами - этто может быть и 1 буква +void xlsx_text_context::Impl::start_span(const std::wstring & styleName)//text chunk in paragraph with its own properties - this can be even 1 letter { int text_size = text_.str().length(); @@ -208,8 +208,8 @@ void xlsx_text_context::Impl::start_span(const std::wstring & styleName)//кус in_span = true; } -void xlsx_text_context::Impl::end_span() //odf корявенько написан - возможны повторы стилей в последовательных кусках текста -//пока с анализом стилей тока комменты - остальные текстовые куски как есть.. с охрененным возможно дубляжом +void xlsx_text_context::Impl::end_span() //odf is written awkwardly - style repetitions possible in consecutive text chunks +//for now only comments analyze styles - other text chunks as is.. with possible huge duplication { if (!in_comment && !only_text) { @@ -542,7 +542,7 @@ void xlsx_text_context::Impl::start_drawing_content() } std::wstring xlsx_text_context::Impl::end_comment_content() { - dump_run();//если в комменте куча абзацев со одним стилем - сдампится здесь - иначе дампится по мере прихода каждого нового стиля + dump_run();//if comment has many paragraphs with same style - dumps here - otherwise dumps as each new style arrives std::wstring comment= run_.str(); @@ -560,7 +560,7 @@ std::wstring xlsx_text_context::Impl::end_comment_content() } std::wstring xlsx_text_context::Impl::end_drawing_content() { - dump_paragraph();//если в draw куча абзацев со одним стилем - сдампится здесь - иначе дампится по мере прихода каждого нового стиля + dump_paragraph();//if draw has many paragraphs with same style - dumps here - otherwise dumps as each new style arrives std::wstring draw = paragraph_.str(); diff --git a/OdfFile/Reader/Converter/xlsxconversioncontext.cpp b/OdfFile/Reader/Converter/xlsxconversioncontext.cpp index 157732390f..084d62f3ef 100644 --- a/OdfFile/Reader/Converter/xlsxconversioncontext.cpp +++ b/OdfFile/Reader/Converter/xlsxconversioncontext.cpp @@ -102,9 +102,9 @@ void xlsx_conversion_context::set_mediaitems(mediaitems_ptr &items) void xlsx_conversion_context::start_chart(std::wstring name) { charts_.push_back(oox_chart_context_ptr(new oox_chart_context(mediaitems_, name))); - //добавляем новую форму для диаграммы - //в ней будет информационная часть - и она пишется каждый раз в свою xml (их - по числу диаграмм) - //этот контекст нужно передавать в файл + //adding new form for chart + //it will contain info part - and it's written each time to its own xml (count = chart count) + //this context needs to be passed to file } void xlsx_conversion_context::end_chart() @@ -214,7 +214,7 @@ void xlsx_conversion_context::end_document() { CP_XML_NODE(L"sheet") { - CP_XML_ATTR(L"name", XmlUtils::EncodeXmlString(sheet->name())); // ms office ! ограничение на длину имени 31!!! + CP_XML_ATTR(L"name", XmlUtils::EncodeXmlString(sheet->name())); // ms office ! name length limit 31!!! CP_XML_ATTR(L"sheetId", i + 1); CP_XML_ATTR(L"state", sheet->hidden() ? L"hidden" : L"visible"); CP_XML_ATTR(L"r:id", id); @@ -896,7 +896,7 @@ xlsx_table_metrics & xlsx_conversion_context::get_table_metrics() return get_table_context().get_table_metrics(); } void xlsx_conversion_context::start_drawing_context() -{//todooo если делать множественную вложенность -> vector +{//todooo if making multiple nesting -> vector if (xlsx_drawing_context_) return; xlsx_drawing_context_ = boost::shared_ptr<xlsx_drawing_context>(new xlsx_drawing_context(get_drawing_context_handle(), true)); @@ -957,14 +957,14 @@ void xlsx_conversion_context::end_hyperlink(std::wstring const & href) } else { - std::wstring hId = get_table_context().get_drawing_context().add_hyperlink(href); // на внешний объект + std::wstring hId = get_table_context().get_drawing_context().add_hyperlink(href); // to external object xlsx_text_context_.end_hyperlink(hId); xlsx_text_context_.end_span2(); } } void xlsx_conversion_context::add_pivot_sheet_source (const std::wstring & sheet_name, int index_table_view) -{//ващето в либре жесткая привязка что на одном листе тока одна сводная может быть .. +{//actually in LibreOffice there's a hard limit that only one pivot table can be on one sheet .. mapPivotsTableView_.insert(std::make_pair(sheet_name, index_table_view)); } void xlsx_conversion_context::add_jsaProject(const std::string &content) diff --git a/OdfFile/Reader/Format/anim_elements.cpp b/OdfFile/Reader/Format/anim_elements.cpp index 6577dfee8d..c9a3bb7081 100644 --- a/OdfFile/Reader/Format/anim_elements.cpp +++ b/OdfFile/Reader/Format/anim_elements.cpp @@ -579,7 +579,7 @@ void anim_par::pptx_convert(oox::pptx_conversion_context & Context) _CP_OPT(int) presentationPresetId; _CP_OPT(int) presentationPresetPresetSubType; - bool isSlideAnimation = false; // NOTE: Анимация применяется к самому слайду, а не элементу на слайде + bool isSlideAnimation = false; // NOTE: Animation is applied to the slide itself, not to an element on the slide _CP_OPT(int) accelerate; _CP_OPT(int) decelerate; @@ -712,14 +712,14 @@ void anim_par::pptx_convert(oox::pptx_conversion_context & Context) if (anim_par_array_.size()) { for(size_t i = 0; i < anim_par_array_.size(); i++) - anim_par_array_[i]->pptx_convert(Context); // это для самого слайда (то что и нужно) + anim_par_array_[i]->pptx_convert(Context); // this is for the slide itself (which is what we need) } for (size_t i = 0; i < anim_seq_array_.size(); i++) { anim_seq_array_[i]->pptx_convert(Context); } ///////////////////////////////////////////////////////////////// -//внутренние эффекты - те что внутри одной последовательности +//internal effects - those inside one sequence for (size_t i = 0; i < content_.size(); i++) { content_[i]->pptx_convert(Context); @@ -733,7 +733,7 @@ void anim_par::add_child_element( xml::sax * Reader, const std::wstring & Ns, co if CP_CHECK_NAME(L"anim", L"par") CP_CREATE_ELEMENT(anim_par_array_); else if CP_CHECK_NAME(L"anim", L"seq") - CP_CREATE_ELEMENT(anim_seq_array_);//более 1 элемента- взаимосвязанная анимация (между фигурами) + CP_CREATE_ELEMENT(anim_seq_array_);//more than 1 element - interrelated animation (between shapes) else CP_CREATE_ELEMENT(content_); } diff --git a/OdfFile/Reader/Format/anim_elements.h b/OdfFile/Reader/Format/anim_elements.h index 817d0436e6..a683d0c8af 100644 --- a/OdfFile/Reader/Format/anim_elements.h +++ b/OdfFile/Reader/Format/anim_elements.h @@ -41,7 +41,7 @@ namespace cpdoccore { namespace odf_reader { //anim:par -class anim_par : public office_element_impl<anim_par>//Параллельные анимации +class anim_par : public office_element_impl<anim_par>//Parallel animations { public: static const wchar_t * ns; @@ -69,7 +69,7 @@ private: CP_REGISTER_OFFICE_ELEMENT2(anim_par); ////////////////////////////////////////////////////////////////////////////////////////////////////////////// //anim:seq -class anim_seq : public office_element_impl<anim_seq>//Последовательные анимации +class anim_seq : public office_element_impl<anim_seq>//Sequential animations { public: static const wchar_t * ns; diff --git a/OdfFile/Reader/Format/chart_build_oox.cpp b/OdfFile/Reader/Format/chart_build_oox.cpp index 648eea6672..0da12a297e 100644 --- a/OdfFile/Reader/Format/chart_build_oox.cpp +++ b/OdfFile/Reader/Format/chart_build_oox.cpp @@ -87,7 +87,7 @@ static double convert_symbol_size(double val, double metrix, bool add_padding) return pixels * 0.75; //* 9525. * 72.0 / (360000.0 * 2.54); } -// Класс для конструирования чартов +// Class for constructing charts using namespace chart; void object_odf_context::set_pivot_source(std::wstring const & val) @@ -458,7 +458,7 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context) for (size_t i = 0; i < series_.size(); i++) { - if (series_[i].class_ != last_set_class) //разные типы серий в диаграмме - например бар и линия. + if (series_[i].class_ != last_set_class) //different series types in chart - e.g. bar and line. { chart_context.add_chart(series_[i].class_); last_set_class = series_[i].class_; @@ -487,10 +487,10 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context) if (series_[i].cell_range_address_.empty()) series_[i].cell_range_address_ = domain_cell_range_adress2_; - //тут данные нужно поделить по столбцам или строкам - так как в плот-ареа общий диапазон - //первый столбец-строка МОЖЕт использоваться для подписей - //каждая серия берет каждый последующий диапазрн - //такое определение - редкость = todooo + //here the data needs to be split by columns or rows - since plot-area has a common range + //first column-row MAY be used for labels + //each series takes each subsequent range + //such definition is rare = todooo std::vector<std::wstring> domain_cash; std::vector<std::wstring> cell_cash; @@ -502,7 +502,7 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context) calc_cache_series (series_[i].label_cell_address_, label_cash); if (chart_context.no_used_local_tables_ && false == table_name_.empty()) - {//убрать ссылки на локальную таблицу кэшей + {//remove references to local cache table if (std::wstring::npos != series_[i].cell_range_address_.find(table_name_)) { series_[i].cell_range_address_.clear(); @@ -514,7 +514,7 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context) } if (false == categories_.empty()) - {//вычищать от локальных ссылок нельзя. может использоваться в последующих сериях + {//cannot clear local references. may be used in subsequent series calc_cache_series (categories_[0], cat_cash); } @@ -580,7 +580,7 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context) current->set_values_series(1, cell_cash); } - if (categories_.empty() == false)//названия + if (categories_.empty() == false)//names/labels { if (chart_context.no_used_local_tables_) { @@ -623,11 +623,11 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context) last_set_class == chart_class::bubble) a.type_ = 2; if (class_ == chart_class::stock && a.type_ == 3 ) - a.type_ = 4; //шкала дат. + a.type_ = 4; //date scale if (bIs3D.get_value_or(false)) { - a.type_ = 1; // шкала категорий + a.type_ = 1; // category scale } x_enabled = true; @@ -867,17 +867,17 @@ void process_build_object::visit(office_chart& val) void process_build_object::visit(office_text& val) { object_odf_context_.object_type_ = 2; - object_odf_context_.office_text_ = &val; //конвертация будет уровнем выше + object_odf_context_.office_text_ = &val; //conversion will be at a higher level } void process_build_object::visit(office_math& val) { - object_odf_context_.object_type_ = 3; //= 0 - временно замещающая картинка - object_odf_context_.office_math_ = &val; //конвертация будет уровнем выше + object_odf_context_.object_type_ = 3; //= 0 - temporary placeholder image + object_odf_context_.office_math_ = &val; //conversion will be at a higher level } void process_build_object::visit(office_spreadsheet& val) { object_odf_context_.object_type_ = 4; - object_odf_context_.office_spreadsheet_ = &val; //конвертация будет уровнем выше + object_odf_context_.office_spreadsheet_ = &val; //conversion will be at a higher level } void process_build_object::visit(chart_chart& val) { diff --git a/OdfFile/Reader/Format/createandread.cpp b/OdfFile/Reader/Format/createandread.cpp index 689323c86b..11ca0178b1 100644 --- a/OdfFile/Reader/Format/createandread.cpp +++ b/OdfFile/Reader/Format/createandread.cpp @@ -53,7 +53,7 @@ bool create_element_and_read(xml::sax * Reader, elm->read_sax( Reader ); elm->afterReadContent(); - if (_Element) // элемент читается повторно + if (_Element) // element is being read repeatedly { _CP_LOG << L"[error] : duplicate element (" << Ns << L":" << Name << L")\n"; } diff --git a/OdfFile/Reader/Format/draw_common.cpp b/OdfFile/Reader/Format/draw_common.cpp index 230c23dd26..d13cd8001e 100644 --- a/OdfFile/Reader/Format/draw_common.cpp +++ b/OdfFile/Reader/Format/draw_common.cpp @@ -156,7 +156,7 @@ bool parse_clipping(std::wstring strClipping, int fileWidth, int fileHeight, dou if (!bEnableCrop) return false; - if (Points_pt.size() > 3)//если другое количество точек .. попозже + if (Points_pt.size() > 3)//if different number of points.. handle later { float dpi_ = 96.; clip_rect[0] = dpi_ * Points_pt[3].get_value_unit(length::inch); @@ -164,7 +164,7 @@ bool parse_clipping(std::wstring strClipping, int fileWidth, int fileHeight, dou clip_rect[2] = dpi_ * Points_pt[1].get_value_unit(length::inch); clip_rect[3] = dpi_ * Points_pt[2].get_value_unit(length::inch); - // в проценты + // convert to percentages clip_rect[0] = clip_rect[0]*100/fileWidth; clip_rect[2] = clip_rect[2]*100/fileWidth; clip_rect[1] = clip_rect[1]*100/fileHeight; @@ -486,7 +486,7 @@ void Compute_GraphicFill(const common_draw_fill_attlist & props, const office_el if (opacity_style->draw_start_ && opacity_style->draw_end_ || opacity_style->content_.size() > 1) { fill.gradient = oox::oox_gradient_fill::create(); - fill.type = 3; //?? градиентная прозрачность на картинку + fill.type = 3; //?? gradient transparency on image for (size_t i = 0; i < opacity_style->content_.size(); ++i) { @@ -511,7 +511,7 @@ void Compute_GraphicFill(const common_draw_fill_attlist & props, const office_el fill.solid = oox::oox_solid_fill::create(); fill.solid->color = props.draw_fill_color_->get_hex_value(); - if (fill.type <= 0 && !txbx ) fill.type = 1; //в этом случае тип может и не быть задан явно + if (fill.type <= 0 && !txbx ) fill.type = 1; //in this case the type may not be explicitly set if (fill.gradient) { @@ -749,7 +749,7 @@ void draw_a::pptx_convert(oox::pptx_conversion_context & Context) } void draw_a::docx_convert(oox::docx_conversion_context & Context) { - Context.get_drawing_context().draw_hyperlinkRId = Context.add_hyperlink(xlink_attlist_.href_.get_value_or(L""), L""); //гиперлинк с объекта, а не с текста .. + Context.get_drawing_context().draw_hyperlinkRId = Context.add_hyperlink(xlink_attlist_.href_.get_value_or(L""), L""); //hyperlink from object, not from text.. for (size_t i = 0; i < content_.size(); i++) { @@ -784,10 +784,10 @@ void docx_convert_transforms(std::wstring transformStr,std::vector<odf_reader::_ boost::algorithm::split(transform, transforms[i], boost::algorithm::is_any_of(L"("), boost::algorithm::token_compress_on); - if (transform.size() > 1)//тока с аргументами + if (transform.size() > 1)//only with arguments { int res=0; - if ((res = transform[0].find(L"translate")) >= 0) //перемещение + if ((res = transform[0].find(L"translate")) >= 0) //translation { std::vector<length> Points ; parse_string_to_points(transform[1], Points); @@ -797,29 +797,29 @@ void docx_convert_transforms(std::wstring transformStr,std::vector<odf_reader::_ double x_pt = Points[0].get_value_unit(length::pt); double y_pt = 0; - if (Points.size() > 1) y_pt = Points[1].get_value_unit(length::pt); //ее может не быть + if (Points.size() > 1) y_pt = Points[1].get_value_unit(length::pt); //it may not exist //Context.get_drawing_context().set_translate(x_pt,y_pt); additional.push_back(_property(L"svg:translate_x", x_pt)); additional.push_back(_property(L"svg:translate_y", y_pt)); } } - else if ((res = transform[0].find(L"scale"))>=0)//масштабирование + else if ((res = transform[0].find(L"scale"))>=0)//scaling { std::vector<length> Points ; parse_string_to_points(transform[1], Points); if (Points.size()>0) { double x_pt = Points[0].get_value_unit(length::pt); - double y_pt = x_pt; - if (Points.size()>1)y_pt = Points[1].get_value_unit(length::pt);//ее может не быть + double y_pt = x_pt; + if (Points.size()>1)y_pt = Points[1].get_value_unit(length::pt);//it may not exist //Context.get_drawing_context().set_scale(x_pt,y_pt); additional.push_back(_property(L"svg:scale_x", x_pt)); additional.push_back(_property(L"svg:scale_y", y_pt)); } } - else if ((res = transform[0].find(L"rotate"))>=0)//вращение + else if ((res = transform[0].find(L"rotate"))>=0)//rotation { double angle = boost::lexical_cast<double>(transform[1]); additional.push_back(_property(L"svg:rotate", angle)); @@ -840,10 +840,10 @@ void xlsx_convert_transforms(std::wstring transformStr, oox::xlsx_conversion_con std::vector<std::wstring> transform; boost::algorithm::split(transform, transforms[i], boost::algorithm::is_any_of(L"("), boost::algorithm::token_compress_on); - if (transform.size() > 1)//тока с аргументами + if (transform.size() > 1)//only with arguments { size_t res=0; - if ((res = transform[0].find(L"translate")) != std::wstring::npos)//перемещение + if ((res = transform[0].find(L"translate")) != std::wstring::npos)//translation { std::vector<length> Points ; parse_string_to_points(transform[1], Points); @@ -852,34 +852,34 @@ void xlsx_convert_transforms(std::wstring transformStr, oox::xlsx_conversion_con { double x_pt = Points[0].get_value_unit(length::pt); double y_pt = 0; - if (Points.size()>1)y_pt = Points[1].get_value_unit(length::pt);//ее может не быть + if (Points.size()>1)y_pt = Points[1].get_value_unit(length::pt);//it may not exist Context.get_drawing_context().set_translate(x_pt,y_pt); } } - else if ((res = transform[0].find(L"scale")) != std::wstring::npos)//масштабирование + else if ((res = transform[0].find(L"scale")) != std::wstring::npos)//scaling { std::vector<length> Points ; parse_string_to_points(transform[1], Points); if (Points.size()>0) { double x_pt = Points[0].get_value_unit(length::pt); - double y_pt = x_pt; - if (Points.size()>1)y_pt = Points[1].get_value_unit(length::pt);//ее может не быть + double y_pt = x_pt; + if (Points.size()>1)y_pt = Points[1].get_value_unit(length::pt);//it may not exist Context.get_drawing_context().set_scale(x_pt,y_pt); } } - else if ((res = transform[0].find(L"rotate")) != std::wstring::npos)//вращение + else if ((res = transform[0].find(L"rotate")) != std::wstring::npos)//rotation { Context.get_drawing_context().set_rotate(boost::lexical_cast<double>(transform[1]), true); } - else if ((res = transform[0].find(L"skewX")) != std::wstring::npos)//сдвиг + else if ((res = transform[0].find(L"skewX")) != std::wstring::npos)//skew { double angle = boost::lexical_cast<double>(transform[1]); Context.get_drawing_context().set_property(_property(L"svg:skewX", angle)); } - else if ((res = transform[0].find(L"skewY")) != std::wstring::npos)//сдвиг + else if ((res = transform[0].find(L"skewY")) != std::wstring::npos)//skew { double angle = boost::lexical_cast<double>(transform[1]); Context.get_drawing_context().set_property(_property(L"svg:skewY", angle)); @@ -900,10 +900,10 @@ void pptx_convert_transforms(std::wstring transformStr, oox::pptx_conversion_con std::vector<std::wstring> transform; boost::algorithm::split(transform, transforms[i], boost::algorithm::is_any_of(L"("), boost::algorithm::token_compress_on); - if (transform.size() > 1)//тока с аргументами + if (transform.size() > 1)//only with arguments { size_t res = 0; - if ((res = transform[0].find(L"translate")) != std::wstring::npos)//перемещение + if ((res = transform[0].find(L"translate")) != std::wstring::npos)//translation { std::vector<length> Points ; parse_string_to_points(transform[1], Points); @@ -912,35 +912,35 @@ void pptx_convert_transforms(std::wstring transformStr, oox::pptx_conversion_con { double x_pt = Points[0].get_value_unit(length::pt); double y_pt = 0; - if (Points.size()>1)y_pt = Points[1].get_value_unit(length::pt);//ее может не быть + if (Points.size()>1)y_pt = Points[1].get_value_unit(length::pt);//it may not exist Context.get_slide_context().set_translate(x_pt, y_pt); } } - else if ((res = transform[0].find(L"scale")) != std::wstring::npos)//масштабирование + else if ((res = transform[0].find(L"scale")) != std::wstring::npos)//scaling { std::vector<length> Points ; parse_string_to_points(transform[1], Points); - + if (false == Points.empty()) { double x_pt = Points[0].get_value_unit(length::pt); - double y_pt = x_pt; - if (Points.size()>1)y_pt = Points[1].get_value_unit(length::pt);//ее может не быть + double y_pt = x_pt; + if (Points.size()>1)y_pt = Points[1].get_value_unit(length::pt);//it may not exist Context.get_slide_context().set_scale(x_pt, y_pt); } } - else if ((res = transform[0].find(L"rotate")) != std::wstring::npos)//вращение + else if ((res = transform[0].find(L"rotate")) != std::wstring::npos)//rotation { Context.get_slide_context().set_rotate( boost::lexical_cast<double>(transform[1]), true); } - else if ((res = transform[0].find(L"skewX")) != std::wstring::npos)//вращение + else if ((res = transform[0].find(L"skewX")) != std::wstring::npos)//skew { double angle = boost::lexical_cast<double>(transform[1]); Context.get_slide_context().set_property(_property(L"svg:skewX", angle)); } - else if ((res = transform[0].find(L"skewY")) != std::wstring::npos)//вращение + else if ((res = transform[0].find(L"skewY")) != std::wstring::npos)//skew { double angle = boost::lexical_cast<double>(transform[1]); Context.get_slide_context().set_property(_property(L"svg:skewY", angle)); diff --git a/OdfFile/Reader/Format/draw_frame.cpp b/OdfFile/Reader/Format/draw_frame.cpp index 8ccaecf2bb..5ac9e8a2b7 100644 --- a/OdfFile/Reader/Format/draw_frame.cpp +++ b/OdfFile/Reader/Format/draw_frame.cpp @@ -278,7 +278,7 @@ void draw_frame::add_child_element( xml::sax * Reader, const std::wstring & Ns, { CP_CREATE_ELEMENT(content_); } - else if CP_CHECK_NAME(L"draw", L"object") //embedded объект + else if CP_CHECK_NAME(L"draw", L"object") //embedded object { CP_CREATE_ELEMENT(content_); is_object_ = true; diff --git a/OdfFile/Reader/Format/draw_frame_docx.cpp b/OdfFile/Reader/Format/draw_frame_docx.cpp index 5b942bab73..e7f02d8aad 100644 --- a/OdfFile/Reader/Format/draw_frame_docx.cpp +++ b/OdfFile/Reader/Format/draw_frame_docx.cpp @@ -591,7 +591,7 @@ int ComputeMarginY(const style_page_layout_properties_attlist & pageProperties, { const _CP_OPT(anchor_type) anchor = attlists_.shape_with_text_and_styles_.common_text_anchor_attlist_.type_; - //todooo пока не ясно как привязать к определеной странице в документе ... + //todooo not yet clear how to anchor to a specific page in document ... //const _CP_OPT(unsigned int) anchor_page_number = // attlists_.shape_with_text_and_styles_. // common_text_anchor_attlist_. @@ -623,7 +623,7 @@ int ComputeMarginY(const style_page_layout_properties_attlist & pageProperties, const _CP_OPT(length) translation = length(dVal ? *dVal : 0, length::pt); const _CP_OPT(length) pageHeight = pageProperties.fo_page_height_; - // TODO : проверить, значения в процентах что именно означают + // TODO : check what exactly percent values mean const _CP_OPT(length) pageMarginTop = CalcResultLength(pageProperties.common_vertical_margin_attlist_.fo_margin_top_, pageHeight); const _CP_OPT(length) pageMarginBottom = CalcResultLength(pageProperties.common_vertical_margin_attlist_.fo_margin_bottom_, pageHeight); @@ -772,7 +772,7 @@ int ComputeMarginY(const style_page_layout_properties_attlist & pageProperties, svgY = *attlists_.position_.svg_y_; } - //if (anchor_page_number && pageHeight)....так нельзя .. только в пределах текущей страницы :( + //if (anchor_page_number && pageHeight)....can't do this .. only within current page :( //{ // svgY = length(svgY->get_value_unit(length::pt) + pageHeight->get_value_unit(length::pt) * (*anchor_page_number - 1), length::pt ); //} @@ -899,7 +899,7 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm drawing->behindDoc = L"0"; if (!drawing->styleWrap) - drawing->styleWrap = style_wrap(style_wrap::Parallel);//у опен офис и мс разные дефолты + drawing->styleWrap = style_wrap(style_wrap::Parallel);//OpenOffice and MS have different defaults if (((drawing->styleWrap && drawing->styleWrap->get_type() == style_wrap::RunThrough) || !drawing->styleWrap) && ((styleRunThrough && styleRunThrough->get_type() == run_through::Background) || !styleRunThrough)) @@ -911,7 +911,7 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm _CP_OPT(unsigned int) zIndex = attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_z_index_; - if (zIndex)//порядок отрисовки объектов + if (zIndex)//object drawing order { if (*zIndex < 0) drawing->relativeHeight = L"0"; @@ -1009,7 +1009,7 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm } if (Context.process_headers_footers_ && drawing->posOffsetH < 0) - {//p7офис_Альт.odt + {//p7office_Alt.odt const _CP_OPT(length) pageMarginLeft = CalcResultLength(pageProperties.common_horizontal_margin_attlist_.fo_margin_left_, pageProperties.fo_page_width_); if (pageMarginLeft) @@ -1045,7 +1045,7 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm } //////////////////////////////////////////////////////////////////////////////////////////////////// - if ((drawing->styleWrap) && (drawing->styleWrap->get_type() == style_wrap::Dynamic)) //автоподбор + if ((drawing->styleWrap) && (drawing->styleWrap->get_type() == style_wrap::Dynamic)) //auto-fit { int max_width = get_value_emu(pageProperties.fo_page_width_); int max_height = get_value_emu(pageProperties.fo_page_height_); @@ -1092,7 +1092,7 @@ void draw_shape::docx_convert(oox::docx_conversion_context & Context) drawing.hyperlinkRId = Context.get_drawing_context().draw_hyperlinkRId; drawing.sub_type = sub_type_; - drawing.additional = additional_;//сюда могут добавиться свойства ... + drawing.additional = additional_;//properties can be added here ... if (drawing.lined == false) { @@ -1105,13 +1105,13 @@ void draw_shape::docx_convert(oox::docx_conversion_context & Context) common_draw_docx_convert(Context, common_draw_attlists_, &drawing); ///////// - if (bad_shape_ && drawing.fill.bitmap) // CV_Kucheruk_Maria(rus).odt - картинка по дебильному + if (bad_shape_ && drawing.fill.bitmap) // CV_Kucheruk_Maria(rus).odt - image done stupidly { drawing.sub_type = 1; bad_shape_ = false; } - if (drawing.fill.type < 1 && !IsExistProperty(drawing.additional, L"stroke"))//бывает что и не определено ничего + if (drawing.fill.type < 1 && !IsExistProperty(drawing.additional, L"stroke"))//sometimes nothing is defined { drawing.fill.solid = oox::oox_solid_fill::create(); drawing.fill.solid->color = L"729FCF"; @@ -1219,7 +1219,7 @@ void draw_image::docx_convert(oox::docx_conversion_context & Context) if (pos_replaicement != std::wstring::npos) { if (!Context.get_drawing_context().get_use_image_replace()) - return; //skip replacement image (math, chart, ...) - возможно записать как альтернативный контент - todooo ??? + return; //skip replacement image (math, chart, ...) - possibly write as alternative content - todooo ??? if (href.length() - (pos_replaicement + 18) < 2) return; //href="./ObjectReplacements/" } @@ -1247,8 +1247,8 @@ void draw_image::docx_convert(oox::docx_conversion_context & Context) //-------------------------------------------------- oox::hyperlinks::_ref hyperlink = Context.last_hyperlink(); - //нужно еще систему конроля - могут придте уже "использованные" линки с картинок - из колонтитулов (но на них уже использовали релсы) - //дыра осталась если картинка в картинке - линк продублируется с внутренней на внешнюю + //need a control system - already "used" image links may come - from headers/footers (but rels were already used for them) + //hole remains if image inside image - link will be duplicated from inner to outer if (hyperlink.drawing == true && hyperlink.used_rels == false) {//link from object @@ -1352,7 +1352,7 @@ void draw_text_box::docx_convert(oox::docx_conversion_context & Context) return; } //--------------------------------------------------------------------------------------------------------------- - //тут может быть не только текст , но и таблицы, другие объекты ... + //here there can be not only text, but also tables, other objects ... oox::StreamsManPtr prev = Context.get_stream_man(); std::wstringstream temp_stream(Context.get_drawing_context().get_text_stream_frame()); @@ -1476,7 +1476,7 @@ void draw_g::docx_convert(oox::docx_conversion_context & Context) return; } - if (object_index >= 0) //только в документах нельзя объект объединять с шейпами в группы ( + if (object_index >= 0) //only in documents you can't combine object with shapes in groups ( { draw_frame *frame = dynamic_cast<draw_frame*>(content_[object_index].get()); @@ -1793,7 +1793,7 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context) objectBuild.object_type_ = 0; } - if (objectBuild.object_type_ == 1) //диаграмма + if (objectBuild.object_type_ == 1) //chart { drawing->type = oox::typeChart; @@ -1804,7 +1804,7 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context) { //text in text not support } - else if (objectBuild.object_type_ == 3) //мат формулы + else if (objectBuild.object_type_ == 3) //math formulas { const std::wstring& content = Context.get_drawing_context().get_text_stream_frame(); @@ -1857,7 +1857,7 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context) } else { - //замещающая картинка(если она конечно присутствует) + //replacement image (if it's present of course) bool & use_image_replace = Context.get_drawing_context().get_use_image_replace(); use_image_replace = true; } diff --git a/OdfFile/Reader/Format/draw_frame_pptx.cpp b/OdfFile/Reader/Format/draw_frame_pptx.cpp index 130f5049e6..aba5a46051 100644 --- a/OdfFile/Reader/Format/draw_frame_pptx.cpp +++ b/OdfFile/Reader/Format/draw_frame_pptx.cpp @@ -153,7 +153,7 @@ void draw_frame::pptx_convert(oox::pptx_conversion_context & Context) if (baseStyleInst && ((!common_presentation_attlist_.presentation_user_transformed_) || ((common_presentation_attlist_.presentation_user_transformed_) && - (common_presentation_attlist_.presentation_user_transformed_->get() == false))))//векторная фигура презентаций + (common_presentation_attlist_.presentation_user_transformed_->get() == false))))//presentation vector shape { style_instance * defaultStyle = Context.root()->odf_context().styleContainer().style_default_by_type(odf_types::style_family::Presentation); if (defaultStyle) instances.push_back(defaultStyle); @@ -163,7 +163,7 @@ void draw_frame::pptx_convert(oox::pptx_conversion_context & Context) { instances.push_back(baseStyleInst); } - if (grStyleInst)//обычная векторная фигура + if (grStyleInst)//regular vector shape { style_instance * defaultStyle = Context.root()->odf_context().styleContainer().style_default_by_type(odf_types::style_family::Graphic); if (defaultStyle) instances.push_back(defaultStyle); @@ -364,7 +364,7 @@ void draw_image::pptx_convert(oox::pptx_conversion_context & Context) { Context.get_slide_context().set_text_box(); } -////////////////////////////////////в принципе достаточно общая часть ... +////////////////////////////////////basically a fairly common part ... Context.get_text_context().start_object(); for (size_t i = 0; i < content_.size(); i++) @@ -406,7 +406,7 @@ void draw_text_box::pptx_convert(oox::pptx_conversion_context & Context) return; } //--------------------------------------------------------------------------------------------------------------- - Context.get_slide_context().set_text_box(); //rect с наваротами + Context.get_slide_context().set_text_box(); //rect with extras Context.get_text_context().start_object(); for (size_t i = 0; i < content_.size(); i++) @@ -463,8 +463,8 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context) office_element *contentSubDoc = odf_document_ ? odf_document_->get_impl()->get_content() : NULL; if (!contentSubDoc) { - //здесь другой формат xml (не Open Office) - //временно - замещающая картинка(если она конечно присутствует) + //different xml format here (not Open Office) + //temporarily - replacement image (if it's present of course) return; } object_odf_context objectBuild(href); @@ -496,12 +496,12 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context) } } //--------------------------------------------------------------------------------------------------------------------- - if (objectBuild.object_type_ == 1)//диаграмма + if (objectBuild.object_type_ == 1)//chart { const std::wstring href_draw = xlink_attlist_.href_.get_value_or(L"Chart"); objectBuild.pptx_convert(Context); - Context.get_slide_context().set_chart(href_draw); // в рисовательной части только место объекта, рамочки ... и релсы + Context.get_slide_context().set_chart(href_draw); // in drawing part only object position, frames ... and rels } else if (objectBuild.object_type_ == 2)//odt text { @@ -561,7 +561,7 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context) } else { - //замещающая картинка(если она конечно присутствует) + //replacement image (if it's present of course) Context.get_slide_context().set_use_image_replacement(); } diff --git a/OdfFile/Reader/Format/draw_frame_xlsx.cpp b/OdfFile/Reader/Format/draw_frame_xlsx.cpp index 4f73aef629..7360a76f36 100644 --- a/OdfFile/Reader/Format/draw_frame_xlsx.cpp +++ b/OdfFile/Reader/Format/draw_frame_xlsx.cpp @@ -266,8 +266,8 @@ void draw_image::xlsx_convert(oox::xlsx_conversion_context & Context) Context.get_drawing_context().set_image(href); -////////////////////////////////////в принципе достаточно общая часть ... - Context.get_text_context()->start_drawing_content(); //... если в объекте есть текст он привяжется к объекту - иначе к ячейке +////////////////////////////////////basically a fairly common part... + Context.get_text_context()->start_drawing_content(); //...if the object contains text it will bind to the object - otherwise to the cell Context.start_drawing_context(); for (size_t i = 0 ; i < content_.size(); i++) @@ -369,8 +369,8 @@ void draw_object::xlsx_convert(oox::xlsx_conversion_context & Context) office_element *contentSubDoc = odf_document_ ? odf_document_->get_impl()->get_content() : NULL; if (!contentSubDoc) { - //здесь другой формат xml (не Open Office) - //временно - замещающая картинка(если она конечно присутствует) + //here is a different xml format (not Open Office) + //temporarily - placeholder image (if it exists of course) return; } object_odf_context objectBuild(href); @@ -378,14 +378,14 @@ void draw_object::xlsx_convert(oox::xlsx_conversion_context & Context) process_build_object process_build_object_(objectBuild, odf_document_.get()); contentSubDoc->accept(process_build_object_); //--------------------------------------------------------------------------------------------------------------------- - if (objectBuild.object_type_ == 1) //диаграмма + if (objectBuild.object_type_ == 1) //chart { const std::wstring href_draw = xlink_attlist_.href_.get_value_or(L"chart"); objectBuild.xlsx_convert(Context); - Context.get_drawing_context().set_chart(href_draw); // в рисовательной части только место объекта, рамочки ... и релсы + Context.get_drawing_context().set_chart(href_draw); // in drawing part only object position, frames ... and rels } - else if (objectBuild.object_type_ == 2) //текст (odt text) + else if (objectBuild.object_type_ == 2) //text (odt text) { Context.get_drawing_context().set_use_image_replacement(); @@ -398,7 +398,7 @@ void draw_object::xlsx_convert(oox::xlsx_conversion_context & Context) Context.get_drawing_context().set_ms_object(href, L"Word.Document"); } } - else if (objectBuild.object_type_ == 3) //мат формулы + else if (objectBuild.object_type_ == 3) //math formulas { bool bNewObject = false; if (bNewObject = Context.get_drawing_context().isDefault()) @@ -435,7 +435,7 @@ void draw_object::xlsx_convert(oox::xlsx_conversion_context & Context) } else { - //замещающая картинка(если она конечно присутствует) + //replacement image (if it's present of course) Context.get_drawing_context().set_use_image_replacement(); } diff --git a/OdfFile/Reader/Format/draw_page.cpp b/OdfFile/Reader/Format/draw_page.cpp index a64f906ec2..0b82f346e1 100644 --- a/OdfFile/Reader/Format/draw_page.cpp +++ b/OdfFile/Reader/Format/draw_page.cpp @@ -94,7 +94,7 @@ void draw_page::add_attributes( const xml::attributes_wc_ptr & Attributes ) void draw_page::pptx_convert_placeHolder(oox::pptx_conversion_context & Context, std::wstring styleName, presentation_class::type PresentationClass) { office_element_ptr elm = Context.root()->odf_context().drawStyles().find_by_style_name(styleName); - //todooo если это элемент datatime -нужно вытащить формат поля + //todooo if this is a datetime element - need to extract field format if (!elm) return; @@ -168,7 +168,7 @@ void draw_page::pptx_convert(oox::pptx_conversion_context & Context) bool is_page_visible = properties->content().presentation_visibility_.get_value_or(presentation_visibility::visible).get_type() == presentation_visibility::visible; Context.current_slide().set_show(is_page_visible); - //часть свойств переходов между слайдами тута + //part of slide transition properties here if (properties->content().presentation_transition_type_) { @@ -299,7 +299,7 @@ void presentation_notes::add_attributes( const xml::attributes_wc_ptr & Attribut void presentation_notes::pptx_convert_placeHolder(oox::pptx_conversion_context & Context, std::wstring styleName, presentation_class::type PresentationClass) { office_element_ptr elm = Context.root()->odf_context().drawStyles().find_by_style_name(styleName); - //todooo если это элемент datatime -нужно вытащить формат поля + //todooo if this is a datetime element - need to extract field format if (!elm)return; diff --git a/OdfFile/Reader/Format/draw_shapes.cpp b/OdfFile/Reader/Format/draw_shapes.cpp index 78bb69add1..b1bde73148 100644 --- a/OdfFile/Reader/Format/draw_shapes.cpp +++ b/OdfFile/Reader/Format/draw_shapes.cpp @@ -86,7 +86,7 @@ void draw_shape::add_child_element( xml::sax * Reader, const std::wstring & Ns, } void draw_shape::add_attributes( const xml::attributes_wc_ptr & Attributes ) { - CP_APPLY_ATTR(L"draw:id", draw_id_);//или сюда draw_shape_attlist_??? + CP_APPLY_ATTR(L"draw:id", draw_id_);// or here draw_shape_attlist_??? common_draw_attlists_.shape_with_text_and_styles_.add_attributes(Attributes); common_draw_attlists_.position_.add_attributes(Attributes); @@ -287,7 +287,7 @@ void draw_path::reset_svg_path() } if (false == o_Polyline_pt.empty()) { - //сформируем xml-oox сдесь ... а то придется плодить массивы в drawing .. хоть и не красиво.. + // form xml-oox here... otherwise will have to create arrays in drawing.. not pretty though.. std::wstringstream output_; ::svg_path::oox_serialize(output_, o_Polyline_pt); additional_.push_back(odf_reader::_property(L"custom_path",output_.str())); @@ -359,7 +359,7 @@ void draw_polygon::reset_polygon_path() } if (false == o_Polyline_pt.empty()) { - //сформируем xml-oox сдесь ... а то придется плодить массивы в drawing .. хоть и не красиво.. + // form xml-oox here... otherwise will have to create arrays in drawing.. not pretty though.. std::wstringstream output_; ::svg_path::oox_serialize(output_, o_Polyline_pt); additional_.push_back(odf_reader::_property(L"custom_path", output_.str())); @@ -411,7 +411,7 @@ void draw_polyline::reset_polyline_path() { if (poly.points[i].x) { - if (!start_x)//вообщето это не верно .. но из за разных точек осей поворота фигура может "улететь" + if (!start_x)// actually this is not correct.. but due to different rotation axis points the shape may "fly away" start_x = length(poly.points[i].x.get()/1000., length::cm).get_value_unit(length::emu); poly.points[i].x = length(poly.points[i].x.get()/1000., length::cm).get_value_unit(length::emu);// - *start_x; } @@ -426,7 +426,7 @@ void draw_polyline::reset_polyline_path() } if (false == o_Polyline_pt.empty()) { - //сформируем xml-oox сдесь ... а то придется плодить массивы в drawing .. хоть и не красиво.. + // form xml-oox here... otherwise will have to create arrays in drawing.. not pretty though.. std::wstringstream output_; ::svg_path::oox_serialize(output_, o_Polyline_pt); @@ -1038,7 +1038,7 @@ bool draw_enhanced_geometry::oox_convert(std::vector<odf_reader::_property>& pro if (!o_Polyline.empty() && res) { - //сформируем xml-oox сдесь ... а то придется плодить массивы в drawing .. хоть и не красиво.. + // form xml-oox here... otherwise will have to create arrays in drawing.. not pretty though.. std::wstringstream output_; ::svg_path::oox_serialize(output_, o_Polyline); @@ -1108,7 +1108,7 @@ void draw_connector::add_attributes( const xml::attributes_wc_ptr & Attributes ) draw_line_attlist_.add_attributes(Attributes); draw_shape::add_attributes(Attributes); - sub_type_ = 10; //коннектор - линия, если ломаная (ниже определяется) - то путь + sub_type_ = 10; // connector - line, if polyline (determined below) - then path lined_shape_ = true; connector_ = true; } @@ -1149,7 +1149,7 @@ void draw_connector::reset_svg_path() if (o_Polyline_pt.size() > 0) { sub_type_ = 6; - //сформируем xml-oox сдесь ... а то придется плодить массивы в drawing .. хоть и не красиво.. + // form xml-oox here... otherwise will have to create arrays in drawing.. not pretty though.. std::wstringstream output_; ::svg_path::oox_serialize(output_, o_Polyline_pt); additional_.push_back(odf_reader::_property(L"custom_path",output_.str())); diff --git a/OdfFile/Reader/Format/draw_shapes.h b/OdfFile/Reader/Format/draw_shapes.h index b5123deb96..91814338d0 100644 --- a/OdfFile/Reader/Format/draw_shapes.h +++ b/OdfFile/Reader/Format/draw_shapes.h @@ -81,7 +81,7 @@ public: draw_shape_attlist draw_shape_attlist_; odf_types::common_xlink_attlist xlink_attlist_; - _CP_OPT(std::wstring) draw_id_; //используется для анимашек + _CP_OPT(std::wstring) draw_id_; // used for animations office_element_ptr_array content_; office_element_ptr enhanced_geometry_; @@ -281,7 +281,7 @@ public: draw_polygon_attlist draw_polygon_attlist_; - void reset_polygon_path();//частный случай svg - все точки соединены прямыми + void reset_polygon_path();// special case of svg - all points are connected by straight lines }; CP_REGISTER_OFFICE_ELEMENT2(draw_polygon); @@ -338,7 +338,7 @@ public: draw_polyline_attlist draw_polyline_attlist_; - void reset_polyline_path();//частный случай svg - все точки соединены прямыми + void reset_polyline_path();// special case of svg - all points are connected by straight lines }; CP_REGISTER_OFFICE_ELEMENT2(draw_polyline); @@ -372,7 +372,7 @@ CP_REGISTER_OFFICE_ELEMENT2(draw_custom_shape); //draw:enhanced-geometry ////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////// -class draw_equation_attlist//убрать стринги ... сделать парсинг см стр 378 оазис !!!!!!!!!!! +class draw_equation_attlist// remove strings... implement parsing see page 378 oasis !!!!!!!!!!! { public: virtual void add_attributes( const xml::attributes_wc_ptr & Attributes ); @@ -405,7 +405,7 @@ CP_REGISTER_OFFICE_ELEMENT2(draw_equation); // int max; //}; ////////////////////////////////////////////////////// -class draw_handle_attlist//убрать стринги ... сделать парсинг см стр 378 оазис !!!!!!!!!!! +class draw_handle_attlist// remove strings... implement parsing see page 378 oasis !!!!!!!!!!! { public: virtual void add_attributes( const xml::attributes_wc_ptr & Attributes ); diff --git a/OdfFile/Reader/Format/draw_shapes_docx.cpp b/OdfFile/Reader/Format/draw_shapes_docx.cpp index 3fe7e7658c..faa05a1ff4 100644 --- a/OdfFile/Reader/Format/draw_shapes_docx.cpp +++ b/OdfFile/Reader/Format/draw_shapes_docx.cpp @@ -72,12 +72,12 @@ void draw_shape::common_docx_convert(oox::docx_conversion_context & Context) Context.get_drawing_context().add_name_object(name.get_value_or(L"Shape")); -//---------------------------сначала элементы графики потом все остальное +//---------------------------first graphics elements then everything else if (enhanced_geometry_) enhanced_geometry_->docx_convert(Context); -//---------------------------на другом контексте - //тут может быть не только текст , но и таблицы, другие объекты ... +//---------------------------on another context + //here can be not only text, but also tables, other objects... oox::StreamsManPtr prev = Context.get_stream_man(); std::wstringstream temp_stream(Context.get_drawing_context().get_text_stream_shape()); diff --git a/OdfFile/Reader/Format/draw_shapes_pptx.cpp b/OdfFile/Reader/Format/draw_shapes_pptx.cpp index 59829e1797..da2cf95006 100644 --- a/OdfFile/Reader/Format/draw_shapes_pptx.cpp +++ b/OdfFile/Reader/Format/draw_shapes_pptx.cpp @@ -118,14 +118,14 @@ void draw_shape::common_pptx_convert(oox::pptx_conversion_context & Context) odf_reader::style_instance* baseStyleInst = Context.root()->odf_context().styleContainer().style_by_name(presentationStyleName, odf_types::style_family::Presentation,Context.process_masters_); - if (baseStyleInst)//векторная фигура презентаций + if (baseStyleInst)// presentation vector shape { style_instance * defaultStyle = Context.root()->odf_context().styleContainer().style_default_by_type(odf_types::style_family::Presentation); if (defaultStyle)instances.push_back(defaultStyle); instances.push_back(baseStyleInst); } - else if (grStyleInst)//обычная векторная фигура + else if (grStyleInst)// regular vector shape { style_instance * defaultStyle = Context.root()->odf_context().styleContainer().style_default_by_type(odf_types::style_family::Graphic); if (defaultStyle)instances.push_back(defaultStyle); @@ -286,7 +286,7 @@ void draw_caption::pptx_convert(oox::pptx_conversion_context & Context) { //const std::wstring style = common_shape_draw_attlist_.draw_text_style_name_.get_value_or(L""); - Context.get_slide_context().start_shape(sub_type_);//rect с наваротами-атрибутами .. а-ля TextBox + Context.get_slide_context().start_shape(sub_type_);// rect with fancy attributes.. like TextBox common_pptx_convert(Context); @@ -391,7 +391,7 @@ void draw_connector::pptx_convert(oox::pptx_conversion_context & Context) Context.get_slide_context().set_connector_draw_type(pptx_prst); -//перебъем заливку .. +// override fill.. oox::_oox_fill fill; fill.type = 0; Context.get_slide_context().set_fill(fill); diff --git a/OdfFile/Reader/Format/draw_shapes_xlsx.cpp b/OdfFile/Reader/Format/draw_shapes_xlsx.cpp index 367b07a605..a5d1e825f1 100644 --- a/OdfFile/Reader/Format/draw_shapes_xlsx.cpp +++ b/OdfFile/Reader/Format/draw_shapes_xlsx.cpp @@ -265,7 +265,7 @@ void draw_caption::xlsx_convert(oox::xlsx_conversion_context & Context) { //const std::wstring style = common_shape_draw_attlist_.draw_text_style_name_.get_value_or(L""); - Context.get_drawing_context().start_shape(1);//rect с наваротами-атрибутами .. а-ля TextBox + Context.get_drawing_context().start_shape(1);//rect with fancy attributes .. like TextBox common_xlsx_convert(Context); @@ -279,7 +279,7 @@ void dr3d_scene::xlsx_convert(oox::xlsx_conversion_context & Context) { //const std::wstring style = common_shape_draw_attlist_.draw_text_style_name_.get_value_or(L""); - Context.get_drawing_context().start_shape(1);//rect с наваротами-атрибутами .. а-ля TextBox + Context.get_drawing_context().start_shape(1);//rect with fancy attributes .. like TextBox common_xlsx_convert(Context); diff --git a/OdfFile/Reader/Format/list.cpp b/OdfFile/Reader/Format/list.cpp index 45873d0b74..ef8a365a14 100644 --- a/OdfFile/Reader/Format/list.cpp +++ b/OdfFile/Reader/Format/list.cpp @@ -91,7 +91,7 @@ void list_item::add_child_element( xml::sax * Reader, const std::wstring & Ns, c void list_item::docx_convert(oox::docx_conversion_context & Context) { bool restart = false; - // TODO - надо сделать так чтобы не только с 1 + // TODO - need to make it work not only from 1 if (text_start_value_) { restart = true; @@ -110,7 +110,7 @@ void list_item::docx_convert(oox::docx_conversion_context & Context) void list_item::pptx_convert(oox::pptx_conversion_context & Context) { bool restart = false; - // TODO - надо сделать так чтобы не только с 1 + // TODO - need to make it work not only from 1 if (text_start_value_) { restart = true; @@ -133,7 +133,7 @@ const wchar_t * list_header::name = L"list-header"; void list_header::docx_convert(oox::docx_conversion_context & Context) { - //заголовок это не элемент списка + //header is not a list item std::wstring s = Context.current_list_style(); Context.end_list(); @@ -149,7 +149,7 @@ void list_header::pptx_convert(oox::pptx_conversion_context & Context) { bool restart = false; - //заголовок это не элемент списка + //header is not a list item Context.get_text_context().set_header(true); diff --git a/OdfFile/Reader/Format/math_token_elements.cpp b/OdfFile/Reader/Format/math_token_elements.cpp index 60dad923ac..5fe603fc6f 100644 --- a/OdfFile/Reader/Format/math_token_elements.cpp +++ b/OdfFile/Reader/Format/math_token_elements.cpp @@ -158,7 +158,7 @@ void math_mo::oox_convert(oox::math_context & Context) { CP_XML_NODE(L"m:r") { - // + доп стили текста ... todoooo + // + additional text styles ... todoooo Context.text_properties_->content_.oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_); @@ -199,7 +199,7 @@ void math_mn::oox_convert(oox::math_context & Context) { CP_XML_NODE(L"m:r") { - // + доп стили текста ... todoooo + // + additional text styles ... todoooo Context.text_properties_->content_.oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_); diff --git a/OdfFile/Reader/Format/note.cpp b/OdfFile/Reader/Format/note.cpp index c57ae3aee3..4f4c3e5d4b 100644 --- a/OdfFile/Reader/Format/note.cpp +++ b/OdfFile/Reader/Format/note.cpp @@ -128,7 +128,7 @@ void note_body::docx_convert(oox::docx_conversion_context & Context) Context.set_process_headers_footers(true); Context.reset_context_state(); - //Context.start_comment_content(); // чтоб ins/del не отрабатывало + //Context.start_comment_content(); // so that ins/del doesn't work for (size_t i = 0; i < content_.size(); i++) { content_[i]->docx_convert(Context); diff --git a/OdfFile/Reader/Format/odf_document_impl.cpp b/OdfFile/Reader/Format/odf_document_impl.cpp index 45711aa6f1..d3b14c5c60 100644 --- a/OdfFile/Reader/Format/odf_document_impl.cpp +++ b/OdfFile/Reader/Format/odf_document_impl.cpp @@ -823,8 +823,8 @@ void odf_document::Impl::parse_styles(office_element *element) } } - // parse automatic styles - эти стили используют объекты которые в оазис находятся в этом же документе - //переопределяем имя - иначе при поиске может возникнуть коллизия. + // parse automatic styles - these styles are used by objects that in OASIS are located in the same document + //redefine the name - otherwise a collision may occur during search. do { office_automatic_styles * automaticStyles = dynamic_cast<office_automatic_styles *>( document->office_automatic_styles_.get() ); @@ -1233,9 +1233,9 @@ bool odf_document::Impl::docx_convert(oox::docx_conversion_context & Context) Context.end_document(); - // мы обрабатываем стили списка после того как сконвертировали документ, - // так как в процессе конвертации документа у нас могу добавиться стили — - // в случае если используется text:start-value (начинаем нумерацию заново) + // we process list styles after we have converted the document, + // because during document conversion styles may be added — + // in case text:start-value is used (restart numbering) Context.process_list_styles(); Context.add_jsaProject(jsaProject_bin_); diff --git a/OdfFile/Reader/Format/odfcontext.cpp b/OdfFile/Reader/Format/odfcontext.cpp index d087c701af..7737db7038 100644 --- a/OdfFile/Reader/Format/odfcontext.cpp +++ b/OdfFile/Reader/Format/odfcontext.cpp @@ -123,7 +123,7 @@ namespace cpdoccore { if (Name == ParentStyleName) { - ParentStyleName = L"";//иначе в коде возможно зацикливание. + ParentStyleName = L"";//otherwise an infinite loop is possible in code. } style_instance_ptr newStyle = style_instance_ptr(new style_instance(this, Name, DisplayName, Type, Content, IsAutomatic, IsDefault, ParentStyleName, NextStyleName, DataStyleName, PercentageDataStyleName, StyleClass, ListStyleName, ListLevel, OutlineLevel)); @@ -136,7 +136,7 @@ namespace cpdoccore { std::wstring n = Name + L":" + boost::lexical_cast<std::wstring>(style_family(Type)); map_[n] = pos; - // TODO: как правильно?? + // TODO: what's the correct way?? std::wstring lName = XmlUtils::GetLower(Name); //if ( boost::algorithm::contains(lName, L"internet_20_link") ) if (lName == L"internet_20_link")///??????????????? diff --git a/OdfFile/Reader/Format/odfcontext.h b/OdfFile/Reader/Format/odfcontext.h index b8d0e4a231..c91922d0be 100644 --- a/OdfFile/Reader/Format/odfcontext.h +++ b/OdfFile/Reader/Format/odfcontext.h @@ -369,7 +369,7 @@ public: text_outline_style * outline_style(); int id_outline(); - /// получить Id, которое будет использоваться в numId и abstractNumId + /// get Id that will be used in numId and abstractNumId int id_by_name(const std::wstring & Name); instances_array & instances() { return instances_; } @@ -379,7 +379,7 @@ public: void add_outline_style(text_outline_style *textOutlineStyle); private: - // ассоциации имени стиля и порядкового номера в массиве instances_ + // associations of style name and ordinal number in instances_ array boost::unordered_map<std::wstring, int> list_style_names_; instances_array instances_; diff --git a/OdfFile/Reader/Format/office_annotation.cpp b/OdfFile/Reader/Format/office_annotation.cpp index 06029b5fa7..042a944adb 100644 --- a/OdfFile/Reader/Format/office_annotation.cpp +++ b/OdfFile/Reader/Format/office_annotation.cpp @@ -187,7 +187,7 @@ void office_annotation::xlsx_convert(oox::xlsx_conversion_context & Context) Context.start_text_context(); Context.get_text_context()->start_comment_content(); - for (size_t i = 0; i < content_.size(); i++)//текст + текстовый стиль + for (size_t i = 0; i < content_.size(); i++)//text + text style { content_[i]->xlsx_convert(Context); } @@ -298,7 +298,7 @@ void officeooo_annotation::pptx_convert(oox::pptx_conversion_context & Context) Context.get_comments_context().start_comment(x, y, id_idx.first, id_idx.second);//author & idx (uniq number for author Context.get_text_context().start_comment_content(); - for (size_t i = 0; i < content_.size(); i++)//текст + текстовый стиль + for (size_t i = 0; i < content_.size(); i++)//text + text style { content_[i]->pptx_convert(Context); } @@ -307,7 +307,7 @@ void officeooo_annotation::pptx_convert(oox::pptx_conversion_context & Context) Context.get_comments_context().add_content(Context.get_text_context().end_comment_content()); ////////////////////////////////////////////////////////////////// - /// Обрабатываем стиль draw + /// Process draw style std::vector<const odf_reader::style_instance *> instances; style_instance* styleInst = Context.root()->odf_context().styleContainer().style_by_name( attr_.draw_style_name_.get_value_or(L""), odf_types::style_family::Graphic,false/*Context.process_headers_footers_*/); diff --git a/OdfFile/Reader/Format/office_body.cpp b/OdfFile/Reader/Format/office_body.cpp index da84fd915a..4f8d508a00 100644 --- a/OdfFile/Reader/Format/office_body.cpp +++ b/OdfFile/Reader/Format/office_body.cpp @@ -120,7 +120,7 @@ void office_body::docx_convert(oox::docx_conversion_context & Context) const page_layout_instance * layout = Context.root()->odf_context().pageLayoutContainer().page_layout_first(); - if (layout) //два раза - чтобы дефолтовые настройки всегда были + if (layout) // twice - so that default settings are always present { //Context.add_page_properties(layout->name()); Context.add_page_properties(layout->name()); diff --git a/OdfFile/Reader/Format/office_elements_create.cpp b/OdfFile/Reader/Format/office_elements_create.cpp index 2959260453..a09937b6b4 100644 --- a/OdfFile/Reader/Format/office_elements_create.cpp +++ b/OdfFile/Reader/Format/office_elements_create.cpp @@ -95,7 +95,7 @@ bool office_element_creator::register_element(const std::wstring &ns, const std: } else { - // TODO: элемент уже есть, непонятно что делать + // TODO: element already exists, unclear what to do i->second = f; } return true; diff --git a/OdfFile/Reader/Format/office_elements_create.h b/OdfFile/Reader/Format/office_elements_create.h index 0242f85954..c40c687ca4 100644 --- a/OdfFile/Reader/Format/office_elements_create.h +++ b/OdfFile/Reader/Format/office_elements_create.h @@ -66,10 +66,10 @@ public: typedef boost::function< office_element_ptr () > CreateFuncImpl; public: - // Зарегестрировать элемент + // Register element bool register_element(const std::wstring &ns, const std::wstring & name, CreateFuncImpl f); - // Создать элемент по имени + // Create element by name office_element_ptr create(const std::wstring & ns, const std::wstring & name, document_context * Context = NULL, bool isRoot = false) const; private: @@ -77,7 +77,7 @@ private: MapType map_; public: - // Обеспечение синглтона + // Singleton implementation static office_element_creator * get(); private: @@ -85,7 +85,7 @@ private: static office_element_creator * instance_; }; -/// Класс, обеспечивающий регистрацию элементов +/// Class that handles element registration template <class T> class RegisterElement { @@ -131,7 +131,7 @@ template<class T> int RegisterElement<T>::class_registered_ = 0; //with namespa template<class T> int RegisterElement<T>::class_registered_1_ = 0; //without namespace -// Создать элемент и в случае успеха прочитать его содержимое из SAX, поместить в shared_ptr +// Create element and if successful read its content from SAX, put in shared_ptr bool create_element_and_read(xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name, @@ -139,7 +139,7 @@ bool create_element_and_read(xml::sax * Reader, document_context * Context, bool isRoot = false); -// Создать элемент и в случае успеха прочитать его содержимое из SAX, поместить в array +// Create element and if successful read its content from SAX, put in array bool create_element_and_read(xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name, diff --git a/OdfFile/Reader/Format/office_text.cpp b/OdfFile/Reader/Format/office_text.cpp index ae391df630..e5d5334c18 100644 --- a/OdfFile/Reader/Format/office_text.cpp +++ b/OdfFile/Reader/Format/office_text.cpp @@ -243,10 +243,10 @@ void office_text::docx_convert(oox::docx_conversion_context & Context) if (content_[i]->next_element_style_name) { std::wstring text___ = *content_[i]->next_element_style_name; - // проверяем не сменится ли свойства страницы. - // если да — устанавливаем контексту флаг на то что необходимо в текущем параграфе - // распечатать свойства раздела/секции - //проверить ... не она ли текущая - может быть прописан дубляж - и тогда разрыв нарисуется ненужный + // check if page properties will change. + // if yes — set context flag that it's necessary in current paragraph + // to print section properties + //check... is it the current one - may have duplicate - then unnecessary break will appear const _CP_OPT(std::wstring) next_masterPageName = Context.root()->odf_context().styleContainer().master_page_name_by_name(*content_[i]->next_element_style_name); if ((next_masterPageName) && (Context.get_master_page_name() != *next_masterPageName)) diff --git a/OdfFile/Reader/Format/paragraph_elements.cpp b/OdfFile/Reader/Format/paragraph_elements.cpp index bf00339345..a9e64b2266 100644 --- a/OdfFile/Reader/Format/paragraph_elements.cpp +++ b/OdfFile/Reader/Format/paragraph_elements.cpp @@ -206,11 +206,11 @@ void text::docx_convert(oox::docx_conversion_context & Context) { if (Context.get_process_note() != oox::docx_conversion_context::noNote && Context.get_delete_text_state()) - return; //в ms нет рецензирования notes + return; //MS doesn't have notes revision tracking bool add_del_run = false; if (Context.get_drawing_state_content() && Context.get_delete_text_state()) - { //0503IG-AddingFormattingText.odt - удаленый текст в удаленом объекте + { //0503IG-AddingFormattingText.odt - deleted text in deleted object oox::text_tracked_context::_state &state = Context.get_text_tracked_context().get_tracked_change(L""); if (state.type == 2) @@ -763,7 +763,7 @@ void a::docx_convert(oox::docx_conversion_context & Context) if (Context.is_table_content() || office_target_frame_name_ || ref[0] == L'#') { size_t pos_outline = ref.find(L"|outline"); - if (std::wstring::npos != pos_outline)//без # + if (std::wstring::npos != pos_outline)//without # { std::wstringstream strm; text_to_stream(strm, false); @@ -973,7 +973,7 @@ void note::add_child_element( xml::sax * Reader, const std::wstring & Ns, const } void note::pptx_convert(oox::pptx_conversion_context & Context) { - //см presentation:notes + //see presentation:notes } void note::docx_convert(oox::docx_conversion_context & Context) { @@ -1302,7 +1302,7 @@ void text_page_count::xlsx_serialize(std::wostream & _Wostream, oox::xlsx_conver } void text_page_count::pptx_convert(oox::pptx_conversion_context & Context) { - //поскольку такого поля в ms нет - конвертим как обычный текст + //since this field doesn't exist in MS - convert as plain text if (text_) { text_->pptx_convert(Context); diff --git a/OdfFile/Reader/Format/search_table_cell.cpp b/OdfFile/Reader/Format/search_table_cell.cpp index 9fe2fa17e1..b8c4f210bc 100644 --- a/OdfFile/Reader/Format/search_table_cell.cpp +++ b/OdfFile/Reader/Format/search_table_cell.cpp @@ -68,7 +68,7 @@ typedef shared_ptr<const office_element>::Type office_element_ptr_const; if (elm) \ elm->accept(*this); \ } -// обход таблицы +// table traversal class table_round : public base_visitor, public const_visitor<office_body>, public const_visitor<office_spreadsheet>, diff --git a/OdfFile/Reader/Format/style_chart_properties.cpp b/OdfFile/Reader/Format/style_chart_properties.cpp index 1a495beb2e..244dede181 100644 --- a/OdfFile/Reader/Format/style_chart_properties.cpp +++ b/OdfFile/Reader/Format/style_chart_properties.cpp @@ -64,7 +64,7 @@ void chart_format_properties::apply_from(const chart_format_properties & Other) } void chart_format_properties::add_attributes( const xml::attributes_wc_ptr & Attributes ) { - _CP_OPT(bool) bVal;//потом можно и это разделение убрать - заменить вариант + _CP_OPT(bool) bVal;// later can remove this separation - replace variant CP_APPLY_ATTR(L"chart:scale-text", bVal); if (bVal) push_back(_property(L"scale-text", bVal.get())); CP_APPLY_ATTR(L"chart:three-dimensional", bVal); if (bVal) push_back(_property(L"three-dimensional", bVal.get())); diff --git a/OdfFile/Reader/Format/style_chart_properties.h b/OdfFile/Reader/Format/style_chart_properties.h index 2ae6fba9de..759a147b9b 100644 --- a/OdfFile/Reader/Format/style_chart_properties.h +++ b/OdfFile/Reader/Format/style_chart_properties.h @@ -66,7 +66,7 @@ namespace odf_reader { return prop ? GetProperty<T>(*prop, Name, Val) : false; } // style:chart-properties -class style_chart_properties : public office_element_impl<style_chart_properties>//стили чарта не наследуются +class style_chart_properties : public office_element_impl<style_chart_properties>//chart styles are not inherited { public: static const wchar_t * ns; diff --git a/OdfFile/Reader/Format/style_graphic_properties.cpp b/OdfFile/Reader/Format/style_graphic_properties.cpp index a463ce8e61..6f6076297a 100644 --- a/OdfFile/Reader/Format/style_graphic_properties.cpp +++ b/OdfFile/Reader/Format/style_graphic_properties.cpp @@ -283,7 +283,7 @@ void style_graphic_properties::add_child_element( xml::sax * Reader, const std:: CP_CREATE_ELEMENT(content_.style_columns_); //if (CP_CHECK_NAME(L"text", L"list-style") - // styles_.add_child_element(Reader, Ns, Name, getContext()); он тут и не нужен по сути... описание есть и в другом сместе + // styles_.add_child_element(Reader, Ns, Name, getContext()); it's not needed here actually... description exists elsewhere } ////////////////////////////////////////////////////////////////////////////////////////////////// const wchar_t * loext_graphic_properties::ns = L"loext"; @@ -302,7 +302,7 @@ void loext_graphic_properties::add_child_element( xml::sax * Reader, const std:: } //if (CP_CHECK_NAME(L"text", L"list-style") - // styles_.add_child_element(Reader, Ns, Name, getContext()); он тут и не нужен по сути... описание есть и в другом сместе + // styles_.add_child_element(Reader, Ns, Name, getContext()); it's not needed here actually... description exists elsewhere } } } diff --git a/OdfFile/Reader/Format/style_paragraph_properties_docx.cpp b/OdfFile/Reader/Format/style_paragraph_properties_docx.cpp index 23dfcabf1b..62f35952f9 100644 --- a/OdfFile/Reader/Format/style_paragraph_properties_docx.cpp +++ b/OdfFile/Reader/Format/style_paragraph_properties_docx.cpp @@ -158,7 +158,7 @@ void paragraph_format_properties::docx_convert(oox::docx_conversion_context & Co Context.set_rtl(false); } } - if (Context.get_rtl()) //может быть он установился от стиля родителя !! + if (Context.get_rtl()) //it may have been set from parent style !! { _pPr << L"<w:bidi/>"; } @@ -372,8 +372,8 @@ void paragraph_format_properties::docx_convert(oox::docx_conversion_context & Co w_after = docx_process_margin(fo_margin_bottom_, 20.0); w_before = docx_process_margin(fo_margin_top_, 20.0); - // TODO : здесь 240 берется из корневого стиля? надо не константу использовать а брать оттуда - // в xsl преобразованиях так же написано + // TODO : here 240 is taken from root style? should not use constant but take from there + // in xsl transformations it's written the same way if (fo_line_height_) { if (fo_line_height_->get_type() == line_width::Percent) @@ -416,7 +416,7 @@ void paragraph_format_properties::docx_convert(oox::docx_conversion_context & Co } } _CP_OPT(odf_types::length_or_percent) curr_margin_left_ = fo_margin_left_; - if (curr_margin_left_ || //? + буквица + if (curr_margin_left_ || //? + drop cap fo_margin_right_ || (fo_text_indent_ && Context.get_drop_cap_context().state() != 1)) { @@ -456,7 +456,7 @@ void paragraph_format_properties::docx_convert(oox::docx_conversion_context & Co CP_XML_ATTR(L"w:start", w_left); CP_XML_ATTR(L"w:end", w_right); - if (Context.get_drop_cap_context().state() != 1 )//состояние сразу после добавления буквицы - не нужны ни отступы, ни висячие + if (Context.get_drop_cap_context().state() != 1 )//state right after adding drop cap - no indents or hanging needed { if (!w_hanging.empty()) CP_XML_ATTR(L"w:hanging", w_hanging); @@ -533,7 +533,7 @@ void style_tab_stop::docx_convert(oox::docx_conversion_context & Context, bool c _pPr << L"<w:tab"; - length def_tab = length(1.0, length::cm);// в ms значение 0.8 не корректно оО + length def_tab = length(1.0, length::cm);// in MS value 0.8 is not correct o_O double tab_pos_offset = (!Context.get_paragraph_state() || Context.is_table_content()) ? margin_left : 0; diff --git a/OdfFile/Reader/Format/style_paragraph_properties_pptx.cpp b/OdfFile/Reader/Format/style_paragraph_properties_pptx.cpp index 19da4906d1..dcbd174945 100644 --- a/OdfFile/Reader/Format/style_paragraph_properties_pptx.cpp +++ b/OdfFile/Reader/Format/style_paragraph_properties_pptx.cpp @@ -274,7 +274,7 @@ void paragraph_format_properties::xlsx_convert(std::wostream & strm, bool in_dra void paragraph_format_properties::pptx_convert(oox::pptx_conversion_context & Context) { std::wstringstream & _pPr = Context.get_text_context().get_styles_context().paragraph_attr(); - //сначала аттрибуты к самому pPr или defPPr + //first attributes to pPr or defPPr itself if (fo_margin_left_ || fo_margin_right_ || fo_text_indent_ ) { // TODO auto indent @@ -370,7 +370,7 @@ void paragraph_format_properties::pptx_convert(oox::pptx_conversion_context & Co // } //} //////////////////////////////////////////////////////////////////////// - //теперь nodes к pPr или defPPr + //now nodes to pPr or defPPr CP_XML_WRITER(Context.get_text_context().get_styles_context().paragraph_nodes()) { //if (fo_keep_with_next_) //&& Context.get_drop_cap_context().state() != 2 diff --git a/OdfFile/Reader/Format/style_presentation.cpp b/OdfFile/Reader/Format/style_presentation.cpp index a11f5fecc4..54c48d1e67 100644 --- a/OdfFile/Reader/Format/style_presentation.cpp +++ b/OdfFile/Reader/Format/style_presentation.cpp @@ -70,7 +70,7 @@ namespace cpdoccore { double cx = svg_width_.get_value_or(length(0)).get_value_unit(length::pt); double cy = svg_height_.get_value_or(length(0)).get_value_unit(length::pt); - //пока не понятно что значит отрицательная ширина ... + //not yet clear what negative width means ... cx = fabs(cx); cy = fabs(cy); diff --git a/OdfFile/Reader/Format/style_presentation.h b/OdfFile/Reader/Format/style_presentation.h index 0978abe2d7..c71ebe12f4 100644 --- a/OdfFile/Reader/Format/style_presentation.h +++ b/OdfFile/Reader/Format/style_presentation.h @@ -110,8 +110,8 @@ public: _CP_OPT(std::wstring) draw_background_size_; //"border" or "full" - _CP_OPT(std::wstring) presentation_transition_type_; //manual, automatic, semi-automatic (переход отделен от эффектов кликом) - _CP_OPT(std::wstring) presentation_transition_style_; //none, fade, move, uncover,clockwise, .... игнор если smil + _CP_OPT(std::wstring) presentation_transition_type_; //manual, automatic, semi-automatic (transition separated from effects by click) + _CP_OPT(std::wstring) presentation_transition_style_; //none, fade, move, uncover,clockwise, .... ignore if smil _CP_OPT(std::wstring) presentation_transition_speed_; //slow, medium, fast _CP_OPT(bool) presentation_display_footer_; diff --git a/OdfFile/Reader/Format/style_text_properties.cpp b/OdfFile/Reader/Format/style_text_properties.cpp index 797842b5fe..da13a06c3e 100644 --- a/OdfFile/Reader/Format/style_text_properties.cpp +++ b/OdfFile/Reader/Format/style_text_properties.cpp @@ -291,7 +291,7 @@ void text_format_properties::pptx_convert_as_list(oox::pptx_conversion_context & if (font) w_font = font->name(); - //'Arial' глючит + //'Arial' has issues removeCharsFromString(w_font, L"'"); } @@ -490,7 +490,7 @@ void text_format_properties::drawing_serialize(std::wostream & strm, std::wstrin //nodes if (fo_color_) { - std::wstring strRGB = fo_color_->get_hex_value(); //auto ... не нужно + std::wstring strRGB = fo_color_->get_hex_value(); //auto... not needed if (!strRGB.empty()) { CP_XML_NODE(L"a:solidFill") @@ -542,7 +542,7 @@ void text_format_properties::drawing_serialize(std::wostream & strm, std::wstrin } if ((fo_background_color_) && (fo_background_color_->get_type() == odf_types::background_color::Enabled )) { - std::wstring strRGB = fo_background_color_->get_color().get_hex_value(); //auto ... не нужно + std::wstring strRGB = fo_background_color_->get_color().get_hex_value(); //auto... not needed if (!strRGB.empty()) { CP_XML_NODE(L"a:highlight") @@ -632,7 +632,7 @@ void text_format_properties::xlsx_serialize(std::wostream & strm, oox::xlsx_conv } } void text_format_properties::docx_serialize(std::wostream & _rPr, fonts_container & fonts) -{//упрощенный вариант +{//simplified version _rPr << L"<w:rPr>"; const int W = process_font_weight (fo_font_weight_); @@ -716,7 +716,7 @@ void text_format_properties::docx_serialize(std::wostream & _rPr, fonts_containe if ((style_text_underline_type_ && style_text_underline_type_->get_type() == line_type::None) || (style_text_underline_style_ && style_text_underline_style_->get_type() == line_style::None)) { - // подчеркивание выключено + // underline is disabled underline = L"none"; } else if (style_text_underline_type_ && @@ -1051,7 +1051,7 @@ void text_format_properties::pptx_convert(oox::pptx_conversion_context & Context } void text_format_properties::docx_convert(oox::docx_conversion_context & Context) -{//расширенный вариант +{//extended version std::wostream & _pPr = Context.get_styles_context().paragraph_nodes(); // to paragraph properties @@ -1161,7 +1161,7 @@ void text_format_properties::docx_convert(oox::docx_conversion_context & Context if (( style_text_underline_type_ && style_text_underline_type_->get_type() == line_type::None) || (style_text_underline_style_ && style_text_underline_style_->get_type() == line_style::None)) { - // подчеркивание выключено + // underline is disabled underline = L"none"; } else if (style_text_underline_type_ && @@ -1270,7 +1270,7 @@ void text_format_properties::docx_convert(oox::docx_conversion_context & Context // 17.3.2.42 //if (Context.get_drop_cap_context().state() == 2) //{ - // _rPr << L"<w:position w:val=\"-" << (2+Context.get_drop_cap_context().Scale*2-3)*2 << "\"/> ";//формула ачуметь !! - подбор вручную + // _rPr << L"<w:position w:val=\"-" << (2+Context.get_drop_cap_context().Scale*2-3)*2 << "\"/> ";//crazy formula!! - manual adjustment //} //else if (style_text_position_) @@ -1346,7 +1346,7 @@ void text_format_properties::docx_convert(oox::docx_conversion_context & Context if (Context.get_drop_cap_context().state()==2) { fontSize = process_font_size(fo_font_size_, Context.get_styles_context().get_current_processed_style(),false, - Context.get_drop_cap_context().Scale + (Context.get_drop_cap_context().Scale-1) * 0.7);//вместо 1 ДОЛЖНОБЫТЬ коэфф. межстрочного интервала!!! + Context.get_drop_cap_context().Scale + (Context.get_drop_cap_context().Scale-1) * 0.7);//instead of 1 SHOULD BE line spacing coefficient!!! if (fontSize < 1) fontSize = (int)(Context.get_drop_cap_context().FontSize / 10.0); } @@ -1484,7 +1484,7 @@ void text_format_properties::docx_convert(oox::docx_conversion_context & Context odf_reader::draw_shape *shape = Context.get_drawing_context().get_current_shape(); if (shape->word_art_) - {//взять из графических ствойст цвет текста .. + {//get text color from graphic properties.. const std::wstring styleName = shape->common_draw_attlists_.shape_with_text_and_styles_. common_shape_draw_attlist_.draw_style_name_.get_value_or(L""); diff --git a/OdfFile/Reader/Format/styles.cpp b/OdfFile/Reader/Format/styles.cpp index 7eb213e61e..ba8ef21e7f 100644 --- a/OdfFile/Reader/Format/styles.cpp +++ b/OdfFile/Reader/Format/styles.cpp @@ -1430,7 +1430,7 @@ bool style_page_layout_properties::docx_background_serialize(std::wostream & str if (attlist_.common_background_color_attlist_.fo_background_color_ && attlist_.common_background_color_attlist_.fo_background_color_->get_type() == background_color::Transparent) return true; //?? - //прозрачный фон + //transparent background CP_XML_WRITER(strm) { @@ -1685,7 +1685,7 @@ void style_page_layout_properties::docx_serialize(std::wostream & strm, oox::doc oox::section_context::_section & section = Context.get_section_context().get_last(); attlist_.docx_convert_serialize(CP_XML_STREAM(), Context, section.margin_left_, section.margin_right_); - //todooo при появлении еще накладок - переписать !! + //todooo if more overlays appear - rewrite !! } } } diff --git a/OdfFile/Reader/Format/styles.h b/OdfFile/Reader/Format/styles.h index cdebbd3297..b81b6a4025 100644 --- a/OdfFile/Reader/Format/styles.h +++ b/OdfFile/Reader/Format/styles.h @@ -435,11 +435,11 @@ public: virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const; - office_element_ptr_array style_master_page_; // разметки тем - office_element_ptr style_handout_master_; // разметки для принтера - .. второстепенно - office_element_ptr draw_layer_set_; // необязательно .. так как слои все равно не поддерживаются в мс. - // то есть не будут объекты объеденены по признаку слоя - // зы. не путать с обычной группировкой + office_element_ptr_array style_master_page_; // theme layouts + office_element_ptr style_handout_master_; // layouts for printer -.. secondary + office_element_ptr draw_layer_set_; // optional.. since layers are not supported in MS anyway. + // i.e. objects won't be grouped by layer + // PS. don't confuse with regular grouping private: virtual void add_attributes( const xml::attributes_wc_ptr & Attributes ); virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name); diff --git a/OdfFile/Reader/Format/styles_list.cpp b/OdfFile/Reader/Format/styles_list.cpp index 499a2ef0f2..574116c302 100644 --- a/OdfFile/Reader/Format/styles_list.cpp +++ b/OdfFile/Reader/Format/styles_list.cpp @@ -629,15 +629,15 @@ void text_list_level_style_number::pptx_convert(oox::pptx_conversion_context & C CP_XML_WRITER(strm) { - if (style_text_properties * textProperties = dynamic_cast<style_text_properties *>(text_properties_.get()))///эти свойства относятся - // к отрисовки значков !!! а не самого текста + if (style_text_properties * textProperties = dynamic_cast<style_text_properties *>(text_properties_.get()))///these properties relate + // to icon rendering !!! not the text itself { textProperties->content_.pptx_convert_as_list(Context); strm << Context.get_text_context().get_styles_context().text_style().str(); } if (false == num_format.empty()) { - CP_XML_NODE(L"a:buAutoNum")//ms козлы !! для них оказыается ВАЖЕН порядок .. если записать это поле первым, а потом свойства - нихера в мс2010 не отображается верно !!! + CP_XML_NODE(L"a:buAutoNum")//ms jerks !! turns out order is IMPORTANT for them .. if you write this field first, then properties - nothing displays correctly in ms2010 !!! { CP_XML_ATTR(L"startAt", number_attr_.text_start_value_); CP_XML_ATTR(L"type", num_format); @@ -804,8 +804,8 @@ void text_list_level_style_bullet::pptx_convert(oox::pptx_conversion_context & C style_text_properties * textProperties = dynamic_cast<style_text_properties *>(text_properties_.get()); std::wstring bullet = bullet_attr_.text_bullet_char_.get_value_or(L"\x2022"); - if (textProperties)///эти свойства относятся - // к отрисовки значков !!! а не самого текста + if (textProperties)///these properties relate + // to icon rendering !!! not the text itself { textProperties->content_.pptx_convert_as_list(Context); strm << Context.get_text_context().get_styles_context().text_style().str(); @@ -963,8 +963,8 @@ void text_list_level_style_image::pptx_convert(oox::pptx_conversion_context & Co style_text_properties* textProperties = dynamic_cast<style_text_properties*>(text_properties_.get()); wchar_t bullet = L'\x2022'; - if (textProperties)///эти свойства относятся - // к отрисовки значков !!! а не самого текста + if (textProperties)///these properties relate + // to bullet rendering !!! not the text itself { textProperties->content_.pptx_convert_as_list(Context); strm << Context.get_text_context().get_styles_context().text_style().str(); diff --git a/OdfFile/Reader/Format/svg_parser.cpp b/OdfFile/Reader/Format/svg_parser.cpp index a5aaf20970..d2fc027003 100644 --- a/OdfFile/Reader/Format/svg_parser.cpp +++ b/OdfFile/Reader/Format/svg_parser.cpp @@ -399,7 +399,7 @@ namespace svg_path { bRelative = true; } - case 'H' ://горизонт линия + case 'H' ://horizontal line { nPos++; skipSpaces(nPos, rSvgDStatement, nLen); @@ -431,7 +431,7 @@ namespace svg_path { bRelative = true; } - case 'V' ://вертикальная линия + case 'V' ://vertical line { nPos++; skipSpaces(nPos, rSvgDStatement, nLen); @@ -670,7 +670,7 @@ namespace svg_path Polyline.clear(); _polyline aCurrPoly; - aCurrPoly.command = L"a:moveTo"; //первая точка сдвиг - остальные линия + aCurrPoly.command = L"a:moveTo"; //first point is move - rest are lines std::vector<std::wstring> points_str; @@ -696,7 +696,7 @@ namespace svg_path } if (Polyline.size() > 2 && closed) { - //замкнем + //close it Polyline.push_back(Polyline[0]); Polyline.back().command = L"a:lnTo"; } @@ -970,7 +970,7 @@ namespace svg_path { bRelative = true; } - case 'H'://горизонт линия + case 'H'://horizontal line { nPos++; skipSpaces(nPos, rSvgDStatement, nLen); @@ -1000,7 +1000,7 @@ namespace svg_path { bRelative = true; } - case 'V'://вертикальная линия + case 'V'://vertical line { nPos++; skipSpaces(nPos, rSvgDStatement, nLen); diff --git a/OdfFile/Reader/Format/table_docx.cpp b/OdfFile/Reader/Format/table_docx.cpp index 91ef79017a..6513ae113d 100644 --- a/OdfFile/Reader/Format/table_docx.cpp +++ b/OdfFile/Reader/Format/table_docx.cpp @@ -196,7 +196,7 @@ void table_table::docx_convert(oox::docx_conversion_context & Context) } bool sub_table = attlist_.table_is_sub_table_.get_value_or(false); - //todooo придумать как сделать внешние границы sub-таблицы границами внешней ячейки (чтоб слияние произошло) + // todooo figure out how to make outer borders of sub-table into outer cell borders (so that merging occurs) std::wstring tableStyleName = attlist_.table_style_name_.get_value_or(L""); @@ -393,7 +393,7 @@ void table_table_cell::docx_convert(oox::docx_conversion_context & Context) } _Wostream << L"</w:tcPr>"; - /// Обрабатываем стиль по умолчанию для данного столбца + /// Process default style for this column { const std::wstring & defaultCellStyle = Context.get_table_context().get_default_cell_style_col(Context.get_table_context().current_column()); @@ -412,7 +412,7 @@ void table_table_cell::docx_convert(oox::docx_conversion_context & Context) } } - /// Стиль по умолчанию для данной строки + /// Default style for this row { const std::wstring & defaultCellStyle = Context.get_table_context().get_default_cell_style_row(); @@ -430,7 +430,7 @@ void table_table_cell::docx_convert(oox::docx_conversion_context & Context) } } - // если одержимое не содержит ниодного параграфа, то добавляем параграф, иначе word считает файл битым + // if content doesn't contain any paragraph, add a paragraph, otherwise Word considers the file corrupted if (!content_.docx_convert(Context)) { _Wostream << emptyPar; diff --git a/OdfFile/Reader/Format/table_xlsx.cpp b/OdfFile/Reader/Format/table_xlsx.cpp index 5d02493fb3..2842246160 100644 --- a/OdfFile/Reader/Format/table_xlsx.cpp +++ b/OdfFile/Reader/Format/table_xlsx.cpp @@ -98,7 +98,7 @@ void table_table_row::xlsx_convert(oox::xlsx_conversion_context & Context) } std::wostream & strm = Context.current_sheet().sheetData(); -///обработка чтилей для роу - +///processing styles for row - size_t Default_Cell_style_in_row_ = 0; const std::wstring rowStyleName = attlist_.table_style_name_.get_value_or(L""); @@ -111,16 +111,16 @@ void table_table_row::xlsx_convert(oox::xlsx_conversion_context & Context) if ((instStyle_CellDefault) && (instStyle_CellDefault->content())) prop_CellDefault = instStyle_CellDefault->content()->get_style_table_cell_properties(); -//кастомные настройки стиля ячеек в данном роу +//custom cell style settings for this row - if (prop_CellDefault) //проверим что есть вообще кастом для роу- а потом уже посчитаем стиль + if (prop_CellDefault) //check if there is any custom for row - then calculate style { odf_reader::style_table_cell_properties_attlist cellFormatProperties = calc_table_cell_properties(instStyle_CellDefault); Default_Cell_style_in_row_ = Context.get_style_manager().xfId(NULL,NULL, &cellFormatProperties, NULL, L"", 0, true); } - else //стиля ячеек для строки нет глянем что там внутри строки в последней ячейке + else //no cell style for row - let's look inside the row at the last cell { - //возьмем стиль из последнего cell если он повторяющийся (тогда и ячейки вхолостую ненадо писать) + //take style from last cell if it's repeating (then don't need to write empty cells) int ind_last_cell = content_.size()-1; table_table_cell *last_cell = NULL; if (ind_last_cell > 0) @@ -148,9 +148,9 @@ void table_table_row::xlsx_convert(oox::xlsx_conversion_context & Context) if ((prop->attlist_.style_use_optimal_row_height_) && (*prop->attlist_.style_use_optimal_row_height_==true)) { - //автоматическая подстройка высоты. - //нету в оох - //todooo высилить по текущему шрифту размер у (двойной) и сравнить с заданным - перебить !!! + //automatic height adjustment. + //not present in oox + //todooo calculate size based on current font (double) and compare with specified - override!!! } std::wstringstream ht_s; @@ -248,14 +248,14 @@ void table_table_row::xlsx_convert(oox::xlsx_conversion_context & Context) { skip_next_row = true; if (attlist_.table_number_rows_repeated_ > 0xf000) - break;//Уведомление_о_вручении.ods (1 лист) + break;//Notification_of_delivery.ods (1st sheet) } if (content_.size() > 0 && attlist_.table_number_rows_repeated_ > 1000) { table_table_cell * table_cell = dynamic_cast<table_table_cell *>(content_[0].get()); if ((table_cell) && (table_cell->attlist_.table_number_columns_repeated_ > 1000)) { - break;//Уведомление_о_вручении.ods (2 лист) + break;//Notification_of_delivery.ods (2nd sheet) } } } @@ -490,7 +490,7 @@ namespace { double pixToSize(double pixels, double maxDigitSize) { - if (pixels < 8) pixels = 8; //УВЕДОМЛЕНИЕ О ПРИБЫТИИ ИНОСТРАННОГО ГРАЖДАНИНА.ods + if (pixels < 8) pixels = 8; //NOTIFICATION_OF_ARRIVAL_OF_FOREIGN_CITIZEN.ods return (int(( pixels /*/ 0.75*/ - 5)/ maxDigitSize * 100. + 0.5)) /100. * 0.98; // * 9525. * 72.0 / (360000.0 * 2.54); } @@ -546,7 +546,7 @@ void table_table_column::xlsx_convert(oox::xlsx_conversion_context & Context) if (inst->content()) { if (const style_table_cell_properties * prop = inst->content()->get_style_table_cell_properties()) - {//сделать проверку чтоб сюда не попал дефолтный, то сть пустой стиль + {//add check so that default, i.e. empty style, doesn't get here odf_reader::style_table_cell_properties_attlist cellFormatProperties = calc_table_cell_properties(inst); bool set_default = false; @@ -754,7 +754,7 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context) if (num_format_type == office_value_type::Time || num_format_type == office_value_type::Date || num_format_type == office_value_type::Currency) - {//тип формата данных из стиля не соответствует формату анных ячейки + {//data format type from style doesn't match cell data format num_format.clear(); num_format_type = office_value_type::Custom; } @@ -767,7 +767,7 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context) if (num_format_type == office_value_type::Time || num_format_type == office_value_type::Date || num_format_type == office_value_type::Currency) - {//тип формата данных из стиля не соответствует формату анных ячейки + {//data format type from style doesn't match cell data format num_format.clear(); num_format_type = office_value_type::Percentage; } @@ -805,7 +805,7 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context) xlsx_value_type = oox::XlsxCellType::n; if (num_format_type == office_value_type::Currency) - {//тип формата данных из стиля не соответствует формату данных ячейки + {//data format type from style doesn't match cell data format num_format.clear(); num_format_type = office_value_type::Date; } @@ -837,7 +837,7 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context) xlsx_value_type = oox::XlsxCellType::n; if (num_format_type == office_value_type::Currency) - {//тип формата данных из стиля не соответствует формату анных ячейки + {//data format type from style doesn't match cell data format num_format.clear(); num_format_type = office_value_type::Time; } @@ -895,9 +895,9 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context) for (unsigned int r = 0; r < attlist_.table_number_columns_repeated_; ++r) { -// вычислить стиль для ячейки +// calculate style for cell //--------------------------------------------------------------------------------------------------------- - std::wstring columnStyleName = Context.get_table_context().default_column_cell_style(); // могут быть разные стили колонок при repeated (Book 24.ods) + std::wstring columnStyleName = Context.get_table_context().default_column_cell_style(); // different column styles may exist with repeated (Book 24.ods) odf_read_context& odfContext = Context.root()->odf_context(); @@ -924,7 +924,7 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context) std::wstring data_style = CalcCellDataStyle(Context, columnStyleName, rowStyleName, cellStyleName); - // стили не наследуются + // styles are not inherited std::vector<const style_instance*> instances; instances.push_back(defaultCellStyle); @@ -1043,7 +1043,7 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context) } if (sharedStringId >= 0) { - xlsx_value_type = oox::XlsxCellType::s;//в случае текста, если он есть берем кэшированное значение + xlsx_value_type = oox::XlsxCellType::s;//for text, if it exists, we take the cached value } //--------------------------------------------------------------------------------------------------------- if (skip_next_cell) @@ -1052,7 +1052,7 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context) break; } - // пустые ячейки пропускаем. + // skip empty cells. if ( is_data_visible || ((cellStyle || defaultColumnCellStyle) && is_style_visible)) { std::wstring ref = oox::getCellAddress(Context.current_table_column(), Context.current_table_row()); @@ -1122,9 +1122,9 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context) else { empty_cell_count++; - //Уведомление_о_вручении.ods - 13 повторов пустых с cellStyle=NULL - нужные !!! + //Notification_of_delivery.ods - 13 empty repeats with cellStyle=NULL - needed!!! if (empty_cell_count > 19 && last_cell_&& (attlist_.table_number_columns_repeated_> 299 || cellStyle == NULL)) - {//пишем простыню только если задан стиль тока для этих ячеек + {//write full sheet only if style is set only for these cells skip_next_cell = true; } } @@ -1163,14 +1163,14 @@ void table_covered_table_cell::xlsx_convert(oox::xlsx_conversion_context & Conte bool skip_next_cell = false; bool is_style_visible = true; bool is_data_visible = false; -// вычислить стиль для ячейки +// calculate style for cell std::wstring cellStyleName = attlist_.table_style_name_.get_value_or(L""); std::wstring columnStyleName = Context.get_table_context().default_column_cell_style(); std::wstring rowStyleName = Context.get_table_context().default_row_cell_style(); if (attlist_.table_number_columns_repeated_ > 1) - columnStyleName.clear(); // могут быть разные стили колонок Book 24.ods + columnStyleName.clear(); // there can be different column styles Book 24.ods odf_read_context & odfContext = Context.root()->odf_context(); @@ -1190,7 +1190,7 @@ void table_covered_table_cell::xlsx_convert(oox::xlsx_conversion_context & Conte std::wstring data_style = CalcCellDataStyle(Context, columnStyleName, rowStyleName, cellStyleName); - // стили не наследуются + // styles are not inherited std::vector<const style_instance *> instances; instances.push_back(defaultCellStyle); @@ -1364,11 +1364,11 @@ void table_covered_table_cell::xlsx_convert(oox::xlsx_conversion_context & Conte const int sharedStringId = content_.xlsx_convert(Context, textFormatProperties); if (xlsx_value_type == oox::XlsxCellType::str && sharedStringId >= 0) - xlsx_value_type = oox::XlsxCellType::s;//в случае текста, если он есть берем кэшированное значение + xlsx_value_type = oox::XlsxCellType::s;//for text, if it exists, we take the cached value if (skip_next_cell) break; - // пустые ячейки пропускаем. + // skip empty cells. if ( is_data_visible || ((cellStyle || defaultColumnCellStyle) && is_style_visible)) { CP_XML_WRITER(strm) @@ -1419,9 +1419,9 @@ void table_covered_table_cell::xlsx_convert(oox::xlsx_conversion_context & Conte else { empty_cell_count++; - //Уведомление_о_вручении.ods - 13 повторов пустых с cellStyle=NULL - нужные !!! + //Notification_of_delivery.ods - 13 empty repeats with cellStyle=NULL - needed!!! if (empty_cell_count > 19 && last_cell_&& (attlist_.table_number_columns_repeated_> 299 || cellStyle == NULL)) - {//пишем простыню только если задан стиль тока для этих ячеек + {//write full sheet only if style is set only for these cells skip_next_cell = true; } } diff --git a/OdfFile/Reader/Format/templates.cpp b/OdfFile/Reader/Format/templates.cpp index 4067d10f3d..bbbf26b88b 100644 --- a/OdfFile/Reader/Format/templates.cpp +++ b/OdfFile/Reader/Format/templates.cpp @@ -56,7 +56,7 @@ void table_template_element::add_attributes( const xml::attributes_wc_ptr & Attr if (table_style_name_.empty()) table_style_name_ = text_style_name_; //http://lists.freedesktop.org/archives/libreoffice-bugs/2011-March/007109.html - //файл 1 (7).odp + // file 1 (7).odp } const wchar_t * table_body_template::ns = L"table"; diff --git a/OdfFile/Reader/Format/text_elements.cpp b/OdfFile/Reader/Format/text_elements.cpp index 4cad19d97d..1f963f959c 100644 --- a/OdfFile/Reader/Format/text_elements.cpp +++ b/OdfFile/Reader/Format/text_elements.cpp @@ -91,9 +91,9 @@ void process_paragraph_drop_cap_attr(const paragraph_attrs & Attr, oox::docx_con Context.get_drop_cap_context().Scale = style_drop_cap_->style_lines_; if (style_drop_cap_->style_distance_) - Context.get_drop_cap_context().Space = (int)(20.0 * (style_drop_cap_->style_distance_->get_value_unit(length::pt) ) );//формула ачуметь !! - подбор вручную + Context.get_drop_cap_context().Space = (int)(20.0 * (style_drop_cap_->style_distance_->get_value_unit(length::pt) ) );//crazy formula!! - manual adjustment - //font size пощитаем здесь .. так как его значение нужо в стиле параграфа (межстрочный интервал) - в (pt*20) + //calculate font size here.. since its value is needed in paragraph style (line spacing) - in (pt*20) text_format_properties_ptr text_properties = calc_text_properties_content (styleInst); @@ -106,7 +106,7 @@ void process_paragraph_drop_cap_attr(const paragraph_attrs & Attr, oox::docx_con { Context.get_drop_cap_context().FontSize = text_properties->process_font_size( text_properties->fo_font_size_, Context.get_styles_context().get_current_processed_style(), false, //1.); - 7.25 * (Context.get_drop_cap_context().Scale + (Context.get_drop_cap_context().Scale-1) * 0.7));//формула ачуметь !! - подбор вручную + 7.25 * (Context.get_drop_cap_context().Scale + (Context.get_drop_cap_context().Scale-1) * 0.7));//crazy formula!! - manual adjustment } } @@ -186,8 +186,8 @@ void paragraph::drop_cap_text_docx_convert(office_element_ptr first_text_element size_t str_start = Context.get_drop_cap_context().Length; size_t str_size = store_str.length() - Context.get_drop_cap_context().Length; - if (str_size < 0) str_size = 0; // это если на буквы в буквице разные стили - if (str_start > store_str.length()) str_start = store_str.length(); // это если на буквы в буквице разные стили + if (str_size < 0) str_size = 0; // this is if letters in drop cap have different styles + if (str_start > store_str.length()) str_start = store_str.length(); // this is if letters in drop cap have different styles str = store_str.substr(str_start, str_size); @@ -200,7 +200,7 @@ size_t paragraph::drop_cap_docx_convert(oox::docx_conversion_context & Context) size_t index = 0; - while(index < content_.size()) // могут быть track-change, ... + while(index < content_.size()) // may be track-change, ... { if (content_[index]->get_type() == typeTextText || content_[index]->get_type() == typeTextSpan) @@ -243,7 +243,7 @@ size_t paragraph::drop_cap_docx_convert(oox::docx_conversion_context & Context) 7.25 * (Context.get_drop_cap_context().Scale + (Context.get_drop_cap_context().Scale-1) * 0.7)); } } - //в рассчет берутся только первые элементы !!! разные там break-и отменяют реэжим drop_cap!! + //only first elements are considered!!! various breaks cancel drop_cap mode!! if ((!first_span_in_paragraph->content_.empty()) && (first_span_in_paragraph->content_[0]->get_type() == typeTextText)) { @@ -314,17 +314,17 @@ void paragraph::docx_convert(oox::docx_conversion_context & Context, _CP_OPT(std bool is_empty = content_.empty(); if (Context.get_paragraph_state() && (Context.get_process_note() == oox::docx_conversion_context::noNote) && !in_drawing) - {//вложеннные элементы ... или после графики embedded_linux_kernel_and_drivers_labs_zh_TW.odt + {//nested elements... or after graphics embedded_linux_kernel_and_drivers_labs_zh_TW.odt bIsNewParagraph = false; - if (!Context.get_paragraph_keep())// например Appendix I_IPP.odt - tracked elements ( + if (!Context.get_paragraph_keep())// for example Appendix I_IPP.odt - tracked elements ( { for (size_t i = 0; i < content_.size(); i++) { content_[i]->docx_convert(Context); } if (!Context.get_delete_text_state()) - Context.set_paragraph_state(false);// например Appendix I_IPP.odt - tracked elements (вложенные списки из 2 элементов) + Context.set_paragraph_state(false);// for example Appendix I_IPP.odt - tracked elements (nested lists of 2 elements) return; } } @@ -341,11 +341,11 @@ void paragraph::docx_convert(oox::docx_conversion_context & Context, _CP_OPT(std _CP_OPT(std::wstring) next_masterPageName; if (next_element_style_name) { - // проверяем не сменит ли следующий параграф свойства страницы. - // если да — устанавливаем контексту флаг на то что необходимо в текущем параграфе - // распечатать свойства раздела/секции - // проверить ... не она ли текущая - может быть прописан дубляж - и тогда разрыв нарисуется ненужный - // dump был выше уровнем + // check if next paragraph will change page properties. + // if yes — set context flag that it's necessary in current paragraph + // to print section properties + // check... is it the current one - may have duplicate - then unnecessary break will appear + // dump was one level higher next_masterPageName = Context.root()->odf_context().styleContainer().master_page_name_by_name(*next_element_style_name); if ((next_masterPageName) && (Context.get_master_page_name() != *next_masterPageName)) @@ -412,7 +412,7 @@ void paragraph::docx_convert(oox::docx_conversion_context & Context, _CP_OPT(std for (size_t i = index; i < content_.size(); i++) { if (content_[i]->get_type() == typeTextP) - {//параграф в параграфе .... оО + {// paragraph inside paragraph.... o_O p *para_inside = dynamic_cast<p*>(content_[i].get()); for (size_t j = 0; (para_inside) && (j < para_inside->paragraph_.content_.size()); ++j) @@ -459,8 +459,8 @@ void paragraph::docx_convert(oox::docx_conversion_context & Context, _CP_OPT(std Context.finish_run(); - // конвертируем в контексте параграфа элементы, которые были помещены в очередь - if (!Context.delayed_converting_)//иначе возможно зацикливание + // convert elements that were placed in the queue in paragraph context + if (!Context.delayed_converting_)// otherwise looping is possible { Context.docx_convert_delayed(); } @@ -579,7 +579,7 @@ void h::docx_convert(oox::docx_conversion_context & Context) { std::wstring bookmark; if (false == Context.get_table_content_context().mapReferences.empty()) - {//когда заголовки находятся выше таблицы контента - херово + {// when headers are above the table of contents - problematic std::wstringstream strm; text_to_stream(strm, false); std::wstring outline = strm.str(); @@ -821,7 +821,7 @@ void section::docx_convert(oox::docx_conversion_context & Context) } else { - //колонки для текста в объектах todooo + // columns for text in objects todooo } for (size_t i = 0; i < content_.size(); i++) @@ -838,7 +838,7 @@ void section::docx_convert(oox::docx_conversion_context & Context) if (false == masterPageNameLayout.empty()) { - Context.set_master_page_name(*masterPageName); //проверка на то что тема действительно существует???? + Context.set_master_page_name(*masterPageName); // check that theme actually exists???? Context.remove_page_properties(); Context.add_page_properties(masterPageNameLayout); @@ -848,10 +848,10 @@ void section::docx_convert(oox::docx_conversion_context & Context) if (content_[i]->next_element_style_name) { std::wstring text___ = *content_[i]->next_element_style_name; - // проверяем не сменится ли свойства страницы. - // если да — устанавливаем контексту флаг на то что необходимо в текущем параграфе - // распечатать свойства раздела/секции - //проверить ... не она ли текущая - может быть прописан дубляж - и тогда разрыв нарисуется ненужный + // check if page properties will change. + // if yes — set context flag that it's necessary in current paragraph + // to print section properties + // check... is it current - there may be duplication - and then unnecessary break will be drawn const _CP_OPT(std::wstring) next_masterPageName = Context.root()->odf_context().styleContainer().master_page_name_by_name(*content_[i]->next_element_style_name); if ((next_masterPageName) && (Context.get_master_page_name() != *next_masterPageName)) @@ -1970,7 +1970,7 @@ void unknown_base_change::docx_convert(oox::docx_conversion_context & Context) if (content_.empty()) return; -//тут удаленный текст. не по стандарту сделать бы и форматы - стилями чтоли .... +// here is deleted text. should make formats non-standard - with styles maybe.... for (size_t i = 0; i < content_.size(); i++) { @@ -2037,7 +2037,7 @@ void format_change::docx_convert(oox::docx_conversion_context & Context) } //---------------------------------------------------------------------------------------------------------- const wchar_t * unknown_change::ns = L"text"; -const wchar_t * unknown_change::name = L"UnknownChange"; //?? libra пишет +const wchar_t * unknown_change::name = L"UnknownChange"; //?? libre writes void unknown_change::docx_convert(oox::docx_conversion_context & Context) { diff --git a/OdfFile/Reader/Format/text_elements.h b/OdfFile/Reader/Format/text_elements.h index 7d35a74579..6e9a1b1bab 100644 --- a/OdfFile/Reader/Format/text_elements.h +++ b/OdfFile/Reader/Format/text_elements.h @@ -694,7 +694,7 @@ public: virtual void add_attributes( const xml::attributes_wc_ptr & Attributes ); virtual void docx_convert(oox::docx_conversion_context & Context); - _CP_OPT(std::wstring) style_name_; //не по снецификации ... но КАК сохранить то что было изменено в формате????? + _CP_OPT(std::wstring) style_name_; //not per specification ... but HOW to save what was changed in format????? }; CP_REGISTER_OFFICE_ELEMENT2(format_change); diff --git a/OdfFile/Reader/Format/visitor.h b/OdfFile/Reader/Format/visitor.h index c9e8f674a6..68b16f1baa 100644 --- a/OdfFile/Reader/Format/visitor.h +++ b/OdfFile/Reader/Format/visitor.h @@ -32,40 +32,40 @@ #pragma once /* -Схема работы с visitor: +Visitor pattern usage: -для классов, которые могут быть посещены visitor-ом: -1. наследуем от base_visitable -2. объявляем внутри макрос CPDOCCORE_DEFINE_VISITABLE() +For classes that can be visited by a visitor: +1. inherit from base_visitable +2. declare inside the macro CPDOCCORE_DEFINE_VISITABLE() -class example_visitable_element: public base_visitable +class example_visitable_element: public base_visitable { -// ... +// ... public: CPDOCCORE_DEFINE_VISITABLE(); -// ... +// ... }; -Для создания гостя: -1. наследуем гостя от base_visitor -2. наследуем гостя(визитор) от const_visitor<visitable_element1>/visitor<visitable_element1>, - const_visitor<visitable_element2>/visitor<visitable_element2>, и т.д. - для каждого из элементов, котоыре может посетить визитор -3. объявляем для каждого из элементов метод +To create a visitor: +1. inherit visitor from base_visitor +2. inherit visitor from const_visitor<visitable_element1>/visitor<visitable_element1>, + const_visitor<visitable_element2>/visitor<visitable_element2>, etc. + for each element that visitor can visit +3. declare for each element a method virtual void visit(const visitable_element1& val); virtual void visit(const visitable_element2& val); - и т.д. - (в случае неконстатности - убираем const) + etc. + (in case of non-const - remove const) -class table_round : public base_visitor, +class table_round : public base_visitor, public const_visitor<office_body>, public const_visitor<office_spreadsheet>, public const_visitor<table_table> { virtual void visit(const office_body& val) { - // ... + // ... } virtual void visit(const office_spreadsheet& val) @@ -75,20 +75,20 @@ class table_round : public base_visitor, virtual void visit(const table_table& val) { - // ... + // ... } }; -Для организации обхода: -1. Создаем визитор -2. Выполняем accept для корневого элемента +To organize traversal: +1. Create visitor +2. Execute accept for root element office_element * root; -/// ... +/// ... table_round tableRoundVisitor; root->accept(tableRoundVisitor); -Внимание! Визитор САМ определяет правила обхода внутренних вершин, т.е. внутри каждой функции посещения требуется написать например +Note! Visitor ITSELF determines traversal rules for internal nodes, i.e. inside each visit function you need to write for example virtual void visit(const office_body& val) { diff --git a/OdfFile/Writer/Converter/ConvertDrawing.cpp b/OdfFile/Writer/Converter/ConvertDrawing.cpp index f96182c0b8..1a21dc74ee 100644 --- a/OdfFile/Writer/Converter/ConvertDrawing.cpp +++ b/OdfFile/Writer/Converter/ConvertDrawing.cpp @@ -361,7 +361,7 @@ void OoxConverter::convert(PPTX::Logic::Pic *oox_picture) if (pathMedia.empty() && ext.link_media.IsInit()) { pathMedia = find_link_by_id(ext.link_media->get(), 3, bExternal); - //например файлики mp3 + // for example mp3 files } if (ext.st.IsInit()) start = *ext.st; if (ext.end.IsInit()) end = *ext.end; @@ -429,7 +429,7 @@ void OoxConverter::convert(PPTX::Logic::Pic *oox_picture) if (!sIdImageFileCache.empty()) { - //ищем физический файл ( rId относительно vml_drawing) + // searching for physical file (rId relative to vml_drawing) smart_ptr<OOX::File> pFile = pVml->Find(sIdImageFileCache); if (pFile.IsInit() && (OOX::FileTypes::Image == pFile->type())) @@ -1069,7 +1069,7 @@ int OoxConverter::convert(PPTX::Logic::PrstTxWarp *oox_text_preset) if (oox_text_preset == NULL) return -1; if (oox_text_preset->prst.GetBYTECode() == SimpleTypes::textshapetypeTextNoShape || - oox_text_preset->prst.GetBYTECode() == SimpleTypes::textshapetypeTextPlain) // в зависимости от других настроек + oox_text_preset->prst.GetBYTECode() == SimpleTypes::textshapetypeTextPlain) // depending on other settings { return 2000; } @@ -1408,7 +1408,7 @@ void OoxConverter::convert(PPTX::Logic::BlipFill *oox_bitmap_fill) convert(oox_bitmap_fill->blip->Effects[i].Effect.GetPointer()); } } - if (oox_bitmap_fill->srcRect.IsInit() && Width > 0 && Height > 0)//часть изображения + if (oox_bitmap_fill->srcRect.IsInit() && Width > 0 && Height > 0)// part of image { odf_context()->drawing_context()->set_image_client_rect_inch( (oox_bitmap_fill->srcRect->l.IsInit() ? XmlUtils::GetInteger(oox_bitmap_fill->srcRect->l.get()) : 0 ) / 100000. * Width, @@ -1445,7 +1445,7 @@ void OoxConverter::convert(PPTX::Logic::BlipFill *oox_bitmap_fill) if (oox_bitmap_fill->stretch.IsInit()) { odf_context()->drawing_context()->set_image_style_repeat(1); - if (oox_bitmap_fill->stretch->fillRect.IsInit()){} //заполнение неполного объема + if (oox_bitmap_fill->stretch->fillRect.IsInit()){} // filling incomplete volume } } odf_context()->drawing_context()->end_area_properties(); @@ -1681,7 +1681,7 @@ void OoxConverter::convert(PPTX::Logic::Ln *oox_line_prop, DWORD ARGB, PPTX::Log //if (oox_line_prop->custDash.IsInit()) //{ - // //через задание стиля и описание геометрии + // // through style definition and geometry description //} if (oox_line_prop->prstDash.IsInit() && oox_line_prop->prstDash->val.IsInit()) { @@ -1692,7 +1692,7 @@ void OoxConverter::convert(PPTX::Logic::Ln *oox_line_prop, DWORD ARGB, PPTX::Log //nullable<SimpleTypes::CCompoundLine<>> m_oCmpd; - //ELineJoinType m_eJoinType; // Тип соединения линий + //ELineJoinType m_eJoinType; // Line join type //nullable<OOX::Drawing::CLineJoinBevel> m_oBevel; //nullable<OOX::Drawing::CLineJoinMiterProperties> m_oMiter; //nullable<OOX::Drawing::CLineJoinRound> m_oRound; @@ -1749,8 +1749,8 @@ void OoxConverter::convert(PPTX::Logic::BodyPr *oox_bodyPr) switch(oox_bodyPr->Fit.type) { case PPTX::Logic::TextFit::FitSpAuto: - {//изменяемы размеры шейпа под текст - odf_context()->drawing_context()->set_text_box_min_size(true);//уже выставленые в min + {// shape sizes adjustable to fit text + odf_context()->drawing_context()->set_text_box_min_size(true);// already set to min }break; case PPTX::Logic::TextFit::FitNo: { @@ -1855,12 +1855,12 @@ void OoxConverter::convert(PPTX::Logic::NvPr *oox_nvPr) -//ph уровнем выше +// ph one level higher } void OoxConverter::convert_list_level(PPTX::Logic::TextParagraphPr *oox_para_props, int level) -{//одномерные списки тока +{// one-dimensional lists only //if (!oox_list)return; if (!oox_para_props) return; @@ -2120,7 +2120,7 @@ void OoxConverter::convert(PPTX::Logic::Paragraph *oox_paragraph, PPTX::Logic::T } else list_present = false; - //свойства могут быть приписаны не только к параграфу, но и к самому объекту + // properties can be assigned not only to paragraph, but also to the object itself odf_writer::paragraph_format_properties* paragraph_properties = odf_context()->text_context()->get_paragraph_properties(); odf_writer::text_format_properties* text_properties = odf_context()->text_context()->get_text_properties(); @@ -2148,7 +2148,7 @@ void OoxConverter::convert(PPTX::Logic::Paragraph *oox_paragraph, PPTX::Logic::T if (is_empty_run_elems(oox_paragraph->RunElems)) list_present = false; - //if (oox_paragraph->RunElems.empty() && list_present) list_present = false; // ms не обозначает присутствие списка, libra - показывает значек + //if (oox_paragraph->RunElems.empty() && list_present) list_present = false; // ms doesn't indicate list presence, libra - shows icon while ((int)odf_context()->text_context()->list_state_.levels.size() > list_level) { @@ -2295,7 +2295,7 @@ void OoxConverter::convert(PPTX::Logic::TextParagraphPr *oox_paragraph_pr , odf_ { convert(oox_paragraph_pr->defRPr.GetPointer(), text_properties); - //надо подумать как брать последний по family !!! + // need to think how to get the last one by family !!! //convert(oox_paragraph_pr->m_oDefRunProperty.GetPointer()); //odf_context()->text_context()->set_parent_span_style(odf_context()->styles_context()->last_state().get_name()); } @@ -2849,7 +2849,7 @@ void OoxConverter::convert(PPTX::Logic::TxBody *oox_txBody, PPTX::Logic::ShapeSt convert(oox_txBody->lstStyle.GetPointer()); -//single math - либра не тянет сложные вложенности +// single math - libre doesn't handle complex nesting bool bSingleMath = false; if (odf_context()->drawing_context()->is_text_box() && oox_txBody->Paragrs.size() == 1 && @@ -2871,7 +2871,7 @@ void OoxConverter::convert(PPTX::Logic::TxBody *oox_txBody, PPTX::Logic::ShapeSt { convert(&oox_txBody->Paragrs[i], oox_txBody->lstStyle.GetPointer()); - //внешние настройки для текста + // external settings for text convert(oox_txBody->bodyPr.GetPointer()); if (oox_style) diff --git a/OdfFile/Writer/Converter/ConvertVml.cpp b/OdfFile/Writer/Converter/ConvertVml.cpp index 3fd42d093f..d3ac6c05b1 100644 --- a/OdfFile/Writer/Converter/ConvertVml.cpp +++ b/OdfFile/Writer/Converter/ConvertVml.cpp @@ -65,7 +65,7 @@ namespace Oox2Odf { strId = strId.substr(1); } - //if (m_mapShapeTypes.find(strId) == m_mapShapeTypes.end())//?? с затиранием ??? + //if (m_mapShapeTypes.find(strId) == m_mapShapeTypes.end())//?? with overwriting ??? { m_mapVmlShapeTypes.insert(std::make_pair(strId, vml_shape_type)); } @@ -429,7 +429,7 @@ namespace Oox2Odf pathImage = find_link_by_id(sID, 1, bExternal); } - //что именно нужно заливка объекта или картинка - разрулится внутри drawing_context + // whether object fill or image is needed - will be resolved inside drawing_context if (pathImage.empty())return; _graphics_utils_::GetResolution(pathImage.c_str(), Width, Height); @@ -838,7 +838,7 @@ namespace Oox2Odf } void OoxConverter::convert(OOX::Vml::CTextPath *vml_textpath) { - if (vml_textpath == NULL) return; //это типо фигурный текст + if (vml_textpath == NULL) return; // this is like decorative text if (vml_textpath->m_sString.IsInit() == false) return; @@ -861,7 +861,7 @@ namespace Oox2Odf //height = vml_textpath->m_oStyle->m_arrProperties[i]->get_Value().oValue.dValue; break; case SimpleTypes::Vml::cssptFontSize: - //todooo проверять на размерность + // todooo check for dimension text_properties->fo_font_size_ = odf_types::length(vml_textpath->m_oStyle->m_arrProperties[i]->get_Value().oValue.dValue, odf_types::length::pt); break; case SimpleTypes::Vml::cssptFontStyle: diff --git a/OdfFile/Writer/Converter/Converter.cpp b/OdfFile/Writer/Converter/Converter.cpp index e4c2ee5e56..606313a24a 100644 --- a/OdfFile/Writer/Converter/Converter.cpp +++ b/OdfFile/Writer/Converter/Converter.cpp @@ -652,12 +652,12 @@ void OoxConverter::convert(OOX::WritingElement *oox_unknown) { convert(dynamic_cast<OOX::Drawing::COfficeArtExtension*>(oox_unknown)); }break; - // "ненужные" элементы + // "unnecessary" elements case OOX::et_w_softHyphen: case OOX::et_w_proofErr: case OOX::et_w_proofState: { - //бяка + //garbage }break; //--Math case OOX::et_m_oMath: diff --git a/OdfFile/Writer/Converter/ConverterChart.cpp b/OdfFile/Writer/Converter/ConverterChart.cpp index a5a28efdb5..08acf7b352 100644 --- a/OdfFile/Writer/Converter/ConverterChart.cpp +++ b/OdfFile/Writer/Converter/ConverterChart.cpp @@ -70,7 +70,7 @@ void OoxConverter::convert_chart_text(PPTX::Logic::TxBody *oox_txBody, bool only { convert(&oox_txBody->Paragrs[i], oox_txBody->lstStyle.GetPointer()); - //внешние настройки для текста + //external text settings convert_chart_text(oox_txBody->bodyPr.GetPointer()); } @@ -104,7 +104,7 @@ void OoxConverter::convert_chart_text(PPTX::Logic::BodyPr *oox_bodyPr) if ((oox_bodyPr->numCol.IsInit()) && (oox_bodyPr->numCol.get() > 1)) { //+ style section - //+element text:section в котором параграфы + //+element text:section containing paragraphs } if (oox_bodyPr->rot.IsInit()) { @@ -242,7 +242,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_Legend* ct_legend) convert_chart_text(ct_legend->m_txPr.GetPointer(), true); if (ct_legend->m_legendEntry.size() > 0) { - convert(ct_legend->m_legendEntry[0]); // в odf_writer нет в легенде множественности стилей + convert(ct_legend->m_legendEntry[0]); // odf_writer doesn't have multiple styles in legend } ////////////////////// odf_context()->chart_context()->end_element(); @@ -551,7 +551,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_ChartLines *line, int type) convert(line->m_spPr.GetPointer()); odf_context()->chart_context()->end_element(); } - if (type == 3)//drop line - нет в формате опен офис + if (type == 3)//drop line - not in OpenOffice format { odf_context()->chart_context()->start_stock_range_line(); convert(line->m_spPr.GetPointer()); @@ -973,7 +973,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CBaseSer* ser) { if (ser == NULL) return; - convert(ser->m_extLst.GetPointer()); // ref вперед cache + convert(ser->m_extLst.GetPointer()); // ref before cache convert(ser->m_tx); convert(ser->m_spPr.GetPointer()); @@ -1015,7 +1015,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_PieSer* ser) convert(ser->m_cat, 1); convert(ser->m_val); - if (!ser->m_dPt.empty()) //?? нужны ли дефолтовые? + if (!ser->m_dPt.empty()) //?? are defaults needed? { convert(NULL, ser->m_dPt); } @@ -1144,7 +1144,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_Marker* marker, std::vector<OOX: } odf_context()->chart_context()->start_data_point_series(1); convert(dPt[i]->m_spPr.GetPointer()); - convert(dPt[i]->m_marker, !dPt[i]->m_spPr.IsInit()); // брать цвета маркера, если нет цвета точки + convert(dPt[i]->m_marker, !dPt[i]->m_spPr.IsInit()); // take marker colors if no point color if (dPt[i]->m_explosion.IsInit()) odf_context()->chart_context()->set_series_pie_explosion(*dPt[i]->m_explosion); @@ -1172,7 +1172,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_Marker* marker, bool bFill) odf_context()->chart_context()->set_marker_type(marker->m_symbol->GetValue()); if (marker->m_size.IsInit()) odf_context()->chart_context()->set_marker_size(*marker->m_size); - //в оо нету отдельного понятия цвета маркера и точки данных + //in OO there's no separate concept for marker and data point color if (bFill) { convert(marker->m_spPr.GetPointer()); @@ -1343,7 +1343,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_Surface* ct_surface, int type, b void OoxConverter::convert(OOX::Spreadsheet::CT_ExternalData *external_data) { if (external_data == NULL)return; - //данные для диаграммы внутренние !!! + //internal chart data !!! if (false == external_data->m_id.IsInit()) return; @@ -1379,7 +1379,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_ExternalData *external_data) if (!bConvertLocal) { - odf_context()->chart_context()->set_local_table(true);//пока пользуем кэш .... + odf_context()->chart_context()->set_local_table(true);//for now using cache .... } } void OoxConverter::convert(OOX::Spreadsheet::CT_NumData *num_data, bool categories, bool label) diff --git a/OdfFile/Writer/Converter/DocxConverter.cpp b/OdfFile/Writer/Converter/DocxConverter.cpp index 3ec1cf2f53..eb41c14b38 100644 --- a/OdfFile/Writer/Converter/DocxConverter.cpp +++ b/OdfFile/Writer/Converter/DocxConverter.cpp @@ -222,7 +222,7 @@ bool DocxConverter::convertDocument() convert_document(); - //удалим уже ненужный документ docx + //delete the no longer needed docx document if (docx_document) delete docx_document; docx_document = NULL; if (docx_flat_document) delete docx_flat_document; docx_flat_document = NULL; @@ -259,7 +259,7 @@ void DocxConverter::convert_document() } else { - //считаем количесво секций и запоминаем их свойства .. + //count the number of sections and remember their properties.. size_t last_section_start = 0; for (size_t i = 0; i < doc->m_arrItems.size(); ++i) { @@ -474,7 +474,7 @@ void DocxConverter::convert(OOX::WritingElement *oox_unknown) case OOX::et_w_commentReference: { convert(dynamic_cast<OOX::Logic::CCommentReference*>(oox_unknown)); - //если нет Start - означает начало с предыдущего Run + //if no Start - means beginning from previous Run }break; case OOX::et_w_footnoteReference: { @@ -752,18 +752,18 @@ void DocxConverter::convert(OOX::Logic::CParagraph *oox_paragraph) current_bidi_set = (oox_paragraph->m_oParagraphProperty && oox_paragraph->m_oParagraphProperty->m_oBidi.IsInit() && oox_paragraph->m_oParagraphProperty->m_oBidi->m_oVal.ToBool()); if (oox_paragraph->m_oParagraphProperty) - {//цепочка изменений форматов в удаленных кусках либрой (и оо) не поддерживается - + {//chain of format changes in deleted chunks is not supported by LibreOffice (and OO) - int id; if (oox_paragraph->m_oParagraphProperty->m_oRPr.IsInit()) { - //удаление знака абзаца - объединение со следующим - в либре нету + //paragraph mark deletion - merge with next - not in LibreOffice //id = convert(oox_paragraph->m_oParagraphProperty->m_oRPr->m_oDel.GetPointer(), 2); //if (id >= 0) // id_change_properties.push_back(std::pair<int, int> (2, id)); - //вставка знака абзаца - разделение текущего параграфа - в либре нету - //if (oox_paragraph->m_arrItems.size() < 2)//только для пустых + //paragraph mark insertion - split current paragraph - not in LibreOffice + //if (oox_paragraph->m_arrItems.size() < 2)//only for empty ones { //id = convert(oox_paragraph->m_oParagraphProperty->m_oRPr->m_oIns.GetPointer(), 1); //if (id >= 0) @@ -841,9 +841,9 @@ void DocxConverter::convert(OOX::Logic::CParagraph *oox_paragraph) paragraph_properties = state->get_paragraph_properties(); text_properties = state->get_text_properties(); - if (odt_context->in_drop_cap()) //после буквицы (Nadpis.docx) - нужно накатить свойства параграфа нормального + if (odt_context->in_drop_cap()) //after drop cap (Nadpis.docx) - need to apply normal paragraph properties { - //очистить все кроме drop_cap + //clear all except drop_cap paragraph_properties->clear(false); } else @@ -851,7 +851,7 @@ void DocxConverter::convert(OOX::Logic::CParagraph *oox_paragraph) // ???? if (oox_paragraph->m_oParagraphProperty && oox_paragraph->m_oParagraphProperty->m_oPStyle.IsInit() && oox_paragraph->m_oParagraphProperty->m_oPStyle->m_sVal.IsInit()) { - //перезатираем все свойства ... наложение не катит -- ваще то надо чистить после буквицы (Nadpis.docx) .. проверить надобность с остальными случами + //overwrite all properties... overlay doesn't work -- actually need to clear after drop cap (Nadpis.docx).. check necessity with other cases paragraph_properties->clear(true); if (text_properties) text_properties->clear(); @@ -887,7 +887,7 @@ void DocxConverter::convert(OOX::Logic::CParagraph *oox_paragraph) { if (odt_context->in_drop_cap()) { - //вообще то свойства правильные параграфа идут в следующем после буквицы параграфе + //actually correct paragraph properties go in the paragraph following the drop cap odf_writer::text_format_properties *text_properties_drop_cap = odt_context->get_drop_cap_properties(); convert(oox_paragraph->m_oParagraphProperty->m_oRPr.GetPointer(), text_properties_drop_cap); if (text_properties_drop_cap->fo_font_size_) @@ -907,8 +907,8 @@ void DocxConverter::convert(OOX::Logic::CParagraph *oox_paragraph) } else { - odt_context->text_context()->set_KeepNextParagraph(false); //НУЖНО ПРИВЯЗАТЬ к УРОВНЮ на котором хранить m_bKeepNextParagraph !!! todooo - //пока - если следующий не параграф - скидываем !!! + odt_context->text_context()->set_KeepNextParagraph(false); //NEED TO BIND TO LEVEL where to store m_bKeepNextParagraph !!! todooo + //for now - if next is not paragraph - reset !!! } if (list_present) @@ -920,7 +920,7 @@ void DocxConverter::convert(OOX::Logic::CParagraph *oox_paragraph) bool empty_para = !((oox_paragraph->m_oParagraphProperty) && (oox_paragraph->m_oParagraphProperty->m_oRPr.IsInit())) ; if (empty_para && oox_paragraph->m_arrItems.size() < 2 && odt_context->text_context()->get_KeepNextParagraph()) - {//rapcomnat12.docx - стр 185 + {//rapcomnat12.docx - page 185 for (size_t i = 0; i < oox_paragraph->m_arrItems.size(); ++i) { @@ -948,12 +948,12 @@ void DocxConverter::convert(OOX::Logic::CParagraph *oox_paragraph) //--------------------------------------------------------------------------------------------------------------------- for (size_t i = 0; i < oox_paragraph->m_arrItems.size(); ++i) { - //те элементы которые тока для Paragraph - здесь - остальные в общей куче + //elements that are only for Paragraph - here - the rest in common pile switch(oox_paragraph->m_arrItems[i]->getType()) { case OOX::et_w_pPr: { - // пропускаем .. + // skip.. }break; default: convert(oox_paragraph->m_arrItems[i]); @@ -987,9 +987,9 @@ void DocxConverter::convert(OOX::Logic::CParagraph *oox_paragraph) void DocxConverter::convert(OOX::Logic::CRun *oox_run)//wordprocessing 22.1.2.87 math 17.3.2.25 { if (oox_run == NULL) return; - //хм разобраться а нужен ли он ... частенько бывает в неправильном месте!!! - A GRUBU.docx + //hmm figure out if it's needed... often in wrong place!!! - A GRUBU.docx //https://forums.asp.net/t/1951556.aspx?Facing+problem+finding+out+page+end+in+Ms+Word+Open+XML+SDK+Asp+net+c+We+can+t+get+a+lastRenderedPageBreak - ////test for break - 2 first element ЭТОТ элемент НУЖНО вытащить отдельно !!! + ////test for break - 2 first element THIS element NEEDS to be extracted separately !!! //for(size_t i = 0; i < (std::min) ( (size_t)2, oox_run->m_arrItems.size()); ++i) //{ // if (*it->getType() == OOX::et_w_lastRenderedPageBreak) @@ -1016,7 +1016,7 @@ void DocxConverter::convert(OOX::Logic::CRun *oox_run)//wordprocessing 22.1.2.87 for (size_t i = 0; i < oox_run->m_arrItems.size(); ++i) { - //те элементы которые тока для Run - здесь - остальные в общей куче + //elements that are only for Run - here - the rest in common pile switch(oox_run->m_arrItems[i]->getType()) { case OOX::et_w_fldChar: @@ -1034,10 +1034,10 @@ void DocxConverter::convert(OOX::Logic::CRun *oox_run)//wordprocessing 22.1.2.87 OOX::Logic::CDelText* pDelText= dynamic_cast<OOX::Logic::CDelText*>(oox_run->m_arrItems[i]); convert(pDelText); }break; - case OOX::et_w_rPr: // пропускаем .. + case OOX::et_w_rPr: // skip.. { }break; - case OOX::et_w_lastRenderedPageBreak: // не информативное .. может быть неверно записано + case OOX::et_w_lastRenderedPageBreak: // not informative.. may be incorrectly written { }break; case OOX::et_w_br: @@ -1405,7 +1405,7 @@ int DocxConverter::convert(OOX::Logic::CTrPrChange *oox_tr_prop_change) if (odt_context->start_change(id, 3, author, userId, date)) { convert(oox_tr_prop_change->m_pTrPr.GetPointer()); - //odt_context->end_change(id, 3); в конце row + //odt_context->end_change(id, 3); at end of row return id; } if (!odt_context->start_change(id, 3, author, userId, date, style_name)) return -1; @@ -1447,7 +1447,7 @@ int DocxConverter::convert(OOX::Logic::CTblPrChange *oox_table_prop_change) { bool table_styled = false; if (oox_table_prop_change->m_pTblPr->m_oTblStyle.IsInit() && oox_table_prop_change->m_pTblPr->m_oTblStyle->m_sVal.IsInit()) - {//настройка предустановленного стиля + {//preset style configuration std::wstring base_style_name = *oox_table_prop_change->m_pTblPr->m_oTblStyle->m_sVal; @@ -1620,7 +1620,7 @@ void DocxConverter::convert(OOX::Logic::CParagraphProperty *oox_paragraph_pr, _CP_OPT(odf_types::length) length; convert(dynamic_cast<SimpleTypes::CUniversalMeasure *>(oox_paragraph_pr->m_oInd->m_oStart.GetPointer()), length); paragraph_properties->fo_margin_left_ = odf_types::length(length->get_value_unit(odf_types::length::cm), odf_types::length::cm); - //в случае списка тута надо выдумать indent (взять из стиля списка) + //in case of list need to figure out indent here (take from list style) } if (oox_paragraph_pr->m_oInd->m_oEnd.IsInit()) { @@ -1736,7 +1736,7 @@ void DocxConverter::convert(OOX::Logic::CParagraphProperty *oox_paragraph_pr, paragraph_properties->fo_keep_with_next_ = odf_types::keep_together::type::Always; } - convert(oox_paragraph_pr->m_oFramePr.GetPointer(), paragraph_properties); //буквица или фрейм + convert(oox_paragraph_pr->m_oFramePr.GetPointer(), paragraph_properties); //drop cap or frame if (current_section_properties) { @@ -1934,7 +1934,7 @@ void DocxConverter::convert(OOX::Logic::CSectionProperty* oox_section_pr, bool b case SimpleTypes::sectionmarkEvenPage: case SimpleTypes::sectionmarkNextPage: case SimpleTypes::sectionmarkOddPage: - // возможен разрыв + // break possible break; } } @@ -2098,7 +2098,7 @@ void DocxConverter::convert(OOX::Logic::CSectionProperty* oox_section_pr, bool b //pageborderdisplayAllPages = 0, //pageborderdisplayFirstPage = 1, //pageborderdisplayNotFirstPage = 2 - //нужно разделить + сделать новые (без этих свойств) стили страниц - действительно для раздела + //need to split + make new page styles (without these properties) - really for section } //nullable<SimpleTypes::CPageBorderOffset<> > m_oOffsetFrom; //nullable<SimpleTypes::CPageBorderZOrder<> > m_oZOrder; @@ -2120,7 +2120,7 @@ void DocxConverter::convert(OOX::Logic::CSectionProperty* oox_section_pr, bool b } if (docx_document) { - convert(docx_document->m_oMain.document->m_oBackground.GetPointer(), 1);//подложка - вот в таком она месте :(, причём одна на все разделы, не как в оо + convert(docx_document->m_oMain.document->m_oBackground.GetPointer(), 1);//background - that's where it is :(, and it's one for all sections, not like in OO } else if (docx_flat_document) { @@ -2255,14 +2255,14 @@ void DocxConverter::convert(OOX::Logic::CSectionProperty* oox_section_pr, bool b } if (oox_section_pr->m_oLnNumType->m_oStart.IsInit()) - {//нет в формате ??? + {//not in format ??? linenumbering->text_start_ = oox_section_pr->m_oLnNumType->m_oStart->GetValue(); } odt_context->styles_context()->add_style(lnNum_elm, false, true, style_family::LineNumbering); } //------------------------------------------------------------------------------------------------------------------------------------------ - // то что относится собственно к секциям-разделам + // what relates specifically to sections //nullable<ComplexTypes::Word::COnOff2 > m_oBidi; //nullable<ComplexTypes::Word::CDocGrid > m_oDocGrid; @@ -2392,7 +2392,7 @@ void DocxConverter::convert(ComplexTypes::Word::CFramePr *oox_frame_pr, odf_writ if (oox_frame_pr->m_oDropCap.IsInit() || oox_frame_pr->m_oLines.IsInit()) { - //буквица + //drop cap odt_context->start_drop_cap(paragraph_properties); if (oox_frame_pr->m_oDropCap.IsInit() && oox_frame_pr->m_oDropCap->GetValue() == SimpleTypes::dropcapMargin) @@ -2405,7 +2405,7 @@ void DocxConverter::convert(ComplexTypes::Word::CFramePr *oox_frame_pr, odf_writ } else { - //фрейм текста .. ваще то его никто не формирует .. странно todoo ?? + //text frame.. actually no one generates it.. strange todoo ?? if (oox_frame_pr->m_oXAlign.IsInit()) { switch(oox_frame_pr->m_oXAlign->GetValue()) @@ -2432,7 +2432,7 @@ void DocxConverter::convert(ComplexTypes::Word::CFramePr *oox_frame_pr, odf_writ } //nullable<SimpleTypes::CHeightRule<> > m_oHRule; -//имеют отношение только в drawing +//only relevant in drawing //nullable<SimpleTypes::CTwipsMeasure > m_oW; //nullable<SimpleTypes::CWrap<> > m_oWrap; //nullable<SimpleTypes::CTwipsMeasure > m_oH; @@ -2554,7 +2554,7 @@ void DocxConverter::convert(OOX::Logic::CPBdr *oox_border, odf_writer::paragraph if (left.length() > 0 ) paragraph_properties->common_border_attlist_.fo_border_left_ = left; if (right.length() > 0 ) paragraph_properties->common_border_attlist_.fo_border_right_ = right; } - bool shadow = false;//в либре только одна тень ( + bool shadow = false;//in LibreOffice only one shadow ( if (oox_border->m_oBottom.IsInit() && oox_border->m_oBottom->m_oShadow.IsInit() && oox_border->m_oBottom->m_oShadow->ToBool()) shadow = true; if (oox_border->m_oTop.IsInit() && oox_border->m_oTop->m_oShadow.IsInit() && oox_border->m_oTop->m_oShadow->ToBool()) shadow = true; if (oox_border->m_oLeft.IsInit() && oox_border->m_oLeft->m_oShadow.IsInit() && oox_border->m_oLeft->m_oShadow->ToBool()) shadow = true; @@ -2876,7 +2876,7 @@ void DocxConverter::convert(OOX::Logic::CRunProperty *oox_run_pr, odf_writer::te text_properties->fo_color_ = hexString; } - //text_properties->content_.style_text_underline_type_= odf_types::line_type(odf_types::line_type::None); //нельзя..если будет выше наследуемого то подчеркивания не будет + //text_properties->content_.style_text_underline_type_= odf_types::line_type(odf_types::line_type::None); //can't..if above inherited then underline won't be there if (oox_run_pr->m_oU.IsInit()) { text_properties->style_text_underline_style_ = odf_types::line_style(odf_types::line_style::Solid); @@ -3087,7 +3087,7 @@ void DocxConverter::convert(OOX::Logic::CRunProperty *oox_run_pr, odf_writer::te } } if ((oox_run_pr->m_oOutline.IsInit()) && (oox_run_pr->m_oOutline->m_oVal.ToBool())) - text_properties->style_text_outline_ = true; //контур + text_properties->style_text_outline_ = true; //outline if (oox_run_pr->m_oVanish.IsInit()) text_properties->text_display_ = odf_types::text_display(odf_types::text_display::None); @@ -3144,14 +3144,14 @@ void DocxConverter::convert(OOX::Logic::CAlternateContent *oox_alt_content) { if (oox_alt_content == NULL)return; - for(size_t i = 0; i < oox_alt_content->m_arrChoiceItems.size(); ++i) // правильный выбор + for(size_t i = 0; i < oox_alt_content->m_arrChoiceItems.size(); ++i) // correct choice { convert(oox_alt_content->m_arrChoiceItems[i]); } - - if (oox_alt_content->m_arrChoiceItems.size() > 0) return; //чтоб не было дубляжа - for(size_t i = 0; i < oox_alt_content->m_arrFallbackItems.size(); ++i) // альтернативный - // todooo нужно сверять по инддексно что нормально сконвертилось ... или делать ВСЕ по choice ( это правильнее) + + if (oox_alt_content->m_arrChoiceItems.size() > 0) return; //to avoid duplication + for(size_t i = 0; i < oox_alt_content->m_arrFallbackItems.size(); ++i) // alternative + // todooo need to compare by index that converted normally... or do ALL by choice (that's more correct) { convert(oox_alt_content->m_arrFallbackItems[i]); } @@ -3480,7 +3480,7 @@ void DocxConverter::convert(OOX::Drawing::CAnchor* oox_anchor) { odt_context->drawing_context()->set_wrap_style(odf_types::style_wrap::RunThrough); } - if (bBackground)//эффект_штурмовика.docx + if (bBackground)//stormtrooper_effect.docx { odt_context->drawing_context()->set_object_background(true); } @@ -3542,7 +3542,7 @@ void DocxConverter::convert(OOX::Drawing::CInline *oox_inline) if (oox_inline->m_oDistR.IsInit()) odt_context->drawing_context()->set_margin_right (oox_inline->m_oDistR->ToPoints()); if (oox_inline->m_oDistB.IsInit()) odt_context->drawing_context()->set_margin_bottom (oox_inline->m_oDistB->ToPoints()); - //вертикальное выравнивание относительно строки поставим в середину (иначе по нижнему краю почемуто) + //set vertical alignment relative to line to center (otherwise bottom edge for some reason) odt_context->drawing_context()->set_vertical_rel(2);//line odt_context->drawing_context()->set_vertical_pos(1);//middle @@ -3815,7 +3815,7 @@ void DocxConverter::convert_styles() //if (i == 0 && styles->m_arrStyle[i]->m_oDefault.IsInit() && styles->m_arrStyle[i]->m_oDefault->ToBool()) //{ - // //NADIE_COMO_TU.docx тут дефолтовый стиль не прописан явно, берем тот что Normal + // //NADIE_COMO_TU.docx here default style is not explicitly specified, taking Normal //} } @@ -3828,11 +3828,11 @@ void DocxConverter::convert(OOX::Logic::CHyperlink *oox_hyperlink) std::wstring link, location; bool bExternal = false; - if (oox_hyperlink->m_oId.IsInit()) //гиперлинк + if (oox_hyperlink->m_oId.IsInit()) //hyperlink { link = find_link_by_id(oox_hyperlink->m_oId->GetValue(), 2, bExternal); } - else if (oox_hyperlink->m_sDestinition.IsInit()) //гиперлинк + else if (oox_hyperlink->m_sDestinition.IsInit()) //hyperlink { link = *oox_hyperlink->m_sDestinition; } @@ -3936,7 +3936,7 @@ void DocxConverter::convert(OOX::CDocDefaults *def_style, OOX::CStyles *styles) } convert(&runProps, text_properties); - ///////на дефолтовый параграф - дефолтовые настройки шрифта + ///////for default paragraph - default font settings odf_writer::odf_style_state_ptr def_style_state; odf_writer::text_format_properties* para_text_properties = NULL; @@ -3980,7 +3980,7 @@ void DocxConverter::convert(OOX::CDocDefaults *def_style, OOX::CStyles *styles) odt_context->styles_context()->create_default_style(odf_types::style_family::Table); odf_writer::style_table_properties * table_properties = odt_context->styles_context()->last_state()->get_table_properties(); - //для красивой отрисовки в редакторах - разрешим объеденить стили пересекающихся обрамлений + //for nice rendering in editors - allow merging styles of overlapping borders table_properties->content_.table_border_model_ = odf_types::border_model(odf_types::border_model::Collapsing); odt_context->styles_context()->create_default_style(odf_types::style_family::TableRow); @@ -3988,12 +3988,12 @@ void DocxConverter::convert(OOX::CDocDefaults *def_style, OOX::CStyles *styles) row_properties->style_table_row_properties_attlist_.fo_keep_together_ = odf_types::keep_together(odf_types::keep_together::Auto); ///////////////////////////////////////////////////////////////////////////////////////////////// - //зачемто ?! для OpenOffice для врезок/фреймов нужен базовый стиль - без него другой тип геометрии oO !!! + //for some reason ?! for OpenOffice for insets/frames base style is needed - without it different geometry type oO !!! odt_context->styles_context()->create_style(L"Frame", odf_types::style_family::Graphic, false, true); odf_writer::graphic_format_properties* graphic_properties = odt_context->styles_context()->last_state()->get_graphic_properties(); - //для image ?! + //for image ?! odt_context->styles_context()->create_style(L"Graphics", odf_types::style_family::Graphic, false, true); graphic_properties = odt_context->styles_context()->last_state()->get_graphic_properties(); //if (graphic_properties)graphic_properties->content_.common_background_color_attlist_.fo_background_color_ = odf_types::background_color(odf_types::background_color::Transparent); @@ -4091,7 +4091,7 @@ void DocxConverter::convert(OOX::Numbering::CLvl *oox_num_lvl, OOX::Numbering::C } } - if (oox_num_lvl->m_oRPr.IsInit())//для обозначений списка + if (oox_num_lvl->m_oRPr.IsInit())//for list markers { if ((lvl_over) && (lvl_over->m_oRPr.IsInit())) { @@ -4105,7 +4105,7 @@ void DocxConverter::convert(OOX::Numbering::CLvl *oox_num_lvl, OOX::Numbering::C odf_writer::text_format_properties *text_props = odt_context->styles_context()->lists_styles().get_text_properties(); convert(oox_num_lvl->m_oRPr.GetPointer(), text_props, true); - //create text style for symbols list НА ЛОКАЛЬНОМ контексте - иначе пересечение имен стилей (todoo вытащить генерацию имен в общую часть) + //create text style for symbols list ON LOCAL context - otherwise style name collision (todoo move name generation to common part) styles_context->create_style(L"", odf_types::style_family::Text, false, true, -1); odf_writer::odf_style_state_ptr style_state = styles_context->last_state(odf_types::style_family::Text); if (style_state) @@ -4125,7 +4125,7 @@ void DocxConverter::convert(OOX::Numbering::CLvl *oox_num_lvl, OOX::Numbering::C } if (size_bullet_number_marker < 0.01 && (type_list == 2 || type_list == 3)) { - //выдернем из дефолтного + //extract from default odf_writer::odf_style_state_ptr state; if ((odf_context()->styles_context()->find_odf_default_style_state(odf_types::style_family::Paragraph, state)) && (state)) { @@ -4228,14 +4228,14 @@ void DocxConverter::convert_table_style(OOX::CStyle *oox_style) std::wstring oox_name_id = oox_style->m_sStyleId.get_value_or(L""); odt_context->styles_context()->table_styles().start_style(oox_name_id); -//общие +//common if (oox_style->m_oTblPr.IsInit()) { odf_writer::style_table_properties *table_properties = odt_context->styles_context()->table_styles().get_table_properties(); convert(oox_style->m_oTblPr.GetPointer(), table_properties); - //нужно проверить стоит ли отнаследоваться от base_on + //need to check whether to inherit from base_on if (oox_style->m_oTblPr->m_oTblBorders.IsInit()) { @@ -4278,7 +4278,7 @@ void DocxConverter::convert_table_style(OOX::CStyle *oox_style) // odf_writer::style_table_row_properties * table_row_properties = odt_context->styles_context()->table_styles().get_table_row_properties(); // convert(oox_style->m_oTrPr.GetPointer(), table_row_properties); //} -//отдельные +//individual for (size_t i = 0; i < oox_style->m_arrTblStylePr.size() ; i++) { if (oox_style->m_arrTblStylePr[i] == NULL) continue; @@ -4300,7 +4300,7 @@ void DocxConverter::convert_table_style(OOX::CStyle *oox_style) case SimpleTypes::tblstyleoverridetypeSwCell : odt_context->styles_context()->table_styles().add_swCell(); break; case SimpleTypes::tblstyleoverridetypeWholeTable : odt_context->styles_context()->table_styles().add_wholeTable(); break; } - //сначела отнаследоваться от общих настроек??? + //first inherit from common settings??? convert(oox_style->m_arrTblStylePr[i]->m_oTcPr.GetPointer(), odt_context->styles_context()->table_styles().get_table_cell_properties()); convert(oox_style->m_arrTblStylePr[i]->m_oRunPr.GetPointer(),odt_context->styles_context()->table_styles().get_text_properties()); convert(oox_style->m_arrTblStylePr[i]->m_oParPr.GetPointer(),odt_context->styles_context()->table_styles().get_paragraph_properties(), NULL, false); @@ -4499,9 +4499,9 @@ void DocxConverter::convert(OOX::Logic::CCommentReference* oox_comm_ref) int state = odt_context->start_comment(oox_comm_id); - if (state > 0) // типо тока стартанул + if (state > 0) // like just started { - //значит старт тута а не по RangeStart + //means start is here not by RangeStart convert_comment(oox_comm_id); if (state == 2) @@ -4698,7 +4698,7 @@ void DocxConverter::convert(OOX::Logic::CTbl *oox_table) if (oox_table->m_oTableProperties && (oox_table->m_oTableProperties->m_oTblStyle.IsInit() && oox_table->m_oTableProperties->m_oTblStyle->m_sVal.IsInit())) - {//настройка предустановленного стиля + {//preset style configuration std::wstring base_style_name = *oox_table->m_oTableProperties->m_oTblStyle->m_sVal; styled_table = odt_context->styles_context()->table_styles().start_table(base_style_name); @@ -4852,10 +4852,10 @@ void DocxConverter::convert(OOX::Logic::CTbl *oox_table) odt_context->styles_context()->table_styles().set_current_dimension(count_columns, count_rows); odt_context->table_context()->set_table_size(count_columns, count_rows); -//------ колонки +//------ columns convert(oox_table->m_oTblGrid.GetPointer()); -//------ строки +//------ rows for (size_t i = 0; i < oox_table->m_arrItems.size(); ++i) { switch(oox_table->m_arrItems[i]->getType()) @@ -4930,7 +4930,7 @@ void DocxConverter::convert(OOX::Logic::CTblGrid *oox_table_grid) odt_context->add_table_column(width); - if (width > 0 && width < 5) //2222010_53102Reader final.docx - настройка через ячейки + if (width > 0 && width < 5) //2222010_53102Reader final.docx - configuration via cells { //odt_context->table_context()->set_column_optimal(true); //2222010_53102Reader final.docx @@ -4952,7 +4952,7 @@ int DocxConverter::convert(OOX::Logic::CTblGridChange *oox_table_grid_prop_chang //std::wstring userId = oox_table_grid_prop_change->m_sUserId.IsInit() ? oox_table_grid_prop_change->m_sUserId.get2() : L""; //std::wstring date = oox_table_grid_prop_change->m_oDate.IsInit() ? oox_table_grid_prop_change->m_oDate->GetValue() : L""; - /// ( нету в либре подходящей схемы + /// ( no suitable scheme in LibreOffice //if (!odt_context->start_change(id, 3, author, userId, date, style_name)) return -1; //return id; return -1; @@ -4972,7 +4972,7 @@ void DocxConverter::convert(OOX::Logic::CTr *oox_table_row) {//+ Format ??? //id_insert_row = convert(oox_table_row->m_pTableRowProperties->m_oIns.GetPointer(), 1); //id_delete_row = convert(oox_table_row->m_pTableRowProperties->m_oDel.GetPointer(), 2); - //??? как в электороных таблицах? или ваще нету? + //??? like in spreadsheets? or doesn't exist at all? } if (styled && oox_table_row->m_pTableRowProperties->m_oTblHeader.IsInit() @@ -5014,7 +5014,7 @@ void DocxConverter::convert(OOX::Logic::CTc *oox_table_cell) //id_change_properties = convert(oox_table_cell->m_pTableCellProperties->m_oCellIns.GetPointer()); ?? //id_change_properties = convert(oox_table_cell->m_pTableCellProperties->m_oCellDel.GetPointer()); ?? //id_change_properties = convert(oox_table_cell->m_pTableCellProperties->m_oTcPrChange.GetPointer()); - //??? как в электороных таблицах? или ваще нету? + //??? like in spreadsheets? or doesn't exist at all? if (oox_table_cell->m_pTableCellProperties->m_oVMerge.IsInit()) { @@ -5093,7 +5093,7 @@ bool DocxConverter::convert(OOX::Logic::CTableProperty *oox_table_pr, odf_writer else if ( oox_table_pr->m_oTblW->m_oType->GetValue() == SimpleTypes::tblwidthAuto && oox_table_pr->m_oTblW->m_oW->GetValue() == 0 ) { - //динамическое расширение - автоподбор по содержимому. + //dynamic expansion - auto-fit by content. odt_context->table_context()->set_optimal_column_width(true); table_properties->content_.style_use_optimal_column_width_ = true; } @@ -5107,7 +5107,7 @@ bool DocxConverter::convert(OOX::Logic::CTableProperty *oox_table_pr, odf_writer { } - if (oox_table_pr->m_oTblInd.IsInit())//отступ слева - обтекания нет + if (oox_table_pr->m_oTblInd.IsInit())//left indent - no wrapping { _CP_OPT(odf_types::length) length; @@ -5118,7 +5118,7 @@ bool DocxConverter::convert(OOX::Logic::CTableProperty *oox_table_pr, odf_writer } table_properties->content_.table_align_ = odf_types::table_align(odf_types::table_align::Left); } - else if (oox_table_pr->m_oTblpPr.IsInit()) //отступы, обтекание есть + else if (oox_table_pr->m_oTblpPr.IsInit()) //margins, wrapping present { table_properties->content_.table_align_ = odf_types::table_align(odf_types::table_align::Left); @@ -5203,14 +5203,14 @@ void DocxConverter::convert(OOX::Logic::CTableProperty *oox_table_pr, odf_writer bool DocxConverter::convert(OOX::Logic::CTableProperty *oox_table_pr, bool base_styled) { if ((oox_table_pr && oox_table_pr->m_oTblBorders.IsInit()) || base_styled) - {//напрямую задать cell_prop на саму таблицу низя - тока как default-cell-style-name на columns & row + {//can't set cell_prop directly on table itself - only as default-cell-style-name on columns & row - //общие свойства ячеек - odt_context->styles_context()->create_style(L"", odf_types::style_family::TableCell, true, false, -1); //ради нормального задания дефолтовых свойств на cells + //common cell properties + odt_context->styles_context()->create_style(L"", odf_types::style_family::TableCell, true, false, -1); //for proper default properties assignment on cells odt_context->styles_context()->last_state()->set_dont_write(true); odf_writer::style_table_cell_properties * table_cell_properties = odt_context->styles_context()->last_state()->get_table_cell_properties(); - if (base_styled)// накатим свойства из стиля + if (base_styled)// apply properties from style { odt_context->styles_context()->table_styles().get_table_cell_properties(table_cell_properties); } @@ -5218,11 +5218,11 @@ bool DocxConverter::convert(OOX::Logic::CTableProperty *oox_table_pr, bool base_ odt_context->table_context()->set_default_cell_properties(odt_context->styles_context()->last_state()->get_name()); } -//стиль создаем всегда +//always create style odt_context->styles_context()->create_style(L"", odf_types::style_family::Table, true, false, -1); odf_writer::style_table_properties *table_properties = odt_context->styles_context()->last_state()->get_table_properties(); - if (base_styled)// накатим свойства - они не наследуются :( + if (base_styled)// apply properties - they are not inherited :( { odt_context->styles_context()->table_styles().get_table_properties(table_properties); @@ -5324,7 +5324,7 @@ bool DocxConverter::convert(OOX::Logic::CTableCellProperties *oox_table_cell_pr, table_cell_properties->content_.common_writing_mode_attlist_.loext_writing_mode_ = odf_types::writing_mode::LrTb; table_cell_properties->content_.style_direction_ = odf_types::direction(odf_types::direction::Ltr); }break; - case SimpleTypes::textdirectionLr ://повернутость буковок + case SimpleTypes::textdirectionLr ://letter rotation table_cell_properties->content_.common_writing_mode_attlist_.loext_writing_mode_ = odf_types::writing_mode::BtLr; case SimpleTypes::textdirectionLrV : case SimpleTypes::textdirectionTbV : @@ -5382,7 +5382,7 @@ bool DocxConverter::convert(OOX::Logic::CTableCellProperties *oox_table_cell_pr, if (oox_table_cell_pr->m_oTcW.IsInit() && oox_table_cell_pr->m_oTcW->m_oW.IsInit() && oox_table_cell_pr->m_oTcW->m_oType.IsInit() && oox_table_cell_pr->m_oTcW->m_oType->GetValue() == SimpleTypes::tblwidthDxa) { - //кастомная ширина ячейки :( //2222010_53102Reader final.docx - все равно кривоватенько + //custom cell width :( //2222010_53102Reader final.docx - still a bit wonky odt_context->table_context()->change_current_column_width(oox_table_cell_pr->m_oTcW->m_oW->GetValue()/ 20.);//dxa type } @@ -5472,7 +5472,7 @@ bool DocxConverter::convert(OOX::Logic::CTableCellProperties *oox_table_cell_pr, if ((border_inside_v || border_inside_h)) { - if (cell_properties->content_.common_border_attlist_.fo_border_)//раскидаем по сторонам + if (cell_properties->content_.common_border_attlist_.fo_border_)//distribute to sides { if (cell_properties->content_.common_border_attlist_.fo_border_->is_none() == false) { @@ -5484,7 +5484,7 @@ bool DocxConverter::convert(OOX::Logic::CTableCellProperties *oox_table_cell_pr, } cell_properties->content_.common_border_attlist_.fo_border_ = boost::none; } - //если нет убрать, если да - добавить + //if no remove, if yes - add if (border_inside_h) { int del_border = (int)border_inside_h->find(L"none"); diff --git a/OdfFile/Writer/Converter/MathConverter.cpp b/OdfFile/Writer/Converter/MathConverter.cpp index f415230cdc..6b8ac34d8b 100644 --- a/OdfFile/Writer/Converter/MathConverter.cpp +++ b/OdfFile/Writer/Converter/MathConverter.cpp @@ -151,13 +151,13 @@ namespace Oox2Odf return arrColor[index]; } - void OoxConverter::mrow() // обертка для тега <mrow> + void OoxConverter::mrow() // wrapper for <mrow> tag { CREATE_MATH_TAG(L"mrow"); OPEN_MATH_TAG(elm); } - void OoxConverter::endOfMrow() // закрывашка тега <mrow> + void OoxConverter::endOfMrow() // closing tag for <mrow> { CLOSE_MATH_TAG } @@ -1291,7 +1291,7 @@ namespace Oox2Odf OOX::Logic::CDelText* pDelText = dynamic_cast<OOX::Logic::CDelText*>(oox_mrun->m_arrItems[i]); convert(pDelText); }break; - case OOX::et_w_lastRenderedPageBreak: // не информативное .. может быть неверно записано + case OOX::et_w_lastRenderedPageBreak: // not informative.. may be incorrectly written { }break; case OOX::et_w_t: diff --git a/OdfFile/Writer/Converter/PptxConverter.cpp b/OdfFile/Writer/Converter/PptxConverter.cpp index e0e0e85995..ea05bbbf94 100644 --- a/OdfFile/Writer/Converter/PptxConverter.cpp +++ b/OdfFile/Writer/Converter/PptxConverter.cpp @@ -220,7 +220,7 @@ bool PptxConverter::convertDocument() convert_masters_and_layouts(); convert_slides(); - //удалим уже ненужный документ pptx + // delete no longer needed pptx document delete pptx_document; pptx_document = NULL; odp_context->end_document(); @@ -256,13 +256,13 @@ void PptxConverter::convert_styles() OoxConverter::convert(presentation->defaultTextStyle->levels[0].GetPointer(), paragraph_properties, text_properties); //default text } - //convert(presentation->defaultTextStyle.GetPointer()); //стили дефалтовых списков + //convert(presentation->defaultTextStyle.GetPointer()); // default list styles /////////////////////////////////////////////////////////////////////////// odp_context->styles_context()->create_default_style(odf_types::style_family::Table); odf_writer::style_table_properties * table_properties = odp_context->styles_context()->last_state()->get_table_properties(); - //для красивой отрисовки в редакторах - разрешим объеденить стили пересекающихся обрамлений + // for nice rendering in editors - allow merging styles of overlapping borders table_properties->content_.table_border_model_ = odf_types::border_model(odf_types::border_model::Collapsing); odp_context->styles_context()->create_default_style(odf_types::style_family::TableRow); @@ -270,7 +270,7 @@ void PptxConverter::convert_styles() row_properties->style_table_row_properties_attlist_.fo_keep_together_ = odf_types::keep_together(odf_types::keep_together::Auto); ///////////////////////////////////////////////////////////////////////////////////////////////// - //зачемто ?! для OpenOffice для врезок/фреймов нужен базовый стиль - без него другой тип геометрии oO !!! + // for some reason?! OpenOffice needs base style for inserts/frames - without it different geometry type o_O !!! odp_context->styles_context()->create_style(L"Frame", odf_types::style_family::Graphic, false, true); odf_writer::graphic_format_properties * frame_graphic_properties = odp_context->styles_context()->last_state()->get_graphic_properties(); @@ -1358,14 +1358,14 @@ void PptxConverter::convert_slides() { for (size_t i = 0; i < presentation->sldIdLst.size(); ++i) { - odp_context->map_table_styles_.clear();// todooo - для одинаковых тем не чистить + odp_context->map_table_styles_.clear();// todooo - don't clear for same themes std::wstring rId = presentation->sldIdLst[i].rid.get(); smart_ptr<PPTX::Slide> slide = ((*presentation)[rId]).smart_dynamic_cast<PPTX::Slide>(); if (slide.IsInit() == false) { - continue;// странное ... слайд 38 в FY10_September_Partner_Call.pptx + continue;// strange... slide 38 in FY10_September_Partner_Call.pptx } current_theme = slide->theme.GetPointer(); @@ -1442,7 +1442,7 @@ void PptxConverter::convert_slides() } pFind = m_mapLayouts.find(slide->Layout->m_sOutputFilename); if (pFind == m_mapLayouts.end()) - {//сюда уже не попадет - выше + {// won't get here anymore - handled above odp_context->start_layout_slide(); convert_layout(&slide->Layout->cSld); odp_context->end_layout_slide(); @@ -2415,7 +2415,7 @@ bool PptxConverter::convert(PPTX::Logic::TableCellProperties *oox_table_cell_pr, if ((border_inside_v || border_inside_h)) { - if (cell_properties->content_.common_border_attlist_.fo_border_)//раскидаем по сторонам + if (cell_properties->content_.common_border_attlist_.fo_border_)// distribute to sides { if (cell_properties->content_.common_border_attlist_.fo_border_->is_none() == false) { @@ -2427,7 +2427,7 @@ bool PptxConverter::convert(PPTX::Logic::TableCellProperties *oox_table_cell_pr, } cell_properties->content_.common_border_attlist_.fo_border_ = boost::none; } - //если нет убрать, если да - добавить + // if no - remove, if yes - add if (border_inside_h) { bool del_border = (std::wstring::npos != border_inside_h->find(L"none")); @@ -2518,7 +2518,7 @@ void PptxConverter::convert(PPTX::Logic::TcBdr *oox_table_borders) { if (!oox_table_borders) return; - //НИ ГРАФИКА НИ СВОЙСТВА ЯЧЕЕК .. ПАРАГРАФ блять !! - идиетский odf !!! + // NEITHER GRAPHICS NOR CELL PROPERTIES.. PARAGRAPH damn!! - idiotic odf !!! //odf_writer::style_table_cell_properties *odf_cell_props = odp_context->styles_context()->last_state(odf_types::style_family::TableCell)->get_table_cell_properties(); odf_writer::paragraph_format_properties *odf_para_props = odp_context->styles_context()->last_state(odf_types::style_family::TableCell)->get_paragraph_properties(); @@ -2714,7 +2714,7 @@ void PptxConverter::convert(PPTX::Logic::Bg *oox_background) odf_writer::style* page_style_ = dynamic_cast<odf_writer::style*>(odp_context->current_slide().page_style_elm_.get()); odf_writer::style_drawing_page_properties* page_props = page_style_->content_.add_get_style_drawing_page_properties(); - //необязательно + // optional //if (page_props->content_.common_draw_fill_attlist_.draw_fill_image_name_) //{ // page_props->content_.draw_background_size_ = L"border"; @@ -2851,8 +2851,8 @@ void PptxConverter::convert_slide(PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxS pShape->Merge(update_shape); if (type == Slide && bPlaceholder && false == bTextPresent && update_shape.txBody.IsInit()) - // спец. для либры - чтобы она отображала плейсхолдеры на слайдах нормально! бл... - // изменение форматирования в плейсхолдере для данного слайда похерется + // special for libre - so it displays placeholders on slides normally! damn... + // formatting changes in placeholder for this slide will be lost { update_shape.txBody->Paragrs.clear(); } diff --git a/OdfFile/Writer/Converter/XlsxConverter.cpp b/OdfFile/Writer/Converter/XlsxConverter.cpp index 7c73ed9aed..d9c4a02a95 100644 --- a/OdfFile/Writer/Converter/XlsxConverter.cpp +++ b/OdfFile/Writer/Converter/XlsxConverter.cpp @@ -340,20 +340,20 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet) convert(oox_sheet->m_oSheetFormatPr.GetPointer()); convert(oox_sheet->m_oSheetPr.GetPointer()); ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//Предобработка - //гиперлинки +//Preprocessing + //hyperlinks for (size_t hyp = 0; oox_sheet->m_oHyperlinks.IsInit() && hyp < oox_sheet->m_oHyperlinks->m_arrItems.size(); hyp++) { convert(oox_sheet->m_oHyperlinks->m_arrItems[hyp],oox_sheet); } - //комментарии + //comments std::map<std::wstring, OOX::Spreadsheet::CCommentItem*>::iterator pos = oox_sheet->m_mapComments.begin(); while ( oox_sheet->m_mapComments.end() != pos ) { convert(pos->second); pos++; } - //todooo для оптимизации - перенести мержи в начало + //todooo for optimization - move merges to the beginning if (oox_sheet->m_oTableParts.IsInit()) { @@ -1561,7 +1561,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CRPr *oox_run_pr) text_properties->style_text_position_ = odf_types::text_position(+33.); break; case SimpleTypes::verticalalignrunSubscript: //text_properties->content_.style_text_position_ = odf_types::text_position(odf_types::text_position::Sub); break; - text_properties->style_text_position_ = odf_types::text_position(-33.); break;//по умолчанию 58% - хуже выглядит + text_properties->style_text_position_ = odf_types::text_position(-33.); break;//default 58% - looks worse } } if (oox_run_pr->m_oScheme.IsInit() && oox_run_pr->m_oScheme->m_oFontScheme.IsInit()) @@ -1687,7 +1687,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CCol *oox_column) } else { - //нужно добавить дефолтный стиль для ячеек ДАННОГО листа + //need to add default style for cells of THIS sheet //??? style_cell_name= ods_context->styles_context()->find_odf_style_name_default(odf_types::style_family::TableCell); } @@ -1861,9 +1861,9 @@ void XlsxConverter::convert(OOX::Spreadsheet::CSheetViews *oox_sheet_views) if (selection->m_oSqref.IsInit()) { //D6:D9 I9:I12 M16:M21 C20:I24 - //в OpenOffice этого нету + //OpenOffice doesn't have this } - break; // в OpenOffice нет множественного селекта + break; // OpenOffice doesn't have multiple selection } if (sheet_view->m_oPane.IsInit()) { @@ -1943,7 +1943,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CPrintOptions *oox_print_options) { ods_context->page_layout_context()->set_page_print_gridLines(oox_print_options->m_oGridLines->ToBool()); } - //if (oox_print_options->m_oGridLinesSet.IsInit()) дублирование + //if (oox_print_options->m_oGridLinesSet.IsInit()) duplication //{ // ods_context->page_layout_context()->set_page_print_gridLinesSet(oox_print_options->m_oGridLines->ToBool()); //} @@ -2119,7 +2119,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CSheetFormatPr *oox_sheet_format_p //nullable<SimpleTypes::COnOff<>> m_oThickTop; //nullable<SimpleTypes::COnOff<>> m_oZeroHeight; //Cell default//////////////////////////// - ////пока не красиво :( и главное НЕПРАВИЛЬНО c чегой то раз первый - то и делтный ???? - НЕФИГА - хз чё делать :( + ////not pretty yet :( and most importantly WRONG - why is the first one the default ???? - NO WAY - no idea what to do :( //odf_writer::odf_style_state_ptr default_cell_style; //ods_context->styles_context()->find_odf_style_state(0,odf_types::style_family::TableCell, default_cell_style, true); //if (default_cell_style) ods_context->styles_context()->add_default(default_cell_style); @@ -2136,7 +2136,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CSheetFormatPr *oox_sheet_format_p double defaut_column_width_sym_ = 9.08984375; bool padding = false; - //в xlsx необязательно задавать ширину (колонок) - дефолтное по приложению. в oo - обязательно + //in xlsx column width is optional - default by application. in oo - required odf_writer::style* style = dynamic_cast<odf_writer::style*>(ods_context->styles_context()->last_state()->get_office_element().get()); if (style) { @@ -2184,7 +2184,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CSheetFormatPr *oox_sheet_format_p ods_context->current_table()->defaut_row_height_ = height;//pt row_properties->style_table_row_properties_attlist_.style_row_height_ = odf_types::length(odf_types::length(height,odf_types::length::pt).get_value_unit(odf_types::length::cm),odf_types::length::cm); } - //row_properties->style_table_row_properties_attlist_.style_use_optimal_row_height_ = true; - UTF-8''Отчет о развертывании-1.xlsx + //row_properties->style_table_row_properties_attlist_.style_use_optimal_row_height_ = true; - UTF-8''Deployment-Report-1.xlsx row_properties->style_table_row_properties_attlist_.common_break_attlist_.fo_break_before_ = odf_types::fo_break(odf_types::fo_break::Auto); } } @@ -2205,16 +2205,16 @@ void XlsxConverter::convert_styles() if (xlsx_flat_document) xlsx_styles = xlsx_flat_document->m_pStyles.GetPointer(); if (!xlsx_styles)return; -//todooo ?? стоит ли обращать на параметр Count ?? -////////////форматы данных +//todooo ?? should we pay attention to the Count parameter ?? +////////////data formats for (size_t i = 0; xlsx_styles->m_oNumFmts.IsInit() && i < xlsx_styles->m_oNumFmts->m_arrItems.size(); i++) { convert(xlsx_styles->m_oNumFmts->m_arrItems[i]); } -/////////////стили ячеек +/////////////cell styles for (size_t i = 0; xlsx_styles->m_oCellStyleXfs.IsInit() && i < xlsx_styles->m_oCellStyleXfs->m_arrItems.size(); i++) { - //automatical, root - noname - они тока для named + //automatical, root - noname - they are only for named convert(xlsx_styles->m_oCellStyleXfs->m_arrItems[i] , i, true, true); } for (size_t i = 0; xlsx_styles->m_oCellStyles.IsInit() && i < xlsx_styles->m_oCellStyles->m_arrItems.size(); i++)//styles.xml @@ -2223,14 +2223,14 @@ void XlsxConverter::convert_styles() convert(xlsx_styles->m_oCellStyles->m_arrItems[i]); } - //кастомные стили ячеек + //custom cell styles for (size_t i = 0; xlsx_styles->m_oCellXfs.IsInit() && i < xlsx_styles->m_oCellXfs->m_arrItems.size(); i++) { //automatical, non root convert(xlsx_styles->m_oCellXfs->m_arrItems[i], i, true, false); } -////////////стили условного форматирования +////////////conditional formatting styles for (size_t i = 0; xlsx_styles->m_oDxfs.IsInit() && i < xlsx_styles->m_oDxfs->m_arrItems.size(); i++) { convert(xlsx_styles->m_oDxfs->m_arrItems[i], i); @@ -2311,7 +2311,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CFont *font, odf_writer::text_form text_properties->style_text_position_ = odf_types::text_position(+33.); break; case SimpleTypes::verticalalignrunSubscript: //text_properties->content_.style_text_position_ = odf_types::text_position(odf_types::text_position::Sub); break; - text_properties->style_text_position_ = odf_types::text_position(-33.); break;//по умолчанию 58% - хуже выглядит + text_properties->style_text_position_ = odf_types::text_position(-33.); break;//default 58% - looks worse } } if (font->m_oScheme.IsInit() && font->m_oScheme->m_oFontScheme.IsInit()) @@ -2335,7 +2335,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CFont *font, odf_writer::text_form void XlsxConverter::convert(double oox_size, _CP_OPT(odf_types::length) & odf_size) { - //нужно сделать преобразования типов oox_size + //need to convert oox_size types //??? odf_size = odf_types::length(oox_size, odf_types::length::pt); } @@ -2447,7 +2447,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CAligment *aligment, odf_writer::p cell_properties->content_.common_rotation_angle_attlist_.style_rotation_angle_ = *aligment->m_oTextRotation; cell_properties->content_.style_rotation_align_= odf_types::rotation_align(odf_types::rotation_align::Bottom); } - else if (*aligment->m_oTextRotation == 0xff)//вертикальный текст + else if (*aligment->m_oTextRotation == 0xff)//vertical text cell_properties->content_.style_direction_ = odf_types::direction(odf_types::direction::Ttb); } @@ -2630,7 +2630,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CBorderProp *borderProp, std::wstr odf_border_prop = border_style + border_color; } -void XlsxConverter::convert(OOX::Spreadsheet::CColor *color, _CP_OPT(odf_types::color) & odf_color)//стоит ли сюда тащить odf_writer type??? +void XlsxConverter::convert(OOX::Spreadsheet::CColor *color, _CP_OPT(odf_types::color) & odf_color)//should we drag odf_writer type here??? { odf_color = boost::none; @@ -2729,8 +2729,8 @@ void XlsxConverter::convert(OOX::Spreadsheet::CCellStyle * cell_style) //if (parent_id >=0) // ods_context->styles_context()->last_state()->set_parent_style_name(ods_context->styles_context()->find_odf_style_name(parent_id, odf_types::style_family::TableCell,true, true)); - //фишечка либры и оо - они НЕ ЧИТАЮТ автоматические стили для стилей - //придется копировать свойства все .. они автоматические стили удалить (не сохранять в файл) + //quirk of LibreOffice and OO - they DON'T READ automatic styles for styles + //will have to copy all properties .. they remove automatic styles (don't save to file) odf_writer::odf_style_state_ptr parent_style_state; if (ods_context->styles_context()->find_odf_style_state(parent_id, odf_types::style_family::TableCell, parent_style_state, true, true) && parent_style_state) @@ -2856,7 +2856,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CXfs * xfc_style, int oox_id, bool odf_writer::odf_style_state_ptr parent_style_state; if (ods_context->styles_context()->find_odf_style_state(id_parent, odf_types::style_family::TableCell,parent_style_state, true, false) - && parent_style_state) // сначала в поименованных + && parent_style_state) // first in named ones { ods_context->styles_context()->last_state()->set_parent_style_name(parent_style_state->get_name()); @@ -2967,7 +2967,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CDrawing *oox_drawing, OOX::Spread boost::unordered_map<unsigned int, OOX::Spreadsheet::COleObject*>::const_iterator pFind = oox_sheet->m_oOleObjects->m_mapOleObjects.find(oox_anchor->m_nId.get()); if (pFind != oox_sheet->m_oOleObjects->m_mapOleObjects.end()) { - //??? перенести даные привязки + //??? transfer binding data oox_anchor->m_bShapeOle = true; continue; } @@ -2977,7 +2977,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CDrawing *oox_drawing, OOX::Spread std::map<unsigned int, nullable<OOX::Spreadsheet::CControl>>::const_iterator pFind = oox_sheet->m_oControls->m_mapControls.find(oox_anchor->m_nId.get()); if (pFind != oox_sheet->m_oControls->m_mapControls.end()) { - //??? перенести даные привязки + //??? transfer binding data oox_anchor->m_bShapeControl = true; continue; } @@ -3078,7 +3078,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::COleObjects *oox_objects, OOX::Spr if (!sIdImageFileCache.empty()) { - //ищем физический файл ( rId относительно vml_drawing) + //looking for physical file (rId relative to vml_drawing) smart_ptr<OOX::CVmlDrawing> oVmlDrawing = oox_sheet->Find(oox_sheet->m_oLegacyDrawing->m_oId->GetValue()).smart_dynamic_cast<OOX::CVmlDrawing>(); smart_ptr<OOX::File> pFile = oVmlDrawing->Find(sIdImageFileCache); @@ -3133,7 +3133,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CControls *oox_controls, OOX::Spre if (pControl->m_oRid.IsInit()) { - pFileControl = oox_sheet->Find(OOX::RId(pControl->m_oRid->GetValue()));// rId относительно sheet + pFileControl = oox_sheet->Find(OOX::RId(pControl->m_oRid->GetValue()));// rId relative to sheet } if (false == pFileControl.IsInit()) continue; diff --git a/OdfFile/Writer/Format/anim_elements.cpp b/OdfFile/Writer/Format/anim_elements.cpp index 76a7859736..3d9780d17c 100644 --- a/OdfFile/Writer/Format/anim_elements.cpp +++ b/OdfFile/Writer/Format/anim_elements.cpp @@ -53,7 +53,7 @@ void anim_par::create_child_element(const std::wstring & Ns, const std::wstring if CP_CHECK_NAME(L"anim", L"par") CP_CREATE_ELEMENT(anim_par_); else if CP_CHECK_NAME(L"anim", L"seq") - CP_CREATE_ELEMENT(anim_seq_array_);//более 1 элемента- взаимосвязанная анимация (между фигурами) + CP_CREATE_ELEMENT(anim_seq_array_);// more than 1 element - interconnected animation (between shapes) else CP_CREATE_ELEMENT(content_); } diff --git a/OdfFile/Writer/Format/anim_elements.h b/OdfFile/Writer/Format/anim_elements.h index e19bd1e247..5225b83843 100644 --- a/OdfFile/Writer/Format/anim_elements.h +++ b/OdfFile/Writer/Format/anim_elements.h @@ -44,7 +44,7 @@ namespace cpdoccore { namespace odf_writer { -class anim_par : public office_element_impl<anim_par>//Параллельные анимации +class anim_par : public office_element_impl<anim_par>// Parallel animations { public: static const wchar_t * ns; @@ -66,7 +66,7 @@ public: }; CP_REGISTER_OFFICE_ELEMENT2(anim_par); -class anim_seq : public office_element_impl<anim_seq>//Последовательные анимации +class anim_seq : public office_element_impl<anim_seq>// Sequential animations { public: static const wchar_t * ns; diff --git a/OdfFile/Writer/Format/draw_frame.cpp b/OdfFile/Writer/Format/draw_frame.cpp index 3f09673d57..eddbfdbc6b 100644 --- a/OdfFile/Writer/Format/draw_frame.cpp +++ b/OdfFile/Writer/Format/draw_frame.cpp @@ -168,7 +168,7 @@ void draw_g::serialize(std::wostream & _Wostream) { if (!common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_name_) common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_name_ = L""; - //брееед ... иначе либра не показывает группу!!! + //nonsense... otherwise LibreOffice doesn't show the group!!! CP_XML_ATTR_OPT(L"xml:id", xml_id_); CP_XML_ATTR_OPT(L"draw:id", xml_id_); @@ -215,8 +215,8 @@ void draw_frame::serialize(std::wostream & _Wostream) void draw_frame::create_child_element( const std::wstring & Ns, const std::wstring & Name) { if (CP_CHECK_NAME(L"draw", L"text-box") || - CP_CHECK_NAME(L"draw", L"image") ||//копия чарта в виде картинки ну.. или просто картинка - CP_CHECK_NAME(L"draw", L"object") ||//месторасположение чарта + CP_CHECK_NAME(L"draw", L"image") ||//chart copy as image or.. just an image + CP_CHECK_NAME(L"draw", L"object") ||//chart location CP_CHECK_NAME(L"draw", L"object-ole") || CP_CHECK_NAME(L"draw", L"applet") || CP_CHECK_NAME(L"draw", L"floating-frame") || diff --git a/OdfFile/Writer/Format/draw_frame.h b/OdfFile/Writer/Format/draw_frame.h index b80e7ff524..2bc0cbf5d2 100644 --- a/OdfFile/Writer/Format/draw_frame.h +++ b/OdfFile/Writer/Format/draw_frame.h @@ -87,7 +87,7 @@ public: CP_REGISTER_OFFICE_ELEMENT2(draw_image) ////////////////////////////////////////////////////////////////////////////////////////////////////////// - //объект рисования не нужен .. нужно только место для фрэйма - сам чарт в другом месте + // drawing object is not needed.. only place for frame is needed - the chart itself is elsewhere class draw_chart : public office_element_impl<draw_chart> { public: @@ -114,7 +114,7 @@ CP_REGISTER_OFFICE_ELEMENT2(draw_chart) /////////////////////////////////////////////////////////////////////////////////////////////////////////////// class draw_frame : public draw_base -{ //для draw-text-box, draw-image, draw-object, draw-object-ole, draw-applet, draw-floating-frame, draw-plugin +{ // for draw-text-box, draw-image, draw-object, draw-object-ole, draw-applet, draw-floating-frame, draw-plugin public: static const wchar_t * ns; static const wchar_t * name; @@ -130,7 +130,7 @@ public: draw_frame_attlist draw_frame_attlist_; office_element_ptr office_event_listeners_; - // в content перенести нельзя - иначе событи будет добавляться не к этому объекту а следующему + // cannot move to content - otherwise event will be added to the next object, not this one office_element_ptr draw_glue_point_; office_element_ptr draw_image_map_; //office_element_ptr draw_chart_map_; diff --git a/OdfFile/Writer/Format/draw_shapes.cpp b/OdfFile/Writer/Format/draw_shapes.cpp index 49b8c3dc91..2ac8947a03 100644 --- a/OdfFile/Writer/Format/draw_shapes.cpp +++ b/OdfFile/Writer/Format/draw_shapes.cpp @@ -91,7 +91,7 @@ const wchar_t * draw_rect::name = L"rect"; void draw_rect::serialize(std::wostream & _Wostream) { - sub_type_ = 2;//todooo перекинуть + sub_type_ = 2;//todooo move/relocate CP_XML_WRITER(_Wostream) { CP_XML_NODE_SIMPLE() @@ -247,7 +247,7 @@ void draw_path::serialize(std::wostream & _Wostream) } } } -void draw_path::reset_svg_path()//todooo наоборот +void draw_path::reset_svg_path()//todooo reverse { //if (draw_path_attlist_.svg_d_) //{ @@ -273,7 +273,7 @@ void draw_path::reset_svg_path()//todooo наоборот // } // if (o_Polyline_pt.size()>0) // { - // //сформируем xml-oox сдесь ... а то придется плодить массивы в drawing .. хоть и не красиво.. + // //generate xml-oox here... otherwise will have to create arrays in drawing.. even if not pretty.. // std::wstringstream output_; // //svg_path::oox_serialize(output_, o_Polyline_pt); // additional_.push_back(odf_writer::_property(L"custom_path",output_.str())); @@ -336,7 +336,7 @@ void draw_polygon::reset_polygon_path() // } // if (o_Polyline_pt.size()>0) // { - // //сформируем xml-oox сдесь ... а то придется плодить массивы в drawing .. хоть и не красиво.. + // //generate xml-oox here... otherwise will have to create arrays in drawing.. even if not pretty.. // std::wstringstream output_; // svg_path::oox_serialize(output_, o_Polyline_pt); // additional_.push_back(odf_writer::_property(L"custom_path",output_.str())); @@ -543,7 +543,7 @@ const wchar_t * draw_connector::name = L"connector"; void draw_connector::serialize(std::wostream & _Wostream) { - sub_type_ = 9; //коннектор - линия, если ломаная (ниже определяется) - то путь + sub_type_ = 9; //connector - line, if polyline (determined below) - then path reset_svg_path(); @@ -590,7 +590,7 @@ void draw_connector::reset_svg_path() // if (o_Polyline_pt.size()>0) // { // sub_type_ = 6; - // //сформируем xml-oox сдесь ... а то придется плодить массивы в drawing .. хоть и не красиво.. + // //generate xml-oox here... otherwise will have to create arrays in drawing.. even if not pretty.. // std::wstringstream output_; // svg_path::oox_serialize(output_, o_Polyline_pt); // additional_.push_back(odf_writer::_property(L"custom_path",output_.str())); diff --git a/OdfFile/Writer/Format/draw_shapes.h b/OdfFile/Writer/Format/draw_shapes.h index de272fb8e2..fedbdc8932 100644 --- a/OdfFile/Writer/Format/draw_shapes.h +++ b/OdfFile/Writer/Format/draw_shapes.h @@ -52,7 +52,7 @@ public: odf_types::common_xlink_attlist common_xlink_attlist_; - _CP_OPT(std::wstring) draw_id_;//используется для анимашек + _CP_OPT(std::wstring) draw_id_;// used for animations int sub_type_; }; @@ -200,7 +200,7 @@ public: draw_polygon_attlist draw_polygon_attlist_; - void reset_polygon_path();//частный случай svg - все точки соединены прямыми + void reset_polygon_path();// special case of svg - all points connected by straight lines }; CP_REGISTER_OFFICE_ELEMENT2(draw_polygon); @@ -226,7 +226,7 @@ CP_REGISTER_OFFICE_ELEMENT2(draw_custom_shape); //---------------------------------------------------------------------------------------------- //draw:enhanced-geometry //---------------------------------------------------------------------------------------------- -class draw_equation_attlist//убрать стринги ... сделать парсинг см стр 378 оазис !!!!!!!!!!! +class draw_equation_attlist// remove strings... implement parsing see page 378 oasis !!!!!!!!!!! { public: _CP_OPT(std::wstring) draw_name_; @@ -262,7 +262,7 @@ struct draw_handle_geometry int max; }; //---------------------------------------------------------------------------------------------- -class draw_handle_attlist//убрать стринги ... сделать парсинг см стр 378 оазис !!!!!!!!!!! +class draw_handle_attlist// remove strings... implement parsing see page 378 oasis !!!!!!!!!!! { public: _CP_OPT(std::wstring) draw_handle_position_; @@ -352,13 +352,13 @@ public: typedef std::pair<std::wstring,std::wstring> pair_string_value; - std::vector<draw_handle_geometry> draw_handle_geometry_; //параметры в удобноваримом виде + std::vector<draw_handle_geometry> draw_handle_geometry_; // parameters in digestible form std::vector<pair_string_value> draw_equation_array_; - + office_element_ptr_array draw_handle_; - office_element_ptr_array draw_equation_;//некоторые заданные параметры отрисовки которые используются в draw_handle - автозамена общих частей - - static int parsing(_CP_OPT(std::wstring) val);//todoooo наоборот + office_element_ptr_array draw_equation_;// some specified drawing parameters used in draw_handle - auto-replacement of common parts + + static int parsing(_CP_OPT(std::wstring) val);// todooo vice versa }; diff --git a/OdfFile/Writer/Format/number_style.cpp b/OdfFile/Writer/Format/number_style.cpp index 6aa15924ae..4a08606d8b 100644 --- a/OdfFile/Writer/Format/number_style.cpp +++ b/OdfFile/Writer/Format/number_style.cpp @@ -446,7 +446,7 @@ void number_percentage_style::serialize(std::wostream & strm) namespace { - //todooo - сделать наоборот string -> в свойства + //todooo - do the opposite string -> to properties void format_number_number( std::wostream & strm, bool number_grouping_, diff --git a/OdfFile/Writer/Format/object_package.cpp b/OdfFile/Writer/Format/object_package.cpp index 73d60d4f0c..76bf5dc331 100644 --- a/OdfFile/Writer/Format/object_package.cpp +++ b/OdfFile/Writer/Format/object_package.cpp @@ -433,7 +433,7 @@ namespace odf_writer if (items[i].type == type_) { OOX::CPath file_name_inp ( items[i].oox_ref); - OOX::CPath file_name_out ( RootPath + FILE_SEPARATOR_STR + items[i].odf_ref); //ref содержит уже folder_ + OOX::CPath file_name_out ( RootPath + FILE_SEPARATOR_STR + items[i].odf_ref); //ref already contains folder_ NSFile::CFileBinary::Copy(file_name_inp.GetPath(), file_name_out.GetPath()); } diff --git a/OdfFile/Writer/Format/odf_chart_context.cpp b/OdfFile/Writer/Format/odf_chart_context.cpp index 9e07bf202b..9b16091e06 100644 --- a/OdfFile/Writer/Format/odf_chart_context.cpp +++ b/OdfFile/Writer/Format/odf_chart_context.cpp @@ -66,7 +66,7 @@ namespace odf_writer static const std::wstring default_MS_series_colors[] = { L"#355a86", L"#883533", L"#6e963c", L"#594573", L"#327a8d", L"#3d679a", L"#9d3e3b", L"#7e9945", L"#674f84", L"#398ba2", L"#cb7934", - //todooo - продолжить .... пока копия первых + // todooo - continue.... for now copy of first ones L"#355a86", L"#883533", L"#6e963c", L"#594573", L"#327a8d", L"#3d679a", L"#9d3e3b", L"#7e9945", L"#674f84", L"#398ba2", L"#cb7934", L"#355a86", L"#883533", L"#6e963c", L"#594573", L"#327a8d", L"#3d679a", L"#9d3e3b", L"#7e9945", L"#674f84", L"#398ba2", L"#cb7934", L"#355a86", L"#883533", L"#6e963c", L"#594573", L"#327a8d", L"#3d679a", L"#9d3e3b", L"#7e9945", L"#674f84", L"#398ba2", L"#cb7934", @@ -193,8 +193,8 @@ public: bool local_table_enabled_; bool local_table_reset_ref_; - std::vector<odf_chart_level_state> current_level_; //постоянно меняющийся список уровней наследования - std::vector<odf_chart_state> chart_list_; //все элементы .. для удобства разделение по "топам" + std::vector<odf_chart_level_state> current_level_; // constantly changing list of inheritance levels + std::vector<odf_chart_state> chart_list_; // all elements.. for convenience separated by "tops" //////// void set_default_series_color(); void clear_current(); @@ -229,7 +229,7 @@ std::wstring odf_chart_context::Impl::convert_formula(std::wstring oox_ref) //remove table name if (!refs.empty()) { - size_t pos = refs[0].rfind(L"!");//в имени таблички может быть... + size_t pos = refs[0].rfind(L"!");// may be in table name... if (std::wstring::npos != pos) { refs[0] = L"local-table!" + refs[0].substr(pos + 1, refs[0].size() - pos); @@ -255,7 +255,7 @@ std::wstring odf_chart_context::Impl::convert_formula(std::wstring oox_ref) else { //open office dont support defined names in chart formula - // 7501214.xlsx - частичное заполнение local-table + // 7501214.xlsx - partial filling of local-table int col = -1, row = -1; utils::parsing_ref( refs[0], col, row); @@ -444,7 +444,7 @@ void odf_chart_context::set_chart_bar_type(int type) } if (type == -1) { - //нужно вытащить свойство с уровня выше. + // need to get property from higher level. size_t sz = impl_->current_level_.size(); if (sz > 1) impl_->current_level_.back().chart_properties->solid_type_ = @@ -758,7 +758,7 @@ void odf_chart_context::start_series(odf_types::chart_class::type type) impl_->series_.push_back(elm); impl_->group_series_.push_back(elm); - //может хранить отдельно общий класс чарта?? + // maybe store common chart class separately?? if (type == chart_class::radar || (impl_->get_current_chart_class() == chart_class::stock && type == chart_class::line)) { series->chart_series_attlist_.chart_class_ = impl_->get_current_chart_class(); @@ -792,7 +792,7 @@ void odf_chart_context::set_label_show_leader_line(bool val) void odf_chart_context::set_label_show_legend_key(bool val) { } -void odf_chart_context::set_label_formula(const std::wstring & oox_ref) //в odf не поддерживается +void odf_chart_context::set_label_formula(const std::wstring & oox_ref) // not supported in odf { std::wstring odf_ref = impl_->convert_formula(oox_ref); @@ -821,7 +821,7 @@ void odf_chart_context::add_axis_group_series(unsigned int id) void odf_chart_context::end_group_series() { if (impl_->axis_.empty() && false == impl_->categories_.empty()) - {//без осей нихера не понимает MS Office !!! - причем оси для MS должны идти обязательно перед сериями + {// MS Office doesn't understand anything without axes!!! - also axes for MS must go before series start_axis(); set_axis_dimension(1); end_element(); @@ -864,7 +864,7 @@ void odf_chart_context::end_group_series() { if (impl_->axis_[j].oox_id == impl_->axis_group_series_[i] && impl_->axis_[j].dimension ==2) { - axis_name = impl_->axis_[j].name;//привязка оси Y + axis_name = impl_->axis_[j].name;// Y axis binding break; } } @@ -1123,7 +1123,7 @@ void odf_chart_context::end_plot_area() { cell_range = cell_range + impl_->data_cell_ranges_[i].ref + L" "; } - //plot_area->chart_plot_area_attlist_.table_cell_range_address_ = cell_range; - точно для локальной диагр это лишнее!!! + //plot_area->chart_plot_area_attlist_.table_cell_range_address_ = cell_range; - definitely unnecessary for local chart!!! } end_element(); } @@ -1625,7 +1625,7 @@ void odf_chart_context::start_element(office_element_ptr & elm, office_element_p size_t level = impl_->current_level_.size(); drawing_context()->start_element(elm, style_elm); - //if (!impl_->current_level_.empty()) impl_->current_level_.back()->add_child_element(elm); не надо...наследование через start_element в drawing + //if (!impl_->current_level_.empty()) impl_->current_level_.back()->add_child_element(elm); not needed...inheritance through start_element in drawing odf_element_state state = {elm, style_name, style_elm, level, 0}; impl_->current_chart_state_.elements_.push_back(state); @@ -1751,7 +1751,7 @@ void odf_chart_context::set_category_axis_formula(const std::wstring & oox_ref, impl_->categories_.push_back(category_state); } -void odf_chart_context::set_series_pie_explosion(int val)//или точка серии +void odf_chart_context::set_series_pie_explosion(int val)// or series point { if (!impl_->current_level_.back().chart_properties)return; @@ -1859,7 +1859,7 @@ void odf_chart_context::set_cash(std::wstring format_code, std::vector<std::wstr } if(ref.empty() && !data_str.empty()) { - // банальнейшая генерация А1 ... Аххх + // simplest A1 ... Axxx generation ref = std::wstring(L"local-table.A1:") + std::wstring(L".A") + boost::lexical_cast<std::wstring>(data_str.size()); } @@ -1994,7 +1994,7 @@ void odf_chart_context::Impl::create_local_table() int min_col = 0xffff; int min_row = 0xffff; - //выкинем дублирующие ref + // remove duplicate refs for (size_t i = 0; i < cash_.size(); i++) { for (size_t j = i + 1; j < cash_.size(); j++) @@ -2015,7 +2015,7 @@ void odf_chart_context::Impl::create_local_table() if (refs.size() < 1) continue; - size_t r = refs[0].rfind(L".");//в имени таблички может быть точка + size_t r = refs[0].rfind(L".");// there may be a dot in table name if (std::wstring::npos != r) { table_name = refs[0].substr (0, r); diff --git a/OdfFile/Writer/Format/odf_controls_context.cpp b/OdfFile/Writer/Format/odf_controls_context.cpp index e1ee26a09d..4a358bd600 100644 --- a/OdfFile/Writer/Format/odf_controls_context.cpp +++ b/OdfFile/Writer/Format/odf_controls_context.cpp @@ -390,7 +390,7 @@ bool odf_controls_context::is_exist_content() return (impl_->controls_.empty() ? false : true); } -void odf_controls_context::finalize(office_element_ptr & root_elm)//для привязки +void odf_controls_context::finalize(office_element_ptr & root_elm)//for binding { if (impl_->controls_.empty()) return; diff --git a/OdfFile/Writer/Format/odf_conversion_context.cpp b/OdfFile/Writer/Format/odf_conversion_context.cpp index 22dd960b6f..7ee8dbadcd 100644 --- a/OdfFile/Writer/Format/odf_conversion_context.cpp +++ b/OdfFile/Writer/Format/odf_conversion_context.cpp @@ -232,7 +232,7 @@ void odf_conversion_context::end_document() //------------------------ package::content_simple_ptr content_style_ = package::content_simple::create(); for (size_t i = 0; i < object.styles.size(); i++) - {// мастер-пейджы, заданные заливки (градиенты, битмапы), дефолтные стили, колонтитулы, разметки, заметки,... + {// master pages, defined fills (gradients, bitmaps), default styles, headers/footers, layouts, notes,... object.styles[i]->serialize(content_style_->content()); } //------------------------ @@ -393,7 +393,7 @@ bool odf_conversion_context::start_math(int base_font_size, const std::wstring& drawing_context()->set_anchor(anchor_type::AsChar); } drawing_context()->start_object(get_next_name_object(), !math_context_.in_text_box_); - //имитация рисованного объекта - высота-ширина ???? + // imitation of drawn object - height-width ???? create_object(false); create_element(L"math", L"math", objects_.back()->content, this, true); @@ -411,12 +411,12 @@ void odf_conversion_context::end_math() end_object(); - calculate_font_metrix(math_context_.font_name, math_context_.font_size, false, false, true); // смотреть по формуле - перевычислять только если есть изменения это шрифт и кегль + calculate_font_metrix(math_context_.font_name, math_context_.font_size, false, false, true); // look at formula - recalculate only if there are changes in font and size double h = math_context_.lvl_max - math_context_.lvl_min; if (math_context_.lvl_min < 0) h += 1; - _CP_OPT(double)width = convert_symbol_width(math_context_.symbol_counter * 1.2, true); // либра рамка формулы(её параметры) + _CP_OPT(double)width = convert_symbol_width(math_context_.symbol_counter * 1.2, true); // libre formula frame (its parameters) _CP_OPT(double)height = convert_symbol_width(1.76 * h, true); if (false == math_context_.in_text_box_) @@ -496,9 +496,9 @@ void odf_conversion_context::process_styles(_object & object, bool isRoot) } } - object.styles.push_back(object.content_styles.back()); //копия + object.styles.push_back(object.content_styles.back()); // copy - create_element(L"office", L"styles", object.styles, this, true);//общие стили + create_element(L"office", L"styles", object.styles, this, true);// common styles object.style_context->process_office_styles(object.styles.back()); page_layout_context()->process_office_styles(object.styles.back()); diff --git a/OdfFile/Writer/Format/odf_drawing_context.cpp b/OdfFile/Writer/Format/odf_drawing_context.cpp index 2756edb15b..48d2a5f316 100644 --- a/OdfFile/Writer/Format/odf_drawing_context.cpp +++ b/OdfFile/Writer/Format/odf_drawing_context.cpp @@ -297,14 +297,14 @@ public: is_footer_ = false; is_background_ = false; placeholder_replacing = false; - //некоторые свойства для объектов графики не поддерживаюися в редакторах Libre && OpenOffice.net - //в MS Office и в нашем - проблем таких нет. + //some properties for graphics objects are not supported in Libre && OpenOffice.net editors + //in MS Office and ours - no such problems. } odf_drawing_state current_drawing_state_; _drawing_part current_drawing_part_; - std::vector<odf_level_state> current_level_; //постоянно меняющийся список уровней наследования + std::vector<odf_level_state> current_level_; //constantly changing list of inheritance levels odf_style_context_ptr styles_context_; odf_conversion_context *odf_context_; @@ -328,8 +328,8 @@ public: odf_group_state_ptr current_group_; - std::vector<odf_group_state_ptr> group_list_; //группы - std::vector<odf_drawing_state> drawing_list_; //все элементы(кроме групп) .. для удобства разделение по "топам" + std::vector<odf_group_state_ptr> group_list_; //groups + std::vector<odf_drawing_state> drawing_list_; //all elements (except groups).. for convenience separated by "tops" std::vector<office_element_ptr> tops_elements_; @@ -396,7 +396,7 @@ void odf_drawing_context::check_anchor() if ((/*impl_->is_footer_ || impl_->is_header_ ||*/ impl_->is_background_) && (impl_->anchor_settings_.run_through_) && (impl_->anchor_settings_.run_through_->get_type() == run_through::Background)) { set_anchor(anchor_type::Char); - //подозрительно на подложку страницы + //looks like page background impl_->anchor_settings_.style_wrap_ = style_wrap(style_wrap::RunThrough); impl_->anchor_settings_.run_through_ = run_through(run_through::Background); @@ -427,7 +427,7 @@ void odf_drawing_context::start_group() if (group == NULL) return; - //если группа топовая - то данные если не записать - сотрутся + //if group is top-level - data will be lost if not written if (!impl_->current_drawing_state_.name_.empty()) group->common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_name_ = impl_->current_drawing_state_.name_; else @@ -573,7 +573,7 @@ void odf_drawing_context::set_anchor_drawing(graphic_format_properties *graphic_ { draw->common_draw_attlists_.shape_with_text_and_styles_.common_text_anchor_attlist_.type_ = impl_->anchor_settings_.anchor_type_; } - else if (graphic_properties) // libra падает + else if (graphic_properties) // LibreOffice crashes { graphic_properties->style_wrap_ = impl_->anchor_settings_.style_wrap_; graphic_properties->style_wrap_contour_ = impl_->anchor_settings_.style_wrap_contour_; @@ -728,7 +728,7 @@ void odf_drawing_context::end_drawing() } }else { - //не поддерживается :( - нужно считать искажения на простейшие фигуры - линии, ректы, эллипсы + //not supported :( - need to calculate distortions for simple shapes - lines, rects, ellipses } //set_anchor_drawing(); @@ -743,7 +743,7 @@ void odf_drawing_context::end_drawing() if ( impl_->current_drawing_state_.elements_.empty() == false && impl_->current_drawing_state_.elements_[0].level == 0 - && impl_->current_drawing_state_.elements_[0].elm ) // не base_index -> см draw_a + && impl_->current_drawing_state_.elements_[0].elm ) // not base_index -> see draw_a { impl_->tops_elements_.push_back(impl_->current_drawing_state_.elements_[0].elm); } @@ -866,7 +866,7 @@ void odf_drawing_context::start_shape(int ooxDrawPreset) } else if (ooxDrawPreset == 1000) { - impl_->create_draw_base(drawCustom);//пока кастом .. потом переделать на path, что правильнее + impl_->create_draw_base(drawCustom);//custom for now.. later rework to path, which is more correct } else if (ooxDrawPreset == 1001) { @@ -933,7 +933,7 @@ bool odf_drawing_context::change_text_box_2_wordart() size_t sz_state = impl_->current_drawing_state_.elements_.size(); if (sz_state < 2) return false; - if (sz > 2) //в группе ?? + if (sz > 2) //in group ?? { draw_base* draw_old = dynamic_cast<draw_base*>(impl_->current_level_[sz-2].elm.get()); if (draw_old) @@ -980,7 +980,7 @@ bool odf_drawing_context::change_text_box_2_wordart() size_t sz_state = impl_->current_drawing_state_.elements_.size(); if (sz_state < 1) return false; - if (sz > 1) //в группе ?? + if (sz > 1) //in group ?? { draw_base* draw_old = dynamic_cast<draw_base*>(impl_->current_level_[sz - 1].elm.get()); if (draw_old) @@ -1022,7 +1022,7 @@ void odf_drawing_context::end_shape() if (impl_->current_drawing_state_.oox_shape_preset_ == 2000) return end_text_box(); if (impl_->current_drawing_state_.oox_shape_preset_ == 3000) return end_image(); - //вторичные, вычисляемые свойства шейпов + //secondary, computed shape properties if (isLineShape()) { @@ -1122,7 +1122,7 @@ void odf_drawing_context::end_shape() { sub_type = Shape_Types_Mapping[impl_->current_drawing_state_.oox_shape_preset_].first; } - else if (impl_->current_drawing_state_.oox_shape_preset_ > 2000 && impl_->current_drawing_state_.oox_shape_preset_ < 3000)// 3000 - все равно сюда не попадет + else if (impl_->current_drawing_state_.oox_shape_preset_ > 2000 && impl_->current_drawing_state_.oox_shape_preset_ < 3000)// 3000 - won't reach here anyway { text_shape = true; } @@ -1199,7 +1199,7 @@ void odf_drawing_context::end_shape() { enhanced->attlist_.draw_modifiers_ = impl_->current_drawing_state_.oox_shape_->modifiers; } - else // обязательно нужны дефолтовые + else // defaults are required enhanced->attlist_.draw_modifiers_ = shape_define->modifiers; if (!shape_define->enhanced_path.empty()) @@ -1346,7 +1346,7 @@ void odf_drawing_context::start_element(office_element_ptr elm, office_element_p { size_t level = impl_->current_level_.size(); - //если фейковый предыдущий уровень (для сохранения порядка выше) - привязывааем к уровню выше + //if previous level is fake (to preserve order above) - bind to higher level for (int i = (int)impl_->current_level_.size() - 1; elm && i >= 0; i--) { @@ -1618,7 +1618,7 @@ void odf_drawing_context::set_solid_fill(std::wstring hexColor) { impl_->current_graphic_properties->common_draw_fill_attlist_.draw_fill_color_ = hexColor; //impl_->current_graphic_properties->common_background_color_attlist_.fo_background_color_ = color(hexColor); - default transparent - //последнее нужно - что если будут вводить текст - под текстом будет цвет фона (или он поменяется в полях текста) + //the latter is needed - in case text is entered - background color will be under text (or it will change in text fields) if ((/*impl_->is_footer_ || impl_->is_header_ ||*/ impl_->is_background_) && (impl_->current_graphic_properties->common_draw_fill_attlist_.draw_fill_) && @@ -1667,7 +1667,7 @@ void odf_drawing_context::add_path_element(std::wstring command, std::wstring st XmlUtils::replace_all(strE, L"gd", L"?f"); if (command != impl_->current_drawing_state_.path_last_command_ - || command == L"M") // NOTE: Две последовательые команды "Move" должны быть записаны без сокращений (включая команду "M" для каждого мува) + || command == L"M") // NOTE: Two consecutive "Move" commands must be written without abbreviations (including "M" command for each move) { impl_->current_drawing_state_.path_ += command; if (!strE.empty()) @@ -1919,9 +1919,9 @@ void odf_drawing_context::set_rotate(double dVal) impl_->current_drawing_state_.rotateAngle_ = dRotate; } -void odf_drawing_context::set_drawings_rect(_CP_OPT(double) x_pt, _CP_OPT(double) y_pt, _CP_OPT(double) width_pt, _CP_OPT(double) height_pt)// "- 1" не задано +void odf_drawing_context::set_drawings_rect(_CP_OPT(double) x_pt, _CP_OPT(double) y_pt, _CP_OPT(double) width_pt, _CP_OPT(double) height_pt)// "- 1" not specified { - //хороший тон сохранить все размеры в см (хотя можно и в другой системе) + //good practice to save all sizes in cm (although other units are possible) if (x_pt) { impl_->x = *x_pt; @@ -2467,7 +2467,7 @@ std::wstring odf_drawing_context::add_marker_style(int type) if (impl_->styles_context_->find_odf_style(str_types[type],style_family::Marker,style_)) return str_types[type]; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// генерация типа маркера +// marker type generation odf_writer::office_element_ptr marker_element; odf_writer::create_element(L"draw",L"marker", marker_element, impl_->odf_context_); @@ -2513,7 +2513,7 @@ void odf_drawing_context::set_line_dash_preset(int style) if ((impl_->current_graphic_properties->draw_stroke_) && (impl_->current_graphic_properties->draw_stroke_->get_type() == line_style::None) )return; - switch(style) //+создать стиль, привзать имена + switch(style) //+create style, bind names { case 0://presetlinedashvalDash case 7://presetlinedashvalSysDash @@ -2560,7 +2560,7 @@ void odf_drawing_context::set_text_properties(text_format_properties* text_prope } } else - { //todooo - см set_parent_text_style (контент контроли) + { //todooo - see set_parent_text_style (content controls) } } } @@ -2744,7 +2744,7 @@ void odf_drawing_context::set_textarea_fontcolor(std::wstring hexColor) } void odf_drawing_context::set_textarea_writing_mode(int mode) { - if (mode == 1) return;//незачем + if (mode == 1) return;//no need if (impl_->current_drawing_state_.elements_.empty())return; if (impl_->current_drawing_state_.oox_shape_preset_ > 2000 && impl_->current_drawing_state_.oox_shape_preset_ < 3000) @@ -2803,7 +2803,7 @@ void odf_drawing_context::set_textarea_writing_mode(int mode) else { std::wstring style_name = *draw->common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_text_style_name_; - //найти + //find } if (style_ && !paragraph_properties) { @@ -2815,7 +2815,7 @@ void odf_drawing_context::set_textarea_writing_mode(int mode) { switch(mode) { - case 4://SimpleTypes::textverticaltypeVert270: //нужно отзеркалить по горизонтали текст + case 4://SimpleTypes::textverticaltypeVert270: //need to mirror text horizontally paragraph_properties->style_writing_mode_ = odf_types::writing_mode(odf_types::writing_mode::TbLr); break; case 5://textverticaltypeWordArtVert: @@ -2837,7 +2837,7 @@ void odf_drawing_context::set_textarea_writing_mode(int mode) { switch(mode) { - case 4://SimpleTypes::textverticaltypeVert270: //нужно отзеркалить по горизонтали текст + case 4://SimpleTypes::textverticaltypeVert270: //need to mirror text horizontally impl_->current_paragraph_properties->style_writing_mode_ = odf_types::writing_mode(odf_types::writing_mode::TbLr); break; case 5://textverticaltypeWordArtVert: @@ -2886,7 +2886,7 @@ void odf_drawing_context::start_image(std::wstring odf_path) start_frame(); - //добавить в стиль ссыль на базовый стиль Graphics - зачемто нужно :( + //add reference to base Graphics style - needed for some reason :( set_parent_style(L"Graphics"); /////////////////////////////////////////////////////////////////////////////////////////////// @@ -2941,8 +2941,8 @@ void odf_drawing_context::start_object(std::wstring name, bool in_frame) } else { - //remove text_box - он лишний (оставляя фейковый, который не запишется) - impl_->current_level_.back().elm = office_element_ptr(); // чтоб внутрении элементы добавлялись к тому что выше + //remove text_box - it's redundant (leaving fake one, which won't be written) + impl_->current_level_.back().elm = office_element_ptr(); // so inner elements are added to what's above } if (impl_->current_level_.size() > 1) { @@ -3308,8 +3308,8 @@ void odf_drawing_context::set_parent_style(std::wstring style_name) { if (impl_->current_drawing_state_.elements_.empty()) return; - //добавить в стиль ссыль на базовый стиль Frame - зачемто нужно для таблиц которые не инлайн - style* style_ = dynamic_cast<style*>(impl_->current_drawing_state_.elements_[0].style_elm.get()); // на "головной" элекмент + //add reference to base Frame style - needed for some reason for non-inline tables + style* style_ = dynamic_cast<style*>(impl_->current_drawing_state_.elements_[0].style_elm.get()); // to "main" element if (style_) { @@ -3467,7 +3467,7 @@ bool odf_drawing_context::is_current_empty() { return impl_->current_drawing_state_.elements_.empty(); } -void odf_drawing_context::finalize(office_element_ptr & root_elm)//для привязки +void odf_drawing_context::finalize(office_element_ptr & root_elm)//for binding { for (size_t i = 0; i < impl_->tops_elements_.size(); i++) { @@ -3485,7 +3485,7 @@ void odf_drawing_context::set_text(odf_text_context* text_context) { if (text_context == NULL || impl_->current_level_.empty() ) return; - if (!impl_->current_level_.back().elm) return; // фейковый текстбокс к примеру + if (!impl_->current_level_.back().elm) return; // fake textbox for example //if (impl_->is_presentation_ && *impl_->is_presentation_) return; @@ -3500,7 +3500,7 @@ void odf_drawing_context::set_text(odf_text_context* text_context) if ((impl_->current_graphic_properties) && !impl_->current_graphic_properties->draw_auto_grow_height_) { - //автоувеличение при добавлении текста + //auto-grow when adding text impl_->current_graphic_properties->draw_auto_grow_height_ = false; impl_->current_graphic_properties->draw_auto_grow_width_ = false; //impl_->current_graphic_properties->draw_fit_to_size_ = false;//??? @@ -3509,7 +3509,7 @@ void odf_drawing_context::set_text(odf_text_context* text_context) if (impl_->current_drawing_state_.oox_shape_preset_ > 2000 && impl_->current_drawing_state_.oox_shape_preset_ < 3000) { - //настройки цвета - перетащить в линии и заливки - так уж нужно wordart-у оо + //color settings - move to lines and fills - that's what OO wordart needs text_format_properties *text_properties_ = text_context->get_text_properties(); if (text_properties_) diff --git a/OdfFile/Writer/Format/odf_drawing_context.h b/OdfFile/Writer/Format/odf_drawing_context.h index 30f04aa4f2..adb99c1b5c 100644 --- a/OdfFile/Writer/Format/odf_drawing_context.h +++ b/OdfFile/Writer/Format/odf_drawing_context.h @@ -73,7 +73,7 @@ public: void set_drawings_rect (_CP_OPT(double) x_pt, _CP_OPT(double) y_pt, _CP_OPT(double) width_pt, _CP_OPT(double) height_pt); void clear (); - void set_styles_context (odf_style_context_ptr styles_context);//для embedded + void set_styles_context (odf_style_context_ptr styles_context);// for embedded void set_parent_style(std::wstring style_name); void set_parent_text_style(std::wstring style_name); @@ -172,7 +172,7 @@ public: void set_text_box_tableframe (bool val); void end_text_box (); - void start_object(std::wstring ref, bool in_frame = true); //формулы, диаграммы ... + void start_object(std::wstring ref, bool in_frame = true); // formulas, charts ... void end_object(bool in_frame = true); void start_object_ole(std::wstring ref); @@ -265,7 +265,7 @@ public: void set_line_color (std::wstring hexColor); //void start_shadow_properties(); //void end_shadow_properties(); -// пока одной функией .. +// for now with one function.. void set_shadow (int type, std::wstring hexColor, _CP_OPT(double) opacity, double dist_pt, double dist_pt_y = -1); void set_grayscale(); void set_white_balance(double red, double green, double blue); diff --git a/OdfFile/Writer/Format/odf_lists_styles_context.cpp b/OdfFile/Writer/Format/odf_lists_styles_context.cpp index 2af7f5e06b..8f62aa22eb 100644 --- a/OdfFile/Writer/Format/odf_lists_styles_context.cpp +++ b/OdfFile/Writer/Format/odf_lists_styles_context.cpp @@ -111,7 +111,7 @@ void odf_lists_styles_context::start_style(bool bMaster, int based_number) if (style == NULL)return; style->text_list_style_attr_.style_name_ = state.odf_list_style_name; - lists_format_array_.push_back(state); //перенести в end?? + lists_format_array_.push_back(state); // move to end?? } style_list_level_properties * odf_lists_styles_context::get_list_level_properties() diff --git a/OdfFile/Writer/Format/odf_math_context.cpp b/OdfFile/Writer/Format/odf_math_context.cpp index ac920dc089..1148a222b9 100644 --- a/OdfFile/Writer/Format/odf_math_context.cpp +++ b/OdfFile/Writer/Format/odf_math_context.cpp @@ -94,8 +94,8 @@ namespace odf_writer style_paragraph_properties *current_paragraph_properties; style_text_properties *current_text_properties; - std::vector<odf_math_level_state> current_level_; //постоянно меняющийся список уровней наследования - std::vector<odf_math_state> math_list_; //все элементы .. для удобства разделение по "топам" + std::vector<odf_math_level_state> current_level_; //constantly changing list of inheritance levels + std::vector<odf_math_state> math_list_; //all elements .. for convenience separated by "tops" odf_conversion_context *odf_context_; office_math *root_element_; diff --git a/OdfFile/Writer/Format/odf_number_styles_context.cpp b/OdfFile/Writer/Format/odf_number_styles_context.cpp index 2bd277e1a7..d564c83f48 100644 --- a/OdfFile/Writer/Format/odf_number_styles_context.cpp +++ b/OdfFile/Writer/Format/odf_number_styles_context.cpp @@ -319,7 +319,7 @@ void odf_number_styles_context::create_default(int oox_num_fmt, std::wstring for case 49: formatCode = L"@"; state.ods_type =office_value_type::String; break; default: -/////////////////////////////////// с неопределенным formatCode .. он задается в файле +/////////////////////////////////// with undefined formatCode.. it is set in file if (oox_num_fmt >= 5 && oox_num_fmt <= 8) state.ods_type =office_value_type::Currency; else if (oox_num_fmt >= 41 && oox_num_fmt <= 44) state.ods_type =office_value_type::Currency; @@ -445,7 +445,7 @@ void odf_number_styles_context::create_numbers(number_format_state& state, offic if (state.format_code[0].empty()) { - //формат не определен .. дефолтный + // format is not defined.. default min_digit = 1; } else @@ -829,11 +829,11 @@ void odf_number_styles_context::create_date_style(number_format_state & state, o else number_year_->number_style_ = L"long"; } } - else if (!bAM) // разделителя am.pm в либре нет - { //////////////////// делитель //////////////////// - if(sz > 1) + else if (!bAM) // no am.pm separator in libre + { //////////////////// delimiter //////////////////// + if(sz > 1) { - //выкинем "лишние" слэши + // remove "extra" slashes XmlUtils::replace_all( s, L"\\", L""); } create_element(L"number", L"text", elm, odf_context_); @@ -860,7 +860,7 @@ void odf_number_styles_context::create_time_style(number_format_state & state, o boost::wregex re(L"([a-zA-Z]+)(\\W+)");//(L"(\\w+)"); std::list<std::wstring> result; bool b = boost::regex_split(std::back_inserter(result),s, re); - if (b)result.push_back(s);//последний ..выносится - так уж работает boost.regex_split + if (b)result.push_back(s);// last one.. carried out - that's how boost.regex_split works size_t sz=0; for (std::list<std::wstring>::iterator it = result.begin(); it != result.end(); ++it) @@ -878,7 +878,7 @@ void odf_number_styles_context::create_time_style(number_format_state & state, o if (sz == 2) number_hours_->number_style_ = L"long"; } } - else if (std::wstring::npos != s.find(L"am")) //излишнее .. + else if (std::wstring::npos != s.find(L"am")) // redundant.. { create_element(L"number", L"am-pm", elm, odf_context_); } @@ -903,12 +903,12 @@ void odf_number_styles_context::create_time_style(number_format_state & state, o //number_decimal_places_ } } - else if (std::wstring::npos == s.find(L"pm"))//так уж формат делится .. а этот текст нам не нужен + else if (std::wstring::npos == s.find(L"pm"))// that's how format is split.. and we don't need this text { - //////////////////// делитель //////////////////// - if(sz > 1) + //////////////////// delimiter //////////////////// + if(sz > 1) { - //выкинем "лишние" слэши + // remove "extra" slashes XmlUtils::replace_all( s, L"\\", L""); } create_element(L"number", L"text", elm, odf_context_); diff --git a/OdfFile/Writer/Format/odf_number_styles_context.h b/OdfFile/Writer/Format/odf_number_styles_context.h index 0fffa3d735..ac973e6888 100644 --- a/OdfFile/Writer/Format/odf_number_styles_context.h +++ b/OdfFile/Writer/Format/odf_number_styles_context.h @@ -49,7 +49,7 @@ typedef shared_ptr<office_element>::Type office_element_ptr; struct number_format_state { - int oox_num_fmt;//дефолтные + int oox_num_fmt;//default odf_types::office_value_type::type ods_type; diff --git a/OdfFile/Writer/Format/odf_page_layout_context.cpp b/OdfFile/Writer/Format/odf_page_layout_context.cpp index b5b29b6066..470867bf74 100644 --- a/OdfFile/Writer/Format/odf_page_layout_context.cpp +++ b/OdfFile/Writer/Format/odf_page_layout_context.cpp @@ -162,7 +162,7 @@ void odf_page_layout_context::process_master_styles(office_element_ptr root ) } catch(...) { - //почему то нет страницы + // for some reason there is no page } } } @@ -256,13 +256,13 @@ void odf_page_layout_context::set_page_gutter(_CP_OPT(length) length_) } void odf_page_layout_context::set_footer_size(_CP_OPT(length) length_, _CP_OPT(odf_types::length) length_min) -//тут собственно не footer а размер после колонтитула +// here it's not actually footer but size after the header/footer { if (layout_state_list_.size() < 1) return; //layout_state_list_.back().footer_size_ = length_; layout_state_list_.back().footer_min_size_ = length_min; - //собственно в layout встроим позднее - по факту наличия хоть одного колонтитула + // will actually embed into layout later - when at least one header/footer exists return; } void odf_page_layout_context::set_header_size(_CP_OPT(length) length_, _CP_OPT(odf_types::length) length_min) @@ -324,7 +324,7 @@ bool odf_page_layout_context::add_footer(int type) master_state_list_.back().add_footer(root_header_footer_); ///////////////////////////////////////////////////////////////////// -//настраить нужно 1 раз +// needs to be configured once if (!layout_state_list_.back().footer_size_ && !layout_state_list_.back().footer_min_size_) return true; style_header_footer_properties *footer_props = get_footer_properties(); @@ -371,7 +371,7 @@ bool odf_page_layout_context::add_header(int type) master_state_list_.back().add_header(root_header_footer_); //////////////////////////////////////////////////////////////////////// -//настроить нужно один раз +// needs to be configured once if (!layout_state_list_.back().header_size_ && !layout_state_list_.back().header_min_size_) return true; style_header_footer_properties *header_props = get_header_properties(); @@ -401,7 +401,7 @@ void odf_page_layout_context::set_header_footer_image(office_element_ptr image) style_header_footer_properties *header_footer_props = get_footer_properties(); if (!header_footer_props)return; - if (!header_footer_props->style_background_image_ )// картинка общая для всех четных, нечетных, первых, так же нету центральных, левых, правых + if (!header_footer_props->style_background_image_ )// image is common for all even, odd, first, also no center, left, right { header_footer_props->style_background_image_ = image; } diff --git a/OdfFile/Writer/Format/odf_page_layout_context.h b/OdfFile/Writer/Format/odf_page_layout_context.h index f40f30a469..b02bdac5a8 100644 --- a/OdfFile/Writer/Format/odf_page_layout_context.h +++ b/OdfFile/Writer/Format/odf_page_layout_context.h @@ -71,12 +71,12 @@ public: void process_master_styles (office_element_ptr root ); void process_automatic_for_styles (office_element_ptr root ); - void process_office_styles (office_element_ptr root );//картинки, шрифты, ... для мастер пэйджей и шаблонов + void process_office_styles (office_element_ptr root );//images, fonts, ... for master pages and templates odf_layout_state * last_layout(); odf_master_state * last_master(); - odf_style_context_ptr get_local_styles_context() //для автоматических стилей самих стилей + odf_style_context_ptr get_local_styles_context() //for automatic styles of the styles themselves {return local_style_context_;} void set_page_margin (_CP_OPT(double) top, _CP_OPT(double) left, _CP_OPT(double) bottom, _CP_OPT(double) right, _CP_OPT(double) header, _CP_OPT(double) footer); @@ -114,7 +114,7 @@ public: void set_page_number_format (_CP_OPT(int) & type, _CP_OPT(int) & start); - office_element_ptr root_header_footer_; //для топовых элементов в style:footer + office_element_ptr root_header_footer_; //for top-level elements in style:footer double current_page_width_; bool even_and_left_headers_; diff --git a/OdfFile/Writer/Format/odf_page_layout_state.h b/OdfFile/Writer/Format/odf_page_layout_state.h index 97f36122ff..902d509283 100644 --- a/OdfFile/Writer/Format/odf_page_layout_state.h +++ b/OdfFile/Writer/Format/odf_page_layout_state.h @@ -106,7 +106,7 @@ public: void set_name(std::wstring & name); std::wstring get_name(); - style_page_layout_properties *get_properties();//пока не красиво ... лучше хранить прямую ссыль нежели искать + style_page_layout_properties *get_properties();//not pretty for now ... better to store direct reference rather than search style_header_footer_properties *get_header_properties();//-''- style_header_footer_properties *get_footer_properties();//-''- diff --git a/OdfFile/Writer/Format/odf_style_context.cpp b/OdfFile/Writer/Format/odf_style_context.cpp index a5d1126acd..28362fb08a 100644 --- a/OdfFile/Writer/Format/odf_style_context.cpp +++ b/OdfFile/Writer/Format/odf_style_context.cpp @@ -49,7 +49,7 @@ namespace cpdoccore { namespace odf_writer { -static int style_family_counts_[1024]={};//согласно количеству разных стилей +static int style_family_counts_[1024]={};//according to the number of different styles void calc_paragraph_properties_content(std::vector<paragraph_format_properties*> & parProps, paragraph_format_properties * result) @@ -154,7 +154,7 @@ void odf_style_context::reset_defaults() } void odf_style_context::process_automatic_for_styles(office_element_ptr root ) -{//автоматические стили для эементнов стилей +{//automatic styles for style elements for (size_t i =0; i < style_state_list_.size(); i++) { if (style_state_list_[i]->writable_ == false) continue; @@ -164,7 +164,7 @@ void odf_style_context::process_automatic_for_styles(office_element_ptr root ) } } void odf_style_context::process_automatic_styles(office_element_ptr root ) -{//автоматические стили для элементов +{//automatic styles for elements for (size_t i =0; i < style_state_list_.size(); i++) { if (style_state_list_[i]->writable_ == false) continue; @@ -389,7 +389,7 @@ std::wstring odf_style_context::get_name_family(style_family::type family) case style_family::PageLayout: return L"Mpm"; case style_family::MasterPage: return L"MasterPage"; case style_family::HandoutMaster: return L"Handout"; - case style_family::LayerSet: return L"";//нету + case style_family::LayerSet: return L"";//none case style_family::PresentationPageLayout: return L"AL"; case style_family::LineNumbering: return L"Line_20_numbering"; @@ -403,7 +403,7 @@ std::wstring odf_style_context::find_free_name(style_family::type family) std::wstring name = get_name_family(family); int count = style_family_counts_[(int)family]; - //доооолго .. проще хранить + //takes too long.. easier to store //for (size_t i=0;i<style_state_list_.size(); i++) //{ // if ((style_state_list_[i]->odf_style_) && (style_state_list_[i]->get_family_type() == family)) @@ -427,7 +427,7 @@ office_element_ptr & odf_style_context::add_or_find(std::wstring name, style_fam if ((name.length() >= 0 && style_state_list_[i]->odf_style_->get_name() == name) && style_state_list_[i]->root_ == root) return style_state_list_[i]->get_office_element(); - //во избежания имена генерим уникальные (в принципе для root и остальных - можно одинаковые) + //to avoid conflicts we generate unique names (in principle for root and others - can be the same) } } diff --git a/OdfFile/Writer/Format/odf_style_context.h b/OdfFile/Writer/Format/odf_style_context.h index c947ae08bf..2c45b05db3 100644 --- a/OdfFile/Writer/Format/odf_style_context.h +++ b/OdfFile/Writer/Format/odf_style_context.h @@ -83,7 +83,7 @@ public: bool find_odf_default_style_state(odf_types::style_family::type family, odf_style_state_ptr & state); bool find_odf_style(std::wstring style_name, odf_types::style_family::type family, style *& style_); - bool find_odf_style_state(std::wstring style_name, odf_types::style_family::type family, odf_style_state_ptr & state); //имена в odf_writer сделаны полностью уникальными + bool find_odf_style_state(std::wstring style_name, odf_types::style_family::type family, odf_style_state_ptr & state); // names in odf_writer are made completely unique odf_style_state_ptr last_state(odf_types::style_family::type family = odf_types::style_family::None); @@ -107,7 +107,7 @@ private: std::vector<odf_style_state_ptr> style_state_list_; - std::vector<odf_style_state_ptr> current_default_styles_;//для внутренней работы .. переодически очищаемый частично или полностью + std::vector<odf_style_state_ptr> current_default_styles_;// for internal use.. periodically cleared partially or completely std::wstring get_name_family(odf_types::style_family::type family); diff --git a/OdfFile/Writer/Format/odf_style_state.cpp b/OdfFile/Writer/Format/odf_style_state.cpp index 65ba22441a..4e6041dc42 100644 --- a/OdfFile/Writer/Format/odf_style_state.cpp +++ b/OdfFile/Writer/Format/odf_style_state.cpp @@ -162,7 +162,7 @@ void odf_style_state::set_automatic(bool val) { automatic_ = val; } -void odf_style_state::set_root(bool val)//метка того что в файле styles, а не content +void odf_style_state::set_root(bool val)// flag that it's in styles file, not content { root_ = val; } diff --git a/OdfFile/Writer/Format/odf_style_state.h b/OdfFile/Writer/Format/odf_style_state.h index 8cfba7adaf..daef54455c 100644 --- a/OdfFile/Writer/Format/odf_style_state.h +++ b/OdfFile/Writer/Format/odf_style_state.h @@ -119,14 +119,14 @@ private: std::wstring odf_style_name_; std::wstring oox_style_name_; -//инфа для описания ячеек +// info for cell description int style_oox_id_; - int num_fmt_id_; //default =0 (general) -/////// + int num_fmt_id_; //default =0 (general) +/////// bool automatic_; bool root_; - bool default_; // это для тех стилей что в root - bool conditional_; //стили накладываемые по условию + bool default_; // this is for styles that are in root + bool conditional_; // styles applied by condition bool writable_; diff --git a/OdfFile/Writer/Format/odf_table_context.cpp b/OdfFile/Writer/Format/odf_table_context.cpp index 077918e29b..9857391bbc 100644 --- a/OdfFile/Writer/Format/odf_table_context.cpp +++ b/OdfFile/Writer/Format/odf_table_context.cpp @@ -138,10 +138,10 @@ public: _CP_OPT(odf_types::length) default_cell_padding_top; _CP_OPT(odf_types::length) default_cell_padding_bottom; - std::wstring default_cell_properties; // для предустановки .. + std::wstring default_cell_properties; // for preset.. private: - std::vector<odf_table_state> tables_;//типо current level ... для вложенных таблиц + std::vector<odf_table_state> tables_;// like current level... for nested tables }; @@ -205,7 +205,7 @@ void odf_table_context::start_table(office_element_ptr &elm, bool styled) } void odf_table_context::end_table() { - //последние объединенные ячейки .. + // last merged cells.. if (impl_->current_table().columns.empty()) { } @@ -288,7 +288,7 @@ void odf_table_context::end_row() //for (int i = impl_->current_table().current_column ; i < impl_->current_table().columns.size() ; i++) //{ - // office_element_ptr cell; //потом на default ??? + // office_element_ptr cell; // later to default ??? // create_element(L"table", L"table-cell",cell , impl_->odf_context_); // start_cell(cell,false); // end_cell(); diff --git a/OdfFile/Writer/Format/odf_table_styles_context.cpp b/OdfFile/Writer/Format/odf_table_styles_context.cpp index 17fabf7a14..2f996be63a 100644 --- a/OdfFile/Writer/Format/odf_table_styles_context.cpp +++ b/OdfFile/Writer/Format/odf_table_styles_context.cpp @@ -238,7 +238,7 @@ void odf_table_styles_context::get_table_cell_properties (int col, int row, styl bool first_row = (row == 1)? true: false; bool first_col = (col == 1)? true: false; - bool odd_row = ((row+row_shift)%2 != 0) ? true : false;//нечетные + bool odd_row = ((row+row_shift)%2 != 0) ? true : false;//odd bool odd_col = ((col+col_shift)%2 != 0) ? true : false; bool last_row = (row == current_used_.back().table_row_count_) ? true: false; @@ -250,7 +250,7 @@ void odf_table_styles_context::get_table_cell_properties (int col, int row, styl bool se = (row == current_used_.back().table_row_count_ && col == current_used_.back().table_col_count_) ? true: false; //bottom right cell bool sw = (row == current_used_.back().table_row_count_ && col == 1) ? true: false; //bottom left cell. //---------------------------------------------------------------------------------------------------------------------------------- -//порядок рассмотрения - main, odd, even first, last, ne, .... col, row +//order of consideration - main, odd, even first, last, ne, .... col, row cell_props->apply_from(dynamic_cast<style_table_cell_properties *>(state.table_.table_cell_props.get())); if (current_used_.back().cols) @@ -348,7 +348,7 @@ void odf_table_styles_context::get_text_properties (int col, int row, text_forma bool first_row = (row == 1)? true: false; bool first_col = (col == 1)? true: false; - bool odd_row = ((row+row_shift)%2 != 0) ? true : false;//нечетные + bool odd_row = ((row+row_shift)%2 != 0) ? true : false;//odd bool odd_col = ((col+col_shift)%2 != 0) ? true : false; bool last_row = (row == current_used_.back().table_row_count_) ? true: false; @@ -360,7 +360,7 @@ void odf_table_styles_context::get_text_properties (int col, int row, text_forma bool se = (row == current_used_.back().table_row_count_ && col == current_used_.back().table_col_count_) ? true: false; //bottom right cell bool sw = (row == current_used_.back().table_row_count_ && col == 1) ? true: false; //bottom left cell //---------------------------------------------------------------------------------------------------------------------------------- -//порядок рассмотрения - main, odd, even first, last, ne, .... +//order of consideration - main, odd, even first, last, ne, .... style_text_properties *props = NULL; props = dynamic_cast<style_text_properties *>(state.table_.text_props.get()); @@ -461,7 +461,7 @@ bool odf_table_styles_context::is_styled(int col, int row) if (state.lastCol_.is && last_col) return true; if (state.lastRow_.is && last_row) return true; - bool odd_row = ((row + row_shift) % 2 != 0) ? true : false;//нечетные + bool odd_row = ((row + row_shift) % 2 != 0) ? true : false;//odd bool odd_col = ((col + col_shift) % 2 != 0) ? true : false; if (state.band1Vert_.is && odd_col) return true; @@ -500,7 +500,7 @@ void odf_table_styles_context::get_paragraph_properties (int col, int row, parag bool first_row = (row == 1)? true : false; bool first_col = (col == 1)? true : false; - bool odd_row = ((row + row_shift) % 2 != 0) ? true : false;//нечетные + bool odd_row = ((row + row_shift) % 2 != 0) ? true : false;//odd bool odd_col = ((col + col_shift) % 2 != 0) ? true : false; bool last_row = (row == current_used_.back().table_row_count_) ? true: false; diff --git a/OdfFile/Writer/Format/odf_text_context.cpp b/OdfFile/Writer/Format/odf_text_context.cpp index 319056bd18..45e2b1bbe1 100644 --- a/OdfFile/Writer/Format/odf_text_context.cpp +++ b/OdfFile/Writer/Format/odf_text_context.cpp @@ -231,7 +231,7 @@ void odf_text_context::add_text_space(int count) text_s* s = dynamic_cast<text_s*>(s_elm.get()); if (s) s->text_c_ = count; - //необязательно хранить.. + // not necessary to store.. //int level = current_level_.size(); //odf_element_state state={ s_elm, L"", office_element_ptr(), level}; //text_elements_list_.push_back(state); @@ -422,7 +422,7 @@ void odf_text_context::start_span(bool styled) { style_->style_parent_style_name_ = parent_span_style_; } - text_properties_ = style_->content_.add_get_style_text_properties();//для буквиц на поле + text_properties_ = style_->content_.add_get_style_text_properties();// for drop caps in margin } } diff --git a/OdfFile/Writer/Format/odf_text_context.h b/OdfFile/Writer/Format/odf_text_context.h index ed57558f87..60077745b0 100644 --- a/OdfFile/Writer/Format/odf_text_context.h +++ b/OdfFile/Writer/Format/odf_text_context.h @@ -81,8 +81,8 @@ public: odf_text_context (odf_conversion_context *odf_context, odf_style_context_ptr styles_context); ~odf_text_context (); - odf_style_context_ptr get_styles_context();//для embedded - void set_styles_context(odf_style_context_ptr styles_context);//для embedded + odf_style_context_ptr get_styles_context();// for embedded + void set_styles_context(odf_style_context_ptr styles_context);// for embedded void clear_params(); @@ -154,8 +154,8 @@ public: bool is_hyperlink_; int level_hyperlink_; - std::vector<odf_element_state> current_level_; //постоянно меняющийся список уровней наследования - std::vector<odf_element_state> text_elements_list_; //параграфы, списки , ... + std::vector<odf_element_state> current_level_; // constantly changing list of inheritance levels + std::vector<odf_element_state> text_elements_list_; // paragraphs, lists, ... struct _list_state { bool started_list = false; @@ -170,8 +170,8 @@ private: _CP_OPT(odf_types::fo_break) need_break_; - paragraph_format_properties *paragraph_properties_; //хранилка-опознавалка что свойства приписаны другому, не текстовому, объекту - text_format_properties *text_properties_; //хранилка-опознавалка что свойства приписаны другому, не текстовому, объекту + paragraph_format_properties *paragraph_properties_; // storage-marker that properties are assigned to another, non-text object + text_format_properties *text_properties_; // storage-marker that properties are assigned to another, non-text object odf_style_context_ptr styles_context_; diff --git a/OdfFile/Writer/Format/odp_conversion_context.cpp b/OdfFile/Writer/Format/odp_conversion_context.cpp index de3d616ab6..d7dce592f4 100644 --- a/OdfFile/Writer/Format/odp_conversion_context.cpp +++ b/OdfFile/Writer/Format/odp_conversion_context.cpp @@ -163,7 +163,7 @@ void odp_conversion_context::start_master_slide(std::wstring & name) void odp_conversion_context::end_master_slide() { slide_context_.end_page(); - slide_context_.set_styles_context(NULL); //возврат на базовый + slide_context_.set_styles_context(NULL); //return to base } void odp_conversion_context::start_layout_slide() { @@ -178,7 +178,7 @@ void odp_conversion_context::start_layout_slide() void odp_conversion_context::end_layout_slide() { slide_context_.end_page(); - slide_context_.set_styles_context(NULL); //возврат на базовый + slide_context_.set_styles_context(NULL); //return to base } odf_style_context_ptr odp_conversion_context::styles_context() diff --git a/OdfFile/Writer/Format/odp_slide_context.cpp b/OdfFile/Writer/Format/odp_slide_context.cpp index 209758e642..cd87a2731e 100644 --- a/OdfFile/Writer/Format/odp_slide_context.cpp +++ b/OdfFile/Writer/Format/odp_slide_context.cpp @@ -117,9 +117,9 @@ void odp_slide_context::start_table() //-------------------------------------------------------------------- odf_style_state_ptr style_state; -//общие свойства ячеек +//common cell properties styles_context_->create_style(L"", odf_types::style_family::TableCell, true, false, -1); - //ради нормального задания дефолтовых свойств на cells + //for proper setting of default cell properties style_state = styles_context_->last_state(style_family::TableCell); if (style_state) { @@ -127,7 +127,7 @@ void odp_slide_context::start_table() table_context()->set_default_cell_properties(style_state->get_name()); } -//стиль создаем всегда +//always create style styles_context_->create_style(L"", odf_types::style_family::Table, true, false, -1); style_state = styles_context_->last_state(style_family::Table); @@ -153,7 +153,7 @@ void odp_slide_context::add_table_column(double width) styles_context_->create_style(L"", style_family::TableColumn, true, false, -1); - //не срабатывает .. + //doesn't work .. //std::wstring parent_name = table_context()->get_default_cell_properties(); //if (parent_name.length() > 0) @@ -171,7 +171,7 @@ void odp_slide_context::add_table_column(double width) table_context()->add_column(elm, true); table_context()->set_column_width(width); - state().drawing_context()->start_element(elm); // для связи элментов + state().drawing_context()->start_element(elm); // for linking elements state().drawing_context()->end_element(); } void odp_slide_context::end_table_columns() diff --git a/OdfFile/Writer/Format/ods_conversion_context.cpp b/OdfFile/Writer/Format/ods_conversion_context.cpp index d67501e706..60103782e1 100644 --- a/OdfFile/Writer/Format/ods_conversion_context.cpp +++ b/OdfFile/Writer/Format/ods_conversion_context.cpp @@ -345,7 +345,7 @@ void ods_conversion_context::add_hyperlink(const std::wstring & ref, const std:: boost::algorithm::split(ref_cells, ref, boost::algorithm::is_any_of(L":"), boost::algorithm::token_compress_on); if (ref_cells.size() > 1) { - //в ооx можно воткнуть на диапазон одну ссылку, в оо нельзя - ссылку вствляем, текст не меням + //in oox you can put one link on a range, in oo you can't - we insert link, don't change text int start_col = -1, start_row = -1; int end_col = -1, end_row = -1; @@ -357,7 +357,7 @@ void ods_conversion_context::add_hyperlink(const std::wstring & ref, const std:: for (long row = start_row; row <= end_row; row++) { current_table()->add_hyperlink(ref, col, row, link, location); - //ссылка одна, а вот отображаемый текст - разный + //link is one, but displayed text is different } } } @@ -409,7 +409,7 @@ void ods_conversion_context::add_merge_cells(const std::wstring & ref) std::vector<std::wstring> ref_cells; boost::algorithm::split(ref_cells, ref, boost::algorithm::is_any_of(L":"), boost::algorithm::token_compress_on); - if (ref_cells.size() != 2) return;//тута однозначно .. по правилам оохml + if (ref_cells.size() != 2) return;//definitely here.. according to ooxml rules int start_col = -1, start_row = -1; int end_col = -1, end_row = -1; @@ -498,8 +498,8 @@ void ods_conversion_context::start_columns() } void ods_conversion_context::end_columns() { - //add default last column - ЕСЛИ они не прописаны в исходном (1024 - от балды) - //вопрос - если и добавлять то с каким стилем??? + //add default last column - IF they are not specified in the source (1024 - arbitrary) + //question - if adding then with what style??? //if (current_table()->current_column() < 1 ) // add_column(current_table()->current_column() + 1,1024, 0, true); //else @@ -543,7 +543,7 @@ void ods_conversion_context::add_default_row(int repeated) } } if (row_split > current_table()->current_row() && row_split_repeated != repeated) - {//делим на 3 - до, с --, после; + {//split into 3 - before, with --, after; int r = current_table()->current_row(); add_default_row(row_split - r - 1); @@ -624,8 +624,8 @@ void ods_conversion_context::add_column(int start_column, int repeated, int leve } else { - //по сути в этом стиле раличные опции ширины колонок тока .. а если свойства совпадают - можно сгенерить один, хотя выше и указано что стили разные. - //то есть в оо разделяют оох стиль на 2 (для колонки собственно, и описалово ячеек в колонки) + //essentially this style has different column width options only.. and if properties match - can generate one, although above it's indicated that styles are different. + //i.e. in oo they split oox style into 2 (for the column itself, and cell description in column) styles_context()->create_style(L"", style_family::TableColumn, true, false, -1); style_elm = styles_context()->last_state()->get_office_element(); @@ -731,8 +731,8 @@ void ods_conversion_context::start_cell_text() text_a_->common_xlink_attlist_.type_ = xlink_type(xlink_type::Simple); text_a_->common_xlink_attlist_.href_ = state.link; - text_context()->start_element(text_a_elm); // может быть стоит сделать собственый??? - // libra дурит если в табличках будет вложенный span в гиперлинк ... оО (хотя это разрешено в спецификации!!!) + text_context()->start_element(text_a_elm); // maybe worth making a custom one??? + // LibreOffice acts weird if there's a nested span in hyperlink inside tables... o_O (although it's allowed in specification!!!) text_context()->single_paragraph_ = true; } diff --git a/OdfFile/Writer/Format/ods_table_context.cpp b/OdfFile/Writer/Format/ods_table_context.cpp index 1d0475d935..c848139ec6 100644 --- a/OdfFile/Writer/Format/ods_table_context.cpp +++ b/OdfFile/Writer/Format/ods_table_context.cpp @@ -125,7 +125,7 @@ void ods_table_context::start_table_part(const std::wstring &name, std::wstring } pos = ref.rfind(L":"); - if (pos == std::wstring::npos) return;//тута однозначно .. по правилам оох + if (pos == std::wstring::npos) return;//definitely here.. according to oox rules utils::parsing_ref (ref.substr(0, pos), part_state.col_start, part_state.row_start); utils::parsing_ref (ref.substr(pos + 1, ref.size() - pos), part_state.col_end, part_state.row_end); @@ -490,7 +490,7 @@ void ods_table_context::add_defined_range(const std::wstring & name, const std:: formulasconvert::oox2odf_converter formulas_converter; - std::wstring odf_range = formulas_converter.convert_named_ref(cell_range);//todo - разделить конвертацию диапазонов/рэнжей на c [] и без + std::wstring odf_range = formulas_converter.convert_named_ref(cell_range);//todo - separate range conversion with [] and without std::wstring odf_base_cell = formulas_converter.get_table_name(); @@ -538,7 +538,7 @@ void ods_table_context::add_defined_expression(const std::wstring & name, const bool simple_range = formulas_converter.is_simple_ref(value); - if (simple_range)//если простой - range, составной - выражение + if (simple_range)//if simple - range, compound - expression return add_defined_range (name, value, sheet_id, printable); office_element_ptr elm; @@ -592,8 +592,8 @@ void ods_table_context::start_table(office_element_ptr & elm) state()->set_table_style(style); state()->set_table_hidden(false); - //для свойств страницы, а не таблицы - нужно создать master-page c page layout и связать по имени со стилем таблицы - //причем здесь, т.к. с другой стороны это ВСЕ еще свойства листа. то есть совйства листа разделить на свйства страницы и таблицы .. + //for page properties, not table - need to create master-page with page layout and link by name with table style + //and here, because on the other hand these are ALL still sheet properties. i.e. split sheet properties into page and table properties.. //todooo //???? } diff --git a/OdfFile/Writer/Format/ods_table_state.cpp b/OdfFile/Writer/Format/ods_table_state.cpp index b9305b8345..8f56279502 100644 --- a/OdfFile/Writer/Format/ods_table_state.cpp +++ b/OdfFile/Writer/Format/ods_table_state.cpp @@ -64,7 +64,7 @@ namespace odf_writer { _INT32 ods_table_state::tmp_column_ =0; _INT32 ods_table_state::tmp_row_ =0; -namespace utils//////////////////////////////////////////// ОБЩАЯ хрень .. вытащить что ли в utils ??? +namespace utils//////////////////////////////////////////// COMMON stuff.. maybe move to utils ??? { bool convert_date(__int64 date, std::wstring & date_str) @@ -349,7 +349,7 @@ void ods_table_state::set_table_style(office_element_ptr & elm) if (table == NULL)return; table->attlist_.table_style_name_ = office_table_style_->style_name_; - //потом в принципе и по имени можно будет связать(найти) + //later it will also be possible to link(find) by name } void ods_table_state::start_group(office_element_ptr & elm) { @@ -658,7 +658,7 @@ _UINT32 ods_table_state::get_last_row_repeated () void ods_table_state::set_row_default_cell_style(std::wstring & style_name) { - row_default_cell_style_name_= style_name; //обязательно нужно определить default-style (table_cell)!!! + row_default_cell_style_name_= style_name; //must define default-style (table_cell)!!! //if (style_name.length() < 1) return; @@ -766,7 +766,7 @@ void ods_table_state::set_cell_type(int type) case 2:// error-type case 3:// inline case 5:// shared - case 6:// обычная строка + case 6:// regular string cell_type = office_value_type(office_value_type::String); break; } @@ -949,7 +949,7 @@ void ods_table_state::set_merge_cells(_INT32 start_col, _INT32 start_row, _INT32 pFindRow->second.insert(std::make_pair(start_col, info)); } - //else нереально pFindCol->second.insert(info); + //else unrealistic pFindCol->second.insert(info); } } bool ods_table_state::isSpannedCell(_INT32 col, _INT32 row, _INT32&spanned_cols, _INT32&spanned_rows ) @@ -1076,7 +1076,7 @@ void ods_table_state::set_cell_formula(std::wstring & formula) for (size_t j = 0; j < table_parts_[i].columns.size(); j ++) { std::wstring name = table_parts_[i].name + L"[" + table_parts_[i].columns[j].first + L"]"; - //Таблица1[ Сумма за кв. 3 ] + //Table1[ Sum for Q3 ] XmlUtils::replace_all(odfFormula, name, table_parts_[i].columns[j].second); } @@ -1098,7 +1098,7 @@ std::wstring ods_table_state::replace_cell_row(boost::wsmatch const & what) { std::wstring ref_formula = what[1].str(); _INT32 col_formula = 0, row_formula = 0; - utils::parsing_ref(ref_formula, col_formula, row_formula);col_formula--;//инче отсчет с 1 + utils::parsing_ref(ref_formula, col_formula, row_formula);col_formula--;//otherwise counting from 1 ref_formula = utils::getColAddress(col_formula) + std::to_wstring(row_formula + current_table_row_ - tmp_row_); @@ -1172,7 +1172,7 @@ void ods_table_state::add_or_find_cell_shared_formula(std::wstring & formula, st { odf_formula = pFind->second.formula; - //поменять по ref формулу !!! + //change formula by ref !!! if (pFind->second.moving_type == 1) { tmp_column_ = pFind->second.base_column; @@ -1206,7 +1206,7 @@ void ods_table_state::set_cell_array_formula(std::wstring & formula, std::wstrin { set_cell_formula(formula); - //; ??? C2:D5 или D1;F1;G; ... ??? + //; ??? C2:D5 or D1;F1;G; ... ??? std::vector<std::wstring> ref_cells; boost::algorithm::split(ref_cells,ref, boost::algorithm::is_any_of(L":"), boost::algorithm::token_compress_on); @@ -1248,7 +1248,7 @@ void ods_table_state::add_child_element( const office_element_ptr & child_elemen office_table_->add_child_element(child_element); } -void ods_table_state::convert_position(oox_table_position & oox_pos, double & x, double & y)//c 0 отсчет +void ods_table_state::convert_position(oox_table_position & oox_pos, double & x, double & y)//0-based counting { double sz_col=0; size_t curr_col = 0, i; @@ -1352,7 +1352,7 @@ void ods_table_state::set_cell_value(const std::wstring & value, bool need_cash) { cell->attlist_.common_value_and_type_attlist_ = common_value_and_type_attlist(); cell->attlist_.common_value_and_type_attlist_->office_value_type_ = office_value_type(office_value_type::Float); - //временно... пока нет определялки типов + //temporary... until type detector is available } cells_.back().empty = false; @@ -1408,7 +1408,7 @@ void ods_table_state::set_cell_value(const std::wstring & value, bool need_cash) //general !! } - //кэшированные значения + //cached values if (false == value.empty()) { if (is_cell_hyperlink()) @@ -1493,8 +1493,8 @@ void ods_table_state::start_cell_text() text_a_->common_xlink_attlist_.type_ = xlink_type(xlink_type::Simple); text_a_->common_xlink_attlist_.href_ = state.link; - context_->text_context()->start_element(text_a_elm); // может быть стоит сделать собственый??? - // libra дурит если в табличках будет вложенный span в гиперлинк ... оО (хотя это разрешено в спецификации!!!) + context_->text_context()->start_element(text_a_elm); // maybe worth making a custom one??? + // LibreOffice acts weird if there's a nested span in hyperlink inside tables... o_O (although it's allowed in specification!!!) context_->text_context()->single_paragraph_ = true; } @@ -1543,7 +1543,7 @@ void ods_table_state::add_default_cell(_INT32 repeated) _INT32 comment_idx = is_cell_comment(current_table_column_ + 1, current_table_row_, repeated); if (comment_idx >= 0 && repeated > 1) { - //делим на 3 - до, с комметом, после; + //split into 3 - before, with comment, after; _INT32 c = current_table_column_; add_default_cell(comments_[comment_idx].col - c - 1); @@ -1564,7 +1564,7 @@ void ods_table_state::add_default_cell(_INT32 repeated) { if (repeated > 1) { - //делим на 3 - до, с spanned, после; + //split into 3 - before, with spanned, after; _INT32 c = current_table_column_; add_default_cell(it->first - c - 1); @@ -1589,7 +1589,7 @@ void ods_table_state::add_default_cell(_INT32 repeated) if (data_validation_idx >= 0 && repeated > 1 && repeated_validation != repeated) { - //делим на 3 - до, с validation, после; + //split into 3 - before, with validation, after; _INT32 c = current_table_column_; add_default_cell(ref.col_start - c - 1); @@ -1972,7 +1972,7 @@ void ods_table_state::start_conditional_format(const std::wstring& ref) std::wstring out = converter.convert_ref_distances(ref, L" ", L" "); cond_format->calcext_target_range_address_ = out; - //проверить конвертацию на диапазонах с именами листов в кавычках и с пробелами + //check conversion on ranges with sheet names in quotes and with spaces } } void ods_table_state::end_conditional_format() @@ -2243,7 +2243,7 @@ void ods_table_state::set_conditional_value(int type, const std::wstring& value } entry->calcext_value_ = value; } - ///color???? - прихоодят выше уровнем !! + ///color???? - comes from higher level !! } } void ods_table_state::set_conditional_show_value(bool value) diff --git a/OdfFile/Writer/Format/ods_table_state.h b/OdfFile/Writer/Format/ods_table_state.h index a1d422c154..39b45d3c8a 100644 --- a/OdfFile/Writer/Format/ods_table_state.h +++ b/OdfFile/Writer/Format/ods_table_state.h @@ -538,7 +538,7 @@ private: _INT32 start_col = 0; _INT32 count_cols = 0; - _INT32 count_rows = 0; // от текущей строки + _INT32 count_rows = 0; // from current row }; std::vector<_covered_info> current_covered_rows_; _INT32 current_covered_cols_; @@ -546,7 +546,7 @@ private: odf_conversion_context *context_; office_element_ptr office_table_; - style* office_table_style_ = NULL;//??? может хранить как office_element_ptr ??? + style* office_table_style_ = NULL;//??? maybe store as office_element_ptr ??? office_element_ptr table_defined_expressions_; std::wstring row_default_cell_style_name_; @@ -563,7 +563,7 @@ private: // row column std::map<_INT32, std::map<_INT32, _spanned_info>> map_merged_cells; - std::vector<office_element_ptr> current_level_;//постоянно меняющийся список уровней ("0-й элемент - сама таблица) + std::vector<office_element_ptr> current_level_;//constantly changing list of levels (0th element - the table itself) std::vector<ods_cell_state> cells_; diff --git a/OdfFile/Writer/Format/odt_conversion_context.cpp b/OdfFile/Writer/Format/odt_conversion_context.cpp index e2cb0be153..2741d6a93c 100644 --- a/OdfFile/Writer/Format/odt_conversion_context.cpp +++ b/OdfFile/Writer/Format/odt_conversion_context.cpp @@ -104,7 +104,7 @@ void odt_conversion_context::start_document() page_layout_context()->set_styles_context(styles_context()); -/////////////////настройки дефолтовые +/////////////////default settings root_text_->office_text_attlist_.text_use_soft_page_breaks_ = true; } @@ -244,7 +244,7 @@ void odt_conversion_context::add_text_content(const std::wstring & text) } void odt_conversion_context::add_to_root() { - if (!text_context_.empty()) return; // не root element (embedded) ???? + if (!text_context_.empty()) return; // not root element (embedded) ???? if (comment_context_.is_started()) return; @@ -334,7 +334,7 @@ void odt_conversion_context::start_paragraph(bool styled) if (false == current_fields.empty() && current_fields.back().status == 1 && false == current_fields.back().in_span) { current_fields.back().status = 2; - //if (!current_fields.empty() && !current_fields.back().result) return; //Стандартное_составное_письмо.docx + //if (!current_fields.empty() && !current_fields.back().result) return; //Standard_mail_merge.docx switch (current_fields.back().type) { case fieldBibliography: start_bibliography(); break; @@ -361,17 +361,17 @@ void odt_conversion_context::add_paragraph_break(int type) //text_p* para = NULL; //style * style_ = NULL; //http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1415190_253892949 - //нихере не работает !! в span, ... приходится генерить разрыв вручную !! + //doesn't work at all !! in span, ... have to generate break manually !! //if (para = dynamic_cast<text_p*>(current_root_elements_.back().elm.get())) //{ - // style_ = dynamic_cast<style*>(current_root_elements_.back().style_elm.get());//для переноса свойств параграфа + // style_ = dynamic_cast<style*>(current_root_elements_.back().style_elm.get());//for transferring paragraph properties // end_paragraph(); //} //else/* if (header = dynamic_cast<text_h*>(current_root_elements_.back().elm.get()))*/ //{ - //тут получается что разрыв будет прописан внутри элемента (не параграфа) - так что вручную свойство запишем - //в случае разрыва параграфов оно запишется при старте после-разрывного параграфа + //here it turns out that the break will be written inside the element (not paragraph) - so we write the property manually + //in case of paragraph breaks it will be written at the start of the post-break paragraph //text_context()->set_type_break(type, 0); text_context()->save_property_break(); //} @@ -389,7 +389,7 @@ void odt_conversion_context::add_paragraph_break(int type) // { // style_paragraph_properties * new_props = NULL; // if (styles_context()->last_state()) - // {// нужна именно копия св-в так как будет добавочные свойства + // {// need exactly a copy of properties since there will be additional properties // new_props = styles_context()->last_state()->get_paragraph_properties(); // if (new_props)new_props->apply_from(style_->content_.get_style_paragraph_properties()); // @@ -637,7 +637,7 @@ void odt_conversion_context::end_hyperlink() text_context()->level_hyperlink_ = 0; text_context()->end_element(); //hyperlink_element - text_context()->is_hyperlink_ = false; //метка .. для гиперлинков в объектах - там не будет span + text_context()->is_hyperlink_ = false; //flag.. for hyperlinks in objects - there won't be span } void odt_conversion_context::start_drop_down() { @@ -1048,7 +1048,7 @@ void odt_conversion_context::set_field_item (const std::wstring &value, const st void odt_conversion_context::start_field(bool in_span) { if (false == current_fields.empty() && current_fields.back().status == 0 && current_fields.back().instrText.empty() ) - return; //start_field из sdt + return; //start_field from sdt _field_state field; current_fields.push_back(field); @@ -1063,7 +1063,7 @@ void odt_conversion_context::separate_field() } void odt_conversion_context::set_master_page_name(std::wstring master_name) { - if (current_root_elements_.empty())// return; - эффект_штурмовика.docx - 1 страница !! (и ваще - + if (current_root_elements_.empty())// return; - stormtrooper_effect.docx - 1 page !! (and actually - { is_paragraph_in_current_section_ = true; return; @@ -1259,7 +1259,7 @@ void odt_conversion_context::end_field() } void odt_conversion_context::end_paragraph() { - //if (!current_fields.empty() && !current_fields.back().result) return; //Стандартное_составное_письмо.docx + //if (!current_fields.empty() && !current_fields.back().result) return; //Standard_mail_merge.docx text_context()->end_paragraph(); if (false == current_fields.empty() && current_fields.back().status == 3) //prepare for delete @@ -1286,7 +1286,7 @@ void odt_conversion_context::start_list_item(int level, std::wstring style_name // add_to_root(); // text_context()->start_list_item(); //} - level = level + 1; //отсчет от 1 (а не 0) + level = level + 1; //counting from 1 (not 0) if (text_context()->list_state_.style_name != style_name && text_context()->list_state_.started_list) { @@ -1308,7 +1308,7 @@ void odt_conversion_context::start_list_item(int level, std::wstring style_name { if (text_context()->start_list(style_name)) { - //text_context()->set_list_continue(true); //??? держать в памяти все списки???? + //text_context()->set_list_continue(true); //??? keep all lists in memory???? add_to_root(); } @@ -1348,12 +1348,12 @@ void odt_conversion_context::flush_section() for (size_t i = 0; i < current_root_elements_.size(); i++) { if ((sections_.back().continuous && i < 2) || !sections_.back().continuous) - // при вставлении параграфа возможен искусственный разрыв в параграфах - см add_page_break + // when inserting paragraph, artificial break in paragraphs is possible - see add_page_break { text_soft_page_break * break_ = dynamic_cast<text_soft_page_break*>(current_root_elements_[i].elm.get()); if (break_) { - //необходимо добавить в свойства предыдущего параграфа (если он есть, если нет - следующего), что брейк не нужен + //need to add to previous paragraph properties (if exists, if not - next one), that break is not needed //int paragraph_break = i-1; //if (paragraph_break < 0) paragraph_break = i+1; //style *style_ = dynamic_cast<style*>(current_root_elements_[paragraph_break].style_elm.get()); @@ -1400,7 +1400,7 @@ void odt_conversion_context::start_run(bool styled) props->apply_from(dynamic_cast<style_text_properties*>(drop_cap_state_.text_properties.get())->content_); } - if (!current_fields.empty() && current_fields.back().status == 1 && current_fields.back().in_span)//поле стартуется в span - нужно для сохранения стиля + if (!current_fields.empty() && current_fields.back().status == 1 && current_fields.back().in_span)//field starts in span - needed to preserve style { current_fields.back().status = 2; current_fields.back().elm = text_context()->start_field(current_fields.back().type, current_fields.back().value, current_fields.back().format); @@ -1441,7 +1441,7 @@ int odt_conversion_context::start_comment(int oox_comm_id) start_paragraph(); text_context()->set_KeepNextParagraph(true); - //аннотацию нельзя добавить на верхний уровень - нет поддержки в open_format + //annotation cannot be added to top level - no support in open_format } text_context()->current_level_.back().elm->add_child_element(comm_elm); @@ -1547,15 +1547,15 @@ bool odt_conversion_context::start_change (int id, int type, std::wstring &autho //--------------------------------------------------------------------------------- office_element_ptr start_elm; - if (type == 2) create_element(L"text", L"change", start_elm, this); //место удаления .. - else - create_element(L"text", L"change-start", start_elm, this); //место изменения .... + if (type == 2) create_element(L"text", L"change", start_elm, this); //deletion location.. + else + create_element(L"text", L"change-start", start_elm, this); //change location.... text_add_change* change = dynamic_cast<text_add_change*>(start_elm.get()); if (change) change->text_change_id_ = strId; text_context()->start_element(start_elm); - add_to_root();//добавление/удаление параграфов и т д + add_to_root();//adding/removing paragraphs etc text_context()->end_element(); //text_changes_state_.main_text_context->start_element(start_elm); @@ -1602,7 +1602,7 @@ bool odt_conversion_context::start_change (int id, int type, std::wstring &autho if (type == 3 && !style_name.empty()) { - //не по спецификации !!! + //not according to specification !!! text_format_change * format_change = dynamic_cast<text_format_change*> (child_elm.get()); if (format_change) format_change->text_style_name_ = style_name; @@ -1613,7 +1613,7 @@ bool odt_conversion_context::start_change (int id, int type, std::wstring &autho { start_text_context(); text_context()->start_element(child_elm); - text_context()->start_paragraph();//ваще то не по стандарту .. может мы уже в параграфе (ради Libra! ... гы) + text_context()->start_paragraph();//actually not according to standard.. maybe we're already in paragraph (for LibreOffice! ... hehe) } return true; } @@ -1641,7 +1641,7 @@ void odt_conversion_context::end_change (int id, int type) add_to_root(); text_context()->end_element(); } - text_changes_state_.current_types.pop_back();//todooo map?? удаление без проверки чего удаляешь + text_changes_state_.current_types.pop_back();//todooo map?? deletion without checking what you're deleting } //bool odt_conversion_context::is_delete_changes() //{ @@ -1661,7 +1661,7 @@ text_format_properties* odt_conversion_context::get_drop_cap_properties() void odt_conversion_context::start_drop_cap(paragraph_format_properties *paragraph_properties) { if (drop_cap_state_.enabled) - end_drop_cap(); // 2 подряд ваще возможны ??? + end_drop_cap(); // 2 in a row even possible ??? if (paragraph_properties == NULL) return; @@ -1700,7 +1700,7 @@ void odt_conversion_context::end_drop_cap() } if (drop_cap_state_.inline_style == false) { - //сдвинуть первую строку - так чтоб буквица вся (что поместится) была на поле + //shift first line - so that drop cap entirely (what fits) is on the margin //double indent_pt = 0; //double indent_percent = 0; //if (drop_cap_state_.paragraph_properties->content_.fo_text_indent_) @@ -1755,7 +1755,7 @@ void odt_conversion_context::add_table_column(double width) styles_context()->create_style(L"", style_family::TableColumn, true, false, -1); - //не срабатывает .. + //doesn't work.. //std::wstring parent_name = table_context()->get_default_cell_properties(); //if (parent_name.length() > 0) @@ -1773,7 +1773,7 @@ void odt_conversion_context::add_table_column(double width) table_context()->add_column(elm, true); table_context()->set_column_width(width); - text_context()->start_element(elm); // для связи элментов + text_context()->start_element(elm); // for linking elements text_context()->end_element(); } void odt_conversion_context::end_table_columns() diff --git a/OdfFile/Writer/Format/office_elements_create.cpp b/OdfFile/Writer/Format/office_elements_create.cpp index 404ce527c4..29e99bd6ea 100644 --- a/OdfFile/Writer/Format/office_elements_create.cpp +++ b/OdfFile/Writer/Format/office_elements_create.cpp @@ -93,7 +93,7 @@ bool office_element_creator::register_element(const std::wstring &ns, const std: } else { - // TODO: элемент уже есть, непонятно что делать + // TODO: element already exists, unclear what to do i->second = f; } return true; @@ -127,7 +127,7 @@ bool create_element(const std::wstring & Ns, { if (office_element_ptr elm = office_element_creator::get()->create(Ns, Name, Context, isRoot)) { - if (_Element) // элемент создается повторно + if (_Element) // element is being created again { _CP_LOG << L"[warning] : duplicate element (" << Ns << L":" << Name << L")\n"; } diff --git a/OdfFile/Writer/Format/office_elements_create.h b/OdfFile/Writer/Format/office_elements_create.h index abd12eccda..aef885a46f 100644 --- a/OdfFile/Writer/Format/office_elements_create.h +++ b/OdfFile/Writer/Format/office_elements_create.h @@ -60,18 +60,18 @@ public: typedef boost::function< office_element_ptr () > CreateFuncImpl; public: - // Зарегестрировать элемент + // Register element bool register_element(const std::wstring &ns, const std::wstring & name, CreateFuncImpl f); - // Создать элемент по имени + // Create element by name office_element_ptr create(const std::wstring & ns, const std::wstring & name, odf_conversion_context * Context = NULL, bool isRoot = false) const; private: typedef std::map<std::wstring, CreateFuncImpl> MapType; - MapType map_; - + MapType map_; + public: - // Обеспечение синглтона + // Singleton implementation static office_element_creator * get(); private: @@ -79,7 +79,7 @@ private: static office_element_creator * instance_; }; -/// Класс, обеспечивающий регистрацию элементов +/// Class that provides element registration template <class T> class RegisterElement { @@ -113,7 +113,7 @@ private: template<class T> int RegisterElement<T>::class_registered_ = 0; -/// \brief Создать элемент +/// \brief Create element bool create_element(const std::wstring & Ns, const std::wstring & Name, office_element_ptr & _Element, diff --git a/OdfFile/Writer/Format/paragraph_elements.h b/OdfFile/Writer/Format/paragraph_elements.h index 865aa75d38..7546860ec2 100644 --- a/OdfFile/Writer/Format/paragraph_elements.h +++ b/OdfFile/Writer/Format/paragraph_elements.h @@ -325,7 +325,7 @@ public: office_element_ptr_array content_; - _CP_OPT(std::wstring) text_style_name_;//ваще то это такой элемент где стиль должОн быть всегда + _CP_OPT(std::wstring) text_style_name_;//actually this is an element where style should always be present std::vector<std::wstring> text_class_names_; virtual void add_text(const std::wstring & Text); diff --git a/OdfFile/Writer/Format/style_chart_properties.h b/OdfFile/Writer/Format/style_chart_properties.h index 0982266f3b..0a2c28f82c 100644 --- a/OdfFile/Writer/Format/style_chart_properties.h +++ b/OdfFile/Writer/Format/style_chart_properties.h @@ -130,7 +130,7 @@ public: }; typedef boost::shared_ptr<chart_format_properties> chart_format_properties_ptr; -class style_chart_properties : public office_element_impl<style_chart_properties>//стили чарта не наследуются +class style_chart_properties : public office_element_impl<style_chart_properties>//chart styles are not inherited { public: static const wchar_t * ns; diff --git a/OdfFile/Writer/Format/style_presentation.h b/OdfFile/Writer/Format/style_presentation.h index b3a791eede..3179e740ca 100644 --- a/OdfFile/Writer/Format/style_presentation.h +++ b/OdfFile/Writer/Format/style_presentation.h @@ -109,8 +109,8 @@ public: _CP_OPT(std::wstring) draw_background_size_; //"border" or "full" - _CP_OPT(std::wstring) presentation_transition_type_; //manual, automatic, semi-automatic (переход отделен от эффектов кликом) - _CP_OPT(std::wstring) presentation_transition_style_; //none, fade, move, uncover,clockwise, .... игнор если smil + _CP_OPT(std::wstring) presentation_transition_type_; //manual, automatic, semi-automatic (transition separated from effects by click) + _CP_OPT(std::wstring) presentation_transition_style_; //none, fade, move, uncover,clockwise, .... ignored if smil _CP_OPT(std::wstring) presentation_transition_speed_; //slow, medium, fast _CP_OPT(bool) presentation_display_footer_; diff --git a/OdfFile/Writer/Format/styles.cpp b/OdfFile/Writer/Format/styles.cpp index 9408af114d..4ec7c7d2cf 100644 --- a/OdfFile/Writer/Format/styles.cpp +++ b/OdfFile/Writer/Format/styles.cpp @@ -146,7 +146,7 @@ style_section_properties * style_content::add_get_style_section_properties() style_table_cell_properties * style_content::add_get_style_table_cell_properties() { - //если запросили .. значит надо - создаем + //if requested.. then needed - create it if (!style_table_cell_properties_) create_element(L"style", L"table-cell-properties",style_table_cell_properties_, Context); @@ -189,7 +189,7 @@ void style_content::add_child_element( const office_element_ptr & child) ElementType type_ = child->get_type(); - switch(type_)//перезатирать??? + switch(type_)//overwrite??? { case typeStyleTextProperties: style_text_properties_ = child; break; case typeStyleParagraphProperties: style_paragraph_properties_ = child; break; diff --git a/OdfFile/Writer/Format/styles.h b/OdfFile/Writer/Format/styles.h index a932d5dc1f..347e93b24d 100644 --- a/OdfFile/Writer/Format/styles.h +++ b/OdfFile/Writer/Format/styles.h @@ -469,11 +469,11 @@ public: virtual void serialize(std::wostream & strm); - office_element_ptr_array style_master_page_; // разметки тем - office_element_ptr style_handout_master_; // разметки для принтера - .. второстепенно - office_element_ptr draw_layer_set_; // необязательно .. так как слои все равно не поддерживаются в мс. - // то есть не будут объекты объеденены по признаку слоя - // зы. не путать с обычной группировкой + office_element_ptr_array style_master_page_; // theme layouts + office_element_ptr style_handout_master_; // printer layouts - .. secondary + office_element_ptr draw_layer_set_; // optional.. since layers are not supported in MS anyway + // i.e. objects will not be grouped by layer attribute + // P.S. do not confuse with regular grouping }; CP_REGISTER_OFFICE_ELEMENT2(office_master_styles) //---------------------------------------------------------------------------------------------------- diff --git a/OdfFile/Writer/Format/table.h b/OdfFile/Writer/Format/table.h index e526657cc6..296e7cf74b 100644 --- a/OdfFile/Writer/Format/table.h +++ b/OdfFile/Writer/Format/table.h @@ -554,7 +554,7 @@ public: virtual void serialize(std::wostream & _Wostream); - int get_count(){return (int)content_.size();}//временно .. для группировок + int get_count(){return (int)content_.size();}//temporary.. for groupings office_element_ptr_array content_; //int type_; diff --git a/OdfFile/Writer/Format/table_named_expressions.h b/OdfFile/Writer/Format/table_named_expressions.h index 0fe2dbe39a..2dee85294a 100644 --- a/OdfFile/Writer/Format/table_named_expressions.h +++ b/OdfFile/Writer/Format/table_named_expressions.h @@ -84,7 +84,7 @@ public: _CP_OPT(std::wstring) table_cell_range_address_; _CP_OPT(std::wstring) table_base_cell_address_; - _CP_OPT(std::wstring) table_range_usable_as_;//printrange, filter , repeatrow, repeatcolumn через пробел + _CP_OPT(std::wstring) table_range_usable_as_;//printrange, filter, repeatrow, repeatcolumn separated by space }; diff --git a/OdfFile/Writer/Format/text_elements.h b/OdfFile/Writer/Format/text_elements.h index 786a089398..237138228b 100644 --- a/OdfFile/Writer/Format/text_elements.h +++ b/OdfFile/Writer/Format/text_elements.h @@ -341,7 +341,7 @@ public: virtual void serialize(std::wostream & _Wostream); - _CP_OPT(std::wstring) text_style_name_; //не по снецификации ... но КАК сохранить то что было изменено в формате????? + _CP_OPT(std::wstring) text_style_name_; //not according to specification... but HOW to save what was changed in format????? }; CP_REGISTER_OFFICE_ELEMENT2(text_format_change); diff --git a/OdfFile/Writer/Format/visitor.h b/OdfFile/Writer/Format/visitor.h index efc650d007..e0d165bf1b 100644 --- a/OdfFile/Writer/Format/visitor.h +++ b/OdfFile/Writer/Format/visitor.h @@ -34,40 +34,40 @@ /* -Схема работы с visitor: +Visitor pattern usage: -для классов, которые могут быть посещены visitor-ом: -1. наследуем от base_visitable -2. объявляем внутри макрос CPDOCCORE_DEFINE_VISITABLE() +For classes that can be visited by a visitor: +1. inherit from base_visitable +2. declare the CPDOCCORE_DEFINE_VISITABLE() macro inside -class example_visitable_element: public base_visitable +class example_visitable_element: public base_visitable { -// ... +// ... public: CPDOCCORE_DEFINE_VISITABLE(); -// ... +// ... }; -Для создания гостя: -1. наследуем гостя от base_visitor -2. наследуем гостя(визитор) от const_visitor<visitable_element1>/visitor<visitable_element1>, - const_visitor<visitable_element2>/visitor<visitable_element2>, и т.д. - для каждого из элементов, котоыре может посетить визитор -3. объявляем для каждого из элементов метод +To create a visitor: +1. inherit visitor from base_visitor +2. inherit visitor from const_visitor<visitable_element1>/visitor<visitable_element1>, + const_visitor<visitable_element2>/visitor<visitable_element2>, etc. + for each element that the visitor can visit +3. declare a method for each element virtual void visit(const visitable_element1& val); virtual void visit(const visitable_element2& val); - и т.д. - (в случае неконстатности - убираем const) + etc. + (in case of non-const - remove const) -class table_round : public base_visitor, +class table_round : public base_visitor, public const_visitor<office_body>, public const_visitor<office_spreadsheet>, public const_visitor<table_table> { virtual void visit(const office_body& val) { - // ... + // ... } virtual void visit(const office_spreadsheet& val) @@ -77,20 +77,20 @@ class table_round : public base_visitor, virtual void visit(const table_table& val) { - // ... + // ... } }; -Для организации обхода: -1. Создаем визитор -2. Выполняем accept для корневого элемента +To organize traversal: +1. Create a visitor +2. Execute accept for the root element office_element * root; /// ... table_round tableRoundVisitor; root->accept(tableRoundVisitor); -Внимание! Визитор САМ определяет правила обхода внутренних вершин, т.е. внутри каждой функции посещения требуется написать например +Note! The visitor ITSELF determines the rules for traversing internal nodes, i.e. inside each visit function you need to write for example virtual void visit(const office_body& val) { diff --git a/OfficeCryptReader/ooxml_crypt/main.cpp b/OfficeCryptReader/ooxml_crypt/main.cpp index ea40dd7978..571bd04de0 100644 --- a/OfficeCryptReader/ooxml_crypt/main.cpp +++ b/OfficeCryptReader/ooxml_crypt/main.cpp @@ -274,7 +274,7 @@ int main(int argc, char** argv) for (int i = 0; i <= argc; ++i) { - // чтобы не дублировать код + // to avoid duplicating code std::wstring param = L"--print"; if (i < argc) @@ -382,7 +382,7 @@ int main(int argc, char** argv) std::string docinfo = file.ReadAdditional(file_path, L"DocumentID"); std::string docinfoOld = docinfo; - // декодируем пароль (если надо) + // decode the password (if needed) if (MasterRecord.Type == rtMaster && file_password.empty()) { std::string user = U_TO_UTF8(MasterRecord.getValue(L"user")); @@ -419,7 +419,7 @@ int main(int argc, char** argv) } } - // сначала удаляем + // first, remove for (std::vector<CRecord>::iterator iter = Records.begin(); iter != Records.end(); iter++) { CRecord& rec = *iter; @@ -440,7 +440,7 @@ int main(int argc, char** argv) } } - // теперь добавляем + // now add for (std::vector<CRecord>::iterator iter = Records.begin(); iter != Records.end(); iter++) { CRecord& rec = *iter; @@ -455,7 +455,7 @@ int main(int argc, char** argv) if (!data.empty()) { - // записи не дублируем + // do not duplicate records std::string::size_type pos = docinfo.find(user); while (pos != std::string::npos) { diff --git a/OfficeCryptReader/source/CryptTransform.cpp b/OfficeCryptReader/source/CryptTransform.cpp index f822ef48bc..2512d9ee88 100644 --- a/OfficeCryptReader/source/CryptTransform.cpp +++ b/OfficeCryptReader/source/CryptTransform.cpp @@ -229,7 +229,7 @@ _buf Hmac(_buf & buf, CRYPT_METHOD::_hashAlgorithm algorithm, std::string & pla _buf HashAppend(_buf & hashBuf, _buf & block, CRYPT_METHOD::_hashAlgorithm algorithm) -{//todooo переделать +{//todooo refactor if (algorithm == CRYPT_METHOD::MD5) { MD5 hash; @@ -843,7 +843,7 @@ void ODFWriteProtect::GetCryptData(_odfWriteProtectData &_data) void ODFWriteProtect::Generate() { - //сгенерить соль + //generate salt RandomPool prng; SecByteBlock seed_salt(16); OS_GenerateRandomBlock(false, seed_salt, seed_salt.size()); @@ -900,7 +900,7 @@ void ECMAWriteProtect::GetCryptData(_ecmaWriteProtectData &_data) } void ECMAWriteProtect::Generate() { - //сгенерить соль + //generate salt RandomPool prng; SecByteBlock seed_salt(16); OS_GenerateRandomBlock(false, seed_salt, seed_salt.size()); @@ -977,7 +977,7 @@ void ECMAEncryptor::SetPassword(std::wstring _password) //--------- RandomPool prng; - //сгенерить соль + //generate salt SecByteBlock seed_salt(cryptData.saltSize); OS_GenerateRandomBlock(false, seed_salt, seed_salt.size()); if (prng.CanIncorporateEntropy()) @@ -990,14 +990,14 @@ void ECMAEncryptor::SetPassword(std::wstring _password) { prng.IncorporateEntropy(seed_datasalt, seed_datasalt.size()); } - //сгенерить ключ + //generate key SecByteBlock seed_key(cryptData.keySize); OS_GenerateRandomBlock(false, seed_key, seed_key.size()); if (prng.CanIncorporateEntropy()) { prng.IncorporateEntropy(seed_key, seed_key.size()); } - //сгенерить проверочный + //generate verification SecByteBlock seed_verify(cryptData.saltSize); OS_GenerateRandomBlock(false, seed_verify, seed_verify.size()); if (prng.CanIncorporateEntropy()) diff --git a/OfficeUtils/js/wasm/js/zlib.js b/OfficeUtils/js/wasm/js/zlib.js index 631a8dbf1a..e7815d3515 100644 --- a/OfficeUtils/js/wasm/js/zlib.js +++ b/OfficeUtils/js/wasm/js/zlib.js @@ -44,7 +44,7 @@ */ function ZLib() { - this.engine = 0; // указатель на нативный класс Zlib + this.engine = 0; // pointer to native Zlib class this.files = {}; } @@ -71,17 +71,17 @@ var arrayBuffer = (undefined !== buf.byteLength) ? new Uint8Array(buf) : buf; - // TODO: открыли архив, и заполнили this.files - // объектами { path : null } + // TODO: opened archive and filled this.files + // with objects { path : null } - // копируем память в память webasm + // copy memory to webasm memory var FileRawDataSize = arrayBuffer.length; var FileRawData = Module["_Zlib_Malloc"](FileRawDataSize); if (0 == FileRawData) return false; Module["HEAP8"].set(arrayBuffer, FileRawData); - // грузим данные + // load data this.engine = Module["_Zlib_Open"](FileRawData, FileRawDataSize); if (0 == this.engine) { @@ -89,7 +89,7 @@ return false; } - // получаем пути в архиве + // get paths in archive var pointer = Module["_Zlib_GetPaths"](this.engine); if (0 == pointer) { @@ -179,11 +179,11 @@ if (!this.isModuleInit || !this.engine) return null; - // проверяем - есть ли файл вообще? + // check if file exists at all if (undefined === this.files[path]) return null; - // проверяем - может мы уже его разжимали? + // check if we already decompressed it if (null !== this.files[path]) { if (this.files[path].l > 0) @@ -233,7 +233,7 @@ if (!data) return false; - // проверяем - может такой файл уже есть? тогда его надо сначала удалить? + // check if such file already exists - then delete it first if (undefined !== this.files[path]) this.removeFile(path); @@ -271,7 +271,7 @@ if (!this.isModuleInit || !this.engine) return false; - // проверяем - может такого файла и нет? + // check if file doesn't exist if (undefined === this.files[path]) return false; diff --git a/OfficeUtils/src/ZipBuffer.cpp b/OfficeUtils/src/ZipBuffer.cpp index ec2686354b..775e6d5a3e 100644 --- a/OfficeUtils/src/ZipBuffer.cpp +++ b/OfficeUtils/src/ZipBuffer.cpp @@ -60,7 +60,7 @@ bool current_file_is_find(unzFile uf, const char* filename) return false; std::string name(filename_inzip); - //todooo есть ли необходимость свести все к нижнему ??? + //todooo is there a need to convert everything to lowercase ??? return strcmp(filename, name.c_str()) == 0; } bool get_file(unzFile unzip_file_handle, BYTE* arr, uInt array_size) @@ -111,20 +111,20 @@ bool get_file_in_archive(unzFile unzip_file_handle, const char* filePathInZip, B } // end from (ZipUtilsCP.cpp) -// Создает архив в памяти +// Creates an archive in memory void CZipBuffer::create() { m_zipFile = NULL; m_sizeZip = 0; } -// Открывает архив в память, переданные данные необходимо освободить +// Opens an archive in memory, the passed data must be freed void CZipBuffer::open(BYTE* buffer, DWORD size) { m_zipFile = new BYTE[size]; memcpy(m_zipFile, buffer, size); m_sizeZip = size; - // Получаем пути в архиве + // Get paths in the archive BUFFER_IO* buf = new BUFFER_IO; buf->buffer = m_zipFile; buf->nSize = m_sizeZip; @@ -140,14 +140,14 @@ void CZipBuffer::open(BYTE* buffer, DWORD size) unzClose(uf); RELEASEOBJECT(buf); } -// Закрывает архив и очищает память +// Closes the archive and frees memory void CZipBuffer::close() { for (CFile& oFile : m_arrFiles) RELEASEARRAYOBJECTS(oFile.m_pData); m_arrFiles.clear(); } -// Перемещает файл в архиве +// Moves a file within the archive void CZipBuffer::move(const std::string& sSrc, const std::string& sDst) { std::vector<CFile>::iterator it = @@ -155,7 +155,7 @@ void CZipBuffer::move(const std::string& sSrc, const std::string& sDst) if (it != m_arrFiles.end()) it->m_sPath = sDst; } -// Возвращает вектор путей в архиве +// Returns a vector of paths in the archive std::vector<std::string> CZipBuffer::getPaths() { std::vector<std::string> oRes; @@ -163,7 +163,7 @@ std::vector<std::string> CZipBuffer::getPaths() oRes.push_back(oFile.m_sPath); return oRes; } -// Сохраняет архив в переданную память, полученные данные необходимо освободить +// Saves the archive to the passed memory, the returned data must be freed void CZipBuffer::save(BYTE*& data, DWORD& length) { BUFFER_IO* buf = new BUFFER_IO; @@ -193,7 +193,7 @@ void CZipBuffer::save(BYTE*& data, DWORD& length) length = m_sizeZip = buf->nCurrentPos; RELEASEOBJECT(buf); } -// По относительно пути в архиве возвращает файл, полученные данные будут освобождены после использования класса +// Returns a file by relative path in the archive, the returned data will be freed after class usage void CZipBuffer::getFile(const std::string& sPath, BYTE*& data, DWORD& length) { std::vector<CFile>::iterator it = @@ -225,7 +225,7 @@ void CZipBuffer::getFile(const std::string& sPath, BYTE*& data, DWORD& length) it->m_pData = data; RELEASEOBJECT(buf); } -// По относительно пути в архиве добавляет файл, переданные данные необходимо освободить +// Adds a file by relative path in the archive, the passed data must be freed void CZipBuffer::addFile (const std::string& sPath, BYTE* data, DWORD length) { std::vector<CFile>::iterator it = @@ -248,7 +248,7 @@ void CZipBuffer::addFile (const std::string& sPath, BYTE* data, DWORD length) it->m_nLength = length; } } -// По относительно пути в архиве удаляет файл +// Removes a file by relative path in the archive bool CZipBuffer::removeFile(const std::string& sPath) { for (std::vector<CFile>::iterator i = m_arrFiles.begin(); i != m_arrFiles.end(); i++) diff --git a/OfficeUtils/src/ZipBuffer.h b/OfficeUtils/src/ZipBuffer.h index 4ab467f399..55fd70748a 100644 --- a/OfficeUtils/src/ZipBuffer.h +++ b/OfficeUtils/src/ZipBuffer.h @@ -38,64 +38,64 @@ #include "../../Common/kernel_config.h" #include "../../DesktopEditor/common/Types.h" -// Работает с архивом в памяти +// Works with an archive in memory class KERNEL_DECL CZipBuffer { private: - // Архивированные данные + // Archived data BYTE* m_zipFile; - // Длина архивированных данных + // Length of archived data DWORD m_sizeZip; - // Файл + // File struct CFile { - // Относительный путь файла в архиве + // Relative path of the file in the archive std::string m_sPath; - // Данные файла + // File data BYTE* m_pData; - // Длина файла + // File length DWORD m_nLength; CFile(const std::string& sPath, BYTE* pData, DWORD nLength) : m_sPath(sPath), m_pData(pData), m_nLength(nLength) {} }; - // Вектор файлов в архиве + // Vector of files in the archive std::vector<CFile> m_arrFiles; friend class CZipFolderMemory; public: - // Создает архив в памяти + // Creates an archive in memory CZipBuffer() { create(); } - // Открывает архив в памяти, переданные данные необходимо освободить после использования класса + // Opens an archive in memory, the passed data must be freed after class usage CZipBuffer(BYTE* buffer, DWORD size) { open(buffer, size); } - // Закрывает архив и очищает память + // Closes the archive and frees memory ~CZipBuffer() { close(); } - // Создает архив в памяти + // Creates an archive in memory void create(); - // Открывает архив в памяти, переданные данные необходимо освободить после использования класса + // Opens an archive in memory, the passed data must be freed after class usage void open(BYTE* buffer, DWORD size); - // Закрывает архив и очищает память + // Closes the archive and frees memory void close(); - // Перемещает файл в архиве + // Moves a file within the archive void move(const std::string& sSrc, const std::string& sDst); - // Возвращает вектор путей в архиве + // Returns a vector of paths in the archive std::vector<std::string> getPaths(); - // Сохраняет архив в переданную память, полученные данные необходимо освободить + // Saves the archive to the passed memory, the returned data must be freed void save(BYTE*& data, DWORD& length); - // По относительно пути в архиве возвращает файл, полученные данные будут освобождены после использования класса + // Returns a file by relative path in the archive, the returned data will be freed after class usage void getFile(const std::string& sPath, BYTE*& data, DWORD& length); - // По относительно пути в архиве добавляет файл, переданные данные будут освобождены после использования класса + // Adds a file by relative path in the archive, the passed data will be freed after class usage void addFile (const std::string& sPath, BYTE* data, DWORD length); - // По относительно пути в архиве удаляет файл + // Removes a file by relative path in the archive bool removeFile(const std::string& sPath); }; diff --git a/OfficeUtils/src/ZipFolder.h b/OfficeUtils/src/ZipFolder.h index 478339e430..9b15017099 100644 --- a/OfficeUtils/src/ZipFolder.h +++ b/OfficeUtils/src/ZipFolder.h @@ -86,30 +86,30 @@ public: virtual ~IFolder() {} virtual IFolderType getType() = 0; - // полный путь по локальному + // full path from local path virtual std::wstring getFullFilePath(const std::wstring& path) = 0; - // локальный путь по полному (без первого '/') + // local path from full path (without the leading '/') virtual std::wstring getLocalFilePath(const std::wstring& path) = 0; - // чтение файла в буффер. промежуточный класс нужен, чтобы - // одна реализация могли отдавать память напрямую, а другая выделять и не хранить у себя + // read file into buffer. intermediate class is needed so that + // one implementation can return memory directly, while another allocates and doesn't store it virtual bool read(const std::wstring& path, CBuffer*& buffer) = 0; - // запись данных в файл + // write data to file virtual void write(const std::wstring& path, BYTE* data, DWORD length) = 0; - // работа с файлами + // file operations virtual void move(const std::wstring& src, const std::wstring& dst) = 0; virtual bool exists(const std::wstring& path) = 0; virtual void remove(const std::wstring& path) = 0; - // работа с директориями + // directory operations virtual void createDirectory(const std::wstring& path) = 0; virtual void removeDirectory(const std::wstring& path) = 0; virtual std::vector<std::wstring> getFiles(const std::wstring& path, bool recursion) = 0; - // финализация + // finalization virtual CBuffer* finalize() { return NULL; } - // чтение ноды + // read node virtual XmlUtils::CXmlNode getNodeFromFile(const std::wstring& path) = 0; virtual bool getReaderFromFile(const std::wstring& path, XmlUtils::CXmlLiteReader& oReader) = 0; - // вспомогательные функции + // helper functions void writeXml(const std::wstring& path, const std::wstring& xml) { std::string sXmlUtf8 = U_TO_UTF8(xml); @@ -298,7 +298,7 @@ private: posB = posA; - // не ищем '['. просто первый неравный + // don't search for '['. just the first non-equal //if ('[' != a[posA - 1] || '[' != b[posB - 1]) // goto error; @@ -455,14 +455,14 @@ public: } }; -// Работает с архивом в памяти +// Works with an archive in memory class CZipFolderMemory : public IFolder { CZipBuffer* m_zlib; protected: - // Конвертирует wstring -> string и убирает '/' в начале, т.к. пути относительные архива + // Converts wstring -> string and removes '/' at the beginning, since paths are relative to the archive std::string getLocalFilePathA(const std::wstring& path) { std::string sPath = U_TO_UTF8(path); @@ -472,7 +472,7 @@ protected: } public: - // Открывает архив, переданные данные необходимо освободить после использования класса + // Opens the archive, the passed data must be freed after class usage CZipFolderMemory() { m_zlib = new CZipBuffer(); @@ -481,7 +481,7 @@ public: { m_zlib = new CZipBuffer(data, length); } - // Закрывает архив и очищает память + // Closes the archive and frees memory ~CZipFolderMemory() { delete m_zlib; @@ -492,12 +492,12 @@ public: return iftZip; } - // Относительный путь до файла в архиве + // Relative path to the file in the archive virtual std::wstring getFullFilePath(const std::wstring& path) { return path; } - // Относительный путь до файла в архиве без '/' в начале + // Relative path to the file in the archive without '/' at the beginning virtual std::wstring getLocalFilePath(const std::wstring& path) { if (!path.empty() && path[0] == L'/') @@ -505,7 +505,7 @@ public: return path; } - // Читает файл по относительному пути в архиве, полученные данные необходимо освободить + // Reads a file by relative path in the archive, the returned data must be freed virtual bool read(const std::wstring& path, CBuffer*& buffer) { buffer = NULL; @@ -520,30 +520,30 @@ public: } return false; } - // Пишет файл по относительному пути в архиве, переданные данные необходимо освободить + // Writes a file by relative path in the archive, the passed data must be freed virtual void write(const std::wstring& path, BYTE* data, DWORD length) { std::string sPath = getLocalFilePathA(path); m_zlib->addFile(sPath, data, length); } - // Перемещает файл в архиве + // Moves a file within the archive virtual void move(const std::wstring& sSrc, const std::wstring& sDst) { m_zlib->move(getLocalFilePathA(sSrc), getLocalFilePathA(sDst)); } - // Содержится ли файл в архиве + // Checks if the file exists in the archive virtual bool exists(const std::wstring& path) { std::string sPath = getLocalFilePathA(path); return std::find_if(m_zlib->m_arrFiles.begin(), m_zlib->m_arrFiles.end(), [sPath](const CZipBuffer::CFile& file){ return file.m_sPath == sPath; }) != m_zlib->m_arrFiles.end(); } - // Удаляет файл по относительному пути в архиве + // Removes a file by relative path in the archive virtual void remove(const std::wstring& path) { std::string sPath = getLocalFilePathA(path); m_zlib->removeFile(sPath); } - // Создавать директорию в архиве не требуется + // Creating a directory in the archive is not required virtual void createDirectory(const std::wstring& path) { } @@ -553,7 +553,7 @@ public: for (std::vector<std::wstring>::iterator i = arFiles.begin(); i != arFiles.end(); i++) remove(*i); } - // Возвращает вектор путей расположенных в папке + // Returns a vector of paths located in the folder virtual std::vector<std::wstring> getFiles(const std::wstring& path, bool bIsRecursion) { std::string sPath = getLocalFilePathA(path); @@ -579,7 +579,7 @@ public: } return sRes; } - // Возвращает архивированные данные и закрывает архив, полученные данные необходимо освободить + // Returns the archived data and closes the archive, the returned data must be freed virtual CBuffer* finalize() { BYTE* data = NULL; @@ -588,7 +588,7 @@ public: m_zlib->close(); return new CBuffer(data, length, true); } - // Читает файл по относительному пути в архиве и формирует из него CXmlNode + // Reads a file by relative path in the archive and creates a CXmlNode from it virtual XmlUtils::CXmlNode getNodeFromFile(const std::wstring& path) { CBuffer* buffer = NULL; diff --git a/OfficeUtils/src/ZipUtilsCP.cpp b/OfficeUtils/src/ZipUtilsCP.cpp index 2ab5479b35..e2deefea30 100644 --- a/OfficeUtils/src/ZipUtilsCP.cpp +++ b/OfficeUtils/src/ZipUtilsCP.cpp @@ -487,7 +487,7 @@ namespace ZLibZipUtils std::wstring filenameW = codepage_issue_fixFromOEM(filename_inzip); - //todooo есть ли необходимость свести все к нижнему ??? + //todooo is there a need to convert everything to lowercase ??? if (wcscmp(filename, filenameW.c_str()) == 0) return true; diff --git a/PdfFile/PdfEditor.cpp b/PdfFile/PdfEditor.cpp index 286cb03696..490bcd1af3 100644 --- a/PdfFile/PdfEditor.cpp +++ b/PdfFile/PdfEditor.cpp @@ -606,7 +606,7 @@ HRESULT _ChangePassword(const std::wstring& wsPath, const std::wstring& wsPasswo PdfWriter::CDocument* pDoc = _pWriter->GetDocument(); PdfWriter::CXref* pXref = new PdfWriter::CXref(pDoc, 0); - PdfWriter::CXref* m_pXref = new PdfWriter::CXref(pDoc, xref->getNumObjects()); // Для новых объектов + PdfWriter::CXref* m_pXref = new PdfWriter::CXref(pDoc, xref->getNumObjects()); // For new objects if (!xref || !pDoc || !pXref || !m_pXref) { RELEASEOBJECT(pXref); @@ -1044,7 +1044,7 @@ bool CPdfEditor::IncrementalUpdates() oFile.CloseFile(); } - // Получение каталога и дерева страниц из reader + // Get catalog and page tree from reader Object catDict, catRefObj, pagesRefObj; if (!xref->getCatalog(&catDict)->isDict() || !catDict.dictLookupNF("Pages", &pagesRefObj)) { @@ -1060,7 +1060,7 @@ bool CPdfEditor::IncrementalUpdates() Ref catRef = catRefObj.getRef(); catRefObj.free(); - // Создание каталога для writer + // Create catalog for writer PdfWriter::CXref* pXref = new PdfWriter::CXref(pDoc, catRef.num); if (!pXref) { @@ -1148,7 +1148,7 @@ bool CPdfEditor::IncrementalUpdates() } catDict.free(); - // Проверка уникальности имён текущих цифровых подписей pdf + // Check uniqueness of current pdf digital signature names unsigned int nFormField = 0; AcroForm* form = pPDFDocument->getCatalog()->getForm(); if (form) @@ -1174,7 +1174,7 @@ bool CPdfEditor::IncrementalUpdates() nFormField--; } - // Получение шифрования из reader и применения для writer + // Get encryption from reader and apply for writer int nCryptAlgorithm = -1; PdfWriter::CEncryptDict* pEncryptDict = NULL; if (xref->isEncrypted()) @@ -1190,7 +1190,7 @@ bool CPdfEditor::IncrementalUpdates() { pEncryptDict = new PdfWriter::CEncryptDict(); - // Нужно получить словарь Encrypt БЕЗ дешифровки, поэтому времено отключаем encrypted в xref + // Need to get Encrypt dictionary WITHOUT decryption, so temporarily disable encrypted in xref xref->offEncrypted(); Object encrypt, ID, ID1; @@ -1234,11 +1234,11 @@ bool CPdfEditor::IncrementalUpdates() } } - // Применение редактирования для writer + // Apply editing for writer bool bRes = pDoc->EditPdf(xref->getLastXRefPos(), xref->getNumObjects() + 1, pXref, pCatalog, pEncryptDict, nFormField); if (bRes) { - // Воспроизведение дерева страниц во writer + // Reproduce page tree in writer GetPageTree(xref, &pagesRefObj); if (pDR && pDRXref) @@ -1351,7 +1351,7 @@ void CPdfEditor::NewFrom() } } else if (strcmp("SigFlags", chKey) == 0 || strcmp("XFA", chKey) == 0 || strcmp("DA", chKey) == 0 || strcmp("NeedAppearances", chKey) == 0) - { // Нельзя гарантировать их выполнение + { // Cannot guarantee their execution oTemp.free(); continue; } @@ -1410,7 +1410,7 @@ void CPdfEditor::NewFrom() } } else if (strcmp("DR", chKey) == 0) - { // Добавляем только уникальные ключи + { // Add only unique keys PdfWriter::CResourcesDict* pDR = pDoc->GetFieldsResources(); if (!pDR) { @@ -1547,7 +1547,7 @@ void CPdfEditor::Close() pDoc->SetPasswords(sPassword, sPassword); PdfWriter::CEncryptDict* pEncryptDict = pDoc->GetEncrypt(); - // Нужно получить словарь Encrypt БЕЗ дешифровки, поэтому времено отключаем encrypted в xref + // Need to get Encrypt dictionary WITHOUT decryption, so temporarily disable encrypted in xref xref->offEncrypted(); Object encrypt, ID, ID1; @@ -1636,8 +1636,8 @@ void CPdfEditor::Close() PdfWriter::CDocument* pDoc = m_pWriter->GetDocument(); XRef* xref = pPDFDocument->getXRef(); - // Добавляем первый элемент в таблицу xref - // он должен иметь вид 0000000000 65535 f + // Add first element to xref table + // it should have the form 0000000000 65535 f PdfWriter::CXref* pXref = new PdfWriter::CXref(pDoc, 0, 65535); if (!pXref) return; @@ -1664,7 +1664,7 @@ void CPdfEditor::Close() PdfWriter::CInfoDict* pInfoDict = NULL; if (info.isDict()) { - // Обновление Info + // Update Info PdfWriter::CObjectBase* pInfo = pTrailer->Get("Info"); pInfoXref = new PdfWriter::CXref(pDoc, pInfo ? pInfo->GetObjId() : 0); if (!pInfoXref) @@ -1873,7 +1873,7 @@ bool CPdfEditor::EditPage(int _nPageIndex, bool bSet, bool bActualPos) pPageTree->ReplacePage(_nPageIndex, pPage); pDoc->AddEditPage(pPage, _nPageIndex); - // Получение объекта страницы + // Get page object Catalog* pCatalog = pPDFDocument->getCatalog(); XRef* xref = pPDFDocument->getXRef(); Ref* pPageRef = pCatalog->getPageRef(nPageIndex); @@ -1935,7 +1935,7 @@ bool CPdfEditor::EditPage(int _nPageIndex, bool bSet, bool bActualPos) } else if (strcmp("Parent", chKey) == 0) { - // Поля родителей страниц переносятся к самим страницам + // Parent page fields are transferred to the pages themselves oTemp.free(); continue; } @@ -2054,7 +2054,7 @@ bool CPdfEditor::EditPage(int _nPageIndex, bool bSet, bool bActualPos) if (pPageRef.first == 0) return false; - // Получение объекта страницы + // Get page object Object pageRefObj, pageObj; pageRefObj.initRef(pPageRef.first, pPageRef.second); if (!pageRefObj.fetch(xref, &pageObj) || !pageObj.isDict()) @@ -2065,7 +2065,7 @@ bool CPdfEditor::EditPage(int _nPageIndex, bool bSet, bool bActualPos) } pageRefObj.free(); - // Воспроизведение словаря страницы из reader для writer + // Reproduce page dictionary from reader for writer PdfWriter::CXref* pXref = new PdfWriter::CXref(pDoc, pPageRef.first); if (!pXref) { @@ -2213,7 +2213,7 @@ bool CPdfEditor::EditPage(int _nPageIndex, bool bSet, bool bActualPos) GetCTM(xref, &pageObj, dCTM); pageObj.free(); - // Применение редактирования страницы для writer + // Apply page editing for writer if (pDoc->EditPage(pXref, pPage, _nPageIndex)) { if (bSet) @@ -2263,7 +2263,7 @@ bool CPdfEditor::SplitPages(const int* arrPageIndex, unsigned int unLength, PDFD if (unLength == 0) unLength = pPDFDocument->getNumPages(); - // Страницы должны быть созданы заранее для ссылки на них + // Pages must be created in advance to reference them Catalog* pCatalog = pPDFDocument->getCatalog(); for (unsigned int i = 0; i < unLength; ++i) { @@ -2279,7 +2279,7 @@ bool CPdfEditor::SplitPages(const int* arrPageIndex, unsigned int unLength, PDFD pPageTree->ReplacePage(nPagesBefore + (arrPageIndex ? arrPageIndex[i] : i), pPage); pDoc->AddEditPage(pPage, nPagesBefore + (arrPageIndex ? arrPageIndex[i] : i)); - // Получение объекта страницы + // Get page object Object pageRefObj, pageObj; pageRefObj.initRef(pPageRef->num, pPageRef->gen); if (!pageRefObj.fetch(xref, &pageObj)->isDict()) @@ -2297,7 +2297,7 @@ bool CPdfEditor::SplitPages(const int* arrPageIndex, unsigned int unLength, PDFD if (pPageRef->num == 0) return false; - // Получение объекта страницы + // Get page object PdfWriter::CPage* pPage = (PdfWriter::CPage*)m_mObjManager.GetObj(pPageRef->num + nStartRefID); Object pageRefObj, pageObj; pageRefObj.initRef(pPageRef->num, pPageRef->gen); @@ -2310,7 +2310,7 @@ bool CPdfEditor::SplitPages(const int* arrPageIndex, unsigned int unLength, PDFD pageRefObj.free(); bool bResources = false, bMediaBox = false, bCropBox = false, bRotate = false; - // Копирование страницы со всеми ресурсами из reader для writer + // Copy page with all resources from reader for writer for (int nIndex = 0; nIndex < pageObj.dictGetLength(); ++nIndex) { Object oTemp; @@ -2454,7 +2454,7 @@ bool CPdfEditor::SplitPages(const int* arrPageIndex, unsigned int unLength, PDFD pPage->EndText(); } else - m_pWriter->SetNeedAddHelvetica(false); // TODO дописывает шрифт для адекватного редактирования Adobe pdf без текст. Убрать при реализации map шрифтов + m_pWriter->SetNeedAddHelvetica(false); // TODO adds font for proper Adobe pdf editing without text. Remove when implementing font map pageObj.free(); } @@ -2556,12 +2556,12 @@ bool CPdfEditor::SplitPages(const int* arrPageIndex, unsigned int unLength, PDFD } } else if (strcmp("SigFlags", chKey) == 0 || strcmp("XFA", chKey) == 0 || (strcmp("DA", chKey) == 0 && pAcroForm->Get("DA")) || strcmp("NeedAppearances", chKey) == 0) - { // Нельзя гарантировать их выполнение + { // Cannot guarantee their execution oTemp.free(); continue; } else if (strcmp("DR", chKey) == 0) - { // Добавляем только уникальные ключи + { // Add only unique keys PdfWriter::CDictObject* pDR = dynamic_cast<PdfWriter::CDictObject*>(pAcroForm->Get("DR")); if (!pDR) { @@ -2657,12 +2657,12 @@ bool CPdfEditor::SplitPages(const int* arrPageIndex, unsigned int unLength, PDFD } oAcroForm.free(); oCatalog.free(); - // Переименование полей + // Renaming fields std::string sPrefix = m_pReader->GetPrefixForm(pPDFDocument); if (!sPrefix.empty()) { sPrefix = "_" + sPrefix; - std::vector<int> arrRename; // Вектор переименованных полей + std::vector<int> arrRename; // Vector of renamed fields std::map<int, PdfWriter::CAnnotation*> mAnnots = m_pWriter->GetDocument()->GetAnnots(); for (auto it = mAnnots.begin(); it != mAnnots.end(); it++) { @@ -3013,7 +3013,7 @@ bool CPdfEditor::PrintPages(const std::vector<bool>& arrPages, int nFlag) } else if (strcmp("Parent", chKey) == 0) { - // Поля родителей страниц переносятся к самим страницам + // Parent page fields are transferred to the pages themselves oTemp.free(); continue; } @@ -3158,7 +3158,7 @@ bool CPdfEditor::PrintPages(const std::vector<bool>& arrPages, int nFlag) } oType.free(); - // TODO Нужно ли генерировать внешний вид тем у кого его нет + // TODO Should we generate appearance for those who don't have it Object oAP, oAPN; if (!oAnnot.dictLookup("AP", &oAP)->isDict() || !oAP.dictLookup("N", &oAPN)->isStream()) { @@ -3352,10 +3352,10 @@ bool CPdfEditor::AddPage(int nPageIndex) // Mode WriteNew & WriteAppend m_nEditPage = -1; - // Применение добавления страницы для writer + // Apply page addition for writer if (!m_pWriter->AddPage(nPageIndex)) return false; - // По умолчанию выставляются размеры первой страницы, в дальнейшем размеры можно изменить + // By default, first page dimensions are set, they can be changed later double dPageDpiX, dPageDpiY; double dWidth, dHeight; m_pReader->GetPageInfo(0, &dWidth, &dHeight, &dPageDpiX, &dPageDpiY); @@ -3401,7 +3401,7 @@ bool CPdfEditor::EditAnnot(int _nPageIndex, int nID) if (!xref || !pPageRef || pPageRef->num == 0) return false; - // Получение объекта аннотации + // Get annotation object Object pageRefObj, pageObj, oAnnots; pageRefObj.initRef(pPageRef->num, pPageRef->gen); if (!pageRefObj.fetch(xref, &pageObj)->isDict() || !pageObj.dictLookup("Annots", &oAnnots)->isArray()) @@ -3428,7 +3428,7 @@ bool CPdfEditor::EditAnnot(int _nPageIndex, int nID) if (!pDoc->GetEditPage(_nPageIndex)) EditPage(_nPageIndex, false); - // Воспроизведение словаря аннотации из reader для writer + // Reproduce annotation dictionary from reader for writer PdfWriter::CXref* pXref = new PdfWriter::CXref(pDoc, oAnnotRef.getRefNum()); if (!pXref) { @@ -3714,7 +3714,7 @@ bool CPdfEditor::DeleteAnnot(int nID, Object* oAnnots) oAnnots = new Object(); bClear = true; - // Получение объекта аннотации + // Get annotation object Object pageRefObj, pageObj; pageRefObj.initRef(pPageRef.first, pPageRef.second); if (!pageRefObj.fetch(xref, &pageObj)->isDict() || !pageObj.dictLookup("Annots", oAnnots)->isArray()) @@ -3970,7 +3970,7 @@ bool CPdfEditor::EditWidgets(IAdvancedCommand* pCommand) Object oParentRef; oParentRef.initRef(nRefID, pEntry->type == xrefEntryCompressed ? 0 : pEntry->gen); GetWidgetParent(pPDFDocument, pDoc, &oParentRef, nStartRefID); - // TODO перевыставить детей + // TODO re-set children oParentRef.free(); } return true; @@ -4023,7 +4023,7 @@ void CPdfEditor::ClearPage() XRef* xref = pPDFDocument->getXRef(); Ref* pPageRef = pPDFDocument->getCatalog()->getPageRef(nPageIndex); - // Получение объекта страницы + // Get page object Object pageRefObj, pageObj; pageRefObj.initRef(pPageRef->num, pPageRef->gen); if (!pageRefObj.fetch(xref, &pageObj)->isDict()) @@ -4034,7 +4034,7 @@ void CPdfEditor::ClearPage() pageRefObj.free(); Object oAnnots; - // ВРЕМЕННО удаление Link аннотаций при редактировании + // TEMPORARILY delete Link annotations when editing if (pageObj.dictLookup("Annots", &oAnnots)->isArray()) { for (int nIndex = 0; nIndex < oAnnots.arrayGetLength(); ++nIndex) @@ -4074,7 +4074,7 @@ void CPdfEditor::ClearPage() } // Mode::WriteAppend && Mode::WriteNew - // Чтение и обработка шрифтов со страницы + // Reading and processing fonts from page Dict* pResources = pOPage->getResourceDict(); if (pResources) { @@ -4303,8 +4303,8 @@ std::vector<double> CPdfEditor::WriteRedact(const std::vector<std::wstring>& arr m_pWriter->put_BrushAlpha1(lAlpha1); m_pWriter->put_BrushAlpha2(lAlpha2); - // TODO рендер редакта должен быть пересечён со всеми последующими редактами - // TODO на самом деле должен быть рендер команд редакта + // TODO edit render should intersect with all subsequent edits + // TODO actually there should be render of edit commands /* PdfWriter::CPage* pCurPage = m_pWriter->GetPage(); pDoc->FixEditPage(pCurPage); @@ -4312,7 +4312,7 @@ std::vector<double> CPdfEditor::WriteRedact(const std::vector<std::wstring>& arr m_pWriter->SetPage(pFakePage); pDoc->SetCurPage(pFakePage); - // TODO Нужно нивелировать текущую матрицу до единичной, а потом сместить ещё на CropBox + // TODO Need to reset current matrix to identity, then shift by CropBox pFakePage->SetStream(pCurPage->GetStream()); pFakePage->Add("Resources", pCurPage->Get("Resources")); @@ -4337,7 +4337,7 @@ void CPdfEditor::ScanAndProcessFonts(PDFDoc* pPDFDocument, XRef* xref, Dict* pRe NSFonts::IFontManager* pFontManager = m_pReader->GetFontManager(); - // Обработка Font + // Process Font Object oFonts; if (pResources->lookup("Font", &oFonts)->isDict()) { @@ -4369,7 +4369,7 @@ void CPdfEditor::ScanAndProcessFonts(PDFDoc* pPDFDocument, XRef* xref, Dict* pRe std::wstring wsFileName, wsFontName; PdfReader::RendererOutputDev::GetFont(xref, pFontManager, pFontList, gfxFont, wsFileName, wsFontName, false); - // Собираем информацию о встроенном шрифте + // Collect information about embedded font if (!PdfReader::IsBaseFont(wsFontBaseName)) { PdfReader::TFontEntry pFontEntry; @@ -4409,7 +4409,7 @@ void CPdfEditor::ScanAndProcessFonts(PDFDoc* pPDFDocument, XRef* xref, Dict* pRe } oFonts.free(); - // Обработка XObject + // Process XObject auto fScanFonts = [this, pPDFDocument, xref, nDepth, &arrUniqueResources, pFontList, nStartRefID](Dict* pResources, const char* sName) { Object oObject; @@ -4445,7 +4445,7 @@ void CPdfEditor::ScanAndProcessFonts(PDFDoc* pPDFDocument, XRef* xref, Dict* pRe fScanFonts(pResources, "XObject"); fScanFonts(pResources, "Pattern"); - // Обработка ExtGState + // Process ExtGState Object oExtGState; if (!pResources->lookup("ExtGState", &oExtGState)->isDict()) { diff --git a/PdfFile/PdfEditor.h b/PdfFile/PdfEditor.h index c0636802f2..a582ca7a8b 100644 --- a/PdfFile/PdfEditor.h +++ b/PdfFile/PdfEditor.h @@ -64,7 +64,7 @@ public: private: PdfWriter::CDocument* m_pDoc; - std::map<int, CObjectInfo> m_mUniqueRef; // map уникальных объектов + std::map<int, CObjectInfo> m_mUniqueRef; // map of unique objects }; class CPdfEditor @@ -137,8 +137,8 @@ private: CPdfWriter* m_pWriter; int m_nError; - // 0 - Дозапись. pReader и pWriter работают с одним файлом - // 1 - Split. pReader и pWriter работают с разными файлами + // 0 - Append. pReader and pWriter work with the same file + // 1 - Split. pReader and pWriter work with different files Mode m_nMode; int m_nEditPage; int m_nOriginIndex; diff --git a/PdfFile/PdfFile.h b/PdfFile/PdfFile.h index 384c2983b2..19de091ebe 100644 --- a/PdfFile/PdfFile.h +++ b/PdfFile/PdfFile.h @@ -72,17 +72,17 @@ namespace PdfFile { typedef enum { - errorNone = 0, // Нет ошибок - errorOpenFile = 1, // Ошибка при открытии PDF файла + errorNone = 0, // No errors + errorOpenFile = 1, // Error opening PDF file errorBadCatalog = 2, // Couldn't read the page catalog - errorDamaged = 3, // PDF файл был поврежден и его невозможно восстановить - errorEncrypted = 4, // Файл зашифрован, авторизация не пройдена + errorDamaged = 3, // PDF file was damaged and cannot be recovered + errorEncrypted = 4, // File is encrypted, authorization failed errorHighlightFile = 5, // Nonexistent or invalid highlight file - errorBadPrinter = 6, // Плохой принтер - errorPrinting = 7, // Ошибка во время печати - errorPermission = 8, // Ошибка связанная с ограничениями наложенными на файл - errorBadPageNum = 9, // Неверное количество страниц - errorFileIO = 10,// Ошибка при чтении/записи + errorBadPrinter = 6, // Bad printer + errorPrinting = 7, // Error during printing + errorPermission = 8, // Error related to file restrictions + errorBadPageNum = 9, // Invalid page number + errorFileIO = 10,// Error reading/writing errorMemory = 11 // Memory exceed } EError; } @@ -93,16 +93,16 @@ public: CPdfFile(NSFonts::IApplicationFonts* pAppFonts); virtual ~CPdfFile(); NSFonts::IFontManager* GetFontManager(); - // В режиме для чтения закрытие reader, есть возможность открыть новый - // В режиме для редактирования закрытие writer, есть возможность использования reader + // In read mode closes reader, allows opening a new one + // In edit mode closes writer, allows using reader virtual void Close(); // --- EDIT --- - // Переходит в режим редактирования. Pdf уже должен быть открыт на чтение - LoadFromFile/LoadFromMemory + // Switches to edit mode. Pdf must already be opened for reading - LoadFromFile/LoadFromMemory bool EditPdf(const std::wstring& wsDstFile = L""); void EditClose(); void SetEditType(int nType); - // Манипуляции со страницами возможны в режиме редактирования + // Page manipulations are possible in edit mode bool EditPage (int nPageIndex); bool DeletePage(int nPageIndex); bool AddPage (int nPageIndex); @@ -138,7 +138,7 @@ public: virtual BYTE* GetLinks(int nPageIndex); bool ValidMetaData(); - // Захватывает полученную память malloc data + // Takes ownership of malloc data memory bool MergePages(BYTE* data, DWORD length, int nMaxID = 0, const std::string& sPrefixForm = ""); bool UnmergePages(); bool RedactPage(int nPageIndex, double* arrRedactBox, int nLengthX8, BYTE* pChanges = NULL, int nLength = 0); @@ -183,11 +183,11 @@ public: HRESULT SetRadialGradient(const double& dX1, const double& dY1, const double& dR1, const double& dX2, const double& dY2, const double& dR2); //---------------------------------------------------------------------------------------- - // Тип рендерера + // Renderer type //---------------------------------------------------------------------------------------- virtual HRESULT get_Type(LONG* lType); //---------------------------------------------------------------------------------------- - // Функции для работы со страницей + // Functions for working with page //---------------------------------------------------------------------------------------- virtual HRESULT NewPage(); virtual HRESULT get_Height(double* dHeight); @@ -197,7 +197,7 @@ public: virtual HRESULT get_DpiX(double* dDpiX); virtual HRESULT get_DpiY(double* dDpiY); //---------------------------------------------------------------------------------------- - // Функции для работы с Pen + // Functions for working with Pen //---------------------------------------------------------------------------------------- virtual HRESULT get_PenColor(LONG* lColor); virtual HRESULT put_PenColor(const LONG& lColor); @@ -221,7 +221,7 @@ public: virtual HRESULT put_PenMiterLimit(const double& dMiter); virtual HRESULT PenDashPattern(double* pPattern, LONG lCount); //---------------------------------------------------------------------------------------- - // Функции для работы с Brush + // Functions for working with Brush //---------------------------------------------------------------------------------------- virtual HRESULT get_BrushType(LONG* lType); virtual HRESULT put_BrushType(const LONG& lType); @@ -253,7 +253,7 @@ public: virtual HRESULT get_BrushScale(bool& isScale, double& scaleX, double& scaleY) const; virtual HRESULT put_BrushScale(bool isScale, const double& scaleX, const double& scaleY); //---------------------------------------------------------------------------------------- - // Функции для работы со шрифтами + // Functions for working with fonts //---------------------------------------------------------------------------------------- virtual HRESULT get_FontName(std::wstring* wsName); virtual HRESULT put_FontName(const std::wstring& wsName); @@ -270,7 +270,7 @@ public: virtual HRESULT get_FontFaceIndex(int* lFaceIndex); virtual HRESULT put_FontFaceIndex(const int& lFaceIndex); //---------------------------------------------------------------------------------------- - // Функции для вывода текста + // Functions for text output //---------------------------------------------------------------------------------------- virtual HRESULT CommandDrawTextCHAR (const LONG& lUnicode, const double& dX, const double& dY, const double& dW, const double& dH); virtual HRESULT CommandDrawTextExCHAR(const LONG& lUnicode, const LONG& lGid, const double& dX, const double& dY, const double& dW, const double& dH); @@ -278,12 +278,12 @@ public: virtual HRESULT CommandDrawTextEx (const std::wstring& wsUnicodeText, const unsigned int* pGids, const unsigned int nGidsCount, const double& dX, const double& dY, const double& dW, const double& dH); virtual HRESULT CommandDrawTextCHAR2 (unsigned int* unUnicode, const unsigned int& unUnicodeCount, const unsigned int& unGid, const double& dX, const double& dY, const double& dW, const double& dH); //---------------------------------------------------------------------------------------- - // Маркеры команд + // Command markers //---------------------------------------------------------------------------------------- virtual HRESULT BeginCommand(const DWORD& lType); virtual HRESULT EndCommand(const DWORD& lType); //---------------------------------------------------------------------------------------- - // Функции для работы с патом + // Functions for working with path //---------------------------------------------------------------------------------------- virtual HRESULT PathCommandMoveTo(const double& dX, const double& dY); virtual HRESULT PathCommandLineTo(const double& dX, const double& dY); @@ -301,23 +301,23 @@ public: virtual HRESULT PathCommandText (const std::wstring& wsUnicodeText, const double& dX, const double& dY, const double& dW, const double& dH); virtual HRESULT PathCommandTextEx (const std::wstring& wsUnicodeText, const unsigned int* pGids, const unsigned int nGidsCount, const double& dX, const double& dY, const double& dW, const double& dH); //---------------------------------------------------------------------------------------- - // Функции для вывода изображений + // Functions for image output //---------------------------------------------------------------------------------------- virtual HRESULT DrawImage(IGrObject* pImage, const double& dX, const double& dY, const double& dW, const double& dH); virtual HRESULT DrawImageFromFile(const std::wstring& wsImagePath, const double& dX, const double& dY, const double& dW, const double& dH, const BYTE& nAlpha = 255); //---------------------------------------------------------------------------------------- - // Функции для выставления преобразования + // Functions for setting transformation //---------------------------------------------------------------------------------------- virtual HRESULT SetTransform(const double& dM11, const double& dM12, const double& dM21, const double& dM22, const double& dX, const double& dY); virtual HRESULT GetTransform(double* dM11, double* dM12, double* dM21, double* dM22, double* dX, double* dY); virtual HRESULT ResetTransform(); //---------------------------------------------------------------------------------------- - // Тип клипа + // Clip type //---------------------------------------------------------------------------------------- virtual HRESULT get_ClipMode(LONG* lMode); virtual HRESULT put_ClipMode(const LONG& lMode); //---------------------------------------------------------------------------------------- - // Дополнительные функции + // Additional functions //---------------------------------------------------------------------------------------- virtual HRESULT CommandLong(const LONG& lType, const LONG& lCommand); virtual HRESULT CommandDouble(const LONG& lType, const double& dCommand); diff --git a/PdfFile/PdfReader.cpp b/PdfFile/PdfReader.cpp index df55fc3186..bde27114a6 100644 --- a/PdfFile/PdfReader.cpp +++ b/PdfFile/PdfReader.cpp @@ -91,7 +91,7 @@ CPdfReader::CPdfReader(NSFonts::IApplicationFonts* pAppFonts) globalParams->setErrQuiet(gTrue); #endif - // Создаем менеджер шрифтов с собственным кэшем + // Create font manager with its own cache m_pFontManager = InitFontManager(pAppFonts); #ifndef BUILDING_WASM_MODULE globalParams->setupBaseFonts(NULL); @@ -196,8 +196,8 @@ bool CPdfReader::LoadFromMemory(NSFonts::IApplicationFonts* pAppFonts, BYTE* dat m_eError = errNone; m_nFileLength = length; - // Все LoadFromMemory копируют память в свои классы - // Кроме того MemStream использует malloc/free память + // All LoadFromMemory copy memory into their classes + // Also MemStream uses malloc/free memory BYTE* pCopy = (BYTE*)malloc(length); memcpy(pCopy, data, length); data = pCopy; @@ -474,8 +474,8 @@ bool CPdfReader::MergePages(BYTE* pData, DWORD nLength, const wchar_t* wsPasswor Object obj; obj.initNull(); - // будет освобожден в деструкторе PDFDoc - // Время его жизни > copy и makeSubStream из MemStream + // will be freed in PDFDoc destructor + // Its lifetime > copy and makeSubStream from MemStream BaseStream *str = new MemStream((char*)pData, 0, nLength, &obj, gTrue); CPdfReaderContext* pContext = new CPdfReaderContext(); pContext->m_pDocument = new PDFDoc(str, owner_pswd, user_pswd); @@ -494,7 +494,7 @@ bool CPdfReader::MergePages(BYTE* pData, DWORD nLength, const wchar_t* wsPasswor m_eError = pDoc ? pDoc->getErrorCode() : errMemory; if (!pDoc || !pDoc->isOk()) { - // pData освобождается + // pData is freed delete pContext; m_vPDFContext.pop_back(); return false; @@ -518,7 +518,7 @@ bool CPdfReader::MergePages(const std::wstring& wsFile, const wchar_t* wsPasswor user_pswd = NSStrings::CreateString(wsPassword); } - // конвертим путь в utf8 - под виндой они сконвертят в юникод, а на остальных - так и надо + // convert path to utf8 - on Windows they will convert to unicode, on others - that's what we need std::string sPathUtf8 = U_TO_UTF8(wsFile); CPdfReaderContext* pContext = new CPdfReaderContext(); @@ -680,7 +680,7 @@ void CPdfReader::DrawPageOnRenderer(IRenderer* pRenderer, int _nPageIndex, bool* LONG lRendererType = 0; pRenderer->get_Type(&lRendererType); if (c_nDocxWriter == lRendererType) - return; // Без отрисовки Redact при ScanPage + return; // No Redact rendering during ScanPage Page* pPage = pDoc->getCatalog()->getPage(nPageIndex); PDFRectangle* cropBox = pPage->getCropBox(); @@ -1104,7 +1104,7 @@ BYTE* CPdfReader::GetStructure() oRes.AddInt(nStartPage); oRes.AddInt(1); oRes.AddDouble(0); - oRes.WriteString(std::to_string(iPDF)); // TODO Писать имя файла как Adobe? + oRes.WriteString(std::to_string(iPDF)); // TODO Write filename like Adobe? } for (int i = 0, num = pList->getLength(); i < num; i++) @@ -1124,7 +1124,7 @@ BYTE* CPdfReader::GetStructure() } BYTE* CPdfReader::GetLinks(int _nPageIndex) { - // TODO Links должны стать частью Annots + // TODO Links should become part of Annots PDFDoc* pDoc = NULL; int nPageIndex = GetPageIndex(_nPageIndex, &pDoc); if (nPageIndex < 0 || !pDoc || !pDoc->getCatalog()) @@ -1136,7 +1136,7 @@ BYTE* CPdfReader::GetLinks(int _nPageIndex) NSWasm::CPageLink oLinks; - // Гиперссылка + // Hyperlink /* Links* pLinks = pDoc->getLinks(nPageIndex); if (pLinks) @@ -1222,7 +1222,7 @@ BYTE* CPdfReader::GetLinks(int _nPageIndex) nRotate = -pDoc->getPageRotate(nPageIndex); #endif - // Текст-ссылка + // Text-link TextOutputControl textOutControl; textOutControl.mode = textOutReadingOrder; TextOutputDev* pTextOut = new TextOutputDev(NULL, &textOutControl, gFalse); @@ -1407,7 +1407,7 @@ BYTE* CPdfReader::VerifySign(const std::wstring& sFile, ICertificate* pCertifica int nByteOffset = 0; for (int j = 0; j < arrByteOffset.size(); ++j) { - // TODO проверка длины файла и ByteRange + // TODO check file length and ByteRange memcpy(pDataForVerify + nByteOffset, pFileData + arrByteOffset[j], arrByteLength[j]); nByteOffset += arrByteLength[j]; } @@ -1425,7 +1425,7 @@ BYTE* CPdfReader::VerifySign(const std::wstring& sFile, ICertificate* pCertifica RELEASEARRAYOBJECTS(pDataForVerify); oObj1.free(); - // Номер аннотации для сопоставления с AP + // Annotation number for matching with AP oRes.AddInt(i); oRes.AddInt(nRes); } @@ -1524,7 +1524,7 @@ BYTE* CPdfReader::GetButtonIcon(int nBackgroundColor, int _nPageIndex, bool bBas Object oStr, oXObject, oIm;; if (oMK.dictLookup(sMKName.c_str(), &oStr)->isStream()) { - // Получение единственного XObject из Resources, если возможно + // Get single XObject from Resources, if possible Object oResources; if (!oStr.streamGetDict()->lookup("Resources", &oResources)->isDict() || !oResources.dictLookup("XObject", &oXObject)->isDict() || oXObject.dictGetLength() != 1 || !oXObject.dictGetVal(0, &oIm)->isStream()) @@ -1536,7 +1536,7 @@ BYTE* CPdfReader::GetButtonIcon(int nBackgroundColor, int _nPageIndex, bool bBas } else if ((oStr.free(), true) && oMK.dictLookup("I", &oStr)->isNull() && oAP.isDict() && (oStr.free(), true) && oAP.dictLookup(arrAPName[j], &oStr)->isStream()) { - // Получение единственного XObject из Resources, если возможно + // Get single XObject from Resources, if possible Object oResources; if (!oStr.streamGetDict()->lookup("Resources", &oResources)->isDict() || !oResources.dictLookup("XObject", &oXObject)->isDict() || oXObject.dictGetLength() != 1 || !oXObject.dictGetVal(0, &oIm)->isStream()) @@ -1571,11 +1571,11 @@ BYTE* CPdfReader::GetButtonIcon(int nBackgroundColor, int _nPageIndex, bool bBas { Object oFieldRef; pField->getFieldRef(&oFieldRef); - // Номер аннотации для сопоставления с AP + // Annotation number for matching with AP oRes.AddInt(oFieldRef.getRefNum() + nStartRefID); oFieldRef.free(); - // Количество иконок 1-3 + // Number of icons 1-3 nMKPos = oRes.GetSize(); oRes.AddInt(nMKLength); bFirst = false; @@ -2026,7 +2026,7 @@ int GetPageAnnots(PDFDoc* pdfDoc, NSFonts::IFontManager* pFontManager, PdfReader // { // pAnnot = new PdfReader::CAnnotPopup(pdfDoc, &oAnnotRef, nPageIndex, nStartRefID); // } - // TODO Все аннотации + // TODO All annotations oAnnotRef.free(); if (pAnnot) diff --git a/PdfFile/PdfReader.h b/PdfFile/PdfReader.h index bf2f4a8273..81cce2ce9f 100644 --- a/PdfFile/PdfReader.h +++ b/PdfFile/PdfReader.h @@ -89,7 +89,7 @@ public: int GetMaxRefID(); int GetNumPages(); bool ValidMetaData(); - // Захватывает полученную память malloc data + // Takes ownership of malloc data memory bool MergePages(BYTE* pData, DWORD nLength, const wchar_t* wsPassword = NULL, int nMaxID = 0, const std::string& sPrefixForm = ""); bool MergePages(const std::wstring& wsFile, const wchar_t* wsPassword = NULL, int nMaxID = 0, const std::string& sPrefixForm = ""); bool UnmergePages(); diff --git a/PdfFile/PdfWriter.cpp b/PdfFile/PdfWriter.cpp index 025829a585..509c9a4cc7 100644 --- a/PdfFile/PdfWriter.cpp +++ b/PdfFile/PdfWriter.cpp @@ -95,7 +95,7 @@ #define LO_SURROGATE_START 0xDC00 #define LO_SURROGATE_END 0xDFFF -// Этих типов браша нет в рендерере, мы их используем, когда конвертим из веба +// These brush types don't exist in renderer, we use them when converting from web static const long c_BrushTypeLinearGradient = 8001; static const long c_BrushTypeRadialGradient = 8002; @@ -160,7 +160,7 @@ Aggplus::CImage* ConvertMetafile(NSFonts::IApplicationFonts* pAppFonts, const st //---------------------------------------------------------------------------------------- CPdfWriter::CPdfWriter(NSFonts::IApplicationFonts* pAppFonts, bool isPDFA, IRenderer* pRenderer, bool bCreate, const std::wstring& wsTempDirectory) : m_oCommandManager(this) { - // Создаем менеджер шрифтов с собственным кэшем + // Create font manager with its own cache m_pFontManager = pAppFonts->GenerateFontManager(); NSFonts::IFontsCache* pMeasurerCache = NSFonts::NSFontCache::Create(); pMeasurerCache->SetStreams(pAppFonts->GetStreams()); @@ -218,7 +218,7 @@ void CPdfWriter::SetDocumentID(const std::wstring& wsDocumentID) } int CPdfWriter::SaveToFile(const std::wstring& wsPath) { - // TODO: Переделать на код ошибки + // TODO: Refactor to use error code if (!IsValid()) return 1; @@ -238,7 +238,7 @@ int CPdfWriter::SaveToFile(const std::wstring& wsPath) } int CPdfWriter::SaveToMemory(BYTE** pData, int* pLength) { - // TODO: Переделать на код ошибки + // TODO: Refactor to use error code if (!IsValid()) return 1; @@ -276,7 +276,7 @@ void CPdfWriter::SetTempDirectory(const std::wstring& wsTempDirectory) m_wsTempDirectory = wsTempDirectory; } //---------------------------------------------------------------------------------------- -// Функции для работы со страницей +// Functions for working with page //---------------------------------------------------------------------------------------- HRESULT CPdfWriter::NewPage() { @@ -329,7 +329,7 @@ HRESULT CPdfWriter::put_Width(const double& dWidth, bool bMM2PT) return S_OK; } //---------------------------------------------------------------------------------------- -// Функции для работы с Pen +// Functions for working with Pen //---------------------------------------------------------------------------------------- HRESULT CPdfWriter::get_PenColor(LONG* lColor) { @@ -437,7 +437,7 @@ HRESULT CPdfWriter::PenDashPattern(double* pPattern, LONG lCount) return S_OK; } //---------------------------------------------------------------------------------------- -// Функции для работы с Brush +// Functions for working with Brush //---------------------------------------------------------------------------------------- HRESULT CPdfWriter::get_BrushType(LONG* lType) { @@ -537,8 +537,8 @@ HRESULT CPdfWriter::put_BrushLinearAngle(const double& dAngle) } HRESULT CPdfWriter::BrushRect(const INT& nVal, const double& dLeft, const double& dTop, const double& dWidth, const double& dHeight) { - // Данными параметрами пользуемся, только если пришла команда EnableBrushRect, если команда не пришла, тогда - // ориентируемся на границы пата. + // We use these parameters only if EnableBrushRect command was received, if the command was not received, then + // we use path boundaries. m_oBrush.SetBrushRect(nVal, dLeft, dTop, dWidth, dHeight); m_oBrush.EnableBrushRect(1 == nVal ? true : false); return S_OK; @@ -589,7 +589,7 @@ HRESULT CPdfWriter::put_BrushScale(bool isScale, const double& scaleX, const dou return S_OK; } //---------------------------------------------------------------------------------------- -// Функции для работы со шрифтами +// Functions for working with fonts //---------------------------------------------------------------------------------------- HRESULT CPdfWriter::get_FontName(std::wstring* wsName) { @@ -686,7 +686,7 @@ HRESULT CPdfWriter::put_FontFaceIndex(const int& nFaceIndex) return S_OK; } //---------------------------------------------------------------------------------------- -// Функции для вывода текста +// Functions for text output //---------------------------------------------------------------------------------------- bool UnicodePUA(unsigned int unUnicode) { @@ -731,7 +731,7 @@ HRESULT CPdfWriter::CommandDrawText(const std::wstring& wsUnicodeText, const dou if (!pCodes) return DrawTextToRenderer(NULL, 0, dX, dY, wsUnicodeText) ? S_OK : S_FALSE; - // Специальный случай для текста из Djvu, нам не нужно, чтобы он рисовался + // Special case for text from Djvu, we don't need it to be drawn if (L"" == m_oFont.GetPath() && L"DjvuEmptyFont" == m_oFont.GetName()) { if (m_bNeedUpdateTextFont) @@ -836,14 +836,14 @@ HRESULT CPdfWriter::CommandDrawTextCHAR2(unsigned int* pUnicodes, const unsigned return DrawText(pCodes, 2, dX, dY, UnicodesPUA(pUnicodes, unUnicodeCount) ? NSStringExt::CConverter::GetUtf8FromUTF32(pUnicodes, unUnicodeCount) : "") ? S_OK : S_FALSE; } //---------------------------------------------------------------------------------------- -// Маркеры команд +// Command markers //---------------------------------------------------------------------------------------- HRESULT CPdfWriter::EndCommand(const DWORD& dwType) { if (!IsPageValid()) return S_FALSE; - // Здесь мы различаем лишь 2 команды: присоединить текущий пат к клипу и отменить клип + // Here we distinguish only 2 commands: attach current path to clip and cancel clip if (c_nClipType == dwType) { m_oCommandManager.Flush(); @@ -880,7 +880,7 @@ HRESULT CPdfWriter::EndCommand(const DWORD& dwType) return S_OK; } //---------------------------------------------------------------------------------------- -// Функции для работы с патом +// Functions for working with path //---------------------------------------------------------------------------------------- HRESULT CPdfWriter::PathCommandStart() { @@ -1104,7 +1104,7 @@ HRESULT CPdfWriter::PathCommandTextEx(const std::wstring& wsUnicodeText, const u return bRes ? S_OK : S_FALSE; } //---------------------------------------------------------------------------------------- -// Функции для вывода изображений +// Functions for image output //---------------------------------------------------------------------------------------- HRESULT CPdfWriter::DrawImage(IGrObject* pImage, const double& dX, const double& dY, const double& dW, const double& dH) { @@ -1155,7 +1155,7 @@ HRESULT CPdfWriter::DrawImageFromFile(NSFonts::IApplicationFonts* pAppFonts, con return hRes; } //---------------------------------------------------------------------------------------- -// Функции для выставления преобразования +// Functions for setting transformation //---------------------------------------------------------------------------------------- HRESULT CPdfWriter::SetTransform(const double& dM11, const double& dM12, const double& dM21, const double& dM22, const double& dX, const double& dY) { @@ -1190,7 +1190,7 @@ HRESULT CPdfWriter::put_ClipMode(const LONG& lMode) return S_OK; } //---------------------------------------------------------------------------------------- -// Дополнительные функции +// Additional functions //---------------------------------------------------------------------------------------- HRESULT CPdfWriter::AddHyperlink(const double& dX, const double& dY, const double& dW, const double& dH, const std::wstring& wsUrl, const std::wstring& wsTooltip) { @@ -1359,7 +1359,7 @@ HRESULT CPdfWriter::AddFormField(NSFonts::IApplicationFonts* pAppFonts, CFormFie double _dY = m_pPage->GetHeight() - MM_2_PT(dY); double _dB = m_pPage->GetHeight() - MM_2_PT(dY + dH); - double dMargin = 2; // такой отступ используется в AdobeReader + double dMargin = 2; // this margin is used in AdobeReader double dBaseLine = MM_2_PT(dH - oInfo.GetBaseLineOffset()); double dShiftX = dMargin; @@ -1410,8 +1410,8 @@ HRESULT CPdfWriter::AddFormField(NSFonts::IApplicationFonts* pAppFonts, CFormFie m_oLinesManager.Init(pCodes2, pWidths, unLen, ushSpaceCode, ushNewLineCode, pFontTT->GetLineHeight(), pFontTT->GetAscent()); - // TODO: Разобраться более детально по какой именно высоте идет в Adobe расчет - // пока временно оставим (H - 3 * margin) + // TODO: Figure out in more detail which height Adobe uses for calculation + // for now temporarily leave (H - 3 * margin) if (pPr->IsAutoFit()) dFontSize = m_oLinesManager.ProcessAutoFit(MM_2_PT(dW), (MM_2_PT(dH) - 3 * dMargin)); @@ -1462,7 +1462,7 @@ HRESULT CPdfWriter::AddFormField(NSFonts::IApplicationFonts* pAppFonts, CFormFie pShifts = new double[unShiftsCount]; if (pShifts && unShiftsCount) { - // Сдвиг нулевой для comb форм и не забываем, что мы к ширине добавили 2 * dMargin + // Zero shift for comb forms and don't forget that we added 2 * dMargin to width dShiftX = 0; unsigned int unCellsCount = std::max(unShiftsCount, pPr->GetMaxCharacters()); double dPrevW = 0; @@ -1600,7 +1600,7 @@ HRESULT CPdfWriter::AddFormField(NSFonts::IApplicationFonts* pAppFonts, CFormFie if (!pPr->IsEditComboBox()) { - // Для drop-down list в 0 позиции мы добавили плейсхолдер + // For drop-down list at position 0 we added placeholder if (oInfo.IsPlaceHolder()) unSelectedIndex = 0; else if (0xFFFF != unSelectedIndex) @@ -1701,8 +1701,8 @@ HRESULT CPdfWriter::AddFormField(NSFonts::IApplicationFonts* pAppFonts, CFormFie pField->SetFormat(pPr->GetFormat()); } - // Выставляем имя в конце, потому что там возможно копирование настроек поля в новое родительское поле, поэтому к текущему моменту - // все настройки должны быть выставлены + // Set name at the end, because field settings may be copied to a new parent field there, so by this point + // all settings must be set if (!bRadioButton) { std::wstring wsKey = oInfo.GetKey(); @@ -2442,7 +2442,7 @@ HRESULT CPdfWriter::AddAnnotField(NSFonts::IApplicationFonts* pAppFonts, CAnnotF pFontTT = m_pDocument->CreateTrueTypeFont(m_pFont); pWidgetAnnot->SetDA(pFontTT, oInfo.GetWidgetAnnotPr()->GetFontSize(), dFontSize, oInfo.GetWidgetAnnotPr()->GetTC()); - // ВНЕШНИЙ ВИД + // APPEARANCE pButtonWidget->SetFont(m_pFont, dFontSize, isBold, isItalic); if (nFlags & (1 << 10)) { @@ -2502,7 +2502,7 @@ HRESULT CPdfWriter::AddAnnotField(NSFonts::IApplicationFonts* pAppFonts, CAnnotF pButtonWidget->SetDA(pFont, oInfo.GetWidgetAnnotPr()->GetFontSize(), dFontSize, oInfo.GetWidgetAnnotPr()->GetTC()); } - // ВНЕШНИЙ ВИД + // APPEARANCE //if (!pButtonWidget->Get("AP")) pButtonWidget->SetAP(nR); @@ -2760,7 +2760,7 @@ void CPdfWriter::SetHeadings(CHeadings* pCommand) } void CPdfWriter::SetNeedAddHelvetica(bool bNeedAddHelvetica) { m_bNeedAddHelvetica = bNeedAddHelvetica; } //---------------------------------------------------------------------------------------- -// Дополнительные функции Pdf рендерера +// Additional PDF renderer functions //---------------------------------------------------------------------------------------- HRESULT CPdfWriter::DrawImage1bpp(NSImages::CPixJbig2* pImageBuffer, const unsigned int& unWidth, const unsigned int& unHeight, const double& dX, const double& dY, const double& dW, const double& dH) { @@ -2833,7 +2833,7 @@ HRESULT CPdfWriter::EditWidgetParents(NSFonts::IApplicationFonts* pAppFonts, CWi std::vector<std::wstring> arrValue; int nFlags = pParent->nFlags; - // Adobe не может смешивать юникод и utf имена полей + // Adobe cannot mix unicode and utf field names if (nFlags & (1 << 0)) pParentObj->Add("T", new PdfWriter::CStringObject((U_TO_UTF8(pParent->sName)).c_str(), true)); @@ -3279,7 +3279,7 @@ bool CPdfWriter::FinalizeSignature(BYTE* pSignedData, DWORD dwDataLength) } //---------------------------------------------------------------------------------------- -// Внутренние функции +// Internal functions //---------------------------------------------------------------------------------------- bool CPdfWriter::SkipRedact(const double& dX, const double& dY, const double& dW, const double& dH) { @@ -3356,7 +3356,7 @@ PdfWriter::CImageDict* CPdfWriter::LoadImage(Aggplus::CImage* pImage, BYTE nAlph BYTE* pData = pImage->GetData(); int nStride = 4 * nImageW; - // Картинки совсем маленьких размеров нельзя делать Jpeg2000 + // Very small images cannot be made Jpeg2000 bool bJpeg = false; if (nImageH < 100 || nImageW < 100 || m_pDocument->IsPDFA()) bJpeg = true; @@ -3364,11 +3364,11 @@ PdfWriter::CImageDict* CPdfWriter::LoadImage(Aggplus::CImage* pImage, BYTE nAlph if (nImageH <= 0 || nImageW <= 0) return NULL; - // TODO: Пока не разберемся как в CxImage управлять параметрами кодирования нельзя писать в Jpeg2000, - // т.к. файлы получаются гораздо больше и конвертация идет намного дольше. + // TODO: Until we figure out how to manage encoding parameters in CxImage, we cannot write to Jpeg2000, + // because files become much larger and conversion takes much longer. bJpeg = true; - // Пробегаемся по картинке и определяем есть ли у нас альфа-канал + // Iterate through the image and determine if we have an alpha channel bool bAlpha = false; CBgraFrame oFrame; @@ -3463,8 +3463,8 @@ bool CPdfWriter::DrawText(unsigned char* pCodes, const unsigned int& unLen, cons if (!pCodes || !unLen) return false; - // TODO должна быть проверка центрального положения, а не точки начала - // TODO Сюда приходит много символов за раз, и нужно отрисовать только те, что вне областей редакта + // TODO should check center position, not start point + // TODO Many characters arrive here at once, and we need to draw only those outside redact areas if (SkipRedact(dX, dY)) return true; @@ -3492,11 +3492,11 @@ bool CPdfWriter::DrawTextToRenderer(const unsigned int* unGid, const unsigned in { if (m_bSplit) return false; - // TODO должна быть проверка центрального положения, а не точки начала - // TODO Сюда приходит много символов за раз, и нужно отрисовать только те, что вне областей редакта + // TODO should check center position, not start point + // TODO Many characters arrive here at once, and we need to draw only those outside redact areas if (SkipRedact(dX, dY)) return true; - // TODO pdf позволяет создание своего шрифта, но не следует это использовать для воссоздания шрифта запрещенного для редактирования или встраивания + // TODO pdf allows creating custom font, but this should not be used to recreate a font that is prohibited for editing or embedding Aggplus::CGraphicsPathSimpleConverter simplifier; simplifier.SetRenderer(m_pRenderer); m_pFontManager->LoadFontByName(m_oFont.GetName(), m_oFont.GetSize(), (int)m_oFont.GetStyle(), 72.0, 72.0); @@ -3511,8 +3511,8 @@ bool CPdfWriter::DrawTextToRenderer(const unsigned int* unGid, const unsigned in } bool CPdfWriter::PathCommandDrawText(unsigned int* pUnicodes, unsigned int unLen, const double& dX, const double& dY, const unsigned int* pGids) { - // TODO должна быть проверка центрального положения, а не точки начала - // TODO Сюда приходит много символов за раз, и нужно отрисовать только те, что вне областей редакта + // TODO should check center position, not start point + // TODO Many characters arrive here at once, and we need to draw only those outside redact areas if (SkipRedact(dX, dY)) return true; @@ -3607,7 +3607,7 @@ bool CPdfWriter::IsEmbeddedFont(const std::wstring& wsName) { if (wsName.find(L"Embedded: ") != 0) return false; - // Исключаем Base14 шрифты + // Exclude Base14 fonts int nBase14 = IsEmbeddedBase14(wsName); return nBase14 < 0; } @@ -3741,7 +3741,7 @@ PdfWriter::CFontCidTrueType* CPdfWriter::GetFont(const std::wstring& wsFontPath, if (m_bSplit) return pFont; - // TODO: Пока мы здесь предполагаем, что шрифты только либо TrueType, либо OpenType + // TODO: For now we assume fonts are only either TrueType or OpenType if (!m_pFontManager->LoadFontFromFile(wsFontPath, lFaceIndex, 10, 72, 72)) { std::wcout << L"PDF Writer: Can't load fontfile " << wsFontPath.c_str() << "\n"; @@ -3824,7 +3824,7 @@ void CPdfWriter::UpdatePen() LONG lDashStyle = m_oPen.GetDashStyle(); if (Aggplus::DashStyleSolid == lDashStyle) { - // Ничего не делаем + // Do nothing } else if (Aggplus::DashStyleCustom == lDashStyle) { @@ -3843,7 +3843,7 @@ void CPdfWriter::UpdatePen() } else { - // TODO: Реализовать другие типы пунктирных линий + // TODO: Implement other types of dashed lines } if (pDashPattern && lDashCount) @@ -3917,7 +3917,7 @@ void CPdfWriter::UpdateBrush(NSFonts::IApplicationFonts* pAppFonts, const std::w _CXIMAGE_FORMAT_SVM == oImageFormat.eFileType || _CXIMAGE_FORMAT_SVG == oImageFormat.eFileType) { - // TODO: Реализовать отрисовку метафайлов по-нормальному + // TODO: Implement proper metafile rendering MetaFile::IMetaFile* pMeta = MetaFile::Create(pAppFonts); pMeta->LoadFromFile(wsTexturePath.c_str()); @@ -3994,18 +3994,18 @@ void CPdfWriter::UpdateBrush(NSFonts::IApplicationFonts* pAppFonts, const std::w double dXStepSpacing = 0, dYStepSpacing = 0; if (c_BrushTextureModeStretch == lTextureMode) { - // Растягиваем картинку по размерам пата + // Stretch image to path dimensions dW = std::max(10.0, dR - dL); dH = std::max(10.0, dB - dT); - // Чтобы избавиться от погрешностей из-за которых могут возникать полоски или обрезание картинки, - // удвоим расстрояние между соседними тайлами. Плохого тут нет, т.к. нам нужен всего 1 тайл + // To eliminate errors that may cause stripes or image clipping, + // double the distance between adjacent tiles. There's nothing bad here since we only need 1 tile dXStepSpacing = dW; dYStepSpacing = dH; } else // Tile { - // Размеры картинки заданы в пикселях. Размеры тайла - это размеры картинки в пунктах. + // Image dimensions are specified in pixels. Tile dimensions are image dimensions in points. dW = (double)nImageW * 72.0 / 96.0; dH = (double)nImageH * 72.0 / 96.0; @@ -4029,7 +4029,7 @@ void CPdfWriter::UpdateBrush(NSFonts::IApplicationFonts* pAppFonts, const std::w else if (c_BrushTextureModeTileFlipXY == lTextureMode) ePatternType = PdfWriter::imagetilepatterntype_InverseXY; - // Нам нужно, чтобы левый нижний угол границ нашего пата являлся точкой переноса для матрицы преобразования. + // We need the lower left corner of our path bounds to be the translation point for the transformation matrix. PdfWriter::CMatrix* pMatrix = m_pPage->GetTransform(); pMatrix->Apply(dL, dT); PdfWriter::CMatrix oPatternMatrix = *pMatrix; @@ -4231,7 +4231,7 @@ unsigned char* CPdfWriter::EncodeGID(const unsigned int& unGID, const unsigned i { unsigned short ushCode = m_pFontEmbedded->EncodeUnicode(unGID, *pUnicodes); - // Для CFontEmbedded ширины уже загружены, ничего не добавляем + // For CFontEmbedded widths are already loaded, we don't add anything unsigned char* pCodes = new unsigned char[2]; pCodes[0] = (ushCode >> 8) & 0xFF; @@ -4392,7 +4392,7 @@ void CPdfWriter::DrawTextWidget(NSFonts::IApplicationFonts* pAppFonts, PdfWriter if (nType == PdfWriter::EBorderType::Beveled || nType == PdfWriter::EBorderType::Inset) dShiftBorder *= 2; - // Коды, шрифты, количество + // Codes, fonts, count unsigned int unLen = 0; unsigned int* pUnicodes = NULL; unsigned short* pCodes = NULL; @@ -4760,7 +4760,7 @@ void CPdfWriter::DrawButtonWidget(NSFonts::IApplicationFonts* pAppFonts, PdfWrit if (pFontTT) { double dKoef = dFontSize / pFontTT->m_dUnitsPerEm; - // TODO что-то между m_dMaxY-m_dMinY и m_dHeight, но не просто среднее + // TODO something between m_dMaxY-m_dMinY and m_dHeight, but not just average dLineH = (pFontTT->m_dMaxY + std::abs(pFontTT->m_dMinY) + pFontTT->m_dHeight) / 2.0 * dKoef; // dLineH = (pFontTT->m_dMaxY + std::abs(pFontTT->m_dMinY)) * dKoef; // dLineH = pFontTT->m_dHeight * dKoef; diff --git a/PdfFile/PdfWriter.h b/PdfFile/PdfWriter.h index f520350f79..3f8b7d8eb9 100644 --- a/PdfFile/PdfWriter.h +++ b/PdfFile/PdfWriter.h @@ -77,7 +77,7 @@ public: std::wstring GetTempFile(const std::wstring& wsDirectory); void SetTempDirectory(const std::wstring& wsTempDirectory); //---------------------------------------------------------------------------------------- - // Функции для работы со страницей + // Functions for working with page //---------------------------------------------------------------------------------------- HRESULT NewPage(); HRESULT get_Height(double* dHeight); @@ -85,7 +85,7 @@ public: HRESULT get_Width(double* dWidth); HRESULT put_Width(const double& dWidth, bool bMM2PT = true); //---------------------------------------------------------------------------------------- - // Функции для работы с Pen + // Functions for working with Pen //---------------------------------------------------------------------------------------- HRESULT get_PenColor(LONG* lColor); HRESULT put_PenColor(const LONG& lColor); @@ -109,7 +109,7 @@ public: HRESULT put_PenMiterLimit(const double& dMiter); HRESULT PenDashPattern(double* pPattern, LONG lCount); //---------------------------------------------------------------------------------------- - // Функции для работы с Brush + // Functions for working with Brush //---------------------------------------------------------------------------------------- HRESULT get_BrushType(LONG* lType); HRESULT put_BrushType(const LONG& lType); @@ -140,7 +140,7 @@ public: HRESULT get_BrushScale(bool& isScale, double& scaleX, double& scaleY) const; HRESULT put_BrushScale(bool isScale, const double& scaleX, const double& scaleY); //---------------------------------------------------------------------------------------- - // Функции для работы со шрифтами + // Functions for working with fonts //---------------------------------------------------------------------------------------- HRESULT get_FontName(std::wstring* wsName); HRESULT put_FontName(const std::wstring& wsName); @@ -157,7 +157,7 @@ public: HRESULT get_FontFaceIndex(int* lFaceIndex); HRESULT put_FontFaceIndex(const int& lFaceIndex); //---------------------------------------------------------------------------------------- - // Функции для вывода текста + // Functions for text output //---------------------------------------------------------------------------------------- HRESULT CommandDrawTextCHAR (const LONG& lUnicode, const double& dX, const double& dY, const double& dW, const double& dH); HRESULT CommandDrawTextExCHAR(const LONG& lUnicode, const LONG& lGid, const double& dX, const double& dY, const double& dW, const double& dH); @@ -165,11 +165,11 @@ public: HRESULT CommandDrawTextEx (const std::wstring& wsUnicodeText, const unsigned int* pGids, const unsigned int nGidsCount, const double& dX, const double& dY, const double& dW, const double& dH); HRESULT CommandDrawTextCHAR2 (unsigned int* unUnicode, const unsigned int& unUnicodeCount, const unsigned int& unGid, const double& dX, const double& dY, const double& dW, const double& dH); //---------------------------------------------------------------------------------------- - // Маркеры команд + // Command markers //---------------------------------------------------------------------------------------- HRESULT EndCommand(const DWORD& lType); //---------------------------------------------------------------------------------------- - // Функции для работы с патом + // Functions for working with path //---------------------------------------------------------------------------------------- HRESULT PathCommandMoveTo(const double& dX, const double& dY); HRESULT PathCommandLineTo(const double& dX, const double& dY); @@ -187,18 +187,18 @@ public: HRESULT PathCommandText (const std::wstring& wsUnicodeText, const double& dX, const double& dY, const double& dW, const double& dH); HRESULT PathCommandTextEx (const std::wstring& wsUnicodeText, const unsigned int* pGids, const unsigned int nGidsCount, const double& dX, const double& dY, const double& dW, const double& dH); //---------------------------------------------------------------------------------------- - // Функции для вывода изображений + // Functions for image output //---------------------------------------------------------------------------------------- HRESULT DrawImage(IGrObject* pImage, const double& dX, const double& dY, const double& dW, const double& dH); HRESULT DrawImageFromFile(NSFonts::IApplicationFonts* pAppFonts, const std::wstring& wsTempDirectory, const std::wstring& wsImagePath, const double& dX, const double& dY, const double& dW, const double& dH, const BYTE& nAlpha = 255); //---------------------------------------------------------------------------------------- - // Функции для выставления преобразования + // Functions for setting transformation //---------------------------------------------------------------------------------------- HRESULT SetTransform(const double& dM11, const double& dM12, const double& dM21, const double& dM22, const double& dX, const double& dY); HRESULT GetTransform(double* dM11, double* dM12, double* dM21, double* dM22, double* dX, double* dY); HRESULT ResetTransform(); //---------------------------------------------------------------------------------------- - // Дополнительные функции + // Additional functions //---------------------------------------------------------------------------------------- HRESULT AddHyperlink(const double& dX, const double& dY, const double& dW, const double& dH, const std::wstring& wsUrl, const std::wstring& wsTooltip); HRESULT AddLink(const double& dX, const double& dY, const double& dW, const double& dH, const double& dDestX, const double& dDestY, const int& nPage); @@ -209,7 +209,7 @@ public: HRESULT get_ClipMode(LONG* lMode); HRESULT put_ClipMode(const LONG& lMode); //---------------------------------------------------------------------------------------- - // Дополнительные функции Pdf рендерера + // Additional Pdf renderer functions //---------------------------------------------------------------------------------------- HRESULT DrawImage1bpp(NSImages::CPixJbig2* pImageBuffer, const unsigned int& unWidth, const unsigned int& unHeight, const double& dX, const double& dY, const double& dW, const double& dH); HRESULT EnableBrushRect(const LONG& lEnable); @@ -217,7 +217,7 @@ public: HRESULT SetRadialGradient(const double& dX1, const double& dY1, const double& dR1, const double& dX2, const double& dY2, const double& dR2); HRESULT DrawImageWith1bppMask(IGrObject* pImage, NSImages::CPixJbig2* pMaskBuffer, const unsigned int& unMaskWidth, const unsigned int& unMaskHeight, const double& dX, const double& dY, const double& dW, const double& dH); //---------------------------------------------------------------------------------------- - // Дополнительные функции для дозаписи Pdf + // Additional functions for incremental Pdf writing //---------------------------------------------------------------------------------------- HRESULT EditWidgetParents(NSFonts::IApplicationFonts* pAppFonts, CWidgetsInfo* pFieldInfo, const std::wstring& wsTempDirectory); void SetPage(PdfWriter::CPage* pPage); diff --git a/PdfFile/Resources/BaseFonts.h b/PdfFile/Resources/BaseFonts.h index 18f65aa7f5..cca3a8aa5d 100644 --- a/PdfFile/Resources/BaseFonts.h +++ b/PdfFile/Resources/BaseFonts.h @@ -35,7 +35,7 @@ #include <string> namespace PdfReader { - // эту память не удалять!!! просто использовать + // do not delete this memory!!! just use it bool GetBaseFont(const std::wstring& sName, const unsigned char*& pData, unsigned int& nSize); bool GetBaseCidToUnicode(const char* sName, const unsigned int*& pData, unsigned int& nSize); } diff --git a/PdfFile/SrcReader/Adaptors.cpp b/PdfFile/SrcReader/Adaptors.cpp index dafb7955ce..b9b4ba5f06 100644 --- a/PdfFile/SrcReader/Adaptors.cpp +++ b/PdfFile/SrcReader/Adaptors.cpp @@ -210,7 +210,7 @@ bool GlobalParamsAdaptor::InRedact(double dX, double dY) continue; } - // Проверяем знаки векторных произведений для всех сторон + // Check signs of cross products for all sides double cross1 = crossProduct(x1, y1, x2, y2, dX, dY); double cross2 = crossProduct(x2, y2, x3, y3, dX, dY); double cross3 = crossProduct(x3, y3, x4, y4, dX, dY); @@ -219,7 +219,7 @@ bool GlobalParamsAdaptor::InRedact(double dX, double dY) bool allPositive = (cross1 >= 0 && cross2 >= 0 && cross3 >= 0 && cross4 >= 0); bool allNegative = (cross1 <= 0 && cross2 <= 0 && cross3 <= 0 && cross4 <= 0); - // Точка внутри, если все векторные произведения имеют одинаковый знак + // Point is inside if all cross products have the same sign if ((allPositive || allNegative) && !(cross1 == 0 && cross2 == 0 && cross3 == 0 && cross4 == 0)) return true; } @@ -520,7 +520,7 @@ void XMLConverter::ObjectToXml(Object *pObject, bool isSkipCheck) } case objStream: m_wsXml += L"<stream/>"; - // TODO: Запись стрима + // TODO: Write stream break; case objRef: m_wsXml += std::to_wstring(pObject->getRefNum()); diff --git a/PdfFile/SrcReader/Adaptors.h b/PdfFile/SrcReader/Adaptors.h index 4fe4fc8a07..74102f56ee 100644 --- a/PdfFile/SrcReader/Adaptors.h +++ b/PdfFile/SrcReader/Adaptors.h @@ -149,7 +149,7 @@ namespace PdfReader { static void SpitPathExt(std::wstring& wsFullPath, std::wstring* pwsFilePath, std::wstring* pwsExt) { - // Ищем '.' начиная с конца пути, и разделяем путь на расширение и остальную часть + // Find '.' starting from end of path, and split path into extension and remaining part size_t nPos = wsFullPath.find_last_of(L"."); *pwsFilePath = wsFullPath.substr(0, nPos); *pwsExt = wsFullPath.substr(nPos + 1); diff --git a/PdfFile/SrcReader/FontsWasm.h b/PdfFile/SrcReader/FontsWasm.h index 07abba0ad9..43d14f530e 100644 --- a/PdfFile/SrcReader/FontsWasm.h +++ b/PdfFile/SrcReader/FontsWasm.h @@ -78,7 +78,7 @@ namespace NSWasm js_free_id((unsigned char*)pFontId); return sRes; #else - // пока заглушка - тут надо прочитать в стрим, чтобы дальше правильно сработать с кодировками + // stub for now - need to read into stream to properly work with encodings later if (!NSFonts::NSApplicationFontStream::GetGlobalMemoryStorage()->Get(sFontPath)) { DWORD dwSize = 0; diff --git a/PdfFile/SrcReader/JPXStream2.cpp b/PdfFile/SrcReader/JPXStream2.cpp index 4b5f927642..f87443e122 100644 --- a/PdfFile/SrcReader/JPXStream2.cpp +++ b/PdfFile/SrcReader/JPXStream2.cpp @@ -60,7 +60,7 @@ void JPXStream2::reset() { str->reset(); - // Инизиализация + // Initialization m_lCurPos = 0; m_lBufferSize = 0; diff --git a/PdfFile/SrcReader/MemoryUtils.h b/PdfFile/SrcReader/MemoryUtils.h index 83195761d1..5725bf6592 100644 --- a/PdfFile/SrcReader/MemoryUtils.h +++ b/PdfFile/SrcReader/MemoryUtils.h @@ -48,12 +48,12 @@ namespace PdfReader { if (!memory) { - // TODO: Выдать ошибку выделения памяти + // TODO: Throw memory allocation error } } //------------------------------------------------------------------------ - // Аналогично malloc, но с обработкой ошибок. + // Same as malloc, but with error handling. static void* MemUtilsMalloc(unsigned int nSize) { void* pResult; @@ -79,14 +79,14 @@ namespace PdfReader return MemUtilsMalloc(nObjectsCount * nObjectSize); } - // Тоже что и free, но проверяет и игнорирует NULL-указатели. + // Same as free, but checks and ignores NULL pointers. static void MemUtilsFree(void* pData) { if (pData) free(pData); } - // Тоже что и realloc, но с обработкой ошибок. + // Same as realloc, but with error handling. static void* MemUtilsRealloc(void* pData, unsigned int nSize, unsigned int nOldSize) { void* pResult; diff --git a/PdfFile/SrcReader/PdfAnnot.cpp b/PdfFile/SrcReader/PdfAnnot.cpp index 3da159314d..2342f6dd81 100644 --- a/PdfFile/SrcReader/PdfAnnot.cpp +++ b/PdfFile/SrcReader/PdfAnnot.cpp @@ -202,23 +202,23 @@ CAction* getAction(PDFDoc* pdfDoc, Object* oAction) LinkActionKind kind = oAct->getKind(); switch (kind) { - // Переход внутри файла + // Navigation within the file case actionGoTo: { pRes = getGoTo(pdfDoc, oAct); break; } - // Переход к внешнему файлу + // Navigation to external file case actionGoToR: { break; } - // Запуск стороннего приложения + // Launch external application case actionLaunch: { break; } - // Внешняя ссылка + // External link case actionURI: { CActionURI* ppRes = new CActionURI(); @@ -228,7 +228,7 @@ CAction* getAction(PDFDoc* pdfDoc, Object* oAction) pRes = ppRes; break; } - // Нестандартно именованные действия + // Non-standard named actions case actionNamed: { CActionNamed* ppRes = new CActionNamed(); @@ -238,7 +238,7 @@ CAction* getAction(PDFDoc* pdfDoc, Object* oAction) pRes = ppRes; break; } - // Воспроизведение фильма + // Movie playback case actionMovie: { break; @@ -253,12 +253,12 @@ CAction* getAction(PDFDoc* pdfDoc, Object* oAction) pRes = ppRes; break; } - // Отправка формы + // Form submission case actionSubmitForm: { break; } - // Скрытие аннотаций + // Hide annotations case actionHide: { CActionHide* ppRes = new CActionHide(); @@ -295,7 +295,7 @@ CAction* getAction(PDFDoc* pdfDoc, Object* oAction) pRes = ppRes; break; } - // Неизвестное действие + // Unknown action case actionUnknown: default: { @@ -473,7 +473,7 @@ GList* tokenize(GString *s) } CAnnot::CBorderType* getBorder(Object* oBorder, bool bBSorBorder) { - // Границы и Dash Pattern - Border/BS + // Borders and Dash Pattern - Border/BS CAnnot::CBorderType* pBorderType = new CAnnot::CBorderType(); if (!oBorder) return pBorderType; @@ -547,7 +547,7 @@ CAnnotWidgetBtn::CAnnotWidgetBtn(PDFDoc* pdfDoc, AcroFormField* pField, int nSta oFieldRef.fetch(pdfDoc->getXRef(), &oField); oFieldRef.free(); - // 9 - Значение поля - V + // 9 - Field value - V if (oField.dictLookup("V", &oObj)) { m_sV = getValue(&oObj); @@ -566,7 +566,7 @@ CAnnotWidgetBtn::CAnnotWidgetBtn(PDFDoc* pdfDoc, AcroFormField* pField, int nSta AcroFormFieldType oType = pField->getAcroFormFieldType(); Object oOpt; - // 10 - Список значений + // 10 - List of values if (oType != acroFormFieldPushbutton && oField.dictLookup("Opt", &oOpt)->isArray()) { m_unFlags |= (1 << 10); @@ -617,11 +617,11 @@ CAnnotWidgetBtn::CAnnotWidgetBtn(PDFDoc* pdfDoc, AcroFormField* pField, int nSta { if (oType == acroFormFieldPushbutton) { - // 10 - Заголовок - СА + // 10 - Caption - CA m_sCA = DictLookupString(&oMK, "CA", 10); - // 11 - Заголовок прокрутки - RC + // 11 - Rollover caption - RC m_sRC = DictLookupString(&oMK, "RC", 11); - // 12 - Альтернативный заголовок - AC + // 12 - Alternate caption - AC m_sAC = DictLookupString(&oMK, "AC", 12); } else @@ -630,23 +630,23 @@ CAnnotWidgetBtn::CAnnotWidgetBtn(PDFDoc* pdfDoc, AcroFormField* pField, int nSta { std::string sCA(oObj.getString()->getCString()); - if (sCA == "l") // кружок + if (sCA == "l") // circle m_nStyle = 3; - else if (sCA == "4") // галка + else if (sCA == "4") // checkmark m_nStyle = 0; - else if (sCA == "8") // крест + else if (sCA == "8") // cross m_nStyle = 1; - else if (sCA == "u") // ромб + else if (sCA == "u") // diamond m_nStyle = 2; - else if (sCA == "n") // квадрат + else if (sCA == "n") // square m_nStyle = 5; - else if (sCA == "H") // звезда + else if (sCA == "H") // star m_nStyle = 4; } oObj.free(); } - // 13 - Положение заголовка - TP + // 13 - Caption position - TP if (oMK.dictLookup("TP", &oObj)->isInt()) { m_nTP = oObj.getInt(); @@ -658,7 +658,7 @@ CAnnotWidgetBtn::CAnnotWidgetBtn(PDFDoc* pdfDoc, AcroFormField* pField, int nSta if (oMK.dictLookup("IF", &oIF)->isDict()) { m_unIFFlag = 1; - // 1 - Масштабирование - SW + // 1 - Scaling - SW if (oIF.dictLookup("SW", &oObj)->isName()) { m_unIFFlag |= (1 << 1); @@ -672,7 +672,7 @@ CAnnotWidgetBtn::CAnnotWidgetBtn(PDFDoc* pdfDoc, AcroFormField* pField, int nSta m_nSW = 1; } oObj.free(); - // 2 - Тип масштабирования - S + // 2 - Scaling type - S if (oIF.dictLookup("S", &oObj)->isName()) { m_unIFFlag |= (1 << 2); @@ -682,7 +682,7 @@ CAnnotWidgetBtn::CAnnotWidgetBtn(PDFDoc* pdfDoc, AcroFormField* pField, int nSta m_nS = 1; } oObj.free(); - // 3 - Смещение - A + // 3 - Offset - A if (oIF.dictLookup("A", &oObj)->isArray()) { m_dA1 = 0.5, m_dA2 = 0.5; @@ -692,7 +692,7 @@ CAnnotWidgetBtn::CAnnotWidgetBtn(PDFDoc* pdfDoc, AcroFormField* pField, int nSta m_dA2 = ArrGetNum(&oObj, 1); } oObj.free(); - // 4 - Полное соответствие - FB + // 4 - Full fit - FB if (oIF.dictLookup("FB", &oObj)->isBool() && oObj.getBool()) m_unIFFlag |= (1 << 4); oObj.free(); @@ -703,7 +703,7 @@ CAnnotWidgetBtn::CAnnotWidgetBtn(PDFDoc* pdfDoc, AcroFormField* pField, int nSta pField->fieldLookup("Opt", &oOpt); - // 14 - Имя вкл состояния - AP - N - Yes + // 14 - On state name - AP - N - Yes Object oNorm; if (pField->fieldLookup("AP", &oObj)->isDict() && oObj.dictLookup("N", &oNorm)->isDict() && oOpt.isNull()) { @@ -728,7 +728,7 @@ CAnnotWidgetTx::CAnnotWidgetTx(PDFDoc* pdfDoc, AcroFormField* pField, int nStart oFieldRef.fetch(pdfDoc->getXRef(), &oField); oFieldRef.free(); - // 9 - Значение - V + // 9 - Value - V if (oField.dictLookup("V", &oObj)) { m_sV = getValue(&oObj); @@ -738,7 +738,7 @@ CAnnotWidgetTx::CAnnotWidgetTx(PDFDoc* pdfDoc, AcroFormField* pField, int nStart oObj.free(); oField.free(); - // 10 - Максимальное количество символов в Tx - MaxLen + // 10 - Maximum number of characters in Tx - MaxLen if (oField.dictLookup("MaxLen", &oObj)->isInt()) { m_unFlags |= (1 << 10); @@ -746,7 +746,7 @@ CAnnotWidgetTx::CAnnotWidgetTx(PDFDoc* pdfDoc, AcroFormField* pField, int nStart } oObj.free(); - // 11 - Расширенный текст RV - RichText + // 11 - Rich text RV - RichText if (pField->getFlags() & (1 << 25)) m_sRV = FieldLookupString(pField, "RV", 11); } @@ -758,7 +758,7 @@ CAnnotWidgetCh::CAnnotWidgetCh(PDFDoc* pdfDoc, AcroFormField* pField, int nStart oFieldRef.fetch(pdfDoc->getXRef(), &oField); oFieldRef.free(); - // 9 - Значение + // 9 - Value if (oField.dictLookup("V", &oObj)) { m_sV = getValue(&oObj, false); @@ -768,7 +768,7 @@ CAnnotWidgetCh::CAnnotWidgetCh(PDFDoc* pdfDoc, AcroFormField* pField, int nStart oObj.free(); Object oOpt; - // 10 - Список значений + // 10 - List of values if (oField.dictLookup("Opt", &oOpt)->isArray()) { m_unFlags |= (1 << 10); @@ -813,7 +813,7 @@ CAnnotWidgetCh::CAnnotWidgetCh(PDFDoc* pdfDoc, AcroFormField* pField, int nStart } oOpt.free(); - // 11 - Индекс верхнего элемента - TI + // 11 - Top element index - TI if (pField->fieldLookup("TI", &oObj)->isInt()) { m_unFlags |= (1 << 11); @@ -821,7 +821,7 @@ CAnnotWidgetCh::CAnnotWidgetCh(PDFDoc* pdfDoc, AcroFormField* pField, int nStart } oObj.free(); - // 12 - Выбранные индексы - I + // 12 - Selected indices - I if (oField.dictLookup("I", &oOpt)->isArray()) { m_unFlags |= (1 << 12); @@ -834,7 +834,7 @@ CAnnotWidgetCh::CAnnotWidgetCh(PDFDoc* pdfDoc, AcroFormField* pField, int nStart } oOpt.free(); - // 13 - Массив значений + // 13 - Values array if (oField.dictLookup("V", &oOpt)->isArray()) { m_unFlags |= (1 << 13); @@ -862,7 +862,7 @@ CAnnotWidgetSig::CAnnotWidgetSig(PDFDoc* pdfDoc, AcroFormField* pField, int nSta oFieldRef.fetch(pdfDoc->getXRef(), &oField); oFieldRef.free(); - // 9 - Значение + // 9 - Value if (oField.dictLookup("V", &oObj)->isDict()) m_unFlags |= (1 << 9); oObj.free(); @@ -881,20 +881,20 @@ CAnnotWidget::CAnnotWidget(PDFDoc* pdfDoc, AcroFormField* pField, int nStartRefI m_dFontSize = 0.0; m_unFontStyle = 0; - // Цвет текста - из DA + // Text color - from DA int nSpace; GList *arrColors = pField->getColorSpace(&nSpace); for (int j = 0; j < nSpace; ++j) m_arrTC.push_back(*(double*)arrColors->get(j)); deleteGList(arrColors, double); - // Выравнивание текста - Q + // Text alignment - Q m_nQ = 0; if (pField->fieldLookup("Q", &oObj)->isInt()) m_nQ = oObj.getInt(); oObj.free(); - // Тип - FT + флаги + // Type - FT + flags AcroFormFieldType oType = pField->getAcroFormFieldType(); m_nType = 26; // Unknown switch (oType) @@ -912,13 +912,13 @@ CAnnotWidget::CAnnotWidget(PDFDoc* pdfDoc, AcroFormField* pField, int nStartRefI default: m_nType = 26; break; } - // Флаг - Ff + // Flag - Ff m_unFieldFlag = -1; if (oField.dictLookup("Ff", &oObj)->isInt()) m_unFieldFlag = oObj.getInt(); oObj.free(); - // 0 - Альтернативное имя поля, используется во всплывающей подсказке и сообщениях об ошибке - TU + // 0 - Alternative field name, used in tooltips and error messages - TU if (oField.dictLookup("TU", &oObj)) { m_sTU = getValue(&oObj); @@ -927,10 +927,10 @@ CAnnotWidget::CAnnotWidget(PDFDoc* pdfDoc, AcroFormField* pField, int nStartRefI } oObj.free(); - // 1 - Строка стиля по умолчанию - DS + // 1 - Default style string - DS m_sDS = FieldLookupString(pField, "DS", 1); - // 3 - Режим выделения - H + // 3 - Highlighting mode - H if (pField->fieldLookup("H", &oObj)->isName()) { m_unFlags |= (1 << 3); @@ -948,7 +948,7 @@ CAnnotWidget::CAnnotWidget(PDFDoc* pdfDoc, AcroFormField* pField, int nStartRefI Object oMK; if (pField->fieldLookup("MK", &oMK)->isDict()) { - // 5 - Цвет границ - BC. Даже если граница не задана BS/Border, то при наличии BC предоставляется граница по-умолчанию (сплошная, толщиной 1) + // 5 - Border color - BC. Even if border is not set by BS/Border, if BC is present a default border is provided (solid, 1pt thick) if (oMK.dictLookup("BC", &oObj)->isArray()) { m_unFlags |= (1 << 5); @@ -962,7 +962,7 @@ CAnnotWidget::CAnnotWidget(PDFDoc* pdfDoc, AcroFormField* pField, int nStartRefI } oObj.free(); - // 6 - Поворот аннотации относительно страницы - R + // 6 - Annotation rotation relative to page - R if (oMK.dictLookup("R", &oObj)->isInt()) { m_unFlags |= (1 << 6); @@ -970,7 +970,7 @@ CAnnotWidget::CAnnotWidget(PDFDoc* pdfDoc, AcroFormField* pField, int nStartRefI } oObj.free(); - // 7 - Цвет фона - BG + // 7 - Background color - BG if (oMK.dictLookup("BG", &oObj)->isArray()) { m_unFlags |= (1 << 7); @@ -986,7 +986,7 @@ CAnnotWidget::CAnnotWidget(PDFDoc* pdfDoc, AcroFormField* pField, int nStartRefI } oMK.free(); - // 8 - Значение по-умолчанию + // 8 - Default value if (oField.dictLookup("DV", &oObj)) { m_sDV = getValue(&oObj); @@ -995,7 +995,7 @@ CAnnotWidget::CAnnotWidget(PDFDoc* pdfDoc, AcroFormField* pField, int nStartRefI } oObj.free(); - // 17 - Родитель - Parent + // 17 - Parent - Parent m_unRefNumParent = 0; if (oField.dictLookupNF("Parent", &oObj)->isRef()) { @@ -1004,7 +1004,7 @@ CAnnotWidget::CAnnotWidget(PDFDoc* pdfDoc, AcroFormField* pField, int nStartRefI } oObj.free(); - // 18 - Частичное имя поля - T + // 18 - Partial field name - T m_sT = DictLookupString(&oField, "T", 18); m_sFullName = m_sT; @@ -1073,7 +1073,7 @@ std::string CAnnotWidget::FieldLookupString(AcroFormField* pField, const char* s } void CAnnotWidget::SetFont(PDFDoc* pdfDoc, AcroFormField* pField, NSFonts::IFontManager* pFontManager, CPdfFontList *pFontList) { - // Шрифт и размер шрифта - из DA + // Font and font size - from DA Ref fontID; pField->getFont(&fontID, &m_dFontSize); m_unFontStyle = 0; @@ -1094,11 +1094,11 @@ void CAnnotWidget::SetFont(PDFDoc* pdfDoc, AcroFormField* pField, NSFonts::IFont GetFontData(pdfDoc, pFontManager, pFontList, &oFontRef, m_sFontName, m_sActualFontName, bBold, bItalic); oFontRef.free(); - // 2 - Актуальный шрифт + // 2 - Actual font if (!m_sActualFontName.empty()) m_unFlags |= (1 << 2); - // 4 - Уникальный идентификатор шрифта + // 4 - Unique font identifier if (!m_sFontKey.empty()) m_unFlags |= (1 << 4); @@ -1109,7 +1109,7 @@ void CAnnotWidget::SetFont(PDFDoc* pdfDoc, AcroFormField* pField, NSFonts::IFont } void CAnnotWidget::SetButtonFont(PDFDoc* pdfDoc, AcroFormField* pField, NSFonts::IFontManager* pFontManager, CPdfFontList *pFontList) { - // Неполный шрифт во внешнем виде pushbutton + // Incomplete font in pushbutton appearance Object oFontRef; if (!GetFontFromAP(pdfDoc, pField, &oFontRef, m_sFontKey)) { @@ -1154,12 +1154,12 @@ CAnnotPopup::CAnnotPopup(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int XRef* pXref = pdfDoc->getXRef(); oAnnotRef->fetch(pXref, &oAnnot); - // 0 - Отображаться открытой - Open + // 0 - Display as open - Open if (oAnnot.dictLookup("Open", &oObj)->isBool() && oObj.getBool()) m_unFlags |= (1 << 0); oObj.free(); - // 1 - Родитель - Parent + // 1 - Parent - Parent if (oAnnot.dictLookupNF("Parent", &oObj)->isRef()) { m_unFlags |= (1 << 1); @@ -1219,7 +1219,7 @@ CAnnotLink::CAnnotLink(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nS } oObj.free(); - // 2 - Режим выделения - H + // 2 - Highlighting mode - H if (oAnnot.dictLookup("H", &oObj)->isName()) { m_unFlags |= (1 << 2); @@ -1234,7 +1234,7 @@ CAnnotLink::CAnnotLink(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nS } oObj.free(); - // 3 - Координаты - QuadPoints + // 3 - Coordinates - QuadPoints if (oAnnot.dictLookup("QuadPoints", &oObj)->isArray()) { m_unFlags |= (1 << 3); @@ -1265,12 +1265,12 @@ CAnnotText::CAnnotText(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nS XRef* pXref = pdfDoc->getXRef(); oAnnotRef->fetch(pXref, &oAnnot); - // 15 - Отображаться открытой - Open + // 15 - Display as open - Open if (oAnnot.dictLookup("Open", &oObj)->isBool() && oObj.getBool()) m_unFlags |= (1 << 15); oObj.free(); - // 16 - Иконка - Name + // 16 - Icon - Name m_unFlags |= (1 << 16); m_nName = 10; // Default: Note if (oAnnot.dictLookup("Name", &oObj)->isName()) @@ -1283,7 +1283,7 @@ CAnnotText::CAnnotText(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nS } oObj.free(); - // 17 - Модель состояния - StateModel + // 17 - State model - StateModel if (oAnnot.dictLookup("StateModel", &oObj)->isString()) { m_unFlags |= (1 << 17); @@ -1296,7 +1296,7 @@ CAnnotText::CAnnotText(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nS } oObj.free(); - // 18 - Состояние - State + // 18 - State - State if (oAnnot.dictLookup("State", &oObj)->isString()) { m_unFlags |= (1 << 18); @@ -1319,7 +1319,7 @@ CAnnotText::CAnnotText(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nS } oObj.free(); - // Text аннотация с IRT не отображается + // Text annotation with IRT is not displayed if (m_unFlags & (1 << 5)) m_unAFlags &= ~(1 << 6); @@ -1336,7 +1336,7 @@ CAnnotInk::CAnnotInk(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nSta XRef* pXref = pdfDoc->getXRef(); oAnnotRef->fetch(pXref, &oAnnot); - // Путь - InkList + // Path - InkList if (oAnnot.dictLookup("InkList", &oObj)->isArray()) { for (int j = 0; j < oObj.arrayGetLength(); ++j) @@ -1372,7 +1372,7 @@ CAnnotLine::CAnnotLine(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nS XRef* pXref = pdfDoc->getXRef(); oAnnotRef->fetch(pXref, &oAnnot); - // Координаты линии - L + // Line coordinates - L if (oAnnot.dictLookup("L", &oObj)->isArray()) { m_pL[0] = ArrGetNum(&oObj, 0) - m_dX; @@ -1382,7 +1382,7 @@ CAnnotLine::CAnnotLine(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nS } oObj.free(); - // 15 - Стили окончания линии - LE + // 15 - Line ending styles - LE if (oAnnot.dictLookup("LE", &oObj)->isArray()) { m_unFlags |= (1 << 15); @@ -1396,7 +1396,7 @@ CAnnotLine::CAnnotLine(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nS } oObj.free(); - // 16 - Цвет окончаний линии - IC + // 16 - Line endings color - IC if (oAnnot.dictLookup("IC", &oObj)->isArray()) { m_unFlags |= (1 << 16); @@ -1408,7 +1408,7 @@ CAnnotLine::CAnnotLine(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nS } oObj.free(); - // 17 - Длина линий выноски - LL + // 17 - Leader lines length - LL if (oAnnot.dictLookup("LL", &oObj)->isNum()) { m_unFlags |= (1 << 17); @@ -1416,7 +1416,7 @@ CAnnotLine::CAnnotLine(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nS } oObj.free(); - // 18 - Продолжение линий выноски - LLE + // 18 - Leader line extensions - LLE if (oAnnot.dictLookup("LLE", &oObj)->isNum()) { m_unFlags |= (1 << 18); @@ -1424,12 +1424,12 @@ CAnnotLine::CAnnotLine(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nS } oObj.free(); - // 19 - Местоположение заголовка - Cap + // 19 - Caption location - Cap if (oAnnot.dictLookup("Cap", &oObj)->isBool()) m_unFlags |= (1 << 19); oObj.free(); - // 20 - Назначение аннотации - IT + // 20 - Annotation intent - IT if (oAnnot.dictLookup("IT", &oObj)->isName()) { m_unFlags |= (1 << 20); @@ -1439,7 +1439,7 @@ CAnnotLine::CAnnotLine(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nS } oObj.free(); - // 21 - Длина смещения выноски - LLO + // 21 - Leader line offset length - LLO if (oAnnot.dictLookup("LLO", &oObj)->isNum()) { m_unFlags |= (1 << 21); @@ -1447,7 +1447,7 @@ CAnnotLine::CAnnotLine(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nS } oObj.free(); - // 22 - Расположение заголовка аннотации - CP + // 22 - Annotation caption position - CP if (oAnnot.dictLookup("CP", &oObj)->isName()) { m_unFlags |= (1 << 22); @@ -1457,7 +1457,7 @@ CAnnotLine::CAnnotLine(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nS } oObj.free(); - // 23 - Смещение текста подписи - CO + // 23 - Caption text offset - CO m_pCO[0] = 0.0; m_pCO[1] = 0.0; if (oAnnot.dictLookup("CO", &oObj)->isArray()) { @@ -1480,7 +1480,7 @@ CAnnotTextMarkup::CAnnotTextMarkup(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageI XRef* pXref = pdfDoc->getXRef(); oAnnotRef->fetch(pXref, &oAnnot); - // Координаты - QuadPoints + // Coordinates - QuadPoints if (oAnnot.dictLookup("QuadPoints", &oObj)->isArray()) { for (int i = 0; i < oObj.arrayGetLength(); ++i) @@ -1492,7 +1492,7 @@ CAnnotTextMarkup::CAnnotTextMarkup(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageI } oObj.free(); - // Подтип - Subtype + // Subtype - Subtype std::string sType; if (oAnnot.dictLookup("Subtype", &oObj)->isName()) sType = oObj.getName(); @@ -1520,7 +1520,7 @@ CAnnotSquareCircle::CAnnotSquareCircle(PDFDoc* pdfDoc, Object* oAnnotRef, int nP XRef* pXref = pdfDoc->getXRef(); oAnnotRef->fetch(pXref, &oAnnot); - // Подтип - Subtype + // Subtype - Subtype std::string sType; if (oAnnot.dictLookup("Subtype", &oObj)->isName()) sType = oObj.getName(); @@ -1531,7 +1531,7 @@ CAnnotSquareCircle::CAnnotSquareCircle(PDFDoc* pdfDoc, Object* oAnnotRef, int nP else if (sType == "Circle") m_nSubtype = 5; - // 15 - Различия Rect и фактического размера - RD + // 15 - Differences between Rect and actual size - RD if (oAnnot.dictLookup("RD", &oObj)->isArray()) { m_unFlags |= (1 << 15); @@ -1542,7 +1542,7 @@ CAnnotSquareCircle::CAnnotSquareCircle(PDFDoc* pdfDoc, Object* oAnnotRef, int nP } oObj.free(); - // 16 - Цвет заполнения - IC + // 16 - Fill color - IC if (oAnnot.dictLookup("IC", &oObj)->isArray()) { m_unFlags |= (1 << 16); @@ -1567,7 +1567,7 @@ CAnnotPolygonLine::CAnnotPolygonLine(PDFDoc* pdfDoc, Object* oAnnotRef, int nPag XRef* pXref = pdfDoc->getXRef(); oAnnotRef->fetch(pXref, &oAnnot); - // Подтип - Subtype + // Subtype - Subtype std::string sType; if (oAnnot.dictLookup("Subtype", &oObj)->isName()) sType = oObj.getName(); @@ -1578,7 +1578,7 @@ CAnnotPolygonLine::CAnnotPolygonLine(PDFDoc* pdfDoc, Object* oAnnotRef, int nPag else if (sType == "PolyLine") m_nSubtype = 7; - // Координаты вершин - Vertices + // Vertex coordinates - Vertices if (oAnnot.dictLookup("Vertices", &oObj)->isArray()) { for (int j = 0; j < oObj.arrayGetLength(); ++j) @@ -1592,7 +1592,7 @@ CAnnotPolygonLine::CAnnotPolygonLine(PDFDoc* pdfDoc, Object* oAnnotRef, int nPag } oObj.free(); - // 15 - Стили окончания линии - LE + // 15 - Line ending styles - LE if (oAnnot.dictLookup("LE", &oObj)->isArray()) { m_unFlags |= (1 << 15); @@ -1606,7 +1606,7 @@ CAnnotPolygonLine::CAnnotPolygonLine(PDFDoc* pdfDoc, Object* oAnnotRef, int nPag } oObj.free(); - // 16 - Цвет заполнения - IC + // 16 - Fill color - IC if (oAnnot.dictLookup("IC", &oObj)->isArray()) { m_unFlags |= (1 << 16); @@ -1618,7 +1618,7 @@ CAnnotPolygonLine::CAnnotPolygonLine(PDFDoc* pdfDoc, Object* oAnnotRef, int nPag } oObj.free(); - // 20 - Назначение аннотации - IT + // 20 - Annotation intent - IT if (oAnnot.dictLookup("IT", &oObj)->isName()) { m_unFlags |= (1 << 20); @@ -1643,7 +1643,7 @@ CAnnotFreeText::CAnnotFreeText(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex XRef* pXref = pdfDoc->getXRef(); oAnnotRef->fetch(pXref, &oAnnot); - // Выравнивание текста - Q + // Text alignment - Q m_nQ = 0; if (oAnnot.dictLookup("Q", &oObj)->isInt()) m_nQ = oObj.getInt(); @@ -1654,7 +1654,7 @@ CAnnotFreeText::CAnnotFreeText(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex m_nRotate = oObj.getInt(); oObj.free(); - // 15 - Различия Rect и фактического размера - RD + // 15 - Differences between Rect and actual size - RD if (oAnnot.dictLookup("RD", &oObj)->isArray()) { m_unFlags |= (1 << 15); @@ -1665,7 +1665,7 @@ CAnnotFreeText::CAnnotFreeText(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex } oObj.free(); - // 16 - Координаты выноски - CL + // 16 - Callout coordinates - CL if (oAnnot.dictLookup("CL", &oObj)->isArray()) { m_unFlags |= (1 << 16); @@ -1680,10 +1680,10 @@ CAnnotFreeText::CAnnotFreeText(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex } oObj.free(); - // 17 - Строка стиля по умолчанию - DS + // 17 - Default style string - DS m_sDS = DictLookupString(&oAnnot, "DS", 17); - // 18 - Стили окончания линии - LE + // 18 - Line ending styles - LE if (oAnnot.dictLookup("LE", &oObj)->isName()) { m_unFlags |= (1 << 18); @@ -1691,7 +1691,7 @@ CAnnotFreeText::CAnnotFreeText(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex } oObj.free(); - // 20 - Назначение аннотации - IT + // 20 - Annotation intent - IT if (oAnnot.dictLookup("IT", &oObj)->isName()) { m_unFlags |= (1 << 20); @@ -1703,7 +1703,7 @@ CAnnotFreeText::CAnnotFreeText(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex } oObj.free(); - // 21 - Цвет границы - color from DA + // 21 - Border color - color from DA if (oAnnot.dictLookup("DA", &oObj)->isString()) { m_unFlags |= (1 << 21); @@ -1766,7 +1766,7 @@ CAnnotCaret::CAnnotCaret(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int XRef* pXref = pdfDoc->getXRef(); oAnnotRef->fetch(pXref, &oAnnot); - // 15 - Различия Rect и фактического размера - RD + // 15 - Differences between Rect and actual size - RD if (oAnnot.dictLookup("RD", &oObj)->isArray() && oObj.arrayGetLength() == 4) { m_unFlags |= (1 << 15); @@ -1777,7 +1777,7 @@ CAnnotCaret::CAnnotCaret(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int } oObj.free(); - // 16 - Связанный символ - Sy + // 16 - Associated symbol - Sy if (oAnnot.dictLookup("Sy", &oObj)->isName()) { m_unFlags |= (1 << 16); @@ -1804,7 +1804,7 @@ CAnnotFileAttachment::CAnnotFileAttachment(PDFDoc* pdfDoc, Object* oAnnotRef, in XRef* pXref = pdfDoc->getXRef(); oAnnotRef->fetch(pXref, &oAnnot); - // 15 - Иконка - Name + // 15 - Icon - Name if (oAnnot.dictLookup("Name", &oObj)->isName()) { m_unFlags |= (1 << 15); @@ -1819,7 +1819,7 @@ CAnnotFileAttachment::CAnnotFileAttachment(PDFDoc* pdfDoc, Object* oAnnotRef, in return; } - // 16 - Файловая система - FS + // 16 - File system - FS if (oFS.dictLookup("FS", &oObj)->isName()) { m_unFlags |= (1 << 16); @@ -1827,22 +1827,22 @@ CAnnotFileAttachment::CAnnotFileAttachment(PDFDoc* pdfDoc, Object* oAnnotRef, in } oObj.free(); - // 17 - Спецификация файла - F + // 17 - File specification - F m_sF = DictLookupString(&oFS, "F", 17); - // 18 - Спецификация файла - UF + // 18 - File specification - UF m_sUF = DictLookupString(&oFS, "UF", 18); - // 19 - Спецификация файла - DOS + // 19 - File specification - DOS m_sDOS = DictLookupString(&oFS, "DOS", 19); - // 20 - Спецификация файла - Mac + // 20 - File specification - Mac m_sMac = DictLookupString(&oFS, "Mac", 20); - // 21 - Спецификация файла - Unix + // 21 - File specification - Unix m_sUnix = DictLookupString(&oFS, "Unix", 21); - // 22 - Идентификатор файла - ID + // 22 - File identifier - ID if (oFS.dictLookup("ID", &oObj)->isArray() && oObj.arrayGetLength() == 2) { m_unFlags |= (1 << 22); @@ -1863,12 +1863,12 @@ CAnnotFileAttachment::CAnnotFileAttachment(PDFDoc* pdfDoc, Object* oAnnotRef, in } oObj.free(); - // 23 - Изменчивость файла - V + // 23 - File volatility - V if (oFS.dictLookup("V", &oObj)->isBool() && oObj.getBool()) m_unFlags |= (1 << 23); oObj.free(); - // 24 - Встроенные файловые потоки - EF + // 24 - Embedded file streams - EF Object oEF; if (oFS.dictLookup("EF", &oEF)->isDict()) { @@ -1892,15 +1892,15 @@ CAnnotFileAttachment::CAnnotFileAttachment(PDFDoc* pdfDoc, Object* oAnnotRef, in } oEF.free(); - // 25 - Встроенные файловые потоки - RF + // 25 - Embedded file streams - RF if (oFS.dictLookup("RF", &oObj)->isDict()) m_unFlags |= (1 << 25); oObj.free(); - // 26 - Описание файла - Desc + // 26 - File description - Desc m_sDesc = DictLookupString(&oFS, "Desc", 26); - // 27 - Коллекция - Cl + // 27 - Collection - Cl if (oFS.dictLookup("Cl", &oObj)->isDict()) m_unFlags |= (1 << 27); oObj.free(); @@ -1922,7 +1922,7 @@ CAnnotStamp::CAnnotStamp(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int XRef* pXref = pdfDoc->getXRef(); oAnnotRef->fetch(pXref, &oAnnot); - // Иконка - Name + // Icon - Name if (oAnnot.dictLookup("Name", &oObj)->isName()) m_sName = oObj.getName(); oObj.free(); @@ -2055,7 +2055,7 @@ CAnnotRedact::CAnnotRedact(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, in XRef* pXref = pdfDoc->getXRef(); oAnnotRef->fetch(pXref, &oAnnot); - // 15 - Координаты - QuadPoints + // 15 - Coordinates - QuadPoints if (oAnnot.dictLookup("QuadPoints", &oObj)->isArray()) { m_unFlags |= (1 << 15); @@ -2068,7 +2068,7 @@ CAnnotRedact::CAnnotRedact(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, in } oObj.free(); - // 16 - Цвет заполнения - IC + // 16 - Fill color - IC if (oAnnot.dictLookup("IC", &oObj)->isArray()) { m_unFlags |= (1 << 16); @@ -2080,16 +2080,16 @@ CAnnotRedact::CAnnotRedact(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, in } oObj.free(); - // RO во внешних видах + // RO in appearance streams - // 17 - Текст наложения - OverlayText + // 17 - Overlay text - OverlayText m_sOverlayText = DictLookupString(&oAnnot, "OverlayText", 17); - // 18 - Повторять текст - Repeat + // 18 - Repeat text - Repeat if (oAnnot.dictLookup("Repeat", &oObj)->isBool() && oObj.getBool()) m_unFlags |= (1 << 18); - // 19 - Выравнивание текста - Q + // 19 - Text alignment - Q m_nQ = 0; if (oAnnot.dictLookup("Q", &oObj)->isInt()) { @@ -2098,7 +2098,7 @@ CAnnotRedact::CAnnotRedact(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, in } oObj.free(); - // Замена C: 3 - Цвет - C + // Replacement of C: 3 - Color - C if (oAnnot.dictLookup("OC", &oObj)->isArray()) { m_unAFlags |= (1 << 3); @@ -2120,7 +2120,7 @@ void CAnnotRedact::SetFont(PDFDoc* pdfDoc, NSFonts::IFontManager* pFontManager, XRef* pXref = pdfDoc->getXRef(); oAnnotRef->fetch(pXref, &oAnnot); - // 20 - Шрифт, размер, цвет текста замены - DA + // 20 - Font, size, color of replacement text - DA if (oAnnot.dictLookup("DA", &oObj)->isString()) { m_unFlags |= (1 << 20); @@ -2212,7 +2212,7 @@ CAnnots::CAnnots(PDFDoc* pdfDoc, NSFonts::IFontManager* pFontManager, CPdfFontLi XRef* xref = pdfDoc->getXRef(); AcroForm* pAcroForms = pdfDoc->getCatalog()->getForm(); - // Порядок вычислений - CO + // Calculation order - CO Object* oAcroForm = pAcroForms->getAcroFormObj(); if (oAcroForm->dictLookup("CO", &oObj1)->isArray()) { @@ -2245,7 +2245,7 @@ CAnnots::CAnnots(PDFDoc* pdfDoc, NSFonts::IFontManager* pFontManager, CPdfFontLi continue; } - // Родители + // Parents Object oParentRefObj; if (oField.dictLookupNF("Parent", &oParentRefObj)->isRef()) getParents(pdfDoc, &oParentRefObj, nStartRefID); @@ -2443,7 +2443,7 @@ void CAnnots::getParents(PDFDoc* pdfDoc, Object* oFieldRef, int nStartRefID) } oOpt.free(); - // 7 - Флаг - Ff + // 7 - Flag - Ff if (oField.dictLookup("Ff", &oObj)->isInt()) { pAnnotParent->unFieldFlag = oObj.getInt(); @@ -2614,17 +2614,17 @@ CAnnotMarkup::CAnnotMarkup(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, in XRef* pXref = pdfDoc->getXRef(); oAnnotRef->fetch(pXref, &oAnnot); - // 0 - Всплывающая аннотация - Popup + // 0 - Popup annotation - Popup if (oAnnot.dictLookupNF("Popup", &oObj)->isRef()) { m_unFlags |= (1 << 0); m_unRefNumPopup = oObj.getRefNum() + nStartRefID; } - // 1 - Текстовая метка пользователя - T + // 1 - User text label - T m_sT = DictLookupString(&oAnnot, "T", 1); - // 2 - Значение непрозрачности - CA + // 2 - Opacity value - CA if (oAnnot.dictLookup("CA", &oObj)->isNum()) { m_unFlags |= (1 << 2); @@ -2632,7 +2632,7 @@ CAnnotMarkup::CAnnotMarkup(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, in } oObj.free(); - // 3 - Форматированный текст - RC + // 3 - Rich text - RC std::string sRC = DictLookupString(&oAnnot, "RC", 3); // std::cout << sRC << std::endl; // if (oAnnot.dictLookup("RC", &oObj)->isStream()) @@ -2643,10 +2643,10 @@ CAnnotMarkup::CAnnotMarkup(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, in else m_unFlags |= (1 << 3); - // 4 - Дата создания - CreationDate + // 4 - Creation date - CreationDate m_sCreationDate = DictLookupString(&oAnnot, "CreationDate", 4); - // 5 - Ссылка на аннотацию ответ - IRT + // 5 - Reference to reply annotation - IRT if (oAnnot.dictLookupNF("IRT", &oObj)->isRef()) { m_unFlags |= (1 << 5); @@ -2654,7 +2654,7 @@ CAnnotMarkup::CAnnotMarkup(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, in } oObj.free(); - // 6 - Тип аннотации ответа - RT + // 6 - Reply annotation type - RT if (oAnnot.dictLookup("RT", &oObj)->isName()) { m_unFlags |= (1 << 6); @@ -2664,7 +2664,7 @@ CAnnotMarkup::CAnnotMarkup(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, in } oObj.free(); - // 7 - Краткое описание - Subj + // 7 - Brief description - Subj m_sSubj = DictLookupString(&oAnnot, "Subj", 7); oAnnot.free(); @@ -2855,15 +2855,15 @@ CAnnot::CAnnot(PDFDoc* pdfDoc, AcroFormField* pField, int nStartRefID) m_unRefNum = oObj.getRefNum() + nStartRefID; oObj.free(); - // Флаг аннотации - F + // Annotation flag - F if (pField->fieldLookup("F", &oObj)->isInt()) m_unAnnotFlag = oObj.getInt(); oObj.free(); - // Номер страницы - P + // Page number - P m_unPage = pField->getPageNum(); - // Координаты - Rect + // Coordinates - Rect pField->getBBox(&m_pRect[0], &m_pRect[1], &m_pRect[2], &m_pRect[3]); PDFRectangle* pCropBox = pdfDoc->getCatalog()->getPage(m_unPage)->getCropBox(); m_dHeight = pCropBox->y2; @@ -2878,7 +2878,7 @@ CAnnot::CAnnot(PDFDoc* pdfDoc, AcroFormField* pField, int nStartRefID) if (m_pRect[1] > m_pRect[3]) std::swap(m_pRect[1], m_pRect[3]); - // 0 - Уникальное имя - NM + // 0 - Unique name - NM if (pField->fieldLookup("NM", &oObj)->isString()) { m_unAFlags |= (1 << 0); @@ -2888,7 +2888,7 @@ CAnnot::CAnnot(PDFDoc* pdfDoc, AcroFormField* pField, int nStartRefID) } oObj.free(); - // 1 - Альтернативный текст - Contents + // 1 - Alternative text - Contents if (pField->fieldLookup("Contents", &oObj)->isString()) { m_unAFlags |= (1 << 1); @@ -2898,7 +2898,7 @@ CAnnot::CAnnot(PDFDoc* pdfDoc, AcroFormField* pField, int nStartRefID) } oObj.free(); - // 2 - Эффекты границы - BE + // 2 - Border effects - BE if (pField->fieldLookup("BE", &oObj)->isDict()) { Object oBorderBE; @@ -2916,7 +2916,7 @@ CAnnot::CAnnot(PDFDoc* pdfDoc, AcroFormField* pField, int nStartRefID) } oObj.free(); - // 3 - Специальный цвет для аннотации - C + // 3 - Special color for annotation - C if (pField->fieldLookup("C", &oObj)->isArray()) { m_unAFlags |= (1 << 3); @@ -2930,7 +2930,7 @@ CAnnot::CAnnot(PDFDoc* pdfDoc, AcroFormField* pField, int nStartRefID) } oObj.free(); - // 4 - Границы и Dash Pattern - Border/BS + // 4 - Borders and Dash Pattern - Border/BS m_pBorder = NULL; if (pField->fieldLookup("BS", &oObj)->isDict()) m_pBorder = getBorder(&oObj, true); @@ -2944,7 +2944,7 @@ CAnnot::CAnnot(PDFDoc* pdfDoc, AcroFormField* pField, int nStartRefID) if (m_pBorder && m_pBorder->nType != 5) m_unAFlags |= (1 << 4); - // 5 - Дата последнего изменения - M + // 5 - Last modification date - M if (pField->fieldLookup("M", &oObj)->isString()) { m_unAFlags |= (1 << 5); @@ -2954,7 +2954,7 @@ CAnnot::CAnnot(PDFDoc* pdfDoc, AcroFormField* pField, int nStartRefID) } oObj.free(); - // 6 - Наличие/Отсутствие внешнего вида + // 6 - Presence/Absence of appearance if (std::abs(m_pRect[2] - m_pRect[0]) * std::abs(m_pRect[3] - m_pRect[1]) < 1073741824.0 / 3.0 && pField->fieldLookup("AP", &oObj)->isDict() && oObj.dictGetLength()) m_unAFlags |= (1 << 6); oObj.free(); @@ -2969,7 +2969,7 @@ CAnnot::CAnnot(PDFDoc* pdfDoc, AcroFormField* pField, int nStartRefID) } oObj.free(); - // 9 - OO метаданные форм - OMetadata + // 9 - OO form metadata - OMetadata if (pField->fieldLookup("OMetadata", &oObj)->isString()) { m_unAFlags |= (1 << 9); @@ -2990,21 +2990,21 @@ CAnnot::CAnnot(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nStartRefI XRef* pXref = pdfDoc->getXRef(); oAnnotRef->fetch(pXref, &oAnnot); - // Номер объекта аннотации + // Annotation object number m_unRefNum = oAnnotRef->getRefNum() + nStartRefID; - // Флаг аннотации - F + // Annotation flag - F if (oAnnot.dictLookup("F", &oObj)->isInt()) m_unAnnotFlag = oObj.getInt(); oObj.free(); - // Номер страницы - P + // Page number - P m_unPage = nPageIndex; PDFRectangle* pCropBox = pdfDoc->getCatalog()->getPage(m_unPage)->getCropBox(); m_dHeight = pCropBox->y2; m_dX = pCropBox->x1; - // Координаты - Rect + // Coordinates - Rect m_pRect[0] = 0.0, m_pRect[1] = 0.0, m_pRect[2] = 0.0, m_pRect[3] = 0.0; if (oAnnot.dictLookup("Rect", &oObj)->isArray() && oObj.arrayGetLength() == 4) { @@ -3020,7 +3020,7 @@ CAnnot::CAnnot(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nStartRefI } oObj.free(); - // 0 - Уникальное имя - NM + // 0 - Unique name - NM if (oAnnot.dictLookup("NM", &oObj)->isString()) { m_unAFlags |= (1 << 0); @@ -3030,7 +3030,7 @@ CAnnot::CAnnot(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nStartRefI } oObj.free(); - // 1 - Альтернативный текст - Contents + // 1 - Alternative text - Contents if (oAnnot.dictLookup("Contents", &oObj)->isString()) { m_unAFlags |= (1 << 1); @@ -3040,7 +3040,7 @@ CAnnot::CAnnot(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nStartRefI } oObj.free(); - // 2 - Эффекты границы - BE + // 2 - Border effects - BE if (oAnnot.dictLookup("BE", &oObj)->isDict()) { Object oBorderBE; @@ -3058,7 +3058,7 @@ CAnnot::CAnnot(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nStartRefI } oObj.free(); - // 3 - Цвет - C + // 3 - Color - C if (oAnnot.dictLookup("C", &oObj)->isArray()) { m_unAFlags |= (1 << 3); @@ -3071,7 +3071,7 @@ CAnnot::CAnnot(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nStartRefI } oObj.free(); - // 4 - Границы и Dash Pattern - Border/BS + // 4 - Borders and Dash Pattern - Border/BS m_pBorder = NULL; if (oAnnot.dictLookup("BS", &oObj)->isDict()) m_pBorder = getBorder(&oObj, true); @@ -3085,7 +3085,7 @@ CAnnot::CAnnot(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nStartRefI if (m_pBorder && m_pBorder->nType != 5) m_unAFlags |= (1 << 4); - // 5 - Дата последнего изменения - M + // 5 - Last modification date - M if (oAnnot.dictLookup("M", &oObj)->isString()) { m_unAFlags |= (1 << 5); @@ -3095,7 +3095,7 @@ CAnnot::CAnnot(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nStartRefI } oObj.free(); - // 6 - Наличие/Отсутствие внешнего вида + // 6 - Presence/Absence of appearance if (std::abs(m_pRect[2] - m_pRect[0]) * std::abs(m_pRect[3] - m_pRect[1]) < 1073741824.0 / 3.0 && oAnnot.dictLookup("AP", &oObj)->isDict() && oObj.dictGetLength()) m_unAFlags |= (1 << 6); oObj.free(); @@ -3110,7 +3110,7 @@ CAnnot::CAnnot(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nStartRefI } oObj.free(); - // 9 - OO метаданные форм - OMetadata + // 9 - OO form metadata - OMetadata if (oAnnot.dictLookup("OMetadata", &oObj)->isString()) { m_unAFlags |= (1 << 9); @@ -3158,13 +3158,13 @@ CAnnotAP::CAnnotAP(PDFDoc* pdfDoc, NSFonts::IFontManager* pFontManager, CPdfFont Object oAP; if (pField->fieldLookup("AP", &oAP)->isDict() && oAP.dictGetLength()) { - // Номер аннотации для сопоставления с AP + // Annotation number for matching with AP Object oRef; pField->getFieldRef(&oRef); m_unRefNum = oRef.getRefNum() + nStartRefID; oRef.free(); - // Координаты - BBox + // Coordinates - BBox pField->getBBox(&m_dx1, &m_dy1, &m_dx2, &m_dy2); if (std::abs(m_dx2 - m_dx1) * std::abs(m_dy2 - m_dy1) < 1073741824.0 / 3.0) { @@ -3242,7 +3242,7 @@ void CAnnotAP::Init(PDFDoc* pdfDoc, NSFonts::IFontManager* pFontManager, CPdfFon m_nWidth += 2; m_nHeight += 2; - // Отрисовка на прозрачном холсте с заданым цветом фона + // Drawing on transparent canvas with specified background color BYTE* pBgraData = new BYTE[m_nWidth * m_nHeight * 4]; unsigned int nColor = (unsigned int)nBackgroundColor; unsigned int nSize = (unsigned int)(m_nWidth * m_nHeight); @@ -3269,16 +3269,16 @@ void CAnnotAP::Init(PDFDoc* pdfDoc, NSFonts::IFontManager* pFontManager, CPdfFon m_pRendererOut = new RendererOutputDev(m_pRenderer, pFontManager, pFontList); m_pRendererOut->NewPDF(pdfDoc->getXRef()); - // Создание Gfx + // Create Gfx GBool crop = gTrue; PDFRectangle box; - // Поворот не требуется + // Rotation not required pPage->makeBox(72.0, 72.0, 0, gFalse, m_pRendererOut->upsideDown(), -1, -1, -1, -1, &box, &crop); PDFRectangle* cropBox = pPage->getCropBox(); m_gfx = new Gfx(pdfDoc, m_pRendererOut, nPageIndex, pPage->getAttrs()->getResourceDict(), 72.0, 72.0, &box, crop ? cropBox : (PDFRectangle *)NULL, 0, NULL, NULL); - // Координаты внешнего вида + // Appearance coordinates m_dRx1 = ((m_bIsStamp ? m_dx1S: m_dx1) - m_dCropX) * m_dWScale - 1; m_dRy1 = (pdfDoc->getPageCropHeight(nPageIndex) - (m_bIsStamp ? m_dy2S : m_dy2) + m_dCropY) * m_dHScale - 1; } @@ -3393,7 +3393,7 @@ void CAnnotAP::Init(Object* oAnnot) } void CAnnotAP::Draw(PDFDoc* pdfDoc, Object* oAP, int nRasterH, int nBackgroundColor, int nPageIndex, AcroFormField* pField, const char* sView, const char* sButtonView) { - // Отрисовка внешних видов аннотации + // Drawing annotation appearances AcroFormFieldType oType = pField->getAcroFormFieldType(); ((GlobalParamsAdaptor*)globalParams)->setDrawFormField(true); @@ -3449,7 +3449,7 @@ void CAnnotAP::Draw(PDFDoc* pdfDoc, Object* oAP, int nRasterH, int nBackgroundCo { ((GlobalParamsAdaptor*)globalParams)->setDrawFormField(true); - // Отрисовка внешних видов аннотации + // Drawing annotation appearances Object oAnnot; XRef* xref = pdfDoc->getXRef(); oAnnotRef->fetch(xref, &oAnnot); @@ -3541,12 +3541,12 @@ void CAnnotAP::ToWASM(NSWasm::CData& oRes) } void CAnnots::ToWASM(NSWasm::CData& oRes) { - // Порядок вычислений - CO + // Calculation order - CO oRes.AddInt(m_arrCO.size()); for (int i = 0; i < m_arrCO.size(); ++i) oRes.AddInt(m_arrCO[i]); - // Родительские Fields + // Parent Fields oRes.AddInt(m_arrParents.size()); for (int i = 0; i < m_arrParents.size(); ++i) m_arrParents[i]->ToWASM(oRes); @@ -4162,7 +4162,7 @@ void CAnnotFileAttachment::ToWASM(NSWasm::CData& oRes) pEF->bFree = false; }; - // Освобождение памяти необходимо вызвать с js стороны + // Memory release must be called from js side if (m_pEF->m_pF) { nFlag |= (1 << 0); diff --git a/PdfFile/SrcReader/PdfAnnot.h b/PdfFile/SrcReader/PdfAnnot.h index 5275e3b1d9..7747ae850a 100644 --- a/PdfFile/SrcReader/PdfAnnot.h +++ b/PdfFile/SrcReader/PdfAnnot.h @@ -140,7 +140,7 @@ private: void Draw(PDFDoc* pdfDoc, Object* oAP, int nRasterH, int nBackgroundColor, Object* oAnnotRef, const char* sView); void Clear(); - unsigned int m_unRefNum; // Номер ссылки на объект + unsigned int m_unRefNum; // Object reference number double m_dx1, m_dy1, m_dx2, m_dy2; double m_dCropX, m_dCropY; double m_dWScale, m_dHScale; @@ -192,22 +192,22 @@ protected: unsigned int m_unAFlags; unsigned int m_unFlags; - double m_dHeight; // Высота холста, для Y трансформации - double m_dX; // Смещение по X для трансформации - double m_pRect[4]; // Координаты - std::vector<double> m_arrC; // Специальный цвет + double m_dHeight; // Canvas height, for Y transformation + double m_dX; // X offset for transformation + double m_pRect[4]; // Coordinates + std::vector<double> m_arrC; // Special color private: - unsigned int m_unAnnotFlag; // Флаг аннотации - F - unsigned int m_unRefNum; // Номер ссылки на объект - unsigned int m_unPage; // Страница - std::pair<BYTE, double> m_pBE; // Эффекты границы - std::string m_sContents; // Отображаемый текст - std::string m_sNM; // Уникальное имя - std::string m_sM; // Дата последнего изменения + unsigned int m_unAnnotFlag; // Annotation flag - F + unsigned int m_unRefNum; // Object reference number + unsigned int m_unPage; // Page + std::pair<BYTE, double> m_pBE; // Border effects + std::string m_sContents; // Display text + std::string m_sNM; // Unique name + std::string m_sM; // Date of last modification std::string m_sOUserID; // OO User ID - std::string m_sOMetadata; // OO метаданные формы - CBorderType* m_pBorder; // Граница + std::string m_sOMetadata; // OO form metadata + CBorderType* m_pBorder; // Border }; //------------------------------------------------------------------------ @@ -236,30 +236,30 @@ protected: std::string FieldLookupString(AcroFormField* pField, const char* sName, int nByte); - BYTE m_nType; // Тип - FT + флаги - unsigned int m_unFieldFlag; // Флаг - Ff + BYTE m_nType; // Type - FT + flags + unsigned int m_unFieldFlag; // Flag - Ff private: - unsigned int m_unR; // Поворот аннотации относительно страницы - R - unsigned int m_unRefNumParent; // Номер ссылки на объект родителя - unsigned int m_unFontStyle; // Стиль шрифта - из DA + unsigned int m_unR; // Annotation rotation relative to page - R + unsigned int m_unRefNumParent; // Parent object reference number + unsigned int m_unFontStyle; // Font style - from DA unsigned int m_unMEOptions; // MEOptions - double m_dFontSize; // Размер шрифта - из DA - std::vector<double> m_arrTC; // Цвет текста - из DA - std::vector<double> m_arrBC; // Цвет границ - BC - std::vector<double> m_arrBG; // Цвет фона - BG - std::vector<CAction*> m_arrAction; // Действия - A&AA - BYTE m_nQ; // Выравнивание текста - Q - BYTE m_nH; // Режим выделения - H - std::string m_sTU; // Альтернативное имя поля, используется во всплывающей подсказке и сообщениях об ошибке - TU - std::string m_sDS; // Строка стиля по умолчанию - DS - std::string m_sDV; // Значение по-умолчанию - DV - std::string m_sT; // Частичное имя поля - T - std::string m_sFontKey; // Уникальный идентификатор шрифта - std::string m_sFullName; // Полное имя поля - std::string m_sFontName; // Имя шрифта - из DA - std::string m_sActualFontName; // Имя замененного шрифта - std::string m_sButtonFontName; // Имя шрифта кнопки + double m_dFontSize; // Font size - from DA + std::vector<double> m_arrTC; // Text color - from DA + std::vector<double> m_arrBC; // Border color - BC + std::vector<double> m_arrBG; // Background color - BG + std::vector<CAction*> m_arrAction; // Actions - A&AA + BYTE m_nQ; // Text alignment - Q + BYTE m_nH; // Highlight mode - H + std::string m_sTU; // Alternate field name, used in tooltips and error messages - TU + std::string m_sDS; // Default style string - DS + std::string m_sDV; // Default value - DV + std::string m_sT; // Partial field name - T + std::string m_sFontKey; // Unique font identifier + std::string m_sFullName; // Full field name + std::string m_sFontName; // Font name - from DA + std::string m_sActualFontName; // Substituted font name + std::string m_sButtonFontName; // Button font name }; class CAnnotWidgetBtn final : public CAnnotWidget @@ -334,7 +334,7 @@ public: private: unsigned int m_unFlags; - unsigned int m_unRefNumParent; // Номер ссылки на объект родителя + unsigned int m_unRefNumParent; // Parent object reference number }; //------------------------------------------------------------------------ @@ -350,10 +350,10 @@ public: void ToWASM(NSWasm::CData& oRes) override; private: - BYTE m_nH; // Режим выделения - H - std::vector<double> m_arrQuadPoints; // Координаты - QuadPoints - CAction* m_pAction; // Действие - A&Dest - CAction* m_pPA; // URI действие - PA + BYTE m_nH; // Highlight mode - H + std::vector<double> m_arrQuadPoints; // Coordinates - QuadPoints + CAction* m_pAction; // Action - A&Dest + CAction* m_pPA; // URI action - PA }; //------------------------------------------------------------------------ @@ -367,7 +367,7 @@ public: { bool bFind; BYTE nAlign; - unsigned int unFontFlags; // 0 Bold, 1 Italic, 3 зачеркнутый, 4 подчеркнутый, 5 vertical-align, 6 actual font, 7 RTL + unsigned int unFontFlags; // 0 Bold, 1 Italic, 3 strikethrough, 4 underline, 5 vertical-align, 6 actual font, 7 RTL double dFontSise; double dVAlign; double dColor[3]; @@ -389,16 +389,16 @@ protected: virtual void ToWASM(NSWasm::CData& oRes) override; - std::vector<CFontData*> m_arrRC; // Форматированный текст + std::vector<CFontData*> m_arrRC; // Formatted text private: - BYTE m_nRT; // Тип аннотации-ответа - unsigned int m_unRefNumPopup; // Номер ссылки на всплывающую аннотацию - unsigned int m_unRefNumIRT; // Номер ссылки на аннотацию-ответ - double m_dCA; // Значение непрозрачности - std::string m_sT; // Текстовая метка, пользователь добавивший аннотацию - std::string m_sCreationDate; // Дата создания - std::string m_sSubj; // Краткое описание + BYTE m_nRT; // Reply annotation type + unsigned int m_unRefNumPopup; // Popup annotation reference number + unsigned int m_unRefNumIRT; // Reply annotation reference number + double m_dCA; // Opacity value + std::string m_sT; // Text label, user who added the annotation + std::string m_sCreationDate; // Creation date + std::string m_sSubj; // Brief description }; //------------------------------------------------------------------------ @@ -412,9 +412,9 @@ public: void ToWASM(NSWasm::CData& oRes) override; private: - BYTE m_nName; // Иконка - BYTE m_nState; // Состояние - BYTE m_nStateModel; // Модель состояния + BYTE m_nName; // Icon + BYTE m_nState; // State + BYTE m_nStateModel; // State model }; //------------------------------------------------------------------------ @@ -429,7 +429,7 @@ public: void ToWASM(NSWasm::CData& oRes) override; private: - std::vector< std::vector<double> > m_arrInkList; // Путь + std::vector< std::vector<double> > m_arrInkList; // Path }; //------------------------------------------------------------------------ @@ -444,16 +444,16 @@ public: void ToWASM(NSWasm::CData& oRes) override; private: - BYTE m_nIT; // Назначение аннотации - BYTE m_nCP; // Расположение заголовка аннотации - double m_dLL; // Длина линий выноски - double m_dLLE; // Продолжение линий выноски - double m_dLLO; // Длина смещения выноски - BYTE m_nLE[2]; // Стили окончания линии - double m_pL[4]{}; // Координаты линии - double m_pCO[2]; // Смещение текста подписи - std::vector<double> m_arrIC; // Цвет окончаний линии - // TODO Measure Показатели масштаба, единиц измерения + BYTE m_nIT; // Annotation intent + BYTE m_nCP; // Annotation caption position + double m_dLL; // Leader line length + double m_dLLE; // Leader line extension + double m_dLLO; // Leader line offset + BYTE m_nLE[2]; // Line ending styles + double m_pL[4]{}; // Line coordinates + double m_pCO[2]; // Caption text offset + std::vector<double> m_arrIC; // Line ending color + // TODO Measure scale indicators, measurement units }; //------------------------------------------------------------------------ @@ -468,8 +468,8 @@ public: void ToWASM(NSWasm::CData& oRes) override; private: - BYTE m_nSubtype; // Подтип TextMarkup аннотации - std::vector<double> m_arrQuadPoints; // Координаты + BYTE m_nSubtype; // TextMarkup annotation subtype + std::vector<double> m_arrQuadPoints; // Coordinates }; //------------------------------------------------------------------------ @@ -484,9 +484,9 @@ public: void ToWASM(NSWasm::CData& oRes) override; private: - BYTE m_nSubtype; // Подтип Square или Circle аннотации - double m_pRD[4]{}; // Различия Rect и фактического размера - std::vector<double> m_arrIC; // Цвет заполнения + BYTE m_nSubtype; // Square or Circle annotation subtype + double m_pRD[4]{}; // Differences between Rect and actual size + std::vector<double> m_arrIC; // Fill color }; //------------------------------------------------------------------------ @@ -501,12 +501,12 @@ public: void ToWASM(NSWasm::CData& oRes) override; private: - BYTE m_nIT; // Назначение аннотации - BYTE m_nSubtype; // Подтип Polygon или Polyline аннотации - BYTE m_nLE[2]; // Стили окончания линии - std::vector<double> m_arrIC; // Цвет заполнения - std::vector<double> m_arrVertices; // Координаты вершин - // TODO Measure Показатели масштаба, единиц измерения + BYTE m_nIT; // Annotation intent + BYTE m_nSubtype; // Polygon or Polyline annotation subtype + BYTE m_nLE[2]; // Line ending styles + std::vector<double> m_arrIC; // Fill color + std::vector<double> m_arrVertices; // Vertex coordinates + // TODO Measure scale indicators, measurement units }; //------------------------------------------------------------------------ @@ -521,14 +521,14 @@ public: void ToWASM(NSWasm::CData& oRes) override; private: - BYTE m_nQ; // Выравнивание текста - Q - BYTE m_nIT; // Назначение аннотации - BYTE m_nLE; // Стиль окончания линии + BYTE m_nQ; // Text alignment - Q + BYTE m_nIT; // Annotation intent + BYTE m_nLE; // Line ending style int m_nRotate; - std::string m_sDS; // Строка стиля по умолчанию - DS - double m_pRD[4]{}; // Различия Rect и фактического размера - std::vector<double> m_arrCFromDA; // Цвет границы - std::vector<double> m_arrCL; // Координаты выноски + std::string m_sDS; // Default style string - DS + double m_pRD[4]{}; // Differences between Rect and actual size + std::vector<double> m_arrCFromDA; // Border color + std::vector<double> m_arrCL; // Callout coordinates }; //------------------------------------------------------------------------ @@ -543,8 +543,8 @@ public: void ToWASM(NSWasm::CData& oRes) override; private: - BYTE m_nSy; // Связанный символ - Sy - double m_pRD[4]{}; // Различия Rect и фактического размера + BYTE m_nSy; // Associated symbol - Sy + double m_pRD[4]{}; // Differences between Rect and actual size }; //------------------------------------------------------------------------ @@ -589,18 +589,18 @@ public: }; private: - std::string m_sName; // Иконка - std::string m_sFS; // Файловая система - std::string m_sDesc; // Описание файла - std::string m_sF; // Спецификация файла (обратная совместимость) - std::string m_sUF; // Спецификация файла (кросс-платформенная и межъязыковая совместимость) - std::string m_sDOS; // Спецификация файла DOS - std::string m_sMac; // Спецификация файла Mac - std::string m_sUnix; // Спецификация файла Unix - std::pair<std::string, std::string> m_sID; // Идентификатор файла - CEmbeddedFiles* m_pEF; // EF содержит F/UF/DOS/Mac/Unix со ссылками на встроенные файловые потоки по соответствующим спецификациях - // TODO RF содержит F/UF/DOS/Mac/Unix с массивами связанных файлов по соответствующим спецификациях - // TODO Cl коллекция для создания пользовательского интерфейса + std::string m_sName; // Icon + std::string m_sFS; // File system + std::string m_sDesc; // File description + std::string m_sF; // File specification (backward compatibility) + std::string m_sUF; // File specification (cross-platform and cross-language compatibility) + std::string m_sDOS; // DOS file specification + std::string m_sMac; // Mac file specification + std::string m_sUnix; // Unix file specification + std::pair<std::string, std::string> m_sID; // File identifier + CEmbeddedFiles* m_pEF; // EF contains F/UF/DOS/Mac/Unix with references to embedded file streams by corresponding specifications + // TODO RF contains F/UF/DOS/Mac/Unix with arrays of related files by corresponding specifications + // TODO Cl collection for creating user interface }; //------------------------------------------------------------------------ @@ -615,7 +615,7 @@ public: void ToWASM(NSWasm::CData& oRes) override; private: - std::string m_sName; // Иконка + std::string m_sName; // Icon double m_dRotate; double m_dX1, m_dY1, m_dX2, m_dY2, m_dX3, m_dY3, m_dX4, m_dY4; }; @@ -634,15 +634,15 @@ public: void ToWASM(NSWasm::CData& oRes) override; private: - BYTE m_nQ; // Выравнивание текста - unsigned int m_unFontStyle; // Стиль шрифта - из DA - double m_dFontSize; // Размер шрифта - из DA - std::string m_sFontName; // Имя шрифта - из DA - std::string m_sActualFontName; // Имя замененного шрифта - std::string m_sOverlayText; // Текст наложения - std::vector<double> m_arrQuadPoints; // Координаты - std::vector<double> m_arrIC; // Цвет заполнения - std::vector<double> m_arrCFromDA; // Цвет текста + BYTE m_nQ; // Text alignment + unsigned int m_unFontStyle; // Font style - from DA + double m_dFontSize; // Font size - from DA + std::string m_sFontName; // Font name - from DA + std::string m_sActualFontName; // Substituted font name + std::string m_sOverlayText; // Overlay text + std::vector<double> m_arrQuadPoints; // Coordinates + std::vector<double> m_arrIC; // Fill color + std::vector<double> m_arrCFromDA; // Text color }; //------------------------------------------------------------------------ @@ -680,15 +680,15 @@ private: bool bChangeFullName; unsigned int unFlags; - unsigned int unRefNum; // Номер ссылки на объект - unsigned int unMaxLen; // Ограничение на максимальную длину text field - unsigned int unFieldFlag; // Флаг Ff + unsigned int unRefNum; // Object reference number + unsigned int unMaxLen; // Maximum length limit for text field + unsigned int unFieldFlag; // Flag Ff unsigned int unMEOptions; // MEOptions - unsigned int unRefNumParent; // Номер ссылки на объект родителя + unsigned int unRefNumParent; // Parent object reference number std::vector<int> arrI; std::vector<std::string> arrV; std::vector< std::pair<std::string, std::string> > arrOpt; - std::vector<CAction*> arrAction; // Действия + std::vector<CAction*> arrAction; // Actions std::string sT; std::string sV; std::string sDV; @@ -698,8 +698,8 @@ private: void getParents(PDFDoc* pdfDoc, Object* oFieldRef, int nStartRefID); - std::vector<int> m_arrCO; // Порядок вычислений - CO - std::vector<CAnnotParent*> m_arrParents; // Родительские Fields + std::vector<int> m_arrCO; // Calculation order - CO + std::vector<CAnnotParent*> m_arrParents; // Parent Fields std::vector<CAnnotWidget*> m_arrAnnots; }; diff --git a/PdfFile/SrcReader/PdfFont.cpp b/PdfFile/SrcReader/PdfFont.cpp index 93cacbf318..316e7e2d0d 100644 --- a/PdfFile/SrcReader/PdfFont.cpp +++ b/PdfFile/SrcReader/PdfFont.cpp @@ -409,7 +409,7 @@ std::map<std::wstring, std::wstring> GetAllFonts(PDFDoc* pdfDoc, NSFonts::IFontM if (!pField) continue; - // Шрифт и размер шрифта - из DA + // Font and font size - from DA Ref fontID; double dFontSize = 0; pField->getFont(&fontID, &dFontSize); @@ -955,7 +955,7 @@ std::map<std::wstring, std::wstring> GetFreeTextFont(PDFDoc* pdfDoc, NSFonts::IF } void CollectFontWidths(GfxFont* gfxFont, Dict* pFontDict, std::map<unsigned int, unsigned int>& mGIDToWidth) { - // Пытаемся получить ширины из словаря Widths + // Try to get widths from Widths dictionary Object oWidths; if (pFontDict->lookup("Widths", &oWidths)->isArray()) { @@ -979,21 +979,21 @@ void CollectFontWidths(GfxFont* gfxFont, Dict* pFontDict, std::map<unsigned int, } oWidths.free(); - // Для CID шрифтов обрабатываем DW и W + // For CID fonts, process DW and W Object oDescendantFonts; if (pFontDict->lookup("DescendantFonts", &oDescendantFonts)->isArray() && oDescendantFonts.arrayGetLength() > 0) { Object oCIDFont; if (oDescendantFonts.arrayGet(0, &oCIDFont)->isDict()) { - // Получаем DW (default width) + // Get DW (default width) Object oDW; int nDefaultWidth = 1000; if (oCIDFont.dictLookup("DW", &oDW)->isInt()) nDefaultWidth = oDW.getInt(); oDW.free(); - // Получаем W (widths array) + // Get W (widths array) Object oW; if (oCIDFont.dictLookup("W", &oW)->isArray()) { diff --git a/PdfFile/SrcReader/RendererOutputDev.cpp b/PdfFile/SrcReader/RendererOutputDev.cpp index cbc3687407..e6e412ef45 100644 --- a/PdfFile/SrcReader/RendererOutputDev.cpp +++ b/PdfFile/SrcReader/RendererOutputDev.cpp @@ -312,10 +312,10 @@ static int readFromMemoryStream(void* data) return ((CMemoryFontStream*)data)->getChar(); } -// TODO: 1. Реализовать по-нормальному градиентные заливки (Axial и Radial) +// TODO: 1. Implement gradient fills properly (Axial and Radial) // 2. m_pRenderer->SetAdditionalParam(L"TilingHtmlPattern", oWriter.GetXmlString()); -// 3. Подбор шрифтов необходимо перенести в GlobalParams->FindFontFile -// 4. В идентефикацию шрифта к путю добавить номер шрифта в файле +// 3. Font matching needs to be moved to GlobalParams->FindFontFile +// 4. Add font number in file to font identification path namespace PdfReader { @@ -340,7 +340,7 @@ namespace PdfReader if (bResult) { - // Шрифт нашелся, но пока им пользоваться нельзя, потому что он загружается в параллельном потоке + // Font was found, but cannot be used yet because it is being loaded in a parallel thread while (!pEntry->bAvailable) NSThreads::Sleep(10); } @@ -357,7 +357,7 @@ namespace PdfReader if (bResult) { - // Шрифт нашелся, но пока им пользоваться нельзя, потому что он загружается в параллельном потоке + // Font was found, but cannot be used yet because it is being loaded in a parallel thread while (!(*ppEntry)->bAvailable) NSThreads::Sleep(10); } @@ -374,7 +374,7 @@ namespace PdfReader } TFontEntry* CPdfFontList::Add(Ref oRef, const std::wstring& wsFileName, int* pCodeToGID, int* pCodeToUnicode, unsigned int unLenGID, unsigned int unLenUnicode) { - // Данная функция приходит только из Find2, поэтому проверять есть ли данный шрифт уже не надо + // This function is only called from Find2, so no need to check if this font already exists CTemporaryCS* pCS = new CTemporaryCS(&m_oCS); TFontEntry* pNewEntry = new TFontEntry; @@ -435,7 +435,7 @@ namespace PdfReader } void CPdfFontList::Add(Ref& oRef, TFontEntry* pFontEntry) { - // До вызова данной функции надо проверять есть ли элемент с данным ключом + // Before calling this function, need to check if an element with this key exists m_oFontMap.insert(std::pair<Ref, TFontEntry*>(oRef, pFontEntry)); } const std::map<Ref, TFontEntry*>& CPdfFontList::GetFonts() @@ -511,8 +511,8 @@ namespace PdfReader m_sStates.back().pSoftMask = m_pSoftMask; } - // Выходит дольше из-за копирования Clip, Pen, Brush, - // но не имеет смысла, т.к. Restore всё равно перенакладывает все Clip с нуля + // Takes longer due to copying Clip, Pen, Brush, + // but pointless since Restore reapplies all Clip from scratch anyway //if (c_nGrRenderer == m_lRendererType) //{ // NSGraphics::IGraphicsRenderer* GRenderer = dynamic_cast<NSGraphics::IGraphicsRenderer*>(m_pRenderer); @@ -525,7 +525,7 @@ namespace PdfReader { RELEASEINTERFACE(m_pSoftMask); if (m_sStates.empty()) - { // Несбалансированный q/Q - сломанный файл + { // Unbalanced q/Q - corrupted file updateAll(pGState); UpdateAllClip(pGState); return; @@ -795,7 +795,7 @@ namespace PdfReader if (oDictItem.isInt() && 0 != oDictItem.getInt()) { int nFlags = oDictItem.getInt(); - if (nFlags & 1) // моноширинный + if (nFlags & 1) // monospaced oFontSelect.bFixedWidth = new INT(1); } oDictItem.free(); @@ -870,7 +870,7 @@ namespace PdfReader if (!pFontList->Find2((*pFont->getID()), &pEntry)) { GfxFontType eFontType = pFont->getType(); - if (fontType3 == eFontType) // FontType3 обрабатывается отдельной командой + if (fontType3 == eFontType) // FontType3 is handled by a separate command { pEntry->bAvailable = true; return; @@ -887,9 +887,9 @@ namespace PdfReader #ifdef FONTS_USE_ONLY_MEMORY_STREAMS CMemoryFontStream oMemoryFontStream; #endif - // 1. Если шрифт внедренный, тогда скидываем его в темповый файл. - // 2. Если шрифт лежит вне пдф, а в самом пдф есть ссылка на него, тогда используем эту ссылку. - // 3. В противном случае подбираем шрифт. + // 1. If font is embedded, dump it to a temp file. + // 2. If font is outside pdf but pdf has a reference to it, use that reference. + // 3. Otherwise, select a font. if (pFont->getEmbeddedFontID(&oEmbRef)) { @@ -933,7 +933,7 @@ namespace PdfReader oReferenceObject.free(); if (!oStreamObject.isStream()) { - // Внедренный шрифт неправильно записан + // Embedded font is incorrectly written oStreamObject.free(); #ifndef FONTS_USE_ONLY_MEMORY_STREAMS @@ -965,7 +965,7 @@ namespace PdfReader wsFileName = wsTempFileName; #ifdef FONTS_USE_AFM_SETTINGS - // Для шрифтов типа Type1 нужно дописать Afm файл с метриками + // For Type1 fonts, need to write Afm file with metrics if (fontType1 == pFont->getType() || fontType1C == pFont->getType() || fontType1COT == pFont->getType()) { std::wstring wsSplitFileName, wsSplitFileExt; @@ -1101,7 +1101,7 @@ namespace PdfReader } #endif - // Загрузим сам файл со шрифтом, чтобы точно определить его тип + // Load the font file itself to determine its exact type if (!pFontManager->LoadFontFromFile(wsFileName, 0, 10, 72, 72)) { pEntry->bAvailable = true; @@ -1219,13 +1219,13 @@ namespace PdfReader bFontSubstitution = true; } - else // В крайнем случае, в данном шрифте просто не пишем ничего + else // As a last resort, simply don't write anything with this font { pEntry->bAvailable = true; return; } } - // Здесь мы грузим кодировки + // Here we load encodings int* pCodeToGID = NULL, *pCodeToUnicode = NULL; int nLen = 0; FoFiTrueType* pTTFontFile = NULL; @@ -1448,9 +1448,9 @@ namespace PdfReader case fontCIDType2: case fontCIDType2OT: { - // Создаем карту CID-to-GID - // Если у нас шрифт был не встроен и подбирался и есть мап ToUnicode, тогда на основе его читаем из файла гиды по юникодным значениям. - // Для встроенных шрифтов используем мап CIDtoGID + // Create CID-to-GID map + // If font was not embedded and was substituted and has ToUnicode map, read GIDs from file based on unicode values. + // For embedded fonts use CIDtoGID map pCodeToGID = NULL; nLen = 0; if (L"" != wsFileName && bFontSubstitution) @@ -1465,7 +1465,7 @@ namespace PdfReader #endif if (pTTFontFile) { - // Ищем Unicode Cmap + // Looking for Unicode Cmap std::vector<int> arrCMapIndex; for (int nCMapIndex = 0; nCMapIndex < pTTFontFile->getNumCmaps(); ++nCMapIndex) { @@ -1519,7 +1519,7 @@ namespace PdfReader } default: { - // Такого не должно произойти + // This should not happen #ifndef FONTS_USE_ONLY_MEMORY_STREAMS if (L"" != wsTempFileName) NSFile::CFileBinary::Remove(wsTempFileName); @@ -1527,7 +1527,7 @@ namespace PdfReader break; } } - // Составляем таблицу Code -> Unicode + // Build Code -> Unicode table int nToUnicodeLen = 0; if (pFont->isCIDFont()) { @@ -1578,7 +1578,7 @@ namespace PdfReader } } - // Обрежем индекс у FontName, если он есть + // Trim index from FontName if present if (wsFontName.empty()) wsFontName = wsFontBaseName; if (bNotFullName) @@ -1604,7 +1604,7 @@ namespace PdfReader } void RendererOutputDev::updateFont(GfxState* pGState) { - // Проверяем наличие списка со шрифтами + // Check for font list presence if (!m_pFontList) return; @@ -1687,7 +1687,7 @@ namespace PdfReader if (m_bDrawOnlyText) return; - if (nX1 - nX0 == 1 && nY1 - nY0 == 1) // Одно изображение, tilingPattern не требуется + if (nX1 - nX0 == 1 && nY1 - nY0 == 1) // Single image, tilingPattern not required { gfx->drawForm(pStream, pResourcesDict, pMatrix, pBBox); return; @@ -2300,7 +2300,7 @@ namespace PdfReader double dShiftX = 0, dShiftY = 0; DoTransform(pMatrix, &dShiftX, &dShiftY, true); - // TODO: нужна нормальная конвертация + // TODO: need proper conversion int nLen = (int)wsText.length(); const wchar_t* pDataSrc = wsText.c_str(); if (1 == wsText.length()) @@ -2330,7 +2330,7 @@ namespace PdfReader int nRenderMode = pGState->getRender(); - // Обработка Stroke + // Handle Stroke if (1 == nRenderMode || 2 == nRenderMode || 5 == nRenderMode || 6 == nRenderMode) { // Painter::CPen oPen; @@ -2349,13 +2349,13 @@ namespace PdfReader int nRenderMode = pGState->getRender(); - // Добавляем в Clipping Path текст + // Add text to Clipping Path if (nRenderMode >= 4) { updateFont(pGState); } - // Возвращаем параметры для Stroke + // Restore Stroke parameters if (1 == nRenderMode || 2 == nRenderMode || 5 == nRenderMode || 6 == nRenderMode) { //BSTR bsPen = m_oPen.ToXmlString().AllocSysString(); @@ -2367,18 +2367,18 @@ namespace PdfReader } void RendererOutputDev::drawString(GfxState* pGState, GString* seString) { - // Проверяем наличие списка со шрифтами + // Check for font list presence if (NULL == m_pFontList) return; - // Проверяем наличие текущего шрифта + // Check for current font presence TFontEntry oEntry; if (!m_pFontList->GetFont(pGState->getFont()->getID(), &oEntry)) return; int nRendererMode = pGState->getRender(); - if (3 == nRendererMode) // Невидимый текст + if (3 == nRendererMode) // Invisible text return; unsigned int unGidsCount = seString->getLength(); @@ -2409,17 +2409,17 @@ namespace PdfReader } void RendererOutputDev::drawChar(GfxState* pGState, double dX, double dY, double dDx, double dDy, double dOriginX, double dOriginY, CharCode nCode, int nBytesCount, Unicode* pUnicode, int nUnicodeLen) { - // Проверяем наличие списка со шрифтами + // Check for font list presence if (NULL == m_pFontList) return; - // Проверяем наличие текущего шрифта + // Check for current font presence TFontEntry oEntry; if (!m_pFontList->GetFont(pGState->getFont()->getID(), &oEntry)) return; int nRenderMode = pGState->getRender(); - if (3 == nRenderMode && !m_bDrawOnlyText) // Невидимый текст + if (3 == nRenderMode && !m_bDrawOnlyText) // Invisible text { return; } @@ -2508,12 +2508,12 @@ namespace PdfReader { if (isCIDFont) { - // Значит кодировка была Identity-H или Identity-V, что означает, что исходные коды и есть юникодные значения + // Means encoding was Identity-H or Identity-V, which means source codes are unicode values wsUnicodeText = NSStringExt::CConverter::GetUnicodeFromUTF32((const unsigned int*)(&nCode), 1); } else { - // Договорились, что если нельзя точно составить юникодные значения, тогда отдаем NULL + // Agreed that if unicode values cannot be accurately composed, return NULL if (pFont->getType() == fontType3) wsUnicodeText = NSStringExt::CConverter::GetUnicodeFromUTF32(pUnicode, nUnicodeLen); else @@ -2762,7 +2762,7 @@ namespace PdfReader Aggplus::CImage oImage; oImage.Create(pBufferPtr, nWidth, nHeight, -4 * nWidth); - // Пишем данные в pBufferPtr + // Write data to pBufferPtr ImageStream* pImageStream = new ImageStream(pStream, nWidth, 1, 1); pImageStream->reset(); @@ -2806,7 +2806,7 @@ namespace PdfReader double arrMatrix[6]; double* pCTM = pGState->getCTM(); - // Исходное предобразование + // Initial transformation // |1 0 0| |pCTM[0] pCTM[1] 0| // arrMattrix = |0 -1 0| * |pCTM[2] pCTM[3] 0| // |0 1 1| |pCTM[4] pCTM[5] 1| @@ -2841,7 +2841,7 @@ namespace PdfReader Aggplus::CImage oImage; oImage.Create(pBufferPtr, nWidth, nHeight, -4 * nWidth, true); - // Пишем данные в pBufferPtr + // Write data to pBufferPtr ImageStream* pImageStream = new ImageStream(pStream, nWidth, 1, 1); pImageStream->reset(); @@ -2893,7 +2893,7 @@ namespace PdfReader double arrMatrix[6]; double* pCTM = pGState->getCTM(); - // Исходное предобразование + // Initial transformation // |1 0 0| |pCTM[0] pCTM[1] 0| // arrMattrix = |0 -1 0| * |pCTM[2] pCTM[3] 0| // |0 1 1| |pCTM[4] pCTM[5] 1| @@ -2938,7 +2938,7 @@ namespace PdfReader int nComponentsCount = pColorMap->getNumPixelComps(); BYTE unAlpha = std::min(255, std::max(0, int(pGState->getFillOpacity() * 255))); - // Пишем данные в pBufferPtr + // Write data to pBufferPtr ImageStream* pImageStream = new ImageStream(pStream, nWidth, nComponentsCount, pColorMap->getBits()); pImageStream->reset(); @@ -3053,7 +3053,7 @@ namespace PdfReader int nComponentsCount = pColorMap->getNumPixelComps(); BYTE unAlpha = std::min(255, std::max(0, int(pGState->getFillOpacity() * 255))); - // Чтение jpeg через cximage происходит быстрее чем через xpdf на ~40% + // Reading jpeg via cximage is ~40% faster than via xpdf if (pMaskColors || unAlpha != 255 || (nSK != strDCT || nComponentsCount != 3 || !ReadImage(&oImage, pRef, pStream))) { BYTE* pBufferPtr = BufferFromImageStream(pGState, pStream, nWidth, nHeight, pColorMap, pMaskColors); @@ -3065,7 +3065,7 @@ namespace PdfReader double arrMatrix[6]; double* pCTM = pGState->getCTM(); - // Исходное предобразование + // Initial transformation // |1 0 0| |pCTM[0] pCTM[1] 0| // arrMatrix = |0 -1 0| * |pCTM[2] pCTM[3] 0| // |0 1 1| |pCTM[4] pCTM[5] 1| @@ -3122,7 +3122,7 @@ namespace PdfReader Aggplus::CImage oImage; oImage.Create(pBufferPtr, nWidth, nHeight, -4 * nWidth); - // Пишем данные в pBufferPtr + // Write data to pBufferPtr ImageStream* pImageStream = new ImageStream(pStream, nWidth, pColorMap->getNumPixelComps(), pColorMap->getBits()); ImageStream* pMask = new ImageStream(pMaskStream, nMaskWidth, 1, 1); pMask->reset(); @@ -3210,7 +3210,7 @@ namespace PdfReader double arrMatrix[6]; double* pCTM = pGState->getCTM(); - // Исходное предобразование + // Initial transformation // |1 0 0| |pCTM[0] pCTM[1] 0| // arrMatrix = |0 -1 0| * |pCTM[2] pCTM[3] 0| // |0 1 1| |pCTM[4] pCTM[5] 1| @@ -3249,8 +3249,8 @@ namespace PdfReader double dAlphaKoef = pGState->getFillOpacity(); if (nWidth != nMaskWidth || nHeight != nMaskHeight) { - // TODO: Здесь сделан элементарный вариант масштабирования маски. - // Надо улучшить алгоритм. + // TODO: Basic mask scaling implementation done here. + // Need to improve the algorithm. bool bResize = true; @@ -3356,7 +3356,7 @@ namespace PdfReader ImageStream* pSMaskStream = new ImageStream(pMaskStream, nMaskWidth, pMaskColorMap->getNumPixelComps(), pMaskColorMap->getBits()); pSMaskStream->reset(); - // Быстрая реализация для масок + // Fast implementation for masks int nMaskColorMapType = pMaskColorMap->getFillType(); GfxColorComp** pMaskColorMapLookup = pMaskColorMap->getLookup(); if (!pMaskColorMapLookup) @@ -3371,7 +3371,7 @@ namespace PdfReader int nIndex = 4 * nY * nMaskWidth; if (!pMaskLine) { - // Заполняем прозрачностью, если линия не прочитана + // Fill with transparency if line was not read for (int nX = 0; nX < nMaskWidth; ++nX) { pBufferPtr[nIndex + 3] = 0; @@ -3384,7 +3384,7 @@ namespace PdfReader { BYTE unAlpha = 0; - // Оптимизированные случаи для разных цветовых пространств + // Optimized cases for different color spaces if (1 == nMaskColorMapType) { unAlpha = colToByte(clip01(pMaskColorMapLookup[0][pMaskLine[0]])); @@ -3444,7 +3444,7 @@ namespace PdfReader double arrMatrix[6]; double* pCTM = pGState->getCTM(); - // Исходное предобразование + // Initial transformation // |1 0 0| |pCTM[0] pCTM[1] 0| // arrMattrix = |0 -1 0| * |pCTM[2] pCTM[3] 0| // |0 1 1| |pCTM[4] pCTM[5] 1| @@ -3502,7 +3502,7 @@ namespace PdfReader GfxRGB c; m_sCS.back().pBlendingCS->getRGB(pBackdropColor, &c, GfxRenderingIntent::gfxRenderingIntentAbsoluteColorimetric); DWORD dwColor = colToByte(c.r) + colToByte(c.g) * 0x100 + colToByte(c.b) * 0x100 * 0x100; - // TODO цвет фона мягкой маски должен быть установлен в dwColor + // TODO soft mask background color should be set to dwColor } if (pTransferFunc) @@ -3526,7 +3526,7 @@ namespace PdfReader } } - // if (!bAlpha) // pTransferFunc преобразовала результат luminosity маски в alpha маску + // if (!bAlpha) // pTransferFunc transformed luminosity mask result to alpha mask // m_pSoftMask->SetType(Aggplus::EMaskDataType::Alpha4Buffer); } @@ -3644,7 +3644,7 @@ namespace PdfReader double dShiftX = 0, dShiftY = 0; DoTransform(pTextClip->GetMatrix(nIndex), &dShiftX, &dShiftY, true); - // TODO: нужна нормальная конвертация + // TODO: need proper conversion int nLen = 0; wchar_t* wsTextTmp = wsText; if (wsTextTmp) diff --git a/PdfFile/SrcReader/RendererOutputDev.h b/PdfFile/SrcReader/RendererOutputDev.h index c1f9995cf5..02468e4eb0 100644 --- a/PdfFile/SrcReader/RendererOutputDev.h +++ b/PdfFile/SrcReader/RendererOutputDev.h @@ -48,13 +48,13 @@ namespace PdfReader //------------------------------------------------------------------------------------------------------------------------------- struct TFontEntry { - std::wstring wsFilePath; // Путь к шрифту на диске - std::wstring wsFontName; // Имя шрифта, которое записано в PDF(ветка для случаев, когда имя шрифта в самом шрифте не указано) - int* pCodeToGID; // Таблица код - номер глифа в шрифте - int* pCodeToUnicode; // Таблица код - юникодное значение + std::wstring wsFilePath; // Path to font on disk + std::wstring wsFontName; // Font name as written in PDF (branch for cases when font name is not specified in font itself) + int* pCodeToGID; // Code to glyph number in font table + int* pCodeToUnicode; // Code to unicode value table unsigned int unLenGID; unsigned int unLenUnicode; - bool bAvailable; // Доступен ли шрифт. Сделано для многопотоковости + bool bAvailable; // Is font available. Made for multithreading bool bFontSubstitution = false; bool bIsIdentity = false; @@ -78,7 +78,7 @@ namespace PdfReader private: std::map<Ref, TFontEntry*> m_oFontMap; - NSCriticalSection::CRITICAL_SECTION m_oCS; // Критическая секция + NSCriticalSection::CRITICAL_SECTION m_oCS; // Critical section }; //------------------------------------------------------------------------------------------------------------------------------- @@ -167,7 +167,7 @@ namespace PdfReader //----- Save/Restore GState virtual void saveState(GfxState *pGState) override; virtual void restoreState(GfxState *pGState) override; - //----- Изменение параметров в GState + //----- GState parameter modification virtual void updateCTM(GfxState *pGState, double dMatrix11, double dMatrix12, double dMatrix21, double dMatrix22, double dMatrix31, double dMatrix32) override; virtual void updateLineDash(GfxState *pGState) override; virtual void updateFlatness(GfxState *pGState) override; @@ -183,9 +183,9 @@ namespace PdfReader virtual void updateStrokeOpacity(GfxState *pGState) override; virtual void updateAll(GfxState *pGState) override; virtual void updateRender(GfxState *pGState) override; - //----- Изменение текстовых параметров + //----- Text parameter modification virtual void updateFont(GfxState *pGState) override; - //----- Рисование Path + //----- Path drawing virtual void stroke(GfxState *pGState) override; virtual void fill(GfxState *pGState) override; virtual void eoFill(GfxState *pGState) override; @@ -211,7 +211,7 @@ namespace PdfReader virtual void eoClip(GfxState *pGState) override; virtual void clipToStrokePath(GfxState *pGState) override; virtual void clipToPath(GfxState *pGState, GfxPath *pPath, double *pMatrix, bool bEO); - //----- Вывод текста + //----- Text output virtual void endTextObject(GfxState *pGState) override; virtual void beginStringOp(GfxState *pGState) override; virtual void endStringOp(GfxState *pGState) override; @@ -219,11 +219,11 @@ namespace PdfReader virtual void drawChar(GfxState *pGState, double dX, double dY, double dDx, double dDy, double dOriginX, double dOriginY, CharCode nCode, int nBytesCount, Unicode *pUnicode, int nUnicodeLen) override; GBool beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, Unicode *u, int uLen) override; void endType3Char(GfxState *pGState) override; - //----- Дополнительные функции + //----- Additional functions virtual GBool beginMarkedContent(GfxState *state, GString *s) override; virtual GBool beginMCOShapes(GfxState *state, GString *s, Object *ref) override; virtual void endMarkedContent(GfxState *state) override; - //----- Вывод картинок + //----- Image output bool ReadImage(Aggplus::CImage* pImageRes, Object *pRef, Stream *pStream); virtual void drawImageMask(GfxState *pGState, Gfx *gfx, Object *pRef, Stream *pStream, int nWidth, int nHeight, GBool bInvert, GBool bInlineImage, GBool interpolate) override; virtual void setSoftMaskFromImageMask(GfxState *pGState, Gfx *gfx, Object *pRef, Stream *pStream, int nWidth, int nHeight, GBool bInvert, GBool bInlineImage, GBool interpolate) override; @@ -232,13 +232,13 @@ namespace PdfReader Object* pMaskRef, Stream *pMaskStream, int nMaskWidth, int nMaskHeight, GBool bMaskInvert, GBool interpolate) override; virtual void drawSoftMaskedImage(GfxState *pGState, Gfx *gfx, Object *pRef, Stream *pStream, int nWidth, int nHeight, GfxImageColorMap *pColorMap, Object *maskRef, Stream *pMaskStream, int nMaskWidth, int nMaskHeight, GfxImageColorMap *pMaskColorMap, double *pMatte, GBool interpolate) override; - //----- Transparency groups и SMasks + //----- Transparency groups and SMasks virtual void beginTransparencyGroup(GfxState *pGState, double *pBBox, GfxColorSpace *pBlendingColorSpace, GBool bIsolated, GBool bKnockout, GBool bForSoftMask) override; virtual void endTransparencyGroup(GfxState *pGState) override; virtual void paintTransparencyGroup(GfxState *pGState, double *pBBox) override; virtual void setSoftMask(GfxState *pGState, double *pBBox, GBool bAlpha, Function *pTransferFunc, GfxColor *pBackdropColor) override; virtual void clearSoftMask(GfxState *pGState) override; - //----- Дополнительные функции для данного устройства + //----- Additional functions for this device void NewPDF(XRef *pXref); void SetBreak(bool* pbBreak) { @@ -283,10 +283,10 @@ namespace PdfReader double m_arrMatrix[6]; NSFonts::IFontManager* m_pFontManager; - XRef* m_pXref; // Таблица Xref для данного PDF-документа + XRef* m_pXref; // Xref table for this PDF document CPdfFontList* m_pFontList; - bool *m_pbBreak; // Внешняя остановка рендерера + bool *m_pbBreak; // External renderer stop std::deque<GfxOutputCS> m_sCS; std::deque<GfxOutputState> m_sStates; diff --git a/PdfFile/SrcWriter/Annotation.cpp b/PdfFile/SrcWriter/Annotation.cpp index a4be2349f3..a40947a42a 100644 --- a/PdfFile/SrcWriter/Annotation.cpp +++ b/PdfFile/SrcWriter/Annotation.cpp @@ -190,7 +190,7 @@ namespace PdfWriter Add("Type", "Annot"); Add("Subtype", c_sAnnotTypeNames[(int)eType]); - // Для PDFA нужно, чтобы 0, 1, 4 биты были выключены, а второй включен + // For PDFA bits 0, 1, 4 must be off and bit 2 must be on Add("F", 4); } void CAnnotation::SetRect(const TRect& oRect) @@ -2493,7 +2493,7 @@ namespace PdfWriter int i = 0; if (m_nTI < 0) { - // Ищем верхний элемент отрисовки + // Find top rendering element for (; i < m_arrOpt.size(); ++i) { if (( m_arrOpt[i].first.empty() && m_arrOpt[i].second == arrV.front()) || diff --git a/PdfFile/SrcWriter/Consts.h b/PdfFile/SrcWriter/Consts.h index ec346d8bd2..6246dc55e5 100644 --- a/PdfFile/SrcWriter/Consts.h +++ b/PdfFile/SrcWriter/Consts.h @@ -35,28 +35,28 @@ #define OK 0 #define NOERROR 0 -// Стандартный размер буфера в memory-stream-object +// Default buffer size for memory-stream-object #define STREAM_BUF_SIZ 4096 #define MAX_OPENED_FT_FACES 30 -// Необходимый размер буффера для конвертирования с символьную строку. +// Required buffer size for converting to character string. #define SHORT_BUFFER_SIZE 32 #define REAL_LEN 31//11 #define INT_LEN 11 #define TEXT_DEFAULT_LEN 256 #define DATE_TIME_STR_LEN 23 -// Соответсвующие длины в таблицу cross-reference-table +// Corresponding lengths in cross-reference-table #define BYTE_OFFSET_LEN 10 #define OBJ_ID_LEN 7 #define GEN_NO_LEN 5 -// Стандартный размер страницы (А4) +// Default page size (A4) #define DEF_PAGE_WIDTH 595.276 #define DEF_PAGE_HEIGHT 841.89 -// Типы компрессии +// Compression types #define COMP_NONE 0x00 #define COMP_TEXT 0x01 @@ -76,7 +76,7 @@ #define ENABLE_COPY 16 #define ENABLE_EDIT 32 -// Варианты просмотра документа +// Document view options #define HIDE_TOOLBAR 1 #define HIDE_MENUBAR 2 @@ -85,7 +85,7 @@ #define CENTER_WINDOW 16 -// Ограничения, в соответствии со спецификацией +// Limits according to specification #define LIMIT_MAX_INT 2147483647 #define LIMIT_MIN_INT -2147483647 diff --git a/PdfFile/SrcWriter/Destination.cpp b/PdfFile/SrcWriter/Destination.cpp index c65a3b5bda..ae2bb2845c 100644 --- a/PdfFile/SrcWriter/Destination.cpp +++ b/PdfFile/SrcWriter/Destination.cpp @@ -41,16 +41,16 @@ namespace PdfWriter if (!bInline) pXref->Add(this); - // Первый элемент массива должен быть страницей, которой принадлежит объект + // First element of the array must be the page to which the object belongs Add(pPage); - Add("Fit"); // Значение по умолчанию Fit + Add("Fit"); // Default value Fit } bool CDestination::IsValid() const { if (m_arrList.size() < 2) return false; - // Проверка, что объект является страницей. Но это может быть ссылка на нередактируемую страницу + // Check that the object is a page. But it can be a reference to a non-editable page // CObjectBase* pObject = Get(0, false); // if ((object_type_DICT != pObject->GetType() || dict_type_PAGE != ((CDictObject*)pObject)->GetDictType()) && // (object_type_PROXY != pObject->GetType() || object_type_DICT != ((CProxyObject*)pObject)->Get()->GetType() || dict_type_PAGE != ((CDictObject*)((CProxyObject*)pObject)->Get())->GetDictType())) @@ -85,7 +85,7 @@ namespace PdfWriter if (!IsValid()) return; - // Если параметр приближения задан некорректно, тогда оставляем его нетронутым(что соответствует значению 0) + // If zoom parameter is invalid, leave it unchanged (which corresponds to value 0) if (fZoom < 0.08 || fZoom > 32) fZoom = 0; diff --git a/PdfFile/SrcWriter/Document.cpp b/PdfFile/SrcWriter/Document.cpp index a240016f09..e2eb8bc3f3 100644 --- a/PdfFile/SrcWriter/Document.cpp +++ b/PdfFile/SrcWriter/Document.cpp @@ -180,7 +180,7 @@ namespace PdfWriter } void CDocument::Close() { - // Все объекты удаляются внутри CXref + // All objects are deleted inside CXref RELEASEOBJECT(m_pXref); m_pLastXref = NULL; @@ -257,7 +257,7 @@ namespace PdfWriter { m_pCatalog->AddMetadata(m_pXref, m_pInfo); - // Пишем заголовок + // Write header if (IsPDFA()) pStream->WriteStr(c_sPdfAHeader); else @@ -269,11 +269,11 @@ namespace PdfWriter pStream->WriteStr(sDocumentID.c_str()); } - // Добавляем в Trailer необходимые элементы + // Add required elements to Trailer m_pTrailer->Add("Root", m_pCatalog); m_pTrailer->Add("Info", m_pInfo); - // Шифруем документ, если это необходимо + // Encrypt document if necessary CEncrypt* pEncrypt = NULL; if (m_bEncrypt) { @@ -940,7 +940,7 @@ namespace PdfWriter if (!pFont) return NULL; - // 0 GID всегда используется для .notdef символа, не используем данный код для настоящих символов + // 0 GID is always used for .notdef glyph, do not use this code for real characters unsigned int unUnicode = 0; pFont->EncodeGID(0, &unUnicode, 1); @@ -1053,7 +1053,7 @@ namespace PdfWriter { if (m_pJbig2 && m_pJbig2->GetImagesCount() > 4) { - // Удалять не надо, т.к. объект удалится в CXref + // No need to delete, object will be deleted in CXref m_pJbig2->FlushStreams(); m_pJbig2 = NULL; } @@ -1091,7 +1091,7 @@ namespace PdfWriter return CreateRadialShading(pPattern[0], pPattern[1], pPattern[2], pPattern[3], pPattern[4], pPattern[5], pColors, pPoints, nCount); } - // Создаем 2 shading-объекта, один цветной RGB, второй серый со значениями альфа-канала + // Create 2 shading objects, one color RGB, second grayscale with alpha channel values CShading* pColorShading = NULL; CShading* pAlphaShading = NULL; @@ -1122,7 +1122,7 @@ namespace PdfWriter double dWidth = pPage->GetWidth(); double dHeight = pPage->GetHeight(); - // Создаем графический объект, который будет альфа-маской + // Create graphics object that will be the alpha mask CDictObject* pXObject = new CDictObject(m_pXref); pXObject->Add("Type", "XObject"); pXObject->Add("Subtype", "Form"); @@ -1142,7 +1142,7 @@ namespace PdfWriter pStream->WriteReal(dHeight); pStream->WriteStr(" re\012W\012\n\012/S1 sh\012"); - // Создаем обект-маску для графического состояние + // Create mask object for graphics state CDictObject* pMask = new CDictObject(); m_pXref->Add(pMask); pMask->Add("Type", "Mask"); @@ -1151,7 +1151,7 @@ namespace PdfWriter if (!IsPDFA()) { - // Создаем ExtGState объект, в который мы запишем альфа-маску + // Create ExtGState object where we will write the alpha mask pExtGrState = new CExtGrState(m_pXref); pExtGrState->Add("BM", "Normal"); pExtGrState->Add("ca", 1); @@ -1212,7 +1212,7 @@ namespace PdfWriter } CImageTilePattern*CDocument::CreateHatchPattern(double dW, double dH, const BYTE& nR1, const BYTE& nG1, const BYTE& nB1, const BYTE& nAlpha1, const BYTE& nR2, const BYTE& nG2, const BYTE& nB2, const BYTE& nAlpha2, const std::wstring& wsHatch) { - // TODO: Надо бы сделать мап, чтобы не создавать одинаковых паттернов + // TODO: Should create a map to avoid creating duplicate patterns CImageDict* pImage = CreateImage(); BYTE* pBuffer = new BYTE[3 * HATCH_TX_SIZE * HATCH_TX_SIZE]; @@ -1901,7 +1901,7 @@ namespace PdfWriter pXref->SetPrev(m_pLastXref); m_pLastXref = pXref; - // Вторая часть идентификатора должна обновляться + // Second part of identifier must be updated CObjectBase* pID = m_pTrailer->Get("ID"); if ((pID && pID->GetType() == object_type_ARRAY) || !m_vMetaOForms.empty()) { @@ -1931,7 +1931,7 @@ namespace PdfWriter if (m_bEncrypt) pEncrypt = m_pEncryptDict->GetEncrypt(); - // Если m_pTrailer поток перекрестных ссылок, то при дозаписи тоже должен быть поток + // If m_pTrailer is a cross-reference stream, then appending should also use a stream m_pTrailer->Remove("XRefStm"); bool bNeedStreamXRef = false; pStream->WriteChar('\n'); @@ -1967,8 +1967,8 @@ namespace PdfWriter } bool CDocument::PrepareSignature(const std::wstring& wsPath) { - // Сначала нужно сохранить основной файл - // Это должно быть сделано в AddToFile или SaveToFile ПЕРЕД вызовом этого метода + // First need to save the main file + // This should be done in AddToFile or SaveToFile BEFORE calling this method if (m_vSignatures.empty() || wsPath.empty()) return false; @@ -1978,7 +1978,7 @@ namespace PdfWriter unsigned int nSizeXRef = pSI->nSizeXRef; bool bNeedStreamXRef = pSI->bNeedStreamXRef; - // Создаем новый XRef для этой подписи + // Create new XRef for this signature CXref* pXrefBefore = m_pXref; m_pXref = new CXref(this, nSizeXRef); if (!m_pXref) @@ -1990,7 +1990,7 @@ namespace PdfWriter pSI->nPrevAddr = pXrefBefore->GetPrevAddr(); m_pXref->SetPrevAddr(pSI->nPrevAddr); - // Создаем поле подписи + // Create signature field CSignatureField* pField = CreateSignatureField(); if (!pField) { @@ -1999,7 +1999,7 @@ namespace PdfWriter return false; } - // Настраиваем поле + // Configure field pSI->pField = pField; m_pAcroForm->Add("SigFlags", 3); pField->SetDate(); @@ -2017,7 +2017,7 @@ namespace PdfWriter if (!pSI->wsLocation.empty()) pField->SetLocation(pSI->wsLocation); - // Открываем файл для дозаписи + // Open file for appending CFileStream* pStream = new CFileStream(); if (!pStream || !pStream->OpenFile(wsPath, false)) { @@ -2027,7 +2027,7 @@ namespace PdfWriter } pSI->nFileSizeBefore = pStream->Size(); - // Вычисляем размер для Contents + // Calculate size for Contents unsigned int nContentsSize = 7000 + pStream->Size() / 1000 + 1000; if (nContentsSize < 5000) nContentsSize = 5000; @@ -2035,7 +2035,7 @@ namespace PdfWriter nContentsSize = 20000; pField->GetSignatureDict()->SetContentsSize(nContentsSize); - // Записываем XRef и получаем информацию о расположении + // Write XRef and get location information CXref* pXrefCatalog = new CXref(this, m_pCatalog->GetObjId()); if (pXrefCatalog) { @@ -2067,7 +2067,7 @@ namespace PdfWriter pField->GetSignatureDict()->WriteToStream(pStream, pStream->Size()); - // Восстанавливаем XRef + // Restore XRef m_pXref = pXrefBefore; delete pStream; @@ -2085,12 +2085,12 @@ namespace PdfWriter if (wsPath.empty() || !pSI->pField) return false; - // Если подписание не удалось + // If signing failed if (!pSignedData || dwDataLength == 0) { unsigned int nFileSizeBefore = pSI->nFileSizeBefore; - // Обрезаем файл + // Truncate file NSFile::CFileBinary::Truncate(wsPath, nFileSizeBefore); CXref* pXref = pSI->pXref; @@ -2114,7 +2114,7 @@ namespace PdfWriter } } - // Продолжаем со следующей подписью + // Continue with next signature if (!m_vSignatures.empty()) { CXref* pPrev = pXref; @@ -2126,7 +2126,7 @@ namespace PdfWriter delete pSI; delete pXref; - return true; // Успешно откатили + return true; // Successfully rolled back } CFileStream* pStream = new CFileStream(); diff --git a/PdfFile/SrcWriter/Document.h b/PdfFile/SrcWriter/Document.h index 24e9fa9f84..1e0a616c5b 100644 --- a/PdfFile/SrcWriter/Document.h +++ b/PdfFile/SrcWriter/Document.h @@ -332,7 +332,7 @@ namespace PdfWriter std::vector<CExtGrState*> m_vExtGrStates; std::vector<CExtGrState*> m_vStrokeAlpha; std::vector<CExtGrState*> m_vFillAlpha; - char m_sTTFontTag[8]; // 6 символов + '+' + 0x00 ("BAAAAA+/0") + char m_sTTFontTag[8]; // 6 characters + '+' + 0x00 ("BAAAAA+/0") CJbig2Global* m_pJbig2; std::vector<CShading*> m_vShadings; std::vector<TFontInfo> m_vCidTTFonts; diff --git a/PdfFile/SrcWriter/EncryptDictionary.cpp b/PdfFile/SrcWriter/EncryptDictionary.cpp index 31341e1ef4..cd1e040fc7 100644 --- a/PdfFile/SrcWriter/EncryptDictionary.cpp +++ b/PdfFile/SrcWriter/EncryptDictionary.cpp @@ -94,7 +94,7 @@ namespace PdfWriter std::time_t oTime = time(0); hash.Update( (BYTE*)&oTime, sizeof(oTime)); - // Создаем идентификатор файла по элементам библиотеки Info. + // Create file identifier from Info library elements. if (pInfo) { const char *sTemp = NULL; @@ -243,7 +243,7 @@ namespace PdfWriter pStream->WriteEscapeName(oIter->first.c_str()); pStream->WriteChar(' '); nBegin = pStream->Tell(); - // Цифровая подпись не шифруется + // Digital signature is not encrypted pStream->Write(pObject, oIter->first == "Contents" ? NULL : pEncrypt); nEnd = pStream->Tell(); pStream->WriteStr("\012"); @@ -261,7 +261,7 @@ namespace PdfWriter } void CSignatureDict::WriteToStream(CStream* pStream, int nFileEnd) { - // Запись ByteRange + // Write ByteRange if (m_nByteRangeBegin > 0 && m_nByteRangeEnd > 0 && m_nByteRangeBegin < m_nByteRangeEnd && m_nByteRangeEnd < nFileEnd) { CArrayObject* pByteRange = new CArrayObject(); @@ -297,10 +297,10 @@ namespace PdfWriter if (!pSignedData) return false; - // Записываем подписанные данные в Contents + // Write signed data to Contents if (dwDataLength > m_nContentsSize) { - // Подпись не влезает! Ошибка расчета размера + // Signature doesn't fit! Size calculation error return false; } @@ -309,11 +309,11 @@ namespace PdfWriter if (!pContents) return false; - // Цифровая подпись не шифруется + // Digital signature is not encrypted pStream->Write(pContents, NULL); delete pContents; - // Стираем лишний '>' если нужно + // Erase extra '>' if needed BYTE cChar = '0'; pStream->Seek(pStream->Tell() - 1, EWhenceMode::SeekSet); pStream->Write(&cChar, 1); @@ -339,8 +339,8 @@ namespace PdfWriter } void CSignatureDict::SetName(const std::string& sName) { - // Name - Cтрока, Имя лица или органа, подписавшего документ. - // Значение следует использовать когда невозможно извлечь имя из подписи или сертификата подписавшего. + // Name - String, Name of the person or authority signing the document. + // This value should be used when the name cannot be extracted from the signature or signer's certificate. Add("Name", new CStringObject(sName.c_str())); } void CSignatureDict::SetLocation(const std::string& sLocation) @@ -349,19 +349,19 @@ namespace PdfWriter } void CSignatureDict::SetReason(const std::string& sReason) { - // Reason - Строка, Причина подписания, например (Я согласен) + // Reason - String, Reason for signing, for example (I agree) Add("Reason", new CStringObject(sReason.c_str())); } void CSignatureDict::SetContact(const std::string& sContacts) { - // ContactInfo - Строка, Информация, предоставленная подписывающей стороной, - // чтобы получатель мог связаться с подписывающей стороной для проверки подписи, например (номер_телефона) + // ContactInfo - String, Information provided by the signer, + // so that the recipient can contact the signer to verify the signature, for example (phone_number) Add("ContactInfo", new CStringObject(sContacts.c_str())); } void CSignatureDict::SetDate() { - // M - Дата, Время подписания - // Значение следует использовать когда время подписания недоступно в подписи + // M - Date, Time of signing + // This value should be used when the signing time is not available in the signature Add("M", new CStringObject(DateNow().c_str())); } diff --git a/PdfFile/SrcWriter/EncryptDictionary.h b/PdfFile/SrcWriter/EncryptDictionary.h index ac5b7774db..da05788a8c 100644 --- a/PdfFile/SrcWriter/EncryptDictionary.h +++ b/PdfFile/SrcWriter/EncryptDictionary.h @@ -86,13 +86,13 @@ namespace PdfWriter void SetContact(const std::string& sContacts); void SetDate(); private: - unsigned int m_nContentsSize; // Размер Contents + unsigned int m_nContentsSize; // Contents size - int m_nLen1; // Длина первого интервала - int m_nOffset2; // Начало второго интервала + int m_nLen1; // First interval length + int m_nOffset2; // Second interval start - int m_nByteRangeBegin; // Смещение начала массива ByteRange - int m_nByteRangeEnd; // Смещение конца массива ByteRange + int m_nByteRangeBegin; // ByteRange array start offset + int m_nByteRangeEnd; // ByteRange array end offset }; } #endif // _PDF_WRITER_SRC_ENCRYPT_DICTIONARY_H diff --git a/PdfFile/SrcWriter/Field.cpp b/PdfFile/SrcWriter/Field.cpp index 60edb73f0f..ad8f1ec3d8 100644 --- a/PdfFile/SrcWriter/Field.cpp +++ b/PdfFile/SrcWriter/Field.cpp @@ -585,7 +585,7 @@ namespace PdfWriter Add("BS", pBorderStyleDict); - // PDF ридеры воспринимают только целочисленные значения толщины линии + // PDF readers only accept integer line width values int nWidth = (int)(dWidth + 0.5); if (nWidth < 1) nWidth = 1; @@ -1144,7 +1144,7 @@ namespace PdfWriter return; } - // Если текст плейсхолдера не добавить как опцию, тогда AdobeAcrobat не дает выставлять такое текстовое значение + // If placeholder text is not added as an option, AdobeAcrobat does not allow setting such text value AddOption(wsText, false); sFocus = "event.target.textColor = [\"RGB\", " + @@ -1620,7 +1620,7 @@ namespace PdfWriter //---------------------------------------------------------------------------------------- CSignatureField::CSignatureField(CXref* pXref, CDocument* pDocument) : CFieldBase(pXref, pDocument) { - // Словарь сигнатур + // Signature dictionary m_pSig = new CSignatureDict(pXref); if (!m_pSig) return; @@ -3196,7 +3196,7 @@ namespace PdfWriter double dCX = dW / 2.0, dCY = dH / 2.0; double dR = std::min(dW, dH) / 2.0; - // Задний фон + // Background std::string sBG; if (!bN && nBorderType != EBorderType::Beveled) { @@ -3223,7 +3223,7 @@ namespace PdfWriter m_pStream->WriteStr("f\012Q\012"); } - // Граница + // Border if (pAnnot->HaveBC()) { if (dBorder != 1) @@ -3279,7 +3279,7 @@ namespace PdfWriter } } - // Установлен + // Set (checked) if (!bSet) return; double dShift = dBorder / 2.0; @@ -3313,7 +3313,7 @@ namespace PdfWriter if (nRotate == 90 || nRotate == 270) std::swap(dW, dH); - // Задний фон + // Background m_pStream->WriteStr("q\012"); std::string sBG; if (!bN && nBorderType != EBorderType::Beveled) @@ -3332,7 +3332,7 @@ namespace PdfWriter m_pStream->WriteStr("f\012"); } - // Граница + // Border if (pAnnot->HaveBC()) { if (nBorderType == EBorderType::Beveled || nBorderType == EBorderType::Inset) @@ -3390,7 +3390,7 @@ namespace PdfWriter m_pStream->WriteStr("s\012Q\012"); } - // Установлен + // Set (checked) if (!bSet) return; double dDiff = std::abs(dW - dH) / 2.0; diff --git a/PdfFile/SrcWriter/Field.h b/PdfFile/SrcWriter/Field.h index 2ed1990869..9e7d561351 100644 --- a/PdfFile/SrcWriter/Field.h +++ b/PdfFile/SrcWriter/Field.h @@ -334,7 +334,7 @@ namespace PdfWriter virtual CResourcesDict* GetResourcesDict(); private: - CSignatureDict* m_pSig; // Словарь сигнатур + CSignatureDict* m_pSig; // Signature dictionary CResourcesDict* m_pResources; }; diff --git a/PdfFile/SrcWriter/Font14.cpp b/PdfFile/SrcWriter/Font14.cpp index 0b7196ee53..39f75d215b 100644 --- a/PdfFile/SrcWriter/Font14.cpp +++ b/PdfFile/SrcWriter/Font14.cpp @@ -117,7 +117,7 @@ namespace PdfWriter } unsigned int CFontEmbedded::GetWidth(unsigned short ushCode) { - // Возвращаем ширину из карты + // Return width from the map auto it = m_mCodeToWidth.find(ushCode); if (it != m_mCodeToWidth.end()) return it->second; diff --git a/PdfFile/SrcWriter/Font14.h b/PdfFile/SrcWriter/Font14.h index 7efca80c43..dbbd718a97 100644 --- a/PdfFile/SrcWriter/Font14.h +++ b/PdfFile/SrcWriter/Font14.h @@ -83,7 +83,7 @@ namespace PdfWriter std::map<unsigned int, unsigned int> m_mCodeToUnicode; std::map<unsigned int, unsigned int> m_mCodeToGID; - std::map<unsigned int, unsigned int> m_mCodeToWidth; // Code -> Width в единицах em + std::map<unsigned int, unsigned int> m_mCodeToWidth; // Code -> Width in em units }; } diff --git a/PdfFile/SrcWriter/FontCidTT.cpp b/PdfFile/SrcWriter/FontCidTT.cpp index 81a989b6bc..d914fd79cc 100644 --- a/PdfFile/SrcWriter/FontCidTT.cpp +++ b/PdfFile/SrcWriter/FontCidTT.cpp @@ -54,7 +54,7 @@ namespace PdfWriter if (NULL == pOs2 || 0xFFFF == pOs2->version) return -1; - // Проверяем установлен ли 31 бит + // Check if bit 31 is set if (!(pOs2->ulCodePageRange1 & 0x80000000) && !(pOs2->ulCodePageRange1 == 0 && pOs2->ulCodePageRange2 == 0)) return -1; @@ -131,12 +131,12 @@ namespace PdfWriter pFont->Add("CIDSystemInfo", pSystemInfo); CDictObject* pFontDescriptor = new CDictObject(); - // FontDescriptor обязательно должен идти ссылкой + // FontDescriptor must be a reference m_pXref->Add(pFontDescriptor); pFontDescriptor->Add("Type", "FontDescriptor"); m_pFontDescriptor = pFontDescriptor; - // Выставляем бит Symbolic, а бит NonSymbolic убираем + // Set Symbolic bit and clear NonSymbolic bit unsigned int nFlags = 0; if (!(nFlags & 4)) UIntChangeBit(nFlags, 2); @@ -470,7 +470,7 @@ namespace PdfWriter if (m_bNeedAddFontName) { - // Дописываем имя шрифта во все необходимые словари, а также заполняем дескриптор + // Add font name to all necessary dictionaries and fill in descriptor std::string sFontName = m_pDocument->GetTTFontTag(); sFontName += (m_pFace->family_name ? std::string(m_pFace->family_name) : std::string()); if (m_pFace->style_flags & FT_STYLE_FLAG_ITALIC) @@ -538,7 +538,7 @@ namespace PdfWriter m_mGlyphs.insert(std::pair<unsigned int, bool>(unGID, true)); - // Если данный символ составной (CompositeGlyf), тогда мы должны учесть все его дочерные символы (subglyfs) + // If this character is composite (CompositeGlyf), then we must account for all its child characters (subglyfs) if (0 == FT_Load_Glyph(m_pFace, unGID, FT_LOAD_NO_SCALE | FT_LOAD_NO_RECURSE)) { if (0 != m_pFace->units_per_EM) diff --git a/PdfFile/SrcWriter/FontCidTT.h b/PdfFile/SrcWriter/FontCidTT.h index 46d15fac1b..b948f966d6 100644 --- a/PdfFile/SrcWriter/FontCidTT.h +++ b/PdfFile/SrcWriter/FontCidTT.h @@ -138,9 +138,9 @@ namespace PdfWriter CDictObject* m_pFont; CDictObject* m_pFontDescriptor; - unsigned short m_ushCodesCount; // Количество закодированных символов - std::map<unsigned int, unsigned short> m_mUnicodeToCode; // Мап Юникод->код символа - std::vector<std::vector<unsigned int>> m_vUnicodes; // Обратный мап код символа -> юникодЫ + unsigned short m_ushCodesCount; // Number of encoded characters + std::map<unsigned int, unsigned short> m_mUnicodeToCode; // Map Unicode->character code + std::vector<std::vector<unsigned int>> m_vUnicodes; // Reverse map character code -> unicodes std::vector<unsigned int> m_vCodeToGid; std::vector<unsigned int> m_vWidths; // glyph.advance diff --git a/PdfFile/SrcWriter/FontOTWriter.cpp b/PdfFile/SrcWriter/FontOTWriter.cpp index 8ac8d7e533..18582236bf 100644 --- a/PdfFile/SrcWriter/FontOTWriter.cpp +++ b/PdfFile/SrcWriter/FontOTWriter.cpp @@ -596,7 +596,7 @@ namespace PdfWriter CharSetInfoVector mCharSets;// count is NOT the same as fonts count [some charsets may be shared]. consult the top dict charset pointer for the right charset EncodingsInfoVector mEncodings; // count is NOT the same as fonts count [some encodinds may be shared]. - CMemoryStream* mPrimitivesReader; // внешний, освобождать не надо + CMemoryStream* mPrimitivesReader; // external, no need to free StringToUShort mNameToIndex; long long mNameIndexPosition; long long mTopDictIndexPosition; @@ -4397,8 +4397,8 @@ namespace PdfWriter if (subsetGlyphIDs.empty()) subsetGlyphIDs.push_back(0); - // Добавить зависимые глифы - // Они есть в m_vCodeToGid из pCodeToGID. В pUseGlyfs они тоже есть из m_mGlyphs, но только в m_mGlyphs, они имеют false + // Add dependent glyphs + // They exist in m_vCodeToGid from pCodeToGID. They also exist in pUseGlyfs from m_mGlyphs, but only in m_mGlyphs they have false mSubsetFontGlyphsCount = subsetGlyphIDs.size(); // == unCodesCount @@ -5038,7 +5038,7 @@ namespace PdfWriter { if (!m_bOpenTypeCFF) { - // Если шрифт не является OpenType CFF, завершаем + // If font is not OpenType CFF, exit return; } diff --git a/PdfFile/SrcWriter/FontTT.cpp b/PdfFile/SrcWriter/FontTT.cpp index 3dee4ff587..5ec8ee91cf 100644 --- a/PdfFile/SrcWriter/FontTT.cpp +++ b/PdfFile/SrcWriter/FontTT.cpp @@ -64,7 +64,7 @@ namespace PdfWriter Add("LastChar", 255); CDictObject* pFontDescriptor = new CDictObject(); - // FontDescriptor обязательно должен идти ссылкой + // FontDescriptor must be a reference m_pXref->Add(pFontDescriptor); pFontDescriptor->Add("Type", "FontDescriptor"); m_pFontDescriptor = pFontDescriptor; @@ -75,7 +75,7 @@ namespace PdfWriter if (m_bCanEmbed) { - // Выставляем бит Symbolic, а бит NonSymbolic убираем + // Set Symbolic bit and clear NonSymbolic bit unsigned int nFlags = 0; if (!(nFlags & 4)) UIntChangeBit(nFlags, 2); @@ -89,8 +89,8 @@ namespace PdfWriter } else { - // Ставим флаг NonSymbolic, т.к. Adobe плохо подбирает шрифт с Symbolic флагом - // TODO: Хорошо бы сделать проверку, стоит ли ставить флаг Symbolic + // Set NonSymbolic flag, because Adobe poorly selects fonts with Symbolic flag + // TODO: Should add check whether to set Symbolic flag unsigned int nFlags = 0; UIntChangeBit(nFlags, 5); pFontDescriptor->Add("Flags", nFlags); @@ -137,7 +137,7 @@ namespace PdfWriter return; } - // Дописываем имя шрифта во все необходимые словари, а также заполняем дескриптор + // Write font name to all required dictionaries and fill descriptor std::string sFontName = pFace->family_name ? std::string(pFace->family_name) : std::string(); if (pFace->style_flags & FT_STYLE_FLAG_ITALIC) sFontName += "-Italic"; @@ -200,8 +200,8 @@ namespace PdfWriter m_pFontDescriptor->Add("StemV", 80); m_pFontDescriptor->Add("FontWeight", m_pFontFile ? m_pFontFile->GetWeight() : 400); - // Сейчас мы этот класс используем для внедрения шрифтов, которые будут использоваться для заполнения - // внутри форм. Если класс будет использоваться для чего-то другого, тогда надо задавать ограничения на внедрение + // Currently this class is used for embedding fonts that will be used for filling + // within forms. If the class is used for something else, embedding restrictions need to be set FT_UShort fsType = FT_Get_FSType_Flags(pFace); m_bCanEmbed = NSFonts::CFontInfo::CanEmbedForEdit(fsType); diff --git a/PdfFile/SrcWriter/FontTTWriter.cpp b/PdfFile/SrcWriter/FontTTWriter.cpp index e4c263a610..c93b620460 100644 --- a/PdfFile/SrcWriter/FontTTWriter.cpp +++ b/PdfFile/SrcWriter/FontTTWriter.cpp @@ -374,14 +374,14 @@ namespace PdfWriter unsigned int t; int nPos = 0, i, j, k, n; - // Записываем OpenType шрифт не меняя его + // Write OpenType font without modifying it if (m_bOpenTypeCFF) { WriteCIDFontType0C(pOutputStream, pCodeToGID, unCodesCount); return; } - // Проверяем недостающие таблицы + // Check for missing tables bool bMissingCmap = (nCmapIndex = SeekTable("cmap")) < 0; bool bMissingName = SeekTable("name") < 0; bool bMissingPost = SeekTable("post") < 0; @@ -407,8 +407,8 @@ namespace PdfWriter { bUnsortedLoca = true; } - // Описание глифа должны быть как минимум 12 байт (nContours, - // xMin, yMin, xMax, yMax, instructionLength - каждый по 2 байта); + // Glyph description must be at least 12 bytes (nContours, + // xMin, yMin, xMax, yMax, instructionLength - 2 bytes each); if (i > 0 && pLocaTable[i].nOrigOffset - pLocaTable[i - 1].nOrigOffset > 0 && pLocaTable[i].nOrigOffset - pLocaTable[i - 1].nOrigOffset < 12) { pLocaTable[i - 1].nOrigOffset = pLocaTable[i].nOrigOffset; @@ -417,7 +417,7 @@ namespace PdfWriter pLocaTable[i].nIndex = i; } - // Проверяем наличие нулевых таблиц + // Check for zero-length tables nZeroLengthTables = 0; for (i = 0; i < m_nTablesCount; ++i) { @@ -425,7 +425,7 @@ namespace PdfWriter ++nZeroLengthTables; } - // Проверяем длину таблицы Cmap + // Check Cmap table length badCmapLen = false; nCmapLen = 0; if (!bMissingCmap) @@ -445,12 +445,12 @@ namespace PdfWriter } } - // Проверяем, является ли таблица 'hmtx' сокращенной. + // Check if 'hmtx' table is abbreviated. i = SeekTable("hhea"); nHMetrics = GetU16BE(m_pTables[i].nOffset + 34, &bSuccess); abbrevHMTX = nHMetrics < m_nGlyphs; - // Если все впорядке, и нам не надо переписывать таблицы 'cmap' и 'name', тогда пишем файл TTF как он есть + // If everything is fine and we don't need to rewrite 'cmap' and 'name' tables, write TTF file as is if (!bMissingCmap && !bMissingName && !bMissingPost && !bMissingOS2 && !bUnsortedLoca && !badCmapLen && !abbrevHMTX && nZeroLengthTables == 0 && !sName && !pCodeToGID) { pOutputStream->Write((BYTE *)m_sFile, m_nLen); @@ -458,12 +458,12 @@ namespace PdfWriter return; } - // Сортируем таблицу 'loca': некоторые шрифты содержат неупорядоченную - // таблицу 'loca'; а некоторые шрифты с нормальной таблицей 'loca' - // содержат пустые элементы в середине таблицы, cmpTrueTypeLocaOffset - // использует сдвиги как основной ключ для сортировки, а номера глифов - // как второй ключ (чтобы элементы в таблице, которые имели одинаковую позицию - // шли в том же порядке, как и в исходном шрифте) + // Sort 'loca' table: some fonts contain unsorted 'loca' table; + // and some fonts with normal 'loca' table contain empty elements + // in the middle of the table, cmpTrueTypeLocaOffset uses offsets + // as primary sort key, and glyph numbers as secondary key + // (so that elements with the same position go in the same order + // as in the original font) nGlyphLen = 0; if (bUnsortedLoca || pUseGlyfs) { @@ -478,7 +478,7 @@ namespace PdfWriter for (i = 0; i <= m_nGlyphs; ++i) { - // TO DO: Протестировать тут запись только тех глифов, которые нам нужны + // TO DO: Test writing only the glyphs that we need here if (pUseGlyfs && lGlyfsCount == m_nGlyphs) { @@ -510,7 +510,7 @@ namespace PdfWriter nGlyphLen = nPos; } - // Вычисляем чексуммы таблиц 'loca' и 'glyf' + // Calculate checksums for 'loca' and 'glyf' tables nLocaChecksum = nGlyphChecksum = 0; if (bUnsortedLoca || pUseGlyfs) { @@ -547,7 +547,7 @@ namespace PdfWriter } } - // Строим новую таблицу 'name' + // Build new 'name' table if (sName) { n = strlen(sName); @@ -597,7 +597,7 @@ namespace PdfWriter arrNewNameTable = NULL; } - // Строим новую таблицу 'cmap' + // Build new 'cmap' table if (pCodeToGID) { unsigned short ushSubTableLen = 10 + unCodesCount * 2; @@ -607,9 +607,9 @@ namespace PdfWriter arrNewCmapTable[1] = 0; // arrNewCmapTable[2] = 0; // number of encoding tables = 1 arrNewCmapTable[3] = 1; // - arrNewCmapTable[4] = 0; // platform ID = 1 (MacOS) // Эти два поля обязательно должны - arrNewCmapTable[5] = 1; // // иметь таки значения, иначе, Adobe - arrNewCmapTable[6] = 0; // encoding ID = 0 // Acrobat может открыть данный шрифт. + arrNewCmapTable[4] = 0; // platform ID = 1 (MacOS) // These two fields must have + arrNewCmapTable[5] = 1; // // these values, otherwise Adobe + arrNewCmapTable[6] = 0; // encoding ID = 0 // Acrobat cannot open this font. arrNewCmapTable[7] = 0; // arrNewCmapTable[8] = 0; // offset of subtable arrNewCmapTable[9] = 0; // @@ -638,7 +638,7 @@ namespace PdfWriter arrNewCmapTable = NULL; } - // Генерируем новую таблицу 'hmtx' и обновляем таблицу 'hhea' + // Generate new 'hmtx' table and update 'hhea' table if (abbrevHMTX) { i = SeekTable("hhea"); @@ -682,13 +682,13 @@ namespace PdfWriter nNewHHEALen = nNewHMTXLen = 0; } - // Создаем список таблиц: - // - сохраняем исходные ненулевые таблицы - // - переписываем длину таблицы 'cmap', если необходимо - // - добавляем недостающие таблицы - // - сортируем таблицы по тэгам - // - вычисляем новые позиции таблиц, с учетом 4-байтового выравнивания - // - пересчитываем чексуммы таблиц + // Create table list: + // - keep original non-zero tables + // - rewrite 'cmap' table length if necessary + // - add missing tables + // - sort tables by tags + // - calculate new table positions with 4-byte alignment + // - recalculate table checksums nNewTables = m_nTablesCount - nZeroLengthTables + (bMissingCmap ? 1 : 0) + (bMissingName ? 1 : 0) + (bMissingPost ? 1 : 0) + (bMissingOS2 ? 1 : 0); pNewTables = (TrueTypeTable *)malloc(nNewTables * sizeof(TrueTypeTable)); j = 0; @@ -832,7 +832,7 @@ namespace PdfWriter } } - // Записываем информацию о таблицах в файле + // Write table information to file arrTableDir = (char *)malloc(12 + nNewReqTables * 16); arrTableDir[0] = 0x00; // sfnt version arrTableDir[1] = 0x01; // @@ -875,7 +875,7 @@ namespace PdfWriter } pOutputStream->Write((BYTE*)arrTableDir, 12 + nNewReqTables * 16); - // Вычисляем чексумму файла + // Calculate file checksum nFileChecksum = ComputeTableChecksum((unsigned char *)arrTableDir, 12 + nNewReqTables * 16); for (i = 0; i < nNewTables; ++i) { @@ -886,7 +886,7 @@ namespace PdfWriter } nFileChecksum = 0xb1b0afba - nFileChecksum; - // Записываем сами таблицы + // Write the tables themselves for (i = 0; i < nNewTables; ++i) { if (1 == pUseTable[i]) @@ -1010,7 +1010,7 @@ namespace PdfWriter if (!m_bOpenTypeCFF || SeekTable("CFF ") < 0) return; - // Open Type Font записываем так как он есть, не изменяя его + // Write Open Type Font as is, without modifying it pOutputStream->Write((BYTE*)m_sFile, m_nLen); return; @@ -1071,7 +1071,7 @@ namespace PdfWriter m_bSuccess = true; - // Проверяем является ли данный файл (TTC) + // Check if this file is a TTC collection unsigned int unTopTag = GetU32BE(0, &m_bSuccess); if (!m_bSuccess) return; @@ -1088,12 +1088,12 @@ namespace PdfWriter else nPos = 0; - // Проверяем sfnt версию + // Check sfnt version int nSfntVersion = GetU32BE(nPos, &m_bSuccess); if (!m_bSuccess) return; - // Проверяем на формат данных. CCF или нет? + // Check data format. CFF or not? m_bOpenTypeCFF = (nSfntVersion == 0x4f54544f); // 'OTTO' m_nTablesCount = GetU16BE(nPos + 4, &m_bSuccess); @@ -1116,14 +1116,14 @@ namespace PdfWriter if (!m_bSuccess) return; - // ищем таблицы необходимые как и для TrueType так и для Type 42 + // Look for tables required for both TrueType and Type 42 if (SeekTable("head") < 0 || SeekTable("hhea") < 0 || SeekTable("maxp") < 0 || SeekTable("hmtx") < 0 || (!m_bOpenTypeCFF && SeekTable("loca") < 0) || (!m_bOpenTypeCFF && SeekTable("glyf") < 0) || (m_bOpenTypeCFF && SeekTable("CFF ") < 0)) { m_bSuccess = false; return; } - // читаем таблицы CMaps + // Read CMaps tables if ((nIndex = SeekTable("cmap")) >= 0) { nPos = m_pTables[nIndex].nOffset + 2; @@ -1164,7 +1164,7 @@ namespace PdfWriter if (!m_bSuccess) return; - // Проверяем корректность таблицы loca + // Check loca table correctness if (!m_bOpenTypeCFF) { nIndex = SeekTable("loca"); diff --git a/PdfFile/SrcWriter/FontTTWriter.h b/PdfFile/SrcWriter/FontTTWriter.h index 86f5081e24..77594b3923 100644 --- a/PdfFile/SrcWriter/FontTTWriter.h +++ b/PdfFile/SrcWriter/FontTTWriter.h @@ -94,10 +94,10 @@ namespace PdfWriter static CFontFileTrueType *LoadFromFile(const std::wstring& wsFileName, unsigned int unIndex); ~CFontFileTrueType(); - // Записываем TrueTypeFont File, заполняя недостающие таблицы и корректируя - // различные ошибки. Если задан парметр <sName>, в шрифте переписываем таблицу - // 'name'. Если задан парамтре <pCodeToGID>, тогда в шрифте переписываем - // таблицу 'cmap'. + // Write TrueTypeFont File, filling in missing tables and correcting + // various errors. If <sName> parameter is specified, the 'name' table + // is rewritten in the font. If <pCodeToGID> parameter is specified, + // the 'cmap' table is rewritten in the font. void WriteTTF(CStream* pOutputStream, char *sName = NULL, unsigned short *pCodeToGID = NULL, unsigned int unCodesCount = 0, unsigned char *pUseGlyfs = NULL, long lGlyfsCount = 0); void WriteOTF(CStream* pOutputStream, char *sName = NULL, unsigned short *pCodeToGID = NULL); void WriteCIDFontType0C(CStream* pOutputStream, unsigned short* pCodeToGID = NULL, unsigned int unCodesCount = 0); diff --git a/PdfFile/SrcWriter/GState.h b/PdfFile/SrcWriter/GState.h index 0f5d9f4345..c29c4ba459 100644 --- a/PdfFile/SrcWriter/GState.h +++ b/PdfFile/SrcWriter/GState.h @@ -35,7 +35,7 @@ #include "Types.h" #include "Objects.h" -// Стандартные значения для Graphic State +// Default values for Graphic State #define DEF_FONT "Helvetica" #define DEF_WORDSPACE 0 #define DEF_CHARSPACE 0 diff --git a/PdfFile/SrcWriter/Info.h b/PdfFile/SrcWriter/Info.h index d0aad92442..5491a2cc2f 100644 --- a/PdfFile/SrcWriter/Info.h +++ b/PdfFile/SrcWriter/Info.h @@ -38,11 +38,11 @@ namespace PdfWriter { enum EInfoType { - // Данные относительно даты создания и изменения. + // Data related to creation and modification dates. InfoCreationDate = 0, InfoModaDate = 1, - // Текстовые данные + // Text data InfoAuthor = 2, InfoCreator = 3, InfoProducer = 4, diff --git a/PdfFile/SrcWriter/Objects.cpp b/PdfFile/SrcWriter/Objects.cpp index 0c0928c93c..7ad798bd25 100644 --- a/PdfFile/SrcWriter/Objects.cpp +++ b/PdfFile/SrcWriter/Objects.cpp @@ -37,14 +37,14 @@ #include "Document.h" #include "EncryptDictionary.h" -// Если установлен бит OTYPE_DIRECT, значит данный объект принадлежит другому -// объекту. Если установлен бит OTYPE_INDIRECT, значит объект управляется таблицей xref. +// If OTYPE_DIRECT bit is set, the object belongs to another object. +// If OTYPE_INDIRECT bit is set, the object is managed by the xref table. #define FLAG_NONE 0x0 #define FLAG_HIDDEN 0x1 #define FLAG_INDIRECT 0x4 #define FLAG_DIRECT 0x8 -//------ Значения относящиеся к объекту xref ------------------------------------ +//------ Values related to xref object ------------------------------------ #define FREE_ENTRY 'f' #define IN_USE_ENTRY 'n' @@ -297,7 +297,7 @@ namespace PdfWriter if (!pObject) return; - // Не даем писать сложные объекты в массив не по ссылке + // Do not allow writing complex objects to array without reference if (pObject->IsDirect()) return; @@ -390,9 +390,9 @@ namespace PdfWriter pObject->SetDirect(); - //получаем target-object из списка - //рассмотреть случай, когда указатель на содержимое списка - //может быть proxy-object. + //get target-object from list + //consider case when pointer to list contents + //may be proxy-object. for (int nIndex = 0, nCount = m_arrList.size(); nIndex < nCount; nIndex++) { @@ -409,7 +409,7 @@ namespace PdfWriter } } - // Дошли до сюда, значит не вставили данный объект, поэтому удаляем его + // Reached here, meaning we did not insert this object, so delete it RELEASE_OBJECT(pObject); } CObjectBase* CArrayObject::Get(unsigned int unIndex, bool bCheckProxy) const @@ -532,22 +532,22 @@ namespace PdfWriter AddToObject(new CStringObject(sAText.c_str())) else if (sType == "Name") AddToObject(sAText.c_str()) - // Null ниже - // Array ниже - // Dict ниже - // Stream игнорируется + // Null below + // Array below + // Dict below + // Stream is ignored else if (sType == "Ref") { CObjectBase* pBase = new CObjectBase(); pBase->SetRef(std::stoi(sAText), gen); AddToObject(new CProxyObject(pBase, true)); } - // Cmd игнорируется + // Cmd is ignored else if (sType == "Cmd") AddToObject(sAText.c_str()) - // Error игнорируется - // EOF игнорируется - // None ниже + // Error is ignored + // EOF is ignored + // None below else if (sType == "Binary") gen = std::stoi(sAText); } @@ -615,7 +615,7 @@ namespace PdfWriter CNumberObject* pLength = new CNumberObject(0); - // Только stream object добавляются в таблицу xref автоматически + // Only stream objects are added to xref table automatically pXref->Add((CObjectBase*)this); pXref->Add((CObjectBase*)pLength); @@ -662,7 +662,7 @@ namespace PdfWriter return; } - // Удаляем старую запись, если она была + // Remove old entry if it existed Remove(sKey); if (pObject->IsIndirect()) @@ -732,7 +732,7 @@ namespace PdfWriter if (pObject->IsHidden()) { - // ничего не делаем + // do nothing } else { @@ -756,7 +756,7 @@ namespace PdfWriter { CNumberObject* pLength = new CNumberObject(0); - // Только stream object добавляются в таблицу xref автоматически + // Only stream objects are added to xref table automatically if (bThis) pXref->Add((CObjectBase*)this); pXref->Add((CObjectBase*)pLength); @@ -823,8 +823,8 @@ namespace PdfWriter if (0 == m_unStartOffset) { - // Добавляем первый элемент в таблицу xref - // он должен иметь вид 0000000000 65535 f + // Add first element to xref table + // it should have the form 0000000000 65535 f TXrefEntry* pEntry = new TXrefEntry; pEntry->nEntryType = FREE_ENTRY; pEntry->unByteOffset = 0; @@ -843,8 +843,8 @@ namespace PdfWriter m_pPrev = NULL; m_pTrailer = NULL; - // Добавляем удаляемый элемент в таблицу xref - // он должен иметь вид 0000000000 gen+1 f + // Add the element to be removed to xref table + // it should have the form 0000000000 gen+1 f TXrefEntry* pEntry = new TXrefEntry; pEntry->nEntryType = FREE_ENTRY; pEntry->unByteOffset = 0; @@ -934,7 +934,7 @@ namespace PdfWriter return; } - // В случае ошибки r объектe нужно применить dispose + // In case of error, dispose should be applied to the object TXrefEntry* pEntry = new TXrefEntry; if (NULL == pEntry) { @@ -965,7 +965,7 @@ namespace PdfWriter return; } - // В случае ошибки r объектe нужно применить dispose + // In case of error, dispose should be applied to the object TXrefEntry* pEntry = new TXrefEntry; if (NULL == pEntry) { @@ -1114,7 +1114,7 @@ namespace PdfWriter pTrailer->Add("Filter", "FlateDecode"); #endif - // Сортируем pXref, Index должен быть в порядке возрастания + // Sort pXref, Index must be in ascending order pXref = this; CXref* q, *p, *pr, *out = NULL; while (pXref) @@ -1134,7 +1134,7 @@ namespace PdfWriter } } - // Записываем поток + // Write stream pXref = out; pXref->m_unAddr = nStreamOffset; CStream* pTrailerStream = new CMemoryStream(); @@ -1171,7 +1171,7 @@ namespace PdfWriter pXref = pXref->m_pPrev; } - // Добавляем последний элемент + // Add last element pIndex->Add(unEntries); pIndex->Add(unEntriesSize); pTrailerStream->WriteChar('\001'); @@ -1180,7 +1180,7 @@ namespace PdfWriter pTrailerStream->WriteChar('\000'); pTrailerStream->WriteChar('\000'); - // Фильтруем поток, pEncrypt = NULL поток перекрестных ссылок не шифруется + // Filter stream, pEncrypt = NULL - cross-reference stream is not encrypted CStream* pFlateStream = new CMemoryStream(); pFlateStream->WriteStream(pTrailerStream, pTrailer->GetFilter(), NULL); pLength->Set(pFlateStream->Size()); @@ -1191,7 +1191,7 @@ namespace PdfWriter pBuf = ItoA(pBuf, 0, pEndPtr); StrCpy(pBuf, " obj\012", pEndPtr); - // Записываем cross-reference table + // Write cross-reference table pStream->WriteStr(sBuf); pTrailer->WriteValue(pStream, NULL); pStream->WriteStr("\012stream\015\012"); @@ -1205,7 +1205,7 @@ namespace PdfWriter return; } - // Записываем cross-reference table + // Write cross-reference table pXref = this; pXref->m_unAddr = pStream->Tell(); pStream->WriteStr("xref\012"); @@ -1236,7 +1236,7 @@ namespace PdfWriter pXref = pXref->m_pPrev; } - // Записываем Trailer + // Write Trailer WriteTrailer(pStream); } bool CXref::IsPDFA() const diff --git a/PdfFile/SrcWriter/Pages.cpp b/PdfFile/SrcWriter/Pages.cpp index 29a734704c..ae081ad6ba 100644 --- a/PdfFile/SrcWriter/Pages.cpp +++ b/PdfFile/SrcWriter/Pages.cpp @@ -127,14 +127,14 @@ namespace PdfWriter } static double AngToEllPrm(double dAngle, double dXRad, double dYRad) { - // Функция для перевода реального угла в параметрическое задание эллписа - // т.е. x= a cos(t) y = b sin(t) - параметрическое задание эллписа. + // Function to convert real angle to parametric ellipse representation + // i.e. x= a cos(t) y = b sin(t) - parametric ellipse representation. // x = r cos(p), y = r sin(p) => t = atan2( sin(p) / b, cos(p) / a ); return atan2(sin(dAngle) / dYRad, cos(dAngle) / dXRad); } static void WriteEllipseArc(CStream* pStream, double dX, double dY, double dXRad, double dYRad, double dAngle1, double dAngle2, double& dXCur, double& dYCur, bool bClockDirection = false) { - // Рассчитаем начальную, конечную и контрольные точки + // Calculate start, end and control points double dX1 = 0.0, dX2 = 0.0, dY1 = 0.0, dY2 = 0.0; double dCX1 = 0.0, dCX2 = 0.0, dCY1 = 0.0, dCY2 = 0.0; @@ -207,7 +207,7 @@ namespace PdfWriter } void CPageTree::Fix() { - // Инициализация текущего m_pPages + // Initialize current m_pPages CObjectBase* pPages = Get("Kids"); if (pPages && pPages->GetType() == object_type_ARRAY) m_pPages = (CArrayObject*)pPages; @@ -217,7 +217,7 @@ namespace PdfWriter Add("Kids", m_pPages); } - // Инициализация текущего m_pCount + // Initialize current m_pCount CObjectBase* pCount = Get("Count"); if (pCount && pCount->GetType() == object_type_NUMBER) m_pCount = (CNumberObject*)pCount; @@ -392,7 +392,7 @@ namespace PdfWriter } void CPage::Fix() { - // Инициализация текущего contents + // Initialize current contents CObjectBase* pContents = Get("Contents"); if (pContents) { @@ -419,7 +419,7 @@ namespace PdfWriter Add("Contents", m_pContents); } - // Инициализация текущего MediaBox + // Initialize current MediaBox CObjectBase* pMediaBox = Get("MediaBox"); if (pMediaBox && pMediaBox->GetType() == object_type_ARRAY) { @@ -454,7 +454,7 @@ namespace PdfWriter else Add("MediaBox", CArrayObject::CreateBox(0, 0, DEF_PAGE_WIDTH, DEF_PAGE_HEIGHT)); - // Инициализация текущего Rotate + // Initialize current Rotate CObjectBase* pRotate = GetRotateItem(); if (pRotate && pRotate->GetType() == object_type_NUMBER) Add("Rotate", ((CNumberObject*)pRotate)->Get() % 360); @@ -464,7 +464,7 @@ namespace PdfWriter { pResources->Fix(); - // Инициализация текущего Shading + // Initialize current Shading CObjectBase* pShading = pResources->Get("Shading"); if (pShading && pShading->GetType() == object_type_DICT) { @@ -472,7 +472,7 @@ namespace PdfWriter m_unShadingsCount = m_pShadings->GetSize(); } - // Инициализация текущего Pattern + // Initialize current Pattern CObjectBase* pPattern = pResources->Get("Pattern"); if (pPattern && pPattern->GetType() == object_type_DICT) { @@ -589,7 +589,7 @@ namespace PdfWriter { CObjectBase* pObject = Get("Resources"); - // Если объект Resources нулевой, тогда ищем Resources у родительского объекта рекурсивно + // If Resources object is null, search for Resources in parent object recursively if (!pObject) { CPageTree* pPageTree = NULL; @@ -641,16 +641,16 @@ namespace PdfWriter void CPage::SetGrMode(EGrMode eMode) { m_eGrMode = eMode; - // TODO: Сделать проверку плохих ситуаций + // TODO: Add validation for error cases } void CPage::CheckGrMode(EGrMode eMode) { - // TODO: Сделать проверку плохих ситуаций + // TODO: Add validation for error cases } void CPage::MoveTo (double dX, double dY) { // Operator : m - // Description: Начинаем новый subpath, передвигая текущий указатель в точку (x, y)(она же стартовая). + // Description: Begin a new subpath, moving the current pointer to point (x, y) (which is also the start point). SetGrMode(grmode_PATH); m_pStream->WriteReal(dX); @@ -664,7 +664,7 @@ namespace PdfWriter void CPage::LineTo (double dX, double dY) { // Operator : l - // Description: Добавляем линию от текущей точки до точки (x, y). Текущую точку выставляем (х, у). + // Description: Add a line from current point to point (x, y). Set current point to (x, y). CheckGrMode(grmode_PATH); m_pStream->WriteReal(dX); @@ -677,9 +677,9 @@ namespace PdfWriter void CPage::CurveTo(double dX1, double dY1, double dX2, double dY2, double dX3, double dY3) { // Operator : c - // Description: Добавляем кривую Безье(кубическую). Начинается кривая в текущей позиции, заканчивается - // в точке (x3, y3). (x1, y1) и (x2, y2) - контрольные точки. Текущую точку устанавливаем - // в (х3, у3). + // Description: Add a cubic Bezier curve. The curve starts at current position and ends + // at point (x3, y3). (x1, y1) and (x2, y2) are control points. Set current point + // to (x3, y3). CheckGrMode(grmode_PATH); m_pStream->WriteReal(dX1); @@ -718,18 +718,18 @@ namespace PdfWriter { CheckGrMode(grmode_PATH); - // переведем углы в радианы + // Convert angles to radians double dAngle1 = _dAngle1 * 3.141592f / 180; double dAngle2 = _dAngle2 * 3.141592f / 180; - // Выясним в каких четвертях находятся начальная и конечная точки + // Determine which quadrants contain the start and end points int nFirstPointQuard = int(_dAngle1) / 90 + 1; int nSecondPointQuard = int(_dAngle2) / 90 + 1; nSecondPointQuard = std::min(4, std::max(1, nSecondPointQuard)); nFirstPointQuard = std::min(4, std::max(1, nFirstPointQuard)); - // Проведем линию в начальную точку дуги + // Draw line to arc start point double dStartX = 0.0, dStartY = 0.0, dEndX = 0.0, dEndY = 0.0; dStartX = dX + dXRad * cos(AngToEllPrm(dAngle1, dXRad, dYRad)); @@ -740,7 +740,7 @@ namespace PdfWriter //m_pStream->WriteReal(dStartY); //m_pStream->WriteStr(" m\012"); - // Дальше рисуем по четверям + // Continue drawing by quadrants double dCurX = dStartX, dCurY = dStartY; double dStartAngle = dAngle1; double dEndAngle = 0; @@ -781,7 +781,7 @@ namespace PdfWriter } void CPage::EllipseArcTo(double dX, double dY, double dXRad, double dYRad, double _dAngle1, double _dAngle2, bool bClockDirection) { - // Проверяем эллипс на невырожденность + // Check ellipse for degeneracy if (dXRad < 0.001 || dYRad < 0.001) { double dAngle1 = _dAngle1 * 3.141592f / 180; @@ -839,8 +839,8 @@ namespace PdfWriter void CPage::ClosePath() { // Operator : h - // Description: Закрываем subpath, соединяя текущую точку с начальной прямой линией. Если subpath - // уже закрыт, тогда ничего не делаем + // Description: Close subpath by connecting current point to start point with a straight line. If subpath + // is already closed, do nothing CheckGrMode(grmode_PATH); m_pStream->WriteStr("h\012"); m_oCurPos = m_oStartPos; @@ -848,7 +848,7 @@ namespace PdfWriter void CPage::Stroke() { // Operator : S - // Description: Обводим path. + // Description: Stroke the path. SetGrMode(grmode_PAGE); m_pStream->WriteStr("S\012"); @@ -857,8 +857,8 @@ namespace PdfWriter void CPage::Fill() { // Operator : f - // Description: Заливка path по правилу Nonzero Winding Number Rule(см. спецификацию PDF Part1: PDF 1.7 - // стр. 136, закладка 8.5.3.3.2). + // Description: Fill path using Nonzero Winding Number Rule (see PDF Part1: PDF 1.7 specification + // page 136, section 8.5.3.3.2). SetGrMode(grmode_PAGE); m_pStream->WriteStr("f\012"); m_oCurPos.Reset(); @@ -866,8 +866,8 @@ namespace PdfWriter void CPage::EoFill() { // Operator : f* - // Description: Заливка path по правилу Even-Odd Rule(см. спецификацию PDF Part1: PDF 1.7 стр. 137, - // закладка 8.5.3.3.3). + // Description: Fill path using Even-Odd Rule (see PDF Part1: PDF 1.7 specification page 137, + // section 8.5.3.3.3). SetGrMode(grmode_PAGE); m_pStream->WriteStr("f*\012"); m_oCurPos.Reset(); @@ -875,10 +875,10 @@ namespace PdfWriter void CPage::FillStroke() { // Operator : B - // Description: Заливка и обоводка path, используя правило для заливки Nonzero Winding Number Rule(см. - // спецификацию PDF Part1: PDF 1.7 стр. 136, закладка 8.5.3.3.2). Этот оператор должен - // привести к тому же самому результату как строительство двух идентичных объектов path, - // применяя к первому оператор f и ко второму - S. + // Description: Fill and stroke path using Nonzero Winding Number Rule for fill (see PDF Part1: PDF 1.7 + // specification page 136, section 8.5.3.3.2). This operator should produce the same result + // as constructing two identical path objects, applying operator f to the first + // and operator S to the second. SetGrMode(grmode_PAGE); m_pStream->WriteStr("B\012"); m_oCurPos.Reset(); @@ -886,10 +886,10 @@ namespace PdfWriter void CPage::EoFillStroke() { // Operator : B* - // Description: Заливка и обоводка path, используя правило для заливки Even-Odd Rule(см. - // спецификацию PDF Part1: PDF 1.7 стр. 137, закладка 8.5.3.3.3). Этот оператор должен - // привести к тому же самому результату как строительство двух идентичных объектов path, - // применяя к первому оператор f* и ко второму - S. + // Description: Fill and stroke path using Even-Odd Rule for fill (see PDF Part1: PDF 1.7 + // specification page 137, section 8.5.3.3.3). This operator should produce the same result + // as constructing two identical path objects, applying operator f* to the first + // and operator S to the second. SetGrMode(grmode_PAGE); m_pStream->WriteStr("B*\012"); m_oCurPos.Reset(); @@ -897,16 +897,16 @@ namespace PdfWriter void CPage::EndPath() { // Operator : n - // Description: Закрываем path, не заливая и не обводя его. Этот оператор используется прежде всего для - // изменения текущего path. + // Description: Close path without filling or stroking it. This operator is primarily used for + // modifying the current path. SetGrMode(grmode_PAGE); m_pStream->WriteStr("n\012"); m_oCurPos.Reset(); } void CPage::SetLineWidth(double dLineWidth) { - // Operator : w - // Descriprion: устанавливаем толщину линии + // Operator : w + // Description: Set line width dLineWidth = std::max(dLineWidth, 0.0); m_pStream->WriteReal(dLineWidth); @@ -915,8 +915,8 @@ namespace PdfWriter } void CPage::SetLineCap(ELineCapStyle eLineCap) { - // Operator : J - // Descriprion: устанавливаем вид окончания линии (LineCapStyle) + // Operator : J + // Description: Set line cap style (LineCapStyle) eLineCap = std::max(linecap_Min, std::min(linecap_Max, eLineCap)); m_pStream->WriteInt((unsigned int)eLineCap); @@ -926,7 +926,7 @@ namespace PdfWriter void CPage::SetLineJoin(ELineJoinStyle eLineJoin) { // Operator : j - // Descriprion: устанавливаем вид соединения линий (LineJoinStyle) + // Description: Set line join style (LineJoinStyle) eLineJoin = std::max(linejoin_Min, std::min(linejoin_Max, eLineJoin)); m_pStream->WriteInt((unsigned int)eLineJoin); m_pStream->WriteStr(" j\012"); @@ -935,7 +935,7 @@ namespace PdfWriter void CPage::SetMiterLimit(double dMiterLimit) { // Operator : M - // Descriprion: устанавливаем MiterLimit - константа, относящаяся к виду соединения линий + // Description: Set MiterLimit - constant related to line join style dMiterLimit = std::max(1.0, dMiterLimit); m_pStream->WriteReal(dMiterLimit); m_pStream->WriteStr(" M\012"); @@ -944,7 +944,7 @@ namespace PdfWriter void CPage::SetDash(const double* pPattern, unsigned int unCount, double dPhase) { // Operator : d - // Descriprion: устанавливаем вид линий (DashMode) + // Description: Set line dash pattern (DashMode) if (0 == unCount || !pPattern) return; @@ -977,7 +977,7 @@ namespace PdfWriter void CPage::SetFlat(double dFlatness) { // Operator : i - // Descriprion: устанавливаем порог ошибки линии (Flatness tolerance) + // Description: Set flatness tolerance dFlatness = std::min(100.0, std::max(0.0, dFlatness)); m_pStream->WriteReal(dFlatness); m_pStream->WriteStr(" i\012"); @@ -986,7 +986,7 @@ namespace PdfWriter void CPage::GrSave() { // Operator : q - // Description: сохраняем текущий GState в графическом стеке + // Description: Save current GState to graphics stack CheckGrMode(grmode_PAGE); CGrState* pState = new CGrState(m_pGrState); if (!pState) @@ -998,7 +998,7 @@ namespace PdfWriter void CPage::GrRestore() { // Operator : Q - // Description: Восстанавливаем GState, удаляя самый последний GState, и делаем данный GState текущим + // Description: Restore GState by removing the most recent GState and making it current CheckGrMode(grmode_PAGE); if (!m_pGrState->m_pPrev) @@ -1013,8 +1013,8 @@ namespace PdfWriter void CPage::SetStrokeColor(unsigned char unR, unsigned char unG, unsigned char unB) { // Operator : RG - // Description: Устанавливаем цветовое пространтсво для обводки в DeviceRGB и устанавливаем цвет для - // операций связанных с обведением фигур. + // Description: Set color space for stroking to DeviceRGB and set color for + // stroking operations. double dR = unR / 255.0; double dG = unG / 255.0; @@ -1029,8 +1029,8 @@ namespace PdfWriter void CPage::SetFillColor(unsigned char unR, unsigned char unG, unsigned char unB) { // Operator : rg - // Description: Устанавливаем цветовое пространтсво для заливки в DeviceRGB и устанавливаем цвет для - // операций связанных с заливкой фигур. + // Description: Set color space for filling to DeviceRGB and set color for + // fill operations. double dR = unR / 255.0; double dG = unG / 255.0; @@ -1045,7 +1045,7 @@ namespace PdfWriter void CPage::SetStrokeG(double dG) { // Operator : G - // Description: Заливка в DeviceG + // Description: Stroke in DeviceGray m_pStream->WriteReal(dG); m_pStream->WriteStr(" G\012"); @@ -1053,7 +1053,7 @@ namespace PdfWriter void CPage::SetStrokeRGB(double dR, double dG, double dB) { // Operator : RG - // Description: Обводка в DeviceRGB + // Description: Stroke in DeviceRGB m_pStream->WriteReal(dR); m_pStream->WriteChar(' '); @@ -1065,7 +1065,7 @@ namespace PdfWriter void CPage::SetStrokeCMYK(double dC, double dM, double dY, double dK) { // Operator : K - // Description: Обводка в DeviceCMYK + // Description: Stroke in DeviceCMYK m_pStream->WriteReal(dC); m_pStream->WriteChar(' '); @@ -1079,7 +1079,7 @@ namespace PdfWriter void CPage::SetFillG(double dG) { // Operator : g - // Description: Заливка в DeviceG + // Description: Fill in DeviceGray m_pStream->WriteReal(dG); m_pStream->WriteStr(" g\012"); @@ -1087,7 +1087,7 @@ namespace PdfWriter void CPage::SetFillRGB(double dR, double dG, double dB) { // Operator : rg - // Description: Заливка в DeviceRGB + // Description: Fill in DeviceRGB m_pStream->WriteReal(dR); m_pStream->WriteChar(' '); @@ -1099,7 +1099,7 @@ namespace PdfWriter void CPage::SetFillCMYK(double dC, double dM, double dY, double dK) { // Operator : k - // Description: Заливка в DeviceCMYK + // Description: Fill in DeviceCMYK m_pStream->WriteReal(dC); m_pStream->WriteChar(' '); @@ -1113,7 +1113,7 @@ namespace PdfWriter void CPage::Concat(double dM11, double dM12, double dM21, double dM22, double dX, double dY) { // Operator : cm - // Description: меняем матрицу преобразований (CTM - Current Transformation Matrix) + // Description: Modify the transformation matrix (CTM - Current Transformation Matrix) m_pStream->WriteReal(dM11); m_pStream->WriteChar(' '); @@ -1130,7 +1130,7 @@ namespace PdfWriter CMatrix oCTM = m_pGrState->m_oMatrix; - // перемножаем матрицы oCTM(новая)= oCTM(преобразования(которая параметрами задана)) x oCTM(старая) + // Multiply matrices oCTM(new) = oCTM(transformation(given by parameters)) x oCTM(old) m_pGrState->m_oMatrix.m11 = dM11 * oCTM.m11 + dM12 * oCTM.m21; m_pGrState->m_oMatrix.m12 = dM11 * oCTM.m12 + dM12 * oCTM.m22; m_pGrState->m_oMatrix.m21 = dM21 * oCTM.m11 + dM22 * oCTM.m21; @@ -1165,16 +1165,16 @@ namespace PdfWriter void CPage::Clip() { // Operator : W - // Description: Изменяем текущий clipping path, пересакая его с текущим path, ипользуя правило Nonzero - // Winding Number Rule, для определения какие регионы лежат внутри clipping path. + // Description: Modify current clipping path by intersecting it with current path, using Nonzero + // Winding Number Rule to determine which regions are inside the clipping path. SetGrMode(grmode_CLIP); m_pStream->WriteStr("W\012"); } void CPage::Eoclip() { // Operator : W* - // Description: Изменяем текущий clipping path, пересакая его с текущим path, ипользуя правило Even-Odd - // Rule, для определения какие регионы лежат внутри clipping path. + // Description: Modify current clipping path by intersecting it with current path, using Even-Odd + // Rule to determine which regions are inside the clipping path. SetGrMode(grmode_CLIP); m_pStream->WriteStr("W*\012"); } @@ -1184,7 +1184,7 @@ namespace PdfWriter return; // Operator : gs - // Description: устанавливаем сразу все настройки данного графического состояния(ExtGState) + // Description: Set all settings of the given graphics state (ExtGState) at once CResourcesDict* pResources = GetResourcesItem(); if (!pResources) @@ -1196,7 +1196,7 @@ namespace PdfWriter void CPage::SetExtGrStateKey(const char* sKey) { // Operator : gs - // Description: устанавливаем сразу все настройки данного графического состояния(ExtGState) + // Description: Set all settings of the given graphics state (ExtGState) at once if (!sKey) return; @@ -1240,7 +1240,7 @@ namespace PdfWriter void CPage::BeginText() { // Operator : BT - // Description: Начало текста + // Description: Begin text SetGrMode(grmode_TEXT); m_pStream->WriteStr("BT\012"); @@ -1250,7 +1250,7 @@ namespace PdfWriter void CPage::EndText() { // Operator : ET - // Description: Окончание текста + // Description: End text CheckGrMode(grmode_TEXT); m_pStream->WriteStr("ET\012"); SetGrMode(grmode_PAGE); @@ -1258,7 +1258,7 @@ namespace PdfWriter void CPage::MoveTextPos(double dX, double dY) { // Operator : Td - // Description: Переходим к началу следующей линии, сдвигаясь от начала текущей на ( fX, fY ). + // Description: Move to the beginning of next line, offset from current line start by (fX, fY). CheckGrMode(grmode_TEXT); m_pStream->WriteReal(dX); @@ -1273,7 +1273,7 @@ namespace PdfWriter void CPage::ShowText(const BYTE* sText, unsigned int unLen) { // Operator : Tj - // Description: Показать текстовую строку. + // Description: Show text string. CheckGrMode(grmode_TEXT); WriteText(sText, unLen); m_pStream->WriteStr(" Tj\012"); @@ -1375,7 +1375,7 @@ namespace PdfWriter void CPage::SetTextRise(double dS) { // Operator : Ts - // Description: Устанавливаем подъём текста + // Description: Set text rise CheckGrMode(grmode_TEXT); m_pStream->WriteReal(dS); @@ -1384,7 +1384,7 @@ namespace PdfWriter void CPage::SetCharSpace(double dValue) { // Operator : Tc - // Description: Устанавливаем расстояние между буквами + // Description: Set character spacing CheckGrMode(grmode_TEXT); dValue = std::min((double)MAX_CHARSPACE, std::max((double)MIN_CHARSPACE, dValue)); @@ -1394,7 +1394,7 @@ namespace PdfWriter void CPage::SetWordSpace(double dValue) { // Operator : Tw - // Description: Устанавливаем расстояние между словами + // Description: Set word spacing CheckGrMode(grmode_TEXT); m_pStream->WriteReal(dValue); @@ -1403,7 +1403,7 @@ namespace PdfWriter void CPage::SetHorizontalScaling(double dValue) { // Operator : Tz - // Description: Устанавливаем горизонтальное растяжение/сжатие + // Description: Set horizontal scaling CheckGrMode(grmode_TEXT); dValue = std::min((double)MAX_HORIZONTALSCALING, std::max((double)MIN_HORIZONTALSCALING, dValue)); @@ -1413,7 +1413,7 @@ namespace PdfWriter void CPage::SetFontAndSize(CFontDict* pFont, double dSize) { // Operator : Tf - // Description: Устанавливаем шрифт и размер шрифта + // Description: Set font and font size dSize = std::min((double)MAX_FONTSIZE, std::max(0.0, dSize)); CResourcesDict* pResources = GetResourcesItem(); @@ -1434,7 +1434,7 @@ namespace PdfWriter void CPage::SetFontKeyAndSize(const char* sKey, double dSize) { // Operator : Tf - // Description: Устанавливаем шрифт и размер шрифта + // Description: Set font and font size dSize = std::min((double)MAX_FONTSIZE, std::max(0.0, dSize)); if (!sKey) @@ -1452,7 +1452,7 @@ namespace PdfWriter void CPage::SetTextRenderingMode(ETextRenderingMode eMode) { // Operator : Tr - // Description: Устанавливаем тип закрашивания символов (TextRenderingMode) + // Description: Set text rendering mode (TextRenderingMode) CheckGrMode(grmode_TEXT); m_pStream->WriteInt((int)eMode); m_pStream->WriteStr(" Tr\012"); @@ -1460,7 +1460,7 @@ namespace PdfWriter void CPage::SetTextMatrix(double dM11, double dM12, double dM21, double dM22, double dX, double dY) { // Operator : Tm - // Description: Устанавливаем матрицу преобразования для текста. + // Description: Set text transformation matrix. CheckGrMode(grmode_TEXT); m_pStream->WriteReal(dM11); @@ -1510,7 +1510,7 @@ namespace PdfWriter void CPage::DrawShading(CShading* pShading) { // Operator : sh - // Description: отрисовываем градиент + // Description: Draw gradient const char* sShadingName = GetLocalShadingName(pShading); if (!sShadingName) @@ -1612,7 +1612,7 @@ namespace PdfWriter void CPage::SetPatternColorSpace(CImageTilePattern* pPattern) { // Operator : csn - // Description: задаем паттерн для рисования + // Description: Set pattern for drawing const char* sPatternName = GetLocalPatternName(pPattern); if (!sPatternName) @@ -1688,7 +1688,7 @@ namespace PdfWriter void CPage::BeginMarkedContent(const std::string& sName) { // Operator : BMC - // Description: Начало маркированного контента + // Description: Begin marked content m_pStream->WriteEscapeName(sName.c_str()); m_pStream->WriteStr(" BMC\012"); @@ -1696,7 +1696,7 @@ namespace PdfWriter void CPage::BeginMarkedContentDict(const std::string& sName, CDictObject* pBDC) { // Operator : BDC - // Description: Начало маркированного контента со списком свойств + // Description: Begin marked content with property list m_pStream->WriteEscapeName(sName.c_str()); m_pStream->WriteChar(' '); @@ -1706,14 +1706,14 @@ namespace PdfWriter void CPage::EndMarkedContent() { // Operator : EMC - // Description: Конец маркированного контента + // Description: End marked content m_pStream->WriteStr("EMC\012"); } void CPage::SetRenderingIntent(ERenderingIntent eRenderingIntent) { // Operator : ri - // Description: Способы рендеринга/цветопередачи + // Description: Rendering intent / color reproduction methods m_pStream->WriteEscapeName(c_sRenderingIntent[(int)eRenderingIntent]); m_pStream->WriteStr(" ri\012"); diff --git a/PdfFile/SrcWriter/Pages.h b/PdfFile/SrcWriter/Pages.h index 8cf9f1bceb..8fdcce0f71 100644 --- a/PdfFile/SrcWriter/Pages.h +++ b/PdfFile/SrcWriter/Pages.h @@ -216,16 +216,16 @@ namespace PdfWriter CDocument* m_pDocument; CPageTree* m_pParent; - CPoint m_oStartPos; // Позиция начала текущего пата - CPoint m_oCurPos; // Текущая позиция пата - CPoint m_oTextPos; // Текущая позиция текста + CPoint m_oStartPos; // Start position of current path + CPoint m_oCurPos; // Current path position + CPoint m_oTextPos; // Current text position CMatrix m_oTextMatrix; CArrayObject* m_pContents; CStream* m_pStream; unsigned int m_unCompressionMode; EGrMode m_eGrMode; CGrState* m_pGrState; - CFontDict* m_pFont; // Текущий шрифт + CFontDict* m_pFont; // Current font CDictObject* m_pShadings; unsigned int m_unShadingsCount; CDictObject* m_pPatterns; diff --git a/PdfFile/SrcWriter/RedactOutputDev.cpp b/PdfFile/SrcWriter/RedactOutputDev.cpp index bf1eb4f432..6e5c362dad 100644 --- a/PdfFile/SrcWriter/RedactOutputDev.cpp +++ b/PdfFile/SrcWriter/RedactOutputDev.cpp @@ -401,7 +401,7 @@ void SaveImageMaskToStream(CDocument* pDocument, CDictObject* pDictObj, BYTE* pM } void ApplyRedactToRGBA(const std::vector<double>& arrQuadPoints, BYTE* pImage, int nWidth, int nHeight, const std::vector<CPoint>& imagePolygon) { - // Находим все области редоктирования, которые пересекаются с изображением + // Find all redaction areas that intersect with the image std::vector<std::vector<CPoint>> imageSpaceRedacts; for (int j = 0; j < arrQuadPoints.size(); j += 8) @@ -414,7 +414,7 @@ void ApplyRedactToRGBA(const std::vector<double>& arrQuadPoints, BYTE* pImage, i CPoint(arrQuadPoints[j + 6], arrQuadPoints[j + 7]) }; - // Преобразуем в координаты изображения + // Transform to image coordinates std::vector<CPoint> imageSpaceRedact; for (const CPoint& point : redactPolygon) { @@ -423,15 +423,15 @@ void ApplyRedactToRGBA(const std::vector<double>& arrQuadPoints, BYTE* pImage, i imageSpaceRedact.push_back(CPoint(x, y)); } - // Проверяем, что область хоть частично внутри изображения + // Check that the area is at least partially inside the image if (PdfWriter::SAT(imageSpaceRedact, {CPoint(0, 0), CPoint(0, nHeight), CPoint(nWidth, nHeight), CPoint(nWidth, 0)})) imageSpaceRedacts.push_back(imageSpaceRedact); } - // Закрашиваем области редоктирования черным цветом + // Fill redaction areas with black color for (const auto& redact : imageSpaceRedacts) { - // Находим bounding box области редоктирования в координатах изображения + // Find bounding box of redaction area in image coordinates double minX = nWidth, minY = nHeight, maxX = 0, maxY = 0; for (const CPoint& p : redact) { @@ -441,25 +441,25 @@ void ApplyRedactToRGBA(const std::vector<double>& arrQuadPoints, BYTE* pImage, i if (p.y > maxY) maxY = p.y; } - // Ограничиваем bounding box размерами изображения + // Clamp bounding box to image dimensions int startX = std::max(0, (int)minX); int startY = std::max(0, (int)minY); int endX = std::min(nWidth - 1, (int)maxX); int endY = std::min(nHeight - 1, (int)maxY); - // Закрашиваем прямоугольную область + // Fill rectangular area for (int y = startY; y <= endY; ++y) { for (int x = startX; x <= endX; ++x) { - // Проверяем, что пиксель внутри полигона редоктирования + // Check that pixel is inside redaction polygon if (PdfWriter::isPointInQuad(x, y, redact[0].x, redact[0].y, redact[1].x, redact[1].y, redact[2].x, redact[2].y, redact[3].x, redact[3].y)) { int nIndex = ((nHeight - 1 - y) * nWidth + x) * 4; pImage[nIndex + 0] = 0; // R pImage[nIndex + 1] = 0; // G pImage[nIndex + 2] = 0; // B - // Alpha оставляем 255 + // Keep Alpha at 255 } } } @@ -467,7 +467,7 @@ void ApplyRedactToRGBA(const std::vector<double>& arrQuadPoints, BYTE* pImage, i } void ApplyRedactToGray(const std::vector<double>& arrQuadPoints, BYTE* pImage, int nWidth, int nHeight, const std::vector<CPoint>& imagePolygon) { - // Преобразуем области редоктирования в координаты маски + // Transform redaction areas to mask coordinates std::vector<std::vector<CPoint>> maskSpaceRedacts; for (int j = 0; j < arrQuadPoints.size(); j += 8) @@ -480,7 +480,7 @@ void ApplyRedactToGray(const std::vector<double>& arrQuadPoints, BYTE* pImage, i CPoint(arrQuadPoints[j + 6], arrQuadPoints[j + 7]) }; - // Преобразуем в координаты маски + // Transform to mask coordinates std::vector<CPoint> maskSpaceRedact; for (const CPoint& point : redactPolygon) { @@ -495,7 +495,7 @@ void ApplyRedactToGray(const std::vector<double>& arrQuadPoints, BYTE* pImage, i for (const auto& redact : maskSpaceRedacts) { - // Находим bounding box + // Find bounding box double minX = nWidth, minY = nHeight, maxX = 0, maxY = 0; for (const CPoint& p : redact) { @@ -588,7 +588,7 @@ void RedactOutputDev::restoreState(GfxState *pGState) updateAll(pGState); if (m_sStates.empty()) - return; // Несбалансированный q/Q - сломанный файл + return; // Unbalanced q/Q - broken file m_sStates.pop_back(); } //----- update graphics state @@ -1087,7 +1087,7 @@ void RedactOutputDev::setShading(GfxState *pGState, const char* name) double dShiftX = 0, dShiftY = 0; DoTransform(pGState->getCTM(), &dShiftX, &dShiftY, true); - // TODO Нужно проверять Shading на отсечение? + // TODO Should Shading be checked for clipping? m_pPage->GrSave(); UpdateTransform(); @@ -1229,7 +1229,7 @@ void RedactOutputDev::drawSoftMaskedImage(GfxState *pGState, Gfx *gfx, Object *p { if (nWidth != nMaskWidth || nHeight != nMaskHeight) { - // Простое масштабирование (ближайший сосед) + // Simple scaling (nearest neighbor) BYTE* pDstMask = new BYTE[nWidth * nHeight]; if (!pDstMask) { @@ -1247,7 +1247,7 @@ void RedactOutputDev::drawSoftMaskedImage(GfxState *pGState, Gfx *gfx, Object *p int srcX = (int)(dstX * dScaleX); int srcY = (int)(dstY * dScaleY); - // Ограничиваем координаты + // Clamp coordinates srcX = std::min(srcX, nMaskWidth - 1); srcY = std::min(srcY, nMaskHeight - 1); @@ -1439,18 +1439,18 @@ bool SkipPath(const std::vector<CSegment>& arrForStroke, const CPoint& P1, const { CPoint P3 = arrForStroke[i].start; CPoint P4 = arrForStroke[i].end; - // Вычисляем коэффициенты A, B, C для уравнения прямой P3P4: Ax + By + C = 0 + // Calculate coefficients A, B, C for line equation P3P4: Ax + By + C = 0 double A = P4.y - P3.y; double B = P3.x - P4.x; double C = P4.x * P3.y - P3.x * P4.y; - // Проверяем, лежит ли точка P1 на прямой P3P4 + // Check if point P1 lies on line P3P4 double check1 = A * P1.x + B * P1.y + C; - // Проверяем, лежит ли точка P2 на прямой P3P4 + // Check if point P2 lies on line P3P4 double check2 = A * P2.x + B * P2.y + C; - // Если обе проверки близки к нулю (в пределах эпсилон), то лежит + // If both checks are close to zero (within epsilon), then it lies on the line if ((std::abs(check1) < 0.006) && (std::abs(check2) < 0.006)) return true; } @@ -1708,7 +1708,7 @@ void RedactOutputDev::DoPathRedact(GfxState* pGState, GfxPath* pPath, double* pC ++nCurPointIndex; } } - // if (pSubpath->isClosed()) Принудительное замыкание фигур для CGraphicsPath + // if (pSubpath->isClosed()) Force closing figures for CGraphicsPath oPath.CloseFigure(); } diff --git a/PdfFile/SrcWriter/ResourcesDictionary.cpp b/PdfFile/SrcWriter/ResourcesDictionary.cpp index fd74076ca5..efb136a4ff 100644 --- a/PdfFile/SrcWriter/ResourcesDictionary.cpp +++ b/PdfFile/SrcWriter/ResourcesDictionary.cpp @@ -94,7 +94,7 @@ namespace PdfWriter const char *sKey = m_pFonts->GetKey(pEmbedded ? pEmbedded->GetObj2() : pFont); if (!sKey) { - // если фонт не зарегистрирован в ресурсах, тогда регистрируем его + // if font is not registered in resources, then register it char sFontName[LIMIT_MAX_NAME_LEN + 1]; char *pPointer = NULL; char *pEndPointer = sFontName + LIMIT_MAX_NAME_LEN; @@ -129,7 +129,7 @@ namespace PdfWriter const char* sKey = m_pExtGStates->GetKey(pState); if (!sKey) { - // Если ExtGState не зарегистрирован в Resource, регистрируем. + // If ExtGState is not registered in Resource, register it. char sExtGrStateName[LIMIT_MAX_NAME_LEN + 1]; char *pPointer; char *pEndPointer = sExtGrStateName + LIMIT_MAX_NAME_LEN; @@ -195,7 +195,7 @@ namespace PdfWriter } void CResourcesDict::Fix() { - // Инициализация текущего fonts + // Initialize current fonts CObjectBase* pFonts = Get("Font"); if (pFonts && pFonts->GetType() == object_type_DICT) { @@ -203,7 +203,7 @@ namespace PdfWriter m_unFontsCount = 0; } - // Инициализация текущего ExtGStates + // Initialize current ExtGStates CObjectBase* pExtGStates = Get("ExtGState"); if (pExtGStates && pExtGStates->GetType() == object_type_DICT) { @@ -211,7 +211,7 @@ namespace PdfWriter m_unExtGStatesCount = 0; } - // Инициализация текущего XObject + // Initialize current XObject CObjectBase* pXObject = Get("XObject"); if (pXObject && pXObject->GetType() == object_type_DICT) { diff --git a/PdfFile/SrcWriter/Shading.h b/PdfFile/SrcWriter/Shading.h index 602023fd65..0a2db6ebea 100644 --- a/PdfFile/SrcWriter/Shading.h +++ b/PdfFile/SrcWriter/Shading.h @@ -69,7 +69,7 @@ namespace PdfWriter private: - bool m_bRgb; // Rgb или Gray + bool m_bRgb; // Rgb or Gray unsigned char* m_pColors; double* m_pColorsPoints; int m_nColorsCount; diff --git a/PdfFile/SrcWriter/States.cpp b/PdfFile/SrcWriter/States.cpp index b5a828d225..97e1ab9282 100644 --- a/PdfFile/SrcWriter/States.cpp +++ b/PdfFile/SrcWriter/States.cpp @@ -259,7 +259,7 @@ void CCommandManager::Clear() } //---------------------------------------------------------------------------------------- -// Внутренние функции +// Internal functions //---------------------------------------------------------------------------------------- static inline void UpdateMaxMinPoints(double& dMinX, double& dMinY, double& dMaxX, double& dMaxY, const double& dX, const double& dY) { @@ -281,18 +281,18 @@ bool SkipPath(const std::vector<PdfWriter::CSegment>& arrForStroke, const PdfWri { PdfWriter::CPoint P3 = arrForStroke[i].start; PdfWriter::CPoint P4 = arrForStroke[i].end; - // Вычисляем коэффициенты A, B, C для уравнения прямой P3P4: Ax + By + C = 0 + // Calculate coefficients A, B, C for line equation P3P4: Ax + By + C = 0 double A = P4.y - P3.y; double B = P3.x - P4.x; double C = P4.x * P3.y - P3.x * P4.y; - // Проверяем, лежит ли точка P1 на прямой P3P4 + // Check if point P1 lies on line P3P4 double check1 = A * P1.x + B * P1.y + C; - // Проверяем, лежит ли точка P2 на прямой P3P4 + // Check if point P2 lies on line P3P4 double check2 = A * P2.x + B * P2.y + C; - // Если обе проверки близки к нулю (в пределах эпсилон), то лежит + // If both checks are close to zero (within epsilon), it lies on the line if ((std::abs(check1) < 0.006) && (std::abs(check2) < 0.006)) return true; } @@ -667,14 +667,14 @@ void CPath::CPathArcTo::UpdateBounds(double& dL, double& dT, double& dR, double& } double AngToEllPrm(double dAngle, double dXRad, double dYRad) { - // Функция для перевода реального угла в параметрическое задание эллписа - // т.е. x= a cos(t) y = b sin(t) - параметрическое задание эллписа. + // Function to convert real angle to parametric ellipse representation + // i.e. x= a cos(t) y = b sin(t) - parametric ellipse representation. // x = r cos(p), y = r sin(p) => t = atan2( sin(p) / b, cos(p) / a ); return atan2(sin(dAngle) / dYRad, cos(dAngle) / dXRad); } void WriteEllipseArc(PdfWriter::CMatrix* pMatrix, Aggplus::CGraphicsPath& oPath, double dX, double dY, double dXRad, double dYRad, double dAngle1, double dAngle2, double& dXCur, double& dYCur, bool bClockDirection = false) { - // Рассчитаем начальную, конечную и контрольные точки + // Calculate start, end and control points double dX1 = 0.0, dX2 = 0.0, dY1 = 0.0, dY2 = 0.0; double dCX1 = 0.0, dCX2 = 0.0, dCY1 = 0.0, dCY2 = 0.0; @@ -717,24 +717,24 @@ void WriteEllipseArc(PdfWriter::CMatrix* pMatrix, Aggplus::CGraphicsPath& oPath, } void EllipseArc(double dX, double dY, double dXRad, double dYRad, double _dAngle1, double _dAngle2, bool bClockDirection, PdfWriter::CMatrix* pMatrix, Aggplus::CGraphicsPath& oPath) { - // переведем углы в радианы + // Convert angles to radians double dAngle1 = _dAngle1 * 3.141592f / 180; double dAngle2 = _dAngle2 * 3.141592f / 180; - // Выясним в каких четвертях находятся начальная и конечная точки + // Determine which quadrants contain the start and end points int nFirstPointQuard = int(_dAngle1) / 90 + 1; int nSecondPointQuard = int(_dAngle2) / 90 + 1; nSecondPointQuard = std::min(4, std::max(1, nSecondPointQuard)); nFirstPointQuard = std::min(4, std::max(1, nFirstPointQuard)); - // Проведем линию в начальную точку дуги + // Draw line to arc start point double dStartX = 0.0, dStartY = 0.0, dEndX = 0.0, dEndY = 0.0; dStartX = dX + dXRad * cos(AngToEllPrm(dAngle1, dXRad, dYRad)); dStartY = dY + dYRad * sin(AngToEllPrm(dAngle1, dXRad, dYRad)); - // Дальше рисуем по четверям + // Continue drawing by quadrants double dCurX = dStartX, dCurY = dStartY; double dStartAngle = dAngle1; double dEndAngle = 0; @@ -810,7 +810,7 @@ void CPath::CPathArcTo::ToCGraphicsPath(PdfWriter::CMatrix* pMatrix, Aggplus::CG { double dX = x + w / 2, dY = y + h / 2, dXRad = w / 2, dYRad = h / 2, _dAngle1 = 360 - startAngle, _dAngle2 = 360 - (startAngle + sweepAngle); bool bClockDirection = sweepAngle > 0; - // Проверяем эллипс на невырожденность + // Check ellipse for degeneracy if (dXRad < 0.001 || dYRad < 0.001) { double dAngle1 = _dAngle1 * 3.141592f / 180; @@ -886,7 +886,7 @@ void CPath::CPathClose::ToCGraphicsPath(PdfWriter::CMatrix* pMatrix, Aggplus::CG } void CPath::CPathText::Draw(PdfWriter::CPage* pPage) { - // TODO: Если данная команда будет часто вызываться, тогда ее нужно будет оптимизировать, точно также как это делается в обычном тексте + // TODO: If this command is called frequently, it needs to be optimized, the same way as regular text pPage->BeginText(); pPage->SetFontAndSize(font, fontSize); pPage->SetCharSpace(charSpace); @@ -900,8 +900,8 @@ void CPath::CPathText::UpdateBounds(double& dL, double& dT, double& dR, double& } void CPath::CPathText::ToCGraphicsPath(PdfWriter::CMatrix* pMatrix, Aggplus::CGraphicsPath& oPath) { - // Весь текст проверяется в CPdfWriter::PathCommandDrawText - // Эта функция не должна быть вызвана + // All text is checked in CPdfWriter::PathCommandDrawText + // This function should not be called } void CBrushState::Reset() { diff --git a/PdfFile/SrcWriter/States.h b/PdfFile/SrcWriter/States.h index 5c14279eed..925561db5d 100644 --- a/PdfFile/SrcWriter/States.h +++ b/PdfFile/SrcWriter/States.h @@ -435,7 +435,7 @@ public: } else { - // Избавляемся от нулей, потому что все pdf-ридеры плохо их воспринимают + // Remove zeros because all pdf readers handle them poorly std::vector<double> vPattern; for (LONG lIndex = 0; lIndex < lSize; lIndex++) { @@ -727,7 +727,7 @@ public: } inline void SetGradientColors(LONG* pColors, double* pPoints, const LONG& lCount) { - // Мы создаем упорядоченный по возрастанию массив, причем первая и последняя точки должны быть 0 и 1 соответственно. + // We create an array sorted in ascending order, with the first and last points being 0 and 1 respectively. if (m_pShadingColors) { delete[] m_pShadingColors; @@ -743,7 +743,7 @@ public: if (!pColors || !pPoints || !lCount) return; - // Проверим вырожденный случай, когда задана либо 1 точка, либо несколько точек с одинковым значением + // Check degenerate case when either 1 point is given, or several points with the same value bool bIrregular = false; if (1 == lCount) { @@ -1113,7 +1113,7 @@ private: TColor* m_pShadingColors; double* m_pShadingPoints; LONG m_lShadingPointsCount; - double m_pShadingPattern[6]; // У линейного градиента x0, y0, x1, y1 (2 не используются), у радиального x0, y0, r0, x1, y1, r1 + double m_pShadingPattern[6]; // For linear gradient x0, y0, x1, y1 (2 unused), for radial x0, y0, r0, x1, y1, r1 bool m_bIsScale; double m_dScaleX; @@ -1477,7 +1477,7 @@ private: } void GetLastPoint(double& dX, double& dY) { - // TODO: Надо грамотно пересчитать + // TODO: Need to recalculate properly dX = x; dY = y; } @@ -1506,7 +1506,7 @@ private: } void GetLastPoint(double& dX, double& dY) { - // TODO: Надо грамотно пересчитать + // TODO: Need to recalculate properly dX = 0; dY = 0; } @@ -1818,7 +1818,7 @@ public: { double dGoodFontSize = 0; - // Параметры подобраны для совместимости с AdobeReader + // Parameters selected for AdobeReader compatibility double dFontSize = 4; double dFontSizeStep = 0.797 / 3.0; diff --git a/PdfFile/SrcWriter/Streams.cpp b/PdfFile/SrcWriter/Streams.cpp index 7e5bee3ece..a3f37ffeb7 100644 --- a/PdfFile/SrcWriter/Streams.cpp +++ b/PdfFile/SrcWriter/Streams.cpp @@ -651,11 +651,11 @@ namespace PdfWriter pDict->BeforeWrite(); - // EncryptDict не надо шифровать + // EncryptDict should not be encrypted if (dict_type_ENCRYPT == pDict->GetDictType()) pEncrypt = NULL; - // Добавляем запись Filter + // Add Filter entry if (pDict->GetStream()) { unsigned int unFilter = pDict->GetFilter(); @@ -725,7 +725,7 @@ namespace PdfWriter if (pStream) { CNumberObject* pLength = (CNumberObject*)pDict->Get("Length"); - // "Length" должен управляться таблицей Xref (флаг Indirect) + // "Length" should be managed by Xref table (Indirect flag) if (pLength && object_type_NUMBER == pLength->GetType()) { if (pEncrypt) diff --git a/PdfFile/SrcWriter/Utils.cpp b/PdfFile/SrcWriter/Utils.cpp index 583d7a657d..8bbc37b75b 100644 --- a/PdfFile/SrcWriter/Utils.cpp +++ b/PdfFile/SrcWriter/Utils.cpp @@ -182,11 +182,11 @@ namespace PdfWriter dVal = -dVal; } - // разделяем целую и дробную части + // Separate integer and fractional parts nNPartVal = (int)(dVal + 0.000005); nFPartVal = (int)((float)(dVal - nNPartVal + 0.000005) * 100000); - // пишем дробную часть + // Write fractional part for (nIndex = 0; nIndex < 5; nIndex++) { *sTemp = (char)(nFPartVal % 10) + '0'; @@ -194,7 +194,7 @@ namespace PdfWriter sTemp--; } - // пишем целую часть + // Write integer part *sTemp-- = '.'; *sTemp = '0'; if (nNPartVal == 0) @@ -214,8 +214,8 @@ namespace PdfWriter sDst--; - // TODO: при избавлении от нулей при сдвиге конец строки тоже нужно чистить - // пример число -00.90123 результат "-0.901234" + // TODO: when removing zeros during shift, the end of the string also needs to be cleaned + // example number -00.90123 result "-0.901234" while (sDst > sptr) { @@ -233,7 +233,7 @@ namespace PdfWriter } void UIntChangeBit(unsigned int& nValue, short nBit) { - // работаем только с 4-байтовыми числами + // Work only with 4-byte numbers if (nBit < 0 || nBit > 31) return; @@ -338,7 +338,7 @@ namespace PdfWriter CPoint p1 = poly1[i]; CPoint p2 = poly1[(i + 1) % poly1.size()]; CPoint edge(p2.x - p1.x, p2.y - p1.y); - CPoint normal(-edge.y, edge.x); // Перпендикуляр к ребру + CPoint normal(-edge.y, edge.x); // Perpendicular to edge axes.push_back(normal); } @@ -347,11 +347,11 @@ namespace PdfWriter CPoint p1 = poly2[i]; CPoint p2 = poly2[(i + 1) % poly2.size()]; CPoint edge(p2.x - p1.x, p2.y - p1.y); - CPoint normal(-edge.y, edge.x); // Перпендикуляр к ребру + CPoint normal(-edge.y, edge.x); // Perpendicular to edge axes.push_back(normal); } - // Проверяем все оси на разделение + // Check all axes for separation for (const auto& axis : axes) { double min1, max1, min2, max2; @@ -359,9 +359,9 @@ namespace PdfWriter projectPolygon(poly2, axis, min2, max2); if (max1 < min2 || max2 < min1) - return false; // Найдена разделяющая ось + return false; // Separating axis found } - return true; // Пересекаются + return true; // Intersecting } bool isPolygonInsidePolygon(const std::vector<CPoint>& inner, const std::vector<CPoint>& outer) { @@ -381,13 +381,13 @@ namespace PdfWriter if (x1 == x2 && x2 == x3 && x3 == x4 && y1 == y2 && y2 == y3 && y3 == y4) return (px == x1 && py == y1); - // Проверяем знаки векторных произведений для всех сторон + // Check cross product signs for all sides double cross1 = crossProduct(x1, y1, x2, y2, px, py); double cross2 = crossProduct(x2, y2, x3, y3, px, py); double cross3 = crossProduct(x3, y3, x4, y4, px, py); double cross4 = crossProduct(x4, y4, x1, y1, px, py); - // Точка внутри, если все векторные произведения имеют одинаковый знак + // Point is inside if all cross products have the same sign bool allPositive = (cross1 >= 0 && cross2 >= 0 && cross3 >= 0 && cross4 >= 0); bool allNegative = (cross1 <= 0 && cross2 <= 0 && cross3 <= 0 && cross4 <= 0); @@ -441,7 +441,7 @@ namespace PdfWriter if (length < 1e-10) return 0; - // Проекция вектора (point - start) на направление отрезка + // Project vector (point - start) onto segment direction double proj = ((point.x - start.x) * dx + (point.y - start.y) * dy) / length; return proj; } @@ -449,7 +449,7 @@ namespace PdfWriter { std::vector<CPoint> allIntersections; - // Собираем все точки пересечения со всеми прямоугольниками + // Collect all intersection points with all rectangles for (const auto& rect : rectangles) { for (int i = 0; i < rect.size(); i++) @@ -460,11 +460,11 @@ namespace PdfWriter } } - // Добавляем концы отрезка + // Add segment endpoints allIntersections.push_back(line.start); allIntersections.push_back(line.end); - // Удаляем дубликаты + // Remove duplicates std::sort(allIntersections.begin(), allIntersections.end(), [&line](const CPoint& a, const CPoint& b) { return distanceAlongLine(line.start, line.end, a) < distanceAlongLine(line.start, line.end, b); @@ -473,21 +473,21 @@ namespace PdfWriter auto last = std::unique(allIntersections.begin(), allIntersections.end()); allIntersections.erase(last, allIntersections.end()); - // Проверяем каждый сегмент между точками пересечения + // Check each segment between intersection points std::vector<CSegment> result; for (size_t i = 0; i < allIntersections.size() - 1; i++) { CPoint start = allIntersections[i]; CPoint end = allIntersections[i + 1]; - // Находим среднюю точку сегмента + // Find segment midpoint CPoint mid = { (start.x + end.x) / 2, (start.y + end.y) / 2 }; - // Проверяем, находится ли средняя точка внутри какого-либо прямоугольника + // Check if midpoint is inside any rectangle bool isInsideAnyRectangle = false; for (const auto& rect : rectangles) { @@ -498,7 +498,7 @@ namespace PdfWriter } } - // Если средняя точка не внутри ни одного прямоугольника - это внешний сегмент + // If midpoint is not inside any rectangle - this is an external segment if (!isInsideAnyRectangle) result.push_back(CSegment(start, end)); } @@ -507,10 +507,10 @@ namespace PdfWriter } std::vector<CSegment> RectangleIntersection::findSegmentsOutsideRectanglesSequential(const CSegment& line, const std::vector<std::vector<CPoint>>& rectangles) { - // Начинаем с полного отрезка + // Start with full segment std::vector<CSegment> currentSegments = {line}; - // Последовательно вычитаем каждый прямоугольник + // Sequentially subtract each rectangle for (const auto& rect : rectangles) { std::vector<CSegment> newSegments; diff --git a/PdfFile/SrcWriter/Utils.h b/PdfFile/SrcWriter/Utils.h index dd75ca51ed..d94bec1769 100644 --- a/PdfFile/SrcWriter/Utils.h +++ b/PdfFile/SrcWriter/Utils.h @@ -142,11 +142,11 @@ namespace PdfWriter std::string DateNow(); std::wstring NormalizeWhitespace(const std::wstring& s); - // Пересечение многоугольников по теореме о разделяющей оси + // Polygon intersection using separating axis theorem bool SAT(const std::vector<CPoint>& poly1, const std::vector<CPoint>& poly2); - // Проверка, что все точки внутреннего полигона находятся внутри внешнего + // Check that all points of inner polygon are inside outer polygon bool isPolygonInsidePolygon(const std::vector<CPoint>& inner, const std::vector<CPoint>& outer); - // Проверка принадлежности точки выпуклому четырехугольнику + // Check if point belongs to convex quadrilateral bool isPointInQuad(double px, double py, double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4); @@ -154,17 +154,17 @@ namespace PdfWriter class RectangleIntersection { private: - // Проверка на пересечение двух отрезков + // Check for intersection of two line segments static bool segmentsIntersect(const CPoint& a, const CPoint& b, const CPoint& c, const CPoint& d, CPoint& intersection); - // Проверка, находится ли точка внутри прямоугольника + // Check if point is inside rectangle static bool pointInRectangle(const CPoint& p, const std::vector<CPoint>& rect); - // Вычисление расстояния от точки до начала отрезка вдоль направления + // Calculate distance from point to segment start along direction static double distanceAlongLine(const CPoint& start, const CPoint& end, const CPoint& point); public: - // Основная функция для нахождения отрезков вне всех прямоугольников + // Main function for finding segments outside all rectangles static std::vector<CSegment> findSegmentsOutsideRectangles(const CSegment& line, const std::vector<std::vector<CPoint>>& rectangles); - // Альтернативный подход: последовательное вычитание прямоугольников + // Alternative approach: sequential subtraction of rectangles static std::vector<CSegment> findSegmentsOutsideRectanglesSequential(const CSegment& line, const std::vector<std::vector<CPoint>>& rectangles); }; diff --git a/PdfFile/lib/xpdf/Gfx.cc b/PdfFile/lib/xpdf/Gfx.cc index fe408a8acd..65e4ea4e5c 100644 --- a/PdfFile/lib/xpdf/Gfx.cc +++ b/PdfFile/lib/xpdf/Gfx.cc @@ -5104,14 +5104,14 @@ void Gfx::opEndIgnoreUndef(Object args[], int numArgs) { void Gfx::SkipBDC() { Object obj; - // Стек аргументов (как в основном цикле обработки) + // Argument stack (as in the main processing loop) Object args[maxArgs]; int numArgs = 0; getContentObj(&obj); while (!obj.isEOF()) { if (obj.isCmd("BMC") || obj.isCmd("BDC")) { - // Сбрасываем накопленные аргументы перед рекурсией + // Reset accumulated arguments before recursion for (int i = 0; i < numArgs; ++i) args[i].free(); numArgs = 0; SkipBDC(); @@ -5125,11 +5125,11 @@ void Gfx::SkipBDC() for (int i = 0; i < numArgs; ++i) args[i].free(); numArgs = 0; } else if (obj.isCmd()) { - // Любая другая команда — просто сбрасываем аргументы + // Any other command - just reset arguments for (int i = 0; i < numArgs; ++i) args[i].free(); numArgs = 0; } else { - // Операнд — кладём в стек аргументов + // Operand - put on argument stack if (numArgs < maxArgs) { obj.copy(&args[numArgs]); ++numArgs; diff --git a/PdfFile/test/test.cpp b/PdfFile/test/test.cpp index 24d00a32c4..a6e639cc67 100644 --- a/PdfFile/test/test.cpp +++ b/PdfFile/test/test.cpp @@ -346,7 +346,7 @@ TEST_F(CPdfFileTest, Base64ConvertToRaster) { GTEST_SKIP(); - // чтение и конвертации бинарника + // reading and converting the binary NSFile::CFileBinary oFile; ASSERT_TRUE(oFile.OpenFile(NSFile::GetProcessDirectory() + L"/base64.txt")); @@ -381,7 +381,7 @@ TEST_F(CPdfFileTest, BinConvertToRaster) { GTEST_SKIP(); - // чтение и конвертации бинарника + // reading and converting the binary NSFile::CFileBinary oFile; ASSERT_TRUE(oFile.OpenFile(NSFile::GetProcessDirectory() + L"/pdf.bin")); @@ -533,7 +533,7 @@ TEST_F(CPdfFileTest, EditPdfFromBase64) LoadFromFile(); ASSERT_TRUE(pdfFile->EditPdf(wsDstFile)); - // чтение и конвертации бинарника + // reading and converting the binary NSFile::CFileBinary oFile; ASSERT_TRUE(oFile.OpenFile(NSFile::GetProcessDirectory() + L"/base64.txt")); @@ -576,7 +576,7 @@ TEST_F(CPdfFileTest, EditPdfFromBin) LoadFromFile(); ASSERT_TRUE(pdfFile->EditPdf(wsDstFile)); - // чтение бинарника + // reading the binary NSFile::CFileBinary oFile; ASSERT_TRUE(oFile.OpenFile(NSFile::GetProcessDirectory() + L"/changes.bin")); @@ -665,11 +665,11 @@ TEST_F(CPdfFileTest, EditPdfSign) pdfFile->Sign(10, 300, 100, 100, NSFile::GetProcessDirectory() + L"/test.jpeg"); } - // Для цифровой подписи важно предварительно pdfFile->EditClose, в остальных случаях pdfFile->Close() сделает тоже самое + // For digital signature it's important to call pdfFile->EditClose beforehand, in other cases pdfFile->Close() does the same pdfFile->EditClose(); // EditPdf & EditClose || CreatePdf & SaveToFile - // И только после подготовка данных для подписания, подписываем, запись подписи + // And only after preparing the data for signing, we sign and write the signature for (int i = 0; i < 3; ++i) { pdfFile->PrepareSignature(wsDstFile); @@ -699,7 +699,7 @@ TEST_F(CPdfFileTest, EditPdfSign) pCertificate->SignPKCS7(pDataToSign, dwDataSignLength, pDatatoWrite, dwLenDatatoWrite); RELEASEARRAYOBJECTS(pDataToSign); - // Обязательно FinalizeSignature - он либо заполнит данные, либо сделает подпись пустой + // FinalizeSignature is mandatory - it either fills in the data or makes the signature empty pdfFile->FinalizeSignature(pDatatoWrite, dwLenDatatoWrite); RELEASEARRAYOBJECTS(pDatatoWrite); diff --git a/RtfFile/Format/DestinationCommand.cpp b/RtfFile/Format/DestinationCommand.cpp index ec078e118e..9d65fc709b 100644 --- a/RtfFile/Format/DestinationCommand.cpp +++ b/RtfFile/Format/DestinationCommand.cpp @@ -86,7 +86,7 @@ void ConvertOle1ToOle2(BYTE *pData, int nSize, std::wstring sOle2Name) bResult = true; } else - {//уже ole2 + {//already ole2 storageIn->close(); bResult = true; } @@ -487,7 +487,7 @@ void RtfNormalReader::SectDef( RtfDocument& oDocument, RtfReader& oReader ) { oReader.m_oCurSectionProp.SetDefaultRtf(); - //в соответствии с документацией ставим Page Information свойства как у документа + //according to documentation, set Page Information properties same as document oReader.m_oCurSectionProp.m_nPageWidth = oDocument.m_oProperty.m_nPaperWidth; oReader.m_oCurSectionProp.m_nPageHeight = oDocument.m_oProperty.m_nPaperHeight; oReader.m_oCurSectionProp.m_nMarginLeft = oDocument.m_oProperty.m_nMarginLeft; @@ -636,7 +636,7 @@ bool RtfNormalReader::ExecuteCommand( RtfDocument& oDocument, RtfReader& oReader oParagraphReaderDestination.m_oTextItems = new_section.props; - //вручную обнуляем footer, т.к. sectd может встретиться и после field + //manually reset footer, because sectd can appear after field ///????? oReader.m_oCurSectionProp.m_oHeaderLeft = TextItemContainerPtr(); oReader.m_oCurSectionProp.m_oHeaderFirst = TextItemContainerPtr(); @@ -1008,7 +1008,7 @@ bool RtfShadingCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReade } bool RtfShadingCellCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader, std::string sCommand, bool hasParameter, int parameter, RtfShading& oOutput) { - //для свойст таблицы и для стилей таблицы + //for table properties and table styles if ( "clshdrawnil" == sCommand ) oOutput.m_eType = RtfShading::st_clshdrawnil; else if ( "rawclbgvert" == sCommand || "clbgvert" == sCommand || "tsbgvert" == sCommand ) @@ -1466,10 +1466,10 @@ bool RtfTableCellPropsCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader& COMMAND_RTF_BOOL( "clFitText", cellProps->m_bFitText, sCommand, hasParameter, parameter ) COMMAND_RTF_BOOL( "clNoWrap", cellProps->m_bNoWrap, sCommand, hasParameter, parameter ) //https://www.office-forums.com/threads/rtf-file-weirdness-clpadt-vs-clpadl.2163500/ - COMMAND_RTF_INT ( "clpadft", cellProps->m_ePaddingLeftUnit, sCommand, hasParameter, parameter ) //перепутаны top & left - COMMAND_RTF_INT ( "clpadt", cellProps->m_nPaddingLeft, sCommand, hasParameter, parameter ) //перепутаны top & left - COMMAND_RTF_INT ( "clpadfl", cellProps->m_ePaddingTopUnit, sCommand, hasParameter, parameter ) //перепутаны top & left - COMMAND_RTF_INT ( "clpadl", cellProps->m_nPaddingTop, sCommand, hasParameter, parameter ) //перепутаны top & left + COMMAND_RTF_INT ( "clpadft", cellProps->m_ePaddingLeftUnit, sCommand, hasParameter, parameter ) //top & left are swapped + COMMAND_RTF_INT ( "clpadt", cellProps->m_nPaddingLeft, sCommand, hasParameter, parameter ) //top & left are swapped + COMMAND_RTF_INT ( "clpadfl", cellProps->m_ePaddingTopUnit, sCommand, hasParameter, parameter ) //top & left are swapped + COMMAND_RTF_INT ( "clpadl", cellProps->m_nPaddingTop, sCommand, hasParameter, parameter ) //top & left are swapped COMMAND_RTF_INT ( "clpadfr", cellProps->m_ePaddingRightUnit, sCommand, hasParameter, parameter ) COMMAND_RTF_INT ( "clpadr", cellProps->m_nPaddingRight, sCommand, hasParameter, parameter ) COMMAND_RTF_INT ( "clpadfb", cellProps->m_ePaddingBottomUnit, sCommand, hasParameter, parameter ) @@ -1682,7 +1682,7 @@ RtfOldShapeReader::RtfOldShapeReader( RtfShape& oShape ):m_oShape(oShape) } void RtfOldShapeReader::ExitReader( RtfDocument& oDocument, RtfReader& oReader ) { - //если задан поворот, то надо повернуть и исходный rect, если угол от 45 до 135 и от 225 до 315 + //if rotation is set, then rotate the source rect too, if angle is from 45 to 135 and from 225 to 315 if( (PROP_DEF != m_oShape.m_nRotation || PROP_DEF != m_oShape.m_nRelRotation) && (( PROP_DEF != m_oShape.m_nLeft && PROP_DEF != m_oShape.m_nTop && PROP_DEF != m_oShape.m_nBottom && PROP_DEF != m_oShape.m_nRight ) || @@ -1690,12 +1690,12 @@ void RtfOldShapeReader::ExitReader( RtfDocument& oDocument, RtfReader& oReader ) PROP_DEF != m_oShape.m_nRelRight && PROP_DEF != m_oShape.m_nRelBottom ) ) ) { - int nAngel = 0; // в градусах + int nAngel = 0; // in degrees if( PROP_DEF != m_oShape.m_nRotation ) nAngel = m_oShape.m_nRotation / 65536; else nAngel = m_oShape.m_nRelRotation / 65536; - int nSourceAngel = nAngel; // в градусах + int nSourceAngel = nAngel; // in degrees bool bRel = false; int nLeft; int nRight; @@ -1716,16 +1716,16 @@ void RtfOldShapeReader::ExitReader( RtfDocument& oDocument, RtfReader& oReader ) nTop = m_oShape.m_nRelTop; nBottom = m_oShape.m_nRelBottom; } - //поворачиваем на 45 градусов + //rotate by 45 degrees nAngel -= 45; - //делаем угол от 0 до 360 + //make angle from 0 to 360 nAngel = nAngel % 360; if( nAngel < 0 ) nAngel += 360; - int nQuater = nAngel / 90; // определяем четверть + int nQuater = nAngel / 90; // determine quadrant if( 0 == nQuater || 2 == nQuater ) { - //поворачиваем относительно центра на 90 градусов обратно + //rotate back 90 degrees relative to center int nCenterX = ( nLeft + nRight ) / 2; int nCenterY = ( nTop + nBottom ) / 2; int nWidth = nRight - nLeft; @@ -2095,7 +2095,7 @@ RtfShapeReader::RtfShapeReader( RtfShape& oShape ):m_oShape(oShape) } void RtfShapeReader::ExitReader( RtfDocument& oDocument, RtfReader& oReader ) { - //если задан поворот, то надо повернуть и исходный rect, если угол от 45 до 135 и от 225 до 315 + //if rotation is set, then rotate the source rect too, if angle is from 45 to 135 and from 225 to 315 if( (PROP_DEF != m_oShape.m_nRotation || PROP_DEF != m_oShape.m_nRelRotation) && (( PROP_DEF != m_oShape.m_nLeft && PROP_DEF != m_oShape.m_nTop && PROP_DEF != m_oShape.m_nBottom && PROP_DEF != m_oShape.m_nRight ) || @@ -2103,12 +2103,12 @@ void RtfShapeReader::ExitReader( RtfDocument& oDocument, RtfReader& oReader ) PROP_DEF != m_oShape.m_nRelRight && PROP_DEF != m_oShape.m_nRelBottom ) ) ) { - int nAngel = 0; // в градусах + int nAngel = 0; // in degrees if( PROP_DEF != m_oShape.m_nRotation ) nAngel = m_oShape.m_nRotation / 65536; else nAngel = m_oShape.m_nRelRotation / 65536; - int nSourceAngel = nAngel; // в градусах + int nSourceAngel = nAngel; // in degrees bool bRel = false; int nLeft; int nRight; @@ -2129,16 +2129,16 @@ void RtfShapeReader::ExitReader( RtfDocument& oDocument, RtfReader& oReader ) nTop = m_oShape.m_nRelTop; nBottom = m_oShape.m_nRelBottom; } - //поворачиваем на 45 градусов + //rotate by 45 degrees nAngel -= 45; - //делаем угол от 0 до 360 + //make angle from 0 to 360 nAngel = nAngel % 360; if( nAngel < 0 ) nAngel += 360; - int nQuater = nAngel / 90; // определяем четверть + int nQuater = nAngel / 90; // determine quadrant if( 0 == nQuater || 2 == nQuater ) { - //поворачиваем относительно центра на 90 градусов обратно + //rotate back 90 degrees relative to center int nCenterX = ( nLeft + nRight ) / 2; int nCenterY = ( nTop + nBottom ) / 2; int nWidth = nRight - nLeft; @@ -2323,7 +2323,7 @@ RtfFieldReader::RtfFieldReader( RtfField& oField ) : m_oField(oField) } void RtfFieldReader::ExitReader( RtfDocument& oDocument, RtfReader& oReader ) { - //если результат пустой пытаемся его сгенерировать + //if result is empty try to generate it if( true == IsEmptyText( oDocument ) ) TryToPepairResult( oDocument, oReader ); } @@ -2389,9 +2389,9 @@ void RtfFieldReader::TryToPepairResult( RtfDocument& oDocument, RtfReader& oRead std::wstring sResTokenize = arResult[i]; size_t nTokenLen = sResTokenize.length(); - if( nTokenLen > 0 && sResTokenize[0] == '\"' && sResTokenize[nTokenLen - 1] != '\"' ) //текст в кавычках считается как один + if( nTokenLen > 0 && sResTokenize[0] == '\"' && sResTokenize[nTokenLen - 1] != '\"' ) //text in quotes is considered as one { - //ищем следующую кавычку + //search for next quote size_t nNextQuot = sField.find( '\"', nStartTokenize ); if( std::wstring::npos != nNextQuot ) { @@ -2517,7 +2517,7 @@ bool RtfFieldReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader, m_oField.m_pResult = oNewFieldInst; } - //oReader.m_oLex.putString( "}{" );//чтобы не терять после fldrslt + //oReader.m_oLex.putString( "}{" );//so as not to lose after fldrslt //{\field{\*\fldinst...}{\*\fldrslt...} ??? } //{\field{\*\fldinst...}{\*\fldrslt...}}{ ??? } } @@ -2777,7 +2777,7 @@ bool RtfOleReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader, st std::wstring sOleStorageName = NSDirectory::CreateTempFileWithUniqueName(oReader.m_sTempFolder, L"img"); - //конвертация Ole1 в Ole2 + //conversion from Ole1 to Ole2 ConvertOle1ToOle2(pData, nSize, sOleStorageName); m_oOle.SetFilename( sOleStorageName.c_str() ); @@ -2874,7 +2874,7 @@ void RtfShapeReader::ShapePropertyReader::ShapePropertyValueReader::PopState( Rt m_oShape.m_sSigSetupSuggSignerEmail = sValue; return; } - //числовые + //numeric int nValue = 0; try @@ -3398,7 +3398,7 @@ void RtfFontTableReader::ExecuteTextInternal2( RtfDocument& oDocument, RtfReader { if( oReader.m_oState->m_sCurText.empty() ) return; - //для корректного отображения названий шрифта нужно использовать данные самого шрифта + //for correct display of font names, use font data itself int nKeepGlobalCodepage = oDocument.m_oProperty.m_nAnsiCodePage; @@ -3443,7 +3443,7 @@ void RtfFontTableReader::ExecuteText(RtfDocument& oDocument, RtfReader& oReader, { sText = sText.substr(0, pos); - if( std::wstring::npos != sText.find('&') )//todooo выясниснить что значит &; + if( std::wstring::npos != sText.find('&') )//todooo find out what &; means { //sText.Remove('&'); // m_oFont.m_sName += RemoveLastUnchar(sText); @@ -3453,7 +3453,7 @@ void RtfFontTableReader::ExecuteText(RtfDocument& oDocument, RtfReader& oReader, m_oFont.m_sName += sText; } - //todooo при добавлении могут быть повторы - убрать нннадо - goldwingSetting.rtf + //todooo duplicates may occur when adding - need to remove - goldwingSetting.rtf oDocument.m_oFontTable.AddFont( m_oFont ); m_oFont.SetDefaultRtf(); @@ -3877,10 +3877,10 @@ bool RtfPictureReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader { if ( hasParameter ) { - //читаем картинку как бинарник длиной parameter + //read picture as binary with length parameter m_bBin = true; m_nBinLength = parameter; - oReader.m_oLex.ReadBytes( parameter, &m_pbBin );//читаем сразу байты, потому что если между ними и был пробел, то он пропустится в RtfLex::parseKeyword + oReader.m_oLex.ReadBytes( parameter, &m_pbBin );//read bytes immediately, because if there was a space between them, it will be skipped in RtfLex::parseKeyword } } else if ("brdrt" == sCommand) m_eInternalState = is_borderTop; @@ -4104,23 +4104,23 @@ void RtfParagraphPropDestination::EndRows(RtfReader& oReader) else break; } - //для каждого cell в row добавляем их свойства + //for each cell in row add their properties for( int i = 0; i < oNewTableRow->GetCount() && i < oNewTableRow->m_oProperty.GetCount() ; i++ ) { oNewTableRow->operator [](i)->m_oProperty = oNewTableRow->m_oProperty[i]; } - //Добавляем временный row + //Add temporary row aRows.push_back( oNewTableRow ); aRowItaps.push_back( nCurItap ); } void RtfParagraphPropDestination::AddItem( RtfParagraphPtr oItem, RtfReader& oReader, bool bEndCell, bool bEndRow ) { - // 1 != oItem->m_oProperty.m_bInTable - параграф не в таблице - // PROP_DEF != nTargetItap && oItem->m_oProperty.m_nItap <= nTargetItap - выставлено свойство,что вложенность - nTargetItap - это не таблица( Нужно для чтения параграфов в таблицах ) - if ( ( 1 != oItem->m_oProperty.m_bInTable || 0 == oItem->m_oProperty.m_nItap ) //Платежное_поручение.rtf + // 1 != oItem->m_oProperty.m_bInTable - paragraph not in table + // PROP_DEF != nTargetItap && oItem->m_oProperty.m_nItap <= nTargetItap - property is set that nesting level nTargetItap is not a table (Needed for reading paragraphs in tables) + if ( ( 1 != oItem->m_oProperty.m_bInTable || 0 == oItem->m_oProperty.m_nItap ) //PaymentOrder.rtf || ( PROP_DEF != nTargetItap && oItem->m_oProperty.m_nItap <= nTargetItap ) ) { - if ( nCurItap > 0 ) //Если до этого были только параграфы в таблицах - завершаем таблицу + if ( nCurItap > 0 ) //If there were only paragraphs in tables before - finish the table { if (bEndRow) EndRows(oReader); @@ -4137,9 +4137,9 @@ void RtfParagraphPropDestination::AddItem( RtfParagraphPtr oItem, RtfReader& oRe aRows.erase(aRows.begin() + k); aRowItaps.erase(aRowItaps.begin() + k); } - //вычисляем свойства для OOX + //calculate properties for OOX oNewTable->CalculateGridProp(); - //удаляем временные единицы + //remove temporary units aCellRenderables.clear(); aItaps.clear(); aCells.clear(); @@ -4147,7 +4147,7 @@ void RtfParagraphPropDestination::AddItem( RtfParagraphPtr oItem, RtfReader& oRe aRows.clear(); aRowItaps.clear(); - //добавляем таблицу + //add table m_oTextItems->AddItem( oNewTable ); if (oReader.m_convertationManager) @@ -4155,18 +4155,18 @@ void RtfParagraphPropDestination::AddItem( RtfParagraphPtr oItem, RtfReader& oRe oReader.m_convertationManager->OnCompleteItemRtf(); } } - //добавляем параграф + //add paragraph m_oTextItems->AddItem( oItem ); if (oReader.m_convertationManager) { oReader.m_convertationManager->OnCompleteItemRtf(); } - //запоминаем nCurItap + //remember nCurItap nCurItap = oItem->m_oProperty.m_nItap; } else { - //если вложенность текущего параграфа меньше - завершаем внутреннюю таблицу + //if current paragraph nesting is less - finish inner table if ( nCurItap > oItem->m_oProperty.m_nItap ) { RtfTablePtr oNewTable ( new RtfTable() ); @@ -4182,9 +4182,9 @@ void RtfParagraphPropDestination::AddItem( RtfParagraphPtr oItem, RtfReader& oRe aRows.erase(aRows.begin() + k); aRowItaps.erase(aRowItaps.begin() + k); } - //вычисляем свойства для OOX + //calculate properties for OOX oNewTable->CalculateGridProp(); - //добавляем таблицу + //add table aCellRenderables.push_back( oNewTable ); aItaps.push_back( oItem->m_oProperty.m_nItap ); } @@ -4196,9 +4196,9 @@ void RtfParagraphPropDestination::AddItem( RtfParagraphPtr oItem, RtfReader& oRe } else { - //добавляем параграф во временные cell - aCellRenderables.push_back( oItem ); //содержит все параграфы, не разложенные по cell - aItaps.push_back( nCurItap ); //содержит все номера вложенности параграфов + //add paragraph to temporary cell + aCellRenderables.push_back( oItem ); //contains all paragraphs not distributed to cells + aItaps.push_back( nCurItap ); //contains all paragraph nesting levels if ( bEndCell ) { @@ -4224,7 +4224,7 @@ void RtfParagraphPropDestination::AddItem( RtfParagraphPtr oItem, RtfReader& oRe } void RtfParagraphPropDestination::Finalize( RtfReader& oReader/*, RtfSectionPtr pSection*/) { - if ( false == m_bPar && m_oCurParagraph->IsValid())// потому что это не reader и нужно как-то загонять последний параграф + if ( false == m_bPar && m_oCurParagraph->IsValid())// because this is not a reader and we need to somehow push the last paragraph { m_oCurParagraph->m_oProperty = oReader.m_oState->m_oParagraphProp; //m_oCurParagraph->m_oProperty.m_pSection = pSection; @@ -4233,7 +4233,7 @@ void RtfParagraphPropDestination::Finalize( RtfReader& oReader/*, RtfSectionPtr *m_oCurParagraph->m_oOldList = oReader.m_oState->m_oCurOldList; m_oCurParagraph->m_oProperty.m_oCharProperty = oReader.m_oState->m_oCharProp; - m_oCurParagraph->m_oProperty.m_bInTable = PROP_DEF; // поле (гиперссылка) в таблице + m_oCurParagraph->m_oProperty.m_bInTable = PROP_DEF; // field (hyperlink) in table AddItem( m_oCurParagraph, oReader, false, false ); m_oCurParagraph = RtfParagraphPtr(new RtfParagraph()); @@ -4279,14 +4279,14 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead } else if ( "cell" == sCommand || "nestcell" == sCommand ) { - //пример п 9 п 12.rtf + //example p 9 p 12.rtf //XXT_RV_VNP.rtf if (oReader.m_oState->m_oParagraphProp.m_bInTable == PROP_DEF) oReader.m_oState->m_oParagraphProp.m_bInTable = 1; if (oReader.m_oState->m_oParagraphProp.m_nItap == PROP_DEF) oReader.m_oState->m_oParagraphProp.m_nItap = 1; - if (oReader.m_oState->m_oParagraphProp.m_bInTable == 1 && 0 == oReader.m_oState->m_oParagraphProp.m_nItap )//Платежное_поручение.rtf (ели по другому сбойная строка заменяется параграфами + if (oReader.m_oState->m_oParagraphProp.m_bInTable == 1 && 0 == oReader.m_oState->m_oParagraphProp.m_nItap )//PaymentOrder.rtf (otherwise the corrupt row is replaced by paragraphs oReader.m_oState->m_oParagraphProp.m_nItap = 1; m_oCurParagraph->m_oProperty = oReader.m_oState->m_oParagraphProp; @@ -4339,7 +4339,7 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead } else if ( "pntext" == sCommand ) { - //пропускаем списки office 95, если есть списки office 2007 + //skip office 95 lists if office 2007 lists exist if ( oDocument.m_oListTable.GetCount() > 0 ) oAbstrReader.Skip( oDocument, oReader ); else @@ -4387,7 +4387,7 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead } COMMAND_RTF_INT ( "uc", oReader.m_oState->m_nUnicodeClean, sCommand, hasParameter, parameter) - //Tab todoooo перенести в ParagrProps (trackchanges) + //Tab todoooo move to ParagrProps (trackchanges) COMMAND_RTF_INT ( "tldot", m_oCurTab.m_eLeader, sCommand, true, RtfTab::tl_dot ) COMMAND_RTF_INT ( "tlmdot", m_oCurTab.m_eLeader, sCommand, true, RtfTab::tl_mdot ) COMMAND_RTF_INT ( "tlhyph", m_oCurTab.m_eLeader, sCommand, true, RtfTab::tl_hyph ) @@ -4741,8 +4741,8 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead pNewChar->m_oProperty = oReader.m_oState->m_oCharProp; m_oCurParagraph->AddItem( pNewChar ); //Microsoft (Demo-Hayden-Management-v2).docx - //после разрыва могут быть и графические элементы .. их надо оставить в ЭТОМ же параграфе - //разрыв страницы со следующего параграфа .. + //after break there may be graphic elements too .. they need to stay in THIS paragraph + //page break from the next paragraph .. //m_oCurParagraph->m_oProperty = oReader.m_oState->m_oParagraphProp; //m_oCurParagraph->m_oOldList ( new RtfOldList() ); //*m_oCurParagraph->m_oOldList = oReader.m_oState->m_oCurOldList; @@ -5313,17 +5313,17 @@ void RtfStyleTableReader::RtfStyleReader::ExitReader(RtfDocument& oDocument, Rtf m_oCurTableStyle->m_oParProp = oReader.m_oState->m_oParagraphProp; if( PROP_DEF == m_oCurTableStyle->m_oParProp.m_nSpaceBetween ) - m_oCurTableStyle->m_oParProp.m_nSpaceBetween = 240;//интервал - единичный + m_oCurTableStyle->m_oParProp.m_nSpaceBetween = 240;//single spacing m_oCurTableStyle->m_oTableProp = oReader.m_oState->m_oRowProperty; m_oCurTableStyle->m_oRowProp = oReader.m_oState->m_oRowProperty; //m_oCurTableStyle->m_oTableStyleProperty = m_oTableStyleProperty; - //надо определить базовый это стиль или например firstRow + //need to determine if this is base style or for example firstRow RtfStylePtr oStyle; if( true == oDocument.m_oStyleTable.GetStyle(m_oCurTableStyle->m_nID, oStyle) ) { if( oStyle->m_eType == RtfStyle::stTable ) - {//определяем какой это conditionalFormating + {//determine which conditionalFormatting this is RtfTableStylePtr oStyleTable = boost::static_pointer_cast<RtfTableStyle, RtfStyle>(oStyle); if( 1 == m_oCurTableStyle->m_oParProp.m_bStyleFirstRow ) oStyleTable->m_oFirstRow = m_oCurTableStyle; @@ -5424,7 +5424,7 @@ bool RtfListTableReader::ListReader::ListLevelReader::ExecuteCommand(RtfDocument } void RtfListTableReader::ListReader::ListLevelReader::ExitReader( RtfDocument& oDocument, RtfReader& oReader ) { - //убираем shading и border (word тоже так делает) + //remove shading and border (word also does this) m_oListLevelProp.m_oCharProp.m_poBorder.SetDefaultRtf(); m_oListLevelProp.m_oCharProp.m_poShading.SetDefaultRtf(); @@ -5538,7 +5538,7 @@ bool RtfListOverrideTableReader::ListOverrideReader::lfolevelReader::ExecuteComm COMMAND_RTF_INT( "listoverrideformat", m_oOverrideLevel.m_nLevelIndex, sCommand, hasParameter, parameter ) else if( "listoverridestartat" == sCommand ) { - m_oOverrideLevel.m_nStart = 0; //индикатор + m_oOverrideLevel.m_nStart = 0; //indicator if( true == hasParameter ) m_oOverrideLevel.m_nStart = parameter; } diff --git a/RtfFile/Format/DestinationCommand.h b/RtfFile/Format/DestinationCommand.h index e9ad39516d..cfd4f60ef0 100644 --- a/RtfFile/Format/DestinationCommand.h +++ b/RtfFile/Format/DestinationCommand.h @@ -69,7 +69,7 @@ pNewChar->m_oProperty = oReader.m_oState->m_oCharProp;\ target->AddItem( pNewChar );\ } -//Command не имеет состояний +//Command has no states #include "math.h" class RtfBorderCommand @@ -127,7 +127,7 @@ class RtfCharPropsCommand { public: static bool ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader, std::string sCommand, bool hasParameter, int parameter, RtfCharProperty * props, bool bLookOnBorder = true); - //bool bLookOnBorder; Надо ли читать свойства border( актуально для ParagraphReader ) + //bool bLookOnBorder; Whether to read border properties (relevant for ParagraphReader) }; class RtfParagraphPropsCommand @@ -256,7 +256,7 @@ public: class RtfPictureReader : public RtfAbstractReader { - class PLACEABLEMETAHEADER //заголовок для wmf из rtf ( в rtf wmf не содержит размеров картинки ) + class PLACEABLEMETAHEADER //header for wmf from rtf (in rtf wmf doesn't contain image dimensions) { public: DWORD Key; /* Magic number (always 9AC6CDD7h) */ @@ -283,7 +283,7 @@ public: is_borderCellLeft, is_borderCellTop, is_borderCellRight, is_borderCellBottom, is_borderCellLR, is_borderCellRL, is_borderRowLeft, is_borderRowTop, is_borderRowRight, is_borderRowBottom, is_borderRowVer, is_borderRowHor }; - //только для определения бордера + //only for border detection private: _InternalState m_eInternalState; private: @@ -329,7 +329,7 @@ private: enum _InternalState{ is_normal,is_charBorder, is_borderTop, is_borderLeft, is_borderBottom, is_borderRight, is_borderBox, is_borderBar, is_borderCellLeft,is_borderCellTop,is_borderCellRight,is_borderCellBottom,is_borderCellLR,is_borderCellRL, is_borderRowLeft,is_borderRowTop,is_borderRowRight,is_borderRowBottom,is_borderRowVer,is_borderRowHor} ; - //только для определения бордеров + //only for borders detection _InternalState m_eInternalState; @@ -394,7 +394,7 @@ class RtfShapeGroupReader : public RtfShapeReader { public: RtfShape& m_oShapeGroup; - bool m_bHeader; //чтобы отличать заголовок от вложенных групп + bool m_bHeader; //to distinguish header from nested groups RtfShapeGroupReader( RtfShape& oShape ); @@ -514,35 +514,35 @@ public: }; class FootnoteReader; -//Destination имеет состояния -class RtfParagraphPropDestination // todo - последний параграф не обрабатывается +//Destination has states +class RtfParagraphPropDestination // todo - last paragraph is not processed { public: enum _InternalState{ is_normal,is_charBorder, is_borderTop, is_borderLeft, is_borderBottom, is_borderRight, is_borderBox, is_borderBar, is_borderCellLeft,is_borderCellTop,is_borderCellRight,is_borderCellBottom,is_borderCellLR,is_borderCellRL, is_borderRowLeft,is_borderRowTop,is_borderRowRight,is_borderRowBottom,is_borderRowVer,is_borderRowHor} ; - //только для определения бордера + //only for border detection private: _InternalState m_eInternalState; RtfParagraphPtr m_oCurParagraph; - //реальные параграфы и таблицы + //real paragraphs and tables std::vector< ITextItemPtr > aCellRenderables; - std::vector< int > aItaps; //вложенность параграфов + std::vector< int > aItaps; //nesting level of paragraphs std::vector< RtfTableCellPtr > aCells; - std::vector< int > aCellItaps; //вложенность cell + std::vector< int > aCellItaps; //nesting level of cell std::vector< RtfTableRowPtr > aRows; - std::vector< int > aRowItaps; //вложенность row + std::vector< int > aRowItaps; //nesting level of row RtfRowProperty oCurRowProperty; RtfReader* m_oReader; public: - bool m_bPar; // если последняя команда была par, то не надо добавлять параграф - TextItemContainerPtr m_oTextItems; //для разбивки на TextItem + bool m_bPar; // if last command was par, no need to add paragraph + TextItemContainerPtr m_oTextItems; //for splitting into TextItem RtfTab m_oCurTab; - int nTargetItap; //уровень который считается не таблицей ( для того чтобы читать параграфы в таблицах ) + int nTargetItap; //level considered non-table (to read paragraphs in tables) int nCurItap; RtfParagraphPropDestination( ); @@ -710,7 +710,7 @@ class RtfStyleTableReader: public RtfAbstractReader { class RtfStyleReader: public RtfAbstractReader { - //только для определения бордеров + //only for borders detection private: enum _InternalState{ is_normal, is_tsbrdrt, is_tsbrdrb, is_tsbrdrl, is_tsbrdrr, is_tsbrdrh, is_tsbrdrv } InternalState; diff --git a/RtfFile/Format/Ole1FormatReader.cpp b/RtfFile/Format/Ole1FormatReader.cpp index 2804af5649..72e5703e44 100644 --- a/RtfFile/Format/Ole1FormatReader.cpp +++ b/RtfFile/Format/Ole1FormatReader.cpp @@ -382,7 +382,7 @@ void Ole1FormatReaderWriter::Read(BYTE *pData, int Size) if (stream.IsEof()) return; - // далее графическое представление + // followed by graphic representation OtherDataSize = stream.CanReadWrite(); OtherData = new BYTE[OtherDataSize]; @@ -408,7 +408,7 @@ void Ole1FormatReaderWriter::Write(BYTE *pData, int &Size) stream.WriteBytes(NativeData, NativeDataSize); - /// далее графическое представление + /// followed by graphic representation BYTE other[9] = {1, 5, 0, 0, 0, 0, 0, 0, 0}; Size = stream.Tell() - 1; diff --git a/RtfFile/Format/RtfChar.cpp b/RtfFile/Format/RtfChar.cpp index daf1774fb0..32bebdbf44 100644 --- a/RtfFile/Format/RtfChar.cpp +++ b/RtfFile/Format/RtfChar.cpp @@ -187,7 +187,7 @@ std::wstring RtfChar::RenderToOOX(RenderParameter oRenderParameter) sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + XmlUtils::EncodeXmlString(sAuthor) + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">"; m_oProperty.m_nDeleted = PROP_DEF; } - sResult += m_oProperty.RenderToOOX(oRenderParameter);//w:rPr внутри + sResult += m_oProperty.RenderToOOX(oRenderParameter);//w:rPr inside sResult += renderTextToXML( L"Math" ); if (bDelete)sResult += L"</w:del>"; @@ -238,8 +238,8 @@ std::wstring RtfChar::renderRtfText( std::wstring& sText, void* poDocument, RtfC if (oCharProperty) iFont = oCharProperty->m_nFont; int nCodePage = -1; - //применяем параметры codepage от текущего шрифта todo associated fonts. - //todooo разобраться со шрифтами и их подбором + //apply codepage parameters from the current font todo associated fonts. + //todooo figure out fonts and their selection RtfFont oFont; if( NULL != oCharProperty && true == pDocument->m_oFontTable.GetFont( oCharProperty->m_nFont, oFont ) ) { @@ -280,7 +280,7 @@ std::wstring RtfChar::renderRtfText( std::wstring& sText, void* poDocument, int { return sResult; } - //от настроек документа + //from document settings if( -1 == nCodePage && RtfDocumentProperty::cp_none != pDocument->m_oProperty.m_eCodePage ) { switch ( pDocument->m_oProperty.m_eCodePage ) @@ -298,7 +298,7 @@ std::wstring RtfChar::renderRtfText( std::wstring& sText, void* poDocument, int case RtfDocumentProperty::cp_pca: nCodePage = 850; break; } } - //если ничего нет ставим ANSI или default from user + //if nothing else, set ANSI or default from user if( -1 == nCodePage ) { nCodePage = CP_ACP; @@ -490,7 +490,7 @@ std::wstring RtfCharSpecial::RenderToRtf(RenderParameter oRenderParameter) } if( PROP_DEF != m_nTextWrapBreak ) sResult += L"\\par"; - //switch ( m_nTextWrapBreak ) //не воспринимается word + //switch ( m_nTextWrapBreak ) //not recognized by Word //{ // case 0: sResult += L"\\lbr0";break; // case 1: sResult += L"\\lbr1";break; diff --git a/RtfFile/Format/RtfDocument.h b/RtfFile/Format/RtfDocument.h index 5863588864..68db3918ec 100644 --- a/RtfFile/Format/RtfDocument.h +++ b/RtfFile/Format/RtfDocument.h @@ -82,7 +82,7 @@ public: TextItemContainerPtr m_oEndnoteSep; TextItemContainerPtr m_oEndnoteCon; -//для того чтобы конвертировать старый формат List в Numbering +//to convert old List format to Numbering std::vector<RtfOldListPtr> m_aOldLists; NSFonts::IApplicationFonts* m_pAppFonts; diff --git a/RtfFile/Format/RtfField.cpp b/RtfFile/Format/RtfField.cpp index 91957d461d..1a1af98523 100644 --- a/RtfFile/Format/RtfField.cpp +++ b/RtfFile/Format/RtfField.cpp @@ -302,7 +302,7 @@ std::wstring RtfField::RenderToOOX(RenderParameter oRenderParameter) sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + XmlUtils::EncodeXmlString(sAuthor) + L"\" w:id=\"" + std::to_wstring(pOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">"; m_pInsert->m_oCharProperty.m_nDeleted = PROP_DEF; } - //поверяем на наличие гиперссылки + //check for hyperlink RenderParameter oNewParam = oRenderParameter; oNewParam.nType = RENDER_TO_OOX_PARAM_PLAIN; @@ -320,16 +320,16 @@ std::wstring RtfField::RenderToOOX(RenderParameter oRenderParameter) sHyperlink = sHyperlink.substr(0, nSplash); } - //оставляем только одну ссылку + //keep only one link XmlUtils::replace_all(sHyperlink, L"\"", L"" ); boost::algorithm::trim(sHyperlink); - //заменяем пробелы на %20 + //replace spaces with %20 XmlUtils::replace_all(sHyperlink, L" ", L"%20" ); - //добавляем в rels + //add to rels OOXRelsWriter* poRelsWriter = static_cast<OOXRelsWriter*>( oRenderParameter.poRels ); std::wstring sId = poRelsWriter->AddRelationship( L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink", XmlUtils::EncodeXmlString( sHyperlink ), false ); - //добавляем гиперссылку в документ + //add hyperlink to document sResult += L"<w:hyperlink r:id=\"" + sId + L"\" >"; oNewParam.nType = RENDER_TO_OOX_PARAM_RUN; @@ -360,7 +360,7 @@ std::wstring RtfField::RenderToOOX(RenderParameter oRenderParameter) std::wstring props = m_pResult->m_oCharProperty.RenderToOOX(oRenderParameter); if (!props.empty()) props = L"<w:rPr>" + props + L"</w:rPr>"; - //начинаем Field + //start Field sResult += L"<w:r>"; if (!props.empty()) sResult += props; @@ -438,11 +438,11 @@ std::wstring RtfField::RenderToOOX(RenderParameter oRenderParameter) } } oNewParametr = oRenderParameter; - // разделитель + // separator sResult += L"<w:r>"; sResult += L"<w:fldChar w:fldCharType=\"separate\"/></w:r>"; - //пишем содержание-кэш + //write content-cache if ((m_pResult->m_pTextItems) && (m_pResult->m_pTextItems->GetCount() > 0)) { sResult += m_pResult->m_pTextItems->m_aArray[0]->RenderToOOX(oNewParametr); @@ -475,7 +475,7 @@ std::wstring RtfField::RenderToOOX(RenderParameter oRenderParameter) sResult += L"</w:r>"; } - //заканчиваем Field + //end Field sResult += L"<w:r>"; if (!props.empty()) sResult += props; diff --git a/RtfFile/Format/RtfGlobalTables.cpp b/RtfFile/Format/RtfGlobalTables.cpp index c04ba80f21..16c26614f9 100644 --- a/RtfFile/Format/RtfGlobalTables.cpp +++ b/RtfFile/Format/RtfGlobalTables.cpp @@ -83,7 +83,7 @@ std::wstring RtfFontTable::RenderToOOX(RenderParameter oRenderParameter) } std::wstring RtfFontTable::RenderToRtf(RenderParameter oRenderParameter) { - ////записывает default charset и codepage + ////writes default charset and codepage //RtfDocument* poDocument = static_cast<RtfDocument*>( oRenderParameter.poDocument ); //if( PROP_DEF != poDocument->m_oProperty.m_nAnsiCodePage ) //{ @@ -237,7 +237,7 @@ RtfStylePtr RtfStyleTable::GetStyleResulting( RtfStylePtr oInputStyle ) { eStyleType = RtfStyle::stParagraph; oResultStyle = RtfParagraphStylePtr( new RtfParagraphStyle() ); - nLinked = oInputStyle->m_nLink;//linked будем смотреть только у стилей параграфа, чтобы избежать рекурсии + nLinked = oInputStyle->m_nLink;//linked will only be checked for paragraph styles to avoid recursion } else if( RtfStyle::stTable == oInputStyle->m_eType ) { @@ -245,7 +245,7 @@ RtfStylePtr RtfStyleTable::GetStyleResulting( RtfStylePtr oInputStyle ) oResultStyle = RtfTableStylePtr( new RtfTableStyle() ); } else - return oInputStyle; //ОПАСНО .. потом может другим затереться todooo + return oInputStyle; //DANGEROUS.. can be overwritten by other later todooo RtfStylePtr oLinkedStyle; //if( PROP_DEF != nLinked && nStyleId != nLinked) @@ -262,7 +262,7 @@ RtfStylePtr RtfStyleTable::GetStyleResulting( RtfStylePtr oInputStyle ) oBaseStyle = GetStyleResulting( oTemStyle ); } - //Опытным путем установлено - Base старше Link + //Experimentally established - Base is older than Link if( NULL != oLinkedStyle ) { oResultStyle->Merge( oLinkedStyle ); diff --git a/RtfFile/Format/RtfLex.cpp b/RtfFile/Format/RtfLex.cpp index 94e524a9c3..c6cf99b506 100644 --- a/RtfFile/Format/RtfLex.cpp +++ b/RtfFile/Format/RtfLex.cpp @@ -93,23 +93,23 @@ int StringStream::getc() } void StringStream::ungetc() { - //в проекте используется ungetcб только после getc - //поэтому проблем с выходом в 0 нет + //in the project ungetc is used only after getc + //so there are no problems with reaching 0 //if( m_nPosAbs + 2 < m_nSizeAbs ) { - m_nPosAbs--; //взять любой txt переименовать в rtf - зацикливание + m_nPosAbs--; //take any txt rename to rtf - infinite loop } } void StringStream::putString( std::string sText ) { size_t nExtBufSize = sText.length(); - //копируем буфер в темповый буфер + //copy buffer to temp buffer unsigned char* aTempBuf = new unsigned char[ m_nSizeAbs ]; memcpy( aTempBuf, m_aBuffer, m_nSizeAbs ); - //создаем новый буфер большего размера + //create new buffer with larger size RELEASEARRAYOBJECTS( m_aBuffer ); m_aBuffer = new unsigned char[ m_nSizeAbs + nExtBufSize ]; - //копируем все в новый буфер + //copy everything to new buffer unsigned long nDelimiter = (unsigned long)m_nPosAbs + 1; memcpy( m_aBuffer, aTempBuf, nDelimiter ); memcpy( m_aBuffer + nDelimiter , sText.c_str(), nExtBufSize ); @@ -131,7 +131,7 @@ LONG64 StringStream::getSize() RtfLex::RtfLex() { m_oFileWriter = NULL; - m_nReadBufSize = 1024 * 1024 * 5; // 5мб + m_nReadBufSize = 1024 * 1024 * 5; // 5MB m_caReadBuffer = new char[m_nReadBufSize]; } RtfLex::~RtfLex() @@ -262,7 +262,7 @@ void RtfLex::parseKeyword(RtfToken& token) token.HasParameter = true; int nCharCode = RtfUtility::ToByte( m_oStream.getc() ) << 4; nCharCode |= RtfUtility::ToByte( m_oStream.getc() ); - if( nCharCode >= 0 && nCharCode <=30 )//искуственно сидвигаем на 1 чтобы не потерять \'00 ( символов от 0 до 0x20 служебные) + if( nCharCode >= 0 && nCharCode <=30 )//artificially shift by 1 to not lose \'00 (characters from 0 to 0x20 are service characters) nCharCode++; token.Parameter = nCharCode; } @@ -347,10 +347,10 @@ void RtfLex::parseKeyword(RtfToken& token) } void RtfLex::parseText(int car, RtfToken& token) { - int nTempBufPos = 0; //1 мб + int nTempBufPos = 0; //1 MB int c = car; - //while ((isalnum(c) || c == '"'|| c == ':'|| c == '/' || c == '.') &&c != '\\' && c != '}' && c != '{' && c != Eof) // иправиЃEЃEрвьD усЃEвиЃE + //while ((isalnum(c) || c == '"'|| c == ':'|| c == '/' || c == '.') &&c != '\\' && c != '}' && c != '{' && c != Eof) // (corrupted comment removed) //while (c != '\\' && c != '}' && c != '{' && c != Eof) //while (c != ';' &&c ! = '\\' && c != '}' && c != '{' && c != EOF) while (c != '\\' && c != '}' && c != '{' && c != EOF) diff --git a/RtfFile/Format/RtfLex.h b/RtfFile/Format/RtfLex.h index 40bd5ba364..9edf9a9453 100644 --- a/RtfFile/Format/RtfLex.h +++ b/RtfFile/Format/RtfLex.h @@ -38,8 +38,8 @@ class StringStream { private: - LONG64 m_nSizeAbs;//размер файла - LONG64 m_nPosAbs;//позиция в файле + LONG64 m_nSizeAbs;//file size + LONG64 m_nPosAbs;//position in file unsigned char* m_aBuffer; diff --git a/RtfFile/Format/RtfMath.cpp b/RtfFile/Format/RtfMath.cpp index c752b46c1e..b4a2888a00 100644 --- a/RtfFile/Format/RtfMath.cpp +++ b/RtfFile/Format/RtfMath.cpp @@ -75,7 +75,7 @@ bool RtfMath::IsRtfControlPropertyBool( std::string sControl ) int mc_nRtfControlWordsSize = sizeof( mc_aRtfControlWords ) / sizeof( char* ); - //можно бинарный поиск вставить + //binary search can be inserted here for( int i = 0; i < mc_nRtfControlWordsSize; i++ ) if( mc_aRtfControlWords[ i ] == sControl ) return true; @@ -90,7 +90,7 @@ bool RtfMath::IsRtfControlProperty( std::string sControl ) int mc_nRtfControlWordsSize = sizeof( mc_aRtfControlWords ) / sizeof( char* ); - //можно бинарный поиск вставить + //binary search can be inserted here for( int i = 0; i < mc_nRtfControlWordsSize; i++ ) { if( mc_aRtfControlWords[ i ] == sControl ) @@ -110,7 +110,7 @@ bool RtfMath::IsRtfControlWord( std::string sControl ) int mc_nRtfControlWordsSize = sizeof( mc_aRtfControlWords ) / sizeof( char* ); - //можно бинарный поиск вставить + //binary search can be inserted here for( int i = 0; i < mc_nRtfControlWordsSize; i++ ) { if( mc_aRtfControlWords[ i ] == sControl ) @@ -223,7 +223,7 @@ std::wstring RtfMath::RenderToOOX(RenderParameter oRenderParameter) sResult += L"</" + wsOOXName + L">"; -//альтернативная картинка +//alternative picture // if( NULL != m_oPicture ) // sResult += m_oPicture->RenderToOOX(oRenderParameter); diff --git a/RtfFile/Format/RtfMath.h b/RtfFile/Format/RtfMath.h index 4d8dc21b1d..cdc4c469c9 100644 --- a/RtfFile/Format/RtfMath.h +++ b/RtfFile/Format/RtfMath.h @@ -42,7 +42,7 @@ public: std::string m_sRtfName; std::string m_sOOXName; - bool m_bHeader; //чтобы отличать заголовок от вложенных групп + bool m_bHeader; //to distinguish header from nested groups bool m_bIsVal = false; bool m_bIsChar = false; // for write diff --git a/RtfFile/Format/RtfOldList.cpp b/RtfFile/Format/RtfOldList.cpp index 469b5e0f58..1349f5fad4 100644 --- a/RtfFile/Format/RtfOldList.cpp +++ b/RtfFile/Format/RtfOldList.cpp @@ -48,7 +48,7 @@ std::wstring RtfOldList::RenderToOOX(RenderParameter oRenderParameter) { std::wstring sResult; if( true == CanConvertToNumbering() ) - {//сохраняем как список + {//save as list if( RENDER_TO_OOX_PARAM_OLDLIST_ABS == oRenderParameter.nType ) { std::wstring sCharProp = m_oLevelText->m_oProperty.m_oCharProperty.RenderToOOX( oRenderParameter ); diff --git a/RtfFile/Format/RtfOle.cpp b/RtfFile/Format/RtfOle.cpp index 5980582d07..ebec27b58d 100644 --- a/RtfFile/Format/RtfOle.cpp +++ b/RtfFile/Format/RtfOle.cpp @@ -71,7 +71,7 @@ std::wstring RtfOle::RenderToOOX(RenderParameter oRenderParameter) { RtfCharProperty * pCharProps = &m_oCharProperty; //------------------------------------------ -// todooo общая часть с RtfChar +// todooo common part with RtfChar bool bInsert = false; bool bDelete = false; diff --git a/RtfFile/Format/RtfOle.h b/RtfFile/Format/RtfOle.h index da8b1d3126..c2d36c5edf 100644 --- a/RtfFile/Format/RtfOle.h +++ b/RtfFile/Format/RtfOle.h @@ -50,7 +50,7 @@ public: std::pair<boost::shared_array<unsigned char>, size_t> m_oOle1Data; - RtfCharProperty m_oCharProperty; // тут могут быть track changes .... + RtfCharProperty m_oCharProperty; // track changes can be here.... RtfOle(); ~RtfOle(); diff --git a/RtfFile/Format/RtfParagraph.cpp b/RtfFile/Format/RtfParagraph.cpp index cfc76a836b..210ab37dfd 100644 --- a/RtfFile/Format/RtfParagraph.cpp +++ b/RtfFile/Format/RtfParagraph.cpp @@ -56,7 +56,7 @@ int RtfParagraph::AddItem( IDocumentElementPtr piRend ) if( TYPE_RTF_CHAR == piRend->GetType() ) { - if( m_aArray.size() > 0 && TYPE_RTF_CHAR == m_aArray[ m_aArray.size() - 1 ]->GetType() )//соединяем два текста с одинаковыми свойствами + if( m_aArray.size() > 0 && TYPE_RTF_CHAR == m_aArray[ m_aArray.size() - 1 ]->GetType() )//merge two texts with identical properties { RtfCharPtr oCurChar = boost::static_pointer_cast<RtfChar,IDocumentElement>( piRend ); RtfCharPtr oPrevChar = boost::static_pointer_cast<RtfChar,IDocumentElement>( m_aArray[ m_aArray.size() - 1 ] ); @@ -184,7 +184,7 @@ std::wstring RtfParagraph::RenderToOOX(RenderParameter oRenderParameter) if( NULL != m_oOldList ) { - //для OldList + //for OldList if( true == bCanConvertToNumbering ) sResult += m_oOldList->RenderToOOX( oRenderParameter ); } @@ -192,7 +192,7 @@ std::wstring RtfParagraph::RenderToOOX(RenderParameter oRenderParameter) if( NULL != m_oOldList) { - //для OldList + //for OldList if( false == bCanConvertToNumbering && NULL != m_oOldList->m_oText) { RtfCharProperty oCharProp = m_oProperty.m_oCharProperty; diff --git a/RtfFile/Format/RtfParagraph.h b/RtfFile/Format/RtfParagraph.h index 666f154ec5..1542b6d466 100644 --- a/RtfFile/Format/RtfParagraph.h +++ b/RtfFile/Format/RtfParagraph.h @@ -46,12 +46,12 @@ public: int m_nLevelType; _LevelJust m_eLevelJust; - RtfParagraphPtr m_oLevelText; //фомат текста списка + RtfParagraphPtr m_oLevelText; //list text format int m_nLs; int m_nIlvl; - RtfParagraphPtr m_oText; //замещающий текст + RtfParagraphPtr m_oText; //replacement text RtfOldList() { diff --git a/RtfFile/Format/RtfPicture.cpp b/RtfFile/Format/RtfPicture.cpp index 9c32d0be25..7dd39474a8 100644 --- a/RtfFile/Format/RtfPicture.cpp +++ b/RtfFile/Format/RtfPicture.cpp @@ -83,7 +83,7 @@ void RtfPicture::SetDefault() m_sPicFilename = L""; } -std::wstring RtfPicture::GenerateWMF(RenderParameter oRenderParameter) //копия растра в векторе +std::wstring RtfPicture::GenerateWMF(RenderParameter oRenderParameter) //copy of raster in vector { std::wstring sResult; sResult += L"{\\pict"; @@ -105,11 +105,11 @@ std::wstring RtfPicture::GenerateWMF(RenderParameter oRenderParameter) //коп sResult += L" "; - //сохраняем в темповую директорию и загружаем файл как текст + //save to temp directory and load file as text RtfWriter * poWriter = static_cast<RtfWriter*>( oRenderParameter.poWriter ); //IUnknown* piTempPict = NULL; - //todooo ??? переписать + //todooo ??? rewrite //if( true == LoadPicture( &piTempPict, m_sPicFilename ) ) //{ // std::wstring sTempFile = Utils::CreateTempFile( poWriter->m_sTempFolder ); diff --git a/RtfFile/Format/RtfPicture.h b/RtfFile/Format/RtfPicture.h index 89a41eae51..f699bd0d76 100644 --- a/RtfFile/Format/RtfPicture.h +++ b/RtfFile/Format/RtfPicture.h @@ -60,8 +60,8 @@ public: RtfBorder m_oBorderBottom; RtfBorder m_oBorderRight; - bool m_bIsCopy; // true - надо удалять m_sPicFilename, false - не надо удалять - std::wstring m_sPicFilename; //всегда содержит имя картинки, тип которой поддерживает rtf + bool m_bIsCopy; // true - need to delete m_sPicFilename, false - do not delete + std::wstring m_sPicFilename; //always contains the image name whose type is supported by rtf std::vector<std::wstring> m_aTempFiles; diff --git a/RtfFile/Format/RtfProperty.cpp b/RtfFile/Format/RtfProperty.cpp index cbe266f97d..72e7adde15 100644 --- a/RtfFile/Format/RtfProperty.cpp +++ b/RtfFile/Format/RtfProperty.cpp @@ -292,7 +292,7 @@ std::wstring RtfFont::RenderToOOX(RenderParameter oRenderParameter) { sHint = L" w:hint=\"cs\""; }break; - //?? нужно ли описывать default??? todooo + //?? should we describe default??? todooo default: break; } @@ -553,7 +553,7 @@ RtfColor RtfColor::GetColorByPreset( std::wstring oStr ) return RtfColor(0,0,0); } -std::wstring RtfColor::GetPresetByColor( RtfColor oCol ) //стр. 3320 +std::wstring RtfColor::GetPresetByColor( RtfColor oCol ) //page 3320 { if ( oCol == RtfColor(240,248,255)) return L"aliceBlue"; else if ( oCol == RtfColor(250,235,215)) return L"aniqueWhite"; @@ -986,7 +986,7 @@ void RtfShading::SetDefault( ) } void RtfShading::Merge( RtfShading& oParPr ) { - //свойство должно быть как единое целое, поэтому если oBorPr задано, то переписыватся целиком + //property should be treated as a whole, so if oBorPr is set, it gets overwritten completely if ( st_none != oParPr.m_eType || PROP_DEF != oParPr.m_nValue || PROP_DEF != oParPr.m_nForeColor || PROP_DEF != oParPr.m_nBackColor ) { m_eType = oParPr.m_eType; @@ -1119,7 +1119,7 @@ void RtfBorder::SetEmpty( ) } void RtfBorder::Merge( RtfBorder& oBorPr ) { - //свойство должно быть как единое целое, поэтому если oBorPr задано, то переписыватся целиком + //property should be treated as a whole, so if oBorPr is set, it gets overwritten completely if (PROP_DEF != oBorPr.m_eType || PROP_DEF != oBorPr.m_nWidth || PROP_DEF != oBorPr.m_nSpace || PROP_DEF != oBorPr.m_nColor ) { m_eType = oBorPr.m_eType; @@ -1466,7 +1466,7 @@ void RtfCharProperty::Merge( RtfCharProperty& oCharPr, bool bAll ) MERGE_PROPERTY( m_bStrike, oCharPr ) MERGE_PROPERTY( m_nStriked, oCharPr ) MERGE_PROPERTY( m_nHightlited, oCharPr ) - //свойство должно быть как единое целое, поэтому если oBorPr задано, то переписыватся целиком + //property should be treated as a whole, so if oBorPr is set, it gets overwritten completely if ( uls_none != oCharPr.m_eUnderStyle || PROP_DEF != oCharPr.m_nUnderlineColor ) { m_eUnderStyle = oCharPr.m_eUnderStyle; @@ -1602,7 +1602,7 @@ std::wstring RtfCharProperty::RenderToOOX(RenderParameter oRenderParameter) m_nFontSize = poRtfDocument->m_oProperty.m_nDefFontSize; } if( RENDER_TO_OOX_PARAM_MATH == oRenderParameter.nType) - {//w:rPr в m:ctrlPr + {//w:rPr in m:ctrlPr if (m_nRevised != PROP_DEF) { bInsert = true; @@ -1626,7 +1626,7 @@ std::wstring RtfCharProperty::RenderToOOX(RenderParameter oRenderParameter) sResult += L"<w:rPr>"; } - if ( PROP_DEF != m_nDeleted )//для rPr в pPr + if ( PROP_DEF != m_nDeleted )//for rPr in pPr { std::wstring sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_nRevauthDel); std::wstring sDate(RtfUtility::convertDateTime(m_nRevdttmDel).c_str()); @@ -1814,7 +1814,7 @@ std::wstring RtfCharProperty::RenderToOOX(RenderParameter oRenderParameter) RENDER_OOX_INT( m_nUp, sResult, L"w:position" ) if ((m_nLanguage != PROP_DEF || m_nLanguageAsian != PROP_DEF) && RENDER_TO_OOX_PARAM_MATH != oRenderParameter.nType) - //todooo сделаь map для используемых в доке + //todooo create map for those used in document { std::wstring str_lang, str_lang_asian; #if defined(_WIN32) || defined(_WIN64) @@ -1910,7 +1910,7 @@ bool RtfListLevelProperty::IsValid() return PROP_DEF != m_nNumberType && false == m_sLevelText.empty(); } std::wstring RtfListLevelProperty::GenerateListText() - {//заменяем на булеты + {//replace with bullets std::wstring sResult; char cBullet[1]; cBullet[0] = (char)149; @@ -2137,7 +2137,7 @@ std::wstring RtfListLevelProperty::RenderToRtf(RenderParameter oRenderParameter) RENDER_RTF_INT( m_nStart, sResult, L"levelstartat" ) RENDER_RTF_INT( m_nNoRestart, sResult, L"levelnorestart" ) RENDER_RTF_INT( m_nPictureIndex, sResult, L"levelpicture" ) - //чтобы при последующем чтении из rtf не потерялась информация о шрифте + //so that font information is not lost on subsequent rtf reading sResult += m_oCharProp.RenderToRtf( oRenderParameter ); sResult += L"{\\leveltext" + m_sLevelText + L";}"; @@ -2209,7 +2209,7 @@ void RtfListLevelProperty::SetLevelTextOOX(const std::wstring& sText) m_sLevelText += L"\\'" + XmlUtils::ToString(nLevel - 1, L"%02x"); m_sNumber += L"\\'" + XmlUtils::ToString(nLevelOffsets + 1, L"%02x"); - i++; //т.к. следующий симовл уже учли + i++; //because we already processed the next character nText++; } @@ -3383,7 +3383,7 @@ void RtfParagraphProperty::SetDefaultRtf() SetDefault(); m_nSpaceBefore = 0; // 137.rtf - //4.1 Наряд_R7_M133.rtf + //4.1 WorkOrder_R7_M133.rtf m_nSpaceAfter = 0; m_nSpaceBetween = 240; } @@ -3693,31 +3693,31 @@ std::wstring RtfParagraphProperty::RenderToRtf(RenderParameter oRenderParameter) //RENDER_RTF_BOOL( m_bStyleSECell, sResult, L"tscsecell" ); - //дописываем текст списка (для старых reader например wordPad) + //write list text (for old readers like wordPad) if( PROP_DEF != m_nListId && PROP_DEF != m_nListLevel ) { RtfListProperty oListProperty; RtfDocument* poRtfDocument = static_cast<RtfDocument*>( oRenderParameter.poDocument ); RtfListOverrideProperty oListOverrideProperty; - //ищем по override table + //search in override table if( true == poRtfDocument->m_oListOverrideTable.GetList( m_nListId, oListOverrideProperty ) ) { - //Ищем по List Table + //Search in List Table if( true == poRtfDocument->m_oListTable.GetList( oListOverrideProperty.m_nListID, oListProperty) ) { - //дописываем свойства параграфа firstIndent Indent + //write paragraph properties firstIndent Indent RtfListLevelProperty poLevelProp ; if( true == oListProperty.GetItem( poLevelProp , m_nListLevel ) ) { sResult += L"{\\listtext\\pard\\plain"; sResult += poLevelProp.m_oCharProp.RenderToRtf( oRenderParameter ); - //пишем текст + //write text std::wstring strLevelProp = poLevelProp.GenerateListText(); RtfCharProperty* pCharProperty = NULL; sResult += RtfChar::renderRtfText( strLevelProp, oRenderParameter.poDocument, pCharProperty ); - //или картинку + //or picture if( PROP_DEF != poLevelProp.m_nPictureIndex ) { int nIndex = poLevelProp.m_nPictureIndex; @@ -3725,7 +3725,7 @@ std::wstring RtfParagraphProperty::RenderToRtf(RenderParameter oRenderParameter) if( 0 < nIndex && nIndex < poRtfDocument->m_oListTable.m_aPictureList.GetCount() ) sResult += poRtfDocument->m_oListTable.m_aPictureList[nIndex]->RenderToRtf( oRenderParameter ); } - //ставим tab + //add tab if( PROP_DEF != poLevelProp.m_nFollow ) { switch( poLevelProp.m_nFollow ) @@ -3899,7 +3899,7 @@ std::wstring RtfParagraphProperty::RenderToOOX(RenderParameter oRenderParameter) else sSpacing += L" w:lineRule=\"auto\""; } //else - // sSpacing += L" w:line=\"240\""); //по умолчанию - единичный + // sSpacing += L" w:line=\"240\""); //by default - single if( !sSpacing.empty() ) { sResult += L"<w:spacing " + sSpacing + L"/>"; @@ -3991,7 +3991,7 @@ std::wstring RtfParagraphProperty::RenderToOOX(RenderParameter oRenderParameter) } if (styleTabs.m_aTabs.size() != m_oTabs.m_aTabs.size() && m_oTabs.m_aTabs.size() > 0) - {//зачистка от стилевых табов (позиции по возрастанию) + {//clear style tabs (positions in ascending order) for (int i = (int)styleTabs.m_aTabs.size() - 1; i >= 0; i--) { bool bPreset = false; @@ -4209,12 +4209,12 @@ std::wstring RtfCellProperty::RenderToRtf(RenderParameter oRenderParameter) RENDER_RTF_BOOL( m_bNoWrap, sResult, L"clNoWrap" ) //https://www.office-forums.com/threads/rtf-file-weirdness-clpadt-vs-clpadl.2163500/ - RENDER_RTF_INT( m_nPaddingLeft, sResult, L"clpadt" ) //перепутаны top & left - RENDER_RTF_INT( m_ePaddingLeftUnit, sResult, L"clpadft" ) //перепутаны top & left + RENDER_RTF_INT( m_nPaddingLeft, sResult, L"clpadt" ) //top & left are swapped + RENDER_RTF_INT( m_ePaddingLeftUnit, sResult, L"clpadft" ) //top & left are swapped RENDER_RTF_INT( m_nPaddingRight, sResult, L"clpadr" ) RENDER_RTF_INT( m_ePaddingRightUnit, sResult, L"clpadfr" ) - RENDER_RTF_INT( m_nPaddingTop, sResult, L"clpadl" ) //перепутаны top & left - RENDER_RTF_INT( m_ePaddingTopUnit, sResult, L"clpadfl" ) //перепутаны top & left + RENDER_RTF_INT( m_nPaddingTop, sResult, L"clpadl" ) //top & left are swapped + RENDER_RTF_INT( m_ePaddingTopUnit, sResult, L"clpadfl" ) //top & left are swapped RENDER_RTF_INT( m_nPaddingBottom, sResult, L"clpadb" ) RENDER_RTF_INT( m_ePaddingBottomUnit, sResult, L"clpadfb" ) @@ -4414,8 +4414,8 @@ std::wstring RtfCellProperty::RenderToOOX(RenderParameter oRenderParameter) { if (PROP_DEF != m_nShadingPctFrom && PROP_DEF != m_oShading.m_nValue && m_oShading.m_nValue != 0) { - // todooo тут цвет подложки подкладывается от ячейки, таблицы или еще какой хрени - // пока берем второй цвет паттерна Romanization_Armenian.rtf + // todooo here the background color comes from cell, table or something else + // for now we take second pattern color Romanization_Armenian.rtf m_oShading.m_nBackColor = (int)(m_oShading.m_nForeColor * (m_oShading.m_nValue / 10000.)); } sResult += m_oShading.RenderToOOX(oRenderParameter); @@ -4776,7 +4776,7 @@ std::wstring RtfTableProperty::RenderToOOX(RenderParameter oRenderParameter) else if( 1 == m_nAutoFit ) sResult += L"<w:tblLayout w:type=\"autofit\"/>"; - //сделаем не по документации, а как все остальные юниты !!! + //do it not as per documentation, but like all other units !!! if( PROP_DEF != nTableIndent && 3 == eTableIndentUnit ) { sResult += L"<w:tblInd w:w=\"" + std::to_wstring(nTableIndent) + L"\" w:type=\"dxa\"/>"; @@ -4935,7 +4935,7 @@ void RtfRowProperty::SetDefaultRtf() void RtfRowProperty::SetDefaultOOX() { SetDefault(); - //не SetEmpty() !!! + //not SetEmpty() !!! m_oBorderLeft.SetDefault(); m_oBorderRight.SetDefault(); m_oBorderTop.SetDefault(); diff --git a/RtfFile/Format/RtfProperty.h b/RtfFile/Format/RtfProperty.h index e8aa7f2fba..4fd62e0ffc 100644 --- a/RtfFile/Format/RtfProperty.h +++ b/RtfFile/Format/RtfProperty.h @@ -208,7 +208,7 @@ public: static bool GetHighlightByColor( RtfColor oOutputColor,std::wstring& oStr ); //todo static RtfColor GetColorByPreset( std::wstring oStr ); - static std::wstring GetPresetByColor( RtfColor oCol ); //стр. 3320 + static std::wstring GetPresetByColor( RtfColor oCol ); //page 3320 static bool GetThemeByString( std::wstring sTheme, _ThemeColor & oOutTheme ); static bool GetThemeByOOX( SimpleTypes::EShemeColorVal val, _ThemeColor & oOutTheme ); static bool GetStringByTheme( std::wstring sTheme , _ThemeColor& oOutTheme ); @@ -503,7 +503,7 @@ public: _INT32 m_nJustification; //leveljcN \leveljcnN 0 Left justified 1 Center justified 2 Right justified _INT32 m_nFollow; //levelfollowN _INT32 m_nStart; //levelstartatN N specifies the start-at value for the level. - std::wstring m_sLevelText; //как в rtf текст, но сдвинут от нуля на 1 // \'03\'00.\'01 -> ("%d%d%d",4,1,2) + std::wstring m_sLevelText; //same as rtf text, but shifted from zero by 1 // \'03\'00.\'01 -> ("%d%d%d",4,1,2) std::wstring m_sNumber; _INT32 m_nNoRestart; //levelnorestartN 1 if this level does not restart its count each time a super ordinate level is incremented; 0 if this level does restart its count each time a super ordinate level is incremented. _INT32 m_nLegal; //levellegalN 1 if any list numbers from previous levels should be converted to Arabic numbers; 0 if they should be left with the format specified by their own level’s definition. @@ -966,8 +966,8 @@ public: _INT32 m_nWidthEndInvCell; //trwWidthAN Width of invisible cell at the end of the row. Used only when rows have different widths. _INT32 m_eWidthEndInvCellUnit; //trftsWidthAN Units for \trwWidthAN: - _INT32 m_nGridBefore; //для oox - _INT32 m_nGridAfter; //для oox + _INT32 m_nGridBefore; //for oox + _INT32 m_nGridAfter; //for oox _INT32 m_bStyleFirstRow; // tscfirstrow This cell is in the first row. _INT32 m_bStyleLastRow; // tsclastrow This cell is in the last row. @@ -991,7 +991,7 @@ public: void SetDefaultRtf(); void SetDefaultOOX(); - //5.5 Доверенность_MO_Q139.rtf + //5.5 PowerOfAttorney_MO_Q139.rtf void SetDefault(); bool IsValid(); diff --git a/RtfFile/Format/RtfReader.cpp b/RtfFile/Format/RtfReader.cpp index 8fc48372a2..f845b06aba 100644 --- a/RtfFile/Format/RtfReader.cpp +++ b/RtfFile/Format/RtfReader.cpp @@ -307,7 +307,7 @@ void RtfAbstractReader::ExecuteTextInternal2(RtfDocument& oDocument, RtfReader& } void RtfAbstractReader::ExecuteTextInternalSkipChars(std::string & sResult, RtfReader& oReader, std::string & sKey, int& nSkipChars) { - //удаляем символы вслед за юникодом + //remove characters following unicode if (nSkipChars > 0) { if (nSkipChars >= (int)sResult.length()) @@ -323,13 +323,13 @@ void RtfAbstractReader::ExecuteTextInternalSkipChars(std::string & sResult, RtfR } if ("u" == sKey) { - //надо правильно установить m_nSkipChars по значению \ucN + //need to correctly set m_nSkipChars based on \\ucN value nSkipChars = oReader.m_oState->m_nUnicodeClean; } } void RtfAbstractReader::ExecuteTextInternalSkipChars(std::wstring & sResult, RtfReader& oReader, std::string & sKey, int& nSkipChars) { - //удаляем символы вслед за юникодом + //remove characters following unicode if (nSkipChars > 0) { if (nSkipChars >= (int)sResult.length()) @@ -345,7 +345,7 @@ void RtfAbstractReader::ExecuteTextInternalSkipChars(std::wstring & sResult, Rtf } if ("u" == sKey) { - //надо правильно установить m_nSkipChars по значению \ucN + //need to correctly set m_nSkipChars based on \\ucN value nSkipChars = oReader.m_oState->m_nUnicodeClean; } } @@ -358,7 +358,7 @@ std::wstring RtfAbstractReader::ExecuteTextInternalCodePage( std::string& sCharS int nCodepage = -1; - //применяем параметры codepage от текущего шрифта todo associated fonts. + //apply codepage parameters from the current font todo associated fonts. RtfFont oFont; if ((!m_bUseGlobalCodepage) && (true == oDocument.m_oFontTable.GetFont(oReader.m_oState->m_oCharProp.m_nFont, oFont))) { @@ -372,7 +372,7 @@ std::wstring RtfAbstractReader::ExecuteTextInternalCodePage( std::string& sCharS nCodepage = RtfUtility::CharsetToCodepage(oFont.m_nCharset); } } - //от настроек документа + //from document settings if (-1 == nCodepage && RtfDocumentProperty::cp_none != oDocument.m_oProperty.m_eCodePage) { switch (oDocument.m_oProperty.m_eCodePage) @@ -392,7 +392,7 @@ std::wstring RtfAbstractReader::ExecuteTextInternalCodePage( std::string& sCharS case RtfDocumentProperty::cp_pca: nCodepage = 850; break; //ms dos latin eu } } - //если ничего нет ставим ANSI или default from user + //if nothing else, set ANSI or default from user if (-1 == nCodepage) { nCodepage = CP_ACP; diff --git a/RtfFile/Format/RtfReader.h b/RtfFile/Format/RtfReader.h index 3fc34515a1..670fec8efa 100644 --- a/RtfFile/Format/RtfReader.h +++ b/RtfFile/Format/RtfReader.h @@ -47,7 +47,7 @@ public: class ReaderState { public: - int m_nUnicodeClean; // количество символов игнорируемых за юникодом + int m_nUnicodeClean; // number of characters ignored after unicode RtfCharProperty m_oCharProp; RtfParagraphProperty m_oParagraphProp; RtfRowProperty m_oRowProperty; @@ -63,7 +63,7 @@ public: ReaderStatePtr m_oState; RtfSectionProperty m_oCurSectionProp; RtfLex m_oLex; - int m_nFootnote; //толко для симовола chftn. основано на том что вложенных footnote быть не может + int m_nFootnote; //only for chftn symbol. based on the fact that nested footnotes cannot exist int m_nDefFont; int m_nDefLang; int m_nDefLangAsian; diff --git a/RtfFile/Format/RtfSection.cpp b/RtfFile/Format/RtfSection.cpp index a0bda9e1b0..aae980e773 100644 --- a/RtfFile/Format/RtfSection.cpp +++ b/RtfFile/Format/RtfSection.cpp @@ -215,7 +215,7 @@ std::wstring RtfDocumentProperty::RenderToRtf(RenderParameter oRenderParameter) RENDER_RTF_BOOL ( m_bAlignBordersAndEdges, sResult, L"pgbrdrsnap" ) //Page Information -//эти свойства пишутся в первой секции +//these properties are written in the first section //public: int m_nPaperWidth; // paperwN Paper width in twips (default is 12,240). //public: int m_nPaperHeight; // paperhN Paper height in twips (default is 15,840). //public: int m_nMarginLeft; // marglN Left margin in twips (default is 1800). @@ -286,7 +286,7 @@ std::wstring RtfDocumentProperty::RenderToRtf(RenderParameter oRenderParameter) } } -//для схоранения в RTF +//for saving to RTF RENDER_RTF_INT( m_bSplitPageBrake, sResult, L"spltpgpar" ) if( 0 != m_bHtmlAutoSpace ) @@ -381,7 +381,7 @@ std::wstring RtfDocumentProperty::RenderToOOX(RenderParameter oRenderParameter) sResult += L"<w:footnotePr>" + sFootnoteProp + L"</w:footnotePr>"; std::wstring sEndnoteProp; - //todooo проверить id + //todooo check id for (size_t i = 0; i < m_aSpecialEndnotes.size(); i++ ) { sEndnoteProp += L"<w:endnote w:id=\"" + std::to_wstring(m_aSpecialEndnotes[i]) + L"\"/>"; @@ -433,7 +433,7 @@ std::wstring RtfSectionProperty::RenderToRtf(RenderParameter oRenderParameter) { std::wstring sResult; - if( RENDER_TO_OOX_PARAM_FIRST_SECTION == oRenderParameter.nType ) //Пишем как свойства документа + if( RENDER_TO_OOX_PARAM_FIRST_SECTION == oRenderParameter.nType ) //Write as document properties { //Page Information RENDER_RTF_INT ( m_nPageWidth, sResult, L"paperw" ) @@ -558,7 +558,7 @@ std::wstring RtfSectionProperty::RenderToRtf(RenderParameter oRenderParameter) case lnr_linecont: sResult += L"\\linecont"; break; } - if( RENDER_TO_OOX_PARAM_FIRST_SECTION != oRenderParameter.nType )//Пишем как свойства секции + if( RENDER_TO_OOX_PARAM_FIRST_SECTION != oRenderParameter.nType )//Write as section properties { //Page Information RENDER_RTF_INT( m_nPageWidth, sResult, L"pgwsxn" ) @@ -1198,7 +1198,7 @@ void RtfSectionProperty::SetDefault() DEFAULT_PROPERTY ( m_nBorderMeasure ) DEFAULT_PROPERTY ( m_nBorderAlign ) - //footer - header надо обнулять вручную + //footer - header need to be reset manually //m_oHeaderLeft = TextItemContainerPtr(); //m_oHeaderFirst = TextItemContainerPtr(); //m_oHeaderRight = TextItemContainerPtr(); @@ -1255,7 +1255,7 @@ std::wstring RtfSection::RenderToOOX(RenderParameter oRenderParameter) { if (!m_bFinalize) return L""; - m_bFinalize = false; // тут .. чтобы не повторилось при конвертации колонтитулов + m_bFinalize = false; // here.. to avoid repetition during header/footer conversion RenderParameter oNewParam = oRenderParameter; oNewParam.nType = RENDER_TO_OOX_PARAM_UNKNOWN; diff --git a/RtfFile/Format/RtfSection.h b/RtfFile/Format/RtfSection.h index 5045e708f5..79a30a7e55 100644 --- a/RtfFile/Format/RtfSection.h +++ b/RtfFile/Format/RtfSection.h @@ -142,7 +142,7 @@ public: ep_BottomPage // aftnbj Endnotes at bottom of page (bottom justified). }m_eEndnotePlacement; -//для схоранения в RTF +//for saving to RTF int m_bSplitPageBrake; // spltpgpar int m_bHtmlAutoSpace; // htmautsp Use HTML paragraph auto spacing. @@ -364,7 +364,7 @@ public: TextItemContainerPtr m_oFooterFirst; TextItemContainerPtr m_oFooterRight; - std::wstring m_sIDHeaderLeft; //для OOX + std::wstring m_sIDHeaderLeft; //for OOX std::wstring m_sIDHeaderFirst; std::wstring m_sIDHeaderRight; std::wstring m_sIDFooterLeft; diff --git a/RtfFile/Format/RtfShape.cpp b/RtfFile/Format/RtfShape.cpp index 79f17db9bb..efaa11fa50 100644 --- a/RtfFile/Format/RtfShape.cpp +++ b/RtfFile/Format/RtfShape.cpp @@ -268,7 +268,7 @@ std::wstring RtfShape::RenderToRtf(RenderParameter oRenderParameter) if ( PROP_DEF == m_nShapeType) return L""; std::wstring sResult; - //запоминаем координаты и если нужно поворачиваем + //save coordinates and rotate if needed int nLeft = m_nLeft; int nTop = m_nTop; int nRight = m_nRight; @@ -492,7 +492,7 @@ std::wstring RtfShape::RenderToRtf(RenderParameter oRenderParameter) } sResult += L"}"; } - //восстанавливаем координаты и если нужно поворачиваем + //restore coordinates and rotate if needed m_nLeft = nLeft; m_nTop = nTop; m_nRight = nRight; @@ -793,7 +793,7 @@ std::wstring RtfShape::RenderToOOX(RenderParameter oRenderParameter) m_aTextItems = TextItemContainerPtr(); if ( 0 != aTempTextItems ) - {//пишем только Ole обьект + {//write only Ole object size_t nTempTextItemsCount = aTempTextItems->GetCount(); for (size_t i = 0; i < nTempTextItemsCount; i++ ) { @@ -810,7 +810,7 @@ std::wstring RtfShape::RenderToOOX(RenderParameter oRenderParameter) poCurParagraph->GetItem( piCurIDocumentElement, j ); if ( NULL != piCurIDocumentElement && TYPE_RTF_OLE == piCurIDocumentElement->GetType() ) { - //рендерим только Ole часть + //render only Ole part RenderParameter oNewParam = oRenderParameter; oNewParam.nType = RENDER_TO_OOX_PARAM_OLE_ONLY; oNewParam.nValue = m_nID; @@ -833,7 +833,7 @@ std::wstring RtfShape::RenderToOOX(RenderParameter oRenderParameter) } } } - //возвращаем text box на место + //return text box to its place m_aTextItems = aTempTextItems; } } @@ -886,7 +886,7 @@ std::wstring RtfShape::RenderToOOXBegin(RenderParameter oRenderParameter) } } else - {//работает по умолчанию + {//works by default if (m_oCharProperty.m_nRevised != PROP_DEF) { m_bInsert = true; @@ -950,7 +950,7 @@ std::wstring RtfShape::RenderToOOXBegin(RenderParameter oRenderParameter) if (1 == m_bFilled || m_nFillColor != PROP_DEF || m_nFillColor2 != PROP_DEF || m_nFillType != PROP_DEF) sShapeStart += L" filled=\"t\""; else - sShapeStart += L" filled=\"f\""; //сф_850000158725_R7_M194_МО_Q194.rtf + sShapeStart += L" filled=\"f\""; //invoice_850000158725_R7_M194_MO_Q194.rtf if (PROP_DEF == m_bLine) { @@ -999,7 +999,7 @@ std::wstring RtfShape::RenderToOOXBegin(RenderParameter oRenderParameter) m_eXAnchor = RtfShape::ax_margin; m_eYAnchor = RtfShape::ay_margin; } - //не пишем если inline + //don't write if inline if ( 3 != m_nPositionHRelative || 3 != m_nPositionVRelative ) { sStyle += L"position:absolute;"; @@ -1491,7 +1491,7 @@ std::wstring RtfShape::RenderToOOXBegin(RenderParameter oRenderParameter) if (m_nShapeType == PROP_DEF || m_nShapeType == 75 || m_bIsOle) { - if ( sPicture.empty() )//если не сохранилась картинка, то весь shape-picture будет бесполезным + if ( sPicture.empty() )//if the image wasn't saved, the entire shape-picture will be useless return L""; int nCropLeft = PROP_DEF; @@ -1623,7 +1623,7 @@ std::wstring RtfShape::RenderToOOXBegin(RenderParameter oRenderParameter) if ( !m_sGtextFont.empty() ) { - sTextStyle += L"font-family:" + XmlUtils::EncodeXmlString(m_sGtextFont) + L";";//todooo значения как в кавычках так и без - проверить как без + sTextStyle += L"font-family:" + XmlUtils::EncodeXmlString(m_sGtextFont) + L";";//todooo values both with and without quotes - check without } if (!sTextStyle.empty()) @@ -1683,11 +1683,11 @@ std::wstring RtfShape::RenderToOOXEnd(RenderParameter oRenderParameter) { if (!m_sOle.empty()) { - sResult += m_sOle + L"</w:object></w:r>";//работает по умолчанию + sResult += m_sOle + L"</w:object></w:r>";//works by default } else { - sResult += L"</w:pict></w:r>";//работает по умолчанию + sResult += L"</w:pict></w:r>";//works by default } if (m_bDelete) sResult += L"</w:del>"; @@ -1698,7 +1698,7 @@ std::wstring RtfShape::RenderToOOXEnd(RenderParameter oRenderParameter) std::wstring RtfShape::GroupRenderToRtf(RenderParameter oRenderParameter) { std::wstring sResult; - //запоминаем координаты и если нужно поворачиваем + //save coordinates and rotate if needed int nLeft = m_nLeft; int nTop = m_nTop; int nRight = m_nRight; @@ -1804,7 +1804,7 @@ std::wstring RtfShape::GroupRenderToRtf(RenderParameter oRenderParameter) sResult += L"}"; sResult += L"}"; } - //восстанавливаем координаты и если нужно поворачиваем + //restore coordinates and rotate if needed m_nLeft = nLeft; m_nTop = nTop; m_nRight = nRight; @@ -1865,17 +1865,17 @@ void RtfShape::SetNotSupportShape() void RtfShape::ToRtfRotation( int nAngel , int &nLeft, int &nTop, int& nRight, int& nBottom ) { nAngel = nAngel/ 65536; - //поворачиваем на 45 градусов + //rotate by 45 degrees nAngel -= 45; - //делаем угол от 0 до 360 + //make angle from 0 to 360 nAngel = nAngel % 360; if ( nAngel < 0 ) nAngel += 360; - int nQuater = nAngel / 90; // определяем четверть + int nQuater = nAngel / 90; // determine the quadrant if ( 0 == nQuater || 2 == nQuater ) { - //поворачиваем относительно центра на 90 градусов обратно + //rotate back 90 degrees relative to center int nCenterX = ( nLeft + nRight ) / 2; int nCenterY = ( nTop + nBottom ) / 2; int nWidth = nRight - nLeft; diff --git a/RtfFile/Format/RtfShape.h b/RtfFile/Format/RtfShape.h index da3d56d9c0..5da04eb165 100644 --- a/RtfFile/Format/RtfShape.h +++ b/RtfFile/Format/RtfShape.h @@ -168,7 +168,7 @@ public: int m_nConnectorStyle; //cxstyle Connector style //Picture Effects - int m_nCropFromTop; //cropFromTop Top cropping percentage. Измеряется в fraction 1 /65536 + int m_nCropFromTop; //cropFromTop Top cropping percentage. Measured in fraction 1/65536 int m_nCropFromBottom; //cropFromBottom Bottom cropping percentage. int m_nCropFromLeft; //cropFromLeft Left cropping percentage. int m_nCropFromRight; //cropFromRight Right cropping percentage. @@ -199,7 +199,7 @@ public: int m_nFillToLeft; int m_nFillShadeType; std::vector< std::pair<int, double> > m_aFillShadeColors; - //int m_bFillShape; //есть копия заливки картинкой + //int m_bFillShape; //there is a copy of image fill //Line int m_bLine; //fLine Has a line int m_nLineColor; @@ -231,7 +231,7 @@ public: std::wstring m_sSigSetupSuggSigner2; std::wstring m_sSigSetupSuggSignerEmail; - RtfCharProperty m_oCharProperty; // тут могут быть track changes .... + RtfCharProperty m_oCharProperty; // track changes may be here... //pWrapPolygonVertices Points of the text wrap polygon. std::vector< std::pair<__int64, __int64> > m_aWrapPoints; diff --git a/RtfFile/Format/RtfTable.cpp b/RtfFile/Format/RtfTable.cpp index cbdaa3c33e..5d82f5d7ee 100644 --- a/RtfFile/Format/RtfTable.cpp +++ b/RtfFile/Format/RtfTable.cpp @@ -98,13 +98,13 @@ std::wstring RtfTable::RenderToRtf(RenderParameter oRenderParameter) } void RtfTable::CalculateGridProp() { - //массив всевозможных cellx - std::vector<int> aCellx; // упорядочен по возрастанию + //array of all possible cellx values + std::vector<int> aCellx; // sorted in ascending order int nLastCellx = 0; int maxCellxFirstRow = 0; - //m_aArray - строки + //m_aArray - rows for (size_t nCurRow = 0; nCurRow < m_aArray.size(); nCurRow++) { nLastCellx = 0; @@ -118,8 +118,8 @@ void RtfTable::CalculateGridProp() if (PROP_DEF != oCurRow->m_oProperty.m_nWidthEndInvCell && mu_Twips == oCurRow->m_oProperty.m_eWidthEndInvCellUnit) nWidthAfter = oCurRow->m_oProperty.m_nWidthEndInvCell; - int nDelta = 0;// поправка на margin и indent и spacing - if (PROP_DEF != oCurRow->m_oProperty.m_nLeft) //для каждого row свой + int nDelta = 0;// adjustment for margin, indent and spacing + if (PROP_DEF != oCurRow->m_oProperty.m_nLeft) //different for each row nDelta = -oCurRow->m_oProperty.m_nLeft; else { @@ -133,7 +133,7 @@ void RtfTable::CalculateGridProp() nDelta -= oCurRow->m_oProperty.m_nWidthStartInvCell; } - //добавляем widthBefore + //add widthBefore if (0 != nWidthBefore) { AddToArray(aCellx, nWidthBefore); @@ -149,20 +149,20 @@ void RtfTable::CalculateGridProp() if (nCellx > maxCellxFirstRow && maxCellxFirstRow > 0) nCellx = maxCellxFirstRow; AddToArray(aCellx, nCellx); - //те свойства, что остались в row не трогаем - они не важны для конвертации в oox + //don't touch the properties that remain in row - they are not important for oox conversion nLastCellx = nCellx; } - //добавляем widthAfter + //add widthAfter if (0 != nWidthAfter) AddToArray(aCellx, nLastCellx + nWidthAfter); if (maxCellxFirstRow == 0) maxCellxFirstRow = nLastCellx + nWidthAfter; } - //вычисляем Span + //calculate Span for (size_t i = 0; i < m_aArray.size(); i++) { RtfTableRowPtr oCurRow = m_aArray[i]; - //индекс последнего минимального элемента + //index of the last minimum element int nLastIndex = 0; int nLastCellx = 0; @@ -173,8 +173,8 @@ void RtfTable::CalculateGridProp() if (PROP_DEF != oCurRow->m_oProperty.m_nWidthEndInvCell && mu_Twips == oCurRow->m_oProperty.m_eWidthEndInvCellUnit) nWidthAfter = oCurRow->m_oProperty.m_nWidthEndInvCell; - int nDelta = 0;// поправка на margin и indent и spacing и border - if (PROP_DEF != oCurRow->m_oProperty.m_nLeft) //для каждого row свой + int nDelta = 0;// adjustment for margin, indent, spacing and border + if (PROP_DEF != oCurRow->m_oProperty.m_nLeft) //different for each row nDelta = -oCurRow->m_oProperty.m_nLeft; else { @@ -188,7 +188,7 @@ void RtfTable::CalculateGridProp() nDelta -= oCurRow->m_oProperty.m_nWidthStartInvCell; } - //добавляем gridBefore + //add gridBefore if (0 != nWidthBefore) { for (int k = nLastIndex; k < (int)aCellx.size(); k++) @@ -225,7 +225,7 @@ void RtfTable::CalculateGridProp() nLastCellx = nCellx; } - //добавляем gridAfter + //add gridAfter if (0 != nWidthAfter) for (int k = nLastIndex; k < (int)aCellx.size(); k++) { @@ -237,7 +237,7 @@ void RtfTable::CalculateGridProp() } } } - //вычисляем gridTable + //calculate gridTable for (size_t i = 0; i < (int)aCellx.size(); i++) { if (i == 0) @@ -246,18 +246,18 @@ void RtfTable::CalculateGridProp() m_aTableGrid.push_back(aCellx[i] - aCellx[i - 1]); } } -void RtfTable::CalculateCellx(RtfDocument& oDocument)//todo учитывать margin indent +void RtfTable::CalculateCellx(RtfDocument& oDocument)//todo consider margin indent { if (m_aTableGrid.size() == 0 && m_aArray.size() > 0) { - //если отсутствует <w:tblGrid/> делаем пропорционально + //if <w:tblGrid/> is missing, make proportional m_oProperty.m_nAutoFit = 1; if ((PROP_DEF == m_oProperty.m_nWidth || m_oProperty.m_nWidth <= 0)) { - //если не задана ширина таблицы, считаем ее 100% + //if table width is not specified, consider it 100% // Width = PageWidth - MarginLeft - MarginRight - Gutter int nGutter = oDocument.m_oProperty.m_nGutterWidth; - if (1 == oDocument.m_oProperty.m_bGutterAtTop)//не учитываем если это Top gutter + if (1 == oDocument.m_oProperty.m_bGutterAtTop)//don't consider if it's Top gutter nGutter = 0; m_oProperty.m_nWidth = oDocument.m_oProperty.m_nPaperWidth - oDocument.m_oProperty.m_nMarginLeft - oDocument.m_oProperty.m_nMarginRight - nGutter; m_oProperty.m_eWidthUnit = mu_Twips; @@ -300,7 +300,7 @@ void RtfTable::CalculateCellx(RtfDocument& oDocument)//todo учитывать m nLeft -= m_oProperty.m_nDefCellMarLeft; if (PROP_DEF != m_oProperty.m_nDefCellSpLeft && 3 == m_oProperty.m_eDefCellSpLeftUnit) nLeft += 2 * m_oProperty.m_nDefCellSpLeft; - int nDelta = nLeft;//в left учитывается GrindBefore + int nDelta = nLeft;//GrindBefore is accounted for in left //if( PROP_DEF != oCurRow->m_oProperty.m_nGridBefore ) //{ @@ -360,7 +360,7 @@ void RtfTable::CalculateCellx(RtfDocument& oDocument)//todo учитывать m } } } -void RtfTable::AddToArray(std::vector<int>& aArray, int nValue)//todo можно применить то что он упорядоченный +void RtfTable::AddToArray(std::vector<int>& aArray, int nValue)//todo can use the fact that it's sorted { bool bNeedAdd = true; for (size_t k = 0; k < aArray.size(); k++) diff --git a/RtfFile/Format/RtfTable.h b/RtfFile/Format/RtfTable.h index b710d18a27..b4058a884c 100644 --- a/RtfFile/Format/RtfTable.h +++ b/RtfFile/Format/RtfTable.h @@ -36,7 +36,7 @@ class RtfDocument; -//TODO не работает если сделать вертикальный мерж и убрать разделение на пераграфы +//TODO does not work if vertical merge is applied and paragraph separation is removed class RtfTable : public ITextItem, public ItemContainer< RtfTableRowPtr > { public: diff --git a/RtfFile/Format/RtfTableCell.cpp b/RtfFile/Format/RtfTableCell.cpp index 7db4c34435..3985e04c92 100644 --- a/RtfFile/Format/RtfTableCell.cpp +++ b/RtfFile/Format/RtfTableCell.cpp @@ -65,7 +65,7 @@ std::wstring RtfTableCell::RenderToRtf(RenderParameter oRenderParameter) if( RENDER_TO_RTF_PARAM_NESTED != oRenderParameter.nType ) result += L"\\cell"; else - result += L"\\nestcell{\\nonesttables }"; //todo как бы вернуть + result += L"\\nestcell{\\nonesttables }"; //todo how to return return result; } std::wstring RtfTableCell::RenderToOOX(RenderParameter oRenderParameter) diff --git a/RtfFile/Format/RtfWriter.cpp b/RtfFile/Format/RtfWriter.cpp index 68b91329b7..53a6ea62f6 100644 --- a/RtfFile/Format/RtfWriter.cpp +++ b/RtfFile/Format/RtfWriter.cpp @@ -69,7 +69,7 @@ bool RtfWriter::SaveByItemStart() // BSTR bstrFileName = m_sTempFileResult.AllocSysString(); // m_oFileWriter = new NFileWriter::CBufferedFileWriter( bstrFileName ); // SysFreeString( bstrFileName ); - // //создаем темповый файл куда пишем параграфы( потом копируем свойства секции и содержимое файла ) + // //create temp file where we write paragraphs (then copy section properties and file content) // m_sTempFile = Utils::CreateTempFile( m_sTempFolder ); // BSTR bstrTempFileName = m_sTempFile.AllocSysString(); // m_oTempFileWriter = new NFileWriter::CBufferedFileWriter( bstrTempFileName ); @@ -117,10 +117,10 @@ bool RtfWriter::SaveByItem() if( m_oDocument.GetCount() > 1 && m_oDocument[0].props->GetCount() == 0 ) { - //пишем конец секции + //write end of section std::string sRtfExt = "\\sect"; m_oCurTempFileWriter->Write( (BYTE*)sRtfExt.c_str(), sRtfExt.length() ); - //окончательно дописываем темповый файл + //finally complete writing to temp file RELEASEOBJECT( m_oCurTempFileWriter ) try { @@ -135,19 +135,19 @@ bool RtfWriter::SaveByItem() } if( NULL != m_oCurTempFileSectWriter ) { - //пишем свойства секции + //write section properties std::wstring sRtf; if( true == m_bFirst ) { - //первый свойства секции пишем как свойства документа + //write first section properties as document properties m_bFirst = false; oNewParam.nType = RENDER_TO_OOX_PARAM_FIRST_SECTION; } sRtf = m_oDocument[0].props->m_oProperty.RenderToRtf(oNewParam); RtfUtility::RtfInternalEncoder::Decode( sRtf, *m_oCurTempFileSectWriter ); - //дописываем в файл + //complete writing to file RELEASEOBJECT( m_oCurTempFileSectWriter ); - //создаем новый + //create new one std::wstring sNewTempFileSect = Utils::CreateTempFile( m_sTempFolder ); m_aTempFilesSectPr.push_back( sNewTempFileSect ); @@ -157,10 +157,10 @@ bool RtfWriter::SaveByItem() //RtfInternalEncoder::Decode( sRtf, *m_oFileWriter ); //m_oFileWriter->Write( (BYTE*)(LPCSTR)sRtf, sRtf.length() ); } - //удаляем секцию + //remove section m_oDocument.RemoveItem( 0 ); } - //пишем параграф + //write paragraph if( m_oDocument.GetCount() > 0 && m_oDocument[0].props->GetCount() > 0 ) { std::wstring sRtf; @@ -168,7 +168,7 @@ bool RtfWriter::SaveByItem() if( TYPE_RTF_PARAGRAPH == m_oDocument[0].props->operator[](0)->GetType() && !( m_oDocument[0].props->GetCount() == 0 - && m_oDocument.GetCount() > 1) )//для последнего параграфа секции не пишем \par + && m_oDocument.GetCount() > 1) )//don't write \par for last paragraph of section { sRtf += L"\\par"; //oNewParam.nValue = RENDER_TO_RTF_PARAM_NO_PAR; @@ -176,7 +176,7 @@ bool RtfWriter::SaveByItem() RtfUtility::RtfInternalEncoder::Decode( sRtf, *m_oCurTempFileWriter ); //m_oTempFileWriter->Write( (BYTE*)(LPCSTR)sRtf, sRtf.length() ); - //удаляем элемент который только что написали + //remove element we just wrote m_oDocument[0].props->RemoveItem( 0 ); } return true; @@ -184,7 +184,7 @@ bool RtfWriter::SaveByItem() bool RtfWriter::SaveByItemEnd() { bool result = true; - //окончательно дописываем темповый файл + //finally complete writing to temp file RELEASEOBJECT( m_oCurTempFileWriter ); std::wstring sRtf; @@ -197,40 +197,40 @@ bool RtfWriter::SaveByItemEnd() if( NULL != m_oCurTempFileSectWriter ) { - //пишем последнюю секцию + //write last section if( true == m_bFirst ) { - //первый свойства секции пишем как свойства документа + //write first section properties as document properties m_bFirst = false; oNewParam.nType = RENDER_TO_OOX_PARAM_FIRST_SECTION; } sRtf = m_oDocument[0].props->m_oProperty.RenderToRtf(oNewParam); RtfUtility::RtfInternalEncoder::Decode( sRtf, *m_oCurTempFileSectWriter ); - //дописываем в файл + //complete writing to file RELEASEOBJECT( m_oCurTempFileSectWriter ); } //RtfInternalEncoder::Decode( sRtf, *m_oCurTempFileWriter ); //m_oFileWriter->Write( (BYTE*)(LPCSTR)sRtf, sRtf.length() ); - //удаляем секцию + //remove section m_oDocument.RemoveItem( 0 ); } - //формируем выходной файл + //create output file try { NFileWriter::CBufferedFileWriter oTargetFileWriter(m_sFilename ); - //пишем заголовок потом все содежимое + //write header then all content sRtf = CreateRtfStart(); DWORD dwBytesWrite = 0; RtfUtility::RtfInternalEncoder::Decode( sRtf, oTargetFileWriter ); //WriteFile ( hTargetFile, sRtf, ( DWORD ) sRtf.length(), &dwBytesWrite, NULL ); - //копируем заголовки из массива и параграфы из темповых файлов + //copy headers from array and paragraphs from temp files for (size_t i = 0 ; i < m_aTempFiles.size() && i < m_aTempFilesSectPr.size(); i++ ) { - //свойства секции + //section properties NSFile::CFileBinary file; if (true == file.OpenFile(m_aTempFilesSectPr[i])) @@ -248,7 +248,7 @@ bool RtfWriter::SaveByItemEnd() } file.CloseFile(); } - //параграфы + //paragraphs if (true == file.OpenFile(m_aTempFiles[i])) { DWORD dwBytesRead = 1; @@ -266,7 +266,7 @@ bool RtfWriter::SaveByItemEnd() } } - //завершаем документ + //complete document sRtf = CreateRtfEnd(); RtfUtility::RtfInternalEncoder::Decode( sRtf, oTargetFileWriter ); BYTE nEndFile = 0; diff --git a/RtfFile/Format/UniversalConverterUtils.cpp b/RtfFile/Format/UniversalConverterUtils.cpp index 57c14f6f9f..4fc6a99ed6 100644 --- a/RtfFile/Format/UniversalConverterUtils.cpp +++ b/RtfFile/Format/UniversalConverterUtils.cpp @@ -35,16 +35,16 @@ int Utils::CopyDirOrFile(std::wstring sSource, std::wstring sDestination) { - //удаляем sDestination, чтобы там не было. + //delete sDestination so it's not there. if( 0 != RemoveDirOrFile( sDestination ) ) return 1; - //копируем + //copy CDirectory::CopyFile(sSource, sDestination); return 0; } -// return "" если не удалось создать +// return "" if creation failed int Utils::RemoveDirOrFile(std::wstring sPath) { CDirectory::DeleteFile(sPath); @@ -63,8 +63,8 @@ std::wstring Utils::CreateTempFile( std::wstring sDir ) else return CreateTempFile(); } -// return "" если не удалось создать -std::wstring Utils::CreateTempDir( std::wstring sDir )//создаем файл в папке sDir +// return "" if creation failed +std::wstring Utils::CreateTempDir( std::wstring sDir )//create file in sDir folder { if( !sDir.empty() ) { diff --git a/RtfFile/Format/UniversalConverterUtils.h b/RtfFile/Format/UniversalConverterUtils.h index ac50a035ed..2b7206b2ba 100644 --- a/RtfFile/Format/UniversalConverterUtils.h +++ b/RtfFile/Format/UniversalConverterUtils.h @@ -40,14 +40,14 @@ class Utils public: static int CopyDirOrFile(std::wstring sSource, std::wstring sDestination); - // return "" если не удалось создать + // return "" if creation failed static int RemoveDirOrFile(std::wstring sPath); static std::wstring CreateTempFile( ); static std::wstring CreateTempFile( std::wstring sDir ); - // return "" если не удалось создать + // return "" if creation failed - static std::wstring CreateTempDir( std::wstring sDir ); //создаем файл в папке sDir + static std::wstring CreateTempDir( std::wstring sDir ); //create file in sDir folder static std::wstring CreateTempDir(); }; diff --git a/RtfFile/Format/Utils.cpp b/RtfFile/Format/Utils.cpp index 85f736a302..9c0a502626 100644 --- a/RtfFile/Format/Utils.cpp +++ b/RtfFile/Format/Utils.cpp @@ -134,7 +134,7 @@ std::wstring RtfUtility::RtfInternalEncoder::Encode( std::wstring sFilename ) { return L"{\\*filename " + sFilename + L"\\*end}"; } -void RtfUtility::RtfInternalEncoder::Decode( std::wstring& sText, NFileWriter::CBufferedFileWriter& oFileWriter ) //сразу записывает в файл +void RtfUtility::RtfInternalEncoder::Decode( std::wstring& sText, NFileWriter::CBufferedFileWriter& oFileWriter ) //writes directly to file { #if defined(_WIN32) || defined(_WIN64) std::string sAnsiText(sText.begin(), sText.end()); @@ -258,7 +258,7 @@ int RtfUtility::String2Twips( std::wstring sValue ) } int RtfUtility::px2Twip(int px) { - return 15 * px; //из наблюдений за word + return 15 * px; //from observations of Word } int RtfUtility::pc2Twip(double pc) { @@ -367,10 +367,10 @@ bool RtfUtility::IsDigit( int nChar ) std::wstring RtfUtility::Preserve( std::wstring sText ) { std::wstring sResult = sText; - //обрезавем лишние пробелы + //trim extra spaces //sResult.Trim(); - //удаляем дублирующие пробелы + //remove duplicate spaces XmlUtils::replace_all(sResult, L" ", L" "); // while( sResult.Replace( L" ", L" " ) > 0 ) // ; @@ -463,8 +463,8 @@ std::wstring RtfUtility::convert_string_icu(std::string::const_iterator start, s NSUnicodeConverter::CUnicodeConverter oConverter; return oConverter.toUnicode(inptr, insize, nCodepage, true); } - else //сф_850000158725_R7_M194_МО_Q194.rtf - {//текущая локаль + else //invoice_850000158725_R7_M194_MO_Q194.rtf + {//current locale std::locale loc(""); std::ctype<wchar_t> const &facet = std::use_facet<std::ctype<wchar_t> >(loc); diff --git a/RtfFile/Format/Utils.h b/RtfFile/Format/Utils.h index 25fed2b06c..f6ec2d8abf 100644 --- a/RtfFile/Format/Utils.h +++ b/RtfFile/Format/Utils.h @@ -188,7 +188,7 @@ public: { public: static std::wstring Encode( std::wstring sFilename ); - static void Decode( std::wstring& sText, NFileWriter::CBufferedFileWriter& oFileWriter ); //сразу записывает в файл + static void Decode( std::wstring& sText, NFileWriter::CBufferedFileWriter& oFileWriter ); //writes directly to file private: static void DecodeFromFile( std::wstring& sFilename, NFileWriter::CBufferedFileWriter& oFileWriter ); diff --git a/RtfFile/OOXml/Reader/OOXBorderReader.cpp b/RtfFile/OOXml/Reader/OOXBorderReader.cpp index 84e7fc8ad7..6fc086f966 100644 --- a/RtfFile/OOXml/Reader/OOXBorderReader.cpp +++ b/RtfFile/OOXml/Reader/OOXBorderReader.cpp @@ -73,7 +73,7 @@ bool OOXBorderReader::Parse( ReaderParameter oParam, RtfBorder& oOutputBorder ) type_border = m_ooxBorder->m_oVal->GetValue(); } //if (m_ooxBorder->m_oVal->GetValue() == SimpleTypes::bordervalueNone ) return true; - // // это отсутствие свойства а не бордера (Nil + // // this is absence of property, not border (Nil if ((m_ooxBorder->m_oColor.IsInit()) && (m_ooxBorder->m_oColor->GetValue() == SimpleTypes::hexcolorRGB)) { diff --git a/RtfFile/OOXml/Reader/OOXColorReader2.cpp b/RtfFile/OOXml/Reader/OOXColorReader2.cpp index d273fbeb9a..1ebbc6eee0 100644 --- a/RtfFile/OOXml/Reader/OOXColorReader2.cpp +++ b/RtfFile/OOXml/Reader/OOXColorReader2.cpp @@ -47,7 +47,7 @@ bool OOXColorReader2::Parse( ReaderParameter oParam, RtfColor& oOutputColor,std: // std::wstring val = oXmlReader.ReadNodeAttribute(sColor, L"" ); // if( !sThemeColor.empty() ) // { - // //Todo tx1 - моджет приходить text1 + // //Todo tx1 - may come as text1 // RtfColor::ThemeColor oTheme = RtfColor::TC_NONE; // if( sThemeColor == L"accent1" ) // oTheme = RtfColor::caccentone; @@ -86,7 +86,7 @@ bool OOXColorReader2::Parse( ReaderParameter oParam, RtfColor& oOutputColor,std: // if( true == oParam.oRtf->m_oColorTable.GetColor( oTheme , oOutputColor ) ) // { - // //из themeColor + // //from themeColor // int nShade = Strings::ToInteger( themeShade ); // if( nShade < 0 ) // nShade = 0; diff --git a/RtfFile/OOXml/Reader/OOXDocumentReader.cpp b/RtfFile/OOXml/Reader/OOXDocumentReader.cpp index a9f01b3530..9573aeefea 100644 --- a/RtfFile/OOXml/Reader/OOXDocumentReader.cpp +++ b/RtfFile/OOXml/Reader/OOXDocumentReader.cpp @@ -91,7 +91,7 @@ bool OOXDocumentReader::Parse(ReaderParameter oParam) { size_t last_section_start = 0; - //считаем количесво секций и заполняем их свойства .. + //count sections and fill their properties .. for (size_t i = 0; i < m_ooxDocument->m_arrItems.size(); ++i) { if (m_ooxDocument->m_arrItems[i] == NULL) continue; @@ -131,7 +131,7 @@ bool OOXDocumentReader::Parse(ReaderParameter oParam) section.end_para = m_ooxDocument->m_arrItems.size(); section.props->m_oProperty.SetDefaultOOX(); - if (m_ooxDocument->m_oSectPr.IsInit())// свойства последней секции + if (m_ooxDocument->m_oSectPr.IsInit())// last section properties { OOXSectionPropertyReader oSectReader(m_ooxDocument->m_oSectPr.GetPointer()); if (oSectReader.Parse(oParam, section.props->m_oProperty)) @@ -141,7 +141,7 @@ bool OOXDocumentReader::Parse(ReaderParameter oParam) } } //------------------------------------------------------------------------------------------------------------- - m_poDocument->RemoveItem(0); //бланковый при инициализации + m_poDocument->RemoveItem(0); //blank during initialization for (int sect = 0; sect < m_poDocument->GetCount(); sect++) { @@ -187,7 +187,7 @@ bool OOXSettingsReader::Parse(ReaderParameter oParam) } if (m_ooxSettings->m_oHyphenationZone.IsInit() && m_ooxSettings->m_oHyphenationZone->m_oVal.IsInit()) { - oParam.oRtf->m_oProperty.m_nHyphenationRight = m_ooxSettings->m_oHyphenationZone->m_oVal->ToTwips(); //todooo проверить размерность + oParam.oRtf->m_oProperty.m_nHyphenationRight = m_ooxSettings->m_oHyphenationZone->m_oVal->ToTwips(); //todooo check dimension } if (m_ooxSettings->m_oDefaultTabStop.IsInit() && m_ooxSettings->m_oDefaultTabStop->m_oVal.IsInit()) { @@ -223,7 +223,7 @@ bool OOXSettingsReader::Parse(ReaderParameter oParam) } if (m_ooxSettings->m_oCompat.IsInit()) { - // todooo - реализовать в DocxFormat + // todooo - implement in DocxFormat //if( L"w:doNotUseHTMLParagraphAutoSpacing" == sNodeName ) // oParam.oRtf->m_oProperty.m_bHtmlAutoSpace = 0; diff --git a/RtfFile/OOXml/Reader/OOXDrawingGraphicReader.cpp b/RtfFile/OOXml/Reader/OOXDrawingGraphicReader.cpp index 51fb62c59b..9bbb568770 100644 --- a/RtfFile/OOXml/Reader/OOXDrawingGraphicReader.cpp +++ b/RtfFile/OOXml/Reader/OOXDrawingGraphicReader.cpp @@ -57,7 +57,7 @@ int OOXGraphicReader::Parse( ReaderParameter oParam , RtfShapePtr & pOutput) } if (m_ooxGraphic->chartRec.IsInit()) { - //сгенерим ole (olePic) + //generate ole (olePic) m_ooxGraphic->ChartToOlePackageInStorage(oParam.oReader->m_currentContainer, oParam.oReader->m_sTempFolder, ++oParam.oReader->m_nCurOleChartId); } if (m_ooxGraphic->olePic.IsInit()) diff --git a/RtfFile/OOXml/Reader/OOXLevelReader.cpp b/RtfFile/OOXml/Reader/OOXLevelReader.cpp index 0ba6f4b329..7117ec09c7 100644 --- a/RtfFile/OOXml/Reader/OOXLevelReader.cpp +++ b/RtfFile/OOXml/Reader/OOXLevelReader.cpp @@ -63,7 +63,7 @@ bool OOXLevelReader::Parse( ReaderParameter oParam, RtfListLevelProperty& oLevel int nVal = *m_ooxLvlNum->m_oLvlRestart->m_oVal; if( 0 == nVal ) oLevelProperty.m_nNoRestart = 0; - //todooo непонятка что будет если рестарт списка с не "0" + //todooo unclear what happens if list restart is not "0" } if (m_ooxLvlNum->m_oIsLgl.IsInit() ) oLevelProperty.m_nLegal = m_ooxLvlNum->m_oIsLgl->m_oVal.ToBool() ? 1 : 0; diff --git a/RtfFile/OOXml/Reader/OOXParagraphElementReaders.cpp b/RtfFile/OOXml/Reader/OOXParagraphElementReaders.cpp index 6ea7ea4e23..1cec60e77c 100644 --- a/RtfFile/OOXml/Reader/OOXParagraphElementReaders.cpp +++ b/RtfFile/OOXml/Reader/OOXParagraphElementReaders.cpp @@ -104,12 +104,12 @@ bool OOXParagraphReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputPa } if (m_ooxParagraph == NULL) return false; - //надо default стиль применять до OOXParagraphReader - ////применяем default + //need to apply default style before OOXParagraphReader + ////apply default //oOutputParagraph.m_oProperty = oParam.oRtf->m_oDefaultParagraphProp; RtfTableStylePtr oResultTableStyle; - //сначала применяем default стиль (если это нужно) + //first apply default style (if needed) oOutputParagraph.m_oProperty.m_oCharProperty = m_oCharProperty; @@ -129,7 +129,7 @@ bool OOXParagraphReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputPa oOutputParagraph.m_oProperty.m_oCharProperty.Merge( oResultTableStyle->m_oCharProp ); } } - //формируем внешний стиль для вложенных элементов + //create external style for nested elements RtfCharStylePtr poExternalStyle; if( NULL != oResultTableStyle || PROP_DEF != oOutputParagraph.m_oProperty.m_nStyle ) { @@ -250,7 +250,7 @@ bool OOXParagraphReader::Parse3( ReaderParameter oParam , RtfParagraph& oOutputP oCurField->m_pInsert = RtfFieldInstPtr ( new RtfFieldInst() ); oCurField->m_pResult = RtfFieldInstPtr ( new RtfFieldInst() ); - //добавляем insert + //add insert RtfCharPtr pNewChar ( new RtfChar() ); pNewChar->m_bRtfEncode = false; if (pFldSimple->m_sInstr.IsInit()) @@ -261,7 +261,7 @@ bool OOXParagraphReader::Parse3( ReaderParameter oParam , RtfParagraph& oOutputP oNewInsertParagraph->AddItem( pNewChar ); oCurField->m_pInsert->m_pTextItems->AddItem( oNewInsertParagraph ); - //добаляем свойства + //add properties if( TRUE == pFldSimple->m_oFldLock.ToBool() ) oCurField->m_eMode = RtfField::fm_fldlock; @@ -269,10 +269,10 @@ bool OOXParagraphReader::Parse3( ReaderParameter oParam , RtfParagraph& oOutputP oCurField->m_eMode = RtfField::fm_flddirty; RtfParagraphPtr oNewResultParagraph( new RtfParagraph() ); - //применяем к новому параграфу default property + //apply default property to new paragraph oNewResultParagraph->m_oProperty = oParam.oRtf->m_oDefaultParagraphProp; oNewResultParagraph->m_oProperty.m_oCharProperty = oParam.oRtf->m_oDefaultCharProp; - //применяем к новому параграфу свойства данного параграфа + //apply this paragraph's properties to new paragraph oNewResultParagraph->m_oProperty = oOutputParagraph.m_oProperty; if (pFldSimple->m_arrItems.size() >0) @@ -309,7 +309,7 @@ bool OOXParagraphReader::Parse3( ReaderParameter oParam , RtfParagraph& oOutputP { sTarget += L"#" + *pHyperlink->m_sAnchor; } - //заменяем пробелы на %20 + //replace spaces with %20 XmlUtils::replace_all(sTarget, L" ", L"%20" ); std::wstring sFileUrl = L"file:///"; @@ -328,7 +328,7 @@ bool OOXParagraphReader::Parse3( ReaderParameter oParam , RtfParagraph& oOutputP oCurField->m_pInsert = RtfFieldInstPtr ( new RtfFieldInst() ); oCurField->m_pResult = RtfFieldInstPtr ( new RtfFieldInst() ); - //добавляем insert + //add insert RtfCharPtr pNewChar( new RtfChar() ); pNewChar->m_bRtfEncode = true;// false; std::wstring sFieldText; @@ -338,7 +338,7 @@ bool OOXParagraphReader::Parse3( ReaderParameter oParam , RtfParagraph& oOutputP RtfParagraphPtr oNewInsertParagraph( new RtfParagraph() ); oNewInsertParagraph->AddItem( pNewChar ); oCurField->m_pInsert->m_pTextItems->AddItem( oNewInsertParagraph ); - //добавляем свойства + //add properties //pHyperlink->m_arrItems todoooo //BOOL bLock = Strings::ToBoolean(oXmlReader.ReadNodeAttribute(i, L"w:fldLock", L"false))); @@ -349,10 +349,10 @@ bool OOXParagraphReader::Parse3( ReaderParameter oParam , RtfParagraph& oOutputP // oCurField->m_eMode = RtfField::fm_flddirty; RtfParagraphPtr oNewResultParagraph( new RtfParagraph() ); - //применяем к новому параграфу default property + //apply default property to new paragraph oNewResultParagraph->m_oProperty = oParam.oRtf->m_oDefaultParagraphProp; oNewResultParagraph->m_oProperty.m_oCharProperty = oParam.oRtf->m_oDefaultCharProp; - //применяем к новому параграфу свойства данного параграфа + //apply this paragraph's properties to new paragraph oNewResultParagraph->m_oProperty = oOutputParagraph.m_oProperty; if (pHyperlink->m_arrItems.size() >0) @@ -372,7 +372,7 @@ bool OOXParagraphReader::Parse3( ReaderParameter oParam , RtfParagraph& oOutputP oCurField->m_pInsert = RtfFieldInstPtr ( new RtfFieldInst() ); oCurField->m_pResult = RtfFieldInstPtr ( new RtfFieldInst() ); - //добавляем insert + //add insert RtfCharPtr pNewCharHYPER ( new RtfChar() ); pNewCharHYPER->m_bRtfEncode = false; pNewCharHYPER->setText( L"HYPERLINK \\l \"" + pHyperlink->m_sAnchor.get() +L"\""); @@ -381,7 +381,7 @@ bool OOXParagraphReader::Parse3( ReaderParameter oParam , RtfParagraph& oOutputP oNewInsertParagraph->AddItem( pNewCharHYPER ); oCurField->m_pInsert->m_pTextItems->AddItem( oNewInsertParagraph ); - ////добаляем свойства + ////add properties //BOOL bLock = Strings::ToBoolean(oXmlReader.ReadNodeAttribute(i, L"w:fldLock" ,L"false")); //if( TRUE == bLock ) // oCurField->m_eMode = RtfField::fm_fldlock; @@ -390,10 +390,10 @@ bool OOXParagraphReader::Parse3( ReaderParameter oParam , RtfParagraph& oOutputP // oCurField->m_eMode = RtfField::fm_flddirty; RtfParagraphPtr oNewResultParagraph ( new RtfParagraph() ); - //применяем к новому параграфу default property + //apply default property to new paragraph oNewResultParagraph->m_oProperty = oParam.oRtf->m_oDefaultParagraphProp; oNewResultParagraph->m_oProperty.m_oCharProperty = oParam.oRtf->m_oDefaultCharProp; - //применяем к новому параграфу свойства данного параграфа + //apply this paragraph's properties to new paragraph oNewResultParagraph->m_oProperty = oOutputParagraph.m_oProperty; if (pHyperlink->m_arrItems.size() > 0) @@ -770,7 +770,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap RtfShapePtr pNewShape ( new RtfShape() ); if (ooxObject) - {//важна последовательность обработки + {//processing order is important OOXShapeReader oShapeReaderType(ooxObject->m_oShapeType.GetPointer()); oShapeReaderType.Parse( oParam, pNewShape ); @@ -992,10 +992,10 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap //std::wstring sChar = ooxSym->m_oChar->GetValue(); //sChar.MakeLower(); - ////оставляем только 2 байта (4 символа) + ////keep only 2 bytes (4 characters) //if( sChar.length() > 4 ) // sChar = sChar.Right( 4 ); - ////убираем маску F000 + ////remove mask F000 //if( sChar.length() == 4 && 'f' == sChar[0] ) // sChar = sChar.Right( 3 ); @@ -1067,10 +1067,10 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap { RtfCharProperty oNewProperty; oNewProperty.SetDefaultOOX(); - //применяем default + //apply default oNewProperty = oParam.oRtf->m_oDefaultCharProp; - //применяем внешний стиль (часть свойств не наследуется!!) + //apply external style (some properties are not inherited!!) oNewProperty.Merge( oOutputParagraph.m_oProperty.m_oCharProperty, false ); oNewProperty.Merge( m_oCharProperty ); @@ -1112,7 +1112,7 @@ bool OOXpPrReader::Parse( ReaderParameter oParam, RtfParagraphProperty& oOutputP if (m_drawingParaProps) return ParseDrawing( oParam, oOutputProperty); if (m_ooxParaProps == NULL) return false; - //применяем внешний стиль + //apply external style if( NULL != oParam.poTableStyle ) { if( m_ooxParaProps->m_oCnfStyle.IsInit() ) @@ -1130,14 +1130,14 @@ bool OOXpPrReader::Parse( ReaderParameter oParam, RtfParagraphProperty& oOutputP oOutputProperty.Merge( oResultStyle->m_oParProp ); oOutputProperty.m_oCharProperty.Merge( oResultStyle->m_oCharProp ); } - //применяем стиль по-умолчанию,если не определен свой + //apply default style if own style is not defined if(( m_ooxParaProps->m_oPStyle.IsInit() == false ) && (true == m_bDefStyle && NULL != oParam.oReader->m_oDefParStyle )) { oOutputProperty.Merge( oParam.oReader->m_oDefParStyle->m_oParProp ); oOutputProperty.m_nStyle = oParam.oReader->m_oDefParStyle->m_nID; } - //применяем все остальные свойчтва direct formating + //apply all other direct formatting properties if( m_ooxParaProps->m_oPStyle.IsInit() && m_ooxParaProps->m_oPStyle->m_sVal.IsInit()) { std::wstring sStyleName = *m_ooxParaProps->m_oPStyle->m_sVal; @@ -1323,16 +1323,16 @@ bool OOXpPrReader::Parse( ReaderParameter oParam, RtfParagraphProperty& oOutputP } if( PROP_DEF != oOutputProperty.m_nListLevel && PROP_DEF != oOutputProperty.m_nListId ) { - //применяем direct свойства списка к параграфу + //apply list direct properties to paragraph RtfListOverrideProperty oListOverrideProperty; - //ищем по override table + //search in override table if( true == oParam.oRtf->m_oListOverrideTable.GetList( oOutputProperty.m_nListId, oListOverrideProperty ) ) { RtfListProperty oListProperty; - //Ищем по List Table + //Search in List Table if( true == oParam.oRtf->m_oListTable.GetList( oListOverrideProperty.m_nListID, oListProperty) ) { - //дописываем свойства параграфа firstIndent Indent + //add paragraph properties firstIndent Indent RtfListLevelProperty poLevelProp ; if( true == oListProperty.GetItem( poLevelProp , oOutputProperty.m_nListLevel ) ) { @@ -1425,7 +1425,7 @@ bool OOXpPrReader::Parse( ReaderParameter oParam, RtfParagraphProperty& oOutputP } if( m_ooxParaProps->m_oRPr.IsInit() ) - {// ??? todooo сохранять текстовые ствойсва и использовать там где в run нет этих свойств + {// ??? todooo store text properties and use where run lacks these properties OOXrPrReader orPrReader(m_ooxParaProps->m_oRPr.GetPointer()); orPrReader.Parse( oParam, oOutputProperty.m_oCharProperty ); } @@ -1567,8 +1567,8 @@ bool OOXrPrReader::Parse( ReaderParameter oParam, RtfCharProperty& oOutputProper if (m_ooxRunProps == NULL) return false; - //сначала применяем стили - //применяем стиль по-умолчанию,если не определен свой + //first apply styles + //apply default style if own style is not defined if(( m_ooxRunProps->m_oRStyle.IsInit() == false) && (true == m_bDefStyle && NULL != oParam.oReader->m_oDefCharStyle )) { oOutputProperty.Merge( oParam.oReader->m_oDefCharStyle->m_oCharProp ); @@ -2030,7 +2030,7 @@ bool OOXpPrFrameReader::Parse( ReaderParameter oParam ,RtfFrame& oOutputProperty default: break; } } - oOutputProperty.m_DropcapLines = m_ooxFramePr->m_oLines.IsInit() ? m_ooxFramePr->m_oLines->GetValue() : 0; //todoo ??? или 1 ??? + oOutputProperty.m_DropcapLines = m_ooxFramePr->m_oLines.IsInit() ? m_ooxFramePr->m_oLines->GetValue() : 0; //todoo ??? or 1 ??? if( m_ooxFramePr->m_oHSpace.IsInit() ) { @@ -2129,7 +2129,7 @@ bool OOXSectionPropertyReader::Parse( ReaderParameter oParam , RtfSectionPropert { switch(m_ooxSectionProperty->m_oEndnotePr->m_oNumRestart->m_oVal->GetValue()) { - case SimpleTypes::restartnumberContinious : break;// ???? todooo проверить + case SimpleTypes::restartnumberContinious : break;// ???? todooo check case SimpleTypes::restartnumberEachPage : oOutput.m_eEndnotesRestart = RtfSectionProperty::er_saftnrestart; break; case SimpleTypes::restartnumberEachSect : oOutput.m_eEndnotesRestart = RtfSectionProperty::er_saftnrstcont; break; default: break; @@ -2278,7 +2278,7 @@ bool OOXSectionPropertyReader::Parse( ReaderParameter oParam , RtfSectionPropert case SimpleTypes::textdirectionRlV : oOutput.m_nTextFollow = 3; break; case SimpleTypes::textdirectionTb : oOutput.m_nTextFollow = 0; break; case SimpleTypes::textdirectionTbV : oOutput.m_nTextFollow = 5; break; - //oOutput.m_nTextFollow = 2; bottom to top ( .. todooo переделать DocxFormat + //oOutput.m_nTextFollow = 2; bottom to top ( .. todooo refactor DocxFormat default: break; } } diff --git a/RtfFile/OOXml/Reader/OOXPictureAnchorReader.cpp b/RtfFile/OOXml/Reader/OOXPictureAnchorReader.cpp index c0998ec15f..8cc121f9a6 100644 --- a/RtfFile/OOXml/Reader/OOXPictureAnchorReader.cpp +++ b/RtfFile/OOXml/Reader/OOXPictureAnchorReader.cpp @@ -82,7 +82,7 @@ int OOXDrawingAnchorReader::Parse( ReaderParameter oParam , RtfShapePtr & pOutpu nWidth = (int)m_ooxAnchor->m_oExtent->m_oCx.ToTwips(); nHeight = (int)m_ooxAnchor->m_oExtent->m_oCy.ToTwips(); - if( PROP_DEF != pOutput->m_nLeft && PROP_DEF != pOutput->m_nTop )//всегда !! + if( PROP_DEF != pOutput->m_nLeft && PROP_DEF != pOutput->m_nTop )//always !! { pOutput->m_nRight = pOutput->m_nLeft + nWidth; pOutput->m_nBottom = pOutput->m_nTop + nHeight; diff --git a/RtfFile/OOXml/Reader/OOXReader.cpp b/RtfFile/OOXml/Reader/OOXReader.cpp index 96259855c8..bc8e835a07 100644 --- a/RtfFile/OOXml/Reader/OOXReader.cpp +++ b/RtfFile/OOXml/Reader/OOXReader.cpp @@ -62,7 +62,7 @@ bool OOXReader::Parse() oReaderParameter.oReader = this; if (inputDocxFile.m_oMain.settings) - { //важно чтобы первыми читались именно settings (например для footnote) + { //important that settings are read first (e.g. for footnote) OOXSettingsReader oSettingsReader( inputDocxFile.m_oMain.settings ); oSettingsReader.Parse( oReaderParameter ); } diff --git a/RtfFile/OOXml/Reader/OOXReader.h b/RtfFile/OOXml/Reader/OOXReader.h index 8dea8cadef..6d16dedb6d 100644 --- a/RtfFile/OOXml/Reader/OOXReader.h +++ b/RtfFile/OOXml/Reader/OOXReader.h @@ -63,7 +63,7 @@ public: RtfConvertationManager* m_convertationManager; std::wstring m_sPath; - int m_nCurItap = 0; //для определение вложенности таблицы + int m_nCurItap = 0; //for determining table nesting level bool m_bInTable = false; int m_nCurOleChartId; diff --git a/RtfFile/OOXml/Reader/OOXShapeReader.cpp b/RtfFile/OOXml/Reader/OOXShapeReader.cpp index 41c55f9a60..a5362d079c 100644 --- a/RtfFile/OOXml/Reader/OOXShapeReader.cpp +++ b/RtfFile/OOXml/Reader/OOXShapeReader.cpp @@ -172,22 +172,22 @@ bool OOXShapeReader::ParseVmlStyle(RtfShapePtr pShape, SimpleTypes::Vml::CCssPro }break; case SimpleTypes::Vml::cssptMsoWrapDistanceBottom: { - //todooo проверять на размерность + //todooo check dimension pShape->m_nWrapDistBottom = (int)(20 * prop->get_Value().oValue.dValue ); }break; case SimpleTypes::Vml::cssptMsoWrapDistanceLeft : { - //todooo проверять на размерность + //todooo check dimension pShape->m_nWrapDistLeft = (int)(20 * prop->get_Value().oValue.dValue ); }break; case SimpleTypes::Vml::cssptMsoWrapDistanceRight: { - //todooo проверять на размерность + //todooo check dimension pShape->m_nWrapDistRight = (int)(20 * prop->get_Value().oValue.dValue ); }break; case SimpleTypes::Vml::cssptMsoWrapDistanceTop : { - //todooo проверять на размерность + //todooo check dimension pShape->m_nWrapDistTop = (int)(20 * prop->get_Value().oValue.dValue ); }break; case SimpleTypes::Vml::cssptMsoWrapEdited: @@ -241,7 +241,7 @@ bool OOXShapeReader::ParseVmlStyle(RtfShapePtr pShape, SimpleTypes::Vml::CCssPro }break; case SimpleTypes::Vml::cssptVTextAnchor: { - pShape->m_nAnchorText = prop->get_Value().eVTextAnchor;//совпдает + pShape->m_nAnchorText = prop->get_Value().eVTextAnchor;//matches pShape->m_bFitShapeToText = 0; }break; case SimpleTypes::Vml::csspctMsoWidthPercent: @@ -414,7 +414,7 @@ bool OOXShapeReader::ParseVmlChild( ReaderParameter oParam , RtfShapePtr& pOutpu if (!stroke) break; if (stroke->m_oDahsStyle.IsInit()) - pOutput->m_nLineDashing = stroke->m_oDahsStyle->GetValue(); //совпадают значения + pOutput->m_nLineDashing = stroke->m_oDahsStyle->GetValue(); //values match if (stroke->m_oColor.IsInit()) pOutput->m_nLineColor = (stroke->m_oColor->Get_B() << 16) + (stroke->m_oColor->Get_G() << 8) + stroke->m_oColor->Get_R(); @@ -456,7 +456,7 @@ bool OOXShapeReader::ParseVmlChild( ReaderParameter oParam , RtfShapePtr& pOutpu int nCropedWidthGoal = pOutput->m_oPicture->m_nWidthGoal; if( PROP_DEF != nCropedWidthGoal ) { - //делаем crop + //do crop if( image_data->m_oCropLeft.IsInit() ) { double nCropLeft = image_data->m_oCropLeft->GetValue(); @@ -494,7 +494,7 @@ bool OOXShapeReader::ParseVmlChild( ReaderParameter oParam , RtfShapePtr& pOutpu nCropedHeightGoal -= pOutput->m_oPicture->m_nCropB; } } - //устанавливаем scale + //set scale if( PROP_DEF != pOutput->m_nLeft && PROP_DEF != pOutput->m_nRight && PROP_DEF != nCropedWidthGoal && 0 != nCropedWidthGoal ) { int nWidth = pOutput->m_nRight - pOutput->m_nLeft; @@ -616,7 +616,7 @@ bool OOXShapeReader::ParseVmlChild( ReaderParameter oParam , RtfShapePtr& pOutpu default: break; } } - //проверяем на inline + //check for inline if((PROP_DEF == pOutput->m_nLeft/* || 0 == pOutput->m_nLeft */) && ( PROP_DEF == pOutput->m_nTop/* || 0 == pOutput->m_nTop */) && PROP_DEF == pOutput->m_nPositionH && PROP_DEF == pOutput->m_nPositionV ) { @@ -804,12 +804,12 @@ bool OOXShapeReader::Parse(ReaderParameter oParam, RtfShapePtr& pOutput, PPTX::L //for (size_t i = 0 ; i < oox_bitmap_fill->m_oBlip->m_arrEffects.size(); i++) // convert(oox_bitmap_fill->m_oBlip->m_arrEffects[i]); } - if (oox_bitmap_fill->srcRect.IsInit())//часть изображения + if (oox_bitmap_fill->srcRect.IsInit())//part of image { int nCropedWidthGoal = pOutput->m_oPicture->m_nWidthGoal; if( PROP_DEF != nCropedWidthGoal ) { - //делаем crop + //do crop if (oox_bitmap_fill->srcRect->l.IsInit()) { double nCropLeft = XmlUtils::GetInteger( oox_bitmap_fill->srcRect->l.get()) / 100. ; @@ -849,7 +849,7 @@ bool OOXShapeReader::Parse(ReaderParameter oParam, RtfShapePtr& pOutput, PPTX::L nCropedHeightGoal -= pOutput->m_oPicture->m_nCropB; } } - //устанавливаем scale + //set scale if( PROP_DEF != pOutput->m_nLeft && PROP_DEF != pOutput->m_nRight && PROP_DEF != nCropedWidthGoal && 0 != nCropedWidthGoal ) { int nWidth = pOutput->m_nRight - pOutput->m_nLeft; @@ -1051,7 +1051,7 @@ void OOXShapeReader::Parse(ReaderParameter oParam, RtfShapePtr& pOutput, PPTX::L //nullable<SimpleTypes::CCompoundLine<>> m_oCmpd; - //ELineJoinType m_eJoinType; // Тип соединения линий + //ELineJoinType m_eJoinType; // line join type //nullable<OOX::Drawing::CLineJoinBevel> m_oBevel; //nullable<OOX::Drawing::CLineJoinMiterProperties> m_oMiter; //nullable<OOX::Drawing::CLineJoinRound> m_oRound; @@ -1417,7 +1417,7 @@ bool OOXShapeReader::ParsePic( ReaderParameter oParam, RtfShapePtr& pOutput) { pOutput->m_oPicture->eDataType = RtfPicture::dt_png; pOutput->m_oPicture->m_sPicFilename = ooxPic->blipFill.blip->oleFilepathImage; - pOutput->m_oPicture->m_bIsCopy = false; //не удалять + pOutput->m_oPicture->m_bIsCopy = false; //do not delete if (pOutput->m_oPicture->m_nWidthGoal == PROP_DEF) { @@ -1628,10 +1628,10 @@ bool OOXShapeReader::ParseVml(ReaderParameter oParam, RtfShapePtr& pOutput, bool pOutput->m_nID = oParam.oReader->m_oOOXIdGenerator.GetId(m_vmlElement->m_sId.get()); } - //pOutput->m_nLeft = 0; //стили только с widht height (например в Numbering) + //pOutput->m_nLeft = 0; //styles only with width height (e.g. in Numbering) //pOutput->m_nTop = 0; - // геометрия -------------------------------------------------------------------------------------------------------- + // geometry -------------------------------------------------------------------------------------------------------- SimpleTypes::Vml::CVmlPath * custom_path = NULL; int Width = 0, Height = 0; @@ -1913,7 +1913,7 @@ void OOXShapeReader::ParseAdjustment (RtfShape& oShape, std::wstring sAdjustment } bool OOXShapeReader::WriteDataToPicture( std::wstring sPath, RtfPicture& pOutput, ReaderParameter& oParam) { - OOX::CPath ooxPath = sPath; //для target + OOX::CPath ooxPath = sPath; //for target if (!oParam.oReader->m_sTempFolder.empty()) ooxPath = oParam.oReader->m_sTempFolder + FILE_SEPARATOR_STR; @@ -1921,17 +1921,17 @@ bool OOXShapeReader::WriteDataToPicture( std::wstring sPath, RtfPicture& pOutput pOutput.m_dScaleX = 100; pOutput.m_dScaleY = 100; - //Выставляем тип картинки + //Set picture type pOutput.eDataType = RtfPicture::GetPictureType( sPath ); - //ecли тип не поддерживается rtf конвертируем в png + //if type is not supported by rtf, convert to png if( RtfPicture::dt_none == pOutput.eDataType ) { - //в туже папку что и исходная картинка + //in the same folder as the source image CBgraFrame image; if (image.OpenFile(sPath) == false ) return false; - //правильно выставляем размеры + //set correct dimensions pOutput.m_nWidthGoal = image.get_Width() * 15; //pixels to twip ( 1440 / 96 ) pOutput.m_nHeightGoal = image.get_Height()* 15; //pixels to twip ( 1440 / 96 ) @@ -1940,14 +1940,14 @@ bool OOXShapeReader::WriteDataToPicture( std::wstring sPath, RtfPicture& pOutput if (image.SaveFile(sTargetFile, 4 /*_CXIMAGE_FORMAT_PNG*/) ) { pOutput.eDataType = RtfPicture::dt_png; - //Запоминаем имя + //Store filename pOutput.m_sPicFilename = sTargetFile; - pOutput.m_bIsCopy = true;//выставляем флаг чтобы потом удалить файл + pOutput.m_bIsCopy = true;//set flag to delete file later } } else if( RtfPicture::dt_apm == pOutput.eDataType ) { - //убираем заголовок apm (22 byte) + //remove apm header (22 byte) NSFile::CFileBinary file_inp; //mpa NSFile::CFileBinary file_out;//wmf @@ -1991,7 +1991,7 @@ bool OOXShapeReader::WriteDataToPicture( std::wstring sPath, RtfPicture& pOutput file_out.CloseFile(); pOutput.eDataType = RtfPicture::dt_wmf; - //Запоминаем имя + //Store filename pOutput.m_sPicFilename = sTargetFile; pOutput.m_bIsCopy = true; } @@ -2017,22 +2017,22 @@ bool OOXShapeReader::WriteDataToPicture( std::wstring sPath, RtfPicture& pOutput pOutput.m_nHeightGoal = (int)(dH * 15); //pixels to twip; } RELEASEOBJECT(meta); - //Запоминаем только имя + //Store only filename pOutput.m_sPicFilename = sPath; - pOutput.m_bIsCopy = false; //не удалять + pOutput.m_bIsCopy = false; //do not delete } else {//png, jpeg CBgraFrame image; if (image.OpenFile(sPath, 0) == false ) return false; - //правильно выставляем размеры + //set correct dimensions pOutput.m_nWidthGoal = image.get_Width() * 15; //pixels to twip pOutput.m_nHeightGoal = image.get_Height() * 15; //pixels to twip; - //Запоминаем только имя + //Store only filename pOutput.m_sPicFilename = sPath; - pOutput.m_bIsCopy = false; //не удалять + pOutput.m_bIsCopy = false; //do not delete } } return true; diff --git a/RtfFile/OOXml/Reader/OOXStyleReader.cpp b/RtfFile/OOXml/Reader/OOXStyleReader.cpp index 8df577b4d5..3d731ad1b0 100644 --- a/RtfFile/OOXml/Reader/OOXStyleReader.cpp +++ b/RtfFile/OOXml/Reader/OOXStyleReader.cpp @@ -96,7 +96,7 @@ bool OOXStyleReader::ParseStyle( ReaderParameter oParam, RtfStylePtr& oOutputSty if (m_ooxStyle->m_oUiPriority.IsInit()) oNewStyle->m_bCompose = *m_ooxStyle->m_oUiPriority->m_oVal; - if (m_ooxStyle->m_oRunPr.IsInit() && ( RtfStyle::stCharacter == eStyleType || RtfStyle::stParagraph == eStyleType || RtfStyle::stTable == eStyleType ))//todo с rtf стилями + if (m_ooxStyle->m_oRunPr.IsInit() && ( RtfStyle::stCharacter == eStyleType || RtfStyle::stParagraph == eStyleType || RtfStyle::stTable == eStyleType ))//todo with rtf styles { RtfCharStylePtr oNewCharStyle = boost::static_pointer_cast<RtfCharStyle, RtfStyle>( oNewStyle ); @@ -115,7 +115,7 @@ bool OOXStyleReader::ParseStyle( ReaderParameter oParam, RtfStylePtr& oOutputSty CcnfStyle style; opPrReader.Parse( oParam, oNewParStyle->m_oParProp, style ); - //oNewParStyle->m_oParProp.m_nListId = PROP_DEF; //экспериментально вроде нельзя иметь numbering в параграф стиле + //oNewParStyle->m_oParProp.m_nListId = PROP_DEF; //experimentally, numbering in paragraph style seems not allowed //oNewParStyle->m_oParProp.m_nListLevel = PROP_DEF; } @@ -175,7 +175,7 @@ bool OOXStyleReader::ParseStyle( ReaderParameter oParam, RtfStylePtr& oOutputSty case SimpleTypes::tblstyleoverridetypeBand1Vert : { oTableStyle->m_oBandVerOdd = boost::static_pointer_cast<RtfTableStyle, RtfStyle>( oNewSubStyle ); - oTableStyle->m_oBandVerOdd->m_oParProp.m_bStyleOddColBand = 1; //для конвертации в Rtf + oTableStyle->m_oBandVerOdd->m_oParProp.m_bStyleOddColBand = 1; //for conversion to Rtf }break; case SimpleTypes::tblstyleoverridetypeBand2Horz : { @@ -260,10 +260,10 @@ bool OOXStyleReader::ParseTableStyle(OOX::Logic::CTableStyleProperties * oox_tab oOutputStyle = RtfStylePtr ( new RtfTableStyle() ); oOutputStyle->m_nID = oParam.oRtf->m_oStyleTable.GetCount() + 1; } - RtfStyle::_StyleType eStyleType = oOutputStyle->m_eType;//todooo проверить + RtfStyle::_StyleType eStyleType = oOutputStyle->m_eType;//todooo check if (oox_tableStyle->m_oRunPr.IsInit() && - ( RtfStyle::stCharacter == eStyleType || RtfStyle::stParagraph == eStyleType || RtfStyle::stTable == eStyleType ))//todo с rtf стилями + ( RtfStyle::stCharacter == eStyleType || RtfStyle::stParagraph == eStyleType || RtfStyle::stTable == eStyleType ))//todo with rtf styles { RtfCharStylePtr oNewCharStyle = boost::static_pointer_cast<RtfCharStyle, RtfStyle>( oOutputStyle ); @@ -283,7 +283,7 @@ bool OOXStyleReader::ParseTableStyle(OOX::Logic::CTableStyleProperties * oox_tab opPrReader.Parse( oParam, oNewParStyle->m_oParProp, style ); - oNewParStyle->m_oParProp.m_nListId = PROP_DEF; //экспериментально вроде нельзя иметь numbering в параграф стиле + oNewParStyle->m_oParProp.m_nListId = PROP_DEF; //experimentally, numbering in paragraph style seems not allowed oNewParStyle->m_oParProp.m_nListLevel = PROP_DEF; } diff --git a/RtfFile/OOXml/Reader/OOXStyleTableReader.cpp b/RtfFile/OOXml/Reader/OOXStyleTableReader.cpp index 20720e0779..d2cf30674d 100644 --- a/RtfFile/OOXml/Reader/OOXStyleTableReader.cpp +++ b/RtfFile/OOXml/Reader/OOXStyleTableReader.cpp @@ -60,7 +60,7 @@ bool OOXStyleTableReader::Parse( ReaderParameter oParam ) if( NULL != oNewStyle ) oParam.oRtf->m_oStyleTable.AddItem( oNewStyle ); } - //только чтобы добавить связи между стилями + //only to add links between styles for (size_t i=0; i< m_ooxStyles->m_arrStyle.size(); i++) { diff --git a/RtfFile/OOXml/Reader/OOXTableReader.cpp b/RtfFile/OOXml/Reader/OOXTableReader.cpp index f98f439982..a8d30fde39 100644 --- a/RtfFile/OOXml/Reader/OOXTableReader.cpp +++ b/RtfFile/OOXml/Reader/OOXTableReader.cpp @@ -46,7 +46,7 @@ bool OOXtrPrReader::Parse( ReaderParameter oParam , RtfRowProperty& oOutputPrope { if (m_ooxTableRowProps == NULL) return false; - //ищем cnfStyle и применяем внешний стиль + //find cnfStyle and apply external style if( NULL != oParam.poTableStyle ) { if( m_ooxTableRowProps->m_oCnfStyle.IsInit() ) @@ -65,7 +65,7 @@ bool OOXtrPrReader::Parse( ReaderParameter oParam , RtfRowProperty& oOutputPrope if (m_ooxTableRowProps->m_oTblHeader.IsInit() ) oOutputProperty.m_bIsHeader = m_ooxTableRowProps->m_oTblHeader->m_oVal.ToBool() ? 1 : 0; -//todooo непонятнка +//todooo unclear // if (m_ooxTableRowProps->m_oCantSplit.IsInit() ) // oOutputProperty.m_bIsHeader= m_ooxTableRowProps->m_oCantSplit->m_oVal.ToBool() ? 1 : 0; @@ -131,7 +131,7 @@ bool OOXTableReader::Parse( ReaderParameter oParam, RtfTable& oOutputTable ) if (m_ooxTable == NULL) return false; bool bExistTablPr = false; - //сначала читаем свойства + //first read properties if(m_ooxTable->m_oTableProperties ) { OOXtblPrReader otblPrReader(m_ooxTable->m_oTableProperties); @@ -139,7 +139,7 @@ bool OOXTableReader::Parse( ReaderParameter oParam, RtfTable& oOutputTable ) bExistTablPr = true; } - //формируем внешний стиль для вложенных элементов + //create external style for nested elements RtfTableStylePtr poTableStyle; if( PROP_DEF != oOutputTable.m_oProperty.m_nStyle ) { @@ -152,16 +152,16 @@ bool OOXTableReader::Parse( ReaderParameter oParam, RtfTable& oOutputTable ) poTableStyle = boost::static_pointer_cast<RtfTableStyle, RtfStyle>( oResultStyle ); poTableStyle->m_oTableProp = oOutputTable.m_oProperty; - //TableProperty ставим как уже прочитали чтобы не терять порядок применения свойст - //например индент последовательно затирает друг друга в стилях, numbering, просто в свойствах - //затирает свойства и на First, Last .... todoooo + //Set TableProperty as already read to maintain property application order + //for example indent sequentially overwrites each other in styles, numbering, just in properties + //overwrites properties on First, Last .... todoooo } } } else if( true == bExistTablPr ) { RtfTableStylePtr poTableStyle ( new RtfTableStyle() ); - poTableStyle->m_oTableProp.Merge( oOutputTable.m_oProperty ); // будут использованы ниже + poTableStyle->m_oTableProp.Merge( oOutputTable.m_oProperty ); // will be used below } if( m_ooxTable->m_oTblGrid.IsInit() ) @@ -186,8 +186,8 @@ bool OOXTableReader::Parse( ReaderParameter oParam, RtfTable& oOutputTable ) newParam.poTableStyle = poTableStyle; RtfTableRowPtr oNewRow ( new RtfTableRow() ); - //применяем свойства таблицы к каждому row - //т.к. в RTF нет свойств таблиц и все свойства записываются в свойства row + //apply table properties to each row + //since RTF has no table properties and all properties are written to row properties (*((RtfTableProperty*)&oNewRow->m_oProperty)).Merge( oOutputTable.m_oProperty ); OOX::Logic::CTr *ooxRow = dynamic_cast<OOX::Logic::CTr *>(m_ooxTable->m_arrItems[i]); @@ -201,7 +201,7 @@ bool OOXTableReader::Parse( ReaderParameter oParam, RtfTable& oOutputTable ) ApplyParagraphProperty( oOutputTable ); return true; } -//применяет свойства параграфа связанные с положением +//applies paragraph properties related to position void OOXTableReader::ApplyParagraphProperty( RtfTable& oOutputTable ) { for (int i = 0; i < oOutputTable.GetCount(); i++ ) @@ -247,11 +247,11 @@ bool OOXTableRowReader::Parse( ReaderParameter oParam, RtfTableRow& oOutputRow, if (nCurRow == nRowCount - 1 && oOutputRow.m_oProperty.m_bAutoLastRow == 1) oConditionStyle.bLastRow = true; - //сначала применяем свойства + //first apply properties if( m_ooxRowTable->m_pTableRowProperties ) { OOXtrPrReader otrPrReader(m_ooxRowTable->m_pTableRowProperties); - otrPrReader.Parse( oParam, oOutputRow.m_oProperty, oConditionStyle);// может поменяться на любой condition(first row) + otrPrReader.Parse( oParam, oOutputRow.m_oProperty, oConditionStyle);// may change to any condition (first row) } int nCellCount = m_ooxRowTable->m_nCountCell, nCurCell = 0; @@ -272,9 +272,9 @@ bool OOXTableRowReader::Parse( ReaderParameter oParam, RtfTableRow& oOutputRow, OOXTableCellReader oCellReader(ooxCell, m_ooxTableProps ); oCellReader.Parse( oParam, *oNewCell, oConditionStyle, nCurCell++, nCurRow, nCellCount, nRowCount ); - //добавляем cell + //add cell oOutputRow.AddItem(oNewCell); - //свойства cell в row + //cell properties in row oOutputRow.m_oProperty.AddItem( oNewCell->m_oProperty ); } return true; @@ -292,7 +292,7 @@ bool OOXTableCellReader::Parse( ReaderParameter oParam ,RtfTableCell& oOutputCel if( m_ooxTableCell->m_pTableCellProperties ) { OOXtcPrReader oCellPropReader(m_ooxTableCell->m_pTableCellProperties, m_ooxTableProps); - oCellPropReader.Parse( oParam, oOutputCell.m_oProperty, oConditionalTableStyle, nCurCell, nCellCount, nCurRow, nRowCount );//может поменяться на любой condition (firstRow) + oCellPropReader.Parse( oParam, oOutputCell.m_oProperty, oConditionalTableStyle, nCurCell, nCellCount, nCurRow, nRowCount );//may change to any condition (firstRow) } else { diff --git a/RtfFile/OOXml/Reader/OOXTextItemReader.cpp b/RtfFile/OOXml/Reader/OOXTextItemReader.cpp index 371163468d..579476ad89 100644 --- a/RtfFile/OOXml/Reader/OOXTextItemReader.cpp +++ b/RtfFile/OOXml/Reader/OOXTextItemReader.cpp @@ -57,7 +57,7 @@ bool OOXTextItemReader::Parse(OOX::WritingElement* ooxElement, ReaderParameter o OOXParagraphReader oParagraphReader(pParagraph); RtfParagraphPtr oNewParagraph(new RtfParagraph()); - //применяем к новому параграфу default property + //apply default property to new paragraph oNewParagraph->m_oProperty = oParam.oRtf->m_oDefaultParagraphProp; oNewParagraph->m_oProperty.m_oCharProperty = oParam.oRtf->m_oDefaultCharProp; oNewParagraph->m_oProperty.m_nItap = 0; @@ -73,7 +73,7 @@ bool OOXTextItemReader::Parse(OOX::WritingElement* ooxElement, ReaderParameter o OOXParagraphReader oParagraphReader(pParagraph); RtfParagraphPtr oNewParagraph(new RtfParagraph()); - //применяем к новому параграфу default property + //apply default property to new paragraph oNewParagraph->m_oProperty = oParam.oRtf->m_oDefaultParagraphProp; oNewParagraph->m_oProperty.m_oCharProperty = oParam.oRtf->m_oDefaultCharProp; @@ -148,7 +148,7 @@ bool OOXTextItemReader::Parse(OOX::WritingElement* ooxElement, ReaderParameter o oParagraph.m_oParagraphProperty->m_oKeepLines.Init(); oParagraph.m_oParagraphProperty->m_oKeepLines->m_oVal.SetValue(SimpleTypes::EOnOff::onoffTrue); - //применяем к новому параграфу default property + //apply default property to new paragraph oNewParagraph->m_oProperty = oParam.oRtf->m_oDefaultParagraphProp; oNewParagraph->m_oProperty.m_oCharProperty = oParam.oRtf->m_oDefaultCharProp; oNewParagraph->m_oProperty.m_nItap = 0; diff --git a/RtfFile/OOXml/Reader/OOXcnfStyleReader.cpp b/RtfFile/OOXml/Reader/OOXcnfStyleReader.cpp index b085df0db4..3fd4de414c 100644 --- a/RtfFile/OOXml/Reader/OOXcnfStyleReader.cpp +++ b/RtfFile/OOXml/Reader/OOXcnfStyleReader.cpp @@ -174,7 +174,7 @@ void CcnfStyle::ApplyTableStyleToCellBorder( RtfTableStylePtr oInputStyle, RtfCe if( PROP_DEF != oInputStyle->m_oTableProp.m_nColBandSize ) nColsInBand = oInputStyle->m_oTableProp.m_nColBandSize; - //обнуляем + //reset oOutputProperty.m_oBorderDiagonalLR = RtfBorder(); oOutputProperty.m_oBorderDiagonalRL = RtfBorder(); oOutputProperty.m_oBorderLeft = RtfBorder(); @@ -183,10 +183,10 @@ void CcnfStyle::ApplyTableStyleToCellBorder( RtfTableStylePtr oInputStyle, RtfCe oOutputProperty.m_oBorderBottom = RtfBorder(); oOutputProperty.m_oBorderInsideH = RtfBorder(); oOutputProperty.m_oBorderInsideV = RtfBorder(); - //От всей таблицы + //From the whole table ApplyTableStyleToCellBorder( oInputStyle, oOutputProperty, nCurX, nCurY, 0, nWidth - 1, 0, nHeight - 1 ); - //От OddVBand + //From OddVBand if( 1 != oInputStyle->m_oTableProp.m_bAutoNoColBand && nColsInBand > 0 ) { int nBoundLeft = 0; @@ -197,9 +197,9 @@ void CcnfStyle::ApplyTableStyleToCellBorder( RtfTableStylePtr oInputStyle, RtfCe nBoundRight --; if( nBoundLeft <= nBoundRight && nBoundLeft <= nCurX && nCurX <= nBoundRight ) { - int nDelta = nCurX - nBoundLeft;//получаем количество столбцов между - int nPlace = nDelta % nColsInBand;//получаем номер внутри band - //будем считать что флаги расставлены правильно + int nDelta = nCurX - nBoundLeft;//get the number of columns between + int nPlace = nDelta % nColsInBand;//get the position within band + //assume flags are set correctly if( true == bOddVBand && NULL != oInputStyle->m_oBandVerOdd ) ApplyOneStyleToCellBorder( oInputStyle->m_oBandVerOdd, oOutputProperty, nCurX, nCurY, nCurX - nPlace, nCurX - nPlace + nColsInBand - 1, 0, nHeight - 1 ); if( true == bEvenVBand && NULL != oInputStyle->m_oBandVerEven ) @@ -217,9 +217,9 @@ void CcnfStyle::ApplyTableStyleToCellBorder( RtfTableStylePtr oInputStyle, RtfCe nBoundBottom --; if( nBoundTop <= nBoundBottom && nBoundTop <= nCurY && nCurY <= nBoundBottom ) { - int nDelta = nCurY - nBoundTop;//получаем количество столбцов между - int nPlace = nDelta % nRowsInBand;//получаем номер внутри band - //будем считать что флаги расставлены правильно + int nDelta = nCurY - nBoundTop;//get the number of columns between + int nPlace = nDelta % nRowsInBand;//get the position within band + //assume flags are set correctly if( true == bOddHBand && NULL != oInputStyle->m_oBandHorOdd ) ApplyOneStyleToCellBorder( oInputStyle->m_oBandHorOdd, oOutputProperty, nCurX, nCurY, 0, nWidth - 1, nCurY - nPlace, nCurY - nPlace + nRowsInBand - 1 ); if( true == bEvenHBand && NULL != oInputStyle->m_oBandHorEven ) @@ -302,7 +302,7 @@ void CcnfStyle::ApplyOneStyleToCellBorder( RtfTableStylePtr oInputStyle, RtfCell return; if( !(nBoundLeft <= nCurX && nCurX <= nBoundRight && nBoundTop <= nCurY && nCurY <= nBoundBottom) ) return; - //на них ни что не влияет + //nothing affects them oOutputProperty.m_oBorderDiagonalLR.Merge( oInputStyle->m_oCellProp.m_oBorderDiagonalLR ); oOutputProperty.m_oBorderDiagonalRL.Merge( oInputStyle->m_oCellProp.m_oBorderDiagonalRL ); @@ -363,7 +363,7 @@ bool OOXcnfStyleReader::Parse( ReaderParameter oParam, CcnfStyle& oOutput) oOutput.bEvenVBand = m_ooxCnfStyle->m_oVal->IsBand2Vertical(); oOutput.bOddHBand = m_ooxCnfStyle->m_oVal->IsBand1Horizontal(); oOutput.bEvenHBand = m_ooxCnfStyle->m_oVal->IsBand2Horizontal(); - oOutput.bFirstRowLastCol = m_ooxCnfStyle->m_oVal->IsNeCell(); //северо восток + oOutput.bFirstRowLastCol = m_ooxCnfStyle->m_oVal->IsNeCell(); //north east oOutput.bFirstRowFirstCol = m_ooxCnfStyle->m_oVal->IsNwCell(); oOutput.bLastRowLastCol = m_ooxCnfStyle->m_oVal->IsSeCell(); oOutput.bLastRowFirstCol = m_ooxCnfStyle->m_oVal->IsSwCell(); diff --git a/RtfFile/OOXml/Reader/OOXtblPrReader.cpp b/RtfFile/OOXml/Reader/OOXtblPrReader.cpp index 32f2caa5ee..c83ee32f18 100644 --- a/RtfFile/OOXml/Reader/OOXtblPrReader.cpp +++ b/RtfFile/OOXml/Reader/OOXtblPrReader.cpp @@ -48,9 +48,9 @@ bool OOXtblPrReader::Parse( ReaderParameter oParam , RtfTableProperty& oOutputPr { if (m_ooxTableProps == NULL) return false; - //сначала применяем стили + //first apply styles - //применяем стиль по-умолчанию,если не определен свой + //apply default style if no custom style defined if( m_ooxTableProps->m_oTblStyle.IsInit() == false && true == m_bDefStyle && NULL != oParam.oReader->m_oDefTableStyle ) { oOutputProperty.Merge( oParam.oReader->m_oDefTableStyle->m_oTableProp ); diff --git a/RtfFile/OOXml/Reader/OOXtcPrReader.cpp b/RtfFile/OOXml/Reader/OOXtcPrReader.cpp index 33fd26deca..f25d6aab1a 100644 --- a/RtfFile/OOXml/Reader/OOXtcPrReader.cpp +++ b/RtfFile/OOXml/Reader/OOXtcPrReader.cpp @@ -42,7 +42,7 @@ bool OOXtcPrReader::Parse( ReaderParameter oParam ,RtfCellProperty& oOutputPrope { if (m_ooxTableCellProps == NULL) return false; - //ищем cnfStyle и применяем внешний стиль + //find cnfStyle and apply external style if( NULL != oParam.poTableStyle ) { if( m_ooxTableCellProps->m_oCnfStyle.IsInit() ) @@ -232,5 +232,5 @@ void OOXtcPrReader::Parse(ComplexTypes::Word::CTblWidth* margin, int& type, int& value = (int)margin->m_oW->GetValue(); } - //todooo сделать реализацию с процентами + //todooo implement percentages } diff --git a/RtfFile/OOXml/Writer/OOXDocumentWriter.cpp b/RtfFile/OOXml/Writer/OOXDocumentWriter.cpp index 4677324bf8..a597531de2 100644 --- a/RtfFile/OOXml/Writer/OOXDocumentWriter.cpp +++ b/RtfFile/OOXml/Writer/OOXDocumentWriter.cpp @@ -52,14 +52,14 @@ OOXDocumentWriter::~OOXDocumentWriter() std::wstring OOXDocumentWriter::CreateXmlStart() { - //пишем Footnotes + //write Footnotes RenderParameter oNewParam; oNewParam.poDocument = &m_oDocument; oNewParam.poWriter = &m_oWriter; oNewParam.poRels = &m_oWriter.m_oDocRels; oNewParam.nType = RENDER_TO_OOX_PARAM_UNKNOWN; - //пишем document.xml + //write document.xml std::wstring sResult = L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n"; sResult += L"<w:document \ xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \ @@ -107,7 +107,7 @@ std::wstring OOXDocumentWriter::CreateXmlEnd( ) { std::wstring sResult ; - //пишем все кроме document.xml + //write everything except document.xml RenderParameter oNewParam; oNewParam.poDocument = &m_oDocument; oNewParam.poWriter = &m_oWriter; @@ -208,7 +208,7 @@ std::wstring OOXDocumentWriter::CreateXmlEnd( ) m_oDocument.m_oInformation.RenderToOOX(oNewParam); - //пишем финальные свойства секции + //write final section properties oNewParam.poDocument = &m_oDocument; oNewParam.poWriter = &m_oWriter; oNewParam.poRels = &m_oWriter.m_oDocRels; @@ -336,7 +336,7 @@ bool OOXDocumentWriter::SaveBySection() if (m_oDocument.GetCount() > 1 ) { - m_oDocument.RemoveItem( 0 ); //удаляем секцию кроме последней + m_oDocument.RemoveItem( 0 ); //remove section except last one } else { @@ -357,7 +357,7 @@ bool OOXDocumentWriter::SaveByItem() oNewParam.poRels = &m_oWriter.m_oDocRels; oNewParam.nType = RENDER_TO_OOX_PARAM_UNKNOWN; - if( m_oDocument.GetCount() > 1)//если что-то есть в следующей секции значит предыдущая закончилась + if( m_oDocument.GetCount() > 1)//if there's something in the next section, the previous one has ended { std::wstring sXml, sectPr; @@ -394,16 +394,16 @@ bool OOXDocumentWriter::SaveByItem() } else { - //генерация ??? + //generation ??? sXml = L"<w:p><w:pPr>" + sectPr + L"</w:pPr></w:p>"; } std::string sXmlUTF = NSFile::CUtf8Converter::GetUtf8StringFromUnicode(sXml); m_oFileWriter->Write((BYTE*)sXmlUTF.c_str(), sXmlUTF.length()); - m_oDocument.RemoveItem( 0 ); //удаляем секцию + m_oDocument.RemoveItem( 0 ); //remove section } - else if( m_oDocument.GetCount() > 0 && m_oDocument[0].props->GetCount() > 1 )//пишем параграф - один всегда "прозапас для секций" + else if( m_oDocument.GetCount() > 0 && m_oDocument[0].props->GetCount() > 1 )//write paragraph - one is always "reserve for sections" { std::wstring sXml = m_oDocument[0].props->operator[](0)->RenderToOOX(oNewParam); std::string sXmlUTF = NSFile::CUtf8Converter::GetUtf8StringFromUnicode(sXml); @@ -412,7 +412,7 @@ bool OOXDocumentWriter::SaveByItem() { m_oFileWriter->Write((BYTE*)sXmlUTF.c_str(), sXmlUTF.length()); } - m_oDocument[0].props->RemoveItem( 0 );//удаляем первый параграф + m_oDocument[0].props->RemoveItem( 0 );//remove first paragraph } } return true; @@ -425,10 +425,10 @@ bool OOXDocumentWriter::SaveByItemEnd() oNewParam.poRels = &m_oWriter.m_oDocRels; oNewParam.nType = RENDER_TO_OOX_PARAM_UNKNOWN; - if( m_oDocument.GetCount() > 0 && m_oDocument[0].props->GetCount() > 0 )//дописываем последний параграф + if( m_oDocument.GetCount() > 0 && m_oDocument[0].props->GetCount() > 0 )//write last paragraph { std::wstring sXml = m_oDocument[0].props->operator[](0)->RenderToOOX(oNewParam); - //удаляем первый параграф + //remove first paragraph m_oDocument[0].props->RemoveItem( 0 ); std::string sXmlUTF = NSFile::CUtf8Converter::GetUtf8StringFromUnicode(sXml); diff --git a/RtfFile/OOXml/Writer/OOXDocumentWriter.h b/RtfFile/OOXml/Writer/OOXDocumentWriter.h index 1e0a0a81fe..aef4fda3af 100644 --- a/RtfFile/OOXml/Writer/OOXDocumentWriter.h +++ b/RtfFile/OOXml/Writer/OOXDocumentWriter.h @@ -41,7 +41,7 @@ private: OOXWriter& m_oWriter; RtfDocument& m_oDocument; NFileWriter::CBufferedFileWriter* m_oFileWriter; - bool m_bFirst; //один параграф пишем другой храним в памяти + bool m_bFirst; //write one paragraph, keep another in memory public: OOXDocumentWriter( OOXWriter& oWriter,RtfDocument& oDocument ); diff --git a/RtfFile/OOXml/Writer/OOXSettingsWriter.cpp b/RtfFile/OOXml/Writer/OOXSettingsWriter.cpp index 4ee3c3afa9..16b7ab8e7c 100644 --- a/RtfFile/OOXml/Writer/OOXSettingsWriter.cpp +++ b/RtfFile/OOXml/Writer/OOXSettingsWriter.cpp @@ -57,12 +57,12 @@ bool OOXSettingsWriter::Save( std::wstring sFolder ) if ( false == m_sFileXml.empty() ) { - //генерируем свою xml + //generate our xml std::wstring sXml = CreateXml(); - //todoooo ПЕРЕПИСАТЬ + //todoooo REWRITE - ////берем xml из шаблона + ////take xml from template //std::wstring sFilename = sFolder + _T("\\word\\settings.xml"); //if( true == RtfUtility:: SaveResourceToFile( IDR_SETTINGS, L"XML", sFilename ) ) //{ diff --git a/RtfFile/OOXml/Writer/OOXThemeWriter.cpp b/RtfFile/OOXml/Writer/OOXThemeWriter.cpp index 042cb10a2f..06441f1606 100644 --- a/RtfFile/OOXml/Writer/OOXThemeWriter.cpp +++ b/RtfFile/OOXml/Writer/OOXThemeWriter.cpp @@ -37,7 +37,7 @@ OOXThemeWriter::OOXThemeWriter(OOXWriter& oWriter,RtfDocument& oDocument ):m_oWriter(oWriter) { } -bool OOXThemeWriter::Save( std::wstring sFolder ) //todo доделать очистку поле ошибок +bool OOXThemeWriter::Save( std::wstring sFolder ) //todo finish error field cleanup { std::wstring pathWord = sFolder + FILE_SEPARATOR_STR + _T("word"); diff --git a/RtfFile/OOXml/Writer/OOXThemeWriter.h b/RtfFile/OOXml/Writer/OOXThemeWriter.h index 5448ac9725..812c91a958 100644 --- a/RtfFile/OOXml/Writer/OOXThemeWriter.h +++ b/RtfFile/OOXml/Writer/OOXThemeWriter.h @@ -42,5 +42,5 @@ private: public: OOXThemeWriter(OOXWriter& oWriter,RtfDocument& oDocument ); - bool Save( std::wstring sFolder ); //todo доделать очистку поле ошибок + bool Save( std::wstring sFolder ); //todo complete cleanup after errors }; diff --git a/RtfFile/OOXml/Writer/OOXWriter.cpp b/RtfFile/OOXml/Writer/OOXWriter.cpp index cb93ad43c0..cc4304e9d8 100644 --- a/RtfFile/OOXml/Writer/OOXWriter.cpp +++ b/RtfFile/OOXml/Writer/OOXWriter.cpp @@ -154,7 +154,7 @@ bool OOXWriter::SaveByItemEnd() ((OOXStylesWriter*) m_poStylesWriter)->Save (m_sTargetFolder); ((OOXFontTableWriter*) m_poFontTableWriter)->Save (m_sTargetFolder); - ((OOXSettingsWriter*) m_poSettingsWriter)->Save (m_sTargetFolder); //setting в последнюю очередь + ((OOXSettingsWriter*) m_poSettingsWriter)->Save (m_sTargetFolder); //settings last //------------------------------------------------------------------------------------- OOX::CPath pathDocProps = m_sTargetFolder + FILE_SEPARATOR_STR + L"docProps"; diff --git a/Test/Applications/DocxFormatCodeGen/codegen/CodeGen.cs b/Test/Applications/DocxFormatCodeGen/codegen/CodeGen.cs index ec63079ae1..285feb96be 100644 --- a/Test/Applications/DocxFormatCodeGen/codegen/CodeGen.cs +++ b/Test/Applications/DocxFormatCodeGen/codegen/CodeGen.cs @@ -51,12 +51,12 @@ namespace codegen public string sNamespace; public bool bIsAttribute; public string sDefAttribute; - public bool bQualified;//нужно ли при записи в xml писать prefix + public bool bQualified;//whether to write prefix when writing to xml public bool bIsArray; public List<GenMember> aArrayTypes; public string sArrayTypesElementName; public string sArrayTypesEnumName; - public bool bInternal;//отличает массив с типами + public bool bInternal;//distinguishes array with types public bool bToDo; public bool bToDoString; @@ -84,7 +84,7 @@ namespace codegen public string sNamespace; public bool bIsEnum; public List<GenMember> aMembers = new List<GenMember>(); - public bool bInternal;//отличает enum типов + public bool bInternal;//distinguishes type enum public bool bIsRoot; public GenClass(string _sName, string _sNamespace) { @@ -173,7 +173,7 @@ namespace codegen aRes.Add(oGenClass); mapAllClasses[oGenClass.sName] = oGenClass; } - //специально для chart + //specifically for chart for (int i = 0; i < aRes.Count; ++i) { GenClass oGenClass = aRes[i]; @@ -234,7 +234,7 @@ namespace codegen GenClass PreProcessClass(List<GenClass> aGenClasses, CodeTypeDeclaration type) { GenClass oGenClass = null; - //получаем xml namespace + //get xml namespace string sNamespace = null; bool bIncludeInSchema = true; bool bIsRoot = false; @@ -291,7 +291,7 @@ namespace codegen for (int i = 0; i < type.Members.Count; ++i) { CodeTypeMember member = type.Members[i]; - //CodeMemberField пропускаем + //skip CodeMemberField CodeMemberProperty codeMemberProperty = member as CodeMemberProperty; if (codeMemberProperty != null) { @@ -320,7 +320,7 @@ namespace codegen oGenMember.bQualified = false; oGenMember.bIsAttribute = true; ParseArguments(attribute.Arguments, oGenMember); - //todo могут быть повторы имен атрибутов и child nodes. + //todo there may be duplicate attribute names and child nodes } else if (attribute.Name == "System.ComponentModel.DefaultValueAttribute") { @@ -376,7 +376,7 @@ namespace codegen { ParseArguments(attribute.Arguments, oGenMember); } - //todo не всегда прописан + //todo not always specified //else if (attribute.Name == "System.Xml.Serialization.XmlChoiceIdentifierAttribute") //{ // if (attribute.Arguments.Count > 0) @@ -392,17 +392,17 @@ namespace codegen { if (oGenMember.bIsArray && null != aWrappedMemebers) { - //todo не проверен случай + //todo case not tested //[System.Xml.Serialization.XmlArrayItemAttribute("ahPolar", typeof(CT_PolarAdjustHandle), IsNullable=false)] //[System.Xml.Serialization.XmlArrayItemAttribute("ahXY", typeof(CT_XYAdjustHandle), IsNullable=false)] //public object[] ahLst { - //создаем wrap class чтобы не работать с двумерными массивами + //create wrap class to avoid working with 2D arrays string sNewName = Utils.GetClassName(oGenMember.sName); GenClass oNewGenClass = new GenClass(sNewName, oGenMember.sNamespace); if (null == oNewGenClass.sNamespace) oNewGenClass.sNamespace = oGenClass.sNamespace; - //помещаем класс указанный в атрибутах в aMembers + //place class specified in attributes into aMembers for (int i = 0; i < aWrappedMemebers.Count; ++i) { GenMember oWrappedMemeber = aWrappedMemebers[i]; @@ -415,7 +415,7 @@ namespace codegen oWrappedMemeber.sNamespace = oNewGenClass.sNamespace; oNewGenClass.aMembers.Add(oWrappedMemeber); } - //проверяем нет ли такого типа + //check if such type exists bool bExist = false; bool bNeedCreate = true; GenClass oPrevGenClass; @@ -447,7 +447,7 @@ namespace codegen aGenClasses.Add(oNewGenClass); m_mapGeneratedClasses[oNewGenClass.sName] = oNewGenClass; } - //меняем oGenMember, чтобы он ссылался на oNewGenClass + //modify oGenMember to reference oNewGenClass if (codeMemberProperty.Type.ArrayElementType.ArrayRank > 0) oGenMember.bIsArray = true; else @@ -457,7 +457,7 @@ namespace codegen } if (oGenMember.bIsArray && null != oGenMember.aArrayTypes) { - //добавляем enum для member и дополнительный массив для типов + //add enum for member and additional array for types GenClass oNewEnum = new GenClass(Utils.gc_sItemsChoiceType + m_nItemsChoiceTypeCount++, oGenClass.sNamespace); oNewEnum.bInternal = true; oNewEnum.bIsEnum = true; diff --git a/Test/Applications/DocxFormatCodeGen/codegen/CodeGenPivot.cs b/Test/Applications/DocxFormatCodeGen/codegen/CodeGenPivot.cs index d0427cc22e..dd90f0b44b 100644 --- a/Test/Applications/DocxFormatCodeGen/codegen/CodeGenPivot.cs +++ b/Test/Applications/DocxFormatCodeGen/codegen/CodeGenPivot.cs @@ -54,7 +54,7 @@ namespace codegen public bool? bIsAttribute; public string sDefAttribute; - public bool? bQualified;//нужно ли при записи в xml писать prefix + public bool? bQualified;//whether to write prefix when writing to xml public int? nArrayRank; public List<GenMemberPivot> aArrayTypes; @@ -300,7 +300,7 @@ namespace codegen GenClassPivot PreProcessClass(List<GenClassPivot> aGenClasses, CodeTypeDeclaration type) { GenClassPivot oGenClass = null; - //получаем xml namespace + //get xml namespace string sNamespace = null; bool bIncludeInSchema = true; string sRootName = ""; @@ -355,7 +355,7 @@ namespace codegen for (int i = 0; i < type.Members.Count; ++i) { CodeTypeMember member = type.Members[i]; - //CodeMemberField пропускаем + //skip CodeMemberField CodeMemberProperty codeMemberProperty = member as CodeMemberProperty; if (codeMemberProperty != null) { @@ -387,7 +387,7 @@ namespace codegen oGenMember.bQualified = false; oGenMember.bIsAttribute = true; ParseArguments(attribute.Arguments, oGenMember); - //todo могут быть повторы имен атрибутов и child nodes. + //todo there may be duplicate attribute names and child nodes } else if (attribute.Name == "System.ComponentModel.DefaultValueAttribute") { @@ -420,7 +420,7 @@ namespace codegen { ParseArguments(attribute.Arguments, oGenMember); } - //todo не всегда прописан + //todo not always specified //else if (attribute.Name == "System.Xml.Serialization.XmlChoiceIdentifierAttribute") //{ // if (attribute.Arguments.Count > 0) diff --git a/Test/Applications/DocxFormatCodeGen/codegen/CodeGenSlicer.cs b/Test/Applications/DocxFormatCodeGen/codegen/CodeGenSlicer.cs index 7a10d006f0..76358e56d6 100644 --- a/Test/Applications/DocxFormatCodeGen/codegen/CodeGenSlicer.cs +++ b/Test/Applications/DocxFormatCodeGen/codegen/CodeGenSlicer.cs @@ -192,7 +192,7 @@ namespace codegen GenClassPivot PreProcessClass(List<GenClassPivot> aGenClasses, CodeTypeDeclaration type) { GenClassPivot oGenClass = null; - //получаем xml namespace + //get xml namespace string sNamespace = null; bool bIncludeInSchema = true; string sRootName = ""; @@ -247,7 +247,7 @@ namespace codegen for (int i = 0; i < type.Members.Count; ++i) { CodeTypeMember member = type.Members[i]; - //CodeMemberField пропускаем + //skip CodeMemberField CodeMemberProperty codeMemberProperty = member as CodeMemberProperty; if (codeMemberProperty != null) { @@ -279,7 +279,7 @@ namespace codegen oGenMember.bQualified = false; oGenMember.bIsAttribute = true; ParseArguments(attribute.Arguments, oGenMember); - //todo могут быть повторы имен атрибутов и child nodes. + //todo there may be duplicate attribute names and child nodes } else if (attribute.Name == "System.ComponentModel.DefaultValueAttribute") { @@ -312,7 +312,7 @@ namespace codegen { ParseArguments(attribute.Arguments, oGenMember); } - //todo не всегда прописан + //todo not always specified //else if (attribute.Name == "System.Xml.Serialization.XmlChoiceIdentifierAttribute") //{ // if (attribute.Arguments.Count > 0) diff --git a/Test/Applications/DocxFormatCodeGen/codegen/CodeGenXmlJS.cs b/Test/Applications/DocxFormatCodeGen/codegen/CodeGenXmlJS.cs index b6c704ea64..6ac59e2fc7 100644 --- a/Test/Applications/DocxFormatCodeGen/codegen/CodeGenXmlJS.cs +++ b/Test/Applications/DocxFormatCodeGen/codegen/CodeGenXmlJS.cs @@ -233,7 +233,7 @@ namespace codegen GenClassPivot PreProcessClass(List<GenClassPivot> aGenClasses, CodeTypeDeclaration type) { GenClassPivot oGenClass = null; - //получаем xml namespace + //get xml namespace string sNamespace = null; bool bIncludeInSchema = true; string sRootName = ""; @@ -288,7 +288,7 @@ namespace codegen for (int i = 0; i < type.Members.Count; ++i) { CodeTypeMember member = type.Members[i]; - //CodeMemberField пропускаем + //skip CodeMemberField CodeMemberProperty codeMemberProperty = member as CodeMemberProperty; if (codeMemberProperty != null) { @@ -320,7 +320,7 @@ namespace codegen oGenMember.bQualified = false; oGenMember.bIsAttribute = true; ParseArguments(attribute.Arguments, oGenMember); - //todo могут быть повторы имен атрибутов и child nodes. + //todo there may be duplicate attribute names and child nodes } else if (attribute.Name == "System.ComponentModel.DefaultValueAttribute") { @@ -353,7 +353,7 @@ namespace codegen { ParseArguments(attribute.Arguments, oGenMember); } - //todo не всегда прописан + //todo not always specified //else if (attribute.Name == "System.Xml.Serialization.XmlChoiceIdentifierAttribute") //{ // if (attribute.Arguments.Count > 0) diff --git a/Test/Applications/DocxFormatCodeGen/codegen/CodegenCPP.cs b/Test/Applications/DocxFormatCodeGen/codegen/CodegenCPP.cs index f06f3b8a29..9437fd4e25 100644 --- a/Test/Applications/DocxFormatCodeGen/codegen/CodegenCPP.cs +++ b/Test/Applications/DocxFormatCodeGen/codegen/CodegenCPP.cs @@ -58,7 +58,7 @@ namespace codegen string gc_sEnumToXmlPrefix = "ToXml_"; public void Process(string sDirCppXmlOut, string sDirCppBinOut, List<GenClass> aGenClasses) { - //собираем список используемых типов + //collect list of used types List<GenClass> aEnums = new List<GenClass>(); List<GenClass> aClasses = new List<GenClass>(); for (int i = 0; i < aGenClasses.Count; ++i) @@ -91,10 +91,10 @@ namespace codegen m_oDocxSerH.AppendFormat("namespace OOX{{\r\nnamespace Spreadsheet{{\r\n"); m_oDocxSerCPP.AppendFormat("#include \"{0}\"\r\nnamespace OOX{{\r\nnamespace Spreadsheet{{\r\n", sFileDocxSerH); - //в начале все enum + //all enums first for (int i = 0; i < aEnums.Count; ++i) ProcessClass(aEnums[i]); - //декларация классов + //class declarations for (int i = 0; i < aClasses.Count; ++i) m_oDocxSerH.AppendFormat("class {0};\r\n", aClasses[i].sName); for (int i = 0; i < aClasses.Count; ++i) @@ -281,7 +281,7 @@ namespace codegen string sMemeberName = Utils.GetMemberElemName(oGenMember.sName); if (!oGenMember.bIsArray) { - //todo подумать нужны ли в конструкторе DefAttribute + //todo consider if DefAttribute is needed in constructor if (null != oGenMember.sDefAttribute) { string sTypeClass = ""; @@ -305,7 +305,7 @@ namespace codegen } else { - //todo без строк + //todo without strings sb.AppendFormat("CString s_{0}(\"{1}\");\r\n", sMemeberName, oGenMember.sDefAttribute); sb.AppendFormat("{{\r\n", sMemeberName, oGenMember.sDefAttribute); ProcessCPPTypeFromXml(sb, "s_" + sMemeberName, "*" + sMemeberName, oGenMember.oSystemType); @@ -674,7 +674,7 @@ namespace codegen //todo switch (Type.GetTypeCode(oType)) { - case TypeCode.Boolean://todo на запись "false", "off" + case TypeCode.Boolean://todo for writing "false", "off" sb.AppendFormat("if({0})\r\n", sCodeVal); sb.AppendFormat("{0} = _T(\"1\");\r\n", sCodeMember); sb.AppendFormat("else\r\n"); diff --git a/Test/Applications/DocxFormatCodeGen/codegen/CodegenXmlJSFiles.cs b/Test/Applications/DocxFormatCodeGen/codegen/CodegenXmlJSFiles.cs index 921ea66b97..ded4217ae0 100644 --- a/Test/Applications/DocxFormatCodeGen/codegen/CodegenXmlJSFiles.cs +++ b/Test/Applications/DocxFormatCodeGen/codegen/CodegenXmlJSFiles.cs @@ -167,7 +167,7 @@ namespace codegen if (!isMatch.Success) { name = "todo_" + name; - //закомментировать и разбираться в ручном режиме + //comment out and debug manually //throw new ArgumentOutOfRangeException(); } return name; diff --git a/Test/Applications/FilesSort/FilesSort/CodeFile1.cs b/Test/Applications/FilesSort/FilesSort/CodeFile1.cs index 5f13dd4ec4..fd65466654 100644 --- a/Test/Applications/FilesSort/FilesSort/CodeFile1.cs +++ b/Test/Applications/FilesSort/FilesSort/CodeFile1.cs @@ -182,7 +182,7 @@ public class FormatChecker public const int AVS_OFFICESTUDIO_FILE_OTHER_OLD_PRESENTATION = AVS_OFFICESTUDIO_FILE_OTHER + 0x0005; public const int AVS_OFFICESTUDIO_FILE_OTHER_OLD_DRAWING = AVS_OFFICESTUDIO_FILE_OTHER + 0x0006; public const int AVS_OFFICESTUDIO_FILE_OTHER_TEAMLAB_INNER = AVS_OFFICESTUDIO_FILE_OTHER + 0x0007; - public const int AVS_OFFICESTUDIO_FILE_OTHER_JSON = AVS_OFFICESTUDIO_FILE_OTHER + 0x0008; // Для mail-merge + public const int AVS_OFFICESTUDIO_FILE_OTHER_JSON = AVS_OFFICESTUDIO_FILE_OTHER + 0x0008; // For mail-merge public const int AVS_OFFICESTUDIO_FILE_TEAMLAB = 0x1000; public const int AVS_OFFICESTUDIO_FILE_TEAMLAB_DOCY = AVS_OFFICESTUDIO_FILE_TEAMLAB + 0x0001; diff --git a/Test/Applications/PdfSorter/FontEngineTester/Form1.cs b/Test/Applications/PdfSorter/FontEngineTester/Form1.cs index d382b469bd..63482bd9ad 100644 --- a/Test/Applications/PdfSorter/FontEngineTester/Form1.cs +++ b/Test/Applications/PdfSorter/FontEngineTester/Form1.cs @@ -152,7 +152,7 @@ namespace FontEngineTester if (1 == strdst.Length) { - // находим файл с инфой о шрифтах + // find file with font info string sFontsFile = strdst[0] + "\\fonts\\types.txt"; StreamReader oReader = new StreamReader(sFontsFile); string sTypes = oReader.ReadToEnd(); @@ -170,7 +170,7 @@ namespace FontEngineTester int nWFNT = sTypes.IndexOf(": Windows FNT,"); string sSort = ""; - // теперь 8 вариантов имени папки + // now 8 folder name variants if (nType2 != -1 || nType1Cid != -1 || nBDF != -1 || nPCF != -1 || nPFR != -1 || nWFNT != -1) { sSort = "other"; diff --git a/Test/Applications/StandardTester/main.cpp b/Test/Applications/StandardTester/main.cpp index d109d0eeb3..34bb62aa14 100644 --- a/Test/Applications/StandardTester/main.cpp +++ b/Test/Applications/StandardTester/main.cpp @@ -671,7 +671,7 @@ public: if (!m_pInternal->m_bIsStandard) { - // смотрим разницу + // check the difference std::wstring strDirIn = GetOutputFile(L"", true); std::wstring strDirOut = sDirectoryDst; diff --git a/Test/Applications/TestDownloader/downloader.pro b/Test/Applications/TestDownloader/downloader.pro index 9ca22f70a3..3532cd440c 100644 --- a/Test/Applications/TestDownloader/downloader.pro +++ b/Test/Applications/TestDownloader/downloader.pro @@ -30,7 +30,7 @@ LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lkernel_network #ADD_DEPENDENCY(kernel, kernel_network) ##################################################### -# внешнее подключение сторонних библиотек +# external third-party library includes #BOOST CONFIG += core_boost_regex diff --git a/Test/Applications/gradient/Gradient/mainwindow.cpp b/Test/Applications/gradient/Gradient/mainwindow.cpp index 70917d1c21..7faa44ac25 100644 --- a/Test/Applications/gradient/Gradient/mainwindow.cpp +++ b/Test/Applications/gradient/Gradient/mainwindow.cpp @@ -41,7 +41,7 @@ QImage GenerateImg(std::vector<NSStructures::Point> &points, Info &info, const i unsigned int back = 0xffffff; unsigned int *pData32 = (unsigned int *)pData; unsigned int *pData32End = pData32 + nRasterW * nRasterH; - // дефолтный тон должен быть прозрачным, а не белым + // default color should be transparent, not white while (pData32 < pData32End) *pData32++ = back; diff --git a/TxtFile/Source/ConvertTxt2Docx.cpp b/TxtFile/Source/ConvertTxt2Docx.cpp index 70a017f6b1..df76e5a091 100644 --- a/TxtFile/Source/ConvertTxt2Docx.cpp +++ b/TxtFile/Source/ConvertTxt2Docx.cpp @@ -106,7 +106,7 @@ namespace Txt2Docx if ( pProperty ) { ((OOX::Logic::CRun*)pR)->m_arrItems.push_back( (OOX::WritingElement*)pProperty ); - ((OOX::Logic::CRun*)pR)->m_oRunProperty = pProperty;//копия для удобства + ((OOX::Logic::CRun*)pR)->m_oRunProperty = pProperty;//copy for convenience } ((OOX::Logic::CRun*)pR)->m_arrItems.push_back( pT ); @@ -246,7 +246,7 @@ namespace Txt2Docx pPr->m_oRPr = *rPr; paragraph->m_arrItems.push_back(pPr); - paragraph->m_oParagraphProperty = pPr; //копия для удобства + paragraph->m_oParagraphProperty = pPr; //copy for convenience while(line.find(_T("\x08")) != line.npos) { diff --git a/TxtFile/Source/TxtFormat/File.cpp b/TxtFile/Source/TxtFormat/File.cpp index e393e3f8f5..cdd496c826 100644 --- a/TxtFile/Source/TxtFormat/File.cpp +++ b/TxtFile/Source/TxtFormat/File.cpp @@ -128,7 +128,7 @@ namespace Txt { m_listContent.clear(); } - void File::read(const std::wstring& filename, int code_page) // насильственное чтение в кодировке + void File::read(const std::wstring& filename, int code_page) // forced reading with encoding { m_listContent.clear(); diff --git a/TxtFile/Source/TxtFormat/File.h b/TxtFile/Source/TxtFormat/File.h index 42147ed381..3ecc8e4a7e 100644 --- a/TxtFile/Source/TxtFormat/File.h +++ b/TxtFile/Source/TxtFormat/File.h @@ -55,9 +55,9 @@ namespace Txt const bool isValid (const std::wstring& filename) const; - std::vector<std::wstring> m_listContent; //unicode (ранее было utf8) + std::vector<std::wstring> m_listContent; //unicode (previously was utf8) std::vector<std::string> m_listContentutf8; - int m_listContentSize; //для вывода процентов конвертации + int m_listContentSize; //for displaying conversion percentage int m_nEncoding; }; } // namespace Txt diff --git a/TxtFile/Source/TxtFormat/TxtFile.cpp b/TxtFile/Source/TxtFormat/TxtFile.cpp index a92d4b558a..7ff7971523 100644 --- a/TxtFile/Source/TxtFormat/TxtFile.cpp +++ b/TxtFile/Source/TxtFormat/TxtFile.cpp @@ -235,7 +235,7 @@ const std::vector<std::wstring> TxtFile::readUnicodeLines(int CodePage) return result; } -const std::vector<std::string> TxtFile::readAnsiOrCodePage() // == readUtf8withoutPref также +const std::vector<std::string> TxtFile::readAnsiOrCodePage() // == readUtf8withoutPref as well { std::vector<std::string> result; NSFile::CFileBinary file_binary; @@ -387,7 +387,7 @@ const std::vector<std::string> TxtFile::readUtf8() return result; } -bool TxtFile::writeAnsiOrCodePage(const std::vector<std::string>& content) // === writeUtf8withoutPref также +bool TxtFile::writeAnsiOrCodePage(const std::vector<std::string>& content) // === writeUtf8withoutPref as well { NSFile::CFileBinary file; if (!file.CreateFileW(m_path)) return false; diff --git a/TxtFile/Source/TxtFormat/TxtFile.h b/TxtFile/Source/TxtFormat/TxtFile.h index eeb1befbb6..044f51fad2 100644 --- a/TxtFile/Source/TxtFormat/TxtFile.h +++ b/TxtFile/Source/TxtFormat/TxtFile.h @@ -46,7 +46,7 @@ public: const std::vector<std::wstring> readUnicode(); const std::vector<std::wstring> readUnicodeLines(int codePage); const std::vector<std::string> readUtf8Lines(int CodePage); - //const std::vector<std::wstring> readUnicodeWithOutBOM(); /// не используем + //const std::vector<std::wstring> readUnicodeWithOutBOM(); /// not used const std::vector<std::wstring> readBigEndian(); const std::vector<std::string> readUtf8(); diff --git a/X2tConverter/README.md b/X2tConverter/README.md index cf1d64c60f..a7c1bbcc90 100644 --- a/X2tConverter/README.md +++ b/X2tConverter/README.md @@ -1,7 +1,7 @@ x2t converter ============= -Нou can convert files from one format to another. +You can convert files from one format to another. # CONFIGURATION You need to create the xml configuration file. diff --git a/X2tConverter/src/ASCConverters.cpp b/X2tConverter/src/ASCConverters.cpp index cc9ebac971..2f232f476a 100644 --- a/X2tConverter/src/ASCConverters.cpp +++ b/X2tConverter/src/ASCConverters.cpp @@ -185,7 +185,7 @@ namespace NExtractTools recordTo = *oMailMergeSend.recordTo; NSDoctRenderer::CDoctrenderer oDoctRenderer(NULL != params.m_sAllFontsPath ? *params.m_sAllFontsPath : _T("")); std::wstring sMailMergeXml = getMailMergeXml(sJsonPath, *oMailMergeSend.recordFrom, recordTo, *oMailMergeSend.to); - // посылаем выходную папку sFileFromDir, чтобы файлы лежали на одном уровне с папкой media, важно для дальнейшей конвертации в docx, pdf + // send output folder sFileFromDir so that files are at the same level as the media folder, important for further conversion to docx, pdf std::wstring sXml = getDoctXml(NSDoctRenderer::DoctRendererFormat::FormatFile::DOCT, eTypeTo, sFrom, sFileFromDir, sImagesDirectory, convertParams.m_sThemesDir, -1, sMailMergeXml, params); std::wstring sResult; oDoctRenderer.Execute(sXml, sResult); @@ -291,7 +291,7 @@ namespace NExtractTools bool bIsNeedDoct = false; switch (nFormatTo) { - // перечислить все "документные" форматы, которым нужна конвертация через doct + // list all "document" formats that need conversion through doct case AVS_OFFICESTUDIO_FILE_DOCUMENT_HTML: case AVS_OFFICESTUDIO_FILE_DOCUMENT_HTML_IN_CONTAINER: case AVS_OFFICESTUDIO_FILE_DOCUMENT_FB2: diff --git a/X2tConverter/src/cextracttools.cpp b/X2tConverter/src/cextracttools.cpp index 567c4de500..f7ae5f791c 100644 --- a/X2tConverter/src/cextracttools.cpp +++ b/X2tConverter/src/cextracttools.cpp @@ -113,7 +113,7 @@ namespace NExtractTools } else { - // dir ( ??? файл без расширения???) -> zip + // dir ( ??? file without extension???) -> zip if (NSDirectory::Exists(sFile1)) return TCD_ZIPDIR; @@ -916,7 +916,7 @@ namespace NExtractTools const std::wstring& sResultDirectory) { std::vector<std::wstring> aImages = pDoctRenderer->GetImagesInChanges(); - // todo сделать interface у COfficeUtils, чтобы можно было делать архив из файлов в разных папках. + // todo create an interface for COfficeUtils so that archives can be made from files in different folders. for (size_t i = 0; i < aImages.size(); ++i) { std::wstring sImageName = aImages[i]; diff --git a/X2tConverter/src/cextracttools.h b/X2tConverter/src/cextracttools.h index 5e144e15b0..adaa7c8781 100644 --- a/X2tConverter/src/cextracttools.h +++ b/X2tConverter/src/cextracttools.h @@ -179,7 +179,7 @@ namespace NExtractTools TCD_ODF_FLAT2OOX, TCD_ODF_FLAT2OOT, TCD_ODF_FLAT2OOT_BIN, - TCD_ODF_FLAT2ODF, // todooo напрямую + TCD_ODF_FLAT2ODF, // todooo directly // 2 odt TCD_DOCX2ODT, TCD_DOCT2ODT, @@ -1166,7 +1166,7 @@ namespace NExtractTools if (NULL != m_oMailMergeSend) eRes = TCD_MAILMERGE; else if ((AVS_OFFICESTUDIO_FILE_DOCUMENT_XML == nFormatFrom) && 0 != (AVS_OFFICESTUDIO_FILE_OTHER & nFormatTo)) - eRes = TCD_NON_AUTO; // параметры требуют уточнений + eRes = TCD_NON_AUTO; // parameters require clarification else if ((AVS_OFFICESTUDIO_FILE_DOCUMENT_XML == nFormatFrom) && (0 != (AVS_OFFICESTUDIO_FILE_SPREADSHEET & nFormatTo) || (AVS_OFFICESTUDIO_FILE_CANVAS_SPREADSHEET == nFormatTo))) eRes = TCD_SPREADSHEET2; else if (0 != (AVS_OFFICESTUDIO_FILE_DOCUMENT & nFormatFrom)) @@ -1295,7 +1295,7 @@ namespace NExtractTools int getEncodingByContent() { int nRes = -1; - // todo использовать codepage + // todo use codepage NSFile::CFileBinary file; if (file.OpenFile(*m_sFileFrom)) { diff --git a/X2tConverter/src/lib/crypt.h b/X2tConverter/src/lib/crypt.h index 27b060f84f..5a0b2cbedf 100644 --- a/X2tConverter/src/lib/crypt.h +++ b/X2tConverter/src/lib/crypt.h @@ -70,7 +70,7 @@ namespace NExtractTools if (bDataIntegrity == false) { - // было несанкционированое вешательство в файл + // there was unauthorized tampering with the file } COfficeFileFormatChecker OfficeFileFormatChecker; @@ -156,7 +156,7 @@ namespace NExtractTools if (bDataIntegrity == false) { - // было несанкционированое вешательство в файл + // there was unauthorized tampering with the file } return 0; @@ -182,7 +182,7 @@ namespace NExtractTools _UINT32 nRes = mscrypt2oox(sFrom, sResultDecryptFile, params, convertParams); - if (!SUCCEEDED_X2T(nRes) && password.empty()) // qiaoshemei1 (1).xlsx - запрокченный xlsx + if (!SUCCEEDED_X2T(nRes) && password.empty()) // qiaoshemei1 (1).xlsx - corrupted xlsx { if (!params.getDontSaveAdditional()) { diff --git a/X2tConverter/src/lib/csv.h b/X2tConverter/src/lib/csv.h index 3968bfce70..85c59ca56c 100644 --- a/X2tConverter/src/lib/csv.h +++ b/X2tConverter/src/lib/csv.h @@ -181,7 +181,7 @@ namespace NExtractTools std::wstring sXmlOptions = params.getXmlOptionsTo(); nRes = oCXlsxSerializer.loadFromFile(sTargetBin, sTo, sXmlOptions, sMediaPath, sEmbedPath); } - // удаляем EditorWithChanges, потому что он не в Temp + // delete EditorWithChanges because it's not in Temp if (sFrom != sTargetBin) NSFile::CFileBinary::Remove(sTargetBin); return nRes; diff --git a/X2tConverter/src/lib/docx.h b/X2tConverter/src/lib/docx.h index 46efe78502..5867e23215 100644 --- a/X2tConverter/src/lib/docx.h +++ b/X2tConverter/src/lib/docx.h @@ -182,7 +182,7 @@ namespace NExtractTools nRes = m_oCDocxSerializer.loadFromFile(sTargetBin, convertParams.m_sTempResultOOXMLDirectory, sThemePath, sMediaPath, sEmbedPath) ? nRes : AVS_FILEUTILS_ERROR_CONVERT; params.m_bMacro = m_oCDocxSerializer.getMacroEnabled(); } - // удаляем EditorWithChanges, потому что он не в Temp + // delete EditorWithChanges because it's not in Temp if (sFrom != sTargetBin) NSFile::CFileBinary::Remove(sTargetBin); diff --git a/X2tConverter/src/lib/odf.h b/X2tConverter/src/lib/odf.h index f0fdcdf0ac..9931d4c769 100644 --- a/X2tConverter/src/lib/odf.h +++ b/X2tConverter/src/lib/odf.h @@ -69,7 +69,7 @@ namespace NExtractTools { nRes = ConvertODF2OOXml(sTempUnpackedOdf, sTo, params.getFontPath(), convertParams.m_sTempDir, params.getPassword()); - params.m_bMacro = false; // todooo ������� ��������� �������� odf + params.m_bMacro = false; // todo add macro support for odf nRes = processEncryptionError(nRes, sFrom, params); } else @@ -98,7 +98,7 @@ namespace NExtractTools nRes = ConvertODF2OOXml(sTempUnpackedOdf, sTempUnpackedOox, params.getFontPath(), convertParams.m_sTempDir, params.getPassword()); - params.m_bMacro = false; // todooo ������� ��������� �������� odf + params.m_bMacro = false; // todo add macro support for odf nRes = processEncryptionError(nRes, sFrom, params); if (SUCCEEDED_X2T(nRes)) @@ -164,7 +164,7 @@ namespace NExtractTools _UINT32 odf_flat2oox_dir(const std::wstring& sFrom, const std::wstring& sTo, InputParams& params, ConvertParams& convertParams) { _UINT32 nRes = ConvertODF2OOXml(sFrom, sTo, params.getFontPath(), convertParams.m_sTempDir, params.getPassword()); - params.m_bMacro = false; // todooo ������� ��������� �������� odf + params.m_bMacro = false; // todo add macro support for odf nRes = processEncryptionError(nRes, sFrom, params); return nRes; @@ -179,7 +179,7 @@ namespace NExtractTools NSDirectory::CreateDirectory(sTempUnpackedOox); _UINT32 nRes = ConvertODF2OOXml(sFrom, sTempUnpackedOox, params.getFontPath(), convertParams.m_sTempDir, params.getPassword()); - params.m_bMacro = false; // todooo ������� ��������� �������� odf + params.m_bMacro = false; // todo add macro support for odf nRes = processEncryptionError(nRes, sFrom, params); if (SUCCEEDED_X2T(nRes)) diff --git a/X2tConverter/src/lib/pdf_image.h b/X2tConverter/src/lib/pdf_image.h index 507eb66df2..c0695d16b1 100644 --- a/X2tConverter/src/lib/pdf_image.h +++ b/X2tConverter/src/lib/pdf_image.h @@ -408,7 +408,7 @@ namespace NExtractTools RELEASEOBJECT(pApplicationFonts); } - // удаляем sPdfBinFile, потому что он не в Temp + // delete sPdfBinFile because it's not in Temp if (NSFile::CFileBinary::Exists(sPdfBinFile)) NSFile::CFileBinary::Remove(sPdfBinFile); return nRes; diff --git a/X2tConverter/src/lib/pptx.h b/X2tConverter/src/lib/pptx.h index ce9ab42d44..8aefb4ee04 100644 --- a/X2tConverter/src/lib/pptx.h +++ b/X2tConverter/src/lib/pptx.h @@ -173,7 +173,7 @@ namespace NExtractTools params.m_bMacro = pptx_file->GetMacroEnabled(); delete pptx_file; } - // удаляем EditorWithChanges, потому что он не в Temp + // delete EditorWithChanges because it's not in Temp if (sFrom != sTargetBin) NSFile::CFileBinary::Remove(sTargetBin); diff --git a/X2tConverter/src/lib/rtf.h b/X2tConverter/src/lib/rtf.h index 6a6bda06c5..da1e85fbde 100644 --- a/X2tConverter/src/lib/rtf.h +++ b/X2tConverter/src/lib/rtf.h @@ -126,7 +126,7 @@ namespace NExtractTools nRes = rtfConvert.ConvertOOXToRtf(sTo, sResultDocxDir); } } - // удаляем EditorWithChanges, потому что он не в Temp + // delete EditorWithChanges because it's not in Temp if (sFrom != sTargetBin) NSFile::CFileBinary::Remove(sTargetBin); return nRes; diff --git a/X2tConverter/src/lib/vsdx.h b/X2tConverter/src/lib/vsdx.h index bd05ee8099..69448ea01f 100644 --- a/X2tConverter/src/lib/vsdx.h +++ b/X2tConverter/src/lib/vsdx.h @@ -169,7 +169,7 @@ namespace NExtractTools nRes = oVsdxSerializer.loadFromFile(sTargetBin, convertParams.m_sTempResultOOXMLDirectory, sMediaPath, sEmbedPath); params.m_bMacro = oVsdxSerializer.getMacroEnabled(); } - // удаляем EditorWithChanges, потому что он не в Temp + // delete EditorWithChanges because it's not in Temp if (sFrom != sTargetBin) NSFile::CFileBinary::Remove(sTargetBin); diff --git a/X2tConverter/src/lib/xlsx.h b/X2tConverter/src/lib/xlsx.h index cbb4426476..133b793939 100644 --- a/X2tConverter/src/lib/xlsx.h +++ b/X2tConverter/src/lib/xlsx.h @@ -205,7 +205,7 @@ namespace NExtractTools convertParams.m_sTempResultOOXMLDirectory = sTempUnpackedXLSB; nRes = xlst_bin2xlsx_dir(sTargetBin, sTempUnpackedXLSB, params, convertParams); - // удаляем EditorWithChanges, потому что он не в Temp + // delete EditorWithChanges because it's not in Temp if (sFrom != sTargetBin) NSFile::CFileBinary::Remove(sTargetBin); return nRes; @@ -294,7 +294,7 @@ namespace NExtractTools nRes = oCXlsxSerializer.loadFromFile(sTargetBin, convertParams.m_sTempResultOOXMLDirectory, sXmlOptions, sMediaPath, sEmbedPath); params.m_bMacro = oCXlsxSerializer.getMacroEnabled(); } - // удаляем EditorWithChanges, потому что он не в Temp + // delete EditorWithChanges because it's not in Temp if (sFrom != sTargetBin) NSFile::CFileBinary::Remove(sTargetBin); diff --git a/XpsFile/XpsFile.cpp b/XpsFile/XpsFile.cpp index f799be45aa..eb3a70ddcf 100644 --- a/XpsFile/XpsFile.cpp +++ b/XpsFile/XpsFile.cpp @@ -61,7 +61,7 @@ public: m_pAppFonts = pAppFonts; - // Создаем менеджер шрифтов с собственным кэшем + // Create a font manager with its own cache m_pFontManager = pAppFonts->GenerateFontManager(); NSFonts::IFontsCache* pMeasurerCache = NSFonts::NSFontCache::Create(); pMeasurerCache->SetStreams(pAppFonts->GetStreams()); @@ -108,7 +108,7 @@ bool CXpsFile::LoadFromFile(const std::wstring& wsSrcFileName, const std::wstrin { Close(); - // Распаковываем Zip-архив в темповую папку + // Extract the Zip archive to a temporary folder COfficeUtils oUtils(NULL); if (S_OK != oUtils.ExtractToDirectory(wsSrcFileName, m_pInternal->m_wsTempFolder->getFullFilePath(L""), NULL, 0)) return false; diff --git a/XpsFile/XpsLib/Document.cpp b/XpsFile/XpsLib/Document.cpp index 3964f0f019..8a33af9888 100644 --- a/XpsFile/XpsLib/Document.cpp +++ b/XpsFile/XpsLib/Document.cpp @@ -192,7 +192,7 @@ namespace XPS std::wstring wsFilePath = GetPath(wsSourceFile); - // Оглавление, содержание, structure + // Table of contents, contents, structure oReader.Clear(); std::wstring wsStructureTargetFile = wsFilePath + L"_rels/" + NSFile::GetFileName(wsSourceFile) + L".rels"; @@ -244,9 +244,9 @@ namespace XPS if (oReader.GetNameNoNS() == L"OutlineEntry") { CDocumentStructure oStructure; - oStructure.nLevel = 1; // OutlineLevel по умолчанию имеет значение 1 + oStructure.nLevel = 1; // OutlineLevel has a default value of 1 oStructure.nPage = 0; - oStructure.dY = 0; // по умолчанию верхняя часть страницы (216) + oStructure.dY = 0; // default is top of the page (216) while (oReader.MoveToNextAttribute()) { std::wstring wsAttrName = oReader.GetName(); diff --git a/XpsFile/XpsLib/FontList.h b/XpsFile/XpsLib/FontList.h index d6d0002161..96662b0804 100644 --- a/XpsFile/XpsLib/FontList.h +++ b/XpsFile/XpsLib/FontList.h @@ -71,7 +71,7 @@ namespace XPS unsigned char sKey[16]; GetFontKey(wsName, sKey); - // Нужно подменить первые 32 байта файла + // Need to replace the first 32 bytes of the file if (IFolder::iftFolder == pFolder->getType()) { if (NSDirectory::Exists(wsFontPath)) diff --git a/XpsFile/XpsLib/StaticResources.cpp b/XpsFile/XpsLib/StaticResources.cpp index ea8382f0f7..fa8b34159a 100644 --- a/XpsFile/XpsLib/StaticResources.cpp +++ b/XpsFile/XpsLib/StaticResources.cpp @@ -454,8 +454,8 @@ namespace XPS { CBrush* pBrush = NULL; - // TODO: 1. Трансформы здесь не реализованы, потому что их невозможно учесть с текущим интерфейсом рендерера - // 2. Не реализован VisualBrush + // TODO: 1. Transforms are not implemented here because they cannot be accounted for with the current renderer interface + // 2. VisualBrush is not implemented if (!oReader.IsEmptyNode()) { CWString wsNodeName; diff --git a/XpsFile/XpsLib/Utils.cpp b/XpsFile/XpsLib/Utils.cpp index 58502b0daf..7d3a25ad1f 100644 --- a/XpsFile/XpsLib/Utils.cpp +++ b/XpsFile/XpsLib/Utils.cpp @@ -75,8 +75,8 @@ namespace XPSEllipse { double AngToEllPrm (double fAngle, double fXRad, double fYRad) { - // Функция для перевода реального угла в параметрическое задание эллписа - // т.е. x= a cos(t) y = b sin(t) - параметрическое задание эллписа. + // Function for converting a real angle to parametric ellipse representation + // i.e. x = a cos(t) y = b sin(t) - parametric ellipse representation. // x = r cos(p), y = r sin(p) => t = atan2( sin(p) / b, cos(p) / a ); return atan2(sin(fAngle) / fYRad, cos(fAngle) / fXRad); } @@ -99,7 +99,7 @@ namespace XPSEllipse } void EllipseArc3 (IRenderer* pRenderer, Aggplus::CMatrix& oTransform, double fX, double fY, double fXRad, double fYRad, double dAngle1, double dAngle2, double *pfXCur, double *pfYCur, bool bClockDirection) { - // Рассчитаем начальную, конечную и контрольные точки + // Calculate start, end and control points double fX1 = 0.0, fX2 = 0.0, fY1 = 0.0, fY2 = 0.0; double fCX1 = 0.0, fCX2 = 0.0, fCY1 = 0.0, fCY2 = 0.0; @@ -136,16 +136,16 @@ namespace XPSEllipse } void EllipseArc2 (IRenderer* pRenderer, Aggplus::CMatrix& oTransform, double fX, double fY, double fXRad, double fYRad, double fAngle1, double fAngle2, bool bClockDirection) { - // переведем углы в радианы + // Convert angles to radians double dAngle1 = fAngle1 * 3.141592 / 180; double dAngle2 = fAngle2 * 3.141592 / 180; - // Выясним в каких четвертях находятся начальная и конечная точки + // Determine in which quadrants the start and end points are located unsigned int nFirstPointQuard = int(fAngle1) / 90 + 1; unsigned int nSecondPointQuard = int(fAngle2) / 90 + 1; nSecondPointQuard = std::min((unsigned int)4, std::max((unsigned int)1, nSecondPointQuard)); nFirstPointQuard = std::min((unsigned int)4, std::max((unsigned int)1, nFirstPointQuard)); - // Проведем линию в начальную точку дуги + // Draw a line to the starting point of the arc double fStartX = 0.0, fStartY = 0.0, fEndX = 0.0, fEndY = 0.0; fStartX = fX + fXRad * cos(AngToEllPrm(dAngle1, fXRad, fYRad)); @@ -153,7 +153,7 @@ namespace XPSEllipse LineTo(pRenderer, oTransform, fStartX, fStartY); - // Дальше рисуем по четверям + // Next we draw by quadrants double fCurX = fStartX, fCurY = fStartY; double dStartAngle = dAngle1; @@ -240,11 +240,11 @@ namespace XPSEllipse if (fXRad <= 0 || fYRad <= 0) return; - if (fabs(fEndAngle - fStartAngle) >= 360) // Целый эллипс + if (fabs(fEndAngle - fStartAngle) >= 360) // Full ellipse { Ellipse(pRenderer, oTransform, fX, fY, fXRad, fYRad); } - else // Дуга эллипса + else // Ellipse arc { EllipseArc(pRenderer, oTransform, fX, fY, fXRad, fYRad, fStartAngle, fEndAngle, bClockDirection); } @@ -255,7 +255,7 @@ namespace XPSEllipse dA1 = -dX1 / dY1 * SQR(dRadY) / SQR(dRadX); dB1 = (SQR(dX1) / SQR(dRadX) + SQR(dY1) / SQR(dRadY)) * SQR(dRadY) / (2 * dY1); - // Получаем квадратное уравнение A2 * X^2 + B2 * X + C2 = 0 (причем A2 != 0 в нашей ситуации) + // Get the quadratic equation A2 * X^2 + B2 * X + C2 = 0 (where A2 != 0 in our case) dA2 = SQR(dA1) / SQR(dRadY) + 1 / SQR(dRadX); dB2 = 2 * dA1 * dB1 / SQR(dRadY); dC2 = SQR(dB1) / SQR(dRadY) - 1; @@ -268,12 +268,12 @@ namespace XPSEllipse GetEllipseKoefs(dX1, dY1, dRadX, dRadY, dA1, dB1, dA2, dB2, dC2, dRoot); if (dRoot < 0) { - double dK1 = (SQR(dA1) + SQR(dRadY) / SQR(dRadX)); // dK1 всегда положительное (поэтому спокойно на него делим) + double dK1 = (SQR(dA1) + SQR(dRadY) / SQR(dRadX)); // dK1 is always positive (so we can safely divide by it) double dK2 = 2 * dA1 * dB1; double dK3 = SQR(dB1); double dK4 = dK3 - SQR(dK2) / (4 * dK1); if (dK4 < 0) - return false; // Такого быть не должно + return false; // This should not happen double dNewRadY = SQRT(dK4); double dKoef = dNewRadY / dRadY; @@ -287,7 +287,7 @@ namespace XPSEllipse if (dRoot < -0.001) { - // Такого быть не должно + // This should not happen return false; } else if (dRoot < 0) @@ -310,7 +310,7 @@ namespace XPSEllipse if (abs(dX1) < 0.001) return false; - // Центры искомых эллипсов лежат на вертикальной прямой + // Centers of the sought ellipses lie on a vertical line dCx1 = dX1 / 2; dCx2 = dCx1; @@ -329,7 +329,7 @@ namespace XPSEllipse if (dRoot < -0.001) { - // Такого быть не должно + // This should not happen return false; } else if (dRoot < 0) @@ -358,7 +358,7 @@ namespace XPS static inline double GetEllipseAngle(const double& dCx, const double& dCy, const double& dRadX, const double dRadY, const double& dX, const double& dY) { - // Определим квадрант + // Determine the quadrant int nQuarter = -1; if (dX >= dCx) { @@ -640,7 +640,7 @@ namespace XPS return; } - // Точку X0, Y0 переносим в начало координат и поворачиваем на обратный угол, чтобы искомые эллипсы встали правильно + // Move point X0, Y0 to the origin and rotate by the inverse angle so that the sought ellipses are positioned correctly Aggplus::CMatrix oTransform, oInverse; oTransform.Rotate(-dAngle); oTransform.Translate(-dX0, -dY0); @@ -652,10 +652,10 @@ namespace XPS oInverse.TransformPoint(dTestX, dTestY); double dCx1, dCy1, dCx2, dCy2; - // Ищем эллипсы, точками пересечения которых являются (0, 0) и (dX1, dY1) + // Find ellipses whose intersection points are (0, 0) and (dX1, dY1) if (!XPSEllipse::GetEllipses(dX1, dY1, dRadX, dRadY, dCx1, dCy1, dCx2, dCy2)) { - // Такого не должно быть + // This should not happen pRenderer->PathCommandLineTo(_dX1, _dY1); dCurX = _dX1; dCurY = _dY1; @@ -667,8 +667,8 @@ namespace XPS //double dTest3 = SQR(dCx2) / SQR(dRadX) + SQR(dCy2) / SQR(dRadY); //double dTest4 = SQR(dCx2 - dX1) / SQR(dRadX) + SQR(dCy2 - dY1) / SQR(dRadY); - // Теперь у нас есть 2 эллипса, нужно определить дугу, которую нам и надо отрисовать. - // Для начала найдем углы начальной и конечной точек для обоих эллипсов. + // Now we have 2 ellipses, we need to determine the arc that we need to draw. + // First, let's find the angles of the start and end points for both ellipses. double dAngleStart1 = GetEllipseAngle(dCx1, dCy1, dRadX, dRadY, 0, 0); double dAngleEnd1 = GetEllipseAngle(dCx1, dCy1, dRadX, dRadY, dX1, dY1); @@ -698,7 +698,7 @@ namespace XPS dAngleEnd = dAngleEnd2; } - // Аппроксимируем эллипс кривыми Безье + // Approximate the ellipse with Bezier curves XPSEllipse::AppendEllipseArc(pRenderer, oInverse, dCx, dCy, dRadX, dRadY, dAngleStart, dAngleEnd, bClockwise); dCurX = _dX1; dCurY = _dY1; @@ -1245,7 +1245,7 @@ namespace XPS wChar = LookChar(wsIndices, nIndicesPos); if (')' != wChar) - return false; // Такого не должно быть + return false; // This should not happen nIndicesPos++; } @@ -1259,8 +1259,8 @@ namespace XPS if (nCodeUnitCount > 0 && nGlyphCount > 0) { oEntry.vRemainUnicodes.clear(); - // Нам нужно прочитать сколько реальных юникодных значений лежит в - // промежутке [pUnicode + nUnicodePos, pUnicode + nUnicodePos + nCodeUnitCount] + // We need to read how many real unicode values are in the + // range [pUnicode + nUnicodePos, pUnicode + nUnicodePos + nCodeUnitCount] int nUnicodesCount = 0; unsigned int* pUnicodes = NULL; nCodeUnitCount = std::min(nUtf16Len - nUtf16Pos, nCodeUnitCount); @@ -1282,7 +1282,7 @@ namespace XPS } else if (ushLeading >= 0xDC00) { - // Такого не должно быть + // This should not happen continue; } else @@ -1294,7 +1294,7 @@ namespace XPS ushTraling = pUtf16[nUtf16Pos + nCodeUnitPos++]; if (ushTraling < 0xDC00 || ushTraling > 0xDFFF) { - // Такого не должно быть + // This should not happen continue; } else @@ -1305,8 +1305,8 @@ namespace XPS } } - // Равномерно распределяем юникоды по глифам, в идеале их количество должно совпадать. - // Если юникодов больше, то лишние удаляем, если их меньше, то недостающие заполняем пробелами. + // Evenly distribute unicodes across glyphs, ideally their count should match. + // If there are more unicodes, we remove the extra ones; if there are fewer, we fill the missing ones with spaces. nUnicodesCount = std::min(nUnicodesCount, nGlyphCount); for (int nIndex = 0; nIndex < nGlyphCount; nIndex++) { @@ -1325,7 +1325,7 @@ namespace XPS if (oEntry.vRemainUnicodes.size() <= 0) return false; - // Теперь мы читаем ровно 1 глиф с возможными метриками + // Now we read exactly 1 glyph with possible metrics oEntry.nUnicode = oEntry.vRemainUnicodes.at(0); oEntry.vRemainUnicodes.erase(oEntry.vRemainUnicodes.begin()); @@ -1420,7 +1420,7 @@ namespace XPS return true; } else - return false; // Такого не должно быть + return false; // This should not happen } void ReadMatrixTransform(XmlUtils::CXmlLiteReader& oReader, CWString& wsTransform, CWString* pwsKey) { @@ -1507,7 +1507,7 @@ namespace XPS } void ReadPathFigure (XmlUtils::CXmlLiteReader& oReader, std::wstring& wsData, bool bEvenOdd) { - // TODO: Улучшить здесь сложение строк и хождение по атрибутам + // TODO: Improve string concatenation and attribute traversal here if (oReader.IsEmptyNode()) return; diff --git a/XpsFile/XpsLib/XpsPage.cpp b/XpsFile/XpsLib/XpsPage.cpp index 620356365f..6ad9068e77 100644 --- a/XpsFile/XpsLib/XpsPage.cpp +++ b/XpsFile/XpsLib/XpsPage.cpp @@ -458,7 +458,7 @@ namespace XPS } else { - // шрифт не odttf - надо добавить его во внешний сторадж шрифтов, если нужно + // font is not odttf - need to add it to external font storage if needed if (IFolder::iftZip == m_wsRootPath->getType() && NSFonts::NSApplicationFontStream::GetGlobalMemoryStorage()) { IFolder::CBuffer* buffer = NULL; @@ -615,9 +615,9 @@ namespace XPS return; } - // Сначала задается матрица преобразования, потом клип, потому что даже - // если преобразование задано в дочерней ноде, а клип задан в атрибутах данной ноды, - // то преобразование влияется на клип все равно. + // First the transformation matrix is set, then the clip, because even + // if the transformation is specified in a child node and the clip is specified in the attributes of this node, + // the transformation still affects the clip. if (!wsTransform.empty()) { bTransform = TransformToRenderer(wsTransform.c_str(), pState); @@ -986,7 +986,7 @@ namespace XPS oTransform.TransformPoint(x3, y3); } } - // Верхний левый угол + // Top left corner oLink.X = x1 == x2 ? fmin(x1, x3) : fmin(x1, x2); oLink.Y = y1 == y2 ? fmin(y1, y3) : fmin(y1, y2); oLink.H = x1 == x2 ? abs(y1 - y2) : abs(y1 - y3); @@ -1000,7 +1000,7 @@ namespace XPS } else { - // координата назначения на странице назначения + // destination coordinate on the destination page size_t nSharp = wsNameTarget.find(L'#'); if (nSharp != std::wstring::npos) { @@ -1029,7 +1029,7 @@ namespace XPS { size_t nFindEndY = wsPath.find(L' ', ++nFindY); if (nFindEndY != std::wstring::npos) - // координата назначения на странице назначения + // destination coordinate on the destination page find->dY = GetDouble(wsPath.substr(nFindY, nFindEndY - nFindY)); } } @@ -1097,9 +1097,9 @@ namespace XPS RELEASEOBJECT(pBrush); } - // Сначала задается матрица преобразования, потом клип, потому что даже - // если преобразование задано в дочерней ноде, а клип задан в атрибутах данной ноды, - // то преобразование влияется на клип все равно. + // First the transformation matrix is set, then the clip, because even + // if the transformation is specified in a child node and the clip is specified in the attributes of this node, + // the transformation still affects the clip. if (!wsTransform.empty()) { bTransform = TransformToRenderer(wsTransform.c_str(), pState); From bd245cd62a2804f8f9851000ec40dc320e698d64 Mon Sep 17 00:00:00 2001 From: Svetlana Kulikova <Svetlana.Kulikova@onlyoffice.com> Date: Thu, 2 Apr 2026 13:43:56 +0300 Subject: [PATCH 2/5] Fix drawingfile, htmltoxhtml, Fb2File, HtmlFile2, PdfFile Also checked: Common/3dParty/html/htmltoxhtml.cpp DesktopEditor/doctrenderer/drawingfile.h DjVuFile EpubFile Fb2File HtmlFile2/htmlfile2.cpp PdfFile XpsFile --- Common/3dParty/html/htmltoxhtml.cpp | 2 +- DesktopEditor/doctrenderer/drawingfile.h | 2 +- Fb2File/Fb2File.cpp | 4 ++-- Fb2File/xml/tmp/main.cpp | 2 +- HtmlFile2/htmlfile2.cpp | 2 +- PdfFile/PdfEditor.cpp | 10 +++++----- PdfFile/PdfWriter.cpp | 6 +++--- PdfFile/SrcReader/PdfAnnot.cpp | 2 +- PdfFile/SrcWriter/EncryptDictionary.cpp | 2 +- PdfFile/SrcWriter/Field.cpp | 4 ++-- PdfFile/SrcWriter/Pages.cpp | 4 ++-- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Common/3dParty/html/htmltoxhtml.cpp b/Common/3dParty/html/htmltoxhtml.cpp index 5363122372..11e5ca9579 100644 --- a/Common/3dParty/html/htmltoxhtml.cpp +++ b/Common/3dParty/html/htmltoxhtml.cpp @@ -522,7 +522,7 @@ static void prettyprint_contents(GumboNode* node, NSStringUtils::CStringBuilderA remove_control_symbols(val); substitute_xml_entities_into_text(val); - // Remove FF (form feed) + // Remove FF size_t found = val.find_first_of("\014"); while(found != std::string::npos) { diff --git a/DesktopEditor/doctrenderer/drawingfile.h b/DesktopEditor/doctrenderer/drawingfile.h index 9e2b361baf..5c33a0b2bc 100644 --- a/DesktopEditor/doctrenderer/drawingfile.h +++ b/DesktopEditor/doctrenderer/drawingfile.h @@ -311,7 +311,7 @@ public: memcpy(pCopy, data, size); data = pCopy; } - // Captures the received memory, will be freed either in MemStream destructor, or via free on failure + // Captures the received memory, will be freed either in MemStream destructor or on failure return ((CPdfFile*)m_pFile)->MergePages(data, size, nMaxID, sPrefixForm); } return false; diff --git a/Fb2File/Fb2File.cpp b/Fb2File/Fb2File.cpp index 42e4544d68..85186b7107 100644 --- a/Fb2File/Fb2File.cpp +++ b/Fb2File/Fb2File.cpp @@ -39,7 +39,7 @@ struct CTc } }; -// Description of work information. Tag: title-info, src-title-info +// Description of book information. Tag: title-info, src-title-info struct STitleInfo { std::wstring m_sGenres; // Genres @@ -350,7 +350,7 @@ public: int nDeath = m_oLightReader.GetDepth(); while (m_oLightReader.ReadNextSiblingNode(nDeath)) { - // Write heading + // Write title if (m_oLightReader.GetName() == L"p") { // Write title + sLevel diff --git a/Fb2File/xml/tmp/main.cpp b/Fb2File/xml/tmp/main.cpp index 68abb4fef6..ca7f5508f6 100644 --- a/Fb2File/xml/tmp/main.cpp +++ b/Fb2File/xml/tmp/main.cpp @@ -7,7 +7,7 @@ int main() // sax reader XmlUtils::CXmlLiteReader oLightReader; /* - Conclusions: + Output: Returns success of file opening Reads file into m_pStream stream Stream length in m_lStreamLen diff --git a/HtmlFile2/htmlfile2.cpp b/HtmlFile2/htmlfile2.cpp index d5691dcd93..c4e3b35dd1 100644 --- a/HtmlFile2/htmlfile2.cpp +++ b/HtmlFile2/htmlfile2.cpp @@ -4970,7 +4970,7 @@ private: return false; unsigned int alfa = 0xffffff; - //default tone should be transparent, not white + //default background should be transparent, not white //memset(pBgraData, 0xff, nWidth * nHeight * 4); for (int i = 0; i < nWidth * nHeight; i++) { diff --git a/PdfFile/PdfEditor.cpp b/PdfFile/PdfEditor.cpp index 490bcd1af3..e56fdc188d 100644 --- a/PdfFile/PdfEditor.cpp +++ b/PdfFile/PdfEditor.cpp @@ -1935,7 +1935,7 @@ bool CPdfEditor::EditPage(int _nPageIndex, bool bSet, bool bActualPos) } else if (strcmp("Parent", chKey) == 0) { - // Parent page fields are transferred to the pages themselves + // Fields from Parent pages are transferred to the pages themselves oTemp.free(); continue; } @@ -3013,7 +3013,7 @@ bool CPdfEditor::PrintPages(const std::vector<bool>& arrPages, int nFlag) } else if (strcmp("Parent", chKey) == 0) { - // Parent page fields are transferred to the pages themselves + // Fields from Parent pages are transferred to the pages themselves oTemp.free(); continue; } @@ -3355,7 +3355,7 @@ bool CPdfEditor::AddPage(int nPageIndex) // Apply page addition for writer if (!m_pWriter->AddPage(nPageIndex)) return false; - // By default, first page dimensions are set, they can be changed later + // By default, first page dimensions are set for new page, they can be changed later double dPageDpiX, dPageDpiY; double dWidth, dHeight; m_pReader->GetPageInfo(0, &dWidth, &dHeight, &dPageDpiX, &dPageDpiY); @@ -4303,8 +4303,8 @@ std::vector<double> CPdfEditor::WriteRedact(const std::vector<std::wstring>& arr m_pWriter->put_BrushAlpha1(lAlpha1); m_pWriter->put_BrushAlpha2(lAlpha2); - // TODO edit render should intersect with all subsequent edits - // TODO actually there should be render of edit commands + // TODO Redact render should intersect with all subsequent Redacts + // TODO actually there should be render of Redact commands /* PdfWriter::CPage* pCurPage = m_pWriter->GetPage(); pDoc->FixEditPage(pCurPage); diff --git a/PdfFile/PdfWriter.cpp b/PdfFile/PdfWriter.cpp index 509c9a4cc7..d9d28cfbf6 100644 --- a/PdfFile/PdfWriter.cpp +++ b/PdfFile/PdfWriter.cpp @@ -3464,7 +3464,7 @@ bool CPdfWriter::DrawText(unsigned char* pCodes, const unsigned int& unLen, cons return false; // TODO should check center position, not start point - // TODO Many characters arrive here at once, and we need to draw only those outside redact areas + // TODO Many characters arrive here at once, and we need to draw only those outside Redact areas if (SkipRedact(dX, dY)) return true; @@ -3493,7 +3493,7 @@ bool CPdfWriter::DrawTextToRenderer(const unsigned int* unGid, const unsigned in if (m_bSplit) return false; // TODO should check center position, not start point - // TODO Many characters arrive here at once, and we need to draw only those outside redact areas + // TODO Many characters arrive here at once, and we need to draw only those outside Redact areas if (SkipRedact(dX, dY)) return true; // TODO pdf allows creating custom font, but this should not be used to recreate a font that is prohibited for editing or embedding @@ -3512,7 +3512,7 @@ bool CPdfWriter::DrawTextToRenderer(const unsigned int* unGid, const unsigned in bool CPdfWriter::PathCommandDrawText(unsigned int* pUnicodes, unsigned int unLen, const double& dX, const double& dY, const unsigned int* pGids) { // TODO should check center position, not start point - // TODO Many characters arrive here at once, and we need to draw only those outside redact areas + // TODO Many characters arrive here at once, and we need to draw only those outside Redact areas if (SkipRedact(dX, dY)) return true; diff --git a/PdfFile/SrcReader/PdfAnnot.cpp b/PdfFile/SrcReader/PdfAnnot.cpp index 2342f6dd81..3ecece0477 100644 --- a/PdfFile/SrcReader/PdfAnnot.cpp +++ b/PdfFile/SrcReader/PdfAnnot.cpp @@ -646,7 +646,7 @@ CAnnotWidgetBtn::CAnnotWidgetBtn(PDFDoc* pdfDoc, AcroFormField* pField, int nSta oObj.free(); } - // 13 - Caption position - TP + // 13 - Title position - TP if (oMK.dictLookup("TP", &oObj)->isInt()) { m_nTP = oObj.getInt(); diff --git a/PdfFile/SrcWriter/EncryptDictionary.cpp b/PdfFile/SrcWriter/EncryptDictionary.cpp index cd1e040fc7..c52c2e74c6 100644 --- a/PdfFile/SrcWriter/EncryptDictionary.cpp +++ b/PdfFile/SrcWriter/EncryptDictionary.cpp @@ -94,7 +94,7 @@ namespace PdfWriter std::time_t oTime = time(0); hash.Update( (BYTE*)&oTime, sizeof(oTime)); - // Create file identifier from Info library elements. + // Create file identifier from Info elements. if (pInfo) { const char *sTemp = NULL; diff --git a/PdfFile/SrcWriter/Field.cpp b/PdfFile/SrcWriter/Field.cpp index ad8f1ec3d8..c4e6b2ba64 100644 --- a/PdfFile/SrcWriter/Field.cpp +++ b/PdfFile/SrcWriter/Field.cpp @@ -3279,7 +3279,7 @@ namespace PdfWriter } } - // Set (checked) + // Set if (!bSet) return; double dShift = dBorder / 2.0; @@ -3390,7 +3390,7 @@ namespace PdfWriter m_pStream->WriteStr("s\012Q\012"); } - // Set (checked) + // Set if (!bSet) return; double dDiff = std::abs(dW - dH) / 2.0; diff --git a/PdfFile/SrcWriter/Pages.cpp b/PdfFile/SrcWriter/Pages.cpp index ae081ad6ba..ceba409102 100644 --- a/PdfFile/SrcWriter/Pages.cpp +++ b/PdfFile/SrcWriter/Pages.cpp @@ -1696,7 +1696,7 @@ namespace PdfWriter void CPage::BeginMarkedContentDict(const std::string& sName, CDictObject* pBDC) { // Operator : BDC - // Description: Begin marked content with property list + // Description: Begin marked content with dict m_pStream->WriteEscapeName(sName.c_str()); m_pStream->WriteChar(' '); @@ -1713,7 +1713,7 @@ namespace PdfWriter void CPage::SetRenderingIntent(ERenderingIntent eRenderingIntent) { // Operator : ri - // Description: Rendering intent / color reproduction methods + // Description: Rendering intent / color rendering methods m_pStream->WriteEscapeName(c_sRenderingIntent[(int)eRenderingIntent]); m_pStream->WriteStr(" ri\012"); From 47fed9cb63f7ea95ddcff5655f1c7ca71ec031fd Mon Sep 17 00:00:00 2001 From: Kirill Polyakov <Kirill.Poljakov@onlyoffice.com> Date: Thu, 2 Apr 2026 23:18:03 +0300 Subject: [PATCH 3/5] Fix CssCalculator, EpubTest, HWPFile Checked: - Apple - HtmlFile2 - DesktopEditor\raster\Metafile - EpubFile - Fb2File - HWPFile - OFDFile --- Common/3dParty/html/css/src/CUnitMeasureConverter.cpp | 4 ++-- Common/3dParty/html/css/src/StaticFunctions.cpp | 2 +- Common/3dParty/html/css/src/StyleProperties.cpp | 4 ++-- EpubFile/test/main.cpp | 1 - HwpFile/HwpDoc/HWPElements/HWPRecordCharShape.cpp | 2 +- HwpFile/HwpDoc/HWPElements/HWPRecordCtrlHeader.cpp | 4 ++-- HwpFile/HwpDoc/HWPElements/HWPRecordParaShape.cpp | 4 ++-- HwpFile/HwpDoc/HWPElements/HwpRecordTabDef.cpp | 2 +- HwpFile/HwpDoc/HWPElements/HwpRecordTypes.h | 2 +- HwpFile/HwpDoc/HWPFile.cpp | 2 +- HwpFile/HwpDoc/Paragraph/CtrlField.cpp | 2 +- HwpFile/HwpDoc/Paragraph/CtrlShapePic.cpp | 8 ++++---- 12 files changed, 18 insertions(+), 19 deletions(-) diff --git a/Common/3dParty/html/css/src/CUnitMeasureConverter.cpp b/Common/3dParty/html/css/src/CUnitMeasureConverter.cpp index 97b60a4eed..a614a78c7c 100644 --- a/Common/3dParty/html/css/src/CUnitMeasureConverter.cpp +++ b/Common/3dParty/html/css/src/CUnitMeasureConverter.cpp @@ -23,7 +23,7 @@ namespace NSCSS case NSCSS::Inch: return dValue / (double)ushDPI; case NSCSS::Peak: - return dValue * 6. / (double)ushDPI; // 1 inch = 6 picas + return dValue * 6. / (double)ushDPI; // 1 inch = 6 peak case NSCSS::Twips: return dValue * 1440. / (double)ushDPI; default: @@ -122,7 +122,7 @@ namespace NSCSS case NSCSS::Point: return dValue * 12.; // 12 = 72 / 6 case NSCSS::Pixel: - return dValue * (double)ushDPI / 6.; // 1 inch = 6 picas + return dValue * (double)ushDPI / 6.; // 1 inch = 6 peak case NSCSS::Cantimeter: return dValue * 0.423; // 0.423 = 2.54 / 6 case NSCSS::Millimeter: diff --git a/Common/3dParty/html/css/src/StaticFunctions.cpp b/Common/3dParty/html/css/src/StaticFunctions.cpp index d35f10bdf9..5df07729b0 100644 --- a/Common/3dParty/html/css/src/StaticFunctions.cpp +++ b/Common/3dParty/html/css/src/StaticFunctions.cpp @@ -23,7 +23,7 @@ namespace NS_STATIC_FUNCTIONS std::string sEncoding; if (true) { - // determine encoding + //determining the encoding const std::string::size_type& posCharset = sContent.find("@charset"); if (std::string::npos != posCharset) diff --git a/Common/3dParty/html/css/src/StyleProperties.cpp b/Common/3dParty/html/css/src/StyleProperties.cpp index 078244ee24..835b5e33ce 100644 --- a/Common/3dParty/html/css/src/StyleProperties.cpp +++ b/Common/3dParty/html/css/src/StyleProperties.cpp @@ -392,8 +392,8 @@ namespace NSCSS std::wstring wsNewValue = wsValue; - const bool bImportant{CutImportant(wsNewValue)}; //TODO:: sometimes we know that "!important" definitely won't occur - // perhaps should add another method + const bool bImportant{CutImportant(wsNewValue)}; + if (m_bImportant && !bImportant) return false; diff --git a/EpubFile/test/main.cpp b/EpubFile/test/main.cpp index d5782576fc..bb34443a8b 100644 --- a/EpubFile/test/main.cpp +++ b/EpubFile/test/main.cpp @@ -29,7 +29,6 @@ int main() std::vector<std::wstring> arFiles = NSDirectory::GetFiles(NSFile::GetProcessDirectory() + L"/../../../Files"); clock_t tTime1 = clock(); - //Russian characters are not displayed in the console for (const std::wstring& sFileName : arFiles) { clock_t tTimeBegin = clock(); diff --git a/HwpFile/HwpDoc/HWPElements/HWPRecordCharShape.cpp b/HwpFile/HwpDoc/HWPElements/HWPRecordCharShape.cpp index 2ab369c30b..a30cea9202 100644 --- a/HwpFile/HwpDoc/HWPElements/HWPRecordCharShape.cpp +++ b/HwpFile/HwpDoc/HWPElements/HWPRecordCharShape.cpp @@ -19,7 +19,7 @@ EAccent GetAccent(int nValue) } } -//Only found in hwpx +//Occurs only in hwpx EAccent GetAccent(const std::string& sValue) { if (sValue.empty() || "NONE" == sValue) diff --git a/HwpFile/HwpDoc/HWPElements/HWPRecordCtrlHeader.cpp b/HwpFile/HwpDoc/HWPElements/HWPRecordCtrlHeader.cpp index a9f79f6d22..73906ca53e 100644 --- a/HwpFile/HwpDoc/HWPElements/HWPRecordCtrlHeader.cpp +++ b/HwpFile/HwpDoc/HWPElements/HWPRecordCtrlHeader.cpp @@ -52,14 +52,14 @@ CCtrl* CHWPRecordCtrlHeader::Parse(int nTagNum, int nLevel, int nSize, CHWPStrea pCtrl = new CCtrlEqEdit(sCtrlID, nSize - oBuffer.GetDistanceToLastPos(), oBuffer, 0, nVersion); else if (L"dhgp" == sCtrlID) { + // TODO:: Return to this later int nTempSize = nSize - oBuffer.GetDistanceToLastPos(); oBuffer.Skip(nTempSize); } else if (L"cot%" == sCtrlID) { + // TODO:: Return to this later // When content is read as UTF_16LE, the following content remains the same - // ¥TableOfContents:set:140:ContentsMake:uint:17 ContentsStyles:wstring:0: ContentsLevel:int:5 ContentsAutoTabRight:int:0 ContentsLeader:int:3 ContentsHyperlink:bool:1 - int nTempSize = nSize - oBuffer.GetDistanceToLastPos(); oBuffer.Skip(nTempSize); } diff --git a/HwpFile/HwpDoc/HWPElements/HWPRecordParaShape.cpp b/HwpFile/HwpDoc/HWPElements/HWPRecordParaShape.cpp index abfe57564c..62a3e4fef5 100644 --- a/HwpFile/HwpDoc/HWPElements/HWPRecordParaShape.cpp +++ b/HwpFile/HwpDoc/HWPElements/HWPRecordParaShape.cpp @@ -160,8 +160,8 @@ CHWPRecordParaShape::CHWPRecordParaShape(CHWPDocInfo& oDocInfo, CXMLReader& oRea m_bConnect(false), m_bIgnoreMargin(false), m_bParaTailShape(false), m_nIndent(0), m_nMarginLeft(0), m_nMarginRight(0), m_nMarginPrev(0), m_nMarginNext(0) { - //In HWPX data in this node is written as node-type data - //In HWPML data in this node is written as argument-type data + //In HWPX, node data is written not only in arguments but also in nested nodes. + //In HWPML, node data is written in arguments. if (EHanType::HWPX == eType) { diff --git a/HwpFile/HwpDoc/HWPElements/HwpRecordTabDef.cpp b/HwpFile/HwpDoc/HWPElements/HwpRecordTabDef.cpp index 420d10b190..50a3ed524f 100644 --- a/HwpFile/HwpDoc/HWPElements/HwpRecordTabDef.cpp +++ b/HwpFile/HwpDoc/HWPElements/HwpRecordTabDef.cpp @@ -93,7 +93,7 @@ CHwpRecordTabDef::CHwpRecordTabDef(CHWPDocInfo& oDocInfo, CXMLReader& oReader, E } END_READ_ATTRIBUTES(oReader) - // The following structure is only found in HWPX format + // The following structure is occurs only in HWPX format if (EHanType::HWPX != eType) return; diff --git a/HwpFile/HwpDoc/HWPElements/HwpRecordTypes.h b/HwpFile/HwpDoc/HWPElements/HwpRecordTypes.h index 6826a6adcc..99e2b1de79 100644 --- a/HwpFile/HwpDoc/HWPElements/HwpRecordTypes.h +++ b/HwpFile/HwpDoc/HWPElements/HwpRecordTypes.h @@ -74,7 +74,7 @@ inline ELineStyle1 GetLineStyle1(const std::string& sValue, EHanType eType) if (GetValueName(EValue::SlimThickSlim, eType) == sValue) return ELineStyle1::SLIM_THICK_SLIM; - // Other values are only found in hwpx + // Other values are occurs only in hwpx if (EHanType::HWPX != eType) return ELineStyle1::SOLID; diff --git a/HwpFile/HwpDoc/HWPFile.cpp b/HwpFile/HwpDoc/HWPFile.cpp index 8eb56dc0d8..9ccf935e43 100644 --- a/HwpFile/HwpDoc/HWPFile.cpp +++ b/HwpFile/HwpDoc/HWPFile.cpp @@ -294,7 +294,7 @@ bool CHWPFile::Unzip(CHWPStream& oInput, CHWPStream& oBuffer) return DEFLATE_OK == nRes || DEFLATE_STREAM_END == nRes; } -// Since consistent behavior is required across all OSes, +// Since identical behavior is required across all OSes, // we use our own randomizer class CRandomizer diff --git a/HwpFile/HwpDoc/Paragraph/CtrlField.cpp b/HwpFile/HwpDoc/Paragraph/CtrlField.cpp index 43e19b063d..17efbe123d 100644 --- a/HwpFile/HwpDoc/Paragraph/CtrlField.cpp +++ b/HwpFile/HwpDoc/Paragraph/CtrlField.cpp @@ -65,7 +65,7 @@ CCtrlField::CCtrlField(const HWP_STRING& sCtrlID, CXMLReader& oReader, EHanType if (!wsName.empty() && EFieldType::Bookmark == m_eType) AddStringParam(L"bookmarkname", wsName); - // Only found in HWPX + // Occurs only in HWPX if (EHanType::HWPX == eType) { WHILE_READ_NEXT_NODE_WITH_ONE_NAME(oReader, "hp:parameters") diff --git a/HwpFile/HwpDoc/Paragraph/CtrlShapePic.cpp b/HwpFile/HwpDoc/Paragraph/CtrlShapePic.cpp index 181e29ba4d..c7031737db 100644 --- a/HwpFile/HwpDoc/Paragraph/CtrlShapePic.cpp +++ b/HwpFile/HwpDoc/Paragraph/CtrlShapePic.cpp @@ -85,7 +85,7 @@ CShadow::CShadow(CXMLReader& oReader, EHanType eType) else if (GetAttributeName(EAttribute::RotationStyle, eType) == sAttributeName) m_nRotation = (int)oReader.GetBool(); - // The following attributes are only found in HWPML + // The following attributes are occurs only in HWPML else if (EHanType::HWPML != eType) continue; else if ("SkewX" == sAttributeName) @@ -99,7 +99,7 @@ CShadow::CShadow(CXMLReader& oReader, EHanType eType) } END_READ_ATTRIBUTES(oReader) - // The following nodes are only found in HWPX + // The following nodes are occurs only in HWPX if (EHanType::HWPX != eType) return; @@ -231,7 +231,7 @@ CReflect::CReflect(CXMLReader& oReader, EHanType eType) else if (GetAttributeName(EAttribute::FadeDirection, eType) == sAttributeName) m_fOffsetDirection = oReader.GetDouble(); - // The following attributes are only found in HWPML + // The following attributes are occurs only in HWPML else if (EHanType::HWPML != eType) continue; else if ("SkewX" == sAttributeName) @@ -253,7 +253,7 @@ CReflect::CReflect(CXMLReader& oReader, EHanType eType) } END_READ_ATTRIBUTES(oReader) - // The following nodes are only found in HWPX + // The following nodes are occurs only in HWPX if (EHanType::HWPX != eType) return; From 2fd10fc33f94c8b852117f0e47c34b11657c3947 Mon Sep 17 00:00:00 2001 From: Elena Subbotina <Elena.Subbotina@onlyoffice.com> Date: Fri, 3 Apr 2026 15:57:38 +0300 Subject: [PATCH 4/5] . --- RtfFile/Format/RtfLex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RtfFile/Format/RtfLex.cpp b/RtfFile/Format/RtfLex.cpp index c6cf99b506..ad51ad7257 100644 --- a/RtfFile/Format/RtfLex.cpp +++ b/RtfFile/Format/RtfLex.cpp @@ -350,7 +350,7 @@ void RtfLex::parseText(int car, RtfToken& token) int nTempBufPos = 0; //1 MB int c = car; - //while ((isalnum(c) || c == '"'|| c == ':'|| c == '/' || c == '.') &&c != '\\' && c != '}' && c != '{' && c != Eof) // (corrupted comment removed) + //while ((isalnum(c) || c == '"'|| c == ':'|| c == '/' || c == '.') &&c != '\\' && c != '}' && c != '{' && c != Eof) //while (c != '\\' && c != '}' && c != '{' && c != Eof) //while (c != ';' &&c ! = '\\' && c != '}' && c != '{' && c != EOF) while (c != '\\' && c != '}' && c != '{' && c != EOF) From 19758d579d403fdf55e15d992866855df6c0e190 Mon Sep 17 00:00:00 2001 From: Elena Subbotina <Elena.Subbotina@onlyoffice.com> Date: Fri, 3 Apr 2026 16:55:46 +0300 Subject: [PATCH 5/5] . --- OOXML/DocxFormat/Bibliography.cpp | 2 +- OOXML/DocxFormat/ContentTypes.cpp | 2 +- OOXML/DocxFormat/FtnEdn.cpp | 2 +- OOXML/DocxFormat/Logic/Annotations.cpp | 18 +++++++-------- OOXML/DocxFormat/Logic/Bdo.cpp | 2 +- OOXML/DocxFormat/Logic/Table.cpp | 2 +- OOXML/DocxFormat/Logic/TableProperty.cpp | 16 +++++++------- OOXML/DocxFormat/Logic/Vml.cpp | 12 +++++----- OOXML/DocxFormat/Logic/VmlOfficeDrawing.cpp | 16 +++++++------- OOXML/DocxFormat/Math/oMathContent.cpp | 2 +- OOXML/DocxFormat/Settings/Settings.cpp | 4 ++-- OOXML/PPTXFormat/Logic/TextFont.cpp | 2 +- OOXML/XlsxFormat/CalcChain/CalcChain.cpp | 2 +- OOXML/XlsxFormat/ComplexTypes_Spreadsheet.cpp | 2 +- OOXML/XlsxFormat/Drawing/Pos.cpp | 2 +- OOXML/XlsxFormat/SharedStrings/PhoneticPr.cpp | 4 ++-- OOXML/XlsxFormat/Styles/Colors.cpp | 2 +- OOXML/XlsxFormat/Styles/TableStyles.cpp | 4 ++-- OOXML/XlsxFormat/Styles/Xfs.cpp | 2 +- OOXML/XlsxFormat/Styles/dxf.cpp | 2 +- OOXML/XlsxFormat/Table/Autofilter.cpp | 22 +++++++++---------- OOXML/XlsxFormat/Workbook/CalcPr.cpp | 2 +- .../Worksheets/WorksheetChildOther.cpp | 2 +- 23 files changed, 63 insertions(+), 63 deletions(-) diff --git a/OOXML/DocxFormat/Bibliography.cpp b/OOXML/DocxFormat/Bibliography.cpp index 63913ca7f1..d00ea6ecb2 100644 --- a/OOXML/DocxFormat/Bibliography.cpp +++ b/OOXML/DocxFormat/Bibliography.cpp @@ -112,7 +112,7 @@ namespace OOX } void CBibliography::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("SelectedStyle"), m_sSelectedStyle ) WritingElement_ReadAttributes_Read_else_if( oReader, _T("StyleName"), m_sStyleName ) diff --git a/OOXML/DocxFormat/ContentTypes.cpp b/OOXML/DocxFormat/ContentTypes.cpp index af67d1f228..07d100a26d 100644 --- a/OOXML/DocxFormat/ContentTypes.cpp +++ b/OOXML/DocxFormat/ContentTypes.cpp @@ -131,7 +131,7 @@ namespace OOX } void CDefault::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start(oReader) WritingElement_ReadAttributes_ReadSingle(oReader, L"Extension", m_sExtension) WritingElement_ReadAttributes_End(oReader) diff --git a/OOXML/DocxFormat/FtnEdn.cpp b/OOXML/DocxFormat/FtnEdn.cpp index 417e4c326e..ede91f328a 100644 --- a/OOXML/DocxFormat/FtnEdn.cpp +++ b/OOXML/DocxFormat/FtnEdn.cpp @@ -241,7 +241,7 @@ namespace OOX } void CFtnEdn::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if( oReader, L"w:id", m_oId ) WritingElement_ReadAttributes_Read_else_if( oReader, L"w:type", m_oType ) diff --git a/OOXML/DocxFormat/Logic/Annotations.cpp b/OOXML/DocxFormat/Logic/Annotations.cpp index e8591f67f0..627df0447e 100644 --- a/OOXML/DocxFormat/Logic/Annotations.cpp +++ b/OOXML/DocxFormat/Logic/Annotations.cpp @@ -175,7 +175,7 @@ namespace OOX } void CCustomXmlDelRangeEnd::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, L"w:id", m_oId ) WritingElement_ReadAttributes_End( oReader ) @@ -284,7 +284,7 @@ namespace OOX } void CCustomXmlInsRangeEnd::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, L"w:id", m_oId ) WritingElement_ReadAttributes_End( oReader ) @@ -568,7 +568,7 @@ namespace OOX } void CCustomXmlMoveToRangeStart::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, L"w:author", m_sAuthor ) WritingElement_ReadAttributes_Read_else_if( oReader, L"w:date", m_oDate ) @@ -612,7 +612,7 @@ namespace OOX } void CMoveFromRangeEnd::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, L"w:displacedbyCustomXml", m_oDisplacedByCustomXml ) WritingElement_ReadAttributes_Read_else_if( oReader, L"w:id", m_oId ) @@ -684,7 +684,7 @@ namespace OOX } void CMoveFromRangeStart::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, L"w:author", m_sAuthor ) WritingElement_ReadAttributes_Read_else_if( oReader, L"w:colFirst", m_oColFirst ) @@ -1198,7 +1198,7 @@ namespace OOX } void CPermEnd::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, L"w:displacedbyCustomXml", m_oDisplacedByCustomXml ) WritingElement_ReadAttributes_Read_else_if( oReader, L"w:id", m_sId ) @@ -1296,7 +1296,7 @@ namespace OOX } void CProofErr::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, L"w:type", m_oType ) WritingElement_ReadAttributes_End( oReader ) @@ -1414,7 +1414,7 @@ namespace OOX } void CIns::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if( oReader, L"w:author", m_sAuthor ) WritingElement_ReadAttributes_Read_else_if( oReader, L"w:date", m_oDate ) @@ -1533,7 +1533,7 @@ namespace OOX } void CDel::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if( oReader, L"w:author", m_sAuthor ) WritingElement_ReadAttributes_Read_else_if( oReader, L"w:date", m_oDate ) diff --git a/OOXML/DocxFormat/Logic/Bdo.cpp b/OOXML/DocxFormat/Logic/Bdo.cpp index 335546f3a1..310f59a49c 100644 --- a/OOXML/DocxFormat/Logic/Bdo.cpp +++ b/OOXML/DocxFormat/Logic/Bdo.cpp @@ -280,7 +280,7 @@ namespace OOX void CBdo::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, _T("w:val"), m_oVal ) WritingElement_ReadAttributes_End( oReader ) diff --git a/OOXML/DocxFormat/Logic/Table.cpp b/OOXML/DocxFormat/Logic/Table.cpp index c14f1ddea0..2361d0ae0b 100644 --- a/OOXML/DocxFormat/Logic/Table.cpp +++ b/OOXML/DocxFormat/Logic/Table.cpp @@ -78,7 +78,7 @@ namespace ComplexTypes } void CTblGridCol::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, L"w:w", m_oW ) WritingElement_ReadAttributes_End( oReader ) diff --git a/OOXML/DocxFormat/Logic/TableProperty.cpp b/OOXML/DocxFormat/Logic/TableProperty.cpp index 07672fa5b0..635bd354a0 100644 --- a/OOXML/DocxFormat/Logic/TableProperty.cpp +++ b/OOXML/DocxFormat/Logic/TableProperty.cpp @@ -88,7 +88,7 @@ namespace ComplexTypes } void CCellMergeTrackChange::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, L"w:author", m_sAuthor ) WritingElement_ReadAttributes_Read_else_if( oReader, L"w:date", m_oDate ) @@ -130,7 +130,7 @@ namespace ComplexTypes } void CHMerge::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, L"w:val", m_oVal ) WritingElement_ReadAttributes_End( oReader ) @@ -167,7 +167,7 @@ namespace ComplexTypes } void CVMerge::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, L"w:val", m_oVal ) WritingElement_ReadAttributes_End( oReader ) @@ -249,7 +249,7 @@ namespace ComplexTypes } void CJcTable::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, L"w:val", m_oVal ) WritingElement_ReadAttributes_End( oReader ) @@ -291,7 +291,7 @@ namespace ComplexTypes } void CTblLayoutType::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, L"w:type", m_oType ) WritingElement_ReadAttributes_End( oReader ) @@ -493,7 +493,7 @@ namespace ComplexTypes } void CTblLook::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, L"w:firstColumn", m_oFirstColumn ) WritingElement_ReadAttributes_Read_else_if( oReader, L"w:firstRow", m_oFirstRow ) @@ -521,7 +521,7 @@ namespace ComplexTypes } void CTblOverlap::FromXML(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, L"w:val", m_oVal ) WritingElement_ReadAttributes_End( oReader ) @@ -685,7 +685,7 @@ namespace ComplexTypes } void CTblPPr::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, L"w:bottomFromText", m_oBottomFromText ) WritingElement_ReadAttributes_Read_else_if( oReader, L"w:horzAnchor", m_oHorzAnchor ) diff --git a/OOXML/DocxFormat/Logic/Vml.cpp b/OOXML/DocxFormat/Logic/Vml.cpp index af8ad5a78b..a524b3ca9c 100644 --- a/OOXML/DocxFormat/Logic/Vml.cpp +++ b/OOXML/DocxFormat/Logic/Vml.cpp @@ -615,7 +615,7 @@ namespace OOX } void CArc::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + if ( oReader.GetAttributesCount() <= 0 ) return; @@ -685,7 +685,7 @@ namespace OOX } void CCurve::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + if ( oReader.GetAttributesCount() <= 0 ) return; @@ -899,7 +899,7 @@ namespace OOX // Set default values m_oPoints.SetDelimiter( ' ' ); - // Read attributes + if ( oReader.GetAttributesCount() <= 0 ) return; @@ -1014,7 +1014,7 @@ namespace OOX // Set default values m_oArcSize.SetPercentage( 20 ); - // Read attributes + if ( oReader.GetAttributesCount() <= 0 ) return; @@ -1855,7 +1855,7 @@ namespace OOX m_oInset.Init(); m_oInset->Set(7.2, 3.6, 7.2, 3.6 ); - // Read attributes + if ( oReader.GetAttributesCount() <= 0 ) return; @@ -2978,7 +2978,7 @@ namespace OOX m_oFrom.SetValue( 0, 0 ); m_oTo.SetValue( 10, 10 ); - // Read attributes + if ( oReader.GetAttributesCount() <= 0 ) return; diff --git a/OOXML/DocxFormat/Logic/VmlOfficeDrawing.cpp b/OOXML/DocxFormat/Logic/VmlOfficeDrawing.cpp index c8810d2ff2..e55968c085 100644 --- a/OOXML/DocxFormat/Logic/VmlOfficeDrawing.cpp +++ b/OOXML/DocxFormat/Logic/VmlOfficeDrawing.cpp @@ -374,7 +374,7 @@ namespace OOX // Set default values std::wstring sColors; - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, L"v:ext", m_oExt ) WritingElement_ReadAttributes_Read_else_if( oReader, L"colors", sColors ) @@ -488,7 +488,7 @@ namespace OOX } void CRelation::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, L"v:ext", m_oExt ) WritingElement_ReadAttributes_Read_else_if( oReader, L"idcntr", m_sIdCntr ) @@ -1458,7 +1458,7 @@ namespace OOX } void CR::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, L"how", m_oHow ) WritingElement_ReadAttributes_Read_else_if( oReader, L"id", m_sId ) @@ -1530,7 +1530,7 @@ namespace OOX } void CRegroupTable::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, L"v:ext", m_oExt ) WritingElement_ReadAttributes_End( oReader ) @@ -1599,7 +1599,7 @@ namespace OOX } void CRules::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, L"v:ext", m_oExt ) WritingElement_ReadAttributes_End( oReader ) @@ -1665,7 +1665,7 @@ namespace OOX } void CShapeLayout::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, L"v:ext", m_oExt ) WritingElement_ReadAttributes_End( oReader ) @@ -1871,7 +1871,7 @@ namespace OOX } void CSignatureLine::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, L"o:addlxml", m_sAddXml ) WritingElement_ReadAttributes_Read_else_if( oReader, L"allowcomments", m_oAllowComments ) @@ -1934,7 +1934,7 @@ namespace OOX } void CSkew::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, L"v:ext", m_oExt ) WritingElement_ReadAttributes_Read_else_if( oReader, L"id", m_sId ) diff --git a/OOXML/DocxFormat/Math/oMathContent.cpp b/OOXML/DocxFormat/Math/oMathContent.cpp index 929e2b3bfd..68277a8cf4 100644 --- a/OOXML/DocxFormat/Math/oMathContent.cpp +++ b/OOXML/DocxFormat/Math/oMathContent.cpp @@ -2664,7 +2664,7 @@ namespace OOX } void CMIns::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("w:author"), m_sAuthor ) WritingElement_ReadAttributes_Read_else_if( oReader, _T("w:date"), m_oDate ) diff --git a/OOXML/DocxFormat/Settings/Settings.cpp b/OOXML/DocxFormat/Settings/Settings.cpp index fb106ee0b5..b1309162c1 100644 --- a/OOXML/DocxFormat/Settings/Settings.cpp +++ b/OOXML/DocxFormat/Settings/Settings.cpp @@ -170,7 +170,7 @@ namespace Settings } void CAutoCaption::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + if ( oReader.GetAttributesCount() <= 0 ) return; @@ -304,7 +304,7 @@ namespace Settings } void CCaption::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + if ( oReader.GetAttributesCount() <= 0 ) return; diff --git a/OOXML/PPTXFormat/Logic/TextFont.cpp b/OOXML/PPTXFormat/Logic/TextFont.cpp index b0d1a03c0e..b9eb5321f1 100644 --- a/OOXML/PPTXFormat/Logic/TextFont.cpp +++ b/OOXML/PPTXFormat/Logic/TextFont.cpp @@ -110,7 +110,7 @@ namespace PPTX } void TextFont::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + if ( oReader.GetAttributesCount() <= 0 ) return; diff --git a/OOXML/XlsxFormat/CalcChain/CalcChain.cpp b/OOXML/XlsxFormat/CalcChain/CalcChain.cpp index c92ccf3a00..cd89062110 100644 --- a/OOXML/XlsxFormat/CalcChain/CalcChain.cpp +++ b/OOXML/XlsxFormat/CalcChain/CalcChain.cpp @@ -66,7 +66,7 @@ namespace OOX } void CCalcCell::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("a"), m_oArray ) diff --git a/OOXML/XlsxFormat/ComplexTypes_Spreadsheet.cpp b/OOXML/XlsxFormat/ComplexTypes_Spreadsheet.cpp index 35feb160c7..2b85bf6958 100644 --- a/OOXML/XlsxFormat/ComplexTypes_Spreadsheet.cpp +++ b/OOXML/XlsxFormat/ComplexTypes_Spreadsheet.cpp @@ -337,7 +337,7 @@ namespace ComplexTypes } void CChartBarGrouping::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, _T("val"), m_oVal ) WritingElement_ReadAttributes_End( oReader ) diff --git a/OOXML/XlsxFormat/Drawing/Pos.cpp b/OOXML/XlsxFormat/Drawing/Pos.cpp index e5914d63e3..628e61c645 100644 --- a/OOXML/XlsxFormat/Drawing/Pos.cpp +++ b/OOXML/XlsxFormat/Drawing/Pos.cpp @@ -70,7 +70,7 @@ namespace OOX } void CPos::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("x"), m_oX ) diff --git a/OOXML/XlsxFormat/SharedStrings/PhoneticPr.cpp b/OOXML/XlsxFormat/SharedStrings/PhoneticPr.cpp index 2bd8ae3a98..a491ae273a 100644 --- a/OOXML/XlsxFormat/SharedStrings/PhoneticPr.cpp +++ b/OOXML/XlsxFormat/SharedStrings/PhoneticPr.cpp @@ -120,7 +120,7 @@ namespace OOX } void CPhonetic::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("alignment"), m_oAlignment ) @@ -234,7 +234,7 @@ namespace OOX } void CRPh::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("eb"), m_oEb ) diff --git a/OOXML/XlsxFormat/Styles/Colors.cpp b/OOXML/XlsxFormat/Styles/Colors.cpp index 2f523d590a..270a9df363 100644 --- a/OOXML/XlsxFormat/Styles/Colors.cpp +++ b/OOXML/XlsxFormat/Styles/Colors.cpp @@ -140,7 +140,7 @@ namespace OOX } void CColors::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("count"), m_oCount ) WritingElement_ReadAttributes_End( oReader ) diff --git a/OOXML/XlsxFormat/Styles/TableStyles.cpp b/OOXML/XlsxFormat/Styles/TableStyles.cpp index e757b2464e..23c7e642e5 100644 --- a/OOXML/XlsxFormat/Styles/TableStyles.cpp +++ b/OOXML/XlsxFormat/Styles/TableStyles.cpp @@ -241,7 +241,7 @@ namespace OOX } void CTableStyleElement::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("dxfId"), m_oDxfId ) @@ -573,7 +573,7 @@ namespace OOX } void CTableStyles::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("count"), m_oCount ) diff --git a/OOXML/XlsxFormat/Styles/Xfs.cpp b/OOXML/XlsxFormat/Styles/Xfs.cpp index 610cf1f87d..f891daed55 100644 --- a/OOXML/XlsxFormat/Styles/Xfs.cpp +++ b/OOXML/XlsxFormat/Styles/Xfs.cpp @@ -636,7 +636,7 @@ namespace OOX } void CCellXfs::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("count"), m_oCount ) diff --git a/OOXML/XlsxFormat/Styles/dxf.cpp b/OOXML/XlsxFormat/Styles/dxf.cpp index a3a77772e2..193079ab3d 100644 --- a/OOXML/XlsxFormat/Styles/dxf.cpp +++ b/OOXML/XlsxFormat/Styles/dxf.cpp @@ -371,7 +371,7 @@ namespace OOX } void CDxfs::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("count"), m_oCount ) WritingElement_ReadAttributes_End( oReader ) diff --git a/OOXML/XlsxFormat/Table/Autofilter.cpp b/OOXML/XlsxFormat/Table/Autofilter.cpp index 76768680d5..9c01e66238 100644 --- a/OOXML/XlsxFormat/Table/Autofilter.cpp +++ b/OOXML/XlsxFormat/Table/Autofilter.cpp @@ -230,7 +230,7 @@ namespace OOX } void CSortCondition::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("descending"), m_oDescending ) @@ -460,7 +460,7 @@ namespace OOX } void CSortState::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("ref"), m_oRef ) @@ -545,7 +545,7 @@ namespace OOX } void CColorFilter::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("cellColor"), m_oCellColor ) @@ -703,7 +703,7 @@ namespace OOX } void CDynamicFilter::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("type"), m_oType ) @@ -913,7 +913,7 @@ namespace OOX } void CCustomFilter::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("operator"), m_oOperator ) @@ -1044,7 +1044,7 @@ namespace OOX } void CCustomFilters::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("and"), m_oAnd ) @@ -1125,7 +1125,7 @@ namespace OOX } void CFilter::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("val"), m_oVal ) @@ -1248,7 +1248,7 @@ namespace OOX } void CDateGroupItem::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("dateTimeGrouping"), m_oDateTimeGrouping ) @@ -1407,7 +1407,7 @@ namespace OOX } void CFilters::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("blank"), m_oBlank ) @@ -1495,7 +1495,7 @@ namespace OOX } void CTop10::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("filterVal"), m_oFilterVal ) @@ -1684,7 +1684,7 @@ namespace OOX } void CFilterColumn::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("colId"), m_oColId ) diff --git a/OOXML/XlsxFormat/Workbook/CalcPr.cpp b/OOXML/XlsxFormat/Workbook/CalcPr.cpp index d96d611d06..59abddcda5 100644 --- a/OOXML/XlsxFormat/Workbook/CalcPr.cpp +++ b/OOXML/XlsxFormat/Workbook/CalcPr.cpp @@ -146,7 +146,7 @@ namespace OOX } void CCalcPr::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("calcId"), m_oCalcId ) diff --git a/OOXML/XlsxFormat/Worksheets/WorksheetChildOther.cpp b/OOXML/XlsxFormat/Worksheets/WorksheetChildOther.cpp index ca55d8674f..58d656d24c 100644 --- a/OOXML/XlsxFormat/Worksheets/WorksheetChildOther.cpp +++ b/OOXML/XlsxFormat/Worksheets/WorksheetChildOther.cpp @@ -2506,7 +2506,7 @@ namespace OOX } void COutlinePr::ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Read attributes + WritingElement_ReadAttributes_Start(oReader) WritingElement_ReadAttributes_Read_if(oReader, (L"applyStyles"), m_oApplyStyles) WritingElement_ReadAttributes_Read_else_if(oReader, (L"showOutlineSymbols"), m_oShowOutlineSymbols)