[Libreoffice-commits] .: reportbuilder/java wizards/com

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Oct 9 23:57:18 PDT 2012


 reportbuilder/java/com/sun/star/report/SDBCReportData.java                                        |   11 
 reportbuilder/java/com/sun/star/report/SOImageService.java                                        |    1 
 reportbuilder/java/com/sun/star/report/pentaho/SOFormulaParser.java                               |    5 
 reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java            |    1 
 reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java |    1 
 reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementLayoutController.java  |    5 
 wizards/com/sun/star/wizards/agenda/AgendaTemplate.java                                           |    4 
 wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java                                   |   10 
 wizards/com/sun/star/wizards/agenda/TopicsControl.java                                            |   16 -
 wizards/com/sun/star/wizards/common/ConfigGroup.java                                              |    1 
 wizards/com/sun/star/wizards/common/NumberFormatter.java                                          |    2 
 wizards/com/sun/star/wizards/common/NumericalHelper.java                                          |  114 ----------
 12 files changed, 2 insertions(+), 169 deletions(-)

New commits:
commit f6739073edc1b593035f25becbd0e9d6d536ef0c
Author: Jose Guilherme Vanz <guilherme.sft at gmail.com>
Date:   Mon Oct 8 21:22:03 2012 -0300

    Remove commented code and empty methods
    
    This patch removes commented code and some empty private methods
    
    Change-Id: I4a79e521399a07873030f021a97c01cf8d2e81d7
    Signed-off-by: José Guilherme Vanz <guilherme.sft at gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/844
    Reviewed-by: Thomas Arnhold <thomas at arnhold.org>
    Tested-by: Thomas Arnhold <thomas at arnhold.org>

diff --git a/reportbuilder/java/com/sun/star/report/SDBCReportData.java b/reportbuilder/java/com/sun/star/report/SDBCReportData.java
index 0faf94c..7f8fae1 100644
--- a/reportbuilder/java/com/sun/star/report/SDBCReportData.java
+++ b/reportbuilder/java/com/sun/star/report/SDBCReportData.java
@@ -179,17 +179,6 @@ public class SDBCReportData implements DataSource
     {
     }
 
-//  public int getCurrentRow() throws DataSourceException
-//  {
-//    try
-//    {
-//      return rowSet.getRow();
-//    }
-//    catch (SQLException e)
-//    {
-//      throw new DataSourceException(e.getMessage(), e);
-//    }
-//  }
     static private java.sql.Date getDate(final Object obj)
     {
         final java.sql.Date date;
diff --git a/reportbuilder/java/com/sun/star/report/SOImageService.java b/reportbuilder/java/com/sun/star/report/SOImageService.java
index e9c0739..78f4e45 100644
--- a/reportbuilder/java/com/sun/star/report/SOImageService.java
+++ b/reportbuilder/java/com/sun/star/report/SOImageService.java
@@ -81,7 +81,6 @@ public class SOImageService implements ImageService
             {
                 new PropertyValue()
             };
-            // value[0] = new PropertyValue();
             value[0].Name = "InputStream";
             value[0].Value = image;
 
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaParser.java b/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaParser.java
index de35978..a9b236d 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaParser.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaParser.java
@@ -309,11 +309,6 @@ public final class SOFormulaParser extends ComponentBase
 
     public void setOpCodeMap(com.sun.star.sheet.FormulaOpCodeMapEntry[] the_value)
     {
-//        m_prophlp.prepareSet("OpCodeMap", null);
-//        synchronized (this)
-//        {
-//            m_OpCodeMap.clear();
-//        }
     }
 
     public String getImplementationName()
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java
index 3936079..ad653a7 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java
@@ -179,7 +179,6 @@ public class FormatValueUtility
             if (!"string".equals(valueType))
             {
                 variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "string");
-                //variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, String.valueOf(value));
             }
             variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, STRING_VALUE, String.valueOf(value));
         }
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java
index 1607b69..3362b26 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java
@@ -111,7 +111,6 @@ public class FormattedTextLayoutController
             variablesGet.setAttribute(JFreeReportInfo.REPORT_NAMESPACE,
                     Element.NAMESPACE_ATTRIBUTE, OfficeNamespaces.TEXT_NS);
             variablesGet.setAttribute(OfficeNamespaces.TEXT_NS, "name", name);
