[Libreoffice-commits] .: 3 commits - instsetoo_native/util l10ntools/inc l10ntools/source setup_native/source

Andras Timar timar at kemper.freedesktop.org
Tue Nov 8 13:39:21 PST 2011


 dev/null                                     |binary
 instsetoo_native/util/openoffice.lst         |   22 ----
 l10ntools/inc/srciter.hxx                    |    3 
 l10ntools/source/localize.cxx                |  139 +++------------------------
 l10ntools/source/srciter.cxx                 |   10 -
 setup_native/source/packinfo/libreoffice.pcp |binary
 6 files changed, 25 insertions(+), 149 deletions(-)

New commits:
commit a527939c80d2ad22c07776b574ec0a2775fbd5f5
Author: Andras Timar <atimar at suse.com>
Date:   Tue Nov 8 22:36:07 2011 +0100

    remove unused variables

diff --git a/instsetoo_native/util/openoffice.lst b/instsetoo_native/util/openoffice.lst
index 6f2b77f..1371634 100644
--- a/instsetoo_native/util/openoffice.lst
+++ b/instsetoo_native/util/openoffice.lst
@@ -63,8 +63,6 @@ LibreOffice
 			ABOUTBOXPRODUCTVERSION 3.5.0
 			BASEPRODUCTVERSION 3.5
             PCPFILENAME libreoffice.pcp
-			UPDATEURL http://update.libreoffice.org/ProductUpdateService/check.Update
-            ODFNOTIFYURL http://odfnotify.libreoffice.org/OOo3.0/notification.jsp?version=ODF
 			ADD_INCLUDE_FILES cliureversion.mk,clioootypesversion.mk,userland.txt,version.lst
 			REMOVE_UPGRADE_CODE_FILE upgradecode_remove_ooo.txt
 			ADDSYSTEMINTEGRATION 1
@@ -96,8 +94,6 @@ LibreOffice
             STARTCENTER_INFO_URL http://www.libreoffice.org/
             STARTCENTER_TEMPLREP_URL http://templates.libreoffice.org/
             STARTCENTER_LAYOUT_STYLE 0
-            REGISTRATION_PRODUCT LibreOffice
-            REGISTRATION_CID 926117
             DICT_REPO_URL http://extensions.libreoffice.org/dictionaries/
 		}
 		active			1
@@ -127,8 +123,6 @@ LibreOffice_wJRE
 			USERDIRPRODUCTVERSION 3
 			ABOUTBOXPRODUCTVERSION 3.5.0
 			BASEPRODUCTVERSION 3.5
-			UPDATEURL http://update.libreoffice.org/ProductUpdateService/check.Update
-            ODFNOTIFYURL http://odfnotify.libreoffice.org/OOo3.0/notification.jsp?version=ODF
 			ADD_INCLUDE_FILES cliureversion.mk,clioootypesversion.mk,javaversion2.dat,userland.txt,version.lst
 			REMOVE_UPGRADE_CODE_FILE upgradecode_remove_ooo.txt
 			ADDSYSTEMINTEGRATION 1
@@ -162,8 +156,6 @@ LibreOffice_wJRE
             STARTCENTER_INFO_URL http://www.libreoffice.org/
             STARTCENTER_TEMPLREP_URL http://templates.libreoffice.org/
             STARTCENTER_LAYOUT_STYLE 0
-            REGISTRATION_PRODUCT LibreOffice
-            REGISTRATION_CID 926117
             DICT_REPO_URL http://extensions.libreoffice.org/dictionaries/
 		}
 		active			1
@@ -198,8 +190,6 @@ LibreOffice_Dev
 			SOLSUREPACKAGEPREFIX lodev
 			REGISTRYLAYERNAME LayerDev
 			SERVICETAG_URN urn:uuid:1680b00d-e45c-11de-82d6-080020a9ed93
-			UPDATEURL http://update.libreoffice.org/ProductUpdateService/check.Update
-            ODFNOTIFYURL http://odfnotify.libreoffice.org/OOo3.0/notification.jsp?version=ODF
 			ADD_INCLUDE_FILES cliureversion.mk,clioootypesversion.mk,javaversion2.dat,userland.txt,version.lst
 			EVAL
 			FILEFORMATNAME OpenOffice.org
