summaryrefslogtreecommitdiff
path: root/nlpsolver/src
diff options
context:
space:
mode:
Diffstat (limited to 'nlpsolver/src')
-rw-r--r--nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java19
-rw-r--r--nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/PropertyInfo.java7
-rw-r--r--nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/Registration.java4
3 files changed, 13 insertions, 17 deletions
diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java
index 30b83922f028..73da46b39567 100644
--- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java
+++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java
@@ -78,9 +78,17 @@ public abstract class BaseNLPSolver extends WeakBase
private com.sun.star.lang.Locale m_locale = new com.sun.star.lang.Locale();
private final ResourceManager resourceManager;
+ private CellAddress m_objective;
+ protected CellAddress[] m_variables;
+ protected SolverConstraint[] m_constraints;
+
public BaseNLPSolver(XComponentContext xContext, String name) {
m_xContext = xContext;
m_name = name;
+ // init members exposed as XSolver properties thru uno bridge
+ m_objective = new CellAddress();
+ m_variables = new CellAddress[0];
+ m_constraints = new SolverConstraint[0];
XMultiComponentFactory componentFactory = xContext.getServiceManager();
try {
@@ -117,9 +125,6 @@ public abstract class BaseNLPSolver extends WeakBase
private XSpreadsheetDocument m_document;
private XModel m_xModel;
protected XReschedule m_xReschedule;
- private CellAddress m_objective;
- protected CellAddress[] m_variables;
- protected SolverConstraint[] m_constraints;
protected ExtSolverConstraint[] m_extConstraints;
protected boolean m_maximize;
@@ -155,9 +160,6 @@ public abstract class BaseNLPSolver extends WeakBase
}
public CellAddress[] getVariables() {
- if (m_variables == null)
- return new CellAddress[0]; //Workaround for basic scripts; otherwise
- //setting the Variables property fails.
return m_variables;
}
@@ -296,9 +298,6 @@ public abstract class BaseNLPSolver extends WeakBase
}
public SolverConstraint[] getConstraints() {
- if (m_constraints == null)
- return new SolverConstraint[0]; //Workaround for basic scripts; otherwise
- //setting the Constraints property fails.
return m_constraints;
}
@@ -463,7 +462,7 @@ public abstract class BaseNLPSolver extends WeakBase
return m_propertyMap.containsKey(property);
}
- // <editor-fold defaultstate="collapsed" desc="Helper functions">
+ // Helper functions
private void lockDocument(boolean lock) {
if (lock)
m_xModel.lockControllers();
diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/PropertyInfo.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/PropertyInfo.java
index 2371f0eb79e6..f1a7a4714f05 100644
--- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/PropertyInfo.java
+++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/PropertyInfo.java
@@ -89,10 +89,11 @@ public class PropertyInfo<PropType> {
public void localize(ResourceManager resourceManager) {
try {
- m_description = resourceManager.getLocalizedString("Properties." + m_property.Name);
- System.out.println("Localised description to " + m_description);
+ m_description = resourceManager.getLocalizedString("Properties."
+ + m_property.Name);
} catch (com.sun.star.resource.MissingResourceException ex) {
- System.out.println("No properties file !");
+ System.out.println("Can't localize. Resource missing for property: "
+ + m_property.Name);
}
}
diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/Registration.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/Registration.java
index 02a3d3ea052d..157f4963f9e0 100644
--- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/Registration.java
+++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/Registration.java
@@ -23,8 +23,6 @@ public final class Registration {
{
XSingleComponentFactory xFactory = null;
- System.out.println("Get component '" + sImplementationName + "'");
-
if ( sImplementationName.equals( "com.sun.star.comp.Calc.NLPSolver.DEPSSolverImpl" ) )
xFactory = Factory.createComponentFactory( com.sun.star.comp.Calc.NLPSolver.DEPSSolverImpl.class,
m_serviceNames );
@@ -32,8 +30,6 @@ public final class Registration {
xFactory = Factory.createComponentFactory( com.sun.star.comp.Calc.NLPSolver.SCOSolverImpl.class,
m_serviceNames );
- System.out.println("Return factory " + xFactory);
-
return xFactory;
}
private Registration() {}