Files
libreoffice/svx/source/items/numfmtsh.cxx

1696 lines
55 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
re-base on ALv2 code. Includes: Patch contributed by Christian Lippka impress212: #i113063# patch: dubios self assign in svx/source/dialog/framelink.cxx http://svn.apache.org/viewvc?view=revision&revision=1167619 Patches contributed by Mathias Bauer gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394707 http://svn.apache.org/viewvc?view=revision&revision=1394326 cws mba34issues01: #i117712#: fix several resource errors introduced by IAccessible2 implementation http://svn.apache.org/viewvc?view=revision&revision=1172343 cws mba34issues01: #i117719#: use correct resource ID http://svn.apache.org/viewvc?view=revision&revision=1172351 Patch contributed by Andre Fischer Do not add targets for junit tests when junit is disabled. http://svn.apache.org/viewvc?view=revision&revision=1241508 Patches contributed by Armin Le-Grand #118804# corrected GraphicExporter behaviour on shortcut when pixel graphic is requested http://svn.apache.org/viewvc?view=revision&revision=1240195 fix for #118525#: Using primitives for chart sub-geometry visualisation http://svn.apache.org/viewvc?view=revision&revision=1226879 #118485# - Styles for OLEs are not saved. http://svn.apache.org/viewvc?view=revision&revision=1182166 #118524: apply patch, followup fixes to 118485 http://svn.apache.org/viewvc?view=revision&revision=1186077 13f79535-47bb-0310-9956-ffa450edef68 Patch contributed by Regina Henschel linecap: Reintegrating finished LineCap feature http://svn.apache.org/viewvc?view=revision&revision=1232507 Patch contributed by Wang Lei (leiw) #i118760# split the first table cell vertically, then undo&redo, the Presentation app will crash http://svn.apache.org/viewvc?view=revision&revision=1301361 cleanup globlmn hacks, undo dependent fixmes.
2012-11-21 22:06:52 +00:00
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
2000-09-18 16:07:07 +00:00
#include <tools/color.hxx>
2000-09-18 16:07:07 +00:00
#include <tools/debug.hxx>
#include <i18nlangtag/mslangid.hxx>
#include <svl/zforlist.hxx>
#include <svl/zformat.hxx>
#include <svl/currencytable.hxx>
2000-09-18 16:07:07 +00:00
#include <svtools/langtab.hxx>
2002-07-23 09:52:55 +00:00
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
CWS-TOOLING: integrate CWS locales32 2009-09-06 19:13:15 +0200 er r275860 : #i104308# Lower and Upper Sorbian 2009-09-03 01:40:09 +0200 erack r275732 : CWS-TOOLING: rebase CWS locales32 to trunk@275331 (milestone: DEV300:m56) 2009-08-17 21:48:26 +0200 erack r275072 : * #i102920# use OUString::iterateCodePoints() in xdictionary; patch from <cmc> * Adapted local iterateCodePoints() in breakiteratorImpl.cxx to cope with surrogates at text end. * Use OUString::iterateCodePoints() in BreakIterator_CJK::getLineBreak() 2009-08-09 23:14:39 +0200 erack r274792 : mergeinfo 2009-08-09 23:09:31 +0200 erack r274791 : re-adding this again, merge from tag didn't work; SVN IS A PIECE OF CRAP 2009-08-09 22:45:02 +0200 erack r274790 : don't re-add file, merge instead 2009-08-09 22:09:49 +0200 erack r274789 : cws rebase ERRONEOUSLY REMOVED THIS FILE! 2009-08-09 22:01:02 +0200 erack r274788 : adapt to new postset.mk completelangiso content; get rid of /i modifier uglyness 2009-08-09 19:40:46 +0200 erack r274787 : #i99823# sort currency list ISO,symbol,language/country; removed unused STR_EUROPE 2009-08-09 01:23:35 +0200 erack r274786 : make AZM currency legacyOnly to avoid duplicate listing in number formatter because of the identical 'man.' currency symbol 2009-08-09 01:11:38 +0200 erack r274785 : #i94445# make ROL currency legacyOnly to avoid duplicate listing in number formatter because of the identical 'lei' currency symbol 2009-08-06 19:10:34 +0200 erack r274743 : CWS-TOOLING: rebase CWS locales32 to trunk@274622 (milestone: DEV300:m54) 2009-08-04 21:26:24 +0200 erack r274634 : #i94445# new currency RON 2009-08-04 21:06:55 +0200 erack r274633 : #i103193# corrected data; from <calibaashi> 2009-07-18 23:56:55 +0200 erack r274104 : #i103408# ignore an empty LANGUAGE variable; patch from <cmc> 2009-07-07 00:21:02 +0200 erack r273764 : Langpack.ulf is gone 2009-07-07 00:02:39 +0200 erack r273763 : #i103358# add 'is' Icelandic 2009-07-04 02:10:55 +0200 erack r273720 : #i101173# typographic quotation marks 2009-07-04 01:07:44 +0200 erack r273719 : #i65127# make it compile with OSL_DEBUG_LEVEL>2 again 2009-06-26 22:50:49 +0200 erack r273444 : #i97602# add Asturian_Spain [ast-ES]; locale data contributed by <astur>/<it46> 2009-06-26 22:01:25 +0200 erack r273443 : #i101173# add Oromo [om-ET] locale data; contributed by <barreessaa> 2009-06-26 21:55:41 +0200 erack r273442 : #i101173# add Oromo [om-ET] locale data; contributed by <barreessaa> 2009-06-26 21:11:46 +0200 erack r273441 : #i102991# linguistic corrections 2009-06-26 21:02:45 +0200 erack r273440 : #i102986# add Somali 'so' 2009-06-22 00:04:35 +0200 erack r273190 : #i101235# add Uyghur_China [ug-CN] locale; contributed by <sahran>/<it46> 2009-06-21 23:35:21 +0200 erack r273189 : blah 2009-06-21 23:22:40 +0200 erack r273188 : #i99972# add Quechua (Ecuador) [qu-EC] 2009-06-21 21:57:29 +0200 erack r273187 : #i97791# add Yiddish [yi-IL] 2009-06-21 21:24:29 +0200 erack r273186 : #i102186# add Greek, Ancient [grc-GR] 2009-06-21 21:00:59 +0200 erack r273185 : #i98489# add Arabic (Oman) [ar-OM] locale data; contributed by <zayed2001>/<it46> 2009-06-21 20:54:07 +0200 erack r273184 : check ListSeparator for ';' semicolon, for consistency 2009-06-21 20:20:13 +0200 erack r273183 : ISO 4217 checks only if not legacy (e.g. Macau Pound 'P') 2009-06-21 20:00:27 +0200 erack r273182 : check CurrencyID and BankSymbol vor ISO 4217 2009-06-21 19:10:36 +0200 erack r273181 : #i73118# Bokmål instead of Bokmal 2009-06-21 19:00:47 +0200 erack r273180 : #i99827# add Sardinian locale data; contributed by <valterubuntu> 2009-06-21 18:20:05 +0200 erack r273179 : give URL of svn instead of legacy cvs 2009-06-21 17:45:31 +0200 erack r273178 : #i87907# add Oromo [om-ET] 2009-06-21 17:23:14 +0200 erack r273177 : grep in completelangiso of postset.mk 2009-03-24 00:22:16 +0100 erack r269901 : #i100368# parentheses, parentheses, parentheses ... 2009-03-23 23:31:22 +0100 erack r269899 : #i99712# call OutlineNumberingLevel_Impl dtor 2009-03-23 22:37:31 +0100 erack r269897 : #i98347# register NumToCharHalfwidth 2009-03-22 18:07:40 +0100 erack r269852 : definitely ignore any output resulting from the cd command in list of rules, which may have lead to a spurious rule file
2009-09-16 14:55:33 +00:00
#include <comphelper/processfactory.hxx>
2002-07-23 09:52:55 +00:00
#include <svx/numfmtsh.hxx>
2011-08-08 13:06:35 +02:00
#include <limits>
2000-09-18 16:07:07 +00:00
const double SvxNumberFormatShell::DEFAULT_NUMVALUE = 1234.56789;
2000-09-18 16:07:07 +00:00
SvxNumberFormatShell* SvxNumberFormatShell::Create( SvNumberFormatter* pNumFormatter,
sal_uInt32 nFormatKey,
SvxNumberValueType eNumValType,
const OUString& rNumStr )
2000-09-18 16:07:07 +00:00
{
return new SvxNumberFormatShell(pNumFormatter,nFormatKey,
eNumValType,rNumStr );
}
SvxNumberFormatShell* SvxNumberFormatShell::Create( SvNumberFormatter* pNumFormatter,
sal_uInt32 nFormatKey,
2000-09-18 16:07:07 +00:00
SvxNumberValueType eNumValType,
double nNumVal,
const OUString* pNumStr )
2000-09-18 16:07:07 +00:00
{
return new SvxNumberFormatShell(pNumFormatter,nFormatKey,
eNumValType,nNumVal,pNumStr );
2000-09-18 16:07:07 +00:00
}
2000-09-18 16:07:07 +00:00
SvxNumberFormatShell::SvxNumberFormatShell( SvNumberFormatter* pNumFormatter,
sal_uInt32 nFormatKey,
2000-09-18 16:07:07 +00:00
SvxNumberValueType eNumValType,
const OUString& rNumStr )
: pFormatter ( pNumFormatter )
, pCurFmtTable ( NULL )
, eValType ( eNumValType )
, bUndoAddList ( true )
, nCurFormatKey ( nFormatKey )
, nCurCategory (css::util::NumberFormat::ALL)
, eCurLanguage (LANGUAGE_NONE)
, pCurCurrencyEntry(NULL)
, bBankingSymbol (false)
, nCurCurrencyEntryPos((sal_uInt16) SELPOS_NONE)
, bUseStarFormat (false)
2000-09-18 16:07:07 +00:00
{
nValNum = DEFAULT_NUMVALUE;
switch ( eValType )
{
case SVX_VALUE_TYPE_STRING:
aValStr = rNumStr;
break;
case SVX_VALUE_TYPE_NUMBER:
case SVX_VALUE_TYPE_UNDEFINED:
default:
aValStr.clear();
2000-09-18 16:07:07 +00:00
}
}
2000-09-18 16:07:07 +00:00
SvxNumberFormatShell::SvxNumberFormatShell( SvNumberFormatter* pNumFormatter,
sal_uInt32 nFormatKey,
2000-09-18 16:07:07 +00:00
SvxNumberValueType eNumValType,
double nNumVal,
const OUString* pNumStr )
: pFormatter ( pNumFormatter )
, pCurFmtTable ( NULL )
, eValType ( eNumValType )
, bUndoAddList ( true )
, nCurFormatKey ( nFormatKey )
, nCurCategory (css::util::NumberFormat::ALL)
, eCurLanguage (LANGUAGE_NONE)
, pCurCurrencyEntry(NULL)
, bBankingSymbol (false)
, nCurCurrencyEntryPos((sal_uInt16) SELPOS_NONE)
, bUseStarFormat (false)
2000-09-18 16:07:07 +00:00
{
// #50441# When used in Writer, the SvxNumberInfoItem contains the
// original string in addition to the value
if ( pNumStr )
aValStr = *pNumStr;
2000-09-18 16:07:07 +00:00
switch ( eValType )
{
case SVX_VALUE_TYPE_NUMBER:
nValNum = nNumVal;
break;
case SVX_VALUE_TYPE_STRING:
case SVX_VALUE_TYPE_UNDEFINED:
default:
nValNum = DEFAULT_NUMVALUE;
}
}
2000-09-18 16:07:07 +00:00
SvxNumberFormatShell::~SvxNumberFormatShell()
{
/*
* An dieser Stelle wird abhaengig davon, ob die
* hinzugefuegten, benutzerdefinierten als gueltig
* erklaert wurden (ValidateNewEntries()), die
* Add-Liste wieder aus dem Zahlenformatierer entfernt.
*
* Loeschen von Formaten aus dem Formatierer passiert
* aus Undo-Gruenden nur in der aufrufenden Instanz.
*/
if ( bUndoAddList )
{
// Added formats are invalid => remove them
2000-09-18 16:07:07 +00:00
for ( std::vector<sal_uInt32>::const_iterator it(aAddList.begin()); it != aAddList.end(); ++it )
pFormatter->DeleteEntry( *it );
2000-09-18 16:07:07 +00:00
}
}
2000-09-18 16:07:07 +00:00
size_t SvxNumberFormatShell::GetUpdateDataCount() const
2000-09-18 16:07:07 +00:00
{
return aDelList.size();
2000-09-18 16:07:07 +00:00
}
2000-09-18 16:07:07 +00:00
void SvxNumberFormatShell::GetUpdateData( sal_uInt32* pDelArray, const sal_uInt32 nSize )
{
const size_t nListSize = aDelList.size();
2000-09-18 16:07:07 +00:00
DBG_ASSERT( pDelArray && ( nSize == nListSize ), "Array not initialised!" );
2000-09-18 16:07:07 +00:00
if ( pDelArray && ( nSize == nListSize ) )
for (std::vector<sal_uInt32>::const_iterator it(aDelList.begin()); it != aDelList.end(); ++it )
*pDelArray++ = *it;
2000-09-18 16:07:07 +00:00
}
2000-09-18 16:07:07 +00:00
void SvxNumberFormatShell::CategoryChanged( sal_uInt16 nCatLbPos,
short& rFmtSelPos,
std::vector<OUString>& rFmtEntries )
2000-09-18 16:07:07 +00:00
{
short nOldCategory = nCurCategory;
2000-09-18 16:07:07 +00:00
PosToCategory_Impl( nCatLbPos, nCurCategory );
pCurFmtTable = &( pFormatter->GetEntryTable( nCurCategory,
nCurFormatKey,
eCurLanguage ) );
// reinitialize currency if category newly entered
if ( nCurCategory == css::util::NumberFormat::CURRENCY && nOldCategory != nCurCategory )
pCurCurrencyEntry = NULL;
2000-09-18 16:07:07 +00:00
rFmtSelPos = FillEntryList_Impl( rFmtEntries );
}
2000-09-18 16:07:07 +00:00
void SvxNumberFormatShell::LanguageChanged( LanguageType eLangType,
short& rFmtSelPos,
std::vector<OUString>& rFmtEntries )
2000-09-18 16:07:07 +00:00
{
eCurLanguage = eLangType;
pCurFmtTable = &(pFormatter->ChangeCL( nCurCategory,
nCurFormatKey,
eCurLanguage ) );
rFmtSelPos = FillEntryList_Impl( rFmtEntries );
}
2000-09-18 16:07:07 +00:00
void SvxNumberFormatShell::FormatChanged( sal_uInt16 nFmtLbPos,
OUString& rPreviewStr,
Color*& rpFontColor )
2000-09-18 16:07:07 +00:00
{
if( static_cast<size_t>(nFmtLbPos) < aCurEntryList.size() )
2000-09-18 16:07:07 +00:00
{
nCurFormatKey = aCurEntryList[nFmtLbPos];
2000-09-18 16:07:07 +00:00
if( nCurFormatKey != NUMBERFORMAT_ENTRY_NOT_FOUND )
2000-09-18 16:07:07 +00:00
{
2002-07-23 09:52:55 +00:00
GetPreviewString_Impl( rPreviewStr, rpFontColor );
2000-09-18 16:07:07 +00:00
}
else if( nCurCategory == css::util::NumberFormat::CURRENCY )
2000-09-18 16:07:07 +00:00
{
if( static_cast<size_t>(nFmtLbPos) < aCurrencyFormatList.size() )
2000-09-18 16:07:07 +00:00
{
MakePrevStringFromVal(aCurrencyFormatList[nFmtLbPos],
2002-07-23 09:52:55 +00:00
rPreviewStr,rpFontColor,nValNum);
2000-09-18 16:07:07 +00:00
}
}
}
}
2000-09-18 16:07:07 +00:00
bool SvxNumberFormatShell::AddFormat( OUString& rFormat, sal_Int32& rErrPos,
2000-09-18 16:07:07 +00:00
sal_uInt16& rCatLbSelPos, short& rFmtSelPos,
std::vector<OUString>& rFmtEntries )
2000-09-18 16:07:07 +00:00
{
bool bInserted = false;
2000-09-18 16:07:07 +00:00
sal_uInt32 nAddKey = pFormatter->GetEntryKey( rFormat, eCurLanguage );
if ( nAddKey != NUMBERFORMAT_ENTRY_NOT_FOUND ) // exists already?
2000-09-18 16:07:07 +00:00
{
::std::vector<sal_uInt32>::iterator nAt = GetRemoved_Impl( nAddKey );
if ( nAt != aDelList.end() )
2000-09-18 16:07:07 +00:00
{
aDelList.erase( nAt );
bInserted = true;
2000-09-18 16:07:07 +00:00
}
else
{
OSL_FAIL( "duplicate format!" );
}
2000-09-18 16:07:07 +00:00
}
else // new format
2000-09-18 16:07:07 +00:00
{
sal_Int32 nPos;
bInserted = pFormatter->PutEntry( rFormat, nPos,
2000-09-18 16:07:07 +00:00
nCurCategory, nAddKey,
eCurLanguage );
rErrPos = (nPos >= 0) ? nPos : -1;
if (bInserted)
{
// May be sorted under a different locale if LCID was parsed.
const SvNumberformat* pEntry = pFormatter->GetEntry( nAddKey);
if (pEntry)
{
LanguageType nLang = pEntry->GetLanguage();
if (eCurLanguage != nLang)
{
// Current language's list would not show entry, adapt.
eCurLanguage = nLang;
}
}
}
2000-09-18 16:07:07 +00:00
}
if ( bInserted )
2000-09-18 16:07:07 +00:00
{
nCurFormatKey = nAddKey;
DBG_ASSERT( !IsAdded_Impl( nCurFormatKey ), "duplicate format!" );
aAddList.push_back( nCurFormatKey );
2000-09-18 16:07:07 +00:00
// get current table
2000-09-18 16:07:07 +00:00
pCurFmtTable = &(pFormatter->GetEntryTable( nCurCategory,
nCurFormatKey,
eCurLanguage ));
nCurCategory=pFormatter->GetType(nAddKey);
2000-09-18 16:07:07 +00:00
CategoryToPos_Impl( nCurCategory, rCatLbSelPos );
rFmtSelPos = FillEntryList_Impl( rFmtEntries );
}
else if ( rErrPos != 0 ) // syntax error
{
2000-09-18 16:07:07 +00:00
;
}
else // insert twice not possible
{
OSL_FAIL( "duplicate format!" );
}
2000-09-18 16:07:07 +00:00
return bInserted;
}
2000-09-18 16:07:07 +00:00
bool SvxNumberFormatShell::RemoveFormat( const OUString& rFormat,
sal_uInt16& rCatLbSelPos,
short& rFmtSelPos,
std::vector<OUString>& rFmtEntries )
2000-09-18 16:07:07 +00:00
{
sal_uInt32 nDelKey = pFormatter->GetEntryKey( rFormat, eCurLanguage );
DBG_ASSERT( nDelKey != NUMBERFORMAT_ENTRY_NOT_FOUND, "entry not found!" );
DBG_ASSERT( !IsRemoved_Impl( nDelKey ), "entry already removed!" );
2000-09-18 16:07:07 +00:00
if ( (nDelKey != NUMBERFORMAT_ENTRY_NOT_FOUND) && !IsRemoved_Impl( nDelKey ) )
{
aDelList.push_back( nDelKey );
2000-09-18 16:07:07 +00:00
::std::vector<sal_uInt32>::iterator nAt = GetAdded_Impl( nDelKey );
if( nAt != aAddList.end() )
2000-09-18 16:07:07 +00:00
{
aAddList.erase( nAt );
2000-09-18 16:07:07 +00:00
}
nCurCategory=pFormatter->GetType(nDelKey);
2000-09-18 16:07:07 +00:00
pCurFmtTable = &(pFormatter->GetEntryTable( nCurCategory,
nCurFormatKey,
eCurLanguage ));
nCurFormatKey=pFormatter->GetStandardFormat(nCurCategory,
eCurLanguage );
CategoryToPos_Impl( nCurCategory, rCatLbSelPos );
rFmtSelPos = FillEntryList_Impl( rFmtEntries );
}
return true;
2000-09-18 16:07:07 +00:00
}
2000-09-18 16:07:07 +00:00
void SvxNumberFormatShell::MakeFormat( OUString& rFormat,
bool bThousand, bool bNegRed,
2000-09-18 16:07:07 +00:00
sal_uInt16 nPrecision, sal_uInt16 nLeadingZeroes,
sal_uInt16 nCurrencyPos)
{
if( aCurrencyFormatList.size() > static_cast<size_t>(nCurrencyPos) )
2000-09-18 16:07:07 +00:00
{
sal_Int32 rErrPos=0;
std::vector<OUString> aFmtEList;
2000-09-18 16:07:07 +00:00
sal_uInt32 nFound = pFormatter->TestNewString( aCurrencyFormatList[nCurrencyPos], eCurLanguage );
2000-09-18 16:07:07 +00:00
if ( nFound == NUMBERFORMAT_ENTRY_NOT_FOUND )
{
sal_uInt16 rCatLbSelPos =0;
short rFmtSelPos = 0;
AddFormat( aCurrencyFormatList[nCurrencyPos],rErrPos,rCatLbSelPos,
2000-09-18 16:07:07 +00:00
rFmtSelPos,aFmtEList);
}
if(rErrPos==0)
{
rFormat = pFormatter->GenerateFormat(nCurFormatKey,
eCurLanguage,
bThousand, bNegRed,
nPrecision, nLeadingZeroes);
2000-09-18 16:07:07 +00:00
}
}
else
{
rFormat = pFormatter->GenerateFormat(nCurFormatKey,
eCurLanguage,
bThousand, bNegRed,
nPrecision, nLeadingZeroes);
2000-09-18 16:07:07 +00:00
}
}
sal_uInt16 SvxNumberFormatShell::GetFormatIntegerDigits( const OUString& rFormat ) const
{
sal_uInt32 nFmtKey = pFormatter->GetEntryKey( rFormat, eCurLanguage );
return pFormatter->GetFormatIntegerDigits(nFmtKey);
}
2000-09-18 16:07:07 +00:00
void SvxNumberFormatShell::GetOptions( const OUString& rFormat,
bool& rThousand,
bool& rNegRed,
sal_uInt16& rPrecision,
sal_uInt16& rLeadingZeroes,
sal_uInt16& rCatLbPos )
2000-09-18 16:07:07 +00:00
{
sal_uInt32 nFmtKey = pFormatter->GetEntryKey( rFormat, eCurLanguage );
if(nFmtKey != NUMBERFORMAT_ENTRY_NOT_FOUND)
{
pFormatter->GetFormatSpecialInfo( nFmtKey,
rThousand, rNegRed,
rPrecision, rLeadingZeroes );
2000-09-18 16:07:07 +00:00
CategoryToPos_Impl( pFormatter->GetType( nFmtKey ), rCatLbPos );
2000-09-18 16:07:07 +00:00
}
else
{
bool bTestBanking = false;
2000-09-18 16:07:07 +00:00
sal_uInt16 nPos=FindCurrencyTableEntry(rFormat, bTestBanking );
if(IsInTable(nPos,bTestBanking,rFormat) &&
pFormatter->GetFormatSpecialInfo( rFormat,rThousand, rNegRed,
rPrecision, rLeadingZeroes,eCurLanguage)==0)
{
rCatLbPos = CAT_CURRENCY;
}
else
rCatLbPos = CAT_USERDEFINED;
}
}
2000-09-18 16:07:07 +00:00
void SvxNumberFormatShell::MakePreviewString( const OUString& rFormatStr,
OUString& rPreviewStr,
Color*& rpFontColor )
2000-09-18 16:07:07 +00:00
{
2002-07-23 09:52:55 +00:00
rpFontColor = NULL;
2000-09-18 16:07:07 +00:00
sal_uIntPtr nExistingFormat = pFormatter->GetEntryKey( rFormatStr, eCurLanguage );
if ( nExistingFormat == NUMBERFORMAT_ENTRY_NOT_FOUND )
{
// real preview - not implemented in NumberFormatter for text formats
pFormatter->GetPreviewString( rFormatStr, nValNum, rPreviewStr,
&rpFontColor, eCurLanguage, bUseStarFormat );
}
else
{
// format exists
// #50441# if a string was set in addition to the value, use it for text formats
bool bUseText = ( eValType == SVX_VALUE_TYPE_STRING ||
( !aValStr.isEmpty() && ( pFormatter->GetType(nExistingFormat) & css::util::NumberFormat::TEXT ) ) );
if ( bUseText )
{
pFormatter->GetOutputString( aValStr, nExistingFormat,
rPreviewStr, &rpFontColor );
}
else
{
pFormatter->GetOutputString( nValNum, nExistingFormat,
rPreviewStr, &rpFontColor, bUseStarFormat );
}
}
2000-09-18 16:07:07 +00:00
}
2000-09-18 16:07:07 +00:00
bool SvxNumberFormatShell::IsUserDefined( const OUString& rFmtString )
2000-09-18 16:07:07 +00:00
{
sal_uInt32 nFound = pFormatter->GetEntryKey( rFmtString, eCurLanguage );
bool bFlag=false;
2000-09-18 16:07:07 +00:00
if ( nFound != NUMBERFORMAT_ENTRY_NOT_FOUND )
{
bFlag=pFormatter->IsUserDefined( rFmtString, eCurLanguage );
if(bFlag)
{
const SvNumberformat* pNumEntry = pFormatter->GetEntry(nFound);
if(pNumEntry!=NULL && pNumEntry->HasNewCurrency())
{
bool bTestBanking;
2000-09-18 16:07:07 +00:00
sal_uInt16 nPos=FindCurrencyTableEntry(rFmtString,bTestBanking);
bFlag=!IsInTable(nPos,bTestBanking,rFmtString);
}
}
}
return bFlag;
}
2000-09-18 16:07:07 +00:00
bool SvxNumberFormatShell::FindEntry( const OUString& rFmtString, sal_uInt32* pAt /* = NULL */ )
2000-09-18 16:07:07 +00:00
{
bool bRes=false;
2000-09-18 16:07:07 +00:00
sal_uInt32 nFound = pFormatter->TestNewString( rFmtString, eCurLanguage );
if ( nFound == NUMBERFORMAT_ENTRY_NOT_FOUND )
{
bool bTestBanking=false;
2000-09-18 16:07:07 +00:00
sal_uInt16 nPos=FindCurrencyTableEntry(rFmtString, bTestBanking );
if(IsInTable(nPos,bTestBanking,rFmtString))
{
nFound=NUMBERFORMAT_ENTRY_NEW_CURRENCY;
bRes=true;
2000-09-18 16:07:07 +00:00
}
}
else
{
bRes=!IsRemoved_Impl( nFound );
}
if ( pAt )
*pAt = nFound;
return bRes;
}
2000-09-18 16:07:07 +00:00
void SvxNumberFormatShell::GetInitSettings( sal_uInt16& nCatLbPos,
LanguageType& rLangType,
sal_uInt16& nFmtLbSelPos,
std::vector<OUString>& rFmtEntries,
OUString& rPrevString,
Color*& rpPrevColor )
2000-09-18 16:07:07 +00:00
{
// precondition: number formater found
2000-09-18 16:07:07 +00:00
DBG_ASSERT( pFormatter != NULL, "Zahlenformatierer nicht gefunden!" );
short nSelPos = SELPOS_NONE;
// Sonderbehandlung fuer undefiniertes Zahlenformat:
if ( (eValType == SVX_VALUE_TYPE_UNDEFINED) && (nCurFormatKey == 0) )
PosToCategory_Impl( CAT_ALL, nCurCategory ); // Kategorie = Alle
else
nCurCategory = css::util::NumberFormat::UNDEFINED; // Kategorie = Undefiniert
2000-09-18 16:07:07 +00:00
pCurFmtTable = &(pFormatter->GetFirstEntryTable( nCurCategory,
nCurFormatKey,
eCurLanguage ));
CategoryToPos_Impl( nCurCategory, nCatLbPos );
rLangType = eCurLanguage;
nSelPos = FillEntryList_Impl( rFmtEntries );
DBG_ASSERT( nSelPos != SELPOS_NONE, "Leere Formatliste!" );
nFmtLbSelPos = (nSelPos != SELPOS_NONE) ? (sal_uInt16)nSelPos : 0;
2002-07-23 09:52:55 +00:00
GetPreviewString_Impl( rPrevString, rpPrevColor );
2000-09-18 16:07:07 +00:00
}
2000-09-18 16:07:07 +00:00
short SvxNumberFormatShell::FillEntryList_Impl( std::vector<OUString>& rList )
2000-09-18 16:07:07 +00:00
{
/* Erstellen einer aktuellen Liste von Format-Eintraegen.
* Rueckgabewert ist die Listenposition des aktuellen Formates.
* Ist die Liste leer oder gibt es kein aktuelles Format,
* so wird SELPOS_NONE geliefert.
*/
short nSelPos=0;
sal_uInt16 nPrivCat = CAT_CURRENCY;
2000-09-18 16:07:07 +00:00
nSelPos=SELPOS_NONE;
aCurEntryList.clear();
if(nCurCategory==css::util::NumberFormat::ALL)
2000-09-18 16:07:07 +00:00
{
FillEListWithStd_Impl(rList,CAT_NUMBER,nSelPos);
FillEListWithStd_Impl(rList,CAT_PERCENT,nSelPos);
FillEListWithStd_Impl(rList,CAT_CURRENCY,nSelPos);
FillEListWithStd_Impl(rList,CAT_DATE,nSelPos);
FillEListWithStd_Impl(rList,CAT_TIME,nSelPos);
FillEListWithStd_Impl(rList,CAT_SCIENTIFIC,nSelPos);
FillEListWithStd_Impl(rList,CAT_FRACTION,nSelPos);
FillEListWithStd_Impl(rList,CAT_BOOLEAN,nSelPos);
FillEListWithStd_Impl(rList,CAT_TEXT,nSelPos);
}
else
{
CategoryToPos_Impl(nCurCategory, nPrivCat);
FillEListWithStd_Impl(rList,nPrivCat,nSelPos);
}
if( nPrivCat!=CAT_CURRENCY)
nSelPos=FillEListWithUsD_Impl(rList,nPrivCat,nSelPos);
2000-09-18 16:07:07 +00:00
return nSelPos;
}
void SvxNumberFormatShell::FillEListWithStd_Impl( std::vector<OUString>& rList,
sal_uInt16 nPrivCat,short &nSelPos )
2000-09-18 16:07:07 +00:00
{
/* Erstellen einer aktuellen Liste von Format-Eintraegen.
* Rueckgabewert ist die Listenposition des aktuellen Formates.
* Ist die Liste leer oder gibt es kein aktuelles Format,
* so wird SELPOS_NONE geliefert.
*/
DBG_ASSERT( pCurFmtTable != NULL, "Unbekanntes Zahlenformat!" );
aCurrencyFormatList.clear();
2000-09-18 16:07:07 +00:00
if(nPrivCat==CAT_CURRENCY)
{
nSelPos=FillEListWithCurrency_Impl(rList,nSelPos);
}
else
{
NfIndexTableOffset eOffsetStart;
NfIndexTableOffset eOffsetEnd;
switch(nPrivCat)
{
case CAT_NUMBER :eOffsetStart=NF_NUMBER_START;
eOffsetEnd=NF_NUMBER_END;
break;
case CAT_PERCENT :eOffsetStart=NF_PERCENT_START;
eOffsetEnd=NF_PERCENT_END;
break;
case CAT_CURRENCY :eOffsetStart=NF_CURRENCY_START;
eOffsetEnd=NF_CURRENCY_END;
break;
case CAT_DATE :eOffsetStart=NF_DATE_START;
eOffsetEnd=NF_DATE_END;
break;
case CAT_TIME :eOffsetStart=NF_TIME_START;
eOffsetEnd=NF_TIME_END;
break;
case CAT_SCIENTIFIC :eOffsetStart=NF_SCIENTIFIC_START;
eOffsetEnd=NF_SCIENTIFIC_END;
break;
case CAT_FRACTION :eOffsetStart=NF_FRACTION_START;
eOffsetEnd=NF_FRACTION_END;
break;
case CAT_BOOLEAN :eOffsetStart=NF_BOOLEAN;
eOffsetEnd=NF_BOOLEAN;
break;
case CAT_TEXT :eOffsetStart=NF_TEXT;
eOffsetEnd=NF_TEXT;
break;
default :return;
}
2000-09-18 16:07:07 +00:00
nSelPos=FillEListWithFormats_Impl(rList,nSelPos,eOffsetStart,eOffsetEnd);
if(nPrivCat==CAT_DATE || nPrivCat==CAT_TIME)
{
nSelPos=FillEListWithDateTime_Impl(rList,nSelPos);
}
}
}
short SvxNumberFormatShell::FillEListWithFormats_Impl( std::vector<OUString>& rList,
short nSelPos,
2000-09-18 16:07:07 +00:00
NfIndexTableOffset eOffsetStart,
NfIndexTableOffset eOffsetEnd)
{
/* Erstellen einer aktuellen Liste von Format-Eintraegen.
* Rueckgabewert ist die Listenposition des aktuellen Formates.
* Ist die Liste leer oder gibt es kein aktuelles Format,
* so wird SELPOS_NONE geliefert.
*/
sal_uInt16 nMyType;
DBG_ASSERT( pCurFmtTable != NULL, "Unbekanntes Zahlenformat!" );
const SvNumberformat* pNumEntry = pCurFmtTable->empty() ? 0 : pCurFmtTable->begin()->second;
2000-09-18 16:07:07 +00:00
sal_uInt32 nNFEntry;
OUString aStrComment;
OUString aNewFormNInfo;
2000-09-18 16:07:07 +00:00
short nMyCat = SELPOS_NONE;
long nIndex;
for(nIndex=eOffsetStart;nIndex<=eOffsetEnd;nIndex++)
{
nNFEntry=pFormatter->GetFormatIndex((NfIndexTableOffset)nIndex,eCurLanguage);
pNumEntry = pFormatter->GetEntry(nNFEntry);
2000-09-18 16:07:07 +00:00
if(pNumEntry==NULL) continue;
nMyCat=pNumEntry->GetType() & ~css::util::NumberFormat::DEFINED;
2000-09-18 16:07:07 +00:00
aStrComment=pNumEntry->GetComment();
CategoryToPos_Impl(nMyCat,nMyType);
aNewFormNInfo= pNumEntry->GetFormatstring();
if ( nNFEntry == nCurFormatKey )
{
nSelPos = ( !IsRemoved_Impl( nNFEntry ) ) ? aCurEntryList.size() : SELPOS_NONE;
2000-09-18 16:07:07 +00:00
}
rList.push_back( aNewFormNInfo );
aCurEntryList.push_back( nNFEntry );
2000-09-18 16:07:07 +00:00
}
return nSelPos;
}
short SvxNumberFormatShell::FillEListWithDateTime_Impl( std::vector<OUString>& rList,
short nSelPos)
2000-09-18 16:07:07 +00:00
{
sal_uInt16 nMyType;
assert(pCurFmtTable && "Unknown number format!");
2000-09-18 16:07:07 +00:00
const SvNumberformat* pNumEntry = pCurFmtTable->empty() ? 0 : pCurFmtTable->begin()->second;
2000-09-18 16:07:07 +00:00
sal_uInt32 nNFEntry;
OUString aStrComment;
OUString aNewFormNInfo;
2000-09-18 16:07:07 +00:00
short nMyCat = SELPOS_NONE;
for (long nIndex = NF_DATETIME_START; nIndex <= NF_DATETIME_END; ++nIndex)
2000-09-18 16:07:07 +00:00
{
nNFEntry=pFormatter->GetFormatIndex((NfIndexTableOffset)nIndex,eCurLanguage);
pNumEntry = pFormatter->GetEntry(nNFEntry);
2000-09-18 16:07:07 +00:00
if(pNumEntry!=NULL)
{
nMyCat=pNumEntry->GetType() & ~css::util::NumberFormat::DEFINED;
2000-09-18 16:07:07 +00:00
aStrComment=pNumEntry->GetComment();
CategoryToPos_Impl(nMyCat,nMyType);
aNewFormNInfo= pNumEntry->GetFormatstring();
if ( nNFEntry == nCurFormatKey )
{
nSelPos = ( !IsRemoved_Impl( nNFEntry ) ) ? aCurEntryList.size() : SELPOS_NONE;
2000-09-18 16:07:07 +00:00
}
rList.push_back( aNewFormNInfo );
aCurEntryList.push_back( nNFEntry );
2000-09-18 16:07:07 +00:00
}
}
return nSelPos;
}
short SvxNumberFormatShell::FillEListWithCurrency_Impl( std::vector<OUString>& rList,
short nSelPos)
2000-09-18 16:07:07 +00:00
{
/* Erstellen einer aktuellen Liste von Format-Eintraegen.
* Rueckgabewert ist die Listenposition des aktuellen Formates.
* Ist die Liste leer oder gibt es kein aktuelles Format,
* so wird SELPOS_NONE geliefert.
*/
DBG_ASSERT( pCurFmtTable != NULL, "Unbekanntes Zahlenformat!" );
const NfCurrencyEntry* pTmpCurrencyEntry;
bool bTmpBanking;
OUString rSymbol;
2000-09-18 16:07:07 +00:00
bool bFlag=pFormatter->GetNewCurrencySymbolString(nCurFormatKey,rSymbol,
&pTmpCurrencyEntry,&bTmpBanking);
2000-09-18 16:07:07 +00:00
if( (!bFlag && pCurCurrencyEntry==NULL) ||
(bFlag && pTmpCurrencyEntry==NULL && rSymbol.isEmpty()) ||
(nCurCategory==css::util::NumberFormat::ALL))
2000-09-18 16:07:07 +00:00
{
if ( nCurCategory == css::util::NumberFormat::ALL )
FillEListWithUserCurrencys(rList,nSelPos);
2000-09-18 16:07:07 +00:00
nSelPos=FillEListWithSysCurrencys(rList,nSelPos);
}
else
{
nSelPos=FillEListWithUserCurrencys(rList,nSelPos);
}
return nSelPos;
}
short SvxNumberFormatShell::FillEListWithSysCurrencys( std::vector<OUString>& rList,
short nSelPos)
2000-09-18 16:07:07 +00:00
{
/* Erstellen einer aktuellen Liste von Format-Eintraegen.
* Rueckgabewert ist die Listenposition des aktuellen Formates.
* Ist die Liste leer oder gibt es kein aktuelles Format,
* so wird SELPOS_NONE geliefert.
*/
sal_uInt16 nMyType;
DBG_ASSERT( pCurFmtTable != NULL, "Unbekanntes Zahlenformat!" );
const SvNumberformat* pNumEntry = pCurFmtTable->empty() ? 0 : pCurFmtTable->begin()->second;
2000-09-18 16:07:07 +00:00
sal_uInt32 nNFEntry;
OUString aStrComment;
OUString aNewFormNInfo;
2000-09-18 16:07:07 +00:00
nCurCurrencyEntryPos=0;
short nMyCat = SELPOS_NONE;
NfIndexTableOffset eOffsetStart=NF_CURRENCY_START;
2011-12-14 14:43:58 -05:00
NfIndexTableOffset eOffsetEnd=NF_CURRENCY_END;
2000-09-18 16:07:07 +00:00
long nIndex;
for(nIndex=eOffsetStart;nIndex<=eOffsetEnd;nIndex++)
{
nNFEntry=pFormatter->GetFormatIndex((NfIndexTableOffset)nIndex,eCurLanguage);
pNumEntry = pFormatter->GetEntry(nNFEntry);
2000-09-18 16:07:07 +00:00
if(pNumEntry==NULL) continue;
nMyCat=pNumEntry->GetType() & ~css::util::NumberFormat::DEFINED;
2000-09-18 16:07:07 +00:00
aStrComment=pNumEntry->GetComment();
CategoryToPos_Impl(nMyCat,nMyType);
aNewFormNInfo= pNumEntry->GetFormatstring();
if ( nNFEntry == nCurFormatKey )
{
nSelPos = ( !IsRemoved_Impl( nNFEntry ) ) ? aCurEntryList.size() : SELPOS_NONE;
2000-09-18 16:07:07 +00:00
}
rList.push_back( aNewFormNInfo );
aCurEntryList.push_back( nNFEntry );
2000-09-18 16:07:07 +00:00
}
if(nCurCategory!=css::util::NumberFormat::ALL)
2000-09-18 16:07:07 +00:00
{
SvNumberFormatTable::iterator it = pCurFmtTable->begin();
while ( it != pCurFmtTable->end() )
2000-09-18 16:07:07 +00:00
{
sal_uInt32 nKey = it->first;
pNumEntry = it->second;
2000-09-18 16:07:07 +00:00
if ( !IsRemoved_Impl( nKey ))
{
bool bUserNewCurrency=false;
2000-09-18 16:07:07 +00:00
if(pNumEntry->HasNewCurrency())
{
const NfCurrencyEntry* pTmpCurrencyEntry;
bool bTmpBanking;
OUString rSymbol;
2000-09-18 16:07:07 +00:00
pFormatter->GetNewCurrencySymbolString(nKey,rSymbol,
&pTmpCurrencyEntry,
&bTmpBanking);
2000-09-18 16:07:07 +00:00
bUserNewCurrency=(pTmpCurrencyEntry!=NULL);
}
if(!bUserNewCurrency &&(pNumEntry->GetType() & css::util::NumberFormat::DEFINED))
2000-09-18 16:07:07 +00:00
{
nMyCat=pNumEntry->GetType() & ~css::util::NumberFormat::DEFINED;
2000-09-18 16:07:07 +00:00
aStrComment=pNumEntry->GetComment();
CategoryToPos_Impl(nMyCat,nMyType);
aNewFormNInfo= pNumEntry->GetFormatstring();
if ( nKey == nCurFormatKey ) nSelPos =aCurEntryList.size();
rList.push_back( aNewFormNInfo );
aCurEntryList.push_back( nKey );
2000-09-18 16:07:07 +00:00
}
}
++it;
2000-09-18 16:07:07 +00:00
}
}
return nSelPos;
}
short SvxNumberFormatShell::FillEListWithUserCurrencys( std::vector<OUString>& rList,
short nSelPos)
2000-09-18 16:07:07 +00:00
{
/* Erstellen einer aktuellen Liste von Format-Eintraegen.
* Rueckgabewert ist die Listenposition des aktuellen Formates.
* Ist die Liste leer oder gibt es kein aktuelles Format,
* so wird SELPOS_NONE geliefert.
*/
sal_uInt16 nMyType;
DBG_ASSERT( pCurFmtTable != NULL, "Unbekanntes Zahlenformat!" );
OUString aStrComment;
OUString aNewFormNInfo;
2000-09-18 16:07:07 +00:00
short nMyCat = SELPOS_NONE;
const NfCurrencyEntry* pTmpCurrencyEntry;
bool bTmpBanking, bAdaptSelPos;
OUString rSymbol;
OUString rBankSymbol;
2000-09-18 16:07:07 +00:00
std::vector<OUString> aList;
std::vector<sal_uInt32> aKeyList;
2000-09-18 16:07:07 +00:00
pFormatter->GetNewCurrencySymbolString(nCurFormatKey,rSymbol,
&pTmpCurrencyEntry,
&bTmpBanking);
2000-09-18 16:07:07 +00:00
OUString rShortSymbol;
2000-09-18 16:07:07 +00:00
if(pCurCurrencyEntry==NULL)
{
// #110398# If no currency format was previously selected (we're not
// about to add another currency), try to select the initial currency
// format (nCurFormatKey) that was set in FormatChanged() after
// matching the format string entered in the dialog.
bAdaptSelPos = true;
pCurCurrencyEntry = const_cast<NfCurrencyEntry*>(pTmpCurrencyEntry);
bBankingSymbol = bTmpBanking;
nCurCurrencyEntryPos = FindCurrencyFormat(pTmpCurrencyEntry,bTmpBanking);
2000-09-18 16:07:07 +00:00
}
else
{
if (pTmpCurrencyEntry == pCurCurrencyEntry)
bAdaptSelPos = true;
else
{
bAdaptSelPos = false;
pTmpCurrencyEntry = pCurCurrencyEntry;
}
2000-09-18 16:07:07 +00:00
bTmpBanking=bBankingSymbol;
}
if(pTmpCurrencyEntry!=NULL)
{
rSymbol = pTmpCurrencyEntry->BuildSymbolString(false);
rBankSymbol = pTmpCurrencyEntry->BuildSymbolString(true);
rShortSymbol = pTmpCurrencyEntry->BuildSymbolString(bTmpBanking,true);
2000-09-18 16:07:07 +00:00
}
SvNumberFormatTable::iterator it = pCurFmtTable->begin();
while ( it != pCurFmtTable->end() )
2000-09-18 16:07:07 +00:00
{
sal_uInt32 nKey = it->first;
const SvNumberformat* pNumEntry = it->second;
2000-09-18 16:07:07 +00:00
if ( !IsRemoved_Impl( nKey ) )
{
if( pNumEntry->GetType() & css::util::NumberFormat::DEFINED ||
pNumEntry->IsAdditionalBuiltin() )
2000-09-18 16:07:07 +00:00
{
nMyCat=pNumEntry->GetType() & ~css::util::NumberFormat::DEFINED;
aStrComment = pNumEntry->GetComment();
2000-09-18 16:07:07 +00:00
CategoryToPos_Impl(nMyCat,nMyType);
aNewFormNInfo = pNumEntry->GetFormatstring();
2000-09-18 16:07:07 +00:00
bool bInsFlag = false;
if ( pNumEntry->HasNewCurrency() )
{
bInsFlag = true; // merge locale formats into currency selection
}
else if( (!bTmpBanking && aNewFormNInfo.indexOf(rSymbol) >= 0) ||
(bTmpBanking && aNewFormNInfo.indexOf(rBankSymbol) >= 0) )
2000-09-18 16:07:07 +00:00
{
bInsFlag = true;
2000-09-18 16:07:07 +00:00
}
else if(aNewFormNInfo.indexOf(rShortSymbol) >= 0)
2000-09-18 16:07:07 +00:00
{
OUString rTstSymbol;
2000-09-18 16:07:07 +00:00
const NfCurrencyEntry* pTstCurrencyEntry;
bool bTstBanking;
2000-09-18 16:07:07 +00:00
pFormatter->GetNewCurrencySymbolString(nKey,rTstSymbol,
&pTstCurrencyEntry,
&bTstBanking);
2000-09-18 16:07:07 +00:00
if(pTmpCurrencyEntry == pTstCurrencyEntry &&
bTstBanking == bTmpBanking)
2000-09-18 16:07:07 +00:00
{
bInsFlag = true;
2000-09-18 16:07:07 +00:00
}
}
if(bInsFlag)
{
aList.push_back( aNewFormNInfo );
aKeyList.push_back( nKey );
2000-09-18 16:07:07 +00:00
}
}
}
++it;
2000-09-18 16:07:07 +00:00
}
NfWSStringsDtor aWSStringsDtor;
sal_uInt16 nDefault;
if ( pTmpCurrencyEntry && nCurCategory != css::util::NumberFormat::ALL )
{
nDefault = pFormatter->GetCurrencyFormatStrings(
aWSStringsDtor, *pTmpCurrencyEntry, bTmpBanking );
if ( !bTmpBanking )
pFormatter->GetCurrencyFormatStrings(
aWSStringsDtor, *pTmpCurrencyEntry, true );
}
2000-09-18 16:07:07 +00:00
else
nDefault = 0;
if ( !bTmpBanking && nCurCategory != css::util::NumberFormat::ALL )
{ // append formats for all currencies defined in the current I18N locale
const NfCurrencyTable& rCurrencyTable = SvNumberFormatter::GetTheCurrencyTable();
sal_uInt16 nCurrCount = rCurrencyTable.size();
LanguageType eLang = MsLangId::getRealLanguage( eCurLanguage );
for ( sal_uInt16 i=0; i < nCurrCount; ++i )
{
const NfCurrencyEntry* pCurr = &rCurrencyTable[i];
if ( pCurr->GetLanguage() == eLang && pTmpCurrencyEntry != pCurr )
{
pFormatter->GetCurrencyFormatStrings( aWSStringsDtor, *pCurr, false );
pFormatter->GetCurrencyFormatStrings( aWSStringsDtor, *pCurr, true );
}
}
}
2000-09-18 16:07:07 +00:00
size_t nOldListCount = rList.size();
for( size_t i = 0, nPos = nOldListCount; i < aWSStringsDtor.size(); ++i )
2000-09-18 16:07:07 +00:00
{
bool bFlag = true;
OUString aInsStr(aWSStringsDtor[i]);
size_t j;
for( j=0; j < aList.size(); ++j )
2000-09-18 16:07:07 +00:00
{
if(aList[j]==aInsStr)
2000-09-18 16:07:07 +00:00
{
bFlag = false;
2000-09-18 16:07:07 +00:00
break;
}
}
if(bFlag)
{
rList.push_back( aInsStr );
aCurEntryList.insert( aCurEntryList.begin() + (nPos++), NUMBERFORMAT_ENTRY_NOT_FOUND);
2000-09-18 16:07:07 +00:00
}
else
{
rList.push_back( aList[j] );
aList.erase( aList.begin()+j );
aCurEntryList.insert( aCurEntryList.begin() + (nPos++), aKeyList[j]);
aKeyList.erase( aKeyList.begin()+j );
2000-09-18 16:07:07 +00:00
}
}
for( size_t i = 0; i < aKeyList.size(); ++i )
2000-09-18 16:07:07 +00:00
{
if( aKeyList[i] != NUMBERFORMAT_ENTRY_NOT_FOUND )
2000-09-18 16:07:07 +00:00
{
rList.push_back( aList[i] );
aCurEntryList.push_back( aKeyList[i] );
2000-09-18 16:07:07 +00:00
}
}
for( size_t i = nOldListCount; i < rList.size(); ++i )
2000-09-18 16:07:07 +00:00
{
aCurrencyFormatList.push_back( rList[i] );
2000-09-18 16:07:07 +00:00
if ( nSelPos == SELPOS_NONE && bAdaptSelPos && aCurEntryList[i] == nCurFormatKey )
nSelPos = i;
2000-09-18 16:07:07 +00:00
}
if ( nSelPos == SELPOS_NONE && nCurCategory != css::util::NumberFormat::ALL )
nSelPos = nDefault;
2000-09-18 16:07:07 +00:00
return nSelPos;
}
short SvxNumberFormatShell::FillEListWithUsD_Impl( std::vector<OUString>& rList,
sal_uInt16 nPrivCat, short nSelPos )
2000-09-18 16:07:07 +00:00
{
/* Erstellen einer aktuellen Liste von Format-Eintraegen.
* Rueckgabewert ist die Listenposition des aktuellen Formates.
* Ist die Liste leer oder gibt es kein aktuelles Format,
* so wird SELPOS_NONE geliefert.
*/
sal_uInt16 nMyType;
DBG_ASSERT( pCurFmtTable != NULL, "Unbekanntes Zahlenformat!" );
OUString aStrComment;
OUString aNewFormNInfo;
2000-09-18 16:07:07 +00:00
short nMyCat = SELPOS_NONE;
bool bAdditional = (nPrivCat != CAT_USERDEFINED &&
nCurCategory != css::util::NumberFormat::ALL);
2000-09-18 16:07:07 +00:00
SvNumberFormatTable::iterator it = pCurFmtTable->begin();
while ( it != pCurFmtTable->end() )
2000-09-18 16:07:07 +00:00
{
sal_uInt32 nKey = it->first;
const SvNumberformat* pNumEntry = it->second;
2000-09-18 16:07:07 +00:00
if ( !IsRemoved_Impl( nKey ) )
{
if( (pNumEntry->GetType() & css::util::NumberFormat::DEFINED) ||
(bAdditional && pNumEntry->IsAdditionalBuiltin()) )
2000-09-18 16:07:07 +00:00
{
nMyCat=pNumEntry->GetType() & ~css::util::NumberFormat::DEFINED;
2000-09-18 16:07:07 +00:00
aStrComment=pNumEntry->GetComment();
CategoryToPos_Impl(nMyCat,nMyType);
aNewFormNInfo= pNumEntry->GetFormatstring();
bool bFlag=true;
2000-09-18 16:07:07 +00:00
if(pNumEntry->HasNewCurrency())
{
bool bTestBanking;
2000-09-18 16:07:07 +00:00
sal_uInt16 nPos=FindCurrencyTableEntry(aNewFormNInfo,bTestBanking);
bFlag=!IsInTable(nPos,bTestBanking,aNewFormNInfo);
}
if(bFlag)
{
if ( nKey == nCurFormatKey ) nSelPos = aCurEntryList.size();
rList.push_back( aNewFormNInfo );
aCurEntryList.push_back( nKey );
2000-09-18 16:07:07 +00:00
}
}
}
++it;
2000-09-18 16:07:07 +00:00
}
return nSelPos;
}
2000-09-18 16:07:07 +00:00
void SvxNumberFormatShell::GetPreviewString_Impl( OUString& rString, Color*& rpColor )
2000-09-18 16:07:07 +00:00
{
2002-07-23 09:52:55 +00:00
rpColor = NULL;
2000-09-18 16:07:07 +00:00
// #50441# if a string was set in addition to the value, use it for text formats
bool bUseText = ( eValType == SVX_VALUE_TYPE_STRING ||
( !aValStr.isEmpty() && ( pFormatter->GetType(nCurFormatKey) & css::util::NumberFormat::TEXT ) ) );
if ( bUseText )
{
pFormatter->GetOutputString( aValStr, nCurFormatKey, rString, &rpColor );
}
2000-09-18 16:07:07 +00:00
else
{
pFormatter->GetOutputString( nValNum, nCurFormatKey, rString, &rpColor, bUseStarFormat );
}
2000-09-18 16:07:07 +00:00
}
2000-09-18 16:07:07 +00:00
::std::vector<sal_uInt32>::iterator SvxNumberFormatShell::GetRemoved_Impl( size_t nKey )
2000-09-18 16:07:07 +00:00
{
return ::std::find(aDelList.begin(), aDelList.end(), nKey);
2000-09-18 16:07:07 +00:00
}
2000-09-18 16:07:07 +00:00
bool SvxNumberFormatShell::IsRemoved_Impl( size_t nKey )
{
return GetRemoved_Impl( nKey ) != aDelList.end();
}
::std::vector<sal_uInt32>::iterator SvxNumberFormatShell::GetAdded_Impl( size_t nKey )
{
return ::std::find(aAddList.begin(), aAddList.end(), nKey);
}
bool SvxNumberFormatShell::IsAdded_Impl( size_t nKey )
2000-09-18 16:07:07 +00:00
{
return GetAdded_Impl( nKey ) != aAddList.end();
2000-09-18 16:07:07 +00:00
}
// Konvertierungs-Routinen:
void SvxNumberFormatShell::PosToCategory_Impl(sal_uInt16 nPos, short& rCategory) const
2000-09-18 16:07:07 +00:00
{
// Kategorie ::com::sun::star::form-Positionen abbilden (->Resource)
switch ( nPos )
{
case CAT_USERDEFINED: rCategory = css::util::NumberFormat::DEFINED; break;
case CAT_NUMBER: rCategory = css::util::NumberFormat::NUMBER; break;
case CAT_PERCENT: rCategory = css::util::NumberFormat::PERCENT; break;
case CAT_CURRENCY: rCategory = css::util::NumberFormat::CURRENCY; break;
case CAT_DATE: rCategory = css::util::NumberFormat::DATE; break;
case CAT_TIME: rCategory = css::util::NumberFormat::TIME; break;
case CAT_SCIENTIFIC: rCategory = css::util::NumberFormat::SCIENTIFIC; break;
case CAT_FRACTION: rCategory = css::util::NumberFormat::FRACTION; break;
case CAT_BOOLEAN: rCategory = css::util::NumberFormat::LOGICAL; break;
case CAT_TEXT: rCategory = css::util::NumberFormat::TEXT; break;
2000-09-18 16:07:07 +00:00
case CAT_ALL:
default: rCategory = css::util::NumberFormat::ALL; break;
2000-09-18 16:07:07 +00:00
}
}
void SvxNumberFormatShell::CategoryToPos_Impl(short nCategory, sal_uInt16& rPos) const
2000-09-18 16:07:07 +00:00
{
// Kategorie auf ::com::sun::star::form-Positionen abbilden (->Resource)
switch ( nCategory )
{
case css::util::NumberFormat::DEFINED: rPos = CAT_USERDEFINED; break;
case css::util::NumberFormat::NUMBER: rPos = CAT_NUMBER; break;
case css::util::NumberFormat::PERCENT: rPos = CAT_PERCENT; break;
case css::util::NumberFormat::CURRENCY: rPos = CAT_CURRENCY; break;
case css::util::NumberFormat::DATETIME:
case css::util::NumberFormat::DATE: rPos = CAT_DATE; break;
case css::util::NumberFormat::TIME: rPos = CAT_TIME; break;
case css::util::NumberFormat::SCIENTIFIC: rPos = CAT_SCIENTIFIC; break;
case css::util::NumberFormat::FRACTION: rPos = CAT_FRACTION; break;
case css::util::NumberFormat::LOGICAL: rPos = CAT_BOOLEAN; break;
case css::util::NumberFormat::TEXT: rPos = CAT_TEXT; break;
case css::util::NumberFormat::ALL:
2000-09-18 16:07:07 +00:00
default: rPos = CAT_ALL;
}
}
/*
* Funktion: Formatiert die Zahl nValue abhaengig von rFormatStr
* und speichert das Ergebnis in rPreviewStr.
* Input: FormatString, Farbe, zu formatierende Zahl
* Output: Ausgabestring rPreviewStr
*/
2002-07-23 09:52:55 +00:00
void SvxNumberFormatShell::MakePrevStringFromVal(
const OUString& rFormatStr,
OUString& rPreviewStr,
2002-07-23 09:52:55 +00:00
Color*& rpFontColor,
double nValue)
2000-09-18 16:07:07 +00:00
{
2002-07-23 09:52:55 +00:00
rpFontColor = NULL;
pFormatter->GetPreviewString( rFormatStr, nValue, rPreviewStr, &rpFontColor, eCurLanguage );
2000-09-18 16:07:07 +00:00
}
2002-07-23 09:52:55 +00:00
/*
* Funktion: Liefert den Kommentar fuer einen gegebenen
* Eintrag zurueck.
* Input: Nummer des Eintrags
* Output: Kommentar-String
*/
void SvxNumberFormatShell::SetComment4Entry(short nEntry, const OUString& aEntStr)
2000-09-18 16:07:07 +00:00
{
SvNumberformat *pNumEntry;
if(nEntry<0) return;
sal_uInt32 nMyNfEntry=aCurEntryList[nEntry];
pNumEntry = const_cast<SvNumberformat*>(pFormatter->GetEntry(nMyNfEntry));
2000-09-18 16:07:07 +00:00
if(pNumEntry!=NULL) pNumEntry->SetComment(aEntStr);
}
/*
* Funktion: Liefert den Kommentar fuer einen gegebenen
* Eintrag zurueck.
* Input: Nummer des Eintrags
* Output: Kommentar-String
*/
OUString SvxNumberFormatShell::GetComment4Entry(short nEntry)
2000-09-18 16:07:07 +00:00
{
if(nEntry < 0)
return OUString();
2000-09-18 16:07:07 +00:00
if( static_cast<size_t>(nEntry) < aCurEntryList.size())
2000-09-18 16:07:07 +00:00
{
sal_uInt32 nMyNfEntry=aCurEntryList[nEntry];
const SvNumberformat *pNumEntry = pFormatter->GetEntry(nMyNfEntry);
2000-09-18 16:07:07 +00:00
if(pNumEntry!=NULL)
return pNumEntry->GetComment();
}
return OUString();
2000-09-18 16:07:07 +00:00
}
/*
* Funktion: Liefert die Kategorie- Nummer fuer einen gegebenen
* Eintrag zurueck.
* Input: Nummer des Eintrags
* Output: Kategorie- Nummer
*/
short SvxNumberFormatShell::GetCategory4Entry(short nEntry) const
2000-09-18 16:07:07 +00:00
{
if(nEntry<0) return 0;
if( static_cast<size_t>(nEntry) < aCurEntryList.size() )
2000-09-18 16:07:07 +00:00
{
sal_uInt32 nMyNfEntry=aCurEntryList[nEntry];
if(nMyNfEntry!=NUMBERFORMAT_ENTRY_NOT_FOUND)
{
const SvNumberformat *pNumEntry = pFormatter->GetEntry(nMyNfEntry);
2000-09-18 16:07:07 +00:00
sal_uInt16 nMyCat,nMyType;
if(pNumEntry!=NULL)
{
nMyCat=pNumEntry->GetType() & ~css::util::NumberFormat::DEFINED;
2000-09-18 16:07:07 +00:00
CategoryToPos_Impl(nMyCat,nMyType);
return (short) nMyType;
}
return 0;
}
else if( !aCurrencyFormatList.empty() )
2000-09-18 16:07:07 +00:00
{
return CAT_CURRENCY;
}
}
return 0;
}
/*
* Funktion: Liefert die Information, ob ein Eintrag
* benutzerspezifisch ist zurueck.
* Input: Nummer des Eintrags
* Output: Benutzerspezifisch?
*/
bool SvxNumberFormatShell::GetUserDefined4Entry(short nEntry)
2000-09-18 16:07:07 +00:00
{
if(nEntry<0) return false;
if( static_cast<size_t>(nEntry) < aCurEntryList.size())
2000-09-18 16:07:07 +00:00
{
sal_uInt32 nMyNfEntry=aCurEntryList[nEntry];
const SvNumberformat *pNumEntry = pFormatter->GetEntry(nMyNfEntry);
2000-09-18 16:07:07 +00:00
if(pNumEntry!=NULL)
{
if((pNumEntry->GetType() & css::util::NumberFormat::DEFINED)>0)
2000-09-18 16:07:07 +00:00
{
return true;
2000-09-18 16:07:07 +00:00
}
}
}
return false;
2000-09-18 16:07:07 +00:00
}
/*
* Funktion: Liefert den Format- String fuer einen gegebenen
* Eintrag zurueck.
* Input: Nummer des Eintrags
* Output: Format- String
*/
OUString SvxNumberFormatShell::GetFormat4Entry(short nEntry)
2000-09-18 16:07:07 +00:00
{
if(nEntry < 0)
return OUString();
2000-09-18 16:07:07 +00:00
if( !aCurrencyFormatList.empty() )
2000-09-18 16:07:07 +00:00
{
if( aCurrencyFormatList.size() > static_cast<size_t>(nEntry) )
return aCurrencyFormatList[nEntry];
2000-09-18 16:07:07 +00:00
}
else
{
sal_uInt32 nMyNfEntry=aCurEntryList[nEntry];
const SvNumberformat *pNumEntry = pFormatter->GetEntry(nMyNfEntry);
2000-09-18 16:07:07 +00:00
if(pNumEntry!=NULL)
return pNumEntry->GetFormatstring();
}
return OUString();
2000-09-18 16:07:07 +00:00
}
/*
* Funktion: Liefert die Listen- Nummer fuer einen gegebenen
* Formatindex zurueck.
* Input: Nummer des Eintrags
* Output: Kategorie- Nummer
*/
2000-09-18 16:07:07 +00:00
short SvxNumberFormatShell::GetListPos4Entry(sal_uInt32 nIdx)
{
short nSelP=SELPOS_NONE;
// Check list size against return type limit.
if( aCurEntryList.size() <= static_cast<size_t>(::std::numeric_limits< short >::max()) )
2000-09-18 16:07:07 +00:00
{
for(size_t i=0; i < aCurEntryList.size(); ++i)
2000-09-18 16:07:07 +00:00
{
if(aCurEntryList[i]==nIdx)
{
nSelP=i;
break;
}
2000-09-18 16:07:07 +00:00
}
}
else
{
OSL_FAIL("svx::SvxNumberFormatShell::GetListPos4Entry(), list got too large!" );
}
2000-09-18 16:07:07 +00:00
return nSelP;
}
short SvxNumberFormatShell::GetListPos4Entry( const OUString& rFmtString )
2000-09-18 16:07:07 +00:00
{
sal_uInt32 nAt=0;
short nSelP=SELPOS_NONE;
if(FindEntry(rFmtString, &nAt))
{
if(NUMBERFORMAT_ENTRY_NOT_FOUND!=nAt && NUMBERFORMAT_ENTRY_NEW_CURRENCY!=nAt)
{
nSelP=GetListPos4Entry(nAt);
}
else
{
for( size_t i=0; i<aCurrencyFormatList.size(); i++ )
2000-09-18 16:07:07 +00:00
{
if (rFmtString==aCurrencyFormatList[i])
2000-09-18 16:07:07 +00:00
{
nSelP = static_cast<short>(i);
break;
2000-09-18 16:07:07 +00:00
}
}
}
}
return nSelP;
}
OUString SvxNumberFormatShell::GetStandardName() const
{
return pFormatter->GetStandardName( eCurLanguage);
}
void SvxNumberFormatShell::GetCurrencySymbols(std::vector<OUString>& rList, sal_uInt16* pPos)
2000-09-18 16:07:07 +00:00
{
const NfCurrencyEntry* pTmpCurrencyEntry=SvNumberFormatter::MatchSystemCurrency();
2000-09-18 16:07:07 +00:00
bool bFlag=(pTmpCurrencyEntry==NULL);
2000-09-18 16:07:07 +00:00
2012-01-11 10:47:56 -05:00
GetCurrencySymbols(rList, bFlag);
2000-09-18 16:07:07 +00:00
if(pPos!=NULL)
{
const NfCurrencyTable& rCurrencyTable=SvNumberFormatter::GetTheCurrencyTable();
sal_uInt16 nTableCount=rCurrencyTable.size();
2000-09-18 16:07:07 +00:00
*pPos=0;
size_t nCount=aCurCurrencyList.size();
2000-09-18 16:07:07 +00:00
if(bFlag)
{
*pPos=1;
nCurCurrencyEntryPos=1;
}
else
{
for(size_t i=1;i<nCount;i++)
2000-09-18 16:07:07 +00:00
{
CWS-TOOLING: integrate CWS locales32 2009-09-06 19:13:15 +0200 er r275860 : #i104308# Lower and Upper Sorbian 2009-09-03 01:40:09 +0200 erack r275732 : CWS-TOOLING: rebase CWS locales32 to trunk@275331 (milestone: DEV300:m56) 2009-08-17 21:48:26 +0200 erack r275072 : * #i102920# use OUString::iterateCodePoints() in xdictionary; patch from <cmc> * Adapted local iterateCodePoints() in breakiteratorImpl.cxx to cope with surrogates at text end. * Use OUString::iterateCodePoints() in BreakIterator_CJK::getLineBreak() 2009-08-09 23:14:39 +0200 erack r274792 : mergeinfo 2009-08-09 23:09:31 +0200 erack r274791 : re-adding this again, merge from tag didn't work; SVN IS A PIECE OF CRAP 2009-08-09 22:45:02 +0200 erack r274790 : don't re-add file, merge instead 2009-08-09 22:09:49 +0200 erack r274789 : cws rebase ERRONEOUSLY REMOVED THIS FILE! 2009-08-09 22:01:02 +0200 erack r274788 : adapt to new postset.mk completelangiso content; get rid of /i modifier uglyness 2009-08-09 19:40:46 +0200 erack r274787 : #i99823# sort currency list ISO,symbol,language/country; removed unused STR_EUROPE 2009-08-09 01:23:35 +0200 erack r274786 : make AZM currency legacyOnly to avoid duplicate listing in number formatter because of the identical 'man.' currency symbol 2009-08-09 01:11:38 +0200 erack r274785 : #i94445# make ROL currency legacyOnly to avoid duplicate listing in number formatter because of the identical 'lei' currency symbol 2009-08-06 19:10:34 +0200 erack r274743 : CWS-TOOLING: rebase CWS locales32 to trunk@274622 (milestone: DEV300:m54) 2009-08-04 21:26:24 +0200 erack r274634 : #i94445# new currency RON 2009-08-04 21:06:55 +0200 erack r274633 : #i103193# corrected data; from <calibaashi> 2009-07-18 23:56:55 +0200 erack r274104 : #i103408# ignore an empty LANGUAGE variable; patch from <cmc> 2009-07-07 00:21:02 +0200 erack r273764 : Langpack.ulf is gone 2009-07-07 00:02:39 +0200 erack r273763 : #i103358# add 'is' Icelandic 2009-07-04 02:10:55 +0200 erack r273720 : #i101173# typographic quotation marks 2009-07-04 01:07:44 +0200 erack r273719 : #i65127# make it compile with OSL_DEBUG_LEVEL>2 again 2009-06-26 22:50:49 +0200 erack r273444 : #i97602# add Asturian_Spain [ast-ES]; locale data contributed by <astur>/<it46> 2009-06-26 22:01:25 +0200 erack r273443 : #i101173# add Oromo [om-ET] locale data; contributed by <barreessaa> 2009-06-26 21:55:41 +0200 erack r273442 : #i101173# add Oromo [om-ET] locale data; contributed by <barreessaa> 2009-06-26 21:11:46 +0200 erack r273441 : #i102991# linguistic corrections 2009-06-26 21:02:45 +0200 erack r273440 : #i102986# add Somali 'so' 2009-06-22 00:04:35 +0200 erack r273190 : #i101235# add Uyghur_China [ug-CN] locale; contributed by <sahran>/<it46> 2009-06-21 23:35:21 +0200 erack r273189 : blah 2009-06-21 23:22:40 +0200 erack r273188 : #i99972# add Quechua (Ecuador) [qu-EC] 2009-06-21 21:57:29 +0200 erack r273187 : #i97791# add Yiddish [yi-IL] 2009-06-21 21:24:29 +0200 erack r273186 : #i102186# add Greek, Ancient [grc-GR] 2009-06-21 21:00:59 +0200 erack r273185 : #i98489# add Arabic (Oman) [ar-OM] locale data; contributed by <zayed2001>/<it46> 2009-06-21 20:54:07 +0200 erack r273184 : check ListSeparator for ';' semicolon, for consistency 2009-06-21 20:20:13 +0200 erack r273183 : ISO 4217 checks only if not legacy (e.g. Macau Pound 'P') 2009-06-21 20:00:27 +0200 erack r273182 : check CurrencyID and BankSymbol vor ISO 4217 2009-06-21 19:10:36 +0200 erack r273181 : #i73118# Bokmål instead of Bokmal 2009-06-21 19:00:47 +0200 erack r273180 : #i99827# add Sardinian locale data; contributed by <valterubuntu> 2009-06-21 18:20:05 +0200 erack r273179 : give URL of svn instead of legacy cvs 2009-06-21 17:45:31 +0200 erack r273178 : #i87907# add Oromo [om-ET] 2009-06-21 17:23:14 +0200 erack r273177 : grep in completelangiso of postset.mk 2009-03-24 00:22:16 +0100 erack r269901 : #i100368# parentheses, parentheses, parentheses ... 2009-03-23 23:31:22 +0100 erack r269899 : #i99712# call OutlineNumberingLevel_Impl dtor 2009-03-23 22:37:31 +0100 erack r269897 : #i98347# register NumToCharHalfwidth 2009-03-22 18:07:40 +0100 erack r269852 : definitely ignore any output resulting from the cd command in list of rules, which may have lead to a spurious rule file
2009-09-16 14:55:33 +00:00
const sal_uInt16 j = aCurCurrencyList[i];
if (j != (sal_uInt16)-1 && j < nTableCount &&
pTmpCurrencyEntry == &rCurrencyTable[j])
2000-09-18 16:07:07 +00:00
{
*pPos=static_cast<sal_uInt16>(i);
nCurCurrencyEntryPos=static_cast<sal_uInt16>(i);
2000-09-18 16:07:07 +00:00
break;
}
}
}
}
}
void SvxNumberFormatShell::GetCurrencySymbols(std::vector<OUString>& rList, bool bFlag)
2000-09-18 16:07:07 +00:00
{
aCurCurrencyList.clear();
2000-09-18 16:07:07 +00:00
const NfCurrencyTable& rCurrencyTable=SvNumberFormatter::GetTheCurrencyTable();
sal_uInt16 nCount=rCurrencyTable.size();
2000-09-18 16:07:07 +00:00
sal_uInt16 nStart=1;
2000-09-18 16:07:07 +00:00
OUString aString( ApplyLreOrRleEmbedding( rCurrencyTable[0].GetSymbol()));
aString += " ";
aString += ApplyLreOrRleEmbedding( SvtLanguageTable::GetLanguageString( rCurrencyTable[0].GetLanguage()));
2000-09-18 16:07:07 +00:00
2012-01-11 10:47:56 -05:00
rList.push_back(aString);
2000-09-18 16:07:07 +00:00
sal_uInt16 nAuto=(sal_uInt16)-1;
aCurCurrencyList.push_back(nAuto);
2000-09-18 16:07:07 +00:00
if(bFlag)
{
2012-01-11 10:47:56 -05:00
rList.push_back(aString);
aCurCurrencyList.push_back(0);
++nStart;
2000-09-18 16:07:07 +00:00
}
CollatorWrapper aCollator( ::comphelper::getProcessComponentContext());
aCollator.loadDefaultCollator( Application::GetSettings().GetLanguageTag().getLocale(), 0);
2000-09-18 16:07:07 +00:00
const OUString aTwoSpace(" ");
2000-09-18 16:07:07 +00:00
2012-01-11 10:47:56 -05:00
for(sal_uInt16 i = 1; i < nCount; ++i)
CWS-TOOLING: integrate CWS locales32 2009-09-06 19:13:15 +0200 er r275860 : #i104308# Lower and Upper Sorbian 2009-09-03 01:40:09 +0200 erack r275732 : CWS-TOOLING: rebase CWS locales32 to trunk@275331 (milestone: DEV300:m56) 2009-08-17 21:48:26 +0200 erack r275072 : * #i102920# use OUString::iterateCodePoints() in xdictionary; patch from <cmc> * Adapted local iterateCodePoints() in breakiteratorImpl.cxx to cope with surrogates at text end. * Use OUString::iterateCodePoints() in BreakIterator_CJK::getLineBreak() 2009-08-09 23:14:39 +0200 erack r274792 : mergeinfo 2009-08-09 23:09:31 +0200 erack r274791 : re-adding this again, merge from tag didn't work; SVN IS A PIECE OF CRAP 2009-08-09 22:45:02 +0200 erack r274790 : don't re-add file, merge instead 2009-08-09 22:09:49 +0200 erack r274789 : cws rebase ERRONEOUSLY REMOVED THIS FILE! 2009-08-09 22:01:02 +0200 erack r274788 : adapt to new postset.mk completelangiso content; get rid of /i modifier uglyness 2009-08-09 19:40:46 +0200 erack r274787 : #i99823# sort currency list ISO,symbol,language/country; removed unused STR_EUROPE 2009-08-09 01:23:35 +0200 erack r274786 : make AZM currency legacyOnly to avoid duplicate listing in number formatter because of the identical 'man.' currency symbol 2009-08-09 01:11:38 +0200 erack r274785 : #i94445# make ROL currency legacyOnly to avoid duplicate listing in number formatter because of the identical 'lei' currency symbol 2009-08-06 19:10:34 +0200 erack r274743 : CWS-TOOLING: rebase CWS locales32 to trunk@274622 (milestone: DEV300:m54) 2009-08-04 21:26:24 +0200 erack r274634 : #i94445# new currency RON 2009-08-04 21:06:55 +0200 erack r274633 : #i103193# corrected data; from <calibaashi> 2009-07-18 23:56:55 +0200 erack r274104 : #i103408# ignore an empty LANGUAGE variable; patch from <cmc> 2009-07-07 00:21:02 +0200 erack r273764 : Langpack.ulf is gone 2009-07-07 00:02:39 +0200 erack r273763 : #i103358# add 'is' Icelandic 2009-07-04 02:10:55 +0200 erack r273720 : #i101173# typographic quotation marks 2009-07-04 01:07:44 +0200 erack r273719 : #i65127# make it compile with OSL_DEBUG_LEVEL>2 again 2009-06-26 22:50:49 +0200 erack r273444 : #i97602# add Asturian_Spain [ast-ES]; locale data contributed by <astur>/<it46> 2009-06-26 22:01:25 +0200 erack r273443 : #i101173# add Oromo [om-ET] locale data; contributed by <barreessaa> 2009-06-26 21:55:41 +0200 erack r273442 : #i101173# add Oromo [om-ET] locale data; contributed by <barreessaa> 2009-06-26 21:11:46 +0200 erack r273441 : #i102991# linguistic corrections 2009-06-26 21:02:45 +0200 erack r273440 : #i102986# add Somali 'so' 2009-06-22 00:04:35 +0200 erack r273190 : #i101235# add Uyghur_China [ug-CN] locale; contributed by <sahran>/<it46> 2009-06-21 23:35:21 +0200 erack r273189 : blah 2009-06-21 23:22:40 +0200 erack r273188 : #i99972# add Quechua (Ecuador) [qu-EC] 2009-06-21 21:57:29 +0200 erack r273187 : #i97791# add Yiddish [yi-IL] 2009-06-21 21:24:29 +0200 erack r273186 : #i102186# add Greek, Ancient [grc-GR] 2009-06-21 21:00:59 +0200 erack r273185 : #i98489# add Arabic (Oman) [ar-OM] locale data; contributed by <zayed2001>/<it46> 2009-06-21 20:54:07 +0200 erack r273184 : check ListSeparator for ';' semicolon, for consistency 2009-06-21 20:20:13 +0200 erack r273183 : ISO 4217 checks only if not legacy (e.g. Macau Pound 'P') 2009-06-21 20:00:27 +0200 erack r273182 : check CurrencyID and BankSymbol vor ISO 4217 2009-06-21 19:10:36 +0200 erack r273181 : #i73118# Bokmål instead of Bokmal 2009-06-21 19:00:47 +0200 erack r273180 : #i99827# add Sardinian locale data; contributed by <valterubuntu> 2009-06-21 18:20:05 +0200 erack r273179 : give URL of svn instead of legacy cvs 2009-06-21 17:45:31 +0200 erack r273178 : #i87907# add Oromo [om-ET] 2009-06-21 17:23:14 +0200 erack r273177 : grep in completelangiso of postset.mk 2009-03-24 00:22:16 +0100 erack r269901 : #i100368# parentheses, parentheses, parentheses ... 2009-03-23 23:31:22 +0100 erack r269899 : #i99712# call OutlineNumberingLevel_Impl dtor 2009-03-23 22:37:31 +0100 erack r269897 : #i98347# register NumToCharHalfwidth 2009-03-22 18:07:40 +0100 erack r269852 : definitely ignore any output resulting from the cd command in list of rules, which may have lead to a spurious rule file
2009-09-16 14:55:33 +00:00
{
OUString aStr( ApplyLreOrRleEmbedding( rCurrencyTable[i].GetBankSymbol()));
CWS-TOOLING: integrate CWS locales32 2009-09-06 19:13:15 +0200 er r275860 : #i104308# Lower and Upper Sorbian 2009-09-03 01:40:09 +0200 erack r275732 : CWS-TOOLING: rebase CWS locales32 to trunk@275331 (milestone: DEV300:m56) 2009-08-17 21:48:26 +0200 erack r275072 : * #i102920# use OUString::iterateCodePoints() in xdictionary; patch from <cmc> * Adapted local iterateCodePoints() in breakiteratorImpl.cxx to cope with surrogates at text end. * Use OUString::iterateCodePoints() in BreakIterator_CJK::getLineBreak() 2009-08-09 23:14:39 +0200 erack r274792 : mergeinfo 2009-08-09 23:09:31 +0200 erack r274791 : re-adding this again, merge from tag didn't work; SVN IS A PIECE OF CRAP 2009-08-09 22:45:02 +0200 erack r274790 : don't re-add file, merge instead 2009-08-09 22:09:49 +0200 erack r274789 : cws rebase ERRONEOUSLY REMOVED THIS FILE! 2009-08-09 22:01:02 +0200 erack r274788 : adapt to new postset.mk completelangiso content; get rid of /i modifier uglyness 2009-08-09 19:40:46 +0200 erack r274787 : #i99823# sort currency list ISO,symbol,language/country; removed unused STR_EUROPE 2009-08-09 01:23:35 +0200 erack r274786 : make AZM currency legacyOnly to avoid duplicate listing in number formatter because of the identical 'man.' currency symbol 2009-08-09 01:11:38 +0200 erack r274785 : #i94445# make ROL currency legacyOnly to avoid duplicate listing in number formatter because of the identical 'lei' currency symbol 2009-08-06 19:10:34 +0200 erack r274743 : CWS-TOOLING: rebase CWS locales32 to trunk@274622 (milestone: DEV300:m54) 2009-08-04 21:26:24 +0200 erack r274634 : #i94445# new currency RON 2009-08-04 21:06:55 +0200 erack r274633 : #i103193# corrected data; from <calibaashi> 2009-07-18 23:56:55 +0200 erack r274104 : #i103408# ignore an empty LANGUAGE variable; patch from <cmc> 2009-07-07 00:21:02 +0200 erack r273764 : Langpack.ulf is gone 2009-07-07 00:02:39 +0200 erack r273763 : #i103358# add 'is' Icelandic 2009-07-04 02:10:55 +0200 erack r273720 : #i101173# typographic quotation marks 2009-07-04 01:07:44 +0200 erack r273719 : #i65127# make it compile with OSL_DEBUG_LEVEL>2 again 2009-06-26 22:50:49 +0200 erack r273444 : #i97602# add Asturian_Spain [ast-ES]; locale data contributed by <astur>/<it46> 2009-06-26 22:01:25 +0200 erack r273443 : #i101173# add Oromo [om-ET] locale data; contributed by <barreessaa> 2009-06-26 21:55:41 +0200 erack r273442 : #i101173# add Oromo [om-ET] locale data; contributed by <barreessaa> 2009-06-26 21:11:46 +0200 erack r273441 : #i102991# linguistic corrections 2009-06-26 21:02:45 +0200 erack r273440 : #i102986# add Somali 'so' 2009-06-22 00:04:35 +0200 erack r273190 : #i101235# add Uyghur_China [ug-CN] locale; contributed by <sahran>/<it46> 2009-06-21 23:35:21 +0200 erack r273189 : blah 2009-06-21 23:22:40 +0200 erack r273188 : #i99972# add Quechua (Ecuador) [qu-EC] 2009-06-21 21:57:29 +0200 erack r273187 : #i97791# add Yiddish [yi-IL] 2009-06-21 21:24:29 +0200 erack r273186 : #i102186# add Greek, Ancient [grc-GR] 2009-06-21 21:00:59 +0200 erack r273185 : #i98489# add Arabic (Oman) [ar-OM] locale data; contributed by <zayed2001>/<it46> 2009-06-21 20:54:07 +0200 erack r273184 : check ListSeparator for ';' semicolon, for consistency 2009-06-21 20:20:13 +0200 erack r273183 : ISO 4217 checks only if not legacy (e.g. Macau Pound 'P') 2009-06-21 20:00:27 +0200 erack r273182 : check CurrencyID and BankSymbol vor ISO 4217 2009-06-21 19:10:36 +0200 erack r273181 : #i73118# Bokmål instead of Bokmal 2009-06-21 19:00:47 +0200 erack r273180 : #i99827# add Sardinian locale data; contributed by <valterubuntu> 2009-06-21 18:20:05 +0200 erack r273179 : give URL of svn instead of legacy cvs 2009-06-21 17:45:31 +0200 erack r273178 : #i87907# add Oromo [om-ET] 2009-06-21 17:23:14 +0200 erack r273177 : grep in completelangiso of postset.mk 2009-03-24 00:22:16 +0100 erack r269901 : #i100368# parentheses, parentheses, parentheses ... 2009-03-23 23:31:22 +0100 erack r269899 : #i99712# call OutlineNumberingLevel_Impl dtor 2009-03-23 22:37:31 +0100 erack r269897 : #i98347# register NumToCharHalfwidth 2009-03-22 18:07:40 +0100 erack r269852 : definitely ignore any output resulting from the cd command in list of rules, which may have lead to a spurious rule file
2009-09-16 14:55:33 +00:00
aStr += aTwoSpace;
aStr += ApplyLreOrRleEmbedding( rCurrencyTable[i].GetSymbol());
CWS-TOOLING: integrate CWS locales32 2009-09-06 19:13:15 +0200 er r275860 : #i104308# Lower and Upper Sorbian 2009-09-03 01:40:09 +0200 erack r275732 : CWS-TOOLING: rebase CWS locales32 to trunk@275331 (milestone: DEV300:m56) 2009-08-17 21:48:26 +0200 erack r275072 : * #i102920# use OUString::iterateCodePoints() in xdictionary; patch from <cmc> * Adapted local iterateCodePoints() in breakiteratorImpl.cxx to cope with surrogates at text end. * Use OUString::iterateCodePoints() in BreakIterator_CJK::getLineBreak() 2009-08-09 23:14:39 +0200 erack r274792 : mergeinfo 2009-08-09 23:09:31 +0200 erack r274791 : re-adding this again, merge from tag didn't work; SVN IS A PIECE OF CRAP 2009-08-09 22:45:02 +0200 erack r274790 : don't re-add file, merge instead 2009-08-09 22:09:49 +0200 erack r274789 : cws rebase ERRONEOUSLY REMOVED THIS FILE! 2009-08-09 22:01:02 +0200 erack r274788 : adapt to new postset.mk completelangiso content; get rid of /i modifier uglyness 2009-08-09 19:40:46 +0200 erack r274787 : #i99823# sort currency list ISO,symbol,language/country; removed unused STR_EUROPE 2009-08-09 01:23:35 +0200 erack r274786 : make AZM currency legacyOnly to avoid duplicate listing in number formatter because of the identical 'man.' currency symbol 2009-08-09 01:11:38 +0200 erack r274785 : #i94445# make ROL currency legacyOnly to avoid duplicate listing in number formatter because of the identical 'lei' currency symbol 2009-08-06 19:10:34 +0200 erack r274743 : CWS-TOOLING: rebase CWS locales32 to trunk@274622 (milestone: DEV300:m54) 2009-08-04 21:26:24 +0200 erack r274634 : #i94445# new currency RON 2009-08-04 21:06:55 +0200 erack r274633 : #i103193# corrected data; from <calibaashi> 2009-07-18 23:56:55 +0200 erack r274104 : #i103408# ignore an empty LANGUAGE variable; patch from <cmc> 2009-07-07 00:21:02 +0200 erack r273764 : Langpack.ulf is gone 2009-07-07 00:02:39 +0200 erack r273763 : #i103358# add 'is' Icelandic 2009-07-04 02:10:55 +0200 erack r273720 : #i101173# typographic quotation marks 2009-07-04 01:07:44 +0200 erack r273719 : #i65127# make it compile with OSL_DEBUG_LEVEL>2 again 2009-06-26 22:50:49 +0200 erack r273444 : #i97602# add Asturian_Spain [ast-ES]; locale data contributed by <astur>/<it46> 2009-06-26 22:01:25 +0200 erack r273443 : #i101173# add Oromo [om-ET] locale data; contributed by <barreessaa> 2009-06-26 21:55:41 +0200 erack r273442 : #i101173# add Oromo [om-ET] locale data; contributed by <barreessaa> 2009-06-26 21:11:46 +0200 erack r273441 : #i102991# linguistic corrections 2009-06-26 21:02:45 +0200 erack r273440 : #i102986# add Somali 'so' 2009-06-22 00:04:35 +0200 erack r273190 : #i101235# add Uyghur_China [ug-CN] locale; contributed by <sahran>/<it46> 2009-06-21 23:35:21 +0200 erack r273189 : blah 2009-06-21 23:22:40 +0200 erack r273188 : #i99972# add Quechua (Ecuador) [qu-EC] 2009-06-21 21:57:29 +0200 erack r273187 : #i97791# add Yiddish [yi-IL] 2009-06-21 21:24:29 +0200 erack r273186 : #i102186# add Greek, Ancient [grc-GR] 2009-06-21 21:00:59 +0200 erack r273185 : #i98489# add Arabic (Oman) [ar-OM] locale data; contributed by <zayed2001>/<it46> 2009-06-21 20:54:07 +0200 erack r273184 : check ListSeparator for ';' semicolon, for consistency 2009-06-21 20:20:13 +0200 erack r273183 : ISO 4217 checks only if not legacy (e.g. Macau Pound 'P') 2009-06-21 20:00:27 +0200 erack r273182 : check CurrencyID and BankSymbol vor ISO 4217 2009-06-21 19:10:36 +0200 erack r273181 : #i73118# Bokmål instead of Bokmal 2009-06-21 19:00:47 +0200 erack r273180 : #i99827# add Sardinian locale data; contributed by <valterubuntu> 2009-06-21 18:20:05 +0200 erack r273179 : give URL of svn instead of legacy cvs 2009-06-21 17:45:31 +0200 erack r273178 : #i87907# add Oromo [om-ET] 2009-06-21 17:23:14 +0200 erack r273177 : grep in completelangiso of postset.mk 2009-03-24 00:22:16 +0100 erack r269901 : #i100368# parentheses, parentheses, parentheses ... 2009-03-23 23:31:22 +0100 erack r269899 : #i99712# call OutlineNumberingLevel_Impl dtor 2009-03-23 22:37:31 +0100 erack r269897 : #i98347# register NumToCharHalfwidth 2009-03-22 18:07:40 +0100 erack r269852 : definitely ignore any output resulting from the cd command in list of rules, which may have lead to a spurious rule file
2009-09-16 14:55:33 +00:00
aStr += aTwoSpace;
aStr += ApplyLreOrRleEmbedding( SvtLanguageTable::GetLanguageString( rCurrencyTable[i].GetLanguage()));
CWS-TOOLING: integrate CWS locales32 2009-09-06 19:13:15 +0200 er r275860 : #i104308# Lower and Upper Sorbian 2009-09-03 01:40:09 +0200 erack r275732 : CWS-TOOLING: rebase CWS locales32 to trunk@275331 (milestone: DEV300:m56) 2009-08-17 21:48:26 +0200 erack r275072 : * #i102920# use OUString::iterateCodePoints() in xdictionary; patch from <cmc> * Adapted local iterateCodePoints() in breakiteratorImpl.cxx to cope with surrogates at text end. * Use OUString::iterateCodePoints() in BreakIterator_CJK::getLineBreak() 2009-08-09 23:14:39 +0200 erack r274792 : mergeinfo 2009-08-09 23:09:31 +0200 erack r274791 : re-adding this again, merge from tag didn't work; SVN IS A PIECE OF CRAP 2009-08-09 22:45:02 +0200 erack r274790 : don't re-add file, merge instead 2009-08-09 22:09:49 +0200 erack r274789 : cws rebase ERRONEOUSLY REMOVED THIS FILE! 2009-08-09 22:01:02 +0200 erack r274788 : adapt to new postset.mk completelangiso content; get rid of /i modifier uglyness 2009-08-09 19:40:46 +0200 erack r274787 : #i99823# sort currency list ISO,symbol,language/country; removed unused STR_EUROPE 2009-08-09 01:23:35 +0200 erack r274786 : make AZM currency legacyOnly to avoid duplicate listing in number formatter because of the identical 'man.' currency symbol 2009-08-09 01:11:38 +0200 erack r274785 : #i94445# make ROL currency legacyOnly to avoid duplicate listing in number formatter because of the identical 'lei' currency symbol 2009-08-06 19:10:34 +0200 erack r274743 : CWS-TOOLING: rebase CWS locales32 to trunk@274622 (milestone: DEV300:m54) 2009-08-04 21:26:24 +0200 erack r274634 : #i94445# new currency RON 2009-08-04 21:06:55 +0200 erack r274633 : #i103193# corrected data; from <calibaashi> 2009-07-18 23:56:55 +0200 erack r274104 : #i103408# ignore an empty LANGUAGE variable; patch from <cmc> 2009-07-07 00:21:02 +0200 erack r273764 : Langpack.ulf is gone 2009-07-07 00:02:39 +0200 erack r273763 : #i103358# add 'is' Icelandic 2009-07-04 02:10:55 +0200 erack r273720 : #i101173# typographic quotation marks 2009-07-04 01:07:44 +0200 erack r273719 : #i65127# make it compile with OSL_DEBUG_LEVEL>2 again 2009-06-26 22:50:49 +0200 erack r273444 : #i97602# add Asturian_Spain [ast-ES]; locale data contributed by <astur>/<it46> 2009-06-26 22:01:25 +0200 erack r273443 : #i101173# add Oromo [om-ET] locale data; contributed by <barreessaa> 2009-06-26 21:55:41 +0200 erack r273442 : #i101173# add Oromo [om-ET] locale data; contributed by <barreessaa> 2009-06-26 21:11:46 +0200 erack r273441 : #i102991# linguistic corrections 2009-06-26 21:02:45 +0200 erack r273440 : #i102986# add Somali 'so' 2009-06-22 00:04:35 +0200 erack r273190 : #i101235# add Uyghur_China [ug-CN] locale; contributed by <sahran>/<it46> 2009-06-21 23:35:21 +0200 erack r273189 : blah 2009-06-21 23:22:40 +0200 erack r273188 : #i99972# add Quechua (Ecuador) [qu-EC] 2009-06-21 21:57:29 +0200 erack r273187 : #i97791# add Yiddish [yi-IL] 2009-06-21 21:24:29 +0200 erack r273186 : #i102186# add Greek, Ancient [grc-GR] 2009-06-21 21:00:59 +0200 erack r273185 : #i98489# add Arabic (Oman) [ar-OM] locale data; contributed by <zayed2001>/<it46> 2009-06-21 20:54:07 +0200 erack r273184 : check ListSeparator for ';' semicolon, for consistency 2009-06-21 20:20:13 +0200 erack r273183 : ISO 4217 checks only if not legacy (e.g. Macau Pound 'P') 2009-06-21 20:00:27 +0200 erack r273182 : check CurrencyID and BankSymbol vor ISO 4217 2009-06-21 19:10:36 +0200 erack r273181 : #i73118# Bokmål instead of Bokmal 2009-06-21 19:00:47 +0200 erack r273180 : #i99827# add Sardinian locale data; contributed by <valterubuntu> 2009-06-21 18:20:05 +0200 erack r273179 : give URL of svn instead of legacy cvs 2009-06-21 17:45:31 +0200 erack r273178 : #i87907# add Oromo [om-ET] 2009-06-21 17:23:14 +0200 erack r273177 : grep in completelangiso of postset.mk 2009-03-24 00:22:16 +0100 erack r269901 : #i100368# parentheses, parentheses, parentheses ... 2009-03-23 23:31:22 +0100 erack r269899 : #i99712# call OutlineNumberingLevel_Impl dtor 2009-03-23 22:37:31 +0100 erack r269897 : #i98347# register NumToCharHalfwidth 2009-03-22 18:07:40 +0100 erack r269852 : definitely ignore any output resulting from the cd command in list of rules, which may have lead to a spurious rule file
2009-09-16 14:55:33 +00:00
2012-01-11 10:47:56 -05:00
sal_uInt16 j = nStart;
for(; j < rList.size(); ++j)
if (aCollator.compareString(aStr, rList[j]) < 0)
CWS-TOOLING: integrate CWS locales32 2009-09-06 19:13:15 +0200 er r275860 : #i104308# Lower and Upper Sorbian 2009-09-03 01:40:09 +0200 erack r275732 : CWS-TOOLING: rebase CWS locales32 to trunk@275331 (milestone: DEV300:m56) 2009-08-17 21:48:26 +0200 erack r275072 : * #i102920# use OUString::iterateCodePoints() in xdictionary; patch from <cmc> * Adapted local iterateCodePoints() in breakiteratorImpl.cxx to cope with surrogates at text end. * Use OUString::iterateCodePoints() in BreakIterator_CJK::getLineBreak() 2009-08-09 23:14:39 +0200 erack r274792 : mergeinfo 2009-08-09 23:09:31 +0200 erack r274791 : re-adding this again, merge from tag didn't work; SVN IS A PIECE OF CRAP 2009-08-09 22:45:02 +0200 erack r274790 : don't re-add file, merge instead 2009-08-09 22:09:49 +0200 erack r274789 : cws rebase ERRONEOUSLY REMOVED THIS FILE! 2009-08-09 22:01:02 +0200 erack r274788 : adapt to new postset.mk completelangiso content; get rid of /i modifier uglyness 2009-08-09 19:40:46 +0200 erack r274787 : #i99823# sort currency list ISO,symbol,language/country; removed unused STR_EUROPE 2009-08-09 01:23:35 +0200 erack r274786 : make AZM currency legacyOnly to avoid duplicate listing in number formatter because of the identical 'man.' currency symbol 2009-08-09 01:11:38 +0200 erack r274785 : #i94445# make ROL currency legacyOnly to avoid duplicate listing in number formatter because of the identical 'lei' currency symbol 2009-08-06 19:10:34 +0200 erack r274743 : CWS-TOOLING: rebase CWS locales32 to trunk@274622 (milestone: DEV300:m54) 2009-08-04 21:26:24 +0200 erack r274634 : #i94445# new currency RON 2009-08-04 21:06:55 +0200 erack r274633 : #i103193# corrected data; from <calibaashi> 2009-07-18 23:56:55 +0200 erack r274104 : #i103408# ignore an empty LANGUAGE variable; patch from <cmc> 2009-07-07 00:21:02 +0200 erack r273764 : Langpack.ulf is gone 2009-07-07 00:02:39 +0200 erack r273763 : #i103358# add 'is' Icelandic 2009-07-04 02:10:55 +0200 erack r273720 : #i101173# typographic quotation marks 2009-07-04 01:07:44 +0200 erack r273719 : #i65127# make it compile with OSL_DEBUG_LEVEL>2 again 2009-06-26 22:50:49 +0200 erack r273444 : #i97602# add Asturian_Spain [ast-ES]; locale data contributed by <astur>/<it46> 2009-06-26 22:01:25 +0200 erack r273443 : #i101173# add Oromo [om-ET] locale data; contributed by <barreessaa> 2009-06-26 21:55:41 +0200 erack r273442 : #i101173# add Oromo [om-ET] locale data; contributed by <barreessaa> 2009-06-26 21:11:46 +0200 erack r273441 : #i102991# linguistic corrections 2009-06-26 21:02:45 +0200 erack r273440 : #i102986# add Somali 'so' 2009-06-22 00:04:35 +0200 erack r273190 : #i101235# add Uyghur_China [ug-CN] locale; contributed by <sahran>/<it46> 2009-06-21 23:35:21 +0200 erack r273189 : blah 2009-06-21 23:22:40 +0200 erack r273188 : #i99972# add Quechua (Ecuador) [qu-EC] 2009-06-21 21:57:29 +0200 erack r273187 : #i97791# add Yiddish [yi-IL] 2009-06-21 21:24:29 +0200 erack r273186 : #i102186# add Greek, Ancient [grc-GR] 2009-06-21 21:00:59 +0200 erack r273185 : #i98489# add Arabic (Oman) [ar-OM] locale data; contributed by <zayed2001>/<it46> 2009-06-21 20:54:07 +0200 erack r273184 : check ListSeparator for ';' semicolon, for consistency 2009-06-21 20:20:13 +0200 erack r273183 : ISO 4217 checks only if not legacy (e.g. Macau Pound 'P') 2009-06-21 20:00:27 +0200 erack r273182 : check CurrencyID and BankSymbol vor ISO 4217 2009-06-21 19:10:36 +0200 erack r273181 : #i73118# Bokmål instead of Bokmal 2009-06-21 19:00:47 +0200 erack r273180 : #i99827# add Sardinian locale data; contributed by <valterubuntu> 2009-06-21 18:20:05 +0200 erack r273179 : give URL of svn instead of legacy cvs 2009-06-21 17:45:31 +0200 erack r273178 : #i87907# add Oromo [om-ET] 2009-06-21 17:23:14 +0200 erack r273177 : grep in completelangiso of postset.mk 2009-03-24 00:22:16 +0100 erack r269901 : #i100368# parentheses, parentheses, parentheses ... 2009-03-23 23:31:22 +0100 erack r269899 : #i99712# call OutlineNumberingLevel_Impl dtor 2009-03-23 22:37:31 +0100 erack r269897 : #i98347# register NumToCharHalfwidth 2009-03-22 18:07:40 +0100 erack r269852 : definitely ignore any output resulting from the cd command in list of rules, which may have lead to a spurious rule file
2009-09-16 14:55:33 +00:00
break; // insert before first greater than
2012-01-11 10:47:56 -05:00
rList.insert(rList.begin() + j, aStr);
aCurCurrencyList.insert(aCurCurrencyList.begin() + j, i);
2000-09-18 16:07:07 +00:00
}
CWS-TOOLING: integrate CWS locales32 2009-09-06 19:13:15 +0200 er r275860 : #i104308# Lower and Upper Sorbian 2009-09-03 01:40:09 +0200 erack r275732 : CWS-TOOLING: rebase CWS locales32 to trunk@275331 (milestone: DEV300:m56) 2009-08-17 21:48:26 +0200 erack r275072 : * #i102920# use OUString::iterateCodePoints() in xdictionary; patch from <cmc> * Adapted local iterateCodePoints() in breakiteratorImpl.cxx to cope with surrogates at text end. * Use OUString::iterateCodePoints() in BreakIterator_CJK::getLineBreak() 2009-08-09 23:14:39 +0200 erack r274792 : mergeinfo 2009-08-09 23:09:31 +0200 erack r274791 : re-adding this again, merge from tag didn't work; SVN IS A PIECE OF CRAP 2009-08-09 22:45:02 +0200 erack r274790 : don't re-add file, merge instead 2009-08-09 22:09:49 +0200 erack r274789 : cws rebase ERRONEOUSLY REMOVED THIS FILE! 2009-08-09 22:01:02 +0200 erack r274788 : adapt to new postset.mk completelangiso content; get rid of /i modifier uglyness 2009-08-09 19:40:46 +0200 erack r274787 : #i99823# sort currency list ISO,symbol,language/country; removed unused STR_EUROPE 2009-08-09 01:23:35 +0200 erack r274786 : make AZM currency legacyOnly to avoid duplicate listing in number formatter because of the identical 'man.' currency symbol 2009-08-09 01:11:38 +0200 erack r274785 : #i94445# make ROL currency legacyOnly to avoid duplicate listing in number formatter because of the identical 'lei' currency symbol 2009-08-06 19:10:34 +0200 erack r274743 : CWS-TOOLING: rebase CWS locales32 to trunk@274622 (milestone: DEV300:m54) 2009-08-04 21:26:24 +0200 erack r274634 : #i94445# new currency RON 2009-08-04 21:06:55 +0200 erack r274633 : #i103193# corrected data; from <calibaashi> 2009-07-18 23:56:55 +0200 erack r274104 : #i103408# ignore an empty LANGUAGE variable; patch from <cmc> 2009-07-07 00:21:02 +0200 erack r273764 : Langpack.ulf is gone 2009-07-07 00:02:39 +0200 erack r273763 : #i103358# add 'is' Icelandic 2009-07-04 02:10:55 +0200 erack r273720 : #i101173# typographic quotation marks 2009-07-04 01:07:44 +0200 erack r273719 : #i65127# make it compile with OSL_DEBUG_LEVEL>2 again 2009-06-26 22:50:49 +0200 erack r273444 : #i97602# add Asturian_Spain [ast-ES]; locale data contributed by <astur>/<it46> 2009-06-26 22:01:25 +0200 erack r273443 : #i101173# add Oromo [om-ET] locale data; contributed by <barreessaa> 2009-06-26 21:55:41 +0200 erack r273442 : #i101173# add Oromo [om-ET] locale data; contributed by <barreessaa> 2009-06-26 21:11:46 +0200 erack r273441 : #i102991# linguistic corrections 2009-06-26 21:02:45 +0200 erack r273440 : #i102986# add Somali 'so' 2009-06-22 00:04:35 +0200 erack r273190 : #i101235# add Uyghur_China [ug-CN] locale; contributed by <sahran>/<it46> 2009-06-21 23:35:21 +0200 erack r273189 : blah 2009-06-21 23:22:40 +0200 erack r273188 : #i99972# add Quechua (Ecuador) [qu-EC] 2009-06-21 21:57:29 +0200 erack r273187 : #i97791# add Yiddish [yi-IL] 2009-06-21 21:24:29 +0200 erack r273186 : #i102186# add Greek, Ancient [grc-GR] 2009-06-21 21:00:59 +0200 erack r273185 : #i98489# add Arabic (Oman) [ar-OM] locale data; contributed by <zayed2001>/<it46> 2009-06-21 20:54:07 +0200 erack r273184 : check ListSeparator for ';' semicolon, for consistency 2009-06-21 20:20:13 +0200 erack r273183 : ISO 4217 checks only if not legacy (e.g. Macau Pound 'P') 2009-06-21 20:00:27 +0200 erack r273182 : check CurrencyID and BankSymbol vor ISO 4217 2009-06-21 19:10:36 +0200 erack r273181 : #i73118# Bokmål instead of Bokmal 2009-06-21 19:00:47 +0200 erack r273180 : #i99827# add Sardinian locale data; contributed by <valterubuntu> 2009-06-21 18:20:05 +0200 erack r273179 : give URL of svn instead of legacy cvs 2009-06-21 17:45:31 +0200 erack r273178 : #i87907# add Oromo [om-ET] 2009-06-21 17:23:14 +0200 erack r273177 : grep in completelangiso of postset.mk 2009-03-24 00:22:16 +0100 erack r269901 : #i100368# parentheses, parentheses, parentheses ... 2009-03-23 23:31:22 +0100 erack r269899 : #i99712# call OutlineNumberingLevel_Impl dtor 2009-03-23 22:37:31 +0100 erack r269897 : #i98347# register NumToCharHalfwidth 2009-03-22 18:07:40 +0100 erack r269852 : definitely ignore any output resulting from the cd command in list of rules, which may have lead to a spurious rule file
2009-09-16 14:55:33 +00:00
// Append ISO codes to symbol list.
// XXX If this is to be changed, various other places would had to be
// adapted that assume this order!
2012-01-11 10:47:56 -05:00
sal_uInt16 nCont = rList.size();
2000-09-18 16:07:07 +00:00
2012-01-11 10:47:56 -05:00
for(sal_uInt16 i = 1; i < nCount; ++i)
2000-09-18 16:07:07 +00:00
{
CWS-TOOLING: integrate CWS locales32 2009-09-06 19:13:15 +0200 er r275860 : #i104308# Lower and Upper Sorbian 2009-09-03 01:40:09 +0200 erack r275732 : CWS-TOOLING: rebase CWS locales32 to trunk@275331 (milestone: DEV300:m56) 2009-08-17 21:48:26 +0200 erack r275072 : * #i102920# use OUString::iterateCodePoints() in xdictionary; patch from <cmc> * Adapted local iterateCodePoints() in breakiteratorImpl.cxx to cope with surrogates at text end. * Use OUString::iterateCodePoints() in BreakIterator_CJK::getLineBreak() 2009-08-09 23:14:39 +0200 erack r274792 : mergeinfo 2009-08-09 23:09:31 +0200 erack r274791 : re-adding this again, merge from tag didn't work; SVN IS A PIECE OF CRAP 2009-08-09 22:45:02 +0200 erack r274790 : don't re-add file, merge instead 2009-08-09 22:09:49 +0200 erack r274789 : cws rebase ERRONEOUSLY REMOVED THIS FILE! 2009-08-09 22:01:02 +0200 erack r274788 : adapt to new postset.mk completelangiso content; get rid of /i modifier uglyness 2009-08-09 19:40:46 +0200 erack r274787 : #i99823# sort currency list ISO,symbol,language/country; removed unused STR_EUROPE 2009-08-09 01:23:35 +0200 erack r274786 : make AZM currency legacyOnly to avoid duplicate listing in number formatter because of the identical 'man.' currency symbol 2009-08-09 01:11:38 +0200 erack r274785 : #i94445# make ROL currency legacyOnly to avoid duplicate listing in number formatter because of the identical 'lei' currency symbol 2009-08-06 19:10:34 +0200 erack r274743 : CWS-TOOLING: rebase CWS locales32 to trunk@274622 (milestone: DEV300:m54) 2009-08-04 21:26:24 +0200 erack r274634 : #i94445# new currency RON 2009-08-04 21:06:55 +0200 erack r274633 : #i103193# corrected data; from <calibaashi> 2009-07-18 23:56:55 +0200 erack r274104 : #i103408# ignore an empty LANGUAGE variable; patch from <cmc> 2009-07-07 00:21:02 +0200 erack r273764 : Langpack.ulf is gone 2009-07-07 00:02:39 +0200 erack r273763 : #i103358# add 'is' Icelandic 2009-07-04 02:10:55 +0200 erack r273720 : #i101173# typographic quotation marks 2009-07-04 01:07:44 +0200 erack r273719 : #i65127# make it compile with OSL_DEBUG_LEVEL>2 again 2009-06-26 22:50:49 +0200 erack r273444 : #i97602# add Asturian_Spain [ast-ES]; locale data contributed by <astur>/<it46> 2009-06-26 22:01:25 +0200 erack r273443 : #i101173# add Oromo [om-ET] locale data; contributed by <barreessaa> 2009-06-26 21:55:41 +0200 erack r273442 : #i101173# add Oromo [om-ET] locale data; contributed by <barreessaa> 2009-06-26 21:11:46 +0200 erack r273441 : #i102991# linguistic corrections 2009-06-26 21:02:45 +0200 erack r273440 : #i102986# add Somali 'so' 2009-06-22 00:04:35 +0200 erack r273190 : #i101235# add Uyghur_China [ug-CN] locale; contributed by <sahran>/<it46> 2009-06-21 23:35:21 +0200 erack r273189 : blah 2009-06-21 23:22:40 +0200 erack r273188 : #i99972# add Quechua (Ecuador) [qu-EC] 2009-06-21 21:57:29 +0200 erack r273187 : #i97791# add Yiddish [yi-IL] 2009-06-21 21:24:29 +0200 erack r273186 : #i102186# add Greek, Ancient [grc-GR] 2009-06-21 21:00:59 +0200 erack r273185 : #i98489# add Arabic (Oman) [ar-OM] locale data; contributed by <zayed2001>/<it46> 2009-06-21 20:54:07 +0200 erack r273184 : check ListSeparator for ';' semicolon, for consistency 2009-06-21 20:20:13 +0200 erack r273183 : ISO 4217 checks only if not legacy (e.g. Macau Pound 'P') 2009-06-21 20:00:27 +0200 erack r273182 : check CurrencyID and BankSymbol vor ISO 4217 2009-06-21 19:10:36 +0200 erack r273181 : #i73118# Bokmål instead of Bokmal 2009-06-21 19:00:47 +0200 erack r273180 : #i99827# add Sardinian locale data; contributed by <valterubuntu> 2009-06-21 18:20:05 +0200 erack r273179 : give URL of svn instead of legacy cvs 2009-06-21 17:45:31 +0200 erack r273178 : #i87907# add Oromo [om-ET] 2009-06-21 17:23:14 +0200 erack r273177 : grep in completelangiso of postset.mk 2009-03-24 00:22:16 +0100 erack r269901 : #i100368# parentheses, parentheses, parentheses ... 2009-03-23 23:31:22 +0100 erack r269899 : #i99712# call OutlineNumberingLevel_Impl dtor 2009-03-23 22:37:31 +0100 erack r269897 : #i98347# register NumToCharHalfwidth 2009-03-22 18:07:40 +0100 erack r269852 : definitely ignore any output resulting from the cd command in list of rules, which may have lead to a spurious rule file
2009-09-16 14:55:33 +00:00
bool bInsert = true;
OUString aStr(ApplyLreOrRleEmbedding(rCurrencyTable[i].GetBankSymbol()));
2000-09-18 16:07:07 +00:00
2012-01-11 10:47:56 -05:00
sal_uInt16 j = nCont;
for(; j < rList.size() && bInsert; ++j)
2000-09-18 16:07:07 +00:00
{
2012-01-11 10:47:56 -05:00
if(rList[j] == aStr)
CWS-TOOLING: integrate CWS locales32 2009-09-06 19:13:15 +0200 er r275860 : #i104308# Lower and Upper Sorbian 2009-09-03 01:40:09 +0200 erack r275732 : CWS-TOOLING: rebase CWS locales32 to trunk@275331 (milestone: DEV300:m56) 2009-08-17 21:48:26 +0200 erack r275072 : * #i102920# use OUString::iterateCodePoints() in xdictionary; patch from <cmc> * Adapted local iterateCodePoints() in breakiteratorImpl.cxx to cope with surrogates at text end. * Use OUString::iterateCodePoints() in BreakIterator_CJK::getLineBreak() 2009-08-09 23:14:39 +0200 erack r274792 : mergeinfo 2009-08-09 23:09:31 +0200 erack r274791 : re-adding this again, merge from tag didn't work; SVN IS A PIECE OF CRAP 2009-08-09 22:45:02 +0200 erack r274790 : don't re-add file, merge instead 2009-08-09 22:09:49 +0200 erack r274789 : cws rebase ERRONEOUSLY REMOVED THIS FILE! 2009-08-09 22:01:02 +0200 erack r274788 : adapt to new postset.mk completelangiso content; get rid of /i modifier uglyness 2009-08-09 19:40:46 +0200 erack r274787 : #i99823# sort currency list ISO,symbol,language/country; removed unused STR_EUROPE 2009-08-09 01:23:35 +0200 erack r274786 : make AZM currency legacyOnly to avoid duplicate listing in number formatter because of the identical 'man.' currency symbol 2009-08-09 01:11:38 +0200 erack r274785 : #i94445# make ROL currency legacyOnly to avoid duplicate listing in number formatter because of the identical 'lei' currency symbol 2009-08-06 19:10:34 +0200 erack r274743 : CWS-TOOLING: rebase CWS locales32 to trunk@274622 (milestone: DEV300:m54) 2009-08-04 21:26:24 +0200 erack r274634 : #i94445# new currency RON 2009-08-04 21:06:55 +0200 erack r274633 : #i103193# corrected data; from <calibaashi> 2009-07-18 23:56:55 +0200 erack r274104 : #i103408# ignore an empty LANGUAGE variable; patch from <cmc> 2009-07-07 00:21:02 +0200 erack r273764 : Langpack.ulf is gone 2009-07-07 00:02:39 +0200 erack r273763 : #i103358# add 'is' Icelandic 2009-07-04 02:10:55 +0200 erack r273720 : #i101173# typographic quotation marks 2009-07-04 01:07:44 +0200 erack r273719 : #i65127# make it compile with OSL_DEBUG_LEVEL>2 again 2009-06-26 22:50:49 +0200 erack r273444 : #i97602# add Asturian_Spain [ast-ES]; locale data contributed by <astur>/<it46> 2009-06-26 22:01:25 +0200 erack r273443 : #i101173# add Oromo [om-ET] locale data; contributed by <barreessaa> 2009-06-26 21:55:41 +0200 erack r273442 : #i101173# add Oromo [om-ET] locale data; contributed by <barreessaa> 2009-06-26 21:11:46 +0200 erack r273441 : #i102991# linguistic corrections 2009-06-26 21:02:45 +0200 erack r273440 : #i102986# add Somali 'so' 2009-06-22 00:04:35 +0200 erack r273190 : #i101235# add Uyghur_China [ug-CN] locale; contributed by <sahran>/<it46> 2009-06-21 23:35:21 +0200 erack r273189 : blah 2009-06-21 23:22:40 +0200 erack r273188 : #i99972# add Quechua (Ecuador) [qu-EC] 2009-06-21 21:57:29 +0200 erack r273187 : #i97791# add Yiddish [yi-IL] 2009-06-21 21:24:29 +0200 erack r273186 : #i102186# add Greek, Ancient [grc-GR] 2009-06-21 21:00:59 +0200 erack r273185 : #i98489# add Arabic (Oman) [ar-OM] locale data; contributed by <zayed2001>/<it46> 2009-06-21 20:54:07 +0200 erack r273184 : check ListSeparator for ';' semicolon, for consistency 2009-06-21 20:20:13 +0200 erack r273183 : ISO 4217 checks only if not legacy (e.g. Macau Pound 'P') 2009-06-21 20:00:27 +0200 erack r273182 : check CurrencyID and BankSymbol vor ISO 4217 2009-06-21 19:10:36 +0200 erack r273181 : #i73118# Bokmål instead of Bokmal 2009-06-21 19:00:47 +0200 erack r273180 : #i99827# add Sardinian locale data; contributed by <valterubuntu> 2009-06-21 18:20:05 +0200 erack r273179 : give URL of svn instead of legacy cvs 2009-06-21 17:45:31 +0200 erack r273178 : #i87907# add Oromo [om-ET] 2009-06-21 17:23:14 +0200 erack r273177 : grep in completelangiso of postset.mk 2009-03-24 00:22:16 +0100 erack r269901 : #i100368# parentheses, parentheses, parentheses ... 2009-03-23 23:31:22 +0100 erack r269899 : #i99712# call OutlineNumberingLevel_Impl dtor 2009-03-23 22:37:31 +0100 erack r269897 : #i98347# register NumToCharHalfwidth 2009-03-22 18:07:40 +0100 erack r269852 : definitely ignore any output resulting from the cd command in list of rules, which may have lead to a spurious rule file
2009-09-16 14:55:33 +00:00
bInsert = false;
2012-01-11 10:47:56 -05:00
else if (aCollator.compareString(aStr, rList[j]) < 0)
break; // insert before first greater than
2000-09-18 16:07:07 +00:00
}
CWS-TOOLING: integrate CWS locales32 2009-09-06 19:13:15 +0200 er r275860 : #i104308# Lower and Upper Sorbian 2009-09-03 01:40:09 +0200 erack r275732 : CWS-TOOLING: rebase CWS locales32 to trunk@275331 (milestone: DEV300:m56) 2009-08-17 21:48:26 +0200 erack r275072 : * #i102920# use OUString::iterateCodePoints() in xdictionary; patch from <cmc> * Adapted local iterateCodePoints() in breakiteratorImpl.cxx to cope with surrogates at text end. * Use OUString::iterateCodePoints() in BreakIterator_CJK::getLineBreak() 2009-08-09 23:14:39 +0200 erack r274792 : mergeinfo 2009-08-09 23:09:31 +0200 erack r274791 : re-adding this again, merge from tag didn't work; SVN IS A PIECE OF CRAP 2009-08-09 22:45:02 +0200 erack r274790 : don't re-add file, merge instead 2009-08-09 22:09:49 +0200 erack r274789 : cws rebase ERRONEOUSLY REMOVED THIS FILE! 2009-08-09 22:01:02 +0200 erack r274788 : adapt to new postset.mk completelangiso content; get rid of /i modifier uglyness 2009-08-09 19:40:46 +0200 erack r274787 : #i99823# sort currency list ISO,symbol,language/country; removed unused STR_EUROPE 2009-08-09 01:23:35 +0200 erack r274786 : make AZM currency legacyOnly to avoid duplicate listing in number formatter because of the identical 'man.' currency symbol 2009-08-09 01:11:38 +0200 erack r274785 : #i94445# make ROL currency legacyOnly to avoid duplicate listing in number formatter because of the identical 'lei' currency symbol 2009-08-06 19:10:34 +0200 erack r274743 : CWS-TOOLING: rebase CWS locales32 to trunk@274622 (milestone: DEV300:m54) 2009-08-04 21:26:24 +0200 erack r274634 : #i94445# new currency RON 2009-08-04 21:06:55 +0200 erack r274633 : #i103193# corrected data; from <calibaashi> 2009-07-18 23:56:55 +0200 erack r274104 : #i103408# ignore an empty LANGUAGE variable; patch from <cmc> 2009-07-07 00:21:02 +0200 erack r273764 : Langpack.ulf is gone 2009-07-07 00:02:39 +0200 erack r273763 : #i103358# add 'is' Icelandic 2009-07-04 02:10:55 +0200 erack r273720 : #i101173# typographic quotation marks 2009-07-04 01:07:44 +0200 erack r273719 : #i65127# make it compile with OSL_DEBUG_LEVEL>2 again 2009-06-26 22:50:49 +0200 erack r273444 : #i97602# add Asturian_Spain [ast-ES]; locale data contributed by <astur>/<it46> 2009-06-26 22:01:25 +0200 erack r273443 : #i101173# add Oromo [om-ET] locale data; contributed by <barreessaa> 2009-06-26 21:55:41 +0200 erack r273442 : #i101173# add Oromo [om-ET] locale data; contributed by <barreessaa> 2009-06-26 21:11:46 +0200 erack r273441 : #i102991# linguistic corrections 2009-06-26 21:02:45 +0200 erack r273440 : #i102986# add Somali 'so' 2009-06-22 00:04:35 +0200 erack r273190 : #i101235# add Uyghur_China [ug-CN] locale; contributed by <sahran>/<it46> 2009-06-21 23:35:21 +0200 erack r273189 : blah 2009-06-21 23:22:40 +0200 erack r273188 : #i99972# add Quechua (Ecuador) [qu-EC] 2009-06-21 21:57:29 +0200 erack r273187 : #i97791# add Yiddish [yi-IL] 2009-06-21 21:24:29 +0200 erack r273186 : #i102186# add Greek, Ancient [grc-GR] 2009-06-21 21:00:59 +0200 erack r273185 : #i98489# add Arabic (Oman) [ar-OM] locale data; contributed by <zayed2001>/<it46> 2009-06-21 20:54:07 +0200 erack r273184 : check ListSeparator for ';' semicolon, for consistency 2009-06-21 20:20:13 +0200 erack r273183 : ISO 4217 checks only if not legacy (e.g. Macau Pound 'P') 2009-06-21 20:00:27 +0200 erack r273182 : check CurrencyID and BankSymbol vor ISO 4217 2009-06-21 19:10:36 +0200 erack r273181 : #i73118# Bokmål instead of Bokmal 2009-06-21 19:00:47 +0200 erack r273180 : #i99827# add Sardinian locale data; contributed by <valterubuntu> 2009-06-21 18:20:05 +0200 erack r273179 : give URL of svn instead of legacy cvs 2009-06-21 17:45:31 +0200 erack r273178 : #i87907# add Oromo [om-ET] 2009-06-21 17:23:14 +0200 erack r273177 : grep in completelangiso of postset.mk 2009-03-24 00:22:16 +0100 erack r269901 : #i100368# parentheses, parentheses, parentheses ... 2009-03-23 23:31:22 +0100 erack r269899 : #i99712# call OutlineNumberingLevel_Impl dtor 2009-03-23 22:37:31 +0100 erack r269897 : #i98347# register NumToCharHalfwidth 2009-03-22 18:07:40 +0100 erack r269852 : definitely ignore any output resulting from the cd command in list of rules, which may have lead to a spurious rule file
2009-09-16 14:55:33 +00:00
if(bInsert)
2000-09-18 16:07:07 +00:00
{
2012-01-11 10:47:56 -05:00
rList.insert(rList.begin() + j, aStr);
aCurCurrencyList.insert(aCurCurrencyList.begin()+j, i);
2000-09-18 16:07:07 +00:00
}
}
}
void SvxNumberFormatShell::SetCurrencySymbol(sal_uInt32 nPos)
2000-09-18 16:07:07 +00:00
{
const NfCurrencyTable& rCurrencyTable=SvNumberFormatter::GetTheCurrencyTable();
sal_uInt16 nCount=rCurrencyTable.size();
2000-09-18 16:07:07 +00:00
bBankingSymbol=(nPos>=nCount);
if(nPos<aCurCurrencyList.size())
2000-09-18 16:07:07 +00:00
{
sal_uInt16 nCurrencyPos=aCurCurrencyList[nPos];
if(nCurrencyPos!=(sal_uInt16)-1)
{
pCurCurrencyEntry=const_cast<NfCurrencyEntry*>(&rCurrencyTable[nCurrencyPos]);
2000-09-18 16:07:07 +00:00
nCurCurrencyEntryPos=nPos;
}
else
{
pCurCurrencyEntry=NULL;
nCurCurrencyEntryPos=0;
nCurFormatKey=pFormatter->GetFormatIndex(
NF_CURRENCY_1000DEC2_RED, eCurLanguage);
}
}
}
void SvxNumberFormatShell::SetCurCurrencyEntry(NfCurrencyEntry* pCEntry)
{
pCurCurrencyEntry=pCEntry;
}
bool SvxNumberFormatShell::IsTmpCurrencyFormat( const OUString& rFmtString )
2000-09-18 16:07:07 +00:00
{
sal_uInt32 nFound;
FindEntry(rFmtString, &nFound);
2000-09-18 16:07:07 +00:00
if(nFound==NUMBERFORMAT_ENTRY_NEW_CURRENCY)
{
return true;
2000-09-18 16:07:07 +00:00
}
return false;
2000-09-18 16:07:07 +00:00
}
sal_uInt16 SvxNumberFormatShell::FindCurrencyFormat( const OUString& rFmtString )
2000-09-18 16:07:07 +00:00
{
const NfCurrencyTable& rCurrencyTable=SvNumberFormatter::GetTheCurrencyTable();
sal_uInt16 nCount=rCurrencyTable.size();
2000-09-18 16:07:07 +00:00
bool bTestBanking=false;
2000-09-18 16:07:07 +00:00
sal_uInt16 nPos=FindCurrencyTableEntry(rFmtString, bTestBanking);
if(nPos!=(sal_uInt16)-1)
{
2010-12-29 09:52:22 +01:00
sal_uInt16 nStart=0;
if(bTestBanking && aCurCurrencyList.size()>nPos)
2000-09-18 16:07:07 +00:00
{
nStart=nCount;
}
for(size_t j=nStart;j<aCurCurrencyList.size();j++)
2000-09-18 16:07:07 +00:00
{
if(aCurCurrencyList[j]==nPos) return j;
}
}
return (sal_uInt16) -1;
}
sal_uInt16 SvxNumberFormatShell::FindCurrencyTableEntry( const OUString& rFmtString, bool &bTestBanking )
2000-09-18 16:07:07 +00:00
{
sal_uInt16 nPos=(sal_uInt16) -1;
const NfCurrencyTable& rCurrencyTable=SvNumberFormatter::GetTheCurrencyTable();
sal_uInt16 nCount=rCurrencyTable.size();
2000-09-18 16:07:07 +00:00
const SvNumberformat* pFormat;
OUString aSymbol, aExtension;
sal_uInt32 nFound = pFormatter->TestNewString( rFmtString, eCurLanguage );
if ( nFound != NUMBERFORMAT_ENTRY_NOT_FOUND &&
((pFormat = pFormatter->GetEntry( nFound )) != 0) &&
pFormat->GetNewCurrencySymbol( aSymbol, aExtension ) )
{ // eventually match with format locale
const NfCurrencyEntry* pTmpCurrencyEntry =
SvNumberFormatter::GetCurrencyEntry( bTestBanking, aSymbol, aExtension,
pFormat->GetLanguage() );
if ( pTmpCurrencyEntry )
2000-09-18 16:07:07 +00:00
{
for(sal_uInt16 i=0;i<nCount;i++)
{
if(pTmpCurrencyEntry==&rCurrencyTable[i])
{
nPos=i;
break;
}
}
2000-09-18 16:07:07 +00:00
}
}
else
{ // search symbol string only
for(sal_uInt16 i=0;i<nCount;i++)
2000-09-18 16:07:07 +00:00
{
const NfCurrencyEntry* pTmpCurrencyEntry=&rCurrencyTable[i];
OUString _aSymbol = pTmpCurrencyEntry->BuildSymbolString(false);
OUString aBankSymbol = pTmpCurrencyEntry->BuildSymbolString(true);
if(rFmtString.indexOf(_aSymbol) != -1)
{
bTestBanking=false;
nPos=i;
break;
}
else if(rFmtString.indexOf(aBankSymbol) != -1)
{
bTestBanking=true;
nPos=i;
break;
}
2000-09-18 16:07:07 +00:00
}
}
return nPos;
}
sal_uInt16 SvxNumberFormatShell::FindCurrencyFormat(const NfCurrencyEntry* pTmpCurrencyEntry,bool bTmpBanking)
2000-09-18 16:07:07 +00:00
{
const NfCurrencyTable& rCurrencyTable=SvNumberFormatter::GetTheCurrencyTable();
sal_uInt16 nCount=rCurrencyTable.size();
2000-09-18 16:07:07 +00:00
sal_uInt16 nPos=0;
for(sal_uInt16 i=0;i<nCount;i++)
{
if(pTmpCurrencyEntry==&rCurrencyTable[i])
2000-09-18 16:07:07 +00:00
{
nPos=i;
break;
}
}
sal_uInt16 nStart=0;
if(bTmpBanking && aCurCurrencyList.size()>nPos)
2000-09-18 16:07:07 +00:00
{
nStart=nCount;
}
for(size_t j=nStart;j<aCurCurrencyList.size();j++)
2000-09-18 16:07:07 +00:00
{
if(aCurCurrencyList[j]==nPos) return j;
}
return (sal_uInt16) -1;
}
bool SvxNumberFormatShell::IsInTable(sal_uInt16 const nPos,
bool const bTmpBanking, OUString const& rFmtString)
2000-09-18 16:07:07 +00:00
{
bool bFlag=false;
2000-09-18 16:07:07 +00:00
if(nPos!=(sal_uInt16)-1)
{
const NfCurrencyTable& rCurrencyTable=SvNumberFormatter::GetTheCurrencyTable();
sal_uInt16 nCount=rCurrencyTable.size();
2000-09-18 16:07:07 +00:00
if(nPos<nCount)
{
NfWSStringsDtor aWSStringsDtor;
const NfCurrencyEntry* pTmpCurrencyEntry=&rCurrencyTable[nPos];
2000-09-18 16:07:07 +00:00
if ( pTmpCurrencyEntry!=NULL)
{
2011-02-14 09:09:58 +00:00
pFormatter->GetCurrencyFormatStrings( aWSStringsDtor,
2000-09-18 16:07:07 +00:00
*pTmpCurrencyEntry, bTmpBanking );
for(size_t i=0;i<aWSStringsDtor.size();i++)
2000-09-18 16:07:07 +00:00
{
if (aWSStringsDtor[i] == rFmtString)
2000-09-18 16:07:07 +00:00
{
bFlag=true;
2000-09-18 16:07:07 +00:00
break;
}
}
}
}
}
return bFlag;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */