summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java/mod/_xmloff/Chart/XMLStylesImporter.java
blob: ee91a846fe4817b6147f976721162d8927da8531 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

package mod._xmloff.Chart;

import java.io.PrintWriter;

import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
import lib.TestParameters;
import util.SOfficeFactory;

import com.sun.star.chart.XChartDocument;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.XInterface;

/**
 * Test for object which is represented by service
 * <code>com.sun.star.comp.Chart.XMLStylesImporter</code>. <p>
 * Object implements the following interfaces :
 * <ul>
 *  <li><code>com::sun::star::lang::XInitialization</code></li>
 *  <li><code>com::sun::star::document::XImporter</code></li>
 *  <li><code>com::sun::star::document::XFilter</code></li>
 *  <li><code>com::sun::star::document::ImportFilter</code></li>
 *  <li><code>com::sun::star::beans::XPropertySet</code></li>
 *  <li><code>com::sun::star::xml::sax::XDocumentHandler</code></li>
 * </ul>
 * @see com.sun.star.lang.XInitialization
 * @see com.sun.star.document.XImporter
 * @see com.sun.star.document.XFilter
 * @see com.sun.star.document.ImportFilter
 * @see com.sun.star.beans.XPropertySet
 * @see com.sun.star.xml.sax.XDocumentHandler
 * @see ifc.lang._XInitialization
 * @see ifc.document._XImporter
 * @see ifc.document._XFilter
 * @see ifc.document._XExporter
 * @see ifc.beans._XPropertySet
 * @see ifc.xml.sax._XDocumentHandler
 */
public class XMLStylesImporter extends TestCase {
    XComponent comp ;
    XChartDocument xChartDoc = null;

    /**
    * New chart document created.
    */
    protected void initialize( TestParameters tParam, PrintWriter log ) {
        // get a soffice factory object
        SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());

        try {
            log.println( "creating a chartdocument" );
            xChartDoc = SOF.createChartDoc(null);
        } catch ( Exception e ) {
            // Some exception occures.FAILED
            e.printStackTrace( log );
            throw new StatusException( "Couldn't create document", e );
        }

