Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
5c2e3a16
Commit
5c2e3a16
authored
May 12, 2007
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
copying cards with a different stylesheet now works
parent
8a789f8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
src/data/format/clipboard.cpp
src/data/format/clipboard.cpp
+8
-5
No files found.
src/data/format/clipboard.cpp
View file @
5c2e3a16
...
@@ -38,7 +38,7 @@ void deserialize_from_clipboard(T& object, Package& package, const String& data)
...
@@ -38,7 +38,7 @@ void deserialize_from_clipboard(T& object, Package& package, const String& data)
/// A wrapped card for storing on the clipboard
/// A wrapped card for storing on the clipboard
struct
WrappedCard
{
struct
WrappedCard
{
String
expected_game_n
ame
;
Game
*
expected_g
ame
;
String
game_name
;
String
game_name
;
CardP
card
;
CardP
card
;
...
@@ -46,15 +46,18 @@ struct WrappedCard {
...
@@ -46,15 +46,18 @@ struct WrappedCard {
};
};
IMPLEMENT_REFLECTION
(
WrappedCard
)
{
IMPLEMENT_REFLECTION
(
WrappedCard
)
{
if
(
game_name
==
expected_game_name
)
REFLECT
(
game_name
);
REFLECT
(
game_name
);
if
(
game_name
==
expected_game_name
)
REFLECT
(
card
);
if
(
game_name
==
expected_game
->
name
())
{
WITH_DYNAMIC_ARG
(
game_for_reading
,
expected_game
);
REFLECT
(
card
);
}
}
}
wxDataFormat
CardDataObject
::
format
=
_
(
"application/x-mse-card"
);
wxDataFormat
CardDataObject
::
format
=
_
(
"application/x-mse-card"
);
CardDataObject
::
CardDataObject
(
const
SetP
&
set
,
const
CardP
&
card
)
{
CardDataObject
::
CardDataObject
(
const
SetP
&
set
,
const
CardP
&
card
)
{
WrappedCard
data
=
{
set
->
game
->
name
(),
set
->
game
->
name
(),
card
};
WrappedCard
data
=
{
set
->
game
.
get
(),
set
->
game
->
name
(),
card
};
SetText
(
serialize_for_clipboard
(
*
set
,
data
));
SetText
(
serialize_for_clipboard
(
*
set
,
data
));
SetFormat
(
format
);
SetFormat
(
format
);
}
}
...
@@ -65,7 +68,7 @@ CardDataObject::CardDataObject() {
...
@@ -65,7 +68,7 @@ CardDataObject::CardDataObject() {
CardP
CardDataObject
::
getCard
(
const
SetP
&
set
)
{
CardP
CardDataObject
::
getCard
(
const
SetP
&
set
)
{
CardP
card
(
new
Card
(
*
set
->
game
));
CardP
card
(
new
Card
(
*
set
->
game
));
WrappedCard
data
=
{
set
->
game
->
name
(),
set
->
game
->
name
(),
card
};
WrappedCard
data
=
{
set
->
game
.
get
(),
set
->
game
->
name
(),
card
};
deserialize_from_clipboard
(
data
,
*
set
,
GetText
());
deserialize_from_clipboard
(
data
,
*
set
,
GetText
());
if
(
data
.
game_name
!=
set
->
game
->
name
())
return
CardP
();
// Card is from a different game
if
(
data
.
game_name
!=
set
->
game
->
name
())
return
CardP
();
// Card is from a different game
else
return
card
;
else
return
card
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment