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