Skip to content

Commit 98bd931

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]> (cherry picked from commit c091eb3) Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/583816
1 parent de88aea commit 98bd931

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

@@ -25,7 +26,9 @@
2526
#include "printing/buildflags/buildflags.h"
2627
#include "printing/metafile.h"
2728
#include "printing/mojom/print.mojom.h"
29+
#if BUILDFLAG(USE_CUPS)
2830
#include "printing/print_job_constants_cups.h"
31+
#endif
2932
#include "printing/print_settings_initializer_mac.h"
3033
#include "printing/printing_features.h"
3134
#include "printing/units.h"
@@ -82,6 +85,7 @@ PMPaper MatchPaper(CFArrayRef paper_list,
8285
return best_matching_paper;
8386
}
8487

88+
#if BUILDFLAG(USE_CUPS)
8589
bool IsIppColorModelColorful(mojom::ColorModel color_model) {
8690
// Accept `kUnknownColorModel` as it can occur with raw CUPS printers.
8791
// Treat it similarly to the behavior in `GetColorModelForModel()`.
@@ -90,6 +94,7 @@ bool IsIppColorModelColorful(mojom::ColorModel color_model) {
9094
}
9195
return IsColorModelSelected(color_model).value();
9296
}
97+
#endif
9398

9499
#if BUILDFLAG(ENABLE_OOP_PRINTING_NO_OOP_BASIC_PRINT_DIALOG)
95100

@@ -672,8 +677,10 @@ void ApplySystemPrintDialogData(
672677
}
673678

674679
bool PrintingContextMac::SetOutputColor(int color_mode) {
680+
#if !BUILDFLAG(USE_CUPS)
681+
return false;
682+
#else
675683
const mojom::ColorModel color_model = ColorModeToColorModel(color_mode);
676-
677684
if (!base::FeatureList::IsEnabled(features::kCupsIppPrintingBackend)) {
678685
std::string color_setting_name;
679686
std::string color_value;
@@ -701,6 +708,7 @@ void ApplySystemPrintDialogData(
701708
}
702709

703710
return true;
711+
#endif // BUILDFLAG(USE_CUPS)
704712
}
705713

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

0 commit comments

Comments
 (0)