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