LibreOffice Module sw (master) 1
htmlflywriter.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <com/sun/star/text/HoriOrientation.hpp>
21#include <com/sun/star/text/VertOrientation.hpp>
22#include <com/sun/star/text/RelOrientation.hpp>
23#include <com/sun/star/beans/XPropertySet.hpp>
24#include <hintids.hxx>
25#include <tools/fract.hxx>
26#include <svl/urihelper.hxx>
27#include <vcl/svapp.hxx>
28#include <sfx2/event.hxx>
29#include <svtools/htmlkywd.hxx>
30#include <svtools/htmlout.hxx>
31#include <svtools/htmltokn.h>
32#include <vcl/imap.hxx>
33#include <vcl/imapobj.hxx>
34#include <svtools/htmlcfg.hxx>
36#include <svx/svdouno.hxx>
37#include <svx/xoutbmp.hxx>
38#include <editeng/boxitem.hxx>
39#include <editeng/lrspitem.hxx>
40#include <editeng/ulspitem.hxx>
41#include <editeng/brushitem.hxx>
42#include <sal/log.hxx>
43#include <osl/diagnose.h>
44#include <svx/svdograf.hxx>
45
46#include <fmtanchr.hxx>
47#include <fmtornt.hxx>
48#include <fmturl.hxx>
49#include <fmtfsize.hxx>
50#include <fmtclds.hxx>
51#include <fmtcntnt.hxx>
52#include <fmtsrnd.hxx>
53#include <fmtinfmt.hxx>
54#include <txtinet.hxx>
55#include <frmatr.hxx>
56#include <grfatr.hxx>
57#include <flypos.hxx>
58#include <ndgrf.hxx>
59
60#include <doc.hxx>
61#include <ndtxt.hxx>
62#include <pam.hxx>
63#include <swerror.h>
64#include <frmfmt.hxx>
65#include "wrthtml.hxx"
66#include "htmlatr.hxx"
67#include "htmlfly.hxx"
68#include "htmlreqifreader.hxx"
69
70using namespace css;
71
89
101
108
115
123
131
132static Writer& OutHTML_FrameFormatTableNode( Writer& rWrt, const SwFrameFormat& rFrameFormat );
133static Writer& OutHTML_FrameFormatAsMulticol( Writer& rWrt, const SwFrameFormat& rFormat,
134 bool bInCntnr );
135static Writer& OutHTML_FrameFormatAsSpacer( Writer& rWrt, const SwFrameFormat& rFormat );
137 const SwFrameFormat& rFrameFormat, bool bSpan );
138static Writer& OutHTML_FrameFormatAsImage( Writer& rWrt, const SwFrameFormat& rFormat, bool bPNGFallback );
139
140static Writer& OutHTML_FrameFormatGrfNode( Writer& rWrt, const SwFrameFormat& rFormat,
141 bool bInCntnr, bool bPNGFallback );
142
143static Writer& OutHTML_FrameFormatAsMarquee( Writer& rWrt, const SwFrameFormat& rFrameFormat,
144 const SdrObject& rSdrObj );
145
147{
148 { OOO_STRING_SVTOOLS_HTML_O_SDonload, OOO_STRING_SVTOOLS_HTML_O_onload, SvMacroItemId::OnImageLoadDone },
149 { OOO_STRING_SVTOOLS_HTML_O_SDonabort, OOO_STRING_SVTOOLS_HTML_O_onabort, SvMacroItemId::OnImageLoadCancel },
151 { nullptr, nullptr, SvMacroItemId::NONE }
152};
153
155{
158 { nullptr, nullptr, SvMacroItemId::NONE }
159};
160
161sal_uInt16 SwHTMLWriter::GuessFrameType( const SwFrameFormat& rFrameFormat,
162 const SdrObject*& rpSdrObj )
163{
165
166 if( RES_DRAWFRMFMT == rFrameFormat.Which() )
167 {
168 // use an arbitrary draw object as the default value
170
171 const SdrObject *pObj =
172 SwHTMLWriter::GetMarqueeTextObj( static_cast<const SwDrawFrameFormat &>(rFrameFormat) );
173 if( pObj )
174 {
175 // scrolling text
176 rpSdrObj = pObj;
178 }
179 else
180 {
181 pObj = GetHTMLControl( static_cast<const SwDrawFrameFormat &>(rFrameFormat) );
182
183 if( pObj )
184 {
185 // Form control
186 rpSdrObj = pObj;
188 }
189 }
190 }
191 else
192 {
193 // use a text frame as the default value
195
196 const SwFormatContent& rFlyContent = rFrameFormat.GetContent();
197 SwNodeOffset nStt = rFlyContent.GetContentIdx()->GetIndex()+1;
198 const SwNode* pNd = m_pDoc->GetNodes()[ nStt ];
199
200 if( pNd->IsGrfNode() )
201 {
202 // graphic node
204 }
205 else if( pNd->IsOLENode() )
206 {
207 // applet, plugin, floating frame
208 eType = static_cast<SwHTMLFrameType>(GuessOLENodeFrameType( *pNd ));
209 }
210 else
211 {
212 SwNodeOffset nEnd = m_pDoc->GetNodes()[nStt-1]->EndOfSectionIndex();
213
214 const SfxItemSet& rItemSet = rFrameFormat.GetAttrSet();
215 const SwFormatCol* pFormatCol = rItemSet.GetItemIfSet( RES_COL );
216 if( pFormatCol && pFormatCol->GetNumCols() > 1 )
217 {
218 // frame with columns
220 }
221 else if( pNd->IsTableNode() )
222 {
223 const SwTableNode *pTableNd = pNd->GetTableNode();
224 SwNodeOffset nTableEnd = pTableNd->EndOfSectionIndex();
225
226 if( nTableEnd+1 == nEnd )
227 {
228 // table
230 }
231 else if( nTableEnd+2 == nEnd )
232 {
233 // table with caption
235 }
236 }
237 else if( pNd->IsTextNode() )
238 {
239 const SwTextNode *pTextNd = pNd->GetTextNode();
240
241 bool bEmpty = false;
242 if( nStt==nEnd-1 && !pTextNd->Len() )
243 {
244 // empty frame? Only if no frame is
245 // anchored to the text or start node.
246 bEmpty = true;
247 for( auto & pHTMLPosFlyFrame : m_aHTMLPosFlyFrames )
248 {
249 SwNodeOffset nIdx = pHTMLPosFlyFrame->GetNdIndex().GetIndex();
250 bEmpty = (nIdx != nStt) && (nIdx != nStt-1);
251 if( !bEmpty || nIdx > nStt )
252 break;
253 }
254 }
255 if( bEmpty )
256 {
257 std::unique_ptr<SvxBrushItem> aBrush = rFrameFormat.makeBackgroundBrushItem();
260 if( GPOS_NONE != aBrush->GetGraphicPos() ||
261 aBrush->GetColor() != COL_TRANSPARENT )
262 {
263 bEmpty = false;
264 }
265 }
266 if( bEmpty )
267 {
268 // empty frame
270 }
271 else if( m_pDoc->GetNodes()[nStt+1]->IsTableNode() )
272 {
273 const SwTableNode *pTableNd =
274 m_pDoc->GetNodes()[nStt+1]->GetTableNode();
275 if( pTableNd->EndOfSectionIndex()+1 == nEnd )
276 {
277 // table with heading
279 }
280 }
281 }
282 }
283 }
284
285 return static_cast< sal_uInt16 >(eType);
286}
287
289{
290 OSL_ENSURE( HTML_CFG_MAX+1 == MAX_BROWSERS,
291 "number of browser configurations has changed" );
292
293 SwPosFlyFrames aFlyPos(
294 m_pDoc->GetAllFlyFormats(m_bWriteAll ? nullptr : m_pCurrentPam.get(), true));
295
296 for(const SwPosFlyFrame& rItem : aFlyPos)
297 {
298 const SwFrameFormat& rFrameFormat = rItem.GetFormat();
299 const SdrObject *pSdrObj = nullptr;
300 const SwPosition *pAPos;
301 const SwContentNode *pACNd;
302 SwHTMLFrameType eType = static_cast<SwHTMLFrameType>(GuessFrameType( rFrameFormat, pSdrObj ));
303
304 AllHtmlFlags nMode;
305 const SwFormatAnchor& rAnchor = rFrameFormat.GetAnchor();
306 sal_Int16 eHoriRel = rFrameFormat.GetHoriOrient().GetRelationOrient();
307 switch( rAnchor.GetAnchorId() )
308 {
309 case RndStdIds::FLY_AT_PAGE:
310 case RndStdIds::FLY_AT_FLY:
312 break;
313
314 case RndStdIds::FLY_AT_PARA:
315 // frames that are anchored to a paragraph are only placed
316 // before the paragraph, if the paragraph has a
317 // spacing.
318 if( text::RelOrientation::FRAME == eHoriRel &&
319 (pAPos = rAnchor.GetContentAnchor()) != nullptr &&
320 (pACNd = pAPos->GetNode().GetContentNode()) != nullptr )
321 {
322 const SvxLRSpaceItem& rLRItem =
323 pACNd->GetAttr(RES_LR_SPACE);
324 if( rLRItem.GetTextLeft() || rLRItem.GetRight() )
325 {
327 break;
328 }
329 }
331 break;
332
333 case RndStdIds::FLY_AT_CHAR:
334 if( text::RelOrientation::FRAME == eHoriRel || text::RelOrientation::PRINT_AREA == eHoriRel )
336 else
338 break;
339
340 default:
342 break;
343 }
344
345 m_aHTMLPosFlyFrames.insert( std::make_unique<SwHTMLPosFlyFrame>(rItem, pSdrObj, nMode) );
346 }
347}
348
349bool SwHTMLWriter::OutFlyFrame( SwNodeOffset nNdIdx, sal_Int32 nContentIdx, HtmlPosition nPos )
350{
351 bool bFlysLeft = false; // Are there still Flys left at the current node position?
352
353 // OutFlyFrame can be called recursively. Thus, sometimes it is
354 // necessary to start over after a Fly was returned.
355 bool bRestart = true;
356 while( !m_aHTMLPosFlyFrames.empty() && bRestart )
357 {
358 bFlysLeft = bRestart = false;
359
360 // search for the beginning of the FlyFrames
361 size_t i {0};
362
363 for( ; i < m_aHTMLPosFlyFrames.size() &&
364 m_aHTMLPosFlyFrames[i]->GetNdIndex().GetIndex() < nNdIdx; i++ )
365 ;
366 for( ; !bRestart && i < m_aHTMLPosFlyFrames.size() &&
367 m_aHTMLPosFlyFrames[i]->GetNdIndex().GetIndex() == nNdIdx; i++ )
368 {
369 SwHTMLPosFlyFrame *pPosFly = m_aHTMLPosFlyFrames[i].get();
370 if( ( HtmlPosition::Any == nPos ||
371 pPosFly->GetOutPos() == nPos ) &&
372 pPosFly->GetContentIndex() == nContentIdx )
373 {
374 // It is important to remove it first, because additional
375 // elements or the whole array could be deleted on
376 // deeper recursion levels.
377 std::unique_ptr<SwHTMLPosFlyFrame> flyHolder = m_aHTMLPosFlyFrames.erase_extract(i);
378 i--;
380 {
381 bRestart = true; // not really, only exit the loop
382 }
383
384 HTMLOutFuncs::FlushToAscii(Strm()); // it was one time only; do we still need it?
385
386 OutFrameFormat( pPosFly->GetOutMode(), pPosFly->GetFormat(),
387 pPosFly->GetSdrObject() );
388 switch( pPosFly->GetOutFn() )
389 {
390 case HtmlOut::Div:
391 case HtmlOut::Span:
394 bRestart = true; // It could become recursive here
395 break;
396 default: break;
397 }
398 }
399 else
400 {
401 bFlysLeft = true;
402 }
403 }
404 }
405
406 return bFlysLeft;
407}
408
410 const SdrObject *pSdrObject )
411{
412 HtmlContainerFlags nCntnrMode = nMode.nContainer;
413 HtmlOut nOutMode = nMode.nOut;
414 OString aContainerStr;
415 if( HtmlContainerFlags::NONE != nCntnrMode )
416 {
417
418 if( m_bLFPossible && HtmlContainerFlags::Div == nCntnrMode )
419 OutNewLine();
420
421 OStringBuffer sOut;
422 aContainerStr = (HtmlContainerFlags::Div == nCntnrMode)
425 sOut.append("<" + GetNamespace() + aContainerStr + " "
427 "sd-abs-pos\"");
428 Strm().WriteOString( sOut );
429 sOut.setLength(0);
430
431 // Output a width for non-draw objects
432 HtmlFrmOpts nFrameFlags = HTML_FRMOPTS_CNTNR;
433
434 // For frames with columns we can also output the background
435 if( HtmlOut::MultiCol == nOutMode )
437
439 nFrameFlags |= HtmlFrmOpts::SNoBorder;
440 OutCSS1_FrameFormatOptions( rFrameFormat, nFrameFlags, pSdrObject );
441 Strm().WriteChar( '>' );
442
443 if( HtmlContainerFlags::Div == nCntnrMode )
444 {
446 m_bLFPossible = true;
447 }
448 }
449
450 switch( nOutMode )
451 {
452 case HtmlOut::TableNode: // OK
453 OSL_ENSURE( aContainerStr.isEmpty(), "Table: Container is not supposed to be here" );
454 OutHTML_FrameFormatTableNode( *this, rFrameFormat );
455 break;
456 case HtmlOut::GraphicNode: // OK
457 OutHTML_FrameFormatGrfNode( *this, rFrameFormat, !aContainerStr.isEmpty(), /*bPNGFallback=*/true );
458 break;
459 case HtmlOut::OleNode: // OK
460 OutHTML_FrameFormatOLENode( *this, rFrameFormat, !aContainerStr.isEmpty() );
461 break;
462 case HtmlOut::OleGraphic: // OK
463 OutHTML_FrameFormatOLENodeGrf( *this, rFrameFormat, !aContainerStr.isEmpty() );
464 break;
465 case HtmlOut::Div:
466 case HtmlOut::Span:
467 OSL_ENSURE( aContainerStr.isEmpty(), "Div: Container is not supposed to be here" );
468 OutHTML_FrameFormatAsDivOrSpan( *this, rFrameFormat, HtmlOut::Span==nOutMode );
469 break;
470 case HtmlOut::MultiCol: // OK
471 OutHTML_FrameFormatAsMulticol( *this, rFrameFormat, !aContainerStr.isEmpty() );
472 break;
473 case HtmlOut::Spacer: // OK
474 OSL_ENSURE( aContainerStr.isEmpty(), "Spacer: Container is not supposed to be here" );
475 OutHTML_FrameFormatAsSpacer( *this, rFrameFormat );
476 break;
477 case HtmlOut::Control: // OK
479 static_cast<const SwDrawFrameFormat &>(rFrameFormat), dynamic_cast<const SdrUnoObj&>(*pSdrObject),
480 !aContainerStr.isEmpty() );
481 break;
483 OutHTML_FrameFormatAsMarquee( *this, rFrameFormat, *pSdrObject );
484 break;
485 case HtmlOut::Marquee:
486 OSL_ENSURE( aContainerStr.isEmpty(), "Marquee: Container is not supposed to be here" );
488 static_cast<const SwDrawFrameFormat &>(rFrameFormat), *pSdrObject );
489 break;
491 OutHTML_FrameFormatAsImage( *this, rFrameFormat, /*bPNGFallback=*/true );
492 break;
493 }
494
495 if( HtmlContainerFlags::Div == nCntnrMode )
496 {
498 if( m_bLFPossible )
499 OutNewLine();
501 m_bLFPossible = true;
502 }
503 else if( HtmlContainerFlags::Span == nCntnrMode )
505}
506
508 const OUString& rAlternateText,
509 HtmlFrmOpts nFrameOpts )
510{
511 OString sRetEndTags;
512 OStringBuffer sOut;
513 const SfxItemSet& rItemSet = rFrameFormat.GetAttrSet();
514
515 // Name
516 if( (nFrameOpts & (HtmlFrmOpts::Id|HtmlFrmOpts::Name)) &&
517 !rFrameFormat.GetName().isEmpty() )
518 {
519 const char *pStr =
521 sOut.append(OString::Concat(" ") + pStr + "=\"");
522 Strm().WriteOString( sOut );
523 sOut.setLength(0);
524 HTMLOutFuncs::Out_String( Strm(), rFrameFormat.GetName() );
525 sOut.append('\"');
526 }
527
528 // Name
529 if( nFrameOpts & HtmlFrmOpts::Dir )
530 {
531 SvxFrameDirection nDir = GetHTMLDirection( rItemSet );
532 Strm().WriteOString( sOut );
533 sOut.setLength(0);
534 OutDirection( nDir );
535 }
536
537 // ALT
538 if( (nFrameOpts & HtmlFrmOpts::Alt) && !rAlternateText.isEmpty() )
539 {
540 sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_alt "=\"");
541 Strm().WriteOString( sOut );
542 sOut.setLength(0);
543 HTMLOutFuncs::Out_String( Strm(), rAlternateText );
544 sOut.append('\"');
545 }
546
547 // ALIGN
548 const char *pStr = nullptr;
549 RndStdIds eAnchorId = rFrameFormat.GetAnchor().GetAnchorId();
550 if( (nFrameOpts & HtmlFrmOpts::Align) &&
551 ((RndStdIds::FLY_AT_PARA == eAnchorId) || (RndStdIds::FLY_AT_CHAR == eAnchorId)) )
552 {
553 // MIB 12.3.98: Wouldn't it be more clever to left-align frames that
554 // are anchored to a paragraph if necessary, instead of inserting them
555 // as being anchored to characters?
556 const SwFormatHoriOrient& rHoriOri = rFrameFormat.GetHoriOrient();
557 if( !(nFrameOpts & HtmlFrmOpts::SAlign) ||
558 text::RelOrientation::FRAME == rHoriOri.GetRelationOrient() ||
559 text::RelOrientation::PRINT_AREA == rHoriOri.GetRelationOrient() )
560 {
561 pStr = text::HoriOrientation::RIGHT == rHoriOri.GetHoriOrient()
564 }
565 }
566 const SwFormatVertOrient* pVertOrient;
567 if( (nFrameOpts & HtmlFrmOpts::Align) && !pStr &&
568 ( !(nFrameOpts & HtmlFrmOpts::SAlign) ||
569 (RndStdIds::FLY_AS_CHAR == eAnchorId) ) &&
570 (pVertOrient = rItemSet.GetItemIfSet( RES_VERT_ORIENT )) )
571 {
572 switch( pVertOrient->GetVertOrient() )
573 {
574 case text::VertOrientation::LINE_TOP: pStr = OOO_STRING_SVTOOLS_HTML_VA_top; break;
575 case text::VertOrientation::CHAR_TOP:
576 case text::VertOrientation::BOTTOM: pStr = OOO_STRING_SVTOOLS_HTML_VA_texttop; break; // not possible
577 case text::VertOrientation::LINE_CENTER:
578 case text::VertOrientation::CHAR_CENTER: pStr = OOO_STRING_SVTOOLS_HTML_VA_absmiddle; break; // not possible
579 case text::VertOrientation::CENTER: pStr = OOO_STRING_SVTOOLS_HTML_VA_middle; break;
580 case text::VertOrientation::LINE_BOTTOM:
581 case text::VertOrientation::CHAR_BOTTOM: pStr = OOO_STRING_SVTOOLS_HTML_VA_absbottom; break; // not possible
582 case text::VertOrientation::TOP: pStr = OOO_STRING_SVTOOLS_HTML_VA_bottom; break;
583 case text::VertOrientation::NONE: break;
584 }
585 }
586 if( pStr )
587 {
588 sOut.append(OString::Concat(" " OOO_STRING_SVTOOLS_HTML_O_align "=\"") +
589 pStr + "\"");
590 }
591
592 // HSPACE and VSPACE
593 Size aTwipSpc( 0, 0 );
594 const SvxLRSpaceItem* pLRSpaceItem;
595 if( (nFrameOpts & (HtmlFrmOpts::Space|HtmlFrmOpts::MarginSize)) &&
596 (pLRSpaceItem = rItemSet.GetItemIfSet( RES_LR_SPACE )) )
597 {
598 aTwipSpc.setWidth(
599 ( pLRSpaceItem->GetLeft() + pLRSpaceItem->GetRight() ) / 2 );
601 }
602 const SvxULSpaceItem* pULSpaceItem;
603 if( (nFrameOpts & (HtmlFrmOpts::Space|HtmlFrmOpts::MarginSize)) &&
604 (pULSpaceItem = rItemSet.GetItemIfSet( RES_UL_SPACE )) )
605 {
606 aTwipSpc.setHeight(
607 ( pULSpaceItem->GetUpper() + pULSpaceItem->GetLower() ) / 2 );
608 m_nDfltTopMargin = m_nDfltBottomMargin = o3tl::narrowing<sal_uInt16>(aTwipSpc.Height());
609 }
610
611 if( (nFrameOpts & HtmlFrmOpts::Space) &&
612 (aTwipSpc.Width() || aTwipSpc.Height()) &&
614 !mbReqIF )
615 {
616 Size aPixelSpc =
618 MapMode(MapUnit::MapTwip) );
619 if( !aPixelSpc.Width() && aTwipSpc.Width() )
620 aPixelSpc.setWidth( 1 );
621 if( !aPixelSpc.Height() && aTwipSpc.Height() )
622 aPixelSpc.setHeight( 1 );
623
624 if( aPixelSpc.Width() )
625 {
627 "=\"" + OString::number(aPixelSpc.Width()) + "\"");
628 }
629
630 if( aPixelSpc.Height() )
631 {
633 "=\"" + OString::number(aPixelSpc.Height()) + "\"");
634 }
635 }
636
637 // The spacing must be considered for the size, if the corresponding flag
638 // is set.
639 if( nFrameOpts & HtmlFrmOpts::MarginSize )
640 {
641 aTwipSpc.setWidth( aTwipSpc.Width() * -2 );
642 aTwipSpc.setHeight( aTwipSpc.Height() * -2 );
643 }
644 else
645 {
646 aTwipSpc.setWidth( 0 );
647 aTwipSpc.setHeight( 0 );
648 }
649
650 const SvxBoxItem* pBoxItem;
651 if( !(nFrameOpts & HtmlFrmOpts::AbsSize) &&
652 (pBoxItem = rItemSet.GetItemIfSet( RES_BOX )) )
653 {
654 aTwipSpc.AdjustWidth(pBoxItem->CalcLineSpace( SvxBoxItemLine::LEFT ) );
655 aTwipSpc.AdjustWidth(pBoxItem->CalcLineSpace( SvxBoxItemLine::RIGHT ) );
656 aTwipSpc.AdjustHeight(pBoxItem->CalcLineSpace( SvxBoxItemLine::TOP ) );
657 aTwipSpc.AdjustHeight(pBoxItem->CalcLineSpace( SvxBoxItemLine::BOTTOM ) );
658 }
659
660 // WIDTH and/or HEIGHT
661 // Output SwFrameSize::Variable/SwFrameSize::Minimum only, if ANYSIZE is set
662 const SwFormatFrameSize *pFSItem;
663 if( (nFrameOpts & HtmlFrmOpts::Size) &&
664 (pFSItem = rItemSet.GetItemIfSet( RES_FRM_SIZE )) &&
665 ( (nFrameOpts & HtmlFrmOpts::AnySize) ||
667 {
668 sal_uInt8 nPercentWidth = pFSItem->GetWidthPercent();
669 sal_uInt8 nPercentHeight = pFSItem->GetHeightPercent();
670
671 // Size of the object in Twips without margins
672 Size aTwipSz( (nPercentWidth ? 0
673 : pFSItem->GetWidth()-aTwipSpc.Width()),
674 (nPercentHeight ? 0
675 : pFSItem->GetHeight()-aTwipSpc.Height()) );
676
677 OSL_ENSURE( aTwipSz.Width() >= 0 && aTwipSz.Height() >= 0, "Frame size minus spacing < 0!!!???" );
678 if( aTwipSz.Width() < 0 )
679 aTwipSz.setWidth( 0 );
680 if( aTwipSz.Height() < 0 )
681 aTwipSz.setHeight( 0 );
682
683 Size aPixelSz( 0, 0 );
684 if( (aTwipSz.Width() || aTwipSz.Height()) &&
686 {
687 aPixelSz =
689 MapMode(MapUnit::MapTwip) );
690 if( !aPixelSz.Width() && aTwipSz.Width() )
691 aPixelSz.setWidth( 1 );
692 if( !aPixelSz.Height() && aTwipSz.Height() )
693 aPixelSz.setHeight( 1 );
694 }
695
696 if( (nFrameOpts & HtmlFrmOpts::Width) &&
697 ((nPercentWidth && nPercentWidth!=255) || aPixelSz.Width()) )
698 {
699 sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_width "=\"");
700 if( nPercentWidth )
701 sOut.append(static_cast<sal_Int32>(nPercentWidth)).append('%');
702 else
703 sOut.append(static_cast<sal_Int32>(aPixelSz.Width()));
704 sOut.append("\"");
705 }
706
707 if( (nFrameOpts & HtmlFrmOpts::Height) &&
708 ((nPercentHeight && nPercentHeight!=255) || aPixelSz.Height()) )
709 {
710 sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_height "=\"");
711 if( nPercentHeight )
712 sOut.append(static_cast<sal_Int32>(nPercentHeight)).append('%');
713 else
714 sOut.append(static_cast<sal_Int32>(aPixelSz.Height()));
715 sOut.append("\"");
716 }
717 }
718
719 if (!sOut.isEmpty())
720 {
721 Strm().WriteOString( sOut );
722 sOut.setLength(0);
723 }
724
725 // Insert wrap for graphics that are anchored to a paragraph as
726 // <BR CLEAR=...> in the string
727 const SwFormatSurround* pSurround;
728 if( (nFrameOpts & HtmlFrmOpts::BrClear) &&
729 ((RndStdIds::FLY_AT_PARA == rFrameFormat.GetAnchor().GetAnchorId()) ||
730 (RndStdIds::FLY_AT_CHAR == rFrameFormat.GetAnchor().GetAnchorId())) &&
731 (pSurround = rItemSet.GetItemIfSet( RES_SURROUND )) )
732 {
733 sal_Int16 eHoriOri = rFrameFormat.GetHoriOrient().GetHoriOrient();
734 pStr = nullptr;
735 css::text::WrapTextMode eSurround = pSurround->GetSurround();
736 bool bAnchorOnly = pSurround->IsAnchorOnly();
737 switch( eHoriOri )
738 {
739 case text::HoriOrientation::RIGHT:
740 {
741 switch( eSurround )
742 {
743 case css::text::WrapTextMode_NONE:
744 case css::text::WrapTextMode_RIGHT:
746 break;
747 case css::text::WrapTextMode_LEFT:
748 case css::text::WrapTextMode_PARALLEL:
749 if( bAnchorOnly )
750 m_bClearRight = true;
751 break;
752 default:
753 ;
754 }
755 }
756 break;
757
758 default:
759 // If a frame is centered, it gets left aligned. This
760 // should be taken into account here, too.
761 {
762 switch( eSurround )
763 {
764 case css::text::WrapTextMode_NONE:
765 case css::text::WrapTextMode_LEFT:
767 break;
768 case css::text::WrapTextMode_RIGHT:
769 case css::text::WrapTextMode_PARALLEL:
770 if( bAnchorOnly )
771 m_bClearLeft = true;
772 break;
773 default:
774 ;
775 }
776 }
777 break;
778
779 }
780
781 if( pStr )
782 {
785 "=\"" + OString::Concat(pStr) + "\">");
786 sRetEndTags = sOut.makeStringAndClear();
787 }
788 }
789 return sRetEndTags;
790}
791
792void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameFormat& rFrameFormat, std::u16string_view rAlternateText, HtmlFrmOpts nFrameOptions)
793{
794 bool bReplacement = (nFrameOptions & HtmlFrmOpts::Replacement) || mbReqIF;
795 const SfxItemSet& rItemSet = rFrameFormat.GetAttrSet();
796
797 // Name
798 if( (nFrameOptions & (HtmlFrmOpts::Id|HtmlFrmOpts::Name)) &&
799 !rFrameFormat.GetName().isEmpty() && !bReplacement)
800 {
801 const char* pAttributeName = (nFrameOptions & HtmlFrmOpts::Id) ? OOO_STRING_SVTOOLS_HTML_O_id : OOO_STRING_SVTOOLS_HTML_O_name;
802 aHtml.attribute(pAttributeName, rFrameFormat.GetName());
803 }
804
805 // Name
806 if (nFrameOptions & HtmlFrmOpts::Dir)
807 {
808 SvxFrameDirection nCurrentDirection = GetHTMLDirection(rItemSet);
809 OString sDirection = convertDirection(nCurrentDirection);
810 aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_dir, sDirection);
811 }
812
813 // alt
814 if( (nFrameOptions & HtmlFrmOpts::Alt) && !rAlternateText.empty() && !bReplacement )
815 {
816 aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_alt, rAlternateText);
817 }
818
819 // align
820 const char* pAlignString = nullptr;
821 RndStdIds eAnchorId = rFrameFormat.GetAnchor().GetAnchorId();
822 if( (nFrameOptions & HtmlFrmOpts::Align) &&
823 ((RndStdIds::FLY_AT_PARA == eAnchorId) || (RndStdIds::FLY_AT_CHAR == eAnchorId)) && !bReplacement)
824 {
825 const SwFormatHoriOrient& rHoriOri = rFrameFormat.GetHoriOrient();
826 if( !(nFrameOptions & HtmlFrmOpts::SAlign) ||
827 text::RelOrientation::FRAME == rHoriOri.GetRelationOrient() ||
828 text::RelOrientation::PRINT_AREA == rHoriOri.GetRelationOrient() )
829 {
830 pAlignString = text::HoriOrientation::RIGHT == rHoriOri.GetHoriOrient()
833 }
834 }
835 const SwFormatVertOrient* pVertOrient;
836 if( (nFrameOptions & HtmlFrmOpts::Align) && !pAlignString &&
837 ( !(nFrameOptions & HtmlFrmOpts::SAlign) ||
838 (RndStdIds::FLY_AS_CHAR == eAnchorId) ) &&
839 (pVertOrient = rItemSet.GetItemIfSet( RES_VERT_ORIENT )) )
840 {
841 switch( pVertOrient->GetVertOrient() )
842 {
843 case text::VertOrientation::LINE_TOP: pAlignString = OOO_STRING_SVTOOLS_HTML_VA_top; break;
844 case text::VertOrientation::CHAR_TOP:
845 case text::VertOrientation::BOTTOM: pAlignString = OOO_STRING_SVTOOLS_HTML_VA_texttop; break;
846 case text::VertOrientation::LINE_CENTER:
847 case text::VertOrientation::CHAR_CENTER: pAlignString = OOO_STRING_SVTOOLS_HTML_VA_absmiddle; break;
848 case text::VertOrientation::CENTER: pAlignString = OOO_STRING_SVTOOLS_HTML_VA_middle; break;
849 case text::VertOrientation::LINE_BOTTOM:
850 case text::VertOrientation::CHAR_BOTTOM: pAlignString = OOO_STRING_SVTOOLS_HTML_VA_absbottom; break;
851 case text::VertOrientation::TOP: pAlignString = OOO_STRING_SVTOOLS_HTML_VA_bottom; break;
852 case text::VertOrientation::NONE: break;
853 }
854 }
855 if (pAlignString && !bReplacement)
856 {
857 aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_align, pAlignString);
858 }
859
860 // hspace and vspace
861 Size aTwipSpc( 0, 0 );
862 const SvxLRSpaceItem* pLRSpaceItem;
863 if( (nFrameOptions & (HtmlFrmOpts::Space | HtmlFrmOpts::MarginSize)) &&
864 (pLRSpaceItem = rItemSet.GetItemIfSet( RES_LR_SPACE )) )
865 {
866 aTwipSpc.setWidth(
867 ( pLRSpaceItem->GetLeft() + pLRSpaceItem->GetRight() ) / 2 );
869 }
870 const SvxULSpaceItem* pULSpaceItem;
871 if( (nFrameOptions & (HtmlFrmOpts::Space|HtmlFrmOpts::MarginSize)) &&
872 (pULSpaceItem = rItemSet.GetItemIfSet( RES_UL_SPACE )) )
873 {
874 aTwipSpc.setHeight(
875 ( pULSpaceItem->GetUpper() + pULSpaceItem->GetLower() ) / 2 );
876 m_nDfltTopMargin = m_nDfltBottomMargin = o3tl::narrowing<sal_uInt16>(aTwipSpc.Height());
877 }
878
879 if( (nFrameOptions & HtmlFrmOpts::Space) &&
880 (aTwipSpc.Width() || aTwipSpc.Height()) &&
882 !mbReqIF )
883 {
884 Size aPixelSpc =
886 MapMode(MapUnit::MapTwip) );
887 if( !aPixelSpc.Width() && aTwipSpc.Width() )
888 aPixelSpc.setWidth( 1 );
889 if( !aPixelSpc.Height() && aTwipSpc.Height() )
890 aPixelSpc.setHeight( 1 );
891
892 if (aPixelSpc.Width())
893 {
894 aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_hspace, static_cast<sal_Int32>(aPixelSpc.Width()));
895 }
896
897 if (aPixelSpc.Height())
898 {
899 aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_vspace, static_cast<sal_Int32>(aPixelSpc.Height()));
900 }
901 }
902
903 // The spacing must be considered for the size, if the corresponding flag
904 // is set.
905 if( nFrameOptions & HtmlFrmOpts::MarginSize )
906 {
907 aTwipSpc.setWidth( aTwipSpc.Width() * -2 );
908 aTwipSpc.setHeight( aTwipSpc.Height() * -2 );
909 }
910 else
911 {
912 aTwipSpc.setWidth( 0 );
913 aTwipSpc.setHeight( 0 );
914 }
915
916 const SvxBoxItem* pBoxItem;
917 if( !(nFrameOptions & HtmlFrmOpts::AbsSize) &&
918 (pBoxItem = rItemSet.GetItemIfSet( RES_BOX )) )
919 {
920 aTwipSpc.AdjustWidth(pBoxItem->CalcLineSpace( SvxBoxItemLine::LEFT ) );
921 aTwipSpc.AdjustWidth(pBoxItem->CalcLineSpace( SvxBoxItemLine::RIGHT ) );
922 aTwipSpc.AdjustHeight(pBoxItem->CalcLineSpace( SvxBoxItemLine::TOP ) );
923 aTwipSpc.AdjustHeight(pBoxItem->CalcLineSpace( SvxBoxItemLine::BOTTOM ) );
924 }
925
926 // "width" and/or "height"
927 // Only output SwFrameSize::Variable/SwFrameSize::Minimum if ANYSIZE is set
928 std::optional<SwFormatFrameSize> aFrameSize;
929 const SwFormatFrameSize* pFSItem = rItemSet.GetItemIfSet( RES_FRM_SIZE );
930 const SdrObject* pObject;
931 if (!pFSItem && (pObject = rFrameFormat.FindSdrObject()))
932 {
933 // Write size for Draw shapes as well.
934 const tools::Rectangle& rSnapRect = pObject->GetSnapRect();
935 aFrameSize.emplace();
936 aFrameSize->SetWidthSizeType(SwFrameSize::Fixed);
937 aFrameSize->SetWidth(rSnapRect.getOpenWidth());
938 aFrameSize->SetHeightSizeType(SwFrameSize::Fixed);
939 aFrameSize->SetHeight(rSnapRect.getOpenHeight());
940 pFSItem = &*aFrameSize;
941 }
942 if( (nFrameOptions & HtmlFrmOpts::Size) &&
943 pFSItem &&
944 ( (nFrameOptions & HtmlFrmOpts::AnySize) ||
946 {
947 sal_uInt8 nPercentWidth = pFSItem->GetWidthPercent();
948 sal_uInt8 nPercentHeight = pFSItem->GetHeightPercent();
949
950 // Size of the object in Twips without margins
951 Size aTwipSz( (nPercentWidth && nPercentWidth != 255 ? 0
952 : pFSItem->GetWidth()-aTwipSpc.Width()),
953 (nPercentHeight && nPercentHeight != 255 ? 0
954 : pFSItem->GetHeight()-aTwipSpc.Height()) );
955
956 OSL_ENSURE( aTwipSz.Width() >= 0 && aTwipSz.Height() >= 0, "Frame size minus spacing < 0!!!???" );
957 if( aTwipSz.Width() < 0 )
958 aTwipSz.setWidth( 0 );
959 if( aTwipSz.Height() < 0 )
960 aTwipSz.setHeight( 0 );
961
962 Size aPixelSz( 0, 0 );
963 if( (aTwipSz.Width() || aTwipSz.Height()) &&
965 {
966 aPixelSz =
968 MapMode(MapUnit::MapTwip) );
969 if( !aPixelSz.Width() && aTwipSz.Width() )
970 aPixelSz.setWidth( 1 );
971 if( !aPixelSz.Height() && aTwipSz.Height() )
972 aPixelSz.setHeight( 1 );
973 }
974
975 if( (nFrameOptions & HtmlFrmOpts::Width) &&
976 ((nPercentWidth && nPercentWidth!=255) || aPixelSz.Width()) )
977 {
978 OString sWidth;
979 if (nPercentWidth)
980 {
981 if (nPercentWidth == 255)
982 {
983 if (nPercentHeight)
984 {
985 sWidth = "auto";
986 }
987 else
988 {
989 sWidth = OString::number(static_cast<sal_Int32>(aPixelSz.Width()));
990 }
991 }
992 else
993 {
994 sWidth = OString::number(static_cast<sal_Int32>(nPercentWidth)) + "%";
995 }
996 }
997 else
998 sWidth = OString::number(static_cast<sal_Int32>(aPixelSz.Width()));
999 if (!mbXHTML || sWidth != "auto")
1000 {
1002 }
1003 }
1004
1005 if( (nFrameOptions & HtmlFrmOpts::Height) &&
1006 ((nPercentHeight && nPercentHeight!=255) || aPixelSz.Height()) )
1007 {
1008 OString sHeight;
1009 if (nPercentHeight)
1010 {
1011 if (nPercentHeight == 255)
1012 {
1013 if (nPercentWidth)
1014 {
1015 sHeight = "auto";
1016 }
1017 else
1018 {
1019 sHeight = OString::number(static_cast<sal_Int32>(aPixelSz.Height()));
1020 }
1021 }
1022 else
1023 {
1024 sHeight = OString::number(static_cast<sal_Int32>(nPercentHeight)) + "%";
1025 }
1026 }
1027 else
1028 sHeight = OString::number(static_cast<sal_Int32>(aPixelSz.Height()));
1029 if (!mbXHTML || sHeight != "auto")
1030 {
1032 }
1033 }
1034 }
1035
1036 // Insert wrap for graphics that are anchored to a paragraph as
1037 // <BR CLEAR=...> in the string
1038
1039 if( !(nFrameOptions & HtmlFrmOpts::BrClear) )
1040 return;
1041 RndStdIds nAnchorId = rFrameFormat.GetAnchor().GetAnchorId();
1042 if (RndStdIds::FLY_AT_PARA != nAnchorId && RndStdIds::FLY_AT_CHAR != nAnchorId)
1043 return;
1044 const SwFormatSurround* pSurround = rItemSet.GetItemIfSet( RES_SURROUND );
1045 if (!pSurround)
1046 return;
1047
1048 const char* pSurroundString = nullptr;
1049
1050 sal_Int16 eHoriOri = rFrameFormat.GetHoriOrient().GetHoriOrient();
1051 css::text::WrapTextMode eSurround = pSurround->GetSurround();
1052 bool bAnchorOnly = pSurround->IsAnchorOnly();
1053 switch( eHoriOri )
1054 {
1055 case text::HoriOrientation::RIGHT:
1056 {
1057 switch( eSurround )
1058 {
1059 case css::text::WrapTextMode_NONE:
1060 case css::text::WrapTextMode_RIGHT:
1061 pSurroundString = OOO_STRING_SVTOOLS_HTML_AL_right;
1062 break;
1063 case css::text::WrapTextMode_LEFT:
1064 case css::text::WrapTextMode_PARALLEL:
1065 if( bAnchorOnly )
1066 m_bClearRight = true;
1067 break;
1068 default:
1069 ;
1070 }
1071 }
1072 break;
1073
1074 default:
1075 // If a frame is centered, it gets left aligned. This
1076 // should be taken into account here, too.
1077 {
1078 switch( eSurround )
1079 {
1080 case css::text::WrapTextMode_NONE:
1081 case css::text::WrapTextMode_LEFT:
1082 pSurroundString = OOO_STRING_SVTOOLS_HTML_AL_left;
1083 break;
1084 case css::text::WrapTextMode_RIGHT:
1085 case css::text::WrapTextMode_PARALLEL:
1086 if( bAnchorOnly )
1087 m_bClearLeft = true;
1088 break;
1089 default:
1090 break;
1091 }
1092 }
1093 break;
1094 }
1095
1096 if (pSurroundString)
1097 {
1099 aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_clear, pSurroundString);
1100 aHtml.end();
1101 }
1102}
1103
1104namespace
1105{
1106
1107OUString lclWriteOutImap(SwHTMLWriter& rHTMLWrt, const SfxItemSet& rItemSet, const SwFrameFormat& rFrameFormat,
1108 const Size& rRealSize, const ImageMap* pAltImgMap, const SwFormatURL*& pURLItem)
1109{
1110 OUString aIMapName;
1111
1112 // Only consider the URL attribute if no ImageMap was supplied
1113 if (!pAltImgMap)
1114 pURLItem = rItemSet.GetItemIfSet( RES_URL );
1115
1116 // write ImageMap
1117 const ImageMap* pIMap = pAltImgMap;
1118 if( !pIMap && pURLItem )
1119 {
1120 pIMap = pURLItem->GetMap();
1121 }
1122
1123 if (pIMap)
1124 {
1125 // make the name unique
1126 aIMapName = pIMap->GetName();
1127 OUString aNameBase;
1128 if (!aIMapName.isEmpty())
1129 aNameBase = aIMapName;
1130 else
1131 aNameBase = OOO_STRING_SVTOOLS_HTML_map;
1132
1133 if (aIMapName.isEmpty())
1134 aIMapName = aNameBase + OUString::number(rHTMLWrt.m_nImgMapCnt);
1135
1136 bool bFound;
1137 do
1138 {
1139 bFound = false;
1140 for (const OUString & rImgMapName : rHTMLWrt.m_aImgMapNames)
1141 {
1142 // TODO: Unicode: Comparison is case insensitive for ASCII
1143 // characters only now!
1144 if (aIMapName.equalsIgnoreAsciiCase(rImgMapName))
1145 {
1146 bFound = true;
1147 break;
1148 }
1149 }
1150 if (bFound)
1151 {
1152 rHTMLWrt.m_nImgMapCnt++;
1153 aIMapName = aNameBase + OUString::number( rHTMLWrt.m_nImgMapCnt );
1154 }
1155 } while (bFound);
1156
1157 bool bScale = false;
1158 Fraction aScaleX(1, 1);
1159 Fraction aScaleY(1, 1);
1160
1161 const SwFormatFrameSize& rFrameSize = rFrameFormat.GetFrameSize();
1162 const SvxBoxItem& rBox = rFrameFormat.GetBox();
1163
1164 if (!rFrameSize.GetWidthPercent() && rRealSize.Width())
1165 {
1166 SwTwips nWidth = rFrameSize.GetWidth();
1167 nWidth -= rBox.CalcLineSpace(SvxBoxItemLine::LEFT) + rBox.CalcLineSpace(SvxBoxItemLine::RIGHT);
1168
1169 OSL_ENSURE( nWidth > 0, "Are there any graphics that are 0 twip wide!?" );
1170 if (nWidth <= 0) // should not happen
1171 nWidth = 1;
1172
1173 if (rRealSize.Width() != nWidth)
1174 {
1175 aScaleX = Fraction(nWidth, rRealSize.Width());
1176 bScale = true;
1177 }
1178 }
1179
1180 if (!rFrameSize.GetHeightPercent() && rRealSize.Height())
1181 {
1182 SwTwips nHeight = rFrameSize.GetHeight();
1183
1184 nHeight -= rBox.CalcLineSpace(SvxBoxItemLine::TOP) + rBox.CalcLineSpace(SvxBoxItemLine::BOTTOM);
1185
1186 OSL_ENSURE( nHeight > 0, "Are there any graphics that are 0 twip high!?" );
1187 if (nHeight <= 0)
1188 nHeight = 1;
1189
1190 if (rRealSize.Height() != nHeight)
1191 {
1192 aScaleY = Fraction(nHeight, rRealSize.Height());
1193 bScale = true;
1194 }
1195 }
1196
1197 rHTMLWrt.m_aImgMapNames.push_back(aIMapName);
1198
1199 OString aIndMap, aIndArea;
1200 const char *pIndArea = nullptr, *pIndMap = nullptr;
1201
1202 if (rHTMLWrt.m_bLFPossible)
1203 {
1204 rHTMLWrt.OutNewLine( true );
1205 aIndMap = rHTMLWrt.GetIndentString();
1206 aIndArea = rHTMLWrt.GetIndentString(1);
1207 pIndArea = aIndArea.getStr();
1208 pIndMap = aIndMap.getStr();
1209 }
1210
1211 if (bScale)
1212 {
1213 ImageMap aScaledIMap(*pIMap);
1214 aScaledIMap.Scale(aScaleX, aScaleY);
1215 HTMLOutFuncs::Out_ImageMap( rHTMLWrt.Strm(), rHTMLWrt.GetBaseURL(), aScaledIMap, aIMapName,
1217 rHTMLWrt.m_bCfgStarBasic,
1218 SAL_NEWLINE_STRING, pIndArea, pIndMap );
1219 }
1220 else
1221 {
1222 HTMLOutFuncs::Out_ImageMap( rHTMLWrt.Strm(), rHTMLWrt.GetBaseURL(), *pIMap, aIMapName,
1224 rHTMLWrt.m_bCfgStarBasic,
1225 SAL_NEWLINE_STRING, pIndArea, pIndMap );
1226 }
1227 }
1228 return aIMapName;
1229}
1230
1231}
1232
1233Writer& OutHTML_ImageStart( HtmlWriter& rHtml, Writer& rWrt, const SwFrameFormat &rFrameFormat,
1234 const OUString& rGraphicURL,
1235 Graphic const & rGraphic, const OUString& rAlternateText,
1236 const Size &rRealSize, HtmlFrmOpts nFrameOpts,
1237 const char *pMarkType,
1238 const ImageMap *pAltImgMap,
1239 const OUString& rMimeType )
1240{
1241 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
1242 // <object data="..."> instead of <img src="...">
1243 bool bReplacement = (nFrameOpts & HtmlFrmOpts::Replacement) || rHTMLWrt.mbReqIF;
1244
1245 if (rHTMLWrt.mbSkipImages)
1246 return rHTMLWrt;
1247
1248 // if necessary, temporarily close an open attribute
1249 if( !rHTMLWrt.m_aINetFormats.empty() )
1250 {
1251 SwFormatINetFormat* pINetFormat = rHTMLWrt.m_aINetFormats.back();
1252 OutHTML_INetFormat( rWrt, *pINetFormat, false );
1253 }
1254
1255 OUString aGraphicURL( rGraphicURL );
1256 if( !rHTMLWrt.mbEmbedImages && !HTMLOutFuncs::PrivateURLToInternalImg(aGraphicURL) && !rHTMLWrt.mpTempBaseURL )
1257 aGraphicURL = URIHelper::simpleNormalizedMakeRelative( rWrt.GetBaseURL(), aGraphicURL);
1258
1259 const SfxItemSet& rItemSet = rFrameFormat.GetAttrSet();
1260
1261 const SwFormatURL* pURLItem = nullptr;
1262 OUString aIMapName = lclWriteOutImap(rHTMLWrt, rItemSet, rFrameFormat, rRealSize, pAltImgMap, pURLItem);
1263
1264 // put img into new line
1265 if( rHTMLWrt.m_bLFPossible )
1266 rHTMLWrt.OutNewLine( true );
1267
1268 // <a name=...></a>...<img ...>
1269 if( pMarkType && !rFrameFormat.GetName().isEmpty() )
1270 {
1271 rHTMLWrt.OutImplicitMark( rFrameFormat.GetName(), pMarkType );
1272 }
1273
1274 // URL -> <a>...<img ... >...</a>
1275 const SvxMacroItem *pMacItem = rItemSet.GetItemIfSet(RES_FRMMACRO);
1276
1277 if (pURLItem || pMacItem)
1278 {
1279 OUString aMapURL;
1280 OUString aName;
1281 OUString aTarget;
1282
1283 if(pURLItem)
1284 {
1285 aMapURL = pURLItem->GetURL();
1286 aName = pURLItem->GetName();
1287 aTarget = pURLItem->GetTargetFrameName();
1288 }
1289
1290 bool bEvents = pMacItem && !pMacItem->GetMacroTable().empty();
1291
1292 if( !aMapURL.isEmpty() || !aName.isEmpty() || !aTarget.isEmpty() || bEvents )
1293 {
1295
1296 // Output "href" element if a link or macro exists
1297 if( !aMapURL.isEmpty() || bEvents )
1298 {
1299 rHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_href, OUStringToOString(rHTMLWrt.convertHyperlinkHRefValue(aMapURL), RTL_TEXTENCODING_UTF8));
1300 }
1301
1302 if( !aName.isEmpty() )
1303 {
1304 rHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_name, OUStringToOString(aName, RTL_TEXTENCODING_UTF8));
1305 }
1306
1307 if( !aTarget.isEmpty() )
1308 {
1309 rHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_target, OUStringToOString(aTarget, RTL_TEXTENCODING_UTF8));
1310 }
1311
1312 if( pMacItem )
1313 {
1314 const SvxMacroTableDtor& rMacTable = pMacItem->GetMacroTable();
1315 if (!rMacTable.empty())
1316 {
1318 }
1319 }
1320 }
1321 }
1322
1323 // <font color = ...>...<img ... >...</font>
1324 sal_uInt16 nBorderWidth = 0;
1325 const SvxBoxItem* pBoxItem;
1326 if( (nFrameOpts & HtmlFrmOpts::Border) &&
1327 (pBoxItem = rItemSet.GetItemIfSet( RES_BOX )) )
1328 {
1329 Size aTwipBorder( 0, 0 );
1330 const ::editeng::SvxBorderLine *pColBorderLine = nullptr;
1331 const ::editeng::SvxBorderLine *pBorderLine = pBoxItem->GetLeft();
1332 if( pBorderLine )
1333 {
1334 pColBorderLine = pBorderLine;
1335 aTwipBorder.AdjustWidth(pBorderLine->GetOutWidth() );
1336 }
1337
1338 pBorderLine = pBoxItem->GetRight();
1339 if( pBorderLine )
1340 {
1341 pColBorderLine = pBorderLine;
1342 aTwipBorder.AdjustWidth(pBorderLine->GetOutWidth() );
1343 }
1344
1345 pBorderLine = pBoxItem->GetTop();
1346 if( pBorderLine )
1347 {
1348 pColBorderLine = pBorderLine;
1349 aTwipBorder.AdjustHeight(pBorderLine->GetOutWidth() );
1350 }
1351
1352 pBorderLine = pBoxItem->GetBottom();
1353 if( pBorderLine )
1354 {
1355 pColBorderLine = pBorderLine;
1356 aTwipBorder.AdjustHeight(pBorderLine->GetOutWidth() );
1357 }
1358
1359 aTwipBorder.setWidth( aTwipBorder.Width() / 2 );
1360 aTwipBorder.setHeight( aTwipBorder.Height() / 2 );
1361
1362 if( (aTwipBorder.Width() || aTwipBorder.Height()) &&
1364 {
1365 Size aPixelBorder =
1367 MapMode(MapUnit::MapTwip) );
1368 if( !aPixelBorder.Width() && aTwipBorder.Width() )
1369 aPixelBorder.setWidth( 1 );
1370 if( !aPixelBorder.Height() && aTwipBorder.Height() )
1371 aPixelBorder.setHeight( 1 );
1372
1373 if( aPixelBorder.Width() )
1374 aPixelBorder.setHeight( 0 );
1375
1376 nBorderWidth =
1377 o3tl::narrowing<sal_uInt16>(aPixelBorder.Width() + aPixelBorder.Height());
1378 }
1379
1380 if( pColBorderLine )
1381 {
1383 HtmlWriterHelper::applyColor(rHtml, OOO_STRING_SVTOOLS_HTML_O_color, pColBorderLine->GetColor());
1384 }
1385 }
1386
1387 OString aTag(OOO_STRING_SVTOOLS_HTML_image);
1388 if (bReplacement)
1389 // Write replacement graphic of OLE object as <object>.
1391 rHtml.start(aTag);
1392
1393 OStringBuffer sBuffer;
1394 if(rHTMLWrt.mbEmbedImages)
1395 {
1396 OUString aGraphicInBase64;
1397 if (XOutBitmap::GraphicToBase64(rGraphic, aGraphicInBase64))
1398 {
1399 sBuffer.append(OOO_STRING_SVTOOLS_HTML_O_data);
1400 sBuffer.append(":");
1401 sBuffer.append(OUStringToOString(aGraphicInBase64, RTL_TEXTENCODING_UTF8));
1402 rHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_src, sBuffer.makeStringAndClear().getStr());
1403 }
1404 else
1405 rHTMLWrt.m_nWarn = WARN_SWG_POOR_LOAD;
1406 }
1407 else
1408 {
1409 sBuffer.append(OUStringToOString(aGraphicURL, RTL_TEXTENCODING_UTF8));
1410 OString aAttribute(OOO_STRING_SVTOOLS_HTML_O_src);
1411 if (bReplacement)
1412 aAttribute = OOO_STRING_SVTOOLS_HTML_O_data;
1413 rHtml.attribute(aAttribute, sBuffer.makeStringAndClear().getStr());
1414 }
1415
1416 if (bReplacement)
1417 {
1418 // Handle XHTML type attribute for OLE replacement images.
1419 if (!rMimeType.isEmpty())
1420 rHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_type, rMimeType.toUtf8());
1421 }
1422
1423 // Events
1424 if (const SvxMacroItem* pMacroItem = rItemSet.GetItemIfSet(RES_FRMMACRO))
1425 {
1426 const SvxMacroTableDtor& rMacTable = pMacroItem->GetMacroTable();
1427 if (!rMacTable.empty())
1428 {
1430 }
1431 }
1432
1433 // alt, align, width, height, hspace, vspace
1434 rHTMLWrt.writeFrameFormatOptions(rHtml, rFrameFormat, rAlternateText, nFrameOpts);
1435 if( rHTMLWrt.IsHTMLMode( HTMLMODE_ABS_POS_FLY ) )
1436 rHTMLWrt.OutCSS1_FrameFormatOptions( rFrameFormat, nFrameOpts );
1437
1438 if ((nFrameOpts & HtmlFrmOpts::Border) && !bReplacement)
1439 {
1441 }
1442
1443 if( pURLItem && pURLItem->IsServerMap() )
1444 {
1446 }
1447
1448 if( !aIMapName.isEmpty() )
1449 {
1450 rHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_usemap, Concat2View("#" + aIMapName));
1451 }
1452
1453 if (bReplacement)
1454 {
1455 // XHTML object replacement image's alternate text doesn't use the
1456 // "alt" attribute.
1457 if (rAlternateText.isEmpty())
1458 // Empty alternate text is not valid.
1459 rHtml.characters(" ");
1460 else
1461 rHtml.characters(rAlternateText.toUtf8());
1462 }
1463
1464 return rHTMLWrt;
1465}
1466
1468{
1469 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
1470 rHtml.flushStack();
1471
1472 if( !rHTMLWrt.m_aINetFormats.empty() )
1473 {
1474 // There is still an attribute on the stack that has to be reopened
1475 SwFormatINetFormat *pINetFormat = rHTMLWrt.m_aINetFormats.back();
1476 OutHTML_INetFormat( rWrt, *pINetFormat, true );
1477 }
1478
1479 return rHTMLWrt;
1480}
1481
1483 const char *pTag,
1484 const SvxBrushItem* pBrush,
1485 const OUString &rGraphicURL)
1486{
1487 SwHTMLWriter & rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
1488
1489 OUString aGraphicInBase64;
1490 OUString aLink;
1491 if( pBrush )
1492 {
1493 aLink = pBrush->GetGraphicLink();
1494 if(rHTMLWrt.mbEmbedImages || aLink.isEmpty())
1495 {
1496 const Graphic* pGrf = pBrush->GetGraphic();
1497 if( pGrf )
1498 {
1499 if( !XOutBitmap::GraphicToBase64(*pGrf, aGraphicInBase64) )
1500 {
1501 rHTMLWrt.m_nWarn = WARN_SWG_POOR_LOAD;
1502 }
1503 }
1504 }
1505 else if(!aLink.isEmpty())
1506 {
1507 if( rHTMLWrt.m_bCfgCpyLinkedGrfs )
1508 {
1509 rHTMLWrt.CopyLocalFileToINet( aLink );
1510 }
1511
1512 }
1513 }
1514 else if(!rHTMLWrt.mbEmbedImages)
1515 {
1516 aLink = rGraphicURL;
1517 }
1518 if(!aLink.isEmpty())
1519 {
1522 }
1523
1524 OStringBuffer sOut;
1525 if( pTag )
1526 sOut.append('<').append(pTag);
1527
1528 sOut.append(' ');
1529 sOut.append(OOO_STRING_SVTOOLS_HTML_O_style "=\"");
1530 if(!aLink.isEmpty())
1531 {
1532 sOut.append(OOO_STRING_SVTOOLS_HTML_O_src "=\"");
1533 rWrt.Strm().WriteOString( sOut );
1534 sOut.setLength(0);
1535 HTMLOutFuncs::Out_String( rWrt.Strm(), aLink );
1536 }
1537 else
1538 {
1539 sOut.append("list-style-image: url("
1541 rWrt.Strm().WriteOString( sOut );
1542 sOut.setLength(0);
1543 HTMLOutFuncs::Out_String( rWrt.Strm(), aGraphicInBase64 );
1544 sOut.append(");");
1545 }
1546 sOut.append('\"');
1547
1548 if (pTag)
1549 sOut.append('>');
1550 rWrt.Strm().WriteOString( sOut );
1551
1552 return rWrt;
1553}
1554
1555static Writer& OutHTML_FrameFormatTableNode( Writer& rWrt, const SwFrameFormat& rFrameFormat )
1556{
1557 SwHTMLWriter & rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
1558
1559 const SwFormatContent& rFlyContent = rFrameFormat.GetContent();
1560 SwNodeOffset nStt = rFlyContent.GetContentIdx()->GetIndex()+1;
1561 SwNodeOffset nEnd = rHTMLWrt.m_pDoc->GetNodes()[nStt-1]->EndOfSectionIndex();
1562
1563 OUString aCaption;
1564 bool bTopCaption = false;
1565
1566 // Not const, because GetTable won't be const sometime later
1567 SwNode *pNd = rHTMLWrt.m_pDoc->GetNodes()[ nStt ];
1568 SwTableNode *pTableNd = pNd->GetTableNode();
1569 const SwTextNode *pTextNd = pNd->GetTextNode();
1570 if( !pTableNd && pTextNd )
1571 {
1572 // Table with heading
1573 bTopCaption = true;
1574 pTableNd = rHTMLWrt.m_pDoc->GetNodes()[nStt+1]->GetTableNode();
1575 }
1576 OSL_ENSURE( pTableNd, "Frame does not contain a table" );
1577 if( pTableNd )
1578 {
1579 SwNodeOffset nTableEnd = pTableNd->EndOfSectionIndex();
1580 OSL_ENSURE( nTableEnd == nEnd - 1 ||
1581 (nTableEnd == nEnd - 2 && !bTopCaption),
1582 "Invalid frame content for a table" );
1583
1584 if( nTableEnd == nEnd - 2 )
1585 pTextNd = rHTMLWrt.m_pDoc->GetNodes()[nTableEnd+1]->GetTextNode();
1586 }
1587 if( pTextNd )
1588 aCaption = pTextNd->GetText();
1589
1590 if( pTableNd )
1591 {
1592 HTMLSaveData aSaveData( rHTMLWrt, pTableNd->GetIndex()+1,
1593 pTableNd->EndOfSectionIndex(),
1594 true, &rFrameFormat );
1595 rHTMLWrt.m_bOutFlyFrame = true;
1596 OutHTML_SwTableNode( rHTMLWrt, *pTableNd, &rFrameFormat, &aCaption,
1597 bTopCaption );
1598 }
1599
1600 return rWrt;
1601}
1602
1604 const SwFrameFormat& rFrameFormat,
1605 bool bInCntnr )
1606{
1607 SwHTMLWriter & rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
1608
1609 rHTMLWrt.ChangeParaToken( HtmlTokenId::NONE );
1610
1611 // Close the current <DL>!
1612 rHTMLWrt.OutAndSetDefList( 0 );
1613
1614 // output as Multicol
1615 if( rHTMLWrt.m_bLFPossible )
1616 rHTMLWrt.OutNewLine();
1617
1618 OStringBuffer sOut;
1619 sOut.append('<').append(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_multicol);
1620
1621 const SwFormatCol& rFormatCol = rFrameFormat.GetCol();
1622
1623 // output the number of columns as COLS
1624 sal_uInt16 nCols = rFormatCol.GetNumCols();
1625 if( nCols )
1626 {
1627 sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_cols
1628 "=\"" + OString::number(nCols) + "\"");
1629 }
1630
1631 // the Gutter width (minimum value) as GUTTER
1632 sal_uInt16 nGutter = rFormatCol.GetGutterWidth( true );
1633 if( nGutter!=USHRT_MAX )
1634 {
1635 if( nGutter && Application::GetDefaultDevice() )
1636 {
1637 nGutter = o3tl::narrowing<sal_uInt16>(Application::GetDefaultDevice()
1638 ->LogicToPixel( Size(nGutter,0),
1639 MapMode(MapUnit::MapTwip) ).Width());
1640 }
1641 sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_gutter
1642 "=\"" + OString::number(nGutter) + "\"");
1643 }
1644
1645 rWrt.Strm().WriteOString( sOut );
1646 sOut.setLength(0);
1647
1648 // WIDTH
1649 HtmlFrmOpts nFrameFlags = HTML_FRMOPTS_MULTICOL;
1650 if( rHTMLWrt.IsHTMLMode( HTMLMODE_ABS_POS_FLY ) && !bInCntnr )
1651 nFrameFlags |= HTML_FRMOPTS_MULTICOL_CSS1;
1652 rHTMLWrt.OutFrameFormatOptions(rFrameFormat, OUString(), nFrameFlags);
1653 if( rHTMLWrt.IsHTMLMode( HTMLMODE_ABS_POS_FLY ) && !bInCntnr )
1654 rHTMLWrt.OutCSS1_FrameFormatOptions( rFrameFormat, nFrameFlags );
1655
1656 rWrt.Strm().WriteChar( '>' );
1657
1658 rHTMLWrt.m_bLFPossible = true;
1659 rHTMLWrt.IncIndentLevel(); // indent the content of Multicol
1660
1661 const SwFormatContent& rFlyContent = rFrameFormat.GetContent();
1662 SwNodeOffset nStt = rFlyContent.GetContentIdx()->GetIndex();
1663 const SwStartNode* pSttNd = rWrt.m_pDoc->GetNodes()[nStt]->GetStartNode();
1664 OSL_ENSURE( pSttNd, "Where is the start node" );
1665
1666 {
1667 // in a block, so that the old state can be restored in time
1668 // before the end
1669 HTMLSaveData aSaveData( rHTMLWrt, nStt+1,
1670 pSttNd->EndOfSectionIndex(),
1671 true, &rFrameFormat );
1672 rHTMLWrt.m_bOutFlyFrame = true;
1673 rHTMLWrt.Out_SwDoc( rWrt.m_pCurrentPam.get() );
1674 }
1675
1676 rHTMLWrt.DecIndentLevel(); // indent the content of Multicol;
1677 if( rHTMLWrt.m_bLFPossible )
1678 rHTMLWrt.OutNewLine();
1679 HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), Concat2View(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_multicol), false );
1680 rHTMLWrt.m_bLFPossible = true;
1681
1682 return rWrt;
1683}
1684
1685static Writer& OutHTML_FrameFormatAsSpacer( Writer& rWrt, const SwFrameFormat& rFrameFormat )
1686{
1687 SwHTMLWriter & rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
1688
1689 // if possible, output a line break before the graphic
1690 if( rHTMLWrt.m_bLFPossible )
1691 rHTMLWrt.OutNewLine( true );
1692
1693 OString sOut =
1694 "<" + rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_spacer " "
1697 rWrt.Strm().WriteOString( sOut );
1698
1699 // ALIGN, WIDTH, HEIGHT
1700 OString aEndTags = rHTMLWrt.OutFrameFormatOptions(rFrameFormat, OUString(), HTML_FRMOPTS_SPACER);
1701
1702 rWrt.Strm().WriteChar( '>' );
1703 if( !aEndTags.isEmpty() )
1704 rWrt.Strm().WriteOString( aEndTags );
1705
1706 return rWrt;
1707}
1708
1710 const SwFrameFormat& rFrameFormat, bool bSpan)
1711{
1712 SwHTMLWriter & rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
1713
1714 OString aTag;
1715 if( !bSpan )
1716 {
1717 rHTMLWrt.ChangeParaToken( HtmlTokenId::NONE );
1718
1719 // Close the current <DL>!
1720 rHTMLWrt.OutAndSetDefList( 0 );
1722 }
1723 else
1725
1726 // output as DIV
1727 if( rHTMLWrt.m_bLFPossible )
1728 rHTMLWrt.OutNewLine();
1729
1730 OStringBuffer sOut;
1731 sOut.append('<').append(rHTMLWrt.GetNamespace() + aTag);
1732
1733 rWrt.Strm().WriteOString( sOut );
1734 sOut.setLength(0);
1735 HtmlFrmOpts nFrameFlags = HTML_FRMOPTS_DIV;
1736 if( rHTMLWrt.IsHTMLMode( HTMLMODE_BORDER_NONE ) )
1737 nFrameFlags |= HtmlFrmOpts::SNoBorder;
1738 OString aEndTags = rHTMLWrt.OutFrameFormatOptions(rFrameFormat, OUString(), nFrameFlags);
1739 rHTMLWrt.OutCSS1_FrameFormatOptions( rFrameFormat, nFrameFlags );
1740 rWrt.Strm().WriteChar( '>' );
1741
1742 rHTMLWrt.IncIndentLevel(); // indent the content
1743 rHTMLWrt.m_bLFPossible = true;
1744
1745 const SwFormatContent& rFlyContent = rFrameFormat.GetContent();
1746 SwNodeOffset nStt = rFlyContent.GetContentIdx()->GetIndex();
1747
1748 // Output frame-anchored frames that are anchored to the start node
1749 rHTMLWrt.OutFlyFrame( nStt, 0, HtmlPosition::Any );
1750
1751 const SwStartNode* pSttNd = rWrt.m_pDoc->GetNodes()[nStt]->GetStartNode();
1752 OSL_ENSURE( pSttNd, "Where is the start node" );
1753
1754 {
1755 // in a block, so that the old state can be restored in time
1756 // before the end
1757 HTMLSaveData aSaveData( rHTMLWrt, nStt+1,
1758 pSttNd->EndOfSectionIndex(),
1759 true, &rFrameFormat );
1760 rHTMLWrt.m_bOutFlyFrame = true;
1761 rHTMLWrt.Out_SwDoc( rWrt.m_pCurrentPam.get() );
1762 }
1763
1764 rHTMLWrt.DecIndentLevel(); // indent the content of Multicol;
1765 if( rHTMLWrt.m_bLFPossible )
1766 rHTMLWrt.OutNewLine();
1767 HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), Concat2View(rHTMLWrt.GetNamespace() + aTag), false );
1768
1769 if( !aEndTags.isEmpty() )
1770 rWrt.Strm().WriteOString( aEndTags );
1771
1772 return rWrt;
1773}
1774
1776static void OutHTML_ImageOLEStart(SwHTMLWriter& rHTMLWrt, const Graphic& rGraphic,
1777 const SwFrameFormat& rFrameFormat)
1778{
1779 if (!rHTMLWrt.mbReqIF || !rHTMLWrt.m_bExportImagesAsOLE)
1780 return;
1781
1782 // Write the original image as an RTF fragment.
1783 OUString aFileName;
1784 if (rHTMLWrt.GetOrigFileName())
1785 aFileName = *rHTMLWrt.GetOrigFileName();
1786 INetURLObject aURL(aFileName);
1787 OUString aName = aURL.getBase() + "_" + aURL.getExtension() + "_"
1788 + OUString::number(rGraphic.GetChecksum(), 16);
1789 aURL.setBase(aName);
1790 aURL.setExtension(u"ole");
1791 aFileName = aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE);
1792
1793 SvFileStream aOutStream(aFileName, StreamMode::WRITE);
1794 if (!SwReqIfReader::WrapGraphicInRtf(rGraphic, rFrameFormat, aOutStream))
1795 SAL_WARN("sw.html", "SwReqIfReader::WrapGraphicInRtf() failed");
1796
1797 // Refer to this data.
1798 aFileName = URIHelper::simpleNormalizedMakeRelative(rHTMLWrt.GetBaseURL(), aFileName);
1799 rHTMLWrt.Strm().WriteOString(
1800 Concat2View("<" + rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_object));
1801 rHTMLWrt.Strm().WriteOString(Concat2View(" data=\"" + aFileName.toUtf8() + "\""));
1802 rHTMLWrt.Strm().WriteOString(" type=\"text/rtf\"");
1803 rHTMLWrt.Strm().WriteOString(">");
1804 rHTMLWrt.OutNewLine();
1805}
1806
1808static void OutHTML_ImageOLEEnd(SwHTMLWriter& rHTMLWrt)
1809{
1810 if (rHTMLWrt.mbReqIF && rHTMLWrt.m_bExportImagesAsOLE)
1811 {
1812 rHTMLWrt.Strm().WriteOString(
1813 Concat2View("</" + rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_object ">"));
1814 }
1815}
1816
1817static Writer & OutHTML_FrameFormatAsImage( Writer& rWrt, const SwFrameFormat& rFrameFormat, bool bPNGFallback)
1818{
1819 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
1820 bool bWritePNGFallback = rHTMLWrt.mbReqIF && !rHTMLWrt.m_bExportImagesAsOLE && bPNGFallback;
1821
1822 if (rHTMLWrt.mbSkipImages)
1823 return rWrt;
1824
1825 ImageMap aIMap;
1826 std::optional<Size> aDPI;
1827 if (rHTMLWrt.m_nShapeDPI.has_value())
1828 {
1829 aDPI.emplace(*rHTMLWrt.m_nShapeDPI, *rHTMLWrt.m_nShapeDPI);
1830 }
1831 Graphic aGraphic( const_cast<SwFrameFormat &>(rFrameFormat).MakeGraphic( &aIMap, /*nMaximumQuadraticPixels=*/2100000, aDPI ) );
1832
1833 if (rHTMLWrt.mbReqIF)
1834 {
1835 // ImageMap doesn't seem to be allowed in reqif.
1836 if (auto pGrafObj = dynamic_cast<const SdrGrafObj*>(rFrameFormat.FindSdrObject()))
1837 {
1838 aGraphic = pGrafObj->GetGraphic();
1839 }
1840 else
1841 {
1842 // We only have a bitmap, write that as PNG without any fallback.
1843 bWritePNGFallback = false;
1844 }
1845 }
1846
1847 Size aSz( 0, 0 );
1848 OUString GraphicURL;
1849 OUString aMimeType("image/jpeg");
1850 if(!rHTMLWrt.mbEmbedImages)
1851 {
1852 if( rHTMLWrt.GetOrigFileName() )
1853 GraphicURL = *rHTMLWrt.GetOrigFileName();
1854
1855 OUString aFilterName("JPG");
1856 XOutFlags nFlags = XOutFlags::UseGifIfPossible | XOutFlags::UseNativeIfPossible;
1857
1858 if (rHTMLWrt.mbReqIF && !bWritePNGFallback)
1859 {
1860 // Writing image without fallback PNG in ReqIF mode: force PNG output.
1861 aFilterName = "PNG";
1862 nFlags = XOutFlags::NONE;
1863 aMimeType = "image/png";
1864 }
1865 else if (rHTMLWrt.mbReqIF)
1866 {
1867 // Original format is wanted, don't force JPG.
1868 aFilterName.clear();
1869 aMimeType.clear();
1870 }
1871
1872 if( aGraphic.GetType() == GraphicType::NONE ||
1873 XOutBitmap::WriteGraphic( aGraphic, GraphicURL,
1874 aFilterName,
1875 nFlags ) != ERRCODE_NONE )
1876 {
1877 // empty or incorrect, because there is nothing to output
1878 rHTMLWrt.m_nWarn = WARN_SWG_POOR_LOAD;
1879 return rWrt;
1880 }
1881
1882 GraphicURL = URIHelper::SmartRel2Abs(
1883 INetURLObject(rWrt.GetBaseURL()), GraphicURL,
1885
1886 }
1887 uno::Reference<beans::XPropertySet> xGraphic(aGraphic.GetXGraphic(), uno::UNO_QUERY);
1888 if (xGraphic.is() && aMimeType.isEmpty())
1889 xGraphic->getPropertyValue("MimeType") >>= aMimeType;
1890
1891 OutHTML_ImageOLEStart(rHTMLWrt, aGraphic, rFrameFormat);
1892
1893 HtmlWriter aHtml(rWrt.Strm(), rHTMLWrt.maNamespace);
1894 OutHTML_ImageStart( aHtml, rWrt, rFrameFormat, GraphicURL, aGraphic, rFrameFormat.GetName(), aSz,
1895 HtmlFrmOpts::GenImgMask, "frame",
1896 aIMap.GetIMapObjectCount() ? &aIMap : nullptr, aMimeType );
1897
1898 GfxLink aLink = aGraphic.GetGfxLink();
1899 if (bWritePNGFallback && aLink.GetType() != GfxLinkType::NativePng)
1900 {
1901 OutHTML_FrameFormatAsImage( rWrt, rFrameFormat, /*bPNGFallback=*/false);
1902 }
1903
1904 OutHTML_ImageEnd(aHtml, rWrt);
1905
1906 OutHTML_ImageOLEEnd(rHTMLWrt);
1907
1908 return rWrt;
1909}
1910
1911static Writer& OutHTML_FrameFormatGrfNode( Writer& rWrt, const SwFrameFormat& rFrameFormat,
1912 bool bInCntnr, bool bPNGFallback )
1913{
1914 SwHTMLWriter& rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
1915 bool bWritePNGFallback = rHTMLWrt.mbReqIF && !rHTMLWrt.m_bExportImagesAsOLE && bPNGFallback;
1916
1917 if (rHTMLWrt.mbSkipImages)
1918 return rWrt;
1919
1920 const SwFormatContent& rFlyContent = rFrameFormat.GetContent();
1921 SwNodeOffset nStt = rFlyContent.GetContentIdx()->GetIndex()+1;
1922 SwGrfNode *pGrfNd = rHTMLWrt.m_pDoc->GetNodes()[ nStt ]->GetGrfNode();
1923 OSL_ENSURE( pGrfNd, "Grf node expected" );
1924 if( !pGrfNd )
1925 return rWrt;
1926
1927 HtmlFrmOpts nFrameFlags = bInCntnr ? HTML_FRMOPTS_IMG_CNTNR : HTML_FRMOPTS_IMG;
1928 if( rHTMLWrt.IsHTMLMode( HTMLMODE_ABS_POS_FLY ) && !bInCntnr )
1929 nFrameFlags |= HTML_FRMOPTS_IMG_CSS1;
1930
1931 Graphic aGraphic = pGrfNd->GetGraphic();
1932
1933 if (aGraphic.GetType() == GraphicType::GdiMetafile)
1934 {
1935 // We only have a metafile, write that as PNG without any fallback.
1936 bWritePNGFallback = false;
1937 }
1938
1939 OUString aGraphicURL;
1940 OUString aMimeType;
1941 if(!rHTMLWrt.mbEmbedImages)
1942 {
1943 const SwMirrorGrf& rMirror = pGrfNd->GetSwAttrSet().GetMirrorGrf();
1944
1945 if( !pGrfNd->IsLinkedFile() || MirrorGraph::Dont != rMirror.GetValue() )
1946 {
1947 // create a (mirrored) jpeg file
1948 if( rHTMLWrt.GetOrigFileName() )
1949 aGraphicURL = *rHTMLWrt.GetOrigFileName();
1950 else
1951 aGraphicURL = rHTMLWrt.GetBaseURL();
1952 pGrfNd->GetGrf( true );
1953
1954 XOutFlags nFlags = XOutFlags::UseGifIfSensible |
1955 XOutFlags::UseNativeIfPossible;
1956 switch( rMirror.GetValue() )
1957 {
1958 case MirrorGraph::Vertical: nFlags = XOutFlags::MirrorHorz; break;
1959 case MirrorGraph::Horizontal: nFlags = XOutFlags::MirrorVert; break;
1960 case MirrorGraph::Both:
1961 nFlags = XOutFlags::MirrorVert | XOutFlags::MirrorHorz;
1962 break;
1963 default: break;
1964 }
1965
1966 const SwFormatFrameSize& rSize = rFrameFormat.GetFrameSize();
1967 Size aMM100Size = o3tl::convert( rSize.GetSize(),
1969
1970 OUString aFilterName("");
1971
1972 if (rHTMLWrt.mbReqIF && !bWritePNGFallback)
1973 {
1974 // Writing image without fallback PNG in ReqIF mode: force PNG
1975 // output.
1976 // But don't force it when writing the original format and we'll write PNG inside
1977 // that.
1978 aFilterName = "PNG";
1979 nFlags &= ~XOutFlags::UseNativeIfPossible;
1980 nFlags &= ~XOutFlags::UseGifIfSensible;
1981 aMimeType = "image/png";
1982 }
1983
1984 const Graphic& rGraphic = pGrfNd->GetGrf();
1985
1986 // So that Graphic::IsTransparent() can report true.
1987 if (!rGraphic.isAvailable())
1988 const_cast<Graphic&>(rGraphic).makeAvailable();
1989
1990 if (rHTMLWrt.mbReqIF && bWritePNGFallback)
1991 {
1992 // ReqIF: force native data if possible.
1993 const std::shared_ptr<VectorGraphicData>& pVectorGraphicData = rGraphic.getVectorGraphicData();
1994 if (pVectorGraphicData && pVectorGraphicData->getType() == VectorGraphicDataType::Svg)
1995 {
1996 aFilterName = "svg";
1997 }
1998 else if (rGraphic.GetGfxLink().IsEMF())
1999 {
2000 aFilterName = "emf";
2001 aMimeType = "image/x-emf"; // avoid image/x-wmf
2002 }
2003 else if (pVectorGraphicData && pVectorGraphicData->getType() == VectorGraphicDataType::Wmf)
2004 {
2005 aFilterName = "wmf";
2006 }
2007 else if (rGraphic.GetGfxLink().GetType() == GfxLinkType::NativeTif)
2008 {
2009 aFilterName = "tif";
2010 aMimeType = "image/tiff"; // avoid image/x-vclgraphic
2011 }
2012 }
2013
2014 ErrCode nErr = XOutBitmap::WriteGraphic( rGraphic, aGraphicURL,
2015 aFilterName, nFlags, &aMM100Size );
2016 if( nErr )
2017 {
2018 rHTMLWrt.m_nWarn = WARN_SWG_POOR_LOAD;
2019 return rWrt;
2020 }
2021 aGraphicURL = URIHelper::SmartRel2Abs(
2022 INetURLObject(rWrt.GetBaseURL()), aGraphicURL,
2024 }
2025 else
2026 {
2027 pGrfNd->GetFileFilterNms( &aGraphicURL, nullptr );
2028 if( rHTMLWrt.m_bCfgCpyLinkedGrfs )
2029 rWrt.CopyLocalFileToINet( aGraphicURL );
2030 }
2031
2032 }
2033 uno::Reference<beans::XPropertySet> xGraphic(aGraphic.GetXGraphic(), uno::UNO_QUERY);
2034 if (xGraphic.is() && aMimeType.isEmpty())
2035 xGraphic->getPropertyValue("MimeType") >>= aMimeType;
2036
2037 OutHTML_ImageOLEStart(rHTMLWrt, aGraphic, rFrameFormat);
2038
2039 HtmlWriter aHtml(rWrt.Strm(), rHTMLWrt.maNamespace);
2040 OutHTML_ImageStart( aHtml, rWrt, rFrameFormat, aGraphicURL, aGraphic, pGrfNd->GetTitle(),
2041 pGrfNd->GetTwipSize(), nFrameFlags, "graphic", nullptr, aMimeType );
2042
2043 GfxLink aLink = aGraphic.GetGfxLink();
2044 if (bWritePNGFallback && aLink.GetType() != GfxLinkType::NativePng)
2045 {
2046 // Not OLE mode, outer format is not PNG: write inner PNG.
2047 OutHTML_FrameFormatGrfNode( rWrt, rFrameFormat,
2048 bInCntnr, /*bPNGFallback=*/false );
2049 }
2050
2051 OutHTML_ImageEnd(aHtml, rWrt);
2052
2053 OutHTML_ImageOLEEnd(rHTMLWrt);
2054
2055 return rWrt;
2056}
2057
2058static Writer& OutHTML_FrameFormatAsMarquee( Writer& rWrt, const SwFrameFormat& rFrameFormat,
2059 const SdrObject& rSdrObj )
2060{
2061 SwHTMLWriter & rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
2062
2063 // get the edit engine attributes of the object as SW attributes and
2064 // sort them as Hints
2065 const SfxItemSet& rFormatItemSet = rFrameFormat.GetAttrSet();
2066 SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END> aItemSet( *rFormatItemSet.GetPool() );
2067 SwHTMLWriter::GetEEAttrsFromDrwObj( aItemSet, &rSdrObj );
2068 bool bCfgOutStylesOld = rHTMLWrt.m_bCfgOutStyles;
2069 rHTMLWrt.m_bCfgOutStyles = false;
2070 rHTMLWrt.m_bTextAttr = true;
2071 rHTMLWrt.m_bTagOn = true;
2072 Out_SfxItemSet( aHTMLAttrFnTab, rWrt, aItemSet, false );
2073 rHTMLWrt.m_bTextAttr = false;
2074
2076 static_cast<const SwDrawFrameFormat &>(rFrameFormat),
2077 rSdrObj );
2078 rHTMLWrt.m_bTextAttr = true;
2079 rHTMLWrt.m_bTagOn = false;
2080 Out_SfxItemSet( aHTMLAttrFnTab, rWrt, aItemSet, false );
2081 rHTMLWrt.m_bTextAttr = false;
2082 rHTMLWrt.m_bCfgOutStyles = bCfgOutStylesOld;
2083
2084 return rWrt;
2085}
2086
2088 bool bHeader )
2089{
2090 SwHTMLWriter & rHTMLWrt = static_cast<SwHTMLWriter&>(rWrt);
2091
2092 // output as Multicol
2093 rHTMLWrt.OutNewLine();
2094 OStringBuffer sOut;
2095 sOut.append(OOO_STRING_SVTOOLS_HTML_division " "
2097 .append( bHeader ? "header" : "footer" ).append("\"");
2098 HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), Concat2View(rHTMLWrt.GetNamespace() + sOut) );
2099
2100 rHTMLWrt.IncIndentLevel(); // indent the content of Multicol;
2101
2102 // Piece a spacer for the spacing together. Because the
2103 // <DL> or </DL> always produces a space between paragraphs, it is
2104 // subtracted if necessary.
2105 const SvxULSpaceItem& rULSpace = rFrameFormat.GetULSpace();
2106 sal_uInt16 nSize = bHeader ? rULSpace.GetLower() : rULSpace.GetUpper();
2107 rHTMLWrt.m_nHeaderFooterSpace = nSize;
2108
2109 OString aSpacer;
2110 if( rHTMLWrt.IsHTMLMode(HTMLMODE_VERT_SPACER) &&
2112 {
2113 nSize -= HTML_PARSPACE;
2114 nSize = static_cast<sal_Int16>(Application::GetDefaultDevice()
2115 ->LogicToPixel( Size(nSize,0), MapMode(MapUnit::MapTwip) ).Width());
2116
2121 "=\"" + OString::number(nSize) + "\"";
2122 }
2123
2124 const SwFormatContent& rFlyContent = rFrameFormat.GetContent();
2125 SwNodeOffset nStt = rFlyContent.GetContentIdx()->GetIndex();
2126 const SwStartNode* pSttNd = rWrt.m_pDoc->GetNodes()[nStt]->GetStartNode();
2127 OSL_ENSURE( pSttNd, "Where is the start node" );
2128
2129 if( !bHeader && !aSpacer.isEmpty() )
2130 {
2131 rHTMLWrt.OutNewLine();
2132 HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), Concat2View(rHTMLWrt.GetNamespace() + aSpacer) );
2133 }
2134
2135 {
2136 // in a block, so that the old state can be restored in time
2137 // before the end. pFlyFormat doesn't need to be set here, because
2138 // PageDesc attributes cannot occur here
2139 HTMLSaveData aSaveData( rHTMLWrt, nStt+1,
2140 pSttNd->EndOfSectionIndex() );
2141
2142 if( bHeader )
2143 rHTMLWrt.m_bOutHeader = true;
2144 else
2145 rHTMLWrt.m_bOutFooter = true;
2146
2147 rHTMLWrt.Out_SwDoc( rWrt.m_pCurrentPam.get() );
2148 }
2149
2150 if( bHeader && !aSpacer.isEmpty() )
2151 {
2152 rHTMLWrt.OutNewLine();
2153 HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), Concat2View(rHTMLWrt.GetNamespace() + aSpacer) );
2154 }
2155
2156 rHTMLWrt.DecIndentLevel(); // indent the content of Multicol;
2157 rHTMLWrt.OutNewLine();
2158 HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), Concat2View(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_division), false );
2159
2160 rHTMLWrt.m_nHeaderFooterSpace = 0;
2161
2162 return rWrt;
2163}
2164
2165void SwHTMLWriter::AddLinkTarget( std::u16string_view aURL )
2166{
2167 if( aURL.empty() || aURL[0] != '#' )
2168 return;
2169
2170 // There might be a '|' as delimiter (if the link has been inserted
2171 // freshly) or a '%7c' or a '%7C' if the document has been saved and
2172 // loaded already.
2173 sal_Int32 nPos = aURL.size();
2174 bool bFound = false, bEncoded = false;
2175 while( !bFound && nPos > 0 )
2176 {
2177 sal_Unicode c = aURL[ --nPos ];
2178 switch( c )
2179 {
2180 case cMarkSeparator:
2181 bFound = true;
2182 break;
2183 case '%':
2184 bFound = (aURL.size() - nPos) >=3 && aURL[ nPos+1 ] == '7';
2185 if(bFound)
2186 {
2187 c = aURL[ nPos+2 ];
2188 bFound = (c == 'C' || c == 'c');
2189 }
2190 if( bFound )
2191 bEncoded = true;
2192 }
2193 }
2194 if( !bFound || nPos < 2 ) // at least "#a|..."
2195 return;
2196
2197 aURL = aURL.substr( 1 );
2198
2199 // nPos-1+1/3 (-1 because of Erase)
2200 OUString sCmp = OUString(aURL.substr(bEncoded ? nPos+2 : nPos)).replaceAll(" ","");
2201 if( sCmp.isEmpty() )
2202 return;
2203
2204 sCmp = sCmp.toAsciiLowerCase();
2205
2206 if( sCmp == "region" ||
2207 sCmp == "frame" ||
2208 sCmp == "graphic" ||
2209 sCmp == "ole" ||
2210 sCmp == "table" )
2211 {
2212 // Just remember it in a sorted array
2213 OUString aURL2(aURL);
2214 if( bEncoded )
2215 {
2216 aURL2 = aURL2.replaceAt( nPos - 1, 3, rtl::OUStringChar(cMarkSeparator) );
2217 }
2218 m_aImplicitMarks.insert( aURL2 );
2219 }
2220 else if( sCmp == "outline" )
2221 {
2222 // Here, we need position and name. That's why we sort a
2223 // sal_uInt16 and a string array ourselves.
2224 OUString aOutline( aURL.substr( 0, nPos-1 ) );
2225 SwPosition aPos( *m_pCurrentPam->GetPoint() );
2226 if( m_pDoc->GotoOutline( aPos, aOutline ) )
2227 {
2228 SwNodeOffset nIdx = aPos.GetNodeIndex();
2229
2230 decltype(m_aOutlineMarkPoss)::size_type nIns=0;
2231 while( nIns < m_aOutlineMarkPoss.size() &&
2232 m_aOutlineMarkPoss[nIns] < nIdx )
2233 nIns++;
2234
2235 m_aOutlineMarkPoss.insert( m_aOutlineMarkPoss.begin()+nIns, nIdx );
2236 OUString aURL2(aURL);
2237 if( bEncoded )
2238 {
2239 aURL2 = aURL2.replaceAt( nPos - 1, 3, rtl::OUStringChar(cMarkSeparator) );
2240 }
2241 m_aOutlineMarks.insert( m_aOutlineMarks.begin()+nIns, aURL2 );
2242 }
2243 }
2244}
2245
2247{
2248 const SwTextINetFormat* pTextAttr;
2249
2251 {
2252 auto pINetFormat = dynamic_cast<const SwFormatINetFormat*>(pItem);
2253 const SwTextNode* pTextNd;
2254
2255 if( pINetFormat &&
2256 nullptr != ( pTextAttr = pINetFormat->GetTextINetFormat()) &&
2257 nullptr != ( pTextNd = pTextAttr->GetpTextNode() ) &&
2258 pTextNd->GetNodes().IsDocNodes() )
2259 {
2260 AddLinkTarget( pINetFormat->GetValue() );
2261 }
2262 }
2263
2264 for (const SfxPoolItem* pItem : m_pDoc->GetAttrPool().GetItemSurrogates(RES_URL))
2265 {
2266 auto pURL = dynamic_cast<const SwFormatURL*>(pItem);
2267 if( pURL )
2268 {
2269 AddLinkTarget( pURL->GetURL() );
2270 const ImageMap *pIMap = pURL->GetMap();
2271 if( pIMap )
2272 {
2273 for( size_t i=0; i<pIMap->GetIMapObjectCount(); ++i )
2274 {
2275 const IMapObject* pObj = pIMap->GetIMapObject( i );
2276 if( pObj )
2277 {
2278 AddLinkTarget( pObj->GetURL() );
2279 }
2280 }
2281 }
2282 }
2283 }
2284}
2285
2286/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
GPOS_NONE
constexpr int nBorderWidth
static OutputDevice * GetDefaultDevice()
bool isAvailable() const
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
GraphicType GetType() const
GfxLink GetGfxLink() const
BitmapChecksum GetChecksum() const
const std::shared_ptr< VectorGraphicData > & getVectorGraphicData() const
void attribute(std::string_view aAttribute, const char *aValue)
void flushStack()
bool end(const OString &aElement)
void start(const OString &aElement)
void characters(std::string_view rChars)
const OUString & GetURL() const
const OUString & GetName() const
IMapObject * GetIMapObject(size_t nPos) const
size_t GetIMapObjectCount() const
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
EnumT GetValue() const
Item2Range GetItemSurrogates(sal_uInt16 nWhich) const
SfxItemPool * GetPool() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
SvStream & WriteOString(std::string_view rStr)
SvStream & WriteChar(char nChar)
const editeng::SvxBorderLine * GetTop() const
sal_Int16 CalcLineSpace(SvxBoxItemLine nLine, bool bEvenIfNoLine=false, bool bAllowNegative=false) const
const editeng::SvxBorderLine * GetRight() const
const editeng::SvxBorderLine * GetLeft() const
const editeng::SvxBorderLine * GetBottom() const
const Graphic * GetGraphic(OUString const &referer=OUString()) const
const OUString & GetGraphicLink() const
tools::Long GetRight() const
tools::Long GetTextLeft() const
tools::Long GetLeft() const
const SvxMacroTableDtor & GetMacroTable() const
bool empty() const
tools::Long GetHeight() const
tools::Long GetWidth() const
const Size & GetSize() const
sal_uInt16 GetUpper() const
sal_uInt16 GetLower() const
const SwMirrorGrf & GetMirrorGrf(bool=true) const
Definition: grfatr.hxx:282
const SfxPoolItem & GetAttr(sal_uInt16 nWhich, bool bInParent=true) const
SS for PoolItems: hard attributation.
Definition: node.hxx:770
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
Definition: node.hxx:763
bool GotoOutline(SwPosition &rPos, const OUString &rName, SwRootFrame const *=nullptr) const
Definition: docnum.cxx:733
SwNodes & GetNodes()
Definition: doc.hxx:417
SwPosFlyFrames GetAllFlyFormats(const SwPaM *, bool bDrawAlso, bool bAsCharAlso=false) const
Returns positions of all FlyFrames in the document.
Definition: doclay.cxx:499
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1326
FlyAnchors.
Definition: fmtanchr.hxx:37
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:67
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:69
sal_uInt16 GetGutterWidth(bool bMin=false) const
Definition: atrfrm.cxx:918
sal_uInt16 GetNumCols() const
Definition: fmtclds.hxx:114
Content, content of frame (header, footer, fly).
Definition: fmtcntnt.hxx:32
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
sal_uInt8 GetWidthPercent() const
Definition: fmtfsize.hxx:91
SwFrameSize GetHeightSizeType() const
Definition: fmtfsize.hxx:80
sal_uInt8 GetHeightPercent() const
Definition: fmtfsize.hxx:88
Defines the horizontal position of a fly frame.
Definition: fmtornt.hxx:73
sal_Int16 GetHoriOrient() const
Definition: fmtornt.hxx:94
sal_Int16 GetRelationOrient() const
Definition: fmtornt.hxx:95
bool IsAnchorOnly() const
Definition: fmtsrnd.hxx:52
css::text::WrapTextMode GetSurround() const
Definition: fmtsrnd.hxx:51
const ImageMap * GetMap() const
Definition: fmturl.hxx:68
const OUString & GetName() const
Definition: fmturl.hxx:71
const OUString & GetTargetFrameName() const
Definition: fmturl.hxx:65
const OUString & GetURL() const
Definition: fmturl.hxx:66
bool IsServerMap() const
Definition: fmturl.hxx:67
Defines the vertical position of a fly frame.
Definition: fmtornt.hxx:37
sal_Int16 GetVertOrient() const
Definition: fmtornt.hxx:57
const SvxBoxItem & GetBox(bool=true) const
Definition: frmatr.hxx:84
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:104
sal_uInt16 Which() const
for Querying of Writer-functions.
Definition: format.hxx:82
const OUString & GetName() const
Definition: format.hxx:131
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:83
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:136
const SwFormatHoriOrient & GetHoriOrient(bool=true) const
Definition: fmtornt.hxx:115
const SwFormatCol & GetCol(bool=true) const
Definition: fmtclds.hxx:168
const SvxULSpaceItem & GetULSpace(bool=true) const
Definition: frmatr.hxx:76
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
std::unique_ptr< SvxBrushItem > makeBackgroundBrushItem(bool=true) const
Definition: format.cxx:736
Style of a layout element.
Definition: frmfmt.hxx:62
SdrObject * FindSdrObject()
Definition: frmfmt.hxx:141
virtual Size GetTwipSize() const override
Definition: ndgrf.cxx:432
bool IsLinkedFile() const
Definition: ndgrf.hxx:164
const Graphic & GetGrf(bool bWait=false) const
Definition: ndgrf.cxx:373
bool GetFileFilterNms(OUString *pFileNm, OUString *pFilterNm) const
Definition: ndgrf.cxx:494
HtmlOut GetOutFn() const
Definition: htmlfly.hxx:120
const SdrObject * GetSdrObject() const
Definition: htmlfly.hxx:116
const SwFrameFormat & GetFormat() const
Definition: htmlfly.hxx:115
sal_Int32 GetContentIndex() const
Definition: htmlfly.hxx:118
AllHtmlFlags const & GetOutMode() const
Definition: htmlfly.hxx:119
HtmlPosition GetOutPos() const
Definition: htmlfly.hxx:121
bool mbXHTML
If XHTML markup should be written instead of HTML.
Definition: wrthtml.hxx:410
std::vector< OUString > m_aOutlineMarks
Definition: wrthtml.hxx:302
bool m_bOutHeader
Definition: wrthtml.hxx:378
void CollectLinkTargets()
void OutAndSetDefList(sal_uInt16 nNewLvl)
Definition: htmlatr.cxx:120
SwHTMLPosFlyFrames m_aHTMLPosFlyFrames
Definition: wrthtml.hxx:274
sal_uInt16 GuessFrameType(const SwFrameFormat &rFrameFormat, const SdrObject *&rpStrObj)
void ChangeParaToken(HtmlTokenId nNew)
Definition: htmlatr.cxx:158
static const SdrObject * GetMarqueeTextObj(const SwDrawFrameFormat &rFormat)
sal_uInt16 m_nImgMapCnt
Definition: wrthtml.hxx:328
std::set< OUString > m_aImplicitMarks
Definition: wrthtml.hxx:298
bool mbSkipImages
Definition: wrthtml.hxx:403
static OString convertDirection(SvxFrameDirection nDirection)
Definition: wrthtml.cxx:1486
std::vector< OUString > m_aImgMapNames
Definition: wrthtml.hxx:297
bool mbEmbedImages
Definition: wrthtml.hxx:406
void IncIndentLevel()
Definition: wrthtml.hxx:525
void OutDirection(SvxFrameDirection nDir)
Definition: wrthtml.cxx:1474
static sal_uInt16 GuessOLENodeFrameType(const SwNode &rNd)
Definition: htmlplug.cxx:1190
void OutFrameFormat(AllHtmlFlags nType, const SwFrameFormat &rFormat, const SdrObject *pSdrObj)
bool m_bLFPossible
Definition: wrthtml.hxx:395
ErrCode m_nWarn
Definition: wrthtml.hxx:323
OUString convertHyperlinkHRefValue(const OUString &rURL)
Definition: wrthtml.cxx:1327
bool m_bTextAttr
Definition: wrthtml.hxx:373
bool m_bClearRight
Definition: wrthtml.hxx:394
std::optional< sal_Int32 > m_nShapeDPI
DPI used when exporting a vector shape as a bitmap.
Definition: wrthtml.hxx:430
std::vector< SwNodeOffset > m_aOutlineMarkPoss
Definition: wrthtml.hxx:303
std::unique_ptr< utl::TempFileNamed > mpTempBaseURL
Temporary base URL for paste of images.
Definition: wrthtml.hxx:408
bool m_bTagOn
Definition: wrthtml.hxx:364
bool m_bOutFlyFrame
Definition: wrthtml.hxx:380
bool m_bCfgOutStyles
Definition: wrthtml.hxx:355
void AddLinkTarget(std::u16string_view aURL)
bool m_bExportImagesAsOLE
ReqIF mode: export images as OLE objects.
Definition: wrthtml.hxx:427
sal_Int32 m_nDfltRightMargin
Definition: wrthtml.hxx:334
std::vector< SwFormatINetFormat * > m_aINetFormats
Definition: wrthtml.hxx:307
void DecIndentLevel()
Definition: wrthtml.hxx:529
OString GetNamespace() const
Determines the prefix string needed to respect the requested namespace alias.
Definition: wrthtml.cxx:1570
void Out_SwDoc(SwPaM *)
Definition: wrthtml.cxx:882
sal_uInt16 m_nExportMode
Definition: wrthtml.hxx:345
sal_Int32 m_nDfltLeftMargin
Definition: wrthtml.hxx:333
bool mbReqIF
If the ReqIF subset of XHTML should be written.
Definition: wrthtml.hxx:414
OString OutFrameFormatOptions(const SwFrameFormat &rFrameFormat, const OUString &rAltText, HtmlFrmOpts nFrameOpts)
OString GetIndentString(sal_uInt16 nIncLvl=0)
Definition: wrthtml.cxx:1504
void OutCSS1_FrameFormatOptions(const SwFrameFormat &rFrameFormat, HtmlFrmOpts nFrameOpts, const SdrObject *pSdrObj=nullptr, const SfxItemSet *pItemSet=nullptr)
Definition: css1atr.cxx:1853
void CollectFlyFrames()
sal_uInt16 m_nDfltTopMargin
Definition: wrthtml.hxx:337
bool m_bClearLeft
Definition: wrthtml.hxx:393
sal_uInt16 m_nHeaderFooterSpace
Definition: wrthtml.hxx:343
sal_uInt16 m_nDfltBottomMargin
Definition: wrthtml.hxx:338
void OutNewLine(bool bCheck=false)
Definition: wrthtml.cxx:1521
OString maNamespace
XML namespace, in case of XHTML.
Definition: wrthtml.hxx:412
void writeFrameFormatOptions(HtmlWriter &aHtml, const SwFrameFormat &rFrameFormat, std::u16string_view rAltText, HtmlFrmOpts nFrameOpts)
bool m_bCfgStarBasic
Definition: wrthtml.hxx:358
static const SdrObject * GetHTMLControl(const SwDrawFrameFormat &rFormat)
Definition: htmlforw.cxx:614
bool IsHTMLMode(sal_uInt32 nMode) const
Definition: wrthtml.hxx:598
SvxFrameDirection GetHTMLDirection(SvxFrameDirection nDir) const
Definition: wrthtml.cxx:1455
static void GetEEAttrsFromDrwObj(SfxItemSet &rItemSet, const SdrObject *pObj)
bool m_bCfgCpyLinkedGrfs
Definition: wrthtml.hxx:359
void OutImplicitMark(std::u16string_view rMark, const char *pMarkType)
Definition: wrthtml.cxx:1314
bool OutFlyFrame(SwNodeOffset nNdIdx, sal_Int32 nContentIdx, HtmlPosition nPos)
bool m_bOutFooter
Definition: wrthtml.hxx:379
OUString GetTitle() const
Definition: ndnotxt.cxx:258
Graphic GetGraphic() const
Definition: ndnotxt.cxx:229
SwNodeOffset GetIndex() const
Definition: ndindex.hxx:171
Base class of the Writer document model elements.
Definition: node.hxx:98
bool IsGrfNode() const
Definition: node.hxx:705
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:897
SwNodeOffset GetIndex() const
Definition: node.hxx:312
SwNodes & GetNodes()
Node is in which nodes-array/doc?
Definition: node.hxx:742
bool IsTableNode() const
Definition: node.hxx:689
bool IsTextNode() const
Definition: node.hxx:685
SwNodeOffset EndOfSectionIndex() const
Definition: node.hxx:726
SwContentNode * GetContentNode()
Definition: node.hxx:664
SwTableNode * GetTableNode()
Definition: node.hxx:648
bool IsOLENode() const
Definition: node.hxx:701
bool IsDocNodes() const
Is the NodesArray the regular one of Doc? (and not the UndoNds, ...) Implementation in doc....
Definition: nodes.cxx:2528
For querying current flys in document.
Definition: flypos.hxx:31
Starts a section of nodes in the document model.
Definition: node.hxx:348
const SwTextNode * GetpTextNode() const
Definition: txtinet.hxx:45
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:111
virtual sal_Int32 Len() const override
Definition: ndtxt.cxx:290
const OUString & GetText() const
Definition: ndtxt.hxx:242
const OUString * GetOrigFileName() const
Definition: shellio.hxx:432
SvStream & Strm()
Definition: writer.cxx:214
SwDoc * m_pDoc
Definition: shellio.hxx:401
std::shared_ptr< SwUnoCursor > m_pCurrentPam
Definition: shellio.hxx:403
bool m_bWriteAll
Definition: shellio.hxx:404
const OUString & GetBaseURL() const
Definition: shellio.hxx:437
bool CopyLocalFileToINet(OUString &rFileNm)
Definition: writer.cxx:299
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)
static bool GraphicToBase64(const Graphic &rGraphic, OUString &rOUString, bool bAddPrefix=true, ConvertDataFormat aTargetFormat=ConvertDataFormat::Unknown)
Value erase_extract(size_t index)
bool empty() const
size_type size() const
std::pair< const_iterator, bool > insert(Value &&x)
tools::Long getOpenHeight() const
tools::Long getOpenWidth() const
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
URL aURL
float u
EmbeddedObjectRef * pObject
#define ERRCODE_NONE
std::set< SwPosFlyFrame, SwPosFlyFrameCmp > SwPosFlyFrames
Definition: flypos.hxx:45
DocumentType eType
@ Fixed
Frame cannot be moved in Var-direction.
SvxFrameDirection
constexpr TypedWhichId< SwFormatCol > RES_COL(109)
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(101)
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
constexpr TypedWhichId< SvxMacroItem > RES_FRMMACRO(108)
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(159)
constexpr TypedWhichId< SwFormatURL > RES_URL(111)
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(102)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(106)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
Writer & OutHTML_INetFormat(Writer &rWrt, const SwFormatINetFormat &rINetFormat, bool bOn)
Definition: htmlatr.cxx:2947
HTMLOutEvent const aAnchorEventTable[]
Definition: htmlatr.cxx:86
SwAttrFnTab aHTMLAttrFnTab
Definition: htmlatr.cxx:3214
#define HTML_CFG_MAX
Writer & OutHTML_DrawFrameFormatAsMarquee(Writer &rWrt, const SwDrawFrameFormat &rFormat, const SdrObject &rSdrObject)
HtmlContainerFlags
Definition: htmlfly.hxx:73
SwHTMLFrameType
Definition: htmlfly.hxx:34
@ HTML_FRMTYPE_GRF
Definition: htmlfly.hxx:40
@ HTML_FRMTYPE_MARQUEE
Definition: htmlfly.hxx:45
@ HTML_FRMTYPE_MULTICOL
Definition: htmlfly.hxx:37
@ HTML_FRMTYPE_EMPTY
Definition: htmlfly.hxx:38
@ HTML_FRMTYPE_CONTROL
Definition: htmlfly.hxx:46
@ HTML_FRMTYPE_DRAW
Definition: htmlfly.hxx:47
@ HTML_FRMTYPE_TABLE
Definition: htmlfly.hxx:35
@ HTML_FRMTYPE_TEXT
Definition: htmlfly.hxx:39
@ HTML_FRMTYPE_TABLE_CAP
Definition: htmlfly.hxx:36
const sal_uInt16 MAX_BROWSERS
Definition: htmlfly.hxx:83
AllHtmlFlags const aHTMLOutFramePageFlyTable[MAX_FRMTYPES][MAX_BROWSERS]
Definition: htmlflyt.cxx:24
AllHtmlFlags const aHTMLOutFrameParaFrameTable[MAX_FRMTYPES][MAX_BROWSERS]
Definition: htmlflyt.cxx:120
HtmlPosition
Definition: htmlfly.hxx:66
HtmlOut
Definition: htmlfly.hxx:51
@ GraphicFrame
AllHtmlFlags const aHTMLOutFrameParaOtherTable[MAX_FRMTYPES][MAX_BROWSERS]
Definition: htmlflyt.cxx:313
AllHtmlFlags const aHTMLOutFrameParaPrtAreaTable[MAX_FRMTYPES][MAX_BROWSERS]
Definition: htmlflyt.cxx:217
static void OutHTML_ImageOLEStart(SwHTMLWriter &rHTMLWrt, const Graphic &rGraphic, const SwFrameFormat &rFrameFormat)
Starts the OLE version of an image in the ReqIF + OLE case.
static Writer & OutHTML_FrameFormatAsImage(Writer &rWrt, const SwFrameFormat &rFormat, bool bPNGFallback)
static Writer & OutHTML_FrameFormatAsDivOrSpan(Writer &rWrt, const SwFrameFormat &rFrameFormat, bool bSpan)
Writer & OutHTML_ImageEnd(HtmlWriter &rHtml, Writer &rWrt)
HTMLOutEvent const aIMapEventTable[]
static Writer & OutHTML_FrameFormatAsMulticol(Writer &rWrt, const SwFrameFormat &rFormat, bool bInCntnr)
static Writer & OutHTML_FrameFormatAsSpacer(Writer &rWrt, const SwFrameFormat &rFormat)
static Writer & OutHTML_FrameFormatGrfNode(Writer &rWrt, const SwFrameFormat &rFormat, bool bInCntnr, bool bPNGFallback)
HTMLOutEvent const aImageEventTable[]
const HtmlFrmOpts HTML_FRMOPTS_SPACER
const HtmlFrmOpts HTML_FRMOPTS_IMG_CNTNR
Writer & OutHTML_ImageStart(HtmlWriter &rHtml, Writer &rWrt, const SwFrameFormat &rFrameFormat, const OUString &rGraphicURL, Graphic const &rGraphic, const OUString &rAlternateText, const Size &rRealSize, HtmlFrmOpts nFrameOpts, const char *pMarkType, const ImageMap *pAltImgMap, const OUString &rMimeType)
Writer & OutHTML_BulletImage(Writer &rWrt, const char *pTag, const SvxBrushItem *pBrush, const OUString &rGraphicURL)
const HtmlFrmOpts HTML_FRMOPTS_IMG
Writer & OutHTML_HeaderFooter(Writer &rWrt, const SwFrameFormat &rFrameFormat, bool bHeader)
const HtmlFrmOpts HTML_FRMOPTS_DIV
static Writer & OutHTML_FrameFormatAsMarquee(Writer &rWrt, const SwFrameFormat &rFrameFormat, const SdrObject &rSdrObj)
const HtmlFrmOpts HTML_FRMOPTS_MULTICOL
static void OutHTML_ImageOLEEnd(SwHTMLWriter &rHTMLWrt)
Ends the OLE version of an image in the ReqIF + OLE case.
const HtmlFrmOpts HTML_FRMOPTS_CNTNR
const HtmlFrmOpts HTML_FRMOPTS_MULTICOL_CSS1
const HtmlFrmOpts HTML_FRMOPTS_IMG_CSS1
const HtmlFrmOpts HTML_FRMOPTS_IMG_ALL
static Writer & OutHTML_FrameFormatTableNode(Writer &rWrt, const SwFrameFormat &rFrameFormat)
Writer & OutHTML_DrawFrameFormatAsControl(Writer &rWrt, const SwDrawFrameFormat &rFormat, const SdrUnoObj &rFormObj, bool bInCntnr)
Definition: htmlforw.cxx:673
#define OOO_STRING_SVTOOLS_HTML_O_height
#define OOO_STRING_SVTOOLS_HTML_SPTYPE_vertical
#define OOO_STRING_SVTOOLS_HTML_O_data
#define OOO_STRING_SVTOOLS_HTML_O_target
#define OOO_STRING_SVTOOLS_HTML_O_clear
#define OOO_STRING_SVTOOLS_HTML_O_color
#define OOO_STRING_SVTOOLS_HTML_AL_left
#define OOO_STRING_SVTOOLS_HTML_O_SDonmouseover
#define OOO_STRING_SVTOOLS_HTML_O_align
#define OOO_STRING_SVTOOLS_HTML_division
#define OOO_STRING_SVTOOLS_HTML_O_title
#define OOO_STRING_SVTOOLS_HTML_O_SDonerror
#define OOO_STRING_SVTOOLS_HTML_VA_middle
#define OOO_STRING_SVTOOLS_HTML_O_SDonmouseout
#define OOO_STRING_SVTOOLS_HTML_O_onmouseout
#define OOO_STRING_SVTOOLS_HTML_O_dir
#define OOO_STRING_SVTOOLS_HTML_spacer
#define OOO_STRING_SVTOOLS_HTML_O_onmouseover
#define OOO_STRING_SVTOOLS_HTML_VA_absmiddle
#define OOO_STRING_SVTOOLS_HTML_O_size
#define OOO_STRING_SVTOOLS_HTML_SPTYPE_block
#define OOO_STRING_SVTOOLS_HTML_anchor
#define OOO_STRING_SVTOOLS_HTML_VA_bottom
#define OOO_STRING_SVTOOLS_HTML_O_onerror
#define OOO_STRING_SVTOOLS_HTML_multicol
#define OOO_STRING_SVTOOLS_HTML_span
#define OOO_STRING_SVTOOLS_HTML_VA_absbottom
#define OOO_STRING_SVTOOLS_HTML_O_src
#define OOO_STRING_SVTOOLS_HTML_VA_top
#define OOO_STRING_SVTOOLS_HTML_O_cols
#define OOO_STRING_SVTOOLS_HTML_O_SDonabort
#define OOO_STRING_SVTOOLS_HTML_image
#define OOO_STRING_SVTOOLS_HTML_O_SDonload
#define OOO_STRING_SVTOOLS_HTML_map
#define OOO_STRING_SVTOOLS_HTML_O_class
#define OOO_STRING_SVTOOLS_HTML_O_href
#define OOO_STRING_SVTOOLS_HTML_O_onabort
#define OOO_STRING_SVTOOLS_HTML_O_hspace
#define OOO_STRING_SVTOOLS_HTML_VA_texttop
#define OOO_STRING_SVTOOLS_HTML_AL_right
#define OOO_STRING_SVTOOLS_HTML_O_ismap
#define OOO_STRING_SVTOOLS_HTML_O_border
#define OOO_STRING_SVTOOLS_HTML_O_vspace
#define OOO_STRING_SVTOOLS_HTML_O_type
#define OOO_STRING_SVTOOLS_HTML_O_onload
#define OOO_STRING_SVTOOLS_HTML_O_name
#define OOO_STRING_SVTOOLS_HTML_font
#define OOO_STRING_SVTOOLS_HTML_O_id
#define OOO_STRING_SVTOOLS_HTML_O_gutter
#define OOO_STRING_SVTOOLS_HTML_O_width
#define OOO_STRING_SVTOOLS_HTML_object
#define OOO_STRING_SVTOOLS_HTML_linebreak
#define OOO_STRING_SVTOOLS_HTML_O_usemap
#define OOO_STRING_SVTOOLS_HTML_O_alt
#define OOO_STRING_SVTOOLS_HTML_O_style
Writer & OutHTML_FrameFormatOLENode(Writer &rWrt, const SwFrameFormat &rFrameFormat, bool bInCntnr)
Definition: htmlplug.cxx:1218
Writer & OutHTML_FrameFormatOLENodeGrf(Writer &rWrt, const SwFrameFormat &rFrameFormat, bool bInCntnr)
Definition: htmlplug.cxx:1486
Writer & OutHTML_SwTableNode(Writer &rWrt, SwTableNode &rNode, const SwFrameFormat *pFlyFrameFormat, const OUString *pCaption, bool bTopCaption)
Definition: htmltabw.cxx:879
OUString aName
sal_uInt16 nPos
#define SAL_WARN(area, stream)
if(aStr !=aBuf) UpdateName_Impl(m_xFollowLb.get()
bool WrapGraphicInRtf(const Graphic &rGraphic, const SwFrameFormat &rFormat, SvStream &rRtf)
Wraps an image in an RTF fragment.
SVL_DLLPUBLIC Link< OUString *, bool > const & GetMaybeFileHdl()
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)
SVL_DLLPUBLIC OUString simpleNormalizedMakeRelative(OUString const &baseUriReference, OUString const &uriReference)
int i
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
const sal_Unicode *const aMimeType[]
HtmlOut nOut
Definition: htmlfly.hxx:86
HtmlContainerFlags nContainer
Definition: htmlfly.hxx:88
static SVT_DLLPUBLIC SvStream & Out_AsciiTag(SvStream &, std::string_view rStr, bool bOn=true)
static SVT_DLLPUBLIC SvStream & Out_String(SvStream &, const OUString &, OUString *pNonConvertableChars=nullptr)
static SVT_DLLPUBLIC bool PrivateURLToInternalImg(OUString &rURL)
static SVT_DLLPUBLIC SvStream & Out_ImageMap(SvStream &, const OUString &, const ImageMap &, const OUString &, const HTMLOutEvent *pEventTable, bool bOutStarBasic, const char *pDelim, const char *pIndentArea, const char *pIndentMap)
static SVT_DLLPUBLIC SvStream & FlushToAscii(SvStream &)
static SVT_DLLPUBLIC void applyEvents(HtmlWriter &rHtmlWriter, const SvxMacroTableDtor &rMacroTable, const HTMLOutEvent *pEventTable, bool bOutStarBasic)
static SVT_DLLPUBLIC void applyColor(HtmlWriter &rHtmlWriter, std::string_view aAttributeName, const Color &rColor)
Marks a position in the document model.
Definition: pam.hxx:37
SwNode & GetNode() const
Definition: pam.hxx:80
SwNodeOffset GetNodeIndex() const
Definition: pam.hxx:77
#define WARN_SWG_POOR_LOAD
Definition: swerror.h:40
RndStdIds
tools::Long SwTwips
Definition: swtypes.hxx:51
const sal_Unicode cMarkSeparator
Definition: swtypes.hxx:124
unsigned char sal_uInt8
sal_uInt16 sal_Unicode
Writer & Out_SfxItemSet(const SwAttrFnTab, Writer &, const SfxItemSet &, bool bDeep)
Definition: wrt_fn.cxx:42
HtmlFrmOpts
Definition: wrthtml.hxx:76
@ Replacement
The graphic frame is a replacement image of an OLE object.
#define HTML_PARSPACE
Definition: wrthtml.hxx:70
#define HTMLMODE_BORDER_NONE
Definition: wrthtml.hxx:126
#define HTMLMODE_ABS_POS_FLY
Definition: wrthtml.hxx:123
#define HTMLMODE_VERT_SPACER
Definition: wrthtml.hxx:118
XOutFlags