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 
86 using ::editeng::SvxBorderLine;
87 using namespace ::com::sun::star;
88 
89 const char sMyBegComment[] = "<!-- ";
90 const char sMyEndComment[] = " -->";
91 const char sDisplay[] = "display:";
92 const char sBorder[] = "border:";
93 const char sBackground[] = "background:";
94 
96 {
99 };
100 
101 sal_uInt16 ScHTMLExport::nFontSize[SC_HTML_FONTSIZES] = { 0 };
102 
104 {
105  "xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large"
106 };
107 
108 const sal_uInt16 ScHTMLExport::nCellSpacing = 0;
110  "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
111 
112 // Macros for HTML export
113 
114 #define TAG_ON( tag ) HTMLOutFuncs::Out_AsciiTag( rStrm, tag )
115 #define TAG_OFF( tag ) HTMLOutFuncs::Out_AsciiTag( rStrm, tag, false )
116 #define OUT_STR( str ) HTMLOutFuncs::Out_String( rStrm, str, eDestEnc, &aNonConvertibleChars )
117 #define OUT_LF() rStrm.WriteCharPtr( SAL_NEWLINE_STRING ).WriteCharPtr( GetIndentStr() )
118 #define TAG_ON_LF( tag ) (TAG_ON( tag ).WriteCharPtr( SAL_NEWLINE_STRING ).WriteCharPtr( GetIndentStr() ))
119 #define TAG_OFF_LF( tag ) (TAG_OFF( tag ).WriteCharPtr( SAL_NEWLINE_STRING ).WriteCharPtr( GetIndentStr() ))
120 #define OUT_HR() TAG_ON_LF( OOO_STRING_SVTOOLS_HTML_horzrule )
121 #define OUT_COMMENT( comment ) (rStrm.WriteCharPtr( sMyBegComment ), OUT_STR( comment ) \
122  .WriteCharPtr( sMyEndComment ).WriteCharPtr( SAL_NEWLINE_STRING ) \
123  .WriteCharPtr( GetIndentStr() ))
124 
125 #define OUT_SP_CSTR_ASS( s ) rStrm.WriteChar( ' ').WriteCharPtr( s ).WriteChar( '=' )
126 
127 #define GLOBSTR(id) ScResId( id )
128 
129 void ScFormatFilterPluginImpl::ScExportHTML( SvStream& rStrm, const OUString& rBaseURL, ScDocument* pDoc,
130  const ScRange& rRange, const rtl_TextEncoding /*eNach*/, bool bAll,
131  const OUString& rStreamPath, OUString& rNonConvertibleChars, const OUString& rFilterOptions )
132 {
133  ScHTMLExport aEx( rStrm, rBaseURL, pDoc, rRange, bAll, rStreamPath, rFilterOptions );
134  aEx.Write();
135  rNonConvertibleChars = aEx.GetNonConvertibleChars();
136 }
137 
138 static OString lcl_getColGroupString(sal_Int32 nSpan, sal_Int32 nWidth)
139 {
140  OStringBuffer aByteStr(OOO_STRING_SVTOOLS_HTML_colgroup);
141  aByteStr.append(' ');
142  if( nSpan > 1 )
143  {
144  aByteStr.append(OOO_STRING_SVTOOLS_HTML_O_span);
145  aByteStr.append("=\"");
146  aByteStr.append(nSpan);
147  aByteStr.append("\" ");
148  }
149  aByteStr.append(OOO_STRING_SVTOOLS_HTML_O_width);
150  aByteStr.append("=\"");
151  aByteStr.append(nWidth);
152  aByteStr.append('"');
153  return aByteStr.makeStringAndClear();
154 }
155 
156 static void lcl_AddStamp( OUString& rStr, std::u16string_view rName,
157  const css::util::DateTime& rDateTime,
158  const LocaleDataWrapper& rLoc )
159 {
160  Date aD(rDateTime.Day, rDateTime.Month, rDateTime.Year);
161  tools::Time aT(rDateTime.Hours, rDateTime.Minutes, rDateTime.Seconds,
162  rDateTime.NanoSeconds);
163  DateTime aDateTime(aD,aT);
164 
165  OUString aStrDate = rLoc.getDate( aDateTime );
166  OUString aStrTime = rLoc.getTime( aDateTime );
167 
168  rStr += GLOBSTR( STR_BY ) + " ";
169  if (!rName.empty())
170  rStr += rName;
171  else
172  rStr += "???";
173  rStr += " " + GLOBSTR( STR_ON ) + " ";
174  if (!aStrDate.isEmpty())
175  rStr += aStrDate;
176  else
177  rStr += "???";
178  rStr += ", ";
179  if (!aStrTime.isEmpty())
180  rStr += aStrTime;
181  else
182  rStr += "???";
183 }
184 
185 static OString lcl_makeHTMLColorTriplet(const Color& rColor)
186 {
187  char buf[24];
188 
189  // <font COLOR="#00FF40">hello</font>
190  snprintf( buf, 24, "\"#%02X%02X%02X\"", rColor.GetRed(), rColor.GetGreen(), rColor.GetBlue() );
191 
192  return buf;
193 }
194 
195 ScHTMLExport::ScHTMLExport( SvStream& rStrmP, const OUString& rBaseURL, ScDocument* pDocP,
196  const ScRange& rRangeP, bool bAllP,
197  const OUString& rStreamPathP, std::u16string_view rFilterOptions ) :
198  ScExportBase( rStrmP, pDocP, rRangeP ),
199  aBaseURL( rBaseURL ),
200  aStreamPath( rStreamPathP ),
201  pAppWin( Application::GetDefaultDevice() ),
202  nUsedTables( 0 ),
203  nIndent( 0 ),
204  bAll( bAllP ),
205  bTabHasGraphics( false ),
206  bTabAlignedLeft( false ),
207  bCalcAsShown( pDocP->GetDocOptions().IsCalcAsShown() ),
208  bTableDataHeight( true ),
209  mbSkipImages ( false ),
210  mbSkipHeaderFooter( false )
211 {
212  strcpy( sIndent, sIndentSource );
213  sIndent[0] = 0;
214 
215  // set HTML configuration
216  SvxHtmlOptions& rHtmlOptions = SvxHtmlOptions::Get();
217  eDestEnc = (pDoc->IsClipOrUndo() ? RTL_TEXTENCODING_UTF8 : rHtmlOptions.GetTextEncoding());
218  bCopyLocalFileToINet = rHtmlOptions.IsSaveGraphicsLocal();
219 
220  if (rFilterOptions == u"SkipImages")
221  {
222  mbSkipImages = true;
223  }
224  else if (rFilterOptions == u"SkipHeaderFooter")
225  {
226  mbSkipHeaderFooter = true;
227  }
228 
229  for ( sal_uInt16 j=0; j < SC_HTML_FONTSIZES; j++ )
230  {
231  sal_uInt16 nSize = rHtmlOptions.GetFontSize( j );
232  // remember in Twips, like our SvxFontHeightItem
233  if ( nSize )
234  nFontSize[j] = nSize * 20;
235  else
236  nFontSize[j] = nDefaultFontSize[j] * 20;
237  }
238 
239  const SCTAB nCount = pDoc->GetTableCount();
240  for ( SCTAB nTab = 0; nTab < nCount; nTab++ )
241  {
242  if ( !IsEmptyTable( nTab ) )
243  nUsedTables++;
244  }
245 }
246 
248 {
249  aGraphList.clear();
250 }
251 
252 sal_uInt16 ScHTMLExport::GetFontSizeNumber( sal_uInt16 nHeight )
253 {
254  sal_uInt16 nSize = 1;
255  for ( sal_uInt16 j=SC_HTML_FONTSIZES-1; j>0; j-- )
256  {
257  if( nHeight > (nFontSize[j] + nFontSize[j-1]) / 2 )
258  { // The one next to it
259  nSize = j+1;
260  break;
261  }
262  }
263  return nSize;
264 }
265 
266 const char* ScHTMLExport::GetFontSizeCss( sal_uInt16 nHeight )
267 {
268  sal_uInt16 nSize = GetFontSizeNumber( nHeight );
269  return pFontSizeCss[ nSize-1 ];
270 }
271 
272 sal_uInt16 ScHTMLExport::ToPixel( sal_uInt16 nVal )
273 {
274  if( nVal )
275  {
276  nVal = static_cast<sal_uInt16>(pAppWin->LogicToPixel(
277  Size( nVal, nVal ), MapMode( MapUnit::MapTwip ) ).Width());
278  if( !nVal ) // If there's a Twip there should also be a Pixel
279  nVal = 1;
280  }
281  return nVal;
282 }
283 
285 {
286  Size aSize = pAppWin->LogicToPixel( rSize, MapMode( MapUnit::Map100thMM ) );
287  // If there's something there should also be a Pixel
288  if ( !aSize.Width() && rSize.Width() )
289  aSize.setWidth( 1 );
290  if ( !aSize.Height() && rSize.Height() )
291  aSize.setHeight( 1 );
292  return aSize;
293 }
294 
296 {
297  if (!mbSkipHeaderFooter)
298  {
302  WriteHeader();
303  OUT_LF();
304  }
305  WriteBody();
306  OUT_LF();
307  if (!mbSkipHeaderFooter)
309 }
310 
312 {
314 
315  if ( pDoc->IsClipOrUndo() )
316  { // no real DocInfo available, but some META information like charset needed
318  }
319  else
320  {
321  uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
322  pDoc->GetDocumentShell()->GetModel(), uno::UNO_QUERY_THROW);
323  uno::Reference<document::XDocumentProperties> xDocProps
324  = xDPS->getDocumentProperties();
327  OUT_LF();
328 
329  if (!xDocProps->getPrintedBy().isEmpty())
330  {
331  OUT_COMMENT( GLOBSTR( STR_DOC_INFO ) );
332  OUString aStrOut = GLOBSTR( STR_DOC_PRINTED ) + ": ";
333  lcl_AddStamp( aStrOut, xDocProps->getPrintedBy(),
334  xDocProps->getPrintDate(), *ScGlobal::getLocaleDataPtr() );
335  OUT_COMMENT( aStrOut );
336  }
337 
338  }
339  OUT_LF();
340 
341  // CSS1 StyleSheet
342  PageDefaults( bAll ? 0 : aRange.aStart.Tab() );
343  IncIndent(1);
345 
346  OUT_LF();
351  .WriteCharPtr( " { " ).WriteCharPtr( "font-family:" );
352  if (!aHTMLStyle.aFontFamilyName.isEmpty())
353  {
354  const OUString& rList = aHTMLStyle.aFontFamilyName;
355  for(sal_Int32 nPos {0};;)
356  {
357  rStrm.WriteChar( '\"' );
358  OUT_STR( rList.getToken( 0, ';', nPos ) );
359  rStrm.WriteChar( '\"' );
360  if (nPos<0)
361  break;
362  rStrm.WriteCharPtr( ", " );
363  }
364  }
365  rStrm.WriteCharPtr( "; " ).WriteCharPtr( "font-size:" )
366  .WriteCharPtr( GetFontSizeCss( static_cast<sal_uInt16>(aHTMLStyle.nFontHeight) ) ).WriteCharPtr( " }" );
367 
368  OUT_LF();
369 
370  // write the style for the comments to make them stand out from normal cell content
371  // this is done through only showing the cell contents when the custom indicator is hovered
372  rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_HTML_anchor ).WriteCharPtr(".comment-indicator:hover")
375  .WriteCharPtr("position:").WriteCharPtr("absolute").WriteCharPtr("; ")
377  .WriteCharPtr(sBorder).WriteCharPtr("1px solid black").WriteCharPtr("; ")
378  .WriteCharPtr("padding:").WriteCharPtr("0.5em").WriteCharPtr("; ")
379  .WriteCharPtr(" } ");
380 
381  OUT_LF();
382 
384  .WriteCharPtr(" { ")
386  .WriteCharPtr(sDisplay).WriteCharPtr("inline-block").WriteCharPtr("; ")
387  .WriteCharPtr(sBorder).WriteCharPtr("1px solid black").WriteCharPtr("; ")
388  .WriteCharPtr("width:").WriteCharPtr("0.5em").WriteCharPtr("; ")
389  .WriteCharPtr("height:").WriteCharPtr("0.5em").WriteCharPtr("; ")
390  .WriteCharPtr(" } ");
391 
392  OUT_LF();
393 
396  .WriteCharPtr(" } ");
397 
398 
400 
402 }
403 
405 {
406  if ( nUsedTables <= 1 )
407  return;
408 
409  IncIndent(1);
410  OUT_HR();
413  OUT_STR( ScResId( STR_OVERVIEW ) );
415 
416  OUString aStr;
417 
418  const SCTAB nCount = pDoc->GetTableCount();
419  for ( SCTAB nTab = 0; nTab < nCount; nTab++ )
420  {
421  if ( !IsEmptyTable( nTab ) )
422  {
423  pDoc->GetName( nTab, aStr );
424  rStrm.WriteCharPtr( "<A HREF=\"#table" )
425  .WriteOString( OString::number(nTab) )
426  .WriteCharPtr( "\">" );
427  OUT_STR( aStr );
428  rStrm.WriteCharPtr( "</A>" );
430  }
431  }
432 
433  IncIndent(-1); OUT_LF();
435 }
436 
438 {
440  SfxStyleSheetBase* pStyleSheet = nullptr;
441  OSL_ENSURE( pStylePool, "StylePool not found! :-(" );
442 
443  // remember defaults for compare in WriteCell
444  if ( !aHTMLStyle.bInitialized )
445  {
446  pStyleSheet = pStylePool->Find(
447  ScResId(STR_STYLENAME_STANDARD),
448  SfxStyleFamily::Para );
449  OSL_ENSURE( pStyleSheet, "ParaStyle not found! :-(" );
450  if (!pStyleSheet)
451  pStyleSheet = pStylePool->First(SfxStyleFamily::Para);
452  const SfxItemSet& rSetPara = pStyleSheet->GetItemSet();
453 
455  aHTMLStyle.aFontFamilyName = static_cast<const SvxFontItem&>((rSetPara.Get(
458  )))).GetFamilyName();
459  aHTMLStyle.nFontHeight = static_cast<const SvxFontHeightItem&>((rSetPara.Get(
462  )))).GetHeight();
463  aHTMLStyle.nFontSizeNumber = GetFontSizeNumber( static_cast< sal_uInt16 >( aHTMLStyle.nFontHeight ) );
464  }
465 
466  // Page style sheet printer settings, e.g. for background graphics.
467  // There's only one background graphic in HTML!
468  pStyleSheet = pStylePool->Find( pDoc->GetPageStyle( nTab ), SfxStyleFamily::Page );
469  OSL_ENSURE( pStyleSheet, "PageStyle not found! :-(" );
470  if (!pStyleSheet)
471  pStyleSheet = pStylePool->First(SfxStyleFamily::Page);
472  const SfxItemSet& rSet = pStyleSheet->GetItemSet();
473  if ( !aHTMLStyle.bInitialized )
474  {
475  const SvxBrushItem* pBrushItem = &rSet.Get( ATTR_BACKGROUND );
476  aHTMLStyle.aBackgroundColor = pBrushItem->GetColor();
477  aHTMLStyle.bInitialized = true;
478  }
479  return rSet;
480 }
481 
482 OString ScHTMLExport::BorderToStyle(const char* pBorderName,
483  const SvxBorderLine* pLine, bool& bInsertSemicolon)
484 {
485  OStringBuffer aOut;
486 
487  if ( pLine )
488  {
489  if ( bInsertSemicolon )
490  aOut.append("; ");
491 
492  // which border
493  aOut.append("border-").append(pBorderName).append(": ");
494 
495  // thickness
496  int nWidth = pLine->GetWidth();
497  int nPxWidth = (nWidth > 0) ?
498  std::max(o3tl::convert(nWidth, o3tl::Length::twip, o3tl::Length::px), sal_Int64(1)) : 0;
499  aOut.append(static_cast<sal_Int32>(nPxWidth)).
500  append("px ");
501  switch (pLine->GetBorderLineStyle())
502  {
503  case SvxBorderLineStyle::SOLID:
504  aOut.append("solid");
505  break;
506  case SvxBorderLineStyle::DOTTED:
507  aOut.append("dotted");
508  break;
509  case SvxBorderLineStyle::DASHED:
510  case SvxBorderLineStyle::DASH_DOT:
511  case SvxBorderLineStyle::DASH_DOT_DOT:
512  aOut.append("dashed");
513  break;
514  case SvxBorderLineStyle::DOUBLE:
515  case SvxBorderLineStyle::DOUBLE_THIN:
516  case SvxBorderLineStyle::THINTHICK_SMALLGAP:
517  case SvxBorderLineStyle::THINTHICK_MEDIUMGAP:
518  case SvxBorderLineStyle::THINTHICK_LARGEGAP:
519  case SvxBorderLineStyle::THICKTHIN_SMALLGAP:
520  case SvxBorderLineStyle::THICKTHIN_MEDIUMGAP:
521  case SvxBorderLineStyle::THICKTHIN_LARGEGAP:
522  aOut.append("double");
523  break;
524  case SvxBorderLineStyle::EMBOSSED:
525  aOut.append("ridge");
526  break;
527  case SvxBorderLineStyle::ENGRAVED:
528  aOut.append("groove");
529  break;
530  case SvxBorderLineStyle::OUTSET:
531  aOut.append("outset");
532  break;
533  case SvxBorderLineStyle::INSET:
534  aOut.append("inset");
535  break;
536  default:
537  aOut.append("hidden");
538  }
539  aOut.append(" #");
540 
541  // color
542  char hex[7];
543  snprintf( hex, 7, "%06" SAL_PRIxUINT32, static_cast<sal_uInt32>( pLine->GetColor().GetRGBColor() ) );
544  hex[6] = 0;
545 
546  aOut.append(hex);
547 
548  bInsertSemicolon = true;
549  }
550 
551  return aOut.makeStringAndClear();
552 }
553 
555 {
556  const SfxItemSet& rSet = PageDefaults( bAll ? 0 : aRange.aStart.Tab() );
557  const SvxBrushItem* pBrushItem = &rSet.Get( ATTR_BACKGROUND );
558 
559  // default text color black
560  if (!mbSkipHeaderFooter)
561  {
563 
564  if (!mbSkipImages)
565  {
566  if ( bAll && GPOS_NONE != pBrushItem->GetGraphicPos() )
567  {
568  OUString aLink = pBrushItem->GetGraphicLink();
569  OUString aGrfNm;
570 
571  // Embedded graphic -> write using WriteGraphic
572  if( aLink.isEmpty() )
573  {
574  const Graphic* pGrf = pBrushItem->GetGraphic();
575  if( pGrf )
576  {
577  // Save graphic as (JPG) file
578  aGrfNm = aStreamPath;
579  ErrCode nErr = XOutBitmap::WriteGraphic( *pGrf, aGrfNm,
580  "JPG", XOutFlags::UseNativeIfPossible );
581  if( !nErr ) // Contains errors, as we have nothing to output
582  {
583  aGrfNm = URIHelper::SmartRel2Abs(
585  aGrfNm, URIHelper::GetMaybeFileHdl());
586  aLink = aGrfNm;
587  }
588  }
589  }
590  else
591  {
592  aGrfNm = aLink;
594  {
595  CopyLocalFileToINet( aGrfNm, aStreamPath );
596  }
597  else
598  aGrfNm = URIHelper::SmartRel2Abs(
600  aGrfNm, URIHelper::GetMaybeFileHdl());
601  aLink = aGrfNm;
602  }
603  if( !aLink.isEmpty() )
604  {
607  aBaseURL,
608  aLink ) ).WriteChar( '\"' );
609  }
610  }
611  }
613  { // A transparent background color should always result in default
614  // background of the browser. Also, HTMLOutFuncs::Out_Color() writes
615  // black #000000 for COL_AUTO which is the same as white #ffffff with
616  // transparency set to 0xff, our default background.
619  }
620 
621  rStrm.WriteChar( '>' ); OUT_LF();
622  }
623 
624  if ( bAll )
625  WriteOverview();
626 
627  WriteTables();
628 
629  if (!mbSkipHeaderFooter)
631 }
632 
634 {
635  const SCTAB nTabCount = pDoc->GetTableCount();
636  const OUString aStrTable( ScResId( SCSTR_TABLE ) );
637  OUString aStr;
638  OUString aStrOut;
639  SCCOL nStartCol;
640  SCROW nStartRow;
641  SCTAB nStartTab;
642  SCCOL nEndCol;
643  SCROW nEndRow;
644  SCTAB nEndTab;
645  SCCOL nStartColFix = 0;
646  SCROW nStartRowFix = 0;
647  SCCOL nEndColFix = 0;
648  SCROW nEndRowFix = 0;
649  ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
650  if ( bAll )
651  {
652  nStartTab = 0;
653  nEndTab = nTabCount - 1;
654  }
655  else
656  {
657  nStartCol = nStartColFix = aRange.aStart.Col();
658  nStartRow = nStartRowFix = aRange.aStart.Row();
659  nStartTab = aRange.aStart.Tab();
660  nEndCol = nEndColFix = aRange.aEnd.Col();
661  nEndRow = nEndRowFix = aRange.aEnd.Row();
662  nEndTab = aRange.aEnd.Tab();
663  }
664  SCTAB nTableStrNum = 1;
665  for ( SCTAB nTab=nStartTab; nTab<=nEndTab; nTab++ )
666  {
667  if ( !pDoc->IsVisible( nTab ) )
668  continue; // for
669 
670  if ( bAll )
671  {
672  if ( !GetDataArea( nTab, nStartCol, nStartRow, nEndCol, nEndRow ) )
673  continue; // for
674 
675  if ( nUsedTables > 1 )
676  {
677  aStrOut = aStrTable + " " + OUString::number( nTableStrNum++ ) + ": ";
678 
679  OUT_HR();
680 
681  // Write anchor
682  rStrm.WriteCharPtr( "<A NAME=\"table" )
683  .WriteOString( OString::number(nTab) )
684  .WriteCharPtr( "\">" );
686  OUT_STR( aStrOut );
688 
689  pDoc->GetName( nTab, aStr );
690  OUT_STR( aStr );
691 
694  rStrm.WriteCharPtr( "</A>" ); OUT_LF();
695  }
696  }
697  else
698  {
699  nStartCol = nStartColFix;
700  nStartRow = nStartRowFix;
701  nEndCol = nEndColFix;
702  nEndRow = nEndRowFix;
703  if ( !TrimDataArea( nTab, nStartCol, nStartRow, nEndCol, nEndRow ) )
704  continue; // for
705  }
706 
707  // <TABLE ...>
708  OStringBuffer aByteStrOut(OOO_STRING_SVTOOLS_HTML_table);
709 
711  if ( bAll && pDrawLayer )
712  PrepareGraphics( pDrawLayer, nTab, nStartCol, nStartRow,
713  nEndCol, nEndRow );
714 
715  // more <TABLE ...>
716  if ( bTabAlignedLeft )
717  {
718  aByteStrOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_align).
719  append("=\"").
720  append(OOO_STRING_SVTOOLS_HTML_AL_left).append('"');
721  }
722  // ALIGN=LEFT allow text and graphics to flow around
723  // CELLSPACING
724  aByteStrOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_cellspacing).
725  append("=\"").
726  append(static_cast<sal_Int32>(nCellSpacing)).append('"');
727 
728  // BORDER=0, we do the styling of the cells in <TD>
729  aByteStrOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_border).
730  append("=\"0\"");
731  IncIndent(1); TAG_ON_LF( aByteStrOut.makeStringAndClear().getStr() );
732 
733  // --- <COLGROUP> ----
734  {
735  SCCOL nCol = nStartCol;
736  sal_Int32 nWidth = 0;
737  sal_Int32 nSpan = 0;
738  while( nCol <= nEndCol )
739  {
740  if( pDoc->ColHidden(nCol, nTab) )
741  {
742  ++nCol;
743  continue;
744  }
745 
746  if( nWidth != ToPixel( pDoc->GetColWidth( nCol, nTab ) ) )
747  {
748  if( nSpan != 0 )
749  {
750  TAG_ON(lcl_getColGroupString(nSpan, nWidth).getStr());
752  }
753  nWidth = ToPixel( pDoc->GetColWidth( nCol, nTab ) );
754  nSpan = 1;
755  }
756  else
757  nSpan++;
758  nCol++;
759  }
760  if( nSpan )
761  {
762  TAG_ON(lcl_getColGroupString(nSpan, nWidth).getStr());
764  }
765  }
766 
767  // <TBODY> // Re-enable only when THEAD and TFOOT are exported
768  // IncIndent(1); TAG_ON_LF( OOO_STRING_SVTOOLS_HTML_tbody );
769  // At least old (3.x, 4.x?) Netscape doesn't follow <TABLE COLS=n> and
770  // <COL WIDTH=x> specified, but needs a width at every column.
771  bool bHasHiddenRows = pDoc->HasHiddenRows(nStartRow, nEndRow, nTab);
772  // We need to cache sc::ColumnBlockPosition per each column.
773  std::vector< sc::ColumnBlockPosition > blockPos( nEndCol - nStartCol + 1 );
774  for( SCCOL i = nStartCol; i <= nEndCol; ++i )
775  pDoc->InitColumnBlockPosition( blockPos[ i - nStartCol ], nTab, i );
776  for ( SCROW nRow=nStartRow; nRow<=nEndRow; nRow++ )
777  {
778  if ( bHasHiddenRows && pDoc->RowHidden(nRow, nTab) )
779  {
780  nRow = pDoc->FirstVisibleRow(nRow+1, nEndRow, nTab);
781  --nRow;
782  continue; // for
783  }
784 
786  bTableDataHeight = true; // height at every first cell of each row
787  for ( SCCOL nCol2=nStartCol; nCol2<=nEndCol; nCol2++ )
788  {
789  if ( pDoc->ColHidden(nCol2, nTab) )
790  continue; // for
791 
792  if ( nCol2 == nEndCol )
793  IncIndent(-1);
794  WriteCell( blockPos[ nCol2 - nStartCol ], nCol2, nRow, nTab );
795  bTableDataHeight = false;
796  }
797 
798  if ( nRow == nEndRow )
799  IncIndent(-1);
801  }
802  // TODO: Uncomment later
803  // IncIndent(-1); TAG_OFF_LF( OOO_STRING_SVTOOLS_HTML_tbody );
804 
806 
807  if ( bTabHasGraphics && !mbSkipImages )
808  {
809  // the rest that is not in a cell
810  size_t ListSize = aGraphList.size();
811  for ( size_t i = 0; i < ListSize; ++i )
812  {
814  if ( !pE->bWritten )
815  WriteGraphEntry( pE );
816  }
817  aGraphList.clear();
818  if ( bTabAlignedLeft )
819  {
820  // clear <TABLE ALIGN=LEFT> with <BR CLEAR=LEFT>
821  aByteStrOut.append(OOO_STRING_SVTOOLS_HTML_linebreak);
822  aByteStrOut.append(' ').
823  append(OOO_STRING_SVTOOLS_HTML_O_clear).append('=').
825  TAG_ON_LF( aByteStrOut.makeStringAndClear().getStr() );
826  }
827  }
828 
829  if ( bAll )
830  OUT_COMMENT( "**************************************************************************" );
831  }
832 }
833 
835 {
836  ScAddress aPos( nCol, nRow, nTab );
837  ScRefCellValue aCell(*pDoc, aPos, rBlockPos);
838  const ScPatternAttr* pAttr = pDoc->GetPattern( nCol, nRow, nTab );
839  const SfxItemSet* pCondItemSet = pDoc->GetCondResult( nCol, nRow, nTab, &aCell );
840 
841  const ScMergeFlagAttr& rMergeFlagAttr = pAttr->GetItem( ATTR_MERGE_FLAG, pCondItemSet );
842  if ( rMergeFlagAttr.IsOverlapped() )
843  return ;
844 
845  ScHTMLGraphEntry* pGraphEntry = nullptr;
846  if ( bTabHasGraphics && !mbSkipImages )
847  {
848  size_t ListSize = aGraphList.size();
849  for ( size_t i = 0; i < ListSize; ++i )
850  {
852  if ( pE->bInCell && pE->aRange.In( aPos ) )
853  {
854  if ( pE->aRange.aStart == aPos )
855  {
856  pGraphEntry = pE;
857  break; // for
858  }
859  else
860  return ; // Is a Col/RowSpan, Overlapped
861  }
862  }
863  }
864 
865  sal_uInt32 nFormat = pAttr->GetNumberFormat( pFormatter );
866  bool bValueData = aCell.hasNumeric();
867  SvtScriptType nScriptType = SvtScriptType::NONE;
868  if (!aCell.isEmpty())
869  nScriptType = pDoc->GetScriptType(nCol, nRow, nTab, &aCell);
870 
871  if ( nScriptType == SvtScriptType::NONE )
872  nScriptType = aHTMLStyle.nDefaultScriptType;
873 
874  OStringBuffer aStrTD(OOO_STRING_SVTOOLS_HTML_tabledata);
875 
876  // border of the cells
877  const SvxBoxItem* pBorder = pDoc->GetAttr( nCol, nRow, nTab, ATTR_BORDER );
878  if ( pBorder && (pBorder->GetTop() || pBorder->GetBottom() || pBorder->GetLeft() || pBorder->GetRight()) )
879  {
880  aStrTD.append(' ').append(OOO_STRING_SVTOOLS_HTML_style).
881  append("=\"");
882 
883  bool bInsertSemicolon = false;
884  aStrTD.append(BorderToStyle("top", pBorder->GetTop(),
885  bInsertSemicolon));
886  aStrTD.append(BorderToStyle("bottom", pBorder->GetBottom(),
887  bInsertSemicolon));
888  aStrTD.append(BorderToStyle("left", pBorder->GetLeft(),
889  bInsertSemicolon));
890  aStrTD.append(BorderToStyle("right", pBorder->GetRight(),
891  bInsertSemicolon));
892 
893  aStrTD.append('"');
894  }
895 
896  const char* pChar;
897  sal_uInt16 nHeightPixel;
898 
899  const ScMergeAttr& rMergeAttr = pAttr->GetItem( ATTR_MERGE, pCondItemSet );
900  if ( pGraphEntry || rMergeAttr.IsMerged() )
901  {
902  SCCOL nC, jC;
903  SCROW nR;
904  sal_uLong v;
905  if ( pGraphEntry )
906  nC = std::max( SCCOL(pGraphEntry->aRange.aEnd.Col() - nCol + 1),
907  rMergeAttr.GetColMerge() );
908  else
909  nC = rMergeAttr.GetColMerge();
910  if ( nC > 1 )
911  {
912  aStrTD.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_colspan).
913  append('=').append(static_cast<sal_Int32>(nC));
914  nC = nC + nCol;
915  for ( jC=nCol, v=0; jC<nC; jC++ )
916  v += pDoc->GetColWidth( jC, nTab );
917  }
918 
919  if ( pGraphEntry )
920  nR = std::max( SCROW(pGraphEntry->aRange.aEnd.Row() - nRow + 1),
921  rMergeAttr.GetRowMerge() );
922  else
923  nR = rMergeAttr.GetRowMerge();
924  if ( nR > 1 )
925  {
926  aStrTD.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_rowspan).
927  append('=').append(static_cast<sal_Int32>(nR));
928  nR += nRow;
929  v = pDoc->GetRowHeight( nRow, nR-1, nTab );
930  nHeightPixel = ToPixel( static_cast< sal_uInt16 >( v ) );
931  }
932  else
933  nHeightPixel = ToPixel( pDoc->GetRowHeight( nRow, nTab ) );
934  }
935  else
936  nHeightPixel = ToPixel( pDoc->GetRowHeight( nRow, nTab ) );
937 
938  if ( bTableDataHeight )
939  {
940  aStrTD.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_height).
941  append("=\"").
942  append(static_cast<sal_Int32>(nHeightPixel)).append('"');
943  }
944 
945  const SvxFontItem& rFontItem = static_cast<const SvxFontItem&>( pAttr->GetItem(
947  pCondItemSet) );
948 
949  const SvxFontHeightItem& rFontHeightItem = static_cast<const SvxFontHeightItem&>(
950  pAttr->GetItem( ScGlobal::GetScriptedWhichID( nScriptType,
951  ATTR_FONT_HEIGHT), pCondItemSet) );
952 
953  const SvxWeightItem& rWeightItem = static_cast<const SvxWeightItem&>( pAttr->GetItem(
955  pCondItemSet) );
956 
957  const SvxPostureItem& rPostureItem = static_cast<const SvxPostureItem&>(
958  pAttr->GetItem( ScGlobal::GetScriptedWhichID( nScriptType,
959  ATTR_FONT_POSTURE), pCondItemSet) );
960 
961  const SvxUnderlineItem& rUnderlineItem =
962  pAttr->GetItem( ATTR_FONT_UNDERLINE, pCondItemSet );
963 
964  const SvxCrossedOutItem& rCrossedOutItem =
965  pAttr->GetItem( ATTR_FONT_CROSSEDOUT, pCondItemSet );
966 
967  const SvxColorItem& rColorItem = pAttr->GetItem(
968  ATTR_FONT_COLOR, pCondItemSet );
969 
970  const SvxHorJustifyItem& rHorJustifyItem =
971  pAttr->GetItem( ATTR_HOR_JUSTIFY, pCondItemSet );
972 
973  const SvxVerJustifyItem& rVerJustifyItem =
974  pAttr->GetItem( ATTR_VER_JUSTIFY, pCondItemSet );
975 
976  const SvxBrushItem& rBrushItem = pAttr->GetItem(
977  ATTR_BACKGROUND, pCondItemSet );
978 
979  Color aBgColor;
980  if ( rBrushItem.GetColor().GetAlpha() == 0 )
981  aBgColor = aHTMLStyle.aBackgroundColor; // No unwanted background color
982  else
983  aBgColor = rBrushItem.GetColor();
984 
985  bool bBold = ( WEIGHT_BOLD <= rWeightItem.GetWeight() );
986  bool bItalic = ( ITALIC_NONE != rPostureItem.GetPosture() );
987  bool bUnderline = ( LINESTYLE_NONE != rUnderlineItem.GetLineStyle() );
988  bool bCrossedOut = ( STRIKEOUT_SINGLE <= rCrossedOutItem.GetStrikeout() );
989  bool bSetFontColor = ( COL_AUTO != rColorItem.GetValue() ); // default is AUTO now
990  bool bSetFontName = ( aHTMLStyle.aFontFamilyName != rFontItem.GetFamilyName() );
991  sal_uInt16 nSetFontSizeNumber = 0;
992  sal_uInt32 nFontHeight = rFontHeightItem.GetHeight();
993  if ( nFontHeight != aHTMLStyle.nFontHeight )
994  {
995  nSetFontSizeNumber = GetFontSizeNumber( static_cast<sal_uInt16>(nFontHeight) );
996  if ( nSetFontSizeNumber == aHTMLStyle.nFontSizeNumber )
997  nSetFontSizeNumber = 0; // no difference, don't set
998  }
999 
1000  bool bSetFont = (bSetFontColor || bSetFontName || nSetFontSizeNumber);
1001 
1005 
1006  switch( rHorJustifyItem.GetValue() )
1007  {
1008  case SvxCellHorJustify::Standard:
1010  break;
1011  case SvxCellHorJustify::Center: pChar = OOO_STRING_SVTOOLS_HTML_AL_center; break;
1012  case SvxCellHorJustify::Block: pChar = OOO_STRING_SVTOOLS_HTML_AL_justify; break;
1013  case SvxCellHorJustify::Right: pChar = OOO_STRING_SVTOOLS_HTML_AL_right; break;
1014  case SvxCellHorJustify::Left:
1015  case SvxCellHorJustify::Repeat:
1016  default: pChar = OOO_STRING_SVTOOLS_HTML_AL_left; break;
1017  }
1018 
1019  aStrTD.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_align).
1020  append("=\"").append(pChar).append('"');
1021 
1022  switch( rVerJustifyItem.GetValue() )
1023  {
1024  case SvxCellVerJustify::Top: pChar = OOO_STRING_SVTOOLS_HTML_VA_top; break;
1025  case SvxCellVerJustify::Center: pChar = OOO_STRING_SVTOOLS_HTML_VA_middle; break;
1026  case SvxCellVerJustify::Bottom: pChar = OOO_STRING_SVTOOLS_HTML_VA_bottom; break;
1027  case SvxCellVerJustify::Standard:
1028  default: pChar = nullptr;
1029  }
1030  if ( pChar )
1031  {
1032  aStrTD.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_valign).
1033  append('=').append(pChar);
1034  }
1035 
1036  if ( aHTMLStyle.aBackgroundColor != aBgColor )
1037  {
1038  aStrTD.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_bgcolor).
1039  append('=');
1040  aStrTD.append(lcl_makeHTMLColorTriplet(aBgColor));
1041  }
1042 
1043  double fVal = 0.0;
1044  if ( bValueData )
1045  {
1046  switch (aCell.meType)
1047  {
1048  case CELLTYPE_VALUE:
1049  fVal = aCell.mfValue;
1050  if ( bCalcAsShown && fVal != 0.0 )
1051  fVal = pDoc->RoundValueAsShown( fVal, nFormat );
1052  break;
1053  case CELLTYPE_FORMULA:
1054  fVal = aCell.mpFormula->GetValue();
1055  break;
1056  default:
1057  OSL_FAIL( "value data with unsupported cell type" );
1058  }
1059  }
1060 
1061  aStrTD.append(HTMLOutFuncs::CreateTableDataOptionsValNum(bValueData, fVal,
1062  nFormat, *pFormatter, eDestEnc, &aNonConvertibleChars));
1063 
1064  TAG_ON(aStrTD.makeStringAndClear().getStr());
1065 
1066  //write the note for this as the first thing in the tag
1067  ScPostIt* pNote = pDoc->HasNote(aPos) ? pDoc->GetNote(aPos) : nullptr;
1068  if (pNote)
1069  {
1070  //create the comment indicator
1071  OString aStr = OOO_STRING_SVTOOLS_HTML_anchor " "
1072  OOO_STRING_SVTOOLS_HTML_O_class "=\"comment-indicator\"";
1073  TAG_ON(aStr.getStr());
1075  OUT_LF();
1076 
1077  //create the element holding the contents
1078  //this is a bit naive, since it doesn't separate
1079  //lines into html breaklines yet
1081  OUT_STR( pNote->GetText() );
1083  OUT_LF();
1084  }
1085 
1086  if ( bBold ) TAG_ON( OOO_STRING_SVTOOLS_HTML_bold );
1087  if ( bItalic ) TAG_ON( OOO_STRING_SVTOOLS_HTML_italic );
1088  if ( bUnderline ) TAG_ON( OOO_STRING_SVTOOLS_HTML_underline );
1089  if ( bCrossedOut ) TAG_ON( OOO_STRING_SVTOOLS_HTML_strikethrough );
1090 
1091  if ( bSetFont )
1092  {
1093  OStringBuffer aStr(OOO_STRING_SVTOOLS_HTML_font);
1094  if ( bSetFontName )
1095  {
1096  aStr.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_face).
1097  append("=\"");
1098 
1099  if (!rFontItem.GetFamilyName().isEmpty())
1100  {
1101  const OUString& rList = rFontItem.GetFamilyName();
1102  for (sal_Int32 nPos {0};;)
1103  {
1104  OString aTmpStr = HTMLOutFuncs::ConvertStringToHTML(
1105  rList.getToken( 0, ';', nPos ), eDestEnc,
1107  aStr.append(aTmpStr);
1108  if (nPos<0)
1109  break;
1110  aStr.append(',');
1111  }
1112  }
1113 
1114  aStr.append('\"');
1115  }
1116  if ( nSetFontSizeNumber )
1117  {
1118  aStr.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_size).
1119  append('=').append(static_cast<sal_Int32>(nSetFontSizeNumber));
1120  }
1121  if ( bSetFontColor )
1122  {
1123  Color aColor = rColorItem.GetValue();
1124 
1125  // always export automatic text color as black
1126  if ( aColor == COL_AUTO )
1127  aColor = COL_BLACK;
1128 
1129  aStr.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_color).
1130  append('=').append(lcl_makeHTMLColorTriplet(aColor));
1131  }
1132  TAG_ON(aStr.makeStringAndClear().getStr());
1133  }
1134 
1135  OUString aURL;
1136  bool bWriteHyperLink(false);
1137  if (aCell.meType == CELLTYPE_FORMULA)
1138  {
1139  ScFormulaCell* pFCell = aCell.mpFormula;
1140  if (pFCell->IsHyperLinkCell())
1141  {
1142  OUString aCellText;
1143  pFCell->GetURLResult(aURL, aCellText);
1144  bWriteHyperLink = true;
1145  }
1146  }
1147 
1148  if (bWriteHyperLink)
1149  {
1151  OString aStr = OOO_STRING_SVTOOLS_HTML_anchor " " OOO_STRING_SVTOOLS_HTML_O_href "=\"" + aURLStr + "\"";
1152  TAG_ON(aStr.getStr());
1153  }
1154 
1155  OUString aStrOut;
1156  bool bFieldText = false;
1157 
1158  const Color* pColor;
1159  switch (aCell.meType)
1160  {
1161  case CELLTYPE_EDIT :
1162  bFieldText = WriteFieldText(aCell.mpEditText);
1163  if ( bFieldText )
1164  break;
1165  [[fallthrough]];
1166  default:
1167  ScCellFormat::GetString(aCell, nFormat, aStrOut, &pColor, *pFormatter, *pDoc);
1168  }
1169 
1170  if ( !bFieldText )
1171  {
1172  if ( aStrOut.isEmpty() )
1173  {
1174  TAG_ON( OOO_STRING_SVTOOLS_HTML_linebreak ); // No completely empty line
1175  }
1176  else
1177  {
1178  sal_Int32 nPos = aStrOut.indexOf( '\n' );
1179  if ( nPos == -1 )
1180  {
1181  OUT_STR( aStrOut );
1182  }
1183  else
1184  {
1185  sal_Int32 nStartPos = 0;
1186  do
1187  {
1188  OUString aSingleLine = aStrOut.copy( nStartPos, nPos - nStartPos );
1189  OUT_STR( aSingleLine );
1191  nStartPos = nPos + 1;
1192  }
1193  while( ( nPos = aStrOut.indexOf( '\n', nStartPos ) ) != -1 );
1194  OUString aSingleLine = aStrOut.copy( nStartPos );
1195  OUT_STR( aSingleLine );
1196  }
1197  }
1198  }
1199  if ( pGraphEntry )
1200  WriteGraphEntry( pGraphEntry );
1201 
1202  if (bWriteHyperLink) { TAG_OFF(OOO_STRING_SVTOOLS_HTML_anchor); }
1203 
1204  if ( bSetFont ) TAG_OFF( OOO_STRING_SVTOOLS_HTML_font );
1205  if ( bCrossedOut ) TAG_OFF( OOO_STRING_SVTOOLS_HTML_strikethrough );
1206  if ( bUnderline ) TAG_OFF( OOO_STRING_SVTOOLS_HTML_underline );
1207  if ( bItalic ) TAG_OFF( OOO_STRING_SVTOOLS_HTML_italic );
1208  if ( bBold ) TAG_OFF( OOO_STRING_SVTOOLS_HTML_bold );
1209 
1211 }
1212 
1214 {
1215  bool bFields = false;
1216  // text and anchor of URL fields, Doc-Engine is a ScFieldEditEngine
1217  EditEngine& rEngine = pDoc->GetEditEngine();
1218  rEngine.SetText( *pData );
1219  sal_Int32 nParas = rEngine.GetParagraphCount();
1220  if ( nParas )
1221  {
1222  ESelection aSel( 0, 0, nParas-1, rEngine.GetTextLen( nParas-1 ) );
1223  SfxItemSet aSet( rEngine.GetAttribs( aSel ) );
1224  SfxItemState eFieldState = aSet.GetItemState( EE_FEATURE_FIELD, false );
1225  if ( eFieldState == SfxItemState::DONTCARE || eFieldState == SfxItemState::SET )
1226  bFields = true;
1227  }
1228  if ( bFields )
1229  {
1230  bool bOldUpdateMode = rEngine.GetUpdateMode();
1231  rEngine.SetUpdateMode( true ); // no portions if not formatted
1232  for ( sal_Int32 nPar=0; nPar < nParas; nPar++ )
1233  {
1234  if ( nPar > 0 )
1236  std::vector<sal_Int32> aPortions;
1237  rEngine.GetPortions( nPar, aPortions );
1238  sal_Int32 nStart = 0;
1239  for ( const sal_Int32 nEnd : aPortions )
1240  {
1241  ESelection aSel( nPar, nStart, nPar, nEnd );
1242  bool bUrl = false;
1243  // fields are single characters
1244  if ( nEnd == nStart+1 )
1245  {
1246  const SfxPoolItem* pItem;
1247  SfxItemSet aSet = rEngine.GetAttribs( aSel );
1248  if ( aSet.GetItemState( EE_FEATURE_FIELD, false, &pItem ) == SfxItemState::SET )
1249  {
1250  const SvxFieldData* pField = static_cast<const SvxFieldItem*>(pItem)->GetField();
1251  if (const SvxURLField* pURLField = dynamic_cast<const SvxURLField*>(pField))
1252  {
1253  bUrl = true;
1255  OUT_STR( pURLField->GetURL() );
1256  rStrm.WriteCharPtr( "\">" );
1257  OUT_STR( pURLField->GetRepresentation() );
1259  }
1260  }
1261  }
1262  if ( !bUrl )
1263  OUT_STR( rEngine.GetText( aSel ) );
1264  nStart = nEnd;
1265  }
1266  }
1267  rEngine.SetUpdateMode( bOldUpdateMode );
1268  }
1269  return bFields;
1270 }
1271 
1272 void ScHTMLExport::CopyLocalFileToINet( OUString& rFileNm,
1273  const OUString& rTargetNm )
1274 {
1275  INetURLObject aFileUrl, aTargetUrl;
1276  aFileUrl.SetSmartURL( rFileNm );
1277  aTargetUrl.SetSmartURL( rTargetNm );
1278  if( !(INetProtocol::File == aFileUrl.GetProtocol() &&
1279  ( INetProtocol::File != aTargetUrl.GetProtocol() &&
1280  INetProtocol::Ftp <= aTargetUrl.GetProtocol() &&
1281  INetProtocol::Javascript >= aTargetUrl.GetProtocol())) )
1282  return;
1283 
1284  if( pFileNameMap )
1285  {
1286  // Did we already move the file?
1287  std::map<OUString, OUString>::iterator it = pFileNameMap->find( rFileNm );
1288  if( it != pFileNameMap->end() )
1289  {
1290  rFileNm = it->second;
1291  return;
1292  }
1293  }
1294  else
1295  {
1296  pFileNameMap.reset( new std::map<OUString, OUString> );
1297  }
1298 
1299  bool bRet = false;
1300  SvFileStream aTmp( aFileUrl.PathToFileName(), StreamMode::READ );
1301 
1302  OUString aSrc = rFileNm;
1303  OUString aDest = aTargetUrl.GetPartBeforeLastName() + aFileUrl.GetLastName();
1304 
1305  SfxMedium aMedium( aDest, StreamMode::WRITE | StreamMode::SHARE_DENYNONE );
1306 
1307  {
1308  SvFileStream aCpy( aMedium.GetPhysicalName(), StreamMode::WRITE );
1309  aCpy.WriteStream( aTmp );
1310  }
1311 
1312  // Take over
1313  aMedium.Close();
1314  aMedium.Commit();
1315 
1316  bRet = ERRCODE_NONE == aMedium.GetError();
1317 
1318  if( bRet )
1319  {
1320  pFileNameMap->insert( std::make_pair( aSrc, aDest ) );
1321  rFileNm = aDest;
1322  }
1323 }
1324 
1325 void ScHTMLExport::IncIndent( short nVal )
1326 {
1327  sIndent[nIndent] = '\t';
1328  nIndent = nIndent + nVal;
1329  if ( nIndent < 0 )
1330  nIndent = 0;
1331  else if ( nIndent > nIndentMax )
1332  nIndent = nIndentMax;
1333  sIndent[nIndent] = 0;
1334 }
1335 
1336 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const char sBackground[]
Definition: htmlexp.cxx:93
SCTAB nUsedTables
Definition: htmlexp.hxx:120
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:499
#define OOO_STRING_SVTOOLS_HTML_O_clear
const short nIndentMax
Definition: htmlexp.hxx:97
virtual ~ScHTMLExport() override
Definition: htmlexp.cxx:247
#define OOO_STRING_SVTOOLS_HTML_VA_bottom
sal_uInt8 GetAlpha() const
sal_uInt8 GetRed() const
FileNameMapPtr pFileNameMap
Definition: htmlexp.hxx:117
sal_uInt16 nFontSizeNumber
Definition: htmlexp.hxx:53
bool IsSaveGraphicsLocal() const
FormulaCommand pE
constexpr TypedWhichId< SvxBoxItem > ATTR_BORDER(150)
#define TAG_OFF(tag)
Definition: htmlexp.cxx:115
SCROW Row() const
Definition: address.hxx:261
void setWidth(tools::Long nWidth)
#define OOO_STRING_SVTOOLS_HTML_O_rowspan
void SetUpdateMode(bool bUpdate, bool bRestoring=false)
#define OOO_STRING_SVTOOLS_HTML_AL_center
bool IsTransparent() const
#define OUT_SP_CSTR_ASS(s)
Definition: htmlexp.cxx:125
bool isEmpty() const
Definition: cellvalue.cxx:670
GPOS_NONE
void WriteGraphEntry(ScHTMLGraphEntry *)
Definition: htmlexp2.cxx:114
const sal_uInt32 SC_HTML_FONTSIZES
Definition: htmlpars.hxx:33
#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:156
static OString lcl_getColGroupString(sal_Int32 nSpan, sal_Int32 nWidth)
Definition: htmlexp.cxx:138
constexpr TypedWhichId< SvxCrossedOutItem > ATTR_FONT_CROSSEDOUT(106)
void WriteBody()
Definition: htmlexp.cxx:554
sal_uIntPtr sal_uLong
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:1325
#define OOO_STRING_SVTOOLS_HTML_tablerow
SC_DLLPUBLIC bool InitColumnBlockPosition(sc::ColumnBlockPosition &rBlockPos, SCTAB nTab, SCCOL nCol)
Definition: document.cxx:2603
#define OUT_COMMENT(comment)
Definition: htmlexp.cxx:121
bool mbSkipImages
Definition: htmlexp.hxx:129
#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:126
bool IsClipOrUndo() const
Definition: document.hxx:1530
#define OOO_STRING_SVTOOLS_HTML_body
sal_uInt16 ToPixel(sal_uInt16 nTwips)
Definition: htmlexp.cxx:272
SC_DLLPUBLIC SCROW FirstVisibleRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab) const
Definition: document.cxx:4467
ScAddress aEnd
Definition: address.hxx:500
OUString GetLastName(DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
SvStream & WriteOString(const OString &rStr)
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
css::uno::Reference< css::frame::XModel > GetModel() const
#define OOO_STRING_SVTOOLS_HTML_O_background
const editeng::SvxBorderLine * GetRight() const
#define OOO_STRING_SVTOOLS_HTML_italic
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:4153
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
void Close(bool bInDestruction=false)
#define OOO_STRING_SVTOOLS_HTML_tabledata
bool bTabAlignedLeft
Definition: htmlexp.hxx:125
SC_DLLPUBLIC ScPostIt * GetNote(const ScAddress &rPos)
Notes.
Definition: document.cxx:6495
#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
const EditTextObject * mpEditText
Definition: cellvalue.hxx:109
LINESTYLE_NONE
void SetText(const OUString &rStr)
static void Out_DocInfo(SvStream &rStrm, const OUString &rBaseURL, const css::uno::Reference< css::document::XDocumentProperties > &, const char *pIndent, rtl_TextEncoding eDestEnc=RTL_TEXTENCODING_MS_1252, OUString *pNonConvertableChars=nullptr)
#define OOO_STRING_SVTOOLS_HTML_O_href
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:313
Additional class containing cell annotation data.
Definition: postit.hxx:159
double GetValue()
static const char * GetFontSizeCss(sal_uInt16 nHeight)
Definition: htmlexp.cxx:266
int nCount
static SC_DLLPUBLIC sal_uInt16 GetScriptedWhichID(SvtScriptType nScriptType, sal_uInt16 nWhich)
Map ATTR_((CJK|CTL)_)?FONT_...
Definition: global.cxx:864
#define OOO_STRING_SVTOOLS_HTML_O_colspan
static SVT_DLLPUBLIC OString CreateTableDataOptionsValNum(bool bValue, double fVal, sal_uLong nFormat, SvNumberFormatter &rFormatter, rtl_TextEncoding eDestEnc=RTL_TEXTENCODING_MS_1252, OUString *pNonConvertableChars=nullptr)
#define OOO_STRING_SVTOOLS_HTML_AL_justify
const char sMyEndComment[]
Definition: htmlexp.cxx:90
const OUString & GetPhysicalName() const
#define GLOBSTR(id)
Definition: htmlexp.cxx:127
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:270
#define OUT_STR(str)
Definition: htmlexp.cxx:116
#define OOO_STRING_SVTOOLS_HTML_VA_top
void WriteHeader()
Definition: htmlexp.cxx:311
void CopyLocalFileToINet(OUString &rFileNm, const OUString &rTargetNm)
Definition: htmlexp.cxx:1272
STRIKEOUT_SINGLE
sal_uInt8 GetBlue() const
SC_DLLPUBLIC const ScPatternAttr * GetPattern(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: document.cxx:4727
SC_DLLPUBLIC const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) const
Definition: document.cxx:4706
constexpr auto convert(N n, sal_Int64 mul, sal_Int64 div)
#define OOO_STRING_SVTOOLS_HTML_bold
constexpr TypedWhichId< SvxUnderlineItem > ATTR_FONT_UNDERLINE(104)
const SfxPoolItem & GetItem(sal_uInt16 nWhichP) const
Definition: patattr.hxx:70
static SvxHtmlOptions & Get()
#define OOO_STRING_SVTOOLS_HTML_colgroup
const Color & GetColor() const
#define OUT_HR()
Definition: htmlexp.cxx:120
#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:131
bool bTabHasGraphics
Definition: htmlexp.hxx:124
#define OOO_STRING_SVTOOLS_HTML_doctype
SC_DLLPUBLIC ScDrawLayer * GetDrawLayer()
Definition: document.hxx:1057
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:4437
SvtScriptType
Size MMToPixel(const Size &r100thMMSize)
Definition: htmlexp.cxx:284
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
sal_uInt32 GetTextLen() 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
OUString ScResId(const char *pId)
Definition: scdll.cxx:89
bool WriteFieldText(const EditTextObject *pData)
Definition: htmlexp.cxx:1213
SC_DLLPUBLIC OUString GetPageStyle(SCTAB nTab) const
Definition: document.cxx:6173
#define OOO_STRING_SVTOOLS_HTML_style
sal_uInt32 GetNumberFormat(SvNumberFormatter *) const
Definition: patattr.cxx:1255
#define TAG_ON_LF(tag)
Definition: htmlexp.cxx:118
#define TAG_ON(tag)
Definition: htmlexp.cxx:114
bool hasNumeric() const
Definition: cellvalue.cxx:622
bool In(const ScAddress &) const
is Address& in Range?
Definition: address.hxx:732
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:789
SvStream & WriteStream(SvStream &rStream)
SC_DLLPUBLIC bool HasNote(const ScAddress &rPos) const
Definition: document.cxx:6520
#define OOO_STRING_SVTOOLS_HTML_underline
SCCOL Col() const
Definition: address.hxx:266
sal_Int32 GetParagraphCount() const
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:129
bool bTableDataHeight
Definition: htmlexp.hxx:128
#define HTMLFONTSZ6_DFLT
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:634
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
static SC_DLLPUBLIC const LocaleDataWrapper * getLocaleDataPtr()
Definition: global.cxx:1000
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
static SC_DLLPUBLIC SvtScriptType GetDefaultScriptType()
Definition: global.cxx:849
#define OOO_STRING_SVTOOLS_HTML_strikethrough
#define OUT_LF()
Definition: htmlexp.cxx:117
sal_uInt16 GetFontSize(sal_uInt16 nPos) const
#define TAG_OFF_LF(tag)
Definition: htmlexp.cxx:119
sal_uInt32 GetHeight() const
static SVT_DLLPUBLIC OString ConvertStringToHTML(const OUString &sSrc, rtl_TextEncoding eDestEnc, OUString *pNonConvertableChars)
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
#define ERRCODE_NONE
constexpr tools::Long Height() const
short nIndent
Definition: htmlexp.hxx:121
OUString GetPartBeforeLastName() const
static sal_uInt16 GetFontSizeNumber(sal_uInt16 nHeight)
Definition: htmlexp.cxx:252
bool bCopyLocalFileToINet
Definition: htmlexp.hxx:127
bool GetUpdateMode() const
#define OOO_STRING_SVTOOLS_HTML_center
#define OOO_STRING_SVTOOLS_HTML_doctype40
ScRange aRange
Definition: expbase.hxx:34
const char sBorder[]
Definition: htmlexp.cxx:92
bool bInitialized
Definition: htmlexp.hxx:55
INetProtocol GetProtocol() const
void GetPortions(sal_Int32 nPara, std::vector< sal_Int32 > &rList)
rtl_TextEncoding eDestEnc
Definition: htmlexp.hxx:119
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:91
constexpr TypedWhichId< SvxHorJustifyItem > ATTR_HOR_JUSTIFY(129)
void WriteCell(sc::ColumnBlockPosition &rBlockPos, SCCOL nCol, SCROW nRow, SCTAB nTab)
Definition: htmlexp.cxx:834
#define OOO_STRING_SVTOOLS_HTML_parabreak
#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:180
const char sMyBegComment[]
Definition: htmlexp.cxx:89
SvStream & WriteChar(char nChar)
SC_DLLPUBLIC ScStyleSheetPool * GetStyleSheetPool() const
Definition: document.cxx:6053
void Write()
Definition: htmlexp.cxx:295
FontStrikeout GetStrikeout() const
SC_DLLPUBLIC bool HasHiddenRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab) const
Definition: document.cxx:4429
static OString lcl_makeHTMLColorTriplet(const Color &rColor)
Definition: htmlexp.cxx:185
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:4421
#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:195
#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:404
void GetURLResult(OUString &rURL, OUString &rCellText)
SC_DLLPUBLIC bool IsVisible(SCTAB nTab) const
Definition: document.cxx:907
SfxObjectShell * GetDocumentShell() const
Definition: document.hxx:1056
rtl_TextEncoding GetTextEncoding() const
constexpr sal_uInt16 EE_FEATURE_FIELD(EE_FEATURE_NOTCONV+1)
SCROW GetRowMerge() const
Definition: attrib.hxx:69
static void GetString(const ScRefCellValue &rCell, sal_uInt32 nFormat, OUString &rString, const Color **ppColor, SvNumberFormatter &rFormatter, const ScDocument &rDoc, bool bNullVals=true, bool bFormula=false, bool bUseStarFormat=false)
Definition: cellform.cxx:31
void WriteTables()
Definition: htmlexp.cxx:633
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:482
char sIndent[nIndentMax+1]
Definition: htmlexp.hxx:122
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:4112
const SfxItemSet & PageDefaults(SCTAB nTab)
Definition: htmlexp.cxx:437
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:212
#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:456
#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
bool SetSmartURL(OUString const &rTheAbsURIRef, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
#define OOO_STRING_SVTOOLS_HTML_O_span
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