diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-10-04 00:26:17 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-04 00:26:17 +0000 |
commit | 912f2d154162cef0dcb59f030a45b1f4f024f78a (patch) | |
tree | 035caa58cdc7154f75ea9778fc027d95eec85449 /core/fpdfdoc/cpdf_pagelabel.cpp | |
parent | 80482dc264c537945f95b0419ba4f9a70d6ae4cd (diff) | |
download | pdfium-912f2d154162cef0dcb59f030a45b1f4f024f78a.tar.xz |
Remove several more unused methods from core/
Change-Id: I891add4e91c7ee58b34974fed6d73d17c297e759
Reviewed-on: https://pdfium-review.googlesource.com/c/43459
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpdf_pagelabel.cpp')
-rw-r--r-- | core/fpdfdoc/cpdf_pagelabel.cpp | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/core/fpdfdoc/cpdf_pagelabel.cpp b/core/fpdfdoc/cpdf_pagelabel.cpp index d6f9220c26..b622073d9f 100644 --- a/core/fpdfdoc/cpdf_pagelabel.cpp +++ b/core/fpdfdoc/cpdf_pagelabel.cpp @@ -120,28 +120,3 @@ Optional<WideString> CPDF_PageLabel::GetLabel(int nPage) const { label = WideString::Format(L"%d", nPage + 1); return {label}; } - -int32_t CPDF_PageLabel::GetPageByLabel(const ByteStringView& bsLabel) const { - if (!m_pDocument) - return -1; - - const CPDF_Dictionary* pPDFRoot = m_pDocument->GetRoot(); - if (!pPDFRoot) - return -1; - - int nPages = m_pDocument->GetPageCount(); - for (int i = 0; i < nPages; i++) { - Optional<WideString> str = GetLabel(i); - if (!str.has_value()) - continue; - if (PDF_EncodeText(str.value()).Compare(bsLabel)) - return i; - } - - int nPage = FXSYS_atoi(ByteString(bsLabel).c_str()); // NUL terminate. - return nPage > 0 && nPage <= nPages ? nPage : -1; -} - -int32_t CPDF_PageLabel::GetPageByLabel(const WideStringView& wsLabel) const { - return GetPageByLabel(PDF_EncodeText(WideString(wsLabel)).AsStringView()); -} |