LibreOffice Module sw (master)  1
wrtw8num.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <hintids.hxx>
21 #include <vcl/font.hxx>
22 #include <editeng/fontitem.hxx>
23 #include <editeng/lrspitem.hxx>
24 #include <editeng/langitem.hxx>
25 #include <doc.hxx>
26 #include <docary.hxx>
27 #include <numrule.hxx>
28 #include <paratr.hxx>
29 #include <charfmt.hxx>
30 #include <ndtxt.hxx>
31 #include <unotools/fontcfg.hxx>
32 #include <com/sun/star/i18n/ScriptType.hpp>
33 
34 #include "sprmids.hxx"
35 
36 #include "ww8attributeoutput.hxx"
37 #include "writerhelper.hxx"
38 #include "writerwordglue.hxx"
39 #include "wrtww8.hxx"
40 #include "ww8par.hxx"
41 
42 using namespace ::com::sun::star;
43 using namespace sw::types;
44 using namespace sw::util;
45 
46 sal_uInt16 MSWordExportBase::DuplicateNumRule( const SwNumRule *pRule, sal_uInt8 nLevel, sal_uInt16 nVal )
47 {
48  sal_uInt16 nNumId = USHRT_MAX;
49  const OUString sPrefix("WW8TempExport" + OUString::number( m_nUniqueList++ ));
50  SwNumRule* pMyNumRule =
51  new SwNumRule( m_pDoc->GetUniqueNumRuleName( &sPrefix ),
53  m_pUsedNumTable->push_back( pMyNumRule );
54 
55  for ( sal_uInt16 i = 0; i < MAXLEVEL; i++ )
56  {
57  const SwNumFormat& rSubRule = pRule->Get(i);
58  pMyNumRule->Set( i, rSubRule );
59  }
60 
61  SwNumFormat aNumFormat( pMyNumRule->Get( nLevel ) );
62  aNumFormat.SetStart( nVal );
63  pMyNumRule->Set( nLevel, aNumFormat );
64 
65  nNumId = GetId( *pMyNumRule );
66 
67  // Map the old list to our new list
68  m_aRuleDuplicates[GetId( *pRule )] = nNumId;
69 
70  return nNumId;
71 }
72 
73 sal_uInt16 MSWordExportBase::GetId( const SwNumRule& rNumRule )
74 {
75  if ( !m_pUsedNumTable )
76  {
77  m_pUsedNumTable.reset(new SwNumRuleTable);
78  m_pUsedNumTable->insert( m_pUsedNumTable->begin(), m_pDoc->GetNumRuleTable().begin(), m_pDoc->GetNumRuleTable().end() );
79  // Check, if the outline rule is already inserted into <pUsedNumTable>.
80  // If yes, do not insert it again.
81  bool bOutlineRuleAdded( false );
82  for ( sal_uInt16 n = m_pUsedNumTable->size(); n; )
83  {
84  const SwNumRule& rRule = *(*m_pUsedNumTable)[ --n ];
85  if ( !SwDoc::IsUsed( rRule ) )
86  {
87  m_pUsedNumTable->erase( m_pUsedNumTable->begin() + n );
88  }
89  else if ( &rRule == m_pDoc->GetOutlineNumRule() )
90  {
91  bOutlineRuleAdded = true;
92  }
93  }
94 
95  if ( !bOutlineRuleAdded )
96  {
97  // still need to paste the OutlineRule
98  SwNumRule* pR = m_pDoc->GetOutlineNumRule();
99  m_pUsedNumTable->push_back( pR );
100  }
101  }
102  SwNumRule* p = const_cast<SwNumRule*>(&rNumRule);
103  sal_uInt16 nRet = static_cast<sal_uInt16>(m_pUsedNumTable->GetPos(p));
104 
105  // Is this list now duplicated into a new list which we should use
106  // #i77812# - perform 'deep' search in duplication map
107  std::map<sal_uInt16,sal_uInt16>::const_iterator aResult = m_aRuleDuplicates.end();
108  do {
109  aResult = m_aRuleDuplicates.find(nRet);
110  if ( aResult != m_aRuleDuplicates.end() )
111  {
112  nRet = (*aResult).second;
113  }
114  } while ( aResult != m_aRuleDuplicates.end() );
115 
116  return nRet;
117 }
118 
119 // GetFirstLineOffset should problem never appear unadorned apart from
120 // here in the ww export filter
121 sal_Int16 GetWordFirstLineOffset(const SwNumFormat &rFormat)
122 {
124  "<GetWordFirstLineOffset> - misusage: position-and-space-mode does not equal LABEL_WIDTH_AND_POSITION" );
125 
126  short nFirstLineOffset;
127  if (rFormat.GetNumAdjust() == SvxAdjust::Right)
128  nFirstLineOffset = -rFormat.GetCharTextDistance();
129  else
130  nFirstLineOffset = rFormat.GetFirstLineOffset(); //TODO: overflow
131  return nFirstLineOffset;
132 }
133 
135 {
136  if ( !m_pUsedNumTable )
137  return; // no numbering is used
138 
139  // list formats - LSTF
140  pFib->m_fcPlcfLst = pTableStrm->Tell();
141  SwWW8Writer::WriteShort( *pTableStrm, m_pUsedNumTable->size() );
142  NumberingDefinitions();
143  // set len to FIB
144  pFib->m_lcbPlcfLst = pTableStrm->Tell() - pFib->m_fcPlcfLst;
145 
146  // list formats - LVLF
147  AbstractNumberingDefinitions();
148 
149  // list formats - LFO
150  OutOverrideListTab();
151 
152  // list formats - ListNames
153  OutListNamesTab();
154 }
155 
156 void WW8AttributeOutput::NumberingDefinition( sal_uInt16 nId, const SwNumRule &rRule )
157 {
158  SwWW8Writer::WriteLong( *m_rWW8Export.pTableStrm, nId );
159  SwWW8Writer::WriteLong( *m_rWW8Export.pTableStrm, nId );
160 
161  // not associated with a Style
162  for ( int i = 0; i < WW8ListManager::nMaxLevel; ++i )
163  SwWW8Writer::WriteShort( *m_rWW8Export.pTableStrm, 0xFFF );
164 
165  sal_uInt8 nFlags = 0;
166  if ( rRule.IsContinusNum() )
167  nFlags |= 0x1;
168 
169  m_rWW8Export.pTableStrm->WriteUChar( nFlags ).WriteUChar( 0/*nDummy*/ );
170 }
171 
173 {
174  if ( !m_pUsedNumTable )
175  return; // no numbering is used
176 
177  sal_uInt16 nCount = m_pUsedNumTable->size();
178 
179  // Write static data of SwNumRule - LSTF
180  for ( sal_uInt16 n = 0; n < nCount; ++n )
181  {
182  const SwNumRule& rRule = *(*m_pUsedNumTable)[ n ];
183 
184  AttrOutput().NumberingDefinition( n + 1, rRule );
185  }
186 }
187 
188 static sal_uInt8 GetLevelNFC( sal_uInt16 eNumType, const SfxItemSet *pOutSet)
189 {
190  sal_uInt8 nRet = 0;
191  switch( eNumType )
192  {
194  case SVX_NUM_CHARS_UPPER_LETTER_N: nRet = 3; break;
196  case SVX_NUM_CHARS_LOWER_LETTER_N: nRet = 4; break;
197  case SVX_NUM_ROMAN_UPPER: nRet = 1; break;
198  case SVX_NUM_ROMAN_LOWER: nRet = 2; break;
199 
200  case SVX_NUM_BITMAP:
201  case SVX_NUM_CHAR_SPECIAL: nRet = 23; break;
202  case SVX_NUM_FULL_WIDTH_ARABIC: nRet = 14; break;
203  case SVX_NUM_CIRCLE_NUMBER: nRet = 18;break;
205  nRet = 35;
206  if ( pOutSet ) {
207  const SvxLanguageItem& rLang = pOutSet->Get( RES_CHRATR_CJK_LANGUAGE);
208  const LanguageType eLang = rLang.GetLanguage();
209  if (LANGUAGE_CHINESE_SIMPLIFIED ==eLang) {
210  nRet = 39;
211  }
212  }
213  break;
214  case SVX_NUM_NUMBER_UPPER_ZH: nRet = 38; break;
215  case SVX_NUM_NUMBER_UPPER_ZH_TW: nRet = 34;break;
216  case SVX_NUM_TIAN_GAN_ZH: nRet = 30; break;
217  case SVX_NUM_DI_ZI_ZH: nRet = 31; break;
218  case SVX_NUM_NUMBER_TRADITIONAL_JA: nRet = 16; break;
219  case SVX_NUM_AIU_FULLWIDTH_JA: nRet = 20; break;
220  case SVX_NUM_AIU_HALFWIDTH_JA: nRet = 12; break;
221  case SVX_NUM_IROHA_FULLWIDTH_JA: nRet = 21; break;
222  case SVX_NUM_IROHA_HALFWIDTH_JA: nRet = 13; break;
223  case style::NumberingType::HANGUL_SYLLABLE_KO: nRet = 24; break;// ganada
224  case style::NumberingType::HANGUL_JAMO_KO: nRet = 25; break;// chosung
225  case style::NumberingType::HANGUL_CIRCLED_SYLLABLE_KO: nRet = 24; break;
226  case style::NumberingType::HANGUL_CIRCLED_JAMO_KO: nRet = 25; break;
227  case style::NumberingType::NUMBER_HANGUL_KO: nRet = 41; break;
228  case style::NumberingType::NUMBER_UPPER_KO: nRet = 44; break;
229  case SVX_NUM_NUMBER_NONE: nRet = 0xff; break;
230  }
231  return nRet;
232 }
233 
234 
236  sal_uInt16 nStart,
237  sal_uInt16 nNumberingType,
238  SvxAdjust eAdjust,
239  const sal_uInt8 *pNumLvlPos,
240  sal_uInt8 nFollow,
241  const wwFont *pFont,
242  const SfxItemSet *pOutSet,
243  sal_Int16 nIndentAt,
244  sal_Int16 nFirstLineIndex,
245  sal_Int16 nListTabPos,
246  const OUString &rNumberingString,
247  const SvxBrushItem* pBrush //For i120928,to transfer graphic of bullet
248  )
249 {
250  // Start value
251  SwWW8Writer::WriteLong( *m_rWW8Export.pTableStrm, nStart );
252 
253  // Type
254  m_rWW8Export.pTableStrm->WriteUChar( GetLevelNFC( nNumberingType ,pOutSet) );
255 
256  // Justification
257  sal_uInt8 nAlign;
258  switch ( eAdjust )
259  {
260  case SvxAdjust::Center:
261  nAlign = 1;
262  break;
263  case SvxAdjust::Right:
264  nAlign = 2;
265  break;
266  default:
267  nAlign = 0;
268  break;
269  }
270  m_rWW8Export.pTableStrm->WriteUChar( nAlign );
271 
272  // Write the rgbxchNums[9], positions of placeholders for paragraph
273  // numbers in the text
274  m_rWW8Export.pTableStrm->WriteBytes(pNumLvlPos, WW8ListManager::nMaxLevel);
275 
276  // Type of the character between the bullet and the text
277  m_rWW8Export.pTableStrm->WriteUChar( nFollow );
278 
279  // dxaSoace/dxaIndent (Word 6 compatibility)
280  SwWW8Writer::WriteLong( *m_rWW8Export.pTableStrm, 0 );
281  SwWW8Writer::WriteLong( *m_rWW8Export.pTableStrm, 0 );
282 
283  // cbGrpprlChpx
284  std::unique_ptr<ww::bytes> pCharAtrs;
285  if ( pOutSet )
286  {
287  std::unique_ptr<ww::bytes> pOldpO = std::move(m_rWW8Export.pO);
288  m_rWW8Export.pO.reset(new ww::bytes);
289  if ( pFont )
290  {
291  sal_uInt16 nFontID = m_rWW8Export.m_aFontHelper.GetId( *pFont );
292 
293  m_rWW8Export.InsUInt16( NS_sprm::sprmCRgFtc0 );
294  m_rWW8Export.InsUInt16( nFontID );
295  m_rWW8Export.InsUInt16( NS_sprm::sprmCRgFtc2 );
296  m_rWW8Export.InsUInt16( nFontID );
297  }
298 
299  m_rWW8Export.OutputItemSet( *pOutSet, false, true, i18n::ScriptType::LATIN, m_rWW8Export.m_bExportModeRTF );
300  //For i120928,achieve graphic's index of bullet from the bullet bookmark
301  if (SVX_NUM_BITMAP == nNumberingType && pBrush)
302  {
303  int nIndex = m_rWW8Export.GetGrfIndex(*pBrush);
304  if ( nIndex != -1 )
305  {
306  m_rWW8Export.InsUInt16(NS_sprm::sprmCPbiIBullet);
307  m_rWW8Export.InsUInt32(nIndex);
308  m_rWW8Export.InsUInt16(NS_sprm::sprmCPbiGrf);
309  m_rWW8Export.InsUInt16(1);
310  }
311  }
312 
313  pCharAtrs = std::move(m_rWW8Export.pO);
314  m_rWW8Export.pO = std::move(pOldpO);
315  }
316  m_rWW8Export.pTableStrm->WriteUChar(sal_uInt8(pCharAtrs ? pCharAtrs->size() : 0));
317 
318  // cbGrpprlPapx
319  sal_uInt8 aPapSprms [] = {
320  0x5e, 0x84, 0, 0, // sprmPDxaLeft
321  0x60, 0x84, 0, 0, // sprmPDxaLeft1
322  0x15, 0xc6, 0x05, 0x00, 0x01, 0, 0, 0x06
323  };
324  m_rWW8Export.pTableStrm->WriteUChar( sal_uInt8( sizeof( aPapSprms ) ) );
325 
326  // reserved
327  SwWW8Writer::WriteShort( *m_rWW8Export.pTableStrm, 0 );
328 
329  // pap sprms
330  sal_uInt8* pData = aPapSprms + 2;
331  Set_UInt16( pData, nIndentAt );
332  pData += 2;
333  Set_UInt16( pData, nFirstLineIndex );
334  pData += 5;
335  Set_UInt16( pData, nListTabPos );
336 
337  m_rWW8Export.pTableStrm->WriteBytes(aPapSprms, sizeof(aPapSprms));
338 
339  // write Chpx
340  if (pCharAtrs && !pCharAtrs->empty())
341  m_rWW8Export.pTableStrm->WriteBytes(pCharAtrs->data(), pCharAtrs->size());
342 
343  // write the num string
344  SwWW8Writer::WriteShort( *m_rWW8Export.pTableStrm, rNumberingString.getLength() );
345  SwWW8Writer::WriteString16( *m_rWW8Export.pTableStrm, rNumberingString, false );
346 }
347 
349 {
350  sal_uInt16 nCount = m_pUsedNumTable->size();
351  sal_uInt16 n;
352 
353  // prepare the NodeNum to generate the NumString
354  SwNumberTree::tNumberVector aNumVector;
355  for ( n = 0; n < WW8ListManager::nMaxLevel; ++n )
356  aNumVector.push_back( n );
357 
358  for( n = 0; n < nCount; ++n )
359  {
360  AttrOutput().StartAbstractNumbering( n + 1 );
361 
362  const SwNumRule& rRule = *(*m_pUsedNumTable)[ n ];
363  sal_uInt8 nLvl;
364  sal_uInt8 nLevels = static_cast< sal_uInt8 >(rRule.IsContinusNum() ?
366  for( nLvl = 0; nLvl < nLevels; ++nLvl )
367  {
368  // write the static data of the SwNumFormat of this level
369  sal_uInt8 aNumLvlPos[WW8ListManager::nMaxLevel] = { 0,0,0,0,0,0,0,0,0 };
370 
371  const SwNumFormat& rFormat = rRule.Get( nLvl );
372 
373  sal_uInt8 nFollow = 0;
374  // #i86652#
376  {
377  nFollow = 2; // ixchFollow: 0 - tab, 1 - blank, 2 - nothing
378  }
380  {
381  switch ( rFormat.GetLabelFollowedBy() )
382  {
384  {
385  // 0 (tab) unless there would be no content before the tab, in which case 2 (nothing)
386  nFollow = (SVX_NUM_NUMBER_NONE != rFormat.GetNumberingType()) ? 0 : 2;
387  }
388  break;
390  {
391  // 1 (space) unless there would be no content before the space in which case 2 (nothing)
392  nFollow = (SVX_NUM_NUMBER_NONE != rFormat.GetNumberingType()) ? 1 : 2;
393  }
394  break;
396  {
397  nFollow = 2;
398  }
399  break;
400  default:
401  {
402  nFollow = 0;
403  OSL_FAIL( "unknown GetLabelFollowedBy() return value" );
404  }
405  }
406  }
407 
408  // Build the NumString for this Level
409  OUString sNumStr;
410  OUString sFontName;
411  bool bWriteBullet = false;
412  const vcl::Font* pBulletFont=nullptr;
413  rtl_TextEncoding eChrSet=0;
415  if( SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType() ||
416  SVX_NUM_BITMAP == rFormat.GetNumberingType() )
417  {
418  sNumStr = OUString(rFormat.GetBulletChar());
419  bWriteBullet = true;
420 
421  pBulletFont = rFormat.GetBulletFont();
422  if (!pBulletFont)
423  {
424  pBulletFont = &numfunc::GetDefBulletFont();
425  }
426 
427  eChrSet = pBulletFont->GetCharSet();
428  sFontName = pBulletFont->GetFamilyName();
429  eFamily = pBulletFont->GetFamilyType();
430 
431  if ( IsStarSymbol(sFontName) )
432  SubstituteBullet( sNumStr, eChrSet, sFontName );
433 
434  // #i86652#
435  if ( rFormat.GetPositionAndSpaceMode() ==
437  {
438  // <nFollow = 2>, if minimum label width equals 0 and
439  // minimum distance between label and text equals 0
440  nFollow = ( rFormat.GetFirstLineOffset() == 0 &&
441  rFormat.GetCharTextDistance() == 0 )
442  ? 2 : 0; // ixchFollow: 0 - tab, 1 - blank, 2 - nothing
443  }
444  }
445  else
446  {
447  if (SVX_NUM_NUMBER_NONE != rFormat.GetNumberingType())
448  {
449  sal_uInt8* pLvlPos = aNumLvlPos;
450  // the numbering string has to be restrict
451  // to the level currently working on.
452  sNumStr = rRule.MakeNumString(aNumVector, false, true, nLvl);
453 
454  // now search the nums in the string
455  for( sal_uInt8 i = 0; i <= nLvl; ++i )
456  {
457  OUString sSrch( OUString::number( i ));
458  sal_Int32 nFnd = sNumStr.indexOf( sSrch );
459  if( -1 != nFnd )
460  {
461  *pLvlPos = static_cast<sal_uInt8>(nFnd + rFormat.GetPrefix().getLength() + 1 );
462  ++pLvlPos;
463  sNumStr = sNumStr.replaceAt( nFnd, 1, OUString(static_cast<char>(i)) );
464  }
465  }
466  // #i86652#
467  if ( rFormat.GetPositionAndSpaceMode() ==
469  {
470  // <nFollow = 2>, if minimum label width equals 0 and
471  // minimum distance between label and text equals 0
472  nFollow = ( rFormat.GetFirstLineOffset() == 0 &&
473  rFormat.GetCharTextDistance() == 0 )
474  ? 2 : 0; // ixchFollow: 0 - tab, 1 - blank, 2 - nothing
475  }
476  }
477 
478  if( !rFormat.GetPrefix().isEmpty() )
479  sNumStr = rFormat.GetPrefix() + sNumStr;
480  sNumStr += rFormat.GetSuffix();
481  }
482 
483  // Attributes of the numbering
484  std::unique_ptr<wwFont> pPseudoFont;
485  const SfxItemSet* pOutSet = nullptr;
486 
487  // cbGrpprlChpx
488  SfxItemSet aSet( m_pDoc->GetAttrPool(), svl::Items<RES_CHRATR_BEGIN,
489  RES_CHRATR_END>{} );
490  if ( rFormat.GetCharFormat() || bWriteBullet )
491  {
492  if ( bWriteBullet )
493  {
494  pOutSet = &aSet;
495 
496  if ( rFormat.GetCharFormat() )
497  aSet.Put( rFormat.GetCharFormat()->GetAttrSet() );
498  aSet.ClearItem( RES_CHRATR_CJK_FONT );
499  aSet.ClearItem( RES_CHRATR_FONT );
500 
501  if ( sFontName.isEmpty() )
502  sFontName = pBulletFont->GetFamilyName();
503 
504  pPseudoFont.reset(new wwFont( sFontName, pBulletFont->GetPitch(),
505  eFamily, eChrSet));
506  }
507  else
508  pOutSet = &rFormat.GetCharFormat()->GetAttrSet();
509  }
510 
511  sal_Int16 nIndentAt = 0;
512  sal_Int16 nFirstLineIndex = 0;
513  sal_Int16 nListTabPos = 0;
514 
515  // #i86652#
517  {
518  nIndentAt = nListTabPos = rFormat.GetAbsLSpace(); //TODO: overflow
519  nFirstLineIndex = GetWordFirstLineOffset(rFormat);
520  }
522  {
523  nIndentAt = static_cast<sal_Int16>(rFormat.GetIndentAt());
524  nFirstLineIndex = static_cast<sal_Int16>(rFormat.GetFirstLineIndent());
525  nListTabPos = rFormat.GetLabelFollowedBy() == SvxNumberFormat::LISTTAB?
526  static_cast<sal_Int16>( rFormat.GetListtabPos() ) : 0;
527  }
528 
529  AttrOutput().NumberingLevel( nLvl,
530  rFormat.GetStart(),
531  rFormat.GetNumberingType(),
532  rFormat.GetNumAdjust(),
533  aNumLvlPos,
534  nFollow,
535  pPseudoFont.get(), pOutSet,
536  nIndentAt, nFirstLineIndex, nListTabPos,
537  sNumStr,
538  rFormat.GetNumberingType()==SVX_NUM_BITMAP ? rFormat.GetBrush():nullptr);
539  }
540  AttrOutput().EndAbstractNumbering();
541  }
542 }
543 
545 {
546  if( !m_pUsedNumTable )
547  return ; // no numbering is used
548 
549  // write the "list format override" - LFO
550  sal_uInt16 nCount = m_pUsedNumTable->size();
551  sal_uInt16 n;
552 
553  pFib->m_fcPlfLfo = pTableStrm->Tell();
554  SwWW8Writer::WriteLong( *pTableStrm, nCount );
555 
556  for( n = 0; n < nCount; ++n )
557  {
558  SwWW8Writer::WriteLong( *pTableStrm, n + 1 );
559  SwWW8Writer::FillCount( *pTableStrm, 12 );
560  }
561  for( n = 0; n < nCount; ++n )
562  SwWW8Writer::WriteLong( *pTableStrm, -1 ); // no overwrite
563 
564  // set len to FIB
565  pFib->m_lcbPlfLfo = pTableStrm->Tell() - pFib->m_fcPlfLfo;
566 }
567 
569 {
570  if( !m_pUsedNumTable )
571  return ; // no numbering is used
572 
573  // write the "list format override" - LFO
574  sal_uInt16 nNms = 0, nCount = m_pUsedNumTable->size();
575 
576  pFib->m_fcSttbListNames = pTableStrm->Tell();
577  SwWW8Writer::WriteShort( *pTableStrm, -1 );
578  SwWW8Writer::WriteLong( *pTableStrm, nCount );
579 
580  for( ; nNms < nCount; ++nNms )
581  {
582  const SwNumRule& rRule = *(*m_pUsedNumTable)[ nNms ];
583  OUString sNm;
584  if( !rRule.IsAutoRule() )
585  sNm = rRule.GetName();
586 
587  SwWW8Writer::WriteShort( *pTableStrm, sNm.getLength() );
588  if (!sNm.isEmpty())
589  SwWW8Writer::WriteString16(*pTableStrm, sNm, false);
590  }
591 
592  SwWW8Writer::WriteLong( *pTableStrm, pFib->m_fcSttbListNames + 2, nNms );
593  // set len to FIB
594  pFib->m_lcbSttbListNames = pTableStrm->Tell() - pFib->m_fcSttbListNames;
595 }
596 
597 void MSWordExportBase::SubstituteBullet( OUString& rNumStr,
598  rtl_TextEncoding& rChrSet, OUString& rFontName ) const
599 {
600  if (!m_bSubstituteBullets)
601  return;
602  OUString sFontName = rFontName;
603 
604  // If Bullet char is "", don't change
605  if (rNumStr[0] != u'\0')
606  {
607  rNumStr = rNumStr.replaceAt(0, 1, OUString(
608  msfilter::util::bestFitOpenSymbolToMSFont(rNumStr[0], rChrSet, sFontName)));
609  }
610 
611  rFontName = sFontName;
612 }
613 
614 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 DuplicateNumRule(const SwNumRule *pRule, sal_uInt8 nLevel, sal_uInt16 nVal)
In case of numbering restart.
Definition: wrtw8num.cxx:46
SvxNumType GetNumberingType() const
const sal_uInt16 sprmCPbiIBullet
Definition: sprmids.hxx:350
SVX_NUM_CHARS_UPPER_LETTER_N
#define RES_CHRATR_CJK_LANGUAGE
Definition: hintids.hxx:92
const OUString & GetFamilyName() const
long GetFirstLineIndent() const
sal_Unicode bestFitOpenSymbolToMSFont(sal_Unicode cBullet, rtl_TextEncoding &r_ioChrSet, OUString &r_ioFontName)
OUString MakeNumString(const SwNodeNum &, bool bInclStrings=true) const
Definition: number.cxx:617
SVX_NUM_FULL_WIDTH_ARABIC
const sal_uInt16 sprmCRgFtc0
Definition: sprmids.hxx:308
const SvxBrushItem * GetBrush() const
SVX_NUM_NUMBER_NONE
std::vector< sal_uInt8 > bytes
Definition: types.hxx:29
SVX_NUM_CHARS_UPPER_LETTER
bool IsAutoRule() const
Definition: numrule.hxx:227
SVX_NUM_CIRCLE_NUMBER
#define RES_CHRATR_FONT
Definition: hintids.hxx:75
virtual void WriteNumbering() override
Output the numbering table.
Definition: wrtw8num.cxx:134
const OUString & GetName() const
Definition: numrule.hxx:222
#define RES_CHRATR_CJK_FONT
Definition: hintids.hxx:90
virtual void NumberingDefinition(sal_uInt16 nId, const SwNumRule &rRule) override
Definition of a numbering instance.
Definition: wrtw8num.cxx:156
FontFamily GetFamilyType()
void OutListNamesTab()
Definition: wrtw8num.cxx:568
#define RES_CHRATR_END
Definition: hintids.hxx:114
const sal_uInt16 sprmCPbiGrf
Definition: sprmids.hxx:351
const sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:95
short GetCharTextDistance() const
SVX_NUM_ROMAN_UPPER
SVX_NUM_ROMAN_LOWER
SVX_NUM_IROHA_FULLWIDTH_JA
void Set_UInt16(sal_uInt8 *&p, sal_uInt16 n)
Definition: ww8struc.hxx:47
const OUString & GetPrefix() const
const OUString & GetSuffix() const
FAMILY_DECORATIVE
SVX_NUM_DI_ZI_ZH
Collects and outputs fonts.
Definition: wrtww8.hxx:299
bool IsContinusNum() const
Definition: numrule.hxx:233
static void WriteString16(SvStream &rStrm, const OUString &rStr, bool bAddZero)
Definition: wrtww8.cxx:1768
SVX_NUM_BITMAP
SVX_NUM_CHAR_SPECIAL
SwCharFormat * GetCharFormat() const
Definition: numrule.hxx:74
SVX_NUM_IROHA_HALFWIDTH_JA
SVX_NUM_TIAN_GAN_ZH
SVX_NUM_CHARS_LOWER_LETTER
FontPitch GetPitch()
SvxAdjust
void SubstituteBullet(OUString &rNumStr, rtl_TextEncoding &rChrSet, OUString &rFontName) const
Definition: wrtw8num.cxx:597
LabelFollowedBy GetLabelFollowedBy() const
sal_Int32 GetAbsLSpace() const
const vcl::Font & GetDefBulletFont()
retrieve font used for the default bullet list characters
Definition: number.cxx:1264
sal_uInt16 GetId(const SwNumRule &rNumRule)
Return the numeric id of the numbering rule.
Definition: wrtw8num.cxx:73
int i
static void WriteShort(SvStream &rStrm, sal_Int16 nVal)
Definition: wrtww8.hxx:937
const vcl::Font * GetBulletFont() const
static sal_uInt8 GetLevelNFC(sal_uInt16 eNumType, const SfxItemSet *pOutSet)
Definition: wrtw8num.cxx:188
float u
#define RES_CHRATR_BEGIN
Definition: hintids.hxx:68
#define LANGUAGE_CHINESE_SIMPLIFIED
SvxAdjust GetNumAdjust() const
sal_uInt16 GetStart() const
SvxNumPositionAndSpaceMode GetPositionAndSpaceMode() const
SVX_NUM_CHARS_LOWER_LETTER_N
sal_Int16 GetWordFirstLineOffset(const SwNumFormat &rFormat)
Definition: wrtw8num.cxx:121
std::vector< tSwNumTreeNumber > tNumberVector
long GetIndentAt() const
const sal_uInt16 sprmCRgFtc2
Definition: sprmids.hxx:310
SVX_NUM_NUMBER_UPPER_ZH_TW
FontFamily
const SwNumFormat & Get(sal_uInt16 i) const
Definition: number.cxx:83
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
LanguageType GetLanguage() const
void Set(sal_uInt16 i, const SwNumFormat *)
Definition: number.cxx:592
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
unsigned char sal_uInt8
SVX_NUM_NUMBER_TRADITIONAL_JA
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:261
SVX_NUM_NUMBER_LOWER_ZH
SVX_NUM_NUMBER_UPPER_ZH
bool IsUsed(const SwModify &) const
Definition: poolfmt.cxx:122
void NumberingDefinitions()
Write static data of SwNumRule - LSTF.
Definition: wrtw8num.cxx:172
long GetListtabPos() const
sal_Int32 GetFirstLineOffset() const
sal_Unicode GetBulletChar() const
void SetStart(sal_uInt16 nSet)
void OutOverrideListTab()
Definition: wrtw8num.cxx:544
SVX_NUM_AIU_HALFWIDTH_JA
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:116
bool IsStarSymbol(const OUString &rFontName)
static void WriteLong(SvStream &rStrm, sal_Int32 nVal)
Definition: wrtww8.hxx:940
static void FillCount(SvStream &rStrm, sal_uLong nCount)
Definition: wrtww8.cxx:954
SVX_NUM_AIU_FULLWIDTH_JA
virtual void NumberingLevel(sal_uInt8 nLevel, sal_uInt16 nStart, sal_uInt16 nNumberingType, SvxAdjust eAdjust, const sal_uInt8 *pNumLvlPos, sal_uInt8 nFollow, const wwFont *pFont, const SfxItemSet *pOutSet, sal_Int16 nIndentAt, sal_Int16 nFirstLineIndex, sal_Int16 nListTabPos, const OUString &rNumberingString, const SvxBrushItem *pBrush) override
All the numbering level information.
Definition: wrtw8num.cxx:235
rtl_TextEncoding GetCharSet() const
void AbstractNumberingDefinitions()
Write all Levels for all SwNumRules - LVLF.
Definition: wrtw8num.cxx:348