/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. *
*/
mpPage = mpPdfDocument->openPage(mnPageIndex); if (!mpPage) returnfalse;
mpTextPage = mpPage->getTextPage(); if (!mpTextPage) returnfalse;
// Index where to start to search. -1 => at the end int nStartIndex = maOptions.meStartPosition == SearchStartPosition::End ? -1 : 0;
if (mnCurrentIndex >= 0)
nStartIndex = mnCurrentIndex;
// vcl::pdf::PDFFindFlags::MatchCase, vcl::pdf::PDFFindFlags::MatchWholeWord, vcl::pdf::PDFFindFlags::Consecutive // vcl::pdf::PDFFindFlags::MatchCase - If not set, it will not match case by default. // vcl::pdf::PDFFindFlags::MatchWholeWord - If not set, it will not match the whole word by default. // vcl::pdf::PDFFindFlags::Consecutive - If not set, it will skip past the current match to look for the next match.
vcl::pdf::PDFFindFlags nSearchFlags{}; if (maOptions.mbMatchCase)
nSearchFlags |= vcl::pdf::PDFFindFlags::MatchCase; if (maOptions.mbMatchWholeWord)
nSearchFlags |= vcl::pdf::PDFFindFlags::MatchWholeWord;
if (!mpImplementation->mpPdfDocument)
{ //TODO: Handle failure to load. switch (mpImplementation->mpPDFium->getLastErrorCode())
{ case vcl::pdf::PDFErrorType::Success: break; case vcl::pdf::PDFErrorType::Unknown: break; case vcl::pdf::PDFErrorType::File: break; case vcl::pdf::PDFErrorType::Format: break; case vcl::pdf::PDFErrorType::Password: break; case vcl::pdf::PDFErrorType::Security: break; case vcl::pdf::PDFErrorType::Page: break; default: break;
} returnfalse;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.