summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2014-12-19 17:48:09 +0100
committerLionel Elie Mamane <lionel@mamane.lu>2014-12-19 23:33:28 +0100
commita983fb0f7c7b94d0771d277777035254acce093f (patch)
tree58c561a4888e7c1434449d2f8e4b5c79a1ee7ea1
parentffd3388d08aafbbea92c6354064cf1ab6a56bd70 (diff)
Revert "fdo#87301 don't rely on the shape to get the control"
-rw-r--r--wizards/com/sun/star/wizards/document/TimeStampControl.java21
-rw-r--r--wizards/com/sun/star/wizards/form/StyleApplier.java4
2 files changed, 15 insertions, 10 deletions
diff --git a/wizards/com/sun/star/wizards/document/TimeStampControl.java b/wizards/com/sun/star/wizards/document/TimeStampControl.java
index e77c6b12adee..42b8b5351d89 100644
--- a/wizards/com/sun/star/wizards/document/TimeStampControl.java
+++ b/wizards/com/sun/star/wizards/document/TimeStampControl.java
@@ -62,17 +62,22 @@ public class TimeStampControl extends DatabaseControl
nreltimewidth = 1.0 - nreldatewidth;
}
- public XPropertySet getControlByIndex(int _i)
+ public XPropertySet getControlofGroupShapeByIndex(int _i)
{
- switch (_i)
+ try
+ {
+ if (_i < xShapes.getCount())
+ {
+ Object oControl = xShapes.getByIndex(_i);
+ XControlShape xControlShape = UnoRuntime.queryInterface(XControlShape.class, oControl);
+ return UnoRuntime.queryInterface(XPropertySet.class, xControlShape.getControl());
+ }
+ }
+ catch (Exception e)
{
- case 0:
- return oDateControl.xPropertySet;
- case 1:
- return oTimeControl.xPropertySet;
- default:
- return null;
+ e.printStackTrace(System.err);
}
+ return null;
}
public TimeStampControl(Resource _oResource, GridControl _oGridControl, FieldColumn _curfieldcolumn)
diff --git a/wizards/com/sun/star/wizards/form/StyleApplier.java b/wizards/com/sun/star/wizards/form/StyleApplier.java
index 10037aa4990c..4a171e022fba 100644
--- a/wizards/com/sun/star/wizards/form/StyleApplier.java
+++ b/wizards/com/sun/star/wizards/form/StyleApplier.java
@@ -271,7 +271,7 @@ public class StyleApplier
TimeStampControl oTimeStampControl = (TimeStampControl) DBControls[n];
for (int i = 0; i < 2; i++)
{
- XPropertySet xPropertySet = oTimeStampControl.getControlByIndex(i);
+ XPropertySet xPropertySet = oTimeStampControl.getControlofGroupShapeByIndex(i);
if (xPropertySet.getPropertySetInfo().hasPropertyByName(PropertyNames.PROPERTY_BORDER))
{
xPropertySet.setPropertyValue(PropertyNames.PROPERTY_BORDER, IBorderValue);
@@ -405,7 +405,7 @@ public class StyleApplier
TimeStampControl oTimeStampControl = (TimeStampControl) aDBControl;
for (int i = 0; i < 2; i++)
{
- XPropertySet xPropertySet = oTimeStampControl.getControlByIndex(i);
+ XPropertySet xPropertySet = oTimeStampControl.getControlofGroupShapeByIndex(i);
setDBControlColors(xPropertySet, _iStyleColors);
}
}