Kaydet (Commit) e971c88e authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Fix the test for resValue != oldValue

When the property type is e.g. a UNO sequence or struct type, !equals would
trivially be always true (as the UNO bridge creates fresh instances of such
value types on the fly), masking failures where the tested code didn't change
the property value at all.

And one such masked failure was
sw.CharacterStyle::com::sun::star::style::CharacterProperties in
JunitTest_sw_unoapi_1 not changing any of the CharLeft/Right/Bottom/TopBorder
properties, as SvxBorderLine::GuessLinesWidths
(editeng/source/items/borderline.cxx) appears to only work properly if nStyle is
DOUBLE, so work around that for now by explicitly setting that BorderLineStyle
in the ValueChanger for BorderLine2.

Change-Id: If9536822c5db04cbd01e6d760b5b63da04c4cf5b
üst 0fee8f24
......@@ -408,7 +408,7 @@ public class MultiPropertyTest extends MultiMethodTest
}
if (resValue != null)
{
if ((!compare(resValue, oldValue)) || (!resValue.equals(oldValue)))
if (!compare(resValue, oldValue))
{
log.println("But it has changed.");
tRes.tested(propName, true);
......
......@@ -612,6 +612,10 @@ public class ValueChanger {
_newValue.InnerLineWidth += 2;
_newValue.LineDistance += 2;
_newValue.OuterLineWidth += 3;
if (_newValue instanceof com.sun.star.table.BorderLine2) {
((com.sun.star.table.BorderLine2) _newValue).LineStyle
= com.sun.star.table.BorderLineStyle.DOUBLE;
}
newValue = _newValue;
} else if (oldValue instanceof com.sun.star.text.XTextColumns) {
com.sun.star.text.XTextColumns _newValue = (com.sun.star.text.XTextColumns) oldValue;
......
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