summaryrefslogtreecommitdiff
path: root/reportbuilder/java/com/sun/star/report/function/metadata/AuthorFunction.java
blob: 1bbf417a4b8e89207d1dc1e477b201bbf3bc89a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * Copyright 2008 by Sun Microsystems, Inc.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * $RCSfile: AuthorFunction.java,v $
 * $Revision: 1.2 $
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/
package com.sun.star.report.function.metadata;

import com.sun.star.report.ReportEngineParameterNames;
import org.pentaho.reporting.libraries.formula.EvaluationException;
import org.pentaho.reporting.libraries.formula.FormulaContext;
import org.pentaho.reporting.libraries.formula.LibFormulaErrorValue;
import org.pentaho.reporting.libraries.formula.function.Function;
import org.pentaho.reporting.libraries.formula.function.ParameterCallback;
import org.pentaho.reporting.libraries.formula.lvalues.TypeValuePair;
import org.pentaho.reporting.libraries.formula.typing.coretypes.TextType;

/**
 *
 * @author Ocke Janssen
 */
public class AuthorFunction implements Function
{

    public String getCanonicalName()
    {
        return "AUTHOR";
    }

    public TypeValuePair evaluate(final FormulaContext context, final ParameterCallback parameters)
            throws EvaluationException
    {
        if (parameters.getParameterCount() != 0)
        {
            throw new EvaluationException(LibFormulaErrorValue.ERROR_ARGUMENTS_VALUE);
        }

        return new TypeValuePair(TextType.TYPE, context.getConfiguration().getConfigProperty(ReportEngineParameterNames.AUTHOR));
    }
}
f862995d227c31ae2aa0abd Reviewed-on: https://gerrit.libreoffice.org/83979 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 72bd0df107ee47c4d54fa88b4960d32ea03e9f69) Reviewed-on: https://gerrit.libreoffice.org/84620 2019-12-02tdf#123206 Import/Export chart custom label textTamas Bunth OOX import supports custom label texts in chart diagrams (produced by e.g. double clicking on a data label, and write custom text), but - since embedded objects are exported and imported to odf right after migration - it is not displayed in case of a Writer document. In order to make it work, we have to support custom label text in the odf structure. This commit only allows the import/export of pure text, it should be improved to store and load formatted string. A new XML token is added, which currently refers to an attribute of the chart:data-point tag. If we want to store formatted string, something more clever has to be done. Change-Id: I80c4a3a0dbcf59f1dc732d795fb716da318411cb Reviewed-on: https://gerrit.libreoffice.org/80156 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/84076 2019-10-07use FastParser in linguisticNoel Grandin Change-Id: Iee2254dc13ccc31d266009ba1eb00f2517484cc7 Reviewed-on: https://gerrit.libreoffice.org/79814 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2019-09-24Related: tdf#124600 sw anchored object allow overlap: add ODT filterMiklos Vajna Expose the AllowOverlap shape property as <style:graphic-properties loext:allow-overlap="..."/>. Change-Id: I6b6e08c67224ac7d4fb87046ea8accf94cdb583f Reviewed-on: https://gerrit.libreoffice.org/79462 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins 2019-08-22QR Code : ODF import/exportShubham Goyal Change-Id: I6c1ae63a89d5ed34d2fa245279d4552949bb64a7 Reviewed-on: https://gerrit.libreoffice.org/74853 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> 2019-07-25tdf#119228 Add storage and serialisation for the Resolved flagScott Clarke Change-Id: I0278588dc533378104e544d05b60583c85271f6a Co-authored-by: Jim MacArthur <jim.macarthur@codethink.co.uk> Reviewed-on: https://gerrit.libreoffice.org/75858 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> 2019-02-13sw btlr writing mode: implement ODF filterMiklos Vajna An easy way would be to just extend aXML_WritingDirection_Enum, but then we would write the new attribute value to a non-extension namespace. So special case the new attribute value during both import and export (and only for table cells as a start). Change-Id: I431bf99693c4a3452e91f241bd2f0fcfc72c68fd Reviewed-on: https://gerrit.libreoffice.org/67770 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins 2018-12-08related tdf#51671, store new "hide legend" feature also in ODFMarkus Mohrhard Change-Id: Ibf55f02eccdcadb2d42f5aff8d72bff20ada3b3a Reviewed-on: https://gerrit.libreoffice.org/64792 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> 2018-08-06Export Data Transformations to ODF - follow-upVikas Mahato Change-Id: I8aea387f5db399e27b2a08224f6c4ac59f26c54c Reviewed-on: https://gerrit.libreoffice.org/58254 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> 2018-07-17remove the GL based 3D chartsMarkus Mohrhard Change-Id: Ia578c71ae70aa0a85b49fa50138edf90f961b1e9 Reviewed-on: https://gerrit.libreoffice.org/57533 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> 2018-07-11ODF export data transformations -follow-upVikas Mahato Change-Id: I31a0b29d94abb59e7633c45aa1536772b2d8c102 Reviewed-on: https://gerrit.libreoffice.org/57217 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> 2018-07-10Revert "tdf#118324 Extend ODF for blank in integer"Eike Rathke This reverts commit c290f692dd28094d41dff686f3faa1c4e14b556e. Reverting because a) makes builds fail with errors from the schema validator in saving unit tests b) the loext:max-blank-integer-digits is now saved for some number formats where it is not necessary For example, load sc/qa/unit/data/ods/tdf102370_ExponentWithoutSign.ods save as .xlsx reload the .xlsx save as .ods (which effectively is what the ScExportTest::testExponentWithoutSignFormatXLSX() unit test does and makes the schema validator stumble) Change-Id: Iaac7e42b23317e7977876c9b5d545c76a1e2a4d2 Reviewed-on: https://gerrit.libreoffice.org/57240 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> 2018-07-10tdf#118324 Extend ODF for blank in integerLaurent BP Following resolution of tdf#117575, this commit add disambiguation between '0' and '?' in integer part XML_MAX_BLANK_INTEGER_DIGITS is added for the number of '?' XML_MIN_INTEGER_DIGITS is the number of '?' and '0' This preserve compatibility with previous versions: in previous versions '?' will be transformed in '0' It also applies to scientific and fraction numbers. Change-Id: I6e1185bbece9c615240425cc973d59052b22aa34 Reviewed-on: https://gerrit.libreoffice.org/56352 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com> 2018-07-02Export data transformations to odfVikas Change-Id: Ie36aef4a4ee550a1bb5407305f13726d55eeea58 Reviewed-on: https://gerrit.libreoffice.org/56665 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> 2018-06-08tdf#115007: add import/export to NatNum12 (spell out numbers,László Németh dates and money amounts, supporting all the XNumberText/libnumbertext formatting codes, for example "ordinal", "ordinal-number", "ordinal-feminine", etc., and ISO 4217 currency codes, also their possible combinations. NatNum12 formatting codes are stored by using the newly introduced (yet, loext:)transliteration-spellout attribute. creator-initials also added to token list Change-Id: I20f93c9d16778f142067a56d53b336d0acbe2d92 Reviewed-on: https://gerrit.libreoffice.org/54673 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: László Németh <nemeth@numbertext.org> 2018-04-08tdf#112384 sw: Allow New line as a label followed by chapter numberingNithin Kumar Padavu reference-language also added to token list Change-Id: I32713508d3611dc2bce10b2c5abb1e1a4167bdaf Reviewed-on: https://gerrit.libreoffice.org/52561 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>