1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef SC_LOTATTR_HXX
21 #define SC_LOTATTR_HXX
23 #include <boost/ptr_container/ptr_vector.hpp>
25 #include <tools/solar.h>
27 #include "address.hxx"
28 #include "scitems.hxx"
37 namespace editeng
{ class SvxBorderLine
; }
46 inline bool HasStyles () const
48 return ( nFont
|| nLineStyle
|| nFontCol
|| ( nBack
& 0x7F ) );
49 // !! ohne Center-Bit!!
52 inline bool IsCentered () const
54 return ( nBack
& 0x80 );
62 LotAttrCache(LOTUS_ROOT
* pLotRoot
);
66 const ScPatternAttr
& GetPattAttr( const LotAttrWK3
& );
70 friend class LotAttrTable
;
74 ScPatternAttr
* pPattAttr
;
77 ENTRY (ScPatternAttr
* p
);
81 inline bool operator == (const ENTRY
&r
) const { return nHash0
== r
.nHash0
; }
83 inline bool operator == (const sal_uInt32
&r
) const { return nHash0
== r
; }
86 inline static void MakeHash( const LotAttrWK3
& rAttr
, sal_uInt32
& rOut
)
88 ( ( sal_uInt8
* ) &rOut
)[ 0 ] = rAttr
.nFont
& 0x7F;
89 ( ( sal_uInt8
* ) &rOut
)[ 1 ] = rAttr
.nLineStyle
;
90 ( ( sal_uInt8
* ) &rOut
)[ 2 ] = rAttr
.nFontCol
;
91 ( ( sal_uInt8
* ) &rOut
)[ 3 ] = rAttr
.nBack
;
94 static void LotusToScBorderLine( sal_uInt8 nLine
, ::editeng::SvxBorderLine
& );
96 const SvxColorItem
& GetColorItem( const sal_uInt8 nLotIndex
) const;
98 const Color
& GetColor( const sal_uInt8 nLotIndex
) const;
100 ScDocumentPool
* pDocPool
;
101 SvxColorItem
* ppColorItems
[6]; // 0 und 7 fehlen!
102 SvxColorItem
* pBlack
;
103 SvxColorItem
* pWhite
;
105 boost::ptr_vector
<ENTRY
> aEntries
;
107 LOTUS_ROOT
* mpLotusRoot
;
114 void SetAttr (const SCROW nRow
, const ScPatternAttr
&);
116 void Apply (const SCCOL nCol
, const SCTAB nTab
);
121 const ScPatternAttr
* pPattAttr
;
126 boost::ptr_vector
<ENTRY
> aEntries
;
133 LotAttrTable(LOTUS_ROOT
* pLotRoot
);
135 void SetAttr( const SCCOL nColFirst
, const SCCOL nColLast
, const SCROW nRow
, const LotAttrWK3
& );
137 void Apply( const SCTAB nTabNum
);
141 LotAttrCol pCols
[ MAXCOLCOUNT
];
142 LotAttrCache aAttrCache
;
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */