Update ooo320-m1
[ooovba.git] / writerfilter / source / dmapper / DomainMapper.cxx
blobdadd45eb0b75347e3a9bfb59869fde71562d5b16
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: DomainMapper.cxx,v $
11 * $Revision: 1.69 $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
31 #include "PageBordersHandler.hxx"
33 #include <dmapper/DomainMapper.hxx>
34 #include <DomainMapper_Impl.hxx>
35 #include <ConversionHelper.hxx>
36 #include <NumberingManager.hxx>
37 #include <ThemeTable.hxx>
38 #include <ModelEventListener.hxx>
39 #include <MeasureHandler.hxx>
40 #include <OLEHandler.hxx>
41 #include <i18npool/mslangid.hxx>
42 #include <i18npool/paper.hxx>
43 #include <ooxml/OOXMLFastTokens.hxx>
44 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
45 #include <com/sun/star/document/XOOXMLDocumentPropertiesImporter.hpp>
46 #include <com/sun/star/text/HoriOrientation.hpp>
47 #include <com/sun/star/text/RelOrientation.hpp>
48 #include <com/sun/star/text/VertOrientation.hpp>
49 #include <com/sun/star/text/WrapTextMode.hpp>
50 #include <com/sun/star/text/SizeType.hpp>
51 #include <com/sun/star/text/XEndnotesSupplier.hpp>
52 #include <com/sun/star/text/XFootnotesSupplier.hpp>
53 #include <com/sun/star/text/XLineNumberingProperties.hpp>
54 #include <com/sun/star/text/XTextDocument.hpp>
55 #include <com/sun/star/text/XTextCursor.hpp>
56 #include <com/sun/star/text/XTextPortionAppend.hpp>
57 #include <com/sun/star/text/XParagraphAppend.hpp>
58 #include <com/sun/star/text/FontEmphasis.hpp>
59 #include <com/sun/star/awt/FontRelief.hpp>
60 #include <com/sun/star/awt/FontWeight.hpp>
61 #include <com/sun/star/awt/FontUnderline.hpp>
62 #include <com/sun/star/awt/FontStrikeout.hpp>
63 #include <com/sun/star/awt/FontSlant.hpp>
64 #include <com/sun/star/container/XIndexReplace.hpp>
65 #include <com/sun/star/drawing/XShape.hpp>
66 #include <com/sun/star/document/XEventBroadcaster.hpp>
67 #include <com/sun/star/style/ParagraphAdjust.hpp>
68 #include <com/sun/star/style/BreakType.hpp>
69 #include <com/sun/star/style/CaseMap.hpp>
70 #include <com/sun/star/style/LineSpacing.hpp>
71 #include <com/sun/star/style/LineSpacingMode.hpp>
72 #include <com/sun/star/table/BorderLine.hpp>
73 #include <com/sun/star/text/TextGridMode.hpp>
74 #include <com/sun/star/text/XDocumentIndexesSupplier.hpp>
75 #include <com/sun/star/text/WritingMode.hpp>
76 #include <com/sun/star/text/XFootnote.hpp>
77 #include <com/sun/star/style/NumberingType.hpp>
78 #include <comphelper/types.hxx>
79 #include <comphelper/storagehelper.hxx>
81 #include <rtl/ustrbuf.hxx>
82 #include <boost/shared_ptr.hpp>
83 #include <com/sun/star/uno/Any.hxx>
84 #include <tools/color.hxx>
85 #include <BorderHandler.hxx>
86 #include <CellColorHandler.hxx>
87 #include <SectionColumnHandler.hxx>
88 #include <vector>
89 #include <iostream>
91 #ifdef DEBUG_DOMAINMAPPER
92 #include <resourcemodel/QNameToString.hxx>
93 #include <resourcemodel/util.hxx>
94 #include <resourcemodel/TagLogger.hxx>
95 #endif
96 #if OSL_DEBUG_LEVEL > 0
97 #include <resourcemodel/QNameToString.hxx>
98 #endif
101 using namespace ::com::sun::star;
102 using namespace ::rtl;
104 namespace writerfilter {
105 namespace dmapper{
107 #ifdef DEBUG_DOMAINMAPPER
108 TagLogger::Pointer_t dmapper_logger(TagLogger::getInstance("DOMAINMAPPER"));
109 #endif
110 #if OSL_DEBUG_LEVEL > 0
111 #include <resourcemodel/QNameToString.hxx>
112 #endif
114 /* ---- Fridrich's mess begins here ---- */
115 struct _PageSz
117 sal_Int32 code;
118 sal_Int32 h;
119 bool orient;
120 sal_Int32 w;
121 } CT_PageSz;
124 /* ---- Fridrich's mess (hopefully) ends here ---- */
126 /*-- 09.06.2006 09:52:11---------------------------------------------------
128 -----------------------------------------------------------------------*/
129 DomainMapper::DomainMapper( const uno::Reference< uno::XComponentContext >& xContext,
130 uno::Reference< io::XInputStream > xInputStream,
131 uno::Reference< lang::XComponent > xModel,
132 SourceDocumentType eDocumentType) :
133 m_pImpl( new DomainMapper_Impl( *this, xContext, xModel, eDocumentType )),
134 mnBackgroundColor(0), mbIsHighlightSet(false)
136 // #i24363# tab stops relative to indent
137 m_pImpl->SetDocumentSettingsProperty(
138 PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_TABS_RELATIVE_TO_INDENT ),
139 uno::makeAny( false ) );
141 m_pImpl->SetDocumentSettingsProperty(
142 PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_ADD_PARA_TABLE_SPACING ),
143 uno::makeAny( false ) );
145 //import document properties
149 uno::Reference< lang::XMultiServiceFactory > xFactory(xContext->getServiceManager(), uno::UNO_QUERY_THROW);
150 uno::Reference< embed::XStorage > xDocumentStorage =
151 (comphelper::OStorageHelper::GetStorageOfFormatFromInputStream(OFOPXML_STORAGE_FORMAT_STRING, xInputStream));
153 uno::Reference< uno::XInterface > xTemp = xContext->getServiceManager()->createInstanceWithContext(
154 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.OOXMLDocumentPropertiesImporter")),
155 xContext);
157 uno::Reference< document::XOOXMLDocumentPropertiesImporter > xImporter( xTemp, uno::UNO_QUERY_THROW );
158 uno::Reference< document::XDocumentPropertiesSupplier > xPropSupplier( xModel, uno::UNO_QUERY_THROW);
159 xImporter->importProperties( xDocumentStorage, xPropSupplier->getDocumentProperties() );
161 catch( const uno::Exception& rEx )
163 (void)rEx;
166 #ifdef DEBUG_DOMAINMAPPER
167 dmapper_logger->startElement("domainmapper");
168 #endif
170 /*-- 09.06.2006 09:52:12---------------------------------------------------
172 -----------------------------------------------------------------------*/
173 DomainMapper::~DomainMapper()
177 uno::Reference< text::XDocumentIndexesSupplier> xIndexesSupplier( m_pImpl->GetTextDocument(), uno::UNO_QUERY );
178 uno::Reference< container::XIndexAccess > xIndexes = xIndexesSupplier->getDocumentIndexes();
179 sal_Int32 nIndexes = xIndexes->getCount();
180 if( nIndexes )
182 //index update has to wait until first view is created
183 uno::Reference< document::XEventBroadcaster > xBroadcaster(xIndexesSupplier, uno::UNO_QUERY);
184 xBroadcaster->addEventListener(uno::Reference< document::XEventListener >(new ModelEventListener));
188 // Apply the document settings after everything else
189 m_pImpl->GetSettingsTable()->ApplyProperties( m_pImpl->GetTextDocument( ) );
191 catch( const uno::Exception& rEx )
193 (void)rEx;
196 delete m_pImpl;
198 #ifdef DEBUG_DOMAINMAPPER
199 dmapper_logger->endElement("domainmapper");
200 #endif
202 /*-- 09.06.2006 09:52:12---------------------------------------------------
204 -----------------------------------------------------------------------*/
205 void DomainMapper::attribute(Id nName, Value & val)
207 #ifdef DEBUG_DOMAINMAPPER
208 dmapper_logger->startElement("attribute");
209 dmapper_logger->attribute("name", (*QNameToString::Instance())(nName));
210 dmapper_logger->attribute("value", val.toString());
211 #endif
212 static ::rtl::OUString sLocalBookmarkName;
213 sal_Int32 nIntValue = val.getInt();
214 rtl::OUString sStringValue = val.getString();
215 // printf ( "DomainMapper::attribute(0x%.4x, 0x%.4x) [%s]\n", (unsigned int)nName, (unsigned int)nIntValue, ::rtl::OUStringToOString(sStringValue, RTL_TEXTENCODING_DONTKNOW).getStr());
216 if( nName >= NS_rtf::LN_WIDENT && nName <= NS_rtf::LN_LCBSTTBFUSSR )
217 m_pImpl->GetFIB().SetData( nName, nIntValue );
218 else //if( !m_pImpl->getTableManager().attribute( nName, val) )
222 /* WRITERFILTERSTATUS: table: attributedata */
223 switch( nName )
225 /* attributes to be ignored */
226 case NS_rtf::LN_UNUSED4:
227 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
229 case NS_rtf::LN_UNUSED8:
230 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
232 case NS_rtf::LN_UNUSED1_3:
233 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
235 case NS_rtf::LN_UNUSED1_7:
236 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
238 case NS_rtf::LN_UNUSED8_3:
239 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
241 case NS_rtf::LN_FWRITERESERVATION:
242 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
244 case NS_rtf::LN_FLOADOVERRIDE:
245 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
247 case NS_rtf::LN_FFAREAST:
248 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
250 case NS_rtf::LN_FCRYPTO:
251 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
253 case NS_rtf::LN_NFIBBACK:
254 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
256 case NS_rtf::LN_LKEY:
257 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
259 case NS_rtf::LN_ENVR:
260 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
262 case NS_rtf::LN_FMAC:
263 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
265 case NS_rtf::LN_FWORD97SAVED:
266 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
268 case NS_rtf::LN_FCMAC:
269 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
271 case NS_rtf::LN_PNFBPCHPFIRST_W6:
272 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
274 case NS_rtf::LN_PNCHPFIRST_W6:
275 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
277 case NS_rtf::LN_CPNBTECHP_W6:
278 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
280 case NS_rtf::LN_PNFBPPAPFIRST_W6:
281 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
283 case NS_rtf::LN_PNPAPFIRST_W6:
284 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
286 case NS_rtf::LN_CPNBTEPAP_W6:
287 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
289 case NS_rtf::LN_PNFBPLVCFIRST_W6:
290 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
292 case NS_rtf::LN_PNLVCFIRST_W6:
293 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
295 case NS_rtf::LN_CPNBTELVC_W6:
296 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
298 case NS_rtf::LN_CBMAC:
299 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
301 case NS_rtf::LN_LPRODUCTCREATED:
302 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
304 case NS_rtf::LN_LPRODUCTREVISED:
305 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
307 case NS_rtf::LN_CCPMCR:
308 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
310 case NS_rtf::LN_PNFBPCHPFIRST:
311 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
313 case NS_rtf::LN_PNFBPPAPFIRST:
314 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
316 case NS_rtf::LN_PNFBPLVCFIRST:
317 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
319 case NS_rtf::LN_FCISLANDFIRST:
320 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
322 case NS_rtf::LN_FCISLANDLIM:
323 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
325 case NS_rtf::LN_FCSTSHFORIG:
326 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
328 case NS_rtf::LN_LCBSTSHFORIG:
329 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
331 case NS_rtf::LN_FCPLCFPAD:
332 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
334 case NS_rtf::LN_LCBPLCFPAD:
335 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
337 case NS_rtf::LN_FCSTTBFGLSY:
338 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
340 case NS_rtf::LN_LCBSTTBFGLSY:
341 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
343 case NS_rtf::LN_FCPLCFGLSY:
344 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
346 case NS_rtf::LN_LCBPLCFGLSY:
347 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
349 case NS_rtf::LN_FCPLCFSEA:
350 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
352 case NS_rtf::LN_LCBPLCFSEA:
353 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
355 case NS_rtf::LN_FCPLCFFLDMCR:
356 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
358 case NS_rtf::LN_LCBPLCFFLDMCR:
359 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
361 case NS_rtf::LN_FCCMDS:
362 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
364 case NS_rtf::LN_LCBCMDS:
365 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
367 case NS_rtf::LN_FCPLCMCR:
368 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
370 case NS_rtf::LN_LCBPLCMCR:
371 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
373 case NS_rtf::LN_FCSTTBFMCR:
374 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
376 case NS_rtf::LN_LCBSTTBFMCR:
377 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
379 case NS_rtf::LN_FCPRDRVR:
380 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
382 case NS_rtf::LN_LCBPRDRVR:
383 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
385 case NS_rtf::LN_FCPRENVPORT:
386 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
388 case NS_rtf::LN_LCBPRENVPORT:
389 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
391 case NS_rtf::LN_FCPRENVLAND:
392 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
394 case NS_rtf::LN_LCBPRENVLAND:
395 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
397 case NS_rtf::LN_FCWSS:
398 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
400 case NS_rtf::LN_LCBWSS:
401 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
403 case NS_rtf::LN_FCPLCFPGDFTN:
404 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
406 case NS_rtf::LN_LCBPLCFPGDFTN:
407 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
409 case NS_rtf::LN_FCAUTOSAVESOURCE:
410 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
412 case NS_rtf::LN_LCBAUTOSAVESOURCE:
413 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
415 case NS_rtf::LN_FCPLCDOAMOM:
416 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
418 case NS_rtf::LN_LCBPLCDOAMOM:
419 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
421 case NS_rtf::LN_FCPLCDOAHDR:
422 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
424 case NS_rtf::LN_LCBPLCDOAHDR:
425 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
427 case NS_rtf::LN_FCPMS:
428 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
430 case NS_rtf::LN_LCBPMS:
431 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
433 case NS_rtf::LN_FCPLCFPGDEDN:
434 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
436 case NS_rtf::LN_LCBPLCFPGDEDN:
437 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
439 case NS_rtf::LN_FCPLCFWKB:
440 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
442 case NS_rtf::LN_LCBPLCFWKB:
443 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
445 case NS_rtf::LN_FCPLCFSPL:
446 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
448 case NS_rtf::LN_LCBPLCFSPL:
449 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
451 case NS_rtf::LN_FCSTWUSER:
452 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
454 case NS_rtf::LN_LCBSTWUSER:
455 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
457 case NS_rtf::LN_FCUNUSED:
458 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
460 case NS_rtf::LN_LCBUNUSED:
461 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
463 case NS_rtf::LN_FCSTTBFINTLFLD:
464 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
466 case NS_rtf::LN_LCBSTTBFINTLFLD:
467 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
469 case NS_rtf::LN_FCROUTESLIP:
470 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
472 case NS_rtf::LN_LCBROUTESLIP:
473 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
475 case NS_rtf::LN_FCSTTBSAVEDBY:
476 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
478 case NS_rtf::LN_LCBSTTBSAVEDBY:
479 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
481 case NS_rtf::LN_FCSTTBFNM:
482 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
484 case NS_rtf::LN_LCBSTTBFNM:
485 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
487 case NS_rtf::LN_FCDOCUNDO:
488 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
490 case NS_rtf::LN_LCBDOCUNDO:
491 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
493 case NS_rtf::LN_FCRGBUSE:
494 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
496 case NS_rtf::LN_LCBRGBUSE:
497 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
499 case NS_rtf::LN_FCUSP:
500 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
502 case NS_rtf::LN_LCBUSP:
503 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
505 case NS_rtf::LN_FCUSKF:
506 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
508 case NS_rtf::LN_LCBUSKF:
509 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
511 case NS_rtf::LN_FCPLCUPCRGBUSE:
512 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
514 case NS_rtf::LN_LCBPLCUPCRGBUSE:
515 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
517 case NS_rtf::LN_FCPLCUPCUSP:
518 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
520 case NS_rtf::LN_LCBPLCUPCUSP:
521 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
523 case NS_rtf::LN_FCPLGOSL:
524 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
526 case NS_rtf::LN_LCBPLGOSL:
527 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
529 case NS_rtf::LN_FCPLCOCX:
530 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
532 case NS_rtf::LN_LCBPLCOCX:
533 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
535 case NS_rtf::LN_DWLOWDATETIME:
536 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
538 case NS_rtf::LN_DWHIGHDATETIME:
539 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
541 case NS_rtf::LN_FCPLCASUMY:
542 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
544 case NS_rtf::LN_LCBPLCASUMY:
545 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
547 case NS_rtf::LN_FCPLCFGRAM:
548 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
550 case NS_rtf::LN_LCBPLCFGRAM:
551 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
553 case NS_rtf::LN_FCSTTBFUSSR:
554 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
555 break;
557 case NS_rtf::LN_ISTD: //index of applied style
558 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
560 //search for the style with the given id and apply it
561 //as CharStyleName or ParaStyleName
562 //if the style is a user defined style then it must have an ISTD - built-in styles might not have it
563 StyleSheetTablePtr pStyleSheets = m_pImpl->GetStyleSheetTable();
564 ::rtl::OUString sValue = ::rtl::OUString::valueOf(nIntValue, 16);
565 const StyleSheetEntryPtr pEntry = pStyleSheets->FindStyleSheetByISTD(sValue);
566 if( pEntry.get( ) )
568 bool bParaStyle = (pEntry->nStyleTypeCode == STYLE_TYPE_PARA);
569 if(bParaStyle)
570 m_pImpl->SetCurrentParaStyleId(::rtl::OUString::valueOf(static_cast<sal_Int32>(nIntValue), 16));
571 if (m_pImpl->GetTopContext() && m_pImpl->GetTopContextType() != CONTEXT_SECTION)
572 m_pImpl->GetTopContext()->Insert(
573 bParaStyle ?
574 PROP_PARA_STYLE_NAME : PROP_CHAR_STYLE_NAME,
575 true,
576 uno::makeAny(
577 m_pImpl->GetStyleSheetTable()->ConvertStyleName( pEntry->sStyleName ) ) );
580 break;
581 case NS_rtf::LN_ISTARTAT:
582 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
583 break;
584 case NS_rtf::LN_NFC:
585 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
586 break;
587 case NS_rtf::LN_FLEGAL:
588 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
589 break;
590 case NS_rtf::LN_FNORESTART:
591 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
592 break;
593 case NS_rtf::LN_FPREV:
594 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
595 break;
596 case NS_rtf::LN_FPREVSPACE:
597 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
598 break;
599 case NS_rtf::LN_FWORD6:
600 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
601 break;
602 case NS_rtf::LN_UNUSED5_7:
603 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
604 break;
605 case NS_rtf::LN_RGBXCHNUMS:
606 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
607 break;
608 case NS_rtf::LN_IXCHFOLLOW:
609 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
610 break;
611 case NS_rtf::LN_DXASPACE:
612 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
613 break;
614 case NS_rtf::LN_DXAINDENT:
615 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
616 break;
617 case NS_rtf::LN_CBGRPPRLCHPX:
618 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
619 break;
620 case NS_rtf::LN_CBGRPPRLPAPX:
621 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
622 break;
623 case NS_rtf::LN_LSID:
624 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
625 break;
626 case NS_rtf::LN_TPLC:
627 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
628 break;
629 case NS_rtf::LN_RGISTD:
630 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
631 break;
632 case NS_rtf::LN_FSIMPLELIST:
633 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
634 break;
635 case NS_rtf::LN_FRESTARTHDN:
636 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
637 break;
638 case NS_rtf::LN_UNSIGNED26_2:
639 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
640 break;
641 case NS_rtf::LN_ILVL:
642 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
643 break;
644 case NS_rtf::LN_FSTARTAT:
645 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
646 break;
647 case NS_rtf::LN_FFORMATTING:
648 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
649 break;
650 case NS_rtf::LN_UNSIGNED4_6:
651 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
652 break;
653 case NS_rtf::LN_CLFOLVL:
654 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
655 break;
656 case NS_rtf::LN_CBFFNM1:
657 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
658 break;
659 case NS_rtf::LN_PRQ:
660 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
661 break;
662 case NS_rtf::LN_FTRUETYPE:
663 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
664 break;
665 case NS_rtf::LN_FF:
666 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
667 break;
668 case NS_rtf::LN_WWEIGHT:
669 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
670 break;
671 case NS_rtf::LN_CHS:
672 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
675 m_pImpl->GetFIB().SetLNCHS( nIntValue );
677 break;
678 case NS_rtf::LN_IXCHSZALT:
679 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
680 break;
681 case NS_rtf::LN_PANOSE:
682 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
683 break;
684 case NS_rtf::LN_FS:
685 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
686 break;
687 case NS_rtf::LN_STI:
688 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
689 break;
690 case NS_rtf::LN_FSCRATCH:
691 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
692 break;
693 case NS_rtf::LN_FINVALHEIGHT:
694 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
695 break;
696 case NS_rtf::LN_FHASUPE:
697 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
698 break;
699 case NS_rtf::LN_FMASSCOPY:
700 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
701 break;
702 case NS_rtf::LN_SGC:
703 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
704 break;
705 case NS_rtf::LN_ISTDBASE:
706 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
707 break;
708 case NS_rtf::LN_CUPX:
709 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
710 break;
711 case NS_rtf::LN_ISTDNEXT:
712 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
713 break;
714 case NS_rtf::LN_BCHUPE:
715 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
716 break;
717 case NS_rtf::LN_FAUTOREDEF:
718 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
719 break;
720 case NS_rtf::LN_FHIDDEN:
721 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
722 break;
723 case NS_rtf::LN_CSTD:
724 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
725 break;
726 case NS_rtf::LN_CBSTDBASEINFILE:
727 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
728 break;
729 case NS_rtf::LN_FSTDSTYLENAMESWRITTEN:
730 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
731 break;
732 case NS_rtf::LN_UNUSED4_2:
733 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
734 break;
735 case NS_rtf::LN_STIMAXWHENSAVED:
736 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
737 break;
738 case NS_rtf::LN_ISTDMAXFIXEDWHENSAVED:
739 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
740 break;
741 case NS_rtf::LN_NVERBUILTINNAMESWHENSAVED:
742 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
743 break;
744 case NS_rtf::LN_RGFTCSTANDARDCHPSTSH:
745 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
746 break;
747 case NS_rtf::LN_WIDENT:
748 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
750 case NS_rtf::LN_NFIB:
751 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
753 case NS_rtf::LN_NPRODUCT:
754 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
755 case NS_rtf::LN_LID:
756 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
757 case NS_rtf::LN_PNNEXT:
758 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
759 case NS_rtf::LN_FDOT:
760 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
761 case NS_rtf::LN_FGLSY:
762 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
763 case NS_rtf::LN_FCOMPLEX:
764 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
765 case NS_rtf::LN_FHASPIC:
766 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
768 case NS_rtf::LN_CQUICKSAVES:
769 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
771 case NS_rtf::LN_FENCRYPTED:
772 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
774 case NS_rtf::LN_FWHICHTBLSTM:
775 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
777 case NS_rtf::LN_FREADONLYRECOMMENDED:
778 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
780 case NS_rtf::LN_FEXTCHAR:
781 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
783 case NS_rtf::LN_FEMPTYSPECIAL:
784 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
786 case NS_rtf::LN_FLOADOVERRIDEPAGE:
787 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
789 case NS_rtf::LN_FFUTURESAVEDUNDO:
790 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
792 case NS_rtf::LN_FSPARE0:
793 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
795 case NS_rtf::LN_CHSTABLES:
796 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
798 case NS_rtf::LN_FCMIN:
799 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
801 case NS_rtf::LN_CSW:
802 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
804 case NS_rtf::LN_WMAGICCREATED:
805 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
807 case NS_rtf::LN_WMAGICREVISED:
808 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
810 case NS_rtf::LN_WMAGICCREATEDPRIVATE:
811 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
814 case NS_rtf::LN_WMAGICREVISEDPRIVATE:
815 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
817 case NS_rtf::LN_LIDFE:
818 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
820 case NS_rtf::LN_CLW:
821 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
823 case NS_rtf::LN_CCPTEXT:
824 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
827 case NS_rtf::LN_CCPFTN:
828 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
830 case NS_rtf::LN_CCPHDD:
831 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
833 case NS_rtf::LN_CCPATN:
834 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
836 case NS_rtf::LN_CCPEDN:
837 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
839 case NS_rtf::LN_CCPTXBX:
840 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
842 case NS_rtf::LN_CCPHDRTXBX:
843 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
845 case NS_rtf::LN_PNCHPFIRST:
846 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
848 case NS_rtf::LN_CPNBTECHP:
849 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
851 case NS_rtf::LN_PNPAPFIRST:
852 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
854 case NS_rtf::LN_CPNBTEPAP:
855 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
857 case NS_rtf::LN_PNLVCFIRST:
858 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
860 case NS_rtf::LN_CPNBTELVC:
861 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
863 case NS_rtf::LN_CFCLCB:
864 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
866 case NS_rtf::LN_FCSTSHF:
867 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
869 case NS_rtf::LN_LCBSTSHF:
870 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
872 case NS_rtf::LN_FCPLCFFNDREF:
873 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
875 case NS_rtf::LN_LCBPLCFFNDREF:
876 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
878 case NS_rtf::LN_FCPLCFFNDTXT:
879 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
881 case NS_rtf::LN_LCBPLCFFNDTXT:
882 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
884 case NS_rtf::LN_FCPLCFANDREF:
885 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
887 case NS_rtf::LN_LCBPLCFANDREF:
888 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
890 case NS_rtf::LN_FCPLCFANDTXT:
891 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
893 case NS_rtf::LN_LCBPLCFANDTXT:
894 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
896 case NS_rtf::LN_FCPLCFSED:
897 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
899 case NS_rtf::LN_LCBPLCFSED:
900 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
902 case NS_rtf::LN_FCPLCFPHE:
903 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
905 case NS_rtf::LN_LCBPLCFPHE:
906 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
908 case NS_rtf::LN_FCPLCFHDD:
909 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
911 case NS_rtf::LN_LCBPLCFHDD:
912 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
914 case NS_rtf::LN_FCPLCFBTECHPX:
915 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
917 case NS_rtf::LN_LCBPLCFBTECHPX:
918 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
921 case NS_rtf::LN_FCPLCFBTEPAPX:
922 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
924 case NS_rtf::LN_LCBPLCFBTEPAPX:
925 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
927 case NS_rtf::LN_FCSTTBFFFN:
928 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
930 case NS_rtf::LN_LCBSTTBFFFN:
931 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
933 case NS_rtf::LN_FCPLCFFLDMOM:
934 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
936 case NS_rtf::LN_LCBPLCFFLDMOM:
937 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
939 case NS_rtf::LN_FCPLCFFLDHDR:
940 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
942 case NS_rtf::LN_LCBPLCFFLDHDR:
943 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
946 case NS_rtf::LN_FCPLCFFLDFTN:
947 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
949 case NS_rtf::LN_LCBPLCFFLDFTN:
950 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
952 case NS_rtf::LN_FCPLCFFLDATN:
953 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
955 case NS_rtf::LN_LCBPLCFFLDATN:
956 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
958 case NS_rtf::LN_FCSTTBFBKMK:
959 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
961 case NS_rtf::LN_LCBSTTBFBKMK:
962 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
964 case NS_rtf::LN_FCPLCFBKF:
965 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
967 case NS_rtf::LN_LCBPLCFBKF:
968 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
970 case NS_rtf::LN_FCPLCFBKL:
971 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
973 case NS_rtf::LN_LCBPLCFBKL:
974 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
976 case NS_rtf::LN_FCDOP:
977 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
979 case NS_rtf::LN_LCBDOP:
980 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
982 case NS_rtf::LN_FCSTTBFASSOC:
983 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
985 case NS_rtf::LN_LCBSTTBFASSOC:
986 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
988 case NS_rtf::LN_FCCLX:
989 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
991 case NS_rtf::LN_LCBCLX:
992 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
994 case NS_rtf::LN_FCGRPXSTATNOWNERS:
995 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
997 case NS_rtf::LN_LCBGRPXSTATNOWNERS:
998 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1000 case NS_rtf::LN_FCSTTBFATNBKMK:
1001 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1003 case NS_rtf::LN_LCBSTTBFATNBKMK:
1004 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1006 case NS_rtf::LN_FCPLCSPAMOM:
1007 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1009 case NS_rtf::LN_LCBPLCSPAMOM:
1010 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1012 case NS_rtf::LN_FCPLCSPAHDR:
1013 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1016 case NS_rtf::LN_LCBPLCSPAHDR:
1017 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1019 case NS_rtf::LN_FCPLCFATNBKF:
1020 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1022 case NS_rtf::LN_LCBPLCFATNBKF:
1023 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1025 case NS_rtf::LN_FCPLCFATNBKL:
1026 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1028 case NS_rtf::LN_LCBPLCFATNBKL:
1029 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1031 case NS_rtf::LN_FCFORMFLDSTTBF:
1032 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1034 case NS_rtf::LN_LCBFORMFLDSTTBF:
1035 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1037 case NS_rtf::LN_FCPLCFENDREF:
1038 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1041 case NS_rtf::LN_LCBPLCFENDREF:
1042 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1044 case NS_rtf::LN_FCPLCFENDTXT:
1045 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1047 case NS_rtf::LN_LCBPLCFENDTXT:
1048 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1050 case NS_rtf::LN_FCPLCFFLDEDN:
1051 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1053 case NS_rtf::LN_LCBPLCFFLDEDN:
1054 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1056 case NS_rtf::LN_FCDGGINFO:
1057 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1059 case NS_rtf::LN_LCBDGGINFO:
1060 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1062 case NS_rtf::LN_FCSTTBFRMARK:
1063 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1066 case NS_rtf::LN_LCBSTTBFRMARK:
1067 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1069 case NS_rtf::LN_FCSTTBFCAPTION:
1070 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1072 case NS_rtf::LN_LCBSTTBFCAPTION:
1073 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1075 case NS_rtf::LN_FCSTTBFAUTOCAPTION:
1076 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1078 case NS_rtf::LN_LCBSTTBFAUTOCAPTION:
1079 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1081 case NS_rtf::LN_LCBPLCFTXBXTXT:
1082 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1084 case NS_rtf::LN_FCPLCFFLDTXBX:
1085 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1087 case NS_rtf::LN_LCBPLCFFLDTXBX:
1088 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1090 case NS_rtf::LN_FCPLCFHDRTXBXTXT:
1091 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1093 case NS_rtf::LN_LCBPLCFHDRTXBXTXT:
1094 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1096 case NS_rtf::LN_FCPLCFFLDHDRTXBX:
1097 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1099 case NS_rtf::LN_LCBPLCFFLDHDRTXBX:
1100 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1102 case NS_rtf::LN_FCSTTBTTMBD:
1103 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1105 case NS_rtf::LN_LCBSTTBTTMBD:
1106 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1108 case NS_rtf::LN_FCPGDMOTHER:
1109 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1111 case NS_rtf::LN_LCBPGDMOTHER:
1112 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1114 case NS_rtf::LN_FCBKDMOTHER:
1115 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1117 case NS_rtf::LN_LCBBKDMOTHER:
1118 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1120 case NS_rtf::LN_FCPGDFTN:
1121 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1123 case NS_rtf::LN_LCBPGDFTN:
1124 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1126 case NS_rtf::LN_FCBKDFTN:
1127 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1129 case NS_rtf::LN_LCBBKDFTN:
1130 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1132 case NS_rtf::LN_FCPGDEDN:
1133 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1135 case NS_rtf::LN_LCBPGDEDN:
1136 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1139 case NS_rtf::LN_FCBKDEDN:
1140 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1142 case NS_rtf::LN_LCBBKDEDN:
1143 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1145 case NS_rtf::LN_FCPLCFLST:
1146 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1149 case NS_rtf::LN_LCBPLCFLST:
1150 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1152 case NS_rtf::LN_FCPLFLFO:
1153 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1155 case NS_rtf::LN_LCBPLFLFO:
1156 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1158 case NS_rtf::LN_FCPLCFTXBXBKD:
1159 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1161 case NS_rtf::LN_LCBPLCFTXBXBKD:
1162 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1164 case NS_rtf::LN_FCPLCFTXBXHDRBKD:
1165 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1167 case NS_rtf::LN_LCBPLCFTXBXHDRBKD:
1168 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1170 case NS_rtf::LN_FCSTTBGLSYSTYLE:
1171 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1174 case NS_rtf::LN_LCBSTTBGLSYSTYLE:
1175 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1177 case NS_rtf::LN_FCPLCFBTELVC:
1178 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1180 case NS_rtf::LN_LCBPLCFBTELVC:
1181 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1183 case NS_rtf::LN_FCPLCFLVC:
1184 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1186 case NS_rtf::LN_LCBPLCFLVC:
1187 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1189 case NS_rtf::LN_FCSTTBLISTNAMES:
1190 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1192 case NS_rtf::LN_LCBSTTBLISTNAMES:
1193 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1195 case NS_rtf::LN_LCBSTTBFUSSR:
1196 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1198 m_pImpl->GetFIB().SetData( nName, nIntValue );
1200 break;
1201 case NS_rtf::LN_FN:
1202 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1204 case NS_rtf::LN_FCSEPX:
1205 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1207 case NS_rtf::LN_FNMPR:
1208 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1210 case NS_rtf::LN_FCMPR:
1211 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1213 //section descriptor, unused or internally used
1214 break;
1215 case NS_rtf::LN_ICOFORE:
1216 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1217 break;
1218 case NS_rtf::LN_ICOBACK:
1219 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1220 break;
1221 case NS_rtf::LN_IPAT:
1222 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1223 break;
1224 case NS_rtf::LN_SHDFORECOLOR:
1225 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1226 break;
1227 case NS_rtf::LN_SHDBACKCOLOR:
1228 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1229 break;
1230 case NS_rtf::LN_SHDPATTERN:
1231 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1232 break;
1233 case NS_rtf::LN_DPTLINEWIDTH:
1234 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1235 break;
1236 case NS_rtf::LN_BRCTYPE:
1237 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1238 break;
1239 case NS_rtf::LN_ICO:
1240 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1241 break;
1242 case NS_rtf::LN_DPTSPACE:
1243 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1244 break;
1245 case NS_rtf::LN_FSHADOW:
1246 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1247 break;
1248 case NS_rtf::LN_FFRAME:
1249 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1250 break;
1251 case NS_rtf::LN_UNUSED2_15:
1252 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1253 break;
1254 case NS_rtf::LN_FFIRSTMERGED:
1255 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1256 break;
1257 case NS_rtf::LN_FMERGED:
1258 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1259 break;
1260 case NS_rtf::LN_FVERTICAL:
1261 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1262 break;
1263 case NS_rtf::LN_FBACKWARD:
1264 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1265 break;
1266 case NS_rtf::LN_FROTATEFONT:
1267 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1268 break;
1269 case NS_rtf::LN_FVERTMERGE:
1270 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1271 break;
1272 case NS_rtf::LN_FVERTRESTART:
1273 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1274 break;
1275 case NS_rtf::LN_VERTALIGN:
1276 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1277 break;
1278 case NS_rtf::LN_FUNUSED:
1279 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1280 break;
1281 case NS_rtf::LN_BRCTOP:
1282 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1283 case NS_rtf::LN_BRCLEFT:
1284 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1285 case NS_rtf::LN_BRCBOTTOM:
1286 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1287 case NS_rtf::LN_BRCRIGHT:
1288 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1290 table::BorderLine aBorderLine;
1291 sal_Int32 nLineDistance = ConversionHelper::MakeBorderLine( nIntValue, aBorderLine );
1292 (void)nLineDistance;
1293 PropertyIds eBorderId = PROP_LEFT_BORDER;
1294 PropertyIds eBorderDistId = PROP_LEFT_BORDER_DISTANCE ;
1295 switch( nName )
1297 case NS_rtf::LN_BRCTOP:
1298 eBorderId = PROP_TOP_BORDER ;
1299 eBorderDistId = PROP_TOP_BORDER_DISTANCE;
1300 break;
1301 case NS_rtf::LN_BRCLEFT:
1302 // eBorderId = PROP_LEFT_BORDER;
1303 // eBorderDistId = PROP_LEFT_BORDER_DISTANCE ;
1304 break;
1305 case NS_rtf::LN_BRCBOTTOM:
1306 eBorderId = PROP_BOTTOM_BORDER ;
1307 eBorderDistId = PROP_BOTTOM_BORDER_DISTANCE;
1308 break;
1309 case NS_rtf::LN_BRCRIGHT:
1310 eBorderId = PROP_RIGHT_BORDER ;
1311 eBorderDistId = PROP_RIGHT_BORDER_DISTANCE ;
1312 break;
1313 default:;
1315 //todo: where to put the border properties
1316 //rContext->Insert(eBorderId, uno::makeAny( aBorderLine ));
1317 //rContext->Insert(eBorderDistId, uno::makeAny( nLineDistance ));
1319 break;
1320 case NS_rtf::LN_ITCFIRST:
1321 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1322 break;
1323 case NS_rtf::LN_FPUB:
1324 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1325 break;
1326 case NS_rtf::LN_ITCLIM:
1327 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1328 break;
1329 case NS_rtf::LN_FCOL:
1330 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1331 break;
1332 case NS_rtf::LN_LINECOLOR:
1333 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1334 break;
1335 case NS_rtf::LN_LINEWIDTH:
1336 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1337 break;
1338 case NS_rtf::LN_LINETYPE:
1339 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1340 break;
1341 case NS_rtf::LN_MM:
1342 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1343 break;
1344 case NS_rtf::LN_XEXT:
1345 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1346 break;
1347 case NS_rtf::LN_YEXT:
1348 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1349 break;
1350 case NS_rtf::LN_HMF:
1351 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1352 break;
1353 case NS_rtf::LN_LCB:
1354 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1355 break;
1356 case NS_rtf::LN_CBHEADER:
1357 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1358 break;
1359 case NS_rtf::LN_MFP:
1360 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1361 break;
1362 case NS_rtf::LN_BM_RCWINMF:
1363 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1364 break;
1365 case NS_rtf::LN_DXAGOAL:
1366 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1367 break;
1368 case NS_rtf::LN_DYAGOAL:
1369 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1370 break;
1371 case NS_rtf::LN_MX:
1372 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1373 break;
1374 case NS_rtf::LN_MY:
1375 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1376 break;
1377 case NS_rtf::LN_DXACROPLEFT:
1378 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1379 break;
1380 case NS_rtf::LN_DYACROPTOP:
1381 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1382 break;
1383 case NS_rtf::LN_DXACROPRIGHT:
1384 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1385 break;
1386 case NS_rtf::LN_DYACROPBOTTOM:
1387 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1388 break;
1389 case NS_rtf::LN_BRCL:
1390 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1391 break;
1392 case NS_rtf::LN_FFRAMEEMPTY:
1393 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1394 break;
1395 case NS_rtf::LN_FBITMAP:
1396 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1397 break;
1398 case NS_rtf::LN_FDRAWHATCH:
1399 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1400 break;
1401 case NS_rtf::LN_FERROR:
1402 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1403 break;
1404 case NS_rtf::LN_BPP:
1405 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1406 break;
1407 case NS_rtf::LN_DXAORIGIN:
1408 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1409 break;
1410 case NS_rtf::LN_DYAORIGIN:
1411 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1412 break;
1413 case NS_rtf::LN_CPROPS:
1414 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1415 break;
1416 case NS_rtf::LN_LINEPROPSTOP:
1417 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1418 break;
1419 case NS_rtf::LN_LINEPROPSLEFT:
1420 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1421 break;
1422 case NS_rtf::LN_LINEPROPSBOTTOM:
1423 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1424 break;
1425 case NS_rtf::LN_LINEPROPSRIGHT:
1426 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1427 break;
1428 case NS_rtf::LN_LINEPROPSHORIZONTAL:
1429 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1430 break;
1431 case NS_rtf::LN_LINEPROPSVERTICAL:
1432 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1433 break;
1434 case NS_rtf::LN_headerr:
1435 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1436 break;
1437 case NS_rtf::LN_footerr:
1438 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1439 break;
1440 case NS_rtf::LN_endnote:
1441 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1442 break;
1443 case NS_rtf::LN_BOOKMARKNAME:
1444 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1445 // sStringValue contains the bookmark name
1446 sLocalBookmarkName = sStringValue;
1447 break;
1448 case NS_rtf::LN_IBKL:
1449 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0.5 */
1450 //contains the bookmark identifier - has to be added to the bookmark name imported before
1451 //if it is already available then the bookmark should be inserted
1452 m_pImpl->AddBookmark( sLocalBookmarkName, sStringValue );
1453 sLocalBookmarkName = ::rtl::OUString();
1454 break;
1455 case NS_rtf::LN_LISTLEVEL:
1456 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1457 break;
1458 case NS_rtf::LN_LFO:
1459 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1460 break;
1461 case NS_rtf::LN_F:
1462 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1463 break;
1464 case NS_rtf::LN_ALTFONTNAME:
1465 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1466 break;
1467 case NS_rtf::LN_XSZFFN:
1468 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1469 break;
1470 case NS_rtf::LN_XSTZNAME:
1471 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1472 break;
1473 case NS_rtf::LN_XSTZNAME1:
1474 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1475 break;
1476 case NS_rtf::LN_UPXSTART:
1477 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1478 break;
1479 case NS_rtf::LN_UPX:
1480 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1481 break;
1482 case NS_rtf::LN_sed:
1483 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1484 //section properties
1485 resolveAttributeProperties(val);
1486 break;
1487 case NS_rtf::LN_tbdAdd:
1488 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1491 writerfilter::Reference<Properties>::Pointer_t pProperties = val.getProperties();
1492 if( pProperties.get())
1494 pProperties->resolve(*this);
1495 //increment to the next tab stop
1496 m_pImpl->NextTabStop();
1499 break;
1500 case NS_rtf::LN_dxaDel:
1501 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1502 //deleted tab
1503 case NS_rtf::LN_dxaAdd:
1504 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1505 //set tab
1506 case NS_rtf::LN_TLC:
1507 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1508 //tab leading characters - for decimal tabs
1509 case NS_rtf::LN_JC:
1510 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1511 //tab justification
1512 m_pImpl->ModifyCurrentTabStop(nName, nIntValue);
1513 break;
1514 case NS_rtf::LN_UNUSED0_6:
1515 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1516 // really unused
1517 break;
1518 case NS_rtf::LN_rgbrc:
1519 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1520 break;
1521 case NS_rtf::LN_shd:
1522 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1523 break;
1524 case NS_rtf::LN_cellShd:
1525 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1526 break;
1527 case NS_rtf::LN_cellTopColor:
1528 case NS_rtf::LN_cellLeftColor:
1529 case NS_rtf::LN_cellBottomColor:
1530 case NS_rtf::LN_cellRightColor:
1531 OSL_ASSERT("handled by DomainMapperTableManager");
1532 break;
1534 case NS_rtf::LN_LISTTABLE:
1535 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1536 break;
1537 case NS_rtf::LN_LFOTABLE:
1538 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1539 break;
1540 case NS_rtf::LN_FONTTABLE:
1541 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1542 break;
1543 case NS_rtf::LN_STYLESHEET:
1544 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1545 break;
1547 case NS_rtf::LN_fcEastAsianLayout:
1548 /* WRITERFILTERSTATUS: done: 50, planned: 0.5, spent: 0 */
1549 /* it seems that the value is following:
1550 ???? XX YYYY ZZ
1551 where
1552 XX seems to be the run id
1553 ZZ is the length of the function that is normally 6
1554 Lower byte of YYYY determines whether it is
1555 vertical text flow (0x01), or
1556 two lines in one layout (0x02).
1557 For 0x01, if the higher byte of YYYY is zero, the text is not scaled to fit the line height,
1558 in oposite case, it is to be scaled.
1559 For 0x02, the higher byte of YYYY is determinig the prefix and suffix of the run:
1560 no brackets (0x00) ,
1561 () round brackets (0x01),
1562 [] square backets (0x02),
1563 <> angle brackets (0x03) and
1564 {} curly brackets (0x04).
1565 ???? is different and we do not know its signification
1568 if ((nIntValue & 0x000000FF) == 6)
1570 switch ((nIntValue & 0x0000FF00) >> 8)
1572 case 1: // vertical text
1573 if (m_pImpl->GetTopContext())
1575 m_pImpl->GetTopContext()->Insert(PROP_CHAR_ROTATION, true, uno::makeAny ( sal_Int16(900) ));
1576 m_pImpl->GetTopContext()->Insert(PROP_CHAR_ROTATION_IS_FIT_TO_LINE, true, uno::makeAny (((nIntValue & 0x00FF0000) >> 16) != 0));
1578 break;
1579 case 2: // two lines in one
1580 if (m_pImpl->GetTopContext())
1582 m_pImpl->GetTopContext()->Insert(PROP_CHAR_COMBINE_IS_ON, true, uno::makeAny ( true ));
1583 m_pImpl->GetTopContext()->Insert(PROP_CHAR_COMBINE_PREFIX, true, uno::makeAny ( getBracketStringFromEnum((nIntValue & 0x00FF0000) >> 16)));
1584 m_pImpl->GetTopContext()->Insert(PROP_CHAR_COMBINE_SUFFIX, true, uno::makeAny ( getBracketStringFromEnum((nIntValue & 0x00FF0000) >> 16, false)));
1586 break;
1587 default:
1588 break;
1591 break;
1592 case NS_rtf::LN_FRD :
1593 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1594 //footnote reference descriptor, if nIntValue > 0 then automatic, custom otherwise
1595 //ignored
1596 break;
1597 case NS_rtf::LN_FONT: //font of footnote symbol
1598 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1599 if (m_pImpl->GetTopContext())
1600 m_pImpl->GetTopContext()->SetFootnoteFontId( nIntValue );
1601 break;
1602 case NS_ooxml::LN_CT_Sym_char:
1603 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1604 if( m_pImpl->GetTopContext() && m_pImpl->GetTopContext()->GetFootnote().is())
1606 m_pImpl->GetTopContext()->GetFootnote()->setLabel(::rtl::OUString( sal_Unicode(nIntValue)));
1607 break;
1609 else //it's a _real_ symbol
1611 utext( reinterpret_cast < const sal_uInt8 * >( &nIntValue ), 1 );
1613 break;
1614 case NS_rtf::LN_CHAR: //footnote symbol character
1615 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1616 if (m_pImpl->GetTopContext())
1617 m_pImpl->GetTopContext()->SetFootnoteSymbol( sal_Unicode(nIntValue));
1618 break;
1619 case NS_ooxml::LN_CT_Sym_font:
1620 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1621 //the footnote symbol and font are provided after the footnote is already inserted
1622 if( m_pImpl->GetTopContext() && m_pImpl->GetTopContext()->GetFootnote().is())
1624 uno::Reference< beans::XPropertySet > xAnchorProps( m_pImpl->GetTopContext()->GetFootnote()->getAnchor(), uno::UNO_QUERY );
1625 xAnchorProps->setPropertyValue(
1626 PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_CHAR_FONT_NAME),
1627 uno::makeAny( sStringValue ));
1629 else //a real symbol
1630 if (m_pImpl->GetTopContext())
1631 m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME, true, uno::makeAny( sStringValue ));
1632 break;
1633 case NS_ooxml::LN_CT_Underline_val:
1634 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1635 handleUnderlineType(nIntValue, m_pImpl->GetTopContext());
1636 break;
1637 case NS_ooxml::LN_CT_Color_val:
1638 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1639 if (m_pImpl->GetTopContext())
1640 m_pImpl->GetTopContext()->Insert(PROP_CHAR_COLOR, true, uno::makeAny( nIntValue ) );
1641 break;
1642 case NS_ooxml::LN_CT_Underline_color:
1643 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1644 if (m_pImpl->GetTopContext())
1646 m_pImpl->GetTopContext()->Insert(PROP_CHAR_UNDERLINE_HAS_COLOR, true, uno::makeAny( true ) );
1647 m_pImpl->GetTopContext()->Insert(PROP_CHAR_UNDERLINE_COLOR, true, uno::makeAny( nIntValue ) );
1649 break;
1651 case NS_ooxml::LN_CT_TabStop_val:
1652 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1653 if (sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_ST_TabJc_clear)
1655 m_pImpl->m_aCurrentTabStop.bDeleted = true;
1657 else
1659 m_pImpl->m_aCurrentTabStop.bDeleted = false;
1660 m_pImpl->m_aCurrentTabStop.Alignment = getTabAlignFromValue(nIntValue);
1662 break;
1663 case NS_ooxml::LN_CT_TabStop_leader:
1664 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1665 m_pImpl->m_aCurrentTabStop.FillChar = getFillCharFromValue(nIntValue);
1666 break;
1667 case NS_ooxml::LN_CT_TabStop_pos:
1668 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1669 m_pImpl->m_aCurrentTabStop.Position = ConversionHelper::convertTwipToMM100(nIntValue);
1670 break;
1672 case NS_ooxml::LN_CT_Fonts_ascii:
1673 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1674 if (m_pImpl->GetTopContext())
1675 m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME, true, uno::makeAny( sStringValue ));
1676 break;
1677 case NS_ooxml::LN_CT_Fonts_asciiTheme:
1678 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1679 if (m_pImpl->GetTopContext())
1680 m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME, true, uno::makeAny( m_pImpl->GetThemeTable()->getFontNameForTheme(nIntValue) ));
1681 break;
1682 case NS_ooxml::LN_CT_Fonts_hAnsi:
1683 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1684 break;//unsupported
1685 case NS_ooxml::LN_CT_Fonts_hAnsiTheme:
1686 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1687 break; //unsupported
1688 case NS_ooxml::LN_CT_Fonts_eastAsia:
1689 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1690 if (m_pImpl->GetTopContext())
1691 m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME_ASIAN, true, uno::makeAny( sStringValue ));
1692 break;
1693 case NS_ooxml::LN_CT_Fonts_eastAsiaTheme:
1694 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1695 if (m_pImpl->GetTopContext())
1696 m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME_COMPLEX, true, uno::makeAny( m_pImpl->GetThemeTable()->getFontNameForTheme(nIntValue) ) );
1697 break;
1698 case NS_ooxml::LN_CT_Fonts_cs:
1699 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1700 if (m_pImpl->GetTopContext())
1701 m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME_COMPLEX, true, uno::makeAny( sStringValue ));
1702 break;
1703 case NS_ooxml::LN_CT_Fonts_cstheme:
1704 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1705 if (m_pImpl->GetTopContext())
1706 m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME_COMPLEX, true, uno::makeAny( m_pImpl->GetThemeTable()->getFontNameForTheme(nIntValue) ));
1707 break;
1708 case NS_ooxml::LN_CT_Spacing_before:
1709 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1710 if (m_pImpl->GetTopContext())
1711 m_pImpl->GetTopContext()->Insert(PROP_PARA_TOP_MARGIN, true, uno::makeAny( ConversionHelper::convertTwipToMM100( nIntValue ) ));
1712 break;
1713 case NS_ooxml::LN_CT_Spacing_beforeLines:
1714 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1715 break;
1716 case NS_ooxml::LN_CT_Spacing_after:
1717 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1718 if (m_pImpl->GetTopContext())
1719 m_pImpl->GetTopContext()->Insert(PROP_PARA_BOTTOM_MARGIN, true, uno::makeAny( ConversionHelper::convertTwipToMM100( nIntValue ) ));
1720 break;
1721 case NS_ooxml::LN_CT_Spacing_afterLines:
1722 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1723 break;
1724 case NS_ooxml::LN_CT_Spacing_line: //91434
1725 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1726 case NS_ooxml::LN_CT_Spacing_lineRule: //91435
1727 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1729 #define SINGLE_LINE_SPACING 240
1730 style::LineSpacing aSpacing;
1731 PropertyMapPtr pTopContext = m_pImpl->GetTopContext();
1732 PropertyMap::iterator aLineSpacingIter = pTopContext->find(PropertyDefinition( PROP_PARA_LINE_SPACING, true ) );
1733 if( aLineSpacingIter != pTopContext->end())
1735 aLineSpacingIter->second >>= aSpacing;
1737 else
1739 //default to single line spacing
1740 aSpacing.Mode = style::LineSpacingMode::FIX;
1741 aSpacing.Height = sal_Int16(ConversionHelper::convertTwipToMM100( SINGLE_LINE_SPACING ));
1743 if( nName == NS_ooxml::LN_CT_Spacing_line )
1745 //now set the value depending on the Mode
1746 if( aSpacing.Mode == style::LineSpacingMode::PROP )
1747 aSpacing.Height = sal_Int16(sal_Int32(nIntValue) * 100 / SINGLE_LINE_SPACING );
1748 else
1749 aSpacing.Height = sal_Int16(ConversionHelper::convertTwipToMM100( nIntValue ));
1751 else //NS_ooxml::LN_CT_Spacing_lineRule:
1753 // exactly, atLeast, auto
1754 if( sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_wordprocessingml_ST_LineSpacingRule_auto)
1756 aSpacing.Mode = style::LineSpacingMode::PROP;
1757 //reinterpret the already set value
1758 aSpacing.Height = sal_Int16( aSpacing.Height * 100 / ConversionHelper::convertTwipToMM100( SINGLE_LINE_SPACING ));
1760 else if( sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_wordprocessingml_ST_LineSpacingRule_atLeast)
1761 aSpacing.Mode = style::LineSpacingMode::MINIMUM;
1762 else // NS_ooxml::LN_Value_wordprocessingml_ST_LineSpacingRule_exact
1763 aSpacing.Mode = style::LineSpacingMode::FIX;
1765 pTopContext->Insert(PROP_PARA_LINE_SPACING, true, uno::makeAny( aSpacing ));
1767 break;
1768 case NS_ooxml::LN_CT_Ind_left:
1769 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1770 if (m_pImpl->GetTopContext())
1771 m_pImpl->GetTopContext()->Insert(
1772 PROP_PARA_LEFT_MARGIN, true, uno::makeAny( ConversionHelper::convertTwipToMM100(nIntValue ) ));
1773 break;
1774 case NS_ooxml::LN_CT_Ind_right:
1775 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1776 if (m_pImpl->GetTopContext())
1777 m_pImpl->GetTopContext()->Insert(
1778 PROP_PARA_RIGHT_MARGIN, true, uno::makeAny( ConversionHelper::convertTwipToMM100(nIntValue ) ));
1779 break;
1780 case NS_ooxml::LN_CT_Ind_hanging:
1781 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1782 if (m_pImpl->GetTopContext())
1784 sal_Int32 nValue = ConversionHelper::convertTwipToMM100( nIntValue );
1785 m_pImpl->GetTopContext()->Insert(
1786 PROP_PARA_FIRST_LINE_INDENT, true, uno::makeAny( - nValue ));
1788 break;
1789 case NS_ooxml::LN_CT_Ind_firstLine:
1790 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1791 if (m_pImpl->GetTopContext())
1792 m_pImpl->GetTopContext()->Insert(
1793 PROP_PARA_FIRST_LINE_INDENT, true, uno::makeAny( ConversionHelper::convertTwipToMM100(nIntValue ) ));
1794 break;
1796 case NS_ooxml::LN_CT_EastAsianLayout_id:
1797 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1798 break;
1799 case NS_ooxml::LN_CT_EastAsianLayout_combine:
1800 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1801 if (m_pImpl->GetTopContext())
1802 m_pImpl->GetTopContext()->Insert(PROP_CHAR_COMBINE_IS_ON, true, uno::makeAny ( nIntValue ? true : false ));
1803 break;
1804 case NS_ooxml::LN_CT_EastAsianLayout_combineBrackets:
1805 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1806 if (m_pImpl->GetTopContext())
1808 rtl::OUString sCombinePrefix = getBracketStringFromEnum(nIntValue);
1809 rtl::OUString sCombineSuffix = getBracketStringFromEnum(nIntValue, false);
1810 m_pImpl->GetTopContext()->Insert(PROP_CHAR_COMBINE_PREFIX, true, uno::makeAny ( sCombinePrefix ));
1811 m_pImpl->GetTopContext()->Insert(PROP_CHAR_COMBINE_SUFFIX, true, uno::makeAny ( sCombineSuffix ));
1813 break;
1814 case NS_ooxml::LN_CT_EastAsianLayout_vert:
1815 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1816 if (m_pImpl->GetTopContext())
1818 sal_Int16 nRotationAngle = (nIntValue ? 900 : 0);
1819 m_pImpl->GetTopContext()->Insert(PROP_CHAR_ROTATION, true, uno::makeAny ( nRotationAngle ));
1821 break;
1822 case NS_ooxml::LN_CT_EastAsianLayout_vertCompress:
1823 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1824 if (m_pImpl->GetTopContext())
1825 m_pImpl->GetTopContext()->Insert(PROP_CHAR_ROTATION_IS_FIT_TO_LINE, true, uno::makeAny ( nIntValue ? true : false));
1826 break;
1828 case NS_ooxml::LN_CT_PageSz_code:
1829 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1830 CT_PageSz.code = nIntValue;
1831 break;
1832 case NS_ooxml::LN_CT_PageSz_h:
1833 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1835 sal_Int32 nHeight = ConversionHelper::convertTwipToMM100(nIntValue);
1836 CT_PageSz.h = PaperInfo::sloppyFitPageDimension(nHeight);
1838 break;
1839 case NS_ooxml::LN_CT_PageSz_orient:
1840 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1841 CT_PageSz.orient = (nIntValue != 0);
1842 break;
1843 case NS_ooxml::LN_CT_PageSz_w:
1844 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1846 sal_Int32 nWidth = ConversionHelper::convertTwipToMM100(nIntValue);
1847 CT_PageSz.w = PaperInfo::sloppyFitPageDimension(nWidth);
1849 break;
1851 case NS_ooxml::LN_CT_PageMar_top:
1852 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1853 m_pImpl->SetPageMarginTwip( PAGE_MAR_TOP, nIntValue );
1854 break;
1855 case NS_ooxml::LN_CT_PageMar_right:
1856 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1857 m_pImpl->SetPageMarginTwip( PAGE_MAR_RIGHT, nIntValue );
1858 break;
1859 case NS_ooxml::LN_CT_PageMar_bottom:
1860 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1861 m_pImpl->SetPageMarginTwip( PAGE_MAR_BOTTOM, nIntValue );
1862 break;
1863 case NS_ooxml::LN_CT_PageMar_left:
1864 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1865 m_pImpl->SetPageMarginTwip( PAGE_MAR_LEFT, nIntValue );
1866 break;
1867 case NS_ooxml::LN_CT_PageMar_header:
1868 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1869 m_pImpl->SetPageMarginTwip( PAGE_MAR_HEADER, nIntValue );
1870 break;
1871 case NS_ooxml::LN_CT_PageMar_footer:
1872 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1873 m_pImpl->SetPageMarginTwip( PAGE_MAR_FOOTER, nIntValue );
1874 break;
1875 case NS_ooxml::LN_CT_PageMar_gutter:
1876 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1877 m_pImpl->SetPageMarginTwip( PAGE_MAR_GUTTER, nIntValue );
1878 break;
1879 case NS_ooxml::LN_CT_Language_val: //90314
1880 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1881 case NS_ooxml::LN_CT_Language_eastAsia: //90315
1882 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1883 case NS_ooxml::LN_CT_Language_bidi: //90316
1884 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1886 LanguageType eLang = MsLangId::convertIsoStringToLanguage( sStringValue );
1887 lang::Locale aLocale = MsLangId::convertLanguageToLocale( eLang );
1888 if (m_pImpl->GetTopContext())
1889 m_pImpl->GetTopContext()->Insert(NS_ooxml::LN_CT_Language_val== nName ? PROP_CHAR_LOCALE :
1890 NS_ooxml::LN_CT_Language_eastAsia == nName ? PROP_CHAR_LOCALE_ASIAN : PROP_CHAR_LOCALE_COMPLEX,
1891 true,
1892 uno::makeAny( aLocale ) );
1894 break;
1895 #define AUTO_PARA_SPACING sal_Int32(49)
1896 case NS_ooxml::LN_CT_Spacing_beforeAutospacing:
1897 /* WRITERFILTERSTATUS: done: 80, planned: 0.5, spent: 0.2 */
1898 //TODO: autospacing depends on some document property (called fDontUseHTMLAutoSpacing in old ww8 filter) 100 or 280 twip
1899 //and should be set to 0 on start of page
1900 m_pImpl->GetTopContext()->Insert( PROP_PARA_TOP_MARGIN, false, uno::makeAny( AUTO_PARA_SPACING ) );
1901 break;
1902 case NS_ooxml::LN_CT_Spacing_afterAutospacing:
1903 /* WRITERFILTERSTATUS: done: 80, planned: 0.5, spent: 0.2 */
1904 //TODO: autospacing depends on some document property (called fDontUseHTMLAutoSpacing in old ww8 filter) 100 or 280 twip
1905 m_pImpl->GetTopContext()->Insert( PROP_PARA_BOTTOM_MARGIN, false, uno::makeAny( AUTO_PARA_SPACING ) );
1906 break;
1907 case NS_ooxml::LN_CT_SmartTagRun_uri:
1908 case NS_ooxml::LN_CT_SmartTagRun_element:
1909 /* WRITERFILTERSTATUS: done: 0, planned: 1, spent: 0 */
1910 //TODO: add handling of SmartTags
1911 break;
1912 case NS_ooxml::LN_CT_Br_type :
1913 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1914 //TODO: attributes for break (0x12) are not supported
1915 break;
1916 case NS_ooxml::LN_CT_Fonts_hint :
1917 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1918 /* assigns script type to ambigous characters, values can be:
1919 NS_ooxml::LN_Value_ST_Hint_default
1920 NS_ooxml::LN_Value_ST_Hint_eastAsia
1921 NS_ooxml::LN_Value_ST_Hint_cs
1923 //TODO: unsupported?
1924 break;
1925 case NS_ooxml::LN_CT_TblCellMar_right: // 92375;
1926 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1927 case NS_ooxml::LN_CT_TblBorders_top: // 92377;
1928 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1929 case NS_ooxml::LN_CT_TblBorders_left: // 92378;
1930 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1931 case NS_ooxml::LN_CT_TblBorders_bottom: // 92379;
1932 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1933 //todo: handle cell mar
1934 break;
1935 case NS_rtf::LN_blip: // contains the binary graphic
1936 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1937 case NS_ooxml::LN_shape:
1938 /* WRITERFILTERSTATUS: done: 50, planned: 0.5, spent: 0 */
1940 //looks a bit like a hack - and it is. The graphic import is split into the inline_inline part and
1941 //afterwards the adding of the binary data.
1942 m_pImpl->GetGraphicImport( IMPORT_AS_DETECTED_INLINE )->attribute(nName, val);
1943 m_pImpl->ImportGraphic( val.getProperties(), IMPORT_AS_DETECTED_INLINE );
1945 break;
1946 case NS_ooxml::LN_CT_FramePr_dropCap:
1947 case NS_ooxml::LN_CT_FramePr_lines:
1948 case NS_ooxml::LN_CT_FramePr_hAnchor:
1949 case NS_ooxml::LN_CT_FramePr_vAnchor:
1950 case NS_ooxml::LN_CT_FramePr_x:
1951 case NS_ooxml::LN_CT_FramePr_xAlign:
1952 case NS_ooxml::LN_CT_FramePr_y:
1953 case NS_ooxml::LN_CT_FramePr_yAlign:
1954 case NS_ooxml::LN_CT_FramePr_hRule:
1955 case NS_sprm::LN_PWr:
1956 case NS_sprm::LN_PDxaWidth:
1957 case NS_sprm::LN_PWHeightAbs:
1958 case NS_sprm::LN_PDxaFromText:
1959 case NS_sprm::LN_PDyaFromText:
1961 ParagraphProperties* pParaProperties = dynamic_cast< ParagraphProperties*>(m_pImpl->GetTopContext().get());
1962 if( pParaProperties )
1964 switch( nName )
1966 case NS_ooxml::LN_CT_FramePr_dropCap:
1967 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1968 pParaProperties->SetDropCap( nIntValue );
1969 break;
1970 case NS_ooxml::LN_CT_FramePr_lines:
1971 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1972 pParaProperties->SetLines( nIntValue );
1973 break;
1974 case NS_ooxml::LN_CT_FramePr_hAnchor:
1975 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1976 switch(nIntValue)
1978 case NS_ooxml::LN_Value_wordprocessingml_ST_HAnchor_text: //relative to column
1979 nIntValue = text::RelOrientation::FRAME; break;
1980 case NS_ooxml::LN_Value_wordprocessingml_ST_HAnchor_margin: nIntValue = text::RelOrientation::PAGE_PRINT_AREA; break;
1981 case NS_ooxml::LN_Value_wordprocessingml_ST_HAnchor_page: nIntValue = text::RelOrientation::PAGE_FRAME; break;
1982 default:;
1984 pParaProperties->SethAnchor( nIntValue );
1985 break;
1986 case NS_ooxml::LN_CT_FramePr_vAnchor:
1987 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1988 switch(nIntValue)
1990 case NS_ooxml::LN_Value_wordprocessingml_ST_VAnchor_text: //relative to paragraph
1991 nIntValue = text::RelOrientation::FRAME; break;
1992 case NS_ooxml::LN_Value_wordprocessingml_ST_VAnchor_margin:nIntValue = text::RelOrientation::PAGE_PRINT_AREA ; break;
1993 case NS_ooxml::LN_Value_wordprocessingml_ST_VAnchor_page: nIntValue = text::RelOrientation::PAGE_FRAME; break;
1994 default:;
1996 pParaProperties->SetvAnchor( nIntValue );
1997 break;
1998 case NS_ooxml::LN_CT_FramePr_x:
1999 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2000 pParaProperties->Setx( ConversionHelper::convertTwipToMM100(nIntValue ));
2001 break;
2002 case NS_ooxml::LN_CT_FramePr_xAlign:
2003 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2004 switch( nIntValue )
2006 case NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_center : nIntValue = text::HoriOrientation::CENTER; break;
2007 case NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_right : nIntValue = text::HoriOrientation::RIGHT; break;
2008 case NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_inside : nIntValue = text::HoriOrientation::INSIDE; break;
2009 case NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_outside : nIntValue = text::HoriOrientation::OUTSIDE; break;
2010 case NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_left : nIntValue = text::HoriOrientation::LEFT; break;
2011 default: nIntValue = text::HoriOrientation::NONE;
2013 pParaProperties->SetxAlign( nIntValue );
2014 break;
2015 case NS_ooxml::LN_CT_FramePr_y:
2016 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2017 pParaProperties->Sety( ConversionHelper::convertTwipToMM100(nIntValue ));
2018 break;
2019 case NS_ooxml::LN_CT_FramePr_yAlign:
2020 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2021 switch( nIntValue )
2023 case NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_top :
2024 case NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_inside :nIntValue = text::VertOrientation::TOP; break;
2025 case NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_center :nIntValue = text::VertOrientation::CENTER;break;
2026 case NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_bottom :
2027 case NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_outside :nIntValue = text::VertOrientation::BOTTOM;break;
2028 case NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_inline ://todo: what to do with inline - no avail. in WW97 and WW2007
2029 //no break;
2030 default:nIntValue = text::VertOrientation::NONE;
2032 pParaProperties->SetyAlign( nIntValue );
2033 break;
2034 case NS_ooxml::LN_CT_FramePr_hRule:
2035 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2036 switch( nIntValue )
2038 case NS_ooxml::LN_Value_wordprocessingml_ST_HeightRule_exact:
2039 nIntValue = text::SizeType::FIX;
2040 break;
2041 case NS_ooxml::LN_Value_wordprocessingml_ST_HeightRule_atLeast:
2042 nIntValue = text::SizeType::MIN;
2043 break;
2044 case NS_ooxml::LN_Value_wordprocessingml_ST_HeightRule_auto:
2045 //no break;
2046 default:;
2047 nIntValue = text::SizeType::VARIABLE;
2049 pParaProperties->SethRule( nIntValue );
2050 break;
2051 case NS_sprm::LN_PWr:
2053 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2054 //should be either LN_Value_wordprocessingml_ST_Wrap_notBeside or LN_Value_wordprocessingml_ST_Wrap_around
2055 OSL_ENSURE( sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_wordprocessingml_ST_Wrap_around ||
2056 sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_wordprocessingml_ST_Wrap_notBeside,
2057 "wrap not around or not_Beside?");
2058 pParaProperties->SetWrap(sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_wordprocessingml_ST_Wrap_around ?
2059 text::WrapTextMode_DYNAMIC : text::WrapTextMode_NONE );
2061 break;
2062 case NS_sprm::LN_PDxaWidth:
2063 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2064 pParaProperties->Setw(ConversionHelper::convertTwipToMM100(nIntValue));
2065 break;
2066 case NS_sprm::LN_PWHeightAbs:
2067 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2068 pParaProperties->Seth(ConversionHelper::convertTwipToMM100(nIntValue));
2069 break;
2070 case NS_sprm::LN_PDxaFromText:
2071 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
2072 pParaProperties->SethSpace( ConversionHelper::convertTwipToMM100(nIntValue ));
2073 break;
2074 case NS_sprm::LN_PDyaFromText:
2075 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
2076 pParaProperties->SetvSpace( ConversionHelper::convertTwipToMM100(nIntValue ));
2077 break;
2078 default:;
2081 else
2083 //TODO: how to handle frame properties at styles
2086 break;
2087 case NS_ooxml::LN_CT_LineNumber_start:
2088 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
2089 case NS_ooxml::LN_CT_LineNumber_distance:
2090 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
2091 case NS_ooxml::LN_CT_TrackChange_author:
2092 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2093 m_pImpl->SetCurrentRedlineAuthor( sStringValue );
2094 break;
2095 case NS_ooxml::LN_CT_TrackChange_date:
2096 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2097 m_pImpl->SetCurrentRedlineDate( sStringValue );
2098 break;
2099 case NS_ooxml::LN_CT_Markup_id:
2100 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2101 m_pImpl->SetCurrentRedlineId( nIntValue );
2102 break;
2103 case NS_ooxml::LN_token:
2104 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2105 m_pImpl->SetCurrentRedlineToken( nIntValue );
2106 break;
2107 case NS_ooxml::LN_CT_LineNumber_countBy:
2108 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
2109 case NS_ooxml::LN_CT_LineNumber_restart:
2110 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
2112 //line numbering in Writer is a global document setting
2113 //in Word is a section setting
2114 //if line numbering is switched on anywhere in the document it's set at the global settings
2115 LineNumberSettings aSettings = m_pImpl->GetLineNumberSettings();
2116 switch( nName )
2118 case NS_ooxml::LN_CT_LineNumber_countBy:
2119 aSettings.nInterval = nIntValue;
2120 break;
2121 case NS_ooxml::LN_CT_LineNumber_start:
2122 aSettings.nStartValue = nIntValue; // todo: has to be set at (each) first paragraph
2123 break;
2124 case NS_ooxml::LN_CT_LineNumber_distance:
2125 aSettings.nDistance = ConversionHelper::convertTwipToMM100( nIntValue );
2126 break;
2127 case NS_ooxml::LN_CT_LineNumber_restart:
2128 //page:empty, probably 0,section:1,continuous:2;
2129 aSettings.bRestartAtEachPage = nIntValue < 1;
2130 break;
2131 default:;
2133 m_pImpl->SetLineNumberSettings( aSettings );
2135 break;
2136 case NS_ooxml::LN_CT_FtnEdnRef_customMarkFollows:
2137 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2138 m_pImpl->SetCustomFtnMark( true );
2139 break;
2140 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2141 case NS_ooxml::LN_CT_FtnEdnRef_id:
2142 // footnote or endnote reference id - not needed
2143 case NS_ooxml::LN_CT_Color_themeColor:
2144 case NS_ooxml::LN_CT_Color_themeTint:
2145 case NS_ooxml::LN_CT_Color_themeShade:
2146 //unsupported
2147 break;
2148 case NS_ooxml::LN_endtrackchange:
2149 m_pImpl->RemoveCurrentRedline( );
2150 break;
2151 default:
2153 #if OSL_DEBUG_LEVEL > 0
2154 ::rtl::OString sMessage( "DomainMapper::attribute() - Id: ");
2155 sMessage += ::rtl::OString::valueOf( sal_Int32( nName ), 10 );
2156 sMessage += ::rtl::OString(" / 0x");
2157 sMessage += ::rtl::OString::valueOf( sal_Int32( nName ), 16 );
2158 // sMessage += ::rtl::OString(" / ");
2159 // sMessage += ::rtl::OString
2160 // ((*QNameToString::Instance())(nName).c_str());
2161 sMessage += ::rtl::OString(" value: ");
2162 sMessage += ::rtl::OString::valueOf( sal_Int32( nIntValue ), 10 );
2163 sMessage += ::rtl::OString(" / 0x");
2164 sMessage += ::rtl::OString::valueOf( sal_Int32( nIntValue ), 16 );
2165 OSL_ENSURE( false, sMessage.getStr()); //
2166 #endif
2170 #ifdef DEBUG_DOMAINMAPPER
2171 dmapper_logger->endElement("attribute");
2172 #endif
2174 /*-- 09.06.2006 09:52:12---------------------------------------------------
2176 -----------------------------------------------------------------------*/
2177 void DomainMapper::sprm(Sprm & rSprm)
2179 if( !m_pImpl->getTableManager().sprm(rSprm))
2180 DomainMapper::sprm( rSprm, m_pImpl->GetTopContext() );
2182 /*-- 20.06.2006 09:58:33---------------------------------------------------
2184 -----------------------------------------------------------------------*/
2185 void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmType )
2187 #ifdef DEBUG_DOMAINMAPPER
2188 dmapper_logger->startElement("sprm");
2189 dmapper_logger->chars(rSprm.toString());
2190 #endif
2191 OSL_ENSURE(rContext.get(), "PropertyMap has to be valid!");
2192 if(!rContext.get())
2193 return ;
2195 sal_uInt32 nSprmId = rSprm.getId();
2196 //needed for page properties
2197 SectionPropertyMap* pSectionContext = 0;
2198 //the section context is not availabe before the first call of startSectionGroup()
2199 if( !m_pImpl->IsAnyTableImport() )
2201 PropertyMapPtr pContext = m_pImpl->GetTopContextOfType(CONTEXT_SECTION);
2202 OSL_ENSURE(pContext.get(), "Section context is not in the stack!");
2203 pSectionContext = dynamic_cast< SectionPropertyMap* >( pContext.get() );
2206 //TODO: In rtl-paragraphs the meaning of left/right are to be exchanged
2207 bool bExchangeLeftRight = false;
2208 // if( nSprmId == NS_sprm::LN_PJcExtra && AlreadyInRTLPara() )
2209 // bExchangeLeftRight = true;
2210 Value::Pointer_t pValue = rSprm.getValue();
2211 sal_Int32 nIntValue = pValue->getInt();
2212 rtl::OUString sStringValue = pValue->getString();
2213 // printf ( "DomainMapper::sprm(0x%.4x, 0x%.4x) [%s]\n", (unsigned int)nSprmId, (unsigned int)nIntValue, ::rtl::OUStringToOString(sStringValue, RTL_TEXTENCODING_DONTKNOW).getStr());
2214 /* WRITERFILTERSTATUS: table: sprmdata */
2216 switch(nSprmId)
2218 case 2: // sprmPIstd
2219 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2220 case 0x4600:
2221 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2222 break; // sprmPIstd - style code
2223 case 3: // "sprmPIstdPermute
2224 case NS_sprm::LN_PIstdPermute:
2225 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2226 break; // sprmPIstdPermute
2227 case NS_sprm::LN_PIncLvl:
2228 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2229 break; // sprmPIncLvl
2230 case NS_sprm::LN_PJcExtra: // sprmPJc Asian (undocumented)
2231 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
2232 case NS_sprm::LN_PJc: // sprmPJc
2233 handleParaJustification(nIntValue, rContext, bExchangeLeftRight);
2234 break;
2235 case NS_sprm::LN_PFSideBySide:
2236 /* WRITERFILTERSTATUS: done: 0, planned: 3, spent: 0 */
2237 /* WRITERFILTERSTATUS: comment: */
2238 break; // sprmPFSideBySide
2240 case NS_sprm::LN_PFKeep: // sprmPFKeep
2241 /* WRITERFILTERSTATUS: done: 0, planned: 3, spent: 0 */
2242 /* WRITERFILTERSTATUS: comment: */
2243 break;
2244 case NS_sprm::LN_PFKeepFollow: // sprmPFKeepFollow
2245 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 1 */
2246 /* WRITERFILTERSTATUS: comment: */
2247 rContext->Insert(PROP_PARA_KEEP_TOGETHER, true, uno::makeAny( nIntValue ? true : false) );
2248 break;
2249 case NS_sprm::LN_PFPageBreakBefore:
2250 /* WRITERFILTERSTATUS: done: 100, planned: 3, spent: 0 */
2251 /* WRITERFILTERSTATUS: comment: */
2252 rContext->Insert(PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_PAGE_BEFORE ) );
2253 break; // sprmPFPageBreakBefore
2254 case NS_sprm::LN_PBrcl:
2255 break; // sprmPBrcl
2256 case NS_sprm::LN_PBrcp:
2257 break; // sprmPBrcp
2258 case NS_sprm::LN_PIlvl: // sprmPIlvl
2259 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 1 */
2260 /* WRITERFILTERSTATUS: comment: */
2261 //todo: Numbering level will be implemented in the near future (OOo 3.0?)
2262 if( m_pImpl->IsStyleSheetImport() )
2264 //style sheets cannot have a numbering rule attached
2265 StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() );
2266 pStyleSheetPropertyMap->SetListLevel( (sal_Int16)nIntValue );
2268 else
2269 rContext->Insert( PROP_NUMBERING_LEVEL, true, uno::makeAny( (sal_Int16)nIntValue ));
2270 break;
2271 case NS_sprm::LN_PIlfo: // sprmPIlfo
2272 /* WRITERFILTERSTATUS: done: 50, planned: 0, spent: 1 */
2273 /* WRITERFILTERSTATUS: comment: */
2275 //convert the ListTable entry to a NumberingRules propery and apply it
2276 ListsManager::Pointer pListTable = m_pImpl->GetListTable();
2277 ListDef::Pointer pList = pListTable->GetList( nIntValue );
2278 if( pList.get( ) )
2280 if( m_pImpl->IsStyleSheetImport() )
2282 //style sheets cannot have a numbering rule attached
2283 StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() );
2284 pStyleSheetPropertyMap->SetListId( nIntValue );
2286 else
2288 uno::Any aRules = uno::makeAny( pList->GetNumberingRules( ) );
2289 rContext->Insert( PROP_NUMBERING_RULES, true, aRules );
2292 else if ( !m_pImpl->IsStyleSheetImport( ) )
2294 rtl::OUString sNone;
2295 rContext->Insert( PROP_NUMBERING_STYLE_NAME, true, uno::makeAny( sNone ) );
2298 break;
2299 case NS_sprm::LN_PFNoLineNumb: // sprmPFNoLineNumb
2300 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 1 */
2301 /* WRITERFILTERSTATUS: comment: */
2302 rContext->Insert(PROP_PARA_LINE_NUMBER_COUNT, true, uno::makeAny( nIntValue ? false : true) );
2303 break;
2304 case NS_sprm::LN_PChgTabsPapx: // sprmPChgTabsPapx
2305 /* WRITERFILTERSTATUS: done: 90, planned: 8, spent: 8 */
2306 /* WRITERFILTERSTATUS: comment: bar tab stops a unavailable */
2308 // Initialize tab stop vector from style sheet
2309 uno::Any aValue = m_pImpl->GetPropertyFromStyleSheet(PROP_PARA_TAB_STOPS);
2310 uno::Sequence< style::TabStop > aStyleTabStops;
2311 if(aValue >>= aStyleTabStops)
2313 m_pImpl->InitTabStopFromStyle( aStyleTabStops );
2316 //create a new tab stop property - this is done with the contained properties
2317 resolveSprmProps(rSprm);
2318 //add this property
2319 rContext->Insert(PROP_PARA_TAB_STOPS, true, uno::makeAny( m_pImpl->GetCurrentTabStopAndClear()));
2321 break;
2322 case 0x845d: //right margin Asian - undocumented
2323 case 0x845e: //left margin Asian - undocumented
2324 case 16: // sprmPDxaRight - right margin
2325 case NS_sprm::LN_PDxaRight: // sprmPDxaRight - right margin
2326 case 17:
2327 case NS_sprm::LN_PDxaLeft: // sprmPDxaLeft
2328 /* WRITERFILTERSTATUS: done: 50, planned: 5, spent: 1 */
2329 if( NS_sprm::LN_PDxaLeft == nSprmId || 0x17 == nSprmId|| (bExchangeLeftRight && nSprmId == 0x845d) || ( !bExchangeLeftRight && nSprmId == 0x845e))
2330 rContext->Insert(
2331 eSprmType == SPRM_DEFAULT ? PROP_PARA_LEFT_MARGIN : PROP_LEFT_MARGIN,
2332 true,
2333 uno::makeAny( ConversionHelper::convertTwipToMM100( nIntValue ) ));
2334 else if(eSprmType == SPRM_DEFAULT)
2335 rContext->Insert(
2336 PROP_PARA_RIGHT_MARGIN, true,
2337 uno::makeAny( ConversionHelper::convertTwipToMM100(nIntValue ) ));
2338 //TODO: what happens to the right margins in numberings?
2339 break;
2340 case 18: // sprmPNest
2341 case NS_sprm::LN_PNest: // sprmPNest
2342 //not handled in the old WW8 filter
2343 break;
2344 case 0x8460: //first line indent Asian - undocumented
2345 case 19:
2346 case NS_sprm::LN_PDxaLeft1: // sprmPDxaLeft1
2347 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 1 */
2348 rContext->Insert(
2349 eSprmType == SPRM_DEFAULT ? PROP_PARA_FIRST_LINE_INDENT : PROP_FIRST_LINE_OFFSET,
2350 true,
2351 uno::makeAny( ConversionHelper::convertTwipToMM100(nIntValue ) ));
2352 break;
2353 case 20 : // sprmPDyaLine
2354 case NS_sprm::LN_PDyaLine: // sprmPDyaLine
2355 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 1 */
2357 style::LineSpacing aSpacing;
2358 sal_Int16 nDistance = sal_Int16(nIntValue & 0xffff);
2359 if(nIntValue & 0xffff0000)
2361 // single line in Writer is 100, in Word it is 240
2362 aSpacing.Mode = style::LineSpacingMode::PROP;
2363 aSpacing.Height = sal_Int16(sal_Int32(nDistance) * 100 /240);
2365 else
2367 if(nDistance < 0)
2369 aSpacing.Mode = style::LineSpacingMode::FIX;
2370 aSpacing.Height = sal_Int16(ConversionHelper::convertTwipToMM100(-nDistance));
2372 else if(nDistance >0)
2374 aSpacing.Mode = style::LineSpacingMode::MINIMUM;
2375 aSpacing.Height = sal_Int16(ConversionHelper::convertTwipToMM100(nDistance));
2378 rContext->Insert(PROP_PARA_LINE_SPACING, true, uno::makeAny( aSpacing ));
2380 break;
2381 case 21 : // legacy version
2382 case NS_sprm::LN_PDyaBefore: // sprmPDyaBefore
2383 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 1 */
2384 rContext->Insert(PROP_PARA_TOP_MARGIN, true, uno::makeAny( ConversionHelper::convertTwipToMM100( nIntValue ) ));
2385 break;
2386 case 22 :
2387 case NS_sprm::LN_PDyaAfter: // sprmPDyaAfter
2388 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 1 */
2389 rContext->Insert(PROP_PARA_BOTTOM_MARGIN, true, uno::makeAny( ConversionHelper::convertTwipToMM100( nIntValue ) ));
2390 break;
2392 case 23: //sprmPChgTabs
2393 case NS_sprm::LN_PChgTabs: // sprmPChgTabs
2394 /* WRITERFILTERSTATUS: done: 0, planned: 3, spent: 0 */
2395 OSL_ENSURE( false, "unhandled");
2396 //tabs of list level?
2397 break;
2398 case 24: // "sprmPFInTable"
2399 case NS_sprm::LN_PFInTable:
2400 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2401 break; // sprmPFInTable
2402 case NS_sprm::LN_PTableDepth: //sprmPTableDepth
2403 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
2404 //not handled via sprm but via text( 0x07 )
2405 break;
2406 case 25: // "sprmPTtp" pap.fTtp
2407 case NS_sprm::LN_PFTtp: // sprmPFTtp was: Read_TabRowEnd
2408 break;
2409 case 26: // "sprmPDxaAbs
2410 case NS_sprm::LN_PDxaAbs:
2411 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2412 break; // sprmPDxaAbs
2413 case 27: //sprmPDyaAbs
2414 case NS_sprm::LN_PDyaAbs:
2415 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2416 break; // sprmPDyaAbs
2417 case NS_sprm::LN_PDxaWidth:
2418 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2419 break; // sprmPDxaWidth
2420 case NS_sprm::LN_PPc:
2421 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2422 break; // sprmPPc
2423 case NS_sprm::LN_PBrcTop10:
2424 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2425 break; // sprmPBrcTop10
2426 case NS_sprm::LN_PBrcLeft10:
2427 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2428 break; // sprmPBrcLeft10
2429 case NS_sprm::LN_PBrcBottom10:
2430 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2431 break; // sprmPBrcBottom10
2432 case NS_sprm::LN_PBrcRight10:
2433 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2434 break; // sprmPBrcRight10
2435 case NS_sprm::LN_PBrcBetween10:
2436 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2437 break; // sprmPBrcBetween10
2438 case NS_sprm::LN_PBrcBar10:
2439 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2440 break; // sprmPBrcBar10
2441 case NS_sprm::LN_PDxaFromText10:
2442 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2443 break; // sprmPDxaFromText10
2444 case NS_sprm::LN_PWr:
2445 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2446 break; // sprmPWr
2448 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
2449 case NS_ooxml::LN_CT_PrBase_pBdr: //paragraph border
2450 resolveSprmProps(rSprm);
2451 break;
2452 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
2453 case NS_sprm::LN_PBrcTop: // sprmPBrcTop
2454 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
2455 /* WRITERFILTERSTATUS: comment: page borders are no handled yet, conversion incomplete */
2456 case NS_sprm::LN_PBrcLeft: // sprmPBrcLeft
2457 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
2458 /* WRITERFILTERSTATUS: comment: page borders are no handled yet, conversion incomplete */
2459 case NS_sprm::LN_PBrcBottom: // sprmPBrcBottom
2460 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
2461 /* WRITERFILTERSTATUS: comment: page borders are no handled yet, conversion incomplete */
2462 case NS_sprm::LN_PBrcRight: // sprmPBrcRight
2463 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
2464 /* WRITERFILTERSTATUS: comment: page borders are no handled yet, conversion incomplete */
2465 case NS_sprm::LN_PBrcBetween: // sprmPBrcBetween
2466 /* WRITERFILTERSTATUS: done: 0, planned: 8, spent: 0 */
2467 /* WRITERFILTERSTATUS: comment: */
2469 //in binary format the borders are directly provided in OOXML they are inside of properties
2470 if( IsOOXMLImport() )
2472 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
2473 if( pProperties.get())
2475 BorderHandlerPtr pBorderHandler( new BorderHandler( true ) );
2476 pProperties->resolve(*pBorderHandler);
2477 PropertyIds eBorderId = PropertyIds( 0 );
2478 PropertyIds eBorderDistId = PropertyIds( 0 );
2479 switch( nSprmId )
2481 case NS_sprm::LN_PBrcTop:
2482 eBorderId = PROP_TOP_BORDER;
2483 eBorderDistId = PROP_TOP_BORDER_DISTANCE;
2484 break;
2485 case NS_sprm::LN_PBrcLeft:
2486 eBorderId = PROP_LEFT_BORDER;
2487 eBorderDistId = PROP_LEFT_BORDER_DISTANCE;
2488 break;
2489 case NS_sprm::LN_PBrcBottom:
2490 eBorderId = PROP_BOTTOM_BORDER ;
2491 eBorderDistId = PROP_BOTTOM_BORDER_DISTANCE;
2492 break;
2493 case NS_sprm::LN_PBrcRight:
2494 eBorderId = PROP_RIGHT_BORDER;
2495 eBorderDistId = PROP_RIGHT_BORDER_DISTANCE ;
2496 break;
2497 case NS_sprm::LN_PBrcBetween:
2498 //not supported
2499 break;
2500 default:;
2502 if( eBorderId )
2503 rContext->Insert( eBorderId, true, uno::makeAny( pBorderHandler->getBorderLine()) , true);
2504 if(eBorderDistId)
2505 rContext->Insert(eBorderDistId, true, uno::makeAny( pBorderHandler->getLineDistance()), true);
2508 else
2510 table::BorderLine aBorderLine;
2511 sal_Int32 nLineDistance = ConversionHelper::MakeBorderLine( nIntValue, aBorderLine );
2512 PropertyIds eBorderId = PROP_LEFT_BORDER;
2513 PropertyIds eBorderDistId = PROP_LEFT_BORDER_DISTANCE ;
2514 switch( nSprmId )
2516 case NS_sprm::LN_PBrcBetween: // sprmPBrcBetween
2517 OSL_ENSURE( false, "TODO: inner border is not handled");
2518 break;
2519 case NS_sprm::LN_PBrcLeft: // sprmPBrcLeft
2520 eBorderId = PROP_LEFT_BORDER;
2521 eBorderDistId = PROP_LEFT_BORDER_DISTANCE ;
2522 break;
2523 case NS_sprm::LN_PBrcRight: // sprmPBrcRight
2524 eBorderId = PROP_RIGHT_BORDER ;
2525 eBorderDistId = PROP_RIGHT_BORDER_DISTANCE ;
2526 break;
2527 case NS_sprm::LN_PBrcTop: // sprmPBrcTop
2528 eBorderId = PROP_TOP_BORDER ;
2529 eBorderDistId = PROP_TOP_BORDER_DISTANCE;
2530 break;
2531 case NS_sprm::LN_PBrcBottom: // sprmPBrcBottom
2532 default:
2533 eBorderId = PROP_BOTTOM_BORDER ;
2534 eBorderDistId = PROP_BOTTOM_BORDER_DISTANCE;
2536 rContext->Insert(eBorderId, true, uno::makeAny( aBorderLine ));
2537 rContext->Insert(eBorderDistId, true, uno::makeAny( nLineDistance ));
2540 break;
2541 case NS_sprm::LN_PBorderTop:
2542 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2543 /* WRITERFILTERSTATUS: comment: probably _real_ border colors, unhandled */
2544 case NS_sprm::LN_PBorderLeft:
2545 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2546 /* WRITERFILTERSTATUS: comment: probably _real_ border colors, unhandled */
2547 case NS_sprm::LN_PBorderBottom:
2548 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2549 /* WRITERFILTERSTATUS: comment: probably _real_ border colors, unhandled */
2550 case NS_sprm::LN_PBorderRight:
2551 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2552 /* WRITERFILTERSTATUS: comment: probably _real_ border colors, unhandled */
2553 OSL_ENSURE( false, "TODO: border color definition");
2554 break;
2555 case NS_sprm::LN_PBrcBar:
2556 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2557 break; // sprmPBrcBar
2558 case NS_sprm::LN_PFNoAutoHyph: // sprmPFNoAutoHyph
2559 rContext->Insert(PROP_PARA_IS_HYPHENATION, true, uno::makeAny( nIntValue ? false : true ));
2560 break;
2561 case NS_sprm::LN_PWHeightAbs:
2562 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2563 break; // sprmPWHeightAbs
2564 case NS_sprm::LN_PDcs:
2565 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2566 break; // sprmPDcs
2568 case NS_sprm::LN_PShd: // sprmPShd
2570 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 2 */
2571 //contains fore color, back color and shadow percentage, results in a brush
2572 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
2573 if( pProperties.get())
2575 CellColorHandlerPtr pCellColorHandler( new CellColorHandler );
2576 pCellColorHandler->setParagraph();
2577 pProperties->resolve(*pCellColorHandler);
2578 rContext->insert( pCellColorHandler->getProperties(), true );
2581 break;
2582 case NS_sprm::LN_PDyaFromText:
2583 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2584 break; // sprmPDyaFromText
2585 case NS_sprm::LN_PDxaFromText:
2586 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2587 break; // sprmPDxaFromText
2588 case NS_sprm::LN_PFLocked:
2589 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2590 break; // sprmPFLocked
2591 case NS_sprm::LN_PFWidowControl:
2592 case NS_ooxml::LN_CT_PPrBase_widowControl:
2594 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2595 uno::Any aVal( uno::makeAny( sal_Int8(nIntValue ? 2 : 0 )));
2596 rContext->Insert( PROP_PARA_WIDOWS, true, aVal );
2597 rContext->Insert( PROP_PARA_ORPHANS, true, aVal );
2599 break; // sprmPFWidowControl
2600 case NS_sprm::LN_PRuler:
2601 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2602 break; // sprmPRuler
2603 case NS_sprm::LN_PFKinsoku:
2604 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2605 break; // sprmPFKinsoku
2606 case NS_sprm::LN_PFWordWrap:
2607 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2608 break; // sprmPFWordWrap
2609 case NS_sprm::LN_PFOverflowPunct: ; // sprmPFOverflowPunct - hanging punctuation
2610 rContext->Insert(PROP_PARA_IS_HANGING_PUNCTUATION, true, uno::makeAny( nIntValue ? false : true ));
2611 break;
2612 case NS_sprm::LN_PFTopLinePunct:
2613 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2614 break; // sprmPFTopLinePunct
2615 case NS_sprm::LN_PFAutoSpaceDE:
2616 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2617 break; // sprmPFAutoSpaceDE
2618 case NS_sprm::LN_PFAutoSpaceDN:
2619 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2620 break; // sprmPFAutoSpaceDN
2621 case NS_sprm::LN_PWAlignFont:
2622 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2623 break; // sprmPWAlignFont
2624 case NS_sprm::LN_PFrameTextFlow:
2625 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2626 break; // sprmPFrameTextFlow
2627 case NS_sprm::LN_PISnapBaseLine:
2628 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2629 break; // sprmPISnapBaseLine
2630 case NS_sprm::LN_PAnld:
2631 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2632 break; // sprmPAnld
2633 case NS_sprm::LN_PPropRMark:
2634 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2635 break; // sprmPPropRMark
2636 case NS_sprm::LN_POutLvl:
2637 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2639 if( m_pImpl->IsStyleSheetImport() )
2641 sal_Int16 nLvl = static_cast< sal_Int16 >( nIntValue );
2643 StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() );
2644 pStyleSheetPropertyMap->SetOutlineLevel( nLvl );
2647 break; // sprmPOutLvl
2648 case NS_sprm::LN_PFBiDi:
2649 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2650 break; // sprmPFBiDi
2651 case NS_sprm::LN_PFNumRMIns:
2652 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2653 break; // sprmPFNumRMIns
2654 case NS_sprm::LN_PCrLf:
2655 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2656 break; // sprmPCrLf
2657 case NS_sprm::LN_PNumRM:
2658 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2659 break; // sprmPNumRM
2660 case NS_sprm::LN_PHugePapx:
2661 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2662 break; // sprmPHugePapx
2663 case NS_sprm::LN_PFUsePgsuSettings:
2664 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2665 break; // sprmPFUsePgsuSettings
2666 case NS_sprm::LN_PFAdjustRight:
2667 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2668 break; // sprmPFAdjustRight
2669 case NS_sprm::LN_CFRMarkDel:
2670 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2671 break; // sprmCFRMarkDel
2672 case NS_sprm::LN_CFRMark:
2673 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2674 break; // sprmCFRMark
2675 case NS_sprm::LN_CFFldVanish:
2676 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2677 break; // sprmCFFldVanish
2678 case NS_sprm::LN_CFSpec: // sprmCFSpec
2679 break;
2680 case NS_sprm::LN_CPicLocation: // sprmCPicLocation
2681 //is being resolved on the tokenizer side
2682 break;
2683 case NS_sprm::LN_CIbstRMark:
2684 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2685 break; // sprmCIbstRMark
2686 case NS_sprm::LN_CDttmRMark:
2687 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2688 break; // sprmCDttmRMark
2689 case NS_sprm::LN_CFData:
2690 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2691 break; // sprmCFData
2692 case NS_sprm::LN_CIdslRMark:
2693 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2694 break; // sprmCIdslRMark
2695 case NS_sprm::LN_CChs:
2696 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2697 break; // sprmCChs
2698 case NS_sprm::LN_CSymbol: // sprmCSymbol
2699 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2700 resolveSprmProps(rSprm); //resolves LN_FONT and LN_CHAR
2701 break;
2702 case NS_sprm::LN_CFOle2:
2703 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2704 break; // sprmCFOle2
2705 case NS_sprm::LN_CIdCharType:
2706 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2707 break; // sprmCIdCharType
2708 case NS_sprm::LN_CHighlight:
2709 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2711 sal_Int32 nColor = 0;
2712 if(true ==( mbIsHighlightSet = getColorFromIndex(nIntValue, nColor)))
2713 rContext->Insert(PROP_CHAR_BACK_COLOR, true, uno::makeAny( nColor ));
2714 else if (mnBackgroundColor)
2715 rContext->Insert(PROP_CHAR_BACK_COLOR, true, uno::makeAny( mnBackgroundColor ));
2717 break; // sprmCHighlight
2718 case NS_sprm::LN_CObjLocation:
2719 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2720 break; // sprmCObjLocation
2721 case NS_sprm::LN_CFFtcAsciSymb:
2722 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2723 break; // sprmCFFtcAsciSymb
2724 case NS_sprm::LN_CIstd:
2725 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2726 break; // sprmCIstd
2727 case NS_sprm::LN_CIstdPermute:
2728 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2729 break; // sprmCIstdPermute
2730 case NS_sprm::LN_CDefault:
2731 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2732 break; // sprmCDefault
2733 case NS_sprm::LN_CPlain:
2734 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2735 break; // sprmCPlain
2736 case NS_sprm::LN_CKcd:
2737 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2738 rContext->Insert(PROP_CHAR_EMPHASIS, true, uno::makeAny ( getEmphasisValue (nIntValue)));
2739 break; // sprmCKcd
2740 case NS_sprm::LN_CFEmboss:// sprmCFEmboss
2741 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */
2742 case 60:// sprmCFBold
2743 case NS_sprm::LN_CFBoldBi:// sprmCFBoldBi (offset 0x27 to normal bold)
2744 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */
2745 case NS_sprm::LN_CFItalicBi:// sprmCFItalicBi (offset 0x27 to normal italic)
2746 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */
2747 case NS_sprm::LN_CFBold: //sprmCFBold
2748 case 61: /*sprmCFItalic*/
2749 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */
2750 case NS_sprm::LN_CFItalic: //sprmCFItalic
2751 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */
2752 case NS_sprm::LN_CFStrike: //sprmCFStrike
2753 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5*/
2754 case NS_sprm::LN_CFOutline: //sprmCFOutline
2755 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */
2756 case NS_sprm::LN_CFShadow: //sprmCFShadow
2757 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */
2758 case NS_sprm::LN_CFSmallCaps: //sprmCFSmallCaps
2759 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */
2760 case NS_sprm::LN_CFCaps: //sprmCFCaps
2761 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */
2762 case NS_sprm::LN_CFVanish: //sprmCFVanish
2763 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */
2764 case NS_sprm::LN_CFDStrike: // sprmCFDStrike
2765 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */
2767 PropertyIds ePropertyId = PROP_CHAR_WEIGHT; //initialized to prevent warning!
2768 switch( nSprmId )
2770 case 60:// sprmCFBold
2771 case NS_sprm::LN_CFBoldBi: // sprmCFBoldBi
2772 case NS_sprm::LN_CFBold: /*sprmCFBold*/
2773 ePropertyId = nSprmId != NS_sprm::LN_CFBoldBi ? PROP_CHAR_WEIGHT : PROP_CHAR_WEIGHT_COMPLEX;
2774 break;
2775 case 61: /*sprmCFItalic*/
2776 case NS_sprm::LN_CFItalicBi: // sprmCFItalicBi
2777 case NS_sprm::LN_CFItalic: /*sprmCFItalic*/
2778 ePropertyId = nSprmId == 0x836 ? PROP_CHAR_POSTURE : PROP_CHAR_POSTURE_COMPLEX;
2779 break;
2780 case NS_sprm::LN_CFStrike: /*sprmCFStrike*/
2781 case NS_sprm::LN_CFDStrike : /*sprmCFDStrike double strike through*/
2782 ePropertyId = PROP_CHAR_STRIKEOUT;
2783 break;
2784 case NS_sprm::LN_CFOutline: /*sprmCFOutline*/
2785 ePropertyId = PROP_CHAR_CONTOURED;
2786 break;
2787 case NS_sprm::LN_CFShadow: /*sprmCFShadow*/
2788 ePropertyId = PROP_CHAR_SHADOWED;
2789 break;
2790 case NS_sprm::LN_CFSmallCaps: /*sprmCFSmallCaps*/
2791 case NS_sprm::LN_CFCaps: /*sprmCFCaps*/
2792 ePropertyId = PROP_CHAR_CASE_MAP;
2793 break;
2794 case NS_sprm::LN_CFVanish: /*sprmCFVanish*/
2795 ePropertyId = PROP_CHAR_HIDDEN;
2796 break;
2797 case NS_sprm::LN_CFEmboss: /*sprmCFEmboss*/
2798 ePropertyId = PROP_CHAR_RELIEF;
2799 break;
2801 //expected: 0,1,128,129
2802 if(nIntValue != 128) //inherited from paragraph - ignore
2804 if( nIntValue == 129) //inverted style sheet value
2806 //get value from style sheet and invert it
2807 sal_Int16 nStyleValue = 0;
2808 double fDoubleValue;
2809 uno::Any aStyleVal = m_pImpl->GetPropertyFromStyleSheet(ePropertyId);
2810 if( !aStyleVal.hasValue() )
2812 nIntValue = 0x83a == nSprmId ?
2813 4 : 1;
2815 else if(aStyleVal.getValueTypeClass() == uno::TypeClass_FLOAT )
2817 //only in case of awt::FontWeight
2818 aStyleVal >>= fDoubleValue;
2819 nIntValue = fDoubleValue > 100. ? 0 : 1;
2821 else if((aStyleVal >>= nStyleValue) ||
2822 (nStyleValue = (sal_Int16)comphelper::getEnumAsINT32(aStyleVal)) >= 0 )
2824 nIntValue = 0x83a == nSprmId ?
2825 nStyleValue ? 0 : 4 :
2826 nStyleValue ? 0 : 1;
2828 else
2830 OSL_ENSURE( false, "what type was it");
2834 switch( nSprmId )
2836 case 60:/*sprmCFBold*/
2837 case NS_sprm::LN_CFBold: /*sprmCFBold*/
2838 case NS_sprm::LN_CFBoldBi: // sprmCFBoldBi
2840 uno::Any aBold( uno::makeAny( nIntValue ? awt::FontWeight::BOLD : awt::FontWeight::NORMAL ) );
2841 rContext->Insert(ePropertyId, true, aBold );
2842 if( nSprmId != NS_sprm::LN_CFBoldBi ) // sprmCFBoldBi
2843 rContext->Insert(PROP_CHAR_WEIGHT_ASIAN, true, aBold );
2845 break;
2846 case 61: /*sprmCFItalic*/
2847 case NS_sprm::LN_CFItalic: /*sprmCFItalic*/
2848 case NS_sprm::LN_CFItalicBi: // sprmCFItalicBi
2850 uno::Any aPosture( uno::makeAny( nIntValue ? awt::FontSlant_ITALIC : awt::FontSlant_NONE ) );
2851 rContext->Insert( ePropertyId, true, aPosture );
2852 if( nSprmId != NS_sprm::LN_CFItalicBi ) // sprmCFItalicBi
2853 rContext->Insert(PROP_CHAR_POSTURE_ASIAN, true, aPosture );
2855 break;
2856 case NS_sprm::LN_CFStrike: /*sprmCFStrike*/
2857 rContext->Insert(ePropertyId, true,
2858 uno::makeAny( nIntValue ? awt::FontStrikeout::SINGLE : awt::FontStrikeout::NONE ) );
2859 break;
2860 case NS_sprm::LN_CFDStrike : /*sprmCFDStrike double strike through*/
2861 rContext->Insert(ePropertyId, true,
2862 uno::makeAny( awt::FontStrikeout::DOUBLE ) );
2863 break;
2864 case NS_sprm::LN_CFOutline: /*sprmCFOutline*/
2865 case NS_sprm::LN_CFShadow: /*sprmCFShadow*/
2866 case NS_sprm::LN_CFVanish: /*sprmCFVanish*/
2867 rContext->Insert(ePropertyId, true, uno::makeAny( nIntValue ? true : false ));
2868 break;
2869 case NS_sprm::LN_CFSmallCaps: /*sprmCFSmallCaps*/
2870 rContext->Insert(ePropertyId, true,
2871 uno::makeAny( nIntValue ? style::CaseMap::SMALLCAPS : style::CaseMap::NONE));
2872 break;
2873 case NS_sprm::LN_CFCaps: /*sprmCFCaps*/
2874 rContext->Insert(ePropertyId, true,
2875 uno::makeAny( nIntValue ? style::CaseMap::UPPERCASE : style::CaseMap::NONE));
2876 break;
2877 case NS_sprm::LN_CFEmboss: /*sprmCFEmboss*/
2878 rContext->Insert(ePropertyId, true,
2879 uno::makeAny( nIntValue ? awt::FontRelief::EMBOSSED : awt::FontRelief::NONE ));
2880 break;
2885 break;
2886 case NS_sprm::LN_CFtcDefault:
2887 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2888 break; // sprmCFtcDefault
2889 case NS_sprm::LN_CKul: // sprmCKul
2890 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
2892 // Parameter: 0 = none, 1 = single, 2 = by Word,
2893 // 3 = double, 4 = dotted, 5 = hidden
2894 // 6 = thick, 7 = dash, 8 = dot(not used)
2895 // 9 = dotdash 10 = dotdotdash 11 = wave
2896 handleUnderlineType(nIntValue, rContext);
2898 break;
2899 case NS_sprm::LN_CSizePos:
2900 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2901 break; // sprmCSizePos
2902 case NS_sprm::LN_CLid:
2903 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2904 break; // sprmCLid
2905 case NS_sprm::LN_CIco:
2906 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2908 sal_Int32 nColor = 0;
2909 if (getColorFromIndex(nIntValue, nColor))
2910 rContext->Insert(PROP_CHAR_COLOR, true, uno::makeAny( nColor ) );
2912 break; // sprmCIco
2913 case NS_sprm::LN_CHpsBi: // sprmCHpsBi
2914 case NS_sprm::LN_CHps: // sprmCHps
2915 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
2917 //multiples of half points (12pt == 24)
2918 double fVal = double(nIntValue) / 2.;
2919 uno::Any aVal = uno::makeAny( fVal );
2920 if( NS_sprm::LN_CHpsBi == nSprmId )
2921 rContext->Insert( PROP_CHAR_HEIGHT_COMPLEX, true, aVal );
2922 else
2924 //Asian get the same value as Western
2925 rContext->Insert( PROP_CHAR_HEIGHT, true, aVal );
2926 rContext->Insert( PROP_CHAR_HEIGHT_ASIAN, true, aVal );
2929 break;
2930 case NS_sprm::LN_CHpsInc:
2931 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2932 break; // sprmCHpsInc
2933 case NS_sprm::LN_CHpsPos:
2934 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2936 // FIXME: ww8 filter in ww8par6.cxx has a Read_SubSuperProp function
2937 // that counts the escapement from this value and font size. So it will be
2938 // on our TODO list
2939 sal_Int16 nEscapement = 0;
2940 sal_Int8 nProp = 100;
2941 if (nIntValue < 0)
2942 nEscapement = -58;
2943 else if (nIntValue > 0)
2944 nEscapement = 58;
2945 else /* (nIntValue == 0) */
2946 nProp = 0;
2947 rContext->Insert(PROP_CHAR_ESCAPEMENT, true, uno::makeAny( nEscapement ) );
2948 rContext->Insert(PROP_CHAR_ESCAPEMENT_HEIGHT, true, uno::makeAny( nProp ) );
2950 break; // sprmCHpsPos
2951 case NS_sprm::LN_CHpsPosAdj:
2952 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2953 break; // sprmCHpsPosAdj
2954 case NS_sprm::LN_CMajority:
2955 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2956 break; // sprmCMajority
2957 case NS_sprm::LN_CIss: // sprmCIss
2958 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
2960 //sub/super script 1: super, 2: sub, 0: normal
2961 sal_Int16 nEscapement = 0;
2962 sal_Int8 nProp = 58;
2963 switch(nIntValue)
2965 case 1: //super
2966 nEscapement = 101;
2967 break;
2968 case 2: //sub
2969 nEscapement = -101;
2970 break;
2971 case 0: nProp = 0;break; //none
2973 rContext->Insert(PROP_CHAR_ESCAPEMENT, true, uno::makeAny( nEscapement ) );
2974 rContext->Insert(PROP_CHAR_ESCAPEMENT_HEIGHT, true, uno::makeAny( nProp ) );
2976 break;
2977 case NS_sprm::LN_CHpsNew50:
2978 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2979 break; // sprmCHpsNew50
2980 case NS_sprm::LN_CHpsInc1:
2981 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2982 break; // sprmCHpsInc1
2983 case 71 : //"sprmCDxaSpace"
2984 case 96 : //"sprmCDxaSpace"
2985 case NS_sprm::LN_CDxaSpace: // sprmCDxaSpace
2986 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */
2987 //Kerning half point values
2988 //TODO: there are two kerning values -
2989 // in ww8par6.cxx NS_sprm::LN_CHpsKern is used as boolean AutoKerning
2990 rContext->Insert(PROP_CHAR_CHAR_KERNING, true, uno::makeAny( sal_Int16(ConversionHelper::convertTwipToMM100(sal_Int16(nIntValue))) ) );
2991 break;
2992 case NS_sprm::LN_CHpsKern: // sprmCHpsKern auto kerning is bound to a minimum font size in Word - but not in Writer :-(
2993 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
2994 rContext->Insert(PROP_CHAR_AUTO_KERNING, true, uno::makeAny( true ) );
2995 break;
2996 case NS_sprm::LN_CMajority50:
2997 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2998 break; // sprmCMajority50
2999 case NS_sprm::LN_CHpsMul:
3000 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3001 break; // sprmCHpsMul
3002 case NS_sprm::LN_CYsri:
3003 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3004 break; // sprmCYsri
3005 case NS_sprm::LN_CRgFtc0: // sprmCRgFtc0 //ascii font index
3006 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3007 case NS_sprm::LN_CRgFtc1: // sprmCRgFtc1 //Asian font index
3008 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3009 case NS_sprm::LN_CRgFtc2: // sprmCRgFtc2 //CTL font index
3010 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3011 case NS_sprm::LN_CFtcBi: // sprmCFtcBi //font index of a CTL font
3012 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3014 FontTablePtr pFontTable = m_pImpl->GetFontTable();
3015 if(nIntValue >= 0 && pFontTable->size() > sal_uInt32(nIntValue))
3017 PropertyIds eFontName = PROP_CHAR_FONT_NAME;
3018 PropertyIds eFontStyle = PROP_CHAR_FONT_STYLE;
3019 PropertyIds eFontFamily = PROP_CHAR_FONT_FAMILY;
3020 PropertyIds eFontCharSet = PROP_CHAR_FONT_CHAR_SET;
3021 PropertyIds eFontPitch = PROP_CHAR_FONT_PITCH;
3022 switch(nSprmId)
3024 case NS_sprm::LN_CRgFtc0:
3025 //already initialized
3026 break;
3027 case NS_sprm::LN_CRgFtc1:
3028 eFontName = PROP_CHAR_FONT_NAME_ASIAN;
3029 eFontStyle = PROP_CHAR_FONT_STYLE_ASIAN;
3030 eFontFamily = PROP_CHAR_FONT_FAMILY_ASIAN;
3031 eFontCharSet = PROP_CHAR_FONT_CHAR_SET_ASIAN;
3032 eFontPitch = PROP_CHAR_FONT_PITCH_ASIAN;
3033 break;
3034 case NS_sprm::LN_CRgFtc2:
3035 case NS_sprm::LN_CFtcBi:
3036 eFontName = PROP_CHAR_FONT_NAME_COMPLEX;
3037 eFontStyle = PROP_CHAR_FONT_STYLE_COMPLEX;
3038 eFontFamily = PROP_CHAR_FONT_FAMILY_COMPLEX;
3039 eFontCharSet = PROP_CHAR_FONT_CHAR_SET_COMPLEX;
3040 eFontPitch = PROP_CHAR_FONT_PITCH_COMPLEX;
3041 break;
3043 const FontEntry* pFontEntry = pFontTable->getFontEntry(sal_uInt32(nIntValue));
3044 rContext->Insert(eFontName, true, uno::makeAny( pFontEntry->sFontName ));
3045 // rContext->Insert(eFontStyle, uno::makeAny( pFontEntry-> ));
3046 // rContext->Insert(eFontFamily, uno::makeAny( pFontEntry-> ));
3047 rContext->Insert(eFontCharSet, true, uno::makeAny( (sal_Int16)pFontEntry->nTextEncoding ));
3048 rContext->Insert(eFontPitch, true, uno::makeAny( pFontEntry->nPitchRequest ));
3051 break;
3052 case NS_sprm::LN_CCharScale: // sprmCCharScale
3053 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3054 rContext->Insert(PROP_CHAR_SCALE_WIDTH, true,
3055 uno::makeAny( sal_Int16(nIntValue) ));
3056 break;
3057 case NS_sprm::LN_CFImprint: // sprmCFImprint 1 or 0
3058 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3059 // FontRelief: NONE, EMBOSSED, ENGRAVED
3060 rContext->Insert(PROP_CHAR_RELIEF, true,
3061 uno::makeAny( nIntValue ? awt::FontRelief::ENGRAVED : awt::FontRelief::NONE ));
3062 break;
3063 case NS_sprm::LN_CFObj:
3064 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3065 break; // sprmCFObj
3066 case NS_sprm::LN_CPropRMark:
3067 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3068 break; // sprmCPropRMark
3069 case NS_sprm::LN_CSfxText:
3070 // The file-format has many character animations. We have only
3071 // one, so we use it always. Suboptimal solution though.
3072 if (nIntValue)
3073 rContext->Insert(PROP_CHAR_FLASH, true, uno::makeAny( true ));
3074 else
3075 rContext->Insert(PROP_CHAR_FLASH, true, uno::makeAny( false ));
3076 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3077 break; // sprmCSfxText
3078 case NS_sprm::LN_CFBiDi:
3079 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3080 break; // sprmCFBiDi
3081 case NS_sprm::LN_CFDiacColor:
3082 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3083 break; // sprmCFDiacColor
3084 case NS_sprm::LN_CIcoBi:
3085 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3086 break; // sprmCIcoBi
3087 case NS_sprm::LN_CDispFldRMark:
3088 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3089 break; // sprmCDispFldRMark
3090 case NS_sprm::LN_CIbstRMarkDel:
3091 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3092 break; // sprmCIbstRMarkDel
3093 case NS_sprm::LN_CDttmRMarkDel:
3094 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3095 break; // sprmCDttmRMarkDel
3096 case NS_sprm::LN_CBrc:
3097 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3098 break; // sprmCBrc
3099 case NS_sprm::LN_CShd:
3100 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3101 break; // sprmCShd
3102 case NS_sprm::LN_CIdslRMarkDel:
3103 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3104 break; // sprmCIdslRMarkDel
3105 case NS_sprm::LN_CFUsePgsuSettings:
3106 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3107 break; // sprmCFUsePgsuSettings
3108 case NS_sprm::LN_CCpg:
3109 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3110 break; // sprmCCpg
3111 case NS_sprm::LN_CLidBi: // sprmCLidBi language complex
3112 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3113 case 0x4873: //sprmCRgLid
3114 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 1 */
3115 //undocumented but interpreted as western language
3116 case NS_sprm::LN_CRgLid0: // sprmCRgLid0 language Western
3117 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3118 case NS_sprm::LN_CRgLid1: // sprmCRgLid1 language Asian
3119 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3121 lang::Locale aLocale;
3122 MsLangId::convertLanguageToLocale( (LanguageType)nIntValue, aLocale );
3123 rContext->Insert(NS_sprm::LN_CRgLid0 == nSprmId ? PROP_CHAR_LOCALE :
3124 NS_sprm::LN_CRgLid1 == nSprmId ? PROP_CHAR_LOCALE_ASIAN : PROP_CHAR_LOCALE_COMPLEX,
3125 true,
3126 uno::makeAny( aLocale ) );
3128 break;
3130 case NS_sprm::LN_CIdctHint: // sprmCIdctHint
3131 //list table - text offset???
3132 break;
3133 case NS_sprm::LN_PicBrcl:
3134 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3135 break; // sprmPicBrcl
3136 case NS_sprm::LN_PicScale:
3137 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3138 break; // sprmPicScale
3139 case NS_sprm::LN_PicBrcTop:
3140 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3141 break; // sprmPicBrcTop
3142 case NS_sprm::LN_PicBrcLeft:
3143 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3144 break; // sprmPicBrcLeft
3145 case NS_sprm::LN_PicBrcBottom:
3146 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3147 break; // sprmPicBrcBoConversionHelper::convertTwipToMM100ttom
3148 case NS_sprm::LN_PicBrcRight:
3149 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3150 break; // sprmPicBrcRight
3151 case NS_sprm::LN_ScnsPgn:
3152 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3153 break; // sprmScnsPgn
3154 case NS_sprm::LN_SiHeadingPgn:
3155 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3156 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3157 if(pSectionContext)
3158 pSectionContext->SetEvenlySpaced( nIntValue > 0 );
3160 break; // sprmSiHeadingPgn
3161 case NS_sprm::LN_SOlstAnm:
3162 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3163 break; // sprmSOlstAnm
3164 case 136:
3165 case NS_sprm::LN_SDxaColWidth: // sprmSDxaColWidth
3166 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3167 // contains the twip width of the column as 3-byte-code
3168 // the lowet byte contains the index
3169 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3170 if(pSectionContext)
3171 pSectionContext->AppendColumnWidth( ConversionHelper::convertTwipToMM100( (nIntValue & 0xffff00) >> 8 ));
3172 break;
3173 case NS_sprm::LN_SDxaColSpacing: // sprmSDxaColSpacing
3174 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3175 // the lowet byte contains the index
3176 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3177 if(pSectionContext)
3178 pSectionContext->AppendColumnSpacing( ConversionHelper::convertTwipToMM100( (nIntValue & 0xffff00) >> 8 ));
3179 break;
3180 case 138:
3181 case NS_sprm::LN_SFEvenlySpaced:
3182 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3183 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3184 if(pSectionContext)
3185 pSectionContext->SetEvenlySpaced( nIntValue > 0 );
3186 break; // sprmSFEvenlySpaced
3187 case NS_sprm::LN_SFProtected: // sprmSFProtected
3188 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3189 //todo: missing feature - unlocked sections in protected documents
3190 break;
3191 case NS_sprm::LN_SDmBinFirst: // sprmSDmBinFirst
3192 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3193 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3194 if(pSectionContext)
3195 pSectionContext->SetFirstPaperBin(nIntValue);
3196 break;
3197 case NS_sprm::LN_SDmBinOther: // sprmSDmBinOther
3198 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3199 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3200 if(pSectionContext)
3201 pSectionContext->SetPaperBin( nIntValue );
3202 break;
3203 case NS_sprm::LN_SBkc: // sprmSBkc
3204 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */
3205 /* break type
3206 0 - No break
3207 1 - New Colunn
3208 2 - New page
3209 3 - Even page
3210 4 - odd page
3212 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3213 if(pSectionContext)
3214 pSectionContext->SetBreakType( nIntValue );
3215 break;
3216 case 143:
3217 case NS_sprm::LN_SFTitlePage: // sprmSFTitlePage
3218 case NS_ooxml::LN_EG_SectPrContents_titlePg:
3220 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3221 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3222 if(pSectionContext)
3223 pSectionContext->SetTitlePage( nIntValue > 0 ? true : false );//section has title page
3225 break;
3226 case 144:
3227 case NS_sprm::LN_SCcolumns: // sprmSCcolumns
3228 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3229 //no of columns - 1
3230 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3231 if(pSectionContext)
3232 pSectionContext->SetColumnCount( (sal_Int16) nIntValue );
3233 break;
3234 case 145:
3235 case NS_sprm::LN_SDxaColumns: // sprmSDxaColumns
3236 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3237 //column distance - default 708 twip
3238 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3239 if(pSectionContext)
3240 pSectionContext->SetColumnDistance( ConversionHelper::convertTwipToMM100( nIntValue ) );
3241 break;
3242 case NS_sprm::LN_SFAutoPgn:
3243 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3244 break; // sprmSFAutoPgn
3245 case 147:
3246 case NS_sprm::LN_SNfcPgn: // sprmSNfcPgn
3247 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3248 //page numbering 0 - Arab, 1 - ROMAN, 2 - roman, 3 - ABC, 4 abc
3249 sal_Int16 nNumbering;
3250 switch( nIntValue )
3252 case 1: nNumbering = style::NumberingType::ROMAN_UPPER;
3253 case 2: nNumbering = style::NumberingType::ROMAN_LOWER;
3254 case 3: nNumbering = style::NumberingType::CHARS_UPPER_LETTER;
3255 case 4: nNumbering = style::NumberingType::CHARS_LOWER_LETTER;
3256 case 0:
3257 default:
3258 nNumbering = style::NumberingType::ARABIC;
3260 rContext->Insert( PROP_NUMBERING_TYPE, false, uno::makeAny( nNumbering ) );
3261 break;
3262 case NS_sprm::LN_SDyaPgn:
3263 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3264 break; // sprmSDyaPgn
3265 case NS_sprm::LN_SDxaPgn:
3266 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3267 break; // sprmSDxaPgn
3268 case 150:
3269 case NS_sprm::LN_SFPgnRestart: // sprmSFPgnRestart
3271 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3272 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3273 if(pSectionContext)
3274 pSectionContext->SetPageNoRestart( nIntValue > 0 );
3276 break;
3277 case NS_sprm::LN_SFEndnote:
3278 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3279 break; // sprmSFEndnote
3280 case 154:
3281 case NS_sprm::LN_SNLnnMod:// sprmSNLnnMod
3282 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3283 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3284 if( pSectionContext )
3285 pSectionContext->SetLnnMod( nIntValue );
3286 break;
3287 case 155:
3288 case NS_sprm::LN_SDxaLnn: // sprmSDxaLnn
3289 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3290 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3291 if( pSectionContext )
3292 pSectionContext->SetdxaLnn( nIntValue );
3293 break;
3294 case 152:
3295 case NS_sprm::LN_SLnc:// sprmSLnc
3296 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3297 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3298 if( pSectionContext )
3299 pSectionContext->SetLnc( nIntValue );
3300 break;
3301 case 160:
3302 case NS_sprm::LN_SLnnMin: // sprmSLnnMin
3303 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3304 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3305 if( pSectionContext )
3306 pSectionContext->SetLnnMin( nIntValue );
3307 break;
3309 case NS_sprm::LN_SGprfIhdt:
3310 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3311 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3312 //flags about header/footer sharing and footnotes?
3313 /* ww8scan.hxx:
3314 * WW8_HEADER_EVEN = 0x01, WW8_HEADER_ODD = 0x02, WW8_FOOTER_EVEN = 0x04,
3315 * WW8_FOOTER_ODD = 0x08, WW8_HEADER_FIRST = 0x10, WW8_FOOTER_FIRST = 0x20
3318 // if(pSectionContext)
3319 break; // sprmSGprfIhdt
3320 case NS_sprm::LN_SDyaHdrTop: // sprmSDyaHdrTop
3321 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3322 // default 720 twip
3323 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3324 if(pSectionContext)
3325 pSectionContext->SetHeaderTop( ConversionHelper::convertTwipToMM100( nIntValue ));
3326 break;
3327 case NS_sprm::LN_SDyaHdrBottom: // sprmSDyaHdrBottom
3328 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3329 // default 720 twip
3330 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3331 if(pSectionContext)
3332 pSectionContext->SetHeaderBottom( ConversionHelper::convertTwipToMM100( nIntValue ) );
3333 break;
3334 case 158:
3335 case NS_sprm::LN_SLBetween: // sprmSLBetween
3336 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3337 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3338 if(pSectionContext)
3339 pSectionContext->SetSeparatorLine( nIntValue > 0 );
3340 break;
3341 case NS_sprm::LN_SVjc:
3342 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3343 break; // sprmSVjc
3344 case 161:
3345 case NS_sprm::LN_SPgnStart: // sprmSPgnStart
3346 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3347 //page number
3348 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3349 if(pSectionContext)
3350 pSectionContext->SetPageNumber( nIntValue );
3351 break;
3352 case 162:
3353 case NS_sprm::LN_SBOrientation:
3354 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3355 //todo: the old filter assumed that a value of 2 points to double-pages layout
3356 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3357 if(pSectionContext)
3358 pSectionContext->SetLandscape( nIntValue > 0 );
3359 rContext->Insert( PROP_IS_LANDSCAPE , false, uno::makeAny( nIntValue > 0 ));
3360 break; // sprmSBOrientation
3361 case NS_sprm::LN_SBCustomize:
3362 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3363 break; // sprmSBCustomize
3364 case 165:
3365 case NS_sprm::LN_SYaPage: // sprmSYaPage
3367 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3368 //page height, rounded to default values, default: 0x3dc0 twip
3369 sal_Int32 nHeight = ConversionHelper::convertTwipToMM100( nIntValue );
3370 rContext->Insert( PROP_HEIGHT, false, uno::makeAny( PaperInfo::sloppyFitPageDimension( nHeight ) ) );
3372 break;
3373 case NS_sprm::LN_SXaPage: // sprmSXaPage
3375 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3376 //page width, rounded to default values, default 0x2fd0 twip
3377 sal_Int32 nWidth = ConversionHelper::convertTwipToMM100( nIntValue );
3378 rContext->Insert( PROP_WIDTH, false, uno::makeAny( PaperInfo::sloppyFitPageDimension( nWidth ) ) );
3380 break;
3381 case 166:
3382 case NS_sprm::LN_SDxaLeft: // sprmSDxaLeft
3384 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3385 //left page margin default 0x708 twip
3386 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3387 sal_Int32 nConverted = ConversionHelper::convertTwipToMM100( nIntValue );
3388 if(pSectionContext)
3389 pSectionContext->SetLeftMargin( nConverted );
3390 rContext->Insert( PROP_LEFT_MARGIN, false, uno::makeAny( nConverted ));
3392 break;
3393 case 167:
3394 case NS_sprm::LN_SDxaRight: // sprmSDxaRight
3396 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3397 //right page margin default 0x708 twip
3398 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3399 sal_Int32 nConverted = ConversionHelper::convertTwipToMM100( nIntValue );
3400 if(pSectionContext)
3401 pSectionContext->SetRightMargin( nConverted );
3402 rContext->Insert( PROP_RIGHT_MARGIN, false, uno::makeAny( nConverted ));
3404 break;
3405 case 168:
3406 case NS_sprm::LN_SDyaTop: // sprmSDyaTop
3408 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3409 //top page margin default 1440 twip
3410 //todo: check cast of SVBT16
3411 sal_Int32 nConverted = ConversionHelper::convertTwipToMM100( static_cast< sal_Int16 >( nIntValue ) );
3412 rContext->Insert( PROP_TOP_MARGIN, false, uno::makeAny( nConverted ) );
3413 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3414 if(pSectionContext)
3415 pSectionContext->SetTopMargin( nConverted );
3417 break;
3418 case 169:
3419 case NS_sprm::LN_SDyaBottom: // sprmSDyaBottom
3421 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3422 //bottom page margin default 1440 twip
3423 //todo: check cast of SVBT16
3424 sal_Int32 nConverted = ConversionHelper::convertTwipToMM100( static_cast< sal_Int16 >( nIntValue ) );
3425 rContext->Insert( PROP_BOTTOM_MARGIN, false, uno::makeAny( nConverted) );
3426 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3427 if(pSectionContext)
3428 pSectionContext->SetBottomMargin( nConverted );
3430 break;
3431 case 170:
3432 case NS_sprm::LN_SDzaGutter: // sprmSDzaGutter
3434 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3435 // gutter is added to one of the margins of a section depending on RTL, can be placed on top either
3436 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3437 if(pSectionContext)
3439 pSectionContext->SetDzaGutter( ConversionHelper::convertTwipToMM100( nIntValue ) );
3442 break;
3443 case NS_sprm::LN_SDmPaperReq: // sprmSDmPaperReq
3444 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
3445 //paper code - no handled in old filter
3446 break;
3447 case NS_sprm::LN_SPropRMark:
3448 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3449 break; // sprmSPropRMark
3450 case NS_sprm::LN_SFBiDi:// sprmSFBiDi
3452 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */
3453 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3454 if(pSectionContext)
3455 pSectionContext->SetSFBiDi( nIntValue > 0 );
3457 break;
3458 case NS_sprm::LN_SFFacingCol:
3459 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3460 break; // sprmSFFacingCol
3461 case NS_sprm::LN_SFRTLGutter: // sprmSFRTLGutter
3463 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3464 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3465 if(pSectionContext)
3466 pSectionContext->SetGutterRTL( nIntValue > 0 );
3468 break;
3469 case NS_sprm::LN_SBrcTop: // sprmSBrcTop
3470 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3471 case NS_sprm::LN_SBrcLeft: // sprmSBrcLeft
3472 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3473 case NS_sprm::LN_SBrcBottom: // sprmSBrcBottom
3474 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3475 case NS_sprm::LN_SBrcRight: // sprmSBrcRight
3476 /* WRITERFILTERSTATUS: Sectiondone: 100, planned: 0.5, spent: 0 */
3478 table::BorderLine aBorderLine;
3479 sal_Int32 nLineDistance = ConversionHelper::MakeBorderLine( nIntValue, aBorderLine );
3480 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3481 if(pSectionContext)
3483 static const BorderPosition aPositions[4] =
3485 BORDER_TOP,
3486 BORDER_LEFT,
3487 BORDER_BOTTOM,
3488 BORDER_RIGHT
3490 pSectionContext->SetBorder( aPositions[nSprmId - NS_sprm::LN_SBrcTop], nLineDistance, aBorderLine );
3493 break;
3495 case NS_sprm::LN_SPgbProp: // sprmSPgbProp
3497 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3498 if(pSectionContext)
3500 pSectionContext->ApplyBorderToPageStyles( m_pImpl->GetPageStyles(), m_pImpl->GetTextFactory(), nIntValue );
3503 break;
3504 case NS_sprm::LN_SDxtCharSpace:
3506 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3507 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3508 if(pSectionContext)
3510 pSectionContext->SetDxtCharSpace( nIntValue );
3513 break; // sprmSDxtCharSpace
3514 case NS_sprm::LN_SDyaLinePitch: // sprmSDyaLinePitch
3516 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3517 //see SwWW8ImplReader::SetDocumentGrid
3518 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3519 if(pSectionContext)
3521 pSectionContext->SetGridLinePitch( ConversionHelper::convertTwipToMM100( nIntValue ) );
3524 break;
3525 case 0x703a: //undocumented, grid related?
3526 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3527 OSL_ENSURE( false, "TODO: not handled yet"); //nIntValue like 0x008a2373 ?
3528 break;
3529 case NS_sprm::LN_SClm:
3531 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3532 sal_Int16 nGridType = text::TextGridMode::NONE;
3533 switch( nIntValue )
3535 case 0:
3536 nGridType = text::TextGridMode::NONE;
3537 break;
3538 case 3:
3539 //Text snaps to char grid, this doesn't make a lot of sense to
3540 //me. This is closer than LINES_CHARS
3541 nGridType = text::TextGridMode::LINES;
3542 break;
3543 case 1:
3544 nGridType = text::TextGridMode::LINES_AND_CHARS;
3545 break;
3546 case 2:
3547 nGridType = text::TextGridMode::LINES;
3548 break;
3549 default:;
3551 rContext->Insert( PROP_GRID_MODE, false, uno::makeAny( nGridType ) );
3553 //Seems to force this behaviour in word ?
3554 if(nGridType != text::TextGridMode::NONE)
3555 m_pImpl->SetDocumentSettingsProperty(
3556 PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_ADD_EXTERNAL_LEADING ),
3557 uno::makeAny( true ) );
3559 break; // sprmSClm
3560 case NS_sprm::LN_STextFlow:
3562 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3563 /* 0 HoriLR 1 Vert TR 2 Vert TR 3 Vert TT 4 HoriLT
3564 only 0 and 1 can be imported correctly
3566 sal_Int16 nDirection = text::WritingMode_LR_TB;
3567 switch( nIntValue )
3569 case 0:
3570 case 4:
3571 nDirection = text::WritingMode_LR_TB;
3572 break;
3573 case 1:
3574 case 2:
3575 case 3:
3576 nDirection = text::WritingMode_TB_RL;
3577 break;
3578 default:;
3580 rContext->Insert(PROP_WRITING_MODE, false, uno::makeAny( nDirection ) );
3582 break; // sprmSTextFlow
3583 case NS_sprm::LN_TJc: // sprmTJc
3584 case NS_sprm::LN_TDxaLeft:
3585 case NS_sprm::LN_TDxaGapHalf:
3586 case NS_sprm::LN_TFCantSplit:
3587 case NS_sprm::LN_TTableHeader:
3588 case NS_sprm::LN_TTableBorders: // sprmTTableBorders
3590 OSL_ENSURE( false, "table propeties should be handled by the table manager");
3592 break;
3593 case NS_sprm::LN_TDefTable10:
3594 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3595 break; // sprmTDefTable10
3596 case NS_sprm::LN_TDyaRowHeight:
3597 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3598 break; // sprmTDyaRowHeight
3599 case NS_sprm::LN_TDefTable:
3600 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3601 break; // sprmTDefTable
3602 case NS_sprm::LN_TDefTableShd:
3603 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3604 break; // sprmTDefTableShd
3605 case NS_sprm::LN_TTlp:
3606 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3607 break; // sprmTTlp
3608 case NS_sprm::LN_TFBiDi:
3609 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3610 break; // sprmTFBiDi
3611 case NS_sprm::LN_THTMLProps:
3612 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3613 break; // sprmTHTMLProps
3614 case NS_sprm::LN_TSetBrc:
3615 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3616 break; // sprmTSetBrc
3617 case NS_sprm::LN_TInsert:
3618 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3619 break; // sprmTInsert
3620 case NS_sprm::LN_TDelete:
3621 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3622 break; // sprmTDelete
3623 case NS_sprm::LN_TDxaCol:
3624 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3625 break; // sprmTDxaCol
3626 case NS_sprm::LN_TMerge:
3627 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3628 break; // sprmTMerge
3629 case NS_sprm::LN_TSplit:
3630 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3631 break; // sprmTSplit
3632 case NS_sprm::LN_TSetBrc10:
3633 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3634 break; // sprmTSetBrc10
3635 case 164: // sprmTSetShd
3636 case NS_sprm::LN_TSetShd:
3637 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3638 break; // sprmTSetShd
3639 case NS_sprm::LN_TSetShdOdd:
3640 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3641 break; // sprmTSetShdOdd
3642 case NS_sprm::LN_TTextFlow:
3643 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3644 break; // sprmTTextFlow
3645 case NS_sprm::LN_TDiagLine:
3646 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3647 break; // sprmTDiagLine
3648 case NS_sprm::LN_TVertMerge:
3649 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3650 break; // sprmTVertMerge
3651 case NS_sprm::LN_TVertAlign:
3652 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3653 break; // sprmTVertAlign
3654 // the following are not part of the official documentation
3655 case 0x6870: //TxtForeColor
3656 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3658 //contains a color as 0xTTRRGGBB while SO uses 0xTTRRGGBB
3659 sal_Int32 nColor = ConversionHelper::ConvertColor(nIntValue);
3660 rContext->Insert(PROP_CHAR_COLOR, true, uno::makeAny( nColor ) );
3662 break;
3663 case 0x4874:
3664 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3665 break; //seems to be a language id for Asian text - undocumented
3666 case 0x6877: //underlining color
3667 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3669 sal_Int32 nColor = ConversionHelper::ConvertColor(nIntValue);
3670 rContext->Insert(PROP_CHAR_UNDERLINE_HAS_COLOR, true, uno::makeAny( true ) );
3671 rContext->Insert(PROP_CHAR_UNDERLINE_COLOR, true, uno::makeAny( nColor ) );
3673 break;
3674 case 0x6815:
3675 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3676 break; //undocumented
3677 case NS_sprm::LN_CIndrsid:
3678 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3679 break; //undocumented
3680 case 0x6467:
3681 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3682 break; //undocumented
3683 case 0xF617:
3684 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3685 break; //undocumented
3686 case 0xd634: // sprmTNewSpacing - table spacing ( see WW8TabBandDesc::ProcessSpacing() )
3687 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3688 break;
3689 case NS_sprm::LN_TTRLeft:
3690 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3691 break; //undocumented
3692 case 0x4888:
3693 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3694 case 0x6887:
3695 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3696 //properties of list levels - undocumented
3697 break;
3698 case 0xd234:
3699 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3700 case 0xd235:
3701 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3702 case 0xd236:
3703 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3704 case 0xd237:
3705 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3706 break;//undocumented section properties
3707 case NS_sprm::LN_CEastAsianLayout:
3708 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3709 resolveSprmProps(rSprm);
3710 break;
3711 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3712 case NS_ooxml::LN_CT_Tabs_tab:
3713 resolveSprmProps(rSprm);
3714 m_pImpl->IncorporateTabStop(m_pImpl->m_aCurrentTabStop);
3715 m_pImpl->m_aCurrentTabStop = DeletableTabStop();
3716 break;
3717 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3718 case NS_ooxml::LN_CT_PPrBase_tabs:
3720 // Initialize tab stop vector from style sheet
3721 if( !m_pImpl->IsStyleSheetImport() )
3723 uno::Any aValue = m_pImpl->GetPropertyFromStyleSheet(PROP_PARA_TAB_STOPS);
3724 uno::Sequence< style::TabStop > aStyleTabStops;
3725 if(aValue >>= aStyleTabStops)
3727 m_pImpl->InitTabStopFromStyle( aStyleTabStops );
3730 resolveSprmProps(rSprm);
3731 rContext->Insert(PROP_PARA_TAB_STOPS, true, uno::makeAny( m_pImpl->GetCurrentTabStopAndClear()));
3733 break;
3735 case NS_ooxml::LN_CT_PPr_sectPr:
3736 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3737 case NS_ooxml::LN_EG_RPrBase_color:
3738 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3739 case NS_ooxml::LN_EG_RPrBase_rFonts:
3740 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3741 case NS_ooxml::LN_EG_RPrBase_bdr:
3742 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3743 case NS_ooxml::LN_EG_RPrBase_eastAsianLayout:
3744 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3745 case NS_ooxml::LN_EG_RPrBase_u:
3746 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3747 case NS_ooxml::LN_EG_RPrBase_lang:
3748 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3749 case NS_ooxml::LN_CT_PPrBase_spacing:
3750 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3751 case NS_ooxml::LN_CT_PPrBase_ind:
3752 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3753 case NS_ooxml::LN_CT_RPrDefault_rPr:
3754 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3755 case NS_ooxml::LN_CT_PPrDefault_pPr:
3756 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3757 case NS_ooxml::LN_CT_DocDefaults_pPrDefault:
3758 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3759 case NS_ooxml::LN_CT_DocDefaults_rPrDefault:
3760 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3761 case NS_ooxml::LN_CT_Style_pPr:
3762 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3763 case NS_ooxml::LN_CT_Style_rPr:
3764 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3765 case NS_ooxml::LN_CT_PPr_rPr:
3766 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3767 case NS_ooxml::LN_CT_PPrBase_numPr:
3768 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3769 resolveSprmProps(rSprm);
3770 break;
3771 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3772 case NS_ooxml::LN_EG_SectPrContents_footnotePr:
3773 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3774 case NS_ooxml::LN_EG_SectPrContents_endnotePr:
3775 m_pImpl->SetInFootnoteProperties( NS_ooxml::LN_EG_SectPrContents_footnotePr == nSprmId );
3776 resolveSprmProps(rSprm);
3777 break;
3778 case NS_ooxml::LN_EG_SectPrContents_lnNumType:
3779 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3781 resolveSprmProps(rSprm);
3782 LineNumberSettings aSettings = m_pImpl->GetLineNumberSettings();
3783 aSettings.bIsOn = true;
3784 m_pImpl->SetLineNumberSettings( aSettings );
3785 //apply settings at XLineNumberingProperties
3788 uno::Reference< text::XLineNumberingProperties > xLineNumberingProperties( m_pImpl->GetTextDocument(), uno::UNO_QUERY_THROW );
3789 uno::Reference< beans::XPropertySet > xLineNumberingPropSet = xLineNumberingProperties->getLineNumberingProperties();
3790 PropertyNameSupplier& rNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
3791 xLineNumberingPropSet->setPropertyValue(rNameSupplier.GetName( PROP_IS_ON ), uno::makeAny(true) );
3792 if( aSettings.nInterval )
3793 xLineNumberingPropSet->setPropertyValue(rNameSupplier.GetName( PROP_INTERVAL ), uno::makeAny((sal_Int16)aSettings.nInterval) );
3794 if( aSettings.nDistance )
3795 xLineNumberingPropSet->setPropertyValue(rNameSupplier.GetName( PROP_DISTANCE ), uno::makeAny(aSettings.nDistance) );
3796 xLineNumberingPropSet->setPropertyValue(rNameSupplier.GetName( PROP_RESTART_AT_EACH_PAGE ), uno::makeAny(aSettings.bRestartAtEachPage) );
3798 catch( const uno::Exception& )
3803 break;
3804 case NS_ooxml::LN_CT_PPrBase_framePr:
3806 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3807 PropertyMapPtr pContext = m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH);
3808 if( pContext.get() )
3810 ParagraphPropertyMap* pParaContext = dynamic_cast< ParagraphPropertyMap* >( pContext.get() );
3811 pParaContext->SetFrameMode();
3814 else
3816 //TODO: What about style sheet import of frame properties
3818 resolveSprmProps(rSprm);
3820 break;
3821 case NS_ooxml::LN_EG_SectPrContents_pgSz:
3822 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3823 CT_PageSz.code = 0;
3825 PaperInfo aLetter(PAPER_LETTER);
3826 CT_PageSz.w = aLetter.getWidth();
3827 CT_PageSz.h = aLetter.getHeight();
3829 CT_PageSz.orient = false;
3830 resolveSprmProps(rSprm);
3831 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3832 if(pSectionContext)
3834 pSectionContext->Insert( PROP_HEIGHT, false, uno::makeAny( CT_PageSz.h ) );
3835 pSectionContext->Insert( PROP_IS_LANDSCAPE, false, uno::makeAny( CT_PageSz.orient ));
3836 pSectionContext->Insert( PROP_WIDTH, false, uno::makeAny( CT_PageSz.w ) );
3837 pSectionContext->SetLandscape( CT_PageSz.orient );
3839 break;
3841 case NS_ooxml::LN_EG_SectPrContents_pgMar:
3842 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3843 m_pImpl->InitPageMargins();
3844 resolveSprmProps(rSprm);
3845 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3846 if(pSectionContext)
3848 const _PageMar& rPageMar = m_pImpl->GetPageMargins();
3849 pSectionContext->SetTopMargin( rPageMar.top );
3850 pSectionContext->SetRightMargin( rPageMar.right );
3851 pSectionContext->SetBottomMargin( rPageMar.bottom );
3852 pSectionContext->SetLeftMargin( rPageMar.left );
3853 pSectionContext->SetHeaderTop( rPageMar.header );
3854 pSectionContext->SetHeaderBottom( rPageMar.footer );
3856 break;
3858 case NS_ooxml::LN_EG_SectPrContents_cols:
3859 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3861 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
3862 if( pProperties.get())
3865 SectionColumnHandlerPtr pSectHdl( new SectionColumnHandler );
3866 pProperties->resolve(*pSectHdl);
3867 if(pSectionContext)
3869 if( pSectHdl->IsEqualWidth() )
3871 pSectionContext->SetEvenlySpaced( true );
3872 pSectionContext->SetColumnCount( (sal_Int16) (pSectHdl->GetNum() - 1) );
3873 pSectionContext->SetColumnDistance( pSectHdl->GetSpace() );
3874 pSectionContext->SetSeparatorLine( pSectHdl->IsSeparator() );
3876 else if( !pSectHdl->GetColumns().empty() )
3878 pSectionContext->SetEvenlySpaced( false );
3879 pSectionContext->SetColumnDistance( pSectHdl->GetSpace() );
3880 pSectionContext->SetColumnCount( (sal_Int16)(pSectHdl->GetColumns().size() -1));
3881 std::vector<_Column>::const_iterator tmpIter = pSectHdl->GetColumns().begin();
3882 for (; tmpIter != pSectHdl->GetColumns().end(); tmpIter++)
3884 pSectionContext->AppendColumnWidth( tmpIter->nWidth );
3885 if ((tmpIter != pSectHdl->GetColumns().end() - 1) || (tmpIter->nSpace > 0))
3886 pSectionContext->AppendColumnSpacing( tmpIter->nSpace );
3888 pSectionContext->SetSeparatorLine( pSectHdl->IsSeparator() );
3890 else if( pSectHdl->GetNum() > 0 )
3892 pSectionContext->SetColumnCount( (sal_Int16)pSectHdl->GetNum() - 1 );
3893 pSectionContext->SetColumnDistance( pSectHdl->GetSpace() );
3898 break;
3899 case NS_ooxml::LN_EG_SectPrContents_pgBorders:
3901 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
3902 if( pProperties.get( ) && pSectionContext )
3904 PageBordersHandlerPtr pHandler( new PageBordersHandler );
3905 pProperties->resolve( *pHandler );
3907 // Set the borders to the context and apply them to the styles
3908 pHandler->SetBorders( pSectionContext );
3909 pSectionContext->SetBorderParams( pHandler->GetDisplayOffset( ) );
3912 break;
3914 case NS_ooxml::LN_CT_PPrBase_pStyle:
3916 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3917 m_pImpl->SetCurrentParaStyleId( sStringValue );
3918 StyleSheetTablePtr pStyleTable = m_pImpl->GetStyleSheetTable();
3919 const ::rtl::OUString sConvertedStyleName = pStyleTable->ConvertStyleName( sStringValue, true );
3920 if (m_pImpl->GetTopContext() && m_pImpl->GetTopContextType() != CONTEXT_SECTION)
3921 m_pImpl->GetTopContext()->Insert( PROP_PARA_STYLE_NAME, true, uno::makeAny( sConvertedStyleName ));
3922 const StyleSheetEntryPtr pEntry = pStyleTable->FindStyleSheetByISTD(sStringValue);
3923 //apply numbering to paragraph if it was set at the style
3924 OSL_ENSURE( pEntry.get(), "no style sheet found" );
3925 const StyleSheetPropertyMap* pStyleSheetProperties = dynamic_cast<const StyleSheetPropertyMap*>(pEntry ? pEntry->pProperties.get() : 0);
3927 if( pStyleSheetProperties && pStyleSheetProperties->GetListId() >= 0 )
3928 rContext->Insert( PROP_NUMBERING_STYLE_NAME, true, uno::makeAny(
3929 ListDef::GetStyleName( pStyleSheetProperties->GetListId( ) ) ), false);
3931 if( pStyleSheetProperties && pStyleSheetProperties->GetListLevel() >= 0 )
3932 rContext->Insert( PROP_NUMBERING_LEVEL, true, uno::makeAny(pStyleSheetProperties->GetListLevel()), false);
3934 break;
3935 case NS_ooxml::LN_EG_RPrBase_rStyle:
3936 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3938 rtl::OUString sConvertedName( m_pImpl->GetStyleSheetTable()->ConvertStyleName( sStringValue, true ) );
3939 // First check if the style exists in the document.
3940 StyleSheetEntryPtr pEntry = m_pImpl->GetStyleSheetTable( )->FindStyleSheetByStyleName( sConvertedName );
3941 bool bExists = pEntry.get( ) && ( pEntry->nStyleTypeCode == STYLE_TYPE_CHAR );
3943 // Add the property if the style exists
3944 if ( bExists && m_pImpl->GetTopContext() )
3945 m_pImpl->GetTopContext()->Insert( PROP_CHAR_STYLE_NAME, true, uno::makeAny( sConvertedName ) );
3947 break;
3948 case NS_ooxml::LN_CT_TblPrBase_tblCellMar: //cell margins
3949 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3951 resolveSprmProps(rSprm);//contains LN_CT_TblCellMar_top, LN_CT_TblCellMar_left, LN_CT_TblCellMar_bottom, LN_CT_TblCellMar_right
3953 break;
3954 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
3955 case NS_ooxml::LN_CT_TblCellMar_top:
3956 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
3957 case NS_ooxml::LN_CT_TblCellMar_left:
3958 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
3959 case NS_ooxml::LN_CT_TblCellMar_bottom:
3960 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
3961 case NS_ooxml::LN_CT_TblCellMar_right:
3963 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
3964 if( pProperties.get())
3966 MeasureHandlerPtr pMeasureHandler( new MeasureHandler );
3967 pProperties->resolve(*pMeasureHandler);
3968 sal_Int32 nMeasureValue = pMeasureHandler->getMeasureValue();
3969 PropertyIds eId = META_PROP_CELL_MAR_TOP;
3970 switch(nSprmId)
3972 case NS_ooxml::LN_CT_TblCellMar_top:
3973 break;
3974 case NS_ooxml::LN_CT_TblCellMar_left:
3975 eId = META_PROP_CELL_MAR_LEFT;
3976 break;
3977 case NS_ooxml::LN_CT_TblCellMar_bottom:
3978 eId = META_PROP_CELL_MAR_BOTTOM;
3979 break;
3980 case NS_ooxml::LN_CT_TblCellMar_right:
3981 eId = META_PROP_CELL_MAR_RIGHT;
3982 break;
3983 default:;
3985 rContext->Insert( eId, false, uno::makeAny(nMeasureValue), false);
3988 break;
3989 case NS_sprm::LN_CFNoProof: //0x875 no grammar and spell checking, unsupported
3990 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3991 break;
3992 case NS_ooxml::LN_anchor_anchor: // at_character drawing
3993 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3994 case NS_ooxml::LN_inline_inline: // as_character drawing
3995 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3997 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
3998 if( pProperties.get())
4000 GraphicImportType eGraphicType =
4001 (NS_ooxml::LN_anchor_anchor ==
4002 sal::static_int_cast<Id>(nSprmId)) ?
4003 IMPORT_AS_DETECTED_ANCHOR :
4004 IMPORT_AS_DETECTED_INLINE;
4005 GraphicImportPtr pGraphicImport =
4006 m_pImpl->GetGraphicImport(eGraphicType);
4007 pProperties->resolve(*pGraphicImport);
4008 m_pImpl->ImportGraphic(pProperties, eGraphicType);
4009 if( !pGraphicImport->IsGraphic() )
4011 m_pImpl->ResetGraphicImport();
4012 // todo: It's a shape, now start shape import
4016 break;
4017 case NS_ooxml::LN_EG_RPrBase_vertAlign:
4018 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
4020 sal_Int16 nEscapement = 0;
4021 sal_Int8 nProp = 58;
4022 if( sStringValue.equalsAscii( "superscript" ))
4023 nEscapement = 101;
4024 else if( sStringValue.equalsAscii( "subscript" ))
4025 nEscapement = -101;
4026 else
4027 nProp = 100;
4029 rContext->Insert(PROP_CHAR_ESCAPEMENT, true, uno::makeAny( nEscapement ) );
4030 rContext->Insert(PROP_CHAR_ESCAPEMENT_HEIGHT, true, uno::makeAny( nProp ) );
4032 break;
4033 // case NS_ooxml::LN_CT_FtnEdn_type
4034 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
4035 // case NS_ooxml::LN_CT_FtnEdn_id
4036 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
4037 // case NS_ooxml::LN_EG_FtnEdnNumProps_numRestart
4038 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
4039 case NS_ooxml::LN_CT_FtnProps_pos:
4040 //footnotes in word can be at page end or beneath text - writer supports only the first
4041 //endnotes in word can be at section end or document end - writer supports only the latter
4042 // -> so this property can be ignored
4043 break;
4044 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
4045 case NS_ooxml::LN_EG_FtnEdnNumProps_numStart:
4046 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
4047 case NS_ooxml::LN_CT_FtnProps_numFmt:
4048 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
4049 case NS_ooxml::LN_CT_EdnProps_numFmt:
4053 uno::Reference< beans::XPropertySet > xFtnEdnSettings;
4054 if( m_pImpl->IsInFootnoteProperties() )
4056 uno::Reference< text::XFootnotesSupplier> xFootnotesSupplier( m_pImpl->GetTextDocument(), uno::UNO_QUERY );
4057 xFtnEdnSettings = xFootnotesSupplier->getFootnoteSettings();
4059 else
4061 uno::Reference< text::XEndnotesSupplier> xEndnotesSupplier( m_pImpl->GetTextDocument(), uno::UNO_QUERY );
4062 xFtnEdnSettings = xEndnotesSupplier->getEndnoteSettings();
4064 if( NS_ooxml::LN_EG_FtnEdnNumProps_numStart == nSprmId )
4066 xFtnEdnSettings->setPropertyValue(
4067 PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_START_AT),
4068 uno::makeAny( sal_Int16( nIntValue - 1 )));
4070 else
4072 sal_Int16 nNumType = ConversionHelper::ConvertNumberingType( nIntValue );
4073 xFtnEdnSettings->setPropertyValue(
4074 PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_NUMBERING_TYPE),
4075 uno::makeAny( nNumType ));
4078 catch( const uno::Exception& )
4082 break;
4083 case NS_ooxml::LN_paratrackchange:
4084 m_pImpl->StartParaChange( );
4085 case NS_ooxml::LN_trackchange:
4086 /* WRITERFILTERSTATUS: done: 100, planned: 5, spent: 0 */
4087 case NS_ooxml::LN_EG_RPrContent_rPrChange:
4088 /* WRITERFILTERSTATUS: done: 100, planned: 5, spent: 0 */
4090 m_pImpl->AddNewRedline( );
4091 resolveSprmProps( rSprm );
4092 // now the properties author, date and id should be available
4093 sal_Int32 nToken = m_pImpl->GetCurrentRedlineToken();
4094 switch( nToken & 0xffff )
4096 case ooxml::OOXML_mod :
4097 case ooxml::OOXML_ins :
4098 case ooxml::OOXML_del : break;
4099 default: OSL_ENSURE( false, "redline token other than mod, ins or del" );
4101 m_pImpl->EndParaChange( );
4103 break;
4104 case NS_ooxml::LN_CT_RPrChange_rPr:
4105 /* WRITERFILTERSTATUS: done: 100, planned: 5, spent: 0 */
4106 break;
4107 /* WRITERFILTERSTATUS: done: 0, planned: 4, spent: 0 */
4108 case NS_ooxml::LN_object:
4110 #if DEBUG
4111 clog << "DomainMapper: LN_object" << endl;
4112 #endif
4113 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
4114 if( pProperties.get( ) )
4116 OLEHandlerPtr pOLEHandler( new OLEHandler );
4117 pProperties->resolve(*pOLEHandler);
4118 if ( pOLEHandler->isOLEObject( ) )
4120 ::rtl::OUString sStreamName = pOLEHandler->copyOLEOStream( m_pImpl->GetTextDocument() );
4121 if( sStreamName.getLength() )
4123 m_pImpl->appendOLE( sStreamName, pOLEHandler );
4128 break;
4129 // case NS_ooxml::LN_CT_EdnProps_pos
4130 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
4131 // case NS_ooxml::LN_CT_EdnProps_numFmt
4132 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
4133 // case NS_ooxml::LN_CT_FtnDocProps_footnote
4134 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
4135 // case NS_ooxml::LN_CT_EdnDocProps_endnote
4136 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
4137 //break;
4138 case NS_ooxml::LN_EG_HdrFtrReferences_headerReference: // header reference - not needed
4139 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
4140 case NS_ooxml::LN_EG_HdrFtrReferences_footerReference: // footer reference - not needed
4141 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
4142 break;
4143 case NS_ooxml::LN_EG_RPrBase_snapToGrid: // "Use document grid settings for inter-paragraph spacing"
4144 break;
4145 case NS_sprm::LN_PContextualSpacing:
4146 //TODO: determines whether top/bottom paragraph spacing is added if equal styles are following - unsupported
4147 break;
4148 case NS_ooxml::LN_EG_SectPrContents_formProt: //section protection, only form editing is enabled - unsupported
4149 break;
4150 default:
4152 #if OSL_DEBUG_LEVEL > 0
4153 ::rtl::OString sMessage( "DomainMapper::sprm() - Id: ");
4154 sMessage += ::rtl::OString::valueOf( sal_Int32( nSprmId ), 10 );
4155 sMessage += ::rtl::OString(" / 0x");
4156 sMessage += ::rtl::OString::valueOf( sal_Int32( nSprmId ), 16 );
4157 sMessage += ::rtl::OString(" / ");
4158 sMessage += ::rtl::OString( rSprm.getName( ).c_str( ) );
4159 clog << sMessage.getStr( ) << endl;
4160 // OSL_ENSURE( false, sMessage.getStr()); //
4161 #endif
4165 #ifdef DEBUG_DOMAINMAPPER
4166 dmapper_logger->endElement("sprm");
4167 #endif
4169 /*-- 09.06.2006 09:52:13---------------------------------------------------
4171 -----------------------------------------------------------------------*/
4172 void DomainMapper::entry(int /*pos*/,
4173 writerfilter::Reference<Properties>::Pointer_t ref)
4175 ref->resolve(*this);
4177 /*-- 09.06.2006 09:52:13---------------------------------------------------
4179 -----------------------------------------------------------------------*/
4180 void DomainMapper::data(const sal_uInt8* /*buf*/, size_t /*len*/,
4181 writerfilter::Reference<Properties>::Pointer_t /*ref*/)
4184 /*-- 09.06.2006 09:52:13---------------------------------------------------
4186 -----------------------------------------------------------------------*/
4187 void DomainMapper::startSectionGroup()
4189 #ifdef DEBUG_DOMAINMAPPER
4190 dmapper_logger->startElement("section");
4191 #endif
4192 m_pImpl->PushProperties(CONTEXT_SECTION);
4194 /*-- 09.06.2006 09:52:13---------------------------------------------------
4196 -----------------------------------------------------------------------*/
4197 void DomainMapper::endSectionGroup()
4199 PropertyMapPtr pContext = m_pImpl->GetTopContextOfType(CONTEXT_SECTION);
4200 SectionPropertyMap* pSectionContext = dynamic_cast< SectionPropertyMap* >( pContext.get() );
4201 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
4202 if(pSectionContext)
4203 pSectionContext->CloseSectionGroup( *m_pImpl );
4204 m_pImpl->PopProperties(CONTEXT_SECTION);
4206 #ifdef DEBUG_DOMAINMAPPER
4207 dmapper_logger->endElement("section");
4208 #endif
4210 /*-- 09.06.2006 09:52:13---------------------------------------------------
4212 -----------------------------------------------------------------------*/
4213 void DomainMapper::startParagraphGroup()
4215 #ifdef DEBUG_DOMAINMAPPER
4216 dmapper_logger->startElement("paragraph");
4217 #endif
4219 m_pImpl->getTableManager().startParagraphGroup();
4220 m_pImpl->PushProperties(CONTEXT_PARAGRAPH);
4221 static ::rtl::OUString sDefault( ::rtl::OUString::createFromAscii("Standard") );
4222 if (m_pImpl->GetTopContext())
4224 m_pImpl->GetTopContext()->Insert( PROP_PARA_STYLE_NAME, true, uno::makeAny( sDefault ) );
4225 if (m_pImpl->isBreakDeferred(PAGE_BREAK))
4226 m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_PAGE_BEFORE) );
4227 else if (m_pImpl->isBreakDeferred(COLUMN_BREAK))
4228 m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_COLUMN_BEFORE) );
4230 m_pImpl->clearDeferredBreaks();
4232 /*-- 09.06.2006 09:52:14---------------------------------------------------
4234 -----------------------------------------------------------------------*/
4235 void DomainMapper::endParagraphGroup()
4237 m_pImpl->PopProperties(CONTEXT_PARAGRAPH);
4238 m_pImpl->getTableManager().endParagraphGroup();
4239 //frame conversion has to be executed after table conversion
4240 m_pImpl->ExecuteFrameConversion();
4241 #ifdef DEBUG_DOMAINMAPPER
4242 dmapper_logger->endElement("paragraph");
4243 #endif
4246 void DomainMapper::markLastParagraphInSection( )
4248 #ifdef DEBUG_DOMAINMAPPER
4249 dmapper_logger->element( "markLastParagraphInSection" );
4250 #endif
4251 m_pImpl->SetIsLastParagraphInSection( true );
4254 void DomainMapper::startShape( uno::Reference< drawing::XShape > xShape )
4256 m_pImpl->PushShapeContext( xShape );
4259 void DomainMapper::endShape( )
4261 m_pImpl->PopShapeContext( );
4264 /*-- 13.06.2007 16:15:55---------------------------------------------------
4266 -----------------------------------------------------------------------*/
4267 void DomainMapper::PushStyleSheetProperties( PropertyMapPtr pStyleProperties, bool bAffectTableMngr )
4269 m_pImpl->PushStyleProperties( pStyleProperties );
4270 if ( bAffectTableMngr )
4271 m_pImpl->getTableManager( ).SetStyleProperties( pStyleProperties );
4273 /*-- 13.06.2007 16:15:55---------------------------------------------------
4275 -----------------------------------------------------------------------*/
4276 void DomainMapper::PopStyleSheetProperties( bool bAffectTableMngr )
4278 m_pImpl->PopProperties( CONTEXT_STYLESHEET );
4279 if ( bAffectTableMngr )
4281 PropertyMapPtr emptyPtr;
4282 m_pImpl->getTableManager( ).SetStyleProperties( emptyPtr );
4285 /*-- 28.01.2008 14:52:33---------------------------------------------------
4287 -----------------------------------------------------------------------*/
4288 void DomainMapper::PushListProperties( ::boost::shared_ptr<PropertyMap> pListProperties )
4290 m_pImpl->PushListProperties( pListProperties );
4292 /*-- 28.01.2008 14:52:33---------------------------------------------------
4294 -----------------------------------------------------------------------*/
4295 void DomainMapper::PopListProperties()
4297 m_pImpl->PopProperties( CONTEXT_LIST );
4299 /*-- 09.06.2006 09:52:14---------------------------------------------------
4301 -----------------------------------------------------------------------*/
4303 void DomainMapper::startCharacterGroup()
4305 #ifdef DEBUG_DOMAINMAPPER
4306 dmapper_logger->startElement("charactergroup");
4307 #endif
4309 m_pImpl->PushProperties(CONTEXT_CHARACTER);
4310 DomainMapperTableManager& rTableManager = m_pImpl->getTableManager();
4311 if( rTableManager.getTableStyleName().getLength() )
4313 PropertyMapPtr pTopContext = m_pImpl->GetTopContext();
4314 rTableManager.CopyTextProperties(pTopContext, m_pImpl->GetStyleSheetTable());
4317 /*-- 09.06.2006 09:52:14---------------------------------------------------
4319 -----------------------------------------------------------------------*/
4320 void DomainMapper::endCharacterGroup()
4322 m_pImpl->PopProperties(CONTEXT_CHARACTER);
4324 #ifdef DEBUG_DOMAINMAPPER
4325 dmapper_logger->endElement("charactergroup");
4326 #endif
4328 /*-- 09.06.2006 09:52:14---------------------------------------------------
4330 -----------------------------------------------------------------------*/
4331 void DomainMapper::text(const sal_uInt8 * data_, size_t len)
4333 //TODO: Determine the right text encoding (FIB?)
4334 ::rtl::OUString sText( (const sal_Char*) data_, len, RTL_TEXTENCODING_MS_1252 );
4337 if(len == 1)
4339 switch(*data_)
4341 case 0x02: return; //footnote character
4342 case 0x0c: //page break
4343 m_pImpl->deferBreak(PAGE_BREAK);
4344 return;
4345 case 0x0e: //column break
4346 m_pImpl->deferBreak(COLUMN_BREAK);
4347 return;
4348 case 0x07:
4349 m_pImpl->getTableManager().text(data_, len);
4350 case 0x0d:
4351 m_pImpl->finishParagraph(m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH));
4352 return;
4353 case 0x13:
4354 m_pImpl->PushFieldContext();
4355 return;
4356 case 0x14:
4357 // delimiter not necessarily available
4358 // appears only if field contains further content
4359 m_pImpl->CloseFieldCommand();
4360 return;
4361 case 0x15: /* end of field */
4362 m_pImpl->PopFieldContext();
4363 return;
4364 default:
4365 break;
4369 PropertyMapPtr pContext = m_pImpl->GetTopContext();
4370 if ( pContext && !pContext->GetFootnote().is() )
4372 if (m_pImpl->isBreakDeferred(PAGE_BREAK))
4373 m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_PAGE_BEFORE) );
4374 else if (m_pImpl->isBreakDeferred(COLUMN_BREAK))
4375 m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_COLUMN_BEFORE) );
4376 m_pImpl->clearDeferredBreaks();
4379 if( pContext->GetFootnote().is() && m_pImpl->IsCustomFtnMark() )
4381 pContext->GetFootnote()->setLabel( sText );
4382 m_pImpl->SetCustomFtnMark( false );
4383 //otherwise ignore sText
4385 else if( m_pImpl->IsOpenFieldCommand() )
4386 m_pImpl->AppendFieldCommand(sText);
4387 else if( m_pImpl->IsOpenField() && m_pImpl->IsFieldResultAsString())
4388 /*depending on the success of the field insert operation this result will be
4389 set at the field or directly inserted into the text*/
4390 m_pImpl->SetFieldResult( sText );
4391 else
4393 //--> debug
4394 //sal_uInt32 nSize = pContext->size();
4395 //<--
4397 m_pImpl->appendTextPortion( sText, pContext );
4398 #ifdef DEBUG_DOMAINMAPPER
4399 dmapper_logger->startElement("text");
4400 dmapper_logger->chars(sText);
4401 dmapper_logger->endElement("text");
4402 #endif
4405 catch( const uno::RuntimeException& )
4407 std::clog << __FILE__ << "(l" << __LINE__ << ")" << std::endl;
4410 /*-- 09.06.2006 09:52:15---------------------------------------------------
4412 -----------------------------------------------------------------------*/
4413 void DomainMapper::utext(const sal_uInt8 * data_, size_t len)
4415 OUString sText;
4416 OUStringBuffer aBuffer = OUStringBuffer(len);
4417 aBuffer.append( (const sal_Unicode *) data_, len);
4418 sText = aBuffer.makeStringAndClear();
4421 m_pImpl->getTableManager().utext(data_, len);
4423 if(len == 1 && ((*data_) == 0x0d || (*data_) == 0x07))
4424 m_pImpl->finishParagraph(m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH));
4425 else
4428 PropertyMapPtr pContext = m_pImpl->GetTopContext();
4429 if ( pContext && !pContext->GetFootnote().is() )
4431 if (m_pImpl->isBreakDeferred(PAGE_BREAK))
4432 m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_PAGE_BEFORE) );
4433 else if (m_pImpl->isBreakDeferred(COLUMN_BREAK))
4434 m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_COLUMN_BEFORE) );
4435 m_pImpl->clearDeferredBreaks();
4438 /* doesn't seem to be working
4439 if( pContext->GetFootnote().is() )
4441 //todo: the check for 0x0a is a hack!
4442 if( *data_ != 0x0a && !pContext->GetFootnoteSymbol() )
4443 pContext->GetFootnote()->setLabel( sText );
4444 //otherwise ignore sText
4446 else */
4447 if( pContext->GetFootnote().is() )
4449 if( !pContext->GetFootnoteSymbol() )
4450 pContext->GetFootnote()->setLabel( sText );
4451 //otherwise ignore sText
4453 else if( m_pImpl->IsOpenFieldCommand() )
4454 m_pImpl->AppendFieldCommand(sText);
4455 else if( m_pImpl->IsOpenField() && m_pImpl->IsFieldResultAsString())
4456 /*depending on the success of the field insert operation this result will be
4457 set at the field or directly inserted into the text*/
4458 m_pImpl->SetFieldResult( sText );
4459 else
4460 m_pImpl->appendTextPortion( sText, pContext );
4462 #ifdef DEBUG_DOMAINMAPPER
4463 dmapper_logger->startElement("utext");
4464 dmapper_logger->chars(sText);
4465 dmapper_logger->endElement("utext");
4466 #endif
4469 catch( const uno::RuntimeException& )
4473 /*-- 09.06.2006 09:52:15---------------------------------------------------
4475 -----------------------------------------------------------------------*/
4476 void DomainMapper::props(writerfilter::Reference<Properties>::Pointer_t ref)
4478 #ifdef DEBUG_DOMAINMAPPER
4479 dmapper_logger->startElement("props");
4480 #endif
4482 string sType = ref->getType();
4483 if( sType == "PICF" )
4485 m_pImpl->ImportGraphic(ref, IMPORT_AS_GRAPHIC);
4487 else if( sType == "FSPA" )
4489 m_pImpl->ImportGraphic(ref, IMPORT_AS_SHAPE);
4491 else
4492 ref->resolve(*this);
4494 #ifdef DEBUG_DOMAINMAPPER
4495 dmapper_logger->endElement("props");
4496 #endif
4498 /*-- 09.06.2006 09:52:15---------------------------------------------------
4500 -----------------------------------------------------------------------*/
4501 void DomainMapper::table(Id name, writerfilter::Reference<Table>::Pointer_t ref)
4503 #ifdef DEBUG_DOMAINMAPPER
4504 dmapper_logger->startElement("table");
4505 dmapper_logger->attribute("id", (*QNameToString::Instance())(name));
4506 #endif
4508 // printf ( "DomainMapper::table(0x%.4x)\n", (unsigned int)name);
4509 m_pImpl->SetAnyTableImport(true);
4510 /* WRITERFILTERSTATUS: table: attributedata */
4511 switch(name)
4513 case NS_rtf::LN_FONTTABLE:
4514 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
4516 // create a font table object that listens to the attributes
4517 // each entry call inserts a new font entry
4518 ref->resolve( *m_pImpl->GetFontTable() );
4519 break;
4520 case NS_rtf::LN_STYLESHEET:
4521 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
4522 //same as above to import style sheets
4523 m_pImpl->SetStyleSheetImport( true );
4524 ref->resolve( *m_pImpl->GetStyleSheetTable() );
4525 m_pImpl->GetStyleSheetTable()->ApplyStyleSheets(m_pImpl->GetFontTable());
4526 m_pImpl->SetStyleSheetImport( false );
4527 break;
4528 case NS_ooxml::LN_NUMBERING:
4529 case NS_rtf::LN_LISTTABLE:
4531 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
4533 //the same for list tables
4534 ref->resolve( *m_pImpl->GetListTable() );
4535 m_pImpl->GetListTable( )->CreateNumberingRules( );
4537 break;
4538 case NS_rtf::LN_LFOTABLE:
4540 m_pImpl->GetListTable( )->SetLFOImport( true );
4541 ref->resolve( *m_pImpl->GetListTable() );
4542 m_pImpl->GetListTable( )->CreateNumberingRules( );
4543 m_pImpl->GetListTable( )->SetLFOImport( false );
4545 break;
4546 case NS_ooxml::LN_THEMETABLE:
4547 ref->resolve ( *m_pImpl->GetThemeTable() );
4548 break;
4549 case NS_ooxml::LN_SETTINGS:
4550 ref->resolve( *m_pImpl->GetSettingsTable( ) );
4551 break;
4552 default:
4553 OSL_ENSURE( false, "which table is to be filled here?");
4555 m_pImpl->SetAnyTableImport(false);
4557 #ifdef DEBUG_DOMAINMAPPER
4558 dmapper_logger->endElement("table");
4559 #endif
4561 /*-- 09.06.2006 09:52:16---------------------------------------------------
4563 -----------------------------------------------------------------------*/
4564 void DomainMapper::substream(Id rName, ::writerfilter::Reference<Stream>::Pointer_t ref)
4566 #ifdef DEBUG_DOMAINMAPPER
4567 dmapper_logger->startElement("substream");
4568 #endif
4570 m_pImpl->appendTableManager( );
4571 m_pImpl->getTableManager().startLevel();
4573 //->debug
4574 //string sName = (*QNameToString::Instance())(rName);
4575 //--<debug
4576 //import of page header/footer
4578 /* WRITERFILTERSTATUS: table: attributedata */
4579 switch( rName )
4581 case NS_rtf::LN_headerl:
4582 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */
4584 m_pImpl->PushPageHeader(SectionPropertyMap::PAGE_LEFT);
4585 break;
4586 case NS_rtf::LN_headerr:
4587 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */
4589 m_pImpl->PushPageHeader(SectionPropertyMap::PAGE_RIGHT);
4590 break;
4591 case NS_rtf::LN_headerf:
4592 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */
4594 m_pImpl->PushPageHeader(SectionPropertyMap::PAGE_FIRST);
4595 break;
4596 case NS_rtf::LN_footerl:
4597 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */
4599 m_pImpl->PushPageFooter(SectionPropertyMap::PAGE_LEFT);
4600 break;
4601 case NS_rtf::LN_footerr:
4602 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */
4604 m_pImpl->PushPageFooter(SectionPropertyMap::PAGE_RIGHT);
4605 break;
4606 case NS_rtf::LN_footerf:
4607 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */
4609 m_pImpl->PushPageFooter(SectionPropertyMap::PAGE_FIRST);
4610 break;
4611 case NS_rtf::LN_footnote:
4612 case NS_rtf::LN_endnote:
4613 m_pImpl->PushFootOrEndnote( NS_rtf::LN_footnote == rName );
4614 break;
4615 case NS_rtf::LN_annotation :
4616 m_pImpl->PushAnnotation();
4617 break;
4619 ref->resolve(*this);
4620 switch( rName )
4622 case NS_rtf::LN_headerl:
4623 case NS_rtf::LN_headerr:
4624 case NS_rtf::LN_headerf:
4625 case NS_rtf::LN_footerl:
4626 case NS_rtf::LN_footerr:
4627 case NS_rtf::LN_footerf:
4628 m_pImpl->PopPageHeaderFooter();
4629 break;
4630 case NS_rtf::LN_footnote:
4631 case NS_rtf::LN_endnote:
4632 m_pImpl->PopFootOrEndnote();
4633 break;
4634 case NS_rtf::LN_annotation :
4635 m_pImpl->PopAnnotation();
4636 break;
4639 m_pImpl->getTableManager().endLevel();
4640 m_pImpl->popTableManager( );
4642 #ifdef DEBUG_DOMAINMAPPER
4643 dmapper_logger->endElement("substream");
4644 #endif
4646 /*-- 09.06.2006 09:52:16---------------------------------------------------
4648 -----------------------------------------------------------------------*/
4649 void DomainMapper::info(const string & /*info_*/)
4653 void DomainMapper::handleUnderlineType(const sal_Int32 nIntValue, const ::boost::shared_ptr<PropertyMap> pContext)
4655 sal_Int16 eUnderline = awt::FontUnderline::NONE;
4657 switch(nIntValue)
4659 case 0: eUnderline = awt::FontUnderline::NONE; break;
4660 case 2: pContext->Insert(PROP_CHAR_WORD_MODE, true, uno::makeAny( true ) ); // TODO: how to get rid of it?
4661 case 1: eUnderline = awt::FontUnderline::SINGLE; break;
4662 case 3: eUnderline = awt::FontUnderline::DOUBLE; break;
4663 case 4: eUnderline = awt::FontUnderline::DOTTED; break;
4664 case 7: eUnderline = awt::FontUnderline::DASH; break;
4665 case 9: eUnderline = awt::FontUnderline::DASHDOT; break;
4666 case 10:eUnderline = awt::FontUnderline::DASHDOTDOT; break;
4667 case 6: eUnderline = awt::FontUnderline::BOLD; break;
4668 case 11:eUnderline = awt::FontUnderline::WAVE; break;
4669 case 20:eUnderline = awt::FontUnderline::BOLDDOTTED; break;
4670 case 23:eUnderline = awt::FontUnderline::BOLDDASH; break;
4671 case 39:eUnderline = awt::FontUnderline::LONGDASH; break;
4672 case 55:eUnderline = awt::FontUnderline::BOLDLONGDASH; break;
4673 case 25:eUnderline = awt::FontUnderline::BOLDDASHDOT; break;
4674 case 26:eUnderline = awt::FontUnderline::BOLDDASHDOTDOT;break;
4675 case 27:eUnderline = awt::FontUnderline::BOLDWAVE; break;
4676 case 43:eUnderline = awt::FontUnderline::DOUBLEWAVE; break;
4677 default: ;
4679 pContext->Insert(PROP_CHAR_UNDERLINE, true, uno::makeAny( eUnderline ) );
4682 void DomainMapper::handleParaJustification(const sal_Int32 nIntValue, const ::boost::shared_ptr<PropertyMap> pContext, const bool bExchangeLeftRight)
4684 sal_Int16 nAdjust = 0;
4685 sal_Int16 nLastLineAdjust = 0;
4686 switch(nIntValue)
4688 case 1:
4689 nAdjust = style::ParagraphAdjust_CENTER;
4690 break;
4691 case 2:
4692 nAdjust = static_cast< sal_Int16 > (bExchangeLeftRight ? style::ParagraphAdjust_LEFT : style::ParagraphAdjust_RIGHT);
4693 break;
4694 case 4:
4695 nLastLineAdjust = style::ParagraphAdjust_BLOCK;
4696 //no break;
4697 case 3:
4698 nAdjust = style::ParagraphAdjust_BLOCK;
4699 break;
4700 case 0:
4701 default:
4702 nAdjust = static_cast< sal_Int16 > (bExchangeLeftRight ? style::ParagraphAdjust_RIGHT : style::ParagraphAdjust_LEFT);
4703 break;
4705 pContext->Insert( PROP_PARA_ADJUST, true, uno::makeAny( nAdjust ) );
4706 pContext->Insert( PROP_PARA_LAST_LINE_ADJUST, true, uno::makeAny( nLastLineAdjust ) );
4709 bool DomainMapper::getColorFromIndex(const sal_Int32 nIndex, sal_Int32 &nColor)
4711 nColor = 0;
4712 if ((nIndex < 1) || (nIndex > 16))
4713 return false;
4715 switch (nIndex)
4717 case 1: nColor=0x000000; break; //black
4718 case 2: nColor=0x0000ff; break; //blue
4719 case 3: nColor=0x00ffff; break; //cyan
4720 case 4: nColor=0x00ff00; break; //green
4721 case 5: nColor=0xff00ff; break; //magenta
4722 case 6: nColor=0xff0000; break; //red
4723 case 7: nColor=0xffff00; break; //yellow
4724 case 8: nColor=0xffffff; break; //white
4725 case 9: nColor=0x000080; break;//dark blue
4726 case 10: nColor=0x008080; break; //dark cyan
4727 case 11: nColor=0x008000; break; //dark green
4728 case 12: nColor=0x800080; break; //dark magenta
4729 case 13: nColor=0x800000; break; //dark red
4730 case 14: nColor=0x808000; break; //dark yellow
4731 case 15: nColor=0x808080; break; //dark gray
4732 case 16: nColor=0xC0C0C0; break; //light gray
4733 default:
4734 return false;
4736 return true;
4739 sal_Int16 DomainMapper::getEmphasisValue(const sal_Int32 nIntValue)
4741 switch (nIntValue)
4743 case 1:
4744 return com::sun::star::text::FontEmphasis::DOT_ABOVE;
4745 case 2:
4746 return com::sun::star::text::FontEmphasis::ACCENT_ABOVE;
4747 case 3:
4748 return com::sun::star::text::FontEmphasis::CIRCLE_ABOVE;
4749 case 4:
4750 return com::sun::star::text::FontEmphasis::DOT_BELOW;
4751 default:
4752 return com::sun::star::text::FontEmphasis::NONE;
4756 rtl::OUString DomainMapper::getBracketStringFromEnum(const sal_Int32 nIntValue, const bool bIsPrefix)
4758 switch(nIntValue)
4760 case 1:
4761 if (bIsPrefix)
4762 return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "(" ));
4763 return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( ")" ));
4765 case 2:
4766 if (bIsPrefix)
4767 return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "[" ));
4768 return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "]" ));
4770 case 3:
4771 if (bIsPrefix)
4772 return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "<" ));
4773 return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( ">" ));
4775 case 4:
4776 if (bIsPrefix)
4777 return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "{" ));
4778 return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "}" ));
4780 case 0:
4781 default:
4782 return rtl::OUString();
4786 void DomainMapper::resolveSprmProps(Sprm & rSprm)
4788 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
4789 if( pProperties.get())
4790 pProperties->resolve(*this);
4793 void DomainMapper::resolveAttributeProperties(Value & val)
4795 writerfilter::Reference<Properties>::Pointer_t pProperties = val.getProperties();
4796 if( pProperties.get())
4797 pProperties->resolve(*this);
4801 com::sun::star::style::TabAlign DomainMapper::getTabAlignFromValue(const sal_Int32 nIntValue)
4803 switch (nIntValue)
4805 case 0:
4806 case 4: // bar not supported
4807 case 5: // num not supported
4808 return com::sun::star::style::TabAlign_LEFT;
4809 case 1:
4810 return com::sun::star::style::TabAlign_CENTER;
4811 case 2:
4812 return com::sun::star::style::TabAlign_RIGHT;
4813 case 3:
4814 return com::sun::star::style::TabAlign_DECIMAL;
4816 return com::sun::star::style::TabAlign_LEFT;
4819 sal_Unicode DomainMapper::getFillCharFromValue(const sal_Int32 nIntValue)
4821 switch (nIntValue)
4823 case 1: // dot
4824 return sal_Unicode(0x002e);
4825 case 2: // hyphen
4826 return sal_Unicode(0x002d);
4827 case 3: // underscore
4828 case 4: // heavy FIXME ???
4829 return sal_Unicode(0x005f);
4830 case NS_ooxml::LN_Value_ST_TabTlc_middleDot: // middleDot
4831 return sal_Unicode(0x00b7);
4832 case 0: // none
4833 default:
4834 return sal_Unicode(0x0020); // blank space
4837 /*-- 18.07.2007 14:59:00---------------------------------------------------
4839 -----------------------------------------------------------------------*/
4840 bool DomainMapper::IsOOXMLImport() const
4842 return m_pImpl->IsOOXMLImport();
4844 /*-- 18.07.2007 16:03:14---------------------------------------------------
4846 -----------------------------------------------------------------------*/
4847 uno::Reference < lang::XMultiServiceFactory > DomainMapper::GetTextFactory() const
4849 return m_pImpl->GetTextFactory();
4851 /*-- 12.11.2007 10:41:01---------------------------------------------------
4853 -----------------------------------------------------------------------*/
4854 /*-- 31.01.2008 18:19:44---------------------------------------------------
4856 -----------------------------------------------------------------------*/
4857 uno::Reference< text::XTextRange > DomainMapper::GetCurrentTextRange()
4859 return m_pImpl->GetTopTextAppend()->getEnd();
4862 /*-- 05.02.2008 10:26:26---------------------------------------------------
4864 -----------------------------------------------------------------------*/
4865 ::rtl::OUString DomainMapper::getOrCreateCharStyle( PropertyValueVector_t& rCharProperties )
4867 StyleSheetTablePtr pStyleSheets = m_pImpl->GetStyleSheetTable();
4868 return pStyleSheets->getOrCreateCharStyle( rCharProperties );
4871 ListsManager::Pointer DomainMapper::GetListTable( )
4873 return m_pImpl->GetListTable( );
4876 StyleSheetTablePtr DomainMapper::GetStyleSheetTable( )
4878 return m_pImpl->GetStyleSheetTable( );
4881 } //namespace dmapper
4882 } //namespace writerfilter