@@ -231,8 +221,6 @@ LibreOffice_Dev
             STARTCENTER_INFO_URL http://www.libreoffice.org/
             STARTCENTER_TEMPLREP_URL http://templates.libreoffice.org/
             STARTCENTER_LAYOUT_STYLE 0
-            REGISTRATION_PRODUCT LibreOffice
-            REGISTRATION_CID 926117
             DICT_REPO_URL http://extensions.libreoffice.org/dictionaries/
 		}
 		active			1
@@ -402,8 +390,6 @@ OxygenOffice
 			ABOUTBOXPRODUCTVERSION 3.5.0
 			BASEPRODUCTVERSION 3.5
             PCPFILENAME openoffice.pcp
-			UPDATEURL http://update.libreoffice.org/ProductUpdateService/check.Update
-            ODFNOTIFYURL http://odfnotify.libreoffice.org/OOo3.0/notification.jsp?version=ODF
 			ADD_INCLUDE_FILES cliureversion.mk,clioootypesversion.mk,userland.txt,version.lst
 			REMOVE_UPGRADE_CODE_FILE upgradecode_remove_ooo.txt
 			ADDSYSTEMINTEGRATION 1
@@ -440,8 +426,6 @@ OxygenOffice
             STARTCENTER_INFO_URL http://www.libreoffice.org/
             STARTCENTER_TEMPLREP_URL http://templates.libreoffice.org/
             STARTCENTER_LAYOUT_STYLE 0
-            REGISTRATION_PRODUCT OxygenOffice
-            REGISTRATION_CID 926117
             DICT_REPO_URL http://extensions.libreoffice.org/dictionaries/
 		}
 		active			1
@@ -471,8 +455,6 @@ OxygenOffice_wJRE
 			USERDIRPRODUCTVERSION 3
 			ABOUTBOXPRODUCTVERSION 3.5.0
 			BASEPRODUCTVERSION 3.5
-			UPDATEURL http://update.libreoffice.org/ProductUpdateService/check.Update
-            ODFNOTIFYURL http://odfnotify.libreoffice.org/OOo3.0/notification.jsp?version=ODF
 			ADD_INCLUDE_FILES cliureversion.mk,clioootypesversion.mk,javaversion2.dat,userland.txt,version.lst
 			REMOVE_UPGRADE_CODE_FILE upgradecode_remove_ooo.txt
 			ADDSYSTEMINTEGRATION 1
@@ -511,8 +493,6 @@ OxygenOffice_wJRE
             STARTCENTER_INFO_URL http://www.libreoffice.org/
             STARTCENTER_TEMPLREP_URL http://templates.libreoffice.org/
             STARTCENTER_LAYOUT_STYLE 0
-            REGISTRATION_PRODUCT OxygenOffice
-            REGISTRATION_CID 926117
             DICT_REPO_URL http://extensions.libreoffice.org/dictionaries/
 		}
 		active			1
commit f14ceb771425a895d9f499405f504e5edc3dae78
Author: Andras Timar <atimar at suse.com>
Date:   Tue Nov 8 21:50:32 2011 +0100

    add patch creation profile file for LibreOffice

diff --git a/instsetoo_native/util/openoffice.lst b/instsetoo_native/util/openoffice.lst
index c9c0e20..6f2b77f 100644
--- a/instsetoo_native/util/openoffice.lst
+++ b/instsetoo_native/util/openoffice.lst
@@ -62,7 +62,7 @@ LibreOffice
 			USERDIRPRODUCTVERSION 3
 			ABOUTBOXPRODUCTVERSION 3.5.0
 			BASEPRODUCTVERSION 3.5
-            PCPFILENAME openoffice.pcp
+            PCPFILENAME libreoffice.pcp
 			UPDATEURL http://update.libreoffice.org/ProductUpdateService/check.Update
             ODFNOTIFYURL http://odfnotify.libreoffice.org/OOo3.0/notification.jsp?version=ODF
 			ADD_INCLUDE_FILES cliureversion.mk,clioootypesversion.mk,userland.txt,version.lst
