From 34f36cefc3d780930eb8cc3f9ff646da5ae41f99 Mon Sep 17 00:00:00 2001 From: Svetlana Kulikova Date: Tue, 1 Apr 2025 10:07:16 +0300 Subject: [PATCH] Delete apValue --- .../graphics/pro/js/wasm/src/drawingfile_test.cpp | 12 +----------- PdfFile/SrcReader/Adaptors.cpp | 12 ------------ PdfFile/SrcReader/Adaptors.h | 6 +----- PdfFile/SrcReader/PdfAnnot.cpp | 12 +----------- PdfFile/SrcReader/PdfAnnot.h | 1 - PdfFile/SrcReader/RendererOutputDev.cpp | 2 -- 6 files changed, 3 insertions(+), 42 deletions(-) diff --git a/DesktopEditor/graphics/pro/js/wasm/src/drawingfile_test.cpp b/DesktopEditor/graphics/pro/js/wasm/src/drawingfile_test.cpp index edcde6d46c..6324203b62 100644 --- a/DesktopEditor/graphics/pro/js/wasm/src/drawingfile_test.cpp +++ b/DesktopEditor/graphics/pro/js/wasm/src/drawingfile_test.cpp @@ -840,17 +840,7 @@ void ReadAnnotAP(BYTE* pWidgetsAP, int& i) i += 1; std::string arrBlendMode[] = { "Normal", "Multiply", "Screen", "Overlay", "Darken", "Lighten", "ColorDodge", "ColorBurn", "HardLight", "SoftLight", "Difference", "Exclusion", "Hue", "Saturation", "Color", "Luminosity" }; - std::cout << "Type " << arrBlendMode[nPathLength] << ", "; - - int bText = READ_BYTE(pWidgetsAP + i); - i += 1; - if (bText != 0) - { - nPathLength = READ_INT(pWidgetsAP + i); - i += 4; - std::cout << "Text " << std::string((char*)(pWidgetsAP + i), nPathLength) << ", "; - i += nPathLength; - } + std::cout << "Type " << arrBlendMode[nPathLength]; } std::cout << std::endl; } diff --git a/PdfFile/SrcReader/Adaptors.cpp b/PdfFile/SrcReader/Adaptors.cpp index 1d240b14d2..ad8da8382c 100644 --- a/PdfFile/SrcReader/Adaptors.cpp +++ b/PdfFile/SrcReader/Adaptors.cpp @@ -185,18 +185,6 @@ bool GlobalParamsAdaptor::GetCMap(const char* sName, char*& pData, unsigned int& return false; } -void GlobalParamsAdaptor::ResetTextFormField() -{ - m_sTextFormField.clear(); -} -void GlobalParamsAdaptor::AddTextFormField(const std::wstring& sText) -{ - m_sTextFormField += sText; -} -std::string GlobalParamsAdaptor::GetTextFormField() -{ - return U_TO_UTF8(m_sTextFormField); -} bool operator==(const Ref &a, const Ref &b) { diff --git a/PdfFile/SrcReader/Adaptors.h b/PdfFile/SrcReader/Adaptors.h index 58bff7e978..3eb1247410 100644 --- a/PdfFile/SrcReader/Adaptors.h +++ b/PdfFile/SrcReader/Adaptors.h @@ -59,7 +59,6 @@ class GlobalParamsAdaptor : public GlobalParams BYTE* m_bCMapData; DWORD m_nCMapDataLength; - std::wstring m_sTextFormField; bool m_bDrawFormField; public: @@ -91,10 +90,7 @@ public: void SetCMapMemory(BYTE* pData, DWORD nSizeData); bool GetCMap(const char* sName, char*& pData, unsigned int& nSize); - void ResetTextFormField(); - void AddTextFormField(const std::wstring& sText); - std::string GetTextFormField(); - void setDrawFormField(bool bDrawFormField) { m_bDrawFormField = bDrawFormField; } + void setDrawFormField(bool bDrawFormField) { m_bDrawFormField = bDrawFormField; } bool getDrawFormField() { return m_bDrawFormField; } private: diff --git a/PdfFile/SrcReader/PdfAnnot.cpp b/PdfFile/SrcReader/PdfAnnot.cpp index 7bca8e18f6..e5f3ffb6b6 100644 --- a/PdfFile/SrcReader/PdfAnnot.cpp +++ b/PdfFile/SrcReader/PdfAnnot.cpp @@ -3440,7 +3440,6 @@ void CAnnotAP::Draw(PDFDoc* pdfDoc, Object* oAP, int nRasterH, int nBackgroundCo // Отрисовка внешних видов аннотации AcroFormFieldType oType = pField->getAcroFormFieldType(); ((GlobalParamsAdaptor*)globalParams)->setDrawFormField(true); - ((GlobalParamsAdaptor*)globalParams)->ResetTextFormField(); double dOffsetX = -(m_dx1 - m_dCropX) * m_dWScale + 1 + m_dWTale / 2; double dOffsetY = (m_dy2 - m_dCropY) * m_dHScale - nRasterH + 1 + m_dHTale / 2; @@ -3494,7 +3493,7 @@ void CAnnotAP::Draw(PDFDoc* pdfDoc, Object* oAP, int nRasterH, int nBackgroundCo void CAnnotAP::Draw(PDFDoc* pdfDoc, Object* oAP, int nRasterH, int nBackgroundColor, Object* oAnnotRef, const char* sView) { ((GlobalParamsAdaptor*)globalParams)->setDrawFormField(true); - ((GlobalParamsAdaptor*)globalParams)->ResetTextFormField(); + // Отрисовка внешних видов аннотации Object oAnnot; XRef* xref = pdfDoc->getXRef(); @@ -3551,7 +3550,6 @@ void CAnnotAP::WriteAppearance(unsigned int nColor, CAnnotAPView* pView) } pView->pAP = pSubMatrix; - pView->sText = ((GlobalParamsAdaptor*)globalParams)->GetTextFormField(); } BYTE CAnnotAP::GetBlendMode() { @@ -3584,14 +3582,6 @@ void CAnnotAP::ToWASM(NSWasm::CData& oRes) oRes.AddInt(npSubMatrix >> 32); oRes.WriteBYTE(m_arrAP[i]->nBlendMode); - - if (m_arrAP[i]->sText.empty()) - oRes.WriteBYTE(0); - else - { - oRes.WriteBYTE(1); - oRes.WriteString(m_arrAP[i]->sText); - } } } void CAnnots::ToWASM(NSWasm::CData& oRes) diff --git a/PdfFile/SrcReader/PdfAnnot.h b/PdfFile/SrcReader/PdfAnnot.h index 20c98f3ded..5d176ef7a2 100644 --- a/PdfFile/SrcReader/PdfAnnot.h +++ b/PdfFile/SrcReader/PdfAnnot.h @@ -129,7 +129,6 @@ private: BYTE nBlendMode; std::string sAPName; std::string sASName; - std::string sText; BYTE* pAP; }; diff --git a/PdfFile/SrcReader/RendererOutputDev.cpp b/PdfFile/SrcReader/RendererOutputDev.cpp index e16063c6de..a6fced6987 100644 --- a/PdfFile/SrcReader/RendererOutputDev.cpp +++ b/PdfFile/SrcReader/RendererOutputDev.cpp @@ -2525,8 +2525,6 @@ namespace PdfReader } } } - if (((GlobalParamsAdaptor*)globalParams)->getDrawFormField()) - ((GlobalParamsAdaptor*)globalParams)->AddTextFormField(wsUnicodeText); #endif m_pRenderer->CommandDrawTextEx(wsUnicodeText, &unGid, unGidsCount, PDFCoordsToMM(dShiftX), PDFCoordsToMM(dShiftY), PDFCoordsToMM(dDx), PDFCoordsToMM(dDy)); if (bReplace)