36 Commits
Author SHA1 Message Date
Tomaž Vajngerl 1ac50fddc7 sc: rewrite the token array into the OOXML shape
OOXML writes @ and # as calls and a reference union as a parenthesised
list, so for each of them we need to know how far the sub-expression
under it reaches. CreateStringFromTokenArray worked that out from the
text it had already written. The problem with this is that every pair
it spliced in shifted all the offsets that were still waiting behind
it, so it kept breaking.

Instead of patching the text, OOXMLRewriter builds a second
token array in the shape OOXML spells out and the writer walks that as
it stands. The call names and the parentheses are ordinary tokens, so
there is nothing to splice and no offsets to keep track of. It is the
same trick RewriteMissing already plays a few lines further up, and it
means the input and the output can be looked at side by side.

The # changes place, from behind its operand to a call in front of it,
so it gets an opcode of its own. _xlfn.ANCHORARRAY spells ocAnchorArray
now, and ocSpill keeps the native postfix spelling with no OOXML one at
all, so the postfix form cannot end up in a file by accident. The
import already rewrote the call back into the postfix operator and now
recognises it by opcode instead of by position. The @ stays
ocSingleValue, it is already in front of its operand so only the
parentheses are new.

The OFFSET() literal argument is swapped for the reference error in
the same pass, instead of the writing loop jumping over tokens.

A unit test drives the rewrite on its own: token array in, token array
out, one case per shape. The shapes that end up with nothing to wrap
are in there too - a lone @, one with a missing argument, and text that
never parsed - since those are the ones where dropping a token is the
only change.

Also drop the dead "@" and "#" rows from the OOXML symbol table, the
rows above them already have _xlfn.SINGLE and _xlfn.ANCHORARRAY.

Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Change-Id: I63944fb85b5c4388f304f7d94afd0b4f347d7782
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/10155
Tested-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 4feac84950f5b524d99e277481de50f7b45a8d2f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210292
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-08-31 15:56:50 +02:00
Ben Urban 3bdd856e9f Implemented callables as first-class objects in Calc formulas
Three types of callables are available:

* Built-in functions (tdf#164507)

* External functions

* Macro functions

Change-Id: I6311c9412db650cfeb1100497e4ccdc39662c350
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206264
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-09 08:42:21 +02:00
Stephan Bergmann db3a61cd95 Generally determine Rdb content from gb_*_set_componentfile calls
...instead of by listing the content somewhat redundantly in the Rdb_*.mk
files, to avoid duplication of logic for components that are only built
conditionally (and thus should only be included conditionally in the
corresponding Rdb).  To achieve that, add an "rdb" parameter to
gb_ComponentTarget_ComponentTarget (and to the gb_*_set_componentfile macros
that internally call gb_ComponentTarget_ComponentTarget), which is used to make
the appropriate gb_Rdb_add_component call internally from within
gb_ComponentTarget_ComponentTarget.  (As a special case,
gb_CppunitTest_set_componentfile shall not call gb_Rdb_add_component, as that
has already been done by the corresponding gb_Library_set_componentfile call, so
allow the gb_ComponentTarget_ComponentTarget "rdb" parameter to be empty to
support that special case.)

Most Rdb_*.mk files are thus mostly empty now.  One exception is
i18npool/Rdb_saxparser.mk, which duplicates some of the Rdb_services content as
needed during the build in CustomTarget_i18npool/localedata.

1c9a40299d "gbuild: create services.rdb from built
components" had already tried to do something similar (in addition to other
things) under a new --enable-services-rdb-from-build option.  However, that
approach had four drawbacks that this approach here addresses (and which thus
partly reverts 1c9a40299d):

1  Rdb_services shall not contain the component files of all libraries that are
built.  While that commit filtered out the component files that go into
Rdb_ure/services (ure/Rdb_ure.mk), it failed to filter out the component files
that go into others like Rdb_postgresql-sdbc
(connectivity/Rdb_postgresql-sdbc.mk).

2  The code added by that commit to Makefile.gbuild codified the knowledge that
there is an Rdb_services, which is brittle.

3  The code added by that commit to solenv/gbuild/Rdb.mk codified the knowledge
(for gb_Rdb__URECOMPONENTS) that there is an Rdb_ure/services, which is brittle.

4  Introducing an --enable-services-rdb-from-build option needlessly provided
two different ways how the content of Rdb_services is assembled.

The changes done here would leave --enable-services-rdb-from-build as a
misnomer, as it no longer controls how Rdb_services is assembled.  I thus
renamed it to --enable-customtarget-components, as that is apparently what it
still does now.

Change-Id: Ia5e8df4b640146c77421fcec6daa11a9cd260265
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126577
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-12-10 08:14:24 +01:00
Noel Grandin 9ff8a1173a formula: create instances with uno constructors
See tdf#74608 for motivation

Change-Id: I5983c837977e40b91df02605c1012640ffd5c650
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98291
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-07 22:01:33 +02:00
Caolán McNamara 13fac4894f normalize resource locale ctor construction mechanisms
make them all the same and share std::locales more

various OModuleClient, etc, classes go away

Change-Id: I7e3ff01a69332eeacd22e3078f66a60318de62d5
Reviewed-on: https://gerrit.libreoffice.org/40634
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-08-02 10:36:07 +02:00
Caolán McNamara 00657aef09 migrate to boost::gettext
* all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl
* all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string")
* ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching
  MODULE .mo files
* UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui
  goes from l10n target to normal one, so the res/lang.zips of UI files go away
* translation via Translation::get(hrc-define-key, imbued-std::locale)
* python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there
  to keep finding the .hrc file uniform) so magic numbers can go away there
* java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation
  mechanism
* en-US res files go away, their strings are now the .hrc keys in the source code
* remaining .res files are replaced by .mo files
* in .res/.ui-lang-zip files, the old scheme missing translations of strings
  results in inserting the english original so something can be found, now the
  standard fallback of using the english original from the source key is used, so
  partial translations shrink dramatically in size
* extract .hrc strings with hrcex which backs onto
   xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap
* extract .ui strings with uiex which backs onto
   xgettext --add-comments --no-wrap
* qtz for gettext translations is generated at runtime as ascii-ified crc32 of
   content + "|" + msgid
* [API CHANGE] remove deprecated binary .res resouce loader related uno apis
      com::sun::star::resource::OfficeResourceLoader
      com::sun::star::resource::XResourceBundleLoader
      com::sun::star::resource::XResourceBundle
    when translating strings via uno apis
      com.sun.star.resource.StringResourceWithLocation
    can continue to be used

Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
2017-07-21 08:20:50 +01:00
David Ostrovsky de030cd7a2 gbuild: Remove MSVC 2013 legacy code
Uwinapi is discontinued.

Change-Id: I063b4d0d8fab2d60de168e960a63b8181158ac01
Reviewed-on: https://gerrit.libreoffice.org/23198
Reviewed-by: David Ostrovsky <david@ostrovsky.org>
Tested-by: David Ostrovsky <david@ostrovsky.org>
2017-04-21 18:18:44 +02:00
Caolán McNamara 5b2f823194 add a SAL_RAND_REPEATABLE for repeatable random nums
merge the formula and comphelper ones together

Change-Id: I2e7e2cdb176afc6982e384fa1e007da5b914e6f0
2015-07-10 08:58:20 +01:00
Tor Lillqvist bff635be1d Make the RAND() and RANDBETWEEN() Calc functions non-random when requested
We don't want such a mode to affect other uses of randomness, though. Thus use
a separate random number generator object for these two functions, and use a
fixed seed for it if the SC_RAND_REPEATABLE environment variable is set.

As RAND() is implemented in sc, and RANDBETWEEN() is implemented in scaddins,
it was a bit hard to figure out where to add the new functions needed, without
having to over-engineer things with UNO. (This functionality is totally
Calc-specific, but neither sc nor scaddins has any public (non-UNO) API.)
Caolan suggested the formula module, which seems like a good enough place to
me.

Change-Id: I4b0cb327392e51a18bce28478af91b0174d6b726
2015-01-20 18:12:38 +02:00
Kohei Yoshida ee5010f04c Make some methods non-inline, and hide #include <tools/debug.hxx>.
This header is also included all over sc.

Change-Id: I4b8092c83a40bdeefd0781046125746ca8d35c9a
2014-11-25 23:57:33 -05:00
Michael Stahl 8230c26e3d gbuild: add gb_Library_use_restarget
Change-Id: Ic0a2fd3c1adeb55ec27f6a2eb4709be598120fba
2013-09-22 11:08:28 +02:00
Kohei Yoshida 7fb73a8475 Initial cut on vector formula ref tokens. Not used yet.
Change-Id: I4b28c269759bc01bfc94cfdd6a1c651d03d829c7
2013-04-30 13:10:41 -04:00
David Tardon 1cc9bbfd57 gbuild: drop empty use_packages calls
Change-Id: I8e9f70eb5d929c98b4379416c2259a74e31d587f
Reviewed-on: https://gerrit.libreoffice.org/3503
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2013-04-24 05:18:15 +00:00
David Tardon c042cd05e9 gbuild: drop uses of removed packages
Change-Id: I400fad08c0ae7b6b34bad63693f54856867e4dac
Reviewed-on: https://gerrit.libreoffice.org/3502
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2013-04-24 05:18:03 +00:00
Michael Meeks 62badf3828 Move to MPLv2 license headers, with ESC decision and author's permission. 2013-04-22 09:37:38 +01:00
Eike Rathke 876c619b94 new module i18nlangtag
Moved portions from module i18npool, all of former i18nisolang1 library
that now is i18nlangtag. Included are languagetag, isolang and mslangid.

