Compare commits

...

3 Commits

Author SHA1 Message Date
Kevin Sawicki
8f487aa2cf Bump v1.4.16 2017-04-05 09:26:24 -07:00
Kevin Sawicki
634eb677c6 Merge pull request #9044 from rreimann/1-4-x
Fix printing selected pages on Windows
2017-04-04 14:26:31 -07:00
rreimann
3d54b23b7a Fix printing selected pages on Windows 2017-03-28 12:21:20 +02:00
8 changed files with 22 additions and 11 deletions

View File

@@ -17,9 +17,9 @@
<key>CFBundleIconFile</key>
<string>electron.icns</string>
<key>CFBundleVersion</key>
<string>1.4.15</string>
<string>1.4.16</string>
<key>CFBundleShortVersionString</key>
<string>1.4.15</string>
<string>1.4.16</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>LSMinimumSystemVersion</key>

View File

@@ -56,8 +56,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,4,15,0
PRODUCTVERSION 1,4,15,0
FILEVERSION 1,4,16,0
PRODUCTVERSION 1,4,16,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -74,12 +74,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "GitHub, Inc."
VALUE "FileDescription", "Electron"
VALUE "FileVersion", "1.4.15"
VALUE "FileVersion", "1.4.16"
VALUE "InternalName", "electron.exe"
VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved."
VALUE "OriginalFilename", "electron.exe"
VALUE "ProductName", "Electron"
VALUE "ProductVersion", "1.4.15"
VALUE "ProductVersion", "1.4.16"
VALUE "SquirrelAwareVersion", "1"
END
END

View File

@@ -7,7 +7,7 @@
#define ATOM_MAJOR_VERSION 1
#define ATOM_MINOR_VERSION 4
#define ATOM_PATCH_VERSION 15
#define ATOM_PATCH_VERSION 16
#define ATOM_VERSION_IS_RELEASE 1

View File

@@ -270,6 +270,10 @@ class PrintJob::PdfToEmfState {
std::unique_ptr<PdfToEmfConverter> converter_;
};
void PrintJob::AppendPrintedPage(int page_number) {
pdf_page_mapping_.push_back(page_number);
}
void PrintJob::StartPdfToEmfConversion(
const scoped_refptr<base::RefCountedMemory>& bytes,
const gfx::Size& page_size,
@@ -298,14 +302,15 @@ void PrintJob::OnPdfToEmfPageConverted(int page_number,
float scale_factor,
std::unique_ptr<MetafilePlayer> emf) {
DCHECK(ptd_to_emf_state_);
if (!document_.get() || !emf) {
if (!document_.get() || !emf || page_number < 0 ||
static_cast<size_t>(page_number) >= pdf_page_mapping_.size()) {
ptd_to_emf_state_.reset();
Cancel();
return;
}
// Update the rendered document. It will send notifications to the listener.
document_->SetPage(page_number,
document_->SetPage(pdf_page_mapping_[page_number],
std::move(emf),
scale_factor,
ptd_to_emf_state_->page_size(),

View File

@@ -6,6 +6,7 @@
#define CHROME_BROWSER_PRINTING_PRINT_JOB_H_
#include <memory>
#include <vector>
#include "base/memory/weak_ptr.h"
#include "base/message_loop/message_loop.h"
@@ -91,6 +92,9 @@ class PrintJob : public PrintJobWorkerOwner,
PrintedDocument* document() const;
#if defined(OS_WIN)
// Let the PrintJob know the 0-based |page_number| of a given printed page.
void AppendPrintedPage(int page_number);
void StartPdfToEmfConversion(
const scoped_refptr<base::RefCountedMemory>& bytes,
const gfx::Size& page_size,
@@ -153,6 +157,7 @@ class PrintJob : public PrintJobWorkerOwner,
#if defined(OS_WIN)
class PdfToEmfState;
std::unique_ptr<PdfToEmfState> ptd_to_emf_state_;
std::vector<int> pdf_page_mapping_;
#endif // OS_WIN
// Used at shutdown so that we can quit a nested message loop.

View File

@@ -153,6 +153,7 @@ void PrintViewManagerBase::OnDidPrintPage(
ShouldQuitFromInnerMessageLoop();
#else
print_job_->AppendPrintedPage(params.page_number);
if (metafile_must_be_valid) {
scoped_refptr<base::RefCountedBytes> bytes = new base::RefCountedBytes(
reinterpret_cast<const unsigned char*>(shared_buf.memory()),

View File

@@ -4,7 +4,7 @@
'product_name%': 'Electron',
'company_name%': 'GitHub, Inc',
'company_abbr%': 'github',
'version%': '1.4.15',
'version%': '1.4.16',
'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c',
},
'includes': [

View File

@@ -1,6 +1,6 @@
{
"name": "electron",
"version": "1.4.15",
"version": "1.4.16",
"devDependencies": {
"asar": "^0.11.0",
"browserify": "^13.1.0",