[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sd/source writerfilter/source xmloff/source

Petr Mladek pmladek at kemper.freedesktop.org
Tue Jul 31 06:22:28 PDT 2012


 sd/source/core/sdpage.cxx                           |    6 +++---
 sd/source/filter/ppt/pptanimations.hxx              |    2 +-
 writerfilter/source/ooxml/OOXMLFastTokenHandler.cxx |   12 ++++++++++++
 xmloff/source/style/weighhdl.cxx                    |    2 +-
 4 files changed, 17 insertions(+), 5 deletions(-)

New commits:
commit 10790f7a0bcf0fdcfafedda8c98a8f6ef845fd38
Author: Michael Stahl <mst at openoffice.org>
Date:   Tue Jul 31 14:47:26 2012 +0200

    sd, sfx2, writerfilter, xmloff: fix some warnings
    
    Signed-off-by: Petr Mladek <pmladek at suse.cz>

diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 1fd344d..8313c84 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -1390,7 +1390,7 @@ void findAutoLayoutShapesImpl( SdPage& rPage, const LayoutDescriptor& rDescripto
     bool bMissing = false;
 
     // for each entry in the layoutdescriptor, arrange a presentation shape
-    for( i = 0; (i < PRESOBJ_MAX) && (rDescriptor.meKind[i] != PRESOBJ_NONE); i++ )
+    for (i = 0; (i < MAX_PRESOBJS) && (rDescriptor.meKind[i] != PRESOBJ_NONE); i++)
     {
         PresObjKind eKind = rDescriptor.meKind[i];
         SdrObject* pObj = 0;
@@ -1412,7 +1412,7 @@ void findAutoLayoutShapesImpl( SdPage& rPage, const LayoutDescriptor& rDescripto
     if( bMissing && bInit )
     {
         // for each entry in the layoutdescriptor, look for an alternative shape
-        for( i = 0; (i < PRESOBJ_MAX) && (rDescriptor.meKind[i] != PRESOBJ_NONE); i++ )
+        for (i = 0; (i < MAX_PRESOBJS) && (rDescriptor.meKind[i] != PRESOBJ_NONE); i++)
         {
             if( rShapes[i] )
                 continue;
@@ -1572,7 +1572,7 @@ void SdPage::SetAutoLayout(AutoLayout eLayout, sal_Bool bInit, sal_Bool bCreate
     int i;
 
     // for each entry in the layoutdescriptor, arrange a presentation shape
-    for( i = 0; (i < PRESOBJ_MAX) && (aDescriptor.meKind[i] != PRESOBJ_NONE); i++ )
+    for (i = 0; (i < MAX_PRESOBJS) && (aDescriptor.meKind[i] != PRESOBJ_NONE); i++)
     {
         PresObjKind eKind = aDescriptor.meKind[i];
         SdrObject* pObj = InsertAutoLayoutShape( aLayoutShapes[i], eKind, aDescriptor.mbVertical[i], aRectangle[i], bInit );
diff --git a/sd/source/filter/ppt/pptanimations.hxx b/sd/source/filter/ppt/pptanimations.hxx
index ed1d5f0..b82b321 100644
--- a/sd/source/filter/ppt/pptanimations.hxx
+++ b/sd/source/filter/ppt/pptanimations.hxx
@@ -123,7 +123,7 @@ namespace ppt
 #define DFF_ANIM_GROUP_ID                   19
 #define DFF_ANIM_NODE_TYPE                  20
 #define DFF_ANIM_VOLUME                     22
-#define DFF_ANIM_PROPERTY_ID_COUNT          DFF_ANIM_VOLUME
+#define DFF_ANIM_PROPERTY_ID_COUNT			(DFF_ANIM_VOLUME + 1)
 
 
 
diff --git a/writerfilter/source/ooxml/OOXMLFastTokenHandler.cxx b/writerfilter/source/ooxml/OOXMLFastTokenHandler.cxx
index c89fd90..4bcec2a 100644
--- a/writerfilter/source/ooxml/OOXMLFastTokenHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastTokenHandler.cxx
@@ -72,6 +72,8 @@ OOXMLFastTokenHandler::OOXMLFastTokenHandler
 {
     ::rtl::OUString sResult;
 
+#if 0
+    //FIXME this is broken: tokenmap::wordlist is not indexed by Token!
     if ( Token >= 0 || Token < OOXML_FAST_TOKENS_END )
     {
         static ::rtl::OUString aTokens[OOXML_FAST_TOKENS_END];
@@ -80,6 +82,9 @@ OOXMLFastTokenHandler::OOXMLFastTokenHandler
             aTokens[Token] = ::rtl::OUString::createFromAscii
                 (tokenmap::wordlist[Token].name);
     }
+#else
+    (void) Token;
+#endif
 
     return sResult;
 }
@@ -87,10 +92,17 @@ OOXMLFastTokenHandler::OOXMLFastTokenHandler
 css::uno::Sequence< ::sal_Int8 > SAL_CALL OOXMLFastTokenHandler::getUTF8Identifier(::sal_Int32 Token)
     throw (css::uno::RuntimeException)
 {
+#if 0
     if ( Token < 0  || Token >= OOXML_FAST_TOKENS_END )
+#endif
         return css::uno::Sequence< ::sal_Int8 >();
 
+#if 0
+    //FIXME this is broken: tokenmap::wordlist is not indexed by Token!
     return css::uno::Sequence< ::sal_Int8 >(reinterpret_cast< const sal_Int8 *>(tokenmap::wordlist[Token].name), strlen(tokenmap::wordlist[Token].name));
+#else
+    (void) Token;
+#endif
 }
 
 ::sal_Int32 SAL_CALL OOXMLFastTokenHandler::getTokenFromUTF8
diff --git a/xmloff/source/style/weighhdl.cxx b/xmloff/source/style/weighhdl.cxx
index 2befaa8..66fd369 100644
--- a/xmloff/source/style/weighhdl.cxx
+++ b/xmloff/source/style/weighhdl.cxx
@@ -109,7 +109,7 @@ sal_Bool XMLFontWeightPropHdl::importXML( const OUString& rStrImpValue, Any& rVa
     {
         bRet = sal_False;
         static int nCount = sizeof(aFontWeightMap)/sizeof(FontWeightMapper);
-        for( int i=0; i<nCount; i++ )
+        for (int i = 0; i < (nCount-1); ++i)
         {
             if( (nWeight >= aFontWeightMap[i].nValue) && (nWeight <= aFontWeightMap[i+1].nValue) )
             {


More information about the Libreoffice-commits mailing list