LibreOffice Module sw (master) 1
ww8atr.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/*
21 * This file contains methods for the WW8 output
22 * (nodes, attributes, formats and chars).
23 */
24
25
26#include <algorithm>
27#include <hintids.hxx>
28
29#include <o3tl/safeint.hxx>
30#include <vcl/svapp.hxx>
31#include <vcl/settings.hxx>
32#include <sal/log.hxx>
33
34#include <svl/numformat.hxx>
35#include <svl/zformat.hxx>
36#include <svl/itemiter.hxx>
37#include <svl/whiter.hxx>
38#include <svl/grabbagitem.hxx>
39#include <editeng/fontitem.hxx>
40#include <editeng/tstpitem.hxx>
42#include <editeng/spltitem.hxx>
43#include <editeng/widwitem.hxx>
44#include <editeng/lspcitem.hxx>
45#include <editeng/keepitem.hxx>
46#include <editeng/shaditem.hxx>
47#include <editeng/brushitem.hxx>
48#include <editeng/postitem.hxx>
49#include <editeng/wghtitem.hxx>
50#include <editeng/kernitem.hxx>
52#include <editeng/cmapitem.hxx>
53#include <editeng/wrlmitem.hxx>
54#include <editeng/udlnitem.hxx>
55#include <editeng/langitem.hxx>
57#include <editeng/fhgtitem.hxx>
58#include <editeng/colritem.hxx>
61#include <editeng/lrspitem.hxx>
62#include <editeng/ulspitem.hxx>
63#include <editeng/boxitem.hxx>
65#include <editeng/shdditem.hxx>
67#include <editeng/pbinitem.hxx>
74#include <editeng/pgrditem.hxx>
76#include <editeng/blinkitem.hxx>
78#include <editeng/paperinf.hxx>
79#include <svx/xfillit0.hxx>
80#include <svx/xflgrit.hxx>
81#include <o3tl/string_view.hxx>
82#include <fmtfld.hxx>
83#include <fchrfmt.hxx>
84#include <fmtfsize.hxx>
85#include <fmtpdsc.hxx>
86#include <fmtornt.hxx>
87#include <fmtanchr.hxx>
88#include <fmtclds.hxx>
89#include <fmtsrnd.hxx>
90#include <fmtftn.hxx>
91#include <fmtflcnt.hxx>
92#include <frmatr.hxx>
93#include <swtable.hxx>
94#include <fmtinfmt.hxx>
95#include <txtftn.hxx>
96#include <poolfmt.hxx>
97#include <doc.hxx>
102#include <list.hxx>
103#include <docary.hxx>
104#include <pam.hxx>
105#include <paratr.hxx>
106#include <fldbas.hxx>
107#include <docufld.hxx>
108#include <expfld.hxx>
109#include <pagedesc.hxx>
110#include <ndtxt.hxx>
111#include <swrect.hxx>
112#include <redline.hxx>
113#include <reffld.hxx>
114#include <ftninfo.hxx>
115#include <charfmt.hxx>
116#include <section.hxx>
117#include <fmtline.hxx>
118#include <tox.hxx>
119#include <fmtftntx.hxx>
120#include <breakit.hxx>
121#include <com/sun/star/i18n/ScriptType.hpp>
122#include <com/sun/star/i18n/XBreakIterator.hpp>
125#include <tgrditem.hxx>
126#include <flddropdown.hxx>
127#include <chpfld.hxx>
128#include <fmthdft.hxx>
129#include <authfld.hxx>
130#include <dbfld.hxx>
131
132#include "sprmids.hxx"
133
134#include <fmtcntnt.hxx>
135#include "writerhelper.hxx"
136#include "writerwordglue.hxx"
137#include "wrtww8.hxx"
138#include "ww8par.hxx"
139#include "ww8attributeoutput.hxx"
140#include "fields.hxx"
143#include <unotools/fltrcfg.hxx>
144
145
146using ::editeng::SvxBorderLine;
147using namespace ::com::sun::star;
148using namespace nsSwDocInfoSubType;
149using namespace sw::util;
150using namespace sw::types;
151
152bool WW8Export::CollapseScriptsforWordOk( sal_uInt16 nScript, sal_uInt16 nWhich )
153{
154 bool bRet = true;
155 if ( nScript == i18n::ScriptType::ASIAN )
156 {
157 //for asian in ww8, there is only one fontsize
158 //and one fontstyle (posture/weight) for ww6
159 //there is the additional problem that there
160 //is only one font setting for all three scripts
161 switch ( nWhich )
162 {
166 bRet = false;
167 break;
174 default:
175 break;
176 }
177 }
178 else if ( nScript == i18n::ScriptType::COMPLEX )
179 {
180 //Complex is ok in ww8, but for ww6 there is only
181 //one font, one fontsize, one fontsize (weight/posture)
182 //and only one language
183 }
184 else
185 {
186 //for western in ww8, there is only one fontsize
187 //and one fontstyle (posture/weight) for ww6
188 //there is the additional problem that there
189 //is only one font setting for all three scripts
190 switch ( nWhich )
191 {
195 bRet = false;
196 break;
203 default:
204 break;
205 }
206 }
207 return bRet;
208}
209
210
211void MSWordExportBase::ExportPoolItemsToCHP( ww8::PoolItems &rItems, sal_uInt16 nScript, const SvxFontItem *pFont, bool bWriteCombChars )
212{
213 for ( const auto& rItem : rItems )
214 {
215 const SfxPoolItem *pItem = rItem.second;
216 sal_uInt16 nWhich = pItem->Which();
217 if ( ( isCHRATR( nWhich ) || isTXTATR( nWhich ) ) && CollapseScriptsforWordOk( nScript, nWhich ) )
218 {
219 //In the id definition, RES_TXTATR_INETFMT must precede RES_TXTATR_CHARFMT, so that link style can overwrite char style.
220 //and in #i24291# it describes "All we want to do is ensure for now is that if a charfmt exist in the character
221 //properties that it rises to the top and is exported first."
222 //In bug 119649, it is in such situation, so we need to ignore the link style when doing ms word filter exports and
223 //add the second judgement for #i24291# definition.
224 if (nWhich == RES_TXTATR_CHARFMT)
225 {
226 const SfxPoolItem* pINetItem = SearchPoolItems(rItems, RES_TXTATR_INETFMT);
227
228 if (pINetItem)
229 {
230 const SwFormatINetFormat& rINet = pINetItem->StaticWhichCast(RES_TXTATR_INETFMT);
231 const SwCharFormat* pINetFormat = GetSwCharFormat(rINet, m_rDoc);
232 if (!pINetFormat)
233 continue;
234
235 const SwCharFormat* pFormat = pItem->StaticWhichCast(RES_TXTATR_CHARFMT).GetCharFormat();
236 ww8::PoolItems aCharItems, aINetItems;
237 GetPoolItems(pFormat->GetAttrSet(), aCharItems, false);
238 GetPoolItems(pINetFormat->GetAttrSet(), aINetItems, false);
239 for (const auto& rCharItem : aCharItems)
240 {
241 const SfxPoolItem* pCharItem = rCharItem.second;
242 sal_uInt16 nCharWhich = pCharItem->Which();
243 if (!SearchPoolItems(aINetItems, nCharWhich) && !SearchPoolItems(rItems, nCharWhich))
244 AttrOutput().OutputItem(*pCharItem);
245 }
246 continue;
247 }
248 }
249
250 // tdf#38778 Fix output of the font in DOC run for fields
251 if (pFont &&
252 nWhich == RES_TXTATR_FIELD)
253 {
254 AttrOutput().OutputItem( *pFont );
255 }
256
257 // tdf#66401 For Combined Characters in docx, MS Word uses half the normal font-size for the field's
258 // font-size, but only for <w:sz>. Therefore, we check if we are currently writing a field of type
259 // Combined Characters and if so, we half the font size.
260 if (bWriteCombChars &&
261 nWhich == RES_CHRATR_FONTSIZE)
262 {
263 SvxFontHeightItem fontHeight(item_cast<SvxFontHeightItem>( *pItem ));
264 fontHeight.SetHeight( fontHeight.GetHeight() / 2 );
265
266 AttrOutput().OutputItem( fontHeight );
267 }
268 else if (nWhich == RES_CHRATR_COLOR)
269 {
270 const SvxColorItem& rColor = pItem->StaticWhichCast(RES_CHRATR_COLOR);
271 const SfxPoolItem* pBackgroundItem = SearchPoolItems(rItems, RES_CHRATR_BACKGROUND);
272 if (rColor.GetValue() == COL_AUTO && pBackgroundItem)
273 {
274 const SvxBrushItem& rBrushBackground = pBackgroundItem->StaticWhichCast(RES_CHRATR_BACKGROUND);
275 SvxColorItem aForeground(rBrushBackground.GetColor().IsDark() ? COL_WHITE : COL_BLACK, RES_CHRATR_COLOR);
276 AttrOutput().OutputItem(aForeground);
277 }
278 else
279 {
280 // default
281 AttrOutput().OutputItem( *pItem );
282 }
283 }
284 else if (nWhich == RES_CHRATR_HIGHLIGHT)
285 {
286 const SvxBrushItem& rBrush = pItem->StaticWhichCast(RES_CHRATR_HIGHLIGHT);
287 // The UI easily adds unnecessary highlights, so identify and avoid exporting those.
288 // Highlight is not valid in character styles, so must not check there.
289 // Check the (para) style hierarchy to find the nearest defined highlight.
290 const SfxPoolItem* pInherited = nullptr;
291 if ( auto pNd = dynamic_cast< const SwContentNode *>( m_pOutFormatNode ) ) //paragraph
292 pInherited = static_cast<SwTextFormatColl&>( pNd->GetAnyFormatColl() ).GetAttrSet().GetItem(nWhich);
293 else if ( m_bStyDef && m_pCurrentStyle && m_pCurrentStyle->DerivedFrom() ) //style
294 pInherited = &m_pCurrentStyle->DerivedFrom()->GetFormatAttr(nWhich);
295
296 // Ignore highlight if style already sets the same one.
297 // Also ignore a transparent highlight if there is no inherited highlight to cancel
298 if ( (pInherited && *pInherited != *pItem) || (!pInherited && rBrush.GetColor() != COL_TRANSPARENT) )
299 AttrOutput().OutputItem( *pItem );
300 }
301 else
302 {
303 AttrOutput().OutputItem( *pItem );
304 }
305 }
306 }
307}
308
309/*
310 * Output format as follows:
311 * - output the attributes; without parents!
312 */
313
314void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFormat, bool bChpFormat, sal_uInt16 nScript,
315 bool bExportParentItemSet )
316{
317 if( !(bExportParentItemSet || rSet.Count()) )
318 return;
319
320 m_pISet = &rSet; // for double attributes
321
322 // If frame dir is set, but not adjust, then force adjust as well
323 if ( bPapFormat && SfxItemState::SET == rSet.GetItemState( RES_FRAMEDIR, bExportParentItemSet ) )
324 {
325 // No explicit adjust set ?
326 if ( SfxItemState::SET != rSet.GetItemState( RES_PARATR_ADJUST, bExportParentItemSet ) )
327 {
328 const SvxAdjustItem* pItem = rSet.GetItem( RES_PARATR_ADJUST, bExportParentItemSet );
329 if ( nullptr != pItem )
330 {
331 // then set the adjust used by the parent format
332 AttrOutput().OutputItem( *pItem );
333 }
334 }
335 }
336
337 const SwNumRuleItem* pRuleItem;
338 if ( bPapFormat && (pRuleItem = rSet.GetItemIfSet( RES_PARATR_NUMRULE, bExportParentItemSet )) )
339 {
340 AttrOutput().OutputItem( *pRuleItem );
341
342 // switch off the numbering?
343 const SfxPoolItem* pLRItem;
344 if ( pRuleItem->GetValue().isEmpty() &&
345 SfxItemState::SET != rSet.GetItemState(RES_MARGIN_FIRSTLINE, false) &&
347 {
348 // set the LR-Space of the parentformat!
349 AttrOutput().OutputItem( *pLRItem );
350 }
351 if ( pRuleItem->GetValue().isEmpty() &&
352 SfxItemState::SET != rSet.GetItemState(RES_MARGIN_TEXTLEFT, false) &&
354 {
355 // set the LR-Space of the parentformat!
356 AttrOutput().OutputItem( *pLRItem );
357 }
358 }
359
360 ww8::PoolItems aItems;
361 GetPoolItems( rSet, aItems, bExportParentItemSet );
362 if ( bChpFormat )
363 ExportPoolItemsToCHP(aItems, nScript, nullptr);
364 if ( bPapFormat )
365 {
366 const bool bAlreadyOutputBrushItem = AttrOutput().MaybeOutputBrushItem(rSet);
367
368 for ( const auto& rItem : aItems )
369 {
370 const SfxPoolItem* pItem = rItem.second;
371 sal_uInt16 nWhich = pItem->Which();
372 // Handle fill attributes just like frame attributes for now.
373 if ( (nWhich >= RES_PARATR_BEGIN && nWhich < RES_FRMATR_END && nWhich != RES_PARATR_NUMRULE ) ||
374 (nWhich >= XATTR_FILL_FIRST && nWhich < XATTR_FILL_LAST))
375 AttrOutput().OutputItem( *pItem );
376 }
377
378 // Has to be called after RES_PARATR_GRABBAG is processed.
380 if (!bAlreadyOutputBrushItem && pFill
381 && (pFill->GetValue() == drawing::FillStyle_SOLID || pFill->GetValue() == drawing::FillStyle_NONE)
382 && !rSet.GetItem(RES_BACKGROUND, false))
383 {
384 const bool bFillStyleNone = pFill->GetValue() == drawing::FillStyle_NONE;
385 // No need to write out a NONE background if it can't inherit something else, or if it already inherits a NONE.
386 std::unique_ptr<SvxBrushItem> pInherited;
387 if (bFillStyleNone)
388 {
389 if ( auto pNd = dynamic_cast<const SwContentNode*>(m_pOutFormatNode)) //paragraph
390 pInherited = getSvxBrushItemFromSourceSet(static_cast<SwTextFormatColl&>(pNd->GetAnyFormatColl()).GetAttrSet(), RES_BACKGROUND);
391 else if (m_bStyDef && m_pCurrentStyle && m_pCurrentStyle->DerivedFrom()) //style
393 }
394 // Construct an SvxBrushItem, as expected by the exporters.
395 std::unique_ptr<SvxBrushItem> aBrush(getSvxBrushItemFromSourceSet(rSet, RES_BACKGROUND));
396 if (!bFillStyleNone || (pInherited && *pInherited != *aBrush))
397 AttrOutput().OutputItem(*aBrush);
398 }
399#if 0
400 else
401 {
402 // note: *does not work* due to undocumented Word behavior: must be before a:ln element at least
404 }
405#endif
406 }
407 m_pISet = nullptr; // for double attributes
408}
409
411{
412 //If the header/footer contains a chapter field
415}
416
418{
419 bool bRet = false;
420 if ( const SwNodeIndex* pSttIdx = rContent.GetContentIdx() )
421 {
422 SwNodeIndex aIdx( *pSttIdx, 1 );
423 SwNodeIndex aEnd( *pSttIdx->GetNode().EndOfSectionNode() );
424 SwNodeOffset nStart = aIdx.GetIndex();
425 SwNodeOffset nEnd = aEnd.GetIndex();
426 //If the header/footer contains a chapter field
427 bRet = std::any_of(m_aChapterFieldLocs.cbegin(), m_aChapterFieldLocs.cend(),
428 [nStart, nEnd](SwNodeOffset i) { return ( nStart <= i ) && ( i <= nEnd ); });
429 }
430 return bRet;
431}
432
434{
435 if ( m_aChapterFieldLocs.empty() )
436 return false;
437
438 const SwFrameFormat *pFormat = nullptr;
439
440 pFormat = rFormat.GetHeader().GetHeaderFormat();
441 if ( pFormat && ContentContainsChapterField( pFormat->GetContent() ) )
442 return true;
443
444 pFormat = rFormat.GetFooter().GetFooterFormat();
445 return pFormat && ContentContainsChapterField( pFormat->GetContent() );
446}
447
449{
450 bool bNewPageDesc = false;
451 const SwPageDesc* pCurrent = SwPageDesc::GetPageDescOfNode(rNd);
452 OSL_ENSURE(pCurrent && m_pCurrentPageDesc, "Not possible surely");
453 if (m_pCurrentPageDesc && pCurrent)
454 {
455 if (pCurrent != m_pCurrentPageDesc)
456 {
457 if (m_pCurrentPageDesc->GetFollow() != pCurrent)
458 bNewPageDesc = true;
459 else
460 {
461 const SwFrameFormat& rTitleFormat = m_pCurrentPageDesc->GetFirstMaster();
462 const SwFrameFormat& rFollowFormat = pCurrent->GetMaster();
463
464 bNewPageDesc = !IsPlausableSingleWordSection(rTitleFormat,
465 rFollowFormat);
466 }
467 m_pCurrentPageDesc = pCurrent;
468 }
469 else
470 {
471 const SwFrameFormat &rFormat = pCurrent->GetMaster();
472 bNewPageDesc = FormatHdFtContainsChapterField(rFormat);
473 }
474 }
475 return bNewPageDesc;
476}
477
488void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode& rNd, bool isCellOpen )
489{
491 return;
492
493 m_bBreakBefore = true;
494 bool bNewPageDesc = false;
495 const SwFormatPageDesc *pPgDesc=nullptr;
496 bool bExtraPageBreakBeforeSectionBreak = false;
497
498 //Output a sectionbreak if there's a new pagedescriptor. Otherwise output a
499 //pagebreak if there is a pagebreak here, unless the new page (follow
500 //style) is different to the current one, in which case plump for a
501 //section.
502 bool bBreakSet = false;
503
504 const SwPageDesc * pPageDesc = rNd.FindPageDesc();
505
506 // Even if m_pCurrentPageDesc != pPageDesc ,it might be because of the different header & footer types.
507 if (m_pCurrentPageDesc != pPageDesc)
508 {
509 if (isCellOpen && ( m_pCurrentPageDesc->GetName() != pPageDesc->GetName() ))
510 {
511 /*
512 * If Table cell is open and page header types are different
513 * set pSet to NULL as we don't want to add any section breaks inside a table.
514 */
515 pSet = nullptr;
516 }
518 {
519 bBreakSet = true;
520 bNewPageDesc = true;
521 m_pCurrentPageDesc = pPageDesc;
522 }
523 }
524
525 if ( pSet && pSet->Count() )
526 {
527 const SwFormatPageDesc * pItem = pSet->GetItemIfSet( RES_PAGEDESC, false );
528 if ( pItem && pItem->GetRegisteredIn() != nullptr)
529 {
530 bBreakSet = true;
531 // Avoid unnecessary section breaks if possible. LO can't notice identical
532 // sections during import, so minimize unnecessary duplication
533 // by substituting a simple page break when the resulting section is identical,
534 // unless this is needed to re-number the page.
535 // DOCX only.
536 if (!bNewPageDesc && !pItem->GetNumOffset() && !PreferPageBreakBefore()
538 {
539 // A section break on the very first paragraph is ignored by LO/Word
540 // and should NOT be turned into a page break.
542 SwNodeIndex aStart(*aDocEnd.GetNode().StartOfSectionNode());
543 // Set aStart to the first content node in the section
544 m_rDoc.GetNodes().GoNext(&aStart);
545 assert(aStart <= aDocEnd && "impossible: end section must have one content node");
546 if (rNd.GetIndex() > aStart.GetNode().GetIndex())
547 AttrOutput().OutputItem(SvxFormatBreakItem(SvxBreak::PageBefore, RES_BREAK));
548 }
549 else
550 bNewPageDesc = true;
551
552 pPgDesc = pItem;
553 m_pCurrentPageDesc = pPgDesc->GetPageDesc();
554
555 // tdf#121666: nodes that have pagebreak + sectionbreak may need to export both breaks
556 // tested / implemented with docx format only.
557 // If other formats (rtf /doc) need similar fix, then that may can be done similar way.
558 if (SfxItemState::SET == pSet->GetItemState(RES_BREAK, false))
559 {
560 bExtraPageBreakBeforeSectionBreak = true;
561 }
562 }
563 else if ( const SvxFormatBreakItem* pBreak = pSet->GetItemIfSet( RES_BREAK, false ) )
564 {
565 // Word does not like hard break attributes in some table cells
566 bool bRemoveHardBreakInsideTable = false;
567 if ( m_bOutTable )
568 {
569 const SwTableNode* pTableNode = rNd.FindTableNode();
570 if ( pTableNode )
571 {
572 const SwTableBox* pBox = rNd.GetTableBox();
573 const SwTableLine* pLine = pBox ? pBox->GetUpper() : nullptr;
574 // but only for non-complex tables
575 if ( pLine && !pLine->GetUpper() )
576 {
577 // check if box is not first in that line:
578 if ( 0 < pLine->GetBoxPos( pBox ) && pBox->GetSttNd() )
579 {
580 bRemoveHardBreakInsideTable = true;
581 }
582 }
583 }
584 }
585 bBreakSet = true;
586
587 if ( !bRemoveHardBreakInsideTable )
588 {
589 OSL_ENSURE(m_pCurrentPageDesc, "should not be possible");
590 /*
591 If because of this pagebreak the page desc following the page
592 break is the follow style of the current page desc then output a
593 section break using that style instead. At least in those cases
594 we end up with the same style in word and writer, nothing can be
595 done when it happens when we get a new pagedesc because we
596 overflow from the first page style.
597 */
598 if ( m_pCurrentPageDesc )
599 {
600 // #i76301# - assure that there is a page break before set at the node.
601 if ( pBreak->GetBreak() == SvxBreak::PageBefore )
602 {
603 bNewPageDesc |= SetCurrentPageDescFromNode( rNd );
604 }
605 }
606
607 // If the columns are different in LO's adjacent sections, create a new MS section
608 if (!bNewPageDesc && pBreak->GetBreak() == SvxBreak::PageBefore
609 && Sections().CurrentSectionInfo())
610 {
611 const SwSectionFormat* pSectionFormat = MSWordExportBase::GetSectionFormat(rNd);
612 if (pSectionFormat)
613 {
614 const SwFormatCol& rNewSect = pSectionFormat->GetFormatAttr(RES_COL);
615 const SwFormatCol& rPrevSect
617 *Sections().CurrentSectionInfo());
618 if (rNewSect.GetNumCols() != rPrevSect.GetNumCols()
619 || !rNewSect.IsOrtho() || !rPrevSect.IsOrtho()
620 || rNewSect.GetLineStyle() != rPrevSect.GetLineStyle()
621 || rNewSect.GetLineWidth() != rPrevSect.GetLineWidth()
622 || rNewSect.GetLineColor() != rPrevSect.GetLineColor()
623 || rNewSect.GetLineHeight() != rPrevSect.GetLineHeight()
624 || rNewSect.GetLineAdj() != rPrevSect.GetLineAdj())
625 {
626 bNewPageDesc = true;
627 }
628 }
629 }
630
631 if ( !bNewPageDesc )
632 AttrOutput().OutputItem( *pBreak );
633 }
634 }
635 }
636
637 /*
638 #i9301#
639 No explicit page break, lets see if the style had one and we've moved to a
640 new page style because of it, if we have to then we take the opportunity to
641 set the equivalent word section here. We *could* do it for every paragraph
642 that moves onto a new page because of layout, but that would be insane.
643 */
644 bool bHackInBreak = false;
645 if ( !bBreakSet )
646 {
647 if ( const SwContentNode *pNd = rNd.GetContentNode() )
648 {
649 const SvxFormatBreakItem &rBreak = pNd->GetAttr( RES_BREAK );
650 if ( rBreak.GetBreak() == SvxBreak::PageBefore )
651 bHackInBreak = true;
652 else
653 { // Even a pagedesc item is set, the break item can be set 'NONE',
654 // but a pagedesc item is an implicit page break before...
655 const SwFormatPageDesc &rPageDesc = pNd->GetAttr( RES_PAGEDESC );
656 if ( rPageDesc.KnowsPageDesc() )
657 bHackInBreak = true;
658 }
659 }
660 }
661
662 if ( bHackInBreak )
663 {
664 OSL_ENSURE( m_pCurrentPageDesc, "should not be possible" );
665 if ( m_pCurrentPageDesc )
666 bNewPageDesc = SetCurrentPageDescFromNode( rNd );
667 }
668
669 if ( bNewPageDesc && m_pCurrentPageDesc )
670 {
671 PrepareNewPageDesc( pSet, rNd, pPgDesc, m_pCurrentPageDesc, bExtraPageBreakBeforeSectionBreak );
672 }
673 m_bBreakBefore = false;
674}
675
676// #i76300#
678{
679 bool bRet = false;
680
681 if ( pNd &&
684 {
685 PrepareNewPageDesc( pSet, *pNd, nullptr, m_pCurrentPageDesc->GetFollow() );
686 bRet = true;
687 }
688
689 return bRet;
690}
691
693{
694 const SwSectionFormat* pFormat = nullptr;
695 const SwSectionNode* pSect = rNd.FindSectionNode();
696 if ( pSect &&
698 {
699 pFormat = pSect->GetSection().GetFormat();
700 }
701
702 return pFormat;
703}
704
706{
707 const SwFormatLineNumber* pNItem = nullptr;
708 if ( pSet )
709 {
710 pNItem = & pSet->Get( RES_LINENUMBER );
711 }
712 else if ( const SwContentNode *pNd = rNd.GetContentNode() )
713 {
714 pNItem = &pNd->GetAttr( RES_LINENUMBER );
715 }
716
717 return pNItem? pNItem->GetStartValue() : 0;
718}
719
721 const SwNode& rNd,
722 const SwFormatPageDesc* pNewPgDescFormat,
723 const SwPageDesc* pNewPgDesc,
724 bool /*bExtraPageBreak*/ )
725{
726 // The PageDescs will only be inserted in WW8Writer::pSepx with the corresponding
727 // position by the occurrences of PageDesc attributes. The construction and
728 // output of the attributes and header/footer of the PageDesc are done
729 // after the main text and its attributes.
730
731 sal_uLong nFcPos = ReplaceCr( msword::PageBreak ); // Page/Section-Break
732
733 // actually nothing is outputted here, rather the arrays aCps, aSects
734 // accordingly completed
735 if ( !nFcPos )
736 return;
737
738 const SwSectionFormat* pFormat = GetSectionFormat( rNd );
739 const sal_uLong nLnNm = GetSectionLineNo( pSet, rNd );
740
741 OSL_ENSURE( pNewPgDescFormat || pNewPgDesc, "Neither page desc format nor page desc provided." );
742
743 if ( pNewPgDescFormat )
744 {
745 m_pSepx->AppendSep( Fc2Cp( nFcPos ), *pNewPgDescFormat, rNd, pFormat, nLnNm );
746 }
747 else if ( pNewPgDesc )
748 {
749 m_pSepx->AppendSep( Fc2Cp( nFcPos ), pNewPgDesc, rNd, pFormat, nLnNm );
750 }
751}
752
753void MSWordExportBase::CorrectTabStopInSet( SfxItemSet& rSet, sal_Int32 nAbsLeft )
754{
756 if (!pItem)
757 return;
758
759 // then it must be corrected for the output
760 SvxTabStopItem aTStop(*pItem);
761 for ( sal_uInt16 nCnt = 0; nCnt < aTStop.Count(); ++nCnt )
762 {
763 SvxTabStop& rTab = const_cast<SvxTabStop&>(aTStop[ nCnt ]);
764 if ( SvxTabAdjust::Default != rTab.GetAdjustment() &&
765 rTab.GetTabPos() >= nAbsLeft )
766 {
767 rTab.GetTabPos() -= nAbsLeft;
768 }
769 else
770 {
771 aTStop.Remove( nCnt );
772 --nCnt;
773 }
774 }
775 rSet.Put( aTStop );
776}
777
779{
780 tools::Long nOffset = 0;
781 // Tabs are absolute by default.
783 {
784 // don't do it for editengine text, it doesn't implement this anyway
785 if (!m_pISet || m_pISet->GetRanges()[0].first < RES_WHICHHINT_END)
786 {
787 nOffset = GetItem(RES_MARGIN_TEXTLEFT).GetTextLeft();
788 }
789 }
790 return nOffset;
791}
792
793sal_uInt8 WW8Export::GetNumId( sal_uInt16 eNumType )
794{
795 sal_uInt8 nRet = 0;
796 switch( eNumType )
797 {
799 case SVX_NUM_CHARS_UPPER_LETTER_N: nRet = 3; break;
801 case SVX_NUM_CHARS_LOWER_LETTER_N: nRet = 4; break;
802 case SVX_NUM_ROMAN_UPPER: nRet = 1; break;
803 case SVX_NUM_ROMAN_LOWER: nRet = 2; break;
804 case style::NumberingType::TEXT_NUMBER: nRet = 5; break;
805 case style::NumberingType::TEXT_CARDINAL: nRet = 6; break;
806 case style::NumberingType::TEXT_ORDINAL: nRet = 7; break;
807 case style::NumberingType::AIU_HALFWIDTH_JA: nRet = 12; break;
808 case style::NumberingType::IROHA_HALFWIDTH_JA: nRet = 13; break;
809 case style::NumberingType::FULLWIDTH_ARABIC: nRet = 14; break;
810 case style::NumberingType::NUMBER_TRADITIONAL_JA: nRet = 16; break;
811 case style::NumberingType::CIRCLE_NUMBER: nRet = 18; break;
812 case style::NumberingType::AIU_FULLWIDTH_JA: nRet = 20; break;
813 case style::NumberingType::IROHA_FULLWIDTH_JA: nRet = 21; break;
814
815 case SVX_NUM_BITMAP:
816 case SVX_NUM_CHAR_SPECIAL: nRet = 23; break;
817 case style::NumberingType::HANGUL_SYLLABLE_KO: nRet = 24; break;// ganada
818 case style::NumberingType::HANGUL_JAMO_KO: nRet = 25; break;// chosung
819 case style::NumberingType::HANGUL_CIRCLED_SYLLABLE_KO: nRet = 24; break;
820 case style::NumberingType::HANGUL_CIRCLED_JAMO_KO: nRet = 25; break;
821 case style::NumberingType::TIAN_GAN_ZH: nRet = 30; break;
822 case style::NumberingType::DI_ZI_ZH: nRet = 31; break;
823 case style::NumberingType::NUMBER_UPPER_ZH_TW: nRet = 34;break;
824 case style::NumberingType::NUMBER_UPPER_ZH: nRet = 38; break;
825 case style::NumberingType::NUMBER_DIGITAL_KO: nRet = 41; break;
826 case style::NumberingType::NUMBER_HANGUL_KO: nRet = 42; break;
827 case style::NumberingType::NUMBER_LEGAL_KO: nRet = 43; break;
828 case style::NumberingType::NUMBER_DIGITAL2_KO: nRet = 44; break;
829 case style::NumberingType::NUMBER_HEBREW: nRet = 45; break;
830 case style::NumberingType::CHARS_ARABIC: nRet = 46; break;
831 case style::NumberingType::CHARS_HEBREW: nRet = 47; break;
832 case style::NumberingType::CHARS_ARABIC_ABJAD: nRet = 48; break;
833 case style::NumberingType::CHARS_PERSIAN:
834 case style::NumberingType::CHARS_NEPALI: nRet = 49; break;
835 case style::NumberingType::CHARS_THAI: nRet = 53; break;
836 case style::NumberingType::CHARS_CYRILLIC_LOWER_LETTER_N_RU:
837 case style::NumberingType::CHARS_CYRILLIC_LOWER_LETTER_RU: nRet = 58; break;
838 case style::NumberingType::CHARS_CYRILLIC_UPPER_LETTER_N_RU:
839 case style::NumberingType::CHARS_CYRILLIC_UPPER_LETTER_RU: nRet = 59; break;
840 // nothing, WW does the same (undocumented)
841 case SVX_NUM_NUMBER_NONE: nRet = 0xff; break;
843 // 0x09, msonfcChiManSty
844 nRet = 9;
845 break;
847 // 0x16, msonfcArabicLZ
848 nRet = 22;
849 break;
850 }
851 return nRet;
852}
853
855{
856 // Handled by ParaOutlineLevel and ParaNumRule
857}
858
859// #i77805#
861{
862 bool bRet( false );
863
864 //If there is no numbering on this fmt, but its parent was outline
865 //numbered, then in writer this is no inheritied, but in word it would
866 //be, so we must export "no numbering" and "body level" to make word
867 //behave like writer (see #i25755)
868 if (SfxItemState::SET != rFormat.GetItemState(RES_PARATR_NUMRULE, false))
869 {
870 if (const SwFormat *pParent = rFormat.DerivedFrom())
871 {
872 if (static_cast<const SwTextFormatColl*>(pParent)->IsAssignedToListLevelOfOutlineStyle())
873 {
875 m_pO->push_back(sal_uInt8(9));
878
879 bRet = true;
880 }
881 }
882 }
883
884 return bRet;
885}
886
887void MSWordExportBase::OutputFormat( const SwFormat& rFormat, bool bPapFormat, bool bChpFormat, bool bFlyFormat )
888{
889 bool bCallOutSet = true;
890 const sw::BroadcastingModify* pOldMod = m_pOutFormatNode;
891 m_pOutFormatNode = &rFormat;
892
893 switch( rFormat.Which() )
894 {
896 case RES_TXTFMTCOLL:
897 if( bPapFormat )
898 {
899 int nLvl = MAXLEVEL;
900
901 if (static_cast<const SwTextFormatColl&>(rFormat).IsAssignedToListLevelOfOutlineStyle())
902 nLvl = static_cast<const SwTextFormatColl&>(rFormat).GetAssignedOutlineStyleLevel();
903
904 if (nLvl >= 0 && nLvl < MAXLEVEL)
905 {
906 //if outline numbered
907 // if Write StyleDefinition then write the OutlineRule
908 const SwNumFormat& rNFormat = m_rDoc.GetOutlineNumRule()->Get( o3tl::narrowing<sal_uInt16>( nLvl ) );
909 if ( m_bStyDef )
910 AttrOutput().OutlineNumbering(static_cast<sal_uInt8>(nLvl));
911
912 if ( rNFormat.GetPositionAndSpaceMode() ==
914 rNFormat.GetAbsLSpace() )
915 {
916 SfxItemSet aSet( rFormat.GetAttrSet() );
919
920 leftMargin.SetTextLeft(leftMargin.GetTextLeft() + rNFormat.GetAbsLSpace());
922
923 aSet.Put(firstLine);
924 aSet.Put(leftMargin);
925 CorrectTabStopInSet( aSet, rNFormat.GetAbsLSpace() );
926 OutputItemSet( aSet, bPapFormat, bChpFormat,
927 i18n::ScriptType::LATIN, m_bExportModeRTF);
928 bCallOutSet = false;
929 }
930 }
931 else
932 {
933 //otherwise we might have to remove outline numbering from
934 //what gets exported if the parent style was outline numbered
935 // #i77805#
936 // If inherited outline numbering is suppress, the left/right
937 // margins has to be exported explicitly.
939 {
940 SfxItemSet aSet( rFormat.GetAttrSet() );
941 SvxFirstLineIndentItem const& rFirstLine(aSet.Get(RES_MARGIN_FIRSTLINE));
942 SvxTextLeftMarginItem const& rLeftMargin(aSet.Get(RES_MARGIN_TEXTLEFT));
943 aSet.Put(rFirstLine);
944 aSet.Put(rLeftMargin);
945 OutputItemSet( aSet, bPapFormat, bChpFormat,
946 css::i18n::ScriptType::LATIN, m_bExportModeRTF);
947 bCallOutSet = false;
948 }
949 }
950 }
951 break;
952
953 case RES_CHRFMT:
954 break;
955 case RES_FLYFRMFMT:
956 if (bFlyFormat)
957 {
958 OSL_ENSURE(m_pParentFrame, "No parent frame, all broken");
959
960 if (m_pParentFrame)
961 {
962 const SwFrameFormat &rFrameFormat = m_pParentFrame->GetFrameFormat();
963
966 aSet.Set(rFrameFormat.GetAttrSet());
967
968 // Fly as character becomes a paragraph bound
969 // now set the distance to paragraph margin
970 if (m_pFlyOffset)
971 {
972 aSet.Put(SwFormatHoriOrient(m_pFlyOffset->X()));
973 aSet.Put(SwFormatVertOrient(m_pFlyOffset->Y()));
974 SwFormatAnchor aAnchor(rFrameFormat.GetAnchor());
975 aAnchor.SetType(m_eNewAnchorType);
976 aSet.Put(aAnchor);
977 }
978
979 if (SfxItemState::SET != aSet.GetItemState(RES_SURROUND))
980 aSet.Put(SwFormatSurround(css::text::WrapTextMode_NONE));
981
982 const XFillStyleItem* pXFillStyleItem(rFrameFormat.GetAttrSet().GetItem<XFillStyleItem>(XATTR_FILLSTYLE));
983 if (pXFillStyleItem)
984 {
985 switch (pXFillStyleItem->GetValue())
986 {
987 case drawing::FillStyle_NONE:
988 break;
989 case drawing::FillStyle_SOLID:
990 {
991 // Construct an SvxBrushItem, as expected by the exporters.
992 aSet.Put(getSvxBrushItemFromSourceSet(rFrameFormat.GetAttrSet(), RES_BACKGROUND));
993 break;
994 }
995 default:
996 break;
997 }
998 }
999
1000 m_bOutFlyFrameAttrs = true;
1001 //script doesn't matter if not exporting chp
1002 OutputItemSet(aSet, true, false,
1003 i18n::ScriptType::LATIN, m_bExportModeRTF);
1004 m_bOutFlyFrameAttrs = false;
1005
1006 bCallOutSet = false;
1007 }
1008 }
1009 break;
1010 case RES_FRMFMT:
1011 break;
1012 default:
1013 OSL_ENSURE( false, "Which format is exported here?" );
1014 break;
1015 }
1016
1017 if( bCallOutSet )
1018 OutputItemSet( rFormat.GetAttrSet(), bPapFormat, bChpFormat,
1019 i18n::ScriptType::LATIN, m_bExportModeRTF);
1020 m_pOutFormatNode = pOldMod;
1021}
1022
1023bool MSWordExportBase::HasRefToAttr(const OUString& rName)
1024{
1026 std::vector<SwGetRefField*> vpRFields;
1027 pType->GatherRefFields(vpRFields, REF_SETREFATTR);
1028 return std::any_of(vpRFields.begin(), vpRFields.end(),
1029 [rName](SwGetRefField* pF) { return rName == pF->GetSetRefName(); });
1030}
1031
1032bool MSWordExportBase::HasRefToFootOrEndnote(const bool isEndNote, const sal_uInt16 nSeqNo)
1033{
1035 std::vector<SwGetRefField*> vpRFields;
1036 pType->GatherRefFields(vpRFields, isEndNote ? REF_ENDNOTE : REF_FOOTNOTE);
1037 return std::any_of(vpRFields.begin(), vpRFields.end(),
1038 [nSeqNo](SwGetRefField* pF) { return nSeqNo == pF->GetSeqNo(); });
1039}
1040
1041OUString MSWordExportBase::GetBookmarkName( sal_uInt16 nTyp, const OUString* pName, sal_uInt16 nSeqNo )
1042{
1043 OUString sRet;
1044 switch ( nTyp )
1045 {
1046 case REF_SETREFATTR:
1047 if ( pName )
1048 {
1049 sRet = "Ref_" + *pName;
1050 }
1051 break;
1052 case REF_SEQUENCEFLD:
1053 {
1054 assert(pName);
1055 sRet = "Ref_" + *pName;
1056 break;
1057 }
1058 case REF_BOOKMARK:
1059 if ( pName )
1060 sRet = *pName;
1061 break;
1062 case REF_OUTLINE:
1063 break; // ???
1064 case REF_FOOTNOTE:
1065 sRet = "_RefF" + OUString::number( nSeqNo );
1066 break;
1067 case REF_ENDNOTE:
1068 sRet = "_RefE" + OUString::number( nSeqNo );
1069 break;
1070 }
1071 return BookmarkToWord( sRet ); // #i43956# - encode bookmark accordingly
1072}
1073
1074/* File CHRATR.HXX: */
1075void WW8AttributeOutput::RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript )
1076{
1077 if (bIsRTL)
1078 {
1080 {
1082 m_rWW8Export.m_pO->push_back( sal_uInt8(1) );
1083 }
1084 }
1085
1086 // #i46087# patch from james_clark; complex texts needs the undocumented SPRM CComplexScript with param 0x81.
1087 if (nScript == i18n::ScriptType::COMPLEX && !bIsRTL)
1088 {
1090 m_rWW8Export.m_pO->push_back( sal_uInt8(0x81) );
1091 m_rWW8Export.m_pDop->bUseThaiLineBreakingRules = true;
1092 }
1093}
1094
1096{
1097 m_rWW8Export.m_pPapPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell() - (mbOnTOXEnding?2:0), m_rWW8Export.m_pO->size(), m_rWW8Export.m_pO->data() );
1098 mbOnTOXEnding = false;
1099 m_rWW8Export.m_pO->clear();
1100
1101 if ( pTextNodeInfoInner )
1102 {
1103 if ( pTextNodeInfoInner->isEndOfLine() )
1104 {
1105 TableRowEnd( pTextNodeInfoInner->getDepth() );
1106
1107 SVBT16 nSty;
1108 ShortToSVBT16( 0, nSty );
1109 m_rWW8Export.m_pO->insert( m_rWW8Export.m_pO->end(), nSty, nSty+2 ); // Style #
1110 TableInfoRow( pTextNodeInfoInner );
1111 m_rWW8Export.m_pPapPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), m_rWW8Export.m_pO->size(), m_rWW8Export.m_pO->data());
1112 m_rWW8Export.m_pO->clear();
1113 //For Bug 119650, should break the properties of CHP PLC after a paragraph end.
1114 m_rWW8Export.m_pChpPlc->AppendFkpEntry(m_rWW8Export.Strm().Tell(), m_rWW8Export.m_pO->size(), m_rWW8Export.m_pO->data());
1115 }
1116 }
1117
1118 // Clear bookmarks of the current paragraph
1121}
1122
1124{
1125 WW8_WrPlcField* pCurrentFields = m_rWW8Export.CurrentFieldPlc();
1126 m_nFieldResults = pCurrentFields ? pCurrentFields->ResultCount() : 0;
1127}
1128
1129void WW8AttributeOutput::StartRun( const SwRedlineData* pRedlineData, sal_Int32 nPos, bool /*bSingleEmptyRun*/ )
1130{
1131 if (pRedlineData)
1132 {
1133 const OUString &rComment = pRedlineData->GetComment();
1134 //Only possible to export to main text
1135 if (!rComment.isEmpty() && (m_rWW8Export.m_nTextTyp == TXT_MAINTEXT) &&
1136 // tdf#153016 don't export the new automatic comments added by tdf#148032
1137 rComment != SwResId(STR_REDLINE_COMMENT_DELETED) &&
1138 rComment != SwResId(STR_REDLINE_COMMENT_ADDED))
1139 {
1140 if (m_rWW8Export.m_pAtn->IsNewRedlineComment(pRedlineData))
1141 {
1142 m_rWW8Export.m_pAtn->Append( m_rWW8Export.Fc2Cp( m_rWW8Export.Strm().Tell() ), pRedlineData );
1144 }
1145 }
1146 }
1147
1149 auto aRange = m_aBookmarksOfParagraphStart.equal_range(nPos);
1150 for( auto aIter = aRange.first; aIter != aRange.second; ++aIter)
1151 {
1152 GetExport().AppendBookmark(BookmarkToWord(aIter->second));
1153 }
1154}
1155
1157{
1158 mbOnTOXEnding = true;
1159}
1160
1161void WW8AttributeOutput::EndRun( const SwTextNode* /*pNode*/, sal_Int32 nPos, sal_Int32 /*nLen*/, bool bLastRun )
1162{
1164 auto aRange = m_aBookmarksOfParagraphEnd.equal_range(nPos);
1165 for( auto aIter = aRange.first; aIter != aRange.second; ++aIter)
1166 {
1167 if(bLastRun)
1169 else
1170 GetExport().AppendBookmark(BookmarkToWord(aIter->second));
1171 }
1172}
1173
1175{
1176 Redline( pRedlineData );
1177
1178 WW8_WrPlcField* pCurrentFields = m_rWW8Export.CurrentFieldPlc();
1179 sal_uInt16 nNewFieldResults = pCurrentFields ? pCurrentFields->ResultCount() : 0;
1180
1181 bool bExportedFieldResult = ( m_nFieldResults != nNewFieldResults );
1182
1183 // If we have exported a field result, then we will have been forced to
1184 // split up the text into a 0x13, 0x14, <result> 0x15 sequence with the
1185 // properties forced out at the end of the result, so the 0x15 itself
1186 // should remain clean of all other attributes to avoid #iXXXXX#
1187 if ( !bExportedFieldResult )
1188 {
1189 m_rWW8Export.m_pChpPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(),
1190 m_rWW8Export.m_pO->size(), m_rWW8Export.m_pO->data() );
1191 }
1192 m_rWW8Export.m_pO->clear();
1193}
1194
1195void WW8AttributeOutput::RunText( const OUString& rText, rtl_TextEncoding eCharSet, const OUString& /*rSymbolFont*/ )
1196{
1197 RawText(rText, eCharSet);
1198}
1199
1200void WW8AttributeOutput::RawText(const OUString& rText, rtl_TextEncoding)
1201{
1202 m_rWW8Export.OutSwString(rText, 0, rText.getLength());
1203}
1204
1206{
1207 if (!m_rWW8Export.m_pO->empty() || bForce)
1208 {
1209 m_rWW8Export.m_pChpPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(),
1210 m_rWW8Export.m_pO->size(), m_rWW8Export.m_pO->data() );
1211 m_rWW8Export.m_pO->clear();
1212 }
1213}
1214
1215void WW8AttributeOutput::ParagraphStyle( sal_uInt16 nStyle )
1216{
1217 OSL_ENSURE( m_rWW8Export.m_pO->empty(), " pO is not empty at line end" );
1218
1219 SVBT16 nSty;
1220 ShortToSVBT16( nStyle, nSty );
1221 m_rWW8Export.m_pO->insert( m_rWW8Export.m_pO->end(), nSty, nSty+2 ); // style #
1222}
1223
1225{
1227
1228 m_rWW8Export.m_pO->push_back( bVal ? 1 : 0 );
1229}
1230
1232{
1233 OSL_ENSURE( nId <= 1, "out of range" );
1234 if (nId > 1)
1235 return;
1236
1238 m_rWW8Export.m_pO->push_back( bVal ? 1 : 0 );
1239}
1240
1242{
1243 sal_uInt16 nFontID = m_rWW8Export.GetId( rFont );
1244
1246 m_rWW8Export.InsUInt16( nFontID );
1248
1249 m_rWW8Export.InsUInt16( nFontID );
1250}
1251
1253{
1254 sal_uInt16 nFontID = m_rWW8Export.GetId( rFont );
1256 m_rWW8Export.InsUInt16( nFontID );
1257}
1258
1260{
1261 sal_uInt16 nFontID = m_rWW8Export.GetId( rFont );
1263 m_rWW8Export.InsUInt16( nFontID );
1264}
1265
1267{
1269}
1270
1272{
1273 OutputWW8AttributeCTL( 1, ITALIC_NONE != rPosture.GetPosture() );
1274}
1275
1277{
1278 OutputWW8Attribute( 1, ITALIC_NONE != rPosture.GetPosture() );
1279}
1280
1282{
1283 OutputWW8Attribute( 0, WEIGHT_BOLD == rWeight.GetWeight() );
1284}
1285
1286// Shadowed and Contour are not in WW-UI. JP: ??
1288{
1289 OutputWW8Attribute( 3, rContour.GetValue() );
1290}
1291
1293{
1294 OutputWW8Attribute( 4, rShadow.GetValue() );
1295}
1296
1298{
1300
1301 m_rWW8Export.InsUInt16( rKerning.GetValue() );
1302}
1303
1305{
1307
1308 m_rWW8Export.InsUInt16( rAutoKern.GetValue() ? 2 : 0 );
1309}
1310
1312{
1314 // At the moment the only animated text effect we support is blinking
1315 m_rWW8Export.m_pO->push_back( rBlink.GetValue() ? 2 : 0 );
1316}
1317
1319{
1320 FontStrikeout eSt = rCrossed.GetStrikeout();
1321 if ( STRIKEOUT_DOUBLE == eSt )
1322 {
1323 OutputWW8Attribute( 8, true );
1324 return;
1325 }
1326 if ( STRIKEOUT_NONE != eSt )
1327 {
1328 OutputWW8Attribute( 2, true );
1329 return;
1330 }
1331
1332 // otherwise both off
1333 OutputWW8Attribute( 8, false );
1334 OutputWW8Attribute( 2, false );
1335}
1336
1338{
1339 SvxCaseMap eSt = rCaseMap.GetValue();
1340 switch ( eSt )
1341 {
1342 case SvxCaseMap::SmallCaps:
1343 OutputWW8Attribute( 5, true );
1344 return;
1345 case SvxCaseMap::Uppercase:
1346 OutputWW8Attribute( 6, true );
1347 return;
1348 case SvxCaseMap::Capitalize:
1349 // no such feature in word
1350 break;
1351 default:
1352 // otherwise both off
1353 OutputWW8Attribute( 5, false );
1354 OutputWW8Attribute( 6, false );
1355 return;
1356 }
1357}
1358
1360{
1361 OutputWW8Attribute( 7, rHidden.GetValue() );
1362}
1363
1364void WW8AttributeOutput::CharBorder( const SvxBorderLine* pAllBorder, const sal_uInt16 /*nDist*/, const bool bShadow )
1365{
1367}
1368
1370{
1373 m_rWW8Export.m_pO->push_back( nColor );
1374}
1375
1377{
1379
1380 // FIXME: this should likely be a StaticWhichCast(), but some we put something dirty in RES_CHRATR_WORDLINEMODE apparently
1381 const auto pItem = m_rWW8Export.HasItem(RES_CHRATR_WORDLINEMODE);
1382 bool bWord = false;
1383 if(pItem)
1384 {
1385 const auto pWordline = pItem->DynamicWhichCast(RES_CHRATR_WORDLINEMODE);
1386 if(pWordline)
1387 bWord = pWordline->GetValue();
1388 else
1389 SAL_WARN("sw.ww8", "m_rWW8Export has an RES_CHRATR_WORDLINEMODE item, but it's of the wrong type.");
1390 }
1391
1392 // WW95 - parameters: 0 = none, 1 = single, 2 = by Word,
1393 // 3 = double, 4 = dotted, 5 = hidden
1394 // WW97 - additional parameters:
1395 // 6 = thick, 7 = dash, 8 = dot(not used)
1396 // 9 = dotdash 10 = dotdotdash, 11 = wave
1397 sal_uInt8 b = 0;
1398 switch ( rUnderline.GetLineStyle() )
1399 {
1400 case LINESTYLE_SINGLE:
1401 b = bWord ? 2 : 1;
1402 break;
1403 case LINESTYLE_BOLD:
1404 b = 6;
1405 break;
1406 case LINESTYLE_DOUBLE:
1407 b = 3;
1408 break;
1409 case LINESTYLE_DOTTED:
1410 b = 4;
1411 break;
1412 case LINESTYLE_DASH:
1413 b = 7;
1414 break;
1415 case LINESTYLE_DASHDOT:
1416 b = 9;
1417 break;
1419 b = 10;
1420 break;
1421 case LINESTYLE_WAVE:
1422 b = 11;
1423 break;
1424 // new in WW2000
1426 b = 20;
1427 break;
1428 case LINESTYLE_BOLDDASH:
1429 b = 23;
1430 break;
1431 case LINESTYLE_LONGDASH:
1432 b = 39;
1433 break;
1435 b = 55;
1436 break;
1438 b = 25;
1439 break;
1441 b = 26;
1442 break;
1443 case LINESTYLE_BOLDWAVE:
1444 b = 27;
1445 break;
1447 b = 43;
1448 break;
1449 case LINESTYLE_NONE:
1450 b = 0;
1451 break;
1452 default:
1453 OSL_ENSURE( rUnderline.GetLineStyle() == LINESTYLE_NONE, "Unhandled underline type" );
1454 break;
1455 }
1456
1457 m_rWW8Export.m_pO->push_back( b );
1458 Color aColor = rUnderline.GetColor();
1459 if( aColor != COL_TRANSPARENT )
1460 {
1462
1464 }
1465}
1466
1468{
1469 sal_uInt16 nId = 0;
1470 switch ( rLanguage.Which() )
1471 {
1474 break;
1477 break;
1480 break;
1481 }
1482
1483 if ( !nId )
1484 return;
1485
1486 // use sprmCRgLid0_80 rather than sprmCLid
1488 m_rWW8Export.InsUInt16( static_cast<sal_uInt16>(rLanguage.GetLanguage()) );
1489
1490 // Word 2000 and above apparently require both old and new versions of
1491 // these sprms to be set, without it spellchecking doesn't work
1493 {
1495 m_rWW8Export.InsUInt16( static_cast<sal_uInt16>(rLanguage.GetLanguage()) );
1496 }
1497 else if ( nId == NS_sprm::CRgLid1_80::val )
1498 {
1500 m_rWW8Export.InsUInt16( static_cast<sal_uInt16>(rLanguage.GetLanguage()) );
1501 }
1502}
1503
1505{
1506 sal_uInt8 b = 0xFF;
1507 short nEsc = rEscapement.GetEsc(), nProp = rEscapement.GetProportionalHeight();
1508 if ( !nEsc )
1509 {
1510 b = 0;
1511 nEsc = 0;
1512 nProp = 100;
1513 }
1514 else if ( DFLT_ESC_PROP == nProp || nProp < 1 || nProp > 100 )
1515 {
1516 if ( DFLT_ESC_SUB == nEsc || DFLT_ESC_AUTO_SUB == nEsc )
1517 b = 2;
1518 else if ( DFLT_ESC_SUPER == nEsc || DFLT_ESC_AUTO_SUPER == nEsc )
1519 b = 1;
1520 }
1521 else if ( DFLT_ESC_AUTO_SUPER == nEsc )
1522 {
1523 // Raised by the differences between the ascenders (ascent = baseline to top of highest letter).
1524 // The ascent is generally about 80% of the total font height.
1525 // That is why DFLT_ESC_PROP (58) leads to 33% (DFLT_ESC_SUPER)
1526 nEsc = .8 * (100 - nProp);
1527 }
1528 else if ( DFLT_ESC_AUTO_SUB == nEsc )
1529 {
1530 // Lowered by the differences between the descenders (descent = baseline to bottom of lowest letter).
1531 // The descent is generally about 20% of the total font height.
1532 // That is why DFLT_ESC_PROP (58) leads to 8% (DFLT_ESC_SUB)
1533 nEsc = .2 * -(100 - nProp);
1534 }
1535
1536 if ( 0xFF != b )
1537 {
1539
1540 m_rWW8Export.m_pO->push_back( b );
1541 }
1542
1543 if ( 0 != b && 0xFF != b )
1544 return;
1545
1546 double fHeight = m_rWW8Export.GetItem( RES_CHRATR_FONTSIZE ).GetHeight();
1548
1549 m_rWW8Export.InsUInt16(static_cast<short>( round(fHeight * nEsc / 1000) ));
1550
1551 if( 100 != nProp || !b )
1552 {
1554 m_rWW8Export.InsUInt16(msword_cast<sal_uInt16>( round(fHeight * nProp / 1000) ));
1555 }
1556}
1557
1559{
1560 sal_uInt16 nId = 0;
1561 switch ( rHeight.Which() )
1562 {
1566 break;
1569 break;
1570 }
1571
1572 if ( nId )
1573 {
1575
1576 m_rWW8Export.InsUInt16( o3tl::narrowing<sal_uInt16>(( rHeight.GetHeight() + 5 ) / 10 ) );
1577 }
1578}
1579
1581{
1583 m_rWW8Export.InsUInt16( rScaleWidth.GetValue() );
1584}
1585
1587{
1588 sal_uInt16 nId;
1589 switch ( rRelief.GetValue() )
1590 {
1591 case FontRelief::Embossed: nId = NS_sprm::CFEmboss::val; break;
1592 case FontRelief::Engraved: nId = NS_sprm::CFImprint::val; break;
1593 default: nId = 0; break;
1594 }
1595
1596 if( nId )
1597 {
1599 m_rWW8Export.m_pO->push_back( sal_uInt8(0x81) );
1600 }
1601 else
1602 {
1603 // switch both flags off
1605 m_rWW8Export.m_pO->push_back( sal_uInt8(0x0) );
1607 m_rWW8Export.m_pO->push_back( sal_uInt8(0x0) );
1608 }
1609}
1610
1612{
1613 const SfxInt16Item& rAttr = static_cast<const SfxInt16Item&>(rHt);
1614 if( rAttr.GetValue() == 1 )
1615 {
1616 m_rWW8Export.InsUInt16(0x85a);
1617 m_rWW8Export.m_pO->push_back(sal_uInt8(1));
1618 }
1619}
1620
1622{
1623 const SfxInt16Item& rAttr = static_cast<const SfxInt16Item&>(rHt);
1624 m_rWW8Export.InsUInt16(0x286F);
1625 m_rWW8Export.m_pO->push_back(static_cast<sal_uInt8>(rAttr.GetValue()));
1626}
1627
1629{
1630 // #i28331# - check that a Value is set
1631 if ( !rRotate.GetValue() )
1632 return;
1633
1634 if (m_rWW8Export.IsInTable())
1635 return;
1636
1637 // #i36867 In word the text in a table is rotated via the TC or NS_sprm::TTextFlow::val
1638 // This means you can only rotate all or none of the text adding NS_sprm::CFELayout::val
1639 // here corrupts the table, hence !m_rWW8Export.bIsInTable
1640
1642 m_rWW8Export.m_pO->push_back( sal_uInt8(0x06) ); //len 6
1643 m_rWW8Export.m_pO->push_back( sal_uInt8(0x01) );
1644
1645 m_rWW8Export.InsUInt16( rRotate.IsFitToLine() ? 1 : 0 );
1646 static const sal_uInt8 aZeroArr[ 3 ] = { 0, 0, 0 };
1647 m_rWW8Export.m_pO->insert( m_rWW8Export.m_pO->end(), aZeroArr, aZeroArr+3);
1648}
1649
1651{
1652 sal_uInt8 nVal;
1653 const FontEmphasisMark v = rEmphasisMark.GetEmphasisMark();
1654 if (v == FontEmphasisMark::NONE)
1655 nVal = 0;
1656 else if (v == (FontEmphasisMark::Accent | FontEmphasisMark::PosAbove))
1657 nVal = 2;
1658 else if (v == (FontEmphasisMark::Circle | FontEmphasisMark::PosAbove))
1659 nVal = 3;
1660 else if (v == (FontEmphasisMark::Dot | FontEmphasisMark::PosBelow))
1661 nVal = 4;
1662 else
1663 // case 1:
1664 nVal = 1;
1665
1667 m_rWW8Export.m_pO->push_back( nVal );
1668}
1669
1678bool WW8Export::TransBrush(const Color& rCol, WW8_SHD& rShd)
1679{
1680 if( rCol.IsTransparent() )
1681 rShd = WW8_SHD(); // all zeros: transparent
1682 else
1683 {
1684 rShd.SetFore( 0);
1685 rShd.SetBack( msfilter::util::TransColToIco( rCol ) );
1686 rShd.SetStyle( 0 );
1687 }
1688 return !rCol.IsTransparent();
1689}
1690
1691static sal_uInt32 SuitableBGColor(Color nIn)
1692{
1693 if (nIn == COL_AUTO)
1694 return 0xFF000000;
1695 return wwUtility::RGBToBGR(nIn);
1696}
1697
1699{
1701
1703 m_rWW8Export.m_pO->push_back( nColor );
1704
1705 if (nColor)
1706 {
1709 }
1710}
1711
1713{
1714 WW8_SHD aSHD;
1715
1716 WW8Export::TransBrush( rBrush.GetColor(), aSHD );
1717 // sprmCShd80
1720
1721 //Quite a few unknowns, some might be transparency or something
1722 //of that nature...
1724 m_rWW8Export.m_pO->push_back( 10 );
1725 m_rWW8Export.InsUInt32( 0xFF000000 );
1727 m_rWW8Export.InsUInt16( 0x0000);
1728}
1729
1730namespace sw { namespace util {
1731
1733{
1734 if (rINet.GetValue().isEmpty())
1735 return nullptr;
1736
1737 const sal_uInt16 nId = rINet.GetINetFormatId();
1738 const OUString& rStr = rINet.GetINetFormat();
1739 if (rStr.isEmpty())
1740 {
1741 OSL_ENSURE( false, "WW8AttributeOutput::TextINetFormat(..) - missing unvisited character format at hyperlink attribute" );
1742 }
1743
1744 return IsPoolUserFormat( nId )
1745 ? rDoc.FindCharFormatByName( rStr )
1747}
1748
1749} }
1750
1752{
1753 const SwCharFormat* pFormat = GetSwCharFormat(rINet, m_rWW8Export.m_rDoc);
1754 if (!pFormat)
1755 return;
1756
1758
1760}
1761
1762// #i43956# - add optional parameter <pLinkStr>
1763// It's needed to write the hyperlink data for a certain cross-reference
1764// - it contains the name of the link target, which is a bookmark.
1765// add optional parameter <bIncludeEmptyPicLocation>
1766// It is needed to write an empty picture location for page number field separators
1768 OUString const * pLinkStr,
1769 bool bIncludeEmptyPicLocation = false )
1770{
1771 ww::bytes aItems;
1772 rWrt.GetCurrentItems(aItems);
1773
1774 if (c == 0x13)
1775 rWrt.m_pChpPlc->AppendFkpEntry(rWrt.Strm().Tell());
1776 else
1777 rWrt.m_pChpPlc->AppendFkpEntry(rWrt.Strm().Tell(), aItems.size(), aItems.data());
1778
1779 rWrt.WriteChar(c);
1780
1781 // store empty sprmCPicLocation for field separator
1782 if ( bIncludeEmptyPicLocation &&
1783 ( c == 0x13 || c == 0x14 || c == 0x15 ) )
1784 {
1786 SwWW8Writer::InsUInt32( aItems, 0x00000000 );
1787 }
1788
1789 // #i43956# - write hyperlink data and attributes
1790 if ( c == 0x01 && pLinkStr)
1791 {
1792 // write hyperlink data to data stream
1793 SvStream& rStrm = *rWrt.m_pDataStrm;
1794 // position of hyperlink data
1795 const sal_uInt32 nLinkPosInDataStrm = rStrm.Tell();
1796 // write empty header
1797 const sal_uInt16 nEmptyHdrLen = 0x44;
1798 sal_uInt8 aEmptyHeader[ nEmptyHdrLen ] = { 0 };
1799 aEmptyHeader[ 4 ] = 0x44;
1800 rStrm.WriteBytes( aEmptyHeader, nEmptyHdrLen );
1801 // writer fixed header
1802 const sal_uInt16 nFixHdrLen = 0x19;
1803 sal_uInt8 const aFixHeader[ nFixHdrLen ] =
1804 {
1805 0x08, 0xD0, 0xC9, 0xEA, 0x79, 0xF9, 0xBA, 0xCE,
1806 0x11, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9,
1807 0x0B, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
1808 0x00,
1809 };
1810 rStrm.WriteBytes( aFixHeader, nFixHdrLen );
1811 // write reference string including length+1
1812 sal_uInt32 nStrLen( pLinkStr->getLength() + 1 );
1813 SwWW8Writer::WriteLong( rStrm, nStrLen );
1814 SwWW8Writer::WriteString16( rStrm, *pLinkStr, false );
1815 // write additional two NULL Bytes
1817 // write length of hyperlink data
1818 const sal_uInt32 nCurrPos = rStrm.Tell();
1819 rStrm.Seek( nLinkPosInDataStrm );
1820 rStrm.WriteUInt32(nCurrPos - nLinkPosInDataStrm);
1821 rStrm.Seek( nCurrPos );
1822
1823 // write attributes of hyperlink character 0x01
1825 aItems.push_back( sal_uInt8(0x81) );
1827 SwWW8Writer::InsUInt32( aItems, nLinkPosInDataStrm );
1829 aItems.push_back( sal_uInt8(0x01) );
1830 }
1831
1832 //Technically we should probably Remove all attribs
1833 //here for the 0x13, 0x14, 0x15, but our import
1834 //is slightly lacking
1835 //aItems.Remove(0, aItems.Count());
1836 // fSpec-Attribute true
1838 aItems.push_back( 1 );
1839
1840 rWrt.m_pChpPlc->AppendFkpEntry(rWrt.Strm().Tell(), aItems.size(), aItems.data());
1841}
1842
1843static OUString lcl_GetExpandedField(const SwField &rField)
1844{
1845 //replace LF 0x0A with VT 0x0B
1846 return rField.ExpandField(true, nullptr).replace(0x0A, 0x0B);
1847}
1848
1850{
1851 WW8_WrPlcField* pFieldP = nullptr;
1852 switch (m_nTextTyp)
1853 {
1854 case TXT_MAINTEXT:
1855 pFieldP = m_pFieldMain.get();
1856 break;
1857 case TXT_HDFT:
1858 pFieldP = m_pFieldHdFt.get();
1859 break;
1860 case TXT_FTN:
1861 pFieldP = m_pFieldFootnote.get();
1862 break;
1863 case TXT_EDN:
1864 pFieldP = m_pFieldEdn.get();
1865 break;
1866 case TXT_ATN:
1867 pFieldP = m_pFieldAtn.get();
1868 break;
1869 case TXT_TXTBOX:
1870 pFieldP = m_pFieldTextBxs.get();
1871 break;
1872 case TXT_HFTXTBOX:
1873 pFieldP = m_pFieldHFTextBxs.get();
1874 break;
1875 default:
1876 OSL_ENSURE( false, "what type of SubDoc is that?" );
1877 }
1878 return pFieldP;
1879}
1880
1881void WW8Export::OutputField( const SwField* pField, ww::eField eFieldType,
1882 const OUString& rFieldCmd, FieldFlags nMode )
1883{
1884 OUString sFieldCmd(rFieldCmd);
1885 switch (eFieldType)
1886 {
1887 // map fields that are not supported in WW8 as of Word 2003
1888 case ww::eBIBLIOGRAPHY:
1889 eFieldType = ww::eQUOTE;
1890 assert(rFieldCmd == FieldString(ww::eBIBLIOGRAPHY));
1891 sFieldCmd = FieldString(ww::eQUOTE);
1892 break;
1893 case ww::eCITATION:
1894 eFieldType = ww::eQUOTE;
1895 assert(o3tl::starts_with(o3tl::trim(rFieldCmd), u"CITATION"));
1896 sFieldCmd = rFieldCmd.replaceFirst(FieldString(ww::eCITATION),
1898 break;
1899 default:
1900 break;
1901 }
1902
1903 assert(eFieldType <= 0x5F); // 95 is the highest documented one
1904
1905 WW8_WrPlcField* pFieldP = CurrentFieldPlc();
1906
1907 const bool bIncludeEmptyPicLocation = ( eFieldType == ww::ePAGE );
1908 if (FieldFlags::Start & nMode)
1909 {
1910 sal_uInt8 aField13[2] = { 0x13, 0x00 }; // will change
1911 //#i3958#, Needed to make this field work correctly in Word 2000
1912 if (eFieldType == ww::eSHAPE)
1913 aField13[0] |= 0x80;
1914 aField13[1] = static_cast< sal_uInt8 >(eFieldType); // add type
1915 pFieldP->Append( Fc2Cp( Strm().Tell() ), aField13 );
1916 InsertSpecialChar( *this, 0x13, nullptr, bIncludeEmptyPicLocation );
1917 }
1918 if (FieldFlags::CmdStart & nMode)
1919 {
1920 SwWW8Writer::WriteString16(Strm(), sFieldCmd, false);
1921 // #i43956# - write hyperlink character including
1922 // attributes and corresponding binary data for certain reference fields.
1923 bool bHandleBookmark = false;
1924
1925 if (pField)
1926 {
1927 if (pField->GetTyp()->Which() == SwFieldIds::GetRef &&
1928 ( eFieldType == ww::ePAGEREF || eFieldType == ww::eREF ||
1929 eFieldType == ww::eNOTEREF || eFieldType == ww::eFOOTREF ))
1930 bHandleBookmark = true;
1931 }
1932
1933 if ( bHandleBookmark )
1934 {
1935 // retrieve reference destination - the name of the bookmark
1936 OUString aLinkStr;
1937 const sal_uInt16 nSubType = pField->GetSubType();
1938 const SwGetRefField& rRField = *static_cast<const SwGetRefField*>(pField);
1939 if ( nSubType == REF_SETREFATTR ||
1940 nSubType == REF_BOOKMARK )
1941 {
1942 const OUString& aRefName(rRField.GetSetRefName());
1943 aLinkStr = GetBookmarkName( nSubType, &aRefName, 0 );
1944 }
1945 else if ( nSubType == REF_FOOTNOTE ||
1946 nSubType == REF_ENDNOTE )
1947 {
1948 aLinkStr = GetBookmarkName( nSubType, nullptr, rRField.GetSeqNo() );
1949 }
1950 else if ( nSubType == REF_SEQUENCEFLD )
1951 {
1952 aLinkStr = pField->GetPar2();
1953 }
1954 // insert hyperlink character including attributes and data.
1955 InsertSpecialChar( *this, 0x01, &aLinkStr );
1956 }
1957 }
1958 if (FieldFlags::CmdEnd & nMode)
1959 {
1960 static const sal_uInt8 aField14[2] = { 0x14, 0xff };
1961 pFieldP->Append( Fc2Cp( Strm().Tell() ), aField14 );
1962 pFieldP->ResultAdded();
1963 InsertSpecialChar( *this, 0x14, nullptr, bIncludeEmptyPicLocation );
1964 }
1965 if (FieldFlags::End & nMode)
1966 {
1967 OUString sOut;
1968 if( pField )
1969 sOut = lcl_GetExpandedField(*pField);
1970 else
1971 sOut = sFieldCmd;
1972 if( !sOut.isEmpty() )
1973 {
1974 SwWW8Writer::WriteString16(Strm(), sOut, false);
1975
1976 if (pField)
1977 {
1978 if (pField->GetTyp()->Which() == SwFieldIds::Input &&
1979 eFieldType == ww::eFORMTEXT)
1980 {
1981 sal_uInt8 aArr[12];
1982 sal_uInt8 *pArr = aArr;
1983
1985 Set_UInt32( pArr, 0x0 );
1986
1988 Set_UInt8( pArr, 1 );
1989
1991 Set_UInt8( pArr, 1 );
1992
1993 m_pChpPlc->AppendFkpEntry( Strm().Tell(), static_cast< short >(pArr - aArr), aArr );
1994 }
1995 }
1996 }
1997 }
1998 if (!(FieldFlags::Close & nMode))
1999 return;
2000
2001 sal_uInt8 aField15[2] = { 0x15, 0x80 };
2002
2003 if (pField)
2004 {
2005 if (pField->GetTyp()->Which() == SwFieldIds::Input &&
2006 eFieldType == ww::eFORMTEXT)
2007 {
2008 sal_uInt16 nSubType = pField->GetSubType();
2009
2010 if (nSubType == REF_SEQUENCEFLD)
2011 aField15[0] |= (0x4 << 5);
2012 }
2013 // This ought to apply to any field, but just to be safe, start off with DATE/TIME only.
2014 if (pField->GetTyp()->Which() == SwFieldIds::DateTime
2015 && (pField->GetSubType() & FIXEDFLD))
2016 {
2017 //bit 5 - Locked: do not recalculate field
2018 aField15[1] |= 0x10;
2019 }
2020 }
2021
2022 pFieldP->Append( Fc2Cp( Strm().Tell() ), aField15 );
2023 InsertSpecialChar( *this, 0x15, nullptr, bIncludeEmptyPicLocation );
2024}
2025
2026void WW8Export::StartCommentOutput(std::u16string_view rName)
2027{
2028 const OUString sStr{ FieldString(ww::eQUOTE) + "[" + rName + "] " };
2030}
2031
2032void WW8Export::EndCommentOutput(std::u16string_view rName)
2033{
2034 const OUString sStr{ OUString::Concat(" [") + rName + "] " };
2037}
2038
2039sal_uInt16 MSWordExportBase::GetId( const SwTOXType& rTOXType )
2040{
2041 std::vector<const SwTOXType*>::iterator it
2042 = std::find( m_aTOXArr.begin(), m_aTOXArr.end(), &rTOXType );
2043 if ( it != m_aTOXArr.end() )
2044 {
2045 return it - m_aTOXArr.begin();
2046 }
2047 m_aTOXArr.push_back( &rTOXType );
2048 return m_aTOXArr.size() - 1;
2049}
2050
2051// return values: 1 - no PageNum,
2052// 2 - TabStop before PageNum,
2053// 3 - Text before PageNum - rText hold the text
2054// 4 - no Text and no TabStop before PageNum
2055static int lcl_CheckForm( const SwForm& rForm, sal_uInt8 nLvl, OUString& rText )
2056{
2057 int nRet = 4;
2058 rText.clear();
2059
2060 // #i21237#
2061 SwFormTokens aPattern = rForm.GetPattern(nLvl);
2062 SwFormTokens::iterator aIt = aPattern.begin();
2063 FormTokenType eTType;
2064
2065 // #i61362#
2066 if (! aPattern.empty())
2067 {
2068 bool bPgNumFnd = false;
2069
2070 // #i21237#
2071 while( ++aIt != aPattern.end() && !bPgNumFnd )
2072 {
2073 eTType = aIt->eTokenType;
2074
2075 switch( eTType )
2076 {
2077 case TOKEN_PAGE_NUMS:
2078 bPgNumFnd = true;
2079 break;
2080
2081 case TOKEN_TAB_STOP:
2082 nRet = 2;
2083 break;
2084 case TOKEN_TEXT:
2085 {
2086 nRet = 3;
2087 sal_Int32 nCount = std::min<sal_Int32>(5, aIt->sText.getLength());
2088 rText = aIt->sText.copy(0, nCount); // #i21237#
2089 break;
2090 }
2091 case TOKEN_LINK_START:
2092 case TOKEN_LINK_END:
2093 break;
2094
2095 default:
2096 nRet = 4;
2097 break;
2098 }
2099 }
2100
2101 if( !bPgNumFnd )
2102 nRet = 1;
2103 }
2104
2105 return nRet;
2106}
2107
2108static bool lcl_IsHyperlinked(const SwForm& rForm, sal_uInt16 nTOXLvl)
2109{
2110 bool bRes = false;
2111 for (sal_uInt16 nI = 1; nI <= nTOXLvl; ++nI)
2112 {
2113 // #i21237#
2114 SwFormTokens aPattern = rForm.GetPattern(nI);
2115
2116 if ( !aPattern.empty() )
2117 {
2118 SwFormTokens::iterator aIt = aPattern.begin();
2119
2120 FormTokenType eTType;
2121
2122 // #i21237#
2123 while ( ++aIt != aPattern.end() )
2124 {
2125 eTType = aIt->eTokenType;
2126 switch (eTType)
2127 {
2128 case TOKEN_LINK_START:
2129 case TOKEN_LINK_END:
2130 bRes = true;
2131 break;
2132 default:
2133 ;
2134 }
2135 }
2136 }
2137 }
2138 return bRes;
2139}
2140
2142{
2143 if(GetExport().GetExportFormat() == MSWordExportBase::ExportFormat::RTF) // Not implemented for RTF
2144 return;
2145
2146 const SwpHints* pTextAttrs = rNode.GetpSwpHints();
2147 if (!pTextAttrs)
2148 return;
2149
2150 for( size_t i = 0; i < pTextAttrs->Count(); ++i )
2151 {
2152 const SwTextAttr* pHt = pTextAttrs->Get(i);
2153 if (pHt->GetAttr().Which() == RES_TXTATR_FIELD)
2154 {
2155 const SwFormatField& rField = static_cast<const SwFormatField&>(pHt->GetAttr());
2156 const SwField* pField = rField.GetField();
2157 // Need to have bookmarks only for sequence fields
2158 if (pField && pField->GetTyp()->Which() == SwFieldIds::SetExp && pField->GetSubType() == nsSwGetSetExpType::GSE_SEQ)
2159 {
2160 const sal_uInt16 nSeqFieldNumber = static_cast<const SwSetExpField*>(pField)->GetSeqNumber();
2161 const OUString sObjectName = static_cast<const SwSetExpFieldType*>(pField->GetTyp())->GetName();
2163 bool bHaveFullBkm = false;
2164 bool bHaveLabelAndNumberBkm = false;
2165 bool bHaveCaptionOnlyBkm = false;
2166 bool bHaveNumberOnlyBkm = false;
2167 bool bRunSplittedAtSep = false;
2168 for( auto const & pFieldType : *pFieldTypes )
2169 {
2170 if( SwFieldIds::GetRef == pFieldType->Which() )
2171 {
2172 SwIterator<SwFormatField,SwFieldType> aIter( *pFieldType );
2173 for( SwFormatField* pFormatField = aIter.First(); pFormatField; pFormatField = aIter.Next() )
2174 {
2175 SwGetRefField* pRefField = static_cast<SwGetRefField*>(pFormatField->GetField());
2176 // If we have a reference to the current sequence field
2177 if(pRefField->GetSeqNo() == nSeqFieldNumber && pRefField->GetSetRefName() == sObjectName)
2178 {
2179 // Need to create a separate run for separator character
2180 SwWW8AttrIter aLocalAttrIter( GetExport(), rNode ); // We need a local iterator having the right number of runs
2181 const OUString& aText = rNode.GetText();
2182 const sal_Int32 nCategoryStart = aText.indexOf(pRefField->GetSetRefName());
2183 const sal_Int32 nPosBeforeSeparator = std::max(nCategoryStart, pHt->GetStart());
2184 bool bCategoryFirst = nCategoryStart < pHt->GetStart();
2185 sal_Int32 nSeparatorPos = 0;
2186 if (bCategoryFirst)
2187 {
2188 nSeparatorPos = aLocalAttrIter.WhereNext();
2189 while (nSeparatorPos <= nPosBeforeSeparator)
2190 {
2191 aLocalAttrIter.NextPos();
2192 nSeparatorPos = aLocalAttrIter.WhereNext();
2193 }
2194 }
2195 else
2196 {
2197 nSeparatorPos = nCategoryStart + pRefField->GetSetRefName().getLength();
2198 }
2199 sal_Int32 nRefTextPos = 0;
2200 if(nSeparatorPos < aText.getLength())
2201 {
2202 nRefTextPos = SwGetExpField::GetReferenceTextPos(pHt->GetFormatField(), GetExport().m_rDoc, nSeparatorPos);
2203 if(nRefTextPos != nSeparatorPos)
2204 {
2205 if(!bRunSplittedAtSep)
2206 {
2207 if(!bCategoryFirst)
2208 rAttrIter.SplitRun(nSeparatorPos);
2209 rAttrIter.SplitRun(nRefTextPos);
2210 bRunSplittedAtSep = true;
2211 }
2212 if(!bCategoryFirst)
2213 aLocalAttrIter.SplitRun(nSeparatorPos);
2214 aLocalAttrIter.SplitRun(nRefTextPos);
2215 }
2216 else if (bCategoryFirst)
2217 {
2218 if(!bRunSplittedAtSep)
2219 {
2220 rAttrIter.SplitRun(nSeparatorPos);
2221 bRunSplittedAtSep = true;
2222 }
2223 aLocalAttrIter.SplitRun(nSeparatorPos);
2224 }
2225 }
2226 // Generate bookmarks on the right position
2227 OUString sName("Ref_" + pRefField->GetSetRefName() + OUString::number(pRefField->GetSeqNo()));
2228 switch (pRefField->GetFormat())
2229 {
2230 case REF_PAGE:
2231 case REF_PAGE_PGDESC:
2232 case REF_CONTENT:
2233 case REF_UPDOWN:
2234 if(!bHaveFullBkm)
2235 {
2236 sal_Int32 nLastAttrStart = 0;
2237 sal_Int32 nActAttr = aLocalAttrIter.WhereNext();
2238 while (nActAttr < rNode.GetText().getLength())
2239 {
2240 nLastAttrStart = nActAttr;
2241 aLocalAttrIter.NextPos();
2242 nActAttr = aLocalAttrIter.WhereNext();
2243 }
2244 WriteBookmarkInActParagraph( sName + "_full", std::min(nCategoryStart, pHt->GetStart()), nLastAttrStart );
2245 bHaveFullBkm = true;
2246 }
2247 break;
2248 case REF_ONLYNUMBER:
2249 {
2250 if(!bHaveLabelAndNumberBkm)
2251 {
2252 sName += "_label_and_number";
2253 if(bCategoryFirst)
2254 WriteBookmarkInActParagraph( sName, std::min(nCategoryStart, pHt->GetStart()), std::max(nCategoryStart, pHt->GetStart()) );
2255 else
2256 {
2257 // Find the last run which contains category text
2258 SwWW8AttrIter aLocalAttrIter2( GetExport(), rNode );
2259 sal_Int32 nCatLastRun = 0;
2260 sal_Int32 nNextAttr = aLocalAttrIter2.WhereNext();
2261 while (nNextAttr < nSeparatorPos)
2262 {
2263 nCatLastRun = nNextAttr;
2264 aLocalAttrIter2.NextPos();
2265 nNextAttr = aLocalAttrIter2.WhereNext();
2266 }
2267 WriteBookmarkInActParagraph( sName, pHt->GetStart(), nCatLastRun );
2268 }
2269 bHaveLabelAndNumberBkm = true;
2270 }
2271 break;
2272 }
2273 case REF_ONLYCAPTION:
2274 {
2275 if(!bHaveCaptionOnlyBkm)
2276 {
2277 // Find last run
2278 sal_Int32 nLastAttrStart = 0;
2279 sal_Int32 nActAttr = aLocalAttrIter.WhereNext();
2280 while (nActAttr < rNode.GetText().getLength())
2281 {
2282 nLastAttrStart = nActAttr;
2283 aLocalAttrIter.NextPos();
2284 nActAttr = aLocalAttrIter.WhereNext();
2285 }
2286 WriteBookmarkInActParagraph( sName + "_caption_only", nRefTextPos, nLastAttrStart );
2287 bHaveCaptionOnlyBkm = true;
2288 }
2289 break;
2290 }
2291 case REF_ONLYSEQNO:
2292 {
2293 if(!bHaveNumberOnlyBkm)
2294 {
2295 WriteBookmarkInActParagraph( sName + "_number_only", pHt->GetStart(), pHt->GetStart() );
2296 bHaveNumberOnlyBkm = true;
2297 }
2298 break;
2299 }
2300 }
2301 }
2302 }
2303 }
2304 }
2305 return;
2306 }
2307 }
2308 }
2309}
2310
2311static auto GetSeparatorForLocale() -> OUString
2312{
2313 switch (sal_uInt16(MsLangId::getSystemLanguage()))
2314 {
2315 case sal_uInt16(LANGUAGE_GERMAN):
2316 case sal_uInt16(LANGUAGE_GERMAN_AUSTRIAN):
2317 case sal_uInt16(LANGUAGE_GERMAN_LIECHTENSTEIN):
2318 case sal_uInt16(LANGUAGE_GERMAN_LUXEMBOURG):
2319 case sal_uInt16(LANGUAGE_GERMAN_SWISS):
2320 return ";";
2321 default:
2322 return ",";
2323 }
2324}
2325
2327{
2328 if ( const SwTOXBase* pTOX = rSect.GetTOXBase() )
2329 {
2330 static const char sEntryEnd[] = "\" ";
2331
2332 ww::eField eCode = ww::eTOC;
2333 OUString sStr = pTOX ->GetMSTOCExpression();
2334 if ( sStr.isEmpty() )
2335 {
2336 OUString sUserTypeName;
2337 auto aType = pTOX->GetType();
2338 // user index, it needs INDEX with \f
2339 if ( TOX_USER == aType )
2340 {
2341 sUserTypeName = pTOX->GetTOXType()->GetTypeName();
2342 if ( !sUserTypeName.isEmpty() )
2343 aType = TOX_INDEX;
2344 }
2345 switch (aType)
2346 {
2347 case TOX_INDEX:
2348 eCode = ww::eINDEX;
2349 sStr = FieldString(eCode);
2350
2351 {
2352 const SwFormatCol& rCol = rSect.GetFormat()->GetFormatAttr( RES_COL );
2353 const SwColumns& rColumns = rCol.GetColumns();
2354 sal_Int32 nCol = rColumns.size();
2355
2356 if ( 0 < nCol )
2357 {
2358 // Add a continuous section break
2359 if( GetExport().AddSectionBreaksForTOX() )
2360 {
2361 SwSection *pParent = rSect.GetParent();
2363 pParent ? pParent->GetFormat() : nullptr, 0/*nRstLnNum*/);
2364 GetExport( ).AttrOutput().SectionBreak( msword::PageBreak, false, &rInfo );
2365 }
2366
2367 sStr += "\\c \"" + OUString::number( nCol ) + "\"";
2368 }
2369 }
2370
2371 if (pTOX->GetTOXForm().IsCommaSeparated())
2372 sStr += "\\r ";
2373
2374 if (SwTOIOptions::AlphaDelimiter & pTOX->GetOptions())
2375 sStr += "\\h \"A\" ";
2376
2377 if (!sUserTypeName.isEmpty())
2378 {
2379 sStr += "\\f \"" + sUserTypeName + "\"";
2380 }
2381
2382 if (!pTOX->GetTOXForm().IsCommaSeparated())
2383 {
2384 // In case of Run-in style no separators are added.
2385 OUString aFillText;
2386 for (sal_uInt8 n = 1; n <= 3; ++n)
2387 {
2388 OUString aText;
2389 int nRet = ::lcl_CheckForm(pTOX->GetTOXForm(), n, aText);
2390
2391 if( 3 == nRet )
2392 aFillText = aText;
2393 else if ((4 == nRet) || (2 == nRet))
2394 aFillText = "\t";
2395 else
2396 aFillText.clear();
2397 }
2398 sStr += "\\e \"" + aFillText + sEntryEnd;
2399 }
2400 break;
2401
2402 case TOX_ILLUSTRATIONS:
2403 case TOX_OBJECTS:
2404 case TOX_TABLES:
2405 if (!pTOX->IsFromObjectNames())
2406 {
2407 sStr = FieldString(eCode) + "\\c ";
2408 const OUString& seqName = pTOX->GetSequenceName();
2409 if(!seqName.isEmpty())
2410 {
2411 sStr += "\"" + seqName + sEntryEnd;
2412 }
2413 OUString aText;
2414 int nRet = ::lcl_CheckForm( pTOX->GetTOXForm(), 1, aText );
2415 if (1 == nRet)
2416 sStr += "\\n ";
2417 else if( 3 == nRet || 4 == nRet )
2418 {
2419 sStr += "\\p \"" + aText + sEntryEnd;
2420 }
2421 }
2422 if (lcl_IsHyperlinked(pTOX->GetTOXForm(), 1))
2423 {
2424 sStr += "\\h ";
2425 }
2426 if (pTOX->GetCreateType() & SwTOXElement::Template)
2427 {
2428 OUString const& rStyle(pTOX->GetStyleNames(0));
2429 assert(rStyle.indexOf(TOX_STYLE_DELIMITER) == -1);
2430 SwTextFormatColl const*const pColl = GetExport().m_rDoc.FindTextFormatCollByName(rStyle);
2431 if (pColl)
2432 {
2433 OUString const converted(GetExport().m_pStyles->GetStyleWWName(pColl));
2434 if (!converted.isEmpty())
2435 {
2436 sStr += "\\t \"" + converted + sEntryEnd;
2437 }
2438 }
2439 }
2440 break;
2441
2442 case TOX_AUTHORITIES:
2443 eCode = ww::eBIBLIOGRAPHY;
2444 sStr = FieldString(eCode);
2445 break;
2446 // case TOX_USER:
2447 // case TOX_CONTENT:
2448 default:
2449 {
2450 sStr = FieldString(eCode);
2451
2452 OUString sTOption;
2453 // tdf#153082 Word's separator interpretation in DOCX
2454 // fields varies by system locale.
2455 auto const tsep(GetSeparatorForLocale());
2456 sal_uInt16 n, nTOXLvl = pTOX->GetLevel();
2457 if( !nTOXLvl )
2458 ++nTOXLvl;
2459
2460 if(SwTOXElement::TableLeader & pTOX->GetCreateType())
2461 {
2462 sStr +="\\z " ;
2464 }
2465 if(SwTOXElement::TableInToc & pTOX->GetCreateType())
2466 {
2467 sStr +="\\w " ;
2468 GetExport( ).m_bTabInTOC = true ;
2469 }
2470 if(SwTOXElement::Newline & pTOX->GetCreateType())
2471 {
2472 sStr +="\\x " ;
2473 }
2474 if( SwTOXElement::Mark & pTOX->GetCreateType() )
2475 {
2476 sStr += "\\f ";
2477
2478 if( TOX_USER == pTOX->GetType() )
2479 {
2480 sStr += "\""
2481 + OUStringChar(static_cast<char>( 'A' + GetExport( ).GetId( *pTOX->GetTOXType() ) ))
2482 + sEntryEnd;
2483 }
2484 }
2485 if(SwTOXElement::Bookmark & pTOX->GetCreateType())
2486 {
2487 sStr += "\\b \"" + pTOX->GetBookmarkName() + sEntryEnd;
2488 }
2489
2490 if( SwTOXElement::OutlineLevel & pTOX->GetCreateType() )
2491 {
2492 // Take the TOC value of the max level to evaluate to as
2493 // the starting point for the \o flag, but reduce it to the
2494 // value of the highest outline level filled by a *standard*
2495 // Heading 1 - 9 style because \o "Builds a table of
2496 // contents from paragraphs formatted with built-in heading
2497 // styles". And afterward fill in any outline styles left
2498 // uncovered by that range to the \t flag
2499
2500 // i.e. for
2501 // Heading 1
2502 // Heading 2
2503 // custom-style
2504 // Heading 4
2505 // output
2506 // \o 1-2 \tcustom-style,3,Heading 3,4
2507
2508 // Search over all the outline styles used and figure out
2509 // what is the minimum outline level (if any) filled by a
2510 // non-standard style for that level, i.e. ignore headline
2511 // styles 1-9 and find the lowest valid outline level
2512 sal_uInt8 nPosOfLowestNonStandardLvl = MAXLEVEL;
2514 for( n = rColls.size(); n; )
2515 {
2516 const SwTextFormatColl* pColl = rColls[ --n ];
2517 sal_uInt16 nPoolId = pColl->GetPoolFormatId();
2518 if (
2519 //Is a Non-Standard Outline Style
2520 (RES_POOLCOLL_HEADLINE1 > nPoolId || RES_POOLCOLL_HEADLINE9 < nPoolId) &&
2521 //Has a valid outline level
2523 // Is less than the lowest known non-standard level
2524 (pColl->GetAssignedOutlineStyleLevel() < nPosOfLowestNonStandardLvl)
2525 )
2526 {
2527 nPosOfLowestNonStandardLvl = ::sal::static_int_cast<sal_uInt8>(pColl->GetAssignedOutlineStyleLevel());
2528 }
2529 }
2530
2531 sal_uInt8 nMaxMSAutoEvaluate = nPosOfLowestNonStandardLvl < nTOXLvl ? nPosOfLowestNonStandardLvl : static_cast<sal_uInt8>(nTOXLvl);
2532
2533 //output \o 1-X where X is the highest normal outline style to be included in the toc
2534 if ( nMaxMSAutoEvaluate )
2535 {
2536 if (nMaxMSAutoEvaluate > WW8ListManager::nMaxLevel)
2537 nMaxMSAutoEvaluate = WW8ListManager::nMaxLevel;
2538
2539 sStr += "\\o \"1-" + OUString::number(nMaxMSAutoEvaluate) + sEntryEnd;
2540 }
2541
2542 //collect up any other styles in the writer TOC which will
2543 //not already appear in the MS TOC and place then into the
2544 //\t option
2545 if( nMaxMSAutoEvaluate < nTOXLvl )
2546 {
2547 // collect this templates into the \t option
2548 for( n = rColls.size(); n;)
2549 {
2550 const SwTextFormatColl* pColl = rColls[ --n ];
2552 continue;
2553 sal_uInt8 nTestLvl = ::sal::static_int_cast<sal_uInt8>(pColl->GetAssignedOutlineStyleLevel());
2554 if (nTestLvl < nTOXLvl && nTestLvl >= nMaxMSAutoEvaluate)
2555 {
2556 if (!sTOption.isEmpty())
2557 sTOption += tsep;
2558 sTOption += pColl->GetName() + tsep + OUString::number(nTestLvl + 1);
2559 }
2560 }
2561 }
2562 }
2563
2564 if( SwTOXElement::ParagraphOutlineLevel & pTOX->GetCreateType() )
2565 {
2566 sStr +="\\u " ;
2567 }
2568
2569 if( SwTOXElement::Template & pTOX->GetCreateType() )
2570 {
2571 // #i99641# - Consider additional styles regardless of TOX-outlinelevel
2572 for( n = 0; n < MAXLEVEL; ++n )
2573 {
2574 const OUString& rStyles = pTOX->GetStyleNames( n );
2575 if( !rStyles.isEmpty() )
2576 {
2577 sal_Int32 nPos = 0;
2578 const OUString sLvl{tsep + OUString::number(n + 1)};
2579 do {
2580 const OUString sStyle( rStyles.getToken( 0, TOX_STYLE_DELIMITER, nPos ));
2581 if( !sStyle.isEmpty() )
2582 {
2584 if (pColl)
2585 {
2586 OUString const converted(GetExport().m_pStyles->GetStyleWWName(pColl));
2587 if (!converted.isEmpty() &&
2589 || pColl->GetAssignedOutlineStyleLevel() < nTOXLvl))
2590 {
2591 if( !sTOption.isEmpty() )
2592 sTOption += tsep;
2593 sTOption += converted + sLvl;
2594 }
2595 }
2596 }
2597 } while( -1 != nPos );
2598 }
2599 }
2600 }
2601
2602 // No 'else' branch; why the below snippet is a block I have no idea.
2603 {
2604 OUString aFillText;
2605 sal_uInt8 nNoPgStt = MAXLEVEL, nNoPgEnd = MAXLEVEL;
2606 bool bFirstFillText = true, bOnlyText = true;
2607 for( n = 0; n < nTOXLvl; ++n )
2608 {
2609 OUString aText;
2610 int nRet = ::lcl_CheckForm( pTOX->GetTOXForm(),
2611 static_cast< sal_uInt8 >(n+1), aText );
2612 if( 1 == nRet )
2613 {
2614 bOnlyText = false;
2615 if( MAXLEVEL == nNoPgStt )
2616 nNoPgStt = static_cast< sal_uInt8 >(n+1);
2617 }
2618 else
2619 {
2620 if( MAXLEVEL != nNoPgStt &&
2621 MAXLEVEL == nNoPgEnd )
2622 nNoPgEnd = sal_uInt8(n);
2623
2624 bOnlyText = bOnlyText && 3 == nRet;
2625 if( 3 == nRet || 4 == nRet )
2626 {
2627 if( bFirstFillText )
2628 aFillText = aText;
2629 else if( aFillText != aText )
2630 aFillText.clear();
2631 bFirstFillText = false;
2632 }
2633 }
2634 }
2635 if( MAXLEVEL != nNoPgStt )
2636 {
2637 if (WW8ListManager::nMaxLevel < nNoPgEnd)
2638 nNoPgEnd = WW8ListManager::nMaxLevel;
2639 sStr += "\\n "
2640 + OUString::number( nNoPgStt )
2641 + "-"
2642 + OUString::number( nNoPgEnd )
2643 + " ";
2644 }
2645 if( bOnlyText )
2646 {
2647 sStr += "\\p \"" + aFillText + sEntryEnd;
2648 }
2649 }
2650
2651 if( !sTOption.isEmpty() )
2652 {
2653 sStr += "\\t \"" + sTOption + sEntryEnd;
2654 }
2655
2656 if (lcl_IsHyperlinked(pTOX->GetTOXForm(), nTOXLvl))
2657 sStr += "\\h";
2658 break;
2659 }
2660 }
2661 }
2662
2663 if (!sStr.isEmpty())
2664 {
2665 GetExport( ).m_bInWriteTOX = true;
2666 if (GetExport().GetExportFormat() == MSWordExportBase::ExportFormat::RTF)
2667 { // tdf#129574: required for RTF; doesn't work with DOCX
2668 StartRun(nullptr, -42, true);
2669 }
2670 GetExport( ).OutputField( nullptr, eCode, sStr, FieldFlags::Start | FieldFlags::CmdStart |
2672 if (GetExport().GetExportFormat() == MSWordExportBase::ExportFormat::RTF)
2673 {
2674 EndRun(nullptr, -42, -1, true);
2675 }
2676 }
2677 }
2678
2679 GetExport( ).m_bStartTOX = false;
2680}
2681
2682void AttributeOutputBase::EndTOX( const SwSection& rSect,bool bCareEnd )
2683{
2684 const SwTOXBase* pTOX = rSect.GetTOXBase();
2685 if ( pTOX )
2686 {
2687 ww::eField eCode = TOX_INDEX == pTOX->GetType() ? ww::eINDEX : ww::eTOC;
2688 GetExport( ).OutputField( nullptr, eCode, OUString(), FieldFlags::Close );
2689
2690 if ( pTOX->GetType() == TOX_INDEX && GetExport().AddSectionBreaksForTOX() )
2691 {
2692 const SwFormatCol& rCol = rSect.GetFormat()->GetFormatAttr( RES_COL );
2693 const SwColumns& rColumns = rCol.GetColumns();
2694 sal_Int32 nCol = rColumns.size();
2695
2696 if ( 0 < nCol )
2697 {
2698 WW8_SepInfo rInfo( &GetExport().m_rDoc.GetPageDesc( 0 ), rSect.GetFormat(), 0/*nRstLnNum*/ );
2699 GetExport( ).AttrOutput().SectionBreak( msword::PageBreak, false, &rInfo );
2700 }
2701 }
2702 }
2703 GetExport( ).m_bInWriteTOX = false;
2705 if (bCareEnd)
2706 OnTOXEnding();
2707}
2708
2709bool MSWordExportBase::GetNumberFormat(const SwField& rField, OUString& rStr)
2710{
2711 // Returns a date or time format string by using the US NfKeywordTable
2712 bool bHasFormat = false;
2714 sal_uInt32 nFormatIdx = rField.GetFormat();
2715 const SvNumberformat* pNumFormat = pNFormatr->GetEntry( nFormatIdx );
2716 if( pNumFormat )
2717 {
2718 LanguageType nLng = rField.GetLanguage();
2719 SAL_WARN_IF(nLng == LANGUAGE_DONTKNOW, "sw.ww8", "unexpected LANGUAGE_DONTKNOW");
2720 if (nLng == LANGUAGE_NONE || nLng == LANGUAGE_DONTKNOW)
2721 {
2722 nLng = pNumFormat->GetLanguage();
2723 }
2724 LocaleDataWrapper aLocDat(pNFormatr->GetComponentContext(),
2725 LanguageTag(nLng));
2726
2727 OUString sFormat(pNumFormat->GetMappedFormatstring(GetNfKeywordTable(),
2728 aLocDat));
2729
2730 if (!sFormat.isEmpty())
2731 {
2733
2734 rStr = "\\@\"" + sFormat + "\" " ;
2735 bHasFormat = true;
2736 }
2737 }
2738 return bHasFormat;
2739}
2740
2741void AttributeOutputBase::GetNumberPara( OUString& rStr, const SwField& rField )
2742{
2743 switch(rField.GetFormat())
2744 {
2747 rStr += "\\* ALPHABETIC ";
2748 break;
2751 rStr += "\\* alphabetic ";
2752 break;
2754 rStr += "\\* ROMAN ";
2755 break;
2757 rStr += "\\* roman ";
2758 break;
2760 rStr += "\\* Ordinal ";
2761 break;
2763 rStr += "\\* Ordtext ";
2764 break;
2766 rStr += "\\* Cardtext ";
2767 break;
2768 default:
2769 OSL_ENSURE(rField.GetFormat() == SVX_NUM_ARABIC,
2770 "Unknown numbering type exported as default of Arabic");
2771 [[fallthrough]];
2772 case SVX_NUM_ARABIC:
2773 rStr += "\\* ARABIC ";
2774 break;
2775 case SVX_NUM_PAGEDESC:
2776 //Nothing, use word's default
2777 break;
2778 }
2779}
2780
2782{
2783 sal_uInt8 aArr[ 3 ];
2784 sal_uInt8* pArr = aArr;
2785
2786 // sprmCFSpec true
2788 Set_UInt8( pArr, 1 );
2789
2790 m_pChpPlc->AppendFkpEntry( Strm().Tell() );
2791 WriteChar( 0x05 ); // Annotation reference
2792
2793 if( pOut )
2794 pOut->insert( pOut->end(), aArr, pArr );
2795 else
2796 m_pChpPlc->AppendFkpEntry( Strm().Tell(), static_cast< short >(pArr - aArr), aArr );
2797}
2798
2799OUString FieldString(ww::eField eIndex)
2800{
2801 if (const char *pField = ww::GetEnglishFieldName(eIndex))
2802 return " " + OUString::createFromAscii(pField) + " ";
2803 return " ";
2804}
2805
2807{
2808 //replace LF 0x0A with VT 0x0B
2809 const OUString sExpand(rField.GetPar2().replace(0x0A, 0x0B));
2810
2811 m_rWW8Export.m_pChpPlc->AppendFkpEntry(m_rWW8Export.Strm().Tell());
2812 SwWW8Writer::WriteString16(m_rWW8Export.Strm(), sExpand, false);
2813 static sal_uInt8 aArr[] =
2814 {
2815 0x3C, 0x08, 0x1
2816 };
2817 m_rWW8Export.m_pChpPlc->AppendFkpEntry(m_rWW8Export.Strm().Tell(), sizeof(aArr), aArr);
2818}
2819
2820void WW8AttributeOutput::SetField( const SwField& rField, ww::eField eType, const OUString& rCmd )
2821{
2822 const SwSetExpField* pSet = static_cast<const SwSetExpField*>(&rField);
2823 const OUString &rVar = pSet->GetPar2();
2824
2826
2827 GetExport().OutputField(&rField, eType, rCmd, FieldFlags::Start |
2829
2830 /*
2831 Is there a bookmark at the start position of this field, if so
2832 move it to the 0x14 of the result of the field. This is what word
2833 does. MoveFieldMarks moves any bookmarks at this position to
2834 the beginning of the field result, and marks the bookmark as a
2835 fieldbookmark which is to be ended before the field end mark
2836 instead of after it like a normal bookmark.
2837 */
2839
2840 if (!rVar.isEmpty())
2841 {
2843 }
2844 GetExport().OutputField(&rField, eType, rCmd, FieldFlags::Close);
2845}
2846
2848{
2849 const SwPostItField *pPField = static_cast<const SwPostItField*>(pField);
2850 m_rWW8Export.m_pAtn->Append( m_rWW8Export.Fc2Cp( m_rWW8Export.Strm().Tell() ), pPField );
2852}
2853
2855{
2856 const SwDropDownField& rField2 = *static_cast<const SwDropDownField*>(pField);
2857 uno::Sequence<OUString> aItems =
2858 rField2.GetItemSequence();
2859 GetExport().DoComboBox(rField2.GetName(),
2860 rField2.GetHelp(),
2861 rField2.GetToolTip(),
2862 rField2.GetSelectedItem(), aItems);
2863 return false;
2864}
2865
2867{
2868 return true; // expand to text?
2869}
2870
2871void WW8AttributeOutput::RefField( const SwField &rField, const OUString &rRef)
2872{
2873 const OUString sStr{ FieldString( ww::eREF ) + "\"" + rRef + "\" " };
2876 const OUString sVar = lcl_GetExpandedField( rField );
2877 if ( !sVar.isEmpty() )
2878 {
2880 }
2882}
2883
2885{
2887}
2888
2889namespace
2890{
2891// Escapes a token string for storing in Word formats. Its import counterpart
2892// is lcl_ExtractToken in writerfilter/source/dmapper/DomainMapper_Impl.cxx
2893OUString EscapeToken(const OUString& rCommand)
2894{
2895 bool bWasEscaped = false;
2896
2897 const int nBufferLen = rCommand.getLength()*1.5;
2898 OUStringBuffer sResult(nBufferLen);
2899 sResult.append('"'); // opening quote
2900 for (sal_Int32 i = 0; i < rCommand.getLength(); ++i)
2901 {
2902 sal_Unicode ch = rCommand[i];
2903 switch (ch)
2904 {
2905 case '\\':
2906 case '"':
2907 // Backslashes and doublequotes must be escaped
2908 bWasEscaped = true;
2909 sResult.append('\\');
2910 break;
2911 case ' ':
2912 // Spaces require quotation
2913 bWasEscaped = true;
2914 break;
2915 }
2916 sResult.append(ch);
2917 }
2918
2919 if (bWasEscaped)
2920 {
2921 sResult.append('"'); // closing quote
2922 return sResult.makeStringAndClear();
2923 }
2924 // No escapement/quotation was required
2925 return rCommand;
2926}
2927}
2928
2930{
2931 const SwField* pField = rField.GetField();
2932 bool bWriteExpand = false;
2933 const sal_uInt16 nSubType = pField->GetSubType();
2934
2935 switch (pField->GetTyp()->Which())
2936 {
2937 case SwFieldIds::GetExp:
2938 if (nSubType == nsSwGetSetExpType::GSE_STRING)
2939 {
2940 const SwGetExpField *pGet = static_cast<const SwGetExpField*>(pField);
2941 RefField( *pGet, pGet->GetFormula() );
2942 }
2943 else
2944 bWriteExpand = true;
2945 break;
2946 case SwFieldIds::SetExp:
2947 if (nsSwGetSetExpType::GSE_SEQ == nSubType)
2948 {
2949 OUString sStr;
2950 if (GetExport().FieldsQuoted())
2951 sStr = FieldString(ww::eSEQ) + pField->GetTyp()->GetName() + " ";
2952 else
2953 sStr = FieldString(ww::eSEQ) + "\"" + pField->GetTyp()->GetName() +"\" ";
2954 GetNumberPara( sStr, *pField );
2955 GetExport().OutputField(pField, ww::eSEQ, sStr);
2956 }
2957 else if (nSubType & nsSwGetSetExpType::GSE_STRING)
2958 {
2959 bool bShowAsWell = false;
2960 ww::eField eFieldNo;
2961 const SwSetExpField *pSet = static_cast<const SwSetExpField*>(pField);
2962 const OUString sVar = pSet->GetPar2();
2963 OUString sStr;
2964 if (pSet->GetInputFlag())
2965 {
2966 sStr = FieldString(ww::eASK) + "\""
2967 + pSet->GetPar1() + "\" "
2968 + pSet->GetPromptText() + " \\d "
2969 + sVar;
2970 eFieldNo = ww::eASK;
2971 }
2972 else
2973 {
2974 sStr = FieldString(ww::eSET)
2975 + pSet->GetPar1() + " \""
2976 + sVar + "\" ";
2977 eFieldNo = ww::eSET;
2978 bShowAsWell = (nSubType & nsSwExtendedSubType::SUB_INVISIBLE) == 0;
2979 }
2980
2981 SetField( *pField, eFieldNo, sStr );
2982
2983 if (bShowAsWell)
2984 RefField( *pSet, pSet->GetPar1() );
2985 }
2986 else
2987 bWriteExpand = true;
2988 break;
2990 {
2991 OUString sStr = FieldString(ww::ePAGE);
2992 GetNumberPara(sStr, *pField);
2993 GetExport().OutputField(pField, ww::ePAGE, sStr);
2994 }
2995 break;
2997 {
2998 OUString sStr = FieldString(ww::eFILENAME);
2999 if (pField->GetFormat() == FF_PATHNAME)
3000 sStr += "\\p ";
3001 GetExport().OutputField(pField, ww::eFILENAME, sStr);
3002 }
3003 break;
3005 {
3006 OUString sStr = FieldString(ww::eMERGEFIELD)
3007 + EscapeToken(static_cast<SwDBFieldType *>(pField->GetTyp())->GetColumnName()) + " ";
3008 GetExport().OutputField(pField, ww::eMERGEFIELD, sStr);
3009 }
3010 break;
3012 {
3014 const OUString sStr = FieldString(ww::eDATABASE)
3015 + aData.sDataSource
3016 + OUStringChar(DB_DELIM)
3017 + aData.sCommand;
3018 GetExport().OutputField(pField, ww::eDATABASE, sStr);
3019 }
3020 break;
3021 case SwFieldIds::Author:
3022 {
3026 }
3027 break;
3030 break;
3031 case SwFieldIds::DocInfo: // Last printed, last edited,...
3032 if( DI_SUB_FIXED & nSubType )
3033 bWriteExpand = true;
3034
3035 {
3036 OUString sStr;
3038 switch (0xff & nSubType)
3039 {
3040 case DI_TITLE:
3042 break;
3043 case DI_SUBJECT:
3045 break;
3046 case DI_KEYS:
3048 break;
3049 case DI_COMMENT:
3051 break;
3052 case DI_DOCNO:
3054 break;
3055 case DI_EDIT:
3057 break;
3058 case DI_CREATE:
3059 if (DI_SUB_AUTHOR == (nSubType & DI_SUB_MASK))
3061 else if (GetExport().GetNumberFormat(*pField, sStr) || sStr.isEmpty())
3063
3064 // Create author/time are always imported as fixed. Safe to ignore on export
3065 bWriteExpand = false;
3066 break;
3067
3068 case DI_CHANGE:
3069 if (DI_SUB_AUTHOR == (nSubType & DI_SUB_MASK))
3070 {
3072 bWriteExpand=false;
3073 }
3074 else if (GetExport().GetNumberFormat(*pField, sStr) || sStr.isEmpty())
3076 break;
3077
3078 case DI_PRINT:
3079 if (DI_SUB_AUTHOR != (nSubType & DI_SUB_MASK) &&
3080 (GetExport().GetNumberFormat(*pField, sStr) || sStr.isEmpty()))
3082 break;
3083 case DI_CUSTOM:
3085 {
3086 const SwDocInfoField * pDocInfoField =
3087 dynamic_cast<const SwDocInfoField *> (pField);
3088
3089 if (pDocInfoField != nullptr)
3090 sStr = "\"" + pDocInfoField->GetName() + "\"";
3091
3092 bWriteExpand = false;
3093 }
3094 break;
3095 default:
3096 break;
3097 }
3098
3099 if (!bWriteExpand && eField != ww::eNONE)
3100 {
3101 GetExport().OutputField(pField, eField, FieldString(eField) + sStr);
3102 }
3103 else
3104 bWriteExpand = true;
3105 }
3106 break;
3108 {
3109 OUString sStr;
3110 if (!GetExport().GetNumberFormat(*pField, sStr))
3111 bWriteExpand = true;
3112 else
3113 {
3114 ww::eField eField = (DATEFLD & nSubType) ? ww::eDATE : ww::eTIME;
3115 GetExport().OutputField(pField, eField, FieldString(eField) + sStr);
3116 }
3117 }
3118 break;
3120 {
3122
3123 switch (nSubType)
3124 {
3125 case DS_PAGE:
3127 break;
3128 case DS_WORD:
3130 break;
3131 case DS_CHAR:
3133 break;
3134 }
3135
3136 if (eField != ww::eNONE)
3137 {
3138 OUString sStr = FieldString(eField);
3139 GetNumberPara(sStr, *pField);
3140 GetExport().OutputField(pField, eField, sStr);
3141 }
3142 else
3143 bWriteExpand = true;
3144 }
3145 break;
3147 {
3149 switch (0xFF & nSubType)
3150 {
3151 case EU_FIRSTNAME:
3152 case EU_NAME:
3154 break;
3155 case EU_SHORTCUT:
3157 break;
3158 case EU_STREET:
3159 case EU_COUNTRY:
3160 case EU_ZIP:
3161 case EU_CITY:
3163 break;
3164 }
3165
3166 if (eField != ww::eNONE)
3167 {
3169 }
3170 else
3171 bWriteExpand = true;
3172 }
3173 break;
3175 {
3176 OUString sRet(static_cast<SwAuthorityField const*>(pField)
3177 ->ExpandCitation(AUTH_FIELD_IDENTIFIER, nullptr));
3178 // FIXME: DomainMapper_Impl::CloseFieldCommand() stuffs fully formed
3179 // field instructions in here, but if the field doesn't originate
3180 // from those filters it won't have that
3181 if (!o3tl::starts_with(o3tl::trim(sRet), u"CITATION"))
3182 {
3183 sRet = FieldString(ww::eCITATION) + " \"" + sRet + "\"";
3184 }
3185 GetExport().OutputField( pField, ww::eCITATION, sRet );
3186 }
3187 break;
3188 case SwFieldIds::Postit:
3189 //Sadly only possible for word in main document text
3190 if (GetExport().m_nTextTyp == TXT_MAINTEXT)
3191 {
3192 PostitField( pField );
3193 }
3194 break;
3195 case SwFieldIds::Input:
3196 {
3197 const SwInputField * pInputField = dynamic_cast<const SwInputField *>(pField);
3198
3199 if (pInputField && pInputField->isFormField())
3200 GetExport().DoFormText(pInputField);
3201 else
3202 {
3203 const OUString sStr = FieldString(ww::eFILLIN) + "\""
3204 + pField->GetPar2() + "\"";
3205
3206 GetExport().OutputField(pField, ww::eFILLIN, sStr);
3207 }
3208 }
3209 break;
3210 case SwFieldIds::GetRef:
3211 {
3213 OUString sStr;
3214 const SwGetRefField& rRField = *static_cast<const SwGetRefField*>(pField);
3215 switch (nSubType)
3216 {
3217 case REF_SETREFATTR:
3218 case REF_BOOKMARK:
3219 switch (pField->GetFormat())
3220 {
3221 case REF_PAGE_PGDESC:
3222 case REF_PAGE:
3224 break;
3225 default:
3226 eField = ww::eREF;
3227 break;
3228 }
3229 {
3230 const OUString& aRefName(rRField.GetSetRefName());
3231 sStr = FieldString(eField)
3232 + MSWordExportBase::GetBookmarkName(nSubType, &aRefName, 0);
3233 }
3234 switch (pField->GetFormat())
3235 {
3236 case REF_NUMBER:
3237 sStr += " \\r";
3238 break;
3240 sStr += " \\n";
3241 break;
3243 sStr += " \\w";
3244 break;
3245 }
3246 break;
3247 case REF_SEQUENCEFLD:
3248 {
3249 // Not implemented for RTF
3250 if(GetExport().GetExportFormat() == MSWordExportBase::ExportFormat::RTF)
3251 break;
3252
3253 switch (pField->GetFormat())
3254 {
3255 case REF_PAGE:
3256 case REF_PAGE_PGDESC:
3258 break;
3259 default:
3260 eField = ww::eREF;
3261 break;
3262 }
3263 // Generate a unique bookmark name
3264 {
3265 OUString sName{rRField.GetSetRefName() + OUString::number(rRField.GetSeqNo())};
3266 switch (pField->GetFormat())
3267 {
3268 case REF_PAGE:
3269 case REF_PAGE_PGDESC:
3270 case REF_CONTENT:
3271 case REF_UPDOWN:
3272 sName += "_full";
3273 break;
3274 case REF_ONLYNUMBER:
3275 sName += "_label_and_number";
3276 break;
3277 case REF_ONLYCAPTION:
3278 sName += "_caption_only";
3279 break;
3280 case REF_ONLYSEQNO:
3281 sName += "_number_only";
3282 break;
3283 default: // Ignore other types of reference fields
3284 eField = ww::eNONE;
3285 break;
3286 }
3288 }
3289 switch (pField->GetFormat())
3290 {
3291 case REF_NUMBER:
3292 sStr += " \\r";
3293 break;
3295 sStr += " \\n";
3296 break;
3298 sStr += " \\w";
3299 break;
3300 }
3301 break;
3302 }
3303 case REF_FOOTNOTE:
3304 case REF_ENDNOTE:
3305 switch (pField->GetFormat())
3306 {
3307 case REF_PAGE_PGDESC:
3308 case REF_PAGE:
3310 break;
3311 case REF_UPDOWN:
3312 eField = ww::eREF;
3313 break;
3314 default:
3315 eField =
3316 REF_ENDNOTE == nSubType ? ww::eNOTEREF : ww::eFOOTREF;
3317 break;
3318 }
3319 sStr = FieldString(eField)
3320 + MSWordExportBase::GetBookmarkName(nSubType, nullptr, rRField.GetSeqNo());
3321 break;
3322 }
3323
3324 if (eField != ww::eNONE)
3325 {
3326 switch (pField->GetFormat())
3327 {
3328 case REF_UPDOWN:
3329 sStr += " \\p \\h "; // with hyperlink
3330 break;
3331 case REF_CHAPTER:
3332 sStr += " \\n \\h "; // with hyperlink
3333 break;
3334 default:
3335 sStr += " \\h "; // insert hyperlink
3336 break;
3337 }
3338 GetExport().OutputField(pField, eField, sStr);
3339 }
3340 else
3341 bWriteExpand = true;
3342 }
3343 break;
3345 {
3346 /*
3347 We need a font size to fill in the defaults, if these are overridden
3348 (as they generally are) by character properties then those properties
3349 win.
3350
3351 The fontsize that is used in MS for determining the defaults is always
3352 the CJK fontsize even if the text is not in that language, in OOo the
3353 largest fontsize used in the field is the one we should take, but
3354 whatever we do, word will actually render using the fontsize set for
3355 CJK text. Nevertheless we attempt to guess whether the script is in
3356 asian or western text based up on the first character and use the
3357 font size of that script as our default.
3358 */
3359 assert(g_pBreakIt && g_pBreakIt->GetBreakIter().is());
3360 sal_uInt16 nScript = g_pBreakIt->GetBreakIter()->getScriptType( pField->GetPar1(), 0);
3361
3363 tools::Long nHeight = GetExport().GetItem(nFontHeightWhich).GetHeight();
3364
3365 nHeight = (nHeight + 10) / 20; //Font Size in points;
3366
3367 /*
3368 Divide the combined char string into its up and down part. Get the
3369 font size and fill in the defaults as up == half the font size and
3370 down == a fifth the font size
3371 */
3372 const sal_Int32 nAbove = (pField->GetPar1().getLength()+1)/2;
3373 const OUString sStr = FieldString(ww::eEQ)
3374 + "\\o (\\s\\up "
3375 + OUString::number(nHeight/2)
3376 + "("
3377 + pField->GetPar1().subView(0, nAbove)
3378 + "), \\s\\do "
3379 + OUString::number(nHeight/5)
3380 + "("
3381 + pField->GetPar1().subView(nAbove)
3382 + "))";
3383 GetExport().OutputField(pField, ww::eEQ, sStr);
3384 }
3385 break;
3387 bWriteExpand = DropdownField( pField );
3388 break;
3390 bWriteExpand = true;
3391 if (GetExport().m_bOutKF && rField.GetTextField())
3392 {
3393 const SwTextNode *pTextNd = GetExport().GetHdFtPageRoot();
3394 if (!pTextNd)
3395 {
3396 pTextNd = GetExport().m_pCurPam->GetPointNode().GetTextNode();
3397 }
3398
3399 if (pTextNd)
3400 {
3401 SwChapterField aCopy(*static_cast<const SwChapterField*>(pField));
3402 aCopy.ChangeExpansion(*pTextNd, false);
3403 const OUString sStr = FieldString(ww::eSTYLEREF)
3404 + " "
3405 + OUString::number(aCopy.GetLevel() + 1)
3406 + " \\* MERGEFORMAT ";
3407 GetExport().OutputField(pField, ww::eSTYLEREF, sStr);
3408 bWriteExpand = false;
3409 }
3410 }
3411 break;
3413 {
3414 OUString sExpand(pField->GetPar2());
3415 if (!sExpand.isEmpty())
3416 {
3417 auto eSubType = static_cast<SwFieldTypesEnum>(pField->GetSubType());
3418 if (eSubType == SwFieldTypesEnum::ConditionalText)
3419 {
3420 OUString aCond = pField->GetPar1();
3421 OUString aTrueFalse = pField->GetPar2();
3422 sal_Int32 nPos = aTrueFalse.indexOf('|');
3423 OUString aTrue;
3424 OUString aFalse;
3425 if (nPos == -1)
3426 {
3427 aTrue = aTrueFalse;
3428 }
3429 else
3430 {
3431 aTrue = aTrueFalse.subView(0, nPos);
3432 aFalse = aTrueFalse.subView(nPos + 1);
3433 }
3434 if (aTrue.getLength() > 1 && aTrue.startsWith("\"") && aTrue.endsWith("\""))
3435 aTrue = aTrue.copy(1, aTrue.getLength() - 2);
3436 if (aFalse.getLength() > 1 && aFalse.startsWith("\"") && aFalse.endsWith("\""))
3437 aFalse = aFalse.copy(1, aFalse.getLength() - 2);
3438
3439 // Substitute a single quote for an illegal double quote if one exists
3440 OUString aCmd = FieldString(ww::eIF) + aCond + " \""
3441 + aTrue.replaceAll("\"", "'") + "\" \"" + aFalse.replaceAll("\"", "'")
3442 + "\"";
3443 GetExport().OutputField(pField, ww::eIF, aCmd);
3444 }
3445 else
3446 HiddenField(*pField);
3447 }
3448 }
3449 break;
3451 bWriteExpand = PlaceholderField( pField );
3452 break;
3453 case SwFieldIds::Macro:
3454 {
3455 const OUString sStr = " MACROBUTTON "
3456 + pField->GetPar1().replaceFirst("StarOffice.Standard.Modul1.", "")
3457 + " "
3458 + lcl_GetExpandedField(*pField);
3459 GetExport().OutputField( pField, ww::eMACROBUTTON, sStr );
3460 }
3461 break;
3462 case SwFieldIds::Table:
3463 {
3465 OUString aExpand = OUString::Concat(" =") + o3tl::trim(pField->GetFieldName());
3466 GetExport().OutputField(pField, eField, aExpand);
3467 }
3468 break;
3469 case SwFieldIds::User:
3470 {
3472 OUString aExpand = FieldString(eField) + pField->GetPar1() + " ";
3473 GetExport().OutputField(pField, eField, aExpand);
3474 }
3475 break;
3476 default:
3477 bWriteExpand = true;
3478 break;
3479 }
3480
3481 if (bWriteExpand)
3482 WriteExpand( pField );
3483}
3484
3486{
3487 if ( auto pTextNd = dynamic_cast< const SwContentNode *>( GetExport().m_pOutFormatNode ) )
3488 {
3489 Point const origin;
3490 Point aLayPos = pTextNd->FindLayoutRect( false, &origin ).Pos();
3491
3492 SwPosition aPos( *pTextNd );
3493 ww8::Frame aFrame( *rFlyContent.GetFrameFormat(), std::move(aPos) );
3494
3495 OutputFlyFrame_Impl( aFrame, aLayPos );
3496 }
3497}
3498
3499// TOXMarks are still missing
3500
3501// WW allows detailed settings for hyphenation only for the whole document.
3502// One could implement following mimic: The values of the style "Standard" will
3503// be set in the Document Properties ( DOP ) if they exist.
3504
3505// ACK. This suggestion fits exactly to our implementation of the import,
3506// therefore I'll implement that right now. (KHZ, 07/15/2000)
3508{
3509 // sprmPFNoAutoHyph
3511
3512 m_rWW8Export.m_pO->push_back( rHyphenZone.IsHyphen() ? 0 : 1 );
3513}
3514
3516{
3518 m_rWW8Export.m_pO->push_back( rScriptSpace.GetValue() ? 1 : 0 );
3519}
3520
3522{
3524 m_rWW8Export.m_pO->push_back( rItem.GetValue() ? 1 : 0 );
3525}
3526
3528{
3530 m_rWW8Export.m_pO->push_back( rItem.GetValue() ? 1 : 0 );
3531}
3532
3534{
3535 // sprmPFUsePgsuSettings
3536
3538 m_rWW8Export.m_pO->push_back( rGrid.GetValue() ? 1 : 0 );
3539}
3540
3542{
3543 // sprmPWAlignFont
3544
3546
3547 SvxParaVertAlignItem::Align nAlign = rAlign.GetValue();
3548 sal_uInt16 nVal;
3549 switch ( nAlign )
3550 {
3552 nVal = 2;
3553 break;
3555 nVal = 0;
3556 break;
3558 nVal = 1;
3559 break;
3561 nVal = 3;
3562 break;
3564 nVal = 4;
3565 break;
3566 default:
3567 nVal = 4;
3568 OSL_FAIL( "Unknown vert alignment" );
3569 break;
3570 }
3571 m_rWW8Export.InsUInt16( nVal );
3572}
3573
3574// NoHyphen: I didn't find an equal in the SW UI and WW UI
3575
3576// RefMark, NoLineBreakHere are still missing
3577
3579{
3580 ww::bytes aAttrArr;
3581 const bool bAutoNum = rFootnote.GetNumStr().isEmpty();
3582 if( bAutoNum )
3583 {
3584 static const sal_uInt8 aSpec[] =
3585 {
3586 0x03, 0x6a, 0, 0, 0, 0, // sprmCObjLocation
3587 0x55, 0x08, 1 // sprmCFSpec
3588 };
3589
3590 aAttrArr.insert(aAttrArr.end(), aSpec, aSpec+sizeof(aSpec));
3591 }
3592
3593 // sprmCIstd
3594 const SwEndNoteInfo* pInfo;
3595 if( rFootnote.IsEndNote() )
3596 pInfo = &m_rDoc.GetEndNoteInfo();
3597 else
3598 pInfo = &m_rDoc.GetFootnoteInfo();
3599 const SwCharFormat* pCFormat = pOutArr
3600 ? pInfo->GetAnchorCharFormat( m_rDoc )
3601 : pInfo->GetCharFormat( m_rDoc );
3603 SwWW8Writer::InsUInt16( aAttrArr, GetId( pCFormat ) );
3604
3605 // fSpec-Attribute true
3606 // For Auto-Number a special character must go
3607 // into the text and therefore a fSpec attribute
3608 m_pChpPlc->AppendFkpEntry( Strm().Tell() );
3609 if( bAutoNum )
3610 WriteChar( 0x02 ); // auto number character
3611 else
3612 // user numbering
3613 OutSwString(rFootnote.GetNumStr(), 0, rFootnote.GetNumStr().getLength());
3614
3615 if( pOutArr )
3616 {
3617 // insert at start of array, so the "hard" attribute overrule the
3618 // attributes of the character template
3619 pOutArr->insert( pOutArr->begin(), aAttrArr.begin(), aAttrArr.end() );
3620 }
3621 else
3622 {
3623 std::unique_ptr<ww::bytes> pOwnOutArr(new ww::bytes);
3624
3625 // insert at start of array, so the "hard" attribute overrule the
3626 // attributes of the character template
3627 pOwnOutArr->insert(pOwnOutArr->begin(), aAttrArr.begin(), aAttrArr.end());
3628
3629 // write for the ftn number in the content, the font of the anchor
3630 const SwTextFootnote* pTextFootnote = rFootnote.GetTextFootnote();
3631 if( pTextFootnote )
3632 {
3633 std::unique_ptr<ww::bytes> pOld = std::move(m_pO);
3634 m_pO = std::move(pOwnOutArr);
3636
3637 pCFormat = pInfo->GetCharFormat( m_rDoc );
3638
3639 pTextFootnote->GetTextNode().GetParaAttr(aSet,
3640 pTextFootnote->GetStart(), pTextFootnote->GetStart() + 1, true);
3641 if (aSet.Count())
3642 {
3643 m_pAttrOutput->OutputItem( aSet.Get( RES_CHRATR_FONT ) );
3644 }
3645 else
3646 {
3647 m_pAttrOutput->OutputItem( pCFormat->GetAttrSet().Get(RES_CHRATR_FONT) );
3648 }
3649 pOwnOutArr = std::move(m_pO);
3650 m_pO = std::move(pOld);
3651 }
3652 m_pChpPlc->AppendFkpEntry( Strm().Tell(), pOwnOutArr->size(),
3653 pOwnOutArr->data() );
3654 }
3655}
3656
3657static bool lcl_IsAtTextEnd(const SwFormatFootnote& rFootnote)
3658{
3659 bool bRet = true;
3660 if( rFootnote.GetTextFootnote() )
3661 {
3662 sal_uInt16 nWh = rFootnote.IsEndNote() ? sal_uInt16(RES_END_AT_TXTEND)
3663 : sal_uInt16(RES_FTN_AT_TXTEND);
3664 const SwSectionNode* pSectNd = rFootnote.GetTextFootnote()->GetTextNode().
3665 FindSectionNode();
3666 while( pSectNd && FTNEND_ATPGORDOCEND ==
3667 static_cast<const SwFormatFootnoteEndAtTextEnd&>(pSectNd->GetSection().GetFormat()->
3668 GetFormatAttr( nWh)).GetValue() )
3669 pSectNd = pSectNd->StartOfSectionNode()->FindSectionNode();
3670
3671 if (!pSectNd)
3672 bRet = false; // the is ftn/end collected at Page- or Doc-End
3673 }
3674 return bRet;
3675}
3676
3678{
3679 sal_uInt16 nTyp;
3680 if ( rFootnote.IsEndNote() )
3681 {
3682 nTyp = REF_ENDNOTE;
3683 if ( GetExport().m_bEndAtTextEnd )
3684 GetExport().m_bEndAtTextEnd = lcl_IsAtTextEnd( rFootnote );
3685 }
3686 else
3687 {
3688 nTyp = REF_FOOTNOTE;
3689 if ( GetExport().m_bFootnoteAtTextEnd )
3691 }
3692
3693 // if any reference to this footnote/endnote then insert an internal
3694 // Bookmark.
3695 OUString sBkmkNm;
3696 if ( GetExport().HasRefToFootOrEndnote( rFootnote.IsEndNote(), rFootnote.GetTextFootnote()->GetSeqRefNo()))
3697 {
3698 sBkmkNm = MSWordExportBase::GetBookmarkName( nTyp, nullptr,
3699 rFootnote.GetTextFootnote()->GetSeqRefNo() );
3700 GetExport().AppendBookmark( sBkmkNm );
3701 }
3702
3703 TextFootnote_Impl( rFootnote );
3704
3705 if ( !sBkmkNm.isEmpty() )
3706 GetExport().AppendBookmark( sBkmkNm ); // FIXME: Why is it added twice? Shouldn't this one go to WW8AttributeOutput::TextFootnote_Impl()?
3707}
3708
3710{
3711 WW8_WrPlcFootnoteEdn* pFootnoteEnd;
3712 if ( rFootnote.IsEndNote() || GetExport().m_rDoc.GetFootnoteInfo().m_ePos == FTNPOS_CHAPTER )
3713 pFootnoteEnd = m_rWW8Export.m_pEdn.get();
3714 else
3715 pFootnoteEnd = m_rWW8Export.m_pFootnote.get();
3716
3717 pFootnoteEnd->Append( m_rWW8Export.Fc2Cp( m_rWW8Export.Strm().Tell() ), rFootnote );
3719}
3720
3722{
3723 if( rCharFormat.GetCharFormat() )
3724 {
3726
3728 }
3729}
3730
3731/*
3732 See ww8par6.cxx Read_DoubleLine for some more info
3733 */
3735{
3736 // #i28331# - check that bOn is set
3737 if ( !rTwoLines.GetValue() )
3738 return;
3739
3741 m_rWW8Export.m_pO->push_back( sal_uInt8(0x06) ); //len 6
3742 m_rWW8Export.m_pO->push_back( sal_uInt8(0x02) );
3743
3744 sal_Unicode cStart = rTwoLines.GetStartBracket();
3745 sal_Unicode cEnd = rTwoLines.GetEndBracket();
3746
3747 /*
3748 As per usual we have problems. We can have separate left and right brackets
3749 in OOo, it doesn't appear that you can in word. Also in word there appear
3750 to only be a limited number of possibilities, we can use pretty much
3751 anything.
3752
3753 So if we have none, we export none, if either bracket is set to a known
3754 word type we export both as that type (with the bracket winning out in
3755 the case of a conflict simply being the order of test here.
3756
3757 Upshot being a documented created in word will be reexported with no
3758 ill effects.
3759 */
3760
3761 sal_uInt16 nType;
3762 if (!cStart && !cEnd)
3763 nType = 0;
3764 else if ((cStart == '{') || (cEnd == '}'))
3765 nType = 4;
3766 else if ((cStart == '<') || (cEnd == '>'))
3767 nType = 3;
3768 else if ((cStart == '[') || (cEnd == ']'))
3769 nType = 2;
3770 else
3771 nType = 1;
3773 static const sal_uInt8 aZeroArr[ 3 ] = { 0, 0, 0 };
3774 m_rWW8Export.m_pO->insert( m_rWW8Export.m_pO->end(), aZeroArr, aZeroArr+3);
3775}
3776
3778{
3779 sal_uInt16 nOutLvl = rItem.GetValue();
3780
3781 // Do not write out default level (Body Text) if there is no inheritance, or if the level matches the inherited value
3782 const SfxUInt16Item* pInherited = nullptr;
3783 if (auto pNd = dynamic_cast<const SwContentNode*>(GetExport().m_pOutFormatNode)) //paragraph
3784 pInherited = static_cast<SwTextFormatColl&>(pNd->GetAnyFormatColl()).GetAttrSet().GetItem<SfxUInt16Item>(RES_PARATR_OUTLINELEVEL);
3787 if ((pInherited && pInherited->GetValue() == nOutLvl)
3788 || (!pInherited && !nOutLvl))
3789 return;
3790
3791 ParaOutlineLevel(rItem);
3792}
3793
3795{
3796 if (rNumRule.GetValue().isEmpty())
3797 {
3798 ParaNumRule_Impl(nullptr, 0, 0);
3799 return;
3800 }
3801 const SwNumRule* pRule = GetExport().m_rDoc.FindNumRulePtr(
3802 rNumRule.GetValue() );
3803 if (!pRule)
3804 return;
3805
3806 sal_uInt16 nNumId = GetExport().GetNumberingId(*pRule) + 1;
3807 sal_uInt8 nLvl = 0;
3808
3809 const SwTextNode* pTextNd = dynamic_cast<const SwTextNode*>(GetExport().m_pOutFormatNode);
3810 if (pTextNd)
3811 {
3812 if( pTextNd->IsCountedInList())
3813 {
3814 nLvl = std::clamp(pTextNd->GetActualListLevel(), 0, MAXLEVEL - 1);
3815 const bool bListRestart = pTextNd->IsListRestart();
3816
3817 if (GetExport().GetExportFormat() == MSWordExportBase::DOCX) // FIXME
3818 {
3819 // tdf#95848 find the abstract list definition
3820 OUString const listId(pTextNd->GetListId());
3821 if (!listId.isEmpty()
3822 && (listId != pRule->GetDefaultListId() // default list id uses the 1:1 mapping
3823 || bListRestart) // or restarting previous list
3824 )
3825 {
3826 SwList const*const pList(
3828 if (pList)
3829 {
3830 SwNumRule const*const pAbstractRule(
3832 pList->GetDefaultListStyleName()));
3833 assert(pAbstractRule);
3834 if (pAbstractRule == pRule && !bListRestart)
3835 {
3836 // different list, but no override
3837 nNumId = GetExport().DuplicateAbsNum(listId, *pAbstractRule) + 1;
3838 }
3839 else
3840 {
3841 nNumId = GetExport().OverrideNumRule(
3842 *pRule, listId, *pAbstractRule) + 1;
3843
3844 if (bListRestart)
3845 {
3846 // For restarted lists we should also keep value for
3847 // future w:lvlOverride / w:startOverride
3848 GetExport().AddListLevelOverride(nNumId-1, pTextNd->GetActualListLevel(),
3849 pTextNd->GetActualListStartValue());
3850 }
3851 }
3852 }
3853 }
3854 }
3855 else if (bListRestart)
3856 {
3857 sal_uInt16 nStartWith = static_cast<sal_uInt16>(pTextNd->GetActualListStartValue());
3858 nNumId = GetExport().DuplicateNumRule(pRule, nLvl, nStartWith);
3859 if (USHRT_MAX != nNumId)
3860 ++nNumId;
3861 }
3862 }
3863 else
3864 {
3865 // #i44815# adjust numbering for numbered paragraphs
3866 // without number. These paragraphs will receive a
3867 // list id 0, which WW interprets as 'no number'.
3868 nNumId = 0;
3869 }
3870 }
3871 else if ( auto pC = dynamic_cast< const SwTextFormatColl *>( GetExport().m_pOutFormatNode ) )
3872 {
3873 if (pC->IsAssignedToListLevelOfOutlineStyle())
3874 nLvl = static_cast< sal_uInt8 >( pC->GetAssignedOutlineStyleLevel() );
3875 else
3876 {
3877 const SfxItemSet* pSet = GetExport().m_pISet;
3878 if (pSet && pSet->HasItem(RES_PARATR_LIST_LEVEL))
3879 {
3880 const SfxInt16Item* pItem = pSet->GetItem(RES_PARATR_LIST_LEVEL);
3881 nLvl = pItem->GetValue();
3882 }
3883 }
3884 }
3885
3886 if ( nLvl >= WW8ListManager::nMaxLevel )
3887 nLvl = WW8ListManager::nMaxLevel - 1;
3888
3889 ParaNumRule_Impl( pTextNd, nLvl, nNumId);
3890}
3891
3893 sal_Int32 const nLvl, sal_Int32 const nNumId)
3894{
3895 if (USHRT_MAX == nNumId)
3896 return;
3897
3898 // write sprmPIlvl and sprmPIlfo
3900 m_rWW8Export.m_pO->push_back( ::sal::static_int_cast<sal_uInt8>(nLvl) );
3902 SwWW8Writer::InsUInt16( *m_rWW8Export.m_pO, ::sal::static_int_cast<sal_uInt16>(nNumId) );
3903}
3904
3905/* File FRMATR.HXX */
3906
3908{
3909 if( m_rWW8Export.m_bOutFlyFrameAttrs ) // Flys
3910 {
3912 return; // Fly around graphic -> Auto-size
3913
3914 //???? What about percentages ???
3915 if ( rSize.GetWidth() && rSize.GetWidthSizeType() == SwFrameSize::Fixed)
3916 {
3917 //"sprmPDxaWidth"
3919 m_rWW8Export.InsUInt16( o3tl::narrowing<sal_uInt16>(rSize.GetWidth()) );
3920 }
3921
3922 if ( rSize.GetHeight() )
3923 {
3924 // sprmPWHeightAbs
3926
3927 sal_uInt16 nH = 0;
3928 switch ( rSize.GetHeightSizeType() )
3929 {
3930 case SwFrameSize::Variable: break;
3931 case SwFrameSize::Fixed: nH = o3tl::narrowing<sal_uInt16>(rSize.GetHeight()) & 0x7fff; break;
3932 default: nH = o3tl::narrowing<sal_uInt16>(rSize.GetHeight()) | 0x8000; break;
3933 }
3934 m_rWW8Export.InsUInt16( nH );
3935 }
3936 }
3937 else if( m_rWW8Export.m_bOutPageDescs ) // PageDesc : width + height
3938 {
3940 {
3941 /*sprmSBOrientation*/
3943 m_rWW8Export.m_pO->push_back( 2 );
3944 }
3945
3946 /*sprmSXaPage*/
3949 msword_cast<sal_uInt16>(SvxPaperInfo::GetSloppyPaperDimension(rSize.GetWidth())));
3950
3951 /*sprmSYaPage*/
3954 msword_cast<sal_uInt16>(SvxPaperInfo::GetSloppyPaperDimension(rSize.GetHeight())));
3955 }
3956}
3957
3958// FillOrder is still missing
3959
3968{
3969 OSL_ENSURE( nChar, "replaced with 0 crashes WW97/95" );
3970
3971 bool bReplaced = false;
3972 SvStream& rStrm = Strm();
3973 sal_uInt64 nRetPos = 0, nPos = rStrm.Tell();
3974 //If there is at least two characters already output
3975 if (nPos - 2 >= o3tl::make_unsigned(m_pFib->m_fcMin))
3976 {
3977 sal_uInt16 nUCode=0;
3978
3979 rStrm.SeekRel(-2);
3980 rStrm.ReadUInt16( nUCode );
3981 //If the last char was a cr
3982 if (nUCode == 0x0d) // CR ?
3983 {
3984 if ((nChar == 0x0c) &&
3985 (nPos - 4 >= o3tl::make_unsigned(m_pFib->m_fcMin)))
3986 {
3987 rStrm.SeekRel(-4);
3988 rStrm.ReadUInt16( nUCode );
3989 }
3990 else
3991 {
3992 rStrm.SeekRel(-2);
3993 nUCode = 0x0;
3994 }
3995 //And the para is not of len 0, then replace this cr with the mark
3996 //#120140# If there is a cr before a column break, need replace the cr. So remove the "nChar==0x0e" check.
3997 if( nUCode == 0x0d )
3998 bReplaced = false;
3999 else
4000 {
4001 bReplaced = true;
4002 WriteChar(nChar);
4003 nRetPos = nPos;
4004 }
4005 }
4006 else if ((nUCode == 0x0c) && (nChar == 0x0e))
4007 {
4008 // a column break after a section has no effect in writer
4009 bReplaced = true;
4010 }
4011 rStrm.Seek( nPos );
4012 }
4013 else
4014 bReplaced = true;
4015
4016 if (!bReplaced)
4017 {
4018 // then write as normal char
4019 WriteChar(nChar);
4020 m_pPiece->SetParaBreak();
4021 m_pPapPlc->AppendFkpEntry(rStrm.Tell());
4022 m_pChpPlc->AppendFkpEntry(rStrm.Tell());
4023 nRetPos = rStrm.Tell();
4024 }
4025 return nRetPos;
4026}
4027
4028void WW8AttributeOutput::TableRowEnd(sal_uInt32 nDepth)
4029{
4030 if ( nDepth == 1 )
4031 m_rWW8Export.WriteChar( 0x07 );
4032 else if ( nDepth > 1 )
4033 m_rWW8Export.WriteChar( 0x0d );
4034
4035 //Technically in a word document this is a different value for a row ends
4036 //that are not row ends directly after a cell with a graphic. But it
4037 //doesn't seem to make a difference
4038 //pMagicTable->Append(Fc2Cp(Strm().Tell()),0x1B6);
4039}
4040
4042{
4043 if ( GetExport().m_bStyDef )
4044 if (auto pC = dynamic_cast< const SwTextFormatColl *>( GetExport().m_pOutFormatNode ) )
4045 {
4046 if ( (SfxItemState::SET != pC->GetItemState( RES_BREAK, false ) ) && rPageDesc.KnowsPageDesc() )
4047 FormatBreak( SvxFormatBreakItem( SvxBreak::PageBefore, RES_BREAK ) );
4048 }
4049}
4050
4052{
4053 // sprmPPageBreakBefore/sprmPFPageBreakBefore
4055
4056 m_rWW8Export.m_pO->push_back( bBreak ? 1 : 0 );
4057}
4058
4065{
4066 if ( GetExport().m_bStyDef )
4067 {
4068 switch ( rBreak.GetBreak() )
4069 {
4070 case SvxBreak::NONE:
4071 case SvxBreak::PageBefore:
4072 case SvxBreak::PageBoth:
4073 PageBreakBefore( rBreak.GetValue() != SvxBreak::NONE );
4074 break;
4075 default:
4076 break;
4077 }
4078 }
4079 else if ( !GetExport().m_pParentFrame )
4080 {
4081 sal_uInt8 nC = 0;
4082 bool bBefore = false;
4083 // #i76300# - Note: Can only be <true>, if <bBefore> equals <false>.
4084 bool bCheckForFollowPageDesc = false;
4085
4086 switch ( rBreak.GetBreak() )
4087 {
4088 case SvxBreak::NONE: // disabled
4089 if ( !GetExport().m_bBreakBefore )
4090 PageBreakBefore( false );
4091 return;
4092
4093 case SvxBreak::ColumnBefore: // ColumnBreak
4094 bBefore = true;
4095 [[fallthrough]];
4096 case SvxBreak::ColumnAfter:
4097 case SvxBreak::ColumnBoth:
4099 || GetExport().Sections().CurrentNumberOfColumns( GetExport().m_rDoc ) > 1 )
4100 {
4102 }
4103 break;
4104
4105 case SvxBreak::PageBefore: // PageBreak
4106 // From now on(fix for #i77900#) we prefer to save a page break
4107 // as paragraph attribute (if the exporter is OK with that),
4108 // this has to be done after the export of the paragraph ( =>
4109 // !GetExport().bBreakBefore )
4110 if (GetExport().PreferPageBreakBefore())
4111 {
4112 if (!GetExport().m_bBreakBefore)
4113 PageBreakBefore(true);
4114 }
4115 else
4116 {
4117 bBefore = true;
4118 nC = msword::PageBreak;
4119 }
4120 break;
4121 case SvxBreak::PageAfter:
4122 case SvxBreak::PageBoth:
4123 nC = msword::PageBreak;
4124 // #i76300# - check for follow page description,
4125 // if current writing attributes of a paragraph.
4126 if ( dynamic_cast< const SwTextNode* >( GetExport().m_pOutFormatNode ) &&
4127 GetExport().GetCurItemSet() )
4128 {
4129 bCheckForFollowPageDesc = true;
4130 }
4131 break;
4132
4133 default:
4134 break;
4135 }
4136
4137 if ( ( bBefore == GetExport().m_bBreakBefore ) && nC )
4138 {
4139 // #i76300#
4140 bool bFollowPageDescWritten = false;
4141 if ( bCheckForFollowPageDesc )
4142 {
4143 bFollowPageDescWritten =
4144 GetExport().OutputFollowPageDesc( GetExport().GetCurItemSet(),
4145 dynamic_cast<const SwTextNode*>( GetExport().m_pOutFormatNode ) );
4146 }
4147 if ( !bFollowPageDescWritten )
4148 {
4149 SectionBreak(nC, !bBefore);
4150 }
4151 }
4152 }
4153}
4154
4155void WW8AttributeOutput::SectionBreak( sal_uInt8 nC, bool /*bBreakAfter*/, const WW8_SepInfo* /*pSectionInfo*/, bool /*bExtraPageBreak*/ )
4156{
4157 m_rWW8Export.ReplaceCr( nC );
4158}
4159
4161{
4162 MSWordStyles * pStyles = GetExport().m_pStyles.get();
4163 const SwFormat * pSwFormat = pStyles->GetSwFormat(0);
4164
4165 sal_uInt32 nPageCharSize = 0;
4166
4167 if (pSwFormat != nullptr)
4168 {
4169 nPageCharSize = pSwFormat->GetFormatAttr(RES_CHRATR_FONTSIZE).GetHeight();
4170 }
4171 sal_uInt16 nPitch = rGrid.IsSquaredMode() ? rGrid.GetBaseHeight() :
4172 rGrid.GetBaseWidth( );
4173
4174 sal_Int32 nCharWidth = nPitch - nPageCharSize;
4175 sal_Int32 nFraction = nCharWidth % 20;
4176 if ( nCharWidth < 0 )
4177 nFraction = 20 + nFraction;
4178 nFraction = ( nFraction * 0xFFF ) / 20;
4179 nFraction = ( nFraction & 0x00000FFF );
4180
4181 sal_Int32 nMain = nCharWidth / 20;
4182 if ( nCharWidth < 0 )
4183 nMain -= 1;
4184 nMain = nMain * 0x1000;
4185 nMain = ( nMain & 0xFFFFF000 );
4186
4187 return sal_uInt32( nFraction + nMain );
4188}
4189
4191{
4193 return;
4194
4195 sal_uInt16 nGridType = 0;
4196 switch ( rGrid.GetGridType() )
4197 {
4198 default:
4199 OSL_FAIL("Unknown grid type");
4200 [[fallthrough]];
4201 case GRID_NONE:
4202 nGridType = 0;
4203 break;
4204 case GRID_LINES_ONLY:
4205 nGridType = 2;
4206 break;
4207 case GRID_LINES_CHARS:
4208 if ( rGrid.IsSnapToChars() )
4209 nGridType = 3;
4210 else
4211 nGridType = 1;
4212 break;
4213 }
4215 m_rWW8Export.InsUInt16( nGridType );
4216
4217 sal_uInt16 nHeight = rGrid.GetBaseHeight() + rGrid.GetRubyHeight();
4219 m_rWW8Export.InsUInt16( nHeight );
4220
4223}
4224
4226{
4228 return;
4229
4230 sal_uInt16 nVal;
4231 switch ( rPaperBin.GetValue() )
4232 {
4233 case 0: nVal = 15; break; // Automatically select
4234 case 1: nVal = 1; break; // Upper paper tray
4235 case 2: nVal = 4; break; // Manual paper feed
4236 default: nVal = 0; break;
4237 }
4238
4239 if ( nVal )
4240 {
4243
4244 m_rWW8Export.InsUInt16( nVal );
4245 }
4246}
4247
4249{
4250 // sprmPDxaLeft1
4251 m_rWW8Export.InsUInt16( 0x8460 ); //asian version ?
4253}
4254
4256{ // normal paragraphs
4257 // sprmPDxaLeft
4258 m_rWW8Export.InsUInt16( 0x845E ); //asian version ?
4259 m_rWW8Export.InsUInt16( o3tl::narrowing<sal_uInt16>(rTextLeftMargin.GetTextLeft()) );
4260}
4261
4263{
4264 // (paragraph case, this will be an else branch once others are converted)
4265#if 0
4266 else
4267#endif
4268 { // normal paragraphs
4269 // sprmPDxaRight
4270 m_rWW8Export.InsUInt16( 0x845D ); //asian version ?
4271 m_rWW8Export.InsUInt16( o3tl::narrowing<sal_uInt16>(rRightMargin.GetRight()) );
4272 }
4273}
4274
4276{
4277 // Flys are still missing ( see RTF )
4278
4279 if ( m_rWW8Export.m_bOutFlyFrameAttrs ) // Flys
4280 {
4281 // sprmPDxaFromText10
4283 // use average, since WW only knows one value
4284 m_rWW8Export.InsUInt16( o3tl::narrowing<sal_uInt16>( ( rLR.GetLeft() + rLR.GetRight() ) / 2 ) );
4285 }
4286 else if ( m_rWW8Export.m_bOutPageDescs ) // PageDescs
4287 {
4288 m_pageMargins.nLeft = 0;
4290
4291 if ( const SvxBoxItem* pBoxItem = m_rWW8Export.HasItem( RES_BOX ) )
4292 {
4293 m_pageMargins.nLeft = pBoxItem->CalcLineSpace( SvxBoxItemLine::LEFT, /*bEvenIfNoLine*/true );
4294 m_pageMargins.nRight = pBoxItem->CalcLineSpace( SvxBoxItemLine::RIGHT, /*bEvenIfNoLine*/true );
4295 }
4296
4297 m_pageMargins.nLeft += sal::static_int_cast<sal_uInt16>(rLR.GetLeft());
4298 m_pageMargins.nRight += sal::static_int_cast<sal_uInt16>(rLR.GetRight());
4299 sal_uInt16 nGutter = rLR.GetGutterMargin();
4300
4301 // sprmSDxaLeft
4304
4305 // sprmSDxaRight
4308
4309 if (nGutter)
4310 {
4311 // sprmSDzaGutter
4313 m_rWW8Export.InsUInt16(nGutter);
4314 }
4315 }
4316 else
4317 { // normal paragraphs
4318 // sprmPDxaLeft
4319 m_rWW8Export.InsUInt16( 0x845E ); //asian version ?
4320 m_rWW8Export.InsUInt16( o3tl::narrowing<sal_uInt16>(rLR.GetTextLeft()) );
4321
4322 // sprmPDxaRight
4323 m_rWW8Export.InsUInt16( 0x845D ); //asian version ?
4324 m_rWW8Export.InsUInt16( o3tl::narrowing<sal_uInt16>(rLR.GetRight()) );
4325
4326 // sprmPDxaLeft1
4327 m_rWW8Export.InsUInt16( 0x8460 ); //asian version ?
4329 }
4330}
4331
4333{
4334 if (!rRtlGutter.GetValue())
4335 {
4336 return;
4337 }
4338
4339 // sprmSFRTLGutter
4341 m_rWW8Export.m_pO->push_back(1);
4342}
4343
4345{
4346 // Write the linebreak itself.
4347 m_rWW8Export.WriteChar(0x0b);
4348
4349 // sprmCLbcCRJ
4351 m_rWW8Export.m_pO->push_back(rLineBreak.GetEnumValue());
4352}
4353
4355{
4356 // Flys are still missing ( see RTF )
4357
4358 if ( m_rWW8Export.m_bOutFlyFrameAttrs ) // Flys
4359 {
4360 // sprmPDyaFromText
4362 // use average, since WW only knows one value
4363 m_rWW8Export.InsUInt16( o3tl::narrowing<sal_uInt16>( ( rUL.GetUpper() + rUL.GetLower() ) / 2 ) );
4364 }
4365 else if ( m_rWW8Export.m_bOutPageDescs ) // Page-UL
4366 {
4367 OSL_ENSURE( m_rWW8Export.GetCurItemSet(), "Impossible" );
4368 if ( !m_rWW8Export.GetCurItemSet() )
4369 return;
4370
4372
4373 if ( aDistances.HasHeader() )
4374 {
4375 //sprmSDyaHdrTop
4377 m_rWW8Export.InsUInt16( aDistances.m_DyaHdrTop );
4378 }
4379
4380 // sprmSDyaTop
4382 m_rWW8Export.InsUInt16( aDistances.m_DyaTop );
4383 m_pageMargins.nTop = aDistances.m_DyaTop;
4384
4385 if ( aDistances.HasFooter() )
4386 {
4387 //sprmSDyaHdrBottom
4390 }
4391
4392 //sprmSDyaBottom
4394 m_rWW8Export.InsUInt16( aDistances.m_DyaBottom );
4395 m_pageMargins.nBottom = aDistances.m_DyaBottom;
4396 }
4397 else
4398 {
4399 // sprmPDyaBefore
4402 // sprmPDyaAfter
4405 // sprmPFContextualSpacing
4406
4407 // Write out Contextual Spacing = false if it would have inherited a true.
4408 const SvxULSpaceItem* pInherited = nullptr;
4409 if (!rUL.GetContext())
4410 {
4411 if (auto pNd = dynamic_cast<const SwContentNode*>(m_rWW8Export.m_pOutFormatNode)) //paragraph
4412 pInherited = &static_cast<SwTextFormatColl&>(pNd->GetAnyFormatColl()).GetAttrSet().GetULSpace();
4415 }
4416 if (rUL.GetContext() || (pInherited && pInherited->GetContext()))
4417 {
4419 m_rWW8Export.m_pO->push_back( static_cast<sal_uInt8>(rUL.GetContext()) );
4420 }
4421 }
4422}
4423
4424// print, opaque, protect are still missing
4425
4427{
4429 {
4431
4432 m_rWW8Export.m_pO->push_back(
4433 ( css::text::WrapTextMode_NONE != rSurround.GetSurround() ) ? 2 : 1 );
4434 }
4435}
4436
4438{
4439
4442 return;
4443
4444 short nPos;
4445 switch( rFlyVert.GetVertOrient() )
4446 {
4448 nPos = static_cast<short>(rFlyVert.GetPos());
4449 break;
4450 case text::VertOrientation::CENTER:
4451 case text::VertOrientation::LINE_CENTER:
4452 nPos = -8;
4453 break;
4454 case text::VertOrientation::BOTTOM:
4455 case text::VertOrientation::LINE_BOTTOM:
4456 nPos = -12;
4457 break;
4458 case text::VertOrientation::TOP:
4459 case text::VertOrientation::LINE_TOP:
4460 default:
4461 nPos = -4;
4462 break;
4463 }
4464
4465 // sprmPDyaAbs
4468}
4469
4471{
4473 {
4474 OSL_ENSURE( m_rWW8Export.m_pParentFrame, "HoriOrient without mpParentFrame !!" );
4475 return;
4476 }
4477
4480 return;
4481
4482 short nPos;
4483 switch( rFlyHori.GetHoriOrient() )
4484 {
4486 nPos = static_cast<short>(rFlyHori.GetPos());
4487 if( !nPos )
4488 nPos = 1; // WW: 0 is reserved
4489 break;
4490 case text::HoriOrientation::LEFT:
4491 nPos = rFlyHori.IsPosToggle() ? -12 : 0;
4492 break;
4493 case text::HoriOrientation::RIGHT:
4494 nPos = rFlyHori.IsPosToggle() ? -16 : -8;
4495 break;
4496 case text::HoriOrientation::CENTER:
4497 case text::HoriOrientation::FULL: // FULL only for tables
4498 default:
4499 nPos = -4;
4500 break;
4501 }
4502
4503 // sprmPDxaAbs
4506}
4507
4509{
4510 OSL_ENSURE( m_rWW8Export.m_pParentFrame, "Anchor without mpParentFrame !!" );
4511
4513 return;
4514
4515 sal_uInt8 nP = 0;
4516 switch ( rAnchor.GetAnchorId() )
4517 {
4518 case RndStdIds::FLY_AT_PAGE:
4519 // vertical: page | horizontal: page
4520 nP |= (1 << 4) | (2 << 6);
4521 break;
4522 // in case of Fly as characters: set paragraph-bound!!!
4523 case RndStdIds::FLY_AT_FLY:
4524 case RndStdIds::FLY_AT_CHAR:
4525 case RndStdIds::FLY_AT_PARA:
4526 case RndStdIds::FLY_AS_CHAR:
4527 // vertical: page | horizontal: page
4528 nP |= (2 << 4) | (0 << 6);
4529 break;
4530 default:
4531 break;
4532 }
4533
4534 // sprmPPc
4536 m_rWW8Export.m_pO->push_back( nP );
4537}
4538
4540{
4541 // WW cannot have background in a section
4543 return;
4544
4545 WW8_SHD aSHD;
4546 WW8Export::TransBrush( rBrush.GetColor(), aSHD );
4547
4550
4552 m_rWW8Export.m_pO->push_back( 10 ); //size of operand: MUST be 10
4553 m_rWW8Export.InsUInt32( 0xFF000000 ); //cvFore: Foreground BGR = cvAuto
4554 m_rWW8Export.InsUInt32( SuitableBGColor( rBrush.GetColor() ) ); //cvBack
4555 m_rWW8Export.InsUInt16( 0x0000 ); //iPat: specifies the pattern used for shading = clear/100% background
4556}
4557
4559{
4560 // WW cannot have background in a section
4562 return;
4563
4564 // see MSWordExportBase::OutputItemSet for how _SOLID is handled
4565 if ( rFillStyle.GetValue() != drawing::FillStyle_NONE )
4566 return;
4567
4568 //Shd80Nil
4570 m_rWW8Export.InsUInt16( 0xffff );
4571
4572 //cvAuto
4574 m_rWW8Export.m_pO->push_back( 10 );
4575 m_rWW8Export.InsUInt32( 0xFF000000 );
4576 m_rWW8Export.InsUInt32( 0xFF000000 );
4577 m_rWW8Export.InsUInt16( 0x0000 );
4578}
4579
4581{
4582}
4583
4585 sal_uInt16 nDist, bool bShadow)
4586{
4587 sal_uInt32 nColBGR = 0;
4588 sal_uInt16 nWidth = ::editeng::ConvertBorderWidthToWord(
4589 rLine.GetBorderLineStyle(), rLine.GetWidth());
4590 sal_uInt8 brcType = 0;
4591
4592 if( nWidth ) // line ?
4593 {
4594 // BRC.brcType
4595 brcType = 0;
4596 // All the border types values are available on
4597 // http://msdn.microsoft.com/en-us/library/dd908142%28v=office.12%29.aspx
4598 switch (rLine.GetBorderLineStyle())
4599 {
4600 case SvxBorderLineStyle::SOLID:
4601 {
4602 if ( rLine.GetWidth( ) == SvxBorderLineWidth::Hairline )
4603 brcType = 5;
4604 else
4605 brcType = 1;
4606 }
4607 break;
4608 case SvxBorderLineStyle::DOTTED:
4609 brcType = 6;
4610 break;
4611 case SvxBorderLineStyle::DASHED:
4612 brcType = 7;
4613 break;
4614 case SvxBorderLineStyle::DOUBLE:
4615 case SvxBorderLineStyle::DOUBLE_THIN:
4616 brcType = 3;
4617 break;
4618 case SvxBorderLineStyle::THINTHICK_SMALLGAP:
4619 brcType = 11;
4620 break;
4621 case SvxBorderLineStyle::THINTHICK_MEDIUMGAP:
4622 brcType = 14;
4623 break;
4624 case SvxBorderLineStyle::THINTHICK_LARGEGAP:
4625 brcType = 17;
4626 break;
4627 case SvxBorderLineStyle::THICKTHIN_SMALLGAP:
4628 brcType = 12;
4629 break;
4630 case SvxBorderLineStyle::THICKTHIN_MEDIUMGAP:
4631 brcType = 15;
4632 break;
4633 case SvxBorderLineStyle::THICKTHIN_LARGEGAP:
4634 brcType = 18;
4635 break;
4636 case SvxBorderLineStyle::EMBOSSED:
4637 brcType = 24;
4638 break;
4639 case SvxBorderLineStyle::ENGRAVED:
4640 brcType = 25;
4641 break;
4642 case SvxBorderLineStyle::OUTSET:
4643 brcType = 26;
4644 break;
4645 case SvxBorderLineStyle::INSET:
4646 brcType = 27;
4647 break;
4648 case SvxBorderLineStyle::FINE_DASHED:
4649 brcType = 22;
4650 break;
4651 case SvxBorderLineStyle::DASH_DOT:
4652 brcType = 8;
4653 break;
4654 case SvxBorderLineStyle::DASH_DOT_DOT:
4655 brcType = 9;
4656 break;
4657 default:
4658 break;
4659 }
4660
4661 // convert width from twips (1/20 pt) to eighths of a point
4662 nWidth = (( nWidth * 8 ) + 10 ) / 20;
4663 if( 0xff < nWidth )
4664 nWidth = 0xff;
4665
4666 if( 0 == nWidth ) // really thin line
4667 nWidth = 1; // don't omit
4668
4669 // BRC.cv
4670 nColBGR = wwUtility::RGBToBGR(rLine.GetColor().GetRGBColor());
4671 }
4672
4673 // BRC.dptSpace
4674 sal_uInt16 nLDist = rtl::math::round(nDist / 20.0); // unit of measurement: pt
4675 if( nLDist > 0x1f )
4676 nLDist = 0x1f;
4677
4678 return WW8_BRCVer9(nColBGR, sal_uInt8(nWidth), brcType, sal_uInt8(nLDist),
4679 bShadow, false);
4680}
4681
4688void WW8Export::Out_BorderLine(ww::bytes& rO, const SvxBorderLine* pLine,
4689 sal_uInt16 nDist, sal_uInt16 nSprmNo, sal_uInt16 nSprmNoVer9, bool bShadow)
4690{
4691 OSL_ENSURE( ( nSprmNo == 0 ) ||
4692 ( nSprmNo >= 38 && nSprmNo <= 41 ) ||
4693 ( nSprmNo >= NS_sprm::PBrcTop80::val
4694 && nSprmNo <= NS_sprm::PBrcRight80::val ) ||
4695 ( nSprmNo >= NS_sprm::SBrcTop80::val
4696 && nSprmNo <= NS_sprm::SBrcRight80::val ),
4697 "Sprm for border out is of range" );
4698
4699 WW8_BRCVer9 aBrcVer9;
4700 WW8_BRC aBrcVer8;
4701
4702 if( pLine && pLine->GetBorderLineStyle() != SvxBorderLineStyle::NONE )
4703 {
4704 aBrcVer9 = TranslateBorderLine( *pLine, nDist, bShadow );
4706 aBrcVer8 = WW8_BRC( aBrcVer9.dptLineWidth(), aBrcVer9.brcType(), ico,
4707 aBrcVer9.dptSpace(), aBrcVer9.fShadow(), aBrcVer9.fFrame() );
4708 }
4709
4710 // WW97-SprmIds
4711 if ( nSprmNo != 0 )
4712 SwWW8Writer::InsUInt16( rO, nSprmNo );
4713
4714 rO.insert( rO.end(), aBrcVer8.aBits1, aBrcVer8.aBits2+2 );
4715
4716 if ( nSprmNoVer9 != 0 )
4717 {
4718 SwWW8Writer::InsUInt16( rO, nSprmNoVer9 );
4719 rO.push_back(sizeof(WW8_BRCVer9));
4720 rO.insert( rO.end(), aBrcVer9.aBits1, aBrcVer9.aBits2+4);
4721 }
4722}
4723
4730void WW8Export::Out_SwFormatBox(const SvxBoxItem& rBox, bool bShadow)
4731{
4732 static const SvxBoxItemLine aBorders[] =
4733 {
4734 SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT, SvxBoxItemLine::BOTTOM, SvxBoxItemLine::RIGHT
4735 };
4736 static const sal_uInt16 aPBrc[] =
4737 {
4738 // WW8 SPRMs
4741 // WW9 SPRMs
4744 };
4745 static const sal_uInt16 aSBrc[] =
4746 {
4747 // WW8 SPRMs
4750 // WW9 SPRMs
4753 };
4754
4755 const SvxBoxItemLine* pBrd = aBorders;
4756 for( sal_uInt16 i = 0; i < 4; ++i, ++pBrd )
4757 {
4758 const SvxBorderLine* pLn = rBox.GetLine( *pBrd );
4759
4760 sal_uInt16 nSprmNo, nSprmNoVer9 = 0;
4761 if (m_bOutPageDescs)
4762 {
4763 nSprmNo = aSBrc[i];
4764 nSprmNoVer9 = aSBrc[i+4];
4765 }
4766 else
4767 {
4768 nSprmNo = aPBrc[i];
4769 nSprmNoVer9 = aPBrc[i+4];
4770 }
4771
4772 Out_BorderLine( *m_pO, pLn, rBox.GetDistance( *pBrd ), nSprmNo,
4773 nSprmNoVer9, bShadow );
4774 }
4775}
4776
4786{
4787 // possible and maybe better would be 0xffff
4788 static const SvxBoxItemLine aBorders[] =
4789 {
4790 SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT, SvxBoxItemLine::BOTTOM, SvxBoxItemLine::RIGHT
4791 };
4792 static const SvxBorderLine aBorderLine;
4793
4794 for(const SvxBoxItemLine & rBorder : aBorders)
4795 {
4796 const SvxBorderLine* pLn;
4797 if (pBox != nullptr)
4798 pLn = pBox->GetLine( rBorder );
4799 else
4800 pLn = & aBorderLine;
4801
4802 Out_BorderLine(rO, pLn, 0, 0, 0, false);
4803 }
4804}
4805
4807 sal_uInt8 nLimit )
4808{
4809 if ( !pBox )
4810 return;
4811
4812 static const SvxBoxItemLine aBorders[] =
4813 {
4814 SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT, SvxBoxItemLine::BOTTOM, SvxBoxItemLine::RIGHT
4815 };
4816
4817 for( int i = 0; i < 4; ++i )
4818 {
4819 const SvxBorderLine* pLn = pBox->GetLine( aBorders[i] );
4820 if (!pLn)
4821 continue;
4822
4824 m_pO->push_back( 11 );
4825 m_pO->push_back( nStart );
4826 m_pO->push_back( nLimit );
4827 m_pO->push_back( 1<<i );
4828 WW8_BRCVer9 aBrcVer9 = TranslateBorderLine( *pLn, 0, false );
4829 m_pO->insert( m_pO->end(), aBrcVer9.aBits1, aBrcVer9.aBits2+4 );
4830 }
4831}
4832
4834{
4835 // Fly around graphic -> here no border, because the
4836 // graphics header already has the border
4837 if ( m_rWW8Export.m_bOutGrf )
4838 return;
4839
4840 bool bShadow = false;
4841 const SvxShadowItem* pShadowItem = m_rWW8Export.HasItem( RES_SHADOW );
4842 if ( pShadowItem )
4843 {
4844 bShadow = ( pShadowItem->GetLocation() != SvxShadowLocation::NONE )
4845 && ( pShadowItem->GetWidth() != 0 );
4846 }
4847
4848 SvxBoxItem aBox(rBox);
4850 {
4853
4854 aBox.SetDistance(aDistances.nTop, SvxBoxItemLine::TOP);
4855 aBox.SetDistance(aDistances.nLeft, SvxBoxItemLine::LEFT);
4856 aBox.SetDistance(aDistances.nBottom, SvxBoxItemLine::BOTTOM);
4857 aBox.SetDistance(aDistances.nRight, SvxBoxItemLine::RIGHT);
4858
4859 m_bFromEdge = aDistances.bFromEdge;
4860 }
4861
4862 m_rWW8Export.Out_SwFormatBox( aBox, bShadow );
4863}
4864
4866{
4869
4870 const SvxLRSpaceItem& rLR = pFormat->GetLRSpace();
4871 SwTwips nPageSize = pFormat->GetFrameSize().GetWidth();
4872 rLeft = rLR.GetLeft();
4873 rRight = rLR.GetRight();
4874 return nPageSize;
4875}
4876
4877void WW8AttributeOutput::FormatColumns_Impl( sal_uInt16 nCols, const SwFormatCol & rCol, bool bEven, SwTwips nPageSize )
4878{
4879 // CColumns
4881 m_rWW8Export.InsUInt16( nCols - 1 );
4882
4883 // DxaColumns
4885 m_rWW8Export.InsUInt16( rCol.GetGutterWidth( true ) );
4886
4887 // LBetween
4889 m_rWW8Export.m_pO->push_back( COLADJ_NONE == rCol.GetLineAdj( )? 0 : 1 );
4890
4891 const SwColumns & rColumns = rCol.GetColumns( );
4892
4893 // FEvenlySpaced
4895 m_rWW8Export.m_pO->push_back( bEven ? 1 : 0 );
4896
4897 if ( bEven )
4898 return;
4899
4900 for ( sal_uInt16 n = 0; n < nCols; ++n )
4901 {
4902 //sprmSDxaColWidth
4904 m_rWW8Export.m_pO->push_back( static_cast<sal_uInt8>(n) );
4905 m_rWW8Export.InsUInt16( rCol.
4906 CalcPrtColWidth( n,
4907 o3tl::narrowing<sal_uInt16>(nPageSize) ) );
4908
4909 if ( n + 1 != nCols )
4910 {
4911 //sprmSDxaColSpacing
4913 m_rWW8Export.m_pO->push_back( static_cast<sal_uInt8>(n) );
4914 m_rWW8Export.InsUInt16( rColumns[n].GetRight( ) +
4915 rColumns[n + 1].GetLeft( ) );
4916 }
4917 }
4918}
4919
4921{
4922 const SwColumns& rColumns = rCol.GetColumns();
4923
4924 sal_uInt16 nCols = rColumns.size();
4925 if (1 >= nCols || GetExport( ).m_bOutFlyFrameAttrs)
4926 return;
4927
4928 // get the page width without borders !!
4929
4930 const SwFrameFormat* pFormat = GetExport( ).m_pCurrentPageDesc ? &GetExport( ).m_pCurrentPageDesc->GetMaster() : &const_cast<const SwDoc&>(GetExport().m_rDoc).GetPageDesc(0).GetMaster();
4931 const SvxFrameDirectionItem &frameDirection = pFormat->GetFrameDir();
4932 SwTwips nPageSize;
4933 if ( frameDirection.GetValue() == SvxFrameDirection::Vertical_RL_TB || frameDirection.GetValue() == SvxFrameDirection::Vertical_LR_TB )
4934 {
4935 const SvxULSpaceItem &rUL = pFormat->GetULSpace();
4936 nPageSize = pFormat->GetFrameSize().GetHeight();
4937 nPageSize -= rUL.GetUpper() + rUL.GetLower();
4938
4939 const SwFormatHeader *header = pFormat->GetAttrSet().GetItem(RES_HEADER);
4940 if ( header )
4941 {
4942 const SwFrameFormat *headerFormat = header->GetHeaderFormat();
4943 if (headerFormat)
4944 {
4945 nPageSize -= headerFormat->GetFrameSize().GetHeight();
4946 }
4947 }
4948 const SwFormatFooter *footer = pFormat->GetAttrSet().GetItem(RES_FOOTER);
4949 if ( footer )
4950 {
4951 const SwFrameFormat *footerFormat = footer->GetFooterFormat();
4952 if ( footerFormat )
4953 {
4954 nPageSize -= footerFormat->GetFrameSize().GetHeight();
4955 }
4956 }
4957 }
4958 else
4959 {
4960 const SvxLRSpaceItem &rLR = pFormat->GetLRSpace();
4961 nPageSize = pFormat->GetFrameSize().GetWidth();
4962 nPageSize -= rLR.GetLeft() + rLR.GetRight();
4963 //i120133: The Section width should consider page indent value.
4964 nPageSize -= rCol.GetAdjustValue();
4965
4966 }
4967
4968 // look if all columns are equal
4969 bool bEven = rCol.IsOrtho();
4970 if (!bEven)
4971 {
4972 bEven = true;
4973 sal_uInt16 n;
4974 sal_uInt16 nColWidth = rCol.CalcPrtColWidth( 0, o3tl::narrowing<sal_uInt16>(nPageSize) );
4975 for ( n = 1; n < nCols; n++ )
4976 {
4977 short nDiff = nColWidth -
4978 rCol.CalcPrtColWidth( n, o3tl::narrowing<sal_uInt16>(nPageSize) );
4979
4980 if ( nDiff > 10 || nDiff < -10 ) // Tolerance: 10 tw
4981 {
4982 bEven = false;
4983 break;
4984 }
4985 }
4986 }
4987
4988 FormatColumns_Impl( nCols, rCol, bEven, nPageSize );
4989}
4990
4991// "Paragraphs together"
4993{
4994 // sprmFKeepFollow
4996
4997 m_rWW8Export.m_pO->push_back( rKeep.GetValue() ? 1 : 0 );
4998}
4999
5000// exclude a paragraph from Line Numbering
5002{
5003 // sprmPFNoLineNumb
5005
5006 m_rWW8Export.m_pO->push_back( rNumbering.IsCount() ? 0 : 1 );
5007}
5008
5009/* File PARATR.HXX */
5010
5011void WW8AttributeOutput::ParaLineSpacing_Impl( short nSpace, short nMulti )
5012{
5013 // sprmPDyaLine
5015
5016 m_rWW8Export.InsUInt16( nSpace );
5017 m_rWW8Export.InsUInt16( nMulti );
5018}
5019
5021{
5022 short nSpace = 240, nMulti = 0;
5023
5024 switch ( rSpacing.GetLineSpaceRule() )
5025 {
5026 default:
5027 break;
5028 case SvxLineSpaceRule::Fix: // Fix
5029 nSpace = -static_cast<short>(rSpacing.GetLineHeight());
5030 break;
5031 case SvxLineSpaceRule::Min: // At least
5032 nSpace = static_cast<short>(rSpacing.GetLineHeight());
5033 break;
5034 case SvxLineSpaceRule::Auto:
5035 {
5036 if( rSpacing.GetInterLineSpaceRule() == SvxInterLineSpaceRule::Fix ) // Leading
5037 {
5038 // doesn't exist in WW - how do you get the MaxLineHeight?
5039 nSpace = rSpacing.GetInterLineSpace();
5040 sal_uInt16 nScript =
5041 i18n::ScriptType::LATIN;
5042 const SwAttrSet *pSet = nullptr;
5043 if ( auto pFormat = dynamic_cast< const SwFormat *>( GetExport().m_pOutFormatNode ) )
5044 {
5045 pSet = &pFormat->GetAttrSet();
5046 }
5047 else if ( auto pNd = dynamic_cast< const SwTextNode *>( GetExport().m_pOutFormatNode ) )
5048 {
5049 pSet = &pNd->GetSwAttrSet();
5050 nScript = g_pBreakIt->GetBreakIter()->getScriptType(pNd->GetText(), 0);
5051 }
5052 OSL_ENSURE( pSet, "No attrset for lineheight :-(" );
5053 if ( pSet )
5054 {
5055 nSpace = nSpace + static_cast<short>( AttrSetToLineHeight( GetExport().m_rDoc.getIDocumentSettingAccess(),
5056 *pSet, *Application::GetDefaultDevice(), nScript ) );
5057 }
5058 }
5059 else // Proportional
5060 {
5061 if ( rSpacing.GetInterLineSpaceRule() != SvxInterLineSpaceRule::Off )
5062 nSpace = static_cast<short>( ( 240L * rSpacing.GetPropLineSpace() ) / 100L );
5063 nMulti = 1;
5064 }
5065 }
5066 break;
5067 }
5068 // if nSpace is negative, it is a fixed size in 1/20 of a point
5069 // if nSpace is positive and nMulti is 1, it is 1/240 of a single line height
5070 // otherwise, it is a minimum size in 1/20 of a point
5071 ParaLineSpacing_Impl( nSpace, nMulti );
5072}
5073
5075{
5076 // sprmPJc
5077 sal_uInt8 nAdj;
5078 sal_uInt8 nAdjBiDi;
5079 switch ( rAdjust.GetAdjust() )
5080 {
5081 case SvxAdjust::Left:
5082 nAdj = 0;
5083 nAdjBiDi = 2;
5084 break;
5085 case SvxAdjust::Right:
5086 nAdj = 2;
5087 nAdjBiDi = 0;
5088 break;
5089 case SvxAdjust::BlockLine:
5090 case SvxAdjust::Block:
5091 nAdj = nAdjBiDi = rAdjust.GetLastBlock() == SvxAdjust::Block ? 4 : 3;
5092 break;
5093 case SvxAdjust::Center:
5094 nAdj = nAdjBiDi = 1;
5095 break;
5096 default:
5097 return; // not a supported Attribute
5098 }
5099
5101 m_rWW8Export.m_pO->push_back(nAdj);
5102
5103 /*
5104 Sadly for left to right paragraphs both these values are the same,
5105 for right to left paragraphs the bidi one is the reverse of the
5106 normal one.
5107 */
5108 m_rWW8Export.InsUInt16(NS_sprm::PJc::val); //bidi version ?
5109 bool bBiDiSwap = false;
5111 {
5112 SvxFrameDirection nDirection = SvxFrameDirection::Horizontal_LR_TB;
5113 if (auto pTN = dynamic_cast<const SwTextNode*>(m_rWW8Export.m_pOutFormatNode))
5114 {
5115 SwPosition aPos(*pTN);
5116 nDirection = m_rWW8Export.m_rDoc.GetTextDirection(aPos);
5117 }
5118 else if (auto pC = dynamic_cast<const SwTextFormatColl*>(m_rWW8Export.m_pOutFormatNode))
5119 {
5120 const SvxFrameDirectionItem &rItem = pC->GetFormatAttr(RES_FRAMEDIR);
5121 nDirection = rItem.GetValue();
5122 }
5123 if ( ( nDirection == SvxFrameDirection::Horizontal_RL_TB ) ||
5124 ( nDirection == SvxFrameDirection::Environment && AllSettings::GetLayoutRTL() ) )
5125 {
5126 bBiDiSwap = true;
5127 }
5128 }
5129
5130 if (bBiDiSwap)
5131 m_rWW8Export.m_pO->push_back(nAdjBiDi);
5132 else
5133 m_rWW8Export.m_pO->push_back(nAdj);
5134}
5135
5137{
5138 sal_uInt16 nTextFlow=0;
5139 bool bBiDi = false;
5140 SvxFrameDirection nDir = rDirection.GetValue();
5141
5142 if ( nDir == SvxFrameDirection::Environment )
5144
5145
5146 switch ( nDir )
5147 {
5148 default:
5149 //Can't get an unknown type here
5150 OSL_FAIL("Unknown frame direction");
5151 [[fallthrough]];
5152 case SvxFrameDirection::Horizontal_LR_TB:
5153 nTextFlow = 0;
5154 break;
5155 case SvxFrameDirection::Horizontal_RL_TB:
5156 nTextFlow = 0;
5157 bBiDi = true;
5158 break;
5159 case SvxFrameDirection::Vertical_LR_TB: //word doesn't have this
5160 case SvxFrameDirection::Vertical_RL_TB:
5161 nTextFlow = 1;
5162 break;
5163 }
5164
5166 {
5168 m_rWW8Export.InsUInt16( nTextFlow );
5170 m_rWW8Export.m_pO->push_back( bBiDi ? 1 : 0 );
5171 }
5172 else if ( !m_rWW8Export.m_bOutFlyFrameAttrs ) //paragraph/style
5173 {
5175 m_rWW8Export.m_pO->push_back( bBiDi ? 1 : 0 );
5176 }
5177}
5178
5180{
5181}
5182
5184{
5185}
5186
5188{
5189 sal_uInt16 nOutLvl = std::min(rItem.GetValue(), sal_uInt16(WW8ListManager::nMaxLevel));
5190 // Outline Level: in LO Body Text = 0, in MS Body Text = 9
5191 nOutLvl = nOutLvl ? nOutLvl - 1 : 9;
5193 m_rWW8Export.m_pO->push_back( nOutLvl );
5194}
5195
5196// "Separate paragraphs"
5198{
5199 // sprmPFKeep
5201 m_rWW8Export.m_pO->push_back( rSplit.GetValue() ? 0 : 1 );
5202}
5203
5210{
5211 // sprmPFWidowControl
5213 m_rWW8Export.m_pO->push_back( rWidows.GetValue() ? 1 : 0 );
5214}
5215
5216namespace {
5217
5218class SwWW8WrTabu
5219{
5220 std::unique_ptr<sal_uInt8[]> m_pDel; // DelArray
5221 std::unique_ptr<sal_uInt8[]> m_pAddPos; // AddPos-Array
5222 std::unique_ptr<sal_uInt8[]> m_pAddTyp; // AddTyp-Array
5223 sal_uInt16 m_nAdd; // number of tabs to be added
5224 sal_uInt16 m_nDel; // number of tabs to be deleted
5225
5226 SwWW8WrTabu(const SwWW8WrTabu&) = delete;
5227 SwWW8WrTabu& operator=(const SwWW8WrTabu&) = delete;
5228
5229public:
5230 SwWW8WrTabu(sal_uInt16 nDelMax, sal_uInt16 nAddMax);
5231
5232 void Add(const SvxTabStop &rTS, tools::Long nAdjustment);
5233 void Del(const SvxTabStop &rTS, tools::Long nAdjustment);
5234 void PutAll(WW8Export& rWW8Wrt);
5235};
5236
5237}
5238
5239SwWW8WrTabu::SwWW8WrTabu(sal_uInt16 nDelMax, sal_uInt16 nAddMax)
5240 : m_nAdd(0), m_nDel(0)
5241{
5242 if (nDelMax)
5243 m_pDel.reset( new sal_uInt8[nDelMax * 2] );
5244 m_pAddPos.reset( new sal_uInt8[nAddMax * 2] );
5245 m_pAddTyp.reset( new sal_uInt8[nAddMax] );
5246}
5247
5251void SwWW8WrTabu::Add(const SvxTabStop & rTS, tools::Long nAdjustment)
5252{
5253 // insert tab position
5254 ShortToSVBT16(msword_cast<sal_Int16>(rTS.GetTabPos() + nAdjustment),
5255 m_pAddPos.get() + (m_nAdd * 2));
5256
5257 // insert tab type
5258 sal_uInt8 nPara = 0;
5259 switch (rTS.GetAdjustment())
5260 {
5261 case SvxTabAdjust::Right:
5262 nPara = 2;
5263 break;
5264 case SvxTabAdjust::Center:
5265 nPara = 1;
5266 break;
5267 case SvxTabAdjust::Decimal:
5268 /*
5269 There is nothing we can do btw the decimal separator has been
5270 customized, but if you think different remember that different
5271 locales have different separators, i.e. german is a , while english
5272 is a .
5273 */
5274 nPara = 3;
5275 break;
5276 default:
5277 break;
5278 }
5279
5280 switch( rTS.GetFill() )
5281 {
5282 case '.': // dotted leader
5283 nPara |= 1 << 3;
5284 break;
5285 case '_': // Single line leader
5286 nPara |= 3 << 3;
5287 break;
5288 case '-': // hyphenated leader
5289 nPara |= 2 << 3;
5290 break;
5291 case '=': // heavy line leader
5292 nPara |= 4 << 3;
5293 break;
5294 }
5295
5296 m_pAddTyp[m_nAdd] = nPara;
5297 ++m_nAdd;
5298}
5299
5303void SwWW8WrTabu::Del(const SvxTabStop &rTS, tools::Long nAdjustment)
5304{
5305 // insert tab position
5306 ShortToSVBT16(msword_cast<sal_Int16>(rTS.GetTabPos() + nAdjustment),
5307 m_pDel.get() + (m_nDel * 2));
5308 ++m_nDel;
5309}
5310
5314void SwWW8WrTabu::PutAll(WW8Export& rWrt)
5315{
5316 if (!m_nAdd && !m_nDel) //If it's a no-op
5317 return;
5318 OSL_ENSURE(m_nAdd <= 255, "more than 255 added tabstops?");
5319 OSL_ENSURE(m_nDel <= 255, "more than 244 removed tabstops?");
5320 if (m_nAdd > 255)
5321 m_nAdd = 255;
5322 if (m_nDel > 255)
5323 m_nDel = 255;
5324
5325 sal_uInt16 nSiz = 2 * m_nDel + 3 * m_nAdd + 2;
5326 if (nSiz > 255)
5327 nSiz = 255;
5328
5330 // insert cch
5331 rWrt.m_pO->push_back(msword_cast<sal_uInt8>(nSiz));
5332 // write DelArr
5333 rWrt.m_pO->push_back(msword_cast<sal_uInt8>(m_nDel));
5334 rWrt.OutSprmBytes(m_pDel.get(), m_nDel * 2);
5335 // write InsArr
5336 rWrt.m_pO->push_back(msword_cast<sal_uInt8>(m_nAdd));
5337 rWrt.OutSprmBytes(m_pAddPos.get(), 2 * m_nAdd); // AddPosArray
5338 rWrt.OutSprmBytes(m_pAddTyp.get(), m_nAdd); // AddTypArray
5339}
5340
5341static void ParaTabStopAdd( WW8Export& rWrt,
5342 const SvxTabStopItem& rTStops,
5343 const tools::Long nLParaMgn )
5344{
5345 SwWW8WrTabu aTab( 0, rTStops.Count());
5346
5347 for( sal_uInt16 n = 0; n < rTStops.Count(); n++ )
5348 {
5349 const SvxTabStop& rTS = rTStops[n];
5350 // ignore default tabs
5351 if (SvxTabAdjust::Default != rTS.GetAdjustment())
5352 aTab.Add(rTS, nLParaMgn);
5353 }
5354 aTab.PutAll( rWrt );
5355}
5356
5357static bool lcl_IsEqual(tools::Long nOneLeft, const SvxTabStop &rOne,
5358 tools::Long nTwoLeft, const SvxTabStop &rTwo)
5359{
5360 return(
5361 nOneLeft == nTwoLeft &&
5362 rOne.GetAdjustment() == rTwo.GetAdjustment() &&
5363 rOne.GetDecimal() == rTwo.GetDecimal() &&
5364 rOne.GetFill() == rTwo.GetFill()
5365 );
5366}
5367
5368static void ParaTabStopDelAdd( WW8Export& rWrt,
5369 const SvxTabStopItem& rTStyle,
5370 const tools::Long nLStypeMgn,
5371 const SvxTabStopItem& rTNew,
5372 const tools::Long nLParaMgn )
5373{
5374 SwWW8WrTabu aTab(rTStyle.Count(), rTNew.Count());
5375
5376 sal_uInt16 nO = 0; // rTStyle Index
5377 sal_uInt16 nN = 0; // rTNew Index
5378
5379 do {
5380 const SvxTabStop* pTO;
5381 tools::Long nOP;
5382 if( nO < rTStyle.Count() ) // old not yet at the end?
5383 {
5384 pTO = &rTStyle[ nO ];
5385 nOP = pTO->GetTabPos() + nLStypeMgn;
5386 if( SvxTabAdjust::Default == pTO->GetAdjustment() )
5387 {
5388 nO++; // ignore default tab
5389 continue;
5390 }
5391 }
5392 else
5393 {
5394 pTO = nullptr;
5395 nOP = LONG_MAX;
5396 }
5397
5398 const SvxTabStop* pTN;
5399 tools::Long nNP;
5400 if( nN < rTNew.Count() ) // new not yet at the end
5401 {
5402 pTN = &rTNew[ nN ];
5403 nNP = pTN->GetTabPos() + nLParaMgn;
5404 if( SvxTabAdjust::Default == pTN->GetAdjustment() )
5405 {
5406 nN++; // ignore default tab
5407 continue;
5408 }
5409 }
5410 else
5411 {
5412 pTN = nullptr;
5413 nNP = LONG_MAX;
5414 }
5415
5416 if( nOP == LONG_MAX && nNP == LONG_MAX )
5417 break; // everything done
5418
5419 if( nOP < nNP ) // next tab is old
5420 {
5421 assert(pTO);
5422 aTab.Del(*pTO, nLStypeMgn); // must be deleted
5423 nO++;
5424 }
5425 else if( nNP < nOP ) // next tab is new
5426 {
5427 assert(pTN);
5428 aTab.Add(*pTN, nLParaMgn); // must be inserted
5429 nN++;
5430 }
5431 else if (lcl_IsEqual(nOP, *pTO, nNP, *pTN)) // tabs are equal
5432 {
5433 nO++; // nothing to do
5434 nN++;
5435 }
5436 else // tabs same position, different type
5437 {
5438 aTab.Del(*pTO, nLStypeMgn); // delete old one
5439 aTab.Add(*pTN, nLParaMgn); // insert new one
5440 nO++;
5441 nN++;
5442 }
5443 } while( true );
5444
5445 aTab.PutAll( rWrt );
5446}
5447
5449{
5450 const bool bTabsRelativeToIndex = m_rWW8Export.m_pCurPam->GetDoc().getIDocumentSettingAccess().get( DocumentSettingId::TABS_RELATIVE_TO_INDENT );
5451
5452 tools::Long nCurrentLeft = 0;
5453 if ( bTabsRelativeToIndex )
5454 {
5456 {
5457 if (const auto pLeft = pItem->DynamicWhichCast(RES_MARGIN_TEXTLEFT))
5458 {
5459 nCurrentLeft = pLeft->GetTextLeft();
5460 }
5461 else
5462 // FIXME: This fails in sw.ww8export/testCommentExport::Load_Verify_Reload_Verify
5463 SAL_WARN("sw.ww8", "m_rWW8Export has an RES_LR_SPACE item, but it's of the wrong type.");
5464 }
5465 }
5466
5467 // #i100264#
5468 if ( m_rWW8Export.m_bStyDef &&
5469 m_rWW8Export.m_pCurrentStyle != nullptr &&
5471 {
5472 SvxTabStopItem aParentTabs( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP );
5473 const SwFormat *pParentStyle = m_rWW8Export.m_pCurrentStyle->DerivedFrom();
5474 {
5475 if (const SvxTabStopItem* pParentTabs = pParentStyle->GetAttrSet().GetItem<SvxTabStopItem>(RES_PARATR_TABSTOP))
5476 {
5477 aParentTabs.Insert( pParentTabs );
5478 }
5479 }
5480
5481 // #i120938# - consider left indentation of style and its parent style
5482 tools::Long nParentLeft = 0;
5483 if ( bTabsRelativeToIndex )
5484 {
5485 SvxTextLeftMarginItem const& rLeftMargin(pParentStyle->GetAttrSet().Get(RES_MARGIN_TEXTLEFT));
5486 nParentLeft = rLeftMargin.GetTextLeft();
5487 }
5488
5489 ParaTabStopDelAdd( m_rWW8Export, aParentTabs, nParentLeft, rTabStops, nCurrentLeft );
5490 return;
5491 }
5492
5493 const SvxTabStopItem* pStyleTabs = nullptr;
5495 {
5497 }
5498
5499 if ( !pStyleTabs )
5500 {
5501 ParaTabStopAdd(m_rWW8Export, rTabStops, nCurrentLeft);
5502 }
5503 else
5504 {
5505 tools::Long nStyleLeft = 0;
5506 if ( bTabsRelativeToIndex )
5507 {
5509 nStyleLeft = rLeftMargin.GetTextLeft();
5510 }
5511
5513 *pStyleTabs, nStyleLeft,
5514 rTabStops, nCurrentLeft);
5515 }
5516}
5517
5519{
5520 // FIXME maybe use 'item_cast', like 'item_cast<SvxCharHiddenItem>( rHt )'?
5521 switch ( rHt.Which() )
5522 {
5523 case RES_CHRATR_CASEMAP:
5525 break;
5526 case RES_CHRATR_COLOR:
5528 break;
5529 case RES_CHRATR_CONTOUR:
5531 break;
5534 break;
5537 break;
5538 case RES_CHRATR_FONT:
5540 break;
5543 break;
5544 case RES_CHRATR_KERNING:
5546 break;
5549 break;
5550 case RES_CHRATR_POSTURE:
5552 break;
5555 break;
5558 break;
5559 case RES_CHRATR_WEIGHT:
5561 break;
5564 break;
5565 case RES_CHRATR_BLINK:
5567 break;
5570 break;
5571
5573 CharFontCJK( static_cast< const SvxFontItem& >( rHt ) );
5574 break;
5576 CharFontSizeCJK( static_cast< const SvxFontHeightItem& >( rHt ) );
5577 break;
5579 CharLanguageCJK( static_cast< const SvxLanguageItem& >( rHt ) );
5580 break;
5582 CharPostureCJK( static_cast< const SvxPostureItem& >( rHt ) );
5583 break;
5585 CharWeightCJK( static_cast< const SvxWeightItem& >( rHt ) );
5586 break;
5587
5589 CharFontCTL( static_cast< const SvxFontItem& >( rHt ) );
5590 break;
5592 CharFontSizeCTL( static_cast< const SvxFontHeightItem& >( rHt ) );
5593 break;
5595 CharLanguageCTL( static_cast< const SvxLanguageItem& >( rHt ) );
5596 break;
5598 CharPostureCTL( static_cast< const SvxPostureItem& >( rHt ) );
5599 break;
5601 CharWeightCTL( static_cast< const SvxWeightItem& >( rHt ) );
5602 break;
5603
5604 case RES_CHRATR_ROTATE:
5606 break;
5609 break;
5612 break;
5613 case RES_CHRATR_SCALEW:
5615 break;
5616 case RES_CHRATR_RELIEF:
5618 break;
5619 case RES_CHRATR_HIDDEN:
5621 break;
5622 case RES_CHRATR_BOX:
5624 break;
5627 break;
5628 case RES_CHRATR_BIDIRTL:
5629 CharBidiRTL( rHt );
5630 break;
5632 CharIdctHint( rHt );
5633 break;
5634 case RES_TXTATR_INETFMT:
5635 TextINetFormat( static_cast< const SwFormatINetFormat& >( rHt ) );
5636 break;
5637 case RES_TXTATR_CHARFMT:
5638 TextCharFormat( static_cast< const SwFormatCharFormat& >( rHt ) );
5639 break;
5640
5641 case RES_TXTATR_FIELD:
5644 TextField( static_cast< const SwFormatField& >( rHt ) );
5645 break;
5646
5647 case RES_TXTATR_FLYCNT:
5648 TextFlyContent( static_cast< const SwFormatFlyCnt& >( rHt ) );
5649 break;
5650 case RES_TXTATR_FTN:
5651 TextFootnote( static_cast< const SwFormatFootnote& >( rHt ) );
5652 break;
5653
5655 ParaLineSpacing( static_cast< const SvxLineSpacingItem& >( rHt ) );
5656 break;
5657 case RES_PARATR_ADJUST:
5658 ParaAdjust( static_cast< const SvxAdjustItem& >( rHt ) );
5659 break;
5660 case RES_PARATR_SPLIT:
5661 ParaSplit( static_cast< const SvxFormatSplitItem& >( rHt ) );
5662 break;
5663 case RES_PARATR_WIDOWS:
5664 ParaWidows( static_cast< const SvxWidowsItem& >( rHt ) );
5665 break;
5666 case RES_PARATR_TABSTOP:
5667 ParaTabStop( static_cast< const SvxTabStopItem& >( rHt ) );
5668 break;
5670 ParaHyphenZone( static_cast< const SvxHyphenZoneItem& >( rHt ) );
5671 break;
5672 case RES_PARATR_NUMRULE:
5673 ParaNumRule( static_cast< const SwNumRuleItem& >( rHt ) );
5674 break;
5676 ParaScriptSpace( static_cast< const SfxBoolItem& >( rHt ) );
5677 break;
5679 ParaHangingPunctuation( static_cast< const SfxBoolItem& >( rHt ) );
5680 break;
5682 ParaForbiddenRules( static_cast< const SfxBoolItem& >( rHt ) );
5683 break;
5685 ParaVerticalAlign( static_cast< const SvxParaVertAlignItem& >( rHt ) );
5686 break;
5688 ParaSnapToGrid( static_cast< const SvxParaGridItem& >( rHt ) );
5689 break;
5690
5691 case RES_FRM_SIZE:
5692 FormatFrameSize( static_cast< const SwFormatFrameSize& >( rHt ) );
5693 break;
5694 case RES_PAPER_BIN:
5695 FormatPaperBin( static_cast< const SvxPaperBinItem& >( rHt ) );
5696 break;
5698 FormatFirstLineIndent(static_cast<const SvxFirstLineIndentItem &>(rHt));
5699 break;
5701 FormatTextLeftMargin(static_cast<const SvxTextLeftMarginItem &>(rHt));
5702 break;
5703 case RES_MARGIN_RIGHT:
5704 FormatRightMargin(static_cast<const SvxRightMarginItem &>(rHt));
5705 break;
5706 case RES_LR_SPACE:
5707 FormatLRSpace( static_cast< const SvxLRSpaceItem& >( rHt ) );
5708 break;
5709 case RES_UL_SPACE:
5710 FormatULSpace( static_cast< const SvxULSpaceItem& >( rHt ) );
5711 break;
5712 case RES_PAGEDESC:
5713 FormatPageDescription( static_cast< const SwFormatPageDesc& >( rHt ) );
5714 break;
5715 case RES_BREAK:
5716 FormatBreak( static_cast< const SvxFormatBreakItem& >( rHt ) );
5717 break;
5718 case RES_SURROUND:
5719 FormatSurround( static_cast< const SwFormatSurround& >( rHt ) );
5720 break;
5721 case RES_VERT_ORIENT:
5722 FormatVertOrientation( static_cast< const SwFormatVertOrient& >( rHt ) );
5723 break;
5724 case RES_HORI_ORIENT:
5725 FormatHorizOrientation( static_cast< const SwFormatHoriOrient& >( rHt ) );
5726 break;
5727 case RES_ANCHOR:
5728 FormatAnchor( static_cast< const SwFormatAnchor& >( rHt ) );
5729 break;
5730 case RES_BACKGROUND:
5731 FormatBackground( static_cast< const SvxBrushItem& >( rHt ) );
5732 break;
5733 case XATTR_FILLSTYLE:
5734 FormatFillStyle( static_cast< const XFillStyleItem& >( rHt ) );
5735 break;
5736 case XATTR_FILLGRADIENT:
5737 FormatFillGradient( static_cast< const XFillGradientItem& >( rHt ) );
5738 break;
5739 case RES_BOX:
5740 FormatBox( static_cast< const SvxBoxItem& >( rHt ) );
5741 break;
5742 case RES_COL:
5743 FormatColumns( static_cast< const SwFormatCol& >( rHt ) );
5744 break;
5745 case RES_KEEP:
5746 FormatKeep( static_cast< const SvxFormatKeepItem& >( rHt ) );
5747 break;
5748 case RES_TEXTGRID:
5749 FormatTextGrid( static_cast< const SwTextGridItem& >( rHt ) );
5750 break;
5751 case RES_LINENUMBER:
5752 FormatLineNumbering( static_cast< const SwFormatLineNumber& >( rHt ) );
5753 break;
5754 case RES_FRAMEDIR:
5755 FormatFrameDirection( static_cast< const SvxFrameDirectionItem& >( rHt ) );
5756 break;
5757 case RES_PARATR_GRABBAG:
5758 ParaGrabBag(static_cast<const SfxGrabBagItem&>(rHt));
5759 break;
5761 ParaOutlineLevelBase(static_cast<const SfxUInt16Item&>(rHt));
5762 break;
5763 case RES_CHRATR_GRABBAG:
5764 CharGrabBag(static_cast<const SfxGrabBagItem&>(rHt));
5765 break;
5766 case RES_RTL_GUTTER:
5767 SectionRtlGutter(static_cast<const SfxBoolItem&>(rHt));
5768 break;
5770 TextLineBreak(static_cast<const SwFormatLineBreak&>(rHt));
5771 break;
5772
5773 default:
5774 SAL_INFO("sw.ww8", "Unhandled SfxPoolItem with id " << rHt.Which() );
5775 break;
5776 }
5777}
5778
5779void AttributeOutputBase::OutputStyleItemSet( const SfxItemSet& rSet, bool bTestForDefault )
5780{
5781 // based on OutputItemSet() from wrt_fn.cxx
5782
5783 const SfxItemPool& rPool = *rSet.GetPool();
5784 const SfxItemSet* pSet = &rSet;
5785 if ( !pSet->Count() )
5786 {
5787 while ( nullptr != ( pSet = pSet->GetParent() ) && !pSet->Count() )
5788 ;
5789
5790 if ( !pSet )
5791 return;
5792 }
5793
5794 const SfxPoolItem* pItem;
5795 if ( !pSet->GetParent() )
5796 {
5797 assert(rSet.Count() && "Was already handled or?");
5798 SfxItemIter aIter( *pSet );
5799 pItem = aIter.GetCurItem();
5800 do {
5801 OutputItem( *pItem );
5802 } while ((pItem = aIter.NextItem()));
5803 }
5804 else
5805 {
5806 SfxWhichIter aIter( *pSet );
5807 sal_uInt16 nWhich = aIter.FirstWhich();
5808 while ( nWhich )
5809 {
5810 if ( SfxItemState::SET == aIter.GetItemState( true/*bDeep*/, &pItem ) &&
5811 ( !bTestForDefault ||
5812 nWhich == RES_UL_SPACE ||
5813 nWhich == RES_LR_SPACE ||
5814 *pItem != rPool.GetDefaultItem( nWhich ) ||
5815 ( pSet->GetParent() && *pItem != pSet->GetParent()->Get( nWhich ) ) ) )
5816 {
5817 OutputItem( *pItem );
5818 }
5819 nWhich = aIter.NextWhich();
5820 }
5821 }
5822}
5823
5825{
5826 // Get one of the borders (if there is any border then in docx also will be)
5827 const SvxBorderLine* pBorderLine = nullptr;
5828 sal_uInt16 nDist = 0;
5829 if( rBox.GetTop() )
5830 {
5831 pBorderLine = rBox.GetTop();
5832 nDist = rBox.GetDistance( SvxBoxItemLine::TOP );
5833 }
5834 else if( rBox.GetLeft() )
5835 {
5836 pBorderLine = rBox.GetLeft();
5837 nDist = rBox.GetDistance( SvxBoxItemLine::LEFT );
5838 }
5839 else if( rBox.GetBottom() )
5840 {
5841 pBorderLine = rBox.GetBottom();
5842 nDist = rBox.GetDistance( SvxBoxItemLine::BOTTOM );
5843 }
5844 else if( rBox.GetRight() )
5845 {
5846 pBorderLine = rBox.GetRight();
5847 nDist = rBox.GetDistance( SvxBoxItemLine::RIGHT );
5848 }
5849
5850 // RTF: avoid regressions since RTF doesn't know how to export a border_NONE style-override
5851 if( pBorderLine || GetExport().GetExportFormat() != MSWordExportBase::ExportFormat::RTF )
5852 {
5853 const SfxPoolItem* pItem = GetExport().HasItem( RES_CHRATR_SHADOW );
5854 const SvxShadowItem* pShadowItem = static_cast<const SvxShadowItem*>(pItem);
5855 const bool bShadow = pBorderLine &&
5856 pShadowItem && pShadowItem->GetLocation() != SvxShadowLocation::NONE &&
5857 pShadowItem->GetWidth() > 0;
5858
5859 CharBorder( pBorderLine, nDist, bShadow );
5860 }
5861}
5862
5863/*
5864 * This function is used to check if the current SwTextNode (paragraph) has a redline object
5865 * that is attached to the paragraph marker.
5866 * This is done by checking if the range (SwPaM) of the redline is :
5867 * - Start = the last character of the current paragraph
5868 * - End = the first character of the next paragraph
5869 */
5871{
5872 // ToDo : this is not the most ideal ... should start maybe from 'nCurRedlinePos'
5874 {
5875 // Only check redlines that are of type 'Delete'
5876 if ( pRedl->GetRedlineData().GetType() != aRedlineType )
5877 continue;
5878
5879 SwNodeOffset uStartNodeIndex = pRedl->Start()->GetNodeIndex();
5880 SwNodeOffset uEndNodeIndex = pRedl->End()->GetNodeIndex();
5881 SwNodeOffset uNodeIndex = rNode.GetIndex();
5882
5883 if( uStartNodeIndex <= uNodeIndex && uNodeIndex < uEndNodeIndex )
5884 return &( pRedl->GetRedlineData() );
5885 }
5886 return nullptr;
5887}
5888
5890{
5891 bool bConvertToShading = SvtFilterOptions::Get().IsCharBackground2Shading();
5892 bool bHasShadingMarker = false;
5893
5894 // MS Word doesn't support highlight in character styles. Always export those as shading.
5895 if ( !bConvertToShading && GetExport().m_bStyDef )
5896 {
5897 const SwFormat* pFormat = dynamic_cast<const SwFormat*>( GetExport().m_pOutFormatNode );
5898 bConvertToShading = pFormat && pFormat->Which() == RES_CHRFMT;
5899 }
5900
5901 // Check shading marker
5903 if( pItem )
5904 {
5905 const SfxGrabBagItem aGrabBag = static_cast< const SfxGrabBagItem& >(*pItem);
5906 const std::map<OUString, css::uno::Any>& rMap = aGrabBag.GetGrabBag();
5907 auto aIterator = rMap.find("CharShadingMarker");
5908 if( aIterator != rMap.end() )
5909 {
5910 aIterator->second >>= bHasShadingMarker;
5911 }
5912 }
5913
5914 if( bConvertToShading || bHasShadingMarker )
5915 {
5916 CharBackground(rBrush);
5917 }
5918 else
5919 {
5920 // Don't create a duplicate entry when converting to highlight. An existing one has priority.
5921 // Character runs seem to need a different method to detect duplicates? Just continue to ignore that situation.
5922 if (GetExport().m_aCurrentCharPropStarts.size() || !GetExport().HasItem(RES_CHRATR_HIGHLIGHT))
5923 CharHighlight(rBrush);
5924 }
5925}
5926
5927/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@ TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK
constexpr sal_Int8 header[]
const char * pName
SvxBoxItemLine
SwBreakIt * g_pBreakIt
Definition: breakit.cxx:34
static bool GetLayoutRTL()
static OutputDevice * GetDefaultDevice()
virtual void FormatKeep(const SvxFormatKeepItem &)=0
Sfx item RES_KEEP.
virtual void ParaTabStop(const SvxTabStopItem &)=0
Sfx item RES_PARATR_TABSTOP.
virtual void CharCaseMap(const SvxCaseMapItem &)=0
Sfx item Sfx item RES_CHRATR_CASEMAP.
virtual void FormatFillStyle(const XFillStyleItem &)=0
Sfx item RES_FILL_STYLE.
virtual void FormatTextLeftMargin(const SvxTextLeftMarginItem &rTextLeftMargin)=0
Sfx item RES_MARGIN_TEXTLEFT.
virtual void TextLineBreak(const SwFormatLineBreak &)=0
RES_TXTATR_LINEBREAK, i.e. clearing breaks.
virtual void TextINetFormat(const SwFormatINetFormat &)=0
Sfx item RES_TXTATR_INETFMT.
virtual void CharWeightCTL(const SvxWeightItem &)=0
Sfx item RES_CHRATR_CTL_WEIGHT.
virtual void ParaHyphenZone(const SvxHyphenZoneItem &)=0
Sfx item RES_PARATR_HYPHENZONE.
virtual void WriteExpand(const SwField *pField)=0
Write the expanded field.
virtual void ParaSplit(const SvxFormatSplitItem &)=0
Sfx item RES_PARATR_SPLIT.
virtual void CharBorder(const ::editeng::SvxBorderLine *pAllBorder, const sal_uInt16 nDist, const bool bShadow)=0
virtual void CharFontSize(const SvxFontHeightItem &)=0
Sfx item RES_CHRATR_FONTSIZE.
virtual void CharFontSizeCJK(const SvxFontHeightItem &)=0
Sfx item RES_CHRATR_CJK_FONTSIZE.
virtual bool MaybeOutputBrushItem(SfxItemSet const &)
virtual void CharFontSizeCTL(const SvxFontHeightItem &)=0
Sfx item RES_CHRATR_CTL_FONTSIZE.
void GenerateBookmarksForSequenceField(const SwTextNode &rNode, SwWW8AttrIter &rAttrIter)
MSO uses bookmarks to reference sequence fields, so we need to generate these additional bookmarks du...
Definition: ww8atr.cxx:2141
virtual void CharKerning(const SvxKerningItem &)=0
Sfx item RES_CHRATR_KERNING.
void ParaNumRule(const SwNumRuleItem &)
Sfx item RES_PARATR_NUMRULE.
Definition: ww8atr.cxx:3794
virtual void CharBidiRTL(const SfxPoolItem &)=0
Sfx item RES_CHRATR_BidiRTL.
virtual void CharPostureCJK(const SvxPostureItem &)=0
Sfx item RES_CHRATR_CJK_POSTURE.
virtual void FormatSurround(const SwFormatSurround &)=0
Sfx item RES_SURROUND.
virtual void ParaAdjust(const SvxAdjustItem &)=0
Sfx item RES_PARATR_ADJUST.
void TextFlyContent(const SwFormatFlyCnt &)
Sfx item RES_TXTATR_FLYCNT.
Definition: ww8atr.cxx:3485
void TextField(const SwFormatField &)
Sfx item RES_TXTATR_FIELD, RES_TXTATR_ANNOTATION and RES_TXTATR_INPUTFIELD.
Definition: ww8atr.cxx:2929
virtual void FormatBackground(const SvxBrushItem &)=0
Sfx item RES_BACKGROUND.
virtual void ParaOutlineLevel(const SfxUInt16Item &)=0
virtual void FormatFirstLineIndent(const SvxFirstLineIndentItem &rFirstLine)=0
Sfx item RES_MARGIN_FIRSTLINE.
virtual void CharFontCTL(const SvxFontItem &)=0
Sfx item RES_CHRATR_CTL_FONT.
void CharBackgroundBase(const SvxBrushItem &)
Sfx item RES_CHRATR_BACKGROUND.
Definition: ww8atr.cxx:5889
virtual void FormatTextGrid(const SwTextGridItem &)=0
Sfx item RES_TEXTGRID.
virtual void ParaScriptSpace(const SfxBoolItem &)=0
Sfx item RES_PARATR_SCRIPTSPACE.
void FormatPageDescription(const SwFormatPageDesc &)
Sfx item RES_PAGEDESC.
Definition: ww8atr.cxx:4041
virtual void CharLanguage(const SvxLanguageItem &)=0
Sfx item RES_CHRATR_LANGUAGE.
virtual void SetField(const SwField &rField, ww::eField eType, const OUString &rCmd)=0
virtual void ParaVerticalAlign(const SvxParaVertAlignItem &)=0
Sfx item RES_PARATR_VERTALIGN.
virtual void FormatPaperBin(const SvxPaperBinItem &)=0
Sfx item RES_PAPER_BIN.
virtual void CharWeight(const SvxWeightItem &)=0
Sfx item RES_CHRATR_WEIGHT.
virtual void CharColor(const SvxColorItem &)=0
Sfx item Sfx item RES_CHRATR_COLOR.
virtual bool DropdownField(const SwField *pField)=0
void OutputStyleItemSet(const SfxItemSet &rSet, bool bTestForDefault)
Use OutputItem() on an item set - for styles.
Definition: ww8atr.cxx:5779
virtual void FormatColumns_Impl(sal_uInt16 nCols, const SwFormatCol &rCol, bool bEven, SwTwips nPageSize)=0
void EndTOX(const SwSection &rSect, bool bCareEnd=true)
Definition: ww8atr.cxx:2682
virtual void CharAnimatedText(const SvxBlinkItem &)=0
Sfx item RES_CHRATR_BLINK.
virtual void PageBreakBefore(bool bBreak)=0
Page break As a paragraph property - the paragraph should be on the next page.
virtual void WriteBookmarkInActParagraph(const OUString &rName, sal_Int32 nFirstRunPos, sal_Int32 nLastRunPos)=0
Insert a bookmark inside the currently processed paragraph.
virtual void EndRun(const SwTextNode *pNode, sal_Int32 nPos, sal_Int32 nLen, bool bLastRun=false)=0
End of the text run.
virtual void ParaHangingPunctuation(const SfxBoolItem &)=0
Sfx item RES_PARATR_HANGINGPUNCTUATION.
virtual void CharWeightCJK(const SvxWeightItem &)=0
Sfx item RES_CHRATR_CJK_WEIGHT.
virtual void FormatFrameDirection(const SvxFrameDirectionItem &)=0
Sfx item RES_FRAMEDIR.
virtual void CharRotate(const SvxCharRotateItem &)=0
Sfx item RES_CHRATR_ROTATE.
virtual void ParaForbiddenRules(const SfxBoolItem &)=0
Sfx item RES_PARATR_FORBIDDEN_RULES.
virtual void FormatAnchor(const SwFormatAnchor &)=0
Sfx item RES_ANCHOR.
void FormatBreak(const SvxFormatBreakItem &)
Sfx item RES_BREAK.
Definition: ww8atr.cxx:4064
virtual void ParaWidows(const SvxWidowsItem &)=0
Sfx item RES_PARATR_WIDOWS.
virtual void FormatFillGradient(const XFillGradientItem &)=0
Sfx item RES_FILL_GRADIENT.
virtual void CharIdctHint(const SfxPoolItem &)=0
Sfx item RES_CHRATR_IdctHint.
virtual void TextCharFormat(const SwFormatCharFormat &)=0
Sfx item RES_TXTATR_CHARFMT.
virtual void CharShadow(const SvxShadowedItem &)=0
Sfx item RES_CHRATR_SHADOWED.
virtual void CharRelief(const SvxCharReliefItem &)=0
Sfx item RES_CHRATR_RELIEF.
virtual bool PlaceholderField(const SwField *pField)=0
virtual void RefField(const SwField &rField, const OUString &rRef)=0
virtual void CharUnderline(const SvxUnderlineItem &)=0
Sfx item RES_CHRATR_UNDERLINE.
virtual void FormatHorizOrientation(const SwFormatHoriOrient &)=0
Sfx item RES_HORI_ORIENT.
virtual void CharHighlight(const SvxBrushItem &)=0
Sfx item RES_CHRATR_HIGHLIGHT.
virtual void CharBackground(const SvxBrushItem &)=0
void FormatCharBorder(const SvxBoxItem &rBox)
Sfx item RES_CHRATR_BOX.
Definition: ww8atr.cxx:5824
void ParaOutlineLevelBase(const SfxUInt16Item &rItem)
Sfx item RES_PARATR_OUTLINELEVEL.
Definition: ww8atr.cxx:3777
virtual void StartRun(const SwRedlineData *pRedlineData, sal_Int32 nPos, bool bSingleEmptyRun=false)=0
Start of the text run.
virtual void FormatFrameSize(const SwFormatFrameSize &)=0
Sfx item RES_FRM_SIZE.
virtual MSWordExportBase & GetExport()=0
Return the right export class.
virtual void ParaLineSpacing_Impl(short nSpace, short nMulti)=0
Count the values in ParaLineSpacing, and pass theme here.
void ParaLineSpacing(const SvxLineSpacingItem &)
Sfx item RES_PARATR_LINESPACING.
Definition: ww8atr.cxx:5020
virtual void FormatVertOrientation(const SwFormatVertOrient &)=0
Sfx item RES_VERT_ORIENT.
virtual void FormatLRSpace(const SvxLRSpaceItem &)=0
Sfx item RES_LR_SPACE.
virtual void CharTwoLines(const SvxTwoLinesItem &)=0
Sfx item RES_CHRATR_TWO_LINES.
virtual void CharPosture(const SvxPostureItem &)=0
Sfx item RES_CHRATR_POSTURE.
void OutputItem(const SfxPoolItem &rHt)
Call the right virtual function according to the type of the item.
Definition: ww8atr.cxx:5518
static void GetNumberPara(OUString &rStr, const SwField &rField)
Definition: ww8atr.cxx:2741
sal_uInt32 GridCharacterPitch(const SwTextGridItem &rGrid) const
Compute the grid character pitch.
Definition: ww8atr.cxx:4160
virtual void CharPostureCTL(const SvxPostureItem &)=0
Sfx item RES_CHRATR_CTL_POSTURE.
virtual void CharGrabBag(const SfxGrabBagItem &)=0
Sfx item RES_CHRATR_GRABBAG.
virtual void CharCrossedOut(const SvxCrossedOutItem &)=0
Sfx item RES_CHRATR_CROSSEDOUT.
virtual void FormatBox(const SvxBoxItem &)=0
Sfx item RES_BOX.
void StartTOX(const SwSection &rSect)
Definition: ww8atr.cxx:2326
virtual void CharAutoKern(const SvxAutoKernItem &)=0
Sfx item RES_CHRATR_AUTOKERN.
virtual void FormatULSpace(const SvxULSpaceItem &)=0
Sfx item RES_UL_SPACE.
virtual void PostitField(const SwField *pField)=0
void TextFootnote(const SwFormatFootnote &)
Sfx item RES_TXTATR_FTN.
Definition: ww8atr.cxx:3677
virtual void ParaNumRule_Impl(const SwTextNode *pTextNd, sal_Int32 nLvl, sal_Int32 nNumId)=0
Numbering - the implementation.
void FormatColumns(const SwFormatCol &)
Sfx item RES_COL.
Definition: ww8atr.cxx:4920
virtual void CharHidden(const SvxCharHiddenItem &)=0
Sfx item RES_CHRATR_HIDDEN.
virtual void HiddenField(const SwField &rField)=0
virtual void OutputFlyFrame_Impl(const ww8::Frame &rFormat, const Point &rNdTopLeft)=0
Output frames - the implementation.
virtual void ParaGrabBag(const SfxGrabBagItem &)=0
Sfx item RES_PARATR_GRABBAG.
virtual void CharContour(const SvxContourItem &)=0
Sfx item Sfx item RES_CHRATR_CONTOUR.
virtual void CharFontCJK(const SvxFontItem &)=0
Sfx item RES_CHRATR_CJK_FONT.
virtual void CharLanguageCJK(const SvxLanguageItem &)=0
Sfx item RES_CHRATR_CJK_LANGUAGE.
virtual void CharScaleWidth(const SvxCharScaleWidthItem &)=0
Sfx item RES_CHRATR_SCALEW.
virtual void CharFont(const SvxFontItem &)=0
Sfx item RES_CHRATR_FONT.
virtual void ParaSnapToGrid(const SvxParaGridItem &)=0
Sfx item RES_PARATR_SNAPTOGRID.
virtual void CharEmphasisMark(const SvxEmphasisMarkItem &)=0
Sfx item RES_CHRATR_EMPHASIS_MARK.
virtual void FormatRightMargin(const SvxRightMarginItem &rRightMargin)=0
Sfx item RES_MARGIN_RIGHT.
virtual void CharEscapement(const SvxEscapementItem &)=0
Sfx item RES_CHRATR_ESCAPEMENT.
virtual void CharLanguageCTL(const SvxLanguageItem &)=0
Sfx item RES_CHRATR_CTL_LANGUAGE.
virtual void TextFootnote_Impl(const SwFormatFootnote &)=0
Sfx item RES_TXTATR_FTN.
virtual void SectionBreak(sal_uInt8 nC, bool bBreakAfter, const WW8_SepInfo *pSectionInfo=nullptr, bool bExtraPageBreak=false)=0
Write a section break msword::ColumnBreak or msword::PageBreak bBreakAfter: the break must be schedul...
virtual void OutlineNumbering(sal_uInt8 nLvl)=0
Numbering rule and Id.
virtual void FormatLineNumbering(const SwFormatLineNumber &)=0
Sfx item RES_LINENUMBER.
const SwRedlineData * GetParagraphMarkerRedline(const SwTextNode &rNode, RedlineType aRedlineType)
Definition: ww8atr.cxx:5870
virtual void SectionRtlGutter(const SfxBoolItem &rRtlGutter)=0
RES_RTL_GUTTER.
sal_uInt16 GetValue() const
const OUString & GetValue() const
bool IsDark() const
bool IsTransparent() const
virtual SwFieldType * GetSysFieldType(const SwFieldIds eWhich) const =0
virtual const SwFieldTypes * GetFieldTypes() const =0
virtual SwList * getListByName(const OUString &rListId) const =0
virtual const SwRedlineTable & GetRedlineTable() const =0
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
virtual SwCharFormat * GetCharFormatFromPool(sal_uInt16 nId)=0
bool m_bExportModeRTF
Definition: wrtww8.hxx:571
bool m_bBreakBefore
Definition: wrtww8.hxx:552
bool m_bEndAtTextEnd
Definition: wrtww8.hxx:564
Point * m_pFlyOffset
Definition: wrtww8.hxx:523
void OutputItemSet(const SfxItemSet &rSet, bool bPapFormat, bool bChpFormat, sal_uInt16 nScript, bool bExportParentItemSet)
Use OutputItem() on an item set according to the parameters.
Definition: ww8atr.cxx:314
RndStdIds m_eNewAnchorType
Definition: wrtww8.hxx:524
sal_uInt8 m_nTextTyp
Definition: wrtww8.hxx:549
const SfxItemSet * GetCurItemSet() const
Getter for pISet.
Definition: wrtww8.hxx:731
std::unique_ptr< WW8_WrPlcField > m_pFieldAtn
Definition: wrtww8.hxx:530
bool OutputFollowPageDesc(const SfxItemSet *pSet, const SwTextNode *pNd)
The return value indicates, if a follow page desc is written.
Definition: ww8atr.cxx:677
static void CorrectTabStopInSet(SfxItemSet &rSet, sal_Int32 nAbsLeft)
Definition: ww8atr.cxx:753
virtual bool CollapseScriptsforWordOk(sal_uInt16 nScript, sal_uInt16 nWhich)=0
Guess the script (asian/western).
bool m_bInWriteEscher
Definition: wrtww8.hxx:560
bool HasRefToFootOrEndnote(const bool isEndNote, const sal_uInt16 nSeqNo)
Definition: ww8atr.cxx:1032
bool m_bFootnoteAtTextEnd
Definition: wrtww8.hxx:563
bool IsInTable() const
Return whether currently exported node is in table.
Definition: wrtww8.cxx:3074
const sw::BroadcastingModify * m_pOutFormatNode
Definition: wrtww8.hxx:539
std::unique_ptr< WW8_WrPct > m_pPiece
Definition: wrtww8.hxx:459
sal_uInt16 DuplicateNumRule(const SwNumRule *pRule, sal_uInt8 nLevel, sal_uInt16 nVal)
In case of numbering restart.
Definition: wrtw8num.cxx:57
void AddListLevelOverride(sal_uInt16 nListId, sal_uInt16 nLevelNum, sal_uInt16 nStartAt)
Store list level overrides (restart of list)
Definition: wrtw8num.cxx:115
std::vector< const SwTOXType * > m_aTOXArr
Definition: wrtww8.hxx:456
sal_uInt16 OverrideNumRule(SwNumRule const &rExistingRule, OUString const &rListId, SwNumRule const &rAbstractRule)
Create a overriding numbering definition (if it does not yet exist)
Definition: wrtw8num.cxx:93
bool GetNumberFormat(const SwField &rField, OUString &rStr)
Definition: ww8atr.cxx:2709
std::vector< SwNodeOffset > m_aChapterFieldLocs
Definition: wrtww8.hxx:454
std::unique_ptr< WW8_WrPlcField > m_pFieldTextBxs
Definition: wrtww8.hxx:531
std::unique_ptr< MSWordStyles > m_pStyles
Definition: wrtww8.hxx:503
const NfKeywordTable & GetNfKeywordTable()
Definition: wrtww8.cxx:4537
virtual bool PreferPageBreakBefore() const =0
If saving page break is preferred as a paragraph attribute (yes) or as a special character (no).
bool FormatHdFtContainsChapterField(const SwFrameFormat &rFormat) const
Definition: ww8atr.cxx:433
const SfxPoolItem * HasItem(sal_uInt16 nWhich) const
Definition: wrtww8.cxx:762
bool ContentContainsChapterField(const SwFormatContent &rContent) const
Definition: ww8atr.cxx:417
bool m_bInWriteTOX
Definition: wrtww8.hxx:562
virtual MSWordSections & Sections() const =0
Access to the sections/headers/footres.
const SfxPoolItem & GetItem(sal_uInt16 nWhich) const
Definition: wrtww8.cxx:784
bool SetCurrentPageDescFromNode(const SwNode &rNd)
Definition: ww8atr.cxx:448
const SwAttrSet * m_pStyAttr
Definition: wrtww8.hxx:538
virtual void OutputField(const SwField *pField, ww::eField eFieldType, const OUString &rFieldCmd, FieldFlags nMode=FieldFlags::All)=0
Write the field.
std::unique_ptr< WW8_WrPlcField > m_pFieldMain
Definition: wrtww8.hxx:526
std::unique_ptr< WW8_WrPlcField > m_pFieldEdn
Definition: wrtww8.hxx:529
virtual bool DisallowInheritingOutlineNumbering(const SwFormat &rFormat)=0
Return value indicates if an inherited outline numbering is suppressed.
static sal_uLong GetSectionLineNo(const SfxItemSet *pSet, const SwNode &rNd)
Line number of the section start.
Definition: ww8atr.cxx:705
const SwTextNode * GetHdFtPageRoot() const
Top node of host page when in header/footer.
Definition: wrtww8.hxx:786
void OutputSectionBreaks(const SfxItemSet *pSet, const SwNode &rNd, bool isCellOpen=false)
Start new section.
Definition: ww8atr.cxx:488
void GatherChapterFields()
Setup the chapter fields (maChapterFieldLocs).
Definition: ww8atr.cxx:410
bool m_bOutFirstPage
Definition: wrtww8.hxx:556
virtual void AppendBookmark(const OUString &rName)=0
const SwPageDesc * m_pCurrentPageDesc
Definition: wrtww8.hxx:497
std::unique_ptr< WW8_WrPlcField > m_pFieldHdFt
Definition: wrtww8.hxx:527
virtual void DoFormText(const SwInputField *pField)=0
sal_uInt16 GetNumberingId(const SwNumRule &rNumRule)
Return the numeric id of the numbering rule.
Definition: wrtw8num.cxx:122
const SfxItemSet * m_pISet
Definition: wrtww8.hxx:457
const SwFormat * m_pCurrentStyle
Definition: wrtww8.hxx:540
const ww8::Frame * m_pParentFrame
Definition: wrtww8.hxx:520
void OutputFormat(const SwFormat &rFormat, bool bPapFormat, bool bChpFormat, bool bFlyFormat=false)
Output attributes.
Definition: ww8atr.cxx:887
static OUString GetBookmarkName(sal_uInt16 nTyp, const OUString *pName, sal_uInt16 nSeqNo)
Find the bookmark name.
Definition: ww8atr.cxx:1041
SvxFrameDirection GetDefaultFrameDirection() const
Definition: wrtw8nds.cxx:1631
bool m_bOutPageDescs
PageDescs (section properties) are being written.
Definition: wrtww8.hxx:555
bool HasRefToAttr(const OUString &rName)
Find the reference.
Definition: ww8atr.cxx:1023
std::unique_ptr< WW8_WrPlcField > m_pFieldHFTextBxs
Definition: wrtww8.hxx:532
virtual AttributeOutputBase & AttrOutput() const =0
Access to the attribute output class.
std::shared_ptr< SwUnoCursor > & m_pCurPam
Definition: wrtww8.hxx:578
tools::Long GetParaTabStopOffset() const
Definition: ww8atr.cxx:778
sal_uInt16 DuplicateAbsNum(OUString const &rListId, SwNumRule const &rAbstractRule)
check if a new abstractNum is needed for this list
Definition: wrtw8num.cxx:70
virtual void PrepareNewPageDesc(const SfxItemSet *pSet, const SwNode &rNd, const SwFormatPageDesc *pNewPgDescFormat, const SwPageDesc *pNewPgDesc, bool bExtraPageBreak=false)=0
std::unique_ptr< WW8_WrPlcField > m_pFieldFootnote
Definition: wrtww8.hxx:528
static const SwSectionFormat * GetSectionFormat(const SwNode &rNd)
Format of the section.
Definition: ww8atr.cxx:692
void ExportPoolItemsToCHP(ww8::PoolItems &rItems, sal_uInt16 nScript, const SvxFontItem *pFont, bool bWriteCombChars=false)
Export the pool items to attributes (through an attribute output class).
Definition: ww8atr.cxx:211
std::unique_ptr< WW8_WrPlcPn > m_pPapPlc
Definition: wrtww8.hxx:500
std::unique_ptr< WW8_WrPlcPn > m_pChpPlc
Definition: wrtww8.hxx:501
bool m_bOutFlyFrameAttrs
Definition: wrtww8.hxx:554
SwDoc & m_rDoc
Definition: wrtww8.hxx:576
sal_uInt16 GetId(const SwTextFormatColl &rColl) const
Return the numeric id of the style.
Definition: wrtw8sty.cxx:177
std::unique_ptr< WW8_WrPlcAnnotations > m_pAtn
Definition: wrtww8.hxx:504
bool m_bHideTabLeaderAndPageNumbers
Definition: wrtww8.hxx:570
static const SwFormatCol & GetFormatCol(const SwDoc &rDoc, const WW8_SepInfo &rInfo)
Number of columns of the provided WW8_SepInfo.
Definition: wrtw8sty.cxx:1120
Class to collect and output the styles table.
Definition: wrtww8.hxx:1583
const SwFormat * GetSwFormat(sal_uInt16 nSlot) const
Definition: wrtww8.hxx:1646
static LanguageType getSystemLanguage()
constexpr tools::Long Y() const
constexpr tools::Long X() const
bool GetValue() const
virtual sal_uInt16 GetEnumValue() const override
const std::map< OUString, css::uno::Any > & GetGrabBag() const
sal_Int16 GetValue() const
const SfxPoolItem * GetCurItem() const
const SfxPoolItem * NextItem()
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
const WhichRangesContainer & GetRanges() const
SfxItemPool * GetPool() const
sal_uInt16 Count() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxItemSet * GetParent() const
bool HasItem(sal_uInt16 nWhich, const SfxPoolItem **ppItem=nullptr) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
T & StaticWhichCast(TypedWhichId< T > nId)
T * DynamicWhichCast(TypedWhichId< T > nId)
sal_uInt16 Which() const
sal_uInt16 FirstWhich()
SfxItemState GetItemState(bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
sal_uInt16 NextWhich()
const SvNumberformat * GetEntry(sal_uInt32 nKey) const
const css::uno::Reference< css::uno::XComponentContext > & GetComponentContext() const
LanguageType GetLanguage() const
OUString GetMappedFormatstring(const NfKeywordTable &rKeywords, const LocaleDataWrapper &rLoc, LanguageType nOriginalLang=LANGUAGE_DONTKNOW, bool bSystemLanguage=false) const
sal_uInt64 Tell() const
std::size_t WriteBytes(const void *pData, std::size_t nSize)
SvStream & WriteUInt32(sal_uInt32 nUInt32)
sal_uInt64 Seek(sal_uInt64 nPos)
sal_uInt64 SeekRel(sal_Int64 nPos)
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
bool IsCharBackground2Shading() const
static SvtFilterOptions & Get()
SvxAdjust GetLastBlock() const
SvxAdjust GetAdjust() const
static const sal_Int16 Hairline
const editeng::SvxBorderLine * GetTop() const
const editeng::SvxBorderLine * GetLine(SvxBoxItemLine nLine) const
const editeng::SvxBorderLine * GetRight() const
const editeng::SvxBorderLine * GetLeft() const
sal_Int16 GetDistance(SvxBoxItemLine nLine, bool bAllowNegative=false) const
void SetDistance(sal_Int16 nNew, SvxBoxItemLine nLine)
const editeng::SvxBorderLine * GetBottom() const
const Color & GetColor() const
bool IsFitToLine() const
const Color & GetValue() const
FontStrikeout GetStrikeout() const
FontEmphasisMark GetEmphasisMark() const
sal_uInt8 & GetProportionalHeight()
void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp=100)
short GetTextFirstLineOffset() const
sal_uInt32 GetHeight() const
void SetHeight(sal_uInt32 nNewHeight, const sal_uInt16 nNewProp=100, MapUnit eUnit=MapUnit::MapRelative)
SvxBreak GetBreak() const
bool IsHyphen() const
short GetTextFirstLineOffset() const
tools::Long GetRight() const
tools::Long GetGutterMargin() const
tools::Long GetTextLeft() const
tools::Long GetLeft() const
LanguageType GetLanguage() const
sal_uInt16 GetPropLineSpace() const
SvxInterLineSpaceRule GetInterLineSpaceRule() const
SvxLineSpaceRule GetLineSpaceRule() const
sal_uInt16 GetLineHeight() const
short GetInterLineSpace() const
sal_Int32 GetAbsLSpace() const
SvxNumPositionAndSpaceMode GetPositionAndSpaceMode() const
static tools::Long GetSloppyPaperDimension(tools::Long nSize)
Align GetValue() const
FontItalic GetPosture() const
tools::Long GetRight() const
sal_uInt16 GetWidth() const
SvxShadowLocation GetLocation() const
tools::Long GetHeight() const
tools::Long GetWidth() const
sal_uInt16 Count() const
void Remove(const sal_uInt16 nPos, const sal_uInt16 nLen=1)
bool Insert(const SvxTabStop &rTab)
sal_Unicode & GetFill()
sal_Int32 & GetTabPos()
sal_Unicode & GetDecimal()
SvxTabAdjust & GetAdjustment()
void SetTextLeft(const tools::Long nL, const sal_uInt16 nProp=100)
tools::Long GetTextLeft() const
FontLineStyle GetLineStyle() const
const Color & GetColor() const
Degree10 GetValue() const
sal_Unicode GetStartBracket() const
bool GetValue() const
sal_Unicode GetEndBracket() const
sal_uInt16 GetUpper() const
sal_uInt16 GetLower() const
bool GetContext() const
FontWeight GetWeight() const
Represents an inserted bibliography entry, created using Insert -> Table of Contents and Index -> Bib...
Definition: authfld.hxx:161
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() const
Definition: breakit.hxx:63
void ChangeExpansion(const SwFrame &, const SwContentNode *, bool bSrchNum=false)
Definition: chpfld.cxx:133
sal_uInt8 GetLevel(SwRootFrame const *pLayout=nullptr) const
Definition: chpfld.cxx:79
Represents the style of a text portion.
Definition: charfmt.hxx:27
const SwModify * GetRegisteredIn() const
Definition: calbck.hxx:166
const OUString & GetColumnName() const
Definition: dbfld.hxx:47
const OUString & GetName() const
Definition: docufld.hxx:548
Definition: doc.hxx:197
@ DOCTYPE_MSWORD
Definition: doc.hxx:407
SwDBData const & GetDBData()
Definition: docfld.cxx:386
const SwFootnoteInfo & GetFootnoteInfo() const
Definition: doc.hxx:645
SwNumRule * FindNumRulePtr(const OUString &rName) const
Definition: docnum.cxx:2454
SwNumRule * GetOutlineNumRule() const
Definition: doc.hxx:1039
SwCharFormat * FindCharFormatByName(const OUString &rName) const
Definition: doc.hxx:786
SwNodes & GetNodes()
Definition: doc.hxx:422
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:371
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:349
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:190
const SwTextFormatColls * GetTextFormatColls() const
Definition: doc.hxx:793
const SwEndNoteInfo & GetEndNoteInfo() const
Definition: doc.hxx:647
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:440
SwTextFormatColl * FindTextFormatCollByName(const OUString &rName) const
Definition: doc.hxx:814
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1337
DocumentType GetDocumentType() const
Definition: doc.hxx:410
SvNumberFormatter * GetNumberFormatter(bool bCreate=true)
Definition: doc.hxx:1429
const SwPageDesc & GetPageDesc(const size_t i) const
Definition: doc.hxx:896
SvxFrameDirection GetTextDirection(const SwPosition &rPos, const Point *pPt=nullptr) const
Definition: doclay.cxx:1641
IDocumentListsAccess const & getIDocumentListsAccess() const
Definition: doc.cxx:307
Dropdown field.
Definition: flddropdown.hxx:59
const OUString & GetHelp() const
Returns the help text of the field.
css::uno::Sequence< OUString > GetItemSequence() const
Returns the items of the dropdown box.
const OUString & GetName() const
Returns the name of the field.
const OUString & GetToolTip() const
Returns the tool tip of the field.
const OUString & GetSelectedItem() const
Returns the selected item.
SwCharFormat * GetCharFormat(SwDoc &rDoc) const
Definition: docftn.cxx:140
SwCharFormat * GetAnchorCharFormat(SwDoc &rDoc) const
Definition: docftn.cxx:182
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:247
virtual OUString GetName() const
Only in derived classes.
Definition: fldbas.cxx:139
void GatherRefFields(std::vector< SwGetRefField * > &rvRFields, const sal_uInt16 nTyp)
Definition: fldbas.cxx:200
SwFieldIds Which() const
Definition: fldbas.hxx:276
void GatherNodeIndex(std::vector< SwNodeOffset > &rvNodeIndex)
Definition: fldbas.cxx:195
Base class of all fields.
Definition: fldbas.hxx:296
virtual OUString GetPar1() const
Definition: fldbas.cxx:334
virtual sal_uInt16 GetSubType() const
Definition: fldbas.cxx:355
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
Definition: fldbas.hxx:407
OUString ExpandField(bool bCached, SwRootFrame const *pLayout) const
expand the field.
Definition: fldbas.cxx:491
virtual OUString GetFieldName() const
get name or content
Definition: fldbas.cxx:318
SwFieldType * GetTyp() const
Definition: fldbas.hxx:402
LanguageType GetLanguage() const
Language at field position.
Definition: fldbas.hxx:412
virtual OUString GetPar2() const
Definition: fldbas.cxx:339
SwFootnotePos m_ePos
Definition: ftninfo.hxx:97
Definition: tox.hxx:314
const SwFormTokens & GetPattern(sal_uInt16 nLevel) const
Definition: tox.cxx:954
FlyAnchors.
Definition: fmtanchr.hxx:37
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:67
void SetType(RndStdIds nRndId)
Definition: fmtanchr.hxx:68
SwCharFormat * GetCharFormat() const
Definition: fchrfmt.hxx:70
sal_uInt16 GetGutterWidth(bool bMin=false) const
Definition: atrfrm.cxx:918
sal_uInt16 CalcPrtColWidth(sal_uInt16 nCol, sal_uInt16 nAct) const
As above except that it.
Definition: atrfrm.cxx:1005
bool IsOrtho() const
Definition: fmtclds.hxx:121
sal_Int16 GetAdjustValue() const
Definition: fmtclds.hxx:95
const Color & GetLineColor() const
Definition: fmtclds.hxx:118
const SwColumns & GetColumns() const
Definition: fmtclds.hxx:112
sal_uInt8 GetLineHeight() const
Definition: fmtclds.hxx:123
SvxBorderLineStyle GetLineStyle() const
Definition: fmtclds.hxx:116
sal_uLong GetLineWidth() const
Definition: fmtclds.hxx:117
sal_uInt16 GetNumCols() const
Definition: fmtclds.hxx:114
SwColLineAdj GetLineAdj() const
Definition: fmtclds.hxx:120
Content, content of frame (header, footer, fly).
Definition: fmtcntnt.hxx:32
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
const SwField * GetField() const
Definition: fmtfld.hxx:131
const SwTextField * GetTextField() const
Definition: fmtfld.hxx:149
Format of a fly content.
Definition: fmtflcnt.hxx:33
SwFrameFormat * GetFrameFormat() const
Definition: fmtflcnt.hxx:45
Footer, for pageformats Client of FrameFormat describing the footer.
Definition: fmthdft.hxx:65
const SwFrameFormat * GetFooterFormat() const
Definition: fmthdft.hxx:85
SfxPoolItem subclass that is a wrapper around an SwFootnoteEndPosEnum, i.e.
Definition: fmtftntx.hxx:43
SfxPoolItem subclass for footnotes and endnotes, stored in the anchor text node.
Definition: fmtftn.hxx:47
const OUString & GetNumStr() const
Definition: fmtftn.hxx:72
bool IsEndNote() const
Definition: fmtftn.hxx:75
const SwTextFootnote * GetTextFootnote() const
Definition: fmtftn.hxx:87
SwFrameSize GetWidthSizeType() const
Definition: fmtfsize.hxx:83
SwFrameSize GetHeightSizeType() const
Definition: fmtfsize.hxx:80
Header, for PageFormats Client of FrameFormat describing the header.
Definition: fmthdft.hxx:34
const SwFrameFormat * GetHeaderFormat() const
Definition: fmthdft.hxx:54
Defines the horizontal position of a fly frame.
Definition: fmtornt.hxx:73
sal_Int16 GetHoriOrient() const
Definition: fmtornt.hxx:94
SwTwips GetPos() const
Definition: fmtornt.hxx:99
bool IsPosToggle() const
Definition: fmtornt.hxx:102
const OUString & GetValue() const
Definition: fmtinfmt.hxx:75
sal_uInt16 GetINetFormatId() const
Definition: fmtinfmt.hxx:107
const OUString & GetINetFormat() const
Definition: fmtinfmt.hxx:102
SfxPoolItem subclass that wraps an SwLineBreakClear.
Contains the line numbering properties of this paragraph.
Definition: fmtline.hxx:33
bool IsCount() const
Definition: fmtline.hxx:60
sal_uLong GetStartValue() const
Definition: fmtline.hxx:59
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
Definition: fmtpdsc.hxx:36
bool KnowsPageDesc() const
Definition: atrfrm.cxx:661
SwPageDesc * GetPageDesc()
Definition: fmtpdsc.hxx:61
const ::std::optional< sal_uInt16 > & GetNumOffset() const
Definition: fmtpdsc.hxx:64
css::text::WrapTextMode GetSurround() const
Definition: fmtsrnd.hxx:51
Defines the vertical position of a fly frame.
Definition: fmtornt.hxx:37
SwTwips GetPos() const
Definition: fmtornt.hxx:62
sal_Int16 GetVertOrient() const
Definition: fmtornt.hxx:57
Base class for various Writer styles.
Definition: format.hxx:47
const SvxFrameDirectionItem & GetFrameDir(bool=true) const
Definition: frmatr.hxx:118
sal_uInt16 GetPoolFormatId() const
Get and set Pool style IDs.
Definition: format.hxx:163
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:104
const SvxLRSpaceItem & GetLRSpace(bool=true) const
Definition: frmatr.hxx:98
const SwFormatFooter & GetFooter(bool=true) const
Definition: fmthdft.hxx:99
sal_uInt16 Which() const
for Querying of Writer-functions.
Definition: format.hxx:82
const OUString & GetName() const
Definition: format.hxx:131
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
Definition: format.cxx:385
const SwFormatHeader & GetHeader(bool=true) const
Definition: fmthdft.hxx:97
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:88
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:136
SwFormat * DerivedFrom() const
Definition: format.hxx:128
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
const SvxULSpaceItem & GetULSpace(bool=true) const
Definition: frmatr.hxx:100
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
virtual OUString GetFormula() const override
Definition: fldbas.cxx:820
Style of a layout element.
Definition: frmfmt.hxx:72
static sal_Int32 GetReferenceTextPos(const SwFormatField &rFormat, SwDoc &rDoc, sal_Int32 nHint=0)
Find the index of the reference text following the current field.
Definition: expfld.cxx:965
const OUString & GetSetRefName() const
Definition: reffld.hxx:109
sal_uInt16 GetSeqNo() const
Get/set SequenceNo (of interest only for REF_SEQUENCEFLD).
Definition: reffld.hxx:134
bool isFormField() const
Definition: expfld.cxx:1325
TElementType * Next()
Definition: calbck.hxx:380
TElementType * First()
Definition: calbck.hxx:372
Definition: list.hxx:40
const OUString & GetDefaultListStyleName() const
Definition: list.hxx:49
Marks a node in the document model.
Definition: ndindex.hxx:31
SwNode & GetNode() const
Definition: ndindex.hxx:123
SwNodeOffset GetIndex() const
Definition: ndindex.hxx:111
Base class of the Writer document model elements.
Definition: node.hxx:98
SwNodeOffset GetIndex() const
Definition: node.hxx:312
SwTableBox * GetTableBox() const
If node is in a table return the respective table box.
Definition: node.cxx:772
const SwPageDesc * FindPageDesc(SwNodeOffset *pPgDescNdIdx=nullptr) const
Search PageDesc with which this node is formatted.
Definition: node.cxx:496
SwTableNode * FindTableNode()
Search table node, in which it is.
Definition: node.cxx:380
SwSectionNode * FindSectionNode()
Search section node, in which it is.
Definition: ndsect.cxx:968
const SwStartNode * StartOfSectionNode() const
Definition: node.hxx:153
SwContentNode * GetContentNode()
Definition: node.hxx:666
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
Definition: ndarr.hxx:165
SwContentNode * GoNext(SwNodeIndex *) const
Definition: nodes.cxx:1299
const OUString & GetDefaultListId() const
Definition: numrule.hxx:194
const SwNumFormat & Get(sal_uInt16 i) const
Definition: number.cxx:87
const OUString & GetName() const
Definition: pagedesc.hxx:196
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:238
SwFrameFormat & GetFirstMaster()
Definition: pagedesc.hxx:240
bool GetLandscape() const
Definition: pagedesc.hxx:199
const SwPageDesc * GetFollow() const
Definition: pagedesc.hxx:267
static const SwPageDesc * GetPageDescOfNode(const SwNode &rNd)
Given a SwNode return the pagedesc in use at that location.
Definition: pagedesc.cxx:332
const OUString & GetComment() const
Definition: redline.hxx:129
A section node represents the start of a section on the UI, i.e.
Definition: node.hxx:575
const SwSection & GetSection() const
Definition: node.hxx:590
const SwTOXBase * GetTOXBase() const
Definition: section.cxx:591
SwSection * GetParent() const
Definition: section.hxx:351
SwSectionFormat * GetFormat()
Definition: section.hxx:341
SectionType GetType() const
Definition: section.hxx:173
virtual OUString GetPar1() const override
Query name only.
Definition: expfld.cxx:1017
const OUString & GetPromptText() const
Definition: expfld.hxx:263
virtual OUString GetPar2() const override
Query formula.
Definition: expfld.cxx:1022
bool GetInputFlag() const
Definition: expfld.hxx:269
TOXTypes GetType() const
Definition: tox.hxx:722
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:443
SwTableLine * GetUpper()
Definition: swtable.hxx:477
const SwStartNode * GetSttNd() const
Definition: swtable.hxx:495
SwTableLine is one table row in the document model.
Definition: swtable.hxx:376
sal_uInt16 GetBoxPos(const SwTableBox *pBox) const
Definition: swtable.hxx:388
SwTableBox * GetUpper()
Definition: swtable.hxx:394
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
Definition: txatbase.hxx:44
const SfxPoolItem & GetAttr() const
Definition: txatbase.hxx:167
sal_Int32 GetStart() const
Definition: txatbase.hxx:88
const SwFormatField & GetFormatField() const
Definition: txatbase.hxx:199
SwTextAttr subclass for footnotes and endnotes.
Definition: txtftn.hxx:34
const SwTextNode & GetTextNode() const
Definition: txtftn.hxx:72
sal_uInt16 GetSeqRefNo() const
Definition: txtftn.hxx:66
Represents the style of a paragraph.
Definition: fmtcol.hxx:61
bool IsAssignedToListLevelOfOutlineStyle() const
Definition: fmtcol.hxx:122
int GetAssignedOutlineStyleLevel() const
Definition: fmtcol.cxx:678
sal_uInt16 GetBaseHeight() const
Definition: tgrditem.hxx:75
sal_uInt16 GetBaseWidth() const
Definition: tgrditem.hxx:97
bool IsSquaredMode() const
Definition: tgrditem.hxx:104
sal_uInt16 GetRubyHeight() const
Definition: tgrditem.hxx:78
SwTextGrid GetGridType() const
Definition: tgrditem.hxx:81
bool IsSnapToChars() const
Definition: tgrditem.hxx:100
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:112
SwNumberTree::tSwNumTreeNumber GetActualListStartValue() const
Definition: ndtxt.cxx:4342
bool GetParaAttr(SfxItemSet &rSet, sal_Int32 nStt, sal_Int32 nEnd, const bool bOnlyTextAttr=false, const bool bGetFromChrFormat=true, const bool bMergeIndentValuesOfNumRule=false, SwRootFrame const *pLayout=nullptr) const
Query the attributes of textnode over the range.
Definition: thints.cxx:2140
OUString GetListId() const
Definition: ndtxt.cxx:4580
bool IsCountedInList() const
Definition: ndtxt.cxx:4393
int GetActualListLevel(SwListRedlineType eRedline=SwListRedlineType::SHOW) const
Returns the actual list level of this text node, when it is a list item.
Definition: ndtxt.cxx:4248
bool IsListRestart() const
Definition: ndtxt.cxx:4273
SwpHints * GetpSwpHints()
Definition: ndtxt.hxx:252
const OUString & GetText() const
Definition: ndtxt.hxx:244
size_t size() const
Definition: docary.hxx:88
void NextPos()
Definition: wrtww8.hxx:1554
sal_Int32 WhereNext() const
Definition: wrtww8.hxx:1565
void SplitRun(sal_Int32 nSplitEndPos)
Definition: wrtw8nds.cxx:1255
static void InsUInt32(ww::bytes &rO, sal_uInt32 n)
Definition: wrtww8.cxx:1719
static void InsUInt16(ww::bytes &rO, sal_uInt16 n)
Definition: wrtww8.cxx:1711
static void WriteLong(SvStream &rStrm, sal_Int32 nVal)
Definition: wrtww8.hxx:972
static void WriteString16(SvStream &rStrm, const OUString &rStr, bool bAddZero)
Definition: wrtww8.cxx:1746
An SwTextAttr container, stores all directly formatted text portions for a text node.
Definition: ndhints.hxx:68
SwTextAttr * Get(size_t nPos) const
Definition: ndhints.hxx:144
size_t Count() const
Definition: ndhints.hxx:142
std::multimap< sal_Int32, OUString > m_aBookmarksOfParagraphEnd
virtual void FormatLRSpace(const SvxLRSpaceItem &) override
Sfx item RES_LR_SPACE.
Definition: ww8atr.cxx:4275
virtual void ParaSplit(const SvxFormatSplitItem &) override
Sfx item RES_PARATR_SPLIT.
Definition: ww8atr.cxx:5197
virtual void FormatBackground(const SvxBrushItem &) override
Sfx item RES_BACKGROUND.
Definition: ww8atr.cxx:4539
virtual void StartRun(const SwRedlineData *pRedlineData, sal_Int32 nPos, bool bSingleEmptyRun=false) override
Start of the text run.
Definition: ww8atr.cxx:1129
virtual void CharRotate(const SvxCharRotateItem &) override
Sfx item RES_CHRATR_ROTATE.
Definition: ww8atr.cxx:1628
virtual void FormatLineNumbering(const SwFormatLineNumber &) override
Sfx item RES_LINENUMBER.
Definition: ww8atr.cxx:5001
virtual void CharBidiRTL(const SfxPoolItem &rHt) override
Sfx item RES_CHRATR_BidiRTL.
Definition: ww8atr.cxx:1611
virtual void EndRunProperties(const SwRedlineData *pRedlineData) override
After we end outputting the attributes.
Definition: ww8atr.cxx:1174
virtual void ParaNumRule_Impl(const SwTextNode *pTextNd, sal_Int32 nLvl, sal_Int32 nNumId) override
Sfx item RES_PARATR_NUMRULE.
Definition: ww8atr.cxx:3892
virtual void SectionBreak(sal_uInt8 nC, bool bBreakAfter, const WW8_SepInfo *pSectionInfo=nullptr, bool bExtraPageBreak=false) override
Write a section break msword::ColumnBreak or msword::PageBreak.
Definition: ww8atr.cxx:4155
virtual void ParagraphStyle(sal_uInt16 nStyle) override
Output style.
Definition: ww8atr.cxx:1215
virtual void FormatBox(const SvxBoxItem &) override
Sfx item RES_BOX.
Definition: ww8atr.cxx:4833
virtual void FormatAnchor(const SwFormatAnchor &) override
Sfx item RES_ANCHOR.
Definition: ww8atr.cxx:4508
virtual void FormatULSpace(const SvxULSpaceItem &rHt) override
Sfx item RES_UL_SPACE.
Definition: ww8atr.cxx:4354
virtual void CharWeightCTL(const SvxWeightItem &) override
Sfx item RES_CHRATR_CTL_WEIGHT.
Definition: ww8atr.cxx:1266
virtual void OnTOXEnding() override
Definition: ww8atr.cxx:1156
void OutputWW8AttributeCTL(sal_uInt8 nId, bool bVal)
Output the bold etc. attributes, the Complex Text Layout version.
Definition: ww8atr.cxx:1231
virtual void ParaForbiddenRules(const SfxBoolItem &) override
Sfx item RES_PARATR_FORBIDDEN_RULES.
Definition: ww8atr.cxx:3527
virtual void ParaSnapToGrid(const SvxParaGridItem &) override
Sfx item RES_PARATR_SNAPTOGRID.
Definition: ww8atr.cxx:3533
virtual void CharKerning(const SvxKerningItem &) override
Sfx item RES_CHRATR_KERNING.
Definition: ww8atr.cxx:1297
virtual void FormatPaperBin(const SvxPaperBinItem &) override
Sfx item RES_PAPER_BIN.
Definition: ww8atr.cxx:4225
virtual void TextINetFormat(const SwFormatINetFormat &) override
Sfx item RES_TXTATR_INETFMT.
Definition: ww8atr.cxx:1751
void OutputWW8Attribute(sal_uInt8 nId, bool bVal)
Output the bold etc. attributes.
Definition: ww8atr.cxx:1224
virtual void FormatFillGradient(const XFillGradientItem &) override
Sfx item RES_FILL_GRADIENT.
Definition: ww8atr.cxx:4580
virtual void EndParagraph(ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner) override
End of the paragraph.
Definition: ww8atr.cxx:1095
virtual void CharScaleWidth(const SvxCharScaleWidthItem &) override
Sfx item RES_CHRATR_SCALEW.
Definition: ww8atr.cxx:1580
virtual void CharRelief(const SvxCharReliefItem &) override
Sfx item RES_CHRATR_RELIEF.
Definition: ww8atr.cxx:1586
virtual void RawText(const OUString &rText, rtl_TextEncoding eCharSet) override
Output text (without markup).
Definition: ww8atr.cxx:1200
virtual void CharPostureCTL(const SvxPostureItem &) override
Sfx item RES_CHRATR_CTL_POSTURE.
Definition: ww8atr.cxx:1271
virtual WW8Export & GetExport() override
Return the right export class.
editeng::WordPageMargins m_pageMargins
void TextLineBreak(const SwFormatLineBreak &rLineBreak) override
RES_TXTATR_LINEBREAK, i.e. clearing breaks.
Definition: ww8atr.cxx:4344
virtual void FormatFillStyle(const XFillStyleItem &) override
Sfx item RES_FILL_STYLE.
Definition: ww8atr.cxx:4558
virtual void CharCaseMap(const SvxCaseMapItem &) override
Sfx item Sfx item RES_CHRATR_CASEMAP.
Definition: ww8atr.cxx:1337
virtual void EndRun(const SwTextNode *pNode, sal_Int32 nPos, sal_Int32 nLen, bool bLastRun=false) override
End of the text run.
Definition: ww8atr.cxx:1161
virtual void CharAnimatedText(const SvxBlinkItem &) override
Sfx item RES_CHRATR_BLINK.
Definition: ww8atr.cxx:1311
virtual void FormatVertOrientation(const SwFormatVertOrient &) override
Sfx item RES_VERT_ORIENT.
Definition: ww8atr.cxx:4437
virtual void ParaWidows(const SvxWidowsItem &rHt) override
Sfx item RES_PARATR_WIDOWS.
Definition: ww8atr.cxx:5209
virtual void ParaHangingPunctuation(const SfxBoolItem &) override
Sfx item RES_PARATR_HANGINGPUNCTUATION.
Definition: ww8atr.cxx:3521
virtual void FormatFrameDirection(const SvxFrameDirectionItem &) override
Sfx item RES_FRAMEDIR.
Definition: ww8atr.cxx:5136
virtual void FormatRightMargin(const SvxRightMarginItem &rRightMargin) override
Sfx item RES_MARGIN_RIGHT.
Definition: ww8atr.cxx:4262
virtual void CharPosture(const SvxPostureItem &) override
Sfx item RES_CHRATR_POSTURE.
Definition: ww8atr.cxx:1276
virtual void CharColor(const SvxColorItem &) override
Sfx item Sfx item RES_CHRATR_COLOR.
Definition: ww8atr.cxx:1698
virtual void CharFont(const SvxFontItem &) override
Sfx item RES_CHRATR_FONT.
Definition: ww8atr.cxx:1241
virtual void CharFontCTL(const SvxFontItem &) override
Sfx item RES_CHRATR_CTL_FONT.
Definition: ww8atr.cxx:1252
virtual void RTLAndCJKState(bool bIsRTL, sal_uInt16 nScript) override
Export the state of RTL/CJK.
Definition: ww8atr.cxx:1075
virtual void FormatKeep(const SvxFormatKeepItem &) override
Sfx item RES_KEEP.
Definition: ww8atr.cxx:4992
virtual void ParaGrabBag(const SfxGrabBagItem &) override
Sfx item RES_PARATR_GRABBAG.
Definition: ww8atr.cxx:5179
virtual void FormatHorizOrientation(const SwFormatHoriOrient &) override
Sfx item RES_HORI_ORIENT.
Definition: ww8atr.cxx:4470
virtual void OutputFKP(bool bForce) override
Output FKP (Formatted disK Page) - necessary for binary formats only.
Definition: ww8atr.cxx:1205
virtual void CharHighlight(const SvxBrushItem &) override
Sfx item RES_CHRATR_HIGHLIGHT.
Definition: ww8atr.cxx:1369
virtual void SetField(const SwField &rField, ww::eField eType, const OUString &rCmd) override
Definition: ww8atr.cxx:2820
virtual void RefField(const SwField &rField, const OUString &rRef) override
Definition: ww8atr.cxx:2871
virtual void TableRowEnd(sal_uInt32 nDepth) override
Definition: ww8atr.cxx:4028
virtual bool PlaceholderField(const SwField *pField) override
Definition: ww8atr.cxx:2866
virtual void ParaAdjust(const SvxAdjustItem &rHt) override
Sfx item RES_PARATR_ADJUST.
Definition: ww8atr.cxx:5074
sal_uInt16 m_nFieldResults
For output of run properties.
virtual void FormatTextGrid(const SwTextGridItem &) override
Sfx item RES_TEXTGRID.
Definition: ww8atr.cxx:4190
virtual void PageBreakBefore(bool bBreak) override
Page break As a paragraph property - the paragraph should be on the next page.
Definition: ww8atr.cxx:4051
void SectionRtlGutter(const SfxBoolItem &rRtlGutter) override
RES_RTL_GUTTER.
Definition: ww8atr.cxx:4332
virtual void Redline(const SwRedlineData *pRedline) override
Output redlining.
Definition: wrtw8nds.cxx:3570
virtual void CharWeight(const SvxWeightItem &) override
Sfx item RES_CHRATR_WEIGHT.
Definition: ww8atr.cxx:1281
virtual void CharFontCJK(const SvxFontItem &) override
Sfx item RES_CHRATR_CJK_FONT.
Definition: ww8atr.cxx:1259
virtual void ParaVerticalAlign(const SvxParaVertAlignItem &) override
Sfx item RES_PARATR_VERTALIGN.
Definition: ww8atr.cxx:3541
virtual void FormatSurround(const SwFormatSurround &) override
Sfx item RES_SURROUND.
Definition: ww8atr.cxx:4426
virtual void ParaHyphenZone(const SvxHyphenZoneItem &) override
Sfx item RES_PARATR_HYPHENZONE.
Definition: ww8atr.cxx:3507
virtual void CharUnderline(const SvxUnderlineItem &) override
Sfx item RES_CHRATR_UNDERLINE.
Definition: ww8atr.cxx:1376
virtual void FormatTextLeftMargin(const SvxTextLeftMarginItem &rTextLeftMargin) override
Sfx item RES_MARGIN_TEXTLEFT.
Definition: ww8atr.cxx:4255
virtual void CharBorder(const ::editeng::SvxBorderLine *pAllBorder, const sal_uInt16 nDist, const bool bShadow) override
Sfx item RES_CHRATR_BOX.
Definition: ww8atr.cxx:1364
virtual void CharHidden(const SvxCharHiddenItem &) override
Sfx item RES_CHRATR_HIDDEN.
Definition: ww8atr.cxx:1359
virtual void ParaOutlineLevel(const SfxUInt16Item &) override
Definition: ww8atr.cxx:5187
virtual void HiddenField(const SwField &rField) override
Definition: ww8atr.cxx:2806
virtual void CharTwoLines(const SvxTwoLinesItem &) override
Sfx item RES_CHRATR_TWO_LINES.
Definition: ww8atr.cxx:3734
virtual void ParaLineSpacing_Impl(short nSpace, short nMulti) override
Sfx item RES_PARATR_LINESPACING.
Definition: ww8atr.cxx:5011
virtual void StartRunProperties() override
Before we start outputting the attributes.
Definition: ww8atr.cxx:1123
std::multimap< sal_Int32, OUString > m_aBookmarksOfParagraphStart
Bookmarks of the current paragraph.
virtual void CharEmphasisMark(const SvxEmphasisMarkItem &rHt) override
Sfx item RES_CHRATR_EMPHASIS_MARK.
Definition: ww8atr.cxx:1650
virtual void CharLanguage(const SvxLanguageItem &) override
Sfx item RES_CHRATR_LANGUAGE.
Definition: ww8atr.cxx:1467
virtual bool DropdownField(const SwField *pField) override
Definition: ww8atr.cxx:2854
virtual void CharEscapement(const SvxEscapementItem &) override
Sfx item RES_CHRATR_ESCAPEMENT.
Definition: ww8atr.cxx:1504
virtual void CharBackground(const SvxBrushItem &) override
Sfx item RES_CHRATR_BACKGROUND.
Definition: ww8atr.cxx:1712
WW8Export & m_rWW8Export
Reference to the export, where to get the data from.
virtual void CharShadow(const SvxShadowedItem &) override
Sfx item RES_CHRATR_SHADOWED.
Definition: ww8atr.cxx:1292
virtual void FormatFrameSize(const SwFormatFrameSize &) override
Sfx item RES_FRM_SIZE.
Definition: ww8atr.cxx:3907
virtual void FormatColumns_Impl(sal_uInt16 nCols, const SwFormatCol &rCol, bool bEven, SwTwips nPageSize) override
Sfx item RES_COL.
Definition: ww8atr.cxx:4877
virtual void CharAutoKern(const SvxAutoKernItem &) override
Sfx item RES_CHRATR_AUTOKERN.
Definition: ww8atr.cxx:1304
virtual void CharGrabBag(const SfxGrabBagItem &) override
Sfx item RES_TXTATR_GRABBAG.
Definition: ww8atr.cxx:5183
virtual void CharFontSize(const SvxFontHeightItem &) override
Sfx item RES_CHRATR_FONTSIZE.
Definition: ww8atr.cxx:1558
virtual void RunText(const OUString &rText, rtl_TextEncoding eCharSet=RTL_TEXTENCODING_UTF8, const OUString &rSymbolFont=OUString()) override
Output text.
Definition: ww8atr.cxx:1195
virtual void CharContour(const SvxContourItem &) override
Sfx item Sfx item RES_CHRATR_CONTOUR.
Definition: ww8atr.cxx:1287
virtual void TextFootnote_Impl(const SwFormatFootnote &) override
Sfx item RES_TXTATR_FTN.
Definition: ww8atr.cxx:3709
virtual void PostitField(const SwField *pField) override
Definition: ww8atr.cxx:2847
virtual void FormatFirstLineIndent(const SvxFirstLineIndentItem &rFirstLine) override
Sfx item RES_MARGIN_FIRSTLINE.
Definition: ww8atr.cxx:4248
virtual void TableInfoRow(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo) override
Definition: wrtww8.cxx:2005
virtual void ParaTabStop(const SvxTabStopItem &rHt) override
Sfx item RES_PARATR_TABSTOP.
Definition: ww8atr.cxx:5448
virtual void CharCrossedOut(const SvxCrossedOutItem &rHt) override
Sfx item RES_CHRATR_CROSSEDOUT.
Definition: ww8atr.cxx:1318
virtual void WriteExpand(const SwField *pField) override
Write the expanded field.
Definition: ww8atr.cxx:2884
virtual void TextCharFormat(const SwFormatCharFormat &) override
Sfx item RES_TXTATR_CHARFMT.
Definition: ww8atr.cxx:3721
virtual void CharIdctHint(const SfxPoolItem &rHt) override
Sfx item RES_CHRATR_IdctHint.
Definition: ww8atr.cxx:1621
virtual void OutlineNumbering(sal_uInt8 nLvl) override
Numbering rule and Id.
Definition: ww8atr.cxx:854
virtual void ParaScriptSpace(const SfxBoolItem &) override
Sfx item RES_PARATR_SCRIPTSPACE.
Definition: ww8atr.cxx:3515
Exporter of the binary Word file formats.
Definition: wrtww8.hxx:997
SvStream & Strm() const
Definition: wrtww8.hxx:1189
virtual void OutputField(const SwField *pField, ww::eField eFieldType, const OUString &rFieldCmd, FieldFlags nMode=FieldFlags::All) override
Write the field.
Definition: ww8atr.cxx:1881
void Out_CellRangeBorders(const SvxBoxItem *pBox, sal_uInt8 nStart, sal_uInt8 nLimit)
Definition: ww8atr.cxx:4806
static bool TransBrush(const Color &rCol, WW8_SHD &rShd)
TransBrush converts SW-Brushes to WW.
Definition: ww8atr.cxx:1678
void Out_SwFormatBox(const SvxBoxItem &rBox, bool bShadow)
is for all boxes except in tables.
Definition: ww8atr.cxx:4730
void DoComboBox(css::uno::Reference< css::beans::XPropertySet > const &xPropSet)
std::unique_ptr< WW8AttributeOutput > m_pAttrOutput
Converting attributes to stream data.
Definition: wrtww8.hxx:1013
std::unique_ptr< WW8_WrPlcSepx > m_pSepx
Sections/headers/footers.
Definition: wrtww8.hxx:1007
void OutSprmBytes(sal_uInt8 *pBytes, sal_uInt16 nSiz)
Definition: wrtww8.hxx:1112
void InsUInt16(sal_uInt16 n)
Definition: wrtww8.hxx:1160
static void Out_BorderLine(ww::bytes &rO, const ::editeng::SvxBorderLine *pLine, sal_uInt16 nDist, sal_uInt16 nSprmNo, sal_uInt16 nSprmNoVer9, bool bShadow)
Gets passed a WW8Bytes*, so the function also can be used for the table border.
Definition: ww8atr.cxx:4688
void WritePostItBegin(ww::bytes *pO=nullptr)
Definition: ww8atr.cxx:2781
void WriteChar(sal_Unicode c) override
Definition: wrtww8.cxx:1875
virtual sal_uInt64 ReplaceCr(sal_uInt8 nChar) override
ReplaceCr() is used for Pagebreaks and Pagedescs.
Definition: ww8atr.cxx:3967
void InsUInt32(sal_uInt32 n)
Definition: wrtww8.hxx:1162
virtual bool DisallowInheritingOutlineNumbering(const SwFormat &rFormat) override
Return value indicates if an inherited outline numbering is suppressed.
Definition: ww8atr.cxx:860
WW8_WrPlcField * CurrentFieldPlc() const
Fields.
Definition: ww8atr.cxx:1849
SvStream * m_pDataStrm
Streams for WW97 Export.
Definition: wrtww8.hxx:1001
virtual void AppendBookmark(const OUString &rName) override
Definition: wrtww8.cxx:1498
std::unique_ptr< WW8_WrPlcFootnoteEdn > m_pFootnote
Footnotes - structure to remember them, and output.
Definition: wrtww8.hxx:1005
std::unique_ptr< WW8Dop > m_pDop
Document Properties.
Definition: wrtww8.hxx:1004
static WW8_BRCVer9 TranslateBorderLine(const ::editeng::SvxBorderLine &pLine, sal_uInt16 nDist, bool bShadow)
Definition: ww8atr.cxx:4584
std::unique_ptr< WW8Fib > m_pFib
File Information Block.
Definition: wrtww8.hxx:1003
virtual void PrepareNewPageDesc(const SfxItemSet *pSet, const SwNode &rNd, const SwFormatPageDesc *pNewPgDescFormat, const SwPageDesc *pNewPgDesc, bool bExtraPageBreak=false) override
Helper method for OutputSectionBreaks() and OutputFollowPageDesc().
Definition: ww8atr.cxx:720
SwTwips CurrentPageWidth(SwTwips &rLeft, SwTwips &rRight) const
Definition: ww8atr.cxx:4865
void StartCommentOutput(std::u16string_view rName)
Definition: ww8atr.cxx:2026
void GetCurrentItems(ww::bytes &rItems) const
Definition: wrtw8nds.cxx:883
static sal_uInt8 GetNumId(sal_uInt16 eNumType)
Converts the SVX numbering type to MSONFC.
Definition: ww8atr.cxx:793
static void Out_SwFormatTableBox(ww::bytes &rO, const SvxBoxItem *rBox)
FormatBox2() is for TC structures in tables.
Definition: ww8atr.cxx:4785
WW8_CP Fc2Cp(sal_uLong nFc) const
Definition: wrtww8.hxx:1108
void WriteFootnoteBegin(const SwFormatFootnote &rFootnote, ww::bytes *pO=nullptr)
Definition: ww8atr.cxx:3578
void AppendBookmarkEndWithCorrection(const OUString &rName)
Definition: wrtww8.cxx:1504
std::unique_ptr< ww::bytes > m_pO
Buffer.
Definition: wrtww8.hxx:999
void EndCommentOutput(std::u16string_view rName)
Definition: ww8atr.cxx:2032
std::unique_ptr< WW8_WrPlcFootnoteEdn > m_pEdn
Endnotes - structure to remember them, and output.
Definition: wrtww8.hxx:1006
void OutSwString(const OUString &, sal_Int32 nStt, sal_Int32 nLen)
Definition: wrtww8.cxx:1838
void MoveFieldMarks(WW8_CP nFrom, WW8_CP nTo)
Definition: wrtww8.cxx:1493
virtual bool CollapseScriptsforWordOk(sal_uInt16 nScript, sal_uInt16 nWhich) override
Guess the script (asian/western).
Definition: ww8atr.cxx:152
void Append(WW8_CP nCp, const void *pData)
Definition: wrtww8.cxx:817
void ResultAdded()
Definition: wrtww8.hxx:1374
sal_uInt16 ResultCount() const
Definition: wrtww8.hxx:1375
void Append(WW8_CP nCp, const SwFormatFootnote &rFootnote)
Definition: wrtw8sty.cxx:2186
Make export a word section top/bottom values easy.
Make exporting a Writer Frame easy.
const SwFrameFormat & GetFrameFormat() const
Get the writer SwFrameFormat that this object describes.
std::shared_ptr< WW8TableNodeInfoInner > Pointer_t
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
RedlineType
int nCount
virtual OUString GetName() const override
virtual sal_uInt32 GetId() const override
SwDoc & m_rDoc
Definition: docbm.cxx:1228
@ EU_FIRSTNAME
Definition: docufld.hxx:104
@ EU_NAME
Definition: docufld.hxx:105
@ EU_STREET
Definition: docufld.hxx:107
@ EU_ZIP
Definition: docufld.hxx:109
@ EU_SHORTCUT
Definition: docufld.hxx:106
@ EU_CITY
Definition: docufld.hxx:110
@ EU_COUNTRY
Definition: docufld.hxx:108
@ DS_CHAR
Definition: docufld.hxx:57
@ DS_PAGE
Definition: docufld.hxx:54
@ DS_WORD
Definition: docufld.hxx:56
@ AF_SHORTCUT
Definition: docufld.hxx:46
float v
float u
#define DFLT_ESC_SUB
#define DFLT_ESC_SUPER
#define DFLT_ESC_PROP
#define DFLT_ESC_AUTO_SUB
#define DFLT_ESC_AUTO_SUPER
SwFieldTypesEnum
List of FieldTypes at UI.
Definition: fldbas.hxx:98
@ FF_PATHNAME
Definition: fldbas.hxx:160
@ FIXEDFLD
Definition: fldbas.hxx:233
@ DATEFLD
Definition: fldbas.hxx:234
@ Database
For old documents the Field-Which IDs must be preserved !!!
@ TableOfAuthorities
DocumentType eType
std::vector< SwColumn > SwColumns
Definition: fmtclds.hxx:57
@ COLADJ_NONE
Definition: fmtclds.hxx:61
@ Fixed
Frame cannot be moved in Var-direction.
@ Variable
Frame is variable in Var-direction.
@ FTNEND_ATPGORDOCEND
at page or document end
Definition: fmtftntx.hxx:30
LINESTYLE_BOLDDASHDOT
LINESTYLE_BOLDDASHDOTDOT
LINESTYLE_SINGLE
LINESTYLE_BOLDLONGDASH
LINESTYLE_BOLDWAVE
LINESTYLE_DASHDOTDOT
LINESTYLE_BOLDDASH
LINESTYLE_BOLDDOTTED
LINESTYLE_DOUBLEWAVE
LINESTYLE_DOUBLE
LINESTYLE_NONE
LINESTYLE_DASH
LINESTYLE_DASHDOT
LINESTYLE_DOTTED
LINESTYLE_WAVE
LINESTYLE_LONGDASH
LINESTYLE_BOLD
FontStrikeout
STRIKEOUT_DOUBLE
STRIKEOUT_NONE
ITALIC_NONE
FontEmphasisMark
WEIGHT_BOLD
OUString sName
SvxFrameDirection
@ FTNPOS_CHAPTER
Definition: ftninfo.hxx:82
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(126)
constexpr TypedWhichId< SwFormatEndAtTextEnd > RES_END_AT_TXTEND(124)
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
constexpr TypedWhichId< SvxCrossedOutItem > RES_CHRATR_CROSSEDOUT(5)
constexpr TypedWhichId< SvxFormatKeepItem > RES_KEEP(116)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
constexpr TypedWhichId< SwFormatFootnoteAtTextEnd > RES_FTN_AT_TXTEND(123)
bool isTXTATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:480
constexpr TypedWhichId< SwFormatFootnote > RES_TXTATR_FTN(59)
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
bool isCHRATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:468
constexpr TypedWhichId< SvxAutoKernItem > RES_CHRATR_AUTOKERN(17)
constexpr TypedWhichId< SvxShadowItem > RES_CHRATR_SHADOW(41)
constexpr TypedWhichId< SvxForbiddenRuleItem > RES_PARATR_FORBIDDEN_RULES(75)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
constexpr sal_uInt16 RES_PARATR_BEGIN(RES_TXTATR_END)
constexpr TypedWhichId< SvxFirstLineIndentItem > RES_MARGIN_FIRSTLINE(91)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
constexpr TypedWhichId< SwConditionTextFormatColl > RES_CONDTXTFMTCOLL(166)
constexpr TypedWhichId< SvxShadowedItem > RES_CHRATR_SHADOWED(13)
constexpr TypedWhichId< SwFormatHeader > RES_HEADER(102)
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
constexpr TypedWhichId< SwFormatCol > RES_COL(115)
constexpr TypedWhichId< SwFormatHoriOrient > RES_HORI_ORIENT(109)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
constexpr TypedWhichId< SvxShadowItem > RES_SHADOW(113)
constexpr TypedWhichId< SfxInt16Item > RES_PARATR_LIST_LEVEL(83)
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(108)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
constexpr TypedWhichId< SfxBoolItem > RES_RTL_GUTTER(139)
constexpr sal_uInt16 RES_FRMATR_END(141)
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
constexpr TypedWhichId< SfxInt16Item > RES_CHRATR_BIDIRTL(44)
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(99)
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_HIGHLIGHT(42)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CTL_WEIGHT(31)
constexpr TypedWhichId< SvxHyphenZoneItem > RES_PARATR_HYPHENZONE(69)
constexpr TypedWhichId< SvxAdjustItem > RES_PARATR_ADJUST(64)
constexpr TypedWhichId< SvxContourItem > RES_CHRATR_CONTOUR(4)
constexpr TypedWhichId< SvxCharReliefItem > RES_CHRATR_RELIEF(36)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
constexpr TypedWhichId< SvxCharHiddenItem > RES_CHRATR_HIDDEN(37)
constexpr TypedWhichId< SvxEscapementItem > RES_CHRATR_ESCAPEMENT(6)
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
constexpr TypedWhichId< SwTextGridItem > RES_TEXTGRID(121)
constexpr TypedWhichId< SvxCharScaleWidthItem > RES_CHRATR_SCALEW(35)
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_BACKGROUND(21)
constexpr TypedWhichId< SvxCaseMapItem > RES_CHRATR_CASEMAP(RES_CHRATR_BEGIN)
constexpr TypedWhichId< SvxLineSpacingItem > RES_PARATR_LINESPACING(RES_PARATR_BEGIN)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CTL_POSTURE(30)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_ANNOTATION(60)
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(162)
constexpr sal_uInt16 RES_WHICHHINT_END(HINT_END)
constexpr TypedWhichId< SvxEmphasisMarkItem > RES_CHRATR_EMPHASIS_MARK(33)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
constexpr TypedWhichId< SwFormatLineNumber > RES_LINENUMBER(122)
constexpr TypedWhichId< SwCharFormat > RES_CHRFMT(RES_FMT_BEGIN)
constexpr TypedWhichId< SwFormatFooter > RES_FOOTER(103)
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN)
constexpr TypedWhichId< SvxHangingPunctuationItem > RES_PARATR_HANGINGPUNCTUATION(74)
constexpr TypedWhichId< SwFormatCharFormat > RES_TXTATR_CHARFMT(52)
constexpr TypedWhichId< SfxInt16Item > RES_CHRATR_IDCTHINT(45)
constexpr TypedWhichId< SvxBlinkItem > RES_CHRATR_BLINK(18)
constexpr TypedWhichId< SvxParaVertAlignItem > RES_PARATR_VERTALIGN(76)
constexpr TypedWhichId< SvxWidowsItem > RES_PARATR_WIDOWS(67)
constexpr TypedWhichId< SwFormatFlyCnt > RES_TXTATR_FLYCNT(58)
constexpr TypedWhichId< SvxParaGridItem > RES_PARATR_SNAPTOGRID(77)
constexpr TypedWhichId< SvxCharRotateItem > RES_CHRATR_ROTATE(32)
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(110)
constexpr TypedWhichId< SwFormatLineBreak > RES_TXTATR_LINEBREAK(61)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(112)
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(100)
constexpr TypedWhichId< SfxGrabBagItem > RES_CHRATR_GRABBAG(43)
constexpr TypedWhichId< SvxRightMarginItem > RES_MARGIN_RIGHT(93)
constexpr TypedWhichId< SvxTextLeftMarginItem > RES_MARGIN_TEXTLEFT(92)
constexpr TypedWhichId< SwTextFormatColl > RES_TXTFMTCOLL(163)
constexpr TypedWhichId< SvxScriptSpaceItem > RES_PARATR_SCRIPTSPACE(73)
constexpr TypedWhichId< SvxWordLineModeItem > RES_CHRATR_WORDLINEMODE(16)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CJK_WEIGHT(26)
constexpr TypedWhichId< SfxGrabBagItem > RES_PARATR_GRABBAG(81)
constexpr TypedWhichId< SvxKerningItem > RES_CHRATR_KERNING(9)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
constexpr TypedWhichId< SfxUInt16Item > RES_PARATR_OUTLINELEVEL(79)
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(107)
constexpr TypedWhichId< SvxTwoLinesItem > RES_CHRATR_TWO_LINES(34)
constexpr TypedWhichId< SvxFormatSplitItem > RES_PARATR_SPLIT(65)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CJK_POSTURE(25)
constexpr TypedWhichId< SvxPaperBinItem > RES_PAPER_BIN(90)
constexpr TypedWhichId< SvxBoxItem > RES_CHRATR_BOX(40)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_INPUTFIELD(55)
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(97)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(98)
constexpr TypedWhichId< SwFrameFormat > RES_FRMFMT(161)
sal_uInt16 GetWhichOfScript(sal_uInt16 nWhich, sal_uInt16 nScript)
Definition: hints.cxx:184
sal_Int64 n
#define LANGUAGE_GERMAN_AUSTRIAN
#define LANGUAGE_GERMAN_SWISS
#define LANGUAGE_NONE
#define LANGUAGE_GERMAN_LUXEMBOURG
#define LANGUAGE_DONTKNOW
#define LANGUAGE_GERMAN
#define LANGUAGE_GERMAN_LIECHTENSTEIN
sal_uInt16 nPos
const long LONG_MAX
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
const sal_uInt16 LN_PDxaFromText10
Definition: sprmids.hxx:36
constexpr OUStringLiteral aData
Definition: ww8scan.hxx:48
void BorderDistancesToWord(const SvxBoxItem &rBox, const WordPageMargins &rMargins, WordBorderDistances &rDistances)
int i
void SvStream & rStrm
::Color BGRToRGB(sal_uInt32 nColour)
sal_uInt8 TransColToIco(const Color &rCol)
const sal_uInt8 ColumnBreak
const sal_uInt8 PageBreak
const SwDocInfoSubType DI_SUB_MASK
Definition: docufld.hxx:87
const SwDocInfoSubType DI_DOCNO
Definition: docufld.hxx:78
const SwDocInfoSubType DI_SUB_AUTHOR
Definition: docufld.hxx:83
const SwDocInfoSubType DI_CUSTOM
Definition: docufld.hxx:80
const SwDocInfoSubType DI_CHANGE
Definition: docufld.hxx:76
const SwDocInfoSubType DI_COMMENT
Definition: docufld.hxx:74
const SwDocInfoSubType DI_SUB_FIXED
Definition: docufld.hxx:86
const SwDocInfoSubType DI_PRINT
Definition: docufld.hxx:77
const SwDocInfoSubType DI_KEYS
Definition: docufld.hxx:73
const SwDocInfoSubType DI_EDIT
Definition: docufld.hxx:79
const SwDocInfoSubType DI_SUBJECT
Definition: docufld.hxx:72
const SwDocInfoSubType DI_TITLE
Definition: docufld.hxx:71
const SwDocInfoSubType DI_CREATE
Definition: docufld.hxx:75
const SwExtendedSubType SUB_INVISIBLE
Invisible.
Definition: fldbas.hxx:217
const SwGetSetExpType GSE_SEQ
Sequence.
Definition: fldbas.hxx:209
const SwGetSetExpType GSE_STRING
String.
Definition: fldbas.hxx:207
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
std::basic_string_view< charT, traits > trim(std::basic_string_view< charT, traits > str)
constexpr bool starts_with(std::basic_string_view< charT, traits > sv, std::basic_string_view< charT, traits > x) noexcept
void SwapQuotesInField(OUString &rFormat)
Another function used by MSDateTimeFormatToSwFormat.
const SvxPageUsage aArr[]
void GetPoolItems(const SfxItemSet &rSet, ww8::PoolItems &rItems, bool bExportParentItemSet)
Get the SfxPoolItems of a SfxItemSet.
const SfxPoolItem * SearchPoolItems(const ww8::PoolItems &rItems, sal_uInt16 eType)
bool IsPlausableSingleWordSection(const SwFrameFormat &rTitleFormat, const SwFrameFormat &rFollowFormat)
See if two page formats can be expressed as a single word section.
const T * HasItem(const ww8::PoolItems &rItems, sal_uInt16 eType)
const SwCharFormat * GetSwCharFormat(const SwFormatINetFormat &rINet, SwDoc &rDoc)
Definition: ww8atr.cxx:1732
Dialog to specify the properties of date form field.
long Long
std::map< sal_uInt16, const SfxPoolItem *, sw::util::ItemSort > PoolItems
STL container of SfxPoolItems (Attributes)
sal_uInt32 RGBToBGR(::Color nColour)
Definition: ww8struc.hxx:1087
const char * GetEnglishFieldName(eField eIndex) noexcept
Find the English Field Name from a winword index.
Definition: fields.cxx:26
eFOOTREF
eKEYWORDS
eMERGEFIELD
eDOCVARIABLE
ePRINTDATE
eSUBJECT
eNUMPAGES
eCREATEDATE
eDOCPROPERTY
eNOTEREF
eSTYLEREF
eCITATION
eEDITTIME
eUSERNAME
eTEMPLATE
ePAGEREF
eUSERINITIALS
eFORMTEXT
eNUMCHARS
eNUMWORDS
eLASTSAVEDBY
eDATABASE
eFILENAME
eMACROBUTTON
eBIBLIOGRAPHY
eSAVEDATE
eUSERADDRESS
eCOMMENTS
std::vector< sal_uInt8 > bytes
Definition: types.hxx:29
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
Definition: nodeoffset.hxx:35
sal_Int16 nId
const char GetValue[]
@ RES_POOLCOLL_HEADLINE9
Heading 9.
Definition: poolfmt.hxx:270
@ RES_POOLCOLL_HEADLINE1
Heading 1.
Definition: poolfmt.hxx:262
bool IsPoolUserFormat(sal_uInt16 nId)
Definition: poolfmt.hxx:86
QPRO_FUNC_TYPE nType
@ REF_OUTLINE
Definition: reffld.hxx:40
@ REF_SETREFATTR
Definition: reffld.hxx:37
@ REF_SEQUENCEFLD
Definition: reffld.hxx:38
@ REF_FOOTNOTE
Definition: reffld.hxx:41
@ REF_BOOKMARK
Definition: reffld.hxx:39
@ REF_ENDNOTE
Definition: reffld.hxx:42
@ REF_PAGE_PGDESC
"As Page Style"
Definition: reffld.hxx:52
@ REF_UPDOWN
"Above/Below"
Definition: reffld.hxx:51
@ REF_NUMBER
new reference format types for referencing bookmarks and set references
Definition: reffld.hxx:58
@ REF_PAGE
"Page"
Definition: reffld.hxx:48
@ REF_ONLYSEQNO
"Numbering"
Definition: reffld.hxx:55
@ REF_ONLYNUMBER
"Category and Number"
Definition: reffld.hxx:53
@ REF_ONLYCAPTION
"Caption Text"
Definition: reffld.hxx:54
@ REF_NUMBER_NO_CONTEXT
"Number (no context)"
Definition: reffld.hxx:59
@ REF_CHAPTER
"Chapter"
Definition: reffld.hxx:49
@ REF_CONTENT
"Reference"
Definition: reffld.hxx:50
@ REF_NUMBER_FULL_CONTEXT
"Number (full context)"
Definition: reffld.hxx:60
static SfxItemSet & rSet
sal_uInt8 SVBT16[2]
sal_uIntPtr sal_uLong
static constexpr sal_uInt16 val
Definition: sprmids.hxx:278
Marks a position in the document model.
Definition: pam.hxx:38
bool fShadow() const
Definition: ww8struc.hxx:329
SVBT32 aBits1
Definition: ww8struc.hxx:311
sal_uInt8 brcType() const
Definition: ww8struc.hxx:325
bool fFrame() const
Definition: ww8struc.hxx:331
sal_uInt8 dptLineWidth() const
Definition: ww8struc.hxx:323
SVBT32 aBits2
Definition: ww8struc.hxx:312
sal_uInt32 cv() const
Definition: ww8struc.hxx:321
sal_uInt8 dptSpace() const
Definition: ww8struc.hxx:327
SVBT16 aBits2
Definition: ww8struc.hxx:264
SVBT16 aBits1
Definition: ww8struc.hxx:263
void SetBack(sal_uInt8 nVal)
Definition: ww8struc.hxx:608
sal_uInt16 GetValue() const
Definition: ww8struc.hxx:599
void SetFore(sal_uInt8 nVal)
Definition: ww8struc.hxx:603
void SetStyle(sal_uInt8 nVal)
Definition: ww8struc.hxx:613
SVX_NUM_NUMBER_NONE
SVX_NUM_CHARS_LOWER_LETTER_N
SVX_NUM_CHARS_LOWER_LETTER
SVX_NUM_CHARS_UPPER_LETTER
SVX_NUM_ROMAN_UPPER
SVX_NUM_ROMAN_LOWER
SVX_NUM_SYMBOL_CHICAGO
SVX_NUM_TEXT_NUMBER
SVX_NUM_ARABIC
SVX_NUM_TEXT_CARDINAL
SVX_NUM_CHARS_UPPER_LETTER_N
SVX_NUM_BITMAP
SVX_NUM_CHAR_SPECIAL
SVX_NUM_TEXT_ORDINAL
SVX_NUM_PAGEDESC
SVX_NUM_ARABIC_ZERO
SvxCaseMap
tools::Long AttrSetToLineHeight(const IDocumentSettingAccess &rIDocumentSettingAccess, const SwAttrSet &rSet, const vcl::RenderContext &rOut, sal_Int16 nScript)
Helper for filters to find true lineheight of a font.
Definition: swfont.cxx:1454
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:168
tools::Long SwTwips
Definition: swtypes.hxx:51
#define DB_DELIM
Definition: swtypes.hxx:130
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:92
@ GRID_LINES_ONLY
Definition: tgrditem.hxx:30
@ GRID_LINES_CHARS
Definition: tgrditem.hxx:30
@ GRID_NONE
Definition: tgrditem.hxx:30
FormTokenType
Definition: tox.hxx:229
@ TOKEN_LINK_START
Definition: tox.hxx:237
@ TOKEN_TEXT
Definition: tox.hxx:234
@ TOKEN_PAGE_NUMS
Definition: tox.hxx:235
@ TOKEN_TAB_STOP
Definition: tox.hxx:233
@ TOKEN_LINK_END
Definition: tox.hxx:238
#define TOX_STYLE_DELIMITER
Definition: tox.hxx:422
std::vector< SwFormToken > SwFormTokens
Vector of tokens.
Definition: tox.hxx:286
@ AUTH_FIELD_IDENTIFIER
Definition: toxe.hxx:84
@ TOX_USER
Definition: toxe.hxx:42
@ TOX_TABLES
Definition: toxe.hxx:46
@ TOX_INDEX
Definition: toxe.hxx:41
@ TOX_OBJECTS
Definition: toxe.hxx:45
@ TOX_AUTHORITIES
Definition: toxe.hxx:47
@ TOX_ILLUSTRATIONS
Definition: toxe.hxx:44
static void Add(SwRegionRects &rRegion, const SwRect &rRect)
Definition: trvlfrm.cxx:1989
unsigned char sal_uInt8
sal_uInt16 sal_Unicode
SVXCORE_DLLPUBLIC std::unique_ptr< SvxBrushItem > getSvxBrushItemFromSourceSet(const SfxItemSet &rSourceSet, sal_uInt16 nBackgroundID, bool bSearchInParents=true, bool bXMLImportHack=false)
oslFileHandle & pOut
OUString BookmarkToWord(std::u16string_view rBookmark, bool *pIsMove, bool *pIsFrom)
Definition: wrtw8nds.cxx:1213
sal_Int16 GetWordFirstLineOffset(const SwNumFormat &rFormat)
Definition: wrtw8num.cxx:159
FieldFlags
Definition: wrtww8.hxx:143
@ TXT_FTN
Definition: wrtww8.hxx:158
@ TXT_HFTXTBOX
Definition: wrtww8.hxx:159
@ TXT_ATN
Definition: wrtww8.hxx:159
@ TXT_TXTBOX
Definition: wrtww8.hxx:159
@ TXT_EDN
Definition: wrtww8.hxx:159
@ TXT_MAINTEXT
Definition: wrtww8.hxx:158
@ TXT_HDFT
Definition: wrtww8.hxx:158
static void ParaTabStopDelAdd(WW8Export &rWrt, const SvxTabStopItem &rTStyle, const tools::Long nLStypeMgn, const SvxTabStopItem &rTNew, const tools::Long nLParaMgn)
Definition: ww8atr.cxx:5368
static bool lcl_IsAtTextEnd(const SwFormatFootnote &rFootnote)
Definition: ww8atr.cxx:3657
static sal_uInt32 SuitableBGColor(Color nIn)
Definition: ww8atr.cxx:1691
static int lcl_CheckForm(const SwForm &rForm, sal_uInt8 nLvl, OUString &rText)
Definition: ww8atr.cxx:2055
static void ParaTabStopAdd(WW8Export &rWrt, const SvxTabStopItem &rTStops, const tools::Long nLParaMgn)
Definition: ww8atr.cxx:5341
static void InsertSpecialChar(WW8Export &rWrt, sal_uInt8 c, OUString const *pLinkStr, bool bIncludeEmptyPicLocation=false)
Definition: ww8atr.cxx:1767
OUString FieldString(ww::eField eIndex)
Definition: ww8atr.cxx:2799
static auto GetSeparatorForLocale() -> OUString
Definition: ww8atr.cxx:2311
static OUString lcl_GetExpandedField(const SwField &rField)
Definition: ww8atr.cxx:1843
static bool lcl_IsEqual(tools::Long nOneLeft, const SvxTabStop &rOne, tools::Long nTwoLeft, const SvxTabStop &rTwo)
Definition: ww8atr.cxx:5357
static bool lcl_IsHyperlinked(const SwForm &rForm, sal_uInt16 nTOXLvl)
Definition: ww8atr.cxx:2108
void Set_UInt32(sal_uInt8 *&p, sal_uInt32 n)
Definition: ww8struc.hxx:53
void Set_UInt8(sal_uInt8 *&p, sal_uInt8 n)
Definition: ww8struc.hxx:41
void Set_UInt16(sal_uInt8 *&p, sal_uInt16 n)
Definition: ww8struc.hxx:47
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLUSESLIDEBACKGROUND)
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
constexpr TypedWhichId< XFillGradientItem > XATTR_FILLGRADIENT(XATTR_FILL_FIRST+2)