Kaydet (Commit) 4ae96069 authored tarafından Noel Grandin's avatar Noel Grandin

java: static fields should be accessed in a static way

Change-Id: I727e7f2a7527c60bb45f0ba5d0e88a66c5ccdd6f
üst c483ac1f
......@@ -47,7 +47,6 @@ public class NumberFormatter
public XNumberFormats xNumberFormats;
public XNumberFormatTypes xNumberFormatTypes;
public XPropertySet xNumberFormatSettings;
private static final boolean bNullDateCorrectionIsDefined = false;
private final Locale aLocale;
......@@ -165,22 +164,15 @@ public class NumberFormatter
public long getNullDateCorrection()
{
if (!this.bNullDateCorrectionIsDefined)
{
com.sun.star.util.Date dNullDate = (com.sun.star.util.Date) Helper.getUnoStructValue(this.xNumberFormatSettings, "NullDate");
long lNullDate = Helper.convertUnoDatetoInteger(dNullDate);
java.util.Calendar oCal = java.util.Calendar.getInstance();
oCal.set(1900, 1, 1);
Date dTime = oCal.getTime();
long lTime = dTime.getTime();
long lDBNullDate = lTime / (3600 * 24000);
lDateCorrection = lDBNullDate - lNullDate;
return lDateCorrection;
}
else
{
return this.lDateCorrection;
}
com.sun.star.util.Date dNullDate = (com.sun.star.util.Date) Helper.getUnoStructValue(this.xNumberFormatSettings, "NullDate");
long lNullDate = Helper.convertUnoDatetoInteger(dNullDate);
java.util.Calendar oCal = java.util.Calendar.getInstance();
oCal.set(1900, 1, 1);
Date dTime = oCal.getTime();
long lTime = dTime.getTime();
long lDBNullDate = lTime / (3600 * 24000);
lDateCorrection = lDBNullDate - lNullDate;
return lDateCorrection;
}
......
......@@ -168,7 +168,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen
if (_bAutoincrementation)
{
int nDataType = oTypeInspector.getAutoIncrementIndex(xColPropertySet);
if (nDataType != oTypeInspector.INVALID)
if (nDataType != TypeInspector.INVALID)
{
if (xColPropertySet.getPropertySetInfo().hasPropertyByName("IsAutoIncrement"))
{
......
......@@ -309,9 +309,9 @@ public class Control extends Shape
{
String stext;
short iTextLength = AnyConverter.toShort(xPropertySet.getPropertyValue("MaxTextLen"));
if (iTextLength < this.SOMAXTEXTSIZE)
if (iTextLength < SOMAXTEXTSIZE)
{
stext = FormHandler.SOSIZETEXT.substring(0, this.SOMAXTEXTSIZE);
stext = FormHandler.SOSIZETEXT.substring(0, SOMAXTEXTSIZE);
}
else
{
......
......@@ -222,7 +222,7 @@ public class FieldLinker extends DBLimitedFieldSelection
String[] SlaveLinkNames = JavaTools.ArrayOutOfMultiDimArray(_LinkFieldNames, SOSLAVEINDEX);
String[] ViewMasterFieldNames = addNoneFieldItemToList(_AllMasterFieldNames); // add '-undefined-'
String[] ViewSlaveFieldNames = addNoneFieldItemToList(_AllSlaveFieldNames);
for (int i = 0; i < super.rowcount; i++)
for (int i = 0; i < rowcount; i++)
{
super.initializeListBox(lstMasterFields[i], ViewMasterFieldNames, MasterLinkNames, i);
super.initializeListBox(lstSlaveFields[i], ViewSlaveFieldNames, SlaveLinkNames, i);
......
......@@ -39,7 +39,6 @@ public class CommandFieldSelection extends FieldSelection implements Comparator<
private String sTablePrefix;
private short m_iSelPos = -1;
private short iOldSelPos = -1;
private static final boolean bpreselectCommand = true;
private boolean bgetQueries;
private final WizardDialog oWizardDialog;
private Collator aCollator = null;
......@@ -180,13 +179,10 @@ public class CommandFieldSelection extends FieldSelection implements Comparator<
}
else
{
if (this.bpreselectCommand)
String[] sItemList = ((String[]) Helper.getUnoPropertyValue(UnoDialog.getModel(xTableListBox), PropertyNames.STRING_ITEM_LIST));
if (sItemList.length > 0)
{
String[] sItemList = ((String[]) Helper.getUnoPropertyValue(UnoDialog.getModel(xTableListBox), PropertyNames.STRING_ITEM_LIST));
if (sItemList.length > 0)
{
return (short) 0;
}
return (short) 0;
}
return (short) -1;
}
......@@ -272,21 +268,13 @@ public class CommandFieldSelection extends FieldSelection implements Comparator<
java.util.Arrays.sort(ContentList, this);
Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), PropertyNames.STRING_ITEM_LIST, ContentList);
short iSelPos = getselectedItemPos();
if (bpreselectCommand)
{
if (iSelPos > -1)
{
bgetFields = true;
iSelArray = new short[]
{
iSelPos
};
}
}
else
if (iSelPos > -1)
{
emptyFieldsListBoxes();
iSelArray = new short[] {iSelPos};
bgetFields = true;
iSelArray = new short[]
{
iSelPos
};
}
Helper.setUnoPropertyValue(UnoDialog.getModel(xTableListBox), PropertyNames.SELECTED_ITEMS, iSelArray);
toggleCommandListBox(true);
......
......@@ -33,7 +33,7 @@ public abstract class DBLimitedFieldSelection
protected String sNoField;
protected Integer IStep;
protected static final int rowcount = 4;
protected final int MAXSELINDEX = rowcount - 1;
protected static final int MAXSELINDEX = rowcount - 1;
protected short curtabindex;
protected int iCurPosY;
protected int FirstHelpIndex;
......
......@@ -198,7 +198,7 @@ public class TitlesComponent extends ControlScroller
{
String sTitleModelName = (String) Helper.getUnoPropertyValue(_fieldtitlemodel, PropertyNames.PROPERTY_NAME);
String sindex = JavaTools.getSuffixNumber(sTitleModelName);
return (String) CurUnoDialog.getControlProperty(this.SOLABELPREFIX + sindex, PropertyNames.PROPERTY_LABEL);
return (String) CurUnoDialog.getControlProperty(SOLABELPREFIX + sindex, PropertyNames.PROPERTY_LABEL);
}
public String[] getFieldTitles()
......
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