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 WW8FontTable::initPayload()
27 sal_uInt32 nCount
= getU8(0);
29 sal_uInt32 nOffset
= 1;
33 entryOffsets
.push_back(nOffset
);
35 sal_uInt32 nFFNSize
= getU8(nOffset
) + 1;
43 entryOffsets
.push_back(nOffset
);
44 mnPlcfPayloadOffset
= nOffset
;
47 sal_uInt32
WW8FontTable::getEntryCount()
49 return entryOffsets
.size() - 1;
52 writerfilter::Reference
<Properties
>::Pointer_t
53 WW8FontTable::getEntry(sal_uInt32 nIndex
)
55 writerfilter::Reference
<Properties
>::Pointer_t pResult
;
57 sal_uInt32 nCount
= entryOffsets
[nIndex
+ 1] - entryOffsets
[nIndex
];
61 WW8Font
* pFont
= new WW8Font(this,
62 entryOffsets
[nIndex
], nCount
);
64 pFont
->setIndex(nIndex
);
66 pResult
= writerfilter::Reference
<Properties
>::Pointer_t(pFont
);
72 sal_uInt32
WW8Font::get_f()
77 OUString
WW8Font::get_xszFfn()
79 sal_uInt32 nOffset
= 0x28;
80 sal_uInt32 nCount
= get_cbFfnM1() - nOffset
;
82 Sequence
aSeq(mSequence
, nOffset
, nCount
);
84 rtl_uString
* pNew
= 0;
85 rtl_uString_newFromStr
86 (&pNew
, reinterpret_cast<const sal_Unicode
*>(&aSeq
[0]));
88 return OUString(pNew
);
91 OUString
WW8Font::get_altName()
93 sal_uInt32 nOffset
= 0x28 + get_ixchSzAlt();
94 sal_uInt32 nCount
= get_cbFfnM1() - nOffset
;
96 Sequence
aSeq(mSequence
, nOffset
, nCount
);
98 rtl_uString
* pNew
= 0;
99 rtl_uString_newFromStr
100 (&pNew
, reinterpret_cast<const sal_Unicode
*>(&aSeq
[0]));
102 return OUString(pNew
);
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */