summaryrefslogtreecommitdiff
path: root/sw/source/filter
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-09-07 11:40:35 +0200
committerNoel Grandin <noel@peralex.com>2016-09-07 11:40:35 +0200
commit93136caef5a34d2d4017376fa7192d332765431b (patch)
tree7e22fd81d4e662ca7e3cb2a39010e6c37859b8fe /sw/source/filter
parent15da84c9c3a5323075c5e97ccd595a130f54cf20 (diff)
convert HTML_FF flags to typed_flags
Change-Id: I61c1c008925bcd4b51de327004b73e1c18b34189
Diffstat (limited to 'sw/source/filter')
-rw-r--r--sw/source/filter/html/htmlcss1.cxx10
-rw-r--r--sw/source/filter/html/htmlctxt.cxx4
-rw-r--r--sw/source/filter/html/htmlgrin.cxx2
-rw-r--r--sw/source/filter/html/htmlsect.cxx2
-rw-r--r--sw/source/filter/html/swhtml.hxx16
5 files changed, 20 insertions, 14 deletions
diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx
index 619c5ae94b44..d502957d051d 100644
--- a/sw/source/filter/html/htmlcss1.cxx
+++ b/sw/source/filter/html/htmlcss1.cxx
@@ -2085,14 +2085,14 @@ void SwHTMLParser::SetVarSize( SfxItemSet & /*rItemSet*/,
void SwHTMLParser::SetFrameFormatAttrs( SfxItemSet &rItemSet,
SvxCSS1PropertyInfo & /*rPropInfo*/,
- sal_uInt16 nFlags,
+ HtmlFrameFormatFlags nFlags,
SfxItemSet &rFrameItemSet )
{
const SfxPoolItem *pItem;
- if( (nFlags & HTML_FF_BOX) != 0 &&
+ if( (nFlags & HtmlFrameFormatFlags::Box) &&
SfxItemState::SET==rItemSet.GetItemState( RES_BOX, true, &pItem ) )
{
- if( (nFlags & HTML_FF_PADDING) == 0 )
+ if( nFlags & HtmlFrameFormatFlags::Padding )
{
SvxBoxItem aBoxItem( *static_cast<const SvxBoxItem *>(pItem) );
// reset all 4 sides to 0
@@ -2106,14 +2106,14 @@ void SwHTMLParser::SetFrameFormatAttrs( SfxItemSet &rItemSet,
rItemSet.ClearItem( RES_BOX );
}
- if( (nFlags & HTML_FF_BACKGROUND) != 0 &&
+ if( (nFlags & HtmlFrameFormatFlags::Background) &&
SfxItemState::SET==rItemSet.GetItemState( RES_BACKGROUND, true, &pItem ) )
{
rFrameItemSet.Put( *pItem );
rItemSet.ClearItem( RES_BACKGROUND );
}
- if( (nFlags & HTML_FF_DIRECTION) != 0 &&
+ if( (nFlags & HtmlFrameFormatFlags::Direction) &&
SfxItemState::SET==rItemSet.GetItemState( RES_FRAMEDIR, true, &pItem ) )
{
rFrameItemSet.Put( *pItem );
diff --git a/sw/source/filter/html/htmlctxt.cxx b/sw/source/filter/html/htmlctxt.cxx
index 73176ecc265a..780cd6ce893d 100644
--- a/sw/source/filter/html/htmlctxt.cxx
+++ b/sw/source/filter/html/htmlctxt.cxx
@@ -440,7 +440,7 @@ bool SwHTMLParser::DoPositioning( SfxItemSet &rItemSet,
// Sonstige CSS1-Attribute Setzen
SetFrameFormatAttrs( rItemSet, rPropInfo,
- HTML_FF_BOX|HTML_FF_PADDING|HTML_FF_BACKGROUND|HTML_FF_DIRECTION,
+ HtmlFrameFormatFlags::Box|HtmlFrameFormatFlags::Padding|HtmlFrameFormatFlags::Background|HtmlFrameFormatFlags::Direction,
aFrameItemSet );
InsertFlyFrame( aFrameItemSet, pContext, rPropInfo.aId,
@@ -473,7 +473,7 @@ bool SwHTMLParser::CreateContainer( const OUString& rClass,
SetFixSize( aDummy, aDummy, false, false, rItemSet, rPropInfo,
*pFrameItemSet );
SetSpace( aDummy, rItemSet, rPropInfo, *pFrameItemSet );
- SetFrameFormatAttrs( rItemSet, rPropInfo, HTML_FF_BOX|HTML_FF_BACKGROUND|HTML_FF_DIRECTION,
+ SetFrameFormatAttrs( rItemSet, rPropInfo, HtmlFrameFormatFlags::Box|HtmlFrameFormatFlags::Background|HtmlFrameFormatFlags::Direction,
*pFrameItemSet );
bRet = true;
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index 938a77fee396..3b1a5f0b60f5 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -547,7 +547,7 @@ IMAGE_SETEVENT:
SetSpace( Size( nHSpace, nVSpace), aItemSet, aPropInfo, aFrameSet );
// Sonstige CSS1-Attribute Setzen
- SetFrameFormatAttrs( aItemSet, aPropInfo, HTML_FF_BOX, aFrameSet );
+ SetFrameFormatAttrs( aItemSet, aPropInfo, HtmlFrameFormatFlags::Box, aFrameSet );
Size aTwipSz( bPrcWidth ? 0 : nWidth, bPrcHeight ? 0 : nHeight );
if( (aTwipSz.Width() || aTwipSz.Height()) && Application::GetDefaultDevice() )
diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx
index c8899324b606..488758e86f05 100644
--- a/sw/source/filter/html/htmlsect.cxx
+++ b/sw/source/filter/html/htmlsect.cxx
@@ -636,7 +636,7 @@ void SwHTMLParser::NewMultiCol( sal_uInt16 columnsFromCss )
// it will be cleared here. That for, it won't be set at the section,
// too.
SetFrameFormatAttrs( aItemSet, aPropInfo,
- HTML_FF_BOX|HTML_FF_BACKGROUND|HTML_FF_PADDING|HTML_FF_DIRECTION,
+ HtmlFrameFormatFlags::Box|HtmlFrameFormatFlags::Background|HtmlFrameFormatFlags::Padding|HtmlFrameFormatFlags::Direction,
aFrameItemSet );
// Insert fly frame. If the are columns, the fly frame's name is not
diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx
index 2dca6129e946..0448c8072955 100644
--- a/sw/source/filter/html/swhtml.hxx
+++ b/sw/source/filter/html/swhtml.hxx
@@ -344,10 +344,16 @@ typedef std::vector<std::unique_ptr<ImageMap>> ImageMaps;
(HTML_CNTXT_PROTECT_STACK | \
HTML_CNTXT_STRIP_PARA)
-#define HTML_FF_BOX 0x0001
-#define HTML_FF_BACKGROUND 0x0002
-#define HTML_FF_PADDING 0x0004
-#define HTML_FF_DIRECTION 0x0008
+enum class HtmlFrameFormatFlags {
+ Box = 0x0001,
+ Background = 0x0002,
+ Padding = 0x0004,
+ Direction = 0x0008,
+};
+namespace o3tl
+{
+ template<> struct typed_flags<HtmlFrameFormatFlags> : is_typed_flags<HtmlFrameFormatFlags, 0x0f> {};
+}
class SwHTMLParser : public SfxHTMLParser, public SwClient
{
@@ -669,7 +675,7 @@ private:
SfxItemSet &rFrameItemSet );
static void SetFrameFormatAttrs( SfxItemSet &rItemSet, SvxCSS1PropertyInfo &rPropInfo,
- sal_uInt16 nFlags, SfxItemSet &rFrameItemSet );
+ HtmlFrameFormatFlags nFlags, SfxItemSet &rFrameItemSet );
// Frames anlegen und Auto-gebundene Rahmen registrieren
void RegisterFlyFrame( SwFrameFormat *pFlyFrame );