Resolves: tdf#141146 Fix LOOKUP in array with result scalar / single reference

The returns are identical to the cell range search.

Also, the single reference case is just a special case of range
reference and acts as row vector (as number of rows is not greater
than number of columns), equally extending the passed "range" if
found position is greater than 1.

Extending a result range such leads to the result cell not being
listened to and not acting on its changes, this was always the case for
results of an extended range, and Excel seems to have the same problem.
This is logical because the range cell is unknown in advance, and
certainly we don't want to make LOOKUP() a volatile function being
executed on each change everywhere.

Solutions to this could be:
- create a single cell broadcaster/listener on the fly while pushing the
  out-of-band cell result
  - this is nasty and modifying the model while interpreting is ugly and
    error prone and it's unclear who should destroy such broadcaster if
    the query or data range/array changed
    - so this is a no-go
- create a range broadcaster/listener for the entire row right of the
  cell
  - would mean to inspect during listener setup to which parameter of
    which OpCode a reference belongs
    - really? ...no
  - which also doesn't help if a given range is too short and is
    extended
    - would mean to always extend the listener either as row or column
* doubtable if it is really worth it for this one time off fouled up
  Excel behaviour
* or should we rather return an error for out-of-band results?
  - but then again for ranges it always worked this like
+ do not advertise, or strongly deprecate such use
  + a result range should have the same length as the search
    range/array

Change-Id: Ie903f4491844306d3768ee40bd16786ebe648461
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113085
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
1 file changed
tree: aa3aa08a84ffee45a95293f2a9fa3a0a1c983c25
  1. .git-hooks/
  2. .github/
  3. .vscode/
  4. accessibility/
  5. android/
  6. animations/
  7. apple_remote/
  8. avmedia/
  9. basctl/
  10. basegfx/
  11. basic/
  12. bean/
  13. bin/
  14. binaryurp/
  15. bridges/
  16. canvas/
  17. chart2/
  18. cli_ure/
  19. codemaker/
  20. comphelper/
  21. compilerplugins/
  22. config_host/
  23. configmgr/
  24. connectivity/
  25. cppcanvas/
  26. cppu/
  27. cppuhelper/
  28. cpputools/
  29. cui/
  30. dbaccess/
  31. desktop/
  32. distro-configs/
  33. drawinglayer/
  34. editeng/
  35. embeddedobj/
  36. embedserv/
  37. emfio/
  38. eventattacher/
  39. extensions/
  40. external/
  41. extras/
  42. filter/
  43. forms/
  44. formula/
  45. fpicker/
  46. framework/
  47. helpcompiler/
  48. hwpfilter/
  49. i18nlangtag/
  50. i18npool/
  51. i18nutil/
  52. icon-themes/
  53. idl/
  54. idlc/
  55. include/
  56. instsetoo_native/
  57. io/
  58. ios/
  59. javaunohelper/
  60. jurt/
  61. jvmaccess/
  62. jvmfwk/
  63. l10ntools/
  64. librelogo/
  65. libreofficekit/
  66. lingucomponent/
  67. linguistic/
  68. lotuswordpro/
  69. m4/
  70. nlpsolver/
  71. o3tl/
  72. odk/
  73. offapi/
  74. officecfg/
  75. onlineupdate/
  76. oovbaapi/
  77. oox/
  78. opencl/
  79. osx/
  80. package/
  81. pch/
  82. postprocess/
  83. pyuno/
  84. qadevOOo/
  85. readlicense_oo/
  86. registry/
  87. remotebridges/
  88. reportbuilder/
  89. reportdesign/
  90. ridljar/
  91. sal/
  92. salhelper/
  93. sax/
  94. sc/
  95. scaddins/
  96. sccomp/
  97. schema/
  98. scp2/
  99. scripting/
  100. sd/
  101. sdext/
  102. setup_native/
  103. sfx2/
  104. shell/
  105. slideshow/
  106. smoketest/
  107. solenv/
  108. soltools/
  109. sot/
  110. starmath/
  111. stoc/
  112. store/
  113. svgio/
  114. svl/
  115. svtools/
  116. svx/
  117. sw/
  118. swext/
  119. sysui/
  120. test/
  121. testtools/
  122. toolkit/
  123. tools/
  124. ucb/
  125. ucbhelper/
  126. udkapi/
  127. uitest/
  128. UnoControls/
  129. unodevtools/
  130. unoidl/
  131. unoil/
  132. unotest/
  133. unotools/
  134. unoxml/
  135. ure/
  136. uui/
  137. vbahelper/
  138. vcl/
  139. winaccessibility/
  140. wizards/
  141. writerfilter/
  142. writerperfect/
  143. xmerge/
  144. xmlhelp/
  145. xmloff/
  146. xmlreader/
  147. xmlscript/
  148. xmlsecurity/
  149. .buckconfig
  150. .buckversion
  151. .clang-format
  152. .editorconfig
  153. .git-blame-ignore-revs
  154. .gitattributes
  155. .gitignore
  156. .gitmodules
  157. .gitpod.dockerfile
  158. .gitpod.yml
  159. .gitreview
  160. antivirusDetection.vbs
  161. autogen.sh
  162. BUCK
  163. config.guess
  164. config.sub
  165. config_host.mk.in
  166. config_host_lang.mk.in
  167. configure.ac
  168. COPYING
  169. COPYING.LGPL
  170. COPYING.MPL
  171. download.lst
  172. g
  173. hardened_runtime.xcent.in
  174. install-sh
  175. leak-suppress.txt
  176. Library_merged.mk
  177. lo.xcent
  178. logerrit
  179. Makefile.fetch
  180. Makefile.gbuild
  181. Makefile.in
  182. README.cross
  183. README.md
  184. README.Solaris
  185. Repository.mk
  186. RepositoryExternal.mk
  187. RepositoryFixes.mk
  188. RepositoryModule_build.mk
  189. RepositoryModule_host.mk
  190. sanitize-ubsan-excludelist
  191. setup.cfg
  192. TEMPLATE.SOURCECODE.HEADER
