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);
1678 leftMargin.SetTextLeft(nAbsLSpace);
1679 firstLine.SetTextFirstLineOffset(writer_cast<short>(nListFirstLineIndent));
1680 rStyle.m_pFormat->SetFormatAttr(firstLine);
1681 rStyle.m_pFormat->SetFormatAttr(leftMargin);
1682 rStyle.m_bListRelevantIndentSet = true;
1683 }
1684}
1685
1686void SetStyleIndent(SwWW8StyInf &rStyle, const SwNumFormat &rFormat)
1687{
1689 return;
1690
1693 if (rStyle.m_bListRelevantIndentSet)
1694 {
1695
1696 SyncIndentWithList(firstLine, leftMargin, rFormat, false, false); // #i103711#, #i105414#
1697 }
1698 else
1699 {
1700 leftMargin.SetTextLeft(0);
1701 firstLine.SetTextFirstLineOffset(0);
1702 }
1703 rStyle.m_pFormat->SetFormatAttr(firstLine);
1704 rStyle.m_pFormat->SetFormatAttr(leftMargin);
1705}
1706
1707void SwWW8ImplReader::SetStylesList(sal_uInt16 nStyle, sal_uInt16 nCurrentLFO,
1708 sal_uInt8 nCurrentLevel)
1709{
1710 if (nStyle >= m_vColl.size())
1711 return;
1712
1713 SwWW8StyInf &rStyleInf = m_vColl[nStyle];
1714 if (!rStyleInf.m_bValid)
1715 return;
1716
1717 OSL_ENSURE(m_pCurrentColl, "Cannot be called outside of style import");
1718 // Phase 1: Numbering attributes when reading a StyleDef
1719 if( !m_pCurrentColl )
1720 return;
1721
1722 if (nCurrentLFO < USHRT_MAX)
1723 rStyleInf.m_nLFOIndex = nCurrentLFO;
1724 if (nCurrentLevel < MAXLEVEL)
1725 rStyleInf.m_nListLevel = nCurrentLevel;
1726
1727 // only save the Parameters for now. The actual List will be appended
1728 // at a later point, when the Listdefinitions is read...
1729 if (rStyleInf.m_nLFOIndex < USHRT_MAX && rStyleInf.m_nListLevel < WW8ListManager::nMaxLevel)
1730 {
1731 std::vector<sal_uInt8> aParaSprms;
1732 SwNumRule* pNmRule = m_xLstManager->GetNumRuleForActivation(
1733 rStyleInf.m_nLFOIndex, rStyleInf.m_nListLevel, aParaSprms);
1734 if (pNmRule)
1735 UseListIndent(rStyleInf, pNmRule->Get(rStyleInf.m_nListLevel));
1736 }
1737}
1738
1740{
1741
1742 if (nStyle >= m_vColl.size())
1743 return;
1744
1745 SwWW8StyInf &rStyleInf = m_vColl[nStyle];
1746 if (!(rStyleInf.m_bValid && rStyleInf.m_pFormat))
1747 return;
1748
1749 //Save old pre-list modified indent, which are the word indent values
1750 rStyleInf.m_pWordFirstLine.reset(rStyleInf.m_pFormat->GetFormatAttr(RES_MARGIN_FIRSTLINE).Clone());
1751 rStyleInf.m_pWordLeftMargin.reset(rStyleInf.m_pFormat->GetFormatAttr(RES_MARGIN_TEXTLEFT).Clone());
1752 rStyleInf.m_pWordRightMargin.reset(rStyleInf.m_pFormat->GetFormatAttr(RES_MARGIN_RIGHT).Clone());
1753
1754 // Phase 2: refresh StyleDef after reading all Lists
1755 if (rStyleInf.m_nLFOIndex >= USHRT_MAX || rStyleInf.m_nListLevel >= WW8ListManager::nMaxLevel)
1756 return;
1757
1758 std::vector<sal_uInt8> aParaSprms;
1759 SwNumRule* pNmRule = m_xLstManager->GetNumRuleForActivation(
1760 rStyleInf.m_nLFOIndex, rStyleInf.m_nListLevel, aParaSprms);
1761
1762 if (pNmRule != nullptr)
1763 {
1764 if (rStyleInf.IsWW8BuiltInHeadingStyle()
1765 && rStyleInf.HasWW8OutlineLevel())
1766 {
1767 rStyleInf.m_pOutlineNumrule = pNmRule;
1768 }
1769 else
1770 {
1771 rStyleInf.m_pFormat->SetFormatAttr(
1772 SwNumRuleItem(pNmRule->GetName()));
1773 rStyleInf.m_bHasStyNumRule = true;
1774 }
1775
1776 SetStyleIndent(rStyleInf, pNmRule->Get(rStyleInf.m_nListLevel));
1777 }
1778}
1779
1781 sal_uInt8 nCurrentLevel,
1782 const bool bSetAttr)
1783{
1784 // Note: the method appends NumRule to the Text Node if
1785 // bSetAttr (of course the lists have to be read before)
1786 // and only sets the Level. It does not check if there is a NumRule
1787 // attached to the STYLE !!!
1788
1789 if (!m_xLstManager) // are all list declarations read?
1790 return;
1791
1792 SwTextNode* pTextNd = m_pPaM->GetPointNode().GetTextNode();
1793 OSL_ENSURE(pTextNd, "No Text-Node at PaM-Position");
1794 if (!pTextNd)
1795 return;
1796
1797 // WW8ListManager::nMaxLevel indicates body text, cancelling an inherited numbering.
1798 if (nCurrentLFO < USHRT_MAX && nCurrentLevel == WW8ListManager::nMaxLevel)
1799 {
1800 pTextNd->SetAttr(SwNumRuleItem(OUString()));
1801 return;
1802 }
1803
1804 // Undefined listLevel is treated as the first level with valid numbering rule.
1805 // TODO:This doesn't allow for inheriting from a style(HOW?), but it matches previous behaviour.
1806 if (nCurrentLFO < USHRT_MAX && nCurrentLevel == MAXLEVEL)
1807 nCurrentLevel = 0;
1808
1809 std::vector<sal_uInt8> aParaSprms;
1810 const SwNumRule* pRule = bSetAttr ?
1811 m_xLstManager->GetNumRuleForActivation( nCurrentLFO, nCurrentLevel,
1812 aParaSprms, pTextNd) : nullptr;
1813
1814 if (pRule == nullptr && bSetAttr)
1815 return;
1816
1817 if (bSetAttr && pTextNd->GetNumRule() != pRule
1818 && (pTextNd->GetNumRule() != m_rDoc.GetOutlineNumRule()
1819 || pRule != m_pChosenWW8OutlineStyle))
1820 {
1821 // Now this is either not a part of Chapter Numbering,
1822 // or else it is using a different numRule than the one copied to Chapter Numbering.
1824 : pRule->GetName();
1825 pTextNd->SetAttr(SwNumRuleItem(sName));
1826 }
1827 pTextNd->SetAttrListLevel(nCurrentLevel);
1828
1829 // <IsCounted()> state of text node has to be adjusted accordingly.
1830 if ( /*nCurrentLevel >= 0 &&*/ nCurrentLevel < MAXLEVEL )
1831 {
1832 pTextNd->SetCountedInList( true );
1833 }
1834
1835 // #i99822#
1836 // Direct application of the list level formatting no longer
1837 // needed for list levels of mode LABEL_ALIGNMENT
1838 bool bApplyListLevelIndentDirectlyAtPara(true);
1839 {
1840 if (pTextNd->GetNumRule() && nCurrentLevel < MAXLEVEL)
1841 {
1842 const SwNumFormat& rFormat = pTextNd->GetNumRule()->Get(nCurrentLevel);
1843 if (rFormat.GetPositionAndSpaceMode()
1845 {
1846 bApplyListLevelIndentDirectlyAtPara = false;
1847 }
1848 }
1849 }
1850
1851 if (!bApplyListLevelIndentDirectlyAtPara)
1852 return;
1853
1854 auto pListIndent = std::make_unique<SfxItemSet>(m_rDoc.GetAttrPool(), svl::Items<RES_MARGIN_FIRSTLINE, RES_MARGIN_TEXTLEFT>);
1855 const SfxPoolItem *pItem;
1857 OSL_ENSURE(pItem, "impossible");
1858 if (pItem)
1859 pListIndent->Put(*pItem);
1861 if (pItem)
1862 pListIndent->Put(*pItem);
1863
1864 /*
1865 Take the original paragraph sprms attached to this list level
1866 formatting and apply them to the paragraph. I'm convinced that
1867 this is exactly what word does.
1868 */
1869 if (short nLen = static_cast< short >(aParaSprms.size()))
1870 {
1871 std::unique_ptr<SfxItemSet> pOldCurrentItemSet(SetCurrentItemSet(std::move(pListIndent)));
1872
1873 sal_uInt8* pSprms1 = aParaSprms.data();
1874 while (0 < nLen)
1875 {
1876 sal_uInt16 nL1 = ImportSprm(pSprms1, nLen);
1877 nLen = nLen - nL1;
1878 pSprms1 += nL1;
1879 }
1880
1881 pListIndent = SetCurrentItemSet(std::move(pOldCurrentItemSet));
1882 }
1883
1884 if (const SvxFirstLineIndentItem *const pFirstLine = pListIndent->GetItem<SvxFirstLineIndentItem>(RES_MARGIN_FIRSTLINE))
1885 {
1886 m_xCtrlStck->NewAttr(*m_pPaM->GetPoint(), *pFirstLine);
1888 }
1889 if (const SvxTextLeftMarginItem *const pLeftMargin = pListIndent->GetItem<SvxTextLeftMarginItem>(RES_MARGIN_TEXTLEFT))
1890 {
1891 m_xCtrlStck->NewAttr(*m_pPaM->GetPoint(), *pLeftMargin);
1893 }
1894}
1895
1896void SwWW8ImplReader::RegisterNumFormat(sal_uInt16 nCurrentLFO, sal_uInt8 nCurrentLevel)
1897{
1898 // Are we reading the StyleDef ?
1899 if (m_pCurrentColl)
1900 SetStylesList( m_nCurrentColl , nCurrentLFO, nCurrentLevel);
1901 else
1902 RegisterNumFormatOnTextNode(nCurrentLFO, nCurrentLevel);
1903}
1904
1905void SwWW8ImplReader::Read_ListLevel(sal_uInt16, const sal_uInt8* pData,
1906 short nLen)
1907{
1908 if (m_xPlcxMan && m_xPlcxMan->GetDoingDrawTextBox())
1909 return;
1910
1911 if( nLen < 0 )
1912 {
1913 // the current level is finished, what should we do ?
1915 if (m_xStyles && !m_bVer67)
1916 m_xStyles->mnWwNumLevel = 0;
1917 }
1918 else
1919 {
1920 // security check
1921 if( !pData )
1922 return;
1923
1924 // the Streamdata is zero based
1926
1927 if (m_xStyles && !m_bVer67)
1928 {
1929 /*
1930 if this is the case, then if the numbering is actually stored in
1931 winword 6 format, and its likely that sprmPIlvl has been abused
1932 to set the ww6 list level information which we will need when we
1933 reach the true ww6 list def. So set it now
1934 */
1935 m_xStyles->mnWwNumLevel = m_nListLevel;
1936 }
1937
1938 // Treat an invalid level as body-level
1941
1943 if (USHRT_MAX > m_nLFOPosition)
1944 {
1945 assert(false && "m_nLFOPosition is usually reset immediately, so we rarely ever get here.");
1946 m_nLFOPosition = USHRT_MAX;
1948 }
1949 }
1950}
1951
1952void SwWW8ImplReader::Read_LFOPosition(sal_uInt16, const sal_uInt8* pData,
1953 short nLen)
1954{
1955 if (m_xPlcxMan && m_xPlcxMan->GetDoingDrawTextBox())
1956 return;
1957
1958 if( nLen < 0 )
1959 {
1960 // the current level is finished, what should we do ?
1961 m_nLFOPosition = USHRT_MAX;
1963 }
1964 else
1965 {
1966 // security check
1967 if( !pData )
1968 return;
1969
1970 short nData = SVBT16ToUInt16( pData );
1971 if( 0 >= nData )
1972 {
1973 // disable the numbering/list style apply to the paragraph or the style
1974
1975 /*
1976 If you have a paragraph in word with left and/or hanging indent
1977 and remove its numbering, then the indentation appears to get
1978 reset, but not back to the base style, instead it goes to a blank
1979 setting.
1980 Unless it's a broken ww6 list in 97 in which case more hackery is
1981 required, some more details about broken ww6 list in
1982 ww8par6.cxx#SwWW8ImplReader::Read_LR
1983 */
1984
1985 if (m_pCurrentColl)
1986 {
1987 // here a "named" style is being configured
1988
1989 // disable the numbering/list in the style currently configured
1991
1992 // reset/blank the indent
1996
1997 // These sprmPIlfos are supposed to indicate "cancel" numbering.
1998 // Since m_nLFOPosition is "data - 1", then zero becomes USHRT_MAX
1999 // which is no good since that indicates "unspecified, available for inheritance".
2000 // So instead use USHRT_MAX-1 for indicating an explicit "cancel numbering".
2001 RegisterNumFormat(USHRT_MAX-1, MAXLEVEL);
2002 }
2003 else if (SwTextNode* pTextNode = m_pPaM->GetPointNode().GetTextNode())
2004 {
2005 // here a paragraph is being directly formatted
2006
2007 // empty the numbering/list style applied to the current paragraph
2008 SwNumRuleItem aEmptyRule;
2009 pTextNode->SetAttr( aEmptyRule );
2010
2011 // create an empty SvxLRSpaceItem
2012 std::shared_ptr<SvxFirstLineIndentItem> pFirstLine(std::make_shared<SvxFirstLineIndentItem>(RES_MARGIN_FIRSTLINE));
2013
2014 // replace it with the one of the current node if it exist
2015 const SfxPoolItem *const pItem = GetFormatAttr(RES_MARGIN_FIRSTLINE);
2016 if (pItem)
2017 {
2018 pFirstLine.reset(static_cast<SvxFirstLineIndentItem*>(pItem->Clone()));
2019 }
2020
2021 // reset/blank the left indent (and only the left)
2022 pFirstLine->SetTextFirstLineOffset(0);
2024
2025 // apply the modified SvxLRSpaceItem to the current paragraph
2026 pTextNode->SetAttr(*pFirstLine);
2027 pTextNode->SetAttr(leftMargin);
2028 }
2029
2030 m_nLFOPosition = USHRT_MAX;
2031 }
2032 else // nData in (0..0x7FFF]
2033 {
2034 m_nLFOPosition = o3tl::narrowing<sal_uInt16>(nData)-1; // m_nLFOPosition in [0..0x7FFF)
2035 /*
2036 If we are a ww8+ style with ww7- style lists then there is a
2037 bizarre broken word bug where when the list is removed from a para
2038 the ww6 list first line indent still affects the first line
2039 indentation. Setting this flag will allow us to recover from this
2040 braindeadness
2041 */
2042 if (m_pCurrentColl && (m_nLFOPosition == 2047-1) && m_nCurrentColl < m_vColl.size())
2043 m_vColl[m_nCurrentColl].m_bHasBrokenWW6List = true;
2044
2045 // here the stream data is 1-based, we subtract ONE
2046 if (m_nLFOPosition != 2047-1) //Normal ww8+ list behaviour
2047 {
2049 m_nLFOPosition = USHRT_MAX;
2051 }
2052 else if (m_xPlcxMan && m_xPlcxMan->HasParaSprm(NS_sprm::LN_PAnld).pSprm)
2053 {
2054 /*
2055 #i8114# Horrific backwards compatible ww7- lists in ww8+
2056 docs
2057 */
2058 m_nListLevel = std::min<sal_uInt8>(WW8ListManager::nMaxLevel, m_nListLevel);
2059 Read_ANLevelNo(13 /*equiv ww7- sprm no*/, &m_nListLevel, 1);
2060 }
2061 }
2062 }
2063}
2064
2065// Reading Controls
2066
2068 WW8_CP nStart, SwWw8ControlType nWhich )
2069{
2070 bool bRet=false;
2071 /*
2072 * Save the reader state and process the sprms for this anchor cp.
2073 * Doing so will set the nPicLocFc to the offset to find the hypertext
2074 * data in the data stream.
2075 */
2076 WW8_CP nEndCp = nStart+1; //Only interested in the single 0x01 character
2077
2078 WW8ReaderSave aSave(this,nStart);
2079
2080 WW8PLCFManResult aRes;
2081 nStart = m_xPlcxMan->Where();
2082 while(nStart <= nEndCp)
2083 {
2084 if ( m_xPlcxMan->Get(&aRes)
2085 && aRes.pMemPos && aRes.nSprmId )
2086 {
2087 //only interested in sprms which would set nPicLocFc
2088 if ( (68 == aRes.nSprmId) || (0x6A03 == aRes.nSprmId) )
2089 {
2090 Read_PicLoc( aRes.nSprmId, aRes.pMemPos +
2091 m_oSprmParser->DistanceToData(aRes.nSprmId), 4);
2092 break;
2093 }
2094 }
2095 m_xPlcxMan->advance();
2096 nStart = m_xPlcxMan->Where();
2097 }
2098 sal_uLong nOffset = m_nPicLocFc;
2099 aSave.Restore(this);
2100
2101 sal_uInt64 nOldPos = m_pDataStream->Tell();
2102 WW8_PIC aPic;
2103 bool bValid = checkSeek(*m_pDataStream, nOffset) &&
2105
2106 if (bValid && aPic.lcb > 0x3A)
2107 {
2108 aFormula.FormulaRead(nWhich,m_pDataStream);
2109 bRet = true;
2110 }
2111
2112 /*
2113 There is a problem with aPic, the WW8_PIC is always used even though it
2114 is too big for the WW95 files, it needs to be modified to check the
2115 version C.
2116 */
2117 m_pDataStream->Seek( nOldPos );
2118 return bRet;
2119}
2120
2122{
2123 const uno::Reference< lang::XMultiServiceFactory > & rServiceFactory =
2124 GetServiceFactory();
2125
2126 if(!rServiceFactory.is())
2127 return;
2128
2129 awt::Size aSz;
2130 uno::Reference< form::XFormComponent> xFComp;
2131
2132 if (rFormula.Import(rServiceFactory, xFComp, aSz))
2133 {
2134 uno::Reference <drawing::XShape> xShapeRef;
2135 if (InsertControl(xFComp, aSz, &xShapeRef, false))
2136 GetShapes()->add(xShapeRef);
2137 }
2138}
2139
2141 SvStream *pDataStream)
2142{
2143 sal_uInt8 nField;
2144
2145 // The following is a FFData structure as described in
2146 // Microsoft's DOC specification (chapter 2.9.78)
2147 sal_uInt32 nVersion = 0;
2148 pDataStream->ReadUInt32(nVersion);
2149 // An unsigned integer that MUST be 0xFFFFFFFF
2150 if (nVersion != 0xFFFFFFFF)
2151 {
2152 SAL_WARN("sw.ww8", "Parsing error: invalid header for FFData");
2153 return; // bail out
2154 }
2155
2156 // might be better to read the bits as a 16 bit word
2157 // ( like it is in the spec. )
2158 sal_uInt8 bits1 = 0;
2159 pDataStream->ReadUChar( bits1 );
2160 sal_uInt8 bits2 = 0;
2161 pDataStream->ReadUChar( bits2 );
2162
2163 sal_uInt8 iType = ( bits1 & 0x3 );
2164
2165 // we should verify that bits.iType & nWhich concur
2166 OSL_ENSURE( iType == nWhich, "something wrong, expect control type read from stream doesn't match nWhich passed in");
2167 if ( iType != nWhich )
2168 return; // bail out
2169
2170 sal_uInt8 iRes = (bits1 & 0x7C) >> 2;
2171
2172 pDataStream->ReadUInt16( mnMaxLen );
2173
2174 sal_uInt16 hps = 0;
2175 pDataStream->ReadUInt16( hps );
2176
2177 // xstzName
2179
2180 if (nWhich == WW8_CT_EDIT)
2181 { // Field is a textbox
2182 // Default text
2183 // xstzTextDef
2185 }
2186 else
2187 {
2188 // CheckBox or ComboBox
2189 sal_uInt16 wDef = 0;
2190 pDataStream->ReadUInt16( wDef );
2191 mnChecked = wDef; // default
2192 if (nWhich == WW8_CT_CHECKBOX)
2193 {
2194 if ( iRes != 25 )
2195 mnChecked = iRes;
2196 msDefault = ( wDef == 0 ) ? std::u16string_view( u"0" ) : std::u16string_view( u"1" );
2197 }
2198 }
2199 // xstzTextFormat
2201 // xstzHelpText
2203 // xstzStatText
2205
2206 // xstzEntryMcr
2208 //xstzExitMcr
2210
2211 if (nWhich == WW8_CT_DROPDOWN)
2212 {
2213 bool bAllOk = true;
2214 // SSTB (see Spec. 2.2.4)
2215 sal_uInt16 fExtend = 0;
2216 pDataStream->ReadUInt16( fExtend );
2217 sal_uInt16 nStringsCnt = 0;
2218
2219 // Isn't it that if fExtend isn't 0xFFFF then fExtend actually
2220 // doesn't exist and we really have just read nStringsCnt ( or cData )?
2221 if (fExtend != 0xFFFF)
2222 bAllOk = false;
2223 pDataStream->ReadUInt16( nStringsCnt );
2224
2225 // I guess this should be zero ( and we should ensure that )
2226 sal_uInt16 cbExtra = 0;
2227 pDataStream->ReadUInt16( cbExtra );
2228
2229 OSL_ENSURE(bAllOk, "Unknown formfield dropdown list structure");
2230 if (!bAllOk) //Not as expected, don't risk it at all.
2231 nStringsCnt = 0;
2232 const size_t nMinRecordSize = sizeof(sal_uInt16);
2233 const size_t nMaxRecords = pDataStream->remainingSize() / nMinRecordSize;
2234 if (nStringsCnt > nMaxRecords)
2235 {
2236 SAL_WARN("sw.ww8", "Parsing error: " << nMaxRecords <<
2237 " max possible entries, but " << nStringsCnt << " claimed, truncating");
2238 nStringsCnt = nMaxRecords;
2239 }
2240 maListEntries.reserve(nStringsCnt);
2241 for (sal_uInt32 nI = 0; nI < nStringsCnt; ++nI)
2242 {
2243 OUString sEntry = read_uInt16_PascalString(*pDataStream);
2244 maListEntries.push_back(sEntry);
2245 }
2246 }
2247 mfDropdownIndex = iRes;
2248
2249 mbHelp = bits1 & 0x80;
2250
2251 nField = bits2;
2252 mfToolTip = nField & 0x01;
2253 mfNoMark = (nField & 0x02)>>1;
2254 mfType = (nField & 0x38)>>3;
2255 mfUnused = (nField & 0xE0)>>5;
2256}
2257
2260{
2261}
2262
2263//Miserable hack to get a hardcoded guesstimate of the size of a list dropdown
2264//box's first entry to set as the lists default size
2265awt::Size SwWW8ImplReader::MiserableDropDownFormHack(const OUString &rString,
2266 uno::Reference<beans::XPropertySet> const & rPropSet)
2267{
2268 awt::Size aRet;
2269 struct CtrlFontMapEntry
2270 {
2271 sal_uInt16 nWhichId;
2272 const char* pPropNm;
2273 };
2274 const CtrlFontMapEntry aMapTable[] =
2275 {
2276 { RES_CHRATR_COLOR, "TextColor" },
2277 { RES_CHRATR_FONT, "FontName" },
2278 { RES_CHRATR_FONTSIZE, "FontHeight" },
2279 { RES_CHRATR_WEIGHT, "FontWeight" },
2280 { RES_CHRATR_UNDERLINE, "FontUnderline" },
2281 { RES_CHRATR_CROSSEDOUT, "FontStrikeout" },
2282 { RES_CHRATR_POSTURE, "FontSlant" },
2283 { 0, nullptr }
2284 };
2285
2286 vcl::Font aFont;
2287 uno::Reference< beans::XPropertySetInfo > xPropSetInfo =
2288 rPropSet->getPropertySetInfo();
2289
2290 uno::Any aTmp;
2291 for (const CtrlFontMapEntry* pMap = aMapTable; pMap->nWhichId; ++pMap)
2292 {
2293 bool bSet = true;
2294 const SfxPoolItem* pItem = GetFormatAttr( pMap->nWhichId );
2295 OSL_ENSURE(pItem, "Impossible");
2296 if (!pItem)
2297 continue;
2298
2299 switch ( pMap->nWhichId )
2300 {
2301 case RES_CHRATR_COLOR:
2302 {
2303 OUString aNm;
2304 if (xPropSetInfo->hasPropertyByName(aNm = "TextColor"))
2305 {
2306 aTmp <<= static_cast<sal_Int32>(static_cast<const SvxColorItem*>(pItem)->GetValue());
2307 rPropSet->setPropertyValue(aNm, aTmp);
2308 }
2309 }
2310 aFont.SetColor(static_cast<const SvxColorItem*>(pItem)->GetValue());
2311 break;
2312 case RES_CHRATR_FONT:
2313 {
2314 const SvxFontItem *pFontItem = static_cast<const SvxFontItem *>(pItem);
2315 OUString aNm;
2316 if (xPropSetInfo->hasPropertyByName(aNm = "FontStyleName"))
2317 {
2318 aTmp <<= pFontItem->GetStyleName();
2319 rPropSet->setPropertyValue( aNm, aTmp );
2320 }
2321 if (xPropSetInfo->hasPropertyByName(aNm = "FontFamily"))
2322 {
2323 aTmp <<= static_cast<sal_Int16>(pFontItem->GetFamily());
2324 rPropSet->setPropertyValue( aNm, aTmp );
2325 }
2326 if (xPropSetInfo->hasPropertyByName(aNm = "FontCharset"))
2327 {
2328 aTmp <<= static_cast<sal_Int16>(pFontItem->GetCharSet());
2329 rPropSet->setPropertyValue( aNm, aTmp );
2330 }
2331 if (xPropSetInfo->hasPropertyByName(aNm = "FontPitch"))
2332 {
2333 aTmp <<= static_cast<sal_Int16>(pFontItem->GetPitch());
2334 rPropSet->setPropertyValue( aNm, aTmp );
2335 }
2336
2337 aTmp <<= pFontItem->GetFamilyName();
2338 aFont.SetFamilyName( pFontItem->GetFamilyName() );
2339 aFont.SetStyleName( pFontItem->GetStyleName() );
2340 aFont.SetFamily( pFontItem->GetFamily() );
2341 aFont.SetCharSet( pFontItem->GetCharSet() );
2342 aFont.SetPitch( pFontItem->GetPitch() );
2343 }
2344 break;
2345
2347 {
2348 Size aSize( aFont.GetFontSize().Width(),
2349 static_cast<const SvxFontHeightItem*>(pItem)->GetHeight() );
2350 aTmp <<= static_cast<float>(aSize.Height()) / 20.0;
2351
2353 }
2354 break;
2355
2356 case RES_CHRATR_WEIGHT:
2358 static_cast<const SvxWeightItem*>(pItem)->GetWeight() );
2359 aFont.SetWeight( static_cast<const SvxWeightItem*>(pItem)->GetWeight() );
2360 break;
2361
2363 aTmp <<= static_cast<sal_Int16>(static_cast<const SvxUnderlineItem*>(pItem)->GetLineStyle());
2364 aFont.SetUnderline(static_cast<const SvxUnderlineItem*>(pItem)->GetLineStyle());
2365 break;
2366
2368 aTmp <<= static_cast<sal_Int16>( static_cast<const SvxCrossedOutItem*>(pItem)->GetStrikeout() );
2369 aFont.SetStrikeout( static_cast<const SvxCrossedOutItem*>(pItem)->GetStrikeout() );
2370 break;
2371
2372 case RES_CHRATR_POSTURE:
2373 aTmp <<= static_cast<sal_Int16>( static_cast<const SvxPostureItem*>(pItem)->GetPosture() );
2374 aFont.SetItalic( static_cast<const SvxPostureItem*>(pItem)->GetPosture() );
2375 break;
2376
2377 default:
2378 bSet = false;
2379 break;
2380 }
2381
2382 if (bSet && xPropSetInfo->hasPropertyByName(OUString::createFromAscii(pMap->pPropNm)))
2383 rPropSet->setPropertyValue(OUString::createFromAscii(pMap->pPropNm), aTmp);
2384 }
2385 // now calculate the size of the control
2387 OSL_ENSURE(pOut, "Impossible");
2388 if (pOut)
2389 {
2391 pOut->SetMapMode( MapMode( MapUnit::Map100thMM ));
2392 pOut->SetFont( aFont );
2393 aRet.Width = pOut->GetTextWidth(rString);
2394 aRet.Width += 500; //plus size of button, total hack territory
2395 aRet.Height = pOut->GetTextHeight();
2396 pOut->Pop();
2397 }
2398 return aRet;
2399}
2400
2401bool WW8FormulaListBox::Import(const uno::Reference <
2402 lang::XMultiServiceFactory> &rServiceFactory,
2403 uno::Reference <form::XFormComponent> &rFComp,awt::Size &rSz )
2404{
2405 uno::Reference<uno::XInterface> xCreate = rServiceFactory->createInstance("com.sun.star.form.component.ComboBox");
2406 if( !xCreate.is() )
2407 return false;
2408
2409 rFComp.set(xCreate, uno::UNO_QUERY);
2410 if( !rFComp.is() )
2411 return false;
2412
2413 uno::Reference<beans::XPropertySet> xPropSet(xCreate, uno::UNO_QUERY);
2414
2415 uno::Any aTmp;
2416 if (!msTitle.isEmpty())
2417 aTmp <<= msTitle;
2418 else
2419 aTmp <<= msName;
2420 xPropSet->setPropertyValue("Name", aTmp );
2421
2422 if (!msToolTip.isEmpty())
2423 {
2424 aTmp <<= msToolTip;
2425 xPropSet->setPropertyValue("HelpText", aTmp );
2426 }
2427
2428 xPropSet->setPropertyValue("Dropdown", css::uno::Any(true));
2429
2430 if (!maListEntries.empty())
2431 {
2432 sal_uInt32 nLen = maListEntries.size();
2433 uno::Sequence< OUString > aListSource(nLen);
2434 auto aListSourceRange = asNonConstRange(aListSource);
2435 for (sal_uInt32 nI = 0; nI < nLen; ++nI)
2436 aListSourceRange[nI] = maListEntries[nI];
2437 aTmp <<= aListSource;
2438 xPropSet->setPropertyValue("StringItemList", aTmp );
2439
2440 if (mfDropdownIndex < nLen)
2441 {
2442 aTmp <<= aListSource[mfDropdownIndex];
2443 }
2444 else
2445 {
2446 aTmp <<= aListSource[0];
2447 }
2448
2449 xPropSet->setPropertyValue("DefaultText", aTmp );
2450
2451 rSz = mrRdr.MiserableDropDownFormHack(maListEntries[0], xPropSet);
2452 }
2453 else
2454 {
2455 static constexpr OUStringLiteral aBlank =
2456 u"\u2002\u2002\u2002\u2002\u2002";
2457 rSz = mrRdr.MiserableDropDownFormHack(aBlank, xPropSet);
2458 }
2459
2460 return true;
2461}
2462
2465{
2466}
2467
2469(uno::Reference<beans::XPropertySet> const & xPropSet,
2470 const OUString & rPropertyName, const OUString & rValue)
2471{
2472 uno::Reference<beans::XPropertySetInfo> xPropSetInfo =
2473 xPropSet->getPropertySetInfo();
2474 if (xPropSetInfo.is() &&
2475 ! xPropSetInfo->hasPropertyByName(rPropertyName))
2476 {
2477 uno::Reference<beans::XPropertyContainer>
2478 xPropContainer(xPropSet, uno::UNO_QUERY);
2479 uno::Any aAny((OUString()));
2480 xPropContainer->addProperty
2481 (rPropertyName,
2482 static_cast<sal_Int16>(beans::PropertyAttribute::BOUND |
2483 beans::PropertyAttribute::REMOVABLE),
2484 aAny);
2485 }
2486
2487 uno::Any aAnyValue(rValue);
2488 xPropSet->setPropertyValue(rPropertyName, aAnyValue );
2489}
2490
2491bool WW8FormulaCheckBox::Import(const uno::Reference <
2492 lang::XMultiServiceFactory> &rServiceFactory,
2493 uno::Reference <form::XFormComponent> &rFComp,awt::Size &rSz )
2494{
2495 uno::Reference< uno::XInterface > xCreate = rServiceFactory->createInstance("com.sun.star.form.component.CheckBox");
2496 if( !xCreate.is() )
2497 return false;
2498
2499 rFComp.set( xCreate, uno::UNO_QUERY );
2500 if( !rFComp.is() )
2501 return false;
2502
2503 uno::Reference< beans::XPropertySet > xPropSet( xCreate, uno::UNO_QUERY );
2504
2505 rSz.Width = 16 * mhpsCheckBox;
2506 rSz.Height = 16 * mhpsCheckBox;
2507
2508 uno::Any aTmp;
2509 if (!msTitle.isEmpty())
2510 aTmp <<= msTitle;
2511 else
2512 aTmp <<= msName;
2513 xPropSet->setPropertyValue("Name", aTmp );
2514
2515 aTmp <<= static_cast<sal_Int16>(mnChecked);
2516 xPropSet->setPropertyValue("DefaultState", aTmp);
2517
2518 if (!msToolTip.isEmpty())
2519 lcl_AddToPropertyContainer(xPropSet, "HelpText", msToolTip);
2520
2521 if (!msHelp.isEmpty())
2522 lcl_AddToPropertyContainer(xPropSet, "HelpF1Text", msHelp);
2523
2524 return true;
2525
2526}
2527
2530{
2531}
2532
2534 const uno::Reference< form::XFormComponent > & rFComp,
2535 const awt::Size& rSize, uno::Reference< drawing::XShape > *pShape,
2536 bool bFloatingCtrl)
2537{
2538 const uno::Reference< container::XIndexContainer > &rComps = GetFormComps();
2540 rComps->insertByIndex( rComps->getCount(), aTmp );
2541
2542 const uno::Reference< lang::XMultiServiceFactory > &rServiceFactory =
2543 GetServiceFactory();
2544 if( !rServiceFactory.is() )
2545 return false;
2546
2547 uno::Reference< uno::XInterface > xCreate = rServiceFactory->createInstance(
2548 "com.sun.star.drawing.ControlShape");
2549 if( !xCreate.is() )
2550 return false;
2551
2552 uno::Reference< drawing::XShape > xShape(xCreate, uno::UNO_QUERY);
2553
2554 OSL_ENSURE(xShape.is(), "Did not get XShape");
2555 xShape->setSize(rSize);
2556
2557 uno::Reference< beans::XPropertySet > xShapePropSet(
2558 xCreate, uno::UNO_QUERY );
2559
2560 //I lay a small bet that this will change to
2561 //sal_Int16 nTemp=TextContentAnchorType::AS_CHARACTER;
2562 text::TextContentAnchorType nTemp;
2563 if (bFloatingCtrl)
2564 nTemp = text::TextContentAnchorType_AT_PARAGRAPH;
2565 else
2566 nTemp = text::TextContentAnchorType_AS_CHARACTER;
2567
2568 xShapePropSet->setPropertyValue("AnchorType", uno::Any(static_cast<sal_Int16>(nTemp)) );
2569
2570 xShapePropSet->setPropertyValue("VertOrient", uno::Any(sal_Int16(text::VertOrientation::TOP)) );
2571
2572 uno::Reference< text::XText > xDummyTextRef;
2573 uno::Reference< text::XTextRange > xTextRg =
2574 new SwXTextRange( *m_pPaM, xDummyTextRef );
2575
2576 aTmp <<= xTextRg;
2577 xShapePropSet->setPropertyValue("TextRange", aTmp );
2578
2579 // Set the Control-Model for the Control-Shape
2580 uno::Reference< drawing::XControlShape > xControlShape( xShape,
2581 uno::UNO_QUERY );
2582 uno::Reference< awt::XControlModel > xControlModel( rFComp,
2583 uno::UNO_QUERY );
2584 xControlShape->setControl( xControlModel );
2585
2586 if (pShape)
2587 *pShape = xShape;
2588
2589 return true;
2590}
2591
2592/* 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
void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp=100)
sal_uInt32 GetHeight() const
FontFamily GetFamily() const
FontPitch GetPitch() const
const OUString & GetStyleName() const
rtl_TextEncoding GetCharSet() const
const OUString & GetFamilyName() const
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
void SetTextLeft(const tools::Long nL, const sal_uInt16 nProp=100)
Represents the style of a text portion.
Definition: charfmt.hxx:27
const SwCharFormat * GetDfltCharFormat() const
Definition: doc.hxx:768
OUString GetUniqueNumRuleName(const OUString *pChkStr=nullptr, bool bAutoNum=true) const
Definition: docnum.cxx:2532
const SwNumRuleTable & GetNumRuleTable() const
Definition: doc.hxx:1081
SwNumRule * GetOutlineNumRule() const
Definition: doc.hxx:1039
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:329
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:371
IDocumentMarkAccess * getIDocumentMarkAccess()
Definition: docbm.cxx:1890
bool DelNumRule(const OUString &rName, bool bBroadCast=false)
Definition: docnum.cxx:1055
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1337
SwCharFormat * MakeCharFormat(const OUString &rFormatName, SwCharFormat *pDerivedFrom, bool bBroadcast=false)
Definition: docfmt.cxx:863
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:1100
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:2488
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:1417
void SetHelp(const OUString &rStr)
Definition: expfld.cxx:1407
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:2533
void InsertFormula(WW8FormulaControl &rFormula)
Definition: ww8par3.cxx:2121
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:901
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:188
SwNode & GetPointNode() const
Definition: pam.hxx:275
const SwPosition * GetPoint() const
Definition: pam.hxx:253
Represents the style of a paragraph.
Definition: fmtcol.hxx:61
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:112
void SetAttrListLevel(int nLevel)
Sets the list level of this text node.
Definition: ndtxt.cxx:4218
void SetListRestart(bool bRestart)
Definition: ndtxt.cxx:4257
virtual bool SetAttr(const SfxPoolItem &) override
overriding to handle change of certain paragraph attributes
Definition: ndtxt.cxx:5066
void SetCountedInList(bool bCounted)
Definition: ndtxt.cxx:4378
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
Definition: ndtxt.cxx:2921
void SetAttrListRestartValue(SwNumberTree::tSwNumTreeNumber nNum)
Definition: ndtxt.cxx:4306
virtual bool ResetAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0) override
Definition: ndtxt.cxx:5293
SwPaM * m_pPaM
Definition: ww8par.hxx:1133
sal_uInt16 m_nLFOPosition
Definition: ww8par.hxx:1329
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:2265
SwDocShell * m_pDocShell
Definition: ww8par.hxx:1110
std::vector< SwWW8StyInf > m_vColl
Definition: ww8par.hxx:1273
void Read_ANLevelNo(sal_uInt16, const sal_uInt8 *pData, short nLen)
Definition: ww8par2.cxx:720
std::unique_ptr< SwMSConvertControls > m_xFormImpl
Definition: ww8par.hxx:1235
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:1135
eF_ResT Read_F_HTMLControl(WW8FieldDesc *pF, OUString &rStr)
Definition: ww8par3.cxx:318
SwDoc & m_rDoc
Definition: ww8par.hxx:1131
bool ImportFormulaControl(WW8FormulaControl &rBox, WW8_CP nStart, SwWw8ControlType nWhich)
Definition: ww8par3.cxx:2067
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:1952
sal_uInt16 GetToggleAttrFlags() const
Definition: ww8par.cxx:578
sal_uInt16 m_nCurrentColl
Definition: ww8par.hxx:1327
void SetNCurrentColl(sal_uInt16 nColl)
Definition: ww8par.hxx:1923
sal_uInt8 m_nListLevel
Definition: ww8par.hxx:1343
void Read_ListLevel(sal_uInt16 nId, const sal_uInt8 *pData, short nLen)
Definition: ww8par3.cxx:1905
sal_uInt16 StyleUsingLFO(sal_uInt16 nLFOIndex) const
Definition: ww8par2.cxx:3540
std::shared_ptr< WW8PLCFMan > m_xPlcxMan
Definition: ww8par.hxx:1262
sal_uInt16 GetToggleBiDiAttrFlags() const
Definition: ww8par.cxx:583
void RegisterNumFormat(sal_uInt16 nCurrentLFO, sal_uInt8 nCurrentLevel)
Definition: ww8par3.cxx:1896
void SetToggleAttrFlags(sal_uInt16 nFlags)
Definition: ww8par.cxx:588
std::deque< WW8FieldEntry > m_aFieldStack
Definition: ww8par.hxx:1176
SvStream * m_pDataStream
Definition: ww8par.hxx:1128
const SwNumRule * m_pChosenWW8OutlineStyle
Definition: ww8par.hxx:1342
bool IsRightToLeft()
Definition: ww8par6.cxx:4704
bool IsInvalidOrToBeMergedTabCell() const
Definition: ww8par2.cxx:3521
sal_uLong m_nObjLocFc
Definition: ww8par.hxx:1318
void Read_PicLoc(sal_uInt16, const sal_uInt8 *pData, short nLen)
Definition: ww8par6.cxx:2950
std::unique_ptr< WW8ListManager > m_xLstManager
Definition: ww8par.hxx:1260
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:1707
void RegisterNumFormatOnTextNode(sal_uInt16 nCurrentLFO, sal_uInt8 nCurrentLevel, const bool bSetAttr=true)
Definition: ww8par3.cxx:1780
SwFormat * m_pCurrentColl
Definition: ww8par.hxx:1269
std::unique_ptr< WW8RStyle > m_xStyles
Definition: ww8par.hxx:1268
sal_uInt16 GetCurrentColl() const
Definition: ww8par.hxx:1922
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::optional< wwSprmParser > m_oSprmParser
Definition: ww8par.hxx:1211
std::unique_ptr< SfxItemSet > SetCurrentItemSet(std::unique_ptr< SfxItemSet > pItemSet)
Definition: ww8par.cxx:6744
bool SetTextFormatCollAndListLevel(const SwPaM &rRg, SwWW8StyInf &rStyleInfo)
Definition: ww8par3.cxx:1635
void RegisterNumFormatOnStyle(sal_uInt16 nStyle)
Definition: ww8par3.cxx:1739
const SfxPoolItem * GetFormatAttr(sal_uInt16 nWhich)
Definition: ww8par6.cxx:2880
short ImportSprm(const sal_uInt8 *pPos, sal_Int32 nMemLen, sal_uInt16 nId=0)
Definition: ww8par6.cxx:6256
sal_uLong m_nPicLocFc
Definition: ww8par.hxx:1317
bool m_bListRelevantIndentSet
Definition: ww8par.hxx:261
SwNumRule * m_pOutlineNumrule
Definition: ww8par.hxx:235
std::shared_ptr< SvxRightMarginItem > m_pWordRightMargin
Definition: ww8par.hxx:254
bool m_bColl
Definition: ww8par.hxx:257
bool IsWW8BuiltInHeadingStyle() const
Definition: ww8par.hxx:341
bool HasWW8OutlineLevel() const
Definition: ww8par.hxx:319
std::shared_ptr< SvxFirstLineIndentItem > m_pWordFirstLine
Definition: ww8par.hxx:252
sal_uInt8 m_nListLevel
Definition: ww8par.hxx:240
SwFormat * m_pFormat
Definition: ww8par.hxx:233
std::shared_ptr< SvxTextLeftMarginItem > m_pWordLeftMargin
Definition: ww8par.hxx:253
bool m_bHasStyNumRule
Definition: ww8par.hxx:259
sal_uInt16 m_nLFOIndex
Definition: ww8par.hxx:239
bool m_bValid
Definition: ww8par.hxx:255
sal_Int32 m_lcbPlfLfo
Definition: ww8scan.hxx:1465
WW8_FC m_fcPlfLfo
Definition: ww8scan.hxx:1464
sal_uInt8 m_nVersion
Program-Version asked for by us: in Ctor we check if it matches the value of nFib.
Definition: ww8scan.hxx:1119
sal_Int32 m_lcbPlcfLst
Definition: ww8scan.hxx:1463
WW8_FC m_fcPlcfLst
Definition: ww8scan.hxx:1462
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:2491
WW8FormulaCheckBox(const WW8FormulaCheckBox &)=delete
sal_uInt16 mnChecked
Definition: ww8par.hxx:671
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:666
sal_uInt8 mfType
Definition: ww8par.hxx:667
OUString msName
Definition: ww8par.hxx:689
sal_uInt16 mnMaxLen
FFData.cch in the spec: maximum length, in characters, of the value of the textbox.
Definition: ww8par.hxx:674
sal_uInt8 mfToolTip
Definition: ww8par.hxx:665
std::vector< OUString > maListEntries
Definition: ww8par.hxx:683
OUString msDefault
Definition: ww8par.hxx:676
OUString msExitMcr
Definition: ww8par.hxx:682
OUString msEntryMcr
Definition: ww8par.hxx:681
OUString msTitle
Definition: ww8par.hxx:675
SwWW8ImplReader & mrRdr
Definition: ww8par.hxx:650
sal_uInt8 mfUnused
Definition: ww8par.hxx:668
OUString msToolTip
Definition: ww8par.hxx:680
OUString msHelp
Definition: ww8par.hxx:679
sal_uInt16 mhpsCheckBox
Definition: ww8par.hxx:670
void FormulaRead(SwWw8ControlType nWhich, SvStream *pD)
Definition: ww8par3.cxx:2140
sal_uInt8 mfDropdownIndex
Definition: ww8par.hxx:664
OUString msFormatting
Definition: ww8par.hxx:677
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:2401
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:2113
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:1228
float u
#define ERRCODE_NONE
sal_Int16 nVersion
@ INP_TXT
Definition: fldbas.hxx:222
OUString sName
constexpr TypedWhichId< SvxCrossedOutItem > RES_CHRATR_CROSSEDOUT(5)
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
constexpr TypedWhichId< SvxFirstLineIndentItem > RES_MARGIN_FIRSTLINE(91)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
constexpr TypedWhichId< SvxRightMarginItem > RES_MARGIN_RIGHT(93)
constexpr TypedWhichId< SvxTextLeftMarginItem > RES_MARGIN_TEXTLEFT(92)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
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:147
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 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:1372
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:1686
static void lcl_AddToPropertyContainer(uno::Reference< beans::XPropertySet > const &xPropSet, const OUString &rPropertyName, const OUString &rValue)
Definition: ww8par3.cxx:2469
static bool IsEqualFormatting(const SwNumRule &rOne, const SwNumRule &rTwo)
Definition: ww8par3.cxx:1489
sal_uInt16 WW8aIdSty[WW8ListManager::nMaxLevel]
Definition: ww8par3.cxx:329
void SyncIndentWithList(SvxFirstLineIndentItem &rFirstLine, SvxTextLeftMarginItem &rLeftMargin, const SwNumFormat &rFormat, const bool bFirstLineOfstSet, const bool bLeftIndentSet)
Definition: ww8par.cxx:1249
tools::Long GetListFirstLineIndent(const SwNumFormat &rFormat)
Definition: ww8par.cxx:1213
eF_ResT
Definition: ww8par.hxx:623
SwWw8ControlType
Definition: ww8par.hxx:641
@ WW8_CT_CHECKBOX
Definition: ww8par.hxx:643
@ WW8_CT_EDIT
Definition: ww8par.hxx:642
@ WW8_CT_DROPDOWN
Definition: ww8par.hxx:644
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