update ooo310-m15
[ooovba.git] / writerfilter / source / dmapper / DomainMapper.cxx
blob0379b34ba82f1ed731da291874ea8508866e9569
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 <ListTable.hxx>
37 #include <ThemeTable.hxx>
38 #include <ModelEventListener.hxx>
39 #include <MeasureHandler.hxx>
40 #include <OLEHandler.hxx>
41 #include <i18npool/mslangid.hxx>
42 #include <ooxml/OOXMLFastTokens.hxx>
43 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
44 #include <com/sun/star/document/XOOXMLDocumentPropertiesImporter.hpp>
45 #include <com/sun/star/text/HoriOrientation.hpp>
46 #include <com/sun/star/text/RelOrientation.hpp>
47 #include <com/sun/star/text/VertOrientation.hpp>
48 #include <com/sun/star/text/WrapTextMode.hpp>
49 #include <com/sun/star/text/SizeType.hpp>
50 #include <com/sun/star/text/XEndnotesSupplier.hpp>
51 #include <com/sun/star/text/XFootnotesSupplier.hpp>
52 #include <com/sun/star/text/XLineNumberingProperties.hpp>
53 #include <com/sun/star/text/XTextDocument.hpp>
54 #include <com/sun/star/text/XTextCursor.hpp>
55 #include <com/sun/star/text/XTextPortionAppend.hpp>
56 #include <com/sun/star/text/XParagraphAppend.hpp>
57 #include <com/sun/star/text/FontEmphasis.hpp>
58 #include <com/sun/star/awt/FontRelief.hpp>
59 #include <com/sun/star/awt/FontWeight.hpp>
60 #include <com/sun/star/awt/FontUnderline.hpp>
61 #include <com/sun/star/awt/FontStrikeout.hpp>
62 #include <com/sun/star/awt/FontSlant.hpp>
63 #include <com/sun/star/container/XIndexReplace.hpp>
64 #include <com/sun/star/drawing/XShape.hpp>
65 #include <com/sun/star/document/XEventBroadcaster.hpp>
66 #include <com/sun/star/style/ParagraphAdjust.hpp>
67 #include <com/sun/star/style/BreakType.hpp>
68 #include <com/sun/star/style/CaseMap.hpp>
69 #include <com/sun/star/style/LineSpacing.hpp>
70 #include <com/sun/star/style/LineSpacingMode.hpp>
71 #include <com/sun/star/table/BorderLine.hpp>
72 #include <com/sun/star/text/TextGridMode.hpp>
73 #include <com/sun/star/text/XDocumentIndexesSupplier.hpp>
74 #include <com/sun/star/text/WritingMode.hpp>
75 #include <com/sun/star/text/XFootnote.hpp>
76 #include <com/sun/star/style/NumberingType.hpp>
77 #include <comphelper/types.hxx>
78 #include <comphelper/storagehelper.hxx>
80 #include <rtl/ustrbuf.hxx>
81 #include <boost/shared_ptr.hpp>
82 #include <com/sun/star/uno/Any.hxx>
83 #include <tools/color.hxx>
84 #include <BorderHandler.hxx>
85 #include <CellColorHandler.hxx>
86 #include <SectionColumnHandler.hxx>
87 #include <vector>
88 #include <iostream>
90 #ifdef DEBUG_DOMAINMAPPER
91 #include <resourcemodel/QNameToString.hxx>
92 #include <resourcemodel/util.hxx>
93 #include <resourcemodel/TagLogger.hxx>
94 #endif
95 #if OSL_DEBUG_LEVEL > 0
96 #include <resourcemodel/QNameToString.hxx>
97 #endif
100 using namespace ::com::sun::star;
101 using namespace ::rtl;
103 namespace writerfilter {
104 namespace dmapper{
106 #ifdef DEBUG_DOMAINMAPPER
107 TagLogger::Pointer_t dmapper_logger(TagLogger::getInstance("DOMAINMAPPER"));
108 #endif
109 #if OSL_DEBUG_LEVEL > 0
110 #include <resourcemodel/QNameToString.hxx>
111 #endif
113 /* ---- Fridrich's mess begins here ---- */
114 struct _PageSz
116 sal_Int32 code;
117 sal_Int32 h;
118 bool orient;
119 sal_Int32 w;
120 } CT_PageSz;
123 /* ---- Fridrich's mess (hopefully) ends here ---- */
125 /*-- 09.06.2006 09:52:11---------------------------------------------------
127 -----------------------------------------------------------------------*/
128 DomainMapper::DomainMapper( const uno::Reference< uno::XComponentContext >& xContext,
129 uno::Reference< io::XInputStream > xInputStream,
130 uno::Reference< lang::XComponent > xModel,
131 SourceDocumentType eDocumentType) :
132 m_pImpl( new DomainMapper_Impl( *this, xContext, xModel, eDocumentType )),
133 mnBackgroundColor(0), mbIsHighlightSet(false)
135 // #i24363# tab stops relative to indent
136 m_pImpl->SetDocumentSettingsProperty(
137 PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_TABS_RELATIVE_TO_INDENT ),
138 uno::makeAny( false ) );
140 m_pImpl->SetDocumentSettingsProperty(
141 PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_ADD_PARA_TABLE_SPACING ),
142 uno::makeAny( false ) );
144 //import document properties
148 uno::Reference< lang::XMultiServiceFactory > xFactory(xContext->getServiceManager(), uno::UNO_QUERY_THROW);
149 uno::Reference< embed::XStorage > xDocumentStorage =
150 (comphelper::OStorageHelper::GetStorageOfFormatFromInputStream(OFOPXML_STORAGE_FORMAT_STRING, xInputStream));
152 uno::Reference< uno::XInterface > xTemp = xContext->getServiceManager()->createInstanceWithContext(
153 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.OOXMLDocumentPropertiesImporter")),
154 xContext);
156 uno::Reference< document::XOOXMLDocumentPropertiesImporter > xImporter( xTemp, uno::UNO_QUERY_THROW );
157 uno::Reference< document::XDocumentPropertiesSupplier > xPropSupplier( xModel, uno::UNO_QUERY_THROW);
158 xImporter->importProperties( xDocumentStorage, xPropSupplier->getDocumentProperties() );
160 catch( const uno::Exception& rEx )
162 (void)rEx;
165 #ifdef DEBUG_DOMAINMAPPER
166 dmapper_logger->startElement("domainmapper");
167 #endif
169 /*-- 09.06.2006 09:52:12---------------------------------------------------
171 -----------------------------------------------------------------------*/
172 DomainMapper::~DomainMapper()
176 uno::Reference< text::XDocumentIndexesSupplier> xIndexesSupplier( m_pImpl->GetTextDocument(), uno::UNO_QUERY );
177 uno::Reference< container::XIndexAccess > xIndexes = xIndexesSupplier->getDocumentIndexes();
178 sal_Int32 nIndexes = xIndexes->getCount();
179 if( nIndexes )
181 //index update has to wait until first view is created
182 uno::Reference< document::XEventBroadcaster > xBroadcaster(xIndexesSupplier, uno::UNO_QUERY);
183 xBroadcaster->addEventListener(uno::Reference< document::XEventListener >(new ModelEventListener));
187 // Apply the document settings after everything else
188 m_pImpl->GetSettingsTable()->ApplyProperties( m_pImpl->GetTextDocument( ) );
190 catch( const uno::Exception& rEx )
192 (void)rEx;
195 delete m_pImpl;
197 #ifdef DEBUG_DOMAINMAPPER
198 dmapper_logger->endElement("domainmapper");
199 #endif
201 /*-- 09.06.2006 09:52:12---------------------------------------------------
203 -----------------------------------------------------------------------*/
204 void DomainMapper::attribute(Id nName, Value & val)
206 #ifdef DEBUG_DOMAINMAPPER
207 dmapper_logger->startElement("attribute");
208 dmapper_logger->attribute("name", (*QNameToString::Instance())(nName));
209 dmapper_logger->attribute("value", val.toString());
210 #endif
211 static ::rtl::OUString sLocalBookmarkName;
212 sal_Int32 nIntValue = val.getInt();
213 rtl::OUString sStringValue = val.getString();
214 // printf ( "DomainMapper::attribute(0x%.4x, 0x%.4x) [%s]\n", (unsigned int)nName, (unsigned int)nIntValue, ::rtl::OUStringToOString(sStringValue, RTL_TEXTENCODING_DONTKNOW).getStr());
215 if( nName >= NS_rtf::LN_WIDENT && nName <= NS_rtf::LN_LCBSTTBFUSSR )
216 m_pImpl->GetFIB().SetData( nName, nIntValue );
217 else //if( !m_pImpl->getTableManager().attribute( nName, val) )
221 /* WRITERFILTERSTATUS: table: attributedata */
222 switch( nName )
224 /* attributes to be ignored */
225 case NS_rtf::LN_UNUSED4:
226 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
228 case NS_rtf::LN_UNUSED8:
229 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
231 case NS_rtf::LN_UNUSED1_3:
232 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
234 case NS_rtf::LN_UNUSED1_7:
235 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
237 case NS_rtf::LN_UNUSED8_3:
238 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
240 case NS_rtf::LN_FWRITERESERVATION:
241 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
243 case NS_rtf::LN_FLOADOVERRIDE:
244 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
246 case NS_rtf::LN_FFAREAST:
247 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
249 case NS_rtf::LN_FCRYPTO:
250 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
252 case NS_rtf::LN_NFIBBACK:
253 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
255 case NS_rtf::LN_LKEY:
256 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
258 case NS_rtf::LN_ENVR:
259 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
261 case NS_rtf::LN_FMAC:
262 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
264 case NS_rtf::LN_FWORD97SAVED:
265 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
267 case NS_rtf::LN_FCMAC:
268 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
270 case NS_rtf::LN_PNFBPCHPFIRST_W6:
271 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
273 case NS_rtf::LN_PNCHPFIRST_W6:
274 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
276 case NS_rtf::LN_CPNBTECHP_W6:
277 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
279 case NS_rtf::LN_PNFBPPAPFIRST_W6:
280 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
282 case NS_rtf::LN_PNPAPFIRST_W6:
283 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
285 case NS_rtf::LN_CPNBTEPAP_W6:
286 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
288 case NS_rtf::LN_PNFBPLVCFIRST_W6:
289 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
291 case NS_rtf::LN_PNLVCFIRST_W6:
292 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
294 case NS_rtf::LN_CPNBTELVC_W6:
295 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
297 case NS_rtf::LN_CBMAC:
298 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
300 case NS_rtf::LN_LPRODUCTCREATED:
301 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
303 case NS_rtf::LN_LPRODUCTREVISED:
304 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
306 case NS_rtf::LN_CCPMCR:
307 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
309 case NS_rtf::LN_PNFBPCHPFIRST:
310 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
312 case NS_rtf::LN_PNFBPPAPFIRST:
313 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
315 case NS_rtf::LN_PNFBPLVCFIRST:
316 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
318 case NS_rtf::LN_FCISLANDFIRST:
319 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
321 case NS_rtf::LN_FCISLANDLIM:
322 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
324 case NS_rtf::LN_FCSTSHFORIG:
325 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
327 case NS_rtf::LN_LCBSTSHFORIG:
328 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
330 case NS_rtf::LN_FCPLCFPAD:
331 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
333 case NS_rtf::LN_LCBPLCFPAD:
334 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
336 case NS_rtf::LN_FCSTTBFGLSY:
337 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
339 case NS_rtf::LN_LCBSTTBFGLSY:
340 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
342 case NS_rtf::LN_FCPLCFGLSY:
343 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
345 case NS_rtf::LN_LCBPLCFGLSY:
346 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
348 case NS_rtf::LN_FCPLCFSEA:
349 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
351 case NS_rtf::LN_LCBPLCFSEA:
352 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
354 case NS_rtf::LN_FCPLCFFLDMCR:
355 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
357 case NS_rtf::LN_LCBPLCFFLDMCR:
358 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
360 case NS_rtf::LN_FCCMDS:
361 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
363 case NS_rtf::LN_LCBCMDS:
364 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
366 case NS_rtf::LN_FCPLCMCR:
367 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
369 case NS_rtf::LN_LCBPLCMCR:
370 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
372 case NS_rtf::LN_FCSTTBFMCR:
373 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
375 case NS_rtf::LN_LCBSTTBFMCR:
376 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
378 case NS_rtf::LN_FCPRDRVR:
379 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
381 case NS_rtf::LN_LCBPRDRVR:
382 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
384 case NS_rtf::LN_FCPRENVPORT:
385 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
387 case NS_rtf::LN_LCBPRENVPORT:
388 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
390 case NS_rtf::LN_FCPRENVLAND:
391 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
393 case NS_rtf::LN_LCBPRENVLAND:
394 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
396 case NS_rtf::LN_FCWSS:
397 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
399 case NS_rtf::LN_LCBWSS:
400 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
402 case NS_rtf::LN_FCPLCFPGDFTN:
403 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
405 case NS_rtf::LN_LCBPLCFPGDFTN:
406 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
408 case NS_rtf::LN_FCAUTOSAVESOURCE:
409 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
411 case NS_rtf::LN_LCBAUTOSAVESOURCE:
412 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
414 case NS_rtf::LN_FCPLCDOAMOM:
415 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
417 case NS_rtf::LN_LCBPLCDOAMOM:
418 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
420 case NS_rtf::LN_FCPLCDOAHDR:
421 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
423 case NS_rtf::LN_LCBPLCDOAHDR:
424 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
426 case NS_rtf::LN_FCPMS:
427 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
429 case NS_rtf::LN_LCBPMS:
430 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
432 case NS_rtf::LN_FCPLCFPGDEDN:
433 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
435 case NS_rtf::LN_LCBPLCFPGDEDN:
436 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
438 case NS_rtf::LN_FCPLCFWKB:
439 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
441 case NS_rtf::LN_LCBPLCFWKB:
442 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
444 case NS_rtf::LN_FCPLCFSPL:
445 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
447 case NS_rtf::LN_LCBPLCFSPL:
448 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
450 case NS_rtf::LN_FCSTWUSER:
451 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
453 case NS_rtf::LN_LCBSTWUSER:
454 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
456 case NS_rtf::LN_FCUNUSED:
457 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
459 case NS_rtf::LN_LCBUNUSED:
460 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
462 case NS_rtf::LN_FCSTTBFINTLFLD:
463 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
465 case NS_rtf::LN_LCBSTTBFINTLFLD:
466 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
468 case NS_rtf::LN_FCROUTESLIP:
469 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
471 case NS_rtf::LN_LCBROUTESLIP:
472 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
474 case NS_rtf::LN_FCSTTBSAVEDBY:
475 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
477 case NS_rtf::LN_LCBSTTBSAVEDBY:
478 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
480 case NS_rtf::LN_FCSTTBFNM:
481 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
483 case NS_rtf::LN_LCBSTTBFNM:
484 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
486 case NS_rtf::LN_FCDOCUNDO:
487 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
489 case NS_rtf::LN_LCBDOCUNDO:
490 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
492 case NS_rtf::LN_FCRGBUSE:
493 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
495 case NS_rtf::LN_LCBRGBUSE:
496 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
498 case NS_rtf::LN_FCUSP:
499 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
501 case NS_rtf::LN_LCBUSP:
502 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
504 case NS_rtf::LN_FCUSKF:
505 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
507 case NS_rtf::LN_LCBUSKF:
508 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
510 case NS_rtf::LN_FCPLCUPCRGBUSE:
511 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
513 case NS_rtf::LN_LCBPLCUPCRGBUSE:
514 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
516 case NS_rtf::LN_FCPLCUPCUSP:
517 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
519 case NS_rtf::LN_LCBPLCUPCUSP:
520 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
522 case NS_rtf::LN_FCPLGOSL:
523 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
525 case NS_rtf::LN_LCBPLGOSL:
526 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
528 case NS_rtf::LN_FCPLCOCX:
529 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
531 case NS_rtf::LN_LCBPLCOCX:
532 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
534 case NS_rtf::LN_DWLOWDATETIME:
535 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
537 case NS_rtf::LN_DWHIGHDATETIME:
538 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
540 case NS_rtf::LN_FCPLCASUMY:
541 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
543 case NS_rtf::LN_LCBPLCASUMY:
544 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
546 case NS_rtf::LN_FCPLCFGRAM:
547 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
549 case NS_rtf::LN_LCBPLCFGRAM:
550 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
552 case NS_rtf::LN_FCSTTBFUSSR:
553 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
554 break;
556 case NS_rtf::LN_ISTD: //index of applied style
557 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
559 //search for the style with the given id and apply it
560 //as CharStyleName or ParaStyleName
561 //if the style is a user defined style then it must have an ISTD - built-in styles might not have it
562 StyleSheetTablePtr pStyleSheets = m_pImpl->GetStyleSheetTable();
563 ::rtl::OUString sValue = ::rtl::OUString::valueOf(nIntValue, 16);
564 const StyleSheetEntryPtr pEntry = pStyleSheets->FindStyleSheetByISTD(sValue);
565 if( pEntry.get( ) )
567 bool bParaStyle = (pEntry->nStyleTypeCode == STYLE_TYPE_PARA);
568 if(bParaStyle)
569 m_pImpl->SetCurrentParaStyleId(::rtl::OUString::valueOf(static_cast<sal_Int32>(nIntValue), 16));
570 if (m_pImpl->GetTopContext() && m_pImpl->GetTopContextType() != CONTEXT_SECTION)
571 m_pImpl->GetTopContext()->Insert(
572 bParaStyle ?
573 PROP_PARA_STYLE_NAME : PROP_CHAR_STYLE_NAME,
574 true,
575 uno::makeAny(
576 m_pImpl->GetStyleSheetTable()->ConvertStyleName( pEntry->sStyleName ) ) );
579 break;
580 case NS_rtf::LN_ISTARTAT:
581 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
582 break;
583 case NS_rtf::LN_NFC:
584 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
585 break;
586 case NS_rtf::LN_FLEGAL:
587 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
588 break;
589 case NS_rtf::LN_FNORESTART:
590 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
591 break;
592 case NS_rtf::LN_FPREV:
593 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
594 break;
595 case NS_rtf::LN_FPREVSPACE:
596 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
597 break;
598 case NS_rtf::LN_FWORD6:
599 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
600 break;
601 case NS_rtf::LN_UNUSED5_7:
602 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
603 break;
604 case NS_rtf::LN_RGBXCHNUMS:
605 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
606 break;
607 case NS_rtf::LN_IXCHFOLLOW:
608 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
609 break;
610 case NS_rtf::LN_DXASPACE:
611 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
612 break;
613 case NS_rtf::LN_DXAINDENT:
614 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
615 break;
616 case NS_rtf::LN_CBGRPPRLCHPX:
617 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
618 break;
619 case NS_rtf::LN_CBGRPPRLPAPX:
620 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
621 break;
622 case NS_rtf::LN_LSID:
623 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
624 break;
625 case NS_rtf::LN_TPLC:
626 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
627 break;
628 case NS_rtf::LN_RGISTD:
629 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
630 break;
631 case NS_rtf::LN_FSIMPLELIST:
632 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
633 break;
634 case NS_rtf::LN_FRESTARTHDN:
635 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
636 break;
637 case NS_rtf::LN_UNSIGNED26_2:
638 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
639 break;
640 case NS_rtf::LN_ILVL:
641 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
642 break;
643 case NS_rtf::LN_FSTARTAT:
644 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
645 break;
646 case NS_rtf::LN_FFORMATTING:
647 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
648 break;
649 case NS_rtf::LN_UNSIGNED4_6:
650 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
651 break;
652 case NS_rtf::LN_CLFOLVL:
653 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
654 break;
655 case NS_rtf::LN_CBFFNM1:
656 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
657 break;
658 case NS_rtf::LN_PRQ:
659 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
660 break;
661 case NS_rtf::LN_FTRUETYPE:
662 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
663 break;
664 case NS_rtf::LN_FF:
665 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
666 break;
667 case NS_rtf::LN_WWEIGHT:
668 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
669 break;
670 case NS_rtf::LN_CHS:
671 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
674 m_pImpl->GetFIB().SetLNCHS( nIntValue );
676 break;
677 case NS_rtf::LN_IXCHSZALT:
678 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
679 break;
680 case NS_rtf::LN_PANOSE:
681 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
682 break;
683 case NS_rtf::LN_FS:
684 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
685 break;
686 case NS_rtf::LN_STI:
687 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
688 break;
689 case NS_rtf::LN_FSCRATCH:
690 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
691 break;
692 case NS_rtf::LN_FINVALHEIGHT:
693 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
694 break;
695 case NS_rtf::LN_FHASUPE:
696 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
697 break;
698 case NS_rtf::LN_FMASSCOPY:
699 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
700 break;
701 case NS_rtf::LN_SGC:
702 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
703 break;
704 case NS_rtf::LN_ISTDBASE:
705 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
706 break;
707 case NS_rtf::LN_CUPX:
708 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
709 break;
710 case NS_rtf::LN_ISTDNEXT:
711 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
712 break;
713 case NS_rtf::LN_BCHUPE:
714 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
715 break;
716 case NS_rtf::LN_FAUTOREDEF:
717 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
718 break;
719 case NS_rtf::LN_FHIDDEN:
720 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
721 break;
722 case NS_rtf::LN_CSTD:
723 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
724 break;
725 case NS_rtf::LN_CBSTDBASEINFILE:
726 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
727 break;
728 case NS_rtf::LN_FSTDSTYLENAMESWRITTEN:
729 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
730 break;
731 case NS_rtf::LN_UNUSED4_2:
732 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
733 break;
734 case NS_rtf::LN_STIMAXWHENSAVED:
735 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
736 break;
737 case NS_rtf::LN_ISTDMAXFIXEDWHENSAVED:
738 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
739 break;
740 case NS_rtf::LN_NVERBUILTINNAMESWHENSAVED:
741 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
742 break;
743 case NS_rtf::LN_RGFTCSTANDARDCHPSTSH:
744 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
745 break;
746 case NS_rtf::LN_WIDENT:
747 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
749 case NS_rtf::LN_NFIB:
750 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
752 case NS_rtf::LN_NPRODUCT:
753 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
754 case NS_rtf::LN_LID:
755 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
756 case NS_rtf::LN_PNNEXT:
757 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
758 case NS_rtf::LN_FDOT:
759 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
760 case NS_rtf::LN_FGLSY:
761 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
762 case NS_rtf::LN_FCOMPLEX:
763 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
764 case NS_rtf::LN_FHASPIC:
765 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
767 case NS_rtf::LN_CQUICKSAVES:
768 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
770 case NS_rtf::LN_FENCRYPTED:
771 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
773 case NS_rtf::LN_FWHICHTBLSTM:
774 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
776 case NS_rtf::LN_FREADONLYRECOMMENDED:
777 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
779 case NS_rtf::LN_FEXTCHAR:
780 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
782 case NS_rtf::LN_FEMPTYSPECIAL:
783 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
785 case NS_rtf::LN_FLOADOVERRIDEPAGE:
786 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
788 case NS_rtf::LN_FFUTURESAVEDUNDO:
789 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
791 case NS_rtf::LN_FSPARE0:
792 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
794 case NS_rtf::LN_CHSTABLES:
795 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
797 case NS_rtf::LN_FCMIN:
798 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
800 case NS_rtf::LN_CSW:
801 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
803 case NS_rtf::LN_WMAGICCREATED:
804 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
806 case NS_rtf::LN_WMAGICREVISED:
807 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
809 case NS_rtf::LN_WMAGICCREATEDPRIVATE:
810 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
813 case NS_rtf::LN_WMAGICREVISEDPRIVATE:
814 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
816 case NS_rtf::LN_LIDFE:
817 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
819 case NS_rtf::LN_CLW:
820 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
822 case NS_rtf::LN_CCPTEXT:
823 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
826 case NS_rtf::LN_CCPFTN:
827 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
829 case NS_rtf::LN_CCPHDD:
830 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
832 case NS_rtf::LN_CCPATN:
833 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
835 case NS_rtf::LN_CCPEDN:
836 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
838 case NS_rtf::LN_CCPTXBX:
839 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
841 case NS_rtf::LN_CCPHDRTXBX:
842 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
844 case NS_rtf::LN_PNCHPFIRST:
845 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
847 case NS_rtf::LN_CPNBTECHP:
848 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
850 case NS_rtf::LN_PNPAPFIRST:
851 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
853 case NS_rtf::LN_CPNBTEPAP:
854 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
856 case NS_rtf::LN_PNLVCFIRST:
857 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
859 case NS_rtf::LN_CPNBTELVC:
860 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
862 case NS_rtf::LN_CFCLCB:
863 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
865 case NS_rtf::LN_FCSTSHF:
866 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
868 case NS_rtf::LN_LCBSTSHF:
869 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
871 case NS_rtf::LN_FCPLCFFNDREF:
872 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
874 case NS_rtf::LN_LCBPLCFFNDREF:
875 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
877 case NS_rtf::LN_FCPLCFFNDTXT:
878 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
880 case NS_rtf::LN_LCBPLCFFNDTXT:
881 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
883 case NS_rtf::LN_FCPLCFANDREF:
884 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
886 case NS_rtf::LN_LCBPLCFANDREF:
887 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
889 case NS_rtf::LN_FCPLCFANDTXT:
890 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
892 case NS_rtf::LN_LCBPLCFANDTXT:
893 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
895 case NS_rtf::LN_FCPLCFSED:
896 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
898 case NS_rtf::LN_LCBPLCFSED:
899 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
901 case NS_rtf::LN_FCPLCFPHE:
902 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
904 case NS_rtf::LN_LCBPLCFPHE:
905 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
907 case NS_rtf::LN_FCPLCFHDD:
908 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
910 case NS_rtf::LN_LCBPLCFHDD:
911 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
913 case NS_rtf::LN_FCPLCFBTECHPX:
914 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
916 case NS_rtf::LN_LCBPLCFBTECHPX:
917 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
920 case NS_rtf::LN_FCPLCFBTEPAPX:
921 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
923 case NS_rtf::LN_LCBPLCFBTEPAPX:
924 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
926 case NS_rtf::LN_FCSTTBFFFN:
927 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
929 case NS_rtf::LN_LCBSTTBFFFN:
930 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
932 case NS_rtf::LN_FCPLCFFLDMOM:
933 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
935 case NS_rtf::LN_LCBPLCFFLDMOM:
936 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
938 case NS_rtf::LN_FCPLCFFLDHDR:
939 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
941 case NS_rtf::LN_LCBPLCFFLDHDR:
942 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
945 case NS_rtf::LN_FCPLCFFLDFTN:
946 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
948 case NS_rtf::LN_LCBPLCFFLDFTN:
949 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
951 case NS_rtf::LN_FCPLCFFLDATN:
952 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
954 case NS_rtf::LN_LCBPLCFFLDATN:
955 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
957 case NS_rtf::LN_FCSTTBFBKMK:
958 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
960 case NS_rtf::LN_LCBSTTBFBKMK:
961 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
963 case NS_rtf::LN_FCPLCFBKF:
964 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
966 case NS_rtf::LN_LCBPLCFBKF:
967 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
969 case NS_rtf::LN_FCPLCFBKL:
970 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
972 case NS_rtf::LN_LCBPLCFBKL:
973 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
975 case NS_rtf::LN_FCDOP:
976 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
978 case NS_rtf::LN_LCBDOP:
979 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
981 case NS_rtf::LN_FCSTTBFASSOC:
982 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
984 case NS_rtf::LN_LCBSTTBFASSOC:
985 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
987 case NS_rtf::LN_FCCLX:
988 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
990 case NS_rtf::LN_LCBCLX:
991 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
993 case NS_rtf::LN_FCGRPXSTATNOWNERS:
994 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
996 case NS_rtf::LN_LCBGRPXSTATNOWNERS:
997 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
999 case NS_rtf::LN_FCSTTBFATNBKMK:
1000 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1002 case NS_rtf::LN_LCBSTTBFATNBKMK:
1003 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1005 case NS_rtf::LN_FCPLCSPAMOM:
1006 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1008 case NS_rtf::LN_LCBPLCSPAMOM:
1009 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1011 case NS_rtf::LN_FCPLCSPAHDR:
1012 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1015 case NS_rtf::LN_LCBPLCSPAHDR:
1016 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1018 case NS_rtf::LN_FCPLCFATNBKF:
1019 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1021 case NS_rtf::LN_LCBPLCFATNBKF:
1022 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1024 case NS_rtf::LN_FCPLCFATNBKL:
1025 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1027 case NS_rtf::LN_LCBPLCFATNBKL:
1028 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1030 case NS_rtf::LN_FCFORMFLDSTTBF:
1031 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1033 case NS_rtf::LN_LCBFORMFLDSTTBF:
1034 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1036 case NS_rtf::LN_FCPLCFENDREF:
1037 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1040 case NS_rtf::LN_LCBPLCFENDREF:
1041 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1043 case NS_rtf::LN_FCPLCFENDTXT:
1044 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1046 case NS_rtf::LN_LCBPLCFENDTXT:
1047 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1049 case NS_rtf::LN_FCPLCFFLDEDN:
1050 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1052 case NS_rtf::LN_LCBPLCFFLDEDN:
1053 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1055 case NS_rtf::LN_FCDGGINFO:
1056 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1058 case NS_rtf::LN_LCBDGGINFO:
1059 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1061 case NS_rtf::LN_FCSTTBFRMARK:
1062 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1065 case NS_rtf::LN_LCBSTTBFRMARK:
1066 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1068 case NS_rtf::LN_FCSTTBFCAPTION:
1069 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1071 case NS_rtf::LN_LCBSTTBFCAPTION:
1072 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1074 case NS_rtf::LN_FCSTTBFAUTOCAPTION:
1075 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1077 case NS_rtf::LN_LCBSTTBFAUTOCAPTION:
1078 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1080 case NS_rtf::LN_LCBPLCFTXBXTXT:
1081 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1083 case NS_rtf::LN_FCPLCFFLDTXBX:
1084 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1086 case NS_rtf::LN_LCBPLCFFLDTXBX:
1087 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1089 case NS_rtf::LN_FCPLCFHDRTXBXTXT:
1090 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1092 case NS_rtf::LN_LCBPLCFHDRTXBXTXT:
1093 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1095 case NS_rtf::LN_FCPLCFFLDHDRTXBX:
1096 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1098 case NS_rtf::LN_LCBPLCFFLDHDRTXBX:
1099 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1101 case NS_rtf::LN_FCSTTBTTMBD:
1102 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1104 case NS_rtf::LN_LCBSTTBTTMBD:
1105 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1107 case NS_rtf::LN_FCPGDMOTHER:
1108 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1110 case NS_rtf::LN_LCBPGDMOTHER:
1111 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1113 case NS_rtf::LN_FCBKDMOTHER:
1114 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1116 case NS_rtf::LN_LCBBKDMOTHER:
1117 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1119 case NS_rtf::LN_FCPGDFTN:
1120 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1122 case NS_rtf::LN_LCBPGDFTN:
1123 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1125 case NS_rtf::LN_FCBKDFTN:
1126 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1128 case NS_rtf::LN_LCBBKDFTN:
1129 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1131 case NS_rtf::LN_FCPGDEDN:
1132 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1134 case NS_rtf::LN_LCBPGDEDN:
1135 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1138 case NS_rtf::LN_FCBKDEDN:
1139 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1141 case NS_rtf::LN_LCBBKDEDN:
1142 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1144 case NS_rtf::LN_FCPLCFLST:
1145 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1148 case NS_rtf::LN_LCBPLCFLST:
1149 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1151 case NS_rtf::LN_FCPLFLFO:
1152 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1154 case NS_rtf::LN_LCBPLFLFO:
1155 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1157 case NS_rtf::LN_FCPLCFTXBXBKD:
1158 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1160 case NS_rtf::LN_LCBPLCFTXBXBKD:
1161 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1163 case NS_rtf::LN_FCPLCFTXBXHDRBKD:
1164 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1166 case NS_rtf::LN_LCBPLCFTXBXHDRBKD:
1167 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1169 case NS_rtf::LN_FCSTTBGLSYSTYLE:
1170 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1173 case NS_rtf::LN_LCBSTTBGLSYSTYLE:
1174 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1176 case NS_rtf::LN_FCPLCFBTELVC:
1177 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1179 case NS_rtf::LN_LCBPLCFBTELVC:
1180 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1182 case NS_rtf::LN_FCPLCFLVC:
1183 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1185 case NS_rtf::LN_LCBPLCFLVC:
1186 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1188 case NS_rtf::LN_FCSTTBLISTNAMES:
1189 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1191 case NS_rtf::LN_LCBSTTBLISTNAMES:
1192 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1194 case NS_rtf::LN_LCBSTTBFUSSR:
1195 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1197 m_pImpl->GetFIB().SetData( nName, nIntValue );
1199 break;
1200 case NS_rtf::LN_FN:
1201 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1203 case NS_rtf::LN_FCSEPX:
1204 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1206 case NS_rtf::LN_FNMPR:
1207 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1209 case NS_rtf::LN_FCMPR:
1210 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1212 //section descriptor, unused or internally used
1213 break;
1214 case NS_rtf::LN_ICOFORE:
1215 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1216 break;
1217 case NS_rtf::LN_ICOBACK:
1218 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1219 break;
1220 case NS_rtf::LN_IPAT:
1221 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1222 break;
1223 case NS_rtf::LN_SHDFORECOLOR:
1224 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1225 break;
1226 case NS_rtf::LN_SHDBACKCOLOR:
1227 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1228 break;
1229 case NS_rtf::LN_SHDPATTERN:
1230 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1231 break;
1232 case NS_rtf::LN_DPTLINEWIDTH:
1233 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1234 break;
1235 case NS_rtf::LN_BRCTYPE:
1236 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1237 break;
1238 case NS_rtf::LN_ICO:
1239 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1240 break;
1241 case NS_rtf::LN_DPTSPACE:
1242 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1243 break;
1244 case NS_rtf::LN_FSHADOW:
1245 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1246 break;
1247 case NS_rtf::LN_FFRAME:
1248 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1249 break;
1250 case NS_rtf::LN_UNUSED2_15:
1251 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1252 break;
1253 case NS_rtf::LN_FFIRSTMERGED:
1254 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1255 break;
1256 case NS_rtf::LN_FMERGED:
1257 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1258 break;
1259 case NS_rtf::LN_FVERTICAL:
1260 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1261 break;
1262 case NS_rtf::LN_FBACKWARD:
1263 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1264 break;
1265 case NS_rtf::LN_FROTATEFONT:
1266 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1267 break;
1268 case NS_rtf::LN_FVERTMERGE:
1269 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1270 break;
1271 case NS_rtf::LN_FVERTRESTART:
1272 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1273 break;
1274 case NS_rtf::LN_VERTALIGN:
1275 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1276 break;
1277 case NS_rtf::LN_FUNUSED:
1278 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1279 break;
1280 case NS_rtf::LN_BRCTOP:
1281 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1282 case NS_rtf::LN_BRCLEFT:
1283 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1284 case NS_rtf::LN_BRCBOTTOM:
1285 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1286 case NS_rtf::LN_BRCRIGHT:
1287 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1289 table::BorderLine aBorderLine;
1290 sal_Int32 nLineDistance = ConversionHelper::MakeBorderLine( nIntValue, aBorderLine );
1291 (void)nLineDistance;
1292 PropertyIds eBorderId = PROP_LEFT_BORDER;
1293 PropertyIds eBorderDistId = PROP_LEFT_BORDER_DISTANCE ;
1294 switch( nName )
1296 case NS_rtf::LN_BRCTOP:
1297 eBorderId = PROP_TOP_BORDER ;
1298 eBorderDistId = PROP_TOP_BORDER_DISTANCE;
1299 break;
1300 case NS_rtf::LN_BRCLEFT:
1301 // eBorderId = PROP_LEFT_BORDER;
1302 // eBorderDistId = PROP_LEFT_BORDER_DISTANCE ;
1303 break;
1304 case NS_rtf::LN_BRCBOTTOM:
1305 eBorderId = PROP_BOTTOM_BORDER ;
1306 eBorderDistId = PROP_BOTTOM_BORDER_DISTANCE;
1307 break;
1308 case NS_rtf::LN_BRCRIGHT:
1309 eBorderId = PROP_RIGHT_BORDER ;
1310 eBorderDistId = PROP_RIGHT_BORDER_DISTANCE ;
1311 break;
1312 default:;
1314 //todo: where to put the border properties
1315 //rContext->Insert(eBorderId, uno::makeAny( aBorderLine ));
1316 //rContext->Insert(eBorderDistId, uno::makeAny( nLineDistance ));
1318 break;
1319 case NS_rtf::LN_ITCFIRST:
1320 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1321 break;
1322 case NS_rtf::LN_FPUB:
1323 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1324 break;
1325 case NS_rtf::LN_ITCLIM:
1326 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1327 break;
1328 case NS_rtf::LN_FCOL:
1329 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1330 break;
1331 case NS_rtf::LN_LINECOLOR:
1332 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1333 break;
1334 case NS_rtf::LN_LINEWIDTH:
1335 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1336 break;
1337 case NS_rtf::LN_LINETYPE:
1338 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1339 break;
1340 case NS_rtf::LN_MM:
1341 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1342 break;
1343 case NS_rtf::LN_XEXT:
1344 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1345 break;
1346 case NS_rtf::LN_YEXT:
1347 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1348 break;
1349 case NS_rtf::LN_HMF:
1350 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1351 break;
1352 case NS_rtf::LN_LCB:
1353 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1354 break;
1355 case NS_rtf::LN_CBHEADER:
1356 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1357 break;
1358 case NS_rtf::LN_MFP:
1359 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1360 break;
1361 case NS_rtf::LN_BM_RCWINMF:
1362 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1363 break;
1364 case NS_rtf::LN_DXAGOAL:
1365 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1366 break;
1367 case NS_rtf::LN_DYAGOAL:
1368 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1369 break;
1370 case NS_rtf::LN_MX:
1371 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1372 break;
1373 case NS_rtf::LN_MY:
1374 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1375 break;
1376 case NS_rtf::LN_DXACROPLEFT:
1377 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1378 break;
1379 case NS_rtf::LN_DYACROPTOP:
1380 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1381 break;
1382 case NS_rtf::LN_DXACROPRIGHT:
1383 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1384 break;
1385 case NS_rtf::LN_DYACROPBOTTOM:
1386 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1387 break;
1388 case NS_rtf::LN_BRCL:
1389 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1390 break;
1391 case NS_rtf::LN_FFRAMEEMPTY:
1392 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1393 break;
1394 case NS_rtf::LN_FBITMAP:
1395 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1396 break;
1397 case NS_rtf::LN_FDRAWHATCH:
1398 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1399 break;
1400 case NS_rtf::LN_FERROR:
1401 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1402 break;
1403 case NS_rtf::LN_BPP:
1404 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1405 break;
1406 case NS_rtf::LN_DXAORIGIN:
1407 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1408 break;
1409 case NS_rtf::LN_DYAORIGIN:
1410 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1411 break;
1412 case NS_rtf::LN_CPROPS:
1413 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1414 break;
1415 case NS_rtf::LN_LINEPROPSTOP:
1416 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1417 break;
1418 case NS_rtf::LN_LINEPROPSLEFT:
1419 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1420 break;
1421 case NS_rtf::LN_LINEPROPSBOTTOM:
1422 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1423 break;
1424 case NS_rtf::LN_LINEPROPSRIGHT:
1425 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1426 break;
1427 case NS_rtf::LN_LINEPROPSHORIZONTAL:
1428 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1429 break;
1430 case NS_rtf::LN_LINEPROPSVERTICAL:
1431 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1432 break;
1433 case NS_rtf::LN_headerr:
1434 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1435 break;
1436 case NS_rtf::LN_footerr:
1437 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1438 break;
1439 case NS_rtf::LN_endnote:
1440 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1441 break;
1442 case NS_rtf::LN_BOOKMARKNAME:
1443 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1444 // sStringValue contains the bookmark name
1445 sLocalBookmarkName = sStringValue;
1446 break;
1447 case NS_rtf::LN_IBKL:
1448 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0.5 */
1449 //contains the bookmark identifier - has to be added to the bookmark name imported before
1450 //if it is already available then the bookmark should be inserted
1451 m_pImpl->AddBookmark( sLocalBookmarkName, sStringValue );
1452 sLocalBookmarkName = ::rtl::OUString();
1453 break;
1454 case NS_rtf::LN_LISTLEVEL:
1455 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1456 break;
1457 case NS_rtf::LN_LFO:
1458 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1459 break;
1460 case NS_rtf::LN_F:
1461 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1462 break;
1463 case NS_rtf::LN_ALTFONTNAME:
1464 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1465 break;
1466 case NS_rtf::LN_XSZFFN:
1467 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1468 break;
1469 case NS_rtf::LN_XSTZNAME:
1470 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1471 break;
1472 case NS_rtf::LN_XSTZNAME1:
1473 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1474 break;
1475 case NS_rtf::LN_UPXSTART:
1476 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1477 break;
1478 case NS_rtf::LN_UPX:
1479 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1480 break;
1481 case NS_rtf::LN_sed:
1482 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1483 //section properties
1484 resolveAttributeProperties(val);
1485 break;
1486 case NS_rtf::LN_tbdAdd:
1487 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1490 writerfilter::Reference<Properties>::Pointer_t pProperties = val.getProperties();
1491 if( pProperties.get())
1493 pProperties->resolve(*this);
1494 //increment to the next tab stop
1495 m_pImpl->NextTabStop();
1498 break;
1499 case NS_rtf::LN_dxaDel:
1500 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1501 //deleted tab
1502 case NS_rtf::LN_dxaAdd:
1503 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1504 //set tab
1505 case NS_rtf::LN_TLC:
1506 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1507 //tab leading characters - for decimal tabs
1508 case NS_rtf::LN_JC:
1509 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1510 //tab justification
1511 m_pImpl->ModifyCurrentTabStop(nName, nIntValue);
1512 break;
1513 case NS_rtf::LN_UNUSED0_6:
1514 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1515 // really unused
1516 break;
1517 case NS_rtf::LN_rgbrc:
1518 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1519 break;
1520 case NS_rtf::LN_shd:
1521 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1522 break;
1523 case NS_rtf::LN_cellShd:
1524 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1525 break;
1526 case NS_rtf::LN_cellTopColor:
1527 case NS_rtf::LN_cellLeftColor:
1528 case NS_rtf::LN_cellBottomColor:
1529 case NS_rtf::LN_cellRightColor:
1530 OSL_ASSERT("handled by DomainMapperTableManager");
1531 break;
1533 case NS_rtf::LN_LISTTABLE:
1534 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1535 break;
1536 case NS_rtf::LN_LFOTABLE:
1537 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1538 break;
1539 case NS_rtf::LN_FONTTABLE:
1540 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1541 break;
1542 case NS_rtf::LN_STYLESHEET:
1543 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1544 break;
1546 case NS_rtf::LN_fcEastAsianLayout:
1547 /* WRITERFILTERSTATUS: done: 50, planned: 0.5, spent: 0 */
1548 /* it seems that the value is following:
1549 ???? XX YYYY ZZ
1550 where
1551 XX seems to be the run id
1552 ZZ is the length of the function that is normally 6
1553 Lower byte of YYYY determines whether it is
1554 vertical text flow (0x01), or
1555 two lines in one layout (0x02).
1556 For 0x01, if the higher byte of YYYY is zero, the text is not scaled to fit the line height,
1557 in oposite case, it is to be scaled.
1558 For 0x02, the higher byte of YYYY is determinig the prefix and suffix of the run:
1559 no brackets (0x00) ,
1560 () round brackets (0x01),
1561 [] square backets (0x02),
1562 <> angle brackets (0x03) and
1563 {} curly brackets (0x04).
1564 ???? is different and we do not know its signification
1567 if ((nIntValue & 0x000000FF) == 6)
1569 switch ((nIntValue & 0x0000FF00) >> 8)
1571 case 1: // vertical text
1572 if (m_pImpl->GetTopContext())
1574 m_pImpl->GetTopContext()->Insert(PROP_CHAR_ROTATION, true, uno::makeAny ( sal_Int16(900) ));
1575 m_pImpl->GetTopContext()->Insert(PROP_CHAR_ROTATION_IS_FIT_TO_LINE, true, uno::makeAny (((nIntValue & 0x00FF0000) >> 16) != 0));
1577 break;
1578 case 2: // two lines in one
1579 if (m_pImpl->GetTopContext())
1581 m_pImpl->GetTopContext()->Insert(PROP_CHAR_COMBINE_IS_ON, true, uno::makeAny ( true ));
1582 m_pImpl->GetTopContext()->Insert(PROP_CHAR_COMBINE_PREFIX, true, uno::makeAny ( getBracketStringFromEnum((nIntValue & 0x00FF0000) >> 16)));
1583 m_pImpl->GetTopContext()->Insert(PROP_CHAR_COMBINE_SUFFIX, true, uno::makeAny ( getBracketStringFromEnum((nIntValue & 0x00FF0000) >> 16, false)));
1585 break;
1586 default:
1587 break;
1590 break;
1591 case NS_rtf::LN_FRD :
1592 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1593 //footnote reference descriptor, if nIntValue > 0 then automatic, custom otherwise
1594 //ignored
1595 break;
1596 case NS_rtf::LN_FONT: //font of footnote symbol
1597 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1598 if (m_pImpl->GetTopContext())
1599 m_pImpl->GetTopContext()->SetFootnoteFontId( nIntValue );
1600 break;
1601 case NS_ooxml::LN_CT_Sym_char:
1602 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1603 if( m_pImpl->GetTopContext() && m_pImpl->GetTopContext()->GetFootnote().is())
1605 m_pImpl->GetTopContext()->GetFootnote()->setLabel(::rtl::OUString( sal_Unicode(nIntValue)));
1606 break;
1608 else //it's a _real_ symbol
1610 utext( reinterpret_cast < const sal_uInt8 * >( &nIntValue ), 1 );
1612 break;
1613 case NS_rtf::LN_CHAR: //footnote symbol character
1614 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1615 if (m_pImpl->GetTopContext())
1616 m_pImpl->GetTopContext()->SetFootnoteSymbol( sal_Unicode(nIntValue));
1617 break;
1618 case NS_ooxml::LN_CT_Sym_font:
1619 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1620 //the footnote symbol and font are provided after the footnote is already inserted
1621 if( m_pImpl->GetTopContext() && m_pImpl->GetTopContext()->GetFootnote().is())
1623 uno::Reference< beans::XPropertySet > xAnchorProps( m_pImpl->GetTopContext()->GetFootnote()->getAnchor(), uno::UNO_QUERY );
1624 xAnchorProps->setPropertyValue(
1625 PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_CHAR_FONT_NAME),
1626 uno::makeAny( sStringValue ));
1628 else //a real symbol
1629 if (m_pImpl->GetTopContext())
1630 m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME, true, uno::makeAny( sStringValue ));
1631 break;
1632 case NS_ooxml::LN_CT_Underline_val:
1633 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1634 handleUnderlineType(nIntValue, m_pImpl->GetTopContext());
1635 break;
1636 case NS_ooxml::LN_CT_Color_val:
1637 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1638 if (m_pImpl->GetTopContext())
1639 m_pImpl->GetTopContext()->Insert(PROP_CHAR_COLOR, true, uno::makeAny( nIntValue ) );
1640 break;
1641 case NS_ooxml::LN_CT_Underline_color:
1642 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1643 if (m_pImpl->GetTopContext())
1645 m_pImpl->GetTopContext()->Insert(PROP_CHAR_UNDERLINE_HAS_COLOR, true, uno::makeAny( true ) );
1646 m_pImpl->GetTopContext()->Insert(PROP_CHAR_UNDERLINE_COLOR, true, uno::makeAny( nIntValue ) );
1648 break;
1650 case NS_ooxml::LN_CT_TabStop_val:
1651 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1652 if (sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_ST_TabJc_clear)
1653 m_pImpl->m_aCurrentTabStop.bDeleted = true;
1654 else
1656 m_pImpl->m_aCurrentTabStop.bDeleted = false;
1657 m_pImpl->m_aCurrentTabStop.Alignment = getTabAlignFromValue(nIntValue);
1659 break;
1660 case NS_ooxml::LN_CT_TabStop_leader:
1661 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1662 m_pImpl->m_aCurrentTabStop.FillChar = getFillCharFromValue(nIntValue);
1663 break;
1664 case NS_ooxml::LN_CT_TabStop_pos:
1665 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1666 m_pImpl->m_aCurrentTabStop.Position = ConversionHelper::convertTwipToMM100(nIntValue);
1667 break;
1669 case NS_ooxml::LN_CT_Fonts_ascii:
1670 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1671 if (m_pImpl->GetTopContext())
1672 m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME, true, uno::makeAny( sStringValue ));
1673 break;
1674 case NS_ooxml::LN_CT_Fonts_asciiTheme:
1675 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1676 if (m_pImpl->GetTopContext())
1677 m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME, true, uno::makeAny( m_pImpl->GetThemeTable()->getFontNameForTheme(nIntValue) ));
1678 break;
1679 case NS_ooxml::LN_CT_Fonts_hAnsi:
1680 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1681 break;//unsupported
1682 case NS_ooxml::LN_CT_Fonts_hAnsiTheme:
1683 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1684 break; //unsupported
1685 case NS_ooxml::LN_CT_Fonts_eastAsia:
1686 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1687 if (m_pImpl->GetTopContext())
1688 m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME_ASIAN, true, uno::makeAny( sStringValue ));
1689 break;
1690 case NS_ooxml::LN_CT_Fonts_eastAsiaTheme:
1691 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1692 if (m_pImpl->GetTopContext())
1693 m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME_COMPLEX, true, uno::makeAny( m_pImpl->GetThemeTable()->getFontNameForTheme(nIntValue) ) );
1694 break;
1695 case NS_ooxml::LN_CT_Fonts_cs:
1696 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1697 if (m_pImpl->GetTopContext())
1698 m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME_COMPLEX, true, uno::makeAny( sStringValue ));
1699 break;
1700 case NS_ooxml::LN_CT_Fonts_cstheme:
1701 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1702 if (m_pImpl->GetTopContext())
1703 m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME_COMPLEX, true, uno::makeAny( m_pImpl->GetThemeTable()->getFontNameForTheme(nIntValue) ));
1704 break;
1705 case NS_ooxml::LN_CT_Spacing_before:
1706 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1707 if (m_pImpl->GetTopContext())
1708 m_pImpl->GetTopContext()->Insert(PROP_PARA_TOP_MARGIN, true, uno::makeAny( ConversionHelper::convertTwipToMM100( nIntValue ) ));
1709 break;
1710 case NS_ooxml::LN_CT_Spacing_beforeLines:
1711 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1712 break;
1713 case NS_ooxml::LN_CT_Spacing_after:
1714 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1715 if (m_pImpl->GetTopContext())
1716 m_pImpl->GetTopContext()->Insert(PROP_PARA_BOTTOM_MARGIN, true, uno::makeAny( ConversionHelper::convertTwipToMM100( nIntValue ) ));
1717 break;
1718 case NS_ooxml::LN_CT_Spacing_afterLines:
1719 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1720 break;
1721 case NS_ooxml::LN_CT_Spacing_line: //91434
1722 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1723 case NS_ooxml::LN_CT_Spacing_lineRule: //91435
1724 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1726 #define SINGLE_LINE_SPACING 240
1727 style::LineSpacing aSpacing;
1728 PropertyMapPtr pTopContext = m_pImpl->GetTopContext();
1729 PropertyMap::iterator aLineSpacingIter = pTopContext->find(PropertyDefinition( PROP_PARA_LINE_SPACING, true ) );
1730 if( aLineSpacingIter != pTopContext->end())
1732 aLineSpacingIter->second >>= aSpacing;
1734 else
1736 //default to single line spacing
1737 aSpacing.Mode = style::LineSpacingMode::FIX;
1738 aSpacing.Height = sal_Int16(ConversionHelper::convertTwipToMM100( SINGLE_LINE_SPACING ));
1740 if( nName == NS_ooxml::LN_CT_Spacing_line )
1742 //now set the value depending on the Mode
1743 if( aSpacing.Mode == style::LineSpacingMode::PROP )
1744 aSpacing.Height = sal_Int16(sal_Int32(nIntValue) * 100 / SINGLE_LINE_SPACING );
1745 else
1746 aSpacing.Height = sal_Int16(ConversionHelper::convertTwipToMM100( nIntValue ));
1748 else //NS_ooxml::LN_CT_Spacing_lineRule:
1750 // exactly, atLeast, auto
1751 if( sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_wordprocessingml_ST_LineSpacingRule_auto)
1753 aSpacing.Mode = style::LineSpacingMode::PROP;
1754 //reinterpret the already set value
1755 aSpacing.Height = sal_Int16( aSpacing.Height * 100 / ConversionHelper::convertTwipToMM100( SINGLE_LINE_SPACING ));
1757 else if( sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_wordprocessingml_ST_LineSpacingRule_atLeast)
1758 aSpacing.Mode = style::LineSpacingMode::MINIMUM;
1759 else // NS_ooxml::LN_Value_wordprocessingml_ST_LineSpacingRule_exact
1760 aSpacing.Mode = style::LineSpacingMode::FIX;
1762 pTopContext->Insert(PROP_PARA_LINE_SPACING, true, uno::makeAny( aSpacing ));
1764 break;
1765 case NS_ooxml::LN_CT_Ind_left:
1766 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1767 if (m_pImpl->GetTopContext())
1768 m_pImpl->GetTopContext()->Insert(
1769 PROP_PARA_LEFT_MARGIN, true, uno::makeAny( ConversionHelper::convertTwipToMM100(nIntValue ) ));
1770 break;
1771 case NS_ooxml::LN_CT_Ind_right:
1772 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1773 if (m_pImpl->GetTopContext())
1774 m_pImpl->GetTopContext()->Insert(
1775 PROP_PARA_RIGHT_MARGIN, true, uno::makeAny( ConversionHelper::convertTwipToMM100(nIntValue ) ));
1776 break;
1777 case NS_ooxml::LN_CT_Ind_hanging:
1778 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1779 if (m_pImpl->GetTopContext())
1780 m_pImpl->GetTopContext()->Insert(
1781 PROP_PARA_FIRST_LINE_INDENT, true, uno::makeAny( - ConversionHelper::convertTwipToMM100(nIntValue ) ));
1782 break;
1783 case NS_ooxml::LN_CT_Ind_firstLine:
1784 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1785 if (m_pImpl->GetTopContext())
1786 m_pImpl->GetTopContext()->Insert(
1787 PROP_PARA_FIRST_LINE_INDENT, true, uno::makeAny( ConversionHelper::convertTwipToMM100(nIntValue ) ));
1788 break;
1790 case NS_ooxml::LN_CT_EastAsianLayout_id:
1791 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1792 break;
1793 case NS_ooxml::LN_CT_EastAsianLayout_combine:
1794 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1795 if (m_pImpl->GetTopContext())
1796 m_pImpl->GetTopContext()->Insert(PROP_CHAR_COMBINE_IS_ON, true, uno::makeAny ( nIntValue ? true : false ));
1797 break;
1798 case NS_ooxml::LN_CT_EastAsianLayout_combineBrackets:
1799 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1800 if (m_pImpl->GetTopContext())
1802 rtl::OUString sCombinePrefix = getBracketStringFromEnum(nIntValue);
1803 rtl::OUString sCombineSuffix = getBracketStringFromEnum(nIntValue, false);
1804 m_pImpl->GetTopContext()->Insert(PROP_CHAR_COMBINE_PREFIX, true, uno::makeAny ( sCombinePrefix ));
1805 m_pImpl->GetTopContext()->Insert(PROP_CHAR_COMBINE_SUFFIX, true, uno::makeAny ( sCombineSuffix ));
1807 break;
1808 case NS_ooxml::LN_CT_EastAsianLayout_vert:
1809 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1810 if (m_pImpl->GetTopContext())
1812 sal_Int16 nRotationAngle = (nIntValue ? 900 : 0);
1813 m_pImpl->GetTopContext()->Insert(PROP_CHAR_ROTATION, true, uno::makeAny ( nRotationAngle ));
1815 break;
1816 case NS_ooxml::LN_CT_EastAsianLayout_vertCompress:
1817 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1818 if (m_pImpl->GetTopContext())
1819 m_pImpl->GetTopContext()->Insert(PROP_CHAR_ROTATION_IS_FIT_TO_LINE, true, uno::makeAny ( nIntValue ? true : false));
1820 break;
1822 case NS_ooxml::LN_CT_PageSz_code:
1823 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1824 CT_PageSz.code = nIntValue;
1825 break;
1826 case NS_ooxml::LN_CT_PageSz_h:
1827 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1829 sal_Int32 nHeight = ConversionHelper::SnapPageDimension(nIntValue);
1830 CT_PageSz.h = ConversionHelper::convertTwipToMM100(nHeight);
1832 break;
1833 case NS_ooxml::LN_CT_PageSz_orient:
1834 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1835 CT_PageSz.orient = (nIntValue != 0);
1836 break;
1837 case NS_ooxml::LN_CT_PageSz_w:
1838 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1840 sal_Int32 nWidth = ConversionHelper::SnapPageDimension(nIntValue);
1841 CT_PageSz.w = ConversionHelper::convertTwipToMM100(nWidth);
1843 break;
1845 case NS_ooxml::LN_CT_PageMar_top:
1846 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1847 m_pImpl->SetPageMarginTwip( PAGE_MAR_TOP, nIntValue );
1848 break;
1849 case NS_ooxml::LN_CT_PageMar_right:
1850 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1851 m_pImpl->SetPageMarginTwip( PAGE_MAR_RIGHT, nIntValue );
1852 break;
1853 case NS_ooxml::LN_CT_PageMar_bottom:
1854 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1855 m_pImpl->SetPageMarginTwip( PAGE_MAR_BOTTOM, nIntValue );
1856 break;
1857 case NS_ooxml::LN_CT_PageMar_left:
1858 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1859 m_pImpl->SetPageMarginTwip( PAGE_MAR_LEFT, nIntValue );
1860 break;
1861 case NS_ooxml::LN_CT_PageMar_header:
1862 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1863 m_pImpl->SetPageMarginTwip( PAGE_MAR_HEADER, nIntValue );
1864 break;
1865 case NS_ooxml::LN_CT_PageMar_footer:
1866 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1867 m_pImpl->SetPageMarginTwip( PAGE_MAR_FOOTER, nIntValue );
1868 break;
1869 case NS_ooxml::LN_CT_PageMar_gutter:
1870 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1871 m_pImpl->SetPageMarginTwip( PAGE_MAR_GUTTER, nIntValue );
1872 break;
1873 case NS_ooxml::LN_CT_Language_val: //90314
1874 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1875 case NS_ooxml::LN_CT_Language_eastAsia: //90315
1876 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1877 case NS_ooxml::LN_CT_Language_bidi: //90316
1878 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1880 LanguageType eLang = MsLangId::convertIsoStringToLanguage( sStringValue );
1881 lang::Locale aLocale = MsLangId::convertLanguageToLocale( eLang );
1882 if (m_pImpl->GetTopContext())
1883 m_pImpl->GetTopContext()->Insert(NS_ooxml::LN_CT_Language_val== nName ? PROP_CHAR_LOCALE :
1884 NS_ooxml::LN_CT_Language_eastAsia == nName ? PROP_CHAR_LOCALE_ASIAN : PROP_CHAR_LOCALE_COMPLEX,
1885 true,
1886 uno::makeAny( aLocale ) );
1888 break;
1889 #define AUTO_PARA_SPACING sal_Int32(49)
1890 case NS_ooxml::LN_CT_Spacing_beforeAutospacing:
1891 /* WRITERFILTERSTATUS: done: 80, planned: 0.5, spent: 0.2 */
1892 //TODO: autospacing depends on some document property (called fDontUseHTMLAutoSpacing in old ww8 filter) 100 or 280 twip
1893 //and should be set to 0 on start of page
1894 m_pImpl->GetTopContext()->Insert( PROP_PARA_TOP_MARGIN, false, uno::makeAny( AUTO_PARA_SPACING ) );
1895 break;
1896 case NS_ooxml::LN_CT_Spacing_afterAutospacing:
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 m_pImpl->GetTopContext()->Insert( PROP_PARA_BOTTOM_MARGIN, false, uno::makeAny( AUTO_PARA_SPACING ) );
1900 break;
1901 case NS_ooxml::LN_CT_SmartTagRun_uri:
1902 case NS_ooxml::LN_CT_SmartTagRun_element:
1903 /* WRITERFILTERSTATUS: done: 0, planned: 1, spent: 0 */
1904 //TODO: add handling of SmartTags
1905 break;
1906 case NS_ooxml::LN_CT_Br_type :
1907 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1908 //TODO: attributes for break (0x12) are not supported
1909 break;
1910 case NS_ooxml::LN_CT_Fonts_hint :
1911 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */
1912 /* assigns script type to ambigous characters, values can be:
1913 NS_ooxml::LN_Value_ST_Hint_default
1914 NS_ooxml::LN_Value_ST_Hint_eastAsia
1915 NS_ooxml::LN_Value_ST_Hint_cs
1917 //TODO: unsupported?
1918 break;
1919 case NS_ooxml::LN_CT_TblCellMar_right: // 92375;
1920 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1921 case NS_ooxml::LN_CT_TblBorders_top: // 92377;
1922 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1923 case NS_ooxml::LN_CT_TblBorders_left: // 92378;
1924 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1925 case NS_ooxml::LN_CT_TblBorders_bottom: // 92379;
1926 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
1927 //todo: handle cell mar
1928 break;
1929 case NS_rtf::LN_blip: // contains the binary graphic
1930 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1931 case NS_ooxml::LN_shape:
1932 /* WRITERFILTERSTATUS: done: 50, planned: 0.5, spent: 0 */
1934 //looks a bit like a hack - and it is. The graphic import is split into the inline_inline part and
1935 //afterwards the adding of the binary data.
1936 m_pImpl->GetGraphicImport( IMPORT_AS_DETECTED_INLINE )->attribute(nName, val);
1937 m_pImpl->ImportGraphic( val.getProperties(), IMPORT_AS_DETECTED_INLINE );
1939 break;
1940 case NS_ooxml::LN_CT_FramePr_dropCap:
1941 case NS_ooxml::LN_CT_FramePr_lines:
1942 case NS_ooxml::LN_CT_FramePr_hAnchor:
1943 case NS_ooxml::LN_CT_FramePr_vAnchor:
1944 case NS_ooxml::LN_CT_FramePr_x:
1945 case NS_ooxml::LN_CT_FramePr_xAlign:
1946 case NS_ooxml::LN_CT_FramePr_y:
1947 case NS_ooxml::LN_CT_FramePr_yAlign:
1948 case NS_ooxml::LN_CT_FramePr_hRule:
1949 case NS_sprm::LN_PWr:
1950 case NS_sprm::LN_PDxaWidth:
1951 case NS_sprm::LN_PWHeightAbs:
1952 case NS_sprm::LN_PDxaFromText:
1953 case NS_sprm::LN_PDyaFromText:
1955 ParagraphProperties* pParaProperties = dynamic_cast< ParagraphProperties*>(m_pImpl->GetTopContext().get());
1956 if( pParaProperties )
1958 switch( nName )
1960 case NS_ooxml::LN_CT_FramePr_dropCap:
1961 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1962 pParaProperties->SetDropCap( nIntValue );
1963 break;
1964 case NS_ooxml::LN_CT_FramePr_lines:
1965 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1966 pParaProperties->SetLines( nIntValue );
1967 break;
1968 case NS_ooxml::LN_CT_FramePr_hAnchor:
1969 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1970 switch(nIntValue)
1972 case NS_ooxml::LN_Value_wordprocessingml_ST_HAnchor_text: //relative to column
1973 nIntValue = text::RelOrientation::FRAME; break;
1974 case NS_ooxml::LN_Value_wordprocessingml_ST_HAnchor_margin: nIntValue = text::RelOrientation::PAGE_PRINT_AREA; break;
1975 case NS_ooxml::LN_Value_wordprocessingml_ST_HAnchor_page: nIntValue = text::RelOrientation::PAGE_FRAME; break;
1976 default:;
1978 pParaProperties->SethAnchor( nIntValue );
1979 break;
1980 case NS_ooxml::LN_CT_FramePr_vAnchor:
1981 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1982 switch(nIntValue)
1984 case NS_ooxml::LN_Value_wordprocessingml_ST_VAnchor_text: //relative to paragraph
1985 nIntValue = text::RelOrientation::FRAME; break;
1986 case NS_ooxml::LN_Value_wordprocessingml_ST_VAnchor_margin:nIntValue = text::RelOrientation::PAGE_PRINT_AREA ; break;
1987 case NS_ooxml::LN_Value_wordprocessingml_ST_VAnchor_page: nIntValue = text::RelOrientation::PAGE_FRAME; break;
1988 default:;
1990 pParaProperties->SetvAnchor( nIntValue );
1991 break;
1992 case NS_ooxml::LN_CT_FramePr_x:
1993 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1994 pParaProperties->Setx( ConversionHelper::convertTwipToMM100(nIntValue ));
1995 break;
1996 case NS_ooxml::LN_CT_FramePr_xAlign:
1997 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
1998 switch( nIntValue )
2000 case NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_center : nIntValue = text::HoriOrientation::CENTER; break;
2001 case NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_right : nIntValue = text::HoriOrientation::RIGHT; break;
2002 case NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_inside : nIntValue = text::HoriOrientation::INSIDE; break;
2003 case NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_outside : nIntValue = text::HoriOrientation::OUTSIDE; break;
2004 case NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_left : nIntValue = text::HoriOrientation::LEFT; break;
2005 default: nIntValue = text::HoriOrientation::NONE;
2007 pParaProperties->SetxAlign( nIntValue );
2008 break;
2009 case NS_ooxml::LN_CT_FramePr_y:
2010 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2011 pParaProperties->Sety( ConversionHelper::convertTwipToMM100(nIntValue ));
2012 break;
2013 case NS_ooxml::LN_CT_FramePr_yAlign:
2014 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2015 switch( nIntValue )
2017 case NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_top :
2018 case NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_inside :nIntValue = text::VertOrientation::TOP; break;
2019 case NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_center :nIntValue = text::VertOrientation::CENTER;break;
2020 case NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_bottom :
2021 case NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_outside :nIntValue = text::VertOrientation::BOTTOM;break;
2022 case NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_inline ://todo: what to do with inline - no avail. in WW97 and WW2007
2023 //no break;
2024 default:nIntValue = text::VertOrientation::NONE;
2026 pParaProperties->SetyAlign( nIntValue );
2027 break;
2028 case NS_ooxml::LN_CT_FramePr_hRule:
2029 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2030 switch( nIntValue )
2032 case NS_ooxml::LN_Value_wordprocessingml_ST_HeightRule_exact:
2033 nIntValue = text::SizeType::FIX;
2034 break;
2035 case NS_ooxml::LN_Value_wordprocessingml_ST_HeightRule_atLeast:
2036 nIntValue = text::SizeType::MIN;
2037 break;
2038 case NS_ooxml::LN_Value_wordprocessingml_ST_HeightRule_auto:
2039 //no break;
2040 default:;
2041 nIntValue = text::SizeType::VARIABLE;
2043 pParaProperties->SethRule( nIntValue );
2044 break;
2045 case NS_sprm::LN_PWr:
2047 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2048 //should be either LN_Value_wordprocessingml_ST_Wrap_notBeside or LN_Value_wordprocessingml_ST_Wrap_around
2049 OSL_ENSURE( sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_wordprocessingml_ST_Wrap_around ||
2050 sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_wordprocessingml_ST_Wrap_notBeside,
2051 "wrap not around or not_Beside?");
2052 pParaProperties->SetWrap(sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_wordprocessingml_ST_Wrap_around ?
2053 text::WrapTextMode_DYNAMIC : text::WrapTextMode_NONE );
2055 break;
2056 case NS_sprm::LN_PDxaWidth:
2057 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2058 pParaProperties->Setw(ConversionHelper::convertTwipToMM100(nIntValue));
2059 break;
2060 case NS_sprm::LN_PWHeightAbs:
2061 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2062 pParaProperties->Seth(ConversionHelper::convertTwipToMM100(nIntValue));
2063 break;
2064 case NS_sprm::LN_PDxaFromText:
2065 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
2066 pParaProperties->SethSpace( ConversionHelper::convertTwipToMM100(nIntValue ));
2067 break;
2068 case NS_sprm::LN_PDyaFromText:
2069 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
2070 pParaProperties->SetvSpace( ConversionHelper::convertTwipToMM100(nIntValue ));
2071 break;
2072 default:;
2075 else
2077 //TODO: how to handle frame properties at styles
2080 break;
2081 case NS_ooxml::LN_CT_LineNumber_start:
2082 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
2083 case NS_ooxml::LN_CT_LineNumber_distance:
2084 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
2085 case NS_ooxml::LN_CT_TrackChange_author:
2086 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2087 m_pImpl->SetCurrentRedlineAuthor( sStringValue );
2088 break;
2089 case NS_ooxml::LN_CT_TrackChange_date:
2090 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2091 m_pImpl->SetCurrentRedlineDate( sStringValue );
2092 break;
2093 case NS_ooxml::LN_CT_Markup_id:
2094 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2095 m_pImpl->SetCurrentRedlineId( nIntValue );
2096 break;
2097 case NS_ooxml::LN_token:
2098 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2099 m_pImpl->SetCurrentRedlineToken( nIntValue );
2100 break;
2101 case NS_ooxml::LN_CT_LineNumber_countBy:
2102 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
2103 case NS_ooxml::LN_CT_LineNumber_restart:
2104 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
2106 //line numbering in Writer is a global document setting
2107 //in Word is a section setting
2108 //if line numbering is switched on anywhere in the document it's set at the global settings
2109 LineNumberSettings aSettings = m_pImpl->GetLineNumberSettings();
2110 switch( nName )
2112 case NS_ooxml::LN_CT_LineNumber_countBy:
2113 aSettings.nInterval = nIntValue;
2114 break;
2115 case NS_ooxml::LN_CT_LineNumber_start:
2116 aSettings.nStartValue = nIntValue; // todo: has to be set at (each) first paragraph
2117 break;
2118 case NS_ooxml::LN_CT_LineNumber_distance:
2119 aSettings.nDistance = ConversionHelper::convertTwipToMM100( nIntValue );
2120 break;
2121 case NS_ooxml::LN_CT_LineNumber_restart:
2122 //page:empty, probably 0,section:1,continuous:2;
2123 aSettings.bRestartAtEachPage = nIntValue < 1;
2124 break;
2125 default:;
2127 m_pImpl->SetLineNumberSettings( aSettings );
2129 break;
2130 case NS_ooxml::LN_CT_FtnEdnRef_customMarkFollows:
2131 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2132 m_pImpl->SetCustomFtnMark( true );
2133 break;
2134 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
2135 case NS_ooxml::LN_CT_FtnEdnRef_id:
2136 // footnote or endnote reference id - not needed
2137 case NS_ooxml::LN_CT_Color_themeColor:
2138 case NS_ooxml::LN_CT_Color_themeTint:
2139 case NS_ooxml::LN_CT_Color_themeShade:
2140 //unsupported
2141 break;
2142 case NS_ooxml::LN_endtrackchange:
2143 m_pImpl->RemoveCurrentRedline( );
2144 break;
2145 default:
2147 #if OSL_DEBUG_LEVEL > 0
2148 ::rtl::OString sMessage( "DomainMapper::attribute() - Id: ");
2149 sMessage += ::rtl::OString::valueOf( sal_Int32( nName ), 10 );
2150 sMessage += ::rtl::OString(" / 0x");
2151 sMessage += ::rtl::OString::valueOf( sal_Int32( nName ), 16 );
2152 // sMessage += ::rtl::OString(" / ");
2153 // sMessage += ::rtl::OString
2154 // ((*QNameToString::Instance())(nName).c_str());
2155 sMessage += ::rtl::OString(" value: ");
2156 sMessage += ::rtl::OString::valueOf( sal_Int32( nIntValue ), 10 );
2157 sMessage += ::rtl::OString(" / 0x");
2158 sMessage += ::rtl::OString::valueOf( sal_Int32( nIntValue ), 16 );
2159 OSL_ENSURE( false, sMessage.getStr()); //
2160 #endif
2164 #ifdef DEBUG_DOMAINMAPPER
2165 dmapper_logger->endElement("attribute");
2166 #endif
2168 /*-- 09.06.2006 09:52:12---------------------------------------------------
2170 -----------------------------------------------------------------------*/
2171 void DomainMapper::sprm(Sprm & rSprm)
2173 if( !m_pImpl->getTableManager().sprm(rSprm))
2174 DomainMapper::sprm( rSprm, m_pImpl->GetTopContext() );
2176 /*-- 20.06.2006 09:58:33---------------------------------------------------
2178 -----------------------------------------------------------------------*/
2179 void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmType )
2181 #ifdef DEBUG_DOMAINMAPPER
2182 dmapper_logger->startElement("sprm");
2183 dmapper_logger->chars(rSprm.toString());
2184 #endif
2185 OSL_ENSURE(rContext.get(), "PropertyMap has to be valid!");
2186 if(!rContext.get())
2187 return ;
2189 sal_uInt32 nSprmId = rSprm.getId();
2190 //needed for page properties
2191 SectionPropertyMap* pSectionContext = 0;
2192 //the section context is not availabe before the first call of startSectionGroup()
2193 if( !m_pImpl->IsAnyTableImport() )
2195 PropertyMapPtr pContext = m_pImpl->GetTopContextOfType(CONTEXT_SECTION);
2196 OSL_ENSURE(pContext.get(), "Section context is not in the stack!");
2197 pSectionContext = dynamic_cast< SectionPropertyMap* >( pContext.get() );
2200 //TODO: In rtl-paragraphs the meaning of left/right are to be exchanged
2201 bool bExchangeLeftRight = false;
2202 // if( nSprmId == NS_sprm::LN_PJcExtra && AlreadyInRTLPara() )
2203 // bExchangeLeftRight = true;
2204 Value::Pointer_t pValue = rSprm.getValue();
2205 sal_Int32 nIntValue = pValue->getInt();
2206 rtl::OUString sStringValue = pValue->getString();
2207 // printf ( "DomainMapper::sprm(0x%.4x, 0x%.4x) [%s]\n", (unsigned int)nSprmId, (unsigned int)nIntValue, ::rtl::OUStringToOString(sStringValue, RTL_TEXTENCODING_DONTKNOW).getStr());
2208 /* WRITERFILTERSTATUS: table: sprmdata */
2210 switch(nSprmId)
2212 case 2: // sprmPIstd
2213 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2214 case 0x4600:
2215 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2216 break; // sprmPIstd - style code
2217 case 3: // "sprmPIstdPermute
2218 case NS_sprm::LN_PIstdPermute:
2219 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2220 break; // sprmPIstdPermute
2221 case NS_sprm::LN_PIncLvl:
2222 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2223 break; // sprmPIncLvl
2224 case NS_sprm::LN_PJcExtra: // sprmPJc Asian (undocumented)
2225 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
2226 case NS_sprm::LN_PJc: // sprmPJc
2227 handleParaJustification(nIntValue, rContext, bExchangeLeftRight);
2228 break;
2229 case NS_sprm::LN_PFSideBySide:
2230 /* WRITERFILTERSTATUS: done: 0, planned: 3, spent: 0 */
2231 /* WRITERFILTERSTATUS: comment: */
2232 break; // sprmPFSideBySide
2234 case NS_sprm::LN_PFKeep: // sprmPFKeep
2235 /* WRITERFILTERSTATUS: done: 0, planned: 3, spent: 0 */
2236 /* WRITERFILTERSTATUS: comment: */
2237 break;
2238 case NS_sprm::LN_PFKeepFollow: // sprmPFKeepFollow
2239 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 1 */
2240 /* WRITERFILTERSTATUS: comment: */
2241 rContext->Insert(PROP_PARA_KEEP_TOGETHER, true, uno::makeAny( nIntValue ? true : false) );
2242 break;
2243 case NS_sprm::LN_PFPageBreakBefore:
2244 /* WRITERFILTERSTATUS: done: 100, planned: 3, spent: 0 */
2245 /* WRITERFILTERSTATUS: comment: */
2246 rContext->Insert(PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_PAGE_BEFORE ) );
2247 break; // sprmPFPageBreakBefore
2248 case NS_sprm::LN_PBrcl:
2249 break; // sprmPBrcl
2250 case NS_sprm::LN_PBrcp:
2251 break; // sprmPBrcp
2252 case NS_sprm::LN_PIlvl: // sprmPIlvl
2253 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 1 */
2254 /* WRITERFILTERSTATUS: comment: */
2255 //todo: Numbering level will be implemented in the near future (OOo 3.0?)
2256 if( m_pImpl->IsStyleSheetImport() )
2258 //style sheets cannot have a numbering rule attached
2259 StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() );
2260 pStyleSheetPropertyMap->SetListLevel( (sal_Int16)nIntValue );
2262 else
2263 rContext->Insert( PROP_NUMBERING_LEVEL, true, uno::makeAny( (sal_Int16)nIntValue ));
2264 break;
2265 case NS_sprm::LN_PIlfo: // sprmPIlfo
2266 /* WRITERFILTERSTATUS: done: 50, planned: 0, spent: 1 */
2267 /* WRITERFILTERSTATUS: comment: */
2269 //convert the ListTable entry to a NumberingRules propery and apply it
2270 sal_Int32 nListId = m_pImpl->GetLFOTable()->GetListID( nIntValue );
2271 if(nListId >= 0)
2273 ListTablePtr pListTable = m_pImpl->GetListTable();
2274 if( m_pImpl->IsStyleSheetImport() )
2276 //style sheets cannot have a numbering rule attached
2277 StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() );
2278 pStyleSheetPropertyMap->SetListId( nListId );
2280 else
2281 rContext->Insert( PROP_NUMBERING_RULES, true,
2282 uno::makeAny(pListTable->GetNumberingRules(nListId)));
2283 //TODO: Merge overwrittern numbering levels from LFO table
2286 break;
2287 case NS_sprm::LN_PFNoLineNumb: // sprmPFNoLineNumb
2288 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 1 */
2289 /* WRITERFILTERSTATUS: comment: */
2290 rContext->Insert(PROP_PARA_LINE_NUMBER_COUNT, true, uno::makeAny( nIntValue ? false : true) );
2291 break;
2292 case NS_sprm::LN_PChgTabsPapx: // sprmPChgTabsPapx
2293 /* WRITERFILTERSTATUS: done: 90, planned: 8, spent: 8 */
2294 /* WRITERFILTERSTATUS: comment: bar tab stops a unavailable */
2296 // Initialize tab stop vector from style sheet
2297 uno::Any aValue = m_pImpl->GetPropertyFromStyleSheet(PROP_PARA_TAB_STOPS);
2298 uno::Sequence< style::TabStop > aStyleTabStops;
2299 if(aValue >>= aStyleTabStops)
2301 m_pImpl->InitTabStopFromStyle( aStyleTabStops );
2304 //create a new tab stop property - this is done with the contained properties
2305 resolveSprmProps(rSprm);
2306 //add this property
2307 rContext->Insert(PROP_PARA_TAB_STOPS, true, uno::makeAny( m_pImpl->GetCurrentTabStopAndClear()));
2309 break;
2310 case 0x845d: //right margin Asian - undocumented
2311 case 0x845e: //left margin Asian - undocumented
2312 case 16: // sprmPDxaRight - right margin
2313 case NS_sprm::LN_PDxaRight: // sprmPDxaRight - right margin
2314 case 17:
2315 case NS_sprm::LN_PDxaLeft: // sprmPDxaLeft
2316 /* WRITERFILTERSTATUS: done: 50, planned: 5, spent: 1 */
2317 if( NS_sprm::LN_PDxaLeft == nSprmId || 0x17 == nSprmId|| (bExchangeLeftRight && nSprmId == 0x845d) || ( !bExchangeLeftRight && nSprmId == 0x845e))
2318 rContext->Insert(
2319 eSprmType == SPRM_DEFAULT ? PROP_PARA_LEFT_MARGIN : PROP_LEFT_MARGIN,
2320 true,
2321 uno::makeAny( ConversionHelper::convertTwipToMM100( nIntValue ) ));
2322 else if(eSprmType == SPRM_DEFAULT)
2323 rContext->Insert(
2324 PROP_PARA_RIGHT_MARGIN, true,
2325 uno::makeAny( ConversionHelper::convertTwipToMM100(nIntValue ) ));
2326 //TODO: what happens to the right margins in numberings?
2327 break;
2328 case 18: // sprmPNest
2329 case NS_sprm::LN_PNest: // sprmPNest
2330 //not handled in the old WW8 filter
2331 break;
2332 case 0x8460: //first line indent Asian - undocumented
2333 case 19:
2334 case NS_sprm::LN_PDxaLeft1: // sprmPDxaLeft1
2335 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 1 */
2336 rContext->Insert(
2337 eSprmType == SPRM_DEFAULT ? PROP_PARA_FIRST_LINE_INDENT : PROP_FIRST_LINE_OFFSET,
2338 true,
2339 uno::makeAny( ConversionHelper::convertTwipToMM100(nIntValue ) ));
2340 break;
2341 case 20 : // sprmPDyaLine
2342 case NS_sprm::LN_PDyaLine: // sprmPDyaLine
2343 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 1 */
2345 style::LineSpacing aSpacing;
2346 sal_Int16 nDistance = sal_Int16(nIntValue & 0xffff);
2347 if(nIntValue & 0xffff0000)
2349 // single line in Writer is 100, in Word it is 240
2350 aSpacing.Mode = style::LineSpacingMode::PROP;
2351 aSpacing.Height = sal_Int16(sal_Int32(nDistance) * 100 /240);
2353 else
2355 if(nDistance < 0)
2357 aSpacing.Mode = style::LineSpacingMode::FIX;
2358 aSpacing.Height = sal_Int16(ConversionHelper::convertTwipToMM100(-nDistance));
2360 else if(nDistance >0)
2362 aSpacing.Mode = style::LineSpacingMode::MINIMUM;
2363 aSpacing.Height = sal_Int16(ConversionHelper::convertTwipToMM100(nDistance));
2366 rContext->Insert(PROP_PARA_LINE_SPACING, true, uno::makeAny( aSpacing ));
2368 break;
2369 case 21 : // legacy version
2370 case NS_sprm::LN_PDyaBefore: // sprmPDyaBefore
2371 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 1 */
2372 rContext->Insert(PROP_PARA_TOP_MARGIN, true, uno::makeAny( ConversionHelper::convertTwipToMM100( nIntValue ) ));
2373 break;
2374 case 22 :
2375 case NS_sprm::LN_PDyaAfter: // sprmPDyaAfter
2376 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 1 */
2377 rContext->Insert(PROP_PARA_BOTTOM_MARGIN, true, uno::makeAny( ConversionHelper::convertTwipToMM100( nIntValue ) ));
2378 break;
2380 case 23: //sprmPChgTabs
2381 case NS_sprm::LN_PChgTabs: // sprmPChgTabs
2382 /* WRITERFILTERSTATUS: done: 0, planned: 3, spent: 0 */
2383 OSL_ENSURE( false, "unhandled");
2384 //tabs of list level?
2385 break;
2386 case 24: // "sprmPFInTable"
2387 case NS_sprm::LN_PFInTable:
2388 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2389 break; // sprmPFInTable
2390 case NS_sprm::LN_PTableDepth: //sprmPTableDepth
2391 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
2392 //not handled via sprm but via text( 0x07 )
2393 break;
2394 case 25: // "sprmPTtp" pap.fTtp
2395 case NS_sprm::LN_PFTtp: // sprmPFTtp was: Read_TabRowEnd
2396 break;
2397 case 26: // "sprmPDxaAbs
2398 case NS_sprm::LN_PDxaAbs:
2399 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2400 break; // sprmPDxaAbs
2401 case 27: //sprmPDyaAbs
2402 case NS_sprm::LN_PDyaAbs:
2403 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2404 break; // sprmPDyaAbs
2405 case NS_sprm::LN_PDxaWidth:
2406 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2407 break; // sprmPDxaWidth
2408 case NS_sprm::LN_PPc:
2409 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2410 break; // sprmPPc
2411 case NS_sprm::LN_PBrcTop10:
2412 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2413 break; // sprmPBrcTop10
2414 case NS_sprm::LN_PBrcLeft10:
2415 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2416 break; // sprmPBrcLeft10
2417 case NS_sprm::LN_PBrcBottom10:
2418 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2419 break; // sprmPBrcBottom10
2420 case NS_sprm::LN_PBrcRight10:
2421 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2422 break; // sprmPBrcRight10
2423 case NS_sprm::LN_PBrcBetween10:
2424 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2425 break; // sprmPBrcBetween10
2426 case NS_sprm::LN_PBrcBar10:
2427 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2428 break; // sprmPBrcBar10
2429 case NS_sprm::LN_PDxaFromText10:
2430 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2431 break; // sprmPDxaFromText10
2432 case NS_sprm::LN_PWr:
2433 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2434 break; // sprmPWr
2436 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
2437 case NS_ooxml::LN_CT_PrBase_pBdr: //paragraph border
2438 resolveSprmProps(rSprm);
2439 break;
2440 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
2441 case NS_sprm::LN_PBrcTop: // sprmPBrcTop
2442 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
2443 /* WRITERFILTERSTATUS: comment: page borders are no handled yet, conversion incomplete */
2444 case NS_sprm::LN_PBrcLeft: // sprmPBrcLeft
2445 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
2446 /* WRITERFILTERSTATUS: comment: page borders are no handled yet, conversion incomplete */
2447 case NS_sprm::LN_PBrcBottom: // sprmPBrcBottom
2448 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
2449 /* WRITERFILTERSTATUS: comment: page borders are no handled yet, conversion incomplete */
2450 case NS_sprm::LN_PBrcRight: // sprmPBrcRight
2451 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
2452 /* WRITERFILTERSTATUS: comment: page borders are no handled yet, conversion incomplete */
2453 case NS_sprm::LN_PBrcBetween: // sprmPBrcBetween
2454 /* WRITERFILTERSTATUS: done: 0, planned: 8, spent: 0 */
2455 /* WRITERFILTERSTATUS: comment: */
2457 //in binary format the borders are directly provided in OOXML they are inside of properties
2458 if( IsOOXMLImport() )
2460 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
2461 if( pProperties.get())
2463 BorderHandlerPtr pBorderHandler( new BorderHandler( true ) );
2464 pProperties->resolve(*pBorderHandler);
2465 PropertyIds eBorderId = PropertyIds( 0 );
2466 PropertyIds eBorderDistId = PropertyIds( 0 );
2467 switch( nSprmId )
2469 case NS_sprm::LN_PBrcTop:
2470 eBorderId = PROP_TOP_BORDER;
2471 eBorderDistId = PROP_TOP_BORDER_DISTANCE;
2472 break;
2473 case NS_sprm::LN_PBrcLeft:
2474 eBorderId = PROP_LEFT_BORDER;
2475 eBorderDistId = PROP_LEFT_BORDER_DISTANCE;
2476 break;
2477 case NS_sprm::LN_PBrcBottom:
2478 eBorderId = PROP_BOTTOM_BORDER ;
2479 eBorderDistId = PROP_BOTTOM_BORDER_DISTANCE;
2480 break;
2481 case NS_sprm::LN_PBrcRight:
2482 eBorderId = PROP_RIGHT_BORDER;
2483 eBorderDistId = PROP_RIGHT_BORDER_DISTANCE ;
2484 break;
2485 case NS_sprm::LN_PBrcBetween:
2486 //not supported
2487 break;
2488 default:;
2490 if( eBorderId )
2491 rContext->Insert( eBorderId, true, uno::makeAny( pBorderHandler->getBorderLine()) , true);
2492 if(eBorderDistId)
2493 rContext->Insert(eBorderDistId, true, uno::makeAny( pBorderHandler->getLineDistance()), true);
2496 else
2498 table::BorderLine aBorderLine;
2499 sal_Int32 nLineDistance = ConversionHelper::MakeBorderLine( nIntValue, aBorderLine );
2500 PropertyIds eBorderId = PROP_LEFT_BORDER;
2501 PropertyIds eBorderDistId = PROP_LEFT_BORDER_DISTANCE ;
2502 switch( nSprmId )
2504 case NS_sprm::LN_PBrcBetween: // sprmPBrcBetween
2505 OSL_ENSURE( false, "TODO: inner border is not handled");
2506 break;
2507 case NS_sprm::LN_PBrcLeft: // sprmPBrcLeft
2508 eBorderId = PROP_LEFT_BORDER;
2509 eBorderDistId = PROP_LEFT_BORDER_DISTANCE ;
2510 break;
2511 case NS_sprm::LN_PBrcRight: // sprmPBrcRight
2512 eBorderId = PROP_RIGHT_BORDER ;
2513 eBorderDistId = PROP_RIGHT_BORDER_DISTANCE ;
2514 break;
2515 case NS_sprm::LN_PBrcTop: // sprmPBrcTop
2516 eBorderId = PROP_TOP_BORDER ;
2517 eBorderDistId = PROP_TOP_BORDER_DISTANCE;
2518 break;
2519 case NS_sprm::LN_PBrcBottom: // sprmPBrcBottom
2520 default:
2521 eBorderId = PROP_BOTTOM_BORDER ;
2522 eBorderDistId = PROP_BOTTOM_BORDER_DISTANCE;
2524 rContext->Insert(eBorderId, true, uno::makeAny( aBorderLine ));
2525 rContext->Insert(eBorderDistId, true, uno::makeAny( nLineDistance ));
2528 break;
2529 case NS_sprm::LN_PBorderTop:
2530 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2531 /* WRITERFILTERSTATUS: comment: probably _real_ border colors, unhandled */
2532 case NS_sprm::LN_PBorderLeft:
2533 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2534 /* WRITERFILTERSTATUS: comment: probably _real_ border colors, unhandled */
2535 case NS_sprm::LN_PBorderBottom:
2536 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2537 /* WRITERFILTERSTATUS: comment: probably _real_ border colors, unhandled */
2538 case NS_sprm::LN_PBorderRight:
2539 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2540 /* WRITERFILTERSTATUS: comment: probably _real_ border colors, unhandled */
2541 OSL_ENSURE( false, "TODO: border color definition");
2542 break;
2543 case NS_sprm::LN_PBrcBar:
2544 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2545 break; // sprmPBrcBar
2546 case NS_sprm::LN_PFNoAutoHyph: // sprmPFNoAutoHyph
2547 rContext->Insert(PROP_PARA_IS_HYPHENATION, true, uno::makeAny( nIntValue ? false : true ));
2548 break;
2549 case NS_sprm::LN_PWHeightAbs:
2550 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2551 break; // sprmPWHeightAbs
2552 case NS_sprm::LN_PDcs:
2553 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2554 break; // sprmPDcs
2556 case NS_sprm::LN_PShd: // sprmPShd
2558 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 2 */
2559 //contains fore color, back color and shadow percentage, results in a brush
2560 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
2561 if( pProperties.get())
2563 CellColorHandlerPtr pCellColorHandler( new CellColorHandler );
2564 pCellColorHandler->setParagraph();
2565 pProperties->resolve(*pCellColorHandler);
2566 rContext->insert( pCellColorHandler->getProperties(), true );
2569 break;
2570 case NS_sprm::LN_PDyaFromText:
2571 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2572 break; // sprmPDyaFromText
2573 case NS_sprm::LN_PDxaFromText:
2574 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2575 break; // sprmPDxaFromText
2576 case NS_sprm::LN_PFLocked:
2577 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2578 break; // sprmPFLocked
2579 case NS_sprm::LN_PFWidowControl:
2580 case NS_ooxml::LN_CT_PPrBase_widowControl:
2582 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2583 uno::Any aVal( uno::makeAny( sal_Int8(nIntValue ? 2 : 0 )));
2584 rContext->Insert( PROP_PARA_WIDOWS, true, aVal );
2585 rContext->Insert( PROP_PARA_ORPHANS, true, aVal );
2587 break; // sprmPFWidowControl
2588 case NS_sprm::LN_PRuler:
2589 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2590 break; // sprmPRuler
2591 case NS_sprm::LN_PFKinsoku:
2592 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2593 break; // sprmPFKinsoku
2594 case NS_sprm::LN_PFWordWrap:
2595 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2596 break; // sprmPFWordWrap
2597 case NS_sprm::LN_PFOverflowPunct: ; // sprmPFOverflowPunct - hanging punctuation
2598 rContext->Insert(PROP_PARA_IS_HANGING_PUNCTUATION, true, uno::makeAny( nIntValue ? false : true ));
2599 break;
2600 case NS_sprm::LN_PFTopLinePunct:
2601 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2602 break; // sprmPFTopLinePunct
2603 case NS_sprm::LN_PFAutoSpaceDE:
2604 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2605 break; // sprmPFAutoSpaceDE
2606 case NS_sprm::LN_PFAutoSpaceDN:
2607 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2608 break; // sprmPFAutoSpaceDN
2609 case NS_sprm::LN_PWAlignFont:
2610 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2611 break; // sprmPWAlignFont
2612 case NS_sprm::LN_PFrameTextFlow:
2613 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2614 break; // sprmPFrameTextFlow
2615 case NS_sprm::LN_PISnapBaseLine:
2616 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2617 break; // sprmPISnapBaseLine
2618 case NS_sprm::LN_PAnld:
2619 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2620 break; // sprmPAnld
2621 case NS_sprm::LN_PPropRMark:
2622 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2623 break; // sprmPPropRMark
2624 case NS_sprm::LN_POutLvl:
2625 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2627 if( m_pImpl->IsStyleSheetImport() )
2629 sal_Int16 nLvl = static_cast< sal_Int16 >( nIntValue );
2631 StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() );
2632 pStyleSheetPropertyMap->SetOutlineLevel( nLvl );
2635 break; // sprmPOutLvl
2636 case NS_sprm::LN_PFBiDi:
2637 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2638 break; // sprmPFBiDi
2639 case NS_sprm::LN_PFNumRMIns:
2640 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2641 break; // sprmPFNumRMIns
2642 case NS_sprm::LN_PCrLf:
2643 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2644 break; // sprmPCrLf
2645 case NS_sprm::LN_PNumRM:
2646 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2647 break; // sprmPNumRM
2648 case NS_sprm::LN_PHugePapx:
2649 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2650 break; // sprmPHugePapx
2651 case NS_sprm::LN_PFUsePgsuSettings:
2652 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2653 break; // sprmPFUsePgsuSettings
2654 case NS_sprm::LN_PFAdjustRight:
2655 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2656 break; // sprmPFAdjustRight
2657 case NS_sprm::LN_CFRMarkDel:
2658 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2659 break; // sprmCFRMarkDel
2660 case NS_sprm::LN_CFRMark:
2661 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2662 break; // sprmCFRMark
2663 case NS_sprm::LN_CFFldVanish:
2664 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2665 break; // sprmCFFldVanish
2666 case NS_sprm::LN_CFSpec: // sprmCFSpec
2667 break;
2668 case NS_sprm::LN_CPicLocation: // sprmCPicLocation
2669 //is being resolved on the tokenizer side
2670 break;
2671 case NS_sprm::LN_CIbstRMark:
2672 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2673 break; // sprmCIbstRMark
2674 case NS_sprm::LN_CDttmRMark:
2675 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2676 break; // sprmCDttmRMark
2677 case NS_sprm::LN_CFData:
2678 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2679 break; // sprmCFData
2680 case NS_sprm::LN_CIdslRMark:
2681 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2682 break; // sprmCIdslRMark
2683 case NS_sprm::LN_CChs:
2684 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2685 break; // sprmCChs
2686 case NS_sprm::LN_CSymbol: // sprmCSymbol
2687 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2688 resolveSprmProps(rSprm); //resolves LN_FONT and LN_CHAR
2689 break;
2690 case NS_sprm::LN_CFOle2:
2691 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2692 break; // sprmCFOle2
2693 case NS_sprm::LN_CIdCharType:
2694 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2695 break; // sprmCIdCharType
2696 case NS_sprm::LN_CHighlight:
2697 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2699 sal_Int32 nColor = 0;
2700 if(true ==( mbIsHighlightSet = getColorFromIndex(nIntValue, nColor)))
2701 rContext->Insert(PROP_CHAR_BACK_COLOR, true, uno::makeAny( nColor ));
2702 else if (mnBackgroundColor)
2703 rContext->Insert(PROP_CHAR_BACK_COLOR, true, uno::makeAny( mnBackgroundColor ));
2705 break; // sprmCHighlight
2706 case NS_sprm::LN_CObjLocation:
2707 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2708 break; // sprmCObjLocation
2709 case NS_sprm::LN_CFFtcAsciSymb:
2710 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2711 break; // sprmCFFtcAsciSymb
2712 case NS_sprm::LN_CIstd:
2713 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2714 break; // sprmCIstd
2715 case NS_sprm::LN_CIstdPermute:
2716 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2717 break; // sprmCIstdPermute
2718 case NS_sprm::LN_CDefault:
2719 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2720 break; // sprmCDefault
2721 case NS_sprm::LN_CPlain:
2722 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2723 break; // sprmCPlain
2724 case NS_sprm::LN_CKcd:
2725 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2726 rContext->Insert(PROP_CHAR_EMPHASIS, true, uno::makeAny ( getEmphasisValue (nIntValue)));
2727 break; // sprmCKcd
2728 case NS_sprm::LN_CFEmboss:// sprmCFEmboss
2729 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */
2730 case 60:// sprmCFBold
2731 case NS_sprm::LN_CFBoldBi:// sprmCFBoldBi (offset 0x27 to normal bold)
2732 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */
2733 case NS_sprm::LN_CFItalicBi:// sprmCFItalicBi (offset 0x27 to normal italic)
2734 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */
2735 case NS_sprm::LN_CFBold: //sprmCFBold
2736 case 61: /*sprmCFItalic*/
2737 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */
2738 case NS_sprm::LN_CFItalic: //sprmCFItalic
2739 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */
2740 case NS_sprm::LN_CFStrike: //sprmCFStrike
2741 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5*/
2742 case NS_sprm::LN_CFOutline: //sprmCFOutline
2743 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */
2744 case NS_sprm::LN_CFShadow: //sprmCFShadow
2745 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */
2746 case NS_sprm::LN_CFSmallCaps: //sprmCFSmallCaps
2747 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */
2748 case NS_sprm::LN_CFCaps: //sprmCFCaps
2749 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */
2750 case NS_sprm::LN_CFVanish: //sprmCFVanish
2751 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */
2752 case NS_sprm::LN_CFDStrike: // sprmCFDStrike
2753 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */
2755 PropertyIds ePropertyId = PROP_CHAR_WEIGHT; //initialized to prevent warning!
2756 switch( nSprmId )
2758 case 60:// sprmCFBold
2759 case NS_sprm::LN_CFBoldBi: // sprmCFBoldBi
2760 case NS_sprm::LN_CFBold: /*sprmCFBold*/
2761 ePropertyId = nSprmId != NS_sprm::LN_CFBoldBi ? PROP_CHAR_WEIGHT : PROP_CHAR_WEIGHT_COMPLEX;
2762 break;
2763 case 61: /*sprmCFItalic*/
2764 case NS_sprm::LN_CFItalicBi: // sprmCFItalicBi
2765 case NS_sprm::LN_CFItalic: /*sprmCFItalic*/
2766 ePropertyId = nSprmId == 0x836 ? PROP_CHAR_POSTURE : PROP_CHAR_POSTURE_COMPLEX;
2767 break;
2768 case NS_sprm::LN_CFStrike: /*sprmCFStrike*/
2769 case NS_sprm::LN_CFDStrike : /*sprmCFDStrike double strike through*/
2770 ePropertyId = PROP_CHAR_STRIKEOUT;
2771 break;
2772 case NS_sprm::LN_CFOutline: /*sprmCFOutline*/
2773 ePropertyId = PROP_CHAR_CONTOURED;
2774 break;
2775 case NS_sprm::LN_CFShadow: /*sprmCFShadow*/
2776 ePropertyId = PROP_CHAR_SHADOWED;
2777 break;
2778 case NS_sprm::LN_CFSmallCaps: /*sprmCFSmallCaps*/
2779 case NS_sprm::LN_CFCaps: /*sprmCFCaps*/
2780 ePropertyId = PROP_CHAR_CASE_MAP;
2781 break;
2782 case NS_sprm::LN_CFVanish: /*sprmCFVanish*/
2783 ePropertyId = PROP_CHAR_HIDDEN;
2784 break;
2785 case NS_sprm::LN_CFEmboss: /*sprmCFEmboss*/
2786 ePropertyId = PROP_CHAR_RELIEF;
2787 break;
2789 //expected: 0,1,128,129
2790 if(nIntValue != 128) //inherited from paragraph - ignore
2792 if( nIntValue == 129) //inverted style sheet value
2794 //get value from style sheet and invert it
2795 sal_Int16 nStyleValue = 0;
2796 double fDoubleValue;
2797 uno::Any aStyleVal = m_pImpl->GetPropertyFromStyleSheet(ePropertyId);
2798 if( !aStyleVal.hasValue() )
2800 nIntValue = 0x83a == nSprmId ?
2801 4 : 1;
2803 else if(aStyleVal.getValueTypeClass() == uno::TypeClass_FLOAT )
2805 //only in case of awt::FontWeight
2806 aStyleVal >>= fDoubleValue;
2807 nIntValue = fDoubleValue > 100. ? 0 : 1;
2809 else if((aStyleVal >>= nStyleValue) ||
2810 (nStyleValue = (sal_Int16)comphelper::getEnumAsINT32(aStyleVal)) >= 0 )
2812 nIntValue = 0x83a == nSprmId ?
2813 nStyleValue ? 0 : 4 :
2814 nStyleValue ? 0 : 1;
2816 else
2818 OSL_ENSURE( false, "what type was it");
2822 switch( nSprmId )
2824 case 60:/*sprmCFBold*/
2825 case NS_sprm::LN_CFBold: /*sprmCFBold*/
2826 case NS_sprm::LN_CFBoldBi: // sprmCFBoldBi
2828 uno::Any aBold( uno::makeAny( nIntValue ? awt::FontWeight::BOLD : awt::FontWeight::NORMAL ) );
2829 rContext->Insert(ePropertyId, true, aBold );
2830 if( nSprmId != NS_sprm::LN_CFBoldBi ) // sprmCFBoldBi
2831 rContext->Insert(PROP_CHAR_WEIGHT_ASIAN, true, aBold );
2833 break;
2834 case 61: /*sprmCFItalic*/
2835 case NS_sprm::LN_CFItalic: /*sprmCFItalic*/
2836 case NS_sprm::LN_CFItalicBi: // sprmCFItalicBi
2838 uno::Any aPosture( uno::makeAny( nIntValue ? awt::FontSlant_ITALIC : awt::FontSlant_NONE ) );
2839 rContext->Insert( ePropertyId, true, aPosture );
2840 if( nSprmId != NS_sprm::LN_CFItalicBi ) // sprmCFItalicBi
2841 rContext->Insert(PROP_CHAR_POSTURE_ASIAN, true, aPosture );
2843 break;
2844 case NS_sprm::LN_CFStrike: /*sprmCFStrike*/
2845 rContext->Insert(ePropertyId, true,
2846 uno::makeAny( nIntValue ? awt::FontStrikeout::SINGLE : awt::FontStrikeout::NONE ) );
2847 break;
2848 case NS_sprm::LN_CFDStrike : /*sprmCFDStrike double strike through*/
2849 rContext->Insert(ePropertyId, true,
2850 uno::makeAny( awt::FontStrikeout::DOUBLE ) );
2851 break;
2852 case NS_sprm::LN_CFOutline: /*sprmCFOutline*/
2853 case NS_sprm::LN_CFShadow: /*sprmCFShadow*/
2854 case NS_sprm::LN_CFVanish: /*sprmCFVanish*/
2855 rContext->Insert(ePropertyId, true, uno::makeAny( nIntValue ? true : false ));
2856 break;
2857 case NS_sprm::LN_CFSmallCaps: /*sprmCFSmallCaps*/
2858 rContext->Insert(ePropertyId, true,
2859 uno::makeAny( nIntValue ? style::CaseMap::SMALLCAPS : style::CaseMap::NONE));
2860 break;
2861 case NS_sprm::LN_CFCaps: /*sprmCFCaps*/
2862 rContext->Insert(ePropertyId, true,
2863 uno::makeAny( nIntValue ? style::CaseMap::UPPERCASE : style::CaseMap::NONE));
2864 break;
2865 case NS_sprm::LN_CFEmboss: /*sprmCFEmboss*/
2866 rContext->Insert(ePropertyId, true,
2867 uno::makeAny( nIntValue ? awt::FontRelief::EMBOSSED : awt::FontRelief::NONE ));
2868 break;
2873 break;
2874 case NS_sprm::LN_CFtcDefault:
2875 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2876 break; // sprmCFtcDefault
2877 case NS_sprm::LN_CKul: // sprmCKul
2878 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
2880 // Parameter: 0 = none, 1 = single, 2 = by Word,
2881 // 3 = double, 4 = dotted, 5 = hidden
2882 // 6 = thick, 7 = dash, 8 = dot(not used)
2883 // 9 = dotdash 10 = dotdotdash 11 = wave
2884 handleUnderlineType(nIntValue, rContext);
2886 break;
2887 case NS_sprm::LN_CSizePos:
2888 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2889 break; // sprmCSizePos
2890 case NS_sprm::LN_CLid:
2891 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2892 break; // sprmCLid
2893 case NS_sprm::LN_CIco:
2894 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2896 sal_Int32 nColor = 0;
2897 if (getColorFromIndex(nIntValue, nColor))
2898 rContext->Insert(PROP_CHAR_COLOR, true, uno::makeAny( nColor ) );
2900 break; // sprmCIco
2901 case NS_sprm::LN_CHpsBi: // sprmCHpsBi
2902 case NS_sprm::LN_CHps: // sprmCHps
2903 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
2905 //multiples of half points (12pt == 24)
2906 double fVal = double(nIntValue) / 2.;
2907 uno::Any aVal = uno::makeAny( fVal );
2908 if( NS_sprm::LN_CHpsBi == nSprmId )
2909 rContext->Insert( PROP_CHAR_HEIGHT_COMPLEX, true, aVal );
2910 else
2912 //Asian get the same value as Western
2913 rContext->Insert( PROP_CHAR_HEIGHT, true, aVal );
2914 rContext->Insert( PROP_CHAR_HEIGHT_ASIAN, true, aVal );
2917 break;
2918 case NS_sprm::LN_CHpsInc:
2919 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2920 break; // sprmCHpsInc
2921 case NS_sprm::LN_CHpsPos:
2922 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2924 // FIXME: ww8 filter in ww8par6.cxx has a Read_SubSuperProp function
2925 // that counts the escapement from this value and font size. So it will be
2926 // on our TODO list
2927 sal_Int16 nEscapement = 0;
2928 sal_Int8 nProp = 100;
2929 if (nIntValue < 0)
2930 nEscapement = -58;
2931 else if (nIntValue > 0)
2932 nEscapement = 58;
2933 else /* (nIntValue == 0) */
2934 nProp = 0;
2935 rContext->Insert(PROP_CHAR_ESCAPEMENT, true, uno::makeAny( nEscapement ) );
2936 rContext->Insert(PROP_CHAR_ESCAPEMENT_HEIGHT, true, uno::makeAny( nProp ) );
2938 break; // sprmCHpsPos
2939 case NS_sprm::LN_CHpsPosAdj:
2940 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2941 break; // sprmCHpsPosAdj
2942 case NS_sprm::LN_CMajority:
2943 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2944 break; // sprmCMajority
2945 case NS_sprm::LN_CIss: // sprmCIss
2946 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
2948 //sub/super script 1: super, 2: sub, 0: normal
2949 sal_Int16 nEscapement = 0;
2950 sal_Int8 nProp = 58;
2951 switch(nIntValue)
2953 case 1: //super
2954 nEscapement = 101;
2955 break;
2956 case 2: //sub
2957 nEscapement = -101;
2958 break;
2959 case 0: nProp = 0;break; //none
2961 rContext->Insert(PROP_CHAR_ESCAPEMENT, true, uno::makeAny( nEscapement ) );
2962 rContext->Insert(PROP_CHAR_ESCAPEMENT_HEIGHT, true, uno::makeAny( nProp ) );
2964 break;
2965 case NS_sprm::LN_CHpsNew50:
2966 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2967 break; // sprmCHpsNew50
2968 case NS_sprm::LN_CHpsInc1:
2969 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2970 break; // sprmCHpsInc1
2971 case 71 : //"sprmCDxaSpace"
2972 case 96 : //"sprmCDxaSpace"
2973 case NS_sprm::LN_CDxaSpace: // sprmCDxaSpace
2974 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */
2975 //Kerning half point values
2976 //TODO: there are two kerning values -
2977 // in ww8par6.cxx NS_sprm::LN_CHpsKern is used as boolean AutoKerning
2978 rContext->Insert(PROP_CHAR_CHAR_KERNING, true, uno::makeAny( sal_Int16(ConversionHelper::convertTwipToMM100(sal_Int16(nIntValue))) ) );
2979 break;
2980 case NS_sprm::LN_CHpsKern: // sprmCHpsKern auto kerning is bound to a minimum font size in Word - but not in Writer :-(
2981 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
2982 rContext->Insert(PROP_CHAR_AUTO_KERNING, true, uno::makeAny( true ) );
2983 break;
2984 case NS_sprm::LN_CMajority50:
2985 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2986 break; // sprmCMajority50
2987 case NS_sprm::LN_CHpsMul:
2988 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2989 break; // sprmCHpsMul
2990 case NS_sprm::LN_CYsri:
2991 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
2992 break; // sprmCYsri
2993 case NS_sprm::LN_CRgFtc0: // sprmCRgFtc0 //ascii font index
2994 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
2995 case NS_sprm::LN_CRgFtc1: // sprmCRgFtc1 //Asian font index
2996 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
2997 case NS_sprm::LN_CRgFtc2: // sprmCRgFtc2 //CTL font index
2998 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
2999 case NS_sprm::LN_CFtcBi: // sprmCFtcBi //font index of a CTL font
3000 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3002 FontTablePtr pFontTable = m_pImpl->GetFontTable();
3003 if(nIntValue >= 0 && pFontTable->size() > sal_uInt32(nIntValue))
3005 PropertyIds eFontName = PROP_CHAR_FONT_NAME;
3006 PropertyIds eFontStyle = PROP_CHAR_FONT_STYLE;
3007 PropertyIds eFontFamily = PROP_CHAR_FONT_FAMILY;
3008 PropertyIds eFontCharSet = PROP_CHAR_FONT_CHAR_SET;
3009 PropertyIds eFontPitch = PROP_CHAR_FONT_PITCH;
3010 switch(nSprmId)
3012 case NS_sprm::LN_CRgFtc0:
3013 //already initialized
3014 break;
3015 case NS_sprm::LN_CRgFtc1:
3016 eFontName = PROP_CHAR_FONT_NAME_ASIAN;
3017 eFontStyle = PROP_CHAR_FONT_STYLE_ASIAN;
3018 eFontFamily = PROP_CHAR_FONT_FAMILY_ASIAN;
3019 eFontCharSet = PROP_CHAR_FONT_CHAR_SET_ASIAN;
3020 eFontPitch = PROP_CHAR_FONT_PITCH_ASIAN;
3021 break;
3022 case NS_sprm::LN_CRgFtc2:
3023 case NS_sprm::LN_CFtcBi:
3024 eFontName = PROP_CHAR_FONT_NAME_COMPLEX;
3025 eFontStyle = PROP_CHAR_FONT_STYLE_COMPLEX;
3026 eFontFamily = PROP_CHAR_FONT_FAMILY_COMPLEX;
3027 eFontCharSet = PROP_CHAR_FONT_CHAR_SET_COMPLEX;
3028 eFontPitch = PROP_CHAR_FONT_PITCH_COMPLEX;
3029 break;
3031 const FontEntry* pFontEntry = pFontTable->getFontEntry(sal_uInt32(nIntValue));
3032 rContext->Insert(eFontName, true, uno::makeAny( pFontEntry->sFontName ));
3033 // rContext->Insert(eFontStyle, uno::makeAny( pFontEntry-> ));
3034 // rContext->Insert(eFontFamily, uno::makeAny( pFontEntry-> ));
3035 rContext->Insert(eFontCharSet, true, uno::makeAny( (sal_Int16)pFontEntry->nTextEncoding ));
3036 rContext->Insert(eFontPitch, true, uno::makeAny( pFontEntry->nPitchRequest ));
3039 break;
3040 case NS_sprm::LN_CCharScale: // sprmCCharScale
3041 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3042 rContext->Insert(PROP_CHAR_SCALE_WIDTH, true,
3043 uno::makeAny( sal_Int16(nIntValue) ));
3044 break;
3045 case NS_sprm::LN_CFImprint: // sprmCFImprint 1 or 0
3046 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3047 // FontRelief: NONE, EMBOSSED, ENGRAVED
3048 rContext->Insert(PROP_CHAR_RELIEF, true,
3049 uno::makeAny( nIntValue ? awt::FontRelief::ENGRAVED : awt::FontRelief::NONE ));
3050 break;
3051 case NS_sprm::LN_CFObj:
3052 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3053 break; // sprmCFObj
3054 case NS_sprm::LN_CPropRMark:
3055 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3056 break; // sprmCPropRMark
3057 case NS_sprm::LN_CSfxText:
3058 // The file-format has many character animations. We have only
3059 // one, so we use it always. Suboptimal solution though.
3060 if (nIntValue)
3061 rContext->Insert(PROP_CHAR_FLASH, true, uno::makeAny( true ));
3062 else
3063 rContext->Insert(PROP_CHAR_FLASH, true, uno::makeAny( false ));
3064 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3065 break; // sprmCSfxText
3066 case NS_sprm::LN_CFBiDi:
3067 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3068 break; // sprmCFBiDi
3069 case NS_sprm::LN_CFDiacColor:
3070 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3071 break; // sprmCFDiacColor
3072 case NS_sprm::LN_CIcoBi:
3073 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3074 break; // sprmCIcoBi
3075 case NS_sprm::LN_CDispFldRMark:
3076 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3077 break; // sprmCDispFldRMark
3078 case NS_sprm::LN_CIbstRMarkDel:
3079 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3080 break; // sprmCIbstRMarkDel
3081 case NS_sprm::LN_CDttmRMarkDel:
3082 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3083 break; // sprmCDttmRMarkDel
3084 case NS_sprm::LN_CBrc:
3085 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3086 break; // sprmCBrc
3087 case NS_sprm::LN_CShd:
3088 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3089 break; // sprmCShd
3090 case NS_sprm::LN_CIdslRMarkDel:
3091 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3092 break; // sprmCIdslRMarkDel
3093 case NS_sprm::LN_CFUsePgsuSettings:
3094 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3095 break; // sprmCFUsePgsuSettings
3096 case NS_sprm::LN_CCpg:
3097 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3098 break; // sprmCCpg
3099 case NS_sprm::LN_CLidBi: // sprmCLidBi language complex
3100 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3101 case 0x4873: //sprmCRgLid
3102 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 1 */
3103 //undocumented but interpreted as western language
3104 case NS_sprm::LN_CRgLid0: // sprmCRgLid0 language Western
3105 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3106 case NS_sprm::LN_CRgLid1: // sprmCRgLid1 language Asian
3107 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3109 lang::Locale aLocale;
3110 MsLangId::convertLanguageToLocale( (LanguageType)nIntValue, aLocale );
3111 rContext->Insert(NS_sprm::LN_CRgLid0 == nSprmId ? PROP_CHAR_LOCALE :
3112 NS_sprm::LN_CRgLid1 == nSprmId ? PROP_CHAR_LOCALE_ASIAN : PROP_CHAR_LOCALE_COMPLEX,
3113 true,
3114 uno::makeAny( aLocale ) );
3116 break;
3118 case NS_sprm::LN_CIdctHint: // sprmCIdctHint
3119 //list table - text offset???
3120 break;
3121 case NS_sprm::LN_PicBrcl:
3122 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3123 break; // sprmPicBrcl
3124 case NS_sprm::LN_PicScale:
3125 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3126 break; // sprmPicScale
3127 case NS_sprm::LN_PicBrcTop:
3128 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3129 break; // sprmPicBrcTop
3130 case NS_sprm::LN_PicBrcLeft:
3131 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3132 break; // sprmPicBrcLeft
3133 case NS_sprm::LN_PicBrcBottom:
3134 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3135 break; // sprmPicBrcBoConversionHelper::convertTwipToMM100ttom
3136 case NS_sprm::LN_PicBrcRight:
3137 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3138 break; // sprmPicBrcRight
3139 case NS_sprm::LN_ScnsPgn:
3140 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3141 break; // sprmScnsPgn
3142 case NS_sprm::LN_SiHeadingPgn:
3143 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3144 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3145 if(pSectionContext)
3146 pSectionContext->SetEvenlySpaced( nIntValue > 0 );
3148 break; // sprmSiHeadingPgn
3149 case NS_sprm::LN_SOlstAnm:
3150 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3151 break; // sprmSOlstAnm
3152 case 136:
3153 case NS_sprm::LN_SDxaColWidth: // sprmSDxaColWidth
3154 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3155 // contains the twip width of the column as 3-byte-code
3156 // the lowet byte contains the index
3157 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3158 if(pSectionContext)
3159 pSectionContext->AppendColumnWidth( ConversionHelper::convertTwipToMM100( (nIntValue & 0xffff00) >> 8 ));
3160 break;
3161 case NS_sprm::LN_SDxaColSpacing: // sprmSDxaColSpacing
3162 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3163 // the lowet byte contains the index
3164 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3165 if(pSectionContext)
3166 pSectionContext->AppendColumnSpacing( ConversionHelper::convertTwipToMM100( (nIntValue & 0xffff00) >> 8 ));
3167 break;
3168 case 138:
3169 case NS_sprm::LN_SFEvenlySpaced:
3170 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3171 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3172 if(pSectionContext)
3173 pSectionContext->SetEvenlySpaced( nIntValue > 0 );
3174 break; // sprmSFEvenlySpaced
3175 case NS_sprm::LN_SFProtected: // sprmSFProtected
3176 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3177 //todo: missing feature - unlocked sections in protected documents
3178 break;
3179 case NS_sprm::LN_SDmBinFirst: // sprmSDmBinFirst
3180 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3181 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3182 if(pSectionContext)
3183 pSectionContext->SetFirstPaperBin(nIntValue);
3184 break;
3185 case NS_sprm::LN_SDmBinOther: // sprmSDmBinOther
3186 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3187 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3188 if(pSectionContext)
3189 pSectionContext->SetPaperBin( nIntValue );
3190 break;
3191 case NS_sprm::LN_SBkc: // sprmSBkc
3192 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */
3193 /* break type
3194 0 - No break
3195 1 - New Colunn
3196 2 - New page
3197 3 - Even page
3198 4 - odd page
3200 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3201 if(pSectionContext)
3202 pSectionContext->SetBreakType( nIntValue );
3203 break;
3204 case 143:
3205 case NS_sprm::LN_SFTitlePage: // sprmSFTitlePage
3206 case NS_ooxml::LN_EG_SectPrContents_titlePg:
3208 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3209 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3210 if(pSectionContext)
3211 pSectionContext->SetTitlePage( nIntValue > 0 ? true : false );//section has title page
3213 break;
3214 case 144:
3215 case NS_sprm::LN_SCcolumns: // sprmSCcolumns
3216 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3217 //no of columns - 1
3218 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3219 if(pSectionContext)
3220 pSectionContext->SetColumnCount( (sal_Int16) nIntValue );
3221 break;
3222 case 145:
3223 case NS_sprm::LN_SDxaColumns: // sprmSDxaColumns
3224 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3225 //column distance - default 708 twip
3226 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3227 if(pSectionContext)
3228 pSectionContext->SetColumnDistance( ConversionHelper::convertTwipToMM100( nIntValue ) );
3229 break;
3230 case NS_sprm::LN_SFAutoPgn:
3231 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3232 break; // sprmSFAutoPgn
3233 case 147:
3234 case NS_sprm::LN_SNfcPgn: // sprmSNfcPgn
3235 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3236 //page numbering 0 - Arab, 1 - ROMAN, 2 - roman, 3 - ABC, 4 abc
3237 sal_Int16 nNumbering;
3238 switch( nIntValue )
3240 case 1: nNumbering = style::NumberingType::ROMAN_UPPER;
3241 case 2: nNumbering = style::NumberingType::ROMAN_LOWER;
3242 case 3: nNumbering = style::NumberingType::CHARS_UPPER_LETTER;
3243 case 4: nNumbering = style::NumberingType::CHARS_LOWER_LETTER;
3244 case 0:
3245 default:
3246 nNumbering = style::NumberingType::ARABIC;
3248 rContext->Insert( PROP_NUMBERING_TYPE, false, uno::makeAny( nNumbering ) );
3249 break;
3250 case NS_sprm::LN_SDyaPgn:
3251 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3252 break; // sprmSDyaPgn
3253 case NS_sprm::LN_SDxaPgn:
3254 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3255 break; // sprmSDxaPgn
3256 case 150:
3257 case NS_sprm::LN_SFPgnRestart: // sprmSFPgnRestart
3259 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3260 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3261 if(pSectionContext)
3262 pSectionContext->SetPageNoRestart( nIntValue > 0 );
3264 break;
3265 case NS_sprm::LN_SFEndnote:
3266 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3267 break; // sprmSFEndnote
3268 case 154:
3269 case NS_sprm::LN_SNLnnMod:// sprmSNLnnMod
3270 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3271 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3272 if( pSectionContext )
3273 pSectionContext->SetLnnMod( nIntValue );
3274 break;
3275 case 155:
3276 case NS_sprm::LN_SDxaLnn: // sprmSDxaLnn
3277 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3278 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3279 if( pSectionContext )
3280 pSectionContext->SetdxaLnn( nIntValue );
3281 break;
3282 case 152:
3283 case NS_sprm::LN_SLnc:// sprmSLnc
3284 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3285 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3286 if( pSectionContext )
3287 pSectionContext->SetLnc( nIntValue );
3288 break;
3289 case 160:
3290 case NS_sprm::LN_SLnnMin: // sprmSLnnMin
3291 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3292 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3293 if( pSectionContext )
3294 pSectionContext->SetLnnMin( nIntValue );
3295 break;
3297 case NS_sprm::LN_SGprfIhdt:
3298 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3299 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3300 //flags about header/footer sharing and footnotes?
3301 /* ww8scan.hxx:
3302 * WW8_HEADER_EVEN = 0x01, WW8_HEADER_ODD = 0x02, WW8_FOOTER_EVEN = 0x04,
3303 * WW8_FOOTER_ODD = 0x08, WW8_HEADER_FIRST = 0x10, WW8_FOOTER_FIRST = 0x20
3306 // if(pSectionContext)
3307 break; // sprmSGprfIhdt
3308 case NS_sprm::LN_SDyaHdrTop: // sprmSDyaHdrTop
3309 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3310 // default 720 twip
3311 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3312 if(pSectionContext)
3313 pSectionContext->SetHeaderTop( ConversionHelper::convertTwipToMM100( nIntValue ));
3314 break;
3315 case NS_sprm::LN_SDyaHdrBottom: // sprmSDyaHdrBottom
3316 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3317 // default 720 twip
3318 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3319 if(pSectionContext)
3320 pSectionContext->SetHeaderBottom( ConversionHelper::convertTwipToMM100( nIntValue ) );
3321 break;
3322 case 158:
3323 case NS_sprm::LN_SLBetween: // sprmSLBetween
3324 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3325 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3326 if(pSectionContext)
3327 pSectionContext->SetSeparatorLine( nIntValue > 0 );
3328 break;
3329 case NS_sprm::LN_SVjc:
3330 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3331 break; // sprmSVjc
3332 case 161:
3333 case NS_sprm::LN_SPgnStart: // sprmSPgnStart
3334 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3335 //page number
3336 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3337 if(pSectionContext)
3338 pSectionContext->SetPageNumber( nIntValue );
3339 break;
3340 case 162:
3341 case NS_sprm::LN_SBOrientation:
3342 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3343 //todo: the old filter assumed that a value of 2 points to double-pages layout
3344 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3345 if(pSectionContext)
3346 pSectionContext->SetLandscape( nIntValue > 0 );
3347 rContext->Insert( PROP_IS_LANDSCAPE , false, uno::makeAny( nIntValue > 0 ));
3348 break; // sprmSBOrientation
3349 case NS_sprm::LN_SBCustomize:
3350 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3351 break; // sprmSBCustomize
3352 case 165:
3353 case NS_sprm::LN_SYaPage: // sprmSYaPage
3355 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3356 //page height, rounded to default values, default: 0x3dc0 twip
3357 sal_Int32 nHeight = ConversionHelper::SnapPageDimension( nIntValue );
3358 rContext->Insert( PROP_HEIGHT, false, uno::makeAny( ConversionHelper::convertTwipToMM100( nHeight ) ) );
3360 break;
3361 case NS_sprm::LN_SXaPage: // sprmSXaPage
3363 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3364 //page width, rounded to default values, default 0x2fd0 twip
3365 sal_Int32 nWidth = ConversionHelper::SnapPageDimension( nIntValue );
3366 rContext->Insert( PROP_WIDTH, false, uno::makeAny( ConversionHelper::convertTwipToMM100( nWidth ) ) );
3368 break;
3369 case 166:
3370 case NS_sprm::LN_SDxaLeft: // sprmSDxaLeft
3372 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3373 //left page margin default 0x708 twip
3374 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3375 sal_Int32 nConverted = ConversionHelper::convertTwipToMM100( nIntValue );
3376 if(pSectionContext)
3377 pSectionContext->SetLeftMargin( nConverted );
3378 rContext->Insert( PROP_LEFT_MARGIN, false, uno::makeAny( nConverted ));
3380 break;
3381 case 167:
3382 case NS_sprm::LN_SDxaRight: // sprmSDxaRight
3384 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3385 //right page margin default 0x708 twip
3386 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3387 sal_Int32 nConverted = ConversionHelper::convertTwipToMM100( nIntValue );
3388 if(pSectionContext)
3389 pSectionContext->SetRightMargin( nConverted );
3390 rContext->Insert( PROP_RIGHT_MARGIN, false, uno::makeAny( nConverted ));
3392 break;
3393 case 168:
3394 case NS_sprm::LN_SDyaTop: // sprmSDyaTop
3396 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3397 //top page margin default 1440 twip
3398 //todo: check cast of SVBT16
3399 sal_Int32 nConverted = ConversionHelper::convertTwipToMM100( static_cast< sal_Int16 >( nIntValue ) );
3400 rContext->Insert( PROP_TOP_MARGIN, false, uno::makeAny( nConverted ) );
3401 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3402 if(pSectionContext)
3403 pSectionContext->SetTopMargin( nConverted );
3405 break;
3406 case 169:
3407 case NS_sprm::LN_SDyaBottom: // sprmSDyaBottom
3409 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3410 //bottom page margin default 1440 twip
3411 //todo: check cast of SVBT16
3412 sal_Int32 nConverted = ConversionHelper::convertTwipToMM100( static_cast< sal_Int16 >( nIntValue ) );
3413 rContext->Insert( PROP_BOTTOM_MARGIN, false, uno::makeAny( nConverted) );
3414 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3415 if(pSectionContext)
3416 pSectionContext->SetBottomMargin( nConverted );
3418 break;
3419 case 170:
3420 case NS_sprm::LN_SDzaGutter: // sprmSDzaGutter
3422 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3423 // gutter is added to one of the margins of a section depending on RTL, can be placed on top either
3424 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3425 if(pSectionContext)
3427 pSectionContext->SetDzaGutter( ConversionHelper::convertTwipToMM100( nIntValue ) );
3430 break;
3431 case NS_sprm::LN_SDmPaperReq: // sprmSDmPaperReq
3432 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
3433 //paper code - no handled in old filter
3434 break;
3435 case NS_sprm::LN_SPropRMark:
3436 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3437 break; // sprmSPropRMark
3438 case NS_sprm::LN_SFBiDi:// sprmSFBiDi
3440 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */
3441 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3442 if(pSectionContext)
3443 pSectionContext->SetSFBiDi( nIntValue > 0 );
3445 break;
3446 case NS_sprm::LN_SFFacingCol:
3447 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3448 break; // sprmSFFacingCol
3449 case NS_sprm::LN_SFRTLGutter: // sprmSFRTLGutter
3451 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3452 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3453 if(pSectionContext)
3454 pSectionContext->SetGutterRTL( nIntValue > 0 );
3456 break;
3457 case NS_sprm::LN_SBrcTop: // sprmSBrcTop
3458 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3459 case NS_sprm::LN_SBrcLeft: // sprmSBrcLeft
3460 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3461 case NS_sprm::LN_SBrcBottom: // sprmSBrcBottom
3462 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3463 case NS_sprm::LN_SBrcRight: // sprmSBrcRight
3464 /* WRITERFILTERSTATUS: Sectiondone: 100, planned: 0.5, spent: 0 */
3466 table::BorderLine aBorderLine;
3467 sal_Int32 nLineDistance = ConversionHelper::MakeBorderLine( nIntValue, aBorderLine );
3468 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3469 if(pSectionContext)
3471 static const BorderPosition aPositions[4] =
3473 BORDER_TOP,
3474 BORDER_LEFT,
3475 BORDER_BOTTOM,
3476 BORDER_RIGHT
3478 pSectionContext->SetBorder( aPositions[nSprmId - NS_sprm::LN_SBrcTop], nLineDistance, aBorderLine );
3481 break;
3483 case NS_sprm::LN_SPgbProp: // sprmSPgbProp
3485 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3486 if(pSectionContext)
3488 pSectionContext->ApplyBorderToPageStyles( m_pImpl->GetPageStyles(), m_pImpl->GetTextFactory(), nIntValue );
3491 break;
3492 case NS_sprm::LN_SDxtCharSpace:
3494 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3495 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3496 if(pSectionContext)
3498 pSectionContext->SetDxtCharSpace( nIntValue );
3501 break; // sprmSDxtCharSpace
3502 case NS_sprm::LN_SDyaLinePitch: // sprmSDyaLinePitch
3504 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3505 //see SwWW8ImplReader::SetDocumentGrid
3506 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3507 if(pSectionContext)
3509 pSectionContext->SetGridLinePitch( ConversionHelper::convertTwipToMM100( nIntValue ) );
3512 break;
3513 case 0x703a: //undocumented, grid related?
3514 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3515 OSL_ENSURE( false, "TODO: not handled yet"); //nIntValue like 0x008a2373 ?
3516 break;
3517 case NS_sprm::LN_SClm:
3519 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3520 sal_Int16 nGridType = text::TextGridMode::NONE;
3521 switch( nIntValue )
3523 case 0:
3524 nGridType = text::TextGridMode::NONE;
3525 break;
3526 case 3:
3527 //Text snaps to char grid, this doesn't make a lot of sense to
3528 //me. This is closer than LINES_CHARS
3529 nGridType = text::TextGridMode::LINES;
3530 break;
3531 case 1:
3532 nGridType = text::TextGridMode::LINES_AND_CHARS;
3533 break;
3534 case 2:
3535 nGridType = text::TextGridMode::LINES;
3536 break;
3537 default:;
3539 rContext->Insert( PROP_GRID_MODE, false, uno::makeAny( nGridType ) );
3541 //Seems to force this behaviour in word ?
3542 if(nGridType != text::TextGridMode::NONE)
3543 m_pImpl->SetDocumentSettingsProperty(
3544 PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_ADD_EXTERNAL_LEADING ),
3545 uno::makeAny( true ) );
3547 break; // sprmSClm
3548 case NS_sprm::LN_STextFlow:
3550 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */
3551 /* 0 HoriLR 1 Vert TR 2 Vert TR 3 Vert TT 4 HoriLT
3552 only 0 and 1 can be imported correctly
3554 sal_Int16 nDirection = text::WritingMode_LR_TB;
3555 switch( nIntValue )
3557 case 0:
3558 case 4:
3559 nDirection = text::WritingMode_LR_TB;
3560 break;
3561 case 1:
3562 case 2:
3563 case 3:
3564 nDirection = text::WritingMode_TB_RL;
3565 break;
3566 default:;
3568 rContext->Insert(PROP_WRITING_MODE, false, uno::makeAny( nDirection ) );
3570 break; // sprmSTextFlow
3571 case NS_sprm::LN_TJc: // sprmTJc
3572 case NS_sprm::LN_TDxaLeft:
3573 case NS_sprm::LN_TDxaGapHalf:
3574 case NS_sprm::LN_TFCantSplit:
3575 case NS_sprm::LN_TTableHeader:
3576 case NS_sprm::LN_TTableBorders: // sprmTTableBorders
3578 OSL_ENSURE( false, "table propeties should be handled by the table manager");
3580 break;
3581 case NS_sprm::LN_TDefTable10:
3582 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3583 break; // sprmTDefTable10
3584 case NS_sprm::LN_TDyaRowHeight:
3585 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3586 break; // sprmTDyaRowHeight
3587 case NS_sprm::LN_TDefTable:
3588 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3589 break; // sprmTDefTable
3590 case NS_sprm::LN_TDefTableShd:
3591 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3592 break; // sprmTDefTableShd
3593 case NS_sprm::LN_TTlp:
3594 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3595 break; // sprmTTlp
3596 case NS_sprm::LN_TFBiDi:
3597 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3598 break; // sprmTFBiDi
3599 case NS_sprm::LN_THTMLProps:
3600 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3601 break; // sprmTHTMLProps
3602 case NS_sprm::LN_TSetBrc:
3603 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3604 break; // sprmTSetBrc
3605 case NS_sprm::LN_TInsert:
3606 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3607 break; // sprmTInsert
3608 case NS_sprm::LN_TDelete:
3609 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3610 break; // sprmTDelete
3611 case NS_sprm::LN_TDxaCol:
3612 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3613 break; // sprmTDxaCol
3614 case NS_sprm::LN_TMerge:
3615 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3616 break; // sprmTMerge
3617 case NS_sprm::LN_TSplit:
3618 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3619 break; // sprmTSplit
3620 case NS_sprm::LN_TSetBrc10:
3621 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3622 break; // sprmTSetBrc10
3623 case 164: // sprmTSetShd
3624 case NS_sprm::LN_TSetShd:
3625 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3626 break; // sprmTSetShd
3627 case NS_sprm::LN_TSetShdOdd:
3628 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3629 break; // sprmTSetShdOdd
3630 case NS_sprm::LN_TTextFlow:
3631 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3632 break; // sprmTTextFlow
3633 case NS_sprm::LN_TDiagLine:
3634 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3635 break; // sprmTDiagLine
3636 case NS_sprm::LN_TVertMerge:
3637 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3638 break; // sprmTVertMerge
3639 case NS_sprm::LN_TVertAlign:
3640 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3641 break; // sprmTVertAlign
3642 // the following are not part of the official documentation
3643 case 0x6870: //TxtForeColor
3644 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3646 //contains a color as 0xTTRRGGBB while SO uses 0xTTRRGGBB
3647 sal_Int32 nColor = ConversionHelper::ConvertColor(nIntValue);
3648 rContext->Insert(PROP_CHAR_COLOR, true, uno::makeAny( nColor ) );
3650 break;
3651 case 0x4874:
3652 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3653 break; //seems to be a language id for Asian text - undocumented
3654 case 0x6877: //underlining color
3655 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3657 sal_Int32 nColor = ConversionHelper::ConvertColor(nIntValue);
3658 rContext->Insert(PROP_CHAR_UNDERLINE_HAS_COLOR, true, uno::makeAny( true ) );
3659 rContext->Insert(PROP_CHAR_UNDERLINE_COLOR, true, uno::makeAny( nColor ) );
3661 break;
3662 case 0x6815:
3663 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3664 break; //undocumented
3665 case NS_sprm::LN_CIndrsid:
3666 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3667 break; //undocumented
3668 case 0x6467:
3669 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3670 break; //undocumented
3671 case 0xF617:
3672 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3673 break; //undocumented
3674 case 0xd634: // sprmTNewSpacing - table spacing ( see WW8TabBandDesc::ProcessSpacing() )
3675 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3676 break;
3677 case NS_sprm::LN_TTRLeft:
3678 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */
3679 break; //undocumented
3680 case 0x4888:
3681 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3682 case 0x6887:
3683 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3684 //properties of list levels - undocumented
3685 break;
3686 case 0xd234:
3687 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3688 case 0xd235:
3689 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3690 case 0xd236:
3691 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3692 case 0xd237:
3693 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3694 break;//undocumented section properties
3695 case NS_sprm::LN_CEastAsianLayout:
3696 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3697 resolveSprmProps(rSprm);
3698 break;
3699 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3700 case NS_ooxml::LN_CT_Tabs_tab:
3701 resolveSprmProps(rSprm);
3702 m_pImpl->IncorporateTabStop(m_pImpl->m_aCurrentTabStop);
3703 m_pImpl->m_aCurrentTabStop = DeletableTabStop();
3704 break;
3705 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3706 case NS_ooxml::LN_CT_PPrBase_tabs:
3708 // Initialize tab stop vector from style sheet
3709 if( !m_pImpl->IsStyleSheetImport() )
3711 uno::Any aValue = m_pImpl->GetPropertyFromStyleSheet(PROP_PARA_TAB_STOPS);
3712 uno::Sequence< style::TabStop > aStyleTabStops;
3713 if(aValue >>= aStyleTabStops)
3715 m_pImpl->InitTabStopFromStyle( aStyleTabStops );
3718 resolveSprmProps(rSprm);
3719 rContext->Insert(PROP_PARA_TAB_STOPS, true, uno::makeAny( m_pImpl->GetCurrentTabStopAndClear()));
3721 break;
3723 case NS_ooxml::LN_CT_PPr_sectPr:
3724 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3725 case NS_ooxml::LN_EG_RPrBase_color:
3726 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3727 case NS_ooxml::LN_EG_RPrBase_rFonts:
3728 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3729 case NS_ooxml::LN_EG_RPrBase_bdr:
3730 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3731 case NS_ooxml::LN_EG_RPrBase_eastAsianLayout:
3732 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3733 case NS_ooxml::LN_EG_RPrBase_u:
3734 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3735 case NS_ooxml::LN_EG_RPrBase_lang:
3736 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3737 case NS_ooxml::LN_CT_PPrBase_spacing:
3738 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3739 case NS_ooxml::LN_CT_PPrBase_ind:
3740 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3741 case NS_ooxml::LN_CT_RPrDefault_rPr:
3742 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3743 case NS_ooxml::LN_CT_PPrDefault_pPr:
3744 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3745 case NS_ooxml::LN_CT_DocDefaults_pPrDefault:
3746 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3747 case NS_ooxml::LN_CT_DocDefaults_rPrDefault:
3748 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3749 case NS_ooxml::LN_CT_Style_pPr:
3750 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3751 case NS_ooxml::LN_CT_Style_rPr:
3752 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3753 case NS_ooxml::LN_CT_PPr_rPr:
3754 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3755 case NS_ooxml::LN_CT_PPrBase_numPr:
3756 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3757 resolveSprmProps(rSprm);
3758 break;
3759 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3760 case NS_ooxml::LN_EG_SectPrContents_footnotePr:
3761 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3762 case NS_ooxml::LN_EG_SectPrContents_endnotePr:
3763 m_pImpl->SetInFootnoteProperties( NS_ooxml::LN_EG_SectPrContents_footnotePr == nSprmId );
3764 resolveSprmProps(rSprm);
3765 break;
3766 case NS_ooxml::LN_EG_SectPrContents_lnNumType:
3767 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3769 resolveSprmProps(rSprm);
3770 LineNumberSettings aSettings = m_pImpl->GetLineNumberSettings();
3771 aSettings.bIsOn = true;
3772 m_pImpl->SetLineNumberSettings( aSettings );
3773 //apply settings at XLineNumberingProperties
3776 uno::Reference< text::XLineNumberingProperties > xLineNumberingProperties( m_pImpl->GetTextDocument(), uno::UNO_QUERY_THROW );
3777 uno::Reference< beans::XPropertySet > xLineNumberingPropSet = xLineNumberingProperties->getLineNumberingProperties();
3778 PropertyNameSupplier& rNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
3779 xLineNumberingPropSet->setPropertyValue(rNameSupplier.GetName( PROP_IS_ON ), uno::makeAny(true) );
3780 if( aSettings.nInterval )
3781 xLineNumberingPropSet->setPropertyValue(rNameSupplier.GetName( PROP_INTERVAL ), uno::makeAny((sal_Int16)aSettings.nInterval) );
3782 if( aSettings.nDistance )
3783 xLineNumberingPropSet->setPropertyValue(rNameSupplier.GetName( PROP_DISTANCE ), uno::makeAny(aSettings.nDistance) );
3784 xLineNumberingPropSet->setPropertyValue(rNameSupplier.GetName( PROP_RESTART_AT_EACH_PAGE ), uno::makeAny(aSettings.bRestartAtEachPage) );
3786 catch( const uno::Exception& )
3791 break;
3792 case NS_ooxml::LN_CT_PPrBase_framePr:
3794 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3795 PropertyMapPtr pContext = m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH);
3796 if( pContext.get() )
3798 ParagraphPropertyMap* pParaContext = dynamic_cast< ParagraphPropertyMap* >( pContext.get() );
3799 pParaContext->SetFrameMode();
3802 else
3804 //TODO: What about style sheet import of frame properties
3806 resolveSprmProps(rSprm);
3808 break;
3809 case NS_ooxml::LN_EG_SectPrContents_pgSz:
3810 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3811 CT_PageSz.code = 0;
3812 CT_PageSz.h = ConversionHelper::convertTwipToMM100( ConversionHelper::SnapPageDimension( sal_Int32(15840) ));
3813 CT_PageSz.w = ConversionHelper::convertTwipToMM100( ConversionHelper::SnapPageDimension( sal_Int32(12240) ));
3814 CT_PageSz.orient = false;
3815 resolveSprmProps(rSprm);
3816 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3817 if(pSectionContext)
3819 pSectionContext->Insert( PROP_HEIGHT, false, uno::makeAny( CT_PageSz.h ) );
3820 pSectionContext->Insert( PROP_IS_LANDSCAPE, false, uno::makeAny( CT_PageSz.orient ));
3821 pSectionContext->Insert( PROP_WIDTH, false, uno::makeAny( CT_PageSz.w ) );
3822 pSectionContext->SetLandscape( CT_PageSz.orient );
3824 break;
3826 case NS_ooxml::LN_EG_SectPrContents_pgMar:
3827 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3828 m_pImpl->InitPageMargins();
3829 resolveSprmProps(rSprm);
3830 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
3831 if(pSectionContext)
3833 const _PageMar& rPageMar = m_pImpl->GetPageMargins();
3834 pSectionContext->SetTopMargin( rPageMar.top );
3835 pSectionContext->SetRightMargin( rPageMar.right );
3836 pSectionContext->SetBottomMargin( rPageMar.bottom );
3837 pSectionContext->SetLeftMargin( rPageMar.left );
3838 pSectionContext->SetHeaderTop( rPageMar.header );
3839 pSectionContext->SetHeaderBottom( rPageMar.footer );
3841 break;
3843 case NS_ooxml::LN_EG_SectPrContents_cols:
3844 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3846 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
3847 if( pProperties.get())
3850 SectionColumnHandlerPtr pSectHdl( new SectionColumnHandler );
3851 pProperties->resolve(*pSectHdl);
3852 if(pSectionContext)
3854 if( pSectHdl->IsEqualWidth() )
3856 pSectionContext->SetEvenlySpaced( true );
3857 pSectionContext->SetColumnCount( (sal_Int16) (pSectHdl->GetNum() - 1) );
3858 pSectionContext->SetColumnDistance( pSectHdl->GetSpace() );
3859 pSectionContext->SetSeparatorLine( pSectHdl->IsSeparator() );
3861 else if( !pSectHdl->GetColumns().empty() )
3863 pSectionContext->SetEvenlySpaced( false );
3864 pSectionContext->SetColumnDistance( pSectHdl->GetSpace() );
3865 pSectionContext->SetColumnCount( (sal_Int16)(pSectHdl->GetColumns().size() -1));
3866 std::vector<_Column>::const_iterator tmpIter = pSectHdl->GetColumns().begin();
3867 for (; tmpIter != pSectHdl->GetColumns().end(); tmpIter++)
3869 pSectionContext->AppendColumnWidth( tmpIter->nWidth );
3870 if ((tmpIter != pSectHdl->GetColumns().end() - 1) || (tmpIter->nSpace > 0))
3871 pSectionContext->AppendColumnSpacing( tmpIter->nSpace );
3873 pSectionContext->SetSeparatorLine( pSectHdl->IsSeparator() );
3875 else if( pSectHdl->GetNum() > 0 )
3877 pSectionContext->SetColumnCount( (sal_Int16)pSectHdl->GetNum() - 1 );
3878 pSectionContext->SetColumnDistance( pSectHdl->GetSpace() );
3883 break;
3884 case NS_ooxml::LN_EG_SectPrContents_pgBorders:
3886 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
3887 if( pProperties.get( ) && pSectionContext )
3889 PageBordersHandlerPtr pHandler( new PageBordersHandler );
3890 pProperties->resolve( *pHandler );
3892 // Set the borders to the context and apply them to the styles
3893 pHandler->SetBorders( pSectionContext );
3894 pSectionContext->SetBorderParams( pHandler->GetDisplayOffset( ) );
3897 break;
3899 case NS_ooxml::LN_CT_PPrBase_pStyle:
3901 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3902 m_pImpl->SetCurrentParaStyleId( sStringValue );
3903 StyleSheetTablePtr pStyleTable = m_pImpl->GetStyleSheetTable();
3904 const ::rtl::OUString sConvertedStyleName = pStyleTable->ConvertStyleName( sStringValue, true );
3905 if (m_pImpl->GetTopContext() && m_pImpl->GetTopContextType() != CONTEXT_SECTION)
3906 m_pImpl->GetTopContext()->Insert( PROP_PARA_STYLE_NAME, true, uno::makeAny( sConvertedStyleName ));
3907 const StyleSheetEntryPtr pEntry = pStyleTable->FindStyleSheetByISTD(sStringValue);
3908 //apply numbering to paragraph if it was set at the style
3909 OSL_ENSURE( pEntry.get(), "no style sheet found" );
3910 const StyleSheetPropertyMap* pStyleSheetProperties = dynamic_cast<const StyleSheetPropertyMap*>(pEntry ? pEntry->pProperties.get() : 0);
3912 if( pStyleSheetProperties && pStyleSheetProperties->GetListId() >= 0 )
3913 rContext->Insert( PROP_NUMBERING_STYLE_NAME, true, uno::makeAny(
3914 m_pImpl->GetListTable( )->GetStyleName( pStyleSheetProperties->GetListId( ) ) ), false);
3916 if( pStyleSheetProperties && pStyleSheetProperties->GetListLevel() >= 0 )
3917 rContext->Insert( PROP_NUMBERING_LEVEL, true, uno::makeAny(pStyleSheetProperties->GetListLevel()), false);
3919 break;
3920 case NS_ooxml::LN_EG_RPrBase_rStyle:
3921 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3923 rtl::OUString sConvertedName( m_pImpl->GetStyleSheetTable()->ConvertStyleName( sStringValue, true ) );
3924 // First check if the style exists in the document.
3925 StyleSheetEntryPtr pEntry = m_pImpl->GetStyleSheetTable( )->FindStyleSheetByStyleName( sConvertedName );
3926 bool bExists = pEntry.get( ) && ( pEntry->nStyleTypeCode == STYLE_TYPE_CHAR );
3928 // Add the property if the style exists
3929 if ( bExists && m_pImpl->GetTopContext() )
3930 m_pImpl->GetTopContext()->Insert( PROP_CHAR_STYLE_NAME, true, uno::makeAny( sConvertedName ) );
3932 break;
3933 case NS_ooxml::LN_CT_TblPrBase_tblCellMar: //cell margins
3934 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3936 resolveSprmProps(rSprm);//contains LN_CT_TblCellMar_top, LN_CT_TblCellMar_left, LN_CT_TblCellMar_bottom, LN_CT_TblCellMar_right
3938 break;
3939 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
3940 case NS_ooxml::LN_CT_TblCellMar_top:
3941 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
3942 case NS_ooxml::LN_CT_TblCellMar_left:
3943 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
3944 case NS_ooxml::LN_CT_TblCellMar_bottom:
3945 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */
3946 case NS_ooxml::LN_CT_TblCellMar_right:
3948 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
3949 if( pProperties.get())
3951 MeasureHandlerPtr pMeasureHandler( new MeasureHandler );
3952 pProperties->resolve(*pMeasureHandler);
3953 sal_Int32 nMeasureValue = pMeasureHandler->getMeasureValue();
3954 PropertyIds eId = META_PROP_CELL_MAR_TOP;
3955 switch(nSprmId)
3957 case NS_ooxml::LN_CT_TblCellMar_top:
3958 break;
3959 case NS_ooxml::LN_CT_TblCellMar_left:
3960 eId = META_PROP_CELL_MAR_LEFT;
3961 break;
3962 case NS_ooxml::LN_CT_TblCellMar_bottom:
3963 eId = META_PROP_CELL_MAR_BOTTOM;
3964 break;
3965 case NS_ooxml::LN_CT_TblCellMar_right:
3966 eId = META_PROP_CELL_MAR_RIGHT;
3967 break;
3968 default:;
3970 rContext->Insert( eId, false, uno::makeAny(nMeasureValue), false);
3973 break;
3974 case NS_sprm::LN_CFNoProof: //0x875 no grammar and spell checking, unsupported
3975 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
3976 break;
3977 case NS_ooxml::LN_anchor_anchor: // at_character drawing
3978 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3979 case NS_ooxml::LN_inline_inline: // as_character drawing
3980 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
3982 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
3983 if( pProperties.get())
3985 GraphicImportType eGraphicType =
3986 (NS_ooxml::LN_anchor_anchor ==
3987 sal::static_int_cast<Id>(nSprmId)) ?
3988 IMPORT_AS_DETECTED_ANCHOR :
3989 IMPORT_AS_DETECTED_INLINE;
3990 GraphicImportPtr pGraphicImport =
3991 m_pImpl->GetGraphicImport(eGraphicType);
3992 pProperties->resolve(*pGraphicImport);
3993 m_pImpl->ImportGraphic(pProperties, eGraphicType);
3994 if( !pGraphicImport->IsGraphic() )
3996 m_pImpl->ResetGraphicImport();
3997 // todo: It's a shape, now start shape import
4001 break;
4002 case NS_ooxml::LN_EG_RPrBase_vertAlign:
4003 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
4005 sal_Int16 nEscapement = 0;
4006 sal_Int8 nProp = 58;
4007 if( sStringValue.equalsAscii( "superscript" ))
4008 nEscapement = 101;
4009 else if( sStringValue.equalsAscii( "subscript" ))
4010 nEscapement = -101;
4011 else
4012 nProp = 100;
4014 rContext->Insert(PROP_CHAR_ESCAPEMENT, true, uno::makeAny( nEscapement ) );
4015 rContext->Insert(PROP_CHAR_ESCAPEMENT_HEIGHT, true, uno::makeAny( nProp ) );
4017 break;
4018 // case NS_ooxml::LN_CT_FtnEdn_type
4019 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
4020 // case NS_ooxml::LN_CT_FtnEdn_id
4021 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
4022 // case NS_ooxml::LN_EG_FtnEdnNumProps_numRestart
4023 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
4024 case NS_ooxml::LN_CT_FtnProps_pos:
4025 //footnotes in word can be at page end or beneath text - writer supports only the first
4026 //endnotes in word can be at section end or document end - writer supports only the latter
4027 // -> so this property can be ignored
4028 break;
4029 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
4030 case NS_ooxml::LN_EG_FtnEdnNumProps_numStart:
4031 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
4032 case NS_ooxml::LN_CT_FtnProps_numFmt:
4033 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
4034 case NS_ooxml::LN_CT_EdnProps_numFmt:
4038 uno::Reference< beans::XPropertySet > xFtnEdnSettings;
4039 if( m_pImpl->IsInFootnoteProperties() )
4041 uno::Reference< text::XFootnotesSupplier> xFootnotesSupplier( m_pImpl->GetTextDocument(), uno::UNO_QUERY );
4042 xFtnEdnSettings = xFootnotesSupplier->getFootnoteSettings();
4044 else
4046 uno::Reference< text::XEndnotesSupplier> xEndnotesSupplier( m_pImpl->GetTextDocument(), uno::UNO_QUERY );
4047 xFtnEdnSettings = xEndnotesSupplier->getEndnoteSettings();
4049 if( NS_ooxml::LN_EG_FtnEdnNumProps_numStart == nSprmId )
4051 xFtnEdnSettings->setPropertyValue(
4052 PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_START_AT),
4053 uno::makeAny( sal_Int16( nIntValue - 1 )));
4055 else
4057 sal_Int16 nNumType = ConversionHelper::ConvertNumberingType( nIntValue );
4058 xFtnEdnSettings->setPropertyValue(
4059 PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_NUMBERING_TYPE),
4060 uno::makeAny( nNumType ));
4063 catch( const uno::Exception& )
4067 break;
4068 case NS_ooxml::LN_paratrackchange:
4069 m_pImpl->StartParaChange( );
4070 case NS_ooxml::LN_trackchange:
4071 /* WRITERFILTERSTATUS: done: 100, planned: 5, spent: 0 */
4072 case NS_ooxml::LN_EG_RPrContent_rPrChange:
4073 /* WRITERFILTERSTATUS: done: 100, planned: 5, spent: 0 */
4075 m_pImpl->AddNewRedline( );
4076 resolveSprmProps( rSprm );
4077 // now the properties author, date and id should be available
4078 sal_Int32 nToken = m_pImpl->GetCurrentRedlineToken();
4079 switch( nToken & 0xffff )
4081 case ooxml::OOXML_mod :
4082 case ooxml::OOXML_ins :
4083 case ooxml::OOXML_del : break;
4084 default: OSL_ENSURE( false, "redline token other than mod, ins or del" );
4086 m_pImpl->EndParaChange( );
4088 break;
4089 case NS_ooxml::LN_CT_RPrChange_rPr:
4090 /* WRITERFILTERSTATUS: done: 100, planned: 5, spent: 0 */
4091 break;
4092 /* WRITERFILTERSTATUS: done: 0, planned: 4, spent: 0 */
4093 case NS_ooxml::LN_object:
4095 #if DEBUG
4096 clog << "DomainMapper: LN_object" << endl;
4097 #endif
4098 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
4099 if( pProperties.get( ) )
4101 OLEHandlerPtr pOLEHandler( new OLEHandler );
4102 pProperties->resolve(*pOLEHandler);
4103 if ( pOLEHandler->isOLEObject( ) )
4105 ::rtl::OUString sStreamName = pOLEHandler->copyOLEOStream( m_pImpl->GetTextDocument() );
4106 if( sStreamName.getLength() )
4108 m_pImpl->appendOLE( sStreamName, pOLEHandler );
4113 break;
4114 // case NS_ooxml::LN_CT_EdnProps_pos
4115 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
4116 // case NS_ooxml::LN_CT_EdnProps_numFmt
4117 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
4118 // case NS_ooxml::LN_CT_FtnDocProps_footnote
4119 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
4120 // case NS_ooxml::LN_CT_EdnDocProps_endnote
4121 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
4122 //break;
4123 case NS_ooxml::LN_EG_HdrFtrReferences_headerReference: // header reference - not needed
4124 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
4125 case NS_ooxml::LN_EG_HdrFtrReferences_footerReference: // footer reference - not needed
4126 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
4127 break;
4128 case NS_ooxml::LN_EG_RPrBase_snapToGrid: // "Use document grid settings for inter-paragraph spacing"
4129 break;
4130 case NS_sprm::LN_PContextualSpacing:
4131 //TODO: determines whether top/bottom paragraph spacing is added if equal styles are following - unsupported
4132 break;
4133 case NS_ooxml::LN_EG_SectPrContents_formProt: //section protection, only form editing is enabled - unsupported
4134 break;
4135 case NS_ooxml::LN_CT_Lvl_pStyle:
4136 //TODO: numbering style should apply current numbering level - not yet supported
4137 break;
4138 default:
4140 #if OSL_DEBUG_LEVEL > 0
4141 ::rtl::OString sMessage( "DomainMapper::sprm() - Id: ");
4142 sMessage += ::rtl::OString::valueOf( sal_Int32( nSprmId ), 10 );
4143 sMessage += ::rtl::OString(" / 0x");
4144 sMessage += ::rtl::OString::valueOf( sal_Int32( nSprmId ), 16 );
4145 sMessage += ::rtl::OString(" / ");
4146 sMessage += ::rtl::OString( rSprm.getName( ).c_str( ) );
4147 clog << sMessage.getStr( ) << endl;
4148 // OSL_ENSURE( false, sMessage.getStr()); //
4149 #endif
4153 #ifdef DEBUG_DOMAINMAPPER
4154 dmapper_logger->endElement("sprm");
4155 #endif
4157 /*-- 09.06.2006 09:52:13---------------------------------------------------
4159 -----------------------------------------------------------------------*/
4160 void DomainMapper::entry(int /*pos*/,
4161 writerfilter::Reference<Properties>::Pointer_t ref)
4163 ref->resolve(*this);
4165 /*-- 09.06.2006 09:52:13---------------------------------------------------
4167 -----------------------------------------------------------------------*/
4168 void DomainMapper::data(const sal_uInt8* /*buf*/, size_t /*len*/,
4169 writerfilter::Reference<Properties>::Pointer_t /*ref*/)
4172 /*-- 09.06.2006 09:52:13---------------------------------------------------
4174 -----------------------------------------------------------------------*/
4175 void DomainMapper::startSectionGroup()
4177 #ifdef DEBUG_DOMAINMAPPER
4178 dmapper_logger->startElement("section");
4179 #endif
4180 m_pImpl->PushProperties(CONTEXT_SECTION);
4182 /*-- 09.06.2006 09:52:13---------------------------------------------------
4184 -----------------------------------------------------------------------*/
4185 void DomainMapper::endSectionGroup()
4187 PropertyMapPtr pContext = m_pImpl->GetTopContextOfType(CONTEXT_SECTION);
4188 SectionPropertyMap* pSectionContext = dynamic_cast< SectionPropertyMap* >( pContext.get() );
4189 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
4190 if(pSectionContext)
4191 pSectionContext->CloseSectionGroup( *m_pImpl );
4192 m_pImpl->PopProperties(CONTEXT_SECTION);
4194 #ifdef DEBUG_DOMAINMAPPER
4195 dmapper_logger->endElement("section");
4196 #endif
4198 /*-- 09.06.2006 09:52:13---------------------------------------------------
4200 -----------------------------------------------------------------------*/
4201 void DomainMapper::startParagraphGroup()
4203 #ifdef DEBUG_DOMAINMAPPER
4204 dmapper_logger->startElement("paragraph");
4205 #endif
4207 m_pImpl->getTableManager().startParagraphGroup();
4208 m_pImpl->PushProperties(CONTEXT_PARAGRAPH);
4209 static ::rtl::OUString sDefault( ::rtl::OUString::createFromAscii("Standard") );
4210 if (m_pImpl->GetTopContext())
4212 m_pImpl->GetTopContext()->Insert( PROP_PARA_STYLE_NAME, true, uno::makeAny( sDefault ) );
4213 if (m_pImpl->isBreakDeferred(PAGE_BREAK))
4214 m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_PAGE_BEFORE) );
4215 else if (m_pImpl->isBreakDeferred(COLUMN_BREAK))
4216 m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_COLUMN_BEFORE) );
4218 m_pImpl->clearDeferredBreaks();
4220 /*-- 09.06.2006 09:52:14---------------------------------------------------
4222 -----------------------------------------------------------------------*/
4223 void DomainMapper::endParagraphGroup()
4225 m_pImpl->PopProperties(CONTEXT_PARAGRAPH);
4226 m_pImpl->getTableManager().endParagraphGroup();
4227 //frame conversion has to be executed after table conversion
4228 m_pImpl->ExecuteFrameConversion();
4229 #ifdef DEBUG_DOMAINMAPPER
4230 dmapper_logger->endElement("paragraph");
4231 #endif
4234 void DomainMapper::markLastParagraphInSection( )
4236 #ifdef DEBUG_DOMAINMAPPER
4237 dmapper_logger->element( "markLastParagraphInSection" );
4238 #endif
4239 m_pImpl->SetIsLastParagraphInSection( true );
4242 void DomainMapper::startShape( uno::Reference< drawing::XShape > xShape )
4244 m_pImpl->PushShapeContext( xShape );
4247 void DomainMapper::endShape( )
4249 m_pImpl->PopShapeContext( );
4252 /*-- 13.06.2007 16:15:55---------------------------------------------------
4254 -----------------------------------------------------------------------*/
4255 void DomainMapper::PushStyleSheetProperties( PropertyMapPtr pStyleProperties, bool bAffectTableMngr )
4257 m_pImpl->PushStyleProperties( pStyleProperties );
4258 if ( bAffectTableMngr )
4259 m_pImpl->getTableManager( ).SetStyleProperties( pStyleProperties );
4261 /*-- 13.06.2007 16:15:55---------------------------------------------------
4263 -----------------------------------------------------------------------*/
4264 void DomainMapper::PopStyleSheetProperties( bool bAffectTableMngr )
4266 m_pImpl->PopProperties( CONTEXT_STYLESHEET );
4267 if ( bAffectTableMngr )
4269 PropertyMapPtr emptyPtr;
4270 m_pImpl->getTableManager( ).SetStyleProperties( emptyPtr );
4273 /*-- 28.01.2008 14:52:33---------------------------------------------------
4275 -----------------------------------------------------------------------*/
4276 void DomainMapper::PushListProperties( ::boost::shared_ptr<PropertyMap> pListProperties )
4278 m_pImpl->PushListProperties( pListProperties );
4280 /*-- 28.01.2008 14:52:33---------------------------------------------------
4282 -----------------------------------------------------------------------*/
4283 void DomainMapper::PopListProperties()
4285 m_pImpl->PopProperties( CONTEXT_LIST );
4287 /*-- 09.06.2006 09:52:14---------------------------------------------------
4289 -----------------------------------------------------------------------*/
4291 void DomainMapper::startCharacterGroup()
4293 #ifdef DEBUG_DOMAINMAPPER
4294 dmapper_logger->startElement("charactergroup");
4295 #endif
4297 m_pImpl->PushProperties(CONTEXT_CHARACTER);
4298 DomainMapperTableManager& rTableManager = m_pImpl->getTableManager();
4299 if( rTableManager.getTableStyleName().getLength() )
4301 PropertyMapPtr pTopContext = m_pImpl->GetTopContext();
4302 rTableManager.CopyTextProperties(pTopContext, m_pImpl->GetStyleSheetTable());
4305 /*-- 09.06.2006 09:52:14---------------------------------------------------
4307 -----------------------------------------------------------------------*/
4308 void DomainMapper::endCharacterGroup()
4310 m_pImpl->PopProperties(CONTEXT_CHARACTER);
4312 #ifdef DEBUG_DOMAINMAPPER
4313 dmapper_logger->endElement("charactergroup");
4314 #endif
4316 /*-- 09.06.2006 09:52:14---------------------------------------------------
4318 -----------------------------------------------------------------------*/
4319 void DomainMapper::text(const sal_uInt8 * data_, size_t len)
4321 //TODO: Determine the right text encoding (FIB?)
4322 ::rtl::OUString sText( (const sal_Char*) data_, len, RTL_TEXTENCODING_MS_1252 );
4325 if(len == 1)
4327 switch(*data_)
4329 case 0x02: return; //footnote character
4330 case 0x0c: //page break
4331 m_pImpl->deferBreak(PAGE_BREAK);
4332 return;
4333 case 0x0e: //column break
4334 m_pImpl->deferBreak(COLUMN_BREAK);
4335 return;
4336 case 0x07:
4337 m_pImpl->getTableManager().text(data_, len);
4338 case 0x0d:
4339 m_pImpl->finishParagraph(m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH));
4340 return;
4341 case 0x13:
4342 m_pImpl->PushFieldContext();
4343 return;
4344 case 0x14:
4345 // delimiter not necessarily available
4346 // appears only if field contains further content
4347 m_pImpl->CloseFieldCommand();
4348 return;
4349 case 0x15: /* end of field */
4350 m_pImpl->PopFieldContext();
4351 return;
4352 default:
4353 break;
4357 PropertyMapPtr pContext = m_pImpl->GetTopContext();
4358 if ( pContext && !pContext->GetFootnote().is() )
4360 if (m_pImpl->isBreakDeferred(PAGE_BREAK))
4361 m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_PAGE_BEFORE) );
4362 else if (m_pImpl->isBreakDeferred(COLUMN_BREAK))
4363 m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_COLUMN_BEFORE) );
4364 m_pImpl->clearDeferredBreaks();
4367 if( pContext->GetFootnote().is() && m_pImpl->IsCustomFtnMark() )
4369 pContext->GetFootnote()->setLabel( sText );
4370 m_pImpl->SetCustomFtnMark( false );
4371 //otherwise ignore sText
4373 else if( m_pImpl->IsOpenFieldCommand() )
4374 m_pImpl->AppendFieldCommand(sText);
4375 else if( m_pImpl->IsOpenField() && m_pImpl->IsFieldResultAsString())
4376 /*depending on the success of the field insert operation this result will be
4377 set at the field or directly inserted into the text*/
4378 m_pImpl->SetFieldResult( sText );
4379 else
4381 //--> debug
4382 //sal_uInt32 nSize = pContext->size();
4383 //<--
4385 m_pImpl->appendTextPortion( sText, pContext );
4386 #ifdef DEBUG_DOMAINMAPPER
4387 dmapper_logger->startElement("text");
4388 dmapper_logger->chars(sText);
4389 dmapper_logger->endElement("text");
4390 #endif
4393 catch( const uno::RuntimeException& )
4395 std::clog << __FILE__ << "(l" << __LINE__ << ")" << std::endl;
4398 /*-- 09.06.2006 09:52:15---------------------------------------------------
4400 -----------------------------------------------------------------------*/
4401 void DomainMapper::utext(const sal_uInt8 * data_, size_t len)
4403 OUString sText;
4404 OUStringBuffer aBuffer = OUStringBuffer(len);
4405 aBuffer.append( (const sal_Unicode *) data_, len);
4406 sText = aBuffer.makeStringAndClear();
4409 m_pImpl->getTableManager().utext(data_, len);
4411 if(len == 1 && ((*data_) == 0x0d || (*data_) == 0x07))
4412 m_pImpl->finishParagraph(m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH));
4413 else
4416 PropertyMapPtr pContext = m_pImpl->GetTopContext();
4417 if ( pContext && !pContext->GetFootnote().is() )
4419 if (m_pImpl->isBreakDeferred(PAGE_BREAK))
4420 m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_PAGE_BEFORE) );
4421 else if (m_pImpl->isBreakDeferred(COLUMN_BREAK))
4422 m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_COLUMN_BEFORE) );
4423 m_pImpl->clearDeferredBreaks();
4426 /* doesn't seem to be working
4427 if( pContext->GetFootnote().is() )
4429 //todo: the check for 0x0a is a hack!
4430 if( *data_ != 0x0a && !pContext->GetFootnoteSymbol() )
4431 pContext->GetFootnote()->setLabel( sText );
4432 //otherwise ignore sText
4434 else */
4435 if( pContext->GetFootnote().is() )
4437 if( !pContext->GetFootnoteSymbol() )
4438 pContext->GetFootnote()->setLabel( sText );
4439 //otherwise ignore sText
4441 else if( m_pImpl->IsOpenFieldCommand() )
4442 m_pImpl->AppendFieldCommand(sText);
4443 else if( m_pImpl->IsOpenField() && m_pImpl->IsFieldResultAsString())
4444 /*depending on the success of the field insert operation this result will be
4445 set at the field or directly inserted into the text*/
4446 m_pImpl->SetFieldResult( sText );
4447 else
4448 m_pImpl->appendTextPortion( sText, pContext );
4450 #ifdef DEBUG_DOMAINMAPPER
4451 dmapper_logger->startElement("utext");
4452 dmapper_logger->chars(sText);
4453 dmapper_logger->endElement("utext");
4454 #endif
4457 catch( const uno::RuntimeException& )
4461 /*-- 09.06.2006 09:52:15---------------------------------------------------
4463 -----------------------------------------------------------------------*/
4464 void DomainMapper::props(writerfilter::Reference<Properties>::Pointer_t ref)
4466 #ifdef DEBUG_DOMAINMAPPER
4467 dmapper_logger->startElement("props");
4468 #endif
4470 string sType = ref->getType();
4471 if( sType == "PICF" )
4473 m_pImpl->ImportGraphic(ref, IMPORT_AS_GRAPHIC);
4475 else if( sType == "FSPA" )
4477 m_pImpl->ImportGraphic(ref, IMPORT_AS_SHAPE);
4479 else
4480 ref->resolve(*this);
4482 #ifdef DEBUG_DOMAINMAPPER
4483 dmapper_logger->endElement("props");
4484 #endif
4486 /*-- 09.06.2006 09:52:15---------------------------------------------------
4488 -----------------------------------------------------------------------*/
4489 void DomainMapper::table(Id name, writerfilter::Reference<Table>::Pointer_t ref)
4491 #ifdef DEBUG_DOMAINMAPPER
4492 dmapper_logger->startElement("table");
4493 dmapper_logger->attribute("id", (*QNameToString::Instance())(name));
4494 #endif
4496 // printf ( "DomainMapper::table(0x%.4x)\n", (unsigned int)name);
4497 m_pImpl->SetAnyTableImport(true);
4498 /* WRITERFILTERSTATUS: table: attributedata */
4499 switch(name)
4501 case NS_rtf::LN_FONTTABLE:
4502 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
4504 // create a font table object that listens to the attributes
4505 // each entry call inserts a new font entry
4506 ref->resolve( *m_pImpl->GetFontTable() );
4507 break;
4508 case NS_rtf::LN_STYLESHEET:
4509 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
4510 //same as above to import style sheets
4511 m_pImpl->SetStyleSheetImport( true );
4512 ref->resolve( *m_pImpl->GetStyleSheetTable() );
4513 m_pImpl->GetStyleSheetTable()->ApplyStyleSheets(m_pImpl->GetFontTable());
4514 m_pImpl->SetStyleSheetImport( false );
4515 break;
4516 case NS_ooxml::LN_NUMBERING:
4517 case NS_rtf::LN_LISTTABLE:
4519 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
4521 //the same for list tables
4522 ref->resolve( *m_pImpl->GetListTable() );
4523 m_pImpl->GetListTable( )->CreateNumberingRules( );
4525 break;
4526 case NS_rtf::LN_LFOTABLE:
4527 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
4529 ref->resolve( *m_pImpl->GetLFOTable() );
4530 break;
4531 case NS_ooxml::LN_THEMETABLE:
4532 ref->resolve ( *m_pImpl->GetThemeTable() );
4533 break;
4534 case NS_ooxml::LN_SETTINGS:
4535 ref->resolve( *m_pImpl->GetSettingsTable( ) );
4536 break;
4537 default:
4538 OSL_ENSURE( false, "which table is to be filled here?");
4540 m_pImpl->SetAnyTableImport(false);
4542 #ifdef DEBUG_DOMAINMAPPER
4543 dmapper_logger->endElement("table");
4544 #endif
4546 /*-- 09.06.2006 09:52:16---------------------------------------------------
4548 -----------------------------------------------------------------------*/
4549 void DomainMapper::substream(Id rName, ::writerfilter::Reference<Stream>::Pointer_t ref)
4551 #ifdef DEBUG_DOMAINMAPPER
4552 dmapper_logger->startElement("substream");
4553 #endif
4555 m_pImpl->appendTableManager( );
4556 m_pImpl->getTableManager().startLevel();
4558 //->debug
4559 //string sName = (*QNameToString::Instance())(rName);
4560 //--<debug
4561 //import of page header/footer
4563 /* WRITERFILTERSTATUS: table: attributedata */
4564 switch( rName )
4566 case NS_rtf::LN_headerl:
4567 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */
4569 m_pImpl->PushPageHeader(SectionPropertyMap::PAGE_LEFT);
4570 break;
4571 case NS_rtf::LN_headerr:
4572 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */
4574 m_pImpl->PushPageHeader(SectionPropertyMap::PAGE_RIGHT);
4575 break;
4576 case NS_rtf::LN_headerf:
4577 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */
4579 m_pImpl->PushPageHeader(SectionPropertyMap::PAGE_FIRST);
4580 break;
4581 case NS_rtf::LN_footerl:
4582 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */
4584 m_pImpl->PushPageFooter(SectionPropertyMap::PAGE_LEFT);
4585 break;
4586 case NS_rtf::LN_footerr:
4587 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */
4589 m_pImpl->PushPageFooter(SectionPropertyMap::PAGE_RIGHT);
4590 break;
4591 case NS_rtf::LN_footerf:
4592 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */
4594 m_pImpl->PushPageFooter(SectionPropertyMap::PAGE_FIRST);
4595 break;
4596 case NS_rtf::LN_footnote:
4597 case NS_rtf::LN_endnote:
4598 m_pImpl->PushFootOrEndnote( NS_rtf::LN_footnote == rName );
4599 break;
4600 case NS_rtf::LN_annotation :
4601 m_pImpl->PushAnnotation();
4602 break;
4604 ref->resolve(*this);
4605 switch( rName )
4607 case NS_rtf::LN_headerl:
4608 case NS_rtf::LN_headerr:
4609 case NS_rtf::LN_headerf:
4610 case NS_rtf::LN_footerl:
4611 case NS_rtf::LN_footerr:
4612 case NS_rtf::LN_footerf:
4613 m_pImpl->PopPageHeaderFooter();
4614 break;
4615 case NS_rtf::LN_footnote:
4616 case NS_rtf::LN_endnote:
4617 m_pImpl->PopFootOrEndnote();
4618 break;
4619 case NS_rtf::LN_annotation :
4620 m_pImpl->PopAnnotation();
4621 break;
4624 m_pImpl->getTableManager().endLevel();
4625 m_pImpl->popTableManager( );
4627 #ifdef DEBUG_DOMAINMAPPER
4628 dmapper_logger->endElement("substream");
4629 #endif
4631 /*-- 09.06.2006 09:52:16---------------------------------------------------
4633 -----------------------------------------------------------------------*/
4634 void DomainMapper::info(const string & /*info_*/)
4638 void DomainMapper::handleUnderlineType(const sal_Int32 nIntValue, const ::boost::shared_ptr<PropertyMap> pContext)
4640 sal_Int16 eUnderline = awt::FontUnderline::NONE;
4642 switch(nIntValue)
4644 case 0: eUnderline = awt::FontUnderline::NONE; break;
4645 case 2: pContext->Insert(PROP_CHAR_WORD_MODE, true, uno::makeAny( true ) ); // TODO: how to get rid of it?
4646 case 1: eUnderline = awt::FontUnderline::SINGLE; break;
4647 case 3: eUnderline = awt::FontUnderline::DOUBLE; break;
4648 case 4: eUnderline = awt::FontUnderline::DOTTED; break;
4649 case 7: eUnderline = awt::FontUnderline::DASH; break;
4650 case 9: eUnderline = awt::FontUnderline::DASHDOT; break;
4651 case 10:eUnderline = awt::FontUnderline::DASHDOTDOT; break;
4652 case 6: eUnderline = awt::FontUnderline::BOLD; break;
4653 case 11:eUnderline = awt::FontUnderline::WAVE; break;
4654 case 20:eUnderline = awt::FontUnderline::BOLDDOTTED; break;
4655 case 23:eUnderline = awt::FontUnderline::BOLDDASH; break;
4656 case 39:eUnderline = awt::FontUnderline::LONGDASH; break;
4657 case 55:eUnderline = awt::FontUnderline::BOLDLONGDASH; break;
4658 case 25:eUnderline = awt::FontUnderline::BOLDDASHDOT; break;
4659 case 26:eUnderline = awt::FontUnderline::BOLDDASHDOTDOT;break;
4660 case 27:eUnderline = awt::FontUnderline::BOLDWAVE; break;
4661 case 43:eUnderline = awt::FontUnderline::DOUBLEWAVE; break;
4662 default: ;
4664 pContext->Insert(PROP_CHAR_UNDERLINE, true, uno::makeAny( eUnderline ) );
4667 void DomainMapper::handleParaJustification(const sal_Int32 nIntValue, const ::boost::shared_ptr<PropertyMap> pContext, const bool bExchangeLeftRight)
4669 sal_Int16 nAdjust = 0;
4670 sal_Int16 nLastLineAdjust = 0;
4671 switch(nIntValue)
4673 case 1:
4674 nAdjust = style::ParagraphAdjust_CENTER;
4675 break;
4676 case 2:
4677 nAdjust = static_cast< sal_Int16 > (bExchangeLeftRight ? style::ParagraphAdjust_LEFT : style::ParagraphAdjust_RIGHT);
4678 break;
4679 case 4:
4680 nLastLineAdjust = style::ParagraphAdjust_BLOCK;
4681 //no break;
4682 case 3:
4683 nAdjust = style::ParagraphAdjust_BLOCK;
4684 break;
4685 case 0:
4686 default:
4687 nAdjust = static_cast< sal_Int16 > (bExchangeLeftRight ? style::ParagraphAdjust_RIGHT : style::ParagraphAdjust_LEFT);
4688 break;
4690 pContext->Insert( PROP_PARA_ADJUST, true, uno::makeAny( nAdjust ) );
4691 pContext->Insert( PROP_PARA_LAST_LINE_ADJUST, true, uno::makeAny( nLastLineAdjust ) );
4694 bool DomainMapper::getColorFromIndex(const sal_Int32 nIndex, sal_Int32 &nColor)
4696 nColor = 0;
4697 if ((nIndex < 1) || (nIndex > 16))
4698 return false;
4700 switch (nIndex)
4702 case 1: nColor=0x000000; break; //black
4703 case 2: nColor=0x0000ff; break; //blue
4704 case 3: nColor=0x00ffff; break; //cyan
4705 case 4: nColor=0x00ff00; break; //green
4706 case 5: nColor=0xff00ff; break; //magenta
4707 case 6: nColor=0xff0000; break; //red
4708 case 7: nColor=0xffff00; break; //yellow
4709 case 8: nColor=0xffffff; break; //white
4710 case 9: nColor=0x000080; break;//dark blue
4711 case 10: nColor=0x008080; break; //dark cyan
4712 case 11: nColor=0x008000; break; //dark green
4713 case 12: nColor=0x800080; break; //dark magenta
4714 case 13: nColor=0x800000; break; //dark red
4715 case 14: nColor=0x808000; break; //dark yellow
4716 case 15: nColor=0x808080; break; //dark gray
4717 case 16: nColor=0xC0C0C0; break; //light gray
4718 default:
4719 return false;
4721 return true;
4724 sal_Int16 DomainMapper::getEmphasisValue(const sal_Int32 nIntValue)
4726 switch (nIntValue)
4728 case 1:
4729 return com::sun::star::text::FontEmphasis::DOT_ABOVE;
4730 case 2:
4731 return com::sun::star::text::FontEmphasis::ACCENT_ABOVE;
4732 case 3:
4733 return com::sun::star::text::FontEmphasis::CIRCLE_ABOVE;
4734 case 4:
4735 return com::sun::star::text::FontEmphasis::DOT_BELOW;
4736 default:
4737 return com::sun::star::text::FontEmphasis::NONE;
4741 rtl::OUString DomainMapper::getBracketStringFromEnum(const sal_Int32 nIntValue, const bool bIsPrefix)
4743 switch(nIntValue)
4745 case 1:
4746 if (bIsPrefix)
4747 return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "(" ));
4748 return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( ")" ));
4750 case 2:
4751 if (bIsPrefix)
4752 return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "[" ));
4753 return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "]" ));
4755 case 3:
4756 if (bIsPrefix)
4757 return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "<" ));
4758 return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( ">" ));
4760 case 4:
4761 if (bIsPrefix)
4762 return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "{" ));
4763 return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "}" ));
4765 case 0:
4766 default:
4767 return rtl::OUString();
4771 void DomainMapper::resolveSprmProps(Sprm & rSprm)
4773 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
4774 if( pProperties.get())
4775 pProperties->resolve(*this);
4778 void DomainMapper::resolveAttributeProperties(Value & val)
4780 writerfilter::Reference<Properties>::Pointer_t pProperties = val.getProperties();
4781 if( pProperties.get())
4782 pProperties->resolve(*this);
4786 com::sun::star::style::TabAlign DomainMapper::getTabAlignFromValue(const sal_Int32 nIntValue)
4788 switch (nIntValue)
4790 case 0:
4791 case 4: // bar not supported
4792 return com::sun::star::style::TabAlign_LEFT;
4793 case 1:
4794 return com::sun::star::style::TabAlign_CENTER;
4795 case 2:
4796 return com::sun::star::style::TabAlign_RIGHT;
4797 case 3:
4798 return com::sun::star::style::TabAlign_DECIMAL;
4799 default:
4800 return com::sun::star::style::TabAlign_DEFAULT;
4802 return com::sun::star::style::TabAlign_LEFT;
4805 sal_Unicode DomainMapper::getFillCharFromValue(const sal_Int32 nIntValue)
4807 switch (nIntValue)
4809 case 1: // dot
4810 return sal_Unicode(0x002e);
4811 case 2: // hyphen
4812 return sal_Unicode(0x002d);
4813 case 3: // underscore
4814 case 4: // heavy FIXME ???
4815 return sal_Unicode(0x005f);
4816 case NS_ooxml::LN_Value_ST_TabTlc_middleDot: // middleDot
4817 return sal_Unicode(0x00b7);
4818 case 0: // none
4819 default:
4820 return sal_Unicode(0x0020); // blank space
4823 /*-- 18.07.2007 14:59:00---------------------------------------------------
4825 -----------------------------------------------------------------------*/
4826 bool DomainMapper::IsOOXMLImport() const
4828 return m_pImpl->IsOOXMLImport();
4830 /*-- 18.07.2007 16:03:14---------------------------------------------------
4832 -----------------------------------------------------------------------*/
4833 uno::Reference < lang::XMultiServiceFactory > DomainMapper::GetTextFactory() const
4835 return m_pImpl->GetTextFactory();
4837 /*-- 12.11.2007 10:41:01---------------------------------------------------
4839 -----------------------------------------------------------------------*/
4840 void DomainMapper::AddListIDToLFOTable( sal_Int32 nAbstractNumId )
4842 m_pImpl->GetLFOTable()->AddListID( nAbstractNumId );
4844 /*-- 31.01.2008 18:19:44---------------------------------------------------
4846 -----------------------------------------------------------------------*/
4847 uno::Reference< text::XTextRange > DomainMapper::GetCurrentTextRange()
4849 return m_pImpl->GetTopTextAppend()->getEnd();
4852 /*-- 05.02.2008 10:26:26---------------------------------------------------
4854 -----------------------------------------------------------------------*/
4855 ::rtl::OUString DomainMapper::getOrCreateCharStyle( PropertyValueVector_t& rCharProperties )
4857 StyleSheetTablePtr pStyleSheets = m_pImpl->GetStyleSheetTable();
4858 return pStyleSheets->getOrCreateCharStyle( rCharProperties );
4861 ListTablePtr DomainMapper::GetListTable( )
4863 return m_pImpl->GetListTable( );
4866 } //namespace dmapper
4867 } //namespace writerfilter