diff options
author | Daniel Rentz <dr@openoffice.org> | 2010-07-27 17:12:01 +0200 |
---|---|---|
committer | Daniel Rentz <dr@openoffice.org> | 2010-07-27 17:12:01 +0200 |
commit | efa16af14469b6fdc27e375c71a3227b68d60672 (patch) | |
tree | d21c14154312e84273e0f9539bdf1af85ef241a3 | |
parent | rebase to m83 (diff) | |
parent | masterfix: #i10000# build breaks in shell,crashrep (diff) | |
download | core-efa16af14469b6fdc27e375c71a3227b68d60672.tar.gz core-efa16af14469b6fdc27e375c71a3227b68d60672.zip |
mib17: rebase to DEV300_m84
110 files changed, 3899 insertions, 1469 deletions
diff --git a/comphelper/inc/comphelper/docpasswordhelper.hxx b/comphelper/inc/comphelper/docpasswordhelper.hxx index 0a60c4b53ce9..dbbb68372a07 100644 --- a/comphelper/inc/comphelper/docpasswordhelper.hxx +++ b/comphelper/inc/comphelper/docpasswordhelper.hxx @@ -33,6 +33,7 @@ #include "comphelper/docpasswordrequest.hxx" namespace com { namespace sun { namespace star { namespace task { class XInteractionHandler; } } } } +namespace com { namespace sun { namespace star { namespace beans { struct PropertyValue; } } } } namespace comphelper { @@ -84,6 +85,116 @@ class COMPHELPER_DLLPUBLIC DocPasswordHelper public: // ------------------------------------------------------------------------ + /** This helper function generates the information related + to "Password to modify" provided by user. The result + sequence contains the hash and the algorithm-related + info. + + @param aString + The string for which the info should be generated + + @return + The sequence containing the hash and the algorithm-related info + */ + + static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > + GenerateNewModifyPasswordInfo( const ::rtl::OUString& aPassword ); + + // ------------------------------------------------------------------------ + + /** This helper function allows to check whether + the "Password to modify" provided by user is the correct one. + + @param aString + The string containing the provided password + + @param aInfo + The sequence containing the hash and the algorithm-info + + @return + <TRUE/> if the password is correct one + <FALSE/> otherwise + */ + + static sal_Bool IsModifyPasswordCorrect( + const ::rtl::OUString& aPassword, + const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aInfo ); + + + // ------------------------------------------------------------------------ + + /** This helper function generates the hash code based on the algorithm + specified by MS for "Password to modify" feature of Word. + + @param aString + The string for which the hash should be calculated + + @return + The hash represented by sal_uInt32 + */ + + static sal_uInt32 GetWordHashAsUINT32( + const ::rtl::OUString& aString ); + + // ------------------------------------------------------------------------ + + /** This helper function generates the hash code based on the algorithm + specified by MS for "Password to modify" feature of Word. + + @param aString + The string for which the hash should be calculated + + @return + The hash represented by sequence of bytes in BigEndian form + */ + + static ::com::sun::star::uno::Sequence< sal_Int8 > GetWordHashAsSequence( + const ::rtl::OUString& aString ); + + // ------------------------------------------------------------------------ + + /** This helper function generates the hash code based on the algorithm + specified by MS for "Password to modify" and passwords related to + table protection of Excel. + + @param aString + The string for which the hash should be calculated + + @param nEnc + The encoding that should be used to generate the 8-bit string + before the hash is generated + + @return + The hash represented by sal_uInt16 + */ + + static sal_uInt16 GetXLHashAsUINT16( + const ::rtl::OUString& aString, + rtl_TextEncoding nEnc = RTL_TEXTENCODING_UTF8 ); + + // ------------------------------------------------------------------------ + + /** This helper function generates the hash code based on the algorithm + specified by MS for "Password to modify" and passwords related to + table protection. + + @param aString + The string for which the hash should be calculated + + @param nEnc + The encoding that should be used to generate the 8-bit string + before the hash is generated + + @return + The hash represented by sequence of bytes in BigEndian form + */ + + static ::com::sun::star::uno::Sequence< sal_Int8 > GetXLHashAsSequence( + const ::rtl::OUString& aString, + rtl_TextEncoding nEnc = RTL_TEXTENCODING_UTF8 ); + + // ------------------------------------------------------------------------ + /** This helper function tries to request and verify a password to load a protected document. diff --git a/comphelper/inc/comphelper/docpasswordrequest.hxx b/comphelper/inc/comphelper/docpasswordrequest.hxx index 7b186b3a261a..cf04d22c7a6d 100644..100755 --- a/comphelper/inc/comphelper/docpasswordrequest.hxx +++ b/comphelper/inc/comphelper/docpasswordrequest.hxx @@ -32,6 +32,7 @@ #include <com/sun/star/task/PasswordRequestMode.hpp> #include <com/sun/star/task/XInteractionRequest.hpp> #include <cppuhelper/implbase1.hxx> +#include <cppuhelper/weak.hxx> namespace comphelper { @@ -52,19 +53,31 @@ class PasswordContinuation; /** Implements the task.XInteractionRequest interface for requesting a password string for a document. */ -class COMPHELPER_DLLPUBLIC DocPasswordRequest : public ::cppu::WeakImplHelper1< ::com::sun::star::task::XInteractionRequest > +class COMPHELPER_DLLPUBLIC DocPasswordRequest : + public ::com::sun::star::task::XInteractionRequest, + public ::cppu::OWeakObject { public: explicit DocPasswordRequest( DocPasswordRequestType eType, ::com::sun::star::task::PasswordRequestMode eMode, - const ::rtl::OUString& rDocumentName ); + const ::rtl::OUString& rDocumentName, + sal_Bool bPasswordToModify = sal_False ); virtual ~DocPasswordRequest(); - bool isAbort() const; - bool isPassword() const; + // XInterface / OWeakObject + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire( ) throw (); + virtual void SAL_CALL release( ) throw (); + + sal_Bool isAbort() const; + sal_Bool isPassword() const; + ::rtl::OUString getPassword() const; + ::rtl::OUString getPasswordToModify() const; + sal_Bool getRecommendReadOnly() const; + private: virtual ::com::sun::star::uno::Any SAL_CALL getRequest() throw( ::com::sun::star::uno::RuntimeException ); @@ -78,6 +91,8 @@ private: ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > maContinuations; AbortContinuation* mpAbort; PasswordContinuation* mpPassword; + + sal_Bool mbPasswordToModify; }; // ============================================================================ diff --git a/comphelper/inc/comphelper/mediadescriptor.hxx b/comphelper/inc/comphelper/mediadescriptor.hxx index e20440a3d30d..7d2333045390 100644 --- a/comphelper/inc/comphelper/mediadescriptor.hxx +++ b/comphelper/inc/comphelper/mediadescriptor.hxx @@ -127,6 +127,9 @@ class COMPHELPER_DLLPUBLIC MediaDescriptor : public SequenceAsHashMap //------------------------------------------- // interface public: + /** Value type of the 'ComponentData' property. + */ + typedef ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > ComponentDataSequence; //--------------------------------------- /** @short these ctors do nothing - excepting that they forward @@ -197,6 +200,54 @@ class COMPHELPER_DLLPUBLIC MediaDescriptor : public SequenceAsHashMap */ sal_Bool isStreamReadOnly() const; + //--------------------------------------- + /** Returns a value from the sequence contained in the property + 'ComponentData' of this media descriptor. + + @descr The property 'ComponentData' should be empty or should + contain a value of type ComponentDataSequence (see above). + + @return The value with the specified name, if existing in the + sequence of the 'ComponentData' property, otherwise an empty + Any. + */ + ::com::sun::star::uno::Any getComponentDataEntry( + const ::rtl::OUString& rName ) const; + + //--------------------------------------- + /** Inserts a value into the sequence contained in the property + 'ComponentData' of the media descriptor. + + @descr The property 'ComponentData' should be empty or should + contain a value of type ComponentDataSequence (see above). The + passed value will be inserted into the sequence, or, if already + existing, will be overwritten. + + @param rName The name of the value to be inserted into the + sequence of the 'ComponentData' property. + + @param rValue The value to be inserted into the sequence of the + 'ComponentData' property. + */ + void setComponentDataEntry( + const ::rtl::OUString& rName, + const ::com::sun::star::uno::Any& rValue ); + + //--------------------------------------- + /** Removes a value from the sequence contained in the property + 'ComponentData' of the media descriptor. + + @descr The property 'ComponentData' should be empty or should + contain a value of type ComponentDataSequence (see above). The + value with the passed name will be removed from the sequence, + if existing. + + @param rName The name of the value to be removed from the sequence + of the 'ComponentData' property. + */ + void clearComponentDataEntry( + const ::rtl::OUString& rName ); + //------------------------------------------- // helper private: diff --git a/comphelper/source/misc/comphelper_services.cxx b/comphelper/source/misc/comphelper_services.cxx index a2d4dd8fc0de..b46dcea68ba7 100644 --- a/comphelper/source/misc/comphelper_services.cxx +++ b/comphelper/source/misc/comphelper_services.cxx @@ -41,6 +41,7 @@ extern void createRegistryInfo_OfficeInstallationDirectories(); extern void createRegistryInfo_OInstanceLocker(); extern void createRegistryInfo_Map(); extern void createRegistryInfo_OSimpleLogRing(); +extern void createRegistryInfo_OOfficeRestartManager(); //........................................................................ namespace comphelper { namespace module @@ -66,6 +67,7 @@ namespace comphelper { namespace module createRegistryInfo_OInstanceLocker(); createRegistryInfo_Map(); createRegistryInfo_OSimpleLogRing(); + createRegistryInfo_OOfficeRestartManager(); } } } diff --git a/comphelper/source/misc/docpasswordhelper.cxx b/comphelper/source/misc/docpasswordhelper.cxx index ea25cb795a53..37941352ae28 100644 --- a/comphelper/source/misc/docpasswordhelper.cxx +++ b/comphelper/source/misc/docpasswordhelper.cxx @@ -1,4 +1,4 @@ -/************************************************************************* +/*********************************************************************** * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -32,7 +32,12 @@ #include <com/sun/star/task/XInteractionHandler.hpp> #include "comphelper/mediadescriptor.hxx" +#include <osl/time.h> +#include <rtl/digest.h> +#include <rtl/random.h> + using ::rtl::OUString; +using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Exception; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::UNO_SET_THROW; @@ -42,15 +47,241 @@ using ::com::sun::star::task::PasswordRequestMode_PASSWORD_REENTER; using ::com::sun::star::task::XInteractionHandler; using ::com::sun::star::task::XInteractionRequest; +using namespace ::com::sun::star; + namespace comphelper { // ============================================================================ +static uno::Sequence< sal_Int8 > GeneratePBKDF2Hash( const ::rtl::OUString& aPassword, const uno::Sequence< sal_Int8 >& aSalt, sal_Int32 nCount, sal_Int32 nHashLength ) +{ + uno::Sequence< sal_Int8 > aResult; + + if ( aPassword.getLength() && aSalt.getLength() && nCount && nHashLength ) + { + ::rtl::OString aBytePass = ::rtl::OUStringToOString( aPassword, RTL_TEXTENCODING_UTF8 ); + aResult.realloc( 16 ); + rtl_digest_PBKDF2( reinterpret_cast < sal_uInt8 * > ( aResult.getArray() ), + aResult.getLength(), + reinterpret_cast < const sal_uInt8 * > ( aBytePass.getStr() ), + aBytePass.getLength(), + reinterpret_cast < const sal_uInt8 * > ( aSalt.getConstArray() ), + aSalt.getLength(), + nCount ); + } + + return aResult; +} + +// ============================================================================ + IDocPasswordVerifier::~IDocPasswordVerifier() { } // ============================================================================ +uno::Sequence< beans::PropertyValue > DocPasswordHelper::GenerateNewModifyPasswordInfo( const ::rtl::OUString& aPassword ) +{ + uno::Sequence< beans::PropertyValue > aResult; + + uno::Sequence< sal_Int8 > aSalt( 16 ); + sal_Int32 nCount = 1024; + + TimeValue aTime; + osl_getSystemTime( &aTime ); + rtlRandomPool aRandomPool = rtl_random_createPool (); + rtl_random_addBytes ( aRandomPool, &aTime, 8 ); + + rtl_random_getBytes ( aRandomPool, aSalt.getArray(), 16 ); + + uno::Sequence< sal_Int8 > aNewHash = GeneratePBKDF2Hash( aPassword, aSalt, nCount, 16 ); + if ( aNewHash.getLength() ) + { + aResult.realloc( 4 ); + aResult[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "algorithm-name" ) ); + aResult[0].Value <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PBKDF2" ) ); + aResult[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "salt" ) ); + aResult[1].Value <<= aSalt; + aResult[2].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "iteration-count" ) ); + aResult[2].Value <<= nCount; + aResult[3].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "hash" ) ); + aResult[3].Value <<= aNewHash; + } + + // Clean up random pool memory + rtl_random_destroyPool ( aRandomPool ); + + return aResult; +} + +// ============================================================================ +sal_Bool DocPasswordHelper::IsModifyPasswordCorrect( const ::rtl::OUString& aPassword, const uno::Sequence< beans::PropertyValue >& aInfo ) +{ + sal_Bool bResult = sal_False; + if ( aPassword.getLength() && aInfo.getLength() ) + { + ::rtl::OUString sAlgorithm; + uno::Sequence< sal_Int8 > aSalt; + uno::Sequence< sal_Int8 > aHash; + sal_Int32 nCount = 0; + + for ( sal_Int32 nInd = 0; nInd < aInfo.getLength(); nInd++ ) + { + if ( aInfo[nInd].Name.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "algorithm-name" ) ) ) ) + aInfo[nInd].Value >>= sAlgorithm; + else if ( aInfo[nInd].Name.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "salt" ) ) ) ) + aInfo[nInd].Value >>= aSalt; + else if ( aInfo[nInd].Name.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "iteration-count" ) ) ) ) + aInfo[nInd].Value >>= nCount; + else if ( aInfo[nInd].Name.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "hash" ) ) ) ) + aInfo[nInd].Value >>= aHash; + } + + if ( sAlgorithm.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PBKDF2" ) ) ) + && aSalt.getLength() && nCount > 0 && aHash.getLength() ) + { + uno::Sequence< sal_Int8 > aNewHash = GeneratePBKDF2Hash( aPassword, aSalt, nCount, aHash.getLength() ); + for ( sal_Int32 nInd = 0; nInd < aNewHash.getLength() && nInd < aHash.getLength() && aNewHash[nInd] == aHash[nInd]; nInd ++ ) + { + if ( nInd == aNewHash.getLength() - 1 && nInd == aHash.getLength() - 1 ) + bResult = sal_True; + } + } + } + + return bResult; +} + +// ============================================================================ +sal_uInt32 DocPasswordHelper::GetWordHashAsUINT32( + const ::rtl::OUString& aUString ) +{ + static sal_uInt16 pInitialCode[] = { + 0xE1F0, // 1 + 0x1D0F, // 2 + 0xCC9C, // 3 + 0x84C0, // 4 + 0x110C, // 5 + 0x0E10, // 6 + 0xF1CE, // 7 + 0x313E, // 8 + 0x1872, // 9 + 0xE139, // 10 + 0xD40F, // 11 + 0x84F9, // 12 + 0x280C, // 13 + 0xA96A, // 14 + 0x4EC3 // 15 + }; + + static sal_uInt16 pEncryptionMatrix[15][7] = { + { 0xAEFC, 0x4DD9, 0x9BB2, 0x2745, 0x4E8A, 0x9D14, 0x2A09}, // last-14 + { 0x7B61, 0xF6C2, 0xFDA5, 0xEB6B, 0xC6F7, 0x9DCF, 0x2BBF}, // last-13 + { 0x4563, 0x8AC6, 0x05AD, 0x0B5A, 0x16B4, 0x2D68, 0x5AD0}, // last-12 + { 0x0375, 0x06EA, 0x0DD4, 0x1BA8, 0x3750, 0x6EA0, 0xDD40}, // last-11 + { 0xD849, 0xA0B3, 0x5147, 0xA28E, 0x553D, 0xAA7A, 0x44D5}, // last-10 + { 0x6F45, 0xDE8A, 0xAD35, 0x4A4B, 0x9496, 0x390D, 0x721A}, // last-9 + { 0xEB23, 0xC667, 0x9CEF, 0x29FF, 0x53FE, 0xA7FC, 0x5FD9}, // last-8 + { 0x47D3, 0x8FA6, 0x8FA6, 0x1EDA, 0x3DB4, 0x7B68, 0xF6D0}, // last-7 + { 0xB861, 0x60E3, 0xC1C6, 0x93AD, 0x377B, 0x6EF6, 0xDDEC}, // last-6 + { 0x45A0, 0x8B40, 0x06A1, 0x0D42, 0x1A84, 0x3508, 0x6A10}, // last-5 + { 0xAA51, 0x4483, 0x8906, 0x022D, 0x045A, 0x08B4, 0x1168}, // last-4 + { 0x76B4, 0xED68, 0xCAF1, 0x85C3, 0x1BA7, 0x374E, 0x6E9C}, // last-3 + { 0x3730, 0x6E60, 0xDCC0, 0xA9A1, 0x4363, 0x86C6, 0x1DAD}, // last-2 + { 0x3331, 0x6662, 0xCCC4, 0x89A9, 0x0373, 0x06E6, 0x0DCC}, // last-1 + { 0x1021, 0x2042, 0x4084, 0x8108, 0x1231, 0x2462, 0x48C4} // last + }; + + sal_uInt32 nResult = 0; + sal_uInt32 nLen = aUString.getLength(); + + if ( nLen ) + { + if ( nLen > 15 ) + nLen = 15; + + sal_uInt16 nHighResult = pInitialCode[nLen - 1]; + sal_uInt16 nLowResult = 0; + + const sal_Unicode* pStr = aUString.getStr(); + for ( sal_uInt32 nInd = 0; nInd < nLen; nInd++ ) + { + // NO Encoding during conversion! + // The specification says that the low byte should be used in case it is not NULL + char nHighChar = (char)( pStr[nInd] >> 8 ); + char nLowChar = (char)( pStr[nInd] & 0xFF ); + char nChar = nLowChar ? nLowChar : nHighChar; + + for ( int nMatrixInd = 0; nMatrixInd < 7; ++nMatrixInd ) + { + if ( ( nChar & ( 1 << nMatrixInd ) ) != 0 ) + nHighResult = nHighResult ^ pEncryptionMatrix[15 - nLen + nInd][nMatrixInd]; + } + + nLowResult = ( ( ( nLowResult >> 14 ) & 0x0001 ) | ( ( nLowResult << 1 ) & 0x7FFF ) ) ^ nChar; + } + + nLowResult = (sal_uInt16)( ( ( ( nLowResult >> 14 ) & 0x001 ) | ( ( nLowResult << 1 ) & 0x7FF ) ) ^ nLen ^ 0xCE4B ); + + nResult = ( nHighResult << 16 ) | nLowResult; + } + + return nResult; +} + +// ============================================================================ +Sequence< sal_Int8 > DocPasswordHelper::GetWordHashAsSequence( + const ::rtl::OUString& aUString ) +{ + sal_uInt32 nHash = GetWordHashAsUINT32( aUString ); + Sequence< sal_Int8 > aResult( 4 ); + aResult[0] = ( nHash >> 24 ); + aResult[1] = ( ( nHash >> 16 ) & 0xFF ); + aResult[2] = ( ( nHash >> 8 ) & 0xFF ); + aResult[3] = ( nHash & 0xFF ); + + return aResult; +} + +// ============================================================================ +sal_uInt16 DocPasswordHelper::GetXLHashAsUINT16( + const ::rtl::OUString& aUString, + rtl_TextEncoding nEnc ) +{ + sal_uInt16 nResult = 0; + + ::rtl::OString aString = ::rtl::OUStringToOString( aUString, nEnc ); + + if ( aString.getLength() && aString.getLength() <= SAL_MAX_UINT16 ) + { + for ( sal_Int32 nInd = aString.getLength() - 1; nInd >= 0; nInd-- ) + { + nResult = ( ( nResult >> 14 ) & 0x01 ) | ( ( nResult << 1 ) & 0x7FFF ); + nResult ^= aString.getStr()[nInd]; + } + + nResult = ( ( nResult >> 14 ) & 0x01 ) | ( ( nResult << 1 ) & 0x7FFF ); + nResult ^= ( 0x8000 | ( 'N' << 8 ) | 'K' ); + nResult ^= aString.getLength(); + } + + return nResult; +} + +// ============================================================================ +Sequence< sal_Int8 > DocPasswordHelper::GetXLHashAsSequence( + const ::rtl::OUString& aUString, + rtl_TextEncoding nEnc ) +{ + sal_uInt16 nHash = GetXLHashAsUINT16( aUString, nEnc ); + Sequence< sal_Int8 > aResult( 2 ); + aResult[0] = ( nHash >> 8 ); + aResult[1] = ( nHash & 0xFF ); + + return aResult; +} + +// ============================================================================ /*static*/ OUString DocPasswordHelper::requestAndVerifyDocPassword( IDocPasswordVerifier& rVerifier, diff --git a/comphelper/source/misc/docpasswordrequest.cxx b/comphelper/source/misc/docpasswordrequest.cxx index 9377d6c7c473..17cdb0ae2d92 100644 --- a/comphelper/source/misc/docpasswordrequest.cxx +++ b/comphelper/source/misc/docpasswordrequest.cxx @@ -29,24 +29,26 @@ #include "precompiled_comphelper.hxx" #include "comphelper/docpasswordrequest.hxx" -#include <com/sun/star/task/DocumentMSPasswordRequest.hpp> -#include <com/sun/star/task/DocumentPasswordRequest.hpp> +#include <com/sun/star/task/DocumentMSPasswordRequest2.hpp> +#include <com/sun/star/task/DocumentPasswordRequest2.hpp> #include <com/sun/star/task/XInteractionAbort.hpp> -#include <com/sun/star/task/XInteractionPassword.hpp> +#include <com/sun/star/task/XInteractionPassword2.hpp> using ::rtl::OUString; using ::com::sun::star::uno::Any; +using ::com::sun::star::uno::Type; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::RuntimeException; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::XInterface; using ::com::sun::star::task::InteractionClassification_QUERY; -using ::com::sun::star::task::DocumentMSPasswordRequest; -using ::com::sun::star::task::DocumentPasswordRequest; +using ::com::sun::star::task::DocumentMSPasswordRequest2; +using ::com::sun::star::task::DocumentPasswordRequest2; using ::com::sun::star::task::PasswordRequestMode; using ::com::sun::star::task::XInteractionAbort; using ::com::sun::star::task::XInteractionContinuation; -using ::com::sun::star::task::XInteractionPassword; +using ::com::sun::star::task::XInteractionPassword2; +using ::com::sun::star::task::XInteractionRequest; namespace comphelper { @@ -57,52 +59,64 @@ class AbortContinuation : public ::cppu::WeakImplHelper1< XInteractionAbort > public: inline explicit AbortContinuation() : mbSelected( false ) {} - inline bool isSelected() const { return mbSelected; } + inline sal_Bool isSelected() const { return mbSelected; } inline void reset() { mbSelected = false; } virtual void SAL_CALL select() throw( RuntimeException ) { mbSelected = true; } private: - bool mbSelected; + sal_Bool mbSelected; }; // ============================================================================ -class PasswordContinuation : public ::cppu::WeakImplHelper1< XInteractionPassword > +class PasswordContinuation : public ::cppu::WeakImplHelper1< XInteractionPassword2 > { public: - inline explicit PasswordContinuation() : mbSelected( false ) {} + inline explicit PasswordContinuation() : mbReadOnly( sal_False ), mbSelected( sal_False ) {} - inline bool isSelected() const { return mbSelected; } - inline void reset() { mbSelected = false; } + inline sal_Bool isSelected() const { return mbSelected; } + inline void reset() { mbSelected = sal_False; } + + virtual void SAL_CALL select() throw( RuntimeException ) { mbSelected = sal_True; } - virtual void SAL_CALL select() throw( RuntimeException ) { mbSelected = true; } virtual void SAL_CALL setPassword( const OUString& rPass ) throw( RuntimeException ) { maPassword = rPass; } virtual OUString SAL_CALL getPassword() throw( RuntimeException ) { return maPassword; } + virtual void SAL_CALL setPasswordToModify( const OUString& rPass ) throw( RuntimeException ) { maModifyPassword = rPass; } + virtual OUString SAL_CALL getPasswordToModify() throw( RuntimeException ) { return maModifyPassword; } + + virtual void SAL_CALL setRecommendReadOnly( sal_Bool bReadOnly ) throw( RuntimeException ) { mbReadOnly = bReadOnly; } + virtual sal_Bool SAL_CALL getRecommendReadOnly() throw( RuntimeException ) { return mbReadOnly; } + private: OUString maPassword; - bool mbSelected; + OUString maModifyPassword; + sal_Bool mbReadOnly; + sal_Bool mbSelected; }; // ============================================================================ DocPasswordRequest::DocPasswordRequest( DocPasswordRequestType eType, - PasswordRequestMode eMode, const OUString& rDocumentName ) + PasswordRequestMode eMode, const OUString& rDocumentName, sal_Bool bPasswordToModify ) +: mpAbort( NULL ) +, mpPassword( NULL ) +, mbPasswordToModify( bPasswordToModify ) { switch( eType ) { case DocPasswordRequestType_STANDARD: { - DocumentPasswordRequest aRequest( OUString(), Reference< XInterface >(), - InteractionClassification_QUERY, eMode, rDocumentName ); + DocumentPasswordRequest2 aRequest( OUString(), Reference< XInterface >(), + InteractionClassification_QUERY, eMode, rDocumentName, bPasswordToModify ); maRequest <<= aRequest; } break; case DocPasswordRequestType_MS: { - DocumentMSPasswordRequest aRequest( OUString(), Reference< XInterface >(), - InteractionClassification_QUERY, eMode, rDocumentName ); + DocumentMSPasswordRequest2 aRequest( OUString(), Reference< XInterface >(), + InteractionClassification_QUERY, eMode, rDocumentName, bPasswordToModify ); maRequest <<= aRequest; } break; @@ -119,12 +133,32 @@ DocPasswordRequest::~DocPasswordRequest() { } -bool DocPasswordRequest::isAbort() const +/*uno::*/Any SAL_CALL DocPasswordRequest::queryInterface( const /*uno::*/Type& rType ) throw (RuntimeException) +{ + return ::cppu::queryInterface ( rType, + // OWeakObject interfaces + dynamic_cast< XInterface* > ( (XInteractionRequest *) this ), + static_cast< XWeak* > ( this ), + // my own interfaces + static_cast< XInteractionRequest* > ( this ) ); +} + +void SAL_CALL DocPasswordRequest::acquire( ) throw () +{ + OWeakObject::acquire(); +} + +void SAL_CALL DocPasswordRequest::release( ) throw () +{ + OWeakObject::release(); +} + +sal_Bool DocPasswordRequest::isAbort() const { return mpAbort->isSelected(); } -bool DocPasswordRequest::isPassword() const +sal_Bool DocPasswordRequest::isPassword() const { return mpPassword->isSelected(); } @@ -134,6 +168,16 @@ OUString DocPasswordRequest::getPassword() const return mpPassword->getPassword(); } +OUString DocPasswordRequest::getPasswordToModify() const +{ + return mpPassword->getPasswordToModify(); +} + +sal_Bool DocPasswordRequest::getRecommendReadOnly() const +{ + return mpPassword->getRecommendReadOnly(); +} + Any SAL_CALL DocPasswordRequest::getRequest() throw( RuntimeException ) { return maRequest; diff --git a/comphelper/source/misc/makefile.mk b/comphelper/source/misc/makefile.mk index 5ad7e3ed289e..cecba554b332 100644 --- a/comphelper/source/misc/makefile.mk +++ b/comphelper/source/misc/makefile.mk @@ -72,6 +72,7 @@ SLOFILES= \ $(SLO)$/numberedcollection.obj \ $(SLO)$/numbers.obj \ $(SLO)$/officeresourcebundle.obj \ + $(SLO)$/officerestartmanager.obj \ $(SLO)$/proxyaggregation.obj \ $(SLO)$/querydeep.obj \ $(SLO)$/regpathhelper.obj \ diff --git a/comphelper/source/misc/mediadescriptor.cxx b/comphelper/source/misc/mediadescriptor.cxx index 1bc40a454d43..9e02afe8c56c 100644 --- a/comphelper/source/misc/mediadescriptor.cxx +++ b/comphelper/source/misc/mediadescriptor.cxx @@ -30,47 +30,21 @@ #include <comphelper/mediadescriptor.hxx> #include <comphelper/stillreadwriteinteraction.hxx> -//_______________________________________________ -// includes - -#ifndef __COM_SUN_STAR_UCB_XCONTENT_HPP__ #include <com/sun/star/ucb/XContent.hpp> -#endif - -#ifndef __COM_SUN_STAR_UCB_XCOMMANDENVIRONMENT_HPP__ #include <com/sun/star/ucb/XCommandEnvironment.hpp> -#endif - -#ifndef __COM_SUN_STAR_TASK_XINTERACTIONHANDLER_HPP__ #include <com/sun/star/task/XInteractionHandler.hpp> -#endif - -#ifndef __COM_SUN_STAR_IO_XSTREAM_HPP__ #include <com/sun/star/io/XStream.hpp> -#endif #include <com/sun/star/io/XActiveDataSink.hpp> #include <com/sun/star/io/XSeekable.hpp> - -#ifndef __COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP__ #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#endif #include <com/sun/star/lang/IllegalArgumentException.hpp> - -#ifndef __COM_SUN_STAR_UTIL_XURLTRANSFORMER_HPP__ #include <com/sun/star/util/XURLTransformer.hpp> -#endif - -#ifndef __COM_SUN_STAR_UCB_COMMANDFAILEDEXCEPTION_HPP__ +#include <com/sun/star/ucb/InteractiveIOException.hpp> +#include <com/sun/star/ucb/UnsupportedDataSinkException.hpp> #include <com/sun/star/ucb/CommandFailedException.hpp> -#endif - -#ifndef __COM_SUN_STAR_URI_XURIREFERENCEFACTORY_HPP__ +#include <com/sun/star/task/XInteractionAbort.hpp> #include <com/sun/star/uri/XUriReferenceFactory.hpp> -#endif - -#ifndef __COM_SUN_STAR_URI_XURIREFERENCE_HPP__ #include <com/sun/star/uri/XUriReference.hpp> -#endif #include <com/sun/star/ucb/PostCommandArgument2.hpp> #include <com/sun/star/container/XNameAccess.hpp> @@ -81,11 +55,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/configurationhelper.hxx> -#if OSL_DEBUG_LEVEL>0 - #ifndef _RTL_USTRBUF_HXX_ - #include <rtl/ustrbuf.hxx> - #endif -#endif +#include <rtl/ustrbuf.hxx> //_______________________________________________ // namespace @@ -503,6 +473,61 @@ sal_Bool MediaDescriptor::isStreamReadOnly() const return bReadOnly; } +// ---------------------------------------------------------------------------- + +css::uno::Any MediaDescriptor::getComponentDataEntry( const ::rtl::OUString& rName ) const +{ + SequenceAsHashMap aCompDataMap( getUnpackedValueOrDefault( PROP_COMPONENTDATA(), ComponentDataSequence() ) ); + SequenceAsHashMap::iterator aIt = aCompDataMap.find( rName ); + return (aIt == aCompDataMap.end()) ? css::uno::Any() : aIt->second; +} + +void MediaDescriptor::setComponentDataEntry( const ::rtl::OUString& rName, const css::uno::Any& rValue ) +{ + if( rValue.hasValue() ) + { + // get or craete the 'ComponentData' property entry + css::uno::Any& rCompDataAny = operator[]( PROP_COMPONENTDATA() ); + // check type, insert the value + OSL_ENSURE( !rCompDataAny.hasValue() || rCompDataAny.has< ComponentDataSequence >(), + "MediaDescriptor::setComponentDataEntry - incompatible 'ComponentData' property in media descriptor" ); + if( !rCompDataAny.hasValue() || rCompDataAny.has< ComponentDataSequence >() ) + { + // insert or overwrite the passed value + SequenceAsHashMap aCompDataMap( rCompDataAny ); + aCompDataMap[ rName ] = rValue; + // write back the sequence (sal_False = use NamedValue instead of PropertyValue) + rCompDataAny = aCompDataMap.getAsConstAny( sal_False ); + } + } + else + { + // if an empty Any is passed, clear the entry + clearComponentDataEntry( rName ); + } +} + +void MediaDescriptor::clearComponentDataEntry( const ::rtl::OUString& rName ) +{ + SequenceAsHashMap::iterator aPropertyIter = find( PROP_COMPONENTDATA() ); + if( aPropertyIter != end() ) + { + OSL_ENSURE( aPropertyIter->second.has< ComponentDataSequence >(), + "MediaDescriptor::clearComponentDataEntry - incompatible 'ComponentData' property in media descriptor" ); + if( aPropertyIter->second.has< ComponentDataSequence >() ) + { + // remove the value with the passed name + SequenceAsHashMap aCompDataMap( aPropertyIter->second ); + aCompDataMap.erase( rName ); + // write back the sequence, or remove it completely if it is empty + if( aCompDataMap.empty() ) + erase( aPropertyIter ); + else + aPropertyIter->second = aCompDataMap.getAsConstAny( sal_False ); + } + } +} + /*----------------------------------------------- 10.03.2004 09:02 -----------------------------------------------*/ diff --git a/comphelper/source/misc/officerestartmanager.cxx b/comphelper/source/misc/officerestartmanager.cxx new file mode 100644 index 000000000000..974b8d65e7ae --- /dev/null +++ b/comphelper/source/misc/officerestartmanager.cxx @@ -0,0 +1,210 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_comphelper.hxx" + +#include <com/sun/star/lang/XMultiComponentFactory.hpp> +#include <com/sun/star/awt/XRequestCallback.hpp> +#include <com/sun/star/frame/XDesktop.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> + +#include <comphelper_module.hxx> +#include "officerestartmanager.hxx" + +using namespace ::com::sun::star; + +namespace comphelper +{ + +// ---------------------------------------------------------- +uno::Sequence< ::rtl::OUString > SAL_CALL OOfficeRestartManager::getSupportedServiceNames_static() +{ + uno::Sequence< rtl::OUString > aResult( 1 ); + aResult[0] = getServiceName_static(); + return aResult; +} + +// ---------------------------------------------------------- +::rtl::OUString SAL_CALL OOfficeRestartManager::getImplementationName_static() +{ + return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.task.OfficeRestartManager" ) ); +} + +// ---------------------------------------------------------- +::rtl::OUString SAL_CALL OOfficeRestartManager::getSingletonName_static() +{ + return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.OfficeRestartManager" ) ); +} + +// ---------------------------------------------------------- +::rtl::OUString SAL_CALL OOfficeRestartManager::getServiceName_static() +{ + return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.task.OfficeRestartManager" ) ); +} + +// ---------------------------------------------------------- +uno::Reference< uno::XInterface > SAL_CALL OOfficeRestartManager::Create( const uno::Reference< uno::XComponentContext >& rxContext ) +{ + return static_cast< cppu::OWeakObject* >( new OOfficeRestartManager( rxContext ) ); +} + +// XRestartManager +// ---------------------------------------------------------- +void SAL_CALL OOfficeRestartManager::requestRestart( const uno::Reference< task::XInteractionHandler >& /* xInteractionHandler */ ) + throw (uno::Exception, uno::RuntimeException) +{ + if ( !m_xContext.is() ) + throw uno::RuntimeException(); + + { + ::osl::MutexGuard aGuard( m_aMutex ); + + // if the restart already running there is no need to trigger it again + if ( m_bRestartRequested ) + return; +#ifndef MACOSX + m_bRestartRequested = sal_True; +#endif + // the office is still not initialized, no need to terminate, changing the state is enough + if ( !m_bOfficeInitialized ) + return; + } + + // TODO: use InteractionHandler to report errors + try + { + // register itself as a job that should be executed asynchronously + uno::Reference< lang::XMultiComponentFactory > xFactory( m_xContext->getServiceManager(), uno::UNO_SET_THROW ); + + uno::Reference< awt::XRequestCallback > xRequestCallback( + xFactory->createInstanceWithContext( + ::rtl::OUString::createFromAscii("com.sun.star.awt.AsyncCallback"), + m_xContext ), + uno::UNO_QUERY_THROW ); + + xRequestCallback->addCallback( this, uno::Any() ); + } + catch ( uno::Exception& ) + { + // the try to request restart has failed + m_bRestartRequested = sal_False; + } +} + +// ---------------------------------------------------------- +::sal_Bool SAL_CALL OOfficeRestartManager::isRestartRequested( ::sal_Bool bOfficeInitialized ) + throw (uno::Exception, uno::RuntimeException) +{ + ::osl::MutexGuard aGuard( m_aMutex ); + + if ( bOfficeInitialized && !m_bOfficeInitialized ) + m_bOfficeInitialized = bOfficeInitialized; + + return m_bRestartRequested; +} + +// XCallback +// ---------------------------------------------------------- +void SAL_CALL OOfficeRestartManager::notify( const uno::Any& /* aData */ ) + throw ( uno::RuntimeException ) +{ + try + { + sal_Bool bSuccess = sal_False; + + if ( m_xContext.is() ) + { + uno::Reference< lang::XMultiComponentFactory > xFactory( m_xContext->getServiceManager(), uno::UNO_SET_THROW ); + uno::Reference< frame::XDesktop > xDesktop( + xFactory->createInstanceWithContext( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ) ), m_xContext ), + uno::UNO_QUERY_THROW ); + + // Turn Quickstarter veto off + uno::Reference< beans::XPropertySet > xPropertySet( xDesktop, uno::UNO_QUERY_THROW ); + ::rtl::OUString aVetoPropName( RTL_CONSTASCII_USTRINGPARAM( "SuspendQuickstartVeto" ) ); + uno::Any aValue; + aValue <<= (sal_Bool)sal_True; + xPropertySet->setPropertyValue( aVetoPropName, aValue ); + + try + { + bSuccess = xDesktop->terminate(); + } catch( uno::Exception& ) + {} + + if ( !bSuccess ) + { + aValue <<= (sal_Bool)sal_False; + xPropertySet->setPropertyValue( aVetoPropName, aValue ); + } + } + + if ( !bSuccess ) + m_bRestartRequested = sal_False; + } + catch( uno::Exception& ) + { + // the try to restart has failed + m_bRestartRequested = sal_False; + } +} + +// XServiceInfo +// ---------------------------------------------------------- +::rtl::OUString SAL_CALL OOfficeRestartManager::getImplementationName() throw (uno::RuntimeException) +{ + return getImplementationName_static(); +} + +// ---------------------------------------------------------- +::sal_Bool SAL_CALL OOfficeRestartManager::supportsService( const ::rtl::OUString& aServiceName ) throw (uno::RuntimeException) +{ + const uno::Sequence< rtl::OUString > & aSupportedNames = getSupportedServiceNames_static(); + for ( sal_Int32 nInd = 0; nInd < aSupportedNames.getLength(); nInd++ ) + { + if ( aSupportedNames[ nInd ].equals( aServiceName ) ) + return sal_True; + } + + return sal_False; +} + +// ---------------------------------------------------------- +uno::Sequence< ::rtl::OUString > SAL_CALL OOfficeRestartManager::getSupportedServiceNames() throw (uno::RuntimeException) +{ + return getSupportedServiceNames_static(); +} + +} // namespace comphelper + +void createRegistryInfo_OOfficeRestartManager() +{ + static ::comphelper::module::OAutoRegistration< ::comphelper::OOfficeRestartManager > aAutoRegistration; + static ::comphelper::module::OSingletonRegistration< ::comphelper::OOfficeRestartManager > aSingletonRegistration; +} diff --git a/comphelper/source/misc/officerestartmanager.hxx b/comphelper/source/misc/officerestartmanager.hxx new file mode 100644 index 000000000000..2317d0217060 --- /dev/null +++ b/comphelper/source/misc/officerestartmanager.hxx @@ -0,0 +1,91 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __OFFICESTARTMANAGER_HXX_ +#define __OFFICESTARTMANAGER_HXX_ + +#include <com/sun/star/task/XRestartManager.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/awt/XCallback.hpp> + +#include <osl/mutex.hxx> +#include <cppuhelper/implbase3.hxx> + +namespace comphelper +{ + +class OOfficeRestartManager : public ::cppu::WeakImplHelper3< ::com::sun::star::task::XRestartManager + , ::com::sun::star::awt::XCallback + , ::com::sun::star::lang::XServiceInfo > +{ + ::osl::Mutex m_aMutex; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; + + sal_Bool m_bOfficeInitialized; + sal_Bool m_bRestartRequested; + +public: + OOfficeRestartManager( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ) + : m_xContext( xContext ) + , m_bOfficeInitialized( sal_False ) + , m_bRestartRequested( sal_False ) + {} + + virtual ~OOfficeRestartManager() + {} + + static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames_static(); + + static ::rtl::OUString SAL_CALL getImplementationName_static(); + + static ::rtl::OUString SAL_CALL getSingletonName_static(); + + static ::rtl::OUString SAL_CALL getServiceName_static(); + + static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL + Create( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); + +// XRestartManager + virtual void SAL_CALL requestRestart( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xInteractionHandler ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL isRestartRequested( ::sal_Bool bInitialized ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); + +// XCallback + virtual void SAL_CALL notify( const ::com::sun::star::uno::Any& aData ) throw (::com::sun::star::uno::RuntimeException); + +// XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); + +}; + +} // namespace comphelper + +#endif + diff --git a/i18npool/inc/i18npool/lang.h b/i18npool/inc/i18npool/lang.h index 8599ec75c634..52e4e51d7a41 100644 --- a/i18npool/inc/i18npool/lang.h +++ b/i18npool/inc/i18npool/lang.h @@ -512,5 +512,9 @@ typedef unsigned short LanguageType; #define LANGUAGE_USER_SARDINIAN_LOGUDORESE 0x0652 #define LANGUAGE_USER_SARDINIAN_SASSARESE 0x0653 #define LANGUAGE_USER_BAFIA 0x0654 +#define LANGUAGE_USER_GIKUYU 0x0655 +#define LANGUAGE_USER_RUSYN_UKRAINE 0x0656 +#define LANGUAGE_USER_RUSYN_SLOVAKIA 0x8256 /* makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_USER_RUSYN_UKRAINE)) */ + #endif /* INCLUDED_I18NPOOL_LANG_H */ diff --git a/i18npool/source/breakiterator/data/char_in.txt b/i18npool/source/breakiterator/data/char_in.txt index 72c4a44720cd..5e1ed67596c0 100644 --- a/i18npool/source/breakiterator/data/char_in.txt +++ b/i18npool/source/breakiterator/data/char_in.txt @@ -1,48 +1,108 @@ # -# Copyright (C) 2002-2003, International Business Machines Corporation and others. +# Copyright (C) 2002-2009, International Business Machines Corporation and others. # All Rights Reserved. # # file: char.txt # # ICU Character Break Rules, also known as Grapheme Cluster Boundaries # See Unicode Standard Annex #29. -# These rules are based on TR29 Version 4.0.0 +# These rules are based on TR29 Revision 13, for Unicode Version 5.1 # # # Character Class Definitions. -# The names are those from TR29. # -$CR = \r; -$LF = \n; -$Control = [[:Zl:] [:Zp:] [:Cc:] [:Cf:]]; - -# add Japanese Half Width voicing marks to $Extend -$VoiceMarks = [\uff9e\uff9f]; -$cmcextend = [ \u0903 \u093e-\u0940 \u0949-\u094C \u09bf-\u09c0 \u09c7-\u09c8 \u09cb-\u09cc \u0bc1-\u0bc2 \u0bc6-\u0bc8 \u0bca-\u0bcc \u0c01-\u0c03 \u0c41-\u0c44]; -$Extend = [[:Grapheme_Extend = TRUE:] $VoiceMarks $cmcextend]; +$CR = [\p{Grapheme_Cluster_Break = CR}]; +$LF = [\p{Grapheme_Cluster_Break = LF}]; +$Control = [\p{Grapheme_Cluster_Break = Control}]; +$Prepend = [\p{Grapheme_Cluster_Break = Prepend}]; +$Extend = [\p{Grapheme_Cluster_Break = Extend}]; +$SpacingMark = [\p{Grapheme_Cluster_Break = SpacingMark}]; +$BengaliLetter = [\u0985-\u09B9 \u09CE \u09DC-\u09E1 \u09F0-\u09F1]; +$BengaliSignVirama = \u09CD; +$GujaratiLetter = [\u0A85-\u0A8C \u0A8F-\u0A90 \u0A93-\u0AB9 \u0AE0-\u0AE1]; +$GujaratiSignVirama = \u0ACD; +$DevanagariLetter = [\u0904-\u0939 \u0958-\u0961 \u0972-\u097F]; +$DevanagariSignVirama = \u094D; +$KannadaLetter = [\u0C85-\u0CB9 \u0CDE-\u0CE1]; +$KannadaSignVirama = \u0CCD; +$MalayalamLetter = [\u0D05-\u0D39 \u0D60-\u0D61 \u0D7A-\u0D7F]; +$MalayalamSignVirama = \u0D4D; +$OriyaLetter = [\u0B05-\u0B39 \u0B5C-\u0B61 \u0B71]; +$OriyaSignVirama = \u0B4D; +$GurmukhiLetter = [\u0A05-\u0A39 \u0A59-\u0A5E]; +$GurmukhiSignVirama = \u0A4D; +$TamilLetter = [\u0B85-\u0BB9]; +$TamilSignVirama = \u0BCD; +$TeluguLetter = [\u0C05-\u0C39 \u0C58-\u0C61]; +$TeluguSignVirama = \u0C4D; # # Korean Syllable Definitions # -$L = [:Hangul_Syllable_Type = L:]; -$V = [:Hangul_Syllable_Type = V:]; -$T = [:Hangul_Syllable_Type = T:]; +$L = [\p{Grapheme_Cluster_Break = L}]; +$V = [\p{Grapheme_Cluster_Break = V}]; +$T = [\p{Grapheme_Cluster_Break = T}]; -$LV = [:Hangul_Syllable_Type = LV:]; -$LVT = [:Hangul_Syllable_Type = LVT:]; +$LV = [\p{Grapheme_Cluster_Break = LV}]; +$LVT = [\p{Grapheme_Cluster_Break = LVT}]; -$HangulSyllable = $L+ | ($L* ($LV? $V+ | $LV | $LVT) $T*) | $T+; -# -# Forward Break Rules -# +## ------------------------------------------------- +!!chain; + +!!forward; + $CR $LF; -([^$Control] | $HangulSyllable) $Extend*; -.; +$BengaliLetter ($BengaliSignVirama $BengaliLetter?)+; +$GujaratiLetter ($GujaratiSignVirama $GujaratiLetter?)+; +$DevanagariLetter ($DevanagariSignVirama $DevanagariLetter?)+; +$KannadaLetter ($KannadaSignVirama $KannadaLetter?)+; +$MalayalamLetter ($MalayalamSignVirama $MalayalamLetter?)+; +$OriyaLetter ($OriyaSignVirama $OriyaLetter?)+; +$GurmukhiLetter ($GurmukhiSignVirama $GurmukhiLetter?)+; +$TamilLetter ($TamilSignVirama $TamilLetter?)+; +$TeluguLetter ($TeluguSignVirama $TeluguLetter?)+; + +$L ($L | $V | $LV | $LVT); +($LV | $V) ($V | $T); +($LVT | $T) $T; + +[^$Control $CR $LF] $Extend; + +[^$Control $CR $LF] $SpacingMark; +$Prepend [^$Control $CR $LF]; + + +## ------------------------------------------------- + +!!reverse; +$LF $CR; +($BengaliLetter? $BengaliSignVirama)+ $BengaliLetter; +($GujaratiLetter? $GujaratiSignVirama)+ $GujaratiLetter; +($DevanagariLetter? $DevanagariSignVirama)+ $DevanagariLetter; +($KannadaLetter? $KannadaSignVirama)+ $KannadaLetter; +($MalayalamLetter? $MalayalamSignVirama)+ $MalayalamLetter; +($OriyaLetter? $OriyaSignVirama)+ $OriyaLetter; +($GurmukhiLetter? $GurmukhiSignVirama)+ $GurmukhiLetter; +($TamilLetter? $TamilSignVirama)+ $TamilLetter; +($TeluguLetter? $TeluguSignVirama)+ $TeluguLetter; +($L | $V | $LV | $LVT) $L; +($V | $T) ($LV | $V); +$T ($LVT | $T); + +$Extend [^$Control $CR $LF]; +$SpacingMark [^$Control $CR $LF]; +[^$Control $CR $LF] $Prepend; + + +## ------------------------------------------------- + +!!safe_reverse; + + +## ------------------------------------------------- + +!!safe_forward; -# -# Reverse Rule, back up to the beginning of some preceding grapheme cluster. -# -! ($Extend | $V | $T )* ($LF $CR | ($LV | $LVT)?$L* | .); diff --git a/i18npool/source/isolang/isolang.cxx b/i18npool/source/isolang/isolang.cxx index 9d80bf7050e6..357be80a69ea 100644 --- a/i18npool/source/isolang/isolang.cxx +++ b/i18npool/source/isolang/isolang.cxx @@ -287,8 +287,9 @@ static MsLangId::IsoLangEntry const aImplIsoLangEntries[] = { LANGUAGE_BELARUSIAN, "be", "BY" }, { LANGUAGE_CATALAN, "ca", "ES" }, // Spain (default) { LANGUAGE_CATALAN, "ca", "AD" }, // Andorra - { LANGUAGE_USER_CATALAN_VALENCIAN, "ca", "XV" }, // XV: ISO 3166 user-assigned; old workaround for UI localization only, do not use in document content! Kept just in case.. - { LANGUAGE_USER_CATALAN_VALENCIAN, "qcv", "ES" }, // qcv: ISO 639-3 reserved-for-local-use; for UI localization, use in document content on own risk! + { LANGUAGE_USER_CATALAN_VALENCIAN, "ca", "XV" }, // XV: ISO 3166 user-assigned; workaround for UI localization only, do not use in document content! + { LANGUAGE_CATALAN, "qcv", "ES" }, // qcv: ISO 639-3 reserved-for-local-use; UI localization quirk only, do not use in document content! +// { LANGUAGE_USER_CATALAN_VALENCIAN, "ca", "ES" }, // In case MS format files escaped into the wild, map them back. { LANGUAGE_FRENCH_CAMEROON, "fr", "CM" }, { LANGUAGE_FRENCH_COTE_D_IVOIRE, "fr", "CI" }, { LANGUAGE_FRENCH_HAITI, "fr", "HT" }, @@ -457,6 +458,9 @@ static MsLangId::IsoLangEntry const aImplIsoLangEntries[] = { LANGUAGE_USER_TAHITIAN, "ty", "PF" }, { LANGUAGE_USER_MALAGASY_PLATEAU, "plt", "MG" }, { LANGUAGE_USER_BAFIA, "ksf", "CM" }, + { LANGUAGE_USER_GIKUYU, "ki", "KE" }, + { LANGUAGE_USER_RUSYN_UKRAINE, "rue", "UA" }, + { LANGUAGE_USER_RUSYN_SLOVAKIA, "rue", "SK" }, { LANGUAGE_NONE, "zxx", "" }, // added to ISO 639-2 on 2006-01-11: Used to declare the absence of linguistic information { LANGUAGE_DONTKNOW, "", "" } // marks end of table }; @@ -1005,6 +1009,28 @@ LanguageType MsLangId::convertIsoByteStringToLanguage( } // ----------------------------------------------------------------------- + +struct IsoLangGLIBCModifiersEntry +{ + LanguageType mnLang; + sal_Char maLangStr[4]; + sal_Char maCountry[3]; + sal_Char maAtString[9]; +}; + +static IsoLangGLIBCModifiersEntry const aImplIsoLangGLIBCModifiersEntries[] = +{ + // MS-LANGID codes ISO639-1/2/3 ISO3166 glibc modifier + { LANGUAGE_BOSNIAN_CYRILLIC_BOSNIA_HERZEGOVINA, "bs", "BA", "cyrillic" }, + { LANGUAGE_USER_SERBIAN_LATIN_SERBIA, "sr", "RS", "latin" }, // Serbian Latin in Serbia + { LANGUAGE_SERBIAN_LATIN, "sr", "CS", "latin" }, // Serbian Latin in Serbia and Montenegro + { LANGUAGE_USER_SERBIAN_LATIN_MONTENEGRO, "sr", "ME", "latin" }, // Serbian Latin in Montenegro + { LANGUAGE_SERBIAN_LATIN_NEUTRAL, "sr", "", "latin" }, + { LANGUAGE_AZERI_CYRILLIC, "az", "AZ", "cyrillic" }, + { LANGUAGE_UZBEK_CYRILLIC, "uz", "UZ", "cyrillic" }, + { LANGUAGE_DONTKNOW, "", "", "" } // marks end of table +}; + // convert a unix locale string into LanguageType // static @@ -1013,15 +1039,20 @@ LanguageType MsLangId::convertUnxByteStringToLanguage( { rtl::OString aLang; rtl::OString aCountry; + rtl::OString aAtString; sal_Int32 nLangSepPos = rString.indexOf( (sal_Char)'_' ); sal_Int32 nCountrySepPos = rString.indexOf( (sal_Char)'.' ); + sal_Int32 nAtPos = rString.indexOf( (sal_Char)'@' ); if (nCountrySepPos < 0) - nCountrySepPos = rString.indexOf( (sal_Char)'@' ); + nCountrySepPos = nAtPos; if (nCountrySepPos < 0) nCountrySepPos = rString.getLength(); + if (nAtPos >= 0) + aAtString = rString.copy( nAtPos+1 ); + if ( ((nLangSepPos >= 0) && (nLangSepPos > nCountrySepPos)) || ((nLangSepPos < 0)) ) { @@ -1035,6 +1066,30 @@ LanguageType MsLangId::convertUnxByteStringToLanguage( aCountry = rString.copy( nLangSepPos+1, nCountrySepPos - nLangSepPos - 1); } + // if there is a glibc modifier, first look for exact match in modifier table + if (aAtString.getLength()) + { + // language is lower case in table + rtl::OString aLowerLang = aLang.toAsciiLowerCase(); + // country is upper case in table + rtl::OString aUpperCountry = aCountry.toAsciiUpperCase(); + const IsoLangGLIBCModifiersEntry* pGLIBCModifiersEntry = aImplIsoLangGLIBCModifiersEntries; + do + { + if (( aLowerLang.equals( pGLIBCModifiersEntry->maLangStr ) ) && + ( aAtString.equals( pGLIBCModifiersEntry->maAtString ) )) + { + if ( !aUpperCountry.getLength() || + aUpperCountry.equals( pGLIBCModifiersEntry->maCountry ) ) + { + return pGLIBCModifiersEntry->mnLang; + } + } + ++pGLIBCModifiersEntry; + } + while ( pGLIBCModifiersEntry->mnLang != LANGUAGE_DONTKNOW ); + } + return convertIsoNamesToLanguage( aLang, aCountry ); } diff --git a/i18npool/source/isolang/langid.pl b/i18npool/source/isolang/langid.pl index 06883279345b..8035178b7bb5 100755 --- a/i18npool/source/isolang/langid.pl +++ b/i18npool/source/isolang/langid.pl @@ -39,7 +39,8 @@ sub Usage() "\n", "langid - a hackish utility to lookup lang.h language defines and LangIDs,\n", "isolang.cxx ISO639/ISO3166 mapping, locale data files, langtab.src language\n", - "listbox entries, postset.mk and file_ooo.scp registry name.\n\n", + "listbox entries, postset.mk, file_ooo.scp registry name, globals.pm and\n", + "msi-encodinglist.txt\n\n", "Usage: $0 [--single] {language string} | {LangID} | {primarylanguage sublanguage} | {language-country}\n\n", @@ -105,7 +106,8 @@ sub grepFile($$$$@) my( $regex, $path, $module, $name, @addregex) = @_; my @result; my $found = 0; - my $arefound = ''; + my $areopen = 0; + my $arecloser = ''; my $file; # Try module under current working directory first to catch local # modifications. A Not yet delivered lang.h is a special case. @@ -145,17 +147,22 @@ sub grepFile($$$$@) print "$line\n"; push( @result, $line); } - else + elsif (@addregex) { - for my $re (@addregex) + # By convention first element is opener, second element is closer. + if (!$areopen) { - if ($re ne $arefound && $line =~ /$re/) + if ($line =~ /$addregex[0]/) { - if ($arefound eq '') - { - $arefound = $re; - } - else + $areopen = 1; + $arecloser = $addregex[1]; + } + } + if ($areopen) + { + for (my $i = 2; $i < @addregex; ++$i) + { + if ($line =~ /$addregex[$i]/) { if (!$found) { @@ -167,13 +174,19 @@ sub grepFile($$$$@) push( @result, $line); } } + if ($line =~ /$arecloser/) + { + $areopen = 0; + } } } } close( IN); } if (!$found) { - print "Not found in $file\n"; } + print "Not found in $file\n"; + #print "Not found in $file for $regex @addregex\n"; + } return @result; } @@ -317,13 +330,13 @@ sub main() if ($coun) { $loca = $lang . "_" . $coun; - push( @langcoungreplist, $lang . '(-' . $coun . ')?'); + push( @langcoungreplist, '\b' . $lang . '\b(-' . $coun . ')?'); } else { $loca = $lang; $coun = ""; - push( @langcoungreplist, $lang); + push( @langcoungreplist, '\b' . $lang . '\b'); } my $file = "$SRC_ROOT/i18npool/source/localedata/data/$loca.xml"; my $found; @@ -385,12 +398,24 @@ sub main() grepFile( '^\s*Name\s*\(' . $langcoun . '\)\s*=', "$SRC_ROOT", "scp2", "source/ooo/file_ooo.scp", ()); + # completelangiso=af ar as-IN ... zu grepFile( - '^\s*completelangiso\s*[= ](.{2,3}(-..)?)*' . $langcoun . '', + '^\s*completelangiso\s*=\s*(\s*([a-z]{2,3})(-[A-Z][A-Z])?)*' . $langcoun . '', "$SRC_ROOT", "solenv", "inc/postset.mk", # needs a duplicated pair of backslashes to produce a literal \\ - ('^\s*completelangiso\s*=', '^\s*' . $langcoun . '\s*\\\\*$')); + ('^\s*completelangiso\s*=', '^\s*$', '^\s*' . $langcoun . '\s*\\\\*$')); + + # @noMSLocaleLangs = ( "br", "bs", ... ) + grepFile( + '^\s*@noMSLocaleLangs\s*=\s*\(\s*(\s*"([a-z]{2,3})(-[A-Z][A-Z])?"\s*,?)*' . $langcoun . '', + "$SRC_ROOT", "solenv", "bin/modules/installer/globals.pm", + ('^\s*@noMSLocaleLangs\s*=', '\)\s*$', '"' . $langcoun . '"')); + + # af 1252 1078 # Afrikaans + grepFile( + '^\s*' . $langcoun . '', + "$SRC_ROOT", "setup_native", "source/win32/msi-encodinglist.txt", ()); } } return 0; diff --git a/i18npool/source/isolang/mslangid.cxx b/i18npool/source/isolang/mslangid.cxx index 8e9dddff872b..da9da0ff8646 100644 --- a/i18npool/source/isolang/mslangid.cxx +++ b/i18npool/source/isolang/mslangid.cxx @@ -102,6 +102,8 @@ LanguageType MsLangId::getRealLanguageWithoutConfig( LanguageType nLang ) nLang = getSystemUILanguage(); break; default: + /* TODO: would this be useful here? */ + //nLang = MsLangId::getReplacementForObsoleteLanguage( nLang); ; // nothing } if (nLang == LANGUAGE_DONTKNOW) @@ -128,6 +130,8 @@ LanguageType MsLangId::getRealLanguage( LanguageType nLang ) nLang = nConfiguredSystemUILanguage; break; default: + /* TODO: would this be useful here? */ + //nLang = MsLangId::getReplacementForObsoleteLanguage( nLang); ; // nothing } if (nLang == LANGUAGE_DONTKNOW) @@ -451,6 +455,12 @@ LanguageType MsLangId::getReplacementForObsoleteLanguage( LanguageType nLang ) case LANGUAGE_SPANISH_DATED: nLang = LANGUAGE_SPANISH_MODERN; break; + + // Do not use ca-XV for document content. + /* TODO: remove in case we implement BCP47 language tags. */ + case LANGUAGE_USER_CATALAN_VALENCIAN: + nLang = LANGUAGE_CATALAN; + break; } return nLang; } diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx index 4204b3636fcb..7a520047637d 100644 --- a/i18npool/source/localedata/LocaleNode.cxx +++ b/i18npool/source/localedata/LocaleNode.cxx @@ -493,6 +493,14 @@ void LCCTYPENode::generateCode (const OFileWriter &of) const if (aDoubleQuoteStart == aDoubleQuoteEnd) fprintf( stderr, "Warning: %s\n", "DoubleQuotationStart equals DoubleQuotationEnd. Not necessarily an error, but unusual."); + /* TODO: should equalness of single and double quotes be an error? Would + * need to adapt quite some locales' data. */ + if (aQuoteStart == aDoubleQuoteStart) + fprintf( stderr, "Warning: %s\n", + "QuotationStart equals DoubleQuotationStart. Not necessarily an error, but unusual."); + if (aQuoteEnd == aDoubleQuoteEnd) + fprintf( stderr, "Warning: %s\n", + "QuotationEnd equals DoubleQuotationEnd. Not necessarily an error, but unusual."); writeParameterCheckLen( of, "TimeAM", "timeAM", 1, -1); writeParameterCheckLen( of, "TimePM", "timePM", 1, -1); @@ -689,7 +697,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const incErrorInt( "ThousandSeparator not present in FormatCode formatindex=\"%d\".", formatindex); } - if (nDec <= nGrp) + if (nDec >= 0 && nGrp >= 0 && nDec <= nGrp) incErrorInt( "Ordering of ThousandSeparator and DecimalSeparator not correct in formatindex=\"%d\".", formatindex); } @@ -724,7 +732,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const incErrorInt( "Time100SecSeparator+00 not present in FormatCode formatindex=\"%d\".", formatindex); } - if (n100s <= nTime) + if (n100s >= 0 && nTime >= 0 && n100s <= nTime) incErrorInt( "Ordering of Time100SecSeparator and TimeSeparator not correct in formatindex=\"%d\".", formatindex); } diff --git a/i18npool/source/localedata/data/ar_DZ.xml b/i18npool/source/localedata/data/ar_DZ.xml new file mode 100644 index 000000000000..68cf3ed441e8 --- /dev/null +++ b/i18npool/source/localedata/data/ar_DZ.xml @@ -0,0 +1,437 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE Locale SYSTEM 'locale.dtd'> +<Locale versionDTD="2.0.3" allowUpdateFromCLDR="yes" version="1.0"> + <LC_INFO> + <Language> + <LangID>ar</LangID> + <DefaultName>Arabic</DefaultName> + </Language> + <Country> + <CountryID>DZ</CountryID> + <DefaultName>Algeria</DefaultName> + </Country> + </LC_INFO> + <LC_CTYPE> + <Separators> + <DateSeparator>/</DateSeparator> + <ThousandSeparator> </ThousandSeparator> + <DecimalSeparator>٫</DecimalSeparator> + <TimeSeparator>:</TimeSeparator> + <Time100SecSeparator>٫</Time100SecSeparator> + <ListSeparator>;</ListSeparator> + <LongDateDayOfWeekSeparator>، </LongDateDayOfWeekSeparator> + <LongDateDaySeparator>، </LongDateDaySeparator> + <LongDateMonthSeparator>، </LongDateMonthSeparator> + <LongDateYearSeparator> </LongDateYearSeparator> + </Separators> + <Markers> + <QuotationStart>‘</QuotationStart> + <QuotationEnd>’</QuotationEnd> + <DoubleQuotationStart>"</DoubleQuotationStart> + <DoubleQuotationEnd>"</DoubleQuotationEnd> + </Markers> + <TimeAM>ص</TimeAM> + <TimePM>م</TimePM> + <MeasurementSystem>metric</MeasurementSystem> + </LC_CTYPE> + <LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$د.ج.-1401]"> + <FormatElement msgid="FixedFormatskey1" default="true" type="medium" usage="FIXED_NUMBER" formatindex="0"> + <FormatCode>General</FormatCode> + </FormatElement> + <FormatElement msgid="FixedFormatskey2" default="true" type="short" usage="FIXED_NUMBER" formatindex="1"> + <FormatCode>0</FormatCode> + </FormatElement> + <FormatElement msgid="FixedFormatskey3" default="false" type="medium" usage="FIXED_NUMBER" formatindex="2"> + <FormatCode>0٫00</FormatCode> + </FormatElement> + <FormatElement msgid="FixedFormatskey4" default="false" type="short" usage="FIXED_NUMBER" formatindex="3"> + <FormatCode># ##0</FormatCode> + </FormatElement> + <FormatElement msgid="FixedFormatskey5" default="false" type="medium" usage="FIXED_NUMBER" formatindex="4"> + <FormatCode># ##0٫00</FormatCode> + </FormatElement> + <FormatElement msgid="FixedFormatskey6" default="false" type="medium" usage="FIXED_NUMBER" formatindex="5"> + <FormatCode># ###٫00</FormatCode> + </FormatElement> + <FormatElement msgid="ScientificFormatskey1" default="true" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="6"> + <FormatCode>0٫00E+000</FormatCode> + </FormatElement> + <FormatElement msgid="ScientificFormatskey2" default="false" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="7"> + <FormatCode>0٫00E+00</FormatCode> + </FormatElement> + <FormatElement msgid="PercentFormatskey1" default="true" type="short" usage="PERCENT_NUMBER" formatindex="8"> + <FormatCode>0%</FormatCode> + </FormatElement> + <FormatElement msgid="PercentFormatskey2" default="true" type="long" usage="PERCENT_NUMBER" formatindex="9"> + <FormatCode>0٫00%</FormatCode> + </FormatElement> + <FormatElement msgid="CurrencyFormatskey1" default="true" type="short" usage="CURRENCY" formatindex="12"> + <FormatCode>[CURRENCY] # ##0;[CURRENCY] # ##0 -</FormatCode> + </FormatElement> + <FormatElement msgid="CurrencyFormatskey2" default="false" type="medium" usage="CURRENCY" formatindex="13"> + <FormatCode>[CURRENCY] # ##0٫00;[CURRENCY] # ##0٫00 -</FormatCode> + </FormatElement> + <FormatElement msgid="CurrencyFormatskey3" default="false" type="medium" usage="CURRENCY" formatindex="14"> + <FormatCode>[CURRENCY] # ##0;[RED][CURRENCY] # ##0 -</FormatCode> + </FormatElement> + <FormatElement msgid="CurrencyFormatskey4" default="true" type="medium" usage="CURRENCY" formatindex="15"> + <FormatCode>[CURRENCY] # ##0٫00;[RED][CURRENCY] # ##0٫00 -</FormatCode> + </FormatElement> + <FormatElement msgid="CurrencyFormatskey5" default="false" type="medium" usage="CURRENCY" formatindex="16"> + <FormatCode># ##0٫00 CCC</FormatCode> + </FormatElement> + <FormatElement msgid="CurrencyFormatskey6" default="false" type="medium" usage="CURRENCY" formatindex="17"> + <FormatCode>[CURRENCY] # ##0٫--;[RED][CURRENCY] # ##0٫-- -</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey1" default="true" type="short" usage="DATE" formatindex="18"> + <FormatCode>[~hijri]D/MM/YYYY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey9" default="true" type="long" usage="DATE" formatindex="19"> + <FormatCode>[~hijri]NNN DD MMMM YYYY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey8" default="true" type="medium" usage="DATE" formatindex="20"> + <FormatCode>[NatNum1][~hijri]YYYY/MM/D</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey7" default="false" type="medium" usage="DATE" formatindex="21"> + <FormatCode>D/M/YYYY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey10" default="false" type="long" usage="DATE" formatindex="22"> + <FormatCode>[NatNum1][~hijri]NNN DD MMMM YYYY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey11" default="false" type="long" usage="DATE" formatindex="23"> + <FormatCode>DD MMMM YYYY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey16" default="false" type="long" usage="DATE" formatindex="24"> + <FormatCode>[NatNum1]DD MMMM YYYY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey12" default="false" type="long" usage="DATE" formatindex="25"> + <FormatCode>NNN DD MMMM YYYY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey17" default="false" type="long" usage="DATE" formatindex="26"> + <FormatCode>[NatNum1]NNN DD MMMM YYYY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey13" default="false" type="long" usage="DATE" formatindex="27"> + <FormatCode>DD MMMM YY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey2" default="false" type="medium" usage="DATE" formatindex="28"> + <FormatCode>[NatNum1]DD MMMM YY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey14" default="false" type="long" usage="DATE" formatindex="29"> + <FormatCode>[~hijri]DD MMMM YYYY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey15" default="false" type="long" usage="DATE" formatindex="30"> + <FormatCode>[NatNum1][~hijri]DD MMMM YYYY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey18" default="false" type="short" usage="DATE" formatindex="31"> + <FormatCode>[NatNum1][~hijri]YYYY/MM/D</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey19" default="false" type="medium" usage="DATE" formatindex="32"> + <FormatCode>[NatNum1]YY/MM/DD</FormatCode> + <DefaultName>ISO 8601</DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey20" default="false" type="medium" usage="DATE" formatindex="33"> + <FormatCode>[NatNum1]YYYY/MM/DD</FormatCode> + <DefaultName>ISO 8601</DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey3" default="false" type="medium" usage="DATE" formatindex="34"> + <FormatCode>MM/YY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey4" default="false" type="medium" usage="DATE" formatindex="35"> + <FormatCode>DD MMM</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey5" default="false" type="medium" usage="DATE" formatindex="36"> + <FormatCode>MMMM</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey6" default="false" type="medium" usage="DATE" formatindex="37"> + <FormatCode>QQ YY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey21" default="false" type="medium" usage="DATE" formatindex="38"> + <FormatCode>WW</FormatCode> + </FormatElement> + <FormatElement msgid="TimeFormatskey1" default="true" type="short" usage="TIME" formatindex="39"> + <FormatCode>HH:MM</FormatCode> + </FormatElement> + <FormatElement msgid="TimeFormatskey2" default="true" type="medium" usage="TIME" formatindex="40"> + <FormatCode>HH:MM:SS</FormatCode> + </FormatElement> + <FormatElement msgid="TimeFormatskey3" default="false" type="short" usage="TIME" formatindex="41"> + <FormatCode>AM/PMMM:HH</FormatCode> + </FormatElement> + <FormatElement msgid="TimeFormatskey4" default="false" type="medium" usage="TIME" formatindex="42"> + <FormatCode>AM/PMSS:MM:HH</FormatCode> + </FormatElement> + <FormatElement msgid="TimeFormatskey5" default="false" type="medium" usage="TIME" formatindex="43"> + <FormatCode>[HH]:MM:SS</FormatCode> + </FormatElement> + <FormatElement msgid="TimeFormatskey6" default="false" type="short" usage="TIME" formatindex="44"> + <FormatCode>MM:SS٫00</FormatCode> + </FormatElement> + <FormatElement msgid="TimeFormatskey7" default="false" type="medium" usage="TIME" formatindex="45"> + <FormatCode>[HH]:MM:SS٫00</FormatCode> + </FormatElement> + <FormatElement msgid="DateTimeFormatskey1" default="true" type="medium" usage="DATE_TIME" formatindex="46"> + <FormatCode>[~hijri]AM/PMHH:MM YYYY/MM/D</FormatCode> + </FormatElement> + <FormatElement msgid="DateTimeFormatskey2" default="false" type="medium" usage="DATE_TIME" formatindex="47"> + <FormatCode>[NatNum1][~hijri]AM/PMHH:MM YYYY/MM/D</FormatCode> + </FormatElement> + <FormatElement msgid="DateTimeFormatskey3" default="false" type="medium" usage="DATE_TIME" formatindex="50"> + <FormatCode>AM/PMHH:MM YYYY/MM/D</FormatCode> + </FormatElement> + <FormatElement msgid="DateTimeFormatskey4" default="false" type="medium" usage="DATE_TIME" formatindex="51"> + <FormatCode>[NatNum1]AM/PMHH:MM YYYY/MM/D</FormatCode> + </FormatElement> + </LC_FORMAT> + <LC_COLLATION ref="en_US" /> + <LC_SEARCH ref="en_US"/> + <LC_INDEX ref="ar_EG"/> + <LC_CALENDAR> + <Calendar unoid="gregorian" default="true"> + <DaysOfWeek> + <Day> + <DayID>sun</DayID> + <DefaultAbbrvName>ح</DefaultAbbrvName> + <DefaultFullName>الأحد</DefaultFullName> + </Day> + <Day> + <DayID>mon</DayID> + <DefaultAbbrvName>ن</DefaultAbbrvName> + <DefaultFullName>الاثنين</DefaultFullName> + </Day> + <Day> + <DayID>tue</DayID> + <DefaultAbbrvName>ث</DefaultAbbrvName> + <DefaultFullName>الثلاثاء</DefaultFullName> + </Day> + <Day> + <DayID>wed</DayID> + <DefaultAbbrvName>ر</DefaultAbbrvName> + <DefaultFullName>الأربعاء</DefaultFullName> + </Day> + <Day> + <DayID>thu</DayID> + <DefaultAbbrvName>خ</DefaultAbbrvName> + <DefaultFullName>الخميس</DefaultFullName> + </Day> + <Day> + <DayID>fri</DayID> + <DefaultAbbrvName>ج</DefaultAbbrvName> + <DefaultFullName>الجمعة</DefaultFullName> + </Day> + <Day> + <DayID>sat</DayID> + <DefaultAbbrvName>س</DefaultAbbrvName> + <DefaultFullName>السبت</DefaultFullName> + </Day> + </DaysOfWeek> + <MonthsOfYear> + <Month> + <MonthID>jan</MonthID> + <DefaultAbbrvName>جانفي</DefaultAbbrvName> + <DefaultFullName>جانفي</DefaultFullName> + </Month> + <Month> + <MonthID>feb</MonthID> + <DefaultAbbrvName>فيفري</DefaultAbbrvName> + <DefaultFullName>فيفري</DefaultFullName> + </Month> + <Month> + <MonthID>mar</MonthID> + <DefaultAbbrvName>مارس</DefaultAbbrvName> + <DefaultFullName>مارس</DefaultFullName> + </Month> + <Month> + <MonthID>apr</MonthID> + <DefaultAbbrvName>أفريل</DefaultAbbrvName> + <DefaultFullName>أفريل</DefaultFullName> + </Month> + <Month> + <MonthID>may</MonthID> + <DefaultAbbrvName>ماي</DefaultAbbrvName> + <DefaultFullName>ماي</DefaultFullName> + </Month> + <Month> + <MonthID>jun</MonthID> + <DefaultAbbrvName>جوان</DefaultAbbrvName> + <DefaultFullName>جوان</DefaultFullName> + </Month> + <Month> + <MonthID>jul</MonthID> + <DefaultAbbrvName>جويلية</DefaultAbbrvName> + <DefaultFullName>جويلية</DefaultFullName> + </Month> + <Month> + <MonthID>aug</MonthID> + <DefaultAbbrvName>أوت</DefaultAbbrvName> + <DefaultFullName>أوت</DefaultFullName> + </Month> + <Month> + <MonthID>sep</MonthID> + <DefaultAbbrvName>سبتمبر</DefaultAbbrvName> + <DefaultFullName>سبتمبر</DefaultFullName> + </Month> + <Month> + <MonthID>oct</MonthID> + <DefaultAbbrvName>أكتوبر</DefaultAbbrvName> + <DefaultFullName>أكتوبر</DefaultFullName> + </Month> + <Month> + <MonthID>nov</MonthID> + <DefaultAbbrvName>نوفمبر</DefaultAbbrvName> + <DefaultFullName>نوفمبر</DefaultFullName> + </Month> + <Month> + <MonthID>dec</MonthID> + <DefaultAbbrvName>ديسمبر</DefaultAbbrvName> + <DefaultFullName>ديسمبر</DefaultFullName> + </Month> + </MonthsOfYear> + <Eras> + <Era> + <EraID>bc</EraID> + <DefaultAbbrvName>ق.م</DefaultAbbrvName> + <DefaultFullName>قبل الميلاد</DefaultFullName> + </Era> + <Era> + <EraID>ad</EraID> + <DefaultAbbrvName>م</DefaultAbbrvName> + <DefaultFullName>ميلادي</DefaultFullName> + </Era> + </Eras> + <StartDayOfWeek> + <DayID>sat</DayID> + </StartDayOfWeek> + <MinimalDaysInFirstWeek>1</MinimalDaysInFirstWeek> + </Calendar> + <Calendar unoid="hijri" default="false"> + <DaysOfWeek> + <Day> + <DayID>sun</DayID> + <DefaultAbbrvName>ح</DefaultAbbrvName> + <DefaultFullName>الأحد</DefaultFullName> + </Day> + <Day> + <DayID>mon</DayID> + <DefaultAbbrvName>ن</DefaultAbbrvName> + <DefaultFullName>الاثنين</DefaultFullName> + </Day> + <Day> + <DayID>tue</DayID> + <DefaultAbbrvName>ث</DefaultAbbrvName> + <DefaultFullName>الثلاثاء</DefaultFullName> + </Day> + <Day> + <DayID>wed</DayID> + <DefaultAbbrvName>ر</DefaultAbbrvName> + <DefaultFullName>الأربعاء</DefaultFullName> + </Day> + <Day> + <DayID>thu</DayID> + <DefaultAbbrvName>خ</DefaultAbbrvName> + <DefaultFullName>الخميس</DefaultFullName> + </Day> + <Day> + <DayID>fri</DayID> + <DefaultAbbrvName>ج</DefaultAbbrvName> + <DefaultFullName>الجمعة</DefaultFullName> + </Day> + <Day> + <DayID>sat</DayID> + <DefaultAbbrvName>س</DefaultAbbrvName> + <DefaultFullName>السبت</DefaultFullName> + </Day> + </DaysOfWeek> + <MonthsOfYear> + <Month> + <MonthID>jan</MonthID> + <DefaultAbbrvName>محرم</DefaultAbbrvName> + <DefaultFullName>محرم</DefaultFullName> + </Month> + <Month> + <MonthID>feb</MonthID> + <DefaultAbbrvName>صفر</DefaultAbbrvName> + <DefaultFullName>صفر</DefaultFullName> + </Month> + <Month> + <MonthID>mar</MonthID> + <DefaultAbbrvName>ربيع الأول</DefaultAbbrvName> + <DefaultFullName>ربيع الأول</DefaultFullName> + </Month> + <Month> + <MonthID>apr</MonthID> + <DefaultAbbrvName>ربيع الآخر</DefaultAbbrvName> + <DefaultFullName>ربيع الآخر</DefaultFullName> + </Month> + <Month> + <MonthID>may</MonthID> + <DefaultAbbrvName>جمادى الأولى</DefaultAbbrvName> + <DefaultFullName>جمادى الأولى</DefaultFullName> + </Month> + <Month> + <MonthID>jun</MonthID> + <DefaultAbbrvName>جمادى الآخرة</DefaultAbbrvName> + <DefaultFullName>جمادى الآخرة</DefaultFullName> + </Month> + <Month> + <MonthID>jul</MonthID> + <DefaultAbbrvName>رجب</DefaultAbbrvName> + <DefaultFullName>رجب</DefaultFullName> + </Month> + <Month> + <MonthID>aug</MonthID> + <DefaultAbbrvName>شعبان</DefaultAbbrvName> + <DefaultFullName>شعبان</DefaultFullName> + </Month> + <Month> + <MonthID>sep</MonthID> + <DefaultAbbrvName>رمضان</DefaultAbbrvName> + <DefaultFullName>رمضان</DefaultFullName> + </Month> + <Month> + <MonthID>oct</MonthID> + <DefaultAbbrvName>شوال</DefaultAbbrvName> + <DefaultFullName>شوال</DefaultFullName> + </Month> + <Month> + <MonthID>nov</MonthID> + <DefaultAbbrvName>ذو القعدة</DefaultAbbrvName> + <DefaultFullName>ذو القعدة</DefaultFullName> + </Month> + <Month> + <MonthID>dec</MonthID> + <DefaultAbbrvName>ذو الحجة</DefaultAbbrvName> + <DefaultFullName>ذو الحجة</DefaultFullName> + </Month> + </MonthsOfYear> + <Eras> + <Era> + <EraID>BeforeHijra</EraID> + <DefaultAbbrvName>ه</DefaultAbbrvName> + <DefaultFullName>قبل الهجرة</DefaultFullName> + </Era> + <Era> + <EraID>AfterHijra</EraID> + <DefaultAbbrvName/> + <DefaultFullName>هجري</DefaultFullName> + </Era> + </Eras> + <StartDayOfWeek> + <DayID>sat</DayID> + </StartDayOfWeek> + <MinimalDaysInFirstWeek>1</MinimalDaysInFirstWeek> + </Calendar> + </LC_CALENDAR> + <LC_CURRENCY> + <Currency default="true" usedInCompatibleFormatCodes="true"> + <CurrencyID>DZD</CurrencyID> + <CurrencySymbol>د.ج.</CurrencySymbol> + <BankSymbol>DZD</BankSymbol> + <CurrencyName>دينار جزائري</CurrencyName> + <DecimalPlaces>2</DecimalPlaces> + </Currency> + </LC_CURRENCY> + <LC_TRANSLITERATION ref="en_US"/> + <LC_MISC ref="ar_EG"/> + <LC_NumberingLevel ref="ar_EG"/> + <LC_OutLineNumberingLevel ref="ar_EG"/> +</Locale> diff --git a/i18npool/source/localedata/data/localedata_euro.map b/i18npool/source/localedata/data/localedata_euro.map index 130a3c5a249f..e0564b85ea25 100644 --- a/i18npool/source/localedata/data/localedata_euro.map +++ b/i18npool/source/localedata/data/localedata_euro.map @@ -55,6 +55,7 @@ getAllCalendars_pl_PL; getAllCalendars_pt_BR; getAllCalendars_pt_PT; getAllCalendars_ro_RO; +getAllCalendars_rue_SK; getAllCalendars_ru_RU; getAllCalendars_sc_IT; getAllCalendars_sh_ME; @@ -124,6 +125,7 @@ getAllCurrencies_pl_PL; getAllCurrencies_pt_BR; getAllCurrencies_pt_PT; getAllCurrencies_ro_RO; +getAllCurrencies_rue_SK; getAllCurrencies_ru_RU; getAllCurrencies_sc_IT; getAllCurrencies_sh_ME; @@ -193,6 +195,7 @@ getAllFormats0_pl_PL; getAllFormats0_pt_BR; getAllFormats0_pt_PT; getAllFormats0_ro_RO; +getAllFormats0_rue_SK; getAllFormats0_ru_RU; getAllFormats0_sc_IT; getAllFormats0_sh_ME; @@ -262,6 +265,7 @@ getBreakIteratorRules_pl_PL; getBreakIteratorRules_pt_BR; getBreakIteratorRules_pt_PT; getBreakIteratorRules_ro_RO; +getBreakIteratorRules_rue_SK; getBreakIteratorRules_ru_RU; getBreakIteratorRules_sc_IT; getBreakIteratorRules_sh_ME; @@ -331,6 +335,7 @@ getCollationOptions_pl_PL; getCollationOptions_pt_BR; getCollationOptions_pt_PT; getCollationOptions_ro_RO; +getCollationOptions_rue_SK; getCollationOptions_ru_RU; getCollationOptions_sc_IT; getCollationOptions_sh_ME; @@ -400,6 +405,7 @@ getCollatorImplementation_pl_PL; getCollatorImplementation_pt_BR; getCollatorImplementation_pt_PT; getCollatorImplementation_ro_RO; +getCollatorImplementation_rue_SK; getCollatorImplementation_ru_RU; getCollatorImplementation_sc_IT; getCollatorImplementation_sh_ME; @@ -469,6 +475,7 @@ getContinuousNumberingLevels_pl_PL; getContinuousNumberingLevels_pt_BR; getContinuousNumberingLevels_pt_PT; getContinuousNumberingLevels_ro_RO; +getContinuousNumberingLevels_rue_SK; getContinuousNumberingLevels_ru_RU; getContinuousNumberingLevels_sc_IT; getContinuousNumberingLevels_sh_ME; @@ -538,6 +545,7 @@ getFollowPageWords_pl_PL; getFollowPageWords_pt_BR; getFollowPageWords_pt_PT; getFollowPageWords_ro_RO; +getFollowPageWords_rue_SK; getFollowPageWords_ru_RU; getFollowPageWords_sc_IT; getFollowPageWords_sh_ME; @@ -607,6 +615,7 @@ getForbiddenCharacters_pl_PL; getForbiddenCharacters_pt_BR; getForbiddenCharacters_pt_PT; getForbiddenCharacters_ro_RO; +getForbiddenCharacters_rue_SK; getForbiddenCharacters_ru_RU; getForbiddenCharacters_sc_IT; getForbiddenCharacters_sh_ME; @@ -676,6 +685,7 @@ getIndexAlgorithm_pl_PL; getIndexAlgorithm_pt_BR; getIndexAlgorithm_pt_PT; getIndexAlgorithm_ro_RO; +getIndexAlgorithm_rue_SK; getIndexAlgorithm_ru_RU; getIndexAlgorithm_sc_IT; getIndexAlgorithm_sh_ME; @@ -745,6 +755,7 @@ getLCInfo_pl_PL; getLCInfo_pt_BR; getLCInfo_pt_PT; getLCInfo_ro_RO; +getLCInfo_rue_SK; getLCInfo_ru_RU; getLCInfo_sc_IT; getLCInfo_sh_ME; @@ -814,6 +825,7 @@ getLocaleItem_pl_PL; getLocaleItem_pt_BR; getLocaleItem_pt_PT; getLocaleItem_ro_RO; +getLocaleItem_rue_SK; getLocaleItem_ru_RU; getLocaleItem_sc_IT; getLocaleItem_sh_ME; @@ -883,6 +895,7 @@ getOutlineNumberingLevels_pl_PL; getOutlineNumberingLevels_pt_BR; getOutlineNumberingLevels_pt_PT; getOutlineNumberingLevels_ro_RO; +getOutlineNumberingLevels_rue_SK; getOutlineNumberingLevels_ru_RU; getOutlineNumberingLevels_sc_IT; getOutlineNumberingLevels_sh_ME; @@ -952,6 +965,7 @@ getReservedWords_pl_PL; getReservedWords_pt_BR; getReservedWords_pt_PT; getReservedWords_ro_RO; +getReservedWords_rue_SK; getReservedWords_ru_RU; getReservedWords_sc_IT; getReservedWords_sh_ME; @@ -1021,6 +1035,7 @@ getSearchOptions_pl_PL; getSearchOptions_pt_BR; getSearchOptions_pt_PT; getSearchOptions_ro_RO; +getSearchOptions_rue_SK; getSearchOptions_ru_RU; getSearchOptions_sc_IT; getSearchOptions_sh_ME; @@ -1090,6 +1105,7 @@ getTransliterations_pl_PL; getTransliterations_pt_BR; getTransliterations_pt_PT; getTransliterations_ro_RO; +getTransliterations_rue_SK; getTransliterations_ru_RU; getTransliterations_sc_IT; getTransliterations_sh_ME; @@ -1159,6 +1175,7 @@ getUnicodeScripts_pl_PL; getUnicodeScripts_pt_BR; getUnicodeScripts_pt_PT; getUnicodeScripts_ro_RO; +getUnicodeScripts_rue_SK; getUnicodeScripts_ru_RU; getUnicodeScripts_sc_IT; getUnicodeScripts_sh_ME; diff --git a/i18npool/source/localedata/data/localedata_others.map b/i18npool/source/localedata/data/localedata_others.map index fd9e13cfb779..e5de10cb68e5 100644 --- a/i18npool/source/localedata/data/localedata_others.map +++ b/i18npool/source/localedata/data/localedata_others.map @@ -4,6 +4,7 @@ getAllCalendars_af_NA; getAllCalendars_af_ZA; getAllCalendars_ak_GH; getAllCalendars_am_ET; +getAllCalendars_ar_DZ; getAllCalendars_ar_EG; getAllCalendars_ar_LB; getAllCalendars_ar_OM; @@ -37,6 +38,7 @@ getAllCalendars_ky_KG; getAllCalendars_lg_UG; getAllCalendars_ln_CD; getAllCalendars_lo_LA; +getAllCalendars_mai_IN; getAllCalendars_ml_IN; getAllCalendars_mn_MN; getAllCalendars_mr_IN; @@ -80,6 +82,7 @@ getAllCurrencies_af_NA; getAllCurrencies_af_ZA; getAllCurrencies_ak_GH; getAllCurrencies_am_ET; +getAllCurrencies_ar_DZ; getAllCurrencies_ar_EG; getAllCurrencies_ar_LB; getAllCurrencies_ar_OM; @@ -113,6 +116,7 @@ getAllCurrencies_ky_KG; getAllCurrencies_lg_UG; getAllCurrencies_ln_CD; getAllCurrencies_lo_LA; +getAllCurrencies_mai_IN; getAllCurrencies_ml_IN; getAllCurrencies_mn_MN; getAllCurrencies_mr_IN; @@ -156,6 +160,7 @@ getAllFormats0_af_NA; getAllFormats0_af_ZA; getAllFormats0_ak_GH; getAllFormats0_am_ET; +getAllFormats0_ar_DZ; getAllFormats0_ar_EG; getAllFormats0_ar_LB; getAllFormats0_ar_OM; @@ -189,6 +194,7 @@ getAllFormats0_ky_KG; getAllFormats0_lg_UG; getAllFormats0_ln_CD; getAllFormats0_lo_LA; +getAllFormats0_mai_IN; getAllFormats0_ml_IN; getAllFormats0_mn_MN; getAllFormats0_mr_IN; @@ -232,6 +238,7 @@ getBreakIteratorRules_af_NA; getBreakIteratorRules_af_ZA; getBreakIteratorRules_ak_GH; getBreakIteratorRules_am_ET; +getBreakIteratorRules_ar_DZ; getBreakIteratorRules_ar_EG; getBreakIteratorRules_ar_LB; getBreakIteratorRules_ar_OM; @@ -265,6 +272,7 @@ getBreakIteratorRules_ky_KG; getBreakIteratorRules_lg_UG; getBreakIteratorRules_ln_CD; getBreakIteratorRules_lo_LA; +getBreakIteratorRules_mai_IN; getBreakIteratorRules_ml_IN; getBreakIteratorRules_mn_MN; getBreakIteratorRules_mr_IN; @@ -308,6 +316,7 @@ getCollationOptions_af_NA; getCollationOptions_af_ZA; getCollationOptions_ak_GH; getCollationOptions_am_ET; +getCollationOptions_ar_DZ; getCollationOptions_ar_EG; getCollationOptions_ar_LB; getCollationOptions_ar_OM; @@ -341,6 +350,7 @@ getCollationOptions_ky_KG; getCollationOptions_lg_UG; getCollationOptions_ln_CD; getCollationOptions_lo_LA; +getCollationOptions_mai_IN; getCollationOptions_ml_IN; getCollationOptions_mn_MN; getCollationOptions_mr_IN; @@ -384,6 +394,7 @@ getCollatorImplementation_af_NA; getCollatorImplementation_af_ZA; getCollatorImplementation_ak_GH; getCollatorImplementation_am_ET; +getCollatorImplementation_ar_DZ; getCollatorImplementation_ar_EG; getCollatorImplementation_ar_LB; getCollatorImplementation_ar_OM; @@ -417,6 +428,7 @@ getCollatorImplementation_ky_KG; getCollatorImplementation_lg_UG; getCollatorImplementation_ln_CD; getCollatorImplementation_lo_LA; +getCollatorImplementation_mai_IN; getCollatorImplementation_ml_IN; getCollatorImplementation_mn_MN; getCollatorImplementation_mr_IN; @@ -460,6 +472,7 @@ getContinuousNumberingLevels_af_NA; getContinuousNumberingLevels_af_ZA; getContinuousNumberingLevels_ak_GH; getContinuousNumberingLevels_am_ET; +getContinuousNumberingLevels_ar_DZ; getContinuousNumberingLevels_ar_EG; getContinuousNumberingLevels_ar_LB; getContinuousNumberingLevels_ar_OM; @@ -493,6 +506,7 @@ getContinuousNumberingLevels_ky_KG; getContinuousNumberingLevels_lg_UG; getContinuousNumberingLevels_ln_CD; getContinuousNumberingLevels_lo_LA; +getContinuousNumberingLevels_mai_IN; getContinuousNumberingLevels_ml_IN; getContinuousNumberingLevels_mn_MN; getContinuousNumberingLevels_mr_IN; @@ -536,6 +550,7 @@ getFollowPageWords_af_NA; getFollowPageWords_af_ZA; getFollowPageWords_ak_GH; getFollowPageWords_am_ET; +getFollowPageWords_ar_DZ; getFollowPageWords_ar_EG; getFollowPageWords_ar_LB; getFollowPageWords_ar_OM; @@ -569,6 +584,7 @@ getFollowPageWords_ky_KG; getFollowPageWords_lg_UG; getFollowPageWords_ln_CD; getFollowPageWords_lo_LA; +getFollowPageWords_mai_IN; getFollowPageWords_ml_IN; getFollowPageWords_mn_MN; getFollowPageWords_mr_IN; @@ -612,6 +628,7 @@ getForbiddenCharacters_af_NA; getForbiddenCharacters_af_ZA; getForbiddenCharacters_ak_GH; getForbiddenCharacters_am_ET; +getForbiddenCharacters_ar_DZ; getForbiddenCharacters_ar_EG; getForbiddenCharacters_ar_LB; getForbiddenCharacters_ar_OM; @@ -645,6 +662,7 @@ getForbiddenCharacters_ky_KG; getForbiddenCharacters_lg_UG; getForbiddenCharacters_ln_CD; getForbiddenCharacters_lo_LA; +getForbiddenCharacters_mai_IN; getForbiddenCharacters_ml_IN; getForbiddenCharacters_mn_MN; getForbiddenCharacters_mr_IN; @@ -688,6 +706,7 @@ getIndexAlgorithm_af_NA; getIndexAlgorithm_af_ZA; getIndexAlgorithm_ak_GH; getIndexAlgorithm_am_ET; +getIndexAlgorithm_ar_DZ; getIndexAlgorithm_ar_EG; getIndexAlgorithm_ar_LB; getIndexAlgorithm_ar_OM; @@ -721,6 +740,7 @@ getIndexAlgorithm_ky_KG; getIndexAlgorithm_lg_UG; getIndexAlgorithm_ln_CD; getIndexAlgorithm_lo_LA; +getIndexAlgorithm_mai_IN; getIndexAlgorithm_ml_IN; getIndexAlgorithm_mn_MN; getIndexAlgorithm_mr_IN; @@ -764,6 +784,7 @@ getLCInfo_af_NA; getLCInfo_af_ZA; getLCInfo_ak_GH; getLCInfo_am_ET; +getLCInfo_ar_DZ; getLCInfo_ar_EG; getLCInfo_ar_LB; getLCInfo_ar_OM; @@ -797,6 +818,7 @@ getLCInfo_ky_KG; getLCInfo_lg_UG; getLCInfo_ln_CD; getLCInfo_lo_LA; +getLCInfo_mai_IN; getLCInfo_ml_IN; getLCInfo_mn_MN; getLCInfo_mr_IN; @@ -840,6 +862,7 @@ getLocaleItem_af_NA; getLocaleItem_af_ZA; getLocaleItem_ak_GH; getLocaleItem_am_ET; +getLocaleItem_ar_DZ; getLocaleItem_ar_EG; getLocaleItem_ar_LB; getLocaleItem_ar_OM; @@ -873,6 +896,7 @@ getLocaleItem_ky_KG; getLocaleItem_lg_UG; getLocaleItem_ln_CD; getLocaleItem_lo_LA; +getLocaleItem_mai_IN; getLocaleItem_ml_IN; getLocaleItem_mn_MN; getLocaleItem_mr_IN; @@ -916,6 +940,7 @@ getOutlineNumberingLevels_af_NA; getOutlineNumberingLevels_af_ZA; getOutlineNumberingLevels_ak_GH; getOutlineNumberingLevels_am_ET; +getOutlineNumberingLevels_ar_DZ; getOutlineNumberingLevels_ar_EG; getOutlineNumberingLevels_ar_LB; getOutlineNumberingLevels_ar_OM; @@ -949,6 +974,7 @@ getOutlineNumberingLevels_ky_KG; getOutlineNumberingLevels_lg_UG; getOutlineNumberingLevels_ln_CD; getOutlineNumberingLevels_lo_LA; +getOutlineNumberingLevels_mai_IN; getOutlineNumberingLevels_ml_IN; getOutlineNumberingLevels_mn_MN; getOutlineNumberingLevels_mr_IN; @@ -992,6 +1018,7 @@ getReservedWords_af_NA; getReservedWords_af_ZA; getReservedWords_ak_GH; getReservedWords_am_ET; +getReservedWords_ar_DZ; getReservedWords_ar_EG; getReservedWords_ar_LB; getReservedWords_ar_OM; @@ -1025,6 +1052,7 @@ getReservedWords_ky_KG; getReservedWords_lg_UG; getReservedWords_ln_CD; getReservedWords_lo_LA; +getReservedWords_mai_IN; getReservedWords_ml_IN; getReservedWords_mn_MN; getReservedWords_mr_IN; @@ -1068,6 +1096,7 @@ getSearchOptions_af_NA; getSearchOptions_af_ZA; getSearchOptions_ak_GH; getSearchOptions_am_ET; +getSearchOptions_ar_DZ; getSearchOptions_ar_EG; getSearchOptions_ar_LB; getSearchOptions_ar_OM; @@ -1101,6 +1130,7 @@ getSearchOptions_ky_KG; getSearchOptions_lg_UG; getSearchOptions_ln_CD; getSearchOptions_lo_LA; +getSearchOptions_mai_IN; getSearchOptions_ml_IN; getSearchOptions_mn_MN; getSearchOptions_mr_IN; @@ -1144,6 +1174,7 @@ getTransliterations_af_NA; getTransliterations_af_ZA; getTransliterations_ak_GH; getTransliterations_am_ET; +getTransliterations_ar_DZ; getTransliterations_ar_EG; getTransliterations_ar_LB; getTransliterations_ar_OM; @@ -1177,6 +1208,7 @@ getTransliterations_ky_KG; getTransliterations_lg_UG; getTransliterations_ln_CD; getTransliterations_lo_LA; +getTransliterations_mai_IN; getTransliterations_ml_IN; getTransliterations_mn_MN; getTransliterations_mr_IN; @@ -1220,6 +1252,7 @@ getUnicodeScripts_af_NA; getUnicodeScripts_af_ZA; getUnicodeScripts_ak_GH; getUnicodeScripts_am_ET; +getUnicodeScripts_ar_DZ; getUnicodeScripts_ar_EG; getUnicodeScripts_ar_LB; getUnicodeScripts_ar_OM; @@ -1253,6 +1286,7 @@ getUnicodeScripts_ky_KG; getUnicodeScripts_lg_UG; getUnicodeScripts_ln_CD; getUnicodeScripts_lo_LA; +getUnicodeScripts_mai_IN; getUnicodeScripts_ml_IN; getUnicodeScripts_mn_MN; getUnicodeScripts_mr_IN; diff --git a/i18npool/source/localedata/data/ltg_LV.xml b/i18npool/source/localedata/data/ltg_LV.xml index c41c38c86b9c..7d4445d26426 100644 --- a/i18npool/source/localedata/data/ltg_LV.xml +++ b/i18npool/source/localedata/data/ltg_LV.xml @@ -65,23 +65,23 @@ <FormatElement msgid="PercentFormatskey2" default="true" type="long" usage="PERCENT_NUMBER" formatindex="9"> <FormatCode>0,00%</FormatCode> </FormatElement> - <FormatElement msgid="CurrencyFormatskey1" default="true" type="short" usage="CURRENCY" formatindex="12"> - <FormatCode># ##0[$Ls-64B];-# ##0[$Ls-64B]</FormatCode> + <FormatElement msgid="CurrencyFormatskey1" default="true" type="short" usage="CURRENCY" formatindex="12"> + <FormatCode>[$Ls-64B] # ##0;[$Ls-64B] -# ##0</FormatCode> </FormatElement> - <FormatElement msgid="CurrencyFormatskey2" default="false" type="medium" usage="CURRENCY" formatindex="13"> - <FormatCode># ##0,00[$Ls-64B];-# ##0,00[$Ls-64B]</FormatCode> + <FormatElement msgid="CurrencyFormatskey2" default="false" type="medium" usage="CURRENCY" formatindex="13"> + <FormatCode>[$Ls-64B] # ##0,00;[$Ls-64B] -# ##0,00</FormatCode> </FormatElement> - <FormatElement msgid="CurrencyFormatskey3" default="false" type="medium" usage="CURRENCY" formatindex="14"> - <FormatCode># ##0[$Ls-64B];[RED]-# ##0[$Ls-64B]</FormatCode> + <FormatElement msgid="CurrencyFormatskey3" default="false" type="medium" usage="CURRENCY" formatindex="14"> + <FormatCode>[$Ls-64B] # ##0;[RED][$Ls-64B] -# ##0</FormatCode> </FormatElement> - <FormatElement msgid="CurrencyFormatskey4" default="true" type="medium" usage="CURRENCY" formatindex="15"> - <FormatCode># ##0,00[$Ls-64B];[RED]-# ##0,00[$Ls-64B]</FormatCode> + <FormatElement msgid="CurrencyFormatskey4" default="true" type="medium" usage="CURRENCY" formatindex="15"> + <FormatCode>[$Ls-64B] # ##0,00;[RED][$Ls-64B] -# ##0,00</FormatCode> </FormatElement> - <FormatElement msgid="CurrencyFormatskey5" default="false" type="medium" usage="CURRENCY" formatindex="16"> + <FormatElement msgid="CurrencyFormatskey5" default="false" type="medium" usage="CURRENCY" formatindex="16"> <FormatCode># ##0,00 CCC</FormatCode> </FormatElement> - <FormatElement msgid="CurrencyFormatskey6" default="false" type="medium" usage="CURRENCY" formatindex="17"> - <FormatCode># ##0,--[$Ls-64B];[RED]-# ##0,--[$Ls-64B]</FormatCode> + <FormatElement msgid="CurrencyFormatskey6" default="false" type="medium" usage="CURRENCY" formatindex="17"> + <FormatCode>[$Ls-64B] # ##0,--;[RED][$Ls-64B] -# ##0,--</FormatCode> </FormatElement> <FormatElement msgid="DateFormatskey11" default="true" type="short" usage="DATE" formatindex="18"> <FormatCode>D.MM.YY</FormatCode> diff --git a/i18npool/source/localedata/data/lv_LV.xml b/i18npool/source/localedata/data/lv_LV.xml index ab76b4930bc6..0144bb4787cc 100644 --- a/i18npool/source/localedata/data/lv_LV.xml +++ b/i18npool/source/localedata/data/lv_LV.xml @@ -66,28 +66,28 @@ <FormatCode>0,00%</FormatCode> </FormatElement> <FormatElement msgid="CurrencyFormatskey1" default="true" type="short" usage="CURRENCY" formatindex="12"> - <FormatCode># ##0[$Ls-426];-# ##0[$Ls-426]</FormatCode> + <FormatCode>[$Ls-426] # ##0;[$Ls-426] -# ##0</FormatCode> </FormatElement> <FormatElement msgid="CurrencyFormatskey2" default="false" type="medium" usage="CURRENCY" formatindex="13"> - <FormatCode># ##0,00[$Ls-426];-# ##0,00[$Ls-426]</FormatCode> + <FormatCode>[$Ls-426] # ##0,00;[$Ls-426] -# ##0,00</FormatCode> </FormatElement> <FormatElement msgid="CurrencyFormatskey3" default="false" type="medium" usage="CURRENCY" formatindex="14"> - <FormatCode># ##0[$Ls-426];[RED]-# ##0[$Ls-426]</FormatCode> + <FormatCode>[$Ls-426] # ##0;[RED][$Ls-426] -# ##0</FormatCode> </FormatElement> <FormatElement msgid="CurrencyFormatskey4" default="true" type="medium" usage="CURRENCY" formatindex="15"> - <FormatCode># ##0,00[$Ls-426];[RED]-# ##0,00[$Ls-426]</FormatCode> + <FormatCode>[$Ls-426] # ##0,00;[RED][$Ls-426] -# ##0,00</FormatCode> </FormatElement> <FormatElement msgid="CurrencyFormatskey5" default="false" type="medium" usage="CURRENCY" formatindex="16"> <FormatCode># ##0,00 CCC</FormatCode> </FormatElement> <FormatElement msgid="CurrencyFormatskey6" default="false" type="medium" usage="CURRENCY" formatindex="17"> - <FormatCode># ##0,--[$Ls-426];[RED]-# ##0,--[$Ls-426]</FormatCode> + <FormatCode>[$Ls-426] # ##0,--;[RED][$Ls-426] -# ##0,--</FormatCode> </FormatElement> <FormatElement msgid="DateFormatskey1" default="true" type="short" usage="DATE" formatindex="18"> <FormatCode>D.M.YY</FormatCode> </FormatElement> <FormatElement msgid="DateFormatskey9" default="true" type="long" usage="DATE" formatindex="19"> - <FormatCode>DD. NNNNMMMM, YYYY</FormatCode> + <FormatCode>YYYY. "gada" DD. MMMM, NNNN</FormatCode> </FormatElement> <FormatElement msgid="DateFormatskey8" default="true" type="medium" usage="DATE" formatindex="20"> <FormatCode>DD.MM.YY</FormatCode> @@ -120,7 +120,7 @@ <FormatCode>NN, D. MMMM, YYYY</FormatCode> </FormatElement> <FormatElement msgid="DateFormatskey15" default="false" type="long" usage="DATE" formatindex="30"> - <FormatCode>NNNNMMMM D, YYYY</FormatCode> + <FormatCode>NNNN, YYYY. "gada" DD. MMMM</FormatCode> </FormatElement> <FormatElement msgid="DateFormatskey18" default="false" type="short" usage="DATE" formatindex="31"> <FormatCode>DD-MM</FormatCode> diff --git a/i18npool/source/localedata/data/mai_IN.xml b/i18npool/source/localedata/data/mai_IN.xml new file mode 100644 index 000000000000..07c3d39c6a9d --- /dev/null +++ b/i18npool/source/localedata/data/mai_IN.xml @@ -0,0 +1,357 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE Locale SYSTEM 'locale.dtd'> +<Locale versionDTD="2.0.3" allowUpdateFromCLDR="no" version="1.0"> + <LC_INFO> + <Language> + <LangID>mai</LangID> + <DefaultName>Maithili</DefaultName> + </Language> + <Country> + <CountryID>IN</CountryID> + <DefaultName>India</DefaultName> + </Country> + </LC_INFO> + <LC_CTYPE unoid="generic"> + <Separators> + <DateSeparator>.</DateSeparator> + <ThousandSeparator>,</ThousandSeparator> + <DecimalSeparator>.</DecimalSeparator> + <TimeSeparator>:</TimeSeparator> + <Time100SecSeparator>.</Time100SecSeparator> + <ListSeparator>;</ListSeparator> + <LongDateDayOfWeekSeparator>, </LongDateDayOfWeekSeparator> + <LongDateDaySeparator>, </LongDateDaySeparator> + <LongDateMonthSeparator> </LongDateMonthSeparator> + <LongDateYearSeparator> </LongDateYearSeparator> + </Separators> + <Markers> + <QuotationStart>‘</QuotationStart> + <QuotationEnd>’</QuotationEnd> + <DoubleQuotationStart>“</DoubleQuotationStart> + <DoubleQuotationEnd>”</DoubleQuotationEnd> + </Markers> + <TimeAM>पूर्वाह्न</TimeAM> + <TimePM>अपराह्न</TimePM> + <MeasurementSystem>metric</MeasurementSystem> + </LC_CTYPE> + <LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$रू.-645]"> + <FormatElement msgid="FixedFormatskey1" default="true" type="medium" usage="FIXED_NUMBER" formatindex="0"> + <FormatCode>General</FormatCode> + </FormatElement> + <FormatElement msgid="FixedFormatskey2" default="true" type="short" usage="FIXED_NUMBER" formatindex="1"> + <FormatCode>0</FormatCode> + </FormatElement> + <FormatElement msgid="FixedFormatskey3" default="false" type="medium" usage="FIXED_NUMBER" formatindex="2"> + <FormatCode>0.00</FormatCode> + </FormatElement> + <FormatElement msgid="FixedFormatskey4" default="false" type="short" usage="FIXED_NUMBER" formatindex="3"> + <FormatCode>#,##0</FormatCode> + </FormatElement> + <FormatElement msgid="FixedFormatskey5" default="false" type="medium" usage="FIXED_NUMBER" formatindex="4"> + <FormatCode>#,##0.00</FormatCode> + </FormatElement> + <FormatElement msgid="FixedFormatskey6" default="false" type="medium" usage="FIXED_NUMBER" formatindex="5"> + <FormatCode>#,###.00</FormatCode> + </FormatElement> + <FormatElement msgid="ScientificFormatskey1" default="true" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="6"> + <FormatCode>0.00E+00</FormatCode> + </FormatElement> + <FormatElement msgid="ScientificFormatskey2" default="false" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="7"> + <FormatCode>0.00E+000</FormatCode> + </FormatElement> + <FormatElement msgid="PercentFormatskey1" default="true" type="short" usage="PERCENT_NUMBER" formatindex="8"> + <FormatCode>0%</FormatCode> + </FormatElement> + <FormatElement msgid="PercentFormatskey2" default="true" type="long" usage="PERCENT_NUMBER" formatindex="9"> + <FormatCode>0.00%</FormatCode> + </FormatElement> + <FormatElement msgid="CurrencyFormatskey1" default="true" type="short" usage="CURRENCY" formatindex="12"> + <FormatCode>[CURRENCY]#,##0;-[CURRENCY]#,##0</FormatCode> + </FormatElement> + <FormatElement msgid="CurrencyFormatskey2" default="false" type="medium" usage="CURRENCY" formatindex="13"> + <FormatCode>[CURRENCY]#,##0.00;-[CURRENCY]#,##0.00</FormatCode> + </FormatElement> + <FormatElement msgid="CurrencyFormatskey3" default="false" type="medium" usage="CURRENCY" formatindex="14"> + <FormatCode>[CURRENCY]#,##0;[RED]-[CURRENCY]#,##0</FormatCode> + </FormatElement> + <FormatElement msgid="CurrencyFormatskey4" default="true" type="medium" usage="CURRENCY" formatindex="15"> + <FormatCode>[CURRENCY]#,##0.00;[RED]-[CURRENCY]#,##0.00</FormatCode> + </FormatElement> + <FormatElement msgid="CurrencyFormatskey5" default="false" type="medium" usage="CURRENCY" formatindex="16"> + <FormatCode>CCC#,##0.00</FormatCode> + </FormatElement> + <FormatElement msgid="CurrencyFormatskey6" default="false" type="medium" usage="CURRENCY" formatindex="17"> + <FormatCode>[CURRENCY]#,##0.--;[RED]-[CURRENCY]#,##0.--</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey11" default="true" type="short" usage="DATE" formatindex="18"> + <FormatCode>D.MM.YY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey14" default="true" type="long" usage="DATE" formatindex="19"> + <FormatCode>NNNNDD, MMMM YYYY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey6" default="true" type="medium" usage="DATE" formatindex="20"> + <FormatCode>DD.MM.YY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey5" default="false" type="medium" usage="DATE" formatindex="21"> + <FormatCode>DD.MM.YYYY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey15" default="false" type="long" usage="DATE" formatindex="22"> + <FormatCode>D, MMM YY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey16" default="false" type="long" usage="DATE" formatindex="23"> + <FormatCode>D, MMM YYYY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey21" default="false" type="long" usage="DATE" formatindex="24"> + <FormatCode>D, MMM YYYY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey17" default="false" type="long" usage="DATE" formatindex="25"> + <FormatCode>D, MMMM YYYY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey22" default="false" type="long" usage="DATE" formatindex="26"> + <FormatCode>D, MMMM YY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey10" default="false" type="medium" usage="DATE" formatindex="27"> + <FormatCode>NN, DD.MMM.YY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey18" default="false" type="long" usage="DATE" formatindex="28"> + <FormatCode>NN, D, MMM YY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey19" default="false" type="long" usage="DATE" formatindex="29"> + <FormatCode>NN, D, MMMM YYYY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey20" default="false" type="long" usage="DATE" formatindex="30"> + <FormatCode>NNNND, MMMM YYYY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey12" default="false" type="short" usage="DATE" formatindex="31"> + <FormatCode>MM.DD</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey7" default="false" type="medium" usage="DATE" formatindex="32"> + <FormatCode>YY-MM-DD</FormatCode> + <DefaultName>ISO 8601</DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey8" default="false" type="medium" usage="DATE" formatindex="33"> + <FormatCode>YYYY-MM-DD</FormatCode> + <DefaultName>ISO 8601</DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey1" default="false" type="medium" usage="DATE" formatindex="34"> + <FormatCode>MM.YY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey2" default="false" type="medium" usage="DATE" formatindex="35"> + <FormatCode>MMM.DD</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey3" default="false" type="medium" usage="DATE" formatindex="36"> + <FormatCode>MMMM</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey4" default="false" type="medium" usage="DATE" formatindex="37"> + <FormatCode>QQ YY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey9" default="false" type="medium" usage="DATE" formatindex="38"> + <FormatCode>WW</FormatCode> + </FormatElement> + <FormatElement msgid="TimeFormatskey1" default="false" type="short" usage="TIME" formatindex="39"> + <FormatCode>HH:MM</FormatCode> + </FormatElement> + <FormatElement msgid="TimeFormatskey2" default="false" type="medium" usage="TIME" formatindex="40"> + <FormatCode>HH:MM:SS</FormatCode> + </FormatElement> + <FormatElement msgid="TimeFormatskey3" default="true" type="short" usage="TIME" formatindex="41"> + <FormatCode>HH:MM AM/PM</FormatCode> + </FormatElement> + <FormatElement msgid="TimeFormatskey4" default="true" type="medium" usage="TIME" formatindex="42"> + <FormatCode>HH:MM:SS AM/PM</FormatCode> + </FormatElement> + <FormatElement msgid="TimeFormatskey5" default="false" type="medium" usage="TIME" formatindex="43"> + <FormatCode>[HH]:MM:SS</FormatCode> + </FormatElement> + <FormatElement msgid="TimeFormatskey6" default="false" type="short" usage="TIME" formatindex="44"> + <FormatCode>MM:SS.00</FormatCode> + </FormatElement> + <FormatElement msgid="TimeFormatskey7" default="false" type="medium" usage="TIME" formatindex="45"> + <FormatCode>[HH]:MM:SS.00</FormatCode> + </FormatElement> + <FormatElement msgid="DateTimeFormatskey1" default="true" type="medium" usage="DATE_TIME" formatindex="46"> + <FormatCode>DD.MM.YY HH:MM</FormatCode> + </FormatElement> + <FormatElement msgid="DateTimeFormatskey2" default="false" type="medium" usage="DATE_TIME" formatindex="47"> + <FormatCode>DD.MM.YYYY HH:MM:SS AM/PM</FormatCode> + </FormatElement> + </LC_FORMAT> + <LC_COLLATION> + <Collator default="true" unoid="alphanumeric"/> + <CollationOptions> + <TransliterationModules>IGNORE_CASE</TransliterationModules> + </CollationOptions> + </LC_COLLATION> + <LC_SEARCH> + <SearchOptions> + <TransliterationModules>IGNORE_CASE</TransliterationModules> + </SearchOptions> + </LC_SEARCH> + <LC_INDEX> + <IndexKey phonetic="false" default="true" unoid="alphanumeric">अ-ह</IndexKey> + <UnicodeScript>14</UnicodeScript> + <FollowPageWord>आ.पृ.</FollowPageWord> + <FollowPageWord>आ.पृ.</FollowPageWord> + </LC_INDEX> + <LC_CALENDAR> + <Calendar unoid="gregorian" default="true"> + <DaysOfWeek> + <Day> + <DayID>sun</DayID> + <DefaultAbbrvName>रवि</DefaultAbbrvName> + <DefaultFullName>रविवार</DefaultFullName> + </Day> + <Day> + <DayID>mon</DayID> + <DefaultAbbrvName>सोम</DefaultAbbrvName> + <DefaultFullName>सोमवार</DefaultFullName> + </Day> + <Day> + <DayID>tue</DayID> + <DefaultAbbrvName>मंगल</DefaultAbbrvName> + <DefaultFullName>मंगलवार</DefaultFullName> + </Day> + <Day> + <DayID>wed</DayID> + <DefaultAbbrvName>बुध</DefaultAbbrvName> + <DefaultFullName>बुधवार</DefaultFullName> + </Day> + <Day> + <DayID>thu</DayID> + <DefaultAbbrvName>गुरु</DefaultAbbrvName> + <DefaultFullName>गुरुवार</DefaultFullName> + </Day> + <Day> + <DayID>fri</DayID> + <DefaultAbbrvName>शुक्र</DefaultAbbrvName> + <DefaultFullName>शुक्रवार</DefaultFullName> + </Day> + <Day> + <DayID>sat</DayID> + <DefaultAbbrvName>शनि</DefaultAbbrvName> + <DefaultFullName>शनिवार</DefaultFullName> + </Day> + </DaysOfWeek> + <MonthsOfYear> + <Month> + <MonthID>jan</MonthID> + <DefaultAbbrvName>जन</DefaultAbbrvName> + <DefaultFullName>जनवरी</DefaultFullName> + </Month> + <Month> + <MonthID>feb</MonthID> + <DefaultAbbrvName>फर</DefaultAbbrvName> + <DefaultFullName>फरवरी</DefaultFullName> + </Month> + <Month> + <MonthID>mar</MonthID> + <DefaultAbbrvName>मार्च</DefaultAbbrvName> + <DefaultFullName>मार्च</DefaultFullName> + </Month> + <Month> + <MonthID>apr</MonthID> + <DefaultAbbrvName>अप्रै</DefaultAbbrvName> + <DefaultFullName>अप्रैल</DefaultFullName> + </Month> + <Month> + <MonthID>may</MonthID> + <DefaultAbbrvName>मई</DefaultAbbrvName> + <DefaultFullName>मई</DefaultFullName> + </Month> + <Month> + <MonthID>jun</MonthID> + <DefaultAbbrvName>जून</DefaultAbbrvName> + <DefaultFullName>जून</DefaultFullName> + </Month> + <Month> + <MonthID>jul</MonthID> + <DefaultAbbrvName>जुला</DefaultAbbrvName> + <DefaultFullName>जुलाई</DefaultFullName> + </Month> + <Month> + <MonthID>aug</MonthID> + <DefaultAbbrvName>अग</DefaultAbbrvName> + <DefaultFullName>अगस्त</DefaultFullName> + </Month> + <Month> + <MonthID>sep</MonthID> + <DefaultAbbrvName>सित</DefaultAbbrvName> + <DefaultFullName>सितम्बर</DefaultFullName> + </Month> + <Month> + <MonthID>oct</MonthID> + <DefaultAbbrvName>अक्टू</DefaultAbbrvName> + <DefaultFullName>अक्टूबर</DefaultFullName> + </Month> + <Month> + <MonthID>nov</MonthID> + <DefaultAbbrvName>नव</DefaultAbbrvName> + <DefaultFullName>नवम्बर</DefaultFullName> + </Month> + <Month> + <MonthID>dec</MonthID> + <DefaultAbbrvName>दिस</DefaultAbbrvName> + <DefaultFullName>दिसम्बर</DefaultFullName> + </Month> + </MonthsOfYear> + <Eras> + <Era> + <EraID>bc</EraID> + <DefaultAbbrvName>ई.पू.</DefaultAbbrvName> + <DefaultFullName>ईस्वी पूर्व</DefaultFullName> + </Era> + <Era> + <EraID>ad</EraID> + <DefaultAbbrvName>ई.</DefaultAbbrvName> + <DefaultFullName>ईस्वी</DefaultFullName> + </Era> + </Eras> + <StartDayOfWeek> + <DayID>sun</DayID> + </StartDayOfWeek> + <MinimalDaysInFirstWeek>1</MinimalDaysInFirstWeek> + </Calendar> + </LC_CALENDAR> + <LC_CURRENCY> + <Currency default="true" usedInCompatibleFormatCodes="true"> + <CurrencyID>INR</CurrencyID> + <CurrencySymbol>रू.</CurrencySymbol> + <BankSymbol>INR</BankSymbol> + <CurrencyName>रुपया</CurrencyName> + <DecimalPlaces>2</DecimalPlaces> + </Currency> + </LC_CURRENCY> + <LC_TRANSLITERATION> + <Transliteration unoid="LOWERCASE_UPPERCASE"/> + <Transliteration unoid="UPPERCASE_LOWERCASE"/> + <Transliteration unoid="IGNORE_CASE"/> + </LC_TRANSLITERATION> + <LC_MISC> + <ReservedWords> + <trueWord>सही</trueWord> + <falseWord>गलत</falseWord> + <quarter1Word>पहिल तीन मास</quarter1Word> + <quarter2Word>दोसर तीन मास</quarter2Word> + <quarter3Word>तेसर तीन मास</quarter3Word> + <quarter4Word>चौथा तीन मास</quarter4Word> + <aboveWord>उप्पर</aboveWord> + <belowWord>नीच्चाँ</belowWord> + <quarter1Abbreviation>पहिल चौथाई</quarter1Abbreviation> + <quarter2Abbreviation>दोसर चौथाई</quarter2Abbreviation> + <quarter3Abbreviation>तेसर चौथाई</quarter3Abbreviation> + <quarter4Abbreviation>चौथा चौथाई</quarter4Abbreviation> + </ReservedWords> + </LC_MISC> + <LC_NumberingLevel> + <NumberingLevel NumType="4" Prefix=" " Suffix=")"/> + <NumberingLevel NumType="4" Prefix="(" Suffix="."/> + <NumberingLevel NumType="4" Prefix="(" Suffix=")"/> + <NumberingLevel NumType="2" Prefix=" " Suffix="."/> + <NumberingLevel NumType="0" Prefix=" " Suffix=")"/> + <NumberingLevel NumType="1" Prefix=" " Suffix=")"/> + <NumberingLevel NumType="1" Prefix="(" Suffix=")"/> + <NumberingLevel NumType="3" Prefix=" " Suffix="."/> + </LC_NumberingLevel> + <LC_OutLineNumberingLevel ref="en_US"/> +</Locale> +<!--Version 1.0 --> diff --git a/i18npool/source/localedata/data/makefile.mk b/i18npool/source/localedata/data/makefile.mk index 2591b70fb63d..1ac16a31fe37 100644 --- a/i18npool/source/localedata/data/makefile.mk +++ b/i18npool/source/localedata/data/makefile.mk @@ -68,6 +68,7 @@ MY_MISC_CXXFILES = \ $(MISC)$/localedata_af_ZA.cxx \ $(MISC)$/localedata_ak_GH.cxx \ $(MISC)$/localedata_am_ET.cxx \ + $(MISC)$/localedata_ar_DZ.cxx \ $(MISC)$/localedata_ar_EG.cxx \ $(MISC)$/localedata_ar_LB.cxx \ $(MISC)$/localedata_ar_SA.cxx \ @@ -176,6 +177,7 @@ MY_MISC_CXXFILES = \ $(MISC)$/localedata_lt_LT.cxx \ $(MISC)$/localedata_ltg_LV.cxx \ $(MISC)$/localedata_lv_LV.cxx \ + $(MISC)$/localedata_mai_IN.cxx \ $(MISC)$/localedata_mk_MK.cxx \ $(MISC)$/localedata_ml_IN.cxx \ $(MISC)$/localedata_mn_MN.cxx \ @@ -200,6 +202,7 @@ MY_MISC_CXXFILES = \ $(MISC)$/localedata_pt_BR.cxx \ $(MISC)$/localedata_pt_PT.cxx \ $(MISC)$/localedata_ro_RO.cxx \ + $(MISC)$/localedata_rue_SK.cxx \ $(MISC)$/localedata_ru_RU.cxx \ $(MISC)$/localedata_rw_RW.cxx \ $(MISC)$/localedata_sg_CF.cxx \ @@ -378,8 +381,9 @@ SHL3OBJS= \ $(SLO)$/localedata_pl_PL.obj \ $(SLO)$/localedata_pt_BR.obj \ $(SLO)$/localedata_pt_PT.obj \ - $(SLO)$/localedata_ru_RU.obj \ $(SLO)$/localedata_ro_RO.obj \ + $(SLO)$/localedata_rue_SK.obj \ + $(SLO)$/localedata_ru_RU.obj \ $(SLO)$/localedata_sc_IT.obj \ $(SLO)$/localedata_sh_ME.obj \ $(SLO)$/localedata_sh_RS.obj \ @@ -416,6 +420,7 @@ SHL4OBJS= \ $(SLO)$/localedata_af_ZA.obj \ $(SLO)$/localedata_ak_GH.obj \ $(SLO)$/localedata_am_ET.obj \ + $(SLO)$/localedata_ar_DZ.obj \ $(SLO)$/localedata_ar_EG.obj \ $(SLO)$/localedata_ar_LB.obj \ $(SLO)$/localedata_ar_OM.obj \ @@ -449,6 +454,7 @@ SHL4OBJS= \ $(SLO)$/localedata_lg_UG.obj \ $(SLO)$/localedata_ln_CD.obj \ $(SLO)$/localedata_lo_LA.obj \ + $(SLO)$/localedata_mai_IN.obj \ $(SLO)$/localedata_ml_IN.obj \ $(SLO)$/localedata_mn_MN.obj \ $(SLO)$/localedata_mr_IN.obj \ diff --git a/i18npool/source/localedata/data/rue_SK.xml b/i18npool/source/localedata/data/rue_SK.xml new file mode 100644 index 000000000000..86b22d5c5a2e --- /dev/null +++ b/i18npool/source/localedata/data/rue_SK.xml @@ -0,0 +1,359 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE Locale SYSTEM 'locale.dtd'> +<Locale versionDTD="2.0.3" allowUpdateFromCLDR="no" version="1.0"> + <LC_INFO> + <Language> + <LangID>rue</LangID> + <DefaultName>Rusyn</DefaultName> + </Language> + <Country> + <CountryID>SK</CountryID> + <DefaultName>Slovakia</DefaultName> + </Country> + </LC_INFO> + <LC_CTYPE unoid="generic"> + <Separators> + <DateSeparator>/</DateSeparator> + <ThousandSeparator>,</ThousandSeparator> + <DecimalSeparator>.</DecimalSeparator> + <TimeSeparator>:</TimeSeparator> + <Time100SecSeparator>.</Time100SecSeparator> + <ListSeparator>;</ListSeparator> + <LongDateDayOfWeekSeparator>, </LongDateDayOfWeekSeparator> + <LongDateDaySeparator>, </LongDateDaySeparator> + <LongDateMonthSeparator> </LongDateMonthSeparator> + <LongDateYearSeparator> </LongDateYearSeparator> + </Separators> + <Markers> + <QuotationStart>“</QuotationStart> + <QuotationEnd>”</QuotationEnd> + <DoubleQuotationStart>‘</DoubleQuotationStart> + <DoubleQuotationEnd>’</DoubleQuotationEnd> + </Markers> + <TimeAM>дообіду</TimeAM> + <TimePM>пообідї</TimePM> + <MeasurementSystem>metric</MeasurementSystem> + </LC_CTYPE> + <LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$€-8256]"> + <FormatElement msgid="FixedFormatskey1" default="true" type="medium" usage="FIXED_NUMBER" formatindex="0"> + <FormatCode>General</FormatCode> + </FormatElement> + <FormatElement msgid="FixedFormatskey2" default="true" type="short" usage="FIXED_NUMBER" formatindex="1"> + <FormatCode>0</FormatCode> + </FormatElement> + <FormatElement msgid="FixedFormatskey3" default="false" type="medium" usage="FIXED_NUMBER" formatindex="2"> + <FormatCode>0.00</FormatCode> + </FormatElement> + <FormatElement msgid="FixedFormatskey4" default="false" type="short" usage="FIXED_NUMBER" formatindex="3"> + <FormatCode>#,##0</FormatCode> + </FormatElement> + <FormatElement msgid="FixedFormatskey5" default="false" type="medium" usage="FIXED_NUMBER" formatindex="4"> + <FormatCode>#,##0.00</FormatCode> + </FormatElement> + <FormatElement msgid="FixedFormatskey6" default="false" type="medium" usage="FIXED_NUMBER" formatindex="5"> + <FormatCode>#,###.00</FormatCode> + </FormatElement> + <FormatElement msgid="ScientificFormatskey1" default="true" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="6"> + <FormatCode>0.00E+00</FormatCode> + </FormatElement> + <FormatElement msgid="ScientificFormatskey2" default="false" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="7"> + <FormatCode>0.00E+000</FormatCode> + </FormatElement> + <FormatElement msgid="PercentFormatskey1" default="true" type="short" usage="PERCENT_NUMBER" formatindex="8"> + <FormatCode>0%</FormatCode> + </FormatElement> + <FormatElement msgid="PercentFormatskey2" default="true" type="long" usage="PERCENT_NUMBER" formatindex="9"> + <FormatCode>0.00%</FormatCode> + </FormatElement> + <FormatElement msgid="CurrencyFormatskey1" default="true" type="short" usage="CURRENCY" formatindex="12"> + <FormatCode>[CURRENCY]#,##0;-[CURRENCY]#,##0</FormatCode> + </FormatElement> + <FormatElement msgid="CurrencyFormatskey2" default="false" type="medium" usage="CURRENCY" formatindex="13"> + <FormatCode>[CURRENCY]#,##0.00;-[CURRENCY]#,##0.00</FormatCode> + </FormatElement> + <FormatElement msgid="CurrencyFormatskey3" default="false" type="medium" usage="CURRENCY" formatindex="14"> + <FormatCode>[CURRENCY]#,##0;[RED]-[CURRENCY]#,##0</FormatCode> + </FormatElement> + <FormatElement msgid="CurrencyFormatskey4" default="true" type="medium" usage="CURRENCY" formatindex="15"> + <FormatCode>[CURRENCY]#,##0.00;[RED]-[CURRENCY]#,##0.00</FormatCode> + </FormatElement> + <FormatElement msgid="CurrencyFormatskey5" default="false" type="medium" usage="CURRENCY" formatindex="16"> + <FormatCode>CCC#,##0.00</FormatCode> + </FormatElement> + <FormatElement msgid="CurrencyFormatskey6" default="false" type="medium" usage="CURRENCY" formatindex="17"> + <FormatCode>[CURRENCY]#,##0.--;[RED]-[CURRENCY]#,##0.--</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey11" default="true" type="short" usage="DATE" formatindex="18"> + <FormatCode>D/MM/YY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey14" default="true" type="long" usage="DATE" formatindex="19"> + <FormatCode>NNNNDD, MMMM YYYY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey6" default="true" type="medium" usage="DATE" formatindex="20"> + <FormatCode>DD/MM/YY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey5" default="false" type="medium" usage="DATE" formatindex="21"> + <FormatCode>DD/MM/YYYY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey15" default="false" type="long" usage="DATE" formatindex="22"> + <FormatCode>D, MMM YY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey16" default="false" type="long" usage="DATE" formatindex="23"> + <FormatCode>D, MMM YYYY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey21" default="false" type="long" usage="DATE" formatindex="24"> + <FormatCode>D, MMM YYYY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey17" default="false" type="long" usage="DATE" formatindex="25"> + <FormatCode>D, MMMM YYYY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey22" default="false" type="long" usage="DATE" formatindex="26"> + <FormatCode>D, MMMM YY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey10" default="false" type="medium" usage="DATE" formatindex="27"> + <FormatCode>NN, DD/MMM/YY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey18" default="false" type="long" usage="DATE" formatindex="28"> + <FormatCode>NN, D, MMM YY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey19" default="false" type="long" usage="DATE" formatindex="29"> + <FormatCode>NN, D, MMMM YYYY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey20" default="false" type="long" usage="DATE" formatindex="30"> + <FormatCode>NNNND, MMMM YYYY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey12" default="false" type="short" usage="DATE" formatindex="31"> + <FormatCode>MM/DD</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey7" default="false" type="medium" usage="DATE" formatindex="32"> + <FormatCode>YY-MM-DD</FormatCode> + <DefaultName>ISO 8601</DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey8" default="false" type="medium" usage="DATE" formatindex="33"> + <FormatCode>YYYY-MM-DD</FormatCode> + <DefaultName>ISO 8601</DefaultName> + </FormatElement> + <FormatElement msgid="DateFormatskey1" default="false" type="medium" usage="DATE" formatindex="34"> + <FormatCode>MM/YY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey2" default="false" type="medium" usage="DATE" formatindex="35"> + <FormatCode>MMM/DD</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey3" default="false" type="medium" usage="DATE" formatindex="36"> + <FormatCode>MMMM</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey4" default="false" type="medium" usage="DATE" formatindex="37"> + <FormatCode>QQ YY</FormatCode> + </FormatElement> + <FormatElement msgid="DateFormatskey9" default="false" type="medium" usage="DATE" formatindex="38"> + <FormatCode>WW</FormatCode> + </FormatElement> + <FormatElement msgid="TimeFormatskey1" default="false" type="short" usage="TIME" formatindex="39"> + <FormatCode>HH:MM</FormatCode> + </FormatElement> + <FormatElement msgid="TimeFormatskey2" default="false" type="medium" usage="TIME" formatindex="40"> + <FormatCode>HH:MM:SS</FormatCode> + </FormatElement> + <FormatElement msgid="TimeFormatskey3" default="true" type="short" usage="TIME" formatindex="41"> + <FormatCode>HH:MM AM/PM</FormatCode> + </FormatElement> + <FormatElement msgid="TimeFormatskey4" default="true" type="medium" usage="TIME" formatindex="42"> + <FormatCode>HH:MM:SS AM/PM</FormatCode> + </FormatElement> + <FormatElement msgid="TimeFormatskey5" default="false" type="medium" usage="TIME" formatindex="43"> + <FormatCode>[HH]:MM:SS</FormatCode> + </FormatElement> + <FormatElement msgid="TimeFormatskey6" default="false" type="short" usage="TIME" formatindex="44"> + <FormatCode>MM:SS.00</FormatCode> + </FormatElement> + <FormatElement msgid="TimeFormatskey7" default="false" type="medium" usage="TIME" formatindex="45"> + <FormatCode>[HH]:MM:SS.00</FormatCode> + </FormatElement> + <FormatElement msgid="DateTimeFormatskey1" default="true" type="medium" usage="DATE_TIME" formatindex="46"> + <FormatCode>DD/MM/YY HH:MM</FormatCode> + </FormatElement> + <FormatElement msgid="DateTimeFormatskey2" default="false" type="medium" usage="DATE_TIME" formatindex="47"> + <FormatCode>DD/MM/YYYY HH:MM:SS AM/PM</FormatCode> + </FormatElement> + </LC_FORMAT> + <LC_COLLATION> + <Collator default="true" unoid="alphanumeric"/> + <CollationOptions> + <TransliterationModules>IGNORE_CASE</TransliterationModules> + </CollationOptions> + </LC_COLLATION> + <LC_SEARCH> + <SearchOptions> + <TransliterationModules>IGNORE_CASE</TransliterationModules> + </SearchOptions> + </LC_SEARCH> + <LC_INDEX> + <IndexKey phonetic="false" default="true" unoid="alphanumeric">A-Z</IndexKey> + <UnicodeScript>0</UnicodeScript> + <UnicodeScript>1</UnicodeScript> + <UnicodeScript>8</UnicodeScript> + <FollowPageWord>стр.</FollowPageWord> + <FollowPageWord>стр.</FollowPageWord> + </LC_INDEX> + <LC_CALENDAR> + <Calendar unoid="gregorian" default="true"> + <DaysOfWeek> + <Day> + <DayID>sun</DayID> + <DefaultAbbrvName>нед</DefaultAbbrvName> + <DefaultFullName>недїля</DefaultFullName> + </Day> + <Day> + <DayID>mon</DayID> + <DefaultAbbrvName>пон</DefaultAbbrvName> + <DefaultFullName>понедїлёк</DefaultFullName> + </Day> + <Day> + <DayID>tue</DayID> + <DefaultAbbrvName>віт</DefaultAbbrvName> + <DefaultFullName>віторок</DefaultFullName> + </Day> + <Day> + <DayID>wed</DayID> + <DefaultAbbrvName>сер</DefaultAbbrvName> + <DefaultFullName>середа</DefaultFullName> + </Day> + <Day> + <DayID>thu</DayID> + <DefaultAbbrvName>чет</DefaultAbbrvName> + <DefaultFullName>четверь</DefaultFullName> + </Day> + <Day> + <DayID>fri</DayID> + <DefaultAbbrvName>пят</DefaultAbbrvName> + <DefaultFullName>пятніця</DefaultFullName> + </Day> + <Day> + <DayID>sat</DayID> + <DefaultAbbrvName>суб</DefaultAbbrvName> + <DefaultFullName>субота</DefaultFullName> + </Day> + </DaysOfWeek> + <MonthsOfYear> + <Month> + <MonthID>jan</MonthID> + <DefaultAbbrvName>ян</DefaultAbbrvName> + <DefaultFullName>януар</DefaultFullName> + </Month> + <Month> + <MonthID>feb</MonthID> + <DefaultAbbrvName>феб</DefaultAbbrvName> + <DefaultFullName>фебруар</DefaultFullName> + </Month> + <Month> + <MonthID>mar</MonthID> + <DefaultAbbrvName>мар</DefaultAbbrvName> + <DefaultFullName>марец</DefaultFullName> + </Month> + <Month> + <MonthID>apr</MonthID> + <DefaultAbbrvName>апр</DefaultAbbrvName> + <DefaultFullName>апріль</DefaultFullName> + </Month> + <Month> + <MonthID>may</MonthID> + <DefaultAbbrvName>май</DefaultAbbrvName> + <DefaultFullName>май</DefaultFullName> + </Month> + <Month> + <MonthID>jun</MonthID> + <DefaultAbbrvName>юн</DefaultAbbrvName> + <DefaultFullName>юн</DefaultFullName> + </Month> + <Month> + <MonthID>jul</MonthID> + <DefaultAbbrvName>юл</DefaultAbbrvName> + <DefaultFullName>юл</DefaultFullName> + </Month> + <Month> + <MonthID>aug</MonthID> + <DefaultAbbrvName>авґ</DefaultAbbrvName> + <DefaultFullName>авґуст</DefaultFullName> + </Month> + <Month> + <MonthID>sep</MonthID> + <DefaultAbbrvName>сеп</DefaultAbbrvName> + <DefaultFullName>септембер</DefaultFullName> + </Month> + <Month> + <MonthID>oct</MonthID> + <DefaultAbbrvName>окт</DefaultAbbrvName> + <DefaultFullName>октобер</DefaultFullName> + </Month> + <Month> + <MonthID>nov</MonthID> + <DefaultAbbrvName>нов</DefaultAbbrvName> + <DefaultFullName>новембер</DefaultFullName> + </Month> + <Month> + <MonthID>dec</MonthID> + <DefaultAbbrvName>дец</DefaultAbbrvName> + <DefaultFullName>децембер</DefaultFullName> + </Month> + </MonthsOfYear> + <Eras> + <Era> + <EraID>bc</EraID> + <DefaultAbbrvName>п.н.е.</DefaultAbbrvName> + <DefaultFullName>перед нашов еров</DefaultFullName> + </Era> + <Era> + <EraID>ad</EraID> + <DefaultAbbrvName>н.е.</DefaultAbbrvName> + <DefaultFullName>нашой еры</DefaultFullName> + </Era> + </Eras> + <StartDayOfWeek> + <DayID>mon</DayID> + </StartDayOfWeek> + <MinimalDaysInFirstWeek>1</MinimalDaysInFirstWeek> + </Calendar> + </LC_CALENDAR> + <LC_CURRENCY> + <Currency default="true" usedInCompatibleFormatCodes="true"> + <CurrencyID>EUR</CurrencyID> + <CurrencySymbol>€</CurrencySymbol> + <BankSymbol>EUR</BankSymbol> + <CurrencyName>евро</CurrencyName> + <DecimalPlaces>2</DecimalPlaces> + </Currency> + </LC_CURRENCY> + <LC_TRANSLITERATION> + <Transliteration unoid="LOWERCASE_UPPERCASE"/> + <Transliteration unoid="UPPERCASE_LOWERCASE"/> + <Transliteration unoid="IGNORE_CASE"/> + </LC_TRANSLITERATION> + <LC_MISC> + <ReservedWords> + <trueWord>Правда</trueWord> + <falseWord>Неправда</falseWord> + <quarter1Word>1. четвертина</quarter1Word> + <quarter2Word>2. четвертина</quarter2Word> + <quarter3Word>3. четвертина</quarter3Word> + <quarter4Word>4. четвертина</quarter4Word> + <aboveWord>Над</aboveWord> + <belowWord>Під</belowWord> + <quarter1Abbreviation>1.чет.</quarter1Abbreviation> + <quarter2Abbreviation>2.чет.</quarter2Abbreviation> + <quarter3Abbreviation>3.чет.</quarter3Abbreviation> + <quarter4Abbreviation>4.чет.</quarter4Abbreviation> + </ReservedWords> + </LC_MISC> + <LC_NumberingLevel> + <NumberingLevel NumType="4" Prefix=" " Suffix=")"/> + <NumberingLevel NumType="4" Prefix=" " Suffix="."/> + <NumberingLevel NumType="4" Prefix="(" Suffix=")"/> + <NumberingLevel NumType="2" Prefix=" " Suffix="."/> + <NumberingLevel NumType="0" Prefix=" " Suffix=")"/> + <NumberingLevel NumType="1" Prefix=" " Suffix=")"/> + <NumberingLevel NumType="1" Prefix="(" Suffix=")"/> + <NumberingLevel NumType="3" Prefix=" " Suffix="."/> + </LC_NumberingLevel> + <LC_OutLineNumberingLevel ref="en_US"/> +</Locale> +<!--Version 1.0 --> diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx index 920a63fe149a..34f4f6bbb520 100644 --- a/i18npool/source/localedata/localedata.cxx +++ b/i18npool/source/localedata/localedata.cxx @@ -169,6 +169,7 @@ static const struct { { "ast_ES", lcl_DATA_EURO }, { "ltg_LV", lcl_DATA_EURO }, { "hsb_DE", lcl_DATA_EURO }, + { "rue_SK", lcl_DATA_EURO }, { "ja_JP", lcl_DATA_OTHERS }, { "ko_KR", lcl_DATA_OTHERS }, @@ -179,6 +180,7 @@ static const struct { { "zh_MO", lcl_DATA_OTHERS }, { "ar_EG", lcl_DATA_OTHERS }, + { "ar_DZ", lcl_DATA_OTHERS }, { "ar_LB", lcl_DATA_OTHERS }, { "ar_SA", lcl_DATA_OTHERS }, { "ar_TN", lcl_DATA_OTHERS }, @@ -248,6 +250,7 @@ static const struct { { "ug_CN", lcl_DATA_OTHERS }, { "om_ET", lcl_DATA_OTHERS }, { "plt_MG", lcl_DATA_OTHERS }, + { "mai_IN", lcl_DATA_OTHERS }, }; static const sal_Unicode under = sal_Unicode('_'); diff --git a/i18npool/source/localedata/saxparser.cxx b/i18npool/source/localedata/saxparser.cxx index 083d2097a54a..9787b9c810a6 100644 --- a/i18npool/source/localedata/saxparser.cxx +++ b/i18npool/source/localedata/saxparser.cxx @@ -125,13 +125,14 @@ Reference< XInputStream > createStreamFromFile( if( f ) { fseek( f , 0 , SEEK_END ); - int nLength = ftell( f ); + size_t nLength = ftell( f ); fseek( f , 0 , SEEK_SET ); Sequence<sal_Int8> seqIn(nLength); - fread( seqIn.getArray() , nLength , 1 , f ); - - r = Reference< XInputStream > ( new OInputStream( seqIn ) ); + if (fread( seqIn.getArray() , nLength , 1 , f ) == 1) + r = Reference< XInputStream > ( new OInputStream( seqIn ) ); + else + fprintf(stderr, "failure reading %s\n", pcFile); fclose( f ); } return r; diff --git a/i18npool/source/paper/paper.cxx b/i18npool/source/paper/paper.cxx index 21be12588e37..e94efa6e06c5 100644 --- a/i18npool/source/paper/paper.cxx +++ b/i18npool/source/paper/paper.cxx @@ -436,8 +436,8 @@ Paper PaperInfo::fromPSName(const rtl::OString &rName) } //http://wiki.services.openoffice.org/wiki/DefaultPaperSize -//http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/localedata/locales/?cvsroot=glibc //http://www.unicode.org/cldr/data/charts/supplemental/territory_language_information.html +//http://sourceware.org/git/?p=glibc.git;a=tree;f=localedata/locales //http://en.wikipedia.org/wiki/Paper_size //http://msdn.microsoft.com/en-us/library/cc195164.aspx PaperInfo PaperInfo::getDefaultPaperForLocale( @@ -448,22 +448,57 @@ PaperInfo PaperInfo::getDefaultPaperForLocale( if ( //United States, Letter !rLocale.Country.compareToAscii("US") || - //Puerto Rico, http://sources.redhat.com/ml/libc-hacker/2001-07/msg00046.html + //Puerto Rico: + // http://unicode.org/cldr/trac/ticket/1710 + // http://sources.redhat.com/ml/libc-hacker/2001-07/msg00046.html !rLocale.Country.compareToAscii("PR") || - //Canada, http://sources.redhat.com/ml/libc-hacker/2001-07/msg00053.html + //Canada: + // http://sources.redhat.com/ml/libc-hacker/2001-07/msg00053.html !rLocale.Country.compareToAscii("CA") || - //Venuzuela, https://www.redhat.com/archives/fedora-devel-list/2008-August/msg00019.html + //Venuzuela: + // http://unicode.org/cldr/trac/ticket/1710 + // https://www.redhat.com/archives/fedora-devel-list/2008-August/msg00019.html !rLocale.Country.compareToAscii("VE") || - //Chile, https://www.redhat.com/archives/fedora-devel-list/2008-August/msg00240.html + //Chile: + // http://unicode.org/cldr/trac/ticket/1710 + // https://www.redhat.com/archives/fedora-devel-list/2008-August/msg00240.html !rLocale.Country.compareToAscii("CL") || - //Mexico, http://qa.openoffice.org/issues/show_bug.cgi?id=49739 + //Mexico: + // http://unicode.org/cldr/trac/ticket/1710 + // http://qa.openoffice.org/issues/show_bug.cgi?id=49739 !rLocale.Country.compareToAscii("MX") || - //Colombia, http://qa.openoffice.org/issues/show_bug.cgi?id=69703 + //Colombia: + // http://unicode.org/cldr/trac/ticket/1710 + // http://qa.openoffice.org/issues/show_bug.cgi?id=69703 !rLocale.Country.compareToAscii("CO") || - //Philippines, + //Philippines: + // http://unicode.org/cldr/trac/ticket/1710 // http://ubuntuliving.blogspot.com/2008/07/default-paper-size-in-evince.html // http://www.gov.ph/faqs/driverslicense.asp - !rLocale.Country.compareToAscii("PH") + !rLocale.Country.compareToAscii("PH") || + //Belize: + // http://unicode.org/cldr/trac/ticket/2585 + // http://www.belize.gov.bz/ct.asp?xItem=1666&ctNode=486&mp=27 + !rLocale.Country.compareToAscii("BZ") || + //Costa Rica: + // http://unicode.org/cldr/trac/ticket/2585 + // http://sources.redhat.com/bugzilla/show_bug.cgi?id=11258 + !rLocale.Country.compareToAscii("CR") || + //Guatemala: + // http://unicode.org/cldr/trac/ticket/2585 + // http://sources.redhat.com/bugzilla/show_bug.cgi?id=10936 + !rLocale.Country.compareToAscii("GT") || + //Nicaragua: + // http://unicode.org/cldr/trac/ticket/2585 + !rLocale.Country.compareToAscii("NI") || + //Panama: + // http://unicode.org/cldr/trac/ticket/2585 + // http://www.minsa.gob.pa/minsa/tl_files/documents/baner_informativo/INSTRUMENTO%20DE%20INVESTIGACION%20DE%20RAAV%202009.pdf + !rLocale.Country.compareToAscii("PA") || + //El Salvador: + // http://unicode.org/cldr/trac/ticket/2585 + // http://www.tse.gob.sv + !rLocale.Country.compareToAscii("SV") ) { eType = PAPER_LETTER; diff --git a/l10ntools/java/jpropex/java/JPropEx.java b/l10ntools/java/jpropex/java/JPropEx.java index d0f72d627aaf..224bed783cf6 100644 --- a/l10ntools/java/jpropex/java/JPropEx.java +++ b/l10ntools/java/jpropex/java/JPropEx.java @@ -43,7 +43,10 @@ public class JPropEx private boolean isQuiet = false; private final String resourceType = "javaproperties"; private final String sourceLanguage = "en-US"; - //private SdfData data; + + static final int JAVA_TYPE = 0; + static final int JAVA_ENUS_TYPE = 1; + static final int EXTENSION_TYPE = 2; public JPropEx() { @@ -178,6 +181,7 @@ public class JPropEx private void mergeFile( String filename , SdfData data , boolean isSingleFile ) { + int type = detectFormat( filename ); java.util.Properties sourceProp = loadProp( filename ); Vector langs = getLanguages( data ); HashMap props = new HashMap(); @@ -209,7 +213,7 @@ public class JPropEx mergedEntity = data.get( curEntity ); if( mergedEntity == null ) { - // if case there is not translation the fallback to the en-US source string + // in case there is no translation then fallback to the en-US source string ( (java.util.Properties) props.get( curLang )).setProperty( curEntity.getLid() , sourceString ); } else @@ -225,10 +229,10 @@ public class JPropEx for( Iterator i = props.keySet().iterator() ; i.hasNext() ; ) { lang = (String) i.next(); - writeSinglePropertiesFile( filename , (java.util.Properties) props.get( lang ) , lang , isSingleFile ); + writeSinglePropertiesFile( filename , (java.util.Properties) props.get( lang ) , lang , isSingleFile , type ); } } - private void writeSinglePropertiesFile( String filename , java.util.Properties prop , String lang , boolean isSingleFile ) + private void writeSinglePropertiesFile( String filename , java.util.Properties prop , String lang , boolean isSingleFile , int type ) { // Prepare path to file int filenameIdx = filename.lastIndexOf( "/" ) > 0 ? filename.lastIndexOf( "/" )+1 : 0 ; @@ -240,24 +244,21 @@ public class JPropEx if( pathPrefixArg != null && pathPrefixArg.length()>0 && pathPostfixArg != null && pathPostfixArg.length()>0 ) { path = new StringBuffer().append( pathPrefixArg ).append( "/" ).append( lcLang ).append( "/" ).append( pathPostfixArg ).append( "/" ).toString(); - name = new StringBuffer().append( filename.substring( filenameIdx , filename.lastIndexOf( ".properties" ) ) ) - .append( "_" ).append( lcLang.replaceAll("-","_") ).append( ".properties" ).toString(); + name += formatFilename( filename , filenameIdx , lang , type ); } //use of -i <one_filename> else if( !isSingleFile && outputFileArg != null && outputFileArg.length()>0 ) { - name = outputFileArg; - name += new StringBuffer().append( filename.substring( filenameIdx , filename.lastIndexOf( ".properties" ) ) ) - .append( "_" ).append( lcLang.replaceAll("-","_") ).append( ".properties" ).toString(); //name = outputFileArg; + path = outputFileArg; + name += formatFilename( filename , filenameIdx , lang , type ); } //use of -i @<file_containing_many_filenames> else if( isSingleFile && outputFileArg != null && outputFileArg.length()>0 ) { - name = outputFileArg; - name += new StringBuffer().append( inputFileArg.substring( filenameIdx , filename.lastIndexOf( ".properties" ) ) ) - .append( "_" ).append( lcLang.replaceAll("-","_") ).append( ".properties" ).toString(); //name = outputFileArg; + path = outputFileArg; + name += formatFilename( filename , filenameIdx , lang , type ); } else { @@ -284,7 +285,7 @@ public class JPropEx } path += name; // Write the properties file - System.out.println("DBG: Writing to "+path); + //System.out.println("DBG: Writing to "+path); try{ BufferedOutputStream out = new BufferedOutputStream( new FileOutputStream( path ) ); if( prop == null ) @@ -298,6 +299,75 @@ public class JPropEx } } + // we have different types of properties in the source code + // each needs a different file nameing scheme + private int detectFormat( String filename ) + { + if( filename.endsWith( "_en_US.properties" ) ) + return EXTENSION_TYPE; + else if( filename.endsWith("_en_us.properties" ) ) + return JAVA_ENUS_TYPE; + else if( filename.endsWith( ".properties" ) ) + return JAVA_TYPE; + + // Can not detect, exit + System.err.println("ERROR: Invalid file name. Only allowed (case sensitive!) *_en_US.properties , *_en_us.properties or *.properties\n"); + System.exit(-1); + return JAVA_TYPE; // dummy + } + + private String formatFilename( String filename , int filenameIdx , String lang , int type ) + { + + if( !lang.equals( "en-US" ) ) + { + // Parse iso code + int pos = lang.indexOf("-"); + String langpart1 = new String(); + String langpart2 = new String(); + if( pos == -1 ) + { + langpart1 = lang; + } + else if( pos > 0 ) + { + langpart1 = lang.substring( 0 , pos ); + langpart2 = lang.substring( pos+1 , lang.length() ); + } + // change filename according to the type + switch( type ) + { + // -> de_DE + case EXTENSION_TYPE: + lang = langpart1.toLowerCase(); + if( langpart2.length() > 0 ) // -> en_US + lang += "_" + langpart2.toUpperCase(); + else // -> de_DE + lang += "_" + langpart1.toUpperCase(); + return new StringBuffer().append( filename.substring( filenameIdx , filename.lastIndexOf( "_en_US.properties" ) ) ) + .append( "_" ).append( lang.replaceAll("-","_") ).append( ".properties" ).toString(); + // -> de + case JAVA_ENUS_TYPE: + lang = langpart1.toLowerCase(); + if( langpart2.length() > 0 ) + lang += "_" + langpart2.toLowerCase(); + return new StringBuffer().append( filename.substring( filenameIdx , filename.lastIndexOf( "_en_us.properties" ) ) ) + .append( "_" ).append( lang.replaceAll("-","_") ).append( ".properties" ).toString(); + // -> de + case JAVA_TYPE: + lang = langpart1.toLowerCase(); + if( langpart2.length() > 0 ) + lang += "_" + langpart2.toLowerCase(); + return new StringBuffer().append( filename.substring( filenameIdx , filename.lastIndexOf( ".properties" ) ) ) + .append( "_" ).append( lang.replaceAll("-","_") ).append( ".properties" ).toString(); + default: + System.err.println("ERROR: Something is really broken here, l10ntools/java/jprop/java/JPropEx.java :: formatFilename()"); + System.exit( -1 ); + break; + } + } + return filename; // don't change en-US source file name + } private SdfData getSdfData() { SdfData data = new SdfData( inputSdfFileArg ); diff --git a/l10ntools/java/jpropex/java/NoLocalizeFilter.java b/l10ntools/java/jpropex/java/NoLocalizeFilter.java index 3bfa53df2296..989ee64bfc86 100644 --- a/l10ntools/java/jpropex/java/NoLocalizeFilter.java +++ b/l10ntools/java/jpropex/java/NoLocalizeFilter.java @@ -44,9 +44,7 @@ public class NoLocalizeFilter extends FilterInputStream String search = new String( b ); Matcher m = p.matcher( search ); if( m.find() ) - //if( search.contains("x-no-translate" ) ) // TODO: fixme! { - System.out.println("found x-no-translate"); in.close(); close(); System.exit( 0 ); diff --git a/l10ntools/java/jpropex/java/SdfData.java b/l10ntools/java/jpropex/java/SdfData.java index 80b8ea890f26..6f79909df1b2 100644 --- a/l10ntools/java/jpropex/java/SdfData.java +++ b/l10ntools/java/jpropex/java/SdfData.java @@ -84,8 +84,7 @@ public class SdfData } catch( IOException e ) { - System.out.println("Error: reading file " + filename); - System.exit( -1 ); + System.out.println("Warning: can not read file " + filename); } } public void write( String filename ) diff --git a/l10ntools/source/export2.cxx b/l10ntools/source/export2.cxx index 8a384b415b6f..fc8f823b7deb 100644 --- a/l10ntools/source/export2.cxx +++ b/l10ntools/source/export2.cxx @@ -703,11 +703,6 @@ void Export::getRandomName( ByteString& sRandStr ) DirEntry Export::GetTempFile() /*****************************************************************************/ { -#if defined(WNT) || defined(OS2) - String sTempDir( Export::GetEnv( "TEMP" ), RTL_TEXTENCODING_ASCII_US ); -#else - String sTempDir( String::CreateFromAscii( "/tmp" )); -#endif rtl::OUString* sTempFilename = new rtl::OUString(); // Create a temp file diff --git a/l10ntools/source/help/HelpLinker.cxx b/l10ntools/source/help/HelpLinker.cxx index 9eed9132a5ec..94139f89de1e 100644 --- a/l10ntools/source/help/HelpLinker.cxx +++ b/l10ntools/source/help/HelpLinker.cxx @@ -245,7 +245,11 @@ class HelpLinker { public: void main(std::vector<std::string> &args, - std::string* pExtensionPath = NULL, const rtl::OUString* pOfficeHelpPath = NULL ) +// std::string* pExtensionPath = NULL, const rtl::OUString* pOfficeHelpPath = NULL ) + std::string* pExtensionPath = NULL, + std::string* pDestination = NULL, + const rtl::OUString* pOfficeHelpPath = NULL ) + throw( HelpProcessingException ); HelpLinker() @@ -269,6 +273,7 @@ private: std::string lang; std::string hid; std::string extensionPath; + std::string extensionDestination; bool bExtensionMode; fs::path indexDirName; Stringtable hidlistTranslation; @@ -396,7 +401,8 @@ void HelpLinker::link() throw( HelpProcessingException ) if( bExtensionMode ) { - indexDirParentName = sourceRoot; + //indexDirParentName = sourceRoot; + indexDirParentName = extensionDestination; } else { @@ -752,8 +758,9 @@ void HelpLinker::link() throw( HelpProcessingException ) void HelpLinker::main( std::vector<std::string> &args, - std::string* pExtensionPath, const rtl::OUString* pOfficeHelpPath ) - throw( HelpProcessingException ) + std::string* pExtensionPath, std::string* pDestination, + const rtl::OUString* pOfficeHelpPath ) + throw( HelpProcessingException ) { rtl::OUString aOfficeHelpPath; @@ -764,7 +771,7 @@ void HelpLinker::main( std::vector<std::string> &args, bExtensionMode = true; extensionPath = *pExtensionPath; sourceRoot = fs::path(extensionPath); - + extensionDestination = *pDestination; aOfficeHelpPath = *pOfficeHelpPath; } if (args.size() > 0 && args[0][0] == '@') @@ -1069,6 +1076,7 @@ HELPLINKER_DLLPUBLIC bool compileExtensionHelp const rtl::OUString& aExtensionName, const rtl::OUString& aExtensionLanguageRoot, sal_Int32 nXhpFileCount, const rtl::OUString* pXhpFiles, + const rtl::OUString& aDestination, HelpProcessingErrorInfo& o_rHelpProcessingErrorInfo ) { @@ -1102,13 +1110,16 @@ HELPLINKER_DLLPUBLIC bool compileExtensionHelp rtl::OString aOExtensionLanguageRoot = rtl::OUStringToOString( aExtensionLanguageRoot, fs::getThreadTextEncoding() ); const char* pExtensionPath = aOExtensionLanguageRoot.getStr(); std::string aStdStrExtensionPath = pExtensionPath; + rtl::OString aODestination = rtl::OUStringToOString(aDestination, fs::getThreadTextEncoding()); + const char* pDestination = aODestination.getStr(); + std::string aStdStrDestination = pDestination; // Set error handler xmlSetStructuredErrorFunc( NULL, (xmlStructuredErrorFunc)StructuredXMLErrorFunction ); try { HelpLinker* pHelpLinker = new HelpLinker(); - pHelpLinker->main( args, &aStdStrExtensionPath, &aOfficeHelpPath ); + pHelpLinker->main( args, &aStdStrExtensionPath, &aStdStrDestination, &aOfficeHelpPath ); delete pHelpLinker; } catch( const HelpProcessingException& e ) diff --git a/l10ntools/source/help/compilehelp.hxx b/l10ntools/source/help/compilehelp.hxx index 472b15231639..9c59083bf038 100644 --- a/l10ntools/source/help/compilehelp.hxx +++ b/l10ntools/source/help/compilehelp.hxx @@ -72,6 +72,7 @@ HELPLINKER_DLLPUBLIC bool compileExtensionHelp const rtl::OUString& aExtensionName, const rtl::OUString& aExtensionLanguageRoot, sal_Int32 nXhpFileCount, const rtl::OUString* pXhpFiles, + const rtl::OUString& aDestination, HelpProcessingErrorInfo& o_rHelpProcessingErrorInfo ); diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index 1d1428ff2dc0..6cecb0972cb7 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -66,7 +66,7 @@ const char *ExeTable[][5] = { { "xcs", "cfgex", "-UTF8 -e -f", "negative", "iso" }, { "xrm", "xrmex", "-UTF8 -e", "negative", "iso" }, { "xhp", "helpex", " -e", "negative", "noiso" }, - //{ "properties", "jpropex", " -e", "negative", "noiso" }, + { "properties", "jpropex", " -e", "negative", "noiso" }, { "NULL", "NULL", "NULL", "NULL", "NULL" } }; diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx index e15a5c8a28fa..eb68215c791e 100644 --- a/l10ntools/source/merge.cxx +++ b/l10ntools/source/merge.cxx @@ -351,7 +351,7 @@ MergeData *MergeDataFile::GetMergeData( ResData *pResData , bool bCaseSensitive sLID = pResData->sId; pResData->sGId = sGID; pResData->sId = sLID; - + //printf("MergeData:: Search gid=%s lid=%s filename=%s \n", pResData->sGId.GetBuffer(),pResData->sId.GetBuffer(),pResData->sFilename.GetBuffer() ); ByteString sKey = CreateKey( pResData->sResTyp , pResData->sGId , pResData->sId , pResData->sFilename , bCaseSensitive ); //printf("DBG: Searching [%s]\n",sKey.GetBuffer()); @@ -361,6 +361,7 @@ MergeData *MergeDataFile::GetMergeData( ResData *pResData , bool bCaseSensitive //printf("DBG: Found[%s]\n",sKey.GetBuffer()); return aMap[ sKey ]; } + //Dump(); pResData->sGId = sOldG; pResData->sId = sOldL; //printf("DBG: Found[%s]\n",sKey.GetBuffer()); diff --git a/l10ntools/source/xrmlex.l b/l10ntools/source/xrmlex.l index c28aede4c6c1..4770a851c741 100644 --- a/l10ntools/source/xrmlex.l +++ b/l10ntools/source/xrmlex.l @@ -55,54 +55,55 @@ int bText=0; %% -"<Readme"[^\>]*\> { - WorkOnTokenSet( XRM_README_START, yytext ); +"<p "[^\>]*xml:lang[^\>]*\> { + WorkOnTokenSet( XRM_TEXT_START , yytext ); } -"</Readme>" { - WorkOnTokenSet( XRM_README_END, yytext ); +"</p>" { + WorkOnTokenSet( XRM_TEXT_END, yytext ); } -"<apochelp"[^\>]*\> { - WorkOnTokenSet( XRM_README_START, yytext ); +"<h1 "[^\>]*xml:lang[^\>]*\> { + WorkOnTokenSet( XRM_TEXT_START , yytext ); } -"</apochelp>" { - WorkOnTokenSet( XRM_README_END, yytext ); +"</h1>" { + WorkOnTokenSet( XRM_TEXT_END, yytext ); } - -"<Section"[^\>]*\> { - WorkOnTokenSet( XRM_SECTION_START, yytext ); +"<h2 "[^\>]*xml:lang[^\>]*\> { + WorkOnTokenSet( XRM_TEXT_START , yytext ); } -"</Section>" { - WorkOnTokenSet( XRM_SECTION_END, yytext ); +"</h2>" { + WorkOnTokenSet( XRM_TEXT_END, yytext ); } - -"<Paragraph"[^\>]*\> { - WorkOnTokenSet( XRM_PARAGRAPH_START, yytext ); +"<h3 "[^\>]*xml:lang[^\>]*\> { + WorkOnTokenSet( XRM_TEXT_START , yytext ); } -"</Paragraph>" { - WorkOnTokenSet( XRM_PARAGRAPH_END, yytext ); +"</h3>" { + WorkOnTokenSet( XRM_TEXT_END, yytext ); } - -"<Text"[^\>]*\> { - WorkOnTokenSet( XRM_TEXT_START, yytext ); +"<h4 "[^\>]*xml:lang[^\>]*\> { + WorkOnTokenSet( XRM_TEXT_START , yytext ); } -"</Text>" { +"</h4>" { WorkOnTokenSet( XRM_TEXT_END, yytext ); } - -"<List"[^\>]*\> { - WorkOnTokenSet( XRM_LIST_START, yytext ); +"<h5 "[^\>]*xml:lang[^\>]*\> { + WorkOnTokenSet( XRM_TEXT_START , yytext ); } -"</List>" { - WorkOnTokenSet( XRM_LIST_END, yytext ); +"</h5>" { + WorkOnTokenSet( XRM_TEXT_END, yytext ); } + + + + + "<!--" { char c1 = 0, c2 = 0, c3 = input(); char pChar[2]; diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx index 149fd560fe3b..b77f75ea04e5 100644 --- a/l10ntools/source/xrmmerge.cxx +++ b/l10ntools/source/xrmmerge.cxx @@ -268,7 +268,7 @@ extern FILE *GetXrmFile() int WorkOnTokenSet( int nTyp, char *pTokenText ) /*****************************************************************************/ { -// printf("Typ = %d , text = '%s'\n",nTyp , pTokenText ); + //printf("Typ = %d , text = '%s'\n",nTyp , pTokenText ); pParser->Execute( nTyp, pTokenText ); return 1; @@ -346,10 +346,10 @@ int XRMResParser::Execute( int nToken, char * pToken ) sLID = ""; sGID += "."; sGID += GetAttribute( rToken, "id" ); - if ( GetAttribute( rToken, "localized" ) == "false" ) +// if ( GetAttribute( rToken, "localized" ) == "false" ) // sLocalized += "0"; - sLocalized = false; - else +// sLocalized = false; +// else // sLocalized += "1"; sLocalized = true; break; @@ -368,47 +368,32 @@ int XRMResParser::Execute( int nToken, char * pToken ) } break; - case XRM_TEXT_START: -// if ( sLocalized.GetChar( sLocalized.Len() - 1 ) == '1' ) { - if ( sLocalized ) { - + case XRM_TEXT_START:{ + //printf("->XRM_TEXT_START\n"); ByteString sNewLID = GetAttribute( rToken, "id" ); if ( sNewLID != sLID ) { - EndOfText( sCurrentOpenTag, sCurrentCloseTag ); + //EndOfText( sCurrentOpenTag, sCurrentCloseTag ); sLID = sNewLID; } bText = TRUE; sCurrentText = ""; sCurrentOpenTag = rToken; Output( rToken ); + //printf("<-XRM_TEXT_START\n"); } break; case XRM_TEXT_END: { -// if ( sLocalized.GetChar( sLocalized.Len() - 1 ) == '1' ) { - if( sLocalized ){ sCurrentCloseTag = rToken; - + //printf("->XRM_TEXT_END\n"); ByteString sLang = GetAttribute( sCurrentOpenTag, "xml:lang" ); - if( sLang.EqualsIgnoreCaseAscii("de") ){ - ULONG nLen = 0; - while ( sCurrentText.Len() != nLen ) - { - nLen = sCurrentText.Len(); - sCurrentText.SearchAndReplaceAll( "\n\t", "\n" ); - sCurrentText.SearchAndReplaceAll( "\n ", "\n" ); - } - sCurrentText.SearchAndReplaceAll( "\n", " " ); - sCurrentCloseTag = rToken; - } WorkOnText( sCurrentOpenTag, sCurrentText ); Output( sCurrentText ); - - //fprintf( stdout, "%s %s\n", sGID.GetBuffer(), sLID.GetBuffer()); - //fprintf( stdout, "%s\n\n", sCurrentText.GetBuffer()); - + EndOfText( sCurrentOpenTag, sCurrentCloseTag );// <--- bText = FALSE; - } + rToken = ByteString(""); + sCurrentText = ByteString(""); + //printf("<-XRM_TEXT_END"); } break; @@ -429,8 +414,9 @@ int XRMResParser::Execute( int nToken, char * pToken ) } if ( !bText ) + { Output( rToken ); - + } return 0; } @@ -598,15 +584,19 @@ void XRMResExport::EndOfText( sCur = aLanguages[ n ]; ByteString sAct = pResData->sText[ sCur ]; - Export::UnquotHTML( sAct ); + //Export::UnquotHTML( sAct ); sAct.EraseAllChars( 0x0A ); ByteString sOutput( sPrj ); sOutput += "\t"; sOutput += sPath; sOutput += "\t0\t"; sOutput += "readmeitem\t"; - sOutput += pResData->sGId; sOutput += "\t"; - sOutput += pResData->sId; sOutput += "\t\t\t0\t"; + sOutput += pResData->sId; + // USE LID AS GID OR MERGE DON'T WORK + //sOutput += pResData->sGId; + sOutput += "\t"; + sOutput += pResData->sId; + sOutput += "\t\t\t0\t"; sOutput += sCur; sOutput += "\t"; @@ -615,7 +605,8 @@ void XRMResExport::EndOfText( sOutput.SearchAndReplaceAll( sSearch, "_" ); //if( !sCur.EqualsIgnoreCaseAscii("de") ||( sCur.EqualsIgnoreCaseAscii("de") && !Export::isMergingGermanAllowed( sPrj ) ) ) - pOutputStream->WriteLine( sOutput ); + if( sAct.Len() > 1 ) + pOutputStream->WriteLine( sOutput ); } } delete pResData; @@ -666,12 +657,14 @@ void XRMResMerge::WorkOnText( if ( pMergeDataFile ) { if ( !pResData ) { ByteString sPlatform( "" ); - pResData = new ResData( sPlatform, GetGID() , sFilename ); +// pResData = new ResData( sPlatform, GetGID() , sFilename ); + pResData = new ResData( sPlatform, GetLID() , sFilename ); pResData->sId = GetLID(); + pResData->sResTyp = "readmeitem"; } - PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrys( pResData ); + PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrys( pResData ); if ( pEntrys ) { ByteString sContent; if ( Export::isAllowed( sLang ) && @@ -682,7 +675,7 @@ void XRMResMerge::WorkOnText( { rText = sContent; ConvertStringToXMLFormat( rText ); - Export::QuotHTMLXRM( rText ); + //Export::QuotHTMLXRM( rText ); } } } @@ -692,7 +685,8 @@ void XRMResMerge::WorkOnText( void XRMResMerge::Output( const ByteString& rOutput ) /*****************************************************************************/ { - if ( pOutputStream ) + //printf("W: %s\n",rOutput.GetBuffer()); + if ( pOutputStream && rOutput.Len() > 0 ) pOutputStream->Write( rOutput.GetBuffer(), rOutput.Len()); } @@ -703,6 +697,8 @@ void XRMResMerge::EndOfText( ) /*****************************************************************************/ { + + Output( rCloseTag ); if ( pMergeDataFile && pResData ) { PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrys( pResData ); if ( pEntrys ) { @@ -710,18 +706,13 @@ void XRMResMerge::EndOfText( for( unsigned int n = 0; n < aLanguages.size(); n++ ){ sCur = aLanguages[ n ]; ByteString sContent; -//<<<<<<< xrmmerge.cxx if ( !sCur.EqualsIgnoreCaseAscii("en-US") && - // ( !sCur.EqualsIgnoreCaseAscii("de") ||( sCur.EqualsIgnoreCaseAscii("de") && Export::isMergingGermanAllowed( sPrj ) )) && -//======= -// if ( Export::isAllowed( sCur ) && -//>>>>>>> 1.17 ( pEntrys->GetText( sContent, STRING_TYP_TEXT, sCur, TRUE )) && ( sContent != "-" ) && ( sContent.Len())) { ByteString sText( sContent ); - Export::QuotHTMLXRM( sText ); + //Export::QuotHTMLXRM( sText ); ByteString sAdditionalLine( "\t" ); sAdditionalLine += rOpenTag; diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index a43c7e52a353..1a4cc9278e1e 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -176,18 +176,38 @@ OUString SAL_CALL FastLocatorImpl::getSystemId(void) throw (RuntimeException) } // -------------------------------------------------------------------- -// FastSaxParser implementation -// -------------------------------------------------------------------- -FastSaxParser::FastSaxParser() +ParserData::ParserData() { - mxDocumentLocator.set( new FastLocatorImpl( this ) ); +} + +ParserData::~ParserData() +{ +} +// -------------------------------------------------------------------- + +Entity::Entity( const ParserData& rData ) : + ParserData( rData ) +{ // performance-Improvment. Reference is needed when calling the startTag callback. // Handing out the same object with every call is allowed (see sax-specification) mxAttributes.set( new FastAttributeList( mxTokenHandler ) ); } +Entity::~Entity() +{ +} + +// -------------------------------------------------------------------- +// FastSaxParser implementation +// -------------------------------------------------------------------- + +FastSaxParser::FastSaxParser() +{ + mxDocumentLocator.set( new FastLocatorImpl( this ) ); +} + // -------------------------------------------------------------------- FastSaxParser::~FastSaxParser() @@ -200,46 +220,43 @@ FastSaxParser::~FastSaxParser() void FastSaxParser::pushContext() { - bool bRootContext = false; - SaxContextImplPtr p; - if( maContextStack.empty() ) + Entity& rEntity = getEntity(); + if( rEntity.maContextStack.empty() ) { - p.reset( new SaxContextImpl() ); - bRootContext = true; + rEntity.maContextStack.push( SaxContextImplPtr( new SaxContextImpl ) ); + DefineNamespace( OString("xml"), "http://www.w3.org/XML/1998/namespace"); } else { - p.reset( new SaxContextImpl( maContextStack.top() ) ); + rEntity.maContextStack.push( SaxContextImplPtr( new SaxContextImpl( rEntity.maContextStack.top() ) ) ); } - maContextStack.push( p ); - - if( bRootContext ) - DefineNamespace( OString("xml"), "http://www.w3.org/XML/1998/namespace"); } // -------------------------------------------------------------------- void FastSaxParser::popContext() { - OSL_ENSURE( !maContextStack.empty(), "sax::FastSaxParser::popContext(), pop without push?" ); - if( !maContextStack.empty() ) - maContextStack.pop(); + Entity& rEntity = getEntity(); + OSL_ENSURE( !rEntity.maContextStack.empty(), "sax::FastSaxParser::popContext(), pop without push?" ); + if( !rEntity.maContextStack.empty() ) + rEntity.maContextStack.pop(); } // -------------------------------------------------------------------- void FastSaxParser::DefineNamespace( const OString& rPrefix, const sal_Char* pNamespaceURL ) { - OSL_ENSURE( !maContextStack.empty(), "sax::FastSaxParser::DefineNamespace(), I need a context!" ); - if( !maContextStack.empty() ) + Entity& rEntity = getEntity(); + OSL_ENSURE( !rEntity.maContextStack.empty(), "sax::FastSaxParser::DefineNamespace(), I need a context!" ); + if( !rEntity.maContextStack.empty() ) { - sal_uInt32 nOffset = maContextStack.top()->mnNamespaceCount++; + sal_uInt32 nOffset = rEntity.maContextStack.top()->mnNamespaceCount++; - if( maNamespaceDefines.size() <= nOffset ) - maNamespaceDefines.resize( maNamespaceDefines.size() + 64 ); + if( rEntity.maNamespaceDefines.size() <= nOffset ) + rEntity.maNamespaceDefines.resize( rEntity.maNamespaceDefines.size() + 64 ); const OUString aNamespaceURL( pNamespaceURL, strlen( pNamespaceURL ), RTL_TEXTENCODING_UTF8 ); - maNamespaceDefines[nOffset].reset( new NamespaceDefine( rPrefix, GetNamespaceToken( aNamespaceURL ), aNamespaceURL ) ); + rEntity.maNamespaceDefines[nOffset].reset( new NamespaceDefine( rPrefix, GetNamespaceToken( aNamespaceURL ), aNamespaceURL ) ); } } @@ -249,7 +266,7 @@ sal_Int32 FastSaxParser::GetToken( const OString& rToken ) { Sequence< sal_Int8 > aSeq( (sal_Int8*)rToken.getStr(), rToken.getLength() ); - return mxTokenHandler->getTokenFromUTF8( aSeq ); + return getEntity().mxTokenHandler->getTokenFromUTF8( aSeq ); } sal_Int32 FastSaxParser::GetToken( const sal_Char* pToken, sal_Int32 nLen /* = 0 */ ) @@ -259,7 +276,7 @@ sal_Int32 FastSaxParser::GetToken( const sal_Char* pToken, sal_Int32 nLen /* = 0 Sequence< sal_Int8 > aSeq( (sal_Int8*)pToken, nLen ); - return mxTokenHandler->getTokenFromUTF8( aSeq ); + return getEntity().mxTokenHandler->getTokenFromUTF8( aSeq ); } // -------------------------------------------------------------------- @@ -268,12 +285,13 @@ sal_Int32 FastSaxParser::GetTokenWithPrefix( const OString& rPrefix, const OStri { sal_Int32 nNamespaceToken = FastToken::DONTKNOW; - sal_uInt32 nNamespace = maContextStack.top()->mnNamespaceCount; + Entity& rEntity = getEntity(); + sal_uInt32 nNamespace = rEntity.maContextStack.top()->mnNamespaceCount; while( nNamespace-- ) { - if( maNamespaceDefines[nNamespace]->maPrefix == rPrefix ) + if( rEntity.maNamespaceDefines[nNamespace]->maPrefix == rPrefix ) { - nNamespaceToken = maNamespaceDefines[nNamespace]->mnToken; + nNamespaceToken = rEntity.maNamespaceDefines[nNamespace]->mnToken; break; } @@ -295,14 +313,15 @@ sal_Int32 FastSaxParser::GetTokenWithPrefix( const sal_Char*pPrefix, int nPrefix { sal_Int32 nNamespaceToken = FastToken::DONTKNOW; - sal_uInt32 nNamespace = maContextStack.top()->mnNamespaceCount; + Entity& rEntity = getEntity(); + sal_uInt32 nNamespace = rEntity.maContextStack.top()->mnNamespaceCount; while( nNamespace-- ) { - const OString& rPrefix( maNamespaceDefines[nNamespace]->maPrefix ); + const OString& rPrefix( rEntity.maNamespaceDefines[nNamespace]->maPrefix ); if( (rPrefix.getLength() == nPrefixLen) && (strncmp( rPrefix.getStr(), pPrefix, nPrefixLen ) == 0 ) ) { - nNamespaceToken = maNamespaceDefines[nNamespace]->mnToken; + nNamespaceToken = rEntity.maNamespaceDefines[nNamespace]->mnToken; break; } @@ -335,12 +354,13 @@ sal_Int32 FastSaxParser::GetNamespaceToken( const OUString& rNamespaceURL ) OUString FastSaxParser::GetNamespaceURL( const OString& rPrefix ) throw (SAXException) { - if( !maContextStack.empty() ) + Entity& rEntity = getEntity(); + if( !rEntity.maContextStack.empty() ) { - sal_uInt32 nNamespace = maContextStack.top()->mnNamespaceCount; + sal_uInt32 nNamespace = rEntity.maContextStack.top()->mnNamespaceCount; while( nNamespace-- ) - if( maNamespaceDefines[nNamespace]->maPrefix == rPrefix ) - return maNamespaceDefines[nNamespace]->maNamespaceURL; + if( rEntity.maNamespaceDefines[nNamespace]->maPrefix == rPrefix ) + return rEntity.maNamespaceDefines[nNamespace]->maNamespaceURL; } throw SAXException(); // prefix that has no defined namespace url @@ -348,16 +368,17 @@ OUString FastSaxParser::GetNamespaceURL( const OString& rPrefix ) throw (SAXExce OUString FastSaxParser::GetNamespaceURL( const sal_Char*pPrefix, int nPrefixLen ) throw(SAXException) { - if( pPrefix && !maContextStack.empty() ) + Entity& rEntity = getEntity(); + if( pPrefix && !rEntity.maContextStack.empty() ) { - sal_uInt32 nNamespace = maContextStack.top()->mnNamespaceCount; + sal_uInt32 nNamespace = rEntity.maContextStack.top()->mnNamespaceCount; while( nNamespace-- ) { - const OString& rPrefix( maNamespaceDefines[nNamespace]->maPrefix ); + const OString& rPrefix( rEntity.maNamespaceDefines[nNamespace]->maPrefix ); if( (rPrefix.getLength() == nPrefixLen) && (strncmp( rPrefix.getStr(), pPrefix, nPrefixLen ) == 0 ) ) { - return maNamespaceDefines[nNamespace]->maNamespaceURL; + return rEntity.maNamespaceDefines[nNamespace]->maNamespaceURL; } } } @@ -421,7 +442,7 @@ void FastSaxParser::parseStream( const InputSource& maStructSource) throw (SAXEx // Only one text at one time MutexGuard guard( maMutex ); - struct Entity entity; + Entity entity( maData ); entity.maStructSource = maStructSource; if( !entity.maStructSource.aInputStream.is() ) @@ -442,26 +463,23 @@ void FastSaxParser::parseStream( const InputSource& maStructSource) throw (SAXEx XML_SetCharacterDataHandler( entity.mpParser, call_callbackCharacters ); XML_SetExternalEntityRefHandler( entity.mpParser, call_callbackExternalEntityRef ); - // maSavedException used to transport exceptions through C callbacks - maSavedException.clear(); - pushEntity( entity ); try { // start the document - if( mxDocumentHandler.is() ) + if( entity.mxDocumentHandler.is() ) { Reference< XLocator > xLoc( mxDocumentLocator.get() ); - mxDocumentHandler->setDocumentLocator( xLoc ); - mxDocumentHandler->startDocument(); + entity.mxDocumentHandler->setDocumentLocator( xLoc ); + entity.mxDocumentHandler->startDocument(); } parse(); // finish document - if( mxDocumentHandler.is() ) + if( entity.mxDocumentHandler.is() ) { - mxDocumentHandler->endDocument(); + entity.mxDocumentHandler->endDocument(); } } catch( SAXException & ) @@ -489,13 +507,12 @@ void FastSaxParser::parseStream( const InputSource& maStructSource) throw (SAXEx void FastSaxParser::setFastDocumentHandler( const Reference< XFastDocumentHandler >& Handler ) throw (RuntimeException) { - mxDocumentHandler = Handler; + maData.mxDocumentHandler = Handler; } void SAL_CALL FastSaxParser::setTokenHandler( const Reference< XFastTokenHandler >& Handler ) throw (RuntimeException) { - mxTokenHandler = Handler; - mxAttributes.set( new FastAttributeList( mxTokenHandler ) ); + maData.mxTokenHandler = Handler; } void SAL_CALL FastSaxParser::registerNamespace( const OUString& NamespaceURL, sal_Int32 NamespaceToken ) throw (IllegalArgumentException, RuntimeException) @@ -513,17 +530,17 @@ void SAL_CALL FastSaxParser::registerNamespace( const OUString& NamespaceURL, sa void FastSaxParser::setErrorHandler(const Reference< XErrorHandler > & Handler) throw (RuntimeException) { - mxErrorHandler = Handler; + maData.mxErrorHandler = Handler; } void FastSaxParser::setEntityResolver(const Reference < XEntityResolver > & Resolver) throw (RuntimeException) { - mxEntityResolver = Resolver; + maData.mxEntityResolver = Resolver; } void FastSaxParser::setLocale( const Locale & Locale ) throw (RuntimeException) { - maLocale = Locale; + maData.maLocale = Locale; } Sequence< OUString > FastSaxParser::getSupportedServiceNames_Static(void) @@ -619,29 +636,30 @@ void FastSaxParser::parse() const int BUFFER_SIZE = 16 * 1024; Sequence< sal_Int8 > seqOut( BUFFER_SIZE ); + Entity& rEntity = getEntity(); int nRead = 0; do { - nRead = getEntity().maConverter.readAndConvert( seqOut, BUFFER_SIZE ); + nRead = rEntity.maConverter.readAndConvert( seqOut, BUFFER_SIZE ); if( nRead <= 0 ) { - XML_Parse( getEntity().mpParser, (const char*) seqOut.getConstArray(), 0, 1 ); + XML_Parse( rEntity.mpParser, (const char*) seqOut.getConstArray(), 0, 1 ); break; } - bool bContinue = XML_Parse( getEntity().mpParser, (const char*) seqOut.getConstArray(), nRead, 0 ) != 0; + bool bContinue = XML_Parse( rEntity.mpParser, (const char*) seqOut.getConstArray(), nRead, 0 ) != 0; // callbacks used inside XML_Parse may have caught an exception - if( !bContinue || maSavedException.hasValue() ) + if( !bContinue || rEntity.maSavedException.hasValue() ) { // Error during parsing ! - XML_Error xmlE = XML_GetErrorCode( getEntity().mpParser ); + XML_Error xmlE = XML_GetErrorCode( rEntity.mpParser ); OUString sSystemId = mxDocumentLocator->getSystemId(); sal_Int32 nLine = mxDocumentLocator->getLineNumber(); SAXParseException aExcept( lclGetErrorMessage( xmlE, sSystemId, nLine ), Reference< XInterface >(), - Any( &maSavedException, getCppuType( &maSavedException ) ), + Any( &rEntity.maSavedException, getCppuType( &rEntity.maSavedException ) ), mxDocumentLocator->getPublicId(), mxDocumentLocator->getSystemId(), mxDocumentLocator->getLineNumber(), @@ -649,8 +667,8 @@ void FastSaxParser::parse() ); // error handler is set, it may throw the exception - if( mxErrorHandler.is() ) - mxErrorHandler->fatalError( Any( aExcept ) ); + if( rEntity.mxErrorHandler.is() ) + rEntity.mxErrorHandler->fatalError( Any( aExcept ) ); // error handler has not thrown, but parsing cannot go on, the // exception MUST be thrown @@ -680,9 +698,10 @@ struct AttributeData void FastSaxParser::callbackStartElement( const XML_Char* pwName, const XML_Char** awAttributes ) { Reference< XFastContextHandler > xParentContext; - if( !maContextStack.empty() ) + Entity& rEntity = getEntity(); + if( !rEntity.maContextStack.empty() ) { - xParentContext = maContextStack.top()->mxContext; + xParentContext = rEntity.maContextStack.top()->mxContext; if( !xParentContext.is() ) { // we ignore current elements, so no processing needed @@ -693,7 +712,7 @@ void FastSaxParser::callbackStartElement( const XML_Char* pwName, const XML_Char pushContext(); - mxAttributes->clear(); + rEntity.mxAttributes->clear(); // create attribute map and process namespace instructions int i = 0; @@ -734,7 +753,7 @@ void FastSaxParser::callbackStartElement( const XML_Char* pwName, const XML_Char if( (nNameLen == 5) && (strcmp( pName, "xmlns" ) == 0) ) { // namespace of the element found - maContextStack.top()->maNamespace = OUString( awAttributes[i+1], strlen( awAttributes[i+1] ), RTL_TEXTENCODING_UTF8 ); + rEntity.maContextStack.top()->maNamespace = OUString( awAttributes[i+1], strlen( awAttributes[i+1] ), RTL_TEXTENCODING_UTF8 ); } else { @@ -752,17 +771,17 @@ void FastSaxParser::callbackStartElement( const XML_Char* pwName, const XML_Char { sal_Int32 nAttributeToken = GetTokenWithPrefix( aIt->maPrefix, aIt->maName ); if( nAttributeToken != FastToken::DONTKNOW ) - mxAttributes->add( nAttributeToken, aIt->maValue ); + rEntity.mxAttributes->add( nAttributeToken, aIt->maValue ); else - mxAttributes->addUnknown( GetNamespaceURL( aIt->maPrefix ), aIt->maName, aIt->maValue ); + rEntity.mxAttributes->addUnknown( GetNamespaceURL( aIt->maPrefix ), aIt->maName, aIt->maValue ); } else { sal_Int32 nAttributeToken = GetToken( aIt->maName ); if( nAttributeToken != FastToken::DONTKNOW ) - mxAttributes->add( nAttributeToken, aIt->maValue ); + rEntity.mxAttributes->add( nAttributeToken, aIt->maValue ); else - mxAttributes->addUnknown( aIt->maName, aIt->maValue ); + rEntity.mxAttributes->addUnknown( aIt->maName, aIt->maValue ); } } @@ -770,31 +789,31 @@ void FastSaxParser::callbackStartElement( const XML_Char* pwName, const XML_Char splitName( pwName, pPrefix, nPrefixLen, pName, nNameLen ); if( nPrefixLen > 0 ) nElementToken = GetTokenWithPrefix( pPrefix, nPrefixLen, pName, nNameLen ); - else if( maContextStack.top()->maNamespace.getLength() > 0 ) - nElementToken = GetTokenWithNamespaceURL( maContextStack.top()->maNamespace, pName, nNameLen ); + else if( rEntity.maContextStack.top()->maNamespace.getLength() > 0 ) + nElementToken = GetTokenWithNamespaceURL( rEntity.maContextStack.top()->maNamespace, pName, nNameLen ); else nElementToken = GetToken( pName ); - maContextStack.top()->mnElementToken = nElementToken; + rEntity.maContextStack.top()->mnElementToken = nElementToken; - Reference< XFastAttributeList > xAttr( mxAttributes.get() ); + Reference< XFastAttributeList > xAttr( rEntity.mxAttributes.get() ); Reference< XFastContextHandler > xContext; if( nElementToken == FastToken::DONTKNOW ) { if( nPrefixLen > 0 ) - maContextStack.top()->maNamespace = GetNamespaceURL( pPrefix, nPrefixLen ); + rEntity.maContextStack.top()->maNamespace = GetNamespaceURL( pPrefix, nPrefixLen ); - const OUString aNamespace( maContextStack.top()->maNamespace ); + const OUString aNamespace( rEntity.maContextStack.top()->maNamespace ); const OUString aElementName( pPrefix, nPrefixLen, RTL_TEXTENCODING_UTF8 ); - maContextStack.top()->maElementName = aElementName; + rEntity.maContextStack.top()->maElementName = aElementName; if( xParentContext.is() ) xContext = xParentContext->createUnknownChildContext( aNamespace, aElementName, xAttr ); else - xContext = mxDocumentHandler->createUnknownChildContext( aNamespace, aElementName, xAttr ); + xContext = rEntity.mxDocumentHandler->createUnknownChildContext( aNamespace, aElementName, xAttr ); if( xContext.is() ) { - maContextStack.top()->mxContext = xContext; + rEntity.maContextStack.top()->mxContext = xContext; xContext->startUnknownElement( aNamespace, aElementName, xAttr ); } } @@ -803,28 +822,29 @@ void FastSaxParser::callbackStartElement( const XML_Char* pwName, const XML_Char if( xParentContext.is() ) xContext = xParentContext->createFastChildContext( nElementToken, xAttr ); else - xContext = mxDocumentHandler->createFastChildContext( nElementToken, xAttr ); + xContext = rEntity.mxDocumentHandler->createFastChildContext( nElementToken, xAttr ); if( xContext.is() ) { - maContextStack.top()->mxContext = xContext; + rEntity.maContextStack.top()->mxContext = xContext; xContext->startFastElement( nElementToken, xAttr ); } } } catch( Exception& e ) { - maSavedException <<= e; + rEntity.maSavedException <<= e; } } void FastSaxParser::callbackEndElement( const XML_Char* ) { - OSL_ENSURE( !maContextStack.empty(), "FastSaxParser::callbackEndElement - no context" ); - if( !maContextStack.empty() ) + Entity& rEntity = getEntity(); + OSL_ENSURE( !rEntity.maContextStack.empty(), "FastSaxParser::callbackEndElement - no context" ); + if( !rEntity.maContextStack.empty() ) { - SaxContextImplPtr pContext( maContextStack.top() ); + SaxContextImplPtr pContext = rEntity.maContextStack.top(); const Reference< XFastContextHandler >& xContext( pContext->mxContext ); if( xContext.is() ) try { @@ -836,7 +856,7 @@ void FastSaxParser::callbackEndElement( const XML_Char* ) } catch( Exception& e ) { - maSavedException <<= e; + rEntity.maSavedException <<= e; } popContext(); @@ -846,14 +866,15 @@ void FastSaxParser::callbackEndElement( const XML_Char* ) void FastSaxParser::callbackCharacters( const XML_Char* s, int nLen ) { - const Reference< XFastContextHandler >& xContext( maContextStack.top()->mxContext ); + Entity& rEntity = getEntity(); + const Reference< XFastContextHandler >& xContext( rEntity.maContextStack.top()->mxContext ); if( xContext.is() ) try { xContext->characters( OUString( s, nLen, RTL_TEXTENCODING_UTF8 ) ); } catch( Exception& e ) { - maSavedException <<= e; + rEntity.maSavedException <<= e; } } @@ -863,22 +884,23 @@ int FastSaxParser::callbackExternalEntityRef( XML_Parser parser, bool bOK = true; InputSource source; - struct Entity entity; + Entity& rCurrEntity = getEntity(); + Entity aNewEntity( rCurrEntity ); - if( mxEntityResolver.is() ) try + if( rCurrEntity.mxEntityResolver.is() ) try { - entity.maStructSource = mxEntityResolver->resolveEntity( + aNewEntity.maStructSource = rCurrEntity.mxEntityResolver->resolveEntity( OUString( publicId, strlen( publicId ), RTL_TEXTENCODING_UTF8 ) , OUString( systemId, strlen( systemId ), RTL_TEXTENCODING_UTF8 ) ); } catch( SAXParseException & e ) { - maSavedException <<= e; + rCurrEntity.maSavedException <<= e; bOK = false; } catch( SAXException & e ) { - maSavedException <<= SAXParseException( + rCurrEntity.maSavedException <<= SAXParseException( e.Message, e.Context, e.WrappedException, mxDocumentLocator->getPublicId(), mxDocumentLocator->getSystemId(), @@ -887,43 +909,42 @@ int FastSaxParser::callbackExternalEntityRef( XML_Parser parser, bOK = false; } - if( entity.maStructSource.aInputStream.is() ) + if( aNewEntity.maStructSource.aInputStream.is() ) { - entity.mpParser = XML_ExternalEntityParserCreate( parser, context, 0 ); - if( ! entity.mpParser ) + aNewEntity.mpParser = XML_ExternalEntityParserCreate( parser, context, 0 ); + if( !aNewEntity.mpParser ) { return false; } - entity.maConverter.setInputStream( entity.maStructSource.aInputStream ); - pushEntity( entity ); + aNewEntity.maConverter.setInputStream( aNewEntity.maStructSource.aInputStream ); + pushEntity( aNewEntity ); try { parse(); } catch( SAXParseException & e ) { - maSavedException <<= e; + rCurrEntity.maSavedException <<= e; bOK = false; } catch( IOException &e ) { SAXException aEx; aEx.WrappedException <<= e; - maSavedException <<= aEx; + rCurrEntity.maSavedException <<= aEx; bOK = false; } catch( RuntimeException &e ) { SAXException aEx; aEx.WrappedException <<= e; - maSavedException <<= aEx; + rCurrEntity.maSavedException <<= aEx; bOK = false; } popEntity(); - - XML_ParserFree( entity.mpParser ); + XML_ParserFree( aNewEntity.mpParser ); } return bOK; diff --git a/sax/source/fastparser/fastparser.hxx b/sax/source/fastparser/fastparser.hxx index 3d494a6d3c81..a0331fe4035a 100644 --- a/sax/source/fastparser/fastparser.hxx +++ b/sax/source/fastparser/fastparser.hxx @@ -47,25 +47,51 @@ #define PARSER_IMPLEMENTATION_NAME "com.sun.star.comp.extensions.xml.sax.FastParser" #define PARSER_SERVICE_NAME "com.sun.star.xml.sax.FastParser" -namespace sax_fastparser +namespace sax_fastparser { + +class FastLocatorImpl; +struct NamespaceDefine; +struct SaxContextImpl; + +typedef ::boost::shared_ptr< SaxContextImpl > SaxContextImplPtr; +typedef ::boost::shared_ptr< NamespaceDefine > NamespaceDefineRef; + +typedef ::std::hash_map< ::rtl::OUString, sal_Int32, + ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > NamespaceMap; + +// -------------------------------------------------------------------- + +struct ParserData { + ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastDocumentHandler > mxDocumentHandler; + ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastTokenHandler > mxTokenHandler; + ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XErrorHandler > mxErrorHandler; + ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XEntityResolver > mxEntityResolver; + ::com::sun::star::lang::Locale maLocale; - class FastLocatorImpl; - struct NamespaceDefine; - struct SaxContextImpl; - typedef boost::shared_ptr< SaxContextImpl > SaxContextImplPtr; - typedef ::std::hash_map< ::rtl::OUString, sal_Int32, - ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > - > NamespaceMap; + ParserData(); + ~ParserData(); +}; // -------------------------------------------------------------------- -// Entity binds all information neede for a single file -struct Entity +// Entity binds all information needed for a single file +struct Entity : public ParserData { - ::com::sun::star::xml::sax::InputSource maStructSource; - XML_Parser mpParser; - sax_expatwrap::XMLFile2UTFConverter maConverter; + ::com::sun::star::xml::sax::InputSource maStructSource; + XML_Parser mpParser; + ::sax_expatwrap::XMLFile2UTFConverter maConverter; + ::rtl::Reference< FastAttributeList > mxAttributes; + + // Exceptions cannot be thrown through the C-XmlParser (possible resource leaks), + // therefore the exception must be saved somewhere. + ::com::sun::star::uno::Any maSavedException; + + ::std::stack< SaxContextImplPtr > maContextStack; + ::std::vector< NamespaceDefineRef > maNamespaceDefines; + + explicit Entity( const ParserData& rData ); + ~Entity(); }; // -------------------------------------------------------------------- @@ -75,7 +101,7 @@ class FastSaxParser : public ::cppu::WeakImplHelper2< ::com::sun::star::xml::sax { public: FastSaxParser(); - ~FastSaxParser(); + virtual ~FastSaxParser(); // The implementation details static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void); @@ -100,9 +126,9 @@ public: void callbackCharacters( const XML_Char* s, int nLen ); int callbackExternalEntityRef( XML_Parser parser, const XML_Char *openEntityNames, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId); - void pushEntity( const struct Entity &entity ) { vecEntity.push_back( entity ); } - void popEntity() { vecEntity.pop_back( ); } - struct Entity &getEntity() { return vecEntity.back(); } + inline void pushEntity( const Entity& rEntity ) { maEntities.push( rEntity ); } + inline void popEntity() { maEntities.pop(); } + Entity& getEntity() { return maEntities.top(); } private: void parse(); @@ -126,26 +152,11 @@ private: private: ::osl::Mutex maMutex; - ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastDocumentHandler > mxDocumentHandler; - ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastTokenHandler > mxTokenHandler; - ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XErrorHandler > mxErrorHandler; - ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XEntityResolver > mxEntityResolver; - - rtl::Reference < FastLocatorImpl > mxDocumentLocator; - rtl::Reference < FastAttributeList > mxAttributes; - - // External entity stack - std::vector< struct Entity > vecEntity; - - // Exceptions cannot be thrown through the C-XmlParser (possible resource leaks), - // therefore the exception must be saved somewhere. - ::com::sun::star::uno::Any maSavedException; - - ::com::sun::star::lang::Locale maLocale; + ::rtl::Reference< FastLocatorImpl > mxDocumentLocator; + NamespaceMap maNamespaceMap; - std::stack< SaxContextImplPtr > maContextStack; - std::vector< boost::shared_ptr< NamespaceDefine > > maNamespaceDefines; - NamespaceMap maNamespaceMap; + ParserData maData; /// Cached parser configuration for next call of parseStream(). + ::std::stack< Entity > maEntities; /// Entity stack for each call of parseStream(). }; } diff --git a/svtools/inc/svtools/accessibletable.hxx b/svtools/inc/svtools/accessibletable.hxx index 198a24b8eb62..8ff17a2b71c7 100755 --- a/svtools/inc/svtools/accessibletable.hxx +++ b/svtools/inc/svtools/accessibletable.hxx @@ -124,7 +124,7 @@ public: virtual ::com::sun::star::uno::Any GetCellContent( sal_Int32 _nRowPos, sal_Int32 _nColPos) const = 0; virtual std::vector<sal_Int32>& GetSelectedRows() = 0; virtual void RemoveSelectedRow(sal_Int32 _nRowPos) = 0; - virtual ::rtl::OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) = 0; + virtual ::rtl::OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) const = 0; }; // ---------------------------------------------------------------------------- diff --git a/svtools/inc/svtools/logindlg.hxx b/svtools/inc/svtools/logindlg.hxx deleted file mode 100644 index 9cf12dd70610..000000000000 --- a/svtools/inc/svtools/logindlg.hxx +++ /dev/null @@ -1,118 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SVTOOLS_LOGINDLG_HXX_ -#define _SVTOOLS_LOGINDLG_HXX_ - -#include "svtools/svtdllapi.h" -#include <svtools/stdctrl.hxx> -#ifndef _SV_BUTTON_HXX -#include <vcl/button.hxx> -#endif -#include <vcl/dialog.hxx> -#include <vcl/edit.hxx> -#include <vcl/fixed.hxx> - -//============================================================================ -#define LF_NO_PATH 0x0001 // hide "path" -#define LF_NO_USERNAME 0x0002 // hide "name" -#define LF_NO_PASSWORD 0x0004 // hide "password" -#define LF_NO_SAVEPASSWORD 0x0008 // hide "save password" -#define LF_NO_ERRORTEXT 0x0010 // hide message -#define LF_PATH_READONLY 0x0020 // "path" readonly -#define LF_USERNAME_READONLY 0x0040 // "name" readonly -#define LF_NO_ACCOUNT 0x0080 // hide "account" - -//............................................................................ -namespace svt -{ -//............................................................................ - -//============================================================================ -class SVT_DLLPUBLIC LoginDialog : public ModalDialog -{ - FixedInfo aErrorInfo; - FixedLine aErrorGB; - FixedInfo aRequestInfo; - FixedText aPathFT; - Edit aPathED; - FixedInfo aPathInfo; - PushButton aPathBtn; - FixedText aNameFT; - Edit aNameED; - FixedInfo aNameInfo; - FixedText aPasswordFT; - Edit aPasswordED; - FixedText aAccountFT; - Edit aAccountED; - CheckBox aSavePasswdBtn; - FixedLine aLoginGB; - OKButton aOKBtn; - CancelButton aCancelBtn; - HelpButton aHelpBtn; - - SVT_DLLPRIVATE void HideControls_Impl( USHORT nFlags ); - - DECL_DLLPRIVATE_LINK( OKHdl_Impl, OKButton * ); - DECL_DLLPRIVATE_LINK( PathHdl_Impl, PushButton * ); - -public: - LoginDialog( Window* pParent, USHORT nFlags, - const String& rServer, const String* pRealm = NULL ); - - String GetPath() const { return aPathED.GetText(); } - void SetPath( const String& rNewPath ) - { aPathED.SetText( rNewPath ); - aPathInfo.SetText( rNewPath );} - String GetName() const { return aNameED.GetText(); } - void SetName( const String& rNewName ); - String GetPassword() const { return aPasswordED.GetText(); } - void SetPassword( const String& rNew ) - { aPasswordED.SetText( rNew ); } - String GetAccount() const { return aAccountED.GetText(); } - void SetAccount( const String& rNew ) - { aAccountED.SetText( rNew ); } - BOOL IsSavePassword() const - { return aSavePasswdBtn.IsChecked(); } - void SetSavePassword( BOOL bSave ) - { aSavePasswdBtn.Check( bSave ); } - void SetSavePasswordText( const String& rTxt ) - { aSavePasswdBtn.SetText( rTxt ); } - void SetErrorText( const String& rTxt ) - { aErrorInfo.SetText( rTxt ); } - void SetLoginRequestText( const String& rTxt ) - { aRequestInfo.SetText( rTxt ); } - void ClearPassword(); - void ClearAccount(); -}; - -//............................................................................ -} // namespace svt -//............................................................................ - -#endif // _SVTOOLS_LOGINDLG_HXX_ - diff --git a/svtools/inc/svtools/table/abstracttablecontrol.hxx b/svtools/inc/svtools/table/abstracttablecontrol.hxx index 2b3951f6aaf3..9206f20ecbcb 100644 --- a/svtools/inc/svtools/table/abstracttablecontrol.hxx +++ b/svtools/inc/svtools/table/abstracttablecontrol.hxx @@ -116,6 +116,7 @@ namespace svt { namespace table /** returns selection engine*/ virtual SelectionEngine* getSelEngine() = 0; virtual void setCursorAtCurrentCell(const Point& rPoint) = 0; + virtual bool isTooltipActive() = 0; virtual rtl::OUString& setTooltip(const Point& rPoint ) = 0; virtual RowPos getCurrentRow(const Point& rPoint ) = 0; virtual void resizeColumn(const Point& rPoint ) = 0; diff --git a/svtools/inc/svtools/table/tablecontrol.hxx b/svtools/inc/svtools/table/tablecontrol.hxx index 6eb7f063f9fa..f3b7ed88b565 100644 --- a/svtools/inc/svtools/table/tablecontrol.hxx +++ b/svtools/inc/svtools/table/tablecontrol.hxx @@ -79,6 +79,7 @@ namespace svt { namespace table ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aText; Link m_aSelectHdl; bool m_bSelectionChanged; + bool m_bTooltip; public: ::std::auto_ptr< AccessibleTableControl_Impl > m_pAccessTable; @@ -217,12 +218,13 @@ namespace svt { namespace table virtual sal_Bool isAccessibleAlive( ) const; virtual void commitGridControlEvent( sal_Int16 _nEventId, const com::sun::star::uno::Any& _rNewValue, const com::sun::star::uno::Any& _rOldValue ); virtual void RemoveSelectedRow(RowPos _nRowPos); - virtual ::rtl::OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos); + virtual ::rtl::OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) const; ::com::sun::star::uno::Sequence< sal_Int32 >& getColumnsForTooltip(); ::com::sun::star::uno::Sequence< ::rtl::OUString >& getTextForTooltip(); void setTooltip(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aText, const ::com::sun::star::uno::Sequence< sal_Int32 >& nCols); void clearSelection(); void selectionChanged(bool _bChanged); + bool isTooltip(); protected: /// retrieves the XAccessible implementation associated with the GridControl instance diff --git a/svtools/inc/svtools/table/tabledatawindow.hxx b/svtools/inc/svtools/table/tabledatawindow.hxx index c9f96483d943..9a6ece489119 100644 --- a/svtools/inc/svtools/table/tabledatawindow.hxx +++ b/svtools/inc/svtools/table/tabledatawindow.hxx @@ -74,6 +74,11 @@ namespace svt { namespace table virtual void CaptureMouse(); virtual void ReleaseMouse(); virtual long Notify(NotifyEvent& rNEvt); + virtual void SetControlBackground(const Color& rColor); + virtual void SetControlBackground(); + + void SetBackground(const Wallpaper& rColor); + void SetBackground(); }; //........................................................................ } } // namespace svt::table diff --git a/svtools/inc/svtools/xwindowitem.hxx b/svtools/inc/svtools/xwindowitem.hxx new file mode 100755 index 000000000000..eca425cf1369 --- /dev/null +++ b/svtools/inc/svtools/xwindowitem.hxx @@ -0,0 +1,70 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: chrtitem.hxx,v $ + * $Revision: 1.9 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _XWINDOWITEM_HXX_ +#define _XWINDOWITEM_HXX_ + + +#include "svtools/svtdllapi.h" + +#include <svl/poolitem.hxx> +#include <toolkit/helper/vclunohelper.hxx> + +#include <com/sun/star/awt/XWindow.hpp> + +class Window; + +////////////////////////////////////////////////////////////////////// + +class SVT_DLLPUBLIC XWindowItem : public SfxPoolItem +{ + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xWin; + + // disallow use assignment operator + XWindowItem & operator = ( const XWindowItem & ); + +public: + TYPEINFO(); + XWindowItem(); + explicit XWindowItem( USHORT nWhich, Window * pWin ); + XWindowItem( USHORT nWhich, com::sun::star::uno::Reference< com::sun::star::awt::XWindow > & rxWin ); + XWindowItem( const XWindowItem &rItem ); + ~XWindowItem(); + + virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const; + virtual int operator == ( const SfxPoolItem& rAttr ) const; + + Window * GetWindowPtr() const { return VCLUnoHelper::GetWindow( m_xWin ); } + com::sun::star::uno::Reference< com::sun::star::awt::XWindow > GetXWindow() const { return m_xWin; } +}; + +////////////////////////////////////////////////////////////////////// + +#endif + diff --git a/svtools/inc/tabbar.hxx b/svtools/inc/tabbar.hxx index cf89d4426726..e036f4c2f045 100644 --- a/svtools/inc/tabbar.hxx +++ b/svtools/inc/tabbar.hxx @@ -320,9 +320,6 @@ typedef USHORT TabBarPageBits; // - TabBar-Types - // ---------------- -#define TABBAR_APPEND ((USHORT)0xFFFF) -#define TABBAR_PAGE_NOTFOUND ((USHORT)0xFFFF) - #define TABBAR_RENAMING_YES ((long)TRUE) #define TABBAR_RENAMING_NO ((long)FALSE) #define TABBAR_RENAMING_CANCEL ((long)2) @@ -400,6 +397,9 @@ private: DECL_DLLPRIVATE_LINK( ImplClickHdl, ImplTabButton* ); public: + static const sal_uInt16 APPEND; + static const sal_uInt16 PAGE_NOT_FOUND; + TabBar( Window* pParent, WinBits nWinStyle = WB_STDTABBAR ); virtual ~TabBar(); @@ -424,9 +424,14 @@ public: void InsertPage( USHORT nPageId, const XubString& rText, TabBarPageBits nBits = 0, - USHORT nPos = TABBAR_APPEND ); + USHORT nPos = TabBar::APPEND ); void RemovePage( USHORT nPageId ); void MovePage( USHORT nPageId, USHORT nNewPos ); + + Color GetTabBgColor( USHORT nPageId ) const; + void SetTabBgColor( USHORT nPageId, const Color& aTabBgColor ); + BOOL IsDefaultTabBgColor( USHORT nPageId ); + void Clear(); void EnablePage( USHORT nPageId, BOOL bEnable = TRUE ); @@ -453,7 +458,7 @@ public: void SelectPage( USHORT nPageId, BOOL bSelect = TRUE ); void SelectPageRange( BOOL bSelect = FALSE, USHORT nStartPos = 0, - USHORT nEndPos = TABBAR_APPEND ); + USHORT nEndPos = TabBar::APPEND ); USHORT GetSelectPage( USHORT nSelIndex = 0 ) const; USHORT GetSelectPageCount() const; BOOL IsPageSelected( USHORT nPageId ) const; diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index 843de83f7710..af19379d8b8f 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -54,6 +54,9 @@ #include <vcl/waitobj.hxx> #include <com/sun/star/io/XPersist.hpp> #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/ucb/XCommandInfo.hpp> +#include <com/sun/star/beans/XPropertySetInfo.hpp> +#include <com/sun/star/beans/PropertyAttribute.hpp> #include <algorithm> #include <memory> @@ -100,7 +103,7 @@ using ::rtl::OUString; DECLARE_LIST( StringList_Impl, OUString* ) -#define ROW_HEIGHT 17 // the height of a row has to be a little higher than the bitmap +#define ROW_HEIGHT 17 // the height of a row has to be a little higher than the bitmap #define QUICK_SEARCH_TIMEOUT 1500 // time in mSec before the quicksearch string will be reseted namespace @@ -210,6 +213,7 @@ private: sal_Bool mbResizeDisabled : 1; sal_Bool mbAutoResize : 1; sal_Bool mbEnableDelete : 1; + sal_Bool mbEnableRename : 1; void DeleteEntries(); void DoQuickSearch( const xub_Unicode& rChar ); @@ -232,6 +236,7 @@ public: void EnableAutoResize() { mbAutoResize = sal_True; } void EnableDelete( sal_Bool bEnable ) { mbEnableDelete = bEnable; } + void EnableRename( sal_Bool bEnable ) { mbEnableRename = bEnable; } sal_Bool IsDeleteOrContextMenuEnabled() { return mbEnableDelete || IsContextMenuHandlingEnabled(); } Reference< XCommandEnvironment > GetCommandEnvironment() const { return mxCmdEnv; } @@ -299,11 +304,11 @@ inline const OUString& HashedEntry::GetName() const class HashedEntryList : protected List {// provides a list of _unique_ Entries protected: - inline HashedEntry* First(); - inline HashedEntry* Next(); - inline void Append( HashedEntry* pNewEntry ); + inline HashedEntry* First(); + inline HashedEntry* Next(); + inline void Append( HashedEntry* pNewEntry ); public: - virtual ~HashedEntryList(); + virtual ~HashedEntryList(); const HashedEntry* Find( const OUString& rNameToSearchFor ); const HashedEntry* Find( const HashedEntry& rToSearchFor ); @@ -338,7 +343,7 @@ HashedEntryList::~HashedEntryList() const HashedEntry* HashedEntryList::Find( const OUString& rRefName ) { // simple linear search, which should be fast enough for this purpose - HashedEntry aRef( rRefName ); + HashedEntry aRef( rRefName ); HashedEntry* pIter = First(); while( pIter && *pIter != aRef ) pIter = Next(); @@ -419,12 +424,12 @@ class NameTranslationList : protected HashedEntryList { // contains a list of substitutes of strings for a given folder (as URL) // explanation of the circumstances see in remarks for Init(); protected: - INetURLObject maTransFile; // URL of file with translation entries - HashedEntry maHashedURL; // for future purposes when dealing with a set of cached - // NameTranslationLists + INetURLObject maTransFile; // URL of file with translation entries + HashedEntry maHashedURL; // for future purposes when dealing with a set of cached + // NameTranslationLists private: const String maTransFileName; - void Init(); // reads the translation file and fills the (internal) list + void Init(); // reads the translation file and fills the (internal) list public: NameTranslationList( const INetURLObject& rBaseURL ); @@ -436,12 +441,12 @@ public: using List::operator!=; inline sal_Bool operator !=( const HashedEntry& rRef ) const; - const OUString* Translate( const OUString& rName ) const; + const OUString* Translate( const OUString& rName ) const; // returns NULL, if rName can't be found - inline void Update(); // clears list and init + inline void Update(); // clears list and init - inline const String& GetTransTableFileName() const; + inline const String& GetTransTableFileName() const; // returns the name for the file, which contains the translation strings }; @@ -463,7 +468,7 @@ void NameTranslationList::Init() if( aTestContent.isDocument() ) {// ... also tests the existence of maTransFile by throwing an Exception - const sal_Char* pSection = "TRANSLATIONNAMES"; + const sal_Char* pSection = "TRANSLATIONNAMES"; String aFsysName( maTransFile.getFSysPath( INetURLObject::FSYS_DETECT ) ); Config aConfig( aFsysName ); @@ -475,7 +480,7 @@ void NameTranslationList::Init() Insert( new NameTranslationEntry( aConfig.GetKeyName( nCnt ), aConfig.ReadKey( nCnt ) ) ); } } - catch( Exception& ) {} + catch( Exception const & ) {} } NameTranslationList::NameTranslationList( const INetURLObject& rBaseURL ): @@ -527,7 +532,7 @@ public: // IContentTitleTranslation virtual sal_Bool GetTranslation( const OUString& rOriginalName, OUString& rTranslatedName ) const; - void UpdateTranslationTable(); // reads the translation file again + void UpdateTranslationTable(); // reads the translation file again void SetActualFolder( const INetURLObject& rActualFolder ); const String* GetTransTableFileName() const; @@ -600,7 +605,7 @@ public: void OpenFolder_Impl(); // #83004# ------- - void ReplaceTabWithString( OUString& aValue ); + void ReplaceTabWithString( OUString& aValue ); void CreateDisplayText_Impl(); void CreateVector_Impl( const Sequence < OUString > &rList ); void SortFolderContent_Impl(); @@ -661,11 +666,13 @@ inline void SvtFileView_Impl::EnableDelete( sal_Bool bEnable ) inline sal_Bool SvtFileView_Impl::EnableNameReplacing( sal_Bool bEnable ) { + mpView->EnableRename( bEnable ); + sal_Bool bRet; if( mpView->IsDeleteOrContextMenuEnabled() ) { DBG_ASSERT( !mbReplaceNames, "SvtFileView_Impl::EnableNameReplacing(): state should be not possible!" ); - bRet = !bEnable; // only for enabling this is an unsuccessful result + bRet = !bEnable; // only for enabling this is an unsuccessful result } else { @@ -744,7 +751,8 @@ ViewTabListBox_Impl::ViewTabListBox_Impl( Window* pParentWin, mnSearchIndex ( 0 ), mbResizeDisabled ( sal_False ), mbAutoResize ( sal_False ), - mbEnableDelete ( sal_True ) + mbEnableDelete ( sal_True ), + mbEnableRename ( sal_True ) { Size aBoxSize = pParentWin->GetSizePixel(); @@ -824,7 +832,7 @@ void ViewTabListBox_Impl::Resize() mbResizeDisabled = sal_True; Point aPos = GetPosPixel(); SetPosSizePixel( Point( 0, aBarSize.Height() ), - Size( aBoxSize.Width(), aBoxSize.Height() - aBarSize.Height() ) ); + Size( aBoxSize.Width(), aBoxSize.Height() - aBarSize.Height() ) ); mbResizeDisabled = sal_False; } } @@ -870,20 +878,90 @@ void ViewTabListBox_Impl::KeyInput( const KeyEvent& rKEvt ) PopupMenu* ViewTabListBox_Impl::CreateContextMenu( void ) { - PopupMenu* pRet; - sal_Int32 nSelectedEntries = GetSelectionCount(); + bool bEnableDelete = mbEnableDelete; + bool bEnableRename = mbEnableRename; + + if ( bEnableDelete || bEnableRename ) + { + sal_Int32 nSelectedEntries = GetSelectionCount(); + bEnableDelete &= nSelectedEntries > 0; + bEnableRename &= nSelectedEntries == 1; + } + + if ( bEnableDelete || bEnableRename ) + { + SvLBoxEntry* pEntry = FirstSelected(); + while ( pEntry ) + { + ::ucbhelper::Content aCnt; + try + { + OUString aURL( static_cast< SvtContentEntry * >( + pEntry->GetUserData() )->maURL ); + aCnt = ::ucbhelper::Content( aURL, mxCmdEnv ); + } + catch( Exception const & ) + { + bEnableDelete = bEnableRename = false; + } + + if ( bEnableDelete ) + { + try + { + Reference< XCommandInfo > aCommands = aCnt.getCommands(); + if ( aCommands.is() ) + bEnableDelete + = aCommands->hasCommandByName( + OUString::createFromAscii( "delete" ) ); + else + bEnableDelete = false; + } + catch( Exception const & ) + { + bEnableDelete = false; + } + } + + if ( bEnableRename ) + { + try + { + Reference< XPropertySetInfo > aProps = aCnt.getProperties(); + if ( aProps.is() ) + { + Property aProp + = aProps->getPropertyByName( + OUString::createFromAscii( "Title" ) ); + bEnableRename + = !( aProp.Attributes & PropertyAttribute::READONLY ); + } + else + bEnableRename = false; + } + catch( Exception const & ) + { + bEnableRename = false; + } + } + + pEntry = ( bEnableDelete || bEnableRename ) + ? NextSelected( pEntry ) + : 0; + } + } - if ( nSelectedEntries ) + if ( bEnableDelete || bEnableRename ) { - pRet = new PopupMenu( SvtResId( RID_FILEVIEW_CONTEXTMENU ) ); - pRet->EnableItem( MID_FILEVIEW_DELETE, 0 < nSelectedEntries ); - pRet->EnableItem( MID_FILEVIEW_RENAME, 1 == nSelectedEntries ); + PopupMenu * pRet + = new PopupMenu( SvtResId( RID_FILEVIEW_CONTEXTMENU ) ); + pRet->EnableItem( MID_FILEVIEW_DELETE, bEnableDelete ); + pRet->EnableItem( MID_FILEVIEW_RENAME, bEnableRename ); pRet->RemoveDisabledEntries( sal_True, sal_True ); + return pRet; } - else - pRet = NULL; - return pRet; + return NULL; } // ----------------------------------------------------------------------- @@ -928,12 +1006,31 @@ void ViewTabListBox_Impl::DeleteEntries() aURL = ( (SvtContentEntry*)pCurEntry->GetUserData() )->maURL; if ( !aURL.Len() ) - return; + continue; + + bool canDelete = true; + try + { + ::ucbhelper::Content aCnt( aURL, mxCmdEnv ); + Reference< XCommandInfo > aCommands = aCnt.getCommands(); + if ( aCommands.is() ) + canDelete + = aCommands->hasCommandByName( + OUString::createFromAscii( "delete" ) ); + else + canDelete = false; + } + catch( Exception const & ) + { + canDelete = false; + } - INetURLObject aObj( aURL ); + if (!canDelete) + continue; // process next entry if ( eResult != svtools::QUERYDELETE_ALL ) { + INetURLObject aObj( aURL ); svtools::QueryDeleteDlg_Impl aDlg( NULL, aObj.GetName( INetURLObject::DECODE_WITH_CHARSET ) ); if ( sDialogPosition.Len() ) aDlg.SetWindowState( sDialogPosition ); @@ -979,22 +1076,44 @@ BOOL ViewTabListBox_Impl::EditedEntry( SvLBoxEntry* pEntry, try { + OUString aPropName = OUString::createFromAscii( "Title" ); + bool canRename = true; ::ucbhelper::Content aContent( aURL, mxCmdEnv ); - OUString aPropName = OUString::createFromAscii( "Title" ); - Any aValue; - aValue <<= OUString( rNewText ); - aContent.setPropertyValue( aPropName, aValue ); - mpParent->EntryRenamed( aURL, rNewText ); + try + { + Reference< XPropertySetInfo > aProps = aContent.getProperties(); + if ( aProps.is() ) + { + Property aProp = aProps->getPropertyByName( aPropName ); + canRename = !( aProp.Attributes & PropertyAttribute::READONLY ); + } + else + { + canRename = false; + } + } + catch ( Exception const & ) + { + canRename = false; + } + + if ( canRename ) + { + Any aValue; + aValue <<= OUString( rNewText ); + aContent.setPropertyValue( aPropName, aValue ); + mpParent->EntryRenamed( aURL, rNewText ); - pData->maURL = aURL; - pEntry->SetUserData( pData ); + pData->maURL = aURL; + pEntry->SetUserData( pData ); - bRet = TRUE; + bRet = TRUE; + } + } + catch( Exception const & ) + { } - catch( ::com::sun::star::ucb::ContentCreationException ) {} - catch( ::com::sun::star::ucb::CommandAbortedException ) {} - catch( ::com::sun::star::uno::Exception ) {} return bRet; } @@ -1095,12 +1214,12 @@ sal_Bool ViewTabListBox_Impl::Kill( const OUString& rContent ) ::ucbhelper::Content aCnt( rContent, mxCmdEnv ); aCnt.executeCommand( OUString::createFromAscii( "delete" ), makeAny( sal_Bool( sal_True ) ) ); } - catch( ::com::sun::star::ucb::CommandAbortedException& ) + catch( ::com::sun::star::ucb::CommandAbortedException const & ) { DBG_WARNING( "CommandAbortedException" ); bRet = sal_False; } - catch( ::com::sun::star::uno::Exception& ) + catch( Exception const & ) { DBG_WARNING( "Any other exception" ); bRet = sal_False; @@ -1314,7 +1433,7 @@ sal_Bool SvtFileView::GetParentURL( String& rParentURL ) const } } } - catch( ::com::sun::star::uno::Exception ) + catch( Exception const & ) { // perhaps an unkown url protocol (e.g. "private:newdoc") } @@ -1366,7 +1485,7 @@ sal_Bool SvtFileView::Initialize( const ::com::sun::star::uno::Reference< ::com: mpImp->FilterFolderContent_Impl( rFilter ); - mpImp->SortFolderContent_Impl(); // possibly not necessary!!!!!!!!!! + mpImp->SortFolderContent_Impl(); // possibly not necessary!!!!!!!!!! mpImp->CreateDisplayText_Impl(); mpImp->OpenFolder_Impl(); @@ -1999,7 +2118,7 @@ void SvtFileView_Impl::FilterFolderContent_Impl( const OUString &rFilter ) { // normalize the content title (we always match case-insensitive) // 91872 - 11.09.2001 - frank.schoenheit@sun.com - sCompareString = (*aContentLoop)->GetFileName(); // filter works on file name, not on title! + sCompareString = (*aContentLoop)->GetFileName(); // filter works on file name, not on title! sal_Bool bDelete; if( bHideTransFile && sCompareString == sHideEntry ) @@ -2643,12 +2762,12 @@ QueryDeleteDlg_Impl::QueryDeleteDlg_Impl ModalDialog( pParent, SvtResId( DLG_SVT_QUERYDELETE ) ), - _aEntryLabel ( this, SvtResId( TXT_ENTRY ) ), - _aEntry ( this, SvtResId( TXT_ENTRYNAME ) ), - _aQueryMsg ( this, SvtResId( TXT_QUERYMSG ) ), - _aYesButton ( this, SvtResId( BTN_YES ) ), - _aAllButton ( this, SvtResId( BTN_ALL ) ), - _aNoButton ( this, SvtResId( BTN_NO ) ), + _aEntryLabel ( this, SvtResId( TXT_ENTRY ) ), + _aEntry ( this, SvtResId( TXT_ENTRYNAME ) ), + _aQueryMsg ( this, SvtResId( TXT_QUERYMSG ) ), + _aYesButton ( this, SvtResId( BTN_YES ) ), + _aAllButton ( this, SvtResId( BTN_ALL ) ), + _aNoButton ( this, SvtResId( BTN_NO ) ), _aCancelButton( this, SvtResId( BTN_CANCEL ) ) { @@ -2671,12 +2790,6 @@ QueryDeleteDlg_Impl::QueryDeleteDlg_Impl // ----------------------------------------------------------------------- IMPL_STATIC_LINK( QueryDeleteDlg_Impl, ClickLink, PushButton*, pBtn ) - -/* [Beschreibung] - - Die Methode wertet das Resultat der Abfrage aus. -*/ - { if ( pBtn == &pThis->_aYesButton ) pThis->_eResult = QUERYDELETE_YES; diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index c4896ba8b812..2ad81da40716 100644..100755 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -39,6 +39,8 @@ #include <vcl/edit.hxx> #include "svtaccessiblefactory.hxx" +#include <limits> + // ======================================================================= #define TABBAR_OFFSET_X 7 @@ -62,6 +64,10 @@ struct ImplTabBarItem BOOL mbShort; BOOL mbSelect; BOOL mbEnable; + Color maTabBgColor; + bool IsDefaultTabBgColor() const { return maTabBgColor == Color(COL_AUTO) ? TRUE : FALSE; }; + Color maTabTextColor; + bool IsDefaultTabTextColor() const { return maTabTextColor == Color(COL_AUTO) ? TRUE : FALSE; }; ImplTabBarItem( USHORT nItemId, const XubString& rText, TabBarPageBits nPageBits ) : @@ -74,6 +80,8 @@ struct ImplTabBarItem mbShort = FALSE; mbSelect = FALSE; mbEnable = TRUE; + maTabBgColor = Color( COL_AUTO ); + maTabTextColor = Color( COL_AUTO ); } }; @@ -348,6 +356,9 @@ struct TabBar_Impl // ======================================================================= +const sal_uInt16 TabBar::APPEND = ::std::numeric_limits<sal_uInt16>::max(); +const sal_uInt16 TabBar::PAGE_NOT_FOUND = ::std::numeric_limits<sal_uInt16>::max(); + void TabBar::ImplInit( WinBits nWinStyle ) { mpItemList = new ImplTabBarList; @@ -1046,7 +1057,8 @@ void TabBar::Paint( const Rectangle& ) // Font selektieren Font aFont = GetFont(); Font aLightFont = aFont; - aLightFont.SetWeight( WEIGHT_LIGHT ); + //aLightFont.SetWeight( WEIGHT_LIGHT ); //TODO Make font weight light on custom color only? + aLightFont.SetWeight( WEIGHT_NORMAL ); // #i36013# exclude push buttons from painting area Rectangle aClipRect( Point( mnOffX, 0 ), Point( mnLastOffX, GetOutputHeightPixel() - 1 ) ); @@ -1120,15 +1132,23 @@ void TabBar::Paint( const Rectangle& ) SetFont( aLightFont ); // Je nach Status die richtige FillInBrush setzen + // Set the correct FillInBrush depending upon status if ( pItem->mbSelect || (pItem->mnId == mnCurPageId) ) { + // Currently selected Tab SetFillColor( aSelectColor ); SetTextColor( aSelectTextColor ); } else { - SetFillColor( aFaceColor ); - SetTextColor( aFaceTextColor ); + if ( !pItem->IsDefaultTabBgColor() && !rStyleSettings.GetHighContrastMode() ) + { + SetFillColor( pItem->maTabBgColor ); + SetTextColor( pItem->maTabTextColor ); + } else { + SetFillColor( aFaceColor ); + SetTextColor( aFaceTextColor ); + } } // Muss Font Kursiv geschaltet werden @@ -1160,21 +1180,38 @@ void TabBar::Paint( const Rectangle& ) long nTextHeight = GetTextHeight(); Point aTxtPos( aRect.Left()+(aRectSize.Width()-nTextWidth)/2, (aRectSize.Height()-nTextHeight)/2 ); - if ( !pItem->mbEnable ) - DrawCtrlText( aTxtPos, aText, 0, STRING_LEN, (TEXT_DRAW_DISABLE | TEXT_DRAW_MNEMONIC) ); - else - DrawText( aTxtPos, aText ); - + if ( pItem->IsDefaultTabBgColor() || (!pItem->mbSelect) ) + { + if ( !pItem->mbEnable ) + DrawCtrlText( aTxtPos, aText, 0, STRING_LEN, (TEXT_DRAW_DISABLE | TEXT_DRAW_MNEMONIC) ); + else + DrawText( aTxtPos, aText ); + } // Jetzt im Inhalt den 3D-Effekt ausgeben aPos0.X()++; aPos1.X()++; aPos2.X()--; aPos3.X()--; - SetLineColor( rStyleSettings.GetLightColor() ); + + // If this is the current tab, draw the left inner shadow the default color, + // otherwise make it the same as the custom background color + if ( pItem->mbSelect || (pItem->mnId == mnCurPageId) ) { + SetLineColor( rStyleSettings.GetLightColor() ); + } else { + if ( !pItem->IsDefaultTabBgColor() && ! rStyleSettings.GetHighContrastMode() ) + { + SetLineColor( pItem->maTabBgColor ); + } else { + SetLineColor( rStyleSettings.GetLightColor() ); + } + } + // Draw the left side of the tab DrawLine( aPos0, aPos1 ); if ( !pItem->mbSelect && (pItem->mnId != mnCurPageId) ) { + // Draw the top inner shadow + // ToDo: Change from this static color to tab custom bg color DrawLine( Point( aPos0.X(), aPos0.Y()+1 ), Point( aPos3.X(), aPos3.Y()+1 ) ); } @@ -1184,8 +1221,27 @@ void TabBar::Paint( const Rectangle& ) aPos1.X()--; aPos1.Y()--; aPos2.Y()--; + if ( !pItem->IsDefaultTabBgColor() && ( pItem->mbSelect || (pItem->mnId == mnCurPageId) ) ) + { + SetLineColor( pItem->maTabBgColor ); + DrawLine( Point(aPos1.X()-1, aPos1.Y()-1), Point(aPos2.X(), aPos2.Y()-1) ); + } DrawLine( aPos1, aPos2 ); + // draw a small 2px sliver of the original background color at the bottom of the selected tab + + if ( !pItem->IsDefaultTabBgColor() ) + { + if ( pItem->mbSelect || (pItem->mnId == mnCurPageId) || rStyleSettings.GetHighContrastMode() ) { + SetLineColor( pItem->maTabBgColor ); + DrawLine( Point(aPos1.X()-1, aPos1.Y()-1), Point(aPos2.X(), aPos2.Y()-1) ); + if ( !pItem->mbEnable ) + DrawCtrlText( aTxtPos, aText, 0, STRING_LEN, (TEXT_DRAW_DISABLE | TEXT_DRAW_MNEMONIC) ); + else + DrawText( aTxtPos, aText ); + } + } + // Da etwas uebermalt werden konnte, muessen wir die Polygon- // umrandung nocheinmal ausgeben SetLineColor( rStyleSettings.GetDarkShadowColor() ); @@ -1540,7 +1596,7 @@ void TabBar::InsertPage( USHORT nPageId, const XubString& rText, TabBarPageBits nBits, USHORT nPos ) { DBG_ASSERT( nPageId, "TabBar::InsertPage(): PageId == 0" ); - DBG_ASSERT( GetPagePos( nPageId ) == TABBAR_PAGE_NOTFOUND, + DBG_ASSERT( GetPagePos( nPageId ) == PAGE_NOT_FOUND, "TabBar::InsertPage(): PageId already exists" ); DBG_ASSERT( nBits <= TPB_SPECIAL, "TabBar::InsertPage(): nBits is wrong" ); @@ -1562,12 +1618,47 @@ void TabBar::InsertPage( USHORT nPageId, const XubString& rText, // ----------------------------------------------------------------------- +Color TabBar::GetTabBgColor( USHORT nPageId ) const +{ + USHORT nPos = GetPagePos( nPageId ); + + if ( nPos != PAGE_NOT_FOUND ) + return mpItemList->GetObject( nPos )->maTabBgColor; + else + return Color( COL_AUTO ); +} + +void TabBar::SetTabBgColor( USHORT nPageId, const Color& aTabBgColor ) +{ + USHORT nPos = GetPagePos( nPageId ); + ImplTabBarItem* pItem; + if ( nPos != PAGE_NOT_FOUND ) + { + pItem = mpItemList->GetObject( nPos ); + if ( aTabBgColor != Color( COL_AUTO ) ) + { + pItem->maTabBgColor = aTabBgColor; + if ( aTabBgColor.GetLuminance() <= 128 ) //Do not use aTabBgColor.IsDark(), because that threshold is way too low... + pItem->maTabTextColor = Color( COL_WHITE ); + else + pItem->maTabTextColor = Color( COL_BLACK ); + } + else + { + pItem->maTabBgColor = Color( COL_AUTO ); + pItem->maTabTextColor = Color( COL_AUTO ); + } + } +} + +// ----------------------------------------------------------------------- + void TabBar::RemovePage( USHORT nPageId ) { USHORT nPos = GetPagePos( nPageId ); // Existiert Item - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) { if ( mnCurPageId == nPageId ) mnCurPageId = 0; @@ -1602,7 +1693,7 @@ void TabBar::MovePage( USHORT nPageId, USHORT nNewPos ) return; // Existiert Item - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) { // TabBar-Item in der Liste verschieben ImplTabBarItem* pItem = mpItemList->Remove( nPos ); @@ -1640,7 +1731,7 @@ void TabBar::Clear() if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); - CallEventListeners( VCLEVENT_TABBAR_PAGEREMOVED, (void*) TABBAR_PAGE_NOTFOUND ); + CallEventListeners( VCLEVENT_TABBAR_PAGEREMOVED, (void*) PAGE_NOT_FOUND ); } // ----------------------------------------------------------------------- @@ -1649,7 +1740,7 @@ void TabBar::EnablePage( USHORT nPageId, BOOL bEnable ) { USHORT nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) { ImplTabBarItem* pItem = mpItemList->GetObject( nPos ); @@ -1672,7 +1763,7 @@ BOOL TabBar::IsPageEnabled( USHORT nPageId ) const { USHORT nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) return mpItemList->GetObject( nPos )->mbEnable; else return FALSE; @@ -1684,7 +1775,7 @@ void TabBar::SetPageBits( USHORT nPageId, TabBarPageBits nBits ) { USHORT nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) { ImplTabBarItem* pItem = mpItemList->GetObject( nPos ); @@ -1705,7 +1796,7 @@ TabBarPageBits TabBar::GetPageBits( USHORT nPageId ) const { USHORT nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) return mpItemList->GetObject( nPos )->mnBits; else return FALSE; @@ -1742,7 +1833,7 @@ USHORT TabBar::GetPagePos( USHORT nPageId ) const pItem = mpItemList->Next(); } - return TABBAR_PAGE_NOTFOUND; + return PAGE_NOT_FOUND; } // ----------------------------------------------------------------------- @@ -1767,7 +1858,7 @@ Rectangle TabBar::GetPageRect( USHORT nPageId ) const { USHORT nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) return mpItemList->GetObject( nPos )->maRect; else return Rectangle(); @@ -1780,7 +1871,7 @@ void TabBar::SetCurPageId( USHORT nPageId ) USHORT nPos = GetPagePos( nPageId ); // Wenn Item nicht existiert, dann nichts machen - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) { // Wenn sich aktuelle Page nicht geaendert hat, dann muessen wir // jetzt nichts mehr machen @@ -1872,7 +1963,7 @@ void TabBar::MakeVisible( USHORT nPageId ) USHORT nPos = GetPagePos( nPageId ); // Wenn Item nicht existiert, dann nichts machen - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) { if ( nPos < mnFirstPos ) SetFirstPageId( nPageId ); @@ -1921,7 +2012,7 @@ void TabBar::SetFirstPageId( USHORT nPageId ) USHORT nPos = GetPagePos( nPageId ); // Wenn Item nicht existiert, dann FALSE zurueckgeben - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) { if ( nPos != mnFirstPos ) { @@ -1955,7 +2046,7 @@ void TabBar::SelectPage( USHORT nPageId, BOOL bSelect ) { USHORT nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) { ImplTabBarItem* pItem = mpItemList->GetObject( nPos ); @@ -2036,7 +2127,7 @@ USHORT TabBar::GetSelectPageCount() const BOOL TabBar::IsPageSelected( USHORT nPageId ) const { USHORT nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) return mpItemList->GetObject( nPos )->mbSelect; else return FALSE; @@ -2047,7 +2138,7 @@ BOOL TabBar::IsPageSelected( USHORT nPageId ) const BOOL TabBar::StartEditMode( USHORT nPageId ) { USHORT nPos = GetPagePos( nPageId ); - if ( mpEdit || (nPos == TABBAR_PAGE_NOTFOUND) || (mnLastOffX < 8) ) + if ( mpEdit || (nPos == PAGE_NOT_FOUND) || (mnLastOffX < 8) ) return FALSE; mnEditId = nPageId; @@ -2268,7 +2359,7 @@ void TabBar::SetSelectTextColor( const Color& rColor ) void TabBar::SetPageText( USHORT nPageId, const XubString& rText ) { USHORT nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) { mpItemList->GetObject( nPos )->maText = rText; mbSizeFormat = TRUE; @@ -2286,7 +2377,7 @@ void TabBar::SetPageText( USHORT nPageId, const XubString& rText ) XubString TabBar::GetPageText( USHORT nPageId ) const { USHORT nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) return mpItemList->GetObject( nPos )->maText; else return XubString(); @@ -2297,7 +2388,7 @@ XubString TabBar::GetPageText( USHORT nPageId ) const void TabBar::SetHelpText( USHORT nPageId, const XubString& rText ) { USHORT nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) mpItemList->GetObject( nPos )->maHelpText = rText; } @@ -2306,7 +2397,7 @@ void TabBar::SetHelpText( USHORT nPageId, const XubString& rText ) XubString TabBar::GetHelpText( USHORT nPageId ) const { USHORT nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) { ImplTabBarItem* pItem = mpItemList->GetObject( nPos ); if ( !pItem->maHelpText.Len() && pItem->mnHelpId ) @@ -2327,7 +2418,7 @@ XubString TabBar::GetHelpText( USHORT nPageId ) const void TabBar::SetHelpId( USHORT nPageId, ULONG nHelpId ) { USHORT nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) mpItemList->GetObject( nPos )->mnHelpId = nHelpId; } @@ -2336,7 +2427,7 @@ void TabBar::SetHelpId( USHORT nPageId, ULONG nHelpId ) ULONG TabBar::GetHelpId( USHORT nPageId ) const { USHORT nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) return mpItemList->GetObject( nPos )->mnHelpId; else return 0; @@ -2483,9 +2574,12 @@ USHORT TabBar::ShowDropPos( const Point& rPos ) nX--; else nX++; + if ( !pItem->IsDefaultTabBgColor() && !pItem->mbSelect) + SetLineColor( pItem->maTabTextColor ); DrawLine( Point( nX, nY ), Point( nX, nY ) ); DrawLine( Point( nX+1, nY-1 ), Point( nX+1, nY+1 ) ); DrawLine( Point( nX+2, nY-2 ), Point( nX+2, nY+2 ) ); + SetLineColor( aBlackColor ); } if ( (mnDropPos > 0) && (mnDropPos < nItemCount+1) ) { @@ -2493,6 +2587,8 @@ USHORT TabBar::ShowDropPos( const Point& rPos ) nX = pItem->maRect.Right()-TABBAR_OFFSET_X; if ( mnDropPos == nCurPos ) nX++; + if ( !pItem->IsDefaultTabBgColor() && !pItem->mbSelect) + SetLineColor( pItem->maTabTextColor ); DrawLine( Point( nX, nY ), Point( nX, nY ) ); DrawLine( Point( nX-1, nY-1 ), Point( nX-1, nY+1 ) ); DrawLine( Point( nX-2, nY-2 ), Point( nX-2, nY+2 ) ); diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx index f07ebd7fe8cd..fa393da3d5a8 100644 --- a/svtools/source/control/toolbarmenu.cxx +++ b/svtools/source/control/toolbarmenu.cxx @@ -481,6 +481,9 @@ void ToolbarMenu::implInit(const Reference< XFrame >& rFrame) { mpImpl = new ToolbarMenu_Impl( *this, rFrame ); + const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); + SetControlBackground( rStyleSettings.GetMenuColor() ); + initWindow(); Window* pWindow = GetTopMostParentSystemWindow( this ); @@ -638,8 +641,6 @@ void ToolbarMenu::initWindow() { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); - SetControlBackground( GetSettings().GetStyleSettings().GetFaceGradientColor() ); - SetPointFont( rStyleSettings.GetMenuFont() ); SetBackground( Wallpaper( GetControlBackground() ) ); SetTextColor( rStyleSettings.GetMenuTextColor() ); diff --git a/svtools/source/dialogs/logindlg.cxx b/svtools/source/dialogs/logindlg.cxx deleted file mode 100644 index 036d5d71a4cf..000000000000 --- a/svtools/source/dialogs/logindlg.cxx +++ /dev/null @@ -1,312 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svtools.hxx" -#include <filedlg.hxx> -#include <vcl/msgbox.hxx> -#include <svtools/logindlg.hxx> - -#ifndef _SVTOOLS_LOGINDLG_HRC_ -#include "logindlg.hrc" -#endif -#ifndef _SVTOOLS_HRC -#include <svtools/svtools.hrc> -#endif -#include <svtools/svtdata.hxx> - -#ifdef UNX -#include <limits.h> -#define _MAX_PATH PATH_MAX -#endif - -// LoginDialog ------------------------------------------------------- - -//............................................................................ -namespace svt -{ -//............................................................................ - -void LoginDialog::HideControls_Impl( USHORT nFlags ) -{ - FASTBOOL bPathHide = FALSE; - FASTBOOL bErrorHide = FALSE; - FASTBOOL bAccountHide = FALSE; - - if ( ( nFlags & LF_NO_PATH ) == LF_NO_PATH ) - { - aPathFT.Hide(); - aPathED.Hide(); - aPathBtn.Hide(); - bPathHide = TRUE; - } - else if ( ( nFlags & LF_PATH_READONLY ) == LF_PATH_READONLY ) - { - aPathED.Hide(); - aPathInfo.Show(); - aPathBtn.Hide(); - } - - if ( ( nFlags & LF_NO_USERNAME ) == LF_NO_USERNAME ) - { - aNameFT.Hide(); - aNameED.Hide(); - } - else if ( ( nFlags & LF_USERNAME_READONLY ) == LF_USERNAME_READONLY ) - { - aNameED.Hide(); - aNameInfo.Show(); - } - - if ( ( nFlags & LF_NO_PASSWORD ) == LF_NO_PASSWORD ) - { - aPasswordFT.Hide(); - aPasswordED.Hide(); - } - - if ( ( nFlags & LF_NO_SAVEPASSWORD ) == LF_NO_SAVEPASSWORD ) - aSavePasswdBtn.Hide(); - - if ( ( nFlags & LF_NO_ERRORTEXT ) == LF_NO_ERRORTEXT ) - { - aErrorInfo.Hide(); - aErrorGB.Hide(); - bErrorHide = TRUE; - } - - if ( ( nFlags & LF_NO_ACCOUNT ) == LF_NO_ACCOUNT ) - { - aAccountFT.Hide(); - aAccountED.Hide(); - bAccountHide = TRUE; - } - - if ( bErrorHide ) - { - long nOffset = aLoginGB.GetPosPixel().Y() - - aErrorGB.GetPosPixel().Y(); - Point aNewPnt = aRequestInfo.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aRequestInfo.SetPosPixel( aNewPnt ); - aNewPnt = aPathFT.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aPathFT.SetPosPixel( aNewPnt ); - aNewPnt = aPathED.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aPathED.SetPosPixel( aNewPnt ); - aNewPnt = aPathInfo.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aPathInfo.SetPosPixel( aNewPnt ); - aNewPnt = aPathBtn.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aPathBtn.SetPosPixel( aNewPnt ); - aNewPnt = aNameFT.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aNameFT.SetPosPixel( aNewPnt ); - aNewPnt = aNameED.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aNameED.SetPosPixel( aNewPnt ); - aNewPnt = aNameInfo.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aNameInfo.SetPosPixel( aNewPnt ); - aNewPnt = aPasswordFT.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aPasswordFT.SetPosPixel( aNewPnt ); - aNewPnt = aPasswordED.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aPasswordED.SetPosPixel( aNewPnt ); - aNewPnt = aAccountFT.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aAccountFT.SetPosPixel( aNewPnt ); - aNewPnt = aAccountED.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aAccountED.SetPosPixel( aNewPnt ); - aNewPnt = aSavePasswdBtn.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aSavePasswdBtn.SetPosPixel( aNewPnt ); - aNewPnt = aLoginGB.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aLoginGB.SetPosPixel( aNewPnt ); - Size aNewSiz = GetSizePixel(); - aNewSiz.Height() -= nOffset; - SetSizePixel( aNewSiz ); - } - - if ( bPathHide ) - { - long nOffset = aNameED.GetPosPixel().Y() - - aPathED.GetPosPixel().Y(); - - Point aTmpPnt1 = aNameFT.GetPosPixel(); - Point aTmpPnt2 = aPasswordFT.GetPosPixel(); - aNameFT.SetPosPixel( aPathFT.GetPosPixel() ); - aPasswordFT.SetPosPixel( aTmpPnt1 ); - aAccountFT.SetPosPixel( aTmpPnt2 ); - aTmpPnt1 = aNameED.GetPosPixel(); - aTmpPnt2 = aPasswordED.GetPosPixel(); - aNameED.SetPosPixel( aPathED.GetPosPixel() ); - aPasswordED.SetPosPixel( aTmpPnt1 ); - aAccountED.SetPosPixel( aTmpPnt2 ); - aNameInfo.SetPosPixel( aPathInfo.GetPosPixel() ); - aTmpPnt1 = aSavePasswdBtn.GetPosPixel(); - aTmpPnt1.Y() -= nOffset; - aSavePasswdBtn.SetPosPixel( aTmpPnt1 ); - Size aNewSz = GetSizePixel(); - aNewSz.Height() -= nOffset; - SetSizePixel( aNewSz ); - } - - if ( bAccountHide ) - { - long nOffset = aAccountED.GetPosPixel().Y() - aPasswordED.GetPosPixel().Y(); - - Point aTmpPnt = aSavePasswdBtn.GetPosPixel(); - aTmpPnt.Y() -= nOffset; - aSavePasswdBtn.SetPosPixel( aTmpPnt ); - Size aNewSz = GetSizePixel(); - aNewSz.Height() -= nOffset; - SetSizePixel( aNewSz ); - } -}; - -// ----------------------------------------------------------------------- - -IMPL_LINK( LoginDialog, OKHdl_Impl, OKButton *, EMPTYARG ) -{ - // trim the strings - aNameED.SetText( aNameED.GetText().EraseLeadingChars(). - EraseTrailingChars() ); - aPasswordED.SetText( aPasswordED.GetText().EraseLeadingChars(). - EraseTrailingChars() ); - EndDialog( RET_OK ); - return 1; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( LoginDialog, PathHdl_Impl, PushButton *, EMPTYARG ) -{ - PathDialog* pDlg = new PathDialog( this, WB_3DLOOK ); -// DirEntry aEntry; -// aEntry.ToAbs(); -// pDlg->SetPath( aEntry.GetFull() ); - - if ( pDlg->Execute() == RET_OK ) - aPathED.SetText( pDlg->GetPath() ); - - delete pDlg; - return 1; -} - -// ----------------------------------------------------------------------- - -LoginDialog::LoginDialog -( - Window* pParent, - USHORT nFlags, - const String& rServer, - const String* pRealm -) : - - ModalDialog( pParent, SvtResId( DLG_LOGIN ) ), - - aErrorInfo ( this, SvtResId( INFO_LOGIN_ERROR ) ), - aErrorGB ( this, SvtResId( GB_LOGIN_ERROR ) ), - aRequestInfo ( this, SvtResId( INFO_LOGIN_REQUEST ) ), - aPathFT ( this, SvtResId( FT_LOGIN_PATH ) ), - aPathED ( this, SvtResId( ED_LOGIN_PATH ) ), - aPathInfo ( this, SvtResId( INFO_LOGIN_PATH ) ), - aPathBtn ( this, SvtResId( BTN_LOGIN_PATH ) ), - aNameFT ( this, SvtResId( FT_LOGIN_USERNAME ) ), - aNameED ( this, SvtResId( ED_LOGIN_USERNAME ) ), - aNameInfo ( this, SvtResId( INFO_LOGIN_USERNAME ) ), - aPasswordFT ( this, SvtResId( FT_LOGIN_PASSWORD ) ), - aPasswordED ( this, SvtResId( ED_LOGIN_PASSWORD ) ), - aAccountFT ( this, SvtResId( FT_LOGIN_ACCOUNT ) ), - aAccountED ( this, SvtResId( ED_LOGIN_ACCOUNT ) ), - aSavePasswdBtn ( this, SvtResId( CB_LOGIN_SAVEPASSWORD ) ), - aLoginGB ( this, SvtResId( GB_LOGIN_LOGIN ) ), - aOKBtn ( this, SvtResId( BTN_LOGIN_OK ) ), - aCancelBtn ( this, SvtResId( BTN_LOGIN_CANCEL ) ), - aHelpBtn ( this, SvtResId( BTN_LOGIN_HELP ) ) - -{ - // Einlog-Ort eintragen - String aServer; - - if ( ( ( nFlags & LF_NO_ACCOUNT ) == LF_NO_ACCOUNT ) && pRealm && pRealm->Len() ) - { - aServer = *pRealm; - ( ( aServer += ' ' ) += String( SvtResId( STR_LOGIN_AT ) ) ) += ' '; - } - aServer += rServer; - String aTxt = aRequestInfo.GetText(); - aTxt.SearchAndReplaceAscii( "%1", aServer ); - aRequestInfo.SetText( aTxt ); - - FreeResource(); - - aPathED.SetMaxTextLen( _MAX_PATH ); - aNameED.SetMaxTextLen( _MAX_PATH ); - - aOKBtn.SetClickHdl( LINK( this, LoginDialog, OKHdl_Impl ) ); - aPathBtn.SetClickHdl( LINK( this, LoginDialog, PathHdl_Impl ) ); - - HideControls_Impl( nFlags ); -}; - -// ----------------------------------------------------------------------- - -void LoginDialog::SetName( const String& rNewName ) -{ - aNameED.SetText( rNewName ); - aNameInfo.SetText( rNewName ); -} - -// ----------------------------------------------------------------------- - -void LoginDialog::ClearPassword() -{ - aPasswordED.SetText( String() ); - - if ( 0 == aNameED.GetText().Len() ) - aNameED.GrabFocus(); - else - aPasswordED.GrabFocus(); -}; - -// ----------------------------------------------------------------------- - -void LoginDialog::ClearAccount() -{ - aAccountED.SetText( String() ); - aAccountED.GrabFocus(); -}; - -//............................................................................ -} // namespace svt -//............................................................................ diff --git a/svtools/source/dialogs/logindlg.src b/svtools/source/dialogs/logindlg.src deleted file mode 100644 index f6e3565d8cd9..000000000000 --- a/svtools/source/dialogs/logindlg.src +++ /dev/null @@ -1,200 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SVTOOLS_HRC -#include <svtools/svtools.hrc> -#endif - -#ifndef _SVTOOLS_LOGINDLG_HRC_ -#include "logindlg.hrc" -#endif - -ModalDialog DLG_LOGIN -{ -// HelpId = HID_DLG_LOGIN ; - Border = TRUE ; - Moveable = TRUE ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 265 , 158 ) ; - FixedText INFO_LOGIN_ERROR - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 185 , 18 ) ; - WordBreak = TRUE ; - }; - FixedLine GB_LOGIN_ERROR - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 197 , 8 ) ; - Text [ en-US ] = "Message from server" ; - }; - FixedText INFO_LOGIN_REQUEST - { - Pos = MAP_APPFONT ( 12 , 55 ) ; - Size = MAP_APPFONT ( 185 , 18 ) ; - WordBreak = TRUE ; - Text [ en-US ] = "Please enter user name and password for %1." ; - }; - FixedText FT_LOGIN_PATH - { - Pos = MAP_APPFONT ( 12 , 77 ) ; - Size = MAP_APPFONT ( 57 , 10 ) ; - Text [ en-US ] = "~Path" ; - }; - Edit ED_LOGIN_PATH - { - Border = TRUE ; - Pos = MAP_APPFONT ( 72 , 76 ) ; - Size = MAP_APPFONT ( 108 , 12 ) ; - }; - FixedText INFO_LOGIN_PATH - { - Hide = TRUE ; - Pos = MAP_APPFONT ( 72 , 77 ) ; - Size = MAP_APPFONT ( 125 , 10 ) ; - }; - PushButton BTN_LOGIN_PATH - { - Pos = MAP_APPFONT ( 183 , 75 ) ; - Size = MAP_APPFONT ( 14 , 14 ) ; - Text = "~..." ; - }; - FixedText FT_LOGIN_USERNAME - { - Pos = MAP_APPFONT ( 12 , 92 ) ; - Size = MAP_APPFONT ( 57 , 10 ) ; - Text [ en-US ] = "~User name" ; - }; - Edit ED_LOGIN_USERNAME - { - Border = TRUE ; - Pos = MAP_APPFONT ( 72 , 91 ) ; - Size = MAP_APPFONT ( 125 , 12 ) ; - }; - FixedText INFO_LOGIN_USERNAME - { - Hide = TRUE ; - Pos = MAP_APPFONT ( 72 , 92 ) ; - Size = MAP_APPFONT ( 125 , 10 ) ; - }; - FixedText FT_LOGIN_PASSWORD - { - Pos = MAP_APPFONT ( 12 , 107 ) ; - Size = MAP_APPFONT ( 57 , 10 ) ; - Text [ en-US ] = "Pass~word" ; - }; - Edit ED_LOGIN_PASSWORD - { - Border = TRUE ; - Pos = MAP_APPFONT ( 72 , 106 ) ; - Size = MAP_APPFONT ( 125 , 12 ) ; - PassWord = TRUE ; - }; - FixedText FT_LOGIN_ACCOUNT - { - Pos = MAP_APPFONT ( 12 , 122 ) ; - Size = MAP_APPFONT ( 57 , 10 ) ; - Text [ en-US ] = "A~ccount"; - }; - Edit ED_LOGIN_ACCOUNT - { - Border = TRUE ; - Pos = MAP_APPFONT ( 72 , 121 ) ; - Size = MAP_APPFONT ( 125 , 12 ) ; - PassWord = TRUE ; - }; - CheckBox CB_LOGIN_SAVEPASSWORD - { - Pos = MAP_APPFONT ( 12 , 136 ) ; - Size = MAP_APPFONT ( 185 , 10 ) ; - Text [ en-US ] = "~Save password" ; - }; - FixedLine GB_LOGIN_LOGIN - { - Pos = MAP_APPFONT ( 7 , 44 ) ; - Size = MAP_APPFONT ( 197 , 8 ) ; - Text [ en-US ] = "Log in" ; - }; - OKButton BTN_LOGIN_OK - { - Pos = MAP_APPFONT ( 209 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - DefButton = TRUE ; - }; - CancelButton BTN_LOGIN_CANCEL - { - Pos = MAP_APPFONT ( 209 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - }; - HelpButton BTN_LOGIN_HELP - { - Pos = MAP_APPFONT ( 209 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - }; - String STR_LOGIN_AT - { - Text [ en-US ] = "to " ; - }; - Text [ en-US ] = "User Name and Password Required" ; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/svtools/source/dialogs/makefile.mk b/svtools/source/dialogs/makefile.mk index 16528ee7d4cd..99c4b59b76ae 100644..100755 --- a/svtools/source/dialogs/makefile.mk +++ b/svtools/source/dialogs/makefile.mk @@ -44,7 +44,6 @@ SRC1FILES= filedlg2.src \ prnsetup.src \ printdlg.src \ colrdlg.src \ - logindlg.src \ addresstemplate.src \ wizardmachine.src @@ -69,8 +68,7 @@ SLOFILES= \ $(SLO)$/colrdlg.obj \ $(SLO)$/property.obj \ $(SLO)$/wizdlg.obj \ - $(SLO)$/mcvmath.obj \ - $(SLO)$/logindlg.obj + $(SLO)$/mcvmath.obj # --- Targets ------------------------------------------------------ diff --git a/svtools/source/misc/errtxt.src b/svtools/source/misc/errtxt.src index 6c1a90ae6412..f33896e20003 100644 --- a/svtools/source/misc/errtxt.src +++ b/svtools/source/misc/errtxt.src @@ -328,23 +328,23 @@ Resource RID_ERRHDL }; String ERRCODE_INET_CONNECT { - Text [ en-US ] = "Could not establish Internet connection to $(ARG1)." ; + Text [ en-US ] = "Could not establish network connection to $(ARG1)." ; }; String ERRCODE_INET_READ { - Text [ en-US ] = "Error reading data from the Internet.\nServer error message: $(ARG1)." ; + Text [ en-US ] = "Error reading data from the network.\nServer error message: $(ARG1)." ; }; String ERRCODE_INET_WRITE { - Text [ en-US ] = "Error transferring data to the Internet.\nServer error message: $(ARG1)." ; + Text [ en-US ] = "Error transferring data to the network.\nServer error message: $(ARG1)." ; }; String ERRCODE_INET_GENERAL { - Text [ en-US ] = "General Internet error has occurred." ; + Text [ en-US ] = "General network error has occurred." ; }; String ERRCODE_INET_OFFLINE { - Text [ en-US ] = "The requested Internet data is not available in the cache and cannot be transmitted as the Online mode has not be activated." ; + Text [ en-US ] = "The requested network data is not available in the cache and cannot be transmitted as the Online mode has not be activated." ; }; String ERRCODE_SFXMSG_STYLEREPLACE { diff --git a/svtools/source/misc/langtab.src b/svtools/source/misc/langtab.src index 1cb20d27fc12..067eb601a5af 100644 --- a/svtools/source/misc/langtab.src +++ b/svtools/source/misc/langtab.src @@ -319,6 +319,10 @@ StringArray STR_ARR_SVT_LANGUAGE_TABLE < "Sardinian, Logudorese" ; LANGUAGE_USER_SARDINIAN_LOGUDORESE ; > ; < "Sardinian, Sassarese" ; LANGUAGE_USER_SARDINIAN_SASSARESE ; > ; < "Bafia" ; LANGUAGE_USER_BAFIA ; > ; + < "Gikuyu" ; LANGUAGE_USER_GIKUYU ; > ; + < "Yoruba" ; LANGUAGE_YORUBA ; > ; + < "Rusyn (Ukraine)" ; LANGUAGE_USER_RUSYN_UKRAINE ; > ; + < "Rusyn (Slovakia)" ; LANGUAGE_USER_RUSYN_SLOVAKIA ; > ; }; }; diff --git a/svtools/source/misc/makefile.mk b/svtools/source/misc/makefile.mk index 65e43747a586..32781dbfefb1 100644..100755 --- a/svtools/source/misc/makefile.mk +++ b/svtools/source/misc/makefile.mk @@ -75,7 +75,8 @@ SLOFILES=\ $(SLO)$/transfer.obj \ $(SLO)$/transfer2.obj \ $(SLO)$/unitconv.obj \ - $(SLO)$/wallitem.obj + $(SLO)$/wallitem.obj \ + $(SLO)$/xwindowitem.obj # --- Targets ------------------------------------------------------- diff --git a/svtools/source/misc/xwindowitem.cxx b/svtools/source/misc/xwindowitem.cxx new file mode 100755 index 000000000000..a382d8293617 --- /dev/null +++ b/svtools/source/misc/xwindowitem.cxx @@ -0,0 +1,97 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_svtools.hxx" + +#include "svtools/xwindowitem.hxx" + +#include <vcl/window.hxx> + + +using namespace ::com::sun::star; + +////////////////////////////////////////////////////////////////////// + +TYPEINIT1_FACTORY( XWindowItem, SfxPoolItem, new XWindowItem ); + + +XWindowItem::XWindowItem() : + SfxPoolItem() +{ +} + + +XWindowItem::XWindowItem( USHORT nWhichId, Window * pWin ) : + SfxPoolItem( nWhichId ) +{ + if (pWin) + { + m_xWin = uno::Reference< awt::XWindow >( pWin->GetComponentInterface(), uno::UNO_QUERY ); + // the assertion can't possibly fails since VCLXWindow implements XWindow... + DBG_ASSERT( m_xWin.is(), "failed to get XWindow" ); + } +} + + +XWindowItem::XWindowItem( USHORT nWhichId, uno::Reference< awt::XWindow > & rxWin ) : + SfxPoolItem( nWhichId ), + m_xWin( rxWin ) +{ +} + + +XWindowItem::XWindowItem( const XWindowItem &rItem ) : + SfxPoolItem( Which() ), + m_xWin( rItem.m_xWin ) +{ +} + + +XWindowItem::~XWindowItem() +{ +} + + +SfxPoolItem * XWindowItem::Clone( SfxItemPool* /*pPool*/ ) const +{ + return new XWindowItem( *this ); +} + + +int XWindowItem::operator == ( const SfxPoolItem & rAttr ) const +{ + DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); + + const XWindowItem * pItem = dynamic_cast< const XWindowItem * >(&rAttr); + return pItem ? m_xWin == pItem->m_xWin : 0; +} + + +////////////////////////////////////////////////////////////////////// + + diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx index 67fc5f619fdf..ade58688dc55 100644 --- a/svtools/source/svhtml/parhtml.cxx +++ b/svtools/source/svhtml/parhtml.cxx @@ -2118,11 +2118,7 @@ enum eHtmlMetas { }; // <META NAME=xxx> -#ifdef __MINGW32__ // for runtime pseudo reloc -static HTMLOptionEnum aHTMLMetaNameTable[] = -#else static HTMLOptionEnum __READONLY_DATA aHTMLMetaNameTable[] = -#endif { { OOO_STRING_SVTOOLS_HTML_META_author, HTML_META_AUTHOR }, { OOO_STRING_SVTOOLS_HTML_META_changed, HTML_META_CHANGED }, diff --git a/svtools/source/table/gridtablerenderer.cxx b/svtools/source/table/gridtablerenderer.cxx index a3f954e0bef5..8e5bd181a583 100644 --- a/svtools/source/table/gridtablerenderer.cxx +++ b/svtools/source/table/gridtablerenderer.cxx @@ -109,7 +109,10 @@ namespace svt { namespace table DBG_ASSERT( !!pColumn, "GridTableRenderer::PaintColumnHeader: invalid column model object!" ); if ( !!pColumn ) sHeaderText = pColumn->getName(); - _rDevice.SetTextColor(m_pImpl->rModel.getTextColor()); + if(m_pImpl->rModel.getTextColor() != 0x000000) + _rDevice.SetTextColor(m_pImpl->rModel.getTextColor()); + else + _rDevice.SetTextColor(_rStyle.GetFieldTextColor()); ULONG nHorFlag = TEXT_DRAW_LEFT; ULONG nVerFlag = TEXT_DRAW_TOP; if(m_pImpl->rModel.getVerticalAlign() == 1) @@ -146,6 +149,11 @@ namespace svt { namespace table Color aRowBackground = m_pImpl->rModel.getOddRowBackgroundColor(); Color line = m_pImpl->rModel.getLineColor(); Color aRowBackground2 = m_pImpl->rModel.getEvenRowBackgroundColor(); + Color fieldColor = _rStyle.GetFieldColor(); + if(aRowBackground == 0xFFFFFF) + aRowBackground = fieldColor; + if(aRowBackground2 == 0xFFFFFF) + aRowBackground2 = fieldColor; //if row is selected background color becomes blue, and lines should be also blue //if they aren't user defined if(_bSelected) @@ -161,7 +169,7 @@ namespace svt { namespace table //and set line color to be the same else { - if(aRowBackground2 != 0xFFFFFF && _nRow%2) + if(aRowBackground2 != fieldColor && _nRow%2) { aRowBackground = aRowBackground2; if(line == 0xFFFFFF) @@ -170,7 +178,7 @@ namespace svt { namespace table _rDevice.SetLineColor(line); } //fill the rows with alternating background colors if second background color is specified - else if(aRowBackground != 0xFFFFFF && line == 0xFFFFFF) + else if(aRowBackground != fieldColor && line == 0xFFFFFF) _rDevice.SetLineColor(aRowBackground); else { @@ -195,7 +203,10 @@ namespace svt { namespace table _rDevice.Push( PUSH_LINECOLOR); _rDevice.SetLineColor(_rStyle.GetSeparatorColor()); _rDevice.DrawLine( _rArea.BottomLeft(), _rArea.BottomRight() ); - _rDevice.SetTextColor(m_pImpl->rModel.getTextColor()); + if(m_pImpl->rModel.getTextColor() != 0x000000) + _rDevice.SetTextColor(m_pImpl->rModel.getTextColor()); + else + _rDevice.SetTextColor(_rStyle.GetFieldTextColor()); ULONG nHorFlag = TEXT_DRAW_LEFT; ULONG nVerFlag = TEXT_DRAW_TOP; if(m_pImpl->rModel.getVerticalAlign() == 1) @@ -221,44 +232,42 @@ namespace svt { namespace table void GridTableRenderer::PaintCellImage( ColPos _nColumn, bool _bSelected, bool _bActive, OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle, Image* _pCellData ) { - _rDevice.Push( PUSH_LINECOLOR | PUSH_FILLCOLOR | PUSH_CLIPREGION); - _rDevice.IntersectClipRegion( _rArea ); - Color background1 = m_pImpl->rModel.getOddRowBackgroundColor(); - Color background2 = m_pImpl->rModel.getEvenRowBackgroundColor(); - Color line = m_pImpl->rModel.getLineColor(); - //if row is selected and line color isn't user specified, set it blue - if(_bSelected) - { - if(line == 0xFFFFFF) - _rDevice.SetLineColor(_rStyle.GetHighlightColor()); - else - _rDevice.SetLineColor(line); - } - //else set line color to the color of row background - else - { - if(background2 != 0xFFFFFF && m_pImpl->nCurrentRow%2) + _rDevice.Push( PUSH_LINECOLOR | PUSH_FILLCOLOR); + Color background1 = m_pImpl->rModel.getOddRowBackgroundColor(); + Color background2 = m_pImpl->rModel.getEvenRowBackgroundColor(); + Color line = m_pImpl->rModel.getLineColor(); + //if row is selected and line color isn't user specified, set it blue + if(_bSelected) { if(line == 0xFFFFFF) - _rDevice.SetLineColor(background2); + _rDevice.SetLineColor(_rStyle.GetHighlightColor()); else _rDevice.SetLineColor(line); } - else if(background1 != 0xFFFFFF && line == 0xFFFFFF) - _rDevice.SetLineColor(background1); + //else set line color to the color of row background else { - //if line color is set, then it was user defined and should be visible - //if it wasn't set, it'll be the same as the default background color, so lines still won't be visible - _rDevice.SetLineColor(line); + if(background2 != 0xFFFFFF && m_pImpl->nCurrentRow%2) + { + if(line == 0xFFFFFF) + _rDevice.SetLineColor(background2); + else + _rDevice.SetLineColor(line); + } + else if(background1 != 0xFFFFFF && line == 0xFFFFFF) + _rDevice.SetLineColor(background1); + else + { + //if line color is set, then it was user defined and should be visible + //if it wasn't set, it'll be the same as the default background color, so lines still won't be visible + _rDevice.SetLineColor(line); + } } - } - _rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight() ); - { - // TODO: remove those temporary place holders - Rectangle aRect( _rArea ); - ++aRect.Left(); --aRect.Right(); - aRect.Top(); aRect.Bottom(); + _rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight() ); + + Rectangle aRect( _rArea ); + ++aRect.Left(); --aRect.Right(); + aRect.Top(); aRect.Bottom(); Point imagePos(Point(aRect.Left(), aRect.Top())); Size imageSize = _pCellData->GetSizePixel(); if(aRect.GetWidth() > imageSize.Width()) @@ -281,8 +290,7 @@ namespace svt { namespace table imageSize.Height() = aRect.GetHeight()-1; Image& image (*_pCellData); _rDevice.DrawImage(imagePos, imageSize, image, 0); - } - _rDevice.Pop(); + _rDevice.Pop(); (void)_bActive; // no special painting for the active cell at the moment @@ -293,48 +301,47 @@ namespace svt { namespace table OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle, rtl::OUString& _rText ) { _rDevice.Push( PUSH_LINECOLOR | PUSH_FILLCOLOR ); - Color background1 = m_pImpl->rModel.getOddRowBackgroundColor(); - Color background2 = m_pImpl->rModel.getEvenRowBackgroundColor(); - Color line = m_pImpl->rModel.getLineColor(); - //if row is selected and line color isn't user specified, set it blue - if(_bSelected) - { - if(line == 0xFFFFFF) - _rDevice.SetLineColor(_rStyle.GetHighlightColor()); - else - _rDevice.SetLineColor(line); - } - //else set line color to the color of row background - else - { - if(background2 != 0xFFFFFF && m_pImpl->nCurrentRow%2) + Color background1 = m_pImpl->rModel.getOddRowBackgroundColor(); + Color background2 = m_pImpl->rModel.getEvenRowBackgroundColor(); + Color line = m_pImpl->rModel.getLineColor(); + //if row is selected and line color isn't user specified, set it blue + if(_bSelected) { if(line == 0xFFFFFF) - _rDevice.SetLineColor(background2); + _rDevice.SetLineColor(_rStyle.GetHighlightColor()); else _rDevice.SetLineColor(line); } - else if(background1 != 0xFFFFFF && line == 0xFFFFFF) - _rDevice.SetLineColor(background1); + //else set line color to the color of row background else { - //if Line color is set, then it was user defined and should be visible - //if it wasn't set, it'll be the same as the default background color, so lines still won't be visible - _rDevice.SetLineColor(line); + if(background2 != 0xFFFFFF && m_pImpl->nCurrentRow%2) + { + if(line == 0xFFFFFF) + _rDevice.SetLineColor(background2); + else + _rDevice.SetLineColor(line); + } + else if(background1 != 0xFFFFFF && line == 0xFFFFFF) + _rDevice.SetLineColor(background1); + else + { + //if Line color is set, then it was user defined and should be visible + //if it wasn't set, it'll be the same as the default background color, so lines still won't be visible + _rDevice.SetLineColor(line); + } } - } - _rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight() ); - { - // TODO: remove those temporary place holders - Rectangle aRect( _rArea ); - ++aRect.Left(); --aRect.Right(); - aRect.Top(); aRect.Bottom(); + _rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight() ); + + Rectangle aRect( _rArea ); + ++aRect.Left(); --aRect.Right(); + aRect.Top(); aRect.Bottom(); if(_bSelected) - { _rDevice.SetTextColor(_rStyle.GetHighlightTextColor()); - } - else + else if(m_pImpl->rModel.getTextColor() != 0x000000) _rDevice.SetTextColor(m_pImpl->rModel.getTextColor()); + else + _rDevice.SetTextColor(_rStyle.GetFieldTextColor()); ULONG nHorFlag = TEXT_DRAW_LEFT; ULONG nVerFlag = TEXT_DRAW_TOP; if(m_pImpl->rModel.getVerticalAlign() == 1) @@ -348,8 +355,8 @@ namespace svt { namespace table Rectangle textRect(_rArea); textRect.Left()+=4; textRect.Right()-=4; textRect.Bottom()-=2; - _rDevice.DrawText( textRect, _rText, nHorFlag | nVerFlag | TEXT_DRAW_CLIP); - } + _rDevice.DrawText( textRect, _rText, nHorFlag | nVerFlag | TEXT_DRAW_CLIP); + _rDevice.Pop(); (void)_bActive; // no special painting for the active cell at the moment diff --git a/svtools/source/table/tablecontrol.cxx b/svtools/source/table/tablecontrol.cxx index 1770bfd7dd02..33c80e642118 100644 --- a/svtools/source/table/tablecontrol.cxx +++ b/svtools/source/table/tablecontrol.cxx @@ -70,6 +70,7 @@ namespace svt { namespace table :Control( _pParent, _nStyle ) ,m_pImpl( new TableControl_Impl( *this ) ) ,m_bSelectionChanged(false) + ,m_bTooltip(false) { TableDataWindow* aTableData = m_pImpl->getDataWindow(); aTableData->SetMouseButtonDownHdl( LINK( this, TableControl, ImplMouseButtonDownHdl ) ); @@ -306,7 +307,7 @@ namespace svt { namespace table aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ColumnHeaderBar" ) ); break; case TCTYPE_TABLECELL: - aRetText = GetRowName(_nRow); + aRetText = GetAccessibleCellText(_nRow, _nCol); break; case TCTYPE_ROWHEADERCELL: aRetText = GetRowName(_nRow); @@ -389,9 +390,9 @@ namespace svt { namespace table } // ----------------------------------------------------------------------------- -::rtl::OUString TableControl::GetAccessibleCellText( sal_Int32 _nRowPos, sal_Int32 _nColPos) +::rtl::OUString TableControl::GetAccessibleCellText( sal_Int32 _nRowPos, sal_Int32 _nColPos) const { - ::com::sun::star::uno::Any cellContent = GetCellContent(_nRowPos, _nColPos); + const ::com::sun::star::uno::Any cellContent = GetCellContent(_nRowPos, _nColPos); return m_pImpl->convertToString(cellContent); } // ----------------------------------------------------------------------------- @@ -589,6 +590,7 @@ void TableControl::setTooltip(const ::com::sun::star::uno::Sequence< ::rtl::OUSt { m_aText = aText; m_nCols = nCols; + m_bTooltip = true; } // ----------------------------------------------------------------------- void TableControl::selectionChanged(bool _bChanged) @@ -596,6 +598,11 @@ void TableControl::selectionChanged(bool _bChanged) m_bSelectionChanged = _bChanged; } // ----------------------------------------------------------------------- +bool TableControl::isTooltip() +{ + return m_bTooltip; +} +// ----------------------------------------------------------------------- IMPL_LINK( TableControl, ImplSelectHdl, void*, EMPTYARG ) { Select(); diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx index 3288ab6a4284..90bc4899209b 100644 --- a/svtools/source/table/tablecontrol_impl.cxx +++ b/svtools/source/table/tablecontrol_impl.cxx @@ -609,10 +609,10 @@ namespace svt { namespace table if(pColumn->getMinWidth() == 0 && bResizable) { pColumn->setMinWidth(1); - minColWithoutFixedSum+=m_rAntiImpl.LogicToPixel( Size( 1, 0 ), MAP_APPFONT ).Width(); + minColWithoutFixedSum+=m_rAntiImpl.PixelToLogic( Size( 1, 0 ), MAP_APPFONT ).Width(); } if(pColumn->getMaxWidth() == 0 && bResizable) - pColumn->setMaxWidth(m_rAntiImpl.LogicToPixel( Size( (int)gridWidth, 0 ), MAP_APPFONT ).Width()); + pColumn->setMaxWidth(m_rAntiImpl.PixelToLogic( Size( (int)gridWidth, 0 ), MAP_APPFONT ).Width()); if( colPrefWidth != 0) { if(m_bResizingGrid) @@ -884,6 +884,16 @@ namespace svt { namespace table // position it if ( m_pHScroll ) { + TableSize nVisibleUnits = lcl_getColumnsVisibleWithin( aDataCellPlayground, m_nLeftColumn, *this, false ); + int nRange = m_nColumnCount; + if( m_nLeftColumn + nVisibleUnits == nRange-1) + { + if(m_aAccColumnWidthsPixel[nRange-2] - m_aAccColumnWidthsPixel[m_nLeftColumn] + m_aColumnWidthsPixel[nRange-1]>aDataCellPlayground.GetWidth()) + { + m_pHScroll->SetVisibleSize( nVisibleUnits -1 ); + m_pHScroll->SetPageSize(nVisibleUnits -1); + } + } Rectangle aScrollbarArea( Point( 0, aDataCellPlayground.Bottom() + 1 ), Size( aDataCellPlayground.Right() + 1, nScrollbarMetrics ) @@ -1000,7 +1010,6 @@ namespace svt { namespace table *m_pDataWindow, aCell.getRect(), rStyle ); } } - // the area occupied by the row header, if any Rectangle aRowHeaderArea; if ( m_pModel->hasRowHeaders() ) @@ -1014,12 +1023,13 @@ namespace svt { namespace table //to avoid double lines when scrolling vertically if(m_nTopRow != 0) --aRowHeaderArea.Top(); + --aRowHeaderArea.Right(); pRenderer->PaintHeaderArea(*m_pDataWindow, aRowHeaderArea, false, true, rStyle); // Note that strictly, aRowHeaderArea also contains the intersection between column // and row header area. However, below we go to paint this intersection, again, // so this hopefully doesn't hurt if we already paint it here. - if ( getModel()->hasColumnHeaders() ) + if ( m_pModel->hasColumnHeaders() ) { TableCellGeometry aIntersection( *this, Rectangle( Point( 0, 0 ), aAllCellsWithHeaders.BottomRight() ), COL_ROW_HEADERS, ROW_COL_HEADERS ); @@ -1030,6 +1040,7 @@ namespace svt { namespace table --aInters.Top(); --aInters.Bottom(); } + --aInters.Right(); pRenderer->PaintHeaderArea( *m_pDataWindow, aInters, true, true, rStyle ); @@ -1068,6 +1079,11 @@ namespace svt { namespace table --aRect.Top(); if(m_nLeftColumn != 0) --aRect.Left(); + else + { + if(m_pModel->hasRowHeaders()) + --aRect.Left(); + } // give the redenderer a chance to prepare the row pRenderer->PrepareRow( aRowIterator.getRow(), isActiveRow, isSelectedRow, *m_pDataWindow, aRect, rStyle ); @@ -1908,6 +1924,11 @@ namespace svt { namespace table return -1; } //------------------------------------------------------------------------------- + bool TableControl_Impl::isTooltipActive() + { + return m_rAntiImpl.isTooltip(); + } + //------------------------------------------------------------------------------- ::rtl::OUString& TableControl_Impl::setTooltip(const Point& rPoint ) { ::rtl::OUString aTooltipText; @@ -2033,8 +2054,8 @@ namespace svt { namespace table { m_pDataWindow->HideTracking(); PColumnModel pColumn = m_pModel->getColumnModel(m_nResizingColumn); - int maxWidth = pColumn->getMaxWidth(); - int minWidth = pColumn->getMinWidth(); + int maxWidth = m_rAntiImpl.LogicToPixel( Size( pColumn->getMaxWidth(), 0 ), MAP_APPFONT ).Width(); + int minWidth = m_rAntiImpl.LogicToPixel( Size( pColumn->getMinWidth(), 0 ), MAP_APPFONT ).Width(); int resizeCol = m_nResizingColumn-m_nLeftColumn; //new position of mouse int actX = rPoint.X(); @@ -2044,7 +2065,7 @@ namespace svt { namespace table int leftX = 0; if(m_nResizingColumn > m_nLeftColumn) leftX = m_aVisibleColumnWidthsPixel[resizeCol-1]; - else if(m_nResizingColumn == 0 && m_pModel->hasRowHeaders()) + else if(m_nResizingColumn == m_nLeftColumn && m_pModel->hasRowHeaders()) leftX = m_rAntiImpl.LogicToPixel( Size( m_pModel->getRowHeaderWidth(), 0 ), MAP_APPFONT ).Width(); int actWidth = actX - leftX; int newActWidth = 0; @@ -2057,7 +2078,7 @@ namespace svt { namespace table pColumn->setPreferredWidth(newActWidth); } else - pColumn->setPreferredWidth(minWidth); + pColumn->setPreferredWidth(pColumn->getMinWidth()); if(m_nLeftColumn != 0) impl_updateLeftColumn(); } @@ -2069,7 +2090,7 @@ namespace svt { namespace table pColumn->setPreferredWidth(newActWidth); } else - pColumn->setPreferredWidth(maxWidth); + pColumn->setPreferredWidth(pColumn->getMaxWidth()); } m_nCurColumn = m_nResizingColumn; impl_ni_updateColumnWidths(); diff --git a/svtools/source/table/tablecontrol_impl.hxx b/svtools/source/table/tablecontrol_impl.hxx index 12b518aa3578..053766d92841 100644 --- a/svtools/source/table/tablecontrol_impl.hxx +++ b/svtools/source/table/tablecontrol_impl.hxx @@ -210,6 +210,7 @@ namespace svt { namespace table virtual void showCursor(); virtual bool dispatchAction( TableControlAction _eAction ); virtual SelectionEngine* getSelEngine(); + virtual bool isTooltipActive(); virtual rtl::OUString& setTooltip(const Point& rPoint ); virtual void resizeColumn(const Point& rPoint); virtual bool startResizeColumn(const Point& rPoint); diff --git a/svtools/source/table/tabledatawindow.cxx b/svtools/source/table/tabledatawindow.cxx index 3245b7e84aac..e2e1ce5353fe 100644 --- a/svtools/source/table/tabledatawindow.cxx +++ b/svtools/source/table/tabledatawindow.cxx @@ -58,14 +58,33 @@ namespace svt { namespace table { m_rTableControl.doPaintContent( rUpdateRect ); } - + //-------------------------------------------------------------------- + void TableDataWindow::SetBackground( const Wallpaper& rColor ) + { + Window::SetBackground( rColor ); + } + //-------------------------------------------------------------------- + void TableDataWindow::SetControlBackground( const Color& rColor ) + { + Window::SetControlBackground( rColor ); + } + //-------------------------------------------------------------------- + void TableDataWindow::SetBackground() + { + Window::SetBackground(); + } + //-------------------------------------------------------------------- + void TableDataWindow::SetControlBackground() + { + Window::SetControlBackground(); + } //-------------------------------------------------------------------- void TableDataWindow::MouseMove( const MouseEvent& rMEvt ) { Point aPoint = rMEvt.GetPosPixel(); if ( !m_rTableControl.getInputHandler()->MouseMove( m_rTableControl, rMEvt ) ) { - if(m_rTableControl.getCurrentRow(aPoint)>=0 ) + if(m_rTableControl.getCurrentRow(aPoint)>=0 && m_rTableControl.isTooltipActive() ) { SetPointer(POINTER_ARROW); rtl::OUString& rHelpText = m_rTableControl.setTooltip(aPoint); @@ -102,12 +121,9 @@ namespace svt { namespace table m_nRowAlreadySelected = nCurRow; m_aSelectHdl.Call( NULL ); } - else - m_aMouseButtonDownHdl.Call((MouseEvent*) &rMEvt); } - else - m_aMouseButtonDownHdl.Call((MouseEvent*) &rMEvt); } + m_aMouseButtonDownHdl.Call((MouseEvent*) &rMEvt); m_rTableControl.getAntiImpl().LoseFocus(); } //-------------------------------------------------------------------- @@ -115,8 +131,7 @@ namespace svt { namespace table { if ( !m_rTableControl.getInputHandler()->MouseButtonUp( m_rTableControl, rMEvt ) ) Window::MouseButtonUp( rMEvt ); - else - m_aMouseButtonUpHdl.Call((MouseEvent*) &rMEvt); + m_aMouseButtonUpHdl.Call((MouseEvent*) &rMEvt); m_rTableControl.getAntiImpl().GetFocus(); } //-------------------------------------------------------------------- diff --git a/svtools/source/uno/svtxgridcontrol.cxx b/svtools/source/uno/svtxgridcontrol.cxx index 99b36c390f23..f5bc837f60b0 100755 --- a/svtools/source/uno/svtxgridcontrol.cxx +++ b/svtools/source/uno/svtxgridcontrol.cxx @@ -191,7 +191,7 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An } case BASEPROPERTY_GRID_HEADER_BACKGROUND: { - sal_Int32 colorHeader = 0x000000; + sal_Int32 colorHeader = 0xFFFFFF; if( aValue >>= colorHeader ) { m_pTableModel->setHeaderBackgroundColor(colorHeader); @@ -200,7 +200,7 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An } case BASEPROPERTY_GRID_LINE_COLOR: { - sal_Int32 colorLine = 0x000000; + sal_Int32 colorLine = 0xFFFFFF; if( aValue >>= colorLine ) { m_pTableModel->setLineColor(colorLine); @@ -209,7 +209,7 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An } case BASEPROPERTY_GRID_EVEN_ROW_BACKGROUND: { - sal_Int32 colorEvenRow = 0x000000; + sal_Int32 colorEvenRow = 0xFFFFFF; if( aValue >>= colorEvenRow ) { m_pTableModel->setEvenRowBackgroundColor(colorEvenRow); @@ -218,7 +218,7 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An } case BASEPROPERTY_GRID_ROW_BACKGROUND: { - sal_Int32 colorBackground = 0x000000; + sal_Int32 colorBackground = 0xFFFFFF; if( aValue >>= colorBackground ) { m_pTableModel->setOddRowBackgroundColor(colorBackground); @@ -227,7 +227,7 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An } case BASEPROPERTY_TEXTCOLOR: { - sal_Int32 colorText = 0xFFFFFF; + sal_Int32 colorText = 0x000000; if( aValue >>= colorText ) { m_pTableModel->setTextColor(colorText); @@ -673,10 +673,10 @@ void SAL_CALL SVTXGridControl::selectRows(const ::com::sun::star::uno::Sequence< if((start >= 0 && start < m_pTableModel->getRowCount()) && (end >= 0 && end < m_pTableModel->getRowCount())) { std::vector<RowPos>& selectedRows = pTable->GetSelectedRows(); - if(!selectedRows.empty()) - selectedRows.clear(); if(eSelMode == SINGLE_SELECTION) { + if(!selectedRows.empty()) + selectedRows.clear(); if(rangeOfRows.getLength() == 1) selectedRows.push_back(start); else @@ -685,7 +685,10 @@ void SAL_CALL SVTXGridControl::selectRows(const ::com::sun::star::uno::Sequence< else { for(int i=0;i<seqSize;i++) - selectedRows.push_back(rangeOfRows[i]); + { + if(!isSelectedIndex(rangeOfRows[i])) + selectedRows.push_back(rangeOfRows[i]); + } } pTable->selectionChanged(true); pTable->InvalidateDataWindow(start, end, false); @@ -713,24 +716,23 @@ void SAL_CALL SVTXGridControl::selectAllRows() throw (::com::sun::star::uno::Run SetSynthesizingVCLEvent( sal_False ); } } + void SAL_CALL SVTXGridControl::deselectRows(const ::com::sun::star::uno::Sequence< ::sal_Int32 >& rangeOfRows) throw (::com::sun::star::uno::RuntimeException) { TableControl* pTable = (TableControl*)GetWindow(); std::vector<RowPos>& selectedRows = pTable->GetSelectedRows(); std::vector<RowPos>::iterator itStart = selectedRows.begin(); std::vector<RowPos>::iterator itEnd = selectedRows.end(); - sal_Int32 start = rangeOfRows[0]; - sal_Int32 end = rangeOfRows[rangeOfRows.getLength()-1]; - if((start >= 0 && start < m_pTableModel->getRowCount()) && (end >= 0 && end < m_pTableModel->getRowCount())) + for(int i = 0; i < rangeOfRows.getLength(); i++ ) { - std::vector<RowPos>::iterator iter = std::find(itStart, itEnd, start); - selectedRows.erase(iter, iter+(end-start)+1); - pTable->selectionChanged(true); - pTable->InvalidateDataWindow(start, end, false); - SetSynthesizingVCLEvent( sal_True ); - pTable->Select(); - SetSynthesizingVCLEvent( sal_False ); + std::vector<RowPos>::iterator iter = std::find(itStart, itEnd, rangeOfRows[i]); + selectedRows.erase(iter); } + pTable->selectionChanged(true); + pTable->Invalidate(); + SetSynthesizingVCLEvent( sal_True ); + pTable->Select(); + SetSynthesizingVCLEvent( sal_False ); } void SAL_CALL SVTXGridControl::deselectAllRows() throw (::com::sun::star::uno::RuntimeException) @@ -869,7 +871,7 @@ void SVTXGridControl::ImplCallItemListeners() aEvent.Range = diff; } //selected row changed - else if(diff == 0) + else if(diff == 0 && actSelRowCount != 0) { aEvent.Row = selRows[actSelRowCount-1]; aEvent.Action = com::sun::star::awt::grid::SelectionEventType(2); diff --git a/toolkit/source/helper/property.cxx b/toolkit/source/helper/property.cxx index 9a3dc7b9bfb3..3a83465a3218 100644 --- a/toolkit/source/helper/property.cxx +++ b/toolkit/source/helper/property.cxx @@ -284,9 +284,9 @@ ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount ) DECL_PROP_3 ( "SelectionModel", GRID_SELECTIONMODE, ::com::sun::star::view::SelectionType, BOUND, MAYBEDEFAULT, MAYBEVOID ), DECL_PROP_2 ( "EnableVisible", ENABLEVISIBLE, sal_Bool, BOUND, MAYBEDEFAULT ), DECL_PROP_3 ( "ReferenceDevice", REFERENCE_DEVICE, Reference< XDevice >,BOUND, MAYBEDEFAULT, TRANSIENT ), - DECL_PROP_3 ( "EvenRowBackgroundColor", GRID_EVEN_ROW_BACKGROUND, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ), - DECL_PROP_3 ( "HeaderBackgroundColor", GRID_HEADER_BACKGROUND, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ), - DECL_PROP_3 ( "LineColor", GRID_LINE_COLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ), + DECL_PROP_3 ( "EvenRowBackgroundColor", GRID_EVEN_ROW_BACKGROUND, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ), + DECL_PROP_3 ( "HeaderBackgroundColor", GRID_HEADER_BACKGROUND, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ), + DECL_PROP_3 ( "GridLineColor", GRID_LINE_COLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ), DECL_PROP_3 ( "RowBackgroundColor", GRID_ROW_BACKGROUND, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID ) }; pPropertyInfos = aImplPropertyInfos; diff --git a/tools/bootstrp/makefile.mk b/tools/bootstrp/makefile.mk index b592cb900630..41188d2117d0 100644 --- a/tools/bootstrp/makefile.mk +++ b/tools/bootstrp/makefile.mk @@ -38,6 +38,10 @@ LIBTARGET=NO CDEFS+=-D_TOOLS_STRINGLIST +.IF "$(HAVE_GETOPT)" == "YES" +CDEFS += -DHAVE_GETOPT +.ENDIF + # --- Files -------------------------------------------------------- OBJFILES= \ @@ -83,6 +87,11 @@ APP2TARGET= rscdep APP2OBJS= $(OBJ)$/rscdep.obj APP2LIBS= $(LB)$/$(TARGET).lib $(LB)$/$(TARGET1).lib APP2STDLIBS= $(SALLIB) $(VOSLIB) $(TOOLSLIB) $(BASEGFXLIB) $(UCBHELPERLIB) $(CPPULIB) $(COMPHELPERLIB) $(I18NISOLANGLIB) $(CPPUHELPERLIB) $(SALHELPERLIB) +.IF "$(HAVE_GETOPT)" != "YES" +.IF "$(OS)"=="WNT" +APP2STDLIBS+=gnu_getopt.lib +.ENDIF +.ENDIF APP2RPATH= NONE APP2RPATH= NONE APP2RPATH= NONE diff --git a/tools/bootstrp/rscdep.cxx b/tools/bootstrp/rscdep.cxx index 5c18793c9833..37edfc6a8c18 100644 --- a/tools/bootstrp/rscdep.cxx +++ b/tools/bootstrp/rscdep.cxx @@ -45,6 +45,16 @@ #include "cppdep.hxx" +#if defined WNT +#if !defined HAVE_GETOPT +#define __STDC__ 1 +#define __GNU_LIBRARY__ +#include <external/glibc/getopt.h> +#else +#include <getopt.h> +#endif +#endif + class RscHrcDep : public CppDep { public: @@ -70,15 +80,6 @@ void RscHrcDep::Execute() //static String aDelim; -/* poor man's getopt() */ -int simple_getopt(char *argv[], const char *optstring); -#if defined(WNT) || defined(OS2) -static char *optarg = NULL; -static int optind = 1; -static int optopt = 0; -static int opterr = 0; -#endif - SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv ) { int c; @@ -179,7 +180,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv ) while( 1 ) { - c = simple_getopt( argv, + c = getopt( argc, argv, "_abcdefghi:jklmnopqrstuvwxyzABCDEFGHI:JKLMNOPQRSTUVWXYZ1234567890/-+=.\\()\""); if ( c == -1 ) break; @@ -296,41 +297,3 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv ) return 0; } -/* my very simple minded implementation of getopt() - * it's too sad that getopt() is not available everywhere - * note: this is not a full POSIX conforming getopt() - */ -int simple_getopt(char *argv[], const char *optstring) -{ - char *arg = argv[optind]; - - /* skip all response file arguments */ - if ( arg ) { - while ( *arg == '@' ) - arg = argv[++optind]; - - if ( arg[0] == '-' && arg[1] != '\0' ) { - const char *popt; - int c = arg[1]; - if ( (popt = strchr(optstring, c)) == NULL ) { - optopt = c; - if ( opterr ) - fprintf(stderr, "Unknown option character `\\x%x'.\n", optopt); - return '?'; - } - if ( *(++popt) == ':') { - if ( arg[2] != '\0' ) { - optarg = ++arg; - } else { - optarg = argv[++optind]; - } - } else { - optarg = NULL; - } - ++optind; - return c; - } - } - return -1; -} - diff --git a/tools/inc/tools/color.hxx b/tools/inc/tools/color.hxx index 56d596453740..a99ad1dd11c4 100644 --- a/tools/inc/tools/color.hxx +++ b/tools/inc/tools/color.hxx @@ -78,7 +78,7 @@ typedef UINT32 ColorData; #define COL_YELLOW RGB_COLORDATA( 0xFF, 0xFF, 0x00 ) #define COL_WHITE RGB_COLORDATA( 0xFF, 0xFF, 0xFF ) #define COL_TRANSPARENT TRGB_COLORDATA( 0xFF, 0xFF, 0xFF, 0xFF ) -#define COL_AUTO (UINT32)0xFFFFFFFF +#define COL_AUTO (ColorData)0xFFFFFFFF #define COL_AUTHOR1_DARK RGB_COLORDATA(198, 146, 0) #define COL_AUTHOR1_NORMAL RGB_COLORDATA(255, 255, 158) #define COL_AUTHOR1_LIGHT RGB_COLORDATA(255, 255, 195) diff --git a/svtools/source/dialogs/logindlg.hrc b/tools/inc/tools/svlibrary.hxx index 7baf6010f531..fa8ff7c8068b 100644 --- a/svtools/source/dialogs/logindlg.hrc +++ b/tools/inc/tools/svlibrary.hxx @@ -24,34 +24,19 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ +#ifndef _SVLIBRARY_HXX +#define _SVLIBRARY_HXX +#include "tools/toolsdllapi.h" -#ifndef _SVTOOLS_LOGINDLG_HRC_ -#define _SVTOOLS_LOGINDLG_HRC_ +#include <osl/module.hxx> +#include <rtl/ustring.hxx> -//============================================================================ -#define INFO_LOGIN_ERROR 10 -#define GB_LOGIN_ERROR 11 +class TOOLS_DLLPUBLIC SvLibrary +{ +public: + static bool LoadModule( osl::Module&, const rtl::OUString& rLibName, ::oslGenericFunction baseModule, ::sal_Int32 mode = SAL_LOADMODULE_DEFAULT ); +}; -#define INFO_LOGIN_REQUEST 20 -#define FT_LOGIN_PATH 21 -#define ED_LOGIN_PATH 22 -#define INFO_LOGIN_PATH 23 -#define BTN_LOGIN_PATH 24 -#define FT_LOGIN_USERNAME 25 -#define ED_LOGIN_USERNAME 26 -#define INFO_LOGIN_USERNAME 27 -#define FT_LOGIN_PASSWORD 28 -#define ED_LOGIN_PASSWORD 29 -#define FT_LOGIN_ACCOUNT 30 -#define ED_LOGIN_ACCOUNT 31 -#define CB_LOGIN_SAVEPASSWORD 32 -#define GB_LOGIN_LOGIN 33 +#endif -#define BTN_LOGIN_OK 50 -#define BTN_LOGIN_CANCEL 51 -#define BTN_LOGIN_HELP 52 - -#define STR_LOGIN_AT 60 - -#endif // _SVTOOLS_LOGINDLG_HRC_ diff --git a/tools/inc/tools/wintypes.hxx b/tools/inc/tools/wintypes.hxx index 8f13af8fd842..7d6296b76e8c 100644 --- a/tools/inc/tools/wintypes.hxx +++ b/tools/inc/tools/wintypes.hxx @@ -215,6 +215,7 @@ typedef sal_Int64 WinBits; // Window-Bits for CheckBox #define WB_CBLINESTYLE ((WinBits)SAL_CONST_INT64(0x2000000000)) +#define WB_EARLYTOGGLE ((WinBits)SAL_CONST_INT64(0x4000000000)) // Window-Bits for Edit #define WB_PASSWORD ((WinBits)0x01000000) diff --git a/tools/prj/d.lst b/tools/prj/d.lst index 6b4a99a3a676..e0291c2f8ad0 100644 --- a/tools/prj/d.lst +++ b/tools/prj/d.lst @@ -37,6 +37,7 @@ mkdir: %_DEST%\inc%_EXT%\bootstrp ..\inc\tools\postextstl.h %_DEST%\inc%_EXT%\tools\postextstl.h ..\inc\tools\preextstl.h %_DEST%\inc%_EXT%\tools\preextstl.h +..\inc\tools\svlibrary.hxx %_DEST%\inc%_EXT%\tools\svlibrary.hxx ..\inc\tools\solarmutex.hxx %_DEST%\inc%_EXT%\tools\solarmutex.hxx ..\inc\tools\wintypes.hxx %_DEST%\inc%_EXT%\tools\wintypes.hxx ..\inc\tools\mapunit.hxx %_DEST%\inc%_EXT%\tools\mapunit.hxx diff --git a/tools/source/generic/makefile.mk b/tools/source/generic/makefile.mk index 5cdaa02065ae..07bab82f32b0 100644 --- a/tools/source/generic/makefile.mk +++ b/tools/source/generic/makefile.mk @@ -37,9 +37,10 @@ TARGET=gen # --- Files -------------------------------------------------------- -EXCEPTIONSFILES = $(SLO)$/poly.obj $(OBJ)$/poly.obj +EXCEPTIONSFILES = $(SLO)$/poly.obj $(OBJ)$/poly.obj $(SLO)$/svlibrary.obj SLOFILES= $(SLO)$/toolsin.obj \ + $(SLO)$/svlibrary.obj \ $(SLO)$/b3dtrans.obj \ $(SLO)$/link.obj \ $(SLO)$/bigint.obj \ diff --git a/tools/source/generic/svlibrary.cxx b/tools/source/generic/svlibrary.cxx new file mode 100644 index 000000000000..6ebfd0086b5c --- /dev/null +++ b/tools/source/generic/svlibrary.cxx @@ -0,0 +1,129 @@ +/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_tools.hxx"
+
+#include <tools/svlibrary.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/util/XMacroExpander.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <comphelper/processfactory.hxx>
+#include <tools/string.hxx>
+#include <rtl/uri.hxx>
+
+using namespace com::sun::star;
+
+static uno::Sequence< rtl::OUString > GetMultiPaths_Impl()
+{
+ uno::Sequence< rtl::OUString > aRes;
+ uno::Sequence< rtl::OUString > aInternalPaths;
+ uno::Sequence< rtl::OUString > aUserPaths;
+
+ bool bSuccess = true;
+ uno::Reference< lang::XMultiServiceFactory > xMgr( comphelper::getProcessServiceFactory() );
+ if (xMgr.is())
+ {
+ try
+ {
+ String aInternal;
+ aInternal.AppendAscii("Libraries");
+ String aUser;
+ aUser.AppendAscii("Libraries");
+ aInternal .AppendAscii( "_internal" );
+ aUser .AppendAscii( "_user" );
+
+ uno::Reference< beans::XPropertySet > xPathSettings( xMgr->createInstance(
+ rtl::OUString::createFromAscii( "com.sun.star.util.PathSettings" ) ), uno::UNO_QUERY_THROW );
+ xPathSettings->getPropertyValue( aInternal ) >>= aInternalPaths;
+ xPathSettings->getPropertyValue( aUser ) >>= aUserPaths;
+ }
+ catch (uno::Exception &)
+ {
+ bSuccess = false;
+ }
+ }
+ if (bSuccess)
+ {
+ sal_Int32 nMaxEntries = aInternalPaths.getLength() + aUserPaths.getLength();
+ aRes.realloc( nMaxEntries );
+ rtl::OUString *pRes = aRes.getArray();
+ sal_Int32 nCount = 0; // number of actually added entries
+ for (int i = 0; i < 2; ++i)
+ {
+ const uno::Sequence< rtl::OUString > &rPathSeq = i == 0 ? aUserPaths : aInternalPaths;
+ const rtl::OUString *pPathSeq = rPathSeq.getConstArray();
+ for (sal_Int32 k = 0; k < rPathSeq.getLength(); ++k)
+ {
+ const bool bAddUser = (&rPathSeq == &aUserPaths);
+ const bool bAddInternal = (&rPathSeq == &aInternalPaths);
+ if ((bAddUser || bAddInternal) && pPathSeq[k].getLength() > 0)
+ pRes[ nCount++ ] = pPathSeq[k];
+ }
+ }
+ aRes.realloc( nCount );
+ }
+
+ return aRes;
+}
+
+bool SvLibrary::LoadModule( osl::Module& rModule, const rtl::OUString& rLibName, ::oslGenericFunction baseModule, ::sal_Int32 mode )
+{
+ static uno::Sequence < rtl::OUString > aPaths = GetMultiPaths_Impl();
+ bool bLoaded = false;
+
+ for (sal_Int32 n=0; n<aPaths.getLength(); n++)
+ {
+ rtl::OUString aMod = aPaths[n];
+ if ( aPaths[n].indexOfAsciiL("vnd.sun.star.expand",19) == 0)
+ {
+ uno::Reference< uno::XComponentContext > xComponentContext = comphelper::getProcessComponentContext();
+ uno::Reference< util::XMacroExpander > xMacroExpander;
+ xComponentContext->getValueByName(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.util.theMacroExpander") ) )
+ >>= xMacroExpander;
+
+ aMod = aMod.copy( sizeof("vnd.sun.star.expand:") -1 );
+ aMod = ::rtl::Uri::decode( aMod, rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 );
+ aMod = xMacroExpander->expandMacros( aMod );
+ }
+
+ aMod += ::rtl::OUString( sal_Unicode('/') );
+ aMod += rLibName;
+ bLoaded = rModule.load( aMod, mode );
+ if ( bLoaded )
+ break;
+ }
+
+ if (!bLoaded )
+ bLoaded = rModule.loadRelative( baseModule, rLibName, mode );
+
+ return bLoaded;
+}
diff --git a/ucbhelper/source/provider/simpleauthenticationrequest.cxx b/ucbhelper/source/provider/simpleauthenticationrequest.cxx index 8fc0cd4aec4f..8fc94cf88438 100644 --- a/ucbhelper/source/provider/simpleauthenticationrequest.cxx +++ b/ucbhelper/source/provider/simpleauthenticationrequest.cxx @@ -200,13 +200,13 @@ SimpleAuthenticationRequest::SimpleAuthenticationRequest( //========================================================================= void SimpleAuthenticationRequest::initialize( - const ucb::URLAuthenticationRequest & rRequest, - sal_Bool bCanSetRealm, - sal_Bool bCanSetUserName, - sal_Bool bCanSetPassword, - sal_Bool bCanSetAccount, - sal_Bool bAllowPersistentStoring, - sal_Bool bAllowUseSystemCredentials ) + const ucb::URLAuthenticationRequest & rRequest, + sal_Bool bCanSetRealm, + sal_Bool bCanSetUserName, + sal_Bool bCanSetPassword, + sal_Bool bCanSetAccount, + sal_Bool bAllowPersistentStoring, + sal_Bool bAllowUseSystemCredentials ) { setRequest( uno::makeAny( rRequest ) ); diff --git a/unotools/source/misc/fontcvt.cxx b/unotools/source/misc/fontcvt.cxx index 1a31272a483c..2bb682e4915b 100644 --- a/unotools/source/misc/fontcvt.cxx +++ b/unotools/source/misc/fontcvt.cxx @@ -295,18 +295,18 @@ static const sal_Unicode aWingDings2Tab[224] = // F050 0xe52f, 0xe530, 0xe531, 0xe532, 0xe533, 0xe534, 0xe535, 0xe536, - 0xe537, 0xe538, 0xe539, 0xe53a, + 0xe537, 0x203D, 0x203D, 0x203D, 0xe53b, 0xe53c, 0xe53d, 0xe53e, // F060 0xe53f, 0xe540, 0xe541, 0xe542, 0xe543, 0xe544, 0xe545, 0xe546, - 0xe547, 0xe548, 0xe549, 0xe54a, - 0xe54b, 0xe54c, 0xe54d, 0xe54e, + 0xe547, 0x24EA, 0x2460, 0x2461, + 0x2462, 0x2463, 0x2464, 0x2465, // F070 - 0xe54e, 0xe54f, 0xe550, 0xe551, - 0xe552, 0xe553, 0xe554, 0xe555, - 0xe556, 0xe557, 0xe558, 0xe559, - 0xe55a, 0xe55b, 0xe55c, 0, + 0x2466, 0x2467, 0x2468, 0x2469, + 0xE453, 0x278A, 0x278B, 0x278C, + 0x278D, 0x278E, 0x278F, 0x2790, + 0x2791, 0x2792, 0x2793, 0, // F080 0x2609, 0x25cb, 0x263d, 0x263e, 0xe55d, 0xe55e, 0xe55f, 0xe560, @@ -343,7 +343,7 @@ static const sal_Unicode aWingDings2Tab[224] = 0xe5c1, 0xe5c2, 0xe5c3, 0xe5c4, 0xe5c5, 0xe5c6, 0xe5c7, 0xe5c8, // F0f0 - 0xe5c9, 0xe5ca, 0xe5cb, 0xe5cc, + 0xe5c9, 0x2022, 0xe5cb, 0xe5cc, 0xe5cd, 0xe5ce, 0xe5cf, 0xe5d0, 0x203b, 0x2042, 0, 0, 0, 0, 0, 0 diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx index 4a3532b44659..c1c222755599 100644 --- a/unotools/source/misc/fontdefs.cxx +++ b/unotools/source/misc/fontdefs.cxx @@ -37,6 +37,7 @@ struct ImplLocalizedFontName const sal_Unicode* mpLocalizedNames; }; +// TODO: where did the 0,0 delimiters come from? A single 0 should suffice... static sal_Unicode const aBatang[] = { 0xBC14, 0xD0D5, 0, 0 }; static sal_Unicode const aBatangChe[] = { 0xBC14, 0xD0D5, 0xCCB4, 0, 0 }; static sal_Unicode const aGungsuh[] = { 0xAD81, 0xC11C, 0, 0 }; @@ -72,6 +73,8 @@ static sal_Unicode const aMSGothic[] = { 'm','s', 0x30B4, 0x30B7, 0x30C3, static sal_Unicode const aMSPGothic[] = { 'm','s','p', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0, 0 }; static sal_Unicode const aMSMincho[] = { 'm', 's', 0x660E, 0x671D, 0 }; static sal_Unicode const aMSPMincho[] = { 'm','s','p', 0x660E, 0x671D, 0 }; +static sal_Unicode const aMSYaHei[] = { 0x5FAE, 0x8F6F, 0x96C5, 0x9ED1, 0 }; +static sal_Unicode const aMSJhengHei[] = { 0x5FAE, 0x8EDF, 0x6B63, 0x9ED1, 0x9AD4, 0 }; static sal_Unicode const aMeiryo[] = { 0x30e1, 0x30a4, 0x30ea, 0x30aa, 0 }; static sal_Unicode const aHGMinchoL[] = { 'h','g', 0x660E, 0x671D, 'l', 0, 0 }; static sal_Unicode const aHGGothicB[] = { 'h','g', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 'b', 0 }; @@ -180,7 +183,6 @@ static sal_Unicode const aHiraginoKakuGothicProN[] = { 0x30D2, 0x30E9, 0x30AE, static sal_Unicode const aHiraginoMaruGothicPro[] = { 0x30D2, 0x30E9, 0x30AE, 0x30CE, 0x4E38, 0x30B4, 'p','r','o',0}; static sal_Unicode const aHiraginoMaruGothicProN[] = { 0x30D2, 0x30E9, 0x30AE, 0x30CE, 0x4E38, 0x30B4, 'p','r','o','n',0}; - static ImplLocalizedFontName aImplLocalizedNamesList[] = { { "batang", aBatang }, @@ -216,6 +218,8 @@ static ImplLocalizedFontName aImplLocalizedNamesList[] = { "mspgothic", aMSPGothic }, { "msmincho", aMSMincho }, { "mspmincho", aMSPMincho }, +{ "microsoftjhenghei", aMSJhengHei }, +{ "microsoftyahei", aMSYaHei }, { "meiryo", aMeiryo }, { "hgminchol", aHGMinchoL }, { "hggothicb", aHGGothicB }, @@ -513,8 +517,6 @@ void AddTokenFontName( String& rName, const String& rNewToken ) ImplAppendFontToken( rName, rNewToken ); } - - // ======================================================================= String GetSubsFontName( const String& rName, ULONG nFlags ) diff --git a/vcl/aqua/inc/salframeview.h b/vcl/aqua/inc/salframeview.h index 498c9679e97c..0174c1a68832 100755 --- a/vcl/aqua/inc/salframeview.h +++ b/vcl/aqua/inc/salframeview.h @@ -108,6 +108,7 @@ -(MacOSBOOL)sendKeyToFrameDirect: (USHORT)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod; -(MacOSBOOL)sendSingleCharacter:(NSEvent*)pEvent; -(MacOSBOOL)handleKeyDownException:(NSEvent*)pEvent; +-(void)clearLastEvent; /* text action methods */ diff --git a/vcl/aqua/inc/salgdi.h b/vcl/aqua/inc/salgdi.h index 247de1b95dec..1948018806e1 100644 --- a/vcl/aqua/inc/salgdi.h +++ b/vcl/aqua/inc/salgdi.h @@ -191,7 +191,7 @@ public: virtual sal_Bool drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ); virtual sal_Bool drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ); virtual sal_Bool drawPolyPolygonBezier( ULONG nPoly, const ULONG* pPoints, const SalPoint* const* pPtAry, const BYTE* const* pFlgAry ); - virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin); + virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ); // CopyArea --> No RasterOp, but ClipRegion virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth, diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx index 5b1e24befc9b..8a4744d1efcd 100644 --- a/vcl/aqua/source/gdi/salgdi.cxx +++ b/vcl/aqua/source/gdi/salgdi.cxx @@ -988,6 +988,7 @@ bool AquaSalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPol // ----------------------------------------------------------------------- bool AquaSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon& rPolyLine, + double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin eLineJoin ) { @@ -1032,6 +1033,7 @@ bool AquaSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon& rPolyLine, CGContextAddPath( mrContext, xPath ); // draw path with antialiased line CGContextSetShouldAntialias( mrContext, true ); + CGContextSetAlpha( mrContext, 1.0 - fTransparency ); CGContextSetLineJoin( mrContext, aCGLineJoin ); CGContextSetLineWidth( mrContext, rLineWidths.getX() ); CGContextDrawPath( mrContext, kCGPathStroke ); diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm index 0dfa0fa356aa..25dadf0e592b 100755 --- a/vcl/aqua/source/window/salframeview.mm +++ b/vcl/aqua/source/window/salframeview.mm @@ -1510,6 +1510,11 @@ private: mbKeyHandled = true; } +-(void)clearLastEvent +{ + mpLastEvent = nil; +} + - (NSRect)firstRectForCharacterRange:(NSRange)theRange { SalExtTextInputPosEvent aPosEvent; diff --git a/vcl/aqua/source/window/salmenu.cxx b/vcl/aqua/source/window/salmenu.cxx index f39d7c675bc4..ed3086d8506f 100644 --- a/vcl/aqua/source/window/salmenu.cxx +++ b/vcl/aqua/source/window/salmenu.cxx @@ -370,6 +370,10 @@ bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rR displayPopupFrame.origin.y = pWin->ImplGetFrame()->maGeometry.nY - pParentAquaSalFrame->maGeometry.nY + offset; pParentAquaSalFrame->VCLToCocoa(displayPopupFrame, false); + // #i111992# if this menu was opened due to a key event, prevent dispatching that yet again + if( [pParentNSView respondsToSelector: @selector(clearLastEvent)] ) + [pParentNSView performSelector:@selector(clearLastEvent)]; + // open popup menu NSPopUpButtonCell * pPopUpButtonCell = [[NSPopUpButtonCell alloc] initTextCell:@"" pullsDown:NO]; [pPopUpButtonCell setMenu: pCopyMenu]; diff --git a/vcl/inc/vcl/abstdlg.hxx b/vcl/inc/vcl/abstdlg.hxx index 1d4e08991bda..2fa134af5078 100644..100755 --- a/vcl/inc/vcl/abstdlg.hxx +++ b/vcl/inc/vcl/abstdlg.hxx @@ -66,6 +66,16 @@ public: virtual void Sync() = 0; }; +class VCL_DLLPUBLIC AbstractPasswordToOpenModifyDialog : public VclAbstractDialog +{ +public: + virtual String GetPasswordToOpen() const = 0; + virtual String GetPasswordToModify() const = 0; + virtual bool IsRecommendToOpenReadonly() const = 0; +}; + +//------------------------------------------------------------- + class VCL_DLLPUBLIC VclAbstractDialogFactory { public: @@ -74,6 +84,9 @@ public: // nDialogId was previously a ResId without ResMgr; the ResourceId is now // an implementation detail of the factory virtual VclAbstractDialog* CreateVclDialog( Window* pParent, sal_uInt32 nResId ) = 0; + + // creates instance of PasswordToOpenModifyDialog from cui + virtual AbstractPasswordToOpenModifyDialog * CreatePasswordToOpenModifyDialog( Window * pParent, sal_uInt16 nMinPasswdLen, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify ) = 0; }; #endif diff --git a/vcl/inc/vcl/menu.hxx b/vcl/inc/vcl/menu.hxx index c0cc3b5b51d6..908f3e30319c 100644 --- a/vcl/inc/vcl/menu.hxx +++ b/vcl/inc/vcl/menu.hxx @@ -41,6 +41,7 @@ struct MenuItemData; class Point; class Size; class Rectangle; +class Menu; class MenuItemList; class HelpEvent; class Image; @@ -102,6 +103,17 @@ typedef USHORT MenuItemBits; // forces images & toggle visibility for toolbar config popup #define MENU_FLAG_SHOWCHECKIMAGES 0x0008 +struct ImplMenuDelData +{ + ImplMenuDelData* mpNext; + const Menu* mpMenu; + + ImplMenuDelData( const Menu* pMenu ); + ~ImplMenuDelData(); + + bool isDeleted() const { return mpMenu == 0; } +}; + // -------- // - Menu - // -------- @@ -120,9 +132,9 @@ class VCL_DLLPUBLIC Menu : public Resource friend class MenuFloatingWindow; friend class PopupMenu; friend class SystemWindow; - + friend struct ImplMenuDelData; private: - void* pMenuData_NotUsedYet; + ImplMenuDelData* mpFirstDel; MenuItemList* pItemList; // Liste mit den MenuItems MenuLogo* pLogo; Menu* pStartedFrom; @@ -186,6 +198,8 @@ protected: // return value is Max( rCheckHeight, rRadioHeight ) SAL_DLLPRIVATE long ImplGetNativeCheckAndRadioSize( Window*, long& rCheckHeight, long& rRadioHeight, long &rMaxWidth ) const; + SAL_DLLPRIVATE void ImplAddDel( ImplMenuDelData &rDel ); + SAL_DLLPRIVATE void ImplRemoveDel( ImplMenuDelData &rDel ); public: SAL_DLLPRIVATE void ImplKillLayoutData() const; SAL_DLLPRIVATE Menu* ImplGetStartedFrom() const; diff --git a/vcl/inc/vcl/salgdi.hxx b/vcl/inc/vcl/salgdi.hxx index 510e797678b0..08c489f7d466 100644 --- a/vcl/inc/vcl/salgdi.hxx +++ b/vcl/inc/vcl/salgdi.hxx @@ -125,7 +125,7 @@ protected: virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry ) = 0; virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ) = 0; virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ) = 0; - virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ) = 0; + virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ) = 0; virtual sal_Bool drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ) = 0; virtual sal_Bool drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ) = 0; virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, const SalPoint* const* pPtAry, const BYTE* const* pFlgAry ) = 0; @@ -373,7 +373,7 @@ public: PCONSTSALPOINT* pPtAry, const OutputDevice *pOutDev ); bool DrawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency, const OutputDevice* ); - bool DrawPolyLine( const basegfx::B2DPolygon&, const basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin, const OutputDevice* ); + bool DrawPolyLine( const basegfx::B2DPolygon&, double fTransparency, const basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin, const OutputDevice* ); sal_Bool DrawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry, diff --git a/vcl/os2/inc/salgdi.h b/vcl/os2/inc/salgdi.h index b8dc4eba0199..cf05ff15d7e2 100644 --- a/vcl/os2/inc/salgdi.h +++ b/vcl/os2/inc/salgdi.h @@ -162,7 +162,7 @@ protected: virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry ); virtual void drawPolyPolygon( ULONG nPoly, const ULONG* pPoints, PCONSTSALPOINT* pPtAry ); virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); - virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, const ::basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin); + virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin ); virtual sal_Bool drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ); virtual sal_Bool drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ); virtual sal_Bool drawPolyPolygonBezier( ULONG nPoly, const ULONG* pPoints, const SalPoint* const* pPtAry, const BYTE* const* pFlgAry ); diff --git a/vcl/os2/source/gdi/salgdi.cxx b/vcl/os2/source/gdi/salgdi.cxx index 5be40355f731..dff1557170fb 100644 --- a/vcl/os2/source/gdi/salgdi.cxx +++ b/vcl/os2/source/gdi/salgdi.cxx @@ -670,6 +670,7 @@ bool Os2SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double / bool Os2SalGraphics::drawPolyLine( const basegfx::B2DPolygon& /*rPolygon*/, + double /*fTransparency*/, const basegfx::B2DVector& /*rLineWidths*/, basegfx::B2DLineJoin /*eLineJoin*/) { diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 08759f37d7a6..d66389eee62d 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -1187,7 +1187,7 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags aSize.Width() -= ( 5 + nSymbolSize ); ImplDrawAlignedImage( pDev, aPos, aSize, bLayout, - 1, nDrawFlags, nTextStyle ); + 1, nDrawFlags, nTextStyle, NULL, (GetStyle() & WB_FLATBUTTON) != 0 ); } else ImplCalcSymbolRect( aInRect ); @@ -3688,11 +3688,14 @@ void CheckBox::ImplCheck() else eNewState = STATE_NOCHECK; meState = eNewState; - ImplInvalidateOrDrawCheckBoxState(); ImplDelData aDelData; ImplAddDel( &aDelData ); - Toggle(); + if( (GetStyle() & WB_EARLYTOGGLE) ) + Toggle(); + ImplInvalidateOrDrawCheckBoxState(); + if( ! (GetStyle() & WB_EARLYTOGGLE) ) + Toggle(); if ( aDelData.IsDelete() ) return; ImplRemoveDel( &aDelData ); diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx index bb5e4e3ba36d..a011e4ee4a92 100644 --- a/vcl/source/gdi/outdev.cxx +++ b/vcl/source/gdi/outdev.cxx @@ -2311,7 +2311,7 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt ) aB2DPolyLine = basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aB2DPolyLine); } - if(mpGraphics->DrawPolyLine(aB2DPolyLine, aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this)) + if( mpGraphics->DrawPolyLine( aB2DPolyLine, 0.0, aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this)) { return; } @@ -2416,7 +2416,7 @@ void OutputDevice::impPaintLineGeometryWithEvtlExpand( if(bTryAA) { - bDone = mpGraphics->DrawPolyLine(aCandidate, basegfx::B2DVector(1.0, 1.0), basegfx::B2DLINEJOIN_NONE, this); + bDone = mpGraphics->DrawPolyLine( aCandidate, 0.0, basegfx::B2DVector(1.0,1.0), basegfx::B2DLINEJOIN_NONE, this); } if(!bDone) @@ -2605,7 +2605,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly ) aB2DPolyLine = basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aB2DPolyLine); } - if(mpGraphics->DrawPolyLine(aB2DPolyLine, aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this)) + if(mpGraphics->DrawPolyLine( aB2DPolyLine, 0.0, aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this)) { return; } @@ -2653,7 +2653,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly, const LineInfo& rLineInfo if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) && LINE_SOLID == rLineInfo.GetStyle()) { - DrawPolyLine(rPoly.getB2DPolygon(), (double)rLineInfo.GetWidth(), rLineInfo.GetLineJoin()); + DrawPolyLine( rPoly.getB2DPolygon(), (double)rLineInfo.GetWidth(), rLineInfo.GetLineJoin()); return; } @@ -2785,7 +2785,7 @@ void OutputDevice::DrawPolygon( const Polygon& rPoly ) aB2DPolygon = basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aB2DPolygon); } - bSuccess = mpGraphics->DrawPolyLine(aB2DPolygon, aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this); + bSuccess = mpGraphics->DrawPolyLine( aB2DPolygon, 0.0, aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this); } if(bSuccess) @@ -2877,7 +2877,7 @@ void OutputDevice::DrawPolyPolygon( const PolyPolygon& rPolyPoly ) for(sal_uInt32 a(0); bSuccess && a < aB2DPolyPolygon.count(); a++) { - bSuccess = mpGraphics->DrawPolyLine(aB2DPolyPolygon.getB2DPolygon(a), aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this); + bSuccess = mpGraphics->DrawPolyLine( aB2DPolyPolygon.getB2DPolygon(a), 0.0, aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this); } } @@ -3000,7 +3000,7 @@ void OutputDevice::ImpDrawPolyPolygonWithB2DPolyPolygon(const basegfx::B2DPolyPo for(sal_uInt32 a(0);bSuccess && a < aB2DPolyPolygon.count(); a++) { - bSuccess = mpGraphics->DrawPolyLine(aB2DPolyPolygon.getB2DPolygon(a), aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this); + bSuccess = mpGraphics->DrawPolyLine( aB2DPolyPolygon.getB2DPolygon(a), 0.0, aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this); } } @@ -3047,7 +3047,7 @@ bool OutputDevice::ImpTryDrawPolyLineDirect( } // draw the polyline - return mpGraphics->DrawPolyLine(aB2DPolygon, aB2DLineWidth, eLineJoin, this); + return mpGraphics->DrawPolyLine( aB2DPolygon, 0.0, aB2DLineWidth, eLineJoin, this); } void OutputDevice::DrawPolyLine( diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx index bef37284adbd..47b150ddc4c5 100644 --- a/vcl/source/gdi/outdev6.cxx +++ b/vcl/source/gdi/outdev6.cxx @@ -184,18 +184,31 @@ void OutputDevice::DrawTransparent( const basegfx::B2DPolyPolygon& rB2DPolyPoly, if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) && mpGraphics->supportsOperation(OutDevSupport_B2DDraw) - && ROP_OVERPAINT == GetRasterOp() - && IsFillColor()) + && ROP_OVERPAINT == GetRasterOp() ) { // b2dpolygon support not implemented yet on non-UNX platforms const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation(); basegfx::B2DPolyPolygon aB2DPolyPolygon(rB2DPolyPoly); - // transform the polygon and ensure closed - aB2DPolyPolygon.transform(aTransform); - aB2DPolyPolygon.setClosed(true); + // transform the polygon into device space and ensure it is closed + aB2DPolyPolygon.transform( aTransform ); + aB2DPolyPolygon.setClosed( true ); - if(mpGraphics->DrawPolyPolygon(aB2DPolyPolygon, fTransparency, this)) + bool bDrawnOk = true; + if( IsFillColor() ) + bDrawnOk = mpGraphics->DrawPolyPolygon( aB2DPolyPolygon, fTransparency, this ); + if( bDrawnOk && IsLineColor() ) + { + const basegfx::B2DVector aHairlineWidth(1,1); + const int nPolyCount = aB2DPolyPolygon.count(); + for( int nPolyIdx = 0; nPolyIdx < nPolyCount; ++nPolyIdx ) + { + const ::basegfx::B2DPolygon aOnePoly = aB2DPolyPolygon.getB2DPolygon( nPolyIdx ); + mpGraphics->DrawPolyLine( aOnePoly, fTransparency, aHairlineWidth, ::basegfx::B2DLINEJOIN_NONE, this ); + } + } + + if( bDrawnOk ) { #if 0 // MetaB2DPolyPolygonAction is not implemented yet: @@ -287,14 +300,17 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly, // get the polygon in device coordinates basegfx::B2DPolyPolygon aB2DPolyPolygon( rPolyPoly.getB2DPolyPolygon() ); - aB2DPolyPolygon.setClosed( true ); const ::basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation(); aB2DPolyPolygon.transform( aTransform ); - // draw the transparent polygon - bDrawn = mpGraphics->DrawPolyPolygon( aB2DPolyPolygon, nTransparencePercent*0.01, this ); + const double fTransparency = 0.01 * nTransparencePercent; + if( mbFillColor ) + { + // draw the transparent polygon + // NOTE: filled polygons are assumed to be drawn as if they were always closed + bDrawn = mpGraphics->DrawPolyPolygon( aB2DPolyPolygon, fTransparency, this ); + } - // DrawTransparent() assumes that the border is NOT to be drawn transparently??? if( mbLineColor ) { // disable the fill color for now @@ -305,7 +321,7 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly, for( int nPolyIdx = 0; nPolyIdx < nPolyCount; ++nPolyIdx ) { const ::basegfx::B2DPolygon& rPolygon = aB2DPolyPolygon.getB2DPolygon( nPolyIdx ); - mpGraphics->DrawPolyLine( rPolygon, aLineWidths, ::basegfx::B2DLINEJOIN_NONE, this ); + bDrawn = mpGraphics->DrawPolyLine( rPolygon, fTransparency, aLineWidths, ::basegfx::B2DLINEJOIN_NONE, this ); } // prepare to restore the fill color mbInitFillColor = mbFillColor; diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 77f7f74fc10e..6cb0a7d07697 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -4081,15 +4081,15 @@ bool PDFWriterImpl::emitFonts() } else if( (aSubsetInfo.m_nFontType & FontSubsetInfo::TYPE1_PFB) != 0 ) // TODO: also support PFA? { - unsigned char* pBuffer = new unsigned char[ (int)nLength1 ]; + boost::shared_array<unsigned char> pBuffer( new unsigned char[ nLength1 ] ); sal_uInt64 nBytesRead = 0; - CHECK_RETURN( (osl_File_E_None == osl_readFile( aFontFile, pBuffer, nLength1, &nBytesRead ) ) ); + CHECK_RETURN( (osl_File_E_None == osl_readFile( aFontFile, pBuffer.get(), nLength1, &nBytesRead ) ) ); DBG_ASSERT( nBytesRead==nLength1, "PDF-FontSubset read incomplete!" ); CHECK_RETURN( (osl_File_E_None == osl_setFilePos( aFontFile, osl_Pos_Absolut, 0 ) ) ); // get the PFB-segment lengths ThreeInts aSegmentLengths = {0,0,0}; - getPfbSegmentLengths( pBuffer, (int)nBytesRead, aSegmentLengths ); + getPfbSegmentLengths( pBuffer.get(), (int)nBytesRead, aSegmentLengths ); // the lengths below are mandatory for PDF-exported Type1 fonts // because the PFB segment headers get stripped! WhyOhWhy. aLine.append( (sal_Int32)aSegmentLengths[0] ); @@ -4106,11 +4106,9 @@ bool PDFWriterImpl::emitFonts() // emit PFB-sections without section headers beginCompression(); checkAndEnableStreamEncryption( nFontStream ); - CHECK_RETURN( writeBuffer( pBuffer+ 6, aSegmentLengths[0] ) ); - CHECK_RETURN( writeBuffer( pBuffer+12 + aSegmentLengths[0], aSegmentLengths[1] ) ); - CHECK_RETURN( writeBuffer( pBuffer+18 + aSegmentLengths[0] + aSegmentLengths[1], aSegmentLengths[2] ) ); - - delete[] pBuffer; + CHECK_RETURN( writeBuffer( &pBuffer[6], aSegmentLengths[0] ) ); + CHECK_RETURN( writeBuffer( &pBuffer[12] + aSegmentLengths[0], aSegmentLengths[1] ) ); + CHECK_RETURN( writeBuffer( &pBuffer[18] + aSegmentLengths[0] + aSegmentLengths[1], aSegmentLengths[2] ) ); } else { diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx index 84e45979d679..7a6808a0e392 100644 --- a/vcl/source/gdi/salgdilayout.cxx +++ b/vcl/source/gdi/salgdilayout.cxx @@ -405,6 +405,7 @@ void SalGraphics::DrawRect( long nX, long nY, long nWidth, long nHeight, cons } bool SalGraphics::drawPolyLine( const basegfx::B2DPolygon& /*rPolyPolygon*/, + double /*fTransparency*/, const basegfx::B2DVector& /*rLineWidths*/, basegfx::B2DLineJoin /*eLineJoin*/) { @@ -536,7 +537,7 @@ sal_Bool SalGraphics::DrawPolyPolygonBezier( sal_uInt32 i_nPoly, const sal_uInt3 return bRet; } -bool SalGraphics::DrawPolyLine( const ::basegfx::B2DPolygon& i_rPolygon, +bool SalGraphics::DrawPolyLine( const ::basegfx::B2DPolygon& i_rPolygon, double fTransparency, const ::basegfx::B2DVector& i_rLineWidth, basegfx::B2DLineJoin i_eLineJoin, const OutputDevice* i_pOutDev ) { @@ -544,10 +545,10 @@ bool SalGraphics::DrawPolyLine( const ::basegfx::B2DPolygon& i_rPolygon, if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) ) { basegfx::B2DPolygon aMirror( mirror( i_rPolygon, i_pOutDev ) ); - bRet = drawPolyLine( aMirror, i_rLineWidth, i_eLineJoin ); + bRet = drawPolyLine( aMirror, fTransparency, i_rLineWidth, i_eLineJoin ); } else - bRet = drawPolyLine( i_rPolygon, i_rLineWidth, i_eLineJoin ); + bRet = drawPolyLine( i_rPolygon, fTransparency, i_rLineWidth, i_eLineJoin ); return bRet; } diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index cebe1d1f596c..1723d26ce399 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -938,6 +938,14 @@ Menu::~Menu() if ( nEventId ) Application::RemoveUserEvent( nEventId ); + // Notify deletion of this menu + ImplMenuDelData* pDelData = mpFirstDel; + while ( pDelData ) + { + pDelData->mpMenu = NULL; + pDelData = pDelData->mpNext; + } + bKilled = TRUE; delete pItemList; @@ -970,7 +978,7 @@ void Menu::ImplInit() bInCallback = FALSE; bKilled = FALSE; mpLayoutData = NULL; - + mpFirstDel = NULL; // Dtor notification list // Native-support: returns NULL if not supported mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu( bIsMenuBar ); } @@ -1034,19 +1042,29 @@ void Menu::CreateAutoMnemonics() void Menu::Activate() { bInCallback = TRUE; + + ImplMenuDelData aDelData( this ); + ImplCallEventListeners( VCLEVENT_MENU_ACTIVATE, ITEMPOS_INVALID ); - if ( !aActivateHdl.Call( this ) ) + + if( !aDelData.isDeleted() ) { - Menu* pStartMenu = ImplGetStartMenu(); - if ( pStartMenu && ( pStartMenu != this ) ) + if ( !aActivateHdl.Call( this ) ) { - pStartMenu->bInCallback = TRUE; - // MT 11/01: Call EventListener here? I don't know... - pStartMenu->aActivateHdl.Call( this ); - pStartMenu->bInCallback = FALSE; + if( !aDelData.isDeleted() ) + { + Menu* pStartMenu = ImplGetStartMenu(); + if ( pStartMenu && ( pStartMenu != this ) ) + { + pStartMenu->bInCallback = TRUE; + // MT 11/01: Call EventListener here? I don't know... + pStartMenu->aActivateHdl.Call( this ); + pStartMenu->bInCallback = FALSE; + } + } } + bInCallback = FALSE; } - bInCallback = FALSE; } void Menu::Deactivate() @@ -1059,33 +1077,49 @@ void Menu::Deactivate() } bInCallback = TRUE; + + ImplMenuDelData aDelData( this ); + Menu* pStartMenu = ImplGetStartMenu(); ImplCallEventListeners( VCLEVENT_MENU_DEACTIVATE, ITEMPOS_INVALID ); - if ( !aDeactivateHdl.Call( this ) ) + + if( !aDelData.isDeleted() ) { - if ( pStartMenu && ( pStartMenu != this ) ) + if ( !aDeactivateHdl.Call( this ) ) { - pStartMenu->bInCallback = TRUE; - pStartMenu->aDeactivateHdl.Call( this ); - pStartMenu->bInCallback = FALSE; + if( !aDelData.isDeleted() ) + { + if ( pStartMenu && ( pStartMenu != this ) ) + { + pStartMenu->bInCallback = TRUE; + pStartMenu->aDeactivateHdl.Call( this ); + pStartMenu->bInCallback = FALSE; + } + } } } - bInCallback = FALSE; - if ( this == pStartMenu ) - GetpApp()->HideHelpStatusText(); + if( !aDelData.isDeleted() ) + { + bInCallback = FALSE; + + if ( this == pStartMenu ) + GetpApp()->HideHelpStatusText(); + } } void Menu::Highlight() { + ImplMenuDelData aDelData( this ); + Menu* pStartMenu = ImplGetStartMenu(); - if ( !aHighlightHdl.Call( this ) ) + if ( !aHighlightHdl.Call( this ) && !aDelData.isDeleted() ) { if ( pStartMenu && ( pStartMenu != this ) ) pStartMenu->aHighlightHdl.Call( this ); } - if ( GetCurItemId() ) + if ( !aDelData.isDeleted() && GetCurItemId() ) GetpApp()->ShowHelpStatusText( GetHelpText( GetCurItemId() ) ); } @@ -1112,14 +1146,19 @@ void Menu::ImplSelect() void Menu::Select() { + ImplMenuDelData aDelData( this ); + ImplCallEventListeners( VCLEVENT_MENU_SELECT, GetItemPos( GetCurItemId() ) ); - if ( !aSelectHdl.Call( this ) ) + if ( !aDelData.isDeleted() && !aSelectHdl.Call( this ) ) { - Menu* pStartMenu = ImplGetStartMenu(); - if ( pStartMenu && ( pStartMenu != this ) ) + if( !aDelData.isDeleted() ) { - pStartMenu->nSelectedId = nSelectedId; - pStartMenu->aSelectHdl.Call( this ); + Menu* pStartMenu = ImplGetStartMenu(); + if ( pStartMenu && ( pStartMenu != this ) ) + { + pStartMenu->nSelectedId = nSelectedId; + pStartMenu->aSelectHdl.Call( this ); + } } } } @@ -1141,6 +1180,8 @@ void Menu::RequestHelp( const HelpEvent& ) void Menu::ImplCallEventListeners( ULONG nEvent, USHORT nPos ) { + ImplMenuDelData aDelData( this ); + VclMenuEvent aEvent( this, nEvent, nPos ); // This is needed by atk accessibility bridge @@ -1149,16 +1190,22 @@ void Menu::ImplCallEventListeners( ULONG nEvent, USHORT nPos ) ImplGetSVData()->mpApp->ImplCallEventListeners( &aEvent ); } - if ( !maEventListeners.empty() ) + if ( !aDelData.isDeleted() && !maEventListeners.empty() ) maEventListeners.Call( &aEvent ); - Menu* pMenu = this; - while ( pMenu ) + if( !aDelData.isDeleted() ) { - if ( !maChildEventListeners.empty() ) - maChildEventListeners.Call( &aEvent ); + Menu* pMenu = this; + while ( pMenu ) + { + if ( !maChildEventListeners.empty() ) + maChildEventListeners.Call( &aEvent ); + + if( aDelData.isDeleted() ) + break; - pMenu = ( pMenu->pStartedFrom != pMenu ) ? pMenu->pStartedFrom : NULL; + pMenu = ( pMenu->pStartedFrom != pMenu ) ? pMenu->pStartedFrom : NULL; + } } } @@ -2261,6 +2308,42 @@ long Menu::ImplGetNativeCheckAndRadioSize( Window* pWin, long& rCheckHeight, lon return (rCheckHeight > rRadioHeight) ? rCheckHeight : rRadioHeight; } +// ----------------------------------------------------------------------- + +void Menu::ImplAddDel( ImplMenuDelData& rDel ) +{ + DBG_ASSERT( !rDel.mpMenu, "Menu::ImplAddDel(): cannot add ImplMenuDelData twice !" ); + if( !rDel.mpMenu ) + { + rDel.mpMenu = this; + rDel.mpNext = mpFirstDel; + mpFirstDel = &rDel; + } +} + +// ----------------------------------------------------------------------- + +void Menu::ImplRemoveDel( ImplMenuDelData& rDel ) +{ + rDel.mpMenu = NULL; + if ( mpFirstDel == &rDel ) + { + mpFirstDel = rDel.mpNext; + } + else + { + ImplMenuDelData* pData = mpFirstDel; + while ( pData && (pData->mpNext != &rDel) ) + pData = pData->mpNext; + + DBG_ASSERT( pData, "Menu::ImplRemoveDel(): ImplMenuDelData not registered !" ); + if( pData ) + pData->mpNext = rDel.mpNext; + } +} + +// ----------------------------------------------------------------------- + Size Menu::ImplCalcSize( Window* pWin ) { // | Checked| Image| Text| Accel/Popup| @@ -2790,13 +2873,19 @@ Menu* Menu::ImplGetStartMenu() void Menu::ImplCallHighlight( USHORT nHighlightedItem ) { + ImplMenuDelData aDelData( this ); + nSelectedId = 0; MenuItemData* pData = pItemList->GetDataFromPos( nHighlightedItem ); if ( pData ) nSelectedId = pData->nId; ImplCallEventListeners( VCLEVENT_MENU_HIGHLIGHT, GetItemPos( GetCurItemId() ) ); - Highlight(); - nSelectedId = 0; + + if( !aDelData.isDeleted() ) + { + Highlight(); + nSelectedId = 0; + } } IMPL_LINK( Menu, ImplCallSelect, Menu*, EMPTYARG ) @@ -3292,10 +3381,14 @@ BOOL MenuBar::HandleMenuActivateEvent( Menu *pMenu ) const { if( pMenu ) { + ImplMenuDelData aDelData( this ); + pMenu->pStartedFrom = (Menu*)this; pMenu->bInCallback = TRUE; pMenu->Activate(); - pMenu->bInCallback = FALSE; + + if( !aDelData.isDeleted() ) + pMenu->bInCallback = FALSE; } return TRUE; } @@ -3304,10 +3397,13 @@ BOOL MenuBar::HandleMenuDeActivateEvent( Menu *pMenu ) const { if( pMenu ) { + ImplMenuDelData aDelData( this ); + pMenu->pStartedFrom = (Menu*)this; pMenu->bInCallback = TRUE; pMenu->Deactivate(); - pMenu->bInCallback = FALSE; + if( !aDelData.isDeleted() ) + pMenu->bInCallback = FALSE; } return TRUE; } @@ -3318,13 +3414,18 @@ BOOL MenuBar::HandleMenuHighlightEvent( Menu *pMenu, USHORT nHighlightEventId ) pMenu = ((Menu*) this)->ImplFindMenu( nHighlightEventId ); if( pMenu ) { + ImplMenuDelData aDelData( pMenu ); + if( mnHighlightedItemPos != ITEMPOS_INVALID ) pMenu->ImplCallEventListeners( VCLEVENT_MENU_DEHIGHLIGHT, mnHighlightedItemPos ); - pMenu->mnHighlightedItemPos = pMenu->GetItemPos( nHighlightEventId ); - pMenu->nSelectedId = nHighlightEventId; - pMenu->pStartedFrom = (Menu*)this; - pMenu->ImplCallHighlight( pMenu->mnHighlightedItemPos ); + if( !aDelData.isDeleted() ) + { + pMenu->mnHighlightedItemPos = pMenu->GetItemPos( nHighlightEventId ); + pMenu->nSelectedId = nHighlightEventId; + pMenu->pStartedFrom = (Menu*)this; + pMenu->ImplCallHighlight( pMenu->mnHighlightedItemPos ); + } return TRUE; } else @@ -5989,3 +6090,17 @@ bool MenuBarWindow::HandleMenuButtonEvent( USHORT i_nButtonId ) } return FALSE; } + +ImplMenuDelData::ImplMenuDelData( const Menu* pMenu ) +: mpNext( 0 ) +, mpMenu( 0 ) +{ + if( pMenu ) + const_cast< Menu* >( pMenu )->ImplAddDel( *this ); +} + +ImplMenuDelData::~ImplMenuDelData() +{ + if( mpMenu ) + const_cast< Menu* >( mpMenu )->ImplRemoveDel( *this ); +} diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index ca92d9ed6c5b..ebeb5c94d68a 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -8650,7 +8650,10 @@ Reference< XClipboard > Window::GetClipboard() if( xFactory.is() ) { - mpWindowImpl->mpFrameData->mxClipboard = Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.SystemClipboard" ) ), UNO_QUERY ); + mpWindowImpl->mpFrameData->mxClipboard = Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.SystemClipboardExt" ) ), UNO_QUERY ); + + if( !mpWindowImpl->mpFrameData->mxClipboard.is() ) + mpWindowImpl->mpFrameData->mxClipboard = Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.SystemClipboard" ) ), UNO_QUERY ); #if defined(UNX) && !defined(QUARTZ) // unix clipboard needs to be initialized if( mpWindowImpl->mpFrameData->mxClipboard.is() ) @@ -8713,6 +8716,9 @@ Reference< XClipboard > Window::GetPrimarySelection() static Reference< XClipboard > s_xSelection; if ( !s_xSelection.is() ) + s_xSelection = Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.GenericClipboardExt" ) ), UNO_QUERY ); + + if ( !s_xSelection.is() ) s_xSelection = Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.GenericClipboard" ) ), UNO_QUERY ); mpWindowImpl->mpFrameData->mxSelection = s_xSelection; diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index 11d567c85098..c6ff16f8395b 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -3757,8 +3757,21 @@ gboolean GtkSalFrame::IMHandler::signalIMDeleteSurrounding( GtkIMContext*, gint if (xText.is()) { sal_uInt32 nPosition = xText->getCaretPosition(); - xText->deleteText(nPosition + offset, nPosition + offset + nchars); - return TRUE; + // --> OD 2010-06-04 #i111768# - apply patch from kstribley: + // range checking +// xText->deleteText(nPosition + offset, nPosition + offset + nchars); + sal_Int32 nDeletePos = nPosition + offset; + sal_Int32 nDeleteEnd = nDeletePos + nchars; + if (nDeletePos < 0) + nDeletePos = 0; + if (nDeleteEnd < 0) + nDeleteEnd = 0; + if (nDeleteEnd > xText->getCharacterCount()) + nDeleteEnd = xText->getCharacterCount(); + + xText->deleteText(nDeletePos, nDeleteEnd); + // <-- + return TRUE; } return FALSE; diff --git a/vcl/unx/headless/svpgdi.cxx b/vcl/unx/headless/svpgdi.cxx index e65c9faf1432..68d8be7cb4eb 100644 --- a/vcl/unx/headless/svpgdi.cxx +++ b/vcl/unx/headless/svpgdi.cxx @@ -382,7 +382,7 @@ void SvpSalGraphics::drawPolyPolygon( sal_uInt32 nPoly, dbgOut( m_aDevice ); } -bool SvpSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon&, const ::basegfx::B2DVector& /*rLineWidths*/, basegfx::B2DLineJoin /*eJoin*/ ) +bool SvpSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon&, double /*fTransparency*/, const ::basegfx::B2DVector& /*rLineWidths*/, basegfx::B2DLineJoin /*eJoin*/ ) { // TODO: implement and advertise OutDevSupport_B2DDraw support return false; diff --git a/vcl/unx/headless/svpgdi.hxx b/vcl/unx/headless/svpgdi.hxx index 132dafaa9adf..ca1af87f8862 100644 --- a/vcl/unx/headless/svpgdi.hxx +++ b/vcl/unx/headless/svpgdi.hxx @@ -121,7 +121,7 @@ public: virtual void drawLine( long nX1, long nY1, long nX2, long nY2 ); virtual void drawRect( long nX, long nY, long nWidth, long nHeight ); virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); - virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ); + virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ); virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry ); virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry ); virtual void drawPolyPolygon( sal_uInt32 nPoly, diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx index 7f551051c1a7..6da09b38023c 100644 --- a/vcl/unx/headless/svppspgraphics.cxx +++ b/vcl/unx/headless/svppspgraphics.cxx @@ -323,7 +323,7 @@ void PspGraphics::drawPolyPolygon( sal_uInt32 nPoly, m_pPrinterGfx->DrawPolyPolygon (nPoly, pPoints, (const Point**)pPtAry); } -bool PspGraphics::drawPolyLine( const ::basegfx::B2DPolygon&, const ::basegfx::B2DVector& /*rLineWidths*/, basegfx::B2DLineJoin /*eJoin*/ ) +bool PspGraphics::drawPolyLine( const ::basegfx::B2DPolygon&, double /*fTransparency*/, const ::basegfx::B2DVector& /*rLineWidths*/, basegfx::B2DLineJoin /*eJoin*/ ) { // TODO: implement and advertise OutDevSupport_B2DDraw support return false; diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx index 82ba613615cb..063dff34c3c2 100644 --- a/vcl/unx/headless/svppspgraphics.hxx +++ b/vcl/unx/headless/svppspgraphics.hxx @@ -142,7 +142,7 @@ public: virtual void drawPolyLine( ULONG nPoints, const SalPoint* pPtAry ); virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry ); virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); - virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ); + virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ); virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ); diff --git a/vcl/unx/inc/pspgraphics.h b/vcl/unx/inc/pspgraphics.h index 2eae73cdaa86..4b1ac12116a3 100644 --- a/vcl/unx/inc/pspgraphics.h +++ b/vcl/unx/inc/pspgraphics.h @@ -142,7 +142,7 @@ public: const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ); virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); - virtual bool drawPolyLine( const basegfx::B2DPolygon&, const basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin); + virtual bool drawPolyLine( const basegfx::B2DPolygon&, double fTransparency, const basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin); virtual sal_Bool drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ); diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h index 6ccea2c4a00c..42d9c5592317 100644 --- a/vcl/unx/inc/salgdi.h +++ b/vcl/unx/inc/salgdi.h @@ -294,7 +294,7 @@ public: const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ); virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); - virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, const ::basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin ); + virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin ); virtual bool drawFilledTrapezoids( const ::basegfx::B2DTrapezoid*, int nTrapCount, double fTransparency ); #if 1 // TODO: remove these obselete methods diff --git a/vcl/unx/source/app/keysymnames.cxx b/vcl/unx/source/app/keysymnames.cxx index cf7f7e082e69..c9515f016433 100644 --- a/vcl/unx/source/app/keysymnames.cxx +++ b/vcl/unx/source/app/keysymnames.cxx @@ -637,6 +637,7 @@ const char* SalDisplay::GetKeyboardName( BOOL bRefresh ) } } } + close(kbd); } } #else diff --git a/vcl/unx/source/app/sm.cxx b/vcl/unx/source/app/sm.cxx index dbaa278a780b..959d6af5912d 100644 --- a/vcl/unx/source/app/sm.cxx +++ b/vcl/unx/source/app/sm.cxx @@ -159,6 +159,10 @@ class ICEConnectionObserver static int nWakeupFiles[2]; static oslMutex ICEMutex; static oslThread ICEThread; +#ifdef USE_SM_EXTENSION + static IceIOErrorHandler origIOErrorHandler; + static IceErrorHandler origErrorHandler; +#endif public: static void activate(); @@ -179,6 +183,19 @@ oslMutex ICEConnectionObserver::ICEMutex = NULL; oslThread ICEConnectionObserver::ICEThread = NULL; int ICEConnectionObserver::nWakeupFiles[2] = { 0, 0 }; +#ifdef USE_SM_EXTENSION +IceIOErrorHandler ICEConnectionObserver::origIOErrorHandler = NULL; +IceErrorHandler ICEConnectionObserver::origErrorHandler = NULL; + +static void IgnoreIceErrors(IceConn, Bool, int, unsigned long, int, int, IcePointer) +{ +} + +static void IgnoreIceIOErrors(IceConn) +{ +} +#endif + // HACK bool SessionManagerClient::bDocSaveDone = false; @@ -591,6 +608,12 @@ void ICEConnectionObserver::activate() ICEMutex = osl_createMutex(); bIsWatching = TRUE; #ifdef USE_SM_EXTENSION + /* + * Default handlers call exit, we don't care that strongly if something + * happens to fail + */ + origIOErrorHandler = IceSetIOErrorHandler( IgnoreIceIOErrors ); + origErrorHandler = IceSetErrorHandler( IgnoreIceErrors ); IceAddConnectionWatch( ICEWatchProc, NULL ); #endif } @@ -604,6 +627,8 @@ void ICEConnectionObserver::deactivate() bIsWatching = FALSE; #ifdef USE_SM_EXTENSION IceRemoveConnectionWatch( ICEWatchProc, NULL ); + IceSetErrorHandler( origErrorHandler ); + IceSetIOErrorHandler( origIOErrorHandler ); #endif nConnections = 0; if( ICEThread ) diff --git a/vcl/unx/source/app/wmadaptor.cxx b/vcl/unx/source/app/wmadaptor.cxx index fb2317e19573..1a116fcbe8d6 100644 --- a/vcl/unx/source/app/wmadaptor.cxx +++ b/vcl/unx/source/app/wmadaptor.cxx @@ -1407,56 +1407,59 @@ void WMAdaptor::setFrameTypeAndDecoration( X11SalFrame* pFrame, WMWindowType eTy pFrame->meWindowType = eType; pFrame->mnDecorationFlags = nDecorationFlags; - // set mwm hints - struct _mwmhints { - unsigned long flags, func, deco; - long input_mode; - unsigned long status; - } aHint; - - aHint.flags = 15; /* flags for functions, decoration, input mode and status */ - aHint.deco = 0; - aHint.func = 1L << 2; - aHint.status = 0; - aHint.input_mode = 0; - - // evaluate decoration flags - if( nDecorationFlags & decoration_All ) - aHint.deco = 1, aHint.func = 1; - else - { - if( nDecorationFlags & decoration_Title ) - aHint.deco |= 1L << 3; - if( nDecorationFlags & decoration_Border ) - aHint.deco |= 1L << 1; - if( nDecorationFlags & decoration_Resize ) - aHint.deco |= 1L << 2, aHint.func |= 1L << 1; - if( nDecorationFlags & decoration_MinimizeBtn ) - aHint.deco |= 1L << 5, aHint.func |= 1L << 3; - if( nDecorationFlags & decoration_MaximizeBtn ) - aHint.deco |= 1L << 6, aHint.func |= 1L << 4; - if( nDecorationFlags & decoration_CloseBtn ) - aHint.deco |= 1L << 4, aHint.func |= 1L << 5; - } - // evaluate window type - switch( eType ) + if( ! pFrame->mbFullScreen ) { - case windowType_ModalDialogue: - aHint.input_mode = 1; - break; - default: - break; - } + // set mwm hints + struct _mwmhints { + unsigned long flags, func, deco; + long input_mode; + unsigned long status; + } aHint; + + aHint.flags = 15; /* flags for functions, decoration, input mode and status */ + aHint.deco = 0; + aHint.func = 1L << 2; + aHint.status = 0; + aHint.input_mode = 0; + + // evaluate decoration flags + if( nDecorationFlags & decoration_All ) + aHint.deco = 1, aHint.func = 1; + else + { + if( nDecorationFlags & decoration_Title ) + aHint.deco |= 1L << 3; + if( nDecorationFlags & decoration_Border ) + aHint.deco |= 1L << 1; + if( nDecorationFlags & decoration_Resize ) + aHint.deco |= 1L << 2, aHint.func |= 1L << 1; + if( nDecorationFlags & decoration_MinimizeBtn ) + aHint.deco |= 1L << 5, aHint.func |= 1L << 3; + if( nDecorationFlags & decoration_MaximizeBtn ) + aHint.deco |= 1L << 6, aHint.func |= 1L << 4; + if( nDecorationFlags & decoration_CloseBtn ) + aHint.deco |= 1L << 4, aHint.func |= 1L << 5; + } + // evaluate window type + switch( eType ) + { + case windowType_ModalDialogue: + aHint.input_mode = 1; + break; + default: + break; + } - // set the hint - XChangeProperty( m_pDisplay, - pFrame->GetShellWindow(), - m_aWMAtoms[ MOTIF_WM_HINTS ], - m_aWMAtoms[ MOTIF_WM_HINTS ], - 32, - PropModeReplace, - (unsigned char*)&aHint, - 5 ); + // set the hint + XChangeProperty( m_pDisplay, + pFrame->GetShellWindow(), + m_aWMAtoms[ MOTIF_WM_HINTS ], + m_aWMAtoms[ MOTIF_WM_HINTS ], + 32, + PropModeReplace, + (unsigned char*)&aHint, + 5 ); + } // set transientFor hint /* #91030# dtwm will not map a dialogue if the transient diff --git a/vcl/unx/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx index 816c8fb0b4c4..3e24cd7c8e45 100644 --- a/vcl/unx/source/fontmanager/fontconfig.cxx +++ b/vcl/unx/source/fontmanager/fontconfig.cxx @@ -851,7 +851,7 @@ bool PrintFontManager::addFontconfigDir( const rtl::OString& rDirName ) bool bDirOk = (rWrapper.FcConfigAppFontAddDir( rWrapper.FcConfigGetCurrent(), (FcChar8*)pDirName ) == FcTrue); #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "FcConfigAppFontAddDir( \"%s\") => %d\n", pDirName, bRet ); + fprintf( stderr, "FcConfigAppFontAddDir( \"%s\") => %d\n", pDirName, bDirOk ); #endif if( bDirOk ) diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx index d599e09e71f2..d3eb103b9dd6 100644 --- a/vcl/unx/source/gdi/pspgraphics.cxx +++ b/vcl/unx/source/gdi/pspgraphics.cxx @@ -403,7 +403,7 @@ bool PspGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double /*fT return false; } -bool PspGraphics::drawPolyLine( const basegfx::B2DPolygon&, const basegfx::B2DVector& /*rLineWidths*/, basegfx::B2DLineJoin /*eJoin*/) +bool PspGraphics::drawPolyLine( const basegfx::B2DPolygon&, double /*fTranspareny*/, const basegfx::B2DVector& /*rLineWidths*/, basegfx::B2DLineJoin /*eJoin*/) { // TODO: a PS printer can draw B2DPolyLines almost directly return false; diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index 15e391256344..ae21c3aa9f7b 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -1089,7 +1089,7 @@ SystemGraphicsData X11SalGraphics::GetGraphicsData() const // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // draw a poly-polygon -bool X11SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rOrigPolyPoly, double fTransparency) +bool X11SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rOrigPolyPoly, double fTransparency ) { // nothing to do for empty polypolygons const int nOrigPolyCount = rOrigPolyPoly.count(); @@ -1203,7 +1203,7 @@ bool X11SalGraphics::drawFilledTrapezoids( const ::basegfx::B2DTrapezoid* pB2DTr // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, const ::basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin eLineJoin) +bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, double fTransparency, const ::basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin eLineJoin) { const bool bIsHairline = (rLineWidth.getX() == rLineWidth.getY()) && (rLineWidth.getX() <= 1.2); @@ -1239,7 +1239,7 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, const : // draw tesselation result const int nTrapCount = aB2DTrapVector.size(); - const bool bDrawOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, 0.0 ); + const bool bDrawOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency ); // restore the original brush GC nBrushColor_ = aKeepBrushColor; @@ -1271,7 +1271,7 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, const : for( int nPolyIdx = 0; nPolyIdx < nPolyCount; ++nPolyIdx ) { const ::basegfx::B2DPolyPolygon aOnePoly( aAreaPolyPoly.getB2DPolygon( nPolyIdx ) ); - bDrawOk = drawPolyPolygon( aOnePoly, 0.0 ); + bDrawOk = drawPolyPolygon( aOnePoly, fTransparency ); if( !bDrawOk ) break; } diff --git a/vcl/unx/source/gdi/salprnpsp.cxx b/vcl/unx/source/gdi/salprnpsp.cxx index 3491622f783c..90c6a196143e 100644 --- a/vcl/unx/source/gdi/salprnpsp.cxx +++ b/vcl/unx/source/gdi/salprnpsp.cxx @@ -694,6 +694,18 @@ BOOL PspSalInfoPrinter::SetData( pKey = aData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) ); pValue = pKey ? pKey->getValueCaseInsensitive( aPaper ) : NULL; + + // some PPD files do not specify the standard paper names (e.g. C5 instead of EnvC5) + // try to find the correct paper anyway using the size + if( pKey && ! pValue && pJobSetup->mePaperFormat != PAPER_USER ) + { + PaperInfo aInfo( pJobSetup->mePaperFormat ); + aPaper = aData.m_pParser->matchPaper( + TenMuToPt( aInfo.getWidth() ), + TenMuToPt( aInfo.getHeight() ) ); + pValue = pKey->getValueCaseInsensitive( aPaper ); + } + if( ! ( pKey && pValue && aData.m_aContext.setValue( pKey, pValue, false ) == pValue ) ) return FALSE; } diff --git a/vcl/unx/source/printergfx/printerjob.cxx b/vcl/unx/source/printergfx/printerjob.cxx index 3e885d8af5b4..5e18849b8dfe 100644 --- a/vcl/unx/source/printergfx/printerjob.cxx +++ b/vcl/unx/source/printergfx/printerjob.cxx @@ -284,7 +284,8 @@ removeSpoolDir (const rtl::OUString& rSpoolDir) nChar = psp::appendStr ("rm -rf ", pSystem); nChar += psp::appendStr (aSysPathByte.getStr(), pSystem + nChar); - system (pSystem); + if (system (pSystem) == -1) + OSL_ENSURE( 0, "psprint: couldn't remove spool directory" ); } /* creates a spool directory with a "pidgin random" value based on diff --git a/vcl/win/inc/salgdi.h b/vcl/win/inc/salgdi.h index 4b97eeb98c0b..b1bfcbee96f4 100644 --- a/vcl/win/inc/salgdi.h +++ b/vcl/win/inc/salgdi.h @@ -194,7 +194,7 @@ protected: virtual void drawPolygon( ULONG nPoints, const SalPoint* pPtAry ); virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ); virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); - virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, const ::basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin); + virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin ); virtual sal_Bool drawPolyLineBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ); virtual sal_Bool drawPolygonBezier( ULONG nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ); virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, const SalPoint* const* pPtAry, const BYTE* const* pFlgAry ); diff --git a/vcl/win/source/app/salinfo.cxx b/vcl/win/source/app/salinfo.cxx index b7ea81d313ae..14cb5d63437a 100644 --- a/vcl/win/source/app/salinfo.cxx +++ b/vcl/win/source/app/salinfo.cxx @@ -160,7 +160,8 @@ bool WinSalSystem::initMonitors() std::hash_map< rtl::OUString, int, rtl::OUStringHash > aDeviceStringCount; while( EnumDisplayDevicesW( NULL, nDevice++, &aDev, 0 ) ) { - if( (aDev.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER) == 0 ) // sort out non monitors + if( (aDev.StateFlags & DISPLAY_DEVICE_ACTIVE) + && !(aDev.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER) ) // sort out non/disabled monitors { aDev.DeviceName[31] = 0; aDev.DeviceString[127] = 0; diff --git a/vcl/win/source/gdi/salgdi_gdiplus.cxx b/vcl/win/source/gdi/salgdi_gdiplus.cxx index c621d81dce40..88efbb29d30a 100644 --- a/vcl/win/source/gdi/salgdi_gdiplus.cxx +++ b/vcl/win/source/gdi/salgdi_gdiplus.cxx @@ -189,14 +189,15 @@ bool WinSalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly return true; } -bool WinSalGraphics::drawPolyLine(const basegfx::B2DPolygon& rPolygon, const basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin eLineJoin) +bool WinSalGraphics::drawPolyLine( const basegfx::B2DPolygon& rPolygon, double fTransparency, const basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin eLineJoin ) { const sal_uInt32 nCount(rPolygon.count()); if(mbPen && nCount) { Gdiplus::Graphics aGraphics(mhDC); - Gdiplus::Color aTestColor(255, SALCOLOR_RED(maLineColor), SALCOLOR_GREEN(maLineColor), SALCOLOR_BLUE(maLineColor)); + const sal_uInt8 aTrans = (sal_uInt8)basegfx::fround( 255 * (1.0 - fTransparency) ); + Gdiplus::Color aTestColor(aTrans, SALCOLOR_RED(maLineColor), SALCOLOR_GREEN(maLineColor), SALCOLOR_BLUE(maLineColor)); Gdiplus::Pen aTestPen(aTestColor, Gdiplus::REAL(rLineWidths.getX())); Gdiplus::GraphicsPath aPath; bool bNoLineJoin(false); |