summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2018-08-07 10:16:58 +0200
committerMichal Klocek <michal.klocek@qt.io>2018-08-09 09:40:02 +0000
commit3b5c6f13348e6ed5eaecc4cec3d88f2089c819e6 (patch)
tree1c4c848b551655705c8a056a017910ad7417db02 /src
parentdb62139e1daea171e08d95592c63f663789d6391 (diff)
Fix bogus QT_CONFIG usage for printing
If webengine-printing-and-pdf is disabled we do not compile print_view_manager_qt, therefore print_view_manager_qt.h should never be included. Add missing QT_CONFIG check in web_contents_adapter instead. Change-Id: Ib0477c1f12025cd60ee9799ac06a6b664c65018c Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/core/printing/print_view_manager_qt.cpp3
-rw-r--r--src/core/printing/print_view_manager_qt.h7
-rw-r--r--src/core/web_contents_adapter.cpp2
3 files changed, 3 insertions, 9 deletions
diff --git a/src/core/printing/print_view_manager_qt.cpp b/src/core/printing/print_view_manager_qt.cpp
index fffc91631..508042e48 100644
--- a/src/core/printing/print_view_manager_qt.cpp
+++ b/src/core/printing/print_view_manager_qt.cpp
@@ -214,7 +214,6 @@ PrintViewManagerQt::~PrintViewManagerQt()
{
}
-#if QT_CONFIG(webengine_printing_and_pdf)
void PrintViewManagerQt::PrintToPDFFileWithCallback(const QPageLayout &pageLayout,
bool printInColor,
const QString &filePath,
@@ -294,8 +293,6 @@ bool PrintViewManagerQt::PrintToPDFInternal(const QPageLayout &pageLayout,
return true;
}
-#endif // QT_CONFIG(webengine_printing_and_pdf)
-
// PrintedPagesSource implementation.
base::string16 PrintViewManagerQt::RenderSourceName()
{
diff --git a/src/core/printing/print_view_manager_qt.h b/src/core/printing/print_view_manager_qt.h
index c71ec4a61..ae96b72af 100644
--- a/src/core/printing/print_view_manager_qt.h
+++ b/src/core/printing/print_view_manager_qt.h
@@ -85,7 +85,7 @@ public:
~PrintViewManagerQt() override;
typedef base::Callback<void(const std::vector<char> &result)> PrintToPDFCallback;
typedef base::Callback<void(bool success)> PrintToPDFFileCallback;
-#if QT_CONFIG(webengine_printing_and_pdf)
+
// Method to print a page to a Pdf document with page size \a pageSize in location \a filePath.
void PrintToPDFFileWithCallback(const QPageLayout &pageLayout,
bool printInColor,
@@ -95,7 +95,6 @@ public:
bool printInColor,
bool useCustomMargins,
const PrintToPDFCallback &callback);
-#endif // QT_CONFIG(webengine_printing_and_pdf)
base::string16 RenderSourceName() override;
@@ -123,11 +122,7 @@ protected:
void OnDidPreviewPage(const PrintHostMsg_DidPreviewPage_Params& params);
void OnShowScriptedPrintPreview(content::RenderFrameHost* rfh,
bool source_is_modifiable);
-
-
-#if QT_CONFIG(webengine_printing_and_pdf)
bool PrintToPDFInternal(const QPageLayout &, bool printInColor, bool useCustomMargins = true);
-#endif
private:
void resetPdfState();
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index e65ab9d07..84b97412b 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -49,7 +49,9 @@
#include "devtools_frontend_qt.h"
#include "download_manager_delegate_qt.h"
#include "media_capture_devices_dispatcher.h"
+#if QT_CONFIG(webengine_printing_and_pdf)
#include "printing/print_view_manager_qt.h"
+#endif
#include "profile_qt.h"
#include "qwebenginecallback_p.h"
#include "render_view_observer_host_qt.h"