[Libreoffice-commits] .: 3 commits - sal/qa sfx2/source unusedcode.easy

Caolán McNamara caolan at kemper.freedesktop.org
Wed Aug 31 05:42:40 PDT 2011


 sal/qa/osl/security/osl_Security.cxx |   13 ++
 sfx2/source/appl/appdde.cxx          |  182 +++++++++++++++++------------------
 unusedcode.easy                      |   11 ++
 3 files changed, 114 insertions(+), 92 deletions(-)

New commits:
commit 930e38e16329e4a81dc2dcf185d44a752fbfbf7f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Aug 31 13:41:40 2011 +0100

    add details to message as to what failed

diff --git a/sal/qa/osl/security/osl_Security.cxx b/sal/qa/osl/security/osl_Security.cxx
index 72b00b3..ea59027 100644
--- a/sal/qa/osl/security/osl_Security.cxx
+++ b/sal/qa/osl/security/osl_Security.cxx
@@ -36,6 +36,8 @@
 #include <windows.h>
 #endif
 #include <osl_Security_Const.h>
+#include <osl/thread.h>
+#include <rtl/strbuf.hxx>
 
 using namespace osl;
 using namespace rtl;
@@ -154,8 +156,15 @@ namespace osl_Security
             ::rtl::OUString strID;
             bRes = aSec.getUserIdent( strID );
 
-            CPPUNIT_ASSERT_MESSAGE( "#test comment#: get UserID and compare it with names got at the beginning of the test.",
-                                     ( sal_True == strUserID.equals( strID ) ) && ( sal_True == bRes ));
+            rtl::OStringBuffer aMessage;
+            aMessage.append("strUserID: ");
+            aMessage.append(rtl::OUStringToOString(strUserID, osl_getThreadTextEncoding()));
+            aMessage.append(", strID: ");
+            aMessage.append(rtl::OUStringToOString(strID, osl_getThreadTextEncoding()));
+            aMessage.append(", bRes: ");
+            aMessage.append(bRes);
+
+            CPPUNIT_ASSERT_MESSAGE( aMessage.getStr(), strUserID.equals(strID) && (bRes == sal_True));
         }
 
         CPPUNIT_TEST_SUITE( getUserIdent );
commit cbbc215285a636a470a8f7feed59a273050b8010
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Aug 31 13:30:17 2011 +0100

    regenerate list

diff --git a/unusedcode.easy b/unusedcode.easy
index f1b1219..4fbb9c1 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -1932,9 +1932,11 @@ binfilter::SfxPtrArr::Insert(unsigned short, void*)
 binfilter::SfxPtrArr::Remove(void*)
 binfilter::SfxPtrArr::Replace(void*, void*)
 binfilter::SfxUINT32s::Insert(binfilter::SfxUINT32s const*, unsigned short, unsigned short, unsigned short)
+binfilter::SfxUINT32s::Insert(unsigned int const&, unsigned short)
 binfilter::SfxUINT32s::Remove(unsigned short, unsigned short)
 binfilter::SfxUINT32s::Replace(unsigned int const&, unsigned short)
 binfilter::SfxUINT32s::Replace(unsigned int const*, unsigned short, unsigned short)
+binfilter::SfxUINT32s::SfxUINT32s(unsigned short, unsigned char)
 binfilter::SfxUINT32s::_ForEach(unsigned short, unsigned short, unsigned char (*)(unsigned int const&, void*), void*)
 binfilter::ShellResource::~ShellResource()
 binfilter::SmFntFmtListEntryArr::Insert(binfilter::SmFntFmtListEntryArr const*, unsigned short, unsigned short, unsigned short)
