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 INCLUDED_SC_SOURCE_FILTER_INC_LOTATTR_HXX
21 #define INCLUDED_SC_SOURCE_FILTER_INC_LOTATTR_HXX
23 #include <boost/ptr_container/ptr_vector.hpp>
25 #include "address.hxx"
26 #include "scitems.hxx"
35 namespace editeng
{ class SvxBorderLine
; }
44 inline bool HasStyles () const
46 return ( nFont
|| nLineStyle
|| nFontCol
|| ( nBack
& 0x7F ) );
47 // !! ohne Center-Bit!!
50 inline bool IsCentered () const
52 return ( nBack
& 0x80 );
60 LotAttrCache(LOTUS_ROOT
* pLotRoot
);
64 const ScPatternAttr
& GetPattAttr( const LotAttrWK3
& );
68 friend class LotAttrTable
;
72 ScPatternAttr
* pPattAttr
;
75 ENTRY (ScPatternAttr
* p
);
79 inline bool operator == (const ENTRY
&r
) const { return nHash0
== r
.nHash0
; }
81 inline bool operator == (const sal_uInt32
&r
) const { return nHash0
== r
; }
84 inline static void MakeHash( const LotAttrWK3
& rAttr
, sal_uInt32
& rOut
)
86 reinterpret_cast<sal_uInt8
*>(&rOut
)[ 0 ] = rAttr
.nFont
& 0x7F;
87 reinterpret_cast<sal_uInt8
*>(&rOut
)[ 1 ] = rAttr
.nLineStyle
;
88 reinterpret_cast<sal_uInt8
*>(&rOut
)[ 2 ] = rAttr
.nFontCol
;
89 reinterpret_cast<sal_uInt8
*>(&rOut
)[ 3 ] = rAttr
.nBack
;
92 static void LotusToScBorderLine( sal_uInt8 nLine
, ::editeng::SvxBorderLine
& );
94 const SvxColorItem
& GetColorItem( const sal_uInt8 nLotIndex
) const;
96 const Color
& GetColor( const sal_uInt8 nLotIndex
) const;
98 ScDocumentPool
* pDocPool
;
99 SvxColorItem
* ppColorItems
[6]; // 0 und 7 fehlen!
100 SvxColorItem
* pBlack
;
101 SvxColorItem
* pWhite
;
103 boost::ptr_vector
<ENTRY
> aEntries
;
105 LOTUS_ROOT
* mpLotusRoot
;
111 void SetAttr (const SCROW nRow
, const ScPatternAttr
&);
113 void Apply(LOTUS_ROOT
* pLotRoot
, const SCCOL nCol
, const SCTAB nTab
);
118 const ScPatternAttr
* pPattAttr
;
123 boost::ptr_vector
<ENTRY
> aEntries
;
129 LotAttrTable(LOTUS_ROOT
* pLotRoot
);
131 void SetAttr( const SCCOL nColFirst
, const SCCOL nColLast
, const SCROW nRow
, const LotAttrWK3
& );
133 void Apply(LOTUS_ROOT
* pLotRoot
, const SCTAB nTabNum
);
137 LotAttrCol pCols
[ MAXCOLCOUNT
];
138 LotAttrCache aAttrCache
;
143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */