Remove buffers option since only a single is supported
This commit is contained in:
parent
8f35afd941
commit
5adf9c47fc
2 changed files with 1 additions and 19 deletions
|
@ -4,8 +4,6 @@
|
|||
|
||||
#include "atom/common/api/atom_api_clipboard.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "atom/common/native_mate_converters/image_converter.h"
|
||||
#include "atom/common/native_mate_converters/string16_converter.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
|
@ -68,7 +66,6 @@ void Clipboard::Write(const mate::Dictionary& data, mate::Arguments* args) {
|
|||
ui::ScopedClipboardWriter writer(GetClipboardType(args));
|
||||
base::string16 text, html, bookmark;
|
||||
gfx::Image image;
|
||||
std::map<std::string, v8::Local<v8::Value>> customBuffers;
|
||||
|
||||
if (data.Get("text", &text)) {
|
||||
writer.WriteText(text);
|
||||
|
@ -87,14 +84,6 @@ void Clipboard::Write(const mate::Dictionary& data, mate::Arguments* args) {
|
|||
|
||||
if (data.Get("image", &image))
|
||||
writer.WriteImage(image.AsBitmap());
|
||||
|
||||
if (data.Get("buffers", &customBuffers)) {
|
||||
for (auto i = customBuffers.begin(); i != customBuffers.end(); ++i) {
|
||||
writer.WriteData(node::Buffer::Data(i->second),
|
||||
node::Buffer::Length(i->second),
|
||||
ui::Clipboard::GetFormatType(i->first));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
base::string16 Clipboard::ReadText(mate::Arguments* args) {
|
||||
|
|
|
@ -173,17 +173,10 @@ Writes the `buffer` into the clipboard as `format`.
|
|||
* `image` [NativeImage](native-image.md) (optional)
|
||||
* `rtf` String (optional)
|
||||
* `bookmark` String (optional) - The title of the url at `text`.
|
||||
* `buffers` {[format: String]: Buffer} (optional) _Experimental_ - The buffers for each format you want to write
|
||||
* `type` String (optional)
|
||||
|
||||
```javascript
|
||||
const {clipboard} = require('electron')
|
||||
clipboard.write({
|
||||
text: 'test',
|
||||
html: '<b>test</b>',
|
||||
buffers: {
|
||||
'com.adobe.pdf': pdfData
|
||||
}
|
||||
})
|
||||
clipboard.write({text: 'test', html: '<b>test</b>'})
|
||||
```
|
||||
Writes `data` to the clipboard.
|
||||
|
|
Loading…
Add table
Reference in a new issue