From 8cc6699ade4e1e1b7b00d7034b12c3aec2ed50e9 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sat, 12 Jan 2013 21:36:45 +0100 Subject: -Werror,-Wtautological-constant-out-of-range-compare ...comparing enum eOption with -1 Change-Id: I927b71d1e9988a39ffc1be585ab4bdecfd16b226 --- sfx2/source/doc/objstor.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'sfx2/source/doc') diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 887be25e167d..d646e5f13ab0 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2874,7 +2874,7 @@ sal_Int16 SfxObjectShell::QueryHiddenInformation( HiddenWarningFact eFact, Windo { sal_Int16 nRet = RET_YES; sal_uInt16 nResId = 0; - SvtSecurityOptions::EOption eOption = static_cast< SvtSecurityOptions::EOption >( -1 ); + SvtSecurityOptions::EOption eOption; switch ( eFact ) { @@ -2903,12 +2903,10 @@ sal_Int16 SfxObjectShell::QueryHiddenInformation( HiddenWarningFact eFact, Windo break; } default: - { - SAL_WARN( "sfx2.doc", "SfxObjectShell::DetectHiddenInformation(): what fact?" ); - } + assert(false); // this cannot happen } - if ( eOption != -1 && SvtSecurityOptions().IsOptionSet( eOption ) ) + if ( SvtSecurityOptions().IsOptionSet( eOption ) ) { String sMessage( SfxResId(STR_HIDDENINFO_CONTAINS).toString() ); sal_uInt16 nWantedStates = HIDDENINFORMATION_RECORDEDCHANGES | HIDDENINFORMATION_NOTES; -- cgit