diff --git a/mscore/exportxml.cpp b/mscore/exportxml.cpp
index 72988c76e854d..edae8266adbea 100644
--- a/mscore/exportxml.cpp
+++ b/mscore/exportxml.cpp
@@ -1221,9 +1221,9 @@ static QString tick2xml(const int ticks, int* dots)
// findVolta -- find volta starting in measure m
//---------------------------------------------------------
-static Volta* findVolta(Measure* m, bool /*left*/)
+static Volta* findVolta(Measure* m, bool left)
{
- for (Spanner* el = m->spannerFor(); el; el = el->next()) {
+ for (Spanner* el = left ? m->spannerFor() : m->spannerBack(); el; el = el->next()) {
if (el->type() != Element::VOLTA)
continue;
return (Volta*) el;
diff --git a/mtest/musicxml/io/testVolta1.xml b/mtest/musicxml/io/testVolta1.xml
index c7afa79f3dc14..43558f28827f3 100644
--- a/mtest/musicxml/io/testVolta1.xml
+++ b/mtest/musicxml/io/testVolta1.xml
@@ -95,6 +95,87 @@
1
whole
+
+
+
+
+
+ G
+ 4
+
+ 4
+ 1
+ whole
+
+
+
+
+
+
+
+
+ A
+ 4
+
+ 4
+ 1
+ whole
+
+
+
+
+
+ B
+ 4
+
+ 4
+ 1
+ whole
+
+
+ light-heavy
+
+
+
+
+
+
+
+
+
+
+ C
+ 5
+
+ 4
+ 1
+ whole
+
+
+
+
+
+ D
+ 5
+
+ 4
+ 1
+ whole
+
+
+
+
+
+
+
+
+ E
+ 5
+
+ 4
+ 1
+ whole
+
light-heavy
diff --git a/test/musicxml/testVolta1.xml b/test/musicxml/testVolta1.xml
index c7afa79f3dc14..43558f28827f3 100644
--- a/test/musicxml/testVolta1.xml
+++ b/test/musicxml/testVolta1.xml
@@ -95,6 +95,87 @@
1
whole
+
+
+
+
+
+ G
+ 4
+
+ 4
+ 1
+ whole
+
+
+
+
+
+
+
+
+ A
+ 4
+
+ 4
+ 1
+ whole
+
+
+
+
+
+ B
+ 4
+
+ 4
+ 1
+ whole
+
+
+ light-heavy
+
+
+
+
+
+
+
+
+
+
+ C
+ 5
+
+ 4
+ 1
+ whole
+
+
+
+
+
+ D
+ 5
+
+ 4
+ 1
+ whole
+
+
+
+
+
+
+
+
+ E
+ 5
+
+ 4
+ 1
+ whole
+
light-heavy