LibreOffice Module sw (master)  1
htmlnumreader.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 <com/sun/star/text/VertOrientation.hpp>
21 #include <hintids.hxx>
22 #include <svtools/htmltokn.h>
23 #include <svtools/htmlkywd.hxx>
24 #include <svl/urihelper.hxx>
25 #include <editeng/brushitem.hxx>
26 #include <editeng/lrspitem.hxx>
27 #include <vcl/svapp.hxx>
28 #include <sal/log.hxx>
29 #include <osl/diagnose.h>
30 #include <numrule.hxx>
31 #include <doc.hxx>
32 #include <docary.hxx>
33 #include <poolfmt.hxx>
34 #include <ndtxt.hxx>
35 #include <paratr.hxx>
36 
37 #include "htmlnum.hxx"
38 #include "swcss1.hxx"
39 #include "swhtml.hxx"
40 
41 using namespace css;
42 
43 // <UL TYPE=...>
45 {
49  { nullptr, 0 }
50 };
51 
52 
54 {
55  SwHTMLNumRuleInfo& rInfo = GetNumInfo();
56 
57  // Create a new paragraph
58  bool bSpace = (rInfo.GetDepth() + m_nDefListDeep) == 0;
59  if( m_pPam->GetPoint()->nContent.GetIndex() )
60  AppendTextNode( bSpace ? AM_SPACE : AM_NOSPACE, false );
61  else if( bSpace )
62  AddParSpace();
63 
64  // Increment the numbering depth
65  rInfo.IncDepth();
66  sal_uInt8 nLevel = static_cast<sal_uInt8>( (rInfo.GetDepth() <= MAXLEVEL ? rInfo.GetDepth()
67  : MAXLEVEL) - 1 );
68 
69  // Create rules if needed
70  if( !rInfo.GetNumRule() )
71  {
72  sal_uInt16 nPos = m_xDoc->MakeNumRule( m_xDoc->GetUniqueNumRuleName() );
73  rInfo.SetNumRule( m_xDoc->GetNumRuleTable()[nPos] );
74  }
75 
76  // Change the format for this level if that hasn't happened yet for this level
77  bool bNewNumFormat = rInfo.GetNumRule()->GetNumFormat( nLevel ) == nullptr;
78  bool bChangeNumFormat = false;
79 
80  // Create the default numbering format
81  SwNumFormat aNumFormat( rInfo.GetNumRule()->Get(nLevel) );
82  rInfo.SetNodeStartValue( nLevel );
83  if( bNewNumFormat )
84  {
85  sal_uInt16 nChrFormatPoolId = 0;
86  if( HtmlTokenId::ORDERLIST_ON == nToken )
87  {
88  aNumFormat.SetNumberingType(SVX_NUM_ARABIC);
89  nChrFormatPoolId = RES_POOLCHR_NUM_LEVEL;
90  }
91  else
92  {
93  // We'll set a default style because the UI does the same. This meant a 9pt font, which
94  // was not the case in Netscape. That didn't bother anyone so far
95  // #i63395# - Only apply user defined default bullet font
97  {
98  aNumFormat.SetBulletFont( &numfunc::GetDefBulletFont() );
99  }
100  aNumFormat.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
101  aNumFormat.SetBulletChar( cBulletChar );
102  nChrFormatPoolId = RES_POOLCHR_BULLET_LEVEL;
103  }
104 
105  sal_Int32 nAbsLSpace = HTML_NUMBER_BULLET_MARGINLEFT;
106 
107  sal_Int32 nFirstLineIndent = HTML_NUMBER_BULLET_INDENT;
108  if( nLevel > 0 )
109  {
110  const SwNumFormat& rPrevNumFormat = rInfo.GetNumRule()->Get( nLevel-1 );
111  nAbsLSpace = nAbsLSpace + rPrevNumFormat.GetAbsLSpace();
112  nFirstLineIndent = rPrevNumFormat.GetFirstLineOffset();
113  }
114  aNumFormat.SetAbsLSpace( nAbsLSpace );
115  aNumFormat.SetFirstLineOffset( nFirstLineIndent );
116  aNumFormat.SetCharFormat( m_pCSS1Parser->GetCharFormatFromPool(nChrFormatPoolId) );
117 
118  bChangeNumFormat = true;
119  }
120  else if( 1 != aNumFormat.GetStart() )
121  {
122  // If the layer has already been used, the start value may need to be set hard to the paragraph.
123  rInfo.SetNodeStartValue( nLevel, 1 );
124  }
125 
126  // and set that in the options
127  OUString aId, aStyle, aClass, aLang, aDir;
128  OUString aBulletSrc;
129  sal_Int16 eVertOri = text::VertOrientation::NONE;
130  sal_uInt16 nWidth=USHRT_MAX, nHeight=USHRT_MAX;
131  const HTMLOptions& rHTMLOptions = GetOptions();
132  for (size_t i = rHTMLOptions.size(); i; )
133  {
134  const HTMLOption& rOption = rHTMLOptions[--i];
135  switch( rOption.GetToken() )
136  {
137  case HtmlOptionId::ID:
138  aId = rOption.GetString();
139  break;
140  case HtmlOptionId::TYPE:
141  if( bNewNumFormat && !rOption.GetString().isEmpty() )
142  {
143  switch( nToken )
144  {
145  case HtmlTokenId::ORDERLIST_ON:
146  bChangeNumFormat = true;
147  switch( rOption.GetString()[0] )
148  {
149  case 'A': aNumFormat.SetNumberingType(SVX_NUM_CHARS_UPPER_LETTER); break;
150  case 'a': aNumFormat.SetNumberingType(SVX_NUM_CHARS_LOWER_LETTER); break;
151  case 'I': aNumFormat.SetNumberingType(SVX_NUM_ROMAN_UPPER); break;
152  case 'i': aNumFormat.SetNumberingType(SVX_NUM_ROMAN_LOWER); break;
153  default: bChangeNumFormat = false;
154  }
155  break;
156 
157  case HtmlTokenId::UNORDERLIST_ON:
158  aNumFormat.SetBulletChar( rOption.GetEnum(
159  aHTMLULTypeTable,aNumFormat.GetBulletChar() ) );
160  bChangeNumFormat = true;
161  break;
162  default: break;
163  }
164  }
165  break;
166  case HtmlOptionId::START:
167  {
168  sal_uInt16 nStart = static_cast<sal_uInt16>(rOption.GetNumber());
169  if( bNewNumFormat )
170  {
171  aNumFormat.SetStart( nStart );
172  bChangeNumFormat = true;
173  }
174  else
175  {
176  rInfo.SetNodeStartValue( nLevel, nStart );
177  }
178  }
179  break;
180  case HtmlOptionId::STYLE:
181  aStyle = rOption.GetString();
182  break;
183  case HtmlOptionId::CLASS:
184  aClass = rOption.GetString();
185  break;
186  case HtmlOptionId::LANG:
187  aLang = rOption.GetString();
188  break;
189  case HtmlOptionId::DIR:
190  aDir = rOption.GetString();
191  break;
192  case HtmlOptionId::SRC:
193  if( bNewNumFormat )
194  {
195  aBulletSrc = rOption.GetString();
196  if( !InternalImgToPrivateURL(aBulletSrc) )
197  aBulletSrc = URIHelper::SmartRel2Abs( INetURLObject( m_sBaseURL ), aBulletSrc, Link<OUString *, bool>(), false );
198  }
199  break;
200  case HtmlOptionId::WIDTH:
201  nWidth = static_cast<sal_uInt16>(rOption.GetNumber());
202  break;
203  case HtmlOptionId::HEIGHT:
204  nHeight = static_cast<sal_uInt16>(rOption.GetNumber());
205  break;
206  case HtmlOptionId::ALIGN:
207  eVertOri = rOption.GetEnum( aHTMLImgVAlignTable, eVertOri );
208  break;
209  default: break;
210  }
211  }
212 
213  if( !aBulletSrc.isEmpty() )
214  {
215  // A bullet list with graphics
216  aNumFormat.SetNumberingType(SVX_NUM_BITMAP);
217 
218  // Create the graphic as a brush
219  SvxBrushItem aBrushItem( RES_BACKGROUND );
220  aBrushItem.SetGraphicLink( aBulletSrc );
221  aBrushItem.SetGraphicPos( GPOS_AREA );
222 
223  // Only set size if given a width and a height
224  Size aTwipSz( nWidth, nHeight), *pTwipSz=nullptr;
225  if( nWidth!=USHRT_MAX && nHeight!=USHRT_MAX )
226  {
227  aTwipSz =
229  MapMode(MapUnit::MapTwip) );
230  pTwipSz = &aTwipSz;
231  }
232 
233  // Only set orientation if given one
234  aNumFormat.SetGraphicBrush( &aBrushItem, pTwipSz,
235  text::VertOrientation::NONE!=eVertOri ? &eVertOri : nullptr);
236 
237  // Remember the graphic to not put it into the paragraph
238  m_aBulletGrfs[nLevel] = aBulletSrc;
239  bChangeNumFormat = true;
240  }
241  else
242  m_aBulletGrfs[nLevel].clear();
243 
244  // don't number the current paragraph (for now)
245  {
246  sal_uInt8 nLvl = nLevel;
247  SetNodeNum( nLvl );
248  }
249 
250  // create a new context
251  std::unique_ptr<HTMLAttrContext> xCntxt(new HTMLAttrContext(nToken));
252 
253  // Parse styles
254  if( HasStyleOptions( aStyle, aId, aClass, &aLang, &aDir ) )
255  {
256  SfxItemSet aItemSet( m_xDoc->GetAttrPool(), m_pCSS1Parser->GetWhichMap() );
257  SvxCSS1PropertyInfo aPropInfo;
258 
259  if( ParseStyleOptions( aStyle, aId, aClass, aItemSet, aPropInfo, &aLang, &aDir ) )
260  {
261  if( bNewNumFormat )
262  {
263  if( aPropInfo.m_bLeftMargin )
264  {
265  // Default indent has already been added
266  tools::Long nAbsLSpace =
267  aNumFormat.GetAbsLSpace() - HTML_NUMBER_BULLET_MARGINLEFT;
268  if( aPropInfo.m_nLeftMargin < 0 &&
269  nAbsLSpace < -aPropInfo.m_nLeftMargin )
270  nAbsLSpace = 0U;
271  else if( aPropInfo.m_nLeftMargin > SHRT_MAX ||
272  nAbsLSpace + aPropInfo.m_nLeftMargin > SHRT_MAX )
273  nAbsLSpace = SHRT_MAX;
274  else
275  nAbsLSpace = nAbsLSpace + aPropInfo.m_nLeftMargin;
276 
277  aNumFormat.SetAbsLSpace( nAbsLSpace );
278  bChangeNumFormat = true;
279  }
280  if( aPropInfo.m_bTextIndent )
281  {
282  short nTextIndent =
283  aItemSet.Get( RES_LR_SPACE ).GetTextFirstLineOffset();
284  aNumFormat.SetFirstLineOffset( nTextIndent );
285  bChangeNumFormat = true;
286  }
287  if( aPropInfo.m_bNumbering )
288  {
289  aNumFormat.SetNumberingType(aPropInfo.m_nNumberingType);
290  bChangeNumFormat = true;
291  }
292  if( aPropInfo.m_bBullet )
293  {
294  aNumFormat.SetBulletChar( aPropInfo.m_cBulletChar );
295  bChangeNumFormat = true;
296  }
297  }
298  aPropInfo.m_bLeftMargin = aPropInfo.m_bTextIndent = false;
299  if( !aPropInfo.m_bRightMargin )
300  aItemSet.ClearItem( RES_LR_SPACE );
301 
302  // #i89812# - Perform change to list style before calling <DoPositioning(..)>,
303  // because <DoPositioning(..)> may open a new context and thus may
304  // clear the <SwHTMLNumRuleInfo> instance hold by local variable <rInfo>.
305  if( bChangeNumFormat )
306  {
307  rInfo.GetNumRule()->Set( nLevel, aNumFormat );
308  m_xDoc->ChgNumRuleFormats( *rInfo.GetNumRule() );
309  bChangeNumFormat = false;
310  }
311 
312  DoPositioning(aItemSet, aPropInfo, xCntxt.get());
313 
314  InsertAttrs(aItemSet, aPropInfo, xCntxt.get());
315  }
316  }
317 
318  if( bChangeNumFormat )
319  {
320  rInfo.GetNumRule()->Set( nLevel, aNumFormat );
321  m_xDoc->ChgNumRuleFormats( *rInfo.GetNumRule() );
322  }
323 
324  PushContext(xCntxt);
325 
326  // set attributes to the current template
327  SetTextCollAttrs(m_aContexts.back().get());
328 }
329 
331 {
332  SwHTMLNumRuleInfo& rInfo = GetNumInfo();
333 
334  // A new paragraph needs to be created, when
335  // - the current one isn't empty (it contains text or paragraph-bound objects)
336  // - the current one is numbered
337  bool bAppend = m_pPam->GetPoint()->nContent.GetIndex() > 0;
338  if( !bAppend )
339  {
340  SwTextNode* pTextNode = m_pPam->GetNode().GetTextNode();
341 
342  bAppend = (pTextNode && ! pTextNode->IsOutline() && pTextNode->IsCountedInList()) ||
343 
344  HasCurrentParaFlys();
345  }
346 
347  bool bSpace = (rInfo.GetDepth() + m_nDefListDeep) == 1;
348  if( bAppend )
349  AppendTextNode( bSpace ? AM_SPACE : AM_NOSPACE, false );
350  else if( bSpace )
351  AddParSpace();
352 
353  // get current context from stack
354  std::unique_ptr<HTMLAttrContext> xCntxt(nToken != HtmlTokenId::NONE ? PopContext(getOnToken(nToken)) : nullptr);
355 
356  // Don't end a list because of a token, if the context wasn't created or mustn't be ended
357  if( rInfo.GetDepth()>0 && (nToken == HtmlTokenId::NONE || xCntxt) )
358  {
359  rInfo.DecDepth();
360  if( !rInfo.GetDepth() ) // was that the last level?
361  {
362  // The formats not yet modified are now modified, to ease editing
363  const SwNumFormat *pRefNumFormat = nullptr;
364  bool bChanged = false;
365  for( sal_uInt16 i=0; i<MAXLEVEL; i++ )
366  {
367  const SwNumFormat *pNumFormat = rInfo.GetNumRule()->GetNumFormat(i);
368  if( pNumFormat )
369  {
370  pRefNumFormat = pNumFormat;
371  }
372  else if( pRefNumFormat )
373  {
374  SwNumFormat aNumFormat( rInfo.GetNumRule()->Get(i) );
375  aNumFormat.SetNumberingType(pRefNumFormat->GetNumberingType() != SVX_NUM_BITMAP
376  ? pRefNumFormat->GetNumberingType() : SVX_NUM_CHAR_SPECIAL);
377  if( SVX_NUM_CHAR_SPECIAL == aNumFormat.GetNumberingType() )
378  {
379  // #i63395# - Only apply user defined default bullet font
381  {
382  aNumFormat.SetBulletFont( &numfunc::GetDefBulletFont() );
383  }
384  aNumFormat.SetBulletChar( cBulletChar );
385  }
386  aNumFormat.SetAbsLSpace( (i+1) * HTML_NUMBER_BULLET_MARGINLEFT );
387  aNumFormat.SetFirstLineOffset( HTML_NUMBER_BULLET_INDENT );
388  aNumFormat.SetCharFormat( pRefNumFormat->GetCharFormat() );
389  rInfo.GetNumRule()->Set( i, aNumFormat );
390  bChanged = true;
391  }
392  }
393  if( bChanged )
394  m_xDoc->ChgNumRuleFormats( *rInfo.GetNumRule() );
395 
396  // On the last append, the NumRule item and NodeNum object were copied.
397  // Now we need to delete them. ResetAttr deletes the NodeNum object as well
398  if (SwTextNode *pTextNode = m_pPam->GetNode().GetTextNode())
399  pTextNode->ResetAttr(RES_PARATR_NUMRULE);
400 
401  rInfo.Clear();
402  }
403  else
404  {
405  // the next paragraph not numbered first
406  SetNodeNum( rInfo.GetLevel() );
407  }
408  }
409 
410  // end attributes
411  bool bSetAttrs = false;
412  if (xCntxt)
413  {
414  EndContext(xCntxt.get());
415  xCntxt.reset();
416  bSetAttrs = true;
417  }
418 
419  if( nToken != HtmlTokenId::NONE )
421 
422  if( bSetAttrs )
423  SetAttr(); // Set paragraph attributes asap because of Javascript
424 
425 }
426 
428 {
429  sal_uInt8 nLevel = GetNumInfo().GetLevel();
430  OUString aId, aStyle, aClass, aLang, aDir;
431  sal_uInt16 nStart = HtmlTokenId::LISTHEADER_ON != nToken
432  ? GetNumInfo().GetNodeStartValue( nLevel )
433  : USHRT_MAX;
434  if( USHRT_MAX != nStart )
435  GetNumInfo().SetNodeStartValue( nLevel );
436 
437  const HTMLOptions& rHTMLOptions = GetOptions();
438  for (size_t i = rHTMLOptions.size(); i; )
439  {
440  const HTMLOption& rOption = rHTMLOptions[--i];
441  switch( rOption.GetToken() )
442  {
443  case HtmlOptionId::VALUE:
444  nStart = static_cast<sal_uInt16>(rOption.GetNumber());
445  break;
446  case HtmlOptionId::ID:
447  aId = rOption.GetString();
448  break;
449  case HtmlOptionId::STYLE:
450  aStyle = rOption.GetString();
451  break;
452  case HtmlOptionId::CLASS:
453  aClass = rOption.GetString();
454  break;
455  case HtmlOptionId::LANG:
456  aLang = rOption.GetString();
457  break;
458  case HtmlOptionId::DIR:
459  aDir = rOption.GetString();
460  break;
461  default: break;
462  }
463  }
464 
465  // create a new paragraph
466  if( m_pPam->GetPoint()->nContent.GetIndex() )
467  AppendTextNode( AM_NOSPACE, false );
468  m_bNoParSpace = false; // no space in <LI>!
469 
470  SwTextNode* pTextNode = m_pPam->GetNode().GetTextNode();
471  if (!pTextNode)
472  {
473  SAL_WARN("sw.html", "No Text-Node at PaM-Position");
474  return;
475  }
476 
477  const bool bCountedInList = nToken != HtmlTokenId::LISTHEADER_ON;
478 
479  std::unique_ptr<HTMLAttrContext> xCntxt(new HTMLAttrContext(nToken));
480 
481  OUString aNumRuleName;
482  if( GetNumInfo().GetNumRule() )
483  {
484  aNumRuleName = GetNumInfo().GetNumRule()->GetName();
485  }
486  else
487  {
488  aNumRuleName = m_xDoc->GetUniqueNumRuleName();
489  SwNumRule aNumRule( aNumRuleName,
491  SwNumFormat aNumFormat( aNumRule.Get( 0 ) );
492  // #i63395# - Only apply user defined default bullet font
494  {
495  aNumFormat.SetBulletFont( &numfunc::GetDefBulletFont() );
496  }
497  aNumFormat.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
498  aNumFormat.SetBulletChar( cBulletChar ); // the bullet character !!
499  aNumFormat.SetCharFormat( m_pCSS1Parser->GetCharFormatFromPool(RES_POOLCHR_BULLET_LEVEL) );
500  aNumFormat.SetFirstLineOffset( HTML_NUMBER_BULLET_INDENT );
501  aNumRule.Set( 0, aNumFormat );
502 
503  m_xDoc->MakeNumRule( aNumRuleName, &aNumRule );
504 
505  OSL_ENSURE( m_nOpenParaToken == HtmlTokenId::NONE,
506  "Now an open paragraph element is lost" );
507  // We'll act like we're in a paragraph. On the next paragraph, at least numbering is gone,
508  // that's gonna be taken over by the next AppendTextNode
509  m_nOpenParaToken = nToken;
510  }
511 
512  static_cast<SwContentNode *>(pTextNode)->SetAttr( SwNumRuleItem(aNumRuleName) );
513  pTextNode->SetAttrListLevel(nLevel);
514  // #i57656# - <IsCounted()> state of text node has to be adjusted accordingly.
515  if ( nLevel < MAXLEVEL )
516  {
517  pTextNode->SetCountedInList( bCountedInList );
518  }
519  // #i57919#
520  // correction of refactoring done by cws swnumtree
521  // - <nStart> contains the start value, if the numbering has to be restarted
522  // at this text node. Value <USHRT_MAX> indicates, that numbering isn't
523  // restarted at this text node
524  if ( nStart != USHRT_MAX )
525  {
526  pTextNode->SetListRestart( true );
527  pTextNode->SetAttrListRestartValue( nStart );
528  }
529 
530  if( GetNumInfo().GetNumRule() )
531  GetNumInfo().GetNumRule()->SetInvalidRule( true );
532 
533  // parse styles
534  if( HasStyleOptions( aStyle, aId, aClass, &aLang, &aDir ) )
535  {
536  SfxItemSet aItemSet( m_xDoc->GetAttrPool(), m_pCSS1Parser->GetWhichMap() );
537  SvxCSS1PropertyInfo aPropInfo;
538 
539  if( ParseStyleOptions( aStyle, aId, aClass, aItemSet, aPropInfo, &aLang, &aDir ) )
540  {
541  DoPositioning(aItemSet, aPropInfo, xCntxt.get());
542  InsertAttrs(aItemSet, aPropInfo, xCntxt.get());
543  }
544  }
545 
546  PushContext(xCntxt);
547 
548  // set the new template
549  SetTextCollAttrs(m_aContexts.back().get());
550 
551  // Refresh scroll bar
552  ShowStatline();
553 }
554 
556 {
557  // Create a new paragraph
558  if( nToken == HtmlTokenId::NONE && m_pPam->GetPoint()->nContent.GetIndex() )
559  AppendTextNode( AM_NOSPACE );
560 
561  // Get context to that token and pop it from stack
562  std::unique_ptr<HTMLAttrContext> xCntxt;
563  auto nPos = m_aContexts.size();
564  nToken = getOnToken(nToken);
565  while (!xCntxt && nPos>m_nContextStMin)
566  {
567  HtmlTokenId nCntxtToken = m_aContexts[--nPos]->GetToken();
568  switch( nCntxtToken )
569  {
570  case HtmlTokenId::LI_ON:
571  case HtmlTokenId::LISTHEADER_ON:
572  if( nToken == HtmlTokenId::NONE || nToken == nCntxtToken )
573  {
574  xCntxt = std::move(m_aContexts[nPos]);
575  m_aContexts.erase( m_aContexts.begin() + nPos );
576  }
577  break;
578  case HtmlTokenId::ORDERLIST_ON:
579  case HtmlTokenId::UNORDERLIST_ON:
580  case HtmlTokenId::MENULIST_ON:
581  case HtmlTokenId::DIRLIST_ON:
582  // Don't care about LI/LH outside the current list
583  nPos = m_nContextStMin;
584  break;
585  default: break;
586  }
587  }
588 
589  // end attributes
590  if (xCntxt)
591  {
592  EndContext(xCntxt.get());
593  SetAttr(); // set paragraph attributes asap because of Javascript
594  xCntxt.reset();
595  }
596 
597  // set current template
598  if( bSetColl )
600 }
601 
603 {
604  SwTextNode* pTextNode = m_pPam->GetNode().GetTextNode();
605  if (!pTextNode)
606  {
607  SAL_WARN("sw.html", "No Text-Node at PaM-Position");
608  return;
609  }
610 
611  OSL_ENSURE( GetNumInfo().GetNumRule(), "No numbering rule" );
612  const OUString& rName = GetNumInfo().GetNumRule()->GetName();
613  static_cast<SwContentNode *>(pTextNode)->SetAttr( SwNumRuleItem(rName) );
614 
615  pTextNode->SetAttrListLevel( nLevel );
616  pTextNode->SetCountedInList( false );
617 
618  // Invalidate NumRule, it may have been set valid because of an EndAction
619  GetNumInfo().GetNumRule()->SetInvalidRule( false );
620 }
621 
622 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetNodeNum(sal_uInt8 nLevel)
SvxNumType GetNumberingType() const
sal_uInt8 GetLevel() const
Definition: htmlnum.hxx:110
void SetListRestart(bool bRestart)
Definition: ndtxt.cxx:4088
EnumT GetEnum(const HTMLOptionEnum< EnumT > *pOptEnums, EnumT nDflt=static_cast< EnumT >(0)) const
HtmlOptionId GetToken() const
constexpr HtmlTokenId getOnToken(HtmlTokenId nToken)
bool IsOutline() const
Returns if this text node is an outline.
Definition: ndtxt.cxx:3967
const SwNumFormat * GetNumFormat(sal_uInt16 i) const
Definition: number.cxx:89
long Long
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
void NewNumberBulletList(HtmlTokenId nToken)
SVX_NUM_CHARS_UPPER_LETTER
const OUString & GetString() const
const sal_Unicode cBulletChar
Character for lists.
Definition: numrule.hxx:48
OUString aId
static OutputDevice * GetDefaultDevice()
SVX_NUM_ARABIC
const sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:95
SVX_NUM_ROMAN_UPPER
Numbering symbols.
Definition: poolfmt.hxx:117
SVX_NUM_ROMAN_LOWER
void SetCountedInList(bool bCounted)
Definition: ndtxt.cxx:4204
#define HTML_BULLETCHAR_DISC
Definition: htmlnum.hxx:32
void SetNodeStartValue(sal_uInt8 nLvl, sal_uInt16 nVal=USHRT_MAX)
Definition: htmlnum.hxx:118
SVX_NUM_BITMAP
SVX_NUM_CHAR_SPECIAL
#define HTML_NUMBER_BULLET_INDENT
Definition: htmlnum.hxx:26
SwCharFormat * GetCharFormat() const
Definition: numrule.hxx:74
SVX_NUM_CHARS_LOWER_LETTER
sal_uInt16 GetDepth() const
Definition: htmlnum.hxx:73
int i
void SetBulletFont(const vcl::Font *pFont)
sal_Int32 GetAbsLSpace() const
#define OOO_STRING_SVTOOLS_HTML_ULTYPE_disc
const vcl::Font & GetDefBulletFont()
retrieve font used for the default bullet list characters
Definition: number.cxx:1322
void SetNumRule(const SwNumRule *pRule)
Definition: htmlnum.hxx:68
void NewNumberBulletListItem(HtmlTokenId nToken)
#define OOO_STRING_SVTOOLS_HTML_ULTYPE_square
#define HTML_BULLETCHAR_CIRCLE
Definition: htmlnum.hxx:33
GPOS_AREA
HTMLOptionEnum< sal_Int16 > const aHTMLImgVAlignTable[]
Definition: htmlgrin.cxx:81
sal_uInt32 GetNumber() const
void EndNumberBulletListItem(HtmlTokenId nToken, bool bSetColl)
HtmlTokenId
Point PixelToLogic(const Point &rDevicePt) const
void SetGraphicPos(SvxGraphicPosition eNew)
void EndNumberBulletList(HtmlTokenId nToken=HtmlTokenId::NONE)
const SwNumFormat & Get(sal_uInt16 i) const
Definition: number.cxx:79
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:80
void SetAttrListLevel(int nLevel)
Sets the list level of this text node.
Definition: ndtxt.cxx:4051
void Set(sal_uInt16 i, const SwNumFormat *)
Definition: number.cxx:591
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
bool IsDefBulletFontUserDefined()
determine if default bullet font is user defined
Definition: number.cxx:1317
static void SetTextCollAttrs(SwTextFormatColl *pColl, SfxItemSet &rItemSet, SvxCSS1PropertyInfo const &rPropInfo, SwCSS1Parser *pCSS1Parser)
Definition: htmlcss1.cxx:267
unsigned char sal_uInt8
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:254
::std::vector< HTMLOption > HTMLOptions
bool IsCountedInList() const
Definition: ndtxt.cxx:4219
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
sal_Int32 GetFirstLineOffset() const
#define SAL_WARN(area, stream)
void SetGraphicLink(const OUString &rNew)
void SetNumberingType(SvxNumType nSet)
#define OOO_STRING_SVTOOLS_HTML_ULTYPE_circle
#define HTML_BULLETCHAR_SQUARE
Definition: htmlnum.hxx:34
HTMLOptionEnum< sal_UCS4 > const aHTMLULTypeTable[]
SwNumRule * GetNumRule(SwTextFormatColl &rTextFormatColl)
determines the list style, which directly set at the given paragraph style
Definition: fmtcol.cxx:74
SwNumRule * GetNumRule()
Definition: htmlnum.hxx:69
void SetAttrListRestartValue(SwNumberTree::tSwNumTreeNumber nNum)
Definition: ndtxt.cxx:4132
#define HTML_NUMBER_BULLET_MARGINLEFT
Definition: htmlnum.hxx:25
sal_uInt16 nPos
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:848
SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const &rTheBaseURIRef, OUString const &rTheRelURIRef, Link< OUString *, bool > const &rMaybeFileHdl=Link< OUString *, bool >(), bool bCheckFileExists=true, bool bIgnoreFragment=false, INetURLObject::EncodeMechanism eEncodeMechanism=INetURLObject::EncodeMechanism::WasEncoded, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)