[Libreoffice-commits] core.git: framework/inc framework/source

Stephan Bergmann sbergman at redhat.com
Mon Apr 18 14:53:52 UTC 2016


 framework/inc/jobs/joburl.hxx    |   24 --
 framework/source/jobs/joburl.cxx |  325 ---------------------------------------
 2 files changed, 349 deletions(-)

New commits:
commit ca440cf5486099778107c2e263bf7fa9a1a0fdd5
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Apr 18 16:49:28 2016 +0200

    Remove dead ENABLE_COMPONENT_SELF_CHECK
    
    There is no sign it got ever used past 4011187ff516846635d4e2c3256dca3eb8c3719f
    "MWS_SRX644: migrate branch mws_srx644 -> HEAD" at least.
    
    Change-Id: Ia98613420a095b326ad26c024ff74f3c62bf4f99

diff --git a/framework/inc/jobs/joburl.hxx b/framework/inc/jobs/joburl.hxx
index ac816c3..261026d 100644
--- a/framework/inc/jobs/joburl.hxx
+++ b/framework/inc/jobs/joburl.hxx
@@ -114,30 +114,6 @@ class JobURL
                                             sal_Int32        nPartLength     ,
                                             OUString& rPartValue      ,
                                             OUString& rPartArguments  );
-
-    // debug methods!
-
-    #ifdef ENABLE_COMPONENT_SELF_CHECK
-
-    public:
-        static void impldbg_checkIt();
-
-    private:
-        static void impldbg_checkURL( const sal_Char*  pURL                 ,
-                                            sal_uInt32 eExpectedPart        ,
-                                      const sal_Char*  pExpectedEvent       ,
-                                      const sal_Char*  pExpectedAlias       ,
-                                      const sal_Char*  pExpectedService     ,
-                                      const sal_Char*  pExpectedEventArgs   ,
-                                      const sal_Char*  pExpectedAliasArgs   ,
-                                      const sal_Char*  pExpectedServiceArgs );
-        OUString impldbg_toString() const;
-
-        sal_Bool getServiceArgs(       OUString& sServiceArgs ) const;
-        sal_Bool getEventArgs  (       OUString& sEventArgs   ) const;
-        sal_Bool getAliasArgs  (       OUString& sAliasArgs   ) const;
-
-    #endif // ENABLE_COMPONENT_SELF_CHECK
 };
 
 } // namespace framework
