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 .
25 #include <address.hxx>
33 namespace editeng
{ class SvxBorderLine
; }
42 bool HasStyles () const
44 return ( nFont
|| nLineStyle
|| nFontCol
|| ( nBack
& 0x7F ) );
45 // !! without center bit!!
48 bool IsCentered () const
50 return ( nBack
& 0x80 );
58 LotAttrCache(LotusContext
& rContext
);
62 const ScPatternAttr
& GetPattAttr( const LotAttrWK3
& );
66 friend class LotAttrTable
;
70 std::unique_ptr
<ScPatternAttr
> pPattAttr
;
73 ENTRY(std::unique_ptr
<ScPatternAttr
> p
);
78 static void MakeHash( const LotAttrWK3
& rAttr
, sal_uInt32
& rOut
)
80 reinterpret_cast<sal_uInt8
*>(&rOut
)[ 0 ] = rAttr
.nFont
& 0x7F;
81 reinterpret_cast<sal_uInt8
*>(&rOut
)[ 1 ] = rAttr
.nLineStyle
;
82 reinterpret_cast<sal_uInt8
*>(&rOut
)[ 2 ] = rAttr
.nFontCol
;
83 reinterpret_cast<sal_uInt8
*>(&rOut
)[ 3 ] = rAttr
.nBack
;
86 static void LotusToScBorderLine( sal_uInt8 nLine
, ::editeng::SvxBorderLine
& );
88 const SvxColorItem
& GetColorItem( const sal_uInt8 nLotIndex
) const;
90 const Color
& GetColor( const sal_uInt8 nLotIndex
) const;
92 ScDocumentPool
* pDocPool
;
93 std::unique_ptr
<SvxColorItem
> ppColorItems
[6]; // 0 and 7 are missing!
94 std::unique_ptr
<SvxColorItem
> pWhite
;
95 std::unique_ptr
<Color
[]> pColTab
;
96 std::vector
< std::unique_ptr
<ENTRY
> > aEntries
;
98 LotusContext
& mrContext
;
104 void SetAttr (const ScDocument
* pDoc
, const SCROW nRow
, const ScPatternAttr
&);
106 void Apply(LotusContext
& rContext
, const SCCOL nCol
, const SCTAB nTab
);
111 const ScPatternAttr
* pPattAttr
;
116 std::vector
< std::unique_ptr
<ENTRY
> > aEntries
;
122 LotAttrTable(LotusContext
& rContext
);
124 void SetAttr(const LotusContext
& rContext
, const SCCOL nColFirst
, const SCCOL nColLast
, const SCROW nRow
, const LotAttrWK3
& );
126 void Apply(LotusContext
& rContext
, const SCTAB nTabNum
);
130 LotAttrCol pCols
[ MAXCOLCOUNT
];
131 LotAttrCache aAttrCache
;
134 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */