2002-01-31 02:22:28 +00:00
/ * = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
2006-12-22 19:18:16 +00:00
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
2004-04-09 13:05:39 +00:00
http : //www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing , software
distributed under the License is distributed on an " AS IS " BASIS ,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied .
See the License for the specific language governing permissions and
limitations under the License .
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * /
2002-01-31 02:22:28 +00:00
2004-08-23 08:52:54 +00:00
2002-01-31 02:22:28 +00:00
package org.apache.poi.hssf.usermodel ;
2013-10-25 18:41:24 +00:00
import java.util.List ;
2009-12-22 00:51:29 +00:00
import org.apache.poi.hssf.model.InternalWorkbook ;
2002-01-31 02:22:28 +00:00
import org.apache.poi.hssf.record.ExtendedFormatRecord ;
Merged revisions 638786-638802,638805-638811,638813-638814,638816-639230,639233-639241,639243-639253,639255-639486,639488-639601,639603-639835,639837-639917,639919-640056,640058-640710,640712-641156,641158-641184,641186-641795,641797-641798,641800-641933,641935-641963,641965-641966,641968-641995,641997-642230,642232-642562,642564-642565,642568-642570,642572-642573,642576-642736,642739-642877,642879,642881-642890,642892-642903,642905-642945,642947-643624,643626-643653,643655-643669,643671,643673-643830,643832-643833,643835-644342,644344-644472,644474-644508,644510-645347,645349-645351,645353-645559,645561-645565,645568-645951,645953-646193,646195-646311,646313-646404,646406-646665,646667-646853,646855-646869,646871-647151,647153-647185,647187-647277,647279-647566,647568-647573,647575,647578-647711,647714-647737,647739-647823,647825-648155,648157-648202,648204-648273,648275,648277-648302,648304-648333,648335-648588,648590-648622,648625-648673,648675-649141,649144,649146-649556,649558-649795,649799,649801-649910,649912-649913,649915-650128,650131-650132,650134-650137,650140-650914,650916-651991,651993-652284,652286-652287,652289,652291,652293-652297,652299-652328,652330-652425,652427-652445,652447-652560,652562-652933,652935,652937-652993,652995-653116,653118-653124,653126-653483,653487-653519,653522-653550,653552-653607,653609-653667,653669-653674,653676-653814,653817-653830,653832-653891,653893-653944,653946-654055,654057-654355,654357-654365,654367-654648,654651-655215,655217-655277,655279-655281,655283-655911,655913-656212,656214,656216-656251,656253-656698,656700-656756,656758-656892,656894-657135,657137-657165,657168-657179,657181-657354,657356-657357,657359-657701,657703-657874,657876-658032,658034-658284,658286,658288-658301,658303-658307,658309-658321,658323-658335,658337-658348,658351,658353-658832,658834-658983,658985,658987-659066,659068-659402,659404-659428,659430-659451,659453-659454,659456-659461,659463-659477,659479-659524,659526-659571,659574,659576-660255,660257-660262,660264-660279,660281-660343,660345-660473,660475-660827,660829-660833,660835-660888,660890-663321,663323-663435,663437-663764,663766-663854,663856-664219,664221-664489,664494-664514,664516-668013,668015-668142,668144-668152,668154,668156-668256,668258,668260-669139,669141-669455,669457-669657,669659-669808,669810-670189,670191-671321,671323-672229,672231-672549,672551-672552,672554-672561,672563-672566,672568,672571-673049,673051-673852,673854-673862,673864-673986,673988-673996,673998-674347,674349-674890,674892-674910,674912-674936,674938-674952,674954-675078,675080-675085,675087-675217,675219-675660,675662-675670,675672-675716,675718-675726,675728-675733,675735-675775,675777-675782,675784,675786-675791,675794-676205 via svnmerge from
https://svn.apache.org:443/repos/asf/poi/trunk
........
r675853 | josh | 2008-07-11 08:59:44 +0100 (Fri, 11 Jul 2008) | 1 line
Patch 45289 - finished support for special comparison operators in COUNTIF
........
r676201 | nick | 2008-07-12 17:56:55 +0100 (Sat, 12 Jul 2008) | 1 line
Support for cloning one font record onto another, plus tests
........
r676203 | nick | 2008-07-12 18:21:54 +0100 (Sat, 12 Jul 2008) | 1 line
Support for cloning one extended format record onto another, plus tests
........
r676205 | nick | 2008-07-12 18:38:10 +0100 (Sat, 12 Jul 2008) | 1 line
Allow the cloning of one HSSFCellStyle onto another, including cloning styles from one HSSFWorkbook onto another
........
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@676209 13f79535-47bb-0310-9956-ffa450edef68
2008-07-12 18:17:16 +00:00
import org.apache.poi.hssf.record.FontRecord ;
2013-10-25 18:41:24 +00:00
import org.apache.poi.hssf.record.FormatRecord ;
2008-09-15 17:01:46 +00:00
import org.apache.poi.hssf.record.StyleRecord ;
2008-01-24 10:10:55 +00:00
import org.apache.poi.hssf.util.HSSFColor ;
2016-04-05 20:28:46 +00:00
import org.apache.poi.ss.usermodel.BorderStyle ;
2008-01-24 10:10:55 +00:00
import org.apache.poi.ss.usermodel.CellStyle ;
2016-07-08 22:28:28 +00:00
import org.apache.poi.ss.usermodel.FillPatternType ;
2008-01-24 10:10:55 +00:00
import org.apache.poi.ss.usermodel.Font ;
2016-07-10 08:29:02 +00:00
import org.apache.poi.ss.usermodel.HorizontalAlignment ;
import org.apache.poi.ss.usermodel.VerticalAlignment ;
2016-09-14 03:33:52 +00:00
import org.apache.poi.util.Removal ;
2002-01-31 02:22:28 +00:00
/ * *
* High level representation of the style of a cell in a sheet of a workbook .
*
* @see org . apache . poi . hssf . usermodel . HSSFWorkbook # createCellStyle ( )
2015-12-29 02:57:58 +00:00
* @see org . apache . poi . hssf . usermodel . HSSFWorkbook # getCellStyleAt ( int )
2002-01-31 02:22:28 +00:00
* @see org . apache . poi . hssf . usermodel . HSSFCell # setCellStyle ( HSSFCellStyle )
* /
2009-08-18 16:50:24 +00:00
public final class HSSFCellStyle implements CellStyle {
2015-12-28 05:43:11 +00:00
private final ExtendedFormatRecord _format ;
private final short _index ;
private final InternalWorkbook _workbook ;
2002-01-31 02:22:28 +00:00
2002-03-03 09:27:13 +00:00
2002-01-31 02:22:28 +00:00
/** Creates new HSSFCellStyle why would you want to do this?? */
2008-03-22 14:38:43 +00:00
protected HSSFCellStyle ( short index , ExtendedFormatRecord rec , HSSFWorkbook workbook )
{
2016-04-05 23:47:41 +00:00
this ( index , rec , workbook . getWorkbook ( ) ) ;
2008-03-22 14:38:43 +00:00
}
2009-12-22 00:51:29 +00:00
protected HSSFCellStyle ( short index , ExtendedFormatRecord rec , InternalWorkbook workbook )
2002-01-31 02:22:28 +00:00
{
2009-08-18 16:50:24 +00:00
_workbook = workbook ;
_index = index ;
_format = rec ;
2002-01-31 02:22:28 +00:00
}
/ * *
* get the index within the HSSFWorkbook ( sequence within the collection of ExtnededFormat objects )
* @return unique index number of the underlying record this style represents ( probably you don ' t care
* unless you ' re comparing which one is which )
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public short getIndex ( )
{
2009-08-18 16:50:24 +00:00
return _index ;
2002-01-31 02:22:28 +00:00
}
2009-08-18 16:50:24 +00:00
2008-09-15 17:01:46 +00:00
/ * *
* Return the parent style for this cell style .
* In most cases this will be null , but in a few
* cases there ' ll be a fully defined parent .
* /
public HSSFCellStyle getParentStyle ( ) {
2011-03-11 17:33:36 +00:00
short parentIndex = _format . getParentIndex ( ) ;
// parentIndex equal 0xFFF indicates no inheritance from a cell style XF (See 2.4.353 XF)
2016-04-05 23:47:41 +00:00
if ( parentIndex = = 0 | | parentIndex = = 0xFFF ) {
return null ;
}
return new HSSFCellStyle (
parentIndex ,
_workbook . getExFormatAt ( parentIndex ) ,
_workbook
) ;
2008-09-15 17:01:46 +00:00
}
2002-01-31 02:22:28 +00:00
/ * *
2002-09-06 04:08:30 +00:00
* set the data format ( must be a valid format )
2002-01-31 02:22:28 +00:00
* @see org . apache . poi . hssf . usermodel . HSSFDataFormat
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public void setDataFormat ( short fmt )
{
2009-08-18 16:50:24 +00:00
_format . setFormatIndex ( fmt ) ;
2002-01-31 02:22:28 +00:00
}
/ * *
2002-09-06 04:08:30 +00:00
* get the index of the format
2002-01-31 02:22:28 +00:00
* @see org . apache . poi . hssf . usermodel . HSSFDataFormat
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public short getDataFormat ( )
{
2009-08-18 16:50:24 +00:00
return _format . getFormatIndex ( ) ;
2002-01-31 02:22:28 +00:00
}
2009-08-18 16:50:24 +00:00
2014-05-26 20:03:08 +00:00
// we keep the cached data in ThreadLocal members in order to
// avoid multi-threading issues when different workbooks are accessed in
// multiple threads at the same time
2015-12-28 05:43:11 +00:00
private static final ThreadLocal < Short > lastDateFormat = new ThreadLocal < Short > ( ) {
2014-05-26 20:03:08 +00:00
protected Short initialValue ( ) {
return Short . MIN_VALUE ;
}
} ;
2015-12-28 05:43:11 +00:00
private static final ThreadLocal < List < FormatRecord > > lastFormats = new ThreadLocal < List < FormatRecord > > ( ) ;
private static final ThreadLocal < String > getDataFormatStringCache = new ThreadLocal < String > ( ) ;
2014-05-26 20:03:08 +00:00
2007-08-06 13:38:48 +00:00
/ * *
* Get the contents of the format string , by looking up
Merged revisions 638001-638784,638786-639486,639488-639601,639603-639836 via svnmerge from
https://svn.apache.org/repos/asf/poi/trunk
........
r638803 | nick | 2008-03-19 11:57:38 +0000 (Wed, 19 Mar 2008) | 1 line
Added test to show that bug #41546 is already fixed. Also rename a test file to be more consistent
........
r638804 | nick | 2008-03-19 12:01:32 +0000 (Wed, 19 Mar 2008) | 1 line
Add test to show that bug #43251 is already fixed
........
r638812 | nick | 2008-03-19 12:28:56 +0000 (Wed, 19 Mar 2008) | 1 line
Patch from Dmitriy from bug #30311 - Support for conditional formatting records
........
r638815 | nick | 2008-03-19 12:49:35 +0000 (Wed, 19 Mar 2008) | 1 line
Fix bug #44627 - improve the thread safety of POILogFactory
........
r639231 | nick | 2008-03-20 10:06:59 +0000 (Thu, 20 Mar 2008) | 1 line
Test relating to bug #44636
........
r639232 | nick | 2008-03-20 10:16:15 +0000 (Thu, 20 Mar 2008) | 1 line
Simple patch from Josh from bug #44636 - fix for RefVPtg and edit-in-excel oddness
........
r639242 | nick | 2008-03-20 11:02:39 +0000 (Thu, 20 Mar 2008) | 1 line
Fix for readCompressedUnicode not moaning about length=0, from bug #44643
........
r639254 | nick | 2008-03-20 11:43:14 +0000 (Thu, 20 Mar 2008) | 1 line
Make junit happy
........
r639836 | nick | 2008-03-21 21:04:47 +0000 (Fri, 21 Mar 2008) | 1 line
Tweak how you get dataformat strings out of cell styles, to be more logical, and in keeping with how we'll want to do things for xssf too
........
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@642557 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 17:00:47 +00:00
* the DataFormat against the bound workbook
2007-08-06 13:38:48 +00:00
* @see org . apache . poi . hssf . usermodel . HSSFDataFormat
Merged revisions 638786-638802,638805-638811,638813-638814,638816-639230,639233-639241,639243-639253,639255-639486,639488-639601,639603-639835,639837-639917,639919-640056,640058-640710,640712-641156,641158-641184,641186-641795,641797-641798,641800-641933,641935-641963,641965-641966,641968-641995,641997-642230,642232-642562,642564-642565,642568-642570,642572-642573,642576-642736,642739-642877,642879,642881-642890,642892-642903,642905-642945,642947-643624,643626-643653,643655-643669,643671,643673-643830,643832-643833,643835-644342,644344-644472,644474-644508,644510-645347,645349-645351,645353-645559,645561-645565,645568-645951,645953-646193,646195-646311,646313-646404,646406-646665,646667-646853,646855-646869,646871-647151,647153-647185,647187-647277,647279-647566,647568-647573,647575,647578-647711,647714-647737,647739-647823,647825-648155,648157-648202,648204-648273,648275,648277-648302,648304-648333,648335-648588,648590-648622,648625-648673,648675-649141,649144,649146-649556,649558-649795,649799,649801-649910,649912-649913,649915-650128,650131-650132,650134-650137,650140-650914,650916-651991,651993-652284,652286-652287,652289,652291,652293-652297,652299-652328,652330-652425,652427-652445,652447-652560,652562-652933,652935,652937-652993,652995-653116,653118-653124,653126-653483,653487-653519,653522-653550,653552-653607,653609-653667,653669-653674,653676-653814,653817-653830,653832-653891,653893-653944,653946-654055,654057-654355,654357-654365,654367-654648,654651-655215,655217-655277,655279-655281,655283-655911,655913-656212,656214,656216-656251,656253-656698,656700-656756,656758-656892,656894-657135,657137-657165,657168-657179,657181-657354,657356-657357,657359-657701,657703-657874,657876-658032,658034-658284,658286,658288-658301,658303-658307,658309-658321,658323-658335,658337-658348,658351,658353-658832,658834-658983,658985,658987-659066,659068-659402,659404-659428,659430-659451,659453-659454,659456-659461,659463-659477,659479-659524,659526-659571,659574,659576-660255,660257-660262,660264-660279,660281-660343,660345-660473,660475-660827,660829-660833,660835-660888,660890-663321,663323-663435,663437-663764,663766-663854,663856-664219,664221-664489,664494-664514,664516-668013,668015-668142,668144-668152,668154,668156-668256,668258,668260-669139,669141-669455,669457-669657,669659-669808,669810-670189,670191-671321,671323-672229,672231-672549,672551-672552,672554-672561,672563-672566,672568,672571-673049,673051-673852,673854-673862,673864-673986,673988-673996,673998-674347,674349-674890,674892-674910,674912-674936,674938-674952,674954-675078,675080-675085,675087-675217,675219-675660,675662-675670,675672-675716,675718-675726,675728-675733,675735-675775,675777-675782,675784,675786-675791,675794-675852,675854-676200,676202,676204,676206-676220,676222-676309,676311-677004 via svnmerge from
https://svn.apache.org/repos/asf/poi/trunk
........
r676457 | josh | 2008-07-14 00:23:13 +0100 (Mon, 14 Jul 2008) | 1 line
Fix for bug 45380 - added return keyword in ArrayPtg.toFormulaString()
........
r676995 | yegor | 2008-07-15 19:13:50 +0100 (Tue, 15 Jul 2008) | 1 line
fixed bug #45322: HSSFSheet.autoSizeColumn() throws NPE when cell number format was not found
........
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@677006 13f79535-47bb-0310-9956-ffa450edef68
2008-07-15 18:56:24 +00:00
* @return the format string or " General " if not found
2007-08-06 13:38:48 +00:00
* /
2015-12-28 05:43:11 +00:00
@Override
2008-03-22 14:38:43 +00:00
public String getDataFormatString ( ) {
2014-05-26 20:03:08 +00:00
if ( getDataFormatStringCache . get ( ) ! = null ) {
if ( lastDateFormat . get ( ) = = getDataFormat ( ) & & _workbook . getFormats ( ) . equals ( lastFormats . get ( ) ) ) {
return getDataFormatStringCache . get ( ) ;
2013-10-25 18:41:24 +00:00
}
}
2014-05-26 20:03:08 +00:00
lastFormats . set ( _workbook . getFormats ( ) ) ;
lastDateFormat . set ( getDataFormat ( ) ) ;
2013-10-25 18:41:24 +00:00
2014-05-26 20:03:08 +00:00
getDataFormatStringCache . set ( getDataFormatString ( _workbook ) ) ;
2013-10-25 18:41:24 +00:00
2014-05-26 20:03:08 +00:00
return getDataFormatStringCache . get ( ) ;
2007-08-06 13:38:48 +00:00
}
2013-10-25 18:41:24 +00:00
Merged revisions 638001-638784,638786-639486,639488-639601,639603-639836 via svnmerge from
https://svn.apache.org/repos/asf/poi/trunk
........
r638803 | nick | 2008-03-19 11:57:38 +0000 (Wed, 19 Mar 2008) | 1 line
Added test to show that bug #41546 is already fixed. Also rename a test file to be more consistent
........
r638804 | nick | 2008-03-19 12:01:32 +0000 (Wed, 19 Mar 2008) | 1 line
Add test to show that bug #43251 is already fixed
........
r638812 | nick | 2008-03-19 12:28:56 +0000 (Wed, 19 Mar 2008) | 1 line
Patch from Dmitriy from bug #30311 - Support for conditional formatting records
........
r638815 | nick | 2008-03-19 12:49:35 +0000 (Wed, 19 Mar 2008) | 1 line
Fix bug #44627 - improve the thread safety of POILogFactory
........
r639231 | nick | 2008-03-20 10:06:59 +0000 (Thu, 20 Mar 2008) | 1 line
Test relating to bug #44636
........
r639232 | nick | 2008-03-20 10:16:15 +0000 (Thu, 20 Mar 2008) | 1 line
Simple patch from Josh from bug #44636 - fix for RefVPtg and edit-in-excel oddness
........
r639242 | nick | 2008-03-20 11:02:39 +0000 (Thu, 20 Mar 2008) | 1 line
Fix for readCompressedUnicode not moaning about length=0, from bug #44643
........
r639254 | nick | 2008-03-20 11:43:14 +0000 (Thu, 20 Mar 2008) | 1 line
Make junit happy
........
r639836 | nick | 2008-03-21 21:04:47 +0000 (Fri, 21 Mar 2008) | 1 line
Tweak how you get dataformat strings out of cell styles, to be more logical, and in keeping with how we'll want to do things for xssf too
........
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@642557 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 17:00:47 +00:00
/ * *
* Get the contents of the format string , by looking up
* the DataFormat against the supplied workbook
* @see org . apache . poi . hssf . usermodel . HSSFDataFormat
Merged revisions 638786-638802,638805-638811,638813-638814,638816-639230,639233-639241,639243-639253,639255-639486,639488-639601,639603-639835,639837-639917,639919-640056,640058-640710,640712-641156,641158-641184,641186-641795,641797-641798,641800-641933,641935-641963,641965-641966,641968-641995,641997-642230,642232-642562,642564-642565,642568-642570,642572-642573,642576-642736,642739-642877,642879,642881-642890,642892-642903,642905-642945,642947-643624,643626-643653,643655-643669,643671,643673-643830,643832-643833,643835-644342,644344-644472,644474-644508,644510-645347,645349-645351,645353-645559,645561-645565,645568-645951,645953-646193,646195-646311,646313-646404,646406-646665,646667-646853,646855-646869,646871-647151,647153-647185,647187-647277,647279-647566,647568-647573,647575,647578-647711,647714-647737,647739-647823,647825-648155,648157-648202,648204-648273,648275,648277-648302,648304-648333,648335-648588,648590-648622,648625-648673,648675-649141,649144,649146-649556,649558-649795,649799,649801-649910,649912-649913,649915-650128,650131-650132,650134-650137,650140-650914,650916-651991,651993-652284,652286-652287,652289,652291,652293-652297,652299-652328,652330-652425,652427-652445,652447-652560,652562-652933,652935,652937-652993,652995-653116,653118-653124,653126-653483,653487-653519,653522-653550,653552-653607,653609-653667,653669-653674,653676-653814,653817-653830,653832-653891,653893-653944,653946-654055,654057-654355,654357-654365,654367-654648,654651-655215,655217-655277,655279-655281,655283-655911,655913-656212,656214,656216-656251,656253-656698,656700-656756,656758-656892,656894-657135,657137-657165,657168-657179,657181-657354,657356-657357,657359-657701,657703-657874,657876-658032,658034-658284,658286,658288-658301,658303-658307,658309-658321,658323-658335,658337-658348,658351,658353-658832,658834-658983,658985,658987-659066,659068-659402,659404-659428,659430-659451,659453-659454,659456-659461,659463-659477,659479-659524,659526-659571,659574,659576-660255,660257-660262,660264-660279,660281-660343,660345-660473,660475-660827,660829-660833,660835-660888,660890-663321,663323-663435,663437-663764,663766-663854,663856-664219,664221-664489,664494-664514,664516-668013,668015-668142,668144-668152,668154,668156-668256,668258,668260-669139,669141-669455,669457-669657,669659-669808,669810-670189,670191-671321,671323-672229,672231-672549,672551-672552,672554-672561,672563-672566,672568,672571-673049,673051-673852,673854-673862,673864-673986,673988-673996,673998-674347,674349-674890,674892-674910,674912-674936,674938-674952,674954-675078,675080-675085,675087-675217,675219-675660,675662-675670,675672-675716,675718-675726,675728-675733,675735-675775,675777-675782,675784,675786-675791,675794-675852,675854-676200,676202,676204,676206-676220,676222-676309,676311-677004 via svnmerge from
https://svn.apache.org/repos/asf/poi/trunk
........
r676457 | josh | 2008-07-14 00:23:13 +0100 (Mon, 14 Jul 2008) | 1 line
Fix for bug 45380 - added return keyword in ArrayPtg.toFormulaString()
........
r676995 | yegor | 2008-07-15 19:13:50 +0100 (Tue, 15 Jul 2008) | 1 line
fixed bug #45322: HSSFSheet.autoSizeColumn() throws NPE when cell number format was not found
........
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@677006 13f79535-47bb-0310-9956-ffa450edef68
2008-07-15 18:56:24 +00:00
*
* @return the format string or " General " if not found
Merged revisions 638001-638784,638786-639486,639488-639601,639603-639836 via svnmerge from
https://svn.apache.org/repos/asf/poi/trunk
........
r638803 | nick | 2008-03-19 11:57:38 +0000 (Wed, 19 Mar 2008) | 1 line
Added test to show that bug #41546 is already fixed. Also rename a test file to be more consistent
........
r638804 | nick | 2008-03-19 12:01:32 +0000 (Wed, 19 Mar 2008) | 1 line
Add test to show that bug #43251 is already fixed
........
r638812 | nick | 2008-03-19 12:28:56 +0000 (Wed, 19 Mar 2008) | 1 line
Patch from Dmitriy from bug #30311 - Support for conditional formatting records
........
r638815 | nick | 2008-03-19 12:49:35 +0000 (Wed, 19 Mar 2008) | 1 line
Fix bug #44627 - improve the thread safety of POILogFactory
........
r639231 | nick | 2008-03-20 10:06:59 +0000 (Thu, 20 Mar 2008) | 1 line
Test relating to bug #44636
........
r639232 | nick | 2008-03-20 10:16:15 +0000 (Thu, 20 Mar 2008) | 1 line
Simple patch from Josh from bug #44636 - fix for RefVPtg and edit-in-excel oddness
........
r639242 | nick | 2008-03-20 11:02:39 +0000 (Thu, 20 Mar 2008) | 1 line
Fix for readCompressedUnicode not moaning about length=0, from bug #44643
........
r639254 | nick | 2008-03-20 11:43:14 +0000 (Thu, 20 Mar 2008) | 1 line
Make junit happy
........
r639836 | nick | 2008-03-21 21:04:47 +0000 (Fri, 21 Mar 2008) | 1 line
Tweak how you get dataformat strings out of cell styles, to be more logical, and in keeping with how we'll want to do things for xssf too
........
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@642557 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 17:00:47 +00:00
* /
public String getDataFormatString ( org . apache . poi . ss . usermodel . Workbook workbook ) {
2016-04-05 23:47:41 +00:00
HSSFDataFormat format = new HSSFDataFormat ( ( ( HSSFWorkbook ) workbook ) . getWorkbook ( ) ) ;
2009-08-18 16:50:24 +00:00
Merged revisions 638786-638802,638805-638811,638813-638814,638816-639230,639233-639241,639243-639253,639255-639486,639488-639601,639603-639835,639837-639917,639919-640056,640058-640710,640712-641156,641158-641184,641186-641795,641797-641798,641800-641933,641935-641963,641965-641966,641968-641995,641997-642230,642232-642562,642564-642565,642568-642570,642572-642573,642576-642736,642739-642877,642879,642881-642890,642892-642903,642905-642945,642947-643624,643626-643653,643655-643669,643671,643673-643830,643832-643833,643835-644342,644344-644472,644474-644508,644510-645347,645349-645351,645353-645559,645561-645565,645568-645951,645953-646193,646195-646311,646313-646404,646406-646665,646667-646853,646855-646869,646871-647151,647153-647185,647187-647277,647279-647566,647568-647573,647575,647578-647711,647714-647737,647739-647823,647825-648155,648157-648202,648204-648273,648275,648277-648302,648304-648333,648335-648588,648590-648622,648625-648673,648675-649141,649144,649146-649556,649558-649795,649799,649801-649910,649912-649913,649915-650128,650131-650132,650134-650137,650140-650914,650916-651991,651993-652284,652286-652287,652289,652291,652293-652297,652299-652328,652330-652425,652427-652445,652447-652560,652562-652933,652935,652937-652993,652995-653116,653118-653124,653126-653483,653487-653519,653522-653550,653552-653607,653609-653667,653669-653674,653676-653814,653817-653830,653832-653891,653893-653944,653946-654055,654057-654355,654357-654365,654367-654648,654651-655215,655217-655277,655279-655281,655283-655911,655913-656212,656214,656216-656251,656253-656698,656700-656756,656758-656892,656894-657135,657137-657165,657168-657179,657181-657354,657356-657357,657359-657701,657703-657874,657876-658032,658034-658284,658286,658288-658301,658303-658307,658309-658321,658323-658335,658337-658348,658351,658353-658832,658834-658983,658985,658987-659066,659068-659402,659404-659428,659430-659451,659453-659454,659456-659461,659463-659477,659479-659524,659526-659571,659574,659576-660255,660257-660262,660264-660279,660281-660343,660345-660473,660475-660827,660829-660833,660835-660888,660890-663321,663323-663435,663437-663764,663766-663854,663856-664219,664221-664489,664494-664514,664516-668013,668015-668142,668144-668152,668154,668156-668256,668258,668260-669139,669141-669455,669457-669657,669659-669808,669810-670189,670191-671321,671323-672229,672231-672549,672551-672552,672554-672561,672563-672566,672568,672571-673049,673051-673852,673854-673862,673864-673986,673988-673996,673998-674347,674349-674890,674892-674910,674912-674936,674938-674952,674954-675078,675080-675085,675087-675217,675219-675660,675662-675670,675672-675716,675718-675726,675728-675733,675735-675775,675777-675782,675784,675786-675791,675794-675852,675854-676200,676202,676204,676206-676220,676222-676309,676311-677004 via svnmerge from
https://svn.apache.org/repos/asf/poi/trunk
........
r676457 | josh | 2008-07-14 00:23:13 +0100 (Mon, 14 Jul 2008) | 1 line
Fix for bug 45380 - added return keyword in ArrayPtg.toFormulaString()
........
r676995 | yegor | 2008-07-15 19:13:50 +0100 (Tue, 15 Jul 2008) | 1 line
fixed bug #45322: HSSFSheet.autoSizeColumn() throws NPE when cell number format was not found
........
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@677006 13f79535-47bb-0310-9956-ffa450edef68
2008-07-15 18:56:24 +00:00
int idx = getDataFormat ( ) ;
return idx = = - 1 ? " General " : format . getFormat ( getDataFormat ( ) ) ;
Merged revisions 638001-638784,638786-639486,639488-639601,639603-639836 via svnmerge from
https://svn.apache.org/repos/asf/poi/trunk
........
r638803 | nick | 2008-03-19 11:57:38 +0000 (Wed, 19 Mar 2008) | 1 line
Added test to show that bug #41546 is already fixed. Also rename a test file to be more consistent
........
r638804 | nick | 2008-03-19 12:01:32 +0000 (Wed, 19 Mar 2008) | 1 line
Add test to show that bug #43251 is already fixed
........
r638812 | nick | 2008-03-19 12:28:56 +0000 (Wed, 19 Mar 2008) | 1 line
Patch from Dmitriy from bug #30311 - Support for conditional formatting records
........
r638815 | nick | 2008-03-19 12:49:35 +0000 (Wed, 19 Mar 2008) | 1 line
Fix bug #44627 - improve the thread safety of POILogFactory
........
r639231 | nick | 2008-03-20 10:06:59 +0000 (Thu, 20 Mar 2008) | 1 line
Test relating to bug #44636
........
r639232 | nick | 2008-03-20 10:16:15 +0000 (Thu, 20 Mar 2008) | 1 line
Simple patch from Josh from bug #44636 - fix for RefVPtg and edit-in-excel oddness
........
r639242 | nick | 2008-03-20 11:02:39 +0000 (Thu, 20 Mar 2008) | 1 line
Fix for readCompressedUnicode not moaning about length=0, from bug #44643
........
r639254 | nick | 2008-03-20 11:43:14 +0000 (Thu, 20 Mar 2008) | 1 line
Make junit happy
........
r639836 | nick | 2008-03-21 21:04:47 +0000 (Fri, 21 Mar 2008) | 1 line
Tweak how you get dataformat strings out of cell styles, to be more logical, and in keeping with how we'll want to do things for xssf too
........
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@642557 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 17:00:47 +00:00
}
Merged revisions 638786-638802,638805-638811,638813-638814,638816-639230,639233-639241,639243-639253,639255-639486,639488-639601,639603-639835,639837-639917,639919-640056,640058-640710,640712-641156,641158-641184,641186-641795,641797-641798,641800-641933,641935-641963,641965-641966,641968-641995,641997-642230,642232-642562,642564-642565,642568-642570,642572-642573,642576-642736,642739-642877,642879,642881-642890,642892-642903,642905-642945,642947-643624,643626-643653,643655-643669,643671,643673-643830,643832-643833,643835-644342,644344-644472,644474-644508,644510-645347,645349-645351,645353-645559,645561-645565,645568-645951,645953-646193,646195-646311,646313-646404,646406-646665,646667-646853,646855-646869,646871-647151,647153-647185,647187-647277,647279-647566,647568-647573,647575,647578-647711,647714-647737,647739-647823,647825-648155,648157-648202,648204-648273,648275,648277-648302,648304-648333,648335-648588,648590-648622,648625-648673,648675-649141,649144,649146-649556,649558-649795,649799,649801-649910,649912-649913,649915-650128,650131-650132,650134-650137,650140-650914,650916-651991,651993-652284,652286-652287,652289,652291,652293-652297,652299-652328,652330-652425,652427-652445,652447-652560,652562-652933,652935,652937-652993,652995-653116,653118-653124,653126-653483,653487-653519,653522-653550,653552-653607,653609-653667,653669-653674,653676-653814,653817-653830,653832-653891,653893-653944,653946-654055,654057-654355,654357-654365,654367-654648,654651-655215,655217-655277,655279-655281,655283-655911,655913-656212,656214,656216-656251,656253-656698,656700-656756,656758-656892,656894-657135,657137-657165,657168-657179,657181-657354,657356-657357,657359-657701,657703-657874,657876-658032,658034-658284,658286,658288-658301,658303-658307,658309-658321,658323-658335,658337-658348,658351,658353-658832,658834-658983,658985,658987-659066,659068-659402,659404-659428,659430-659451,659453-659454,659456-659461,659463-659477,659479-659524,659526-659571,659574,659576-660255,660257-660262,660264-660279,660281-660343,660345-660473,660475-660827,660829-660833,660835-660888,660890-663321,663323-663435,663437-663764,663766-663854,663856-664219,664221-664489,664494-664514,664516-668013,668015-668142,668144-668152,668154,668156-668256,668258,668260-669139,669141-669455,669457-669657,669659-669808,669810-670189,670191-671321,671323-672229,672231-672549,672551-672552,672554-672561,672563-672566,672568,672571-673049,673051-673852,673854-673862,673864-673986,673988-673996,673998-674347,674349-674890,674892-674910,674912-674936,674938-674952,674954-675078,675080-675085,675087-675217,675219-675660,675662-675670,675672-675716,675718-675726,675728-675733,675735-675775,675777-675782,675784,675786-675791,675794-676205 via svnmerge from
https://svn.apache.org:443/repos/asf/poi/trunk
........
r675853 | josh | 2008-07-11 08:59:44 +0100 (Fri, 11 Jul 2008) | 1 line
Patch 45289 - finished support for special comparison operators in COUNTIF
........
r676201 | nick | 2008-07-12 17:56:55 +0100 (Sat, 12 Jul 2008) | 1 line
Support for cloning one font record onto another, plus tests
........
r676203 | nick | 2008-07-12 18:21:54 +0100 (Sat, 12 Jul 2008) | 1 line
Support for cloning one extended format record onto another, plus tests
........
r676205 | nick | 2008-07-12 18:38:10 +0100 (Sat, 12 Jul 2008) | 1 line
Allow the cloning of one HSSFCellStyle onto another, including cloning styles from one HSSFWorkbook onto another
........
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@676209 13f79535-47bb-0310-9956-ffa450edef68
2008-07-12 18:17:16 +00:00
/ * *
* Get the contents of the format string , by looking up
* the DataFormat against the supplied low level workbook
* @see org . apache . poi . hssf . usermodel . HSSFDataFormat
* /
2009-12-22 00:51:29 +00:00
public String getDataFormatString ( org . apache . poi . hssf . model . InternalWorkbook workbook ) {
2016-04-05 23:47:41 +00:00
HSSFDataFormat format = new HSSFDataFormat ( workbook ) ;
2009-08-18 16:50:24 +00:00
Merged revisions 638786-638802,638805-638811,638813-638814,638816-639230,639233-639241,639243-639253,639255-639486,639488-639601,639603-639835,639837-639917,639919-640056,640058-640710,640712-641156,641158-641184,641186-641795,641797-641798,641800-641933,641935-641963,641965-641966,641968-641995,641997-642230,642232-642562,642564-642565,642568-642570,642572-642573,642576-642736,642739-642877,642879,642881-642890,642892-642903,642905-642945,642947-643624,643626-643653,643655-643669,643671,643673-643830,643832-643833,643835-644342,644344-644472,644474-644508,644510-645347,645349-645351,645353-645559,645561-645565,645568-645951,645953-646193,646195-646311,646313-646404,646406-646665,646667-646853,646855-646869,646871-647151,647153-647185,647187-647277,647279-647566,647568-647573,647575,647578-647711,647714-647737,647739-647823,647825-648155,648157-648202,648204-648273,648275,648277-648302,648304-648333,648335-648588,648590-648622,648625-648673,648675-649141,649144,649146-649556,649558-649795,649799,649801-649910,649912-649913,649915-650128,650131-650132,650134-650137,650140-650914,650916-651991,651993-652284,652286-652287,652289,652291,652293-652297,652299-652328,652330-652425,652427-652445,652447-652560,652562-652933,652935,652937-652993,652995-653116,653118-653124,653126-653483,653487-653519,653522-653550,653552-653607,653609-653667,653669-653674,653676-653814,653817-653830,653832-653891,653893-653944,653946-654055,654057-654355,654357-654365,654367-654648,654651-655215,655217-655277,655279-655281,655283-655911,655913-656212,656214,656216-656251,656253-656698,656700-656756,656758-656892,656894-657135,657137-657165,657168-657179,657181-657354,657356-657357,657359-657701,657703-657874,657876-658032,658034-658284,658286,658288-658301,658303-658307,658309-658321,658323-658335,658337-658348,658351,658353-658832,658834-658983,658985,658987-659066,659068-659402,659404-659428,659430-659451,659453-659454,659456-659461,659463-659477,659479-659524,659526-659571,659574,659576-660255,660257-660262,660264-660279,660281-660343,660345-660473,660475-660827,660829-660833,660835-660888,660890-663321,663323-663435,663437-663764,663766-663854,663856-664219,664221-664489,664494-664514,664516-668013,668015-668142,668144-668152,668154,668156-668256,668258,668260-669139,669141-669455,669457-669657,669659-669808,669810-670189,670191-671321,671323-672229,672231-672549,672551-672552,672554-672561,672563-672566,672568,672571-673049,673051-673852,673854-673862,673864-673986,673988-673996,673998-674347,674349-674890,674892-674910,674912-674936,674938-674952,674954-675078,675080-675085,675087-675217,675219-675660,675662-675670,675672-675716,675718-675726,675728-675733,675735-675775,675777-675782,675784,675786-675791,675794-676205 via svnmerge from
https://svn.apache.org:443/repos/asf/poi/trunk
........
r675853 | josh | 2008-07-11 08:59:44 +0100 (Fri, 11 Jul 2008) | 1 line
Patch 45289 - finished support for special comparison operators in COUNTIF
........
r676201 | nick | 2008-07-12 17:56:55 +0100 (Sat, 12 Jul 2008) | 1 line
Support for cloning one font record onto another, plus tests
........
r676203 | nick | 2008-07-12 18:21:54 +0100 (Sat, 12 Jul 2008) | 1 line
Support for cloning one extended format record onto another, plus tests
........
r676205 | nick | 2008-07-12 18:38:10 +0100 (Sat, 12 Jul 2008) | 1 line
Allow the cloning of one HSSFCellStyle onto another, including cloning styles from one HSSFWorkbook onto another
........
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@676209 13f79535-47bb-0310-9956-ffa450edef68
2008-07-12 18:17:16 +00:00
return format . getFormat ( getDataFormat ( ) ) ;
}
2002-01-31 02:22:28 +00:00
/ * *
* set the font for this style
2002-02-11 10:45:51 +00:00
* @param font a font object created or retreived from the HSSFWorkbook object
2002-01-31 02:22:28 +00:00
* @see org . apache . poi . hssf . usermodel . HSSFWorkbook # createFont ( )
* @see org . apache . poi . hssf . usermodel . HSSFWorkbook # getFontAt ( short )
* /
2015-12-28 05:43:11 +00:00
@Override
2008-07-21 09:55:13 +00:00
public void setFont ( Font font ) {
2016-04-05 23:47:41 +00:00
setFont ( ( HSSFFont ) font ) ;
}
public void setFont ( HSSFFont font ) {
2009-08-18 16:50:24 +00:00
_format . setIndentNotParentFont ( true ) ;
2008-07-21 09:55:13 +00:00
short fontindex = font . getIndex ( ) ;
2009-08-18 16:50:24 +00:00
_format . setFontIndex ( fontindex ) ;
2002-01-31 02:22:28 +00:00
}
2008-01-02 15:48:11 +00:00
/ * *
* gets the index of the font for this style
* @see org . apache . poi . hssf . usermodel . HSSFWorkbook # getFontAt ( short )
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public short getFontIndex ( )
{
2009-08-18 16:50:24 +00:00
return _format . getFontIndex ( ) ;
2002-01-31 02:22:28 +00:00
}
2009-08-18 16:50:24 +00:00
2008-01-02 15:48:11 +00:00
/ * *
* gets the font for this style
* @param parentWorkbook The HSSFWorkbook that this style belongs to
* @see org . apache . poi . hssf . usermodel . HSSFCellStyle # getFontIndex ( )
* @see org . apache . poi . hssf . usermodel . HSSFWorkbook # getFontAt ( short )
* /
2008-01-24 10:53:39 +00:00
public HSSFFont getFont ( org . apache . poi . ss . usermodel . Workbook parentWorkbook ) {
2016-04-05 23:47:41 +00:00
return ( ( HSSFWorkbook ) parentWorkbook ) . getFontAt ( getFontIndex ( ) ) ;
2008-01-02 15:48:11 +00:00
}
2002-01-31 02:22:28 +00:00
/ * *
* set the cell ' s using this style to be hidden
* @param hidden - whether the cell using this style should be hidden
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public void setHidden ( boolean hidden )
{
2009-08-18 16:50:24 +00:00
_format . setIndentNotParentCellOptions ( true ) ;
_format . setHidden ( hidden ) ;
2002-01-31 02:22:28 +00:00
}
/ * *
* get whether the cell ' s using this style are to be hidden
* @return hidden - whether the cell using this style should be hidden
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public boolean getHidden ( )
{
2009-08-18 16:50:24 +00:00
return _format . isHidden ( ) ;
2002-01-31 02:22:28 +00:00
}
/ * *
* set the cell ' s using this style to be locked
* @param locked - whether the cell using this style should be locked
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public void setLocked ( boolean locked )
{
2009-08-18 16:50:24 +00:00
_format . setIndentNotParentCellOptions ( true ) ;
_format . setLocked ( locked ) ;
2002-01-31 02:22:28 +00:00
}
/ * *
* get whether the cell ' s using this style are to be locked
* @return hidden - whether the cell using this style should be locked
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public boolean getLocked ( )
{
2009-08-18 16:50:24 +00:00
return _format . isLocked ( ) ;
2002-01-31 02:22:28 +00:00
}
/ * *
* set the type of horizontal alignment for the cell
* @param align - the type of alignment
* @see # ALIGN_GENERAL
* @see # ALIGN_LEFT
* @see # ALIGN_CENTER
* @see # ALIGN_RIGHT
* @see # ALIGN_FILL
* @see # ALIGN_JUSTIFY
* @see # ALIGN_CENTER_SELECTION
2016-07-10 08:29:02 +00:00
* @deprecated POI 3 . 15 beta 3 . Use { @link # setAlignment ( HorizontalAlignment ) } instead .
2002-01-31 02:22:28 +00:00
* /
2016-09-14 03:33:52 +00:00
@Removal ( version = " 3.17 " )
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public void setAlignment ( short align )
{
2009-08-18 16:50:24 +00:00
_format . setIndentNotParentAlignment ( true ) ;
_format . setAlignment ( align ) ;
2002-01-31 02:22:28 +00:00
}
2016-07-10 08:29:02 +00:00
/ * *
* set the type of horizontal alignment for the cell
* @param align - the type of alignment
* /
@Override
public void setAlignment ( HorizontalAlignment align )
{
_format . setIndentNotParentAlignment ( true ) ;
_format . setAlignment ( align . getCode ( ) ) ;
}
2002-01-31 02:22:28 +00:00
/ * *
* get the type of horizontal alignment for the cell
* @return align - the type of alignment
* @see # ALIGN_GENERAL
* @see # ALIGN_LEFT
* @see # ALIGN_CENTER
* @see # ALIGN_RIGHT
* @see # ALIGN_FILL
* @see # ALIGN_JUSTIFY
* @see # ALIGN_CENTER_SELECTION
2016-07-10 08:29:02 +00:00
* @deprecated POI 3 . 15 beta 3 . Use { @link # getAlignmentEnum ( ) } instead .
2002-01-31 02:22:28 +00:00
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public short getAlignment ( )
{
2009-08-18 16:50:24 +00:00
return _format . getAlignment ( ) ;
2002-01-31 02:22:28 +00:00
}
2016-07-10 08:29:02 +00:00
/ * *
* get the type of horizontal alignment for the cell
* @return align - the type of alignment
* /
@Override
public HorizontalAlignment getAlignmentEnum ( )
{
return HorizontalAlignment . forInt ( _format . getAlignment ( ) ) ;
}
2002-01-31 02:22:28 +00:00
/ * *
* set whether the text should be wrapped
2002-02-11 10:45:51 +00:00
* @param wrapped wrap text or not
2002-01-31 02:22:28 +00:00
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public void setWrapText ( boolean wrapped )
{
2009-08-18 16:50:24 +00:00
_format . setIndentNotParentAlignment ( true ) ;
_format . setWrapText ( wrapped ) ;
2002-01-31 02:22:28 +00:00
}
/ * *
* get whether the text should be wrapped
* @return wrap text or not
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public boolean getWrapText ( )
{
2009-08-18 16:50:24 +00:00
return _format . getWrapText ( ) ;
2002-01-31 02:22:28 +00:00
}
/ * *
* set the type of vertical alignment for the cell
2002-02-11 10:45:51 +00:00
* @param align the type of alignment
2002-01-31 02:22:28 +00:00
* @see # VERTICAL_TOP
* @see # VERTICAL_CENTER
* @see # VERTICAL_BOTTOM
* @see # VERTICAL_JUSTIFY
2016-07-10 08:29:02 +00:00
* @see VerticalAlignment
* @deprecated POI 3 . 15 beta 3 . Use { @link # setVerticalAlignment ( VerticalAlignment ) } instead .
2002-01-31 02:22:28 +00:00
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public void setVerticalAlignment ( short align )
{
2009-08-18 16:50:24 +00:00
_format . setVerticalAlignment ( align ) ;
2002-01-31 02:22:28 +00:00
}
2016-07-10 08:29:02 +00:00
/ * *
* set the type of vertical alignment for the cell
* @param align the type of alignment
* /
@Override
public void setVerticalAlignment ( VerticalAlignment align )
{
_format . setVerticalAlignment ( align . getCode ( ) ) ;
}
2002-01-31 02:22:28 +00:00
/ * *
* get the type of vertical alignment for the cell
2002-02-11 10:45:51 +00:00
* @return align the type of alignment
2002-01-31 02:22:28 +00:00
* @see # VERTICAL_TOP
* @see # VERTICAL_CENTER
* @see # VERTICAL_BOTTOM
* @see # VERTICAL_JUSTIFY
2016-07-10 08:29:02 +00:00
* @see VerticalAlignment
* @deprecated POI 3 . 15 beta 3 . Use { @link # getVerticalAlignmentEnum ( ) } instead .
2002-01-31 02:22:28 +00:00
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public short getVerticalAlignment ( )
{
2009-08-18 16:50:24 +00:00
return _format . getVerticalAlignment ( ) ;
2002-01-31 02:22:28 +00:00
}
2016-07-10 08:29:02 +00:00
/ * *
* get the type of vertical alignment for the cell
* @return align the type of alignment
* /
@Override
public VerticalAlignment getVerticalAlignmentEnum ( )
{
return VerticalAlignment . forInt ( _format . getVerticalAlignment ( ) ) ;
}
2002-01-31 02:22:28 +00:00
/ * *
* set the degree of rotation for the text in the cell
2016-01-03 13:28:17 +00:00
*
* Note : HSSF uses values from - 90 to 90 degrees , whereas XSSF
* uses values from 0 to 180 degrees . The implementations of this method will map between these two value - ranges
* accordingly , however the corresponding getter is returning values in the range mandated by the current type
* of Excel file - format that this CellStyle is applied to .
*
2010-07-18 18:00:36 +00:00
* @param rotation degrees ( between - 90 and 90 degrees , of 0xff for vertical )
2002-01-31 02:22:28 +00:00
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public void setRotation ( short rotation )
{
2010-07-18 18:00:36 +00:00
if ( rotation = = 0xff ) {
// Special cases for vertically aligned text
}
else if ( ( rotation < 0 ) & & ( rotation > = - 90 ) ) {
2002-09-06 01:10:19 +00:00
//Take care of the funny 4th quadrant issue
//The 4th quadrant (-1 to -90) is stored as (91 to 180)
rotation = ( short ) ( 90 - rotation ) ;
}
2016-01-03 13:28:17 +00:00
else if ( rotation > 90 & & rotation < = 180 ) {
// stay compatible with the range used by XSSF, map from ]90..180] to ]0..-90]
// we actually don't need to do anything here as the internal value is stored in [0-180] anyway!
}
else if ( ( rotation < - 90 ) | | ( rotation > 90 ) ) {
2002-09-06 01:10:19 +00:00
//Do not allow an incorrect rotation to be set
2010-07-18 18:00:36 +00:00
throw new IllegalArgumentException ( " The rotation must be between -90 and 90 degrees, or 0xff " ) ;
}
_format . setRotation ( rotation ) ;
2002-01-31 02:22:28 +00:00
}
/ * *
* get the degree of rotation for the text in the cell
2010-07-18 18:00:36 +00:00
* @return rotation degrees ( between - 90 and 90 degrees , or 0xff for vertical )
2002-01-31 02:22:28 +00:00
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public short getRotation ( )
{
2009-08-18 16:50:24 +00:00
short rotation = _format . getRotation ( ) ;
2010-07-18 18:00:36 +00:00
if ( rotation = = 0xff ) {
// Vertical aligned special case
return rotation ;
}
if ( rotation > 90 ) {
2002-09-06 01:10:19 +00:00
//This is actually the 4th quadrant
rotation = ( short ) ( 90 - rotation ) ;
2010-07-18 18:00:36 +00:00
}
2002-09-06 01:10:19 +00:00
return rotation ;
2002-01-31 02:22:28 +00:00
}
/ * *
* set the number of spaces to indent the text in the cell
* @param indent - number of spaces
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public void setIndention ( short indent )
{
2009-08-18 16:50:24 +00:00
_format . setIndent ( indent ) ;
2002-01-31 02:22:28 +00:00
}
/ * *
* get the number of spaces to indent the text in the cell
* @return indent - number of spaces
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public short getIndention ( )
{
2009-08-18 16:50:24 +00:00
return _format . getIndent ( ) ;
2002-01-31 02:22:28 +00:00
}
/ * *
* set the type of border to use for the left border of the cell
* @param border type
* @see # BORDER_NONE
* @see # BORDER_THIN
* @see # BORDER_MEDIUM
* @see # BORDER_DASHED
* @see # BORDER_DOTTED
* @see # BORDER_THICK
* @see # BORDER_DOUBLE
* @see # BORDER_HAIR
* @see # BORDER_MEDIUM_DASHED
* @see # BORDER_DASH_DOT
* @see # BORDER_MEDIUM_DASH_DOT
* @see # BORDER_DASH_DOT_DOT
* @see # BORDER_MEDIUM_DASH_DOT_DOT
* @see # BORDER_SLANTED_DASH_DOT
2016-04-05 23:30:37 +00:00
* @deprecated 3 . 15 beta 2 . Use { @link HSSFCellStyle # setBorderLeft ( BorderStyle ) } instead .
2002-01-31 02:22:28 +00:00
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public void setBorderLeft ( short border )
{
2009-08-18 16:50:24 +00:00
_format . setIndentNotParentBorder ( true ) ;
_format . setBorderLeft ( border ) ;
2002-01-31 02:22:28 +00:00
}
2016-04-05 20:28:46 +00:00
/ * *
* set the type of border to use for the left border of the cell
* @param border type
* /
@Override
public void setBorderLeft ( BorderStyle border )
{
setBorderLeft ( border . getCode ( ) ) ;
}
2002-01-31 02:22:28 +00:00
/ * *
* get the type of border to use for the left border of the cell
* @return border type
* /
2015-12-28 05:43:11 +00:00
@Override
2016-04-05 20:28:46 +00:00
public BorderStyle getBorderLeft ( )
2002-01-31 02:22:28 +00:00
{
2016-04-05 20:28:46 +00:00
return BorderStyle . valueOf ( _format . getBorderLeft ( ) ) ;
2002-01-31 02:22:28 +00:00
}
/ * *
* set the type of border to use for the right border of the cell
* @param border type
* @see # BORDER_NONE
* @see # BORDER_THIN
* @see # BORDER_MEDIUM
* @see # BORDER_DASHED
* @see # BORDER_DOTTED
* @see # BORDER_THICK
* @see # BORDER_DOUBLE
* @see # BORDER_HAIR
* @see # BORDER_MEDIUM_DASHED
* @see # BORDER_DASH_DOT
* @see # BORDER_MEDIUM_DASH_DOT
* @see # BORDER_DASH_DOT_DOT
* @see # BORDER_MEDIUM_DASH_DOT_DOT
* @see # BORDER_SLANTED_DASH_DOT
2016-04-05 23:30:37 +00:00
* @deprecated 3 . 15 beta 2 . Use { @link HSSFCellStyle # setBorderRight ( BorderStyle ) } instead .
2002-01-31 02:22:28 +00:00
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public void setBorderRight ( short border )
{
2009-08-18 16:50:24 +00:00
_format . setIndentNotParentBorder ( true ) ;
_format . setBorderRight ( border ) ;
2002-01-31 02:22:28 +00:00
}
2016-04-05 20:28:46 +00:00
/ * *
* set the type of border to use for the right border of the cell
* @param border type
* /
@Override
public void setBorderRight ( BorderStyle border )
{
setBorderRight ( border . getCode ( ) ) ;
}
2002-01-31 02:22:28 +00:00
/ * *
* get the type of border to use for the right border of the cell
* @return border type
* /
2015-12-28 05:43:11 +00:00
@Override
2016-04-05 20:28:46 +00:00
public BorderStyle getBorderRight ( )
2002-01-31 02:22:28 +00:00
{
2016-04-05 20:28:46 +00:00
return BorderStyle . valueOf ( _format . getBorderRight ( ) ) ;
2002-01-31 02:22:28 +00:00
}
/ * *
* set the type of border to use for the top border of the cell
* @param border type
* @see # BORDER_NONE
* @see # BORDER_THIN
* @see # BORDER_MEDIUM
* @see # BORDER_DASHED
* @see # BORDER_DOTTED
* @see # BORDER_THICK
* @see # BORDER_DOUBLE
* @see # BORDER_HAIR
* @see # BORDER_MEDIUM_DASHED
* @see # BORDER_DASH_DOT
* @see # BORDER_MEDIUM_DASH_DOT
* @see # BORDER_DASH_DOT_DOT
* @see # BORDER_MEDIUM_DASH_DOT_DOT
* @see # BORDER_SLANTED_DASH_DOT
2016-04-05 23:30:37 +00:00
* @deprecated 3 . 15 beta 2 . Use { @link HSSFCellStyle # setBorderTop ( BorderStyle ) } instead .
2002-01-31 02:22:28 +00:00
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public void setBorderTop ( short border )
{
2009-08-18 16:50:24 +00:00
_format . setIndentNotParentBorder ( true ) ;
_format . setBorderTop ( border ) ;
2002-01-31 02:22:28 +00:00
}
2016-04-05 20:28:46 +00:00
/ * *
* set the type of border to use for the top border of the cell
* @param border type
* /
@Override
public void setBorderTop ( BorderStyle border )
{
setBorderTop ( border . getCode ( ) ) ;
}
2002-01-31 02:22:28 +00:00
/ * *
* get the type of border to use for the top border of the cell
* @return border type
* /
2015-12-28 05:43:11 +00:00
@Override
2016-04-05 20:28:46 +00:00
public BorderStyle getBorderTop ( )
2002-01-31 02:22:28 +00:00
{
2016-04-05 20:28:46 +00:00
return BorderStyle . valueOf ( _format . getBorderTop ( ) ) ;
2002-01-31 02:22:28 +00:00
}
/ * *
* set the type of border to use for the bottom border of the cell
* @param border type
* @see # BORDER_NONE
* @see # BORDER_THIN
* @see # BORDER_MEDIUM
* @see # BORDER_DASHED
* @see # BORDER_DOTTED
* @see # BORDER_THICK
* @see # BORDER_DOUBLE
* @see # BORDER_HAIR
* @see # BORDER_MEDIUM_DASHED
* @see # BORDER_DASH_DOT
* @see # BORDER_MEDIUM_DASH_DOT
* @see # BORDER_DASH_DOT_DOT
* @see # BORDER_MEDIUM_DASH_DOT_DOT
* @see # BORDER_SLANTED_DASH_DOT
2016-04-05 23:30:37 +00:00
* @deprecated 3 . 15 beta 2 . Use { @link HSSFCellStyle # setBorderBottom ( BorderStyle ) } instead .
2002-01-31 02:22:28 +00:00
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public void setBorderBottom ( short border )
{
2009-08-18 16:50:24 +00:00
_format . setIndentNotParentBorder ( true ) ;
_format . setBorderBottom ( border ) ;
2002-01-31 02:22:28 +00:00
}
2016-04-05 20:28:46 +00:00
/ * *
* set the type of border to use for the bottom border of the cell
* @param border type
* /
@Override
public void setBorderBottom ( BorderStyle border )
{
setBorderBottom ( border . getCode ( ) ) ;
}
2002-01-31 02:22:28 +00:00
/ * *
* get the type of border to use for the bottom border of the cell
* @return border type
* /
2015-12-28 05:43:11 +00:00
@Override
2016-04-05 20:28:46 +00:00
public BorderStyle getBorderBottom ( )
2002-01-31 02:22:28 +00:00
{
2016-04-05 20:28:46 +00:00
return BorderStyle . valueOf ( _format . getBorderBottom ( ) ) ;
2002-01-31 02:22:28 +00:00
}
/ * *
* set the color to use for the left border
2008-01-02 15:48:11 +00:00
* @param color The index of the color definition
2002-01-31 02:22:28 +00:00
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public void setLeftBorderColor ( short color )
{
2009-08-18 16:50:24 +00:00
_format . setLeftBorderPaletteIdx ( color ) ;
2002-01-31 02:22:28 +00:00
}
/ * *
* get the color to use for the left border
2008-01-02 15:48:11 +00:00
* @see org . apache . poi . hssf . usermodel . HSSFPalette # getColor ( short )
2008-11-07 16:57:23 +00:00
* @return The index of the color definition
2002-01-31 02:22:28 +00:00
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public short getLeftBorderColor ( )
{
2009-08-18 16:50:24 +00:00
return _format . getLeftBorderPaletteIdx ( ) ;
2002-01-31 02:22:28 +00:00
}
/ * *
* set the color to use for the right border
2008-01-02 15:48:11 +00:00
* @param color The index of the color definition
2002-01-31 02:22:28 +00:00
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public void setRightBorderColor ( short color )
{
2009-08-18 16:50:24 +00:00
_format . setRightBorderPaletteIdx ( color ) ;
2002-01-31 02:22:28 +00:00
}
/ * *
* get the color to use for the left border
2008-01-02 15:48:11 +00:00
* @see org . apache . poi . hssf . usermodel . HSSFPalette # getColor ( short )
2008-11-07 16:57:23 +00:00
* @return The index of the color definition
2002-01-31 02:22:28 +00:00
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public short getRightBorderColor ( )
{
2009-08-18 16:50:24 +00:00
return _format . getRightBorderPaletteIdx ( ) ;
2002-01-31 02:22:28 +00:00
}
/ * *
* set the color to use for the top border
2008-01-02 15:48:11 +00:00
* @param color The index of the color definition
2002-01-31 02:22:28 +00:00
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public void setTopBorderColor ( short color )
{
2009-08-18 16:50:24 +00:00
_format . setTopBorderPaletteIdx ( color ) ;
2002-01-31 02:22:28 +00:00
}
/ * *
* get the color to use for the top border
2008-01-02 15:48:11 +00:00
* @see org . apache . poi . hssf . usermodel . HSSFPalette # getColor ( short )
2008-11-07 16:57:23 +00:00
* @return The index of the color definition
2002-01-31 02:22:28 +00:00
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public short getTopBorderColor ( )
{
2009-08-18 16:50:24 +00:00
return _format . getTopBorderPaletteIdx ( ) ;
2002-01-31 02:22:28 +00:00
}
/ * *
* set the color to use for the bottom border
2008-01-02 15:48:11 +00:00
* @param color The index of the color definition
2002-01-31 02:22:28 +00:00
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public void setBottomBorderColor ( short color )
{
2009-08-18 16:50:24 +00:00
_format . setBottomBorderPaletteIdx ( color ) ;
2002-01-31 02:22:28 +00:00
}
/ * *
* get the color to use for the left border
2008-01-02 15:48:11 +00:00
* @see org . apache . poi . hssf . usermodel . HSSFPalette # getColor ( short )
2008-11-07 16:57:23 +00:00
* @return The index of the color definition
2002-01-31 02:22:28 +00:00
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public short getBottomBorderColor ( )
{
2009-08-18 16:50:24 +00:00
return _format . getBottomBorderPaletteIdx ( ) ;
2002-01-31 02:22:28 +00:00
}
/ * *
* setting to one fills the cell with the foreground color . . . No idea about
* other values
2002-03-03 09:27:13 +00:00
*
* @see # NO_FILL
2002-03-11 10:35:39 +00:00
* @see # SOLID_FOREGROUND
2002-03-03 09:27:13 +00:00
* @see # FINE_DOTS
* @see # ALT_BARS
* @see # SPARSE_DOTS
* @see # THICK_HORZ_BANDS
* @see # THICK_VERT_BANDS
* @see # THICK_BACKWARD_DIAG
* @see # THICK_FORWARD_DIAG
* @see # BIG_SPOTS
* @see # BRICKS
* @see # THIN_HORZ_BANDS
* @see # THIN_VERT_BANDS
* @see # THIN_BACKWARD_DIAG
* @see # THIN_FORWARD_DIAG
* @see # SQUARES
* @see # DIAMONDS
*
* @param fp fill pattern ( set to 1 to fill w / foreground color )
2016-07-08 22:28:28 +00:00
* @deprecated POI 3 . 15 beta 3 . Use { @link # setFillPattern ( FillPatternType ) } instead .
2002-01-31 02:22:28 +00:00
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public void setFillPattern ( short fp )
{
2016-07-08 22:28:28 +00:00
setFillPattern ( FillPatternType . forInt ( fp ) ) ;
}
/ * *
* setting to one fills the cell with the foreground color . . . No idea about
* other values
*
* @param fp fill pattern ( set to { @link FillPatternType # SOLID_FOREGROUND } to fill w / foreground color )
* /
@Override
public void setFillPattern ( FillPatternType fp )
{
_format . setAdtlFillPattern ( fp . getCode ( ) ) ;
2002-01-31 02:22:28 +00:00
}
/ * *
2016-07-08 22:28:28 +00:00
* get the fill pattern
2002-01-31 02:22:28 +00:00
* @return fill pattern
2016-07-08 22:28:28 +00:00
* @deprecated POI 3 . 15 beta 3 . This method will return { @link FillPatternType } in the future . Use { @link # setFillPattern ( FillPatternType ) } instead .
2002-01-31 02:22:28 +00:00
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public short getFillPattern ( )
{
2016-07-08 22:28:28 +00:00
return getFillPatternEnum ( ) . getCode ( ) ;
}
/ * *
* get the fill pattern
* @return fill pattern
* /
@Override
public FillPatternType getFillPatternEnum ( )
{
return FillPatternType . forInt ( _format . getAdtlFillPattern ( ) ) ;
2002-01-31 02:22:28 +00:00
}
2009-08-18 16:50:24 +00:00
2006-07-24 12:18:48 +00:00
/ * *
* Checks if the background and foreground fills are set correctly when one
* or the other is set to the default color .
* < p > Works like the logic table below : < / p >
* < p > BACKGROUND FOREGROUND < / p >
* < p > NONE AUTOMATIC < / p >
* < p > 0x41 0x40 < / p >
* < p > NONE RED / ANYTHING < / p >
2009-08-18 16:50:24 +00:00
* < p > 0x40 0xSOMETHING < / p >
2006-07-24 12:18:48 +00:00
* /
private void checkDefaultBackgroundFills ( ) {
2009-08-18 16:50:24 +00:00
if ( _format . getFillForeground ( ) = = org . apache . poi . hssf . util . HSSFColor . AUTOMATIC . index ) {
2016-04-05 23:47:41 +00:00
//JMH: Why +1, hell why not. I guess it made some sense to someone at the time. Doesnt
//to me now.... But experience has shown that when the fore is set to AUTOMATIC then the
//background needs to be incremented......
if ( _format . getFillBackground ( ) ! = ( org . apache . poi . hssf . util . HSSFColor . AUTOMATIC . index + 1 ) )
setFillBackgroundColor ( ( short ) ( org . apache . poi . hssf . util . HSSFColor . AUTOMATIC . index + 1 ) ) ;
2009-08-18 16:50:24 +00:00
} else if ( _format . getFillBackground ( ) = = org . apache . poi . hssf . util . HSSFColor . AUTOMATIC . index + 1 )
2016-04-05 23:47:41 +00:00
//Now if the forground changes to a non-AUTOMATIC color the background resets itself!!!
if ( _format . getFillForeground ( ) ! = org . apache . poi . hssf . util . HSSFColor . AUTOMATIC . index )
setFillBackgroundColor ( org . apache . poi . hssf . util . HSSFColor . AUTOMATIC . index ) ;
2006-07-24 12:18:48 +00:00
}
2002-01-31 02:22:28 +00:00
/ * *
2002-03-03 09:27:13 +00:00
* set the background fill color .
* < p >
* For example :
* < pre >
2002-03-04 11:36:50 +00:00
* cs . setFillPattern ( HSSFCellStyle . FINE_DOTS ) ;
2009-08-18 16:50:24 +00:00
* cs . setFillBackgroundColor ( new HSSFColor . RED ( ) . getIndex ( ) ) ;
2006-07-24 12:18:48 +00:00
* < / pre >
* optionally a Foreground and background fill can be applied :
* < i > Note : Ensure Foreground color is set prior to background < / i >
* < pre >
* cs . setFillPattern ( HSSFCellStyle . FINE_DOTS ) ;
* cs . setFillForegroundColor ( new HSSFColor . BLUE ( ) . getIndex ( ) ) ;
2009-08-18 16:50:24 +00:00
* cs . setFillBackgroundColor ( new HSSFColor . RED ( ) . getIndex ( ) ) ;
2002-03-04 11:36:50 +00:00
* < / pre >
* or , for the special case of SOLID_FILL :
* < pre >
2005-08-23 03:44:59 +00:00
* cs . setFillPattern ( HSSFCellStyle . SOLID_FOREGROUND ) ;
* cs . setFillForegroundColor ( new HSSFColor . RED ( ) . getIndex ( ) ) ;
2002-03-03 09:27:13 +00:00
* < / pre >
2002-03-06 08:33:20 +00:00
* It is necessary to set the fill style in order
* for the color to be shown in the cell .
2002-03-03 09:27:13 +00:00
*
2002-02-11 10:45:51 +00:00
* @param bg color
2002-01-31 02:22:28 +00:00
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public void setFillBackgroundColor ( short bg )
2009-08-18 16:50:24 +00:00
{
_format . setFillBackground ( bg ) ;
2006-07-24 12:18:48 +00:00
checkDefaultBackgroundFills ( ) ;
2002-01-31 02:22:28 +00:00
}
/ * *
Merged revisions 697562,697580,697584,697589,697595,697599 via svnmerge from
https://svn.apache.org/repos/asf/poi/trunk
........
r697562 | nick | 2008-09-21 18:49:20 +0100 (Sun, 21 Sep 2008) | 1 line
Fix bug #45784 - Support long chart titles in SeriesTextRecords
........
r697580 | nick | 2008-09-21 19:43:49 +0100 (Sun, 21 Sep 2008) | 1 line
Include the sheet name in the output of examples.XLS2CSVmra
........
r697584 | nick | 2008-09-21 19:56:32 +0100 (Sun, 21 Sep 2008) | 1 line
Test to show that bug #45492 is invalid
........
r697589 | nick | 2008-09-21 20:17:41 +0100 (Sun, 21 Sep 2008) | 1 line
Update hssf.extractor.ExcelExtractor to optionally output blank cells too
........
r697595 | nick | 2008-09-21 20:31:34 +0100 (Sun, 21 Sep 2008) | 1 line
Improved tests to show that bugs #45062 and #44292 are fixed
........
r697599 | nick | 2008-09-21 20:50:21 +0100 (Sun, 21 Sep 2008) | 1 line
Apply part of patch from bug #16936, with the rest made more HSSFCell like - Initial support for whole-row cell styling
........
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@698257 13f79535-47bb-0310-9956-ffa450edef68
2008-09-23 17:35:31 +00:00
* Get the background fill color .
* Note - many cells are actually filled with a foreground
* fill , not a background fill - see { @link # getFillForegroundColor ( ) }
2008-01-02 15:48:11 +00:00
* @see org . apache . poi . hssf . usermodel . HSSFPalette # getColor ( short )
2002-01-31 02:22:28 +00:00
* @return fill color
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public short getFillBackgroundColor ( )
{
2016-04-05 23:47:41 +00:00
short result = _format . getFillBackground ( ) ;
//JMH: Do this ridiculous conversion, and let HSSFCellStyle
//internally migrate back and forth
if ( result = = ( HSSFColor . AUTOMATIC . index + 1 ) ) {
return HSSFColor . AUTOMATIC . index ;
}
return result ;
2002-01-31 02:22:28 +00:00
}
2010-05-26 17:46:46 +00:00
2015-12-28 05:43:11 +00:00
@Override
2010-05-26 17:46:46 +00:00
public HSSFColor getFillBackgroundColorColor ( ) {
HSSFPalette pallette = new HSSFPalette (
_workbook . getCustomPalette ( )
) ;
return pallette . getColor (
getFillBackgroundColor ( )
) ;
}
2002-01-31 02:22:28 +00:00
/ * *
* set the foreground fill color
2006-07-24 12:18:48 +00:00
* < i > Note : Ensure Foreground color is set prior to background color . < / i >
2002-02-11 10:45:51 +00:00
* @param bg color
2002-01-31 02:22:28 +00:00
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public void setFillForegroundColor ( short bg )
{
2009-08-18 16:50:24 +00:00
_format . setFillForeground ( bg ) ;
2006-07-24 12:18:48 +00:00
checkDefaultBackgroundFills ( ) ;
2002-01-31 02:22:28 +00:00
}
/ * *
Merged revisions 697562,697580,697584,697589,697595,697599 via svnmerge from
https://svn.apache.org/repos/asf/poi/trunk
........
r697562 | nick | 2008-09-21 18:49:20 +0100 (Sun, 21 Sep 2008) | 1 line
Fix bug #45784 - Support long chart titles in SeriesTextRecords
........
r697580 | nick | 2008-09-21 19:43:49 +0100 (Sun, 21 Sep 2008) | 1 line
Include the sheet name in the output of examples.XLS2CSVmra
........
r697584 | nick | 2008-09-21 19:56:32 +0100 (Sun, 21 Sep 2008) | 1 line
Test to show that bug #45492 is invalid
........
r697589 | nick | 2008-09-21 20:17:41 +0100 (Sun, 21 Sep 2008) | 1 line
Update hssf.extractor.ExcelExtractor to optionally output blank cells too
........
r697595 | nick | 2008-09-21 20:31:34 +0100 (Sun, 21 Sep 2008) | 1 line
Improved tests to show that bugs #45062 and #44292 are fixed
........
r697599 | nick | 2008-09-21 20:50:21 +0100 (Sun, 21 Sep 2008) | 1 line
Apply part of patch from bug #16936, with the rest made more HSSFCell like - Initial support for whole-row cell styling
........
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@698257 13f79535-47bb-0310-9956-ffa450edef68
2008-09-23 17:35:31 +00:00
* Get the foreground fill color .
2009-08-18 16:50:24 +00:00
* Many cells are filled with this , instead of a
Merged revisions 697562,697580,697584,697589,697595,697599 via svnmerge from
https://svn.apache.org/repos/asf/poi/trunk
........
r697562 | nick | 2008-09-21 18:49:20 +0100 (Sun, 21 Sep 2008) | 1 line
Fix bug #45784 - Support long chart titles in SeriesTextRecords
........
r697580 | nick | 2008-09-21 19:43:49 +0100 (Sun, 21 Sep 2008) | 1 line
Include the sheet name in the output of examples.XLS2CSVmra
........
r697584 | nick | 2008-09-21 19:56:32 +0100 (Sun, 21 Sep 2008) | 1 line
Test to show that bug #45492 is invalid
........
r697589 | nick | 2008-09-21 20:17:41 +0100 (Sun, 21 Sep 2008) | 1 line
Update hssf.extractor.ExcelExtractor to optionally output blank cells too
........
r697595 | nick | 2008-09-21 20:31:34 +0100 (Sun, 21 Sep 2008) | 1 line
Improved tests to show that bugs #45062 and #44292 are fixed
........
r697599 | nick | 2008-09-21 20:50:21 +0100 (Sun, 21 Sep 2008) | 1 line
Apply part of patch from bug #16936, with the rest made more HSSFCell like - Initial support for whole-row cell styling
........
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@698257 13f79535-47bb-0310-9956-ffa450edef68
2008-09-23 17:35:31 +00:00
* background color ( { @link # getFillBackgroundColor ( ) } )
2008-01-02 15:48:11 +00:00
* @see org . apache . poi . hssf . usermodel . HSSFPalette # getColor ( short )
2002-01-31 02:22:28 +00:00
* @return fill color
* /
2015-12-28 05:43:11 +00:00
@Override
2002-01-31 02:22:28 +00:00
public short getFillForegroundColor ( )
{
2009-08-18 16:50:24 +00:00
return _format . getFillForeground ( ) ;
2002-01-31 02:22:28 +00:00
}
2009-08-18 16:50:24 +00:00
2015-12-28 05:43:11 +00:00
@Override
2010-05-26 17:46:46 +00:00
public HSSFColor getFillForegroundColorColor ( ) {
HSSFPalette pallette = new HSSFPalette (
_workbook . getCustomPalette ( )
) ;
return pallette . getColor (
getFillForegroundColor ( )
) ;
}
2008-09-15 17:01:46 +00:00
/ * *
* Gets the name of the user defined style .
* Returns null for built in styles , and
* styles where no name has been defined
* /
public String getUserStyleName ( ) {
2016-04-05 23:47:41 +00:00
StyleRecord sr = _workbook . getStyleRecord ( _index ) ;
if ( sr = = null ) {
return null ;
}
if ( sr . isBuiltin ( ) ) {
return null ;
}
return sr . getName ( ) ;
2008-09-15 17:01:46 +00:00
}
2009-08-18 16:50:24 +00:00
2008-09-15 17:01:46 +00:00
/ * *
* Sets the name of the user defined style .
* Will complain if you try this on a built in style .
* /
public void setUserStyleName ( String styleName ) {
2016-04-05 23:47:41 +00:00
StyleRecord sr = _workbook . getStyleRecord ( _index ) ;
if ( sr = = null ) {
sr = _workbook . createStyleRecord ( _index ) ;
}
// All Style records start as "builtin", but generally
// only 20 and below really need to be
if ( sr . isBuiltin ( ) & & _index < = 20 ) {
throw new IllegalArgumentException ( " Unable to set user specified style names for built in styles! " ) ;
}
sr . setName ( styleName ) ;
2008-09-15 17:01:46 +00:00
}
Merged revisions 618680-620582 via svnmerge from
https://svn.apache.org/repos/asf/poi/trunk
........
r618680 | nick | 2008-02-05 16:51:29 +0100 (Tue, 05 Feb 2008) | 1 line
Add java.lang.Iterable style methods for iterating over rows and cells, but don't actually implement that, as it wasn't in jdk 1.3 or jdk 1.4, with is rather tedious
........
r618690 | nick | 2008-02-05 17:21:21 +0100 (Tue, 05 Feb 2008) | 1 line
Tweaks to the iterator use guides for hssf
........
r618692 | nick | 2008-02-05 17:32:45 +0100 (Tue, 05 Feb 2008) | 1 line
Few tweaks to the patching guide
........
r618940 | yegor | 2008-02-06 10:47:13 +0100 (Wed, 06 Feb 2008) | 1 line
3.0.2-FINAL released
........
r619001 | nick | 2008-02-06 15:35:05 +0100 (Wed, 06 Feb 2008) | 1 line
Implement hashCode and equals for HSSFFont and HSSFCellStyle
........
r619310 | yegor | 2008-02-07 09:56:59 +0100 (Thu, 07 Feb 2008) | 1 line
support for excel hypelrinks
........
r619382 | nick | 2008-02-07 13:39:12 +0100 (Thu, 07 Feb 2008) | 1 line
Patch from bug #44373 - Have HSSFDateUtil.isADateFormat support more date formats
........
r619502 | nick | 2008-02-07 17:53:23 +0100 (Thu, 07 Feb 2008) | 1 line
Handle timezones better with cell.setCellValue(Calendar), so now 20:00-03:00, 20:00+00:00 and 20:00+03:00 will all be recorded as 20:00, and not 17:00 / 20:00 / 23:00 (pass a Date not a Calendar for old behaviour) - patch from bug #38641
........
r619509 | nick | 2008-02-07 18:12:09 +0100 (Thu, 07 Feb 2008) | 1 line
Add (disabled) failing testcase for bug #44375
........
r619848 | klute | 2008-02-08 12:55:43 +0100 (Fri, 08 Feb 2008) | 1 line
- Fixed bug 44375 - HPSF now copes with a broken dictionary in Document Summary Information stream. RuntimeExceptions that occured when trying to read bogus data are now caught. Dictionary entries up to but not including the bogus one are preserved, the rest is ignored.
........
r619849 | klute | 2008-02-08 12:56:11 +0100 (Fri, 08 Feb 2008) | 1 line
- Fixed bug 44375 - HPSF now copes with a broken dictionary in Document Summary Information stream. RuntimeExceptions that occured when trying to read bogus data are now caught. Dictionary entries up to but not including the bogus one are preserved, the rest is ignored.
........
r619851 | nick | 2008-02-08 13:02:10 +0100 (Fri, 08 Feb 2008) | 1 line
Copy Rainer's change note from changes.xml to status.xml, as it's needed in both
........
r619968 | nick | 2008-02-08 19:17:29 +0100 (Fri, 08 Feb 2008) | 1 line
Tweak layout
........
r620341 | nick | 2008-02-10 22:54:13 +0100 (Sun, 10 Feb 2008) | 1 line
Test for bug #42564 - appears to already be fixed
........
r620557 | nick | 2008-02-11 18:55:09 +0100 (Mon, 11 Feb 2008) | 1 line
Another test relating to bug #42564 - this one is still failing
........
r620582 | nick | 2008-02-11 20:14:04 +0100 (Mon, 11 Feb 2008) | 1 line
If we have a document with a hpsf stream that exists, but is of the wrong type, then log a warning but continue
........
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@627544 13f79535-47bb-0310-9956-ffa450edef68
2008-02-13 17:34:43 +00:00
2013-11-07 22:28:06 +00:00
/ * *
* Controls if the Cell should be auto - sized
* to shrink to fit if the text is too long
* /
2015-12-28 05:43:11 +00:00
@Override
2013-11-07 22:28:06 +00:00
public void setShrinkToFit ( boolean shrinkToFit ) {
2016-04-05 23:47:41 +00:00
_format . setShrinkToFit ( shrinkToFit ) ;
2013-11-07 22:28:06 +00:00
}
/ * *
* Should the Cell be auto - sized by Excel to shrink
* it to fit if this text is too long ?
* /
2015-12-28 05:43:11 +00:00
@Override
2013-11-07 22:28:06 +00:00
public boolean getShrinkToFit ( ) {
2016-04-05 23:47:41 +00:00
return _format . getShrinkToFit ( ) ;
2013-11-07 22:28:06 +00:00
}
2016-04-05 23:47:41 +00:00
2014-09-09 15:59:06 +00:00
/ * *
* Get the reading order , for RTL / LTR ordering of
* the text .
* < p > 0 means Context ( Default ) , 1 means Left To Right ,
* and 2 means Right to Left < / p >
*
* @return order - the reading order ( 0 , 1 , 2 )
* /
public short getReadingOrder ( ) {
return _format . getReadingOrder ( ) ;
}
/ * *
* Sets the reading order , for RTL / LTR ordering of
* the text .
* < p > 0 means Context ( Default ) , 1 means Left To Right ,
* and 2 means Right to Left < / p >
*
* @param order - the reading order ( 0 , 1 , 2 )
* /
public void setReadingOrder ( short order ) {
_format . setReadingOrder ( order ) ;
}
Merged revisions 638786-638802,638805-638811,638813-638814,638816-639230,639233-639241,639243-639253,639255-639486,639488-639601,639603-639835,639837-639917,639919-640056,640058-640710,640712-641156,641158-641184,641186-641795,641797-641798,641800-641933,641935-641963,641965-641966,641968-641995,641997-642230,642232-642562,642564-642565,642568-642570,642572-642573,642576-642736,642739-642877,642879,642881-642890,642892-642903,642905-642945,642947-643624,643626-643653,643655-643669,643671,643673-643830,643832-643833,643835-644342,644344-644472,644474-644508,644510-645347,645349-645351,645353-645559,645561-645565,645568-645951,645953-646193,646195-646311,646313-646404,646406-646665,646667-646853,646855-646869,646871-647151,647153-647185,647187-647277,647279-647566,647568-647573,647575,647578-647711,647714-647737,647739-647823,647825-648155,648157-648202,648204-648273,648275,648277-648302,648304-648333,648335-648588,648590-648622,648625-648673,648675-649141,649144,649146-649556,649558-649795,649799,649801-649910,649912-649913,649915-650128,650131-650132,650134-650137,650140-650914,650916-651991,651993-652284,652286-652287,652289,652291,652293-652297,652299-652328,652330-652425,652427-652445,652447-652560,652562-652933,652935,652937-652993,652995-653116,653118-653124,653126-653483,653487-653519,653522-653550,653552-653607,653609-653667,653669-653674,653676-653814,653817-653830,653832-653891,653893-653944,653946-654055,654057-654355,654357-654365,654367-654648,654651-655215,655217-655277,655279-655281,655283-655911,655913-656212,656214,656216-656251,656253-656698,656700-656756,656758-656892,656894-657135,657137-657165,657168-657179,657181-657354,657356-657357,657359-657701,657703-657874,657876-658032,658034-658284,658286,658288-658301,658303-658307,658309-658321,658323-658335,658337-658348,658351,658353-658832,658834-658983,658985,658987-659066,659068-659402,659404-659428,659430-659451,659453-659454,659456-659461,659463-659477,659479-659524,659526-659571,659574,659576-660255,660257-660262,660264-660279,660281-660343,660345-660473,660475-660827,660829-660833,660835-660888,660890-663321,663323-663435,663437-663764,663766-663854,663856-664219,664221-664489,664494-664514,664516-668013,668015-668142,668144-668152,668154,668156-668256,668258,668260-669139,669141-669455,669457-669657,669659-669808,669810-670189,670191-671321,671323-672229,672231-672549,672551-672552,672554-672561,672563-672566,672568,672571-673049,673051-673852,673854-673862,673864-673986,673988-673996,673998-674347,674349-674890,674892-674910,674912-674936,674938-674952,674954-675078,675080-675085,675087-675217,675219-675660,675662-675670,675672-675716,675718-675726,675728-675733,675735-675775,675777-675782,675784,675786-675791,675794-676205 via svnmerge from
https://svn.apache.org:443/repos/asf/poi/trunk
........
r675853 | josh | 2008-07-11 08:59:44 +0100 (Fri, 11 Jul 2008) | 1 line
Patch 45289 - finished support for special comparison operators in COUNTIF
........
r676201 | nick | 2008-07-12 17:56:55 +0100 (Sat, 12 Jul 2008) | 1 line
Support for cloning one font record onto another, plus tests
........
r676203 | nick | 2008-07-12 18:21:54 +0100 (Sat, 12 Jul 2008) | 1 line
Support for cloning one extended format record onto another, plus tests
........
r676205 | nick | 2008-07-12 18:38:10 +0100 (Sat, 12 Jul 2008) | 1 line
Allow the cloning of one HSSFCellStyle onto another, including cloning styles from one HSSFWorkbook onto another
........
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@676209 13f79535-47bb-0310-9956-ffa450edef68
2008-07-12 18:17:16 +00:00
/ * *
* Verifies that this style belongs to the supplied Workbook .
* Will throw an exception if it belongs to a different one .
* This is normally called when trying to assign a style to a
* cell , to ensure the cell and the style are from the same
* workbook ( if they ' re not , it won ' t work )
* @throws IllegalArgumentException if there ' s a workbook mis - match
* /
public void verifyBelongsToWorkbook ( HSSFWorkbook wb ) {
2016-04-05 23:47:41 +00:00
if ( wb . getWorkbook ( ) ! = _workbook ) {
throw new IllegalArgumentException ( " This Style does not belong to the supplied Workbook. Are you trying to assign a style from one workbook to the cell of a differnt workbook? " ) ;
}
}
2009-08-18 16:50:24 +00:00
Merged revisions 638786-638802,638805-638811,638813-638814,638816-639230,639233-639241,639243-639253,639255-639486,639488-639601,639603-639835,639837-639917,639919-640056,640058-640710,640712-641156,641158-641184,641186-641795,641797-641798,641800-641933,641935-641963,641965-641966,641968-641995,641997-642230,642232-642562,642564-642565,642568-642570,642572-642573,642576-642736,642739-642877,642879,642881-642890,642892-642903,642905-642945,642947-643624,643626-643653,643655-643669,643671,643673-643830,643832-643833,643835-644342,644344-644472,644474-644508,644510-645347,645349-645351,645353-645559,645561-645565,645568-645951,645953-646193,646195-646311,646313-646404,646406-646665,646667-646853,646855-646869,646871-647151,647153-647185,647187-647277,647279-647566,647568-647573,647575,647578-647711,647714-647737,647739-647823,647825-648155,648157-648202,648204-648273,648275,648277-648302,648304-648333,648335-648588,648590-648622,648625-648673,648675-649141,649144,649146-649556,649558-649795,649799,649801-649910,649912-649913,649915-650128,650131-650132,650134-650137,650140-650914,650916-651991,651993-652284,652286-652287,652289,652291,652293-652297,652299-652328,652330-652425,652427-652445,652447-652560,652562-652933,652935,652937-652993,652995-653116,653118-653124,653126-653483,653487-653519,653522-653550,653552-653607,653609-653667,653669-653674,653676-653814,653817-653830,653832-653891,653893-653944,653946-654055,654057-654355,654357-654365,654367-654648,654651-655215,655217-655277,655279-655281,655283-655911,655913-656212,656214,656216-656251,656253-656698,656700-656756,656758-656892,656894-657135,657137-657165,657168-657179,657181-657354,657356-657357,657359-657701,657703-657874,657876-658032,658034-658284,658286,658288-658301,658303-658307,658309-658321,658323-658335,658337-658348,658351,658353-658832,658834-658983,658985,658987-659066,659068-659402,659404-659428,659430-659451,659453-659454,659456-659461,659463-659477,659479-659524,659526-659571,659574,659576-660255,660257-660262,660264-660279,660281-660343,660345-660473,660475-660827,660829-660833,660835-660888,660890-663321,663323-663435,663437-663764,663766-663854,663856-664219,664221-664489,664494-664514,664516-668013,668015-668142,668144-668152,668154,668156-668256,668258,668260-669139,669141-669455,669457-669657,669659-669808,669810-670189,670191-671321,671323-672229,672231-672549,672551-672552,672554-672561,672563-672566,672568,672571-673049,673051-673852,673854-673862,673864-673986,673988-673996,673998-674347,674349-674890,674892-674910,674912-674936,674938-674952,674954-675078,675080-675085,675087-675217,675219-675660,675662-675670,675672-675716,675718-675726,675728-675733,675735-675775,675777-675782,675784,675786-675791,675794-676205 via svnmerge from
https://svn.apache.org:443/repos/asf/poi/trunk
........
r675853 | josh | 2008-07-11 08:59:44 +0100 (Fri, 11 Jul 2008) | 1 line
Patch 45289 - finished support for special comparison operators in COUNTIF
........
r676201 | nick | 2008-07-12 17:56:55 +0100 (Sat, 12 Jul 2008) | 1 line
Support for cloning one font record onto another, plus tests
........
r676203 | nick | 2008-07-12 18:21:54 +0100 (Sat, 12 Jul 2008) | 1 line
Support for cloning one extended format record onto another, plus tests
........
r676205 | nick | 2008-07-12 18:38:10 +0100 (Sat, 12 Jul 2008) | 1 line
Allow the cloning of one HSSFCellStyle onto another, including cloning styles from one HSSFWorkbook onto another
........
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@676209 13f79535-47bb-0310-9956-ffa450edef68
2008-07-12 18:17:16 +00:00
/ * *
* Clones all the style information from another
2009-08-18 16:50:24 +00:00
* HSSFCellStyle , onto this one . This
Merged revisions 638786-638802,638805-638811,638813-638814,638816-639230,639233-639241,639243-639253,639255-639486,639488-639601,639603-639835,639837-639917,639919-640056,640058-640710,640712-641156,641158-641184,641186-641795,641797-641798,641800-641933,641935-641963,641965-641966,641968-641995,641997-642230,642232-642562,642564-642565,642568-642570,642572-642573,642576-642736,642739-642877,642879,642881-642890,642892-642903,642905-642945,642947-643624,643626-643653,643655-643669,643671,643673-643830,643832-643833,643835-644342,644344-644472,644474-644508,644510-645347,645349-645351,645353-645559,645561-645565,645568-645951,645953-646193,646195-646311,646313-646404,646406-646665,646667-646853,646855-646869,646871-647151,647153-647185,647187-647277,647279-647566,647568-647573,647575,647578-647711,647714-647737,647739-647823,647825-648155,648157-648202,648204-648273,648275,648277-648302,648304-648333,648335-648588,648590-648622,648625-648673,648675-649141,649144,649146-649556,649558-649795,649799,649801-649910,649912-649913,649915-650128,650131-650132,650134-650137,650140-650914,650916-651991,651993-652284,652286-652287,652289,652291,652293-652297,652299-652328,652330-652425,652427-652445,652447-652560,652562-652933,652935,652937-652993,652995-653116,653118-653124,653126-653483,653487-653519,653522-653550,653552-653607,653609-653667,653669-653674,653676-653814,653817-653830,653832-653891,653893-653944,653946-654055,654057-654355,654357-654365,654367-654648,654651-655215,655217-655277,655279-655281,655283-655911,655913-656212,656214,656216-656251,656253-656698,656700-656756,656758-656892,656894-657135,657137-657165,657168-657179,657181-657354,657356-657357,657359-657701,657703-657874,657876-658032,658034-658284,658286,658288-658301,658303-658307,658309-658321,658323-658335,658337-658348,658351,658353-658832,658834-658983,658985,658987-659066,659068-659402,659404-659428,659430-659451,659453-659454,659456-659461,659463-659477,659479-659524,659526-659571,659574,659576-660255,660257-660262,660264-660279,660281-660343,660345-660473,660475-660827,660829-660833,660835-660888,660890-663321,663323-663435,663437-663764,663766-663854,663856-664219,664221-664489,664494-664514,664516-668013,668015-668142,668144-668152,668154,668156-668256,668258,668260-669139,669141-669455,669457-669657,669659-669808,669810-670189,670191-671321,671323-672229,672231-672549,672551-672552,672554-672561,672563-672566,672568,672571-673049,673051-673852,673854-673862,673864-673986,673988-673996,673998-674347,674349-674890,674892-674910,674912-674936,674938-674952,674954-675078,675080-675085,675087-675217,675219-675660,675662-675670,675672-675716,675718-675726,675728-675733,675735-675775,675777-675782,675784,675786-675791,675794-676205 via svnmerge from
https://svn.apache.org:443/repos/asf/poi/trunk
........
r675853 | josh | 2008-07-11 08:59:44 +0100 (Fri, 11 Jul 2008) | 1 line
Patch 45289 - finished support for special comparison operators in COUNTIF
........
r676201 | nick | 2008-07-12 17:56:55 +0100 (Sat, 12 Jul 2008) | 1 line
Support for cloning one font record onto another, plus tests
........
r676203 | nick | 2008-07-12 18:21:54 +0100 (Sat, 12 Jul 2008) | 1 line
Support for cloning one extended format record onto another, plus tests
........
r676205 | nick | 2008-07-12 18:38:10 +0100 (Sat, 12 Jul 2008) | 1 line
Allow the cloning of one HSSFCellStyle onto another, including cloning styles from one HSSFWorkbook onto another
........
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@676209 13f79535-47bb-0310-9956-ffa450edef68
2008-07-12 18:17:16 +00:00
* HSSFCellStyle will then have all the same
* properties as the source , but the two may
* be edited independently .
2009-08-18 16:50:24 +00:00
* Any stylings on this HSSFCellStyle will be lost !
*
Merged revisions 638786-638802,638805-638811,638813-638814,638816-639230,639233-639241,639243-639253,639255-639486,639488-639601,639603-639835,639837-639917,639919-640056,640058-640710,640712-641156,641158-641184,641186-641795,641797-641798,641800-641933,641935-641963,641965-641966,641968-641995,641997-642230,642232-642562,642564-642565,642568-642570,642572-642573,642576-642736,642739-642877,642879,642881-642890,642892-642903,642905-642945,642947-643624,643626-643653,643655-643669,643671,643673-643830,643832-643833,643835-644342,644344-644472,644474-644508,644510-645347,645349-645351,645353-645559,645561-645565,645568-645951,645953-646193,646195-646311,646313-646404,646406-646665,646667-646853,646855-646869,646871-647151,647153-647185,647187-647277,647279-647566,647568-647573,647575,647578-647711,647714-647737,647739-647823,647825-648155,648157-648202,648204-648273,648275,648277-648302,648304-648333,648335-648588,648590-648622,648625-648673,648675-649141,649144,649146-649556,649558-649795,649799,649801-649910,649912-649913,649915-650128,650131-650132,650134-650137,650140-650914,650916-651991,651993-652284,652286-652287,652289,652291,652293-652297,652299-652328,652330-652425,652427-652445,652447-652560,652562-652933,652935,652937-652993,652995-653116,653118-653124,653126-653483,653487-653519,653522-653550,653552-653607,653609-653667,653669-653674,653676-653814,653817-653830,653832-653891,653893-653944,653946-654055,654057-654355,654357-654365,654367-654648,654651-655215,655217-655277,655279-655281,655283-655911,655913-656212,656214,656216-656251,656253-656698,656700-656756,656758-656892,656894-657135,657137-657165,657168-657179,657181-657354,657356-657357,657359-657701,657703-657874,657876-658032,658034-658284,658286,658288-658301,658303-658307,658309-658321,658323-658335,658337-658348,658351,658353-658832,658834-658983,658985,658987-659066,659068-659402,659404-659428,659430-659451,659453-659454,659456-659461,659463-659477,659479-659524,659526-659571,659574,659576-660255,660257-660262,660264-660279,660281-660343,660345-660473,660475-660827,660829-660833,660835-660888,660890-663321,663323-663435,663437-663764,663766-663854,663856-664219,664221-664489,664494-664514,664516-668013,668015-668142,668144-668152,668154,668156-668256,668258,668260-669139,669141-669455,669457-669657,669659-669808,669810-670189,670191-671321,671323-672229,672231-672549,672551-672552,672554-672561,672563-672566,672568,672571-673049,673051-673852,673854-673862,673864-673986,673988-673996,673998-674347,674349-674890,674892-674910,674912-674936,674938-674952,674954-675078,675080-675085,675087-675217,675219-675660,675662-675670,675672-675716,675718-675726,675728-675733,675735-675775,675777-675782,675784,675786-675791,675794-676205 via svnmerge from
https://svn.apache.org:443/repos/asf/poi/trunk
........
r675853 | josh | 2008-07-11 08:59:44 +0100 (Fri, 11 Jul 2008) | 1 line
Patch 45289 - finished support for special comparison operators in COUNTIF
........
r676201 | nick | 2008-07-12 17:56:55 +0100 (Sat, 12 Jul 2008) | 1 line
Support for cloning one font record onto another, plus tests
........
r676203 | nick | 2008-07-12 18:21:54 +0100 (Sat, 12 Jul 2008) | 1 line
Support for cloning one extended format record onto another, plus tests
........
r676205 | nick | 2008-07-12 18:38:10 +0100 (Sat, 12 Jul 2008) | 1 line
Allow the cloning of one HSSFCellStyle onto another, including cloning styles from one HSSFWorkbook onto another
........
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@676209 13f79535-47bb-0310-9956-ffa450edef68
2008-07-12 18:17:16 +00:00
* The source HSSFCellStyle could be from another
* HSSFWorkbook if you like . This allows you to
* copy styles from one HSSFWorkbook to another .
* /
2015-12-28 05:43:11 +00:00
@Override
Merged revisions 638786-638802,638805-638811,638813-638814,638816-639230,639233-639241,639243-639253,639255-639486,639488-639601,639603-639835,639837-639917,639919-640056,640058-640710,640712-641156,641158-641184,641186-641795,641797-641798,641800-641933,641935-641963,641965-641966,641968-641995,641997-642230,642232-642562,642564-642565,642568-642570,642572-642573,642576-642736,642739-642877,642879,642881-642890,642892-642903,642905-642945,642947-643624,643626-643653,643655-643669,643671,643673-643830,643832-643833,643835-644342,644344-644472,644474-644508,644510-645347,645349-645351,645353-645559,645561-645565,645568-645951,645953-646193,646195-646311,646313-646404,646406-646665,646667-646853,646855-646869,646871-647151,647153-647185,647187-647277,647279-647566,647568-647573,647575,647578-647711,647714-647737,647739-647823,647825-648155,648157-648202,648204-648273,648275,648277-648302,648304-648333,648335-648588,648590-648622,648625-648673,648675-649141,649144,649146-649556,649558-649795,649799,649801-649910,649912-649913,649915-650128,650131-650132,650134-650137,650140-650914,650916-651991,651993-652284,652286-652287,652289,652291,652293-652297,652299-652328,652330-652425,652427-652445,652447-652560,652562-652933,652935,652937-652993,652995-653116,653118-653124,653126-653483,653487-653519,653522-653550,653552-653607,653609-653667,653669-653674,653676-653814,653817-653830,653832-653891,653893-653944,653946-654055,654057-654355,654357-654365,654367-654648,654651-655215,655217-655277,655279-655281,655283-655911,655913-656212,656214,656216-656251,656253-656698,656700-656756,656758-656892,656894-657135,657137-657165,657168-657179,657181-657354,657356-657357,657359-657701,657703-657874,657876-658032,658034-658284,658286,658288-658301,658303-658307,658309-658321,658323-658335,658337-658348,658351,658353-658832,658834-658983,658985,658987-659066,659068-659402,659404-659428,659430-659451,659453-659454,659456-659461,659463-659477,659479-659524,659526-659571,659574,659576-660255,660257-660262,660264-660279,660281-660343,660345-660473,660475-660827,660829-660833,660835-660888,660890-663321,663323-663435,663437-663764,663766-663854,663856-664219,664221-664489,664494-664514,664516-668013,668015-668142,668144-668152,668154,668156-668256,668258,668260-669139,669141-669455,669457-669657,669659-669808,669810-670189,670191-671321,671323-672229,672231-672549,672551-672552,672554-672561,672563-672566,672568,672571-673049,673051-673852,673854-673862,673864-673986,673988-673996,673998-674347,674349-674890,674892-674910,674912-674936,674938-674952,674954-675078,675080-675085,675087-675217,675219-675660,675662-675670,675672-675716,675718-675726,675728-675733,675735-675775,675777-675782,675784,675786-675791,675794-676205 via svnmerge from
https://svn.apache.org:443/repos/asf/poi/trunk
........
r675853 | josh | 2008-07-11 08:59:44 +0100 (Fri, 11 Jul 2008) | 1 line
Patch 45289 - finished support for special comparison operators in COUNTIF
........
r676201 | nick | 2008-07-12 17:56:55 +0100 (Sat, 12 Jul 2008) | 1 line
Support for cloning one font record onto another, plus tests
........
r676203 | nick | 2008-07-12 18:21:54 +0100 (Sat, 12 Jul 2008) | 1 line
Support for cloning one extended format record onto another, plus tests
........
r676205 | nick | 2008-07-12 18:38:10 +0100 (Sat, 12 Jul 2008) | 1 line
Allow the cloning of one HSSFCellStyle onto another, including cloning styles from one HSSFWorkbook onto another
........
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@676209 13f79535-47bb-0310-9956-ffa450edef68
2008-07-12 18:17:16 +00:00
public void cloneStyleFrom ( CellStyle source ) {
2016-04-05 23:47:41 +00:00
if ( source instanceof HSSFCellStyle ) {
this . cloneStyleFrom ( ( HSSFCellStyle ) source ) ;
} else {
throw new IllegalArgumentException ( " Can only clone from one HSSFCellStyle to another, not between HSSFCellStyle and XSSFCellStyle " ) ;
}
}
Merged revisions 638786-638802,638805-638811,638813-638814,638816-639230,639233-639241,639243-639253,639255-639486,639488-639601,639603-639835,639837-639917,639919-640056,640058-640710,640712-641156,641158-641184,641186-641795,641797-641798,641800-641933,641935-641963,641965-641966,641968-641995,641997-642230,642232-642562,642564-642565,642568-642570,642572-642573,642576-642736,642739-642877,642879,642881-642890,642892-642903,642905-642945,642947-643624,643626-643653,643655-643669,643671,643673-643830,643832-643833,643835-644342,644344-644472,644474-644508,644510-645347,645349-645351,645353-645559,645561-645565,645568-645951,645953-646193,646195-646311,646313-646404,646406-646665,646667-646853,646855-646869,646871-647151,647153-647185,647187-647277,647279-647566,647568-647573,647575,647578-647711,647714-647737,647739-647823,647825-648155,648157-648202,648204-648273,648275,648277-648302,648304-648333,648335-648588,648590-648622,648625-648673,648675-649141,649144,649146-649556,649558-649795,649799,649801-649910,649912-649913,649915-650128,650131-650132,650134-650137,650140-650914,650916-651991,651993-652284,652286-652287,652289,652291,652293-652297,652299-652328,652330-652425,652427-652445,652447-652560,652562-652933,652935,652937-652993,652995-653116,653118-653124,653126-653483,653487-653519,653522-653550,653552-653607,653609-653667,653669-653674,653676-653814,653817-653830,653832-653891,653893-653944,653946-654055,654057-654355,654357-654365,654367-654648,654651-655215,655217-655277,655279-655281,655283-655911,655913-656212,656214,656216-656251,656253-656698,656700-656756,656758-656892,656894-657135,657137-657165,657168-657179,657181-657354,657356-657357,657359-657701,657703-657874,657876-658032,658034-658284,658286,658288-658301,658303-658307,658309-658321,658323-658335,658337-658348,658351,658353-658832,658834-658983,658985,658987-659066,659068-659402,659404-659428,659430-659451,659453-659454,659456-659461,659463-659477,659479-659524,659526-659571,659574,659576-660255,660257-660262,660264-660279,660281-660343,660345-660473,660475-660827,660829-660833,660835-660888,660890-663321,663323-663435,663437-663764,663766-663854,663856-664219,664221-664489,664494-664514,664516-668013,668015-668142,668144-668152,668154,668156-668256,668258,668260-669139,669141-669455,669457-669657,669659-669808,669810-670189,670191-671321,671323-672229,672231-672549,672551-672552,672554-672561,672563-672566,672568,672571-673049,673051-673852,673854-673862,673864-673986,673988-673996,673998-674347,674349-674890,674892-674910,674912-674936,674938-674952,674954-675078,675080-675085,675087-675217,675219-675660,675662-675670,675672-675716,675718-675726,675728-675733,675735-675775,675777-675782,675784,675786-675791,675794-676205 via svnmerge from
https://svn.apache.org:443/repos/asf/poi/trunk
........
r675853 | josh | 2008-07-11 08:59:44 +0100 (Fri, 11 Jul 2008) | 1 line
Patch 45289 - finished support for special comparison operators in COUNTIF
........
r676201 | nick | 2008-07-12 17:56:55 +0100 (Sat, 12 Jul 2008) | 1 line
Support for cloning one font record onto another, plus tests
........
r676203 | nick | 2008-07-12 18:21:54 +0100 (Sat, 12 Jul 2008) | 1 line
Support for cloning one extended format record onto another, plus tests
........
r676205 | nick | 2008-07-12 18:38:10 +0100 (Sat, 12 Jul 2008) | 1 line
Allow the cloning of one HSSFCellStyle onto another, including cloning styles from one HSSFWorkbook onto another
........
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@676209 13f79535-47bb-0310-9956-ffa450edef68
2008-07-12 18:17:16 +00:00
public void cloneStyleFrom ( HSSFCellStyle source ) {
2016-04-05 23:47:41 +00:00
// First we need to clone the extended format
// record
_format . cloneStyleFrom ( source . _format ) ;
2009-08-18 16:50:24 +00:00
2016-04-05 23:47:41 +00:00
// Handle matching things if we cross workbooks
if ( _workbook ! = source . _workbook ) {
2013-10-25 18:41:24 +00:00
2014-05-26 20:03:08 +00:00
lastDateFormat . set ( Short . MIN_VALUE ) ;
lastFormats . set ( null ) ;
getDataFormatStringCache . set ( null ) ;
2016-04-05 23:47:41 +00:00
// Then we need to clone the format string,
// and update the format record for this
short fmt = ( short ) _workbook . createFormat ( source . getDataFormatString ( ) ) ;
setDataFormat ( fmt ) ;
// Finally we need to clone the font,
// and update the format record for this
FontRecord fr = _workbook . createNewFont ( ) ;
fr . cloneStyleFrom (
source . _workbook . getFontRecordAt (
source . getFontIndex ( )
)
) ;
HSSFFont font = new HSSFFont (
( short ) _workbook . getFontIndex ( fr ) , fr
) ;
setFont ( font ) ;
}
}
@Override
public int hashCode ( ) {
final int prime = 31 ;
int result = 1 ;
result = prime * result + ( ( _format = = null ) ? 0 : _format . hashCode ( ) ) ;
result = prime * result + _index ;
return result ;
}
@Override
public boolean equals ( Object obj ) {
if ( this = = obj ) return true ;
if ( obj = = null ) return false ;
if ( obj instanceof HSSFCellStyle ) {
final HSSFCellStyle other = ( HSSFCellStyle ) obj ;
if ( _format = = null ) {
if ( other . _format ! = null )
return false ;
} else if ( ! _format . equals ( other . _format ) )
return false ;
if ( _index ! = other . _index )
return false ;
return true ;
}
return false ;
}
2002-01-31 02:22:28 +00:00
}