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