Skip to content

Commit c091eb3

Browse files
author
Michal Klocek
committed
Add missing check for use_cups
Compiling printing_context_mac.mm requires cups. Task-number: QTBUG-120248 Task-number: QTBUG-122407 Change-Id: Iee59bc96f5a7ee1151daed5ca3c10eb06d051b7b Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/583113 Reviewed-by: Michael Brüning <[email protected]>
1 parent 9eb5f1c commit c091eb3

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

chromium/printing/printing_context_mac.mm

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
#import <AppKit/AppKit.h>
88
#include <CoreFoundation/CoreFoundation.h>
99
#import <QuartzCore/QuartzCore.h>
10+
#if BUILDFLAG(USE_CUPS)
1011
#include <cups/cups.h>
11-
12+
#endif
1213
#import <iomanip>
1314
#import <numeric>
1415

@@ -26,7 +27,9 @@
2627
#include "printing/buildflags/buildflags.h"
2728
#include "printing/metafile.h"
2829
#include "printing/mojom/print.mojom.h"
30+
#if BUILDFLAG(USE_CUPS)
2931
#include "printing/print_job_constants_cups.h"
32+
#endif
3033
#include "printing/print_settings_initializer_mac.h"
3134
#include "printing/printing_features.h"
3235
#include "printing/units.h"
@@ -96,6 +99,7 @@ PMPaper MatchPaper(CFArrayRef paper_list,
9699
return best_matching_paper;
97100
}
98101

102+
#if BUILDFLAG(USE_CUPS)
99103
bool IsIppColorModelColorful(mojom::ColorModel color_model) {
100104
// Accept `kUnknownColorModel` as it can occur with raw CUPS printers.
101105
// Treat it similarly to the behavior in `GetColorModelForModel()`.
@@ -104,6 +108,7 @@ bool IsIppColorModelColorful(mojom::ColorModel color_model) {
104108
}
105109
return IsColorModelSelected(color_model).value();
106110
}
111+
#endif
107112

108113
#if BUILDFLAG(ENABLE_OOP_PRINTING_NO_OOP_BASIC_PRINT_DIALOG)
109114

@@ -685,8 +690,10 @@ void ApplySystemPrintDialogData(
685690
}
686691

687692
bool PrintingContextMac::SetOutputColor(int color_mode) {
693+
#if !BUILDFLAG(USE_CUPS)
694+
return false;
695+
#else
688696
const mojom::ColorModel color_model = ColorModeToColorModel(color_mode);
689-
690697
if (!base::FeatureList::IsEnabled(features::kCupsIppPrintingBackend)) {
691698
std::string color_setting_name;
692699
std::string color_value;
@@ -714,6 +721,7 @@ void ApplySystemPrintDialogData(
714721
}
715722

716723
return true;
724+
#endif // BUILDFLAG(USE_CUPS)
717725
}
718726

719727
bool PrintingContextMac::SetResolution(const gfx::Size& dpi_size) {

0 commit comments

Comments
 (0)