-            //variablesGet.setAttribute(OfficeNamespaces.TEXT_NS, "display", "value");
 
             final String dataStyleName = computeValueStyle();
             if (dataStyleName != null)
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementLayoutController.java
index 1b6f8e4..0b4ffb3 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementLayoutController.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementLayoutController.java
@@ -198,11 +198,6 @@ public class ImageElementLayoutController
                 continue;
             }
             final Element child = (Element) node;
-            /*
-            if (! OfficeToken.COVERED_TABLE_CELL.equals(child.getType()) &&
-            (ObjectUtilities.equal(child.getNamespace(), namespace) == false ||
-            ObjectUtilities.equal(child.getType(), type) == false))
-             */
             if (!ObjectUtilities.equal(child.getNamespace(), namespace) || (!ObjectUtilities.equal(child.getType(), type) && (secondType == null || !ObjectUtilities.equal(child.getType(), secondType))))
             {
                 continue;
diff --git a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.java b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.java
index 6be8215..69659f5 100644
--- a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.java
+++ b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.java
@@ -1757,10 +1757,6 @@ public class AgendaTemplate extends TextDocument implements TemplateConsts, Data
             }
             XTableRows tableRows = table.getRows();
             int targetNumOfRows = topics * rowsPerTopic + 1;
-            if (tableRows.getCount() > targetNumOfRows)
-            {
-                //tableRows.removeByIndex(targetNumOfRows, tableRows.getCount() - targetNumOfRows);
-            }
             formatLastRow();
             while (writtenTopics.size() > topics)
             {
diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java
index adab22a..8d78046 100644
--- a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java
+++ b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java
@@ -490,16 +490,6 @@ public class AgendaWizardDialogImpl extends AgendaWizardDialog
             //document, but it is already stored, written down by a code above. The
             //reason this piece is malfunctioning, because the agendaTemplate.document
             //is read-only (At least as my tests indicated.).
-            /*
-            * try {
-            *     XStorable xStoreable = UnoRuntime.queryInterface(XStorable.class, agendaTemplate.document);
-            *     xStoreable.store();
-            * }
-            * catch (Exception ex) {
-            *     SystemDialog.showMessageBox(xMSF, "ErrorBox", VclWindowPeerAttribute.OK, resources.resErrSaveTemplate);
-            *     ex.printStackTrace();
-            * }
-            */
 
             agendaTemplate.xTextDocument.unlockControllers();
 
diff --git a/wizards/com/sun/star/wizards/agenda/TopicsControl.java b/wizards/com/sun/star/wizards/agenda/TopicsControl.java
index 4a72e26..551c8da 100644
--- a/wizards/com/sun/star/wizards/agenda/TopicsControl.java
+++ b/wizards/com/sun/star/wizards/agenda/TopicsControl.java
@@ -404,16 +404,6 @@ public class TopicsControl extends ControlScroller implements XFocusListener
         ((AgendaWizardDialogImpl)CurUnoDialog).agendaTemplate.refreshTopicConstants();
     }
 
