LibreOffice Module sc (master)  1
htmlexp.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <sal/config.h>
21 
22 #include <string_view>
23 
24 #include <scitems.hxx>
25 #include <editeng/eeitem.hxx>
26 
27 #include <vcl/svapp.hxx>
28 #include <editeng/boxitem.hxx>
29 #include <editeng/brushitem.hxx>
30 #include <editeng/colritem.hxx>
32 #include <editeng/fhgtitem.hxx>
33 #include <editeng/fontitem.hxx>
34 #include <editeng/postitem.hxx>
35 #include <editeng/udlnitem.hxx>
36 #include <editeng/wghtitem.hxx>
37 #include <editeng/justifyitem.hxx>
38 #include <svx/xoutbmp.hxx>
39 #include <editeng/editeng.hxx>
40 #include <svtools/htmlcfg.hxx>
41 #include <sfx2/docfile.hxx>
42 #include <sfx2/frmhtmlw.hxx>
43 #include <sfx2/objsh.hxx>
44 #include <svl/urihelper.hxx>
45 #include <svtools/htmlkywd.hxx>
46 #include <svtools/htmlout.hxx>
47 #include <svtools/parhtml.hxx>
48 #include <vcl/outdev.hxx>
49 #include <stdio.h>
50 #include <osl/diagnose.h>
51 #include <o3tl/unit_conversion.hxx>
52 
53 #include <htmlexp.hxx>
54 #include <global.hxx>
55 #include <postit.hxx>
56 #include <document.hxx>
57 #include <attrib.hxx>
58 #include <patattr.hxx>
59 #include <stlpool.hxx>
60 #include <scresid.hxx>
61 #include <formulacell.hxx>
62 #include <cellform.hxx>
63 #include <docoptio.hxx>
64 #include <editutil.hxx>
65 #include <ftools.hxx>
66 #include <cellvalue.hxx>
67 #include <mtvelements.hxx>
68 
69 #include <editeng/flditem.hxx>
70 #include <editeng/borderline.hxx>
71 
72 // Without strings.hrc: error C2679: binary '=' : no operator defined which takes a
73 // right-hand operand of type 'const class String (__stdcall *)(class ScResId)'
74 // at
75 // const String aStrTable( ScResId( SCSTR_TABLE ) ); aStrOut = aStrTable;
76 // ?!???
77 #include <strings.hrc>
78 #include <globstr.hrc>
79 
80 #include <com/sun/star/frame/XModel.hpp>
81 #include <com/sun/star/uno/Reference.h>
82 #include <com/sun/star/document/XDocumentProperties.hpp>
83 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
84 #include <rtl/strbuf.hxx>
85 #include <officecfg/Office/Common.hxx>
86 
87 using ::editeng::SvxBorderLine;
88 using namespace ::com::sun::star;
89 
90 const char sMyBegComment[] = "<!-- ";
91 const char sMyEndComment[] = " -->";
92 const char sDisplay[] = "display:";
93 const char sBorder[] = "border:";
94 const char sBackground[] = "background:";
95 
97 {
100 };
101 
102 sal_uInt16 ScHTMLExport::nFontSize[SC_HTML_FONTSIZES] = { 0 };
103 
105 {
106  "xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large"
107 };
108 
109 const sal_uInt16 ScHTMLExport::nCellSpacing = 0;
111  "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
112 
113 // Macros for HTML export
114 
115 #define TAG_ON( tag ) HTMLOutFuncs::Out_AsciiTag( rStrm, tag )
116 #define TAG_OFF( tag ) HTMLOutFuncs::Out_AsciiTag( rStrm, tag, false )
117 #define OUT_STR( str ) HTMLOutFuncs::Out_String( rStrm, str, &aNonConvertibleChars )
118 #define OUT_LF() rStrm.WriteCharPtr( SAL_NEWLINE_STRING ).WriteCharPtr( GetIndentStr() )
119 #define TAG_ON_LF( tag ) (TAG_ON( tag ).WriteCharPtr( SAL_NEWLINE_STRING ).WriteCharPtr( GetIndentStr() ))
120 #define TAG_OFF_LF( tag ) (TAG_OFF( tag ).WriteCharPtr( SAL_NEWLINE_STRING ).WriteCharPtr( GetIndentStr() ))
121 #define OUT_HR() TAG_ON_LF( OOO_STRING_SVTOOLS_HTML_horzrule )
122 #define OUT_COMMENT( comment ) (rStrm.WriteCharPtr( sMyBegComment ), OUT_STR( comment ) \
123  .WriteCharPtr( sMyEndComment ).WriteCharPtr( SAL_NEWLINE_STRING ) \
124  .WriteCharPtr( GetIndentStr() ))
125 
126 #define OUT_SP_CSTR_ASS( s ) rStrm.WriteChar( ' ').WriteCharPtr( s ).WriteChar( '=' )
127 
128 #define GLOBSTR(id) ScResId( id )
129 
130 void ScFormatFilterPluginImpl::ScExportHTML( SvStream& rStrm, const OUString& rBaseURL, ScDocument* pDoc,
131  const ScRange& rRange, const rtl_TextEncoding /*eNach*/, bool bAll,
132  const OUString& rStreamPath, OUString& rNonConvertibleChars, const OUString& rFilterOptions )
133 {
134  ScHTMLExport aEx( rStrm, rBaseURL, pDoc, rRange, bAll, rStreamPath, rFilterOptions );
135  aEx.Write();
136  rNonConvertibleChars = aEx.GetNonConvertibleChars();
137 }
138 
139 static OString lcl_getColGroupString(sal_Int32 nSpan, sal_Int32 nWidth)
140 {
141  OStringBuffer aByteStr(OOO_STRING_SVTOOLS_HTML_colgroup);
142  aByteStr.append(' ');
143  if( nSpan > 1 )
144  {
145  aByteStr.append(OOO_STRING_SVTOOLS_HTML_O_span);
146  aByteStr.append("=\"");
147  aByteStr.append(nSpan);
148  aByteStr.append("\" ");
149  }
150  aByteStr.append(OOO_STRING_SVTOOLS_HTML_O_width);
151  aByteStr.append("=\"");
152  aByteStr.append(nWidth);
153  aByteStr.append('"');
154  return aByteStr.makeStringAndClear();
155 }
156 
157 static void lcl_AddStamp( OUString& rStr, std::u16string_view rName,
158  const css::util::DateTime& rDateTime,
159  const LocaleDataWrapper& rLoc )
160 {
161  Date aD(rDateTime.Day, rDateTime.Month, rDateTime.Year);
162  tools::Time aT(rDateTime.Hours, rDateTime.Minutes, rDateTime.Seconds,
163  rDateTime.NanoSeconds);
164  DateTime aDateTime(aD,aT);
165 
166  OUString aStrDate = rLoc.getDate( aDateTime );
167  OUString aStrTime = rLoc.getTime( aDateTime );
168 
169  rStr += GLOBSTR( STR_BY ) + " ";
170  if (!rName.empty())
171  rStr += rName;
172  else
173  rStr += "???";
174  rStr += " " + GLOBSTR( STR_ON ) + " ";
175  if (!aStrDate.isEmpty())
176  rStr += aStrDate;
177  else
178  rStr += "???";
179  rStr += ", ";
180  if (!aStrTime.isEmpty())
181  rStr += aStrTime;
182  else
183  rStr += "???";
184 }
185 
186 static OString lcl_makeHTMLColorTriplet(const Color& rColor)
187 {
188  char buf[24];
189 
190  // <font COLOR="#00FF40">hello</font>
191  snprintf( buf, 24, "\"#%02X%02X%02X\"", rColor.GetRed(), rColor.GetGreen(), rColor.GetBlue() );
192 
193  return OString(buf);
194 }
195 
196 ScHTMLExport::ScHTMLExport( SvStream& rStrmP, const OUString& rBaseURL, ScDocument* pDocP,
197  const ScRange& rRangeP, bool bAllP,
198  const OUString& rStreamPathP, std::u16string_view rFilterOptions ) :
199  ScExportBase( rStrmP, pDocP, rRangeP ),
200  aBaseURL( rBaseURL ),
201  aStreamPath( rStreamPathP ),
202  pAppWin( Application::GetDefaultDevice() ),
203  nUsedTables( 0 ),
204  nIndent( 0 ),
205  bAll( bAllP ),
206  bTabHasGraphics( false ),
207  bTabAlignedLeft( false ),
208  bCalcAsShown( pDocP->GetDocOptions().IsCalcAsShown() ),
209  bTableDataHeight( true ),
210  mbSkipImages ( false ),
211  mbSkipHeaderFooter( false )
212 {
213  strcpy( sIndent, sIndentSource );
214  sIndent[0] = 0;
215 
216  // set HTML configuration
217  bCopyLocalFileToINet = officecfg::Office::Common::Filter::HTML::Export::LocalGraphic::get();
218 
219  if (rFilterOptions == u"SkipImages")
220  {
221  mbSkipImages = true;
222  }
223  else if (rFilterOptions == u"SkipHeaderFooter")
224  {
225  mbSkipHeaderFooter = true;
226  }
227 
228  for ( sal_uInt16 j=0; j < SC_HTML_FONTSIZES; j++ )
229  {
230  sal_uInt16 nSize = SvxHtmlOptions::GetFontSize( j );
231  // remember in Twips, like our SvxFontHeightItem
232  if ( nSize )
233  nFontSize[j] = nSize * 20;
234  else
235  nFontSize[j] = nDefaultFontSize[j] * 20;
236  }
237 
238  const SCTAB nCount = pDoc->GetTableCount();
239  for ( SCTAB nTab = 0; nTab < nCount; nTab++ )
240  {
241  if ( !IsEmptyTable( nTab ) )
242  nUsedTables++;
243  }
244 }
245 
247 {
248  aGraphList.clear();
249 }
250 
251 sal_uInt16 ScHTMLExport::GetFontSizeNumber( sal_uInt16 nHeight )
252 {
253  sal_uInt16 nSize = 1;
254  for ( sal_uInt16 j=SC_HTML_FONTSIZES-1; j>0; j-- )
255  {
256  if( nHeight > (nFontSize[j] + nFontSize[j-1]) / 2 )
257  { // The one next to it
258  nSize = j+1;
259  break;
260  }
261  }
262  return nSize;
263 }
264 
265 const char* ScHTMLExport::GetFontSizeCss( sal_uInt16 nHeight )
266 {
267  sal_uInt16 nSize = GetFontSizeNumber( nHeight );
268  return pFontSizeCss[ nSize-1 ];
269 }
270 
271 sal_uInt16 ScHTMLExport::ToPixel( sal_uInt16 nVal )
272 {
273  if( nVal )
274  {
275  nVal = static_cast<sal_uInt16>(pAppWin->LogicToPixel(
276  Size( nVal, nVal ), MapMode( MapUnit::MapTwip ) ).Width());
277  if( !nVal ) // If there's a Twip there should also be a Pixel
278  nVal = 1;
279  }
280  return nVal;
281 }
282 
284 {
285  Size aSize = pAppWin->LogicToPixel( rSize, MapMode( MapUnit::Map100thMM ) );
286  // If there's something there should also be a Pixel
287  if ( !aSize.Width() && rSize.Width() )
288  aSize.setWidth( 1 );
289  if ( !aSize.Height() && rSize.Height() )
290  aSize.setHeight( 1 );
291  return aSize;
292 }
293 
295 {
296  if (!mbSkipHeaderFooter)
297  {
301  WriteHeader();
302  OUT_LF();
303  }
304  WriteBody();
305  OUT_LF();
306  if (!mbSkipHeaderFooter)
308 }
309 
311 {
313 
314  if ( pDoc->IsClipOrUndo() )
315  { // no real DocInfo available, but some META information like charset needed
317  }
318  else
319  {
320  uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
321  pDoc->GetDocumentShell()->GetModel(), uno::UNO_QUERY_THROW);
322  uno::Reference<document::XDocumentProperties> xDocProps
323  = xDPS->getDocumentProperties();
326  OUT_LF();
327 
328  if (!xDocProps->getPrintedBy().isEmpty())
329  {
330  OUT_COMMENT( GLOBSTR( STR_DOC_INFO ) );
331  OUString aStrOut = GLOBSTR( STR_DOC_PRINTED ) + ": ";
332  lcl_AddStamp( aStrOut, xDocProps->getPrintedBy(),
333  xDocProps->getPrintDate(), ScGlobal::getLocaleData() );
334  OUT_COMMENT( aStrOut );
335  }
336 
337  }
338  OUT_LF();
339 
340  // CSS1 StyleSheet
341  PageDefaults( bAll ? 0 : aRange.aStart.Tab() );
342  IncIndent(1);
344 
345  OUT_LF();
347  rStrm.WriteCharPtr(",");
349  rStrm.WriteCharPtr(",");
351  rStrm.WriteCharPtr(",");
353  rStrm.WriteCharPtr(",");
355  rStrm.WriteCharPtr(",");
357  rStrm.WriteCharPtr(",");
359  rStrm.WriteCharPtr(",");
361  rStrm.WriteCharPtr(",");
363  rStrm.WriteCharPtr(",");
365  rStrm.WriteCharPtr(" { ");
366  rStrm.WriteCharPtr("font-family:");
367 
368  if (!aHTMLStyle.aFontFamilyName.isEmpty())
369  {
370  const OUString& rList = aHTMLStyle.aFontFamilyName;
371  for(sal_Int32 nPos {0};;)
372  {
373  rStrm.WriteChar( '\"' );
374  OUT_STR( rList.getToken( 0, ';', nPos ) );
375  rStrm.WriteChar( '\"' );
376  if (nPos<0)
377  break;
378  rStrm.WriteCharPtr( ", " );
379  }
380  }
381  rStrm.WriteCharPtr("; ");
382  rStrm.WriteCharPtr("font-size:");
383  rStrm.WriteCharPtr(GetFontSizeCss(static_cast<sal_uInt16>(aHTMLStyle.nFontHeight)));
384  rStrm.WriteCharPtr(" }");
385 
386  OUT_LF();
387 
388  // write the style for the comments to make them stand out from normal cell content
389  // this is done through only showing the cell contents when the custom indicator is hovered
391  rStrm.WriteCharPtr(".comment-indicator:hover");
392  rStrm.WriteCharPtr(" + ");
394  rStrm.WriteCharPtr(" { ");
396  rStrm.WriteCharPtr("#ffd");
397  rStrm.WriteCharPtr("; ");
398  rStrm.WriteCharPtr("position:");
399  rStrm.WriteCharPtr("absolute");
400  rStrm.WriteCharPtr("; ");
402  rStrm.WriteCharPtr("block");
403  rStrm.WriteCharPtr("; ");
405  rStrm.WriteCharPtr("1px solid black");
406  rStrm.WriteCharPtr("; ");
407  rStrm.WriteCharPtr("padding:");
408  rStrm.WriteCharPtr("0.5em");
409  rStrm.WriteCharPtr("; ");
410  rStrm.WriteCharPtr(" } ");
411 
412  OUT_LF();
413 
415  rStrm.WriteCharPtr(".comment-indicator");
416  rStrm.WriteCharPtr(" { ");
418  rStrm.WriteCharPtr("red");
419  rStrm.WriteCharPtr("; ");
421  rStrm.WriteCharPtr("inline-block");
422  rStrm.WriteCharPtr("; ");
424  rStrm.WriteCharPtr("1px solid black");
425  rStrm.WriteCharPtr("; ");
426  rStrm.WriteCharPtr("width:");
427  rStrm.WriteCharPtr("0.5em");
428  rStrm.WriteCharPtr("; ");
429  rStrm.WriteCharPtr("height:");
430  rStrm.WriteCharPtr("0.5em");
431  rStrm.WriteCharPtr("; ");
432  rStrm.WriteCharPtr(" } ");
433 
434  OUT_LF();
435 
437  rStrm.WriteCharPtr(" { ");
439  rStrm.WriteCharPtr("none");
440  rStrm.WriteCharPtr("; ");
441  rStrm.WriteCharPtr(" } ");
442 
443 
444  IncIndent(-1);
445  OUT_LF();
447 
448  IncIndent(-1);
449  OUT_LF();
451 }
452 
454 {
455  if ( nUsedTables <= 1 )
456  return;
457 
458  IncIndent(1);
459  OUT_HR();
462  OUT_STR( ScResId( STR_OVERVIEW ) );
464 
465  OUString aStr;
466 
467  const SCTAB nCount = pDoc->GetTableCount();
468  for ( SCTAB nTab = 0; nTab < nCount; nTab++ )
469  {
470  if ( !IsEmptyTable( nTab ) )
471  {
472  pDoc->GetName( nTab, aStr );
473  rStrm.WriteCharPtr( "<A HREF=\"#table" )
474  .WriteOString( OString::number(nTab) )
475  .WriteCharPtr( "\">" );
476  OUT_STR( aStr );
477  rStrm.WriteCharPtr( "</A>" );
479  }
480  }
481 
482  IncIndent(-1); OUT_LF();
484 }
485 
487 {
489  SfxStyleSheetBase* pStyleSheet = nullptr;
490  OSL_ENSURE( pStylePool, "StylePool not found! :-(" );
491 
492  // remember defaults for compare in WriteCell
493  if ( !aHTMLStyle.bInitialized )
494  {
495  pStyleSheet = pStylePool->Find(
496  ScResId(STR_STYLENAME_STANDARD),
497  SfxStyleFamily::Para );
498  OSL_ENSURE( pStyleSheet, "ParaStyle not found! :-(" );
499  if (!pStyleSheet)
500  pStyleSheet = pStylePool->First(SfxStyleFamily::Para);
501  const SfxItemSet& rSetPara = pStyleSheet->GetItemSet();
502 
504  aHTMLStyle.aFontFamilyName = static_cast<const SvxFontItem&>((rSetPara.Get(
507  )))).GetFamilyName();
508  aHTMLStyle.nFontHeight = static_cast<const SvxFontHeightItem&>((rSetPara.Get(
511  )))).GetHeight();
512  aHTMLStyle.nFontSizeNumber = GetFontSizeNumber( static_cast< sal_uInt16 >( aHTMLStyle.nFontHeight ) );
513  }
514 
515  // Page style sheet printer settings, e.g. for background graphics.
516  // There's only one background graphic in HTML!
517  pStyleSheet = pStylePool->Find( pDoc->GetPageStyle( nTab ), SfxStyleFamily::Page );
518  OSL_ENSURE( pStyleSheet, "PageStyle not found! :-(" );
519  if (!pStyleSheet)
520  pStyleSheet = pStylePool->First(SfxStyleFamily::Page);
521  const SfxItemSet& rSet = pStyleSheet->GetItemSet();
522  if ( !aHTMLStyle.bInitialized )
523  {
524  const SvxBrushItem* pBrushItem = &rSet.Get( ATTR_BACKGROUND );
525  aHTMLStyle.aBackgroundColor = pBrushItem->GetColor();
526  aHTMLStyle.bInitialized = true;
527  }
528  return rSet;
529 }
530 
531 OString ScHTMLExport::BorderToStyle(const char* pBorderName,
532  const SvxBorderLine* pLine, bool& bInsertSemicolon)
533 {
534  OStringBuffer aOut;
535 
536  if ( pLine )
537  {
538  if ( bInsertSemicolon )
539  aOut.append("; ");
540 
541  // which border
542  aOut.append(OString::Concat("border-") + pBorderName + ": ");
543 
544  // thickness
545  int nWidth = pLine->GetWidth();
546  int nPxWidth = (nWidth > 0) ?
547  std::max(o3tl::convert(nWidth, o3tl::Length::twip, o3tl::Length::px), sal_Int64(1)) : 0;
548  aOut.append(OString::number(nPxWidth) + "px ");
549  switch (pLine->GetBorderLineStyle())
550  {
551  case SvxBorderLineStyle::SOLID:
552  aOut.append("solid");
553  break;
554  case SvxBorderLineStyle::DOTTED:
555  aOut.append("dotted");
556  break;
557  case SvxBorderLineStyle::DASHED:
558  case SvxBorderLineStyle::DASH_DOT:
559  case SvxBorderLineStyle::DASH_DOT_DOT:
560  aOut.append("dashed");
561  break;
562  case SvxBorderLineStyle::DOUBLE:
563  case SvxBorderLineStyle::DOUBLE_THIN:
564  case SvxBorderLineStyle::THINTHICK_SMALLGAP:
565  case SvxBorderLineStyle::THINTHICK_MEDIUMGAP:
566  case SvxBorderLineStyle::THINTHICK_LARGEGAP:
567  case SvxBorderLineStyle::THICKTHIN_SMALLGAP:
568  case SvxBorderLineStyle::THICKTHIN_MEDIUMGAP:
569  case SvxBorderLineStyle::THICKTHIN_LARGEGAP:
570  aOut.append("double");
571  break;
572  case SvxBorderLineStyle::EMBOSSED:
573  aOut.append("ridge");
574  break;
575  case SvxBorderLineStyle::ENGRAVED:
576  aOut.append("groove");
577  break;
578  case SvxBorderLineStyle::OUTSET:
579  aOut.append("outset");
580  break;
581  case SvxBorderLineStyle::INSET:
582  aOut.append("inset");
583  break;
584  default:
585  aOut.append("hidden");
586  }
587  aOut.append(" #");
588 
589  // color
590  char hex[7];
591  snprintf( hex, 7, "%06" SAL_PRIxUINT32, static_cast<sal_uInt32>( pLine->GetColor().GetRGBColor() ) );
592  hex[6] = 0;
593 
594  aOut.append(hex);
595 
596  bInsertSemicolon = true;
597  }
598 
599  return aOut.makeStringAndClear();
600 }
601 
603 {
604  const SfxItemSet& rSet = PageDefaults( bAll ? 0 : aRange.aStart.Tab() );
605  const SvxBrushItem* pBrushItem = &rSet.Get( ATTR_BACKGROUND );
606 
607  // default text color black
608  if (!mbSkipHeaderFooter)
609  {
611 
612  if (!mbSkipImages)
613  {
614  if ( bAll && GPOS_NONE != pBrushItem->GetGraphicPos() )
615  {
616  OUString aLink = pBrushItem->GetGraphicLink();
617  OUString aGrfNm;
618 
619  // Embedded graphic -> write using WriteGraphic
620  if( aLink.isEmpty() )
621  {
622  const Graphic* pGrf = pBrushItem->GetGraphic();
623  if( pGrf )
624  {
625  // Save graphic as (JPG) file
626  aGrfNm = aStreamPath;
627  ErrCode nErr = XOutBitmap::WriteGraphic( *pGrf, aGrfNm,
628  "JPG", XOutFlags::UseNativeIfPossible );
629  if( !nErr ) // Contains errors, as we have nothing to output
630  {
631  aGrfNm = URIHelper::SmartRel2Abs(
633  aGrfNm, URIHelper::GetMaybeFileHdl());
634  aLink = aGrfNm;
635  }
636  }
637  }
638  else
639  {
640  aGrfNm = aLink;
642  {
643  CopyLocalFileToINet( aGrfNm, aStreamPath );
644  }
645  else
646  aGrfNm = URIHelper::SmartRel2Abs(
648  aGrfNm, URIHelper::GetMaybeFileHdl());
649  aLink = aGrfNm;
650  }
651  if( !aLink.isEmpty() )
652  {
655  aBaseURL,
656  aLink ) ).WriteChar( '\"' );
657  }
658  }
659  }
661  { // A transparent background color should always result in default
662  // background of the browser. Also, HTMLOutFuncs::Out_Color() writes
663  // black #000000 for COL_AUTO which is the same as white #ffffff with
664  // transparency set to 0xff, our default background.
667  }
668 
669  rStrm.WriteChar( '>' ); OUT_LF();
670  }
671 
672  if ( bAll )
673  WriteOverview();
674 
675  WriteTables();
676 
677  if (!mbSkipHeaderFooter)
679 }
680 
682 {
683  const SCTAB nTabCount = pDoc->GetTableCount();
684  const OUString aStrTable( ScResId( SCSTR_TABLE ) );
685  OUString aStr;
686  OUString aStrOut;
687  SCCOL nStartCol;
688  SCROW nStartRow;
689  SCTAB nStartTab;
690  SCCOL nEndCol;
691  SCROW nEndRow;
692  SCTAB nEndTab;
693  SCCOL nStartColFix = 0;
694  SCROW nStartRowFix = 0;
695  SCCOL nEndColFix = 0;
696  SCROW nEndRowFix = 0;
697  ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
698  if ( bAll )
699  {
700  nStartTab = 0;
701  nEndTab = nTabCount - 1;
702  }
703  else
704  {
705  nStartCol = nStartColFix = aRange.aStart.Col();
706  nStartRow = nStartRowFix = aRange.aStart.Row();
707  nStartTab = aRange.aStart.Tab();
708  nEndCol = nEndColFix = aRange.aEnd.Col();
709  nEndRow = nEndRowFix = aRange.aEnd.Row();
710  nEndTab = aRange.aEnd.Tab();
711  }
712  SCTAB nTableStrNum = 1;
713  for ( SCTAB nTab=nStartTab; nTab<=nEndTab; nTab++ )
714  {
715  if ( !pDoc->IsVisible( nTab ) )
716  continue; // for
717 
718  if ( bAll )
719  {
720  if ( !GetDataArea( nTab, nStartCol, nStartRow, nEndCol, nEndRow ) )
721  continue; // for
722 
723  if ( nUsedTables > 1 )
724  {
725  aStrOut = aStrTable + " " + OUString::number( nTableStrNum++ ) + ": ";
726 
727  OUT_HR();
728 
729  // Write anchor
730  rStrm.WriteCharPtr( "<A NAME=\"table" )
731  .WriteOString( OString::number(nTab) )
732  .WriteCharPtr( "\">" );
734  OUT_STR( aStrOut );
736 
737  pDoc->GetName( nTab, aStr );
738  OUT_STR( aStr );
739 
742  rStrm.WriteCharPtr( "</A>" ); OUT_LF();
743  }
744  }
745  else
746  {
747  nStartCol = nStartColFix;
748  nStartRow = nStartRowFix;
749  nEndCol = nEndColFix;
750  nEndRow = nEndRowFix;
751  if ( !TrimDataArea( nTab, nStartCol, nStartRow, nEndCol, nEndRow ) )
752  continue; // for
753  }
754 
755  // <TABLE ...>
756  OStringBuffer aByteStrOut(OOO_STRING_SVTOOLS_HTML_table);
757 
759  if ( bAll && pDrawLayer )
760  PrepareGraphics( pDrawLayer, nTab, nStartCol, nStartRow,
761  nEndCol, nEndRow );
762 
763  // more <TABLE ...>
764  if ( bTabAlignedLeft )
765  {
766  aByteStrOut.append(" " OOO_STRING_SVTOOLS_HTML_O_align
767  "=\""
769  }
770  // ALIGN=LEFT allow text and graphics to flow around
771  // CELLSPACING
772  aByteStrOut.append(" " OOO_STRING_SVTOOLS_HTML_O_cellspacing
773  "=\"" +
774  OString::number(nCellSpacing) + "\"");
775 
776  // BORDER=0, we do the styling of the cells in <TD>
777  aByteStrOut.append(" " OOO_STRING_SVTOOLS_HTML_O_border "=\"0\"");
778  IncIndent(1); TAG_ON_LF( aByteStrOut.makeStringAndClear().getStr() );
779 
780  // --- <COLGROUP> ----
781  {
782  SCCOL nCol = nStartCol;
783  sal_Int32 nWidth = 0;
784  sal_Int32 nSpan = 0;
785  while( nCol <= nEndCol )
786  {
787  if( pDoc->ColHidden(nCol, nTab) )
788  {
789  ++nCol;
790  continue;
791  }
792 
793  if( nWidth != ToPixel( pDoc->GetColWidth( nCol, nTab ) ) )
794  {
795  if( nSpan != 0 )
796  {
797  TAG_ON(lcl_getColGroupString(nSpan, nWidth).getStr());
799  }
800  nWidth = ToPixel( pDoc->GetColWidth( nCol, nTab ) );
801  nSpan = 1;
802  }
803  else
804  nSpan++;
805  nCol++;
806  }
807  if( nSpan )
808  {
809  TAG_ON(lcl_getColGroupString(nSpan, nWidth).getStr());
811  }
812  }
813 
814  // <TBODY> // Re-enable only when THEAD and TFOOT are exported
815  // IncIndent(1); TAG_ON_LF( OOO_STRING_SVTOOLS_HTML_tbody );
816  // At least old (3.x, 4.x?) Netscape doesn't follow <TABLE COLS=n> and
817  // <COL WIDTH=x> specified, but needs a width at every column.
818  bool bHasHiddenRows = pDoc->HasHiddenRows(nStartRow, nEndRow, nTab);
819  // We need to cache sc::ColumnBlockPosition per each column.
820  std::vector< sc::ColumnBlockPosition > blockPos( nEndCol - nStartCol + 1 );
821  for( SCCOL i = nStartCol; i <= nEndCol; ++i )
822  pDoc->InitColumnBlockPosition( blockPos[ i - nStartCol ], nTab, i );
823  for ( SCROW nRow=nStartRow; nRow<=nEndRow; nRow++ )
824  {
825  if ( bHasHiddenRows && pDoc->RowHidden(nRow, nTab) )
826  {
827  nRow = pDoc->FirstVisibleRow(nRow+1, nEndRow, nTab);
828  --nRow;
829  continue; // for
830  }
831 
833  bTableDataHeight = true; // height at every first cell of each row
834  for ( SCCOL nCol2=nStartCol; nCol2<=nEndCol; nCol2++ )
835  {
836  if ( pDoc->ColHidden(nCol2, nTab) )
837  continue; // for
838 
839  if ( nCol2 == nEndCol )
840  IncIndent(-1);
841  WriteCell( blockPos[ nCol2 - nStartCol ], nCol2, nRow, nTab );
842  bTableDataHeight = false;
843  }
844 
845  if ( nRow == nEndRow )
846  IncIndent(-1);
848  }
849  // TODO: Uncomment later
850  // IncIndent(-1); TAG_OFF_LF( OOO_STRING_SVTOOLS_HTML_tbody );
851 
853 
854  if ( bTabHasGraphics && !mbSkipImages )
855  {
856  // the rest that is not in a cell
857  size_t ListSize = aGraphList.size();
858  for ( size_t i = 0; i < ListSize; ++i )
859  {
861  if ( !pE->bWritten )
862  WriteGraphEntry( pE );
863  }
864  aGraphList.clear();
865  if ( bTabAlignedLeft )
866  {
867  // clear <TABLE ALIGN=LEFT> with <BR CLEAR=LEFT>
868  aByteStrOut.append(OOO_STRING_SVTOOLS_HTML_linebreak);
869  aByteStrOut.append(' ').
870  append(OOO_STRING_SVTOOLS_HTML_O_clear).append('=').
872  TAG_ON_LF( aByteStrOut.makeStringAndClear().getStr() );
873  }
874  }
875 
876  if ( bAll )
877  OUT_COMMENT( "**************************************************************************" );
878  }
879 }
880 
882 {
883  ScAddress aPos( nCol, nRow, nTab );
884  ScRefCellValue aCell(*pDoc, aPos, rBlockPos);
885  const ScPatternAttr* pAttr = pDoc->GetPattern( nCol, nRow, nTab );
886  const SfxItemSet* pCondItemSet = pDoc->GetCondResult( nCol, nRow, nTab, &aCell );
887 
888  const ScMergeFlagAttr& rMergeFlagAttr = pAttr->GetItem( ATTR_MERGE_FLAG, pCondItemSet );
889  if ( rMergeFlagAttr.IsOverlapped() )
890  return ;
891 
892  ScHTMLGraphEntry* pGraphEntry = nullptr;
893  if ( bTabHasGraphics && !mbSkipImages )
894  {
895  size_t ListSize = aGraphList.size();
896  for ( size_t i = 0; i < ListSize; ++i )
897  {
899  if ( pE->bInCell && pE->aRange.Contains( aPos ) )
900  {
901  if ( pE->aRange.aStart == aPos )
902  {
903  pGraphEntry = pE;
904  break; // for
905  }
906  else
907  return ; // Is a Col/RowSpan, Overlapped
908  }
909  }
910  }
911 
912  sal_uInt32 nFormat = pAttr->GetNumberFormat( pFormatter );
913  bool bValueData = aCell.hasNumeric();
914  SvtScriptType nScriptType = SvtScriptType::NONE;
915  if (!aCell.isEmpty())
916  nScriptType = pDoc->GetScriptType(nCol, nRow, nTab, &aCell);
917 
918  if ( nScriptType == SvtScriptType::NONE )
919  nScriptType = aHTMLStyle.nDefaultScriptType;
920 
921  OStringBuffer aStrTD(OOO_STRING_SVTOOLS_HTML_tabledata);
922 
923  // border of the cells
924  const SvxBoxItem* pBorder = pDoc->GetAttr( nCol, nRow, nTab, ATTR_BORDER );
925  if ( pBorder && (pBorder->GetTop() || pBorder->GetBottom() || pBorder->GetLeft() || pBorder->GetRight()) )
926  {
927  aStrTD.append(" " OOO_STRING_SVTOOLS_HTML_style "=\"");
928 
929  bool bInsertSemicolon = false;
930  aStrTD.append(BorderToStyle("top", pBorder->GetTop(),
931  bInsertSemicolon));
932  aStrTD.append(BorderToStyle("bottom", pBorder->GetBottom(),
933  bInsertSemicolon));
934  aStrTD.append(BorderToStyle("left", pBorder->GetLeft(),
935  bInsertSemicolon));
936  aStrTD.append(BorderToStyle("right", pBorder->GetRight(),
937  bInsertSemicolon));
938 
939  aStrTD.append('"');
940  }
941 
942  const char* pChar;
943  sal_uInt16 nHeightPixel;
944 
945  const ScMergeAttr& rMergeAttr = pAttr->GetItem( ATTR_MERGE, pCondItemSet );
946  if ( pGraphEntry || rMergeAttr.IsMerged() )
947  {
948  SCCOL nC, jC;
949  SCROW nR;
950  tools::Long v;
951  if ( pGraphEntry )
952  nC = std::max( SCCOL(pGraphEntry->aRange.aEnd.Col() - nCol + 1),
953  rMergeAttr.GetColMerge() );
954  else
955  nC = rMergeAttr.GetColMerge();
956  if ( nC > 1 )
957  {
958  aStrTD.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_colspan).
959  append('=').append(static_cast<sal_Int32>(nC));
960  nC = nC + nCol;
961  for ( jC=nCol, v=0; jC<nC; jC++ )
962  v += pDoc->GetColWidth( jC, nTab );
963  }
964 
965  if ( pGraphEntry )
966  nR = std::max( SCROW(pGraphEntry->aRange.aEnd.Row() - nRow + 1),
967  rMergeAttr.GetRowMerge() );
968  else
969  nR = rMergeAttr.GetRowMerge();
970  if ( nR > 1 )
971  {
972  aStrTD.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_rowspan).
973  append('=').append(static_cast<sal_Int32>(nR));
974  nR += nRow;
975  v = pDoc->GetRowHeight( nRow, nR-1, nTab );
976  nHeightPixel = ToPixel( static_cast< sal_uInt16 >( v ) );
977  }
978  else
979  nHeightPixel = ToPixel( pDoc->GetRowHeight( nRow, nTab ) );
980  }
981  else
982  nHeightPixel = ToPixel( pDoc->GetRowHeight( nRow, nTab ) );
983 
984  if ( bTableDataHeight )
985  {
986  aStrTD.append(" " OOO_STRING_SVTOOLS_HTML_O_height "=\"" +
987  OString::number(nHeightPixel) + "\"");
988  }
989 
990  const SvxFontItem& rFontItem = static_cast<const SvxFontItem&>( pAttr->GetItem(
992  pCondItemSet) );
993 
994  const SvxFontHeightItem& rFontHeightItem = static_cast<const SvxFontHeightItem&>(
995  pAttr->GetItem( ScGlobal::GetScriptedWhichID( nScriptType,
996  ATTR_FONT_HEIGHT), pCondItemSet) );
997 
998  const SvxWeightItem& rWeightItem = static_cast<const SvxWeightItem&>( pAttr->GetItem(
1000  pCondItemSet) );
1001 
1002  const SvxPostureItem& rPostureItem = static_cast<const SvxPostureItem&>(
1003  pAttr->GetItem( ScGlobal::GetScriptedWhichID( nScriptType,
1004  ATTR_FONT_POSTURE), pCondItemSet) );
1005 
1006  const SvxUnderlineItem& rUnderlineItem =
1007  pAttr->GetItem( ATTR_FONT_UNDERLINE, pCondItemSet );
1008 
1009  const SvxCrossedOutItem& rCrossedOutItem =
1010  pAttr->GetItem( ATTR_FONT_CROSSEDOUT, pCondItemSet );
1011 
1012  const SvxColorItem& rColorItem = pAttr->GetItem(
1013  ATTR_FONT_COLOR, pCondItemSet );
1014 
1015  const SvxHorJustifyItem& rHorJustifyItem =
1016  pAttr->GetItem( ATTR_HOR_JUSTIFY, pCondItemSet );
1017 
1018  const SvxVerJustifyItem& rVerJustifyItem =
1019  pAttr->GetItem( ATTR_VER_JUSTIFY, pCondItemSet );
1020 
1021  const SvxBrushItem& rBrushItem = pAttr->GetItem(
1022  ATTR_BACKGROUND, pCondItemSet );
1023 
1024  Color aBgColor;
1025  if ( rBrushItem.GetColor().GetAlpha() == 0 )
1026  aBgColor = aHTMLStyle.aBackgroundColor; // No unwanted background color
1027  else
1028  aBgColor = rBrushItem.GetColor();
1029 
1030  bool bBold = ( WEIGHT_BOLD <= rWeightItem.GetWeight() );
1031  bool bItalic = ( ITALIC_NONE != rPostureItem.GetPosture() );
1032  bool bUnderline = ( LINESTYLE_NONE != rUnderlineItem.GetLineStyle() );
1033  bool bCrossedOut = ( STRIKEOUT_SINGLE <= rCrossedOutItem.GetStrikeout() );
1034  bool bSetFontColor = ( COL_AUTO != rColorItem.GetValue() ); // default is AUTO now
1035  bool bSetFontName = ( aHTMLStyle.aFontFamilyName != rFontItem.GetFamilyName() );
1036  sal_uInt16 nSetFontSizeNumber = 0;
1037  sal_uInt32 nFontHeight = rFontHeightItem.GetHeight();
1038  if ( nFontHeight != aHTMLStyle.nFontHeight )
1039  {
1040  nSetFontSizeNumber = GetFontSizeNumber( static_cast<sal_uInt16>(nFontHeight) );
1041  if ( nSetFontSizeNumber == aHTMLStyle.nFontSizeNumber )
1042  nSetFontSizeNumber = 0; // no difference, don't set
1043  }
1044 
1045  bool bSetFont = (bSetFontColor || bSetFontName || nSetFontSizeNumber);
1046 
1050 
1051  switch( rHorJustifyItem.GetValue() )
1052  {
1053  case SvxCellHorJustify::Standard:
1055  break;
1056  case SvxCellHorJustify::Center: pChar = OOO_STRING_SVTOOLS_HTML_AL_center; break;
1057  case SvxCellHorJustify::Block: pChar = OOO_STRING_SVTOOLS_HTML_AL_justify; break;
1058  case SvxCellHorJustify::Right: pChar = OOO_STRING_SVTOOLS_HTML_AL_right; break;
1059  case SvxCellHorJustify::Left:
1060  case SvxCellHorJustify::Repeat:
1061  default: pChar = OOO_STRING_SVTOOLS_HTML_AL_left; break;
1062  }
1063 
1064  aStrTD.append(" " OOO_STRING_SVTOOLS_HTML_O_align "=\"" +
1065  OString::Concat(pChar) + "\"");
1066 
1067  switch( rVerJustifyItem.GetValue() )
1068  {
1069  case SvxCellVerJustify::Top: pChar = OOO_STRING_SVTOOLS_HTML_VA_top; break;
1070  case SvxCellVerJustify::Center: pChar = OOO_STRING_SVTOOLS_HTML_VA_middle; break;
1071  case SvxCellVerJustify::Bottom: pChar = OOO_STRING_SVTOOLS_HTML_VA_bottom; break;
1072  case SvxCellVerJustify::Standard:
1073  default: pChar = nullptr;
1074  }
1075  if ( pChar )
1076  {
1077  aStrTD.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_valign).
1078  append('=').append(pChar);
1079  }
1080 
1081  if ( aHTMLStyle.aBackgroundColor != aBgColor )
1082  {
1083  aStrTD.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_bgcolor).
1084  append('=');
1085  aStrTD.append(lcl_makeHTMLColorTriplet(aBgColor));
1086  }
1087 
1088  double fVal = 0.0;
1089  if ( bValueData )
1090  {
1091  switch (aCell.meType)
1092  {
1093  case CELLTYPE_VALUE:
1094  fVal = aCell.mfValue;
1095  if ( bCalcAsShown && fVal != 0.0 )
1096  fVal = pDoc->RoundValueAsShown( fVal, nFormat );
1097  break;
1098  case CELLTYPE_FORMULA:
1099  fVal = aCell.mpFormula->GetValue();
1100  break;
1101  default:
1102  OSL_FAIL( "value data with unsupported cell type" );
1103  }
1104  }
1105 
1106  aStrTD.append(HTMLOutFuncs::CreateTableDataOptionsValNum(bValueData, fVal,
1107  nFormat, *pFormatter, &aNonConvertibleChars));
1108 
1109  TAG_ON(aStrTD.makeStringAndClear().getStr());
1110 
1111  //write the note for this as the first thing in the tag
1112  ScPostIt* pNote = pDoc->HasNote(aPos) ? pDoc->GetNote(aPos) : nullptr;
1113  if (pNote)
1114  {
1115  //create the comment indicator
1116  OString aStr = OOO_STRING_SVTOOLS_HTML_anchor " "
1117  OOO_STRING_SVTOOLS_HTML_O_class "=\"comment-indicator\"";
1118  TAG_ON(aStr.getStr());
1120  OUT_LF();
1121 
1122  //create the element holding the contents
1123  //this is a bit naive, since it doesn't separate
1124  //lines into html breaklines yet
1126  OUT_STR( pNote->GetText() );
1128  OUT_LF();
1129  }
1130 
1131  if ( bBold ) TAG_ON( OOO_STRING_SVTOOLS_HTML_bold );
1132  if ( bItalic ) TAG_ON( OOO_STRING_SVTOOLS_HTML_italic );
1133  if ( bUnderline ) TAG_ON( OOO_STRING_SVTOOLS_HTML_underline );
1134  if ( bCrossedOut ) TAG_ON( OOO_STRING_SVTOOLS_HTML_strikethrough );
1135 
1136  if ( bSetFont )
1137  {
1138  OStringBuffer aStr(OOO_STRING_SVTOOLS_HTML_font);
1139  if ( bSetFontName )
1140  {
1141  aStr.append(" " OOO_STRING_SVTOOLS_HTML_O_face "=\"");
1142 
1143  if (!rFontItem.GetFamilyName().isEmpty())
1144  {
1145  const OUString& rList = rFontItem.GetFamilyName();
1146  for (sal_Int32 nPos {0};;)
1147  {
1148  OString aTmpStr = HTMLOutFuncs::ConvertStringToHTML(
1149  rList.getToken( 0, ';', nPos ),
1151  aStr.append(aTmpStr);
1152  if (nPos<0)
1153  break;
1154  aStr.append(',');
1155  }
1156  }
1157 
1158  aStr.append('\"');
1159  }
1160  if ( nSetFontSizeNumber )
1161  {
1162  aStr.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_size).
1163  append('=').append(static_cast<sal_Int32>(nSetFontSizeNumber));
1164  }
1165  if ( bSetFontColor )
1166  {
1167  Color aColor = rColorItem.GetValue();
1168 
1169  // always export automatic text color as black
1170  if ( aColor == COL_AUTO )
1171  aColor = COL_BLACK;
1172 
1173  aStr.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_color).
1174  append('=').append(lcl_makeHTMLColorTriplet(aColor));
1175  }
1176  TAG_ON(aStr.makeStringAndClear().getStr());
1177  }
1178 
1179  OUString aURL;
1180  bool bWriteHyperLink(false);
1181  if (aCell.meType == CELLTYPE_FORMULA)
1182  {
1183  ScFormulaCell* pFCell = aCell.mpFormula;
1184  if (pFCell->IsHyperLinkCell())
1185  {
1186  OUString aCellText;
1187  pFCell->GetURLResult(aURL, aCellText);
1188  bWriteHyperLink = true;
1189  }
1190  }
1191 
1192  if (bWriteHyperLink)
1193  {
1194  OString aURLStr = HTMLOutFuncs::ConvertStringToHTML(aURL, &aNonConvertibleChars);
1195  OString aStr = OOO_STRING_SVTOOLS_HTML_anchor " " OOO_STRING_SVTOOLS_HTML_O_href "=\"" + aURLStr + "\"";
1196  TAG_ON(aStr.getStr());
1197  }
1198 
1199  OUString aStrOut;
1200  bool bFieldText = false;
1201 
1202  const Color* pColor;
1203  switch (aCell.meType)
1204  {
1205  case CELLTYPE_EDIT :
1206  bFieldText = WriteFieldText(aCell.mpEditText);
1207  if ( bFieldText )
1208  break;
1209  [[fallthrough]];
1210  default:
1211  aStrOut = ScCellFormat::GetString(aCell, nFormat, &pColor, *pFormatter, *pDoc);
1212  }
1213 
1214  if ( !bFieldText )
1215  {
1216  if ( aStrOut.isEmpty() )
1217  {
1218  TAG_ON( OOO_STRING_SVTOOLS_HTML_linebreak ); // No completely empty line
1219  }
1220  else
1221  {
1222  sal_Int32 nPos = aStrOut.indexOf( '\n' );
1223  if ( nPos == -1 )
1224  {
1225  OUT_STR( aStrOut );
1226  }
1227  else
1228  {
1229  sal_Int32 nStartPos = 0;
1230  do
1231  {
1232  OUString aSingleLine = aStrOut.copy( nStartPos, nPos - nStartPos );
1233  OUT_STR( aSingleLine );
1235  nStartPos = nPos + 1;
1236  }
1237  while( ( nPos = aStrOut.indexOf( '\n', nStartPos ) ) != -1 );
1238  OUString aSingleLine = aStrOut.copy( nStartPos );
1239  OUT_STR( aSingleLine );
1240  }
1241  }
1242  }
1243  if ( pGraphEntry )
1244  WriteGraphEntry( pGraphEntry );
1245 
1246  if (bWriteHyperLink) { TAG_OFF(OOO_STRING_SVTOOLS_HTML_anchor); }
1247 
1248  if ( bSetFont ) TAG_OFF( OOO_STRING_SVTOOLS_HTML_font );
1249  if ( bCrossedOut ) TAG_OFF( OOO_STRING_SVTOOLS_HTML_strikethrough );
1250  if ( bUnderline ) TAG_OFF( OOO_STRING_SVTOOLS_HTML_underline );
1251  if ( bItalic ) TAG_OFF( OOO_STRING_SVTOOLS_HTML_italic );
1252  if ( bBold ) TAG_OFF( OOO_STRING_SVTOOLS_HTML_bold );
1253 
1255 }
1256 
1258 {
1259  bool bFields = false;
1260  // text and anchor of URL fields, Doc-Engine is a ScFieldEditEngine
1261  EditEngine& rEngine = pDoc->GetEditEngine();
1262  rEngine.SetText( *pData );
1263  sal_Int32 nParas = rEngine.GetParagraphCount();
1264  if ( nParas )
1265  {
1266  ESelection aSel( 0, 0, nParas-1, rEngine.GetTextLen( nParas-1 ) );
1267  SfxItemSet aSet( rEngine.GetAttribs( aSel ) );
1268  SfxItemState eFieldState = aSet.GetItemState( EE_FEATURE_FIELD, false );
1269  if ( eFieldState == SfxItemState::DONTCARE || eFieldState == SfxItemState::SET )
1270  bFields = true;
1271  }
1272  if ( bFields )
1273  {
1274  bool bOldUpdateMode = rEngine.SetUpdateLayout( true ); // no portions if not formatted
1275  for ( sal_Int32 nPar=0; nPar < nParas; nPar++ )
1276  {
1277  if ( nPar > 0 )
1279  std::vector<sal_Int32> aPortions;
1280  rEngine.GetPortions( nPar, aPortions );
1281  sal_Int32 nStart = 0;
1282  for ( const sal_Int32 nEnd : aPortions )
1283  {
1284  ESelection aSel( nPar, nStart, nPar, nEnd );
1285  bool bUrl = false;
1286  // fields are single characters
1287  if ( nEnd == nStart+1 )
1288  {
1289  SfxItemSet aSet = rEngine.GetAttribs( aSel );
1290  if ( const SvxFieldItem* pFieldItem = aSet.GetItemIfSet( EE_FEATURE_FIELD, false ) )
1291  {
1292  const SvxFieldData* pField = pFieldItem->GetField();
1293  if (const SvxURLField* pURLField = dynamic_cast<const SvxURLField*>(pField))
1294  {
1295  bUrl = true;
1297  OUT_STR( pURLField->GetURL() );
1298  rStrm.WriteCharPtr( "\">" );
1299  OUT_STR( pURLField->GetRepresentation() );
1301  }
1302  }
1303  }
1304  if ( !bUrl )
1305  OUT_STR( rEngine.GetText( aSel ) );
1306  nStart = nEnd;
1307  }
1308  }
1309  rEngine.SetUpdateLayout( bOldUpdateMode );
1310  }
1311  return bFields;
1312 }
1313 
1314 void ScHTMLExport::CopyLocalFileToINet( OUString& rFileNm,
1315  std::u16string_view rTargetNm )
1316 {
1317  INetURLObject aFileUrl, aTargetUrl;
1318  aFileUrl.SetSmartURL( rFileNm );
1319  aTargetUrl.SetSmartURL( rTargetNm );
1320  if( !(INetProtocol::File == aFileUrl.GetProtocol() &&
1321  ( INetProtocol::File != aTargetUrl.GetProtocol() &&
1322  INetProtocol::Ftp <= aTargetUrl.GetProtocol() &&
1323  INetProtocol::Javascript >= aTargetUrl.GetProtocol())) )
1324  return;
1325 
1326  if( pFileNameMap )
1327  {
1328  // Did we already move the file?
1329  std::map<OUString, OUString>::iterator it = pFileNameMap->find( rFileNm );
1330  if( it != pFileNameMap->end() )
1331  {
1332  rFileNm = it->second;
1333  return;
1334  }
1335  }
1336  else
1337  {
1338  pFileNameMap.reset( new std::map<OUString, OUString> );
1339  }
1340 
1341  bool bRet = false;
1342  SvFileStream aTmp( aFileUrl.PathToFileName(), StreamMode::READ );
1343 
1344  OUString aSrc = rFileNm;
1345  OUString aDest = aTargetUrl.GetPartBeforeLastName() + aFileUrl.GetLastName();
1346 
1347  SfxMedium aMedium( aDest, StreamMode::WRITE | StreamMode::SHARE_DENYNONE );
1348 
1349  {
1350  SvFileStream aCpy( aMedium.GetPhysicalName(), StreamMode::WRITE );
1351  aCpy.WriteStream( aTmp );
1352  }
1353 
1354  // Take over
1355  aMedium.Close();
1356  aMedium.Commit();
1357 
1358  bRet = ERRCODE_NONE == aMedium.GetError();
1359 
1360  if( bRet )
1361  {
1362  pFileNameMap->insert( std::make_pair( aSrc, aDest ) );
1363  rFileNm = aDest;
1364  }
1365 }
1366 
1367 void ScHTMLExport::IncIndent( short nVal )
1368 {
1369  sIndent[nIndent] = '\t';
1370  nIndent = nIndent + nVal;
1371  if ( nIndent < 0 )
1372  nIndent = 0;
1373  else if ( nIndent > nIndentMax )
1374  nIndent = nIndentMax;
1375  sIndent[nIndent] = 0;
1376 }
1377 
1378 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const char sBackground[]
Definition: htmlexp.cxx:94
SCTAB nUsedTables
Definition: htmlexp.hxx:119
static const char sIndentSource[]
Definition: htmlexp.hxx:107
static const sal_uInt16 nDefaultFontSize[SC_HTML_FONTSIZES]
Definition: htmlexp.hxx:102
SfxStyleSheetBase * First(SfxStyleFamily eFamily, SfxStyleSearchBits eMask=SfxStyleSearchBits::All)
SCCOL GetColMerge() const
Definition: attrib.hxx:68
OUString GetText(LineEnd eEnd=LINEEND_LF) const
ScHTMLStyle aHTMLStyle
Definition: htmlexp.hxx:113
URL aURL
ScAddress aStart
Definition: address.hxx:497
#define OOO_STRING_SVTOOLS_HTML_O_clear
const short nIndentMax
Definition: htmlexp.hxx:97
virtual ~ScHTMLExport() override
Definition: htmlexp.cxx:246
#define OOO_STRING_SVTOOLS_HTML_VA_bottom
sal_uInt8 GetAlpha() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
sal_uInt8 GetRed() const
FileNameMapPtr pFileNameMap
Definition: htmlexp.hxx:117
sal_uInt16 nFontSizeNumber
Definition: htmlexp.hxx:53
OUString ScResId(TranslateId aId)
Definition: scdll.cxx:90
FormulaCommand pE
constexpr TypedWhichId< SvxBoxItem > ATTR_BORDER(150)
#define TAG_OFF(tag)
Definition: htmlexp.cxx:116
SCROW Row() const
Definition: address.hxx:274
void setWidth(tools::Long nWidth)
#define OOO_STRING_SVTOOLS_HTML_O_rowspan
#define OOO_STRING_SVTOOLS_HTML_AL_center
bool IsTransparent() const
#define OUT_SP_CSTR_ASS(s)
Definition: htmlexp.cxx:126
bool isEmpty() const
Definition: cellvalue.cxx:670
GPOS_NONE
void WriteGraphEntry(ScHTMLGraphEntry *)
Definition: htmlexp2.cxx:112
const sal_uInt32 SC_HTML_FONTSIZES
Definition: htmlpars.hxx:34
bool SetSmartURL(std::u16string_view rTheAbsURIRef, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
#define OOO_STRING_SVTOOLS_HTML_O_bgcolor
SvStream & rStrm
Definition: expbase.hxx:33
#define OOO_STRING_SVTOOLS_HTML_tableheader
static void lcl_AddStamp(OUString &rStr, std::u16string_view rName, const css::util::DateTime &rDateTime, const LocaleDataWrapper &rLoc)
Definition: htmlexp.cxx:157
static OString lcl_getColGroupString(sal_Int32 nSpan, sal_Int32 nWidth)
Definition: htmlexp.cxx:139
constexpr TypedWhichId< SvxCrossedOutItem > ATTR_FONT_CROSSEDOUT(106)
void WriteBody()
Definition: htmlexp.cxx:602
long Long
bool IsOverlapped() const
Definition: attrib.hxx:101
#define OOO_STRING_SVTOOLS_HTML_tfoot
#define OOO_STRING_SVTOOLS_HTML_emphasis
constexpr::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
void IncIndent(short nVal)
Definition: htmlexp.cxx:1367
#define OOO_STRING_SVTOOLS_HTML_tablerow
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
SC_DLLPUBLIC bool InitColumnBlockPosition(sc::ColumnBlockPosition &rBlockPos, SCTAB nTab, SCCOL nCol)
Definition: document.cxx:2654
#define OUT_COMMENT(comment)
Definition: htmlexp.cxx:122
css::uno::Reference< css::frame::XModel3 > GetModel() const
bool mbSkipImages
Definition: htmlexp.hxx:128
#define OOO_STRING_SVTOOLS_HTML_head1
SvNumberFormatter * pFormatter
Definition: expbase.hxx:36
bool Commit()
Store position data for column array storage.
bool bCalcAsShown
Definition: htmlexp.hxx:125
bool IsClipOrUndo() const
Definition: document.hxx:1587
#define OOO_STRING_SVTOOLS_HTML_body
sal_uInt16 ToPixel(sal_uInt16 nTwips)
Definition: htmlexp.cxx:271
SC_DLLPUBLIC SCROW FirstVisibleRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab) const
Definition: document.cxx:4525
ScAddress aEnd
Definition: address.hxx:498
OUString GetLastName(DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
constexpr TypedWhichId< SvxFontItem > ATTR_FONT(100)
virtual SfxItemSet & GetItemSet()
This is very similar to ScCellValue, except that it references the original value instead of copying ...
Definition: cellvalue.hxx:103
#define OOO_STRING_SVTOOLS_HTML_O_background
const editeng::SvxBorderLine * GetRight() const
#define OOO_STRING_SVTOOLS_HTML_italic
#define OOO_STRING_SVTOOLS_HTML_doctype5
SVL_DLLPUBLIC OUString simpleNormalizedMakeRelative(OUString const &baseUriReference, OUString const &uriReference)
#define OOO_STRING_SVTOOLS_HTML_thead
SvStream & WriteCharPtr(const char *pBuf)
ErrCode GetError() const
#define HTMLFONTSZ1_DFLT
SfxItemSet GetAttribs(sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, GetAttribsFlags nFlags=GetAttribsFlags::ALL) const
static SVT_DLLPUBLIC SvStream & Out_Color(SvStream &, const Color &, bool bXHTML=false)
constexpr TypedWhichId< ScMergeAttr > ATTR_MERGE(144)
FontItalic GetPosture() const
SC_DLLPUBLIC sal_uInt16 GetRowHeight(SCROW nRow, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: document.cxx:4211
Color aBackgroundColor
Definition: htmlexp.hxx:50
#define HTMLFONTSZ5_DFLT
#define OOO_STRING_SVTOOLS_HTML_tbody
OUString PathToFileName() const
WEIGHT_BOLD
constexpr tools::Long Width() const
SvtScriptType
void Close(bool bInDestruction=false)
#define OOO_STRING_SVTOOLS_HTML_tabledata
static SC_DLLPUBLIC const LocaleDataWrapper & getLocaleData()
Definition: global.cxx:1015
bool bTabAlignedLeft
Definition: htmlexp.hxx:124
SC_DLLPUBLIC ScPostIt * GetNote(const ScAddress &rPos)
Definition: document.cxx:6716
#define OOO_STRING_SVTOOLS_HTML_O_size
SvtScriptType nDefaultScriptType
Definition: htmlexp.hxx:54
#define OOO_STRING_SVTOOLS_HTML_O_height
sal_uInt32 nFontHeight
Definition: htmlexp.hxx:52
constexpr TypedWhichId< SvxFieldItem > EE_FEATURE_FIELD(EE_FEATURE_NOTCONV+1)
const EditTextObject * mpEditText
Definition: cellvalue.hxx:109
LINESTYLE_NONE
void SetText(const OUString &rStr)
#define OOO_STRING_SVTOOLS_HTML_O_href
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:315
Additional class containing cell annotation data.
Definition: postit.hxx:160
double GetValue()
static const char * GetFontSizeCss(sal_uInt16 nHeight)
Definition: htmlexp.cxx:265
int nCount
static SC_DLLPUBLIC sal_uInt16 GetScriptedWhichID(SvtScriptType nScriptType, sal_uInt16 nWhich)
Map ATTR_((CJK|CTL)_)?FONT_...
Definition: global.cxx:875
#define OOO_STRING_SVTOOLS_HTML_O_colspan
#define OOO_STRING_SVTOOLS_HTML_AL_justify
const char sMyEndComment[]
Definition: htmlexp.cxx:91
const OUString & GetPhysicalName() const
#define GLOBSTR(id)
Definition: htmlexp.cxx:128
static ErrCode WriteGraphic(const Graphic &rGraphic, OUString &rFileName, const OUString &rFilterName, const XOutFlags nFlags, const Size *pMtfSize_100TH_MM=nullptr, const css::uno::Sequence< css::beans::PropertyValue > *pFilterData=nullptr)
ScFormulaCell * mpFormula
Definition: cellvalue.hxx:110
SCTAB Tab() const
Definition: address.hxx:283
#define OUT_STR(str)
Definition: htmlexp.cxx:117
#define OOO_STRING_SVTOOLS_HTML_VA_top
static OUString GetString(const ScRefCellValue &rCell, sal_uInt32 nFormat, const Color **ppColor, SvNumberFormatter &rFormatter, const ScDocument &rDoc, bool bNullVals=true, bool bFormula=false, bool bUseStarFormat=false)
Definition: cellform.cxx:31
void WriteHeader()
Definition: htmlexp.cxx:310
static SVT_DLLPUBLIC OString CreateTableDataOptionsValNum(bool bValue, double fVal, sal_uInt32 nFormat, SvNumberFormatter &rFormatter, OUString *pNonConvertableChars=nullptr)
STRIKEOUT_SINGLE
sal_uInt8 GetBlue() const
sal_Int32 GetTextLen() const
SC_DLLPUBLIC const ScPatternAttr * GetPattern(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: document.cxx:4799
SC_DLLPUBLIC const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) const
Definition: document.cxx:4764
static SVT_DLLPUBLIC OString ConvertStringToHTML(const OUString &sSrc, OUString *pNonConvertableChars=nullptr)
#define OOO_STRING_SVTOOLS_HTML_bold
constexpr TypedWhichId< SvxUnderlineItem > ATTR_FONT_UNDERLINE(104)
const SfxPoolItem & GetItem(sal_uInt16 nWhichP) const
Definition: patattr.hxx:72
#define OOO_STRING_SVTOOLS_HTML_colgroup
const Color & GetColor() const
#define OUT_HR()
Definition: htmlexp.cxx:121
#define OOO_STRING_SVTOOLS_HTML_O_class
#define OOO_STRING_SVTOOLS_HTML_font
GraphEntryList aGraphList
Definition: htmlexp.hxx:112
bool mbSkipHeaderFooter
If HTML header and footer should be written as well, or just the content itself.
Definition: htmlexp.hxx:130
bool bTabHasGraphics
Definition: htmlexp.hxx:123
#define OOO_STRING_SVTOOLS_HTML_doctype
SC_DLLPUBLIC ScDrawLayer * GetDrawLayer()
Definition: document.hxx:1081
const editeng::SvxBorderLine * GetTop() const
constexpr TypedWhichId< SvxPostureItem > ATTR_FONT_POSTURE(103)
#define OOO_STRING_SVTOOLS_HTML_html
SC_DLLPUBLIC bool ColHidden(SCCOL nCol, SCTAB nTab, SCCOL *pFirstCol=nullptr, SCCOL *pLastCol=nullptr) const
Definition: document.cxx:4495
Size MMToPixel(const Size &r100thMMSize)
Definition: htmlexp.cxx:283
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const editeng::SvxBorderLine * GetLeft() const
int i
OUString aFontFamilyName
Definition: htmlexp.hxx:51
#define OOO_STRING_SVTOOLS_HTML_O_border
FontWeight GetWeight() const
SVL_DLLPUBLIC Link< OUString *, bool > const & GetMaybeFileHdl()
sal_Int16 SCCOL
Definition: types.hxx:21
#define OOO_STRING_SVTOOLS_HTML_table
constexpr TypedWhichId< SvxVerJustifyItem > ATTR_VER_JUSTIFY(132)
#define OOO_STRING_SVTOOLS_HTML_comment2
bool IsEmptyTable(SCTAB nTab) const
Definition: expbase.cxx:59
#define HTMLFONTSZ7_DFLT
#define OOO_STRING_SVTOOLS_HTML_AL_left
ScDocument * pDoc
Definition: expbase.hxx:35
float u
bool WriteFieldText(const EditTextObject *pData)
Definition: htmlexp.cxx:1257
SC_DLLPUBLIC OUString GetPageStyle(SCTAB nTab) const
Definition: document.cxx:6288
#define OOO_STRING_SVTOOLS_HTML_style
sal_uInt32 GetNumberFormat(SvNumberFormatter *) const
Definition: patattr.cxx:1301
#define TAG_ON_LF(tag)
Definition: htmlexp.cxx:119
sal_uInt16 GetFontSize(sal_uInt16 nPos)
#define TAG_ON(tag)
Definition: htmlexp.cxx:115
static void Out_DocInfo(SvStream &rStrm, const OUString &rBaseURL, const css::uno::Reference< css::document::XDocumentProperties > &, const char *pIndent, OUString *pNonConvertableChars=nullptr)
bool hasNumeric() const
Definition: cellvalue.cxx:622
ITALIC_NONE
#define OOO_STRING_SVTOOLS_HTML_VA_middle
OUString aNonConvertibleChars
Definition: htmlexp.hxx:118
SC_DLLPUBLIC const SfxItemSet * GetCondResult(SCCOL nCol, SCROW nRow, SCTAB nTab, ScRefCellValue *pCell=nullptr) const
Definition: documen4.cxx:805
SvStream & WriteStream(SvStream &rStream)
SC_DLLPUBLIC bool HasNote(const ScAddress &rPos) const
Definition: document.cxx:6741
#define OOO_STRING_SVTOOLS_HTML_underline
SCCOL Col() const
Definition: address.hxx:279
sal_Int32 GetParagraphCount() const
bool SetUpdateLayout(bool bUpdate, bool bRestoring=false)
virtual void ScExportHTML(SvStream &, const OUString &rBaseURL, ScDocument *, const ScRange &rRange, const rtl_TextEncoding eDest, bool bAll, const OUString &rStreamPath, OUString &rNonConvertibleChars, const OUString &rFilterOptions) override
Definition: htmlexp.cxx:130
bool bTableDataHeight
Definition: htmlexp.hxx:127
#define HTMLFONTSZ6_DFLT
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
bool IsMerged() const
Definition: attrib.hxx:71
constexpr TypedWhichId< SvxBrushItem > ATTR_BACKGROUND(148)
SC_DLLPUBLIC double RoundValueAsShown(double fVal, sal_uInt32 nFormat, const ScInterpreterContext *pContext=nullptr) const
Definition: documen4.cxx:641
bool GetDataArea(SCTAB nTab, SCCOL &nStartCol, SCROW &nStartRow, SCCOL &nEndCol, SCROW &nEndRow) const
Definition: expbase.cxx:38
FontLineStyle GetLineStyle() const
sal_uInt8 GetGreen() const
CellType meType
Definition: cellvalue.hxx:105
float v
#define OOO_STRING_SVTOOLS_HTML_O_align
OUString getDate(const Date &rDate) const
#define OOO_STRING_SVTOOLS_HTML_division
const OUString & GetFamilyName() const
constexpr TypedWhichId< ScMergeFlagAttr > ATTR_MERGE_FLAG(145)
#define OOO_STRING_SVTOOLS_HTML_linebreak
sal_Int32 SCROW
Definition: types.hxx:17
void CopyLocalFileToINet(OUString &rFileNm, std::u16string_view rTargetNm)
Definition: htmlexp.cxx:1314
static SC_DLLPUBLIC SvtScriptType GetDefaultScriptType()
Definition: global.cxx:860
#define OOO_STRING_SVTOOLS_HTML_strikethrough
#define OUT_LF()
Definition: htmlexp.cxx:118
#define TAG_OFF_LF(tag)
Definition: htmlexp.cxx:120
sal_uInt32 GetHeight() const
SfxItemState
OUString aStreamPath
Definition: htmlexp.hxx:115
#define OOO_STRING_SVTOOLS_HTML_AL_right
ScRange aRange
Definition: htmlexp.hxx:78
static const char * pFontSizeCss[SC_HTML_FONTSIZES]
Definition: htmlexp.hxx:105
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
SvStream & WriteOString(std::string_view rStr)
#define ERRCODE_NONE
constexpr tools::Long Height() const
short nIndent
Definition: htmlexp.hxx:120
OUString GetPartBeforeLastName() const
static sal_uInt16 GetFontSizeNumber(sal_uInt16 nHeight)
Definition: htmlexp.cxx:251
bool bCopyLocalFileToINet
Definition: htmlexp.hxx:126
#define OOO_STRING_SVTOOLS_HTML_center
ScRange aRange
Definition: expbase.hxx:34
const char sBorder[]
Definition: htmlexp.cxx:93
bool bInitialized
Definition: htmlexp.hxx:55
INetProtocol GetProtocol() const
void GetPortions(sal_Int32 nPara, std::vector< sal_Int32 > &rList)
SC_DLLPUBLIC SvtScriptType GetScriptType(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScRefCellValue *pCell=nullptr)
Definition: documen6.cxx:132
constexpr TypedWhichId< SvxWeightItem > ATTR_FONT_WEIGHT(102)
const char sDisplay[]
Definition: htmlexp.cxx:92
constexpr TypedWhichId< SvxHorJustifyItem > ATTR_HOR_JUSTIFY(129)
void WriteCell(sc::ColumnBlockPosition &rBlockPos, SCCOL nCol, SCROW nRow, SCTAB nTab)
Definition: htmlexp.cxx:881
#define OOO_STRING_SVTOOLS_HTML_parabreak
bool Contains(const ScAddress &) const
is Address& fully in Range?
Definition: address.hxx:718
#define HTMLFONTSZ2_DFLT
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_BLACK
const char * pChar
static const sal_uInt16 nCellSpacing
Definition: htmlexp.hxx:106
const OUString & GetNonConvertibleChars() const
Definition: htmlexp.hxx:179
const char sMyBegComment[]
Definition: htmlexp.cxx:90
SvStream & WriteChar(char nChar)
SC_DLLPUBLIC ScStyleSheetPool * GetStyleSheetPool() const
Definition: document.cxx:6161
void Write()
Definition: htmlexp.cxx:294
FontStrikeout GetStrikeout() const
SC_DLLPUBLIC bool HasHiddenRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab) const
Definition: document.cxx:4487
static OString lcl_makeHTMLColorTriplet(const Color &rColor)
Definition: htmlexp.cxx:186
VclPtr< OutputDevice > pAppWin
Definition: htmlexp.hxx:116
SC_DLLPUBLIC bool RowHidden(SCROW nRow, SCTAB nTab, SCROW *pFirstRow=nullptr, SCROW *pLastRow=nullptr) const
Definition: document.cxx:4479
#define OOO_STRING_SVTOOLS_HTML_O_face
OUString aBaseURL
Definition: htmlexp.hxx:114
void setHeight(tools::Long nHeight)
ScHTMLExport(SvStream &, const OUString &, ScDocument *, const ScRange &, bool bAll, const OUString &aStreamPath, std::u16string_view rFilterOptions)
Definition: htmlexp.cxx:196
#define OOO_STRING_SVTOOLS_HTML_O_type
bool TrimDataArea(SCTAB nTab, SCCOL &nStartCol, SCROW &nStartRow, SCCOL &nEndCol, SCROW &nEndRow) const
Definition: expbase.cxx:46
#define OOO_STRING_SVTOOLS_HTML_O_color
void WriteOverview()
Definition: htmlexp.cxx:453
void GetURLResult(OUString &rURL, OUString &rCellText)
SC_DLLPUBLIC bool IsVisible(SCTAB nTab) const
Definition: document.cxx:911
SfxObjectShell * GetDocumentShell() const
Definition: document.hxx:1080
SCROW GetRowMerge() const
Definition: attrib.hxx:69
void WriteTables()
Definition: htmlexp.cxx:681
void PrepareGraphics(ScDrawLayer *, SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow)
Definition: htmlexp2.cxx:40
#define OOO_STRING_SVTOOLS_HTML_head
static OString BorderToStyle(const char *pBorderName, const editeng::SvxBorderLine *pLine, bool &bInsertSemicolon)
Definition: htmlexp.cxx:531
char sIndent[nIndentMax+1]
Definition: htmlexp.hxx:121
OUString getTime(const tools::Time &rTime, bool bSec=true, bool b100Sec=false) const
bool IsHyperLinkCell() const
SC_DLLPUBLIC sal_uInt16 GetColWidth(SCCOL nCol, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: document.cxx:4170
const SfxItemSet & PageDefaults(SCTAB nTab)
Definition: htmlexp.cxx:486
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
constexpr TypedWhichId< SvxColorItem > ATTR_FONT_COLOR(109)
constexpr TypedWhichId< SvxFontHeightItem > ATTR_FONT_HEIGHT(101)
aStr
const editeng::SvxBorderLine * GetBottom() const
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
Definition: document.cxx:215
#define HTMLFONTSZ4_DFLT
#define OOO_STRING_SVTOOLS_HTML_anchor
#define OOO_STRING_SVTOOLS_HTML_O_valign
#define OOO_STRING_SVTOOLS_HTML_O_width
SC_DLLPUBLIC ScFieldEditEngine & GetEditEngine()
Definition: documen2.cxx:475
#define SAL_NEWLINE_STRING
static sal_uInt16 nFontSize[SC_HTML_FONTSIZES]
Definition: htmlexp.hxx:104
const Color & GetValue() const
sal_uInt16 nPos
sal_Int16 SCTAB
Definition: types.hxx:22
#define OOO_STRING_SVTOOLS_HTML_O_span
bool m_bDetectedRangeSegmentation false
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)
#define HTMLFONTSZ3_DFLT
#define OOO_STRING_SVTOOLS_HTML_O_cellspacing