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