diff options
-rw-r--r-- | build/standalone.gypi | 1 | ||||
-rw-r--r-- | fpdfsdk/src/fpdfview.cpp | 64 | ||||
-rw-r--r-- | xfa/src/fxfa/src/parser/xfa_parser_imp.cpp | 5 |
3 files changed, 6 insertions, 64 deletions
diff --git a/build/standalone.gypi b/build/standalone.gypi index f118e3003e..364c8d86f9 100644 --- a/build/standalone.gypi +++ b/build/standalone.gypi @@ -82,6 +82,7 @@ '-fdata-sections', '-ffunction-sections', ], + 'defines': ['_DEBUG=1',], 'msvs_settings': { 'VCCLCompilerTool': { 'Optimization': '0', diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp index 418d35d720..a535866889 100644 --- a/fpdfsdk/src/fpdfview.cpp +++ b/fpdfsdk/src/fpdfview.cpp @@ -519,10 +519,6 @@ void DropContext(void* data) { delete (CRenderContext*)data; } -#if defined(_DEBUG) || defined(DEBUG) -#define DEBUG_TRACE -#endif - #if defined(_WIN32) DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, @@ -539,7 +535,7 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, CRenderContext* pContext = new CRenderContext; pPage->SetPrivateData((void*)1, pContext, DropContext); -#ifndef _WIN32_WCE +#if !defined(_WIN32_WCE) CFX_DIBitmap* pBitmap = nullptr; FX_BOOL bBackgroundAlphaNeeded = pPage->BackgroundAlphaNeeded(); FX_BOOL bHasImageMask = pPage->HasImageMask(); @@ -591,16 +587,6 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, int width = rect.right - rect.left; int height = rect.bottom - rect.top; -#ifdef DEBUG_TRACE - { - char str[128]; - memset(str, 0, sizeof(str)); - FXSYS_snprintf(str, sizeof(str) - 1, "Rendering DIB %d x %d", width, - height); - CPDF_ModuleMgr::Get()->ReportError(999, str); - } -#endif - // Create a DIB section LPVOID pBuffer; BITMAPINFOHEADER bmih; @@ -612,78 +598,34 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, bmih.biWidth = width; pContext->m_hBitmap = CreateDIBSection(dc, (BITMAPINFO*)&bmih, DIB_RGB_COLORS, &pBuffer, NULL, 0); - if (!pContext->m_hBitmap) { -#if defined(DEBUG) || defined(_DEBUG) - char str[128]; - memset(str, 0, sizeof(str)); - FXSYS_snprintf(str, sizeof(str) - 1, - "Error CreateDIBSection: %d x %d, error code = %d", width, - height, GetLastError()); - CPDF_ModuleMgr::Get()->ReportError(FPDFERR_OUT_OF_MEMORY, str); -#else - CPDF_ModuleMgr::Get()->ReportError(FPDFERR_OUT_OF_MEMORY, NULL); -#endif - } FXSYS_memset(pBuffer, 0xff, height * ((width * 3 + 3) / 4 * 4)); -#ifdef DEBUG_TRACE - { CPDF_ModuleMgr::Get()->ReportError(999, "DIBSection created"); } -#endif - // Create a device with this external buffer pContext->m_pBitmap = new CFX_DIBitmap; pContext->m_pBitmap->Create(width, height, FXDIB_Rgb, (uint8_t*)pBuffer); pContext->m_pDevice = new CPDF_FxgeDevice; ((CPDF_FxgeDevice*)pContext->m_pDevice)->Attach(pContext->m_pBitmap); -#ifdef DEBUG_TRACE - CPDF_ModuleMgr::Get()->ReportError(999, "Ready for PDF rendering"); -#endif - // output to bitmap device FPDF_RenderPage_Retail(pContext, page, start_x - rect.left, start_y - rect.top, size_x, size_y, rotate, flags); -#ifdef DEBUG_TRACE - CPDF_ModuleMgr::Get()->ReportError(999, "Finished PDF rendering"); -#endif - // Now output to real device HDC hMemDC = CreateCompatibleDC(dc); - if (!hMemDC) { -#if defined(DEBUG) || defined(_DEBUG) - char str[128]; - memset(str, 0, sizeof(str)); - FXSYS_snprintf(str, sizeof(str) - 1, - "Error CreateCompatibleDC. Error code = %d", GetLastError()); - CPDF_ModuleMgr::Get()->ReportError(FPDFERR_OUT_OF_MEMORY, str); -#else - CPDF_ModuleMgr::Get()->ReportError(FPDFERR_OUT_OF_MEMORY, NULL); -#endif - } - HGDIOBJ hOldBitmap = SelectObject(hMemDC, pContext->m_hBitmap); -#ifdef DEBUG_TRACE - CPDF_ModuleMgr::Get()->ReportError(999, "Ready for screen rendering"); -#endif - BitBlt(dc, rect.left, rect.top, width, height, hMemDC, 0, 0, SRCCOPY); SelectObject(hMemDC, hOldBitmap); DeleteDC(hMemDC); -#ifdef DEBUG_TRACE - CPDF_ModuleMgr::Get()->ReportError(999, "Finished screen rendering"); -#endif - -#endif +#endif // !defined(_WIN32_WCE) if (bBackgroundAlphaNeeded || bHasImageMask) delete pBitmap; delete pContext; pPage->RemovePrivateData((void*)1); } -#endif +#endif // defined(_WIN32) DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, FPDF_PAGE page, diff --git a/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp b/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp index b774c46517..01b12d5cae 100644 --- a/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp @@ -962,15 +962,13 @@ void XFA_ConvertRichTextToPlainText(IFDE_XMLElement* pRichTextXMLNode, wsOutput = wsPlainTextBuf.GetWideString(); } #endif + void XFA_ConvertXMLToPlainText(IFDE_XMLElement* pRootXMLNode, CFX_WideString& wsOutput) { for (IFDE_XMLNode* pXMLChild = pRootXMLNode->GetNodeItem(IFDE_XMLNode::FirstChild); pXMLChild; pXMLChild = pXMLChild->GetNodeItem(IFDE_XMLNode::NextSibling)) { -#ifdef _DEBUG - FDE_XMLNODETYPE nodeType = pXMLChild->GetType(); -#endif switch (pXMLChild->GetType()) { case FDE_XMLNODE_Element: { CFX_WideString wsTextData; @@ -1002,6 +1000,7 @@ void XFA_ConvertXMLToPlainText(IFDE_XMLElement* pRootXMLNode, } } } + void CXFA_SimpleParser::ParseContentNode(CXFA_Node* pXFANode, IFDE_XMLNode* pXMLNode, XFA_XDPPACKET ePacketID) { |