mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
implemented clipboard handling for cards
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@83 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include <util/vector2d.hpp>
|
||||
#include <util/error.hpp>
|
||||
#include <util/version.hpp>
|
||||
#include <util/io/package.hpp>
|
||||
|
||||
// ----------------------------------------------------------------------------- : Writer
|
||||
|
||||
@@ -115,3 +116,19 @@ template <> void Writer::handle(const Vector2D& vec) {
|
||||
template <> void Writer::handle(const Color& col) {
|
||||
handle(String::Format(_("rgb(%u,%u,%u)"), col.Red(), col.Green(), col.Blue()));
|
||||
}
|
||||
|
||||
template <> void Writer::handle(const FileName& value) {
|
||||
if (clipboard_package() && !value.empty()) {
|
||||
// use absolute names on clipboard
|
||||
try {
|
||||
handle(clipboard_package()->absoluteName(value));
|
||||
} catch (const Error&) {
|
||||
// ignore errors
|
||||
}
|
||||
} else {
|
||||
handle(static_cast<const String&>(value));
|
||||
if (writing_package()) {
|
||||
writing_package()->referenceFile(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user