diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2018-05-18 09:15:36 -0400 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-06-07 10:45:31 +0200 |
commit | 80ae4c7a2a6ff336e3bb7462d62fe01b5cb514b8 (patch) | |
tree | dd3ba086583df4dde32c299786c35522f43d694e /external | |
parent | 3e3f4a7240e2e1fd041f68246171f34ce950311f (diff) |
svx: cleanup pdfium importer
Change-Id: Id925ba7734a2c73270e40f19d3fc50552441c34e
Diffstat (limited to 'external')
-rw-r--r-- | external/pdfium/0013-svx-cleanup-pdfium-importer.patch.2 | 130 | ||||
-rw-r--r-- | external/pdfium/UnpackedTarball_pdfium.mk | 1 |
2 files changed, 131 insertions, 0 deletions
diff --git a/external/pdfium/0013-svx-cleanup-pdfium-importer.patch.2 b/external/pdfium/0013-svx-cleanup-pdfium-importer.patch.2 new file mode 100644 index 000000000000..91fb38d2825b --- /dev/null +++ b/external/pdfium/0013-svx-cleanup-pdfium-importer.patch.2 @@ -0,0 +1,130 @@ +From 2f56db06360e547f995c6b20050974d5f4c6f7c6 Mon Sep 17 00:00:00 2001 +From: Ashod Nakashian <ashod.nakashian@collabora.co.uk> +Date: Tue, 5 Jun 2018 11:36:05 +0200 +Subject: [PATCH 13/14] svx: cleanup pdfium importer + +--- + pdfium/core/fpdfapi/page/cpdf_imageobject.cpp | 1 - + pdfium/core/fpdfapi/page/cpdf_page.cpp | 3 --- + pdfium/core/fpdfapi/page/cpdf_pageobject.cpp | 2 -- + pdfium/core/fpdfapi/render/cpdf_renderstatus.cpp | 1 - + pdfium/core/fxge/cfx_pathdata.cpp | 2 -- + pdfium/fpdfsdk/fpdf_editpage.cpp | 12 ------------ + 6 files changed, 21 deletions(-) + +diff --git a/pdfium/core/fpdfapi/page/cpdf_imageobject.cpp b/pdfium/core/fpdfapi/page/cpdf_imageobject.cpp +index 416d82d..3b5a740 100644 +--- a/pdfium/core/fpdfapi/page/cpdf_imageobject.cpp ++++ b/pdfium/core/fpdfapi/page/cpdf_imageobject.cpp +@@ -43,7 +43,6 @@ const CPDF_ImageObject* CPDF_ImageObject::AsImage() const { + void CPDF_ImageObject::CalcBoundingBox() { + std::tie(m_Left, m_Right, m_Top, m_Bottom) = + m_Matrix.TransformRect(0.f, 1.f, 1.f, 0.f); +- // fprintf(stderr, "Image BB: %f, %f, %f, %f\n", m_Left, m_Right, m_Top, m_Bottom); + } + + void CPDF_ImageObject::SetImage(const RetainPtr<CPDF_Image>& pImage) { +diff --git a/pdfium/core/fpdfapi/page/cpdf_page.cpp b/pdfium/core/fpdfapi/page/cpdf_page.cpp +index 00657d6..eee6673 100644 +--- a/pdfium/core/fpdfapi/page/cpdf_page.cpp ++++ b/pdfium/core/fpdfapi/page/cpdf_page.cpp +@@ -37,14 +37,12 @@ CPDF_Page::CPDF_Page(CPDF_Document* pDocument, + CFX_FloatRect mediabox = GetBox("MediaBox"); + if (mediabox.IsEmpty()) + mediabox = CFX_FloatRect(0, 0, 612, 792); +- fprintf(stderr, "Page mediabox: %f, %f, %f, %f\n", mediabox.left, mediabox.right, mediabox.top, mediabox.bottom); + + m_BBox = GetBox("CropBox"); + if (m_BBox.IsEmpty()) + m_BBox = mediabox; + else + m_BBox.Intersect(mediabox); +- fprintf(stderr, "Page cropbox: %f, %f, %f, %f\n", m_BBox.left, m_BBox.right, m_BBox.top, m_BBox.bottom); + + m_PageSize.width = m_BBox.Width(); + m_PageSize.height = m_BBox.Height(); +@@ -52,7 +50,6 @@ CPDF_Page::CPDF_Page(CPDF_Document* pDocument, + int rotate = GetPageRotation(); + if (rotate % 2) + std::swap(m_PageSize.width, m_PageSize.height); +- fprintf(stderr, "Page rotate: %d, Page Width: %f, Page Height: %f\n", rotate, m_PageSize.width, m_PageSize.height); + + switch (rotate) { + case 0: +diff --git a/pdfium/core/fpdfapi/page/cpdf_pageobject.cpp b/pdfium/core/fpdfapi/page/cpdf_pageobject.cpp +index 9b5e2ce..8bb5bf5 100644 +--- a/pdfium/core/fpdfapi/page/cpdf_pageobject.cpp ++++ b/pdfium/core/fpdfapi/page/cpdf_pageobject.cpp +@@ -98,7 +98,5 @@ FX_RECT CPDF_PageObject::GetBBox(const CFX_Matrix* pMatrix) const { + if (pMatrix) + rect = pMatrix->TransformRect(rect); + +- FX_RECT rc = rect.GetOuterRect(); +- fprintf(stderr, "PageObject BB: %f, %f, %f, %f\n", rc.left, rc.right, rc.top, rc.bottom); + return rect.GetOuterRect(); + } +diff --git a/pdfium/core/fpdfapi/render/cpdf_renderstatus.cpp b/pdfium/core/fpdfapi/render/cpdf_renderstatus.cpp +index bf82d55..565be85 100644 +--- a/pdfium/core/fpdfapi/render/cpdf_renderstatus.cpp ++++ b/pdfium/core/fpdfapi/render/cpdf_renderstatus.cpp +@@ -1767,7 +1767,6 @@ bool CPDF_RenderStatus::ProcessText(CPDF_TextObject* textobj, + return true; + + float font_size = textobj->m_TextState.GetFontSize(); +-// fprintf(stderr, "Font size: %f, matrix a: %f, b: %f, c: %f, d: %f, e: %f, f: %f\n", font_size, text_matrix.a, text_matrix.b, text_matrix.c, text_matrix.d, text_matrix.e, text_matrix.f); + if (bPattern) { + DrawTextPathWithPattern(textobj, pObj2Device, pFont, font_size, + &text_matrix, bFill, bStroke); +diff --git a/pdfium/core/fxge/cfx_pathdata.cpp b/pdfium/core/fxge/cfx_pathdata.cpp +index 13e2cdb..ac1ff42 100644 +--- a/pdfium/core/fxge/cfx_pathdata.cpp ++++ b/pdfium/core/fxge/cfx_pathdata.cpp +@@ -199,7 +199,6 @@ void CFX_PathData::Append(const CFX_PathData* pSrc, const CFX_Matrix* pMatrix) { + void CFX_PathData::AppendPoint(const CFX_PointF& point, + FXPT_TYPE type, + bool closeFigure) { +-// fprintf(stderr, "Append: %f, %f (%s)\n", point.x, point.y, closeFigure ? "CLOSE" : "OPEN"); + m_Points.push_back(FX_PATHPOINT(point, type, closeFigure)); + } + +@@ -295,7 +294,6 @@ CFX_FloatRect CFX_PathData::GetBoundingBox(float line_width, + void CFX_PathData::Transform(const CFX_Matrix* pMatrix) { + if (!pMatrix) + return; +-// fprintf(stderr, "XForm: %f, %f %f, %f, %f, %f\n", pMatrix->a, pMatrix->b, pMatrix->c, pMatrix->d, pMatrix->e, pMatrix->f); + for (auto& point : m_Points) + point.m_Point = pMatrix->Transform(point.m_Point); + } +diff --git a/pdfium/fpdfsdk/fpdf_editpage.cpp b/pdfium/fpdfsdk/fpdf_editpage.cpp +index f34d3b5..29c8b01 100644 +--- a/pdfium/fpdfsdk/fpdf_editpage.cpp ++++ b/pdfium/fpdfsdk/fpdf_editpage.cpp +@@ -711,17 +711,6 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFTextObj_GetText(FPDF_PAGEOBJECT text_object, + str += pFont->UnicodeFromCharCode(charcode); + } + +-// CFX_WideTextBuf m_TextBuf; +-// WideString str = textpage->GetPageText(char_start, char_count); +-// return WideString(m_TextBuf.AsStringView().Mid( +-// static_cast<size_t>(text_start), static_cast<size_t>(text_count))); +- +-// if (str.GetLength() > static_cast<size_t>(char_count)) +-// str = str.Left(static_cast<size_t>(char_count)); +- +- // Reincode in UTF-16. +-// WideString str = text.UTF8Decode(); +- + // UFT16LE_Encode doesn't handle surrogate pairs properly, so it is expected + // the number of items to stay the same. + ByteString byte_str = str.UTF16LE_Encode(); +@@ -843,7 +832,6 @@ FPDFFormObj_GetSubObject(FPDF_PAGEOBJECT form_object, int index) + if (pFrmObj) + { + const CFX_Matrix& matrix = pFrmObj->form_matrix(); +- fprintf(stderr, "Form matrix a: %f, b: %f, c: %f, d: %f, e: %f, f: %f\n", matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f); + const CPDF_PageObjectList* pObjectList = pFrmObj->form()->GetPageObjectList(); + if (pObjectList) + return pObjectList->GetPageObjectByIndex(index); +-- +2.16.3 + diff --git a/external/pdfium/UnpackedTarball_pdfium.mk b/external/pdfium/UnpackedTarball_pdfium.mk index 5525e9ddf65d..333150d016a0 100644 --- a/external/pdfium/UnpackedTarball_pdfium.mk +++ b/external/pdfium/UnpackedTarball_pdfium.mk @@ -26,6 +26,7 @@ pdfium_patches += 0009-svx-support-color-text-for-imported-PDFs.patch.2 pdfium_patches += 0010-svx-support-importing-forms-from-PDFs.patch.2 pdfium_patches += 0011-svx-correctly-possition-form-objects-from-PDF.patch.2 pdfium_patches += 0012-svx-import-processed-PDF-text.patch.2 +pdfium_patches += 0013-svx-cleanup-pdfium-importer.patch.2 $(eval $(call gb_UnpackedTarball_UnpackedTarball,pdfium)) |