LibreOffice Module lotuswordpro (master) 1
lwpcharacterstyle.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*************************************************************************
3 *
4 * The Contents of this file are made available subject to the terms of
5 * either of the following licenses
6 *
7 * - GNU Lesser General Public License Version 2.1
8 * - Sun Industry Standards Source License Version 1.1
9 *
10 * Sun Microsystems Inc., October, 2000
11 *
12 * GNU Lesser General Public License Version 2.1
13 * =============================================
14 * Copyright 2000 by Sun Microsystems, Inc.
15 * 901 San Antonio Road, Palo Alto, CA 94303, USA
16 *
17 * This library is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU Lesser General Public
19 * License version 2.1, as published by the Free Software Foundation.
20 *
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
25 *
26 * You should have received a copy of the GNU Lesser General Public
27 * License along with this library; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 *
31 *
32 * Sun Industry Standards Source License Version 1.1
33 * =================================================
34 * The contents of this file are subject to the Sun Industry Standards
35 * Source License Version 1.1 (the "License"); You may not use this file
36 * except in compliance with the License. You may obtain a copy of the
37 * License at http://www.openoffice.org/license.html.
38 *
39 * Software provided under this License is provided on an "AS IS" basis,
40 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
41 * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
42 * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
43 * See the License for the specific provisions governing your rights and
44 * obligations concerning the Software.
45 *
46 * The Initial Developer of the Original Code is: IBM Corporation
47 *
48 * Copyright: 2008 by IBM Corporation
49 *
50 * All Rights Reserved.
51 *
52 * Contributor(s): _______________________________________
53 *
54 *
55 ************************************************************************/
56/*************************************************************************
57 * @file
58 * For LWP filter architecture prototype
59 ************************************************************************/
60
61#include "lwpcharacterstyle.hxx"
62#include <lwpfilehdr.hxx>
63#include <lwpoverride.hxx>
64#include <lwpatomholder.hxx>
65#include <lwpfont.hxx>
66#include <lwpfoundry.hxx>
68#include <xfilter/xffont.hxx>
70
71/*class LwpTextStyle*/
73 : LwpDLNFPVList(objHdr, pStrm)
74 , m_nFontID(0)
75 , m_nFinalFontID(0)
76 , m_nCSFlags(0)
77 , m_nUseCount(0)
78 , m_nStyleDefinition(0)
79 , m_nKey(0)
80{
81}
82
84{
86 ReadCommon();
87}
88
90
92{
93 m_nFontID = m_pObjStrm->QuickReaduInt32();
94 m_nFinalFontID = m_pObjStrm->QuickReaduInt32();
95 m_nCSFlags = m_pObjStrm->QuickReaduInt16();
96 m_nUseCount = m_pObjStrm->QuickReaduInt32();
97
99
103 {
106 }
107 else
108 {
111 }
112 sal_uInt16 nCount = 6;
114 nCount = m_pObjStrm->QuickReaduInt16();
115
117
118 if (nCount > 1)
119 {
125 }
126
127 if (m_pObjStrm->CheckExtra())
128 {
129 m_nStyleDefinition = m_pObjStrm->QuickReaduInt32();
130
131 if (m_pObjStrm->CheckExtra())
132 {
133 m_nKey = m_pObjStrm->QuickReaduInt16();
134 m_pObjStrm->SkipExtra();
135 }
136 }
137}
138
140{
141 if (!m_pFoundry)
142 {
143 assert(false);
144 return;
145 }
146
147 std::unique_ptr<XFTextStyle> pStyle(new XFTextStyle());
148
149 //Set name
150 OUString styleName = GetName().str();
151 pStyle->SetStyleName(styleName);
152
153 //Create font
156 pStyle->SetFont(pFont);
157
158 //Set other properties if needed
159
160 //Add style
162 pStyleMgr->AddStyle(GetObjectID(), std::move(pStyle));
163}
164
165/*class LwpCharacterStyle*/
167 : LwpTextStyle(objHdr, pStrm)
168{
169}
170
172
173/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void Read(LwpObjectStream *pStrm) override
void Read(LwpObjectStream *pStrm)
@descr read atomholder from object stream the default encoding used in Word Pro is 1252
const OUString & str() const
void Read(LwpObjectStream *pStrm) override
void Read() override
@descr default read function
LwpCharacterStyle(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
Double Linked Named Family Properties Virtual List.
Definition: lwpdlvlist.hxx:119
void Read() override
@descr Read name of LwpDLNFVList from object stream
Definition: lwpdlvlist.cxx:129
LwpAtomHolder & GetName()
Definition: lwpdlvlist.hxx:108
static sal_uInt16 m_nFileRevision
Definition: lwpfilehdr.hxx:77
rtl::Reference< XFFont > CreateFont(sal_uInt32 fontID)
Definition: lwpfont.cxx:471
LwpFontManager & GetFontManager()
Definition: lwpfoundry.hxx:250
LwpStyleManager * GetStyleManager()
Definition: lwpfoundry.hxx:262
Base class of all Lwp VO objects.
Definition: lwpobjhdr.hxx:71
void ReadIndexed(LwpSvStream *pStrm)
@descr Read object id with indexed format from stream if index>0, lowid is get from time table per th...
Definition: lwpobjid.cxx:96
LwpFoundry * m_pFoundry
Definition: lwpobj.hxx:91
std::unique_ptr< LwpObjectStream > m_pObjStrm
Definition: lwpobj.hxx:90
LwpObjectID & GetObjectID()
Definition: lwpobj.hxx:138
void AddStyle(LwpObjectID styleObjID, std::unique_ptr< IXFStyle > pStyle)
Definition: lwpfoundry.cxx:507
encapsulate XInputStream to provide SvStream like interfaces
Definition: lwpsvstream.hxx:69
void Read(LwpObjectStream *pStrm) override
void Read(LwpObjectStream *pStrm) override
sal_uInt32 m_nUseCount
LwpObjectID m_AttributeStyle
sal_uInt32 m_nStyleDefinition
sal_uInt16 m_nCSFlags
LwpObjectID m_FaceStyle
LwpObjectID m_SizeStyle
LwpTextStyle(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
virtual ~LwpTextStyle() override
LwpObjectID m_CharacterBorder
LwpCharacterBorderOverride m_aCharacterBorderOverride
LwpObjectID m_CharacterBorderStyle
LwpObjectID m_FontStyle
sal_uInt32 m_nFontID
virtual void RegisterStyle() override
@descr default register style function
LwpObjectID m_Amikake
void Read() override
@descr default read function
LwpTextLanguageOverride m_aLangOverride
LwpAmikakeOverride m_aAmikakeOverride
LwpTextAttributeOverride m_aTxtAttrOverride
sal_uInt32 m_nFinalFontID
LwpObjectID m_AmikakeStyle
LwpAtomHolder m_aDescription
int nCount