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_CT_Comment_initials: 2078 m_pImpl->SetCurrentRedlineInitials(sStringValue); 2079 break; 2080 case NS_ooxml::LN_EG_RangeMarkupElements_commentRangeStart: 2081 m_pImpl->AddAnnotationPosition( true, nIntValue ); 2082 break; 2083 case NS_ooxml::LN_EG_RangeMarkupElements_commentRangeEnd: 2084 m_pImpl->AddAnnotationPosition( false, nIntValue ); 2085 break; 2086 case NS_ooxml::LN_token: 2087 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 2088 m_pImpl->SetCurrentRedlineToken( nIntValue ); 2089 break; 2090 case NS_ooxml::LN_CT_LineNumber_countBy: 2091 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */ 2092 case NS_ooxml::LN_CT_LineNumber_restart: 2093 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */ 2094 { 2095 //line numbering in Writer is a global document setting 2096 //in Word is a section setting 2097 //if line numbering is switched on anywhere in the document it's set at the global settings 2098 LineNumberSettings aSettings = m_pImpl->GetLineNumberSettings(); 2099 switch( nName ) 2100 { 2101 case NS_ooxml::LN_CT_LineNumber_countBy: 2102 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 2103 aSettings.nInterval = nIntValue; 2104 break; 2105 case NS_ooxml::LN_CT_LineNumber_start: 2106 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 2107 aSettings.nStartValue = nIntValue; // todo: has to be set at (each) first paragraph 2108 break; 2109 case NS_ooxml::LN_CT_LineNumber_distance: 2110 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 2111 aSettings.nDistance = ConversionHelper::convertTwipToMM100( nIntValue ); 2112 break; 2113 case NS_ooxml::LN_CT_LineNumber_restart: 2114 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 2115 //page:empty, probably 0,section:1,continuous:2; 2116 aSettings.bRestartAtEachPage = nIntValue < 1; 2117 break; 2118 default:; 2119 } 2120 m_pImpl->SetLineNumberSettings( aSettings ); 2121 } 2122 break; 2123 case NS_ooxml::LN_CT_FtnEdnRef_customMarkFollows: 2124 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 2125 m_pImpl->SetCustomFtnMark( true ); 2126 break; 2127 case NS_ooxml::LN_CT_FtnEdnRef_id: 2128 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */ 2129 // footnote or endnote reference id - not needed 2130 case NS_ooxml::LN_CT_Color_themeColor: 2131 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */ 2132 case NS_ooxml::LN_CT_Color_themeTint: 2133 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */ 2134 case NS_ooxml::LN_CT_Color_themeShade: 2135 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */ 2136 //unsupported 2137 break; 2138 case NS_ooxml::LN_endtrackchange: 2139 m_pImpl->RemoveCurrentRedline( ); 2140 break; 2141 case NS_ooxml::LN_CT_DocGrid_linePitch: 2142 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 2143 { 2144 //see SwWW8ImplReader::SetDocumentGrid 2145 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 2146 if(pSectionContext) 2147 { 2148 pSectionContext->SetGridLinePitch( ConversionHelper::convertTwipToMM100( nIntValue ) ); 2149 } 2150 } 2151 break; 2152 case NS_ooxml::LN_CT_DocGrid_charSpace: 2153 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 2154 { 2155 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 2156 if(pSectionContext) 2157 { 2158 pSectionContext->SetDxtCharSpace( nIntValue ); 2159 } 2160 } 2161 break; 2162 case NS_ooxml::LN_CT_DocGrid_type: 2163 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 2164 { 2165 if (pSectionContext != NULL) 2166 { 2167 pSectionContext->SetGridType(nIntValue); 2168 } 2169 } 2170 break; 2171 default: 2172 { 2173 #if OSL_DEBUG_LEVEL > 0 2174 ::rtl::OString sMessage( "DomainMapper::attribute() - Id: "); 2175 sMessage += ::rtl::OString::valueOf( sal_Int32( nName ), 10 ); 2176 sMessage += ::rtl::OString(" / 0x"); 2177 sMessage += ::rtl::OString::valueOf( sal_Int32( nName ), 16 ); 2178 // sMessage += ::rtl::OString(" / "); 2179 // sMessage += ::rtl::OString 2180 // ((*QNameToString::Instance())(nName).c_str()); 2181 sMessage += ::rtl::OString(" value: "); 2182 sMessage += ::rtl::OString::valueOf( sal_Int32( nIntValue ), 10 ); 2183 sMessage += ::rtl::OString(" / 0x"); 2184 sMessage += ::rtl::OString::valueOf( sal_Int32( nIntValue ), 16 ); 2185 OSL_ENSURE( false, sMessage.getStr()); // 2186 #endif 2187 } 2188 } 2189 } 2190 } 2191 /*-- 09.06.2006 09:52:12--------------------------------------------------- 2192 2193 -----------------------------------------------------------------------*/ 2194 void DomainMapper::lcl_sprm(Sprm & rSprm) 2195 { 2196 if( !m_pImpl->getTableManager().sprm(rSprm)) 2197 sprmWithProps( rSprm, m_pImpl->GetTopContext() ); 2198 } 2199 /*-- 20.06.2006 09:58:33--------------------------------------------------- 2200 2201 -----------------------------------------------------------------------*/ 2202 void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmType ) 2203 { 2204 OSL_ENSURE(rContext.get(), "PropertyMap has to be valid!"); 2205 if(!rContext.get()) 2206 return ; 2207 2208 sal_uInt32 nSprmId = rSprm.getId(); 2209 //needed for page properties 2210 SectionPropertyMap * pSectionContext = m_pImpl->GetSectionContext(); 2211 2212 //TODO: In rtl-paragraphs the meaning of left/right are to be exchanged 2213 bool bExchangeLeftRight = false; 2214 // if( nSprmId == NS_sprm::LN_PJcExtra && AlreadyInRTLPara() ) 2215 // bExchangeLeftRight = true; 2216 Value::Pointer_t pValue = rSprm.getValue(); 2217 sal_Int32 nIntValue = pValue->getInt(); 2218 rtl::OUString sStringValue = pValue->getString(); 2219 // printf ( "DomainMapper::sprm(0x%.4x, 0x%.4x) [%s]\n", (unsigned int)nSprmId, (unsigned int)nIntValue, ::rtl::OUStringToOString(sStringValue, RTL_TEXTENCODING_DONTKNOW).getStr()); 2220 /* WRITERFILTERSTATUS: table: sprmdata */ 2221 2222 switch(nSprmId) 2223 { 2224 case 2: // sprmPIstd 2225 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2226 case 0x4600: 2227 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2228 break; // sprmPIstd - style code 2229 case 3: // "sprmPIstdPermute 2230 case NS_sprm::LN_PIstdPermute: 2231 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2232 break; // sprmPIstdPermute 2233 case NS_sprm::LN_PIncLvl: 2234 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2235 break; // sprmPIncLvl 2236 case NS_sprm::LN_PJcExtra: // sprmPJc Asian (undocumented) 2237 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 2238 case NS_sprm::LN_PJc: // sprmPJc 2239 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 2240 handleParaJustification(nIntValue, rContext, bExchangeLeftRight); 2241 break; 2242 case NS_sprm::LN_PFSideBySide: 2243 /* WRITERFILTERSTATUS: done: 0, planned: 3, spent: 0 */ 2244 /* WRITERFILTERSTATUS: comment: */ 2245 break; // sprmPFSideBySide 2246 2247 case NS_sprm::LN_PFKeep: // sprmPFKeep 2248 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */ 2249 /* WRITERFILTERSTATUS: comment: */ 2250 rContext->Insert(PROP_PARA_SPLIT, true, uno::makeAny(nIntValue ? false : true)); 2251 break; 2252 case NS_sprm::LN_PFKeepFollow: // sprmPFKeepFollow 2253 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 1 */ 2254 /* WRITERFILTERSTATUS: comment: */ 2255 rContext->Insert(PROP_PARA_KEEP_TOGETHER, true, uno::makeAny( nIntValue ? true : false) ); 2256 break; 2257 case NS_sprm::LN_PFPageBreakBefore: 2258 /* WRITERFILTERSTATUS: done: 100, planned: 3, spent: 0 */ 2259 /* WRITERFILTERSTATUS: comment: */ 2260 rContext->Insert(PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_PAGE_BEFORE ) ); 2261 break; // sprmPFPageBreakBefore 2262 case NS_sprm::LN_PBrcl: 2263 break; // sprmPBrcl 2264 case NS_sprm::LN_PBrcp: 2265 break; // sprmPBrcp 2266 2267 case NS_sprm::LN_PIlvl: // sprmPIlvl 2268 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 1 */ 2269 /* WRITERFILTERSTATUS: comment: */ 2270 { 2271 StyleSheetPropertyMap* pStyleSheetPropertyMap = NULL; 2272 if ( m_pImpl->IsStyleSheetImport() ) 2273 { 2274 StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() ); 2275 } 2276 2277 if ( pStyleSheetPropertyMap != NULL ) 2278 { 2279 pStyleSheetPropertyMap->SetListLevel( (sal_Int16)nIntValue ); 2280 } 2281 else 2282 { 2283 rContext->Insert( PROP_NUMBERING_LEVEL, true, uno::makeAny( (sal_Int16)nIntValue )); 2284 } 2285 } 2286 break; 2287 2288 case NS_sprm::LN_PIlfo: // sprmPIlfo 2289 /* WRITERFILTERSTATUS: done: 50, planned: 0, spent: 1 */ 2290 /* WRITERFILTERSTATUS: comment: */ 2291 { 2292 //convert the ListTable entry to a NumberingRules propery and apply it 2293 StyleSheetPropertyMap* pStyleSheetPropertyMap = NULL; 2294 if ( m_pImpl->IsStyleSheetImport() ) 2295 { 2296 StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() ); 2297 } 2298 2299 ListsManager::Pointer pListTable = m_pImpl->GetListTable(); 2300 ListDef::Pointer pList = pListTable->GetList( nIntValue ); 2301 if( pList.get( ) ) 2302 { 2303 if ( pStyleSheetPropertyMap != NULL ) 2304 { 2305 pStyleSheetPropertyMap->SetListId( nIntValue ); 2306 } 2307 else 2308 { 2309 uno::Any aRules = uno::makeAny( pList->GetNumberingRules( ) ); 2310 rContext->Insert( PROP_NUMBERING_RULES, true, aRules ); 2311 } 2312 } 2313 else 2314 { 2315 if ( pStyleSheetPropertyMap != NULL ) 2316 { 2317 // set the number id for AbstractNum references 2318 pStyleSheetPropertyMap->SetNumId( nIntValue ); 2319 } 2320 else 2321 { 2322 rtl::OUString sNone; 2323 rContext->Insert( PROP_NUMBERING_STYLE_NAME, true, uno::makeAny( sNone ) ); 2324 } 2325 } 2326 } 2327 break; 2328 2329 case NS_sprm::LN_PFNoLineNumb: // sprmPFNoLineNumb 2330 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 1 */ 2331 /* WRITERFILTERSTATUS: comment: */ 2332 rContext->Insert(PROP_PARA_LINE_NUMBER_COUNT, true, uno::makeAny( nIntValue ? false : true) ); 2333 break; 2334 case NS_sprm::LN_PChgTabsPapx: // sprmPChgTabsPapx 2335 /* WRITERFILTERSTATUS: done: 90, planned: 8, spent: 8 */ 2336 /* WRITERFILTERSTATUS: comment: bar tab stops a unavailable */ 2337 { 2338 // Initialize tab stop vector from style sheet 2339 uno::Any aValue = m_pImpl->GetPropertyFromStyleSheet(PROP_PARA_TAB_STOPS); 2340 uno::Sequence< style::TabStop > aStyleTabStops; 2341 if(aValue >>= aStyleTabStops) 2342 { 2343 m_pImpl->InitTabStopFromStyle( aStyleTabStops ); 2344 } 2345 2346 //create a new tab stop property - this is done with the contained properties 2347 resolveSprmProps(*this, rSprm); 2348 //add this property 2349 rContext->Insert(PROP_PARA_TAB_STOPS, true, uno::makeAny( m_pImpl->GetCurrentTabStopAndClear())); 2350 } 2351 break; 2352 case 0x845d: //right margin Asian - undocumented 2353 case 0x845e: //left margin Asian - undocumented 2354 case 16: // sprmPDxaRight - right margin 2355 case NS_sprm::LN_PDxaRight: // sprmPDxaRight - right margin 2356 case 17: 2357 case NS_sprm::LN_PDxaLeft: // sprmPDxaLeft 2358 /* WRITERFILTERSTATUS: done: 50, planned: 5, spent: 1 */ 2359 if( NS_sprm::LN_PDxaLeft == nSprmId || 0x17 == nSprmId|| (bExchangeLeftRight && nSprmId == 0x845d) || ( !bExchangeLeftRight && nSprmId == 0x845e)) 2360 rContext->Insert( 2361 eSprmType == SPRM_DEFAULT ? PROP_PARA_LEFT_MARGIN : PROP_LEFT_MARGIN, 2362 true, 2363 uno::makeAny( ConversionHelper::convertTwipToMM100( nIntValue ) )); 2364 else if(eSprmType == SPRM_DEFAULT) 2365 rContext->Insert( 2366 PROP_PARA_RIGHT_MARGIN, true, 2367 uno::makeAny( ConversionHelper::convertTwipToMM100(nIntValue ) )); 2368 //TODO: what happens to the right margins in numberings? 2369 break; 2370 case 18: // sprmPNest 2371 case NS_sprm::LN_PNest: // sprmPNest 2372 //not handled in the old WW8 filter 2373 break; 2374 case NS_sprm::LN_PDxaLeft1: // sprmPDxaLeft1 2375 case 19: 2376 case NS_sprm::LN_PDxaLeft180: // sprmPDxaLeft180 2377 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 1 */ 2378 rContext->Insert( 2379 eSprmType == SPRM_DEFAULT ? PROP_PARA_FIRST_LINE_INDENT : PROP_FIRST_LINE_OFFSET, 2380 true, 2381 uno::makeAny( ConversionHelper::convertTwipToMM100(nIntValue ) )); 2382 break; 2383 case 20 : // sprmPDyaLine 2384 case NS_sprm::LN_PDyaLine: // sprmPDyaLine 2385 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 1 */ 2386 { 2387 style::LineSpacing aSpacing; 2388 sal_Int16 nDistance = sal_Int16(nIntValue & 0xffff); 2389 if(nIntValue & 0xffff0000) 2390 { 2391 // single line in Writer is 100, in Word it is 240 2392 aSpacing.Mode = style::LineSpacingMode::PROP; 2393 aSpacing.Height = sal_Int16(sal_Int32(nDistance) * 100 /240); 2394 } 2395 else 2396 { 2397 if(nDistance < 0) 2398 { 2399 aSpacing.Mode = style::LineSpacingMode::FIX; 2400 aSpacing.Height = sal_Int16(ConversionHelper::convertTwipToMM100(-nDistance)); 2401 } 2402 else if(nDistance >0) 2403 { 2404 aSpacing.Mode = style::LineSpacingMode::MINIMUM; 2405 aSpacing.Height = sal_Int16(ConversionHelper::convertTwipToMM100(nDistance)); 2406 } 2407 } 2408 rContext->Insert(PROP_PARA_LINE_SPACING, true, uno::makeAny( aSpacing )); 2409 } 2410 break; 2411 case 21 : // legacy version 2412 case NS_sprm::LN_PDyaBefore: // sprmPDyaBefore 2413 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 1 */ 2414 rContext->Insert(PROP_PARA_TOP_MARGIN, true, uno::makeAny( ConversionHelper::convertTwipToMM100( nIntValue ) )); 2415 break; 2416 case 22 : 2417 case NS_sprm::LN_PDyaAfter: // sprmPDyaAfter 2418 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 1 */ 2419 rContext->Insert(PROP_PARA_BOTTOM_MARGIN, true, uno::makeAny( ConversionHelper::convertTwipToMM100( nIntValue ) )); 2420 break; 2421 2422 case 23: //sprmPChgTabs 2423 case NS_sprm::LN_PChgTabs: // sprmPChgTabs 2424 /* WRITERFILTERSTATUS: done: 0, planned: 3, spent: 0 */ 2425 OSL_ENSURE( false, "unhandled"); 2426 //tabs of list level? 2427 break; 2428 case 24: // "sprmPFInTable" 2429 case NS_sprm::LN_PFInTable: 2430 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2431 break; // sprmPFInTable 2432 case NS_sprm::LN_PTableDepth: //sprmPTableDepth 2433 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */ 2434 //not handled via sprm but via text( 0x07 ) 2435 break; 2436 case 25: // "sprmPTtp" pap.fTtp 2437 case NS_sprm::LN_PFTtp: // sprmPFTtp was: Read_TabRowEnd 2438 break; 2439 case 26: // "sprmPDxaAbs 2440 case NS_sprm::LN_PDxaAbs: 2441 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2442 break; // sprmPDxaAbs 2443 case 27: //sprmPDyaAbs 2444 case NS_sprm::LN_PDyaAbs: 2445 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2446 break; // sprmPDyaAbs 2447 case NS_sprm::LN_PDxaWidth: 2448 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2449 break; // sprmPDxaWidth 2450 case NS_sprm::LN_PPc: 2451 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2452 break; // sprmPPc 2453 case NS_sprm::LN_PBrcTop10: 2454 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2455 break; // sprmPBrcTop10 2456 case NS_sprm::LN_PBrcLeft10: 2457 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2458 break; // sprmPBrcLeft10 2459 case NS_sprm::LN_PBrcBottom10: 2460 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2461 break; // sprmPBrcBottom10 2462 case NS_sprm::LN_PBrcRight10: 2463 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2464 break; // sprmPBrcRight10 2465 case NS_sprm::LN_PBrcBetween10: 2466 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2467 break; // sprmPBrcBetween10 2468 case NS_sprm::LN_PBrcBar10: 2469 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2470 break; // sprmPBrcBar10 2471 case NS_sprm::LN_PDxaFromText10: 2472 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2473 break; // sprmPDxaFromText10 2474 case NS_sprm::LN_PWr: 2475 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2476 break; // sprmPWr 2477 2478 case NS_ooxml::LN_CT_PrBase_pBdr: //paragraph border 2479 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 2480 resolveSprmProps(*this, rSprm); 2481 break; 2482 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 2483 case NS_sprm::LN_PBrcTop: // sprmPBrcTop 2484 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 2485 /* WRITERFILTERSTATUS: comment: page borders are no handled yet, conversion incomplete */ 2486 case NS_sprm::LN_PBrcLeft: // sprmPBrcLeft 2487 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 2488 /* WRITERFILTERSTATUS: comment: page borders are no handled yet, conversion incomplete */ 2489 case NS_sprm::LN_PBrcBottom: // sprmPBrcBottom 2490 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 2491 /* WRITERFILTERSTATUS: comment: page borders are no handled yet, conversion incomplete */ 2492 case NS_sprm::LN_PBrcRight: // sprmPBrcRight 2493 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 2494 /* WRITERFILTERSTATUS: comment: page borders are no handled yet, conversion incomplete */ 2495 case NS_sprm::LN_PBrcBetween: // sprmPBrcBetween 2496 /* WRITERFILTERSTATUS: done: 0, planned: 8, spent: 0 */ 2497 /* WRITERFILTERSTATUS: comment: */ 2498 { 2499 //in binary format the borders are directly provided in OOXML they are inside of properties 2500 if( IsOOXMLImport() ) 2501 { 2502 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps(); 2503 if( pProperties.get()) 2504 { 2505 BorderHandlerPtr pBorderHandler( new BorderHandler( true ) ); 2506 pProperties->resolve(*pBorderHandler); 2507 PropertyIds eBorderId = PropertyIds( 0 ); 2508 PropertyIds eBorderDistId = PropertyIds( 0 ); 2509 switch( nSprmId ) 2510 { 2511 case NS_sprm::LN_PBrcTop: 2512 /* WRITERFILTERSTATUS: */ 2513 eBorderId = PROP_TOP_BORDER; 2514 eBorderDistId = PROP_TOP_BORDER_DISTANCE; 2515 break; 2516 case NS_sprm::LN_PBrcLeft: 2517 /* WRITERFILTERSTATUS: */ 2518 eBorderId = PROP_LEFT_BORDER; 2519 eBorderDistId = PROP_LEFT_BORDER_DISTANCE; 2520 break; 2521 case NS_sprm::LN_PBrcBottom: 2522 /* WRITERFILTERSTATUS: */ 2523 eBorderId = PROP_BOTTOM_BORDER ; 2524 eBorderDistId = PROP_BOTTOM_BORDER_DISTANCE; 2525 break; 2526 case NS_sprm::LN_PBrcRight: 2527 /* WRITERFILTERSTATUS: */ 2528 eBorderId = PROP_RIGHT_BORDER; 2529 eBorderDistId = PROP_RIGHT_BORDER_DISTANCE ; 2530 break; 2531 case NS_sprm::LN_PBrcBetween: 2532 /* WRITERFILTERSTATUS: */ 2533 //not supported 2534 break; 2535 default:; 2536 } 2537 if( eBorderId ) 2538 rContext->Insert( eBorderId, true, uno::makeAny( pBorderHandler->getBorderLine()) , true); 2539 if(eBorderDistId) 2540 rContext->Insert(eBorderDistId, true, uno::makeAny( pBorderHandler->getLineDistance()), true); 2541 } 2542 } 2543 else 2544 { 2545 table::BorderLine aBorderLine; 2546 sal_Int32 nLineDistance = ConversionHelper::MakeBorderLine( nIntValue, aBorderLine ); 2547 PropertyIds eBorderId = PROP_LEFT_BORDER; 2548 PropertyIds eBorderDistId = PROP_LEFT_BORDER_DISTANCE ; 2549 switch( nSprmId ) 2550 { 2551 case NS_sprm::LN_PBrcBetween: // sprmPBrcBetween 2552 /* WRITERFILTERSTATUS: */ 2553 OSL_ENSURE( false, "TODO: inner border is not handled"); 2554 break; 2555 case NS_sprm::LN_PBrcLeft: // sprmPBrcLeft 2556 /* WRITERFILTERSTATUS: */ 2557 eBorderId = PROP_LEFT_BORDER; 2558 eBorderDistId = PROP_LEFT_BORDER_DISTANCE ; 2559 break; 2560 case NS_sprm::LN_PBrcRight: // sprmPBrcRight 2561 /* WRITERFILTERSTATUS: */ 2562 eBorderId = PROP_RIGHT_BORDER ; 2563 eBorderDistId = PROP_RIGHT_BORDER_DISTANCE ; 2564 break; 2565 case NS_sprm::LN_PBrcTop: // sprmPBrcTop 2566 /* WRITERFILTERSTATUS: */ 2567 eBorderId = PROP_TOP_BORDER ; 2568 eBorderDistId = PROP_TOP_BORDER_DISTANCE; 2569 break; 2570 case NS_sprm::LN_PBrcBottom: // sprmPBrcBottom 2571 /* WRITERFILTERSTATUS: */ 2572 default: 2573 eBorderId = PROP_BOTTOM_BORDER ; 2574 eBorderDistId = PROP_BOTTOM_BORDER_DISTANCE; 2575 } 2576 rContext->Insert(eBorderId, true, uno::makeAny( aBorderLine )); 2577 rContext->Insert(eBorderDistId, true, uno::makeAny( nLineDistance )); 2578 } 2579 } 2580 break; 2581 case NS_sprm::LN_PBorderTop: 2582 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2583 /* WRITERFILTERSTATUS: comment: probably _real_ border colors, unhandled */ 2584 case NS_sprm::LN_PBorderLeft: 2585 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2586 /* WRITERFILTERSTATUS: comment: probably _real_ border colors, unhandled */ 2587 case NS_sprm::LN_PBorderBottom: 2588 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2589 /* WRITERFILTERSTATUS: comment: probably _real_ border colors, unhandled */ 2590 case NS_sprm::LN_PBorderRight: 2591 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2592 /* WRITERFILTERSTATUS: comment: probably _real_ border colors, unhandled */ 2593 OSL_ENSURE( false, "TODO: border color definition"); 2594 break; 2595 case NS_sprm::LN_PBrcBar: 2596 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2597 break; // sprmPBrcBar 2598 case NS_sprm::LN_PFNoAutoHyph: // sprmPFNoAutoHyph 2599 /* WRITERFILTERSTATUS: done: 100, planned: 1, spent: 0 */ 2600 rContext->Insert(PROP_PARA_IS_HYPHENATION, true, uno::makeAny( nIntValue ? false : true )); 2601 break; 2602 case NS_sprm::LN_PWHeightAbs: 2603 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2604 break; // sprmPWHeightAbs 2605 case NS_sprm::LN_PDcs: 2606 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2607 break; // sprmPDcs 2608 2609 case NS_sprm::LN_PShd: // sprmPShd 2610 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 2 */ 2611 { 2612 //contains fore color, back color and shadow percentage, results in a brush 2613 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps(); 2614 if( pProperties.get()) 2615 { 2616 CellColorHandlerPtr pCellColorHandler( new CellColorHandler ); 2617 pCellColorHandler->setParagraph(); 2618 pProperties->resolve(*pCellColorHandler); 2619 rContext->insert( pCellColorHandler->getProperties(), true ); 2620 } 2621 } 2622 break; 2623 case NS_sprm::LN_PDyaFromText: 2624 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2625 break; // sprmPDyaFromText 2626 case NS_sprm::LN_PDxaFromText: 2627 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2628 break; // sprmPDxaFromText 2629 case NS_sprm::LN_PFLocked: 2630 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2631 break; // sprmPFLocked 2632 case NS_sprm::LN_PFWidowControl: 2633 case NS_ooxml::LN_CT_PPrBase_widowControl: 2634 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 2635 { 2636 uno::Any aVal( uno::makeAny( sal_Int8(nIntValue ? 2 : 0 ))); 2637 rContext->Insert( PROP_PARA_WIDOWS, true, aVal ); 2638 rContext->Insert( PROP_PARA_ORPHANS, true, aVal ); 2639 } 2640 break; // sprmPFWidowControl 2641 case NS_sprm::LN_PRuler: 2642 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2643 break; // sprmPRuler 2644 case NS_sprm::LN_PFKinsoku: 2645 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2646 break; // sprmPFKinsoku 2647 case NS_sprm::LN_PFWordWrap: 2648 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2649 break; // sprmPFWordWrap 2650 case NS_sprm::LN_PFOverflowPunct: ; // sprmPFOverflowPunct - hanging punctuation 2651 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 2652 rContext->Insert(PROP_PARA_IS_HANGING_PUNCTUATION, true, uno::makeAny( nIntValue ? false : true )); 2653 break; 2654 case NS_sprm::LN_PFTopLinePunct: 2655 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2656 break; // sprmPFTopLinePunct 2657 case NS_sprm::LN_PFAutoSpaceDE: 2658 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2659 break; // sprmPFAutoSpaceDE 2660 case NS_sprm::LN_PFAutoSpaceDN: 2661 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2662 break; // sprmPFAutoSpaceDN 2663 case NS_sprm::LN_PWAlignFont: 2664 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2665 break; // sprmPWAlignFont 2666 case NS_sprm::LN_PFrameTextFlow: 2667 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2668 break; // sprmPFrameTextFlow 2669 case NS_sprm::LN_PISnapBaseLine: 2670 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2671 break; // sprmPISnapBaseLine 2672 case NS_sprm::LN_PAnld: 2673 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2674 break; // sprmPAnld 2675 case NS_sprm::LN_PPropRMark: 2676 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2677 break; // sprmPPropRMark 2678 case NS_sprm::LN_POutLvl: 2679 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2680 { 2681 sal_Int16 nLvl = static_cast< sal_Int16 >( nIntValue ); 2682 if( m_pImpl->IsStyleSheetImport() ) 2683 { 2684 2685 StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() ); 2686 pStyleSheetPropertyMap->SetOutlineLevel( nLvl ); 2687 } 2688 else 2689 { 2690 nLvl = nLvl >= WW_OUTLINE_MIN && nLvl < WW_OUTLINE_MAX? nLvl+1 : 0; //0 means no outline level set on 2691 rContext->Insert(PROP_OUTLINE_LEVEL, true, uno::makeAny ( nLvl )); 2692 } 2693 } 2694 break; // sprmPOutLvl 2695 case NS_sprm::LN_PFBiDi: 2696 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 2697 rContext->Insert(PROP_WRITING_MODE, false, uno::makeAny( text::WritingMode2::RL_TB )); 2698 rContext->Insert(PROP_PARA_ADJUST, false, uno::makeAny( style::ParagraphAdjust_RIGHT )); 2699 2700 break; // sprmPFBiDi 2701 case NS_ooxml::LN_EG_SectPrContents_bidi: 2702 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 2703 if (pSectionContext != NULL) 2704 pSectionContext->Insert(PROP_WRITING_MODE,false, uno::makeAny( text::WritingMode2::RL_TB)); 2705 break; 2706 case NS_sprm::LN_PFNumRMIns: 2707 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2708 break; // sprmPFNumRMIns 2709 case NS_sprm::LN_PCrLf: 2710 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2711 break; // sprmPCrLf 2712 case NS_sprm::LN_PNumRM: 2713 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2714 break; // sprmPNumRM 2715 case NS_sprm::LN_PHugePapx: 2716 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2717 break; // sprmPHugePapx 2718 case NS_sprm::LN_PFUsePgsuSettings: 2719 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2720 break; // sprmPFUsePgsuSettings 2721 case NS_sprm::LN_PFAdjustRight: 2722 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2723 break; // sprmPFAdjustRight 2724 case NS_sprm::LN_CFRMarkDel: 2725 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2726 break; // sprmCFRMarkDel 2727 case NS_sprm::LN_CFRMark: 2728 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2729 break; // sprmCFRMark 2730 case NS_sprm::LN_CFFldVanish: 2731 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2732 break; // sprmCFFldVanish 2733 case NS_sprm::LN_CFSpec: // sprmCFSpec 2734 break; 2735 case NS_sprm::LN_CPicLocation: // sprmCPicLocation 2736 //is being resolved on the tokenizer side 2737 break; 2738 case NS_sprm::LN_CIbstRMark: 2739 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2740 break; // sprmCIbstRMark 2741 case NS_sprm::LN_CDttmRMark: 2742 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2743 break; // sprmCDttmRMark 2744 case NS_sprm::LN_CFData: 2745 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2746 break; // sprmCFData 2747 case NS_sprm::LN_CIdslRMark: 2748 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2749 break; // sprmCIdslRMark 2750 case NS_sprm::LN_CChs: 2751 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2752 break; // sprmCChs 2753 case NS_sprm::LN_CSymbol: // sprmCSymbol 2754 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2755 resolveSprmProps(*this, rSprm); //resolves LN_FONT and LN_CHAR 2756 break; 2757 case NS_sprm::LN_CFOle2: 2758 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2759 break; // sprmCFOle2 2760 case NS_sprm::LN_CIdCharType: 2761 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2762 break; // sprmCIdCharType 2763 case NS_sprm::LN_CHighlight: 2764 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 2765 { 2766 sal_Int32 nColor = 0; 2767 if(true ==( mbIsHighlightSet = getColorFromIndex(nIntValue, nColor))) 2768 rContext->Insert(PROP_CHAR_BACK_COLOR, true, uno::makeAny( nColor )); 2769 else if (mnBackgroundColor) 2770 rContext->Insert(PROP_CHAR_BACK_COLOR, true, uno::makeAny( mnBackgroundColor )); 2771 } 2772 break; // sprmCHighlight 2773 case NS_sprm::LN_CObjLocation: 2774 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2775 break; // sprmCObjLocation 2776 case NS_sprm::LN_CFFtcAsciSymb: 2777 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2778 break; // sprmCFFtcAsciSymb 2779 case NS_sprm::LN_CIstd: 2780 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2781 break; // sprmCIstd 2782 case NS_sprm::LN_CIstdPermute: 2783 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2784 break; // sprmCIstdPermute 2785 case NS_sprm::LN_CDefault: 2786 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2787 break; // sprmCDefault 2788 case NS_sprm::LN_CPlain: 2789 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2790 break; // sprmCPlain 2791 case NS_sprm::LN_CKcd: 2792 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 2793 rContext->Insert(PROP_CHAR_EMPHASIS, true, uno::makeAny ( getEmphasisValue (nIntValue))); 2794 break; // sprmCKcd 2795 case NS_sprm::LN_CFEmboss:// sprmCFEmboss 2796 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */ 2797 case 60:// sprmCFBold 2798 case NS_sprm::LN_CFBoldBi:// sprmCFBoldBi (offset 0x27 to normal bold) 2799 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */ 2800 case NS_sprm::LN_CFItalicBi:// sprmCFItalicBi (offset 0x27 to normal italic) 2801 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */ 2802 case NS_sprm::LN_CFBold: //sprmCFBold 2803 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */ 2804 case 61: /*sprmCFItalic*/ 2805 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */ 2806 case NS_sprm::LN_CFItalic: //sprmCFItalic 2807 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */ 2808 case NS_sprm::LN_CFStrike: //sprmCFStrike 2809 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5*/ 2810 case NS_sprm::LN_CFOutline: //sprmCFOutline 2811 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */ 2812 case NS_sprm::LN_CFShadow: //sprmCFShadow 2813 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */ 2814 case NS_sprm::LN_CFSmallCaps: //sprmCFSmallCaps 2815 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */ 2816 case NS_sprm::LN_CFCaps: //sprmCFCaps 2817 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */ 2818 case NS_sprm::LN_CFVanish: //sprmCFVanish 2819 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */ 2820 case NS_sprm::LN_CFDStrike: // sprmCFDStrike 2821 /* WRITERFILTERSTATUS: done: 100, planned: , spent: 0.5 */ 2822 { 2823 PropertyIds ePropertyId = PROP_CHAR_WEIGHT; //initialized to prevent warning! 2824 switch( nSprmId ) 2825 { 2826 case 60:// sprmCFBold 2827 case NS_sprm::LN_CFBoldBi: // sprmCFBoldBi 2828 case NS_sprm::LN_CFBold: /*sprmCFBold*/ 2829 /* WRITERFILTERSTATUS: */ 2830 ePropertyId = nSprmId != NS_sprm::LN_CFBoldBi ? PROP_CHAR_WEIGHT : PROP_CHAR_WEIGHT_COMPLEX; 2831 break; 2832 case 61: /*sprmCFItalic*/ 2833 case NS_sprm::LN_CFItalicBi: // sprmCFItalicBi 2834 case NS_sprm::LN_CFItalic: /*sprmCFItalic*/ 2835 /* WRITERFILTERSTATUS: */ 2836 ePropertyId = nSprmId == 0x836 ? PROP_CHAR_POSTURE : PROP_CHAR_POSTURE_COMPLEX; 2837 break; 2838 case NS_sprm::LN_CFStrike: /*sprmCFStrike*/ 2839 case NS_sprm::LN_CFDStrike : /*sprmCFDStrike double strike through*/ 2840 /* WRITERFILTERSTATUS: */ 2841 ePropertyId = PROP_CHAR_STRIKEOUT; 2842 break; 2843 case NS_sprm::LN_CFOutline: /*sprmCFOutline*/ 2844 /* WRITERFILTERSTATUS: */ 2845 ePropertyId = PROP_CHAR_CONTOURED; 2846 break; 2847 case NS_sprm::LN_CFShadow: /*sprmCFShadow*/ 2848 /* WRITERFILTERSTATUS: */ 2849 ePropertyId = PROP_CHAR_SHADOWED; 2850 break; 2851 case NS_sprm::LN_CFSmallCaps: /*sprmCFSmallCaps*/ 2852 case NS_sprm::LN_CFCaps: /*sprmCFCaps*/ 2853 /* WRITERFILTERSTATUS: */ 2854 ePropertyId = PROP_CHAR_CASE_MAP; 2855 break; 2856 case NS_sprm::LN_CFVanish: /*sprmCFVanish*/ 2857 /* WRITERFILTERSTATUS: */ 2858 ePropertyId = PROP_CHAR_HIDDEN; 2859 break; 2860 case NS_sprm::LN_CFEmboss: /*sprmCFEmboss*/ 2861 /* WRITERFILTERSTATUS: */ 2862 ePropertyId = PROP_CHAR_RELIEF; 2863 break; 2864 } 2865 //expected: 0,1,128,129 2866 if(nIntValue != 128) //inherited from paragraph - ignore 2867 { 2868 if( nIntValue == 129) //inverted style sheet value 2869 { 2870 //get value from style sheet and invert it 2871 sal_Int16 nStyleValue = 0; 2872 double fDoubleValue = 0; 2873 uno::Any aStyleVal = m_pImpl->GetPropertyFromStyleSheet(ePropertyId); 2874 if( !aStyleVal.hasValue() ) 2875 { 2876 nIntValue = 0x83a == nSprmId ? 2877 4 : 1; 2878 } 2879 else if(aStyleVal.getValueTypeClass() == uno::TypeClass_FLOAT ) 2880 { 2881 //only in case of awt::FontWeight 2882 aStyleVal >>= fDoubleValue; 2883 nIntValue = fDoubleValue > 100. ? 0 : 1; 2884 } 2885 else if((aStyleVal >>= nStyleValue) || 2886 (nStyleValue = (sal_Int16)comphelper::getEnumAsINT32(aStyleVal)) >= 0 ) 2887 { 2888 nIntValue = 0x83a == nSprmId ? 2889 nStyleValue ? 0 : 4 : 2890 nStyleValue ? 0 : 1; 2891 } 2892 else 2893 { 2894 OSL_ENSURE( false, "what type was it"); 2895 } 2896 } 2897 2898 switch( nSprmId ) 2899 { 2900 case 60:/*sprmCFBold*/ 2901 case NS_sprm::LN_CFBold: /*sprmCFBold*/ 2902 case NS_sprm::LN_CFBoldBi: // sprmCFBoldBi 2903 /* WRITERFILTERSTATUS: */ 2904 { 2905 uno::Any aBold( uno::makeAny( nIntValue ? awt::FontWeight::BOLD : awt::FontWeight::NORMAL ) ); 2906 2907 rContext->Insert(ePropertyId, true, aBold ); 2908 if( nSprmId != NS_sprm::LN_CFBoldBi ) // sprmCFBoldBi 2909 rContext->Insert(PROP_CHAR_WEIGHT_ASIAN, true, aBold ); 2910 } 2911 break; 2912 case 61: /*sprmCFItalic*/ 2913 case NS_sprm::LN_CFItalic: /*sprmCFItalic*/ 2914 case NS_sprm::LN_CFItalicBi: // sprmCFItalicBi 2915 /* WRITERFILTERSTATUS: */ 2916 { 2917 uno::Any aPosture( uno::makeAny( nIntValue ? awt::FontSlant_ITALIC : awt::FontSlant_NONE ) ); 2918 rContext->Insert( ePropertyId, true, aPosture ); 2919 if( nSprmId != NS_sprm::LN_CFItalicBi ) // sprmCFItalicBi 2920 rContext->Insert(PROP_CHAR_POSTURE_ASIAN, true, aPosture ); 2921 } 2922 break; 2923 case NS_sprm::LN_CFStrike: /*sprmCFStrike*/ 2924 /* WRITERFILTERSTATUS: */ 2925 rContext->Insert(ePropertyId, true, 2926 uno::makeAny( nIntValue ? awt::FontStrikeout::SINGLE : awt::FontStrikeout::NONE ) ); 2927 break; 2928 case NS_sprm::LN_CFDStrike : /*sprmCFDStrike double strike through*/ 2929 /* WRITERFILTERSTATUS: */ 2930 rContext->Insert(ePropertyId, true, 2931 uno::makeAny( awt::FontStrikeout::DOUBLE ) ); 2932 break; 2933 case NS_sprm::LN_CFOutline: /*sprmCFOutline*/ 2934 case NS_sprm::LN_CFShadow: /*sprmCFShadow*/ 2935 case NS_sprm::LN_CFVanish: /*sprmCFVanish*/ 2936 /* WRITERFILTERSTATUS: */ 2937 rContext->Insert(ePropertyId, true, uno::makeAny( nIntValue ? true : false )); 2938 break; 2939 case NS_sprm::LN_CFSmallCaps: /*sprmCFSmallCaps*/ 2940 /* WRITERFILTERSTATUS: */ 2941 rContext->Insert(ePropertyId, true, 2942 uno::makeAny( nIntValue ? style::CaseMap::SMALLCAPS : style::CaseMap::NONE)); 2943 break; 2944 case NS_sprm::LN_CFCaps: /*sprmCFCaps*/ 2945 /* WRITERFILTERSTATUS: */ 2946 rContext->Insert(ePropertyId, true, 2947 uno::makeAny( nIntValue ? style::CaseMap::UPPERCASE : style::CaseMap::NONE)); 2948 break; 2949 case NS_sprm::LN_CFEmboss: /*sprmCFEmboss*/ 2950 /* WRITERFILTERSTATUS: */ 2951 rContext->Insert(ePropertyId, true, 2952 uno::makeAny( nIntValue ? awt::FontRelief::EMBOSSED : awt::FontRelief::NONE )); 2953 break; 2954 2955 } 2956 } 2957 } 2958 break; 2959 case NS_sprm::LN_CFtcDefault: 2960 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2961 break; // sprmCFtcDefault 2962 case NS_sprm::LN_CKul: // sprmCKul 2963 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 2964 { 2965 // Parameter: 0 = none, 1 = single, 2 = by Word, 2966 // 3 = double, 4 = dotted, 5 = hidden 2967 // 6 = thick, 7 = dash, 8 = dot(not used) 2968 // 9 = dotdash 10 = dotdotdash 11 = wave 2969 handleUnderlineType(nIntValue, rContext); 2970 } 2971 break; 2972 case NS_sprm::LN_CSizePos: 2973 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2974 break; // sprmCSizePos 2975 case NS_sprm::LN_CLid: 2976 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2977 break; // sprmCLid 2978 case NS_sprm::LN_CIco: 2979 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 2980 { 2981 sal_Int32 nColor = 0; 2982 if (getColorFromIndex(nIntValue, nColor)) 2983 rContext->Insert(PROP_CHAR_COLOR, true, uno::makeAny( nColor ) ); 2984 } 2985 break; // sprmCIco 2986 case NS_sprm::LN_CHpsBi: // sprmCHpsBi 2987 case NS_sprm::LN_CHps: // sprmCHps 2988 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 2989 { 2990 //multiples of half points (12pt == 24) 2991 double fVal = double(nIntValue) / 2.; 2992 uno::Any aVal = uno::makeAny( fVal ); 2993 if( NS_sprm::LN_CHpsBi == nSprmId ) 2994 rContext->Insert( PROP_CHAR_HEIGHT_COMPLEX, true, aVal ); 2995 else 2996 { 2997 //Asian get the same value as Western 2998 rContext->Insert( PROP_CHAR_HEIGHT, true, aVal ); 2999 rContext->Insert( PROP_CHAR_HEIGHT_ASIAN, true, aVal ); 3000 } 3001 } 3002 break; 3003 case NS_sprm::LN_CHpsInc: 3004 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3005 break; // sprmCHpsInc 3006 case NS_sprm::LN_CHpsPos: 3007 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3008 { 3009 // FIXME: ww8 filter in ww8par6.cxx has a Read_SubSuperProp function 3010 // that counts the escapement from this value and font size. So it will be 3011 // on our TODO list 3012 sal_Int16 nEscapement = 0; 3013 sal_Int8 nProp = 100; 3014 if (nIntValue < 0) 3015 nEscapement = -58; 3016 else if (nIntValue > 0) 3017 nEscapement = 58; 3018 else /* (nIntValue == 0) */ 3019 nProp = 0; 3020 rContext->Insert(PROP_CHAR_ESCAPEMENT, true, uno::makeAny( nEscapement ) ); 3021 rContext->Insert(PROP_CHAR_ESCAPEMENT_HEIGHT, true, uno::makeAny( nProp ) ); 3022 } 3023 break; // sprmCHpsPos 3024 case NS_sprm::LN_CHpsPosAdj: 3025 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3026 break; // sprmCHpsPosAdj 3027 case NS_sprm::LN_CMajority: 3028 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3029 break; // sprmCMajority 3030 case NS_sprm::LN_CIss: // sprmCIss 3031 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 3032 { 3033 //sub/super script 1: super, 2: sub, 0: normal 3034 sal_Int16 nEscapement = 0; 3035 sal_Int8 nProp = 58; 3036 switch(nIntValue) 3037 { 3038 case 1: //super 3039 nEscapement = 101; 3040 break; 3041 case 2: //sub 3042 nEscapement = -101; 3043 break; 3044 case 0: nProp = 0;break; //none 3045 } 3046 rContext->Insert(PROP_CHAR_ESCAPEMENT, true, uno::makeAny( nEscapement ) ); 3047 rContext->Insert(PROP_CHAR_ESCAPEMENT_HEIGHT, true, uno::makeAny( nProp ) ); 3048 } 3049 break; 3050 case NS_sprm::LN_CHpsNew50: 3051 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3052 break; // sprmCHpsNew50 3053 case NS_sprm::LN_CHpsInc1: 3054 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3055 break; // sprmCHpsInc1 3056 case 71 : //"sprmCDxaSpace" 3057 case 96 : //"sprmCDxaSpace" 3058 case NS_sprm::LN_CDxaSpace: // sprmCDxaSpace 3059 { 3060 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */ 3061 //Kerning half point values 3062 //TODO: there are two kerning values - 3063 // in ww8par6.cxx NS_sprm::LN_CHpsKern is used as boolean AutoKerning 3064 sal_Int16 nResult = static_cast<sal_Int16>(ConversionHelper::convertTwipToMM100(nIntValue)); 3065 if (m_pImpl->IsInComments()) 3066 { 3067 nResult = static_cast<sal_Int16>(nIntValue); 3068 } 3069 rContext->Insert(PROP_CHAR_CHAR_KERNING, true, uno::makeAny(nResult)); 3070 } 3071 break; 3072 case NS_sprm::LN_CHpsKern: // sprmCHpsKern auto kerning is bound to a minimum font size in Word - but not in Writer :-( 3073 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 3074 rContext->Insert(PROP_CHAR_AUTO_KERNING, true, uno::makeAny( true ) ); 3075 break; 3076 case NS_sprm::LN_CMajority50: 3077 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3078 break; // sprmCMajority50 3079 case NS_sprm::LN_CHpsMul: 3080 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3081 break; // sprmCHpsMul 3082 case NS_sprm::LN_CYsri: 3083 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3084 break; // sprmCYsri 3085 case NS_sprm::LN_CRgFtc0: // sprmCRgFtc0 //ascii font index 3086 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 3087 case NS_sprm::LN_CRgFtc1: // sprmCRgFtc1 //Asian font index 3088 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 3089 case NS_sprm::LN_CRgFtc2: // sprmCRgFtc2 //CTL font index 3090 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 3091 case NS_sprm::LN_CFtcBi: // sprmCFtcBi //font index of a CTL font 3092 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 3093 { 3094 FontTablePtr pFontTable = m_pImpl->GetFontTable(); 3095 if(nIntValue >= 0 && pFontTable->size() > sal_uInt32(nIntValue)) 3096 { 3097 PropertyIds eFontName = PROP_CHAR_FONT_NAME; 3098 PropertyIds eFontStyle = PROP_CHAR_FONT_STYLE; 3099 PropertyIds eFontFamily = PROP_CHAR_FONT_FAMILY; 3100 PropertyIds eFontCharSet = PROP_CHAR_FONT_CHAR_SET; 3101 PropertyIds eFontPitch = PROP_CHAR_FONT_PITCH; 3102 switch(nSprmId) 3103 { 3104 case NS_sprm::LN_CRgFtc0: 3105 //already initialized 3106 break; 3107 case NS_sprm::LN_CRgFtc1: 3108 eFontName = PROP_CHAR_FONT_NAME_ASIAN; 3109 eFontStyle = PROP_CHAR_FONT_STYLE_ASIAN; 3110 eFontFamily = PROP_CHAR_FONT_FAMILY_ASIAN; 3111 eFontCharSet = PROP_CHAR_FONT_CHAR_SET_ASIAN; 3112 eFontPitch = PROP_CHAR_FONT_PITCH_ASIAN; 3113 break; 3114 case NS_sprm::LN_CRgFtc2: 3115 case NS_sprm::LN_CFtcBi: 3116 eFontName = PROP_CHAR_FONT_NAME_COMPLEX; 3117 eFontStyle = PROP_CHAR_FONT_STYLE_COMPLEX; 3118 eFontFamily = PROP_CHAR_FONT_FAMILY_COMPLEX; 3119 eFontCharSet = PROP_CHAR_FONT_CHAR_SET_COMPLEX; 3120 eFontPitch = PROP_CHAR_FONT_PITCH_COMPLEX; 3121 break; 3122 } 3123 const FontEntry::Pointer_t pFontEntry(pFontTable->getFontEntry(sal_uInt32(nIntValue))); 3124 rContext->Insert(eFontName, true, uno::makeAny( pFontEntry->sFontName )); 3125 // rContext->Insert(eFontStyle, uno::makeAny( pFontEntry-> )); 3126 // rContext->Insert(eFontFamily, uno::makeAny( pFontEntry-> )); 3127 rContext->Insert(eFontCharSet, true, uno::makeAny( (sal_Int16)pFontEntry->nTextEncoding )); 3128 rContext->Insert(eFontPitch, true, uno::makeAny( pFontEntry->nPitchRequest )); 3129 } 3130 } 3131 break; 3132 case NS_sprm::LN_CCharScale: // sprmCCharScale 3133 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 3134 rContext->Insert(PROP_CHAR_SCALE_WIDTH, true, 3135 uno::makeAny( sal_Int16(nIntValue) )); 3136 break; 3137 case NS_sprm::LN_CFImprint: // sprmCFImprint 1 or 0 3138 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 3139 // FontRelief: NONE, EMBOSSED, ENGRAVED 3140 rContext->Insert(PROP_CHAR_RELIEF, true, 3141 uno::makeAny( nIntValue ? awt::FontRelief::ENGRAVED : awt::FontRelief::NONE )); 3142 break; 3143 case NS_sprm::LN_CFObj: 3144 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3145 break; // sprmCFObj 3146 case NS_sprm::LN_CPropRMark: 3147 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3148 break; // sprmCPropRMark 3149 case NS_sprm::LN_CSfxText: 3150 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 3151 // The file-format has many character animations. We have only 3152 // one, so we use it always. Suboptimal solution though. 3153 if (nIntValue) 3154 rContext->Insert(PROP_CHAR_FLASH, true, uno::makeAny( true )); 3155 else 3156 rContext->Insert(PROP_CHAR_FLASH, true, uno::makeAny( false )); 3157 break; // sprmCSfxText 3158 case NS_sprm::LN_CFBiDi: 3159 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3160 break; // sprmCFBiDi 3161 case NS_sprm::LN_CFDiacColor: 3162 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3163 break; // sprmCFDiacColor 3164 case NS_sprm::LN_CIcoBi: 3165 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3166 break; // sprmCIcoBi 3167 case NS_sprm::LN_CDispFldRMark: 3168 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3169 break; // sprmCDispFldRMark 3170 case NS_sprm::LN_CIbstRMarkDel: 3171 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3172 break; // sprmCIbstRMarkDel 3173 case NS_sprm::LN_CDttmRMarkDel: 3174 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3175 break; // sprmCDttmRMarkDel 3176 case NS_sprm::LN_CBrc: 3177 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3178 break; // sprmCBrc 3179 case NS_sprm::LN_CShd: 3180 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */ 3181 break; // sprmCShd 3182 case NS_sprm::LN_CIdslRMarkDel: 3183 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3184 break; // sprmCIdslRMarkDel 3185 case NS_sprm::LN_CFUsePgsuSettings: 3186 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3187 break; // sprmCFUsePgsuSettings 3188 case NS_sprm::LN_CCpg: 3189 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3190 break; // sprmCCpg 3191 case NS_sprm::LN_CLidBi: // sprmCLidBi language complex 3192 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 3193 case NS_sprm::LN_CRgLid0_80: //sprmCRgLid0_80 3194 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 1 */ 3195 //undocumented but interpreted as western language 3196 case NS_sprm::LN_CRgLid0: // sprmCRgLid0 language Western 3197 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 3198 case NS_sprm::LN_CRgLid1: // sprmCRgLid1 language Asian 3199 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 3200 { 3201 lang::Locale aLocale; 3202 MsLangId::convertLanguageToLocale( (LanguageType)nIntValue, aLocale ); 3203 rContext->Insert(NS_sprm::LN_CRgLid0 == nSprmId ? PROP_CHAR_LOCALE : 3204 NS_sprm::LN_CRgLid1 == nSprmId ? PROP_CHAR_LOCALE_ASIAN : PROP_CHAR_LOCALE_COMPLEX, 3205 true, 3206 uno::makeAny( aLocale ) ); 3207 } 3208 break; 3209 3210 case NS_sprm::LN_CIdctHint: // sprmCIdctHint 3211 //list table - text offset??? 3212 break; 3213 case NS_sprm::LN_PicBrcl: 3214 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3215 break; // sprmPicBrcl 3216 case NS_sprm::LN_PicScale: 3217 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3218 break; // sprmPicScale 3219 case NS_sprm::LN_PicBrcTop: 3220 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3221 break; // sprmPicBrcTop 3222 case NS_sprm::LN_PicBrcLeft: 3223 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3224 break; // sprmPicBrcLeft 3225 case NS_sprm::LN_PicBrcBottom: 3226 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3227 break; // sprmPicBrcBoConversionHelper::convertTwipToMM100ttom 3228 case NS_sprm::LN_PicBrcRight: 3229 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3230 break; // sprmPicBrcRight 3231 case NS_sprm::LN_ScnsPgn: 3232 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3233 break; // sprmScnsPgn 3234 case NS_sprm::LN_SiHeadingPgn: 3235 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3236 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3237 if(pSectionContext) 3238 pSectionContext->SetEvenlySpaced( nIntValue > 0 ); 3239 3240 break; // sprmSiHeadingPgn 3241 case NS_sprm::LN_SOlstAnm: 3242 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3243 break; // sprmSOlstAnm 3244 case 136: 3245 case NS_sprm::LN_SDxaColWidth: // sprmSDxaColWidth 3246 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3247 // contains the twip width of the column as 3-byte-code 3248 // the lowet byte contains the index 3249 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3250 if(pSectionContext) 3251 pSectionContext->AppendColumnWidth( ConversionHelper::convertTwipToMM100( (nIntValue & 0xffff00) >> 8 )); 3252 break; 3253 case NS_sprm::LN_SDxaColSpacing: // sprmSDxaColSpacing 3254 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3255 // the lowet byte contains the index 3256 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3257 if(pSectionContext) 3258 pSectionContext->AppendColumnSpacing( ConversionHelper::convertTwipToMM100( (nIntValue & 0xffff00) >> 8 )); 3259 break; 3260 case 138: 3261 case NS_sprm::LN_SFEvenlySpaced: 3262 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3263 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3264 if(pSectionContext) 3265 pSectionContext->SetEvenlySpaced( nIntValue > 0 ); 3266 break; // sprmSFEvenlySpaced 3267 case NS_sprm::LN_SFProtected: // sprmSFProtected 3268 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3269 //todo: missing feature - unlocked sections in protected documents 3270 break; 3271 case NS_sprm::LN_SDmBinFirst: // sprmSDmBinFirst 3272 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 3273 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3274 if(pSectionContext) 3275 pSectionContext->SetFirstPaperBin(nIntValue); 3276 break; 3277 case NS_sprm::LN_SDmBinOther: // sprmSDmBinOther 3278 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 3279 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3280 if(pSectionContext) 3281 pSectionContext->SetPaperBin( nIntValue ); 3282 break; 3283 case NS_sprm::LN_SBkc: // sprmSBkc 3284 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */ 3285 /* break type 3286 0 - No break 3287 1 - New Column 3288 2 - New page 3289 3 - Even page 3290 4 - odd page 3291 */ 3292 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3293 if(pSectionContext) 3294 pSectionContext->SetBreakType( nIntValue ); 3295 break; 3296 case 143: 3297 case NS_sprm::LN_SFTitlePage: // sprmSFTitlePage 3298 case NS_ooxml::LN_EG_SectPrContents_titlePg: 3299 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 3300 { 3301 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3302 if(pSectionContext) 3303 pSectionContext->SetTitlePage( nIntValue > 0 ? true : false );//section has title page 3304 } 3305 break; 3306 case 144: 3307 case NS_sprm::LN_SCcolumns: // sprmSCcolumns 3308 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 3309 //no of columns - 1 3310 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3311 if(pSectionContext) 3312 pSectionContext->SetColumnCount( (sal_Int16) nIntValue ); 3313 break; 3314 case 145: 3315 case NS_sprm::LN_SDxaColumns: // sprmSDxaColumns 3316 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 3317 //column distance - default 708 twip 3318 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3319 if(pSectionContext) 3320 pSectionContext->SetColumnDistance( ConversionHelper::convertTwipToMM100( nIntValue ) ); 3321 break; 3322 case NS_sprm::LN_SFAutoPgn: 3323 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3324 break; // sprmSFAutoPgn 3325 case 147: 3326 case NS_sprm::LN_SNfcPgn: // sprmSNfcPgn 3327 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 3328 //page numbering 0 - Arab, 1 - ROMAN, 2 - roman, 3 - ABC, 4 abc 3329 sal_Int16 nNumbering; 3330 switch( nIntValue ) 3331 { 3332 case 1: nNumbering = style::NumberingType::ROMAN_UPPER; 3333 case 2: nNumbering = style::NumberingType::ROMAN_LOWER; 3334 case 3: nNumbering = style::NumberingType::CHARS_UPPER_LETTER; 3335 case 4: nNumbering = style::NumberingType::CHARS_LOWER_LETTER; 3336 case 0: 3337 default: 3338 nNumbering = style::NumberingType::ARABIC; 3339 } 3340 rContext->Insert( PROP_NUMBERING_TYPE, false, uno::makeAny( nNumbering ) ); 3341 break; 3342 case NS_sprm::LN_SDyaPgn: 3343 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3344 break; // sprmSDyaPgn 3345 case NS_sprm::LN_SDxaPgn: 3346 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3347 break; // sprmSDxaPgn 3348 case 150: 3349 case NS_sprm::LN_SFPgnRestart: // sprmSFPgnRestart 3350 { 3351 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 3352 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3353 if(pSectionContext) 3354 pSectionContext->SetPageNoRestart( nIntValue > 0 ); 3355 } 3356 break; 3357 case NS_sprm::LN_SFEndnote: 3358 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3359 break; // sprmSFEndnote 3360 case 154: 3361 case NS_sprm::LN_SNLnnMod:// sprmSNLnnMod 3362 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 3363 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3364 if( pSectionContext ) 3365 pSectionContext->SetLnnMod( nIntValue ); 3366 break; 3367 case 155: 3368 case NS_sprm::LN_SDxaLnn: // sprmSDxaLnn 3369 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3370 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3371 if( pSectionContext ) 3372 pSectionContext->SetdxaLnn( nIntValue ); 3373 break; 3374 case 152: 3375 case NS_sprm::LN_SLnc:// sprmSLnc 3376 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3377 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3378 if( pSectionContext ) 3379 pSectionContext->SetLnc( nIntValue ); 3380 break; 3381 case 160: 3382 case NS_sprm::LN_SLnnMin: // sprmSLnnMin 3383 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */ 3384 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3385 if( pSectionContext ) 3386 pSectionContext->SetLnnMin( nIntValue ); 3387 break; 3388 3389 case NS_sprm::LN_SGprfIhdt: 3390 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3391 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3392 //flags about header/footer sharing and footnotes? 3393 /* ww8scan.hxx: 3394 * WW8_HEADER_EVEN = 0x01, WW8_HEADER_ODD = 0x02, WW8_FOOTER_EVEN = 0x04, 3395 * WW8_FOOTER_ODD = 0x08, WW8_HEADER_FIRST = 0x10, WW8_FOOTER_FIRST = 0x20 3396 */ 3397 3398 // if(pSectionContext) 3399 break; // sprmSGprfIhdt 3400 case NS_sprm::LN_SDyaHdrTop: // sprmSDyaHdrTop 3401 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3402 // default 720 twip 3403 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3404 if(pSectionContext) 3405 pSectionContext->SetHeaderTop( ConversionHelper::convertTwipToMM100( nIntValue )); 3406 break; 3407 case NS_sprm::LN_SDyaHdrBottom: // sprmSDyaHdrBottom 3408 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3409 // default 720 twip 3410 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3411 if(pSectionContext) 3412 pSectionContext->SetHeaderBottom( ConversionHelper::convertTwipToMM100( nIntValue ) ); 3413 break; 3414 case 158: 3415 case NS_sprm::LN_SLBetween: // sprmSLBetween 3416 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3417 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3418 if(pSectionContext) 3419 pSectionContext->SetSeparatorLine( nIntValue > 0 ); 3420 break; 3421 case NS_sprm::LN_SVjc: 3422 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */ 3423 break; // sprmSVjc 3424 case 161: 3425 case NS_sprm::LN_SPgnStart: // sprmSPgnStart 3426 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3427 //page number 3428 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3429 if(pSectionContext) 3430 pSectionContext->SetPageNumber( nIntValue ); 3431 break; 3432 case 162: 3433 case NS_sprm::LN_SBOrientation: 3434 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3435 //todo: the old filter assumed that a value of 2 points to double-pages layout 3436 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3437 if(pSectionContext) 3438 pSectionContext->SetLandscape( nIntValue > 0 ); 3439 rContext->Insert( PROP_IS_LANDSCAPE , false, uno::makeAny( nIntValue > 0 )); 3440 break; // sprmSBOrientation 3441 case NS_sprm::LN_SBCustomize: 3442 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */ 3443 break; // sprmSBCustomize 3444 case 165: 3445 case NS_sprm::LN_SYaPage: // sprmSYaPage 3446 { 3447 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3448 //page height, rounded to default values, default: 0x3dc0 twip 3449 sal_Int32 nHeight = ConversionHelper::convertTwipToMM100( nIntValue ); 3450 rContext->Insert( PROP_HEIGHT, false, uno::makeAny( PaperInfo::sloppyFitPageDimension( nHeight ) ) ); 3451 } 3452 break; 3453 case NS_sprm::LN_SXaPage: // sprmSXaPage 3454 { 3455 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3456 //page width, rounded to default values, default 0x2fd0 twip 3457 sal_Int32 nWidth = ConversionHelper::convertTwipToMM100( nIntValue ); 3458 rContext->Insert( PROP_WIDTH, false, uno::makeAny( PaperInfo::sloppyFitPageDimension( nWidth ) ) ); 3459 } 3460 break; 3461 case 166: 3462 case NS_sprm::LN_SDxaLeft: // sprmSDxaLeft 3463 { 3464 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3465 //left page margin default 0x708 twip 3466 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3467 sal_Int32 nConverted = ConversionHelper::convertTwipToMM100( nIntValue ); 3468 if(pSectionContext) 3469 pSectionContext->SetLeftMargin( nConverted ); 3470 rContext->Insert( PROP_LEFT_MARGIN, false, uno::makeAny( nConverted )); 3471 } 3472 break; 3473 case 167: 3474 case NS_sprm::LN_SDxaRight: // sprmSDxaRight 3475 { 3476 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3477 //right page margin default 0x708 twip 3478 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3479 sal_Int32 nConverted = ConversionHelper::convertTwipToMM100( nIntValue ); 3480 if(pSectionContext) 3481 pSectionContext->SetRightMargin( nConverted ); 3482 rContext->Insert( PROP_RIGHT_MARGIN, false, uno::makeAny( nConverted )); 3483 } 3484 break; 3485 case 168: 3486 case NS_sprm::LN_SDyaTop: // sprmSDyaTop 3487 { 3488 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3489 //top page margin default 1440 twip 3490 //todo: check cast of SVBT16 3491 sal_Int32 nConverted = ConversionHelper::convertTwipToMM100( static_cast< sal_Int16 >( nIntValue ) ); 3492 rContext->Insert( PROP_TOP_MARGIN, false, uno::makeAny( nConverted ) ); 3493 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3494 if(pSectionContext) 3495 pSectionContext->SetTopMargin( nConverted ); 3496 } 3497 break; 3498 case 169: 3499 case NS_sprm::LN_SDyaBottom: // sprmSDyaBottom 3500 { 3501 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3502 //bottom page margin default 1440 twip 3503 //todo: check cast of SVBT16 3504 sal_Int32 nConverted = ConversionHelper::convertTwipToMM100( static_cast< sal_Int16 >( nIntValue ) ); 3505 rContext->Insert( PROP_BOTTOM_MARGIN, false, uno::makeAny( nConverted) ); 3506 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3507 if(pSectionContext) 3508 pSectionContext->SetBottomMargin( nConverted ); 3509 } 3510 break; 3511 case 170: 3512 case NS_sprm::LN_SDzaGutter: // sprmSDzaGutter 3513 { 3514 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */ 3515 // gutter is added to one of the margins of a section depending on RTL, can be placed on top either 3516 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3517 if(pSectionContext) 3518 { 3519 pSectionContext->SetDzaGutter( ConversionHelper::convertTwipToMM100( nIntValue ) ); 3520 } 3521 } 3522 break; 3523 case NS_sprm::LN_SDmPaperReq: // sprmSDmPaperReq 3524 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */ 3525 //paper code - no handled in old filter 3526 break; 3527 case NS_sprm::LN_SPropRMark: 3528 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3529 break; // sprmSPropRMark 3530 case NS_sprm::LN_SFBiDi:// sprmSFBiDi 3531 { 3532 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */ 3533 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3534 if(pSectionContext) 3535 pSectionContext->SetSFBiDi( nIntValue > 0 ); 3536 } 3537 break; 3538 case NS_sprm::LN_SFFacingCol: 3539 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3540 break; // sprmSFFacingCol 3541 case NS_sprm::LN_SFRTLGutter: // sprmSFRTLGutter 3542 { 3543 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3544 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3545 if(pSectionContext) 3546 pSectionContext->SetGutterRTL( nIntValue > 0 ); 3547 } 3548 break; 3549 case NS_sprm::LN_SBrcTop: // sprmSBrcTop 3550 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3551 case NS_sprm::LN_SBrcLeft: // sprmSBrcLeft 3552 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3553 case NS_sprm::LN_SBrcBottom: // sprmSBrcBottom 3554 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3555 case NS_sprm::LN_SBrcRight: // sprmSBrcRight 3556 /* WRITERFILTERSTATUS: Sectiondone: 100, planned: 0.5, spent: 0 */ 3557 { 3558 table::BorderLine aBorderLine; 3559 sal_Int32 nLineDistance = ConversionHelper::MakeBorderLine( nIntValue, aBorderLine ); 3560 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3561 if(pSectionContext) 3562 { 3563 static const BorderPosition aPositions[4] = 3564 { 3565 BORDER_TOP, 3566 BORDER_LEFT, 3567 BORDER_BOTTOM, 3568 BORDER_RIGHT 3569 }; 3570 pSectionContext->SetBorder( aPositions[nSprmId - NS_sprm::LN_SBrcTop], nLineDistance, aBorderLine ); 3571 } 3572 } 3573 break; 3574 3575 case NS_sprm::LN_SPgbProp: // sprmSPgbProp 3576 { 3577 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3578 if(pSectionContext) 3579 { 3580 pSectionContext->ApplyBorderToPageStyles( m_pImpl->GetPageStyles(), m_pImpl->GetTextFactory(), nIntValue ); 3581 } 3582 } 3583 break; 3584 case NS_sprm::LN_SDxtCharSpace: 3585 { 3586 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 3587 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3588 if(pSectionContext) 3589 { 3590 pSectionContext->SetDxtCharSpace( nIntValue ); 3591 } 3592 } 3593 break; // sprmSDxtCharSpace 3594 case NS_sprm::LN_SDyaLinePitch: // sprmSDyaLinePitch 3595 { 3596 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3597 //see SwWW8ImplReader::SetDocumentGrid 3598 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3599 if(pSectionContext) 3600 { 3601 pSectionContext->SetGridLinePitch( ConversionHelper::convertTwipToMM100( nIntValue ) ); 3602 } 3603 } 3604 break; 3605 case 0x703a: //undocumented, grid related? 3606 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */ 3607 OSL_ENSURE( false, "TODO: not handled yet"); //nIntValue like 0x008a2373 ? 3608 break; 3609 case NS_sprm::LN_SClm: 3610 { 3611 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 3612 sal_Int16 nGridType = text::TextGridMode::NONE; 3613 switch( nIntValue ) 3614 { 3615 case 0: 3616 nGridType = text::TextGridMode::NONE; 3617 break; 3618 case 3: 3619 //Text snaps to char grid, this doesn't make a lot of sense to 3620 //me. This is closer than LINES_CHARS 3621 nGridType = text::TextGridMode::LINES; 3622 break; 3623 case 1: 3624 nGridType = text::TextGridMode::LINES_AND_CHARS; 3625 break; 3626 case 2: 3627 nGridType = text::TextGridMode::LINES; 3628 break; 3629 default:; 3630 } 3631 rContext->Insert( PROP_GRID_MODE, false, uno::makeAny( nGridType ) ); 3632 3633 //Seems to force this behaviour in word ? 3634 if(nGridType != text::TextGridMode::NONE) 3635 m_pImpl->SetDocumentSettingsProperty( 3636 PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_ADD_EXTERNAL_LEADING ), 3637 uno::makeAny( true ) ); 3638 } 3639 break; // sprmSClm 3640 case NS_sprm::LN_STextFlow: 3641 case NS_ooxml::LN_EG_SectPrContents_textDirection: 3642 /* WRITERFILTERSTATUS: done: 100, planned: 2, spent: 0 */ 3643 { 3644 /* 0 HoriLR 1 Vert TR 2 Vert TR 3 Vert TT 4 HoriLT 3645 only 0 and 1 can be imported correctly 3646 */ 3647 sal_Int16 nDirection = text::WritingMode_LR_TB; 3648 switch( nIntValue ) 3649 { 3650 case 0: 3651 case 4: 3652 nDirection = text::WritingMode_LR_TB; 3653 break; 3654 case 1: 3655 case 2: 3656 case 3: 3657 nDirection = text::WritingMode_TB_RL; 3658 break; 3659 default:; 3660 } 3661 3662 PropertyMap * pTargetContext = rContext.get(); 3663 3664 if (pSectionContext != NULL && 3665 nSprmId == NS_ooxml::LN_EG_SectPrContents_textDirection) 3666 { 3667 pTargetContext = pSectionContext; 3668 } 3669 3670 pTargetContext->Insert(PROP_WRITING_MODE, false, uno::makeAny( nDirection ) ); 3671 } 3672 break; // sprmSTextFlow 3673 case NS_sprm::LN_TJc: // sprmTJc 3674 case NS_sprm::LN_TDxaLeft: 3675 case NS_sprm::LN_TDxaGapHalf: 3676 case NS_sprm::LN_TFCantSplit: 3677 case NS_sprm::LN_TTableHeader: 3678 case NS_sprm::LN_TTableBorders: // sprmTTableBorders 3679 { 3680 OSL_ENSURE( false, "table propeties should be handled by the table manager"); 3681 } 3682 break; 3683 case NS_sprm::LN_TDefTable10: 3684 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3685 break; // sprmTDefTable10 3686 case NS_sprm::LN_TDyaRowHeight: 3687 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3688 break; // sprmTDyaRowHeight 3689 case NS_sprm::LN_TDefTable: 3690 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3691 break; // sprmTDefTable 3692 case NS_sprm::LN_TDefTableShd: 3693 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3694 break; // sprmTDefTableShd 3695 case NS_sprm::LN_TTlp: 3696 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3697 break; // sprmTTlp 3698 case NS_sprm::LN_TFBiDi: 3699 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3700 break; // sprmTFBiDi 3701 case NS_sprm::LN_THTMLProps: 3702 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3703 break; // sprmTHTMLProps 3704 case NS_sprm::LN_TSetBrc: 3705 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3706 break; // sprmTSetBrc 3707 case NS_sprm::LN_TInsert: 3708 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3709 break; // sprmTInsert 3710 case NS_sprm::LN_TDelete: 3711 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3712 break; // sprmTDelete 3713 case NS_sprm::LN_TDxaCol: 3714 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3715 break; // sprmTDxaCol 3716 case NS_sprm::LN_TMerge: 3717 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3718 break; // sprmTMerge 3719 case NS_sprm::LN_TSplit: 3720 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3721 break; // sprmTSplit 3722 case NS_sprm::LN_TSetBrc10: 3723 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3724 break; // sprmTSetBrc10 3725 case 164: // sprmTSetShd 3726 case NS_sprm::LN_TSetShd: 3727 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3728 break; // sprmTSetShd 3729 case NS_sprm::LN_TSetShdOdd: 3730 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3731 break; // sprmTSetShdOdd 3732 case NS_sprm::LN_TTextFlow: 3733 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3734 break; // sprmTTextFlow 3735 case NS_sprm::LN_TDiagLine: 3736 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3737 break; // sprmTDiagLine 3738 case NS_sprm::LN_TVertMerge: 3739 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3740 break; // sprmTVertMerge 3741 case NS_sprm::LN_TVertAlign: 3742 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3743 break; // sprmTVertAlign 3744 // the following are not part of the official documentation 3745 case 0x6870: //TxtForeColor 3746 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3747 { 3748 //contains a color as 0xTTRRGGBB while SO uses 0xTTRRGGBB 3749 sal_Int32 nColor = ConversionHelper::ConvertColor(nIntValue); 3750 rContext->Insert(PROP_CHAR_COLOR, true, uno::makeAny( nColor ) ); 3751 } 3752 break; 3753 case 0x4874: 3754 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3755 break; //seems to be a language id for Asian text - undocumented 3756 case 0x6877: //underlining color 3757 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3758 { 3759 sal_Int32 nColor = ConversionHelper::ConvertColor(nIntValue); 3760 rContext->Insert(PROP_CHAR_UNDERLINE_HAS_COLOR, true, uno::makeAny( true ) ); 3761 rContext->Insert(PROP_CHAR_UNDERLINE_COLOR, true, uno::makeAny( nColor ) ); 3762 } 3763 break; 3764 case 0x6815: 3765 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3766 break; //undocumented 3767 case NS_sprm::LN_CIndrsid: 3768 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3769 break; //undocumented 3770 case 0x6467: 3771 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3772 break; //undocumented 3773 case 0xF617: 3774 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3775 break; //undocumented 3776 case 0xd634: // sprmTNewSpacing - table spacing ( see WW8TabBandDesc::ProcessSpacing() ) 3777 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3778 break; 3779 case NS_sprm::LN_TTRLeft: 3780 /* WRITERFILTERSTATUS: done: 0, planned: 2, spent: 0 */ 3781 break; //undocumented 3782 case 0x4888: 3783 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */ 3784 case 0x6887: 3785 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */ 3786 //properties of list levels - undocumented 3787 break; 3788 case 0xd234: 3789 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */ 3790 case 0xd235: 3791 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */ 3792 case 0xd236: 3793 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */ 3794 case 0xd237: 3795 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */ 3796 break;//undocumented section properties 3797 case NS_sprm::LN_CEastAsianLayout: 3798 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */ 3799 resolveSprmProps(*this, rSprm); 3800 break; 3801 case NS_ooxml::LN_CT_Tabs_tab: 3802 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3803 resolveSprmProps(*this, rSprm); 3804 m_pImpl->IncorporateTabStop(m_pImpl->m_aCurrentTabStop); 3805 m_pImpl->m_aCurrentTabStop = DeletableTabStop(); 3806 break; 3807 case NS_ooxml::LN_CT_PPrBase_tabs: 3808 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3809 { 3810 // Initialize tab stop vector from style sheet 3811 if( !m_pImpl->IsStyleSheetImport() ) 3812 { 3813 uno::Any aValue = m_pImpl->GetPropertyFromStyleSheet(PROP_PARA_TAB_STOPS); 3814 uno::Sequence< style::TabStop > aStyleTabStops; 3815 if(aValue >>= aStyleTabStops) 3816 { 3817 m_pImpl->InitTabStopFromStyle( aStyleTabStops ); 3818 } 3819 } 3820 resolveSprmProps(*this, rSprm); 3821 rContext->Insert(PROP_PARA_TAB_STOPS, true, uno::makeAny( m_pImpl->GetCurrentTabStopAndClear())); 3822 } 3823 break; 3824 3825 case NS_ooxml::LN_CT_PPr_sectPr: 3826 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3827 case NS_ooxml::LN_EG_RPrBase_color: 3828 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3829 case NS_ooxml::LN_EG_RPrBase_rFonts: 3830 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3831 case NS_ooxml::LN_EG_RPrBase_bdr: 3832 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3833 case NS_ooxml::LN_EG_RPrBase_eastAsianLayout: 3834 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3835 case NS_ooxml::LN_EG_RPrBase_u: 3836 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3837 case NS_ooxml::LN_EG_RPrBase_lang: 3838 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3839 case NS_ooxml::LN_CT_PPrBase_spacing: 3840 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3841 case NS_ooxml::LN_CT_PPrBase_ind: 3842 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3843 case NS_ooxml::LN_CT_RPrDefault_rPr: 3844 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3845 case NS_ooxml::LN_CT_PPrDefault_pPr: 3846 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3847 case NS_ooxml::LN_CT_DocDefaults_pPrDefault: 3848 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3849 case NS_ooxml::LN_CT_DocDefaults_rPrDefault: 3850 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3851 case NS_ooxml::LN_CT_Style_pPr: 3852 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3853 case NS_ooxml::LN_CT_Style_rPr: 3854 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3855 case NS_ooxml::LN_CT_PPr_rPr: 3856 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3857 case NS_ooxml::LN_CT_PPrBase_numPr: 3858 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3859 resolveSprmProps(*this, rSprm); 3860 break; 3861 case NS_ooxml::LN_EG_SectPrContents_footnotePr: 3862 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3863 case NS_ooxml::LN_EG_SectPrContents_endnotePr: 3864 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3865 m_pImpl->SetInFootnoteProperties( NS_ooxml::LN_EG_SectPrContents_footnotePr == nSprmId ); 3866 resolveSprmProps(*this, rSprm); 3867 break; 3868 case NS_ooxml::LN_EG_SectPrContents_lnNumType: 3869 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */ 3870 { 3871 resolveSprmProps(*this, rSprm); 3872 LineNumberSettings aSettings = m_pImpl->GetLineNumberSettings(); 3873 aSettings.bIsOn = true; 3874 m_pImpl->SetLineNumberSettings( aSettings ); 3875 //apply settings at XLineNumberingProperties 3876 try 3877 { 3878 uno::Reference< text::XLineNumberingProperties > xLineNumberingProperties( m_pImpl->GetTextDocument(), uno::UNO_QUERY_THROW ); 3879 uno::Reference< beans::XPropertySet > xLineNumberingPropSet = xLineNumberingProperties->getLineNumberingProperties(); 3880 PropertyNameSupplier& rNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier(); 3881 xLineNumberingPropSet->setPropertyValue(rNameSupplier.GetName( PROP_IS_ON ), uno::makeAny(true) ); 3882 if( aSettings.nInterval ) 3883 xLineNumberingPropSet->setPropertyValue(rNameSupplier.GetName( PROP_INTERVAL ), uno::makeAny((sal_Int16)aSettings.nInterval) ); 3884 if( aSettings.nDistance ) 3885 xLineNumberingPropSet->setPropertyValue(rNameSupplier.GetName( PROP_DISTANCE ), uno::makeAny(aSettings.nDistance) ); 3886 xLineNumberingPropSet->setPropertyValue(rNameSupplier.GetName( PROP_RESTART_AT_EACH_PAGE ), uno::makeAny(aSettings.bRestartAtEachPage) ); 3887 } 3888 catch( const uno::Exception& ) 3889 { 3890 } 3891 3892 } 3893 break; 3894 case NS_ooxml::LN_CT_PPrBase_framePr: 3895 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3896 { 3897 PropertyMapPtr pContext = m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH); 3898 if( pContext.get() ) 3899 { 3900 ParagraphPropertyMap* pParaContext = dynamic_cast< ParagraphPropertyMap* >( pContext.get() ); 3901 pParaContext->SetFrameMode(); 3902 3903 } 3904 else 3905 { 3906 //TODO: What about style sheet import of frame properties 3907 } 3908 resolveSprmProps(*this, rSprm); 3909 } 3910 break; 3911 case NS_ooxml::LN_EG_SectPrContents_pgSz: 3912 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3913 CT_PageSz.code = 0; 3914 { 3915 PaperInfo aLetter(PAPER_LETTER); 3916 CT_PageSz.w = aLetter.getWidth(); 3917 CT_PageSz.h = aLetter.getHeight(); 3918 } 3919 CT_PageSz.orient = false; 3920 resolveSprmProps(*this, rSprm); 3921 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3922 if(pSectionContext) 3923 { 3924 pSectionContext->Insert( PROP_HEIGHT, false, uno::makeAny( CT_PageSz.h ) ); 3925 pSectionContext->Insert( PROP_IS_LANDSCAPE, false, uno::makeAny( CT_PageSz.orient )); 3926 pSectionContext->Insert( PROP_WIDTH, false, uno::makeAny( CT_PageSz.w ) ); 3927 pSectionContext->SetLandscape( CT_PageSz.orient ); 3928 } 3929 break; 3930 3931 case NS_ooxml::LN_EG_SectPrContents_pgMar: 3932 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3933 m_pImpl->InitPageMargins(); 3934 resolveSprmProps(*this, rSprm); 3935 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 3936 if(pSectionContext) 3937 { 3938 const _PageMar& rPageMar = m_pImpl->GetPageMargins(); 3939 pSectionContext->SetTopMargin( rPageMar.top ); 3940 pSectionContext->SetRightMargin( rPageMar.right ); 3941 pSectionContext->SetBottomMargin( rPageMar.bottom ); 3942 pSectionContext->SetLeftMargin( rPageMar.left ); 3943 pSectionContext->SetHeaderTop( rPageMar.header ); 3944 pSectionContext->SetHeaderBottom( rPageMar.footer ); 3945 } 3946 break; 3947 3948 case NS_ooxml::LN_EG_SectPrContents_cols: 3949 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 3950 { 3951 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps(); 3952 if( pProperties.get()) 3953 { 3954 3955 SectionColumnHandlerPtr pSectHdl( new SectionColumnHandler ); 3956 pProperties->resolve(*pSectHdl); 3957 if(pSectionContext) 3958 { 3959 if( pSectHdl->IsEqualWidth() ) 3960 { 3961 pSectionContext->SetEvenlySpaced( true ); 3962 pSectionContext->SetColumnCount( (sal_Int16) (pSectHdl->GetNum() - 1) ); 3963 pSectionContext->SetColumnDistance( pSectHdl->GetSpace() ); 3964 pSectionContext->SetSeparatorLine( pSectHdl->IsSeparator() ); 3965 } 3966 else if( !pSectHdl->GetColumns().empty() ) 3967 { 3968 pSectionContext->SetEvenlySpaced( false ); 3969 pSectionContext->SetColumnDistance( pSectHdl->GetSpace() ); 3970 pSectionContext->SetColumnCount( (sal_Int16)(pSectHdl->GetColumns().size() -1)); 3971 std::vector<_Column>::const_iterator tmpIter = pSectHdl->GetColumns().begin(); 3972 for (; tmpIter != pSectHdl->GetColumns().end(); tmpIter++) 3973 { 3974 pSectionContext->AppendColumnWidth( tmpIter->nWidth ); 3975 if ((tmpIter != pSectHdl->GetColumns().end() - 1) || (tmpIter->nSpace > 0)) 3976 pSectionContext->AppendColumnSpacing( tmpIter->nSpace ); 3977 } 3978 pSectionContext->SetSeparatorLine( pSectHdl->IsSeparator() ); 3979 } 3980 else if( pSectHdl->GetNum() > 0 ) 3981 { 3982 pSectionContext->SetColumnCount( (sal_Int16)pSectHdl->GetNum() - 1 ); 3983 pSectionContext->SetColumnDistance( pSectHdl->GetSpace() ); 3984 } 3985 } 3986 } 3987 } 3988 break; 3989 case NS_ooxml::LN_EG_SectPrContents_docGrid: 3990 resolveSprmProps(*this, rSprm); 3991 break; 3992 case NS_ooxml::LN_EG_SectPrContents_pgBorders: 3993 { 3994 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps(); 3995 if( pProperties.get( ) && pSectionContext ) 3996 { 3997 PageBordersHandlerPtr pHandler( new PageBordersHandler ); 3998 pProperties->resolve( *pHandler ); 3999 4000 // Set the borders to the context and apply them to the styles 4001 pHandler->SetBorders( pSectionContext ); 4002 pSectionContext->SetBorderParams( pHandler->GetDisplayOffset( ) ); 4003 } 4004 } 4005 break; 4006 4007 case NS_ooxml::LN_CT_PPrBase_pStyle: 4008 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 4009 { 4010 m_pImpl->SetCurrentParaStyleId( sStringValue ); 4011 StyleSheetTablePtr pStyleTable = m_pImpl->GetStyleSheetTable(); 4012 const ::rtl::OUString sConvertedStyleName = pStyleTable->ConvertStyleName( sStringValue, true ); 4013 if (m_pImpl->GetTopContext() && m_pImpl->GetTopContextType() != CONTEXT_SECTION) 4014 m_pImpl->GetTopContext()->Insert( PROP_PARA_STYLE_NAME, true, uno::makeAny( sConvertedStyleName )); 4015 const StyleSheetEntryPtr pEntry = pStyleTable->FindStyleSheetByISTD(sStringValue); 4016 //apply numbering to paragraph if it was set at the style 4017 OSL_ENSURE( pEntry.get(), "no style sheet found" ); 4018 const StyleSheetPropertyMap* pStyleSheetProperties = dynamic_cast<const StyleSheetPropertyMap*>(pEntry ? pEntry->pProperties.get() : 0); 4019 4020 if( pStyleSheetProperties && pStyleSheetProperties->GetListId() >= 0 ) 4021 rContext->Insert( PROP_NUMBERING_STYLE_NAME, true, uno::makeAny( 4022 ListDef::GetStyleName( pStyleSheetProperties->GetListId( ) ) ), false); 4023 4024 if( pStyleSheetProperties && pStyleSheetProperties->GetListLevel() >= 0 ) 4025 rContext->Insert( PROP_NUMBERING_LEVEL, true, uno::makeAny(pStyleSheetProperties->GetListLevel()), false); 4026 } 4027 break; 4028 case NS_ooxml::LN_EG_RPrBase_rStyle: 4029 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 4030 { 4031 rtl::OUString sConvertedName( m_pImpl->GetStyleSheetTable()->ConvertStyleName( sStringValue, true ) ); 4032 // First check if the style exists in the document. 4033 StyleSheetEntryPtr pEntry = m_pImpl->GetStyleSheetTable( )->FindStyleSheetByStyleName( sConvertedName ); 4034 bool bExists = pEntry.get( ) && ( pEntry->nStyleTypeCode == STYLE_TYPE_CHAR ); 4035 4036 // Add the property if the style exists 4037 if ( bExists && m_pImpl->GetTopContext() ) 4038 m_pImpl->GetTopContext()->Insert( PROP_CHAR_STYLE_NAME, true, uno::makeAny( sConvertedName ) ); 4039 } 4040 break; 4041 case NS_ooxml::LN_CT_TblPrBase_tblCellMar: //cell margins 4042 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 4043 { 4044 resolveSprmProps(*this, rSprm);//contains LN_CT_TblCellMar_top, LN_CT_TblCellMar_left, LN_CT_TblCellMar_bottom, LN_CT_TblCellMar_right 4045 } 4046 break; 4047 case NS_ooxml::LN_CT_TblCellMar_top: 4048 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */ 4049 case NS_ooxml::LN_CT_TblCellMar_left: 4050 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */ 4051 case NS_ooxml::LN_CT_TblCellMar_bottom: 4052 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */ 4053 case NS_ooxml::LN_CT_TblCellMar_right: 4054 /* WRITERFILTERSTATUS: done: 100, planned: 0, spent: 0 */ 4055 { 4056 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps(); 4057 if( pProperties.get()) 4058 { 4059 MeasureHandlerPtr pMeasureHandler( new MeasureHandler ); 4060 pProperties->resolve(*pMeasureHandler); 4061 sal_Int32 nMeasureValue = pMeasureHandler->getMeasureValue(); 4062 PropertyIds eId = META_PROP_CELL_MAR_TOP; 4063 switch(nSprmId) 4064 { 4065 case NS_ooxml::LN_CT_TblCellMar_top: 4066 /* WRITERFILTERSTATUS: */ 4067 break; 4068 case NS_ooxml::LN_CT_TblCellMar_left: 4069 /* WRITERFILTERSTATUS: */ 4070 eId = META_PROP_CELL_MAR_LEFT; 4071 break; 4072 case NS_ooxml::LN_CT_TblCellMar_bottom: 4073 /* WRITERFILTERSTATUS: */ 4074 eId = META_PROP_CELL_MAR_BOTTOM; 4075 break; 4076 case NS_ooxml::LN_CT_TblCellMar_right: 4077 /* WRITERFILTERSTATUS: */ 4078 eId = META_PROP_CELL_MAR_RIGHT; 4079 break; 4080 default:; 4081 } 4082 rContext->Insert( eId, false, uno::makeAny(nMeasureValue), false); 4083 } 4084 } 4085 break; 4086 case NS_sprm::LN_CFNoProof: //0x875 no grammar and spell checking, unsupported 4087 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */ 4088 break; 4089 case NS_ooxml::LN_anchor_anchor: // at_character drawing 4090 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 4091 case NS_ooxml::LN_inline_inline: // as_character drawing 4092 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 4093 { 4094 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps(); 4095 if( pProperties.get()) 4096 { 4097 GraphicImportType eGraphicType = 4098 (NS_ooxml::LN_anchor_anchor == 4099 sal::static_int_cast<Id>(nSprmId)) ? 4100 IMPORT_AS_DETECTED_ANCHOR : 4101 IMPORT_AS_DETECTED_INLINE; 4102 GraphicImportPtr pGraphicImport = 4103 m_pImpl->GetGraphicImport(eGraphicType); 4104 pProperties->resolve(*pGraphicImport); 4105 m_pImpl->ImportGraphic(pProperties, eGraphicType); 4106 if( !pGraphicImport->IsGraphic() ) 4107 { 4108 m_pImpl->ResetGraphicImport(); 4109 // todo: It's a shape, now start shape import 4110 } 4111 } 4112 } 4113 break; 4114 case NS_ooxml::LN_EG_RPrBase_vertAlign: 4115 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 4116 { 4117 sal_Int16 nEscapement = 0; 4118 sal_Int8 nProp = 58; 4119 if( sStringValue.equalsAscii( "superscript" )) 4120 nEscapement = 101; 4121 else if( sStringValue.equalsAscii( "subscript" )) 4122 nEscapement = -101; 4123 else 4124 nProp = 100; 4125 4126 rContext->Insert(PROP_CHAR_ESCAPEMENT, true, uno::makeAny( nEscapement ) ); 4127 rContext->Insert(PROP_CHAR_ESCAPEMENT_HEIGHT, true, uno::makeAny( nProp ) ); 4128 } 4129 break; 4130 // case NS_ooxml::LN_CT_FtnEdn_type 4131 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */ 4132 // case NS_ooxml::LN_CT_FtnEdn_id 4133 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */ 4134 // case NS_ooxml::LN_EG_FtnEdnNumProps_numRestart 4135 case NS_ooxml::LN_CT_FtnProps_pos: 4136 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 4137 //footnotes in word can be at page end or beneath text - writer supports only the first 4138 //endnotes in word can be at section end or document end - writer supports only the latter 4139 // -> so this property can be ignored 4140 break; 4141 case NS_ooxml::LN_EG_FtnEdnNumProps_numStart: 4142 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 4143 case NS_ooxml::LN_CT_FtnProps_numFmt: 4144 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 4145 case NS_ooxml::LN_CT_EdnProps_numFmt: 4146 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 4147 { 4148 try 4149 { 4150 uno::Reference< beans::XPropertySet > xFtnEdnSettings; 4151 if( m_pImpl->IsInFootnoteProperties() ) 4152 { 4153 uno::Reference< text::XFootnotesSupplier> xFootnotesSupplier( m_pImpl->GetTextDocument(), uno::UNO_QUERY ); 4154 xFtnEdnSettings = xFootnotesSupplier->getFootnoteSettings(); 4155 } 4156 else 4157 { 4158 uno::Reference< text::XEndnotesSupplier> xEndnotesSupplier( m_pImpl->GetTextDocument(), uno::UNO_QUERY ); 4159 xFtnEdnSettings = xEndnotesSupplier->getEndnoteSettings(); 4160 } 4161 if( NS_ooxml::LN_EG_FtnEdnNumProps_numStart == nSprmId ) 4162 { 4163 xFtnEdnSettings->setPropertyValue( 4164 PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_START_AT), 4165 uno::makeAny( sal_Int16( nIntValue - 1 ))); 4166 } 4167 else 4168 { 4169 sal_Int16 nNumType = ConversionHelper::ConvertNumberingType( nIntValue ); 4170 xFtnEdnSettings->setPropertyValue( 4171 PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_NUMBERING_TYPE), 4172 uno::makeAny( nNumType )); 4173 } 4174 } 4175 catch( const uno::Exception& ) 4176 { 4177 } 4178 } 4179 break; 4180 case NS_ooxml::LN_paratrackchange: 4181 m_pImpl->StartParaChange( ); 4182 case NS_ooxml::LN_trackchange: 4183 /* WRITERFILTERSTATUS: done: 100, planned: 5, spent: 0 */ 4184 case NS_ooxml::LN_EG_RPrContent_rPrChange: 4185 /* WRITERFILTERSTATUS: done: 100, planned: 5, spent: 0 */ 4186 { 4187 m_pImpl->AddNewRedline( ); 4188 resolveSprmProps(*this, rSprm ); 4189 // now the properties author, date and id should be available 4190 sal_Int32 nToken = m_pImpl->GetCurrentRedlineToken(); 4191 switch( nToken & 0xffff ) 4192 { 4193 case ooxml::OOXML_mod : 4194 case ooxml::OOXML_ins : 4195 case ooxml::OOXML_del : break; 4196 default: OSL_ENSURE( false, "redline token other than mod, ins or del" ); 4197 } 4198 m_pImpl->EndParaChange( ); 4199 } 4200 break; 4201 case NS_ooxml::LN_CT_RPrChange_rPr: 4202 /* WRITERFILTERSTATUS: done: 100, planned: 5, spent: 0 */ 4203 break; 4204 /* WRITERFILTERSTATUS: done: 0, planned: 4, spent: 0 */ 4205 case NS_ooxml::LN_object: 4206 { 4207 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps(); 4208 if( pProperties.get( ) ) 4209 { 4210 OLEHandlerPtr pOLEHandler( new OLEHandler ); 4211 pProperties->resolve(*pOLEHandler); 4212 if ( pOLEHandler->isOLEObject( ) ) 4213 { 4214 ::rtl::OUString sStreamName = pOLEHandler->copyOLEOStream( m_pImpl->GetTextDocument() ); 4215 if( sStreamName.getLength() ) 4216 { 4217 m_pImpl->appendOLE( sStreamName, pOLEHandler ); 4218 } 4219 } 4220 } 4221 } 4222 break; 4223 // case NS_ooxml::LN_CT_EdnProps_pos 4224 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */ 4225 // case NS_ooxml::LN_CT_EdnProps_numFmt 4226 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */ 4227 // case NS_ooxml::LN_CT_FtnDocProps_footnote 4228 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */ 4229 // case NS_ooxml::LN_CT_EdnDocProps_endnote 4230 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */ 4231 //break; 4232 case NS_ooxml::LN_EG_HdrFtrReferences_headerReference: // header reference - not needed 4233 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 4234 case NS_ooxml::LN_EG_HdrFtrReferences_footerReference: // footer reference - not needed 4235 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */ 4236 break; 4237 case NS_ooxml::LN_EG_RPrBase_snapToGrid: // "Use document grid settings for inter-paragraph spacing" 4238 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */ 4239 break; 4240 case NS_sprm::LN_PContextualSpacing: 4241 //TODO: determines whether top/bottom paragraph spacing is added if equal styles are following - unsupported 4242 break; 4243 case NS_ooxml::LN_EG_SectPrContents_formProt: //section protection, only form editing is enabled - unsupported 4244 case NS_ooxml::LN_EG_SectPrContents_vAlign: 4245 case NS_ooxml::LN_EG_RPrBase_fitText: 4246 /* WRITERFILTERSTATUS: done: 0, planned: 0, spent: 0 */ 4247 break; 4248 case NS_ooxml::LN_ffdata: 4249 { 4250 writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps(); 4251 if (pProperties.get() != NULL) 4252 { 4253 FFDataHandler::Pointer_t pFFDataHandler(new FFDataHandler()); 4254 4255 pProperties->resolve(*pFFDataHandler); 4256 m_pImpl->SetFieldFFData(pFFDataHandler); 4257 } 4258 } 4259 break; 4260 default: 4261 { 4262 #ifdef DEBUG_DOMAINMAPPER 4263 dmapper_logger->startElement("unhandled"); 4264 dmapper_logger->attribute("id", nSprmId); 4265 dmapper_logger->endElement("unhandled"); 4266 #endif 4267 } 4268 } 4269 } 4270 /*-- 09.06.2006 09:52:13--------------------------------------------------- 4271 4272 -----------------------------------------------------------------------*/ 4273 void DomainMapper::lcl_entry(int /*pos*/, 4274 writerfilter::Reference<Properties>::Pointer_t ref) 4275 { 4276 ref->resolve(*this); 4277 } 4278 /*-- 09.06.2006 09:52:13--------------------------------------------------- 4279 4280 -----------------------------------------------------------------------*/ 4281 void DomainMapper::data(const sal_uInt8* /*buf*/, size_t /*len*/, 4282 writerfilter::Reference<Properties>::Pointer_t /*ref*/) 4283 { 4284 } 4285 /*-- 09.06.2006 09:52:13--------------------------------------------------- 4286 4287 -----------------------------------------------------------------------*/ 4288 void DomainMapper::lcl_startSectionGroup() 4289 { 4290 m_pImpl->PushProperties(CONTEXT_SECTION); 4291 } 4292 /*-- 09.06.2006 09:52:13--------------------------------------------------- 4293 4294 -----------------------------------------------------------------------*/ 4295 void DomainMapper::lcl_endSectionGroup() 4296 { 4297 PropertyMapPtr pContext = m_pImpl->GetTopContextOfType(CONTEXT_SECTION); 4298 SectionPropertyMap* pSectionContext = dynamic_cast< SectionPropertyMap* >( pContext.get() ); 4299 OSL_ENSURE(pSectionContext, "SectionContext unavailable!"); 4300 if(pSectionContext) 4301 pSectionContext->CloseSectionGroup( *m_pImpl ); 4302 m_pImpl->PopProperties(CONTEXT_SECTION); 4303 } 4304 /*-- 09.06.2006 09:52:13--------------------------------------------------- 4305 4306 -----------------------------------------------------------------------*/ 4307 void DomainMapper::lcl_startParagraphGroup() 4308 { 4309 m_pImpl->getTableManager().startParagraphGroup(); 4310 m_pImpl->PushProperties(CONTEXT_PARAGRAPH); 4311 static ::rtl::OUString sDefault( ::rtl::OUString::createFromAscii("Standard") ); 4312 if (m_pImpl->GetTopContext()) 4313 { 4314 m_pImpl->GetTopContext()->Insert( PROP_PARA_STYLE_NAME, true, uno::makeAny( sDefault ) ); 4315 if (m_pImpl->isBreakDeferred(PAGE_BREAK)) 4316 m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_PAGE_BEFORE) ); 4317 else if (m_pImpl->isBreakDeferred(COLUMN_BREAK)) 4318 m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_COLUMN_BEFORE) ); 4319 } 4320 m_pImpl->clearDeferredBreaks(); 4321 } 4322 /*-- 09.06.2006 09:52:14--------------------------------------------------- 4323 4324 -----------------------------------------------------------------------*/ 4325 void DomainMapper::lcl_endParagraphGroup() 4326 { 4327 m_pImpl->PopProperties(CONTEXT_PARAGRAPH); 4328 m_pImpl->getTableManager().endParagraphGroup(); 4329 //frame conversion has to be executed after table conversion 4330 m_pImpl->ExecuteFrameConversion(); 4331 } 4332 4333 void DomainMapper::markLastParagraphInSection( ) 4334 { 4335 m_pImpl->SetIsLastParagraphInSection( true ); 4336 } 4337 4338 void DomainMapper::lcl_startShape( uno::Reference< drawing::XShape > xShape ) 4339 { 4340 m_pImpl->PushShapeContext( xShape ); 4341 } 4342 4343 void DomainMapper::lcl_endShape( ) 4344 { 4345 m_pImpl->PopShapeContext( ); 4346 } 4347 4348 /*-- 13.06.2007 16:15:55--------------------------------------------------- 4349 4350 -----------------------------------------------------------------------*/ 4351 void DomainMapper::PushStyleSheetProperties( PropertyMapPtr pStyleProperties, bool bAffectTableMngr ) 4352 { 4353 m_pImpl->PushStyleProperties( pStyleProperties ); 4354 if ( bAffectTableMngr ) 4355 m_pImpl->getTableManager( ).SetStyleProperties( pStyleProperties ); 4356 } 4357 /*-- 13.06.2007 16:15:55--------------------------------------------------- 4358 4359 -----------------------------------------------------------------------*/ 4360 void DomainMapper::PopStyleSheetProperties( bool bAffectTableMngr ) 4361 { 4362 m_pImpl->PopProperties( CONTEXT_STYLESHEET ); 4363 if ( bAffectTableMngr ) 4364 { 4365 PropertyMapPtr emptyPtr; 4366 m_pImpl->getTableManager( ).SetStyleProperties( emptyPtr ); 4367 } 4368 } 4369 /*-- 28.01.2008 14:52:33--------------------------------------------------- 4370 4371 -----------------------------------------------------------------------*/ 4372 void DomainMapper::PushListProperties( ::boost::shared_ptr<PropertyMap> pListProperties ) 4373 { 4374 m_pImpl->PushListProperties( pListProperties ); 4375 } 4376 /*-- 28.01.2008 14:52:33--------------------------------------------------- 4377 4378 -----------------------------------------------------------------------*/ 4379 void DomainMapper::PopListProperties() 4380 { 4381 m_pImpl->PopProperties( CONTEXT_LIST ); 4382 } 4383 /*-- 09.06.2006 09:52:14--------------------------------------------------- 4384 4385 -----------------------------------------------------------------------*/ 4386 4387 void DomainMapper::lcl_startCharacterGroup() 4388 { 4389 m_pImpl->PushProperties(CONTEXT_CHARACTER); 4390 } 4391 /*-- 09.06.2006 09:52:14--------------------------------------------------- 4392 4393 -----------------------------------------------------------------------*/ 4394 void DomainMapper::lcl_endCharacterGroup() 4395 { 4396 m_pImpl->PopProperties(CONTEXT_CHARACTER); 4397 } 4398 /*-- 09.06.2006 09:52:14--------------------------------------------------- 4399 4400 -----------------------------------------------------------------------*/ 4401 void DomainMapper::lcl_text(const sal_uInt8 * data_, size_t len) 4402 { 4403 //TODO: Determine the right text encoding (FIB?) 4404 ::rtl::OUString sText( (const sal_Char*) data_, len, RTL_TEXTENCODING_MS_1252 ); 4405 #ifdef DEBUG_DOMAINMAPPER 4406 dmapper_logger->startElement("text"); 4407 dmapper_logger->chars(sText); 4408 dmapper_logger->endElement("text"); 4409 #endif 4410 4411 try 4412 { 4413 if(len == 1) 4414 { 4415 switch(*data_) 4416 { 4417 case 0x02: return; //footnote character 4418 case 0x0c: //page break 4419 m_pImpl->deferBreak(PAGE_BREAK); 4420 return; 4421 case 0x0e: //column break 4422 m_pImpl->deferBreak(COLUMN_BREAK); 4423 return; 4424 case 0x07: 4425 m_pImpl->getTableManager().text(data_, len); 4426 case 0x0d: 4427 m_pImpl->finishParagraph(m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH)); 4428 return; 4429 case 0x13: 4430 m_pImpl->PushFieldContext(); 4431 return; 4432 case 0x14: 4433 // delimiter not necessarily available 4434 // appears only if field contains further content 4435 m_pImpl->CloseFieldCommand(); 4436 return; 4437 case 0x15: /* end of field */ 4438 m_pImpl->PopFieldContext(); 4439 return; 4440 default: 4441 break; 4442 } 4443 } 4444 4445 PropertyMapPtr pContext = m_pImpl->GetTopContext(); 4446 if ( pContext && !pContext->GetFootnote().is() ) 4447 { 4448 if (m_pImpl->isBreakDeferred(PAGE_BREAK)) 4449 m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_PAGE_BEFORE) ); 4450 else if (m_pImpl->isBreakDeferred(COLUMN_BREAK)) 4451 m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_COLUMN_BEFORE) ); 4452 m_pImpl->clearDeferredBreaks(); 4453 } 4454 4455 if( pContext->GetFootnote().is() && m_pImpl->IsCustomFtnMark() ) 4456 { 4457 pContext->GetFootnote()->setLabel( sText ); 4458 m_pImpl->SetCustomFtnMark( false ); 4459 //otherwise ignore sText 4460 } 4461 else if( m_pImpl->IsOpenFieldCommand() ) 4462 m_pImpl->AppendFieldCommand(sText); 4463 else if( m_pImpl->IsOpenField() && m_pImpl->IsFieldResultAsString()) 4464 /*depending on the success of the field insert operation this result will be 4465 set at the field or directly inserted into the text*/ 4466 m_pImpl->SetFieldResult( sText ); 4467 else 4468 { 4469 //--> debug 4470 //sal_uInt32 nSize = pContext->size(); 4471 //<-- 4472 4473 if( !bool(pContext)) 4474 pContext.reset(new PropertyMap()); 4475 4476 m_pImpl->appendTextPortion( sText, pContext ); 4477 } 4478 } 4479 catch( const uno::RuntimeException& ) 4480 { 4481 std::clog << __FILE__ << "(l" << __LINE__ << ")" << std::endl; 4482 } 4483 } 4484 /*-- 09.06.2006 09:52:15--------------------------------------------------- 4485 4486 -----------------------------------------------------------------------*/ 4487 void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len) 4488 { 4489 OUString sText; 4490 OUStringBuffer aBuffer = OUStringBuffer(len); 4491 aBuffer.append( (const sal_Unicode *) data_, len); 4492 sText = aBuffer.makeStringAndClear(); 4493 4494 try 4495 { 4496 m_pImpl->getTableManager().utext(data_, len); 4497 4498 if(len == 1 && ((*data_) == 0x0d || (*data_) == 0x07)) 4499 m_pImpl->finishParagraph(m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH)); 4500 else 4501 { 4502 4503 PropertyMapPtr pContext = m_pImpl->GetTopContext(); 4504 if ( pContext && !pContext->GetFootnote().is() ) 4505 { 4506 if (m_pImpl->isBreakDeferred(PAGE_BREAK)) 4507 m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_PAGE_BEFORE) ); 4508 else if (m_pImpl->isBreakDeferred(COLUMN_BREAK)) 4509 m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, true, uno::makeAny( com::sun::star::style::BreakType_COLUMN_BEFORE) ); 4510 m_pImpl->clearDeferredBreaks(); 4511 } 4512 4513 /* doesn't seem to be working 4514 if( pContext->GetFootnote().is() ) 4515 { 4516 //todo: the check for 0x0a is a hack! 4517 if( *data_ != 0x0a && !pContext->GetFootnoteSymbol() ) 4518 pContext->GetFootnote()->setLabel( sText ); 4519 //otherwise ignore sText 4520 } 4521 else */ 4522 if( pContext && pContext->GetFootnote().is() ) 4523 { 4524 if( !pContext->GetFootnoteSymbol() ) 4525 pContext->GetFootnote()->setLabel( sText ); 4526 //otherwise ignore sText 4527 } 4528 else if( m_pImpl->IsOpenFieldCommand() ) 4529 m_pImpl->AppendFieldCommand(sText); 4530 else if( m_pImpl->IsOpenField() && m_pImpl->IsFieldResultAsString()) 4531 /*depending on the success of the field insert operation this result will be 4532 set at the field or directly inserted into the text*/ 4533 m_pImpl->SetFieldResult( sText ); 4534 else 4535 { 4536 if( !bool(pContext)) 4537 pContext.reset(new PropertyMap()); 4538 4539 m_pImpl->appendTextPortion( sText, pContext ); 4540 } 4541 4542 } 4543 } 4544 catch( const uno::RuntimeException& ) 4545 { 4546 } 4547 } 4548 /*-- 09.06.2006 09:52:15--------------------------------------------------- 4549 4550 -----------------------------------------------------------------------*/ 4551 void DomainMapper::lcl_props(writerfilter::Reference<Properties>::Pointer_t ref) 4552 { 4553 string sType = ref->getType(); 4554 if( sType == "PICF" ) 4555 { 4556 m_pImpl->ImportGraphic(ref, IMPORT_AS_GRAPHIC); 4557 } 4558 else if( sType == "FSPA" ) 4559 { 4560 m_pImpl->ImportGraphic(ref, IMPORT_AS_SHAPE); 4561 } 4562 else 4563 ref->resolve(*this); 4564 } 4565 /*-- 09.06.2006 09:52:15--------------------------------------------------- 4566 4567 -----------------------------------------------------------------------*/ 4568 void DomainMapper::lcl_table(Id name, writerfilter::Reference<Table>::Pointer_t ref) 4569 { 4570 // printf ( "DomainMapper::table(0x%.4x)\n", (unsigned int)name); 4571 m_pImpl->SetAnyTableImport(true); 4572 /* WRITERFILTERSTATUS: table: attributedata */ 4573 switch(name) 4574 { 4575 case NS_rtf::LN_FONTTABLE: 4576 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */ 4577 4578 // create a font table object that listens to the attributes 4579 // each entry call inserts a new font entry 4580 ref->resolve( *m_pImpl->GetFontTable() ); 4581 break; 4582 case NS_rtf::LN_STYLESHEET: 4583 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */ 4584 //same as above to import style sheets 4585 m_pImpl->SetStyleSheetImport( true ); 4586 ref->resolve( *m_pImpl->GetStyleSheetTable() ); 4587 m_pImpl->GetStyleSheetTable()->ApplyStyleSheets(m_pImpl->GetFontTable()); 4588 m_pImpl->SetStyleSheetImport( false ); 4589 break; 4590 case NS_ooxml::LN_NUMBERING: 4591 case NS_rtf::LN_LISTTABLE: 4592 { 4593 /* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */ 4594 4595 //the same for list tables 4596 ref->resolve( *m_pImpl->GetListTable() ); 4597 m_pImpl->GetListTable( )->CreateNumberingRules( ); 4598 } 4599 break; 4600 case NS_rtf::LN_LFOTABLE: 4601 { 4602 m_pImpl->GetListTable( )->SetLFOImport( true ); 4603 ref->resolve( *m_pImpl->GetListTable() ); 4604 m_pImpl->GetListTable( )->CreateNumberingRules( ); 4605 m_pImpl->GetListTable( )->SetLFOImport( false ); 4606 } 4607 break; 4608 case NS_ooxml::LN_THEMETABLE: 4609 ref->resolve ( *m_pImpl->GetThemeTable() ); 4610 break; 4611 case NS_ooxml::LN_settings_settings: 4612 ref->resolve ( *m_pImpl->GetSettingsTable() ); 4613 m_pImpl->ApplySettingsTable(); 4614 break; 4615 default: 4616 OSL_ENSURE( false, "which table is to be filled here?"); 4617 } 4618 m_pImpl->SetAnyTableImport(false); 4619 } 4620 /*-- 09.06.2006 09:52:16--------------------------------------------------- 4621 4622 -----------------------------------------------------------------------*/ 4623 void DomainMapper::lcl_substream(Id rName, ::writerfilter::Reference<Stream>::Pointer_t ref) 4624 { 4625 m_pImpl->appendTableManager( ); 4626 m_pImpl->getTableManager().startLevel(); 4627 4628 //->debug 4629 //string sName = (*QNameToString::Instance())(rName); 4630 //--<debug 4631 //import of page header/footer 4632 4633 /* WRITERFILTERSTATUS: table: attributedata */ 4634 switch( rName ) 4635 { 4636 case NS_rtf::LN_headerl: 4637 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */ 4638 4639 m_pImpl->PushPageHeader(SectionPropertyMap::PAGE_LEFT); 4640 break; 4641 case NS_rtf::LN_headerr: 4642 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */ 4643 4644 m_pImpl->PushPageHeader(SectionPropertyMap::PAGE_RIGHT); 4645 break; 4646 case NS_rtf::LN_headerf: 4647 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */ 4648 4649 m_pImpl->PushPageHeader(SectionPropertyMap::PAGE_FIRST); 4650 break; 4651 case NS_rtf::LN_footerl: 4652 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */ 4653 4654 m_pImpl->PushPageFooter(SectionPropertyMap::PAGE_LEFT); 4655 break; 4656 case NS_rtf::LN_footerr: 4657 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */ 4658 4659 m_pImpl->PushPageFooter(SectionPropertyMap::PAGE_RIGHT); 4660 break; 4661 case NS_rtf::LN_footerf: 4662 /* WRITERFILTERSTATUS: done: 50, planned: 2, spent: 0 */ 4663 4664 m_pImpl->PushPageFooter(SectionPropertyMap::PAGE_FIRST); 4665 break; 4666 case NS_rtf::LN_footnote: 4667 case NS_rtf::LN_endnote: 4668 m_pImpl->PushFootOrEndnote( NS_rtf::LN_footnote == rName ); 4669 break; 4670 case NS_rtf::LN_annotation : 4671 m_pImpl->PushAnnotation(); 4672 break; 4673 } 4674 ref->resolve(*this); 4675 switch( rName ) 4676 { 4677 case NS_rtf::LN_headerl: 4678 case NS_rtf::LN_headerr: 4679 case NS_rtf::LN_headerf: 4680 case NS_rtf::LN_footerl: 4681 case NS_rtf::LN_footerr: 4682 case NS_rtf::LN_footerf: 4683 m_pImpl->PopPageHeaderFooter(); 4684 break; 4685 case NS_rtf::LN_footnote: 4686 case NS_rtf::LN_endnote: 4687 m_pImpl->PopFootOrEndnote(); 4688 break; 4689 case NS_rtf::LN_annotation : 4690 m_pImpl->PopAnnotation(); 4691 break; 4692 } 4693 4694 m_pImpl->getTableManager().endLevel(); 4695 m_pImpl->popTableManager( ); 4696 } 4697 /*-- 09.06.2006 09:52:16--------------------------------------------------- 4698 4699 -----------------------------------------------------------------------*/ 4700 void DomainMapper::lcl_info(const string & /*info_*/) 4701 { 4702 } 4703 4704 void DomainMapper::handleUnderlineType(const sal_Int32 nIntValue, const ::boost::shared_ptr<PropertyMap> pContext) 4705 { 4706 sal_Int16 eUnderline = awt::FontUnderline::NONE; 4707 4708 switch(nIntValue) 4709 { 4710 case 0: eUnderline = awt::FontUnderline::NONE; break; 4711 case 2: pContext->Insert(PROP_CHAR_WORD_MODE, true, uno::makeAny( true ) ); // TODO: how to get rid of it? 4712 case 1: eUnderline = awt::FontUnderline::SINGLE; break; 4713 case 3: eUnderline = awt::FontUnderline::DOUBLE; break; 4714 case 4: eUnderline = awt::FontUnderline::DOTTED; break; 4715 case 7: eUnderline = awt::FontUnderline::DASH; break; 4716 case 9: eUnderline = awt::FontUnderline::DASHDOT; break; 4717 case 10:eUnderline = awt::FontUnderline::DASHDOTDOT; break; 4718 case 6: eUnderline = awt::FontUnderline::BOLD; break; 4719 case 11:eUnderline = awt::FontUnderline::WAVE; break; 4720 case 20:eUnderline = awt::FontUnderline::BOLDDOTTED; break; 4721 case 23:eUnderline = awt::FontUnderline::BOLDDASH; break; 4722 case 39:eUnderline = awt::FontUnderline::LONGDASH; break; 4723 case 55:eUnderline = awt::FontUnderline::BOLDLONGDASH; break; 4724 case 25:eUnderline = awt::FontUnderline::BOLDDASHDOT; break; 4725 case 26:eUnderline = awt::FontUnderline::BOLDDASHDOTDOT;break; 4726 case 27:eUnderline = awt::FontUnderline::BOLDWAVE; break; 4727 case 43:eUnderline = awt::FontUnderline::DOUBLEWAVE; break; 4728 default: ; 4729 } 4730 pContext->Insert(PROP_CHAR_UNDERLINE, true, uno::makeAny( eUnderline ) ); 4731 } 4732 4733 void DomainMapper::handleParaJustification(const sal_Int32 nIntValue, const ::boost::shared_ptr<PropertyMap> pContext, const bool bExchangeLeftRight) 4734 { 4735 sal_Int16 nAdjust = 0; 4736 sal_Int16 nLastLineAdjust = 0; 4737 switch(nIntValue) 4738 { 4739 case 1: 4740 nAdjust = style::ParagraphAdjust_CENTER; 4741 break; 4742 case 2: 4743 nAdjust = static_cast< sal_Int16 > (bExchangeLeftRight ? style::ParagraphAdjust_LEFT : style::ParagraphAdjust_RIGHT); 4744 break; 4745 case 4: 4746 nLastLineAdjust = style::ParagraphAdjust_BLOCK; 4747 //no break; 4748 case 3: 4749 nAdjust = style::ParagraphAdjust_BLOCK; 4750 break; 4751 case 0: 4752 default: 4753 nAdjust = static_cast< sal_Int16 > (bExchangeLeftRight ? style::ParagraphAdjust_RIGHT : style::ParagraphAdjust_LEFT); 4754 break; 4755 } 4756 pContext->Insert( PROP_PARA_ADJUST, true, uno::makeAny( nAdjust ) ); 4757 pContext->Insert( PROP_PARA_LAST_LINE_ADJUST, true, uno::makeAny( nLastLineAdjust ) ); 4758 } 4759 4760 bool DomainMapper::getColorFromIndex(const sal_Int32 nIndex, sal_Int32 &nColor) 4761 { 4762 nColor = 0; 4763 if ((nIndex < 1) || (nIndex > 16)) 4764 return false; 4765 4766 switch (nIndex) 4767 { 4768 case 1: nColor=0x000000; break; //black 4769 case 2: nColor=0x0000ff; break; //blue 4770 case 3: nColor=0x00ffff; break; //cyan 4771 case 4: nColor=0x00ff00; break; //green 4772 case 5: nColor=0xff00ff; break; //magenta 4773 case 6: nColor=0xff0000; break; //red 4774 case 7: nColor=0xffff00; break; //yellow 4775 case 8: nColor=0xffffff; break; //white 4776 case 9: nColor=0x000080; break;//dark blue 4777 case 10: nColor=0x008080; break; //dark cyan 4778 case 11: nColor=0x008000; break; //dark green 4779 case 12: nColor=0x800080; break; //dark magenta 4780 case 13: nColor=0x800000; break; //dark red 4781 case 14: nColor=0x808000; break; //dark yellow 4782 case 15: nColor=0x808080; break; //dark gray 4783 case 16: nColor=0xC0C0C0; break; //light gray 4784 default: 4785 return false; 4786 } 4787 return true; 4788 } 4789 4790 sal_Int16 DomainMapper::getEmphasisValue(const sal_Int32 nIntValue) 4791 { 4792 switch (nIntValue) 4793 { 4794 case 1: 4795 return com::sun::star::text::FontEmphasis::DOT_ABOVE; 4796 case 2: 4797 return com::sun::star::text::FontEmphasis::ACCENT_ABOVE; 4798 case 3: 4799 return com::sun::star::text::FontEmphasis::CIRCLE_ABOVE; 4800 case 4: 4801 return com::sun::star::text::FontEmphasis::DOT_BELOW; 4802 default: 4803 return com::sun::star::text::FontEmphasis::NONE; 4804 } 4805 } 4806 4807 rtl::OUString DomainMapper::getBracketStringFromEnum(const sal_Int32 nIntValue, const bool bIsPrefix) 4808 { 4809 switch(nIntValue) 4810 { 4811 case 1: 4812 if (bIsPrefix) 4813 return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "(" )); 4814 return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( ")" )); 4815 4816 case 2: 4817 if (bIsPrefix) 4818 return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "[" )); 4819 return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "]" )); 4820 4821 case 3: 4822 if (bIsPrefix) 4823 return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "<" )); 4824 return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( ">" )); 4825 4826 case 4: 4827 if (bIsPrefix) 4828 return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "{" )); 4829 return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "}" )); 4830 4831 case 0: 4832 default: 4833 return rtl::OUString(); 4834 } 4835 } 4836 4837 com::sun::star::style::TabAlign DomainMapper::getTabAlignFromValue(const sal_Int32 nIntValue) 4838 { 4839 switch (nIntValue) 4840 { 4841 case 0: 4842 case 4: // bar not supported 4843 case 5: // num not supported 4844 return com::sun::star::style::TabAlign_LEFT; 4845 case 1: 4846 return com::sun::star::style::TabAlign_CENTER; 4847 case 2: 4848 return com::sun::star::style::TabAlign_RIGHT; 4849 case 3: 4850 return com::sun::star::style::TabAlign_DECIMAL; 4851 } 4852 return com::sun::star::style::TabAlign_LEFT; 4853 } 4854 4855 sal_Unicode DomainMapper::getFillCharFromValue(const sal_Int32 nIntValue) 4856 { 4857 switch (nIntValue) 4858 { 4859 case 1: // dot 4860 return sal_Unicode(0x002e); 4861 case 2: // hyphen 4862 return sal_Unicode(0x002d); 4863 case 3: // underscore 4864 case 4: // heavy FIXME ??? 4865 return sal_Unicode(0x005f); 4866 case NS_ooxml::LN_Value_ST_TabTlc_middleDot: // middleDot 4867 return sal_Unicode(0x00b7); 4868 case 0: // none 4869 default: 4870 return sal_Unicode(0x0020); // blank space 4871 } 4872 } 4873 /*-- 18.07.2007 14:59:00--------------------------------------------------- 4874 4875 -----------------------------------------------------------------------*/ 4876 bool DomainMapper::IsOOXMLImport() const 4877 { 4878 return m_pImpl->IsOOXMLImport(); 4879 } 4880 /*-- 18.07.2007 16:03:14--------------------------------------------------- 4881 4882 -----------------------------------------------------------------------*/ 4883 uno::Reference < lang::XMultiServiceFactory > DomainMapper::GetTextFactory() const 4884 { 4885 return m_pImpl->GetTextFactory(); 4886 } 4887 /*-- 12.11.2007 10:41:01--------------------------------------------------- 4888 4889 -----------------------------------------------------------------------*/ 4890 /*-- 31.01.2008 18:19:44--------------------------------------------------- 4891 4892 -----------------------------------------------------------------------*/ 4893 uno::Reference< text::XTextRange > DomainMapper::GetCurrentTextRange() 4894 { 4895 return m_pImpl->GetTopTextAppend()->getEnd(); 4896 } 4897 4898 /*-- 05.02.2008 10:26:26--------------------------------------------------- 4899 4900 -----------------------------------------------------------------------*/ 4901 ::rtl::OUString DomainMapper::getOrCreateCharStyle( PropertyValueVector_t& rCharProperties ) 4902 { 4903 StyleSheetTablePtr pStyleSheets = m_pImpl->GetStyleSheetTable(); 4904 return pStyleSheets->getOrCreateCharStyle( rCharProperties ); 4905 } 4906 4907 ListsManager::Pointer DomainMapper::GetListTable( ) 4908 { 4909 return m_pImpl->GetListTable( ); 4910 } 4911 4912 StyleSheetTablePtr DomainMapper::GetStyleSheetTable( ) 4913 { 4914 return m_pImpl->GetStyleSheetTable( ); 4915 } 4916 4917 } //namespace dmapper 4918 } //namespace writerfilter 4919