diff options
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/filter/html/css1atr.cxx | 34 | ||||
-rw-r--r-- | sw/source/filter/html/htmldrawwriter.cxx | 14 | ||||
-rw-r--r-- | sw/source/filter/html/htmlflywriter.cxx | 212 | ||||
-rw-r--r-- | sw/source/filter/html/htmlforw.cxx | 30 | ||||
-rw-r--r-- | sw/source/filter/html/htmlplug.cxx | 82 | ||||
-rw-r--r-- | sw/source/filter/html/wrthtml.hxx | 90 |
6 files changed, 230 insertions, 232 deletions
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index b3e37114e1d2..eb0aaac0be13 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -1969,7 +1969,7 @@ Writer& OutCSS1_NumBulListStyleOpt( Writer& rWrt, const SwNumRule& rNumRule, } void SwHTMLWriter::OutCSS1_FrameFormatOptions( const SwFrameFormat& rFrameFormat, - sal_uInt32 nFrameOpts, + HtmlFrmOpts nFrameOpts, const SdrObject *pSdrObj, const SfxItemSet *pItemSet ) { @@ -1980,7 +1980,7 @@ void SwHTMLWriter::OutCSS1_FrameFormatOptions( const SwFrameFormat& rFrameFormat const SwFormatHoriOrient& rHoriOri = rFrameFormat.GetHoriOrient(); SvxLRSpaceItem aLRItem( rFrameFormat.GetLRSpace() ); SvxULSpaceItem aULItem( rFrameFormat.GetULSpace() ); - if( nFrameOpts & HTML_FRMOPT_S_ALIGN ) + if( nFrameOpts & HtmlFrmOpts::SAlign ) { const SwFormatAnchor& rAnchor = rFrameFormat.GetAnchor(); switch( rAnchor.GetAnchorId() ) @@ -1990,7 +1990,7 @@ void SwHTMLWriter::OutCSS1_FrameFormatOptions( const SwFrameFormat& rFrameFormat if( text::RelOrientation::FRAME == rHoriOri.GetRelationOrient() || text::RelOrientation::PRINT_AREA == rHoriOri.GetRelationOrient() ) { - if( !(nFrameOpts & HTML_FRMOPT_ALIGN) ) + if( !(nFrameOpts & HtmlFrmOpts::Align) ) { // float const sal_Char *pStr = text::HoriOrientation::RIGHT==rHoriOri.GetHoriOrient() @@ -2082,7 +2082,7 @@ void SwHTMLWriter::OutCSS1_FrameFormatOptions( const SwFrameFormat& rFrameFormat } // width/height - if( nFrameOpts & HTML_FRMOPT_S_SIZE ) + if( nFrameOpts & HtmlFrmOpts::SSize ) { if( RES_DRAWFRMFMT == rFrameFormat.Which() ) { @@ -2093,17 +2093,17 @@ void SwHTMLWriter::OutCSS1_FrameFormatOptions( const SwFrameFormat& rFrameFormat if( pSdrObj ) { Size aTwipSz( pSdrObj->GetLogicRect().GetSize() ); - if( nFrameOpts & HTML_FRMOPT_S_WIDTH ) + if( nFrameOpts & HtmlFrmOpts::SWidth ) { - if( nFrameOpts & HTML_FRMOPT_S_PIXSIZE ) + if( nFrameOpts & HtmlFrmOpts::SPixSize ) OutCSS1_PixelProperty( sCSS1_P_width, aTwipSz.Width(), false ); else OutCSS1_UnitProperty( sCSS1_P_width, aTwipSz.Width() ); } - if( nFrameOpts & HTML_FRMOPT_S_HEIGHT ) + if( nFrameOpts & HtmlFrmOpts::SHeight ) { - if( nFrameOpts & HTML_FRMOPT_S_PIXSIZE ) + if( nFrameOpts & HtmlFrmOpts::SPixSize ) OutCSS1_PixelProperty( sCSS1_P_height, aTwipSz.Height(), true ); else @@ -2113,16 +2113,16 @@ void SwHTMLWriter::OutCSS1_FrameFormatOptions( const SwFrameFormat& rFrameFormat } else { - OSL_ENSURE( HTML_FRMOPT_ABSSIZE & nFrameOpts, + OSL_ENSURE( HtmlFrmOpts::AbsSize & nFrameOpts, "Export absolute size" ); - OSL_ENSURE( HTML_FRMOPT_ANYSIZE & nFrameOpts, + OSL_ENSURE( HtmlFrmOpts::AnySize & nFrameOpts, "Export every size" ); Css1FrameSize nMode = Css1FrameSize::NONE; - if( nFrameOpts & HTML_FRMOPT_S_WIDTH ) + if( nFrameOpts & HtmlFrmOpts::SWidth ) nMode |= Css1FrameSize::Width; - if( nFrameOpts & HTML_FRMOPT_S_HEIGHT ) + if( nFrameOpts & HtmlFrmOpts::SHeight ) nMode |= (Css1FrameSize::MinHeight|Css1FrameSize::FixHeight); - if( nFrameOpts & HTML_FRMOPT_S_PIXSIZE ) + if( nFrameOpts & HtmlFrmOpts::SPixSize ) nMode |= Css1FrameSize::Pixel; OutCSS1_SwFormatFrameSize( *this, rFrameFormat.GetFrameSize(), nMode ); @@ -2131,7 +2131,7 @@ void SwHTMLWriter::OutCSS1_FrameFormatOptions( const SwFrameFormat& rFrameFormat const SfxItemSet& rItemSet = rFrameFormat.GetAttrSet(); // margin-* - if( (nFrameOpts & HTML_FRMOPT_S_SPACE) && + if( (nFrameOpts & HtmlFrmOpts::SSpace) && IsHTMLMode( HTMLMODE_FLY_MARGINS) ) { const SvxLRSpaceItem *pLRItem = nullptr; @@ -2145,17 +2145,17 @@ void SwHTMLWriter::OutCSS1_FrameFormatOptions( const SwFrameFormat& rFrameFormat } // border - if( nFrameOpts & HTML_FRMOPT_S_BORDER ) + if( nFrameOpts & HtmlFrmOpts::SBorder ) { const SfxPoolItem* pItem; - if( nFrameOpts & HTML_FRMOPT_S_NOBORDER ) + if( nFrameOpts & HtmlFrmOpts::SNoBorder ) OutCSS1_SvxBox( *this, rFrameFormat.GetBox() ); else if( SfxItemState::SET==rItemSet.GetItemState( RES_BOX, true, &pItem ) ) OutCSS1_SvxBox( *this, *pItem ); } // background (if, then the color must be set also) - if( nFrameOpts & HTML_FRMOPT_S_BACKGROUND ) + if( nFrameOpts & HtmlFrmOpts::SBackground ) OutCSS1_FrameFormatBackground( rFrameFormat ); if( pItemSet ) diff --git a/sw/source/filter/html/htmldrawwriter.cxx b/sw/source/filter/html/htmldrawwriter.cxx index 2debe01231ba..083f6a2df31f 100644 --- a/sw/source/filter/html/htmldrawwriter.cxx +++ b/sw/source/filter/html/htmldrawwriter.cxx @@ -55,13 +55,13 @@ using namespace css; -const sal_uInt32 HTML_FRMOPTS_MARQUEE = - HTML_FRMOPT_ALIGN | - HTML_FRMOPT_SPACE; +const HtmlFrmOpts HTML_FRMOPTS_MARQUEE = + HtmlFrmOpts::Align | + HtmlFrmOpts::Space; -const sal_uInt32 HTML_FRMOPTS_MARQUEE_CSS1 = - HTML_FRMOPT_S_ALIGN | - HTML_FRMOPT_S_SPACE; +const HtmlFrmOpts HTML_FRMOPTS_MARQUEE_CSS1 = + HtmlFrmOpts::SAlign | + HtmlFrmOpts::SSpace; const SdrObject *SwHTMLWriter::GetMarqueeTextObj( const SwDrawFrameFormat& rFormat ) { @@ -283,7 +283,7 @@ Writer& OutHTML_DrawFrameFormatAsMarquee( Writer& rWrt, rWrt.Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() ); // und nun noch ALIGN, HSPACE und VSPACE - sal_uInt32 nFrameFlags = HTML_FRMOPTS_MARQUEE; + HtmlFrmOpts nFrameFlags = HTML_FRMOPTS_MARQUEE; if( rHTMLWrt.IsHTMLMode( HTMLMODE_ABS_POS_DRAW ) ) nFrameFlags |= HTML_FRMOPTS_MARQUEE_CSS1; OString aEndTags = rHTMLWrt.OutFrameFormatOptions( rFormat, aEmptyOUStr, nFrameFlags ); diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index 22b900c3ee18..a70d868ecfd0 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -65,66 +65,66 @@ using namespace css; -const sal_uLong HTML_FRMOPTS_IMG_ALL = - HTML_FRMOPT_ALT | - HTML_FRMOPT_SIZE | - HTML_FRMOPT_ANYSIZE | - HTML_FRMOPT_BORDER | - HTML_FRMOPT_NAME; -const sal_uLong HTML_FRMOPTS_IMG_CNTNR = +const HtmlFrmOpts HTML_FRMOPTS_IMG_ALL = + HtmlFrmOpts::Alt | + HtmlFrmOpts::Size | + HtmlFrmOpts::AnySize | + HtmlFrmOpts::Border | + HtmlFrmOpts::Name; +const HtmlFrmOpts HTML_FRMOPTS_IMG_CNTNR = HTML_FRMOPTS_IMG_ALL | - HTML_FRMOPT_ABSSIZE; -const sal_uLong HTML_FRMOPTS_IMG = + HtmlFrmOpts::AbsSize; +const HtmlFrmOpts HTML_FRMOPTS_IMG = HTML_FRMOPTS_IMG_ALL | - HTML_FRMOPT_ALIGN | - HTML_FRMOPT_SPACE | - HTML_FRMOPT_BRCLEAR; -const sal_uLong HTML_FRMOPTS_IMG_CSS1 = - HTML_FRMOPT_S_ALIGN | - HTML_FRMOPT_S_SPACE; - -const sal_uLong HTML_FRMOPTS_DIV = - HTML_FRMOPT_ID | - HTML_FRMOPT_S_ALIGN | - HTML_FRMOPT_S_SIZE | - HTML_FRMOPT_ANYSIZE | - HTML_FRMOPT_ABSSIZE | - HTML_FRMOPT_S_SPACE | - HTML_FRMOPT_S_BORDER | - HTML_FRMOPT_S_BACKGROUND | - HTML_FRMOPT_BRCLEAR | - HTML_FRMOPT_DIR; - -const sal_uLong HTML_FRMOPTS_MULTICOL = - HTML_FRMOPT_ID | - HTML_FRMOPT_WIDTH | - HTML_FRMOPT_ANYSIZE | - HTML_FRMOPT_ABSSIZE | - HTML_FRMOPT_DIR; -const sal_uLong HTML_FRMOPTS_MULTICOL_CNTNR = + HtmlFrmOpts::Align | + HtmlFrmOpts::Space | + HtmlFrmOpts::BrClear; +const HtmlFrmOpts HTML_FRMOPTS_IMG_CSS1 = + HtmlFrmOpts::SAlign | + HtmlFrmOpts::SSpace; + +const HtmlFrmOpts HTML_FRMOPTS_DIV = + HtmlFrmOpts::Id | + HtmlFrmOpts::SAlign | + HtmlFrmOpts::SSize | + HtmlFrmOpts::AnySize | + HtmlFrmOpts::AbsSize | + HtmlFrmOpts::SSpace | + HtmlFrmOpts::SBorder | + HtmlFrmOpts::SBackground | + HtmlFrmOpts::BrClear | + HtmlFrmOpts::Dir; + +const HtmlFrmOpts HTML_FRMOPTS_MULTICOL = + HtmlFrmOpts::Id | + HtmlFrmOpts::Width | + HtmlFrmOpts::AnySize | + HtmlFrmOpts::AbsSize | + HtmlFrmOpts::Dir; +const HtmlFrmOpts HTML_FRMOPTS_MULTICOL_CNTNR = HTML_FRMOPTS_MULTICOL; -const sal_uLong HTML_FRMOPTS_MULTICOL_CSS1 = - HTML_FRMOPT_S_ALIGN | - HTML_FRMOPT_S_SIZE | - HTML_FRMOPT_S_SPACE | - HTML_FRMOPT_S_BORDER| - HTML_FRMOPT_S_BACKGROUND; - -const sal_uLong HTML_FRMOPTS_SPACER = - HTML_FRMOPT_ALIGN | - HTML_FRMOPT_SIZE | - HTML_FRMOPT_ANYSIZE | - HTML_FRMOPT_BRCLEAR | - HTML_FRMOPT_MARGINSIZE | - HTML_FRMOPT_ABSSIZE; - -const sal_uLong HTML_FRMOPTS_CNTNR = - HTML_FRMOPT_S_ALIGN | - HTML_FRMOPT_S_SPACE | - HTML_FRMOPT_S_WIDTH | - HTML_FRMOPT_ANYSIZE | - HTML_FRMOPT_ABSSIZE | - HTML_FRMOPT_S_PIXSIZE; +const HtmlFrmOpts HTML_FRMOPTS_MULTICOL_CSS1 = + HtmlFrmOpts::SAlign | + HtmlFrmOpts::SSize | + HtmlFrmOpts::SSpace | + HtmlFrmOpts::SBorder| + HtmlFrmOpts::SBackground; + +const HtmlFrmOpts HTML_FRMOPTS_SPACER = + HtmlFrmOpts::Align | + HtmlFrmOpts::Size | + HtmlFrmOpts::AnySize | + HtmlFrmOpts::BrClear | + HtmlFrmOpts::MarginSize | + HtmlFrmOpts::AbsSize; + +const HtmlFrmOpts HTML_FRMOPTS_CNTNR = + HtmlFrmOpts::SAlign | + HtmlFrmOpts::SSpace | + HtmlFrmOpts::SWidth | + HtmlFrmOpts::AnySize | + HtmlFrmOpts::AbsSize | + HtmlFrmOpts::SPixSize; static Writer& OutHTML_FrameFormatTableNode( Writer& rWrt, const SwFrameFormat& rFrameFormat ); static Writer& OutHTML_FrameFormatAsMulticol( Writer& rWrt, const SwFrameFormat& rFormat, @@ -443,14 +443,14 @@ void SwHTMLWriter::OutFrameFormat( AllHtmlFlags nMode, const SwFrameFormat& rFra Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() ); // Output a width for non-draw objects - sal_uLong nFrameFlags = HTML_FRMOPTS_CNTNR; + HtmlFrmOpts nFrameFlags = HTML_FRMOPTS_CNTNR; // For frames with columns we can also output the background if( HtmlOut::MultiCol == nOutMode ) - nFrameFlags |= HTML_FRMOPT_S_BACKGROUND|HTML_FRMOPT_S_BORDER; + nFrameFlags |= HtmlFrmOpts::SBackground|HtmlFrmOpts::SBorder; if( IsHTMLMode( HTMLMODE_BORDER_NONE ) ) - nFrameFlags |= HTML_FRMOPT_S_NOBORDER; + nFrameFlags |= HtmlFrmOpts::SNoBorder; OutCSS1_FrameFormatOptions( rFrameFormat, nFrameFlags, pSdrObject ); Strm().WriteChar( '>' ); @@ -520,7 +520,7 @@ void SwHTMLWriter::OutFrameFormat( AllHtmlFlags nMode, const SwFrameFormat& rFra OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, const OUString& rAlternateText, - sal_uInt32 nFrameOpts ) + HtmlFrmOpts nFrameOpts ) { OString sRetEndTags; OStringBuffer sOut; @@ -528,11 +528,11 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, const SfxItemSet& rItemSet = rFrameFormat.GetAttrSet(); // Name - if( (nFrameOpts & (HTML_FRMOPT_ID|HTML_FRMOPT_NAME)) && + if( (nFrameOpts & (HtmlFrmOpts::Id|HtmlFrmOpts::Name)) && !rFrameFormat.GetName().isEmpty() ) { const sal_Char *pStr = - (nFrameOpts & HTML_FRMOPT_ID) ? OOO_STRING_SVTOOLS_HTML_O_id : OOO_STRING_SVTOOLS_HTML_O_name; + (nFrameOpts & HtmlFrmOpts::Id) ? OOO_STRING_SVTOOLS_HTML_O_id : OOO_STRING_SVTOOLS_HTML_O_name; sOut.append(' ').append(pStr). append("=\""); Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() ); @@ -541,7 +541,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, } // Name - if( nFrameOpts & HTML_FRMOPT_DIR ) + if( nFrameOpts & HtmlFrmOpts::Dir ) { sal_uInt16 nDir = GetHTMLDirection( rItemSet ); Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() ); @@ -549,7 +549,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, } // ALT - if( (nFrameOpts & HTML_FRMOPT_ALT) && !rAlternateText.isEmpty() ) + if( (nFrameOpts & HtmlFrmOpts::Alt) && !rAlternateText.isEmpty() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_alt). append("=\""); @@ -561,14 +561,14 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, // ALIGN const sal_Char *pStr = nullptr; RndStdIds eAnchorId = rFrameFormat.GetAnchor().GetAnchorId(); - if( (nFrameOpts & HTML_FRMOPT_ALIGN) && + if( (nFrameOpts & HtmlFrmOpts::Align) && ((FLY_AT_PARA == eAnchorId) || (FLY_AT_CHAR == eAnchorId)) ) { // MIB 12.3.98: Wouldn't it be more clever to left-align frames that // are anchored to a paragraph if necessary, instead of inserting them // as being anchored to characters? const SwFormatHoriOrient& rHoriOri = rFrameFormat.GetHoriOrient(); - if( !(nFrameOpts & HTML_FRMOPT_S_ALIGN) || + if( !(nFrameOpts & HtmlFrmOpts::SAlign) || text::RelOrientation::FRAME == rHoriOri.GetRelationOrient() || text::RelOrientation::PRINT_AREA == rHoriOri.GetRelationOrient() ) { @@ -577,8 +577,8 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, : OOO_STRING_SVTOOLS_HTML_AL_left; } } - if( (nFrameOpts & HTML_FRMOPT_ALIGN) && !pStr && - ( (nFrameOpts & HTML_FRMOPT_S_ALIGN) == 0 || + if( (nFrameOpts & HtmlFrmOpts::Align) && !pStr && + ( !(nFrameOpts & HtmlFrmOpts::SAlign) || (FLY_AS_CHAR == eAnchorId) ) && SfxItemState::SET == rItemSet.GetItemState( RES_VERT_ORIENT, true, &pItem )) { @@ -604,7 +604,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, // HSPACE und VSPACE Size aTwipSpc( 0, 0 ); - if( (nFrameOpts & (HTML_FRMOPT_SPACE|HTML_FRMOPT_MARGINSIZE)) && + if( (nFrameOpts & (HtmlFrmOpts::Space|HtmlFrmOpts::MarginSize)) && SfxItemState::SET == rItemSet.GetItemState( RES_LR_SPACE, true, &pItem )) { aTwipSpc.Width() = @@ -612,7 +612,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, static_cast<const SvxLRSpaceItem*>(pItem)->GetRight() ) / 2; m_nDfltLeftMargin = m_nDfltRightMargin = aTwipSpc.Width(); } - if( (nFrameOpts & (HTML_FRMOPT_SPACE|HTML_FRMOPT_MARGINSIZE)) && + if( (nFrameOpts & (HtmlFrmOpts::Space|HtmlFrmOpts::MarginSize)) && SfxItemState::SET == rItemSet.GetItemState( RES_UL_SPACE, true, &pItem )) { aTwipSpc.Height() = @@ -621,7 +621,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, m_nDfltTopMargin = m_nDfltBottomMargin = (sal_uInt16)aTwipSpc.Height(); } - if( (nFrameOpts & HTML_FRMOPT_SPACE) && + if( (nFrameOpts & HtmlFrmOpts::Space) && (aTwipSpc.Width() || aTwipSpc.Height()) && Application::GetDefaultDevice() ) { @@ -648,7 +648,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, // The spacing must be considered for the size, if the corresponding flag // is set. - if( (nFrameOpts & HTML_FRMOPT_MARGINSIZE) ) + if( (nFrameOpts & HtmlFrmOpts::MarginSize) ) { aTwipSpc.Width() *= -2; aTwipSpc.Height() *= -2; @@ -659,7 +659,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, aTwipSpc.Height() = 0; } - if( !(nFrameOpts & HTML_FRMOPT_ABSSIZE) && + if( !(nFrameOpts & HtmlFrmOpts::AbsSize) && SfxItemState::SET == rItemSet.GetItemState( RES_BOX, true, &pItem )) { const SvxBoxItem* pBoxItem = static_cast<const SvxBoxItem*>(pItem); @@ -672,9 +672,9 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, // WIDTH and/or HEIGHT // Output ATT_VAR_SIZE/ATT_MIN_SIZE only, if ANYSIZE is set - if( (nFrameOpts & HTML_FRMOPT_SIZE) && + if( (nFrameOpts & HtmlFrmOpts::Size) && SfxItemState::SET == rItemSet.GetItemState( RES_FRM_SIZE, true, &pItem ) && - ( (nFrameOpts & HTML_FRMOPT_ANYSIZE) || + ( (nFrameOpts & HtmlFrmOpts::AnySize) || ATT_FIX_SIZE == static_cast<const SwFormatFrameSize *>(pItem)->GetHeightSizeType()) ) { const SwFormatFrameSize *pFSItem = static_cast<const SwFormatFrameSize *>(pItem); @@ -707,7 +707,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, aPixelSz.Height() = 1; } - if( (nFrameOpts & HTML_FRMOPT_WIDTH) && + if( (nFrameOpts & HtmlFrmOpts::Width) && ((nPrcWidth && nPrcWidth!=255) || aPixelSz.Width()) ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_width). @@ -719,7 +719,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, sOut.append("\""); } - if( (nFrameOpts & HTML_FRMOPT_HEIGHT) && + if( (nFrameOpts & HtmlFrmOpts::Height) && ((nPrcHeight && nPrcHeight!=255) || aPixelSz.Height()) ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_height). @@ -737,7 +737,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, // Insert wrap for graphics that are anchored to a paragraph as // <BR CLEAR=...> in the string - if( (nFrameOpts & HTML_FRMOPT_BRCLEAR) && + if( (nFrameOpts & HtmlFrmOpts::BrClear) && ((FLY_AT_PARA == rFrameFormat.GetAnchor().GetAnchorId()) || (FLY_AT_CHAR == rFrameFormat.GetAnchor().GetAnchorId())) && SfxItemState::SET == rItemSet.GetItemState( RES_SURROUND, true, &pItem )) @@ -802,21 +802,21 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, return sRetEndTags; } -void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameFormat& rFrameFormat, const OUString& rAlternateText, sal_uInt32 nFrameOptions) +void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameFormat& rFrameFormat, const OUString& rAlternateText, HtmlFrmOpts nFrameOptions) { const SfxPoolItem* pItem; const SfxItemSet& rItemSet = rFrameFormat.GetAttrSet(); // Name - if( (nFrameOptions & (HTML_FRMOPT_ID|HTML_FRMOPT_NAME)) && + if( (nFrameOptions & (HtmlFrmOpts::Id|HtmlFrmOpts::Name)) && !rFrameFormat.GetName().isEmpty() ) { - const sal_Char* pAttributeName = (nFrameOptions & HTML_FRMOPT_ID) ? OOO_STRING_SVTOOLS_HTML_O_id : OOO_STRING_SVTOOLS_HTML_O_name; + const sal_Char* pAttributeName = (nFrameOptions & HtmlFrmOpts::Id) ? OOO_STRING_SVTOOLS_HTML_O_id : OOO_STRING_SVTOOLS_HTML_O_name; aHtml.attribute(pAttributeName, rFrameFormat.GetName()); } // Name - if (nFrameOptions & HTML_FRMOPT_DIR) + if (nFrameOptions & HtmlFrmOpts::Dir) { sal_uInt16 nCurrentDirection = GetHTMLDirection(rItemSet); OString sDirection = convertDirection(nCurrentDirection); @@ -824,7 +824,7 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma } // alt - if( (nFrameOptions & HTML_FRMOPT_ALT) && !rAlternateText.isEmpty() ) + if( (nFrameOptions & HtmlFrmOpts::Alt) && !rAlternateText.isEmpty() ) { aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_alt, rAlternateText); } @@ -832,11 +832,11 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma // align const sal_Char* pAlignString = nullptr; RndStdIds eAnchorId = rFrameFormat.GetAnchor().GetAnchorId(); - if( (nFrameOptions & HTML_FRMOPT_ALIGN) && + if( (nFrameOptions & HtmlFrmOpts::Align) && ((FLY_AT_PARA == eAnchorId) || (FLY_AT_CHAR == eAnchorId)) ) { const SwFormatHoriOrient& rHoriOri = rFrameFormat.GetHoriOrient(); - if( !(nFrameOptions & HTML_FRMOPT_S_ALIGN) || + if( !(nFrameOptions & HtmlFrmOpts::SAlign) || text::RelOrientation::FRAME == rHoriOri.GetRelationOrient() || text::RelOrientation::PRINT_AREA == rHoriOri.GetRelationOrient() ) { @@ -845,8 +845,8 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma : OOO_STRING_SVTOOLS_HTML_AL_left; } } - if( (nFrameOptions & HTML_FRMOPT_ALIGN) && !pAlignString && - ( (nFrameOptions & HTML_FRMOPT_S_ALIGN) == 0 || + if( (nFrameOptions & HtmlFrmOpts::Align) && !pAlignString && + ( !(nFrameOptions & HtmlFrmOpts::SAlign) || (FLY_AS_CHAR == eAnchorId) ) && SfxItemState::SET == rItemSet.GetItemState( RES_VERT_ORIENT, true, &pItem )) { @@ -871,7 +871,7 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma // hspace and vspace Size aTwipSpc( 0, 0 ); - if( (nFrameOptions & (HTML_FRMOPT_SPACE | HTML_FRMOPT_MARGINSIZE)) && + if( (nFrameOptions & (HtmlFrmOpts::Space | HtmlFrmOpts::MarginSize)) && SfxItemState::SET == rItemSet.GetItemState( RES_LR_SPACE, true, &pItem )) { aTwipSpc.Width() = @@ -879,7 +879,7 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma static_cast<const SvxLRSpaceItem*>(pItem)->GetRight() ) / 2; m_nDfltLeftMargin = m_nDfltRightMargin = aTwipSpc.Width(); } - if( (nFrameOptions & (HTML_FRMOPT_SPACE|HTML_FRMOPT_MARGINSIZE)) && + if( (nFrameOptions & (HtmlFrmOpts::Space|HtmlFrmOpts::MarginSize)) && SfxItemState::SET == rItemSet.GetItemState( RES_UL_SPACE, true, &pItem )) { aTwipSpc.Height() = @@ -888,7 +888,7 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma m_nDfltTopMargin = m_nDfltBottomMargin = (sal_uInt16)aTwipSpc.Height(); } - if( (nFrameOptions & HTML_FRMOPT_SPACE) && + if( (nFrameOptions & HtmlFrmOpts::Space) && (aTwipSpc.Width() || aTwipSpc.Height()) && Application::GetDefaultDevice() ) { @@ -913,7 +913,7 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma // The spacing must be considered for the size, if the corresponding flag // is set. - if( (nFrameOptions & HTML_FRMOPT_MARGINSIZE) ) + if( (nFrameOptions & HtmlFrmOpts::MarginSize) ) { aTwipSpc.Width() *= -2; aTwipSpc.Height() *= -2; @@ -924,7 +924,7 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma aTwipSpc.Height() = 0; } - if( !(nFrameOptions & HTML_FRMOPT_ABSSIZE) && + if( !(nFrameOptions & HtmlFrmOpts::AbsSize) && SfxItemState::SET == rItemSet.GetItemState( RES_BOX, true, &pItem )) { const SvxBoxItem* pBoxItem = static_cast<const SvxBoxItem*>(pItem); @@ -937,9 +937,9 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma // "width" and/or "height" // Only output ATT_VAR_SIZE/ATT_MIN_SIZE if ANYSIZE is set - if( (nFrameOptions & HTML_FRMOPT_SIZE) && + if( (nFrameOptions & HtmlFrmOpts::Size) && SfxItemState::SET == rItemSet.GetItemState( RES_FRM_SIZE, true, &pItem ) && - ( (nFrameOptions & HTML_FRMOPT_ANYSIZE) || + ( (nFrameOptions & HtmlFrmOpts::AnySize) || ATT_FIX_SIZE == static_cast<const SwFormatFrameSize *>(pItem)->GetHeightSizeType()) ) { const SwFormatFrameSize *pFSItem = static_cast<const SwFormatFrameSize *>(pItem); @@ -972,7 +972,7 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma aPixelSz.Height() = 1; } - if( (nFrameOptions & HTML_FRMOPT_WIDTH) && + if( (nFrameOptions & HtmlFrmOpts::Width) && ((nPrcWidth && nPrcWidth!=255) || aPixelSz.Width()) ) { OString sWidth; @@ -983,7 +983,7 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_width, sWidth); } - if( (nFrameOptions & HTML_FRMOPT_HEIGHT) && + if( (nFrameOptions & HtmlFrmOpts::Height) && ((nPrcHeight && nPrcHeight!=255) || aPixelSz.Height()) ) { OString sHeight; @@ -998,7 +998,7 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma // Insert wrap for graphics that are anchored to a paragraph as // <BR CLEAR=...> in the string - if( (nFrameOptions & HTML_FRMOPT_BRCLEAR) && + if( (nFrameOptions & HtmlFrmOpts::BrClear) && ((FLY_AT_PARA == rFrameFormat.GetAnchor().GetAnchorId()) || (FLY_AT_CHAR == rFrameFormat.GetAnchor().GetAnchorId())) && SfxItemState::SET == rItemSet.GetItemState( RES_SURROUND, true, &pItem )) @@ -1201,7 +1201,7 @@ OUString lclWriteOutImap(SwHTMLWriter& rHTMLWrt, const SfxItemSet& rItemSet, con Writer& OutHTML_Image( Writer& rWrt, const SwFrameFormat &rFrameFormat, const OUString& rGraphicURL, Graphic& rGraphic, const OUString& rAlternateText, - const Size &rRealSize, sal_uInt32 nFrameOpts, + const Size &rRealSize, HtmlFrmOpts nFrameOpts, const sal_Char *pMarkType, const ImageMap *pAltImgMap ) { @@ -1294,7 +1294,7 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrameFormat &rFrameFormat, // <font color = ...>...<img ... >...</font> sal_uInt16 nBorderWidth = 0; - if( (nFrameOpts & HTML_FRMOPT_BORDER) && + if( (nFrameOpts & HtmlFrmOpts::Border) && SfxItemState::SET == rItemSet.GetItemState( RES_BOX, true, &pItem )) { Size aTwipBorder( 0, 0 ); @@ -1394,7 +1394,7 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrameFormat &rFrameFormat, if( rHTMLWrt.IsHTMLMode( HTMLMODE_ABS_POS_FLY ) ) rHTMLWrt.OutCSS1_FrameFormatOptions( rFrameFormat, nFrameOpts ); - if( nFrameOpts & HTML_FRMOPT_BORDER ) + if( nFrameOpts & HtmlFrmOpts::Border ) { aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_border, nBorderWidth); } @@ -1585,7 +1585,7 @@ static Writer & OutHTML_FrameFormatAsMulticol( Writer& rWrt, rWrt.Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() ); // WIDTH - sal_uLong nFrameFlags = bInCntnr ? HTML_FRMOPTS_MULTICOL_CNTNR + HtmlFrmOpts nFrameFlags = bInCntnr ? HTML_FRMOPTS_MULTICOL_CNTNR : HTML_FRMOPTS_MULTICOL; if( rHTMLWrt.IsHTMLMode( HTMLMODE_ABS_POS_FLY ) && !bInCntnr ) nFrameFlags |= HTML_FRMOPTS_MULTICOL_CSS1; @@ -1671,9 +1671,9 @@ static Writer& OutHTML_FrameFormatAsDivOrSpan( Writer& rWrt, sOut.append('<').append(pStr); rWrt.Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() ); - sal_uLong nFrameFlags = HTML_FRMOPTS_DIV; + HtmlFrmOpts nFrameFlags = HTML_FRMOPTS_DIV; if( rHTMLWrt.IsHTMLMode( HTMLMODE_BORDER_NONE ) ) - nFrameFlags |= HTML_FRMOPT_S_NOBORDER; + nFrameFlags |= HtmlFrmOpts::SNoBorder; OString aEndTags = rHTMLWrt.OutFrameFormatOptions( rFrameFormat, aEmptyOUStr, nFrameFlags ); rHTMLWrt.OutCSS1_FrameFormatOptions( rFrameFormat, nFrameFlags ); rWrt.Strm().WriteChar( '>' ); @@ -1744,7 +1744,7 @@ static Writer & OutHTML_FrameFormatAsImage( Writer& rWrt, const SwFrameFormat& r } OutHTML_Image( rWrt, rFrameFormat, GraphicURL, aGraphic, rFrameFormat.GetName(), aSz, - HTML_FRMOPTS_GENIMG, "frame", + HtmlFrmOpts::GenImgMask, "frame", aIMap.GetIMapObjectCount() ? &aIMap : nullptr ); return rWrt; @@ -1765,7 +1765,7 @@ static Writer& OutHTML_FrameFormatGrfNode( Writer& rWrt, const SwFrameFormat& rF if( !pGrfNd ) return rWrt; - sal_uLong nFrameFlags = bInCntnr ? HTML_FRMOPTS_IMG_CNTNR : HTML_FRMOPTS_IMG; + HtmlFrmOpts nFrameFlags = bInCntnr ? HTML_FRMOPTS_IMG_CNTNR : HTML_FRMOPTS_IMG; if( rHTMLWrt.IsHTMLMode( HTMLMODE_ABS_POS_FLY ) && !bInCntnr ) nFrameFlags |= HTML_FRMOPTS_IMG_CSS1; diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx index eab6e05d87e4..897ba95f976d 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -68,19 +68,19 @@ using namespace ::com::sun::star; -const sal_uInt32 HTML_FRMOPTS_CONTROL = - 0; -const sal_uInt32 HTML_FRMOPTS_CONTROL_CSS1 = - HTML_FRMOPT_S_ALIGN | - HTML_FRMOPT_S_SIZE | - HTML_FRMOPT_S_SPACE | - HTML_FRMOPT_BRCLEAR; -const sal_uInt32 HTML_FRMOPTS_IMG_CONTROL = - HTML_FRMOPT_ALIGN | - HTML_FRMOPT_BRCLEAR; -const sal_uInt32 HTML_FRMOPTS_IMG_CONTROL_CSS1 = - HTML_FRMOPT_S_ALIGN | - HTML_FRMOPT_S_SPACE; +const HtmlFrmOpts HTML_FRMOPTS_CONTROL = + HtmlFrmOpts::NONE; +const HtmlFrmOpts HTML_FRMOPTS_CONTROL_CSS1 = + HtmlFrmOpts::SAlign | + HtmlFrmOpts::SSize | + HtmlFrmOpts::SSpace | + HtmlFrmOpts::BrClear; +const HtmlFrmOpts HTML_FRMOPTS_IMG_CONTROL = + HtmlFrmOpts::Align | + HtmlFrmOpts::BrClear; +const HtmlFrmOpts HTML_FRMOPTS_IMG_CONTROL_CSS1 = + HtmlFrmOpts::SAlign | + HtmlFrmOpts::SSpace; static void lcl_html_outEvents( SvStream& rStrm, const uno::Reference< form::XFormComponent >& rFormComp, @@ -718,7 +718,7 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt, bool bEmptyValue = false; uno::Any aTmp = xPropSet->getPropertyValue( "ClassId" ); sal_Int16 nClassId = *o3tl::doAccess<sal_Int16>(aTmp); - sal_uInt32 nFrameOpts = HTML_FRMOPTS_CONTROL; + HtmlFrmOpts nFrameOpts = HTML_FRMOPTS_CONTROL; switch( nClassId ) { case form::FormComponentType::CHECKBOX: @@ -1039,7 +1039,7 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt, : HTML_FRMOPTS_CONTROL_CSS1); } OString aEndTags; - if( nFrameOpts != 0 ) + if( nFrameOpts != HtmlFrmOpts::NONE ) aEndTags = rHTMLWrt.OutFrameFormatOptions( rFormat, aEmptyOUStr, nFrameOpts ); if( rHTMLWrt.m_bCfgOutStyles ) diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index cedeafd75ee1..1845d8aac3e1 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -71,51 +71,51 @@ using namespace com::sun::star; #define HTML_DFLT_APPLET_HEIGHT ((MM50*5)/2) -const sal_uLong HTML_FRMOPTS_EMBED_ALL = - HTML_FRMOPT_ALT | - HTML_FRMOPT_SIZE | - HTML_FRMOPT_NAME; -const sal_uLong HTML_FRMOPTS_EMBED_CNTNR = +const HtmlFrmOpts HTML_FRMOPTS_EMBED_ALL = + HtmlFrmOpts::Alt | + HtmlFrmOpts::Size | + HtmlFrmOpts::Name; +const HtmlFrmOpts HTML_FRMOPTS_EMBED_CNTNR = HTML_FRMOPTS_EMBED_ALL | - HTML_FRMOPT_ABSSIZE; -const sal_uLong HTML_FRMOPTS_EMBED = + HtmlFrmOpts::AbsSize; +const HtmlFrmOpts HTML_FRMOPTS_EMBED = HTML_FRMOPTS_EMBED_ALL | - HTML_FRMOPT_ALIGN | - HTML_FRMOPT_SPACE | - HTML_FRMOPT_BRCLEAR | - HTML_FRMOPT_NAME; -const sal_uLong HTML_FRMOPTS_HIDDEN_EMBED = - HTML_FRMOPT_ALT | - HTML_FRMOPT_NAME; - -const sal_uLong HTML_FRMOPTS_APPLET_ALL = - HTML_FRMOPT_ALT | - HTML_FRMOPT_SIZE; -const sal_uLong HTML_FRMOPTS_APPLET_CNTNR = + HtmlFrmOpts::Align | + HtmlFrmOpts::Space | + HtmlFrmOpts::BrClear | + HtmlFrmOpts::Name; +const HtmlFrmOpts HTML_FRMOPTS_HIDDEN_EMBED = + HtmlFrmOpts::Alt | + HtmlFrmOpts::Name; + +const HtmlFrmOpts HTML_FRMOPTS_APPLET_ALL = + HtmlFrmOpts::Alt | + HtmlFrmOpts::Size; +const HtmlFrmOpts HTML_FRMOPTS_APPLET_CNTNR = HTML_FRMOPTS_APPLET_ALL | - HTML_FRMOPT_ABSSIZE; -const sal_uLong HTML_FRMOPTS_APPLET = + HtmlFrmOpts::AbsSize; +const HtmlFrmOpts HTML_FRMOPTS_APPLET = HTML_FRMOPTS_APPLET_ALL | - HTML_FRMOPT_ALIGN | - HTML_FRMOPT_SPACE | - HTML_FRMOPT_BRCLEAR; - -const sal_uLong HTML_FRMOPTS_IFRAME_ALL = - HTML_FRMOPT_ALT | - HTML_FRMOPT_SIZE; -const sal_uLong HTML_FRMOPTS_IFRAME_CNTNR = + HtmlFrmOpts::Align | + HtmlFrmOpts::Space | + HtmlFrmOpts::BrClear; + +const HtmlFrmOpts HTML_FRMOPTS_IFRAME_ALL = + HtmlFrmOpts::Alt | + HtmlFrmOpts::Size; +const HtmlFrmOpts HTML_FRMOPTS_IFRAME_CNTNR = HTML_FRMOPTS_IFRAME_ALL | - HTML_FRMOPT_ABSSIZE; -const sal_uLong HTML_FRMOPTS_IFRAME = + HtmlFrmOpts::AbsSize; +const HtmlFrmOpts HTML_FRMOPTS_IFRAME = HTML_FRMOPTS_IFRAME_ALL | - HTML_FRMOPT_ALIGN | - HTML_FRMOPT_SPACE | - HTML_FRMOPT_BORDER | - HTML_FRMOPT_BRCLEAR; + HtmlFrmOpts::Align | + HtmlFrmOpts::Space | + HtmlFrmOpts::Border | + HtmlFrmOpts::BrClear; -const sal_uLong HTML_FRMOPTS_OLE_CSS1 = - HTML_FRMOPT_S_ALIGN | - HTML_FRMOPT_S_SPACE; +const HtmlFrmOpts HTML_FRMOPTS_OLE_CSS1 = + HtmlFrmOpts::SAlign | + HtmlFrmOpts::SSpace; void SwHTMLParser::SetFixSize( const Size& rPixSize, const Size& rTwipDfltSize, @@ -1000,7 +1000,7 @@ Writer& OutHTML_FrameFormatOLENode( Writer& rWrt, const SwFrameFormat& rFrameFor return rWrt; } - sal_uLong nFrameOpts; + HtmlFrmOpts nFrameOpts; // wenn meoglich vor dem "Objekt" einen Zeilen-Umbruch ausgeben if( rHTMLWrt.m_bLFPossible ) @@ -1323,8 +1323,8 @@ Writer& OutHTML_FrameFormatOLENodeGrf( Writer& rWrt, const SwFrameFormat& rFrame URIHelper::GetMaybeFileHdl() ); } - sal_uLong nFlags = bInCntnr ? HTML_FRMOPTS_GENIMG_CNTNR - : HTML_FRMOPTS_GENIMG; + HtmlFrmOpts nFlags = bInCntnr ? HtmlFrmOpts::GenImgAllMask + : HtmlFrmOpts::GenImgMask; OutHTML_Image( rWrt, rFrameFormat, aGraphicURL, aGraphic, pOLENd->GetTitle(), pOLENd->GetTwipSize(), nFlags, "ole" ); diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx index b637a611844c..7694b179f295 100644 --- a/sw/source/filter/html/wrthtml.hxx +++ b/sw/source/filter/html/wrthtml.hxx @@ -29,6 +29,7 @@ #include <i18nlangtag/lang.h> #include <comphelper/stl_types.hxx> #include <o3tl/sorted_vector.hxx> +#include <o3tl/typed_flags_set.hxx> #include "shellio.hxx" #include "wrt_fn.hxx" @@ -67,46 +68,43 @@ extern SwAttrFnTab aHTMLAttrFnTab; // BORDER geht nur bei OutHTML_Image // ANYSIZE gibt an, ob auch VAR_SIZE und MIN_SIZE angaben exportiert werden // ABSSIZE gibt an, ob Abstand und Umrandung ignoriert werden sollen -const sal_uInt32 HTML_FRMOPT_ALIGN = 1<<0; -const sal_uInt32 HTML_FRMOPT_S_ALIGN = 1<<1; - -const sal_uInt32 HTML_FRMOPT_WIDTH = 1<<2; -const sal_uInt32 HTML_FRMOPT_HEIGHT = 1<<3; -const sal_uInt32 HTML_FRMOPT_SIZE = HTML_FRMOPT_WIDTH|HTML_FRMOPT_HEIGHT; -const sal_uInt32 HTML_FRMOPT_S_WIDTH = 1<<4; -const sal_uInt32 HTML_FRMOPT_S_HEIGHT = 1<<5; -const sal_uInt32 HTML_FRMOPT_S_SIZE = HTML_FRMOPT_S_WIDTH|HTML_FRMOPT_S_HEIGHT; -const sal_uInt32 HTML_FRMOPT_ANYSIZE = 1<<6; -const sal_uInt32 HTML_FRMOPT_ABSSIZE = 1<<7; -const sal_uInt32 HTML_FRMOPT_MARGINSIZE = 1<<8; - -const sal_uInt32 HTML_FRMOPT_SPACE = 1<<9; -const sal_uInt32 HTML_FRMOPT_S_SPACE = 1<<10; - -const sal_uInt32 HTML_FRMOPT_BORDER = 1<<11; -const sal_uInt32 HTML_FRMOPT_S_BORDER = 1<<12; -const sal_uInt32 HTML_FRMOPT_S_NOBORDER = 1<<13; - -const sal_uInt32 HTML_FRMOPT_S_BACKGROUND = 1<<14; - -const sal_uInt32 HTML_FRMOPT_NAME = 1<<15; -const sal_uInt32 HTML_FRMOPT_ALT = 1<<16; -const sal_uInt32 HTML_FRMOPT_BRCLEAR = 1<<17; -const sal_uInt32 HTML_FRMOPT_S_PIXSIZE = 1<<18; -const sal_uInt32 HTML_FRMOPT_ID = 1<<19; -const sal_uInt32 HTML_FRMOPT_DIR = 1<<20; - -const sal_uInt32 HTML_FRMOPTS_GENIMG_ALL = - HTML_FRMOPT_ALT | - HTML_FRMOPT_SIZE | - HTML_FRMOPT_ABSSIZE | - HTML_FRMOPT_NAME; -const sal_uInt32 HTML_FRMOPTS_GENIMG_CNTNR = HTML_FRMOPTS_GENIMG_ALL; -const sal_uInt32 HTML_FRMOPTS_GENIMG = - HTML_FRMOPTS_GENIMG_ALL | - HTML_FRMOPT_ALIGN | - HTML_FRMOPT_SPACE | - HTML_FRMOPT_BRCLEAR; +enum class HtmlFrmOpts { + NONE = 0, + Align = 1<<0, + SAlign = 1<<1, + + Width = 1<<2, + Height = 1<<3, + Size = Width | Height, + SWidth = 1<<4, + SHeight = 1<<5, + SSize = SWidth | SHeight, + AnySize = 1<<6, + AbsSize = 1<<7, + MarginSize = 1<<8, + + Space = 1<<9, + SSpace = 1<<10, + + Border = 1<<11, + SBorder = 1<<12, + SNoBorder = 1<<13, + + SBackground = 1<<14, + + Name = 1<<15, + Alt = 1<<16, + BrClear = 1<<17, + SPixSize = 1<<18, + Id = 1<<19, + Dir = 1<<20, + + GenImgAllMask = Alt | Size | AbsSize | Name, + GenImgMask = GenImgAllMask | Align | Space | BrClear +}; +namespace o3tl { + template<> struct typed_flags<HtmlFrmOpts> : is_typed_flags<HtmlFrmOpts, ((1<<21)-1)> {}; +} #define HTMLMODE_BLOCK_SPACER 0x00010000 #define HTMLMODE_FLOAT_FRAME 0x00020000 @@ -466,16 +464,16 @@ public: // Frame-Formats ausgeben und ggf. ein <BR CLEAR=...> vorne an // rEndTags anhaengen OString OutFrameFormatOptions( const SwFrameFormat& rFrameFormat, const OUString& rAltText, - sal_uInt32 nFrameOpts ); + HtmlFrmOpts nFrameOpts ); - void writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameFormat& rFrameFormat, const OUString& rAltText, sal_uInt32 nFrameOpts); + void writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameFormat& rFrameFormat, const OUString& rAltText, HtmlFrmOpts nFrameOpts); void OutCSS1_TableFrameFormatOptions( const SwFrameFormat& rFrameFormat ); void OutCSS1_TableCellBorderHack(const SwFrameFormat& rFrameFormat); void OutCSS1_SectionFormatOptions( const SwFrameFormat& rFrameFormat, const SwFormatCol *pCol ); - void OutCSS1_FrameFormatOptions( const SwFrameFormat& rFrameFormat, sal_uInt32 nFrameOpts, - const SdrObject *pSdrObj=nullptr, - const SfxItemSet *pItemSet=nullptr ); + void OutCSS1_FrameFormatOptions( const SwFrameFormat& rFrameFormat, HtmlFrmOpts nFrameOpts, + const SdrObject *pSdrObj=nullptr, + const SfxItemSet *pItemSet=nullptr ); void OutCSS1_FrameFormatBackground( const SwFrameFormat& rFrameFormat ); void ChangeParaToken( sal_uInt16 nNew ); @@ -648,7 +646,7 @@ Writer& OutHTML_HeaderFooter( Writer& rWrt, const SwFrameFormat& rFrameFormat, Writer& OutHTML_Image( Writer&, const SwFrameFormat& rFormat, const OUString& rGraphicURL, Graphic& rGraphic, const OUString& rAlternateText, - const Size& rRealSize, sal_uInt32 nFrameOpts, + const Size& rRealSize, HtmlFrmOpts nFrameOpts, const sal_Char *pMarkType, const ImageMap *pGenImgMap = nullptr ); |