Package com.sun.star.sheet

Examples of com.sun.star.sheet.XFunctionAccess.callFunction()


    c.setTime (date);
   
    Object [] dateArgs = {new Integer(c.get (Calendar.YEAR)),
                          new Integer(c.get (Calendar.MONTH) + 1),
                          new Integer(c.get (Calendar.DAY_OF_MONTH))};
    double result = (Double)(fa.callFunction ("DATE", dateArgs));
    Object [] timeArgs = {new Integer(c.get (Calendar.HOUR_OF_DAY)),
                          new Integer(c.get (Calendar.MINUTE)),
                          new Integer(c.get (Calendar.SECOND))};
    result += (Double)(fa.callFunction ("TIME", timeArgs));
    myLog.debug ("result = " + result);
View Full Code Here


                          new Integer(c.get (Calendar.DAY_OF_MONTH))};
    double result = (Double)(fa.callFunction ("DATE", dateArgs));
    Object [] timeArgs = {new Integer(c.get (Calendar.HOUR_OF_DAY)),
                          new Integer(c.get (Calendar.MINUTE)),
                          new Integer(c.get (Calendar.SECOND))};
    result += (Double)(fa.callFunction ("TIME", timeArgs));
    myLog.debug ("result = " + result);
    return result;
  }

  /**
 
View Full Code Here

  public Date toDate (double val) throws ParseException, Exception
  {
    XFunctionAccess fa = getFunctionAccess();

    Object [] args = {new Double(val), "YYYY-MM-DD HH:MM:SS"};
    String text = (String)(fa.callFunction ("TEXT", args));

    if (myToDateSdf == null) {
      myToDateSdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    }
    Date d = myToDateSdf.parse (text);
View Full Code Here

    double val = 0.0;

    if (includeDate) {
      Object [] args = {new Integer(c.get (Calendar.YEAR)), new Integer(c.get (Calendar.MONTH) + 1), new Integer(c.get (Calendar.DAY_OF_MONTH))};
      myLog.debug("Date = {}-{}-{}", args);
      Double v = (Double)(fa.callFunction ("DATE", args));
      val = v.doubleValue ();
    }
    if (includeTime) {
      Object [] args = {new Integer(c.get (Calendar.HOUR)), new Integer(c.get (Calendar.MINUTE)), new Integer(c.get (Calendar.SECOND))};
      myLog.debug("Time = {}-{}-{}", args);
View Full Code Here

      val = v.doubleValue ();
    }
    if (includeTime) {
      Object [] args = {new Integer(c.get (Calendar.HOUR)), new Integer(c.get (Calendar.MINUTE)), new Integer(c.get (Calendar.SECOND))};
      myLog.debug("Time = {}-{}-{}", args);
      Double v = (Double)(fa.callFunction ("TIME", args));
      val += v.doubleValue ();
    }
    myLog.debug("return {}", val);
    return val;
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.