@@ -2129,6 +2131,15 @@ binfilter::WritingDirectionInfos::Insert(binfilter::WritingDirectionInfos const*
 binfilter::WritingDirectionInfos::Replace(binfilter::WritingDirectionInfo const&, unsigned short)
 binfilter::WritingDirectionInfos::Replace(binfilter::WritingDirectionInfo const*, unsigned short, unsigned short)
 binfilter::WritingDirectionInfos::_ForEach(unsigned short, unsigned short, unsigned char (*)(binfilter::WritingDirectionInfo const&, void*), void*)
+binfilter::XBitmapList::Remove(long)
+binfilter::XBitmapList::Replace(binfilter::XBitmapEntry*, long)
+binfilter::XColorTable::Remove(long)
+binfilter::XDashList::Remove(long)
+binfilter::XDashList::Replace(binfilter::XDashEntry*, long)
+binfilter::XDashTable::Remove(long)
+binfilter::XDashTable::Replace(long, binfilter::XDashEntry*)
+binfilter::XLineEndList::Remove(long)
+binfilter::XLineEndList::Replace(binfilter::XLineEndEntry*, long)
 binfilter::XMLFamilyDataList_Impl::GetPos(binfilter::XMLFamilyData_Impl const*) const
 binfilter::XMLFamilyDataList_Impl::Remove(binfilter::XMLFamilyData_Impl*)
 binfilter::XMLFontAutoStylePoolNames_Impl::GetPos(rtl::OUString const*) const
commit fc2a986cc392f02a1cd01cfec2c50416f25b4f03
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Aug 31 13:29:49 2011 +0100

    ImplDdeService is for windows only

diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx
index 366c49f..04f99ef 100644
--- a/sfx2/source/appl/appdde.cxx
+++ b/sfx2/source/appl/appdde.cxx
@@ -70,7 +70,7 @@ String SfxDdeServiceName_Impl( const String& sIn )
     return sReturn;
 }
 
-
+#if defined( WNT )
 class ImplDdeService : public DdeService
 {
 public:
@@ -84,6 +84,97 @@ public:
     virtual sal_Bool SysTopicExecute( const String* pStr );
 };
 