diff --git a/framework/source/jobs/joburl.cxx b/framework/source/jobs/joburl.cxx
index 59afdfa..95b67e0 100644
--- a/framework/source/jobs/joburl.cxx
+++ b/framework/source/jobs/joburl.cxx
@@ -42,10 +42,6 @@ namespace framework{
 */
 JobURL::JobURL( /*IN*/ const OUString& sURL )
 {
-    #ifdef ENABLE_COMPONENT_SELF_CHECK
-    JobURL::impldbg_checkIt();
-    #endif
-
     m_eRequest = E_UNKNOWN;
 
     // syntax: vnd.sun.star.job:{[event=<name>],[alias=<name>],[service=<name>]}
@@ -257,327 +253,6 @@ bool JobURL::implst_split( /*IN*/  const OUString& sPart           ,
     return bPartFound;
 }
 
-/**
-    @short      special debug method
-    @descr      It's the entry point method to start a self component check for this class.
-                It's used for internal purposes only and never a part of a legal product.
-                Use it for testing and debug only!
-*/
-#ifdef ENABLE_COMPONENT_SELF_CHECK
-
-
-void JobURL::impldbg_checkIt()
-{
-    // check simple URL's
-    JobURL::impldbg_checkURL("vnd.sun.star.job:event=onMyEvent"    , E_EVENT  , "onMyEvent", ""       , ""           , NULL, NULL, NULL);
-    JobURL::impldbg_checkURL("vnd.sun.star.job:alias=myAlias"      , E_ALIAS  , ""         , "myAlias", ""           , NULL, NULL, NULL);
-    JobURL::impldbg_checkURL("vnd.sun.star.job:service=css.Service", E_SERVICE, ""         , ""       , "css.Service", NULL, NULL, NULL);
-    JobURL::impldbg_checkURL("vnd.sun.star.job:service=;"          , E_UNKNOWN, ""         , ""       , ""           , NULL, NULL, NULL);
-
-    // check combinations
-    // Note: No additional spaces or tabs are allowed after a separator occurred.
-    // Tab and spaces before a separator will be used as value!
-    JobURL::impldbg_checkURL("vnd.sun.star.job:event=onMyEvent;alias=myAlias;service=css.Service"  , E_EVENT | E_ALIAS | E_SERVICE , "onMyEvent", "myAlias", "css.Service" , NULL, NULL, NULL);
-    JobURL::impldbg_checkURL("vnd.sun.star.job:service=css.Service;alias=myAlias"                  , E_ALIAS | E_SERVICE           , ""         , "myAlias", "css.Service" , NULL, NULL, NULL);
-    JobURL::impldbg_checkURL("vnd.sun.star.job:service=css.Service;alias=myAlias"                 , E_ALIAS | E_SERVICE           , ""         , "myAlias", "css.Service ", NULL, NULL, NULL);
-    JobURL::impldbg_checkURL("vnd.sun.star.job:service=css.Service; alias=myAlias"                 , E_UNKNOWN                     , ""         , ""       , ""            , NULL, NULL, NULL);
-    JobURL::impldbg_checkURL("vnd.sun.star.job : event=onMyEvent"                                  , E_UNKNOWN                     , ""         , ""       , ""            , NULL, NULL, NULL);
-    JobURL::impldbg_checkURL("vnd.sun.star.job:event=onMyEvent;event=onMyEvent;service=css.Service", E_UNKNOWN                     , ""         , ""       , ""            , NULL, NULL, NULL);
-
-    // check upper/lower case
-    // fix parts of the URL are case insensitive (e.g. "vnd.SUN.star.job:eVEnt=")
-    // values are case sensitive                 (e.g. "myAlias"                )
-    JobURL::impldbg_checkURL("vnd.SUN.star.job:eVEnt=onMyEvent;aliAs=myAlias;serVice=css.Service", E_EVENT | E_ALIAS | E_SERVICE , "onMyEvent", "myAlias", "css.Service" , NULL, NULL, NULL);
-    JobURL::impldbg_checkURL("vnd.SUN.star.job:eVEnt=onMyEVENT;aliAs=myALIAS;serVice=css.SERVICE", E_EVENT | E_ALIAS | E_SERVICE , "onMyEVENT", "myALIAS", "css.SERVICE" , NULL, NULL, NULL);
-
-    // check stupid URLs
-    JobURL::impldbg_checkURL("vnd.sun.star.jobs:service=css.Service"    , E_UNKNOWN, "", "", "", NULL, NULL, NULL);
-    JobURL::impldbg_checkURL("vnd.sun.star.job service=css.Service"     , E_UNKNOWN, "", "", "", NULL, NULL, NULL);
-    JobURL::impldbg_checkURL("vnd.sun.star.job:service;css.Service"     , E_UNKNOWN, "", "", "", NULL, NULL, NULL);
-    JobURL::impldbg_checkURL("vnd.sun.star.job:service;"                , E_UNKNOWN, "", "", "", NULL, NULL, NULL);
-    JobURL::impldbg_checkURL("vnd.sun.star.job:;alias;service;event="   , E_UNKNOWN, "", "", "", NULL, NULL, NULL);
-    JobURL::impldbg_checkURL("vnd.sun.star.job:alias=a;service=s;event=", E_UNKNOWN, "", "", "", NULL, NULL, NULL);
-
-    // check argument handling
-    JobURL::impldbg_checkURL("vnd.sun.star.job:event=onMyEvent?eventArg1,eventArg2=3,eventArg4,"            , E_EVENT          , "onMyEvent", ""       , ""             , "eventArg1,eventArg2=3,eventArg4,", NULL                 , NULL          );
-    JobURL::impldbg_checkURL("vnd.sun.star.job:alias=myAlias?aliasArg1,aliasarg2"                           , E_EVENT          , ""         , "myAlias", ""             , NULL                              , "aliasArg1,aliasarg2", NULL          );
-    JobURL::impldbg_checkURL("vnd.sun.star.job:service=css.myService?serviceArg1"                           , E_EVENT          , ""         , ""       , "css.myService", NULL                              , NULL                 , "serviceArg1" );
-    JobURL::impldbg_checkURL("vnd.sun.star.job:service=css.myService?serviceArg1;alias=myAlias?aliasArg=564", E_EVENT | E_ALIAS, ""         , "myAlias", "css.myService", NULL                              , "aliasArg=564"       , "serviceArg1" );
-}
-
-/**
-    @short      helper debug method
-    @descr      It uses the given parameter to create a new instance of a JobURL.
-                They results will be compared with the expected ones.
-                The a log will be written, which contains some detailed information
-                for this sub test.
-
-    @param      pURL
-                    the job URL, which should be checked
-
-    @param      eExpectedPart
-                    the expected result
-
-    @param      pExpectedEvent
-                    the expected event value
-
-    @param      pExpectedAlias
-                    the expected alias value
-
-    @param      pExpectedService
-                    the expected service value
-
-    @param      pExpectedEventArgs
-                    the expected event arguments
-
-    @param      pExpectedAliasArgs
-                    the expected alias arguments
-
-    @param      pExpectedServiceArgs
-                    the expected service arguments
-*/
-void JobURL::impldbg_checkURL( /*IN*/ const sal_Char*  pURL                 ,
-                               /*IN*/       sal_uInt32 eExpectedPart        ,
-                               /*IN*/ const sal_Char*  pExpectedEvent       ,
-                               /*IN*/ const sal_Char*  pExpectedAlias       ,
-                               /*IN*/ const sal_Char*  pExpectedService     ,
-                               /*IN*/ const sal_Char*  pExpectedEventArgs   ,
-                               /*IN*/ const sal_Char*  pExpectedAliasArgs   ,
-                               /*IN*/ const sal_Char*  pExpectedServiceArgs )
-{
-    OUString sEvent;
-    OUString sAlias;
-    OUString sService;
-    OUString sEventArgs;
-    OUString sAliasArgs;
-    OUString sServiceArgs;
-    OUString sURL    (OUString::createFromAscii(pURL));
-    sal_Bool        bOK     = sal_True;
-
-    JobURL aURL(sURL);
-
-    // check if URL is invalid
-    if (eExpectedPart==E_UNKNOWN)
-        bOK = !aURL.isValid();
-
-    // check if URL has the expected event part
-    if (
-        (bOK                                 ) &&
-        ((eExpectedPart & E_EVENT) == E_EVENT)
-       )
-    {
-        bOK = (
-                (aURL.isValid()                          ) &&
-                (aURL.getEvent(sEvent)                   ) &&
-                (!sEvent.isEmpty()                       ) &&
-                (sEvent.equalsAscii(pExpectedEvent))
-              );
-
-        if (bOK && pExpectedEventArgs!=NULL)
-        {
-            bOK = (
-                    (aURL.getEventArgs(sEventArgs)                   ) &&
-                    (sEventArgs.equalsAscii(pExpectedEventArgs))
-                  );
-        }
-    }
-
-    // check if URL has no event part
-    if (
-        (bOK                                 ) &&
-        ((eExpectedPart & E_EVENT) != E_EVENT)
-       )
-    {
-        bOK = (
-                (!aURL.getEvent(sEvent)        ) &&
-                (sEvent.isEmpty()              ) &&
-                (!aURL.getEventArgs(sEventArgs)) &&
-                (sEventArgs.isEmpty()          )
-              );
-    }
-
-    // check if URL has the expected alias part
-    if (
-        (bOK                                 ) &&
-        ((eExpectedPart & E_ALIAS) == E_ALIAS)
-       )
-    {
-        bOK = (
-                (aURL.isValid()                          ) &&
-                (aURL.getAlias(sAlias)                   ) &&
-                (!sAlias.isEmpty()                       ) &&
-                (sAlias.equalsAscii(pExpectedAlias))
-              );
-
-        if (bOK && pExpectedAliasArgs!=NULL)
-        {
-            bOK = (
-                    (aURL.getAliasArgs(sAliasArgs)                   ) &&
-                    (sAliasArgs.equalsAscii(pExpectedAliasArgs))
-                  );
-        }
-    }
-
-    // check if URL has the no alias part
-    if (
-        (bOK                                 ) &&
-        ((eExpectedPart & E_ALIAS) != E_ALIAS)
-       )
-    {
-        bOK = (
-                (!aURL.getAlias(sAlias)        ) &&
-                (sAlias.isEmpty()              ) &&
-                (!aURL.getAliasArgs(sAliasArgs)) &&
-                (sAliasArgs.isEmpty()          )
-              );
-    }
-
-    // check if URL has the expected service part
-    if (
-        (bOK                                     ) &&
-        ((eExpectedPart & E_SERVICE) == E_SERVICE)
-       )
-    {
-        bOK = (
-                (aURL.isValid()                              ) &&
-                (aURL.getService(sService)                   ) &&
-                (!sService.isEmpty()                         ) &&
-                (sService.equalsAscii(pExpectedService))
-              );
-
-        if (bOK && pExpectedServiceArgs!=NULL)
-        {
-            bOK = (
-                    (aURL.getServiceArgs(sServiceArgs)                   ) &&
-                    (sServiceArgs.equalsAscii(pExpectedServiceArgs))
-                  );
-        }
-    }
-
-    // check if URL has the no service part
-    if (
-        (bOK                                     ) &&
-        ((eExpectedPart & E_SERVICE) != E_SERVICE)
-       )
-    {
-        bOK = (
-                (!aURL.getService(sService)        ) &&
-                (sService.isEmpty()                ) &&
-                (!aURL.getServiceArgs(sServiceArgs)) &&
-                (sServiceArgs.isEmpty()            )
-              );
-    }
-
-    OUStringBuffer sMsg(256);
-
-    sMsg.append(sURL);
-    sMsg.appendAscii("\" ");
-
-    if (bOK)
-    {
-        sMsg.appendAscii("... OK\n");
-    }
-    else
-    {
-        sMsg.appendAscii("... failed. ");
-        sMsg.appendAscii("Expected: ");
-        if (eExpectedPart==E_UNKNOWN)
-            sMsg.appendAscii("E_UNKNOWN");
-        if ((eExpectedPart & E_EVENT) == E_EVENT)
-        {
-            sMsg.appendAscii("| E_EVENT e=\"");
-            sMsg.appendAscii(pExpectedEvent  );
-            sMsg.appendAscii("\""            );
-        }
-        if ((eExpectedPart & E_ALIAS) == E_ALIAS)
-        {
-            sMsg.appendAscii("| E_ALIAS a=\"");
-            sMsg.appendAscii(pExpectedAlias  );
-            sMsg.appendAscii("\""            );
-        }
-        if ((eExpectedPart & E_SERVICE) == E_SERVICE)
-        {
-            sMsg.appendAscii("| E_SERVICE s=\"");
-            sMsg.appendAscii(pExpectedService  );
-            sMsg.appendAscii("\""              );
-        }
-        sMsg.appendAscii(", Actual: "     );
-        sMsg.append     (aURL.impldbg_toString());
-    }
-
-    SAL_INFO("fwk.joburl", OUString(sMsg));
-}
-
-/**
-    @short      helper debug method
-    @descr      It returns a representation of the internal object state
-                as string notation.
-
-    @returns    The formatted string representation.
-*/
-OUString JobURL::impldbg_toString() const
-{
-    SolarMutexGuard g;
-
-    OUStringBuffer sBuffer(256);
-
-    if (m_eRequest==E_UNKNOWN)
-        sBuffer.appendAscii("E_UNKNOWN");
-    if ((m_eRequest & E_EVENT) == E_EVENT)
-        sBuffer.appendAscii("| E_EVENT");
-    if ((m_eRequest & E_ALIAS) == E_ALIAS)
-        sBuffer.appendAscii("| E_ALIAS");
-    if ((m_eRequest & E_SERVICE) == E_SERVICE)
-        sBuffer.appendAscii("| E_SERVICE");
-    sBuffer.appendAscii("{ e=\""   );
-    sBuffer.append     (m_sEvent   );
-    sBuffer.appendAscii("\" - a=\"");
-    sBuffer.append     (m_sAlias   );
-    sBuffer.appendAscii("\" - s=\"");
-    sBuffer.append     (m_sService );
-    sBuffer.appendAscii("\" }"     );
-
-    return sBuffer.makeStringAndClear();
-}
-
-sal_Bool JobURL::getServiceArgs( /*OUT*/ OUString& sServiceArgs ) const
-{
-    SolarMutexGuard g;
-
-             sServiceArgs.clear();
-    sal_Bool bSet         = ((m_eRequest & E_SERVICE) == E_SERVICE);
-    if (bSet)
-        sServiceArgs = m_sServiceArgs;
-
-    return bSet;
-}
-
-sal_Bool JobURL::getEventArgs( /*OUT*/ OUString& sEventArgs ) const
-{
-    SolarMutexGuard g;
-
-             sEventArgs.clear();
-    sal_Bool bSet       = ((m_eRequest & E_EVENT) == E_EVENT);
-    if (bSet)
-        sEventArgs = m_sEventArgs;
-
-    return bSet;
-}
-
-sal_Bool JobURL::getAliasArgs( /*OUT*/ OUString& sAliasArgs ) const
-{
-    SolarMutexGuard g;
-
-             sAliasArgs.clear();
-    sal_Bool bSet       = ((m_eRequest & E_ALIAS) == E_ALIAS);
-    if (bSet)
-        sAliasArgs = m_sAliasArgs;
-
-    return bSet;
-}
-
-#endif // ENABLE_COMPONENT_SELF_CHECK
-
 } // namespace framework
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list