43 #include <drawdoc.hxx>
73 const Size& rPixSpace,
82 pNewDrawObj->
SetLayer( m_xDoc->getIDocumentDrawModelAccess().GetInvisibleHeavenId() );
89 sal_uInt16 nLeftSpace = 0, nRightSpace = 0, nUpperSpace = 0, nLowerSpace = 0;
96 nLeftSpace = nRightSpace =
static_cast<sal_uInt16
>(aTwipSpc.Width());
97 nUpperSpace = nLowerSpace =
static_cast<sal_uInt16
>(aTwipSpc.Height());
110 nLeftSpace =
static_cast< sal_uInt16
>(aLRItem.
GetLeft());
115 nRightSpace =
static_cast< sal_uInt16
>(aLRItem.
GetRight());
120 if( nLeftSpace || nRightSpace )
125 aFrameSet.Put( aLRItem );
146 if( nUpperSpace || nLowerSpace )
151 aFrameSet.Put( aULItem );
164 aAnchor.
SetType( RndStdIds::FLY_AT_FLY );
170 aAnchor.
SetType( RndStdIds::FLY_AT_PAGE );
174 rCSS1PropInfo.
m_nTop + nUpperSpace) );
177 else if( SvxAdjust::Left == rCSS1PropInfo.
m_eFloat ||
178 text::HoriOrientation::LEFT == eHoriOri )
180 aAnchor.
SetType( RndStdIds::FLY_AT_PARA );
190 if (RndStdIds::FLY_AT_PAGE == aAnchor.
GetAnchorId())
194 else if( RndStdIds::FLY_AT_FLY != aAnchor.
GetAnchorId() )
198 aFrameSet.Put( aAnchor );
200 m_xDoc->getIDocumentContentOperations().InsertDrawObj( *m_pPam, *pNewDrawObj, aFrameSet );
207 sal_uInt16 nEEWhich = 0;
209 switch( rSwItem.
Which() )
246 OSL_ENSURE( !m_pMarquee,
"Marquee in Marquee???" );
249 OUString
aId, aStyle, aClass;
252 bool bPercentWidth =
false, bDirection =
false, bBGColor =
false;
254 sal_Int16 eVertOri = text::VertOrientation::TOP;
258 sal_uInt16
nCount = 0, nDelay = 60;
259 sal_Int16 nAmount = -6;
263 for (
const auto & rOption : rHTMLOptions)
265 switch( rOption.GetToken() )
267 case HtmlOptionId::ID:
268 aId = rOption.GetString();
270 case HtmlOptionId::STYLE:
271 aStyle = rOption.GetString();
273 case HtmlOptionId::CLASS:
274 aClass = rOption.GetString();
277 case HtmlOptionId::BEHAVIOR:
278 eAniKind = rOption.GetEnum( aHTMLMarqBehaviorTable, eAniKind );
281 case HtmlOptionId::BGCOLOR:
282 rOption.GetColor( aBGColor );
286 case HtmlOptionId::DIRECTION:
287 eAniDir = rOption.GetEnum( aHTMLMarqDirectionTable, eAniDir );
291 case HtmlOptionId::LOOP:
292 if (rOption.GetString().
299 const sal_Int32 nLoop = rOption.GetSNumber();
300 nCount = std::max<sal_Int32>(nLoop, 0);
304 case HtmlOptionId::SCROLLAMOUNT:
305 nAmount = -
static_cast<sal_Int16
>(rOption.GetNumber());
308 case HtmlOptionId::SCROLLDELAY:
309 nDelay =
static_cast<sal_uInt16
>(rOption.GetNumber());
312 case HtmlOptionId::WIDTH:
314 nWidth = rOption.GetNumber();
315 bPercentWidth = rOption.GetString().indexOf(
'%') != -1;
316 if( bPercentWidth && nWidth>100 )
320 case HtmlOptionId::HEIGHT:
322 nHeight = rOption.GetNumber();
323 if( rOption.GetString().indexOf(
'%') != -1 )
327 case HtmlOptionId::HSPACE:
332 case HtmlOptionId::VSPACE:
334 aSpace.
setWidth( rOption.GetNumber() );
337 case HtmlOptionId::ALIGN:
340 text::VertOrientation::TOP );
350 SwDrawModel* pModel = m_xDoc->getIDocumentDrawModelAccess().GetOrCreateDrawModel();
354 SdrInventor::Default,
363 InsertBookmark( aId );
366 if( SdrTextAniKind::Alternate==eAniKind && !bDirection )
367 eAniDir = SdrTextAniDirection::Right;
382 if( SdrTextAniKind::Alternate==eAniKind )
387 if( SdrTextAniDirection::Left==eAniDir )
393 const Color& rDfltColor =
395 ->GetColor().GetValue();
399 sal_uInt16 nWhichIds[] =
417 for(
int i=0; nWhichIds[
i]; ++
i )
419 if( SfxItemState::SET == rItemSet.
GetItemState( nWhichIds[
i],
true, &pItem ) )
425 HTMLAttr** pHTMLAttributes =
reinterpret_cast<HTMLAttr**
>(m_xAttrTab.get());
441 SfxItemSet aStyleItemSet( m_xDoc->GetAttrPool(),
442 m_pCSS1Parser->GetWhichMap() );
444 if( HasStyleOptions( aStyle, aId, aClass ) &&
445 ParseStyleOptions( aStyle, aId, aClass, aStyleItemSet, aPropInfo ) )
456 Size aTwipSz( bPercentWidth ? 0 : nWidth, nHeight );
465 aTwipSz.
setWidth( aPropInfo.m_nWidth );
467 bPercentWidth =
false;
470 aTwipSz.
setHeight( aPropInfo.m_nHeight );
472 m_bFixMarqueeWidth =
false;
473 if( !nWidth || bPercentWidth )
482 m_bFixMarqueeWidth =
true;
490 bPercentWidth =
true;
496 tools::Long nBrowseWidth = GetCurrentBrowseWidth();
497 aTwipSz.
setWidth( !nWidth ? nBrowseWidth
498 : (nWidth*nBrowseWidth) / 100 );
507 m_pMarquee->SetMergedItemSetAndBroadcast(aItemSet);
514 InsertDrawObject( m_pMarquee, aSpace, eVertOri, eHoriOri, aStyleItemSet,
522 if( pCurTable && bPercentWidth)
523 RegisterDrawObjectToTable( pCurTable, m_pMarquee, static_cast<sal_uInt8>(nWidth) );
528 OSL_ENSURE( m_pMarquee &&
OBJ_TEXT==m_pMarquee->GetObjIdentifier(),
529 "no marquee or wrong type" );
531 if( m_bFixMarqueeWidth )
544 if( m_bFixMarqueeWidth )
547 static_cast<SdrTextObj*
>(m_pMarquee)->FitFrameToTextSize();
551 m_pMarquee =
nullptr;
556 OSL_ENSURE( m_pMarquee &&
OBJ_TEXT==m_pMarquee->GetObjIdentifier(),
557 "no marquee or wrong type" );
566 "no marquee or wrong type" );
#define OOO_STRING_SVTOOLS_HTML_LOOP_infinite
Starts a section of nodes in the document model.
constexpr TypedWhichId< SvxCrossedOutItem > RES_CHRATR_CROSSEDOUT(5)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CJK(EE_CHAR_START+17)
SvxCSS1LengthType m_eLeftType
SvxCSS1LengthType m_eTopType
void SetRight(const tools::Long nR, const sal_uInt16 nProp=100)
#define OOO_STRING_SVTOOLS_HTML_BEHAV_alternate
Marks a position in the document model.
constexpr TypedWhichId< SvxKerningItem > EE_CHAR_KERNING(EE_CHAR_START+12)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
constexpr TypedWhichId< SvxEscapementItem > RES_CHRATR_ESCAPEMENT(6)
sal_uInt16 GetLower() const
void setWidth(tools::Long nWidth)
tools::Long GetRight() const
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
constexpr TypedWhichId< SvxPostureItem > EE_CHAR_ITALIC(EE_CHAR_START+7)
static SdrObject * MakeNewObject(SdrModel &rSdrModel, SdrInventor nInventor, SdrObjKind nObjIdentifier, const tools::Rectangle *pSnapRect=nullptr)
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
virtual SdrObjKind GetObjIdentifier() const
constexpr sal_uInt16 SDRATTR_MISC_LAST(SDRATTR_TEXT_CHAINNEXTNAME)
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
HTMLOptionEnum< SdrTextAniDirection > const aHTMLMarqDirectionTable[]
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CJK_POSTURE(25)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT(EE_CHAR_START+2)
SdrOnOffItem makeSdrTextAutoGrowHeightItem(bool bAuto)
Reference< css::datatransfer::XTransferable > m_aContents
static OutputDevice * GetDefaultDevice()
const SfxPoolItem * NextItem()
static void ResetFrameFormatAttrs(SfxItemSet &rFrameSet)
static void ResizeDrawObject(SdrObject *pObj, SwTwips nWidth)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CTL(EE_CHAR_START+18)
SdrOnOffItem makeSdrTextAutoGrowWidthItem(bool bAuto)
void InsertDrawObject(SdrObject *pNewDrawObj, const Size &rSpace, sal_Int16 eVertOri, sal_Int16 eHoriOri, SfxItemSet &rCSS1ItemSet, SvxCSS1PropertyInfo &rCSS1PropInfo)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT(EE_CHAR_START+4)
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
SwFormatColl & GetAnyFormatColl() const
const Color & GetColor() const
virtual void SetLayer(SdrLayerID nLayer)
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void NewMarquee(HTMLTable *pCurTable=nullptr)
static void PutEEPoolItem(SfxItemSet &rEEItemSet, const SfxPoolItem &rSwItem)
tools::Long GetLeft() const
const SdrPage * GetPage(sal_uInt16 nPgNum) const
void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp=100)
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
tools::Long Width() const
void SetMergedItemSetAndBroadcast(const SfxItemSet &rSet, bool bClearAllItems=false)
#define OOO_STRING_SVTOOLS_HTML_AL_left
constexpr sal_uInt16 EE_CHAR_START(EE_PARA_END+1)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT_CJK(EE_CHAR_START+21)
SvxCSS1Position m_ePosition
virtual void SetLogicRect(const tools::Rectangle &rRect)
constexpr TypedWhichId< SvxPostureItem > EE_CHAR_ITALIC_CTL(EE_CHAR_START+24)
virtual void SetRelativePos(const Point &rPnt)
constexpr sal_uInt16 EE_CHAR_END(EE_CHAR_START+32)
std::unique_ptr< SfxPoolItem > CloneSetWhich(sal_uInt16 nNewWhich) const
HTMLOptionEnum< sal_Int16 > const aHTMLImgVAlignTable[]
Point PixelToLogic(const Point &rDevicePt) const
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
constexpr sal_uInt16 RES_FRMATR_END(131)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_BACKGROUND(21)
SwTextNode is a paragraph in the document model.
constexpr TypedWhichId< SvxCrossedOutItem > EE_CHAR_STRIKEOUT(EE_CHAR_START+6)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
#define OOO_STRING_SVTOOLS_HTML_AL_right
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CJK_WEIGHT(26)
void SetLeft(const tools::Long nL, const sal_uInt16 nProp=100)
bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CTL(EE_CHAR_START+20)
#define OOO_STRING_SVTOOLS_HTML_BEHAV_slide
constexpr TypedWhichId< SvxEscapementItem > EE_CHAR_ESCAPEMENT(EE_CHAR_START+10)
SdrMetricItem makeSdrTextMinFrameHeightItem(tools::Long mnHeight)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CTL_WEIGHT(31)
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
::std::vector< HTMLOption > HTMLOptions
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT_CTL(EE_CHAR_START+22)
constexpr TypedWhichId< SvxColorItem > EE_CHAR_COLOR(EE_CHAR_START+0)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CTL_POSTURE(30)
tools::Long Height() const
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO(EE_CHAR_START+1)
#define OOO_STRING_SVTOOLS_HTML_BEHAV_scroll
void setHeight(tools::Long nHeight)
const SwStartNode * FindFlyStartNode() const
constexpr TypedWhichId< SvxPostureItem > EE_CHAR_ITALIC_CJK(EE_CHAR_START+23)
constexpr TypedWhichId< SvxUnderlineItem > EE_CHAR_UNDERLINE(EE_CHAR_START+5)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CJK(EE_CHAR_START+19)
const SfxItemPool & GetItemPool() const
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLBACKGROUND)
HTMLOptionEnum< sal_Int16 > const aHTMLImgHAlignTable[]
virtual const tools::Rectangle & GetLogicRect() const
constexpr sal_uInt16 SDRATTR_MISC_FIRST(SDRATTR_CAPTION_LAST+1)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
constexpr TypedWhichId< SvxKerningItem > RES_CHRATR_KERNING(9)
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
HTMLOptionEnum< SdrTextAniKind > const aHTMLMarqBehaviorTable[]
const SfxPoolItem * GetCurItem() const
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
sal_uInt16 GetUpper() const