Kaydet (Commit) a87e8268 authored tarafından Miklos Vajna's avatar Miklos Vajna

oox customshapepresetdata: empty is an empty string sequence

In case the data is empty, the data loader still set the proper type for
the sequence, while the generated code used a string sequence. Do the
same to keep testcases happy, there is no visual difference anyway.

Change-Id: I1b9be4486184a2a84c384f1365cc68dd45b8eee0
üst 37168336
...@@ -751,44 +751,50 @@ void CustomShapeProperties::initializePresetDataMap() ...@@ -751,44 +751,50 @@ void CustomShapeProperties::initializePresetDataMap()
if (aLine == "AdjustmentValues") if (aLine == "AdjustmentValues")
{ {
aStream.ReadLine(aLine); aStream.ReadLine(aLine);
comphelper::SequenceAsVector<drawing::EnhancedCustomShapeAdjustmentValue> aAdjustmentValues;
if (aLine != "([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {}") if (aLine != "([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {}")
{ {
comphelper::SequenceAsVector<drawing::EnhancedCustomShapeAdjustmentValue> aAdjustmentValues;
OString aExpectedPrefix("([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { "); OString aExpectedPrefix("([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { ");
assert(aLine.startsWith(aExpectedPrefix)); assert(aLine.startsWith(aExpectedPrefix));
OString aValue = aLine.copy(aExpectedPrefix.getLength(), aLine.getLength() - aExpectedPrefix.getLength() - strlen(" }")); OString aValue = aLine.copy(aExpectedPrefix.getLength(), aLine.getLength() - aExpectedPrefix.getLength() - strlen(" }"));
lcl_parseAdjustmentValues(aAdjustmentValues, aValue); lcl_parseAdjustmentValues(aAdjustmentValues, aValue);
aPropertyMap.setProperty(PROP_AdjustmentValues, aAdjustmentValues.getAsConstList());
} }
aPropertyMap.setProperty(PROP_AdjustmentValues, aAdjustmentValues.getAsConstList()); else
aPropertyMap.setProperty(PROP_AdjustmentValues, uno::Sequence<OUString>(0));
} }
else if (aLine == "Equations") else if (aLine == "Equations")
{ {
aStream.ReadLine(aLine); aStream.ReadLine(aLine);
comphelper::SequenceAsVector<OUString> aEquations;
if (aLine != "([]string) {}") if (aLine != "([]string) {}")
{ {
comphelper::SequenceAsVector<OUString> aEquations;
OString aExpectedPrefix("([]string) { "); OString aExpectedPrefix("([]string) { ");
assert(aLine.startsWith(aExpectedPrefix)); assert(aLine.startsWith(aExpectedPrefix));
OString aValue = aLine.copy(aExpectedPrefix.getLength(), aLine.getLength() - aExpectedPrefix.getLength() - strlen(" }")); OString aValue = aLine.copy(aExpectedPrefix.getLength(), aLine.getLength() - aExpectedPrefix.getLength() - strlen(" }"));
lcl_parseEquations(aEquations, aValue); lcl_parseEquations(aEquations, aValue);
aPropertyMap.setProperty(PROP_Equations, aEquations.getAsConstList());
} }
aPropertyMap.setProperty(PROP_Equations, aEquations.getAsConstList()); else
aPropertyMap.setProperty(PROP_Equations, uno::Sequence<OUString>(0));
} }
else if (aLine == "Handles") else if (aLine == "Handles")
{ {
aStream.ReadLine(aLine); aStream.ReadLine(aLine);
comphelper::SequenceAsVector< uno::Sequence<beans::PropertyValue> > aHandles;
if (aLine != "([][]com.sun.star.beans.PropertyValue) {}") if (aLine != "([][]com.sun.star.beans.PropertyValue) {}")
{ {
comphelper::SequenceAsVector< uno::Sequence<beans::PropertyValue> > aHandles;
OString aExpectedPrefix("([][]com.sun.star.beans.PropertyValue) { "); OString aExpectedPrefix("([][]com.sun.star.beans.PropertyValue) { ");
assert(aLine.startsWith(aExpectedPrefix)); assert(aLine.startsWith(aExpectedPrefix));
OString aValue = aLine.copy(aExpectedPrefix.getLength(), aLine.getLength() - aExpectedPrefix.getLength() - strlen(" }")); OString aValue = aLine.copy(aExpectedPrefix.getLength(), aLine.getLength() - aExpectedPrefix.getLength() - strlen(" }"));
lcl_parseHandles(aHandles, aValue); lcl_parseHandles(aHandles, aValue);
aPropertyMap.setProperty(PROP_Handles, aHandles.getAsConstList());
} }
aPropertyMap.setProperty(PROP_Handles, aHandles.getAsConstList()); else
aPropertyMap.setProperty(PROP_Handles, uno::Sequence<OUString>(0));
} }
else if (aLine == "MirroredX") else if (aLine == "MirroredX")
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment