diff options
author | Tor Lillqvist <tml@iki.fi> | 2013-04-05 00:15:06 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-04-05 00:19:28 +0300 |
commit | 6afeb7e00c4cb4bc7fee17cf460a37952a1384a9 (patch) | |
tree | f3012edb605a91542ff2b499cb878267836e8742 /sw/inc | |
parent | 8facc8e9863a87890c62c97158fceb5c9bbb6c21 (diff) |
Simpler and cleaner way to get rid of rulers and scrollbars for non-DESKTOP
Modify the IsView*() inline functions in the viewoprt.hxx header to
always return sal_False for non-DESKTOP. No ifdefs in the source
files. Presumably when optimizing the compiler will notice that the
inlined function always returns false and not generate code for the
unwanted case.
Change-Id: I07a4bc57cd621f63839d8e8bf551d40250fd9078
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/viewopt.hxx | 42 |
1 files changed, 37 insertions, 5 deletions
diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx index 8efc3d40b1a7..6e99bdd18258 100644 --- a/sw/inc/viewopt.hxx +++ b/sw/inc/viewopt.hxx @@ -16,8 +16,12 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ + #ifndef _VIEWOPT_HXX #define _VIEWOPT_HXX + +#include <config_features.h> + #include <tools/gen.hxx> #include <tools/string.hxx> #include <tools/color.hxx> @@ -441,9 +445,21 @@ public: ----------------------------------------------------------------------------*/ sal_Bool IsViewVScrollBar() const - { return nUIOptions & VIEWOPT_2_VSCROLLBAR ? sal_True : sal_False; } + { +#if HAVE_FEATURE_DESKTOP + return nUIOptions & VIEWOPT_2_VSCROLLBAR ? sal_True : sal_False; +#else + return sal_False; +#endif + } sal_Bool IsViewHScrollBar() const - { return nUIOptions & VIEWOPT_2_HSCROLLBAR ? sal_True : sal_False; } + { +#if HAVE_FEATURE_DESKTOP + return nUIOptions & VIEWOPT_2_HSCROLLBAR ? sal_True : sal_False; +#else + return sal_False; +#endif + } sal_Bool IsKeepRatio() const { return nUIOptions & VIEWOPT_2_KEEPASPECTRATIO ? sal_True : sal_False; } sal_Bool IsGrfKeepZoom() const @@ -479,25 +495,37 @@ public: const Color& GetRetoucheColor() const { return aRetoucheColor;} void SetRetoucheColor(const Color&r) { aRetoucheColor = r; } - sal_Bool IsViewAnyRuler() const {return 0 != (nUIOptions & VIEWOPT_2_ANY_RULER);} + sal_Bool IsViewAnyRuler() const + { +#if HAVE_FEATURE_DESKTOP + return 0 != (nUIOptions & VIEWOPT_2_ANY_RULER); +#else + return sal_False; +#endif + } void SetViewAnyRuler(sal_Bool bSet) { bSet ? (nUIOptions |= VIEWOPT_2_ANY_RULER) : (nUIOptions &= ~VIEWOPT_2_ANY_RULER);} - sal_Bool IsViewHRuler(sal_Bool bDirect = sal_False) const + sal_Bool IsViewHRuler(sal_Bool bDirect = sal_False) const { +#if HAVE_FEATURE_DESKTOP sal_Bool bRet = sal::static_int_cast< sal_Bool >( bDirect ? 0 != (nUIOptions & VIEWOPT_2_H_RULER) : !bReadonly ? (nUIOptions & (VIEWOPT_2_ANY_RULER|VIEWOPT_2_H_RULER)) == (VIEWOPT_2_ANY_RULER|VIEWOPT_2_H_RULER) : sal_False ); return bRet; - +#else + (void) bDirect; + return sal_False; +#endif } void SetViewHRuler (sal_Bool b) { b ? (nUIOptions |= VIEWOPT_2_H_RULER ) : ( nUIOptions &= ~VIEWOPT_2_H_RULER);} sal_Bool IsViewVRuler(sal_Bool bDirect = sal_False) const { +#if HAVE_FEATURE_DESKTOP sal_Bool bRet = sal::static_int_cast< sal_Bool >( bDirect ? 0 !=(nUIOptions & VIEWOPT_2_V_RULER) : !bReadonly ? @@ -505,6 +533,10 @@ public: (VIEWOPT_2_ANY_RULER|VIEWOPT_2_V_RULER)) == (VIEWOPT_2_ANY_RULER|VIEWOPT_2_V_RULER) : sal_False ); return bRet; +#else + (void) bDirect; + return sal_False; +#endif } void SetViewVRuler (sal_Bool b) { b ? (nUIOptions |= VIEWOPT_2_V_RULER ) : ( nUIOptions &= ~VIEWOPT_2_V_RULER);} |