[Libreoffice-commits] .: 2 commits - sfx2/source starmath/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sun Jan 13 23:28:53 PST 2013
sfx2/source/doc/objstor.cxx | 8 +++-----
starmath/source/mathmlimport.cxx | 6 +++---
2 files changed, 6 insertions(+), 8 deletions(-)
New commits:
commit 56c4deae00e42719652b3f8cc3375180d7fd801e
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Sat Jan 12 23:18:28 2013 +0100
-Werror,-Wtautological-constant-out-of-range-compare
...comparing enum aToken.eType with -1
Change-Id: Ied886e8e455e6deae762da78e366dc12e37a76cf
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index 6bc1b93..8ab181e 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -795,10 +795,10 @@ void SmXMLContext_Helper::ApplyAttrs()
//StarMath for now.
const SvXMLTokenMap& rTokenMap =
rContext.GetSmImport().GetColorTokenMap();
- aToken.eType = static_cast<SmTokenType>(rTokenMap.Get(
- XML_NAMESPACE_MATH, sColor));
- if (aToken.eType != -1)
+ sal_uInt16 tok = rTokenMap.Get(XML_NAMESPACE_MATH, sColor);
+ if (tok != XML_TOK_UNKNOWN)
{
+ aToken.eType = static_cast<SmTokenType>(tok);
SmFontNode *pFontNode = new SmFontNode(aToken);
pFontNode->SetSubNodes(0,lcl_popOrZero(rNodeStack));
rNodeStack.push(pFontNode);
commit 8cc6699ade4e1e1b7b00d7034b12c3aec2ed50e9
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Sat Jan 12 21:36:45 2013 +0100
-Werror,-Wtautological-constant-out-of-range-compare
...comparing enum eOption with -1
Change-Id: I927b71d1e9988a39ffc1be585ab4bdecfd16b226
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 887be25..d646e5f 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;
More information about the Libreoffice-commits
mailing list