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 )
283{
284 // Start value
286
287 // Type
288 sal_uInt8 nNumId = GetLevelNFC(nNumberingType, pOutSet, WW8Export::GetNumId(nNumberingType));
290
291 // Justification
292 sal_uInt8 nAlign;
293 switch ( eAdjust )
294 {
295 case SvxAdjust::Center:
296 nAlign = 1;
297 break;
298 case SvxAdjust::Right:
299 nAlign = 2;
300 break;
301 default:
302 nAlign = 0;
303 break;
304 }
306
307 // Write the rgbxchNums[9], positions of placeholders for paragraph
308 // numbers in the text
310
311 // Type of the character between the bullet and the text
313
314 // dxaSoace/dxaIndent (Word 6 compatibility)
317
318 // cbGrpprlChpx
319 std::unique_ptr<ww::bytes> pCharAtrs;
320 if ( pOutSet )
321 {
322 std::unique_ptr<ww::bytes> pOldpO = std::move(m_rWW8Export.m_pO);
323 m_rWW8Export.m_pO.reset(new ww::bytes);
324 if ( pFont )
325 {
326 sal_uInt16 nFontID = m_rWW8Export.m_aFontHelper.GetId( *pFont );
327
329 m_rWW8Export.InsUInt16( nFontID );
331 m_rWW8Export.InsUInt16( nFontID );
332 }
333
334 m_rWW8Export.OutputItemSet( *pOutSet, false, true, i18n::ScriptType::LATIN, m_rWW8Export.m_bExportModeRTF );
335 //For i120928,achieve graphic's index of bullet from the bullet bookmark
336 if (SVX_NUM_BITMAP == nNumberingType && pBrush)
337 {
338 int nIndex = m_rWW8Export.GetGrfIndex(*pBrush);
339 if ( nIndex != -1 )
340 {
345 }
346 }
347
348 pCharAtrs = std::move(m_rWW8Export.m_pO);
349 m_rWW8Export.m_pO = std::move(pOldpO);
350 }
351 m_rWW8Export.m_pTableStrm->WriteUChar(sal_uInt8(pCharAtrs ? pCharAtrs->size() : 0));
352
353 // cbGrpprlPapx
354 sal_uInt8 aPapSprms [] = {
355 0x5e, 0x84, 0, 0, // sprmPDxaLeft
356 0x60, 0x84, 0, 0, // sprmPDxaLeft1
357 0x15, 0xc6, 0x05, 0x00, 0x01, 0, 0, 0x06
358 };
359 m_rWW8Export.m_pTableStrm->WriteUChar( sal_uInt8( sizeof( aPapSprms ) ) );
360
361 // reserved
363
364 // pap sprms
365 sal_uInt8* pData = aPapSprms + 2;
366 Set_UInt16( pData, nIndentAt );
367 pData += 2;
368 Set_UInt16( pData, nFirstLineIndex );
369 pData += 5;
370 Set_UInt16( pData, nListTabPos );
371
372 m_rWW8Export.m_pTableStrm->WriteBytes(aPapSprms, sizeof(aPapSprms));
373
374 // write Chpx
375 if (pCharAtrs && !pCharAtrs->empty())
376 m_rWW8Export.m_pTableStrm->WriteBytes(pCharAtrs->data(), pCharAtrs->size());
377
378 // write the num string
379 m_rWW8Export.m_pTableStrm->WriteUInt16( rNumberingString.getLength() );
380 SwWW8Writer::WriteString16( *m_rWW8Export.m_pTableStrm, rNumberingString, false );
381}
382
384{
385 sal_uInt16 nCount = m_pUsedNumTable->size();
386 sal_uInt16 n;
387
388 for( n = 0; n < nCount; ++n )
389 {
390 if (nullptr == (*m_pUsedNumTable)[ n ])
391 {
392 continue;
393 }
394
396
397 const SwNumRule& rRule = *(*m_pUsedNumTable)[ n ];
398 sal_uInt8 nLvl;
399 sal_uInt8 nLevels = static_cast< sal_uInt8 >(rRule.IsContinusNum() ?
401 for( nLvl = 0; nLvl < nLevels; ++nLvl )
402 {
403 NumberingLevel(rRule, nLvl);
404 }
405
407 }
408}
409
411 SwNumRule const& rRule, sal_uInt8 const nLvl)
412{
413 // write the static data of the SwNumFormat of this level
414 sal_uInt8 aNumLvlPos[WW8ListManager::nMaxLevel] = { 0,0,0,0,0,0,0,0,0 };
415
416 const SwNumFormat& rFormat = rRule.Get( nLvl );
417
418 sal_uInt8 nFollow = 0;
419 // #i86652#
421 {
422 // <nFollow = 2>, if minimum label width equals 0 and
423 // minimum distance between label and text equals 0
424 nFollow = (rFormat.GetFirstLineOffset() == 0 &&
425 rFormat.GetCharTextDistance() == 0)
426 ? 2 : 0; // ixchFollow: 0 - tab, 1 - blank, 2 - nothing
427 }
429 {
430 switch (rFormat.GetLabelFollowedBy())
431 {
433 {
434 // 0 (tab) unless there would be no content before the tab, in which case 2 (nothing)
435 nFollow = (SVX_NUM_NUMBER_NONE != rFormat.GetNumberingType()) ? 0 : 2;
436 }
437 break;
439 {
440 // 1 (space) unless there would be no content before the space in which case 2 (nothing)
441 nFollow = (SVX_NUM_NUMBER_NONE != rFormat.GetNumberingType()) ? 1 : 2;
442 }
443 break;
445 {
446 nFollow = 2;
447 }
448 break;
449 default:
450 {
451 nFollow = 0;
452 OSL_FAIL( "unknown GetLabelFollowedBy() return value" );
453 }
454 }
455 }
456
457 // Build the NumString for this Level
458 OUString sNumStr;
459 OUString sFontName;
460 bool bWriteBullet = false;
461 std::optional<vcl::Font> pBulletFont;
462 rtl_TextEncoding eChrSet=0;
464 if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType() ||
465 SVX_NUM_BITMAP == rFormat.GetNumberingType())
466 {
467 // Use bullet
468 sal_UCS4 cBullet = rFormat.GetBulletChar();
469 sNumStr = OUString(&cBullet, 1);
470 }
471 else
472 {
473 // Create level string
474 if (rFormat.HasListFormat())
475 {
476 sal_uInt8* pLvlPos = aNumLvlPos;
477 sNumStr = rFormat.GetListFormat();
478
479 // now search the nums in the string
480 for (sal_uInt8 i = 0; i <= nLvl; ++i)
481 {
482 OUString sSrch("%" + OUString::number(i+1) + "%");
483 sal_Int32 nFnd = sNumStr.indexOf(sSrch);
484 if (-1 != nFnd)
485 {
486 *pLvlPos = static_cast<sal_uInt8>(nFnd + 1);
487 ++pLvlPos;
488 sNumStr = sNumStr.replaceAt(nFnd, sSrch.getLength(), rtl::OUStringChar(static_cast<char>(i)));
489 }
490 }
491 }
492 else if (rFormat.GetNumberingType() != SVX_NUM_NUMBER_NONE)
493 assert(false && "deprecated format still exists and is unhandled. Inform Vasily or Justin");
494 }
495
496 if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType() ||
497 SVX_NUM_BITMAP == rFormat.GetNumberingType())
498 {
499 bWriteBullet = true;
500
501 pBulletFont = rFormat.GetBulletFont();
502 if (!pBulletFont)
503 {
504 pBulletFont = numfunc::GetDefBulletFont();
505 }
506
507 eChrSet = pBulletFont->GetCharSet();
508 sFontName = pBulletFont->GetFamilyName();
509 eFamily = pBulletFont->GetFamilyType();
510
511 if (IsStarSymbol(sFontName))
512 SubstituteBullet(sNumStr, eChrSet, sFontName);
513 }
514
515 // Attributes of the numbering
516 std::unique_ptr<wwFont> pPseudoFont;
517 const SfxItemSet* pOutSet = nullptr;
518
519 // cbGrpprlChpx
521 if (rFormat.GetCharFormat() || bWriteBullet)
522 {
523 if (bWriteBullet)
524 {
525 pOutSet = &aSet;
526
527 if (rFormat.GetCharFormat())
528 aSet.Put( rFormat.GetCharFormat()->GetAttrSet() );
531
532 if (sFontName.isEmpty())
533 sFontName = pBulletFont->GetFamilyName();
534
535 pPseudoFont.reset(new wwFont( sFontName, pBulletFont->GetPitch(),
536 eFamily, eChrSet));
537 }
538 else
539 pOutSet = &rFormat.GetCharFormat()->GetAttrSet();
540 }
541
542 sal_Int16 nIndentAt = 0;
543 sal_Int16 nFirstLineIndex = 0;
544 sal_Int16 nListTabPos = -1;
545
546 // #i86652#
548 {
549 nIndentAt = nListTabPos = rFormat.GetAbsLSpace(); //TODO: overflow
550 nFirstLineIndex = GetWordFirstLineOffset(rFormat);
551 }
553 {
554 nIndentAt = static_cast<sal_Int16>(rFormat.GetIndentAt());
555 nFirstLineIndex = static_cast<sal_Int16>(rFormat.GetFirstLineIndent());
556 nListTabPos = rFormat.GetLabelFollowedBy() == SvxNumberFormat::LISTTAB?
557 static_cast<sal_Int16>( rFormat.GetListtabPos() ) : 0;
558 }
559
561 rFormat.GetStart(),
562 rFormat.GetNumberingType(),
563 rFormat.GetNumAdjust(),
564 aNumLvlPos,
565 nFollow,
566 pPseudoFont.get(), pOutSet,
567 nIndentAt, nFirstLineIndex, nListTabPos,
568 sNumStr,
569 rFormat.GetNumberingType()==SVX_NUM_BITMAP ? rFormat.GetBrush() : nullptr);
570}
571
573{
574 if( !m_pUsedNumTable )
575 return ; // no numbering is used
576
577 // write the "list format override" - LFO
578 sal_uInt16 nCount = m_pUsedNumTable->size();
579 sal_uInt16 n;
580
581 m_pFib->m_fcPlfLfo = m_pTableStrm->Tell();
583
584 // LFO ([MS-DOC] 2.9.131)
585 for( n = 0; n < nCount; ++n )
586 {
587 m_pTableStrm->WriteUInt32( n + 1 );
589 }
590 // LFOData ([MS-DOC] 2.9.132)
591 for( n = 0; n < nCount; ++n )
592 m_pTableStrm->WriteInt32( -1 ); // no overwrite
593
594 // set len to FIB
595 m_pFib->m_lcbPlfLfo = m_pTableStrm->Tell() - m_pFib->m_fcPlfLfo;
596}
597
599{
600 if( !m_pUsedNumTable )
601 return ; // no numbering is used
602
603 // write the "list format override" - LFO
604 sal_uInt16 nNms = 0, nCount = m_pUsedNumTable->size();
605
606 m_pFib->m_fcSttbListNames = m_pTableStrm->Tell();
609
610 for( ; nNms < nCount; ++nNms )
611 {
612 const SwNumRule& rRule = *(*m_pUsedNumTable)[ nNms ];
613 OUString sNm;
614 if( !rRule.IsAutoRule() )
615 sNm = rRule.GetName();
616
617 m_pTableStrm->WriteUInt16( sNm.getLength() );
618 if (!sNm.isEmpty())
620 }
621
622 SwWW8Writer::WriteLong( *m_pTableStrm, m_pFib->m_fcSttbListNames + 2, nNms );
623 // set len to FIB
624 m_pFib->m_lcbSttbListNames = m_pTableStrm->Tell() - m_pFib->m_fcSttbListNames;
625}
626
628 rtl_TextEncoding& rChrSet, OUString& rFontName ) const
629{
631 return;
632 OUString sFontName = rFontName;
633
634 // If Bullet char is "", don't change
635 if (rNumStr[0] != u'\0')
636 {
637 rNumStr = rNumStr.replaceAt(0, 1, rtl::OUStringChar(
638 msfilter::util::bestFitOpenSymbolToMSFont(rNumStr[0], rChrSet, sFontName)));
639 }
640
641 rFontName = sFontName;
642}
643
644/* 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)=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:313
void SubstituteBullet(OUString &rNumStr, rtl_TextEncoding &rChrSet, OUString &rFontName) const
Definition: wrtw8num.cxx:627
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:410
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:1630
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:383
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
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:2533
bool IsUsed(const sw::BroadcastingModify &) const
Definition: poolfmt.cxx:86
const SwNumRuleTable & GetNumRuleTable() const
Definition: doc.hxx:1070
SwNumRule * GetOutlineNumRule() const
Definition: doc.hxx:1028
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1322
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:90
iterator begin()
Definition: docary.hxx:88
static void FillCount(SvStream &rStrm, sal_uLong nCount)
Definition: wrtww8.cxx:931
static void WriteLong(SvStream &rStrm, sal_Int32 nVal)
Definition: wrtww8.hxx:970
static void WriteString16(SvStream &rStrm, const OUString &rStr, bool bAddZero)
Definition: wrtww8.cxx:1742
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) 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:1158
virtual void WriteNumbering() override
Output the numbering table.
Definition: wrtw8num.cxx:172
void InsUInt32(sal_uInt32 n)
Definition: wrtww8.hxx:1160
SvStream * m_pTableStrm
Definition: wrtww8.hxx:999
std::unique_ptr< WW8Fib > m_pFib
File Information Block.
Definition: wrtww8.hxx:1001
void OutOverrideListTab()
Definition: wrtw8num.cxx:572
static sal_uInt8 GetNumId(sal_uInt16 eNumType)
Converts the SVX numbering type to MSONFC.
Definition: ww8atr.cxx:741
void OutListNamesTab()
Definition: wrtw8num.cxx:598
std::unique_ptr< ww::bytes > m_pO
Buffer.
Definition: wrtww8.hxx:997
sal_uInt16 GetId(const SvxFontItem &rFont)
Definition: wrtw8sty.cxx:906
Collects and outputs fonts.
Definition: wrtww8.hxx:297
int nCount
float u
UNOTOOLS_DLLPUBLIC bool IsStarSymbol(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:1392
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