Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
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/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
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 .
18 : : */
19 : : #include "PageBordersHandler.hxx"
20 : :
21 : : #include <resourcemodel/ResourceModelHelper.hxx>
22 : : #include <DomainMapper_Impl.hxx>
23 : : #include <ConversionHelper.hxx>
24 : : #include <ModelEventListener.hxx>
25 : : #include <MeasureHandler.hxx>
26 : : #include <i18npool/mslangid.hxx>
27 : : #include <i18nutil/paper.hxx>
28 : : #include <ooxml/OOXMLFastTokens.hxx>
29 : : #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
30 : : #include <com/sun/star/document/XOOXMLDocumentPropertiesImporter.hpp>
31 : : #include <com/sun/star/text/HoriOrientation.hpp>
32 : : #include <com/sun/star/text/RelOrientation.hpp>
33 : : #include <com/sun/star/text/VertOrientation.hpp>
34 : : #include <com/sun/star/text/WrapTextMode.hpp>
35 : : #include <com/sun/star/text/SizeType.hpp>
36 : : #include <com/sun/star/text/XEndnotesSupplier.hpp>
37 : : #include <com/sun/star/text/XFootnotesSupplier.hpp>
38 : : #include <com/sun/star/text/XLineNumberingProperties.hpp>
39 : : #include <com/sun/star/awt/FontRelief.hpp>
40 : : #include <com/sun/star/awt/FontWeight.hpp>
41 : : #include <com/sun/star/awt/FontUnderline.hpp>
42 : : #include <com/sun/star/awt/FontStrikeout.hpp>
43 : : #include <com/sun/star/awt/FontSlant.hpp>
44 : : #include <com/sun/star/document/XEventBroadcaster.hpp>
45 : : #include <com/sun/star/style/ParagraphAdjust.hpp>
46 : : #include <com/sun/star/style/BreakType.hpp>
47 : : #include <com/sun/star/style/CaseMap.hpp>
48 : : #include <com/sun/star/style/LineSpacing.hpp>
49 : : #include <com/sun/star/style/LineSpacingMode.hpp>
50 : : #include <com/sun/star/text/FootnoteNumbering.hpp>
51 : : #include <com/sun/star/text/TextGridMode.hpp>
52 : : #include <com/sun/star/text/XDocumentIndexesSupplier.hpp>
53 : : #include <com/sun/star/text/XTextFieldsSupplier.hpp>
54 : : #include <com/sun/star/text/WritingMode.hpp>
55 : : #include <com/sun/star/text/WritingMode2.hpp>
56 : : #include <com/sun/star/text/XFootnote.hpp>
57 : : #include <com/sun/star/style/NumberingType.hpp>
58 : : #include <comphelper/types.hxx>
59 : : #include <comphelper/storagehelper.hxx>
60 : :
61 : : #include <rtl/oustringostreaminserter.hxx>
62 : : #include <tools/color.hxx>
63 : : #include <CellColorHandler.hxx>
64 : : #include <SectionColumnHandler.hxx>
65 : : #include <GraphicHelpers.hxx>
66 : :
67 : : using namespace ::com::sun::star;
68 : : using namespace ::rtl;
69 : :
70 : : namespace writerfilter {
71 : :
72 : : using resourcemodel::resolveSprmProps;
73 : : using resourcemodel::resolveAttributeProperties;
74 : :
75 : : namespace dmapper{
76 : :
77 : 20 : TagLogger::Pointer_t dmapper_logger(TagLogger::getInstance("DOMAINMAPPER"));
78 : :
79 : : struct _PageSz
80 : : {
81 : : sal_Int32 code;
82 : : sal_Int32 h;
83 : : bool orient;
84 : : sal_Int32 w;
85 : : } CT_PageSz;
86 : :
87 : :
88 : 506 : DomainMapper::DomainMapper( const uno::Reference< uno::XComponentContext >& xContext,
89 : : uno::Reference< io::XInputStream > xInputStream,
90 : : uno::Reference< lang::XComponent > xModel,
91 : : SourceDocumentType eDocumentType) :
92 : : LoggedProperties(dmapper_logger, "DomainMapper"),
93 : : LoggedTable(dmapper_logger, "DomainMapper"),
94 : : LoggedStream(dmapper_logger, "DomainMapper"),
95 [ + - ]: 506 : m_pImpl( new DomainMapper_Impl( *this, xContext, xModel, eDocumentType )),
96 [ + - ][ + - ]: 1012 : mnBackgroundColor(0), mbIsHighlightSet(false)
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ]
97 : : {
98 : : // #i24363# tab stops relative to indent
99 : : m_pImpl->SetDocumentSettingsProperty(
100 [ + - ][ + - ]: 506 : PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_TABS_RELATIVE_TO_INDENT ),
101 [ + - ][ + - ]: 1012 : uno::makeAny( false ) );
102 : :
103 : : m_pImpl->SetDocumentSettingsProperty(
104 [ + - ][ + - ]: 506 : PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_ADD_PARA_TABLE_SPACING ),
105 [ + - ][ + - ]: 1012 : uno::makeAny( false ) );
106 : :
107 : : //import document properties
108 : :
109 : : try
110 : : {
111 [ + - ][ + - ]: 506 : uno::Reference< lang::XMultiServiceFactory > xFactory(xContext->getServiceManager(), uno::UNO_QUERY_THROW);
[ + - ]
112 : : uno::Reference< embed::XStorage > xDocumentStorage =
113 [ + + ][ + - ]: 506 : (comphelper::OStorageHelper::GetStorageOfFormatFromInputStream(OFOPXML_STORAGE_FORMAT_STRING, xInputStream));
114 : :
115 [ + - ][ + - ]: 382 : uno::Reference< uno::XInterface > xTemp = xContext->getServiceManager()->createInstanceWithContext(
[ + - ]
116 : : "com.sun.star.document.OOXMLDocumentPropertiesImporter",
117 [ + - ]: 191 : xContext);
118 : :
119 [ + - ]: 191 : uno::Reference< document::XOOXMLDocumentPropertiesImporter > xImporter( xTemp, uno::UNO_QUERY_THROW );
120 [ + - ]: 191 : uno::Reference< document::XDocumentPropertiesSupplier > xPropSupplier( xModel, uno::UNO_QUERY_THROW);
121 [ + - ][ + - ]: 506 : xImporter->importProperties( xDocumentStorage, xPropSupplier->getDocumentProperties() );
[ + - ][ + - ]
[ - + ]
122 : : }
123 [ + - ]: 315 : catch( const uno::Exception& rEx )
124 : : {
125 : : (void)rEx;
126 : : }
127 : 506 : }
128 : :
129 [ + - ][ + - ]: 506 : DomainMapper::~DomainMapper()
[ + - ]
130 : : {
131 : : try
132 : : {
133 [ + - ][ + - ]: 506 : uno::Reference< text::XDocumentIndexesSupplier> xIndexesSupplier( m_pImpl->GetTextDocument(), uno::UNO_QUERY );
134 : 506 : sal_Int32 nIndexes = 0;
135 [ + + ]: 506 : if( xIndexesSupplier.is() )
136 : : {
137 [ + - ][ + - ]: 473 : uno::Reference< container::XIndexAccess > xIndexes = xIndexesSupplier->getDocumentIndexes();
138 [ + - ][ + - ]: 473 : nIndexes = xIndexes->getCount();
139 : : }
140 : : // If we have page references, those need updating as well, similar to the indexes.
141 [ + - ][ + - ]: 506 : uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(m_pImpl->GetTextDocument(), uno::UNO_QUERY);
142 [ + + ]: 506 : if(xTextFieldsSupplier.is())
143 : : {
144 [ + - ][ + - ]: 473 : uno::Reference<container::XEnumeration> xEnumeration = xTextFieldsSupplier->getTextFields()->createEnumeration();
[ + - ][ + - ]
145 [ + - ][ + - ]: 506 : while(xEnumeration->hasMoreElements())
[ + + ]
146 : : {
147 : 33 : ++nIndexes;
148 [ + - ][ + - ]: 33 : xEnumeration->nextElement();
149 : 473 : }
150 : : }
151 [ + + ]: 506 : if( nIndexes )
152 : : {
153 : : //index update has to wait until first view is created
154 [ + - ]: 30 : uno::Reference< document::XEventBroadcaster > xBroadcaster(xIndexesSupplier, uno::UNO_QUERY);
155 [ + - ][ + - ]: 30 : xBroadcaster->addEventListener(uno::Reference< document::XEventListener >(new ModelEventListener));
[ + - ][ + - ]
[ + - ]
156 : : }
157 : :
158 : :
159 : : // Apply the document settings after everything else
160 [ + - ][ + - ]: 506 : m_pImpl->GetSettingsTable()->ApplyProperties( m_pImpl->GetTextDocument( ) );
[ + - ][ + - ]
[ # # ]
161 : : }
162 [ # # ]: 0 : catch( const uno::Exception& rEx )
163 : : {
164 : : (void)rEx;
165 : : }
166 : :
167 [ + - ][ + - ]: 506 : delete m_pImpl;
168 [ - + ]: 1012 : }
169 : :
170 : 11894 : void DomainMapper::lcl_attribute(Id nName, Value & val)
171 : : {
172 [ + + ][ + - ]: 11894 : static OUString sLocalBookmarkName;
173 [ + - ]: 11894 : sal_Int32 nIntValue = val.getInt();
174 [ + - ]: 11894 : OUString sStringValue = val.getString();
175 : :
176 [ + - ]: 11894 : SectionPropertyMap * pSectionContext = m_pImpl->GetSectionContext();
177 : :
178 [ + + ][ - + ]: 11894 : if( nName >= NS_rtf::LN_WIDENT && nName <= NS_rtf::LN_LCBSTTBFUSSR )
179 [ # # ]: 0 : m_pImpl->GetFIB().SetData( nName, nIntValue );
180 : : else
181 : : {
182 : :
183 : :
184 [ - + - - : 11894 : switch( nName )
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - + + -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- + + - +
+ + + + +
+ + + + +
+ - + - +
+ + + + -
- - - - +
+ + + + +
+ + + + +
+ - - - -
+ - - + +
+ + + + +
+ - - - +
- + + +
- ]
185 : : {
186 : : /* attributes to be ignored */
187 : : case NS_rtf::LN_UNUSED1_3:
188 : : case NS_rtf::LN_UNUSED1_7:
189 : : case NS_rtf::LN_UNUSED8_3:
190 : : case NS_rtf::LN_FWRITERESERVATION:
191 : : case NS_rtf::LN_FLOADOVERRIDE:
192 : : case NS_rtf::LN_FFAREAST:
193 : : case NS_rtf::LN_FCRYPTO:
194 : : case NS_rtf::LN_NFIBBACK:
195 : : case NS_rtf::LN_LKEY:
196 : : case NS_rtf::LN_ENVR:
197 : : case NS_rtf::LN_FMAC:
198 : : case NS_rtf::LN_FWORD97SAVED:
199 : : case NS_rtf::LN_FCMAC:
200 : : case NS_rtf::LN_PNFBPCHPFIRST_W6:
201 : : case NS_rtf::LN_PNCHPFIRST_W6:
202 : : case NS_rtf::LN_CPNBTECHP_W6:
203 : : case NS_rtf::LN_PNFBPPAPFIRST_W6:
204 : : case NS_rtf::LN_PNPAPFIRST_W6:
205 : : case NS_rtf::LN_CPNBTEPAP_W6:
206 : : case NS_rtf::LN_PNFBPLVCFIRST_W6:
207 : : case NS_rtf::LN_PNLVCFIRST_W6:
208 : : case NS_rtf::LN_CPNBTELVC_W6:
209 : : case NS_rtf::LN_CBMAC:
210 : : case NS_rtf::LN_LPRODUCTCREATED:
211 : : case NS_rtf::LN_LPRODUCTREVISED:
212 : : case NS_rtf::LN_CCPMCR:
213 : : case NS_rtf::LN_PNFBPCHPFIRST:
214 : : case NS_rtf::LN_PNFBPPAPFIRST:
215 : : case NS_rtf::LN_PNFBPLVCFIRST:
216 : : case NS_rtf::LN_FCISLANDFIRST:
217 : : case NS_rtf::LN_FCISLANDLIM:
218 : : case NS_rtf::LN_FCSTSHFORIG:
219 : : case NS_rtf::LN_LCBSTSHFORIG:
220 : : case NS_rtf::LN_FCPLCFPAD:
221 : : case NS_rtf::LN_LCBPLCFPAD:
222 : : case NS_rtf::LN_FCSTTBFGLSY:
223 : : case NS_rtf::LN_LCBSTTBFGLSY:
224 : : case NS_rtf::LN_FCPLCFGLSY:
225 : : case NS_rtf::LN_LCBPLCFGLSY:
226 : : case NS_rtf::LN_FCPLCFSEA:
227 : : case NS_rtf::LN_LCBPLCFSEA:
228 : : case NS_rtf::LN_FCPLCFFLDMCR:
229 : : case NS_rtf::LN_LCBPLCFFLDMCR:
230 : : case NS_rtf::LN_FCCMDS:
231 : : case NS_rtf::LN_LCBCMDS:
232 : : case NS_rtf::LN_FCPLCMCR:
233 : : case NS_rtf::LN_LCBPLCMCR:
234 : : case NS_rtf::LN_FCSTTBFMCR:
235 : : case NS_rtf::LN_LCBSTTBFMCR:
236 : : case NS_rtf::LN_FCPRDRVR:
237 : : case NS_rtf::LN_LCBPRDRVR:
238 : : case NS_rtf::LN_FCPRENVPORT:
239 : : case NS_rtf::LN_LCBPRENVPORT:
240 : : case NS_rtf::LN_FCPRENVLAND:
241 : : case NS_rtf::LN_LCBPRENVLAND:
242 : : case NS_rtf::LN_FCWSS:
243 : : case NS_rtf::LN_LCBWSS:
244 : : case NS_rtf::LN_FCPLCFPGDFTN:
245 : : case NS_rtf::LN_LCBPLCFPGDFTN:
246 : : case NS_rtf::LN_FCAUTOSAVESOURCE:
247 : : case NS_rtf::LN_LCBAUTOSAVESOURCE:
248 : : case NS_rtf::LN_FCPLCDOAMOM:
249 : : case NS_rtf::LN_LCBPLCDOAMOM:
250 : : case NS_rtf::LN_FCPLCDOAHDR:
251 : : case NS_rtf::LN_LCBPLCDOAHDR:
252 : : case NS_rtf::LN_FCPMS:
253 : : case NS_rtf::LN_LCBPMS:
254 : : case NS_rtf::LN_FCPLCFPGDEDN:
255 : : case NS_rtf::LN_LCBPLCFPGDEDN:
256 : : case NS_rtf::LN_FCPLCFWKB:
257 : : case NS_rtf::LN_LCBPLCFWKB:
258 : : case NS_rtf::LN_FCPLCFSPL:
259 : : case NS_rtf::LN_LCBPLCFSPL:
260 : : case NS_rtf::LN_FCSTWUSER:
261 : : case NS_rtf::LN_LCBSTWUSER:
262 : : case NS_rtf::LN_FCUNUSED:
263 : : case NS_rtf::LN_LCBUNUSED:
264 : : case NS_rtf::LN_FCSTTBFINTLFLD:
265 : : case NS_rtf::LN_LCBSTTBFINTLFLD:
266 : : case NS_rtf::LN_FCROUTESLIP:
267 : : case NS_rtf::LN_LCBROUTESLIP:
268 : : case NS_rtf::LN_FCSTTBSAVEDBY:
269 : : case NS_rtf::LN_LCBSTTBSAVEDBY:
270 : : case NS_rtf::LN_FCSTTBFNM:
271 : : case NS_rtf::LN_LCBSTTBFNM:
272 : : case NS_rtf::LN_FCDOCUNDO:
273 : : case NS_rtf::LN_LCBDOCUNDO:
274 : : case NS_rtf::LN_FCRGBUSE:
275 : : case NS_rtf::LN_LCBRGBUSE:
276 : : case NS_rtf::LN_FCUSP:
277 : : case NS_rtf::LN_LCBUSP:
278 : : case NS_rtf::LN_FCUSKF:
279 : : case NS_rtf::LN_LCBUSKF:
280 : : case NS_rtf::LN_FCPLCUPCRGBUSE:
281 : : case NS_rtf::LN_LCBPLCUPCRGBUSE:
282 : : case NS_rtf::LN_FCPLCUPCUSP:
283 : : case NS_rtf::LN_LCBPLCUPCUSP:
284 : : case NS_rtf::LN_FCPLGOSL:
285 : : case NS_rtf::LN_LCBPLGOSL:
286 : : case NS_rtf::LN_FCPLCOCX:
287 : : case NS_rtf::LN_LCBPLCOCX:
288 : : case NS_rtf::LN_DWLOWDATETIME:
289 : : case NS_rtf::LN_DWHIGHDATETIME:
290 : : case NS_rtf::LN_FCPLCASUMY:
291 : : case NS_rtf::LN_LCBPLCASUMY:
292 : : case NS_rtf::LN_FCPLCFGRAM:
293 : : case NS_rtf::LN_LCBPLCFGRAM:
294 : : case NS_rtf::LN_FCSTTBFUSSR:
295 : 0 : break;
296 : :
297 : : case NS_rtf::LN_ISTD: //index of applied style
298 : : {
299 : : //search for the style with the given id and apply it
300 : : //as CharStyleName or ParaStyleName
301 : : //if the style is a user defined style then it must have an ISTD - built-in styles might not have it
302 [ + - ]: 306 : StyleSheetTablePtr pStyleSheets = m_pImpl->GetStyleSheetTable();
303 : 306 : OUString sValue = OUString::valueOf(nIntValue, 16);
304 [ + - ]: 306 : const StyleSheetEntryPtr pEntry = pStyleSheets->FindStyleSheetByISTD(sValue);
305 [ + + ]: 306 : if( pEntry.get( ) )
306 : : {
307 : 300 : bool bParaStyle = (pEntry->nStyleTypeCode == STYLE_TYPE_PARA);
308 [ + - ]: 300 : if(bParaStyle)
309 : 300 : m_pImpl->SetCurrentParaStyleId(OUString::valueOf(static_cast<sal_Int32>(nIntValue), 16));
310 [ + - ][ + - ]: 300 : if (m_pImpl->GetTopContext() && m_pImpl->GetTopContextType() != CONTEXT_SECTION)
[ + - ][ + - ]
[ + - ][ + - ]
[ + - # # ]
311 : : m_pImpl->GetTopContext()->Insert(
312 : : bParaStyle ?
313 : : PROP_PARA_STYLE_NAME : PROP_CHAR_STYLE_NAME,
314 : : true,
315 : : uno::makeAny(
316 [ + - ][ + - ]: 300 : m_pImpl->GetStyleSheetTable()->ConvertStyleName( pEntry->sStyleName ) ) );
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
317 [ + - ][ + - ]: 306 : }
318 : : }
319 : 306 : break;
320 : : case NS_rtf::LN_ISTARTAT:
321 : 0 : break;
322 : : case NS_rtf::LN_NFC:
323 : 0 : break;
324 : : case NS_rtf::LN_FLEGAL:
325 : 0 : break;
326 : : case NS_rtf::LN_FNORESTART:
327 : 0 : break;
328 : : case NS_rtf::LN_FIDENTSAV:
329 : 0 : break;
330 : : case NS_rtf::LN_FCONVERTED:
331 : 0 : break;
332 : : case NS_rtf::LN_FTENTATIVE:
333 : 0 : break;
334 : : case NS_rtf::LN_RGBXCHNUMS:
335 : 0 : break;
336 : : case NS_rtf::LN_IXCHFOLLOW:
337 : 0 : break;
338 : : case NS_rtf::LN_DXASPACE:
339 : 0 : break;
340 : : case NS_rtf::LN_DXAINDENT:
341 : 0 : break;
342 : : case NS_rtf::LN_CBGRPPRLCHPX:
343 : 0 : break;
344 : : case NS_rtf::LN_CBGRPPRLPAPX:
345 : 0 : break;
346 : : case NS_rtf::LN_LSID:
347 : 0 : break;
348 : : case NS_rtf::LN_TPLC:
349 : 0 : break;
350 : : case NS_rtf::LN_RGISTD:
351 : 0 : break;
352 : : case NS_rtf::LN_FSIMPLELIST:
353 : 0 : break;
354 : : case NS_rtf::LN_fAutoNum:
355 : 0 : break;
356 : : case NS_rtf::LN_fHybrid:
357 : 0 : break;
358 : : case NS_rtf::LN_ILVL:
359 : 0 : break;
360 : : case NS_rtf::LN_FSTARTAT:
361 : 0 : break;
362 : : case NS_rtf::LN_FFORMATTING:
363 : 0 : break;
364 : : case NS_rtf::LN_UNSIGNED4_6:
365 : 0 : break;
366 : : case NS_rtf::LN_clfolvl:
367 : 0 : break;
368 : : case NS_rtf::LN_CBFFNM1:
369 : 0 : break;
370 : : case NS_rtf::LN_PRQ:
371 : 0 : break;
372 : : case NS_rtf::LN_FTRUETYPE:
373 : 0 : break;
374 : : case NS_rtf::LN_FF:
375 : 0 : break;
376 : : case NS_rtf::LN_WWEIGHT:
377 : 0 : break;
378 : : case NS_rtf::LN_CHS:
379 : :
380 : : {
381 : 0 : m_pImpl->GetFIB().SetLNCHS( nIntValue );
382 : : }
383 : 0 : break;
384 : : case NS_rtf::LN_IXCHSZALT:
385 : 0 : break;
386 : : case NS_rtf::LN_PANOSE:
387 : 0 : break;
388 : : case NS_rtf::LN_FS:
389 : 0 : break;
390 : : case NS_rtf::LN_STI:
391 : 0 : break;
392 : : case NS_rtf::LN_FSCRATCH:
393 : 0 : break;
394 : : case NS_rtf::LN_FINVALHEIGHT:
395 : 0 : break;
396 : : case NS_rtf::LN_FHASUPE:
397 : 0 : break;
398 : : case NS_rtf::LN_FMASSCOPY:
399 : 0 : break;
400 : : case NS_rtf::LN_SGC:
401 : 0 : break;
402 : : case NS_rtf::LN_ISTDBASE:
403 : 0 : break;
404 : : case NS_rtf::LN_CUPX:
405 : 0 : break;
406 : : case NS_rtf::LN_ISTDNEXT:
407 : 0 : break;
408 : : case NS_rtf::LN_BCHUPE:
409 : 0 : break;
410 : : case NS_rtf::LN_FAUTOREDEF:
411 : 0 : break;
412 : : case NS_rtf::LN_FHIDDEN:
413 : 0 : break;
414 : : case NS_rtf::LN_CSTD:
415 : 0 : break;
416 : : case NS_rtf::LN_CBSTDBASEINFILE:
417 : 0 : break;
418 : : case NS_rtf::LN_FSTDSTYLENAMESWRITTEN:
419 : 0 : break;
420 : : case NS_rtf::LN_UNUSED4_2:
421 : 0 : break;
422 : : case NS_rtf::LN_STIMAXWHENSAVED:
423 : 0 : break;
424 : : case NS_rtf::LN_ISTDMAXFIXEDWHENSAVED:
425 : 0 : break;
426 : : case NS_rtf::LN_NVERBUILTINNAMESWHENSAVED:
427 : 0 : break;
428 : : case NS_rtf::LN_RGFTCSTANDARDCHPSTSH:
429 : 0 : break;
430 : : case NS_rtf::LN_WIDENT:
431 : :
432 : : case NS_rtf::LN_NFIB:
433 : :
434 : : case NS_rtf::LN_NPRODUCT:
435 : : case NS_rtf::LN_LID:
436 : : case NS_rtf::LN_PNNEXT:
437 : : case NS_rtf::LN_FDOT:
438 : : case NS_rtf::LN_FGLSY:
439 : : case NS_rtf::LN_FCOMPLEX:
440 : : case NS_rtf::LN_FHASPIC:
441 : : case NS_rtf::LN_CQUICKSAVES:
442 : : case NS_rtf::LN_FENCRYPTED:
443 : : case NS_rtf::LN_FWHICHTBLSTM:
444 : : case NS_rtf::LN_FREADONLYRECOMMENDED:
445 : : case NS_rtf::LN_FEXTCHAR:
446 : : case NS_rtf::LN_FEMPTYSPECIAL:
447 : : case NS_rtf::LN_FLOADOVERRIDEPAGE:
448 : : case NS_rtf::LN_FFUTURESAVEDUNDO:
449 : : case NS_rtf::LN_FSPARE0:
450 : : case NS_rtf::LN_CHSTABLES:
451 : : case NS_rtf::LN_FCMIN:
452 : : case NS_rtf::LN_CSW:
453 : : case NS_rtf::LN_WMAGICCREATED:
454 : : case NS_rtf::LN_WMAGICREVISED:
455 : : case NS_rtf::LN_WMAGICCREATEDPRIVATE:
456 : : case NS_rtf::LN_WMAGICREVISEDPRIVATE:
457 : : case NS_rtf::LN_LIDFE:
458 : : case NS_rtf::LN_CLW:
459 : : case NS_rtf::LN_CCPTEXT:
460 : : case NS_rtf::LN_CCPFTN:
461 : : case NS_rtf::LN_CCPHDD:
462 : : case NS_rtf::LN_CCPATN:
463 : : case NS_rtf::LN_CCPEDN:
464 : : case NS_rtf::LN_CCPTXBX:
465 : : case NS_rtf::LN_CCPHDRTXBX:
466 : : case NS_rtf::LN_PNCHPFIRST:
467 : : case NS_rtf::LN_CPNBTECHP:
468 : : case NS_rtf::LN_PNPAPFIRST:
469 : : case NS_rtf::LN_CPNBTEPAP:
470 : : case NS_rtf::LN_PNLVCFIRST:
471 : : case NS_rtf::LN_CPNBTELVC:
472 : : case NS_rtf::LN_CFCLCB:
473 : : case NS_rtf::LN_FCSTSHF:
474 : : case NS_rtf::LN_LCBSTSHF:
475 : : case NS_rtf::LN_FCPLCFFNDREF:
476 : : case NS_rtf::LN_LCBPLCFFNDREF:
477 : : case NS_rtf::LN_FCPLCFFNDTXT:
478 : : case NS_rtf::LN_LCBPLCFFNDTXT:
479 : : case NS_rtf::LN_FCPLCFANDREF:
480 : : case NS_rtf::LN_LCBPLCFANDREF:
481 : : case NS_rtf::LN_FCPLCFANDTXT:
482 : : case NS_rtf::LN_LCBPLCFANDTXT:
483 : : case NS_rtf::LN_FCPLCFSED:
484 : : case NS_rtf::LN_LCBPLCFSED:
485 : : case NS_rtf::LN_FCPLCFPHE:
486 : : case NS_rtf::LN_LCBPLCFPHE:
487 : : case NS_rtf::LN_FCPLCFHDD:
488 : : case NS_rtf::LN_LCBPLCFHDD:
489 : : case NS_rtf::LN_FCPLCFBTECHPX:
490 : : case NS_rtf::LN_LCBPLCFBTECHPX:
491 : : case NS_rtf::LN_FCPLCFBTEPAPX:
492 : : case NS_rtf::LN_LCBPLCFBTEPAPX:
493 : : case NS_rtf::LN_FCSTTBFFFN:
494 : : case NS_rtf::LN_LCBSTTBFFFN:
495 : : case NS_rtf::LN_FCPLCFFLDMOM:
496 : : case NS_rtf::LN_LCBPLCFFLDMOM:
497 : : case NS_rtf::LN_FCPLCFFLDHDR:
498 : : case NS_rtf::LN_LCBPLCFFLDHDR:
499 : : case NS_rtf::LN_FCPLCFFLDFTN:
500 : : case NS_rtf::LN_LCBPLCFFLDFTN:
501 : : case NS_rtf::LN_FCPLCFFLDATN:
502 : : case NS_rtf::LN_LCBPLCFFLDATN:
503 : : case NS_rtf::LN_FCSTTBFBKMK:
504 : : case NS_rtf::LN_LCBSTTBFBKMK:
505 : : case NS_rtf::LN_FCPLCFBKF:
506 : : case NS_rtf::LN_LCBPLCFBKF:
507 : : case NS_rtf::LN_FCPLCFBKL:
508 : : case NS_rtf::LN_LCBPLCFBKL:
509 : : case NS_rtf::LN_FCDOP:
510 : : case NS_rtf::LN_LCBDOP:
511 : : case NS_rtf::LN_FCSTTBFASSOC:
512 : : case NS_rtf::LN_LCBSTTBFASSOC:
513 : : case NS_rtf::LN_FCCLX:
514 : : case NS_rtf::LN_LCBCLX:
515 : : case NS_rtf::LN_FCGRPXSTATNOWNERS:
516 : : case NS_rtf::LN_LCBGRPXSTATNOWNERS:
517 : : case NS_rtf::LN_FCSTTBFATNBKMK:
518 : : case NS_rtf::LN_LCBSTTBFATNBKMK:
519 : : case NS_rtf::LN_FCPLCSPAMOM:
520 : : case NS_rtf::LN_LCBPLCSPAMOM:
521 : : case NS_rtf::LN_FCPLCSPAHDR:
522 : : case NS_rtf::LN_LCBPLCSPAHDR:
523 : : case NS_rtf::LN_FCPLCFATNBKF:
524 : : case NS_rtf::LN_LCBPLCFATNBKF:
525 : : case NS_rtf::LN_FCPLCFATNBKL:
526 : : case NS_rtf::LN_LCBPLCFATNBKL:
527 : : case NS_rtf::LN_FCFORMFLDSTTBF:
528 : : case NS_rtf::LN_LCBFORMFLDSTTBF:
529 : : case NS_rtf::LN_FCPLCFENDREF:
530 : : case NS_rtf::LN_LCBPLCFENDREF:
531 : : case NS_rtf::LN_FCPLCFENDTXT:
532 : : case NS_rtf::LN_LCBPLCFENDTXT:
533 : : case NS_rtf::LN_FCPLCFFLDEDN:
534 : : case NS_rtf::LN_LCBPLCFFLDEDN:
535 : : case NS_rtf::LN_FCDGGINFO:
536 : : case NS_rtf::LN_LCBDGGINFO:
537 : : case NS_rtf::LN_FCSTTBFRMARK:
538 : : case NS_rtf::LN_LCBSTTBFRMARK:
539 : : case NS_rtf::LN_FCSTTBFCAPTION:
540 : : case NS_rtf::LN_LCBSTTBFCAPTION:
541 : : case NS_rtf::LN_FCSTTBFAUTOCAPTION:
542 : : case NS_rtf::LN_LCBSTTBFAUTOCAPTION:
543 : : case NS_rtf::LN_LCBPLCFTXBXTXT:
544 : : case NS_rtf::LN_FCPLCFFLDTXBX:
545 : : case NS_rtf::LN_LCBPLCFFLDTXBX:
546 : : case NS_rtf::LN_FCPLCFHDRTXBXTXT:
547 : : case NS_rtf::LN_LCBPLCFHDRTXBXTXT:
548 : : case NS_rtf::LN_FCPLCFFLDHDRTXBX:
549 : : case NS_rtf::LN_LCBPLCFFLDHDRTXBX:
550 : : case NS_rtf::LN_FCSTTBTTMBD:
551 : : case NS_rtf::LN_LCBSTTBTTMBD:
552 : : case NS_rtf::LN_FCPGDMOTHER:
553 : : case NS_rtf::LN_LCBPGDMOTHER:
554 : : case NS_rtf::LN_FCBKDMOTHER:
555 : : case NS_rtf::LN_LCBBKDMOTHER:
556 : : case NS_rtf::LN_FCPGDFTN:
557 : : case NS_rtf::LN_LCBPGDFTN:
558 : : case NS_rtf::LN_FCBKDFTN:
559 : : case NS_rtf::LN_LCBBKDFTN:
560 : : case NS_rtf::LN_FCPGDEDN:
561 : : case NS_rtf::LN_LCBPGDEDN:
562 : : case NS_rtf::LN_FCBKDEDN:
563 : : case NS_rtf::LN_LCBBKDEDN:
564 : : case NS_rtf::LN_FCPLCFLST:
565 : : case NS_rtf::LN_LCBPLCFLST:
566 : : case NS_rtf::LN_FCPLFLFO:
567 : : case NS_rtf::LN_LCBPLFLFO:
568 : : case NS_rtf::LN_FCPLCFTXBXBKD:
569 : : case NS_rtf::LN_LCBPLCFTXBXBKD:
570 : : case NS_rtf::LN_FCPLCFTXBXHDRBKD:
571 : : case NS_rtf::LN_LCBPLCFTXBXHDRBKD:
572 : : case NS_rtf::LN_FCSTTBGLSYSTYLE:
573 : : case NS_rtf::LN_LCBSTTBGLSYSTYLE:
574 : : case NS_rtf::LN_FCPLCFBTELVC:
575 : : case NS_rtf::LN_LCBPLCFBTELVC:
576 : : case NS_rtf::LN_FCPLCFLVC:
577 : : case NS_rtf::LN_LCBPLCFLVC:
578 : : case NS_rtf::LN_FCSTTBLISTNAMES:
579 : : case NS_rtf::LN_LCBSTTBLISTNAMES:
580 : : case NS_rtf::LN_LCBSTTBFUSSR:
581 : : {
582 [ # # ]: 0 : m_pImpl->GetFIB().SetData( nName, nIntValue );
583 : : }
584 : 0 : break;
585 : : case NS_rtf::LN_FN:
586 : : case NS_rtf::LN_FCSEPX:
587 : : case NS_rtf::LN_FNMPR:
588 : : case NS_rtf::LN_FCMPR:
589 : :
590 : : //section descriptor, unused or internally used
591 : 0 : break;
592 : : case NS_rtf::LN_ICOFORE:
593 : 0 : break;
594 : : case NS_rtf::LN_ICOBACK:
595 : 0 : break;
596 : : case NS_rtf::LN_IPAT:
597 : 0 : break;
598 : : case NS_rtf::LN_SHDFORECOLOR:
599 : 0 : break;
600 : : case NS_rtf::LN_SHDBACKCOLOR:
601 : 0 : break;
602 : : case NS_rtf::LN_SHDPATTERN:
603 : 0 : break;
604 : : case NS_rtf::LN_DPTLINEWIDTH:
605 : 0 : break;
606 : : case NS_rtf::LN_BRCTYPE:
607 : 0 : break;
608 : : case NS_rtf::LN_ICO:
609 : 0 : break;
610 : : case NS_rtf::LN_DPTSPACE:
611 : 0 : break;
612 : : case NS_rtf::LN_FSHADOW:
613 : 0 : break;
614 : : case NS_rtf::LN_FFRAME:
615 : 0 : break;
616 : : case NS_rtf::LN_UNUSED2_15:
617 : 0 : break;
618 : : case NS_rtf::LN_FFIRSTMERGED:
619 : 0 : break;
620 : : case NS_rtf::LN_FMERGED:
621 : 0 : break;
622 : : case NS_rtf::LN_FVERTICAL:
623 : 0 : break;
624 : : case NS_rtf::LN_FBACKWARD:
625 : 0 : break;
626 : : case NS_rtf::LN_FROTATEFONT:
627 : 0 : break;
628 : : case NS_rtf::LN_FVERTMERGE:
629 : 0 : break;
630 : : case NS_rtf::LN_FVERTRESTART:
631 : 0 : break;
632 : : case NS_rtf::LN_VERTALIGN:
633 : 0 : break;
634 : : case NS_rtf::LN_FUNUSED:
635 : 0 : break;
636 : : case NS_rtf::LN_BRCTOP:
637 : : case NS_rtf::LN_BRCLEFT:
638 : : case NS_rtf::LN_BRCBOTTOM:
639 : : case NS_rtf::LN_BRCRIGHT:
640 : : {
641 : 0 : table::BorderLine2 aBorderLine;
642 [ # # ]: 0 : sal_Int32 nLineDistance = ConversionHelper::MakeBorderLine( nIntValue, aBorderLine );
643 : : (void)nLineDistance;
644 : 0 : PropertyIds eBorderId = PROP_LEFT_BORDER;
645 : 0 : PropertyIds eBorderDistId = PROP_LEFT_BORDER_DISTANCE ;
646 [ # # # # : 0 : switch( nName )
# ]
647 : : {
648 : : case NS_rtf::LN_BRCTOP:
649 : 0 : eBorderId = PROP_TOP_BORDER ;
650 : 0 : eBorderDistId = PROP_TOP_BORDER_DISTANCE;
651 : 0 : break;
652 : : case NS_rtf::LN_BRCLEFT:
653 : 0 : break;
654 : : case NS_rtf::LN_BRCBOTTOM:
655 : 0 : eBorderId = PROP_BOTTOM_BORDER ;
656 : 0 : eBorderDistId = PROP_BOTTOM_BORDER_DISTANCE;
657 : 0 : break;
658 : : case NS_rtf::LN_BRCRIGHT:
659 : 0 : eBorderId = PROP_RIGHT_BORDER ;
660 : 0 : eBorderDistId = PROP_RIGHT_BORDER_DISTANCE ;
661 : 0 : break;
662 : : default:;
663 : : }
664 : : //todo: where to put the border properties
665 : : //rContext->Insert(eBorderId, uno::makeAny( aBorderLine ));
666 : : //rContext->Insert(eBorderDistId, uno::makeAny( nLineDistance ));
667 : : (void)eBorderId;
668 : : (void)eBorderDistId;
669 : : }
670 : 0 : break;
671 : : case NS_rtf::LN_ITCFIRST:
672 : 0 : break;
673 : : case NS_rtf::LN_FPUB:
674 : 0 : break;
675 : : case NS_rtf::LN_ITCLIM:
676 : 0 : break;
677 : : case NS_rtf::LN_FCOL:
678 : 0 : break;
679 : : case NS_rtf::LN_LINECOLOR:
680 : 0 : break;
681 : : case NS_rtf::LN_LINEWIDTH:
682 : 0 : break;
683 : : case NS_rtf::LN_LINETYPE:
684 : 0 : break;
685 : : case NS_rtf::LN_MM:
686 : 0 : break;
687 : : case NS_rtf::LN_XEXT:
688 : 0 : break;
689 : : case NS_rtf::LN_YEXT:
690 : 0 : break;
691 : : case NS_rtf::LN_HMF:
692 : 0 : break;
693 : : case NS_rtf::LN_LCB:
694 : 0 : break;
695 : : case NS_rtf::LN_CBHEADER:
696 : 0 : break;
697 : : case NS_rtf::LN_MFP:
698 : 0 : break;
699 : : case NS_rtf::LN_BM_RCWINMF:
700 : 0 : break;
701 : : case NS_rtf::LN_DXAGOAL:
702 : 0 : break;
703 : : case NS_rtf::LN_DYAGOAL:
704 : 0 : break;
705 : : case NS_rtf::LN_MX:
706 : 0 : break;
707 : : case NS_rtf::LN_MY:
708 : 0 : break;
709 : : case NS_rtf::LN_DXACROPLEFT:
710 : 0 : break;
711 : : case NS_rtf::LN_DYACROPTOP:
712 : 0 : break;
713 : : case NS_rtf::LN_DXACROPRIGHT:
714 : 0 : break;
715 : : case NS_rtf::LN_DYACROPBOTTOM:
716 : 0 : break;
717 : : case NS_rtf::LN_BRCL:
718 : 0 : break;
719 : : case NS_rtf::LN_FFRAMEEMPTY:
720 : 0 : break;
721 : : case NS_rtf::LN_FBITMAP:
722 : 0 : break;
723 : : case NS_rtf::LN_FDRAWHATCH:
724 : 0 : break;
725 : : case NS_rtf::LN_FERROR:
726 : 0 : break;
727 : : case NS_rtf::LN_BPP:
728 : 0 : break;
729 : : case NS_rtf::LN_DXAORIGIN:
730 : 0 : break;
731 : : case NS_rtf::LN_DYAORIGIN:
732 : 0 : break;
733 : : case NS_rtf::LN_CPROPS:
734 : 0 : break;
735 : : case NS_rtf::LN_LINEPROPSTOP:
736 : 0 : break;
737 : : case NS_rtf::LN_LINEPROPSLEFT:
738 : 0 : break;
739 : : case NS_rtf::LN_LINEPROPSBOTTOM:
740 : 0 : break;
741 : : case NS_rtf::LN_LINEPROPSRIGHT:
742 : 0 : break;
743 : : case NS_rtf::LN_LINEPROPSHORIZONTAL:
744 : 0 : break;
745 : : case NS_rtf::LN_LINEPROPSVERTICAL:
746 : 0 : break;
747 : : case NS_rtf::LN_headerr:
748 : 0 : break;
749 : : case NS_rtf::LN_footerr:
750 : 0 : break;
751 : : case NS_rtf::LN_endnote:
752 : 0 : break;
753 : : case NS_rtf::LN_BOOKMARKNAME:
754 : : // sStringValue contains the bookmark name
755 : 21 : sLocalBookmarkName = sStringValue;
756 : 21 : break;
757 : : case NS_rtf::LN_IBKL:
758 : : //contains the bookmark identifier - has to be added to the bookmark name imported before
759 : : //if it is already available then the bookmark should be inserted
760 [ + - ]: 42 : m_pImpl->AddBookmark( sLocalBookmarkName, sStringValue );
761 : 42 : sLocalBookmarkName = OUString();
762 : 42 : break;
763 : : case NS_rtf::LN_LISTLEVEL:
764 : 0 : break;
765 : : case NS_rtf::LN_LFOData:
766 : 0 : break;
767 : : case NS_rtf::LN_F:
768 : 0 : break;
769 : : case NS_rtf::LN_ALTFONTNAME:
770 : 0 : break;
771 : : case NS_rtf::LN_XSZFFN:
772 : 0 : break;
773 : : case NS_rtf::LN_XSTZNAME:
774 : 0 : break;
775 : : case NS_rtf::LN_XSTZNAME1:
776 : 0 : break;
777 : : case NS_rtf::LN_UPXSTART:
778 : 0 : break;
779 : : case NS_rtf::LN_UPX:
780 : 0 : break;
781 : : case NS_rtf::LN_sed:
782 : : //section properties
783 [ # # ]: 0 : resolveAttributeProperties(*this, val);
784 : 0 : break;
785 : : case NS_rtf::LN_tbdAdd:
786 : : //
787 : : {
788 [ # # ]: 0 : writerfilter::Reference<Properties>::Pointer_t pProperties = val.getProperties();
789 [ # # ]: 0 : if( pProperties.get())
790 : : {
791 [ # # ]: 0 : pProperties->resolve(*this);
792 : : //increment to the next tab stop
793 : 0 : m_pImpl->NextTabStop();
794 [ # # ]: 0 : }
795 : : }
796 : 0 : break;
797 : : case NS_rtf::LN_dxaDel:
798 : : //deleted tab
799 : : case NS_rtf::LN_dxaAdd:
800 : : //set tab
801 : : case NS_rtf::LN_TLC:
802 : : //tab leading characters - for decimal tabs
803 : : case NS_rtf::LN_JC:
804 : : //tab justification
805 [ # # ]: 0 : m_pImpl->ModifyCurrentTabStop(nName, nIntValue);
806 : 0 : break;
807 : : case NS_rtf::LN_UNUSED0_6:
808 : : // really unused
809 : 0 : break;
810 : : case NS_rtf::LN_rgbrc:
811 : 0 : break;
812 : : case NS_rtf::LN_shd:
813 : 0 : break;
814 : : case NS_rtf::LN_cellShd:
815 : 0 : break;
816 : : case NS_rtf::LN_cellTopColor:
817 : : case NS_rtf::LN_cellLeftColor:
818 : : case NS_rtf::LN_cellBottomColor:
819 : : case NS_rtf::LN_cellRightColor:
820 : : OSL_FAIL("handled by DomainMapperTableManager");
821 : 0 : break;
822 : :
823 : : case NS_rtf::LN_LISTTABLE:
824 : 0 : break;
825 : : case NS_rtf::LN_LFOTABLE:
826 : 0 : break;
827 : : case NS_rtf::LN_FONTTABLE:
828 : 0 : break;
829 : : case NS_rtf::LN_STYLESHEET:
830 : 0 : break;
831 : :
832 : : case NS_rtf::LN_fcEastAsianLayout:
833 : : /* it seems that the value is following:
834 : : ???? XX YYYY ZZ
835 : : where
836 : : XX seems to be the run id
837 : : ZZ is the length of the function that is normally 6
838 : : Lower byte of YYYY determines whether it is
839 : : vertical text flow (0x01), or
840 : : two lines in one layout (0x02).
841 : : For 0x01, if the higher byte of YYYY is zero, the text is not scaled to fit the line height,
842 : : in oposite case, it is to be scaled.
843 : : For 0x02, the higher byte of YYYY is determinig the prefix and suffix of the run:
844 : : no brackets (0x00) ,
845 : : () round brackets (0x01),
846 : : [] square backets (0x02),
847 : : <> angle brackets (0x03) and
848 : : {} curly brackets (0x04).
849 : : ???? is different and we do not know its signification
850 : : */
851 : :
852 [ # # ]: 0 : if ((nIntValue & 0x000000FF) == 6)
853 : : {
854 [ # # # ]: 0 : switch ((nIntValue & 0x0000FF00) >> 8)
855 : : {
856 : : case 1: // vertical text
857 [ # # ][ # # ]: 0 : if (m_pImpl->GetTopContext())
[ # # ]
858 : : {
859 [ # # ][ # # ]: 0 : m_pImpl->GetTopContext()->Insert(PROP_CHAR_ROTATION, true, uno::makeAny ( sal_Int16(900) ));
[ # # ][ # # ]
860 [ # # ][ # # ]: 0 : m_pImpl->GetTopContext()->Insert(PROP_CHAR_ROTATION_IS_FIT_TO_LINE, true, uno::makeAny (((nIntValue & 0x00FF0000) >> 16) != 0));
[ # # ][ # # ]
861 : : }
862 : 0 : break;
863 : : case 2: // two lines in one
864 [ # # ][ # # ]: 0 : if (m_pImpl->GetTopContext())
[ # # ]
865 : : {
866 [ # # ][ # # ]: 0 : m_pImpl->GetTopContext()->Insert(PROP_CHAR_COMBINE_IS_ON, true, uno::makeAny ( true ));
[ # # ][ # # ]
867 [ # # ][ # # ]: 0 : m_pImpl->GetTopContext()->Insert(PROP_CHAR_COMBINE_PREFIX, true, uno::makeAny ( getBracketStringFromEnum((nIntValue & 0x00FF0000) >> 16)));
[ # # ][ # # ]
[ # # ]
868 [ # # ][ # # ]: 0 : m_pImpl->GetTopContext()->Insert(PROP_CHAR_COMBINE_SUFFIX, true, uno::makeAny ( getBracketStringFromEnum((nIntValue & 0x00FF0000) >> 16, false)));
[ # # ][ # # ]
[ # # ]
869 : : }
870 : 0 : break;
871 : : default:
872 : 0 : break;
873 : : }
874 : : }
875 : 0 : break;
876 : : case NS_rtf::LN_FRD :
877 : : //footnote reference descriptor, if nIntValue > 0 then automatic, custom otherwise
878 : : //ignored
879 : 0 : break;
880 : : case NS_rtf::LN_FONT: //font of footnote symbol
881 [ # # ][ # # ]: 0 : if (m_pImpl->GetTopContext())
[ # # ]
882 [ # # ][ # # ]: 0 : m_pImpl->GetTopContext()->SetFootnoteFontId( nIntValue );
883 : 0 : break;
884 : : case NS_ooxml::LN_CT_Sym_char:
885 [ # # ][ # # ]: 0 : if( m_pImpl->GetTopContext() && m_pImpl->GetTopContext()->GetFootnote().is())
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # #
# # # # ]
886 : : {
887 [ # # ][ # # ]: 0 : m_pImpl->GetTopContext()->GetFootnote()->setLabel(OUString( sal_Unicode(nIntValue)));
[ # # ][ # # ]
[ # # ]
888 : 0 : break;
889 : : }
890 : : else //it's a _real_ symbol
891 : : {
892 [ # # ]: 0 : utext( reinterpret_cast < const sal_uInt8 * >( &nIntValue ), 1 );
893 : : }
894 : 0 : break;
895 : : case NS_rtf::LN_CHAR: //footnote symbol character
896 [ # # ][ # # ]: 0 : if (m_pImpl->GetTopContext())
[ # # ]
897 [ # # ][ # # ]: 0 : m_pImpl->GetTopContext()->SetFootnoteSymbol( sal_Unicode(nIntValue));
898 : 0 : break;
899 : : case NS_ooxml::LN_CT_Sym_font:
900 : : //the footnote symbol and font are provided after the footnote is already inserted
901 [ # # ][ # # ]: 0 : if( m_pImpl->GetTopContext() && m_pImpl->GetTopContext()->GetFootnote().is())
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # #
# # # # ]
902 : : {
903 [ # # ][ # # ]: 0 : uno::Reference< beans::XPropertySet > xAnchorProps( m_pImpl->GetTopContext()->GetFootnote()->getAnchor(), uno::UNO_QUERY );
[ # # ][ # # ]
[ # # ][ # # ]
904 [ # # ]: 0 : xAnchorProps->setPropertyValue(
905 [ # # ][ # # ]: 0 : PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_CHAR_FONT_NAME),
906 [ # # ][ # # ]: 0 : uno::makeAny( sStringValue ));
907 : : }
908 : : else //a real symbol
909 [ # # ][ # # ]: 0 : if (m_pImpl->GetTopContext())
[ # # ]
910 [ # # ][ # # ]: 0 : m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME, true, uno::makeAny( sStringValue ));
[ # # ][ # # ]
911 : 0 : break;
912 : : case NS_ooxml::LN_CT_Underline_val:
913 [ + - ][ + - ]: 9 : handleUnderlineType(nIntValue, m_pImpl->GetTopContext());
[ + - ]
914 : 9 : break;
915 : : case NS_ooxml::LN_CT_Color_val:
916 [ + - ][ + - ]: 525 : if (m_pImpl->GetTopContext())
[ + - ]
917 [ + - ][ + - ]: 525 : m_pImpl->GetTopContext()->Insert(PROP_CHAR_COLOR, true, uno::makeAny( nIntValue ) );
[ + - ][ + - ]
918 : 525 : break;
919 : : case NS_ooxml::LN_CT_Underline_color:
920 [ # # ][ # # ]: 0 : if (m_pImpl->GetTopContext())
[ # # ]
921 : : {
922 [ # # ][ # # ]: 0 : m_pImpl->GetTopContext()->Insert(PROP_CHAR_UNDERLINE_HAS_COLOR, true, uno::makeAny( true ) );
[ # # ][ # # ]
923 [ # # ][ # # ]: 0 : m_pImpl->GetTopContext()->Insert(PROP_CHAR_UNDERLINE_COLOR, true, uno::makeAny( nIntValue ) );
[ # # ][ # # ]
924 : : }
925 : 0 : break;
926 : :
927 : : case NS_ooxml::LN_CT_TabStop_val:
928 [ - + ]: 153 : if (sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_ST_TabJc_clear)
929 : : {
930 : 0 : m_pImpl->m_aCurrentTabStop.bDeleted = true;
931 : : }
932 : : else
933 : : {
934 : 153 : m_pImpl->m_aCurrentTabStop.bDeleted = false;
935 [ + - ]: 153 : m_pImpl->m_aCurrentTabStop.Alignment = getTabAlignFromValue(nIntValue);
936 : : }
937 : 153 : break;
938 : : case NS_ooxml::LN_CT_TabStop_leader:
939 [ + - ]: 93 : m_pImpl->m_aCurrentTabStop.FillChar = getFillCharFromValue(nIntValue);
940 : 93 : break;
941 : : case NS_ooxml::LN_CT_TabStop_pos:
942 [ + - ]: 381 : m_pImpl->m_aCurrentTabStop.Position = ConversionHelper::convertTwipToMM100(nIntValue);
943 : 381 : break;
944 : :
945 : : case NS_ooxml::LN_CT_Fonts_ascii:
946 [ + - ][ + - ]: 746 : if (m_pImpl->GetTopContext())
[ + - ]
947 [ + - ][ + - ]: 746 : m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME, true, uno::makeAny( sStringValue ));
[ + - ][ + - ]
948 : 746 : break;
949 : : case NS_ooxml::LN_CT_Fonts_asciiTheme:
950 [ + - ][ + - ]: 111 : if (m_pImpl->GetTopContext())
[ + - ]
951 [ + - ][ + - ]: 111 : m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME, true, uno::makeAny( m_pImpl->GetThemeTable()->getFontNameForTheme(nIntValue) ));
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ]
952 : 111 : break;
953 : : case NS_ooxml::LN_CT_Fonts_hAnsi:
954 : 746 : break;//unsupported
955 : : case NS_ooxml::LN_CT_Fonts_hAnsiTheme:
956 : 111 : break; //unsupported
957 : : case NS_ooxml::LN_CT_Fonts_eastAsia:
958 [ + - ][ + - ]: 488 : if (m_pImpl->GetTopContext())
[ + - ]
959 [ + - ][ + - ]: 488 : m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME_ASIAN, true, uno::makeAny( sStringValue ));
[ + - ][ + - ]
960 : 488 : break;
961 : : case NS_ooxml::LN_CT_Fonts_eastAsiaTheme:
962 [ + - ][ + - ]: 141 : if (m_pImpl->GetTopContext())
[ + - ]
963 [ + - ][ + - ]: 141 : m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME_COMPLEX, true, uno::makeAny( m_pImpl->GetThemeTable()->getFontNameForTheme(nIntValue) ) );
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ]
964 : 141 : break;
965 : : case NS_ooxml::LN_CT_Fonts_cs:
966 [ + - ][ + - ]: 815 : if (m_pImpl->GetTopContext())
[ + - ]
967 [ + - ][ + - ]: 815 : m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME_COMPLEX, true, uno::makeAny( sStringValue ));
[ + - ][ + - ]
968 : 815 : break;
969 : : case NS_ooxml::LN_CT_Fonts_cstheme:
970 [ + - ][ + - ]: 114 : if (m_pImpl->GetTopContext())
[ + - ]
971 [ + - ][ + - ]: 114 : m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME_COMPLEX, true, uno::makeAny( m_pImpl->GetThemeTable()->getFontNameForTheme(nIntValue) ));
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ]
972 : 114 : break;
973 : : case NS_ooxml::LN_CT_Spacing_before:
974 [ + - ][ + - ]: 870 : if (m_pImpl->GetTopContext())
[ + - ]
975 [ + - ][ + - ]: 870 : m_pImpl->GetTopContext()->Insert(PROP_PARA_TOP_MARGIN, true, uno::makeAny( ConversionHelper::convertTwipToMM100( nIntValue ) ));
[ + - ][ + - ]
[ + - ]
976 : 870 : break;
977 : : case NS_ooxml::LN_CT_Spacing_beforeLines:
978 : 0 : break;
979 : : case NS_ooxml::LN_CT_Spacing_after:
980 [ + - ][ + - ]: 1005 : if (m_pImpl->GetTopContext())
[ + - ]
981 [ + - ][ + - ]: 1005 : m_pImpl->GetTopContext()->Insert(PROP_PARA_BOTTOM_MARGIN, true, uno::makeAny( ConversionHelper::convertTwipToMM100( nIntValue ) ));
[ + - ][ + - ]
[ + - ]
982 : 1005 : break;
983 : : case NS_ooxml::LN_CT_Spacing_afterLines:
984 : 0 : break;
985 : : case NS_ooxml::LN_CT_Spacing_line: //91434
986 : : case NS_ooxml::LN_CT_Spacing_lineRule: //91435
987 : : {
988 : : #define SINGLE_LINE_SPACING 240
989 : 336 : style::LineSpacing aSpacing;
990 [ + - ]: 336 : PropertyMapPtr pTopContext = m_pImpl->GetTopContext();
991 : 336 : bool bFound = false;
992 : 336 : PropertyMap::iterator aLineSpacingIter;
993 [ + - ]: 336 : if (pTopContext)
994 : : {
995 [ + - ]: 336 : aLineSpacingIter = pTopContext->find(PropertyDefinition( PROP_PARA_LINE_SPACING, true ) );
996 : 336 : bFound = aLineSpacingIter != pTopContext->end();
997 : : }
998 [ + + ]: 336 : if (bFound)
999 : : {
1000 [ + - ]: 168 : aLineSpacingIter->second >>= aSpacing;
1001 : : }
1002 : : else
1003 : : {
1004 : : //default to single line spacing
1005 : 168 : aSpacing.Mode = style::LineSpacingMode::FIX;
1006 [ + - ]: 168 : aSpacing.Height = sal_Int16(ConversionHelper::convertTwipToMM100( SINGLE_LINE_SPACING ));
1007 : : }
1008 [ + + ]: 336 : if( nName == NS_ooxml::LN_CT_Spacing_line )
1009 : : {
1010 : : //now set the value depending on the Mode
1011 [ + + ]: 168 : if( aSpacing.Mode == style::LineSpacingMode::PROP )
1012 : 138 : aSpacing.Height = sal_Int16(sal_Int32(nIntValue) * 100 / SINGLE_LINE_SPACING );
1013 : : else
1014 [ + - ]: 30 : aSpacing.Height = sal_Int16(ConversionHelper::convertTwipToMM100( nIntValue ));
1015 : : }
1016 : : else //NS_ooxml::LN_CT_Spacing_lineRule:
1017 : : {
1018 : : // exactly, atLeast, auto
1019 [ + + ]: 168 : if( sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_wordprocessingml_ST_LineSpacingRule_auto)
1020 : : {
1021 : 138 : aSpacing.Mode = style::LineSpacingMode::PROP;
1022 : : //reinterpret the already set value
1023 [ + - ]: 138 : aSpacing.Height = sal_Int16( aSpacing.Height * 100 / ConversionHelper::convertTwipToMM100( SINGLE_LINE_SPACING ));
1024 : : }
1025 [ + - ]: 30 : else if( sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_wordprocessingml_ST_LineSpacingRule_atLeast)
1026 : 30 : aSpacing.Mode = style::LineSpacingMode::MINIMUM;
1027 : : else // NS_ooxml::LN_Value_wordprocessingml_ST_LineSpacingRule_exact
1028 : 0 : aSpacing.Mode = style::LineSpacingMode::FIX;
1029 : : }
1030 [ + - ]: 336 : if (pTopContext)
1031 [ + - ][ + - ]: 336 : pTopContext->Insert(PROP_PARA_LINE_SPACING, true, uno::makeAny( aSpacing ));
[ + - ]
1032 : : }
1033 : 336 : break;
1034 : : case NS_ooxml::LN_CT_Ind_start:
1035 : : case NS_ooxml::LN_CT_Ind_left:
1036 [ + - ][ + - ]: 24 : if (m_pImpl->GetTopContext())
[ + - ]
1037 : : {
1038 : : // Word inherits FirstLineIndent property of the numbering, even if ParaLeftMargin is set, Writer does not.
1039 : : // So copy it explicitly, if necessary.
1040 [ + - ]: 24 : sal_Int32 nFirstLineIndent = m_pImpl->getCurrentNumberingProperty("FirstLineIndent");
1041 : :
1042 [ + + ]: 24 : if (nFirstLineIndent != 0)
1043 [ + - ][ + - ]: 3 : m_pImpl->GetTopContext()->Insert(PROP_PARA_FIRST_LINE_INDENT, true, uno::makeAny(nFirstLineIndent));
[ + - ][ + - ]
1044 : :
1045 : : m_pImpl->GetTopContext()->Insert(
1046 [ + - ][ + - ]: 24 : PROP_PARA_LEFT_MARGIN, true, uno::makeAny( ConversionHelper::convertTwipToMM100(nIntValue ) ));
[ + - ][ + - ]
[ + - ]
1047 : : }
1048 : 24 : break;
1049 : : case NS_ooxml::LN_CT_Ind_end:
1050 : : case NS_ooxml::LN_CT_Ind_right:
1051 [ + - ][ + - ]: 6 : if (m_pImpl->GetTopContext())
[ + - ]
1052 : : {
1053 : : // Word inherits FirstLineIndent/ParaLeftMargin property of the numbering, even if ParaRightMargin is set, Writer does not.
1054 : : // So copy it explicitly, if necessary.
1055 [ + - ]: 6 : sal_Int32 nFirstLineIndent = m_pImpl->getCurrentNumberingProperty("FirstLineIndent");
1056 [ + - ]: 6 : sal_Int32 nParaLeftMargin = m_pImpl->getCurrentNumberingProperty("IndentAt");
1057 : :
1058 [ + + ]: 6 : if (nFirstLineIndent != 0)
1059 [ + - ][ + - ]: 3 : m_pImpl->GetTopContext()->Insert(PROP_PARA_FIRST_LINE_INDENT, true, uno::makeAny(nFirstLineIndent));
[ + - ][ + - ]
1060 [ + + ]: 6 : if (nParaLeftMargin != 0)
1061 [ + - ][ + - ]: 3 : m_pImpl->GetTopContext()->Insert(PROP_PARA_LEFT_MARGIN, true, uno::makeAny(nParaLeftMargin));
[ + - ][ + - ]
1062 : :
1063 : : m_pImpl->GetTopContext()->Insert(
1064 [ + - ][ + - ]: 6 : PROP_PARA_RIGHT_MARGIN, true, uno::makeAny( ConversionHelper::convertTwipToMM100(nIntValue ) ));
[ + - ][ + - ]
[ + - ]
1065 : : }
1066 : 6 : break;
1067 : : case NS_ooxml::LN_CT_Ind_hanging:
1068 [ + - ][ + - ]: 6 : if (m_pImpl->GetTopContext())
[ + - ]
1069 : : {
1070 [ + - ]: 6 : sal_Int32 nValue = ConversionHelper::convertTwipToMM100( nIntValue );
1071 : : m_pImpl->GetTopContext()->Insert(
1072 [ + - ][ + - ]: 6 : PROP_PARA_FIRST_LINE_INDENT, true, uno::makeAny( - nValue ));
[ + - ][ + - ]
1073 : : }
1074 : 6 : break;
1075 : : case NS_ooxml::LN_CT_Ind_firstLine:
1076 [ + - ][ + - ]: 6 : if (m_pImpl->GetTopContext())
[ + - ]
1077 : : m_pImpl->GetTopContext()->Insert(
1078 [ + - ][ + - ]: 6 : PROP_PARA_FIRST_LINE_INDENT, true, uno::makeAny( ConversionHelper::convertTwipToMM100(nIntValue ) ));
[ + - ][ + - ]
[ + - ]
1079 : 6 : break;
1080 : :
1081 : : case NS_ooxml::LN_CT_EastAsianLayout_id:
1082 : 0 : break;
1083 : : case NS_ooxml::LN_CT_EastAsianLayout_combine:
1084 [ # # ][ # # ]: 0 : if (m_pImpl->GetTopContext())
[ # # ]
1085 [ # # ][ # # ]: 0 : m_pImpl->GetTopContext()->Insert(PROP_CHAR_COMBINE_IS_ON, true, uno::makeAny ( nIntValue ? true : false ));
[ # # ][ # # ]
1086 : 0 : break;
1087 : : case NS_ooxml::LN_CT_EastAsianLayout_combineBrackets:
1088 [ # # ][ # # ]: 0 : if (m_pImpl->GetTopContext())
[ # # ]
1089 : : {
1090 [ # # ]: 0 : OUString sCombinePrefix = getBracketStringFromEnum(nIntValue);
1091 [ # # ]: 0 : OUString sCombineSuffix = getBracketStringFromEnum(nIntValue, false);
1092 [ # # ][ # # ]: 0 : m_pImpl->GetTopContext()->Insert(PROP_CHAR_COMBINE_PREFIX, true, uno::makeAny ( sCombinePrefix ));
[ # # ][ # # ]
1093 [ # # ][ # # ]: 0 : m_pImpl->GetTopContext()->Insert(PROP_CHAR_COMBINE_SUFFIX, true, uno::makeAny ( sCombineSuffix ));
[ # # ][ # # ]
1094 : : }
1095 : 0 : break;
1096 : : case NS_ooxml::LN_CT_EastAsianLayout_vert:
1097 [ # # ][ # # ]: 0 : if (m_pImpl->GetTopContext())
[ # # ]
1098 : : {
1099 [ # # ]: 0 : sal_Int16 nRotationAngle = (nIntValue ? 900 : 0);
1100 [ # # ][ # # ]: 0 : m_pImpl->GetTopContext()->Insert(PROP_CHAR_ROTATION, true, uno::makeAny ( nRotationAngle ));
[ # # ][ # # ]
1101 : : }
1102 : 0 : break;
1103 : : case NS_ooxml::LN_CT_EastAsianLayout_vertCompress:
1104 [ # # ][ # # ]: 0 : if (m_pImpl->GetTopContext())
[ # # ]
1105 [ # # ][ # # ]: 0 : m_pImpl->GetTopContext()->Insert(PROP_CHAR_ROTATION_IS_FIT_TO_LINE, true, uno::makeAny ( nIntValue ? true : false));
[ # # ][ # # ]
1106 : 0 : break;
1107 : :
1108 : : case NS_ooxml::LN_CT_PageSz_code:
1109 : 15 : CT_PageSz.code = nIntValue;
1110 : 15 : break;
1111 : : case NS_ooxml::LN_CT_PageSz_h:
1112 : : {
1113 [ + - ]: 326 : sal_Int32 nHeight = ConversionHelper::convertTwipToMM100(nIntValue);
1114 [ + - ]: 326 : CT_PageSz.h = PaperInfo::sloppyFitPageDimension(nHeight);
1115 : : }
1116 : 326 : break;
1117 : : case NS_ooxml::LN_CT_PageSz_orient:
1118 : 3 : CT_PageSz.orient = (nIntValue != 0);
1119 : 3 : break;
1120 : : case NS_ooxml::LN_CT_PageSz_w:
1121 : : {
1122 [ + - ]: 326 : sal_Int32 nWidth = ConversionHelper::convertTwipToMM100(nIntValue);
1123 [ + - ]: 326 : CT_PageSz.w = PaperInfo::sloppyFitPageDimension(nWidth);
1124 : : }
1125 : 326 : break;
1126 : :
1127 : : case NS_ooxml::LN_CT_PageMar_top:
1128 [ + - ]: 323 : m_pImpl->SetPageMarginTwip( PAGE_MAR_TOP, nIntValue );
1129 : 323 : break;
1130 : : case NS_ooxml::LN_CT_PageMar_right:
1131 [ + - ]: 329 : m_pImpl->SetPageMarginTwip( PAGE_MAR_RIGHT, nIntValue );
1132 : 329 : break;
1133 : : case NS_ooxml::LN_CT_PageMar_bottom:
1134 [ + - ]: 323 : m_pImpl->SetPageMarginTwip( PAGE_MAR_BOTTOM, nIntValue );
1135 : 323 : break;
1136 : : case NS_ooxml::LN_CT_PageMar_left:
1137 [ + - ]: 329 : m_pImpl->SetPageMarginTwip( PAGE_MAR_LEFT, nIntValue );
1138 : 329 : break;
1139 : : case NS_ooxml::LN_CT_PageMar_header:
1140 [ + - ]: 218 : m_pImpl->SetPageMarginTwip( PAGE_MAR_HEADER, nIntValue );
1141 : 218 : break;
1142 : : case NS_ooxml::LN_CT_PageMar_footer:
1143 [ + - ]: 215 : m_pImpl->SetPageMarginTwip( PAGE_MAR_FOOTER, nIntValue );
1144 : 215 : break;
1145 : : case NS_ooxml::LN_CT_PageMar_gutter:
1146 [ + - ]: 209 : m_pImpl->SetPageMarginTwip( PAGE_MAR_GUTTER, nIntValue );
1147 : 209 : break;
1148 : : case NS_ooxml::LN_CT_Language_val: //90314
1149 : : case NS_ooxml::LN_CT_Language_eastAsia: //90315
1150 : : case NS_ooxml::LN_CT_Language_bidi: //90316
1151 : : {
1152 [ + - ]: 784 : LanguageType eLang = MsLangId::convertIsoStringToLanguage( sStringValue );
1153 [ + - ]: 784 : lang::Locale aLocale = MsLangId::convertLanguageToLocale( eLang );
1154 [ + - ][ + - ]: 784 : if (m_pImpl->GetTopContext())
[ + - ]
1155 : : m_pImpl->GetTopContext()->Insert(NS_ooxml::LN_CT_Language_val== nName ? PROP_CHAR_LOCALE :
1156 : : NS_ooxml::LN_CT_Language_eastAsia == nName ? PROP_CHAR_LOCALE_ASIAN : PROP_CHAR_LOCALE_COMPLEX,
1157 : : true,
1158 [ + - ][ + + ]: 784 : uno::makeAny( aLocale ) );
[ + + ][ + - ]
[ + - ][ + - ]
1159 : : }
1160 : 784 : break;
1161 : : #define AUTO_PARA_SPACING sal_Int32(49)
1162 : : case NS_ooxml::LN_CT_Spacing_beforeAutospacing:
1163 : : //TODO: autospacing depends on some document property (called fDontUseHTMLAutoSpacing in old ww8 filter) 100 or 280 twip
1164 : : //and should be set to 0 on start of page
1165 [ # # ][ # # ]: 0 : m_pImpl->GetTopContext()->Insert( PROP_PARA_TOP_MARGIN, false, uno::makeAny( AUTO_PARA_SPACING ) );
[ # # ][ # # ]
1166 : 0 : break;
1167 : : case NS_ooxml::LN_CT_Spacing_afterAutospacing:
1168 : : //TODO: autospacing depends on some document property (called fDontUseHTMLAutoSpacing in old ww8 filter) 100 or 280 twip
1169 [ # # ][ # # ]: 0 : m_pImpl->GetTopContext()->Insert( PROP_PARA_BOTTOM_MARGIN, false, uno::makeAny( AUTO_PARA_SPACING ) );
[ # # ][ # # ]
1170 : 0 : break;
1171 : : case NS_ooxml::LN_CT_SmartTagRun_uri:
1172 : : case NS_ooxml::LN_CT_SmartTagRun_element:
1173 : : //TODO: add handling of SmartTags
1174 : 0 : break;
1175 : : case NS_ooxml::LN_CT_Br_type :
1176 : : //TODO: attributes for break (0x12) are not supported
1177 : 0 : break;
1178 : : case NS_ooxml::LN_CT_Fonts_hint :
1179 : : /* assigns script type to ambigous characters, values can be:
1180 : : NS_ooxml::LN_Value_ST_Hint_default
1181 : : NS_ooxml::LN_Value_ST_Hint_eastAsia
1182 : : NS_ooxml::LN_Value_ST_Hint_cs
1183 : : */
1184 : : //TODO: unsupported?
1185 : 267 : break;
1186 : : case NS_ooxml::LN_CT_TblCellMar_right: // 92375;
1187 : : case NS_ooxml::LN_CT_TblBorders_top: // 92377;
1188 : : case NS_ooxml::LN_CT_TblBorders_left: // 92378;
1189 : : case NS_ooxml::LN_CT_TblBorders_bottom: // 92379;
1190 : : //todo: handle cell mar
1191 : 0 : break;
1192 : : case NS_rtf::LN_blip: // contains the binary graphic
1193 : : case NS_ooxml::LN_shape:
1194 : : {
1195 : : //looks a bit like a hack - and it is. The graphic import is split into the inline_inline part and
1196 : : //afterwards the adding of the binary data.
1197 [ # # ][ # # ]: 0 : m_pImpl->GetGraphicImport( IMPORT_AS_DETECTED_INLINE )->attribute(nName, val);
[ # # ]
1198 [ # # ][ # # ]: 0 : m_pImpl->ImportGraphic( val.getProperties(), IMPORT_AS_DETECTED_INLINE );
[ # # ]
1199 : : }
1200 : 0 : break;
1201 : : case NS_ooxml::LN_starmath:
1202 [ + - ]: 426 : m_pImpl->appendStarMath( val );
1203 : 426 : break;
1204 : : case NS_ooxml::LN_CT_FramePr_dropCap:
1205 : : case NS_ooxml::LN_CT_FramePr_lines:
1206 : : case NS_ooxml::LN_CT_FramePr_hAnchor:
1207 : : case NS_ooxml::LN_CT_FramePr_vAnchor:
1208 : : case NS_ooxml::LN_CT_FramePr_x:
1209 : : case NS_ooxml::LN_CT_FramePr_xAlign:
1210 : : case NS_ooxml::LN_CT_FramePr_y:
1211 : : case NS_ooxml::LN_CT_FramePr_yAlign:
1212 : : case NS_ooxml::LN_CT_FramePr_hRule:
1213 : : case NS_sprm::LN_PWr:
1214 : : case NS_sprm::LN_PDxaWidth:
1215 : : case NS_sprm::LN_PWHeightAbs:
1216 : : case NS_sprm::LN_PDxaFromText:
1217 : : case NS_sprm::LN_PDyaFromText:
1218 : : {
1219 : : ParagraphProperties* pParaProperties = dynamic_cast< ParagraphProperties*>(
1220 [ + - ][ + + ]: 231 : m_pImpl->GetTopContextOfType( CONTEXT_PARAGRAPH ).get() );
[ + - ]
1221 [ + + ]: 231 : if( pParaProperties )
1222 : : {
1223 [ - - + + : 210 : switch( nName )
+ + + + +
- + + - -
- ]
1224 : : {
1225 : : case NS_ooxml::LN_CT_FramePr_dropCap:
1226 : 0 : pParaProperties->SetDropCap( nIntValue );
1227 : 0 : break;
1228 : : case NS_ooxml::LN_CT_FramePr_lines:
1229 : 0 : pParaProperties->SetLines( nIntValue );
1230 : 0 : break;
1231 : : case NS_ooxml::LN_CT_FramePr_hAnchor:
1232 [ - - + - ]: 18 : switch(nIntValue)
1233 : : {
1234 : : case NS_ooxml::LN_Value_wordprocessingml_ST_HAnchor_text: //relative to column
1235 : 0 : nIntValue = text::RelOrientation::FRAME; break;
1236 : 0 : case NS_ooxml::LN_Value_wordprocessingml_ST_HAnchor_margin: nIntValue = text::RelOrientation::PAGE_PRINT_AREA; break;
1237 : 18 : case NS_ooxml::LN_Value_wordprocessingml_ST_HAnchor_page: nIntValue = text::RelOrientation::PAGE_FRAME; break;
1238 : : default:;
1239 : : }
1240 : 18 : pParaProperties->SethAnchor( nIntValue );
1241 : 18 : break;
1242 : : case NS_ooxml::LN_CT_FramePr_vAnchor:
1243 [ - - + - ]: 24 : switch(nIntValue)
1244 : : {
1245 : : case NS_ooxml::LN_Value_wordprocessingml_ST_VAnchor_text: //relative to paragraph
1246 : 0 : nIntValue = text::RelOrientation::FRAME; break;
1247 : 0 : case NS_ooxml::LN_Value_wordprocessingml_ST_VAnchor_margin:nIntValue = text::RelOrientation::PAGE_PRINT_AREA ; break;
1248 : 24 : case NS_ooxml::LN_Value_wordprocessingml_ST_VAnchor_page: nIntValue = text::RelOrientation::PAGE_FRAME; break;
1249 : : default:;
1250 : : }
1251 : 24 : pParaProperties->SetvAnchor( nIntValue );
1252 : 24 : break;
1253 : : case NS_ooxml::LN_CT_FramePr_x:
1254 [ + - ]: 24 : pParaProperties->Setx( ConversionHelper::convertTwipToMM100(nIntValue ));
1255 : 24 : break;
1256 : : case NS_ooxml::LN_CT_FramePr_xAlign:
1257 [ - - - - : 24 : switch( nIntValue )
- + ]
1258 : : {
1259 : 0 : case NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_center : nIntValue = text::HoriOrientation::CENTER; break;
1260 : 0 : case NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_right : nIntValue = text::HoriOrientation::RIGHT; break;
1261 : 0 : case NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_inside : nIntValue = text::HoriOrientation::INSIDE; break;
1262 : 0 : case NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_outside : nIntValue = text::HoriOrientation::OUTSIDE; break;
1263 : 0 : case NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_left : nIntValue = text::HoriOrientation::LEFT; break;
1264 : 24 : default: nIntValue = text::HoriOrientation::NONE;
1265 : : }
1266 : 24 : pParaProperties->SetxAlign( nIntValue );
1267 : 24 : break;
1268 : : case NS_ooxml::LN_CT_FramePr_y:
1269 [ + - ]: 24 : pParaProperties->Sety( ConversionHelper::convertTwipToMM100(nIntValue ));
1270 : 24 : break;
1271 : : case NS_ooxml::LN_CT_FramePr_yAlign:
1272 [ - - - + ]: 24 : switch( nIntValue )
1273 : : {
1274 : : case NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_top :
1275 : 0 : case NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_inside :nIntValue = text::VertOrientation::TOP; break;
1276 : 0 : case NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_center :nIntValue = text::VertOrientation::CENTER;break;
1277 : : case NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_bottom :
1278 : 0 : case NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_outside :nIntValue = text::VertOrientation::BOTTOM;break;
1279 : : case NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_inline ://todo: what to do with inline - no avail. in WW97 and WW2007
1280 : : //no break;
1281 : 24 : default:nIntValue = text::VertOrientation::NONE;
1282 : : }
1283 : 24 : pParaProperties->SetyAlign( nIntValue );
1284 : 24 : break;
1285 : : case NS_ooxml::LN_CT_FramePr_hRule:
1286 [ + - - ]: 24 : switch( nIntValue )
1287 : : {
1288 : : case NS_ooxml::LN_Value_wordprocessingml_ST_HeightRule_exact:
1289 : 24 : nIntValue = text::SizeType::FIX;
1290 : 24 : break;
1291 : : case NS_ooxml::LN_Value_wordprocessingml_ST_HeightRule_atLeast:
1292 : 0 : nIntValue = text::SizeType::MIN;
1293 : 0 : break;
1294 : : case NS_ooxml::LN_Value_wordprocessingml_ST_HeightRule_auto:
1295 : : //no break;
1296 : : default:;
1297 : 0 : nIntValue = text::SizeType::VARIABLE;
1298 : : }
1299 : 24 : pParaProperties->SethRule( nIntValue );
1300 : 24 : break;
1301 : : case NS_sprm::LN_PWr:
1302 : : {
1303 : : //should be either LN_Value_wordprocessingml_ST_Wrap_notBeside or LN_Value_wordprocessingml_ST_Wrap_around
1304 : : OSL_ENSURE( sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_wordprocessingml_ST_Wrap_around ||
1305 : : sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_wordprocessingml_ST_Wrap_notBeside,
1306 : : "wrap not around or not_Beside?");
1307 : 0 : pParaProperties->SetWrap(sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_wordprocessingml_ST_Wrap_around ?
1308 [ # # ]: 0 : text::WrapTextMode_DYNAMIC : text::WrapTextMode_NONE );
1309 : : }
1310 : 0 : break;
1311 : : case NS_sprm::LN_PDxaWidth:
1312 [ + - ]: 24 : pParaProperties->Setw(ConversionHelper::convertTwipToMM100(nIntValue));
1313 : 24 : break;
1314 : : case NS_sprm::LN_PWHeightAbs:
1315 [ + - ]: 24 : pParaProperties->Seth(ConversionHelper::convertTwipToMM100(nIntValue));
1316 : 24 : break;
1317 : : case NS_sprm::LN_PDxaFromText:
1318 [ # # ]: 0 : pParaProperties->SethSpace( ConversionHelper::convertTwipToMM100(nIntValue ));
1319 : 0 : break;
1320 : : case NS_sprm::LN_PDyaFromText:
1321 [ # # ]: 0 : pParaProperties->SetvSpace( ConversionHelper::convertTwipToMM100(nIntValue ));
1322 : 210 : break;
1323 : : default:;
1324 : : }
1325 : : }
1326 : : else
1327 : : {
1328 : : //TODO: how to handle frame properties at styles
1329 : : }
1330 : : }
1331 : 231 : break;
1332 : : case NS_ooxml::LN_CT_LineNumber_start:
1333 : : case NS_ooxml::LN_CT_LineNumber_distance:
1334 : : case NS_ooxml::LN_CT_TrackChange_author:
1335 [ + - ]: 12 : m_pImpl->SetCurrentRedlineAuthor( sStringValue );
1336 : 12 : break;
1337 : : case NS_ooxml::LN_CT_TrackChange_date:
1338 [ + - ]: 12 : m_pImpl->SetCurrentRedlineDate( sStringValue );
1339 : 12 : break;
1340 : : case NS_ooxml::LN_CT_Markup_id:
1341 [ + - ]: 12 : m_pImpl->SetCurrentRedlineId( nIntValue );
1342 : 12 : break;
1343 : : case NS_ooxml::LN_EG_RangeMarkupElements_commentRangeStart:
1344 [ + - ]: 12 : m_pImpl->AddAnnotationPosition(true);
1345 : 12 : break;
1346 : : case NS_ooxml::LN_EG_RangeMarkupElements_commentRangeEnd:
1347 [ + - ]: 12 : m_pImpl->AddAnnotationPosition(false);
1348 : 12 : break;
1349 : : case NS_ooxml::LN_CT_Comment_initials:
1350 [ + - ]: 12 : m_pImpl->SetCurrentRedlineInitials(sStringValue);
1351 : 12 : break;
1352 : : case NS_ooxml::LN_token:
1353 [ # # ]: 0 : m_pImpl->SetCurrentRedlineToken( nIntValue );
1354 : 0 : break;
1355 : : case NS_ooxml::LN_CT_LineNumber_countBy:
1356 : : case NS_ooxml::LN_CT_LineNumber_restart:
1357 : : {
1358 : : //line numbering in Writer is a global document setting
1359 : : //in Word is a section setting
1360 : : //if line numbering is switched on anywhere in the document it's set at the global settings
1361 : 0 : LineNumberSettings aSettings = m_pImpl->GetLineNumberSettings();
1362 [ # # # # : 0 : switch( nName )
# ]
1363 : : {
1364 : : case NS_ooxml::LN_CT_LineNumber_countBy:
1365 : 0 : aSettings.nInterval = nIntValue;
1366 : 0 : break;
1367 : : case NS_ooxml::LN_CT_LineNumber_start:
1368 : 0 : aSettings.nStartValue = nIntValue; // todo: has to be set at (each) first paragraph
1369 : 0 : break;
1370 : : case NS_ooxml::LN_CT_LineNumber_distance:
1371 [ # # ]: 0 : aSettings.nDistance = ConversionHelper::convertTwipToMM100( nIntValue );
1372 : 0 : break;
1373 : : case NS_ooxml::LN_CT_LineNumber_restart:
1374 : : //page:empty, probably 0,section:1,continuous:2;
1375 : 0 : aSettings.bRestartAtEachPage = nIntValue < 1;
1376 : 0 : break;
1377 : : default:;
1378 : : }
1379 : 0 : m_pImpl->SetLineNumberSettings( aSettings );
1380 : : }
1381 : 0 : break;
1382 : : case NS_ooxml::LN_CT_FtnEdnRef_customMarkFollows:
1383 : 0 : m_pImpl->SetCustomFtnMark( true );
1384 : 0 : break;
1385 : : case NS_ooxml::LN_CT_FtnEdnRef_id:
1386 : : // footnote or endnote reference id - not needed
1387 : : case NS_ooxml::LN_CT_Color_themeColor:
1388 : : case NS_ooxml::LN_CT_Color_themeTint:
1389 : : case NS_ooxml::LN_CT_Color_themeShade:
1390 : : //unsupported
1391 : 90 : break;
1392 : : case NS_ooxml::LN_endtrackchange:
1393 [ # # ]: 0 : m_pImpl->RemoveCurrentRedline( );
1394 : 0 : break;
1395 : : case NS_ooxml::LN_CT_DocGrid_linePitch:
1396 : : {
1397 : : //see SwWW8ImplReader::SetDocumentGrid
1398 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
1399 [ + - ]: 179 : if(pSectionContext)
1400 : : {
1401 [ + - ]: 179 : pSectionContext->SetGridLinePitch( ConversionHelper::convertTwipToMM100( nIntValue ) );
1402 : : }
1403 : : }
1404 : 179 : break;
1405 : : case NS_ooxml::LN_CT_DocGrid_charSpace:
1406 : : {
1407 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
1408 [ + - ]: 87 : if(pSectionContext)
1409 : : {
1410 : 87 : pSectionContext->SetDxtCharSpace( nIntValue );
1411 : : }
1412 : : }
1413 : 87 : break;
1414 : : case NS_ooxml::LN_CT_DocGrid_type:
1415 : : {
1416 [ + - ]: 87 : if (pSectionContext != NULL)
1417 : : {
1418 : 87 : pSectionContext->SetGridType(nIntValue);
1419 : : }
1420 : : }
1421 : 87 : break;
1422 : : default:
1423 : : {
1424 : : #if OSL_DEBUG_LEVEL > 0
1425 : : OString sMessage("DomainMapper::attribute() - Id: ");
1426 : : sMessage += OString::valueOf( sal_Int32( nName ), 10 );
1427 : : sMessage += " / 0x";
1428 : : sMessage += OString::valueOf( sal_Int32( nName ), 16 );
1429 : : sMessage += " value: ";
1430 : : sMessage += OString::valueOf( sal_Int32( nIntValue ), 10 );
1431 : : sMessage += " / 0x";
1432 : : sMessage += OString::valueOf( sal_Int32( nIntValue ), 16 );
1433 : : SAL_WARN("writerfilter", sMessage.getStr());
1434 : : #endif
1435 : : }
1436 : : }
1437 : 11894 : }
1438 : 11894 : }
1439 : :
1440 : 60126 : void DomainMapper::lcl_sprm(Sprm & rSprm)
1441 : : {
1442 [ + + ]: 60126 : if( !m_pImpl->getTableManager().sprm(rSprm))
1443 [ + - ]: 56328 : sprmWithProps( rSprm, m_pImpl->GetTopContext() );
1444 : 60126 : }
1445 : :
1446 : 61121 : void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmType )
1447 : : {
1448 : : OSL_ENSURE(rContext.get(), "PropertyMap has to be valid!");
1449 [ + - ]: 61121 : if(!rContext.get())
1450 : 61121 : return ;
1451 : :
1452 [ + - ]: 61121 : sal_uInt32 nSprmId = rSprm.getId();
1453 : : //needed for page properties
1454 [ + - ]: 61121 : SectionPropertyMap * pSectionContext = m_pImpl->GetSectionContext();
1455 : :
1456 : : //TODO: In rtl-paragraphs the meaning of left/right are to be exchanged
1457 : 61121 : bool bExchangeLeftRight = false;
1458 [ + - ][ + - ]: 61121 : Value::Pointer_t pValue = rSprm.getValue();
1459 [ + - ]: 61121 : sal_Int32 nIntValue = pValue->getInt();
1460 [ + - ]: 61121 : OUString sStringValue = pValue->getString();
1461 [ + - ]: 61121 : PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
1462 : :
1463 [ + + + + : 61121 : switch(nSprmId)
+ + + - +
+ - - - +
+ + + + +
+ + - - -
- - + + -
+ + - + +
+ - - - -
+ - - - -
- - + + -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- + - - -
+ + - + +
- + + + +
+ + + + -
- + + + -
- + + + +
+ ]
1464 : : {
1465 : : case 2: // sprmPIstd
1466 : : case 0x4600:
1467 : : break; // sprmPIstd - style code
1468 : : case 3: // "sprmPIstdPermute
1469 : : case NS_sprm::LN_PIstdPermute:
1470 : : break; // sprmPIstdPermute
1471 : : case NS_sprm::LN_PIncLvl:
1472 : : break; // sprmPIncLvl
1473 : : case NS_sprm::LN_PJcExtra: // sprmPJc Asian (undocumented)
1474 : : case NS_sprm::LN_PJc: // sprmPJc
1475 [ + - ][ + - ]: 501 : handleParaJustification(nIntValue, rContext, bExchangeLeftRight);
[ + - ]
1476 : : break;
1477 : : case NS_sprm::LN_PFSideBySide:
1478 : : break; // sprmPFSideBySide
1479 : :
1480 : : case NS_sprm::LN_PFKeep: // sprmPFKeep
1481 [ + - ][ + - ]: 45 : rContext->Insert(PROP_PARA_SPLIT, true, uno::makeAny(nIntValue ? false : true));
1482 : : break;
1483 : : case NS_sprm::LN_PFKeepFollow: // sprmPFKeepFollow
1484 [ + - ][ + - ]: 249 : rContext->Insert(PROP_PARA_KEEP_TOGETHER, true, uno::makeAny( nIntValue ? true : false) );
1485 : : break;
1486 : : case NS_sprm::LN_PFPageBreakBefore:
1487 [ + - ][ + - ]: 3 : rContext->Insert(PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_PAGE_BEFORE ) );
1488 : : break; // sprmPFPageBreakBefore
1489 : : case NS_sprm::LN_PBrcl:
1490 : : break; // sprmPBrcl
1491 : : case NS_sprm::LN_PBrcp:
1492 : : break; // sprmPBrcp
1493 : : case NS_sprm::LN_PIlvl: // sprmPIlvl
1494 : : //todo: Numbering level will be implemented in the near future (OOo 3.0?)
1495 [ + + ]: 93 : if( m_pImpl->IsStyleSheetImport() )
1496 : : {
1497 : : //style sheets cannot have a numbering rule attached
1498 [ - + ]: 30 : StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() );
1499 : 30 : pStyleSheetPropertyMap->SetListLevel( (sal_Int16)nIntValue );
1500 : : }
1501 : : else
1502 [ + - ][ + - ]: 63 : rContext->Insert( PROP_NUMBERING_LEVEL, true, uno::makeAny( (sal_Int16)nIntValue ));
1503 : : break;
1504 : : case NS_sprm::LN_PIlfo: // sprmPIlfo
1505 : : {
1506 : : //convert the ListTable entry to a NumberingRules propery and apply it
1507 [ + - ]: 114 : ListsManager::Pointer pListTable = m_pImpl->GetListTable();
1508 [ + - ]: 114 : ListDef::Pointer pList = pListTable->GetList( nIntValue );
1509 [ + + ]: 114 : if( m_pImpl->IsStyleSheetImport() )
1510 : : {
1511 : : //style sheets cannot have a numbering rule attached
1512 [ - + ]: 36 : StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() );
1513 : 36 : pStyleSheetPropertyMap->SetListId( nIntValue );
1514 : : }
1515 [ + + ]: 114 : if( pList.get( ) )
1516 : : {
1517 [ + - ]: 78 : if( !m_pImpl->IsStyleSheetImport() )
1518 : : {
1519 [ + - ][ + - ]: 78 : uno::Any aRules = uno::makeAny( pList->GetNumberingRules( ) );
1520 [ + - ]: 78 : rContext->Insert( PROP_NUMBERING_RULES, true, aRules );
1521 : : // erase numbering from pStyle if already set
1522 [ + - ]: 78 : rContext->erase( PropertyDefinition( PROP_NUMBERING_STYLE_NAME, true ));
1523 : : }
1524 : : }
1525 [ - + ]: 36 : else if ( !m_pImpl->IsStyleSheetImport( ) )
1526 [ # # ][ # # ]: 114 : rContext->Insert( PROP_NUMBERING_STYLE_NAME, true, uno::makeAny( OUString() ) );
[ + - ][ + - ]
1527 : : }
1528 : : break;
1529 : : case NS_sprm::LN_PFNoLineNumb: // sprmPFNoLineNumb
1530 [ + - ][ + - ]: 228 : rContext->Insert(PROP_PARA_LINE_NUMBER_COUNT, true, uno::makeAny( nIntValue ? false : true) );
1531 : : break;
1532 : : case NS_sprm::LN_PChgTabsPapx: // sprmPChgTabsPapx
1533 : : {
1534 : : // Initialize tab stop vector from style sheet
1535 [ # # ]: 0 : uno::Any aValue = m_pImpl->GetPropertyFromStyleSheet(PROP_PARA_TAB_STOPS);
1536 [ # # ]: 0 : uno::Sequence< style::TabStop > aStyleTabStops;
1537 [ # # ][ # # ]: 0 : if(aValue >>= aStyleTabStops)
1538 : : {
1539 [ # # ]: 0 : m_pImpl->InitTabStopFromStyle( aStyleTabStops );
1540 : : }
1541 : :
1542 : : //create a new tab stop property - this is done with the contained properties
1543 [ # # ]: 0 : resolveSprmProps(*this, rSprm);
1544 : : //add this property
1545 [ # # ][ # # ]: 0 : rContext->Insert(PROP_PARA_TAB_STOPS, true, uno::makeAny( m_pImpl->GetCurrentTabStopAndClear()));
[ # # ][ # # ]
[ # # ]
1546 : : }
1547 : : break;
1548 : : case 0x845d: //right margin Asian - undocumented
1549 : : case 0x845e: //left margin Asian - undocumented
1550 : : case 16: // sprmPDxaRight - right margin
1551 : : case NS_sprm::LN_PDxaRight: // sprmPDxaRight - right margin
1552 : : case 17:
1553 : : case NS_sprm::LN_PDxaLeft: // sprmPDxaLeft
1554 [ + + ][ + - ]: 1884 : if( NS_sprm::LN_PDxaLeft == nSprmId || 0x17 == nSprmId|| (bExchangeLeftRight && nSprmId == 0x845d) || ( !bExchangeLeftRight && nSprmId == 0x845e))
[ - + ][ # # ]
[ + - ][ + + ]
1555 : : rContext->Insert(
1556 : : eSprmType == SPRM_DEFAULT ? PROP_PARA_LEFT_MARGIN : PROP_LEFT_MARGIN,
1557 : : true,
1558 [ + - ][ + - ]: 1014 : uno::makeAny( ConversionHelper::convertTwipToMM100( nIntValue ) ));
[ + - ][ + - ]
1559 [ + - ]: 870 : else if(eSprmType == SPRM_DEFAULT)
1560 : : rContext->Insert(
1561 : : PROP_PARA_RIGHT_MARGIN, true,
1562 [ + - ][ + - ]: 1884 : uno::makeAny( ConversionHelper::convertTwipToMM100(nIntValue ) ));
[ + - ]
1563 : : //TODO: what happens to the right margins in numberings?
1564 : : break;
1565 : : case 18: // sprmPNest
1566 : : case NS_sprm::LN_PNest: // sprmPNest
1567 : : //not handled in the old WW8 filter
1568 : : break;
1569 : : case NS_sprm::LN_PDxaLeft1: // sprmPDxaLeft1
1570 : : case 19:
1571 : : case NS_sprm::LN_PDxaLeft180: // sprmPDxaLeft180
1572 : : rContext->Insert(
1573 : : eSprmType == SPRM_DEFAULT ? PROP_PARA_FIRST_LINE_INDENT : PROP_FIRST_LINE_OFFSET,
1574 : : true,
1575 [ + - ][ + - ]: 582 : uno::makeAny( ConversionHelper::convertTwipToMM100(nIntValue ) ));
[ + - ][ + - ]
1576 : : break;
1577 : : case 20 : // sprmPDyaLine
1578 : : case NS_sprm::LN_PDyaLine: // sprmPDyaLine
1579 : : {
1580 : 0 : style::LineSpacing aSpacing;
1581 : 0 : sal_Int16 nDistance = sal_Int16(nIntValue & 0xffff);
1582 [ # # ]: 0 : if(nIntValue & 0xffff0000)
1583 : : {
1584 : : // single line in Writer is 100, in Word it is 240
1585 : 0 : aSpacing.Mode = style::LineSpacingMode::PROP;
1586 : 0 : aSpacing.Height = sal_Int16(sal_Int32(nDistance) * 100 /240);
1587 : : }
1588 : : else
1589 : : {
1590 [ # # ]: 0 : if(nDistance < 0)
1591 : : {
1592 : 0 : aSpacing.Mode = style::LineSpacingMode::FIX;
1593 [ # # ]: 0 : aSpacing.Height = sal_Int16(ConversionHelper::convertTwipToMM100(-nDistance));
1594 : : }
1595 [ # # ]: 0 : else if(nDistance >0)
1596 : : {
1597 : 0 : aSpacing.Mode = style::LineSpacingMode::MINIMUM;
1598 [ # # ]: 0 : aSpacing.Height = sal_Int16(ConversionHelper::convertTwipToMM100(nDistance));
1599 : : }
1600 : : }
1601 [ # # ][ # # ]: 0 : rContext->Insert(PROP_PARA_LINE_SPACING, true, uno::makeAny( aSpacing ));
1602 : : }
1603 : : break;
1604 : : case 21 : // legacy version
1605 : : case NS_sprm::LN_PDyaBefore: // sprmPDyaBefore
1606 [ # # ][ # # ]: 0 : rContext->Insert(PROP_PARA_TOP_MARGIN, true, uno::makeAny( ConversionHelper::convertTwipToMM100( nIntValue ) ));
[ # # ]
1607 : : break;
1608 : : case 22 :
1609 : : case NS_sprm::LN_PDyaAfter: // sprmPDyaAfter
1610 [ # # ][ # # ]: 0 : rContext->Insert(PROP_PARA_BOTTOM_MARGIN, true, uno::makeAny( ConversionHelper::convertTwipToMM100( nIntValue ) ));
[ # # ]
1611 : : break;
1612 : :
1613 : : case 23: //sprmPChgTabs
1614 : : case NS_sprm::LN_PChgTabs: // sprmPChgTabs
1615 : : OSL_FAIL( "unhandled");
1616 : : //tabs of list level?
1617 : : break;
1618 : : case 24: // "sprmPFInTable"
1619 : : case NS_sprm::LN_PFInTable:
1620 : : break; // sprmPFInTable
1621 : : case NS_sprm::LN_PTableDepth: //sprmPTableDepth
1622 : : //not handled via sprm but via text( 0x07 )
1623 : : break;
1624 : : case 25: // "sprmPTtp" pap.fTtp
1625 : : case NS_sprm::LN_PFTtp: // sprmPFTtp was: Read_TabRowEnd
1626 : : break;
1627 : : case 26: // "sprmPDxaAbs
1628 : : case NS_sprm::LN_PDxaAbs:
1629 : : break; // sprmPDxaAbs
1630 : : case 27: //sprmPDyaAbs
1631 : : case NS_sprm::LN_PDyaAbs:
1632 : : break; // sprmPDyaAbs
1633 : : case NS_sprm::LN_PDxaWidth:
1634 : : break; // sprmPDxaWidth
1635 : : case NS_sprm::LN_PPc:
1636 : : break; // sprmPPc
1637 : : case NS_sprm::LN_PBrcTop10:
1638 : : break; // sprmPBrcTop10
1639 : : case NS_sprm::LN_PBrcLeft10:
1640 : : break; // sprmPBrcLeft10
1641 : : case NS_sprm::LN_PBrcBottom10:
1642 : : break; // sprmPBrcBottom10
1643 : : case NS_sprm::LN_PBrcRight10:
1644 : : break; // sprmPBrcRight10
1645 : : case NS_sprm::LN_PBrcBetween10:
1646 : : break; // sprmPBrcBetween10
1647 : : case NS_sprm::LN_PBrcBar10:
1648 : : break; // sprmPBrcBar10
1649 : : case NS_sprm::LN_PDxaFromText10:
1650 : : break; // sprmPDxaFromText10
1651 : : case NS_sprm::LN_PWr:
1652 : : break; // sprmPWr
1653 : :
1654 : : case NS_ooxml::LN_CT_PrBase_pBdr: //paragraph border
1655 [ + - ]: 9 : resolveSprmProps(*this, rSprm);
1656 : : break;
1657 : : case NS_sprm::LN_PBrcTop: // sprmPBrcTop
1658 : : case NS_sprm::LN_PBrcLeft: // sprmPBrcLeft
1659 : : case NS_sprm::LN_PBrcBottom: // sprmPBrcBottom
1660 : : case NS_sprm::LN_PBrcRight: // sprmPBrcRight
1661 : : case NS_sprm::LN_PBrcBetween: // sprmPBrcBetween
1662 : : {
1663 : : //in binary format the borders are directly provided in OOXML they are inside of properties
1664 [ + - ][ + + ]: 24 : if( IsOOXMLImport() || IsRTFImport() )
[ + - ][ + - ]
[ + - ]
1665 : : {
1666 [ + - ]: 24 : writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
1667 [ + - ]: 24 : if( pProperties.get())
1668 : : {
1669 [ + - ][ + - ]: 24 : BorderHandlerPtr pBorderHandler( new BorderHandler( true ) );
[ + - ]
1670 [ + - ]: 24 : pProperties->resolve(*pBorderHandler);
1671 : 24 : PropertyIds eBorderId = PropertyIds( 0 );
1672 : 24 : PropertyIds eBorderDistId = PropertyIds( 0 );
1673 [ + + + + : 24 : switch( nSprmId )
- - ]
1674 : : {
1675 : : case NS_sprm::LN_PBrcTop:
1676 : 9 : eBorderId = PROP_TOP_BORDER;
1677 : 9 : eBorderDistId = PROP_TOP_BORDER_DISTANCE;
1678 : 9 : break;
1679 : : case NS_sprm::LN_PBrcLeft:
1680 : 3 : eBorderId = PROP_LEFT_BORDER;
1681 : 3 : eBorderDistId = PROP_LEFT_BORDER_DISTANCE;
1682 : 3 : break;
1683 : : case NS_sprm::LN_PBrcBottom:
1684 : 9 : eBorderId = PROP_BOTTOM_BORDER ;
1685 : 9 : eBorderDistId = PROP_BOTTOM_BORDER_DISTANCE;
1686 : 9 : break;
1687 : : case NS_sprm::LN_PBrcRight:
1688 : 3 : eBorderId = PROP_RIGHT_BORDER;
1689 : 3 : eBorderDistId = PROP_RIGHT_BORDER_DISTANCE ;
1690 : 3 : break;
1691 : : case NS_sprm::LN_PBrcBetween:
1692 : : //not supported
1693 : 0 : break;
1694 : : default:;
1695 : : }
1696 [ + - ]: 24 : if( eBorderId )
1697 [ + - ][ + - ]: 24 : rContext->Insert( eBorderId, true, uno::makeAny( pBorderHandler->getBorderLine()) , true);
[ + - ]
1698 [ + - ]: 24 : if(eBorderDistId)
1699 [ + - ][ + - ]: 24 : rContext->Insert(eBorderDistId, true, uno::makeAny( pBorderHandler->getLineDistance()), true);
[ + - ]
1700 [ + - ]: 24 : }
1701 : : }
1702 : : else
1703 : : {
1704 : 0 : table::BorderLine2 aBorderLine;
1705 [ # # ]: 0 : sal_Int32 nLineDistance = ConversionHelper::MakeBorderLine( nIntValue, aBorderLine );
1706 : 0 : PropertyIds eBorderId = PROP_LEFT_BORDER;
1707 : 0 : PropertyIds eBorderDistId = PROP_LEFT_BORDER_DISTANCE ;
1708 [ # # # # : 0 : switch( nSprmId )
# ]
1709 : : {
1710 : : case NS_sprm::LN_PBrcBetween: // sprmPBrcBetween
1711 : : OSL_FAIL( "TODO: inner border is not handled");
1712 : 0 : break;
1713 : : case NS_sprm::LN_PBrcLeft: // sprmPBrcLeft
1714 : 0 : eBorderId = PROP_LEFT_BORDER;
1715 : 0 : eBorderDistId = PROP_LEFT_BORDER_DISTANCE ;
1716 : 0 : break;
1717 : : case NS_sprm::LN_PBrcRight: // sprmPBrcRight
1718 : 0 : eBorderId = PROP_RIGHT_BORDER ;
1719 : 0 : eBorderDistId = PROP_RIGHT_BORDER_DISTANCE ;
1720 : 0 : break;
1721 : : case NS_sprm::LN_PBrcTop: // sprmPBrcTop
1722 : 0 : eBorderId = PROP_TOP_BORDER ;
1723 : 0 : eBorderDistId = PROP_TOP_BORDER_DISTANCE;
1724 : 0 : break;
1725 : : case NS_sprm::LN_PBrcBottom: // sprmPBrcBottom
1726 : : default:
1727 : 0 : eBorderId = PROP_BOTTOM_BORDER ;
1728 : 0 : eBorderDistId = PROP_BOTTOM_BORDER_DISTANCE;
1729 : : }
1730 [ # # ][ # # ]: 0 : rContext->Insert(eBorderId, true, uno::makeAny( aBorderLine ));
1731 [ # # ][ # # ]: 0 : rContext->Insert(eBorderDistId, true, uno::makeAny( nLineDistance ));
1732 : : }
1733 : : }
1734 : : break;
1735 : : case NS_sprm::LN_PBorderTop:
1736 : : case NS_sprm::LN_PBorderLeft:
1737 : : case NS_sprm::LN_PBorderBottom:
1738 : : case NS_sprm::LN_PBorderRight:
1739 : : OSL_FAIL( "TODO: border color definition");
1740 : : break;
1741 : : case NS_sprm::LN_PBrcBar:
1742 : : break; // sprmPBrcBar
1743 : : case NS_sprm::LN_PFNoAutoHyph: // sprmPFNoAutoHyph
1744 [ + - ][ + - ]: 117 : rContext->Insert(PROP_PARA_IS_HYPHENATION, true, uno::makeAny( nIntValue ? false : true ));
1745 : : break;
1746 : : case NS_sprm::LN_PWHeightAbs:
1747 : : break; // sprmPWHeightAbs
1748 : : case NS_sprm::LN_PDcs:
1749 : : break; // sprmPDcs
1750 : :
1751 : : case NS_sprm::LN_PShd: // sprmPShd
1752 : : {
1753 : : //contains fore color, back color and shadow percentage, results in a brush
1754 [ + - ]: 3 : writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
1755 [ + - ]: 3 : if( pProperties.get())
1756 : : {
1757 [ + - ][ + - ]: 3 : CellColorHandlerPtr pCellColorHandler( new CellColorHandler );
[ + - ]
1758 : 3 : pCellColorHandler->setOutputFormat( CellColorHandler::Paragraph );
1759 [ + - ]: 3 : pProperties->resolve(*pCellColorHandler);
1760 [ + - ][ + - ]: 3 : rContext->insert( pCellColorHandler->getProperties(), true );
[ + - ][ + - ]
[ + - ][ + - ]
1761 [ + - ]: 3 : }
1762 : : }
1763 : : break;
1764 : : case NS_sprm::LN_PDyaFromText:
1765 : : break; // sprmPDyaFromText
1766 : : case NS_sprm::LN_PDxaFromText:
1767 : : break; // sprmPDxaFromText
1768 : : case NS_sprm::LN_PFLocked:
1769 : : break; // sprmPFLocked
1770 : : case NS_sprm::LN_PFWidowControl:
1771 : : case NS_ooxml::LN_CT_PPrBase_widowControl:
1772 : : {
1773 [ + + ][ + - ]: 783 : uno::Any aVal( uno::makeAny( sal_Int8(nIntValue ? 2 : 0 )));
1774 [ + - ]: 783 : rContext->Insert( PROP_PARA_WIDOWS, true, aVal );
1775 [ + - ]: 783 : rContext->Insert( PROP_PARA_ORPHANS, true, aVal );
1776 : : }
1777 : : break; // sprmPFWidowControl
1778 : : case NS_sprm::LN_PRuler:
1779 : : break; // sprmPRuler
1780 : : case NS_sprm::LN_PFKinsoku:
1781 : : break; // sprmPFKinsoku
1782 : : case NS_sprm::LN_PFWordWrap:
1783 : : break; // sprmPFWordWrap
1784 : : case NS_sprm::LN_PFOverflowPunct: ; // sprmPFOverflowPunct - hanging punctuation
1785 [ + - ][ + - ]: 12 : rContext->Insert(PROP_PARA_IS_HANGING_PUNCTUATION, true, uno::makeAny( nIntValue ? false : true ));
1786 : : break;
1787 : : case NS_sprm::LN_PFTopLinePunct:
1788 : : break; // sprmPFTopLinePunct
1789 : : case NS_sprm::LN_PFAutoSpaceDE:
1790 : : break; // sprmPFAutoSpaceDE
1791 : : case NS_sprm::LN_PFAutoSpaceDN:
1792 : : break; // sprmPFAutoSpaceDN
1793 : : case NS_sprm::LN_PWAlignFont:
1794 : : {
1795 : 438 : sal_Int16 nAlignment = 0;
1796 [ - - - - : 438 : switch (nIntValue)
+ ]
1797 : : {
1798 : : case NS_ooxml::LN_Value_wordprocessingml_ST_TextAlignment_top:
1799 : 0 : nAlignment = 2;
1800 : 0 : break;
1801 : : case NS_ooxml::LN_Value_wordprocessingml_ST_TextAlignment_center:
1802 : 0 : nAlignment = 3;
1803 : 0 : break;
1804 : : case NS_ooxml::LN_Value_wordprocessingml_ST_TextAlignment_baseline:
1805 : 0 : nAlignment = 1;
1806 : 0 : break;
1807 : : case NS_ooxml::LN_Value_wordprocessingml_ST_TextAlignment_bottom:
1808 : 0 : nAlignment = 4;
1809 : 0 : break;
1810 : : case NS_ooxml::LN_Value_wordprocessingml_ST_TextAlignment_auto:
1811 : : default:
1812 : 438 : break;
1813 : : }
1814 [ + - ][ + - ]: 438 : rContext->Insert( PROP_PARA_VERT_ALIGNMENT, true, uno::makeAny( nAlignment) );
1815 : : }
1816 : : break; // sprmPWAlignFont
1817 : : case NS_sprm::LN_PFrameTextFlow:
1818 : : break; // sprmPFrameTextFlow
1819 : : case NS_sprm::LN_PISnapBaseLine:
1820 : : break; // sprmPISnapBaseLine
1821 : : case NS_sprm::LN_PAnld:
1822 : : break; // sprmPAnld
1823 : : case NS_sprm::LN_PPropRMark:
1824 : : break; // sprmPPropRMark
1825 : : case NS_sprm::LN_POutLvl:
1826 : : {
1827 [ + - ]: 51 : if( m_pImpl->IsStyleSheetImport() )
1828 : : {
1829 : 51 : sal_Int16 nLvl = static_cast< sal_Int16 >( nIntValue );
1830 : :
1831 [ - + ]: 51 : StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() );
1832 : 51 : pStyleSheetPropertyMap->SetOutlineLevel( nLvl );
1833 : : }
1834 : : }
1835 : : break; // sprmPOutLvl
1836 : : case NS_sprm::LN_PFBiDi:
1837 : : {
1838 [ # # ]: 0 : if (nIntValue != 0)
1839 : : {
1840 [ # # ][ # # ]: 0 : rContext->Insert(PROP_WRITING_MODE, false, uno::makeAny( text::WritingMode2::RL_TB ));
1841 [ # # ][ # # ]: 0 : rContext->Insert(PROP_PARA_ADJUST, false, uno::makeAny( style::ParagraphAdjust_RIGHT ));
1842 : : }
1843 : : }
1844 : :
1845 : : break; // sprmPFBiDi
1846 : : case NS_ooxml::LN_EG_SectPrContents_bidi:
1847 [ # # ]: 0 : if (pSectionContext != NULL)
1848 [ # # ][ # # ]: 0 : pSectionContext->Insert(PROP_WRITING_MODE,false, uno::makeAny( text::WritingMode2::RL_TB));
1849 : : break;
1850 : : case NS_sprm::LN_PFNumRMIns:
1851 : : break; // sprmPFNumRMIns
1852 : : case NS_sprm::LN_PCrLf:
1853 : : break; // sprmPCrLf
1854 : : case NS_sprm::LN_PNumRM:
1855 : : break; // sprmPNumRM
1856 : : case NS_sprm::LN_PHugePapx:
1857 : : break; // sprmPHugePapx
1858 : : case NS_sprm::LN_PFUsePgsuSettings:
1859 : : break; // sprmPFUsePgsuSettings
1860 : : case NS_sprm::LN_PFAdjustRight:
1861 : : break; // sprmPFAdjustRight
1862 : : case NS_sprm::LN_CFRMarkDel:
1863 : : break; // sprmCFRMarkDel
1864 : : case NS_sprm::LN_CFRMark:
1865 : : break; // sprmCFRMark
1866 : : case NS_sprm::LN_CFFldVanish:
1867 : : break; // sprmCFFldVanish
1868 : : case NS_sprm::LN_CFSpec: // sprmCFSpec
1869 : : break;
1870 : : case NS_sprm::LN_CPicLocation: // sprmCPicLocation
1871 : : //is being resolved on the tokenizer side
1872 : : break;
1873 : : case NS_sprm::LN_CIbstRMark:
1874 : : break; // sprmCIbstRMark
1875 : : case NS_sprm::LN_CDttmRMark:
1876 : : break; // sprmCDttmRMark
1877 : : case NS_sprm::LN_CFData:
1878 : : break; // sprmCFData
1879 : : case NS_sprm::LN_CIdslRMark:
1880 : : break; // sprmCIdslRMark
1881 : : case NS_sprm::LN_CChs:
1882 : : break; // sprmCChs
1883 : : case NS_sprm::LN_CSymbol: // sprmCSymbol
1884 [ # # ]: 0 : resolveSprmProps(*this, rSprm); //resolves LN_FONT and LN_CHAR
1885 : : break;
1886 : : case NS_sprm::LN_CFOle2:
1887 : : break; // sprmCFOle2
1888 : : case NS_sprm::LN_CIdCharType:
1889 : : break; // sprmCIdCharType
1890 : : case NS_sprm::LN_CHighlight:
1891 : : {
1892 : 0 : sal_Int32 nColor = 0;
1893 [ # # ][ # # ]: 0 : if(true ==( mbIsHighlightSet = getColorFromIndex(nIntValue, nColor)))
1894 [ # # ][ # # ]: 0 : rContext->Insert(PROP_CHAR_BACK_COLOR, true, uno::makeAny( nColor ));
1895 [ # # ]: 0 : else if (mnBackgroundColor)
1896 [ # # ][ # # ]: 0 : rContext->Insert(PROP_CHAR_BACK_COLOR, true, uno::makeAny( mnBackgroundColor ));
1897 : : }
1898 : : break; // sprmCHighlight
1899 : : case NS_sprm::LN_CObjLocation:
1900 : : break; // sprmCObjLocation
1901 : : case NS_sprm::LN_CFFtcAsciSymb:
1902 : : break; // sprmCFFtcAsciSymb
1903 : : case NS_sprm::LN_CIstd:
1904 : : break; // sprmCIstd
1905 : : case NS_sprm::LN_CIstdPermute:
1906 : : break; // sprmCIstdPermute
1907 : : case NS_sprm::LN_CDefault:
1908 : : break; // sprmCDefault
1909 : : case NS_sprm::LN_CPlain:
1910 : : break; // sprmCPlain
1911 : : case NS_sprm::LN_CKcd:
1912 [ # # ][ # # ]: 0 : rContext->Insert(PROP_CHAR_EMPHASIS, true, uno::makeAny ( getEmphasisValue (nIntValue)));
[ # # ]
1913 : : break; // sprmCKcd
1914 : : case NS_sprm::LN_CFEmboss:// sprmCFEmboss
1915 : : case 60:// sprmCFBold
1916 : : case NS_sprm::LN_CFBoldBi:// sprmCFBoldBi (offset 0x27 to normal bold)
1917 : : case NS_sprm::LN_CFItalicBi:// sprmCFItalicBi (offset 0x27 to normal italic)
1918 : : case NS_sprm::LN_CFBold: //sprmCFBold
1919 : : case 61: /*sprmCFItalic*/
1920 : : case NS_sprm::LN_CFItalic: //sprmCFItalic
1921 : : case NS_sprm::LN_CFStrike: //sprmCFStrike
1922 : : case NS_sprm::LN_CFOutline: //sprmCFOutline
1923 : : case NS_sprm::LN_CFShadow: //sprmCFShadow
1924 : : case NS_sprm::LN_CFSmallCaps: //sprmCFSmallCaps
1925 : : case NS_sprm::LN_CFCaps: //sprmCFCaps
1926 : : case NS_sprm::LN_CFVanish: //sprmCFVanish
1927 : : case NS_sprm::LN_CFDStrike: // sprmCFDStrike
1928 : : {
1929 : 879 : PropertyIds ePropertyId = PROP_CHAR_WEIGHT; //initialized to prevent warning!
1930 [ + + + - : 879 : switch( nSprmId )
- + + -
- ]
1931 : : {
1932 : : case 60:// sprmCFBold
1933 : : case NS_sprm::LN_CFBoldBi: // sprmCFBoldBi
1934 : : case NS_sprm::LN_CFBold: /*sprmCFBold*/
1935 [ + + ]: 384 : ePropertyId = nSprmId != NS_sprm::LN_CFBoldBi ? PROP_CHAR_WEIGHT : PROP_CHAR_WEIGHT_COMPLEX;
1936 : 384 : break;
1937 : : case 61: /*sprmCFItalic*/
1938 : : case NS_sprm::LN_CFItalicBi: // sprmCFItalicBi
1939 : : case NS_sprm::LN_CFItalic: /*sprmCFItalic*/
1940 [ + + ]: 459 : ePropertyId = nSprmId == 0x836 ? PROP_CHAR_POSTURE : PROP_CHAR_POSTURE_COMPLEX;
1941 : 459 : break;
1942 : : case NS_sprm::LN_CFStrike: /*sprmCFStrike*/
1943 : : case NS_sprm::LN_CFDStrike : /*sprmCFDStrike double strike through*/
1944 : 3 : ePropertyId = PROP_CHAR_STRIKEOUT;
1945 : 3 : break;
1946 : : case NS_sprm::LN_CFOutline: /*sprmCFOutline*/
1947 : 0 : ePropertyId = PROP_CHAR_CONTOURED;
1948 : 0 : break;
1949 : : case NS_sprm::LN_CFShadow: /*sprmCFShadow*/
1950 : 0 : ePropertyId = PROP_CHAR_SHADOWED;
1951 : 0 : break;
1952 : : case NS_sprm::LN_CFSmallCaps: /*sprmCFSmallCaps*/
1953 : : case NS_sprm::LN_CFCaps: /*sprmCFCaps*/
1954 : 30 : ePropertyId = PROP_CHAR_CASE_MAP;
1955 : 30 : break;
1956 : : case NS_sprm::LN_CFVanish: /*sprmCFVanish*/
1957 : 3 : ePropertyId = PROP_CHAR_HIDDEN;
1958 : 3 : break;
1959 : : case NS_sprm::LN_CFEmboss: /*sprmCFEmboss*/
1960 : 0 : ePropertyId = PROP_CHAR_RELIEF;
1961 : 0 : break;
1962 : : }
1963 : : //expected: 0,1,128,129
1964 [ + - ]: 879 : if(nIntValue != 128) //inherited from paragraph - ignore
1965 : : {
1966 [ - + ]: 879 : if( nIntValue == 129) //inverted style sheet value
1967 : : {
1968 : : //get value from style sheet and invert it
1969 : 0 : sal_Int16 nStyleValue = 0;
1970 [ # # ]: 0 : uno::Any aStyleVal = m_pImpl->GetPropertyFromStyleSheet(ePropertyId);
1971 [ # # ]: 0 : if( !aStyleVal.hasValue() )
1972 : : {
1973 : : nIntValue = 0x83a == nSprmId ?
1974 [ # # ]: 0 : 4 : 1;
1975 : : }
1976 [ # # ]: 0 : else if(aStyleVal.getValueTypeClass() == uno::TypeClass_FLOAT )
1977 : : {
1978 : 0 : double fDoubleValue = 0;
1979 : : //only in case of awt::FontWeight
1980 : 0 : aStyleVal >>= fDoubleValue;
1981 : 0 : nIntValue = fDoubleValue > 100. ? 0 : 1;
1982 : : }
1983 [ # # ][ # # ]: 0 : else if((aStyleVal >>= nStyleValue) ||
[ # # ]
1984 [ # # ]: 0 : (nStyleValue = (sal_Int16)comphelper::getEnumAsINT32(aStyleVal)) >= 0 )
1985 : : {
1986 : : nIntValue = 0x83a == nSprmId ?
1987 : : nStyleValue ? 0 : 4 :
1988 [ # # ][ # # ]: 0 : nStyleValue ? 0 : 1;
1989 : : }
1990 : : else
1991 : : {
1992 : : OSL_FAIL( "what type was it");
1993 : 0 : }
1994 : : }
1995 : :
1996 [ + + + - : 879 : switch( nSprmId )
+ + + -
- ]
1997 : : {
1998 : : case 60:/*sprmCFBold*/
1999 : : case NS_sprm::LN_CFBold: /*sprmCFBold*/
2000 : : case NS_sprm::LN_CFBoldBi: // sprmCFBoldBi
2001 : : {
2002 [ + + ][ + - ]: 384 : uno::Any aBold( uno::makeAny( nIntValue ? awt::FontWeight::BOLD : awt::FontWeight::NORMAL ) );
2003 : :
2004 [ + - ]: 384 : rContext->Insert(ePropertyId, true, aBold );
2005 [ + + ]: 384 : if( nSprmId != NS_sprm::LN_CFBoldBi ) // sprmCFBoldBi
2006 [ + - ]: 219 : rContext->Insert(PROP_CHAR_WEIGHT_ASIAN, true, aBold );
2007 : :
2008 [ + - ]: 384 : uno::Reference<beans::XPropertySet> xCharStyle(m_pImpl->GetCurrentNumberingCharStyle());
2009 [ + + ]: 384 : if (xCharStyle.is())
2010 [ + - ][ + - ]: 384 : xCharStyle->setPropertyValue(rPropNameSupplier.GetName(PROP_CHAR_WEIGHT), aBold);
[ + - ]
2011 : : }
2012 : 384 : break;
2013 : : case 61: /*sprmCFItalic*/
2014 : : case NS_sprm::LN_CFItalic: /*sprmCFItalic*/
2015 : : case NS_sprm::LN_CFItalicBi: // sprmCFItalicBi
2016 : : {
2017 [ + + ][ + - ]: 459 : uno::Any aPosture( uno::makeAny( nIntValue ? awt::FontSlant_ITALIC : awt::FontSlant_NONE ) );
2018 [ + - ]: 459 : rContext->Insert( ePropertyId, true, aPosture );
2019 [ + + ]: 459 : if( nSprmId != NS_sprm::LN_CFItalicBi ) // sprmCFItalicBi
2020 [ + - ]: 459 : rContext->Insert(PROP_CHAR_POSTURE_ASIAN, true, aPosture );
2021 : : }
2022 : 459 : break;
2023 : : case NS_sprm::LN_CFStrike: /*sprmCFStrike*/
2024 : : rContext->Insert(ePropertyId, true,
2025 [ - + ][ + - ]: 3 : uno::makeAny( nIntValue ? awt::FontStrikeout::SINGLE : awt::FontStrikeout::NONE ) );
[ + - ]
2026 : 3 : break;
2027 : : case NS_sprm::LN_CFDStrike : /*sprmCFDStrike double strike through*/
2028 : : rContext->Insert(ePropertyId, true,
2029 [ # # ][ # # ]: 0 : uno::makeAny( nIntValue ? awt::FontStrikeout::DOUBLE : awt::FontStrikeout::NONE ) );
[ # # ]
2030 : 0 : break;
2031 : : case NS_sprm::LN_CFOutline: /*sprmCFOutline*/
2032 : : case NS_sprm::LN_CFShadow: /*sprmCFShadow*/
2033 : : case NS_sprm::LN_CFVanish: /*sprmCFVanish*/
2034 [ + - ][ + - ]: 3 : rContext->Insert(ePropertyId, true, uno::makeAny( nIntValue ? true : false ));
2035 : 3 : break;
2036 : : case NS_sprm::LN_CFSmallCaps: /*sprmCFSmallCaps*/
2037 : : rContext->Insert(ePropertyId, true,
2038 [ + - ][ + - ]: 15 : uno::makeAny( nIntValue ? style::CaseMap::SMALLCAPS : style::CaseMap::NONE));
[ + - ]
2039 : 15 : break;
2040 : : case NS_sprm::LN_CFCaps: /*sprmCFCaps*/
2041 : : rContext->Insert(ePropertyId, true,
2042 [ + - ][ + - ]: 15 : uno::makeAny( nIntValue ? style::CaseMap::UPPERCASE : style::CaseMap::NONE));
[ + - ]
2043 : 15 : break;
2044 : : case NS_sprm::LN_CFEmboss: /*sprmCFEmboss*/
2045 : : rContext->Insert(ePropertyId, true,
2046 [ # # ][ # # ]: 0 : uno::makeAny( nIntValue ? awt::FontRelief::EMBOSSED : awt::FontRelief::NONE ));
[ # # ]
2047 : 879 : break;
2048 : :
2049 : : }
2050 : : }
2051 : : }
2052 : : break;
2053 : : case NS_sprm::LN_CFtcDefault:
2054 : : break; // sprmCFtcDefault
2055 : : case NS_sprm::LN_CKul: // sprmCKul
2056 : : {
2057 : : // Parameter: 0 = none, 1 = single, 2 = by Word,
2058 : : // 3 = double, 4 = dotted, 5 = hidden
2059 : : // 6 = thick, 7 = dash, 8 = dot(not used)
2060 : : // 9 = dotdash 10 = dotdotdash 11 = wave
2061 [ + - ][ + - ]: 3 : handleUnderlineType(nIntValue, rContext);
[ + - ]
2062 : : }
2063 : : break;
2064 : : case NS_sprm::LN_CSizePos:
2065 : : break; // sprmCSizePos
2066 : : case NS_sprm::LN_CLid:
2067 : : break; // sprmCLid
2068 : : case NS_sprm::LN_CIco:
2069 : : {
2070 : 0 : sal_Int32 nColor = 0;
2071 [ # # ][ # # ]: 0 : if (getColorFromIndex(nIntValue, nColor))
2072 [ # # ][ # # ]: 0 : rContext->Insert(PROP_CHAR_COLOR, true, uno::makeAny( nColor ) );
2073 : : }
2074 : : break; // sprmCIco
2075 : : case NS_sprm::LN_CHpsBi: // sprmCHpsBi
2076 : : case NS_sprm::LN_CHps: // sprmCHps
2077 : : {
2078 : : //multiples of half points (12pt == 24)
2079 : 14833 : double fVal = double(nIntValue) / 2.;
2080 [ + - ]: 14833 : uno::Any aVal = uno::makeAny( fVal );
2081 [ + + ]: 14833 : if( NS_sprm::LN_CHpsBi == nSprmId )
2082 : : {
2083 [ + - ]: 1676 : rContext->Insert( PROP_CHAR_HEIGHT_COMPLEX, true, aVal );
2084 : : // Also set Western, but don't overwrite it.
2085 [ + - ]: 1676 : rContext->Insert( PROP_CHAR_HEIGHT, true, aVal, false );
2086 : : }
2087 : : else
2088 : : {
2089 : : //Asian get the same value as Western
2090 [ + - ]: 13157 : rContext->Insert( PROP_CHAR_HEIGHT, true, aVal );
2091 [ + - ]: 13157 : rContext->Insert( PROP_CHAR_HEIGHT_ASIAN, true, aVal );
2092 : :
2093 [ + - ]: 13157 : uno::Reference<beans::XPropertySet> xCharStyle(m_pImpl->GetCurrentNumberingCharStyle());
2094 [ + + ]: 13157 : if (xCharStyle.is())
2095 [ + - ][ + - ]: 13157 : xCharStyle->setPropertyValue(rPropNameSupplier.GetName(PROP_CHAR_HEIGHT), aVal);
[ + - ]
2096 : : }
2097 [ + - ][ + - ]: 14833 : m_pImpl->deferCharacterProperty( nSprmId, uno::makeAny( nIntValue ));
2098 : : }
2099 : : break;
2100 : : case NS_sprm::LN_CHpsInc:
2101 : : break; // sprmCHpsInc
2102 : : case NS_sprm::LN_CHpsPos:
2103 [ + - ][ + - ]: 9 : m_pImpl->deferCharacterProperty( nSprmId, uno::makeAny( nIntValue ));
2104 : : break; // sprmCHpsPos
2105 : : case NS_sprm::LN_CHpsPosAdj:
2106 : : break; // sprmCHpsPosAdj
2107 : : case NS_sprm::LN_CMajority:
2108 : : break; // sprmCMajority
2109 : : case NS_sprm::LN_CIss: // sprmCIss
2110 : : {
2111 : : //sub/super script 1: super, 2: sub, 0: normal
2112 : 0 : sal_Int16 nEscapement = 0;
2113 : 0 : sal_Int8 nProp = 58;
2114 [ # # # # ]: 0 : switch(nIntValue)
2115 : : {
2116 : : case 1: //super
2117 : 0 : nEscapement = 101;
2118 : 0 : break;
2119 : : case 2: //sub
2120 : 0 : nEscapement = -101;
2121 : 0 : break;
2122 : 0 : case 0: nProp = 0;break; //none
2123 : : }
2124 [ # # ][ # # ]: 0 : rContext->Insert(PROP_CHAR_ESCAPEMENT, true, uno::makeAny( nEscapement ) );
2125 [ # # ][ # # ]: 0 : rContext->Insert(PROP_CHAR_ESCAPEMENT_HEIGHT, true, uno::makeAny( nProp ) );
2126 : : }
2127 : : break;
2128 : : case NS_sprm::LN_CHpsNew50:
2129 : : break; // sprmCHpsNew50
2130 : : case NS_sprm::LN_CHpsInc1:
2131 : : break; // sprmCHpsInc1
2132 : : case 71 : //"sprmCDxaSpace"
2133 : : case 96 : //"sprmCDxaSpace"
2134 : : case NS_sprm::LN_CDxaSpace: // sprmCDxaSpace
2135 : : //Kerning half point values
2136 : : //TODO: there are two kerning values -
2137 : : // in ww8par6.cxx NS_sprm::LN_CHpsKern is used as boolean AutoKerning
2138 [ + - ][ + - ]: 18 : rContext->Insert(PROP_CHAR_CHAR_KERNING, true, uno::makeAny( sal_Int16(ConversionHelper::convertTwipToMM100(sal_Int16(nIntValue))) ) );
[ + - ]
2139 : : break;
2140 : : case NS_sprm::LN_CHpsKern: // sprmCHpsKern auto kerning is bound to a minimum font size in Word - but not in Writer :-(
2141 [ + - ][ + - ]: 369 : rContext->Insert(PROP_CHAR_AUTO_KERNING, true, uno::makeAny( sal_Bool(nIntValue) ) );
2142 : : break;
2143 : : case NS_sprm::LN_CMajority50:
2144 : : break; // sprmCMajority50
2145 : : case NS_sprm::LN_CHpsMul:
2146 : : break; // sprmCHpsMul
2147 : : case NS_sprm::LN_CYsri:
2148 : : break; // sprmCYsri
2149 : : case NS_sprm::LN_CRgFtc0: // sprmCRgFtc0 //ascii font index
2150 : : case NS_sprm::LN_CRgFtc1: // sprmCRgFtc1 //Asian font index
2151 : : case NS_sprm::LN_CRgFtc2: // sprmCRgFtc2 //CTL font index
2152 : : case NS_sprm::LN_CFtcBi: // sprmCFtcBi //font index of a CTL font
2153 : : {
2154 [ + - ]: 14310 : FontTablePtr pFontTable = m_pImpl->GetFontTable();
2155 [ + - ][ + - ]: 14310 : if(nIntValue >= 0 && pFontTable->size() > sal_uInt32(nIntValue))
[ + + ][ + + ]
2156 : : {
2157 : 14025 : PropertyIds eFontName = PROP_CHAR_FONT_NAME;
2158 : 14025 : PropertyIds eFontStyle = PROP_CHAR_FONT_STYLE;
2159 : 14025 : PropertyIds eFontFamily = PROP_CHAR_FONT_FAMILY;
2160 : 14025 : PropertyIds eFontCharSet = PROP_CHAR_FONT_CHAR_SET;
2161 : 14025 : PropertyIds eFontPitch = PROP_CHAR_FONT_PITCH;
2162 [ + + + - ]: 14025 : switch(nSprmId)
2163 : : {
2164 : : case NS_sprm::LN_CRgFtc0:
2165 : : //already initialized
2166 : 12504 : break;
2167 : : case NS_sprm::LN_CRgFtc1:
2168 : 453 : eFontName = PROP_CHAR_FONT_NAME_ASIAN;
2169 : 453 : eFontStyle = PROP_CHAR_FONT_STYLE_ASIAN;
2170 : 453 : eFontFamily = PROP_CHAR_FONT_FAMILY_ASIAN;
2171 : 453 : eFontCharSet = PROP_CHAR_FONT_CHAR_SET_ASIAN;
2172 : 453 : eFontPitch = PROP_CHAR_FONT_PITCH_ASIAN;
2173 : 453 : break;
2174 : : case NS_sprm::LN_CRgFtc2:
2175 : : case NS_sprm::LN_CFtcBi:
2176 : 1068 : eFontName = PROP_CHAR_FONT_NAME_COMPLEX;
2177 : 1068 : eFontStyle = PROP_CHAR_FONT_STYLE_COMPLEX;
2178 : 1068 : eFontFamily = PROP_CHAR_FONT_FAMILY_COMPLEX;
2179 : 1068 : eFontCharSet = PROP_CHAR_FONT_CHAR_SET_COMPLEX;
2180 : 1068 : eFontPitch = PROP_CHAR_FONT_PITCH_COMPLEX;
2181 : 1068 : break;
2182 : : }
2183 : : (void)eFontFamily;
2184 : : (void)eFontStyle;
2185 [ + - ]: 14025 : const FontEntry::Pointer_t pFontEntry(pFontTable->getFontEntry(sal_uInt32(nIntValue)));
2186 [ + - ][ + - ]: 14025 : rContext->Insert(eFontName, true, uno::makeAny( pFontEntry->sFontName ));
2187 [ + - ][ + - ]: 14025 : rContext->Insert(eFontCharSet, true, uno::makeAny( (sal_Int16)pFontEntry->nTextEncoding ));
2188 [ + - ][ + - ]: 14025 : rContext->Insert(eFontPitch, true, uno::makeAny( pFontEntry->nPitchRequest ));
[ + - ]
2189 [ + - ]: 14310 : }
2190 : : }
2191 : : break;
2192 : : case NS_sprm::LN_CCharScale: // sprmCCharScale
2193 : : rContext->Insert(PROP_CHAR_SCALE_WIDTH, true,
2194 [ # # ][ # # ]: 0 : uno::makeAny( sal_Int16(nIntValue) ));
2195 : : break;
2196 : : case NS_sprm::LN_CFImprint: // sprmCFImprint 1 or 0
2197 : : // FontRelief: NONE, EMBOSSED, ENGRAVED
2198 : : rContext->Insert(PROP_CHAR_RELIEF, true,
2199 [ # # ][ # # ]: 0 : uno::makeAny( nIntValue ? awt::FontRelief::ENGRAVED : awt::FontRelief::NONE ));
[ # # ]
2200 : : break;
2201 : : case NS_sprm::LN_CFObj:
2202 : : break; // sprmCFObj
2203 : : case NS_sprm::LN_CPropRMark:
2204 : : break; // sprmCPropRMark
2205 : : case NS_sprm::LN_CSfxText:
2206 : : // The file-format has many character animations. We have only
2207 : : // one, so we use it always. Suboptimal solution though.
2208 [ # # ]: 0 : if (nIntValue)
2209 [ # # ][ # # ]: 0 : rContext->Insert(PROP_CHAR_FLASH, true, uno::makeAny( true ));
2210 : : else
2211 [ # # ][ # # ]: 0 : rContext->Insert(PROP_CHAR_FLASH, true, uno::makeAny( false ));
2212 : : break; // sprmCSfxText
2213 : : case NS_sprm::LN_CFBiDi:
2214 : : break; // sprmCFBiDi
2215 : : case NS_sprm::LN_CFDiacColor:
2216 : : break; // sprmCFDiacColor
2217 : : case NS_sprm::LN_CIcoBi:
2218 : : break; // sprmCIcoBi
2219 : : case NS_sprm::LN_CDispFldRMark:
2220 : : break; // sprmCDispFldRMark
2221 : : case NS_sprm::LN_CIbstRMarkDel:
2222 : : break; // sprmCIbstRMarkDel
2223 : : case NS_sprm::LN_CDttmRMarkDel:
2224 : : break; // sprmCDttmRMarkDel
2225 : : case NS_sprm::LN_CBrc:
2226 : : break; // sprmCBrc
2227 : : case NS_sprm::LN_CShd:
2228 : : {
2229 : : //contains fore color, back color and shadow percentage, results in a brush
2230 [ # # ]: 0 : writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
2231 [ # # ]: 0 : if( pProperties.get())
2232 : : {
2233 [ # # ][ # # ]: 0 : CellColorHandlerPtr pCellColorHandler( new CellColorHandler );
[ # # ]
2234 : 0 : pCellColorHandler->setOutputFormat( CellColorHandler::Character );
2235 [ # # ]: 0 : pProperties->resolve(*pCellColorHandler);
2236 [ # # ][ # # ]: 0 : rContext->insert( pCellColorHandler->getProperties(), true );
[ # # ][ # # ]
[ # # ][ # # ]
2237 : : }
2238 [ # # ]: 0 : break;
2239 : : }
2240 : : case NS_sprm::LN_CIdslRMarkDel:
2241 : : break; // sprmCIdslRMarkDel
2242 : : case NS_sprm::LN_CFUsePgsuSettings:
2243 : : break; // sprmCFUsePgsuSettings
2244 : : case NS_sprm::LN_CCpg:
2245 : : break; // sprmCCpg
2246 : : case NS_sprm::LN_CLidBi: // sprmCLidBi language complex
2247 : : case NS_sprm::LN_CRgLid0_80: // sprmCRgLid0_80 older language Western
2248 : : case NS_sprm::LN_CRgLid0: // sprmCRgLid0 language Western
2249 : : case NS_sprm::LN_CRgLid1: // sprmCRgLid1 language Asian
2250 : : case NS_sprm::LN_CRgLid1_80: // sprmCRgLid1_80 older language Asian
2251 : : {
2252 : 14637 : lang::Locale aLocale;
2253 [ + - ]: 14637 : MsLangId::convertLanguageToLocale( (LanguageType)nIntValue, aLocale );
2254 : :
2255 : : PropertyIds aPropId;
2256 [ + + + ]: 14637 : switch (nSprmId)
2257 : : {
2258 : : case NS_sprm::LN_CRgLid0:
2259 : : case NS_sprm::LN_CRgLid0_80:
2260 : 12939 : aPropId = PROP_CHAR_LOCALE;
2261 : 12939 : break;
2262 : : case NS_sprm::LN_CRgLid1:
2263 : : case NS_sprm::LN_CRgLid1_80:
2264 : 846 : aPropId = PROP_CHAR_LOCALE_ASIAN;
2265 : 846 : break;
2266 : : default:
2267 : 852 : aPropId = PROP_CHAR_LOCALE_COMPLEX;
2268 : 852 : break;
2269 : : }
2270 : :
2271 [ + - ][ + - ]: 14637 : rContext->Insert(aPropId, true, uno::makeAny( aLocale ) );
2272 : : }
2273 : : break;
2274 : :
2275 : : case NS_sprm::LN_CIdctHint: // sprmCIdctHint
2276 : : //list table - text offset???
2277 : : break;
2278 : : case NS_sprm::LN_PicBrcl:
2279 : : break; // sprmPicBrcl
2280 : : case NS_sprm::LN_PicScale:
2281 : : break; // sprmPicScale
2282 : : case NS_sprm::LN_PicBrcTop:
2283 : : break; // sprmPicBrcTop
2284 : : case NS_sprm::LN_PicBrcLeft:
2285 : : break; // sprmPicBrcLeft
2286 : : case NS_sprm::LN_PicBrcBottom:
2287 : : break; // sprmPicBrcBoConversionHelper::convertTwipToMM100ttom
2288 : : case NS_sprm::LN_PicBrcRight:
2289 : : break; // sprmPicBrcRight
2290 : : case NS_sprm::LN_ScnsPgn:
2291 : : break; // sprmScnsPgn
2292 : : case NS_sprm::LN_SiHeadingPgn:
2293 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2294 [ # # ]: 0 : if(pSectionContext)
2295 : 0 : pSectionContext->SetEvenlySpaced( nIntValue > 0 );
2296 : :
2297 : : break; // sprmSiHeadingPgn
2298 : : case NS_sprm::LN_SOlstAnm:
2299 : : break; // sprmSOlstAnm
2300 : : case 136:
2301 : : case NS_sprm::LN_SDxaColWidth: // sprmSDxaColWidth
2302 : : // contains the twip width of the column as 3-byte-code
2303 : : // the lowet byte contains the index
2304 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2305 [ # # ]: 0 : if(pSectionContext)
2306 [ # # ][ # # ]: 0 : pSectionContext->AppendColumnWidth( ConversionHelper::convertTwipToMM100( (nIntValue & 0xffff00) >> 8 ));
2307 : : break;
2308 : : case NS_sprm::LN_SDxaColSpacing: // sprmSDxaColSpacing
2309 : : // the lowet byte contains the index
2310 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2311 [ # # ]: 0 : if(pSectionContext)
2312 [ # # ][ # # ]: 0 : pSectionContext->AppendColumnSpacing( ConversionHelper::convertTwipToMM100( (nIntValue & 0xffff00) >> 8 ));
2313 : : break;
2314 : : case 138:
2315 : : case NS_sprm::LN_SFEvenlySpaced:
2316 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2317 [ # # ]: 0 : if(pSectionContext)
2318 : 0 : pSectionContext->SetEvenlySpaced( nIntValue > 0 );
2319 : : break; // sprmSFEvenlySpaced
2320 : : case NS_sprm::LN_SFProtected: // sprmSFProtected
2321 : : //todo: missing feature - unlocked sections in protected documents
2322 : : break;
2323 : : case NS_sprm::LN_SDmBinFirst: // sprmSDmBinFirst
2324 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2325 [ # # ]: 0 : if(pSectionContext)
2326 [ # # ]: 0 : pSectionContext->SetFirstPaperBin(nIntValue);
2327 : : break;
2328 : : case NS_sprm::LN_SDmBinOther: // sprmSDmBinOther
2329 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2330 [ # # ]: 0 : if(pSectionContext)
2331 [ # # ]: 0 : pSectionContext->SetPaperBin( nIntValue );
2332 : : break;
2333 : : case NS_sprm::LN_SBkc: // sprmSBkc
2334 : : /* break type
2335 : : 0 - No break
2336 : : 1 - New Colunn
2337 : : 2 - New page
2338 : : 3 - Even page
2339 : : 4 - odd page
2340 : : */
2341 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2342 [ + - ]: 129 : if(pSectionContext)
2343 : : {
2344 : : // Ignore continous section break at the end of the document
2345 : : // It makes the importer loose margin settings with no benefit
2346 [ + - ][ + + ]: 129 : if (m_pImpl->GetParaSectpr() || nIntValue != 0)
[ + + ][ + + ]
2347 : 123 : pSectionContext->SetBreakType( nIntValue );
2348 : : }
2349 : : break;
2350 : : case 143:
2351 : : case NS_sprm::LN_SFTitlePage: // sprmSFTitlePage
2352 : : case NS_ooxml::LN_EG_SectPrContents_titlePg:
2353 : : {
2354 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2355 [ + - ]: 21 : if(pSectionContext)
2356 : 21 : pSectionContext->SetTitlePage( nIntValue > 0 ? true : false );//section has title page
2357 : : }
2358 : : break;
2359 : : case 144:
2360 : : case NS_sprm::LN_SCcolumns: // sprmSCcolumns
2361 : : //no of columns - 1
2362 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2363 [ # # ]: 0 : if(pSectionContext)
2364 : 0 : pSectionContext->SetColumnCount( (sal_Int16) nIntValue );
2365 : : break;
2366 : : case 145:
2367 : : case NS_sprm::LN_SDxaColumns: // sprmSDxaColumns
2368 : : //column distance - default 708 twip
2369 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2370 [ # # ]: 0 : if(pSectionContext)
2371 [ # # ]: 0 : pSectionContext->SetColumnDistance( ConversionHelper::convertTwipToMM100( nIntValue ) );
2372 : : break;
2373 : : case NS_sprm::LN_SFAutoPgn:
2374 : : break; // sprmSFAutoPgn
2375 : : case 147:
2376 : : case NS_sprm::LN_SNfcPgn: // sprmSNfcPgn
2377 : : //page numbering 0 - Arab, 1 - ROMAN, 2 - roman, 3 - ABC, 4 abc
2378 : : sal_Int16 nNumbering;
2379 [ # # # # : 0 : switch( nIntValue )
# ]
2380 : : {
2381 : 0 : case 1: nNumbering = style::NumberingType::ROMAN_UPPER;
2382 : 0 : case 2: nNumbering = style::NumberingType::ROMAN_LOWER;
2383 : 0 : case 3: nNumbering = style::NumberingType::CHARS_UPPER_LETTER;
2384 : 0 : case 4: nNumbering = style::NumberingType::CHARS_LOWER_LETTER;
2385 : : case 0:
2386 : : default:
2387 : 0 : nNumbering = style::NumberingType::ARABIC;
2388 : : }
2389 [ # # ][ # # ]: 0 : rContext->Insert( PROP_NUMBERING_TYPE, false, uno::makeAny( nNumbering ) );
2390 : : break;
2391 : : case NS_sprm::LN_SDyaPgn:
2392 : : break; // sprmSDyaPgn
2393 : : case NS_sprm::LN_SDxaPgn:
2394 : : break; // sprmSDxaPgn
2395 : : case 150:
2396 : : case NS_sprm::LN_SFPgnRestart: // sprmSFPgnRestart
2397 : : {
2398 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2399 [ # # ]: 0 : if(pSectionContext)
2400 : 0 : pSectionContext->SetPageNoRestart( nIntValue > 0 );
2401 : : }
2402 : : break;
2403 : : case NS_sprm::LN_SFEndnote:
2404 : : break; // sprmSFEndnote
2405 : : case 154:
2406 : : case NS_sprm::LN_SNLnnMod:// sprmSNLnnMod
2407 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2408 [ # # ]: 0 : if( pSectionContext )
2409 : 0 : pSectionContext->SetLnnMod( nIntValue );
2410 : : break;
2411 : : case 155:
2412 : : case NS_sprm::LN_SDxaLnn: // sprmSDxaLnn
2413 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2414 [ # # ]: 0 : if( pSectionContext )
2415 : 0 : pSectionContext->SetdxaLnn( nIntValue );
2416 : : break;
2417 : : case 152:
2418 : : case NS_sprm::LN_SLnc:// sprmSLnc
2419 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2420 [ # # ]: 0 : if( pSectionContext )
2421 : 0 : pSectionContext->SetLnc( nIntValue );
2422 : : break;
2423 : : case 160:
2424 : : case NS_sprm::LN_SLnnMin: // sprmSLnnMin
2425 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2426 [ # # ]: 0 : if( pSectionContext )
2427 : 0 : pSectionContext->SetLnnMin( nIntValue );
2428 : : break;
2429 : :
2430 : : case NS_sprm::LN_SGprfIhdt:
2431 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2432 : : //flags about header/footer sharing and footnotes?
2433 : : /* ww8scan.hxx:
2434 : : * WW8_HEADER_EVEN = 0x01, WW8_HEADER_ODD = 0x02, WW8_FOOTER_EVEN = 0x04,
2435 : : * WW8_FOOTER_ODD = 0x08, WW8_HEADER_FIRST = 0x10, WW8_FOOTER_FIRST = 0x20
2436 : : */
2437 : :
2438 : : break; // sprmSGprfIhdt
2439 : : case NS_sprm::LN_SDyaHdrTop: // sprmSDyaHdrTop
2440 : : // default 720 twip
2441 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2442 [ # # ]: 0 : if(pSectionContext)
2443 [ # # ]: 0 : pSectionContext->SetHeaderTop( ConversionHelper::convertTwipToMM100( nIntValue ));
2444 : : break;
2445 : : case NS_sprm::LN_SDyaHdrBottom: // sprmSDyaHdrBottom
2446 : : // default 720 twip
2447 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2448 [ # # ]: 0 : if(pSectionContext)
2449 [ # # ]: 0 : pSectionContext->SetHeaderBottom( ConversionHelper::convertTwipToMM100( nIntValue ) );
2450 : : break;
2451 : : case 158:
2452 : : case NS_sprm::LN_SLBetween: // sprmSLBetween
2453 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2454 [ # # ]: 0 : if(pSectionContext)
2455 : 0 : pSectionContext->SetSeparatorLine( nIntValue > 0 );
2456 : : break;
2457 : : case NS_sprm::LN_SVjc:
2458 : : break; // sprmSVjc
2459 : : case 161:
2460 : : case NS_sprm::LN_SPgnStart: // sprmSPgnStart
2461 : : //page number
2462 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2463 [ # # ]: 0 : if(pSectionContext)
2464 : 0 : pSectionContext->SetPageNumber( nIntValue );
2465 : : break;
2466 : : case 162:
2467 : : case NS_sprm::LN_SBOrientation:
2468 : : //todo: the old filter assumed that a value of 2 points to double-pages layout
2469 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2470 [ # # ]: 0 : if(pSectionContext)
2471 : 0 : pSectionContext->SetLandscape( nIntValue > 0 );
2472 [ # # ][ # # ]: 0 : rContext->Insert( PROP_IS_LANDSCAPE , false, uno::makeAny( nIntValue > 0 ));
2473 : : break; // sprmSBOrientation
2474 : : case NS_sprm::LN_SBCustomize:
2475 : : break; // sprmSBCustomize
2476 : : case 165:
2477 : : case NS_sprm::LN_SYaPage: // sprmSYaPage
2478 : : {
2479 : : //page height, rounded to default values, default: 0x3dc0 twip
2480 [ # # ]: 0 : sal_Int32 nHeight = ConversionHelper::convertTwipToMM100( nIntValue );
2481 [ # # ][ # # ]: 0 : rContext->Insert( PROP_HEIGHT, false, uno::makeAny( PaperInfo::sloppyFitPageDimension( nHeight ) ) );
[ # # ]
2482 : : }
2483 : : break;
2484 : : case NS_sprm::LN_SXaPage: // sprmSXaPage
2485 : : {
2486 : : //page width, rounded to default values, default 0x2fd0 twip
2487 [ # # ]: 0 : sal_Int32 nWidth = ConversionHelper::convertTwipToMM100( nIntValue );
2488 [ # # ][ # # ]: 0 : rContext->Insert( PROP_WIDTH, false, uno::makeAny( PaperInfo::sloppyFitPageDimension( nWidth ) ) );
[ # # ]
2489 : : }
2490 : : break;
2491 : : case 166:
2492 : : case NS_sprm::LN_SDxaLeft: // sprmSDxaLeft
2493 : : {
2494 : : //left page margin default 0x708 twip
2495 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2496 [ # # ]: 0 : sal_Int32 nConverted = ConversionHelper::convertTwipToMM100( nIntValue );
2497 [ # # ]: 0 : if(pSectionContext)
2498 : 0 : pSectionContext->SetLeftMargin( nConverted );
2499 [ # # ][ # # ]: 0 : rContext->Insert( PROP_LEFT_MARGIN, false, uno::makeAny( nConverted ));
2500 : : }
2501 : : break;
2502 : : case 167:
2503 : : case NS_sprm::LN_SDxaRight: // sprmSDxaRight
2504 : : {
2505 : : //right page margin default 0x708 twip
2506 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2507 [ # # ]: 0 : sal_Int32 nConverted = ConversionHelper::convertTwipToMM100( nIntValue );
2508 [ # # ]: 0 : if(pSectionContext)
2509 : 0 : pSectionContext->SetRightMargin( nConverted );
2510 [ # # ][ # # ]: 0 : rContext->Insert( PROP_RIGHT_MARGIN, false, uno::makeAny( nConverted ));
2511 : : }
2512 : : break;
2513 : : case 168:
2514 : : case NS_sprm::LN_SDyaTop: // sprmSDyaTop
2515 : : {
2516 : : //top page margin default 1440 twip
2517 : : //todo: check cast of SVBT16
2518 [ # # ]: 0 : sal_Int32 nConverted = ConversionHelper::convertTwipToMM100( static_cast< sal_Int16 >( nIntValue ) );
2519 [ # # ][ # # ]: 0 : rContext->Insert( PROP_TOP_MARGIN, false, uno::makeAny( nConverted ) );
2520 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2521 [ # # ]: 0 : if(pSectionContext)
2522 : 0 : pSectionContext->SetTopMargin( nConverted );
2523 : : }
2524 : : break;
2525 : : case 169:
2526 : : case NS_sprm::LN_SDyaBottom: // sprmSDyaBottom
2527 : : {
2528 : : //bottom page margin default 1440 twip
2529 : : //todo: check cast of SVBT16
2530 [ # # ]: 0 : sal_Int32 nConverted = ConversionHelper::convertTwipToMM100( static_cast< sal_Int16 >( nIntValue ) );
2531 [ # # ][ # # ]: 0 : rContext->Insert( PROP_BOTTOM_MARGIN, false, uno::makeAny( nConverted) );
2532 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2533 [ # # ]: 0 : if(pSectionContext)
2534 : 0 : pSectionContext->SetBottomMargin( nConverted );
2535 : : }
2536 : : break;
2537 : : case 170:
2538 : : case NS_sprm::LN_SDzaGutter: // sprmSDzaGutter
2539 : : {
2540 : : // gutter is added to one of the margins of a section depending on RTL, can be placed on top either
2541 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2542 [ # # ]: 0 : if(pSectionContext)
2543 : : {
2544 [ # # ]: 0 : pSectionContext->SetDzaGutter( ConversionHelper::convertTwipToMM100( nIntValue ) );
2545 : : }
2546 : : }
2547 : : break;
2548 : : case NS_sprm::LN_SDmPaperReq: // sprmSDmPaperReq
2549 : : //paper code - no handled in old filter
2550 : : break;
2551 : : case NS_sprm::LN_SPropRMark:
2552 : : break; // sprmSPropRMark
2553 : : case NS_sprm::LN_SFBiDi:// sprmSFBiDi
2554 : : {
2555 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2556 [ # # ]: 0 : if(pSectionContext)
2557 : 0 : pSectionContext->SetSFBiDi( nIntValue > 0 );
2558 : : }
2559 : : break;
2560 : : case NS_sprm::LN_SFFacingCol:
2561 : : break; // sprmSFFacingCol
2562 : : case NS_sprm::LN_SFRTLGutter: // sprmSFRTLGutter
2563 : : {
2564 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2565 [ # # ]: 0 : if(pSectionContext)
2566 : 0 : pSectionContext->SetGutterRTL( nIntValue > 0 );
2567 : : }
2568 : : break;
2569 : : case NS_sprm::LN_SBrcTop: // sprmSBrcTop
2570 : : case NS_sprm::LN_SBrcLeft: // sprmSBrcLeft
2571 : : case NS_sprm::LN_SBrcBottom: // sprmSBrcBottom
2572 : : case NS_sprm::LN_SBrcRight: // sprmSBrcRight
2573 : : {
2574 : 0 : table::BorderLine2 aBorderLine;
2575 [ # # ]: 0 : sal_Int32 nLineDistance = ConversionHelper::MakeBorderLine( nIntValue, aBorderLine );
2576 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2577 [ # # ]: 0 : if(pSectionContext)
2578 : : {
2579 : : static const BorderPosition aPositions[4] =
2580 : : {
2581 : : BORDER_TOP,
2582 : : BORDER_LEFT,
2583 : : BORDER_BOTTOM,
2584 : : BORDER_RIGHT
2585 : : };
2586 [ # # ]: 0 : pSectionContext->SetBorder( aPositions[nSprmId - NS_sprm::LN_SBrcTop], nLineDistance, aBorderLine );
2587 : : }
2588 : : }
2589 : : break;
2590 : :
2591 : : case NS_sprm::LN_SPgbProp: // sprmSPgbProp
2592 : : {
2593 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2594 [ # # ]: 0 : if(pSectionContext)
2595 : : {
2596 [ # # ][ # # ]: 0 : pSectionContext->ApplyBorderToPageStyles( m_pImpl->GetPageStyles(), m_pImpl->GetTextFactory(), nIntValue );
[ # # ]
2597 : : }
2598 : : }
2599 : : break;
2600 : : case NS_sprm::LN_SDxtCharSpace:
2601 : : {
2602 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2603 [ # # ]: 0 : if(pSectionContext)
2604 : : {
2605 : 0 : pSectionContext->SetDxtCharSpace( nIntValue );
2606 : : }
2607 : : }
2608 : : break; // sprmSDxtCharSpace
2609 : : case NS_sprm::LN_SDyaLinePitch: // sprmSDyaLinePitch
2610 : : {
2611 : : //see SwWW8ImplReader::SetDocumentGrid
2612 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2613 [ # # ]: 0 : if(pSectionContext)
2614 : : {
2615 [ # # ]: 0 : pSectionContext->SetGridLinePitch( ConversionHelper::convertTwipToMM100( nIntValue ) );
2616 : : }
2617 : : }
2618 : : break;
2619 : : case 0x703a: //undocumented, grid related?
2620 : : OSL_FAIL( "TODO: not handled yet"); //nIntValue like 0x008a2373 ?
2621 : : break;
2622 : : case NS_sprm::LN_SClm:
2623 : : {
2624 : 0 : sal_Int16 nGridType = text::TextGridMode::NONE;
2625 [ # # # # : 0 : switch( nIntValue )
# ]
2626 : : {
2627 : : case 0:
2628 : 0 : nGridType = text::TextGridMode::NONE;
2629 : 0 : break;
2630 : : case 3:
2631 : : //Text snaps to char grid, this doesn't make a lot of sense to
2632 : : //me. This is closer than LINES_CHARS
2633 : 0 : nGridType = text::TextGridMode::LINES;
2634 : 0 : break;
2635 : : case 1:
2636 : 0 : nGridType = text::TextGridMode::LINES_AND_CHARS;
2637 : 0 : break;
2638 : : case 2:
2639 : 0 : nGridType = text::TextGridMode::LINES;
2640 : 0 : break;
2641 : : default:;
2642 : : }
2643 [ # # ][ # # ]: 0 : rContext->Insert( PROP_GRID_MODE, false, uno::makeAny( nGridType ) );
2644 : :
2645 : : //Seems to force this behaviour in word ?
2646 [ # # ]: 0 : if(nGridType != text::TextGridMode::NONE)
2647 : : m_pImpl->SetDocumentSettingsProperty(
2648 [ # # ][ # # ]: 0 : PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_ADD_EXTERNAL_LEADING ),
2649 [ # # ][ # # ]: 0 : uno::makeAny( true ) );
2650 : : }
2651 : : break; // sprmSClm
2652 : : case NS_sprm::LN_STextFlow:
2653 : : case NS_ooxml::LN_EG_SectPrContents_textDirection:
2654 : : {
2655 : : /* 0 HoriLR 1 Vert TR 2 Vert TR 3 Vert TT 4 HoriLT
2656 : : only 0 and 1 can be imported correctly
2657 : : */
2658 : 102 : sal_Int16 nDirection = text::WritingMode_LR_TB;
2659 [ + - - ]: 102 : switch( nIntValue )
2660 : : {
2661 : : case 0:
2662 : : case 4:
2663 : 102 : nDirection = text::WritingMode_LR_TB;
2664 : 102 : break;
2665 : : case 1:
2666 : : case 2:
2667 : : case 3:
2668 : 0 : nDirection = text::WritingMode_TB_RL;
2669 : 0 : break;
2670 : : default:;
2671 : : }
2672 : :
2673 : 102 : PropertyMap * pTargetContext = rContext.get();
2674 : :
2675 [ + - ][ + - ]: 102 : if (pSectionContext != NULL &&
2676 : : nSprmId == NS_ooxml::LN_EG_SectPrContents_textDirection)
2677 : : {
2678 : 102 : pTargetContext = pSectionContext;
2679 : : }
2680 : :
2681 [ + - ][ + - ]: 102 : pTargetContext->Insert(PROP_WRITING_MODE, false, uno::makeAny( nDirection ) );
2682 : : }
2683 : : break; // sprmSTextFlow
2684 : : case NS_sprm::LN_TJc: // sprmTJc
2685 : : case NS_sprm::LN_TDxaLeft:
2686 : : case NS_sprm::LN_TDxaGapHalf:
2687 : : case NS_sprm::LN_TFCantSplit:
2688 : : case NS_sprm::LN_TTableHeader:
2689 : : case NS_sprm::LN_TTableBorders: // sprmTTableBorders
2690 : : {
2691 : : OSL_FAIL( "table propeties should be handled by the table manager");
2692 : : }
2693 : : break;
2694 : : case NS_sprm::LN_TDefTable10:
2695 : : break; // sprmTDefTable10
2696 : : case NS_sprm::LN_TDyaRowHeight:
2697 : : break; // sprmTDyaRowHeight
2698 : : case NS_sprm::LN_TDefTable:
2699 : : break; // sprmTDefTable
2700 : : case NS_sprm::LN_TDefTableShd:
2701 : : break; // sprmTDefTableShd
2702 : : case NS_sprm::LN_TTlp:
2703 : : break; // sprmTTlp
2704 : : case NS_sprm::LN_TFBiDi:
2705 : : break; // sprmTFBiDi
2706 : : case NS_sprm::LN_THTMLProps:
2707 : : break; // sprmTHTMLProps
2708 : : case NS_sprm::LN_TSetBrc:
2709 : : break; // sprmTSetBrc
2710 : : case NS_sprm::LN_TInsert:
2711 : : break; // sprmTInsert
2712 : : case NS_sprm::LN_TDelete:
2713 : : break; // sprmTDelete
2714 : : case NS_sprm::LN_TDxaCol:
2715 : : break; // sprmTDxaCol
2716 : : case NS_sprm::LN_TMerge:
2717 : : break; // sprmTMerge
2718 : : case NS_sprm::LN_TSplit:
2719 : : break; // sprmTSplit
2720 : : case NS_sprm::LN_TSetBrc10:
2721 : : break; // sprmTSetBrc10
2722 : : case 164: // sprmTSetShd
2723 : : case NS_sprm::LN_TSetShd:
2724 : : break; // sprmTSetShd
2725 : : case NS_sprm::LN_TSetShdOdd:
2726 : : break; // sprmTSetShdOdd
2727 : : case NS_sprm::LN_TTextFlow:
2728 : : break; // sprmTTextFlow
2729 : : case NS_sprm::LN_TDiagLine:
2730 : : break; // sprmTDiagLine
2731 : : case NS_sprm::LN_TVertMerge:
2732 : : break; // sprmTVertMerge
2733 : : case NS_sprm::LN_TVertAlign:
2734 : : break; // sprmTVertAlign
2735 : : // the following are not part of the official documentation
2736 : : case 0x6870: //TxtForeColor
2737 : : {
2738 : : //contains a color as 0xTTRRGGBB while SO uses 0xTTRRGGBB
2739 [ # # ]: 0 : sal_Int32 nColor = ConversionHelper::ConvertColor(nIntValue);
2740 [ # # ][ # # ]: 0 : rContext->Insert(PROP_CHAR_COLOR, true, uno::makeAny( nColor ) );
2741 : : }
2742 : : break;
2743 : : case 0x6877: //underlining color
2744 : : {
2745 [ # # ][ # # ]: 0 : rContext->Insert(PROP_CHAR_UNDERLINE_HAS_COLOR, true, uno::makeAny( true ) );
2746 [ # # ][ # # ]: 0 : rContext->Insert(PROP_CHAR_UNDERLINE_COLOR, true, uno::makeAny( nIntValue ) );
2747 : : }
2748 : : break;
2749 : : case 0x6815:
2750 : : break; //undocumented
2751 : : case NS_sprm::LN_CIndrsid:
2752 : : break; //undocumented
2753 : : case 0x6467:
2754 : : break; //undocumented
2755 : : case 0xF617:
2756 : : break; //undocumented
2757 : : case 0xd634: // sprmTNewSpacing - table spacing ( see WW8TabBandDesc::ProcessSpacing() )
2758 : : break;
2759 : : case NS_sprm::LN_TTRLeft:
2760 : : break; //undocumented
2761 : : case 0x4888:
2762 : : case 0x6887:
2763 : : //properties of list levels - undocumented
2764 : : break;
2765 : : case 0xd234:
2766 : : case 0xd235:
2767 : : case 0xd236:
2768 : : case 0xd237:
2769 : : break;//undocumented section properties
2770 : : case NS_sprm::LN_CEastAsianLayout:
2771 [ # # ]: 0 : resolveSprmProps(*this, rSprm);
2772 : : break;
2773 : : case NS_ooxml::LN_CT_Tabs_tab:
2774 [ + - ]: 381 : resolveSprmProps(*this, rSprm);
2775 [ + - ]: 381 : m_pImpl->IncorporateTabStop(m_pImpl->m_aCurrentTabStop);
2776 : 381 : m_pImpl->m_aCurrentTabStop = DeletableTabStop();
2777 : : break;
2778 : : case NS_ooxml::LN_CT_PPrBase_tabs:
2779 : : {
2780 : : // Initialize tab stop vector from style sheet
2781 [ + + ]: 210 : if( !m_pImpl->IsStyleSheetImport() )
2782 : : {
2783 [ + - ]: 57 : uno::Any aValue = m_pImpl->GetPropertyFromStyleSheet(PROP_PARA_TAB_STOPS);
2784 [ + - ]: 57 : uno::Sequence< style::TabStop > aStyleTabStops;
2785 [ + - ][ - + ]: 57 : if(aValue >>= aStyleTabStops)
2786 : : {
2787 [ # # ]: 0 : m_pImpl->InitTabStopFromStyle( aStyleTabStops );
2788 [ + - ]: 57 : }
2789 : : }
2790 [ + - ]: 210 : resolveSprmProps(*this, rSprm);
2791 [ + - ][ + - ]: 210 : rContext->Insert(PROP_PARA_TAB_STOPS, true, uno::makeAny( m_pImpl->GetCurrentTabStopAndClear()));
[ + - ][ + - ]
2792 : : }
2793 : : break;
2794 : :
2795 : : case NS_ooxml::LN_CT_DocDefaults_pPrDefault:
2796 : : case NS_ooxml::LN_CT_DocDefaults_rPrDefault:
2797 [ # # ][ # # ]: 0 : GetStyleSheetTable()->sprm( rSprm );
[ # # ]
2798 : : break;
2799 : : case NS_ooxml::LN_CT_PPr_sectPr:
2800 : : case NS_ooxml::LN_EG_RPrBase_color:
2801 : : case NS_ooxml::LN_EG_RPrBase_rFonts:
2802 : : case NS_ooxml::LN_EG_RPrBase_bdr:
2803 : : case NS_ooxml::LN_EG_RPrBase_eastAsianLayout:
2804 : : case NS_ooxml::LN_EG_RPrBase_u:
2805 : : case NS_ooxml::LN_EG_RPrBase_lang:
2806 : : case NS_ooxml::LN_CT_PPrBase_spacing:
2807 : : case NS_ooxml::LN_CT_PPrBase_ind:
2808 : : case NS_ooxml::LN_CT_RPrDefault_rPr:
2809 : : case NS_ooxml::LN_CT_PPrDefault_pPr:
2810 : : case NS_ooxml::LN_CT_Style_pPr:
2811 : : case NS_ooxml::LN_CT_Style_rPr:
2812 : : case NS_ooxml::LN_CT_PPr_rPr:
2813 : : case NS_ooxml::LN_CT_PPrBase_numPr:
2814 [ + + ]: 5300 : if (nSprmId == NS_ooxml::LN_CT_PPr_sectPr)
2815 [ + - ]: 351 : m_pImpl->SetParaSectpr(true);
2816 [ + - ]: 5300 : resolveSprmProps(*this, rSprm);
2817 : : break;
2818 : : case NS_ooxml::LN_EG_SectPrContents_footnotePr:
2819 : : case NS_ooxml::LN_EG_SectPrContents_endnotePr:
2820 : 564 : m_pImpl->SetInFootnoteProperties( NS_ooxml::LN_EG_SectPrContents_footnotePr == nSprmId );
2821 [ + - ]: 564 : resolveSprmProps(*this, rSprm);
2822 : : break;
2823 : : case NS_ooxml::LN_EG_SectPrContents_lnNumType:
2824 : : {
2825 [ # # ]: 0 : resolveSprmProps(*this, rSprm);
2826 : 0 : LineNumberSettings aSettings = m_pImpl->GetLineNumberSettings();
2827 : 0 : aSettings.bIsOn = true;
2828 : 0 : m_pImpl->SetLineNumberSettings( aSettings );
2829 : : //apply settings at XLineNumberingProperties
2830 : : try
2831 : : {
2832 [ # # ][ # # ]: 0 : uno::Reference< text::XLineNumberingProperties > xLineNumberingProperties( m_pImpl->GetTextDocument(), uno::UNO_QUERY_THROW );
2833 [ # # ][ # # ]: 0 : uno::Reference< beans::XPropertySet > xLineNumberingPropSet = xLineNumberingProperties->getLineNumberingProperties();
2834 [ # # ]: 0 : PropertyNameSupplier& rNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
2835 [ # # ][ # # ]: 0 : xLineNumberingPropSet->setPropertyValue(rNameSupplier.GetName( PROP_IS_ON ), uno::makeAny(true) );
[ # # ][ # # ]
2836 [ # # ]: 0 : if( aSettings.nInterval )
2837 [ # # ][ # # ]: 0 : xLineNumberingPropSet->setPropertyValue(rNameSupplier.GetName( PROP_INTERVAL ), uno::makeAny((sal_Int16)aSettings.nInterval) );
[ # # ][ # # ]
2838 [ # # ]: 0 : if( aSettings.nDistance )
2839 [ # # ][ # # ]: 0 : xLineNumberingPropSet->setPropertyValue(rNameSupplier.GetName( PROP_DISTANCE ), uno::makeAny(aSettings.nDistance) );
[ # # ][ # # ]
2840 [ # # ][ # # ]: 0 : xLineNumberingPropSet->setPropertyValue(rNameSupplier.GetName( PROP_RESTART_AT_EACH_PAGE ), uno::makeAny(aSettings.bRestartAtEachPage) );
[ # # ][ # # ]
[ # # ]
2841 : : }
2842 [ # # ]: 0 : catch( const uno::Exception& )
2843 : : {
2844 : : }
2845 : :
2846 : : }
2847 : : break;
2848 : : case NS_ooxml::LN_CT_PPrBase_framePr:
2849 : : {
2850 [ + - ]: 27 : PropertyMapPtr pContext = m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH);
2851 [ + + ]: 27 : if( pContext.get() )
2852 : : {
2853 [ - + ]: 24 : ParagraphPropertyMap* pParaContext = dynamic_cast< ParagraphPropertyMap* >( pContext.get() );
2854 : 24 : pParaContext->SetFrameMode();
2855 : :
2856 : : }
2857 : : else
2858 : : {
2859 : : //TODO: What about style sheet import of frame properties
2860 : : }
2861 [ + - ][ + - ]: 27 : resolveSprmProps(*this, rSprm);
2862 : : }
2863 : : break;
2864 : : case NS_ooxml::LN_EG_SectPrContents_pgSz:
2865 : 326 : CT_PageSz.code = 0;
2866 : : {
2867 [ + - ]: 326 : PaperInfo aLetter(PAPER_LETTER);
2868 : 326 : CT_PageSz.w = aLetter.getWidth();
2869 : 326 : CT_PageSz.h = aLetter.getHeight();
2870 : : }
2871 : 326 : CT_PageSz.orient = false;
2872 [ + - ]: 326 : resolveSprmProps(*this, rSprm);
2873 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2874 [ + - ]: 326 : if(pSectionContext)
2875 : : {
2876 [ + - ][ + - ]: 326 : pSectionContext->Insert( PROP_HEIGHT, false, uno::makeAny( CT_PageSz.h ) );
2877 [ + - ][ + - ]: 326 : pSectionContext->Insert( PROP_IS_LANDSCAPE, false, uno::makeAny( CT_PageSz.orient ));
2878 [ + - ][ + - ]: 326 : pSectionContext->Insert( PROP_WIDTH, false, uno::makeAny( CT_PageSz.w ) );
2879 : 326 : pSectionContext->SetLandscape( CT_PageSz.orient );
2880 : : }
2881 : : break;
2882 : :
2883 : : case NS_ooxml::LN_EG_SectPrContents_pgMar:
2884 [ + - ]: 332 : m_pImpl->InitPageMargins();
2885 [ + - ]: 332 : resolveSprmProps(*this, rSprm);
2886 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
2887 [ + - ]: 332 : if(pSectionContext)
2888 : : {
2889 : 332 : const _PageMar& rPageMar = m_pImpl->GetPageMargins();
2890 : 332 : pSectionContext->SetTopMargin( rPageMar.top );
2891 : 332 : pSectionContext->SetRightMargin( rPageMar.right );
2892 : 332 : pSectionContext->SetBottomMargin( rPageMar.bottom );
2893 : 332 : pSectionContext->SetLeftMargin( rPageMar.left );
2894 : 332 : pSectionContext->SetHeaderTop( rPageMar.header );
2895 : 332 : pSectionContext->SetHeaderBottom( rPageMar.footer );
2896 : : }
2897 : : break;
2898 : :
2899 : : case NS_ooxml::LN_EG_SectPrContents_cols:
2900 : : {
2901 [ + - ]: 119 : writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
2902 [ + - ]: 119 : if( pProperties.get())
2903 : : {
2904 : :
2905 [ + - ][ + - ]: 119 : SectionColumnHandlerPtr pSectHdl( new SectionColumnHandler );
[ + - ]
2906 [ + - ]: 119 : pProperties->resolve(*pSectHdl);
2907 [ + - ]: 119 : if(pSectionContext)
2908 : : {
2909 [ - + ]: 119 : if( pSectHdl->IsEqualWidth() )
2910 : : {
2911 : 0 : pSectionContext->SetEvenlySpaced( true );
2912 : 0 : pSectionContext->SetColumnCount( (sal_Int16) (pSectHdl->GetNum() - 1) );
2913 : 0 : pSectionContext->SetColumnDistance( pSectHdl->GetSpace() );
2914 : 0 : pSectionContext->SetSeparatorLine( pSectHdl->IsSeparator() );
2915 : : }
2916 [ + + ]: 119 : else if( !pSectHdl->GetColumns().empty() )
2917 : : {
2918 : 6 : pSectionContext->SetEvenlySpaced( false );
2919 : 6 : pSectionContext->SetColumnDistance( pSectHdl->GetSpace() );
2920 : 6 : pSectionContext->SetColumnCount( (sal_Int16)(pSectHdl->GetColumns().size() -1));
2921 : 6 : std::vector<_Column>::const_iterator tmpIter = pSectHdl->GetColumns().begin();
2922 [ + - ][ + + ]: 18 : for (; tmpIter != pSectHdl->GetColumns().end(); ++tmpIter)
2923 : : {
2924 [ + - ]: 12 : pSectionContext->AppendColumnWidth( tmpIter->nWidth );
2925 [ + - ][ + - ]: 12 : if ((tmpIter != pSectHdl->GetColumns().end() - 1) || (tmpIter->nSpace > 0))
[ + + ][ - + ]
[ + - ][ + - ]
[ + - ][ + +
# # # # #
# ]
2926 [ + - ]: 6 : pSectionContext->AppendColumnSpacing( tmpIter->nSpace );
2927 : : }
2928 : 6 : pSectionContext->SetSeparatorLine( pSectHdl->IsSeparator() );
2929 : : }
2930 [ - + ]: 113 : else if( pSectHdl->GetNum() > 0 )
2931 : : {
2932 : 0 : pSectionContext->SetColumnCount( (sal_Int16)pSectHdl->GetNum() - 1 );
2933 : 0 : pSectionContext->SetColumnDistance( pSectHdl->GetSpace() );
2934 : : }
2935 [ + - ]: 119 : }
2936 [ + - ]: 119 : }
2937 : : }
2938 : : break;
2939 : : case NS_ooxml::LN_EG_SectPrContents_docGrid:
2940 [ + - ]: 179 : resolveSprmProps(*this, rSprm);
2941 : : break;
2942 : : case NS_ooxml::LN_EG_SectPrContents_pgBorders:
2943 : : {
2944 [ + - ]: 6 : writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
2945 [ + - ][ + - ]: 6 : if( pProperties.get( ) && pSectionContext )
[ + - ]
2946 : : {
2947 [ + - ][ + - ]: 6 : PageBordersHandlerPtr pHandler( new PageBordersHandler );
[ + - ]
2948 [ + - ]: 6 : pProperties->resolve( *pHandler );
2949 : :
2950 : : // Set the borders to the context and apply them to the styles
2951 [ + - ]: 6 : pHandler->SetBorders( pSectionContext );
2952 [ + - ]: 6 : pSectionContext->SetBorderParams( pHandler->GetDisplayOffset( ) );
2953 [ + - ]: 6 : }
2954 : : }
2955 : : break;
2956 : :
2957 : : case NS_ooxml::LN_CT_PPrBase_pStyle:
2958 : : {
2959 : 237 : m_pImpl->SetCurrentParaStyleId( sStringValue );
2960 [ + - ]: 237 : StyleSheetTablePtr pStyleTable = m_pImpl->GetStyleSheetTable();
2961 [ + - ]: 237 : const OUString sConvertedStyleName = pStyleTable->ConvertStyleName( sStringValue, true );
2962 [ + - ][ + - ]: 237 : if (m_pImpl->GetTopContext() && m_pImpl->GetTopContextType() != CONTEXT_SECTION)
[ + - ][ + - ]
[ + - ][ + - ]
[ + - # # ]
2963 [ + - ][ + - ]: 237 : m_pImpl->GetTopContext()->Insert( PROP_PARA_STYLE_NAME, true, uno::makeAny( sConvertedStyleName ));
[ + - ][ + - ]
2964 : : //apply numbering to paragraph if it was set at the style, but only if the paragraph itself
2965 : : //does not specify the numbering
2966 [ + - ][ + - ]: 237 : if( rContext->find( PropertyDefinition( PROP_NUMBERING_RULES, true )) == rContext->end()) // !contains
2967 : : {
2968 [ + - ]: 237 : const StyleSheetEntryPtr pEntry = pStyleTable->FindStyleSheetByISTD(sStringValue);
2969 : : OSL_ENSURE( pEntry.get(), "no style sheet found" );
2970 [ + - ][ - + ]: 237 : const StyleSheetPropertyMap* pStyleSheetProperties = dynamic_cast<const StyleSheetPropertyMap*>(pEntry ? pEntry->pProperties.get() : 0);
2971 : :
2972 [ + - ][ + + ]: 237 : if( pStyleSheetProperties && pStyleSheetProperties->GetListId() >= 0 )
[ + + ]
2973 : : rContext->Insert( PROP_NUMBERING_STYLE_NAME, true, uno::makeAny(
2974 [ + - ][ + - ]: 24 : ListDef::GetStyleName( pStyleSheetProperties->GetListId( ) ) ), false);
[ + - ]
2975 : :
2976 [ + - ][ + + ]: 237 : if( pStyleSheetProperties && pStyleSheetProperties->GetListLevel() >= 0 )
[ + + ]
2977 [ + - ][ + - ]: 237 : rContext->Insert( PROP_NUMBERING_LEVEL, true, uno::makeAny(pStyleSheetProperties->GetListLevel()), false);
[ + - ]
2978 [ + - ]: 237 : }
2979 : : }
2980 : : break;
2981 : : case NS_ooxml::LN_EG_RPrBase_rStyle:
2982 : : {
2983 [ + - ][ + - ]: 21 : OUString sConvertedName( m_pImpl->GetStyleSheetTable()->ConvertStyleName( sStringValue, true ) );
[ + - ]
2984 : : // First check if the style exists in the document.
2985 [ + - ][ + - ]: 21 : StyleSheetEntryPtr pEntry = m_pImpl->GetStyleSheetTable( )->FindStyleSheetByStyleName( sConvertedName );
[ + - ]
2986 [ + + ][ + - ]: 21 : bool bExists = pEntry.get( ) && ( pEntry->nStyleTypeCode == STYLE_TYPE_CHAR );
2987 : :
2988 : : // Add the property if the style exists
2989 [ + + ][ + - ]: 21 : if ( bExists && m_pImpl->GetTopContext() )
[ + - ][ + + ]
[ + - ]
[ + + # # ]
2990 [ + - ][ + - ]: 21 : m_pImpl->GetTopContext()->Insert( PROP_CHAR_STYLE_NAME, true, uno::makeAny( sConvertedName ) );
[ + - ][ + - ]
[ + - ]
2991 : : }
2992 : : break;
2993 : : case NS_ooxml::LN_CT_TblPrBase_tblCellMar: //cell margins
2994 : : {
2995 [ # # ]: 0 : resolveSprmProps(*this, rSprm);//contains LN_CT_TblCellMar_top, LN_CT_TblCellMar_left, LN_CT_TblCellMar_bottom, LN_CT_TblCellMar_right
2996 : : }
2997 : : break;
2998 : : case NS_ooxml::LN_CT_TblCellMar_top:
2999 : : case NS_ooxml::LN_CT_TblCellMar_start:
3000 : : case NS_ooxml::LN_CT_TblCellMar_left:
3001 : : case NS_ooxml::LN_CT_TblCellMar_bottom:
3002 : : case NS_ooxml::LN_CT_TblCellMar_end:
3003 : : case NS_ooxml::LN_CT_TblCellMar_right:
3004 : : {
3005 [ # # ]: 0 : writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
3006 [ # # ]: 0 : if( pProperties.get())
3007 : : {
3008 [ # # ][ # # ]: 0 : MeasureHandlerPtr pMeasureHandler( new MeasureHandler );
[ # # ]
3009 [ # # ]: 0 : pProperties->resolve(*pMeasureHandler);
3010 [ # # ]: 0 : sal_Int32 nMeasureValue = pMeasureHandler->getMeasureValue();
3011 : 0 : PropertyIds eId = META_PROP_CELL_MAR_TOP;
3012 : 0 : bool rtl = false; // TODO
3013 [ # # # # : 0 : switch(nSprmId)
# # # ]
3014 : : {
3015 : : case NS_ooxml::LN_CT_TblCellMar_top:
3016 : 0 : break;
3017 : : case NS_ooxml::LN_CT_TblCellMar_start:
3018 [ # # ]: 0 : eId = rtl ? META_PROP_CELL_MAR_RIGHT : META_PROP_CELL_MAR_LEFT;
3019 : 0 : break;
3020 : : case NS_ooxml::LN_CT_TblCellMar_left:
3021 : 0 : eId = META_PROP_CELL_MAR_LEFT;
3022 : 0 : break;
3023 : : case NS_ooxml::LN_CT_TblCellMar_bottom:
3024 : 0 : eId = META_PROP_CELL_MAR_BOTTOM;
3025 : 0 : break;
3026 : : case NS_ooxml::LN_CT_TblCellMar_end:
3027 [ # # ]: 0 : eId = rtl ? META_PROP_CELL_MAR_LEFT : META_PROP_CELL_MAR_RIGHT;
3028 : 0 : break;
3029 : : case NS_ooxml::LN_CT_TblCellMar_right:
3030 : 0 : eId = META_PROP_CELL_MAR_RIGHT;
3031 : 0 : break;
3032 : : default:;
3033 : : }
3034 [ # # ][ # # ]: 0 : rContext->Insert( eId, false, uno::makeAny(nMeasureValue), false);
[ # # ]
3035 [ # # ]: 0 : }
3036 : : }
3037 : : break;
3038 : : case NS_sprm::LN_CFNoProof: //0x875 no grammar and spell checking, unsupported
3039 : : break;
3040 : : case NS_ooxml::LN_anchor_anchor: // at_character drawing
3041 : : case NS_ooxml::LN_inline_inline: // as_character drawing
3042 : : {
3043 [ + - ]: 30 : writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
3044 [ + - ]: 30 : if( pProperties.get())
3045 : : {
3046 : : GraphicImportType eGraphicType =
3047 : : (NS_ooxml::LN_anchor_anchor ==
3048 : 30 : sal::static_int_cast<Id>(nSprmId)) ?
3049 : : IMPORT_AS_DETECTED_ANCHOR :
3050 [ + + ]: 30 : IMPORT_AS_DETECTED_INLINE;
3051 : : GraphicImportPtr pGraphicImport =
3052 [ + - ]: 30 : m_pImpl->GetGraphicImport(eGraphicType);
3053 [ + - ]: 30 : pProperties->resolve(*pGraphicImport);
3054 [ + - ][ + - ]: 30 : m_pImpl->ImportGraphic(pProperties, eGraphicType);
[ + - ]
3055 [ + - ][ - + ]: 30 : if( !pGraphicImport->IsGraphic() )
3056 : : {
3057 [ # # ]: 0 : m_pImpl->ResetGraphicImport();
3058 : : // todo: It's a shape, now start shape import
3059 [ + - ]: 30 : }
3060 [ + - ]: 30 : }
3061 : : }
3062 : : break;
3063 : : case NS_ooxml::LN_EG_RPrBase_vertAlign:
3064 : : {
3065 : 6 : sal_Int16 nEscapement = 0;
3066 : 6 : sal_Int8 nProp = 58;
3067 [ + - ]: 6 : if ( sStringValue == "superscript" )
3068 : 6 : nEscapement = 101;
3069 [ # # ]: 0 : else if ( sStringValue == "subscript" )
3070 : 0 : nEscapement = -101;
3071 : : else
3072 : 0 : nProp = 100;
3073 : :
3074 [ + - ][ + - ]: 6 : rContext->Insert(PROP_CHAR_ESCAPEMENT, true, uno::makeAny( nEscapement ) );
3075 [ + - ][ + - ]: 6 : rContext->Insert(PROP_CHAR_ESCAPEMENT_HEIGHT, true, uno::makeAny( nProp ) );
3076 : : }
3077 : : break;
3078 : : case NS_ooxml::LN_CT_FtnProps_pos:
3079 : : //footnotes in word can be at page end or beneath text - writer supports only the first
3080 : : //endnotes in word can be at section end or document end - writer supports only the latter
3081 : : // -> so this property can be ignored
3082 : : break;
3083 : : case NS_ooxml::LN_EG_FtnEdnNumProps_numStart:
3084 : : case NS_ooxml::LN_EG_FtnEdnNumProps_numRestart:
3085 : : case NS_ooxml::LN_CT_FtnProps_numFmt:
3086 : : case NS_ooxml::LN_CT_EdnProps_numFmt:
3087 : : {
3088 : : try
3089 : : {
3090 : 1410 : uno::Reference< beans::XPropertySet > xFtnEdnSettings;
3091 [ + + ]: 1410 : if( m_pImpl->IsInFootnoteProperties() )
3092 : : {
3093 [ + - ][ + - ]: 846 : uno::Reference< text::XFootnotesSupplier> xFootnotesSupplier( m_pImpl->GetTextDocument(), uno::UNO_QUERY );
3094 [ + + ]: 846 : if (xFootnotesSupplier.is())
3095 [ + - ][ + - ]: 846 : xFtnEdnSettings = xFootnotesSupplier->getFootnoteSettings();
[ + - ]
3096 : : }
3097 : : else
3098 : : {
3099 [ + - ][ + - ]: 564 : uno::Reference< text::XEndnotesSupplier> xEndnotesSupplier( m_pImpl->GetTextDocument(), uno::UNO_QUERY );
3100 [ + + ]: 564 : if (xEndnotesSupplier.is())
3101 [ + - ][ + - ]: 564 : xFtnEdnSettings = xEndnotesSupplier->getEndnoteSettings();
[ + - ]
3102 : : }
3103 [ + + ][ + + ]: 1410 : if( NS_ooxml::LN_EG_FtnEdnNumProps_numStart == nSprmId && xFtnEdnSettings.is())
[ + + ]
3104 : : {
3105 [ + - ]: 252 : xFtnEdnSettings->setPropertyValue(
3106 [ + - ][ + - ]: 252 : PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_START_AT),
3107 [ + - ][ + - ]: 504 : uno::makeAny( sal_Int16( nIntValue - 1 )));
3108 : : }
3109 [ + + ][ + + ]: 1158 : else if( NS_ooxml::LN_EG_FtnEdnNumProps_numRestart == nSprmId && xFtnEdnSettings.is())
[ + + ]
3110 : : {
3111 : 126 : sal_Int16 nFootnoteCounting = 0;
3112 [ + - - - ]: 126 : switch (nIntValue)
3113 : : {
3114 : 126 : case NS_ooxml::LN_Value_ST_RestartNumber_continuous: nFootnoteCounting = text::FootnoteNumbering::PER_DOCUMENT; break;
3115 : 0 : case NS_ooxml::LN_Value_ST_RestartNumber_eachPage: nFootnoteCounting = text::FootnoteNumbering::PER_PAGE; break;
3116 : 0 : case NS_ooxml::LN_Value_ST_RestartNumber_eachSect: nFootnoteCounting = text::FootnoteNumbering::PER_CHAPTER; break;
3117 : 0 : default: break;
3118 : : }
3119 [ + - ]: 126 : xFtnEdnSettings->setPropertyValue(
3120 [ + - ][ + - ]: 126 : PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_FOOTNOTE_COUNTING ),
3121 [ + - ][ + - ]: 252 : uno::makeAny( nFootnoteCounting ));
3122 : : }
3123 [ + + ]: 1032 : else if (xFtnEdnSettings.is())
3124 : : {
3125 [ + - ]: 252 : sal_Int16 nNumType = ConversionHelper::ConvertNumberingType( nIntValue );
3126 [ + - ]: 252 : xFtnEdnSettings->setPropertyValue(
3127 [ + - ][ + - ]: 252 : PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_NUMBERING_TYPE),
3128 [ + - ][ + - ]: 504 : uno::makeAny( nNumType ));
3129 [ # # ]: 1410 : }
3130 : : }
3131 [ # # ]: 0 : catch( const uno::Exception& )
3132 : : {
3133 : : }
3134 : : }
3135 : : break;
3136 : : case NS_ooxml::LN_paratrackchange:
3137 [ # # ]: 0 : m_pImpl->StartParaChange( );
3138 : : case NS_ooxml::LN_trackchange:
3139 : : case NS_ooxml::LN_EG_RPrContent_rPrChange:
3140 : : {
3141 [ # # ]: 0 : m_pImpl->AddNewRedline( );
3142 [ # # ]: 0 : resolveSprmProps(*this, rSprm );
3143 : : // now the properties author, date and id should be available
3144 [ # # ]: 0 : sal_Int32 nToken = m_pImpl->GetCurrentRedlineToken();
3145 [ # # ]: 0 : switch( nToken & 0xffff )
3146 : : {
3147 : : case ooxml::OOXML_mod :
3148 : : case ooxml::OOXML_ins :
3149 : 0 : case ooxml::OOXML_del : break;
3150 : : default: OSL_FAIL( "redline token other than mod, ins or del" );
3151 : : }
3152 [ # # ]: 0 : m_pImpl->EndParaChange( );
3153 : : }
3154 : : break;
3155 : : case NS_ooxml::LN_CT_RPrChange_rPr:
3156 : : break;
3157 : : case NS_ooxml::LN_object:
3158 : : {
3159 [ + - ]: 42 : writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
3160 [ + - ]: 42 : if( pProperties.get( ) )
3161 : : {
3162 [ + - ][ + - ]: 42 : OLEHandlerPtr pOLEHandler( new OLEHandler );
[ + - ]
3163 [ + - ]: 42 : pProperties->resolve(*pOLEHandler);
3164 [ - + ]: 42 : if ( pOLEHandler->isOLEObject( ) )
3165 : : {
3166 [ # # ][ # # ]: 0 : OUString sStreamName = pOLEHandler->copyOLEOStream( m_pImpl->GetTextDocument() );
3167 [ # # ]: 0 : if( !sStreamName.isEmpty() )
3168 : : {
3169 [ # # ][ # # ]: 0 : m_pImpl->appendOLE( sStreamName, pOLEHandler );
[ # # ]
3170 : 0 : }
3171 [ + - ]: 42 : }
3172 [ + - ]: 42 : }
3173 : : }
3174 : : break;
3175 : : case NS_ooxml::LN_EG_HdrFtrReferences_headerReference: // header reference - not needed
3176 : : case NS_ooxml::LN_EG_HdrFtrReferences_footerReference: // footer reference - not needed
3177 : : break;
3178 : : case NS_ooxml::LN_EG_RPrBase_snapToGrid: // "Use document grid settings for inter-paragraph spacing"
3179 : : break;
3180 : : case NS_sprm::LN_PContextualSpacing:
3181 [ + - ][ + - ]: 246 : rContext->Insert(PROP_PARA_CONTEXT_MARGIN, true, uno::makeAny( sal_Bool( nIntValue ) ));
3182 : : break;
3183 : : case NS_ooxml::LN_EG_SectPrContents_formProt: //section protection, only form editing is enabled - unsupported
3184 : : case NS_ooxml::LN_EG_SectPrContents_vAlign:
3185 : : case NS_ooxml::LN_EG_RPrBase_fitText:
3186 : : break;
3187 : : case NS_ooxml::LN_ffdata:
3188 : : {
3189 [ + - ]: 21 : writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
3190 [ + - ]: 21 : if (pProperties.get() != NULL)
3191 : : {
3192 [ + - ][ + - ]: 21 : FFDataHandler::Pointer_t pFFDataHandler(new FFDataHandler());
[ + - ]
3193 : :
3194 [ + - ]: 21 : pProperties->resolve(*pFFDataHandler);
3195 [ + - ][ + - ]: 21 : m_pImpl->SetFieldFFData(pFFDataHandler);
[ + - ][ + - ]
3196 [ + - ]: 61121 : }
3197 : : }
3198 : : break;
3199 : : default:
3200 : : {
3201 : : #ifdef DEBUG_DOMAINMAPPER
3202 : : dmapper_logger->startElement("unhandled");
3203 : : dmapper_logger->attribute("id", nSprmId);
3204 : : dmapper_logger->attribute("name", rSprm.getName());
3205 : : dmapper_logger->endElement();
3206 : : #endif
3207 : : }
3208 [ + - ]: 61121 : }
3209 : : }
3210 : :
3211 : :
3212 : 12033 : void DomainMapper::processDeferredCharacterProperties( const std::map< sal_Int32, uno::Any >& deferredCharacterProperties )
3213 : : {
3214 : : assert( m_pImpl->GetTopContextType() == CONTEXT_CHARACTER );
3215 [ + - ]: 12033 : PropertyMapPtr rContext = m_pImpl->GetTopContext();
3216 [ + + ]: 49440 : for( std::map< sal_Int32, uno::Any >::const_iterator it = deferredCharacterProperties.begin();
3217 : 24720 : it != deferredCharacterProperties.end();
3218 : : ++it )
3219 : : {
3220 : 12687 : sal_Int32 Id = it->first;
3221 : 12687 : sal_Int32 nIntValue = 0;
3222 : 12687 : OUString sStringValue;
3223 : 12687 : it->second >>= nIntValue;
3224 : 12687 : it->second >>= sStringValue;
3225 [ + + - ]: 12687 : switch( Id )
3226 : : {
3227 : : case NS_sprm::LN_CHps:
3228 : : case NS_sprm::LN_CHpsBi:
3229 : 12678 : break; // only for use by other properties, ignore here
3230 : : case NS_sprm::LN_CHpsPos:
3231 : : {
3232 : 9 : sal_Int16 nEscapement = 0;
3233 : 9 : sal_Int8 nProp = 100;
3234 [ - + ]: 9 : if(nIntValue == 0)
3235 : 0 : nProp = 0;
3236 : : else
3237 : : {
3238 [ + - ]: 9 : std::map< sal_Int32, uno::Any >::const_iterator font = deferredCharacterProperties.find( NS_sprm::LN_CHps );
3239 [ + - ]: 9 : if( font != deferredCharacterProperties.end())
3240 : : {
3241 : 9 : double fontSize = 0;
3242 : 9 : font->second >>= fontSize;
3243 : 9 : nEscapement = nIntValue * 100 / fontSize;
3244 : : }
3245 : : else
3246 : : { // TODO: Find out the font size. The 58/-58 values were here previous, but I have
3247 : : // no idea what they are (they are probably some random guess that did fit whatever
3248 : : // specific case somebody was trying to fix).
3249 [ # # ]: 9 : nEscapement = ( nIntValue > 0 ) ? 58: -58;
3250 : : }
3251 : : }
3252 [ + - ][ + - ]: 9 : rContext->Insert(PROP_CHAR_ESCAPEMENT, true, uno::makeAny( nEscapement ) );
3253 [ + - ][ + - ]: 9 : rContext->Insert(PROP_CHAR_ESCAPEMENT_HEIGHT, true, uno::makeAny( nProp ) );
3254 : : }
3255 : 9 : break; // sprmCHpsPos
3256 : : default:
3257 : : SAL_WARN( "writerfilter", "Unhandled property in processDeferredCharacterProperty()" );
3258 : 0 : break;
3259 : : }
3260 [ + - ]: 24720 : }
3261 : 12033 : }
3262 : :
3263 : 0 : void DomainMapper::lcl_entry(int /*pos*/,
3264 : : writerfilter::Reference<Properties>::Pointer_t ref)
3265 : : {
3266 : 0 : ref->resolve(*this);
3267 : 0 : }
3268 : :
3269 : 0 : void DomainMapper::data(const sal_uInt8* /*buf*/, size_t /*len*/,
3270 : : writerfilter::Reference<Properties>::Pointer_t /*ref*/)
3271 : : {
3272 : 0 : }
3273 : :
3274 : 530 : void DomainMapper::lcl_startSectionGroup()
3275 : : {
3276 : 530 : m_pImpl->PushProperties(CONTEXT_SECTION);
3277 : 530 : }
3278 : :
3279 : 524 : void DomainMapper::lcl_endSectionGroup()
3280 : : {
3281 [ + - ]: 524 : m_pImpl->CheckUnregisteredFrameConversion();
3282 [ + - ]: 524 : m_pImpl->ExecuteFrameConversion();
3283 [ + - ]: 524 : PropertyMapPtr pContext = m_pImpl->GetTopContextOfType(CONTEXT_SECTION);
3284 [ - + ]: 524 : SectionPropertyMap* pSectionContext = dynamic_cast< SectionPropertyMap* >( pContext.get() );
3285 : : OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3286 [ + - ]: 524 : if(pSectionContext)
3287 [ + - ]: 524 : pSectionContext->CloseSectionGroup( *m_pImpl );
3288 [ + - ][ + - ]: 524 : m_pImpl->PopProperties(CONTEXT_SECTION);
3289 : 524 : }
3290 : :
3291 : 2591 : void DomainMapper::lcl_startParagraphGroup()
3292 : : {
3293 : 2591 : m_pImpl->getTableManager().startParagraphGroup();
3294 : 2591 : m_pImpl->PushProperties(CONTEXT_PARAGRAPH);
3295 [ + - ][ + + ]: 2591 : static OUString sDefault("Standard");
3296 [ + - ]: 2591 : if (m_pImpl->GetTopContext())
3297 : : {
3298 [ + + ]: 2591 : if (!m_pImpl->IsInShape())
3299 : : {
3300 [ + - ][ + - ]: 2465 : m_pImpl->GetTopContext()->Insert( PROP_PARA_STYLE_NAME, true, uno::makeAny( sDefault ) );
[ + - ]
3301 : 2465 : m_pImpl->SetCurrentParaStyleId(sDefault);
3302 : : }
3303 [ + + ]: 2591 : if (m_pImpl->isBreakDeferred(PAGE_BREAK))
3304 [ + - ][ + - ]: 150 : m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_PAGE_BEFORE) );
[ + - ][ + - ]
3305 [ - + ]: 2441 : else if (m_pImpl->isBreakDeferred(COLUMN_BREAK))
3306 [ # # ][ # # ]: 0 : m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_COLUMN_BEFORE) );
[ # # ][ # # ]
3307 : : }
3308 : 2591 : m_pImpl->clearDeferredBreaks();
3309 : 2591 : }
3310 : :
3311 : 2555 : void DomainMapper::lcl_endParagraphGroup()
3312 : : {
3313 : 2555 : m_pImpl->PopProperties(CONTEXT_PARAGRAPH);
3314 : 2555 : m_pImpl->getTableManager().endParagraphGroup();
3315 : : //frame conversion has to be executed after table conversion
3316 : 2555 : m_pImpl->ExecuteFrameConversion();
3317 : 2555 : }
3318 : :
3319 : 209 : void DomainMapper::markLastParagraphInSection( )
3320 : : {
3321 : 209 : m_pImpl->SetIsLastParagraphInSection( true );
3322 : 209 : }
3323 : :
3324 : 75 : void DomainMapper::lcl_startShape( uno::Reference< drawing::XShape > xShape )
3325 : : {
3326 [ + - ]: 75 : m_pImpl->PushShapeContext( xShape );
3327 : 75 : lcl_startParagraphGroup();
3328 : 75 : }
3329 : :
3330 : 75 : void DomainMapper::lcl_endShape( )
3331 : : {
3332 : 75 : lcl_endParagraphGroup();
3333 : 75 : m_pImpl->PopShapeContext( );
3334 : 75 : }
3335 : :
3336 : 7056 : void DomainMapper::PushStyleSheetProperties( PropertyMapPtr pStyleProperties, bool bAffectTableMngr )
3337 : : {
3338 [ + - ]: 7056 : m_pImpl->PushStyleProperties( pStyleProperties );
3339 [ - + ]: 7056 : if ( bAffectTableMngr )
3340 [ # # ][ # # ]: 0 : m_pImpl->getTableManager( ).SetStyleProperties( pStyleProperties );
3341 : 7056 : }
3342 : :
3343 : 7056 : void DomainMapper::PopStyleSheetProperties( bool bAffectTableMngr )
3344 : : {
3345 : 7056 : m_pImpl->PopProperties( CONTEXT_STYLESHEET );
3346 [ - + ]: 7056 : if ( bAffectTableMngr )
3347 : : {
3348 [ # # ]: 0 : PropertyMapPtr emptyPtr;
3349 [ # # ][ # # ]: 0 : m_pImpl->getTableManager( ).SetStyleProperties( emptyPtr );
[ # # ][ # # ]
[ # # ]
3350 : : }
3351 : 7056 : }
3352 : :
3353 : 315 : void DomainMapper::PushListProperties( ::boost::shared_ptr<PropertyMap> pListProperties )
3354 : : {
3355 [ + - ]: 315 : m_pImpl->PushListProperties( pListProperties );
3356 : 315 : }
3357 : :
3358 : 315 : void DomainMapper::PopListProperties()
3359 : : {
3360 : 315 : m_pImpl->PopProperties( CONTEXT_LIST );
3361 : 315 : }
3362 : :
3363 : 14511 : void DomainMapper::lcl_startCharacterGroup()
3364 : : {
3365 : 14511 : m_pImpl->PushProperties(CONTEXT_CHARACTER);
3366 : 14511 : DomainMapperTableManager& rTableManager = m_pImpl->getTableManager();
3367 [ + + ]: 14511 : if( !rTableManager.getTableStyleName().isEmpty() )
3368 : : {
3369 [ + - ]: 98 : PropertyMapPtr pTopContext = m_pImpl->GetTopContext();
3370 [ + - ][ + - ]: 98 : rTableManager.CopyTextProperties(pTopContext, m_pImpl->GetStyleSheetTable());
[ + - ][ + - ]
[ + - ][ + - ]
3371 : : }
3372 : 14511 : }
3373 : :
3374 : 14478 : void DomainMapper::lcl_endCharacterGroup()
3375 : : {
3376 : 14478 : m_pImpl->PopProperties(CONTEXT_CHARACTER);
3377 : 14478 : }
3378 : :
3379 : 1608 : void DomainMapper::lcl_text(const sal_uInt8 * data_, size_t len)
3380 : : {
3381 : : //TODO: Determine the right text encoding (FIB?)
3382 [ + - ]: 1608 : OUString sText( (const sal_Char*) data_, len, RTL_TEXTENCODING_MS_1252 );
3383 : : #ifdef DEBUG_DOMAINMAPPER
3384 : : dmapper_logger->startElement("text");
3385 : : dmapper_logger->chars(sText);
3386 : : dmapper_logger->endElement();
3387 : : #endif
3388 : :
3389 : : try
3390 : : {
3391 [ + - ]: 1608 : if(len == 1)
3392 : : {
3393 [ + - - + : 1608 : switch(*data_)
+ + + -
- ]
3394 : : {
3395 : : case 0x02: return; //footnote character
3396 : : case 0x0c: //page break
3397 [ + - ]: 156 : m_pImpl->deferBreak(PAGE_BREAK);
3398 : : return;
3399 : : case 0x0e: //column break
3400 [ # # ]: 0 : m_pImpl->deferBreak(COLUMN_BREAK);
3401 : : return;
3402 : : case 0x07:
3403 [ # # ][ # # ]: 0 : m_pImpl->getTableManager().text(data_, len);
3404 : : case 0x0d:
3405 [ + - ][ + - ]: 1338 : m_pImpl->finishParagraph(m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH));
[ + - ]
3406 : : return;
3407 : : case 0x13:
3408 [ + - ]: 39 : m_pImpl->PushFieldContext();
3409 : : return;
3410 : : case 0x14:
3411 : : // delimiter not necessarily available
3412 : : // appears only if field contains further content
3413 [ + - ]: 36 : m_pImpl->CloseFieldCommand();
3414 : : return;
3415 : : case 0x15: /* end of field */
3416 [ + - ]: 39 : m_pImpl->PopFieldContext();
3417 : : return;
3418 : : default:
3419 : 0 : break;
3420 : : }
3421 : : }
3422 : :
3423 [ # # ]: 0 : PropertyMapPtr pContext = m_pImpl->GetTopContext();
3424 [ # # ][ # # ]: 0 : if ( pContext && !pContext->GetFootnote().is() )
[ # # ][ # # ]
3425 : : {
3426 [ # # ][ # # ]: 0 : if (m_pImpl->isBreakDeferred(PAGE_BREAK))
3427 [ # # ][ # # ]: 0 : m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_PAGE_BEFORE) );
[ # # ][ # # ]
3428 [ # # ][ # # ]: 0 : else if (m_pImpl->isBreakDeferred(COLUMN_BREAK))
3429 [ # # ][ # # ]: 0 : m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_COLUMN_BEFORE) );
[ # # ][ # # ]
3430 [ # # ]: 0 : m_pImpl->clearDeferredBreaks();
3431 : : }
3432 : :
3433 [ # # ][ # # ]: 0 : if( pContext->GetFootnote().is() && m_pImpl->IsCustomFtnMark() )
[ # # ][ # # ]
3434 : : {
3435 [ # # ][ # # ]: 0 : pContext->GetFootnote()->setLabel( sText );
[ # # ]
3436 : 0 : m_pImpl->SetCustomFtnMark( false );
3437 : : //otherwise ignore sText
3438 : : }
3439 [ # # ][ # # ]: 0 : else if( m_pImpl->IsOpenFieldCommand() )
3440 [ # # ]: 0 : m_pImpl->AppendFieldCommand(sText);
3441 [ # # ][ # # ]: 0 : else if( m_pImpl->IsOpenField() && m_pImpl->IsFieldResultAsString())
[ # # ][ # # ]
[ # # ]
3442 : : /*depending on the success of the field insert operation this result will be
3443 : : set at the field or directly inserted into the text*/
3444 [ # # ]: 0 : m_pImpl->SetFieldResult( sText );
3445 : : else
3446 : : {
3447 [ # # ]: 0 : if (pContext == NULL)
3448 [ # # ][ # # ]: 0 : pContext.reset(new PropertyMap());
[ # # ]
3449 : :
3450 [ # # ][ # # ]: 0 : m_pImpl->appendTextPortion( sText, pContext );
[ # # ]
3451 [ # # ][ # # ]: 1608 : }
3452 : : }
3453 [ # # ]: 0 : catch( const uno::RuntimeException& e )
3454 : : {
3455 : : SAL_WARN("writerfilter", "failed. Message :" << e.Message);
3456 [ - + ]: 1608 : }
3457 : : }
3458 : :
3459 : 13650 : void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len)
3460 : : {
3461 : 13650 : OUString sText;
3462 : 13650 : OUStringBuffer aBuffer = OUStringBuffer(len);
3463 [ + - ]: 13650 : aBuffer.append( (const sal_Unicode *) data_, len);
3464 [ + - ]: 13650 : sText = aBuffer.makeStringAndClear();
3465 : :
3466 : : try
3467 : : {
3468 [ + - ][ + - ]: 13650 : m_pImpl->getTableManager().utext(data_, len);
3469 : :
3470 : : // RTF always uses text() instead of utext() for run break
3471 [ + + ][ + + ]: 13650 : if(len == 1 && ((*data_) == 0x0d || (*data_) == 0x07) && !IsRTFImport())
[ + + ][ + - ]
[ + + ][ + + ]
3472 : : {
3473 [ + - ][ + + ]: 785 : bool bSingleParagraph = m_pImpl->GetIsFirstParagraphInSection() && m_pImpl->GetIsLastParagraphInSection();
[ + - ][ + + ]
3474 : : // If the paragraph contains only the section properties and it has
3475 : : // no runs, we should not create a paragraph for it in Writer, unless that would remove the whole section.
3476 [ + - ][ + + ]: 785 : bool bRemove = !m_pImpl->GetParaChanged() && m_pImpl->GetParaSectpr() && !bSingleParagraph;
[ + - ][ + + ]
[ + + ]
3477 [ + - ]: 785 : m_pImpl->SetParaSectpr(false);
3478 [ + - ][ + - ]: 785 : m_pImpl->finishParagraph(m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH));
[ + - ]
3479 [ + + ]: 785 : if (bRemove)
3480 [ + - ]: 12 : m_pImpl->RemoveLastParagraph();
3481 : : }
3482 : : else
3483 : : {
3484 : :
3485 [ + - ]: 12865 : PropertyMapPtr pContext = m_pImpl->GetTopContext();
3486 [ + - ][ + - ]: 12865 : if ( pContext && !pContext->GetFootnote().is() )
[ + - ][ + - ]
3487 : : {
3488 [ + - ][ + + ]: 12865 : if (m_pImpl->isBreakDeferred(PAGE_BREAK))
3489 [ + - ][ + - ]: 6 : m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_PAGE_BEFORE) );
[ + - ][ + - ]
3490 [ + - ][ - + ]: 12859 : else if (m_pImpl->isBreakDeferred(COLUMN_BREAK))
3491 [ # # ][ # # ]: 0 : m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_COLUMN_BEFORE) );
[ # # ][ # # ]
3492 [ + - ]: 12865 : m_pImpl->clearDeferredBreaks();
3493 : : }
3494 : :
3495 [ + - ][ + - ]: 12865 : if( pContext && pContext->GetFootnote().is() )
[ - + ][ - + ]
3496 : : {
3497 [ # # ]: 0 : if( !pContext->GetFootnoteSymbol() )
3498 [ # # ][ # # ]: 0 : pContext->GetFootnote()->setLabel( sText );
[ # # ]
3499 : : //otherwise ignore sText
3500 : : }
3501 [ + - ][ + + ]: 12865 : else if( m_pImpl->IsOpenFieldCommand() )
3502 [ + - ]: 90 : m_pImpl->AppendFieldCommand(sText);
3503 [ + - ][ + + ]: 12775 : else if( m_pImpl->IsOpenField() && m_pImpl->IsFieldResultAsString())
[ + - ][ + + ]
[ + + ]
3504 : : /*depending on the success of the field insert operation this result will be
3505 : : set at the field or directly inserted into the text*/
3506 [ + - ]: 12 : m_pImpl->SetFieldResult( sText );
3507 : : else
3508 : : {
3509 [ - + ]: 12763 : if (pContext == NULL)
3510 [ # # ][ # # ]: 0 : pContext.reset(new PropertyMap());
[ # # ]
3511 : :
3512 [ + - ][ + - ]: 12763 : m_pImpl->appendTextPortion( sText, pContext );
[ + - ]
3513 [ + - ][ # # ]: 12865 : }
3514 : :
3515 : : }
3516 : : }
3517 [ # # ]: 0 : catch( const uno::RuntimeException& )
3518 : : {
3519 : 13650 : }
3520 : 13650 : }
3521 : :
3522 : 17500 : void DomainMapper::lcl_props(writerfilter::Reference<Properties>::Pointer_t ref)
3523 : : {
3524 [ + - ]: 17500 : string sType = ref->getType();
3525 [ + - ][ - + ]: 17500 : if( sType == "PICF" )
3526 : : {
3527 [ # # ][ # # ]: 0 : m_pImpl->ImportGraphic(ref, IMPORT_AS_GRAPHIC);
[ # # ]
3528 : : }
3529 [ + - ][ - + ]: 17500 : else if( sType == "FSPA" )
3530 : : {
3531 [ # # ][ # # ]: 0 : m_pImpl->ImportGraphic(ref, IMPORT_AS_SHAPE);
[ # # ]
3532 : : }
3533 : : else
3534 [ + - ]: 17500 : ref->resolve(*this);
3535 : 17500 : }
3536 : :
3537 : 1250 : void DomainMapper::lcl_table(Id name, writerfilter::Reference<Table>::Pointer_t ref)
3538 : : {
3539 : 1250 : m_pImpl->SetAnyTableImport(true);
3540 [ + + + - : 1250 : switch(name)
+ + - ]
3541 : : {
3542 : : case NS_rtf::LN_FONTTABLE:
3543 : :
3544 : : // create a font table object that listens to the attributes
3545 : : // each entry call inserts a new font entry
3546 [ + - ]: 341 : ref->resolve( *m_pImpl->GetFontTable() );
3547 : 341 : break;
3548 : : case NS_rtf::LN_STYLESHEET:
3549 : : //same as above to import style sheets
3550 : 305 : m_pImpl->SetStyleSheetImport( true );
3551 [ + - ]: 305 : ref->resolve( *m_pImpl->GetStyleSheetTable() );
3552 [ + - ][ + - ]: 305 : m_pImpl->GetStyleSheetTable()->ApplyStyleSheets(m_pImpl->GetFontTable());
[ + - ]
3553 : 305 : m_pImpl->SetStyleSheetImport( false );
3554 : 305 : break;
3555 : : case NS_ooxml::LN_NUMBERING:
3556 : : case NS_rtf::LN_LISTTABLE:
3557 : : {
3558 : :
3559 : : //the same for list tables
3560 [ + - ]: 42 : ref->resolve( *m_pImpl->GetListTable() );
3561 [ + - ]: 42 : m_pImpl->GetListTable( )->CreateNumberingRules( );
3562 : : }
3563 : 42 : break;
3564 : : case NS_rtf::LN_LFOTABLE:
3565 : : {
3566 : 0 : m_pImpl->GetListTable( )->SetLFOImport( true );
3567 [ # # ]: 0 : ref->resolve( *m_pImpl->GetListTable() );
3568 [ # # ]: 0 : m_pImpl->GetListTable( )->CreateNumberingRules( );
3569 : 0 : m_pImpl->GetListTable( )->SetLFOImport( false );
3570 : : }
3571 : 0 : break;
3572 : : case NS_ooxml::LN_THEMETABLE:
3573 [ + - ]: 83 : ref->resolve ( *m_pImpl->GetThemeTable() );
3574 : 83 : break;
3575 : : case NS_ooxml::LN_settings_settings:
3576 [ + - ]: 479 : ref->resolve ( *m_pImpl->GetSettingsTable() );
3577 : 479 : m_pImpl->ApplySettingsTable();
3578 : 479 : break;
3579 : : default:
3580 : : OSL_FAIL( "which table is to be filled here?");
3581 : : }
3582 : 1250 : m_pImpl->SetAnyTableImport(false);
3583 : 1250 : }
3584 : :
3585 : 57 : void DomainMapper::lcl_substream(Id rName, ::writerfilter::Reference<Stream>::Pointer_t ref)
3586 : : {
3587 : 57 : m_pImpl->appendTableManager( );
3588 : : // Appending a TableManager resets its TableHandler, so we need to append
3589 : : // that as well, or tables won't be imported properly in headers/footers.
3590 : 57 : m_pImpl->appendTableHandler( );
3591 : 57 : m_pImpl->getTableManager().startLevel();
3592 : :
3593 : : //import of page header/footer
3594 : :
3595 [ + + + + : 57 : switch( rName )
+ + + +
- ]
3596 : : {
3597 : : case NS_rtf::LN_headerl:
3598 : :
3599 : 3 : m_pImpl->PushPageHeader(SectionPropertyMap::PAGE_LEFT);
3600 : 3 : break;
3601 : : case NS_rtf::LN_headerr:
3602 : :
3603 : 27 : m_pImpl->PushPageHeader(SectionPropertyMap::PAGE_RIGHT);
3604 : 27 : break;
3605 : : case NS_rtf::LN_headerf:
3606 : :
3607 : 3 : m_pImpl->PushPageHeader(SectionPropertyMap::PAGE_FIRST);
3608 : 3 : break;
3609 : : case NS_rtf::LN_footerl:
3610 : :
3611 : 3 : m_pImpl->PushPageFooter(SectionPropertyMap::PAGE_LEFT);
3612 : 3 : break;
3613 : : case NS_rtf::LN_footerr:
3614 : :
3615 : 3 : m_pImpl->PushPageFooter(SectionPropertyMap::PAGE_RIGHT);
3616 : 3 : break;
3617 : : case NS_rtf::LN_footerf:
3618 : :
3619 : 3 : m_pImpl->PushPageFooter(SectionPropertyMap::PAGE_FIRST);
3620 : 3 : break;
3621 : : case NS_rtf::LN_footnote:
3622 : : case NS_rtf::LN_endnote:
3623 : 3 : m_pImpl->PushFootOrEndnote( NS_rtf::LN_footnote == rName );
3624 : 3 : break;
3625 : : case NS_rtf::LN_annotation :
3626 : 12 : m_pImpl->PushAnnotation();
3627 : 12 : break;
3628 : : }
3629 : 57 : ref->resolve(*this);
3630 [ + + + - ]: 57 : switch( rName )
3631 : : {
3632 : : case NS_rtf::LN_headerl:
3633 : : case NS_rtf::LN_headerr:
3634 : : case NS_rtf::LN_headerf:
3635 : : case NS_rtf::LN_footerl:
3636 : : case NS_rtf::LN_footerr:
3637 : : case NS_rtf::LN_footerf:
3638 : 42 : m_pImpl->PopPageHeaderFooter();
3639 : 42 : break;
3640 : : case NS_rtf::LN_footnote:
3641 : : case NS_rtf::LN_endnote:
3642 : 3 : m_pImpl->PopFootOrEndnote();
3643 : 3 : break;
3644 : : case NS_rtf::LN_annotation :
3645 : 12 : m_pImpl->PopAnnotation();
3646 : 12 : break;
3647 : : }
3648 : :
3649 : 57 : m_pImpl->getTableManager().endLevel();
3650 : 57 : m_pImpl->popTableManager( );
3651 : 57 : }
3652 : :
3653 : 969 : void DomainMapper::lcl_info(const string & /*info_*/)
3654 : : {
3655 : 969 : }
3656 : :
3657 : 12 : void DomainMapper::handleUnderlineType(const sal_Int32 nIntValue, const ::boost::shared_ptr<PropertyMap> pContext)
3658 : : {
3659 : 12 : sal_Int16 eUnderline = awt::FontUnderline::NONE;
3660 : :
3661 [ + - + - : 12 : switch(nIntValue)
- - - - -
- - - - -
- - - -
- ]
3662 : : {
3663 : 3 : case 0: eUnderline = awt::FontUnderline::NONE; break;
3664 [ # # ][ # # ]: 0 : case 2: pContext->Insert(PROP_CHAR_WORD_MODE, true, uno::makeAny( true ) ); // TODO: how to get rid of it?
3665 : 9 : case 1: eUnderline = awt::FontUnderline::SINGLE; break;
3666 : 0 : case 3: eUnderline = awt::FontUnderline::DOUBLE; break;
3667 : 0 : case 4: eUnderline = awt::FontUnderline::DOTTED; break;
3668 : 0 : case 7: eUnderline = awt::FontUnderline::DASH; break;
3669 : 0 : case 9: eUnderline = awt::FontUnderline::DASHDOT; break;
3670 : 0 : case 10:eUnderline = awt::FontUnderline::DASHDOTDOT; break;
3671 : 0 : case 6: eUnderline = awt::FontUnderline::BOLD; break;
3672 : 0 : case 11:eUnderline = awt::FontUnderline::WAVE; break;
3673 : 0 : case 20:eUnderline = awt::FontUnderline::BOLDDOTTED; break;
3674 : 0 : case 23:eUnderline = awt::FontUnderline::BOLDDASH; break;
3675 : 0 : case 39:eUnderline = awt::FontUnderline::LONGDASH; break;
3676 : 0 : case 55:eUnderline = awt::FontUnderline::BOLDLONGDASH; break;
3677 : 0 : case 25:eUnderline = awt::FontUnderline::BOLDDASHDOT; break;
3678 : 0 : case 26:eUnderline = awt::FontUnderline::BOLDDASHDOTDOT;break;
3679 : 0 : case 27:eUnderline = awt::FontUnderline::BOLDWAVE; break;
3680 : 0 : case 43:eUnderline = awt::FontUnderline::DOUBLEWAVE; break;
3681 : : default: ;
3682 : : }
3683 [ + - ][ + - ]: 12 : pContext->Insert(PROP_CHAR_UNDERLINE, true, uno::makeAny( eUnderline ) );
3684 : 12 : }
3685 : :
3686 : 501 : void DomainMapper::handleParaJustification(const sal_Int32 nIntValue, const ::boost::shared_ptr<PropertyMap> pContext, const bool bExchangeLeftRight)
3687 : : {
3688 : 501 : sal_Int16 nAdjust = 0;
3689 : 501 : sal_Int16 nLastLineAdjust = 0;
3690 [ + + - + : 501 : switch(nIntValue)
+ ]
3691 : : {
3692 : : case 1:
3693 : 39 : nAdjust = style::ParagraphAdjust_CENTER;
3694 : 39 : break;
3695 : : case 2:
3696 [ - + ]: 45 : nAdjust = static_cast< sal_Int16 > (bExchangeLeftRight ? style::ParagraphAdjust_LEFT : style::ParagraphAdjust_RIGHT);
3697 : 45 : break;
3698 : : case 4:
3699 : 0 : nLastLineAdjust = style::ParagraphAdjust_BLOCK;
3700 : : //no break;
3701 : : case 3:
3702 : 6 : nAdjust = style::ParagraphAdjust_BLOCK;
3703 : 6 : break;
3704 : : case 0:
3705 : : default:
3706 [ - + ]: 411 : nAdjust = static_cast< sal_Int16 > (bExchangeLeftRight ? style::ParagraphAdjust_RIGHT : style::ParagraphAdjust_LEFT);
3707 : 411 : break;
3708 : : }
3709 [ + - ][ + - ]: 501 : pContext->Insert( PROP_PARA_ADJUST, true, uno::makeAny( nAdjust ) );
3710 [ + - ][ + - ]: 501 : pContext->Insert( PROP_PARA_LAST_LINE_ADJUST, true, uno::makeAny( nLastLineAdjust ) );
3711 : 501 : }
3712 : :
3713 : 0 : bool DomainMapper::getColorFromIndex(const sal_Int32 nIndex, sal_Int32 &nColor)
3714 : : {
3715 : 0 : nColor = 0;
3716 [ # # ][ # # ]: 0 : if ((nIndex < 1) || (nIndex > 16))
3717 : 0 : return false;
3718 : :
3719 [ # # # # : 0 : switch (nIndex)
# # # # #
# # # # #
# # # ]
3720 : : {
3721 : 0 : case 1: nColor=0x000000; break; //black
3722 : 0 : case 2: nColor=0x0000ff; break; //blue
3723 : 0 : case 3: nColor=0x00ffff; break; //cyan
3724 : 0 : case 4: nColor=0x00ff00; break; //green
3725 : 0 : case 5: nColor=0xff00ff; break; //magenta
3726 : 0 : case 6: nColor=0xff0000; break; //red
3727 : 0 : case 7: nColor=0xffff00; break; //yellow
3728 : 0 : case 8: nColor=0xffffff; break; //white
3729 : 0 : case 9: nColor=0x000080; break;//dark blue
3730 : 0 : case 10: nColor=0x008080; break; //dark cyan
3731 : 0 : case 11: nColor=0x008000; break; //dark green
3732 : 0 : case 12: nColor=0x800080; break; //dark magenta
3733 : 0 : case 13: nColor=0x800000; break; //dark red
3734 : 0 : case 14: nColor=0x808000; break; //dark yellow
3735 : 0 : case 15: nColor=0x808080; break; //dark gray
3736 : 0 : case 16: nColor=0xC0C0C0; break; //light gray
3737 : : default:
3738 : 0 : return false;
3739 : : }
3740 : 0 : return true;
3741 : : }
3742 : :
3743 : 0 : sal_Int16 DomainMapper::getEmphasisValue(const sal_Int32 nIntValue)
3744 : : {
3745 [ # # # # : 0 : switch (nIntValue)
# ]
3746 : : {
3747 : : case 1:
3748 : 0 : return com::sun::star::text::FontEmphasis::DOT_ABOVE;
3749 : : case 2:
3750 : 0 : return com::sun::star::text::FontEmphasis::ACCENT_ABOVE;
3751 : : case 3:
3752 : 0 : return com::sun::star::text::FontEmphasis::CIRCLE_ABOVE;
3753 : : case 4:
3754 : 0 : return com::sun::star::text::FontEmphasis::DOT_BELOW;
3755 : : default:
3756 : 0 : return com::sun::star::text::FontEmphasis::NONE;
3757 : : }
3758 : : }
3759 : :
3760 : 0 : OUString DomainMapper::getBracketStringFromEnum(const sal_Int32 nIntValue, const bool bIsPrefix)
3761 : : {
3762 [ # # # # : 0 : switch(nIntValue)
# ]
3763 : : {
3764 : : case 1:
3765 [ # # ]: 0 : if (bIsPrefix)
3766 : 0 : return OUString( "(" );
3767 : 0 : return OUString( ")" );
3768 : :
3769 : : case 2:
3770 [ # # ]: 0 : if (bIsPrefix)
3771 : 0 : return OUString( "[" );
3772 : 0 : return OUString( "]" );
3773 : :
3774 : : case 3:
3775 [ # # ]: 0 : if (bIsPrefix)
3776 : 0 : return OUString( "<" );
3777 : 0 : return OUString( ">" );
3778 : :
3779 : : case 4:
3780 [ # # ]: 0 : if (bIsPrefix)
3781 : 0 : return OUString( "{" );
3782 : 0 : return OUString( "}" );
3783 : :
3784 : : case 0:
3785 : : default:
3786 : 0 : return OUString();
3787 : : }
3788 : : }
3789 : :
3790 : 153 : com::sun::star::style::TabAlign DomainMapper::getTabAlignFromValue(const sal_Int32 nIntValue)
3791 : : {
3792 [ + + + - : 153 : switch (nIntValue)
- ]
3793 : : {
3794 : : case 0:
3795 : : case 4: // bar not supported
3796 : : case 5: // num not supported
3797 : 99 : return com::sun::star::style::TabAlign_LEFT;
3798 : : case 1:
3799 : 24 : return com::sun::star::style::TabAlign_CENTER;
3800 : : case 2:
3801 : 30 : return com::sun::star::style::TabAlign_RIGHT;
3802 : : case 3:
3803 : 0 : return com::sun::star::style::TabAlign_DECIMAL;
3804 : : }
3805 : 153 : return com::sun::star::style::TabAlign_LEFT;
3806 : : }
3807 : :
3808 : 93 : sal_Unicode DomainMapper::getFillCharFromValue(const sal_Int32 nIntValue)
3809 : : {
3810 [ - - - - : 93 : switch (nIntValue)
+ ]
3811 : : {
3812 : : case 1: // dot
3813 : 0 : return sal_Unicode(0x002e);
3814 : : case 2: // hyphen
3815 : 0 : return sal_Unicode(0x002d);
3816 : : case 3: // underscore
3817 : : case 4: // heavy FIXME ???
3818 : 0 : return sal_Unicode(0x005f);
3819 : : case NS_ooxml::LN_Value_ST_TabTlc_middleDot: // middleDot
3820 : 0 : return sal_Unicode(0x00b7);
3821 : : case 0: // none
3822 : : default:
3823 : 93 : return sal_Unicode(0x0020); // blank space
3824 : : }
3825 : : }
3826 : :
3827 : 2450 : bool DomainMapper::IsOOXMLImport() const
3828 : : {
3829 : 2450 : return m_pImpl->IsOOXMLImport();
3830 : : }
3831 : :
3832 : 842 : bool DomainMapper::IsRTFImport() const
3833 : : {
3834 : 842 : return m_pImpl->IsRTFImport();
3835 : : }
3836 : :
3837 : 80 : uno::Reference < lang::XMultiServiceFactory > DomainMapper::GetTextFactory() const
3838 : : {
3839 : 80 : return m_pImpl->GetTextFactory();
3840 : : }
3841 : :
3842 : 3 : uno::Reference< text::XTextRange > DomainMapper::GetCurrentTextRange()
3843 : : {
3844 [ + - ][ + - ]: 3 : return m_pImpl->GetTopTextAppend()->getEnd();
3845 : : }
3846 : :
3847 : 111 : OUString DomainMapper::getOrCreateCharStyle( PropertyValueVector_t& rCharProperties )
3848 : : {
3849 [ + - ]: 111 : StyleSheetTablePtr pStyleSheets = m_pImpl->GetStyleSheetTable();
3850 [ + - ][ + - ]: 111 : return pStyleSheets->getOrCreateCharStyle( rCharProperties );
3851 : : }
3852 : :
3853 : 36 : StyleSheetTablePtr DomainMapper::GetStyleSheetTable( )
3854 : : {
3855 : 36 : return m_pImpl->GetStyleSheetTable( );
3856 : : }
3857 : :
3858 : 21 : GraphicZOrderHelper* DomainMapper::graphicZOrderHelper()
3859 : : {
3860 [ + + ]: 21 : if( zOrderHelper.get() == NULL )
3861 [ + - ]: 9 : zOrderHelper.reset( new GraphicZOrderHelper );
3862 : 21 : return zOrderHelper.get();
3863 : : }
3864 : :
3865 : 15 : bool DomainMapper::IsInHeaderFooter() const
3866 : : {
3867 : 15 : return m_pImpl->IsInHeaderFooter();
3868 : : }
3869 : :
3870 : : } //namespace dmapper
3871 [ + - ][ + - ]: 60 : } //namespace writerfilter
3872 : :
3873 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|