summaryrefslogtreecommitdiff
path: root/sw/inc/shellio.hxx
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-11-27 17:34:48 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-11-27 17:44:32 +0100
commit08bd772ce46a2e31019058bcd991580338093c65 (patch)
treed8a37b762db39c170e211a9d2d68a126bb7dcd7f /sw/inc/shellio.hxx
parent08fdc4f365e84bcb7fa22a96b0399d4c2e902e28 (diff)
type punning is all fun, but lets only use it when its really needed
Change-Id: Id6726d85f8f99020b7d13d7dc15448379249b2fa
Diffstat (limited to 'sw/inc/shellio.hxx')
-rw-r--r--sw/inc/shellio.hxx44
1 files changed, 18 insertions, 26 deletions
diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx
index a234095086ee..cd05f4eb91ce 100644
--- a/sw/inc/shellio.hxx
+++ b/sw/inc/shellio.hxx
@@ -104,44 +104,36 @@ typedef Reader *SwRead;
class SwgReaderOption
{
SwAsciiOptions aASCIIOpts;
- union
- {
- bool bFormatsOnly;
- struct
- {
- bool bFrameFormats: 1;
- bool bPageDescs: 1;
- bool bTextFormats: 1;
- bool bNumRules: 1;
- bool bMerge:1;
- } Formats;
- } What;
-
+ bool m_bFrameFormats;
+ bool m_bPageDescs;
+ bool m_bTextFormats;
+ bool m_bNumRules;
+ bool m_bMerge;
public:
- void ResetAllFormatsOnly() { What.bFormatsOnly = false; }
- bool IsFormatsOnly() const { return What.bFormatsOnly; }
+ void ResetAllFormatsOnly() { m_bFrameFormats = m_bPageDescs = m_bTextFormats = m_bNumRules = m_bMerge = false; }
+ bool IsFormatsOnly() const { return m_bFrameFormats || m_bPageDescs || m_bTextFormats || m_bNumRules || m_bMerge; }
- bool IsFrameFormats() const { return What.Formats.bFrameFormats; }
- void SetFrameFormats( const bool bNew) { What.Formats.bFrameFormats = bNew; }
+ bool IsFrameFormats() const { return m_bFrameFormats; }
+ void SetFrameFormats( const bool bNew) { m_bFrameFormats = bNew; }
- bool IsPageDescs() const { return What.Formats.bPageDescs; }
- void SetPageDescs( const bool bNew) { What.Formats.bPageDescs = bNew; }
+ bool IsPageDescs() const { return m_bPageDescs; }
+ void SetPageDescs( const bool bNew) { m_bPageDescs = bNew; }
- bool IsTextFormats() const { return What.Formats.bTextFormats; }
- void SetTextFormats( const bool bNew) { What.Formats.bTextFormats = bNew; }
+ bool IsTextFormats() const { return m_bTextFormats; }
+ void SetTextFormats( const bool bNew) { m_bTextFormats = bNew; }
- bool IsNumRules() const { return What.Formats.bNumRules; }
- void SetNumRules( const bool bNew) { What.Formats.bNumRules = bNew; }
+ bool IsNumRules() const { return m_bNumRules; }
+ void SetNumRules( const bool bNew) { m_bNumRules = bNew; }
- bool IsMerge() const { return What.Formats.bMerge; }
- void SetMerge( const bool bNew ) { What.Formats.bMerge = bNew; }
+ bool IsMerge() const { return m_bMerge; }
+ void SetMerge( const bool bNew ) { m_bMerge = bNew; }
const SwAsciiOptions& GetASCIIOpts() const { return aASCIIOpts; }
void SetASCIIOpts( const SwAsciiOptions& rOpts ) { aASCIIOpts = rOpts; }
void ResetASCIIOpts() { aASCIIOpts.Reset(); }
SwgReaderOption()
- { ResetAllFormatsOnly(); aASCIIOpts.Reset(); }
+ { ResetAllFormatsOnly(); aASCIIOpts.Reset(); }
};
class SW_DLLPUBLIC SwReader: public SwDocFac