From 27abb730b290f3516582d2d787ef64af76663f97 Mon Sep 17 00:00:00 2001 From: Tomas Chvatal Date: Mon, 7 May 2012 13:46:09 +0200 Subject: Enable configure switch for cups This allows us not to have cups during the build time of libreoffice. Commit is inspired from patch from Dave Flogeras . Change-Id: I I32a14eb6e7bdd13de1a737d4798c852a830ae326 --- vcl/Library_vcl.mk | 9 +++++++-- vcl/null/printerinfomanager.cxx | 10 ++++++++++ vcl/unx/generic/printer/ppdparser.cxx | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) (limited to 'vcl') diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 9a259c3d8eea..a5b1848c8c47 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -445,10 +445,15 @@ $(eval $(call gb_Library_add_defs,vcl,\ $(eval $(call gb_Library_add_exception_objects,vcl,\ $(vcl_generic_code) \ vcl/unx/generic/plugadapt/salplug \ - vcl/unx/generic/printer/cupsmgr \ vcl/unx/generic/printer/jobdata \ vcl/unx/generic/printer/ppdparser \ - vcl/unx/generic/printer/printerinfomanager \ + $(if $(filter YES,$(ENABLE_CUPS)),\ + vcl/unx/generic/printer/cupsmgr \ + vcl/unx/generic/printer/printerinfomanager \ + ) \ + $(if $(filter NO,$(ENABLE_CUPS)),\ + vcl/null/printerinfomanager \ + ) \ )) $(eval $(call gb_Library_use_externals,vcl,\ fontconfig \ diff --git a/vcl/null/printerinfomanager.cxx b/vcl/null/printerinfomanager.cxx index 526a9362c05a..d606c41d78dd 100644 --- a/vcl/null/printerinfomanager.cxx +++ b/vcl/null/printerinfomanager.cxx @@ -84,6 +84,16 @@ void PrinterInfoManager::initialize() // ??? } +bool PrinterInfoManager::isCUPSDisabled() const +{ + return m_bDisableCUPS; +} + +void PrinterInfoManager::setCUPSDisabled( bool bDisable ) +{ + // cups is already disabled in config so do nothing +} + void PrinterInfoManager::listPrinters( ::std::list< OUString >& rList ) const { rList.clear(); diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx index e5553961b166..9acee5658a2b 100644 --- a/vcl/unx/generic/printer/ppdparser.cxx +++ b/vcl/unx/generic/printer/ppdparser.cxx @@ -655,7 +655,7 @@ const PPDParser* PPDParser::getParser( const String& rFile ) PrinterInfoManager& rMgr = PrinterInfoManager::get(); if( rMgr.getType() == PrinterInfoManager::CUPS ) { -#if !defined(ANDROID) && !defined(LIBO_HEADLESS) +#if defined HAVE_CUPS_H pNewParser = const_cast(static_cast(rMgr).createCUPSParser( aFile )); #endif } -- cgit