[Libreoffice-commits] .: 2 commits - i18npool/source writerperfect/Library_wpftdraw.mk writerperfect/source

2012-04-19 Thread Stephan Bergmann
 i18npool/source/transliteration/transliterationImpl.cxx |   46 ---
 writerperfect/Library_wpftdraw.mk   |1 
 writerperfect/source/draw/CDRImportFilter.cxx   |9 -
 writerperfect/source/draw/CDRImportFilter.hxx   |9 -
 writerperfect/source/draw/CMXImportFilter.cxx   |9 -
 writerperfect/source/draw/CMXImportFilter.hxx   |9 -
 writerperfect/source/draw/VisioImportFilter.cxx |9 -
 writerperfect/source/draw/VisioImportFilter.hxx |9 -
 writerperfect/source/draw/WPGImportFilter.cxx   |9 -
 writerperfect/source/draw/WPGImportFilter.hxx   |9 -
 writerperfect/source/draw/wpftdraw_genericfilter.cxx|   97 
 11 files changed, 69 insertions(+), 147 deletions(-)

New commits:
commit 8e16c9fa498e61b00724cb44cb4470627014fc27
Author: Stephan Bergmann 
Date:   Thu Apr 19 20:54:13 2012 +0200

Cleaned up wpftdraw_component_getFactory

...which required switching service implementations from 
XMultiServiceManager-
based to XComponentContext-based (using comphelper::ComponentContext 
convenience
helper for the occasional service instantiation via the XComponentContext).

