Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
ccf05043
Commit
ccf05043
authored
13 years ago
by
Gigg, Martyn Anthony
Browse files
Options
Downloads
Patches
Plain Diff
Fix allowedValues on WorkspaceProperty to only return those of the correct type. Fixes #2948
parent
70086bba
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/Mantid/Framework/API/inc/MantidAPI/WorkspaceProperty.h
+10
-9
10 additions, 9 deletions
Code/Mantid/Framework/API/inc/MantidAPI/WorkspaceProperty.h
with
10 additions
and
9 deletions
Code/Mantid/Framework/API/inc/MantidAPI/WorkspaceProperty.h
+
10
−
9
View file @
ccf05043
...
...
@@ -270,20 +270,21 @@ namespace Mantid
{
// If an input workspace, get the list of workspaces currently in the ADS
std
::
set
<
std
::
string
>
vals
=
AnalysisDataService
::
Instance
().
getObjectNames
();
if
(
m_optional
)
if
(
m_optional
)
// Insert an empty option
{
vals
.
insert
(
""
);
}
else
// Copy-construct a temporary workspace property to test the validity of each workspace
WorkspaceProperty
<
TYPE
>
tester
(
*
this
);
std
::
set
<
std
::
string
>::
iterator
it
;
for
(
it
=
vals
.
begin
();
it
!=
vals
.
end
();)
{
// Copy-construct a temporary workspace property to test the validity of each workspace
WorkspaceProperty
<
TYPE
>
tester
(
*
this
);
std
::
set
<
std
::
string
>::
iterator
it
;
for
(
it
=
vals
.
begin
();
it
!=
vals
.
end
();
++
it
)
{
// Remove any workspace that's not valid for this algorithm
if
(
!
tester
.
setValue
(
*
it
).
empty
())
vals
.
erase
(
it
);
// Remove any workspace that's not valid for this algorithm
if
(
!
tester
.
setValue
(
*
it
).
empty
())
{
vals
.
erase
(
it
++
);
//Post-fix so that it erase the previous when returned
}
else
++
it
;
}
return
vals
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment