LibreOffice Module sw (master) 1
css1atr.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <sal/config.h>
21
22#include <string_view>
23
24#include <hintids.hxx>
25#include <comphelper/string.hxx>
26#include <vcl/svapp.hxx>
27#include <svl/whiter.hxx>
28#include <editeng/boxitem.hxx>
29#include <editeng/ulspitem.hxx>
30#include <editeng/udlnitem.hxx>
32#include <editeng/blinkitem.hxx>
33#include <editeng/cmapitem.hxx>
34#include <editeng/colritem.hxx>
35#include <editeng/fontitem.hxx>
36#include <editeng/fhgtitem.hxx>
37#include <editeng/postitem.hxx>
38#include <editeng/kernitem.hxx>
39#include <editeng/wghtitem.hxx>
40#include <editeng/lspcitem.hxx>
42#include <editeng/lrspitem.hxx>
43#include <editeng/brushitem.hxx>
45#include <editeng/keepitem.hxx>
46#include <editeng/widwitem.hxx>
47#include <editeng/spltitem.hxx>
48#include <editeng/orphitem.hxx>
50#include <svx/xoutbmp.hxx>
51#include <svx/svdobj.hxx>
52#include <editeng/langitem.hxx>
54#include <svtools/htmlout.hxx>
55#include <svtools/htmlkywd.hxx>
56#include <svl/urihelper.hxx>
59#include <charfmt.hxx>
60#include <fmtclds.hxx>
61#include <fmtcol.hxx>
62#include <fmtfsize.hxx>
63#include <fmtornt.hxx>
64#include <fmtpdsc.hxx>
65#include <fmtlsplt.hxx>
66#include <pagedesc.hxx>
67#include <fmtanchr.hxx>
68#include <docary.hxx>
69#include <pam.hxx>
70#include <viewsh.hxx>
71#include <viewopt.hxx>
72#include <swtable.hxx>
73// NOTES
74#include <ftninfo.hxx>
75#include <ftnidx.hxx>
76#include <txtftn.hxx>
77#include <fmtftn.hxx>
78// FOOTNOTES
79#include <doc.hxx>
82#include <swerror.h>
83#include <paratr.hxx>
84#include <frmatr.hxx>
85#include <poolfmt.hxx>
86#include "css1kywd.hxx"
87#include "wrthtml.hxx"
88#include "htmlnum.hxx"
89#include "css1atr.hxx"
90
92#include <numrule.hxx>
95
96#include <rtl/strbuf.hxx>
97#include <osl/diagnose.h>
98
99using namespace css;
101
102#define HTML_HEADSPACE (12*20)
103
104namespace {
105
106enum class Css1FrameSize {
107 NONE = 0x00,
108 Width = 0x01,
109 MinHeight = 0x02,
110 FixHeight = 0x04,
111 Pixel = 0x10,
112};
113
114}
115
116namespace o3tl {
117 template<> struct typed_flags<Css1FrameSize> : is_typed_flags<Css1FrameSize, 0x17> {};
118}
119
120#define DOT_LEADERS_MAX_WIDTH 18
121
122static SwHTMLWriter& OutCSS1_SwFormat( SwHTMLWriter& rWrt, const SwFormat& rFormat,
123 IDocumentStylePoolAccess /*SwDoc*/ *pDoc, SwDoc *pTemplate );
124static SwHTMLWriter& OutCSS1_SwPageDesc( SwHTMLWriter& rWrt, const SwPageDesc& rFormat,
125 IDocumentStylePoolAccess /*SwDoc*/ *pDoc, SwDoc *pTemplate,
126 sal_uInt16 nRefPoolId, bool bExtRef,
127 bool bPseudo=true );
129 SwDoc *pDoc, bool bHasNotes, bool bEndNote );
130static void OutCSS1_SwFormatDropAttrs( SwHTMLWriter& rHWrt,
131 const SwFormatDrop& rDrop,
132 const SfxItemSet *pCharFormatItemSet=nullptr );
134 const SvxUnderlineItem *pUItem,
135 const SvxOverlineItem *pOItem,
136 const SvxCrossedOutItem *pCOItem,
137 const SvxBlinkItem *pBItem );
139static SwHTMLWriter& OutCSS1_SvxPosture( SwHTMLWriter& rWrt, const SfxPoolItem& rHt );
140static SwHTMLWriter& OutCSS1_SvxULSpace( SwHTMLWriter& rWrt, const SfxPoolItem& rHt );
144static SwHTMLWriter& OutCSS1_SvxLRSpace( SwHTMLWriter& rWrt, const SfxPoolItem& rHt );
146 const SvxULSpaceItem *pULSpace,
147 const SvxLRSpaceItem *pLRSpace );
149 const SfxItemSet& rItemSet );
150static SwHTMLWriter& OutCSS1_SvxBrush( SwHTMLWriter& rWrt, const SfxPoolItem& rHt,
151 sw::Css1Background nMode,
152 const OUString *pGraphicName );
153static SwHTMLWriter& OutCSS1_SvxBrush( SwHTMLWriter& rWrt, const SfxPoolItem& rHt );
155 Css1FrameSize nMode );
157 const SfxItemSet& rItemSet,
158 bool bDeep );
160
161namespace
162{
163
164const char sCSS1_rule_end[] = " }";
165const char sCSS1_span_tag_end[] = "\">";
166const char cCSS1_style_opt_end = '\"';
167
168const char* const sHTML_FTN_fontheight = "57%";
169
170OString lclConvToHex(sal_uInt16 nHex)
171{
172 char aNToABuf[] = "00";
173
174 // set pointer to end of buffer
175 char *pStr = aNToABuf + (sizeof(aNToABuf)-1);
176 for( sal_uInt8 n = 0; n < 2; ++n )
177 {
178 *(--pStr) = static_cast<char>(nHex & 0xf ) + 48;
179 if( *pStr > '9' )
180 *pStr += 39;
181 nHex >>= 4;
182 }
183
184 return OString(aNToABuf, 2);
185}
186}
187
188bool IgnorePropertyForReqIF(bool bReqIF, std::string_view rProperty, std::string_view rValue,
189 std::optional<sw::Css1Background> oMode)
190{
191 if (!bReqIF)
192 return false;
193
194 if (oMode.has_value() && *oMode != sw::Css1Background::TableCell)
195 {
196 // Table or row.
197 if (rProperty == sCSS1_P_background && rValue == "transparent")
198 {
199 // This is the default already.
200 return true;
201 }
202
203 return false;
204 }
205
206 // Only allow these two keys, nothing else in ReqIF mode.
207 if (rProperty == sCSS1_P_text_decoration)
208 {
209 // Deny other text-decoration values (e.g. "none").
210 if (rValue == "underline" || rValue == "line-through")
211 {
212 return false;
213 }
214
215 return true;
216 }
217
218 if (rProperty == sCSS1_P_color)
219 return false;
220
221 return true;
222}
223
224OString GetCSS1_Color(const Color& rColor)
225{
226 return "#" + lclConvToHex(rColor.GetRed()) + lclConvToHex(rColor.GetGreen()) + lclConvToHex(rColor.GetBlue());
227}
228
229namespace {
230
231class SwCSS1OutMode
232{
233 SwHTMLWriter& rWrt;
234 sal_uInt16 nOldMode;
235
236public:
237
238 SwCSS1OutMode( SwHTMLWriter& rHWrt, sal_uInt16 nMode,
239 const OUString *pSelector ) :
240 rWrt( rHWrt ),
241 nOldMode( rHWrt.m_nCSS1OutMode )
242 {
243 rWrt.m_nCSS1OutMode = nMode;
244 rWrt.m_bFirstCSS1Property = true;
245 if( pSelector )
246 rWrt.m_aCSS1Selector = *pSelector;
247 }
248
249 ~SwCSS1OutMode()
250 {
251 rWrt.m_nCSS1OutMode = nOldMode;
252 }
253};
254
255}
256
257void SwHTMLWriter::OutCSS1_Property( std::string_view pProp,
258 std::string_view sVal,
259 const OUString *pSVal,
260 std::optional<sw::Css1Background> oMode )
261{
262 OString aPropertyValue(sVal);
263 if (aPropertyValue.isEmpty() && pSVal)
264 {
265 aPropertyValue = OUStringToOString(*pSVal, RTL_TEXTENCODING_UTF8);
266 }
267 if (IgnorePropertyForReqIF(mbReqIF, pProp, aPropertyValue, oMode))
268 return;
269
270 OStringBuffer sOut;
271
273 {
274 m_bFirstCSS1Rule = false;
275 OutNewLine();
276 sOut.append("<" + GetNamespace() + OOO_STRING_SVTOOLS_HTML_style " "
277 OOO_STRING_SVTOOLS_HTML_O_type "=\"text/css\">");
278 // Optional CSS2 code for dot leaders (dotted line between the Table of Contents titles and page numbers):
279 // (More information: http://www.w3.org/Style/Examples/007/leaders.en.html)
280 //
281 // p.leaders {
282 // /* FIXME:
283 // (1) dots line up vertically only in the paragraphs with the same alignment/level
284 // (2) max-width = 18 cm instead of 80em; possible improvement with the new CSS3 calc() */
285 // max-width: 18cm; /* note: need to overwrite max-width with max-width - border-left_of_the_actual_paragraph */
286 // padding: 0;
287 // overflow-x: hidden;
288 // line-height: 120%; /* note: avoid HTML scrollbars and missing descenders of the letters */
289 // }
290 // p.leaders:after {
291 // float: left;
292 // width: 0;
293 // white-space: nowrap;
294 // content: ". . . . . . . . . . . . . . . . . . ...";
295 // }
296 // p.leaders span:first-child {
297 // padding-right: 0.33em;
298 // background: white;
299 // }
300 // p.leaders span + span {
301 // float: right;
302 // padding-left: 0.33em;
303 // background: white;
304 // position: relative;
305 // z-index: 1
306 // }
307
308 if (m_bCfgPrintLayout) {
309 sOut.append(
310 "p." sCSS2_P_CLASS_leaders "{max-width:" + OString::number(DOT_LEADERS_MAX_WIDTH) +
311 "cm;padding:0;overflow-x:hidden;line-height:120%}"
312 "p." sCSS2_P_CLASS_leaders ":after{float:left;width:0;white-space:nowrap;content:\"");
313 for (int i = 0; i < 100; i++ )
314 sOut.append(". ");
315 sOut.append(
316 "\"}p." sCSS2_P_CLASS_leaders " span:first-child{padding-right:0.33em;background:white}"
317 "p." sCSS2_P_CLASS_leaders " span+span{float:right;padding-left:0.33em;"
318 "background:white;position:relative;z-index:1}");
319 }
320 Strm().WriteOString( sOut );
321 sOut.setLength(0);
322
324 }
325
327 {
329 {
332 if( m_bTagOn )
333 {
334 sOut.append("<" + GetNamespace() + OOO_STRING_SVTOOLS_HTML_span
336 }
337 else
338 {
340 return;
341 }
342 break;
343
345 {
346 OutNewLine();
347 sOut.append(OUStringToOString(m_aCSS1Selector, RTL_TEXTENCODING_UTF8) + " { ");
348 }
349 break;
350
352 sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_style "=\"");
353 break;
354 }
355 m_bFirstCSS1Property = false;
356 }
357 else
358 {
359 sOut.append("; ");
360 }
361
362 sOut.append(pProp + OString::Concat(": "));
364 {
365 // for STYLE-Option encode string
366 Strm().WriteOString( sOut );
367 sOut.setLength(0);
368 if( !sVal.empty() )
369 HTMLOutFuncs::Out_String( Strm(), OUString::createFromAscii(sVal) );
370 else if( pSVal )
371 HTMLOutFuncs::Out_String( Strm(), *pSVal );
372 }
373 else
374 {
375 // for STYLE-Tag print string directly
376 sOut.append(aPropertyValue);
377 }
378
379 if (!sOut.isEmpty())
380 Strm().WriteOString( sOut );
381}
382
383static void AddUnitPropertyValue(OStringBuffer &rOut, tools::Long nVal,
384 FieldUnit eUnit)
385{
386 if( nVal < 0 )
387 {
388 // special-case sign symbol
389 nVal = -nVal;
390 rOut.append('-');
391 }
392
393 o3tl::Length eTo;
394 int nFac; // used to get specific number of decimals
395 std::string_view pUnit;
396 switch( eUnit )
397 {
398 case FieldUnit::MM_100TH:
399 OSL_ENSURE( FieldUnit::MM == eUnit, "Measuring unit not supported" );
400 [[fallthrough]];
401 case FieldUnit::MM:
402 eTo = o3tl::Length::mm;
403 nFac = 100;
404 pUnit = sCSS1_UNIT_mm;
405 break;
406
407 case FieldUnit::M:
408 case FieldUnit::KM:
409 OSL_ENSURE( FieldUnit::CM == eUnit, "Measuring unit not supported" );
410 [[fallthrough]];
411 case FieldUnit::CM:
412 eTo = o3tl::Length::cm;
413 nFac = 100;
414 pUnit = sCSS1_UNIT_cm;
415 break;
416
417 case FieldUnit::TWIP:
418 OSL_ENSURE( FieldUnit::POINT == eUnit, "Measuring unit not supported" );
419 [[fallthrough]];
420 case FieldUnit::POINT:
421 eTo = o3tl::Length::pt;
422 nFac = 10;
423 pUnit = sCSS1_UNIT_pt;
424 break;
425
426 case FieldUnit::PICA:
427 eTo = o3tl::Length::pc;
428 nFac = 100;
429 pUnit = sCSS1_UNIT_pc;
430 break;
431
432 case FieldUnit::NONE:
433 case FieldUnit::FOOT:
434 case FieldUnit::MILE:
435 case FieldUnit::CUSTOM:
436 case FieldUnit::PERCENT:
437 case FieldUnit::INCH:
438 default:
439 OSL_ENSURE( FieldUnit::INCH == eUnit, "Measuring unit not supported" );
440 eTo = o3tl::Length::in;
441 nFac = 100;
442 pUnit = sCSS1_UNIT_inch;
443 break;
444 }
445
446 sal_Int64 nResult = o3tl::convert(nVal * nFac, o3tl::Length::twip, eTo);
447 rOut.append(nResult/nFac);
448 if ((nResult % nFac) != 0)
449 {
450 rOut.append('.');
451 while (nFac > 1 && (nResult % nFac) != 0)
452 {
453 nFac /= 10;
454 rOut.append((nResult / nFac) % 10);
455 }
456 }
457
458 rOut.append(pUnit);
459}
460
461void SwHTMLWriter::OutCSS1_UnitProperty( std::string_view pProp, tools::Long nVal )
462{
463 OStringBuffer sOut;
465 OutCSS1_PropertyAscii(pProp, sOut);
466}
467
468void SwHTMLWriter::OutCSS1_PixelProperty( std::string_view pProp, tools::Long nVal,
469 bool bVert )
470{
471 OString sOut(OString::number(ToPixel(nVal,bVert)) + sCSS1_UNIT_px);
472 OutCSS1_PropertyAscii(pProp, sOut);
473}
474
476{
477 m_bFirstCSS1Rule = true;
478
479// Feature: PrintExt
481 {
482 const SwPageDesc *pFirstPageDesc = nullptr;
483 sal_uInt16 nFirstRefPoolId = RES_POOLPAGE_HTML;
485
486 // First we try to guess how the document is constructed.
487 // Allowed are only the templates: HTML, 1st page, left page, and right page.
488 // A first page is only exported, if it matches the template "1st page".
489 // Left and right pages are only exported, if their templates are linked.
490 // If other templates are used, only very simple cases are exported.
491 const SwPageDesc *pPageDesc = &rPageDesc;
492 const SwPageDesc *pFollow = rPageDesc.GetFollow();
493 if( RES_POOLPAGE_FIRST == pPageDesc->GetPoolFormatId() &&
494 pFollow != pPageDesc &&
495 !IsPoolUserFormat( pFollow->GetPoolFormatId() ) )
496 {
497 // the document has a first page
498 pFirstPageDesc = pPageDesc;
499 pPageDesc = pFollow;
500 pFollow = pPageDesc->GetFollow();
501 }
502
504 if( pPageDesc == pFollow )
505 {
506 // The document is one-sided; no matter what page, we do not create a 2-sided doc.
507 // The attribute is exported relative to the HTML page template.
508 OutCSS1_SwPageDesc( *this, *pPageDesc, pStylePoolAccess, m_xTemplate.get(),
509 RES_POOLPAGE_HTML, true, false );
510 nFirstRefPoolId = pFollow->GetPoolFormatId();
511 }
512 else if( (RES_POOLPAGE_LEFT == pPageDesc->GetPoolFormatId() &&
513 RES_POOLPAGE_RIGHT == pFollow->GetPoolFormatId()) ||
514 (RES_POOLPAGE_RIGHT == pPageDesc->GetPoolFormatId() &&
515 RES_POOLPAGE_LEFT == pFollow->GetPoolFormatId()) )
516 {
517 // the document is double-sided
518 OutCSS1_SwPageDesc( *this, *pPageDesc, pStylePoolAccess, m_xTemplate.get(),
519 RES_POOLPAGE_HTML, true );
520 OutCSS1_SwPageDesc( *this, *pFollow, pStylePoolAccess, m_xTemplate.get(),
521 RES_POOLPAGE_HTML, true );
522 nFirstRefPoolId = RES_POOLPAGE_RIGHT;
524 }
525 // other cases we miss
526
527 if( pFirstPageDesc )
528 OutCSS1_SwPageDesc( *this, *pFirstPageDesc, pStylePoolAccess, m_xTemplate.get(),
529 nFirstRefPoolId, false );
530 }
531
532 // The text body style has to be exported always (if it is changed compared
533 // to the template), because it is used as reference for any style
534 // that maps to <P>, and that's especially the standard style
536
537 // the Default-TextStyle is not also exported !!
538 // 0-Style is the Default; is never exported !!
539 const size_t nTextFormats = m_pDoc->GetTextFormatColls()->size();
540 for( size_t i = 1; i < nTextFormats; ++i )
541 {
542 const SwTextFormatColl* pColl = (*m_pDoc->GetTextFormatColls())[i];
543 sal_uInt16 nPoolId = pColl->GetPoolFormatId();
544 if( nPoolId == RES_POOLCOLL_TEXT || m_pDoc->IsUsed( *pColl ) )
546 }
547
548 // the Default-TextStyle is not also exported !!
549 const size_t nCharFormats = m_pDoc->GetCharFormats()->size();
550 for( size_t i = 1; i < nCharFormats; ++i )
551 {
552 const SwCharFormat *pCFormat = (*m_pDoc->GetCharFormats())[i];
553 sal_uInt16 nPoolId = pCFormat->GetPoolFormatId();
554 if( nPoolId == RES_POOLCHR_INET_NORMAL ||
555 nPoolId == RES_POOLCHR_INET_VISIT ||
556 m_pDoc->IsUsed( *pCFormat ) )
557 OutCSS1_SwFormat( *this, *pCFormat, &m_pDoc->getIDocumentStylePoolAccess(), m_xTemplate.get() );
558 }
559
560 bool bHasEndNotes {false};
561 bool bHasFootNotes {false};
562 const SwFootnoteIdxs& rIdxs = m_pDoc->GetFootnoteIdxs();
563 for( auto pIdx : rIdxs )
564 {
565 if( pIdx->GetFootnote().IsEndNote() )
566 {
567 bHasEndNotes = true;
568 if (bHasFootNotes)
569 break;
570 }
571 else
572 {
573 bHasFootNotes = true;
574 if (bHasEndNotes)
575 break;
576 }
577 }
578 OutCSS1_SwFootnoteInfo( *this, m_pDoc->GetFootnoteInfo(), m_pDoc, bHasFootNotes, false );
579 OutCSS1_SwFootnoteInfo( *this, m_pDoc->GetEndNoteInfo(), m_pDoc, bHasEndNotes, true );
580
581 if( !m_bFirstCSS1Rule )
582 {
584
585 OutNewLine();
587 }
588 else
589 {
590 m_bFirstCSS1Rule = false;
591 }
592
595}
596
597// if pPseudo is set, Styles-Sheets will be exported;
598// otherwise we only search for Token and Class for a Format
599sal_uInt16 SwHTMLWriter::GetCSS1Selector( const SwFormat *pFormat, OString& rToken,
600 OUString& rClass, sal_uInt16& rRefPoolId,
601 OUString *pPseudo )
602{
603 sal_uInt16 nDeep = 0;
604 rToken.clear();
605 rClass.clear();
606 rRefPoolId = 0;
607 if( pPseudo )
608 pPseudo->clear();
609
610 bool bChrFormat = RES_CHRFMT==pFormat->Which();
611
612 // search formats above for the nearest standard or HTML-Tag template
613 const SwFormat *pPFormat = pFormat;
614 while( pPFormat && !pPFormat->IsDefault() )
615 {
616 bool bStop = false;
617 sal_uInt16 nPoolId = pPFormat->GetPoolFormatId();
618 if( USER_FMT & nPoolId )
619 {
620 // user templates
621 const OUString& aNm(pPFormat->GetName());
622
623 if (!bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_blockquote)
624 {
625 rRefPoolId = RES_POOLCOLL_HTML_BLOCKQUOTE;
626 rToken = OString(OOO_STRING_SVTOOLS_HTML_blockquote);
627 }
628 else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_citation)
629 {
630 rRefPoolId = RES_POOLCHR_HTML_CITATION;
631 rToken = OString(OOO_STRING_SVTOOLS_HTML_citation);
632 }
633 else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_code)
634 {
635 rRefPoolId = RES_POOLCHR_HTML_CODE;
636 rToken = OString(OOO_STRING_SVTOOLS_HTML_code);
637 }
638 else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_definstance)
639 {
640 rRefPoolId = RES_POOLCHR_HTML_DEFINSTANCE;
641 rToken = OString(OOO_STRING_SVTOOLS_HTML_definstance);
642 }
643 else if (!bChrFormat && (aNm == OOO_STRING_SVTOOLS_HTML_dd ||
645 {
646 sal_uInt16 nDefListLvl = GetDefListLvl(aNm, nPoolId);
647 // Export the templates DD 1/DT 1,
648 // but none of their derived templates,
649 // also not DD 2/DT 2 etc.
650 if (nDefListLvl)
651 {
652 if (pPseudo && (nDeep || (nDefListLvl & 0x0fff) > 1))
653 {
654 bStop = true;
655 }
656 else if (nDefListLvl & HTML_DLCOLL_DD)
657 {
658 rRefPoolId = RES_POOLCOLL_HTML_DD;
659 rToken = OString(OOO_STRING_SVTOOLS_HTML_dd);
660 }
661 else
662 {
663 rRefPoolId = RES_POOLCOLL_HTML_DT;
664 rToken = OString(OOO_STRING_SVTOOLS_HTML_dt);
665 }
666 }
667 }
668 else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_emphasis)
669 {
670 rRefPoolId = RES_POOLCHR_HTML_EMPHASIS;
671 rToken = OString(OOO_STRING_SVTOOLS_HTML_emphasis);
672 }
673 else if (!bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_horzrule)
674 {
675 // do not export HR !
676 bStop = (nDeep==0);
677 }
678 else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_keyboard)
679 {
680 rRefPoolId = RES_POOLCHR_HTML_KEYBOARD;
681 rToken = OString(OOO_STRING_SVTOOLS_HTML_keyboard);
682 }
683 else if (!bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_listing)
684 {
685 // Export Listings as PRE or PRE-derived template
686 rToken = OString(OOO_STRING_SVTOOLS_HTML_preformtxt);
687 rRefPoolId = RES_POOLCOLL_HTML_PRE;
688 nDeep = CSS1_FMT_CMPREF;
689 }
690 else if (!bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_preformtxt)
691 {
692 rRefPoolId = RES_POOLCOLL_HTML_PRE;
693 rToken = OString(OOO_STRING_SVTOOLS_HTML_preformtxt);
694 }
695 else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_sample)
696 {
697 rRefPoolId = RES_POOLCHR_HTML_SAMPLE;
698 rToken = OString(OOO_STRING_SVTOOLS_HTML_sample);
699 }
700 else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_strong)
701 {
702 rRefPoolId = RES_POOLCHR_HTML_STRONG;
703 rToken = OString(OOO_STRING_SVTOOLS_HTML_strong);
704 }
705 else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_teletype)
706 {
707 rRefPoolId = RES_POOLCHR_HTML_TELETYPE;
708 rToken = OString(OOO_STRING_SVTOOLS_HTML_teletype);
709 }
710 else if (bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_variable)
711 {
712 rRefPoolId = RES_POOLCHR_HTML_VARIABLE;
713 rToken = OString(OOO_STRING_SVTOOLS_HTML_variable);
714 }
715 else if (!bChrFormat && aNm == OOO_STRING_SVTOOLS_HTML_xmp)
716 {
717 // export XMP as PRE (but not the template as Style)
718 rToken = OString(OOO_STRING_SVTOOLS_HTML_preformtxt);
719 rRefPoolId = RES_POOLCOLL_HTML_PRE;
720 nDeep = CSS1_FMT_CMPREF;
721 }
722
723 // if a PoolId is set, the Name of the template is that of the related Token
724 OSL_ENSURE( (rRefPoolId != 0) == (!rToken.isEmpty()),
725 "Token missing" );
726 }
727 else
728 {
729 // Pool templates
730 switch( nPoolId )
731 {
732 // paragraph templates
735 // do not export this template
736 bStop = (nDeep==0);
737 break;
739 rToken = OString(OOO_STRING_SVTOOLS_HTML_parabreak);
740 break;
742 rToken = OString(OOO_STRING_SVTOOLS_HTML_head1);
743 break;
745 rToken = OString(OOO_STRING_SVTOOLS_HTML_head2);
746 break;
748 rToken = OString(OOO_STRING_SVTOOLS_HTML_head3);
749 break;
751 rToken = OString(OOO_STRING_SVTOOLS_HTML_head4);
752 break;
754 rToken = OString(OOO_STRING_SVTOOLS_HTML_head5);
755 break;
757 rToken = OString(OOO_STRING_SVTOOLS_HTML_head6);
758 break;
760 rToken = OString(OOO_STRING_SVTOOLS_HTML_address);
761 break;
763 rToken = OString(OOO_STRING_SVTOOLS_HTML_blockquote);
764 break;
766 rToken = OString(OOO_STRING_SVTOOLS_HTML_preformtxt);
767 break;
768
770 rToken = OString(OOO_STRING_SVTOOLS_HTML_dd);
771 break;
773 rToken = OString(OOO_STRING_SVTOOLS_HTML_dt);
774 break;
775
777 if( pPseudo )
778 {
781 }
782 else
784 break;
786 if( pPseudo )
787 {
790 }
791 else
792 rToken = OString(OOO_STRING_SVTOOLS_HTML_parabreak);
793 break;
795 // do not export HR !
796 bStop = (nDeep==0);
797 break;
799 if( !nDeep )
800 {
801 rToken = OString(OOO_STRING_SVTOOLS_HTML_parabreak);
803 rRefPoolId = RES_POOLCOLL_TEXT;
804 nDeep = CSS1_FMT_CMPREF;
805 }
806 break;
808 if( !nDeep )
809 {
810 rToken = OString(OOO_STRING_SVTOOLS_HTML_parabreak);
812 rRefPoolId = RES_POOLCOLL_TEXT;
813 nDeep = CSS1_FMT_CMPREF;
814 }
815 break;
816
817 // character templates
819 rToken = OString(OOO_STRING_SVTOOLS_HTML_emphasis);
820 break;
822 rToken = OString(OOO_STRING_SVTOOLS_HTML_citation);
823 break;
825 rToken = OString(OOO_STRING_SVTOOLS_HTML_strong);
826 break;
828 rToken = OString(OOO_STRING_SVTOOLS_HTML_code);
829 break;
831 rToken = OString(OOO_STRING_SVTOOLS_HTML_sample);
832 break;
834 rToken = OString(OOO_STRING_SVTOOLS_HTML_keyboard);
835 break;
837 rToken = OString(OOO_STRING_SVTOOLS_HTML_variable);
838 break;
840 rToken = OString(OOO_STRING_SVTOOLS_HTML_definstance);
841 break;
843 rToken = OString(OOO_STRING_SVTOOLS_HTML_teletype);
844 break;
845
847 if( pPseudo )
848 {
849 rToken = OString(OOO_STRING_SVTOOLS_HTML_anchor);
850 *pPseudo = OStringToOUString( sCSS1_link, RTL_TEXTENCODING_ASCII_US );
851 }
852 break;
854 if( pPseudo )
855 {
856 rToken = OString(OOO_STRING_SVTOOLS_HTML_anchor);
857 *pPseudo = OStringToOUString( sCSS1_visited, RTL_TEXTENCODING_ASCII_US );
858 }
859 break;
860 }
861
862 // if a token is set, PoolId contains the related template
863 if( !rToken.isEmpty() && !rRefPoolId )
864 rRefPoolId = nPoolId;
865 }
866
867 if( !rToken.isEmpty() || bStop )
868 {
869 // stop if a HTML-Tag template was found
870 break;
871 }
872 else
873 {
874 // continue otherwise
875 nDeep++;
876 pPFormat = pPFormat->DerivedFrom();
877 }
878 }
879
880 if( !rToken.isEmpty() )
881 {
882 // this is a HTML-Tag template
883 if( !nDeep )
884 nDeep = CSS1_FMT_ISTAG;
885 }
886 else
887 {
888 // this is not a HTML-Tag template nor derived from one
889 nDeep = 0;
890 }
891 if( nDeep > 0 && nDeep < CSS1_FMT_SPECIAL )
892 {
893 // If the template is derived from a HTML template,
894 // we export it as <TOKEN>.<CLASS>, otherwise as .<CLASS>.
895 // <CLASS> is the name of the template after removing all characters
896 // before and including the first '.'
897 rClass = pFormat->GetName();
898 sal_Int32 nPos = rClass.indexOf( '.' );
899 if( nPos >= 0 && rClass.getLength() > nPos+1 )
900 {
901 rClass = rClass.replaceAt( 0, nPos+1, u"" );
902 }
903
904 rClass = GetAppCharClass().lowercase( rClass );
905 rClass = rClass.replaceAll( ".", "-" );
906 rClass = rClass.replaceAll( " ", "-" );
907 rClass = rClass.replaceAll( "_", "-" );
908 }
909
910 return nDeep;
911}
912
913static sal_uInt16 GetCSS1Selector( const SwFormat *pFormat, OUString& rSelector,
914 sal_uInt16& rRefPoolId )
915{
916 OString aToken;
917 OUString aClass;
918 OUString aPseudo;
919
920 sal_uInt16 nDeep = SwHTMLWriter::GetCSS1Selector( pFormat, aToken, aClass,
921 rRefPoolId, &aPseudo );
922 if( nDeep )
923 {
924 if( !aToken.isEmpty() )
925 rSelector = OStringToOUString(aToken, RTL_TEXTENCODING_ASCII_US);
926 else
927 rSelector.clear();
928
929 if( !aClass.isEmpty() )
930 rSelector += "." + aClass;
931 if( !aPseudo.isEmpty() )
932 rSelector += ":" + aPseudo;
933 }
934
935 return nDeep;
936}
937
938const SwFormat *SwHTMLWriter::GetTemplateFormat( sal_uInt16 nPoolFormatId,
939 IDocumentStylePoolAccess* pTemplate /*SwDoc *pTemplate*/)
940{
941 const SwFormat *pRefFormat = nullptr;
942
943 if( pTemplate )
944 {
945 OSL_ENSURE( !(USER_FMT & nPoolFormatId),
946 "No user templates found" );
947 if( POOLGRP_NOCOLLID & nPoolFormatId )
948 pRefFormat = pTemplate->GetCharFormatFromPool( nPoolFormatId );
949 else
950 pRefFormat = pTemplate->GetTextCollFromPool( nPoolFormatId, false );
951 }
952
953 return pRefFormat;
954}
955
956const SwFormat *SwHTMLWriter::GetParentFormat( const SwFormat& rFormat, sal_uInt16 nDeep )
957{
958 OSL_ENSURE( nDeep != USHRT_MAX, "Called GetParent for HTML-template!" );
959 const SwFormat *pRefFormat = nullptr;
960
961 if( nDeep > 0 )
962 {
963 // get the pointer for the HTML-Tag template, from which the template is derived
964 pRefFormat = &rFormat;
965 for( sal_uInt16 i=nDeep; i>0; i-- )
966 pRefFormat = pRefFormat->DerivedFrom();
967
968 if( pRefFormat && pRefFormat->IsDefault() )
969 pRefFormat = nullptr;
970 }
971
972 return pRefFormat;
973}
974
976{
977 return static_cast<const SvxFontItem &>(r1).GetFamilyName() ==
978 static_cast<const SvxFontItem &>(r2).GetFamilyName() &&
979 static_cast<const SvxFontItem &>(r1).GetFamily() ==
980 static_cast<const SvxFontItem &>(r2).GetFamily();
981}
982
984 const SfxItemSet& rRefItemSet,
985 bool bSetDefaults,
986 bool bClearSame,
987 const SfxItemSet *pRefScriptItemSet )
988{
989 OSL_ENSURE( bSetDefaults || bClearSame,
990 "SwHTMLWriter::SubtractItemSet: No action for this Flag" );
991 SfxItemSet aRefItemSet( *rRefItemSet.GetPool(), rRefItemSet.GetRanges() );
992 aRefItemSet.Set( rRefItemSet );
993
994 // compare with the Attr-Set of the template
995 SfxWhichIter aIter( rItemSet );
996 sal_uInt16 nWhich = aIter.FirstWhich();
997 while( nWhich )
998 {
999 const SfxPoolItem *pRefItem, *pItem;
1000 bool bItemSet = ( SfxItemState::SET ==
1001 aIter.GetItemState( false, &pItem) );
1002 bool bRefItemSet;
1003
1004 if( pRefScriptItemSet )
1005 {
1006 switch( nWhich )
1007 {
1008 case RES_CHRATR_FONT:
1011 case RES_CHRATR_POSTURE:
1012 case RES_CHRATR_WEIGHT:
1023 bRefItemSet = ( SfxItemState::SET ==
1024 pRefScriptItemSet->GetItemState( nWhich, true, &pRefItem) );
1025 break;
1026 default:
1027 bRefItemSet = ( SfxItemState::SET ==
1028 aRefItemSet.GetItemState( nWhich, false, &pRefItem) );
1029 break;
1030 }
1031 }
1032 else
1033 {
1034 bRefItemSet = ( SfxItemState::SET ==
1035 aRefItemSet.GetItemState( nWhich, false, &pRefItem) );
1036 }
1037
1038 if( bItemSet )
1039 {
1040 if( (bClearSame || pRefScriptItemSet) && bRefItemSet &&
1041 ( *pItem == *pRefItem ||
1042 ((RES_CHRATR_FONT == nWhich ||
1043 RES_CHRATR_CJK_FONT == nWhich ||
1044 RES_CHRATR_CTL_FONT == nWhich) &&
1045 swhtml_css1atr_equalFontItems( *pItem, *pRefItem )) ) )
1046 {
1047 // the Attribute is in both templates with the same value
1048 // and does not need to be exported
1049 rItemSet.ClearItem( nWhich );
1050 }
1051 }
1052 else
1053 {
1054 if( (bSetDefaults || pRefScriptItemSet) && bRefItemSet )
1055 {
1056 // the Attribute exists only in the reference; the default
1057 // might have to be exported
1058 rItemSet.Put( rItemSet.GetPool()->GetDefaultItem(nWhich) );
1059 }
1060 }
1061
1062 nWhich = aIter.NextWhich();
1063 }
1064}
1065
1067 OUString& rNames,
1068 sal_Unicode cQuote, bool bGeneric )
1069{
1070 rNames.clear();
1071 const OUString& rName = rFontItem.GetFamilyName();
1072 bool bContainsKeyword = false;
1073 if( !rName.isEmpty() )
1074 {
1075 sal_Int32 nStrPos = 0;
1076 while( nStrPos != -1 )
1077 {
1078 OUString aName = rName.getToken( 0, ';', nStrPos );
1080 if( aName.isEmpty() )
1081 continue;
1082
1083 bool bIsKeyword = false;
1084 switch( aName[0] )
1085 {
1086 case 'c':
1087 case 'C':
1088 bIsKeyword = aName.equalsIgnoreAsciiCaseAscii( sCSS1_PV_cursive );
1089 break;
1090
1091 case 'f':
1092 case 'F':
1093 bIsKeyword = aName.equalsIgnoreAsciiCaseAscii( sCSS1_PV_fantasy );
1094 break;
1095
1096 case 'm':
1097 case 'M':
1098 bIsKeyword = aName.equalsIgnoreAsciiCaseAscii( sCSS1_PV_monospace );
1099 break;
1100
1101 case 's':
1102 case 'S':
1103 bIsKeyword =
1104 aName.equalsIgnoreAsciiCaseAscii( sCSS1_PV_serif ) ||
1105 aName.equalsIgnoreAsciiCaseAscii( sCSS1_PV_sans_serif );
1106 break;
1107 }
1108
1109 bContainsKeyword |= bIsKeyword;
1110
1111 if( !rNames.isEmpty() )
1112 rNames += ", ";
1113 if( cQuote && !bIsKeyword )
1114 rNames += OUStringChar( cQuote );
1115 rNames += aName;
1116 if( cQuote && !bIsKeyword )
1117 rNames += OUStringChar( cQuote );
1118 }
1119 }
1120
1121 if( bContainsKeyword || !bGeneric )
1122 return;
1123
1124 std::string_view pStr;
1125 switch( rFontItem.GetFamily() )
1126 {
1127 case FAMILY_ROMAN: pStr = sCSS1_PV_serif; break;
1128 case FAMILY_SWISS: pStr = sCSS1_PV_sans_serif; break;
1129 case FAMILY_SCRIPT: pStr = sCSS1_PV_cursive; break;
1130 case FAMILY_DECORATIVE: pStr = sCSS1_PV_fantasy; break;
1131 case FAMILY_MODERN: pStr = sCSS1_PV_monospace; break;
1132 default:
1133 ;
1134 }
1135
1136 if( !pStr.empty() )
1137 {
1138 if( !rNames.isEmpty() )
1139 rNames += ", ";
1140 rNames += OStringToOUString( pStr, RTL_TEXTENCODING_ASCII_US );
1141 }
1142}
1143
1145 bool bCheckDropCap )
1146{
1147 static const sal_uInt16 aWhichIds[] =
1148 {
1154 0, 0, 0
1155 };
1156
1157 for( int i=0; aWhichIds[i]; i += 3 )
1158 {
1159 const SfxPoolItem *pItem = nullptr, *pItemCJK = nullptr, *pItemCTL = nullptr, *pTmp;
1160 int nItemCount = 0;
1161 if( SfxItemState::SET == rItemSet.GetItemState( aWhichIds[i], false,
1162 &pTmp ) )
1163 {
1164 pItem = pTmp;
1165 nItemCount++;
1166 }
1167 if( SfxItemState::SET == rItemSet.GetItemState( aWhichIds[i+1], false,
1168 &pTmp ) )
1169 {
1170 pItemCJK = pTmp;
1171 nItemCount++;
1172 }
1173 if( SfxItemState::SET == rItemSet.GetItemState( aWhichIds[i+2], false,
1174 &pTmp ) )
1175 {
1176 pItemCTL = pTmp;
1177 nItemCount++;
1178 }
1179
1180 // If some of the items are set, but not all, we need script dependent
1181 // styles
1182 if( nItemCount > 0 && nItemCount < 3 )
1183 return true;
1184
1185 if( 3 == nItemCount )
1186 {
1187 // If all items are set, but some of them have different values,
1188 // we need script dependent styles, too. For font items, we have
1189 // to take care about their special HTML/CSS1 representation.
1190 if( RES_CHRATR_FONT == aWhichIds[i] )
1191 {
1192 if( !swhtml_css1atr_equalFontItems( *pItem, *pItemCJK ) ||
1193 !swhtml_css1atr_equalFontItems( *pItem, *pItemCTL ) ||
1194 !swhtml_css1atr_equalFontItems( *pItemCJK, *pItemCTL ) )
1195 return true;
1196 }
1197 else
1198 {
1199 if( *pItem != *pItemCJK ||
1200 *pItem != *pItemCTL ||
1201 *pItemCJK != *pItemCTL )
1202 return true;
1203 }
1204 }
1205 }
1206
1207 const SwFormatDrop *pDrop;
1208 if( bCheckDropCap &&
1209 (pDrop = rItemSet.GetItemIfSet( RES_PARATR_DROP )) )
1210 {
1211 const SwCharFormat *pDCCharFormat = pDrop->GetCharFormat();
1212 if( pDCCharFormat )
1213 {
1214 //sequence of (start, end) property ranges we want to
1215 //query
1223 aTstItemSet(*pDCCharFormat->GetAttrSet().GetPool());
1224 aTstItemSet.Set( pDCCharFormat->GetAttrSet() );
1225 return HasScriptDependentItems( aTstItemSet, false );
1226 }
1227 }
1228
1229 return false;
1230}
1231
1232static bool OutCSS1Rule( SwHTMLWriter& rWrt, const OUString& rSelector,
1233 const SfxItemSet& rItemSet, bool bHasClass,
1234 bool bCheckForPseudo )
1235{
1236 bool bScriptDependent = false;
1237 if( SwHTMLWriter::HasScriptDependentItems( rItemSet, bHasClass ) )
1238 {
1239 bScriptDependent = true;
1240 std::u16string_view aSelector( rSelector );
1241
1242 std::u16string_view aPseudo;
1243 if( bCheckForPseudo )
1244 {
1245 size_t nPos = aSelector.rfind( ':' );
1246 if( nPos != std::u16string_view::npos )
1247 {
1248 aPseudo = aSelector.substr( nPos );
1249 aSelector =aSelector.substr( 0, nPos );
1250 }
1251 }
1252
1253 if( !bHasClass )
1254 {
1255 // If we are exporting styles for a tag we have to export a tag
1256 // rule for all properties that aren't style dependent and
1257 // some class rule for the additional style dependen properties
1258 {
1260 &rSelector );
1261 rWrt.OutCSS1_SfxItemSet( rItemSet, false );
1262 }
1263
1264 //sequence of (start, end) property ranges we want to
1265 //query
1270 aScriptItemSet( *rItemSet.GetPool() );
1271 aScriptItemSet.Put( rItemSet );
1272
1273 OUString aNewSelector = OUString::Concat(aSelector) + ".western" + aPseudo;
1274 {
1276 &aNewSelector );
1277 rWrt.OutCSS1_SfxItemSet( aScriptItemSet, false );
1278 }
1279
1280 aNewSelector = OUString::Concat(aSelector) + ".cjk" + aPseudo;
1281 {
1282 SwCSS1OutMode aMode( rWrt, CSS1_OUTMODE_CJK|CSS1_OUTMODE_RULE|CSS1_OUTMODE_TEMPLATE,
1283 &aNewSelector );
1284 rWrt.OutCSS1_SfxItemSet( aScriptItemSet, false );
1285 }
1286
1287 aNewSelector = OUString::Concat(aSelector) + ".ctl" + aPseudo;
1288 {
1289 SwCSS1OutMode aMode( rWrt, CSS1_OUTMODE_CTL|CSS1_OUTMODE_RULE|CSS1_OUTMODE_TEMPLATE,
1290 &aNewSelector );
1291 rWrt.OutCSS1_SfxItemSet( aScriptItemSet, false );
1292 }
1293 }
1294 else
1295 {
1296 // If there are script dependencies and we are derived from a tag,
1297 // when we have to export a style dependent class for all
1298 // scripts
1299 OUString aNewSelector = OUString::Concat(aSelector) + "-western" + aPseudo;
1300 {
1302 &aNewSelector );
1303 rWrt.OutCSS1_SfxItemSet( rItemSet, false );
1304 }
1305
1306 aNewSelector = OUString::Concat(aSelector) + "-cjk" + aPseudo;
1307 {
1308 SwCSS1OutMode aMode( rWrt, CSS1_OUTMODE_CJK|CSS1_OUTMODE_RULE|CSS1_OUTMODE_TEMPLATE,
1309 &aNewSelector );
1310 rWrt.OutCSS1_SfxItemSet( rItemSet, false );
1311 }
1312
1313 aNewSelector = OUString::Concat(aSelector) + "-ctl" + aPseudo;
1314 {
1315 SwCSS1OutMode aMode( rWrt, CSS1_OUTMODE_CTL|CSS1_OUTMODE_RULE|CSS1_OUTMODE_TEMPLATE,
1316 &aNewSelector );
1317 rWrt.OutCSS1_SfxItemSet( rItemSet, false );
1318 }
1319 }
1320 }
1321 else
1322 {
1323 // If there are no script dependencies, when all items are
1324 // exported in one step. For hyperlinks only, a script information
1325 // must be there, because these two chr formats don't support
1326 // script dependencies by now.
1327 SwCSS1OutMode aMode( rWrt,
1329 &rSelector );
1330 rWrt.OutCSS1_SfxItemSet( rItemSet, false );
1331 }
1332
1333 return bScriptDependent;
1334}
1335
1337 SwHTMLWriter& rWrt, const OUString& rSelector,
1338 const SwFormatDrop& rDrop, bool bHasClass,
1339 bool bHasScriptDependencies )
1340{
1341 const SwCharFormat *pDCCharFormat = rDrop.GetCharFormat();
1342 if( (bHasScriptDependencies && bHasClass) ||
1343 (pDCCharFormat && SwHTMLWriter::HasScriptDependentItems( pDCCharFormat->GetAttrSet(), false ) ) )
1344 {
1345 std::u16string_view aSelector( rSelector );
1346
1347 std::u16string_view aPseudo;
1348 size_t nPos = aSelector.rfind( ':' );
1349 if( nPos != std::u16string_view::npos )
1350 {
1351 aPseudo = aSelector.substr( nPos );
1352 aSelector = aSelector.substr( 0, nPos );
1353 }
1354
1355 if( !bHasClass )
1356 {
1357 // If we are exporting styles for a tag we have to export a tag
1358 // rule for all properties that aren't style dependent and
1359 // some class rule for the additional style dependen properties
1360 {
1362 &rSelector );
1363 OutCSS1_SwFormatDropAttrs( rWrt, rDrop );
1364 }
1365
1370 aScriptItemSet( rWrt.m_pDoc->GetAttrPool() );
1371 if( pDCCharFormat )
1372 aScriptItemSet.Set( pDCCharFormat->GetAttrSet() );
1373
1374 OUString aNewSelector = OUString::Concat(aSelector) + ".western" + aPseudo;
1375 {
1377 &aNewSelector );
1378 OutCSS1_SwFormatDropAttrs( rWrt, rDrop, &aScriptItemSet );
1379 }
1380
1381 aNewSelector = OUString::Concat(aSelector) + ".cjk" + aPseudo;
1382 {
1383 SwCSS1OutMode aMode( rWrt, CSS1_OUTMODE_CJK|CSS1_OUTMODE_RULE|CSS1_OUTMODE_DROPCAP,
1384 &aNewSelector );
1385 OutCSS1_SwFormatDropAttrs( rWrt, rDrop, &aScriptItemSet );
1386 }
1387
1388 aNewSelector = OUString::Concat(aSelector) + ".ctl" + aPseudo;
1389 {
1390 SwCSS1OutMode aMode( rWrt, CSS1_OUTMODE_CTL|CSS1_OUTMODE_RULE|CSS1_OUTMODE_DROPCAP,
1391 &aNewSelector );
1392 OutCSS1_SwFormatDropAttrs( rWrt, rDrop, &aScriptItemSet );
1393 }
1394 }
1395 else
1396 {
1397 // If there are script dependencies and we are derived from a tag,
1398 // when we have to export a style dependent class for all
1399 // scripts
1400 OUString aNewSelector = OUString::Concat(aSelector) + "-western" + aPseudo;
1401 {
1403 &aNewSelector );
1404 OutCSS1_SwFormatDropAttrs( rWrt, rDrop );
1405 }
1406
1407 aNewSelector = OUString::Concat(aSelector) + "-cjk" + aPseudo;
1408 {
1409 SwCSS1OutMode aMode( rWrt, CSS1_OUTMODE_CJK|CSS1_OUTMODE_RULE|CSS1_OUTMODE_DROPCAP,
1410 &aNewSelector );
1411 OutCSS1_SwFormatDropAttrs( rWrt, rDrop );
1412 }
1413
1414 aNewSelector = OUString::Concat(aSelector) + "-ctl" + aPseudo;
1415 {
1416 SwCSS1OutMode aMode( rWrt, CSS1_OUTMODE_CTL|CSS1_OUTMODE_RULE|CSS1_OUTMODE_DROPCAP,
1417 &aNewSelector );
1418 OutCSS1_SwFormatDropAttrs( rWrt, rDrop );
1419 }
1420 }
1421 }
1422 else
1423 {
1424 // If there are no script dependencies, when all items are
1425 // exported in one step. For hyperlinks only, a script information
1426 // must be there, because these two chr formats don't support
1427 // script dependencies by now.
1428 SwCSS1OutMode aMode( rWrt,
1430 &rSelector );
1431 OutCSS1_SwFormatDropAttrs( rWrt, rDrop );
1432 }
1433}
1434
1436 IDocumentStylePoolAccess/*SwDoc*/ *pDoc, SwDoc *pTemplate )
1437{
1438 bool bCharFormat = false;
1439 switch( rFormat.Which() )
1440 {
1441 case RES_CHRFMT:
1442 bCharFormat = true;
1443 break;
1444
1445 case RES_TXTFMTCOLL:
1446 case RES_CONDTXTFMTCOLL:
1447 // these template-types can be exported
1448 break;
1449
1450 default:
1451 // but not these
1452 return rWrt;
1453 }
1454
1455 // determine Selector and the to-be-exported Attr-Set-depth
1456 OUString aSelector;
1457 sal_uInt16 nRefPoolId = 0;
1458 sal_uInt16 nDeep = GetCSS1Selector( &rFormat, aSelector, nRefPoolId );
1459 if( !nDeep )
1460 return rWrt; // not derived from a HTML-template
1461
1462 sal_uInt16 nPoolFormatId = rFormat.GetPoolFormatId();
1463
1464 // Determine the to-be-exported Attr-Set. We have to distinguish 3 cases:
1465 // - HTML-Tag templates (nDeep==USHRT_MAX):
1466 // Export Attrs...
1467 // - that are set in the template, but not in the original of the HTML template
1468 // - the Default-Attrs for the Attrs, that are set in the Original of the
1469 // HTML template, but not in the current template.
1470 // - templates directly derived from HTML templates (nDeep==1):
1471 // Export only Attributes of the template Item-Set w/o its parents.
1472 // - templates in-directly derived from HTML templates (nDeep>1):
1473 // Export Attributes of the template Item-Set incl. its Parents,
1474 // but w/o Attributes that are set in the HTML-Tag template.
1475
1476 // create Item-Set with all Attributes from the template
1477 // (all but for nDeep==1)
1478 const SfxItemSet& rFormatItemSet = rFormat.GetAttrSet();
1479 SfxItemSet aItemSet( *rFormatItemSet.GetPool(), rFormatItemSet.GetRanges() );
1480 aItemSet.Set( rFormatItemSet ); // Was nDeep!=1 that is not working
1481 // for script dependent items but should
1482 // not make a difference for any other
1483
1484 bool bSetDefaults = true, bClearSame = true;
1485 const SwFormat *pRefFormat = nullptr;
1486 const SwFormat *pRefFormatScript = nullptr;
1487 switch( nDeep )
1488 {
1489 case CSS1_FMT_ISTAG:
1490 pRefFormat = SwHTMLWriter::GetTemplateFormat( nRefPoolId, pTemplate == nullptr ? nullptr : &pTemplate->getIDocumentStylePoolAccess() );
1491 break;
1492 case CSS1_FMT_CMPREF:
1493 pRefFormat = SwHTMLWriter::GetTemplateFormat( nRefPoolId, pDoc );
1494 pRefFormatScript = SwHTMLWriter::GetTemplateFormat( nRefPoolId, pTemplate == nullptr ? nullptr : &pTemplate->getIDocumentStylePoolAccess() );
1495 bClearSame = false;
1496 break;
1497 default:
1498 pRefFormat = SwHTMLWriter::GetParentFormat( rFormat, nDeep );
1499 pRefFormatScript = SwHTMLWriter::GetTemplateFormat( nRefPoolId, pTemplate == nullptr ? nullptr : &pTemplate->getIDocumentStylePoolAccess() );
1500 bSetDefaults = false;
1501 break;
1502 }
1503
1504 if( pRefFormat )
1505 {
1506 // subtract Item-Set of the Reference template (incl. its Parents)
1507 SwHTMLWriter::SubtractItemSet( aItemSet, pRefFormat->GetAttrSet(),
1508 bSetDefaults, bClearSame,
1509 pRefFormatScript
1510 ? &pRefFormatScript->GetAttrSet()
1511 : nullptr );
1512
1513 if( !bCharFormat )
1514 {
1515 const SvxULSpaceItem& rULItem = pRefFormat->GetULSpace();
1516 rWrt.m_nDfltTopMargin = rULItem.GetUpper();
1517 rWrt.m_nDfltBottomMargin = rULItem.GetLower();
1518 }
1519 }
1520 else if( CSS1_FMT_ISTAG==nDeep && !bCharFormat )
1521 {
1522 // set Default-distance above and below (for the
1523 // case that there is no reference template)
1524 rWrt.m_nDfltTopMargin = 0;
1526 if( USER_FMT & nPoolFormatId )
1527 {
1528 // user templates
1529 const OUString& aNm(rFormat.GetName());
1530
1531 if (aNm == "DD 1" || aNm == "DT 1")
1532 rWrt.m_nDfltBottomMargin = 0;
1533 else if (aNm == OOO_STRING_SVTOOLS_HTML_listing)
1534 rWrt.m_nDfltBottomMargin = 0;
1535 else if (aNm == OOO_STRING_SVTOOLS_HTML_preformtxt)
1536 rWrt.m_nDfltBottomMargin = 0;
1537 else if (aNm == OOO_STRING_SVTOOLS_HTML_xmp)
1538 rWrt.m_nDfltBottomMargin = 0;
1539 }
1540 else
1541 {
1542 // Pool templates
1543 switch( nPoolFormatId )
1544 {
1552 break;
1557 rWrt.m_nDfltBottomMargin = 0;
1558 break;
1559 }
1560 }
1561 }
1562
1563 // if nothing is to be exported ...
1564 if( !aItemSet.Count() )
1565 return rWrt;
1566
1567 // There is no support for script dependent hyperlinks by now.
1568 bool bCheckForPseudo = false;
1569 if( bCharFormat &&
1570 (RES_POOLCHR_INET_NORMAL==nRefPoolId ||
1571 RES_POOLCHR_INET_VISIT==nRefPoolId) )
1572 bCheckForPseudo = true;
1573
1574 // export now the Attributes (incl. selector)
1575 bool bHasScriptDependencies = false;
1576 if( OutCSS1Rule( rWrt, aSelector, aItemSet, CSS1_FMT_ISTAG != nDeep,
1577 bCheckForPseudo ) )
1578 {
1579 if( bCharFormat )
1580 rWrt.m_aScriptTextStyles.insert( rFormat.GetName() );
1581 else
1582 {
1583 if( nPoolFormatId==RES_POOLCOLL_TEXT )
1584 rWrt.m_aScriptParaStyles.insert( pDoc->GetTextCollFromPool( RES_POOLCOLL_STANDARD, false )->GetName() );
1585 rWrt.m_aScriptParaStyles.insert( rFormat.GetName() );
1586 }
1587 bHasScriptDependencies = true;
1588 }
1589
1590 // export Drop-Caps
1591 if( const SwFormatDrop *pDrop = aItemSet.GetItemIfSet( RES_PARATR_DROP, false ) )
1592 {
1593 OUString sOut = aSelector +
1594 ":" + OStringToOUString( sCSS1_first_letter, RTL_TEXTENCODING_ASCII_US );
1595 OutCSS1DropCapRule( rWrt, sOut, *pDrop, CSS1_FMT_ISTAG != nDeep, bHasScriptDependencies );
1596 }
1597
1598 return rWrt;
1599}
1600
1602 IDocumentStylePoolAccess/*SwDoc*/ *pDoc, SwDoc *pTemplate,
1603 sal_uInt16 nRefPoolId, bool bExtRef,
1604 bool bPseudo )
1605{
1606 const SwPageDesc* pRefPageDesc = nullptr;
1607 if( !bExtRef )
1608 pRefPageDesc = pDoc->GetPageDescFromPool( nRefPoolId, false );
1609 else if( pTemplate )
1610 pRefPageDesc = pTemplate->getIDocumentStylePoolAccess().GetPageDescFromPool( nRefPoolId, false );
1611
1612 OUString aSelector = "@" + OStringToOUString( sCSS1_page, RTL_TEXTENCODING_ASCII_US );
1613
1614 if( bPseudo )
1615 {
1616 std::string_view pPseudo;
1617 switch( rPageDesc.GetPoolFormatId() )
1618 {
1619 case RES_POOLPAGE_FIRST: pPseudo = sCSS1_first; break;
1620 case RES_POOLPAGE_LEFT: pPseudo = sCSS1_left; break;
1621 case RES_POOLPAGE_RIGHT: pPseudo = sCSS1_right; break;
1622 }
1623 if( !pPseudo.empty() )
1624 aSelector += ":" + OStringToOUString( pPseudo, RTL_TEXTENCODING_ASCII_US );
1625 }
1626
1627 SwCSS1OutMode aMode( rWrt, CSS1_OUTMODE_RULE_ON|CSS1_OUTMODE_TEMPLATE,
1628 &aSelector );
1629
1630 // Size: If the only difference is the Landscape-Flag,
1631 // only export Portrait or Landscape. Otherwise export size.
1632 bool bRefLandscape = pRefPageDesc && pRefPageDesc->GetLandscape();
1633 Size aRefSz;
1634 const Size& rSz = rPageDesc.GetMaster().GetFrameSize().GetSize();
1635 if( pRefPageDesc )
1636 {
1637 aRefSz = pRefPageDesc->GetMaster().GetFrameSize().GetSize();
1638 if( bRefLandscape != rPageDesc.GetLandscape() )
1639 {
1640 tools::Long nTmp = aRefSz.Height();
1641 aRefSz.setHeight( aRefSz.Width() );
1642 aRefSz.setWidth( nTmp );
1643 }
1644 }
1645
1646 // TODO: Bad Hack: On the Page-Tabpage there are small rounding errors
1647 // for the page size. Partially because of bug 25535, we stupidly still
1648 // use the Size-Item from Dialog, even if nothing changed.
1649 // Thus: once one visited the Page-Dialog and left it with OK, we get a
1650 // new page size that then gets exported here. To avoid that, we allow
1651 // here small deviations.
1652 if( std::abs( rSz.Width() - aRefSz.Width() ) <= 2 &&
1653 std::abs( rSz.Height() - aRefSz.Height() ) <= 2 )
1654 {
1655 if( bRefLandscape != rPageDesc.GetLandscape() )
1656 {
1658 rPageDesc.GetLandscape() ? sCSS1_PV_landscape
1660 }
1661 }
1662 else
1663 {
1664 OStringBuffer sVal;
1665 AddUnitPropertyValue(sVal, rSz.Width(), rWrt.GetCSS1Unit());
1666 sVal.append(' ');
1667 AddUnitPropertyValue(sVal, rSz.Height(), rWrt.GetCSS1Unit());
1669 }
1670
1671 // Export the distance-Attributes as normally
1672 const SwFrameFormat &rMaster = rPageDesc.GetMaster();
1674 aItemSet.Set( rMaster.GetAttrSet() );
1675
1676 if( pRefPageDesc )
1677 {
1679 pRefPageDesc->GetMaster().GetAttrSet(),
1680 true );
1681 }
1682
1683 OutCSS1_SvxULSpace_SvxLRSpace( rWrt, aItemSet );
1684
1685 // If for a Pseudo-Selector no Property had been set, we still
1686 // have to export something, so that the corresponding template is
1687 // created on the next import.
1688 if( rWrt.m_bFirstCSS1Property && bPseudo )
1689 {
1690 rWrt.OutNewLine();
1691 OString sTmp(OUStringToOString(aSelector, RTL_TEXTENCODING_UTF8));
1692 rWrt.Strm().WriteOString( sTmp ).WriteOString( " {" );
1693 rWrt.m_bFirstCSS1Property = false;
1694 }
1695
1696 if( !rWrt.m_bFirstCSS1Property )
1697 rWrt.Strm().WriteOString( sCSS1_rule_end );
1698
1699 return rWrt;
1700}
1701
1703 SwDoc *pDoc, bool bHasNotes, bool bEndNote )
1704{
1705 OUString aSelector;
1706
1707 if( bHasNotes )
1708 {
1709 aSelector = OUString::Concat(OOO_STRING_SVTOOLS_HTML_anchor ".") +
1710 ( bEndNote ? std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_sdendnote_anc)
1711 : std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_sdfootnote_anc) );
1712 SwCSS1OutMode aMode( rWrt, CSS1_OUTMODE_RULE|CSS1_OUTMODE_TEMPLATE,
1713 &aSelector );
1715 sHTML_FTN_fontheight );
1716 rWrt.Strm().WriteOString( sCSS1_rule_end );
1717 }
1718
1719 const SwCharFormat *pSymCharFormat = rInfo.GetCharFormat( *pDoc );
1720 if( pSymCharFormat )
1721 {
1722 const SfxItemSet& rFormatItemSet = pSymCharFormat->GetAttrSet();
1723 SfxItemSet aItemSet( *rFormatItemSet.GetPool(), rFormatItemSet.GetRanges() );
1724 aItemSet.Set( rFormatItemSet );
1725
1726 // If there are footnotes or endnotes, then all Attributes have to be
1727 // exported, so that Netscape displays the document correctly.
1728 // Otherwise it is sufficient, to export the differences to the
1729 // footnote and endnote template.
1730 if( !bHasNotes && rWrt.m_xTemplate.is() )
1731 {
1732 SwFormat *pRefFormat = rWrt.m_xTemplate->getIDocumentStylePoolAccess().GetCharFormatFromPool(
1733 static_cast< sal_uInt16 >(bEndNote ? RES_POOLCHR_ENDNOTE : RES_POOLCHR_FOOTNOTE) );
1734 if( pRefFormat )
1735 SwHTMLWriter::SubtractItemSet( aItemSet, pRefFormat->GetAttrSet(),
1736 true );
1737 }
1738 if( aItemSet.Count() )
1739 {
1740 aSelector = OUString::Concat(OOO_STRING_SVTOOLS_HTML_anchor ".") +
1741 ( bEndNote ? std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_sdendnote_sym)
1742 : std::u16string_view(
1744 if( OutCSS1Rule( rWrt, aSelector, aItemSet, true, false ))
1745 rWrt.m_aScriptTextStyles.insert( pSymCharFormat->GetName() );
1746 }
1747 }
1748
1749 return rWrt;
1750}
1751
1753{
1754 SwCSS1OutMode aMode( rWrt, CSS1_OUTMODE_STYLE_OPT_ON |
1756
1757 // Only export the attributes of the page template.
1758 // The attributes of the default paragraph template were
1759 // considered already when exporting the paragraph template.
1760
1761 const SfxPoolItem *pItem;
1762 if( SfxItemState::SET == rItemSet.GetItemState( RES_BACKGROUND, false,
1763 &pItem ) )
1764 {
1765 OUString rEmbeddedGraphicName;
1766 OutCSS1_SvxBrush( rWrt, *pItem, sw::Css1Background::Page, &rEmbeddedGraphicName );
1767 }
1768
1769 if( SfxItemState::SET == rItemSet.GetItemState( RES_BOX, false,
1770 &pItem ))
1771 {
1772 OutCSS1_SvxBox( rWrt, *pItem );
1773 }
1774
1775 if( !rWrt.m_bFirstCSS1Property )
1776 {
1777 // if a Property was exported as part of a Style-Option,
1778 // the Option still needs to be finished
1779 rWrt.Strm().WriteChar( '\"' );
1780 }
1781
1782 return rWrt;
1783}
1784
1786{
1787 SwCSS1OutMode aMode( rWrt, rWrt.m_nCSS1Script|CSS1_OUTMODE_STYLE_OPT |
1789 rWrt.OutCSS1_SfxItemSet( rItemSet, false );
1790
1791 return rWrt;
1792}
1793
1795{
1796 SwCSS1OutMode aMode( rWrt, CSS1_OUTMODE_STYLE_OPT_ON |
1798 CSS1_OUTMODE_TABLEBOX, nullptr );
1799 OutCSS1_SvxBrush( rWrt, rHt, sw::Css1Background::TableRow, nullptr );
1800
1801 if (!rWrt.m_bFirstCSS1Property)
1802 rWrt.Strm().WriteChar(cCSS1_style_opt_end);
1803
1804 return rWrt;
1805}
1806
1808 sal_uInt8 nLevel )
1809{
1810 SwCSS1OutMode aMode( rWrt, CSS1_OUTMODE_STYLE_OPT |
1812
1813 const SwNumFormat& rNumFormat = rNumRule.Get( nLevel );
1814
1815 tools::Long nLSpace = rNumFormat.GetAbsLSpace();
1817 tools::Long nDfltFirstLineOffset = HTML_NUMBER_BULLET_INDENT;
1818 if( nLevel > 0 )
1819 {
1820 const SwNumFormat& rPrevNumFormat = rNumRule.Get( nLevel-1 );
1821 nLSpace -= rPrevNumFormat.GetAbsLSpace();
1822 nDfltFirstLineOffset = rPrevNumFormat.GetFirstLineOffset();
1823 }
1824
1828
1830 nFirstLineOffset != nDfltFirstLineOffset )
1832
1833 if( !rWrt.m_bFirstCSS1Property )
1834 rWrt.Strm().WriteChar( '\"' );
1835
1836 return rWrt;
1837}
1838
1840 HtmlFrmOpts nFrameOpts,
1841 const SdrObject *pSdrObj,
1842 const SfxItemSet *pItemSet )
1843{
1844 SwCSS1OutMode aMode( *this, CSS1_OUTMODE_STYLE_OPT_ON |
1846 CSS1_OUTMODE_FRAME, nullptr );
1847
1848 const SwFormatHoriOrient& rHoriOri = rFrameFormat.GetHoriOrient();
1849 SvxLRSpaceItem aLRItem( rFrameFormat.GetLRSpace() );
1850 SvxULSpaceItem aULItem( rFrameFormat.GetULSpace() );
1851 if( nFrameOpts & HtmlFrmOpts::SAlign )
1852 {
1853 const SwFormatAnchor& rAnchor = rFrameFormat.GetAnchor();
1854 switch( rAnchor.GetAnchorId() )
1855 {
1856 case RndStdIds::FLY_AT_PARA:
1857 case RndStdIds::FLY_AT_CHAR:
1858 if( text::RelOrientation::FRAME == rHoriOri.GetRelationOrient() ||
1859 text::RelOrientation::PRINT_AREA == rHoriOri.GetRelationOrient() )
1860 {
1861 if( !(nFrameOpts & HtmlFrmOpts::Align) )
1862 {
1863 // float
1864 std::string_view pStr = text::HoriOrientation::RIGHT==rHoriOri.GetHoriOrient()
1866 : sCSS1_PV_left;
1868 }
1869 break;
1870 }
1871 [[fallthrough]];
1872
1873 case RndStdIds::FLY_AT_PAGE:
1874 case RndStdIds::FLY_AT_FLY:
1875 {
1876 // position
1878
1879 // For top/left we need to subtract the distance to the frame
1880 // from the position, as in CSS1 it is added to the position.
1881 // This works also for automatically aligned frames, even that
1882 // in this case Writer also adds the distance; because in this
1883 // case the Orient-Attribute contains the correct position.
1884
1885 // top
1886 tools::Long nXPos=0, nYPos=0;
1887 bool bOutXPos = false, bOutYPos = false;
1888 if( RES_DRAWFRMFMT == rFrameFormat.Which() )
1889 {
1890 OSL_ENSURE( pSdrObj, "Do not pass a SdrObject. Inefficient" );
1891 if( !pSdrObj )
1892 pSdrObj = rFrameFormat.FindSdrObject();
1893 OSL_ENSURE( pSdrObj, "Where is the SdrObject" );
1894 if( pSdrObj )
1895 {
1896 Point aPos( pSdrObj->GetRelativePos() );
1897 nXPos = aPos.X();
1898 nYPos = aPos.Y();
1899 }
1900 bOutXPos = bOutYPos = true;
1901 }
1902 else
1903 {
1904 bOutXPos = text::RelOrientation::CHAR != rHoriOri.GetRelationOrient();
1905 nXPos = text::HoriOrientation::NONE == rHoriOri.GetHoriOrient()
1906 ? rHoriOri.GetPos() : 0;
1907
1908 const SwFormatVertOrient& rVertOri = rFrameFormat.GetVertOrient();
1909 bOutYPos = text::RelOrientation::CHAR != rVertOri.GetRelationOrient();
1910 nYPos = text::VertOrientation::NONE == rVertOri.GetVertOrient()
1911 ? rVertOri.GetPos() : 0;
1912 }
1913
1914 if( bOutYPos )
1915 {
1917 {
1918 nYPos -= aULItem.GetUpper();
1919 if( nYPos < 0 )
1920 {
1921 aULItem.SetUpper( o3tl::narrowing<sal_uInt16>(aULItem.GetUpper() + nYPos) );
1922 nYPos = 0;
1923 }
1924 }
1925
1927 }
1928
1929 if( bOutXPos )
1930 {
1931 // left
1933 {
1934 nXPos -= aLRItem.GetLeft();
1935 if( nXPos < 0 )
1936 {
1937 aLRItem.SetLeft( o3tl::narrowing<sal_uInt16>(aLRItem.GetLeft() + nXPos) );
1938 nXPos = 0;
1939 }
1940 }
1941
1943 }
1944 }
1945 break;
1946
1947 default:
1948 ;
1949 }
1950 }
1951
1952 // width/height
1953 if( nFrameOpts & HtmlFrmOpts::SSize )
1954 {
1955 if( RES_DRAWFRMFMT == rFrameFormat.Which() )
1956 {
1957 OSL_ENSURE( pSdrObj, "Do not pass a SdrObject. Inefficient" );
1958 if( !pSdrObj )
1959 pSdrObj = rFrameFormat.FindSdrObject();
1960 OSL_ENSURE( pSdrObj, "Where is the SdrObject" );
1961 if( pSdrObj )
1962 {
1963 Size aTwipSz( pSdrObj->GetLogicRect().GetSize() );
1964 if( nFrameOpts & HtmlFrmOpts::SWidth )
1965 {
1966 if( nFrameOpts & HtmlFrmOpts::SPixSize )
1968 false );
1969 else
1971 }
1972 if( nFrameOpts & HtmlFrmOpts::SHeight )
1973 {
1974 if( nFrameOpts & HtmlFrmOpts::SPixSize )
1976 true );
1977 else
1979 }
1980 }
1981 }
1982 else
1983 {
1984 OSL_ENSURE( HtmlFrmOpts::AbsSize & nFrameOpts,
1985 "Export absolute size" );
1986 OSL_ENSURE( HtmlFrmOpts::AnySize & nFrameOpts,
1987 "Export every size" );
1988 Css1FrameSize nMode = Css1FrameSize::NONE;
1989 if( nFrameOpts & HtmlFrmOpts::SWidth )
1990 nMode |= Css1FrameSize::Width;
1991 if( nFrameOpts & HtmlFrmOpts::SHeight )
1992 nMode |= Css1FrameSize::MinHeight|Css1FrameSize::FixHeight;
1993 if( nFrameOpts & HtmlFrmOpts::SPixSize )
1994 nMode |= Css1FrameSize::Pixel;
1995
1996 OutCSS1_SwFormatFrameSize( *this, rFrameFormat.GetFrameSize(), nMode );
1997 }
1998 }
1999
2000 const SfxItemSet& rItemSet = rFrameFormat.GetAttrSet();
2001 // margin-*
2002 if( (nFrameOpts & HtmlFrmOpts::SSpace) &&
2004 {
2005 const SvxLRSpaceItem *pLRItem = nullptr;
2006 const SvxULSpaceItem *pULItem = nullptr;
2007 if( SfxItemState::SET == rItemSet.GetItemState( RES_LR_SPACE ) )
2008 pLRItem = &aLRItem;
2009 if( SfxItemState::SET == rItemSet.GetItemState( RES_UL_SPACE ) )
2010 pULItem = &aULItem;
2011 if( pLRItem || pULItem )
2012 OutCSS1_SvxULSpace_SvxLRSpace( *this, pULItem, pLRItem );
2013 }
2014
2015 // border
2016 if( nFrameOpts & HtmlFrmOpts::SBorder )
2017 {
2018 const SfxPoolItem* pItem;
2019 if( nFrameOpts & HtmlFrmOpts::SNoBorder )
2020 OutCSS1_SvxBox( *this, rFrameFormat.GetBox() );
2021 else if( SfxItemState::SET==rItemSet.GetItemState( RES_BOX, true, &pItem ) )
2022 OutCSS1_SvxBox( *this, *pItem );
2023 }
2024
2025 // background (if, then the color must be set also)
2026 if( nFrameOpts & HtmlFrmOpts::SBackground )
2027 OutCSS1_FrameFormatBackground( rFrameFormat );
2028
2029 if( pItemSet )
2030 OutCSS1_SfxItemSet( *pItemSet, false );
2031
2033 Strm().WriteChar( '\"' );
2034}
2035
2037{
2038 SwCSS1OutMode aMode( *this, CSS1_OUTMODE_STYLE_OPT_ON |
2040 CSS1_OUTMODE_TABLE, nullptr );
2041
2042 const SfxPoolItem *pItem;
2043 const SfxItemSet& rItemSet = rFrameFormat.GetAttrSet();
2044 if( SfxItemState::SET==rItemSet.GetItemState( RES_BACKGROUND, false, &pItem ) )
2045 OutCSS1_SvxBrush( *this, *pItem, sw::Css1Background::Table, nullptr );
2046
2049
2050 if( SfxItemState::SET==rItemSet.GetItemState( RES_LAYOUT_SPLIT, false, &pItem ) )
2051 OutCSS1_SwFormatLayoutSplit( *this, *pItem );
2052
2053 if (mbXHTML)
2054 {
2055 sal_Int16 eTabHoriOri = rFrameFormat.GetHoriOrient().GetHoriOrient();
2056 if (eTabHoriOri == text::HoriOrientation::CENTER)
2057 {
2058 // Emit XHTML's center using inline CSS.
2061 }
2062 }
2063
2065 Strm().WriteChar( '\"' );
2066}
2067
2069{
2070 SwCSS1OutMode const aMode( *this,
2072 if (pBrushItem)
2073 OutCSS1_SvxBrush(*this, *pBrushItem, sw::Css1Background::TableCell, nullptr);
2074 OutCSS1_SvxBox(*this, rFrameFormat.GetBox());
2076 Strm().WriteChar(cCSS1_style_opt_end);
2077}
2078
2080{
2081 SwCSS1OutMode aMode( *this, CSS1_OUTMODE_STYLE_OPT_ON |
2083 CSS1_OUTMODE_SECTION, nullptr );
2084
2085 const SfxPoolItem *pItem;
2086 const SfxItemSet& rItemSet = rFrameFormat.GetAttrSet();
2087 if( SfxItemState::SET==rItemSet.GetItemState( RES_BACKGROUND, false, &pItem ) )
2088 OutCSS1_SvxBrush( *this, *pItem, sw::Css1Background::Section, nullptr );
2089
2090 if (mbXHTML)
2091 {
2092 SvxFrameDirection nDir = GetHTMLDirection(rFrameFormat.GetAttrSet());
2093 OString sConvertedDirection = convertDirection(nDir);
2094 if (!sConvertedDirection.isEmpty())
2095 {
2096 OutCSS1_Property(sCSS1_P_dir, sConvertedDirection, nullptr,
2098 }
2099 }
2100
2101 if (pCol)
2102 {
2103 OString sColumnCount(OString::number(static_cast<sal_Int32>(pCol->GetNumCols())));
2105 }
2106
2108 Strm().WriteChar( '\"' );
2109}
2110
2112 const SvxBrushItem& rBrushItem )
2113{
2114 bool bWritten = false;
2117 if( rBrushItem.GetColor() != COL_TRANSPARENT ||
2118 !rBrushItem.GetGraphicLink().isEmpty() ||
2119 0 != rBrushItem.GetGraphicPos() )
2120 {
2121 OutCSS1_SvxBrush( rWrt, rBrushItem, sw::Css1Background::Fly, nullptr );
2122 bWritten = true;
2123 }
2124 return bWritten;
2125}
2126
2128{
2129 // If the frame itself has a background, then export.
2130 if( OutCSS1_FrameFormatBrush( *this, *rFrameFormat.makeBackgroundBrushItem() ) )
2131 return;
2132
2133 // If the frame is not linked to a page, we use the background of the anchor.
2134 const SwFormatAnchor& rAnchor = rFrameFormat.GetAnchor();
2135 RndStdIds eAnchorId = rAnchor.GetAnchorId();
2136 const SwNode *pAnchorNode = rAnchor.GetAnchorNode();
2137 if (RndStdIds::FLY_AT_PAGE != eAnchorId && pAnchorNode)
2138 {
2139 if( pAnchorNode->IsContentNode() )
2140 {
2141 // If the frame is linked to a content-node,
2142 // we take the background of the content-node, if it has one.
2143 if( OutCSS1_FrameFormatBrush( *this,
2144 pAnchorNode->GetContentNode()->GetSwAttrSet().GetBackground()) )
2145 return;
2146
2147 // Otherwise we also could be in a table
2148 const SwTableNode *pTableNd = pAnchorNode->FindTableNode();
2149 if( pTableNd )
2150 {
2151 const SwStartNode *pBoxSttNd = pAnchorNode->FindTableBoxStartNode();
2152 const SwTableBox *pBox =
2153 pTableNd->GetTable().GetTableBox( pBoxSttNd->GetIndex() );
2154
2155 // If the box has a background, we take it.
2156 if( OutCSS1_FrameFormatBrush( *this,
2158 return;
2159
2160 // Otherwise we use that of the lines
2161 const SwTableLine *pLine = pBox->GetUpper();
2162 while( pLine )
2163 {
2164 if( OutCSS1_FrameFormatBrush( *this,
2166 return;
2167 pBox = pLine->GetUpper();
2168 pLine = pBox ? pBox->GetUpper() : nullptr;
2169 }
2170
2171 // If there was none either, we use the background of the table.
2172 if( OutCSS1_FrameFormatBrush( *this,
2173 *pTableNd->GetTable().GetFrameFormat()->makeBackgroundBrushItem() ) )
2174 return;
2175 }
2176
2177 }
2178
2179 // If the anchor is again in a Fly-Frame, use the background of the Fly-Frame.
2180 const SwFrameFormat *pFrameFormat = pAnchorNode->GetFlyFormat();
2181 if( pFrameFormat )
2182 {
2183 OutCSS1_FrameFormatBackground( *pFrameFormat );
2184 return;
2185 }
2186 }
2187
2188 // At last there is the background of the page, and as the final rescue
2189 // the value of the Config.
2190 OSL_ENSURE( m_pCurrPageDesc, "no page template found" );
2191 if( OutCSS1_FrameFormatBrush( *this,
2193 return;
2194
2195 Color aColor( COL_WHITE );
2196
2197 // The background color is normally only used in Browse-Mode.
2198 // We always use it for a HTML document, but for a text document
2199 // only if viewed in Browse-Mode.
2202 {
2204 if ( pVSh &&
2206 aColor = pVSh->GetViewOptions()->GetRetoucheColor();
2207 }
2208
2210}
2211
2213 const SvxUnderlineItem *pUItem,
2214 const SvxOverlineItem *pOItem,
2215 const SvxCrossedOutItem *pCOItem,
2216 const SvxBlinkItem *pBItem )
2217{
2218 bool bNone = false;
2219 OStringBuffer sOut;
2220
2221 if( pUItem )
2222 {
2223 switch( pUItem->GetLineStyle() )
2224 {
2225 case LINESTYLE_NONE:
2226 bNone = true;
2227 break;
2228 case LINESTYLE_DONTKNOW:
2229 break;
2230 default:
2231 if( !rWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) )
2232 {
2233 // this also works in HTML does not need to be written as
2234 // a STYLE-Options, and must not be written as Hint
2235 OSL_ENSURE( !rWrt.IsCSS1Source(CSS1_OUTMODE_HINT) || rWrt.mbReqIF,
2236 "write underline as Hint?" );
2237 sOut.append(sCSS1_PV_underline);
2238 }
2239 break;
2240 }
2241 }
2242
2243 if( pOItem )
2244 {
2245 switch( pOItem->GetLineStyle() )
2246 {
2247 case LINESTYLE_NONE:
2248 bNone = true;
2249 break;
2250 case LINESTYLE_DONTKNOW:
2251 break;
2252 default:
2253 if( !rWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) )
2254 {
2255 // this also works in HTML does not need to be written as
2256 // a STYLE-Options, and must not be written as Hint
2257 OSL_ENSURE( !rWrt.IsCSS1Source(CSS1_OUTMODE_HINT),
2258 "write overline as Hint?" );
2259 if (!sOut.isEmpty())
2260 sOut.append(' ');
2261 sOut.append(sCSS1_PV_overline);
2262 }
2263 break;
2264 }
2265 }
2266
2267 if( pCOItem )
2268 {
2269 switch( pCOItem->GetStrikeout() )
2270 {
2271 case STRIKEOUT_NONE:
2272 bNone = true;
2273 break;
2274 case STRIKEOUT_DONTKNOW:
2275 break;
2276 default:
2277 if( !rWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) )
2278 {
2279 // this also works in HTML does not need to be written as
2280 // a STYLE-Options, and must not be written as Hint
2281 OSL_ENSURE( !rWrt.IsCSS1Source(CSS1_OUTMODE_HINT) || rWrt.mbReqIF,
2282 "write crossedOut as Hint?" );
2283 if (!sOut.isEmpty())
2284 sOut.append(' ');
2285 sOut.append(sCSS1_PV_line_through);
2286 }
2287 break;
2288 }
2289 }
2290
2291 if( pBItem )
2292 {
2293 if( !pBItem->GetValue() )
2294 {
2295 bNone = true;
2296 }
2297 else if( !rWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) )
2298 {
2299 // this also works in HTML does not need to be written as
2300 // a STYLE-Options, and must not be written as Hint
2301 OSL_ENSURE( !rWrt.IsCSS1Source(CSS1_OUTMODE_HINT),
2302 "write blink as Hint?" );
2303 if (!sOut.isEmpty())
2304 sOut.append(' ');
2305 sOut.append(sCSS1_PV_blink);
2306 }
2307 }
2308
2309 if (!sOut.isEmpty())
2311 else if( bNone )
2313
2314 return rWrt;
2315}
2316
2318{
2319 switch( static_cast<const SvxCaseMapItem&>(rHt).GetCaseMap() )
2320 {
2321 case SvxCaseMap::NotMapped:
2323 break;
2324 case SvxCaseMap::SmallCaps:
2326 break;
2327 case SvxCaseMap::Uppercase:
2329 break;
2330 case SvxCaseMap::Lowercase:
2332 break;
2333 case SvxCaseMap::Capitalize:
2335 break;
2336 default:
2337 ;
2338 }
2339
2340 return rWrt;
2341}
2342
2344{
2345 // Colors do not need to be exported for Style-Option.
2346 if( rWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) &&
2347 !rWrt.m_bCfgPreferStyles )
2348 return rWrt;
2349 OSL_ENSURE( !rWrt.IsCSS1Source(CSS1_OUTMODE_HINT),
2350 "write color as Hint?" );
2351
2352 Color aColor( static_cast<const SvxColorItem&>(rHt).GetValue() );
2353 if( COL_AUTO == aColor )
2354 aColor = COL_BLACK;
2355
2357
2358 return rWrt;
2359}
2360
2362{
2363 // This function only exports Hints!
2364 // Otherwise OutCSS1_SvxTextLn_SvxCrOut_SvxBlink() is called directly.
2365
2368 nullptr, nullptr, static_cast<const SvxCrossedOutItem *>(&rHt), nullptr );
2369
2370 return rWrt;
2371}
2372
2374{
2375 // No need to export Fonts for the Style-Option.
2376 if( rWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) )
2377 return rWrt;
2378
2379 sal_uInt16 nScript = CSS1_OUTMODE_WESTERN;
2380 switch( rHt.Which() )
2381 {
2382 case RES_CHRATR_CJK_FONT: nScript = CSS1_OUTMODE_CJK; break;
2383 case RES_CHRATR_CTL_FONT: nScript = CSS1_OUTMODE_CTL; break;
2384 }
2385 if( !rWrt.IsCSS1Script( nScript ) )
2386 return rWrt;
2387
2388 OSL_ENSURE( !rWrt.IsCSS1Source(CSS1_OUTMODE_HINT),
2389 "write Font as Hint?" );
2390
2391 OUString sOut;
2392 // MS IE3b1 has problems with single quotes
2393 sal_uInt16 nMode = rWrt.m_nCSS1OutMode & CSS1_OUTMODE_ANY_ON;
2394 sal_Unicode cQuote = nMode == CSS1_OUTMODE_RULE_ON ? '\"' : '\'';
2395 SwHTMLWriter::PrepareFontList( static_cast<const SvxFontItem&>(rHt), sOut, cQuote,
2396 true );
2397
2399
2400 return rWrt;
2401}
2402
2404{
2405 // Font-Height need not be exported in the Style-Option.
2406 // For Drop-Caps another Font-Size is exported.
2407 if( rWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) ||
2409 return rWrt;
2410
2411 sal_uInt16 nScript = CSS1_OUTMODE_WESTERN;
2412 switch( rHt.Which() )
2413 {
2414 case RES_CHRATR_CJK_FONTSIZE: nScript = CSS1_OUTMODE_CJK; break;
2415 case RES_CHRATR_CTL_FONTSIZE: nScript = CSS1_OUTMODE_CTL; break;
2416 }
2417 if( !rWrt.IsCSS1Script( nScript ) )
2418 return rWrt;
2419
2420 sal_uInt32 nHeight = static_cast<const SvxFontHeightItem&>(rHt).GetHeight();
2421 OString sHeight(OString::number(nHeight/20) + sCSS1_UNIT_pt);
2423
2424 return rWrt;
2425}
2426
2428{
2429 sal_uInt16 nScript = CSS1_OUTMODE_WESTERN;
2430 switch( rHt.Which() )
2431 {
2432 case RES_CHRATR_CJK_POSTURE: nScript = CSS1_OUTMODE_CJK; break;
2433 case RES_CHRATR_CTL_POSTURE: nScript = CSS1_OUTMODE_CTL; break;
2434 }
2435 if( !rWrt.IsCSS1Script( nScript ) )
2436 return rWrt;
2437
2438 std::string_view pStr;
2439 switch( static_cast<const SvxPostureItem&>(rHt).GetPosture() )
2440 {
2441 case ITALIC_NONE: pStr = sCSS1_PV_normal; break;
2442 case ITALIC_OBLIQUE: pStr = sCSS1_PV_oblique; break;
2443 case ITALIC_NORMAL:
2444 if( !rWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) )
2445 {
2446 // this also works in HTML does not need to be written as
2447 // a STYLE-Options, and must not be written as Hint
2448 OSL_ENSURE( !rWrt.IsCSS1Source(CSS1_OUTMODE_HINT),
2449 "write italic as Hint?" );
2450 pStr = sCSS1_PV_italic;
2451 }
2452 break;
2453 default:
2454 ;
2455 }
2456
2457 if( !pStr.empty() )
2459
2460 return rWrt;
2461}
2462
2464{
2465 sal_Int16 nValue = static_cast<const SvxKerningItem&>(rHt).GetValue();
2466 if( nValue )
2467 {
2468 OStringBuffer sOut;
2469 if( nValue < 0 )
2470 {
2471 sOut.append('-');
2472 nValue = -nValue;
2473 }
2474
2475 // Width as n.n pt
2476 nValue = (nValue + 1) / 2; // 1/10pt
2477 sOut.append(OString::number(nValue / 10) + "." + OString::number(nValue % 10) +
2479
2481 sOut.setLength(0);
2482 }
2483 else
2484 {
2487 }
2488
2489 return rWrt;
2490}
2491
2493{
2494 // Only export Language rules
2495 if( rWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) )
2496 return rWrt;
2497
2498 sal_uInt16 nScript = CSS1_OUTMODE_WESTERN;
2499 switch( rHt.Which() )
2500 {
2501 case RES_CHRATR_CJK_LANGUAGE: nScript = CSS1_OUTMODE_CJK; break;
2502 case RES_CHRATR_CTL_LANGUAGE: nScript = CSS1_OUTMODE_CTL; break;
2503 }
2504 if( !rWrt.IsCSS1Script( nScript ) )
2505 return rWrt;
2506
2507 OSL_ENSURE( !rWrt.IsCSS1Source(CSS1_OUTMODE_HINT),
2508 "write Language as Hint?" );
2509
2510 LanguageType eLang = static_cast<const SvxLanguageItem &>(rHt).GetLanguage();
2511 if( LANGUAGE_DONTKNOW == eLang )
2512 return rWrt;
2513
2514 OUString sOut = LanguageTag::convertToBcp47( eLang );
2515
2517
2518 return rWrt;
2519}
2520
2522{
2523 // This function only exports Hints!
2524 // Otherwise OutCSS1_SvxTextLn_SvxCrOut_SvxBlink() is called directly.
2525
2528 static_cast<const SvxUnderlineItem *>(&rHt), nullptr, nullptr, nullptr );
2529
2530 return rWrt;
2531}
2532
2534{
2535 // This function only exports Hints!
2536 // Otherwise OutCSS1_SvxTextLn_SvxCrOut_SvxBlink() is called directly.
2537
2540 nullptr, static_cast<const SvxOverlineItem *>(&rHt), nullptr, nullptr );
2541
2542 return rWrt;
2543}
2544
2546{
2547 if ( static_cast<const SvxCharHiddenItem&>(rHt).GetValue() )
2549
2550 return rWrt;
2551}
2552
2554{
2555 sal_uInt16 nScript = CSS1_OUTMODE_WESTERN;
2556 switch( rHt.Which() )
2557 {
2558 case RES_CHRATR_CJK_WEIGHT: nScript = CSS1_OUTMODE_CJK; break;
2559 case RES_CHRATR_CTL_WEIGHT: nScript = CSS1_OUTMODE_CTL; break;
2560 }
2561 if( !rWrt.IsCSS1Script( nScript ) )
2562 return rWrt;
2563
2564 std::string_view pStr;
2565 switch( static_cast<const SvxWeightItem&>(rHt).GetWeight() )
2566 {
2567 case WEIGHT_ULTRALIGHT: pStr = sCSS1_PV_extra_light; break;
2568 case WEIGHT_LIGHT: pStr = sCSS1_PV_light; break;
2569 case WEIGHT_SEMILIGHT: pStr = sCSS1_PV_demi_light; break;
2570 case WEIGHT_NORMAL: pStr = sCSS1_PV_normal; break;
2571 case WEIGHT_SEMIBOLD: pStr = sCSS1_PV_demi_bold; break;
2572 case WEIGHT_BOLD:
2573 if( !rWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) )
2574 {
2575 // this also works in HTML does not need to be written as
2576 // a STYLE-Options, and must not be written as Hint
2577 OSL_ENSURE( !rWrt.IsCSS1Source(CSS1_OUTMODE_HINT),
2578 "write bold as Hint?" );
2579 pStr = sCSS1_PV_bold;
2580 }
2581 break;
2582 case WEIGHT_ULTRABOLD: pStr = sCSS1_PV_extra_bold; break;
2583 default:
2584 pStr = sCSS1_PV_normal;
2585 }
2586
2587 if( !pStr.empty() )
2589
2590 return rWrt;
2591}
2592
2594{
2595 // This function only exports Hints!
2596 // Otherwise OutCSS1_SvxTextLn_SvxCrOut_SvxBlink() is called directly.
2597
2600 nullptr, nullptr, nullptr, static_cast<const SvxBlinkItem *>(&rHt) );
2601
2602 return rWrt;
2603}
2604
2606{
2607 // Netscape4 has big problems with cell heights if the line spacing is
2608 // changed within a table and the width of the table is not calculated
2609 // automatically (== if there is a WIDTH-Option)
2610 if( rWrt.m_bOutTable && rWrt.m_bCfgNetscape4 )
2611 return rWrt;
2612
2613 const SvxLineSpacingItem& rLSItem = static_cast<const SvxLineSpacingItem&>(rHt);
2614
2615 sal_uInt16 nHeight = 0;
2616 sal_uInt16 nPercentHeight = 0;
2617 SvxLineSpaceRule eLineSpace = rLSItem.GetLineSpaceRule();
2618 switch( rLSItem.GetInterLineSpaceRule() )
2619 {
2620 case SvxInterLineSpaceRule::Off:
2621 case SvxInterLineSpaceRule::Fix:
2622 {
2623 switch( eLineSpace )
2624 {
2625 case SvxLineSpaceRule::Min:
2626 case SvxLineSpaceRule::Fix:
2627 nHeight = rLSItem.GetLineHeight();
2628 break;
2629 case SvxLineSpaceRule::Auto:
2630 nPercentHeight = 100;
2631 break;
2632 default:
2633 ;
2634 }
2635 }
2636 break;
2637 case SvxInterLineSpaceRule::Prop:
2638 nPercentHeight = rLSItem.GetPropLineSpace();
2639 break;
2640
2641 default:
2642 ;
2643 }
2644
2645 if( nHeight )
2646 rWrt.OutCSS1_UnitProperty( sCSS1_P_line_height, static_cast<tools::Long>(nHeight) );
2647 else if( nPercentHeight &&
2648 !(nPercentHeight < 115 && rWrt.m_bParaDotLeaders )) // avoid HTML scrollbars and missing descenders
2649 {
2650 OString sHeight(OString::number(nPercentHeight) + "%");
2652 }
2653
2654 return rWrt;
2655}
2656
2658{
2659 // Export Alignment in Style-Option only if the Tag does not allow ALIGN=xxx
2660 if( rWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) &&
2661 !rWrt.m_bNoAlign)
2662 return rWrt;
2663
2664 std::string_view pStr;
2665 switch( static_cast<const SvxAdjustItem&>(rHt).GetAdjust() )
2666 {
2667 case SvxAdjust::Left: pStr = sCSS1_PV_left; break;
2668 case SvxAdjust::Right: pStr = sCSS1_PV_right; break;
2669 case SvxAdjust::Block: pStr = sCSS1_PV_justify; break;
2670 case SvxAdjust::Center: pStr = sCSS1_PV_center; break;
2671 default:
2672 ;
2673 }
2674
2675 if( !pStr.empty() )
2677
2678 return rWrt;
2679}
2680
2682{
2683 std::string_view pStr = static_cast<const SvxFormatSplitItem&>(rHt).GetValue()
2687
2688 return rWrt;
2689}
2690
2692{
2693 std::string_view pStr = static_cast<const SwFormatLayoutSplit&>(rHt).GetValue()
2697
2698 return rWrt;
2699}
2700
2702{
2703 OString aStr(OString::number(static_cast<const SvxWidowsItem&>(rHt).GetValue()));
2705
2706 return rWrt;
2707}
2708
2710{
2711 OString aStr(OString::number(static_cast<const SvxOrphansItem&>(rHt).GetValue()));
2713
2714 return rWrt;
2715}
2716
2718 const SwFormatDrop& rDrop,
2719 const SfxItemSet *pCharFormatItemSet )
2720{
2721 // Text flows around on right side
2723
2724 // number of lines -> use % for Font-Height!
2725 OString sOut(OString::number(rDrop.GetLines()*100) + "%");
2727
2728 // distance to Text = right margin
2729 sal_uInt16 nDistance = rDrop.GetDistance();
2730 if( nDistance > 0 )
2731 rHWrt.OutCSS1_UnitProperty( sCSS1_P_margin_right, nDistance );
2732
2733 const SwCharFormat *pDCCharFormat = rDrop.GetCharFormat();
2734 if( pCharFormatItemSet )
2735 rHWrt.OutCSS1_SfxItemSet( *pCharFormatItemSet );
2736 else if( pDCCharFormat )
2737 rHWrt.OutCSS1_SfxItemSet( pDCCharFormat->GetAttrSet() );
2739 rHWrt.Strm().WriteOString( sCSS1_rule_end );
2740
2741}
2742
2744{
2745 // never export as an Option of a paragraph, but only as Hints
2746 if( !rWrt.IsCSS1Source(CSS1_OUTMODE_HINT) )
2747 return rWrt;
2748
2749 if( rWrt.m_bTagOn )
2750 {
2751 SwCSS1OutMode aMode( rWrt,
2753 CSS1_OUTMODE_DROPCAP, nullptr );
2754
2755 OutCSS1_SwFormatDropAttrs( rWrt, static_cast<const SwFormatDrop&>(rHt) );
2756 // A "> is already printed by the calling OutCSS1_HintAsSpanTag.
2757 }
2758 else
2759 {
2760 HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), Concat2View(rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span), false );
2761 }
2762
2763 return rWrt;
2764}
2765
2767 Css1FrameSize nMode )
2768{
2769 const SwFormatFrameSize& rFSItem = static_cast<const SwFormatFrameSize&>(rHt);
2770
2771 if( nMode & Css1FrameSize::Width )
2772 {
2773 sal_uInt8 nPercentWidth = rFSItem.GetWidthPercent();
2774 if( nPercentWidth )
2775 {
2776 OString sOut(OString::number(nPercentWidth) + "%");
2778 }
2779 else if( nMode & Css1FrameSize::Pixel )
2780 {
2782 rFSItem.GetSize().Width(), false );
2783 }
2784 else
2785 {
2787 rFSItem.GetSize().Width() );
2788 }
2789 }
2790
2791 return rWrt;
2792}
2793
2795{
2796 const SvxFirstLineIndentItem & rFirstLine(static_cast<const SvxFirstLineIndentItem&>(rHt));
2797
2798 // No Export of a firm attribute is needed if the new values
2799 // match that of the current template
2800
2801 // The LineIndent of the first line might contain the room for numbering
2802 tools::Long nFirstLineIndent = static_cast<tools::Long>(rFirstLine.GetTextFirstLineOffset())
2803 - rWrt.m_nFirstLineIndent;
2804 if (rWrt.m_nDfltFirstLineIndent != nFirstLineIndent)
2805 {
2806 rWrt.OutCSS1_UnitProperty(sCSS1_P_text_indent, nFirstLineIndent);
2807 }
2808
2809 return rWrt;
2810}
2811
2813{
2814 const SvxTextLeftMarginItem& rLeftMargin(static_cast<const SvxTextLeftMarginItem&>(rHt));
2815
2816 // No Export of a firm attribute is needed if the new values
2817 // match that of the current template
2818
2819 // A left margin can exist because of a list nearby
2820 tools::Long nLeftMargin = rLeftMargin.GetTextLeft() - rWrt.m_nLeftMargin;
2821 if (rWrt.m_nDfltLeftMargin != nLeftMargin)
2822 {
2824
2825 // max-width = max-width - margin-left for TOC paragraphs with dot leaders
2826 if (rWrt.m_bParaDotLeaders)
2828
2829 }
2830
2831 return rWrt;
2832}
2833
2835{
2836 const SvxRightMarginItem& rRightMargin(static_cast<const SvxRightMarginItem&>(rHt));
2837
2838 // No Export of a firm attribute is needed if the new values
2839 // match that of the current template
2840
2841 if (rWrt.m_nDfltRightMargin != rRightMargin.GetRight())
2842 {
2844 }
2845
2846 return rWrt;
2847}
2848
2850{
2851 const SvxLRSpaceItem& rLRItem = static_cast<const SvxLRSpaceItem&>(rHt);
2852
2853 // No Export of a firm attribute is needed if the new values
2854 // match that of the current template
2855
2856 // A left margin can exist because of a list nearby
2858 if( rWrt.m_nDfltLeftMargin != nLeftMargin )
2859 {
2861
2862 // max-width = max-width - margin-left for TOC paragraphs with dot leaders
2863 if( rWrt.m_bParaDotLeaders )
2865
2866 }
2867
2868 if( rWrt.m_nDfltRightMargin != rLRItem.GetRight() )
2869 {
2871 }
2872
2873 // The LineIndent of the first line might contain the room for numbering
2874 tools::Long nFirstLineIndent = static_cast<tools::Long>(rLRItem.GetTextFirstLineOffset()) -
2875 rWrt.m_nFirstLineIndent;
2876 if( rWrt.m_nDfltFirstLineIndent != nFirstLineIndent )
2877 {
2879 nFirstLineIndent );
2880 }
2881
2882 return rWrt;
2883}
2884
2886{
2887 const SvxULSpaceItem& rULItem = static_cast<const SvxULSpaceItem&>(rHt);
2888
2889 if( rWrt.m_nDfltTopMargin != rULItem.GetUpper() )
2890 {
2892 static_cast<tools::Long>(rULItem.GetUpper()) );
2893 }
2894
2895 if( rWrt.m_nDfltBottomMargin != rULItem.GetLower() )
2896 {
2898 static_cast<tools::Long>(rULItem.GetLower()) );
2899 }
2900
2901 return rWrt;
2902}
2903
2905 const SvxULSpaceItem *pULItem,
2906 const SvxLRSpaceItem *pLRItem )
2907{
2908 if( pLRItem && pULItem &&
2909 pLRItem->GetLeft() == pLRItem->GetRight() &&
2910 pLRItem->GetLeft() == pULItem->GetUpper() &&
2911 pLRItem->GetLeft() == pULItem->GetLower() &&
2912 pLRItem->GetLeft() != rWrt.m_nDfltLeftMargin &&
2913 pLRItem->GetRight() != rWrt.m_nDfltRightMargin &&
2914 pULItem->GetUpper() != rWrt.m_nDfltTopMargin &&
2915 pULItem->GetLower() != rWrt.m_nDfltBottomMargin )
2916 {
2917 rWrt.OutCSS1_UnitProperty( sCSS1_P_margin, pLRItem->GetLeft() );
2918 }
2919 else
2920 {
2921 if( pLRItem )
2922 OutCSS1_SvxLRSpace( rWrt, *pLRItem );
2923 if( pULItem )
2924 OutCSS1_SvxULSpace( rWrt, *pULItem );
2925 }
2926
2927 return rWrt;
2928}
2929
2931 const SfxItemSet& rItemSet )
2932{
2933 const SvxLRSpaceItem *pLRSpace = rItemSet.GetItemIfSet( RES_LR_SPACE, false/*bDeep*/ );
2934 const SvxULSpaceItem *pULSpace = rItemSet.GetItemIfSet( RES_UL_SPACE, false/*bDeep*/ );
2935
2936 if( pLRSpace || pULSpace )
2937 OutCSS1_SvxULSpace_SvxLRSpace( rWrt, pULSpace, pLRSpace );
2938
2939 return rWrt;
2940}
2941
2943 const SvxFormatBreakItem *pBreakItem,
2944 const SwFormatPageDesc *pPDescItem,
2945 const SvxFormatKeepItem *pKeepItem )
2946{
2947 if( !rWrt.IsHTMLMode(HTMLMODE_PRINT_EXT) )
2948 return rWrt;
2949
2950 std::string_view pBreakBefore;
2951 std::string_view pBreakAfter;
2952
2953 if( pKeepItem )
2954 {
2955 pBreakAfter = pKeepItem->GetValue() ? sCSS1_PV_avoid : sCSS1_PV_auto;
2956 }
2957 if( pBreakItem )
2958 {
2959 switch( pBreakItem->GetBreak() )
2960 {
2961 case SvxBreak::NONE:
2962 pBreakBefore = sCSS1_PV_auto;
2963 if( pBreakAfter.empty() )
2964 pBreakAfter = sCSS1_PV_auto;
2965 break;
2966
2967 case SvxBreak::PageBefore:
2968 pBreakBefore = sCSS1_PV_always;
2969 break;
2970
2971 case SvxBreak::PageAfter:
2972 pBreakAfter= sCSS1_PV_always;
2973 break;
2974
2975 default:
2976 ;
2977 }
2978 }
2979 if( pPDescItem )
2980 {
2981 const SwPageDesc *pPDesc = pPDescItem->GetPageDesc();
2982 if( pPDesc )
2983 {
2984 switch( pPDesc->GetPoolFormatId() )
2985 {
2986 case RES_POOLPAGE_LEFT: pBreakBefore = sCSS1_PV_left; break;
2987 case RES_POOLPAGE_RIGHT: pBreakBefore = sCSS1_PV_right; break;
2988 default: pBreakBefore = sCSS1_PV_always; break;
2989 }
2990 }
2991 else if( pBreakBefore.empty() )
2992 {
2993 pBreakBefore = sCSS1_PV_auto;
2994 }
2995 }
2996
2997 if (rWrt.mbSkipHeaderFooter)
2998 // No page break when writing only a fragment.
2999 return rWrt;
3000
3001 if( !pBreakBefore.empty() )
3003 pBreakBefore );
3004 if( !pBreakAfter.empty() )
3006 pBreakAfter );
3007
3008 return rWrt;
3009}
3010
3012 const SfxItemSet& rItemSet,
3013 bool bDeep )
3014{
3015 const SvxFormatBreakItem *pBreakItem = rItemSet.GetItemIfSet( RES_BREAK, bDeep );
3016
3017 const SwFormatPageDesc *pPDescItem = nullptr;
3018 if( !rWrt.IsCSS1Source( CSS1_OUTMODE_PARA ) ||
3020 rWrt.m_pStartNdIdx->GetIndex() !=
3021 rWrt.m_pCurrentPam->GetPoint()->GetNodeIndex() )
3022 pPDescItem = rItemSet.GetItemIfSet( RES_PAGEDESC, bDeep );
3023
3024 const SvxFormatKeepItem *pKeepItem = rItemSet.GetItemIfSet( RES_KEEP, bDeep );
3025
3026 if( pBreakItem || pPDescItem || pKeepItem )
3028 pPDescItem, pKeepItem );
3029
3030 return rWrt;
3031}
3032
3033// Wrapper for OutCSS1_SfxItemSet etc.
3035{
3036 OutCSS1_SvxBrush( rWrt, rHt, sw::Css1Background::Attr, nullptr );
3037 return rWrt;
3038}
3039
3041 sw::Css1Background nMode,
3042 const OUString* pGraphicName)
3043{
3044 // The Character-Attribute is skipped, if we are about to
3045 // exporting options
3046 if( rHt.Which() < RES_CHRATR_END &&
3048 return rWrt;
3049
3050 // start getting a few values
3051// const Brush &rBrush = static_cast<const SvxBrushItem &>(rHt).GetBrush();
3052 const Color & rColor = static_cast<const SvxBrushItem &>(rHt).GetColor();
3053 OUString aLink = pGraphicName ? *pGraphicName
3054 : static_cast<const SvxBrushItem &>(rHt).GetGraphicLink();
3055 SvxGraphicPosition ePos = static_cast<const SvxBrushItem &>(rHt).GetGraphicPos();
3056 if( sw::Css1Background::Page == nMode && !rWrt.mbEmbedImages )
3057 {
3058 // page style images are exported if not tiled
3059 if( aLink.isEmpty() || GPOS_TILED==ePos )
3060 return rWrt;
3061 }
3062
3063 // get the color
3064 bool bColor = false;
3066 bool bTransparent = (rColor == COL_TRANSPARENT);
3067 Color aColor;
3068 if( !bTransparent )
3069 {
3070 aColor = rColor;
3071 bColor = true;
3072 }
3073
3074 // and now the Graphic
3075 OUString aGraphicInBase64;
3076
3077 // Embedded Graphic -> export WriteEmbedded
3078 const Graphic* pGrf = nullptr;
3079 if( rWrt.mbEmbedImages || aLink.isEmpty())
3080 {
3081 pGrf = static_cast<const SvxBrushItem &>(rHt).GetGraphic();
3082 if( pGrf )
3083 {
3084 if( !XOutBitmap::GraphicToBase64(*pGrf, aGraphicInBase64) )
3085 {
3087 }
3088 }
3089 aLink.clear();
3090 }
3091 else if( !pGraphicName && rWrt.m_bCfgCpyLinkedGrfs )
3092 {
3093 OUString aGraphicAsLink = aLink;
3094 rWrt.CopyLocalFileToINet( aGraphicAsLink );
3095 aLink = aGraphicAsLink;
3096 }
3097 // In tables we only export something if there is a Graphic
3098 if( (nMode == sw::Css1Background::Table || nMode == sw::Css1Background::TableRow) && !pGrf && !aLink.isEmpty())
3099 return rWrt;
3100
3101 // if necessary, add the orientation of the Graphic
3102 std::string_view pRepeat, pHori, pVert;
3103 if( pGrf || !aLink.isEmpty() )
3104 {
3105 if( GPOS_TILED==ePos )
3106 {
3107 pRepeat = sCSS1_PV_repeat;
3108 }
3109 else
3110 {
3111 switch( ePos )
3112 {
3113 case GPOS_LT:
3114 case GPOS_MT:
3115 case GPOS_RT:
3116 pHori = sCSS1_PV_top;
3117 break;
3118
3119 case GPOS_LM:
3120 case GPOS_MM:
3121 case GPOS_RM:
3122 pHori = sCSS1_PV_middle;
3123 break;
3124
3125 case GPOS_LB:
3126 case GPOS_MB:
3127 case GPOS_RB:
3128 pHori = sCSS1_PV_bottom;
3129 break;
3130
3131 default:
3132 ;
3133 }
3134
3135 switch( ePos )
3136 {
3137 case GPOS_LT:
3138 case GPOS_LM:
3139 case GPOS_LB:
3140 pVert = sCSS1_PV_left;
3141 break;
3142
3143 case GPOS_MT:
3144 case GPOS_MM:
3145 case GPOS_MB:
3146 pVert = sCSS1_PV_center;
3147 break;
3148
3149 case GPOS_RT:
3150 case GPOS_RM:
3151 case GPOS_RB:
3152 pVert = sCSS1_PV_right;
3153 break;
3154
3155 default:
3156 ;
3157 }
3158
3159 if( !pHori.empty() || !pVert.empty() )
3160 pRepeat = sCSS1_PV_no_repeat;
3161 }
3162 }
3163
3164 // now build the string
3165 OUString sOut;
3166 if( !pGrf && aLink.isEmpty() && !bColor )
3167 {
3168 // no color and no Link, but a transparent Brush
3169 if( bTransparent && sw::Css1Background::Fly != nMode )
3170 sOut += OStringToOUString(sCSS1_PV_transparent, RTL_TEXTENCODING_ASCII_US);
3171 }
3172 else
3173 {
3174 if( bColor )
3175 {
3176 OString sTmp(GetCSS1_Color(aColor));
3177 sOut += OStringToOUString(sTmp, RTL_TEXTENCODING_ASCII_US);
3178 }
3179
3180 if( pGrf || !aLink.isEmpty() )
3181 {
3182 if( bColor )
3183 sOut += " ";
3184
3185 if(pGrf)
3186 {
3187 sOut += OStringToOUString(sCSS1_url, RTL_TEXTENCODING_ASCII_US) +
3188 "(\'" OOO_STRING_SVTOOLS_HTML_O_data ":" + aGraphicInBase64 + "\')";
3189 }
3190 else
3191 {
3192 sOut += OStringToOUString(sCSS1_url, RTL_TEXTENCODING_ASCII_US)+
3194 aLink) + ")";
3195 }
3196
3197 if( !pRepeat.empty() )
3198 {
3199 sOut += " " + OStringToOUString(pRepeat, RTL_TEXTENCODING_ASCII_US);
3200 }
3201
3202 if( !pHori.empty() )
3203 {
3204 sOut += " " + OStringToOUString(pHori, RTL_TEXTENCODING_ASCII_US);
3205 }
3206 if( !pVert.empty() )
3207 {
3208 sOut += " " + OStringToOUString(pVert, RTL_TEXTENCODING_ASCII_US);
3209 }
3210
3211 sOut += " " + OStringToOUString(sCSS1_PV_scroll, RTL_TEXTENCODING_ASCII_US) + " ";
3212 }
3213 }
3214
3215 if( !sOut.isEmpty() )
3216 {
3217 rWrt.OutCSS1_Property(sCSS1_P_background, std::string_view(), &sOut,
3218 nMode);
3219 }
3220
3221 return rWrt;
3222}
3223
3225 std::string_view pProperty,
3226 const SvxBorderLine *pLine )
3227{
3228 if( !pLine || pLine->isEmpty() )
3229 {
3230 rWrt.OutCSS1_PropertyAscii( pProperty, sCSS1_PV_none );
3231 return;
3232 }
3233
3234 sal_Int32 nWidth = pLine->GetWidth();
3235
3236 OStringBuffer sOut;
3238 nWidth <= Application::GetDefaultDevice()->PixelToLogic(
3239 Size( 1, 1 ), MapMode( MapUnit::MapTwip) ).Width() )
3240 {
3241 // If the width is smaller than one pixel, then export as 1px
3242 // so that Netscape and IE show the line.
3243 sOut.append("1px");
3244 }
3245 else
3246 {
3247 nWidth *= 5; // 1/100pt
3248
3249 // width in n.nn pt
3250 sOut.append(OString::number(nWidth / 100) + "." + OString::number((nWidth/10) % 10) +
3251 OString::number(nWidth % 10) + sCSS1_UNIT_pt);
3252 }
3253
3254 // Line-Style: solid or double
3255 sOut.append(' ');
3256 switch (pLine->GetBorderLineStyle())
3257 {
3258 case SvxBorderLineStyle::SOLID:
3259 sOut.append(sCSS1_PV_solid);
3260 break;
3261 case SvxBorderLineStyle::DOTTED:
3262 sOut.append(sCSS1_PV_dotted);
3263 break;
3264 case SvxBorderLineStyle::DASHED:
3265 sOut.append(sCSS1_PV_dashed);
3266 break;
3267 case SvxBorderLineStyle::DOUBLE:
3268 case SvxBorderLineStyle::THINTHICK_SMALLGAP:
3269 case SvxBorderLineStyle::THINTHICK_MEDIUMGAP:
3270 case SvxBorderLineStyle::THINTHICK_LARGEGAP:
3271 case SvxBorderLineStyle::THICKTHIN_SMALLGAP:
3272 case SvxBorderLineStyle::THICKTHIN_MEDIUMGAP:
3273 case SvxBorderLineStyle::THICKTHIN_LARGEGAP:
3274 sOut.append(sCSS1_PV_double);
3275 break;
3276 case SvxBorderLineStyle::EMBOSSED:
3277 sOut.append(sCSS1_PV_ridge);
3278 break;
3279 case SvxBorderLineStyle::ENGRAVED:
3280 sOut.append(sCSS1_PV_groove);
3281 break;
3282 case SvxBorderLineStyle::INSET:
3283 sOut.append(sCSS1_PV_inset);
3284 break;
3285 case SvxBorderLineStyle::OUTSET:
3286 sOut.append(sCSS1_PV_outset);
3287 break;
3288 default:
3289 sOut.append(sCSS1_PV_none);
3290 }
3291 sOut.append(' ');
3292
3293 // and also the color
3294 sOut.append(GetCSS1_Color(pLine->GetColor()));
3295
3296 rWrt.OutCSS1_PropertyAscii(pProperty, sOut);
3297}
3298
3300{
3301 // Avoid interference between character and paragraph attributes
3302 if( rHt.Which() < RES_CHRATR_END &&
3304 return rWrt;
3305
3306 if( rHt.Which() == RES_CHRATR_BOX )
3307 {
3308 if( rWrt.m_bTagOn )
3309 {
3310 // Inline-block to make the line height changing correspond to the character border
3311 rWrt.OutCSS1_PropertyAscii(sCSS1_P_display, "inline-block");
3312 }
3313 else
3314 {
3315 HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), Concat2View(rWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_span), false );
3316 return rWrt;
3317 }
3318 }
3319
3320 const SvxBoxItem& rBoxItem = static_cast<const SvxBoxItem&>(rHt);
3321 const SvxBorderLine *pTop = rBoxItem.GetTop();
3322 const SvxBorderLine *pBottom = rBoxItem.GetBottom();
3323 const SvxBorderLine *pLeft = rBoxItem.GetLeft();
3324 const SvxBorderLine *pRight = rBoxItem.GetRight();
3325
3326 if( (pTop && pBottom && pLeft && pRight &&
3327 *pTop == *pBottom && *pTop == *pLeft && *pTop == *pRight) ||
3328 (!pTop && !pBottom && !pLeft && !pRight) )
3329 {
3330 // all Lines are set and equal, or all Lines are not set
3331 // => border : ...
3333 }
3334 else
3335 {
3336 // otherwise export all Lines separately
3341 }
3342
3343 tools::Long nTopDist = pTop ? rBoxItem.GetDistance( SvxBoxItemLine::TOP ) : 0;
3344 tools::Long nBottomDist = pBottom ? rBoxItem.GetDistance( SvxBoxItemLine::BOTTOM ) : 0;
3345 tools::Long nLeftDist = pLeft ? rBoxItem.GetDistance( SvxBoxItemLine::LEFT ) : 0;
3346 tools::Long nRightDist = pRight ? rBoxItem.GetDistance( SvxBoxItemLine::RIGHT ) : 0;
3347
3348 if( nTopDist == nBottomDist && nLeftDist == nRightDist )
3349 {
3350 OStringBuffer sVal;
3351 AddUnitPropertyValue(sVal, nTopDist, rWrt.GetCSS1Unit());
3352 if( nTopDist != nLeftDist )
3353 {
3354 sVal.append(' ');
3355 AddUnitPropertyValue(sVal, nLeftDist, rWrt.GetCSS1Unit());
3356 }
3358 }
3359 else
3360 {
3361 rWrt.OutCSS1_UnitProperty( sCSS1_P_padding_top, nTopDist );
3362 rWrt.OutCSS1_UnitProperty( sCSS1_P_padding_bottom, nBottomDist );
3363 rWrt.OutCSS1_UnitProperty( sCSS1_P_padding_left, nLeftDist );
3364 rWrt.OutCSS1_UnitProperty( sCSS1_P_padding_right, nRightDist );
3365 }
3366
3367 return rWrt;
3368}
3369
3371{
3372 // Language will be exported rules only
3373 if( !rWrt.IsCSS1Source( CSS1_OUTMODE_TEMPLATE ) )
3374 return rWrt;
3375
3376 SvxFrameDirection nDir =
3377 static_cast< const SvxFrameDirectionItem& >( rHt ).GetValue();
3378 std::string_view pStr;
3379 switch( nDir )
3380 {
3381 case SvxFrameDirection::Horizontal_LR_TB:
3382 case SvxFrameDirection::Vertical_LR_TB:
3383 pStr = sCSS1_PV_ltr;
3384 break;
3385 case SvxFrameDirection::Horizontal_RL_TB:
3386 case SvxFrameDirection::Vertical_RL_TB:
3387 pStr = sCSS1_PV_rtl;
3388 break;
3389 case SvxFrameDirection::Environment:
3390 pStr = sCSS1_PV_inherit;
3391 break;
3392 default: break;
3393 }
3394
3395 if( !pStr.empty() )
3397
3398 return rWrt;
3399}
3400
3401/*
3402 * Place here the table for the HTML-Function-Pointer to the
3403 * Export-Functions.
3404 * They are local structures, only needed within the HTML-DLL.
3405 */
3406
3408/* RES_CHRATR_CASEMAP */ OutCSS1_SvxCaseMap,
3409/* RES_CHRATR_CHARSETCOLOR */ nullptr,
3410/* RES_CHRATR_COLOR */ OutCSS1_SvxColor,
3411/* RES_CHRATR_CONTOUR */ nullptr,
3412/* RES_CHRATR_CROSSEDOUT */ OutCSS1_SvxCrossedOut,
3413/* RES_CHRATR_ESCAPEMENT */ nullptr,
3414/* RES_CHRATR_FONT */ OutCSS1_SvxFont,
3415/* RES_CHRATR_FONTSIZE */ OutCSS1_SvxFontHeight,
3416/* RES_CHRATR_KERNING */ OutCSS1_SvxKerning,
3417/* RES_CHRATR_LANGUAGE */ OutCSS1_SvxLanguage,
3418/* RES_CHRATR_POSTURE */ OutCSS1_SvxPosture,
3419/* RES_CHRATR_UNUSED1*/ nullptr,
3420/* RES_CHRATR_SHADOWED */ nullptr,
3421/* RES_CHRATR_UNDERLINE */ OutCSS1_SvxUnderline,
3422/* RES_CHRATR_WEIGHT */ OutCSS1_SvxFontWeight,
3423/* RES_CHRATR_WORDLINEMODE */ nullptr,
3424/* RES_CHRATR_AUTOKERN */ nullptr,
3425/* RES_CHRATR_BLINK */ OutCSS1_SvxBlink,
3426/* RES_CHRATR_NOHYPHEN */ nullptr, // new: don't separate
3427/* RES_CHRATR_UNUSED2 */ nullptr,
3428/* RES_CHRATR_BACKGROUND */ OutCSS1_SvxBrush, // new: character background
3429/* RES_CHRATR_CJK_FONT */ OutCSS1_SvxFont,
3430/* RES_CHRATR_CJK_FONTSIZE */ OutCSS1_SvxFontHeight,
3431/* RES_CHRATR_CJK_LANGUAGE */ OutCSS1_SvxLanguage,
3432/* RES_CHRATR_CJK_POSTURE */ OutCSS1_SvxPosture,
3433/* RES_CHRATR_CJK_WEIGHT */ OutCSS1_SvxFontWeight,
3434/* RES_CHRATR_CTL_FONT */ OutCSS1_SvxFont,
3435/* RES_CHRATR_CTL_FONTSIZE */ OutCSS1_SvxFontHeight,
3436/* RES_CHRATR_CTL_LANGUAGE */ OutCSS1_SvxLanguage,
3437/* RES_CHRATR_CTL_POSTURE */ OutCSS1_SvxPosture,
3438/* RES_CHRATR_CTL_WEIGHT */ OutCSS1_SvxFontWeight,
3439/* RES_CHRATR_ROTATE */ nullptr,
3440/* RES_CHRATR_EMPHASIS_MARK */ nullptr,
3441/* RES_CHRATR_TWO_LINES */ nullptr,
3442/* RES_CHRATR_SCALEW */ nullptr,
3443/* RES_CHRATR_RELIEF */ nullptr,
3444/* RES_CHRATR_HIDDEN */ OutCSS1_SvxHidden,
3445/* RES_CHRATR_OVERLINE */ OutCSS1_SvxOverline,
3446/* RES_CHRATR_RSID */ nullptr,
3447/* RES_CHRATR_BOX */ OutCSS1_SvxBox,
3448/* RES_CHRATR_SHADOW */ nullptr,
3449/* RES_CHRATR_HIGHLIGHT */ nullptr,
3450/* RES_CHRATR_GRABBAG */ nullptr,
3451/* RES_CHRATR_BIDIRTL */ nullptr,
3452/* RES_CHRATR_IDCTHINT */ nullptr,
3453
3454/* RES_TXTATR_REFMARK */ nullptr,
3455/* RES_TXTATR_TOXMARK */ nullptr,
3456/* RES_TXTATR_META */ nullptr,
3457/* RES_TXTATR_METAFIELD */ nullptr,
3458/* RES_TXTATR_AUTOFMT */ nullptr,
3459/* RES_TXTATR_INETFMT */ nullptr,
3460/* RES_TXTATR_CHARFMT */ nullptr,
3461/* RES_TXTATR_CJK_RUBY */ nullptr,
3462/* RES_TXTATR_UNKNOWN_CONTAINER */ nullptr,
3463/* RES_TXTATR_INPUTFIELD */ nullptr,
3464/* RES_TXTATR_CONTENTCONTROL */ nullptr,
3465
3466/* RES_TXTATR_FIELD */ nullptr,
3467/* RES_TXTATR_FLYCNT */ nullptr,
3468/* RES_TXTATR_FTN */ nullptr,
3469/* RES_TXTATR_ANNOTATION */ nullptr,
3470/* RES_TXTATR_LINEBREAK */ nullptr,
3471/* RES_TXTATR_DUMMY1 */ nullptr, // Dummy:
3472
3473/* RES_PARATR_LINESPACING */ OutCSS1_SvxLineSpacing,
3474/* RES_PARATR_ADJUST */ OutCSS1_SvxAdjust,
3475/* RES_PARATR_SPLIT */ OutCSS1_SvxFormatSplit,
3476/* RES_PARATR_ORPHANS */ OutCSS1_SvxOrphans,
3477/* RES_PARATR_WIDOWS */ OutCSS1_SvxWidows,
3478/* RES_PARATR_TABSTOP */ nullptr,
3479/* RES_PARATR_HYPHENZONE*/ nullptr,
3480/* RES_PARATR_DROP */ OutCSS1_SwFormatDrop,
3481/* RES_PARATR_REGISTER */ nullptr, // new: register-true
3482/* RES_PARATR_NUMRULE */ nullptr,
3483/* RES_PARATR_SCRIPTSPACE */ nullptr,
3484/* RES_PARATR_HANGINGPUNCTUATION */ nullptr,
3485/* RES_PARATR_FORBIDDEN_RULES */ nullptr, // new
3486/* RES_PARATR_VERTALIGN */ nullptr, // new
3487/* RES_PARATR_SNAPTOGRID*/ nullptr, // new
3488/* RES_PARATR_CONNECT_TO_BORDER */ nullptr, // new
3489/* RES_PARATR_OUTLINELEVEL */ nullptr, // new since cws outlinelevel
3490/* RES_PARATR_RSID */ nullptr, // new
3491/* RES_PARATR_GRABBAG */ nullptr,
3492
3493/* RES_PARATR_LIST_ID */ nullptr, // new
3494/* RES_PARATR_LIST_LEVEL */ nullptr, // new
3495/* RES_PARATR_LIST_ISRESTART */ nullptr, // new
3496/* RES_PARATR_LIST_RESTARTVALUE */ nullptr, // new
3497/* RES_PARATR_LIST_ISCOUNTED */ nullptr, // new
3498/* RES_PARATR_LIST_AUTOFMT */ nullptr, // new
3499
3500/* RES_FILL_ORDER */ nullptr,
3501/* RES_FRM_SIZE */ nullptr,
3502/* RES_PAPER_BIN */ nullptr,
3503/* RES_MARGIN_FIRSTLINE */ OutCSS1_SvxFirstLineIndent,
3504/* RES_MARGIN_TEXTLEFT */ OutCSS1_SvxTextLeftMargin,
3505/* RES_MARGIN_RIGHT */ OutCSS1_SvxRightMargin,
3506/* RES_MARGIN_LEFT */ nullptr,
3507/* RES_MARGIN_GUTTER */ nullptr,
3508/* RES_MARGIN_GUTTER_RIGHT */ nullptr,
3509/* RES_LR_SPACE */ OutCSS1_SvxLRSpace,
3510/* RES_UL_SPACE */ OutCSS1_SvxULSpace,
3511/* RES_PAGEDESC */ nullptr,
3512/* RES_BREAK */ nullptr,
3513/* RES_CNTNT */ nullptr,
3514/* RES_HEADER */ nullptr,
3515/* RES_FOOTER */ nullptr,
3516/* RES_PRINT */ nullptr,
3517/* RES_OPAQUE */ nullptr,
3518/* RES_PROTECT */ nullptr,
3519/* RES_SURROUND */ nullptr,
3520/* RES_VERT_ORIENT */ nullptr,
3521/* RES_HORI_ORIENT */ nullptr,
3522/* RES_ANCHOR */ nullptr,
3523/* RES_BACKGROUND */ OutCSS1_SvxBrush,
3524/* RES_BOX */ OutCSS1_SvxBox,
3525/* RES_SHADOW */ nullptr,
3526/* RES_FRMMACRO */ nullptr,
3527/* RES_COL */ nullptr,
3528/* RES_KEEP */ nullptr,
3529/* RES_URL */ nullptr,
3530/* RES_EDIT_IN_READONLY */ nullptr,
3531/* RES_LAYOUT_SPLIT */ nullptr,
3532/* RES_CHAIN */ nullptr,
3533/* RES_TEXTGRID */ nullptr,
3534/* RES_LINENUMBER */ nullptr,
3535/* RES_FTN_AT_TXTEND */ nullptr,
3536/* RES_END_AT_TXTEND */ nullptr,
3537/* RES_COLUMNBALANCE */ nullptr,
3538/* RES_FRAMEDIR */ OutCSS1_SvxFrameDirection,
3539/* RES_HEADER_FOOTER_EAT_SPACING */ nullptr,
3540/* RES_ROW_SPLIT */ nullptr,
3541/* RES_FLY_SPLIT */ nullptr,
3542/* RES_FOLLOW_TEXT_FLOW */ nullptr,
3543/* RES_COLLAPSING_BORDERS */ nullptr,
3544/* RES_WRAP_INFLUENCE_ON_OBJPOS */ nullptr,
3545/* RES_AUTO_STYLE */ nullptr,
3546/* RES_FRMATR_STYLE_NAME */ nullptr,
3547/* RES_FRMATR_CONDITIONAL_STYLE_NAME */ nullptr,
3548/* RES_FRMATR_GRABBAG */ nullptr,
3549/* RES_TEXT_VERT_ADJUST */ nullptr,
3550/* RES_BACKGROUND_FULL_SIZE */ nullptr,
3551/* RES_RTL_GUTTER */ nullptr,
3552/* RES_DECORATIVE */ nullptr,
3553
3554/* RES_GRFATR_MIRRORGRF */ nullptr,
3555/* RES_GRFATR_CROPGRF */ nullptr,
3556/* RES_GRFATR_ROTATION */ nullptr,
3557/* RES_GRFATR_LUMINANCE */ nullptr,
3558/* RES_GRFATR_CONTRAST */ nullptr,
3559/* RES_GRFATR_CHANNELR */ nullptr,
3560/* RES_GRFATR_CHANNELG */ nullptr,
3561/* RES_GRFATR_CHANNELB */ nullptr,
3562/* RES_GRFATR_GAMMA */ nullptr,
3563/* RES_GRFATR_INVERT */ nullptr,
3564/* RES_GRFATR_TRANSPARENCY */ nullptr,
3565/* RES_GRFATR_DRWAMODE */ nullptr,
3566/* RES_GRFATR_DUMMY3 */ nullptr,
3567/* RES_GRFATR_DUMMY4 */ nullptr,
3568/* RES_GRFATR_DUMMY5 */ nullptr,
3569
3570/* RES_BOXATR_FORMAT */ nullptr,
3571/* RES_BOXATR_FORMULA */ nullptr,
3572/* RES_BOXATR_VALUE */ nullptr
3573};
3574
3576
3578 bool bDeep )
3579{
3580 // print ItemSet, including all attributes
3581 Out_SfxItemSet( aCSS1AttrFnTab, *this, rItemSet, bDeep );
3582
3583 // some Attributes require special treatment
3584
3585 // Underline, Overline, CrossedOut and Blink form together a CSS1-Property
3586 // (doesn't work of course for Hints)
3588 {
3589 const SvxUnderlineItem *pUnderlineItem =
3590 rItemSet.GetItemIfSet( RES_CHRATR_UNDERLINE, bDeep );
3591
3592 const SvxOverlineItem *pOverlineItem =
3593 rItemSet.GetItemIfSet( RES_CHRATR_OVERLINE, bDeep );
3594
3595 const SvxCrossedOutItem *pCrossedOutItem =
3596 rItemSet.GetItemIfSet( RES_CHRATR_CROSSEDOUT, bDeep );
3597
3598 const SvxBlinkItem *pBlinkItem =
3599 rItemSet.GetItemIfSet( RES_CHRATR_BLINK, bDeep );
3600
3601 if( pUnderlineItem || pOverlineItem || pCrossedOutItem || pBlinkItem )
3602 OutCSS1_SvxTextLn_SvxCrOut_SvxBlink( *this, pUnderlineItem,
3603 pOverlineItem,
3604 pCrossedOutItem,
3605 pBlinkItem );
3606
3608 }
3609
3611 return;
3612
3613 // if a Property was exported as part of a Style-Option,
3614 // the Option still needs to be finished
3615 OStringBuffer sOut;
3617 {
3619 sOut.append(sCSS1_span_tag_end);
3620 break;
3621
3623 sOut.append(cCSS1_style_opt_end);
3624 break;
3625
3627 sOut.append(sCSS1_rule_end);
3628 break;
3629 }
3630 if (!sOut.isEmpty())
3631 Strm().WriteOString( sOut );
3632}
3633
3635{
3636 SwCSS1OutMode aMode( rWrt, CSS1_OUTMODE_SPAN_TAG |
3638
3639 Out( aCSS1AttrFnTab, rHt, rWrt );
3640
3641 if( !rWrt.m_bFirstCSS1Property && rWrt.m_bTagOn )
3642 rWrt.Strm().WriteOString( sCSS1_span_tag_end );
3643
3644 return rWrt;
3645}
3646
3648{
3649 SwCSS1OutMode aMode( rWrt, CSS1_OUTMODE_STYLE_OPT_ON |
3651 CSS1_OUTMODE_HINT, nullptr );
3652
3653 Out( aCSS1AttrFnTab, rHt, rWrt );
3654
3655 if( !rWrt.m_bFirstCSS1Property )
3656 rWrt.Strm().WriteChar( '\"' );
3657
3658 return rWrt;
3659}
3660
3661/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::chart::ChartAxisLabelPosition ePos
SvxGraphicPosition
GPOS_MT
GPOS_LT
GPOS_RT
GPOS_MM
GPOS_TILED
GPOS_MB
GPOS_LB
GPOS_LM
GPOS_RM
GPOS_RB
static OutputDevice * GetDefaultDevice()
OUString lowercase(const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
sal_uInt8 GetBlue() const
sal_uInt8 GetRed() const
sal_uInt8 GetGreen() const
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
Access to the style pool.
virtual SwPageDesc * GetPageDescFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return required automatic page style.
virtual SwCharFormat * GetCharFormatFromPool(sal_uInt16 nId)=0
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
static OUString convertToBcp47(LanguageType nLangID)
virtual Point GetRelativePos() const
virtual const tools::Rectangle & GetLogicRect() const
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
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
bool Set(const SfxItemSet &, bool bDeep=true)
sal_uInt16 Which() const
sal_uInt16 FirstWhich()
SfxItemState GetItemState(bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
sal_uInt16 NextWhich()
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
SvStream & WriteOString(std::string_view rStr)
SvStream & WriteChar(char nChar)
const editeng::SvxBorderLine * GetTop() const
const editeng::SvxBorderLine * GetRight() const
const editeng::SvxBorderLine * GetLeft() const
sal_Int16 GetDistance(SvxBoxItemLine nLine, bool bAllowNegative=false) const
const editeng::SvxBorderLine * GetBottom() const
const Color & GetColor() const
const OUString & GetGraphicLink() const
SvxGraphicPosition GetGraphicPos() const
FontStrikeout GetStrikeout() const
short GetTextFirstLineOffset() const
FontFamily GetFamily() const
const OUString & GetFamilyName() const
SvxBreak GetBreak() const
short GetTextFirstLineOffset() const
tools::Long GetRight() const
tools::Long GetTextLeft() const
tools::Long GetLeft() const
void SetLeft(const tools::Long nL, const sal_uInt16 nProp=100)
sal_uInt16 GetPropLineSpace() const
SvxInterLineSpaceRule GetInterLineSpaceRule() const
SvxLineSpaceRule GetLineSpaceRule() const
sal_uInt16 GetLineHeight() const
sal_Int32 GetFirstLineOffset() const
sal_Int32 GetAbsLSpace() const
tools::Long GetRight() const
const Size & GetSize() const
tools::Long GetTextLeft() const
FontLineStyle GetLineStyle() const
sal_uInt16 GetUpper() const
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
sal_uInt16 GetLower() const
SwAttrPool * GetPool() const
Definition: swatrset.hxx:190
const SvxBrushItem & GetBackground(bool=true) const
Definition: frmatr.hxx:70
Represents the style of a text portion.
Definition: charfmt.hxx:27
size_t size() const
Definition: charformats.hxx:71
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
Definition: node.hxx:765
Definition: doc.hxx:197
const SwFootnoteInfo & GetFootnoteInfo() const
Definition: doc.hxx:643
bool IsUsed(const sw::BroadcastingModify &) const
Definition: poolfmt.cxx:86
const SwCharFormats * GetCharFormats() const
Definition: doc.hxx:753
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:419
SwFootnoteIdxs & GetFootnoteIdxs()
Definition: doc.hxx:647
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:190
const SwTextFormatColls * GetTextFormatColls() const
Definition: doc.hxx:791
const SwEndNoteInfo & GetEndNoteInfo() const
Definition: doc.hxx:645
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:440
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1334
SwCharFormat * GetCharFormat(SwDoc &rDoc) const
Definition: docftn.cxx:140
FlyAnchors.
Definition: fmtanchr.hxx:37
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:67
SwNode * GetAnchorNode() const
Definition: atrfrm.cxx:1614
sal_uInt16 GetNumCols() const
Definition: fmtclds.hxx:114
If SwFormatDrop is a Client, it is the CharFormat that describes the font for the DropCaps.
Definition: paratr.hxx:72
sal_uInt8 GetLines() const
Definition: paratr.hxx:110
const SwCharFormat * GetCharFormat() const
Definition: paratr.hxx:122
sal_uInt16 GetDistance() const
Definition: paratr.hxx:119
sal_uInt8 GetWidthPercent() const
Definition: fmtfsize.hxx:91
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
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:95
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
Definition: fmtpdsc.hxx:36
SwPageDesc * GetPageDesc()
Definition: fmtpdsc.hxx:61
Defines the vertical position of a fly frame.
Definition: fmtornt.hxx:37
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:58
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
bool IsDefault() const
Definition: format.hxx:129
const SvxBoxItem & GetBox(bool=true) const
Definition: frmatr.hxx:108
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
sal_uInt16 Which() const
for Querying of Writer-functions.
Definition: format.hxx:82
const OUString & GetName() const
Definition: format.hxx:131
const SwFormatVertOrient & GetVertOrient(bool=true) const
Definition: fmtornt.hxx:113
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 SwFormatHoriOrient & GetHoriOrient(bool=true) const
Definition: fmtornt.hxx:115
const SvxULSpaceItem & GetULSpace(bool=true) const
Definition: frmatr.hxx:100
std::unique_ptr< SvxBrushItem > makeBackgroundBrushItem(bool=true) const
Definition: format.cxx:736
Style of a layout element.
Definition: frmfmt.hxx:72
SdrObject * FindSdrObject()
Definition: frmfmt.hxx:153
bool mbXHTML
If XHTML markup should be written instead of HTML.
Definition: wrthtml.hxx:410
bool m_bNoAlign
Definition: wrthtml.hxx:392
void OutCSS1_PropertyAscii(std::string_view pProp, std::string_view rVal)
Definition: wrthtml.hxx:631
bool m_bOutTable
Definition: wrthtml.hxx:377
bool m_bCfgPreferStyles
Definition: wrthtml.hxx:356
static OString convertDirection(SvxFrameDirection nDirection)
Definition: wrthtml.cxx:1496
bool mbEmbedImages
Definition: wrthtml.hxx:406
void OutCSS1_Property(std::string_view pProp, const OUString &rVal)
Definition: wrthtml.hxx:637
bool mbSkipHeaderFooter
If HTML header and footer should be written as well, or just the content itself.
Definition: wrthtml.hxx:405
static bool HasScriptDependentItems(const SfxItemSet &rItemSet, bool bCheckDropCap)
Definition: css1atr.cxx:1144
void IncIndentLevel()
Definition: wrthtml.hxx:525
short m_nFirstLineIndent
Definition: wrthtml.hxx:335
ErrCode m_nWarn
Definition: wrthtml.hxx:323
bool IsCSS1Source(sal_uInt16 n) const
Definition: wrthtml.hxx:620
void OutStyleSheet(const SwPageDesc &rPageDesc)
Definition: css1atr.cxx:475
bool m_bFirstCSS1Property
Definition: wrthtml.hxx:385
std::set< OUString > m_aScriptTextStyles
Definition: wrthtml.hxx:301
bool m_bTagOn
Definition: wrthtml.hxx:364
const SwPageDesc * m_pCurrPageDesc
Definition: wrthtml.hxx:318
static sal_uInt16 GetDefListLvl(std::u16string_view rNm, sal_uInt16 nPoolId)
Definition: htmlatr.cxx:96
void OutCSS1_TableFrameFormatOptions(const SwFrameFormat &rFrameFormat)
Writes the formatting for tables.
Definition: css1atr.cxx:2036
static void SubtractItemSet(SfxItemSet &rItemSet, const SfxItemSet &rRefItemSet, bool bSetDefaults, bool bClearSame=true, const SfxItemSet *pRefScriptItemSet=nullptr)
Definition: css1atr.cxx:983
static const SwFormat * GetTemplateFormat(sal_uInt16 nPoolId, IDocumentStylePoolAccess *pTemplate)
Definition: css1atr.cxx:938
bool IsCSS1Script(sal_uInt16 n) const
Definition: wrthtml.hxx:625
static const SwFormat * GetParentFormat(const SwFormat &rFormat, sal_uInt16 nDeep)
Definition: css1atr.cxx:956
sal_Int32 m_nDfltRightMargin
Definition: wrthtml.hxx:334
void DecIndentLevel()
Definition: wrthtml.hxx:529
OString GetNamespace() const
Determines the prefix string needed to respect the requested namespace alias.
Definition: wrthtml.cxx:1580
sal_Int32 m_nDfltLeftMargin
Definition: wrthtml.hxx:333
bool mbReqIF
If the ReqIF subset of XHTML should be written.
Definition: wrthtml.hxx:414
sal_Int32 m_nLeftMargin
Definition: wrthtml.hxx:332
sal_uInt16 m_nCSS1OutMode
Definition: wrthtml.hxx:346
bool m_bCSS1IgnoreFirstPageDesc
Definition: wrthtml.hxx:388
bool m_bCfgNetscape4
Definition: wrthtml.hxx:401
static sal_uInt16 GetCSS1Selector(const SwFormat *pFormat, OString &rToken, OUString &rClass, sal_uInt16 &rRefPoolId, OUString *pPseudo=nullptr)
Definition: css1atr.cxx:599
void OutCSS1_FrameFormatOptions(const SwFrameFormat &rFrameFormat, HtmlFrmOpts nFrameOpts, const SdrObject *pSdrObj=nullptr, const SfxItemSet *pItemSet=nullptr)
Definition: css1atr.cxx:1839
void OutCSS1_UnitProperty(std::string_view pProp, tools::Long nVal)
Definition: css1atr.cxx:461
sal_uInt16 m_nDfltTopMargin
Definition: wrthtml.hxx:337
bool m_bParaDotLeaders
Definition: wrthtml.hxx:418
FieldUnit GetCSS1Unit() const
Definition: wrthtml.hxx:612
sal_uInt16 m_nDfltBottomMargin
Definition: wrthtml.hxx:338
void OutCSS1_SfxItemSet(const SfxItemSet &rItemSet, bool bDeep=true)
Definition: css1atr.cxx:3577
short m_nDfltFirstLineIndent
Definition: wrthtml.hxx:336
void OutNewLine(bool bCheck=false)
Definition: wrthtml.cxx:1531
bool m_bFirstCSS1Rule
Definition: wrthtml.hxx:384
static sal_uInt32 ToPixel(sal_uInt32 nVal, const bool bVert)
Definition: htmlatr.cxx:2628
FieldUnit m_eCSS1Unit
Definition: wrthtml.hxx:279
static void PrepareFontList(const SvxFontItem &rFontItem, OUString &rNames, sal_Unicode cQuote, bool bGeneric)
Definition: css1atr.cxx:1066
rtl::Reference< SwDoc > m_xTemplate
Definition: wrthtml.hxx:315
bool IsHTMLMode(sal_uInt32 nMode) const
Definition: wrthtml.hxx:598
SvxFrameDirection GetHTMLDirection(SvxFrameDirection nDir) const
Definition: wrthtml.cxx:1465
bool m_bCfgPrintLayout
Definition: wrthtml.hxx:417
OUString m_aCSS1Selector
Definition: wrthtml.hxx:310
void OutCSS1_FrameFormatBackground(const SwFrameFormat &rFrameFormat)
Definition: css1atr.cxx:2127
SwNodeIndex * m_pStartNdIdx
Definition: wrthtml.hxx:317
bool m_bCfgCpyLinkedGrfs
Definition: wrthtml.hxx:359
void OutCSS1_PixelProperty(std::string_view pProp, tools::Long nVal, bool bVert)
Definition: css1atr.cxx:468
void OutCSS1_TableCellBordersAndBG(const SwFrameFormat &rFrameFormat, const SvxBrushItem *pBrushItem)
Writes the borders and background for table cells.
Definition: css1atr.cxx:2068
void OutCSS1_SectionFormatOptions(const SwFrameFormat &rFrameFormat, const SwFormatCol *pCol)
Definition: css1atr.cxx:2079
sal_uInt16 m_nCSS1Script
Definition: wrthtml.hxx:347
std::set< OUString > m_aScriptParaStyles
Definition: wrthtml.hxx:300
SwNodeOffset GetIndex() const
Definition: ndindex.hxx:111
Base class of the Writer document model elements.
Definition: node.hxx:98
SwFrameFormat * GetFlyFormat() const
If node is in a fly return the respective format.
Definition: node.cxx:738
SwNodeOffset GetIndex() const
Definition: node.hxx:312
const SwStartNode * FindTableBoxStartNode() const
Definition: node.hxx:218
bool IsContentNode() const
Definition: node.hxx:679
SwTableNode * FindTableNode()
Search table node, in which it is.
Definition: node.cxx:380
SwContentNode * GetContentNode()
Definition: node.hxx:666
const SwNumFormat & Get(sal_uInt16 i) const
Definition: number.cxx:87
sal_uInt16 GetPoolFormatId() const
Query and set PoolFormat-Id.
Definition: pagedesc.hxx:275
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:238
bool GetLandscape() const
Definition: pagedesc.hxx:199
const SwPageDesc * GetFollow() const
Definition: pagedesc.hxx:267
Starts a section of nodes in the document model.
Definition: node.hxx:348
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:443
SwTableLine * GetUpper()
Definition: swtable.hxx:477
SwFrameFormat * GetFrameFormat()
Definition: swtable.hxx:481
SwTableLine is one table row in the document model.
Definition: swtable.hxx:376
SwFrameFormat * GetFrameFormat()
Definition: swtable.hxx:398
SwTableBox * GetUpper()
Definition: swtable.hxx:394
const SwTable & GetTable() const
Definition: node.hxx:542
SwTableFormat * GetFrameFormat()
Definition: swtable.hxx:209
const SwTableBox * GetTableBox(const OUString &rName, const bool bPerformValidCheck=false) const
Definition: swtable.cxx:1344
Represents the style of a paragraph.
Definition: fmtcol.hxx:61
size_t size() const
Definition: docary.hxx:88
const Color & GetRetoucheColor() const
Definition: viewopt.hxx:744
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:451
SvStream & Strm()
Definition: writer.cxx:193
SwDoc * m_pDoc
Definition: shellio.hxx:407
std::shared_ptr< SwUnoCursor > m_pCurrentPam
Definition: shellio.hxx:409
const OUString & GetBaseURL() const
Definition: shellio.hxx:443
IDocumentStylePoolAccess & getIDocumentStylePoolAccess()
Definition: writer.cxx:117
bool CopyLocalFileToINet(OUString &rFileNm)
Definition: writer.cxx:264
static bool GraphicToBase64(const Graphic &rGraphic, OUString &rOUString, bool bAddPrefix=true, ConvertDataFormat aTargetFormat=ConvertDataFormat::Unknown)
const Color & GetColor() const
tools::Long GetWidth() const
SvxBorderLineStyle GetBorderLineStyle() const
constexpr Size GetSize() const
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)
static SwHTMLWriter & OutCSS1_SvxKerning(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2463
SwHTMLWriter & OutCSS1_HintSpanTag(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:3634
static SwHTMLWriter & OutCSS1_SvxTextLn_SvxCrOut_SvxBlink(SwHTMLWriter &rWrt, const SvxUnderlineItem *pUItem, const SvxOverlineItem *pOItem, const SvxCrossedOutItem *pCOItem, const SvxBlinkItem *pBItem)
Definition: css1atr.cxx:2212
SwAttrFnTab const aCSS1AttrFnTab
Definition: css1atr.cxx:3407
bool IgnorePropertyForReqIF(bool bReqIF, std::string_view rProperty, std::string_view rValue, std::optional< sw::Css1Background > oMode)
Determines if rProperty with a given rValue has to be suppressed due to ReqIF mode.
Definition: css1atr.cxx:188
static SwHTMLWriter & OutCSS1_SvxHidden(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2545
static SwHTMLWriter & OutCSS1_SvxFrameDirection(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:3370
SwHTMLWriter & OutCSS1_BodyTagStyleOpt(SwHTMLWriter &rWrt, const SfxItemSet &rItemSet)
Definition: css1atr.cxx:1752
static SwHTMLWriter & OutCSS1_SvxOverline(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2533
SwHTMLWriter & OutCSS1_SvxBox(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:3299
static SwHTMLWriter & OutCSS1_SwPageDesc(SwHTMLWriter &rWrt, const SwPageDesc &rFormat, IDocumentStylePoolAccess *pDoc, SwDoc *pTemplate, sal_uInt16 nRefPoolId, bool bExtRef, bool bPseudo=true)
Definition: css1atr.cxx:1601
#define DOT_LEADERS_MAX_WIDTH
Definition: css1atr.cxx:120
static SwHTMLWriter & OutCSS1_SvxFont(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2373
static SwHTMLWriter & OutCSS1_SvxAdjust(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2657
SwHTMLWriter & OutCSS1_ParaTagStyleOpt(SwHTMLWriter &rWrt, const SfxItemSet &rItemSet)
Definition: css1atr.cxx:1785
static SwHTMLWriter & OutCSS1_SvxRightMargin(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2834
static SwHTMLWriter & OutCSS1_SvxColor(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2343
static sal_uInt16 GetCSS1Selector(const SwFormat *pFormat, OUString &rSelector, sal_uInt16 &rRefPoolId)
Definition: css1atr.cxx:913
static SwHTMLWriter & OutCSS1_SvxFormatSplit(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2681
static void OutCSS1_SwFormatDropAttrs(SwHTMLWriter &rHWrt, const SwFormatDrop &rDrop, const SfxItemSet *pCharFormatItemSet=nullptr)
Definition: css1atr.cxx:2717
SwHTMLWriter & OutCSS1_NumberBulletListStyleOpt(SwHTMLWriter &rWrt, const SwNumRule &rNumRule, sal_uInt8 nLevel)
Definition: css1atr.cxx:1807
static SwHTMLWriter & OutCSS1_SvxLRSpace(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2849
static SwHTMLWriter & OutCSS1_SvxLanguage(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2492
static SwHTMLWriter & OutCSS1_SvxFontHeight(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2403
static SwHTMLWriter & OutCSS1_SwFootnoteInfo(SwHTMLWriter &rWrt, const SwEndNoteInfo &rInfo, SwDoc *pDoc, bool bHasNotes, bool bEndNote)
Definition: css1atr.cxx:1702
static SwHTMLWriter & OutCSS1_SvxCrossedOut(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2361
static SwHTMLWriter & OutCSS1_SvxWidows(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2701
static SwHTMLWriter & OutCSS1_SvxUnderline(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2521
static SwHTMLWriter & OutCSS1_SwFormatFrameSize(SwHTMLWriter &rWrt, const SfxPoolItem &rHt, Css1FrameSize nMode)
Definition: css1atr.cxx:2766
static SwHTMLWriter & OutCSS1_SvxBlink(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2593
static SwHTMLWriter & OutCSS1_SvxFirstLineIndent(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2794
static SwHTMLWriter & OutCSS1_SvxFormatBreak_SwFormatPDesc_SvxFormatKeep(SwHTMLWriter &rWrt, const SfxItemSet &rItemSet, bool bDeep)
Definition: css1atr.cxx:3011
static SwHTMLWriter & OutCSS1_SwFormat(SwHTMLWriter &rWrt, const SwFormat &rFormat, IDocumentStylePoolAccess *pDoc, SwDoc *pTemplate)
Definition: css1atr.cxx:1435
OString GetCSS1_Color(const Color &rColor)
Definition: css1atr.cxx:224
static SwHTMLWriter & OutCSS1_SvxBrush(SwHTMLWriter &rWrt, const SfxPoolItem &rHt, sw::Css1Background nMode, const OUString *pGraphicName)
Definition: css1atr.cxx:3040
static SwHTMLWriter & OutCSS1_SvxLineSpacing(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2605
static SwHTMLWriter & OutCSS1_SvxCaseMap(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2317
static SwHTMLWriter & OutCSS1_SvxPosture(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2427
static bool OutCSS1Rule(SwHTMLWriter &rWrt, const OUString &rSelector, const SfxItemSet &rItemSet, bool bHasClass, bool bCheckForPseudo)
Definition: css1atr.cxx:1232
bool swhtml_css1atr_equalFontItems(const SfxPoolItem &r1, const SfxPoolItem &r2)
Definition: css1atr.cxx:975
static SwHTMLWriter & OutCSS1_SvxULSpace_SvxLRSpace(SwHTMLWriter &rWrt, const SvxULSpaceItem *pULSpace, const SvxLRSpaceItem *pLRSpace)
Definition: css1atr.cxx:2904
static SwHTMLWriter & OutCSS1_SvxFontWeight(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2553
SwHTMLWriter & OutCSS1_TableBGStyleOpt(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Writes the background of table rows.
Definition: css1atr.cxx:1794
static SwHTMLWriter & OutCSS1_SvxTextLeftMargin(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2812
static void AddUnitPropertyValue(OStringBuffer &rOut, tools::Long nVal, FieldUnit eUnit)
Definition: css1atr.cxx:383
static SwHTMLWriter & OutCSS1_SvxULSpace(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2885
static bool OutCSS1_FrameFormatBrush(SwHTMLWriter &rWrt, const SvxBrushItem &rBrushItem)
Definition: css1atr.cxx:2111
static void OutCSS1DropCapRule(SwHTMLWriter &rWrt, const OUString &rSelector, const SwFormatDrop &rDrop, bool bHasClass, bool bHasScriptDependencies)
Definition: css1atr.cxx:1336
static void OutCSS1_SvxBorderLine(SwHTMLWriter &rWrt, std::string_view pProperty, const SvxBorderLine *pLine)
Definition: css1atr.cxx:3224
SwHTMLWriter & OutCSS1_HintStyleOpt(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:3647
static SwHTMLWriter & OutCSS1_SwFormatLayoutSplit(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2691
static SwHTMLWriter & OutCSS1_SwFormatDrop(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2743
#define HTML_HEADSPACE
Definition: css1atr.cxx:102
static SwHTMLWriter & OutCSS1_SvxOrphans(SwHTMLWriter &rWrt, const SfxPoolItem &rHt)
Definition: css1atr.cxx:2709
constexpr std::string_view sCSS1_PV_center
Definition: css1kywd.hxx:123
constexpr std::string_view sCSS1_P_font_weight
Definition: css1kywd.hxx:76
constexpr std::string_view sCSS1_P_left
Definition: css1kywd.hxx:188
constexpr std::string_view sCSS1_PV_dotted
Definition: css1kywd.hxx:163
constexpr std::string_view sCSS1_PV_double
Definition: css1kywd.hxx:166
constexpr std::string_view sCSS1_P_font_family
Definition: css1kywd.hxx:51
constexpr std::string_view sCSS1_P_width
Definition: css1kywd.hxx:172
constexpr std::string_view sCSS1_P_border_right
Definition: css1kywd.hxx:157
constexpr std::string_view sCSS1_P_column_count
Definition: css1kywd.hxx:179
constexpr std::string_view sCSS1_PV_extra_light
Definition: css1kywd.hxx:78
constexpr std::string_view sCSS1_P_margin_top
Definition: css1kywd.hxx:137
constexpr std::string_view sCSS1_PV_normal
Definition: css1kywd.hxx:61
constexpr std::string_view sCSS1_visited
Definition: css1kywd.hxx:33
constexpr std::string_view sCSS1_P_max_width
Definition: css1kywd.hxx:173
constexpr std::string_view sCSS1_UNIT_pt
Definition: css1kywd.hxx:42
constexpr std::string_view sCSS1_P_text_indent
Definition: css1kywd.hxx:127
constexpr std::string_view sCSS1_P_float
Definition: css1kywd.hxx:177
constexpr std::string_view sCSS1_PV_groove
Definition: css1kywd.hxx:167
constexpr std::string_view sCSS1_first_letter
Definition: css1kywd.hxx:34
constexpr std::string_view sCSS1_P_font_variant
Definition: css1kywd.hxx:65
constexpr std::string_view sCSS1_PV_overline
Definition: css1kywd.hxx:116
constexpr std::string_view sCSS1_UNIT_pc
Definition: css1kywd.hxx:45
constexpr std::string_view sCSS1_PV_bottom
Definition: css1kywd.hxx:104
constexpr std::string_view sCSS1_link
Definition: css1kywd.hxx:32
constexpr std::string_view sCSS1_UNIT_inch
Definition: css1kywd.hxx:46
constexpr std::string_view sCSS1_P_height
Definition: css1kywd.hxx:175
constexpr std::string_view sCSS1_P_letter_spacing
Definition: css1kywd.hxx:110
constexpr std::string_view sCSS1_UNIT_px
Definition: css1kywd.hxx:47
constexpr std::string_view sCSS1_P_text_decoration
Definition: css1kywd.hxx:112
constexpr std::string_view sCSS1_P_size
Definition: css1kywd.hxx:197
constexpr std::string_view sCSS1_UNIT_mm
Definition: css1kywd.hxx:43
constexpr std::string_view sCSS1_PV_left
Definition: css1kywd.hxx:122
constexpr std::string_view sCSS1_P_font_size
Definition: css1kywd.hxx:86
constexpr std::string_view sCSS1_PV_sans_serif
Definition: css1kywd.hxx:54
constexpr std::string_view sCSS1_PV_blink
Definition: css1kywd.hxx:118
constexpr std::string_view sCSS1_PV_cursive
Definition: css1kywd.hxx:55
constexpr std::string_view sCSS1_P_padding
Definition: css1kywd.hxx:145
constexpr std::string_view sCSS1_PV_extra_bold
Definition: css1kywd.hxx:84
constexpr std::string_view sCSS1_PV_justify
Definition: css1kywd.hxx:125
constexpr std::string_view sCSS1_PV_serif
Definition: css1kywd.hxx:53
constexpr std::string_view sCSS1_PV_solid
Definition: css1kywd.hxx:165
constexpr std::string_view sCSS1_P_display
Definition: css1kywd.hxx:218
constexpr std::string_view sCSS1_PV_no_repeat
Definition: css1kywd.hxx:100
constexpr std::string_view sCSS1_P_orphans
Definition: css1kywd.hxx:200
constexpr std::string_view sCSS1_P_background
Definition: css1kywd.hxx:94
constexpr std::string_view sCSS1_P_dir
Definition: css1kywd.hxx:180
constexpr std::string_view sCSS1_P_page_break_before
Definition: css1kywd.hxx:194
constexpr std::string_view sCSS1_left
Definition: css1kywd.hxx:36
constexpr std::string_view sCSS1_PV_uppercase
Definition: css1kywd.hxx:73
constexpr std::string_view sCSS1_P_border_bottom
Definition: css1kywd.hxx:159
constexpr std::string_view sCSS1_P_padding_left
Definition: css1kywd.hxx:143
constexpr std::string_view sCSS1_P_text_align
Definition: css1kywd.hxx:120
constexpr std::string_view sCSS1_PV_light
Definition: css1kywd.hxx:79
constexpr std::string_view sCSS1_P_page_break_inside
Definition: css1kywd.hxx:196
constexpr std::string_view sCSS1_PV_middle
Definition: css1kywd.hxx:103
constexpr std::string_view sCSS1_PV_lowercase
Definition: css1kywd.hxx:74
constexpr std::string_view sCSS1_first
Definition: css1kywd.hxx:38
constexpr std::string_view sCSS1_PV_ltr
Definition: css1kywd.hxx:214
constexpr std::string_view sCSS1_P_border_left
Definition: css1kywd.hxx:156
constexpr std::string_view sCSS1_P_widows
Definition: css1kywd.hxx:198
constexpr std::string_view sCSS1_P_direction
Definition: css1kywd.hxx:213
constexpr std::string_view sCSS1_PV_landscape
Definition: css1kywd.hxx:207
constexpr std::string_view sCSS1_PV_small_caps
Definition: css1kywd.hxx:68
constexpr std::string_view sCSS1_PV_none
Definition: css1kywd.hxx:114
constexpr std::string_view sCSS1_P_line_height
Definition: css1kywd.hxx:129
constexpr std::string_view sCSS1_PV_bold
Definition: css1kywd.hxx:83
constexpr std::string_view sCSS1_PV_portrait
Definition: css1kywd.hxx:206
constexpr std::string_view sCSS1_P_font_style
Definition: css1kywd.hxx:59
constexpr std::string_view sCSS1_UNIT_cm
Definition: css1kywd.hxx:44
constexpr std::string_view sCSS1_PV_underline
Definition: css1kywd.hxx:115
constexpr std::string_view sCSS1_PV_ridge
Definition: css1kywd.hxx:168
constexpr std::string_view sCSS1_P_position
Definition: css1kywd.hxx:184
constexpr std::string_view sCSS1_url
Definition: css1kywd.hxx:40
constexpr std::string_view sCSS1_P_border
Definition: css1kywd.hxx:160
constexpr std::string_view sCSS1_P_so_language
Definition: css1kywd.hxx:212
constexpr std::string_view sCSS1_PV_rtl
Definition: css1kywd.hxx:215
constexpr std::string_view sCSS1_P_border_top
Definition: css1kywd.hxx:158
constexpr std::string_view sCSS1_PV_absolute
Definition: css1kywd.hxx:186
constexpr std::string_view sCSS1_PV_monospace
Definition: css1kywd.hxx:57
constexpr std::string_view sCSS1_P_padding_bottom
Definition: css1kywd.hxx:142
constexpr std::string_view sCSS1_PV_demi_light
Definition: css1kywd.hxx:80
constexpr std::string_view sCSS1_PV_transparent
Definition: css1kywd.hxx:97
constexpr std::string_view sCSS1_PV_outset
Definition: css1kywd.hxx:170
constexpr std::string_view sCSS1_P_page_break_after
Definition: css1kywd.hxx:195
constexpr std::string_view sCSS1_PV_inset
Definition: css1kywd.hxx:169
constexpr std::string_view sCSS1_P_padding_right
Definition: css1kywd.hxx:144
constexpr std::string_view sCSS1_PV_demi_bold
Definition: css1kywd.hxx:82
constexpr std::string_view sCSS1_P_margin_left
Definition: css1kywd.hxx:135
constexpr std::string_view sCSS1_PV_top
Definition: css1kywd.hxx:102
constexpr std::string_view sCSS1_P_text_transform
Definition: css1kywd.hxx:70
constexpr std::string_view sCSS1_PV_line_through
Definition: css1kywd.hxx:117
constexpr std::string_view sCSS1_right
Definition: css1kywd.hxx:37
constexpr std::string_view sCSS1_PV_italic
Definition: css1kywd.hxx:62
constexpr std::string_view sCSS1_PV_inherit
Definition: css1kywd.hxx:216
constexpr std::string_view sCSS1_PV_oblique
Definition: css1kywd.hxx:63
constexpr std::string_view sCSS1_PV_right
Definition: css1kywd.hxx:124
constexpr std::string_view sCSS1_P_color
Definition: css1kywd.hxx:92
constexpr std::string_view sCSS1_P_margin_right
Definition: css1kywd.hxx:136
constexpr std::string_view sCSS1_PV_avoid
Definition: css1kywd.hxx:204
constexpr std::string_view sCSS1_PV_scroll
Definition: css1kywd.hxx:106
constexpr std::string_view sCSS1_PV_capitalize
Definition: css1kywd.hxx:72
constexpr std::string_view sCSS1_P_top
Definition: css1kywd.hxx:190
constexpr std::string_view sCSS1_P_padding_top
Definition: css1kywd.hxx:141
constexpr std::string_view sCSS1_P_margin_bottom
Definition: css1kywd.hxx:138
constexpr std::string_view sCSS1_PV_dashed
Definition: css1kywd.hxx:164
constexpr std::string_view sCSS1_P_margin
Definition: css1kywd.hxx:139
constexpr std::string_view sCSS1_page
Definition: css1kywd.hxx:29
constexpr std::string_view sCSS1_PV_auto
Definition: css1kywd.hxx:147
constexpr std::string_view sCSS1_PV_fantasy
Definition: css1kywd.hxx:56
constexpr std::string_view sCSS1_PV_repeat
Definition: css1kywd.hxx:99
constexpr std::string_view sCSS1_PV_always
Definition: css1kywd.hxx:203
float u
FieldUnit
sal_Int16 nValue
LINESTYLE_NONE
LINESTYLE_DONTKNOW
STRIKEOUT_NONE
STRIKEOUT_DONTKNOW
ITALIC_NORMAL
ITALIC_NONE
ITALIC_OBLIQUE
FAMILY_DECORATIVE
FAMILY_SCRIPT
FAMILY_SWISS
FAMILY_MODERN
FAMILY_ROMAN
WEIGHT_ULTRALIGHT
WEIGHT_ULTRABOLD
WEIGHT_BOLD
WEIGHT_NORMAL
WEIGHT_LIGHT
WEIGHT_SEMIBOLD
WEIGHT_SEMILIGHT
SvxFrameDirection
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
constexpr TypedWhichId< SvxCrossedOutItem > RES_CHRATR_CROSSEDOUT(5)
constexpr TypedWhichId< SvxFormatKeepItem > RES_KEEP(116)
constexpr sal_uInt16 RES_BOXATR_END(159)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
constexpr sal_uInt16 RES_CHRATR_END(46)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
constexpr TypedWhichId< SwConditionTextFormatColl > RES_CONDTXTFMTCOLL(166)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
constexpr TypedWhichId< SwFormatLayoutSplit > RES_LAYOUT_SPLIT(119)
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(99)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CTL_WEIGHT(31)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CTL_POSTURE(30)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
constexpr TypedWhichId< SwCharFormat > RES_CHRFMT(RES_FMT_BEGIN)
constexpr TypedWhichId< SvxBlinkItem > RES_CHRATR_BLINK(18)
constexpr TypedWhichId< SvxOverlineItem > RES_CHRATR_OVERLINE(38)
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(165)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(112)
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(100)
constexpr TypedWhichId< SwFormatDrop > RES_PARATR_DROP(70)
constexpr TypedWhichId< SwTextFormatColl > RES_TXTFMTCOLL(163)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CJK_WEIGHT(26)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CJK_POSTURE(25)
constexpr TypedWhichId< SvxBoxItem > RES_CHRATR_BOX(40)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(97)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(98)
#define OOO_STRING_SVTOOLS_HTML_parabreak
#define OOO_STRING_SVTOOLS_HTML_O_data
#define OOO_STRING_SVTOOLS_HTML_head6
#define OOO_STRING_SVTOOLS_HTML_emphasis
#define OOO_STRING_SVTOOLS_HTML_head1
#define OOO_STRING_SVTOOLS_HTML_tabledata
#define OOO_STRING_SVTOOLS_HTML_dd
#define OOO_STRING_SVTOOLS_HTML_sample
#define OOO_STRING_SVTOOLS_HTML_head4
#define OOO_STRING_SVTOOLS_HTML_tableheader
#define OOO_STRING_SVTOOLS_HTML_style
#define OOO_STRING_SVTOOLS_HTML_xmp
#define OOO_STRING_SVTOOLS_HTML_sdendnote_sym
#define OOO_STRING_SVTOOLS_HTML_code
#define OOO_STRING_SVTOOLS_HTML_anchor
#define OOO_STRING_SVTOOLS_HTML_span
#define OOO_STRING_SVTOOLS_HTML_definstance
#define OOO_STRING_SVTOOLS_HTML_sdendnote
#define OOO_STRING_SVTOOLS_HTML_sdendnote_anc
#define OOO_STRING_SVTOOLS_HTML_address
#define OOO_STRING_SVTOOLS_HTML_teletype
#define OOO_STRING_SVTOOLS_HTML_sdfootnote_anc
#define OOO_STRING_SVTOOLS_HTML_horzrule
#define OOO_STRING_SVTOOLS_HTML_preformtxt
#define OOO_STRING_SVTOOLS_HTML_citation
#define OOO_STRING_SVTOOLS_HTML_dt
#define OOO_STRING_SVTOOLS_HTML_O_type
#define OOO_STRING_SVTOOLS_HTML_listing
#define OOO_STRING_SVTOOLS_HTML_sdfootnote_sym
#define OOO_STRING_SVTOOLS_HTML_sdfootnote
#define OOO_STRING_SVTOOLS_HTML_strong
#define OOO_STRING_SVTOOLS_HTML_variable
#define OOO_STRING_SVTOOLS_HTML_head3
#define OOO_STRING_SVTOOLS_HTML_keyboard
#define OOO_STRING_SVTOOLS_HTML_blockquote
#define OOO_STRING_SVTOOLS_HTML_head5
#define OOO_STRING_SVTOOLS_HTML_head2
#define OOO_STRING_SVTOOLS_HTML_O_style
#define HTML_NUMBER_BULLET_MARGINLEFT
Definition: htmlnum.hxx:25
#define HTML_NUMBER_BULLET_INDENT
Definition: htmlnum.hxx:26
CharClass & GetAppCharClass()
Definition: init.cxx:721
OUString aName
sal_Int64 n
#define LANGUAGE_DONTKNOW
sal_uInt16 nPos
sal_Int32 nFirstLineOffset
#define SAL_N_ELEMENTS(arr)
if(aStr !=aBuf) UpdateName_Impl(m_xFollowLb.get()
aStr
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
Definition: langhelper.cxx:393
SVL_DLLPUBLIC OUString simpleNormalizedMakeRelative(OUString const &baseUriReference, OUString const &uriReference)
tools::Long const nLeftMargin
OString strip(const OString &rIn, char c)
int i
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
sal_Int16 GetCaseMap(sal_Int32 nToken)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
Css1Background
Definition: wrthtml.hxx:261
long Long
SwNodeOffset abs(const SwNodeOffset &a)
Definition: nodeoffset.hxx:34
const char GetValue[]
@ RES_POOLCOLL_HEADLINE5
Heading 5.
Definition: poolfmt.hxx:266
@ RES_POOLCOLL_TEXT
Text body.
Definition: poolfmt.hxx:251
@ RES_POOLCOLL_STANDARD
Standard.
Definition: poolfmt.hxx:250
@ RES_POOLCOLL_HEADLINE6
Heading 6.
Definition: poolfmt.hxx:267
@ RES_POOLCOLL_HTML_BLOCKQUOTE
Definition: poolfmt.hxx:432
@ RES_POOLCOLL_HTML_DD
Definition: poolfmt.hxx:435
@ RES_POOLCOLL_TABLE
Subgroup table.
Definition: poolfmt.hxx:341
@ RES_POOLCOLL_HTML_DT
Definition: poolfmt.hxx:436
@ RES_POOLCOLL_HTML_HR
Definition: poolfmt.hxx:434
@ RES_POOLCOLL_HEADLINE_BASE
Subgroup headings.
Definition: poolfmt.hxx:261
@ RES_POOLCOLL_SEND_ADDRESS
Sender.
Definition: poolfmt.hxx:355
@ RES_POOLCOLL_HEADLINE2
Heading 2.
Definition: poolfmt.hxx:263
@ RES_POOLCOLL_HEADLINE4
Heading 4.
Definition: poolfmt.hxx:265
@ RES_POOLCOLL_FOOTNOTE
Footnotes.
Definition: poolfmt.hxx:353
@ RES_POOLCOLL_HTML_PRE
Definition: poolfmt.hxx:433
@ RES_POOLCOLL_HEADLINE1
Heading 1.
Definition: poolfmt.hxx:262
@ RES_POOLCOLL_TABLE_HDLN
Table of Contents - heading.
Definition: poolfmt.hxx:342
@ RES_POOLCOLL_HEADLINE3
Heading 3.
Definition: poolfmt.hxx:264
@ RES_POOLCOLL_ENDNOTE
Endnotes.
Definition: poolfmt.hxx:356
@ RES_POOLPAGE_LEFT
Left page.
Definition: poolfmt.hxx:172
@ RES_POOLPAGE_HTML
HTML.
Definition: poolfmt.hxx:176
@ RES_POOLPAGE_FIRST
First page.
Definition: poolfmt.hxx:171
@ RES_POOLPAGE_RIGHT
Right page.
Definition: poolfmt.hxx:173
@ RES_POOLCHR_HTML_TELETYPE
Definition: poolfmt.hxx:143
@ RES_POOLCHR_INET_VISIT
Internet visited.
Definition: poolfmt.hxx:121
@ RES_POOLCHR_HTML_CODE
Definition: poolfmt.hxx:138
@ RES_POOLCHR_HTML_SAMPLE
Definition: poolfmt.hxx:139
@ RES_POOLCHR_HTML_CITATION
Definition: poolfmt.hxx:136
@ RES_POOLCHR_FOOTNOTE
Footnote.
Definition: poolfmt.hxx:113
@ RES_POOLCHR_HTML_EMPHASIS
Definition: poolfmt.hxx:135
@ RES_POOLCHR_ENDNOTE
Endnote.
Definition: poolfmt.hxx:124
@ RES_POOLCHR_INET_NORMAL
Internet normal.
Definition: poolfmt.hxx:120
@ RES_POOLCHR_HTML_KEYBOARD
Definition: poolfmt.hxx:140
@ RES_POOLCHR_HTML_STRONG
Definition: poolfmt.hxx:137
@ RES_POOLCHR_HTML_DEFINSTANCE
Definition: poolfmt.hxx:142
@ RES_POOLCHR_HTML_VARIABLE
Definition: poolfmt.hxx:141
const sal_uInt16 POOLGRP_NOCOLLID
POOLCOLL-IDs: +-—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+ !User! Range ! 0 ! Offset ! +-—+—+—+—+—+—+—+—+—+—+—+...
Definition: poolfmt.hxx:59
const sal_uInt16 USER_FMT
POLLCOLL-groups:
Definition: poolfmt.hxx:63
bool IsPoolUserFormat(sal_uInt16 nId)
Definition: poolfmt.hxx:86
static SVT_DLLPUBLIC SvStream & Out_AsciiTag(SvStream &, std::string_view rStr, bool bOn=true)
static SVT_DLLPUBLIC SvStream & Out_String(SvStream &, const OUString &, OUString *pNonConvertableChars=nullptr)
SvxLineSpaceRule
#define WARN_SWG_POOR_LOAD
Definition: swerror.h:39
RndStdIds
SvxBoxItem & rBoxItem
unsigned char sal_uInt8
sal_uInt16 sal_Unicode
unsigned long Pixel
SwHTMLWriter & Out(const SwAttrFnTab, const SfxPoolItem &, SwHTMLWriter &)
Definition: wrt_fn.cxx:31
FnAttrOut SwAttrFnTab[POOLATTR_END - POOLATTR_BEGIN]
Definition: wrt_fn.hxx:33
SwHTMLWriter & Out_SfxItemSet(const SwAttrFnTab, SwHTMLWriter &, const SfxItemSet &, bool bDeep)
Definition: wrt_fn.cxx:42
#define CSS1_OUTMODE_SPAN_TAG
Definition: wrthtml.hxx:156
#define CSS1_OUTMODE_CJK
Definition: wrthtml.hxx:182
#define CSS1_OUTMODE_ENCODE
Definition: wrthtml.hxx:174
#define CSS1_OUTMODE_RULE_ON
Definition: wrthtml.hxx:144
#define CSS1_OUTMODE_STYLE_OPT_OFF
Definition: wrthtml.hxx:151
#define CSS1_OUTMODE_DROPCAP
Definition: wrthtml.hxx:169
HtmlFrmOpts
Definition: wrthtml.hxx:76
#define CSS1_OUTMODE_PARA
Definition: wrthtml.hxx:164
#define HTML_PARSPACE
Definition: wrthtml.hxx:70
#define CSS1_OUTMODE_SPAN_TAG_OFF
Definition: wrthtml.hxx:150
#define CSS1_OUTMODE_SPAN_TAG1_ON
Definition: wrthtml.hxx:145
#define HTMLMODE_FRSTLINE_IN_NUMBER_BULLET
Definition: wrthtml.hxx:128
#define CSS1_FMT_CMPREF
Definition: wrthtml.hxx:135
#define CSS1_OUTMODE_RULE
Definition: wrthtml.hxx:158
#define CSS1_OUTMODE_SECTION
Definition: wrthtml.hxx:170
#define CSS1_FMT_ISTAG
Definition: wrthtml.hxx:134
#define CSS1_OUTMODE_BODY
Definition: wrthtml.hxx:163
#define CSS1_FMT_SPECIAL
Definition: wrthtml.hxx:136
#define CSS1_OUTMODE_ANY_ON
Definition: wrthtml.hxx:146
#define sCSS2_P_CLASS_leaders
Definition: wrthtml.hxx:416
#define HTMLMODE_PRINT_EXT
Definition: wrthtml.hxx:122
#define CSS1_OUTMODE_SPAN_TAG_ON
Definition: wrthtml.hxx:142
#define CSS1_OUTMODE_CTL
Definition: wrthtml.hxx:184
#define HTMLMODE_FLY_MARGINS
Definition: wrthtml.hxx:125
#define CSS1_OUTMODE_RULE_OFF
Definition: wrthtml.hxx:152
#define CSS1_OUTMODE_NO_SCRIPT
Definition: wrthtml.hxx:186
#define CSS1_OUTMODE_TABLEBOX
Definition: wrthtml.hxx:168
#define HTMLMODE_LSPACE_IN_NUMBER_BULLET
Definition: wrthtml.hxx:120
#define CSS1_OUTMODE_TEMPLATE
Definition: wrthtml.hxx:162
#define CSS1_OUTMODE_FRAME
Definition: wrthtml.hxx:166
#define CSS1_OUTMODE_WESTERN
Definition: wrthtml.hxx:180
#define CSS1_OUTMODE_TABLE
Definition: wrthtml.hxx:167
#define CSS1_OUTMODE_STYLE_OPT_ON
Definition: wrthtml.hxx:143
#define CSS1_OUTMODE_HINT
Definition: wrthtml.hxx:165
#define CSS1_OUTMODE_ANY_OFF
Definition: wrthtml.hxx:153
#define HTML_DLCOLL_DD
Definition: wrthtml.hxx:131
#define CSS1_OUTMODE_STYLE_OPT
Definition: wrthtml.hxx:157