diff --git a/setup_native/source/packinfo/libreoffice.pcp b/setup_native/source/packinfo/libreoffice.pcp
new file mode 100644
index 0000000..68c98c6
Binary files /dev/null and b/setup_native/source/packinfo/libreoffice.pcp differ
diff --git a/setup_native/source/packinfo/openoffice.pcp b/setup_native/source/packinfo/openoffice.pcp
deleted file mode 100644
index 1428227..0000000
Binary files a/setup_native/source/packinfo/openoffice.pcp and /dev/null differ
commit 182913a18c01b945e27246a6ace4e5104bccd9c0
Author: Andras Timar <atimar at suse.com>
Date:   Tue Nov 8 18:50:58 2011 +0100

    code cleanup of localize tool

diff --git a/l10ntools/inc/srciter.hxx b/l10ntools/inc/srciter.hxx
index c859d23..5a1db39 100644
--- a/l10ntools/inc/srciter.hxx
+++ b/l10ntools/inc/srciter.hxx
@@ -43,11 +43,10 @@ private:
     void ExecuteDirectory( transex::Directory& pDirectory );
 
 protected:
-    bool bLocal;
     bool bSkipLinks;
 
 public:
-    SourceTreeIterator( const ByteString &rRootDirectory, const ByteString &rVersion , bool bLocal_in = false);
+    SourceTreeIterator( const ByteString &rRootDirectory, const ByteString &rVersion );
     virtual ~SourceTreeIterator();
 
     sal_Bool StartExecute();
diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx
index 8e0a370..609e344 100644
--- a/l10ntools/source/localize.cxx
+++ b/l10ntools/source/localize.cxx
@@ -172,7 +172,6 @@ const char DLIST_NAME[] = "d.lst";
 
 #define LOCALIZE_NONE       0x0000
 #define LOCALIZE_EXTRACT    0x0001
-#define LOCALIZE_MERGE      0x0002
 
 class SourceTreeLocalizer : public SourceTreeIterator
 {
@@ -208,11 +207,9 @@ private:
     );
     void WorkOnDirectory( const ByteString &rDirectory );
 public:
-    SourceTreeLocalizer( const ByteString &rRoot, const ByteString &rVersion , bool bLocal , bool skip_links );
+    SourceTreeLocalizer( const ByteString &rRoot, const ByteString &rVersion , bool skip_links );
     ~SourceTreeLocalizer();
 
-    ByteString getSourceLanguages( ByteString sLanguageRestriction , ByteString sCommand );
-
     void SetLanguageRestriction( const ByteString& rRestrictions )
         { sLanguageRestriction = rRestrictions; }
     int getFileCnt();
@@ -223,9 +220,9 @@ public:
 
 /*****************************************************************************/
 SourceTreeLocalizer::SourceTreeLocalizer(
-    const ByteString &rRoot, const ByteString &rVersion, bool bLocal_in , bool skip_links )
+    const ByteString &rRoot, const ByteString &rVersion, bool skip_links )
 /*****************************************************************************/
