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