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