README.md

LibreOffice

Coverity Scan Build Status CII Best Practices Translation status

LibreOffice is an integrated office suite based on copyleft licenses and compatible with most document formats and standards. Libreoffice is backed by The Document Foundation, which represents a large independent community of enterprises, developers and other volunteers moved by the common goal of bringing to the market the best software for personal productivity. LibreOffice is open source, and free to download, use and distribute.

A quick overview of the LibreOffice code structure.

Overview

You can develop for LibreOffice in one of two ways, one recommended and one much less so. First the somewhat less recommended way: it is possible to use the SDK to develop an extension, for which you can read the API docs here and here. This re-uses the (extremely generic) UNO APIs that are also used by macro scripting in StarBasic.

The best way to add a generally useful feature to LibreOffice is to work on the code base however. Overall this way makes it easier to compile and build your code, it avoids any arbitrary limitations of our scripting APIs, and in general is far more simple and intuitive - if you are a reasonably able C++ programmer.

The build chain and runtime baselines

These are the current minimal operating system and compiler versions to run and compile LibreOffice, also used by the TDF builds:

  • Windows:
    • Runtime: Windows 7
    • Build: Cygwin + Visual Studio 2019 version 16.5
  • macOS:
    • Runtime: 10.10
    • Build: 10.14.4 + Xcode 11.3
  • Linux:
    • Runtime: RHEL 7 or CentOS 7
    • Build: either GCC 7.0.0; or Clang 5.0.2 with libstdc++ 7.3.0
  • iOS (only for LibreOfficeKit):
    • Runtime: 11.4 (only support for newer i devices == 64 bit)
    • Build: Xcode 9.3 and iPhone SDK 11.4
  • Android:
    • Build: NDK r19c and SDK 22.6.2

If you want to use Clang with the LibreOffice compiler plugins, the minimal version of Clang is 5.0.2. Since Xcode doesn't provide the compiler plugin headers, you have to compile your own Clang to use them on macOS.

You can find the TDF configure switches in the distro-configs/ directory.

To setup your initial build environment on Windows and macOS, we provide the LibreOffice Development Environment (LODE) scripts.

For more information see the build instructions for your platform in the TDF wiki.

The important bits of code

Each module should have a README file inside it which has some degree of documentation for that module; patches are most welcome to improve those. We have those turned into a web page here:

https://docs.libreoffice.org/

However, there are two hundred modules, many of them of only peripheral interest for a specialist audience. So - where is the good stuff, the code that is most useful. Here is a quick overview of the most important ones:

ModuleDescription
sal/this provides a simple System Abstraction Layer
tools/this provides basic internal types: 'Rectangle', 'Color' etc.
vcl/this is the widget toolkit library and one rendering abstraction
frameworkUNO framework, responsible for building toolbars, menus, status bars, and the chrome around the document using widgets from VCL, and XML descriptions from /uiconfig/ files
sfx2/legacy core framework used by Writer/Calc/Draw: document model / load/save / signals for actions etc.
svx/drawing model related helper code, including much of Draw/Impress

Then applications

ModuleDescription
desktop/this is where the 'main' for the application lives, init / bootstrap. the name dates back to an ancient StarOffice that also drew a desktop
sw/Writer
sc/Calc
sd/Draw / Impress

There are several other libraries that are helpful from a graphical perspective:

ModuleDescription
basegfx/algorithms and data-types for graphics as used in the canvas
canvas/new (UNO) canvas rendering model with various backends
cppcanvas/C++ helper classes for using the UNO canvas
drawinglayer/View code to render drawable objects and break them down into primitives we can render more easily.

Rules for #include directives (C/C++)

Use the "..." form if and only if the included file is found next to the including file. Otherwise, use the <...> form. (For further details, see the mail Re: C[++]: Normalizing include syntax ("" vs <>).)

The UNO API include files should consistently use double quotes, for the benefit of external users of this API.

loplugin:includeform (compilerplugins/clang/includeform.cxx) enforces these rules.

Finding out more

Beyond this, you can read the README files, send us patches, ask on the mailing list libreoffice@lists.freedesktop.org (no subscription required) or poke people on IRC #libreoffice-dev on irc.freenode.net - we're a friendly and generally helpful mob. We know the code can be hard to get into at first, and so there are no silly questions.