-                : SourceTreeIterator( rRoot, rVersion , bLocal_in ),
+                : SourceTreeIterator( rRoot, rVersion ),
                 nMode( LOCALIZE_NONE ),
                 nFileCnt( 0 )
 {
@@ -368,7 +365,7 @@ void SourceTreeLocalizer::WorkOnFile(
         sCommand += sTempFile;
         if ( sLanguageRestriction.Len()) {
             sCommand += " -l ";
-        sCommand += getSourceLanguages( sLanguageRestriction , sCommand );
+            sCommand +=  sLanguageRestriction;
         }
 
             //printf("DBG: %s\n",sCommand.GetBuffer());
@@ -393,18 +390,6 @@ void SourceTreeLocalizer::WorkOnFile(
         aOldCWD.SetCWD();
 }
 
-ByteString SourceTreeLocalizer::getSourceLanguages( ByteString sLanguageRestriction_inout , ByteString sCommand )
-{
-    // Source languages in helpcontent2 and macromigration en-US only!
-    if( sCommand.Search("helpex") != STRING_NOTFOUND ) {
-        sLanguageRestriction_inout.Assign( ByteString("en-US") );
-    }
-    else if( sCommand.Search("xmlex") != STRING_NOTFOUND ){
-        sLanguageRestriction_inout.Assign( ByteString("en-US") );
-    }
-    return sLanguageRestriction_inout;
-}
-
 /*****************************************************************************/
 sal_Bool SourceTreeLocalizer::CheckNegativeList( const ByteString &rFileName )
 /*****************************************************************************/
@@ -559,14 +544,6 @@ sal_Bool SourceTreeLocalizer::Extract( const ByteString &rDestinationFile )
 }
 using namespace transex3;
 
-#define STATE_NONE      0x0000
-#define STATE_EXPORT    0x0001
-#define STATE_MERGE     0x0002
-#define STATE_ISOCODE   0x0003
-#define STATE_LANGUAGES 0x0004
-#define STATE_FILENAME  0x0005
-#define STATE_OUTPUT    0x0006
-
 /*****************************************************************************/
 void Help()
 /*****************************************************************************/
@@ -575,23 +552,12 @@ void Help()
         "localize (c)2001 by Sun Microsystems\n"
         "====================================\n" );
     fprintf( stdout,
-        "As part of the L10N framework, localize extracts and merges translations\n"
-        "out of and into the toplevel modules defined in ModuleList array in\n"
+        "As part of the L10N framework, localize extracts en-US strings for\n"
+        "translation out of the toplevel modules defined in ModuleList array in\n"
         "l10ntools/source/localize.cxx.\n\n"
-        "Syntax: localize -e -l en-US -f FileName \n"
+        "Syntax: localize -f FileName \n"
         "Parameter:\n"
-        "\t-e: Extract mode\n"
-        "\tFileName: Output file when extract mode, input file when merge mode\n"
-        "\tl1...ln: supported languages (\"all\" for all languages).\n"
-    );
-
-    fprintf( stdout,
-        "Valid language codes for l1...ln and f1...fn are:\n" );
-    fprintf( stdout,
-        "\nExample 1:\n"
-        "==========\n"
-        "localize -e -l en-US -f MyFile\n\n"
-        "All strings will be extracted for language en-US.\n"
+        "\tFileName: Output file\n"
     );
 }
 
@@ -604,14 +570,6 @@ int Error()
 }
 
 /*****************************************************************************/
-sal_Bool CheckLanguages( ByteString &rLanguages )
-/*****************************************************************************/
-{
-    ByteString sTmp( rLanguages );
-    return true;
-}
-
-/*****************************************************************************/
 #if defined(UNX)
 int main( int argc, char *argv[] )
 #else
