[Libreoffice-commits] .: 2 commits - extensions/source sd/source xmlsecurity/source

Michael Meeks michael at kemper.freedesktop.org
Fri Jun 1 06:48:41 PDT 2012


 extensions/source/bibliography/general.cxx          |    4 ++--
 sd/source/ui/annotations/annotationmanager.cxx      |    6 +++---
 xmlsecurity/source/framework/buffernode.cxx         |    8 ++++----
 xmlsecurity/source/framework/saxeventkeeperimpl.cxx |    6 +++---
 4 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 2c4fd87a5a15fbe04fafdbf205ff2737a1ce6a82
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Fri Jun 1 14:46:37 2012 +0100

    targetted reversion of minor SAL_N_ELEMENTS tweak
    
    Change-Id: I4f907aecd72f55091184aa1509506a46010f1061

diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx
index f4831f3..0561ddb 100644
--- a/sd/source/ui/annotations/annotationmanager.cxx
+++ b/sd/source/ui/annotations/annotationmanager.cxx
@@ -1108,7 +1108,7 @@ Color AnnotationManagerImpl::GetColor(sal_uInt16 aAuthorIndex)
             COL_AUTHOR4_NORMAL,     COL_AUTHOR5_NORMAL,     COL_AUTHOR6_NORMAL,
             COL_AUTHOR7_NORMAL,     COL_AUTHOR8_NORMAL,     COL_AUTHOR9_NORMAL };
 
-        return Color( aArrayNormal[ aAuthorIndex % (SAL_N_ELEMENTS(aArrayNormal))]);
+        return Color( aArrayNormal[ aAuthorIndex % (sizeof( aArrayNormal )/ sizeof( aArrayNormal[0] ))]);
     }
     else
         return Color(COL_WHITE);
@@ -1123,7 +1123,7 @@ Color AnnotationManagerImpl::GetColorLight(sal_uInt16 aAuthorIndex)
             COL_AUTHOR4_LIGHT,      COL_AUTHOR5_LIGHT,      COL_AUTHOR6_LIGHT,
             COL_AUTHOR7_LIGHT,      COL_AUTHOR8_LIGHT,      COL_AUTHOR9_LIGHT };
 
-        return Color( aArrayLight[ aAuthorIndex % (SAL_N_ELEMENTS(aArrayLight))]);
+        return Color( aArrayLight[ aAuthorIndex % (sizeof( aArrayLight )/ sizeof( aArrayLight[0] ))]);
     }
     else
         return Color(COL_WHITE);
@@ -1138,7 +1138,7 @@ Color AnnotationManagerImpl::GetColorDark(sal_uInt16 aAuthorIndex)
             COL_AUTHOR4_DARK,       COL_AUTHOR5_DARK,       COL_AUTHOR6_DARK,
             COL_AUTHOR7_DARK,       COL_AUTHOR8_DARK,       COL_AUTHOR9_DARK };
 
-        return Color( aArrayAnkor[  aAuthorIndex % (SAL_N_ELEMENTS(aArrayAnkor))]);
+        return Color( aArrayAnkor[  aAuthorIndex % (sizeof( aArrayAnkor )   / sizeof( aArrayAnkor[0] ))]);
     }
     else
         return Color(COL_WHITE);
commit d369d4fac79ceea879c626df4d4ee3e290dfe8fa
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Fri Jun 1 14:45:23 2012 +0100

    targetted revert of small stl empty optimisation
    
    Change-Id: I5e845235f946f33f2a38839c8bd7bb6efda64147

diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx
index 65dafe5..8576bce 100644
--- a/extensions/source/bibliography/general.cxx
+++ b/extensions/source/bibliography/general.cxx
@@ -846,7 +846,7 @@ sal_Bool BibGeneralPage::HandleShortCutKey( const KeyEvent& rKeyEvent )
                     if( pWindow->HasChildPathFocus() )
                     {   // save focused control
                         DBG_ASSERT( nFocused == 0xFFFF, "+BibGeneralPage::HandleShortCutKey(): more than one with focus?!" );
-                        DBG_ASSERT( !aMatchList.empty(), "+BibGeneralPage::HandleShortCutKey(): push_back and no content?!" );
+                        DBG_ASSERT( aMatchList.size() > 0, "+BibGeneralPage::HandleShortCutKey(): push_back and no content?!" );
                         nFocused = aMatchList.size() - 1;
                     }
                 }
@@ -856,7 +856,7 @@ sal_Bool BibGeneralPage::HandleShortCutKey( const KeyEvent& rKeyEvent )
 
     if( bHandled )
     {
-        DBG_ASSERT( !aMatchList.empty(), "*BibGeneralPage::HandleShortCutKey(): be prepared to crash..." );
+        DBG_ASSERT( aMatchList.size() > 0, "*BibGeneralPage::HandleShortCutKey(): be prepared to crash..." );
 
         if( nFocused >= ( aMatchList.size() - 1 ) )
             // >=... includes 0xFFFF
diff --git a/xmlsecurity/source/framework/buffernode.cxx b/xmlsecurity/source/framework/buffernode.cxx
index a6de3ca..a7c0a24 100644
--- a/xmlsecurity/source/framework/buffernode.cxx
+++ b/xmlsecurity/source/framework/buffernode.cxx
@@ -317,7 +317,7 @@ bool BufferNode::hasAnything() const
  *  Email: michael.mi at sun.com
  ******************************************************************************/
 {
-    return (m_pBlocker != NULL || !m_vElementCollectors.empty());
+    return (m_pBlocker != NULL || m_vElementCollectors.size() > 0);
 }
 
 bool BufferNode::hasChildren() const
@@ -344,7 +344,7 @@ bool BufferNode::hasChildren() const
  *  Email: michael.mi at sun.com
  ******************************************************************************/
 {
-    return (!m_vChildren.empty());
+    return (m_vChildren.size() > 0);
 }
 
 std::vector< const BufferNode* >* BufferNode::getChildren() const
@@ -378,7 +378,7 @@ const BufferNode* BufferNode::getFirstChild() const
 {
     BufferNode* rc = NULL;
 
-    if (!m_vChildren.empty())
+    if (m_vChildren.size() > 0)
     {
         rc = (BufferNode*)m_vChildren.front();
     }
@@ -853,7 +853,7 @@ void BufferNode::elementCollectorNotify()
  *  Email: michael.mi at sun.com
  ******************************************************************************/
 {
-    if (!m_vElementCollectors.empty())
+    if (m_vElementCollectors.size()>0)
     {
         cssxc::sax::ElementMarkPriority nMaxPriority = cssxc::sax::ElementMarkPriority_MINIMUM;
         cssxc::sax::ElementMarkPriority nPriority;
diff --git a/xmlsecurity/source/framework/saxeventkeeperimpl.cxx b/xmlsecurity/source/framework/saxeventkeeperimpl.cxx
index 015f802..c416d38 100644
--- a/xmlsecurity/source/framework/saxeventkeeperimpl.cxx
+++ b/xmlsecurity/source/framework/saxeventkeeperimpl.cxx
@@ -161,7 +161,7 @@ BufferNode* SAXEventKeeperImpl::addNewElementMarkBuffers()
 {
     BufferNode* pBufferNode = NULL;
 
-    if ( (!m_vNewElementCollectors.empty()) ||
+    if ( (m_vNewElementCollectors.size()>0) ||
          (m_pNewBlocker != NULL))
     {
         /*
@@ -202,7 +202,7 @@ BufferNode* SAXEventKeeperImpl::addNewElementMarkBuffers()
             m_pNewBlocker = NULL;
         }
 
-        if (!m_vNewElementCollectors.empty())
+        if (m_vNewElementCollectors.size()>0)
         {
             std::vector< const ElementCollector* >::const_iterator ii = m_vNewElementCollectors.begin();
 
@@ -713,7 +713,7 @@ void SAXEventKeeperImpl::releaseElementMarkBuffer()
  ******************************************************************************/
 {
     m_bIsReleasing = true;
-    while (!m_vReleasedElementMarkBuffers.empty())
+    while (m_vReleasedElementMarkBuffers.size()>0)
     {
         std::vector< sal_Int32 >::iterator pId = m_vReleasedElementMarkBuffers.begin();
         sal_Int32 nId = *pId;


More information about the Libreoffice-commits mailing list