OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 156 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 156 Rev 182
Line 1... Line 1...
1
/*
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 * 
3
 * 
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
4
 * Copyright 2011-2019 OpenConcerto, by ILM Informatique. All rights reserved.
5
 * 
5
 * 
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
9
 * language governing permissions and limitations under the License.
9
 * language governing permissions and limitations under the License.
Line 140... Line 140...
140
            TableSorter sorter = (TableSorter) tModel;
140
            TableSorter sorter = (TableSorter) tModel;
141
            final Element sortingColsElem = doc.createElement("sortingColumns");
141
            final Element sortingColsElem = doc.createElement("sortingColumns");
142
            elem.appendChild(sortingColsElem);
142
            elem.appendChild(sortingColsElem);
143
            for (final Directive d : sorter.getSortingColumns()) {
143
            for (final Directive d : sorter.getSortingColumns()) {
144
                final Element colElem = doc.createElement("sortCol");
144
                final Element colElem = doc.createElement("sortCol");
-
 
145
 
145
                sortingColsElem.appendChild(colElem);
146
                sortingColsElem.appendChild(colElem);
146
                final TableColumn col;
147
                final TableColumn col;
147
                if (visibilityModel != null) {
148
                if (visibilityModel != null) {
148
                    col = visibilityModel.getColumnByModelIndex(d.getColumn());
149
                    col = visibilityModel.getColumnByModelIndex(d.getColumn());
-
 
150
                    if (col == null) {
-
 
151
                        Log.get().warning("null column in visibilityModel column : " + d.getColumn());
-
 
152
                    }
149
                } else {
153
                } else {
150
                    col = model.getColumn(getSrc().convertColumnIndexToView(d.getColumn()));
154
                    col = model.getColumn(getSrc().convertColumnIndexToView(d.getColumn()));
-
 
155
                    if (col == null) {
-
 
156
                        Log.get().warning("null column in model for : " + getSrc().convertColumnIndexToView(d.getColumn()));
151
                }
157
                    }
-
 
158
                }
-
 
159
                if (col != null) {
152
                colElem.setAttribute(IDENTIFIER_ATTR, String.valueOf(col.getIdentifier()));
160
                    colElem.setAttribute(IDENTIFIER_ATTR, String.valueOf(col.getIdentifier()));
153
                final int status = d.getDirection();
161
                    final int status = d.getDirection();
154
                setSortAttribute(colElem, status);
162
                    setSortAttribute(colElem, status);
155
            }
163
                }
156
        }
164
            }
-
 
165
        }
157
 
166
 
158
        // Use a Transformer for output
167
        // Use a Transformer for output
159
        final TransformerFactory tFactory = TransformerFactory.newInstance();
168
        final TransformerFactory tFactory = TransformerFactory.newInstance();
160
        try {
169
        try {
161
            tFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
170
            tFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);