[PATCH] code cleanup and fix typos in comments

Takeshi Abe tabe at fixedpoint.jp
Sat Dec 25 08:22:11 PST 2010


---
 desktop/source/app/app.cxx             |   50 +-------------------------------
 desktop/source/app/dispatchwatcher.cxx |   14 ---------
 desktop/source/app/officeipcthread.cxx |    4 +--
 desktop/source/app/userinstall.cxx     |    7 ----
 4 files changed, 2 insertions(+), 73 deletions(-)

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index ff74aee..d9c506e 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -167,14 +167,10 @@
 using rtl::OUString;
 using rtl::OUStringBuffer;
 
-//Gives an ICE with MSVC6
-//namespace css = ::com::sun::star;
-
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::util;
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::beans;
-//using namespace ::com::sun::star::bridge;
 using namespace ::com::sun::star::frame;
 using namespace ::com::sun::star::document;
 using namespace ::com::sun::star::view;
@@ -216,15 +212,6 @@ ResMgr* Desktop::GetDesktopResManager()
             // Use VCL to get the correct language specific message as we
             // are in the bootstrap process and not able to get the installed
             // language!!
-/*
-            LanguageType aLanguageType = LANGUAGE_DONTKNOW;
-
-            Desktop::pResMgr = ResMgr::SearchCreateResMgr( U2S( aMgrName ), aLanguageType );
-            AllSettings as = GetSettings();
-            as.SetUILanguage(aLanguageType);
-            SetSettings(as);
-*/
-            // LanguageSelection langselect;
             OUString aUILocaleString = LanguageSelection::getLanguageString();
             sal_Int32 nIndex = 0;
             OUString aLanguage = aUILocaleString.getToken( 0, '-', nIndex);
@@ -1646,25 +1633,6 @@ int Desktop::Main()
         }
         String aTitle = pLabelResMgr ? String( ResId( RID_APPTITLE, *pLabelResMgr ) ) : String();
         delete pLabelResMgr;
-/*
-        // locale and UI locale in AppSettings are now retrieved from configuration or system directly via SvtSysLocale
-        // no reason to set while starting
-        // set UI language and locale
-        RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ set locale settings" );
-        //LanguageSelection langselect;
-        OUString aUILocaleString = LanguageSelection::getLanguageString();
-        Locale aUILocale = LanguageSelection::IsoStringToLocale(aUILocaleString);
-        LanguageType eLanguage = SvtSysLocale().GetLanguage();
-
-        // #i39040#, do not call anything between GetSettings and SetSettings that might have
-        // a side effect on the settings (like, eg, SvtSysLocaleOptions().GetLocaleLanguageType(),
-        // which changes the MiscSettings !!! )
-        AllSettings aSettings( Application::GetSettings() );
-        aSettings.SetUILocale( aUILocale );
-        aSettings.SetLanguage( eLanguage );
-        Application::SetSettings( aSettings );
-        RTL_LOGFILE_CONTEXT_TRACE( aLog, "} set locale settings" );
-*/
 
         // Check for StarOffice/Suite specific extensions runs also with OpenOffice installation sets
         OUString aTitleString( aTitle );
@@ -1688,8 +1656,6 @@ int Desktop::Main()
         RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ create SvtPathOptions and SvtLanguageOptions" );
         pPathOptions.reset( new SvtPathOptions);
         SetSplashScreenProgress(40);
-//        pLanguageOptions = new SvtLanguageOptions(sal_True);
-//        SetSplashScreenProgress(45);
         RTL_LOGFILE_CONTEXT_TRACE( aLog, "} create SvtPathOptions and SvtLanguageOptions" );
 
         // Check special env variable #111015#
@@ -2195,14 +2161,10 @@ IMPL_LINK( Desktop, OpenClients_Impl, void*, EMPTYARG )
 
     OfficeIPCThread::SetReady();
 
-    // CloseStartupScreen();
     CloseSplashScreen();
 
     CheckFirstRun( );
 
-    // allow ipc interaction
-//    OfficeIPCThread::SetReady();
-
     EnableOleAutomation();
 
     if (getenv ("OOO_EXIT_POST_STARTUP"))