This i18nlangtag code is now even used by module comphelper, so
disentangling i18npool and making this an own module was needed to not
create circular module dependencies.

Change-Id: Ib887c3d6dde667403fd22d382310ba5f1a9b0015
2013-04-05 19:10:48 +02:00
Michael Stahl a53586f4ef gbuild: do not copy boost headers around
- do not use gb_UnpackedTarball_copy_header_files for boost
- adapt the optimization in concat-deps.c for new path
- use boost_headers in all LinkTargets that require it
- add explicit include paths to mysqlc, mysqlcppconn, libvisio, liborcus

Change-Id: I0c43e73ed43cc9d2e6bce8faf55e992d655a0bb9
2013-01-26 22:20:06 +01:00
Eike Rathke 9955dbebbd AllSettings with LanguageTag
Change-Id: I710ae66e51139662eb442b681fdf9cc9d158551d
2012-11-22 12:34:59 +01:00
Michael Stahl 5032dc0fc3 gbuild: invert handling of standard system libraries:
Always link in gb_STDLIBS, except when the library explicitly opts out
with gb_LinkTarget_disable_standard_system_libs.

Change-Id: I489a99114fbfa46d0421a27cf6c7b899dc268a4a
2012-09-28 16:49:08 +02:00
Michael Stahl b85c349783 gbuild: replace direct gb_STDLIBS use with ...
... new gb_LinkTarget_add_standard_system_libs

Change-Id: Ib2bc843098db3d8c6822b45a3d21724e67f57d69
2012-09-28 16:49:06 +02:00
Michael Stahl 2e677c3981 gbuild: split uwinapi out of gb_STDLIBS
Change-Id: I53316e0b9369d806197bccb42cf22d3497af43e7
2012-09-28 16:49:05 +02:00
Matúš Kukan 9e04ae0b7d add more runtime deps on resource files for unit-tests
Change-Id: Id9bbb2bbcafe335eada3f36ae103a9074a56848f
2012-08-21 02:06:01 +02:00
Michael Meeks fdda178d88 targetted improvement of UNO API includes / usage 2012-07-02 14:43:34 +01:00
Michael Stahl 4c50f23f87 LinkTarget.mk: remove gb_LinkTarget_add_package_headers 2012-04-08 01:05:53 +02:00
Michael Stahl c923f7d2c2 gbuild: "use" vs. "add":
Naming convention for gbuild methods:
- "add" is used for stuff that is logically a part of the target
  (i.e. not registered at the Module, but defined in the target's makefile)
- "use" is used for stuff that is logically a different target
  (i.e. it is registered at the Module, has it's own makefile, may be
  in a different module than the target)
2012-04-08 01:05:52 +02:00
Matúš Kukan 84b3f7b345 gbuild: get rid of realpath in gb_Foo_set_include 2012-03-10 21:23:20 +01:00
Matúš Kukan 4b30ec9def fdo#39491 -I$(OUTDIR)/inc is set in SOLARINC 2012-02-10 21:41:45 +01:00
Caolán McNamara c8ef924060 normalize Red Hat, Inc. spellings, and bump to latest template 2011-12-06 21:24:37 +00:00
Norbert Thiebaud 3f2ff54778 remove pch from the include list 2011-11-27 15:24:45 -06:00
Norbert Thiebaud 992757cc5e remove pre-compiled header support in gbuild and gbuildified module 2011-11-27 11:49:38 -06:00
Takeshi Abe b2bd33ea25 prefer makefile-gmake-mode to plain makefile-mode 2011-08-10 02:12:48 +09:00
Tor Lillqvist 4122c3b9d5 Add consistent Emacs and vim mode lines 2011-07-30 23:02:30 +03:00
Bjoern Michaelsen 200bc6c582 resyncing to master 2011-07-21 18:51:11 +02:00
Bjoern Michaelsen 1565f386d4 gnumake4: postmerge fixes in formula 2011-06-21 13:18:04 +02:00
David Tardon 68e8a84043 remove all traces of offuh from makefiles 2011-06-17 16:41:13 +02:00
David Tardon a29706246e gbuildize formula 2011-04-21 20:56:44 +02:00