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 #include "doctok/resources.hxx"
22 namespace writerfilter
{
25 void WW8LFOTable::initPayload()
27 sal_uInt32 nCount
= getEntryCount();
29 sal_uInt32 nOffset
= 4;
30 sal_uInt32 nOffsetLFOData
= mnPlcfPayloadOffset
;
32 for (sal_uInt32 n
= 0; n
< nCount
; ++n
)
34 WW8LFO
aLFO(this, nOffset
);
36 entryOffsets
.push_back(nOffset
);
37 nOffset
+= WW8LFO::getSize();
39 payloadOffsets
.push_back(nOffsetLFOData
);
40 payloadIndices
.push_back(n
);
44 sal_uInt32 nLvls
= aLFO
.get_clfolvl();
46 for (sal_uInt32 k
= 0; k
< nLvls
; ++k
)
48 WW8LFOLevel
aLevel(this, nOffsetLFOData
);
49 nOffsetLFOData
+= aLevel
.calcSize();
53 entryOffsets
.push_back(nOffset
);
54 payloadOffsets
.push_back(nOffsetLFOData
);
57 sal_uInt32
WW8LFOTable::getEntryCount()
62 writerfilter::Reference
<Properties
>::Pointer_t
63 WW8LFOTable::getEntry(sal_uInt32 nIndex
)
65 WW8LFO
* pLFO
= new WW8LFO(this, entryOffsets
[nIndex
]);
67 pLFO
->setIndex(nIndex
);
69 return writerfilter::Reference
<Properties
>::Pointer_t(pLFO
);
72 writerfilter::Reference
<Properties
>::Pointer_t
75 WW8LFOTable
* pLFOTable
= dynamic_cast<WW8LFOTable
*>(mpParent
);
76 sal_uInt32 nPayloadOffset
= pLFOTable
->getPayloadOffset(mnIndex
);
77 sal_uInt32 nPayloadSize
= pLFOTable
->getPayloadSize(mnIndex
);
79 return writerfilter::Reference
<Properties
>::Pointer_t
80 (new WW8LFOData(mpParent
, nPayloadOffset
, nPayloadSize
));
83 void WW8LFOLevel::resolveNoAuto(Properties
& /*rHandler*/)
88 sal_uInt32
WW8LFOLevel::calcSize()
90 sal_uInt32 nResult
= WW8LFOLevel::getSize();
92 if (get_fFormatting())
94 WW8ListLevel
aLevel(mpParent
, mnOffsetInParent
+ nResult
);
96 nResult
+= aLevel
.calcSize();
98 sal_uInt32 nXstSize
= mpParent
->getU16(mnOffsetInParent
+ nResult
);
100 nResult
+= (nXstSize
+ 1) * 2;
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */