From 74bac4cec6f846937658d7776fe88fad6e6763b5 Mon Sep 17 00:00:00 2001 From: Ivan Morozov Date: Sat, 10 Dec 2022 11:47:59 +0300 Subject: [PATCH] Reformat records. SSlidePersist build problem --- MsBinaryFile/PptFile/Reader/ClassesAtom.cpp | 2 + MsBinaryFile/PptFile/Reader/ClassesAtom.h | 3 +- .../PptFile/Reader/PPTDocumentInfoOneUser.cpp | 13 +- .../PptFile/Reader/PPTDocumentInfoOneUser.h | 17 +- MsBinaryFile/PptFile/Reader/Records.h | 2 +- MsBinaryFile/PptFile/Reader/SlidePersist.h | 24 +- .../Records/Animations/AnimationInfoAtom.cpp | 1 + .../Records/Animations/AnimationInfoAtom.h | 74 +--- .../Animations/AnimationInfoContainer.cpp | 1 + .../Animations/AnimationInfoContainer.h | 17 +- .../PptFile/Records/Animations/BuildAtom.cpp | 1 + .../PptFile/Records/Animations/BuildAtom.h | 15 +- .../Animations/BuildListSubContainer.cpp | 1 + .../Animations/BuildListSubContainer.h | 21 +- .../Records/Animations/ChartBuildAtom.cpp | 1 + .../Records/Animations/ChartBuildAtom.h | 14 +- .../Animations/ChartBuildContainer.cpp | 1 + .../Records/Animations/ChartBuildContainer.h | 20 +- .../ClientVisualElementContainer.cpp | 1 + .../Animations/ClientVisualElementContainer.h | 34 +- .../Records/Animations/DiagramBuildAtom.cpp | 1 + .../Records/Animations/DiagramBuildAtom.h | 11 +- .../Animations/DiagramBuildContainer.cpp | 1 + .../Animations/DiagramBuildContainer.h | 21 +- .../Animations/ExtTimeNodeContainer.cpp | 2 +- .../Records/Animations/ExtTimeNodeContainer.h | 320 +----------------- .../Records/Animations/HashCode10Atom.cpp | 1 + .../Records/Animations/HashCode10Atom.h | 8 +- .../Records/Animations/LevelInfoAtom.cpp | 1 + .../Records/Animations/LevelInfoAtom.h | 24 +- .../Records/Animations/ParaBuildAtom.cpp | 1 + .../Records/Animations/ParaBuildAtom.h | 17 +- .../Records/Animations/ParaBuildContainer.cpp | 1 + .../Records/Animations/ParaBuildContainer.h | 38 +-- .../Records/Animations/ParaBuildLevel.cpp | 1 + .../Records/Animations/ParaBuildLevel.h | 44 +-- .../Records/Animations/SubEffectContainer.cpp | 1 + .../Records/Animations/SubEffectContainer.h | 108 +----- .../Animations/TimeAnimateBehaviorAtom.cpp | 1 + .../Animations/TimeAnimateBehaviorAtom.h | 19 +- .../TimeAnimateBehaviorContainer.cpp | 1 + .../Animations/TimeAnimateBehaviorContainer.h | 38 +-- .../Records/Animations/TimeAnimateColor.cpp | 1 + .../Records/Animations/TimeAnimateColor.h | 5 +- .../Records/Animations/TimeAnimateColorBy.cpp | 1 + .../Records/Animations/TimeAnimateColorBy.h | 5 +- .../Animations/TimeAnimationValueAtom.cpp | 1 + .../Animations/TimeAnimationValueAtom.h | 8 +- .../TimeAnimationValueListContainer.cpp | 1 + .../TimeAnimationValueListContainer.h | 40 +-- .../TimeAnimationValueListEntry.cpp | 1 + .../Animations/TimeAnimationValueListEntry.h | 44 +-- .../Records/Animations/TimeBehaviorAtom.cpp | 1 + .../Records/Animations/TimeBehaviorAtom.h | 20 +- .../Animations/TimeBehaviorContainer.cpp | 1 + .../Animations/TimeBehaviorContainer.h | 96 +----- .../Animations/TimeColorBehaviorAtom.cpp | 1 + .../Animations/TimeColorBehaviorAtom.h | 17 +- .../Animations/TimeColorBehaviorContainer.cpp | 1 + .../Animations/TimeColorBehaviorContainer.h | 12 +- .../Animations/TimeCommandBehaviorAtom.cpp | 1 + .../Animations/TimeCommandBehaviorAtom.h | 24 +- .../TimeCommandBehaviorContainer.cpp | 1 + .../Animations/TimeCommandBehaviorContainer.h | 25 +- .../Records/Animations/TimeConditionAtom.cpp | 1 + .../Records/Animations/TimeConditionAtom.h | 12 +- .../Animations/TimeConditionContainer.cpp | 1 + .../Animations/TimeConditionContainer.h | 26 +- .../Animations/TimeEffectBehaviorAtom.cpp | 1 + .../Animations/TimeEffectBehaviorAtom.h | 20 +- .../TimeEffectBehaviorContainer.cpp | 1 + .../Animations/TimeEffectBehaviorContainer.h | 48 +-- .../Animations/TimeIterateDataAtom.cpp | 1 + .../Records/Animations/TimeIterateDataAtom.h | 20 +- .../Records/Animations/TimeModifierAtom.cpp | 1 + .../Records/Animations/TimeModifierAtom.h | 9 +- .../Animations/TimeMotionBehaviorAtom.cpp | 1 + .../Animations/TimeMotionBehaviorAtom.h | 25 +- .../TimeMotionBehaviorContainer.cpp | 1 + .../Animations/TimeMotionBehaviorContainer.h | 53 +-- .../Records/Animations/TimeNodeAtom.cpp | 1 + .../PptFile/Records/Animations/TimeNodeAtom.h | 43 +-- .../TimePropertyList4TimeBehavior.cpp | 1 + .../TimePropertyList4TimeBehavior.h | 42 +-- .../TimePropertyList4TimeNodeContainer.cpp | 1 + .../TimePropertyList4TimeNodeContainer.h | 82 +---- .../Animations/TimeRotationBehaviorAtom.cpp | 1 + .../Animations/TimeRotationBehaviorAtom.h | 44 +-- .../TimeRotationBehaviorContainer.cpp | 1 + .../TimeRotationBehaviorContainer.h | 23 +- .../Animations/TimeScaleBehaviorAtom.cpp | 1 + .../Animations/TimeScaleBehaviorAtom.h | 22 +- .../Animations/TimeScaleBehaviorContainer.cpp | 1 + .../Animations/TimeScaleBehaviorContainer.h | 13 +- .../Animations/TimeSequenceDataAtom.cpp | 1 + .../Records/Animations/TimeSequenceDataAtom.h | 21 +- .../Animations/TimeSetBehaviorAtom.cpp | 1 + .../Records/Animations/TimeSetBehaviorAtom.h | 13 +- .../Animations/TimeSetBehaviorContainer.cpp | 1 + .../Animations/TimeSetBehaviorContainer.h | 23 +- .../Animations/TimeStringListContainer.cpp | 1 + .../Animations/TimeStringListContainer.h | 26 +- .../Records/Animations/TimeVariant.cpp | 87 +++++ .../PptFile/Records/Animations/TimeVariant.h | 89 +---- .../Animations/TimeVariant4Behavior.cpp | 1 + .../Records/Animations/TimeVariant4Behavior.h | 29 +- .../Records/Animations/VisualPageAtom.cpp | 1 + .../Records/Animations/VisualPageAtom.h | 11 +- .../Records/Animations/VisualShapeAtom.cpp | 1 + .../Records/Animations/VisualShapeAtom.h | 13 +- .../VisualShapeChartElementAtom.cpp | 1 + .../Animations/VisualShapeChartElementAtom.h | 12 +- .../Animations/VisualShapeGeneralAtom.cpp | 1 + .../Animations/VisualShapeGeneralAtom.h | 13 +- .../Records/Animations/VisualSoundAtom.cpp | 1 + .../Records/Animations/VisualSoundAtom.h | 13 +- .../Records/BlipCollection9Container.cpp | 32 +- .../Records/BlipCollection9Container.h | 34 +- MsBinaryFile/PptFile/Records/BlipEntityAtom.h | 34 +- .../PptFile/Records/BookmarkEntityAtom.cpp | 1 + .../PptFile/Records/BookmarkEntityAtom.h | 26 +- .../PptFile/Records/BookmarkSeedAtom.cpp | 32 +- .../PptFile/Records/BookmarkSeedAtom.h | 25 +- MsBinaryFile/PptFile/Records/BuildAtom.cpp | 33 +- MsBinaryFile/PptFile/Records/BuildAtom.h | 40 +-- MsBinaryFile/PptFile/Records/CFMasks.cpp | 32 +- MsBinaryFile/PptFile/Records/CFMasks.h | 36 +- MsBinaryFile/PptFile/Records/CString.cpp | 32 +- MsBinaryFile/PptFile/Records/CString.h | 26 +- .../PptFile/Records/ColorSchemeAtom.cpp | 2 + .../PptFile/Records/ColorSchemeAtom.h | 96 +----- .../PptFile/Records/Comment10Container.cpp | 32 +- .../PptFile/Records/Comment10Container.h | 97 +----- .../PptFile/Records/CryptSession10Container.h | 7 +- .../PptFile/Records/CurrentUserAtom.cpp | 32 +- .../PptFile/Records/CurrentUserAtom.h | 83 ++--- .../PptFile/Records/DocInfoListContainer.cpp | 34 +- .../PptFile/Records/DocInfoListContainer.h | 97 +----- .../PptFile/Records/DocProgTagsContainer.cpp | 32 +- .../PptFile/Records/DocProgTagsContainer.h | 242 +------------ .../PptFile/Records/DocRoutingSlipAtom.cpp | 32 +- .../PptFile/Records/DocRoutingSlipAtom.h | 55 ++- MsBinaryFile/PptFile/Records/DocumentAtom.cpp | 32 +- MsBinaryFile/PptFile/Records/DocumentAtom.h | 71 ++-- .../PptFile/Records/DocumentRecords.cpp | 35 +- .../PptFile/Records/DocumentRecords.h | 82 +---- .../PptFile/Records/DocumentTextInfo.cpp | 32 +- .../PptFile/Records/DocumentTextInfo.h | 50 +-- .../PptFile/Records/Drawing/ArtBlip.cpp | 24 ++ .../PptFile/Records/Drawing/ArtBlip.h | 60 ++-- .../Records/Drawing/BlipStoreContainer.cpp | 32 +- .../Records/Drawing/BlipStoreContainer.h | 48 +-- .../Records/Drawing/BlipStoreEntry.cpp | 2 + .../PptFile/Records/Drawing/BlipStoreEntry.h | 68 ++-- .../PptFile/Records/Drawing/ChildAnchor.cpp | 33 +- .../PptFile/Records/Drawing/ChildAnchor.h | 34 +- .../PptFile/Records/Drawing/ClientAnchor.cpp | 32 +- .../PptFile/Records/Drawing/ClientAnchor.h | 47 +-- .../Records/Drawing/DrawingContainer.cpp | 32 +- .../Records/Drawing/DrawingContainer.h | 25 +- .../PptFile/Records/Drawing/DrawingGroup.cpp | 32 +- .../PptFile/Records/Drawing/DrawingGroup.h | 49 +-- .../PptFile/Records/Drawing/DrawingRecord.cpp | 32 +- .../PptFile/Records/Drawing/DrawingRecord.h | 34 +- .../PptFile/Records/Drawing/GroupShape.cpp | 32 +- .../PptFile/Records/Drawing/GroupShape.h | 33 +- .../Records/Drawing/GroupShapeContainer.h | 19 +- .../PptFile/Records/Drawing/RegGroupItems.cpp | 31 ++ .../PptFile/Records/Drawing/RegGroupItems.h | 47 +-- .../PptFile/Records/Drawing/Shape.cpp | 32 +- MsBinaryFile/PptFile/Records/Drawing/Shape.h | 84 ++--- .../Records/Drawing/ShapeContainer.cpp | 61 +++- .../PptFile/Records/Drawing/ShapeContainer.h | 53 +-- .../Records/Drawing/ShapeProperties.cpp | 32 +- .../PptFile/Records/Drawing/ShapeProperties.h | 34 +- .../PptFile/Records/Drawing/TextBox.cpp | 32 +- .../PptFile/Records/Drawing/TextBox.h | 28 +- MsBinaryFile/PptFile/Records/EndDocument.cpp | 32 +- MsBinaryFile/PptFile/Records/EndDocument.h | 26 +- .../PptFile/Records/ExCDAudioContainer.cpp | 32 +- .../PptFile/Records/ExCDAudioContainer.h | 54 +-- .../PptFile/Records/ExControlAtom.cpp | 32 +- MsBinaryFile/PptFile/Records/ExControlAtom.h | 29 +- .../PptFile/Records/ExHyperlinkAtom.cpp | 32 +- .../PptFile/Records/ExHyperlinkAtom.h | 87 +---- .../PptFile/Records/ExMIDIAudioContainer.cpp | 32 +- .../PptFile/Records/ExMIDIAudioContainer.h | 24 +- MsBinaryFile/PptFile/Records/ExMediaAtom.cpp | 32 +- MsBinaryFile/PptFile/Records/ExMediaAtom.h | 46 +-- .../PptFile/Records/ExObjListAtom.cpp | 32 +- MsBinaryFile/PptFile/Records/ExObjListAtom.h | 29 +- .../PptFile/Records/ExObjListContainer.cpp | 32 +- .../PptFile/Records/ExObjListContainer.h | 24 +- MsBinaryFile/PptFile/Records/ExObjRefAtom.cpp | 34 +- MsBinaryFile/PptFile/Records/ExObjRefAtom.h | 25 +- .../PptFile/Records/ExOleEmbedAtom.cpp | 32 +- MsBinaryFile/PptFile/Records/ExOleEmbedAtom.h | 34 +- .../PptFile/Records/ExOleLinkAtom.cpp | 34 +- MsBinaryFile/PptFile/Records/ExOleLinkAtom.h | 28 +- MsBinaryFile/PptFile/Records/ExOleObjAtom.cpp | 32 +- MsBinaryFile/PptFile/Records/ExOleObjAtom.h | 114 ++----- .../PptFile/Records/ExVideoContainer.cpp | 32 +- .../PptFile/Records/ExVideoContainer.h | 25 +- .../Records/ExWAVAudioEmbeddedContainer.cpp | 32 +- .../Records/ExWAVAudioEmbeddedContainer.h | 46 +-- .../Records/ExWAVAudioLinkContainer.cpp | 32 +- .../PptFile/Records/ExWAVAudioLinkContainer.h | 24 +- .../Records/FontCollection10Container.cpp | 54 +-- .../Records/FontCollection10Container.h | 32 +- .../PptFile/Records/FontEmbedFlags10Atom.cpp | 32 +- .../PptFile/Records/FontEmbedFlags10Atom.h | 13 +- .../PptFile/Records/FontEntityAtom.cpp | 32 +- MsBinaryFile/PptFile/Records/FontEntityAtom.h | 106 ++---- .../PptFile/Records/GridSpacing10Atom.cpp | 32 +- .../PptFile/Records/GridSpacing10Atom.h | 26 +- MsBinaryFile/PptFile/Records/GuideAtom.cpp | 32 +- MsBinaryFile/PptFile/Records/GuideAtom.h | 31 +- .../PptFile/Records/HeadersFootersAtom.cpp | 32 +- .../PptFile/Records/HeadersFootersAtom.h | 246 ++++---------- .../PptFile/Records/InteractiveInfoAtom.cpp | 32 +- .../PptFile/Records/InteractiveInfoAtom.h | 59 +--- MsBinaryFile/PptFile/Records/KinsokuAtom.cpp | 32 +- MsBinaryFile/PptFile/Records/KinsokuAtom.h | 29 +- .../PptFile/Records/KinsokuContainer.cpp | 32 +- .../PptFile/Records/KinsokuContainer.h | 18 +- .../PptFile/Records/KinsokuFollowingAtom.cpp | 32 +- .../PptFile/Records/KinsokuFollowingAtom.h | 19 +- .../PptFile/Records/KinsokuLeadingAtom.cpp | 32 +- .../PptFile/Records/KinsokuLeadingAtom.h | 18 +- .../PptFile/Records/LinkedShape10Atom.cpp | 32 +- .../PptFile/Records/LinkedShape10Atom.h | 12 +- .../PptFile/Records/LinkedSlide10Atom.cpp | 32 +- .../PptFile/Records/LinkedSlide10Atom.h | 12 +- .../PptFile/Records/MasterPersistAtom.cpp | 32 +- .../PptFile/Records/MasterPersistAtom.h | 29 +- .../PptFile/Records/MasterTextPropAtom.cpp | 32 +- .../PptFile/Records/MasterTextPropAtom.h | 72 +--- MsBinaryFile/PptFile/Records/MetafileBlob.cpp | 32 +- MsBinaryFile/PptFile/Records/MetafileBlob.h | 48 +-- .../Records/MouseInteractiveInfoContainer.cpp | 32 +- .../Records/MouseInteractiveInfoContainer.h | 39 +-- .../Records/MouseTextInteractiveInfoAtom.cpp | 32 +- .../Records/MouseTextInteractiveInfoAtom.h | 25 +- .../PptFile/Records/NamedShowSlidesAtom.cpp | 32 +- .../PptFile/Records/NamedShowSlidesAtom.h | 24 +- .../PptFile/Records/NoZoomViewInfoAtom.cpp | 32 +- .../PptFile/Records/NoZoomViewInfoAtom.h | 28 +- .../PptFile/Records/NormalViewSetInfoAtom.cpp | 33 +- .../PptFile/Records/NormalViewSetInfoAtom.h | 35 +- MsBinaryFile/PptFile/Records/NotesAtom.cpp | 32 +- MsBinaryFile/PptFile/Records/NotesAtom.h | 42 +-- .../PptFile/Records/NotesPersistAtom.cpp | 32 +- .../PptFile/Records/NotesPersistAtom.h | 26 +- .../PptFile/Records/OfficeArtClientData.cpp | 32 +- .../PptFile/Records/OfficeArtClientData.h | 78 +---- .../PptFile/Records/OfficeArtClientTextbox.h | 12 +- .../Records/OutlineTextProps9Container.cpp | 32 +- .../Records/OutlineTextProps9Container.h | 52 +-- .../Records/OutlineTextPropsHeaderExAtom.cpp | 32 +- .../Records/OutlineTextPropsHeaderExAtom.h | 7 +- .../PptFile/Records/OutlineTextRefAtom.cpp | 32 +- .../PptFile/Records/OutlineTextRefAtom.h | 28 +- MsBinaryFile/PptFile/Records/PFMasks.cpp | 63 +--- MsBinaryFile/PptFile/Records/PFMasks.h | 39 +-- .../PptFile/Records/PersistDirectoryAtom.cpp | 32 +- .../PptFile/Records/PersistDirectoryAtom.h | 102 ++---- .../PptFile/Records/PlaceHolderAtom.cpp | 32 +- .../PptFile/Records/PlaceHolderAtom.h | 34 +- .../Records/ProgStringTagContainer.cpp | 32 +- .../PptFile/Records/ProgStringTagContainer.h | 28 +- MsBinaryFile/PptFile/Records/RoundTrip.cpp | 35 +- MsBinaryFile/PptFile/Records/RoundTrip.h | 312 +++++------------ .../RoundTripNotesMasterTextStyles12Atom.cpp | 40 +++ .../RoundTripNotesMasterTextStyles12Atom.h | 41 +-- .../PptFile/Records/SSDocInfoAtom.cpp | 32 +- MsBinaryFile/PptFile/Records/SSDocInfoAtom.h | 80 ++--- .../PptFile/Records/SSSlideInfoAtom.cpp | 32 +- .../PptFile/Records/SSSlideInfoAtom.h | 128 ++----- .../PptFile/Records/SSlideLayoutAtom.cpp | 32 +- .../PptFile/Records/SSlideLayoutAtom.h | 31 +- .../PptFile/Records/ShapeFlags10Atom.cpp | 32 +- .../PptFile/Records/ShapeFlags10Atom.h | 25 +- .../PptFile/Records/ShapeFlagsAtom.cpp | 32 +- MsBinaryFile/PptFile/Records/ShapeFlagsAtom.h | 24 +- .../ShapeProgBinaryTagSubContainerOrAtom.cpp | 62 +--- .../ShapeProgBinaryTagSubContainerOrAtom.h | 71 +--- MsBinaryFile/PptFile/Records/SlideAtom.cpp | 33 +- MsBinaryFile/PptFile/Records/SlideAtom.h | 65 ++-- .../PptFile/Records/SlideColorSchemeAtom.cpp | 64 +--- .../PptFile/Records/SlideColorSchemeAtom.h | 74 ++-- .../PptFile/Records/SlideContainer.cpp | 32 +- MsBinaryFile/PptFile/Records/SlideContainer.h | 151 ++------- .../PptFile/Records/SlideFlags10Atom.cpp | 32 +- .../PptFile/Records/SlideFlags10Atom.h | 10 +- .../PptFile/Records/SlideListWithText.cpp | 32 +- .../PptFile/Records/SlideListWithText.h | 147 ++------ .../PptFile/Records/SlidePersistAtom.cpp | 32 +- .../PptFile/Records/SlidePersistAtom.h | 51 +-- .../Records/SlideProgTagsContainer.cpp | 32 +- .../PptFile/Records/SlideProgTagsContainer.h | 279 +-------------- .../PptFile/Records/SlideTime10Atom.cpp | 32 +- .../PptFile/Records/SlideTime10Atom.h | 8 +- .../PptFile/Records/SlideViewInfoAtom.cpp | 32 +- .../PptFile/Records/SlideViewInfoAtom.h | 37 +- .../PptFile/Records/SoundCollAtom.cpp | 32 +- MsBinaryFile/PptFile/Records/SoundCollAtom.h | 32 +- .../Records/SoundCollectionContainer.cpp | 62 +--- .../Records/SoundCollectionContainer.h | 27 +- .../PptFile/Records/SoundContainer.cpp | 32 +- MsBinaryFile/PptFile/Records/SoundContainer.h | 25 +- .../PptFile/Records/SoundDataBlob.cpp | 32 +- MsBinaryFile/PptFile/Records/SoundDataBlob.h | 59 +--- .../PptFile/Records/StyleTextProp10Atom.cpp | 64 +--- .../PptFile/Records/StyleTextProp10Atom.h | 19 +- .../PptFile/Records/StyleTextProp11Atom.cpp | 33 +- .../PptFile/Records/StyleTextProp11Atom.h | 20 +- .../PptFile/Records/StyleTextProp9Atom.cpp | 32 +- .../PptFile/Records/StyleTextProp9Atom.h | 30 +- .../PptFile/Records/StyleTextPropAtom.cpp | 32 +- .../PptFile/Records/StyleTextPropAtom.h | 82 +---- .../PptFile/Records/TextBookmarkAtom.cpp | 32 +- .../PptFile/Records/TextBookmarkAtom.h | 33 +- .../PptFile/Records/TextBytesAtom.cpp | 33 +- MsBinaryFile/PptFile/Records/TextBytesAtom.h | 56 +-- .../PptFile/Records/TextCFException10.cpp | 32 +- .../PptFile/Records/TextCFException10.h | 11 +- .../PptFile/Records/TextCFException9.cpp | 33 +- .../PptFile/Records/TextCFException9.h | 10 +- .../PptFile/Records/TextCFExceptionAtom.cpp | 33 +- .../PptFile/Records/TextCFExceptionAtom.h | 37 +- .../PptFile/Records/TextCharsAtom.cpp | 32 +- MsBinaryFile/PptFile/Records/TextCharsAtom.h | 33 +- .../PptFile/Records/TextDefaults9Atom.cpp | 32 +- .../PptFile/Records/TextDefaults9Atom.h | 8 +- .../PptFile/Records/TextFullSettings.cpp | 66 +--- .../PptFile/Records/TextFullSettings.h | 37 +- .../PptFile/Records/TextHeaderAtom.cpp | 63 +--- MsBinaryFile/PptFile/Records/TextHeaderAtom.h | 31 +- .../Records/TextInteractiveInfoAtom.cpp | 33 +- .../PptFile/Records/TextInteractiveInfoAtom.h | 36 +- .../PptFile/Records/TextMasterStyle9Atom.cpp | 32 +- .../PptFile/Records/TextMasterStyle9Atom.h | 36 +- .../PptFile/Records/TextMasterStyle9Level.cpp | 32 +- .../PptFile/Records/TextMasterStyle9Level.h | 7 +- .../PptFile/Records/TextMasterStyleAtom.cpp | 33 +- .../PptFile/Records/TextMasterStyleAtom.h | 100 +----- .../PptFile/Records/TextPFException9.cpp | 32 +- .../PptFile/Records/TextPFException9.h | 82 +---- .../PptFile/Records/TextPFExceptionAtom.cpp | 32 +- .../PptFile/Records/TextPFExceptionAtom.h | 37 +- .../PptFile/Records/TextRulerAtom.cpp | 34 +- MsBinaryFile/PptFile/Records/TextRulerAtom.h | 38 +-- .../PptFile/Records/TextSIException.cpp | 34 +- .../PptFile/Records/TextSIException.h | 120 ++----- .../PptFile/Records/TextSIExceptionAtom.cpp | 32 +- .../PptFile/Records/TextSIExceptionAtom.h | 38 +-- .../PptFile/Records/TextSpecInfoAtom.cpp | 34 +- .../PptFile/Records/TextSpecInfoAtom.h | 88 +---- MsBinaryFile/PptFile/Records/UserEditAtom.cpp | 32 +- MsBinaryFile/PptFile/Records/UserEditAtom.h | 82 ++--- MsBinaryFile/PptFile/Records/VBAInfoAtom.cpp | 33 +- MsBinaryFile/PptFile/Records/VBAInfoAtom.h | 118 ++----- MsBinaryFile/PptFile/Records/ViewInfoAtom.cpp | 32 +- MsBinaryFile/PptFile/Records/ViewInfoAtom.h | 48 +-- .../PptFile/Records/ZoomViewInfoAtom.cpp | 65 +--- .../PptFile/Records/ZoomViewInfoAtom.h | 42 +-- MsBinaryFile/PptFile/Structures/ColorIndex.h | 19 +- .../PptFile/Structures/ColorIndexStruct.h | 24 +- MsBinaryFile/PptFile/Structures/ColorStruct.h | 22 +- .../PptFile/Structures/DateTimeStruct.h | 17 +- .../FontCollectionEntry.cpp} | 16 +- .../PptFile/Structures/FontCollectionEntry.h | 53 +++ MsBinaryFile/PptFile/Structures/IStruct.h | 7 +- MsBinaryFile/PptFile/Structures/PointStruct.h | 6 +- MsBinaryFile/PptFile/Structures/RatioStruct.h | 7 +- MsBinaryFile/PptFile/Structures/RectStruct.h | 9 +- .../PptFile/Structures/ScalingStruct.h | 6 +- .../PptFile/Structures/SmallRectStruct.h | 9 +- .../PptFile/Structures/TmsfTimeStruct.h | 9 +- .../PptFile/Structures/WideColorStruct.h | 8 +- .../PPTFormatLib/Linux/PPTFormatLib.pro | 180 +++++++++- 381 files changed, 2425 insertions(+), 10935 deletions(-) create mode 100644 MsBinaryFile/PptFile/Records/Drawing/RegGroupItems.cpp create mode 100644 MsBinaryFile/PptFile/Records/RoundTripNotesMasterTextStyles12Atom.cpp rename MsBinaryFile/PptFile/{Records/Animations/TimeVariant4TimeNode.h => Structures/FontCollectionEntry.cpp} (88%) create mode 100644 MsBinaryFile/PptFile/Structures/FontCollectionEntry.h diff --git a/MsBinaryFile/PptFile/Reader/ClassesAtom.cpp b/MsBinaryFile/PptFile/Reader/ClassesAtom.cpp index 8c30af22fa..fbf86a48da 100644 --- a/MsBinaryFile/PptFile/Reader/ClassesAtom.cpp +++ b/MsBinaryFile/PptFile/Reader/ClassesAtom.cpp @@ -32,6 +32,8 @@ #include "ClassesAtom.h" +using namespace PPT; + CUserEdit::CUserEdit() { m_nOffsetLastEdit = 0; diff --git a/MsBinaryFile/PptFile/Reader/ClassesAtom.h b/MsBinaryFile/PptFile/Reader/ClassesAtom.h index 31bda2ad92..149ced8fcb 100644 --- a/MsBinaryFile/PptFile/Reader/ClassesAtom.h +++ b/MsBinaryFile/PptFile/Reader/ClassesAtom.h @@ -32,6 +32,7 @@ #pragma once #include "../Records/CurrentUserAtom.h" +#include "../Records/UserEditAtom.h" namespace PPT { @@ -50,7 +51,7 @@ public: CUserEdit& operator =(const CUserEdit& oSrc); - void FromAtom(PPT::CRecordUserEditAtom* pAtom); + void FromAtom(CRecordUserEditAtom* pAtom); }; class CCurrentUser diff --git a/MsBinaryFile/PptFile/Reader/PPTDocumentInfoOneUser.cpp b/MsBinaryFile/PptFile/Reader/PPTDocumentInfoOneUser.cpp index a4cae43c6d..af92829547 100644 --- a/MsBinaryFile/PptFile/Reader/PPTDocumentInfoOneUser.cpp +++ b/MsBinaryFile/PptFile/Reader/PPTDocumentInfoOneUser.cpp @@ -34,16 +34,15 @@ #include "PPTDocumentInfo.h" -#include "../Records/ExMIDIAudioContainer.h" -#include "../Records/ExCDAudioContainer.h" -#include "../Records/ExWAVAudioLinkContainer.h" -#include "../Records/ExWAVAudioEmbeddedContainer.h" +#include "../Records/RecordsIncluder.h" -#include "../Records/ExObjListContainer.h" -#include "../Records/SoundCollectionContainer.h" -#include "../Records/SoundContainer.h" +//#include "../Records/ExObjListContainer.h" +//#include "../Records/SoundCollectionContainer.h" +//#include "../Records/SoundContainer.h" #include "../Enums/_includer.h" +using namespace PPT; +using namespace ODRAW; CPPTUserInfo::CPPTUserInfo() : CDocument(), m_oUser(), diff --git a/MsBinaryFile/PptFile/Reader/PPTDocumentInfoOneUser.h b/MsBinaryFile/PptFile/Reader/PPTDocumentInfoOneUser.h index beb00467f4..ad67e1604a 100644 --- a/MsBinaryFile/PptFile/Reader/PPTDocumentInfoOneUser.h +++ b/MsBinaryFile/PptFile/Reader/PPTDocumentInfoOneUser.h @@ -30,14 +30,19 @@ * */ #pragma once -#include "ClassesAtom.h" +#include "ClassesAtom.h" #include "../Records/Animations/_includer.h" #include "../Enums/_includer.h" #include "../Records/ExObjListContainer.h" #include "../Records/CryptSession10Container.h" - +#include "../Records/DocumentRecords.h" +#include "../Records/SlideContainer.h" +#include "../Records/Drawing/BlipStoreContainer.h" +#include "../Records/Drawing/GroupShapeContainer.h" #include "SlideInfo.h" + + namespace PPT { class CPPTDocumentInfo; @@ -83,7 +88,7 @@ public: std::vector m_arrBlipStore; std::vector m_arrFonts; - PPT::CTextStyles m_oDefaultTextStyle; + CTextStyles m_oDefaultTextStyle; vector_string m_PlaceholdersReplaceString[3]; //0-dates, 1 - headers, 2 - footers @@ -157,10 +162,10 @@ public: void LoadExVideo(CRecordsContainer* pExObject); void LoadExAudio(CRecordsContainer* pExObject); - void LoadAutoNumbering(CRecordGroupShapeContainer* pGroupContainer, PPT::CTheme* pTheme); + void LoadAutoNumbering(CRecordGroupShapeContainer* pGroupContainer, CTheme* pTheme); void LoadBulletBlip(CShapeElement* pShape); void LoadAutoNumBullet(CShapeElement* pShape, int slideID); - void CreateDefaultStyle(PPT::CTextStyles& pStyle, PPT::CTheme* pTheme); + void CreateDefaultStyle(CTextStyles& pStyle, CTheme* pTheme); void CorrectColorScheme(std::vector& oScheme); void ConvertLayoutType(SSlideLayoutAtom & layoutRecord, std::wstring & type, std::wstring & name); @@ -168,7 +173,7 @@ public: void AddAnimation (_UINT32 dwSlideID, double Width, double Height, CElementPtr pElement); void AddAudioTransition (_UINT32 dwSlideID, CTransition* pTransition, const std::wstring& strFilePath); - int AddNewLayout(PPT::CTheme* pTheme, CRecordSlide* pRecordSlide, bool addShapes, bool bMasterObjects); + int AddNewLayout(CTheme* pTheme, CRecordSlide* pRecordSlide, bool addShapes, bool bMasterObjects); CElementPtr AddNewLayoutPlaceholder (CLayout *pLayout, int placeholderType, int placeholderSizePreset = -1); diff --git a/MsBinaryFile/PptFile/Reader/Records.h b/MsBinaryFile/PptFile/Reader/Records.h index 02cdb31c84..76e1eae6d9 100644 --- a/MsBinaryFile/PptFile/Reader/Records.h +++ b/MsBinaryFile/PptFile/Reader/Records.h @@ -56,7 +56,7 @@ namespace PPT public: unsigned char RecVersion; unsigned short RecInstance; - PPT::RecordType RecType; + RecordType RecType; _UINT32 RecLen; bool bBadHeader; diff --git a/MsBinaryFile/PptFile/Reader/SlidePersist.h b/MsBinaryFile/PptFile/Reader/SlidePersist.h index 31f6750622..048c97671c 100644 --- a/MsBinaryFile/PptFile/Reader/SlidePersist.h +++ b/MsBinaryFile/PptFile/Reader/SlidePersist.h @@ -32,21 +32,21 @@ #pragma once #include "../../../DesktopEditor/common/ASCVariant.h" - #include + namespace PPT { - class CTextFullSettings; - struct SSlidePersist - { - _UINT32 m_nPsrRef; - _UINT32 m_nSlideID; +class CTextFullSettings; +struct SSlidePersist +{ + _UINT32 m_nPsrRef; + _UINT32 m_nSlideID; - std::vector m_arTextAttrs; + std::vector m_arTextAttrs; - SSlidePersist(); - SSlidePersist(const SSlidePersist& oSrc); - std::wstring ToString(); - SSlidePersist& operator =(const SSlidePersist& oSrc); - }; + SSlidePersist(); + SSlidePersist(const SSlidePersist& oSrc); + std::wstring ToString(); + SSlidePersist& operator =(const SSlidePersist& oSrc); +}; } diff --git a/MsBinaryFile/PptFile/Records/Animations/AnimationInfoAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/AnimationInfoAtom.cpp index a967e24066..260c5d7e3e 100644 --- a/MsBinaryFile/PptFile/Records/Animations/AnimationInfoAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/AnimationInfoAtom.cpp @@ -1,5 +1,6 @@ #include "AnimationInfoAtom.h" +using namespace PPT; struct SFlagsAH { diff --git a/MsBinaryFile/PptFile/Records/Animations/AnimationInfoAtom.h b/MsBinaryFile/PptFile/Records/Animations/AnimationInfoAtom.h index 42278ce5ca..79d8279133 100644 --- a/MsBinaryFile/PptFile/Records/Animations/AnimationInfoAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/AnimationInfoAtom.h @@ -38,27 +38,6 @@ namespace PPT { -struct SFlagsAH { - - USHORT m_fA_H; - - USHORT getH()const {return (m_fA_H & 0xC000) >> 14;} - USHORT getG()const {return (m_fA_H & 0x3000) >> 12;} - USHORT getF()const {return (m_fA_H & 0xC00) >> 10;} - USHORT getE()const {return (m_fA_H & 0x300) >> 8;} - USHORT getD()const {return (m_fA_H & 0xC0) >> 6;} - USHORT getC()const {return (m_fA_H & 0x30) >> 4;} - USHORT getB()const {return (m_fA_H & 0xC) >> 2;} - USHORT getA()const {return (m_fA_H & 0x3) >> 0;} - - - - void ReadFromStream(POLE::Stream* pStream) { - m_fA_H = StreamUtils::ReadWORD(pStream); - } -}; - - class CRecordAnimationInfoAtom : public CUnknownRecord { public: @@ -90,56 +69,11 @@ public: BYTE m_OleVerb; std::array asByteArr{}; + public: + CRecordAnimationInfoAtom(); + ~CRecordAnimationInfoAtom(); - CRecordAnimationInfoAtom() - { - } - - ~CRecordAnimationInfoAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_sDimColor.ReadFromStream(pStream); - - SFlagsAH fAH; - fAH.ReadFromStream(pStream); - - m_fReverse = fAH.getA(); - m_fAutomatic = fAH.getB(); - m_fSound = fAH.getC(); - m_fStopSound = fAH.getD(); - m_fPlay = fAH.getE(); - m_fSynchronous = fAH.getF(); - m_fHide = fAH.getG(); - m_fAnimateBg = fAH.getH(); - - m_Reserved = StreamUtils::ReadWORD(pStream); - - m_SoundIdRef = StreamUtils::ReadDWORD(pStream); - m_DelayTime = StreamUtils::ReadDWORD(pStream); - - m_OrderID = StreamUtils::ReadWORD(pStream); - m_SlideCount = StreamUtils::ReadWORD(pStream); - - m_AnimBuildType = StreamUtils::ReadBYTE(pStream); - m_AnimEffect = StreamUtils::ReadBYTE(pStream); - m_AnimEffectDirection = StreamUtils::ReadBYTE(pStream); - m_AnimAfterEffect = StreamUtils::ReadBYTE(pStream); - m_TextBuildSubEffect = StreamUtils::ReadBYTE(pStream); - m_OleVerb = StreamUtils::ReadBYTE(pStream); - - - StreamUtils::StreamSkip(2, pStream); - m_OldSoundIdRef = m_SoundIdRef; - - StreamUtils::StreamSkipBack(36, pStream); - auto tempStr = StreamUtils::ReadStringA(pStream, 36); - std::copy(tempStr.begin(), tempStr.end(), asByteArr.begin()); - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); }; } diff --git a/MsBinaryFile/PptFile/Records/Animations/AnimationInfoContainer.cpp b/MsBinaryFile/PptFile/Records/Animations/AnimationInfoContainer.cpp index a58569fec5..814420d31a 100644 --- a/MsBinaryFile/PptFile/Records/Animations/AnimationInfoContainer.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/AnimationInfoContainer.cpp @@ -1,5 +1,6 @@ #include "AnimationInfoContainer.h" +using namespace PPT; CRecordAnimationInfoContainer::CRecordAnimationInfoContainer() { diff --git a/MsBinaryFile/PptFile/Records/Animations/AnimationInfoContainer.h b/MsBinaryFile/PptFile/Records/Animations/AnimationInfoContainer.h index 8a35246d26..01823beb80 100644 --- a/MsBinaryFile/PptFile/Records/Animations/AnimationInfoContainer.h +++ b/MsBinaryFile/PptFile/Records/Animations/AnimationInfoContainer.h @@ -45,20 +45,9 @@ public: CRecordAnimationInfoAtom m_AnimationAtom; CRecordSoundContainer m_AnimationSound; - CRecordAnimationInfoContainer(){} - ~CRecordAnimationInfoContainer(){} + CRecordAnimationInfoContainer(); + ~CRecordAnimationInfoContainer(); - virtual void ReadFromStream(SRecordHeader & thisHeader, POLE::Stream* pStream) - { - m_oHeader = thisHeader; - - SRecordHeader oHeader; - - if (oHeader.ReadFromStream(pStream)) - m_AnimationAtom.ReadFromStream ( oHeader, pStream ); - - if (m_oHeader.RecLen != 36 && oHeader.ReadFromStream(pStream)) - m_AnimationSound.ReadFromStream ( oHeader, pStream ); - } + virtual void ReadFromStream(SRecordHeader & thisHeader, POLE::Stream* pStream); }; } diff --git a/MsBinaryFile/PptFile/Records/Animations/BuildAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/BuildAtom.cpp index 72e060f8fc..b3d235c170 100644 --- a/MsBinaryFile/PptFile/Records/Animations/BuildAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/BuildAtom.cpp @@ -1,5 +1,6 @@ #include "BuildAtom.h" +using namespace PPT; void CRecordBuildAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/BuildAtom.h b/MsBinaryFile/PptFile/Records/Animations/BuildAtom.h index 51f517a7a3..087db801e5 100644 --- a/MsBinaryFile/PptFile/Records/Animations/BuildAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/BuildAtom.h @@ -40,22 +40,9 @@ namespace PPT class CRecordBuildAtom : public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - - m_nBuildType = StreamUtils::ReadDWORD ( pStream ); - m_nBuildId = StreamUtils::ReadDWORD ( pStream ); - m_nShapeIdRef = StreamUtils::ReadDWORD ( pStream ); - - _UINT32 Value = StreamUtils::ReadDWORD ( pStream ); - - m_fExpanded = ( 0x01 == ( 0x01 & ((BYTE)Value) ) ); - m_fUIExpanded = ( 0x02 == ( 0x02 & ((BYTE)Value) ) ); - } + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ); public: - _UINT32 m_nBuildType; // 1 - Paragraph build type, 2 - Chart build type, 3 - Diagram build type _UINT32 m_nBuildId; _UINT32 m_nShapeIdRef; diff --git a/MsBinaryFile/PptFile/Records/Animations/BuildListSubContainer.cpp b/MsBinaryFile/PptFile/Records/Animations/BuildListSubContainer.cpp index d8ea959d4e..780dc87046 100644 --- a/MsBinaryFile/PptFile/Records/Animations/BuildListSubContainer.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/BuildListSubContainer.cpp @@ -1,5 +1,6 @@ #include "BuildListSubContainer.h" +using namespace PPT; CRecordBuildListSubContainer::CRecordBuildListSubContainer() { diff --git a/MsBinaryFile/PptFile/Records/Animations/BuildListSubContainer.h b/MsBinaryFile/PptFile/Records/Animations/BuildListSubContainer.h index 33e091ae07..b38ad823a6 100644 --- a/MsBinaryFile/PptFile/Records/Animations/BuildListSubContainer.h +++ b/MsBinaryFile/PptFile/Records/Animations/BuildListSubContainer.h @@ -41,25 +41,10 @@ namespace PPT class CRecordBuildListSubContainer : public CUnknownRecord { public: - CRecordBuildListSubContainer() - { + CRecordBuildListSubContainer(); + ~CRecordBuildListSubContainer(); - } - - ~CRecordBuildListSubContainer() - { - - } - - virtual void ReadFromStream(SRecordHeader &header, POLE::Stream *pStream) override - { - m_oHeader = header; - - SRecordHeader buildAtomHeader; - if (buildAtomHeader.ReadFromStream(pStream)) - buildAtom.ReadFromStream ( buildAtomHeader, pStream ); - - } + virtual void ReadFromStream(SRecordHeader &header, POLE::Stream *pStream) override; public: CRecordBuildAtom buildAtom; diff --git a/MsBinaryFile/PptFile/Records/Animations/ChartBuildAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/ChartBuildAtom.cpp index 8daaee2e13..7eb56cbcfa 100644 --- a/MsBinaryFile/PptFile/Records/Animations/ChartBuildAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/ChartBuildAtom.cpp @@ -1,5 +1,6 @@ #include "ChartBuildAtom.h" +using namespace PPT; CRecordChartBuildAtom::CRecordChartBuildAtom() { diff --git a/MsBinaryFile/PptFile/Records/Animations/ChartBuildAtom.h b/MsBinaryFile/PptFile/Records/Animations/ChartBuildAtom.h index b44d6ad52a..28c908c7dc 100644 --- a/MsBinaryFile/PptFile/Records/Animations/ChartBuildAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/ChartBuildAtom.h @@ -44,17 +44,9 @@ public: ChartBuildEnum m_ChartBuild; BYTE m_fAnimBackground; - CRecordChartBuildAtom(){} - ~CRecordChartBuildAtom(){} + CRecordChartBuildAtom(); + ~CRecordChartBuildAtom(); - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_ChartBuild = (ChartBuildEnum)StreamUtils::ReadDWORD(pStream); - m_fAnimBackground = StreamUtils::ReadBYTE(pStream); - - StreamUtils::StreamSkip(3, pStream); - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; }; } diff --git a/MsBinaryFile/PptFile/Records/Animations/ChartBuildContainer.cpp b/MsBinaryFile/PptFile/Records/Animations/ChartBuildContainer.cpp index 20711c27eb..3e663b2ec1 100644 --- a/MsBinaryFile/PptFile/Records/Animations/ChartBuildContainer.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/ChartBuildContainer.cpp @@ -1,5 +1,6 @@ #include "ChartBuildContainer.h" +using namespace PPT; CRecordChartBuildContainer::CRecordChartBuildContainer() { diff --git a/MsBinaryFile/PptFile/Records/Animations/ChartBuildContainer.h b/MsBinaryFile/PptFile/Records/Animations/ChartBuildContainer.h index 13f10f0271..4b0296ae2b 100644 --- a/MsBinaryFile/PptFile/Records/Animations/ChartBuildContainer.h +++ b/MsBinaryFile/PptFile/Records/Animations/ChartBuildContainer.h @@ -39,24 +39,10 @@ namespace PPT class CRecordChartBuildContainer : public CRecordBuildListSubContainer { public: - CRecordChartBuildContainer() - { + CRecordChartBuildContainer(); + ~CRecordChartBuildContainer(); - } - - ~CRecordChartBuildContainer() - { - - } - - void ReadFromStream(SRecordHeader &header, POLE::Stream *pStream) override - { - CRecordBuildListSubContainer::ReadFromStream(header, pStream); - - SRecordHeader childHeader; - if (childHeader.ReadFromStream(pStream)) - m_oChartBuildAtom.ReadFromStream ( childHeader, pStream ); - } + void ReadFromStream(SRecordHeader &header, POLE::Stream *pStream) override; public: CRecordChartBuildAtom m_oChartBuildAtom; diff --git a/MsBinaryFile/PptFile/Records/Animations/ClientVisualElementContainer.cpp b/MsBinaryFile/PptFile/Records/Animations/ClientVisualElementContainer.cpp index c568f65443..d34cc62e3e 100644 --- a/MsBinaryFile/PptFile/Records/Animations/ClientVisualElementContainer.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/ClientVisualElementContainer.cpp @@ -1,5 +1,6 @@ #include "ClientVisualElementContainer.h" +using namespace PPT; CRecordClientVisualElementContainer::CRecordClientVisualElementContainer() { diff --git a/MsBinaryFile/PptFile/Records/Animations/ClientVisualElementContainer.h b/MsBinaryFile/PptFile/Records/Animations/ClientVisualElementContainer.h index b9789ecfc4..3f5760e1d7 100644 --- a/MsBinaryFile/PptFile/Records/Animations/ClientVisualElementContainer.h +++ b/MsBinaryFile/PptFile/Records/Animations/ClientVisualElementContainer.h @@ -31,7 +31,6 @@ */ #pragma once - #include "../../Reader/Records.h" #include "VisualPageAtom.h" #include "VisualShapeAtom.h" @@ -42,39 +41,12 @@ namespace PPT class CRecordClientVisualElementContainer : public CUnknownRecord { public: - CRecordClientVisualElementContainer () - { - m_bVisualPageAtom = false; - m_bVisualShapeAtom = false; - } + CRecordClientVisualElementContainer (); + ~CRecordClientVisualElementContainer(); - void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override - { - m_oHeader = oHeader; - - LONG lPos = 0; StreamUtils::StreamPosition ( lPos, pStream ); - - SRecordHeader ReadHeader; - if (ReadHeader.ReadFromStream(pStream) ) - { - if ( RT_VisualPageAtom == ReadHeader.RecType ) - { - m_bVisualPageAtom = true; - m_oVisualPageAtom.ReadFromStream ( ReadHeader, pStream ); - } - - if ( RT_VisualShapeAtom == ReadHeader.RecType ) - { - m_bVisualShapeAtom = true; - m_oVisualShapeAtom.ReadFromStream ( ReadHeader, pStream ); - } - } - - StreamUtils::StreamSeek ( lPos + m_oHeader.RecLen, pStream ); - } + void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; public: - CRecordVisualPageAtom m_oVisualPageAtom; CRecordVisualShapeAtom m_oVisualShapeAtom; diff --git a/MsBinaryFile/PptFile/Records/Animations/DiagramBuildAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/DiagramBuildAtom.cpp index d7842a1028..c38e6e0257 100644 --- a/MsBinaryFile/PptFile/Records/Animations/DiagramBuildAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/DiagramBuildAtom.cpp @@ -1,5 +1,6 @@ #include "DiagramBuildAtom.h" +using namespace PPT; CRecordDiagramBuildAtom::CRecordDiagramBuildAtom() { diff --git a/MsBinaryFile/PptFile/Records/Animations/DiagramBuildAtom.h b/MsBinaryFile/PptFile/Records/Animations/DiagramBuildAtom.h index a3b73b7599..85089d42d1 100644 --- a/MsBinaryFile/PptFile/Records/Animations/DiagramBuildAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/DiagramBuildAtom.h @@ -43,14 +43,9 @@ class CRecordDiagramBuildAtom : public CUnknownRecord public: DiagramBuildEnum m_oDiagramBuild; - CRecordDiagramBuildAtom(){} - ~CRecordDiagramBuildAtom(){} + CRecordDiagramBuildAtom(); + ~CRecordDiagramBuildAtom(); - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_oDiagramBuild = (DiagramBuildEnum)StreamUtils::ReadDWORD(pStream); - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; }; } diff --git a/MsBinaryFile/PptFile/Records/Animations/DiagramBuildContainer.cpp b/MsBinaryFile/PptFile/Records/Animations/DiagramBuildContainer.cpp index ab3316d7c0..74628e39b7 100644 --- a/MsBinaryFile/PptFile/Records/Animations/DiagramBuildContainer.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/DiagramBuildContainer.cpp @@ -1,5 +1,6 @@ #include"DiagramBuildContainer.h" +using namespace PPT; CRecordDiagramBuildContainer::CRecordDiagramBuildContainer() { diff --git a/MsBinaryFile/PptFile/Records/Animations/DiagramBuildContainer.h b/MsBinaryFile/PptFile/Records/Animations/DiagramBuildContainer.h index f4fbeba063..f50e28be56 100644 --- a/MsBinaryFile/PptFile/Records/Animations/DiagramBuildContainer.h +++ b/MsBinaryFile/PptFile/Records/Animations/DiagramBuildContainer.h @@ -41,25 +41,10 @@ namespace PPT class CRecordDiagramBuildContainer : public CRecordBuildListSubContainer { public: - CRecordDiagramBuildContainer() - { + CRecordDiagramBuildContainer(); + ~CRecordDiagramBuildContainer(); - } - - ~CRecordDiagramBuildContainer() - { - - } - - void ReadFromStream(SRecordHeader &header, POLE::Stream *pStream) override - { - CRecordBuildListSubContainer::ReadFromStream(header, pStream); - - SRecordHeader diagramBuildAtomHeader; - - if (diagramBuildAtomHeader.ReadFromStream(pStream)) - m_oDiagramBuildAtom.ReadFromStream (diagramBuildAtomHeader, pStream); - } + void ReadFromStream(SRecordHeader &header, POLE::Stream *pStream) override; public: CRecordDiagramBuildAtom m_oDiagramBuildAtom; diff --git a/MsBinaryFile/PptFile/Records/Animations/ExtTimeNodeContainer.cpp b/MsBinaryFile/PptFile/Records/Animations/ExtTimeNodeContainer.cpp index 9beea67107..52503a72ac 100644 --- a/MsBinaryFile/PptFile/Records/Animations/ExtTimeNodeContainer.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/ExtTimeNodeContainer.cpp @@ -1,6 +1,6 @@ #include "ExtTimeNodeContainer.h" - +using namespace PPT; CRecordExtTimeNodeContainer::CRecordExtTimeNodeContainer(): m_pTimePropertyList(nullptr), diff --git a/MsBinaryFile/PptFile/Records/Animations/ExtTimeNodeContainer.h b/MsBinaryFile/PptFile/Records/Animations/ExtTimeNodeContainer.h index ab7d15df48..c804d441d3 100644 --- a/MsBinaryFile/PptFile/Records/Animations/ExtTimeNodeContainer.h +++ b/MsBinaryFile/PptFile/Records/Animations/ExtTimeNodeContainer.h @@ -106,323 +106,13 @@ public: public: - CRecordExtTimeNodeContainer() : - m_pTimePropertyList(nullptr), - m_pTimeAnimateBehavior(nullptr), - m_pTimeColorBehavior(nullptr), - m_pTimeEffectBehavior(nullptr), - m_pTimeMotionBehavior(nullptr), - m_pTimeRotationBehavior(nullptr), - m_pTimeScaleBehavior(nullptr), - m_pTimeSetBehavior(nullptr), - m_pTimeCommandBehavior(nullptr), - m_pClientVisualElement(nullptr), - - m_pTimeIterateDataAtom(nullptr), - m_pTimeSequenceDataAtom(nullptr), - - m_pTimeEndSyncTimeCondition(nullptr), - - - m_haveTimePropertyList(false), - m_haveAnimateBehavior(false), - m_haveColorBehavior(false), - m_haveEffectBehavior(false), - m_haveMotionBehavior(false), - m_haveRotationBehavior(false), - m_haveScaleBehavior(false), - m_haveSetBehavior(false), - m_haveCommandBehavior(false), - m_haveClientVisualElement(false), - - m_haveIterateDataAtom(false), - m_haveSequenceAtom(false), - - m_haveTimeEndSyncTime(false) - { - } - - virtual ~CRecordExtTimeNodeContainer() - { - RELEASEOBJECT(m_pTimePropertyList); - RELEASEOBJECT(m_pTimeAnimateBehavior); - RELEASEOBJECT(m_pTimeColorBehavior); - RELEASEOBJECT(m_pTimeEffectBehavior); - RELEASEOBJECT(m_pTimeMotionBehavior); - RELEASEOBJECT(m_pTimeRotationBehavior); - RELEASEOBJECT(m_pTimeScaleBehavior); - RELEASEOBJECT(m_pTimeSetBehavior); - RELEASEOBJECT(m_pTimeCommandBehavior); - RELEASEOBJECT(m_pClientVisualElement); - - RELEASEOBJECT(m_pTimeIterateDataAtom); - RELEASEOBJECT(m_pTimeSequenceDataAtom); - - RELEASEOBJECT(m_pTimeEndSyncTimeCondition); - - for ( size_t i = 0; i < m_arrRgBeginTimeCondition.size(); ++i ) - RELEASEOBJECT ( m_arrRgBeginTimeCondition[i] ); - - for ( size_t i = 0; i < m_arrRgNextTimeCondition.size(); ++i ) - RELEASEOBJECT ( m_arrRgNextTimeCondition[i] ); - - for ( size_t i = 0; i < m_arrRgEndTimeCondition.size(); ++i ) - RELEASEOBJECT ( m_arrRgEndTimeCondition[i] ); - - for ( size_t i = 0; i < m_arrRgTimeModifierAtom.size(); ++i ) - RELEASEOBJECT ( m_arrRgTimeModifierAtom[i] ); - - for ( size_t i = 0; i < m_arrRgSubEffect.size(); ++i ) - RELEASEOBJECT ( m_arrRgSubEffect[i] ); - - for ( size_t i = 0; i < m_arrRgExtTimeNodeChildren.size(); ++i ) - RELEASEOBJECT ( m_arrRgExtTimeNodeChildren[i] ); - } - - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - - LONG lPos = 0; - StreamUtils::StreamPosition ( lPos, pStream ); - - SRecordHeader rHeader; - - if ( rHeader.ReadFromStream(pStream) ) - m_oTimeNodeAtom.ReadFromStream ( rHeader, pStream ); - - UINT lCurLen = m_oTimeNodeAtom.m_oHeader.RecLen + 8; - - SRecordHeader ReadHeader; - - while ( lCurLen < m_oHeader.RecLen ) - { - LONG lPosExpected = 0; - StreamUtils::StreamPosition ( lPosExpected, pStream ); - - if ( ReadHeader.ReadFromStream(pStream) == false) - break; - - lCurLen += 8 + ReadHeader.RecLen; - lPosExpected += 8 + ReadHeader.RecLen; - - switch (ReadHeader.RecType) - { - case RT_TimePropertyList: - { - - m_pTimePropertyList = new CRecordTimePropertyList4TimeNodeContainer; - m_pTimePropertyList->ReadFromStream(ReadHeader, pStream); - m_haveTimePropertyList = true; - - break; - } - - case RT_TimeAnimateBehaviorContainer: - { - - m_pTimeAnimateBehavior = new CRecordTimeAnimateBehaviorContainer; - m_pTimeAnimateBehavior->ReadFromStream(ReadHeader, pStream); - m_haveAnimateBehavior = true; - - break; - } - - case RT_TimeColorBehaviorContainer: - { - - m_pTimeColorBehavior = new CRecordTimeColorBehaviorContainer; - m_pTimeColorBehavior->ReadFromStream(ReadHeader, pStream); - m_haveColorBehavior = true; - - break; - } - - case RT_TimeEffectBehaviorContainer: - { - - m_pTimeEffectBehavior = new CRecordTimeEffectBehaviorContainer(); - m_pTimeEffectBehavior->ReadFromStream(ReadHeader, pStream); - m_haveEffectBehavior = true; - - break; - } - - case RT_TimeMotionBehaviorContainer: - { - - m_pTimeMotionBehavior = new CRecordTimeMotionBehaviorContainer(); - m_pTimeMotionBehavior->ReadFromStream(ReadHeader, pStream); - m_haveMotionBehavior = true; - - break; - } - - case RT_TimeRotationBehaviorContainer: - { - - m_pTimeRotationBehavior = new CRecordTimeRotationBehaviorContainer(); - m_pTimeRotationBehavior->ReadFromStream(ReadHeader, pStream); - m_haveRotationBehavior = true; - - break; - } - - case RT_TimeScaleBehaviorContainer: - { - - m_pTimeScaleBehavior = new CRecordTimeScaleBehaviorContainer(); - m_pTimeScaleBehavior->ReadFromStream(ReadHeader, pStream); - m_haveScaleBehavior = true; - - break; - } - - case RT_TimeSetBehaviorContainer: - { - - m_pTimeSetBehavior = new CRecordTimeSetBehaviorContainer(); - m_pTimeSetBehavior->ReadFromStream(ReadHeader, pStream); - m_haveSetBehavior = true; - - break; - } - - case RT_TimeCommandBehaviorContainer: - { - - m_pTimeCommandBehavior = new CRecordTimeCommandBehaviorContainer(); - m_pTimeCommandBehavior->ReadFromStream(ReadHeader, pStream); - m_haveCommandBehavior = true; - - break; - } - - case RT_TimeClientVisualElement: - { - - m_pClientVisualElement = new CRecordClientVisualElementContainer(); - m_pClientVisualElement->ReadFromStream(ReadHeader, pStream); - m_haveClientVisualElement = true; - - break; - } - - case RT_TimeIterateData: - { - - m_pTimeIterateDataAtom = new CRecordTimeIterateDataAtom(); - m_pTimeIterateDataAtom->ReadFromStream(ReadHeader, pStream); - m_haveIterateDataAtom = true; - - break; - } - - case RT_TimeSequenceData: - { - - m_pTimeSequenceDataAtom = new CRecordTimeSequenceDataAtom(); - m_pTimeSequenceDataAtom->ReadFromStream(ReadHeader, pStream); - m_haveSequenceAtom = true; - - break; - } - - case RT_TimeConditionContainer: - { - - CRecordTimeConditionContainer* pTimeCondition = - new CRecordTimeConditionContainer(); - pTimeCondition->ReadFromStream(ReadHeader, pStream); - unsigned short recInst = ReadHeader.RecInstance; - - if (recInst == TL_CT_Begin) - { - m_arrRgBeginTimeCondition.push_back(pTimeCondition); - } - else if (recInst == TL_CT_Next) - { - m_arrRgNextTimeCondition.push_back(pTimeCondition); - } - - else if (recInst == TL_CT_End || recInst == TL_CT_Previous) - { - m_arrRgEndTimeCondition.push_back(pTimeCondition); - } - else - { - m_haveTimeEndSyncTime = true; - m_pTimeEndSyncTimeCondition = pTimeCondition; - } - - - break; // A lot of records. Look at instance - } - - - case RT_TimeModifier: - { - - CRecordTimeModifierAtom* pModAtom = new CRecordTimeModifierAtom(); - pModAtom->ReadFromStream(ReadHeader, pStream); - m_arrRgTimeModifierAtom.push_back(pModAtom); - - break; - } - - case RT_TimeSubEffectContainer: - { - - CRecordSubEffectContainer* pSub = new CRecordSubEffectContainer(); - pSub->ReadFromStream(ReadHeader, pStream); - m_arrRgSubEffect.push_back(pSub); - - break; - } - - case RT_TimeExtTimeNodeContainer: - { - - CRecordExtTimeNodeContainer* pExt = new CRecordExtTimeNodeContainer(); - pExt->ReadFromStream(ReadHeader, pStream); - m_arrRgExtTimeNodeChildren.push_back(pExt); - - break; - } - - - default: - break; -// throw ; - } - LONG lPosCurrent = 0; - StreamUtils::StreamPosition ( lPosCurrent, pStream ); - if (lPosExpected != lPosCurrent) - { - StreamUtils::StreamSeek ( lPosExpected, pStream ); - } - - } - StreamUtils::StreamSeek ( lPos + m_oHeader.RecLen, pStream ); - } - - - // - inline CRecordTimeModifierAtom* GetModifier (_UINT32 Type) - { - for ( size_t i = 0; i < m_arrRgTimeModifierAtom.size(); ++i ) - if (m_arrRgTimeModifierAtom[i]->m_nType == Type) - return m_arrRgTimeModifierAtom[i]; - - return nullptr; - } - - inline int GetNodeType () const - { - return m_oTimeNodeAtom.m_dwType; - } + CRecordExtTimeNodeContainer(); + virtual ~CRecordExtTimeNodeContainer(); + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; + CRecordTimeModifierAtom* GetModifier (_UINT32 Type); + int GetNodeType () const; }; } diff --git a/MsBinaryFile/PptFile/Records/Animations/HashCode10Atom.cpp b/MsBinaryFile/PptFile/Records/Animations/HashCode10Atom.cpp index e2ff6baa2b..094f1fdf0d 100644 --- a/MsBinaryFile/PptFile/Records/Animations/HashCode10Atom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/HashCode10Atom.cpp @@ -1,5 +1,6 @@ #include "HashCode10Atom.h" +using namespace PPT; void CRecordHashCode10Atom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/HashCode10Atom.h b/MsBinaryFile/PptFile/Records/Animations/HashCode10Atom.h index bd4a400512..aaffa8c6d6 100644 --- a/MsBinaryFile/PptFile/Records/Animations/HashCode10Atom.h +++ b/MsBinaryFile/PptFile/Records/Animations/HashCode10Atom.h @@ -41,12 +41,6 @@ class CRecordHashCode10Atom : public CUnknownRecord public: _UINT32 m_nHash; - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - - m_nHash = StreamUtils::ReadDWORD(pStream); - } - + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; }; } diff --git a/MsBinaryFile/PptFile/Records/Animations/LevelInfoAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/LevelInfoAtom.cpp index 28a76d9349..1dac368a26 100644 --- a/MsBinaryFile/PptFile/Records/Animations/LevelInfoAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/LevelInfoAtom.cpp @@ -1,5 +1,6 @@ #include "LevelInfoAtom.h" +using namespace PPT; CRecordLevelInfoAtom::CRecordLevelInfoAtom() { diff --git a/MsBinaryFile/PptFile/Records/Animations/LevelInfoAtom.h b/MsBinaryFile/PptFile/Records/Animations/LevelInfoAtom.h index 647cc91d8b..d12b28ea9f 100644 --- a/MsBinaryFile/PptFile/Records/Animations/LevelInfoAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/LevelInfoAtom.h @@ -39,24 +39,12 @@ namespace PPT class CRecordLevelInfoAtom : public CUnknownRecord { public: - CRecordLevelInfoAtom() - { - - } - - ~CRecordLevelInfoAtom() - { - - } - - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - - m_nLevel = StreamUtils::ReadDWORD ( pStream ); - } - - _UINT32 m_nLevel; + + CRecordLevelInfoAtom(); + ~CRecordLevelInfoAtom(); + + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ); + }; } diff --git a/MsBinaryFile/PptFile/Records/Animations/ParaBuildAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/ParaBuildAtom.cpp index 0a903b819d..101caf0798 100644 --- a/MsBinaryFile/PptFile/Records/Animations/ParaBuildAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/ParaBuildAtom.cpp @@ -1,5 +1,6 @@ #include "ParaBuildAtom.h" +using namespace PPT; void CRecordParaBuildAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/ParaBuildAtom.h b/MsBinaryFile/PptFile/Records/Animations/ParaBuildAtom.h index 8fbc3d6342..0b2f372140 100644 --- a/MsBinaryFile/PptFile/Records/Animations/ParaBuildAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/ParaBuildAtom.h @@ -39,22 +39,7 @@ namespace PPT class CRecordParaBuildAtom : public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - - m_nParaBuild = StreamUtils::ReadDWORD ( pStream ); - m_nBuildLevel = StreamUtils::ReadDWORD ( pStream ); - - _UINT32 Value = StreamUtils::ReadDWORD ( pStream ); - - m_fAnimBackground = ( 0x01 == ( 0x01 & ((BYTE)Value) ) ); - m_fReverse = ( 0x02 == ( 0x02 & ((BYTE)Value) ) ); - m_fUserSetAnimBackground = ( 0x04 == ( 0x04 & ((BYTE)Value) ) ); - m_fAutomatic = ( 0x08 == ( 0x08 & ((BYTE)Value) ) ); - - m_nDelayTime = StreamUtils::ReadDWORD ( pStream ); - } + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; public: diff --git a/MsBinaryFile/PptFile/Records/Animations/ParaBuildContainer.cpp b/MsBinaryFile/PptFile/Records/Animations/ParaBuildContainer.cpp index cec28a7366..7ab20dd1e9 100644 --- a/MsBinaryFile/PptFile/Records/Animations/ParaBuildContainer.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/ParaBuildContainer.cpp @@ -1,5 +1,6 @@ #include "ParaBuildContainer.h" +using namespace PPT; CRecordParaBuildContainer::CRecordParaBuildContainer() { diff --git a/MsBinaryFile/PptFile/Records/Animations/ParaBuildContainer.h b/MsBinaryFile/PptFile/Records/Animations/ParaBuildContainer.h index 047a247d32..71b770fb4f 100644 --- a/MsBinaryFile/PptFile/Records/Animations/ParaBuildContainer.h +++ b/MsBinaryFile/PptFile/Records/Animations/ParaBuildContainer.h @@ -42,42 +42,10 @@ class CRecordParaBuildContainer : public CRecordBuildListSubContainer { public: - CRecordParaBuildContainer() - { + CRecordParaBuildContainer(); + virtual ~CRecordParaBuildContainer(); - } - - virtual ~CRecordParaBuildContainer() - { - } - - virtual void ReadFromStream ( SRecordHeader & header, POLE::Stream* pStream ) override - { - LONG lPos(0); StreamUtils::StreamPosition(lPos, pStream); - CRecordBuildListSubContainer::ReadFromStream(header, pStream); - - UINT lCurLen = buildAtom.m_oHeader.RecLen + 8 + 24; // BuildAtom - 24 - - - SRecordHeader paraBuildAtomHeader; - if (paraBuildAtomHeader.ReadFromStream(pStream)) - { - m_oParaBuildAtom.ReadFromStream ( paraBuildAtomHeader, pStream ); - lCurLen += paraBuildAtomHeader.RecLen + 8; - } - - while (lCurLen < m_oHeader.RecLen ) - { - CRecordParaBuildLevel buildLevel; - buildLevel.ReadFromStream(pStream); - - rgParaBuildLevel.push_back(buildLevel); - - lCurLen += buildLevel.getRecordLen(); - } - - StreamUtils::StreamSeek(lPos + m_oHeader.RecLen, pStream); - } + virtual void ReadFromStream ( SRecordHeader & header, POLE::Stream* pStream ) override; public: CRecordParaBuildAtom m_oParaBuildAtom; diff --git a/MsBinaryFile/PptFile/Records/Animations/ParaBuildLevel.cpp b/MsBinaryFile/PptFile/Records/Animations/ParaBuildLevel.cpp index eeb5cf0f2c..e3b9ebfe3a 100644 --- a/MsBinaryFile/PptFile/Records/Animations/ParaBuildLevel.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/ParaBuildLevel.cpp @@ -1,5 +1,6 @@ #include "ParaBuildLevel.h" +using namespace PPT; void CRecordParaBuildLevel::ReadFromStream(POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/ParaBuildLevel.h b/MsBinaryFile/PptFile/Records/Animations/ParaBuildLevel.h index d331d26e50..f5ef604ae0 100644 --- a/MsBinaryFile/PptFile/Records/Animations/ParaBuildLevel.h +++ b/MsBinaryFile/PptFile/Records/Animations/ParaBuildLevel.h @@ -38,40 +38,20 @@ namespace PPT { - class CRecordParaBuildLevel - { - public: - CRecordParaBuildLevel() : m_nRecordLen(0) - { - } +class CRecordParaBuildLevel +{ +public: + CRecordParaBuildLevel (); + ~CRecordParaBuildLevel(); - ~CRecordParaBuildLevel() - { - } + virtual void ReadFromStream ( POLE::Stream* pStream ); - virtual void ReadFromStream(POLE::Stream* pStream) - { - SRecordHeader oHeader; + _UINT32 getRecordLen()const {return m_nRecordLen;} - if (oHeader.ReadFromStream(pStream)) - { - m_oLevelInfoAtom.ReadFromStream(oHeader, pStream); - m_nRecordLen += oHeader.RecLen + 8; - } + CRecordLevelInfoAtom m_oLevelInfoAtom; + CRecordExtTimeNodeContainer m_oTimeNode; // ExtTimeNodeContainer - if (oHeader.ReadFromStream(pStream)) - { - m_oTimeNode.ReadFromStream(oHeader, pStream); - m_nRecordLen += oHeader.RecLen + 8; - } - } - - _UINT32 getRecordLen()const { return m_nRecordLen; } - - CRecordLevelInfoAtom m_oLevelInfoAtom; - CRecordExtTimeNodeContainer m_oTimeNode; // ExtTimeNodeContainer - - private: - _UINT32 m_nRecordLen; - }; +private: + _UINT32 m_nRecordLen = 0; +}; } diff --git a/MsBinaryFile/PptFile/Records/Animations/SubEffectContainer.cpp b/MsBinaryFile/PptFile/Records/Animations/SubEffectContainer.cpp index 4e0e95eabe..b72e120e70 100644 --- a/MsBinaryFile/PptFile/Records/Animations/SubEffectContainer.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/SubEffectContainer.cpp @@ -1,5 +1,6 @@ #include "SubEffectContainer.h" +using namespace PPT; //-------------------------------------------------------------------------------- #define SUBEFFECT_CASE(RECORD_TYPE, P_VAR, CLASS_RECORD_NAME, FLAG) \ diff --git a/MsBinaryFile/PptFile/Records/Animations/SubEffectContainer.h b/MsBinaryFile/PptFile/Records/Animations/SubEffectContainer.h index c294995fea..b63ecad5da 100644 --- a/MsBinaryFile/PptFile/Records/Animations/SubEffectContainer.h +++ b/MsBinaryFile/PptFile/Records/Animations/SubEffectContainer.h @@ -31,7 +31,6 @@ */ #pragma once - #include "../../Reader/Records.h" #include "TimeNodeAtom.h" #include "TimePropertyList4TimeNodeContainer.h" @@ -43,117 +42,16 @@ #include "TimeModifierAtom.h" -//-------------------------------------------------------------------------------- -#define SUBEFFECT_CASE(RECORD_TYPE, P_VAR, CLASS_RECORD_NAME, FLAG) \ - case RECORD_TYPE: { P_VAR = new CLASS_RECORD_NAME(); \ - P_VAR->ReadFromStream(ReadHeader, pStream); \ - FLAG = true; \ - break; } \ -//------------------------------------------------------------------------------- - - namespace PPT { struct CRecordSubEffectContainer : public CUnknownRecord { public: - CRecordSubEffectContainer () : - m_pTimePropertyList(nullptr), - m_pTimeColorBehavior(nullptr), - m_pTimeSetBehavior(nullptr), - m_pTimeCommandBehavior(nullptr), - m_pClientVisualElement(nullptr), + CRecordSubEffectContainer (); + virtual ~CRecordSubEffectContainer (); - m_haveTimePropertyList(false), - m_haveColorBehavior(false), - m_haveSetBehavior(false), - m_haveCommandBehavior(false), - m_haveClientVisualElement(false) - { - } - - virtual ~CRecordSubEffectContainer () - { - RELEASEOBJECT(m_pTimePropertyList); - RELEASEOBJECT(m_pTimeColorBehavior); - RELEASEOBJECT(m_pTimeSetBehavior); - RELEASEOBJECT(m_pTimeCommandBehavior); - RELEASEOBJECT(m_pClientVisualElement); - - for (auto pRecord : m_arrRgBeginTimeCondition) - RELEASEOBJECT(pRecord); - for (auto pRecord : m_arrRgEndTimeCondition) - RELEASEOBJECT(pRecord); - for (auto pRecord : m_arrRgTimeModifierAtom) - RELEASEOBJECT(pRecord); - } - - virtual void ReadFromStream (SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - LONG lPos(0); StreamUtils::StreamPosition(lPos, pStream); - - SRecordHeader ReadHeader; - - if ( ReadHeader.ReadFromStream(pStream) ) - m_oTimeNodeAtom.ReadFromStream ( ReadHeader, pStream ); - - UINT lCurLen = m_oTimeNodeAtom.m_oHeader.RecLen + 8; - while ( lCurLen < m_oHeader.RecLen ) - { - if ( ReadHeader.ReadFromStream(pStream) == false) - break; - - lCurLen += 8 + ReadHeader.RecLen; - - switch (ReadHeader.RecType) - { - SUBEFFECT_CASE(RT_TimePropertyList, m_pTimePropertyList, - CRecordTimePropertyList4TimeNodeContainer, m_haveTimePropertyList) - SUBEFFECT_CASE(RT_TimeColorBehaviorContainer, m_pTimeColorBehavior, - CRecordTimeColorBehaviorContainer, m_haveColorBehavior) - SUBEFFECT_CASE(RT_TimeSetBehaviorContainer, m_pTimeSetBehavior, - CRecordTimeSetBehaviorContainer, m_haveSetBehavior) - SUBEFFECT_CASE(RT_TimeCommandBehaviorContainer, m_pTimeCommandBehavior, - CRecordTimeCommandBehaviorContainer, m_haveCommandBehavior) - SUBEFFECT_CASE(RT_TimeClientVisualElement, m_pClientVisualElement, - CRecordClientVisualElementContainer, m_haveClientVisualElement) - - case RT_TimeConditionContainer: - { - CRecordTimeConditionContainer* pTimeCondition = - new CRecordTimeConditionContainer(); - pTimeCondition->ReadFromStream(ReadHeader, pStream); - unsigned short recInst = ReadHeader.RecInstance; - - if (recInst == TL_CT_Begin) - m_arrRgBeginTimeCondition.push_back(pTimeCondition); - - else if (recInst == TL_CT_End) - m_arrRgEndTimeCondition.push_back(pTimeCondition); - else - throw ; - - break; // A lot of records. Look at instance - } - - case RT_TimeModifier: - { - CRecordTimeModifierAtom* pModAtom = new CRecordTimeModifierAtom(); - pModAtom->ReadFromStream(ReadHeader, pStream); - m_arrRgTimeModifierAtom.push_back(pModAtom); - break; - } - - default: - throw ; - } - } - StreamUtils::StreamSeek(lPos + m_oHeader.RecLen, pStream); - - } + virtual void ReadFromStream (SRecordHeader & oHeader, POLE::Stream* pStream) override; public: diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeAnimateBehaviorAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeAnimateBehaviorAtom.cpp index 89fa8df338..80ff4b2af1 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeAnimateBehaviorAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeAnimateBehaviorAtom.cpp @@ -1,5 +1,6 @@ #include "TimeAnimateBehaviorAtom.h" +using namespace PPT; void CRecordTimeAnimateBehaviorAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeAnimateBehaviorAtom.h b/MsBinaryFile/PptFile/Records/Animations/TimeAnimateBehaviorAtom.h index 26081c3306..576714c059 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeAnimateBehaviorAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeAnimateBehaviorAtom.h @@ -31,7 +31,6 @@ */ #pragma once - #include "../../Reader/Records.h" #include "../../Enums/_includer.h" @@ -41,23 +40,7 @@ namespace PPT class CRecordTimeAnimateBehaviorAtom : public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - - m_nCalcMode = StreamUtils::ReadDWORD ( pStream ); - - _UINT32 Value = StreamUtils::ReadDWORD ( pStream ); - - m_bByPropertyUsed = ( 0x01 == ( 0x01 & ((BYTE)Value) ) ); - m_bFromPropertyUsed = ( 0x02 == ( 0x02 & ((BYTE)Value) ) ); - m_bToPropertyUsed = ( 0x04 == ( 0x04 & ((BYTE)Value) ) ); - m_bCalcModePropertyUsed = ( 0x08 == ( 0x08 & ((BYTE)Value) ) ); - m_bAnimationValuesPropertyUsed = ( 0x10 == ( 0x10 & ((BYTE)Value) ) ); - m_bValueTypePropertyUsed = ( 0x20 == ( 0x20 & ((BYTE)Value) ) ); - - m_ValueType = (TimeAnimateBehaviorValueTypeEnum)StreamUtils::ReadDWORD ( pStream ); - } + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; public: diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeAnimateBehaviorContainer.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeAnimateBehaviorContainer.cpp index 0c94daae2d..f2781292a5 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeAnimateBehaviorContainer.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeAnimateBehaviorContainer.cpp @@ -1,5 +1,6 @@ #include "TimeAnimateBehaviorContainer.h" +using namespace PPT; void CRecordTimeAnimateBehaviorContainer::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeAnimateBehaviorContainer.h b/MsBinaryFile/PptFile/Records/Animations/TimeAnimateBehaviorContainer.h index dbbc23d545..4a4e14a15e 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeAnimateBehaviorContainer.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeAnimateBehaviorContainer.h @@ -45,43 +45,7 @@ namespace PPT class CRecordTimeAnimateBehaviorContainer : public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - - SRecordHeader ReadHeader; - - if ( ReadHeader.ReadFromStream(pStream) ) - m_oAnimateBehaviorAtom.ReadFromStream ( ReadHeader, pStream ); - - ReadHeader.ReadFromStream(pStream) ; - if (ReadHeader.RecType == RT_TimeAnimationValueList) - m_oAnimateValueList.ReadFromStream ( ReadHeader, pStream ); - else - StreamUtils::StreamSkipBack(8, pStream); - - - if ( m_oAnimateBehaviorAtom.m_bByPropertyUsed ) - { - if ( ReadHeader.ReadFromStream(pStream) ) - m_oVarBy.ReadFromStream ( ReadHeader, pStream ); - } - - if ( m_oAnimateBehaviorAtom.m_bFromPropertyUsed ) - { - if ( ReadHeader.ReadFromStream(pStream) ) - m_oVarFrom.ReadFromStream ( ReadHeader, pStream ); - } - - if ( m_oAnimateBehaviorAtom.m_bToPropertyUsed ) - { - if ( ReadHeader.ReadFromStream(pStream) ) - m_oVarTo.ReadFromStream ( ReadHeader, pStream ); - } - - if ( ReadHeader.ReadFromStream(pStream) ) - m_oBehavior.ReadFromStream ( ReadHeader, pStream ); - } + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ); public: diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeAnimateColor.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeAnimateColor.cpp index c8a5dd9d95..2f4313dbd9 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeAnimateColor.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeAnimateColor.cpp @@ -1,5 +1,6 @@ #include "TimeAnimateColor.h" +using namespace PPT; unsigned long TimeAnimateColor::FRGB(BYTE alpha) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeAnimateColor.h b/MsBinaryFile/PptFile/Records/Animations/TimeAnimateColor.h index c30a427a45..0aa5e47d5b 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeAnimateColor.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeAnimateColor.h @@ -44,9 +44,6 @@ struct TimeAnimateColor _UINT32 component1; _UINT32 component2; - inline unsigned long FRGB (BYTE alpha = 0xFF) - { - return ((component2 << 16) | (component1 << 8) | (component0 << 0) | (alpha << 24)); - } + unsigned long FRGB (BYTE alpha = 0xFF); }; } diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeAnimateColorBy.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeAnimateColorBy.cpp index 3f80dd4e93..fed936ec5d 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeAnimateColorBy.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeAnimateColorBy.cpp @@ -1,5 +1,6 @@ #include "TimeAnimateColorBy.h" +using namespace PPT; unsigned long TimeAnimateColorBy::FRGB(BYTE alpha) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeAnimateColorBy.h b/MsBinaryFile/PptFile/Records/Animations/TimeAnimateColorBy.h index ad76679494..81b557d9f5 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeAnimateColorBy.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeAnimateColorBy.h @@ -44,9 +44,6 @@ struct TimeAnimateColorBy _UINT32 component1; _UINT32 component2; - inline unsigned long FRGB (BYTE alpha = 0xFF) // - { - return ((component2 << 16) | (component1 << 8) | (component0 << 0) | (alpha << 24)); - } + unsigned long FRGB (BYTE alpha = 0xFF); }; } diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeAnimationValueAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeAnimationValueAtom.cpp index c20b3001c7..8a541c80e3 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeAnimationValueAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeAnimationValueAtom.cpp @@ -1,5 +1,6 @@ #include "TimeAnimationValueAtom.h" +using namespace PPT; void CRecordTimeAnimationValueAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeAnimationValueAtom.h b/MsBinaryFile/PptFile/Records/Animations/TimeAnimationValueAtom.h index de3880a0d5..18793c465d 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeAnimationValueAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeAnimationValueAtom.h @@ -39,15 +39,9 @@ namespace PPT class CRecordTimeAnimationValueAtom : public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - - m_nTime = StreamUtils::ReadDWORD ( pStream ); - } + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; public: - long m_nTime; }; diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeAnimationValueListContainer.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeAnimationValueListContainer.cpp index 6fff618e93..24fea9c851 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeAnimationValueListContainer.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeAnimationValueListContainer.cpp @@ -1,5 +1,6 @@ #include "TimeAnimationValueListContainer.h" +using namespace PPT; CRecordTimeAnimationValueListContainer::CRecordTimeAnimationValueListContainer() { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeAnimationValueListContainer.h b/MsBinaryFile/PptFile/Records/Animations/TimeAnimationValueListContainer.h index 786b0c8e05..6b306c1cd2 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeAnimationValueListContainer.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeAnimationValueListContainer.h @@ -43,45 +43,13 @@ class CRecordTimeAnimationValueListContainer : public CUnknownRecord { public: - ~CRecordTimeAnimationValueListContainer() - { - for (auto pEntry : m_arrEntry) - { - RELEASEOBJECT(pEntry); - } - } - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - - LONG lPos = 0; - StreamUtils::StreamPosition ( lPos, pStream ); - - UINT lCurLen = 0; - - SRecordHeader ReadHeader; - while ( lCurLen < m_oHeader.RecLen ) - { - if ( ReadHeader.ReadFromStream(pStream) == false ) - { - break; - } - - lCurLen += 8 + ReadHeader.RecLen; - - auto Entry = new CRecordTimeAnimationEntry; - Entry->ReadFromStream ( lCurLen, ReadHeader, pStream ); - - m_arrEntry.push_back ( Entry ); - - } - - StreamUtils::StreamSeek ( lPos + m_oHeader.RecLen, pStream ); - } + CRecordTimeAnimationValueListContainer(); + ~CRecordTimeAnimationValueListContainer(); + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; public: - std::vector m_arrEntry; + std::vector m_arrEntry; }; } diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeAnimationValueListEntry.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeAnimationValueListEntry.cpp index 998d212805..eca76aa161 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeAnimationValueListEntry.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeAnimationValueListEntry.cpp @@ -1,5 +1,6 @@ #include "TimeAnimationValueListEntry.h" +using namespace PPT; CRecordTimeAnimationValueListEntry::CRecordTimeAnimationValueListEntry() { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeAnimationValueListEntry.h b/MsBinaryFile/PptFile/Records/Animations/TimeAnimationValueListEntry.h index 4252a8fd1c..ecf8ed14ef 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeAnimationValueListEntry.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeAnimationValueListEntry.h @@ -40,50 +40,14 @@ namespace PPT { -class CRecordTimeAnimationEntry +class CRecordTimeAnimationValueListEntry { public: - CRecordTimeAnimationEntry() - { + CRecordTimeAnimationValueListEntry(); + virtual ~CRecordTimeAnimationValueListEntry(); - } - - virtual ~CRecordTimeAnimationEntry() - { - } - - virtual void ReadFromStream ( UINT& CurLen, SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oTimeAnimationValueAtom.ReadFromStream ( oHeader, pStream ); - CurLen += 4; - -// UINT res = 0; - SRecordHeader ReadHeader; - - ReadHeader.ReadFromStream(pStream); - if ( ReadHeader.RecInstance == 0 && - ReadHeader.RecType == RT_TimeVariant ) - { - m_pVarValue = TimeVariantFactoryMethod( ReadHeader, pStream ); - CurLen += 8 + ReadHeader.RecLen; - }else - { - StreamUtils::StreamSkipBack(8, pStream); - } - - ReadHeader.ReadFromStream(pStream); - if ( ReadHeader.RecInstance == 1 && - ReadHeader.RecType == RT_TimeVariant) - { - m_VarFormula.ReadFromStream ( ReadHeader, pStream ); - CurLen += 8 + ReadHeader.RecLen; - } else - { - StreamUtils::StreamSkipBack(8, pStream); - } - - } + virtual void ReadFromStream ( UINT& CurLen, SRecordHeader & oHeader, POLE::Stream* pStream ); CRecordTimeAnimationValueAtom m_oTimeAnimationValueAtom; nullable m_pVarValue; diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeBehaviorAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeBehaviorAtom.cpp index 8e49321d39..2f7dfbcf8b 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeBehaviorAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeBehaviorAtom.cpp @@ -1,5 +1,6 @@ #include "TimeBehaviorAtom.h" +using namespace PPT; void CRecordTimeBehaviorAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeBehaviorAtom.h b/MsBinaryFile/PptFile/Records/Animations/TimeBehaviorAtom.h index 3e6c416ad6..c8e1004a72 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeBehaviorAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeBehaviorAtom.h @@ -31,7 +31,6 @@ */ #pragma once - #include "../../Reader/Records.h" @@ -41,25 +40,8 @@ namespace PPT class CRecordTimeBehaviorAtom : public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ); - // LONG lPos = 0; StreamUtils::StreamPosition ( lPos, pStream ); - - _UINT32 dwFlags = StreamUtils::ReadDWORD ( pStream ); - - m_bAdditivePropertyUsed = ( 0x01 == ( 0x01 & ((BYTE)dwFlags) ) ); - m_bAttributeNamesPropertyUsed = ( 0x04 == ( 0x04 & ((BYTE)dwFlags) ) ); - - m_nBehaviorAdditive = StreamUtils::ReadDWORD ( pStream ); - m_nBehaviorAccumulate = StreamUtils::ReadDWORD ( pStream ); - m_nBehaviorTransform = StreamUtils::ReadDWORD ( pStream ); - - // StreamUtils::StreamSeek ( lPos + m_oHeader.RecLen, pStream ); - } - -public: bool m_bAdditivePropertyUsed; bool m_bAttributeNamesPropertyUsed; diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeBehaviorContainer.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeBehaviorContainer.cpp index 2512f89890..02a291b8b2 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeBehaviorContainer.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeBehaviorContainer.cpp @@ -1,5 +1,6 @@ #include "TimeBehaviorContainer.h" +using namespace PPT; CRecordTimeBehaviorContainer::CRecordTimeBehaviorContainer() : m_pStringList(nullptr), diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeBehaviorContainer.h b/MsBinaryFile/PptFile/Records/Animations/TimeBehaviorContainer.h index c8a9f5df3a..52f5432ee3 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeBehaviorContainer.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeBehaviorContainer.h @@ -42,89 +42,23 @@ namespace PPT { - class CRecordTimeBehaviorContainer : public CUnknownRecord - { - public: - CRecordTimeBehaviorContainer() : - m_pStringList(nullptr), - m_pPropertyList(nullptr), +class CRecordTimeBehaviorContainer : public CUnknownRecord +{ +public: + CRecordTimeBehaviorContainer (); + virtual ~CRecordTimeBehaviorContainer (); + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ); - m_haveStringList(false), - m_havePropertyList(false) - { - } + _UINT32 GetObjectID (); - virtual ~CRecordTimeBehaviorContainer() - { - RELEASEOBJECT(m_pStringList); - RELEASEOBJECT(m_pPropertyList); - } +public: + CRecordTimeBehaviorAtom m_oBehaviorAtom; + CRecordTimeStringListContainer* m_pStringList; // OPTIONAL + CRecordTimePropertyList4TimeBehavior* m_pPropertyList; // OPTIONAL + CRecordClientVisualElementContainer m_oClientVisualElement; - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; + bool m_haveStringList; + bool m_havePropertyList; +}; - LONG lPos(0); StreamUtils::StreamPosition(lPos, pStream); - - SRecordHeader ReadHeader; - - if (ReadHeader.ReadFromStream(pStream)) - m_oBehaviorAtom.ReadFromStream(ReadHeader, pStream); - - UINT lCurLen = 8 + ReadHeader.RecLen; - - while (lCurLen < m_oHeader.RecLen) - { - if (ReadHeader.ReadFromStream(pStream) == false) - break; - - lCurLen += 8 + ReadHeader.RecLen; - - RecordType nRecord = ReadHeader.RecType; - - switch (nRecord) - { - case RT_TimeVariantList: - { - m_pStringList = new CRecordTimeStringListContainer(); - m_pStringList->ReadFromStream(ReadHeader, pStream); - m_haveStringList = true; - break; - } - - case RT_TimePropertyList: - { - m_pPropertyList = new CRecordTimePropertyList4TimeBehavior(); - m_pPropertyList->ReadFromStream(ReadHeader, pStream); - m_havePropertyList = true; - break; - } - - case RT_TimeClientVisualElement: - { - m_oClientVisualElement.ReadFromStream(ReadHeader, pStream); - } - - default: - break; - } - } - StreamUtils::StreamSeek(lPos + m_oHeader.RecLen, pStream); - } - - - inline _UINT32 GetObjectID() - { - return m_oClientVisualElement.m_oVisualShapeAtom.m_nObjectIdRef; - } - - public: - CRecordTimeBehaviorAtom m_oBehaviorAtom; - CRecordTimeStringListContainer* m_pStringList; // OPTIONAL - CRecordTimePropertyList4TimeBehavior* m_pPropertyList; // OPTIONAL - CRecordClientVisualElementContainer m_oClientVisualElement; - - bool m_haveStringList; - bool m_havePropertyList; - }; } diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeColorBehaviorAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeColorBehaviorAtom.cpp index bc0444c772..a3570022b3 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeColorBehaviorAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeColorBehaviorAtom.cpp @@ -1,5 +1,6 @@ #include "TimeColorBehaviorAtom.h" +using namespace PPT; void CRecordTimeColorBehaviorAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeColorBehaviorAtom.h b/MsBinaryFile/PptFile/Records/Animations/TimeColorBehaviorAtom.h index 6bf52b50e5..5ea94bb897 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeColorBehaviorAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeColorBehaviorAtom.h @@ -43,22 +43,7 @@ namespace PPT class CRecordTimeColorBehaviorAtom: public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - - _UINT32 flag = StreamUtils::ReadDWORD ( pStream ); - - m_fByPropertyUsed = ( 0x01 == ( 0x01 & ((BYTE)flag) ) ); - m_fFromPropertyUsed = ( 0x02 == ( 0x02 & ((BYTE)flag) ) ); - m_fToPropertyUsed = ( 0x04 == ( 0x04 & ((BYTE)flag) ) ); - m_fColorSpacePropertyUsed = ( 0x08 == ( 0x08 & ((BYTE)flag) ) ); - m_fDirectionPropertyUsed = ( 0x10 == ( 0x10 & ((BYTE)flag) ) ); - - pStream->read ((unsigned char*) &m_sColorBy , sizeof ( TimeAnimateColorBy ) ); - pStream->read ((unsigned char*) &m_sColorFrom , sizeof ( TimeAnimateColor ) ); - pStream->read ((unsigned char*) &m_sColorTo , sizeof ( TimeAnimateColor ) ); - } + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; public: diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeColorBehaviorContainer.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeColorBehaviorContainer.cpp index 1855696e65..e9bd6073b4 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeColorBehaviorContainer.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeColorBehaviorContainer.cpp @@ -1,5 +1,6 @@ #include "TimeColorBehaviorContainer.h" +using namespace PPT; void CRecordTimeColorBehaviorContainer::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeColorBehaviorContainer.h b/MsBinaryFile/PptFile/Records/Animations/TimeColorBehaviorContainer.h index 875652b671..b471ef3178 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeColorBehaviorContainer.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeColorBehaviorContainer.h @@ -43,17 +43,7 @@ namespace PPT class CRecordTimeColorBehaviorContainer : public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - - SRecordHeader ReadHeader; - if (ReadHeader.ReadFromStream(pStream) ) - m_oColorBehaviorAtom.ReadFromStream ( ReadHeader, pStream ); - - if (ReadHeader.ReadFromStream(pStream) ) - m_oBehavior.ReadFromStream (ReadHeader, pStream ); - } + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; public: diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeCommandBehaviorAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeCommandBehaviorAtom.cpp index 344aa8a4e7..6c6050e899 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeCommandBehaviorAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeCommandBehaviorAtom.cpp @@ -1,5 +1,6 @@ #include "TimeCommandBehaviorAtom.h" +using namespace PPT; void CRecordTimeCommandBehaviorAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeCommandBehaviorAtom.h b/MsBinaryFile/PptFile/Records/Animations/TimeCommandBehaviorAtom.h index d35189a3e2..5ae7bd4490 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeCommandBehaviorAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeCommandBehaviorAtom.h @@ -41,30 +41,8 @@ namespace PPT class CRecordTimeCommandBehaviorAtom : public CUnknownRecord { public: - CRecordTimeCommandBehaviorAtom () - { + void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; - } - - ~CRecordTimeCommandBehaviorAtom() - { - - } - - void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override - { - m_oHeader = oHeader; - - _UINT32 flags = StreamUtils::ReadLONG(pStream); - - m_fTypePropertyUsed = ( 0x01 == ( 0x01 & (flags) ) ); - m_fCommandPropertyUsed = ( 0x02 == ( 0x02 & (flags) ) ); - - - m_eCommandBehaviorType = (TimeCommandBehaviorTypeEnum) - StreamUtils::ReadLONG(pStream); - - } public: bool m_fTypePropertyUsed; bool m_fCommandPropertyUsed; diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeCommandBehaviorContainer.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeCommandBehaviorContainer.cpp index 30c9ea1b65..a0c6142280 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeCommandBehaviorContainer.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeCommandBehaviorContainer.cpp @@ -1,5 +1,6 @@ #include "TimeCommandBehaviorContainer.h" +using namespace PPT; void CRecordTimeCommandBehaviorContainer::ReadFromStream(SRecordHeader &thisHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeCommandBehaviorContainer.h b/MsBinaryFile/PptFile/Records/Animations/TimeCommandBehaviorContainer.h index 7ef7cf6ac4..bd86678fce 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeCommandBehaviorContainer.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeCommandBehaviorContainer.h @@ -42,32 +42,9 @@ namespace PPT class CRecordTimeCommandBehaviorContainer : public CUnknownRecord { public: - CRecordTimeCommandBehaviorContainer () - { + void ReadFromStream(SRecordHeader &thisHeader, POLE::Stream *pStream) override; - } - ~CRecordTimeCommandBehaviorContainer () - { - - } - - void ReadFromStream(SRecordHeader &thisHeader, POLE::Stream *pStream) override - { - m_oHeader = thisHeader; - - SRecordHeader oHeader; - if (oHeader.ReadFromStream(pStream)) - m_oCommandBehaviorAtom.ReadFromStream ( oHeader, pStream ); - - if (oHeader.ReadFromStream(pStream)) - m_oVarCommand.ReadFromStream ( oHeader, pStream ); - - if (oHeader.ReadFromStream(pStream)) - m_oBevavior.ReadFromStream ( oHeader, pStream ); - } - -public: CRecordTimeCommandBehaviorAtom m_oCommandBehaviorAtom; CRecordTimeVariantString m_oVarCommand; CRecordTimeBehaviorContainer m_oBevavior; diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeConditionAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeConditionAtom.cpp index 5da2337968..30975d1b6b 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeConditionAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeConditionAtom.cpp @@ -1,5 +1,6 @@ #include "TimeConditionAtom.h" +using namespace PPT; void CRecordTimeConditionAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeConditionAtom.h b/MsBinaryFile/PptFile/Records/Animations/TimeConditionAtom.h index 7882bcee93..a2a7c99dab 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeConditionAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeConditionAtom.h @@ -41,18 +41,8 @@ namespace PPT class CRecordTimeConditionAtom : public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ); - m_TriggerObject = ( TriggerObjectEnum )StreamUtils::ReadDWORD ( pStream ); - - m_nTriggerEvent = StreamUtils::ReadDWORD ( pStream ); - m_nID = StreamUtils::ReadDWORD ( pStream ); - m_nTimeDelay = StreamUtils::ReadLONG ( pStream ); - } - -public: TriggerObjectEnum m_TriggerObject; _UINT32 m_nTriggerEvent; diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeConditionContainer.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeConditionContainer.cpp index 910bbac13a..eae811d0d2 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeConditionContainer.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeConditionContainer.cpp @@ -1,5 +1,6 @@ #include "TimeConditionContainer.h" +using namespace PPT; void CRecordTimeConditionContainer::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeConditionContainer.h b/MsBinaryFile/PptFile/Records/Animations/TimeConditionContainer.h index 3f85789d7e..9c02d3f87e 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeConditionContainer.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeConditionContainer.h @@ -31,7 +31,6 @@ */ #pragma once - #include "../../Reader/Records.h" #include "TimeConditionAtom.h" #include "ClientVisualElementContainer.h" @@ -42,31 +41,8 @@ namespace PPT class CRecordTimeConditionContainer : public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; - LONG lPos = 0; StreamUtils::StreamPosition ( lPos, pStream ); - - SRecordHeader header; - - if ( header.ReadFromStream(pStream) ) - { - m_oTimeConditionAtom.ReadFromStream ( header, pStream ); - - if ( TL_TOT_VisualElement == m_oTimeConditionAtom.m_TriggerObject ) - { - if ( header.ReadFromStream(pStream) ) - { - m_oVisualElement.ReadFromStream ( header, pStream ); - } - } - } - - StreamUtils::StreamSeek ( lPos + m_oHeader.RecLen, pStream ); - } - -public: CRecordTimeConditionAtom m_oTimeConditionAtom; CRecordClientVisualElementContainer m_oVisualElement; diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeEffectBehaviorAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeEffectBehaviorAtom.cpp index 6271a08a81..275cc23fe5 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeEffectBehaviorAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeEffectBehaviorAtom.cpp @@ -1,5 +1,6 @@ #include "TimeEffectBehaviorAtom.h" +using namespace PPT; void CRecordTimeEffectBehaviorAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeEffectBehaviorAtom.h b/MsBinaryFile/PptFile/Records/Animations/TimeEffectBehaviorAtom.h index 44ba976996..900d7a265d 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeEffectBehaviorAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeEffectBehaviorAtom.h @@ -31,33 +31,15 @@ */ #pragma once - #include "../../Reader/Records.h" namespace PPT { - class CRecordTimeEffectBehaviorAtom : public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - - // LONG lPos = 0; StreamUtils::StreamPosition ( lPos, pStream ); - - _UINT32 dwFlags = StreamUtils::ReadDWORD ( pStream ); - - m_bTransitionPropertyUsed = ( 0x01 == ( 0x01 & ((BYTE)dwFlags) ) ); - m_bTypePropertyUsed = ( 0x02 == ( 0x02 & ((BYTE)dwFlags) ) ); - m_bProgressPropertyUsed = ( 0x04 == ( 0x04 & ((BYTE)dwFlags) ) ); - m_bRuntimeContextObsolete = ( 0x08 == ( 0x08 & ((BYTE)dwFlags) ) ); - - m_nEffectTransition = StreamUtils::ReadDWORD ( pStream ); - - // StreamUtils::StreamSeek ( lPos + m_oHeader.RecLen, pStream ); - } + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ); public: bool m_bTransitionPropertyUsed; diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeEffectBehaviorContainer.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeEffectBehaviorContainer.cpp index ac1ce318fe..4ff024e188 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeEffectBehaviorContainer.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeEffectBehaviorContainer.cpp @@ -1,5 +1,6 @@ #include "TimeEffectBehaviorContainer.h" +using namespace PPT; void CRecordTimeEffectBehaviorContainer::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeEffectBehaviorContainer.h b/MsBinaryFile/PptFile/Records/Animations/TimeEffectBehaviorContainer.h index 579093fd0d..387e8bc3c8 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeEffectBehaviorContainer.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeEffectBehaviorContainer.h @@ -42,54 +42,8 @@ namespace PPT class CRecordTimeEffectBehaviorContainer : public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; - LONG lPos = 0; StreamUtils::StreamPosition ( lPos, pStream ); - - SRecordHeader header; - if ( header.ReadFromStream(pStream) ) - m_effectBehaviorAtom.ReadFromStream ( header, pStream ); - - if ( m_effectBehaviorAtom.m_bTypePropertyUsed ) - { - if ( header.ReadFromStream(pStream) ) - m_oVarType.ReadFromStream ( header, pStream ); - } - - if ( m_effectBehaviorAtom.m_bProgressPropertyUsed ) - { - if ( header.ReadFromStream(pStream) ) - m_oVarProgress.ReadFromStream ( header, pStream ); - } - - if ( m_effectBehaviorAtom.m_bRuntimeContextObsolete ) - { - if ( header.ReadFromStream(pStream) ) - m_oVarRuntimeContext.ReadFromStream ( header, pStream ); - } - - if ( header.ReadFromStream(pStream) ) - { - if (header.RecType == 0xF12A) - { - m_oBehavior.ReadFromStream (header, pStream); - } - else - { - StreamUtils::StreamSkip (header.RecLen, pStream); - if ( header.ReadFromStream(pStream) ) - { - m_oBehavior.ReadFromStream ( header, pStream ); - } - } - } - - StreamUtils::StreamSeek ( lPos + m_oHeader.RecLen, pStream ); - } - -public: CRecordTimeEffectBehaviorAtom m_effectBehaviorAtom; diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeIterateDataAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeIterateDataAtom.cpp index c092ad092e..2dc69a10bb 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeIterateDataAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeIterateDataAtom.cpp @@ -1,5 +1,6 @@ #include "TimeIterateDataAtom.h" +using namespace PPT; void CRecordTimeIterateDataAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeIterateDataAtom.h b/MsBinaryFile/PptFile/Records/Animations/TimeIterateDataAtom.h index 3744dcf517..c916c33897 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeIterateDataAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeIterateDataAtom.h @@ -31,32 +31,16 @@ */ #pragma once - #include "../../Reader/Records.h" + namespace PPT { class CRecordTimeIterateDataAtom: public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; - m_nIterateInterval = StreamUtils::ReadDWORD ( pStream ); - m_nIterateType = StreamUtils::ReadDWORD ( pStream ); - m_nIterateDirection = StreamUtils::ReadDWORD ( pStream ); - m_nIterateIntervalType = StreamUtils::ReadDWORD ( pStream ); - - _UINT32 Value = StreamUtils::ReadDWORD ( pStream ); - - m_fIterateDirectionPropertyUsed = ( 0x01 == ( 0x01 & ((BYTE)Value) ) ); - m_fIterateTypePropertyUsed = ( 0x02 == ( 0x02 & ((BYTE)Value) ) ); - m_fIterateIntervalPropertyUsed = ( 0x04 == ( 0x04 & ((BYTE)Value) ) ); - m_fIterateIntervalTypePropertyUsed = ( 0x08 == ( 0x08 & ((BYTE)Value) ) ); - } - -public: _UINT32 m_nIterateInterval; _UINT32 m_nIterateType; diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeModifierAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeModifierAtom.cpp index d45274e0d5..3fda24cae8 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeModifierAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeModifierAtom.cpp @@ -1,5 +1,6 @@ #include "TimeModifierAtom.h" +using namespace PPT; void CRecordTimeModifierAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeModifierAtom.h b/MsBinaryFile/PptFile/Records/Animations/TimeModifierAtom.h index 4d8d860528..5aae915c5e 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeModifierAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeModifierAtom.h @@ -40,15 +40,8 @@ namespace PPT class CRecordTimeModifierAtom : public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; - m_nType = StreamUtils::ReadDWORD(pStream); - m_Value = StreamUtils::ReadFLOAT(pStream); - } - -public: unsigned long m_nType; // 0x00000000 Repeat count. // 0x00000001 Repeat duration. diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeMotionBehaviorAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeMotionBehaviorAtom.cpp index 9bee1c8b98..5282fdafaa 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeMotionBehaviorAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeMotionBehaviorAtom.cpp @@ -1,5 +1,6 @@ #include "TimeMotionBehaviorAtom.h" +using namespace PPT; void CRecordTimeMotionBehaviorAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeMotionBehaviorAtom.h b/MsBinaryFile/PptFile/Records/Animations/TimeMotionBehaviorAtom.h index 79840b25eb..2f935fecfe 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeMotionBehaviorAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeMotionBehaviorAtom.h @@ -40,31 +40,8 @@ namespace PPT class CRecordTimeMotionBehaviorAtom : public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; - _UINT32 Value = StreamUtils::ReadDWORD ( pStream ); - - m_bByPropertyUsed = ( 0x01 == ( 0x01 & ((BYTE)Value) ) ); - m_bFromPropertyUsed = ( 0x02 == ( 0x02 & ((BYTE)Value) ) ); - m_bToPropertyUsed = ( 0x04 == ( 0x04 & ((BYTE)Value) ) ); - m_bOriginPropertyUsed = ( 0x08 == ( 0x08 & ((BYTE)Value) ) ); - m_bPathPropertyUsed = ( 0x10 == ( 0x10 & ((BYTE)Value) ) ); - - m_bEditRotationPropertyUsed = ( 0x40 == ( 0x40 & ((BYTE)Value) ) ); - m_bPointsTypesPropertyUsed = ( 0x80 == ( 0x80 & ((BYTE)Value) ) ); - - m_nXBY = StreamUtils::ReadFLOAT ( pStream ); - m_nYBY = StreamUtils::ReadFLOAT ( pStream ); - m_nXFROM = StreamUtils::ReadFLOAT ( pStream ); - m_nYFROM = StreamUtils::ReadFLOAT ( pStream ); - m_nXTO = StreamUtils::ReadFLOAT ( pStream ); - m_nYTO = StreamUtils::ReadFLOAT ( pStream ); - m_nBehaviorOrigin = StreamUtils::ReadDWORD ( pStream ); - } - -public: bool m_bByPropertyUsed; bool m_bFromPropertyUsed; diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeMotionBehaviorContainer.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeMotionBehaviorContainer.cpp index 1077595ba1..e39dab1b7b 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeMotionBehaviorContainer.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeMotionBehaviorContainer.cpp @@ -1,5 +1,6 @@ #include "TimeMotionBehaviorContainer.h" +using namespace PPT; CRecordTimeMotionBehaviorContainer::~CRecordTimeMotionBehaviorContainer() { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeMotionBehaviorContainer.h b/MsBinaryFile/PptFile/Records/Animations/TimeMotionBehaviorContainer.h index 58e075927d..5d12c61466 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeMotionBehaviorContainer.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeMotionBehaviorContainer.h @@ -43,59 +43,10 @@ namespace PPT class CRecordTimeMotionBehaviorContainer : public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; + ~CRecordTimeMotionBehaviorContainer(); - LONG lPos = 0; StreamUtils::StreamPosition ( lPos, pStream ); + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; - //UINT res = 0; - - SRecordHeader header; - if ( header.ReadFromStream(pStream) ) - { - m_oMotionBehaviorAtom.ReadFromStream ( header, pStream ); - } - - UINT lCurLen = m_oMotionBehaviorAtom.m_oHeader.RecLen + 8; - while ( lCurLen < m_oHeader.RecLen ) - { - header.ReadFromStream(pStream); - - lCurLen += header.RecLen + 8; - - switch (header.RecType) { - case RT_TimeVariant: - { - if (header.RecLen > 5 ) { - m_pVarPath = new CRecordTimeVariantString(); - m_pVarPath->ReadFromStream(header, pStream); - }else if (header.RecLen == 5){ - StreamUtils::StreamSkip(5, pStream); - } else - StreamUtils::StreamSkip(header.RecLen, pStream); - break; - } - - case RT_TimeBehaviorContainer: - { - m_oTimeBehavior.ReadFromStream(header, pStream); - break; - } - default: - break; - } - } - StreamUtils::StreamSeek(lPos + m_oHeader.RecLen, pStream); - } - - - ~CRecordTimeMotionBehaviorContainer() - { - RELEASEOBJECT(m_pVarPath) - } - -public: CRecordTimeMotionBehaviorAtom m_oMotionBehaviorAtom; CRecordTimeVariantString* m_pVarPath; // OPTIONAL diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeNodeAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeNodeAtom.cpp index 440e7b62e9..2d250a44eb 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeNodeAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeNodeAtom.cpp @@ -1,5 +1,6 @@ #include "TimeNodeAtom.h" +using namespace PPT; void CRecordTimeNodeAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeNodeAtom.h b/MsBinaryFile/PptFile/Records/Animations/TimeNodeAtom.h index b3538986fa..312fc6dfa7 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeNodeAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeNodeAtom.h @@ -41,49 +41,8 @@ namespace PPT class CRecordTimeNodeAtom : public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; - // LONG lPos = 0; StreamUtils::StreamPosition(lPos, pStream); - - StreamUtils::StreamSkip ( sizeof ( _UINT32 ), pStream ); - - // 0x00000000 Does not restart. - // 0x00000001 Can restart at any time. - // 0x00000002 Can restart when the corresponding time node is not active. - // 0x00000003 Same as 0x00000000. - m_dwRestart = StreamUtils::ReadDWORD ( pStream ); - // 0x00000000 specifies that this time node is a parallel time node, - // which allows all of its child nodes to start at the same time. - m_dwType = (TimeNodeTypeEnum)StreamUtils::ReadDWORD ( pStream ); - - // 0x00000000 The properties remain at their ending values while the parent time node is still running or holding. After which, the properties reset to their original values. - // 0x00000001 The properties reset to their original values after the time node becomes inactive. - // 0x00000002 The properties remain at their ending values while the parent time node is still running or holding, or until another sibling time node is started under a sequential time node as specified in the type field. After which, the properties reset to their original values. - // 0x00000003 Same as 0x00000000. - // 0x00000004 Same as 0x00000001. - m_dwFill = StreamUtils::ReadDWORD ( pStream ); - - StreamUtils::StreamSkip ( sizeof ( _UINT32 ), pStream ); - StreamUtils::StreamSkip ( sizeof ( _UINT32 ), pStream ); - - // duration: 0xFFFFFFFF specifies that the duration of the time node is infinite, - // and that its actual duration is determined by the durations of its child nodes. - m_nDuration = StreamUtils::ReadLONG ( pStream ); - - _UINT32 Value = StreamUtils::ReadDWORD ( pStream ); - - m_fFillProperty = ( 0x01 == ( 0x01 & ((BYTE)Value) ) ); - m_fRestartProperty = ( 0x02 == ( 0x02 & ((BYTE)Value) ) ); - - m_fGroupingTypeProperty = ( 0x08 == ( 0x08 & ((BYTE)Value) ) ); - m_fDurationProperty = ( 0x10 == ( 0x10 & ((BYTE)Value) ) ); - - // StreamUtils::StreamSeek ( lPos + m_oHeader.RecLen, pStream ); - } - -public: _UINT32 m_dwRestart; TimeNodeTypeEnum m_dwType; diff --git a/MsBinaryFile/PptFile/Records/Animations/TimePropertyList4TimeBehavior.cpp b/MsBinaryFile/PptFile/Records/Animations/TimePropertyList4TimeBehavior.cpp index 001edb1778..631c448069 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimePropertyList4TimeBehavior.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimePropertyList4TimeBehavior.cpp @@ -1,5 +1,6 @@ #include "TimePropertyList4TimeBehavior.h" +using namespace PPT; CRecordTimePropertyList4TimeBehavior::~CRecordTimePropertyList4TimeBehavior() { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimePropertyList4TimeBehavior.h b/MsBinaryFile/PptFile/Records/Animations/TimePropertyList4TimeBehavior.h index a683f7fde0..3f9c7d078b 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimePropertyList4TimeBehavior.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimePropertyList4TimeBehavior.h @@ -42,46 +42,8 @@ namespace PPT class CRecordTimePropertyList4TimeBehavior : public CRecordsContainer { public: - //static const _UINT32 RT_TimePropertyList = 0xF13D; // Specifies a TimePropertyList4TimeNodeContainer or TimePropertyList4TimeBehavior. + virtual ~CRecordTimePropertyList4TimeBehavior (); - CRecordTimePropertyList4TimeBehavior () - { - } - - virtual ~CRecordTimePropertyList4TimeBehavior () - { - CRecordsContainer::Clear(); - } - - virtual void ReadFromStream ( SRecordHeader & thisHeader, POLE::Stream* pStream ) - { - m_oHeader = thisHeader; - - UINT lCurLen = 0; - SRecordHeader oHeader; - - while (lCurLen < m_oHeader.RecLen) - { -// if (oHeader.ReadFromStream(pStream) == FALSE) -// { -// break; -// } - - if (oHeader.ReadFromStream(pStream)) { - lCurLen += 8 + oHeader.RecLen; - IRecord* pRecord = FactoryTimeVariant4Behavior::createByInstanse(oHeader.RecInstance); - if (pRecord) - { - pRecord->ReadFromStream(oHeader, pStream); - m_arRecords.push_back(pRecord); - } - else - break; - } - } - } - -public: - // Empty + virtual void ReadFromStream ( SRecordHeader & thisHeader, POLE::Stream* pStream ) override; }; } diff --git a/MsBinaryFile/PptFile/Records/Animations/TimePropertyList4TimeNodeContainer.cpp b/MsBinaryFile/PptFile/Records/Animations/TimePropertyList4TimeNodeContainer.cpp index a4a1e6dbdf..a9c40eef44 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimePropertyList4TimeNodeContainer.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimePropertyList4TimeNodeContainer.cpp @@ -1,5 +1,6 @@ #include "TimePropertyList4TimeNodeContainer.h" +using namespace PPT; CRecordTimePropertyList4TimeNodeContainer::CRecordTimePropertyList4TimeNodeContainer() { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimePropertyList4TimeNodeContainer.h b/MsBinaryFile/PptFile/Records/Animations/TimePropertyList4TimeNodeContainer.h index 57487d1c56..14ec733970 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimePropertyList4TimeNodeContainer.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimePropertyList4TimeNodeContainer.h @@ -44,87 +44,15 @@ class CRecordTimePropertyList4TimeNodeContainer : public CUnknownRecord public: //static const _UINT32 RT_TimePropertyList = 0xF13D; // Specifies a CRecordTimePropertyList4TimeNodeContainer or TimePropertyList4TimeBehavior. - CRecordTimePropertyList4TimeNodeContainer () - { - m_bEmtyNode = false; - } + CRecordTimePropertyList4TimeNodeContainer (); + virtual ~CRecordTimePropertyList4TimeNodeContainer (); - virtual ~CRecordTimePropertyList4TimeNodeContainer () - { - ClearNodes (); - } + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - - LONG lPos = 0; - StreamUtils::StreamPosition ( lPos, pStream ); - - UINT lCurLen = 0; - - SRecordHeader ReadHeader; - - if ( 0 == m_oHeader.RecLen ) - m_bEmtyNode = true; - - while ( lCurLen < m_oHeader.RecLen ) - { - if (ReadHeader.ReadFromStream(pStream) == false) - break; - - CRecordTimeVariant* pRecord = NULL; - - TimePropertyID4TimeNode VariableType = ( TimePropertyID4TimeNode ) ReadHeader.RecInstance; - - switch ( VariableType ) - { - case TL_TPID_Display: pRecord = new CRecordTimeDisplayType (); break; - case TL_TPID_MasterPos: pRecord = new CRecordTimeMasterRelType (); break; - case TL_TPID_SubType: pRecord = new CRecordTimeSubType (); break; - case TL_TPID_EffectID: pRecord = new CRecordTimeEffectID (); break; - case TL_TPID_EffectDir: pRecord = new CRecordTimeEffectDir (); break; - case TL_TPID_EffectType: pRecord = new CRecordTimeEffectType (); break; - case TL_TPID_AfterEffect: pRecord = new CRecordTimeAfterEffect (); break; - case TL_TPID_SlideCount: pRecord = new CRecordTimeSlideCount (); break; - case TL_TPID_TimeFilter: pRecord = new CRecordTimeNodeTimeFilter (); break; - case TL_TPID_EventFilter: pRecord = new CRecordTimeEventFilter (); break; - case TL_TPID_HideWhenStopped: pRecord = new CRecordTimeHideWhenStopped (); break; - case TL_TPID_GroupID: pRecord = new CRecordTimeGroupID (); break; - case TL_TPID_EffectNodeType: pRecord = new CRecordTimeEffectNodeType (); break; - case TL_TPID_PlaceholderNode: pRecord = new CRecordTimePlaceholderNode (); break; - case TL_TPID_MediaVolume: pRecord = new CRecordTimeMediaVolume (); break; - case TL_TPID_MediaMute: pRecord = new CRecordTimeMediaMute (); break; - case TL_TPID_ZoomToFullScreen: pRecord = new CRecordTimeZoomToFullScreen (); break; - default : - break; - } - - pRecord->ReadFromStream ( ReadHeader, pStream ); - lCurLen += 8 + ReadHeader.RecLen; - - m_arrElements.push_back ( pRecord ); - } - - StreamUtils::StreamSeek ( lPos + m_oHeader.RecLen, pStream ); - } - - inline bool IsEmpty () - { - return m_bEmtyNode; - } - - void ClearNodes () - { - for ( size_t i = 0; i < m_arrElements.size(); ++i ) - { - RELEASEOBJECT ( m_arrElements[i] ); - } - m_arrElements.clear (); - } + bool IsEmpty (); + void ClearNodes (); public: - bool m_bEmtyNode; std::vector m_arrElements; diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeRotationBehaviorAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeRotationBehaviorAtom.cpp index 5d5962c695..66044236a9 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeRotationBehaviorAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeRotationBehaviorAtom.cpp @@ -1,5 +1,6 @@ #include "TimeRotationBehaviorAtom.h" +using namespace PPT; void CRecordTimeRotationBehaviorAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeRotationBehaviorAtom.h b/MsBinaryFile/PptFile/Records/Animations/TimeRotationBehaviorAtom.h index 6e9cc51a68..0746b6cffa 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeRotationBehaviorAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeRotationBehaviorAtom.h @@ -36,36 +36,20 @@ namespace PPT { - class CRecordTimeRotationBehaviorAtom : public CUnknownRecord - { - public: - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; +class CRecordTimeRotationBehaviorAtom : public CUnknownRecord +{ +public: + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ); - _UINT32 src = StreamUtils::ReadDWORD(pStream); +public: - m_fByPropertyUsed = (0x01 == (0x01 & ((BYTE)src))); - m_fFromPropertyUsed = (0x02 == (0x02 & ((BYTE)src))); - m_fToPropertyUsed = (0x04 == (0x04 & ((BYTE)src))); - m_fDirectionPropertyUsed = (0x08 == (0x08 & ((BYTE)src))); - - m_By = StreamUtils::ReadFLOAT(pStream); - m_From = StreamUtils::ReadFLOAT(pStream); - m_To = StreamUtils::ReadFLOAT(pStream); - - m_nRotationDirection = StreamUtils::ReadDWORD(pStream); - } - - public: - - bool m_fByPropertyUsed; - bool m_fFromPropertyUsed; - bool m_fToPropertyUsed; - bool m_fDirectionPropertyUsed; - float m_By; - float m_From; - float m_To; - _UINT32 m_nRotationDirection; // 0 - rotate clockwise, 1 - rotate counter clockwise - }; + bool m_fByPropertyUsed; + bool m_fFromPropertyUsed; + bool m_fToPropertyUsed; + bool m_fDirectionPropertyUsed; + float m_By; + float m_From; + float m_To; + _UINT32 m_nRotationDirection; // 0 - rotate clockwise, 1 - rotate counter clockwise +}; } diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeRotationBehaviorContainer.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeRotationBehaviorContainer.cpp index 2eaf9a4830..a51484f9fd 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeRotationBehaviorContainer.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeRotationBehaviorContainer.cpp @@ -1,5 +1,6 @@ #include "TimeRotationBehaviorContainer.h" +using namespace PPT; void CRecordTimeRotationBehaviorContainer::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeRotationBehaviorContainer.h b/MsBinaryFile/PptFile/Records/Animations/TimeRotationBehaviorContainer.h index c74eef6862..a39d4363f6 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeRotationBehaviorContainer.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeRotationBehaviorContainer.h @@ -39,23 +39,14 @@ namespace PPT { - class CRecordTimeRotationBehaviorContainer : public CUnknownRecord - { - public: - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; +class CRecordTimeRotationBehaviorContainer : public CUnknownRecord +{ +public: + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ); - SRecordHeader ReadHeader; - if (ReadHeader.ReadFromStream(pStream)) - m_oRotationBehaviorAtom.ReadFromStream(ReadHeader, pStream); + CRecordTimeRotationBehaviorAtom m_oRotationBehaviorAtom; + CRecordTimeBehaviorContainer m_oBehavior; +}; - if (ReadHeader.ReadFromStream(pStream)) - m_oBehavior.ReadFromStream(ReadHeader, pStream); - } - - CRecordTimeRotationBehaviorAtom m_oRotationBehaviorAtom; - CRecordTimeBehaviorContainer m_oBehavior; - }; } diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeScaleBehaviorAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeScaleBehaviorAtom.cpp index 07a6885a53..3034dd32b9 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeScaleBehaviorAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeScaleBehaviorAtom.cpp @@ -1,5 +1,6 @@ #include "TimeScaleBehaviorAtom.h" +using namespace PPT; void CRecordTimeScaleBehaviorAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeScaleBehaviorAtom.h b/MsBinaryFile/PptFile/Records/Animations/TimeScaleBehaviorAtom.h index fb6feb5a25..3e636dcc77 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeScaleBehaviorAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeScaleBehaviorAtom.h @@ -40,27 +40,7 @@ namespace PPT class CRecordTimeScaleBehaviorAtom : public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - - _UINT32 src = StreamUtils::ReadDWORD ( pStream ); - - m_fByPropertyUsed = ( 0x01 == ( 0x01 & ((BYTE)src) ) ); - m_fFromPropertyUsed = ( 0x02 == ( 0x02 & ((BYTE)src) ) ); - m_fToPropertyUsed = ( 0x04 == ( 0x04 & ((BYTE)src) ) ); - m_fZoomContentsUsed = ( 0x08 == ( 0x08 & ((BYTE)src) ) ); - - m_XBy = StreamUtils::ReadFLOAT ( pStream ); - m_YBy = StreamUtils::ReadFLOAT ( pStream ); - m_XFrom = StreamUtils::ReadFLOAT ( pStream ); - m_YFrom = StreamUtils::ReadFLOAT ( pStream ); - m_XTo = StreamUtils::ReadFLOAT ( pStream ); - m_YTo = StreamUtils::ReadFLOAT ( pStream ); - - src = StreamUtils::ReadDWORD ( pStream ); - m_fZoomContents = ( 0x01 == ( 0x01 & ((BYTE)src) ) ); - } + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; public: diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeScaleBehaviorContainer.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeScaleBehaviorContainer.cpp index ac14a33357..249f0e5141 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeScaleBehaviorContainer.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeScaleBehaviorContainer.cpp @@ -1,5 +1,6 @@ #include "TimeScaleBehaviorContainer.h" +using namespace PPT; void CRecordTimeScaleBehaviorContainer::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeScaleBehaviorContainer.h b/MsBinaryFile/PptFile/Records/Animations/TimeScaleBehaviorContainer.h index 14ed01aba6..a99dfa7499 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeScaleBehaviorContainer.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeScaleBehaviorContainer.h @@ -42,18 +42,7 @@ namespace PPT class CRecordTimeScaleBehaviorContainer : public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - - SRecordHeader ReadHeader; - - if ( ReadHeader.ReadFromStream(pStream) ) - m_oScaleBehaviorAtom.ReadFromStream ( ReadHeader, pStream ); - - if ( ReadHeader.ReadFromStream(pStream) ) - m_oBehavior.ReadFromStream ( ReadHeader, pStream ); - } + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; public: CRecordTimeScaleBehaviorAtom m_oScaleBehaviorAtom; diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeSequenceDataAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeSequenceDataAtom.cpp index 5d8cc5533e..aae74893de 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeSequenceDataAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeSequenceDataAtom.cpp @@ -1,5 +1,6 @@ #include "TimeSequenceDataAtom.h" +using namespace PPT; void CRecordTimeSequenceDataAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeSequenceDataAtom.h b/MsBinaryFile/PptFile/Records/Animations/TimeSequenceDataAtom.h index ba60e17b12..ee1df115e8 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeSequenceDataAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeSequenceDataAtom.h @@ -39,26 +39,7 @@ namespace PPT class CRecordTimeSequenceDataAtom : public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - - // LONG lPos = 0; StreamUtils::StreamPosition ( lPos, pStream ); - - m_nConcurrency = StreamUtils::ReadDWORD ( pStream ); - m_nNextAction = StreamUtils::ReadDWORD ( pStream ); - m_nPreviousAction = StreamUtils::ReadDWORD ( pStream ); - - StreamUtils::StreamSkip ( sizeof ( _UINT32 ), pStream ); - - _UINT32 Value = StreamUtils::ReadDWORD ( pStream ); - - m_fConcurrencyPropertyUsed = ( 0x01 == ( 0x01 & ((BYTE)Value) ) ); - m_fNextActionPropertyUsed = ( 0x02 == ( 0x02 & ((BYTE)Value) ) ); - m_fPreviousActionPropertyUsed = ( 0x04 == ( 0x04 & ((BYTE)Value) ) ); - - // StreamUtils::StreamSeek ( lPos + m_oHeader.RecLen, pStream ); - } + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; public: diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeSetBehaviorAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeSetBehaviorAtom.cpp index 24f15e613a..8f5696a1ba 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeSetBehaviorAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeSetBehaviorAtom.cpp @@ -1,5 +1,6 @@ #include "TimeSetBehaviorAtom.h" +using namespace PPT; void CRecordTimeSetBehaviorAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeSetBehaviorAtom.h b/MsBinaryFile/PptFile/Records/Animations/TimeSetBehaviorAtom.h index e5b4463e8f..6e879fce1c 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeSetBehaviorAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeSetBehaviorAtom.h @@ -41,19 +41,8 @@ namespace PPT class CRecordTimeSetBehaviorAtom : public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; - _UINT32 Value = StreamUtils::ReadDWORD ( pStream ); - - m_bToPropertyUsed = ( 0x01 == ( 0x01 & ((BYTE)Value) ) ); - m_bValueTypePropertyUsed = ( 0x02 == ( 0x02 & ((BYTE)Value) ) ); - - m_eValueType = (TimeAnimateBehaviorValueTypeEnum)StreamUtils::ReadDWORD ( pStream ); - } - -public: bool m_bToPropertyUsed; bool m_bValueTypePropertyUsed; diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeSetBehaviorContainer.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeSetBehaviorContainer.cpp index 339dd27dbd..4d84d299a8 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeSetBehaviorContainer.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeSetBehaviorContainer.cpp @@ -1,5 +1,6 @@ #include "TimeSetBehaviorContainer.h" +using namespace PPT; void CRecordTimeSetBehaviorContainer::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeSetBehaviorContainer.h b/MsBinaryFile/PptFile/Records/Animations/TimeSetBehaviorContainer.h index 96f265fa39..81f2335bf0 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeSetBehaviorContainer.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeSetBehaviorContainer.h @@ -43,28 +43,7 @@ namespace PPT class CRecordTimeSetBehaviorContainer : public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - - LONG lPos = 0; StreamUtils::StreamPosition ( lPos, pStream ); - - //UINT res = 0; - SRecordHeader ReadHeader; - if ( ReadHeader.ReadFromStream(pStream) ) - m_oSetBehaviorAtom.ReadFromStream ( ReadHeader, pStream ); - - //if ( m_oSetBehaviorAtom.m_bToPropertyUsed ) - //{ - if ( ReadHeader.ReadFromStream(pStream) ) - m_oVarTo.ReadFromStream ( ReadHeader, pStream ); - //} - - if ( ReadHeader.ReadFromStream(pStream) ) - m_oBehavior.ReadFromStream ( ReadHeader, pStream ); - - StreamUtils::StreamSeek ( lPos + m_oHeader.RecLen, pStream ); - } + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; public: diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeStringListContainer.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeStringListContainer.cpp index 288bb3b956..6831a0287d 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeStringListContainer.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeStringListContainer.cpp @@ -1,5 +1,6 @@ #include "TimeStringListContainer.h" +using namespace PPT; void CRecordTimeStringListContainer::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeStringListContainer.h b/MsBinaryFile/PptFile/Records/Animations/TimeStringListContainer.h index 3a6f861c1d..e1a4809a1a 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeStringListContainer.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeStringListContainer.h @@ -31,7 +31,6 @@ */ #pragma once - #include "../../Reader/Records.h" #include "TimeVariant.h" @@ -41,31 +40,8 @@ namespace PPT class CRecordTimeStringListContainer : public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; - LONG lPos(0); StreamUtils::StreamPosition(lPos, pStream); - - UINT lCurLen = 0; - SRecordHeader ReadHeader; - - while ( lCurLen < m_oHeader.RecLen ) - { - if (ReadHeader.ReadFromStream(pStream) == false) - break; - - CRecordTimeVariantString Element; - Element.ReadFromStream ( ReadHeader, pStream ); - lCurLen += 8 + ReadHeader.RecLen; - - - m_arrRgChildRec.push_back ( Element ); - } - StreamUtils::StreamSeek(lPos + m_oHeader.RecLen, pStream); - } - -public: std::vector m_arrRgChildRec; }; diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeVariant.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeVariant.cpp index 7cae0500f2..1cfc143a18 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeVariant.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeVariant.cpp @@ -73,3 +73,90 @@ CRecordTimeVariant* PPT::TimeVariantFactoryMethod(SRecordHeader & oHeader, POLE: return pTimeVariant; } + +void CRecordTimeVariant::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) +{ + m_oHeader = oHeader; + + m_Type = ( TimeVariantTypeEnum )StreamUtils::ReadBYTE ( pStream ); +} + +CRecordTimeVariant::~CRecordTimeVariant() +{ + +} + +CRecordTimeVariant &CRecordTimeVariant::operator=(const CRecordTimeVariant &src) +{ + CUnknownRecord::operator=(src); + m_Type = src.m_Type; + + return *this; +} + +void CRecordTimeVariantBool::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) +{ + CRecordTimeVariant::ReadFromStream(oHeader, pStream); + m_Value = ( 0x1 == StreamUtils::ReadBYTE ( pStream ) ); +} + +CRecordTimeVariant &CRecordTimeVariantBool::operator=(const CRecordTimeVariant &src) +{ + CRecordTimeVariant::operator=(src); + m_Value = dynamic_cast(src).m_Value; + + return *this; +} + +void CRecordTimeVariantInt::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) +{ + CRecordTimeVariant::ReadFromStream(oHeader, pStream); + m_Value = StreamUtils::ReadDWORD ( pStream ); +} + +CRecordTimeVariant &CRecordTimeVariantInt::operator=(const CRecordTimeVariant &src) +{ + CRecordTimeVariant::operator=(src); + m_Value = dynamic_cast(src).m_Value; + + return *this; +} + +void CRecordTimeVariantFloat::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) +{ + CRecordTimeVariant::ReadFromStream(oHeader, pStream); + m_Value = StreamUtils::ReadFLOAT ( pStream ); +} + +CRecordTimeVariant &CRecordTimeVariantFloat::operator=(const CRecordTimeVariant &src) +{ + CRecordTimeVariant::operator=(src); + m_Value = dynamic_cast(src).m_Value; + + return *this; +} + +void CRecordTimeVariantString::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) +{ + if (oHeader.RecLen == 0) + return; + + LONG lPos; StreamUtils::StreamPosition(lPos, pStream); + lPos += oHeader.RecLen; + + CRecordTimeVariant::ReadFromStream(oHeader, pStream); + int strLen = m_oHeader.RecLen / 2 - 1; + if (strLen > 0) + { + m_Value = StreamUtils::ReadStringW(pStream, strLen); + } + StreamUtils::StreamSeek(lPos, pStream); +} + +CRecordTimeVariant &CRecordTimeVariantString::operator=(const CRecordTimeVariant &src) +{ + CRecordTimeVariant::operator=(src); + m_Value = dynamic_cast(src).m_Value; + + return *this; +} diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeVariant.h b/MsBinaryFile/PptFile/Records/Animations/TimeVariant.h index a024b2deda..d934071d7a 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeVariant.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeVariant.h @@ -43,22 +43,11 @@ class CRecordTimeVariant : public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )override; - m_Type = ( TimeVariantTypeEnum )StreamUtils::ReadBYTE ( pStream ); - } + virtual ~CRecordTimeVariant(); - virtual ~CRecordTimeVariant(){} - - virtual CRecordTimeVariant& operator=(const CRecordTimeVariant& src) - { - CUnknownRecord::operator=(src); - m_Type = src.m_Type; - - return *this; - } + virtual CRecordTimeVariant &operator=(const CRecordTimeVariant& src) ; public: TimeVariantTypeEnum m_Type; @@ -68,19 +57,9 @@ public: class CRecordTimeVariantBool : public CRecordTimeVariant { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - CRecordTimeVariant::ReadFromStream(oHeader, pStream); - m_Value = ( 0x1 == StreamUtils::ReadBYTE ( pStream ) ); - } + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; - virtual CRecordTimeVariant& operator=(const CRecordTimeVariant& src) - { - CRecordTimeVariant::operator=(src); - m_Value = dynamic_cast(src).m_Value; - - return *this; - } + virtual CRecordTimeVariant& operator=(const CRecordTimeVariant& src) override; virtual ~CRecordTimeVariantBool(){} @@ -91,19 +70,9 @@ public: class CRecordTimeVariantInt : public CRecordTimeVariant { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - CRecordTimeVariant::ReadFromStream(oHeader, pStream); - m_Value = StreamUtils::ReadDWORD ( pStream ); - } + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )override; - virtual CRecordTimeVariant& operator=(const CRecordTimeVariant& src) - { - CRecordTimeVariant::operator=(src); - m_Value = dynamic_cast(src).m_Value; - - return *this; - } + virtual CRecordTimeVariant& operator=(const CRecordTimeVariant& src) override; virtual ~CRecordTimeVariantInt(){} @@ -114,21 +83,9 @@ public: class CRecordTimeVariantFloat : public CRecordTimeVariant { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - CRecordTimeVariant::ReadFromStream(oHeader, pStream); - m_Value = StreamUtils::ReadFLOAT ( pStream ); - } + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; - virtual CRecordTimeVariant& operator=(const CRecordTimeVariant& src) - { - CRecordTimeVariant::operator=(src); - m_Value = dynamic_cast(src).m_Value; - - return *this; - } - - virtual ~CRecordTimeVariantFloat(){} + virtual CRecordTimeVariant& operator=(const CRecordTimeVariant& src) override; public: FLOAT m_Value; @@ -137,33 +94,9 @@ public: class CRecordTimeVariantString : public CRecordTimeVariant { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - if (oHeader.RecLen == 0) - return; - - LONG lPos; StreamUtils::StreamPosition(lPos, pStream); - lPos += oHeader.RecLen; - - CRecordTimeVariant::ReadFromStream(oHeader, pStream); - int strLen = m_oHeader.RecLen / 2 - 1; - if (strLen > 0) - { - m_Value = StreamUtils::ReadStringW(pStream, strLen); - } - StreamUtils::StreamSeek(lPos, pStream); - } - - virtual CRecordTimeVariant& operator=(const CRecordTimeVariant& src) - { - CRecordTimeVariant::operator=(src); - m_Value = dynamic_cast(src).m_Value; - - return *this; - } - - virtual ~CRecordTimeVariantString(){} + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; + virtual CRecordTimeVariant& operator=(const CRecordTimeVariant& src) override; public: std::wstring m_Value; diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeVariant4Behavior.cpp b/MsBinaryFile/PptFile/Records/Animations/TimeVariant4Behavior.cpp index 2bb6ba2a92..0effb2c95c 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeVariant4Behavior.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/TimeVariant4Behavior.cpp @@ -1,5 +1,6 @@ #include "TimeVariant4Behavior.h" +using namespace PPT; //------------------------------------------------------------------------------- #define CREATE_BY_Instanse(RECORD_Instanse, CLASS_RECORD_NAME) \ diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeVariant4Behavior.h b/MsBinaryFile/PptFile/Records/Animations/TimeVariant4Behavior.h index 52148c67e0..a2bee56d47 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeVariant4Behavior.h +++ b/MsBinaryFile/PptFile/Records/Animations/TimeVariant4Behavior.h @@ -31,43 +31,16 @@ */ #pragma once - #include "../../Reader/Records.h" #include "../../Enums/_includer.h" #include "TimeVariant.h" -//------------------------------------------------------------------------------- -#define CREATE_BY_Instanse(RECORD_Instanse, CLASS_RECORD_NAME) \ - case RECORD_Instanse: { pRecord = new CLASS_RECORD_NAME(); break; } \ -//------------------------------------------------------------------------------- - - namespace PPT { -//TODO class FactoryTimeVariant4Behavior { public: - static IRecord* createByInstanse(unsigned short recInstance) - { - IRecord* pRecord = nullptr; - - switch (recInstance) - { - CREATE_BY_Instanse(TL_TBPID_UnknownPropertyList, CRecordTimeVariantString) - CREATE_BY_Instanse(TL_TBPID_RuntimeContext, CRecordTimeRuntimeContext) - CREATE_BY_Instanse(TL_TBPID_MotionPathEditRelative, CRecordTimeVariantBool) - CREATE_BY_Instanse(TL_TBPID_ColorColorModel, CRecordTimeColorModel) - CREATE_BY_Instanse(TL_TBPID_ColorDirection, CRecordTimeColorDirection) - CREATE_BY_Instanse(TL_TBPID_Override, CRecordTimeOverride) - CREATE_BY_Instanse(TL_TBPID_PathEditRotationAngle, CRecordTimeVariantFloat) - CREATE_BY_Instanse(TL_TBPID_PathEditRotationX, CRecordTimeVariantFloat) - CREATE_BY_Instanse(TL_TBPID_PathEditRotationY, CRecordTimeVariantFloat) - CREATE_BY_Instanse(TL_TBPID_PointsTypes, CRecordTimePointsTypes) - } - - return pRecord; - } + static IRecord* createByInstanse(unsigned short recInstance); }; } diff --git a/MsBinaryFile/PptFile/Records/Animations/VisualPageAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/VisualPageAtom.cpp index df0ee5f727..d74f5ce6b8 100644 --- a/MsBinaryFile/PptFile/Records/Animations/VisualPageAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/VisualPageAtom.cpp @@ -1,5 +1,6 @@ #include "VisualPageAtom.h" +using namespace PPT; void CRecordVisualPageAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/VisualPageAtom.h b/MsBinaryFile/PptFile/Records/Animations/VisualPageAtom.h index 79f9f89026..4726d21e51 100644 --- a/MsBinaryFile/PptFile/Records/Animations/VisualPageAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/VisualPageAtom.h @@ -31,24 +31,17 @@ */ #pragma once - #include "../../Reader/Records.h" #include "../../Enums/_includer.h" + namespace PPT { class CRecordVisualPageAtom : public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; - m_eType = (TimeVisualElementEnum) StreamUtils::ReadDWORD ( pStream ); - } - - -public: TimeVisualElementEnum m_eType; }; diff --git a/MsBinaryFile/PptFile/Records/Animations/VisualShapeAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/VisualShapeAtom.cpp index f4f7abd52a..71abf5eaa5 100644 --- a/MsBinaryFile/PptFile/Records/Animations/VisualShapeAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/VisualShapeAtom.cpp @@ -1,5 +1,6 @@ #include "VisualShapeAtom.h" +using namespace PPT; void CRecordVisualShapeAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/VisualShapeAtom.h b/MsBinaryFile/PptFile/Records/Animations/VisualShapeAtom.h index 2df0c69292..c0f614a17b 100644 --- a/MsBinaryFile/PptFile/Records/Animations/VisualShapeAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/VisualShapeAtom.h @@ -42,19 +42,8 @@ class CRecordVisualShapeAtom : public CUnknownRecord { public: // Привязка анимации через этот объект к ID объекту + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - - m_Type = (TimeVisualElementEnum) StreamUtils::ReadDWORD ( pStream ); - m_RefType = (ElementTypeEnum) StreamUtils::ReadDWORD ( pStream ); - m_nObjectIdRef = StreamUtils::ReadDWORD ( pStream ); - m_nData1 = StreamUtils::ReadDWORD ( pStream ); - m_nData2 = StreamUtils::ReadDWORD ( pStream ); - } - -public: TimeVisualElementEnum m_Type; ElementTypeEnum m_RefType; diff --git a/MsBinaryFile/PptFile/Records/Animations/VisualShapeChartElementAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/VisualShapeChartElementAtom.cpp index 85db6688d9..853fc8f581 100644 --- a/MsBinaryFile/PptFile/Records/Animations/VisualShapeChartElementAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/VisualShapeChartElementAtom.cpp @@ -1,5 +1,6 @@ #include "VisualShapeChartElementAtom.h" +using namespace PPT; void CRecordVisualShapeChartElementAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/VisualShapeChartElementAtom.h b/MsBinaryFile/PptFile/Records/Animations/VisualShapeChartElementAtom.h index ba40a7b31a..d87bd43c5b 100644 --- a/MsBinaryFile/PptFile/Records/Animations/VisualShapeChartElementAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/VisualShapeChartElementAtom.h @@ -40,17 +40,7 @@ namespace PPT class CRecordVisualShapeChartElementAtom : public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - - m_eType = (TimeVisualElementEnum)StreamUtils::ReadDWORD(pStream); - m_eRefType = (ElementTypeEnum)StreamUtils::ReadDWORD(pStream); - - m_nShapeIdRef = StreamUtils::ReadDWORD(pStream); - m_nData1 = StreamUtils::ReadDWORD(pStream); - m_nData2 = StreamUtils::ReadDWORD(pStream); - } + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; public: TimeVisualElementEnum m_eType; diff --git a/MsBinaryFile/PptFile/Records/Animations/VisualShapeGeneralAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/VisualShapeGeneralAtom.cpp index 0c572f68f3..96fb4a003f 100644 --- a/MsBinaryFile/PptFile/Records/Animations/VisualShapeGeneralAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/VisualShapeGeneralAtom.cpp @@ -1,5 +1,6 @@ #include "VisualShapeGeneralAtom.h" +using namespace PPT; void CRecordVisualShapeGeneralAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/VisualShapeGeneralAtom.h b/MsBinaryFile/PptFile/Records/Animations/VisualShapeGeneralAtom.h index a927dfc114..e583b780f3 100644 --- a/MsBinaryFile/PptFile/Records/Animations/VisualShapeGeneralAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/VisualShapeGeneralAtom.h @@ -31,7 +31,6 @@ */ #pragma once - #include "../../Reader/Records.h" #include "../../Enums/_includer.h" @@ -41,24 +40,14 @@ namespace PPT class CRecordVisualShapeGeneralAtom : public CUnknownRecord { public: - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - m_eType = (TimeVisualElementEnum)StreamUtils::ReadDWORD(pStream); - m_eRefType = (ElementTypeEnum)StreamUtils::ReadDWORD(pStream); + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; - m_nShapeIdRef = StreamUtils::ReadDWORD(pStream); - m_nData1 = StreamUtils::ReadDWORD(pStream); - m_nData2 = StreamUtils::ReadDWORD(pStream); - } -public: TimeVisualElementEnum m_eType; ElementTypeEnum m_eRefType; _UINT32 m_nShapeIdRef; _INT32 m_nData1; _INT32 m_nData2; - }; } diff --git a/MsBinaryFile/PptFile/Records/Animations/VisualSoundAtom.cpp b/MsBinaryFile/PptFile/Records/Animations/VisualSoundAtom.cpp index b3baeb52e0..4c9741a924 100644 --- a/MsBinaryFile/PptFile/Records/Animations/VisualSoundAtom.cpp +++ b/MsBinaryFile/PptFile/Records/Animations/VisualSoundAtom.cpp @@ -1,5 +1,6 @@ #include "VisualSoundAtom.h" +using namespace PPT; void CRecordVisualSoundAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Animations/VisualSoundAtom.h b/MsBinaryFile/PptFile/Records/Animations/VisualSoundAtom.h index 9e7b6b89f1..2b60545736 100644 --- a/MsBinaryFile/PptFile/Records/Animations/VisualSoundAtom.h +++ b/MsBinaryFile/PptFile/Records/Animations/VisualSoundAtom.h @@ -42,19 +42,8 @@ class CRecordVisualSoundAtom : public CUnknownRecord { public: // Привязка звука через этот объект к ID объекту + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - - m_eType = (TimeVisualElementEnum) StreamUtils::ReadDWORD ( pStream ); - m_eRefType = (ElementTypeEnum) StreamUtils::ReadDWORD ( pStream ); - m_nSoundIdRef = StreamUtils::ReadDWORD ( pStream ); - m_nData1 = StreamUtils::ReadDWORD ( pStream ); - m_nData2 = StreamUtils::ReadDWORD ( pStream ); - } - -public: TimeVisualElementEnum m_eType; ElementTypeEnum m_eRefType; diff --git a/MsBinaryFile/PptFile/Records/BlipCollection9Container.cpp b/MsBinaryFile/PptFile/Records/BlipCollection9Container.cpp index 90567203c8..eb34be0b43 100644 --- a/MsBinaryFile/PptFile/Records/BlipCollection9Container.cpp +++ b/MsBinaryFile/PptFile/Records/BlipCollection9Container.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "BlipCollection9Container.h" +using namespace PPT; void CRecordBlipCollection9Container::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/BlipCollection9Container.h b/MsBinaryFile/PptFile/Records/BlipCollection9Container.h index b4c7d05908..9b50d939c6 100644 --- a/MsBinaryFile/PptFile/Records/BlipCollection9Container.h +++ b/MsBinaryFile/PptFile/Records/BlipCollection9Container.h @@ -30,48 +30,18 @@ * */ #pragma once + #include "BlipEntityAtom.h" #include namespace PPT { - class CRecordBlipCollection9Container : public CUnknownRecord { public: std::vector > m_rgBlipEntityAtom; - CRecordBlipCollection9Container() - { - } - - ~CRecordBlipCollection9Container() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - LONG lPos = 0; - StreamUtils::StreamPosition ( lPos, pStream ); - - _UINT32 lCurLen = 0; - - SRecordHeader ReadHeader; - - while ( lCurLen < m_oHeader.RecLen ) - { - if ( ReadHeader.ReadFromStream(pStream) == false) - break; - - lCurLen += 8 + ReadHeader.RecLen; - - std::shared_ptr pRec(new CRecordBlipEntityAtom); - pRec->ReadFromStream(ReadHeader, pStream); - m_rgBlipEntityAtom.push_back(pRec); - } - StreamUtils::StreamSeek(lPos + m_oHeader.RecLen, pStream); - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); }; } diff --git a/MsBinaryFile/PptFile/Records/BlipEntityAtom.h b/MsBinaryFile/PptFile/Records/BlipEntityAtom.h index e5b75db1c6..2b9ac188f8 100644 --- a/MsBinaryFile/PptFile/Records/BlipEntityAtom.h +++ b/MsBinaryFile/PptFile/Records/BlipEntityAtom.h @@ -35,25 +35,25 @@ namespace PPT { - class CRecordBlipEntityAtom : public CUnknownRecord - { - public: +class CRecordBlipEntityAtom : public CUnknownRecord +{ +public: + + CRecordBlipEntityAtom(); + const std::wstring getTmpImgPath() const; + const std::wstring getImgExtention() const; + ~CRecordBlipEntityAtom(); - CRecordBlipEntityAtom(); - const std::wstring getTmpImgPath() const; - const std::wstring getImgExtention() const; - ~CRecordBlipEntityAtom(); - - void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; + void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; - private: - bool writeImage(); - std::wstring getTempFolder()const; +private: + bool writeImage(); + std::wstring getTempFolder()const; - private: - BYTE m_nWinBlipType; - CRecordOfficeArtBlip m_oBlip; - std::wstring m_tmpFolder; - }; +private: + BYTE m_nWinBlipType; + CRecordOfficeArtBlip m_oBlip; + std::wstring m_tmpFolder; +}; } diff --git a/MsBinaryFile/PptFile/Records/BookmarkEntityAtom.cpp b/MsBinaryFile/PptFile/Records/BookmarkEntityAtom.cpp index aa282fad90..7ed1df3f5a 100644 --- a/MsBinaryFile/PptFile/Records/BookmarkEntityAtom.cpp +++ b/MsBinaryFile/PptFile/Records/BookmarkEntityAtom.cpp @@ -1,5 +1,6 @@ #include "BookmarkEntityAtom.h" +using namespace PPT; void CRecordBookmarkEntityAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/BookmarkEntityAtom.h b/MsBinaryFile/PptFile/Records/BookmarkEntityAtom.h index 659b07b8cd..64090df7cf 100644 --- a/MsBinaryFile/PptFile/Records/BookmarkEntityAtom.h +++ b/MsBinaryFile/PptFile/Records/BookmarkEntityAtom.h @@ -34,24 +34,12 @@ namespace PPT { - class CRecordBookmarkEntityAtom : public CUnknownRecord - { - public: - UINT m_nID; - std::wstring m_strName; +class CRecordBookmarkEntityAtom : public CUnknownRecord +{ +public: + UINT m_nID = 0; + std::wstring m_strName; - CRecordBookmarkEntityAtom() - { - } - - ~CRecordBookmarkEntityAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - return CUnknownRecord::ReadFromStream(oHeader, pStream); - } - - }; + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); +}; } diff --git a/MsBinaryFile/PptFile/Records/BookmarkSeedAtom.cpp b/MsBinaryFile/PptFile/Records/BookmarkSeedAtom.cpp index deb8002ed3..d678f03986 100644 --- a/MsBinaryFile/PptFile/Records/BookmarkSeedAtom.cpp +++ b/MsBinaryFile/PptFile/Records/BookmarkSeedAtom.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "BookmarkSeedAtom.h" +using namespace PPT; void CRecordBookmarkSeedAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/BookmarkSeedAtom.h b/MsBinaryFile/PptFile/Records/BookmarkSeedAtom.h index 54e945f446..1f26ac8966 100644 --- a/MsBinaryFile/PptFile/Records/BookmarkSeedAtom.h +++ b/MsBinaryFile/PptFile/Records/BookmarkSeedAtom.h @@ -34,23 +34,12 @@ namespace PPT { - class CRecordBookmarkSeedAtom : public CUnknownRecord - { - public: - INT m_nBookmarkID; +class CRecordBookmarkSeedAtom : public CUnknownRecord +{ +public: + INT m_nBookmarkID = -1; - CRecordBookmarkSeedAtom() - { - } - ~CRecordBookmarkSeedAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - return CUnknownRecord::ReadFromStream(oHeader, pStream); - } - - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); +}; +} diff --git a/MsBinaryFile/PptFile/Records/BuildAtom.cpp b/MsBinaryFile/PptFile/Records/BuildAtom.cpp index 9c5b6bd6da..8bd1d13f85 100644 --- a/MsBinaryFile/PptFile/Records/BuildAtom.cpp +++ b/MsBinaryFile/PptFile/Records/BuildAtom.cpp @@ -1,36 +1,7 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "BuildAtom.h" +using namespace PPT; + void CRecordBuildAtom::ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) { m_oHeader = oHeader; diff --git a/MsBinaryFile/PptFile/Records/BuildAtom.h b/MsBinaryFile/PptFile/Records/BuildAtom.h index e6efb23b2e..8e13aee06d 100644 --- a/MsBinaryFile/PptFile/Records/BuildAtom.h +++ b/MsBinaryFile/PptFile/Records/BuildAtom.h @@ -32,42 +32,18 @@ #pragma once #include "../Reader/Records.h" -enum BuildTypeEnum : _UINT32 +namespace PPT { - TL_BuildParagraph, - TL_BuildChart, - TL_BuildDiagram -}; - class CRecordBuildAtom : public CUnknownRecord { public: - BuildTypeEnum m_BuildType; - _UINT32 m_BuildId; - _UINT32 m_ShapeIdRef; - bool m_fExpanded; - bool m_fUIExpanded; -public: + BuildTypeEnum m_BuildType = TL_BuildParagraph; + _UINT32 m_BuildId = 0; + _UINT32 m_ShapeIdRef = 0; + bool m_fExpanded = false; + bool m_fUIExpanded = false; - CRecordBuildAtom() - { - } - ~CRecordBuildAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_BuildType = (BuildTypeEnum)StreamUtils::ReadDWORD(pStream); - m_BuildId = StreamUtils::ReadDWORD(pStream); - m_ShapeIdRef = StreamUtils::ReadDWORD(pStream); - - m_fExpanded = StreamUtils::ReadBYTE(pStream); - m_fUIExpanded = StreamUtils::ReadBYTE(pStream); - - StreamUtils::StreamSkip(2, pStream); - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)override; }; +} diff --git a/MsBinaryFile/PptFile/Records/CFMasks.cpp b/MsBinaryFile/PptFile/Records/CFMasks.cpp index 65d9928aae..c8206dd287 100644 --- a/MsBinaryFile/PptFile/Records/CFMasks.cpp +++ b/MsBinaryFile/PptFile/Records/CFMasks.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "CFMasks.h" +using namespace PPT; void SCFMasks::ReadFromStream(POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/CFMasks.h b/MsBinaryFile/PptFile/Records/CFMasks.h index 34a7aef1a8..d124896a8d 100644 --- a/MsBinaryFile/PptFile/Records/CFMasks.h +++ b/MsBinaryFile/PptFile/Records/CFMasks.h @@ -63,40 +63,6 @@ struct SCFMasks // reserved 5 bits - void ReadFromStream(POLE::Stream* pStream) - { - BYTE data1 = StreamUtils::ReadBYTE(pStream); - BYTE data2 = StreamUtils::ReadBYTE(pStream); - BYTE data3 = StreamUtils::ReadBYTE(pStream); - BYTE data4 = StreamUtils::ReadBYTE(pStream); - - m_bold = 0x01 == (0x01 & data1); - m_italic = 0x02 == (0x02 & data1); - m_underline = 0x04 == (0x04 & data1); - // unused - m_shadow = 0x10 == (0x10 & data1); - m_fehint = 0x20 == (0x20 & data1); - // unused2 - m_kumi = 0x80 == (0x80 & data1); - // unused3 - - m_emboss = 0x02 == (0x02 & data2); - m_fHasStyle = 0x3C & data2; // 4 bits - // unused 2 bits - - m_typeface = 0x01 == (0x01 & data3); - m_size = 0x02 == (0x02 & data3); - m_color = 0x04 == (0x04 & data3); - m_position = 0x08 == (0x08 & data3); - m_pp10ext = 0x10 == (0x10 & data3); - m_oldEATypeface = 0x20 == (0x20 & data3); - m_ansiTypeface = 0x40 == (0x40 & data3); - m_symbolTypeface = 0x80 == (0x80 & data3); - - m_newEATypeface = 0x01 == (0x01 & data4); - m_csTypeface = 0x02 == (0x02 & data4); - m_pp11ext = 0x04 == (0x04 & data4); - // reserved 5 bits - } + void ReadFromStream(POLE::Stream* pStream); }; } diff --git a/MsBinaryFile/PptFile/Records/CString.cpp b/MsBinaryFile/PptFile/Records/CString.cpp index b27e3b8678..4fba36d54c 100644 --- a/MsBinaryFile/PptFile/Records/CString.cpp +++ b/MsBinaryFile/PptFile/Records/CString.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "CString.h" +using namespace PPT; void CRecordCString::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/CString.h b/MsBinaryFile/PptFile/Records/CString.h index b8fdb50c8d..1ed201f15b 100644 --- a/MsBinaryFile/PptFile/Records/CString.h +++ b/MsBinaryFile/PptFile/Records/CString.h @@ -31,28 +31,16 @@ */ #pragma once #include "../Reader/Records.h" -#include + namespace PPT { - class CRecordCString : public CUnknownRecord - { - public: - std::wstring m_strText; +class CRecordCString : public CUnknownRecord +{ +public: + std::wstring m_strText; - CRecordCString() - { - } - ~CRecordCString() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - m_strText = StreamUtils::ReadStringW(pStream, m_oHeader.RecLen / 2); - } - - }; + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; } diff --git a/MsBinaryFile/PptFile/Records/ColorSchemeAtom.cpp b/MsBinaryFile/PptFile/Records/ColorSchemeAtom.cpp index cb82268483..363c040ff8 100644 --- a/MsBinaryFile/PptFile/Records/ColorSchemeAtom.cpp +++ b/MsBinaryFile/PptFile/Records/ColorSchemeAtom.cpp @@ -1,5 +1,7 @@ #include "ColorSchemeAtom.h" +using namespace PPT; +using namespace ODRAW; void CRecordColorSchemeAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/ColorSchemeAtom.h b/MsBinaryFile/PptFile/Records/ColorSchemeAtom.h index 2df99781b1..faf4e6efc6 100644 --- a/MsBinaryFile/PptFile/Records/ColorSchemeAtom.h +++ b/MsBinaryFile/PptFile/Records/ColorSchemeAtom.h @@ -30,88 +30,28 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordColorSchemeAtom : public CUnknownRecord - { - ODRAW::SColorAtom m_oBackgroundColor; - ODRAW::SColorAtom m_oTextAndLinesColor; - ODRAW::SColorAtom m_oShadowsColor; - ODRAW::SColorAtom m_oTitleTextColor; - ODRAW::SColorAtom m_oFillsColor; - ODRAW::SColorAtom m_oAccentColor; - ODRAW::SColorAtom m_oAccentAndHyperlinkColor; - ODRAW::SColorAtom m_oAccentAndFollowingHyperlinkColor; +class CRecordColorSchemeAtom : public CUnknownRecord +{ +public: + ODRAW::SColorAtom m_oBackgroundColor; + ODRAW::SColorAtom m_oTextAndLinesColor; + ODRAW::SColorAtom m_oShadowsColor; + ODRAW::SColorAtom m_oTitleTextColor; + ODRAW::SColorAtom m_oFillsColor; + ODRAW::SColorAtom m_oAccentColor; + ODRAW::SColorAtom m_oAccentAndHyperlinkColor; + ODRAW::SColorAtom m_oAccentAndFollowingHyperlinkColor; - public: - CRecordColorSchemeAtom() - { - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); - ~CRecordColorSchemeAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - NSStreamReader::Read(pStream, m_oBackgroundColor); - NSStreamReader::Read(pStream, m_oTextAndLinesColor); - NSStreamReader::Read(pStream, m_oShadowsColor); - NSStreamReader::Read(pStream, m_oTitleTextColor); - NSStreamReader::Read(pStream, m_oFillsColor); - NSStreamReader::Read(pStream, m_oAccentColor); - NSStreamReader::Read(pStream, m_oAccentAndHyperlinkColor); - NSStreamReader::Read(pStream, m_oAccentAndFollowingHyperlinkColor); - } - - void ToArray(std::vector* pArray) - { - if (NULL != pArray) - { - pArray->push_back(m_oBackgroundColor); - pArray->push_back(m_oTextAndLinesColor); - pArray->push_back(m_oShadowsColor); - pArray->push_back(m_oTitleTextColor); - pArray->push_back(m_oFillsColor); - pArray->push_back(m_oAccentColor); - pArray->push_back(m_oAccentAndHyperlinkColor); - pArray->push_back(m_oAccentAndFollowingHyperlinkColor); - } - } - void ToArray(std::vector* pArray) - { - ODRAW::CColor oColor; - if (NULL != pArray) - { - m_oBackgroundColor.ToColor(&oColor); - pArray->push_back(oColor); - - m_oTextAndLinesColor.ToColor(&oColor); - pArray->push_back(oColor); - - m_oShadowsColor.ToColor(&oColor); - pArray->push_back(oColor); - - m_oTitleTextColor.ToColor(&oColor); - pArray->push_back(oColor); - - m_oFillsColor.ToColor(&oColor); - pArray->push_back(oColor); - - m_oAccentColor.ToColor(&oColor); - pArray->push_back(oColor); - - m_oAccentAndHyperlinkColor.ToColor(&oColor); - pArray->push_back(oColor); - - m_oAccentAndFollowingHyperlinkColor.ToColor(&oColor); - pArray->push_back(oColor); - } - } - }; -} \ No newline at end of file + void ToArray(std::vector* pArray); + void ToArray(std::vector* pArray); +}; +} diff --git a/MsBinaryFile/PptFile/Records/Comment10Container.cpp b/MsBinaryFile/PptFile/Records/Comment10Container.cpp index bc917c864b..056465a3b7 100644 --- a/MsBinaryFile/PptFile/Records/Comment10Container.cpp +++ b/MsBinaryFile/PptFile/Records/Comment10Container.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "Comment10Container.h" +using namespace PPT; void CRecordComment10AuthorAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/Comment10Container.h b/MsBinaryFile/PptFile/Records/Comment10Container.h index 51d25842c3..994ad55ed3 100644 --- a/MsBinaryFile/PptFile/Records/Comment10Container.h +++ b/MsBinaryFile/PptFile/Records/Comment10Container.h @@ -41,12 +41,7 @@ namespace PPT class CRecordComment10AuthorAtom : public CUnknownRecord { public: - void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override - { - m_oHeader = oHeader; - - m_sCommentAuthor = StreamUtils::ReadStringW(pStream, m_oHeader.RecLen); - } + void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; public: std::wstring m_sCommentAuthor; @@ -55,12 +50,7 @@ public: class CRecordComment10TextAtom : public CUnknownRecord { public: - void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override - { - m_oHeader = oHeader; - - m_sCommentText = StreamUtils::ReadStringW(pStream, m_oHeader.RecLen); - } + void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; public: std::wstring m_sCommentText; @@ -69,12 +59,7 @@ public: class CRecordComment10AuthorInitialAtom : public CUnknownRecord { public: - void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override - { - m_oHeader = oHeader; - - m_sCommentAuthorInitials = StreamUtils::ReadStringW(pStream, m_oHeader.RecLen); - } + void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; public: std::wstring m_sCommentAuthorInitials; @@ -83,17 +68,10 @@ public: class CRecordComment10Atom : public CUnknownRecord { public: - void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override - { - m_oHeader = oHeader; - - m_nIndex = StreamUtils::ReadLONG(pStream); - m_oDatetime.ReadFromStream(pStream); - m_oAnchor.ReadFromStream(pStream); - } + void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; public: - _INT32 m_nIndex; + _INT32 m_nIndex = -1; DateTimeStruct m_oDatetime; PointStruct m_oAnchor; }; @@ -103,70 +81,11 @@ class CRecordComment10Container : public CUnknownRecord { public: - CRecordComment10Container() : - m_pCommentAuthorAtom(nullptr), - m_pCommentTextAtom(nullptr), - m_pCommentAuthorInitialsAtom(nullptr), + CRecordComment10Container(); - m_haveAuthorAtom(false), - m_haveTextAtom(false), - m_haveAuthorInitialAtom(false) - {} + ~CRecordComment10Container(); - ~CRecordComment10Container() - { - RELEASEOBJECT(m_pCommentAuthorAtom) - RELEASEOBJECT(m_pCommentTextAtom) - RELEASEOBJECT(m_pCommentAuthorInitialsAtom) - } - - void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override - { - m_oHeader = oHeader; - - LONG lPos(0); StreamUtils::StreamPosition(lPos, pStream); - - _UINT32 lCurLen(0); - SRecordHeader ReadHeader; - - while (lCurLen < m_oHeader.RecLen) { - if ( ReadHeader.ReadFromStream(pStream) == false ) - { - break; - } - - lCurLen += 8 + ReadHeader.RecLen; - - if (ReadHeader.RecType == RT_CString) { - switch (ReadHeader.RecInstance) { - case 0: - m_pCommentAuthorAtom = new CRecordComment10AuthorAtom(); - m_pCommentAuthorAtom->ReadFromStream(ReadHeader, pStream); - m_haveAuthorAtom = true; - break; - case 1: - m_pCommentTextAtom = new CRecordComment10TextAtom(); - m_pCommentTextAtom->ReadFromStream(ReadHeader, pStream); - m_haveTextAtom = true; - break; - - case 2: - m_pCommentAuthorInitialsAtom = new CRecordComment10AuthorInitialAtom(); - m_pCommentAuthorInitialsAtom->ReadFromStream(ReadHeader, pStream); - m_haveAuthorInitialAtom = true; - break; - default: - break; - } - - } else - { - m_oCommentAtom.ReadFromStream(ReadHeader, pStream); - } - } - - StreamUtils::StreamSeek(lPos + m_oHeader.RecLen, pStream); - } + void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; public: CRecordComment10AuthorAtom* m_pCommentAuthorAtom; // OPTIONAL diff --git a/MsBinaryFile/PptFile/Records/CryptSession10Container.h b/MsBinaryFile/PptFile/Records/CryptSession10Container.h index ce0f8fd693..a7b2f8d2fb 100644 --- a/MsBinaryFile/PptFile/Records/CryptSession10Container.h +++ b/MsBinaryFile/PptFile/Records/CryptSession10Container.h @@ -31,7 +31,11 @@ */ #pragma once #include "../../XlsFile/Format/Crypt/Decryptor.h" +#include "../Reader/Records.h" + +namespace PPT +{ class CRecordEncryptedSummary : public CUnknownRecord { public: @@ -45,7 +49,7 @@ public: bool fStream; std::wstring StreamName; - virtual void ReadFromStream(SRecordHeader & oHeader, const XLS::CFStreamPtr &pStream) + virtual void ReadFromStream(SRecordHeader & oHeader, const XLS::CFStreamPtr &pStream) { m_oHeader = oHeader; @@ -193,3 +197,4 @@ public: //int sz_header = (pos_end_record - pos_start_record); } }; +} diff --git a/MsBinaryFile/PptFile/Records/CurrentUserAtom.cpp b/MsBinaryFile/PptFile/Records/CurrentUserAtom.cpp index 7b50b2e3aa..46b735f9e4 100644 --- a/MsBinaryFile/PptFile/Records/CurrentUserAtom.cpp +++ b/MsBinaryFile/PptFile/Records/CurrentUserAtom.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "CurrentUserAtom.h" +using namespace PPT; CRecordCurrentUserAtom::CRecordCurrentUserAtom() : m_nToken(0) { diff --git a/MsBinaryFile/PptFile/Records/CurrentUserAtom.h b/MsBinaryFile/PptFile/Records/CurrentUserAtom.h index 2391aca5f4..6ccfc86bad 100644 --- a/MsBinaryFile/PptFile/Records/CurrentUserAtom.h +++ b/MsBinaryFile/PptFile/Records/CurrentUserAtom.h @@ -30,84 +30,39 @@ * */ #pragma once -#include "../Records/RecordsIncluder.h" +#include "../Reader/Records.h" #define NO_ENCRYPT 0xE391C05F #define ENCRYPT 0xF3D1C4DF namespace PPT { - class CRecordCurrentUserAtom : public CUnknownRecord - { - public: - _UINT32 m_nSize; // must be 0x00000014 - _UINT32 m_nToken; // encrypt or not +class CRecordCurrentUserAtom : public CUnknownRecord +{ +public: + _UINT32 m_nSize; // must be 0x00000014 + _UINT32 m_nToken; // encrypt or not - _UINT32 m_nOffsetToCurEdit; // offset to UserEditAtom in PPTDocStream + _UINT32 m_nOffsetToCurEdit; // offset to UserEditAtom in PPTDocStream - USHORT m_nLenUserName; + USHORT m_nLenUserName; - USHORT m_nDocFileVersion; // must be 0x03F4 - BYTE m_nMajorVersion; // must be 0x03 - BYTE m_nMinorVersion; // must be 0x00 + USHORT m_nDocFileVersion; // must be 0x03F4 + BYTE m_nMajorVersion; // must be 0x03 + BYTE m_nMinorVersion; // must be 0x00 - std::string m_strANSIUserName; - std::wstring m_strUNICODEUserName; + std::string m_strANSIUserName; + std::wstring m_strUNICODEUserName; - _UINT32 m_nRelVersion; // 0x00000008 or 0x00000009 + _UINT32 m_nRelVersion; // 0x00000008 or 0x00000009 - CRecordCurrentUserAtom() : m_nToken(0) - { - m_nSize = m_nRelVersion = m_nToken = m_nOffsetToCurEdit = 0; - m_nLenUserName = m_nDocFileVersion = 0; - m_nMinorVersion = m_nMajorVersion = 0; + CRecordCurrentUserAtom(); - } + ~CRecordCurrentUserAtom(); - ~CRecordCurrentUserAtom() - { - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream * pStream) override; - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream * pStream) - { - m_oHeader = oHeader; - - m_nSize = StreamUtils::ReadDWORD(pStream); - - long sz = (long)(pStream->size() - pStream->tell()); - - if ((long)m_nSize > sz) - { - m_nSize = sz; - } - - if (m_nSize < 16) return; - - m_nToken = StreamUtils::ReadDWORD(pStream); - - m_nOffsetToCurEdit = StreamUtils::ReadDWORD(pStream); - - m_nLenUserName = StreamUtils::ReadWORD(pStream); - - m_nDocFileVersion = StreamUtils::ReadWORD(pStream); - - m_nMajorVersion = StreamUtils::ReadBYTE(pStream); - m_nMinorVersion = StreamUtils::ReadBYTE(pStream); - - StreamUtils::StreamSkip(2, pStream); - - m_strANSIUserName = StreamUtils::ReadStringA(pStream, m_nLenUserName); - - m_nRelVersion = StreamUtils::ReadDWORD(pStream); - - m_strUNICODEUserName = StreamUtils::ReadStringW(pStream, m_nLenUserName); - - } - - bool IsSupported() - { - return (NO_ENCRYPT == m_nToken); - } - }; + bool IsSupported() const; +}; } diff --git a/MsBinaryFile/PptFile/Records/DocInfoListContainer.cpp b/MsBinaryFile/PptFile/Records/DocInfoListContainer.cpp index 81a54fed2f..2812c6b741 100644 --- a/MsBinaryFile/PptFile/Records/DocInfoListContainer.cpp +++ b/MsBinaryFile/PptFile/Records/DocInfoListContainer.cpp @@ -1,37 +1,7 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ - #include "DocInfoListContainer.h" +using namespace PPT; + void DocInfoListSubContainerOrAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { switch (oHeader.RecType) diff --git a/MsBinaryFile/PptFile/Records/DocInfoListContainer.h b/MsBinaryFile/PptFile/Records/DocInfoListContainer.h index f41fb37bc4..f8157cf466 100644 --- a/MsBinaryFile/PptFile/Records/DocInfoListContainer.h +++ b/MsBinaryFile/PptFile/Records/DocInfoListContainer.h @@ -41,31 +41,7 @@ class DocInfoListSubContainerOrAtom public: nullable m_record; - void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) - { - switch (oHeader.RecType) - { - case RT_ProgTags: - { - m_record.reset(new CRecordDocProgTagsContainer); - m_record->ReadFromStream(oHeader, pStream); - break; - } - case RT_VbaInfo: - { - m_record.reset(new CRecordVBAInfoContainer); - m_record->ReadFromStream(oHeader, pStream); - break; - } -// case RT_OutlineViewInfo: -// { - -// } - default: - StreamUtils::StreamSkip(oHeader.RecLen, pStream); - break; - } - } + void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream); }; class CRecordDocInfoListContainer : public CUnknownRecord @@ -74,74 +50,13 @@ public: std::vector m_rgChildRec; public: - CRecordDocInfoListContainer() - { + CRecordDocInfoListContainer(); + virtual ~CRecordDocInfoListContainer() override; - } + virtual void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; - virtual ~CRecordDocInfoListContainer() - { - for (auto child : m_rgChildRec) - { - RELEASEOBJECT(child) - } - } + IRecord* getDocBinaryTagExtension(const std::wstring& extVersion); - virtual void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) - { - m_oHeader = oHeader; - - LONG lPos; StreamUtils::StreamPosition(lPos, pStream); - LONG lCurLen = 0; - SRecordHeader ReadHeader; - - while (lCurLen < (LONG)m_oHeader.RecLen) - { - - if (!ReadHeader.ReadFromStream(pStream)) - { - break; - } - - - lCurLen += 8 + ReadHeader.RecLen; - - auto pRec = new DocInfoListSubContainerOrAtom; - pRec->ReadFromStream(ReadHeader, pStream); - m_rgChildRec.push_back(pRec); - } - StreamUtils::StreamSeek(lPos + m_oHeader.RecLen, pStream); - } - - IRecord* getDocBinaryTagExtension(const std::wstring& extVersion) - { - for (auto* pChild : m_rgChildRec) - { - if(pChild == nullptr || pChild->m_record.IsInit() == false) - continue; - - auto* pDocProgTagsCont = dynamic_cast(pChild->m_record.GetPointer()); - if (pDocProgTagsCont == nullptr) - continue; - - return pDocProgTagsCont->getDocBinaryTagExtension(extVersion); - } - return nullptr; - } - - CRecordVBAInfoAtom* getVBAInfoAtom()const - { - for (const auto* pChild : m_rgChildRec) - { - if (!pChild || !pChild->m_record.IsInit()) - continue; - IRecord* pRecord = pChild->m_record.GetPointer(); - auto* pVBA = dynamic_cast(pRecord); - if (pVBA) - return static_cast(pVBA->m_arRecords[0]); - } - - return nullptr; - } + CRecordVBAInfoAtom* getVBAInfoAtom()const; }; } diff --git a/MsBinaryFile/PptFile/Records/DocProgTagsContainer.cpp b/MsBinaryFile/PptFile/Records/DocProgTagsContainer.cpp index b67310d6f1..2c553b4b86 100644 --- a/MsBinaryFile/PptFile/Records/DocProgTagsContainer.cpp +++ b/MsBinaryFile/PptFile/Records/DocProgTagsContainer.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "DocProgTagsContainer.h" +using namespace PPT; CRecordPP9DocBinaryTagExtension::~CRecordPP9DocBinaryTagExtension() { diff --git a/MsBinaryFile/PptFile/Records/DocProgTagsContainer.h b/MsBinaryFile/PptFile/Records/DocProgTagsContainer.h index 8bcb425f23..76236ba63c 100644 --- a/MsBinaryFile/PptFile/Records/DocProgTagsContainer.h +++ b/MsBinaryFile/PptFile/Records/DocProgTagsContainer.h @@ -55,211 +55,40 @@ public: nullable m_textDefaultsAtom; nullable m_outlineTextPropsContainer; nullable m_blipCollectionContainer; - // TODO - CRecordPP9DocBinaryTagExtension() - { - } - ~CRecordPP9DocBinaryTagExtension() - { - for (auto pEl : m_rgTextMasterStyleAtom) - { - RELEASEOBJECT(pEl) - } - } - - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - LONG lPos = 0; - StreamUtils::StreamPosition ( lPos, pStream ); - - UINT lCurLen = 0; - - SRecordHeader ReadHeader; - - while ( lCurLen < m_oHeader.RecLen ) - { - if ( ReadHeader.ReadFromStream(pStream) == false) - break; - - lCurLen += 8 + ReadHeader.RecLen; - switch (ReadHeader.RecType) - { - case RT_TextMasterStyle9Atom: - { - auto pStyle = new CRecordTextMasterStyle9Atom; - pStyle->ReadFromStream(ReadHeader, pStream); - m_rgTextMasterStyleAtom.push_back(pStyle); - break; - } - case RT_TextDefaults9Atom: - { - m_textDefaultsAtom = new CRecordTextDefaults9Atom; - m_textDefaultsAtom->ReadFromStream(ReadHeader, pStream); - break; - } - case RT_OutlineTextProps9: - { - m_outlineTextPropsContainer = new CRecordOutlineTextProps9Container; - m_outlineTextPropsContainer->ReadFromStream(ReadHeader, pStream); - break; - } - case RT_BlipCollection9: - { - m_blipCollectionContainer = new CRecordBlipCollection9Container; - m_blipCollectionContainer->ReadFromStream(ReadHeader, pStream); - break; - } - default: - IRecord* pRecord = CreateByType(ReadHeader); - pRecord->ReadFromStream(ReadHeader, pStream); - - m_arRecords.push_back(pRecord); - break; - } - - } - - StreamUtils::StreamSeek ( lPos + m_oHeader.RecLen, pStream ); - } + ~CRecordPP9DocBinaryTagExtension(); + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; }; class CRecordPP10DocBinaryTagExtension : public CUnknownRecord { public: - - CRecordPP10DocBinaryTagExtension () - { - } - - virtual ~CRecordPP10DocBinaryTagExtension () - { - - } - - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - - LONG lPos = 0; - StreamUtils::StreamPosition ( lPos, pStream ); - - StreamUtils::StreamSeek ( lPos + m_oHeader.RecLen, pStream ); - } - -public: - + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )override; }; class CRecordPP11DocBinaryTagExtension : public CUnknownRecord { public: - CRecordPP11DocBinaryTagExtension() - { - - } - - ~CRecordPP11DocBinaryTagExtension() - { - - } - - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - LONG lPos = 0; - StreamUtils::StreamPosition ( lPos, pStream ); - - StreamUtils::StreamSeek ( lPos + m_oHeader.RecLen, pStream ); - } - -public: - + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ); }; class CRecordPP12DocBinaryTagExtension : public CUnknownRecord { public: - - CRecordPP12DocBinaryTagExtension() - { - - } - - ~CRecordPP12DocBinaryTagExtension() - { - } - - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - LONG lPos = 0; - StreamUtils::StreamPosition ( lPos, pStream ); - - StreamUtils::StreamSeek ( lPos + m_oHeader.RecLen, pStream ); - } + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; }; class CRecordDocProgBinaryTagSubContainerOrAtom : public CUnknownRecord { public: - CRecordDocProgBinaryTagSubContainerOrAtom() : - m_pTagName(nullptr), m_pTagContainer(nullptr) - {} - ~CRecordDocProgBinaryTagSubContainerOrAtom() - { - RELEASEOBJECT(m_pTagName); - RELEASEOBJECT(m_pTagContainer); - } - void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override - { - m_oHeader = oHeader; - LONG lPos = 0; StreamUtils::StreamPosition(lPos, pStream); + CRecordDocProgBinaryTagSubContainerOrAtom(); + ~CRecordDocProgBinaryTagSubContainerOrAtom(); - SRecordHeader ReadHeader; - ReadHeader.ReadFromStream(pStream); - - if (m_oHeader.RecType == RT_ProgBinaryTag) - { - m_pTagName = new CRecordCString(); - m_pTagName->ReadFromStream(ReadHeader, pStream); - - SRecordHeader childHeader; - if (!childHeader.ReadFromStream(pStream)) - return; - - if (m_pTagName->m_strText == ___PPT9) { - m_pTagContainer = new CRecordPP9DocBinaryTagExtension(); - dynamic_cast - (m_pTagContainer)->ReadFromStream(childHeader, pStream); - } else if (m_pTagName->m_strText == ___PPT10) { - m_pTagContainer = new CRecordPP10DocBinaryTagExtension(); - dynamic_cast - (m_pTagContainer)->ReadFromStream(childHeader, pStream); - } else if (m_pTagName->m_strText == ___PPT11) { - m_pTagContainer = new CRecordPP11DocBinaryTagExtension(); - dynamic_cast - (m_pTagContainer)->ReadFromStream(childHeader, pStream); - } else if (m_pTagName->m_strText == ___PPT12) { - m_pTagContainer = new CRecordPP12DocBinaryTagExtension(); - dynamic_cast - (m_pTagContainer)->ReadFromStream(childHeader, pStream); - } - - } else if (m_oHeader.RecType == RT_ProgStringTag) - { - m_pTagContainer = new CRecordProgStringTagContainer(); - dynamic_cast - (m_pTagContainer)->ReadFromStream(ReadHeader, pStream); - } - LONG lSeek = lPos + m_oHeader.RecLen; - StreamUtils::StreamSeek(lSeek, pStream); - } + void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; public: CRecordCString* m_pTagName; // OPTIONAL @@ -270,59 +99,14 @@ class CRecordDocProgTagsContainer : public CUnknownRecord { public: - CRecordDocProgTagsContainer () - { - - } - - ~CRecordDocProgTagsContainer() - { - for (auto pEl : m_arrRgChildRec) - RELEASEOBJECT(pEl) - } + CRecordDocProgTagsContainer (); + ~CRecordDocProgTagsContainer(); - virtual void ReadFromStream (SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; + virtual void ReadFromStream (SRecordHeader & oHeader, POLE::Stream* pStream)override; - LONG lPos = 0; - StreamUtils::StreamPosition ( lPos, pStream ); - - LONG lCurLen(0); - SRecordHeader ReadHeader; - - while (lCurLen < (LONG)m_oHeader.RecLen) - { - if ( ReadHeader.ReadFromStream(pStream) == false) - break; - lCurLen += 8 + ReadHeader.RecLen; - CRecordDocProgBinaryTagSubContainerOrAtom* pRecord = - new CRecordDocProgBinaryTagSubContainerOrAtom(); - pRecord->ReadFromStream(ReadHeader, pStream); - m_arrRgChildRec.push_back(pRecord); - } - - StreamUtils::StreamSeek(lPos + m_oHeader.RecLen, pStream); - } - - CRecordPP9DocBinaryTagExtension* getPP9DocBinaryTagExtension() - { - for (auto* rec : m_arrRgChildRec) - if (rec->m_pTagName->m_strText == ___PPT9) - return (CRecordPP9DocBinaryTagExtension*)rec->m_pTagContainer; - - return nullptr; - } - - IRecord* getDocBinaryTagExtension(const std::wstring& extVersion) - { - for (auto* rec : m_arrRgChildRec) - if (rec->m_pTagName != nullptr && rec->m_pTagName->m_strText == extVersion) - return rec->m_pTagContainer; - - return nullptr; - } + CRecordPP9DocBinaryTagExtension* getPP9DocBinaryTagExtension(); + IRecord* getDocBinaryTagExtension(const std::wstring& extVersion); public: std::vector m_arrRgChildRec; diff --git a/MsBinaryFile/PptFile/Records/DocRoutingSlipAtom.cpp b/MsBinaryFile/PptFile/Records/DocRoutingSlipAtom.cpp index e5a235f629..6245fda625 100644 --- a/MsBinaryFile/PptFile/Records/DocRoutingSlipAtom.cpp +++ b/MsBinaryFile/PptFile/Records/DocRoutingSlipAtom.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "DocRoutingSlipAtom.h" +using namespace PPT; void CRecordDocRoutingSlipAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/DocRoutingSlipAtom.h b/MsBinaryFile/PptFile/Records/DocRoutingSlipAtom.h index 5842620cee..444bee0c2b 100644 --- a/MsBinaryFile/PptFile/Records/DocRoutingSlipAtom.h +++ b/MsBinaryFile/PptFile/Records/DocRoutingSlipAtom.h @@ -32,40 +32,31 @@ #pragma once #include "../Reader/Records.h" + namespace PPT { - class CRecordDocRoutingSlipAtom : public CUnknownRecord +class CRecordDocRoutingSlipAtom : public CUnknownRecord +{ +public: + struct SDocRoutingSlipAtom { - public: - struct SDocRoutingSlipAtom - { - USHORT m_nType; - USHORT m_nLength; - std::wstring m_strText; - }; - - UINT m_nLength; - UINT m_nRecipientCount; - UINT m_nCurrentRecipient; - USHORT m_usFlags; - - SDocRoutingSlipAtom m_oOriginatorString; - SDocRoutingSlipAtom m_oRgRecipientRoutingSlipStrings; - SDocRoutingSlipAtom m_oSubjectString; - SDocRoutingSlipAtom m_oMessageString; - - CRecordDocRoutingSlipAtom() - { - } - - ~CRecordDocRoutingSlipAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - return CUnknownRecord::ReadFromStream(oHeader, pStream); - } - + USHORT m_nType; + USHORT m_nLength; + std::wstring m_strText; }; + + UINT m_nLength; + UINT m_nRecipientCount; + UINT m_nCurrentRecipient; + USHORT m_usFlags; + + SDocRoutingSlipAtom m_oOriginatorString; + SDocRoutingSlipAtom m_oRgRecipientRoutingSlipStrings; + SDocRoutingSlipAtom m_oSubjectString; + SDocRoutingSlipAtom m_oMessageString; + + + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; + +}; } diff --git a/MsBinaryFile/PptFile/Records/DocumentAtom.cpp b/MsBinaryFile/PptFile/Records/DocumentAtom.cpp index 5f140a388f..ed3c9038a8 100644 --- a/MsBinaryFile/PptFile/Records/DocumentAtom.cpp +++ b/MsBinaryFile/PptFile/Records/DocumentAtom.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "DocumentAtom.h" +using namespace PPT; void CRecordDocumentAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/DocumentAtom.h b/MsBinaryFile/PptFile/Records/DocumentAtom.h index 3c79d7dcf8..106df203d6 100644 --- a/MsBinaryFile/PptFile/Records/DocumentAtom.h +++ b/MsBinaryFile/PptFile/Records/DocumentAtom.h @@ -30,63 +30,34 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordDocumentAtom : public CUnknownRecord - { - public: - ODRAW::SPointAtom m_oSlideSize; - ODRAW::SPointAtom m_oNotesSize; +class CRecordDocumentAtom : public CUnknownRecord +{ +public: + ODRAW::SPointAtom m_oSlideSize; + ODRAW::SPointAtom m_oNotesSize; - PPT::SRatioAtom m_oServerZoom; + SRatioAtom m_oServerZoom; + + UINT m_nNotesMasterPersistIDRef; + UINT m_nHandoutMasterPersistIDRef; + + USHORT m_nFirstSlideNum; + USHORT m_nSlideSizeType; - UINT m_nNotesMasterPersistIDRef; - UINT m_nHandoutMasterPersistIDRef; + BOOL1 m_bSaveWithFonts; + BOOL1 m_bOmitTitlePlace; - USHORT m_nFirstSlideNum; - USHORT m_nSlideSizeType; + BOOL1 m_bRightToLeft; - BOOL1 m_bSaveWithFonts; - BOOL1 m_bOmitTitlePlace; + BOOL1 m_bShowComments; - BOOL1 m_bRightToLeft; - BOOL1 m_bShowComments; - - CRecordDocumentAtom() - { - } - - ~CRecordDocumentAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_oSlideSize.X = StreamUtils::ReadLONG(pStream); - m_oSlideSize.Y = StreamUtils::ReadLONG(pStream); - - m_oNotesSize.X = StreamUtils::ReadLONG(pStream); - m_oNotesSize.Y = StreamUtils::ReadLONG(pStream); - - m_oServerZoom.Number = StreamUtils::ReadLONG(pStream); - m_oServerZoom.Denom = StreamUtils::ReadLONG(pStream); - - m_nNotesMasterPersistIDRef = (UINT)StreamUtils::ReadDWORD(pStream); - m_nHandoutMasterPersistIDRef = (UINT)StreamUtils::ReadDWORD(pStream); - - m_nFirstSlideNum = StreamUtils::ReadWORD(pStream); - m_nSlideSizeType = StreamUtils::ReadWORD(pStream); - - m_bSaveWithFonts = StreamUtils::ReadBYTE(pStream); - m_bOmitTitlePlace = StreamUtils::ReadBYTE(pStream); - m_bRightToLeft = StreamUtils::ReadBYTE(pStream); - m_bShowComments = StreamUtils::ReadBYTE(pStream); - } - - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/DocumentRecords.cpp b/MsBinaryFile/PptFile/Records/DocumentRecords.cpp index 83bb989369..8838b235fe 100644 --- a/MsBinaryFile/PptFile/Records/DocumentRecords.cpp +++ b/MsBinaryFile/PptFile/Records/DocumentRecords.cpp @@ -1,36 +1,7 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "DocumentRecords.h" -#include "SlideListWithText.h" +#include "RecordsIncluder.h" + +using namespace PPT; CRecordDocument::CRecordDocument() { diff --git a/MsBinaryFile/PptFile/Records/DocumentRecords.h b/MsBinaryFile/PptFile/Records/DocumentRecords.h index 6425a7d6a3..ba6bf9757c 100644 --- a/MsBinaryFile/PptFile/Records/DocumentRecords.h +++ b/MsBinaryFile/PptFile/Records/DocumentRecords.h @@ -30,81 +30,23 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordDocument : public CRecordsContainer - { - public: - std::vector m_arMasterPersists; - std::vector m_arNotePersists; - std::vector m_arSlidePersists; +class CRecordDocument : public CRecordsContainer +{ +public: + std::vector m_arMasterPersists; + std::vector m_arNotePersists; + std::vector m_arSlidePersists; - CRecordDocument() - { - } - ~CRecordDocument() - { - m_arMasterPersists.clear(); - m_arNotePersists.clear(); - m_arSlidePersists.clear(); - } + CRecordDocument(); + ~CRecordDocument(); - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_arMasterPersists.clear(); - m_arNotePersists.clear(); - m_arSlidePersists.clear(); - - m_arRecords.clear(); - - CRecordsContainer::ReadFromStream(oHeader, pStream); - - std::vector oArraySlideWithText; - this->GetRecordsByType(&oArraySlideWithText, true, false); - - for (size_t nIndexList = 0; nIndexList < oArraySlideWithText.size(); ++nIndexList) - { - CRecordSlideListWithText* pAtom = oArraySlideWithText[nIndexList]; - std::vector* pArray = NULL; - - switch (pAtom->m_Type) - { - case CRecordSlideListWithText::CollectionOfMasterSlides: - { - pArray = &m_arMasterPersists; - }break; - case CRecordSlideListWithText::CollectionOfNotesSlides: - { - pArray = &m_arNotePersists; - }break; - case CRecordSlideListWithText::CollectionOfSlides: - { - pArray = &m_arSlidePersists; - }break; - default: - { - // этого не может быть... - continue; - } - }; - - size_t nCountItems = pAtom->m_arSlides.size(); - for (size_t index = 0; index < nCountItems; ++index) - { - SSlidePersist oPersist; - oPersist.m_nPsrRef = pAtom->m_arSlides[index]->m_nPsrRef; - oPersist.m_nSlideID = pAtom->m_arSlides[index]->m_nSlideID; - - oPersist.m_arTextAttrs.insert(oPersist.m_arTextAttrs.end(), pAtom->m_arTextPlaceHolders[index].begin(), pAtom->m_arTextPlaceHolders[index].end()); - - pArray->push_back(oPersist); - } - } - } - }; + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; } diff --git a/MsBinaryFile/PptFile/Records/DocumentTextInfo.cpp b/MsBinaryFile/PptFile/Records/DocumentTextInfo.cpp index 4fed5cb0ce..f3e95e6611 100644 --- a/MsBinaryFile/PptFile/Records/DocumentTextInfo.cpp +++ b/MsBinaryFile/PptFile/Records/DocumentTextInfo.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "DocumentTextInfo.h" +using namespace PPT; void CRecordDocumentTextInfo::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/DocumentTextInfo.h b/MsBinaryFile/PptFile/Records/DocumentTextInfo.h index 4f4c4db1ed..082f900855 100644 --- a/MsBinaryFile/PptFile/Records/DocumentTextInfo.h +++ b/MsBinaryFile/PptFile/Records/DocumentTextInfo.h @@ -30,45 +30,21 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordDocumentTextInfo : public CRecordsContainer - { - public: +class CRecordDocumentTextInfo : public CRecordsContainer +{ +public: + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; - CRecordDocumentTextInfo() - { - } - - ~CRecordDocumentTextInfo() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - CRecordsContainer::ReadFromStream(oHeader, pStream); - } - - }; - - class CRecordFontCollection : public CRecordsContainer - { - public: - - CRecordFontCollection() - { - } - - ~CRecordFontCollection() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - CRecordsContainer::ReadFromStream(oHeader, pStream); - } - - }; -} \ No newline at end of file +class CRecordFontCollection : public CRecordsContainer +{ +public: + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/Drawing/ArtBlip.cpp b/MsBinaryFile/PptFile/Records/Drawing/ArtBlip.cpp index aaf1c92a72..b69b6b7ef3 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/ArtBlip.cpp +++ b/MsBinaryFile/PptFile/Records/Drawing/ArtBlip.cpp @@ -35,7 +35,16 @@ #include "../../Reader/PPTDocumentInfo.h" +using namespace PPT; +CRecordOfficeArtBlip::CRecordOfficeArtBlip() +{ + m_oDocumentInfo = NULL; +} + +CRecordOfficeArtBlip::~CRecordOfficeArtBlip() +{ +} void CRecordOfficeArtBlip::ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) { @@ -237,3 +246,18 @@ void CRecordOfficeArtBlip::ReadFromStream(SRecordHeader & oHeader, POLE::Stream* m_sFileName = strFile; } } + +CRecordBitmapBlip::CRecordBitmapBlip() +{ + +} + +CRecordBitmapBlip::~CRecordBitmapBlip() +{ + +} + +void CRecordBitmapBlip::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) +{ + return CUnknownRecord::ReadFromStream(oHeader, pStream); +} diff --git a/MsBinaryFile/PptFile/Records/Drawing/ArtBlip.h b/MsBinaryFile/PptFile/Records/Drawing/ArtBlip.h index 89186767e9..2091f61e94 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/ArtBlip.h +++ b/MsBinaryFile/PptFile/Records/Drawing/ArtBlip.h @@ -34,50 +34,36 @@ #include "../../Reader/Records.h" + namespace PPT { class CPPTDocumentInfo; - class CRecordOfficeArtBlip : public CUnknownRecord - { - public: - CPPTDocumentInfo * m_oDocumentInfo; +class CRecordOfficeArtBlip : public CUnknownRecord +{ +public: + CPPTDocumentInfo * m_oDocumentInfo; + + std::wstring m_sFileName; + std::wstring m_strTmpDirectory; - std::wstring m_sFileName; - std::wstring m_strTmpDirectory; + CRecordOfficeArtBlip(); - CRecordOfficeArtBlip() - { - m_oDocumentInfo = NULL; - } + ~CRecordOfficeArtBlip(); - ~CRecordOfficeArtBlip() - { - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); +}; - }; +class CRecordBitmapBlip : public CUnknownRecord +{ +public: + BYTE m_pRgbUid[16]; + BYTE m_nTag; - class CRecordBitmapBlip : public CUnknownRecord - { - public: - BYTE m_pRgbUid[16]; - BYTE m_nTag; - - //BYTE* m_pScan0; - - CRecordBitmapBlip() - { - } - - ~CRecordBitmapBlip() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - return CUnknownRecord::ReadFromStream(oHeader, pStream); - } - - }; + //BYTE* m_pScan0; + + CRecordBitmapBlip(); + ~CRecordBitmapBlip(); + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); +}; } diff --git a/MsBinaryFile/PptFile/Records/Drawing/BlipStoreContainer.cpp b/MsBinaryFile/PptFile/Records/Drawing/BlipStoreContainer.cpp index 188fe27d58..cee2608c1d 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/BlipStoreContainer.cpp +++ b/MsBinaryFile/PptFile/Records/Drawing/BlipStoreContainer.cpp @@ -1,37 +1,7 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "BlipStoreContainer.h" #include "BlipStoreEntry.h" +using namespace PPT; CRecordBlipStoreContainer::CRecordBlipStoreContainer() { diff --git a/MsBinaryFile/PptFile/Records/Drawing/BlipStoreContainer.h b/MsBinaryFile/PptFile/Records/Drawing/BlipStoreContainer.h index 35835cb653..10b5f5002b 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/BlipStoreContainer.h +++ b/MsBinaryFile/PptFile/Records/Drawing/BlipStoreContainer.h @@ -31,48 +31,14 @@ */ #pragma once #include "../../Reader/Records.h" -#include "BlipStoreEntry.h" namespace PPT { - class CRecordBlipStoreContainer : public CRecordsContainer - { - public: - - CRecordBlipStoreContainer() - { - } - - ~CRecordBlipStoreContainer() - { - } - - void SetUpPicturesInfos(std::vector* pArray) - { - if (NULL == pArray) - return; - - pArray->clear(); - - std::map<_UINT32, int> image_map; - for (size_t nIndex = 0; nIndex < m_arRecords.size(); ++nIndex) - { - CRecordBlipStoreEntry* pEntry = dynamic_cast(m_arRecords[nIndex]); - if (NULL != pEntry) - { - image_map.insert(std::pair<_UINT32, int>(pEntry->m_nFoDelay, pArray->size())); - - int offset = pEntry->m_nFoDelay; - if (0 == pEntry->m_oHeader.RecInstance) offset = -1; - - if (pEntry->m_oHeader.RecType == 0xf007) - { - //inside here? - } - - pArray->push_back(offset); - } - } - } - }; +class CRecordBlipStoreContainer : public CRecordsContainer +{ +public: + CRecordBlipStoreContainer(); + ~CRecordBlipStoreContainer(); + void SetUpPicturesInfos(std::vector* pArray); +}; } diff --git a/MsBinaryFile/PptFile/Records/Drawing/BlipStoreEntry.cpp b/MsBinaryFile/PptFile/Records/Drawing/BlipStoreEntry.cpp index 9c91d18a9a..4290bc2bd5 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/BlipStoreEntry.cpp +++ b/MsBinaryFile/PptFile/Records/Drawing/BlipStoreEntry.cpp @@ -1,5 +1,7 @@ #include "BlipStoreEntry.h" +using namespace PPT; + CRecordBlipStoreEntry::CRecordBlipStoreEntry() { diff --git a/MsBinaryFile/PptFile/Records/Drawing/BlipStoreEntry.h b/MsBinaryFile/PptFile/Records/Drawing/BlipStoreEntry.h index d9dea310f8..2fd0c3d886 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/BlipStoreEntry.h +++ b/MsBinaryFile/PptFile/Records/Drawing/BlipStoreEntry.h @@ -34,53 +34,27 @@ namespace PPT { - class CRecordBlipStoreEntry : public CUnknownRecord - { - public: - ODRAW::eBlipType m_btWin32; - ODRAW::eBlipType m_btMacOS; +class CRecordBlipStoreEntry : public CUnknownRecord +{ +public: + ODRAW::eBlipType m_btWin32; + ODRAW::eBlipType m_btMacOS; + + BYTE m_pRgbUid[16]; + unsigned short m_nTag; + _UINT32 m_nSize; + _UINT32 m_nCountRef; + _UINT32 m_nFoDelay; - BYTE m_pRgbUid[16]; - unsigned short m_nTag; - _UINT32 m_nSize; - _UINT32 m_nCountRef; - _UINT32 m_nFoDelay; + ODRAW::eBlipUsage m_eUsage; + BYTE m_nLenName; - ODRAW::eBlipUsage m_eUsage; - BYTE m_nLenName; + BYTE m_nUnused2; + BYTE m_nUnused3; + + CRecordBlipStoreEntry(); + ~CRecordBlipStoreEntry(); - BYTE m_nUnused2; - BYTE m_nUnused3; - - CRecordBlipStoreEntry() - { - } - - ~CRecordBlipStoreEntry() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_btWin32 = (ODRAW::eBlipType)StreamUtils::ReadBYTE(pStream); - m_btMacOS = (ODRAW::eBlipType)StreamUtils::ReadBYTE(pStream); - - pStream->read(m_pRgbUid, 16); - - m_nTag = StreamUtils::ReadWORD(pStream); - - m_nSize = StreamUtils::ReadDWORD(pStream); - m_nCountRef = StreamUtils::ReadDWORD(pStream); - m_nFoDelay = StreamUtils::ReadDWORD(pStream); - - m_eUsage = (ODRAW::eBlipUsage)StreamUtils::ReadBYTE(pStream); - - m_nLenName = StreamUtils::ReadBYTE(pStream); - - m_nUnused2 = StreamUtils::ReadBYTE(pStream); - m_nUnused3 = StreamUtils::ReadBYTE(pStream); - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); +}; +} diff --git a/MsBinaryFile/PptFile/Records/Drawing/ChildAnchor.cpp b/MsBinaryFile/PptFile/Records/Drawing/ChildAnchor.cpp index 72280b9a93..6e8792f1a3 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/ChildAnchor.cpp +++ b/MsBinaryFile/PptFile/Records/Drawing/ChildAnchor.cpp @@ -1,36 +1,7 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "ChildAnchor.h" +using namespace PPT; + CRecordChildAnchor::CRecordChildAnchor() { diff --git a/MsBinaryFile/PptFile/Records/Drawing/ChildAnchor.h b/MsBinaryFile/PptFile/Records/Drawing/ChildAnchor.h index a83d891421..5c88391e27 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/ChildAnchor.h +++ b/MsBinaryFile/PptFile/Records/Drawing/ChildAnchor.h @@ -34,28 +34,16 @@ namespace PPT { - class CRecordChildAnchor : public CUnknownRecord - { - public: - RECT m_oBounds; +class CRecordChildAnchor : public CUnknownRecord +{ +public: + RECT m_oBounds; - public: +public: + + CRecordChildAnchor(); + ~CRecordChildAnchor(); - CRecordChildAnchor() - { - } - - ~CRecordChildAnchor() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - m_oBounds.left = StreamUtils::ReadLONG(pStream); - m_oBounds.top = StreamUtils::ReadLONG(pStream); - m_oBounds.right = StreamUtils::ReadLONG(pStream); - m_oBounds.bottom = StreamUtils::ReadLONG(pStream); - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); +}; +} diff --git a/MsBinaryFile/PptFile/Records/Drawing/ClientAnchor.cpp b/MsBinaryFile/PptFile/Records/Drawing/ClientAnchor.cpp index 649b6f1a04..e4f674a146 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/ClientAnchor.cpp +++ b/MsBinaryFile/PptFile/Records/Drawing/ClientAnchor.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "ClientAnchor.h" +using namespace PPT; CRecordClientAnchor::CRecordClientAnchor() { diff --git a/MsBinaryFile/PptFile/Records/Drawing/ClientAnchor.h b/MsBinaryFile/PptFile/Records/Drawing/ClientAnchor.h index 1f330d717a..cdd7975ae5 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/ClientAnchor.h +++ b/MsBinaryFile/PptFile/Records/Drawing/ClientAnchor.h @@ -30,44 +30,19 @@ * */ #pragma once + #include "../../Reader/Records.h" + namespace PPT { - class CRecordClientAnchor : public CUnknownRecord - { - public: - ODRAW::SRectAtom m_oBounds; +class CRecordClientAnchor : public CUnknownRecord +{ +public: + ODRAW::SRectAtom m_oBounds; - public: - - CRecordClientAnchor() - { - } - - ~CRecordClientAnchor() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - if (m_oHeader.RecLen == 0x00000008) //SSmallRectAtom - { - m_oBounds.Top = StreamUtils::ReadSHORT(pStream); - m_oBounds.Left = StreamUtils::ReadSHORT(pStream); - m_oBounds.Right = StreamUtils::ReadSHORT(pStream); - m_oBounds.Bottom = StreamUtils::ReadSHORT(pStream); - } - if (m_oHeader.RecLen == 0x00000010) //SRectAtom - { - m_oBounds.Top = StreamUtils::ReadLONG(pStream); - m_oBounds.Left = StreamUtils::ReadLONG(pStream); - m_oBounds.Right = StreamUtils::ReadLONG(pStream); - m_oBounds.Bottom = StreamUtils::ReadLONG(pStream); - } - } - - }; -} \ No newline at end of file + CRecordClientAnchor(); + ~CRecordClientAnchor(); + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); +}; +} diff --git a/MsBinaryFile/PptFile/Records/Drawing/DrawingContainer.cpp b/MsBinaryFile/PptFile/Records/Drawing/DrawingContainer.cpp index 4b3862ceeb..de070e8bf2 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/DrawingContainer.cpp +++ b/MsBinaryFile/PptFile/Records/Drawing/DrawingContainer.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "DrawingContainer.h" +using namespace PPT; CRecordDrawingContainer::CRecordDrawingContainer() { diff --git a/MsBinaryFile/PptFile/Records/Drawing/DrawingContainer.h b/MsBinaryFile/PptFile/Records/Drawing/DrawingContainer.h index ffbd7cdc4c..371733d509 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/DrawingContainer.h +++ b/MsBinaryFile/PptFile/Records/Drawing/DrawingContainer.h @@ -34,22 +34,13 @@ namespace PPT { - class CRecordDrawingContainer : public CRecordsContainer - { - public: +class CRecordDrawingContainer : public CRecordsContainer +{ +public: + + CRecordDrawingContainer(); + ~CRecordDrawingContainer(); - CRecordDrawingContainer() - { - } - - ~CRecordDrawingContainer() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - CRecordsContainer::ReadFromStream(oHeader, pStream); - } - }; + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); +}; } - diff --git a/MsBinaryFile/PptFile/Records/Drawing/DrawingGroup.cpp b/MsBinaryFile/PptFile/Records/Drawing/DrawingGroup.cpp index 7bea40697c..0dbda1e2dc 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/DrawingGroup.cpp +++ b/MsBinaryFile/PptFile/Records/Drawing/DrawingGroup.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "DrawingGroup.h" +using namespace PPT; CRecordDrawingGroup::CRecordDrawingGroup() : m_arrIDs() { diff --git a/MsBinaryFile/PptFile/Records/Drawing/DrawingGroup.h b/MsBinaryFile/PptFile/Records/Drawing/DrawingGroup.h index 5f905c3b56..4b6e60990f 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/DrawingGroup.h +++ b/MsBinaryFile/PptFile/Records/Drawing/DrawingGroup.h @@ -34,42 +34,19 @@ namespace PPT { - class CRecordDrawingGroup : public CUnknownRecord - { - UINT m_nMaxShapeId; // Maximum shape ID - UINT m_nIdClustersCount; // Number of FileIdClusters - UINT m_nShapesSavedCount; // Total number of shapes saved - UINT m_nDrawingsSavedCount; // Total number of drawings saved +class CRecordDrawingGroup : public CUnknownRecord +{ + UINT m_nMaxShapeId; // Maximum shape ID + UINT m_nIdClustersCount; // Number of FileIdClusters + UINT m_nShapesSavedCount; // Total number of shapes saved + UINT m_nDrawingsSavedCount; // Total number of drawings saved - std::vector m_arrIDs; + std::vector m_arrIDs; - public: +public: + CRecordDrawingGroup(); + ~CRecordDrawingGroup(); - CRecordDrawingGroup() : m_arrIDs() - { - } - - ~CRecordDrawingGroup() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_nMaxShapeId = (UINT)StreamUtils::ReadDWORD(pStream); - m_nIdClustersCount = (UINT)StreamUtils::ReadDWORD(pStream) - 1; // Office saves the actual value + 1 - m_nShapesSavedCount = (UINT)StreamUtils::ReadDWORD(pStream); - m_nDrawingsSavedCount = (UINT)StreamUtils::ReadDWORD(pStream); - - m_arrIDs.clear(); - for (UINT nIndex = 0; nIndex < m_nIdClustersCount; ++nIndex) - { - SFileIdCluster elm; - m_arrIDs.push_back(elm); - m_arrIDs[nIndex].ReadFromStream(pStream); - } - } - - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); +}; +} diff --git a/MsBinaryFile/PptFile/Records/Drawing/DrawingRecord.cpp b/MsBinaryFile/PptFile/Records/Drawing/DrawingRecord.cpp index 27f00ad5d1..92e59f361e 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/DrawingRecord.cpp +++ b/MsBinaryFile/PptFile/Records/Drawing/DrawingRecord.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "DrawingRecord.h" +using namespace PPT; CRecordDrawingRecord::CRecordDrawingRecord() { diff --git a/MsBinaryFile/PptFile/Records/Drawing/DrawingRecord.h b/MsBinaryFile/PptFile/Records/Drawing/DrawingRecord.h index beb1b1ccff..fd68cf864c 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/DrawingRecord.h +++ b/MsBinaryFile/PptFile/Records/Drawing/DrawingRecord.h @@ -30,31 +30,23 @@ * */ #pragma once + #include "../../Reader/Records.h" + namespace PPT { - class CRecordDrawingRecord : public CUnknownRecord - { - public: - UINT m_nCountShapes; - /// The last MSOSPID given to an SP in this DG - UINT m_nPidCur; +class CRecordDrawingRecord : public CUnknownRecord +{ +public: + UINT m_nCountShapes; + /// The last MSOSPID given to an SP in this DG + UINT m_nPidCur; + + CRecordDrawingRecord(); + ~CRecordDrawingRecord(); - CRecordDrawingRecord() - { - } - - ~CRecordDrawingRecord() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - m_nCountShapes = (UINT)StreamUtils::ReadDWORD(pStream); - m_nPidCur = (UINT)StreamUtils::ReadDWORD(pStream); - } - }; + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); +}; } diff --git a/MsBinaryFile/PptFile/Records/Drawing/GroupShape.cpp b/MsBinaryFile/PptFile/Records/Drawing/GroupShape.cpp index 5ab86b2637..2116806fd8 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/GroupShape.cpp +++ b/MsBinaryFile/PptFile/Records/Drawing/GroupShape.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "GroupShape.h" +using namespace PPT; CRecordGroupShape::CRecordGroupShape() { diff --git a/MsBinaryFile/PptFile/Records/Drawing/GroupShape.h b/MsBinaryFile/PptFile/Records/Drawing/GroupShape.h index 1047650088..ca217c4483 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/GroupShape.h +++ b/MsBinaryFile/PptFile/Records/Drawing/GroupShape.h @@ -30,32 +30,21 @@ * */ #pragma once + #include "../../Reader/Records.h" + namespace PPT { - class CRecordGroupShape : public CUnknownRecord - { - public: - RECT m_oBounds; +class CRecordGroupShape : public CUnknownRecord +{ +public: + RECT m_oBounds; + + CRecordGroupShape(); + ~CRecordGroupShape(); - CRecordGroupShape() - { - } - - ~CRecordGroupShape() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_oBounds.left = StreamUtils::ReadLONG(pStream); - m_oBounds.top = StreamUtils::ReadLONG(pStream); - m_oBounds.right = StreamUtils::ReadLONG(pStream); - m_oBounds.bottom = StreamUtils::ReadLONG(pStream); - } - }; + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); +}; } diff --git a/MsBinaryFile/PptFile/Records/Drawing/GroupShapeContainer.h b/MsBinaryFile/PptFile/Records/Drawing/GroupShapeContainer.h index 591419078c..d8f53058de 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/GroupShapeContainer.h +++ b/MsBinaryFile/PptFile/Records/Drawing/GroupShapeContainer.h @@ -34,21 +34,10 @@ #include #include "ShapeContainer.h" + namespace PPT { - class CRecordGroupShapeContainer : public CRecordsContainer - { - public: - - CRecordGroupShapeContainer() - { - } - - ~CRecordGroupShapeContainer() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); - - }; +class CRecordGroupShapeContainer : public CRecordsContainer +{ +}; } diff --git a/MsBinaryFile/PptFile/Records/Drawing/RegGroupItems.cpp b/MsBinaryFile/PptFile/Records/Drawing/RegGroupItems.cpp new file mode 100644 index 0000000000..85019a06c7 --- /dev/null +++ b/MsBinaryFile/PptFile/Records/Drawing/RegGroupItems.cpp @@ -0,0 +1,31 @@ +#include "RegGroupItems.h" + +using namespace PPT; + + +CRecordRegGroupItems::CRecordRegGroupItems() +{ +} + +CRecordRegGroupItems::~CRecordRegGroupItems() +{ +} + +void CRecordRegGroupItems::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) +{ + m_oHeader = oHeader; + + m_arItemsNew.clear(); + m_arItemsOld.clear(); + + LONG lCount = (LONG)(oHeader.RecLen / 4); + + for (LONG i = 0; i < lCount; ++i) + { + WORD w1 = StreamUtils::ReadWORD(pStream); + WORD w2 = StreamUtils::ReadWORD(pStream); + + m_arItemsNew.push_back(w1); + m_arItemsOld.push_back(w2); + } +} diff --git a/MsBinaryFile/PptFile/Records/Drawing/RegGroupItems.h b/MsBinaryFile/PptFile/Records/Drawing/RegGroupItems.h index 0a6b0b1a98..d0b9a6d097 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/RegGroupItems.h +++ b/MsBinaryFile/PptFile/Records/Drawing/RegGroupItems.h @@ -30,44 +30,25 @@ * */ #pragma once + #include "../../Reader/Records.h" + namespace PPT { - class CRecordRegGroupItems : public CUnknownRecord - { - public: - std::vector m_arItemsNew; - std::vector m_arItemsOld; +class CRecordRegGroupItems : public CUnknownRecord +{ +public: + std::vector m_arItemsNew; + std::vector m_arItemsOld; - public: +public: + + CRecordRegGroupItems(); - CRecordRegGroupItems() - { - } + ~CRecordRegGroupItems(); - ~CRecordRegGroupItems() - { - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_arItemsNew.clear(); - m_arItemsOld.clear(); - - LONG lCount = (LONG)(oHeader.RecLen / 4); - - for (LONG i = 0; i < lCount; ++i) - { - WORD w1 = StreamUtils::ReadWORD(pStream); - WORD w2 = StreamUtils::ReadWORD(pStream); - - m_arItemsNew.push_back(w1); - m_arItemsOld.push_back(w2); - } - } - - }; -} \ No newline at end of file +}; +} diff --git a/MsBinaryFile/PptFile/Records/Drawing/Shape.cpp b/MsBinaryFile/PptFile/Records/Drawing/Shape.cpp index 6bda4451f3..1e2e73614f 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/Shape.cpp +++ b/MsBinaryFile/PptFile/Records/Drawing/Shape.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "Shape.h" +using namespace PPT; CRecordShape::CRecordShape() { diff --git a/MsBinaryFile/PptFile/Records/Drawing/Shape.h b/MsBinaryFile/PptFile/Records/Drawing/Shape.h index d53389adff..89c3ac58fe 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/Shape.h +++ b/MsBinaryFile/PptFile/Records/Drawing/Shape.h @@ -30,66 +30,36 @@ * */ #pragma once + #include "../../Reader/Records.h" + namespace PPT { - class CRecordShape : public CUnknownRecord - { - public: - UINT m_nID; - UINT m_nShapeID; +class CRecordShape : public CUnknownRecord +{ +public: + UINT m_nID; + UINT m_nShapeID; + + bool m_bGroup; + bool m_bChild; + bool m_bPatriarch; + bool m_bDeleted; + bool m_bOleShape; + bool m_bHaveMaster; + bool m_bFlipH; + bool m_bFlipV; + bool m_bConnector; + bool m_bHaveAnchor; + bool m_bBackground; + bool m_bHaveSpt; - bool m_bGroup; - bool m_bChild; - bool m_bPatriarch; - bool m_bDeleted; - bool m_bOleShape; - bool m_bHaveMaster; - bool m_bFlipH; - bool m_bFlipV; - bool m_bConnector; - bool m_bHaveAnchor; - bool m_bBackground; - bool m_bHaveSpt; +public: + + CRecordShape(); + ~CRecordShape(); - public: - - CRecordShape() - { - } - - ~CRecordShape() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - m_nID = (UINT)StreamUtils::ReadDWORD(pStream); - - UINT nFlag = (UINT)StreamUtils::ReadDWORD(pStream); - - m_bGroup = ((nFlag & 0x01) == 0x01); - m_bChild = ((nFlag & 0x02) == 0x02); - m_bPatriarch = ((nFlag & 0x04) == 0x04); - m_bDeleted = ((nFlag & 0x08) == 0x08); - m_bOleShape = ((nFlag & 0x10) == 0x10); - m_bHaveMaster = ((nFlag & 0x20) == 0x20); - m_bFlipH = ((nFlag & 0x40) == 0x40); - m_bFlipV = ((nFlag & 0x80) == 0x80); - m_bConnector = ((nFlag & 0x0100) == 0x0100); - m_bHaveAnchor = ((nFlag & 0x0200) == 0x0200); - m_bBackground = ((nFlag & 0x0400) == 0x0400); - m_bHaveSpt = ((nFlag & 0x0800) == 0x0800); - - LONG lSize = m_oHeader.RecLen - 8; - if (lSize > 0) - { - StreamUtils::StreamSkip(lSize, pStream); - } - - m_nShapeID = m_oHeader.RecInstance; - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); +}; +} diff --git a/MsBinaryFile/PptFile/Records/Drawing/ShapeContainer.cpp b/MsBinaryFile/PptFile/Records/Drawing/ShapeContainer.cpp index feeda1ce88..32523282e3 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/ShapeContainer.cpp +++ b/MsBinaryFile/PptFile/Records/Drawing/ShapeContainer.cpp @@ -42,11 +42,15 @@ #include "../../../../OfficeUtils/src/OfficeUtils.h" #include #include "../../Enums/_includer.h" +#include "../RecordsIncluder.h" #define FIXED_POINT_unsigned(val) (double)((WORD)(val >> 16) + ((WORD)(val) / 65536.0)) ULONG xmlName = 1; +using namespace ODRAW; +using namespace PPT; + bool CPPTElement::ChangeBlack2ColorImage(std::wstring image_path, int rgbColor1, int rgbColor2) { CBgraFrame bgraFrame; @@ -1506,6 +1510,25 @@ void CPPTElement::SetUpPropertyShape(CElementPtr pElement, CTheme* pTheme, CSlid } +CRecordShapeContainer::CRecordShapeContainer() +{ + bGroupShape = false; + + m_pStream = NULL; + +} + +CRecordShapeContainer::~CRecordShapeContainer() +{ + m_pStream = NULL; +} + +void CRecordShapeContainer::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) +{ + m_pStream = pStream; + CRecordsContainer::ReadFromStream(oHeader, pStream); +} + CElementPtr CRecordShapeContainer::GetElement (bool inGroup, CExMedia* pMapIDs, CTheme* pTheme, CLayout* pLayout, CSlideInfo* pThemeWrapper, CSlideInfo* pSlideWrapper, CSlide* pSlide) @@ -2057,6 +2080,36 @@ CElementPtr CRecordShapeContainer::GetElement (bool inGroup, CExMedia* pMapIDs, return pElement; } +PPT::ElementType CRecordShapeContainer::GetTypeElem(eSPT eType) +{ + switch (eType) + { + //case sptMin: + case sptMax: + case sptNil: + { + return etShape; + } + case sptPictureFrame: + { + return etPicture; + } + default: + { + return etShape; + } + }; + return etShape; +} + +std::wstring CRecordShapeContainer::GetFileName(std::wstring strFilePath) +{ + int nIndex = strFilePath.rfind(wchar_t('\\')); + if (-1 != nIndex) + return strFilePath.substr(nIndex + 1); + else + return strFilePath; +} bool CRecordShapeContainer::isTable() const { std::vector oArrayOptions; @@ -2856,8 +2909,8 @@ void CRecordShapeContainer::ConvertStyleTextProp9(CTextAttributesEx *pText) //} -void CRecordGroupShapeContainer::ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) -{ - CRecordsContainer::ReadFromStream(oHeader, pStream); +//void CRecordGroupShapeContainer::ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) +//{ +// CRecordsContainer::ReadFromStream(oHeader, pStream); -} +//} diff --git a/MsBinaryFile/PptFile/Records/Drawing/ShapeContainer.h b/MsBinaryFile/PptFile/Records/Drawing/ShapeContainer.h index fc997efa70..c4449255c3 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/ShapeContainer.h +++ b/MsBinaryFile/PptFile/Records/Drawing/ShapeContainer.h @@ -58,6 +58,7 @@ #define FIXED_POINT_unsigned(val) (double)((WORD)(val >> 16) + ((WORD)(val) / 65536.0)) +using namespace ODRAW; using namespace PPT; class CPPTElement @@ -83,60 +84,18 @@ public: bool bGroupShape; - CRecordShapeContainer() - { - bGroupShape = false; + CRecordShapeContainer(); - m_pStream = NULL; - - } - - ~CRecordShapeContainer() - { - m_pStream = NULL; - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_pStream = pStream; - CRecordsContainer::ReadFromStream(oHeader, pStream); - } + ~CRecordShapeContainer(); + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); CElementPtr GetElement (bool inGroup, CExMedia* pMapIDs, CTheme* pTheme, CLayout* pLayout, CSlideInfo* pThemeWrapper, CSlideInfo* pSlideWrapper, CSlide* pSlide = NULL); - PPT::ElementType GetTypeElem(eSPT eType) - { - switch (eType) - { - //case sptMin: - case sptMax: - case sptNil: - { - return etShape; - } - case sptPictureFrame: - { - return etPicture; - } - default: - { - return etShape; - } - }; - return etShape; - } - AVSINLINE std::wstring GetFileName(std::wstring strFilePath) - { - int nIndex = strFilePath.rfind(wchar_t('\\')); - if (-1 != nIndex) - { - return strFilePath.substr(nIndex + 1); - } - return strFilePath; - } + ElementType GetTypeElem(eSPT eType); + std::wstring GetFileName(std::wstring strFilePath); protected: diff --git a/MsBinaryFile/PptFile/Records/Drawing/ShapeProperties.cpp b/MsBinaryFile/PptFile/Records/Drawing/ShapeProperties.cpp index 4921f537b5..edb9bbc168 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/ShapeProperties.cpp +++ b/MsBinaryFile/PptFile/Records/Drawing/ShapeProperties.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "ShapeProperties.h" +using namespace PPT; CRecordShapeProperties::CRecordShapeProperties() { diff --git a/MsBinaryFile/PptFile/Records/Drawing/ShapeProperties.h b/MsBinaryFile/PptFile/Records/Drawing/ShapeProperties.h index 28842d6e7a..90fd506e4a 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/ShapeProperties.h +++ b/MsBinaryFile/PptFile/Records/Drawing/ShapeProperties.h @@ -36,32 +36,14 @@ namespace PPT { - class CRecordShapeProperties : public CUnknownRecord - { - public: - CProperties m_oProperties; +class CRecordShapeProperties : public CUnknownRecord +{ +public: + CProperties m_oProperties; - CRecordShapeProperties() - { - } + CRecordShapeProperties(); + ~CRecordShapeProperties(); - ~CRecordShapeProperties() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - LONG lPosition = 0; - StreamUtils::StreamPosition(lPosition, pStream); - - m_oProperties.FromStream(pStream, m_oHeader.RecInstance); - _UINT32 dwLen = m_oProperties.GetLen(); - - // это на всякий случай, может там напридумывают проперти с complex - - // которые мы не поддерживаем... - StreamUtils::StreamSeek(lPosition + m_oHeader.RecLen, pStream); - } - }; + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); +}; } diff --git a/MsBinaryFile/PptFile/Records/Drawing/TextBox.cpp b/MsBinaryFile/PptFile/Records/Drawing/TextBox.cpp index 787f280137..53bfe0c420 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/TextBox.cpp +++ b/MsBinaryFile/PptFile/Records/Drawing/TextBox.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "TextBox.h" +using namespace PPT; CRecordTextBox::CRecordTextBox() { diff --git a/MsBinaryFile/PptFile/Records/Drawing/TextBox.h b/MsBinaryFile/PptFile/Records/Drawing/TextBox.h index b4d239cb7f..5eb8631416 100644 --- a/MsBinaryFile/PptFile/Records/Drawing/TextBox.h +++ b/MsBinaryFile/PptFile/Records/Drawing/TextBox.h @@ -30,26 +30,18 @@ * */ #pragma once + #include "../../Reader/Records.h" + namespace PPT { - class CRecordTextBox : public CUnknownRecord - { - public: +class CRecordTextBox : public CUnknownRecord +{ +public: + CRecordTextBox(); + ~CRecordTextBox(); - CRecordTextBox() - { - } - - ~CRecordTextBox() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - return CUnknownRecord::ReadFromStream(oHeader, pStream); - } - - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); +}; +} diff --git a/MsBinaryFile/PptFile/Records/EndDocument.cpp b/MsBinaryFile/PptFile/Records/EndDocument.cpp index 1d0055faef..0ebd3c7001 100644 --- a/MsBinaryFile/PptFile/Records/EndDocument.cpp +++ b/MsBinaryFile/PptFile/Records/EndDocument.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "EndDocument.h" +using namespace PPT; void CRecordEndDocument::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/EndDocument.h b/MsBinaryFile/PptFile/Records/EndDocument.h index 25c98f7936..8b0d01f589 100644 --- a/MsBinaryFile/PptFile/Records/EndDocument.h +++ b/MsBinaryFile/PptFile/Records/EndDocument.h @@ -30,25 +30,15 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordEndDocument : public CUnknownRecord - { - public: - - CRecordEndDocument() - { - } - - ~CRecordEndDocument() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - return CUnknownRecord::ReadFromStream(oHeader, pStream); - } - }; -} \ No newline at end of file +class CRecordEndDocument : public CUnknownRecord +{ +public: + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/ExCDAudioContainer.cpp b/MsBinaryFile/PptFile/Records/ExCDAudioContainer.cpp index 2da1498853..6d7e1119c8 100644 --- a/MsBinaryFile/PptFile/Records/ExCDAudioContainer.cpp +++ b/MsBinaryFile/PptFile/Records/ExCDAudioContainer.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "ExCDAudioContainer.h" +using namespace PPT; void CRecordExCDAudioContainer::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/ExCDAudioContainer.h b/MsBinaryFile/PptFile/Records/ExCDAudioContainer.h index 7681c600ed..2d2db41ed4 100644 --- a/MsBinaryFile/PptFile/Records/ExCDAudioContainer.h +++ b/MsBinaryFile/PptFile/Records/ExCDAudioContainer.h @@ -30,51 +30,21 @@ * */ #pragma once + #include "ExMediaAtom.h" + namespace PPT { - class CRecordExCDAudioContainer : public CRecordsContainer - { - public: - CRecordExMediaAtom m_oMedia; +class CRecordExCDAudioContainer : public CRecordsContainer +{ +public: + CRecordExMediaAtom m_oMedia; + + double m_dStartTime = .0; + double m_dEndTime = .0; - double m_dStartTime; - double m_dEndTime; - CRecordExCDAudioContainer() - { - m_dStartTime = 0; - m_dEndTime = 0; - } - - ~CRecordExCDAudioContainer() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - SRecordHeader oExHeader; - oExHeader.ReadFromStream(pStream); - - m_oMedia.ReadFromStream(oExHeader, pStream); - - StreamUtils::StreamSkip(8, pStream); - - BYTE nTrack1 = StreamUtils::ReadBYTE(pStream); - BYTE nMinute1 = StreamUtils::ReadBYTE(pStream); - BYTE nSecond1 = StreamUtils::ReadBYTE(pStream); - BYTE nFrame1 = StreamUtils::ReadBYTE(pStream); - - BYTE nTrack2 = StreamUtils::ReadBYTE(pStream); - BYTE nMinute2 = StreamUtils::ReadBYTE(pStream); - BYTE nSecond2 = StreamUtils::ReadBYTE(pStream); - BYTE nFrame2 = StreamUtils::ReadBYTE(pStream); - - m_dStartTime = 60000 * nMinute1 + 1000 * nSecond1; - m_dEndTime = 60000 * nMinute2 + 1000 * nSecond2; - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/ExControlAtom.cpp b/MsBinaryFile/PptFile/Records/ExControlAtom.cpp index 40997b5f62..040dc2b6c4 100644 --- a/MsBinaryFile/PptFile/Records/ExControlAtom.cpp +++ b/MsBinaryFile/PptFile/Records/ExControlAtom.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "ExControlAtom.h" +using namespace PPT; void CRecordExControlAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/ExControlAtom.h b/MsBinaryFile/PptFile/Records/ExControlAtom.h index 776c9167f1..0d9e028c37 100644 --- a/MsBinaryFile/PptFile/Records/ExControlAtom.h +++ b/MsBinaryFile/PptFile/Records/ExControlAtom.h @@ -30,29 +30,18 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordExControlAtom : public CUnknownRecord - { - UINT m_nSlideIdRef; +class CRecordExControlAtom : public CUnknownRecord +{ +public: + UINT m_nSlideIdRef = 0; - public: - CRecordExControlAtom() - { - } - - ~CRecordExControlAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_nSlideIdRef = StreamUtils::ReadDWORD(pStream); - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/ExHyperlinkAtom.cpp b/MsBinaryFile/PptFile/Records/ExHyperlinkAtom.cpp index 027dbb8491..f405558c51 100644 --- a/MsBinaryFile/PptFile/Records/ExHyperlinkAtom.cpp +++ b/MsBinaryFile/PptFile/Records/ExHyperlinkAtom.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "ExHyperlinkAtom.h" +using namespace PPT; void CRecordExHyperlinkAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/ExHyperlinkAtom.h b/MsBinaryFile/PptFile/Records/ExHyperlinkAtom.h index ed083fb4e1..d4c7e978bc 100644 --- a/MsBinaryFile/PptFile/Records/ExHyperlinkAtom.h +++ b/MsBinaryFile/PptFile/Records/ExHyperlinkAtom.h @@ -33,81 +33,30 @@ #include "../Reader/Records.h" #include "CString.h" + namespace PPT { - class CRecordExHyperlinkAtom : public CUnknownRecord - { +class CRecordExHyperlinkAtom : public CUnknownRecord +{ - public: - UINT m_nHyperlinkID; +public: + UINT m_nHyperlinkID = 0; - CRecordExHyperlinkAtom() - { - } - ~CRecordExHyperlinkAtom() - { - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; +class CRecordExHyperlinkContainer : public CRecordsContainer +{ +public: + CRecordExHyperlinkAtom m_exHyperlinkAtom; + nullable m_friendlyNameAtom; + nullable m_targetAtom; + nullable m_locationAtom; - m_nHyperlinkID = StreamUtils::ReadDWORD(pStream); - } - }; - class CRecordExHyperlinkContainer : public CRecordsContainer - { - public: - CRecordExHyperlinkAtom m_exHyperlinkAtom; - nullable m_friendlyNameAtom; - nullable m_targetAtom; - nullable m_locationAtom; + bool hasCString()const; - CRecordExHyperlinkContainer() - { - } - - ~CRecordExHyperlinkContainer() - { - } - - bool hasCString()const - { - return m_friendlyNameAtom.IsInit() || m_targetAtom.IsInit() || m_locationAtom.IsInit(); - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - SRecordHeader header; - - header.ReadFromStream(pStream); - m_exHyperlinkAtom.ReadFromStream(header, pStream); - - unsigned currentLen = 12; // 12(atom) - while (currentLen < m_oHeader.RecLen) - { - header.ReadFromStream(pStream); - auto* pCString = new CRecordCString; - pCString->ReadFromStream(header, pStream); - switch (header.RecInstance) - { - case 0: m_friendlyNameAtom = pCString; break; - case 1: m_targetAtom = pCString; break; - case 3: m_locationAtom = pCString; break; - default: delete pCString; - } - currentLen += 8 + header.RecLen; // headerLen + CStringLen - } - // if (m_friendlyNameAtom.IsInit() && (int)m_friendlyNameAtom->m_strText.find(L"NEXT") == -1) - // std::wcout << m_exHyperlinkAtom.m_nHyperlinkID << L" " - // << (m_friendlyNameAtom.IsInit() ? m_friendlyNameAtom->m_strText : L"-") << L" " - // << (m_targetAtom.IsInit() ? m_targetAtom->m_strText : L"-") << L" " - // << (m_locationAtom.IsInit() ? m_locationAtom->m_strText : L"-") - // << std::endl; - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/ExMIDIAudioContainer.cpp b/MsBinaryFile/PptFile/Records/ExMIDIAudioContainer.cpp index 18f62e678b..b9396b8f33 100644 --- a/MsBinaryFile/PptFile/Records/ExMIDIAudioContainer.cpp +++ b/MsBinaryFile/PptFile/Records/ExMIDIAudioContainer.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "ExMIDIAudioContainer.h" +using namespace PPT; void CRecordExMIDIAudioContainer::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/ExMIDIAudioContainer.h b/MsBinaryFile/PptFile/Records/ExMIDIAudioContainer.h index 192a290eb2..0ad6299e72 100644 --- a/MsBinaryFile/PptFile/Records/ExMIDIAudioContainer.h +++ b/MsBinaryFile/PptFile/Records/ExMIDIAudioContainer.h @@ -34,21 +34,9 @@ namespace PPT { - class CRecordExMIDIAudioContainer : public CRecordsContainer - { - public: - - CRecordExMIDIAudioContainer() - { - } - - ~CRecordExMIDIAudioContainer() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - CRecordsContainer::ReadFromStream(oHeader, pStream); - } - }; -} \ No newline at end of file +class CRecordExMIDIAudioContainer : public CRecordsContainer +{ +public: + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/ExMediaAtom.cpp b/MsBinaryFile/PptFile/Records/ExMediaAtom.cpp index 597a5a7f80..e036164574 100644 --- a/MsBinaryFile/PptFile/Records/ExMediaAtom.cpp +++ b/MsBinaryFile/PptFile/Records/ExMediaAtom.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "ExMediaAtom.h" +using namespace PPT; void CRecordExMediaAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/ExMediaAtom.h b/MsBinaryFile/PptFile/Records/ExMediaAtom.h index 7adfa6bd6e..0688b5efd6 100644 --- a/MsBinaryFile/PptFile/Records/ExMediaAtom.h +++ b/MsBinaryFile/PptFile/Records/ExMediaAtom.h @@ -30,42 +30,22 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordExMediaAtom : public CUnknownRecord - { - public: - _UINT32 m_nExObjID; +class CRecordExMediaAtom : public CUnknownRecord +{ +public: + _UINT32 m_nExObjID = 0; + + bool m_bLoop = false; + bool m_bRewind = false; + bool m_bNarration = false; - bool m_bLoop; - bool m_bRewind; - bool m_bNarration; - public: - - CRecordExMediaAtom() - { - } - - ~CRecordExMediaAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_nExObjID = StreamUtils::ReadDWORD(pStream); - - USHORT nFlag = StreamUtils::ReadWORD(pStream); - - m_bLoop = ((nFlag & 0x01) == 0x01); - m_bRewind = ((nFlag & 0x02) == 0x02); - m_bNarration = ((nFlag & 0x04) == 0x04); - - StreamUtils::StreamSkip(2, pStream); - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); +}; +} diff --git a/MsBinaryFile/PptFile/Records/ExObjListAtom.cpp b/MsBinaryFile/PptFile/Records/ExObjListAtom.cpp index f892d2a166..56f27ac8fb 100644 --- a/MsBinaryFile/PptFile/Records/ExObjListAtom.cpp +++ b/MsBinaryFile/PptFile/Records/ExObjListAtom.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "ExObjListAtom.h" +using namespace PPT; void CRecordExObjListAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/ExObjListAtom.h b/MsBinaryFile/PptFile/Records/ExObjListAtom.h index edfd0ba804..314a89d19a 100644 --- a/MsBinaryFile/PptFile/Records/ExObjListAtom.h +++ b/MsBinaryFile/PptFile/Records/ExObjListAtom.h @@ -30,29 +30,18 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordExObjListAtom : public CUnknownRecord - { - public: - INT m_nObjectIdSeed; +class CRecordExObjListAtom : public CUnknownRecord +{ +public: + _INT32 m_nObjectIdSeed = -1; - CRecordExObjListAtom() - { - } - ~CRecordExObjListAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_nObjectIdSeed = StreamUtils::ReadDWORD(pStream); - } - - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/ExObjListContainer.cpp b/MsBinaryFile/PptFile/Records/ExObjListContainer.cpp index 5f54946512..b81703b149 100644 --- a/MsBinaryFile/PptFile/Records/ExObjListContainer.cpp +++ b/MsBinaryFile/PptFile/Records/ExObjListContainer.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "ExObjListContainer.h" +using namespace PPT; void CRecordExObjListContainer::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/ExObjListContainer.h b/MsBinaryFile/PptFile/Records/ExObjListContainer.h index 1a8e27d24d..c959519049 100644 --- a/MsBinaryFile/PptFile/Records/ExObjListContainer.h +++ b/MsBinaryFile/PptFile/Records/ExObjListContainer.h @@ -34,21 +34,9 @@ namespace PPT { - class CRecordExObjListContainer : public CRecordsContainer - { - public: - - CRecordExObjListContainer() - { - } - - ~CRecordExObjListContainer() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - CRecordsContainer::ReadFromStream(oHeader, pStream); - } - }; -} \ No newline at end of file +class CRecordExObjListContainer : public CRecordsContainer +{ +public: + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/ExObjRefAtom.cpp b/MsBinaryFile/PptFile/Records/ExObjRefAtom.cpp index d99dfbacd8..66f20983a4 100644 --- a/MsBinaryFile/PptFile/Records/ExObjRefAtom.cpp +++ b/MsBinaryFile/PptFile/Records/ExObjRefAtom.cpp @@ -1,35 +1,7 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "ExObjRefAtom.h" + +using namespace PPT; + void CRecordExObjRefAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { m_oHeader = oHeader; diff --git a/MsBinaryFile/PptFile/Records/ExObjRefAtom.h b/MsBinaryFile/PptFile/Records/ExObjRefAtom.h index 0ef8b7cd4d..a8398de16f 100644 --- a/MsBinaryFile/PptFile/Records/ExObjRefAtom.h +++ b/MsBinaryFile/PptFile/Records/ExObjRefAtom.h @@ -34,23 +34,12 @@ namespace PPT { - class CRecordExObjRefAtom : public CUnknownRecord - { - public: - _UINT32 m_nExObjID; +class CRecordExObjRefAtom : public CUnknownRecord +{ +public: + _UINT32 m_nExObjID = 0; - CRecordExObjRefAtom() - { - } - ~CRecordExObjRefAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - m_nExObjID = StreamUtils::ReadDWORD(pStream); - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/ExOleEmbedAtom.cpp b/MsBinaryFile/PptFile/Records/ExOleEmbedAtom.cpp index 851cea9a26..23b279d9c4 100644 --- a/MsBinaryFile/PptFile/Records/ExOleEmbedAtom.cpp +++ b/MsBinaryFile/PptFile/Records/ExOleEmbedAtom.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "ExOleEmbedAtom.h" +using namespace PPT; void CRecordExOleEmbedAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/ExOleEmbedAtom.h b/MsBinaryFile/PptFile/Records/ExOleEmbedAtom.h index c130c56e0e..d870760c73 100644 --- a/MsBinaryFile/PptFile/Records/ExOleEmbedAtom.h +++ b/MsBinaryFile/PptFile/Records/ExOleEmbedAtom.h @@ -34,31 +34,15 @@ namespace PPT { - class CRecordExOleEmbedAtom : public CUnknownRecord - { - public: - UINT m_nColorFollow; - BOOL1 m_nCantLockServer; - BOOL1 m_nNoSizeToServer; - BOOL1 m_nIsTable; +class CRecordExOleEmbedAtom : public CUnknownRecord +{ +public: + UINT m_nColorFollow; + BOOL1 m_nCantLockServer; + BOOL1 m_nNoSizeToServer; + BOOL1 m_nIsTable; - CRecordExOleEmbedAtom() - { - } - ~CRecordExOleEmbedAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_nColorFollow = StreamUtils::ReadLONG(pStream); - m_nCantLockServer = StreamUtils::ReadBYTE(pStream); - m_nNoSizeToServer = StreamUtils::ReadBYTE(pStream); - m_nIsTable = StreamUtils::ReadBYTE(pStream); - StreamUtils::StreamSkip(1, pStream); - } - }; + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; } diff --git a/MsBinaryFile/PptFile/Records/ExOleLinkAtom.cpp b/MsBinaryFile/PptFile/Records/ExOleLinkAtom.cpp index 11a558ecba..0a01fd6dfa 100644 --- a/MsBinaryFile/PptFile/Records/ExOleLinkAtom.cpp +++ b/MsBinaryFile/PptFile/Records/ExOleLinkAtom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ - #include "ExOleLinkAtom.h" +#include "ExOleLinkAtom.h" +using namespace PPT; void CRecordExOleLinkAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/ExOleLinkAtom.h b/MsBinaryFile/PptFile/Records/ExOleLinkAtom.h index a1d06fa9d3..450d01e99a 100644 --- a/MsBinaryFile/PptFile/Records/ExOleLinkAtom.h +++ b/MsBinaryFile/PptFile/Records/ExOleLinkAtom.h @@ -30,27 +30,19 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordExOleLinkAtom : public CUnknownRecord - { - public: - UINT m_nSlideID; - UINT m_nOleUpdateMode; +class CRecordExOleLinkAtom : public CUnknownRecord +{ +public: + UINT m_nSlideID; + UINT m_nOleUpdateMode; - CRecordExOleLinkAtom() - { - } - ~CRecordExOleLinkAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - return CUnknownRecord::ReadFromStream(oHeader, pStream); - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/ExOleObjAtom.cpp b/MsBinaryFile/PptFile/Records/ExOleObjAtom.cpp index 3c7d1c656c..d60f3e3917 100644 --- a/MsBinaryFile/PptFile/Records/ExOleObjAtom.cpp +++ b/MsBinaryFile/PptFile/Records/ExOleObjAtom.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "ExOleObjAtom.h" +using namespace PPT; void CRecordExOleObjAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/ExOleObjAtom.h b/MsBinaryFile/PptFile/Records/ExOleObjAtom.h index 294e72e8e4..c9870fa41e 100644 --- a/MsBinaryFile/PptFile/Records/ExOleObjAtom.h +++ b/MsBinaryFile/PptFile/Records/ExOleObjAtom.h @@ -34,102 +34,28 @@ namespace PPT { - class CRecordExOleObjAtom : public CUnknownRecord - { - UINT m_nDrawAspect; - UINT m_nType; - UINT m_nExObjID; - UINT m_nSubType; - UINT m_nPersistID; +class CRecordExOleObjAtom : public CUnknownRecord +{ +public: + UINT m_nDrawAspect; + UINT m_nType; + UINT m_nExObjID; + UINT m_nSubType; + UINT m_nPersistID; - public: - CRecordExOleObjAtom() - { - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; - ~CRecordExOleObjAtom() - { - } +class CRecordExOleObjStg : public CUnknownRecord +{ +public: + std::wstring m_sFileName; + std::wstring m_strTmpDirectory; + + CRecordExOleObjStg(std::wstring strTemp); + ~CRecordExOleObjStg(); - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_nDrawAspect = StreamUtils::ReadDWORD(pStream); - m_nType = StreamUtils::ReadDWORD(pStream); - m_nExObjID = StreamUtils::ReadDWORD(pStream); - m_nSubType = StreamUtils::ReadDWORD(pStream); - m_nPersistID = StreamUtils::ReadDWORD(pStream); - - StreamUtils::StreamSkip(4, pStream); //unused - } - }; - class CRecordExOleObjStg : public CUnknownRecord - { - public: - std::wstring m_sFileName; - std::wstring m_strTmpDirectory; - - CRecordExOleObjStg(std::wstring strTemp) : m_strTmpDirectory(strTemp) - { - } - - ~CRecordExOleObjStg() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - ULONG decompressedSize = m_oHeader.RecLen, compressedSize = m_oHeader.RecLen; - - if (m_oHeader.RecInstance == 0x01) - { - compressedSize = m_oHeader.RecLen - 4; - decompressedSize = StreamUtils::ReadDWORD(pStream); - } - - BYTE* pData = (compressedSize > 0 && compressedSize < 0xffffff) ? new BYTE[compressedSize] : NULL; - - if (!pData) return; - - compressedSize = pStream->read(pData, compressedSize); - - if (m_oHeader.RecInstance == 0x01) - { - BYTE* pDataUncompress = (compressedSize > 0 && compressedSize < 0xffffff) ? new BYTE[decompressedSize + 64] : NULL; - if ((pDataUncompress) && (NSZip::Decompress(pData, compressedSize, pDataUncompress, decompressedSize))) - { - delete[]pData; - pData = pDataUncompress; - } - else - { - delete[]pData; - pData = NULL; - } - } - //if (pDecryptor) - //{ - // pDecryptor->Decrypt((char*)pData, oHeader.RecLen - lOffset, 0); - //} - if (pData) - { - m_sFileName = m_strTmpDirectory + FILE_SEPARATOR_STR + L"oleObject_xxx.bin"; - - NSFile::CFileBinary file; - if (file.CreateFileW(m_sFileName)) - { - file.WriteFile(pData, decompressedSize); - file.CloseFile(); - } - delete[] pData; - pData = NULL; - } - - } - - }; + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; } diff --git a/MsBinaryFile/PptFile/Records/ExVideoContainer.cpp b/MsBinaryFile/PptFile/Records/ExVideoContainer.cpp index 53876a567d..8ed15b7630 100644 --- a/MsBinaryFile/PptFile/Records/ExVideoContainer.cpp +++ b/MsBinaryFile/PptFile/Records/ExVideoContainer.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "ExVideoContainer.h" +using namespace PPT; void CRecordExVideoContainer::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/ExVideoContainer.h b/MsBinaryFile/PptFile/Records/ExVideoContainer.h index dfcfe4c820..f22e53ad28 100644 --- a/MsBinaryFile/PptFile/Records/ExVideoContainer.h +++ b/MsBinaryFile/PptFile/Records/ExVideoContainer.h @@ -32,23 +32,12 @@ #pragma once #include "../Reader/Records.h" + namespace PPT { - class CRecordExVideoContainer : public CRecordsContainer - { - public: - - CRecordExVideoContainer() - { - } - - ~CRecordExVideoContainer() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - CRecordsContainer::ReadFromStream(oHeader, pStream); - } - }; -} \ No newline at end of file +class CRecordExVideoContainer : public CRecordsContainer +{ +public: + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/ExWAVAudioEmbeddedContainer.cpp b/MsBinaryFile/PptFile/Records/ExWAVAudioEmbeddedContainer.cpp index a3fe84646c..dff93a93a2 100644 --- a/MsBinaryFile/PptFile/Records/ExWAVAudioEmbeddedContainer.cpp +++ b/MsBinaryFile/PptFile/Records/ExWAVAudioEmbeddedContainer.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "ExWAVAudioEmbeddedContainer.h" +using namespace PPT; void CRecordWAVAudioEmbeddedContainer::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/ExWAVAudioEmbeddedContainer.h b/MsBinaryFile/PptFile/Records/ExWAVAudioEmbeddedContainer.h index 3656c9a7b5..0c53e0ede6 100644 --- a/MsBinaryFile/PptFile/Records/ExWAVAudioEmbeddedContainer.h +++ b/MsBinaryFile/PptFile/Records/ExWAVAudioEmbeddedContainer.h @@ -30,43 +30,21 @@ * */ #pragma once + #include "ExMediaAtom.h" + namespace PPT { - class CRecordWAVAudioEmbeddedContainer : public CRecordsContainer - { - public: - CRecordExMediaAtom m_oMedia; +class CRecordWAVAudioEmbeddedContainer : public CRecordsContainer +{ +public: + CRecordExMediaAtom m_oMedia; + + _UINT32 m_nSoundID = 0; + LONG m_nDuration = 0; - _UINT32 m_nSoundID; - LONG m_nDuration; - public: - - CRecordWAVAudioEmbeddedContainer() - { - m_nSoundID = 0; - m_nDuration = 0; - } - - ~CRecordWAVAudioEmbeddedContainer() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - SRecordHeader oExHeader; - oExHeader.ReadFromStream(pStream); - - m_oMedia.ReadFromStream(oExHeader, pStream); - - StreamUtils::StreamSkip(8, pStream); - - m_nSoundID = StreamUtils::ReadDWORD(pStream); - m_nDuration = StreamUtils::ReadLONG(pStream); - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/ExWAVAudioLinkContainer.cpp b/MsBinaryFile/PptFile/Records/ExWAVAudioLinkContainer.cpp index e7be70e018..a26e648595 100644 --- a/MsBinaryFile/PptFile/Records/ExWAVAudioLinkContainer.cpp +++ b/MsBinaryFile/PptFile/Records/ExWAVAudioLinkContainer.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "ExWAVAudioLinkContainer.h" +using namespace PPT; void CRecordWAVAudioLinkContainer::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/ExWAVAudioLinkContainer.h b/MsBinaryFile/PptFile/Records/ExWAVAudioLinkContainer.h index 0180e47a3e..77f9619ae3 100644 --- a/MsBinaryFile/PptFile/Records/ExWAVAudioLinkContainer.h +++ b/MsBinaryFile/PptFile/Records/ExWAVAudioLinkContainer.h @@ -34,21 +34,9 @@ namespace PPT { - class CRecordWAVAudioLinkContainer : public CRecordsContainer - { - public: - - CRecordWAVAudioLinkContainer() - { - } - - ~CRecordWAVAudioLinkContainer() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - CRecordsContainer::ReadFromStream(oHeader, pStream); - } - }; -} \ No newline at end of file +class CRecordWAVAudioLinkContainer : public CRecordsContainer +{ +public: + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/FontCollection10Container.cpp b/MsBinaryFile/PptFile/Records/FontCollection10Container.cpp index 911c972c73..07c0c510d2 100644 --- a/MsBinaryFile/PptFile/Records/FontCollection10Container.cpp +++ b/MsBinaryFile/PptFile/Records/FontCollection10Container.cpp @@ -1,43 +1,13 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "FontCollection10Container.h" +using namespace PPT; CRecordFontCollection10Container::~CRecordFontCollection10Container() -{/* +{ for (auto pEl : m_rgFontCollectionEntry) { RELEASEOBJECT(pEl) - }*/ + } } void CRecordFontCollection10Container::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) @@ -50,16 +20,16 @@ void CRecordFontCollection10Container::ReadFromStream(SRecordHeader &oHeader, PO SRecordHeader ReadHeader; -// while ( lCurLen < m_oHeader.RecLen ) -// { -// if ( ReadHeader.ReadFromStream(pStream) == false) -// break; + while ( lCurLen < m_oHeader.RecLen ) + { + if ( ReadHeader.ReadFromStream(pStream) == false) + break; -// lCurLen += 8 + ReadHeader.RecLen; + lCurLen += 8 + ReadHeader.RecLen; -// auto pRec = new FontCollectionEntry; -// pRec->ReadFromStream(pStream); -// m_rgFontCollectionEntry.push_back(pRec); -// } + auto pRec = new FontCollectionEntry; + pRec->ReadFromStream(pStream); + m_rgFontCollectionEntry.push_back(pRec); + } StreamUtils::StreamSeek(lPos + m_oHeader.RecLen, pStream); } diff --git a/MsBinaryFile/PptFile/Records/FontCollection10Container.h b/MsBinaryFile/PptFile/Records/FontCollection10Container.h index e699432d74..77c89ab8a3 100644 --- a/MsBinaryFile/PptFile/Records/FontCollection10Container.h +++ b/MsBinaryFile/PptFile/Records/FontCollection10Container.h @@ -42,36 +42,8 @@ public: std::vector m_rgFontCollectionEntry; public: - virtual ~CRecordFontCollection10Container() - { - for (auto pEl : m_rgFontCollectionEntry) - { - RELEASEOBJECT(pEl) - } - } + virtual ~CRecordFontCollection10Container(); - virtual void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) - { - m_oHeader = oHeader; - LONG lPos = 0; - StreamUtils::StreamPosition ( lPos, pStream ); - - _UINT32 lCurLen = 0; - - SRecordHeader ReadHeader; - - while ( lCurLen < m_oHeader.RecLen ) - { - if ( ReadHeader.ReadFromStream(pStream) == false) - break; - - lCurLen += 8 + ReadHeader.RecLen; - - auto pRec = new FontCollectionEntry; - pRec->ReadFromStream(pStream); - m_rgFontCollectionEntry.push_back(pRec); - } - StreamUtils::StreamSeek(lPos + m_oHeader.RecLen, pStream); - } + virtual void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; }; } diff --git a/MsBinaryFile/PptFile/Records/FontEmbedFlags10Atom.cpp b/MsBinaryFile/PptFile/Records/FontEmbedFlags10Atom.cpp index a5bb8235c8..0264bc49da 100644 --- a/MsBinaryFile/PptFile/Records/FontEmbedFlags10Atom.cpp +++ b/MsBinaryFile/PptFile/Records/FontEmbedFlags10Atom.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "FontEmbedFlags10Atom.h" +using namespace PPT; void CRecordFontEmbedFlags10Atom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/FontEmbedFlags10Atom.h b/MsBinaryFile/PptFile/Records/FontEmbedFlags10Atom.h index 77e38aee50..d0e7bf1b8a 100644 --- a/MsBinaryFile/PptFile/Records/FontEmbedFlags10Atom.h +++ b/MsBinaryFile/PptFile/Records/FontEmbedFlags10Atom.h @@ -39,17 +39,10 @@ namespace PPT class CRecordFontEmbedFlags10Atom : public CUnknownRecord { public: - bool m_fSubset; - bool m_fSubsetOptionConfirmed; + bool m_fSubset = false; + bool m_fSubsetOptionConfirmed = false; - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - _UINT32 flags = StreamUtils::ReadDWORD(pStream); - m_fSubset = 0x1 & flags; - m_fSubsetOptionConfirmed = 0x2 & flags; - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; }; } diff --git a/MsBinaryFile/PptFile/Records/FontEntityAtom.cpp b/MsBinaryFile/PptFile/Records/FontEntityAtom.cpp index 33b5f49b05..222fe0f264 100644 --- a/MsBinaryFile/PptFile/Records/FontEntityAtom.cpp +++ b/MsBinaryFile/PptFile/Records/FontEntityAtom.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "FontEntityAtom.h" +using namespace PPT; void CRecordFontEntityAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/FontEntityAtom.h b/MsBinaryFile/PptFile/Records/FontEntityAtom.h index c66628a02b..861a1186a3 100644 --- a/MsBinaryFile/PptFile/Records/FontEntityAtom.h +++ b/MsBinaryFile/PptFile/Records/FontEntityAtom.h @@ -34,94 +34,32 @@ namespace PPT { - class CRecordFontEntityAtom : public CUnknownRecord - { - public: - std::wstring m_strFaceName; +class CRecordFontEntityAtom : public CUnknownRecord +{ +public: + std::wstring m_strFaceName; - BYTE m_lfCharSet; + BYTE m_lfCharSet; - bool m_bEmbedSubsetted; - bool m_bIsRaster; - bool m_bIsDevice; - bool m_bIsTrueType; - bool m_bIsNoFontSubstitution; + bool m_bEmbedSubsetted; + bool m_bIsRaster; + bool m_bIsDevice; + bool m_bIsTrueType; + bool m_bIsNoFontSubstitution; - BYTE m_lfPitchAndFamily; - - CRecordFontEntityAtom() {} - - ~CRecordFontEntityAtom() {} - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - //face name - utf16 string with 0, 64 bytes always allocated - unsigned char utf16FaceName[64 + 2] = {}; - - POLE::uint64 lReadByte = pStream->read(utf16FaceName, 64); - - if (sizeof(wchar_t) == 4) - { - ULONG lLen = 0; - for (lLen = 0; lLen < lReadByte; lLen += 2) - if (utf16FaceName[lLen] == 0)break; - - lLen /= 2; - - UTF32 *pStrUtf32 = new UTF32[lLen + 1]; - pStrUtf32[lLen] = 0; - - const UTF16 *pStrUtf16_Conv = (const UTF16 *)utf16FaceName; - UTF32 *pStrUtf32_Conv = pStrUtf32; - - if (conversionOK == ConvertUTF16toUTF32(&pStrUtf16_Conv, &pStrUtf16_Conv[lLen] - , &pStrUtf32_Conv, &pStrUtf32[lLen] - , strictConversion)) - { - m_strFaceName = std::wstring((wchar_t*)pStrUtf32/*, lLen*/); - } - delete[] pStrUtf32; - } - else - { - m_strFaceName = std::wstring((wchar_t*)utf16FaceName/*, lReadByte/2*/); // по факту .. нули нам не нужны - } - m_lfCharSet = StreamUtils::ReadBYTE(pStream); - - BYTE Mem = 0; - Mem = StreamUtils::ReadBYTE(pStream); - m_bEmbedSubsetted = ((Mem & 0x01) == 0x01); - - Mem = 0; - Mem = StreamUtils::ReadBYTE(pStream); - - m_bIsRaster = ((Mem & 0x01) == 0x01); - m_bIsDevice = ((Mem & 0x02) == 0x02); - m_bIsTrueType = ((Mem & 0x04) == 0x04); - m_bIsNoFontSubstitution = ((Mem & 0x08) == 0x08); - - m_lfPitchAndFamily = StreamUtils::ReadBYTE(pStream); - } - }; + BYTE m_lfPitchAndFamily; - class CRecordFontEmbedDataBlob : public CUnknownRecord - { - public: - std::pair, _INT32> data; + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; + + +class CRecordFontEmbedDataBlob : public CUnknownRecord +{ +public: + std::pair, _INT32> data; //font data of an embedded font - CRecordFontEmbedDataBlob() {} - ~CRecordFontEmbedDataBlob() {} - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - data = std::make_pair(boost::shared_array(new unsigned char[m_oHeader.RecLen]), m_oHeader.RecLen); - pStream->read(data.first.get(), data.second); - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/GridSpacing10Atom.cpp b/MsBinaryFile/PptFile/Records/GridSpacing10Atom.cpp index 17da423057..05ae647a3f 100644 --- a/MsBinaryFile/PptFile/Records/GridSpacing10Atom.cpp +++ b/MsBinaryFile/PptFile/Records/GridSpacing10Atom.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "GridSpacing10Atom.h" +using namespace PPT; void CRecordGridSpacing10Atom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/GridSpacing10Atom.h b/MsBinaryFile/PptFile/Records/GridSpacing10Atom.h index aae94eefe6..c49c6960fe 100644 --- a/MsBinaryFile/PptFile/Records/GridSpacing10Atom.h +++ b/MsBinaryFile/PptFile/Records/GridSpacing10Atom.h @@ -34,23 +34,13 @@ namespace PPT { - class CRecordGridSpacing10Atom : public CUnknownRecord - { - public: - INT m_nX; - INT m_nY; +class CRecordGridSpacing10Atom : public CUnknownRecord +{ +public: + INT m_nX = 0; + INT m_nY = 0; - CRecordGridSpacing10Atom() - { - } - ~CRecordGridSpacing10Atom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - return CUnknownRecord::ReadFromStream(oHeader, pStream); - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/GuideAtom.cpp b/MsBinaryFile/PptFile/Records/GuideAtom.cpp index 08cb17db35..d2c3c40bb1 100644 --- a/MsBinaryFile/PptFile/Records/GuideAtom.cpp +++ b/MsBinaryFile/PptFile/Records/GuideAtom.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "GuideAtom.h" +using namespace PPT; void CRecordGuideAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/GuideAtom.h b/MsBinaryFile/PptFile/Records/GuideAtom.h index f8d7de6025..579e4c7122 100644 --- a/MsBinaryFile/PptFile/Records/GuideAtom.h +++ b/MsBinaryFile/PptFile/Records/GuideAtom.h @@ -30,30 +30,19 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordGuideAtom : public CUnknownRecord - { - _UINT32 m_nType; - _UINT32 m_nPos; +class CRecordGuideAtom : public CUnknownRecord +{ +public: + _UINT32 m_nType; + _UINT32 m_nPos; - public: - CRecordGuideAtom() - { - } - - ~CRecordGuideAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - m_nType = StreamUtils::ReadDWORD(pStream); - m_nPos = StreamUtils::ReadDWORD(pStream); - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/HeadersFootersAtom.cpp b/MsBinaryFile/PptFile/Records/HeadersFootersAtom.cpp index 13466ce886..9360ec09d6 100644 --- a/MsBinaryFile/PptFile/Records/HeadersFootersAtom.cpp +++ b/MsBinaryFile/PptFile/Records/HeadersFootersAtom.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "HeadersFootersAtom.h" +using namespace PPT; void CRecordHeadersFootersAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/HeadersFootersAtom.h b/MsBinaryFile/PptFile/Records/HeadersFootersAtom.h index d431ac4770..ee18e30138 100644 --- a/MsBinaryFile/PptFile/Records/HeadersFootersAtom.h +++ b/MsBinaryFile/PptFile/Records/HeadersFootersAtom.h @@ -35,191 +35,89 @@ namespace PPT { - class CRecordHeadersFootersAtom : public CUnknownRecord - { - public: - WORD m_nFormatID; - - bool m_bHasDate; - bool m_bHasTodayDate; - bool m_bHasUserDate; - bool m_bHasSlideNumber; - bool m_bHasHeader; - bool m_bHasFooter; - - CRecordHeadersFootersAtom() - { - } - - ~CRecordHeadersFootersAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_nFormatID = StreamUtils::ReadWORD(pStream); - - BYTE nFlag = StreamUtils::ReadBYTE(pStream); - m_bHasDate = ((nFlag & 0x01) == 0x01); - m_bHasTodayDate = ((nFlag & 0x02) == 0x02); - m_bHasUserDate = ((nFlag & 0x04) == 0x04); - m_bHasSlideNumber = ((nFlag & 0x08) == 0x08); - m_bHasHeader = ((nFlag & 0x10) == 0x10); - m_bHasFooter = ((nFlag & 0x20) == 0x20); - - StreamUtils::ReadBYTE(pStream);//reserved - } - }; +class CRecordHeadersFootersAtom : public CUnknownRecord +{ +public: + WORD m_nFormatID; + + bool m_bHasDate; + bool m_bHasTodayDate; + bool m_bHasUserDate; + bool m_bHasSlideNumber; + bool m_bHasHeader; + bool m_bHasFooter; - class CRecordRoundTripHeaderFooterDefaults12Atom : public CUnknownRecord - { - public: - WORD m_nFormatID; - - bool m_bIncludeDate; - bool m_bIncludeFooter; - bool m_bIncludeHeader; - bool m_bIncludeSlideNumber; - - CRecordRoundTripHeaderFooterDefaults12Atom() - { - } - - ~CRecordRoundTripHeaderFooterDefaults12Atom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - BYTE nFlag = StreamUtils::ReadBYTE(pStream); - - m_bIncludeDate = ((nFlag & 0x04) == 0x04); - m_bIncludeFooter = ((nFlag & 0x08) == 0x08); - m_bIncludeHeader = ((nFlag & 0x10) == 0x10); - m_bIncludeSlideNumber = ((nFlag & 0x20) == 0x20); - } - }; - - class CRecordMetaCharacterAtom : public CUnknownRecord - { - public: - _UINT32 m_nPosition; + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; - CRecordMetaCharacterAtom() - { - m_nPosition = -1; - } - - ~CRecordMetaCharacterAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - if (oHeader.RecLen >= 4) - { - m_nPosition = StreamUtils::ReadDWORD(pStream); - } - } - }; - - class CRecordGenericDateMetaAtom : public CRecordMetaCharacterAtom - { - }; - - class CRecordRTFDateTimeMetaAtom : public CRecordGenericDateMetaAtom - { - public: - std::string m_strFormat; - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - CRecordGenericDateMetaAtom::ReadFromStream(oHeader, pStream); - - m_strFormat = StreamUtils::ReadStringA(pStream, 128); - } - }; - - class CRecordDateTimeMetaAtom : public CRecordGenericDateMetaAtom - { - public: - _UINT32 m_FormatID; - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - POLE::uint64 lPosition = pStream->tell(); - - CRecordGenericDateMetaAtom::ReadFromStream(oHeader, pStream); - - if (oHeader.RecLen == 8) - { - m_FormatID = StreamUtils::ReadDWORD(pStream); - } - else if (oHeader.RecLen > 4) - { - m_FormatID = StreamUtils::ReadBYTE(pStream); - StreamUtils::StreamSeek((long)(lPosition + m_oHeader.RecLen), pStream); - } - } - }; +class CRecordRoundTripHeaderFooterDefaults12Atom : public CUnknownRecord +{ +public: + WORD m_nFormatID; + + bool m_bIncludeDate; + bool m_bIncludeFooter; + bool m_bIncludeHeader; + bool m_bIncludeSlideNumber; - class CRecordFooterMetaAtom : public CRecordMetaCharacterAtom - { - }; + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; - class CRecordHeaderMetaAtom : public CRecordMetaCharacterAtom - { - }; +class CRecordMetaCharacterAtom : public CUnknownRecord +{ +public: + _UINT32 m_nPosition = -1; - class CRecordSlideNumberMetaAtom : public CRecordMetaCharacterAtom - { - }; - class CRecordHeadersFootersContainer : public CRecordsContainer - { - public: - vector_string m_HeadersFootersString[3]; //0-dates, 1 - headers, 2 - footers + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; - CRecordHeadersFootersAtom *m_oHeadersFootersAtom; +class CRecordGenericDateMetaAtom : public CRecordMetaCharacterAtom +{ +}; - CRecordHeadersFootersContainer() - { - m_oHeadersFootersAtom = NULL; - } +class CRecordRTFDateTimeMetaAtom : public CRecordGenericDateMetaAtom +{ +public: + std::string m_strFormat; + - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - CRecordsContainer::ReadFromStream(oHeader, pStream); + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); +}; - for (size_t i = 0; i < m_arRecords.size(); i++) - { - switch (m_arRecords[i]->m_oHeader.RecType) - { - case 0x0FDA: - m_oHeadersFootersAtom = dynamic_cast(m_arRecords[i]); - break; - case 0xFBA: - { - CRecordCString *str = dynamic_cast(m_arRecords[i]); - switch (m_arRecords[i]->m_oHeader.RecInstance) - { - case 0x000: m_HeadersFootersString[0].push_back(str->m_strText); break; - case 0x001: m_HeadersFootersString[1].push_back(str->m_strText); break; - case 0x002: m_HeadersFootersString[2].push_back(str->m_strText); break; - } - }break; - } - } +class CRecordDateTimeMetaAtom : public CRecordGenericDateMetaAtom +{ +public: + _UINT32 m_FormatID; - } - }; -} \ No newline at end of file + + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; + + +class CRecordFooterMetaAtom : public CRecordMetaCharacterAtom +{ +}; + +class CRecordHeaderMetaAtom : public CRecordMetaCharacterAtom +{ +}; + +class CRecordSlideNumberMetaAtom : public CRecordMetaCharacterAtom +{ +}; + +class CRecordHeadersFootersContainer : public CRecordsContainer +{ +public: + vector_string m_HeadersFootersString[3]; //0-dates, 1 - headers, 2 - footers + + CRecordHeadersFootersAtom *m_oHeadersFootersAtom = nullptr; + + + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/InteractiveInfoAtom.cpp b/MsBinaryFile/PptFile/Records/InteractiveInfoAtom.cpp index 7517d45c53..16f2e21f64 100644 --- a/MsBinaryFile/PptFile/Records/InteractiveInfoAtom.cpp +++ b/MsBinaryFile/PptFile/Records/InteractiveInfoAtom.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "InteractiveInfoAtom.h" +using namespace PPT; void CRecordInteractiveInfoAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/InteractiveInfoAtom.h b/MsBinaryFile/PptFile/Records/InteractiveInfoAtom.h index 7e624e0e00..15135d2fb5 100644 --- a/MsBinaryFile/PptFile/Records/InteractiveInfoAtom.h +++ b/MsBinaryFile/PptFile/Records/InteractiveInfoAtom.h @@ -35,51 +35,22 @@ namespace PPT { - class CRecordInteractiveInfoAtom : public CUnknownRecord - { - public: - UINT m_nSoundIdRef; - UINT m_nExHyperlinkIdRef; - BYTE m_nAction; - BYTE m_nOleVerb; - BYTE m_nJump; - BYTE m_nHyperlinkType; +class CRecordInteractiveInfoAtom : public CUnknownRecord +{ +public: + UINT m_nSoundIdRef; + UINT m_nExHyperlinkIdRef; + BYTE m_nAction; + BYTE m_nOleVerb; + BYTE m_nJump; + BYTE m_nHyperlinkType; - bool m_bAnimated; - bool m_bStopSound; - bool m_bCustomShowReturn; - bool m_bVisited; + bool m_bAnimated; + bool m_bStopSound; + bool m_bCustomShowReturn; + bool m_bVisited; - CRecordInteractiveInfoAtom() - { - } - ~CRecordInteractiveInfoAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_nSoundIdRef = StreamUtils::ReadDWORD(pStream); - m_nExHyperlinkIdRef = StreamUtils::ReadDWORD(pStream); - m_nAction = StreamUtils::ReadBYTE(pStream); - m_nOleVerb = StreamUtils::ReadBYTE(pStream); - m_nJump = StreamUtils::ReadBYTE(pStream); - - BYTE nFlag = StreamUtils::ReadBYTE(pStream); - - m_bAnimated = ((nFlag & 0x01) == 0x01); - m_bStopSound = ((nFlag & 0x02) == 0x02); - m_bCustomShowReturn = ((nFlag & 0x04) == 0x04); - m_bVisited = ((nFlag & 0x08) == 0x08); - - m_nHyperlinkType = StreamUtils::ReadBYTE(pStream); - StreamUtils::StreamSkip(3, pStream); - // if (m_nExHyperlinkIdRef) - // std::wcout << L"HyperlinkIDRef: " << m_nExHyperlinkIdRef << std::endl;; - - } - }; + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; } diff --git a/MsBinaryFile/PptFile/Records/KinsokuAtom.cpp b/MsBinaryFile/PptFile/Records/KinsokuAtom.cpp index 8cddfa8f30..57ab0230e6 100644 --- a/MsBinaryFile/PptFile/Records/KinsokuAtom.cpp +++ b/MsBinaryFile/PptFile/Records/KinsokuAtom.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "KinsokuAtom.h" +using namespace PPT; void CRecordKinsokuAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/KinsokuAtom.h b/MsBinaryFile/PptFile/Records/KinsokuAtom.h index 6954665def..1fbf33c0a2 100644 --- a/MsBinaryFile/PptFile/Records/KinsokuAtom.h +++ b/MsBinaryFile/PptFile/Records/KinsokuAtom.h @@ -30,29 +30,18 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordKinsokuAtom : public CUnknownRecord - { - public: - _UINT32 m_nLevel; +class CRecordKinsokuAtom : public CUnknownRecord +{ +public: + _UINT32 m_nLevel = 0; - CRecordKinsokuAtom() - { - } - ~CRecordKinsokuAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_nLevel = StreamUtils::ReadDWORD(pStream); - } - - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/KinsokuContainer.cpp b/MsBinaryFile/PptFile/Records/KinsokuContainer.cpp index cb9f19b0da..aee4347f13 100644 --- a/MsBinaryFile/PptFile/Records/KinsokuContainer.cpp +++ b/MsBinaryFile/PptFile/Records/KinsokuContainer.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "KinsokuContainer.h" +using namespace PPT; void CRecordKinsokuContainer::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/KinsokuContainer.h b/MsBinaryFile/PptFile/Records/KinsokuContainer.h index 301ef8ae2c..261edc752e 100644 --- a/MsBinaryFile/PptFile/Records/KinsokuContainer.h +++ b/MsBinaryFile/PptFile/Records/KinsokuContainer.h @@ -35,24 +35,15 @@ #include "KinsokuFollowingAtom.h" #include "KinsokuLeadingAtom.h" +namespace PPT +{ class CRecordKinsokuContainer : public CUnknownRecord { public: - _UINT32 m_nLevel; + _UINT32 m_nLevel = 0; - CRecordKinsokuContainer() - { - } - ~CRecordKinsokuContainer() - { - } - - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - CUnknownRecord::ReadFromStream(m_oHeader, pStream); - } + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; public: @@ -61,3 +52,4 @@ public: CRecordKinsokuFollowingAtom m_KinsokuFollowingAtom; }; +} diff --git a/MsBinaryFile/PptFile/Records/KinsokuFollowingAtom.cpp b/MsBinaryFile/PptFile/Records/KinsokuFollowingAtom.cpp index 0013f6cfb8..057c716cd0 100644 --- a/MsBinaryFile/PptFile/Records/KinsokuFollowingAtom.cpp +++ b/MsBinaryFile/PptFile/Records/KinsokuFollowingAtom.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "KinsokuFollowingAtom.h" +using namespace PPT; void CRecordKinsokuFollowingAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/KinsokuFollowingAtom.h b/MsBinaryFile/PptFile/Records/KinsokuFollowingAtom.h index 75ae3f5466..09de52415f 100644 --- a/MsBinaryFile/PptFile/Records/KinsokuFollowingAtom.h +++ b/MsBinaryFile/PptFile/Records/KinsokuFollowingAtom.h @@ -30,25 +30,18 @@ * */ #pragma once + #include "../Reader/Records.h" + +namespace PPT +{ class CRecordKinsokuFollowingAtom : public CUnknownRecord { public: std::wstring m_arKinsokuFollowing; - CRecordKinsokuFollowingAtom() - { - } - ~CRecordKinsokuFollowingAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_arKinsokuFollowing = StreamUtils::ReadStringW(pStream, m_oHeader.RecLen - sizeof (oHeader)); - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; }; +} diff --git a/MsBinaryFile/PptFile/Records/KinsokuLeadingAtom.cpp b/MsBinaryFile/PptFile/Records/KinsokuLeadingAtom.cpp index 8307861b4f..5c4a32bf18 100644 --- a/MsBinaryFile/PptFile/Records/KinsokuLeadingAtom.cpp +++ b/MsBinaryFile/PptFile/Records/KinsokuLeadingAtom.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "KinsokuLeadingAtom.h" +using namespace PPT; void CRecordKinsokuLeadingAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/KinsokuLeadingAtom.h b/MsBinaryFile/PptFile/Records/KinsokuLeadingAtom.h index 58e1982fb2..bbdc511344 100644 --- a/MsBinaryFile/PptFile/Records/KinsokuLeadingAtom.h +++ b/MsBinaryFile/PptFile/Records/KinsokuLeadingAtom.h @@ -30,25 +30,17 @@ * */ #pragma once + #include "../Reader/Records.h" +namespace PPT +{ class CRecordKinsokuLeadingAtom : public CUnknownRecord { public: std::wstring m_arKinsokuLeading; - CRecordKinsokuLeadingAtom() - { - } - ~CRecordKinsokuLeadingAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_arKinsokuLeading = StreamUtils::ReadStringW(pStream, m_oHeader.RecLen - sizeof (oHeader)); - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; }; +} diff --git a/MsBinaryFile/PptFile/Records/LinkedShape10Atom.cpp b/MsBinaryFile/PptFile/Records/LinkedShape10Atom.cpp index d7cfcb7b66..ecabbaeb8f 100644 --- a/MsBinaryFile/PptFile/Records/LinkedShape10Atom.cpp +++ b/MsBinaryFile/PptFile/Records/LinkedShape10Atom.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "LinkedShape10Atom.h" +using namespace PPT; void CRecordLinkedShape10Atom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/LinkedShape10Atom.h b/MsBinaryFile/PptFile/Records/LinkedShape10Atom.h index 33abe62c0b..dcc1aa341d 100644 --- a/MsBinaryFile/PptFile/Records/LinkedShape10Atom.h +++ b/MsBinaryFile/PptFile/Records/LinkedShape10Atom.h @@ -38,17 +38,11 @@ namespace PPT { class CRecordLinkedShape10Atom : public CUnknownRecord { -public: -void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override -{ - m_oHeader = oHeader; - - m_nShapeIdRef = StreamUtils::ReadLONG(pStream); - m_nLinkedShapeIdRef = StreamUtils::ReadLONG(pStream); -} - public: _UINT32 m_nShapeIdRef; _UINT32 m_nLinkedShapeIdRef; + + + void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; }; } diff --git a/MsBinaryFile/PptFile/Records/LinkedSlide10Atom.cpp b/MsBinaryFile/PptFile/Records/LinkedSlide10Atom.cpp index 5be2e09c9d..b84c67332f 100644 --- a/MsBinaryFile/PptFile/Records/LinkedSlide10Atom.cpp +++ b/MsBinaryFile/PptFile/Records/LinkedSlide10Atom.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "LinkedSlide10Atom.h" +using namespace PPT; void CRecordLinkedSlide10Atom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/LinkedSlide10Atom.h b/MsBinaryFile/PptFile/Records/LinkedSlide10Atom.h index 62073edbb1..745c636dd7 100644 --- a/MsBinaryFile/PptFile/Records/LinkedSlide10Atom.h +++ b/MsBinaryFile/PptFile/Records/LinkedSlide10Atom.h @@ -39,17 +39,11 @@ typedef _UINT32 SlideIdRef; class CRecordLinkedSlide10Atom : public CUnknownRecord { -public: -void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override -{ - m_oHeader = oHeader; - - m_nLinkedSlideIdRef = StreamUtils::ReadLONG(pStream); - m_cLinkedShapes = StreamUtils::ReadLONG(pStream); -} - public: SlideIdRef m_nLinkedSlideIdRef; _INT32 m_cLinkedShapes; + + + void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; }; } diff --git a/MsBinaryFile/PptFile/Records/MasterPersistAtom.cpp b/MsBinaryFile/PptFile/Records/MasterPersistAtom.cpp index c84268a553..dadda811d7 100644 --- a/MsBinaryFile/PptFile/Records/MasterPersistAtom.cpp +++ b/MsBinaryFile/PptFile/Records/MasterPersistAtom.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "MasterPersistAtom.h" +using namespace PPT; void CRecordMasterPersistAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/MasterPersistAtom.h b/MsBinaryFile/PptFile/Records/MasterPersistAtom.h index e4d1e4f9eb..99e1cff5ba 100644 --- a/MsBinaryFile/PptFile/Records/MasterPersistAtom.h +++ b/MsBinaryFile/PptFile/Records/MasterPersistAtom.h @@ -30,28 +30,19 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordMasterPersistAtom : public CUnknownRecord - { - public: - UINT m_nPsrRef; - INT m_nMasterID; +class CRecordMasterPersistAtom : public CUnknownRecord +{ +public: + UINT m_nPsrRef; + INT m_nMasterID; - CRecordMasterPersistAtom() - { - } - ~CRecordMasterPersistAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - return CUnknownRecord::ReadFromStream(oHeader, pStream); - } - - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/MasterTextPropAtom.cpp b/MsBinaryFile/PptFile/Records/MasterTextPropAtom.cpp index 85e8c21518..5a66676bbb 100644 --- a/MsBinaryFile/PptFile/Records/MasterTextPropAtom.cpp +++ b/MsBinaryFile/PptFile/Records/MasterTextPropAtom.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "MasterTextPropAtom.h" +using namespace PPT; CRecordMasterTextPropAtom::SMasterTextPropRun::SMasterTextPropRun() { diff --git a/MsBinaryFile/PptFile/Records/MasterTextPropAtom.h b/MsBinaryFile/PptFile/Records/MasterTextPropAtom.h index 38820171eb..5044cca428 100644 --- a/MsBinaryFile/PptFile/Records/MasterTextPropAtom.h +++ b/MsBinaryFile/PptFile/Records/MasterTextPropAtom.h @@ -34,62 +34,22 @@ namespace PPT { - class CRecordMasterTextPropAtom : public CUnknownRecord +class CRecordMasterTextPropAtom : public CUnknownRecord +{ +public: + struct SMasterTextPropRun { - public: - struct SMasterTextPropRun - { - _UINT32 lCount; - unsigned short lIndentLevel; - - SMasterTextPropRun() - { - lCount = 0; - lIndentLevel = 0; - } - - SMasterTextPropRun(const SMasterTextPropRun& oSrc) - { - lCount = oSrc.lCount; - lIndentLevel = oSrc.lIndentLevel; - } - - SMasterTextPropRun& operator=(const SMasterTextPropRun& oSrc) - { - lCount = oSrc.lCount; - lIndentLevel = oSrc.lIndentLevel; - - return *this; - } - }; - - std::vector m_arrProps; - - CRecordMasterTextPropAtom() - { - } - - ~CRecordMasterTextPropAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - m_arrProps.clear(); - - size_t nCount = m_oHeader.RecLen / 6; - while (nCount != 0) - { - --nCount; - - SMasterTextPropRun oRun; - oRun.lCount = StreamUtils::ReadDWORD(pStream); - oRun.lIndentLevel = StreamUtils::ReadWORD(pStream); - - m_arrProps.push_back(oRun); - } - } + _UINT32 lCount = 0; + unsigned short lIndentLevel = 0; + SMasterTextPropRun(); + SMasterTextPropRun(const SMasterTextPropRun& oSrc); + SMasterTextPropRun& operator=(const SMasterTextPropRun& oSrc); }; -} \ No newline at end of file + + std::vector m_arrProps; + + + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/MetafileBlob.cpp b/MsBinaryFile/PptFile/Records/MetafileBlob.cpp index 0589a1c88b..397c44a539 100644 --- a/MsBinaryFile/PptFile/Records/MetafileBlob.cpp +++ b/MsBinaryFile/PptFile/Records/MetafileBlob.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "MetafileBlob.h" +using namespace PPT; CRecordMetafileBlob::CRecordMetafileBlob() : m_nMM(-1), m_nExtX(-1), m_nExtY(-1), m_pData(nullptr) diff --git a/MsBinaryFile/PptFile/Records/MetafileBlob.h b/MsBinaryFile/PptFile/Records/MetafileBlob.h index 2ecb75bd09..bde45dce7e 100644 --- a/MsBinaryFile/PptFile/Records/MetafileBlob.h +++ b/MsBinaryFile/PptFile/Records/MetafileBlob.h @@ -35,40 +35,18 @@ namespace PPT { - class CRecordMetafileBlob : public CUnknownRecord - { - public: - SHORT m_nMM; - SHORT m_nExtX; - SHORT m_nExtY; - BYTE* m_pData; +class CRecordMetafileBlob : public CUnknownRecord +{ +public: + SHORT m_nMM; + SHORT m_nExtX; + SHORT m_nExtY; + BYTE* m_pData; + + CRecordMetafileBlob(); + ~CRecordMetafileBlob(); - CRecordMetafileBlob() : - m_nMM(-1), m_nExtX(-1), m_nExtY(-1), m_pData(nullptr) - { + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; - } - - ~CRecordMetafileBlob() - { - RELEASEOBJECT(m_pData) - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_nMM = StreamUtils::ReadSHORT(pStream); - m_nExtX = StreamUtils::ReadSHORT(pStream); - m_nExtY = StreamUtils::ReadSHORT(pStream); - - const int dataLen = m_oHeader.RecLen - 6; - if (dataLen > 6) - { - m_pData = new BYTE[dataLen]; - pStream->read(m_pData, dataLen); - } - } - - }; -} \ No newline at end of file +}; +} diff --git a/MsBinaryFile/PptFile/Records/MouseInteractiveInfoContainer.cpp b/MsBinaryFile/PptFile/Records/MouseInteractiveInfoContainer.cpp index 8d603d092c..9f813f0d24 100644 --- a/MsBinaryFile/PptFile/Records/MouseInteractiveInfoContainer.cpp +++ b/MsBinaryFile/PptFile/Records/MouseInteractiveInfoContainer.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "MouseInteractiveInfoContainer.h" +using namespace PPT; void CRecordMouseInteractiveInfoContainer::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/MouseInteractiveInfoContainer.h b/MsBinaryFile/PptFile/Records/MouseInteractiveInfoContainer.h index b7ccbe05a7..727e92c764 100644 --- a/MsBinaryFile/PptFile/Records/MouseInteractiveInfoContainer.h +++ b/MsBinaryFile/PptFile/Records/MouseInteractiveInfoContainer.h @@ -35,37 +35,14 @@ namespace PPT { - class CRecordMouseInteractiveInfoContainer : public CUnknownRecord - { - public: - CRecordInteractiveInfoAtom interactiveInfoAtom; - nullable macroNameAtom; - bool isOver; // click = 0, over = 1 +class CRecordMouseInteractiveInfoContainer : public CUnknownRecord +{ +public: + CRecordInteractiveInfoAtom interactiveInfoAtom; + nullable macroNameAtom; + bool isOver = false; // click = 0, over = 1 - CRecordMouseInteractiveInfoContainer() : - isOver(false) - { - } - ~CRecordMouseInteractiveInfoContainer() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - isOver = oHeader.RecInstance; - - SRecordHeader header; - header.ReadFromStream(pStream); - interactiveInfoAtom.ReadFromStream(header, pStream); - - if (m_oHeader.RecLen > 24) - { - header.ReadFromStream(pStream); - macroNameAtom.reset(new CRecordCString); - macroNameAtom->ReadFromStream(header, pStream); - } - } - }; + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; } diff --git a/MsBinaryFile/PptFile/Records/MouseTextInteractiveInfoAtom.cpp b/MsBinaryFile/PptFile/Records/MouseTextInteractiveInfoAtom.cpp index 03f59265c7..dd37952300 100644 --- a/MsBinaryFile/PptFile/Records/MouseTextInteractiveInfoAtom.cpp +++ b/MsBinaryFile/PptFile/Records/MouseTextInteractiveInfoAtom.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "MouseTextInteractiveInfoAtom.h" +using namespace PPT; void CRecordMouseTextInteractiveInfoAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/MouseTextInteractiveInfoAtom.h b/MsBinaryFile/PptFile/Records/MouseTextInteractiveInfoAtom.h index 510595a50c..acd2831105 100644 --- a/MsBinaryFile/PptFile/Records/MouseTextInteractiveInfoAtom.h +++ b/MsBinaryFile/PptFile/Records/MouseTextInteractiveInfoAtom.h @@ -30,26 +30,17 @@ * */ #pragma once + #include "../Reader/Records.h" namespace PPT { - class CRecordMouseTextInteractiveInfoAtom : public CUnknownRecord - { - public: - ODRAW::STextRange m_oRange; +class CRecordMouseTextInteractiveInfoAtom : public CUnknownRecord +{ +public: + ODRAW::STextRange m_oRange; - CRecordMouseTextInteractiveInfoAtom() - { - } - ~CRecordMouseTextInteractiveInfoAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - return CUnknownRecord::ReadFromStream(oHeader, pStream); - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/NamedShowSlidesAtom.cpp b/MsBinaryFile/PptFile/Records/NamedShowSlidesAtom.cpp index 556a1c8d29..cb0f1bd59a 100644 --- a/MsBinaryFile/PptFile/Records/NamedShowSlidesAtom.cpp +++ b/MsBinaryFile/PptFile/Records/NamedShowSlidesAtom.cpp @@ -1,36 +1,6 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "NamedShowSlidesAtom.h" +using namespace PPT; void CRecordNamedShowSlidesAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/NamedShowSlidesAtom.h b/MsBinaryFile/PptFile/Records/NamedShowSlidesAtom.h index e29a84b870..1192682cf4 100644 --- a/MsBinaryFile/PptFile/Records/NamedShowSlidesAtom.h +++ b/MsBinaryFile/PptFile/Records/NamedShowSlidesAtom.h @@ -34,22 +34,12 @@ namespace PPT { - class CRecordNamedShowSlidesAtom : public CUnknownRecord - { - public: - std::vector m_arRgSlideIdRef; +class CRecordNamedShowSlidesAtom : public CUnknownRecord +{ +public: + std::vector m_arRgSlideIdRef; - CRecordNamedShowSlidesAtom() - { - } - ~CRecordNamedShowSlidesAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - return CUnknownRecord::ReadFromStream(oHeader, pStream); - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/NoZoomViewInfoAtom.cpp b/MsBinaryFile/PptFile/Records/NoZoomViewInfoAtom.cpp index d8c84e3a5a..f054ca45c5 100644 --- a/MsBinaryFile/PptFile/Records/NoZoomViewInfoAtom.cpp +++ b/MsBinaryFile/PptFile/Records/NoZoomViewInfoAtom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "NoZoomViewInfoAtom.h" +using namespace PPT; void CRecordNoZoomViewInfoAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/NoZoomViewInfoAtom.h b/MsBinaryFile/PptFile/Records/NoZoomViewInfoAtom.h index 90aefe3e9d..20db3bed42 100644 --- a/MsBinaryFile/PptFile/Records/NoZoomViewInfoAtom.h +++ b/MsBinaryFile/PptFile/Records/NoZoomViewInfoAtom.h @@ -34,25 +34,15 @@ namespace PPT { - class CRecordNoZoomViewInfoAtom : public CUnknownRecord - { - public: - SScalingAtom m_oCurScale; - ODRAW::SPointAtom m_nOrigin; +class CRecordNoZoomViewInfoAtom : public CUnknownRecord +{ +public: + SScalingAtom m_oCurScale; + ODRAW::SPointAtom m_nOrigin; - BOOL1 m_bDraftMode; + BOOL1 m_bDraftMode; - CRecordNoZoomViewInfoAtom() - { - } - ~CRecordNoZoomViewInfoAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - return CUnknownRecord::ReadFromStream(oHeader, pStream); - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/NormalViewSetInfoAtom.cpp b/MsBinaryFile/PptFile/Records/NormalViewSetInfoAtom.cpp index a8752d1a83..15815f5bc1 100644 --- a/MsBinaryFile/PptFile/Records/NormalViewSetInfoAtom.cpp +++ b/MsBinaryFile/PptFile/Records/NormalViewSetInfoAtom.cpp @@ -1,36 +1,7 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "NormalViewSetInfoAtom.h" +using namespace PPT; + void CRecordNormalViewSetInfoAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { return CUnknownRecord::ReadFromStream(oHeader, pStream); diff --git a/MsBinaryFile/PptFile/Records/NormalViewSetInfoAtom.h b/MsBinaryFile/PptFile/Records/NormalViewSetInfoAtom.h index 64d28002fa..201a1e9203 100644 --- a/MsBinaryFile/PptFile/Records/NormalViewSetInfoAtom.h +++ b/MsBinaryFile/PptFile/Records/NormalViewSetInfoAtom.h @@ -34,30 +34,19 @@ namespace PPT { - class CRecordNormalViewSetInfoAtom : public CUnknownRecord - { - public: - SRatioAtom m_oLeftPortion; - SRatioAtom m_oTopPortion; +class CRecordNormalViewSetInfoAtom : public CUnknownRecord +{ +public: + SRatioAtom m_oLeftPortion; + SRatioAtom m_oTopPortion; - BYTE m_nVertBarState; - BYTE m_HorizBarState; + BYTE m_nVertBarState; + BYTE m_HorizBarState; - BOOL1 m_fPreferSingleSet; - BYTE m_nFlags; + BOOL1 m_fPreferSingleSet; + BYTE m_nFlags; - CRecordNormalViewSetInfoAtom() - { - } - - ~CRecordNormalViewSetInfoAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - return CUnknownRecord::ReadFromStream(oHeader, pStream); - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/NotesAtom.cpp b/MsBinaryFile/PptFile/Records/NotesAtom.cpp index 0ee14fa41c..3036d1d38f 100644 --- a/MsBinaryFile/PptFile/Records/NotesAtom.cpp +++ b/MsBinaryFile/PptFile/Records/NotesAtom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "NotesAtom.h" +using namespace PPT; void CRecordNotesAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/NotesAtom.h b/MsBinaryFile/PptFile/Records/NotesAtom.h index ed8a3a827f..246c7702be 100644 --- a/MsBinaryFile/PptFile/Records/NotesAtom.h +++ b/MsBinaryFile/PptFile/Records/NotesAtom.h @@ -32,37 +32,19 @@ #pragma once #include "../Reader/Records.h" + namespace PPT { - class CRecordNotesAtom : public CUnknownRecord - { - public: - UINT m_nSlideIDRef; +class CRecordNotesAtom : public CUnknownRecord +{ +public: + UINT m_nSlideIDRef; + + bool m_bMasterObjects; + bool m_bMasterScheme; + bool m_bMasterBackground; - bool m_bMasterObjects; - bool m_bMasterScheme; - bool m_bMasterBackground; - CRecordNotesAtom() - { - } - - ~CRecordNotesAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_nSlideIDRef = (UINT)StreamUtils::ReadDWORD(pStream); - - USHORT nFlag = StreamUtils::ReadWORD(pStream); - m_bMasterObjects = ((nFlag & 0x01) == 0x01); - m_bMasterScheme = ((nFlag & 0x02) == 0x02); - m_bMasterBackground = ((nFlag & 0x04) == 0x04); - - StreamUtils::StreamSkip(2, pStream); - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/NotesPersistAtom.cpp b/MsBinaryFile/PptFile/Records/NotesPersistAtom.cpp index 74f8ab4152..421ab2e057 100644 --- a/MsBinaryFile/PptFile/Records/NotesPersistAtom.cpp +++ b/MsBinaryFile/PptFile/Records/NotesPersistAtom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "NotesPersistAtom.h" +using namespace PPT; void CRecordNotesPersistAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/NotesPersistAtom.h b/MsBinaryFile/PptFile/Records/NotesPersistAtom.h index 026ff7b33a..8d4b1d172e 100644 --- a/MsBinaryFile/PptFile/Records/NotesPersistAtom.h +++ b/MsBinaryFile/PptFile/Records/NotesPersistAtom.h @@ -34,23 +34,13 @@ namespace PPT { - class CRecordNotesPersistAtom : public CUnknownRecord - { - public: - UINT m_nPsrRef; - INT m_nNotesID; +class CRecordNotesPersistAtom : public CUnknownRecord +{ +public: + UINT m_nPsrRef; + INT m_nNotesID; - CRecordNotesPersistAtom() - { - } - ~CRecordNotesPersistAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - return CUnknownRecord::ReadFromStream(oHeader, pStream); - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/OfficeArtClientData.cpp b/MsBinaryFile/PptFile/Records/OfficeArtClientData.cpp index 60460c6704..ff6c0adfa5 100644 --- a/MsBinaryFile/PptFile/Records/OfficeArtClientData.cpp +++ b/MsBinaryFile/PptFile/Records/OfficeArtClientData.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "OfficeArtClientData.h" +using namespace PPT; void CRecordShapeProgBinaryTagContainer::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/OfficeArtClientData.h b/MsBinaryFile/PptFile/Records/OfficeArtClientData.h index d874fad8b7..9908b0411f 100644 --- a/MsBinaryFile/PptFile/Records/OfficeArtClientData.h +++ b/MsBinaryFile/PptFile/Records/OfficeArtClientData.h @@ -43,18 +43,8 @@ class CRecordShapeProgBinaryTagContainer : public CUnknownRecord public: CRecordShapeProgBinaryTagSubContainerOrAtom m_rec; - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - LONG lPos = 0; - StreamUtils::StreamPosition ( lPos, pStream ); - - SRecordHeader ReadHeader; - m_rec.ReadFromStream(ReadHeader, pStream); - - StreamUtils::StreamSeek(lPos + m_oHeader.RecLen, pStream); - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; }; class CRecordOfficeArtClientData : public CRecordsContainer @@ -63,70 +53,10 @@ public: std::vector m_rgShapeClientRoundtripData; - virtual ~CRecordOfficeArtClientData() - { - CRecordsContainer::Clear(); - for ( size_t i = 0; i < m_rgShapeClientRoundtripData.size(); ++i ) - RELEASEOBJECT ( m_rgShapeClientRoundtripData[i] ); - } + virtual ~CRecordOfficeArtClientData(); - CRecordShapeProgBinaryTagSubContainerOrAtom* getProgTag(const std::wstring& tagname) - { - for (auto* progtag : m_rgShapeClientRoundtripData) - { - if (progtag->m_pTagName->m_strText == tagname) - return progtag; - } + CRecordShapeProgBinaryTagSubContainerOrAtom *getProgTag(const std::wstring& tagname); - return nullptr; - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - LONG lPos = 0; - StreamUtils::StreamPosition ( lPos, pStream ); - - UINT lCurLen = 0; - - SRecordHeader ReadHeader; - - while ( lCurLen < m_oHeader.RecLen ) - { - if ( ReadHeader.ReadFromStream(pStream) == false) - break; - - lCurLen += 8 + ReadHeader.RecLen; - - switch (ReadHeader.RecType) - { - case RT_ProgTags: - { - // ShapeProgBinaryTagContainer - ReadHeader.ReadFromStream(pStream); - - auto pRec = new CRecordShapeProgBinaryTagSubContainerOrAtom; - pRec->ReadFromStream(ReadHeader, pStream); - m_rgShapeClientRoundtripData.push_back(pRec); - break; - } - case RT_VbaInfo: - { - auto pRec = new CRecordsContainer; - pRec->ReadFromStream(ReadHeader, pStream); - break; - } - default: - IRecord* pRecord = CreateByType(ReadHeader); - pRecord->ReadFromStream(ReadHeader, pStream); - - m_arRecords.push_back(pRecord); - break; - } - - } - StreamUtils::StreamSeek(lPos + m_oHeader.RecLen, pStream); - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; }; } diff --git a/MsBinaryFile/PptFile/Records/OfficeArtClientTextbox.h b/MsBinaryFile/PptFile/Records/OfficeArtClientTextbox.h index 4973368b43..5bd4627819 100644 --- a/MsBinaryFile/PptFile/Records/OfficeArtClientTextbox.h +++ b/MsBinaryFile/PptFile/Records/OfficeArtClientTextbox.h @@ -32,15 +32,9 @@ #pragma once #include "../Reader/Records.h" - namespace PPT { - class CRecordOfficeArtClientTextbox : public CRecordsContainer - { - public: - CRecordOfficeArtClientTextbox() - { - - } - }; +class CRecordOfficeArtClientTextbox : public CRecordsContainer +{ +}; } diff --git a/MsBinaryFile/PptFile/Records/OutlineTextProps9Container.cpp b/MsBinaryFile/PptFile/Records/OutlineTextProps9Container.cpp index 4626341fa4..4082606ce3 100644 --- a/MsBinaryFile/PptFile/Records/OutlineTextProps9Container.cpp +++ b/MsBinaryFile/PptFile/Records/OutlineTextProps9Container.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "OutlineTextProps9Container.h" +using namespace PPT; void CRecordOutlineTextProps9Entry::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/OutlineTextProps9Container.h b/MsBinaryFile/PptFile/Records/OutlineTextProps9Container.h index bc7829121a..7d69c6181e 100644 --- a/MsBinaryFile/PptFile/Records/OutlineTextProps9Container.h +++ b/MsBinaryFile/PptFile/Records/OutlineTextProps9Container.h @@ -42,21 +42,7 @@ public: CRecordStyleTextProp9Atom m_styleTextProp9Atom; public: - void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override - { - CRecordOutlineTextPropsHeaderExAtom::ReadFromStream(oHeader, pStream); - - SRecordHeader ReadHeader; - ReadHeader.ReadFromStream(pStream); - - if (ReadHeader.bBadHeader) - { - oHeader.bBadHeader = true; // GZoabli_PhD.ppt - return; - } - - m_styleTextProp9Atom.ReadFromStream(ReadHeader, pStream); - } + void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; }; @@ -66,40 +52,8 @@ public: std::vector m_rgOutlineTextProps9Entry; public: - virtual ~CRecordOutlineTextProps9Container() - { - for (auto pEl : m_rgOutlineTextProps9Entry) - { - RELEASEOBJECT(pEl) - } - } + virtual ~CRecordOutlineTextProps9Container(); - virtual void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) - { - m_oHeader = oHeader; - LONG lPos = 0; - StreamUtils::StreamPosition(lPos, pStream); - - UINT lCurLen = 0; - - SRecordHeader ReadHeader; - - while (lCurLen < m_oHeader.RecLen) - { - if (ReadHeader.ReadFromStream(pStream) == false || ReadHeader.bBadHeader) - break; - - lCurLen += 8 + ReadHeader.RecLen; - - auto pRec = new CRecordOutlineTextProps9Entry; - pRec->ReadFromStream(ReadHeader, pStream); - - if (ReadHeader.bBadHeader) - break; - - m_rgOutlineTextProps9Entry.push_back(pRec); - } - StreamUtils::StreamSeek(lPos + m_oHeader.RecLen, pStream); - } + virtual void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; }; } diff --git a/MsBinaryFile/PptFile/Records/OutlineTextPropsHeaderExAtom.cpp b/MsBinaryFile/PptFile/Records/OutlineTextPropsHeaderExAtom.cpp index 4a92a450e7..483f739dc8 100644 --- a/MsBinaryFile/PptFile/Records/OutlineTextPropsHeaderExAtom.cpp +++ b/MsBinaryFile/PptFile/Records/OutlineTextPropsHeaderExAtom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "OutlineTextPropsHeaderExAtom.h" +using namespace PPT; void CRecordOutlineTextPropsHeaderExAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/OutlineTextPropsHeaderExAtom.h b/MsBinaryFile/PptFile/Records/OutlineTextPropsHeaderExAtom.h index ab8915c688..0275fa432e 100644 --- a/MsBinaryFile/PptFile/Records/OutlineTextPropsHeaderExAtom.h +++ b/MsBinaryFile/PptFile/Records/OutlineTextPropsHeaderExAtom.h @@ -43,11 +43,6 @@ public: TextTypeEnum m_eTxType; protected: - virtual void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) - { - m_oHeader = oHeader; - m_slideIdRef = StreamUtils::ReadDWORD(pStream); - m_eTxType = (TextTypeEnum)StreamUtils::ReadDWORD(pStream); - } + virtual void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; }; } diff --git a/MsBinaryFile/PptFile/Records/OutlineTextRefAtom.cpp b/MsBinaryFile/PptFile/Records/OutlineTextRefAtom.cpp index 17addc9021..3b2d9fc662 100644 --- a/MsBinaryFile/PptFile/Records/OutlineTextRefAtom.cpp +++ b/MsBinaryFile/PptFile/Records/OutlineTextRefAtom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "OutlineTextRefAtom.h" +using namespace PPT; void CRecordOutlineTextRefAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/OutlineTextRefAtom.h b/MsBinaryFile/PptFile/Records/OutlineTextRefAtom.h index c15e3f1bfe..82cc2fc8d9 100644 --- a/MsBinaryFile/PptFile/Records/OutlineTextRefAtom.h +++ b/MsBinaryFile/PptFile/Records/OutlineTextRefAtom.h @@ -30,28 +30,18 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordOutlineTextRefAtom : public CUnknownRecord - { - public: - _UINT32 m_nIndex; +class CRecordOutlineTextRefAtom : public CUnknownRecord +{ +public: + _UINT32 m_nIndex; - CRecordOutlineTextRefAtom() - { - } - - ~CRecordOutlineTextRefAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - m_nIndex = StreamUtils::ReadDWORD(pStream); - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/PFMasks.cpp b/MsBinaryFile/PptFile/Records/PFMasks.cpp index 6aa136dd3e..3274b40531 100644 --- a/MsBinaryFile/PptFile/Records/PFMasks.cpp +++ b/MsBinaryFile/PptFile/Records/PFMasks.cpp @@ -1,66 +1,7 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*//* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "PFMasks.h" +using namespace PPT; + static inline bool getBit(_UINT32 data, _UINT32 mask) { return mask == (mask & data); diff --git a/MsBinaryFile/PptFile/Records/PFMasks.h b/MsBinaryFile/PptFile/Records/PFMasks.h index 55d17fa01c..c75cc1983b 100644 --- a/MsBinaryFile/PptFile/Records/PFMasks.h +++ b/MsBinaryFile/PptFile/Records/PFMasks.h @@ -34,13 +34,6 @@ namespace PPT { - -inline bool getBit(_UINT32 data, _UINT32 mask) -{ - return mask == (mask & data); -} - - struct PFMasks { bool m_hasBullet; @@ -71,36 +64,6 @@ struct PFMasks bool m_bulletHasScheme; - void ReadFromStream(POLE::Stream* pStream) - { - _UINT32 data = StreamUtils::ReadDWORD(pStream); - - m_hasBullet = getBit(data, 0x0001); - m_bulletHasFont = getBit(data, 0x0002); - m_bulletHasColor = getBit(data, 0x0004); - m_bulletHasSize = getBit(data, 0x0008); - m_bulletFont = getBit(data, 0x0010); - m_bulletColor = getBit(data, 0x0020); - m_bulletSize = getBit(data, 0x0040); - m_bulletChar = getBit(data, 0x0080); - m_leftMargin = getBit(data, 0x0100); - // unused - m_indent = getBit(data, 0x000400); - m_align = getBit(data, 0x000800); - m_lineSpacing = getBit(data, 0x001000); - m_spaceBefore = getBit(data, 0x002000); - m_spaceAfter = getBit(data, 0x004000); - m_defaultTabSize = getBit(data, 0x008000); - m_fontAlign = getBit(data, 0x010000); - m_charWrap = getBit(data, 0x020000); - m_wordWrap = getBit(data, 0x040000); - m_overflow = getBit(data, 0x080000); - m_tabStops = getBit(data, 0x100000); - m_textDirection = getBit(data, 0x200000); - // reserved1 - m_bulletBlip = getBit(data, 0x0800000); - m_bulletScheme = getBit(data, 0x1000000); - m_bulletHasScheme = getBit(data, 0x2000000); - } + void ReadFromStream(POLE::Stream* pStream); }; } diff --git a/MsBinaryFile/PptFile/Records/PersistDirectoryAtom.cpp b/MsBinaryFile/PptFile/Records/PersistDirectoryAtom.cpp index 5b6a112e19..0f7f166230 100644 --- a/MsBinaryFile/PptFile/Records/PersistDirectoryAtom.cpp +++ b/MsBinaryFile/PptFile/Records/PersistDirectoryAtom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "PersistDirectoryAtom.h" +using namespace PPT; _UINT32 CPersistDirectoryEntry::FromStream(POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/PersistDirectoryAtom.h b/MsBinaryFile/PptFile/Records/PersistDirectoryAtom.h index 6838f501d9..d05385c8d4 100644 --- a/MsBinaryFile/PptFile/Records/PersistDirectoryAtom.h +++ b/MsBinaryFile/PptFile/Records/PersistDirectoryAtom.h @@ -35,88 +35,36 @@ #include "../Reader/Records.h" + namespace PPT { - class CPersistDirectoryEntry +class CPersistDirectoryEntry +{ +public: + _UINT32 m_nPersistID; // PersistOffsetID[index] = m_nPersistID + index + _UINT32 m_nPersistCount; + + std::vector<_UINT32> m_arPersistOffsets; + +public: + + CPersistDirectoryEntry() : m_arPersistOffsets() { - public: - _UINT32 m_nPersistID; // PersistOffsetID[index] = m_nPersistID + index - _UINT32 m_nPersistCount; + m_nPersistID = 0; + m_nPersistCount = 0; + } - std::vector<_UINT32> m_arPersistOffsets; + _UINT32 FromStream(POLE::Stream* pStream); +}; - public: +class CRecordPersistDirectoryAtom : public CUnknownRecord +{ + std::vector m_arEntries; - CPersistDirectoryEntry() : m_arPersistOffsets() - { - m_nPersistID = 0; - m_nPersistCount = 0; - } +public: - _UINT32 FromStream(POLE::Stream* pStream) - { - _UINT32 nFlag = StreamUtils::ReadDWORD(pStream); - m_nPersistID = (nFlag & 0x000FFFFF); // 20 bit - m_nPersistCount = (nFlag & 0xFFF00000) >> 20; // 12 bit + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; - m_arPersistOffsets.clear(); - - for (_UINT32 index = 0; index < m_nPersistCount; ++index) - { - _UINT32 Mem = StreamUtils::ReadDWORD(pStream); - m_arPersistOffsets.push_back(Mem); - } - - return 4 * (m_nPersistCount + 1); - } - }; - - class CRecordPersistDirectoryAtom : public CUnknownRecord - { - std::vector m_arEntries; - - public: - - CRecordPersistDirectoryAtom() : m_arEntries() - { - } - - ~CRecordPersistDirectoryAtom() - { - m_arEntries.clear(); - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - _UINT32 nCountRead = 0; - _UINT32 nCountEnries = 0; - while (nCountRead < m_oHeader.RecLen) - { - CPersistDirectoryEntry elm; - m_arEntries.push_back(elm); - - nCountRead += m_arEntries[nCountEnries].FromStream(pStream); - ++nCountEnries; - } - } - - void ToMap(std::map<_UINT32, _UINT32>* pMap) - { - pMap->clear(); - - for (size_t nEntry = 0; nEntry < m_arEntries.size(); ++nEntry) - { - _UINT32 nPID = m_arEntries[nEntry].m_nPersistID; - - for (size_t nIndex = 0; nIndex < m_arEntries[nEntry].m_nPersistCount; ++nIndex) - { - _UINT32 nOffset = m_arEntries[nEntry].m_arPersistOffsets[nIndex]; - pMap->insert(std::pair<_UINT32, _UINT32>(nPID, nOffset)); - ++nPID; - } - } - } - }; -} \ No newline at end of file + void ToMap(std::map<_UINT32, _UINT32>* pMap); +}; +} diff --git a/MsBinaryFile/PptFile/Records/PlaceHolderAtom.cpp b/MsBinaryFile/PptFile/Records/PlaceHolderAtom.cpp index 94a06e9eaf..c8bb871b58 100644 --- a/MsBinaryFile/PptFile/Records/PlaceHolderAtom.cpp +++ b/MsBinaryFile/PptFile/Records/PlaceHolderAtom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "PlaceHolderAtom.h" +using namespace PPT; void CRecordPlaceHolderAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/PlaceHolderAtom.h b/MsBinaryFile/PptFile/Records/PlaceHolderAtom.h index 51912623f1..20ae58d73c 100644 --- a/MsBinaryFile/PptFile/Records/PlaceHolderAtom.h +++ b/MsBinaryFile/PptFile/Records/PlaceHolderAtom.h @@ -34,32 +34,14 @@ namespace PPT { - class CRecordPlaceHolderAtom : public CUnknownRecord - { - public: - int m_nPosition; - BYTE m_nPlacementID; - BYTE m_nSize; +class CRecordPlaceHolderAtom : public CUnknownRecord +{ +public: + int m_nPosition; + BYTE m_nPlacementID; + BYTE m_nSize; - public: - CRecordPlaceHolderAtom() - { - } - - ~CRecordPlaceHolderAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_nPosition = StreamUtils::ReadLONG(pStream); - m_nPlacementID = StreamUtils::ReadBYTE(pStream); - m_nSize = StreamUtils::ReadBYTE(pStream); - - StreamUtils::StreamSkip(2, pStream); - } - }; + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; } diff --git a/MsBinaryFile/PptFile/Records/ProgStringTagContainer.cpp b/MsBinaryFile/PptFile/Records/ProgStringTagContainer.cpp index 4dac45c490..8a238eb899 100644 --- a/MsBinaryFile/PptFile/Records/ProgStringTagContainer.cpp +++ b/MsBinaryFile/PptFile/Records/ProgStringTagContainer.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "ProgStringTagContainer.h" +using namespace PPT; CRecordProgStringTagContainer::CRecordProgStringTagContainer() { diff --git a/MsBinaryFile/PptFile/Records/ProgStringTagContainer.h b/MsBinaryFile/PptFile/Records/ProgStringTagContainer.h index f59ccfc013..31c706a903 100644 --- a/MsBinaryFile/PptFile/Records/ProgStringTagContainer.h +++ b/MsBinaryFile/PptFile/Records/ProgStringTagContainer.h @@ -34,34 +34,18 @@ #include "Animations/TimeVariant.h" -namespace PPT { +namespace PPT +{ class CRecordProgStringTagContainer : public CUnknownRecord { public: - CRecordProgStringTagContainer() : m_pTagValueAtom(nullptr) {} + CRecordProgStringTagContainer(); + ~CRecordProgStringTagContainer(); - ~CRecordProgStringTagContainer() - { - RELEASEOBJECT(m_pTagValueAtom) - } - - void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override - { - m_oHeader = oHeader; - SRecordHeader ReadHeader; - ReadHeader.ReadFromStream(pStream); - - m_oTagNameAtom.ReadFromStream(ReadHeader, pStream); - if (m_oHeader.RecLen > 8 + ReadHeader.RecLen) - { - m_pTagValueAtom = new CRecordTagValueAtom(); - ReadHeader.ReadFromStream(pStream); - m_pTagValueAtom->ReadFromStream(ReadHeader, pStream); - } - } + void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; public: CRecordTagNameAtom m_oTagNameAtom; - CRecordTagValueAtom* m_pTagValueAtom; // OPTIONAL + CRecordTagValueAtom* m_pTagValueAtom = nullptr; // OPTIONAL }; } diff --git a/MsBinaryFile/PptFile/Records/RoundTrip.cpp b/MsBinaryFile/PptFile/Records/RoundTrip.cpp index 3bd664b5a6..e2fcbe14a6 100644 --- a/MsBinaryFile/PptFile/Records/RoundTrip.cpp +++ b/MsBinaryFile/PptFile/Records/RoundTrip.cpp @@ -1,36 +1,7 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "RoundTrip.h" +using namespace PPT; + //static int nRTCounter = 1; void CUnknownRoundTrip::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { @@ -45,7 +16,7 @@ void CUnknownRoundTrip::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pSt // file.close(); } -void CUnknownRoundTrip::ReadFromStream(SRecordHeader &oHeader, const CFStreamPtr &pStream) +void CUnknownRoundTrip::ReadFromStream(SRecordHeader &oHeader, const XLS::CFStreamPtr &pStream) { m_oHeader = oHeader; diff --git a/MsBinaryFile/PptFile/Records/RoundTrip.h b/MsBinaryFile/PptFile/Records/RoundTrip.h index 33233f040a..a89d30d084 100644 --- a/MsBinaryFile/PptFile/Records/RoundTrip.h +++ b/MsBinaryFile/PptFile/Records/RoundTrip.h @@ -32,259 +32,135 @@ #pragma once #include "../Reader/Records.h" -#include -//static UINT nRTCounter = 1; namespace PPT { - class CUnknownRoundTrip : public CUnknownRecord - { - public: - std::pair, _INT32> data; - - CUnknownRoundTrip() - { - } - - ~CUnknownRoundTrip() - { - } - - void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - data = std::make_pair(boost::shared_array(new unsigned char[m_oHeader.RecLen]), m_oHeader.RecLen); - pStream->read(data.first.get(), data.second); - - // std::string filename = std::to_string(nRTCounter++) + "_" + GetRecordName(m_oHeader.RecType) + ".zip"; - // std::ofstream file("RoundTrips/" + filename, std::ios::out); - // file.write((char*)data.first.get(), data.second); - // file.close(); - } - - void ReadFromStream(SRecordHeader & oHeader, const XLS::CFStreamPtr &pStream) - { - m_oHeader = oHeader; - - data = std::make_pair(boost::shared_array(new unsigned char[m_oHeader.RecLen]), m_oHeader.RecLen); - pStream->read(data.first.get(), data.second); - } - }; - - class CUnknownRoundTripID : public CUnknownRecord - { - public: - UINT m_dwID; - - CUnknownRoundTripID() : m_dwID(-1) {} - ~CUnknownRoundTripID() {} - - virtual inline std::wstring getStrID()const - { - return std::to_wstring(m_dwID); - } - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - m_dwID = StreamUtils::ReadDWORD(pStream); - - // std::string filename = std::to_string(nRTCounter++) + "_" + GetRecordName(m_oHeader.RecType) + "_ID_" + std::to_string(m_dwID) + ".txt"; - // std::ofstream file("RoundTrips/" + filename, std::ios::out); - // file << m_dwID; - // file.close(); - } - }; - - // .zip - class RoundTripTheme12Atom : public CUnknownRoundTrip {}; - class RoundTripContentMasterInfo12Atom : public CUnknownRoundTrip {}; - class RoundTripOArtTextStyles12Atom : public CUnknownRoundTrip {}; - class RoundTripNotesMasterTextStyles12Atom : public CUnknownRoundTrip {}; - class RoundTripCustomTableStyles12Atom : public CUnknownRoundTrip {}; - class RoundTripAnimationAtom12Atom : public CUnknownRoundTrip {}; +class CUnknownRoundTrip : public CUnknownRecord +{ +public: + std::pair, _INT32> data; - // .xml - class RoundTripColorMapping12Atom : public CUnknownRecord - { - public: - std::string m_colorMapping; + void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; + void ReadFromStream(SRecordHeader & oHeader, const XLS::CFStreamPtr &pStream) override; +}; - RoundTripColorMapping12Atom() {} - ~RoundTripColorMapping12Atom() {} +class CUnknownRoundTripID : public CUnknownRecord +{ +public: + UINT m_dwID = -1; - void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - m_colorMapping = StreamUtils::ReadStringA(pStream, m_oHeader.RecLen); - // std::string filename = std::to_string(nRTCounter++) + "_" + GetRecordName(m_oHeader.RecType) + ".xml"; - // std::ofstream file("RoundTrips/" + filename, std::ios::out); - // file << m_colorMapping; - // file.close(); - } - std::wstring getPClrMap()const - { - auto iter = m_colorMapping.find("(new unsigned char[m_oHeader.RecLen]), m_oHeader.RecLen); + pStream->read(data.first.get(), data.second); + + // std::string filename = "notes/" + std::to_string(data.second) + ".zip"; + // std::ofstream file(filename, std::ios::binary | std::ios::out); + // file.write((char*)data.first.get(), data.second); + // file.close(); +} + +CRecordRoundTripCustomTableStyles12Atom::CRecordRoundTripCustomTableStyles12Atom() +{ +} + +CRecordRoundTripCustomTableStyles12Atom::~CRecordRoundTripCustomTableStyles12Atom() +{ +} + +void CRecordRoundTripCustomTableStyles12Atom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) +{ + m_oHeader = oHeader; + + data = std::make_pair(boost::shared_array(new unsigned char[m_oHeader.RecLen]), m_oHeader.RecLen); + pStream->read(data.first.get(), data.second); +} diff --git a/MsBinaryFile/PptFile/Records/RoundTripNotesMasterTextStyles12Atom.h b/MsBinaryFile/PptFile/Records/RoundTripNotesMasterTextStyles12Atom.h index 17484a617c..aea250ce13 100644 --- a/MsBinaryFile/PptFile/Records/RoundTripNotesMasterTextStyles12Atom.h +++ b/MsBinaryFile/PptFile/Records/RoundTripNotesMasterTextStyles12Atom.h @@ -32,31 +32,19 @@ #pragma once #include "../Reader/Records.h" + +namespace PPT +{ class CRecordRoundTripNotesMasterTextStyles12Atom : public CUnknownRecord { public: std::pair, _INT32> data; - CRecordRoundTripNotesMasterTextStyles12Atom() - { - } + CRecordRoundTripNotesMasterTextStyles12Atom(); - ~CRecordRoundTripNotesMasterTextStyles12Atom() - { - } + ~CRecordRoundTripNotesMasterTextStyles12Atom(); - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - data = std::make_pair(boost::shared_array(new unsigned char[m_oHeader.RecLen]), m_oHeader.RecLen); - pStream->read(data.first.get(), data.second); - -// std::string filename = "notes/" + std::to_string(data.second) + ".zip"; -// std::ofstream file(filename, std::ios::binary | std::ios::out); -// file.write((char*)data.first.get(), data.second); -// file.close(); - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); }; class CRecordRoundTripCustomTableStyles12Atom : public CUnknownRecord @@ -64,19 +52,10 @@ class CRecordRoundTripCustomTableStyles12Atom : public CUnknownRecord public: std::pair, _INT32> data; - CRecordRoundTripCustomTableStyles12Atom() - { - } + CRecordRoundTripCustomTableStyles12Atom(); - ~CRecordRoundTripCustomTableStyles12Atom() - { - } + ~CRecordRoundTripCustomTableStyles12Atom(); - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - data = std::make_pair(boost::shared_array(new unsigned char[m_oHeader.RecLen]), m_oHeader.RecLen); - pStream->read(data.first.get(), data.second); - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); }; +} diff --git a/MsBinaryFile/PptFile/Records/SSDocInfoAtom.cpp b/MsBinaryFile/PptFile/Records/SSDocInfoAtom.cpp index a7e95864c4..dea3ec6db4 100644 --- a/MsBinaryFile/PptFile/Records/SSDocInfoAtom.cpp +++ b/MsBinaryFile/PptFile/Records/SSDocInfoAtom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "SSDocInfoAtom.h" +using namespace PPT; CRecordSSDocInfoAtom::CRecordSSDocInfoAtom() { diff --git a/MsBinaryFile/PptFile/Records/SSDocInfoAtom.h b/MsBinaryFile/PptFile/Records/SSDocInfoAtom.h index 3241b48cf4..2e5443f371 100644 --- a/MsBinaryFile/PptFile/Records/SSDocInfoAtom.h +++ b/MsBinaryFile/PptFile/Records/SSDocInfoAtom.h @@ -32,64 +32,32 @@ #pragma once #include "../Reader/Records.h" + namespace PPT { - class CRecordSSDocInfoAtom : public CUnknownRecord - { - public: - ODRAW::SColorAtom m_oPenColor; - _INT32 m_nRestartTime; - short m_nStartSlide; - short m_nEndSlide; - std::wstring m_pName; +class CRecordSSDocInfoAtom : public CUnknownRecord +{ +public: + ODRAW::SColorAtom m_oPenColor; + _INT32 m_nRestartTime; + short m_nStartSlide; + short m_nEndSlide; + std::wstring m_pName; + + bool fAutoAdvance; + bool fWillSkipBuilds; + bool fUseSlideRange; + bool fDocUseNamedShow; + bool fBrowseMode; + bool fKioskMode; + bool fWillSkipNarration; + bool fLoopContinuously; + bool fHideScrollBar; - bool fAutoAdvance; - bool fWillSkipBuilds; - bool fUseSlideRange; - bool fDocUseNamedShow; - bool fBrowseMode; - bool fKioskMode; - bool fWillSkipNarration; - bool fLoopContinuously; - bool fHideScrollBar; + CRecordSSDocInfoAtom(); + ~CRecordSSDocInfoAtom(); - CRecordSSDocInfoAtom() - { - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; - ~CRecordSSDocInfoAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - unsigned short flags; - unsigned char nm[64]; - - NSStreamReader::Read(pStream, m_oPenColor); - m_nRestartTime = StreamUtils::ReadLONG(pStream); - m_nStartSlide = StreamUtils::ReadSHORT(pStream); - m_nEndSlide = StreamUtils::ReadSHORT(pStream); - - pStream->read(nm, 64); - m_pName = NSFile::CUtf8Converter::GetWStringFromUTF16((unsigned short*)nm, 32); - - flags = StreamUtils::ReadWORD(pStream); - - fAutoAdvance = GETBIT(flags, 15); - fWillSkipBuilds = GETBIT(flags, 14); - fUseSlideRange = GETBIT(flags, 13); - fDocUseNamedShow = GETBIT(flags, 12); - fBrowseMode = GETBIT(flags, 11); - fKioskMode = GETBIT(flags, 10); - fWillSkipNarration = GETBIT(flags, 9); - fLoopContinuously = GETBIT(flags, 8); - fHideScrollBar = GETBIT(flags, 7); - - unsigned short unused = StreamUtils::ReadWORD(pStream); - } - - }; -} \ No newline at end of file +}; +} diff --git a/MsBinaryFile/PptFile/Records/SSSlideInfoAtom.cpp b/MsBinaryFile/PptFile/Records/SSSlideInfoAtom.cpp index aa3f54e26f..7329f97ef3 100644 --- a/MsBinaryFile/PptFile/Records/SSSlideInfoAtom.cpp +++ b/MsBinaryFile/PptFile/Records/SSSlideInfoAtom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "SSSlideInfoAtom.h" +using namespace PPT; CSlideShowSlideInfoAtom::CSlideShowSlideInfoAtom() { diff --git a/MsBinaryFile/PptFile/Records/SSSlideInfoAtom.h b/MsBinaryFile/PptFile/Records/SSSlideInfoAtom.h index 0e3127c9db..d71a943939 100644 --- a/MsBinaryFile/PptFile/Records/SSSlideInfoAtom.h +++ b/MsBinaryFile/PptFile/Records/SSSlideInfoAtom.h @@ -30,110 +30,48 @@ * */ #pragma once + #include "../Reader/Records.h" + + namespace PPT { - class CSlideShowSlideInfoAtom : public CUnknownRecord - { - public: +class CSlideShowSlideInfoAtom : public CUnknownRecord +{ +public: - INT m_nSlideTime; - // We need to take it for rels and correct - _UINT32 m_nSoundRef; + INT m_nSlideTime; + // We need to take it for rels and correct + _UINT32 m_nSoundRef; - BYTE m_nEffectDirection; - BYTE m_nEffectType; + BYTE m_nEffectDirection; + BYTE m_nEffectType; - bool m_bManualAdvance; - // reserved1 (1 bit) - bool m_bHidden; - // reserved1 (1 bit) - bool m_bSound; - // reserved1 (1 bit) - bool m_bLoopSound; - // reserved1 (1 bit) - bool m_bStopSound; - // reserved1 (1 bit) - bool m_bAutoAdvance; - // reserved1 (1 bit) - bool m_bCursorVisible; - // reserved1 (3 bit) + bool m_bManualAdvance; + // reserved1 (1 bit) + bool m_bHidden; + // reserved1 (1 bit) + bool m_bSound; + // reserved1 (1 bit) + bool m_bLoopSound; + // reserved1 (1 bit) + bool m_bStopSound; + // reserved1 (1 bit) + bool m_bAutoAdvance; + // reserved1 (1 bit) + bool m_bCursorVisible; + // reserved1 (3 bit) - BYTE m_nSpeed; + BYTE m_nSpeed; - public: +public: + CSlideShowSlideInfoAtom(); + ~CSlideShowSlideInfoAtom(); - CSlideShowSlideInfoAtom() - { - m_nSlideTime = -1; - m_nSoundRef = 0xFFFFFFFE; + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) override; - m_nEffectDirection = 0; - m_nEffectType = 0; - - m_bManualAdvance = false; - m_bHidden = false; - m_bSound = false; - m_bLoopSound = false; - m_bStopSound = false; - m_bAutoAdvance = false; - m_bCursorVisible = false; - - m_nSpeed = 1; - } - - ~CSlideShowSlideInfoAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_nSlideTime = (INT)StreamUtils::ReadDWORD(pStream); - m_nSoundRef = StreamUtils::ReadDWORD(pStream); - - m_nEffectDirection = StreamUtils::ReadBYTE(pStream); - m_nEffectType = StreamUtils::ReadBYTE(pStream); - - BYTE bValue = StreamUtils::ReadBYTE(pStream); - - m_bManualAdvance = (0x01 == (0x01 & bValue)); - m_bHidden = (0x04 == (0x04 & bValue)); - m_bSound = (0x10 == (0x10 & bValue)); - m_bLoopSound = (0x40 == (0x40 & bValue)); - - bValue = StreamUtils::ReadBYTE(pStream); - - m_bStopSound = (0x01 == (0x01 & bValue)); - m_bAutoAdvance = (0x04 == (0x04 & bValue)); - m_bCursorVisible = (0x10 == (0x10 & bValue)); - - //_UINT32 dwValue = StreamUtils::ReadDWORD ( pStream ); - //m_nSpeed = ( 0x01 == ( 0x01 & ((BYTE)dwValue) ) ); - m_nSpeed = StreamUtils::ReadBYTE(pStream); - StreamUtils::StreamSkip(3, pStream); - } - - double GetTimeTransition() - { - double dTime = 500.0; - if (0 == m_nSpeed) - { - dTime = 750.0; - } - else if (2 == m_nSpeed) - { - dTime = 250.0; - } - - return dTime; - } - - double GetTimeSlide() - { - return (double)m_nSlideTime; - } - }; + double GetTimeTransition(); + double GetTimeSlide(); +}; } diff --git a/MsBinaryFile/PptFile/Records/SSlideLayoutAtom.cpp b/MsBinaryFile/PptFile/Records/SSlideLayoutAtom.cpp index e32de9b15d..3dfe82f4f1 100644 --- a/MsBinaryFile/PptFile/Records/SSlideLayoutAtom.cpp +++ b/MsBinaryFile/PptFile/Records/SSlideLayoutAtom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "SSlideLayoutAtom.h" +using namespace PPT; CRecordSSlideLayoutAtom::CRecordSSlideLayoutAtom() { diff --git a/MsBinaryFile/PptFile/Records/SSlideLayoutAtom.h b/MsBinaryFile/PptFile/Records/SSlideLayoutAtom.h index 4c8768d3bb..8f559c7932 100644 --- a/MsBinaryFile/PptFile/Records/SSlideLayoutAtom.h +++ b/MsBinaryFile/PptFile/Records/SSlideLayoutAtom.h @@ -30,28 +30,23 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordSSlideLayoutAtom : public CUnknownRecord - { - public: - INT m_nGeom; - BYTE m_pPlaceHolderID[8]; +class CRecordSSlideLayoutAtom : public CUnknownRecord +{ +public: + INT m_nGeom; + BYTE m_pPlaceHolderID[8]; + - CRecordSSlideLayoutAtom() - { - } + CRecordSSlideLayoutAtom(); + ~CRecordSSlideLayoutAtom(); - ~CRecordSSlideLayoutAtom() - { - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - return CUnknownRecord::ReadFromStream(oHeader, pStream); - } - - }; -} \ No newline at end of file +}; +} diff --git a/MsBinaryFile/PptFile/Records/ShapeFlags10Atom.cpp b/MsBinaryFile/PptFile/Records/ShapeFlags10Atom.cpp index 80d449b1be..c3555295d7 100644 --- a/MsBinaryFile/PptFile/Records/ShapeFlags10Atom.cpp +++ b/MsBinaryFile/PptFile/Records/ShapeFlags10Atom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "ShapeFlags10Atom.h" +using namespace PPT; void CRecordShapeFlags10Atom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/ShapeFlags10Atom.h b/MsBinaryFile/PptFile/Records/ShapeFlags10Atom.h index e4e143b3d1..53e8e2b0ca 100644 --- a/MsBinaryFile/PptFile/Records/ShapeFlags10Atom.h +++ b/MsBinaryFile/PptFile/Records/ShapeFlags10Atom.h @@ -32,24 +32,15 @@ #pragma once #include "../Reader/Records.h" + namespace PPT { - class CRecordShapeFlags10Atom : public CUnknownRecord - { - public: - BYTE m_nFlags; +class CRecordShapeFlags10Atom : public CUnknownRecord +{ +public: + BYTE m_nFlags; - CRecordShapeFlags10Atom() - { - } - ~CRecordShapeFlags10Atom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - return CUnknownRecord::ReadFromStream(oHeader, pStream); - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/ShapeFlagsAtom.cpp b/MsBinaryFile/PptFile/Records/ShapeFlagsAtom.cpp index 943f144877..35af9049f5 100644 --- a/MsBinaryFile/PptFile/Records/ShapeFlagsAtom.cpp +++ b/MsBinaryFile/PptFile/Records/ShapeFlagsAtom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "ShapeFlagsAtom.h" +using namespace PPT; void CRecordShapeFlagsAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/ShapeFlagsAtom.h b/MsBinaryFile/PptFile/Records/ShapeFlagsAtom.h index bf5d771792..264aec0196 100644 --- a/MsBinaryFile/PptFile/Records/ShapeFlagsAtom.h +++ b/MsBinaryFile/PptFile/Records/ShapeFlagsAtom.h @@ -34,22 +34,12 @@ namespace PPT { - class CRecordShapeFlagsAtom : public CUnknownRecord - { - public: - BYTE m_nFlags; +class CRecordShapeFlagsAtom : public CUnknownRecord +{ +public: + BYTE m_nFlags; - CRecordShapeFlagsAtom() - { - } - ~CRecordShapeFlagsAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - return CUnknownRecord::ReadFromStream(oHeader, pStream); - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/ShapeProgBinaryTagSubContainerOrAtom.cpp b/MsBinaryFile/PptFile/Records/ShapeProgBinaryTagSubContainerOrAtom.cpp index 32c2586da7..f1b93daab3 100644 --- a/MsBinaryFile/PptFile/Records/ShapeProgBinaryTagSubContainerOrAtom.cpp +++ b/MsBinaryFile/PptFile/Records/ShapeProgBinaryTagSubContainerOrAtom.cpp @@ -1,66 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*//* - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ #include "ShapeProgBinaryTagSubContainerOrAtom.h" +using namespace PPT; void CRecordPP9ShapeBinaryTagExtension::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/ShapeProgBinaryTagSubContainerOrAtom.h b/MsBinaryFile/PptFile/Records/ShapeProgBinaryTagSubContainerOrAtom.h index 357d9da5e4..094c13a243 100644 --- a/MsBinaryFile/PptFile/Records/ShapeProgBinaryTagSubContainerOrAtom.h +++ b/MsBinaryFile/PptFile/Records/ShapeProgBinaryTagSubContainerOrAtom.h @@ -46,53 +46,26 @@ class CRecordPP9ShapeBinaryTagExtension : public CUnknownRecord { public: CRecordStyleTextProp9Atom m_styleTextPropAtom; - virtual ~CRecordPP9ShapeBinaryTagExtension(){} - void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override - { - m_oHeader = oHeader; - - SRecordHeader ReadHeader; - ReadHeader.ReadFromStream(pStream); - - m_styleTextPropAtom.ReadFromStream(ReadHeader, pStream); - } + void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; }; class CRecordPP10ShapeBinaryTagExtension : public CUnknownRecord { public: CRecordStyleTextProp10Atom m_styleTextPropAtom; - virtual ~CRecordPP10ShapeBinaryTagExtension(){} - void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override - { - m_oHeader = oHeader; - - SRecordHeader ReadHeader; - ReadHeader.ReadFromStream(pStream); - - m_styleTextPropAtom.ReadFromStream(ReadHeader, pStream); - } + void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; }; class CRecordPP11ShapeBinaryTagExtension : public CUnknownRecord { public: CRecordStyleTextProp11Atom m_styleTextPropAtom; - virtual ~CRecordPP11ShapeBinaryTagExtension(){} - void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override - { - m_oHeader = oHeader; - - SRecordHeader ReadHeader; - ReadHeader.ReadFromStream(pStream); - - m_styleTextPropAtom.ReadFromStream(ReadHeader, pStream); - } + void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; }; class CRecordShapeProgBinaryTagSubContainerOrAtom : public CUnknownRecord @@ -101,42 +74,8 @@ public: IRecord* m_pTagContainer; CRecordCString* m_pTagName; - CRecordShapeProgBinaryTagSubContainerOrAtom() : m_pTagContainer(NULL), m_pTagName(NULL){} - virtual ~CRecordShapeProgBinaryTagSubContainerOrAtom(){} + CRecordShapeProgBinaryTagSubContainerOrAtom(); - void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override - { - m_oHeader = oHeader; - LONG lPos = 0; StreamUtils::StreamPosition(lPos, pStream); - - SRecordHeader ReadHeader; - ReadHeader.ReadFromStream(pStream); - - if (ReadHeader.RecType == RT_CString) - { - RELEASEOBJECT(m_pTagName); - RELEASEOBJECT(m_pTagContainer); - m_pTagName = new CRecordCString(); - m_pTagName->ReadFromStream(ReadHeader, pStream); - - SRecordHeader childHeader; - if (!childHeader.ReadFromStream(pStream)) - return; - - if (m_pTagName->m_strText == TN_PPT9) { - m_pTagContainer = new CRecordPP9ShapeBinaryTagExtension(); - dynamic_cast - (m_pTagContainer)->ReadFromStream(childHeader, pStream); - } else if (m_pTagName->m_strText == TN_PPT10) { - m_pTagContainer = new CRecordPP10ShapeBinaryTagExtension(); - dynamic_cast - (m_pTagContainer)->ReadFromStream(childHeader, pStream); - } else if (m_pTagName->m_strText == TN_PPT11) { - m_pTagContainer = new CRecordPP11ShapeBinaryTagExtension(); - dynamic_cast - (m_pTagContainer)->ReadFromStream(childHeader, pStream); - } - } - } + void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; }; } diff --git a/MsBinaryFile/PptFile/Records/SlideAtom.cpp b/MsBinaryFile/PptFile/Records/SlideAtom.cpp index 4506f426e5..6ac44787de 100644 --- a/MsBinaryFile/PptFile/Records/SlideAtom.cpp +++ b/MsBinaryFile/PptFile/Records/SlideAtom.cpp @@ -1,36 +1,7 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "SlideAtom.h" +using namespace PPT; + CRecordSlideAtom::CRecordSlideAtom() { m_oLayout.m_hash = 0; diff --git a/MsBinaryFile/PptFile/Records/SlideAtom.h b/MsBinaryFile/PptFile/Records/SlideAtom.h index 0c94610bc2..9b8a0e613e 100644 --- a/MsBinaryFile/PptFile/Records/SlideAtom.h +++ b/MsBinaryFile/PptFile/Records/SlideAtom.h @@ -30,55 +30,28 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordSlideAtom : public CUnknownRecord - { - public: - SSlideLayoutAtom m_oLayout; - UINT m_nMasterIDRef; - UINT m_nNotesIDRef; +class CRecordSlideAtom : public CUnknownRecord +{ +public: + SSlideLayoutAtom m_oLayout; + UINT m_nMasterIDRef; + UINT m_nNotesIDRef; + + bool m_bMasterObjects; + bool m_bMasterScheme; + bool m_bMasterBackground; - bool m_bMasterObjects; - bool m_bMasterScheme; - bool m_bMasterBackground; +public: + + CRecordSlideAtom(); + ~CRecordSlideAtom(); - public: - - CRecordSlideAtom() - { - m_oLayout.m_hash = 0; - } - - ~CRecordSlideAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_oLayout.m_nGeom = (INT)StreamUtils::ReadLONG(pStream); - for (int nIndex = 0; nIndex < 8; nIndex++) - { - m_oLayout.m_pPlaceHolderID[nIndex] = StreamUtils::ReadBYTE(pStream); - m_oLayout.m_hash = (m_oLayout.m_hash << 4) + m_oLayout.m_pPlaceHolderID[nIndex]; - } - - m_oLayout.m_hash += (((_UINT64)m_oLayout.m_nGeom) << 32); - - m_nMasterIDRef = (UINT)StreamUtils::ReadDWORD(pStream); - m_nNotesIDRef = (UINT)StreamUtils::ReadDWORD(pStream); - - USHORT nFlag = StreamUtils::ReadWORD(pStream); - - m_bMasterObjects = ((nFlag & 0x01) == 0x01); - m_bMasterScheme = ((nFlag & 0x02) == 0x02); - m_bMasterBackground = ((nFlag & 0x04) == 0x04); - - StreamUtils::StreamSkip(2, pStream); - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/SlideColorSchemeAtom.cpp b/MsBinaryFile/PptFile/Records/SlideColorSchemeAtom.cpp index fa6e20db63..425c085a57 100644 --- a/MsBinaryFile/PptFile/Records/SlideColorSchemeAtom.cpp +++ b/MsBinaryFile/PptFile/Records/SlideColorSchemeAtom.cpp @@ -1,66 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*//* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "SlideColorSchemeAtom.h" +using namespace PPT; CRecordSplitMenuColorRecord::CRecordSplitMenuColorRecord() { @@ -94,7 +34,7 @@ void CRecordMostRecentlyUserColors::ReadFromStream(SRecordHeader &oHeader, POLE: for (unsigned int i = 0; i < m_oHeader.RecLen / 4; i++) { - SColorAtom color; + ODRAW::SColorAtom color; NSStreamReader::Read(pStream, color); m_oColors.push_back(color); diff --git a/MsBinaryFile/PptFile/Records/SlideColorSchemeAtom.h b/MsBinaryFile/PptFile/Records/SlideColorSchemeAtom.h index 8ef26a589e..223f333fba 100644 --- a/MsBinaryFile/PptFile/Records/SlideColorSchemeAtom.h +++ b/MsBinaryFile/PptFile/Records/SlideColorSchemeAtom.h @@ -30,61 +30,35 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordSplitMenuColorRecord : public CUnknownRecord - { - public: - ODRAW::SColorAtom m_oFillColor; - ODRAW::SColorAtom m_oLineColor; - ODRAW::SColorAtom m_oShadowColor; - ODRAW::SColorAtom m_o3DColor; +class CRecordSplitMenuColorRecord: public CUnknownRecord +{ +public: + ODRAW::SColorAtom m_oFillColor; + ODRAW::SColorAtom m_oLineColor; + ODRAW::SColorAtom m_oShadowColor; + ODRAW::SColorAtom m_o3DColor; + + CRecordSplitMenuColorRecord(); + ~CRecordSplitMenuColorRecord(); - CRecordSplitMenuColorRecord() - { - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; - ~CRecordSplitMenuColorRecord() - { - } +class CRecordMostRecentlyUserColors : public CUnknownRecord +{ +public: + std::vector m_oColors; + - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; + CRecordMostRecentlyUserColors(); + ~CRecordMostRecentlyUserColors(); - NSStreamReader::Read(pStream, m_oFillColor); - NSStreamReader::Read(pStream, m_oLineColor); - NSStreamReader::Read(pStream, m_oShadowColor); - NSStreamReader::Read(pStream, m_o3DColor); - } - }; - - class CRecordMostRecentlyUserColors : public CUnknownRecord - { - public: - std::vector m_oColors; - - CRecordMostRecentlyUserColors() - { - } - - ~CRecordMostRecentlyUserColors() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - for (unsigned int i = 0; i < m_oHeader.RecLen / 4; i++) - { - ODRAW::SColorAtom color; - NSStreamReader::Read(pStream, color); - - m_oColors.push_back(color); - } - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/SlideContainer.cpp b/MsBinaryFile/PptFile/Records/SlideContainer.cpp index 30713a5fb1..c11603e268 100644 --- a/MsBinaryFile/PptFile/Records/SlideContainer.cpp +++ b/MsBinaryFile/PptFile/Records/SlideContainer.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "SlideContainer.h" +using namespace PPT; CRecordSlide::CRecordSlide() { diff --git a/MsBinaryFile/PptFile/Records/SlideContainer.h b/MsBinaryFile/PptFile/Records/SlideContainer.h index a66c866fc6..4a518cb8b4 100644 --- a/MsBinaryFile/PptFile/Records/SlideContainer.h +++ b/MsBinaryFile/PptFile/Records/SlideContainer.h @@ -36,140 +36,37 @@ #include "../Records/SSSlideInfoAtom.h" + namespace PPT { - class CRecordSlide : public CRecordsContainer - { - public: - SSlidePersist m_oPersist; - CRecordSlideProgTagsContainer* m_pSlideProgTagsContainer; +class CRecordSlide : public CRecordsContainer +{ +public: + SSlidePersist m_oPersist; + CRecordSlideProgTagsContainer* m_pSlideProgTagsContainer; - bool m_bExistsTransition; + bool m_bExistsTransition; + + CSlideShowSlideInfoAtom m_oSlideShowSlideInfoAtom; - CSlideShowSlideInfoAtom m_oSlideShowSlideInfoAtom; + int m_Index; + int m_IndexUser; + +private: + _UINT32 m_lCountReferences; - int m_Index; - int m_IndexUser; +public: + + CRecordSlide(); - private: - _UINT32 m_lCountReferences; + virtual ~CRecordSlide(); - public: + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); - CRecordSlide() - { - m_bExistsTransition = false; - m_pSlideProgTagsContainer = NULL; - m_lCountReferences = 0; + bool IsSlide(); - m_Index = -1; - m_IndexUser = 0; - - AddRef(); - } - - virtual ~CRecordSlide() - { - Clear(); - RELEASEOBJECT(m_pSlideProgTagsContainer); - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - m_arRecords.clear(); - - LONG lPosition = 0; - StreamUtils::StreamPosition(lPosition, pStream); - - m_oHeader = oHeader; - - UINT lCurLen = 0; - SRecordHeader oRec; - - while (lCurLen < m_oHeader.RecLen) - { - if (oRec.ReadFromStream(pStream) == FALSE) - { - break; - } - - if (RT_SlideShowSlideInfoAtom == oRec.RecType) - { - m_bExistsTransition = true; - m_oSlideShowSlideInfoAtom.ReadFromStream(oRec, pStream); - - lCurLen += (8 + oRec.RecLen); - continue; - } - - if (RT_ProgTags == oRec.RecType) - { - m_pSlideProgTagsContainer = - new CRecordSlideProgTagsContainer(); - m_pSlideProgTagsContainer->ReadFromStream(oRec, pStream); - - lCurLen += (8 + oRec.RecLen); - continue; - } - - if (RT_VbaInfo == oRec.RecType) - { - auto pVbaInfo = new CRecordsContainer; - pVbaInfo->ReadFromStream(oRec, pStream); - m_arRecords.push_back(pVbaInfo); - - lCurLen += (8 + oRec.RecLen); - continue; - } - - - IRecord* pRecord = CreateByType(oRec); - - - - pRecord->ReadFromStream(oRec, pStream); - m_arRecords.push_back(pRecord); - - - lCurLen += (8 + oRec.RecLen); - } - if (lCurLen != m_oHeader.RecLen) - { - // нужно разобраться, что тут такое!!! - LONG lPosition = 0; - StreamUtils::StreamSeek(lPosition + m_oHeader.RecLen, pStream); - } - } - - bool IsSlide() - { - for (size_t nIndex = 0; nIndex < m_arRecords.size(); ++nIndex) - { - if ((RT_Slide == m_arRecords[nIndex]->m_oHeader.RecType) || - (RT_MainMaster == m_arRecords[nIndex]->m_oHeader.RecType) || - (RT_Notes == m_arRecords[nIndex]->m_oHeader.RecType)) - { - return true; - } - } - return false; - } - - void AddRef() - { - ++m_lCountReferences; - } - void Release() - { - --m_lCountReferences; - if (0 == m_lCountReferences) - delete this; - } - CRecordSlide* QueryInterface() - { - AddRef(); - return this; - } - }; + void AddRef(); + void Release(); + CRecordSlide* QueryInterface(); +}; } diff --git a/MsBinaryFile/PptFile/Records/SlideFlags10Atom.cpp b/MsBinaryFile/PptFile/Records/SlideFlags10Atom.cpp index ee763a5bbd..ddda0d2e70 100644 --- a/MsBinaryFile/PptFile/Records/SlideFlags10Atom.cpp +++ b/MsBinaryFile/PptFile/Records/SlideFlags10Atom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "SlideFlags10Atom.h" +using namespace PPT; void PPT::CRecordSlideFlags10Atom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/SlideFlags10Atom.h b/MsBinaryFile/PptFile/Records/SlideFlags10Atom.h index 66e357b080..ed54b0bc28 100644 --- a/MsBinaryFile/PptFile/Records/SlideFlags10Atom.h +++ b/MsBinaryFile/PptFile/Records/SlideFlags10Atom.h @@ -39,15 +39,7 @@ namespace PPT class CRecordSlideFlags10Atom : public CUnknownRecord { public: - void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override - { - m_oHeader = oHeader; - - _UINT32 data(StreamUtils::ReadLONG(pStream)); - - m_fPreserveMaster = ( 0x01 == ( 0x01 & ((BYTE)data) ) ); - m_fOverrideMasterAnimation = ( 0x02 == ( 0x02 & ((BYTE)data) ) ); - } + void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; public: bool m_fPreserveMaster; bool m_fOverrideMasterAnimation; diff --git a/MsBinaryFile/PptFile/Records/SlideListWithText.cpp b/MsBinaryFile/PptFile/Records/SlideListWithText.cpp index 3d353d18f3..2effa36e72 100644 --- a/MsBinaryFile/PptFile/Records/SlideListWithText.cpp +++ b/MsBinaryFile/PptFile/Records/SlideListWithText.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "SlideListWithText.h" +using namespace PPT; CRecordSlideListWithText::CRecordSlideListWithText() : m_arSlides() { diff --git a/MsBinaryFile/PptFile/Records/SlideListWithText.h b/MsBinaryFile/PptFile/Records/SlideListWithText.h index d6393ff58d..a5c2d91f3f 100644 --- a/MsBinaryFile/PptFile/Records/SlideListWithText.h +++ b/MsBinaryFile/PptFile/Records/SlideListWithText.h @@ -36,137 +36,28 @@ namespace PPT { - class CRecordSlideListWithText : public CRecordsContainer - { - public: - enum Instances - { - CollectionOfSlides = 0, - CollectionOfMasterSlides = 1, - CollectionOfNotesSlides = 2 - }; +class CRecordSlideListWithText : public CRecordsContainer +{ +public: + enum Instances + { + CollectionOfSlides = 0, + CollectionOfMasterSlides = 1, + CollectionOfNotesSlides = 2 + }; - public: - std::vector m_arSlides; - std::vector> m_arTextPlaceHolders; +public: + std::vector m_arSlides; + std::vector> m_arTextPlaceHolders; - Instances m_Type; + Instances m_Type; - public: +public: + + CRecordSlideListWithText(); - CRecordSlideListWithText() : m_arSlides() - { - m_Type = CollectionOfSlides; - } + ~CRecordSlideListWithText(); - ~CRecordSlideListWithText() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - m_Type = (Instances)m_oHeader.RecInstance; - - if (m_oHeader.IsContainer()) - { - // а по-другому и быть не могло... - _UINT32 lSymbolCount = 0; - - UINT lCurLen = 0; - SRecordHeader oRec; - - while (lCurLen < m_oHeader.RecLen) - { - if (oRec.ReadFromStream(pStream) == FALSE) - { - break; - } - - IRecord* pRecord = CreateByType(oRec); - - if (RT_StyleTextPropAtom == oRec.RecType) - { - ((CRecordStyleTextPropAtom*)(pRecord))->m_lCount = lSymbolCount; - } - else if (RT_TextSpecialInfoAtom == oRec.RecType) - { - ((CRecordTextSpecInfoAtom*)(pRecord))->m_lCount = lSymbolCount; - } - - pRecord->ReadFromStream(oRec, pStream); - lCurLen += (8 + oRec.RecLen); - - if (RT_SlidePersistAtom == oRec.RecType) - { - m_arSlides.push_back((CRecordSlidePersistAtom*)pRecord); - - std::vector elm; - m_arTextPlaceHolders.push_back(elm); - } - else - { - long nCurrentSlide = (long)m_arSlides.size() - 1; - if (0 > nCurrentSlide) - continue; - - CRecordTextHeaderAtom* pHeader = dynamic_cast(pRecord); - if (NULL != pHeader) - { - CTextFullSettings oAttr; - m_arTextPlaceHolders[nCurrentSlide].push_back(oAttr); - m_arTextPlaceHolders[nCurrentSlide][m_arTextPlaceHolders[nCurrentSlide].size() - 1].m_nTextType = pHeader->m_nTextType; - - m_arRecords.push_back(pRecord); - continue; - } - CRecordTextCharsAtom* pChars = dynamic_cast(pRecord); - CRecordTextBytesAtom* pBytes = dynamic_cast(pRecord); - - long nCurrentTextHeader = (long)m_arTextPlaceHolders[nCurrentSlide].size() - 1; - if (0 > nCurrentTextHeader) - continue; - - // здесь еще настойки кроме текста - if (NULL != pChars) - { - m_arTextPlaceHolders[nCurrentSlide][nCurrentTextHeader].m_strText = pChars->m_strText; - lSymbolCount = (_UINT32)pChars->m_strText.length(); - } - else if (NULL != pBytes) - { - m_arTextPlaceHolders[nCurrentSlide][nCurrentTextHeader].m_strText = pBytes->m_strText; - lSymbolCount = (_UINT32)pBytes->m_strText.length(); - } - - if (RT_StyleTextPropAtom == oRec.RecType) - { - m_arTextPlaceHolders[nCurrentSlide][nCurrentTextHeader].m_pTextStyleProp = - dynamic_cast(pRecord); - } - if (RT_TextSpecialInfoAtom == oRec.RecType) - { - m_arTextPlaceHolders[nCurrentSlide][nCurrentTextHeader].m_pTextSpecInfo = - dynamic_cast(pRecord); - } - if (RT_TextRulerAtom == oRec.RecType) - { - m_arTextPlaceHolders[nCurrentSlide][nCurrentTextHeader].m_pTextRuler = - dynamic_cast(pRecord); - } - if (RT_TextInteractiveInfoAtom == oRec.RecType) - { - CRecordTextInteractiveInfoAtom* pTxRanges = dynamic_cast(pRecord); - PPT::CTextRange oRange; - oRange.m_lStart = pTxRanges->m_lStart; - oRange.m_lEnd = pTxRanges->m_lEnd; - m_arTextPlaceHolders[nCurrentSlide][nCurrentTextHeader].m_arRanges.push_back(oRange); - } - } - - m_arRecords.push_back(pRecord); - } - } - } - }; + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); +}; } diff --git a/MsBinaryFile/PptFile/Records/SlidePersistAtom.cpp b/MsBinaryFile/PptFile/Records/SlidePersistAtom.cpp index bca37930a3..e4e92ba7a8 100644 --- a/MsBinaryFile/PptFile/Records/SlidePersistAtom.cpp +++ b/MsBinaryFile/PptFile/Records/SlidePersistAtom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "SlidePersistAtom.h" +using namespace PPT; CRecordSlidePersistAtom::CRecordSlidePersistAtom() { diff --git a/MsBinaryFile/PptFile/Records/SlidePersistAtom.h b/MsBinaryFile/PptFile/Records/SlidePersistAtom.h index cd7ce36cbb..6ea32f0909 100644 --- a/MsBinaryFile/PptFile/Records/SlidePersistAtom.h +++ b/MsBinaryFile/PptFile/Records/SlidePersistAtom.h @@ -30,47 +30,28 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordSlidePersistAtom : public CUnknownRecord - { - public: - _UINT32 m_nPsrRef; +class CRecordSlidePersistAtom : public CUnknownRecord +{ +public: + _UINT32 m_nPsrRef; + + bool m_bShouldCollapse; + bool m_bNonOutlineData; - bool m_bShouldCollapse; - bool m_bNonOutlineData; + INT m_nNumberText; + _UINT32 m_nSlideID; - INT m_nNumberText; - _UINT32 m_nSlideID; + CRecordSlidePersistAtom(); - CRecordSlidePersistAtom() - { - } + ~CRecordSlidePersistAtom(); - ~CRecordSlidePersistAtom() - { - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_nPsrRef = StreamUtils::ReadDWORD(pStream); - - BYTE Mem = 0; - Mem = StreamUtils::ReadBYTE(pStream); - m_bShouldCollapse = ((Mem & 0x02) == 0x02); - m_bNonOutlineData = ((Mem & 0x04) == 0x04); - - StreamUtils::StreamSkip(3, pStream); - - m_nNumberText = (INT)StreamUtils::ReadLONG(pStream); - m_nSlideID = StreamUtils::ReadDWORD(pStream); - - StreamUtils::StreamSkip(4, pStream); - } - - }; -} \ No newline at end of file +}; +} diff --git a/MsBinaryFile/PptFile/Records/SlideProgTagsContainer.cpp b/MsBinaryFile/PptFile/Records/SlideProgTagsContainer.cpp index 2f2a7f592f..c445a230fe 100644 --- a/MsBinaryFile/PptFile/Records/SlideProgTagsContainer.cpp +++ b/MsBinaryFile/PptFile/Records/SlideProgTagsContainer.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "SlideProgTagsContainer.h" +using namespace PPT; CRecordPP9SlideBinaryTagExtension::CRecordPP9SlideBinaryTagExtension() { diff --git a/MsBinaryFile/PptFile/Records/SlideProgTagsContainer.h b/MsBinaryFile/PptFile/Records/SlideProgTagsContainer.h index 9b70fa380b..5c9c49efe0 100644 --- a/MsBinaryFile/PptFile/Records/SlideProgTagsContainer.h +++ b/MsBinaryFile/PptFile/Records/SlideProgTagsContainer.h @@ -54,48 +54,16 @@ namespace PPT { - class CRecordPP9SlideBinaryTagExtension : public CUnknownRecord { public: std::vector m_rgTextMasterStyleAtom; - CRecordPP9SlideBinaryTagExtension() - { + CRecordPP9SlideBinaryTagExtension(); - } + ~CRecordPP9SlideBinaryTagExtension(); - ~CRecordPP9SlideBinaryTagExtension() - { - for (auto pEl : m_rgTextMasterStyleAtom) - { - RELEASEOBJECT(pEl) - } - } - - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - LONG lPos = 0; - StreamUtils::StreamPosition ( lPos, pStream ); - - UINT lCurLen = 0; - - SRecordHeader ReadHeader; - - while ( lCurLen < m_oHeader.RecLen ) - { - if ( ReadHeader.ReadFromStream(pStream) == false) - break; - - lCurLen += 8 + ReadHeader.RecLen; - auto pStyle = new CRecordTextMasterStyle9Atom; - pStyle->ReadFromStream(ReadHeader, pStream); - m_rgTextMasterStyleAtom.push_back(pStyle); - } - - StreamUtils::StreamSeek ( lPos + m_oHeader.RecLen, pStream ); - } + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ); }; @@ -103,141 +71,11 @@ class CRecordPP10SlideBinaryTagExtension : public CUnknownRecord { public: - CRecordPP10SlideBinaryTagExtension () : - m_pLinkedSlideAtom(nullptr), - m_pSlideFlagsAtom(nullptr), - m_pSlideTimeAtom(nullptr), - m_pHashCode10Atom(nullptr), - m_pExtTimeNodeContainer(nullptr), - m_pBuildListContainer(nullptr), + CRecordPP10SlideBinaryTagExtension (); - m_haveLinkedSlide(false), - m_haveSlideFlags(false), - m_haveSlideTime(false), - m_haveHashCode(false), - m_haveExtTime(false), - m_haveBuildList(false) - { - } + virtual ~CRecordPP10SlideBinaryTagExtension (); - virtual ~CRecordPP10SlideBinaryTagExtension () - { - RELEASEOBJECT (m_pLinkedSlideAtom) - RELEASEOBJECT (m_pSlideFlagsAtom) - RELEASEOBJECT (m_pSlideTimeAtom) - RELEASEOBJECT (m_pHashCode10Atom) - RELEASEOBJECT (m_pExtTimeNodeContainer) - RELEASEOBJECT (m_pBuildListContainer) - - for (auto pEl : m_arrRgTextMasterStyleAtom) - RELEASEOBJECT(pEl) - for (auto pEl : m_arrRgComment10Container) - RELEASEOBJECT(pEl) - for (auto pEl : m_arrRgLinkedShape10Atom) - RELEASEOBJECT(pEl) - } - - virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) - { - m_oHeader = oHeader; - - LONG lPos = 0; - StreamUtils::StreamPosition ( lPos, pStream ); - - UINT lCurLen = 0; - - SRecordHeader ReadHeader; - - while ( lCurLen < m_oHeader.RecLen ) - { - if ( ReadHeader.ReadFromStream(pStream) == false) - break; - - lCurLen += 8 + ReadHeader.RecLen; - - switch (ReadHeader.RecType) { - case RT_TextMasterStyle10Atom: - { - CRecordTextMasterStyleAtom* pRecord = - new CRecordTextMasterStyleAtom(); - pRecord->ReadFromStream(ReadHeader, pStream); - m_arrRgTextMasterStyleAtom.push_back(pRecord); - break; - } - - case RT_Comment10: - { - CRecordComment10Container* pRecord = - new CRecordComment10Container(); - pRecord->ReadFromStream(ReadHeader, pStream); - m_arrRgComment10Container.push_back(pRecord); - break; - } - - case RT_LinkedSlide10Atom : - { - m_pLinkedSlideAtom = new CRecordLinkedSlide10Atom(); - m_pLinkedSlideAtom->ReadFromStream(ReadHeader, pStream); - m_haveLinkedSlide = true; - break; - } - - case RT_LinkedShape10Atom : - { - CRecordLinkedShape10Atom* pRecord = - new CRecordLinkedShape10Atom(); - pRecord->ReadFromStream(ReadHeader, pStream); - m_arrRgLinkedShape10Atom.push_back(pRecord); - break; - } - - case RT_SlideFlags10Atom: - { - m_pSlideFlagsAtom = new CRecordSlideFlags10Atom(); - m_pSlideFlagsAtom->ReadFromStream(ReadHeader, pStream); - m_haveSlideFlags = true; - break; - } - - case RT_SlideTime10Atom: - { - m_pSlideTimeAtom = new CRecordSlideTime10Atom(); - m_pSlideTimeAtom->ReadFromStream(ReadHeader, pStream); - m_haveSlideTime = true; - break; - } - - case RT_HashCodeAtom: - { - m_pHashCode10Atom = new CRecordHashCode10Atom(); - m_pHashCode10Atom->ReadFromStream(ReadHeader, pStream); - m_haveHashCode = true; - break; - } - - case RT_TimeExtTimeNodeContainer: - { - m_pExtTimeNodeContainer = new CRecordExtTimeNodeContainer(); - m_pExtTimeNodeContainer->ReadFromStream(ReadHeader, pStream); - m_haveExtTime = true; - break; - } - - case RT_BuildList: - { - m_pBuildListContainer = new CRecordBuildListContainer(); - m_pBuildListContainer->ReadFromStream(ReadHeader, pStream); - m_haveBuildList = true; - break; - } - - default: - break; - } - } - - StreamUtils::StreamSeek ( lPos + m_oHeader.RecLen, pStream ); - } + virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ); public: std::vector m_arrRgTextMasterStyleAtom; @@ -262,15 +100,9 @@ public: class CRecordPP12SlideBinaryTagExtension : public CUnknownRecord { public: - CRecordPP12SlideBinaryTagExtension() - { + CRecordPP12SlideBinaryTagExtension(); - } - - ~CRecordPP12SlideBinaryTagExtension() - { - - } + ~CRecordPP12SlideBinaryTagExtension(); virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream ) { @@ -291,54 +123,9 @@ public: class CRecordSlideProgBinaryTagSubContainerOrAtom : public CUnknownRecord { public: - CRecordSlideProgBinaryTagSubContainerOrAtom() : - m_pTagName(nullptr), m_pTagContainer(nullptr) - {} - ~CRecordSlideProgBinaryTagSubContainerOrAtom() - { - RELEASEOBJECT(m_pTagName); - RELEASEOBJECT(m_pTagContainer); - } - void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override - { - m_oHeader = oHeader; - LONG lPos = 0; StreamUtils::StreamPosition(lPos, pStream); - - SRecordHeader ReadHeader; - ReadHeader.ReadFromStream(pStream); - - if (m_oHeader.RecType == RT_ProgBinaryTag) - { - m_pTagName = new CRecordCString(); - m_pTagName->ReadFromStream(ReadHeader, pStream); - - SRecordHeader childHeader; - if (!childHeader.ReadFromStream(pStream)) - return; - - if (m_pTagName->m_strText == TN_PPT9) { - m_pTagContainer = new CRecordPP9SlideBinaryTagExtension(); - dynamic_cast - (m_pTagContainer)->ReadFromStream(childHeader, pStream); - } else if (m_pTagName->m_strText == TN_PPT10) { - m_pTagContainer = new CRecordPP10SlideBinaryTagExtension(); - dynamic_cast - (m_pTagContainer)->ReadFromStream(childHeader, pStream); - } else if (m_pTagName->m_strText == TN_PPT12) { - m_pTagContainer = new CRecordPP12SlideBinaryTagExtension(); - dynamic_cast - (m_pTagContainer)->ReadFromStream(childHeader, pStream); - } - - } else if (m_oHeader.RecType == RT_ProgStringTag) - { - m_pTagContainer = new CRecordProgStringTagContainer(); - dynamic_cast - (m_pTagContainer)->ReadFromStream(ReadHeader, pStream); - } - LONG lSeek = lPos + m_oHeader.RecLen; - StreamUtils::StreamSeek(lSeek, pStream); - } + CRecordSlideProgBinaryTagSubContainerOrAtom(); + ~CRecordSlideProgBinaryTagSubContainerOrAtom(); + void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; public: CRecordCString* m_pTagName; // OPTIONAL @@ -349,50 +136,14 @@ class CRecordSlideProgTagsContainer : public CUnknownRecord { public: - CRecordSlideProgTagsContainer () - { + CRecordSlideProgTagsContainer (); - } - - ~CRecordSlideProgTagsContainer() - { - for (auto pEl : m_arrRgChildRec) - RELEASEOBJECT(pEl) - } + ~CRecordSlideProgTagsContainer(); - virtual void ReadFromStream (SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; + virtual void ReadFromStream (SRecordHeader & oHeader, POLE::Stream* pStream) override; - LONG lPos = 0; - StreamUtils::StreamPosition ( lPos, pStream ); - - LONG lCurLen(0); - SRecordHeader ReadHeader; - - while (lCurLen < (LONG)m_oHeader.RecLen) - { - if ( ReadHeader.ReadFromStream(pStream) == false) - break; - lCurLen += 8 + ReadHeader.RecLen; - CRecordSlideProgBinaryTagSubContainerOrAtom* pRecord = - new CRecordSlideProgBinaryTagSubContainerOrAtom(); - pRecord->ReadFromStream(ReadHeader, pStream); - m_arrRgChildRec.push_back(pRecord); - } - - StreamUtils::StreamSeek(lPos + m_oHeader.RecLen, pStream); - } - - CRecordPP10SlideBinaryTagExtension* getPP10SlideBinaryTagExtension() - { - for (auto* rec : m_arrRgChildRec) - if (rec->m_pTagName && rec->m_pTagName->m_strText == TN_PPT10) - return (CRecordPP10SlideBinaryTagExtension*)rec->m_pTagContainer; - - return nullptr; - } + CRecordPP10SlideBinaryTagExtension* getPP10SlideBinaryTagExtension(); public: std::vector m_arrRgChildRec; diff --git a/MsBinaryFile/PptFile/Records/SlideTime10Atom.cpp b/MsBinaryFile/PptFile/Records/SlideTime10Atom.cpp index 005a0bc685..6f417367cc 100644 --- a/MsBinaryFile/PptFile/Records/SlideTime10Atom.cpp +++ b/MsBinaryFile/PptFile/Records/SlideTime10Atom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "SlideTime10Atom.h" +using namespace PPT; void CRecordSlideTime10Atom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/SlideTime10Atom.h b/MsBinaryFile/PptFile/Records/SlideTime10Atom.h index 0afa771485..c2343cf25a 100644 --- a/MsBinaryFile/PptFile/Records/SlideTime10Atom.h +++ b/MsBinaryFile/PptFile/Records/SlideTime10Atom.h @@ -47,13 +47,7 @@ typedef struct _FILETIME { class CRecordSlideTime10Atom : public CUnknownRecord { public: -void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override -{ - m_oHeader = oHeader; - - m_oFileTime.dwLowDateTime = StreamUtils::ReadDWORD(pStream); - m_oFileTime.dwHighDateTime = StreamUtils::ReadDWORD(pStream); -} +void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; public: FILETIME m_oFileTime; diff --git a/MsBinaryFile/PptFile/Records/SlideViewInfoAtom.cpp b/MsBinaryFile/PptFile/Records/SlideViewInfoAtom.cpp index 49da447b20..4582765f9c 100644 --- a/MsBinaryFile/PptFile/Records/SlideViewInfoAtom.cpp +++ b/MsBinaryFile/PptFile/Records/SlideViewInfoAtom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "SlideViewInfoAtom.h" +using namespace PPT; CRecordSlideViewInfoAtom::CRecordSlideViewInfoAtom() { diff --git a/MsBinaryFile/PptFile/Records/SlideViewInfoAtom.h b/MsBinaryFile/PptFile/Records/SlideViewInfoAtom.h index 03be43e2f7..601be5eada 100644 --- a/MsBinaryFile/PptFile/Records/SlideViewInfoAtom.h +++ b/MsBinaryFile/PptFile/Records/SlideViewInfoAtom.h @@ -30,34 +30,23 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordSlideViewInfoAtom : public CUnknownRecord - { - BOOL1 m_bShowGuides; - BOOL1 m_bSnapToGrid; - BOOL1 m_bSnapToShape; +class CRecordSlideViewInfoAtom : public CUnknownRecord +{ + BOOL1 m_bShowGuides; + BOOL1 m_bSnapToGrid; + BOOL1 m_bSnapToShape; - public: +public: + CRecordSlideViewInfoAtom(); + ~CRecordSlideViewInfoAtom(); - CRecordSlideViewInfoAtom() - { - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; - ~CRecordSlideViewInfoAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_bShowGuides = StreamUtils::ReadBYTE(pStream); - m_bSnapToGrid = StreamUtils::ReadBYTE(pStream); - m_bSnapToShape = StreamUtils::ReadBYTE(pStream); - } - - }; -} \ No newline at end of file +}; +} diff --git a/MsBinaryFile/PptFile/Records/SoundCollAtom.cpp b/MsBinaryFile/PptFile/Records/SoundCollAtom.cpp index c6b74cf705..b5b0da8b96 100644 --- a/MsBinaryFile/PptFile/Records/SoundCollAtom.cpp +++ b/MsBinaryFile/PptFile/Records/SoundCollAtom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "SoundCollAtom.h" +using namespace PPT; CRecordSoundCollAtom::CRecordSoundCollAtom() { diff --git a/MsBinaryFile/PptFile/Records/SoundCollAtom.h b/MsBinaryFile/PptFile/Records/SoundCollAtom.h index c81d2d736e..4d5d117f54 100644 --- a/MsBinaryFile/PptFile/Records/SoundCollAtom.h +++ b/MsBinaryFile/PptFile/Records/SoundCollAtom.h @@ -30,28 +30,20 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordSoundCollAtom : public CUnknownRecord - { - public: - INT m_nObjectIdSeed; +class CRecordSoundCollAtom : public CUnknownRecord +{ +public: + INT m_nObjectIdSeed; + + CRecordSoundCollAtom(); + ~CRecordSoundCollAtom(); - CRecordSoundCollAtom() - { - } - - ~CRecordSoundCollAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_nObjectIdSeed = StreamUtils::ReadDWORD(pStream); - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/SoundCollectionContainer.cpp b/MsBinaryFile/PptFile/Records/SoundCollectionContainer.cpp index 21033ab903..8b7bf878d8 100644 --- a/MsBinaryFile/PptFile/Records/SoundCollectionContainer.cpp +++ b/MsBinaryFile/PptFile/Records/SoundCollectionContainer.cpp @@ -1,66 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*//* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "SoundCollectionContainer.h" +using namespace PPT; CRecordSoundCollectionContainer::CRecordSoundCollectionContainer() { diff --git a/MsBinaryFile/PptFile/Records/SoundCollectionContainer.h b/MsBinaryFile/PptFile/Records/SoundCollectionContainer.h index 5f3e067d3c..abfa5ec903 100644 --- a/MsBinaryFile/PptFile/Records/SoundCollectionContainer.h +++ b/MsBinaryFile/PptFile/Records/SoundCollectionContainer.h @@ -30,25 +30,20 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordSoundCollectionContainer : public CRecordsContainer - { - public: +class CRecordSoundCollectionContainer : public CRecordsContainer +{ +public: + + CRecordSoundCollectionContainer(); - CRecordSoundCollectionContainer() - { - } + ~CRecordSoundCollectionContainer(); - ~CRecordSoundCollectionContainer() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - CRecordsContainer::ReadFromStream(oHeader, pStream); - } - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/SoundContainer.cpp b/MsBinaryFile/PptFile/Records/SoundContainer.cpp index e358af6188..b35de40b8d 100644 --- a/MsBinaryFile/PptFile/Records/SoundContainer.cpp +++ b/MsBinaryFile/PptFile/Records/SoundContainer.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "SoundContainer.h" +using namespace PPT; CRecordSoundContainer::CRecordSoundContainer() { diff --git a/MsBinaryFile/PptFile/Records/SoundContainer.h b/MsBinaryFile/PptFile/Records/SoundContainer.h index 16a3b3b294..60d4987741 100644 --- a/MsBinaryFile/PptFile/Records/SoundContainer.h +++ b/MsBinaryFile/PptFile/Records/SoundContainer.h @@ -34,22 +34,13 @@ namespace PPT { - class CRecordSoundContainer : public CRecordsContainer - { - public: +class CRecordSoundContainer : public CRecordsContainer +{ +public: + CRecordSoundContainer(); + ~CRecordSoundContainer(); - CRecordSoundContainer() - { - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; - ~CRecordSoundContainer() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - CRecordsContainer::ReadFromStream(oHeader, pStream); - } - - }; -} \ No newline at end of file +}; +} diff --git a/MsBinaryFile/PptFile/Records/SoundDataBlob.cpp b/MsBinaryFile/PptFile/Records/SoundDataBlob.cpp index 199e641cb7..a37eb61618 100644 --- a/MsBinaryFile/PptFile/Records/SoundDataBlob.cpp +++ b/MsBinaryFile/PptFile/Records/SoundDataBlob.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "SoundDataBlob.h" +using namespace PPT; CRecordSoundDataBlob::CRecordSoundDataBlob() { diff --git a/MsBinaryFile/PptFile/Records/SoundDataBlob.h b/MsBinaryFile/PptFile/Records/SoundDataBlob.h index 1bb3df467e..10a09aef19 100644 --- a/MsBinaryFile/PptFile/Records/SoundDataBlob.h +++ b/MsBinaryFile/PptFile/Records/SoundDataBlob.h @@ -32,55 +32,24 @@ #pragma once #include "../Reader/Records.h" + namespace PPT { - class CRecordSoundDataBlob : public CUnknownRecord - { - BYTE* m_pData; - LONG m_lSize; +class CRecordSoundDataBlob : public CUnknownRecord +{ + BYTE* m_pData; + LONG m_lSize; - public: +public: + + CRecordSoundDataBlob(); - CRecordSoundDataBlob() - { - m_pData = NULL; - m_lSize = 0; - } + ~CRecordSoundDataBlob(); - ~CRecordSoundDataBlob() - { - ReleaseData(); - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - m_lSize = m_oHeader.RecLen; + void ReleaseData(); - if (0 < m_lSize) - { - m_pData = new BYTE[m_lSize]; - pStream->read(m_pData, m_lSize); - } - } - - void ReleaseData() - { - RELEASEARRAYOBJECTS(m_pData); - } - - void SaveToFile(std::wstring strFile) - { - if ((NULL == m_pData) || (0 >= m_lSize)) - return; - - NSFile::CFileBinary oFile; - oFile.CreateFileW(strFile); - - oFile.WriteFile((BYTE*)m_pData, (DWORD)m_lSize); - oFile.CloseFile(); - - ReleaseData(); - } - }; -} \ No newline at end of file + void SaveToFile(std::wstring strFile); +}; +} diff --git a/MsBinaryFile/PptFile/Records/StyleTextProp10Atom.cpp b/MsBinaryFile/PptFile/Records/StyleTextProp10Atom.cpp index a9ca27f366..c1da0f24e4 100644 --- a/MsBinaryFile/PptFile/Records/StyleTextProp10Atom.cpp +++ b/MsBinaryFile/PptFile/Records/StyleTextProp10Atom.cpp @@ -1,66 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ +#include "StyleTextProp10Atom.h" -#include "StyleTextProp10Atom.h"/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ +using namespace PPT; void CRecordStyleTextProp10Atom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/StyleTextProp10Atom.h b/MsBinaryFile/PptFile/Records/StyleTextProp10Atom.h index 09f462f584..6014a4e030 100644 --- a/MsBinaryFile/PptFile/Records/StyleTextProp10Atom.h +++ b/MsBinaryFile/PptFile/Records/StyleTextProp10Atom.h @@ -42,24 +42,7 @@ class CRecordStyleTextProp10Atom : public CUnknownRecord public: std::vector rgStyleTextProp10; - virtual void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) - { - m_oHeader = oHeader; - LONG lPos = 0; - StreamUtils::StreamPosition ( lPos, pStream ); - LONG lCurPos = 0; - StreamUtils::StreamPosition ( lCurPos, pStream ); - - while ( lPos + (LONG)m_oHeader.RecLen > lCurPos) - { - STextCFException10 style; - style.ReadFromStream(pStream); - rgStyleTextProp10.push_back(style); - - StreamUtils::StreamPosition ( lCurPos, pStream ); - } - StreamUtils::StreamSeek(lPos + m_oHeader.RecLen, pStream); - } + virtual void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; }; } diff --git a/MsBinaryFile/PptFile/Records/StyleTextProp11Atom.cpp b/MsBinaryFile/PptFile/Records/StyleTextProp11Atom.cpp index 4385238644..cbb30f779c 100644 --- a/MsBinaryFile/PptFile/Records/StyleTextProp11Atom.cpp +++ b/MsBinaryFile/PptFile/Records/StyleTextProp11Atom.cpp @@ -1,36 +1,7 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "StyleTextProp11Atom.h" +using namespace PPT; + void CRecordStyleTextProp11Atom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { m_oHeader = oHeader; diff --git a/MsBinaryFile/PptFile/Records/StyleTextProp11Atom.h b/MsBinaryFile/PptFile/Records/StyleTextProp11Atom.h index 8eaeabed6c..6db76845ca 100644 --- a/MsBinaryFile/PptFile/Records/StyleTextProp11Atom.h +++ b/MsBinaryFile/PptFile/Records/StyleTextProp11Atom.h @@ -47,24 +47,6 @@ class CRecordStyleTextProp11Atom : public CUnknownRecord public: std::vector m_rgStyleTextProp11; - virtual void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) - { - m_oHeader = oHeader; - LONG lPos = 0; - StreamUtils::StreamPosition ( lPos, pStream ); - - LONG lCurPos = 0; - StreamUtils::StreamPosition ( lCurPos, pStream ); - - while ( lPos + (LONG)m_oHeader.RecLen > lCurPos) - { - SStyleTextProp11 style; - style.ReadFromStream(pStream); - m_rgStyleTextProp11.push_back(style); - - StreamUtils::StreamPosition ( lCurPos, pStream ); - } - StreamUtils::StreamSeek(lPos + m_oHeader.RecLen, pStream); - } + virtual void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; }; } diff --git a/MsBinaryFile/PptFile/Records/StyleTextProp9Atom.cpp b/MsBinaryFile/PptFile/Records/StyleTextProp9Atom.cpp index 18dba99a75..bab32b2bc0 100644 --- a/MsBinaryFile/PptFile/Records/StyleTextProp9Atom.cpp +++ b/MsBinaryFile/PptFile/Records/StyleTextProp9Atom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "StyleTextProp9Atom.h" +using namespace PPT; CRecordStyleTextProp9Atom::~CRecordStyleTextProp9Atom() { diff --git a/MsBinaryFile/PptFile/Records/StyleTextProp9Atom.h b/MsBinaryFile/PptFile/Records/StyleTextProp9Atom.h index 04e4510d77..945d94da1d 100644 --- a/MsBinaryFile/PptFile/Records/StyleTextProp9Atom.h +++ b/MsBinaryFile/PptFile/Records/StyleTextProp9Atom.h @@ -30,13 +30,13 @@ * */ #pragma once + #include "TextPFException9.h" #include "TextCFException9.h" #include "TextSIException.h" namespace PPT { - struct SStyleTextProp9 { STextPFException9 m_pf9; @@ -44,38 +44,16 @@ struct SStyleTextProp9 STextSIException m_si; - void ReadFromStream(POLE::Stream* pStream) - { - m_pf9.ReadFromStream(pStream); - m_cf9.ReadFromStream(pStream); - m_si.ReadFromStream(pStream); - } + void ReadFromStream(POLE::Stream* pStream); }; class CRecordStyleTextProp9Atom : public CUnknownRecord { public: - virtual ~CRecordStyleTextProp9Atom() - { - } + virtual ~CRecordStyleTextProp9Atom(); - virtual void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) - { - m_oHeader = oHeader; - - LONG lCurPos; StreamUtils::StreamPosition(lCurPos, pStream); - LONG lEndPos = lCurPos + m_oHeader.RecLen; - - while(lCurPos < lEndPos) - { - SStyleTextProp9 rec; - rec.ReadFromStream(pStream); - m_rgStyleTextProp9.push_back(rec); - - StreamUtils::StreamPosition(lCurPos, pStream); - } - } + virtual void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; public: std::vector m_rgStyleTextProp9; diff --git a/MsBinaryFile/PptFile/Records/StyleTextPropAtom.cpp b/MsBinaryFile/PptFile/Records/StyleTextPropAtom.cpp index 633a1d2652..946d372c28 100644 --- a/MsBinaryFile/PptFile/Records/StyleTextPropAtom.cpp +++ b/MsBinaryFile/PptFile/Records/StyleTextPropAtom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "StyleTextPropAtom.h" +using namespace PPT; CRecordStyleTextPropAtom::CRecordStyleTextPropAtom() { diff --git a/MsBinaryFile/PptFile/Records/StyleTextPropAtom.h b/MsBinaryFile/PptFile/Records/StyleTextPropAtom.h index 99e82e738a..84b592664d 100644 --- a/MsBinaryFile/PptFile/Records/StyleTextPropAtom.h +++ b/MsBinaryFile/PptFile/Records/StyleTextPropAtom.h @@ -34,73 +34,25 @@ namespace PPT { - class CRecordStyleTextPropAtom : public CUnknownRecord - { - public: - // нужно еще хранить позицию в стриме, - // указатель на начало - LONG m_lOffsetInStream; +class CRecordStyleTextPropAtom : public CUnknownRecord +{ +public: + // нужно еще хранить позицию в стриме, + // указатель на начало + LONG m_lOffsetInStream; + + // просто данные. будут обновляться по мере прибытия + // Text.Bytes/Chars.Atom + _UINT32 m_lCount; - // просто данные. будут обновляться по мере прибытия - // Text.Bytes/Chars.Atom - _UINT32 m_lCount; + std::vector m_arrPFs; + std::vector m_arrCFs; + - std::vector m_arrPFs; - std::vector m_arrCFs; + CRecordStyleTextPropAtom(); + ~CRecordStyleTextPropAtom(); - CRecordStyleTextPropAtom() - { - m_lCount = 0; - m_lOffsetInStream = 0; - } + void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; - ~CRecordStyleTextPropAtom() - { - m_lCount = 0; - } - - void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - StreamUtils::StreamPosition(m_lOffsetInStream, pStream); - - _UINT32 lMemCount = 0; - _UINT32 lCountItems = 0; - - if (0 == m_lCount) - { - StreamUtils::StreamSeek(m_lOffsetInStream + m_oHeader.RecLen, pStream); - return; - } - - while (lMemCount < m_lCount + 1) - { - CTextPFRunRecord elm; - m_arrPFs.push_back(elm); - m_arrPFs[lCountItems].LoadFromStream(pStream); - lMemCount += m_arrPFs[lCountItems].m_lCount; - - ++lCountItems; - } - - lMemCount = 0; - lCountItems = 0; - while (lMemCount < m_lCount + 1) - { - CTextCFRunRecord elm; - m_arrCFs.push_back(elm); - - m_arrCFs[lCountItems].LoadFromStream(pStream); - lMemCount += m_arrCFs[lCountItems].m_lCount; - - ++lCountItems; - } - - // на всякий случай... - // здесь когда текст сначала другой (т.е. например - placeholder в мастере) - - // то у нас неправильно выставился m_lCount... - StreamUtils::StreamSeek(m_lOffsetInStream + m_oHeader.RecLen, pStream); - } - - }; +}; } diff --git a/MsBinaryFile/PptFile/Records/TextBookmarkAtom.cpp b/MsBinaryFile/PptFile/Records/TextBookmarkAtom.cpp index 264ed41c0e..da85b74fe1 100644 --- a/MsBinaryFile/PptFile/Records/TextBookmarkAtom.cpp +++ b/MsBinaryFile/PptFile/Records/TextBookmarkAtom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "TextBookmarkAtom.h" +using namespace PPT; CRecordTextBookmarkAtom::CRecordTextBookmarkAtom() { diff --git a/MsBinaryFile/PptFile/Records/TextBookmarkAtom.h b/MsBinaryFile/PptFile/Records/TextBookmarkAtom.h index ba1718e291..e35461504c 100644 --- a/MsBinaryFile/PptFile/Records/TextBookmarkAtom.h +++ b/MsBinaryFile/PptFile/Records/TextBookmarkAtom.h @@ -32,28 +32,19 @@ #pragma once #include "../Reader/Records.h" + namespace PPT { - class CRecordTextBookmarkAtom : public CUnknownRecord - { - UINT m_nBegin; - UINT m_nEnd; - UINT m_nBookmarkID; +class CRecordTextBookmarkAtom : public CUnknownRecord +{ + UINT m_nBegin; + UINT m_nEnd; + UINT m_nBookmarkID; - public: +public: + CRecordTextBookmarkAtom(); + ~CRecordTextBookmarkAtom(); - CRecordTextBookmarkAtom() - { - } - - ~CRecordTextBookmarkAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - return CUnknownRecord::ReadFromStream(oHeader, pStream); - } - - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/TextBytesAtom.cpp b/MsBinaryFile/PptFile/Records/TextBytesAtom.cpp index d05653e236..e141302e8d 100644 --- a/MsBinaryFile/PptFile/Records/TextBytesAtom.cpp +++ b/MsBinaryFile/PptFile/Records/TextBytesAtom.cpp @@ -1,36 +1,7 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "TextBytesAtom.h" +using namespace PPT; + CRecordTextBytesAtom::CRecordTextBytesAtom() { } diff --git a/MsBinaryFile/PptFile/Records/TextBytesAtom.h b/MsBinaryFile/PptFile/Records/TextBytesAtom.h index 2d012941fc..eb2c53dd04 100644 --- a/MsBinaryFile/PptFile/Records/TextBytesAtom.h +++ b/MsBinaryFile/PptFile/Records/TextBytesAtom.h @@ -30,55 +30,21 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordTextBytesAtom : public CUnknownRecord - { - public: - std::wstring m_strText; +class CRecordTextBytesAtom : public CUnknownRecord +{ +public: + std::wstring m_strText; - public: +public: + CRecordTextBytesAtom(); + ~CRecordTextBytesAtom(); - CRecordTextBytesAtom() - { - } - - ~CRecordTextBytesAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - //UTF-16 Unicode character whose high byte is 0x00. - unsigned short *pUTF16 = new unsigned short[m_oHeader.RecLen]; - unsigned char *pUTF16_low = new unsigned char[m_oHeader.RecLen]; - - if (pUTF16 && pUTF16_low) - { - pStream->read(pUTF16_low, m_oHeader.RecLen); - - for (UINT i = 0; i < m_oHeader.RecLen; i++) - { - pUTF16[i] = pUTF16_low[i]; - } - - m_strText = NSFile::CUtf8Converter::GetWStringFromUTF16(pUTF16, m_oHeader.RecLen); - - } - - RELEASEARRAYOBJECTS(pUTF16_low); - RELEASEARRAYOBJECTS(pUTF16); - - //std::string tmpStrTextA = StreamUtils::ReadCStringA(pStream, m_oHeader.RecLen); - - //std::wstring tmpStrTextW (tmpStrTextA.begin(), tmpStrTextA.end()); - - //m_strText = std_string2string(tmpStrTextW); - } - - }; + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; } diff --git a/MsBinaryFile/PptFile/Records/TextCFException10.cpp b/MsBinaryFile/PptFile/Records/TextCFException10.cpp index 51d88e9588..335fe2736f 100644 --- a/MsBinaryFile/PptFile/Records/TextCFException10.cpp +++ b/MsBinaryFile/PptFile/Records/TextCFException10.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "TextCFException10.h" +using namespace PPT; void STextCFException10::ReadFromStream(POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/TextCFException10.h b/MsBinaryFile/PptFile/Records/TextCFException10.h index 169bd275ae..d3cadf9456 100644 --- a/MsBinaryFile/PptFile/Records/TextCFException10.h +++ b/MsBinaryFile/PptFile/Records/TextCFException10.h @@ -41,16 +41,7 @@ struct STextCFException10 nullable m_csFontRef; nullable<_UINT32> m_pp11ext; - virtual void ReadFromStream(POLE::Stream* pStream) - { - m_masks.ReadFromStream(pStream); - if (m_masks.m_newEATypeface) - m_newEAFontRef = new USHORT(StreamUtils::ReadSHORT(pStream)); - if (m_masks.m_csTypeface) - m_newEAFontRef = new USHORT(StreamUtils::ReadSHORT(pStream)); - if (m_masks.m_pp11ext) - m_pp11ext = new _UINT32(StreamUtils::ReadDWORD(pStream)); - } + virtual void ReadFromStream(POLE::Stream* pStream); }; } diff --git a/MsBinaryFile/PptFile/Records/TextCFException9.cpp b/MsBinaryFile/PptFile/Records/TextCFException9.cpp index 4fa512a3d0..49721af61a 100644 --- a/MsBinaryFile/PptFile/Records/TextCFException9.cpp +++ b/MsBinaryFile/PptFile/Records/TextCFException9.cpp @@ -1,37 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ - #include "TextCFException9.h" +using namespace PPT; void STextCFException9::ReadFromStream(POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/TextCFException9.h b/MsBinaryFile/PptFile/Records/TextCFException9.h index 4536220ebc..4e9ccb5246 100644 --- a/MsBinaryFile/PptFile/Records/TextCFException9.h +++ b/MsBinaryFile/PptFile/Records/TextCFException9.h @@ -30,25 +30,19 @@ * */ #pragma once + #include "../Reader/Records.h" #include "CFMasks.h" namespace PPT { - struct STextCFException9 { SCFMasks m_masks; nullable_uint m_pp10runid; // 4 bits - void ReadFromStream(POLE::Stream* pStream) - { - m_masks.ReadFromStream(pStream); - - if (m_masks.m_pp10ext) - m_pp10runid = 0xF & StreamUtils::ReadDWORD(pStream); - } + void ReadFromStream(POLE::Stream* pStream); }; } diff --git a/MsBinaryFile/PptFile/Records/TextCFExceptionAtom.cpp b/MsBinaryFile/PptFile/Records/TextCFExceptionAtom.cpp index 8456b562a1..c5b57e0b04 100644 --- a/MsBinaryFile/PptFile/Records/TextCFExceptionAtom.cpp +++ b/MsBinaryFile/PptFile/Records/TextCFExceptionAtom.cpp @@ -1,37 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ - #include "TextCFExceptionAtom.h" +using namespace PPT; CRecordTextCFExceptionAtom::CRecordTextCFExceptionAtom() { diff --git a/MsBinaryFile/PptFile/Records/TextCFExceptionAtom.h b/MsBinaryFile/PptFile/Records/TextCFExceptionAtom.h index d42bceadea..450c07a9d1 100644 --- a/MsBinaryFile/PptFile/Records/TextCFExceptionAtom.h +++ b/MsBinaryFile/PptFile/Records/TextCFExceptionAtom.h @@ -30,35 +30,22 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordTextCFExceptionAtom : public CUnknownRecord - { - public: - CTextCFRunRecord m_oCFRun; +class CRecordTextCFExceptionAtom : public CUnknownRecord +{ +public: + CTextCFRunRecord m_oCFRun; + - CRecordTextCFExceptionAtom() - { - } + CRecordTextCFExceptionAtom(); + ~CRecordTextCFExceptionAtom(); - ~CRecordTextCFExceptionAtom() - { - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - LONG lPosition = 0; - StreamUtils::StreamPosition(lPosition, pStream); - - m_oCFRun.LoadFromStream(pStream, false); - - // это на всякий случай... - StreamUtils::StreamSeek(lPosition + m_oHeader.RecLen, pStream); - } - - }; -} \ No newline at end of file +}; +} diff --git a/MsBinaryFile/PptFile/Records/TextCharsAtom.cpp b/MsBinaryFile/PptFile/Records/TextCharsAtom.cpp index 873cee56f9..c334fd8426 100644 --- a/MsBinaryFile/PptFile/Records/TextCharsAtom.cpp +++ b/MsBinaryFile/PptFile/Records/TextCharsAtom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "TextCharsAtom.h" +using namespace PPT; CRecordTextCharsAtom::CRecordTextCharsAtom() { diff --git a/MsBinaryFile/PptFile/Records/TextCharsAtom.h b/MsBinaryFile/PptFile/Records/TextCharsAtom.h index 926ad476ab..3b117ca780 100644 --- a/MsBinaryFile/PptFile/Records/TextCharsAtom.h +++ b/MsBinaryFile/PptFile/Records/TextCharsAtom.h @@ -30,30 +30,21 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordTextCharsAtom : public CUnknownRecord - { - public: - std::wstring m_strText; +class CRecordTextCharsAtom : public CUnknownRecord +{ +public: + std::wstring m_strText; - public: +public: + CRecordTextCharsAtom(); + ~CRecordTextCharsAtom(); - CRecordTextCharsAtom() - { - } - - ~CRecordTextCharsAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - m_strText = StreamUtils::ReadStringW(pStream, m_oHeader.RecLen / 2); - } - - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/TextDefaults9Atom.cpp b/MsBinaryFile/PptFile/Records/TextDefaults9Atom.cpp index e8d5775987..940aaf107e 100644 --- a/MsBinaryFile/PptFile/Records/TextDefaults9Atom.cpp +++ b/MsBinaryFile/PptFile/Records/TextDefaults9Atom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "TextDefaults9Atom.h" +using namespace PPT; void CRecordTextDefaults9Atom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/TextDefaults9Atom.h b/MsBinaryFile/PptFile/Records/TextDefaults9Atom.h index b7579671ca..c343f6d57c 100644 --- a/MsBinaryFile/PptFile/Records/TextDefaults9Atom.h +++ b/MsBinaryFile/PptFile/Records/TextDefaults9Atom.h @@ -44,12 +44,6 @@ public: STextPFException9 m_pf9; - - virtual void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) - { - m_oHeader = oHeader; - m_cf9.ReadFromStream(pStream); - m_pf9.ReadFromStream(pStream); - } + virtual void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; }; } diff --git a/MsBinaryFile/PptFile/Records/TextFullSettings.cpp b/MsBinaryFile/PptFile/Records/TextFullSettings.cpp index a81a55451b..03f30fed89 100644 --- a/MsBinaryFile/PptFile/Records/TextFullSettings.cpp +++ b/MsBinaryFile/PptFile/Records/TextFullSettings.cpp @@ -1,65 +1,3 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "TextFullSettings.h" using namespace PPT; @@ -101,7 +39,7 @@ CTextFullSettings::~CTextFullSettings() m_pTextRuler = NULL; } -std::wstring CTextFullSettings::ApplyProperties(PPT::CTextAttributesEx *pTextAttributes) +std::wstring CTextFullSettings::ApplyProperties(CTextAttributesEx *pTextAttributes) { if (NULL == pTextAttributes) return m_strText; @@ -110,7 +48,7 @@ std::wstring CTextFullSettings::ApplyProperties(PPT::CTextAttributesEx *pTextAtt pTextAttributes->m_lStyleThemeIndex = m_lStyleThemeIndex; if (NULL != m_pTextStyleProp) - PPT::ConvertPPTTextToEditorStructure(m_pTextStyleProp->m_arrPFs, m_pTextStyleProp->m_arrCFs, m_strText, *pTextAttributes); + PPT_FORMAT::ConvertPPTTextToEditorStructure(m_pTextStyleProp->m_arrPFs, m_pTextStyleProp->m_arrCFs, m_strText, *pTextAttributes); if (NULL != m_pTextRuler) pTextAttributes->m_oRuler = m_pTextRuler->m_oTextRuler; diff --git a/MsBinaryFile/PptFile/Records/TextFullSettings.h b/MsBinaryFile/PptFile/Records/TextFullSettings.h index de4f1d4182..7c73707ff9 100644 --- a/MsBinaryFile/PptFile/Records/TextFullSettings.h +++ b/MsBinaryFile/PptFile/Records/TextFullSettings.h @@ -40,27 +40,28 @@ #include "../Drawing/Interactive.h" + namespace PPT { - class CTextFullSettings - { - public: - CRecordStyleTextPropAtom* m_pTextStyleProp; - CRecordTextSpecInfoAtom* m_pTextSpecInfo; - CRecordTextRulerAtom* m_pTextRuler; +class CTextFullSettings +{ +public: + CRecordStyleTextPropAtom* m_pTextStyleProp; + CRecordTextSpecInfoAtom* m_pTextSpecInfo; + CRecordTextRulerAtom* m_pTextRuler; - std::vector m_arRanges; + std::vector m_arRanges; - std::wstring m_strText; - _UINT32 m_nTextType; - _UINT32 m_lStyleThemeIndex; + std::wstring m_strText; + _UINT32 m_nTextType; + _UINT32 m_lStyleThemeIndex; - public: - CTextFullSettings(); - CTextFullSettings(const CTextFullSettings& oSrc); - CTextFullSettings& operator =(const CTextFullSettings& oSrc); - ~CTextFullSettings(); - - std::wstring ApplyProperties(CTextAttributesEx* pTextAttributes); - }; +public: + CTextFullSettings(); + CTextFullSettings(const CTextFullSettings& oSrc); + CTextFullSettings& operator =(const CTextFullSettings& oSrc); + ~CTextFullSettings(); + + std::wstring ApplyProperties(CTextAttributesEx* pTextAttributes); +}; } diff --git a/MsBinaryFile/PptFile/Records/TextHeaderAtom.cpp b/MsBinaryFile/PptFile/Records/TextHeaderAtom.cpp index f441d5c2c2..c3c704dd22 100644 --- a/MsBinaryFile/PptFile/Records/TextHeaderAtom.cpp +++ b/MsBinaryFile/PptFile/Records/TextHeaderAtom.cpp @@ -1,67 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "TextHeaderAtom.h" +using namespace PPT; CRecordTextHeaderAtom::CRecordTextHeaderAtom() { diff --git a/MsBinaryFile/PptFile/Records/TextHeaderAtom.h b/MsBinaryFile/PptFile/Records/TextHeaderAtom.h index 6f455d76c6..4f996d95d2 100644 --- a/MsBinaryFile/PptFile/Records/TextHeaderAtom.h +++ b/MsBinaryFile/PptFile/Records/TextHeaderAtom.h @@ -32,28 +32,19 @@ #pragma once #include "../Reader/Records.h" + namespace PPT { - class CRecordTextHeaderAtom : public CUnknownRecord - { - public: - UINT m_nTextType; +class CRecordTextHeaderAtom : public CUnknownRecord +{ +public: + UINT m_nTextType; - public: +public: + CRecordTextHeaderAtom(); + ~CRecordTextHeaderAtom(); - CRecordTextHeaderAtom() - { - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; - ~CRecordTextHeaderAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - m_nTextType = (UINT)StreamUtils::ReadDWORD(pStream); - } - - }; -} \ No newline at end of file +}; +} diff --git a/MsBinaryFile/PptFile/Records/TextInteractiveInfoAtom.cpp b/MsBinaryFile/PptFile/Records/TextInteractiveInfoAtom.cpp index 0dca00f982..fd325cb0ed 100644 --- a/MsBinaryFile/PptFile/Records/TextInteractiveInfoAtom.cpp +++ b/MsBinaryFile/PptFile/Records/TextInteractiveInfoAtom.cpp @@ -1,36 +1,7 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "TextInteractiveInfoAtom.h" +using namespace PPT; + CRecordTextInteractiveInfoAtom::CRecordTextInteractiveInfoAtom() { m_lStart = 0; diff --git a/MsBinaryFile/PptFile/Records/TextInteractiveInfoAtom.h b/MsBinaryFile/PptFile/Records/TextInteractiveInfoAtom.h index 80e1d1ace5..4e73050346 100644 --- a/MsBinaryFile/PptFile/Records/TextInteractiveInfoAtom.h +++ b/MsBinaryFile/PptFile/Records/TextInteractiveInfoAtom.h @@ -30,33 +30,21 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordTextInteractiveInfoAtom : public CUnknownRecord - { - public: - LONG m_lStart; - LONG m_lEnd; +class CRecordTextInteractiveInfoAtom : public CUnknownRecord +{ +public: + LONG m_lStart; + LONG m_lEnd; - CRecordTextInteractiveInfoAtom() - { - m_lStart = 0; - m_lEnd = 0; - } + CRecordTextInteractiveInfoAtom(); + ~CRecordTextInteractiveInfoAtom(); - ~CRecordTextInteractiveInfoAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_lStart = StreamUtils::ReadLONG(pStream); - m_lEnd = StreamUtils::ReadLONG(pStream); - } - - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/TextMasterStyle9Atom.cpp b/MsBinaryFile/PptFile/Records/TextMasterStyle9Atom.cpp index 181f0797fa..5318b8a437 100644 --- a/MsBinaryFile/PptFile/Records/TextMasterStyle9Atom.cpp +++ b/MsBinaryFile/PptFile/Records/TextMasterStyle9Atom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "TextMasterStyle9Atom.h" +using namespace PPT; void CRecordTextMasterStyle9Atom::ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/TextMasterStyle9Atom.h b/MsBinaryFile/PptFile/Records/TextMasterStyle9Atom.h index 783ccbe980..ddec9880a0 100644 --- a/MsBinaryFile/PptFile/Records/TextMasterStyle9Atom.h +++ b/MsBinaryFile/PptFile/Records/TextMasterStyle9Atom.h @@ -35,7 +35,6 @@ namespace PPT { - class CRecordTextMasterStyle9Atom : public CUnknownRecord { public: @@ -47,40 +46,7 @@ public: nullable m_lstLvl4; nullable m_lstLvl5; - void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override - { - m_oHeader = oHeader; - LONG lPos; StreamUtils::StreamPosition(lPos, pStream); - - m_cLevels = StreamUtils::ReadWORD(pStream); - if (m_cLevels > 0) - { - m_lstLvl1 = new STextMasterStyle9Level; - m_lstLvl1->ReadFromStream(pStream); - if (m_cLevels > 1) - { - m_lstLvl2 = new STextMasterStyle9Level; - m_lstLvl2->ReadFromStream(pStream); - if (m_cLevels > 2) - { - m_lstLvl3 = new STextMasterStyle9Level; - m_lstLvl3->ReadFromStream(pStream); - if (m_cLevels > 3) - { - m_lstLvl4 = new STextMasterStyle9Level; - m_lstLvl4->ReadFromStream(pStream); - if (m_cLevels > 4) - { - m_lstLvl5 = new STextMasterStyle9Level; - m_lstLvl5->ReadFromStream(pStream); - } - } - } - } - } - - StreamUtils::StreamSeek(lPos + m_oHeader.RecLen, pStream); - } + void ReadFromStream(SRecordHeader &oHeader, POLE::Stream *pStream) override; }; } diff --git a/MsBinaryFile/PptFile/Records/TextMasterStyle9Level.cpp b/MsBinaryFile/PptFile/Records/TextMasterStyle9Level.cpp index a027169562..4cf06d17ed 100644 --- a/MsBinaryFile/PptFile/Records/TextMasterStyle9Level.cpp +++ b/MsBinaryFile/PptFile/Records/TextMasterStyle9Level.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "TextMasterStyle9Level.h" +using namespace PPT; void STextMasterStyle9Level::ReadFromStream(POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/TextMasterStyle9Level.h b/MsBinaryFile/PptFile/Records/TextMasterStyle9Level.h index 3dcf7debbe..a2f27bbdf3 100644 --- a/MsBinaryFile/PptFile/Records/TextMasterStyle9Level.h +++ b/MsBinaryFile/PptFile/Records/TextMasterStyle9Level.h @@ -36,17 +36,12 @@ namespace PPT { - struct STextMasterStyle9Level { STextPFException9 m_pf9; STextCFException9 m_cf9; - void ReadFromStream(POLE::Stream* pStream) - { - m_pf9.ReadFromStream(pStream); - m_cf9.ReadFromStream(pStream); - } + void ReadFromStream(POLE::Stream* pStream); }; } diff --git a/MsBinaryFile/PptFile/Records/TextMasterStyleAtom.cpp b/MsBinaryFile/PptFile/Records/TextMasterStyleAtom.cpp index 77ba277ef3..070db66d05 100644 --- a/MsBinaryFile/PptFile/Records/TextMasterStyleAtom.cpp +++ b/MsBinaryFile/PptFile/Records/TextMasterStyleAtom.cpp @@ -1,36 +1,7 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "TextMasterStyleAtom.h" +using namespace PPT; + CRecordTextMasterStyleAtom::CRecordTextMasterStyleAtom() : PPT::CTextStyles() { m_nTextType = -1; diff --git a/MsBinaryFile/PptFile/Records/TextMasterStyleAtom.h b/MsBinaryFile/PptFile/Records/TextMasterStyleAtom.h index 94a8935ea0..8232007233 100644 --- a/MsBinaryFile/PptFile/Records/TextMasterStyleAtom.h +++ b/MsBinaryFile/PptFile/Records/TextMasterStyleAtom.h @@ -32,95 +32,21 @@ #pragma once #include "../Reader/Records.h" + namespace PPT { - class CRecordTextMasterStyleAtom : public CUnknownRecord, public PPT::CTextStyles - { - public: - LONG m_nTextType; +class CRecordTextMasterStyleAtom : public CUnknownRecord, public PPT::CTextStyles +{ +public: + LONG m_nTextType; + - CRecordTextMasterStyleAtom() : PPT::CTextStyles() - { - m_nTextType = -1; - } + CRecordTextMasterStyleAtom(); + ~CRecordTextMasterStyleAtom(); - ~CRecordTextMasterStyleAtom() - { - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - LONG lPosition = 0; - StreamUtils::StreamPosition(lPosition, pStream); - - m_nTextType = m_oHeader.RecInstance; - - bool bIsLevelsPresent = (0x05 <= m_oHeader.RecInstance); - - int lLevels = StreamUtils::ReadWORD(pStream); - if (0 < lLevels) - LoadLevel(0, pStream, bIsLevelsPresent); - if (1 < lLevels) - LoadLevel(1, pStream, bIsLevelsPresent); - if (2 < lLevels) - LoadLevel(2, pStream, bIsLevelsPresent); - if (3 < lLevels) - LoadLevel(3, pStream, bIsLevelsPresent); - if (4 < lLevels) - LoadLevel(4, pStream, bIsLevelsPresent); - - // походу нужно делать так: ---------------------------------------------- - if (m_pLevels[0].is_init()) - { - if (!m_pLevels[1].is_init()) - m_pLevels[1] = m_pLevels[0].get(); - else - m_pLevels[1]->ApplyBefore(m_pLevels[0].get()); - } - if (m_pLevels[1].is_init()) - { - if (!m_pLevels[2].is_init()) - m_pLevels[2] = m_pLevels[1].get(); - else - m_pLevels[2]->ApplyBefore(m_pLevels[1].get()); - } - if (m_pLevels[2].is_init()) - { - if (!m_pLevels[3].is_init()) - m_pLevels[3] = m_pLevels[2].get(); - else - m_pLevels[3]->ApplyBefore(m_pLevels[2].get()); - } - if (m_pLevels[3].is_init()) - { - if (!m_pLevels[4].is_init()) - m_pLevels[4] = m_pLevels[3].get(); - else - m_pLevels[4]->ApplyBefore(m_pLevels[3].get()); - } - // ----------------------------------------------------------------------- - - // это на всякий случай... - StreamUtils::StreamSeek(lPosition + m_oHeader.RecLen, pStream); - } - protected: - void LoadLevel(LONG lLevel, POLE::Stream* pStream, bool bIsLevelPresent) - { - LONG lLevelOld = lLevel; - - if (bIsLevelPresent) - lLevel = StreamUtils::ReadSHORT(pStream); - - CTextPFRunRecord oPF; - CTextCFRunRecord oCF; - oPF.LoadFromStream(pStream, false); - oCF.LoadFromStream(pStream, false); - - m_pLevels[lLevelOld] = new PPT::CTextStyleLevel(); - m_pLevels[lLevelOld]->m_oPFRun = oPF.m_oRun; - m_pLevels[lLevelOld]->m_oCFRun = oCF.m_oRun; - } - }; -} \ No newline at end of file +protected: + void LoadLevel(LONG lLevel, POLE::Stream* pStream, bool bIsLevelPresent); +}; +} diff --git a/MsBinaryFile/PptFile/Records/TextPFException9.cpp b/MsBinaryFile/PptFile/Records/TextPFException9.cpp index 0e57f3fda1..471bfe011e 100644 --- a/MsBinaryFile/PptFile/Records/TextPFException9.cpp +++ b/MsBinaryFile/PptFile/Records/TextPFException9.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "TextPFException9.h" +using namespace PPT; void STextAutoNumberScheme::ReadFromStream(POLE::Stream *pStream) { diff --git a/MsBinaryFile/PptFile/Records/TextPFException9.h b/MsBinaryFile/PptFile/Records/TextPFException9.h index 2b090a5392..c7c4705390 100644 --- a/MsBinaryFile/PptFile/Records/TextPFException9.h +++ b/MsBinaryFile/PptFile/Records/TextPFException9.h @@ -42,61 +42,9 @@ struct STextAutoNumberScheme SHORT m_nStartNum; - void ReadFromStream(POLE::Stream* pStream){ - m_eScheme = (TextAutoNumberSchemeEnum)StreamUtils::ReadSHORT(pStream); - m_nStartNum = StreamUtils::ReadSHORT(pStream); - } - - - std::wstring SchemeToStr()const - { - switch (m_eScheme) - { - case ANM_AlphaLcPeriod:{ return L"alphaLcPeriod"; break;} - case ANM_AlphaUcPeriod:{ return L"alphaUcPeriod"; break;} - case ANM_ArabicParenRight:{ return L"arabicParenR"; break;} - case ANM_ArabicPeriod:{ return L"arabicPeriod"; break;} - case ANM_RomanLcParenBoth:{ return L"romanLcParenBoth"; break;} - case ANM_RomanLcParenRight:{ return L"romanLcParenR"; break;} - case ANM_RomanLcPeriod:{ return L"romanLcPeriod"; break;} - case ANM_RomanUcPeriod:{ return L"romanUcPeriod"; break;} - case ANM_AlphaLcParenBoth:{ return L"alphaLcParenBoth"; break;} - case ANM_AlphaLcParenRight:{ return L"alphaLcParenR"; break;} - case ANM_AlphaUcParenBoth:{ return L"alphaUcParenBoth"; break;} - case ANM_AlphaUcParenRight:{ return L"alphaUcParenR"; break;} - case ANM_ArabicParenBoth:{ return L"arabicParenBoth"; break;} - case ANM_ArabicPlain:{ return L"arabicPlain"; break;} - case ANM_RomanUcParenBoth:{ return L"romanUcParenBoth"; break;} - case ANM_RomanUcParenRight:{ return L"romanUcParenR"; break;} - case ANM_ChsPlain:{ return L"ea1ChsPlain"; break;} - case ANM_ChsPeriod:{ return L"ea1ChsPeriod"; break;} - case ANM_CircleNumDBPlain:{ return L"circleNumDbPlain"; break;} - case ANM_CircleNumWDBWhitePlain:{ return L"circleNumWdWhitePlain"; break;} - case ANM_CircleNumWDBBlackPlain:{ return L"circleNumWdBlackPlain"; break;} - case ANM_ChtPlain:{ return L"ea1ChtPlain"; break;} - case ANM_ChtPeriod:{ return L"ea1ChtPeriod"; break;} - case ANM_Arabic1Minus:{ return L"arabic1Minus"; break;} - case ANM_Arabic2Minus:{ return L"arabic2Minus"; break;} - case ANM_Hebrew2Minus:{ return L"hebrew2Minus"; break;} - case ANM_JpnKorPlain:{ return L"ea1JpnKorPlain"; break;} - case ANM_JpnKorPeriod:{ return L"ea1JpnKorPeriod"; break;} - case ANM_ArabicDbPlain:{ return L"arabicDbPlain"; break;} - case ANM_ArabicDbPeriod:{ return L"arabicDbPeriod"; break;} - case ANM_ThaiAlphaPeriod:{ return L"thaiAlphaPeriod"; break;} - case ANM_ThaiAlphaParenRight:{ return L"thaiAlphaParenR"; break;} - case ANM_ThaiAlphaParenBoth:{ return L"thaiAlphaParenBoth"; break;} - case ANM_ThaiNumPeriod:{ return L"thaiNumPeriod"; break;} - case ANM_ThaiNumParenRight:{ return L"thaiNumParenR"; break;} - case ANM_ThaiNumParenBoth:{ return L"thaiNumParenBoth"; break;} - case ANM_HindiAlphaPeriod:{ return L"hindiAlphaPeriod"; break;} - case ANM_HindiNumPeriod:{ return L"hindiNumPeriod"; break;} - case ANM_JpnChsDBPeriod:{ return L"ea1JpnChsDbPeriod"; break;} - case ANM_HindiNumParenRight:{ return L"hindiNumParenR"; break;} - case ANM_HindiAlpha1Period:{ return L"hindiAlpha1Period"; break;} - } - return L"alphaUcPeriod"; - } + void ReadFromStream(POLE::Stream* pStream); + std::wstring SchemeToStr()const; }; @@ -110,30 +58,6 @@ struct STextPFException9 nullable m_optBulletAutoNumberScheme; - void ReadFromStream(POLE::Stream* pStream) - { - m_masks.ReadFromStream(pStream); - - if (m_masks.m_bulletBlip) // 0x0800000 2^23 - m_optBulletBlipRef = StreamUtils::ReadSHORT(pStream); - - if (m_masks.m_bulletHasScheme) // 0x2000000 2^25 - m_optfBulletHasAutoNumber = (bool)StreamUtils::ReadSHORT(pStream); - - if(m_masks.m_bulletScheme) // 0x1000000 2^24 - { - auto pBulletAutoNumberScheme = new STextAutoNumberScheme; - pBulletAutoNumberScheme->ReadFromStream(pStream); - m_optBulletAutoNumberScheme = pBulletAutoNumberScheme; - } - else if (m_optfBulletHasAutoNumber.get_value_or(false)) - { - auto pBulletAutoNumberScheme = new STextAutoNumberScheme; - pBulletAutoNumberScheme->m_nStartNum = 1; - pBulletAutoNumberScheme->m_eScheme = ANM_ArabicPeriod; - m_optBulletAutoNumberScheme = pBulletAutoNumberScheme; - } - - } + void ReadFromStream(POLE::Stream* pStream); }; } diff --git a/MsBinaryFile/PptFile/Records/TextPFExceptionAtom.cpp b/MsBinaryFile/PptFile/Records/TextPFExceptionAtom.cpp index 8812b9592d..aa44f0b263 100644 --- a/MsBinaryFile/PptFile/Records/TextPFExceptionAtom.cpp +++ b/MsBinaryFile/PptFile/Records/TextPFExceptionAtom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "TextPFExceptionAtom.h" +using namespace PPT; CRecordTextPFExceptionAtom::CRecordTextPFExceptionAtom() { diff --git a/MsBinaryFile/PptFile/Records/TextPFExceptionAtom.h b/MsBinaryFile/PptFile/Records/TextPFExceptionAtom.h index a0f411cd7a..efa55f3221 100644 --- a/MsBinaryFile/PptFile/Records/TextPFExceptionAtom.h +++ b/MsBinaryFile/PptFile/Records/TextPFExceptionAtom.h @@ -30,36 +30,21 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordTextPFExceptionAtom : public CUnknownRecord - { - public: - CTextPFRunRecord m_oPFRun; +class CRecordTextPFExceptionAtom : public CUnknownRecord +{ +public: + CTextPFRunRecord m_oPFRun; + - CRecordTextPFExceptionAtom() - { - } + CRecordTextPFExceptionAtom(); + ~CRecordTextPFExceptionAtom(); - ~CRecordTextPFExceptionAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - LONG lPosition = 0; - StreamUtils::StreamPosition(lPosition, pStream); - - m_oPFRun.LoadFromStream(pStream, m_oHeader.RecLen == 12); - - // это на всякий случай... - POLE::uint64 current_pos = pStream->tell(); - StreamUtils::StreamSeek(lPosition + m_oHeader.RecLen, pStream); - } - - }; + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; } diff --git a/MsBinaryFile/PptFile/Records/TextRulerAtom.cpp b/MsBinaryFile/PptFile/Records/TextRulerAtom.cpp index 046ad7c3bd..20355345cb 100644 --- a/MsBinaryFile/PptFile/Records/TextRulerAtom.cpp +++ b/MsBinaryFile/PptFile/Records/TextRulerAtom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "TextRulerAtom.h" -#include "../../../OOXML/SystemUtility/File.h" + +using namespace PPT; CRecordTextRulerAtom::CRecordTextRulerAtom() { diff --git a/MsBinaryFile/PptFile/Records/TextRulerAtom.h b/MsBinaryFile/PptFile/Records/TextRulerAtom.h index 7d63543f8b..8a3b6bc66d 100644 --- a/MsBinaryFile/PptFile/Records/TextRulerAtom.h +++ b/MsBinaryFile/PptFile/Records/TextRulerAtom.h @@ -30,36 +30,22 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordTextRulerAtom : public CUnknownRecord - { - public: - PPT::CTextRuler m_oTextRuler; +class CRecordTextRulerAtom : public CUnknownRecord +{ +public: + PPT::CTextRuler m_oTextRuler; - public: +public: + CRecordTextRulerAtom(); + ~CRecordTextRulerAtom(); - CRecordTextRulerAtom() - { - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; - ~CRecordTextRulerAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - LONG lOffset = 0; - StreamUtils::StreamPosition(lOffset, pStream); - - NSStreamReader::Read(pStream, m_oTextRuler); - - // на всякий случай... - StreamUtils::StreamSeek(lOffset + m_oHeader.RecLen, pStream); - } - - }; -} \ No newline at end of file +}; +} diff --git a/MsBinaryFile/PptFile/Records/TextSIException.cpp b/MsBinaryFile/PptFile/Records/TextSIException.cpp index c364d54ad2..f11d1f49fa 100644 --- a/MsBinaryFile/PptFile/Records/TextSIException.cpp +++ b/MsBinaryFile/PptFile/Records/TextSIException.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "TextSIException.h" -#include "../../../OOXML/SystemUtility/File.h" + +using namespace PPT; SSmartTags::SSmartTags(){} diff --git a/MsBinaryFile/PptFile/Records/TextSIException.h b/MsBinaryFile/PptFile/Records/TextSIException.h index dd39fc4fb9..8d885c9890 100644 --- a/MsBinaryFile/PptFile/Records/TextSIException.h +++ b/MsBinaryFile/PptFile/Records/TextSIException.h @@ -34,97 +34,43 @@ namespace PPT { - struct SSmartTags - { - SSmartTags() {} - SSmartTags(const SSmartTags& other) - { - m_count = other.m_count; - m_rgSmartTagIndex = other.m_rgSmartTagIndex; - } - ~SSmartTags() {} - _UINT32 m_count; - std::vector<_UINT32> m_rgSmartTagIndex; - - void ReadFromStream(POLE::Stream* pStream) - { - m_count = StreamUtils::ReadDWORD(pStream); - for (_UINT32 i = 0; i < m_count; i++) - { - _UINT32 SmartTagIndex = StreamUtils::ReadDWORD(pStream); - m_rgSmartTagIndex.push_back(SmartTagIndex); - } - } - }; +struct SSmartTags +{ + SSmartTags(); + SSmartTags(const SSmartTags& other); + ~SSmartTags(){} + _UINT32 m_count; + std::vector<_UINT32> m_rgSmartTagIndex; - struct STextSIException - { - STextSIException() - { - - } - ~STextSIException() - { - - } - bool m_spell; - bool m_lang; - bool m_altLang; - - bool m_fPp10ext; - bool m_fBidi; - - bool m_smartTag; - - nullable m_spellInfo; - nullable m_lid; - nullable m_altLid; - nullable m_bidi; - - nullable_uint m_pp10runid; // 4 bits - nullable_bool m_grammarError; - - // nullable m_smartTags; - - void ReadFromStream(POLE::Stream* pStream) - { - _UINT16 flags = StreamUtils::ReadWORD(pStream); - StreamUtils::StreamSkip(2, pStream); - - m_spell = 0x1 & flags; - m_lang = 0x2 & flags; - m_altLang = 0x4 & flags; + void ReadFromStream(POLE::Stream* pStream); +}; - m_fPp10ext = 0x20 & flags; - m_fBidi = 0x40 & flags; +struct STextSIException +{ + STextSIException(); + ~STextSIException(); + bool m_spell; + bool m_lang; + bool m_altLang; + + bool m_fPp10ext; + bool m_fBidi; + + bool m_smartTag; + + nullable m_spellInfo; + nullable m_lid; + nullable m_altLid; + nullable m_bidi; + + nullable_uint m_pp10runid; // 4 bits + nullable_bool m_grammarError; + +// nullable m_smartTags; - m_smartTag = 0x200 & flags; - - if (m_spell) - m_spellInfo = StreamUtils::ReadWORD(pStream); - if (m_lang) - m_altLang = StreamUtils::ReadWORD(pStream); - if (m_altLang) - m_altLid = StreamUtils::ReadWORD(pStream); - if (m_fBidi) - m_bidi = StreamUtils::ReadWORD(pStream); - - if (m_fPp10ext) - { - m_pp10runid = 0x0F & StreamUtils::ReadBYTE(pStream); - StreamUtils::StreamSkip(2, pStream); - m_grammarError = 0x80 & StreamUtils::ReadBYTE(pStream); - } - - if (m_smartTag) - { - StreamUtils::StreamSkip(StreamUtils::ReadDWORD(pStream) * 4, pStream); - // m_smartTags = new SSmartTags; - // m_smartTags->ReadFromStream(pStream); - } - } - }; + void ReadFromStream(POLE::Stream* pStream); +}; } diff --git a/MsBinaryFile/PptFile/Records/TextSIExceptionAtom.cpp b/MsBinaryFile/PptFile/Records/TextSIExceptionAtom.cpp index 7ee7d8289f..e7064d1dff 100644 --- a/MsBinaryFile/PptFile/Records/TextSIExceptionAtom.cpp +++ b/MsBinaryFile/PptFile/Records/TextSIExceptionAtom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "TextSIExceptionAtom.h" +using namespace PPT; CRecordTextSIExceptionAtom::CRecordTextSIExceptionAtom() { diff --git a/MsBinaryFile/PptFile/Records/TextSIExceptionAtom.h b/MsBinaryFile/PptFile/Records/TextSIExceptionAtom.h index a981e0585b..64070a89ef 100644 --- a/MsBinaryFile/PptFile/Records/TextSIExceptionAtom.h +++ b/MsBinaryFile/PptFile/Records/TextSIExceptionAtom.h @@ -30,35 +30,21 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordTextSIExceptionAtom : public CUnknownRecord - { - public: - CTextSIRun m_oSIRun; +class CRecordTextSIExceptionAtom : public CUnknownRecord +{ +public: + CTextSIRun m_oSIRun; + - CRecordTextSIExceptionAtom() - { - } + CRecordTextSIExceptionAtom(); + ~CRecordTextSIExceptionAtom(); - ~CRecordTextSIExceptionAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - LONG lPosition = 0; - StreamUtils::StreamPosition(lPosition, pStream); - - NSStreamReader::Read(pStream, m_oSIRun, false); - - // это на всякий случай... - StreamUtils::StreamSeek(lPosition + m_oHeader.RecLen, pStream); - } - - }; -} \ No newline at end of file + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Records/TextSpecInfoAtom.cpp b/MsBinaryFile/PptFile/Records/TextSpecInfoAtom.cpp index d302e78914..f6051a0b3c 100644 --- a/MsBinaryFile/PptFile/Records/TextSpecInfoAtom.cpp +++ b/MsBinaryFile/PptFile/Records/TextSpecInfoAtom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "TextSpecInfoAtom.h" +using namespace PPT; CRecordTextSpecInfoAtom::CRecordTextSpecInfoAtom() { @@ -69,7 +39,7 @@ void CRecordTextSpecInfoAtom::ReadFromStream(SRecordHeader &oHeader, POLE::Strea StreamUtils::StreamSeek(m_lOffsetInStream + m_oHeader.RecLen, pStream); } -void CRecordTextSpecInfoAtom::ApplyProperties(PPT::CTextAttributesEx *pText) +void CRecordTextSpecInfoAtom::ApplyProperties(CTextAttributesEx *pText) { if (m_arrSIs.size() < 1) return; diff --git a/MsBinaryFile/PptFile/Records/TextSpecInfoAtom.h b/MsBinaryFile/PptFile/Records/TextSpecInfoAtom.h index b3cda943d5..1501104f2a 100644 --- a/MsBinaryFile/PptFile/Records/TextSpecInfoAtom.h +++ b/MsBinaryFile/PptFile/Records/TextSpecInfoAtom.h @@ -30,84 +30,28 @@ * */ #pragma once + #include "../Reader/Records.h" + namespace PPT { - class CRecordTextSpecInfoAtom : public CUnknownRecord - { - public: - // нужно еще хранить позицию в стриме, - // указатель на начало - LONG m_lOffsetInStream; - _UINT32 m_lCount; +class CRecordTextSpecInfoAtom : public CUnknownRecord +{ +public: + // нужно еще хранить позицию в стриме, + // указатель на начало + LONG m_lOffsetInStream; + _UINT32 m_lCount; - std::vector m_arrSIs; + std::vector m_arrSIs; + + CRecordTextSpecInfoAtom(); + ~CRecordTextSpecInfoAtom(); - CRecordTextSpecInfoAtom() - { - m_lCount = 0; - m_lOffsetInStream = 0; - } + void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; - ~CRecordTextSpecInfoAtom() - { - m_lCount = 0; - } - - void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - StreamUtils::StreamPosition(m_lOffsetInStream, pStream); - - _UINT32 lMemCount = 0; - while (true) - { - PPT::CTextSIRun elm; - m_arrSIs.push_back(elm); - - NSStreamReader::Read(pStream, m_arrSIs.back()); - lMemCount += m_arrSIs.back().lCount; - - long sz = (long)(pStream->tell() - m_lOffsetInStream); - - if (sz >= (long)m_oHeader.RecLen) - break; - } - - // на всякий случай... - // здесь когда текст сначала другой (т.е. например - placeholder в мастере) - - // то у нас неправильно выставился m_lCount... на число m_lCount пилюем .. берем структур si скока прописано - StreamUtils::StreamSeek(m_lOffsetInStream + m_oHeader.RecLen, pStream); - } - - void ApplyProperties(CTextAttributesEx* pText) - { - if (m_arrSIs.size() < 1) return; - - int pos_text = 0, pos_si = 0; - size_t ind = 0; - - for (size_t i = 0; i < pText->m_arParagraphs.size(); i++) - { - if (ind >= m_arrSIs.size()) break; - - for (size_t j = 0; j < pText->m_arParagraphs[i].m_arSpans.size(); j++) - { - if (pos_text + pText->m_arParagraphs[i].m_arSpans[j].m_strText.length() > pos_si + m_arrSIs[ind].lCount) - { - pos_si += m_arrSIs[ind].lCount; - ind++; - } - if (ind >= m_arrSIs.size()) break; - if (m_arrSIs[ind].bLang) - pText->m_arParagraphs[i].m_arSpans[j].m_oRun.Language = m_arrSIs[ind].Lang; - pos_text += pText->m_arParagraphs[i].m_arSpans[j].m_strText.length(); - } - - } - } - - }; + void ApplyProperties(CTextAttributesEx* pText); +}; } diff --git a/MsBinaryFile/PptFile/Records/UserEditAtom.cpp b/MsBinaryFile/PptFile/Records/UserEditAtom.cpp index 38c00b9c16..dc97a27bc5 100644 --- a/MsBinaryFile/PptFile/Records/UserEditAtom.cpp +++ b/MsBinaryFile/PptFile/Records/UserEditAtom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "UserEditAtom.h" +using namespace PPT; CRecordUserEditAtom::CRecordUserEditAtom() { diff --git a/MsBinaryFile/PptFile/Records/UserEditAtom.h b/MsBinaryFile/PptFile/Records/UserEditAtom.h index 01feebed3f..cd501081ee 100644 --- a/MsBinaryFile/PptFile/Records/UserEditAtom.h +++ b/MsBinaryFile/PptFile/Records/UserEditAtom.h @@ -32,78 +32,36 @@ #pragma once #include "../Reader/Records.h" + namespace PPT { - class CRecordUserEditAtom : public CUnknownRecord - { - public: - _UINT32 m_nLastSlideIdRef; +class CRecordUserEditAtom : public CUnknownRecord +{ +public: + _UINT32 m_nLastSlideIdRef; - USHORT m_nVersion; // must be 0x0000 - BYTE m_nMinorVersion; // must be 0x00 - BYTE m_nMajorVersion; // must be 0x03 + USHORT m_nVersion; // must be 0x0000 + BYTE m_nMinorVersion; // must be 0x00 + BYTE m_nMajorVersion; // must be 0x03 - _UINT32 m_nOffsetLastEdit; // offset to prev UserEditAtom (0 - if no) + _UINT32 m_nOffsetLastEdit; // offset to prev UserEditAtom (0 - if no) - _UINT32 m_nOffsetPersistDirectory; // offset to PersistDirectoryAtom in PPTDocStream (for this user) + _UINT32 m_nOffsetPersistDirectory; // offset to PersistDirectoryAtom in PPTDocStream (for this user) - _UINT32 m_nOffsetDocPersistIdRef; // offset to PersistObjectDirectory in DocContainer must be 0x00000001 + _UINT32 m_nOffsetDocPersistIdRef; // offset to PersistObjectDirectory in DocContainer must be 0x00000001 - _UINT32 m_nPersistIdSeed; // for next + _UINT32 m_nPersistIdSeed; // for next - _UINT32 m_nEncryptSessionPersistIdRef; + _UINT32 m_nEncryptSessionPersistIdRef; - USHORT m_nLastView; + USHORT m_nLastView; - CRecordUserEditAtom() - { - m_nEncryptSessionPersistIdRef = 0; - } - ~CRecordUserEditAtom() - { - } + CRecordUserEditAtom(); + ~CRecordUserEditAtom(); - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; - m_nLastSlideIdRef = StreamUtils::ReadDWORD(pStream); - - m_nVersion = StreamUtils::ReadWORD(pStream); - m_nMinorVersion = StreamUtils::ReadBYTE(pStream); - m_nMajorVersion = StreamUtils::ReadBYTE(pStream); - - m_nOffsetLastEdit = StreamUtils::ReadDWORD(pStream); - m_nOffsetPersistDirectory = StreamUtils::ReadDWORD(pStream); - m_nOffsetDocPersistIdRef = StreamUtils::ReadDWORD(pStream); - - m_nPersistIdSeed = StreamUtils::ReadDWORD(pStream); - m_nLastView = StreamUtils::ReadWORD(pStream); - - StreamUtils::StreamSkip(2, pStream); - - if (m_oHeader.RecLen > 28) - { - m_nEncryptSessionPersistIdRef = StreamUtils::ReadDWORD(pStream); - } - } - - CRecordUserEditAtom& operator =(const CRecordUserEditAtom& oSrc) - { - m_nLastSlideIdRef = oSrc.m_nLastSlideIdRef; - - m_nVersion = oSrc.m_nVersion; - m_nMinorVersion = oSrc.m_nMinorVersion; - m_nMajorVersion = oSrc.m_nMajorVersion; - - m_nOffsetLastEdit = oSrc.m_nOffsetLastEdit; - m_nOffsetPersistDirectory = oSrc.m_nOffsetPersistDirectory; - m_nOffsetDocPersistIdRef = oSrc.m_nOffsetDocPersistIdRef; - m_nPersistIdSeed = oSrc.m_nPersistIdSeed; - m_nLastView = oSrc.m_nLastView; - m_nEncryptSessionPersistIdRef = oSrc.m_nEncryptSessionPersistIdRef; - return (*this); - } - }; -} \ No newline at end of file + CRecordUserEditAtom& operator =(const CRecordUserEditAtom& oSrc); +}; +} diff --git a/MsBinaryFile/PptFile/Records/VBAInfoAtom.cpp b/MsBinaryFile/PptFile/Records/VBAInfoAtom.cpp index 4af8644fc7..63ad353e9f 100644 --- a/MsBinaryFile/PptFile/Records/VBAInfoAtom.cpp +++ b/MsBinaryFile/PptFile/Records/VBAInfoAtom.cpp @@ -1,37 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ - #include "VBAInfoAtom.h" +using namespace PPT; CRecordVBAInfoAtom::CRecordVBAInfoAtom() { diff --git a/MsBinaryFile/PptFile/Records/VBAInfoAtom.h b/MsBinaryFile/PptFile/Records/VBAInfoAtom.h index 069904904e..d3764194f5 100644 --- a/MsBinaryFile/PptFile/Records/VBAInfoAtom.h +++ b/MsBinaryFile/PptFile/Records/VBAInfoAtom.h @@ -34,102 +34,40 @@ namespace PPT { - class CRecordVBAInfoAtom : public CUnknownRecord - { - public: +class CRecordVBAInfoAtom : public CUnknownRecord +{ +public: - UINT m_nObjStgDataRef; - UINT m_nHasMacros; - UINT m_nVersion; + UINT m_nObjStgDataRef; + UINT m_nHasMacros; + UINT m_nVersion; + - CRecordVBAInfoAtom() - { - } + CRecordVBAInfoAtom(); + ~CRecordVBAInfoAtom(); - ~CRecordVBAInfoAtom() - { - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; +class CRecordVBAInfoContainer : public CRecordsContainer +{ +public: + CRecordVBAInfoContainer(); + ~CRecordVBAInfoContainer(); - m_nObjStgDataRef = StreamUtils::ReadDWORD(pStream); - m_nHasMacros = StreamUtils::ReadDWORD(pStream); - m_nVersion = StreamUtils::ReadDWORD(pStream); - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream); +}; - }; +class CRecordVbaProjectStg : public CUnknownRecord +{ +public: + std::wstring m_sFileName; + std::wstring m_strTmpDirectory; + - class CRecordVBAInfoContainer : public CRecordsContainer - { - public: - CRecordVBAInfoContainer() - {} - ~CRecordVBAInfoContainer() - {} - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - CRecordsContainer::ReadFromStream(oHeader, pStream); - } - }; + CRecordVbaProjectStg(std::wstring strTemp); + ~CRecordVbaProjectStg(); - class CRecordVbaProjectStg : public CUnknownRecord - { - public: - std::wstring m_sFileName; - std::wstring m_strTmpDirectory; - - CRecordVbaProjectStg(std::wstring strTemp) : m_strTmpDirectory(strTemp) - { - } - - ~CRecordVbaProjectStg() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - ULONG decompressedSize = m_oHeader.RecLen, compressedSize = m_oHeader.RecLen; - - BYTE* pData = new BYTE[compressedSize]; - if (!pData) return; - - if (m_oHeader.RecInstance == 0x01) - { - decompressedSize = StreamUtils::ReadDWORD(pStream) + 64; - compressedSize -= 4; - } - pStream->read(pData, compressedSize); - - //if (pDecryptor) - //{ - // pDecryptor->Decrypt((char*)pData, compressedSize, 0); - //} - - if (m_oHeader.RecInstance == 0x01) - { - BYTE* pDataUncompress = new BYTE[decompressedSize]; - NSZip::Decompress(pData, compressedSize, pDataUncompress, decompressedSize); - - delete[]pData; - pData = pDataUncompress; - } - - m_sFileName = m_strTmpDirectory + FILE_SEPARATOR_STR + L"vbaProject.bin"; - - NSFile::CFileBinary file; - if (file.CreateFileW(m_sFileName)) - { - file.WriteFile(pData, decompressedSize); - file.CloseFile(); - } - delete[] pData; - pData = NULL; - } - - }; + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; } diff --git a/MsBinaryFile/PptFile/Records/ViewInfoAtom.cpp b/MsBinaryFile/PptFile/Records/ViewInfoAtom.cpp index 3c8d517f55..e42eeb99fb 100644 --- a/MsBinaryFile/PptFile/Records/ViewInfoAtom.cpp +++ b/MsBinaryFile/PptFile/Records/ViewInfoAtom.cpp @@ -1,36 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "ViewInfoAtom.h" +using namespace PPT; CRecordViewInfoAtom::CRecordViewInfoAtom() { diff --git a/MsBinaryFile/PptFile/Records/ViewInfoAtom.h b/MsBinaryFile/PptFile/Records/ViewInfoAtom.h index c92663e16a..c76bd7fbaf 100644 --- a/MsBinaryFile/PptFile/Records/ViewInfoAtom.h +++ b/MsBinaryFile/PptFile/Records/ViewInfoAtom.h @@ -34,41 +34,21 @@ namespace PPT { - class CRecordViewInfoAtom : public CUnknownRecord - { - SScalingAtom m_oCurScale; - SScalingAtom m_oPrevScale; - ODRAW::SPointAtom m_oViewSize; - ODRAW::SPointAtom m_oOrigin; +class CRecordViewInfoAtom : public CUnknownRecord +{ + SScalingAtom m_oCurScale; + SScalingAtom m_oPrevScale; + ODRAW::SPointAtom m_oViewSize; + ODRAW::SPointAtom m_oOrigin; - BOOL1 m_bZoomToFit; - BOOL1 m_bDraftMode; + BOOL1 m_bZoomToFit; + BOOL1 m_bDraftMode; - public: +public: + CRecordViewInfoAtom(); + ~CRecordViewInfoAtom(); - CRecordViewInfoAtom() - { - } + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; - ~CRecordViewInfoAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_oCurScale.FromStream(pStream); - m_oPrevScale.FromStream(pStream); - NSStreamReader::Read(pStream, m_oViewSize); - NSStreamReader::Read(pStream, m_oOrigin); - - m_bZoomToFit = StreamUtils::ReadBYTE(pStream); - m_bDraftMode = StreamUtils::ReadBYTE(pStream); - - // 2 байта зарезервированы... - StreamUtils::StreamSkip(2, pStream); - } - - }; -} \ No newline at end of file +}; +} diff --git a/MsBinaryFile/PptFile/Records/ZoomViewInfoAtom.cpp b/MsBinaryFile/PptFile/Records/ZoomViewInfoAtom.cpp index f0b0774bb0..2048a54c33 100644 --- a/MsBinaryFile/PptFile/Records/ZoomViewInfoAtom.cpp +++ b/MsBinaryFile/PptFile/Records/ZoomViewInfoAtom.cpp @@ -1,67 +1,6 @@ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ -/* -* (c) Copyright Ascensio System SIA 2010-2019 -* -* This program is a free software product. You can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License (AGPL) -* version 3 as published by the Free Software Foundation. In accordance with -* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect -* that Ascensio System SIA expressly excludes the warranty of non-infringement -* of any third-party rights. -* -* This program is distributed WITHOUT ANY WARRANTY; without even the implied -* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For -* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html -* -* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha -* street, Riga, Latvia, EU, LV-1050. -* -* The interactive user interfaces in modified source and object code versions -* of the Program must display Appropriate Legal Notices, as required under -* Section 5 of the GNU AGPL version 3. -* -* Pursuant to Section 7(b) of the License you must retain the original Product -* logo when distributing the program. Pursuant to Section 7(e) we decline to -* grant you any rights under trademark law for use of our trademarks. -* -* All the Product's GUI elements, including illustrations and icon sets, as -* well as technical writing content are licensed under the terms of the -* Creative Commons Attribution-ShareAlike 4.0 International. See the License -* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode -* -*/ #include "ZoomViewInfoAtom.h" -#include "../../../OOXML/SystemUtility/File.h" + +using namespace PPT; CRecordZoomViewInfoAtom::CRecordZoomViewInfoAtom() { diff --git a/MsBinaryFile/PptFile/Records/ZoomViewInfoAtom.h b/MsBinaryFile/PptFile/Records/ZoomViewInfoAtom.h index 0f9784f912..93aeee8f71 100644 --- a/MsBinaryFile/PptFile/Records/ZoomViewInfoAtom.h +++ b/MsBinaryFile/PptFile/Records/ZoomViewInfoAtom.h @@ -37,37 +37,19 @@ namespace PPT { - class CRecordZoomViewInfoAtom : public CUnknownRecord - { - public: - ScalingStruct m_oCurScale; - PointStruct m_oOrigin; +class CRecordZoomViewInfoAtom : public CUnknownRecord +{ +public: + ScalingStruct m_oCurScale; + PointStruct m_oOrigin; - BOOL1 m_fUseVarScale; - BOOL1 m_fDraftMode; + BOOL1 m_fUseVarScale; + BOOL1 m_fDraftMode; + - CRecordZoomViewInfoAtom() - { - } + CRecordZoomViewInfoAtom(); + ~CRecordZoomViewInfoAtom(); - ~CRecordZoomViewInfoAtom() - { - } - - virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) - { - m_oHeader = oHeader; - - m_oCurScale.ReadFromStream(pStream); - - StreamUtils::StreamSkip(24, pStream); - - m_oOrigin.ReadFromStream(pStream); - - m_fUseVarScale = StreamUtils::ReadBYTE(pStream); - m_fDraftMode = StreamUtils::ReadBYTE(pStream); - - StreamUtils::StreamSkip(2, pStream); - } - }; + virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) override; +}; } diff --git a/MsBinaryFile/PptFile/Structures/ColorIndex.h b/MsBinaryFile/PptFile/Structures/ColorIndex.h index 82cadbc9d1..9a0d2bcc14 100644 --- a/MsBinaryFile/PptFile/Structures/ColorIndex.h +++ b/MsBinaryFile/PptFile/Structures/ColorIndex.h @@ -34,27 +34,18 @@ #include "IStruct.h" + namespace PPT { -struct ColorIndex : public IStruct { - +struct ColorIndex : public IStruct +{ BYTE m_red; BYTE m_green; BYTE m_blue; BYTE m_index; - void clear() - { - m_red = m_green = m_blue = 0; - m_index = 0xFF; // Color is undefined. - } - void ReadFromStream(POLE::Stream * pStream) - { - m_red = StreamUtils::ReadBYTE(pStream); - m_green = StreamUtils::ReadBYTE(pStream); - m_blue = StreamUtils::ReadBYTE(pStream); - m_index = StreamUtils::ReadBYTE(pStream); - } + void clear(); + void ReadFromStream(POLE::Stream *pStream) override; }; } diff --git a/MsBinaryFile/PptFile/Structures/ColorIndexStruct.h b/MsBinaryFile/PptFile/Structures/ColorIndexStruct.h index 9cef4ab6a3..c7c60a3621 100644 --- a/MsBinaryFile/PptFile/Structures/ColorIndexStruct.h +++ b/MsBinaryFile/PptFile/Structures/ColorIndexStruct.h @@ -36,30 +36,16 @@ namespace PPT { -struct ColorIndexStruct : public IStruct { - +struct ColorIndexStruct : public IStruct +{ BYTE m_red; BYTE m_green; BYTE m_blue; BYTE m_index; - ColorIndexStruct() - { - clear(); - } + ColorIndexStruct(); - void clear() - { - m_red = m_green = m_blue = 0; - m_index = 0; - } - - void ReadFromStream(POLE::Stream * pStream) - { - m_red = StreamUtils::ReadBYTE(pStream); - m_green = StreamUtils::ReadBYTE(pStream); - m_blue = StreamUtils::ReadBYTE(pStream); - m_index = StreamUtils::ReadBYTE(pStream); - } + void clear(); + void ReadFromStream(POLE::Stream *pStream) override; }; } diff --git a/MsBinaryFile/PptFile/Structures/ColorStruct.h b/MsBinaryFile/PptFile/Structures/ColorStruct.h index 59d76f130f..da1cc0decc 100644 --- a/MsBinaryFile/PptFile/Structures/ColorStruct.h +++ b/MsBinaryFile/PptFile/Structures/ColorStruct.h @@ -36,28 +36,16 @@ namespace PPT { -struct ColorStruct { - +struct ColorStruct +{ BYTE m_red; BYTE m_green; BYTE m_blue; - ColorStruct() - { - clear(); - } - void clear() - { - m_red = m_green = m_blue = 0; - } + ColorStruct(); + void clear(); - void ReadFromStream(POLE::Stream * pStream) - { - m_red = StreamUtils::ReadBYTE(pStream); - m_green = StreamUtils::ReadBYTE(pStream); - m_blue = StreamUtils::ReadBYTE(pStream); - StreamUtils::StreamSkip(1, pStream); - } + void ReadFromStream(POLE::Stream * pStream) override; }; } diff --git a/MsBinaryFile/PptFile/Structures/DateTimeStruct.h b/MsBinaryFile/PptFile/Structures/DateTimeStruct.h index 208cd31020..d76a6d7304 100644 --- a/MsBinaryFile/PptFile/Structures/DateTimeStruct.h +++ b/MsBinaryFile/PptFile/Structures/DateTimeStruct.h @@ -49,21 +49,8 @@ struct DateTimeStruct : public IStruct WORD m_wSecond; WORD m_wMilliseconds; - DateTimeStruct() : - m_wYear(0), m_wMonth(0), m_wDayOfWeek(0), m_wDay(0), - m_wHour(0), m_wMinute(0), m_wSecond(0), m_wMilliseconds(0) - {} - void ReadFromStream(POLE::Stream *pStream) override - { - m_wYear = StreamUtils::ReadWORD(pStream); - m_wMonth = StreamUtils::ReadWORD(pStream); - m_wDayOfWeek = StreamUtils::ReadWORD(pStream); - m_wDay = StreamUtils::ReadWORD(pStream); - m_wHour = StreamUtils::ReadWORD(pStream); - m_wMinute = StreamUtils::ReadWORD(pStream); - m_wSecond = StreamUtils::ReadWORD(pStream); - m_wMilliseconds = StreamUtils::ReadWORD(pStream); - } + DateTimeStruct(); + void ReadFromStream(POLE::Stream *pStream) override; }; } diff --git a/MsBinaryFile/PptFile/Records/Animations/TimeVariant4TimeNode.h b/MsBinaryFile/PptFile/Structures/FontCollectionEntry.cpp similarity index 88% rename from MsBinaryFile/PptFile/Records/Animations/TimeVariant4TimeNode.h rename to MsBinaryFile/PptFile/Structures/FontCollectionEntry.cpp index 02a57737da..ed31df8279 100644 --- a/MsBinaryFile/PptFile/Records/Animations/TimeVariant4TimeNode.h +++ b/MsBinaryFile/PptFile/Structures/FontCollectionEntry.cpp @@ -29,14 +29,12 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ -#pragma once +#include "FontCollectionEntry.h" +#include "../../../OOXML/SystemUtility/File.h" +using namespace PPT; -#include "../Reader/Records.h" - - -// TODO -//class nope : public CUnknownRecord -//{ - -//}; +void FontCollectionEntry::ReadFromStream(POLE::Stream *pStream) +{ + StreamUtils::StreamSkip(76, pStream); +} diff --git a/MsBinaryFile/PptFile/Structures/FontCollectionEntry.h b/MsBinaryFile/PptFile/Structures/FontCollectionEntry.h new file mode 100644 index 0000000000..1bd4f5eea3 --- /dev/null +++ b/MsBinaryFile/PptFile/Structures/FontCollectionEntry.h @@ -0,0 +1,53 @@ +/* + * (c) Copyright Ascensio System SIA 2010-2019 + * + * This program is a free software product. You can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License (AGPL) + * version 3 as published by the Free Software Foundation. In accordance with + * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect + * that Ascensio System SIA expressly excludes the warranty of non-infringement + * of any third-party rights. + * + * This program is distributed WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For + * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html + * + * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha + * street, Riga, Latvia, EU, LV-1050. + * + * The interactive user interfaces in modified source and object code versions + * of the Program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU AGPL version 3. + * + * Pursuant to Section 7(b) of the License you must retain the original Product + * logo when distributing the program. Pursuant to Section 7(e) we decline to + * grant you any rights under trademark law for use of our trademarks. + * + * All the Product's GUI elements, including illustrations and icon sets, as + * well as technical writing content are licensed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International. See the License + * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + * + */ +#pragma once + +#include "IStruct.h" +#include + + +namespace PPT +{ +struct FontCollectionEntry : public IStruct +{ + std::wstring lfFaceName; + BYTE lfCharSet = 0; + bool fEmbedSubsetted = false; + bool rasterFontType = false; + bool deviceFontType = false; + bool truetypeFontType = false; + bool fNoFontSubstitution = false; + + FontCollectionEntry(); + void ReadFromStream(POLE::Stream * pStream) override; +}; +} diff --git a/MsBinaryFile/PptFile/Structures/IStruct.h b/MsBinaryFile/PptFile/Structures/IStruct.h index 51efbf9b84..4fcfb308dc 100644 --- a/MsBinaryFile/PptFile/Structures/IStruct.h +++ b/MsBinaryFile/PptFile/Structures/IStruct.h @@ -31,10 +31,13 @@ */ #pragma once -#include "../../../OOXML/Base/Base.h" +#include "../../../Common/3dParty/pole/pole.h" #include "../../../DesktopEditor/common/File.h" +#include "../../../OOXML/Base/Base.h" // it used -namespace PPT { + +namespace PPT +{ struct IStruct { virtual void ReadFromStream (POLE::Stream* pStream) = 0; }; diff --git a/MsBinaryFile/PptFile/Structures/PointStruct.h b/MsBinaryFile/PptFile/Structures/PointStruct.h index ec97ae91da..f83cc65781 100644 --- a/MsBinaryFile/PptFile/Structures/PointStruct.h +++ b/MsBinaryFile/PptFile/Structures/PointStruct.h @@ -40,10 +40,6 @@ struct PointStruct : public IStruct _UINT32 m_x; _UINT32 m_y; - void ReadFromStream(POLE::Stream *pStream) override - { - m_x = StreamUtils::ReadLONG(pStream); - m_y = StreamUtils::ReadLONG(pStream); - } + void ReadFromStream(POLE::Stream *pStream) override; }; } diff --git a/MsBinaryFile/PptFile/Structures/RatioStruct.h b/MsBinaryFile/PptFile/Structures/RatioStruct.h index 6f6859e92f..a69c530567 100644 --- a/MsBinaryFile/PptFile/Structures/RatioStruct.h +++ b/MsBinaryFile/PptFile/Structures/RatioStruct.h @@ -42,10 +42,7 @@ struct RatioStruct : public IStruct LONG m_nNumber; LONG m_nDenom; - void ReadFromStream(POLE::Stream* pStream) override - { - m_nNumber = StreamUtils::ReadLONG(pStream); - m_nDenom = StreamUtils::ReadLONG(pStream); - } + + void ReadFromStream(POLE::Stream* pStream) override; }; } diff --git a/MsBinaryFile/PptFile/Structures/RectStruct.h b/MsBinaryFile/PptFile/Structures/RectStruct.h index 87b807812a..5fd77ccd00 100644 --- a/MsBinaryFile/PptFile/Structures/RectStruct.h +++ b/MsBinaryFile/PptFile/Structures/RectStruct.h @@ -44,12 +44,7 @@ struct RectStruct : public IStruct _INT32 m_nRight; _INT32 m_nBottom; - void ReadFromStream(POLE::Stream *pStream) override - { - m_nTop = StreamUtils::ReadLONG(pStream); - m_nLeft = StreamUtils::ReadLONG(pStream); - m_nRight = StreamUtils::ReadLONG(pStream); - m_nBottom = StreamUtils::ReadLONG(pStream); - } + + void ReadFromStream(POLE::Stream *pStream) override; }; } diff --git a/MsBinaryFile/PptFile/Structures/ScalingStruct.h b/MsBinaryFile/PptFile/Structures/ScalingStruct.h index 02a8ce60a7..fbe1a39daa 100644 --- a/MsBinaryFile/PptFile/Structures/ScalingStruct.h +++ b/MsBinaryFile/PptFile/Structures/ScalingStruct.h @@ -42,10 +42,6 @@ struct ScalingStruct : public IStruct RatioStruct m_x; RatioStruct m_y; - void ReadFromStream(POLE::Stream* pStream) override - { - m_x.ReadFromStream(pStream); - m_y.ReadFromStream(pStream); - } + void ReadFromStream(POLE::Stream* pStream) override; }; } diff --git a/MsBinaryFile/PptFile/Structures/SmallRectStruct.h b/MsBinaryFile/PptFile/Structures/SmallRectStruct.h index 55e6b3703b..2d1f74ad7d 100644 --- a/MsBinaryFile/PptFile/Structures/SmallRectStruct.h +++ b/MsBinaryFile/PptFile/Structures/SmallRectStruct.h @@ -43,12 +43,7 @@ struct SmallRectStruct : public IStruct _INT16 m_nRight; _INT16 m_nBottom; - void ReadFromStream(POLE::Stream *pStream) override - { - m_nTop = StreamUtils::ReadSHORT(pStream); - m_nLeft = StreamUtils::ReadSHORT(pStream); - m_nRight = StreamUtils::ReadSHORT(pStream); - m_nBottom = StreamUtils::ReadSHORT(pStream); - } + + void ReadFromStream(POLE::Stream *pStream) override; }; } diff --git a/MsBinaryFile/PptFile/Structures/TmsfTimeStruct.h b/MsBinaryFile/PptFile/Structures/TmsfTimeStruct.h index 51d973365d..22a899b8d8 100644 --- a/MsBinaryFile/PptFile/Structures/TmsfTimeStruct.h +++ b/MsBinaryFile/PptFile/Structures/TmsfTimeStruct.h @@ -44,12 +44,7 @@ struct TmsfTimeStruct : public IStruct BYTE m_nSecond; BYTE m_nFrame; - void ReadFromStream(POLE::Stream *pStream) override - { - m_nTrack = StreamUtils::ReadBYTE(pStream); - m_nMinute = StreamUtils::ReadBYTE(pStream); - m_nSecond = StreamUtils::ReadBYTE(pStream); - m_nFrame = StreamUtils::ReadBYTE(pStream); - } + + void ReadFromStream(POLE::Stream *pStream) override; }; } diff --git a/MsBinaryFile/PptFile/Structures/WideColorStruct.h b/MsBinaryFile/PptFile/Structures/WideColorStruct.h index e2feef14ae..2cc773b09a 100644 --- a/MsBinaryFile/PptFile/Structures/WideColorStruct.h +++ b/MsBinaryFile/PptFile/Structures/WideColorStruct.h @@ -43,11 +43,7 @@ struct WideColorStruct : IStruct USHORT m_nGreen; USHORT m_nBlue; - void ReadFromStream(POLE::Stream *pStream) override - { - m_nRed = StreamUtils::ReadWORD(pStream); - m_nGreen = StreamUtils::ReadWORD(pStream); - m_nBlue = StreamUtils::ReadWORD(pStream); - } + + void ReadFromStream(POLE::Stream *pStream) override; }; } diff --git a/MsBinaryFile/Projects/PPTFormatLib/Linux/PPTFormatLib.pro b/MsBinaryFile/Projects/PPTFormatLib/Linux/PPTFormatLib.pro index c89183e0c2..fab3599cd3 100644 --- a/MsBinaryFile/Projects/PPTFormatLib/Linux/PPTFormatLib.pro +++ b/MsBinaryFile/Projects/PPTFormatLib/Linux/PPTFormatLib.pro @@ -127,6 +127,7 @@ HEADERS += \ ../../../PptFile/Records/BookmarkEntityAtom.h \ ../../../PptFile/Records/BookmarkSeedAtom.h \ ../../../PptFile/Records/BuildAtom.h \ + ../../../PptFile/Records/CryptSession10Container.h \ ../../../PptFile/Records/DocInfoListContainer.h \ ../../../PptFile/Records/DocProgTagsContainer.h \ ../../../PptFile/Records/MouseInteractiveInfoContainer.h \ @@ -134,6 +135,7 @@ HEADERS += \ ../../../PptFile/Records/OfficeArtClientTextbox.h \ ../../../PptFile/Records/PlaceHolderAtom.h \ ../../../PptFile/Records/RoundTrip.h \ + ../../../PptFile/Records/RoundTripNotesMasterTextStyles12Atom.h \ ../../../PptFile/Records/ShapeProgBinaryTagSubContainerOrAtom.h \ ../../../PptFile/Records/CFMasks.h \ ../../../PptFile/Records/ColorSchemeAtom.h \ @@ -268,6 +270,7 @@ HEADERS += \ ../../../PptFile/Structures/ColorIndexStruct.h \ ../../../PptFile/Structures/ColorStruct.h \ ../../../PptFile/Structures/DateTimeStruct.h \ + ../../../PptFile/Structures/FontCollectionEntry.h \ ../../../PptFile/Structures/IStruct.h \ ../../../PptFile/Structures/PointStruct.h \ ../../../PptFile/Structures/RatioStruct.h \ @@ -327,4 +330,179 @@ SOURCES += \ ../../../PptFile/Reader/ExtXmlUtils.cpp \ ../../../PptFile/Reader/PPTDocumentInfo.cpp \ ../../../PptFile/Reader/SlideInfo.cpp \ - ../../../PptFile/Records/TextFullSettings.cpp + ../../../PptFile/Records/Animations/AnimationInfoAtom.cpp \ + ../../../PptFile/Records/Animations/AnimationInfoContainer.cpp \ + ../../../PptFile/Records/Animations/BuildAtom.cpp \ + ../../../PptFile/Records/Animations/BuildListSubContainer.cpp \ + ../../../PptFile/Records/Animations/ChartBuildAtom.cpp \ + ../../../PptFile/Records/Animations/ChartBuildContainer.cpp \ + ../../../PptFile/Records/Animations/ClientVisualElementContainer.cpp \ + ../../../PptFile/Records/Animations/DiagramBuildAtom.cpp \ + ../../../PptFile/Records/Animations/DiagramBuildContainer.cpp \ + ../../../PptFile/Records/Animations/ExtTimeNodeContainer.cpp \ + ../../../PptFile/Records/Animations/HashCode10Atom.cpp \ + ../../../PptFile/Records/Animations/LevelInfoAtom.cpp \ + ../../../PptFile/Records/Animations/ParaBuildAtom.cpp \ + ../../../PptFile/Records/Animations/ParaBuildContainer.cpp \ + ../../../PptFile/Records/Animations/ParaBuildLevel.cpp \ + ../../../PptFile/Records/Animations/SubEffectContainer.cpp \ + ../../../PptFile/Records/Animations/TimeAnimateBehaviorAtom.cpp \ + ../../../PptFile/Records/Animations/TimeAnimateBehaviorContainer.cpp \ + ../../../PptFile/Records/Animations/TimeAnimateColor.cpp \ + ../../../PptFile/Records/Animations/TimeAnimateColorBy.cpp \ + ../../../PptFile/Records/Animations/TimeAnimationValueAtom.cpp \ + ../../../PptFile/Records/Animations/TimeAnimationValueListContainer.cpp \ + ../../../PptFile/Records/Animations/TimeAnimationValueListEntry.cpp \ + ../../../PptFile/Records/Animations/TimeBehaviorAtom.cpp \ + ../../../PptFile/Records/Animations/TimeBehaviorContainer.cpp \ + ../../../PptFile/Records/Animations/TimeColorBehaviorAtom.cpp \ + ../../../PptFile/Records/Animations/TimeColorBehaviorContainer.cpp \ + ../../../PptFile/Records/Animations/TimeCommandBehaviorAtom.cpp \ + ../../../PptFile/Records/Animations/TimeCommandBehaviorContainer.cpp \ + ../../../PptFile/Records/Animations/TimeConditionAtom.cpp \ + ../../../PptFile/Records/Animations/TimeConditionContainer.cpp \ + ../../../PptFile/Records/Animations/TimeEffectBehaviorAtom.cpp \ + ../../../PptFile/Records/Animations/TimeEffectBehaviorContainer.cpp \ + ../../../PptFile/Records/Animations/TimeIterateDataAtom.cpp \ + ../../../PptFile/Records/Animations/TimeModifierAtom.cpp \ + ../../../PptFile/Records/Animations/TimeMotionBehaviorAtom.cpp \ + ../../../PptFile/Records/Animations/TimeMotionBehaviorContainer.cpp \ + ../../../PptFile/Records/Animations/TimeNodeAtom.cpp \ + ../../../PptFile/Records/Animations/TimePropertyList4TimeBehavior.cpp \ + ../../../PptFile/Records/Animations/TimePropertyList4TimeNodeContainer.cpp \ + ../../../PptFile/Records/Animations/TimeRotationBehaviorAtom.cpp \ + ../../../PptFile/Records/Animations/TimeRotationBehaviorContainer.cpp \ + ../../../PptFile/Records/Animations/TimeScaleBehaviorAtom.cpp \ + ../../../PptFile/Records/Animations/TimeScaleBehaviorContainer.cpp \ + ../../../PptFile/Records/Animations/TimeSequenceDataAtom.cpp \ + ../../../PptFile/Records/Animations/TimeSetBehaviorAtom.cpp \ + ../../../PptFile/Records/Animations/TimeSetBehaviorContainer.cpp \ + ../../../PptFile/Records/Animations/TimeStringListContainer.cpp \ + ../../../PptFile/Records/Animations/TimeVariant4Behavior.cpp \ + ../../../PptFile/Records/Animations/VisualPageAtom.cpp \ + ../../../PptFile/Records/Animations/VisualShapeAtom.cpp \ + ../../../PptFile/Records/Animations/VisualShapeChartElementAtom.cpp \ + ../../../PptFile/Records/Animations/VisualShapeGeneralAtom.cpp \ + ../../../PptFile/Records/Animations/VisualSoundAtom.cpp \ + ../../../PptFile/Records/BlipCollection9Container.cpp \ + ../../../PptFile/Records/BookmarkEntityAtom.cpp \ + ../../../PptFile/Records/BookmarkSeedAtom.cpp \ + ../../../PptFile/Records/BuildAtom.cpp \ + ../../../PptFile/Records/CFMasks.cpp \ + ../../../PptFile/Records/CString.cpp \ + ../../../PptFile/Records/ColorSchemeAtom.cpp \ + ../../../PptFile/Records/Comment10Container.cpp \ + ../../../PptFile/Records/CurrentUserAtom.cpp \ + ../../../PptFile/Records/DocInfoListContainer.cpp \ + ../../../PptFile/Records/DocProgTagsContainer.cpp \ + ../../../PptFile/Records/DocRoutingSlipAtom.cpp \ + ../../../PptFile/Records/DocumentAtom.cpp \ + ../../../PptFile/Records/DocumentRecords.cpp \ + ../../../PptFile/Records/DocumentTextInfo.cpp \ + ../../../PptFile/Records/Drawing/BlipStoreContainer.cpp \ + ../../../PptFile/Records/Drawing/BlipStoreEntry.cpp \ + ../../../PptFile/Records/Drawing/ChildAnchor.cpp \ + ../../../PptFile/Records/Drawing/ClientAnchor.cpp \ + ../../../PptFile/Records/Drawing/DrawingContainer.cpp \ + ../../../PptFile/Records/Drawing/DrawingGroup.cpp \ + ../../../PptFile/Records/Drawing/DrawingRecord.cpp \ + ../../../PptFile/Records/Drawing/GroupShape.cpp \ + ../../../PptFile/Records/Drawing/RegGroupItems.cpp \ + ../../../PptFile/Records/Drawing/Shape.cpp \ + ../../../PptFile/Records/Drawing/ShapeProperties.cpp \ + ../../../PptFile/Records/Drawing/TextBox.cpp \ + ../../../PptFile/Records/EndDocument.cpp \ + ../../../PptFile/Records/ExCDAudioContainer.cpp \ + ../../../PptFile/Records/ExControlAtom.cpp \ + ../../../PptFile/Records/ExHyperlinkAtom.cpp \ + ../../../PptFile/Records/ExMIDIAudioContainer.cpp \ + ../../../PptFile/Records/ExMediaAtom.cpp \ + ../../../PptFile/Records/ExObjListAtom.cpp \ + ../../../PptFile/Records/ExObjListContainer.cpp \ + ../../../PptFile/Records/ExObjRefAtom.cpp \ + ../../../PptFile/Records/ExOleEmbedAtom.cpp \ + ../../../PptFile/Records/ExOleLinkAtom.cpp \ + ../../../PptFile/Records/ExOleObjAtom.cpp \ + ../../../PptFile/Records/ExVideoContainer.cpp \ + ../../../PptFile/Records/ExWAVAudioEmbeddedContainer.cpp \ + ../../../PptFile/Records/ExWAVAudioLinkContainer.cpp \ + ../../../PptFile/Records/FontCollection10Container.cpp \ + ../../../PptFile/Records/FontEmbedFlags10Atom.cpp \ + ../../../PptFile/Records/FontEntityAtom.cpp \ + ../../../PptFile/Records/GridSpacing10Atom.cpp \ + ../../../PptFile/Records/GuideAtom.cpp \ + ../../../PptFile/Records/HeadersFootersAtom.cpp \ + ../../../PptFile/Records/InteractiveInfoAtom.cpp \ + ../../../PptFile/Records/KinsokuAtom.cpp \ + ../../../PptFile/Records/KinsokuContainer.cpp \ + ../../../PptFile/Records/KinsokuFollowingAtom.cpp \ + ../../../PptFile/Records/KinsokuLeadingAtom.cpp \ + ../../../PptFile/Records/LinkedShape10Atom.cpp \ + ../../../PptFile/Records/LinkedSlide10Atom.cpp \ + ../../../PptFile/Records/MasterPersistAtom.cpp \ + ../../../PptFile/Records/MasterTextPropAtom.cpp \ + ../../../PptFile/Records/MetafileBlob.cpp \ + ../../../PptFile/Records/MouseInteractiveInfoContainer.cpp \ + ../../../PptFile/Records/MouseTextInteractiveInfoAtom.cpp \ + ../../../PptFile/Records/NamedShowSlidesAtom.cpp \ + ../../../PptFile/Records/NoZoomViewInfoAtom.cpp \ + ../../../PptFile/Records/NormalViewSetInfoAtom.cpp \ + ../../../PptFile/Records/NotesAtom.cpp \ + ../../../PptFile/Records/NotesPersistAtom.cpp \ + ../../../PptFile/Records/OfficeArtClientData.cpp \ + ../../../PptFile/Records/OutlineTextProps9Container.cpp \ + ../../../PptFile/Records/OutlineTextPropsHeaderExAtom.cpp \ + ../../../PptFile/Records/OutlineTextRefAtom.cpp \ + ../../../PptFile/Records/PFMasks.cpp \ + ../../../PptFile/Records/PersistDirectoryAtom.cpp \ + ../../../PptFile/Records/PlaceHolderAtom.cpp \ + ../../../PptFile/Records/ProgStringTagContainer.cpp \ + ../../../PptFile/Records/RoundTrip.cpp \ + ../../../PptFile/Records/RoundTripNotesMasterTextStyles12Atom.cpp \ + ../../../PptFile/Records/SSDocInfoAtom.cpp \ + ../../../PptFile/Records/SSSlideInfoAtom.cpp \ + ../../../PptFile/Records/SSlideLayoutAtom.cpp \ + ../../../PptFile/Records/ShapeFlags10Atom.cpp \ + ../../../PptFile/Records/ShapeFlagsAtom.cpp \ + ../../../PptFile/Records/ShapeProgBinaryTagSubContainerOrAtom.cpp \ + ../../../PptFile/Records/SlideAtom.cpp \ + ../../../PptFile/Records/SlideColorSchemeAtom.cpp \ + ../../../PptFile/Records/SlideContainer.cpp \ + ../../../PptFile/Records/SlideFlags10Atom.cpp \ + ../../../PptFile/Records/SlideListWithText.cpp \ + ../../../PptFile/Records/SlidePersistAtom.cpp \ + ../../../PptFile/Records/SlideProgTagsContainer.cpp \ + ../../../PptFile/Records/SlideTime10Atom.cpp \ + ../../../PptFile/Records/SlideViewInfoAtom.cpp \ + ../../../PptFile/Records/SoundCollAtom.cpp \ + ../../../PptFile/Records/SoundCollectionContainer.cpp \ + ../../../PptFile/Records/SoundContainer.cpp \ + ../../../PptFile/Records/SoundDataBlob.cpp \ + ../../../PptFile/Records/StyleTextProp10Atom.cpp \ + ../../../PptFile/Records/StyleTextProp11Atom.cpp \ + ../../../PptFile/Records/StyleTextProp9Atom.cpp \ + ../../../PptFile/Records/StyleTextPropAtom.cpp \ + ../../../PptFile/Records/TextBookmarkAtom.cpp \ + ../../../PptFile/Records/TextBytesAtom.cpp \ + ../../../PptFile/Records/TextCFException10.cpp \ + ../../../PptFile/Records/TextCFException9.cpp \ + ../../../PptFile/Records/TextCFExceptionAtom.cpp \ + ../../../PptFile/Records/TextCharsAtom.cpp \ + ../../../PptFile/Records/TextDefaults9Atom.cpp \ + ../../../PptFile/Records/TextFullSettings.cpp \ + ../../../PptFile/Records/TextHeaderAtom.cpp \ + ../../../PptFile/Records/TextInteractiveInfoAtom.cpp \ + ../../../PptFile/Records/TextMasterStyle9Atom.cpp \ + ../../../PptFile/Records/TextMasterStyle9Level.cpp \ + ../../../PptFile/Records/TextMasterStyleAtom.cpp \ + ../../../PptFile/Records/TextPFException9.cpp \ + ../../../PptFile/Records/TextPFExceptionAtom.cpp \ + ../../../PptFile/Records/TextRulerAtom.cpp \ + ../../../PptFile/Records/TextSIException.cpp \ + ../../../PptFile/Records/TextSIExceptionAtom.cpp \ + ../../../PptFile/Records/TextSpecInfoAtom.cpp \ + ../../../PptFile/Records/UserEditAtom.cpp \ + ../../../PptFile/Records/VBAInfoAtom.cpp \ + ../../../PptFile/Records/ViewInfoAtom.cpp \ + ../../../PptFile/Records/ZoomViewInfoAtom.cpp \ + ../../../PptFile/Structures/FontCollectionEntry.cpp