[Libreoffice-commits] .: sc/source

Arnaud Versini aversini at kemper.freedesktop.org
Sat Jul 28 11:36:28 PDT 2012


 sc/source/filter/qpro/qprostyle.cxx |    8 ++++----
 sc/source/filter/xml/xmlexprt.cxx   |    2 +-
 sc/source/ui/app/drwtrans.cxx       |    2 +-
 sc/source/ui/app/transobj.cxx       |    2 +-
 sc/source/ui/unoobj/afmtuno.cxx     |    2 +-
 sc/source/ui/unoobj/cellsuno.cxx    |    4 ++--
 sc/source/ui/unoobj/dapiuno.cxx     |    2 +-
 sc/source/ui/unoobj/datauno.cxx     |    2 +-
 sc/source/ui/unoobj/docuno.cxx      |    4 ++--
 sc/source/ui/unoobj/fielduno.cxx    |    2 +-
 sc/source/ui/unoobj/fmtuno.cxx      |    4 ++--
 sc/source/ui/unoobj/nameuno.cxx     |    2 +-
 sc/source/ui/unoobj/scdetect.cxx    |    2 +-
 sc/source/ui/unoobj/srchuno.cxx     |    2 +-
 sc/source/ui/unoobj/styleuno.cxx    |    2 +-
 sc/source/ui/unoobj/textuno.cxx     |    8 ++++----
 sc/source/ui/unoobj/viewuno.cxx     |    2 +-
 sc/source/ui/vba/vbaworkbook.cxx    |    2 +-
 sc/source/ui/vba/vbaworksheet.cxx   |    2 +-
 19 files changed, 28 insertions(+), 28 deletions(-)

New commits:
commit 363fb46d5d07758a4b02a135addd8913cda2f933
Author: Arnaud Versini <arnaud.versini at gmail.com>
Date:   Sat Jul 28 20:34:39 2012 +0200

    Use memset and memcmp insteadof rtl_zeroMemory and rtl_compareMemory in sc
    
    Change-Id: Ia40c0af6844f736f0aad2566aec3c71f5016123e

