summaryrefslogtreecommitdiff
path: root/vcl/source/graphic
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-04-07 20:47:00 +0200
committerMiklos Vajna <vmiklos@collabora.com>2021-04-08 10:08:42 +0200
commitfaf3f18bdc89cc5e04abdefcb12d63e6ef796396 (patch)
tree576123e13d99c3cde210aba2d5a76bade24d3ca5 /vcl/source/graphic
parentd9e0d49434c216d8f24a7f8e696286298d96b568 (diff)
vcl VectorGraphicSearch: clean up not needed HAVE_FEATURE_PDFIUM ifdefs
Towards completely avoiding the HAVE_FEATURE_PDFIUM ifdef forest. Change-Id: I38f138d7b7602cd0bd676d2e4f859b0bb5f051e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113772 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'vcl/source/graphic')
-rw-r--r--vcl/source/graphic/VectorGraphicSearch.cxx56
1 files changed, 10 insertions, 46 deletions
diff --git a/vcl/source/graphic/VectorGraphicSearch.cxx b/vcl/source/graphic/VectorGraphicSearch.cxx
index 14e67e0b7138..710c6e5f52e6 100644
--- a/vcl/source/graphic/VectorGraphicSearch.cxx
+++ b/vcl/source/graphic/VectorGraphicSearch.cxx
@@ -10,18 +10,11 @@
#include <vcl/VectorGraphicSearch.hxx>
-#include <config_features.h>
-
-#if HAVE_FEATURE_PDFIUM
-
#include <vcl/filter/PDFiumLibrary.hxx>
#include <tools/UnitConversion.hxx>
#include <sal/config.h>
-#include <fpdf_doc.h>
-#include <fpdf_text.h>
-
namespace
{
class SearchContext
@@ -209,6 +202,11 @@ VectorGraphicSearch::~VectorGraphicSearch() { mpImplementation.reset(); }
bool VectorGraphicSearch::search(OUString const& rSearchString,
VectorGraphicSearchOptions const& rOptions)
{
+ if (!mpImplementation->mpPDFium)
+ {
+ return false;
+ }
+
if (!mpImplementation->mpSearchContext)
{
auto pData = maGraphic.getVectorGraphicData();
@@ -227,6 +225,11 @@ bool VectorGraphicSearch::search(OUString const& rSearchString,
bool VectorGraphicSearch::searchPDF(std::shared_ptr<VectorGraphicData> const& rData)
{
+ if (!mpImplementation->mpPDFium)
+ {
+ return false;
+ }
+
mpImplementation->mpPdfDocument = mpImplementation->mpPDFium->openDocument(
rData->getBinaryDataContainer().getData(), rData->getBinaryDataContainer().getSize());
@@ -299,43 +302,4 @@ std::vector<basegfx::B2DRectangle> VectorGraphicSearch::getTextRectangles()
return std::vector<basegfx::B2DRectangle>();
}
-#else // !HAVE_FEATURE_PDFIUM
-
-class VectorGraphicSearch::Implementation
-{
-};
-
-VectorGraphicSearch::VectorGraphicSearch(Graphic const& rGraphic)
- : maGraphic(rGraphic)
-{
-}
-
-VectorGraphicSearch::~VectorGraphicSearch() {}
-
-bool VectorGraphicSearch::search(OUString const& /*rSearchString*/,
- VectorGraphicSearchOptions const& /*rOptions*/)
-{
- return false;
-}
-
-bool VectorGraphicSearch::searchPDF(std::shared_ptr<VectorGraphicData> const& /*rData*/)
-{
- return false;
-}
-
-basegfx::B2DSize VectorGraphicSearch::pageSize() { return basegfx::B2DSize(); }
-
-bool VectorGraphicSearch::next() { return false; }
-
-bool VectorGraphicSearch::previous() { return false; }
-
-int VectorGraphicSearch::index() { return -1; }
-
-std::vector<basegfx::B2DRectangle> VectorGraphicSearch::getTextRectangles()
-{
- return std::vector<basegfx::B2DRectangle>();
-}
-
-#endif // HAVE_FEATURE_PDFIUM
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */