diff options
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()); -} |