-    private void lockDoc()
-    {
-        //((AgendaWizardDialogImpl)CurUnoDialog).agendaTemplate.xTextDocument.lockControllers();
-    }
-
-    private void unlockDoc()
-    {
-        //((AgendaWizardDialogImpl)CurUnoDialog).agendaTemplate.xTextDocument.unlockControllers();
-    }
-
     /**
      * Removes the current row.
      * See general class documentation explanation about the
@@ -421,7 +411,6 @@ public class TopicsControl extends ControlScroller implements XFocusListener
      */
     public void removeRow()
     {
-        lockDoc();
         for (int i = lastFocusRow; i < scrollfields.size() - 1; i++)
         {
             PropertyValue[] pv1 = scrollfields.get(i);
@@ -445,8 +434,6 @@ public class TopicsControl extends ControlScroller implements XFocusListener
 
         // the focus should return to the edit control
         focus(lastFocusControl);
-
-        unlockDoc();
     }
 
     /**
@@ -456,7 +443,6 @@ public class TopicsControl extends ControlScroller implements XFocusListener
      */
     public void insertRow()
     {
-        lockDoc();
         insertRowAtEnd();
         for (int i = scrollfields.size() - 2; i > lastFocusRow; i--)
         {
@@ -487,8 +473,6 @@ public class TopicsControl extends ControlScroller implements XFocusListener
         fillupControls(lastFocusRow - nscrollvalue);
 
         focus(lastFocusControl);
-
-        unlockDoc();
     }
 
     /**
diff --git a/wizards/com/sun/star/wizards/common/ConfigGroup.java b/wizards/com/sun/star/wizards/common/ConfigGroup.java
index 4a48caa..0f9970d 100644
--- a/wizards/com/sun/star/wizards/common/ConfigGroup.java
+++ b/wizards/com/sun/star/wizards/common/ConfigGroup.java
@@ -51,7 +51,6 @@ public class ConfigGroup implements ConfigNode
     private void writeField(Field field, Object configView, String prefix) throws Exception
     {
         String propertyName = field.getName().substring(prefix.length());
-        //System.out.println("Going to save:" + propertyName);
         Class<?> fieldType = field.getType();
         if (ConfigNode.class.isAssignableFrom(fieldType))
         {
diff --git a/wizards/com/sun/star/wizards/common/NumberFormatter.java b/wizards/com/sun/star/wizards/common/NumberFormatter.java
index c90ce2f..b5920de 100644
--- a/wizards/com/sun/star/wizards/common/NumberFormatter.java
+++ b/wizards/com/sun/star/wizards/common/NumberFormatter.java
@@ -187,7 +187,7 @@ public class NumberFormatter
     {
         try
         {
-            XPropertySet xNumberFormat = _oNumberFormatter.xNumberFormats.getByKey(_FormatKey); //CurDBField.DBFormatKey);
+            XPropertySet xNumberFormat = _oNumberFormatter.xNumberFormats.getByKey(_FormatKey);
             String FormatString = AnyConverter.toString(Helper.getUnoPropertyValue(xNumberFormat, "FormatString"));
             Locale oLocale = (Locale) Helper.getUnoPropertyValue(xNumberFormat, "Locale");
             int NewFormatKey = defineNumberFormat(FormatString, oLocale);
diff --git a/wizards/com/sun/star/wizards/common/NumericalHelper.java b/wizards/com/sun/star/wizards/common/NumericalHelper.java
index d5a198f..22eb3b1 100644
--- a/wizards/com/sun/star/wizards/common/NumericalHelper.java
+++ b/wizards/com/sun/star/wizards/common/NumericalHelper.java
@@ -17,7 +17,6 @@
  */
 package com.sun.star.wizards.common;
 
-// import com.sun.star.beans.XPropertySet;
 import com.sun.star.uno.AnyConverter;
 import com.sun.star.uno.TypeClass;
 
@@ -92,7 +91,6 @@ public class NumericalHelper
     {
 
         byte retValue = 0;
-        // boolean hasConversionWarning = false;
         TypeObject aTypeObject = getTypeObject(aValue);
         switch (aTypeObject.iType)
         {
@@ -396,97 +394,7 @@ public class NumericalHelper
         }
         return false;
     }
-//    public static int toIntWithErrorMessage(Object _aValue) throws com.sun.star.script.BasicErrorException{
-//    try {
-//        return toInt(_aValue);
-//    }
-//    catch(com.sun.star.lang.IllegalArgumentException e) {
-//        DebugHelper.exception(BasicErrorCode.SbERR_CONVERSION, PropertyNames.EMPTY_STRING);
-//        return 0;
-//    }}
-//    
-//    
-//    public static String toStringWithErrorMessage(Object _aValue) throws com.sun.star.script.BasicErrorException{
-//    try {
-//        return toString(_aValue);
-//    }
-//    catch(com.sun.star.lang.IllegalArgumentException e) {
-//        DebugHelper.exception(BasicErrorCode.SbERR_CONVERSION, PropertyNames.EMPTY_STRING);
-//        return PropertyNames.EMPTY_STRING;
-//    }}
-//
-//    
-//    public static int toIntWithErrorMessage(Object _aValue, int _ndefaultValue) throws com.sun.star.script.BasicErrorException{
-//    try {
-//        return toInt(_aValue, _ndefaultValue);
-//    }
-//    catch(com.sun.star.uno.Exception e) {
-//        DebugHelper.exception(BasicErrorCode.SbERR_CONVERSION, PropertyNames.EMPTY_STRING);
-//        return 0;
-//    }}
-//
-//    public static boolean toBooleanWithErrorMessage(Object _oObject, int _nTrueField, int _nFalseField) throws com.sun.star.script.BasicErrorException{
-//        return toBooleanWithErrorMessage(_oObject, new int[]{_nTrueField}, new int[]{_nFalseField});
-//    }
-//    
-//    
-//    public static boolean toBooleanWithErrorMessage(Object _oObject) throws com.sun.star.script.BasicErrorException{
-//        try{
-//            return toBoolean(_oObject);
-//        }
-//        catch (java.lang.Exception e){
-//           DebugHelper.exception(BasicErrorCode.SbERR_BAD_ARGUMENT, PropertyNames.EMPTY_STRING);
-//           return false;
-//        }
-//    }
-//
-//
-//    public static boolean toBooleanWithErrorMessage(Object _oObject, int[] _nTrueFields, int[] _nFalseFields) throws com.sun.star.script.BasicErrorException{
-//    try{
-//        int nValue = NumericalHelper.toIntWithErrorMessage(_oObject);
-//        if (ContainerUtilities.FieldInIntTable(_nTrueFields, nValue) > -1){
-//            return true;
-//        }
-//        else if (ContainerUtilities.FieldInIntTable(_nFalseFields, nValue) > -1){
-//           return false;
-//        }
-//        else{
-//            DebugHelper.exception(BasicErrorCode.SbERR_OUT_OF_RANGE, PropertyNames.EMPTY_STRING);
-//            return false;
-//        }
-//    }catch (java.lang.Exception e){
-//       DebugHelper.exception(BasicErrorCode.SbERR_OUT_OF_RANGE, PropertyNames.EMPTY_STRING);
-//        return false;
-//    }}
-//        
-//    
-//    public static boolean toBooleanWithErrorMessage(Object _oObject, int _nTrueField, int _nFalseField, boolean _bdefaultValue) throws com.sun.star.script.BasicErrorException{
-//        return toBooleanWithErrorMessage(_oObject, new int[]{_nTrueField}, new int[]{_nFalseField}, _bdefaultValue);
-//    }
-//    
-//    
-//    public static boolean toBooleanWithErrorMessage(Object _oObject, int[] _nTrueFields, int[] _nFalseFields, boolean _bdefaultValue) throws com.sun.star.script.BasicErrorException{
-//    try{
-//        if ((_oObject == null) || (AnyConverter.isVoid(_oObject))){
-//            return _bdefaultValue;
-//        }
-//        else{
-//            int nValue = NumericalHelper.toIntWithErrorMessage(_oObject);
-//            if (ContainerUtilities.FieldInIntTable(_nTrueFields, nValue) > -1){
-//                return true;
-//            }
-//            else if (ContainerUtilities.FieldInIntTable(_nFalseFields, nValue) > -1){
-//               return false;
-//            }
-//            else{
-//                DebugHelper.exception(BasicErrorCode.SbERR_OUT_OF_RANGE, PropertyNames.EMPTY_STRING);
-//                return false;
-//            }
-//        }
-//    }catch (java.lang.Exception e){
-//       DebugHelper.exception(BasicErrorCode.SbERR_OUT_OF_RANGE, PropertyNames.EMPTY_STRING);
-//        return false;
-//    }}
+
     /**
      * get an int value from the object
      * @param aValue 
@@ -1484,26 +1392,6 @@ public class NumericalHelper
         return destObject;
     }
 
-//    public static boolean isObjectNumericRepresentation(Object _oValue, NumberFormatter _oNumberFormatter, XPropertySet _xPropertySet) throws com.sun.star.script.BasicErrorException{
-//    try{
-//        int nNumberFormat = AnyConverter.toInt(_xPropertySet.getPropertyValue("NumberFormat"));        
-//        if (AnyConverter.isString(_oValue)){
-//            String sCellContent = AnyConverter.toString(_oValue);
-//            try{
-//                _oNumberFormatter.convertStringToNumber(nNumberFormat, sCellContent);
-//                return true;
-//            }catch (Exception e){
-//                return false;
-//            }
-//        }
-//        else{
-//            return true;
-//        }
-//    }
-//    catch (com.sun.star.uno.Exception e){
-//        DebugHelper.exception(1 /*BasicErrorCode.SbERR_METHOD_FAILED*/, PropertyNames.EMPTY_STRING);
-//        return false;
-//    }} 
     /**
      * Helper class for roman numbering
      */


More information about the Libreoffice-commits mailing list