This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch symphony-vba
in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit d41e06e14a910b68cd5071b50e3de6fabb9d48bc
Author: Pedro Giffuni <=>
AuthorDate: Fri Oct 30 02:51:57 2026 -0500
Add VBA-Dictionary compatibility analysis for AOO
VBA-Dictionary provides pure-VBA Scripting.Dictionary replacement but
requires modifications for AOO: strip VBA. prefix, remove Attribute lines,
simplify #If conditions, define missing VBA constants.
---
docs/vba-compatibility/vba-dictionary-analysis.md | 71 +++++++++++++++++++++++
1 file changed, 71 insertions(+)
diff --git a/docs/vba-compatibility/vba-dictionary-analysis.md
b/docs/vba-compatibility/vba-dictionary-analysis.md
new file mode 100644
index 0000000000..d2bfea7288
--- /dev/null
+++ b/docs/vba-compatibility/vba-dictionary-analysis.md
@@ -0,0 +1,71 @@
+# VBA-Dictionary Compatibility Analysis for AOO
+
+## Overview
+Analysis of https://github.com/VBA-tools/VBA-Dictionary (pure VBA
Scripting.Dictionary replacement) against AOO's VBA compatibility mode.
+
+## Repository Details
+- URL: https://github.com/VBA-tools/VBA-Dictionary
+- License: MIT
+- Main artifact: `Dictionary.cls` (456 lines, single class module)
+- Purpose: Drop-in replacement for Scripting.Dictionary, originally for Mac
(where native Dictionary is unreliable)
+
+## Key Finding
+**VBA-Dictionary requires modifications to work in AOO.** While it's a pure
VBA implementation (no native dependencies), it uses several features AOO
doesn't support.
+
+## Unsupported Features
+
+### 1. `VBA.` Namespace Prefix (~46 occurrences)
+- `VBA.IsObject`, `VBA.vbBoolean`, `VBA.vbString`, `VBA.vbBinaryCompare`, etc.
+- AOO's VBA mode does NOT resolve the `VBA.` prefix
+- **Workaround:** Strip all `VBA.` prefixes (use direct function calls)
+
+### 2. `Attribute` Lines (8 occurrences)
+```vb
+Attribute VB_Name = "Dictionary"
+Attribute CompareMode.VB_Description = "..."
+Attribute Item.VB_UserMemId = 0
+Attribute Add.VB_Description = "..."
+```
+- These are Excel VBA class module attributes
+- May cause parsing issues in AOO's BASIC compiler
+
+### 3. `#If` with Compound Expressions
+```vb
+#Const UseScriptingDictionaryIfAvailable = True
+#If Mac Or Not UseScriptingDictionaryIfAvailable Then
+```
+- Current AOO `#If` implementation
(`main/basic/source/comp/parser.cxx:PPIf()`) only handles simple expressions
+- Does NOT support `Or`/`And` operators in conditions
+- After reading `Mac` (unknown constant → false), parser expects `Then` but
finds `Or`
+- **Effect:** `#Else` branch would be taken (native Dictionary), not the
custom implementation
+- **Workaround:** Simplify condition to `#If Not
UseScriptingDictionaryIfAvailable Then`
+
+### 4. Missing VBA Constants
+- `vbBinaryCompare` (=0), `vbTextCompare` (=1), `vbDatabaseCompare` (=2) - NOT
defined
+- `vbBoolean` (=2), `vbString` (=8), `vbVariant` (=12) - NOT defined
+- Used in `CompareMethod` enum and `dict_GetFormattedKey`
+- **Workaround:** Define these constants with `#Const`
+
+## Supported Features
+
+| Feature | Status | Notes |
+|---------|--------|-------|
+| Class modules with Property Get/Let/Set | Supported | `Class_Module` type
set by VBA compat mode |
+| `New Collection` | Supported | AOO's Collection supports this |
+| `Collection.Add ... Before:` | Supported | `sb.cxx:2116` shows Before param
support |
+| `Class_Initialize`/`Class_Terminate` | Supported | `sb.cxx:806/824` |
+| `On Error Resume Next` | Supported | Standard VBA error handling |
+| Dynamic arrays (`Dim arr() As Variant`) | Supported | |
+| `ReDim`/`Erase` | Supported | |
+| `vbNullString`, `vbCr`, `vbCrLf` | Supported | Defined in
`parser.cxx:843-853` |
+
+## Required Modifications for AOO
+
+1. Remove all `VBA.` prefixes (e.g., `VBA.IsObject` → `IsObject`)
+2. Remove or comment out `Attribute` lines
+3. Simplify `#If` condition to a single constant test
+4. Define missing constants: `vbBinaryCompare`, `vbTextCompare`,
`vbDatabaseCompare`, etc.
+5. Set `UseScriptingDictionaryIfAvailable = False` to force custom
implementation
+
+## Conclusion
+With the modifications above, VBA-Dictionary could provide Dictionary
functionality in AOO. The core implementation is sound - it uses Collection and
arrays which AOO supports. The main blockers are the `VBA.` namespace, missing
constants, and `#If` expression limitations.