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:
twanvl
2006-11-20 18:51:11 +00:00
parent 3cbf2577c1
commit 23abbedcbd
46 changed files with 433 additions and 70 deletions
+17
View File
@@ -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);
}
}
}