diff --git a/writerperfect/Library_wpftdraw.mk 
b/writerperfect/Library_wpftdraw.mk
index e4c3b51..15c1492 100644
--- a/writerperfect/Library_wpftdraw.mk
+++ b/writerperfect/Library_wpftdraw.mk
@@ -41,6 +41,7 @@ $(eval $(call gb_Library_use_api,wpftdraw,\
 ))
 
 $(eval $(call gb_Library_use_libraries,wpftdraw,\
+   comphelper \
cppu \
cppuhelper \
sal \
diff --git a/writerperfect/source/draw/CDRImportFilter.cxx 
b/writerperfect/source/draw/CDRImportFilter.cxx
index 2476a55..7a2538b 100644
--- a/writerperfect/source/draw/CDRImportFilter.cxx
+++ b/writerperfect/source/draw/CDRImportFilter.cxx
@@ -33,7 +33,6 @@
 #include 
 #include 
 
-#include 
 #include 
 #include 
 #include 
@@ -42,6 +41,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 #include 
@@ -67,7 +67,6 @@ using com::sun::star::uno::UNO_QUERY;
 using com::sun::star::uno::XInterface;
 using com::sun::star::uno::Exception;
 using com::sun::star::uno::RuntimeException;
-using com::sun::star::lang::XMultiServiceFactory;
 using com::sun::star::beans::PropertyValue;
 using com::sun::star::document::XFilter;
 using com::sun::star::document::XExtendedFilterDetection;
@@ -107,7 +106,7 @@ throw (RuntimeException)
 
 // An XML import service: what we push sax messages to..
 OUString sXMLImportService ( RTL_CONSTASCII_USTRINGPARAM ( 
"com.sun.star.comp.Draw.XMLOasisImporter" ) );
-Reference < XDocumentHandler > xInternalHandler( mxMSF->createInstance( 
sXMLImportService ), UNO_QUERY );
+Reference < XDocumentHandler > xInternalHandler( 
comphelper::ComponentContext( mxContext ).createComponent( sXMLImportService ), 
UNO_QUERY );
 
 // The XImporter sets up an empty target document for XDocumentHandler to 
write to..
 Reference < XImporter > xImporter(xInternalHandler, UNO_QUERY);
@@ -238,13 +237,13 @@ throw (RuntimeException)
 #undef SERVICE_NAME2
 #undef SERVICE_NAME1
 
-Reference< XInterface > SAL_CALL CDRImportFilter_createInstance( const 
Reference< XMultiServiceFactory > & rSMgr)
+Reference< XInterface > SAL_CALL CDRImportFilter_createInstance( const 
Reference< XComponentContext > & rContext)
 throw( Exception )
 {
 #ifdef DEBUG
 std::cerr << "CDRImportFilter_createInstance" << std::endl;
 #endif
-return (cppu::OWeakObject *) new CDRImportFilter( rSMgr );
+return (cppu::OWeakObject *) new CDRImportFilter( rContext );
 }
 
 // XServiceInfo
diff --git a/writerperfect/source/draw/CDRImportFilter.hxx 
b/writerperfect/source/draw/CDRImportFilter.hxx
index 56f124e..9dbb945 100644
--- a/writerperfect/source/draw/CDRImportFilter.hxx
+++ b/writerperfect/source/draw/CDRImportFilter.hxx
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -54,14 +55,14 @@ class CDRImportFilter : public cppu::WeakImplHelper5
 {
 protected:
 // oo.org declares
-::com::sun::star::uno::Reference< 
::com::sun::star::lang::XMultiServiceFactory > mxMSF;
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext 
> mxContext;
 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > 
mxDoc;
 ::rtl::OUString msFilterName;
 ::com::sun::star::uno::Reference< 
::com::sun::star::xml::sax::XDocumentHandler > mxHandler;
 
 public:
-CDRImportFilter( const ::com::sun::star::uno::Reference< 
::com::sun::star::lang::XMultiServiceFactory > &rxMSF)
-: mxMSF( rxMSF ) {}
+CDRImportFilter( const ::com::sun::star::uno::Reference< 
::com::sun::star::uno::XComponentContext > &rxContext)
+: mxContext( rxContext ) {}
 virtual ~CDRImportFilter() {}
 
 // XFilter
@@ -102,7 +103,7 @@ throw ( ::com::sun::star::uno::RuntimeException );
 throw ( ::com::sun::star::uno::RuntimeException );
 
 ::com::sun::star::uno::Reference< 

[Libreoffice-commits] .: 2 commits - i18npool/source sal/inc sal/rtl

2012-04-02 Thread Lubos Lunak
 i18npool/source/isolang/isolang.cxx |   20 ++--
 sal/inc/rtl/string.hxx  |4 +++-
 sal/inc/rtl/ustring.hxx |3 +++
 sal/rtl/source/strtmpl.cxx  |2 ++
 4 files changed, 18 insertions(+), 11 deletions(-)

New commits:
commit 1cdb1ea6a8071f9cd802c30ae78a35332782cb31
Author: Luboš Luňák 
Date:   Mon Apr 2 16:56:13 2012 +0200

don't use string literals with embedded \0's

Followup to 791f27683311e487947b0464a0cb132b19fd0e12.

diff --git a/i18npool/source/isolang/isolang.cxx 
b/i18npool/source/isolang/isolang.cxx
index 5e40487..35a9250 100644
--- a/i18npool/source/isolang/isolang.cxx
+++ b/i18npool/source/isolang/isolang.cxx
@@ -659,9 +659,9 @@ void MsLangId::convertLanguageToIsoNames( LanguageType 
nLang,
 do
 {
 if ( pEntry->mnLang == nLang )
-{
-rLangStr = rtl::OString( pEntry->maLangStr );
-rCountry = rtl::OString( pEntry->maCountry );
+{  // avoid embedded \0 warning
+rLangStr = rtl::OString( static_cast< const char* >( 
pEntry->maLangStr ));
+rCountry = rtl::OString( static_cast< const char* >( 
pEntry->maCountry ));
 return;
 }
 ++pEntry;
@@ -675,9 +675,9 @@ void MsLangId::convertLanguageToIsoNames( LanguageType 
nLang,
 do
 {
 if ( pNoneStdEntry->mnLang == nLang )
-{
-rLangStr = rtl::OString( pNoneStdEntry->maLangStr );
-rCountry = rtl::OString( pNoneStdEntry->maCountry );
+{  // avoid embedded \0 warning
+rLangStr = rtl::OString( static_cast< const char* >( 
pNoneStdEntry->maLangStr ));
+rCountry = rtl::OString( static_cast< const char* >( 
pNoneStdEntry->maCountry ));
 return;
 }
 ++pNoneStdEntry;
@@ -1082,12 +1082,12 @@ LanguageType MsLangId::convertUnxByteStringToLanguage(
 rtl::OString aUpperCountry = aCountry.toAsciiUpperCase();
 const IsoLangGLIBCModifiersEntry* pGLIBCModifiersEntry = 
aImplIsoLangGLIBCModifiersEntries;
 do
-{
-if (( aLowerLang.equals( pGLIBCModifiersEntry->maLangStr ) ) &&
-   ( aAtString.equals( pGLIBCModifiersEntry->maAtString ) ))
+{ // avoid embedded \0 warning
+if (( aLowerLang.equals( static_cast< const char* >( 
pGLIBCModifiersEntry->maLangStr ))) &&
+   ( aAtString.equals( static_cast< const char* >( 
pGLIBCModifiersEntry->maAtString 
 {
 if ( aUpperCountry.isEmpty() ||
- aUpperCountry.equals( pGLIBCModifiersEntry->maCountry ) )
+ aUpperCountry.equals( static_cast< const char* >( 
pGLIBCModifiersEntry->maCountry )))
{
 return pGLIBCModifiersEntry->mnLang;
}
commit 60b596665fff7c110c6b12da192f5712fb145028
Author: Luboš Luňák 
Date:   Mon Apr 2 16:52:36 2012 +0200

warn on \0 embedded in string literals, after all

Seeing 791f27683311e487947b0464a0cb132b19fd0e12 I've changed my mind,
some embedded \0 can be actually well hidden:
struct foo { const char txt[3]; };
const foos[] = { { "a" }, { "bb" }};
If somebody wants an embedded \0 in a string literal, they need to
say it explicitly by specifying the size.

diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index 8dbb413..a00e186 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -196,7 +196,9 @@ public:
   New string from a string literal.
 
   If there are any embedded \0's in the string literal, the result is 
undefined.
-  Use the overload that explicitly accepts length.
+  Use the overload that explicitly accepts length or cast the literal
+  explicitly to const char*.
+
   @since LibreOffice 3.6
 
   @paramliteral   a string literal
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index 8035bdc..518ef3d 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -190,6 +190,9 @@ public:
   is not pure ASCII, it needs to be converted to OUString by explicitly
   providing the encoding to use for the conversion.
 
+  If there are any embedded \0's in the string literal, the result is 
undefined.
+  Use the overload that explicitly accepts length or fromAscii().
+
   @paramliteral the 8-bit ASCII string literal
 
   @since LibreOffice 3.6
diff --git a/sal/rtl/source/strtmpl.cxx b/sal/rtl/source/strtmpl.cxx
index 2a33907..be86ab3 100644
--- a/sal/rtl/source/strtmpl.cxx
+++ b/sal/rtl/source/strtmpl.cxx
@@ -1220,6 +1220,8 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newFromLiteral)( 
IMPL_RTL_STRINGDATA** ppThis
 /* Check ASCII range */
 SAL_WARN_IF( ((unsigned char)*pCharStr) > 127, "rtl.string",
 "rtl_uString_newFromLiteral - Found char > 127" );
+SAL_

[Libreoffice-commits] .: 2 commits - i18npool/source

2012-01-20 Thread Eike Rathke
 i18npool/source/localedata/data/gu_IN.xml |  103 --
 1 file changed, 55 insertions(+), 48 deletions(-)

New commits:
commit 4e0928278df9e327dac9ac4d0ebf40bf04ef8dd9
Author: Eike Rathke 
Date:   Fri Jan 20 17:08:49 2012 +0100

corrected [gu-IN] currency symbol update

diff --git a/i18npool/source/localedata/data/gu_IN.xml 
b/i18npool/source/localedata/data/gu_IN.xml
index eff6975..606091f 100644
--- a/i18npool/source/localedata/data/gu_IN.xml
+++ b/i18npool/source/localedata/data/gu_IN.xml
@@ -12,7 +12,7 @@
 
   
   
-  
+  
   
   
   
@@ -143,6 +143,13 @@
   Rupee
   2
 
+
+  INR
+  ઋુ.
+  INR
+  Rupee
+  2
+
   
   
   
commit 5d6af4f2947432a55324e4f5cc67bca202f939e9
Author: Ankitkumar Rameshchandra Patel 
Date:   Fri Jan 20 17:01:38 2012 +0100

changed [gu-IN] month names and reserved words, updated currency symbol

diff --git a/i18npool/source/localedata/data/gu_IN.xml 
b/i18npool/source/localedata/data/gu_IN.xml
index e1b8c14..eff6975 100644
--- a/i18npool/source/localedata/data/gu_IN.xml
+++ b/i18npool/source/localedata/data/gu_IN.xml
@@ -12,7 +12,7 @@
 
   
   
-  
+  
   
   
   
@@ -21,112 +21,112 @@
   
 
   sun
-  ઋવિ.
-  ઋવિવાઋ
+  રવિ
+  રવિવાર
 
 
   mon
-  સોમ.
-  સોમવાઋ્
+  સોમવાર
+  સોમવાર
 
 
   tue
-  મંગલ.
-  મંગલવાઋ
+  મંગળ
+  મંગળવાર
 
 
   wed
-  બુધ.
-  બુધવાઋ
+  બુધ
+  બુધવાર
 
 
   thu
-  ગુઋુ.
-  ગુઋુવાઋ
+  ગુરુ
+  ગુરુવાર
 
 
   fri
-  શુક્ઋ.
-  શુક્ઋવાઋ
+  શુક્ર
+  શુક્રવાર
 
 
   sat
-  શનિ.
-  શનિવાઋ
+  શનિ
+  શનિવાર
 
   
   
 
   jan
-  જનવઋી.
-  જનવઋી
+  જાન
+  જાન્યુઆરી
 
 
   feb
-  ફઋવઋી.
-  ફઋવઋી
+  ફેબ
+  ફેબ્રુઆરી
 
 
   mar
-  માઋ્ચ.
-  માઋ્ચ
+  માર્ચ
+  માર્ચ
 
 
   apr
-  અપ્ઋેલ.
-  અપ્ઋેલ
+  એપ્રિલ
+  એપ્રિલ
 
 
   may
-  મઈ.
-  મઈ
+  મે
+  મે
 
 
   jun
-  જૂન.
+  જૂન
   જૂન
 
 
   jul
-  જુલાઇ.
+  જુલ
   જુલાઇ
 
 
   aug
-  અગસ્ત.
-  અગસ્ત
+  ઑગ
+  ઑગસ્ટ
 
 
   sep
-  સિતંબઋ.
-  સિતંબઋ
+  સપ્ટ
+  સપ્ટેમ્બર
 
 
   oct
-  અક્તોબઋ.
-  અક્તોબઋ
+  ઑક્ટ
+  ઑક્ટોબર
 
 
   nov
-  નવંબઋ.
-  નવંબઋ
+  નવ
+  નવેમ્બર
 
 
   dec
-  ડિસધંબઋ.
-  ડિસંબઋ
+  ડિસ
+  ડિસેમ્બર
 
   
   
 
   bc
-  
ઈસાપૂઋ્વ.હ્ન
-  ઈસાપૂઋ્વ.
+  ઈ.સ.પૂ.
+  
ઈસવીસનપૂર્વે
 
 
   ad
-  સન.
-  સન.
+  ઈ.સ.
+  ઈસવીસન
 
   
   
@@ -138,7 +138,7 @@
   
 
   INR
-  ઋુ.
+  ₹
   INR
   Rupee
   2
@@ -154,13 +154,13 @@
   
 
 
-  સહી
-  ગલત
-  પેહલા હંત 1
-  ડૂસઋા હંત 2
-  તીસઋા હંત 3
-  ચૌતા હંત 4
-  ઊપઋ
+  ખરું
+  ખોટું
+  ચતુર્થાંશ૧
+  ચતુર્થાંશ૨
+  ચતુર્થાંશ૩
+  ચતુર્થાંશ૪
+  ઊપર
   નીચે
   Q1
   Q2
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists

[Libreoffice-commits] .: 2 commits - i18npool/source offapi/com

2012-01-19 Thread Eike Rathke
 i18npool/source/localedata/data/kab_DZ.xml |1 +
 offapi/com/sun/star/i18n/NumberFormatIndex.idl |6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit bffecae79a79feec906f55f25d0d563915d64c6e
Author: Eike Rathke 
Date:   Thu Jan 19 23:27:34 2012 +0100

added [kab-DZ] date acceptance pattern "D/M"

diff --git a/i18npool/source/localedata/data/kab_DZ.xml 
b/i18npool/source/localedata/data/kab_DZ.xml
index ad39e6d..3e80f5d 100644
--- a/i18npool/source/localedata/data/kab_DZ.xml
+++ b/i18npool/source/localedata/data/kab_DZ.xml
@@ -35,6 +35,7 @@
 metric
   
   
+D/M
 
   General
 
commit 6f607469e97d6d6aeba99b5fcad264c40b47fd2e
Author: Eike Rathke 
Date:   Thu Jan 19 23:22:02 2012 +0100

minor corrections in comments

diff --git a/offapi/com/sun/star/i18n/NumberFormatIndex.idl 
b/offapi/com/sun/star/i18n/NumberFormatIndex.idl
index c7105b0..708b2d4 100644
--- a/offapi/com/sun/star/i18n/NumberFormatIndex.idl
+++ b/offapi/com/sun/star/i18n/NumberFormatIndex.idl
@@ -50,7 +50,7 @@ module com { module sun { module star { module i18n {
 MUST support some predefined format codes. These predefined
 format codes are accessed through indices as the following, and
 the locale data format code definitions in
-i18npool\source\localedata\data\*.xml MUST have matching
+i18npool/source/localedata/data/*.xml MUST have matching
 entries in the form 
 
  
@@ -65,7 +65,7 @@ module com { module sun { module star { module i18n {
 
  Date formats may have a comment of DIN/EN/ISO, meaning
 
- DIN 5008 (Deutsche Industrie Norm) 
+ DIN 5008 (Deutsches Institut für Normung, formerly 
Deutsche Industrie-Norm) 
  EN 28601 (European Norm) 
  ISO 8601 (International Standards Organization) 
 
@@ -198,7 +198,7 @@ published constants NumberFormatIndex
 const short DATE_SYS_D  = DATE_START+12;
 /// 10-08DIN/EN
 const short DATE_DIN_MMDD   = DATE_START+13;
-/// 97-10-08 DIN/EN/ISO
+/// 97-10-08 DIN/EN
 const short DATE_DIN_YYMMDD = DATE_START+14;
 /// 1997-10-08   DIN/EN/ISO
 const short DATE_DIN_MMDD   = DATE_START+15;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - i18npool/source

2012-01-19 Thread Eike Rathke
 i18npool/source/localedata/LocaleNode.cxx |   22 --
 i18npool/source/localedata/data/ja_JP.xml |7 +++
 2 files changed, 27 insertions(+), 2 deletions(-)

New commits:
commit af25972c19bcd0bef7739bd777c67907d61b2b16
Author: Eike Rathke 
Date:   Thu Jan 19 22:25:33 2012 +0100

added [ja-JP] date acceptance patterns (various)

diff --git a/i18npool/source/localedata/data/ja_JP.xml 
b/i18npool/source/localedata/data/ja_JP.xml
index 54c42a2..0b39a2c 100644
--- a/i18npool/source/localedata/data/ja_JP.xml
+++ b/i18npool/source/localedata/data/ja_JP.xml
@@ -35,6 +35,13 @@
 metric
   
   
+M-D
+M/D
+M/D
+Y.M.D
+Y/M/D
+Y年M月D日
+M月D日
 
   Standard
 
commit 0dc4e9cd0aac2d203219bb5ea4266693427c744c
Author: Eike Rathke 
Date:   Thu Jan 19 22:23:59 2012 +0100

added check for duplicated date acceptance patterns

Also insert full date acceptance pattern at first position instead of
appending to have it be first in checks.

diff --git a/i18npool/source/localedata/LocaleNode.cxx 
b/i18npool/source/localedata/LocaleNode.cxx
index 1b1e777..42cf583 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -1185,7 +1185,8 @@ void LCFormatNode::generateCode (const OFileWriter &of) 
const
 {
 fprintf( stderr, "Generated date acceptance pattern: '%s' from 
'%s'\n",
 OSTR( aPattern), OSTR( sTheDateEditFormat));
-theDateAcceptancePatterns.push_back( aPattern);
+// Insert at front so full date pattern is first in checks.
+theDateAcceptancePatterns.insert( 
theDateAcceptancePatterns.begin(), aPattern);
 }
 if (aPatternBuf2.getLength() > 0)
 {
@@ -1200,7 +1201,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) 
const
 {
 fprintf( stderr, "Generated  2nd acceptance pattern: '%s' from 
'%s'\n",
 OSTR( aPattern2), OSTR( sTheDateEditFormat));
-theDateAcceptancePatterns.push_back( aPattern2);
+theDateAcceptancePatterns.insert( 
theDateAcceptancePatterns.begin(), aPattern2);
 }
 }
 
@@ -1222,6 +1223,23 @@ void LCFormatNode::generateCode (const OFileWriter &of) 
const
 }
 }
 
+// Check for duplicates.
+for (vector::const_iterator aIt = 
theDateAcceptancePatterns.begin();
+aIt != theDateAcceptancePatterns.end(); ++aIt)
+{
+for (vector::iterator aComp = 
theDateAcceptancePatterns.begin();
+aComp != theDateAcceptancePatterns.end(); /*nop*/)
+{
+if (aIt != aComp && *aIt == *aComp)
+{
+incErrorStr( "Duplicated DateAcceptancePattern", *aComp);
+aComp = theDateAcceptancePatterns.erase( aComp);
+}
+else
+++aComp;
+}
+}
+
 sal_Int16 nbOfDateAcceptancePatterns = 
static_cast(theDateAcceptancePatterns.size());
 
 for (sal_Int16 i = 0; i < nbOfDateAcceptancePatterns; ++i)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - i18npool/source

2012-01-17 Thread Eike Rathke
 i18npool/source/localedata/LocaleNode.cxx |   23 +--
 i18npool/source/localedata/data/zh_TW.xml |5 +
 2 files changed, 26 insertions(+), 2 deletions(-)

New commits:
commit c0bbf6f78aba568d3b3edb77fdfa973c183208ff
Author: Eike Rathke 
Date:   Tue Jan 17 17:02:57 2012 +0100

rudimentary check if date acceptance pattern interferes with decimal number

diff --git a/i18npool/source/localedata/LocaleNode.cxx 
b/i18npool/source/localedata/LocaleNode.cxx
index dd07dfe..1b1e777 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -382,7 +382,8 @@ void LCInfoNode::generateCode (const OFileWriter &of) const
 }
 
 
-OUString aDateSep;
+static OUString aDateSep;
+static OUString aDecSep;
 
 void LCCTYPENode::generateCode (const OFileWriter &of) const
 {
@@ -400,7 +401,7 @@ void LCCTYPENode::generateCode (const OFileWriter &of) const
 writeParameterCheckLen( of, "DateSeparator", "dateSeparator", 1, 1);
 OUString aThoSep =
 writeParameterCheckLen( of, "ThousandSeparator", "thousandSeparator", 
1, 1);
-OUString aDecSep =
+aDecSep =
 writeParameterCheckLen( of, "DecimalSeparator", "decimalSeparator", 1, 
1);
 OUString aTimeSep =
 writeParameterCheckLen( of, "TimeSeparator", "timeSeparator", 1, 1);
@@ -1203,6 +1204,24 @@ void LCFormatNode::generateCode (const OFileWriter &of) 
const
 }
 }
 
+// Rudimentary check if a pattern interferes with decimal number.
+nIndex = 0;
+sal_uInt32 cDecSep = aDecSep.iterateCodePoints( &nIndex);
+for (vector::const_iterator aIt = 
theDateAcceptancePatterns.begin();
+aIt != theDateAcceptancePatterns.end(); ++aIt)
+{
+if ((*aIt).getLength() == (cDecSep <= 0x ? 3 : 4))
+{
+nIndex = 1;
+if ((*aIt).iterateCodePoints( &nIndex) == cDecSep)
+{
+++nError;
+fprintf( stderr, "Error: Date acceptance pattern '%s' 
matches decimal number '#%s#'\n",
+OSTR( *aIt), OSTR( aDecSep));
+}
+}
+}
+
 sal_Int16 nbOfDateAcceptancePatterns = 
static_cast(theDateAcceptancePatterns.size());
 
 for (sal_Int16 i = 0; i < nbOfDateAcceptancePatterns; ++i)
commit fa836f7bf0fcdab6029320bdf7830c561d5ea823
Author: Eike Rathke 
Date:   Tue Jan 17 16:40:33 2012 +0100

added [zh-TW] date acceptance patterns (various)

diff --git a/i18npool/source/localedata/data/zh_TW.xml 
b/i18npool/source/localedata/data/zh_TW.xml
index 89ecdd9..15681f0 100644
--- a/i18npool/source/localedata/data/zh_TW.xml
+++ b/i18npool/source/localedata/data/zh_TW.xml
@@ -35,6 +35,11 @@
 metric
   
   
+Y.M.D
+M-D
+M/D
+Y年M月D日
+M月D日
 
 
   General
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - i18npool/source

2012-01-17 Thread Eike Rathke
 i18npool/source/localedata/data/nl_BE.xml |1 +
 i18npool/source/localedata/data/nl_NL.xml |1 +
 2 files changed, 2 insertions(+)

New commits:
commit abfbda01c8faa06f7c97692c25be0e8419cd2c48
Author: Eike Rathke 
Date:   Tue Jan 17 14:24:09 2012 +0100

added [nl-BE] date acceptance pattern "D/M"

diff --git a/i18npool/source/localedata/data/nl_BE.xml 
b/i18npool/source/localedata/data/nl_BE.xml
index a8a7a7c..a423e3a 100644
--- a/i18npool/source/localedata/data/nl_BE.xml
+++ b/i18npool/source/localedata/data/nl_BE.xml
@@ -35,6 +35,7 @@
 metric
   
   
+D/M
 
   Standaard
 
commit 741282c6e8d82c31c534b2e30dbc4ba8ca21299e
Author: Eike Rathke 
Date:   Tue Jan 17 14:22:54 2012 +0100

added [nl-NL] date acceptance pattern "D-M"

diff --git a/i18npool/source/localedata/data/nl_NL.xml 
b/i18npool/source/localedata/data/nl_NL.xml
index cb8637b..ad8fc59 100644
--- a/i18npool/source/localedata/data/nl_NL.xml
+++ b/i18npool/source/localedata/data/nl_NL.xml
@@ -35,6 +35,7 @@
 Metric
   
   
+D-M
 
   D-MM-JJ
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - i18npool/source

2011-12-14 Thread Eike Rathke
 i18npool/source/localedata/LocaleNode.cxx |   18 +-
 i18npool/source/localedata/data/sl_SI.xml |2 +-
 2 files changed, 18 insertions(+), 2 deletions(-)

New commits:
commit 9e77c269b6a0fc1e84812f4817c3c58a01347f29
Author: Eike Rathke 
Date:   Wed Dec 14 17:46:55 2011 +0100

if [CURRENCY] is used then it must be defined

diff --git a/i18npool/source/localedata/data/sl_SI.xml 
b/i18npool/source/localedata/data/sl_SI.xml
index e95325e..04c3baa 100644
--- a/i18npool/source/localedata/data/sl_SI.xml
+++ b/i18npool/source/localedata/data/sl_SI.xml
@@ -34,7 +34,7 @@
 pop.
 metric
   
-  
+  
 
   Standard
 
commit 736b9e76fb62fb5371265509324c8ac5ab28caf2
Author: Eike Rathke 
Date:   Wed Dec 14 17:46:54 2011 +0100

check if [CURRENCY] replaceTo is specified

diff --git a/i18npool/source/localedata/LocaleNode.cxx 
b/i18npool/source/localedata/LocaleNode.cxx
index cabe21f..4d107ed 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -594,6 +594,7 @@ void LCCTYPENode::generateCode (const OFileWriter &of) const
 }
 
 
+static OUString sTheCurrencyReplaceTo;
 static OUString sTheCompatibleCurrency;
 
 sal_Int16 LCFormatNode::mnSection = 0;
@@ -603,7 +604,10 @@ void LCFormatNode::generateCode (const OFileWriter &of) 
const
 {
 OUString str;
 if (mnSection == 0)
+{
+sTheCurrencyReplaceTo = OUString();
 sTheCompatibleCurrency = OUString();
+}
 else if (mnSection >= 2)
 incError("more than 2 LC_FORMAT sections");
 OUString strFrom( getAttr().getValueByName("replaceFrom"));
@@ -612,15 +616,20 @@ void LCFormatNode::generateCode (const OFileWriter &of) 
const
 if (strFrom.getLength() && !str.getLength())
 incErrorStr("replaceFrom=\"%s\" replaceTo=\"\" is empty replacement.", 
strFrom);
 // Locale data generator inserts  for LangID, we need to adapt that.
-if (str.endsWithIgnoreAsciiCaseAsciiL( "-]", 6))
+if (str.endsWithIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM( 
"-]")))
 incErrorStr("replaceTo=\"%s\" needs  to be adapted to the real 
LangID value.", str);
 of.writeParameter("replaceTo", str, mnSection);
+// Remember the replaceTo value for "[CURRENCY]" to check format codes.
+if (strFrom.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "[CURRENCY]")))
+sTheCurrencyReplaceTo = str;
 // Remember the currency symbol if present.
 if (str.indexOfAsciiL( "[$", 2) == 0)
 {
 sal_Int32 nHyphen = str.indexOf( '-');
 if (nHyphen >= 3)
+{
 sTheCompatibleCurrency = str.copy( 2, nHyphen - 2);
+}
 }
 ::rtl::OUString useLocale =   getAttr().getValueByName("ref");
 if (useLocale.getLength() > 0) {
@@ -757,6 +766,13 @@ void LCFormatNode::generateCode (const OFileWriter &of) 
const
 aCode.indexOf( aPar3 ) > 0 || aCode.indexOf( 
aPar4 ) > 0)
 fprintf( stderr, "Warning: FormatCode 
formatindex=\"%d\" for currency uses parentheses for negative amounts, which 
probably is not correct for locales not based on en_US.\n", formatindex);
 }
+// Check if we have replaceTo for "[CURRENCY]" placeholder.
+if (sTheCurrencyReplaceTo.isEmpty())
+{
+OUString aCode( n->getValue());
+if (aCode.indexOfAsciiL( RTL_CONSTASCII_STRINGPARAM( 
"[CURRENCY]")) >= 0)
+incErrorInt( "[CURRENCY] replaceTo not found for 
formatindex=\"%d\".", formatindex);
+}
 break;
 }
 if (pCtype)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - i18npool/source

2011-11-25 Thread Eike Rathke
 i18npool/source/localedata/data/pt_PT.xml |   49 +-
 1 file changed, 28 insertions(+), 21 deletions(-)

New commits:
commit 0e0b3dfc9a13794b2f0137676ccfe0fe608f2864
Author: Eike Rathke 
Date:   Fri Nov 25 17:27:19 2011 +0100

added [pt-PT] legacyOnly currency to cope with change from Esc. to $

diff --git a/i18npool/source/localedata/data/pt_PT.xml 
b/i18npool/source/localedata/data/pt_PT.xml
index 1fbacd9..2d0f18d 100644
--- a/i18npool/source/localedata/data/pt_PT.xml
+++ b/i18npool/source/localedata/data/pt_PT.xml
@@ -34,7 +34,7 @@
 PM
 Metric
 
-
+
 
 DD-MM-
 
@@ -337,6 +337,13 @@
 
 
 
+
+PTE
+Esc.
+PTE
+Escudo
+2
+
 
 PTE
 $
commit 06b6e220b5e9250c688daaea4a7eb2ae64f1863c
Author: Sérgio Marques 
Date:   Fri Nov 25 17:23:25 2011 +0100

updated Portuguese [pt-PT] locale data

diff --git a/i18npool/source/localedata/data/pt_PT.xml 
b/i18npool/source/localedata/data/pt_PT.xml
index df6ce1d..1fbacd9 100644
--- a/i18npool/source/localedata/data/pt_PT.xml
+++ b/i18npool/source/localedata/data/pt_PT.xml
@@ -156,7 +156,7 @@
 
 
 
-Estandar
+Geral
 
 
 
@@ -222,38 +222,38 @@
 
 
 sun
-Dom
-Domingo
+dom
+domingo
 
 
 mon
-Seg
-Segunda-feira
+seg
+segunda-feira
 
 
 tue
-Ter
-Terça-feira
+ter
+terça-feira
 
 
 wed
-Qua
-Quarta-feira
+qua
+quarta-feira
 
 
 thu
-Qui
-Quinta-feira
+qui
+quinta-feira
 
 
 fri
-Sex
-Sexta-feira
+sex
+sexta-feira
 
 
 sat
-Sáb
-Sábado
+sáb
+sábado
 
 
 
@@ -321,13 +321,13 @@
 
 
 bc
-a.c.
-a.c.
+aC
+aC
 
 
 ad
-d.c.
-d.c.
+dC
+dC
 
 
 
@@ -339,7 +339,7 @@
 
 
 PTE
-Esc.
+$
 PTE
 Escudo
 2
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - i18npool/source svl/source

2011-11-23 Thread Eike Rathke
 i18npool/source/localedata/data/be_BY.xml |   62 ++
 svl/source/numbers/zformat.cxx|   43 
 2 files changed, 97 insertions(+), 8 deletions(-)

New commits:
commit e9f303624c26d548fa4581ffe87d3ffec3bf6c26
Author: Eike Rathke 
Date:   Wed Nov 23 12:28:11 2011 +0100

use cased month names only if no hard coded literal string follows

diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index e4c347b..5ab0175 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -2948,37 +2948,64 @@ bool SvNumberformat::ImpGetTimeOutput(double fNumber,
 /** If a day of month occurs within the format, the month name is in 
possessive 
 genitive case if the day follows the month, and partitive case if the day 
 precedes the month. If there is no day of month the nominative case (noun) 
-is returned.
+is returned. Also if the month is immediately preceded or followed by a 
+literal string other than space the nominative name is used, this prevents 
+duplicated casing for \t\a and such in documents imported from (e.g. 
+Finnish) Excel or older LibO/OOo releases.
  */
+
+// IDEA: instead of eCodeType pass the index to nTypeArray and restrict 
+// inspection of month name around that one, that would enable different month 
+// cases in one format. Though probably the most rare use case ever..
+
 sal_Int32 SvNumberformat::ImpUseMonthCase( int & io_nState, const ImpSvNumFor& 
rNumFor, NfKeywordIndex eCodeType ) const
 {
 using namespace ::com::sun::star::i18n;
 if (!io_nState)
 {
-io_nState = 1;
 bool bMonthSeen = false;
+bool bDaySeen = false;
 const ImpSvNumberformatInfo& rInfo = rNumFor.Info();
 const sal_uInt16 nCount = rNumFor.GetCount();
-for ( sal_uInt16 i = 0; i < nCount && io_nState == 1; ++i )
+for (sal_uInt16 i = 0; i < nCount && io_nState == 0; ++i)
 {
-switch ( rInfo.nTypeArray[i] )
+switch (rInfo.nTypeArray[i])
 {
 case NF_KEY_D :
 case NF_KEY_DD :
-io_nState = (bMonthSeen ? 2 : 3);   // and end loop
+if (bMonthSeen)
+io_nState = 2;
+else
+bDaySeen = true;
 break;
 case NF_KEY_MMM:
 case NF_KEY_:
 case NF_KEY_M:
-bMonthSeen = true;
+{
+xub_StrLen nLen;
+if ((i < nCount-1 &&
+rInfo.nTypeArray[i+1] == 
NF_SYMBOLTYPE_STRING &&
+rInfo.sStrArray[i+1].GetChar(0) != ' ') ||
+(i > 0 &&
+ rInfo.nTypeArray[i-1] == NF_SYMBOLTYPE_STRING 
&&
+ ((nLen = rInfo.sStrArray[i-1].Len()) > 0) &&
+ rInfo.sStrArray[i-1].GetChar(nLen-1) != ' '))
+io_nState = 1;
+else if (bDaySeen)
+io_nState = 3;
+else
+bMonthSeen = true;
+}
 break;
 }
 }
+if (io_nState == 0)
+io_nState = 1;  // no day of month
 }
 switch (io_nState)
 {
 case 1:
-// no day of month
+// no day of month or forced nominative
 switch (eCodeType)
 {
 case NF_KEY_MMM:
@@ -3017,7 +3044,7 @@ sal_Int32 SvNumberformat::ImpUseMonthCase( int & 
io_nState, const ImpSvNumFor& r
 ;   // nothing
 }
 }
-OSL_FAIL( "ImpUseMonthCase: should not be reached");
+OSL_FAIL( "ImpUseMonthCase: unhandled keyword index eCodeType");
 return CalendarDisplayCode::LONG_MONTH_NAME;
 }
 
commit 75a49370e6abef09d0e174dc87af33d2a29165be
Author: Yury Tarasievich 
Date:   Wed Nov 23 12:00:58 2011 +0100

added Belarusian [be-BY] genitive case month names

diff --git a/i18npool/source/localedata/data/be_BY.xml 
b/i18npool/source/localedata/data/be_BY.xml
index 70a2ed1..f866f46 100644
--- a/i18npool/source/localedata/data/be_BY.xml
+++ b/i18npool/source/localedata/data/be_BY.xml
@@ -285,6 +285,68 @@
   Снежань
 
   
+  
+
+  jan
+  сту
+  студзеня
+
+
+  feb
+  лют
+  лютага
+
+
+  mar
+  сак
+  сакавіка
+
+
+  apr
+  кра
+  красавіка
+
+
+  may
+  тра
+  траўня
+
+
+  jun
+  чэр
+  чэрвеня
+
+