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