+//--------------------------------------------------------------------
+
+sal_Bool ImplDdeService::MakeTopic( const String& rNm )
+{
+    // Workaround for Event after Main() under OS/2
+    // happens when exiting starts the App again
+    if ( !Application::IsInExecute() )
+        return sal_False;
+
+    // The Topic rNm is sought, do we have it?
+    // First only loop over the ObjectShells to find those
+    // with the specific name:
+    sal_Bool bRet = sal_False;
+    String sNm( rNm );
+    sNm.ToLowerAscii();
+    TypeId aType( TYPE(SfxObjectShell) );
+    SfxObjectShell* pShell = SfxObjectShell::GetFirst( &aType );
+    while( pShell )
+    {
+        String sTmp( pShell->GetTitle(SFX_TITLE_FULLNAME) );
+        sTmp.ToLowerAscii();
+        if( sTmp == sNm )
+        {
+            SFX_APP()->AddDdeTopic( pShell );
+            bRet = sal_True;
+            break;
+        }
+        pShell = SfxObjectShell::GetNext( *pShell, &aType );
+    }
+
+    if( !bRet )
+    {
+        INetURLObject aWorkPath( SvtPathOptions().GetWorkPath() );
+        INetURLObject aFile;
+        if ( aWorkPath.GetNewAbsURL( rNm, &aFile ) &&
+             SfxContentHelper::IsDocument( aFile.GetMainURL( INetURLObject::NO_DECODE ) ) )
+        {
+            // File exists? then try to load it:
+            SfxStringItem aName( SID_FILE_NAME, aFile.GetMainURL( INetURLObject::NO_DECODE ) );
+            SfxBoolItem aNewView(SID_OPEN_NEW_VIEW, sal_True);
+
+            SfxBoolItem aSilent(SID_SILENT, sal_True);
+            SfxDispatcher* pDispatcher = SFX_APP()->GetDispatcher_Impl();
+            const SfxPoolItem* pRet = pDispatcher->Execute( SID_OPENDOC,
+                    SFX_CALLMODE_SYNCHRON,
+                    &aName, &aNewView,
+                    &aSilent, 0L );
+
+            if( pRet && pRet->ISA( SfxViewFrameItem ) &&
+                ((SfxViewFrameItem*)pRet)->GetFrame() &&
+                0 != ( pShell = ((SfxViewFrameItem*)pRet)
+                    ->GetFrame()->GetObjectShell() ) )
+            {
+                SFX_APP()->AddDdeTopic( pShell );
+                bRet = sal_True;
+            }
+        }
+    }
+    return bRet;
+}
+
+String ImplDdeService::Topics()
+{
+    String sRet;
+    if( GetSysTopic() )
+        sRet += GetSysTopic()->GetName();
+
+    TypeId aType( TYPE(SfxObjectShell) );
+    SfxObjectShell* pShell = SfxObjectShell::GetFirst( &aType );
+    while( pShell )
+    {
+        if( SfxViewFrame::GetFirst( pShell ) )
+        {
+            if( sRet.Len() )
+                sRet += '\t';
+            sRet += pShell->GetTitle(SFX_TITLE_FULLNAME);
+        }
+        pShell = SfxObjectShell::GetNext( *pShell, &aType );
+    }
+    if( sRet.Len() )
+        sRet += DEFINE_CONST_UNICODE("\r\n");
+    return sRet;
+}
+
+sal_Bool ImplDdeService::SysTopicExecute( const String* pStr )
+{
+    return (sal_Bool)SFX_APP()->DdeExecute( *pStr );
+}
+
+#endif
+
 class SfxDdeTriggerTopic_Impl : public DdeTopic
 {
 public:
@@ -490,95 +581,6 @@ DdeService* SfxApplication::GetDdeService()
 
 //--------------------------------------------------------------------
 
-sal_Bool ImplDdeService::MakeTopic( const String& rNm )
-{
-    // Workaround for Event after Main() under OS/2
-    // happens when exiting starts the App again
-    if ( !Application::IsInExecute() )
-        return sal_False;
-
-    // The Topic rNm is sought, do we have it?
-    // First only loop over the ObjectShells to find those
-    // with the specific name:
-    sal_Bool bRet = sal_False;
-    String sNm( rNm );
-    sNm.ToLowerAscii();
-    TypeId aType( TYPE(SfxObjectShell) );
-    SfxObjectShell* pShell = SfxObjectShell::GetFirst( &aType );
-    while( pShell )
-    {
-        String sTmp( pShell->GetTitle(SFX_TITLE_FULLNAME) );
-        sTmp.ToLowerAscii();
-        if( sTmp == sNm )
-        {
-            SFX_APP()->AddDdeTopic( pShell );
-            bRet = sal_True;
-            break;
-        }
-        pShell = SfxObjectShell::GetNext( *pShell, &aType );
-    }
-
-    if( !bRet )
-    {
-        INetURLObject aWorkPath( SvtPathOptions().GetWorkPath() );
-        INetURLObject aFile;
-        if ( aWorkPath.GetNewAbsURL( rNm, &aFile ) &&
-             SfxContentHelper::IsDocument( aFile.GetMainURL( INetURLObject::NO_DECODE ) ) )
-        {
-            // File exists? then try to load it:
-            SfxStringItem aName( SID_FILE_NAME, aFile.GetMainURL( INetURLObject::NO_DECODE ) );
-            SfxBoolItem aNewView(SID_OPEN_NEW_VIEW, sal_True);
-
-            SfxBoolItem aSilent(SID_SILENT, sal_True);
-            SfxDispatcher* pDispatcher = SFX_APP()->GetDispatcher_Impl();
-            const SfxPoolItem* pRet = pDispatcher->Execute( SID_OPENDOC,
-                    SFX_CALLMODE_SYNCHRON,
-                    &aName, &aNewView,
-                    &aSilent, 0L );
-
-            if( pRet && pRet->ISA( SfxViewFrameItem ) &&
-                ((SfxViewFrameItem*)pRet)->GetFrame() &&
-                0 != ( pShell = ((SfxViewFrameItem*)pRet)
-                    ->GetFrame()->GetObjectShell() ) )
-            {
-                SFX_APP()->AddDdeTopic( pShell );
-                bRet = sal_True;
-            }
-        }
-    }
-    return bRet;
-}
-
-String ImplDdeService::Topics()
-{
-    String sRet;
-    if( GetSysTopic() )
-        sRet += GetSysTopic()->GetName();
-
-    TypeId aType( TYPE(SfxObjectShell) );
-    SfxObjectShell* pShell = SfxObjectShell::GetFirst( &aType );
-    while( pShell )
-    {
-        if( SfxViewFrame::GetFirst( pShell ) )
-        {
-            if( sRet.Len() )
-                sRet += '\t';
-            sRet += pShell->GetTitle(SFX_TITLE_FULLNAME);
-        }
-        pShell = SfxObjectShell::GetNext( *pShell, &aType );
-    }
-    if( sRet.Len() )
-        sRet += DEFINE_CONST_UNICODE("\r\n");
-    return sRet;
-}
-
-sal_Bool ImplDdeService::SysTopicExecute( const String* pStr )
-{
-    return (sal_Bool)SFX_APP()->DdeExecute( *pStr );
-}
-
-//--------------------------------------------------------------------
-
 sal_Bool SfxDdeTriggerTopic_Impl::Execute( const String* )
 {
     return sal_True;


More information about the Libreoffice-commits mailing list