@@ -2700,16 +2662,6 @@ void Desktop::OpenClients()
 
     if ( ! bAllowRecoveryAndSessionManagement )
     {
-     /*
-        ::comphelper::ConfigurationHelper::writeDirectKey(
-                ::comphelper::getProcessServiceFactory(),
-                ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Recovery")),
-                ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AutoSave")),
-                ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Enabled")),
-                ::com::sun::star::uno::makeAny(sal_False),
-                ::comphelper::ConfigurationHelper::E_STANDARD);
-
-        */
         try
         {
             Reference< XDispatch > xRecovery(
@@ -2982,7 +2934,7 @@ String GetURL_Impl(
     }
 
     // Add path seperator to these directory and make given URL (rName) absolute by using of current working directory
-    // Attention: "setFianlSlash()" is neccessary for calling "smartRel2Abs()"!!!
+    // Attention: "setFinalSlash()" is necessary for calling "smartRel2Abs()"!!!
     // Otherwhise last part will be ignored and wrong result will be returned!!!
     // "smartRel2Abs()" interpret given URL as file not as path. So he truncate last element to get the base path ...
     // But if we add a seperator - he doesn't do it anymore.
diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx
index 75bf44b..8d8fc9d 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -393,7 +393,6 @@ sal_Bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatch
             try
             {
                 xDoc = Reference < XPrintable >( ::comphelper::SynchronousDispatch::dispatch( xDesktop, aName, aTarget, 0, aArgs ), UNO_QUERY );
-                //xDoc = Reference < XPrintable >( xDesktop->loadComponentFromURL( aName, aTarget, 0, aArgs ), UNO_QUERY );
             }
             catch ( ::com::sun::star::lang::IllegalArgumentException& iae)
             {
@@ -455,7 +454,6 @@ sal_Bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatch
                             rtl::OUString aOutFile = aFilterOut+
                                                      ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/" ))+
                                                      aOutFilename.getName();
-                            //FileBase::getFileURLFromSystemPath( aOutFile, aOutFile );
 
                             if ( bGuess )
                             {
@@ -639,18 +637,6 @@ void SAL_CALL DispatchWatcher::dispatchFinished( const DispatchResultEvent& ) th
     sal_Int16 nCount = m_nRequestCount;
     aGuard.clear();
     OfficeIPCThread::RequestsCompleted( 1 );
-/*
-    // Find request in our hash map and remove it as a pending request
-    DispatchWatcherHashMap::iterator pDispatchEntry = m_aRequestContainer.find( rEvent.FeatureURL.Complete ) ;
-    if ( pDispatchEntry != m_aRequestContainer.end() )
-    {
-        m_aRequestContainer.erase( pDispatchEntry );
-        aGuard.clear();
-        OfficeIPCThread::RequestsCompleted( 1 );
-    }
-    else
-        aGuard.clear();
-*/
     if ( !nCount && !OfficeIPCThread::AreRequestsPending() )
     {
         // We have to check if we have an open task otherwise we have to shutdown the office.
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index 28a9106..25ba2c8 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -222,7 +222,7 @@ OfficeIPCThread*	OfficeIPCThread::pGlobalOfficeIPCThread = 0;
     namespace { struct Security : public rtl::Static<osl::Security, Security> {}; }
 ::osl::Mutex*		OfficeIPCThread::pOfficeIPCThreadMutex = 0;
 
-// Turns a string in aMsg such as file://home/foo/.libreoffice/3
+// Turns a string in aMsg such as file:///home/foo/.libreoffice/3
 // Into a hex string of well known length ff132a86...
 String CreateMD5FromString( const OUString& aMsg )
 {
@@ -908,8 +908,6 @@ void SAL_CALL OfficeIPCThread::run()
             while (
                    (nResult = maStreamPipe.send(sc_aConfirmationSequence+nBytes, sc_nCSeqLength-nBytes))>0 &&
                    ((nBytes += nResult) < sc_nCSeqLength) ) ;
-            // now we can close, don't we?
-            // maStreamPipe.close();
 
         }
         else
diff --git a/desktop/source/app/userinstall.cxx b/desktop/source/app/userinstall.cxx
index 644bda2..c80ade8 100644
--- a/desktop/source/app/userinstall.cxx
+++ b/desktop/source/app/userinstall.cxx
@@ -97,11 +97,6 @@ namespace desktop {
                     theMSF->createInstance(sConfigSrvc), UNO_QUERY_THROW);
 
             // localize the provider to user selection
-//            Reference< XLocalizable > localizable(theConfigProvider, UNO_QUERY_THROW);
-//            LanguageType aUserLanguageType = LanguageSelection::getLanguageType();
-//            Locale aLocale( MsLangId::convertLanguageToIsoString(aUserLanguageType));
-//            localizable->setLocale(aLocale);
-
             Reference< XLocalizable > localizable(theConfigProvider, UNO_QUERY_THROW);
             OUString aUserLanguage = LanguageSelection::getLanguageString();
             Locale aLocale = LanguageSelection::IsoStringToLocale(aUserLanguage);
@@ -275,8 +270,6 @@ namespace desktop {
                 theMSF->createInstance(sConfigSrvc), UNO_QUERY_THROW);
             Sequence< Any > theArgs(1);
             NamedValue v(OUString(RTL_CONSTASCII_USTRINGPARAM("NodePath")), makeAny(OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup"))));
-            //v.Name = OUString(RTL_CONSTASCII_USTRINGPARAM("NodePath"));
-            //v.Value = makeAny(OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup")));
             theArgs[0] <<= v;
             Reference< XHierarchicalPropertySet> hpset(
                 theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs), UNO_QUERY_THROW);
-- 
1.7.2.3


----Next_Part(Sun_Dec_26_01_26_40_2010_658)----


More information about the LibreOffice mailing list