summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2011-05-27 20:47:31 +0200
committerJan Holesovsky <kendy@suse.cz>2011-05-27 20:47:31 +0200
commit9e5584a82633442467a53ccc08c3380070178a38 (patch)
tree03ecad6d69523ff70217dd583ac757500135697d /svl
parent9d4ec37cb09142515a5bc1fdc06beee1f8b0642a (diff)
parent73b79fe869dee44b26d79d9e448fa95544a375e7 (diff)
Merge remote-tracking branch 'origin/integration/dev300_m106'
Conflicts: cppcanvas/source/mtfrenderer/implrenderer.cxx i18npool/inc/i18npool/lang.h i18npool/source/isolang/isolang.cxx svtools/source/filter/exportdialog.cxx svtools/source/graphic/grfmgr.cxx vcl/aqua/source/dtrans/aqua_service.cxx vcl/aqua/source/window/salframe.cxx vcl/inc/sft.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/cursor.hxx vcl/inc/vcl/gdimtf.hxx vcl/inc/vcl/settings.hxx vcl/prj/d.lst vcl/source/app/settings.cxx vcl/source/control/edit.cxx vcl/source/gdi/gdimtf.cxx vcl/source/window/cursor.cxx vcl/source/window/window.cxx vcl/unx/generic/fontmanager/fontconfig.cxx vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx vcl/unx/kde4/KDESalGraphics.cxx
Diffstat (limited to 'svl')
-rw-r--r--svl/inc/svl/nfkeytab.hxx14
-rw-r--r--svl/inc/svl/undo.hxx1
-rw-r--r--svl/source/items/cenumitm.cxx4
-rw-r--r--svl/source/items/visitem.cxx4
-rw-r--r--svl/source/numbers/zforlist.cxx14
-rw-r--r--svl/source/numbers/zformat.cxx20
-rw-r--r--svl/source/numbers/zforscan.cxx26
-rw-r--r--svl/source/numbers/zforscan.hxx2
8 files changed, 49 insertions, 36 deletions
diff --git a/svl/inc/svl/nfkeytab.hxx b/svl/inc/svl/nfkeytab.hxx
index 68acf61ebb1f..4fe3fd2e2df6 100644
--- a/svl/inc/svl/nfkeytab.hxx
+++ b/svl/inc/svl/nfkeytab.hxx
@@ -29,6 +29,7 @@
#ifndef INCLUDED_SVTOOLS_NFKEYTAB_HXX
#define INCLUDED_SVTOOLS_NFKEYTAB_HXX
+#include <vector>
#include <tools/string.hxx>
//! For ImpSvNumberformatScan: first the short symbols, then the long symbols!
@@ -112,7 +113,18 @@ enum NfKeywordIndex
NF_KEYWORD_ENTRIES_COUNT
};
-typedef String NfKeywordTable [NF_KEYWORD_ENTRIES_COUNT];
+class NfKeywordTable
+{
+ typedef ::std::vector<String> Keywords_t;
+ Keywords_t m_keywords;
+
+public:
+ NfKeywordTable() : m_keywords(NF_KEYWORD_ENTRIES_COUNT) {};
+ virtual ~NfKeywordTable() {}
+
+ String & operator[] (Keywords_t::size_type n) { return m_keywords[n]; }
+ const String & operator[] (Keywords_t::size_type n) const { return m_keywords[n]; }
+};
#endif // INCLUDED_SVTOOLS_NFKEYTAB_HXX
diff --git a/svl/inc/svl/undo.hxx b/svl/inc/svl/undo.hxx
index e3f964864eb8..4e18504fbfc7 100644
--- a/svl/inc/svl/undo.hxx
+++ b/svl/inc/svl/undo.hxx
@@ -36,6 +36,7 @@
#include <boost/scoped_ptr.hpp>
#include <vector>
+#include <limits>
//====================================================================
diff --git a/svl/source/items/cenumitm.cxx b/svl/source/items/cenumitm.cxx
index 1c302f962431..03f3ae784da9 100644
--- a/svl/source/items/cenumitm.cxx
+++ b/svl/source/items/cenumitm.cxx
@@ -287,8 +287,8 @@ UniString CntBoolItem::GetValueTextByVal(sal_Bool bTheValue) const
{
return
bTheValue ?
- UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("sal_True")) :
- UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("sal_False"));
+ UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("TRUE")) :
+ UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("FALSE"));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/items/visitem.cxx b/svl/source/items/visitem.cxx
index 13f19a48800e..599709d70938 100644
--- a/svl/source/items/visitem.cxx
+++ b/svl/source/items/visitem.cxx
@@ -141,8 +141,8 @@ UniString SfxVisibilityItem::GetValueTextByVal(sal_Bool bTheValue) const
{
return
bTheValue ?
- UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("sal_True")) :
- UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("sal_False"));
+ UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("TRUE")) :
+ UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("FALSE"));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index c95f212ba976..b4611b79babf 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -951,10 +951,10 @@ void SvNumberFormatter::FillKeywordTable( NfKeywordTable& rKeywords,
LanguageType eLang )
{
ChangeIntl( eLang );
- const String* pTable = pFormatScanner->GetKeywords();
+ const NfKeywordTable & rTable = pFormatScanner->GetKeywords();
for ( sal_uInt16 i = 0; i < NF_KEYWORD_ENTRIES_COUNT; ++i )
{
- rKeywords[i] = pTable[i];
+ rKeywords[i] = rTable[i];
}
}
@@ -962,9 +962,9 @@ void SvNumberFormatter::FillKeywordTable( NfKeywordTable& rKeywords,
String SvNumberFormatter::GetKeyword( LanguageType eLnge, sal_uInt16 nIndex )
{
ChangeIntl(eLnge);
- const String* pTable = pFormatScanner->GetKeywords();
- if ( pTable && nIndex < NF_KEYWORD_ENTRIES_COUNT )
- return pTable[nIndex];
+ const NfKeywordTable & rTable = pFormatScanner->GetKeywords();
+ if ( nIndex < NF_KEYWORD_ENTRIES_COUNT )
+ return rTable[nIndex];
OSL_FAIL("GetKeyword: invalid index");
return String();
@@ -2613,8 +2613,8 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, sal_Bool bLoadi
CLOffset + SetIndexTable( NF_FRACTION_4, ZF_STANDARD_FRACTION+3 ));
// Week of year must be appended here because of nNewExtended
- const String* pKeyword = pFormatScanner->GetKeywords();
- aSingleFormatCode.Code = pKeyword[NF_KEY_WW];
+ const NfKeywordTable & rKeyword = pFormatScanner->GetKeywords();
+ aSingleFormatCode.Code = rKeyword[NF_KEY_WW];
ImpInsertNewStandardFormat( aSingleFormatCode,
CLOffset + SetIndexTable( NF_DATE_WW, nNewExtended++ ),
SV_NUMBERFORMATTER_VERSION_NF_DATE_WW );
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 421cc8769f16..990b7e261172 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -1219,7 +1219,7 @@ short SvNumberformat::ImpNextSymbol(String& rString,
xub_StrLen nLen = rString.Len();
ScanState eState = SsStart;
sSymbol.Erase();
- const String* pKeywords = rScan.GetKeywords();
+ const NfKeywordTable & rKeywords = rScan.GetKeywords();
while (nPos < nLen && eState != SsStop)
{
cToken = rString.GetChar(nPos);
@@ -1347,9 +1347,9 @@ short SvNumberformat::ImpNextSymbol(String& rString,
BRACKET_SYMBOLTYPE_DBNUM1 - (cDBNum - '1'));
eState = SsGetPrefix;
}
- else if (cUpper == pKeywords[NF_KEY_H].GetChar(0) || // H
- cUpper == pKeywords[NF_KEY_MI].GetChar(0) || // M
- cUpper == pKeywords[NF_KEY_S].GetChar(0) ) // S
+ else if (cUpper == rKeywords[NF_KEY_H].GetChar(0) || // H
+ cUpper == rKeywords[NF_KEY_MI].GetChar(0) || // M
+ cUpper == rKeywords[NF_KEY_S].GetChar(0) ) // S
{
sSymbol += cToken;
eState = SsGetTime;
@@ -1386,9 +1386,9 @@ short SvNumberformat::ImpNextSymbol(String& rString,
else
{
sal_Unicode cUpper = rChrCls().toUpper( rString, nPos-1, 1 ).GetChar(0);
- if (cUpper == pKeywords[NF_KEY_H].GetChar(0) || // H
- cUpper == pKeywords[NF_KEY_MI].GetChar(0) || // M
- cUpper == pKeywords[NF_KEY_S].GetChar(0) ) // S
+ if (cUpper == rKeywords[NF_KEY_H].GetChar(0) || // H
+ cUpper == rKeywords[NF_KEY_MI].GetChar(0) || // M
+ cUpper == rKeywords[NF_KEY_S].GetChar(0) ) // S
{
if (cLetter == cToken)
{
@@ -4345,10 +4345,10 @@ String SvNumberformat::GetMappedFormatstring(
const String& rColorName = NumFor[n].GetColorName();
if ( rColorName.Len() )
{
- const String* pKey = rScan.GetKeywords() + NF_KEY_FIRSTCOLOR;
- for ( int j=NF_KEY_FIRSTCOLOR; j<=NF_KEY_LASTCOLOR; j++, pKey++ )
+ const NfKeywordTable & rKey = rScan.GetKeywords();
+ for ( int j=NF_KEY_FIRSTCOLOR; j<=NF_KEY_LASTCOLOR; j++ )
{
- if ( *pKey == rColorName )
+ if ( rKey[j] == rColorName )
{
aPrefix += '[';
aPrefix += rKeywords[j];
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index 46f5951de7bd..9eee6a55c823 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -143,7 +143,7 @@ void ImpSvNumberformatScan::InitSpecialKeyword( NfKeywordIndex eIdx ) const
if ( !sKeyword[NF_KEY_TRUE].Len() )
{
DBG_ERRORFILE( "InitSpecialKeyword: TRUE_WORD?" );
- ((ImpSvNumberformatScan*)this)->sKeyword[NF_KEY_TRUE].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "sal_True" ) );
+ ((ImpSvNumberformatScan*)this)->sKeyword[NF_KEY_TRUE].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "TRUE" ) );
}
break;
case NF_KEY_FALSE :
@@ -153,7 +153,7 @@ void ImpSvNumberformatScan::InitSpecialKeyword( NfKeywordIndex eIdx ) const
if ( !sKeyword[NF_KEY_FALSE].Len() )
{
DBG_ERRORFILE( "InitSpecialKeyword: FALSE_WORD?" );
- ((ImpSvNumberformatScan*)this)->sKeyword[NF_KEY_FALSE].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "sal_False" ) );
+ ((ImpSvNumberformatScan*)this)->sKeyword[NF_KEY_FALSE].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "FALSE" ) );
}
break;
default:
@@ -465,10 +465,10 @@ void ImpSvNumberformatScan::ChangeStandardPrec(sal_uInt16 nPrec)
Color* ImpSvNumberformatScan::GetColor(String& sStr)
{
String sString = pFormatter->GetCharClass()->upper(sStr);
- const String* pKeyword = GetKeywords();
+ const NfKeywordTable & rKeyword = GetKeywords();
size_t i = 0;
while (i < NF_MAX_DEFAULT_COLORS &&
- sString != pKeyword[NF_KEY_FIRSTCOLOR+i] )
+ sString != rKeyword[NF_KEY_FIRSTCOLOR+i] )
i++;
if ( i >= NF_MAX_DEFAULT_COLORS )
{
@@ -484,7 +484,7 @@ Color* ImpSvNumberformatScan::GetColor(String& sStr)
Color* pResult = NULL;
if (i >= NF_MAX_DEFAULT_COLORS)
{
- const String& rColorWord = pKeyword[NF_KEY_COLOR];
+ const String& rColorWord = rKeyword[NF_KEY_COLOR];
xub_StrLen nPos = sString.Match(rColorWord);
if (nPos > 0)
{
@@ -521,7 +521,7 @@ Color* ImpSvNumberformatScan::GetColor(String& sStr)
pFormatter->ChangeIntl(eTmpLnge);
}
else
- sStr = pKeyword[NF_KEY_FIRSTCOLOR+i];
+ sStr = rKeyword[NF_KEY_FIRSTCOLOR+i];
pResult = &(StandardColor[i]);
}
@@ -531,16 +531,16 @@ Color* ImpSvNumberformatScan::GetColor(String& sStr)
short ImpSvNumberformatScan::GetKeyWord( const String& sSymbol, xub_StrLen nPos )
{
String sString = pFormatter->GetCharClass()->toUpper( sSymbol, nPos, sSymbol.Len() - nPos );
- const String* pKeyword = GetKeywords();
+ const NfKeywordTable & rKeyword = GetKeywords();
// #77026# for the Xcl perverts: the GENERAL keyword is recognized anywhere
- if ( sString.Search( pKeyword[NF_KEY_GENERAL] ) == 0 )
+ if ( sString.Search( rKeyword[NF_KEY_GENERAL] ) == 0 )
return NF_KEY_GENERAL;
//! MUST be a reverse search to find longer strings first
short i = NF_KEYWORD_ENTRIES_COUNT-1;
sal_Bool bFound = sal_False;
for ( ; i > NF_KEY_LASTKEYWORD_SO5; --i )
{
- bFound = sString.Search(pKeyword[i]) == 0;
+ bFound = sString.Search(rKeyword[i]) == 0;
if ( bFound )
{
break;
@@ -550,15 +550,15 @@ short ImpSvNumberformatScan::GetKeyWord( const String& sSymbol, xub_StrLen nPos
if ( !bFound )
{ // skip the gap of colors et al between new and old keywords and search on
i = NF_KEY_LASTKEYWORD;
- while ( i > 0 && sString.Search(pKeyword[i]) != 0 )
+ while ( i > 0 && sString.Search(rKeyword[i]) != 0 )
i--;
- if ( i > NF_KEY_LASTOLDKEYWORD && sString != pKeyword[i] )
+ if ( i > NF_KEY_LASTOLDKEYWORD && sString != rKeyword[i] )
{ // found something, but maybe it's something else?
// e.g. new NNN is found in NNNN, for NNNN we must search on
short j = i - 1;
- while ( j > 0 && sString.Search(pKeyword[j]) != 0 )
+ while ( j > 0 && sString.Search(rKeyword[j]) != 0 )
j--;
- if ( j && pKeyword[j].Len() > pKeyword[i].Len() )
+ if ( j && rKeyword[j].Len() > rKeyword[i].Len() )
return j;
}
}
diff --git a/svl/source/numbers/zforscan.hxx b/svl/source/numbers/zforscan.hxx
index 6ea2055efe59..3aa279c3ee46 100644
--- a/svl/source/numbers/zforscan.hxx
+++ b/svl/source/numbers/zforscan.hxx
@@ -67,7 +67,7 @@ public:
const LocaleDataWrapper& GetLoc() const { return *pFormatter->GetLocaleData(); }
CalendarWrapper& GetCal() const { return *pFormatter->GetCalendar(); }
- const String* GetKeywords() const
+ const NfKeywordTable & GetKeywords() const
{
if ( bKeywordsNeedInit )
InitKeywords();