[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 3 commits - wizards/com wizards/source
Damjan Jovanovic
damjan at apache.org
Sun Nov 8 10:12:17 PST 2015
wizards/com/sun/star/wizards/common/FileAccess.java | 24 +++++-----
wizards/com/sun/star/wizards/common/TerminateWizardException.java | 3 -
wizards/com/sun/star/wizards/query/QuerySummary.java | 4 -
wizards/com/sun/star/wizards/ui/AggregateComponent.java | 15 ++----
wizards/com/sun/star/wizards/ui/FilterComponent.java | 15 ++----
wizards/source/formwizard/dbwizres.src | 19 -------
6 files changed, 33 insertions(+), 47 deletions(-)
New commits:
commit 1f6546d6c0e6670d59e6beb05d15c80327634e6c
Author: Damjan Jovanovic <damjan at apache.org>
Date: Sun Nov 8 15:55:59 2015 +0000
#i56289# no GROUP BY - COUNT from wizard
Implement the COUNT operator for GROUP BY in the Base Query Wizard,
and delete some unused resource strings to make space for it.
Found by: dtinazzi at easyasp dot it
Patch by: me
diff --git a/wizards/com/sun/star/wizards/ui/AggregateComponent.java b/wizards/com/sun/star/wizards/ui/AggregateComponent.java
index 5852ce9..2798486 100644
--- a/wizards/com/sun/star/wizards/ui/AggregateComponent.java
+++ b/wizards/com/sun/star/wizards/ui/AggregateComponent.java
@@ -39,7 +39,7 @@ public class AggregateComponent extends ControlScroller
String[] sFunctions;
String[] sFunctionOperators = new String[]
{
- "SUM", "AVG", "MIN", "MAX"
+ "SUM", "AVG", "MIN", "MAX", "COUNT"
};
QueryMetaData CurDBMetaData;
XButton optDetailQuery;
@@ -204,7 +204,7 @@ public class AggregateComponent extends ControlScroller
soptSummaryQuery = CurUnoDialog.m_oResource.getResText(UIConsts.RID_QUERY + 12);
slblAggregate = CurUnoDialog.m_oResource.getResText(UIConsts.RID_QUERY + 16);
slblFieldNames = CurUnoDialog.m_oResource.getResText(UIConsts.RID_QUERY + 17);
- sFunctions = CurUnoDialog.m_oResource.getResArray(UIConsts.RID_QUERY + 40, 4);
+ sFunctions = CurUnoDialog.m_oResource.getResArray(UIConsts.RID_QUERY + 40, 5);
sDuplicateAggregateFunction = CurUnoDialog.m_oResource.getResText(UIConsts.RID_QUERY + 90);
}
diff --git a/wizards/source/formwizard/dbwizres.src b/wizards/source/formwizard/dbwizres.src
index fd1a02a..c83cf49 100644
--- a/wizards/source/formwizard/dbwizres.src
+++ b/wizards/source/formwizard/dbwizres.src
@@ -867,28 +867,11 @@ String RID_DB_QUERY_WIZARD_START + 43
Text [ en-US] = "get the maximum of";
};
-
String RID_DB_QUERY_WIZARD_START + 44
{
- Text [ en-US] = "get the sum of <FIELD>";
-};
-
-String RID_DB_QUERY_WIZARD_START + 45
-{
- Text [ en-US] = "get the average of <FIELD>";
+ Text [ en-US] = "get the count of";
};
-String RID_DB_QUERY_WIZARD_START + 46
-{
- Text [ en-US] = "get the minimum of <FIELD>";
-};
-
-String RID_DB_QUERY_WIZARD_START + 47
-{
- Text [ en-US] = "get the maximum of <FIELD>";
-};
-
-
String RID_DB_QUERY_WIZARD_START + 48
{
Text [ en-US] = "(none)";
commit 77ff55a4a1f25c1dc21d083cee43b4506bf91410
Author: Damjan Jovanovic <damjan at apache.org>
Date: Sun Nov 8 14:38:09 2015 +0000
Use the UIConsts constants for resource IDs in main/wizards/com/sun/star/wizards/query/QuerySummary.java
diff --git a/wizards/com/sun/star/wizards/query/QuerySummary.java b/wizards/com/sun/star/wizards/query/QuerySummary.java
index df5118d..96b602c 100644
--- a/wizards/com/sun/star/wizards/query/QuerySummary.java
+++ b/wizards/com/sun/star/wizards/query/QuerySummary.java
@@ -31,11 +31,11 @@ import com.sun.star.wizards.db.FieldColumn;
import com.sun.star.wizards.db.QueryMetaData;
import com.sun.star.wizards.ui.FilterComponent;
+import static com.sun.star.wizards.ui.UIConsts.RID_QUERY;
+
public class QuerySummary extends QueryMetaData
{
- final protected int RID_QUERY = 2300;
- final protected int RID_REPORT = 2400;
String sSummary;
Resource oResource;
// XMultiServiceFactory xMSF;
commit 95efcaf575dced8cc18f2ca9fb874d772ad23595
Author: Damjan Jovanovic <damjan at apache.org>
Date: Sun Nov 8 14:34:28 2015 +0000
Use UIConsts constants for offsets to resource IDs in main/wizards.
diff --git a/wizards/com/sun/star/wizards/common/FileAccess.java b/wizards/com/sun/star/wizards/common/FileAccess.java
index 5a7749e..624c395 100644
--- a/wizards/com/sun/star/wizards/common/FileAccess.java
+++ b/wizards/com/sun/star/wizards/common/FileAccess.java
@@ -22,10 +22,6 @@
package com.sun.star.wizards.common;
-import com.sun.star.beans.XPropertySet;
-import com.sun.star.lang.Locale;
-import com.sun.star.uno.Exception;
-import com.sun.star.util.XMacroExpander;
// import com.sun.star.wizards.common.NoValidPathException;
import java.io.File;
import java.util.ArrayList;
@@ -33,17 +29,25 @@ import java.util.Arrays;
import java.util.Vector;
import com.sun.star.awt.VclWindowPeerAttribute;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.document.XDocumentProperties;
import com.sun.star.io.XActiveDataSink;
import com.sun.star.io.XInputStream;
// import com.sun.star.io.XStream;
import com.sun.star.io.XTextInputStream;
+import com.sun.star.lang.Locale;
import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.ucb.*;
+import com.sun.star.ucb.CommandAbortedException;
+import com.sun.star.ucb.XFileIdentifierConverter;
+import com.sun.star.ucb.XSimpleFileAccess;
+import com.sun.star.ucb.XSimpleFileAccess2;
+import com.sun.star.uno.Exception;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
import com.sun.star.util.DateTime;
-import com.sun.star.beans.PropertyValue;
-import com.sun.star.document.XDocumentProperties;
+import com.sun.star.util.XMacroExpander;
+import com.sun.star.wizards.ui.UIConsts;
/**
* This class delivers static convenience methods
@@ -471,9 +475,9 @@ public class FileAccess
try
{
Resource oResource = new Resource(xMSF, "ImportWizard", "imp");
- sNoDirCreation = oResource.getResText(1050);
- String sMsgDirNotThere = oResource.getResText(1051);
- String sQueryForNewCreation = oResource.getResText(1052);
+ sNoDirCreation = oResource.getResText(UIConsts.RID_DB_COMMON + 50);
+ String sMsgDirNotThere = oResource.getResText(UIConsts.RID_DB_COMMON + 51);
+ String sQueryForNewCreation = oResource.getResText(UIConsts.RID_DB_COMMON + 52);
String OSPath = JavaTools.convertfromURLNotation(Path);
String sQueryMessage = JavaTools.replaceSubString(sMsgDirNotThere, OSPath, "%1");
sQueryMessage = sQueryMessage + (char) 13 + sQueryForNewCreation;
diff --git a/wizards/com/sun/star/wizards/common/TerminateWizardException.java b/wizards/com/sun/star/wizards/common/TerminateWizardException.java
index 0f63259..a8b2dec 100644
--- a/wizards/com/sun/star/wizards/common/TerminateWizardException.java
+++ b/wizards/com/sun/star/wizards/common/TerminateWizardException.java
@@ -24,6 +24,7 @@ package com.sun.star.wizards.common;
// import com.sun.star.wizards.common.Resource;
import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.wizards.ui.UIConsts;
public class TerminateWizardException extends Exception
{
@@ -31,7 +32,7 @@ public class TerminateWizardException extends Exception
public TerminateWizardException(XMultiServiceFactory xMSF)
{
Resource oResource = new Resource(xMSF, "AutoPilot", "dbw");
- String sErrorMessage = oResource.getResText(1006);
+ String sErrorMessage = oResource.getResText(UIConsts.RID_DB_COMMON + 6);
SystemDialog.showMessageBox(xMSF, "ErrorBox", com.sun.star.awt.VclWindowPeerAttribute.OK, sErrorMessage);
printStackTrace(System.out);
}
diff --git a/wizards/com/sun/star/wizards/ui/AggregateComponent.java b/wizards/com/sun/star/wizards/ui/AggregateComponent.java
index d2a29eb..5852ce9 100644
--- a/wizards/com/sun/star/wizards/ui/AggregateComponent.java
+++ b/wizards/com/sun/star/wizards/ui/AggregateComponent.java
@@ -200,14 +200,13 @@ public class AggregateComponent extends ControlScroller
{
if (i == 0)
{
- int BaseID = 2300;
- soptDetailQuery = CurUnoDialog.m_oResource.getResText(BaseID + 11);
- soptSummaryQuery = CurUnoDialog.m_oResource.getResText(BaseID + 12);
- slblAggregate = CurUnoDialog.m_oResource.getResText(BaseID + 16);
- slblFieldNames = CurUnoDialog.m_oResource.getResText(BaseID + 17);
- sFunctions = CurUnoDialog.m_oResource.getResArray(BaseID + 40, 4);
-
- sDuplicateAggregateFunction = CurUnoDialog.m_oResource.getResText(BaseID + 90);
+ soptDetailQuery = CurUnoDialog.m_oResource.getResText(UIConsts.RID_QUERY + 11);
+ soptSummaryQuery = CurUnoDialog.m_oResource.getResText(UIConsts.RID_QUERY + 12);
+ slblAggregate = CurUnoDialog.m_oResource.getResText(UIConsts.RID_QUERY + 16);
+ slblFieldNames = CurUnoDialog.m_oResource.getResText(UIConsts.RID_QUERY + 17);
+ sFunctions = CurUnoDialog.m_oResource.getResArray(UIConsts.RID_QUERY + 40, 4);
+
+ sDuplicateAggregateFunction = CurUnoDialog.m_oResource.getResText(UIConsts.RID_QUERY + 90);
}
if (ControlRowVector == null)
{
diff --git a/wizards/com/sun/star/wizards/ui/FilterComponent.java b/wizards/com/sun/star/wizards/ui/FilterComponent.java
index bd6763d..78fcbbb 100644
--- a/wizards/com/sun/star/wizards/ui/FilterComponent.java
+++ b/wizards/com/sun/star/wizards/ui/FilterComponent.java
@@ -66,7 +66,6 @@ public class FilterComponent
private String slblOperators;
private String slblValue;
WizardDialog CurUnoDialog;
- private int BaseID = 2300;
private String sIncSuffix;
private ControlRow[] oControlRows;
private String sDuplicateCondition;
@@ -405,14 +404,14 @@ public class FilterComponent
boolean bEnabled;
sIncSuffix = com.sun.star.wizards.common.Desktop.getIncrementSuffix(CurUnoDialog.getDlgNameAccess(), "optMatchAll");
- String soptMatchAll = CurUnoDialog.m_oResource.getResText(BaseID + 9);
- String soptMatchAny = CurUnoDialog.m_oResource.getResText(BaseID + 10);
- slblFieldNames = CurUnoDialog.m_oResource.getResText(BaseID + 17);
- slblOperators = CurUnoDialog.m_oResource.getResText(BaseID + 24);
- slblValue = CurUnoDialog.m_oResource.getResText(BaseID + 25);
- sLogicOperators = CurUnoDialog.m_oResource.getResArray(BaseID + 26, 10 /* 7 */); // =, <>, <, >, <=, >=, like, !like, is null, !is null
+ String soptMatchAll = CurUnoDialog.m_oResource.getResText(UIConsts.RID_QUERY + 9);
+ String soptMatchAny = CurUnoDialog.m_oResource.getResText(UIConsts.RID_QUERY + 10);
+ slblFieldNames = CurUnoDialog.m_oResource.getResText(UIConsts.RID_QUERY + 17);
+ slblOperators = CurUnoDialog.m_oResource.getResText(UIConsts.RID_QUERY + 24);
+ slblValue = CurUnoDialog.m_oResource.getResText(UIConsts.RID_QUERY + 25);
+ sLogicOperators = CurUnoDialog.m_oResource.getResArray(UIConsts.RID_QUERY + 26, 10 /* 7 */); // =, <>, <, >, <=, >=, like, !like, is null, !is null
- sDuplicateCondition = CurUnoDialog.m_oResource.getResText(BaseID + 89);
+ sDuplicateCondition = CurUnoDialog.m_oResource.getResText(UIConsts.RID_QUERY + 89);
// create Radiobuttons
// * match all
More information about the Libreoffice-commits
mailing list