diff --git a/sc/source/filter/qpro/qprostyle.cxx b/sc/source/filter/qpro/qprostyle.cxx
index 9284bb2..dd859eb 100644
--- a/sc/source/filter/qpro/qprostyle.cxx
+++ b/sc/source/filter/qpro/qprostyle.cxx
@@ -55,10 +55,10 @@
 
 ScQProStyle::ScQProStyle()
 {
-    rtl_zeroMemory (maAlign, sizeof (maAlign));
-    rtl_zeroMemory (maFont, sizeof (maFont));
-    rtl_zeroMemory (maFontRecord, sizeof (maFontRecord));
-    rtl_zeroMemory (maFontHeight, sizeof (maFontHeight));
+    memset (maAlign, 0, sizeof (maAlign));
+    memset (maFont, 0, sizeof (maFont));
+    memset (maFontRecord, 0, sizeof (maFontRecord));
+    memset (maFontHeight, 0, sizeof (maFontHeight));
 }
 
 void ScQProStyle::SetFormat( ScDocument *pDoc, sal_uInt8 nCol, sal_uInt16 nRow, SCTAB nTab, sal_uInt16 nStyle )
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 9d8fbe3..3e22e75 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -565,7 +565,7 @@ void ScXMLExport::SetSourceStream( const uno::Reference<io::XInputStream>& xNewS
         uno::Sequence<sal_Int8> aFileStart(nLen);
         sal_Int32 nRead = xSourceStream->readBytes( aFileStart, nLen );
 
-        if ( nRead != nLen || rtl_compareMemory( aFileStart.getConstArray(), pXmlHeader, nLen ) != 0 )
+        if ( nRead != nLen || memcmp( aFileStart.getConstArray(), pXmlHeader, nLen ) != 0 )
         {
             // invalid - ignore stream, save normally
             xSourceStream.clear();
diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx
index 9faf217..a5137b9 100644
--- a/sc/source/ui/app/drwtrans.cxx
+++ b/sc/source/ui/app/drwtrans.cxx
@@ -794,7 +794,7 @@ sal_Int64 SAL_CALL ScDrawTransferObj::getSomething( const com::sun::star::uno::S
 {
     sal_Int64 nRet;
     if( ( rId.getLength() == 16 ) &&
-        ( 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) )
+        ( 0 == memcmp( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) )
     {
         nRet = reinterpret_cast< sal_Int64 >( this );
     }
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index cd32171..cf0f3d0 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -865,7 +865,7 @@ sal_Int64 SAL_CALL ScTransferObj::getSomething( const com::sun::star::uno::Seque
 {
     sal_Int64 nRet;
     if( ( rId.getLength() == 16 ) &&
-        ( 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) )
+        ( 0 == memcmp( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) )
     {
         nRet = reinterpret_cast< sal_Int64 >( this );
     }
diff --git a/sc/source/ui/unoobj/afmtuno.cxx b/sc/source/ui/unoobj/afmtuno.cxx
index c14a337..bb6b37a 100644
--- a/sc/source/ui/unoobj/afmtuno.cxx
+++ b/sc/source/ui/unoobj/afmtuno.cxx
@@ -439,7 +439,7 @@ sal_Int64 SAL_CALL ScAutoFormatObj::getSomething(
                 const uno::Sequence<sal_Int8 >& rId ) throw(uno::RuntimeException)
 {
     if ( rId.getLength() == 16 &&
-          0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+          0 == memcmp( getUnoTunnelId().getConstArray(),
                                     rId.getConstArray(), 16 ) )
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index d98d0a3..dd95c27 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -4154,7 +4154,7 @@ sal_Int64 SAL_CALL ScCellRangesBase::getSomething(
                 const uno::Sequence<sal_Int8 >& rId ) throw(uno::RuntimeException)
 {
     if ( rId.getLength() == 16 &&
-          0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+          0 == memcmp( getUnoTunnelId().getConstArray(),
                                     rId.getConstArray(), 16 ) )
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
@@ -8732,7 +8732,7 @@ sal_Int64 SAL_CALL ScTableSheetObj::getSomething(
                 const uno::Sequence<sal_Int8 >& rId ) throw(uno::RuntimeException)
 {
     if ( rId.getLength() == 16 &&
-          0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+          0 == memcmp( getUnoTunnelId().getConstArray(),
                                     rId.getConstArray(), 16 ) )
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index dab0786..0d5e324 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -1085,7 +1085,7 @@ sal_Int64 SAL_CALL ScDataPilotDescriptorBase::getSomething(
                 const Sequence<sal_Int8 >& rId ) throw(RuntimeException)
 {
     if ( rId.getLength() == 16 &&
-          0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+          0 == memcmp( getUnoTunnelId().getConstArray(),
                                     rId.getConstArray(), 16 ) )
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index f40135f..76ec004 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -821,7 +821,7 @@ sal_Int64 SAL_CALL ScSubTotalDescriptorBase::getSomething(
                 const uno::Sequence<sal_Int8 >& rId ) throw(uno::RuntimeException)
 {
     if ( rId.getLength() == 16 &&
-          0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+          0 == memcmp( getUnoTunnelId().getConstArray(),
                                     rId.getConstArray(), 16 ) )
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index c43047c..cad7ae4 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -2043,14 +2043,14 @@ sal_Int64 SAL_CALL ScModelObj::getSomething(
                 const uno::Sequence<sal_Int8 >& rId ) throw(uno::RuntimeException)
 {
     if ( rId.getLength() == 16 &&
-          0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+          0 == memcmp( getUnoTunnelId().getConstArray(),
                                     rId.getConstArray(), 16 ) )
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
     }
 
     if ( rId.getLength() == 16 &&
-        0 == rtl_compareMemory( SfxObjectShell::getUnoTunnelId().getConstArray(),
+        0 == memcmp( SfxObjectShell::getUnoTunnelId().getConstArray(),
                                     rId.getConstArray(), 16 ) )
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(pDocShell ));
diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx
index 31ee02b..bc8c954 100644
--- a/sc/source/ui/unoobj/fielduno.cxx
+++ b/sc/source/ui/unoobj/fielduno.cxx
@@ -1411,7 +1411,7 @@ sal_Int64 SAL_CALL ScEditFieldObj::getSomething(
                 const uno::Sequence<sal_Int8 >& rId ) throw(uno::RuntimeException)
 {
     if ( rId.getLength() == 16 &&
-          0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+          0 == memcmp( getUnoTunnelId().getConstArray(),
                                     rId.getConstArray(), 16 ) )
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
diff --git a/sc/source/ui/unoobj/fmtuno.cxx b/sc/source/ui/unoobj/fmtuno.cxx
index 09adcf9..8b98199 100644
--- a/sc/source/ui/unoobj/fmtuno.cxx
+++ b/sc/source/ui/unoobj/fmtuno.cxx
@@ -491,7 +491,7 @@ sal_Int64 SAL_CALL ScTableConditionalFormat::getSomething(
                 const uno::Sequence<sal_Int8 >& rId ) throw(uno::RuntimeException)
 {
     if ( rId.getLength() == 16 &&
-          0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+          0 == memcmp( getUnoTunnelId().getConstArray(),
                                     rId.getConstArray(), 16 ) )
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
@@ -1021,7 +1021,7 @@ sal_Int64 SAL_CALL ScTableValidationObj::getSomething(
                 const uno::Sequence<sal_Int8 >& rId ) throw(uno::RuntimeException)
 {
     if ( rId.getLength() == 16 &&
-          0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+          0 == memcmp( getUnoTunnelId().getConstArray(),
                                     rId.getConstArray(), 16 ) )
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx
index 0990261..c04b8e9 100644
--- a/sc/source/ui/unoobj/nameuno.cxx
+++ b/sc/source/ui/unoobj/nameuno.cxx
@@ -464,7 +464,7 @@ sal_Int64 SAL_CALL ScNamedRangeObj::getSomething(
                 const uno::Sequence<sal_Int8 >& rId ) throw(uno::RuntimeException)
 {
     if ( rId.getLength() == 16 &&
-          0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+          0 == memcmp( getUnoTunnelId().getConstArray(),
                                     rId.getConstArray(), 16 ) )
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx
index 0e034c4..cd3baf8 100644
--- a/sc/source/ui/unoobj/scdetect.cxx
+++ b/sc/source/ui/unoobj/scdetect.cxx
@@ -169,7 +169,7 @@ static const SfxFilter* lcl_DetectExcelXML( SvStream& rStream, SfxFilterMatcher&
     if ( nBytesRead >= 3 && aBuffer[0] == 0xEF && aBuffer[1] == 0xBB && aBuffer[2] == 0xBF )
         nXMLStart = 3;
 
-    if ( nBytesRead >= nXMLStart + 5 && rtl_compareMemory( aBuffer+nXMLStart, "<?xml", 5 ) == 0 )
+    if ( nBytesRead >= nXMLStart + 5 && memcmp( aBuffer+nXMLStart, "<?xml", 5 ) == 0 )
     {
         // Be consistent with XMLFilterDetect service: Check for presence of "Workbook" in XML file.
 
diff --git a/sc/source/ui/unoobj/srchuno.cxx b/sc/source/ui/unoobj/srchuno.cxx
index 7085b01..e1c860f 100644
--- a/sc/source/ui/unoobj/srchuno.cxx
+++ b/sc/source/ui/unoobj/srchuno.cxx
@@ -229,7 +229,7 @@ sal_Int64 SAL_CALL ScCellSearchObj::getSomething(
                 const uno::Sequence<sal_Int8 >& rId ) throw(uno::RuntimeException)
 {
     if ( rId.getLength() == 16 &&
-          0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+          0 == memcmp( getUnoTunnelId().getConstArray(),
                                     rId.getConstArray(), 16 ) )
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index 23e6ed4..e1be3ea 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -1122,7 +1122,7 @@ sal_Int64 SAL_CALL ScStyleObj::getSomething(
                 const uno::Sequence<sal_Int8 >& rId ) throw(uno::RuntimeException)
 {
     if ( rId.getLength() == 16 &&
-          0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+          0 == memcmp( getUnoTunnelId().getConstArray(),
                                     rId.getConstArray(), 16 ) )
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx
index f2686a8..81d2f97 100644
--- a/sc/source/ui/unoobj/textuno.cxx
+++ b/sc/source/ui/unoobj/textuno.cxx
@@ -161,7 +161,7 @@ sal_Int64 SAL_CALL ScHeaderFooterContentObj::getSomething(
                 const uno::Sequence<sal_Int8 >& rId ) throw(uno::RuntimeException)
 {
     if ( rId.getLength() == 16 &&
-          0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+          0 == memcmp( getUnoTunnelId().getConstArray(),
                                     rId.getConstArray(), 16 ) )
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
@@ -655,7 +655,7 @@ sal_Int64 SAL_CALL ScCellTextCursor::getSomething(
                 const uno::Sequence<sal_Int8 >& rId ) throw(uno::RuntimeException)
 {
     if ( rId.getLength() == 16 &&
-          0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+          0 == memcmp( getUnoTunnelId().getConstArray(),
                                     rId.getConstArray(), 16 ) )
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
@@ -751,7 +751,7 @@ sal_Int64 SAL_CALL ScHeaderFooterTextCursor::getSomething(
                 const uno::Sequence<sal_Int8 >& rId ) throw(uno::RuntimeException)
 {
     if ( rId.getLength() == 16 &&
-          0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+          0 == memcmp( getUnoTunnelId().getConstArray(),
                                     rId.getConstArray(), 16 ) )
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
@@ -847,7 +847,7 @@ sal_Int64 SAL_CALL ScDrawTextCursor::getSomething(
                 const uno::Sequence<sal_Int8 >& rId ) throw(uno::RuntimeException)
 {
     if ( rId.getLength() == 16 &&
-          0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+          0 == memcmp( getUnoTunnelId().getConstArray(),
                                     rId.getConstArray(), 16 ) )
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index b477620..4d7a927 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -2286,7 +2286,7 @@ sal_Int64 SAL_CALL ScTabViewObj::getSomething(
                 const uno::Sequence<sal_Int8 >& rId ) throw(uno::RuntimeException)
 {
     if ( rId.getLength() == 16 &&
-          0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+          0 == memcmp( getUnoTunnelId().getConstArray(),
                                     rId.getConstArray(), 16 ) )
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx
index d73ecca..8e5b38f 100644
--- a/sc/source/ui/vba/vbaworkbook.cxx
+++ b/sc/source/ui/vba/vbaworkbook.cxx
@@ -409,7 +409,7 @@ sal_Int64
 ScVbaWorkbook::getSomething(const uno::Sequence<sal_Int8 >& rId ) throw(css::uno::RuntimeException)
 {
     if (rId.getLength() == 16 &&
-        0 == rtl_compareMemory( ScVbaWorksheet::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ))
+        0 == memcmp( ScVbaWorksheet::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ))
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
     }
diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx
index 9b2ec48..d7fac72 100644
--- a/sc/source/ui/vba/vbaworksheet.cxx
+++ b/sc/source/ui/vba/vbaworksheet.cxx
@@ -1161,7 +1161,7 @@ sal_Int64 SAL_CALL
 ScVbaWorksheet::getSomething(const uno::Sequence<sal_Int8 > & rId) throw(uno::RuntimeException)
 {
     if (rId.getLength() == 16 &&
-        0 == rtl_compareMemory( ScVbaWorksheet::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ))
+        0 == memcmp( ScVbaWorksheet::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ))
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
     }


More information about the Libreoffice-commits mailing list