summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 144aa0f)
raw | patch | inline | side by side (parent: 144aa0f)
author | joncruz <joncruz@users.sourceforge.net> | |
Thu, 28 Aug 2008 15:56:26 +0000 (15:56 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Thu, 28 Aug 2008 15:56:26 +0000 (15:56 +0000) |
src/ui/clipboard.cpp | patch | blob | history |
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp
index 36ceac0d10012def47ff9c3cf62c2e1de4a17974..a3f1b9c0d0eca8e68d641313ec14f766cd1fd56d 100644 (file)
--- a/src/ui/clipboard.cpp
+++ b/src/ui/clipboard.cpp
*/
SPCSSAttr *ClipboardManagerImpl::_parseColor(const Glib::ustring &text)
{
+// TODO reuse existing code instead of replicating here.
Glib::ustring::size_type len = text.bytes();
char *str = const_cast<char *>(text.data());
bool attempt_alpha = false;
{
g_assert( _clipboardSPDoc != NULL );
- const Glib::ustring target = sel.get_target();
+ Glib::ustring target = sel.get_target();
if(target == "") return; // this shouldn't happen
+ if (target == CLIPBOARD_TEXT_TARGET) {
+ target = "image/x-inkscape-svg";
+ }
+
Inkscape::Extension::DB::OutputList outlist;
Inkscape::Extension::db.get_output_list(outlist);
Inkscape::Extension::DB::OutputList::const_iterator out = outlist.begin();
}
else
{
+ if (!(*out)->loaded()) {
+ // Need to load the extension.
+ (*out)->set_state(Inkscape::Extension::Extension::STATE_LOADED);
+ }
(*out)->save(_clipboardSPDoc, filename);
}
g_file_get_contents(filename, &data, &len, NULL);
Inkscape::Extension::DB::OutputList outlist;
Inkscape::Extension::db.get_output_list(outlist);
std::list<Gtk::TargetEntry> target_list;
+ bool plaintextSet = false;
for (Inkscape::Extension::DB::OutputList::const_iterator out = outlist.begin() ; out != outlist.end() ; ++out) {
- target_list.push_back(Gtk::TargetEntry( (*out)->get_mimetype() ));
+ if ( !(*out)->deactivated() ) {
+ Glib::ustring mime = (*out)->get_mimetype();
+ if (mime != CLIPBOARD_TEXT_TARGET) {
+ if ( !plaintextSet && (mime.find("svg") == Glib::ustring::npos) ) {
+ target_list.push_back(Gtk::TargetEntry(CLIPBOARD_TEXT_TARGET));
+ plaintextSet = true;
+ }
+ target_list.push_back(Gtk::TargetEntry(mime));
+ }
+ }
}
// Add PNG export explicitly since there is no extension for this...