        comp = xChartDoc;
    }

   /**
     * Close document
     */
    protected void cleanup( TestParameters tParam, PrintWriter log ) {
        if( xChartDoc!=null ) {
            log.println( "    closing xChartDoc" );
            util.DesktopTools.closeDoc(xChartDoc);
            xChartDoc = null;
            comp = null;
        }
    }

    /**
    * Creating a Testenvironment for the interfaces to be tested.
    * Creates an instance of the service
    * <code>com.sun.star.comp.Chart.XMLStylesImporter</code><p>
    *
    * The chart document is set as a target document for importer.
    *     Object relations created :
    * <ul>
    *  <li> <code>'XDocumentHandler.XMLData'</code> for
    *      {@link ifc.xml.sax._XDocumentHandler} interface </li>
    *  <li> <code>'XDocumentHandler.ImportChecker'</code> for
    *      {@link ifc.xml.sax._XDocumentHandler} interface </li>
    *  <li> <code>'TargetDocument'</code> for
    *      {@link ifc.document._XImporter} interface </li>
    * </ul>
    */
    public synchronized TestEnvironment createTestEnvironment
            (TestParameters tParam, PrintWriter log) {

        XInterface oObj = null;
        Object oInt = null ;

        // creation of testobject here
        // first we write what we are intend to do to log file
        log.println( "creating a test environment" );

        XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF() ;

        try {
            oInt = xMSF.createInstance
                ("com.sun.star.comp.Chart.XMLStylesImporter") ;

        } catch (com.sun.star.uno.Exception e) {
            e.printStackTrace(log) ;
            throw new StatusException("Can't create component.", e) ;
        }

        oObj = (XInterface) oInt ;

        // create testobject here
        log.println( "creating a new environment for Paragraph object" );
        TestEnvironment tEnv = new TestEnvironment( oObj );

        // adding relation
        tEnv.addObjRelation("TargetDocument", comp) ;

        // adding relation for XDocumentHandler
        String[][] xml = new String[][] {
            {"start", "office:document-styles",
                "xmlns:office", "CDATA", "http://openoffice.org/2000/office",
                "xmlns:text", "CDATA", "http://openoffice.org/2000/text",
                "xmlns:chart", "CDATA", "http://openoffice.org/2000/chart",
                "xmlns:style", "CDATA", "http://openoffice.org/2000/style",
                "xmlns:svg", "CDATA", "http://openoffice.org/2000/svg",
                "office:class", "CDATA", "chart",
                "office:version", "CDATA", "1.0"
                },
            {"start", "office:styles"},
            {"end", "office:styles"},
            {"end", "office:document-styles"}} ;

        tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;

        final PrintWriter logF = log ;

        tEnv.addObjRelation("XDocumentHandler.ImportChecker",
            new ifc.xml.sax._XDocumentHandler.ImportChecker() {
                public boolean checkImport() {
                        logF.println("No ways to check styles import were not found.");
                        logF.println(" TRUE returned.");
                        return true ;
/*                    } catch (com.sun.star.uno.Exception e) {
                        logF.println("Exception occurred while checking filter :") ;
                        e.printStackTrace(logF) ;
                        return false ;
                    }
*/                }
            }) ;


        return tEnv;
    } // finish method getTestEnvironment
}
t() TopRight().X() -> Right() BottomRight().X() -> Right() TopLeft().Y() -> Top() TopRight().Y() -> Top() BottomLeft().Y() -> Bottom() BottomRight().Y() -> Bottom() Change-Id: I5050f619bf92cfc59b6f8dfe7c9f98ef1453c294 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110022 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> 2020-12-03jsdialog: fix arrays in JsonWriter outputSzymon Kłos Change-Id: I5638b1b02afcdd57b16b60d83d3d15da45866060 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107066 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> 2020-11-24loplugin:stringviewparam extend to comparison operatorsNoel which means that some call sites have to change to use unicode string literals i.e. u"foo" instead of "foo" Change-Id: Ie51c3adf56d343dd1d1710777f9d2a43ee66221c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106125 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2020-10-19use tools::Long in vclNoel Change-Id: Ice1055021e8568634e9a66ba89d3bb4ef4e731df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104522 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2020-09-08tdf#136208 make combo/list/spin take focus on use of scroll wheelCaolán McNamara So using the scrollwheel on those widgets when they do not have focus will cause then to take focus. That will then cause the fontsize/fontname widgets to reset back to the current document size/name if they are scrolled to a new value, but their new value not explicitly applied to the current document, when focus is restored to the document window. Change-Id: I5d27e5e90c4d76d9cb3321878d82e22d40cacf81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102261 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> 2020-08-26make get_extents_relative_to constCaolán McNamara Change-Id: I031c42cd85395a777c20bdd052da4233bc2fedab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101414 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> 2020-08-04loplugin:flatten in vclNoel Grandin Change-Id: I271cc67ecf34acbf0edbda960e33315fb6a1f9dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100041 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2020-06-25use tools::JsonWriter for dumping property treeNoel Grandin Change-Id: I8f55af19ba10b71bd621e69b27000ab7cb565309 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96677 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2020-06-25loplugin:unusedfieldsNoel Grandin Change-Id: I7d8cd41c6b4b97a6d33764a8580f08413e584a69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97046 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2020-06-23move ListBox to toolkit-only headersCaolán McNamara Change-Id: I6266dedb17cd7c3b730fc69804695536fef37cfc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96751 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> 2020-06-18mbStackMode is always false nowCaolán McNamara Change-Id: I3d6c9b0cc07b3750a3f24b4cfc5138b49e62d06d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96600 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> 2020-06-11loplugin:unusedmethodsNoel Grandin Change-Id: I1050fabdc0c98bbb0cc1d81a41c5b6ac3404cacf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96111 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2020-05-25loplugin:unusedmethodsNoel Grandin Change-Id: I235e00eca7b7cbc070bf5831117868eba5c7c273 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94791 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2020-05-22remove Size arg from Window::Draw and depend on GetSizePixelCaolán McNamara 90% of cases pass GetSizePixel as the Size arg already and this aligns Window::Draw with how Window::PaintToDevice works Change-Id: If5b024179a4b7a3b099177c2f6d4b1fb006b95ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94644 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> 2020-04-24loplugin:unnecessaryvirtualNoel Grandin Change-Id: Iec5de34f908ac370302ab51a33f17dfc23ea2446 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92834 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2020-04-24loplugin:unusedmethodsNoel Grandin Change-Id: Ieec5099a8ce9fa3f07e36be244071efc1b101cf7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92803 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2020-02-19drop newly unused methodsCaolán McNamara Change-Id: I390134b3cd0187f0adcced3625ad0a3a26f8fe28 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89008 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> 2020-01-31tdf#83248 Print using the right color for other components too.Arnaud Versini PDF and printed documents should be the same. Change-Id: I34f43688f4ec8945c65a414bc0d955dea45dc9b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87761 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2020-01-13loplugin:unusedmethodsNoel Grandin Change-Id: I4eae284cf763b260dd9349bf8d31f46612916de1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86654 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2019-12-13loplugin:unusedmethodsNoel Grandin Change-Id: I8ad75d1251df4d6f8097aaa68e4ec92331e38ad4 Reviewed-on: https://gerrit.libreoffice.org/85077 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2019-11-26tdf#129037 add a way to select multiple entries of a ListBox togetherCaolán McNamara Change-Id: I362a9e9e644e15f0dd3aeb691973a0979d17eeb0 Reviewed-on: https://gerrit.libreoffice.org/83771 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> 2019-11-07loplugin:unusedmethodsNoel Grandin Change-Id: I65354c7476dfaede1a607441d7c1b0c7ad038df4 Reviewed-on: https://gerrit.libreoffice.org/82186 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2019-10-25tdf#42949 Fix IWYU warning in include/vcl/window.hxxGabor Kelemen The boost/property_tree/ptree.hpp added in commit 75b8db7fa7344a679d3c5dbdc8c5bd4228cdbc7c turns out to be rather expensive: it adds about 900 kB per compilation unit and window.hxx is included in about 2600 compilation units Replacing it with forward declaration header has reduced total includebloat from 26.1 Gb to about 22.7 Change-Id: I797608b54a62a5838c7a5d47355fb6bd736ad36c Reviewed-on: https://gerrit.libreoffice.org/81500 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>