From ff4425e977f58ba6dc07f95380d4375f2bea4f6f Mon Sep 17 00:00:00 2001 From: Elena Subbotina Date: Wed, 24 Jul 2024 18:36:10 +0300 Subject: [PATCH] fix grad --- MsBinaryFile/DocFile/VMLPictureMapping.cpp | 11 +- MsBinaryFile/DocFile/VMLShapeMapping.cpp | 85 ++++++-- MsBinaryFile/DocFile/WordDocument.cpp | 54 +++-- MsBinaryFile/DocFile/WordDocument.h | 186 +++++++++--------- .../Converter/xlsx_drawing_context.cpp | 6 - .../XlsFile/Converter/xlsx_drawing_context.h | 8 +- OOXML/Common/SimpleTypes_Vml.h | 19 +- .../ASCOfficeDrawingConverter.cpp | 129 +++++++----- OdfFile/Writer/Converter/XlsxConverter.cpp | 2 +- 9 files changed, 311 insertions(+), 189 deletions(-) diff --git a/MsBinaryFile/DocFile/VMLPictureMapping.cpp b/MsBinaryFile/DocFile/VMLPictureMapping.cpp index fb729a5177..10dce60a1e 100644 --- a/MsBinaryFile/DocFile/VMLPictureMapping.cpp +++ b/MsBinaryFile/DocFile/VMLPictureMapping.cpp @@ -316,6 +316,9 @@ namespace DocFileFormat //todooo oбъединить с shape_mapping + + int nColorRGBBase = 0xffffff; + for (size_t i = 0; i < options.size(); i++) { ODRAW::OfficeArtFOPTEPtr & iter = options[i]; @@ -355,7 +358,7 @@ namespace DocFileFormat if (!pict->brcBottom) { ODRAW::OfficeArtCOLORREF bottomColor((_UINT32)iter->op); - m_context->_doc->CorrectColor(bottomColor); + m_context->_doc->CorrectColor(bottomColor, nColorRGBBase); if (false == bottomColor.sColorRGB.empty()) m_pXmlWriter->WriteAttribute(L"o:borderbottomcolor", L"#" + bottomColor.sColorRGB); } @@ -364,7 +367,7 @@ namespace DocFileFormat if (!pict->brcLeft) { ODRAW::OfficeArtCOLORREF leftColor((_UINT32)iter->op); - m_context->_doc->CorrectColor(leftColor); + m_context->_doc->CorrectColor(leftColor, nColorRGBBase); if (false == leftColor.sColorRGB.empty()) m_pXmlWriter->WriteAttribute(L"o:borderleftcolor", L"#" + leftColor.sColorRGB); } @@ -373,7 +376,7 @@ namespace DocFileFormat if (!pict->brcRight) { ODRAW::OfficeArtCOLORREF rightColor((_UINT32)iter->op); - m_context->_doc->CorrectColor(rightColor); + m_context->_doc->CorrectColor(rightColor, nColorRGBBase); if (false == rightColor.sColorRGB.empty()) m_pXmlWriter->WriteAttribute(L"o:borderrightcolor", L"#" + rightColor.sColorRGB); } @@ -382,7 +385,7 @@ namespace DocFileFormat if (!pict->brcTop) { ODRAW::OfficeArtCOLORREF topColor((_UINT32)iter->op); - m_context->_doc->CorrectColor(topColor); + m_context->_doc->CorrectColor(topColor, nColorRGBBase); if (false == topColor.sColorRGB.empty()) m_pXmlWriter->WriteAttribute(L"o:bordertopcolor", L"#" + topColor.sColorRGB); } diff --git a/MsBinaryFile/DocFile/VMLShapeMapping.cpp b/MsBinaryFile/DocFile/VMLShapeMapping.cpp index 723c282537..186fc1701e 100644 --- a/MsBinaryFile/DocFile/VMLShapeMapping.cpp +++ b/MsBinaryFile/DocFile/VMLShapeMapping.cpp @@ -323,15 +323,24 @@ namespace DocFileFormat ODRAW::OfficeArtFOPTEPtr opConnectAngles; ODRAW::OfficeArtFOPTEPtr opConnectLocs; + int nColorRGBBase = 0xffffff, nFillType = 0; + + bool bFlipColors = false; + + boost::optional fill_left; + boost::optional fill_top; + boost::optional fill_right; + boost::optional fill_bottom; + for (size_t i = 0; i < options.size(); i++) { ODRAW::OfficeArtFOPTEPtr & iter = options[i]; switch (iter->opid) { - //BOOLEANS + //BOOLEANS case ODRAW::geometryBooleanProperties: { - ODRAW::GeometryBooleanProperties *booleans = dynamic_cast(iter.get()); + ODRAW::GeometryBooleanProperties* booleans = dynamic_cast(iter.get()); if (booleans->fUsefLineOK && !booleans->fLineOK) { bStroked = false; @@ -352,7 +361,7 @@ namespace DocFileFormat break; case ODRAW::fillStyleBooleanProperties: { - ODRAW::FillStyleBooleanProperties *booleans = dynamic_cast(iter.get()); + ODRAW::FillStyleBooleanProperties* booleans = dynamic_cast(iter.get()); if (booleans->fUsefFilled && !booleans->fFilled) { bFilled = false; @@ -365,7 +374,7 @@ namespace DocFileFormat }break; case ODRAW::lineStyleBooleanProperties: { - ODRAW::LineStyleBooleanProperties *booleans = dynamic_cast(iter.get()); + ODRAW::LineStyleBooleanProperties* booleans = dynamic_cast(iter.get()); if (booleans->fUsefLine && !booleans->fLine) { bStroked = false; @@ -383,14 +392,14 @@ namespace DocFileFormat break; case ODRAW::groupShapeBooleanProperties: { - ODRAW::GroupShapeBooleanProperties *booleans = dynamic_cast(iter.get()); + ODRAW::GroupShapeBooleanProperties* booleans = dynamic_cast(iter.get()); if (booleans->fUsefLayoutInCell) { layoutInCell = booleans->fLayoutInCell; } } break; - // GEOMETRY + // GEOMETRY case ODRAW::shapePath: { bHavePath = true; @@ -483,7 +492,7 @@ namespace DocFileFormat case ODRAW::lineColor: { ODRAW::OfficeArtCOLORREF lineColor((_UINT32)iter->op); - m_context->_doc->CorrectColor(lineColor); + m_context->_doc->CorrectColor(lineColor, nColorRGBBase); if (false == lineColor.sColorRGB.empty() && !pShape->fBackground) m_pXmlWriter->WriteAttribute(L"strokecolor", (std::wstring(L"#") + lineColor.sColorRGB)); }break; @@ -542,18 +551,20 @@ namespace DocFileFormat case 3: m_pXmlWriter->WriteAttribute(L"o:connectortype", L"none"); break; } }break; - // FILL + // FILL case ODRAW::fillColor: { ODRAW::OfficeArtCOLORREF fillColor((_UINT32)iter->op); - m_context->_doc->CorrectColor(fillColor); + m_context->_doc->CorrectColor(fillColor, nColorRGBBase); if (false == fillColor.sColorRGB.empty()) m_pXmlWriter->WriteAttribute(L"fillcolor", (std::wstring(L"#") + fillColor.sColorRGB)); + + nColorRGBBase = fillColor.nColorRGB; }break; case ODRAW::fillBackColor: { ODRAW::OfficeArtCOLORREF fillBackColor((_UINT32)iter->op); - m_context->_doc->CorrectColor(fillBackColor); + m_context->_doc->CorrectColor(fillBackColor, nColorRGBBase); if (false == fillBackColor.sColorRGB.empty()) appendValueAttribute(&m_fill, L"color2", (std::wstring(L"#") + fillBackColor.sColorRGB)); @@ -573,13 +584,47 @@ namespace DocFileFormat }break; case ODRAW::fillFocus: { - appendValueAttribute(&m_fill, L"focus", (std::to_wstring(iter->op) + L"%")); - appendValueAttribute(&m_fill, L"focusposition", L".5, .5"); + appendValueAttribute(&m_fill, L"focus", (std::to_wstring(iter->op) + L"%")); appendValueAttribute(&m_fill, L"focussize", L""); }break; case ODRAW::fillType: { - appendValueAttribute(&m_fill, L"type", getFillType(iter->op)); + nFillType = iter->op; + appendValueAttribute(&m_fill, L"type", getFillType(nFillType)); + if (nFillType == 6) + { + fill_top = 0.5; + fill_left = 0.5; + } + + //if (nFillType == 7) bFlipColors = true; + }break; + case ODRAW::fillToLeft: + { + ODRAW::FixedPoint* point = dynamic_cast(iter.get()); + if (point) fill_left = point->dVal; + }break; + case ODRAW::fillToTop: + { + ODRAW::FixedPoint* point = dynamic_cast(iter.get()); + if (point) fill_top = point->dVal; + }break; + case ODRAW::fillToRight: + { + ODRAW::FixedPoint* point = dynamic_cast(iter.get()); + if (point) fill_right = point->dVal; + }break; + case ODRAW::fillToBottom: + { + ODRAW::FixedPoint* point = dynamic_cast(iter.get()); + if (point) fill_bottom = point->dVal; + }break; + case ODRAW::fillRectLeft: + case ODRAW::fillRectTop: + case ODRAW::fillRectRight: + case ODRAW::fillRectBottom: + { + }break; case ODRAW::fillBlip: { @@ -630,7 +675,7 @@ namespace DocFileFormat case ODRAW::shadowColor: { ODRAW::OfficeArtCOLORREF shadowColor((_UINT32)iter->op); - m_context->_doc->CorrectColor(shadowColor); + m_context->_doc->CorrectColor(shadowColor, nColorRGBBase); if (false == shadowColor.sColorRGB.empty()) appendValueAttribute(&m_shadow, L"color", (std::wstring(L"#") + shadowColor.sColorRGB)); }break; @@ -932,6 +977,18 @@ namespace DocFileFormat } } + if (fill_top || fill_left) + { + std::wstring focusposition; + if (fill_left) focusposition += FormatUtils::DoubleToFormattedWideString(*fill_left, L"%.2f"); + if (fill_top) + { + focusposition += L","; + focusposition += FormatUtils::DoubleToFormattedWideString(*fill_top, L"%.2f"); + } + appendValueAttribute(&m_fill, L"focusposition", focusposition); + } + ODRAW::PVertices* pVP = dynamic_cast(opVerticles.get()); ODRAW::PSegmentInfo* pSI = dynamic_cast(opSegmentInfo.get()); if (pVP && pSI) diff --git a/MsBinaryFile/DocFile/WordDocument.cpp b/MsBinaryFile/DocFile/WordDocument.cpp index 4de69019f8..8c6497f6ec 100644 --- a/MsBinaryFile/DocFile/WordDocument.cpp +++ b/MsBinaryFile/DocFile/WordDocument.cpp @@ -1029,14 +1029,40 @@ namespace DocFileFormat return encodingChars; } } - void WordDocument::CorrectColor(ODRAW::OfficeArtCOLORREF & color) + void WordDocument::CorrectColor(ODRAW::OfficeArtCOLORREF & color, int base_color) { -#if 0 + struct _color + { + _color(unsigned char nR, unsigned char nG, unsigned char nB) + { + SetRGB(nR, nG, nB); + } + _color() {} + int nRGB = 0; + std::wstring sRGB; + int index = -1; + bool bScheme = false; + + void SetRGB(unsigned char nR, unsigned char nG, unsigned char nB) + { + nRGB = (nR << 16) | (nG << 8) | nB; + sRGB = STR::toRGB(nR, nG, nB); + + index = -1; + } + + unsigned char GetB() { return (unsigned char)(nRGB); } + unsigned char GetG() { return (unsigned char)(nRGB >> 8); } + unsigned char GetR() { return (unsigned char)(nRGB >> 16); } + + double opacity = 0; + }; + if (false == color.sColorRGB.empty()) return; if (color.fSysIndex) { - oox::_color sys_color; + _color sys_color; _UINT32 nColorCode = color.index; unsigned short nParameter = (unsigned short)((nColorCode >> 16) & 0x00ff); // the HiByte of nParameter is not zero, an exclusive AND is helping :o @@ -1045,17 +1071,20 @@ namespace DocFileFormat unsigned short nColorIndex = (unsigned short)(nColorCode & 0x00ff); unsigned short nPropColor = 0; - _UINT32 systemColors[25] = + _UINT32 systemColors[25] = { 0xc0c0c0, 0x008080, 0x000080, 0x808080, 0xc0c0c0, 0xffffff, 0x000000, 0x000000, 0x000000, 0xffffff, 0xc0c0c0, 0xc0c0c0, 0x808080, 0x000080, 0xffffff, 0xc0c0c0, 0x808080, 0x808080, 0x000000, 0xc0c0c0, 0xffffff, 0x000000, 0xc0c0c0, 0x000000, 0xffffc0 }; - - if (nColorIndex < 25) + if (nColorIndex == 0xf0) { - sys_color.SetRGB((unsigned char)(systemColors[nColorIndex]>>16), (unsigned char)(systemColors[nColorIndex]>>8), (unsigned char)(systemColors[nColorIndex])); + sys_color.SetRGB((unsigned char)(base_color), (unsigned char)(base_color >> 8), (unsigned char)(base_color >> 16)); + } + else if (nColorIndex < 25) + { + sys_color.SetRGB((unsigned char)(systemColors[nColorIndex] >> 16), (unsigned char)(systemColors[nColorIndex] >> 8), (unsigned char)(systemColors[nColorIndex])); } else return; @@ -1083,7 +1112,7 @@ namespace DocFileFormat BYTE B = static_cast((nInvParameter + (nParameter * sys_color.GetB())) >> 8); sys_color.SetRGB(R, G, B); - }break; + }break; case 0x03: // add grey level RGB(p,p,p) { short nR = (short)sys_color.GetR() + (short)nParameter; @@ -1095,7 +1124,7 @@ namespace DocFileFormat if (nB > 0x00ff) nB = 0x00ff; sys_color.SetRGB((BYTE)nR, (BYTE)nG, (BYTE)nB); - }break; + }break; case 0x04: // substract grey level RGB(p,p,p) { short nR = (short)sys_color.GetR() - (short)nParameter; @@ -1105,7 +1134,7 @@ namespace DocFileFormat if (nG < 0) nG = 0; if (nB < 0) nB = 0; sys_color.SetRGB((BYTE)nR, (BYTE)nG, (BYTE)nB); - } break; + } break; case 0x05: // substract from gray level RGB(p,p,p) { short nR = (short)nParameter - (short)sys_color.GetR(); @@ -1115,7 +1144,7 @@ namespace DocFileFormat if (nG < 0) nG = 0; if (nB < 0) nB = 0; sys_color.SetRGB((BYTE)nR, (BYTE)nG, (BYTE)nB); - }break; + }break; case 0x06: // per component: black if < p, white if >= p { BYTE R = sys_color.GetR() < nParameter ? 0x00 : 0xff; @@ -1123,7 +1152,7 @@ namespace DocFileFormat BYTE B = sys_color.GetB() < nParameter ? 0x00 : 0xff; sys_color.SetRGB(R, G, B); - }break; + }break; } if (nAdditionalFlags & 0x40) // top-bit invert sys_color.SetRGB(sys_color.GetR() ^ 0x80, sys_color.GetG() ^ 0x80, sys_color.GetB() ^ 0x80); @@ -1141,7 +1170,6 @@ namespace DocFileFormat // color.sColorRGB = it->second; // } //} -#endif } } diff --git a/MsBinaryFile/DocFile/WordDocument.h b/MsBinaryFile/DocFile/WordDocument.h index e49bc56ae5..683a60c7a7 100644 --- a/MsBinaryFile/DocFile/WordDocument.h +++ b/MsBinaryFile/DocFile/WordDocument.h @@ -69,11 +69,11 @@ namespace CRYPT namespace DocFileFormat { - class WordDocument: public IVisitable + class WordDocument : public IVisitable { friend class FootnotesMapping; friend class EndnotesMapping; - friend class CommentsMapping; + friend class CommentsMapping; friend class Converter; friend class CharacterPropertiesMapping; friend class DocumentMapping; @@ -94,16 +94,16 @@ namespace DocFileFormat friend class WordprocessingDocument; public: - WordDocument (const std::wstring & tempFolder, const int userLCID); + WordDocument(const std::wstring& tempFolder, const int userLCID); virtual ~WordDocument(); - _UINT32 LoadDocument(const std::wstring & fileName, const std::wstring & password); + _UINT32 LoadDocument(const std::wstring& fileName, const std::wstring& password); int nWordVersion; int nDocumentCodePage; bool bDocumentCodePage; int nFontsCodePage; - + inline StructuredStorageReader* GetStorage() const { return m_pStorage; @@ -115,16 +115,16 @@ namespace DocFileFormat private: bool LoadDocumentFlat(); - bool DecryptOfficeFile (CRYPT::Decryptor* Decryptor); - - bool DecryptStream (std::wstring streamName_open, POLE::Storage* storageIn, std::wstring streamName_create, std::shared_ptr storageOut, CRYPT::Decryptor* Decryptor, bool bDecrypt); - void DecryptStream (int level, std::wstring streamName, POLE::Storage* storageIn, std::shared_ptr storageOut, CRYPT::Decryptor* Decryptor); - - inline OfficeArtContent* GetOfficeArt () + bool DecryptOfficeFile(CRYPT::Decryptor* Decryptor); + + bool DecryptStream(std::wstring streamName_open, POLE::Storage* storageIn, std::wstring streamName_create, std::shared_ptr storageOut, CRYPT::Decryptor* Decryptor, bool bDecrypt); + void DecryptStream(int level, std::wstring streamName, POLE::Storage* storageIn, std::shared_ptr storageOut, CRYPT::Decryptor* Decryptor); + + inline OfficeArtContent* GetOfficeArt() { return officeArtContent; } - + inline int FindFileCharPos(int cp) { if (FIB->m_FibBase.fComplex) @@ -138,41 +138,41 @@ namespace DocFileFormat else { int fc = cp + FIB->m_FibBase.fcMin; - if (fc > FIB->m_FibBase.fcMac) + if (fc > FIB->m_FibBase.fcMac) return -1; return fc; } } - std::vector* GetEncodingChars (int fcStart, int fcEnd); - std::vector* GetChars (int fcStart, int fcEnd, int cp); - - std::vector* GetFileCharacterPositions ( int fcMin, int fcMax ); - std::vector* GetCharacterPropertyExceptions ( int fcMin, int fcMax ); - + std::vector* GetEncodingChars(int fcStart, int fcEnd); + std::vector* GetChars(int fcStart, int fcEnd, int cp); + + std::vector* GetFileCharacterPositions(int fcMin, int fcMax); + std::vector* GetCharacterPropertyExceptions(int fcMin, int fcMax); + void Clear(); MS_LCID_converter m_lcidConverter; - + std::wstring m_sFileName; - std::wstring m_sPassword; + std::wstring m_sPassword; std::wstring m_sTempFolder; std::wstring m_sTempDecryptFileName; int m_nUserLCID; std::wstring m_sXmlApp; std::wstring m_sXmlCore; - POLE::Stream * WordDocumentStream; // The stream "WordDocument" - POLE::Stream * TableStream; // The stream "0Table" or "1Table" - POLE::Stream * DataStream; // The stream called "Data" - StructuredStorageReader * m_pStorage; //POLE::Storage* Storage - - std::vector * Text; // All text of the Word document - std::vector * AllPapxFkps; // A list of all FKPs that contain PAPX - std::vector * AllChpxFkps; // A list of all FKPs that contain CHPX - - std::map * AllPapx; // The value is the PAPX that formats the paragraph. - std::map * AllSepx; // The value is the SEPX that formats the section. - std::vector * AllPapxVector;// A vector to quick find in AllPapx + POLE::Stream* WordDocumentStream; // The stream "WordDocument" + POLE::Stream* TableStream; // The stream "0Table" or "1Table" + POLE::Stream* DataStream; // The stream called "Data" + StructuredStorageReader* m_pStorage; //POLE::Storage* Storage + + std::vector* Text; // All text of the Word document + std::vector* AllPapxFkps; // A list of all FKPs that contain PAPX + std::vector* AllChpxFkps; // A list of all FKPs that contain CHPX + + std::map* AllPapx; // The value is the PAPX that formats the paragraph. + std::map* AllSepx; // The value is the SEPX that formats the section. + std::vector* AllPapxVector;// A vector to quick find in AllPapx std::map PictureBulletsCPsMap; @@ -181,79 +181,79 @@ namespace DocFileFormat struct _bmkStartEnd { int start; - int end; + int end; _UINT32 bookmarkId; }; std::vector<_bmkStartEnd> BookmarkStartEndCPs; std::vector<_bmkStartEnd> BookmarkProtStartEndCPs; std::vector<_bmkStartEnd> AnnotStartEndCPs; - + std::map mapAnnotBookmarks; //id, index std::map mapProtBookmarks; - FileInformationBlock * FIB; - StyleSheet * Styles; // The style sheet of the document - PieceTable * m_PieceTable; // PieceTable PieceTable; - ListFormatOverrideTable * listFormatOverrideTable; // lists and numberings in the document. - HeaderAndFooterTable * headerAndFooterTable; - AnnotationOwnerList * AnnotationOwners; - ListTable * listTable; // list numberings in the document. - WordDocumentProperties * DocProperties; - EncryptionHeader * encryptionHeader; - OfficeArtContent * officeArtContent; // info about the drawings in the document. + FileInformationBlock* FIB; + StyleSheet* Styles; // The style sheet of the document + PieceTable* m_PieceTable; // PieceTable PieceTable; + ListFormatOverrideTable* listFormatOverrideTable; // lists and numberings in the document. + HeaderAndFooterTable* headerAndFooterTable; + AnnotationOwnerList* AnnotationOwners; + ListTable* listTable; // list numberings in the document. + WordDocumentProperties* DocProperties; + EncryptionHeader* encryptionHeader; + OfficeArtContent* officeArtContent; // info about the drawings in the document. - StringTable *RevisionAuthorTable; - StringTable *FontTable; // A list of all font names, used in the doucument - StringTable *BookmarkNames; - StringTable *AutoTextNames; - StringTable *AssocNames; - StringTable *BkmkAnnotNames; - StringTable *Captions; - StringTable *AutoCaptions; - - StringTableEx *BkmkProt; - StringTable *BkmkProtUser; + StringTable* RevisionAuthorTable; + StringTable* FontTable; // A list of all font names, used in the doucument + StringTable* BookmarkNames; + StringTable* AutoTextNames; + StringTable* AssocNames; + StringTable* BkmkAnnotNames; + StringTable* Captions; + StringTable* AutoCaptions; - Plex *IndividualFootnotesPlex; //A plex of locations of individual footnotes - Plex *FootnoteReferenceCharactersPlex; //A plex of footnote reference characters - - Plex *IndividualEndnotesPlex; //A plex of locations of individual endnotes - Plex *EndnoteReferenceCharactersPlex; //A plex of endnote reference characters - - Plex *HeaderStoriesPlex; //A plex of the header document - Plex *IndividualCommentsPlex; // A plex with all ATRDPre10 structs - - Plex *TextboxIndividualPlex; - Plex *TextboxBreakPlex; // Describes the breaks inside the textbox subdocument - Plex *TextboxBreakPlexHeader; // Describes the breaks inside the header textbox subdocument - - Plex *OutlineListDescriptorPlex; - Plex *OfficeDrawingPlex; - Plex *OfficeDrawingPlexHeader; - - Plex *SectionPlex; - - Plex *BookmarkStartPlex; - Plex *BookmarkEndPlex; + StringTableEx* BkmkProt; + StringTable* BkmkProtUser; - Plex *AnnotStartPlex; - Plex *AnnotEndPlex; + Plex* IndividualFootnotesPlex; //A plex of locations of individual footnotes + Plex* FootnoteReferenceCharactersPlex; //A plex of footnote reference characters - Plex *BookmarkProtStartPlex; - Plex *BookmarkProtEndPlex; + Plex* IndividualEndnotesPlex; //A plex of locations of individual endnotes + Plex* EndnoteReferenceCharactersPlex; //A plex of endnote reference characters - Plex *ListPlex; - Plex *FieldsPlex; - Plex *FootnoteDocumentFieldsPlex; - Plex *EndnoteDocumentFieldsPlex; - Plex *HeadersAndFootersDocumentFieldsPlex; - Plex *AnnotationsFieldsPlex; - Plex *AnnotationsReferencePlex; - Plex *AutoTextPlex; - + Plex* HeaderStoriesPlex; //A plex of the header document + Plex* IndividualCommentsPlex; // A plex with all ATRDPre10 structs - AnnotationReferenceExDescriptors *AnnotationsReferencesEx; -//------------------------------------------------------------------------------ - void CorrectColor(ODRAW::OfficeArtCOLORREF & color); + Plex* TextboxIndividualPlex; + Plex* TextboxBreakPlex; // Describes the breaks inside the textbox subdocument + Plex* TextboxBreakPlexHeader; // Describes the breaks inside the header textbox subdocument + + Plex* OutlineListDescriptorPlex; + Plex* OfficeDrawingPlex; + Plex* OfficeDrawingPlexHeader; + + Plex* SectionPlex; + + Plex* BookmarkStartPlex; + Plex* BookmarkEndPlex; + + Plex* AnnotStartPlex; + Plex* AnnotEndPlex; + + Plex* BookmarkProtStartPlex; + Plex* BookmarkProtEndPlex; + + Plex* ListPlex; + Plex* FieldsPlex; + Plex* FootnoteDocumentFieldsPlex; + Plex* EndnoteDocumentFieldsPlex; + Plex* HeadersAndFootersDocumentFieldsPlex; + Plex* AnnotationsFieldsPlex; + Plex* AnnotationsReferencePlex; + Plex* AutoTextPlex; + + + AnnotationReferenceExDescriptors* AnnotationsReferencesEx; + //------------------------------------------------------------------------------ + void CorrectColor(ODRAW::OfficeArtCOLORREF& color, int base_color); }; } diff --git a/MsBinaryFile/XlsFile/Converter/xlsx_drawing_context.cpp b/MsBinaryFile/XlsFile/Converter/xlsx_drawing_context.cpp index f0d2708d5e..c22f4b5b85 100644 --- a/MsBinaryFile/XlsFile/Converter/xlsx_drawing_context.cpp +++ b/MsBinaryFile/XlsFile/Converter/xlsx_drawing_context.cpp @@ -81,13 +81,7 @@ namespace oox { 0x00666666, 0x00C0C0C0, 0x00DDDDDD, 0x00C0C0C0, 0x00888888, 0x00FFFFFF, 0x00CCCCCC, 0x00000000 }; - void _color::SetRGB(unsigned char nR, unsigned char nG, unsigned char nB) - { - nRGB = (nR<<16) | (nG<<8) | nB; - sRGB = STR::toRGB(nR, nG, nB); - index = -1; - } //----------------------------------------------------------------------------------------------------- class xlsx_drawing_context_handle::Impl { diff --git a/MsBinaryFile/XlsFile/Converter/xlsx_drawing_context.h b/MsBinaryFile/XlsFile/Converter/xlsx_drawing_context.h index d63512cd2c..7179902998 100644 --- a/MsBinaryFile/XlsFile/Converter/xlsx_drawing_context.h +++ b/MsBinaryFile/XlsFile/Converter/xlsx_drawing_context.h @@ -94,7 +94,13 @@ struct _color int index = -1; bool bScheme = false; - void SetRGB(unsigned char nR, unsigned char nG, unsigned char nB); + void SetRGB(unsigned char nR, unsigned char nG, unsigned char nB) + { + nRGB = (nR << 16) | (nG << 8) | nB; + sRGB = STR::toRGB(nR, nG, nB); + + index = -1; + } unsigned char GetB() { return (unsigned char )(nRGB);} unsigned char GetG() { return (unsigned char )(nRGB>>8);} diff --git a/OOXML/Common/SimpleTypes_Vml.h b/OOXML/Common/SimpleTypes_Vml.h index 9d4bdba44e..7f8eaaeea8 100644 --- a/OOXML/Common/SimpleTypes_Vml.h +++ b/OOXML/Common/SimpleTypes_Vml.h @@ -1503,9 +1503,8 @@ namespace SimpleTypes SimpleTypes_DefaultString(CVml_Vector2D_Units) - private: - - double m_dX; // В пунктах + private: + double m_dX; // В пунктах double m_dY; // В пунктах }; @@ -1529,7 +1528,7 @@ namespace SimpleTypes SimpleTypes_DefaultString(CVml_Vector2D_Percentage) - private: + private: double m_dX; // double m_dY; // }; @@ -1554,8 +1553,8 @@ namespace SimpleTypes SimpleTypes_DefaultString(CVml_Vector2D_1_65536) - private: - double m_dX; // + private: + double m_dX; // double m_dY; // }; @@ -1639,8 +1638,8 @@ namespace SimpleTypes std::wstring m_sIdX; // Значение для типа Formula иди AdjValue std::wstring m_sIdY; // - double m_dX; // Значение для типа Constant - double m_dY; // + double m_dX; // Значение для типа Constant + double m_dY; // }; //-------------------------------------------------------------------------------- @@ -1788,8 +1787,8 @@ namespace SimpleTypes SimpleTypes_DefaultString(CVml_TextBoxInset) - private: - double m_dLeft; + private: + double m_dLeft; double m_dTop; double m_dRight; double m_dBottom; diff --git a/OOXML/PPTXFormat/DrawingConverter/ASCOfficeDrawingConverter.cpp b/OOXML/PPTXFormat/DrawingConverter/ASCOfficeDrawingConverter.cpp index 1df5b6c73d..cf0544e6b3 100644 --- a/OOXML/PPTXFormat/DrawingConverter/ASCOfficeDrawingConverter.cpp +++ b/OOXML/PPTXFormat/DrawingConverter/ASCOfficeDrawingConverter.cpp @@ -2845,7 +2845,7 @@ void CDrawingConverter::ConvertShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::CX { pCNvPr->hidden = true; } - + CSpTreeElemProps oProps; oProps.IsTop = bIsTop; std::wstring strMainPos = GetDrawingMainProps(oNodeShape, oCSSParser, oProps); @@ -2986,6 +2986,7 @@ void CDrawingConverter::ConvertShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::CX CheckBrushShape(elem, oNodeShape, pPPTShape); CheckBorderShape(elem, oNodeShape, pPPTShape); + } } void CDrawingConverter::ConvertWordArtShape(PPTX::Logic::SpTreeElem* elem, XmlUtils::CXmlNode& oNodeShape, CPPTShape* pPPTShape) @@ -4548,8 +4549,14 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P oWriter.EndNode(L"wp14:pctHeight"); oWriter.EndNode(L"wp14:sizeRelV"); } + nullable_string alt_content; + XmlMacroReadAttributeBase(oNode, L"alt", alt_content); - std::wstring strId = L"