41#include <osl/diagnose.h>
74 const Size& rPixSpace,
83 pNewDrawObj->
SetLayer(
m_xDoc->getIDocumentDrawModelAccess().GetInvisibleHeavenId() );
89 sal_uInt16 nLeftSpace = 0, nRightSpace = 0, nUpperSpace = 0, nLowerSpace = 0;
96 nLeftSpace = nRightSpace = o3tl::narrowing<sal_uInt16>(aTwipSpc.
Width());
97 nUpperSpace = nLowerSpace = o3tl::narrowing<sal_uInt16>(aTwipSpc.
Height());
107 nLeftSpace =
static_cast<sal_uInt16
>(pLeft->GetTextLeft());
116 nRightSpace =
static_cast< sal_uInt16
>(pRight->GetRight());
121 if( nLeftSpace || nRightSpace )
126 aFrameSet.Put( aLRItem );
135 nUpperSpace = pULItem->GetUpper();
140 nLowerSpace = pULItem->GetLower();
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:
281 case HtmlOptionId::BGCOLOR:
282 rOption.GetColor( aBGColor );
286 case HtmlOptionId::DIRECTION:
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 = o3tl::narrowing<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,
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 ) )
456 Size aTwipSz( bPercentWidth ? 0 : nWidth, nHeight );
467 bPercentWidth =
false;
473 if( !nWidth || bPercentWidth )
490 bPercentWidth =
true;
497 aTwipSz.
setWidth( !nWidth ? nBrowseWidth
498 : (nWidth*nBrowseWidth) / 100 );
507 m_pMarquee->SetMergedItemSetAndBroadcast(aItemSet);
522 if( pCurTable && bPercentWidth)
529 "no marquee or wrong type" );
537 Size( USHRT_MAX, 240 ) ) );
557 "no marquee or wrong type" );
566 "no marquee or wrong type" );
static OutputDevice * GetDefaultDevice()
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
static void ResetFrameFormatAttrs(SfxItemSet &rFrameSet)
const SfxItemPool & GetItemPool() const
const SdrPage * GetPage(sal_uInt16 nPgNum) const
static rtl::Reference< SdrObject > MakeNewObject(SdrModel &rSdrModel, SdrInventor nInventor, SdrObjKind nObjIdentifier, const tools::Rectangle *pSnapRect=nullptr)
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
virtual void SetLogicRect(const tools::Rectangle &rRect)
virtual SdrObjKind GetObjIdentifier() const
virtual void SetLayer(SdrLayerID nLayer)
virtual void SetRelativePos(const Point &rPnt)
virtual const tools::Rectangle & GetLogicRect() const
const SfxPoolItem * GetCurItem() const
const SfxPoolItem * NextItem()
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
std::unique_ptr< SfxPoolItem > CloneSetWhich(sal_uInt16 nNewWhich) const
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
const Color & GetColor() const
SvxCSS1LengthType m_eHeightType
SvxCSS1Position m_ePosition
SvxCSS1LengthType m_eWidthType
SvxCSS1LengthType m_eTopType
SvxCSS1LengthType m_eLeftType
void SetRight(const tools::Long nR, const sal_uInt16 nProp=100)
void SetLeft(const tools::Long nL, const sal_uInt16 nProp=100)
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
SwFormatColl & GetAnyFormatColl() const
std::shared_ptr< HTMLTable > m_xTable
void NewMarquee(HTMLTable *pCurTable=nullptr)
void InsertBookmark(const OUString &rName)
std::shared_ptr< HTMLAttrTable > m_xAttrTab
static bool HasStyleOptions(std::u16string_view rStyle, std::u16string_view rId, std::u16string_view rClass, const OUString *pLang=nullptr, const OUString *pDir=nullptr)
rtl::Reference< SwDoc > m_xDoc
bool ParseStyleOptions(const OUString &rStyle, const OUString &rId, const OUString &rClass, SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo, const OUString *pLang=nullptr, const OUString *pDir=nullptr)
rtl::Reference< SdrObject > m_pMarquee
std::unique_ptr< SwCSS1Parser > m_pCSS1Parser
SwTwips GetCurrentBrowseWidth()
void InsertDrawObject(SdrObject *pNewDrawObj, const Size &rSpace, sal_Int16 eVertOri, sal_Int16 eHoriOri, SfxItemSet &rCSS1ItemSet, SvxCSS1PropertyInfo &rCSS1PropInfo)
static void RegisterDrawObjectToTable(HTMLTable *pCurTable, SdrObject *pObj, sal_uInt8 nWidth)
static void ResizeDrawObject(SdrObject *pObj, SwTwips nWidth)
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
const SwStartNode * FindFlyStartNode() const
const SwPosition * GetPoint() const
Starts a section of nodes in the document model.
SwTextNode is a paragraph in the document model.
virtual void SetText(const OUString &rStr) override
constexpr TypedWhichId< SvxKerningItem > EE_CHAR_KERNING(EE_CHAR_START+12)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CJK(EE_CHAR_START+17)
constexpr TypedWhichId< SvxUnderlineItem > EE_CHAR_UNDERLINE(EE_CHAR_START+5)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT(EE_CHAR_START+2)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT(EE_CHAR_START+4)
constexpr TypedWhichId< SvxColorItem > EE_CHAR_COLOR(EE_CHAR_START+0)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT_CTL(EE_CHAR_START+22)
constexpr TypedWhichId< SvxCrossedOutItem > EE_CHAR_STRIKEOUT(EE_CHAR_START+6)
constexpr TypedWhichId< SvxPostureItem > EE_CHAR_ITALIC(EE_CHAR_START+7)
constexpr sal_uInt16 EE_CHAR_START(EE_PARA_END+1)
constexpr TypedWhichId< SvxEscapementItem > EE_CHAR_ESCAPEMENT(EE_CHAR_START+10)
constexpr sal_uInt16 EE_CHAR_END(EE_CHAR_START+32)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CTL(EE_CHAR_START+20)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT_CJK(EE_CHAR_START+21)
constexpr TypedWhichId< SvxPostureItem > EE_CHAR_ITALIC_CJK(EE_CHAR_START+23)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CTL(EE_CHAR_START+18)
constexpr TypedWhichId< SvxPostureItem > EE_CHAR_ITALIC_CTL(EE_CHAR_START+24)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CJK(EE_CHAR_START+19)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO(EE_CHAR_START+1)
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
constexpr TypedWhichId< SvxCrossedOutItem > RES_CHRATR_CROSSEDOUT(5)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
constexpr sal_uInt16 RES_FRMATR_END(141)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CTL_WEIGHT(31)
constexpr TypedWhichId< SvxEscapementItem > RES_CHRATR_ESCAPEMENT(6)
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_BACKGROUND(21)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CTL_POSTURE(30)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
constexpr TypedWhichId< SvxRightMarginItem > RES_MARGIN_RIGHT(93)
constexpr TypedWhichId< SvxTextLeftMarginItem > RES_MARGIN_TEXTLEFT(92)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CJK_WEIGHT(26)
constexpr TypedWhichId< SvxKerningItem > RES_CHRATR_KERNING(9)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CJK_POSTURE(25)
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(97)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(98)
HTMLOptionEnum< SdrTextAniDirection > const aHTMLMarqDirectionTable[]
static void PutEEPoolItem(SfxItemSet &rEEItemSet, const SfxPoolItem &rSwItem)
HTMLOptionEnum< SdrTextAniKind > const aHTMLMarqBehaviorTable[]
HTMLOptionEnum< sal_Int16 > const aHTMLImgVAlignTable[]
HTMLOptionEnum< sal_Int16 > const aHTMLImgHAlignTable[]
#define OOO_STRING_SVTOOLS_HTML_AL_left
#define OOO_STRING_SVTOOLS_HTML_BEHAV_slide
#define OOO_STRING_SVTOOLS_HTML_BEHAV_scroll
#define OOO_STRING_SVTOOLS_HTML_AL_right
#define OOO_STRING_SVTOOLS_HTML_BEHAV_alternate
#define OOO_STRING_SVTOOLS_HTML_LOOP_infinite
bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
::std::vector< HTMLOption > HTMLOptions
@ RES_POOLCOLL_STANDARD
Standard.
SdrOnOffItem makeSdrTextAutoGrowHeightItem(bool bAuto)
SdrOnOffItem makeSdrTextAutoGrowWidthItem(bool bAuto)
SdrMetricItem makeSdrTextMinFrameHeightItem(tools::Long mnHeight)
Marks a position in the document model.
constexpr sal_uInt16 SDRATTR_MISC_LAST(SDRATTR_TEXT_CLIPVERTOVERFLOW)
constexpr sal_uInt16 SDRATTR_MISC_FIRST(SDRATTR_CAPTION_LAST+1)
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLUSESLIDEBACKGROUND)