https://bugs.documentfoundation.org/show_bug.cgi?id=170408

            Bug ID: 170408
           Summary: With BASIC, copying values of empty cells does not
                    give empty cells
           Product: LibreOffice
           Version: 25.8.4.2 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: [email protected]
          Reporter: [email protected]

Description:
I expect the following macro to overwrite the value of A1 with that of B1
everytime:

Sub Bugged
Cells(1,1).Value=Cells(1,2).Value
End Sub

However, when B1 is empty, it instead does not change the value of A1.

Steps to Reproduce:
1. Write these macros in BASIC:

Sub Bugged
Cells(1,1).Value=Cells(1,2).Value
End Sub

Sub Fix
If Cells(1,2).Value = "" Then  Cells(1,1).value="" Else
Cells(1,1).value=Cells(1,2).Value
End Sub

2. Fill A1 with 1 and B1 with 2, run the macros.
3. Fill A1 with 1 and leave B1 empty, run the macros

Actual Results:
For Step 2, both overwrite A1 with 2.
For Step 3, Bugged leaves A1 at 1, while Fix makes A1 empty.

Expected Results:
For Step 2: Same as actual
For Step 3: Bugged should also make A1 empty


Reproducible: Always


User Profile Reset: No

Additional Info:
It may be that Cells(1,2).Value returns some kind of error instead of an empty
cell and the macro then cannot assign this error as a value and thus does
nothing instead.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to