LibreOffice Module sw (master) 1
ww8par3.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 <memory>
21#include <string_view>
22#include <svl/itemiter.hxx>
23#include <vcl/svapp.hxx>
24#include <vcl/outdev.hxx>
25#include <sal/log.hxx>
26
27#include <vcl/unohelp.hxx>
28#include <com/sun/star/form/XFormComponent.hpp>
29#include <com/sun/star/drawing/XShape.hpp>
30#include <com/sun/star/drawing/XShapes.hpp>
31#include <com/sun/star/drawing/XControlShape.hpp>
32#include <com/sun/star/lang/XMultiServiceFactory.hpp>
33#include <com/sun/star/container/XIndexContainer.hpp>
34#include <com/sun/star/text/VertOrientation.hpp>
35#include <com/sun/star/text/TextContentAnchorType.hpp>
36#include <com/sun/star/beans/XPropertyContainer.hpp>
37#include <com/sun/star/beans/PropertyAttribute.hpp>
38
39#include <algorithm>
40#include <hintids.hxx>
41#include <editeng/fontitem.hxx>
42#include <editeng/lrspitem.hxx>
43#include <editeng/fhgtitem.hxx>
44#include <editeng/colritem.hxx>
45#include <editeng/wghtitem.hxx>
47#include <editeng/udlnitem.hxx>
48#include <editeng/postitem.hxx>
49#include <o3tl/safeint.hxx>
50#include <o3tl/temporary.hxx>
51#include <unotextrange.hxx>
52#include <doc.hxx>
53#include <docary.hxx>
56#include <docsh.hxx>
57#include <numrule.hxx>
58#include <paratr.hxx>
59#include <charatr.hxx>
60#include <charfmt.hxx>
61#include <ndtxt.hxx>
62#include <expfld.hxx>
63#include <fmtfld.hxx>
64#include <flddropdown.hxx>
65#include "sprmids.hxx"
66#include "writerhelper.hxx"
67#include "writerwordglue.hxx"
68#include "ww8par.hxx"
69#include "ww8par2.hxx"
70
71#include <IMark.hxx>
72#include <unotools/fltrcfg.hxx>
73#include <rtl/character.hxx>
74#include <xmloff/odffields.hxx>
75#include <comphelper/string.hxx>
76
77using namespace com::sun::star;
78using namespace sw::util;
79using namespace sw::types;
80using namespace sw::mark;
81
82// UNO-Controls
83
84// OCX i.e. word 97 form controls
86{
87 if( m_bObj && m_nPicLocFc )
89 m_bEmbeddObj = true;
90 return eF_ResT::TEXT;
91}
92
94{
95 WW8FormulaEditBox aFormula(*this);
96
97 sal_Int32 const nPos(rStr.indexOf(0x01));
98 if (pF->nLCode && nPos != -1 && nPos < pF->nLCode) {
100 }
101
102 /*
103 Here we have a small complication. This formula control contains
104 the default text that is displayed if you edit the form field in
105 the "default text" area. But MSOffice does not display that
106 information, instead it display the result of the field,
107 MSOffice just uses the default text of the control as its
108 initial value for the displayed default text. So we will swap in
109 the field result into the formula here in place of the default
110 text.
111 */
112
114 const bool bUseEnhFields = rOpt.IsUseEnhancedFields();
115
116 if (!bUseEnhFields)
117 {
118 aFormula.msDefault = GetFieldResult(pF);
119
120 SwInputField aField(
122 aFormula.msDefault,
123 aFormula.msTitle,
124 INP_TXT,
125 0 );
126 aField.SetHelp(aFormula.msHelp);
127 aField.SetToolTip(aFormula.msToolTip);
128
130 return eF_ResT::OK;
131 }
132 else
133 {
134 WW8PLCFx_Book* pB = m_xPlcxMan->GetBook();
135 OUString aBookmarkName;
136 if (pB!=nullptr) {
137 WW8_CP currentCP=pF->nSCode;
138 WW8_CP currentLen=pF->nLen;
139
140 WW8_CP nEnd;
141 if (o3tl::checked_add(currentCP, currentLen-1, nEnd)) {
142 SAL_WARN("sw.ww8", "broken offset, ignoring");
143 }
144 else
145 {
146 sal_uInt16 bkmFindIdx;
147 OUString aBookmarkFind=pB->GetBookmark(currentCP-1, nEnd, bkmFindIdx);
148
149 if (!aBookmarkFind.isEmpty()) {
150 pB->SetStatus(bkmFindIdx, BOOK_FIELD); // mark bookmark as consumed, such that it'll not get inserted as a "normal" bookmark again
151 if (!aBookmarkFind.isEmpty()) {
152 aBookmarkName=aBookmarkFind;
153 }
154 }
155 }
156 }
157
158 if (pB!=nullptr && aBookmarkName.isEmpty()) {
159 aBookmarkName=pB->GetUniqueBookmarkName(aFormula.msTitle);
160 }
161
162 if (!aBookmarkName.isEmpty()) {
163 m_aFieldStack.back().SetBookmarkName(aBookmarkName);
164 m_aFieldStack.back().SetBookmarkType(ODF_FORMTEXT);
165 if ( aFormula.msToolTip.getLength() < 139 )
166 m_aFieldStack.back().getParameters()["Description"] <<= aFormula.msToolTip;
167 m_aFieldStack.back().getParameters()["Name"] <<= aFormula.msTitle;
168 if (aFormula.mnMaxLen && aFormula.mnMaxLen < 32768 )
169 m_aFieldStack.back().getParameters()["MaxLength"] <<= aFormula.mnMaxLen;
170
171 if ( aFormula.mfType == 1 )
172 m_aFieldStack.back().getParameters()["Type"] <<= OUString("number");
173 else if ( aFormula.mfType == 2 )
174 m_aFieldStack.back().getParameters()["Type"] <<= OUString("date");
175 else if ( aFormula.mfType == 3 )
176 m_aFieldStack.back().getParameters()["Type"] <<= OUString("currentTime");
177 else if ( aFormula.mfType == 4 )
178 m_aFieldStack.back().getParameters()["Type"] <<= OUString("currentDate");
179 else if ( aFormula.mfType == 5 )
180 m_aFieldStack.back().getParameters()["Type"] <<= OUString("calculated");
181 }
182 return eF_ResT::TEXT;
183 }
184}
185
187{
188 WW8FormulaCheckBox aFormula(*this);
189
190 if (!m_xFormImpl)
192
193 if (rStr[pF->nLCode-1]==0x01)
196 const bool bUseEnhFields = rOpt.IsUseEnhancedFields();
197
198 if (!bUseEnhFields)
199 {
200 m_xFormImpl->InsertFormula(aFormula);
201 return eF_ResT::OK;
202 }
203
204 OUString aBookmarkName;
205 WW8PLCFx_Book* pB = m_xPlcxMan->GetBook();
206 if (pB!=nullptr) {
207 WW8_CP currentCP=pF->nSCode;
208 WW8_CP currentLen=pF->nLen;
209
210 sal_uInt16 bkmFindIdx;
211 OUString aBookmarkFind=pB->GetBookmark(currentCP-1, currentCP+currentLen-1, bkmFindIdx);
212
213 if (!aBookmarkFind.isEmpty()) {
214 pB->SetStatus(bkmFindIdx, BOOK_FIELD); // mark as consumed by field
215 if (!aBookmarkFind.isEmpty()) {
216 aBookmarkName=aBookmarkFind;
217 }
218 }
219 }
220
221 if (pB!=nullptr && aBookmarkName.isEmpty()) {
222 aBookmarkName=pB->GetUniqueBookmarkName(aFormula.msTitle);
223 }
224
225 if (!aBookmarkName.isEmpty())
226 {
228 IFieldmark* pFieldmark = pMarksAccess->makeNoTextFieldBookmark(
229 *m_pPaM, aBookmarkName, ODF_FORMCHECKBOX );
230 OSL_ENSURE(pFieldmark!=nullptr, "hmmm; why was the bookmark not created?");
231 if (pFieldmark!=nullptr) {
232 IFieldmark::parameter_map_t* const pParameters = pFieldmark->GetParameters();
233 ICheckboxFieldmark* pCheckboxFm = dynamic_cast<ICheckboxFieldmark*>(pFieldmark);
234 (*pParameters)[ODF_FORMCHECKBOX_HELPTEXT] <<= aFormula.msToolTip;
235
236 if(pCheckboxFm)
237 pCheckboxFm->SetChecked(aFormula.mnChecked != 0);
238 // set field data here...
239 }
240 }
241 return eF_ResT::OK;
242}
243
245{
246 WW8FormulaListBox aFormula(*this);
247
248 if (pF->nLCode > 0 && rStr.getLength() >= pF->nLCode && rStr[pF->nLCode-1] == 0x01)
250
252 bool bUseEnhFields = rOpt.IsUseEnhancedFields();
253
254 if (!bUseEnhFields)
255 {
257
258 aField.SetName(aFormula.msTitle);
259 aField.SetHelp(aFormula.msHelp);
260 aField.SetToolTip(aFormula.msToolTip);
261
262 if (!aFormula.maListEntries.empty())
263 {
264 aField.SetItems(std::vector(aFormula.maListEntries));
265 int nIndex = aFormula.mfDropdownIndex < aFormula.maListEntries.size() ? aFormula.mfDropdownIndex : 0;
266 aField.SetSelectedItem(aFormula.maListEntries[nIndex]);
267 }
268
270 return eF_ResT::OK;
271 }
272 else
273 {
274 // TODO: review me
275 OUString aBookmarkName;
276 WW8PLCFx_Book* pB = m_xPlcxMan->GetBook();
277 if (pB!=nullptr)
278 {
279 WW8_CP currentCP=pF->nSCode;
280 WW8_CP currentLen=pF->nLen;
281
282 sal_uInt16 bkmFindIdx;
283 OUString aBookmarkFind=pB->GetBookmark(currentCP-1, currentCP+currentLen-1, bkmFindIdx);
284
285 if (!aBookmarkFind.isEmpty())
286 {
287 pB->SetStatus(bkmFindIdx, BOOK_FIELD); // mark as consumed by field
288 if (!aBookmarkFind.isEmpty())
289 aBookmarkName=aBookmarkFind;
290 }
291 }
292
293 if (pB!=nullptr && aBookmarkName.isEmpty())
294 aBookmarkName=pB->GetUniqueBookmarkName(aFormula.msTitle);
295
296 if (!aBookmarkName.isEmpty())
297 {
299 IFieldmark *pFieldmark =
300 pMarksAccess->makeNoTextFieldBookmark( *m_pPaM, aBookmarkName, ODF_FORMDROPDOWN );
301 OSL_ENSURE(pFieldmark!=nullptr, "hmmm; why was the bookmark not created?");
302 if ( pFieldmark != nullptr )
303 {
304 uno::Sequence< OUString > vListEntries(aFormula.maListEntries.size());
305 std::copy(aFormula.maListEntries.begin(), aFormula.maListEntries.end(), vListEntries.getArray());
306 (*pFieldmark->GetParameters())[ODF_FORMDROPDOWN_LISTENTRY] <<= vListEntries;
307 sal_Int32 nIndex = aFormula.mfDropdownIndex < aFormula.maListEntries.size() ? aFormula.mfDropdownIndex : -1;
308 if (nIndex >= 0)
309 (*pFieldmark->GetParameters())[ODF_FORMDROPDOWN_RESULT] <<= nIndex;
310 // set field data here...
311 }
312 }
313
314 return eF_ResT::OK;
315 }
316}
317
319{
320 if( m_bObj && m_nPicLocFc )
322 m_bEmbeddObj = true;
323 return eF_ResT::TEXT;
324}
325
326// Helper declarations
327
328// Style Id's for each level
330// Character Style Pointer
332
333namespace {
334
335struct WW8LST // only THOSE entries, WE need!
336{
337 WW8aIdSty aIdSty; // Style Id's for each level,
338 // nIStDNil if no style linked
339 sal_uInt32 nIdLst; // Unique List ID
340 sal_uInt32 nTplC; // Unique template code - What is this?
341 bool bSimpleList:1; // Flag: List only has ONE level
342 bool bRestartHdn:1; // WW6-Compatibility-Flag:
343 // true if the list should start numbering over
344}; // at the beginning of each section
345
346}
347
348const sal_uInt32 cbLSTF=28;
349
350namespace {
351
352struct WW8LFO // only THOSE entries, WE need!
353{
354 SwNumRule* pNumRule; // Parent NumRule
355 sal_uInt32 nIdLst; // Unique List ID
356 sal_uInt8 nLfoLvl; // count of levels whose format is overridden
357 bool bSimpleList;
358};
359
360struct WW8LVL // only THE entries, WE need!
361{
362 sal_Int32 nStartAt; // start at value for this value
363 sal_Int32 nV6DxaSpace;// Ver6-Compatible: min Space between Num and text::Paragraph
364 sal_Int32 nV6Indent; // Ver6-Compatible: Width of prefix text;
365 // Use definition of first line indent if appropriate!
366 // Paragraph attributes from GrpprlPapx
367 sal_uInt16 nDxaLeft; // left indent
368 short nDxaLeft1; // first line indent
369
370 sal_uInt8 nNFC; // number format code
371 // Offset of fieldcodes in Num-X-String
373 sal_uInt8 nLenGrpprlChpx; // length, in bytes, of the LVL's grpprlChpx
374 sal_uInt8 nLenGrpprlPapx; // length, in bytes, of the LVL's grpprlPapx
375 sal_uInt8 nAlign; // alignment (left, right, centered) of the number
376 bool bV6Prev; // Ver6-Compatible: number will include previous levels
377 bool bV6PrSp; // Ver6-Compatible: doesn't matter
378 bool bV6; // if true, pay attention to the V6-Compatible Entries!
379
380};
381
382struct WW8LFOLVL
383{
384 sal_Int32 nStartAt; // start-at value if bFormat==false and bStartAt == true
385 // (if bFormat==true, the start-at is stored in the LVL)
386 sal_uInt8 nLevel; // the level to be overridden
387 // this byte has not been packed into the following byte on _purpose_ !!
388 // (see comment of struct WW8LFOInfo)
389
390 bool bStartAt :1; // true if the start-at value is overridden
391 bool bFormat :1; // true if the formatting is overridden
392
393 WW8LFOLVL() :
394 nStartAt(1), nLevel(0), bStartAt(true), bFormat(false) {}
395};
396
397}
398
399// Data to be saved in ListInfo
400
401struct WW8LSTInfo // sorted by nIdLst (in WW8 used list-Id)
402{
403 std::vector<ww::bytes> maParaSprms;
404 WW8aIdSty aIdSty; // Style Id's for each level
405 WW8aCFormat aCharFormat = {}; // Character Style Pointer
406
407 SwNumRule* pNumRule; // Pointer to list-template in Writer
408 sal_uInt32 nIdLst; // WW8Id of this list
409 bool bSimpleList:1;// Flag, if this NumRule only uses one Level
410 bool bUsedInDoc :1;// Flag, if this NumRule is used in the Doc,
411 // or is supposed to be deleted on Reader-End
412
413 WW8LSTInfo(SwNumRule* pNumRule_, const WW8LST& aLST)
414 : pNumRule(pNumRule_), nIdLst(aLST.nIdLst),
416 {
417 memcpy( aIdSty, aLST.aIdSty, sizeof( aIdSty ));
418 }
419
420};
421
422// Data to be saved in ListenFormatOverrideInfos
423
424struct WW8LFOInfo // unordered, means ordered like in WW8 Stream
425{
426 std::vector<ww::bytes> maParaSprms;
427 std::vector<WW8LFOLVL> maOverrides;
428 SwNumRule* pNumRule; // Pointer to list template in Writer
429 // either List in LSTInfos or own List
430 // (in Ctor use the list from LSTInfos first)
431
432 sal_uInt32 nIdLst; // WW8-Id of the relevant list
433 sal_uInt8 nLfoLvl; // count of levels whose format is overridden
434 // yes we could include nLfoLvl (via :4) into the following byte,
435 // but it probably would be a source of error once MS increases their Listformat
436 // to more than 15 levels
437
438 bool bOverride :1;// Flag if NumRule is not included in maLSTInfos,
439 // but was created for m_LFOInfos
440 bool bUsedInDoc :1;// Flag if NumRule is used in Doc,
441 // or should be deleted on Reader-End
442 bool bLSTbUIDSet :1;// Flag, if bUsedInDoc is set in maLSTInfos
443
444 explicit WW8LFOInfo(const WW8LFO& rLFO);
445};
446
447WW8LFOInfo::WW8LFOInfo(const WW8LFO& rLFO)
448 : maParaSprms(WW8ListManager::nMaxLevel)
449 , maOverrides(WW8ListManager::nMaxLevel)
450 , pNumRule(rLFO.pNumRule)
451 , nIdLst(rLFO.nIdLst)
452 , nLfoLvl(rLFO.nLfoLvl)
453 , bOverride(rLFO.nLfoLvl != 0)
454 , bUsedInDoc(false)
455 , bLSTbUIDSet(false)
456{
457}
458
459// Helper methods
460
461// find Sprm-Parameter-Data, if Sprm is included in Grpprl
463 sal_uInt8 nLen)
464{
465 return maSprmParser.findSprmData(nId, &rSprms, nLen);
466}
467
468namespace {
469
470class ListWithId
471{
472private:
473 sal_uInt32 mnIdLst;
474public:
475 explicit ListWithId(sal_uInt32 nIdLst) : mnIdLst(nIdLst) {}
476 bool operator() (const std::unique_ptr<WW8LSTInfo>& pEntry) const
477 { return (pEntry->nIdLst == mnIdLst); }
478};
479
480}
481
482// Access via List-Id of LST Entry
484{
485 auto aResult =
486 std::find_if(maLSTInfos.begin(),maLSTInfos.end(),ListWithId(nIdLst));
487 if (aResult == maLSTInfos.end())
488 return nullptr;
489 return aResult->get();
490}
491
493{
495
496 switch (nNFC)
497 {
498 case 0:
500 break;
501 case 1:
503 break;
504 case 2:
506 break;
507 case 3:
509 break;
510 case 4:
512 break;
513 case 5: // ordinal
515 break;
516 case 6: // cardinalText
518 break;
519 case 7: // ordinalText
521 break;
522 //case 8: // hex
523
524 case 9:
525 // 0x09, msonfcChiManSty
527 break;
528 //case 15: // decimalHalfWidth
529 //case 17: // japaneseDigitalTenThousand
530
531 case 18: // decimalEnclosedCircle
532 case 28: // decimalEnclosedCircleChinese
533 case 29: // ideographEnclosedCircle
535 break;
536 case 22:
537 // 0x16, msonfcArabicLZ
539 break;
540 case 23:
542
543 break;
544 case 255:
546 break;
547 case 14:
548 case 19:
550 break;
551 case 30:
553 break;
554 case 31: // ideographZodiac
555 case 32: // ideographZodiacTraditional
557 break;
558 case 33: // taiwaneseCounting
559 case 35:
560 case 36:
561 case 37:
562 case 11:
563 case 39:
565 break;
566 case 34:
568 break;
569 case 38:
571 break;
572 case 10:
573 case 16: // japaneseLegal
575 break;
576 case 20:
578 break;
579 case 12:
581 break;
582 case 21:
584 break;
585 case 13:
587 break;
588 case 24:
590 break;
591 case 25:
593 break;
594 //case 26: // decimalEnclosedFullstop
595 //case 27: // decimalEnclosedParen
596 //case 40: // decimal (Chinese)
597
598 case 41: // koreanDigital
599 case 42: // koreanCounting
600 case 43: // koreanLegal
602 break;
603 case 44: // koreanDigital2
605 break;
606 case 45: // hebrew1
608 break;
609 case 46: // arabicAlpha
611 break;
612 case 47: // hebrew2
614 break;
615 case 48: // arabicAbjad
617 break;
618 case 49: // hindiVowels
620 break;
621 //case 50: // hindiConsonants
622 //case 51: // hindiNumbers
623 //case 52: // hindiCounting
624
625 case 53: // thaiLetters
627 break;
628 //case 54: // thaiNumbers
629 //case 55: // thaiCounting
630 //case 56: // vietnameseCounting
631 //case 57: // numberInDash
632
633 case 58: // russianLower
635 break;
636 case 59: // russianUpper
638 break;
639 default:
641 break;
642 }
643
644 return nType;
645}
646
647bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, std::unique_ptr<SfxItemSet>& rpItemSet,
648 sal_uInt16 nLevelStyle, bool bSetStartNo, sal_uInt16 /*nLevel*/, ww::bytes &rParaSprms)
649{
650 sal_uInt8 aBits1(0);
652 SvxAdjust eAdj; // Alignment (Left/right/centered)
653 sal_UCS4 cBullet(0x2190); // default safe bullet
654
655 sal_Unicode cGrfBulletCP(USHRT_MAX);
656
657 WW8LVL aLVL = {};
658
659 // 1. read LVLF
660
661 m_rSt.ReadInt32( aLVL.nStartAt );
662 m_rSt.ReadUChar( aLVL.nNFC );
663 m_rSt.ReadUChar( aBits1 );
664 if( ERRCODE_NONE != m_rSt.GetError() ) return false;
665 aLVL.nAlign = (aBits1 & 0x03);
666 if( aBits1 & 0x10 ) aLVL.bV6Prev = true;
667 if( aBits1 & 0x20 ) aLVL.bV6PrSp = true;
668 if( aBits1 & 0x40 ) aLVL.bV6 = true;
669 bool bLVLOkB = true;
670 for(sal_uInt8 nLevelB = 0; nLevelB < nMaxLevel; ++nLevelB)
671 {
672 m_rSt.ReadUChar( aLVL.aOfsNumsXCH[ nLevelB ] );
673 if( ERRCODE_NONE != m_rSt.GetError() )
674 {
675 bLVLOkB = false;
676 break;
677 }
678 }
679
680 if( !bLVLOkB )
681 return false;
682
683 sal_uInt8 ixchFollow(0);
684 m_rSt.ReadUChar( ixchFollow );
685 m_rSt.ReadInt32( aLVL.nV6DxaSpace );
686 m_rSt.ReadInt32( aLVL.nV6Indent );
687 m_rSt.ReadUChar( aLVL.nLenGrpprlChpx );
688 m_rSt.ReadUChar( aLVL.nLenGrpprlPapx );
689 m_rSt.SeekRel( 2 );
690 if( ERRCODE_NONE != m_rSt.GetError()) return false;
691
692 // 2. read PAPx if needed and search for indent values
693
694 short nTabPos = 0; // #i86652# - read tab setting
695 if( aLVL.nLenGrpprlPapx )
696 {
697 sal_uInt8 aGrpprlPapx[ 255 ];
698 if (aLVL.nLenGrpprlPapx != m_rSt.ReadBytes(&aGrpprlPapx, aLVL.nLenGrpprlPapx))
699 return false;
700 // "sprmPDxaLeft" pap.dxaLeft;dxa;word;
701 SprmResult aSprm = GrpprlHasSprm(0x840F,aGrpprlPapx[0],aLVL.nLenGrpprlPapx);
702 if (!aSprm.pSprm)
703 aSprm = GrpprlHasSprm(0x845E,aGrpprlPapx[0],aLVL.nLenGrpprlPapx);
704
705 if (aSprm.pSprm && aSprm.nRemainingData >= 2)
706 {
707 const sal_uInt8 *pBegin = aSprm.pSprm - 2;
708 for(int i=0;i<4;++i)
709 rParaSprms.push_back(*pBegin++);
710 short nDxaLeft = SVBT16ToUInt16(aSprm.pSprm);
711 aLVL.nDxaLeft = (0 < nDxaLeft) ? o3tl::narrowing<sal_uInt16>(nDxaLeft)
712 : o3tl::narrowing<sal_uInt16>(-nDxaLeft);
713 }
714
715 // "sprmPDxaLeft1" pap.dxaLeft1;dxa;word;
716 aSprm = GrpprlHasSprm(0x8411,aGrpprlPapx[0],aLVL.nLenGrpprlPapx);
717 if (!aSprm.pSprm)
718 aSprm = GrpprlHasSprm(0x8460,aGrpprlPapx[0],aLVL.nLenGrpprlPapx);
719
720 if (aSprm.pSprm && aSprm.nRemainingData >= 2)
721 {
722 const sal_uInt8 *pBegin = aSprm.pSprm - 2;
723 for(int i=0;i<4;++i)
724 rParaSprms.push_back(*pBegin++);
725 aLVL.nDxaLeft1 = SVBT16ToUInt16(aSprm.pSprm);
726 }
727
728 // #i86652# - read tab setting
729 aSprm = GrpprlHasSprm(0xC615,aGrpprlPapx[0],aLVL.nLenGrpprlPapx);
730 const sal_uInt8* pSprm = aSprm.pSprm;
731 if (pSprm && aSprm.nRemainingData >= 5)
732 {
733 bool bDone = false;
734 if (*(pSprm-1) == 5)
735 {
736 if (*pSprm++ == 0) //nDel
737 {
738 if (*pSprm++ == 1) //nIns
739 {
740 nTabPos = SVBT16ToUInt16(pSprm);
741 pSprm+=2;
742 if (*pSprm == 6) //type
743 {
744 bDone = true;
745 }
746 }
747 }
748 }
749 OSL_ENSURE(bDone, "tab setting in numbering is "
750 "of unexpected configuration");
751 }
752 if ( rNumFormat.GetPositionAndSpaceMode() ==
754 {
755 // If there is a tab setting with a larger value, then use that.
756 // Ideally we would allow tabs to be used in numbering fields and set
757 // this on the containing paragraph which would make it actually work
758 // most of the time.
759 if ( nTabPos != 0 )
760 {
761 const sal_uInt16 nDesired = aLVL.nDxaLeft + aLVL.nDxaLeft1;
762
763 bool bDoAdjust = false;
764 if ( nDesired < aLVL.nDxaLeft )
765 {
766 if ( nDesired < nTabPos && nTabPos < aLVL.nDxaLeft )
767 {
768 bDoAdjust = true;
769 }
770 }
771 else
772 {
773 if ( aLVL.nDxaLeft < nTabPos && nTabPos < nDesired )
774 {
775 bDoAdjust = true;
776 }
777 }
778
779 if (bDoAdjust)
780 {
781 aLVL.nDxaLeft = (0 < nTabPos)
782 ? o3tl::narrowing<sal_uInt16>(nTabPos)
783 : o3tl::narrowing<sal_uInt16>(-nTabPos);
784
785 aLVL.nDxaLeft1 = nDesired - aLVL.nDxaLeft;
786 }
787 }
788 }
789 }
790
791 // 3. read CHPx if needed
792
793 sal_uInt16 nWitchPicIsBullet = USHRT_MAX;
794 bool bIsPicBullet = false;
795
796 if( aLVL.nLenGrpprlChpx )
797 {
798 sal_uInt8 aGrpprlChpx[ 255 ] = {};
799 if (aLVL.nLenGrpprlChpx != m_rSt.ReadBytes(&aGrpprlChpx, aLVL.nLenGrpprlChpx))
800 return false;
801
802 //For i120928,parse the graphic info of bullets
803 SprmResult aSprmWhichPis = GrpprlHasSprm(NS_sprm::CPbiIBullet::val, aGrpprlChpx[0],aLVL.nLenGrpprlChpx);
804 SprmResult aSprmIsPicBullet = GrpprlHasSprm(NS_sprm::CPbiGrf::val, aGrpprlChpx[0],aLVL.nLenGrpprlChpx);
805 if (aSprmWhichPis.pSprm && aSprmWhichPis.nRemainingData >= 1)
806 {
807 nWitchPicIsBullet = *aSprmWhichPis.pSprm;
808 }
809 if (aSprmIsPicBullet.pSprm && aSprmIsPicBullet.nRemainingData >= 1)
810 {
811 bIsPicBullet = (*aSprmIsPicBullet.pSprm) & 0x0001;
812 }
813
814 // create new Itemset for character attributes
816
817 // Set Reader-ItemSet-Pointer to the newly created set
818 m_rReader.SetCurrentItemSet(std::move(rpItemSet));
819 // Set Reader-Style to Style of this Level
820 sal_uInt16 nOldColl = m_rReader.GetCurrentColl();
821 sal_uInt16 nNewColl = nLevelStyle;
822 if (ww::stiNil == nNewColl)
823 nNewColl = 0;
824 m_rReader.SetNCurrentColl( nNewColl );
825
826 // The Read_xy() methods in WW8PAR6.cxx are calling their respective
827 // NewAttr() or GetFormatAttr() which can determine, by using the assigned
828 // Reader-ItemSet-Pointer, whether this specific ItemSet is relevant
829 // and not a Stack or Style!
830 sal_uInt16 nOldFlags1 = m_rReader.GetToggleAttrFlags();
831 sal_uInt16 nOldFlags2 = m_rReader.GetToggleBiDiAttrFlags();
832
833 WW8SprmIter aSprmIter(&aGrpprlChpx[0], aLVL.nLenGrpprlChpx,
835 while (const sal_uInt8* pSprm = aSprmIter.GetSprms())
836 {
837 m_rReader.ImportSprm(pSprm, aSprmIter.GetRemLen(), aSprmIter.GetCurrentId());
838 aSprmIter.advance();
839 }
840
841 // Reset Reader-ItemSet-Pointer and Reader-Style
842 rpItemSet = m_rReader.SetCurrentItemSet(nullptr);
843 m_rReader.SetNCurrentColl( nOldColl );
844 m_rReader.SetToggleAttrFlags(nOldFlags1);
846 }
847
848 // 4. Read numbering String. Results in prefix and postfix
849
851
852 // 5. convert read values into Writer syntax
853
854 nType = GetSvxNumTypeFromMSONFC(aLVL.nNFC);
855 //For i120928,type info
856 if (bIsPicBullet)
857 {
859 }
860
861 if (style::NumberingType::CHAR_SPECIAL == nType)
862 {
863 cBullet = !sNumString.isEmpty()
864 ? sNumString.iterateCodePoints(&o3tl::temporary(sal_Int32(0))) : 0x2190;
865
866 if (!cBullet) // unsave control code?
867 cBullet = 0x2190;
868 }
869 else if (style::NumberingType::BITMAP == nType) //For i120928,position index info of graphic
870 {
871 cGrfBulletCP = nWitchPicIsBullet; // This is a bullet picture ID
872 }
873
874 switch( aLVL.nAlign )
875 {
876 case 0:
877 eAdj = SvxAdjust::Left;
878 break;
879 case 1:
880 eAdj = SvxAdjust::Center;
881 break;
882 case 2:
883 eAdj = SvxAdjust::Right;
884 break;
885 case 3:
886 // Writer here cannot do block justification
887 eAdj = SvxAdjust::Left;
888 break;
889 default:
890 // undefined value
891 OSL_ENSURE( false, "Value of aLVL.nAlign is not supported" );
892 // take default
893 eAdj = SvxAdjust::Left;
894 break;
895 }
896
897 // 6. Configure NumFormat
898 if( bSetStartNo && 0 <= aLVL.nStartAt)
899 rNumFormat.SetStart(o3tl::narrowing<sal_uInt16>(aLVL.nStartAt));
900 rNumFormat.SetNumberingType( nType );
901 rNumFormat.SetNumAdjust( eAdj );
902
903 if( style::NumberingType::CHAR_SPECIAL == nType )
904 {
905 // first character of the Prefix-Text is the Bullet
906 rNumFormat.SetBulletChar(cBullet);
907 // Don't forget: further below, after building styles
908 // Call SetBulletFont() !!!
909 }
910 //For i120928,position index info
911 else if (style::NumberingType::BITMAP == nType)
912 {
913 rNumFormat.SetGrfBulletCP(cGrfBulletCP);
914 }
915 else
916 {
917 // Replace symbols at aOfsNumsXCH offsets to %1%, %2% as supported by LO
918 OUString sListFormat = sNumString;
919 if (sListFormat.getLength())
920 {
921 sal_uInt32 nExtraOffset = 0;
922 sal_uInt8 nLevelB = 0;
923 while (nLevelB < nMaxLevel && aLVL.aOfsNumsXCH[nLevelB])
924 {
925 // Replacement symbol is read from source string from position taken from aOfsNumsXCH array
926 sal_uInt8 nOffset = aLVL.aOfsNumsXCH[nLevelB] + nExtraOffset - 1;
927 if (nOffset >= sListFormat.getLength())
928 {
929 SAL_WARN("sw.ww8", "List level reference is beyond the border. Ignored.");
930 nLevelB++;
931 continue;
932 }
933 sal_uInt8 nReplacement = sListFormat[nOffset] + 1;
934
935 OUString sReplacement("%" + OUString::number(nReplacement) + "%");
936 sListFormat = sListFormat.replaceAt(nOffset, 1, sReplacement);
937
938 // We need also update an offset, since we are replacing one symbol by at least two
939 nExtraOffset += sReplacement.getLength() - 1;
940 nLevelB++;
941 }
942 }
943
944 rNumFormat.SetListFormat(sListFormat);
945
946 // Total count of replacement holders is determining amount of required parent numbering to include
947 // TODO: not sure how "%" symbol is escaped. This is not supported yet
948 sal_Int16 nParentNum = comphelper::string::getTokenCount(sListFormat, '%');
949 rNumFormat.SetIncludeUpperLevels(nParentNum);
950 }
951
952 // #i89181#
953 if ( rNumFormat.GetPositionAndSpaceMode() ==
955 {
956 if (eAdj == SvxAdjust::Right)
957 {
958 rNumFormat.SetAbsLSpace(aLVL.nDxaLeft);
959 rNumFormat.SetFirstLineOffset(-aLVL.nDxaLeft);
960 rNumFormat.SetCharTextDistance(-aLVL.nDxaLeft1);
961 }
962 else
963 {
964 rNumFormat.SetAbsLSpace( aLVL.nDxaLeft );
965 rNumFormat.SetFirstLineOffset(aLVL.nDxaLeft1);
966 }
967 }
968 else
969 {
970 rNumFormat.SetIndentAt( aLVL.nDxaLeft );
971 rNumFormat.SetFirstLineIndent(aLVL.nDxaLeft1);
972 if ( !aLVL.bV6 )
973 rNumFormat.SetListtabPos( nTabPos );
974 else
975 rNumFormat.SetListtabPos( aLVL.nV6Indent );
977 switch ( ixchFollow )
978 {
979 case 0:
980 {
981 eNumLabelFollowedBy = SvxNumberFormat::LISTTAB;
982 }
983 break;
984 case 1:
985 {
986 eNumLabelFollowedBy = SvxNumberFormat::SPACE;
987 }
988 break;
989 case 2:
990 {
991 eNumLabelFollowedBy = SvxNumberFormat::NOTHING;
992 }
993 break;
994 }
995 rNumFormat.SetLabelFollowedBy( eNumLabelFollowedBy );
996 }
997
998 return true;
999}
1000
1002 WW8aISet const & rListItemSet, WW8aCFormat& rCharFormat, bool& bNewCharFormatCreated,
1003 const OUString& sPrefix )
1004{
1005 bNewCharFormatCreated = false;
1006 sal_uInt8 nIdenticalItemSetLevel;
1007 const SfxPoolItem* pItem;
1008
1009 SwNumFormat aNumFormat = rNumRule.Get( nLevel );
1010
1011 SfxItemSet* pThisLevelItemSet = rListItemSet[nLevel].get();
1012
1013 if( pThisLevelItemSet && pThisLevelItemSet->Count())
1014 {
1015 nIdenticalItemSetLevel = nMaxLevel;
1016 SfxItemIter aIter( *pThisLevelItemSet );
1017 for (sal_uInt8 nLowerLevel = 0; nLowerLevel < nLevel; ++nLowerLevel)
1018 {
1019 SfxItemSet* pLowerLevelItemSet = rListItemSet[nLowerLevel].get();
1020 if( pLowerLevelItemSet
1021 && (pLowerLevelItemSet->Count() == pThisLevelItemSet->Count()) )
1022 {
1023 nIdenticalItemSetLevel = nLowerLevel;
1024 const SfxPoolItem* pItemIter = aIter.GetCurItem();
1025 do
1026 {
1027 if( // search for appropriate pItem in pLowerLevelItemSet
1028 (SfxItemState::SET != pLowerLevelItemSet->GetItemState(
1029 pItemIter->Which(), false, &pItem ) )
1030 || // use virtual "!=" Operator
1031 (*pItem != *pItemIter) )
1032 // if no Item with equal nWhich was found or Item value was not equal
1033 // store inequality and break!
1034 {
1035 nIdenticalItemSetLevel = nMaxLevel;
1036 break;
1037 }
1038 pItemIter = aIter.NextItem();
1039 } while (pItemIter);
1040
1041 if( nIdenticalItemSetLevel != nMaxLevel )
1042 break;
1043 }
1044 }
1045
1046 SwCharFormat* pFormat;
1047 if (nMaxLevel == nIdenticalItemSetLevel)
1048 {
1049 // Define Style
1050 const OUString aName( (!sPrefix.isEmpty() ? sPrefix : rNumRule.GetName())
1051 + "z" + OUString::number( nLevel ) );
1052
1053 // remove const by casting
1055 bNewCharFormatCreated = true;
1056 // Set Attributes
1057 pFormat->SetFormatAttr( *pThisLevelItemSet );
1058 }
1059 else
1060 {
1061 // append Style
1062 pFormat = rCharFormat[ nIdenticalItemSetLevel ];
1063 }
1064
1065 // store
1066 rCharFormat[ nLevel ] = pFormat;
1067
1068 // Append Style to NumFormat
1069
1070 aNumFormat.SetCharFormat( pFormat );
1071 }
1072
1073 // if necessary: Append Bullet Font to NumFormat
1074
1075 if( SVX_NUM_CHAR_SPECIAL == aNumFormat.GetNumberingType() )
1076 {
1077 SwCharFormat* pFormat = aNumFormat.GetCharFormat();
1078 vcl::Font aFont;
1079 if( !pFormat )
1080 {
1081 aFont = numfunc::GetDefBulletFont();
1082 }
1083 else
1084 {
1085 const SvxFontItem& rFontItem = pFormat->GetFont();
1086 aFont.SetFamily( rFontItem.GetFamily() );
1087 aFont.SetFamilyName( rFontItem.GetFamilyName() );
1088 aFont.SetStyleName( rFontItem.GetStyleName() );
1089 aFont.SetPitch( rFontItem.GetPitch() );
1090 aFont.SetCharSet( rFontItem.GetCharSet() );
1091 }
1092 aNumFormat.SetBulletFont( &aFont );
1093 }
1094
1095 // Set NumFormat in NumRule
1096
1097 rNumRule.Set(nLevel, aNumFormat);
1098}
1099
1101{
1102 // Used to build the Style Name
1103 const OUString sPrefix("WW8Num" + OUString::number(m_nUniqueList++));
1104 // #i86652#
1105 sal_uInt16 nRul =
1108 SwNumRule* pMyNumRule = m_rDoc.GetNumRuleTable()[nRul];
1109 pMyNumRule->SetAutoRule(false);
1110 pMyNumRule->SetContinusNum(bSimple);
1111 return pMyNumRule;
1112}
1113
1115{
1116 if (i < maLSTInfos.size())
1117 return maLSTInfos[i]->pNumRule;
1118 else
1119 return nullptr;
1120}
1121
1122// public methods
1123
1125 : maSprmParser(rReader_.GetFib()), m_rReader(rReader_)
1126 , m_rDoc(m_rReader.GetDoc())
1127 , m_rFib(m_rReader.GetFib()), m_rSt(rSt_)
1128 , m_nUniqueList(1)
1129 , m_nLastLFOPosition(USHRT_MAX)
1130{
1131
1132 // LST and LFO only since WW8
1133 if( ( 8 > m_rFib.m_nVersion )
1135 || ( m_rFib.m_lcbPlcfLst < 2 )
1136 || ( m_rFib.m_lcbPlfLfo < 2) ) return; // no public lists
1137
1138 // create Arrays
1139 bool bLVLOk = true;
1140
1141 sal_uInt64 nOriginalPos = m_rSt.Tell();
1142
1143 // 1. read PLCF LST and create list templates in Writer
1144
1145 bool bOk = checkSeek(m_rSt, m_rFib.m_fcPlcfLst);
1146
1147 if (!bOk)
1148 return;
1149
1150 sal_uInt32 nRemainingPlcfLst = m_rFib.m_lcbPlcfLst;
1151
1152 sal_uInt16 nListCount(0);
1153 m_rSt.ReadUInt16( nListCount );
1154 nRemainingPlcfLst -= 2;
1155 bOk = nListCount > 0;
1156
1157 if (!bOk)
1158 return;
1159
1160 // 1.1 read all LST
1161 const size_t nMinRecordSize = 10 + 2*nMaxLevel;
1162 const size_t nMaxRecords = m_rSt.remainingSize() / nMinRecordSize;
1163 if (nListCount > nMaxRecords)
1164 {
1165 SAL_WARN("sw.ww8", "Parsing error: " << nMaxRecords <<
1166 " max possible entries, but " << nListCount << " claimed, truncating");
1167 nListCount = nMaxRecords;
1168 }
1169 for (sal_uInt16 nList=0; nList < nListCount; ++nList)
1170 {
1171 if (nRemainingPlcfLst < cbLSTF)
1172 break;
1173
1174 WW8LST aLST = {};
1175
1176 // 1.1.1 read Data
1177
1178 m_rSt.ReadUInt32( aLST.nIdLst );
1179 m_rSt.ReadUInt32( aLST.nTplC );
1180 for (sal_uInt16 & nLevel : aLST.aIdSty)
1181 m_rSt.ReadUInt16( nLevel );
1182
1183 sal_uInt8 aBits1(0);
1184 m_rSt.ReadUChar( aBits1 );
1185
1186 m_rSt.SeekRel( 1 );
1187
1188 if( aBits1 & 0x01 )
1189 aLST.bSimpleList = true;
1190 if( aBits1 & 0x02 )
1191 aLST.bRestartHdn = true;
1192
1193 // 1.1.2 new NumRule inserted in Doc and WW8LSTInfo marked
1194
1195 /*
1196 #i1869#
1197 In word 2000 microsoft got rid of creating new "simple lists" with
1198 only 1 level, all new lists are created with 9 levels. To hack it
1199 so that the list types formerly known as simple lists still have
1200 their own tab page to themselves one of the reserved bits is used
1201 to show that a given list is to be in the simple list tabpage.
1202 This has now nothing to do with the actual number of list level a
1203 list has, only how many will be shown in the user interface.
1204
1205 i.e. create a simple list in 2000 and open it in 97 and 97 will
1206 claim (correctly) that it is an outline list. We can set our
1207 continuous flag in these lists to store this information.
1208 */
1209 SwNumRule* pMyNumRule = CreateNextRule(
1210 aLST.bSimpleList || (aBits1 & 0x10));
1211
1212 WW8LSTInfo* pLSTInfo = new WW8LSTInfo(pMyNumRule, aLST);
1213 maLSTInfos.emplace_back(pLSTInfo);
1214
1215 nRemainingPlcfLst -= cbLSTF;
1216 }
1217
1218 // 1.2 read all LVL of all aLST
1219
1220 sal_uInt16 nLSTInfos = static_cast< sal_uInt16 >(maLSTInfos.size());
1221 for (sal_uInt16 nList = 0; nList < nLSTInfos; ++nList)
1222 {
1223 WW8aISet aItemSet; // Character attributes from GrpprlChpx
1224
1225 WW8LSTInfo* pListInfo = maLSTInfos[nList].get();
1226 if( !pListInfo || !pListInfo->pNumRule ) break;
1227 SwNumRule& rMyNumRule = *pListInfo->pNumRule;
1228
1229 // 1.2.1 read specific LVL(s) for this aLST
1230
1231 sal_uInt16 nLvlCount = static_cast< sal_uInt16 >(pListInfo->bSimpleList ? nMinLevel : nMaxLevel);
1232 pListInfo->maParaSprms.resize(nMaxLevel);
1233 for (sal_uInt16 nLevel = 0; nLevel < nLvlCount; ++nLevel)
1234 {
1235 SwNumFormat aNumFormat( rMyNumRule.Get( nLevel ) );
1236 // read LVLF
1237 bLVLOk = ReadLVL( aNumFormat, aItemSet[nLevel],
1238 pListInfo->aIdSty[nLevel], true, nLevel,
1239 pListInfo->maParaSprms[nLevel]);
1240 if( !bLVLOk )
1241 break;
1242 // and set in rMyNumRule
1243 rMyNumRule.Set( nLevel, aNumFormat );
1244 }
1245 if( !bLVLOk )
1246 break;
1247
1248 // 1.2.2 compare ItemPools and CHPx Settings of different Levels
1249 // and create Style(s) if necessary
1250
1251 for (sal_uInt16 nLevel = 0; nLevel < nLvlCount; ++nLevel)
1252 {
1253 bool bDummy;
1254 AdjustLVL( nLevel, rMyNumRule, aItemSet,
1255 pListInfo->aCharFormat, bDummy );
1256 }
1257 }
1258
1259 // 2. read and save PLF LFO
1260
1262
1263 if (!bOk)
1264 return;
1265
1266 sal_Int32 nLfoCount(0);
1267 m_rSt.ReadInt32( nLfoCount );
1268 bOk = nLfoCount > 0;
1269
1270 if (!bOk)
1271 return;
1272
1273 // 2.1 read all LFO
1274
1275 for (sal_Int32 nLfo = 0; nLfo < nLfoCount; ++nLfo)
1276 {
1277 bOk = false;
1278
1279 WW8LFO aLFO = {};
1280
1281 m_rSt.ReadUInt32( aLFO.nIdLst );
1282 m_rSt.SeekRel( 8 );
1283 m_rSt.ReadUChar( aLFO.nLfoLvl );
1284 if (!m_rSt.good())
1285 break;
1286 m_rSt.SeekRel( 3 );
1287 // as many Overrides as there are
1288 if ((nMaxLevel < aLFO.nLfoLvl) || m_rSt.GetError())
1289 break;
1290
1291 // get the Parent NumRule of the current List
1292 WW8LSTInfo* pParentListInfo = GetLSTByListId(aLFO.nIdLst);
1293 if (pParentListInfo)
1294 {
1295 // Save the NumRule in this first step
1296 aLFO.pNumRule = pParentListInfo->pNumRule;
1297
1298 // are there multiple Levels in the List?
1299 aLFO.bSimpleList = pParentListInfo->bSimpleList;
1300 }
1301 // store in Array
1302 std::unique_ptr<WW8LFOInfo> pLFOInfo(new WW8LFOInfo(aLFO));
1303 if (pParentListInfo)
1304 {
1305 //Copy the basic paragraph properties for each level from the
1306 //original list into the list format override levels.
1307 int nMaxSize = pParentListInfo->maParaSprms.size();
1308 pLFOInfo->maParaSprms.resize(nMaxSize);
1309 for (int i = 0; i < nMaxSize; ++i)
1310 pLFOInfo->maParaSprms[i] = pParentListInfo->maParaSprms[i];
1311 }
1312 m_LFOInfos.push_back(std::move(pLFOInfo));
1313 bOk = true;
1314 }
1315
1316 if( bOk )
1317 {
1318
1319 // 2.2 read specific LFOLVL for all LFO
1320
1321 size_t nLFOInfos = m_LFOInfos.size();
1322 for (size_t nLfo = 0; nLfo < nLFOInfos; ++nLfo)
1323 {
1324 WW8LFOInfo& rLFOInfo = *m_LFOInfos[nLfo];
1325 // Do LFOLVL exist?
1326 if( rLFOInfo.bOverride )
1327 {
1328 WW8LSTInfo* pParentListInfo = GetLSTByListId(rLFOInfo.nIdLst);
1329 if (!pParentListInfo)
1330 break;
1331
1332 // 2.2.1 create new NumRule for this List
1333
1334 SwNumRule* pParentNumRule = rLFOInfo.pNumRule;
1335 OSL_ENSURE(pParentNumRule, "ww: Impossible lists, please report");
1336 if( !pParentNumRule )
1337 break;
1338 // create name-prefix for NumRule-Name
1339 // and (if necessary) for Style-Name
1340 const OUString sPrefix("WW8NumSt" + OUString::number( nLfo + 1 ));
1341 // Now assign pNumRule its actual value!!!
1342 // (it contained the parent NumRule up to this point)
1343
1344 // check if a Style is referencing this LFO
1345 if( USHRT_MAX > m_rReader.StyleUsingLFO( nLfo ) )
1346 {
1347 sal_uInt16 nRul = m_rDoc.MakeNumRule(
1348 m_rDoc.GetUniqueNumRuleName( &sPrefix ), pParentNumRule);
1349 rLFOInfo.pNumRule = m_rDoc.GetNumRuleTable()[ nRul ];
1350 rLFOInfo.pNumRule->SetAutoRule(false);
1351 }
1352 else
1353 {
1354 sal_uInt16 nRul = m_rDoc.MakeNumRule(
1355 m_rDoc.GetUniqueNumRuleName(), pParentNumRule);
1356 rLFOInfo.pNumRule = m_rDoc.GetNumRuleTable()[ nRul ];
1357 rLFOInfo.pNumRule->SetAutoRule(true); // = default
1358 }
1359
1360 // 2.2.2 read all LFOLVL (and LVL) for the new NumRule
1361
1362 WW8aISet aItemSet; // Character attributes from GrpprlChpx
1363 WW8aCFormat aCharFormat = {}; // Character Style Pointer
1364
1365 //2.2.2.0 skip inter-group of override header ?
1366 //See #i25438# for why I moved this here, compare
1367 //that original bugdoc's binary to what it looks like
1368 //when resaved with word, i.e. there is always a
1369 //4 byte header, there might be more than one if
1370 //that header was 0xFFFFFFFF, e.g. #114412# ?
1371 sal_uInt32 nTest;
1372 m_rSt.ReadUInt32( nTest );
1373 do
1374 {
1375 nTest = 0;
1376 m_rSt.ReadUInt32( nTest );
1377 }
1378 while (nTest == 0xFFFFFFFF);
1379 m_rSt.SeekRel(-4);
1380
1381 for (sal_uInt8 nLevel = 0; nLevel < rLFOInfo.nLfoLvl; ++nLevel)
1382 {
1383 WW8LFOLVL aLFOLVL;
1384 bLVLOk = false;
1385
1386 // 2.2.2.1 read LFOLVL
1387
1388 m_rSt.ReadInt32( aLFOLVL.nStartAt );
1389 sal_uInt8 aBits1(0);
1390 m_rSt.ReadUChar( aBits1 );
1391 m_rSt.SeekRel( 3 );
1392 if (m_rSt.GetError())
1393 break;
1394
1395 // Note: MS writes the Override-Level-Number into 4 bit.
1396 // We do not! (See comment at "struct WW8LFOInfo")
1397 aLFOLVL.nLevel = aBits1 & 0x0F;
1398 if( (0xFF > aBits1) &&
1399 (nMaxLevel > aLFOLVL.nLevel) )
1400 {
1401 if (aBits1 & 0x10)
1402 aLFOLVL.bStartAt = true;
1403 else
1404 aLFOLVL.bStartAt = false;
1405
1406 // 2.2.2.2 load dedicated LVL if necessary
1407
1408 SwNumFormat aNumFormat(
1409 rLFOInfo.pNumRule->Get(aLFOLVL.nLevel));
1410 if (aBits1 & 0x20)
1411 {
1412 aLFOLVL.bFormat = true;
1413 // if bStartup is true, replace Startup-Level
1414 // with the LVLF that is saved in the LVL
1415 bLVLOk = nLevel < rLFOInfo.maParaSprms.size() &&
1416 ReadLVL(aNumFormat, aItemSet[nLevel],
1417 pParentListInfo->aIdSty[nLevel],
1418 aLFOLVL.bStartAt, nLevel,
1419 rLFOInfo.maParaSprms[nLevel]);
1420
1421 if (!bLVLOk)
1422 break;
1423 }
1424 else if (aLFOLVL.bStartAt)
1425 {
1426 aNumFormat.SetStart(
1427 writer_cast<sal_uInt16>(aLFOLVL.nStartAt));
1428 }
1429
1430 // 2.2.2.3 Set NumFormat in NumRule
1431
1432 rLFOInfo.pNumRule->Set(aLFOLVL.nLevel, aNumFormat);
1433 }
1434 bLVLOk = true;
1435
1436 if (nMaxLevel > aLFOLVL.nLevel)
1437 rLFOInfo.maOverrides[aLFOLVL.nLevel] = aLFOLVL;
1438 }
1439 if( !bLVLOk )
1440 break;
1441
1442 // 2.2.3 adjust LVL of the new NumRule
1443
1444 bool bNewCharFormatCreated = false;
1445 for (sal_uInt8 nLevel = 0; nLevel < rLFOInfo.nLfoLvl; ++nLevel)
1446 {
1447 AdjustLVL( nLevel, *rLFOInfo.pNumRule, aItemSet, aCharFormat,
1448 bNewCharFormatCreated, sPrefix );
1449 }
1450 }
1451 }
1452 }
1453 // and we're done!
1454 m_rSt.Seek( nOriginalPos );
1455}
1456
1458{
1459 /*
1460 named lists remain in document
1461 unused automatic lists are removed from document (DelNumRule)
1462 */
1463 for(auto & rpInfo : maLSTInfos)
1464 {
1465 if (rpInfo->pNumRule && !rpInfo->bUsedInDoc &&
1466 rpInfo->pNumRule->IsAutoRule())
1467 {
1468 m_rDoc.DelNumRule(rpInfo->pNumRule->GetName());
1469 }
1470 rpInfo.reset();
1471 }
1472 for (auto aIter = m_LFOInfos.rbegin(); aIter != m_LFOInfos.rend(); ++aIter)
1473 {
1474 if ((*aIter)->bOverride
1475 && (*aIter)->pNumRule
1476 && !(*aIter)->bUsedInDoc
1477 && (*aIter)->pNumRule->IsAutoRule())
1478 {
1479 m_rDoc.DelNumRule( (*aIter)->pNumRule->GetName() );
1480 }
1481 }
1482}
1483
1485{
1487}
1488
1489static bool IsEqualFormatting(const SwNumRule &rOne, const SwNumRule &rTwo)
1490{
1491 bool bRet =
1492 (
1493 rOne.GetRuleType() == rTwo.GetRuleType() &&
1494 rOne.IsContinusNum() == rTwo.IsContinusNum() &&
1495 rOne.IsAbsSpaces() == rTwo.IsAbsSpaces() &&
1496 rOne.GetPoolFormatId() == rTwo.GetPoolFormatId() &&
1497 rOne.GetPoolHelpId() == rTwo.GetPoolHelpId() &&
1498 rOne.GetPoolHlpFileId() == rTwo.GetPoolHlpFileId()
1499 );
1500
1501 if (bRet)
1502 {
1503 for (sal_uInt8 n = 0; n < MAXLEVEL; ++n )
1504 {
1505 //The SvxNumberFormat compare, not the SwNumFormat compare
1506 const SvxNumberFormat &rO = rOne.Get(n);
1507 const SvxNumberFormat &rT = rTwo.Get(n);
1508 if (rO != rT)
1509 {
1510 bRet = false;
1511 break;
1512 }
1513 }
1514 }
1515 return bRet;
1516}
1517
1519 const sal_uInt8 nLevel, std::vector<sal_uInt8> &rParaSprms, SwTextNode *pNode)
1520{
1521 if (m_LFOInfos.size() <= nLFOPosition)
1522 return nullptr;
1523
1524 WW8LFOInfo& rLFOInfo = *m_LFOInfos[nLFOPosition];
1525
1526 bool bFirstUse = !rLFOInfo.bUsedInDoc;
1527 rLFOInfo.bUsedInDoc = true;
1528
1529 if( !rLFOInfo.pNumRule )
1530 return nullptr;
1531
1532 // #i25545#
1533 // #i100132# - a number format does not have to exist on given list level
1534 SwNumFormat aFormat(rLFOInfo.pNumRule->Get(nLevel));
1535
1536 if (m_rReader.IsRightToLeft() && m_nLastLFOPosition != nLFOPosition) {
1537 if ( aFormat.GetNumAdjust() == SvxAdjust::Right)
1538 aFormat.SetNumAdjust(SvxAdjust::Left);
1539 else if ( aFormat.GetNumAdjust() == SvxAdjust::Left)
1540 aFormat.SetNumAdjust(SvxAdjust::Right);
1541 rLFOInfo.pNumRule->Set(nLevel, aFormat);
1542 }
1543 m_nLastLFOPosition = nLFOPosition;
1544 /*
1545 #i1869#
1546 If this list has had its bits set in word 2000 to pretend that it is a
1547 simple list from the point of view of the user, then it is almost
1548 certainly a simple continuous list, and we will try to keep it like that.
1549 Otherwise when we save again it will be shown as the true outline list
1550 that it is, confusing the user that just wanted what they thought was a
1551 simple list. On the other hand it is possible that some of the other levels
1552 were used by the user, in which case we will not pretend anymore that it
1553 is a simple list. Something that word 2000 does anyway, that 97 didn't, to
1554 my bewilderment.
1555 */
1556 if (nLevel && rLFOInfo.pNumRule->IsContinusNum())
1557 rLFOInfo.pNumRule->SetContinusNum(false);
1558
1559 if( (!rLFOInfo.bOverride) && (!rLFOInfo.bLSTbUIDSet) )
1560 {
1561 WW8LSTInfo* pParentListInfo = GetLSTByListId( rLFOInfo.nIdLst );
1562 if( pParentListInfo )
1563 pParentListInfo->bUsedInDoc = true;
1564 rLFOInfo.bLSTbUIDSet = true;
1565 }
1566
1567 if (rLFOInfo.maParaSprms.size() > nLevel)
1568 rParaSprms = rLFOInfo.maParaSprms[nLevel];
1569
1570 SwNumRule *pRet = rLFOInfo.pNumRule;
1571
1572 bool bRestart(false);
1573 sal_uInt16 nStart(0);
1574 bool bNewstart(false);
1575 /*
1576 Note: If you fiddle with this then you have to make sure that #i18322#
1577 #i13833#, #i20095# and #112466# continue to work
1578
1579 Check if there were overrides for this level
1580 */
1581 if (rLFOInfo.bOverride && nLevel < rLFOInfo.nLfoLvl)
1582 {
1583 WW8LSTInfo* pParentListInfo = GetLSTByListId(rLFOInfo.nIdLst);
1584 OSL_ENSURE(pParentListInfo, "ww: Impossible lists, please report");
1585 if (pParentListInfo && pParentListInfo->pNumRule)
1586 {
1587 const WW8LFOLVL &rOverride = rLFOInfo.maOverrides[nLevel];
1588 bool bNoChangeFromParent =
1589 IsEqualFormatting(*pRet, *(pParentListInfo->pNumRule));
1590
1591 //If so then I think word still uses the parent (maybe)
1592 if (bNoChangeFromParent)
1593 {
1594 pRet = pParentListInfo->pNumRule;
1595
1596 //did it not affect start at value ?
1597 if (bFirstUse && rOverride.bStartAt)
1598 {
1599 const SwNumFormat &rFormat =
1600 pParentListInfo->pNumRule->Get(nLevel);
1601 if (
1602 rFormat.GetStart() ==
1603 rLFOInfo.maOverrides[nLevel].nStartAt
1604 )
1605 {
1606 bRestart = true;
1607 }
1608 else
1609 {
1610 bNewstart = true;
1611 nStart = writer_cast<sal_uInt16>
1612 (rLFOInfo.maOverrides[nLevel].nStartAt);
1613 }
1614 }
1615
1616 pParentListInfo->bUsedInDoc = true;
1617 }
1618 }
1619 }
1620
1621 if (pNode)
1622 {
1623 pNode->SetAttrListLevel(nLevel);
1624
1625 if (bRestart || bNewstart)
1626 pNode->SetListRestart(true);
1627 if (bNewstart)
1628 pNode->SetAttrListRestartValue(nStart);
1629 }
1630 return pRet;
1631}
1632
1633// SwWW8ImplReader: append a List to a Style or Paragraph
1634
1636 SwWW8StyInf& rStyleInfo)
1637{
1638 bool bRes = true;
1639 if( rStyleInfo.m_pFormat && rStyleInfo.m_bColl )
1640 {
1641 bRes = m_rDoc.SetTextFormatColl(rRg, static_cast<SwTextFormatColl*>(rStyleInfo.m_pFormat));
1642 SwTextNode* pTextNode = m_pPaM->GetPointNode().GetTextNode();
1643 OSL_ENSURE( pTextNode, "No Text-Node at PaM-Position" );
1644 if ( !pTextNode )
1645 {
1646 // make code robust
1647 return bRes;
1648 }
1649
1650 const SwNumRule * pNumRule = pTextNode->GetNumRule(); // #i27610#
1651
1653 ! (pNumRule && pNumRule->IsOutlineRule()) ) // #i27610#
1654 {
1655 pTextNode->ResetAttr( RES_PARATR_NUMRULE );
1656 }
1657
1658 if (USHRT_MAX > rStyleInfo.m_nLFOIndex && WW8ListManager::nMaxLevel
1659 > rStyleInfo.m_nListLevel)
1660 {
1661 const bool bApplyListStyle = false;
1663 bApplyListStyle);
1664 }
1665 }
1666 return bRes;
1667}
1668
1669void UseListIndent(SwWW8StyInf &rStyle, const SwNumFormat &rFormat)
1670{
1671 // #i86652#
1673 {
1674 const auto nAbsLSpace = rFormat.GetAbsLSpace();
1675 const tools::Long nListFirstLineIndent = GetListFirstLineIndent(rFormat);
1677 aLR.SetTextLeft(nAbsLSpace);
1678 aLR.SetTextFirstLineOffset(writer_cast<short>(nListFirstLineIndent));
1679 rStyle.m_pFormat->SetFormatAttr(aLR);
1680 rStyle.m_bListRelevantIndentSet = true;
1681 }
1682}
1683
1684void SetStyleIndent(SwWW8StyInf &rStyle, const SwNumFormat &rFormat)
1685{
1687 return;
1688
1690 if (rStyle.m_bListRelevantIndentSet)
1691 {
1692
1693 SyncIndentWithList( aLR, rFormat, false, false ); // #i103711#, #i105414#
1694 }
1695 else
1696 {
1697 aLR.SetTextLeft(0);
1699 }
1700 rStyle.m_pFormat->SetFormatAttr(aLR);
1701}
1702
1703void SwWW8ImplReader::SetStylesList(sal_uInt16 nStyle, sal_uInt16 nCurrentLFO,
1704 sal_uInt8 nCurrentLevel)
1705{
1706 if (nStyle >= m_vColl.size())
1707 return;
1708
1709 SwWW8StyInf &rStyleInf = m_vColl[nStyle];
1710 if (!rStyleInf.m_bValid)
1711 return;
1712
1713 OSL_ENSURE(m_pCurrentColl, "Cannot be called outside of style import");
1714 // Phase 1: Numbering attributes when reading a StyleDef
1715 if( !m_pCurrentColl )
1716 return;
1717
1718 if (nCurrentLFO < USHRT_MAX)
1719 rStyleInf.m_nLFOIndex = nCurrentLFO;
1720 if (nCurrentLevel < MAXLEVEL)
1721 rStyleInf.m_nListLevel = nCurrentLevel;
1722
1723 // only save the Parameters for now. The actual List will be appended
1724 // at a later point, when the Listdefinitions is read...
1725 if (rStyleInf.m_nLFOIndex < USHRT_MAX && rStyleInf.m_nListLevel < WW8ListManager::nMaxLevel)
1726 {
1727 std::vector<sal_uInt8> aParaSprms;
1728 SwNumRule* pNmRule = m_xLstManager->GetNumRuleForActivation(
1729 rStyleInf.m_nLFOIndex, rStyleInf.m_nListLevel, aParaSprms);
1730 if (pNmRule)
1731 UseListIndent(rStyleInf, pNmRule->Get(rStyleInf.m_nListLevel));
1732 }
1733}
1734
1736{
1737
1738 if (nStyle >= m_vColl.size())
1739 return;
1740
1741 SwWW8StyInf &rStyleInf = m_vColl[nStyle];
1742 if (!(rStyleInf.m_bValid && rStyleInf.m_pFormat))
1743 return;
1744
1745 //Save old pre-list modified indent, which are the word indent values
1746 rStyleInf.maWordLR.reset(rStyleInf.m_pFormat->GetFormatAttr(RES_LR_SPACE).Clone());
1747
1748 // Phase 2: refresh StyleDef after reading all Lists
1749 if (rStyleInf.m_nLFOIndex >= USHRT_MAX || rStyleInf.m_nListLevel >= WW8ListManager::nMaxLevel)
1750 return;
1751
1752 std::vector<sal_uInt8> aParaSprms;
1753 SwNumRule* pNmRule = m_xLstManager->GetNumRuleForActivation(
1754 rStyleInf.m_nLFOIndex, rStyleInf.m_nListLevel, aParaSprms);
1755
1756 if (pNmRule != nullptr)
1757 {
1758 if (rStyleInf.IsWW8BuiltInHeadingStyle()
1759 && rStyleInf.HasWW8OutlineLevel())
1760 {
1761 rStyleInf.m_pOutlineNumrule = pNmRule;
1762 }
1763 else
1764 {
1765 rStyleInf.m_pFormat->SetFormatAttr(
1766 SwNumRuleItem(pNmRule->GetName()));
1767 rStyleInf.m_bHasStyNumRule = true;
1768 }
1769
1770 SetStyleIndent(rStyleInf, pNmRule->Get(rStyleInf.m_nListLevel));
1771 }
1772}
1773
1775 sal_uInt8 nCurrentLevel,
1776 const bool bSetAttr)
1777{
1778 // Note: the method appends NumRule to the Text Node if
1779 // bSetAttr (of course the lists have to be read before)
1780 // and only sets the Level. It does not check if there is a NumRule
1781 // attached to the STYLE !!!
1782
1783 if (!m_xLstManager) // are all list declarations read?
1784 return;
1785
1786 SwTextNode* pTextNd = m_pPaM->GetPointNode().GetTextNode();
1787 OSL_ENSURE(pTextNd, "No Text-Node at PaM-Position");
1788 if (!pTextNd)
1789 return;
1790
1791 // WW8ListManager::nMaxLevel indicates body text, cancelling an inherited numbering.
1792 if (nCurrentLFO < USHRT_MAX && nCurrentLevel == WW8ListManager::nMaxLevel)
1793 {
1794 pTextNd->SetAttr(SwNumRuleItem(OUString()));
1795 return;
1796 }
1797
1798 // Undefined listLevel is treated as the first level with valid numbering rule.
1799 // TODO:This doesn't allow for inheriting from a style(HOW?), but it matches previous behaviour.
1800 if (nCurrentLFO < USHRT_MAX && nCurrentLevel == MAXLEVEL)
1801 nCurrentLevel = 0;
1802
1803 std::vector<sal_uInt8> aParaSprms;
1804 const SwNumRule* pRule = bSetAttr ?
1805 m_xLstManager->GetNumRuleForActivation( nCurrentLFO, nCurrentLevel,
1806 aParaSprms, pTextNd) : nullptr;
1807
1808 if (pRule == nullptr && bSetAttr)
1809 return;
1810
1811 if (bSetAttr && pTextNd->GetNumRule() != pRule
1812 && (pTextNd->GetNumRule() != m_rDoc.GetOutlineNumRule()
1813 || pRule != m_pChosenWW8OutlineStyle))
1814 {
1815 // Now this is either not a part of Chapter Numbering,
1816 // or else it is using a different numRule than the one copied to Chapter Numbering.
1818 : pRule->GetName();
1819 pTextNd->SetAttr(SwNumRuleItem(sName));
1820 }
1821 pTextNd->SetAttrListLevel(nCurrentLevel);
1822
1823 // <IsCounted()> state of text node has to be adjusted accordingly.
1824 if ( /*nCurrentLevel >= 0 &&*/ nCurrentLevel < MAXLEVEL )
1825 {
1826 pTextNd->SetCountedInList( true );
1827 }
1828
1829 // #i99822#
1830 // Direct application of the list level formatting no longer
1831 // needed for list levels of mode LABEL_ALIGNMENT
1832 bool bApplyListLevelIndentDirectlyAtPara(true);
1833 {
1834 if (pTextNd->GetNumRule() && nCurrentLevel < MAXLEVEL)
1835 {
1836 const SwNumFormat& rFormat = pTextNd->GetNumRule()->Get(nCurrentLevel);
1837 if (rFormat.GetPositionAndSpaceMode()
1839 {
1840 bApplyListLevelIndentDirectlyAtPara = false;
1841 }
1842 }
1843 }
1844
1845 if (!bApplyListLevelIndentDirectlyAtPara)
1846 return;
1847
1848 auto xListIndent = std::make_unique<SfxItemSet>(m_rDoc.GetAttrPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE>);
1849 const SvxLRSpaceItem *pItem = static_cast<const SvxLRSpaceItem*>(
1851 OSL_ENSURE(pItem, "impossible");
1852 if (pItem)
1853 xListIndent->Put(*pItem);
1854
1855 /*
1856 Take the original paragraph sprms attached to this list level
1857 formatting and apply them to the paragraph. I'm convinced that
1858 this is exactly what word does.
1859 */
1860 if (short nLen = static_cast< short >(aParaSprms.size()))
1861 {
1862 std::unique_ptr<SfxItemSet> xOldCurrentItemSet(SetCurrentItemSet(std::move(xListIndent)));
1863
1864 sal_uInt8* pSprms1 = aParaSprms.data();
1865 while (0 < nLen)
1866 {
1867 sal_uInt16 nL1 = ImportSprm(pSprms1, nLen);
1868 nLen = nLen - nL1;
1869 pSprms1 += nL1;
1870 }
1871
1872 xListIndent = SetCurrentItemSet(std::move(xOldCurrentItemSet));
1873 }
1874
1875 if (const SvxLRSpaceItem *pLR = xListIndent->GetItem<SvxLRSpaceItem>(RES_LR_SPACE))
1876 {
1877 m_xCtrlStck->NewAttr(*m_pPaM->GetPoint(), *pLR);
1878 m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_LR_SPACE);
1879 }
1880}
1881
1882void SwWW8ImplReader::RegisterNumFormat(sal_uInt16 nCurrentLFO, sal_uInt8 nCurrentLevel)
1883{
1884 // Are we reading the StyleDef ?
1885 if (m_pCurrentColl)
1886 SetStylesList( m_nCurrentColl , nCurrentLFO, nCurrentLevel);
1887 else
1888 RegisterNumFormatOnTextNode(nCurrentLFO, nCurrentLevel);
1889}
1890
1891void SwWW8ImplReader::Read_ListLevel(sal_uInt16, const sal_uInt8* pData,
1892 short nLen)
1893{
1894 if (m_xPlcxMan && m_xPlcxMan->GetDoingDrawTextBox())
1895 return;
1896
1897 if( nLen < 0 )
1898 {
1899 // the current level is finished, what should we do ?
1901 if (m_xStyles && !m_bVer67)
1902 m_xStyles->mnWwNumLevel = 0;
1903 }
1904 else
1905 {
1906 // security check
1907 if( !pData )
1908 return;
1909
1910 // the Streamdata is zero based
1912
1913 if (m_xStyles && !m_bVer67)
1914 {
1915 /*
1916 if this is the case, then if the numbering is actually stored in
1917 winword 6 format, and its likely that sprmPIlvl has been abused
1918 to set the ww6 list level information which we will need when we
1919 reach the true ww6 list def. So set it now
1920 */
1921 m_xStyles->mnWwNumLevel = m_nListLevel;
1922 }
1923
1924 // Treat an invalid level as body-level
1927
1929 if (USHRT_MAX > m_nLFOPosition)
1930 {
1931 assert(false && "m_nLFOPosition is usually reset immediately, so we rarely ever get here.");
1932 m_nLFOPosition = USHRT_MAX;
1934 }
1935 }
1936}
1937
1938void SwWW8ImplReader::Read_LFOPosition(sal_uInt16, const sal_uInt8* pData,
1939 short nLen)
1940{
1941 if (m_xPlcxMan && m_xPlcxMan->GetDoingDrawTextBox())
1942 return;
1943
1944 if( nLen < 0 )
1945 {
1946 // the current level is finished, what should we do ?
1947 m_nLFOPosition = USHRT_MAX;
1949 }
1950 else
1951 {
1952 // security check
1953 if( !pData )
1954 return;
1955
1956 short nData = SVBT16ToUInt16( pData );
1957 if( 0 >= nData )
1958 {
1959 // disable the numbering/list style apply to the paragraph or the style
1960
1961 /*
1962 If you have a paragraph in word with left and/or hanging indent
1963 and remove its numbering, then the indentation appears to get
1964 reset, but not back to the base style, instead it goes to a blank
1965 setting.
1966 Unless it's a broken ww6 list in 97 in which case more hackery is
1967 required, some more details about broken ww6 list in
1968 ww8par6.cxx#SwWW8ImplReader::Read_LR
1969 */
1970
1971 if (m_pCurrentColl)
1972 {
1973 // here a "named" style is being configured
1974
1975 // disable the numbering/list in the style currently configured
1977
1978 // reset/blank the indent
1980
1981 // These sprmPIlfos are supposed to indicate "cancel" numbering.
1982 // Since m_nLFOPosition is "data - 1", then zero becomes USHRT_MAX
1983 // which is no good since that indicates "unspecified, available for inheritance".
1984 // So instead use USHRT_MAX-1 for indicating an explicit "cancel numbering".
1985 RegisterNumFormat(USHRT_MAX-1, MAXLEVEL);
1986 }
1987 else if (SwTextNode* pTextNode = m_pPaM->GetPointNode().GetTextNode())
1988 {
1989 // here a paragraph is being directly formatted
1990
1991 // empty the numbering/list style applied to the current paragraph
1992 SwNumRuleItem aEmptyRule;
1993 pTextNode->SetAttr( aEmptyRule );
1994
1995 // create an empty SvxLRSpaceItem
1996 std::shared_ptr<SvxLRSpaceItem> aLR(std::make_shared<SvxLRSpaceItem>(RES_LR_SPACE));
1997
1998 // replace it with the one of the current node if it exist
2000 if( pLR )
2001 aLR.reset(static_cast<SvxLRSpaceItem*>(pLR->Clone()));
2002
2003 // reset/blank the left indent (and only the left)
2004 aLR->SetTextLeft(0);
2005 aLR->SetTextFirstLineOffset(0);
2006
2007 // apply the modified SvxLRSpaceItem to the current paragraph
2008 pTextNode->SetAttr( *aLR );
2009 }
2010
2011 m_nLFOPosition = USHRT_MAX;
2012 }
2013 else // nData in (0..0x7FFF]
2014 {
2015 m_nLFOPosition = o3tl::narrowing<sal_uInt16>(nData)-1; // m_nLFOPosition in [0..0x7FFF)
2016 /*
2017 If we are a ww8+ style with ww7- style lists then there is a
2018 bizarre broken word bug where when the list is removed from a para
2019 the ww6 list first line indent still affects the first line
2020 indentation. Setting this flag will allow us to recover from this
2021 braindeadness
2022 */
2023 if (m_pCurrentColl && (m_nLFOPosition == 2047-1) && m_nCurrentColl < m_vColl.size())
2024 m_vColl[m_nCurrentColl].m_bHasBrokenWW6List = true;
2025
2026 // here the stream data is 1-based, we subtract ONE
2027 if (m_nLFOPosition != 2047-1) //Normal ww8+ list behaviour
2028 {
2030 m_nLFOPosition = USHRT_MAX;
2032 }
2033 else if (m_xPlcxMan && m_xPlcxMan->HasParaSprm(NS_sprm::LN_PAnld).pSprm)
2034 {
2035 /*
2036 #i8114# Horrific backwards compatible ww7- lists in ww8+
2037 docs
2038 */
2039 m_nListLevel = std::min<sal_uInt8>(WW8ListManager::nMaxLevel, m_nListLevel);
2040 Read_ANLevelNo(13 /*equiv ww7- sprm no*/, &m_nListLevel, 1);
2041 }
2042 }
2043 }
2044}
2045
2046// Reading Controls
2047
2049 WW8_CP nStart, SwWw8ControlType nWhich )
2050{
2051 bool bRet=false;
2052 /*
2053 * Save the reader state and process the sprms for this anchor cp.
2054 * Doing so will set the nPicLocFc to the offset to find the hypertext
2055 * data in the data stream.
2056 */
2057 WW8_CP nEndCp = nStart+1; //Only interested in the single 0x01 character
2058
2059 WW8ReaderSave aSave(this,nStart);
2060
2061 WW8PLCFManResult aRes;
2062 nStart = m_xPlcxMan->Where();
2063 while(nStart <= nEndCp)
2064 {
2065 if ( m_xPlcxMan->Get(&aRes)
2066 && aRes.pMemPos && aRes.nSprmId )
2067 {
2068 //only interested in sprms which would set nPicLocFc
2069 if ( (68 == aRes.nSprmId) || (0x6A03 == aRes.nSprmId) )
2070 {
2071 Read_PicLoc( aRes.nSprmId, aRes.pMemPos +
2072 m_xSprmParser->DistanceToData(aRes.nSprmId), 4);
2073 break;
2074 }
2075 }
2076 m_xPlcxMan->advance();
2077 nStart = m_xPlcxMan->Where();
2078 }
2079 sal_uLong nOffset = m_nPicLocFc;
2080 aSave.Restore(this);
2081
2082 sal_uInt64 nOldPos = m_pDataStream->Tell();
2083 WW8_PIC aPic;
2084 bool bValid = checkSeek(*m_pDataStream, nOffset) &&
2086
2087 if (bValid && aPic.lcb > 0x3A)
2088 {
2089 aFormula.FormulaRead(nWhich,m_pDataStream);
2090 bRet = true;
2091 }
2092
2093 /*
2094 There is a problem with aPic, the WW8_PIC is always used even though it
2095 is too big for the WW95 files, it needs to be modified to check the
2096 version C.
2097 */
2098 m_pDataStream->Seek( nOldPos );
2099 return bRet;
2100}
2101
2103{
2104 const uno::Reference< lang::XMultiServiceFactory > & rServiceFactory =
2105 GetServiceFactory();
2106
2107 if(!rServiceFactory.is())
2108 return;
2109
2110 awt::Size aSz;
2111 uno::Reference< form::XFormComponent> xFComp;
2112
2113 if (rFormula.Import(rServiceFactory, xFComp, aSz))
2114 {
2115 uno::Reference <drawing::XShape> xShapeRef;
2116 if (InsertControl(xFComp, aSz, &xShapeRef, false))
2117 GetShapes()->add(xShapeRef);
2118 }
2119}
2120
2122 SvStream *pDataStream)
2123{
2124 sal_uInt8 nField;
2125
2126 // The following is a FFData structure as described in
2127 // Microsoft's DOC specification (chapter 2.9.78)
2128 sal_uInt32 nVersion = 0;
2129 pDataStream->ReadUInt32(nVersion);
2130 // An unsigned integer that MUST be 0xFFFFFFFF
2131 if (nVersion != 0xFFFFFFFF)
2132 {
2133 SAL_WARN("sw.ww8", "Parsing error: invalid header for FFData");
2134 return; // bail out
2135 }
2136
2137 // might be better to read the bits as a 16 bit word
2138 // ( like it is in the spec. )
2139 sal_uInt8 bits1 = 0;
2140 pDataStream->ReadUChar( bits1 );
2141 sal_uInt8 bits2 = 0;
2142 pDataStream->ReadUChar( bits2 );
2143
2144 sal_uInt8 iType = ( bits1 & 0x3 );
2145
2146 // we should verify that bits.iType & nWhich concur
2147 OSL_ENSURE( iType == nWhich, "something wrong, expect control type read from stream doesn't match nWhich passed in");
2148 if ( iType != nWhich )
2149 return; // bail out
2150
2151 sal_uInt8 iRes = (bits1 & 0x7C) >> 2;
2152
2153 pDataStream->ReadUInt16( mnMaxLen );
2154
2155 sal_uInt16 hps = 0;
2156 pDataStream->ReadUInt16( hps );
2157
2158 // xstzName
2160
2161 if (nWhich == WW8_CT_EDIT)
2162 { // Field is a textbox
2163 // Default text
2164 // xstzTextDef
2166 }
2167 else
2168 {
2169 // CheckBox or ComboBox
2170 sal_uInt16 wDef = 0;
2171 pDataStream->ReadUInt16( wDef );
2172 mnChecked = wDef; // default
2173 if (nWhich == WW8_CT_CHECKBOX)
2174 {
2175 if ( iRes != 25 )
2176 mnChecked = iRes;
2177 msDefault = ( wDef == 0 ) ? std::u16string_view( u"0" ) : std::u16string_view( u"1" );
2178 }
2179 }
2180 // xstzTextFormat
2182 // xstzHelpText
2184 // xstzStatText
2186
2187 // xstzEntryMcr
2189 //xstzExitMcr
2191
2192 if (nWhich == WW8_CT_DROPDOWN)
2193 {
2194 bool bAllOk = true;
2195 // SSTB (see Spec. 2.2.4)
2196 sal_uInt16 fExtend = 0;
2197 pDataStream->ReadUInt16( fExtend );
2198 sal_uInt16 nStringsCnt = 0;
2199
2200 // Isn't it that if fExtend isn't 0xFFFF then fExtend actually
2201 // doesn't exist and we really have just read nStringsCnt ( or cData )?
2202 if (fExtend != 0xFFFF)
2203 bAllOk = false;
2204 pDataStream->ReadUInt16( nStringsCnt );
2205
2206 // I guess this should be zero ( and we should ensure that )
2207 sal_uInt16 cbExtra = 0;
2208 pDataStream->ReadUInt16( cbExtra );
2209
2210 OSL_ENSURE(bAllOk, "Unknown formfield dropdown list structure");
2211 if (!bAllOk) //Not as expected, don't risk it at all.
2212 nStringsCnt = 0;
2213 const size_t nMinRecordSize = sizeof(sal_uInt16);
2214 const size_t nMaxRecords = pDataStream->remainingSize() / nMinRecordSize;
2215 if (nStringsCnt > nMaxRecords)
2216 {
2217 SAL_WARN("sw.ww8", "Parsing error: " << nMaxRecords <<
2218 " max possible entries, but " << nStringsCnt << " claimed, truncating");
2219 nStringsCnt = nMaxRecords;
2220 }
2221 maListEntries.reserve(nStringsCnt);
2222 for (sal_uInt32 nI = 0; nI < nStringsCnt; ++nI)
2223 {
2224 OUString sEntry = read_uInt16_PascalString(*pDataStream);
2225 maListEntries.push_back(sEntry);
2226 }
2227 }
2228 mfDropdownIndex = iRes;
2229
2230 mbHelp = bits1 & 0x80;
2231
2232 nField = bits2;
2233 mfToolTip = nField & 0x01;
2234 mfNoMark = (nField & 0x02)>>1;
2235 mfType = (nField & 0x38)>>3;
2236 mfUnused = (nField & 0xE0)>>5;
2237}
2238
2241{
2242}
2243
2244//Miserable hack to get a hardcoded guesstimate of the size of a list dropdown
2245//box's first entry to set as the lists default size
2246awt::Size SwWW8ImplReader::MiserableDropDownFormHack(const OUString &rString,
2247 uno::Reference<beans::XPropertySet> const & rPropSet)
2248{
2249 awt::Size aRet;
2250 struct CtrlFontMapEntry
2251 {
2252 sal_uInt16 nWhichId;
2253 const char* pPropNm;
2254 };
2255 const CtrlFontMapEntry aMapTable[] =
2256 {
2257 { RES_CHRATR_COLOR, "TextColor" },
2258 { RES_CHRATR_FONT, "FontName" },
2259 { RES_CHRATR_FONTSIZE, "FontHeight" },
2260 { RES_CHRATR_WEIGHT, "FontWeight" },
2261 { RES_CHRATR_UNDERLINE, "FontUnderline" },
2262 { RES_CHRATR_CROSSEDOUT, "FontStrikeout" },
2263 { RES_CHRATR_POSTURE, "FontSlant" },
2264 { 0, nullptr }
2265 };
2266
2267 vcl::Font aFont;
2268 uno::Reference< beans::XPropertySetInfo > xPropSetInfo =
2269 rPropSet->getPropertySetInfo();
2270
2271 uno::Any aTmp;
2272 for (const CtrlFontMapEntry* pMap = aMapTable; pMap->nWhichId; ++pMap)
2273 {
2274 bool bSet = true;
2275 const SfxPoolItem* pItem = GetFormatAttr( pMap->nWhichId );
2276 OSL_ENSURE(pItem, "Impossible");
2277 if (!pItem)
2278 continue;
2279
2280 switch ( pMap->nWhichId )
2281 {
2282 case RES_CHRATR_COLOR:
2283 {
2284 OUString aNm;
2285 if (xPropSetInfo->hasPropertyByName(aNm = "TextColor"))
2286 {
2287 aTmp <<= static_cast<sal_Int32>(static_cast<const SvxColorItem*>(pItem)->GetValue());
2288 rPropSet->setPropertyValue(aNm, aTmp);
2289 }
2290 }
2291 aFont.SetColor(static_cast<const SvxColorItem*>(pItem)->GetValue());
2292 break;
2293 case RES_CHRATR_FONT:
2294 {
2295 const SvxFontItem *pFontItem = static_cast<const SvxFontItem *>(pItem);
2296 OUString aNm;
2297 if (xPropSetInfo->hasPropertyByName(aNm = "FontStyleName"))
2298 {
2299 aTmp <<= pFontItem->GetStyleName();
2300 rPropSet->setPropertyValue( aNm, aTmp );
2301 }
2302 if (xPropSetInfo->hasPropertyByName(aNm = "FontFamily"))
2303 {
2304 aTmp <<= static_cast<sal_Int16>(pFontItem->GetFamily());
2305 rPropSet->setPropertyValue( aNm, aTmp );
2306 }
2307 if (xPropSetInfo->hasPropertyByName(aNm = "FontCharset"))
2308 {
2309 aTmp <<= static_cast<sal_Int16>(pFontItem->GetCharSet());
2310 rPropSet->setPropertyValue( aNm, aTmp );
2311 }
2312 if (xPropSetInfo->hasPropertyByName(aNm = "FontPitch"))
2313 {
2314 aTmp <<= static_cast<sal_Int16>(pFontItem->GetPitch());
2315 rPropSet->setPropertyValue( aNm, aTmp );
2316 }
2317
2318 aTmp <<= pFontItem->GetFamilyName();
2319 aFont.SetFamilyName( pFontItem->GetFamilyName() );
2320 aFont.SetStyleName( pFontItem->GetStyleName() );
2321 aFont.SetFamily( pFontItem->GetFamily() );
2322 aFont.SetCharSet( pFontItem->GetCharSet() );
2323 aFont.SetPitch( pFontItem->GetPitch() );
2324 }
2325 break;
2326
2328 {
2329 Size aSize( aFont.GetFontSize().Width(),
2330 static_cast<const SvxFontHeightItem*>(pItem)->GetHeight() );
2331 aTmp <<= static_cast<float>(aSize.Height()) / 20.0;
2332
2334 }
2335 break;
2336
2337 case RES_CHRATR_WEIGHT:
2339 static_cast<const SvxWeightItem*>(pItem)->GetWeight() );
2340 aFont.SetWeight( static_cast<const SvxWeightItem*>(pItem)->GetWeight() );
2341 break;
2342
2344 aTmp <<= static_cast<sal_Int16>(static_cast<const SvxUnderlineItem*>(pItem)->GetLineStyle());
2345 aFont.SetUnderline(static_cast<const SvxUnderlineItem*>(pItem)->GetLineStyle());
2346 break;
2347
2349 aTmp <<= static_cast<sal_Int16>( static_cast<const SvxCrossedOutItem*>(pItem)->GetStrikeout() );
2350 aFont.SetStrikeout( static_cast<const SvxCrossedOutItem*>(pItem)->GetStrikeout() );
2351 break;
2352
2353 case RES_CHRATR_POSTURE:
2354 aTmp <<= static_cast<sal_Int16>( static_cast<const SvxPostureItem*>(pItem)->GetPosture() );
2355 aFont.SetItalic( static_cast<const SvxPostureItem*>(pItem)->GetPosture() );
2356 break;
2357
2358 default:
2359 bSet = false;
2360 break;
2361 }
2362
2363 if (bSet && xPropSetInfo->hasPropertyByName(OUString::createFromAscii(pMap->pPropNm)))
2364 rPropSet->setPropertyValue(OUString::createFromAscii(pMap->pPropNm), aTmp);
2365 }
2366 // now calculate the size of the control
2368 OSL_ENSURE(pOut, "Impossible");
2369 if (pOut)
2370 {
2372 pOut->SetMapMode( MapMode( MapUnit::Map100thMM ));
2373 pOut->SetFont( aFont );
2374 aRet.Width = pOut->GetTextWidth(rString);
2375 aRet.Width += 500; //plus size of button, total hack territory
2376 aRet.Height = pOut->GetTextHeight();
2377 pOut->Pop();
2378 }
2379 return aRet;
2380}
2381
2382bool WW8FormulaListBox::Import(const uno::Reference <
2383 lang::XMultiServiceFactory> &rServiceFactory,
2384 uno::Reference <form::XFormComponent> &rFComp,awt::Size &rSz )
2385{
2386 uno::Reference<uno::XInterface> xCreate = rServiceFactory->createInstance("com.sun.star.form.component.ComboBox");
2387 if( !xCreate.is() )
2388 return false;
2389
2390 rFComp.set(xCreate, uno::UNO_QUERY);
2391 if( !rFComp.is() )
2392 return false;
2393
2394 uno::Reference<beans::XPropertySet> xPropSet(xCreate, uno::UNO_QUERY);
2395
2396 uno::Any aTmp;
2397 if (!msTitle.isEmpty())
2398 aTmp <<= msTitle;
2399 else
2400 aTmp <<= msName;
2401 xPropSet->setPropertyValue("Name", aTmp );
2402
2403 if (!msToolTip.isEmpty())
2404 {
2405 aTmp <<= msToolTip;
2406 xPropSet->setPropertyValue("HelpText", aTmp );
2407 }
2408
2409 xPropSet->setPropertyValue("Dropdown", css::uno::Any(true));
2410
2411 if (!maListEntries.empty())
2412 {
2413 sal_uInt32 nLen = maListEntries.size();
2414 uno::Sequence< OUString > aListSource(nLen);
2415 auto aListSourceRange = asNonConstRange(aListSource);
2416 for (sal_uInt32 nI = 0; nI < nLen; ++nI)
2417 aListSourceRange[nI] = maListEntries[nI];
2418 aTmp <<= aListSource;
2419 xPropSet->setPropertyValue("StringItemList", aTmp );
2420
2421 if (mfDropdownIndex < nLen)
2422 {
2423 aTmp <<= aListSource[mfDropdownIndex];
2424 }
2425 else
2426 {
2427 aTmp <<= aListSource[0];
2428 }
2429
2430 xPropSet->setPropertyValue("DefaultText", aTmp );
2431
2432 rSz = mrRdr.MiserableDropDownFormHack(maListEntries[0], xPropSet);
2433 }
2434 else
2435 {
2436 static constexpr OUStringLiteral aBlank =
2437 u"\u2002\u2002\u2002\u2002\u2002";
2438 rSz = mrRdr.MiserableDropDownFormHack(aBlank, xPropSet);
2439 }
2440
2441 return true;
2442}
2443
2446{
2447}
2448
2450(uno::Reference<beans::XPropertySet> const & xPropSet,
2451 const OUString & rPropertyName, const OUString & rValue)
2452{
2453 uno::Reference<beans::XPropertySetInfo> xPropSetInfo =
2454 xPropSet->getPropertySetInfo();
2455 if (xPropSetInfo.is() &&
2456 ! xPropSetInfo->hasPropertyByName(rPropertyName))
2457 {
2458 uno::Reference<beans::XPropertyContainer>
2459 xPropContainer(xPropSet, uno::UNO_QUERY);
2460 uno::Any aAny((OUString()));
2461 xPropContainer->addProperty
2462 (rPropertyName,
2463 static_cast<sal_Int16>(beans::PropertyAttribute::BOUND |
2464 beans::PropertyAttribute::REMOVABLE),
2465 aAny);
2466 }
2467
2468 uno::Any aAnyValue(rValue);
2469 xPropSet->setPropertyValue(rPropertyName, aAnyValue );
2470}
2471
2472bool WW8FormulaCheckBox::Import(const uno::Reference <
2473 lang::XMultiServiceFactory> &rServiceFactory,
2474 uno::Reference <form::XFormComponent> &rFComp,awt::Size &rSz )
2475{
2476 uno::Reference< uno::XInterface > xCreate = rServiceFactory->createInstance("com.sun.star.form.component.CheckBox");
2477 if( !xCreate.is() )
2478 return false;
2479
2480 rFComp.set( xCreate, uno::UNO_QUERY );
2481 if( !rFComp.is() )
2482 return false;
2483
2484 uno::Reference< beans::XPropertySet > xPropSet( xCreate, uno::UNO_QUERY );
2485
2486 rSz.Width = 16 * mhpsCheckBox;
2487 rSz.Height = 16 * mhpsCheckBox;
2488
2489 uno::Any aTmp;
2490 if (!msTitle.isEmpty())
2491 aTmp <<= msTitle;
2492 else
2493 aTmp <<= msName;
2494 xPropSet->setPropertyValue("Name", aTmp );
2495
2496 aTmp <<= static_cast<sal_Int16>(mnChecked);
2497 xPropSet->setPropertyValue("DefaultState", aTmp);
2498
2499 if (!msToolTip.isEmpty())
2500 lcl_AddToPropertyContainer(xPropSet, "HelpText", msToolTip);
2501
2502 if (!msHelp.isEmpty())
2503 lcl_AddToPropertyContainer(xPropSet, "HelpF1Text", msHelp);
2504
2505 return true;
2506
2507}
2508
2511{
2512}
2513
2515 const uno::Reference< form::XFormComponent > & rFComp,
2516 const awt::Size& rSize, uno::Reference< drawing::XShape > *pShape,
2517 bool bFloatingCtrl)
2518{
2519 const uno::Reference< container::XIndexContainer > &rComps = GetFormComps();
2521 rComps->insertByIndex( rComps->getCount(), aTmp );
2522
2523 const uno::Reference< lang::XMultiServiceFactory > &rServiceFactory =
2524 GetServiceFactory();
2525 if( !rServiceFactory.is() )
2526 return false;
2527
2528 uno::Reference< uno::XInterface > xCreate = rServiceFactory->createInstance(
2529 "com.sun.star.drawing.ControlShape");
2530 if( !xCreate.is() )
2531 return false;
2532
2533 uno::Reference< drawing::XShape > xShape(xCreate, uno::UNO_QUERY);
2534
2535 OSL_ENSURE(xShape.is(), "Did not get XShape");
2536 xShape->setSize(rSize);
2537
2538 uno::Reference< beans::XPropertySet > xShapePropSet(
2539 xCreate, uno::UNO_QUERY );
2540
2541 //I lay a small bet that this will change to
2542 //sal_Int16 nTemp=TextContentAnchorType::AS_CHARACTER;
2543 text::TextContentAnchorType nTemp;
2544 if (bFloatingCtrl)
2545 nTemp = text::TextContentAnchorType_AT_PARAGRAPH;
2546 else
2547 nTemp = text::TextContentAnchorType_AS_CHARACTER;
2548
2549 xShapePropSet->setPropertyValue("AnchorType", uno::Any(static_cast<sal_Int16>(nTemp)) );
2550
2551 xShapePropSet->setPropertyValue("VertOrient", uno::Any(sal_Int16(text::VertOrientation::TOP)) );
2552
2553 uno::Reference< text::XText > xDummyTextRef;
2554 uno::Reference< text::XTextRange > xTextRg =
2555 new SwXTextRange( *m_pPaM, xDummyTextRef );
2556
2557 aTmp <<= xTextRg;
2558 xShapePropSet->setPropertyValue("TextRange", aTmp );
2559
2560 // Set the Control-Model for the Control-Shape
2561 uno::Reference< drawing::XControlShape > xControlShape( xShape,
2562 uno::UNO_QUERY );
2563 uno::Reference< awt::XControlModel > xControlModel( rFComp,
2564 uno::UNO_QUERY );
2565 xControlShape->setControl( xControlModel );
2566
2567 if (pShape)
2568 *pShape = xShape;
2569
2570 return true;
2571}
2572
2573/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static OutputDevice * GetDefaultDevice()
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
virtual SwFieldType * GetSysFieldType(const SwFieldIds eWhich) const =0
Provides access to the marks of a document.
virtual sw::mark::IFieldmark * makeNoTextFieldBookmark(const SwPaM &rPaM, const OUString &rName, const OUString &rType)=0
const SfxPoolItem * GetCurItem() const
const SfxPoolItem * NextItem()
sal_uInt16 Count() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
sal_uInt16 Which() const
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
constexpr tools::Long Height() const
constexpr tools::Long Width() const
sal_uInt64 Tell() const
bool good() const
SvStream & ReadUInt32(sal_uInt32 &rUInt32)
sal_uInt64 Seek(sal_uInt64 nPos)
SvStream & ReadInt32(sal_Int32 &rInt32)
std::size_t ReadBytes(void *pData, std::size_t nSize)
sal_uInt64 SeekRel(sal_Int64 nPos)
ErrCode GetError() const
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
sal_uInt64 remainingSize()
SvStream & ReadUChar(unsigned char &rChar)
static SvtFilterOptions & Get()
bool IsUseEnhancedFields() const
sal_uInt32 GetHeight() const
FontFamily GetFamily() const
FontPitch GetPitch() const
const OUString & GetStyleName() const
rtl_TextEncoding GetCharSet() const
const OUString & GetFamilyName() const
void SetTextLeft(const tools::Long nL, const sal_uInt16 nProp=100)
void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp=100)
void SetStart(sal_uInt16 nSet)
void SetAbsLSpace(sal_Int32 nSet)
void SetFirstLineIndent(const tools::Long nFirstLineIndent)
void SetBulletFont(const vcl::Font *pFont)
void SetCharTextDistance(short nSet)
sal_uInt16 GetStart() const
sal_Int32 GetAbsLSpace() const
void SetListFormat(const OUString &rPrefix, const OUString &rSuffix, int nLevel)
void SetNumAdjust(SvxAdjust eSet)
SvxAdjust GetNumAdjust() const
void SetIncludeUpperLevels(sal_uInt8 nSet)
void SetIndentAt(const tools::Long nIndentAt)
void SetFirstLineOffset(sal_Int32 nSet)
SvxNumPositionAndSpaceMode GetPositionAndSpaceMode() const
void SetBulletChar(sal_UCS4 cSet)
void SetLabelFollowedBy(const LabelFollowedBy eLabelFollowedBy)
void SetListtabPos(const tools::Long nListtabPos)
void SetNumberingType(SvxNumType nSet)
SvxNumType GetNumberingType() const
Represents the style of a text portion.
Definition: charfmt.hxx:27
const SwCharFormat * GetDfltCharFormat() const
Definition: doc.hxx:762
OUString GetUniqueNumRuleName(const OUString *pChkStr=nullptr, bool bAutoNum=true) const
Definition: docnum.cxx:2519
const SwNumRuleTable & GetNumRuleTable() const
Definition: doc.hxx:1075
SwNumRule * GetOutlineNumRule() const
Definition: doc.hxx:1033
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:323
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:365
IDocumentMarkAccess * getIDocumentMarkAccess()
Definition: docbm.cxx:1874
bool DelNumRule(const OUString &rName, bool bBroadCast=false)
Definition: docnum.cxx:1053
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1329
SwCharFormat * MakeCharFormat(const OUString &rFormatName, SwCharFormat *pDerivedFrom, bool bBroadcast=false)
Definition: docfmt.cxx:854
bool SetTextFormatColl(const SwPaM &rRg, SwTextFormatColl *pFormat, const bool bReset=true, const bool bResetListAttrs=false, SwRootFrame const *pLayout=nullptr)
Add 4th optional parameter <bResetListAttrs>.
Definition: docfmt.cxx:1081
sal_uInt16 MakeNumRule(const OUString &rName, const SwNumRule *pCpy=nullptr, bool bBroadcast=false, const SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode=SvxNumberFormat::LABEL_WIDTH_AND_POSITION)
Definition: docnum.cxx:2475
Field type for dropdown boxes.
Definition: flddropdown.hxx:32
Dropdown field.
Definition: flddropdown.hxx:59
void SetSelectedItem(const OUString &rItem)
Sets the selected item.
void SetToolTip(const OUString &rToolTip)
Sets the tool tip of the field.
void SetItems(std::vector< OUString > &&rItems)
Sets the items of the dropdown box.
void SetHelp(const OUString &rHelp)
Sets the help text of the field.
void SetName(const OUString &rName)
Sets the name of the field.
const SvxFontItem & GetFont(bool=true) const
Definition: charatr.hxx:122
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:366
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:447
void SetToolTip(const OUString &rStr)
Definition: expfld.cxx:1423
void SetHelp(const OUString &rStr)
Definition: expfld.cxx:1413
virtual bool InsertControl(const css::uno::Reference< css::form::XFormComponent > &rFComp, const css::awt::Size &rSize, css::uno::Reference< css::drawing::XShape > *pShape, bool bFloatingCtrl) override
Definition: ww8par3.cxx:2514
void InsertFormula(WW8FormulaControl &rFormula)
Definition: ww8par3.cxx:2102
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:897
SwCharFormat * GetCharFormat() const
Definition: numrule.hxx:74
void SetGrfBulletCP(sal_Unicode cP)
Definition: numrule.hxx:81
void SetCharFormat(SwCharFormat *)
Definition: number.cxx:281
void SetAutoRule(bool bFlag)
Definition: numrule.hxx:230
sal_uInt8 GetPoolHlpFileId() const
Definition: numrule.hxx:256
bool IsOutlineRule() const
Definition: numrule.hxx:241
bool IsContinusNum() const
Definition: numrule.hxx:235
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
sal_uInt16 GetPoolFormatId() const
Query and set PoolFormat IDs.
Definition: numrule.hxx:250
void SetContinusNum(bool bFlag)
Definition: numrule.hxx:236
bool IsAbsSpaces() const
Definition: numrule.hxx:238
SwNumRuleType GetRuleType() const
Definition: numrule.hxx:211
sal_uInt16 GetPoolHelpId() const
Query and set Help-IDs for document styles.
Definition: numrule.hxx:254
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:187
SwNode & GetPointNode() const
Definition: pam.hxx:283
const SwPosition * GetPoint() const
Definition: pam.hxx:261
Represents the style of a paragraph.
Definition: fmtcol.hxx:61
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:111
void SetAttrListLevel(int nLevel)
Sets the list level of this text node.
Definition: ndtxt.cxx:4210
void SetListRestart(bool bRestart)
Definition: ndtxt.cxx:4249
virtual bool SetAttr(const SfxPoolItem &) override
overriding to handle change of certain paragraph attributes
Definition: ndtxt.cxx:5044
void SetCountedInList(bool bCounted)
Definition: ndtxt.cxx:4370
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
Definition: ndtxt.cxx:2919
void SetAttrListRestartValue(SwNumberTree::tSwNumTreeNumber nNum)
Definition: ndtxt.cxx:4298
virtual bool ResetAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0) override
Definition: ndtxt.cxx:5271
SwPaM * m_pPaM
Definition: ww8par.hxx:1129
sal_uInt16 m_nLFOPosition
Definition: ww8par.hxx:1325
eF_ResT Read_F_FormTextBox(WW8FieldDesc *pF, OUString &rStr)
Definition: ww8par3.cxx:93
css::awt::Size MiserableDropDownFormHack(const OUString &rString, css::uno::Reference< css::beans::XPropertySet > const &rPropSet)
Definition: ww8par3.cxx:2246
SwDocShell * m_pDocShell
Definition: ww8par.hxx:1106
std::vector< SwWW8StyInf > m_vColl
Definition: ww8par.hxx:1269
void Read_ANLevelNo(sal_uInt16, const sal_uInt8 *pData, short nLen)
Definition: ww8par2.cxx:756
std::unique_ptr< SwMSConvertControls > m_xFormImpl
Definition: ww8par.hxx:1231
eF_ResT Read_F_OCX(WW8FieldDesc *, OUString &)
Definition: ww8par3.cxx:85
eF_ResT Read_F_FormCheckBox(WW8FieldDesc *pF, OUString &rStr)
Definition: ww8par3.cxx:186
std::unique_ptr< SwWW8FltControlStack > m_xCtrlStck
Definition: ww8par.hxx:1131
eF_ResT Read_F_HTMLControl(WW8FieldDesc *pF, OUString &rStr)
Definition: ww8par3.cxx:318
SwDoc & m_rDoc
Definition: ww8par.hxx:1127
bool ImportFormulaControl(WW8FormulaControl &rBox, WW8_CP nStart, SwWw8ControlType nWhich)
Definition: ww8par3.cxx:2048
void Read_LFOPosition(sal_uInt16 nId, const sal_uInt8 *pData, short nLen)
read and interpret the sprmPIlfo used to determine which list contains the paragraph.
Definition: ww8par3.cxx:1938
sal_uInt16 GetToggleAttrFlags() const
Definition: ww8par.cxx:578
sal_uInt16 m_nCurrentColl
Definition: ww8par.hxx:1323
void SetNCurrentColl(sal_uInt16 nColl)
Definition: ww8par.hxx:1922
sal_uInt8 m_nListLevel
Definition: ww8par.hxx:1339
void Read_ListLevel(sal_uInt16 nId, const sal_uInt8 *pData, short nLen)
Definition: ww8par3.cxx:1891
sal_uInt16 StyleUsingLFO(sal_uInt16 nLFOIndex) const
Definition: ww8par2.cxx:3576
std::shared_ptr< WW8PLCFMan > m_xPlcxMan
Definition: ww8par.hxx:1258
sal_uInt16 GetToggleBiDiAttrFlags() const
Definition: ww8par.cxx:583
void RegisterNumFormat(sal_uInt16 nCurrentLFO, sal_uInt8 nCurrentLevel)
Definition: ww8par3.cxx:1882
void SetToggleAttrFlags(sal_uInt16 nFlags)
Definition: ww8par.cxx:588
std::deque< WW8FieldEntry > m_aFieldStack
Definition: ww8par.hxx:1172
SvStream * m_pDataStream
Definition: ww8par.hxx:1124
std::unique_ptr< wwSprmParser > m_xSprmParser
Definition: ww8par.hxx:1207
const SwNumRule * m_pChosenWW8OutlineStyle
Definition: ww8par.hxx:1338
bool IsRightToLeft()
Definition: ww8par6.cxx:4635
bool IsInvalidOrToBeMergedTabCell() const
Definition: ww8par2.cxx:3557
sal_uLong m_nObjLocFc
Definition: ww8par.hxx:1314
void Read_PicLoc(sal_uInt16, const sal_uInt8 *pData, short nLen)
Definition: ww8par6.cxx:2911
std::unique_ptr< WW8ListManager > m_xLstManager
Definition: ww8par.hxx:1256
OUString GetFieldResult(WW8FieldDesc const *pF)
Definition: ww8par5.cxx:1250
eF_ResT Read_F_FormListBox(WW8FieldDesc *pF, OUString &rStr)
Definition: ww8par3.cxx:244
void SetStylesList(sal_uInt16 nStyle, sal_uInt16 nCurrentLFO, sal_uInt8 nCurrentLevel)
Definition: ww8par3.cxx:1703
void RegisterNumFormatOnTextNode(sal_uInt16 nCurrentLFO, sal_uInt8 nCurrentLevel, const bool bSetAttr=true)
Definition: ww8par3.cxx:1774
SwFormat * m_pCurrentColl
Definition: ww8par.hxx:1265
std::unique_ptr< WW8RStyle > m_xStyles
Definition: ww8par.hxx:1264
sal_uInt16 GetCurrentColl() const
Definition: ww8par.hxx:1921
void SetToggleBiDiAttrFlags(sal_uInt16 nFlags)
Definition: ww8par.cxx:594
static SAL_WARN_UNUSED_RESULT bool PicRead(SvStream *pDataStream, WW8_PIC *pPic, bool bVer67)
Definition: ww8graf2.cxx:442
std::unique_ptr< SfxItemSet > SetCurrentItemSet(std::unique_ptr< SfxItemSet > pItemSet)
Definition: ww8par.cxx:6769
bool SetTextFormatCollAndListLevel(const SwPaM &rRg, SwWW8StyInf &rStyleInfo)
Definition: ww8par3.cxx:1635
void RegisterNumFormatOnStyle(sal_uInt16 nStyle)
Definition: ww8par3.cxx:1735
const SfxPoolItem * GetFormatAttr(sal_uInt16 nWhich)
Definition: ww8par6.cxx:2841
short ImportSprm(const sal_uInt8 *pPos, sal_Int32 nMemLen, sal_uInt16 nId=0)
Definition: ww8par6.cxx:6188
sal_uLong m_nPicLocFc
Definition: ww8par.hxx:1313
bool m_bListRelevantIndentSet
Definition: ww8par.hxx:259
SwNumRule * m_pOutlineNumrule
Definition: ww8par.hxx:235
bool m_bColl
Definition: ww8par.hxx:255
std::shared_ptr< SvxLRSpaceItem > maWordLR
Definition: ww8par.hxx:252
bool IsWW8BuiltInHeadingStyle() const
Definition: ww8par.hxx:337
bool HasWW8OutlineLevel() const
Definition: ww8par.hxx:315
sal_uInt8 m_nListLevel
Definition: ww8par.hxx:240
SwFormat * m_pFormat
Definition: ww8par.hxx:233
bool m_bHasStyNumRule
Definition: ww8par.hxx:257
sal_uInt16 m_nLFOIndex
Definition: ww8par.hxx:239
bool m_bValid
Definition: ww8par.hxx:253
sal_Int32 m_lcbPlfLfo
Definition: ww8scan.hxx:1464
WW8_FC m_fcPlfLfo
Definition: ww8scan.hxx:1463
sal_uInt8 m_nVersion
Program-Version asked for by us: in Ctor we check if it matches the value of nFib.
Definition: ww8scan.hxx:1118
sal_Int32 m_lcbPlcfLst
Definition: ww8scan.hxx:1462
WW8_FC m_fcPlcfLst
Definition: ww8scan.hxx:1461
virtual bool Import(const css::uno::Reference< css::lang::XMultiServiceFactory > &rServiceFactory, css::uno::Reference< css::form::XFormComponent > &rFComp, css::awt::Size &rSz) override
Definition: ww8par3.cxx:2472
WW8FormulaCheckBox(const WW8FormulaCheckBox &)=delete
sal_uInt16 mnChecked
Definition: ww8par.hxx:667
virtual bool Import(const css::uno::Reference< css::lang::XMultiServiceFactory > &rServiceFactory, css::uno::Reference< css::form::XFormComponent > &rFComp, css::awt::Size &rSz)=0
sal_uInt8 mfNoMark
Definition: ww8par.hxx:662
sal_uInt8 mfType
Definition: ww8par.hxx:663
OUString msName
Definition: ww8par.hxx:685
sal_uInt16 mnMaxLen
FFData.cch in the spec: maximum length, in characters, of the value of the textbox.
Definition: ww8par.hxx:670
sal_uInt8 mfToolTip
Definition: ww8par.hxx:661
std::vector< OUString > maListEntries
Definition: ww8par.hxx:679
OUString msDefault
Definition: ww8par.hxx:672
OUString msExitMcr
Definition: ww8par.hxx:678
OUString msEntryMcr
Definition: ww8par.hxx:677
OUString msTitle
Definition: ww8par.hxx:671
SwWW8ImplReader & mrRdr
Definition: ww8par.hxx:646
sal_uInt8 mfUnused
Definition: ww8par.hxx:664
OUString msToolTip
Definition: ww8par.hxx:676
OUString msHelp
Definition: ww8par.hxx:675
sal_uInt16 mhpsCheckBox
Definition: ww8par.hxx:666
void FormulaRead(SwWw8ControlType nWhich, SvStream *pD)
Definition: ww8par3.cxx:2121
sal_uInt8 mfDropdownIndex
Definition: ww8par.hxx:660
OUString msFormatting
Definition: ww8par.hxx:673
WW8FormulaEditBox(const WW8FormulaEditBox &)=delete
WW8FormulaListBox(const WW8FormulaListBox &)=delete
virtual bool Import(const css::uno::Reference< css::lang::XMultiServiceFactory > &rServiceFactory, css::uno::Reference< css::form::XFormComponent > &rFComp, css::awt::Size &rSz) override
Definition: ww8par3.cxx:2382
sal_uInt16 m_nLastLFOPosition
Definition: ww8par.hxx:197
SwDoc & m_rDoc
Definition: ww8par.hxx:171
wwSprmParser maSprmParser
Definition: ww8par.hxx:169
std::vector< std::unique_ptr< WW8LSTInfo > > maLSTInfos
Definition: ww8par.hxx:174
const WW8Fib & m_rFib
Definition: ww8par.hxx:172
void ImplDestroy()
Definition: ww8par3.cxx:1457
SprmResult GrpprlHasSprm(sal_uInt16 nId, sal_uInt8 &rSprms, sal_uInt8 nLen)
Definition: ww8par3.cxx:462
SwNumRule * CreateNextRule(bool bSimple)
Definition: ww8par3.cxx:1100
WW8LSTInfo * GetLSTByListId(sal_uInt32 nIdLst) const
Definition: ww8par3.cxx:483
SwNumRule * GetNumRuleForActivation(sal_uInt16 nLFOPosition, const sal_uInt8 nLevel, std::vector< sal_uInt8 > &rParaSprms, SwTextNode *pNode=nullptr)
Definition: ww8par3.cxx:1518
WW8ListManager(SvStream &rSt_, SwWW8ImplReader &rReader_)
Definition: ww8par3.cxx:1124
bool ReadLVL(SwNumFormat &rNumFormat, std::unique_ptr< SfxItemSet > &rpItemSet, sal_uInt16 nLevelStyle, bool bSetStartNo, sal_uInt16 nLevel, ww::bytes &rParaSprms)
Definition: ww8par3.cxx:647
void AdjustLVL(sal_uInt8 nLevel, SwNumRule &rNumRule, WW8aISet const &rListItemSet, WW8aCFormat &aCharFormat, bool &bNewCharFormatCreated, const OUString &aPrefix=OUString())
Definition: ww8par3.cxx:1001
std::unique_ptr< SfxItemSet > WW8aISet[nMaxLevel]
Definition: ww8par.hxx:185
SwNumRule * GetNumRule(size_t i)
Definition: ww8par3.cxx:1114
SwCharFormat * WW8aCFormat[nMaxLevel]
Definition: ww8par.hxx:187
static SvxNumType GetSvxNumTypeFromMSONFC(sal_uInt16 nMSONFC)
Definition: ww8par3.cxx:492
sal_uInt16 m_nUniqueList
Definition: ww8par.hxx:176
std::vector< std::unique_ptr< WW8LFOInfo > > m_LFOInfos
Definition: ww8par.hxx:175
SvStream & m_rSt
Definition: ww8par.hxx:173
SwWW8ImplReader & m_rReader
Definition: ww8par.hxx:170
Iterator for Booknotes.
Definition: ww8scan.hxx:751
void SetStatus(sal_uInt16 nIndex, eBookStatus eStat)
Definition: ww8scan.cxx:4430
OUString GetUniqueBookmarkName(const OUString &rSuggestedName)
Definition: ww8scan.cxx:4496
OUString GetBookmark(tools::Long nStart, tools::Long nEnd, sal_uInt16 &nIndex)
Definition: ww8scan.cxx:4462
void Restore(SwWW8ImplReader *pRdr)
Definition: ww8par.cxx:2055
simple Iterator for SPRMs
Definition: ww8scan.hxx:263
const sal_uInt8 * GetSprms() const
Definition: ww8scan.hxx:282
sal_Int32 GetRemLen() const
Definition: ww8scan.hxx:286
sal_uInt16 GetCurrentId() const
Definition: ww8scan.hxx:285
void advance()
Definition: ww8scan.cxx:889
virtual void SetChecked(bool checked)=0
void SetFontSize(const Size &)
void SetStyleName(const OUString &rStyleName)
void SetPitch(FontPitch ePitch)
void SetColor(const Color &)
void SetItalic(FontItalic)
void SetWeight(FontWeight)
void SetFamily(FontFamily)
void SetUnderline(FontLineStyle)
void SetCharSet(rtl_TextEncoding)
const Size & GetFontSize() const
void SetFamilyName(const OUString &rFamilyName)
void SetStrikeout(FontStrikeout)
SprmResult findSprmData(sal_uInt16 nId, sal_uInt8 *pSprms, sal_Int32 nLen) const
Returns the offset to data of the first sprm of id nId, 0.
Definition: ww8scan.cxx:8497
#define suppress_fun_call_w_exception(expr)
SwDoc & m_rDoc
Definition: docbm.cxx:1215
float u
#define ERRCODE_NONE
sal_Int16 nVersion
@ INP_TXT
Definition: fldbas.hxx:218
constexpr TypedWhichId< SvxCrossedOutItem > RES_CHRATR_CROSSEDOUT(5)
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
const SfxPoolItem * GetDfltAttr(sal_uInt16 nWhich)
Get the default attribute from corresponding default attribute table.
Definition: hints.cxx:159
sal_Int32 nIndex
OUString aName
sal_Int64 n
sal_uInt16 nPos
OUString sPrefix
#define SAL_WARN(area, stream)
std::unique_ptr< sal_Int32[]> pData
const char * sName
const sal_uInt16 LN_PAnld
Definition: sprmids.hxx:39
Definition: ww8scan.hxx:44
constexpr OUStringLiteral aCheckBox
Definition: ww8scan.hxx:49
constexpr OUStringLiteral aTextField
Definition: ww8scan.hxx:51
constexpr OUStringLiteral aListBox
Definition: ww8scan.hxx:50
OUString sanitizeStringSurrogates(const OUString &rString)
sal_Int32 getTokenCount(std::string_view rIn, char cTok)
int i
const vcl::Font & GetDefBulletFont()
retrieve font used for the default bullet list characters
Definition: number.cxx:1395
std::enable_if< std::is_signed< T >::value, bool >::type checked_add(T a, T b, T &result)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
constexpr T & temporary(T &&x)
long Long
VCL_DLLPUBLIC float ConvertFontWeight(FontWeight eWeight)
@ stiNil
Definition: wwstyles.hxx:134
std::vector< sal_uInt8 > bytes
Definition: types.hxx:29
constexpr OUStringLiteral ODF_FORMTEXT
constexpr OUStringLiteral ODF_FORMCHECKBOX_HELPTEXT
constexpr OUStringLiteral ODF_FORMDROPDOWN_RESULT
constexpr OUStringLiteral ODF_FORMDROPDOWN_LISTENTRY
constexpr OUStringLiteral ODF_FORMCHECKBOX
constexpr OUStringLiteral ODF_FORMDROPDOWN
sal_Int16 nId
const char GetValue[]
QPRO_FUNC_TYPE nType
sal_uIntPtr sal_uLong
TOOLS_DLLPUBLIC bool checkSeek(SvStream &rSt, sal_uInt64 nOffset)
static constexpr sal_uInt16 val
Definition: sprmids.hxx:278
const sal_uInt8 * pSprm
Definition: ww8scan.hxx:95
sal_Int32 nRemainingData
Definition: ww8scan.hxx:96
WW8_CP nLen
total length (to skip over text)
Definition: ww8scan.hxx:192
WW8_CP nSCode
start of instructions code
Definition: ww8scan.hxx:193
WW8_CP nLCode
length
Definition: ww8scan.hxx:194
SwNumRule * pNumRule
Definition: ww8par3.cxx:428
bool bOverride
Definition: ww8par3.cxx:438
bool bLSTbUIDSet
Definition: ww8par3.cxx:442
sal_uInt32 nIdLst
Definition: ww8par3.cxx:432
bool bUsedInDoc
Definition: ww8par3.cxx:440
WW8LFOInfo(const WW8LFO &rLFO)
Definition: ww8par3.cxx:447
sal_uInt8 nLfoLvl
Definition: ww8par3.cxx:433
std::vector< ww::bytes > maParaSprms
Definition: ww8par3.cxx:426
std::vector< WW8LFOLVL > maOverrides
Definition: ww8par3.cxx:427
WW8aCFormat aCharFormat
Definition: ww8par3.cxx:405
bool bSimpleList
Definition: ww8par3.cxx:409
bool bUsedInDoc
Definition: ww8par3.cxx:410
WW8LSTInfo(SwNumRule *pNumRule_, const WW8LST &aLST)
Definition: ww8par3.cxx:413
std::vector< ww::bytes > maParaSprms
Definition: ww8par3.cxx:403
sal_uInt32 nIdLst
Definition: ww8par3.cxx:408
WW8aIdSty aIdSty
Definition: ww8par3.cxx:404
SwNumRule * pNumRule
Definition: ww8par3.cxx:407
const sal_uInt8 * pMemPos
Definition: ww8scan.hxx:857
sal_uInt16 nSprmId
Definition: ww8scan.hxx:858
sal_Int32 lcb
Definition: ww8struc.hxx:446
SvxNumType
SVX_NUM_IROHA_FULLWIDTH_JA
SVX_NUM_NUMBER_NONE
SVX_NUM_CHARS_HEBREW
SVX_NUM_FULL_WIDTH_ARABIC
SVX_NUM_CHARS_LOWER_LETTER_N
SVX_NUM_CIRCLE_NUMBER
SVX_NUM_TIAN_GAN_ZH
SVX_NUM_AIU_FULLWIDTH_JA
SVX_NUM_CHARS_CYRILLIC_LOWER_LETTER_RU
SVX_NUM_NUMBER_TRADITIONAL_JA
SVX_NUM_NUMBER_UPPER_ZH_TW
SVX_NUM_HANGUL_SYLLABLE_KO
SVX_NUM_CHARS_ARABIC_ABJAD
SVX_NUM_NUMBER_UPPER_KO
SVX_NUM_IROHA_HALFWIDTH_JA
SVX_NUM_CHARS_NEPALI
SVX_NUM_ROMAN_UPPER
SVX_NUM_ROMAN_LOWER
SVX_NUM_SYMBOL_CHICAGO
SVX_NUM_TEXT_NUMBER
SVX_NUM_DI_ZI_ZH
SVX_NUM_ARABIC
SVX_NUM_HANGUL_JAMO_KO
SVX_NUM_TEXT_CARDINAL
SVX_NUM_CHARS_UPPER_LETTER_N
SVX_NUM_CHARS_ARABIC
SVX_NUM_NUMBER_UPPER_ZH
SVX_NUM_BITMAP
SVX_NUM_AIU_HALFWIDTH_JA
SVX_NUM_CHAR_SPECIAL
SVX_NUM_TEXT_ORDINAL
SVX_NUM_NUMBER_LOWER_ZH
SVX_NUM_CHARS_THAI
SVX_NUM_NUMBER_HEBREW
SVX_NUM_ARABIC_ZERO
SVX_NUM_CHARS_CYRILLIC_UPPER_LETTER_RU
SVX_NUM_NUMBER_HANGUL_KO
SvxAdjust
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:92
unsigned char sal_uInt8
sal_uInt16 sal_Unicode
sal_uInt32 sal_UCS4
oslFileHandle & pOut
const sal_uInt32 cbLSTF
Definition: ww8par3.cxx:348
void UseListIndent(SwWW8StyInf &rStyle, const SwNumFormat &rFormat)
Definition: ww8par3.cxx:1669
SwCharFormat * WW8aCFormat[WW8ListManager::nMaxLevel]
Definition: ww8par3.cxx:331
void SetStyleIndent(SwWW8StyInf &rStyle, const SwNumFormat &rFormat)
Definition: ww8par3.cxx:1684
static void lcl_AddToPropertyContainer(uno::Reference< beans::XPropertySet > const &xPropSet, const OUString &rPropertyName, const OUString &rValue)
Definition: ww8par3.cxx:2450
static bool IsEqualFormatting(const SwNumRule &rOne, const SwNumRule &rTwo)
Definition: ww8par3.cxx:1489
sal_uInt16 WW8aIdSty[WW8ListManager::nMaxLevel]
Definition: ww8par3.cxx:329
void SyncIndentWithList(SvxLRSpaceItem &rLR, const SwNumFormat &rFormat, const bool bFirstLineOfstSet, const bool bLeftIndentSet)
Definition: ww8par.cxx:1248
tools::Long GetListFirstLineIndent(const SwNumFormat &rFormat)
Definition: ww8par.cxx:1213
eF_ResT
Definition: ww8par.hxx:619
SwWw8ControlType
Definition: ww8par.hxx:637
@ WW8_CT_CHECKBOX
Definition: ww8par.hxx:639
@ WW8_CT_EDIT
Definition: ww8par.hxx:638
@ WW8_CT_DROPDOWN
Definition: ww8par.hxx:640
OUString read_uInt16_BeltAndBracesString(SvStream &rStrm)
Definition: ww8scan.cxx:2082
@ BOOK_FIELD
Definition: ww8scan.hxx:747
OUString read_uInt16_PascalString(SvStream &rStrm)
Definition: ww8scan.hxx:162
sal_Int32 WW8_CP
Definition: ww8struc.hxx:153