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/langitem.hxx>
23#include <doc.hxx>
24#include <docary.hxx>
25#include <numrule.hxx>
26#include <charfmt.hxx>
27#include <com/sun/star/i18n/ScriptType.hpp>
28
29#include "sprmids.hxx"
30
32#include "writerhelper.hxx"
33#include "writerwordglue.hxx"
34#include "wrtww8.hxx"
35#include "ww8par.hxx"
36
37using namespace ::com::sun::star;
38using namespace sw::types;
39using namespace sw::util;
40
42{
43 const OUString sPrefix("WW8TempExport" + OUString::number( m_nUniqueList++ ));
44 SwNumRule* pMyNumRule =
47 m_pUsedNumTable->push_back( pMyNumRule );
48
49 for ( sal_uInt16 i = 0; i < MAXLEVEL; i++ )
50 {
51 const SwNumFormat& rSubRule = pRule->Get(i);
52 pMyNumRule->Set( i, rSubRule );
53 }
54 return pMyNumRule;
55}
56
57sal_uInt16 MSWordExportBase::DuplicateNumRule(const SwNumRule* pRule, sal_uInt8 nLevel, sal_uInt16 nVal)
58{
59 SwNumRule* const pMyNumRule = DuplicateNumRuleImpl(pRule);
60
61 SwNumFormat aNumFormat(pMyNumRule->Get(nLevel));
62 aNumFormat.SetStart(nVal);
63 pMyNumRule->Set(nLevel, aNumFormat);
64
65 return GetNumberingId(*pMyNumRule);
66}
67
68// multiple SwList can be based on the same SwNumRule; ensure one w:abstractNum
69// per SwList
70sal_uInt16 MSWordExportBase::DuplicateAbsNum(OUString const& rListId,
71 SwNumRule const& rAbstractRule)
72{
73 auto const it(m_Lists.find(rListId));
74 if (it != m_Lists.end())
75 {
76 return it->second;
77 }
78 else
79 {
80 auto const pNewAbstractRule = DuplicateNumRuleImpl(&rAbstractRule);
81 assert(GetNumberingId(*pNewAbstractRule) == m_pUsedNumTable->size() - 1);
82 (void) pNewAbstractRule;
83 m_Lists.insert(std::make_pair(rListId, m_pUsedNumTable->size() - 1));
84 return m_pUsedNumTable->size() - 1;
85 }
86}
87
88// Ideally we want to map SwList to w:abstractNum and SwNumRule to w:num
89// The current approach is to keep exporting every SwNumRule to
90// 1 w:abstractNum and 1 w:num, and then add extra w:num via this function
91// that reference an existing w:abstractNum and may override its formatting;
92// of course this will end up exporting some w:num that aren't actually used.
94 SwNumRule const& rExistingRule,
95 OUString const& rListId,
96 SwNumRule const& rAbstractRule)
97{
98 const sal_uInt16 numdef = GetNumberingId(rExistingRule);
99
100 const sal_uInt16 absnumdef = rListId == rAbstractRule.GetDefaultListId()
101 ? GetNumberingId(rAbstractRule)
102 : DuplicateAbsNum(rListId, rAbstractRule);
103 assert(numdef != USHRT_MAX);
104 assert(absnumdef != USHRT_MAX);
105 auto const mapping = std::make_pair(numdef, absnumdef);
106
107 auto it = m_OverridingNums.insert(std::make_pair(m_pUsedNumTable->size(), mapping));
108
109 m_pUsedNumTable->push_back(nullptr); // dummy, it's unique_ptr...
110 ++m_nUniqueList; // counter for DuplicateNumRule...
111
112 return it.first->first;
113}
114
116 sal_uInt16 nLevelNum,
117 sal_uInt16 nStartAt)
118{
119 m_ListLevelOverrides[nListId][nLevelNum] = nStartAt;
120}
121
122sal_uInt16 MSWordExportBase::GetNumberingId( const SwNumRule& rNumRule )
123{
124 if ( !m_pUsedNumTable )
125 {
128 // Check, if the outline rule is already inserted into <pUsedNumTable>.
129 // If yes, do not insert it again.
130 bool bOutlineRuleAdded( false );
131 for ( sal_uInt16 n = m_pUsedNumTable->size(); n; )
132 {
133 const SwNumRule& rRule = *(*m_pUsedNumTable)[ --n ];
134 if (!m_rDoc.IsUsed(rRule))
135 {
136 m_pUsedNumTable->erase( m_pUsedNumTable->begin() + n );
137 }
138 else if ( &rRule == m_rDoc.GetOutlineNumRule() )
139 {
140 bOutlineRuleAdded = true;
141 }
142 }
143
144 if ( !bOutlineRuleAdded )
145 {
146 // still need to paste the OutlineRule
148 m_pUsedNumTable->push_back( pR );
149 }
150 }
151 SwNumRule* p = const_cast<SwNumRule*>(&rNumRule);
152 sal_uInt16 nRet = o3tl::narrowing<sal_uInt16>(m_pUsedNumTable->GetPos(p));
153
154 return nRet;
155}
156
157// GetFirstLineOffset should problem never appear unadorned apart from
158// here in the ww export filter
159sal_Int16 GetWordFirstLineOffset(const SwNumFormat &rFormat)
160{
162 "<GetWordFirstLineOffset> - misusage: position-and-space-mode does not equal LABEL_WIDTH_AND_POSITION" );
163
164 short nFirstLineOffset;
165 if (rFormat.GetNumAdjust() == SvxAdjust::Right)
167 else
168 nFirstLineOffset = rFormat.GetFirstLineOffset(); //TODO: overflow
169 return nFirstLineOffset;
170}
171
173{
174 if ( !m_pUsedNumTable )
175 return; // no numbering is used
176
177 // list formats - LSTF
178 m_pFib->m_fcPlcfLst = m_pTableStrm->Tell();
181 // set len to FIB
182 m_pFib->m_lcbPlcfLst = m_pTableStrm->Tell() - m_pFib->m_fcPlcfLst;
183
184 // list formats - LVLF
186
187 // list formats - LFO
189
190 // list formats - ListNames
192}
193
194void WW8AttributeOutput::NumberingDefinition( sal_uInt16 nId, const SwNumRule &rRule )
195{
198
199 // not associated with a Style
200 for ( int i = 0; i < WW8ListManager::nMaxLevel; ++i )
202
203 sal_uInt8 nFlags = 0;
204 if ( rRule.IsContinusNum() )
205 nFlags |= 0x1;
206
207 m_rWW8Export.m_pTableStrm->WriteUChar( nFlags ).WriteUChar( 0/*nDummy*/ );
208}
209
211{
212 if ( !m_pUsedNumTable )
213 return; // no numbering is used
214
215 sal_uInt16 nCount = m_pUsedNumTable->size();
216
217 // Write static data of SwNumRule - LSTF
218 for ( sal_uInt16 n = 0; n < nCount; ++n )
219 {
220 const SwNumRule * pRule = (*m_pUsedNumTable)[ n ];
221 if (pRule)
222 {
223 AttrOutput().NumberingDefinition(n + 1, *pRule);
224 }
225 else
226 {
227 auto it = m_OverridingNums.find(n);
228 assert(it != m_OverridingNums.end());
229 pRule = (*m_pUsedNumTable)[it->second.first];
230 assert(pRule);
231 AttrOutput().OverrideNumberingDefinition(*pRule, n + 1, it->second.second + 1, m_ListLevelOverrides[n]);
232 }
233 }
234}
235
241static sal_uInt8 GetLevelNFC(sal_uInt16 eNumType, const SfxItemSet* pOutSet, sal_uInt8 nDefault)
242{
243 sal_uInt8 nRet = nDefault;
244 switch( eNumType )
245 {
247 nRet = 35;
248 if ( pOutSet ) {
249 const SvxLanguageItem& rLang = pOutSet->Get( RES_CHRATR_CJK_LANGUAGE);
250 const LanguageType eLang = rLang.GetLanguage();
251 if (LANGUAGE_CHINESE_SIMPLIFIED ==eLang) {
252 nRet = 39;
253 }
254 }
255 break;
256
257 // LVLF can't contain 0x08, msonfcHex.
258 case style::NumberingType::SYMBOL_CHICAGO:
259 // No SVX_NUM_SYMBOL_CHICAGO here: LVLF can't contain 0x09, msonfcChiManSty.
260 nRet = 0;
261 break;
262 // LVLF can't contain 0x0F / 15, msonfcSbChar / decimalHalfWidth.
263 // LVLF can't contain 0x13 / 19, msonfcDArabic / decimalFullWidth2
264 }
265 return nRet;
266}
267
268
270 sal_uInt16 nStart,
271 sal_uInt16 nNumberingType,
272 SvxAdjust eAdjust,
273 const sal_uInt8 *pNumLvlPos,
274 sal_uInt8 nFollow,
275 const wwFont *pFont,
276 const SfxItemSet *pOutSet,
277 sal_Int16 nIndentAt,
278 sal_Int16 nFirstLineIndex,
279 sal_Int16 nListTabPos,
280 const OUString &rNumberingString,
281 const SvxBrushItem* pBrush, //For i120928,to transfer graphic of bullet
282 bool /*isLegal*/
283 )
284{
285 // Start value
287
288 // Type
289 sal_uInt8 nNumId = GetLevelNFC(nNumberingType, pOutSet, WW8Export::GetNumId(nNumberingType));
291
292 // Justification
293 sal_uInt8 nAlign;
294 switch ( eAdjust )
295 {
296 case SvxAdjust::Center:
297 nAlign = 1;
298 break;
299 case SvxAdjust::Right:
300 nAlign = 2;
301 break;
302 default:
303 nAlign = 0;
304 break;
305 }
307
308 // Write the rgbxchNums[9], positions of placeholders for paragraph
309 // numbers in the text
311
312 // Type of the character between the bullet and the text
314
315 // dxaSoace/dxaIndent (Word 6 compatibility)
318
319 // cbGrpprlChpx
320 std::unique_ptr<ww::bytes> pCharAtrs;
321 if ( pOutSet )
322 {
323 std::unique_ptr<ww::bytes> pOldpO = std::move(m_rWW8Export.m_pO);
324 m_rWW8Export.m_pO.reset(new ww::bytes);
325 if ( pFont )
326 {
327 sal_uInt16 nFontID = m_rWW8Export.m_aFontHelper.GetId( *pFont );
328
330 m_rWW8Export.InsUInt16( nFontID );
332 m_rWW8Export.InsUInt16( nFontID );
333 }
334
335 m_rWW8Export.OutputItemSet( *pOutSet, false, true, i18n::ScriptType::LATIN, m_rWW8Export.m_bExportModeRTF );
336 //For i120928,achieve graphic's index of bullet from the bullet bookmark
337 if (SVX_NUM_BITMAP == nNumberingType && pBrush)
338 {
339 int nIndex = m_rWW8Export.GetGrfIndex(*pBrush);
340 if ( nIndex != -1 )
341 {
346 }
347 }
348
349 pCharAtrs = std::move(m_rWW8Export.m_pO);
350 m_rWW8Export.m_pO = std::move(pOldpO);
351 }
352 m_rWW8Export.m_pTableStrm->WriteUChar(sal_uInt8(pCharAtrs ? pCharAtrs->size() : 0));
353
354 // cbGrpprlPapx
355 sal_uInt8 aPapSprms [] = {
356 0x5e, 0x84, 0, 0, // sprmPDxaLeft
357 0x60, 0x84, 0, 0, // sprmPDxaLeft1
358 0x15, 0xc6, 0x05, 0x00, 0x01, 0, 0, 0x06
359 };
360 m_rWW8Export.m_pTableStrm->WriteUChar( sal_uInt8( sizeof( aPapSprms ) ) );
361
362 // reserved
364
365 // pap sprms
366 sal_uInt8* pData = aPapSprms + 2;
367 Set_UInt16( pData, nIndentAt );
368 pData += 2;
369 Set_UInt16( pData, nFirstLineIndex );
370 pData += 5;
371 Set_UInt16( pData, nListTabPos );
372
373 m_rWW8Export.m_pTableStrm->WriteBytes(aPapSprms, sizeof(aPapSprms));
374
375 // write Chpx
376 if (pCharAtrs && !pCharAtrs->empty())
377 m_rWW8Export.m_pTableStrm->WriteBytes(pCharAtrs->data(), pCharAtrs->size());
378
379 // write the num string
380 m_rWW8Export.m_pTableStrm->WriteUInt16( rNumberingString.getLength() );
381 SwWW8Writer::WriteString16( *m_rWW8Export.m_pTableStrm, rNumberingString, false );
382}
383
385{
386 sal_uInt16 nCount = m_pUsedNumTable->size();
387 sal_uInt16 n;
388
389 for( n = 0; n < nCount; ++n )
390 {
391 if (nullptr == (*m_pUsedNumTable)[ n ])
392 {
393 continue;
394 }
395
397
398 const SwNumRule& rRule = *(*m_pUsedNumTable)[ n ];
399 sal_uInt8 nLvl;
400 sal_uInt8 nLevels = static_cast< sal_uInt8 >(rRule.IsContinusNum() ?
402 for( nLvl = 0; nLvl < nLevels; ++nLvl )
403 {
404 NumberingLevel(rRule, nLvl);
405 }
406
408 }
409}
410
412 SwNumRule const& rRule, sal_uInt8 const nLvl)
413{
414 // write the static data of the SwNumFormat of this level
415 sal_uInt8 aNumLvlPos[WW8ListManager::nMaxLevel] = { 0,0,0,0,0,0,0,0,0 };
416
417 const SwNumFormat& rFormat = rRule.Get( nLvl );
418
419 sal_uInt8 nFollow = 0;
420 // #i86652#
422 {
423 // <nFollow = 2>, if minimum label width equals 0 and
424 // minimum distance between label and text equals 0
425 nFollow = (rFormat.GetFirstLineOffset() == 0 &&
426 rFormat.GetCharTextDistance() == 0)
427 ? 2 : 0; // ixchFollow: 0 - tab, 1 - blank, 2 - nothing
428 }
430 {
431 switch (rFormat.GetLabelFollowedBy())
432 {
434 {
435 // 0 (tab) unless there would be no content before the tab, in which case 2 (nothing)
436 nFollow = (SVX_NUM_NUMBER_NONE != rFormat.GetNumberingType()) ? 0 : 2;
437 }
438 break;
440 {
441 // 1 (space) unless there would be no content before the space in which case 2 (nothing)
442 nFollow = (SVX_NUM_NUMBER_NONE != rFormat.GetNumberingType()) ? 1 : 2;
443 }
444 break;
446 {
447 nFollow = 2;
448 }
449 break;
450 default:
451 {
452 nFollow = 0;
453 OSL_FAIL( "unknown GetLabelFollowedBy() return value" );
454 }
455 }
456 }
457
458 // Build the NumString for this Level
459 OUString sNumStr;
460 OUString sFontName;
461 bool bWriteBullet = false;
462 std::optional<vcl::Font> pBulletFont;
463 rtl_TextEncoding eChrSet=0;
465 if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType() ||
466 SVX_NUM_BITMAP == rFormat.GetNumberingType())
467 {
468 // Use bullet
469 sal_UCS4 cBullet = rFormat.GetBulletChar();
470 sNumStr = OUString(&cBullet, 1);
471 }
472 else
473 {
474 // Create level string
475 if (rFormat.HasListFormat())
476 {
477 sal_uInt8* pLvlPos = aNumLvlPos;
478 sNumStr = rFormat.GetListFormat();
479
480 // now search the nums in the string
481 for (sal_uInt8 i = 0; i <= nLvl; ++i)
482 {
483 OUString sSrch("%" + OUString::number(i+1) + "%");
484 sal_Int32 nFnd = sNumStr.indexOf(sSrch);
485 if (-1 != nFnd)
486 {
487 *pLvlPos = static_cast<sal_uInt8>(nFnd + 1);
488 ++pLvlPos;
489 sNumStr = sNumStr.replaceAt(nFnd, sSrch.getLength(), rtl::OUStringChar(static_cast<char>(i)));
490 }
491 }
492 }
493 else if (rFormat.GetNumberingType() != SVX_NUM_NUMBER_NONE)
494 assert(false && "deprecated format still exists and is unhandled. Inform Vasily or Justin");
495 }
496
497 if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType() ||
498 SVX_NUM_BITMAP == rFormat.GetNumberingType())
499 {
500 bWriteBullet = true;
501
502 pBulletFont = rFormat.GetBulletFont();
503 if (!pBulletFont)
504 {
505 pBulletFont = numfunc::GetDefBulletFont();
506 }
507
508 eChrSet = pBulletFont->GetCharSet();
509 sFontName = pBulletFont->GetFamilyName();
510 eFamily = pBulletFont->GetFamilyType();
511
512 if (IsOpenSymbol(sFontName))
513 SubstituteBullet(sNumStr, eChrSet, sFontName);
514 }
515
516 // Attributes of the numbering
517 std::unique_ptr<wwFont> pPseudoFont;
518 const SfxItemSet* pOutSet = nullptr;
519
520 // cbGrpprlChpx
522 if (rFormat.GetCharFormat() || bWriteBullet)
523 {
524 if (bWriteBullet)
525 {
526 pOutSet = &aSet;
527
528 if (rFormat.GetCharFormat())
529 aSet.Put( rFormat.GetCharFormat()->GetAttrSet() );
532
533 if (sFontName.isEmpty())
534 sFontName = pBulletFont->GetFamilyName();
535
536 pPseudoFont.reset(new wwFont( sFontName, pBulletFont->GetPitch(),
537 eFamily, eChrSet));
538 }
539 else
540 pOutSet = &rFormat.GetCharFormat()->GetAttrSet();
541 }
542
543 sal_Int16 nIndentAt = 0;
544 sal_Int16 nFirstLineIndex = 0;
545 sal_Int16 nListTabPos = -1;
546
547 // #i86652#
549 {
550 nIndentAt = nListTabPos = rFormat.GetAbsLSpace(); //TODO: overflow
551 nFirstLineIndex = GetWordFirstLineOffset(rFormat);
552 }
554 {
555 nIndentAt = static_cast<sal_Int16>(rFormat.GetIndentAt());
556 nFirstLineIndex = static_cast<sal_Int16>(rFormat.GetFirstLineIndent());
557 nListTabPos = rFormat.GetLabelFollowedBy() == SvxNumberFormat::LISTTAB?
558 static_cast<sal_Int16>( rFormat.GetListtabPos() ) : 0;
559 }
560
562 rFormat.GetStart(),
563 rFormat.GetNumberingType(),
564 rFormat.GetNumAdjust(),
565 aNumLvlPos,
566 nFollow,
567 pPseudoFont.get(), pOutSet,
568 nIndentAt, nFirstLineIndex, nListTabPos,
569 sNumStr,
570 rFormat.GetNumberingType()==SVX_NUM_BITMAP ? rFormat.GetBrush() : nullptr, rFormat.GetIsLegal());
571}
572
574{
575 if( !m_pUsedNumTable )
576 return ; // no numbering is used
577
578 // write the "list format override" - LFO
579 sal_uInt16 nCount = m_pUsedNumTable->size();
580 sal_uInt16 n;
581
582 m_pFib->m_fcPlfLfo = m_pTableStrm->Tell();
584
585 // LFO ([MS-DOC] 2.9.131)
586 for( n = 0; n < nCount; ++n )
587 {
588 m_pTableStrm->WriteUInt32( n + 1 );
590 }
591 // LFOData ([MS-DOC] 2.9.132)
592 for( n = 0; n < nCount; ++n )
593 m_pTableStrm->WriteInt32( -1 ); // no overwrite
594
595 // set len to FIB
596 m_pFib->m_lcbPlfLfo = m_pTableStrm->Tell() - m_pFib->m_fcPlfLfo;
597}
598
600{
601 if( !m_pUsedNumTable )
602 return ; // no numbering is used
603
604 // write the "list format override" - LFO
605 sal_uInt16 nNms = 0, nCount = m_pUsedNumTable->size();
606
607 m_pFib->m_fcSttbListNames = m_pTableStrm->Tell();
610
611 for( ; nNms < nCount; ++nNms )
612 {
613 const SwNumRule& rRule = *(*m_pUsedNumTable)[ nNms ];
614 OUString sNm;
615 if( !rRule.IsAutoRule() )
616 sNm = rRule.GetName();
617
618 m_pTableStrm->WriteUInt16( sNm.getLength() );
619 if (!sNm.isEmpty())
621 }
622
623 SwWW8Writer::WriteLong( *m_pTableStrm, m_pFib->m_fcSttbListNames + 2, nNms );
624 // set len to FIB
625 m_pFib->m_lcbSttbListNames = m_pTableStrm->Tell() - m_pFib->m_fcSttbListNames;
626}
627
629 rtl_TextEncoding& rChrSet, OUString& rFontName ) const
630{
632 return;
633 OUString sFontName = rFontName;
634
635 // If Bullet char is "", don't change
636 if (rNumStr[0] != u'\0')
637 {
638 rNumStr = rNumStr.replaceAt(0, 1, rtl::OUStringChar(
639 msfilter::util::bestFitOpenSymbolToMSFont(rNumStr[0], rChrSet, sFontName)));
640 }
641
642 rFontName = sFontName;
643}
644
645/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void NumberingDefinition(sal_uInt16 nId, const SwNumRule &rRule)=0
Definition of a numbering instance.
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, bool isLegal)=0
All the numbering level information.
virtual void OverrideNumberingDefinition(SwNumRule const &, sal_uInt16, sal_uInt16, const std::map< size_t, size_t > &)
Numbering definition that overrides abstract numbering definition.
virtual void StartAbstractNumbering(sal_uInt16)
Start of the abstract numbering definition instance.
virtual void EndAbstractNumbering()
End of the abstract numbering definition instance.
bool m_bExportModeRTF
Definition: wrtww8.hxx:571
void OutputItemSet(const SfxItemSet &rSet, bool bPapFormat, bool bChpFormat, sal_uInt16 nScript, bool bExportParentItemSet)
Use OutputItem() on an item set according to the parameters.
Definition: ww8atr.cxx:314
void SubstituteBullet(OUString &rNumStr, rtl_TextEncoding &rChrSet, OUString &rFontName) const
Definition: wrtw8num.cxx:628
sal_uInt16 m_nUniqueList
current number for creating unique list names
Definition: wrtww8.hxx:485
sal_uInt16 DuplicateNumRule(const SwNumRule *pRule, sal_uInt8 nLevel, sal_uInt16 nVal)
In case of numbering restart.
Definition: wrtw8num.cxx:57
SwNumRule * DuplicateNumRuleImpl(const SwNumRule *pRule)
Definition: wrtw8num.cxx:41
void AddListLevelOverride(sal_uInt16 nListId, sal_uInt16 nLevelNum, sal_uInt16 nStartAt)
Store list level overrides (restart of list)
Definition: wrtw8num.cxx:115
sal_uInt16 OverrideNumRule(SwNumRule const &rExistingRule, OUString const &rListId, SwNumRule const &rAbstractRule)
Create a overriding numbering definition (if it does not yet exist)
Definition: wrtw8num.cxx:93
bool m_bSubstituteBullets
Definition: wrtww8.hxx:567
std::map< size_t, std::pair< size_t, size_t > > m_OverridingNums
overriding numdef index -> (existing numdef index, abstractnumdef index)
Definition: wrtww8.hxx:462
void NumberingLevel(SwNumRule const &rRule, sal_uInt8 nLvl)
Write one numbering level.
Definition: wrtw8num.cxx:411
wwFontHelper m_aFontHelper
Definition: wrtww8.hxx:453
int GetGrfIndex(const SvxBrushItem &rBrush)
Returns the index of a picture bullet, used in numberings.
Definition: wrtww8.cxx:1634
sal_uInt16 GetNumberingId(const SwNumRule &rNumRule)
Return the numeric id of the numbering rule.
Definition: wrtw8num.cxx:122
std::unique_ptr< SwNumRuleTable > m_pUsedNumTable
Definition: wrtww8.hxx:460
virtual AttributeOutputBase & AttrOutput() const =0
Access to the attribute output class.
std::map< OUString, size_t > m_Lists
list-id -> abstractnumdef index
Definition: wrtww8.hxx:464
sal_uInt16 DuplicateAbsNum(OUString const &rListId, SwNumRule const &rAbstractRule)
check if a new abstractNum is needed for this list
Definition: wrtw8num.cxx:70
void AbstractNumberingDefinitions()
Write all Levels for all SwNumRules - LVLF.
Definition: wrtw8num.cxx:384
std::map< size_t, std::map< size_t, size_t > > m_ListLevelOverrides
Map of maps for list levels overrides listid -> level number -> restart value.
Definition: wrtww8.hxx:468
void NumberingDefinitions()
Write static data of SwNumRule - LSTF.
Definition: wrtw8num.cxx:210
SwDoc & m_rDoc
Definition: wrtww8.hxx:576
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
SvStream & WriteInt32(sal_Int32 nInt32)
sal_uInt64 Tell() const
std::size_t WriteBytes(const void *pData, std::size_t nSize)
SvStream & WriteInt16(sal_Int16 nInt16)
SvStream & WriteUChar(unsigned char nChar)
SvStream & WriteUInt16(sal_uInt16 nUInt16)
SvStream & WriteUInt32(sal_uInt32 nUInt32)
LanguageType GetLanguage() const
void SetStart(sal_uInt16 nSet)
tools::Long GetIndentAt() const
const SvxBrushItem * GetBrush() const
OUString GetListFormat(bool bIncludePrefixSuffix=true) const
sal_Int32 GetFirstLineOffset() const
tools::Long GetFirstLineIndent() const
const std::optional< vcl::Font > & GetBulletFont() const
sal_UCS4 GetBulletChar() const
sal_uInt16 GetStart() const
sal_Int32 GetAbsLSpace() const
LabelFollowedBy GetLabelFollowedBy() const
bool GetIsLegal() const
tools::Long GetListtabPos() const
SvxAdjust GetNumAdjust() const
bool HasListFormat() const
SvxNumPositionAndSpaceMode GetPositionAndSpaceMode() const
short GetCharTextDistance() const
SvxNumType GetNumberingType() const
OUString GetUniqueNumRuleName(const OUString *pChkStr=nullptr, bool bAutoNum=true) const
Definition: docnum.cxx:2532
bool IsUsed(const sw::BroadcastingModify &) const
Definition: poolfmt.cxx:86
const SwNumRuleTable & GetNumRuleTable() const
Definition: doc.hxx:1081
SwNumRule * GetOutlineNumRule() const
Definition: doc.hxx:1039
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1337
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:136
SwCharFormat * GetCharFormat() const
Definition: numrule.hxx:74
bool IsAutoRule() const
Definition: numrule.hxx:229
bool IsContinusNum() const
Definition: numrule.hxx:235
const OUString & GetDefaultListId() const
Definition: numrule.hxx:194
const SwNumFormat & Get(sal_uInt16 i) const
Definition: number.cxx:87
void Set(sal_uInt16 i, const SwNumFormat *)
Definition: number.cxx:618
const OUString & GetName() const
Definition: numrule.hxx:224
iterator end()
Definition: docary.hxx:91
iterator begin()
Definition: docary.hxx:89
static void FillCount(SvStream &rStrm, sal_uLong nCount)
Definition: wrtww8.cxx:935
static void WriteLong(SvStream &rStrm, sal_Int32 nVal)
Definition: wrtww8.hxx:972
static void WriteString16(SvStream &rStrm, const OUString &rStr, bool bAddZero)
Definition: wrtww8.cxx:1746
virtual void NumberingDefinition(sal_uInt16 nId, const SwNumRule &rRule) override
Definition of a numbering instance.
Definition: wrtw8num.cxx:194
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, bool isLegal) override
All the numbering level information.
Definition: wrtw8num.cxx:269
WW8Export & m_rWW8Export
Reference to the export, where to get the data from.
void InsUInt16(sal_uInt16 n)
Definition: wrtww8.hxx:1160
virtual void WriteNumbering() override
Output the numbering table.
Definition: wrtw8num.cxx:172
void InsUInt32(sal_uInt32 n)
Definition: wrtww8.hxx:1162
SvStream * m_pTableStrm
Definition: wrtww8.hxx:1001
std::unique_ptr< WW8Fib > m_pFib
File Information Block.
Definition: wrtww8.hxx:1003
void OutOverrideListTab()
Definition: wrtw8num.cxx:573
static sal_uInt8 GetNumId(sal_uInt16 eNumType)
Converts the SVX numbering type to MSONFC.
Definition: ww8atr.cxx:793
void OutListNamesTab()
Definition: wrtw8num.cxx:599
std::unique_ptr< ww::bytes > m_pO
Buffer.
Definition: wrtww8.hxx:999
sal_uInt16 GetId(const SvxFontItem &rFont)
Definition: wrtw8sty.cxx:950
Collects and outputs fonts.
Definition: wrtww8.hxx:297
int nCount
float u
UNOTOOLS_DLLPUBLIC bool IsOpenSymbol(std::u16string_view rFontName)
FontFamily
FAMILY_DECORATIVE
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
sal_Int32 nIndex
void * p
sal_Int64 n
#define LANGUAGE_CHINESE_SIMPLIFIED
sal_Int32 nFirstLineOffset
OUString sPrefix
std::unique_ptr< sal_Int32[]> pData
int i
sal_Unicode bestFitOpenSymbolToMSFont(sal_Unicode cBullet, rtl_TextEncoding &r_ioChrSet, OUString &r_ioFontName)
const vcl::Font & GetDefBulletFont()
retrieve font used for the default bullet list characters
Definition: number.cxx:1372
std::vector< sal_uInt8 > bytes
Definition: types.hxx:29
sal_Int16 nId
static constexpr sal_uInt16 val
Definition: sprmids.hxx:278
SVX_NUM_NUMBER_NONE
SVX_NUM_BITMAP
SVX_NUM_CHAR_SPECIAL
SVX_NUM_NUMBER_LOWER_ZH
SvxAdjust
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:92
unsigned char sal_uInt8
sal_uInt32 sal_UCS4
static sal_uInt8 GetLevelNFC(sal_uInt16 eNumType, const SfxItemSet *pOutSet, sal_uInt8 nDefault)
Converts the SVX numbering type to MSONFC.
Definition: wrtw8num.cxx:241
sal_Int16 GetWordFirstLineOffset(const SwNumFormat &rFormat)
Definition: wrtw8num.cxx:159
void Set_UInt16(sal_uInt8 *&p, sal_uInt16 n)
Definition: ww8struc.hxx:47