summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qadevOOo/runner/lib/MultiPropertyTest.java2
-rw-r--r--qadevOOo/runner/util/ValueChanger.java10
-rw-r--r--sc/source/ui/unoobj/appluno.cxx15
-rw-r--r--sc/source/ui/unoobj/confuno.cxx15
4 files changed, 37 insertions, 5 deletions
diff --git a/qadevOOo/runner/lib/MultiPropertyTest.java b/qadevOOo/runner/lib/MultiPropertyTest.java
index b314ccf8626b..918d5e6f372e 100644
--- a/qadevOOo/runner/lib/MultiPropertyTest.java
+++ b/qadevOOo/runner/lib/MultiPropertyTest.java
@@ -454,7 +454,7 @@ public class MultiPropertyTest extends MultiMethodTest
protected Object getNewValue(String propName, Object oldValue)
throws java.lang.IllegalArgumentException
{
- return ValueChanger.changePValue(oldValue);
+ return ValueChanger.changePValue(oldValue, propName);
}
/**
diff --git a/qadevOOo/runner/util/ValueChanger.java b/qadevOOo/runner/util/ValueChanger.java
index 197de43c81d6..05b52329e0bb 100644
--- a/qadevOOo/runner/util/ValueChanger.java
+++ b/qadevOOo/runner/util/ValueChanger.java
@@ -58,9 +58,15 @@ public class ValueChanger {
newValue = Long.valueOf(oldlong + 15);
} else if (oldValue instanceof Short) {
short n = ((Short) oldValue).shortValue();
- // css.form.component.{CheckBox,RadioButton} DefaultState properties
- // must have values in the range 0--2:
if ("DefaultState".equals(name) && n == 2) {
+ // css.form.component.{CheckBox,RadioButton} DefaultState
+ // properties must have values in the range 0--2:
+ --n;
+ } else if ("LinkUpdateMode".equals(name) && n >= 2) {
+ // css.document.Settings LinkUpdateMode property must have
+ // values in the css.document.LinkUpdateModes range (0--3),
+ // while css.sheet.XGlobalSheetSettings LinkUpdateMode property
+ // must have values in the range 0--2:
--n;
} else {
++n;
diff --git a/sc/source/ui/unoobj/appluno.cxx b/sc/source/ui/unoobj/appluno.cxx
index fd7edfd739da..d814831647ec 100644
--- a/sc/source/ui/unoobj/appluno.cxx
+++ b/sc/source/ui/unoobj/appluno.cxx
@@ -36,6 +36,7 @@
#include "sc.hrc"
#include "unonames.hxx"
#include "funcdesc.hxx"
+#include <com/sun/star/document/LinkUpdateModes.hpp>
#include <com/sun/star/sheet/FunctionArgument.hpp>
#include "ScPanelFactory.hxx"
#include <boost/scoped_array.hpp>
@@ -395,7 +396,19 @@ void SAL_CALL ScSpreadsheetSettings::setPropertyValue(
}
else if (aString == SC_UNONAME_LINKUPD)
{
- aAppOpt.SetLinkMode( (ScLkUpdMode) ScUnoHelpFunctions::GetInt16FromAny( aValue ) );
+ sal_Int16 n;
+ if (!(aValue >>= n) || n < css::document::LinkUpdateModes::NEVER
+ || n > css::document::LinkUpdateModes::GLOBAL_SETTING)
+ {
+ throw css::lang::IllegalArgumentException(
+ ("LinkUpdateMode property value must be a SHORT with a value in"
+ " the range of the css.document.LinkUpdateModes constants"),
+ css::uno::Reference<css::uno::XInterface>(), -1);
+ }
+ //TODO: ScLkUpdMode (LM_ALWAYS=0, LM_NEVER=1, LM_ON_DEMAND=2,
+ // LM_UNKNOWN=3) does not match css.document.LinkUpdateModes (NEVER=0,
+ // MANUAL=1, AUTO=2, GLOBAL_SETTINGS=3):
+ aAppOpt.SetLinkMode( static_cast<ScLkUpdMode>(n) );
bSaveApp = true;
}
else if (aString == SC_UNONAME_MARKHDR)
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx
index ed59eebd832d..6cd3204f2ad5 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -156,7 +156,20 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue(
else if ( aPropertyName == SC_UNO_SHOWPAGEBR )
aViewOpt.SetOption(VOPT_PAGEBREAKS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
else if ( aPropertyName == SC_UNONAME_LINKUPD )
- rDoc.SetLinkMode( static_cast<ScLkUpdMode> ( ScUnoHelpFunctions::GetInt16FromAny( aValue ) ) );
+ {
+ sal_Int16 n;
+ //TODO: css.sheet.XGlobalSheetSettings LinkUpdateMode property is
+ // documented to take values in the range 0--2 (always, never, on
+ // demaned), but appears to be routinely set to 3 here,
+ // corresponding to ScLkUpdMode LM_UNKNOWN:
+ if (!(aValue >>= n) || n < 0 || n > 3) {
+ throw css::lang::IllegalArgumentException(
+ ("LinkUpdateMode property value must be a SHORT in the"
+ " range 0--3"),
+ css::uno::Reference<css::uno::XInterface>(), -1);
+ }
+ rDoc.SetLinkMode( static_cast<ScLkUpdMode>(n) );
+ }
else if ( aPropertyName == SC_UNO_COLROWHDR )
aViewOpt.SetOption(VOPT_HEADER, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
else if ( aPropertyName == SC_UNO_SHEETTABS )