← Back to team overview

desktop-packages team mailing list archive

[Bug 474844] Re: ReDim to empty does not work

 

jimav, this issue is unreproducible in LibreOffice Calc. Does this occur
for you in LibreOffice? If so could you please post a screenshot of the
runtime error? If using Lucid or Maverick feel free to type at the
Terminal:

sudo add-apt-repository ppa:libreoffice/ppa && sudo apt-get update &&
sudo apt-get -y upgrade && sudo apt-get -y install libreoffice-writer

For more on LibreOffice installation, please see:
https://wiki.ubuntu.com/LibreOffice

lsb_release -rd
Description:	Ubuntu 11.04
Release:	11.04

 apt-cache policy libreoffice-calc
libreoffice-calc:
  Installed: 1:3.3.3-1ubuntu2
  Candidate: 1:3.3.3-1ubuntu2
  Version table:
 *** 1:3.3.3-1ubuntu2 0
        500 http://us.archive.ubuntu.com/ubuntu/ natty-updates/main i386 Packages
        100 /var/lib/dpkg/status
     1:3.3.2-1ubuntu4 0
        500 http://us.archive.ubuntu.com/ubuntu/ natty/main i386 Packages

** Also affects: libreoffice (Ubuntu)
   Importance: Undecided
       Status: New

** Changed in: libreoffice (Ubuntu)
       Status: New => Incomplete

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to libreoffice in Ubuntu.
https://bugs.launchpad.net/bugs/474844

Title:
  ReDim to empty does not work

Status in The OpenOffice.org Suite:
  Invalid
Status in “libreoffice” package in Ubuntu:
  Incomplete
Status in “openoffice.org” package in Ubuntu:
  Won't Fix

Bug description:
  Binary package hint: openoffice.org

  ReDim (and Dim) throw a run-time error if UpperBound = (LowerBound-1).
  For example
    Dim foo(0 to 9)
    ...
    ReDim foo(0 to -1)   'causes error

  This should not be an error, but should make the array contain zero elements.
  Note that arrays can be declared as empty with
     Dim foo()
  which has the save effect as ReDim foo(0 to -1) [except that it works...].

  However that form does not allow easy use in algorithms which compute
  array bounds at run-time and may validly want to result an empty
  array.

  DEMO: See attached file.

  For example
    sub RemoveLastElements(ary(), n)
       ReDim Preserve ary(LBound(ary) to UBound(ary)-n)
    end sub
  ... should work for for n up to and including the total number of elements, but instead you currently have to code it like this:

    sub RemoveLastElements(ary(), n)
       if UBound(ary)-LBound(ary) > n then
          ReDim Preserve ary(LBound(ary) to UBound(ary)-n)
       else
          ReDim ary()
       end if
  end sub

  ProblemType: Bug
  Architecture: amd64
  Date: Wed Nov  4 14:25:11 2009
  DistroRelease: Ubuntu 9.10
  ExecutablePath: /usr/lib/openoffice/program/soffice.bin
  Package: openoffice.org-core 1:3.1.1-5ubuntu1 [modified: var/lib/openoffice/basis3.1/program/services.rdb]
  ProcEnviron:
   PATH=(custom, user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  ProcVersionSignature: Ubuntu 2.6.31-14.48-generic
  SourcePackage: openoffice.org
  Uname: Linux 2.6.31-14-generic x86_64

  
  --- 
  Architecture: amd64
  DistroRelease: Ubuntu 10.04
  InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release amd64 (20100429)
  Package: openoffice.org-calc 1:3.2.0-7ubuntu4
  PackageArchitecture: amd64
  ProcEnviron:
   PATH=(custom, user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  ProcVersionSignature: Ubuntu 2.6.32-22.33-generic 2.6.32.11+drm33.2
  Tags: lucid
  Uname: Linux 2.6.32-22-generic x86_64
  UserGroups: adm admin audio cdrom dialout dip fax floppy fuse games lpadmin netdev plugdev sambashare tape users vboxusers video

To manage notifications about this bug go to:
https://bugs.launchpad.net/openoffice/+bug/474844/+subscriptions