diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-09-21 12:33:05 +0200 |
---|---|---|
committer | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-09-21 12:37:37 +0000 |
commit | 5057c70ed8fea6f68c1bb28cfc35243d46cf712b (patch) | |
tree | 7ab53d37e6f5f4d9b148dfe90da60fc55d8894d6 | |
parent | adfb650bec005a46c2192852a8f5801497a19611 (diff) |
remove #defines for HtmlContextFlags masks
InsertFlyFrame was always called with CONTEXT_FLAGS_ABSPOS mask.
Put the value of CONTEXT_FLAGS_ABSPOS in the function and remove
parameter.
CONTEXT_FLAGS_MULTICOL is used for headers/footers and footnote
contexts. Put the mask in the enum class.
Change-Id: I9b1bcd27270ee7fc0eddfaf10afa430a36b2adc9
Reviewed-on: https://gerrit.libreoffice.org/29138
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
-rw-r--r-- | sw/source/filter/html/htmlctxt.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/html/htmlsect.cxx | 15 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.hxx | 7 |
3 files changed, 8 insertions, 17 deletions
diff --git a/sw/source/filter/html/htmlctxt.cxx b/sw/source/filter/html/htmlctxt.cxx index bca76fb844c4..dee8fc7a6908 100644 --- a/sw/source/filter/html/htmlctxt.cxx +++ b/sw/source/filter/html/htmlctxt.cxx @@ -443,8 +443,7 @@ bool SwHTMLParser::DoPositioning( SfxItemSet &rItemSet, HtmlFrameFormatFlags::Box|HtmlFrameFormatFlags::Padding|HtmlFrameFormatFlags::Background|HtmlFrameFormatFlags::Direction, aFrameItemSet ); - InsertFlyFrame( aFrameItemSet, pContext, rPropInfo.aId, - CONTEXT_FLAGS_ABSPOS ); + InsertFlyFrame(aFrameItemSet, pContext, rPropInfo.aId); pContext->SetPopStack( true ); rPropInfo.aId.clear(); bRet = true; diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx index 423706e55781..7b8d2c8ed2ae 100644 --- a/sw/source/filter/html/htmlsect.cxx +++ b/sw/source/filter/html/htmlsect.cxx @@ -52,11 +52,6 @@ #include "swcss1.hxx" #include "swhtml.hxx" -#define CONTEXT_FLAGS_MULTICOL (HtmlContextFlags::StripPara | \ - HtmlContextFlags::KeepNumrule | \ - HtmlContextFlags::KeepAttrs) -#define CONTEXT_FLAGS_HDRFTR (CONTEXT_FLAGS_MULTICOL) -#define CONTEXT_FLAGS_FTN (CONTEXT_FLAGS_MULTICOL) using namespace ::com::sun::star; @@ -149,7 +144,7 @@ void SwHTMLParser::NewDivision( int nToken ) SwFrameFormat *pHdFtFormat; bool bNew = false; - HtmlContextFlags nFlags = CONTEXT_FLAGS_HDRFTR; + HtmlContextFlags nFlags = HtmlContextFlags::MultiColMask; if( bHeader ) { pHdFtFormat = const_cast<SwFrameFormat*>(rPageFormat.GetHeader().GetHeaderFormat()); @@ -233,7 +228,7 @@ void SwHTMLParser::NewDivision( int nToken ) m_pDoc->GetNodes()[pStartNdIdx->GetIndex()+1]->GetContentNode(); SwNodeIndex aTmpSwNodeIndex = SwNodeIndex(*pCNd); SwPosition aNewPos( aTmpSwNodeIndex, SwIndex( pCNd, 0 ) ); - SaveDocContext( pCntxt, CONTEXT_FLAGS_FTN, &aNewPos ); + SaveDocContext( pCntxt, HtmlContextFlags::MultiColMask, &aNewPos ); aId.clear(); aPropInfo.aId.clear(); } @@ -648,7 +643,7 @@ void SwHTMLParser::NewMultiCol( sal_uInt16 columnsFromCss ) aPropInfo.aId.clear(); } - InsertFlyFrame( aFrameItemSet, pCntxt, aFlyName, CONTEXT_FLAGS_ABSPOS ); + InsertFlyFrame(aFrameItemSet, pCntxt, aFlyName); pCntxt->SetPopStack( true ); bPositioned = true; @@ -764,8 +759,7 @@ void SwHTMLParser::NewMultiCol( sal_uInt16 columnsFromCss ) void SwHTMLParser::InsertFlyFrame( const SfxItemSet& rItemSet, HTMLAttrContext *pCntxt, - const OUString& rName, - HtmlContextFlags nFlags ) + const OUString& rName ) { RndStdIds eAnchorId = static_cast<const SwFormatAnchor&>(rItemSet.Get( RES_ANCHOR )).GetAnchorId(); @@ -785,6 +779,7 @@ void SwHTMLParser::InsertFlyFrame( const SfxItemSet& rItemSet, ->GetContentNode(); SwPosition aNewPos( SwNodeIndex( rFlyCntIdx, 1 ), SwIndex( pCNd, 0 ) ); + const HtmlContextFlags nFlags = (HtmlContextFlags::ProtectStack|HtmlContextFlags::StripPara); SaveDocContext( pCntxt, nFlags, &aNewPos ); } diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx index 204f51566a4d..e861d2f811f9 100644 --- a/sw/source/filter/html/swhtml.hxx +++ b/sw/source/filter/html/swhtml.hxx @@ -340,16 +340,13 @@ enum class HtmlContextFlags { HeaderDist = 0x0008, FooterDist = 0x0010, KeepAttrs = 0x0020, + MultiColMask = StripPara | KeepNumrule | KeepAttrs // for headers, footers or footnotes }; namespace o3tl { template<> struct typed_flags<HtmlContextFlags> : is_typed_flags<HtmlContextFlags, 0x03f> {}; } -#define CONTEXT_FLAGS_ABSPOS \ - (HtmlContextFlags::ProtectStack | \ - HtmlContextFlags::StripPara) - enum class HtmlFrameFormatFlags { Box = 0x0001, Background = 0x0002, @@ -595,7 +592,7 @@ class SwHTMLParser : public SfxHTMLParser, public SwClient // Fly-Frames einfuegen/verlassen void InsertFlyFrame( const SfxItemSet& rItemSet, HTMLAttrContext *pCntxt, - const OUString& rId, HtmlContextFlags nFlags ); + const OUString& rId ); void SaveDocContext( HTMLAttrContext *pCntxt, HtmlContextFlags nFlags, const SwPosition *pNewPos ); |