Merge lp:~zorba-coders/zorba/markos-scratch into lp:zorba

Proposed by Markos Zaharioudakis
Status: Merged
Approved by: Markos Zaharioudakis
Approved revision: 11075
Merged at revision: 11410
Proposed branch: lp:~zorba-coders/zorba/markos-scratch
Merge into: lp:zorba
Diff against target: 53 lines (+22/-3)
2 files modified
src/api/dynamiccontextimpl.cpp (+22/-1)
test/fots/CMakeLists.txt (+0/-2)
To merge this branch: bzr merge lp:~zorba-coders/zorba/markos-scratch
Reviewer Review Type Date Requested Status
Markos Zaharioudakis Approve
Review via email: mp+161013@code.launchpad.net

Commit message

if context item is set via the api, implictly set the context size and position as well (to 1)

Description of the change

if context item is set via the api, implictly set the context size and position as well (to 1)

To post a comment you must log in.
Revision history for this message
Markos Zaharioudakis (markos-za) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job markos-scratch-2013-04-25T20-51-52.578Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/api/dynamiccontextimpl.cpp'
2--- src/api/dynamiccontextimpl.cpp 2013-03-13 16:17:38 +0000
3+++ src/api/dynamiccontextimpl.cpp 2013-04-25 20:50:34 +0000
4@@ -395,7 +395,28 @@
5 bool DynamicContextImpl::setContextItem(const Item& inValue)
6 {
7 String varName = Unmarshaller::newString(static_context::DOT_VAR_NAME);
8- return setVariable(varName, inValue);
9+ bool res = setVariable(varName, inValue);
10+
11+ store::Item_t one;
12+
13+ if (!theCtx->is_set_variable(dynamic_context::IDVAR_CONTEXT_ITEM_POSITION))
14+ {
15+ GENV_ITEMFACTORY->createInteger(one, xs_integer(1));
16+
17+ varName = Unmarshaller::newString(static_context::DOT_POS_VAR_NAME);
18+ setVariable(varName, Item(one));
19+ }
20+
21+ if (!theCtx->is_set_variable(dynamic_context::IDVAR_CONTEXT_ITEM_SIZE))
22+ {
23+ if (!one)
24+ GENV_ITEMFACTORY->createInteger(one, xs_integer(1));
25+
26+ varName = Unmarshaller::newString(static_context::DOT_SIZE_VAR_NAME);
27+ setVariable(varName, Item(one));
28+ }
29+
30+ return res;
31 }
32
33
34
35=== modified file 'test/fots/CMakeLists.txt'
36--- test/fots/CMakeLists.txt 2013-04-25 01:27:33 +0000
37+++ test/fots/CMakeLists.txt 2013-04-25 20:50:34 +0000
38@@ -184,7 +184,6 @@
39 EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-014 0)
40 EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-015 0)
41 EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-017 0)
42-EXPECTED_FOTS_FAILURE (fn-last last-24 0)
43 EXPECTED_FOTS_FAILURE (fn-matches cbcl-matches-038 1131304)
44 EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-33 0)
45 EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-35 0)
46@@ -212,7 +211,6 @@
47 EXPECTED_FOTS_FAILURE (fn-parse-xml-fragment parse-xml-fragment-016 0)
48 EXPECTED_FOTS_FAILURE (fn-parse-xml-fragment parse-xml-fragment-017 0)
49 EXPECTED_FOTS_FAILURE (fn-parse-xml-fragment parse-xml-fragment-020 0)
50-EXPECTED_FOTS_FAILURE (fn-position position-23 0)
51 EXPECTED_FOTS_FAILURE (fn-replace fn-replace-42 0)
52 EXPECTED_FOTS_FAILURE (fn-resolve-uri fn-resolve-uri-26 0)
53 EXPECTED_FOTS_FAILURE (fn-resolve-uri fn-resolve-uri-28 0)

Subscribers

People subscribed via source and target branches