@@ -621,101 +579,42 @@ int _cdecl main( int argc, char *argv[] )
 {
     String sTempBase( String::CreateFromAscii( "loc" ));
     DirEntry::SetTempNameBase( sTempBase );
-    sal_uInt16 nState   = STATE_NONE;
 
-    sal_Bool bExport    = sal_False;
-    sal_Bool bMerge     = sal_False;
     bool bSkipLinks = false;
 
     ByteString sLanguages;
     ByteString sFileName;
-    ByteString sOutput;
 
-    bExport = sal_True;
+    sLanguages = ByteString( "en-US" );
 
-    for( int i = 1; i < argc; i++ ) {
-        ByteString sSwitch( argv[ i ] );
-        sSwitch.ToUpperAscii();
+    ByteString sSwitch( argv[ 1 ] );
+    sSwitch.ToUpperAscii();
 
-        if ( sSwitch.Equals( "-E" )) {
-            nState = STATE_EXPORT;
-            if ( bMerge )
-                return Error();
-            bExport = sal_True;
-        }
-        else if ( sSwitch.Equals( "-I" ) )
-            nState = STATE_ISOCODE;
-        else if ( sSwitch.Equals( "-L" ) )
-            nState = STATE_LANGUAGES;
-        else if ( sSwitch.Equals( "-F" ) )
-            nState = STATE_FILENAME;
-        else if ( ByteString( argv[ i ]).ToUpperAscii().Equals( "-O" ) )
-            nState = STATE_OUTPUT;
-        else {
-            switch ( nState ) {
-                case STATE_NONE:
-                    return Error();
-                case STATE_OUTPUT:
-                    if ( sOutput.Len())
-                        return Error();
-                    sOutput = ByteString( argv[ i ] );
-                    nState = STATE_NONE;
-                break;
-                case STATE_LANGUAGES:
-                    if ( sLanguages.Len())
-                        return Error();
-                    sLanguages = ByteString( argv[ i ] );
-                    nState = STATE_NONE;
-                break;
-                case STATE_FILENAME:
-                    if ( sFileName.Len())
-                        return Error();
-                    sFileName = ByteString( argv[ i ] );
-                    nState = STATE_NONE;
-                break;
-                default:
-                    return Error();
-            }
-        }
-    }
-    if ( !bMerge && !bExport ) {
-        Help();
-        return 1;
-    }
+    if ( ( argc == 3 ) && sSwitch.Equals( "-F" ) )
+        sFileName = ByteString( argv[ 2 ] );
+    else
+        return Error();
 
-    ByteString sSolarVer( Export::GetEnv( "WORK_STAMP" ));
     ByteString sVersion( Export::GetEnv( "WORK_STAMP" ));
 
-    if ( !sSolarVer.Len() || !sVersion.Len()) {
+    if ( !sVersion.Len() ) {
         fprintf( stderr, "ERROR: No environment set!\n" );
         return 1;
     }
 
-    if ( !CheckLanguages( sLanguages ))
-        return 2;
-
-    if ( !sFileName.Len()) {
-        fprintf( stderr, "ERROR: No filename given\n" );
-        return 3;
-    }
-
     DirEntry aEntry( String( sFileName , RTL_TEXTENCODING_ASCII_US ));
     aEntry.ToAbs();
     String sFullEntry = aEntry.GetFull();
     ByteString sFileABS(aEntry.GetFull(), osl_getThreadTextEncoding());
-    //printf("B %s\nA %s\n",rDestinationFile.GetBuffer(), sFile.GetBuffer());
     sFileName = sFileABS;
 
     string pwd;
     Export::getCurrentDir( pwd );
     cout << "Localizing directory " << pwd << "\n";
-    SourceTreeLocalizer aIter( ByteString( pwd.c_str() ) , sVersion , (sOutput.Len() > 0) , bSkipLinks );
+    SourceTreeLocalizer aIter( ByteString( pwd.c_str() ) , sVersion , bSkipLinks );
     aIter.SetLanguageRestriction( sLanguages );
-    if ( bExport ){
-        fflush( stdout );
-        aIter.Extract( sFileName );
-        printf("\n%d files found!\n",aIter.GetFileCnt());
-    }
+    aIter.Extract( sFileName );
+    printf("\n%d files found!\n",aIter.GetFileCnt());
     return 0;
 }
 
diff --git a/l10ntools/source/srciter.cxx b/l10ntools/source/srciter.cxx
index 6a16d92..dfd27f4 100644
--- a/l10ntools/source/srciter.cxx
+++ b/l10ntools/source/srciter.cxx
@@ -39,16 +39,14 @@
 
 /*****************************************************************************/
 SourceTreeIterator::SourceTreeIterator(
-    const ByteString &rRootDirectory, const ByteString &rVersion , bool bLocal_in )
+    const ByteString &rRootDirectory, const ByteString &rVersion )
 /*****************************************************************************/
-                : bInExecute( sal_False ) , bLocal( bLocal_in )
+                : bInExecute( sal_False )
 {
     (void) rVersion ;
 
-    if(!bLocal){
-        rtl::OUString sRootDirectory( rRootDirectory.GetBuffer() , rRootDirectory.Len() , RTL_TEXTENCODING_UTF8 );
-        aRootDirectory = transex::Directory( sRootDirectory );
-    }
+    rtl::OUString sRootDirectory( rRootDirectory.GetBuffer() , rRootDirectory.Len() , RTL_TEXTENCODING_UTF8 );
+    aRootDirectory = transex::Directory( sRootDirectory );
 }
 
 /*****************************************************************************/


More information about the Libreoffice-commits mailing list