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