ooo-build r12264 - in trunk: . patches/dev300



Author: kyoshida
Date: Mon Apr 21 21:57:08 2008
New Revision: 12264
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12264&view=rev

Log:
2008-04-21  Kohei Yoshida  <kyoshida novell com>

	* patches/dev300/sc-formula-syntax-core.diff: patch extracted from 
	koheiformula01 cws that forms the core of variable formula syntax mode
	in Calc.  This implementation is slightly different from my 2.4 
	implementation (hence a new patch).
	
	* patches/dev300/apply: apply the new patch.


Added:
   trunk/patches/dev300/sc-formula-syntax-core.diff
Modified:
   trunk/ChangeLog
   trunk/patches/dev300/apply

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Mon Apr 21 21:57:08 2008
@@ -1558,6 +1558,7 @@
 # configuration option in the Options page.
 # The patch depends on the cws-xmlfilter03 stuff
 #FIXME dev300: sc-formula-syntax.diff, n#358558, kohei
+sc-formula-syntax-core.diff, n#358558, kohei
 
 # fix the cell range reference window so that it draws current selection
 # for XL_A1 and XL_R1C1.  This is part of the formula syntax support.

Added: trunk/patches/dev300/sc-formula-syntax-core.diff
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/sc-formula-syntax-core.diff	Mon Apr 21 21:57:08 2008
@@ -0,0 +1,3282 @@
+Index: sc/inc/compiler.hxx
+===================================================================
+RCS file: /cvs/sc/sc/inc/compiler.hxx,v
+retrieving revision 1.35
+retrieving revision 1.35.12.3
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.35 -r1.35.12.3
+--- sc/inc/compiler.hxx	6 Mar 2008 15:15:10 -0000	1.35
++++ sc/inc/compiler.hxx	19 Mar 2008 17:37:07 -0000	1.35.12.3
+@@ -478,11 +478,11 @@
+ 
+ public:
+     ScCompiler( ScDocument* pDocument, const ScAddress&,
+-                const ScGrammar::Grammar eGrammar = ScGrammar::GRAM_DEFAULT );
++                const ScGrammar::Grammar eGrammar );
+ 
+     ScCompiler( ScDocument* pDocument, const ScAddress&,
+                 ScTokenArray& rArr,
+-                const ScGrammar::Grammar eGrammar = ScGrammar::GRAM_DEFAULT );
++                const ScGrammar::Grammar eGrammar );
+ 
+     static bool IsInitialized()
+     {
+Index: sc/inc/document.hxx
+===================================================================
+RCS file: /cvs/sc/sc/inc/document.hxx,v
+retrieving revision 1.109
+retrieving revision 1.109.12.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.109 -r1.109.12.1
+--- sc/inc/document.hxx	6 Mar 2008 15:16:12 -0000	1.109
++++ sc/inc/document.hxx	19 Mar 2008 17:37:07 -0000	1.109.12.1
+@@ -431,7 +431,7 @@
+ 
+ 	BOOL				bInUnoBroadcast;
+ 	BOOL				bInUnoListenerCall;
+-	ScAddress::Convention eAddrConv;
++    ScGrammar::Grammar  eGrammar;
+ 
+     mutable BOOL        bStyleSheetUsageInvalid;
+ 
+@@ -625,7 +625,8 @@
+ 	BOOL			IsActiveScenario( SCTAB nTab ) const;
+ 	void			SetActiveScenario( SCTAB nTab, BOOL bActive );		// nur fuer Undo etc.
+ 	SC_DLLPUBLIC ScAddress::Convention GetAddressConvention() const;
+-	void	 	    SetAddressConvention( ScAddress::Convention eConv );
++    SC_DLLPUBLIC ScGrammar::Grammar GetGrammar() const;
++    void            SetGrammar( ScGrammar::Grammar eGram );
+ 	BYTE			GetLinkMode( SCTAB nTab ) const;
+ 	BOOL			IsLinked( SCTAB nTab ) const;
+ 	const String&	GetLinkDoc( SCTAB nTab ) const;
+Index: sc/inc/funcdesc.hxx
+===================================================================
+RCS file: /cvs/sc/sc/inc/funcdesc.hxx,v
+retrieving revision 1.2
+retrieving revision 1.2.12.2
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.2 -r1.2.12.2
+Index: sc/source/core/data/cell.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/core/data/cell.cxx,v
+retrieving revision 1.41
+retrieving revision 1.41.12.2
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.41 -r1.41.12.2
+--- sc/source/core/data/cell.cxx	6 Mar 2008 15:23:29 -0000	1.41
++++ sc/source/core/data/cell.cxx	20 Mar 2008 23:19:42 -0000	1.41.12.2
+@@ -922,7 +922,7 @@
+ 
+ 		if( !bNoListening && pCode->GetCodeLen() )
+ 			EndListeningTo( pDocument );
+-		ScCompiler aComp(pDocument, aPos, *pCode );
++		ScCompiler aComp(pDocument, aPos, *pCode, pDocument->GetGrammar());
+ 		bSubTotal = aComp.CompileTokenArray();
+ 		if( !pCode->GetCodeError() )
+ 		{
+@@ -1009,7 +1009,7 @@
+ 	// wurde, da die RangeNames erst jetzt existieren.
+ 	if( pCode->GetLen() && !pCode->GetCodeLen() && !pCode->GetCodeError() )
+ 	{
+-		ScCompiler aComp(pDocument, aPos, *pCode);
++		ScCompiler aComp(pDocument, aPos, *pCode, pDocument->GetGrammar());
+ 		bSubTotal = aComp.CompileTokenArray();
+ 		nFormatType = aComp.GetNumFormatType();
+ 		nFormatIndex = 0;
+@@ -1100,7 +1100,8 @@
+                     aDebugVec.push_back( aR);
+                 }
+                 String aStr;
+-                pCell->aPos.Format( aStr, SCA_VALID | SCA_TAB_3D, pCell->GetDocument());
++                pCell->aPos.Format( aStr, SCA_VALID | SCA_TAB_3D, pCell->GetDocument(), 
++                                    pCell->GetDocument()->GetAddressConvention() );
+                 ByteString aB( aStr, RTL_TEXTENCODING_UTF8);
+                 aDebugVec.push_back( aB);
+             }
+Index: sc/source/core/data/cell2.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/core/data/cell2.cxx,v
+retrieving revision 1.32
+retrieving revision 1.32.12.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.32 -r1.32.12.1
+--- sc/source/core/data/cell2.cxx	6 Mar 2008 15:23:55 -0000	1.32
++++ sc/source/core/data/cell2.cxx	19 Mar 2008 17:37:09 -0000	1.32.12.1
+@@ -633,7 +633,7 @@
+         BOOL bRefSizeChanged;
+         if ( bHasRefs )
+         {
+-            ScCompiler aComp(pDocument, aPos, *pCode);
++            ScCompiler aComp(pDocument, aPos, *pCode, pDocument->GetGrammar());
+             pRangeData = aComp.UpdateReference(eUpdateRefMode, aOldPos, r,
+                                              nDx, nDy, nDz,
+                                              bValChanged, bRefSizeChanged);
+@@ -785,7 +785,7 @@
+             pDocument->RemoveFromFormulaTree( this );   // update formula count
+             delete pCode;
+             pCode = pRangeData->GetCode()->Clone();
+-            ScCompiler aComp2(pDocument, aPos, *pCode);
++            ScCompiler aComp2(pDocument, aPos, *pCode, pDocument->GetGrammar());
+             aComp2.UpdateSharedFormulaReference( eUpdateRefMode, aOldPos, r,
+                 nDx, nDy, nDz );
+             bValChanged = TRUE;
+@@ -837,7 +837,7 @@
+         if ( bPosChanged )
+             aPos.IncTab();
+         ScRangeData* pRangeData;
+-        ScCompiler aComp(pDocument, aPos, *pCode);
++        ScCompiler aComp(pDocument, aPos, *pCode, pDocument->GetGrammar());
+         pRangeData = aComp.UpdateInsertTab( nTable, FALSE );
+         if (pRangeData)                     // Shared Formula gegen echte Formel
+         {                                   // austauschen
+@@ -845,7 +845,7 @@
+             pDocument->RemoveFromFormulaTree( this );   // update formula count
+             delete pCode;
+             pCode = new ScTokenArray( *pRangeData->GetCode() );
+-            ScCompiler aComp2(pDocument, aPos, *pCode);
++            ScCompiler aComp2(pDocument, aPos, *pCode, pDocument->GetGrammar());
+             aComp2.MoveRelWrap();
+             aComp2.UpdateInsertTab( nTable, FALSE );
+             // If the shared formula contained a named range/formula containing
+@@ -871,14 +871,14 @@
+         if ( bPosChanged )
+             aPos.IncTab(-1);
+         ScRangeData* pRangeData;
+-        ScCompiler aComp(pDocument, aPos, *pCode);
++        ScCompiler aComp(pDocument, aPos, *pCode, pDocument->GetGrammar());
+         pRangeData = aComp.UpdateDeleteTab(nTable, bIsMove, FALSE, bRefChanged);
+         if (pRangeData)                     // Shared Formula gegen echte Formel
+         {                                   // austauschen
+             pDocument->RemoveFromFormulaTree( this );   // update formula count
+             delete pCode;
+             pCode = pRangeData->GetCode()->Clone();
+-            ScCompiler aComp2(pDocument, aPos, *pCode);
++            ScCompiler aComp2(pDocument, aPos, *pCode, pDocument->GetGrammar());
+             aComp2.CompileTokenArray();
+             aComp2.MoveRelWrap();
+             aComp2.UpdateDeleteTab( nTable, FALSE, FALSE, bRefChanged );
+@@ -906,14 +906,14 @@
+         // SetTab _nach_ EndListeningTo und _vor_ Compiler UpdateMoveTab !
+         aPos.SetTab( nTabNo );
+         ScRangeData* pRangeData;
+-        ScCompiler aComp(pDocument, aPos, *pCode);
++        ScCompiler aComp(pDocument, aPos, *pCode, pDocument->GetGrammar());
+         pRangeData = aComp.UpdateMoveTab( nOldPos, nNewPos, FALSE );
+         if (pRangeData)                     // Shared Formula gegen echte Formel
+         {                                   // austauschen
+             pDocument->RemoveFromFormulaTree( this );   // update formula count
+             delete pCode;
+             pCode = pRangeData->GetCode()->Clone();
+-            ScCompiler aComp2(pDocument, aPos, *pCode);
++            ScCompiler aComp2(pDocument, aPos, *pCode, pDocument->GetGrammar());
+             aComp2.CompileTokenArray();
+             aComp2.MoveRelWrap();
+             aComp2.UpdateMoveTab( nOldPos, nNewPos, TRUE );
+Index: sc/source/core/data/conditio.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/core/data/conditio.cxx,v
+retrieving revision 1.24
+retrieving revision 1.24.12.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.24 -r1.24.12.1
+--- sc/source/core/data/conditio.cxx	6 Mar 2008 15:25:20 -0000	1.24
++++ sc/source/core/data/conditio.cxx	19 Mar 2008 17:37:10 -0000	1.24.12.1
+@@ -636,7 +636,7 @@
+ 			lcl_CondUpdateInsertTab( *pFormula1, rRange.aStart.Tab(), aSrcPos.Tab(), bChanged1 );
+ 		else
+ 		{
+-			ScCompiler aComp( pDoc, aSrcPos, *pFormula1 );
++			ScCompiler aComp( pDoc, aSrcPos, *pFormula1, pDoc->GetGrammar() );
+ 			if ( bDeleteTab )
+ 				aComp.UpdateDeleteTab( rRange.aStart.Tab(), FALSE, TRUE, bChanged1 );
+ 			else
+@@ -652,7 +652,7 @@
+ 			lcl_CondUpdateInsertTab( *pFormula2, rRange.aStart.Tab(), aSrcPos.Tab(), bChanged2 );
+ 		else
+ 		{
+-			ScCompiler aComp( pDoc, aSrcPos, *pFormula2 );
++			ScCompiler aComp( pDoc, aSrcPos, *pFormula2, pDoc->GetGrammar() );
+ 			if ( bDeleteTab )
+ 				aComp.UpdateDeleteTab( rRange.aStart.Tab(), FALSE, TRUE, bChanged2 );
+ 			else
+@@ -668,13 +668,13 @@
+ {
+ 	if (pFormula1)
+ 	{
+-		ScCompiler aComp( pDoc, aSrcPos, *pFormula1 );
++		ScCompiler aComp( pDoc, aSrcPos, *pFormula1, pDoc->GetGrammar() );
+ 		aComp.UpdateMoveTab(nOldPos, nNewPos, TRUE );
+ 		DELETEZ(pFCell1);
+ 	}
+ 	if (pFormula2)
+ 	{
+-		ScCompiler aComp( pDoc, aSrcPos, *pFormula2 );
++		ScCompiler aComp( pDoc, aSrcPos, *pFormula2, pDoc->GetGrammar() );
+ 		aComp.UpdateMoveTab(nOldPos, nNewPos, TRUE );
+ 		DELETEZ(pFCell2);
+ 	}
+Index: sc/source/core/data/documen2.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/core/data/documen2.cxx,v
+retrieving revision 1.71
+retrieving revision 1.71.12.5
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.71 -r1.71.12.5
+--- sc/source/core/data/documen2.cxx	6 Mar 2008 15:25:51 -0000	1.71
++++ sc/source/core/data/documen2.cxx	31 Mar 2008 20:11:20 -0000	1.71.12.5
+@@ -210,7 +210,7 @@
+         nInDdeLinkUpdate( 0 ),
+         bInUnoBroadcast( FALSE ),
+         bInUnoListenerCall( FALSE ),
+-        eAddrConv( ScAddress::CONV_OOO ),
++        eGrammar( ScGrammar::GRAM_DEFAULT ),
+         bStyleSheetUsageInvalid( TRUE ),
+         bUndoEnabled( TRUE ),
+         mbAdjustHeightEnabled( true ),
+@@ -262,20 +262,20 @@
+ }
+ 
+ 
+-void ScDocument::SetStorageGrammar( ScGrammar::Grammar eGrammar )
++void ScDocument::SetStorageGrammar( ScGrammar::Grammar eGram )
+ {
+     DBG_ASSERT(
+-            eGrammar == ScGrammar::GRAM_ODFF ||
+-            eGrammar == ScGrammar::GRAM_PODF,
++            eGram == ScGrammar::GRAM_ODFF ||
++            eGram == ScGrammar::GRAM_PODF,
+             "ScDocument::SetStorageGrammar: wrong storage grammar");
+ 
+-    eStorageGrammar = eGrammar;
++    eStorageGrammar = eGram;
+ 
+     // FIXME: the XML import shouldn't strip brackets, the compiler should
+     // digest them instead, which could also speedup reference recognition
+     // during import.
+ 
+-    eXmlImportGrammar = ScGrammar::mergeToGrammar( eGrammar,
++    eXmlImportGrammar = ScGrammar::mergeToGrammar( eGram,
+             ScAddress::CONV_OOO);
+ }
+ 
+Index: sc/source/core/data/documen3.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/core/data/documen3.cxx,v
+retrieving revision 1.40
+retrieving revision 1.40.68.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.40 -r1.40.68.1
+--- sc/source/core/data/documen3.cxx	29 Jan 2008 15:17:42 -0000	1.40
++++ sc/source/core/data/documen3.cxx	19 Mar 2008 17:37:11 -0000	1.40.68.1
+@@ -352,12 +352,17 @@
+ 
+ ScAddress::Convention ScDocument::GetAddressConvention() const
+ {
+-	return eAddrConv;
++    return ScGrammar::extractRefConvention(eGrammar);
+ }
+ 
+-void ScDocument::SetAddressConvention( ScAddress::Convention eConv )
++ScGrammar::Grammar ScDocument::GetGrammar() const
+ {
+-	eAddrConv = eConv;
++    return eGrammar;
++}
++
++void ScDocument::SetGrammar( ScGrammar::Grammar eGram )
++{
++    eGrammar = eGram;
+ }
+ 
+ BOOL ScDocument::GetLinkMode( SCTAB nTab ) const
+Index: sc/source/core/data/documen5.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/core/data/documen5.cxx,v
+retrieving revision 1.31
+retrieving revision 1.31.124.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.31 -r1.31.124.1
+--- sc/source/core/data/documen5.cxx	13 Nov 2007 15:26:14 -0000	1.31
++++ sc/source/core/data/documen5.cxx	20 Mar 2008 23:19:42 -0000	1.31.124.1
+@@ -175,7 +175,7 @@
+ 							{
+                                 ScRangeListRef aRanges = pChartObj->GetRangeList();
+                                 String sRangeStr;
+-                                aRanges->Format( sRangeStr, SCR_ABS_3D, this );
++                                aRanges->Format( sRangeStr, SCR_ABS_3D, this, GetAddressConvention() );
+ 
+                                 chart::ChartDataRowSource eDataRowSource = chart::ChartDataRowSource_COLUMNS;
+                                 bool bHasCategories = pChartObj->HasRowHeaders();
+@@ -391,7 +391,7 @@
+                         }
+ 
+                         String sRangeStr;
+-                        aNewRanges->Format( sRangeStr, SCR_ABS_3D, this );
++                        aNewRanges->Format( sRangeStr, SCR_ABS_3D, this, GetAddressConvention() );
+ 
+                         lcl_SetChartParameters( xReceiver, sRangeStr, eDataRowSource, bHasCategories, bFirstCellAsLabel );
+ 
+@@ -552,7 +552,8 @@
+             for ( sal_Int32 i=0; i<nRangeCount; i++ )
+             {
+                 ScRange aRange;
+-                if ( aRange.ParseAny( aRepresentations[i], this ) & SCA_VALID )
++                ScAddress::Details aDetails(GetAddressConvention(), 0, 0);
++                if ( aRange.ParseAny( aRepresentations[i], this, aDetails ) & SCA_VALID )
+                     aRanges->Append( aRange );
+             }
+ 
+@@ -684,7 +685,7 @@
+                         lcl_GetChartParameters( xChartDoc, aRangesStr, eDataRowSource, bHasCategories, bFirstCellAsLabel );
+ 
+                         String sRangeStr;
+-                        rNewRangeListRef->Format( sRangeStr, SCR_ABS_3D, this );
++                        rNewRangeListRef->Format( sRangeStr, SCR_ABS_3D, this, GetAddressConvention() );
+ 
+                         lcl_SetChartParameters( xReceiver, sRangeStr, eDataRowSource, bHasCategories, bFirstCellAsLabel );
+ 
+Index: sc/source/core/data/global.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/core/data/global.cxx,v
+retrieving revision 1.54
+retrieving revision 1.54.12.2
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.54 -r1.54.12.2
+--- sc/source/core/data/global.cxx	7 Mar 2008 11:13:15 -0000	1.54
++++ sc/source/core/data/global.cxx	18 Mar 2008 23:14:31 -0000	1.54.12.2
+@@ -1308,7 +1308,15 @@
+ 	if ( nStrLen < nStart )
+ 		return nStart;
+ 
++    // We assume the following tokens are single-character tokens.
++    const sal_Unicode open       = ScCompiler::GetStringFromOpCode(ocOpen).GetChar(0);
++    const sal_Unicode close      = ScCompiler::GetStringFromOpCode(ocClose).GetChar(0);
++    const sal_Unicode sep        = ScCompiler::GetStringFromOpCode(ocSep).GetChar(0);
++    const sal_Unicode arrayOpen  = ScCompiler::GetStringFromOpCode(ocArrayOpen).GetChar(0);
++    const sal_Unicode arrayClose = ScCompiler::GetStringFromOpCode(ocArrayClose).GetChar(0);
++
+ 	short	nParCount = 0;
++    bool    bInArray = false;
+ 	BOOL	bFound = FALSE;
+ 
+ 	while ( !bFound && (nStart < nStrLen) )
+@@ -1321,9 +1329,9 @@
+ 			while ( (nStart < nStrLen) && rStr.GetChar(nStart) != '"' )
+ 				nStart++;
+ 		}
+-		else if ( c == '(' )
++		else if ( c == open )
+ 			nParCount++;
+-		else if ( c == ')' )
++		else if ( c == close )
+ 		{
+ 			nParCount--;
+ 			if ( nParCount == 0 )
+@@ -1334,9 +1342,17 @@
+ 				nStart--;	// einen zu weit gelesen
+ 			}
+ 		}
+-		else if ( c == ';' )
++        else if ( c == arrayOpen )
+ 		{
+-			if ( nParCount == 0 )
++            bInArray = true;
++        }
++        else if ( c == arrayClose )
++        {
++            bInArray = false;
++        }
++		else if ( c == sep )
++		{
++			if ( !bInArray && nParCount == 0 )
+ 			{
+ 				bFound = TRUE;
+ 				nStart--;	// einen zu weit gelesen
+@@ -1357,7 +1373,15 @@
+ 	if ( nStrLen < nStart )
+ 		return nStart;
+ 
++    // We assume the following tokens are single-character tokens.
++    const sal_Unicode open       = ScCompiler::GetStringFromOpCode(ocOpen).GetChar(0);
++    const sal_Unicode close      = ScCompiler::GetStringFromOpCode(ocClose).GetChar(0);
++    const sal_Unicode sep        = ScCompiler::GetStringFromOpCode(ocSep).GetChar(0);
++    const sal_Unicode arrayOpen  = ScCompiler::GetStringFromOpCode(ocArrayOpen).GetChar(0);
++    const sal_Unicode arrayClose = ScCompiler::GetStringFromOpCode(ocArrayClose).GetChar(0);
++
+ 	short	nParCount	= 0;
++    bool    bInArray    = false;
+ 	BOOL	bFound		= FALSE;
+ 
+ 	while ( !bFound && (nStart < nStrLen) )
+@@ -1370,19 +1394,27 @@
+ 			while ( (nStart < nStrLen) && rStr.GetChar(nStart) != '"' )
+ 				nStart++;
+ 		}
+-		else if ( c == '(' )
++		else if ( c == open )
+ 		{
+ 			bFound = ( nArg == 0 );
+ 			nParCount++;
+ 		}
+-		else if ( c == ')' )
++		else if ( c == close )
+ 		{
+ 			nParCount--;
+ 			bFound = ( nParCount == 0 );
+ 		}
+-		else if ( c == ';' )
++        else if ( c == arrayOpen )
+ 		{
+-			if ( nParCount == 1 )
++            bInArray = true;
++        }
++        else if ( c == arrayClose )
++        {
++            bInArray = false;
++        }
++		else if ( c == sep )
++		{
++			if ( !bInArray && nParCount == 1 )
+ 			{
+ 				nArg--;
+ 				bFound = ( nArg == 0  );
+@@ -1788,6 +1820,8 @@
+ 
+ String ScFuncDesc::GetParamList() const
+ {
++    const String& sep = ScCompiler::GetStringFromOpCode(ocSep);
++
+     String aSig;
+ 
+     if ( nArgCount > 0 )
+@@ -1805,7 +1839,10 @@
+                     nLastAdded = i;
+                     aSig += *(ppDefArgNames[i]);
+                     if ( i != nArgCount-1 )
+-                        aSig.AppendAscii(RTL_CONSTASCII_STRINGPARAM( "; " ));
++                    {
++                        aSig.Append(sep);
++                        aSig.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " " ));
++                    }
+                 }
+             }
+             // If only suppressed parameters follow the last added parameter,
+@@ -1822,7 +1859,8 @@
+                 if (!pDefArgFlags[nArg].bSuppress)
+                 {
+                     aSig += *(ppDefArgNames[nArg]);
+-                    aSig.AppendAscii(RTL_CONSTASCII_STRINGPARAM( "; " ));
++                    aSig.Append(sep);
++                    aSig.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " " ));
+                 }
+             }
+             /* NOTE: Currently there are no suppressed var args parameters. If
+@@ -1831,10 +1869,12 @@
+              * treatment of a trailing "; " necessary. */
+             aSig += *(ppDefArgNames[nFix]);
+             aSig += '1';
+-            aSig.AppendAscii(RTL_CONSTASCII_STRINGPARAM( "; " ));
++            aSig.Append(sep);
++            aSig.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " " ));
+             aSig += *(ppDefArgNames[nFix]);
+             aSig += '2';
+-            aSig.AppendAscii(RTL_CONSTASCII_STRINGPARAM( "; ... " ));
++            aSig.Append(sep);
++            aSig.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " ... " ));
+         }
+     }
+ 
+@@ -1869,6 +1909,8 @@
+ 
+ String ScFuncDesc::GetFormulaString( String** aArgArr ) const
+ {
++    const String& sep = ScCompiler::GetStringFromOpCode(ocSep);
++
+ 	String aFormula;
+ 
+ 	if(pFuncName)
+@@ -1891,7 +1933,7 @@
+ 					{
+ 						bLastArg = !( aArgArr[i+1]->Len() > 0 );
+ 						if ( !bLastArg )
+-							aFormula += ';';
++							aFormula += sep;
+ 					}
+ 				}
+ 			}
+Index: sc/source/core/data/validat.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/core/data/validat.cxx,v
+retrieving revision 1.22
+retrieving revision 1.22.12.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.22 -r1.22.12.1
+--- sc/source/core/data/validat.cxx	6 Mar 2008 15:27:23 -0000	1.22
++++ sc/source/core/data/validat.cxx	20 Mar 2008 23:19:42 -0000	1.22.12.1
+@@ -296,7 +296,7 @@
+ 
+ 	//	2) Position der Zelle
+ 	String aPosStr;
+-	rPos.Format( aPosStr, SCA_VALID | SCA_TAB_3D, pDocument );
++	rPos.Format( aPosStr, SCA_VALID | SCA_TAB_3D, pDocument, pDocument->GetAddressConvention() );
+ 	aParams[1] = ::com::sun::star::uno::makeAny( ::rtl::OUString( aPosStr ) );
+ 
+ 	//	use link-update flag to prevent closing the document
+@@ -430,7 +430,7 @@
+ 
+ 		//	2) Position der Zelle
+ 		String aPosStr;
+-		rPos.Format( aPosStr, SCA_VALID | SCA_TAB_3D, pDocument );
++		rPos.Format( aPosStr, SCA_VALID | SCA_TAB_3D, pDocument, pDocument->GetAddressConvention() );
+ 		refPar->Get(2)->PutString( aPosStr );
+ 
+ 		//	use link-update flag to prevent closing the document
+Index: sc/source/core/tool/address.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/core/tool/address.cxx,v
+retrieving revision 1.10
+retrieving revision 1.10.78.3
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.10 -r1.10.78.3
+--- sc/source/core/tool/address.cxx	10 Jan 2008 13:12:58 -0000	1.10
++++ sc/source/core/tool/address.cxx	25 Mar 2008 23:03:18 -0000	1.10.78.3
+@@ -428,7 +428,7 @@
+                            const ScAddress::Details& rDetails,
+                            BOOL bOnlyAcceptSingle )
+ {
+-    const sal_Unicode* pTmp;
++    const sal_Unicode* pTmp = NULL;
+     String aExternDocName, aStartTabName, aEndTabName;
+     USHORT nFlags = SCA_VALID | SCA_VALID_TAB, nFlags2 = SCA_VALID_TAB2;
+ 
+@@ -453,11 +453,25 @@
+         {
+             if( p[0] != ':' || (p[1] != 'R' && p[1] != 'r' ) ||
+                 NULL == (pTmp = lcl_r1c1_get_row( p+1, rDetails, &r.aEnd, &nFlags2 )))
+-            {   // Fallback to just the initial R
++            {
++                // Only the initial row number is given, or the second row
++                // number is invalid. Fallback to just the initial R
+                 nFlags |= (nFlags << 4);
+                 r.aEnd.SetRow( r.aStart.Row() );
+-            } else
++            }
++            else
++            {
++                // Full row range successfully parsed.
+                 nFlags |= (nFlags2 << 4);
++                p = pTmp;
++            }
++
++            if (p && p[0] != 0)
++            {
++                // any trailing invalid character must invalidate the whole address.
++                nFlags &= ~(SCA_VALID | SCA_VALID_COL | SCA_VALID_ROW | SCA_VALID_TAB);
++                return nFlags;
++            }
+ 
+             nFlags |= 
+                 SCA_VALID_COL | SCA_VALID_COL2 |
+@@ -477,9 +491,29 @@
+             (*pTmp != 'C' && *pTmp != 'c') ||
+             NULL == (pTmp = lcl_r1c1_get_col( pTmp, rDetails, &r.aEnd, &nFlags2 )))
+         {
++            // single cell reference
++
++            if (p && p[0] != 0)
++            {
++                // any trailing invalid character must invalidate the whole address.
++                nFlags &= ~(SCA_VALID | SCA_VALID_COL | SCA_VALID_ROW | SCA_VALID_TAB);
++                return nFlags;
++            }
++
+             return bOnlyAcceptSingle ? lcl_XL_LinkSheetRef( r, pDoc,
+                 aExternDocName, aStartTabName, aEndTabName, nFlags ) : 0;
+         }
++        p = pTmp;
++
++        // double reference
++
++        if (p && p[0] != 0)
++        {
++            // any trailing invalid character must invalidate the whole range.
++            nFlags &= ~(SCA_VALID | SCA_VALID_COL | SCA_VALID_ROW | SCA_VALID_TAB | 
++                        SCA_VALID_COL2 | SCA_VALID_ROW2 | SCA_VALID_TAB2);
++            return nFlags;
++        }
+ 
+         nFlags |= (nFlags2 << 4);
+         return bOnlyAcceptSingle ? 0 : lcl_XL_LinkSheetRef( r, pDoc,
+@@ -497,7 +531,17 @@
+             r.aEnd.SetCol( r.aStart.Col() );
+         }
+         else
++        {
+             nFlags |= (nFlags2 << 4);
++            p = pTmp;
++        }
++
++        if (p && p[0] != 0)
++        {
++            // any trailing invalid character must invalidate the whole address.
++            nFlags &= ~(SCA_VALID | SCA_VALID_COL | SCA_VALID_ROW | SCA_VALID_TAB);
++            return nFlags;
++        }
+ 
+         nFlags |= 
+             SCA_VALID_ROW | SCA_VALID_ROW2 |
+@@ -623,10 +667,24 @@
+     // prepare as if it's a singleton, in case we want to fall back */
+     r.aEnd.SetCol( r.aStart.Col() );
+     r.aEnd.SetRow( r.aStart.Row() );    // don't overwrite sheet number as parsed in lcl_ScRange_Parse_XL_Header
++
++    if ( bOnlyAcceptSingle )
++    {
++        if ( *tmp2 == 0 )
++            return lcl_XL_LinkSheetRef( r, pDoc,
++                aExternDocName, aStartTabName, aEndTabName, nFlags );
++        else
++        {
++            // any trailing invalid character must invalidate the address.
++            nFlags &= ~(SCA_VALID | SCA_VALID_COL | SCA_VALID_ROW | SCA_VALID_TAB);
++            return nFlags;
++        }
++    }
++
+     if( *tmp2 != ':' )
+     {
+-        if ( !bOnlyAcceptSingle )
+-            nFlags &= ~SCA_VALID;   // when looking for a double ref, a single-cell ref must not be accepted
++        nFlags &= ~(SCA_VALID | SCA_VALID_COL | SCA_VALID_ROW | SCA_VALID_TAB |
++                    SCA_VALID_COL2 | SCA_VALID_ROW2 | SCA_VALID_TAB2);
+         return nFlags;
+     }
+ 
+@@ -640,6 +698,14 @@
+         return lcl_XL_LinkSheetRef( r, pDoc,
+             aExternDocName, aStartTabName, aEndTabName, nFlags );
+ 
++    if ( *tmp2 != 0 )
++    {
++        // any trailing invalid character must invalidate the range.
++        nFlags &= ~(SCA_VALID | SCA_VALID_COL | SCA_VALID_ROW | SCA_VALID_TAB |
++                    SCA_VALID_COL2 | SCA_VALID_ROW2 | SCA_VALID_TAB2);
++        return nFlags;
++    }
++
+     nFlags |= (nFlags2 << 4);
+     return lcl_XL_LinkSheetRef( r, pDoc,
+         aExternDocName, aStartTabName, aEndTabName, nFlags );
+@@ -1334,9 +1400,12 @@
+ 
+             case CONV_XL_A1:
+             case CONV_XL_R1C1:
++                if (aDocName.Len() > 0)
++                {
+                 r += '[';
+                 r += aDocName;
+                 r += ']';
++                }
+                 r += aTabName;
+                 r += '!';
+                 break;
+@@ -1434,6 +1503,7 @@
+ void ScRange::Format( String& r, USHORT nFlags, ScDocument* pDoc,
+                       const ScAddress::Details& rDetails ) const
+ {
++    r.Erase();
+     if( !( nFlags & SCA_VALID ) )
+     {
+         r = ScGlobal::GetRscString( STR_NOREF_STR );
+Index: sc/source/core/tool/chgtrack.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/core/tool/chgtrack.cxx,v
+retrieving revision 1.29
+retrieving revision 1.29.12.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.29 -r1.29.12.1
+--- sc/source/core/tool/chgtrack.cxx	7 Mar 2008 12:17:43 -0000	1.29
++++ sc/source/core/tool/chgtrack.cxx	20 Mar 2008 23:19:50 -0000	1.29.12.1
+@@ -667,7 +667,7 @@
+ 			default:
+ 				if ( bFlag3D || GetType() == SC_CAT_INSERT_TABS )
+ 					nFlags |= SCA_TAB_3D;
+-				aTmpRange.Format( aStr, nFlags, pDoc );
++				aTmpRange.Format( aStr, nFlags, pDoc, pDoc->GetAddressConvention() );
+ 		}
+ 		if ( (bFlag3D && IsDeleteType()) || IsDeletedIn() )
+ 		{
+@@ -2054,7 +2054,7 @@
+ 		ScAddress aTmpAddress( GetBigRange().aStart.MakeAddress() );
+ 		if ( bFlag3D )
+ 			nFlags |= SCA_TAB_3D;
+-		aTmpAddress.Format( rStr, nFlags, pDoc );
++		aTmpAddress.Format( rStr, nFlags, pDoc, pDoc->GetAddressConvention() );
+ 		if ( IsDeletedIn() )
+ 		{
+ 			rStr.Insert( '(', 0 );
+Index: sc/source/core/tool/compiler.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/core/tool/compiler.cxx,v
+retrieving revision 1.75
+retrieving revision 1.75.12.7
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.75 -r1.75.12.7
+--- sc/source/core/tool/compiler.cxx	7 Mar 2008 11:17:09 -0000	1.75
++++ sc/source/core/tool/compiler.cxx	31 Mar 2008 20:07:26 -0000	1.75.12.7
+@@ -47,6 +47,7 @@
+ #include <tools/rc.hxx>
+ #include <tools/solar.h>
+ #include <unotools/charclass.hxx>
++#include <com/sun/star/lang/Locale.hpp>
+ #include <com/sun/star/sheet/FormulaOpCodeMapEntry.hpp>
+ #include <com/sun/star/sheet/FormulaLanguage.hpp>
+ #include <com/sun/star/sheet/FormulaMapGroup.hpp>
+@@ -222,23 +223,116 @@
+ class ScOpCodeList : public Resource        // temp object for resource
+ {
+ public:
++
+     ScOpCodeList( USHORT, ScCompiler::NonConstOpCodeMapPtr );
++
++private:
++    void init( ScGrammar::Grammar eGrammar );
++    bool getOpCodeString( String& rStr, USHORT nOp );
++    void putDefaultOpCode( ScCompiler::NonConstOpCodeMapPtr xMap, USHORT nOp );
++
++private:
++    enum SeparatorType
++    {
++        SEMICOLON_BASE,
++        COMMA_BASE
++    };
++    SeparatorType meSepType;
+ };
+ 
+-ScOpCodeList::ScOpCodeList( USHORT nRID, ScCompiler::NonConstOpCodeMapPtr xMap )
+-        :
+-        Resource( ScResId( nRID ) )
++ScOpCodeList::ScOpCodeList( USHORT nRID, ScCompiler::NonConstOpCodeMapPtr xMap ) :
++    Resource( ScResId(nRID) )
+ {
+-    for (USHORT i = 0; i <= SC_OPCODE_LAST_OPCODE_ID; i++)
++    init(xMap->getGrammar());
++
++    for (USHORT i = 0; i <= SC_OPCODE_LAST_OPCODE_ID; ++i)
+     {
+-        ScResId aRes(i);
+-        aRes.SetRT(RSC_STRING);
+-        if (IsAvailableRes(aRes))
+-            xMap->putOpCode( aRes, OpCode(i));
++        String aOpStr;
++        if ( getOpCodeString(aOpStr, i) )
++            xMap->putOpCode(aOpStr, OpCode(i));
++        else
++            putDefaultOpCode(xMap, i);
+     }
++
+     FreeResource();
+ }
+ 
++void ScOpCodeList::init( ScGrammar::Grammar eGrammar )
++{
++    using namespace ::com::sun::star::sheet;
++
++    meSepType = SEMICOLON_BASE;
++#if 0
++    if (ScGrammar::extractFormulaLanguage(eGrammar) == FormulaLanguage::NATIVE)
++    {
++        // Use localized separators.
++        const lang::Locale& rLocale = *ScGlobal::pLocale;
++        if (rLocale.Language.equalsAscii("en"))
++            meSepType = COMMA_BASE;
++
++        // TODO: Check for more locales.
++    }
++#endif
++}
++
++bool ScOpCodeList::getOpCodeString( String& rStr, USHORT nOp )
++{
++    switch (nOp)
++    {
++        case SC_OPCODE_SEP:
++        {
++            if (meSepType == COMMA_BASE)
++            {
++                rStr = String::CreateFromAscii(",");
++                return true;
++            }
++            else if (meSepType == SEMICOLON_BASE)
++            {
++                rStr = String::CreateFromAscii(";");
++                return true;
++            }
++        }
++        break;
++        case SC_OPCODE_ARRAY_COL_SEP:
++        {
++            if (meSepType == COMMA_BASE)
++            {
++                rStr = String::CreateFromAscii(",");
++                return true;
++            }
++            else if (meSepType == SEMICOLON_BASE)
++            {
++                rStr = String::CreateFromAscii(";");
++                return true;
++            }
++        }
++        break;
++        case SC_OPCODE_ARRAY_ROW_SEP:
++        {
++            if (meSepType == COMMA_BASE)
++            {
++                rStr = String::CreateFromAscii(";");
++                return true;
++            }
++            else if (meSepType == SEMICOLON_BASE)
++            {
++                rStr = String::CreateFromAscii("|");
++                return true;
++            }
++        }
++        break;
++    }
++
++    return false;
++}
++
++void ScOpCodeList::putDefaultOpCode( ScCompiler::NonConstOpCodeMapPtr xMap, USHORT nOp )
++{
++    ScResId aRes(nOp);
++    aRes.SetRT(RSC_STRING);
++    if (IsAvailableRes(aRes))
++        xMap->putOpCode(aRes, OpCode(nOp));
++}
+ 
+ class ScCompilerRecursionGuard
+ {
+@@ -323,7 +417,7 @@
+     // Core
+     mxSymbolsNative.reset( new OpCodeMap( SC_OPCODE_LAST_OPCODE_ID + 1,
+                 true, ScGrammar::GRAM_NATIVE_UI));
+-    ScOpCodeList aOpCodeListNative( RID_SC_FUNCTION_NAMES, mxSymbolsNative);
++    ScOpCodeList aOpCodeListNative( RID_SC_FUNCTION_NAMES, mxSymbolsNative );
+ 
+     // No AddInMap for native core mapping.
+ }
+@@ -1301,11 +1395,12 @@
+     {
+         ComplRefData aRef( rRef );
+ 
+-        MakeDocStr( rBuf, rComp, aRef, bSingleRef );
+-
+         // Play fast and loose with invalid refs.  There is not much point in producing
+         // Foo!A1:#REF! versus #REF! at this point
+         aRef.Ref1.CalcAbsIfRel( rComp.GetPos() );
++
++        MakeDocStr( rBuf, rComp, aRef, bSingleRef );
++
+         if( aRef.Ref1.IsColDeleted() || aRef.Ref1.IsRowDeleted() )
+         {
+             rBuf.append(ScGlobal::GetRscString(STR_NO_REF_TABLE));
+Index: sc/source/core/tool/interpr1.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/core/tool/interpr1.cxx,v
+retrieving revision 1.56
+retrieving revision 1.56.12.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.56 -r1.56.12.1
+--- sc/source/core/tool/interpr1.cxx	6 Mar 2008 15:32:04 -0000	1.56
++++ sc/source/core/tool/interpr1.cxx	20 Mar 2008 23:19:50 -0000	1.56.12.1
+@@ -1690,7 +1690,7 @@
+             else if( aInfoType.EqualsAscii( "ADDRESS" ) )
+             {   // address formatted as [['FILENAME'#]$TABLE.]$COL$ROW
+                 USHORT nFlags = (aCellPos.Tab() == aPos.Tab()) ? (SCA_ABS) : (SCA_ABS_3D);
+-                aCellPos.Format( aFuncResult, nFlags, pDok );
++                aCellPos.Format( aFuncResult, nFlags, pDok, pDok->GetAddressConvention() );
+                 PushString( aFuncResult );
+             }
+             else if( aInfoType.EqualsAscii( "FILENAME" ) )
+@@ -1720,10 +1720,12 @@
+             else if( aInfoType.EqualsAscii( "COORD" ) )
+             {   // address, lotus 1-2-3 formatted: $TABLE:$COL$ROW
+                 // Yes, passing tab as col is intentional!
+-                ScAddress( static_cast<SCCOL>(aCellPos.Tab()), 0, 0 ).Format( aFuncResult, (SCA_COL_ABSOLUTE|SCA_VALID_COL) );
++                ScAddress( static_cast<SCCOL>(aCellPos.Tab()), 0, 0 ).Format( 
++                    aFuncResult, (SCA_COL_ABSOLUTE|SCA_VALID_COL), NULL, pDok->GetAddressConvention() );
+                 aFuncResult += ':';
+                 String aCellStr;
+-                aCellPos.Format( aCellStr, (SCA_COL_ABSOLUTE|SCA_VALID_COL|SCA_ROW_ABSOLUTE|SCA_VALID_ROW) );
++                aCellPos.Format( aCellStr, (SCA_COL_ABSOLUTE|SCA_VALID_COL|SCA_ROW_ABSOLUTE|SCA_VALID_ROW),
++                                 NULL, pDok->GetAddressConvention() );
+                 aFuncResult += aCellStr;
+                 PushString( aFuncResult );
+             }
+Index: sc/source/core/tool/rangenam.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/core/tool/rangenam.cxx,v
+retrieving revision 1.27
+retrieving revision 1.27.12.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.27 -r1.27.12.1
+--- sc/source/core/tool/rangenam.cxx	6 Mar 2008 15:36:41 -0000	1.27
++++ sc/source/core/tool/rangenam.cxx	19 Mar 2008 17:37:12 -0000	1.27.12.1
+@@ -166,7 +166,7 @@
+ 	aRefData.InitAddress( rTarget );
+ 	aRefData.SetFlag3D( TRUE );
+ 	pCode->AddSingleReference( aRefData );
+-	ScCompiler aComp( pDoc, aPos, *pCode );
++	ScCompiler aComp( pDoc, aPos, *pCode, pDoc->GetGrammar() );
+ 	aComp.CompileTokenArray();
+ 	if ( !pCode->GetCodeError() )
+ 		eType |= RT_ABSPOS;
+@@ -288,7 +288,7 @@
+ 	if( pCode->GetNextReference() )
+ 	{
+         BOOL bSharedFormula = ((eType & RT_SHARED) == RT_SHARED);
+-		ScCompiler aComp( pDoc, aPos, *pCode );
++		ScCompiler aComp( pDoc, aPos, *pCode, pDoc->GetGrammar() );
+ 		BOOL bRelRef = aComp.UpdateNameReference( eUpdateRefMode, r,
+ 													nDx, nDy, nDz,
+ 													bChanged, bSharedFormula);
+@@ -419,7 +419,7 @@
+ 		if ( pCode )
+         {
+             ::std::auto_ptr<ScTokenArray> pTemp( pCode->Clone() );
+-            ScCompiler aComp( pDoc, rPos, *pTemp );
++            ScCompiler aComp( pDoc, rPos, *pTemp, pDoc->GetGrammar() );
+             aComp.MoveRelWrap();
+             return pTemp->IsReference( rRange );
+         }
+@@ -443,7 +443,7 @@
+ 	{
+         ScRangeData* pRangeData = NULL;     // must not be dereferenced
+ 		BOOL bChanged;
+-		ScCompiler aComp( pDoc, aPos, *pCode );
++		ScCompiler aComp( pDoc, aPos, *pCode, pDoc->GetGrammar() );
+ 		switch (nFlag)
+ 		{
+ 			case 1:										// einfache InsertTab (doc.cxx)
+@@ -606,7 +606,7 @@
+ 	}
+ 	if ( bCompile )
+ 	{
+-		ScCompiler aComp( pDoc, aPos, *pCode );
++		ScCompiler aComp( pDoc, aPos, *pCode, pDoc->GetGrammar() );
+ 		aComp.CompileTokenArray();
+ 	}
+ }
+Index: sc/source/core/tool/rangeutl.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/core/tool/rangeutl.cxx,v
+retrieving revision 1.11
+retrieving revision 1.10.276.2
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.11 -r1.10.276.2
+--- sc/source/core/tool/rangeutl.cxx	12 Mar 2008 13:14:16 -0000	1.11
++++ sc/source/core/tool/rangeutl.cxx	31 Mar 2008 20:24:13 -0000	1.10.276.2
+@@ -475,7 +475,7 @@
+ 	OUString sToken;
+ 	GetTokenByOffset( sToken, rAddressStr, nOffset, cSeperator, cQuote );
+ 	if( nOffset >= 0 )
+-		return ((rAddress.Parse( sToken, (ScDocument*) pDocument ) & SCA_VALID) == SCA_VALID);
++		return ((rAddress.Parse( sToken, const_cast<ScDocument*>(pDocument), pDocument->GetAddressConvention() ) & SCA_VALID) == SCA_VALID);
+ 	return sal_False;
+ }
+ 
+@@ -499,7 +499,7 @@
+         {
+             if ( aUIString.GetChar(0) == (sal_Unicode) '.' )
+                 aUIString.Erase( 0, 1 );
+-            bResult = ((rRange.aStart.Parse( aUIString, const_cast<ScDocument*> (pDocument)) & SCA_VALID) == SCA_VALID);
++            bResult = ((rRange.aStart.Parse( aUIString, const_cast<ScDocument*> (pDocument), pDocument->GetAddressConvention()) & SCA_VALID) == SCA_VALID);
+             rRange.aEnd = rRange.aStart;
+         }
+         else
+@@ -640,7 +640,7 @@
+ 	if (pDocument && pDocument->HasTable(rAddress.Tab()))
+ 	{
+ 		String sAddress;
+-		rAddress.Format( sAddress, nFormatFlags, (ScDocument*) pDocument );
++		rAddress.Format( sAddress, nFormatFlags, (ScDocument*) pDocument, pDocument->GetAddressConvention() );
+ 		AssignString( rString, sAddress, bAppendStr, cSeperator );
+ 	}
+ }
+@@ -659,10 +659,9 @@
+ 		ScAddress aEndAddress( rRange.aEnd );
+ 		String sStartAddress;
+ 		String sEndAddress;
+-		aStartAddress.Format( sStartAddress, nFormatFlags, (ScDocument*) pDocument,
+-                              ScAddress::CONV_OOO );
+-		aEndAddress.Format( sEndAddress, nFormatFlags, (ScDocument*) pDocument,
+-                            ScAddress::CONV_OOO );
++        ScAddress::Convention eConv = pDocument->GetAddressConvention();
++		aStartAddress.Format( sStartAddress, nFormatFlags, (ScDocument*) pDocument, eConv );
++		aEndAddress.Format( sEndAddress, nFormatFlags, (ScDocument*) pDocument, eConv );
+ 		OUString sOUStartAddress( sStartAddress );
+         sOUStartAddress += OUString(':');
+ 		sOUStartAddress += OUString( sEndAddress );
+Index: sc/source/core/tool/reffind.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/core/tool/reffind.cxx,v
+retrieving revision 1.6
+retrieving revision 1.6.314.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.6 -r1.6.314.1
+--- sc/source/core/tool/reffind.cxx	27 Feb 2007 12:18:37 -0000	1.6
++++ sc/source/core/tool/reffind.cxx	20 Mar 2008 23:19:51 -0000	1.6.314.1
+@@ -45,7 +45,7 @@
+ #include "reffind.hxx"
+ #include "global.hxx"
+ #include "compiler.hxx"
+-
++#include "document.hxx"
+ 
+ // STATIC DATA -----------------------------------------------------------
+ 
+@@ -142,11 +142,11 @@
+ 
+ 		//	Test, ob aExpr eine Referenz ist
+ 
+-		USHORT nResult = aAddr.Parse( aExpr, pDoc );
++		USHORT nResult = aAddr.Parse( aExpr, pDoc, pDoc->GetAddressConvention() );
+ 		if ( nResult & SCA_VALID )
+ 		{
+ 			USHORT nFlags = lcl_NextFlags( nResult );
+-			aAddr.Format( aExpr, nFlags, pDoc );
++			aAddr.Format( aExpr, nFlags, pDoc, pDoc->GetAddressConvention() );
+ 
+ 			xub_StrLen nAbsStart = nStartPos+aResult.Len()+aSep.Len();
+ 
+Index: sc/source/filter/inc/fdumper.hxx
+===================================================================
+RCS file: /cvs/sc/sc/source/filter/inc/fdumper.hxx,v
+retrieving revision 1.7
+retrieving revision 1.7.310.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.7 -r1.7.310.1
+--- sc/source/filter/inc/fdumper.hxx	27 Feb 2007 12:33:04 -0000	1.7
++++ sc/source/filter/inc/fdumper.hxx	18 Mar 2008 23:14:33 -0000	1.7.310.1
+@@ -36,7 +36,7 @@
+ #ifndef SC_FDUMPER_HXX
+ #define SC_FDUMPER_HXX
+ 
+-#define SCF_INCL_DUMPER (OSL_DEBUG_LEVEL > 0)
++#define SCF_INCL_DUMPER (OSL_DEBUG_LEVEL > 0) && 0
+ 
+ #if SCF_INCL_DUMPER
+ 
+Index: sc/source/ui/app/inputwin.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/app/inputwin.cxx,v
+retrieving revision 1.55
+retrieving revision 1.55.12.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.55 -r1.55.12.1
+--- sc/source/ui/app/inputwin.cxx	7 Mar 2008 11:19:00 -0000	1.55
++++ sc/source/ui/app/inputwin.cxx	20 Mar 2008 23:19:57 -0000	1.55.12.1
+@@ -1562,6 +1562,7 @@
+         ScViewData* pViewData = pViewSh->GetViewData();
+         ScDocument* pDoc = pViewData->GetDocument();
+         SCTAB nTab = pViewData->GetTabNo();
++        ScAddress::Convention eConv = pDoc->GetAddressConvention();
+ 
+         // test in same order as in SID_CURRENTCELL execute
+ 
+@@ -1571,13 +1572,13 @@
+         SCTAB nNameTab;
+         sal_Int32 nNumeric;
+ 
+-        if ( aRange.Parse( rText, pDoc ) & SCA_VALID )
++        if ( aRange.Parse( rText, pDoc, eConv ) & SCA_VALID )
+             eRet = SC_NAME_INPUT_NAMEDRANGE;
+-        else if ( aAddress.Parse( rText, pDoc ) & SCA_VALID )
++        else if ( aAddress.Parse( rText, pDoc, eConv ) & SCA_VALID )
+             eRet = SC_NAME_INPUT_CELL;
+-        else if ( aRangeUtil.MakeRangeFromName( rText, pDoc, nTab, aRange, RUTL_NAMES ) )
++        else if ( aRangeUtil.MakeRangeFromName( rText, pDoc, nTab, aRange, RUTL_NAMES, eConv ) )
+             eRet = SC_NAME_INPUT_NAMEDRANGE;
+-        else if ( aRangeUtil.MakeRangeFromName( rText, pDoc, nTab, aRange, RUTL_DBASE ) )
++        else if ( aRangeUtil.MakeRangeFromName( rText, pDoc, nTab, aRange, RUTL_DBASE, eConv ) )
+             eRet = SC_NAME_INPUT_DATABASE;
+         else if ( ByteString( rText, RTL_TEXTENCODING_ASCII_US ).IsNumericAscii() &&
+                   ( nNumeric = rText.ToInt32() ) > 0 && nNumeric <= MAXROW+1 )
+Index: sc/source/ui/dbgui/consdlg.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/dbgui/consdlg.cxx,v
+retrieving revision 1.11
+retrieving revision 1.11.314.2
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.11 -r1.11.314.2
+--- sc/source/ui/dbgui/consdlg.cxx	27 Feb 2007 13:00:57 -0000	1.11
++++ sc/source/ui/dbgui/consdlg.cxx	21 Mar 2008 05:19:14 -0000	1.11.314.2
+@@ -200,6 +200,7 @@
+ 
+ 	// Einlesen der Konsolidierungsbereiche
+ 	aLbConsAreas.Clear();
++    const ScAddress::Convention eConv = pDoc->GetAddressConvention();
+ 	for ( i=0; i<theConsData.nDataAreaCount; i++ )
+ 	{
+ 		const ScArea& rArea = *(theConsData.ppDataAreas[i] );
+@@ -207,7 +208,7 @@
+ 		{
+             ScRange( rArea.nColStart, rArea.nRowStart, rArea.nTab,
+                     rArea.nColEnd, rArea.nRowEnd, rArea.nTab ).Format( aStr,
+-                        SCR_ABS_3D, pDoc );
++                        SCR_ABS_3D, pDoc, eConv );
+             aLbConsAreas.InsertEntry( aStr );
+         }
+     }
+@@ -215,7 +216,7 @@
+ 	if ( theConsData.nTab < pDoc->GetTableCount() )
+     {
+         ScAddress( theConsData.nCol, theConsData.nRow, theConsData.nTab
+-                ).Format( aStr, SCA_ABS_3D, pDoc );
++                ).Format( aStr, SCA_ABS_3D, pDoc, eConv );
+         aEdDestArea.SetText( aStr );
+     }
+ 	else
+@@ -248,7 +249,7 @@
+ 		ScAreaNameIterator aIter( pDoc );
+ 		while ( aIter.Next( aStrName, aRange ) )
+ 		{
+-			aRange.Format( aStrArea, SCA_ABS_3D, pDoc );
++			aRange.Format( aStrArea, SCA_ABS_3D, pDoc, eConv );
+ 			pAreaData[nAt++].Set( aStrName, aStrArea, aIter.WasDBName() );
+ 		}
+ 	}
+@@ -305,14 +306,15 @@
+ 
+ 		String		aStr;
+ 		USHORT	 	nFmt = SCR_ABS_3D;		 //!!! nCurTab fehlt noch
++        const ScAddress::Convention eConv = pDocP->GetAddressConvention();
+ 
+ 		if ( rRef.aStart.Tab() != rRef.aEnd.Tab() )
+ 			nFmt |= SCA_TAB2_3D;
+ 
+ 		if ( pRefInputEdit == &aEdDataArea)
+-            rRef.Format( aStr, nFmt, pDocP );
++            rRef.Format( aStr, nFmt, pDocP, eConv );
+ 		else if ( pRefInputEdit == &aEdDestArea )
+-            rRef.aStart.Format( aStr, nFmt, pDocP );
++            rRef.aStart.Format( aStr, nFmt, pDocP, eConv );
+ 
+ 		pRefInputEdit->SetRefString( aStr );
+ 	}
+@@ -369,11 +371,12 @@
+ 	SCTAB	nTab	= pViewData->GetTabNo();
+ 	BOOL	bEditOk = FALSE;
+ 	String	theCompleteStr;
++    const ScAddress::Convention eConv = pDoc->GetAddressConvention();
+ 
+ 	if ( pEd == &aEdDataArea )
+ 	{
+ 		bEditOk = pRangeUtil->IsAbsArea( pEd->GetText(), pDoc,
+-										 nTab, &theCompleteStr );
++										 nTab, &theCompleteStr, NULL, NULL, eConv );
+ 	}
+ 	else if ( pEd == &aEdDestArea )
+ 	{
+@@ -381,7 +384,7 @@
+ 
+ 		pRangeUtil->CutPosString( pEd->GetText(), aPosStr );
+ 		bEditOk = pRangeUtil->IsAbsPos( aPosStr, pDoc,
+-										nTab, &theCompleteStr );
++										nTab, &theCompleteStr, NULL, eConv );
+ 	}
+ 
+ 	if ( bEditOk )
+@@ -425,8 +428,9 @@
+ 		ScRefAddress aDestAddress;
+ 		SCTAB		nTab = pViewData->GetTabNo();
+ 		String		aDestPosStr( aEdDestArea.GetText() );
++        const ScAddress::Convention eConv = pDoc->GetAddressConvention();
+ 
+-		if ( pRangeUtil->IsAbsPos( aDestPosStr, pDoc, nTab, NULL, &aDestAddress ) )
++		if ( pRangeUtil->IsAbsPos( aDestPosStr, pDoc, nTab, NULL, &aDestAddress, eConv ) )
+ 		{
+ 			ScConsolidateParam	theOutParam( theConsData );
+ 			ScArea**			ppDataAreas = new ScArea*[nDataAreaCount];
+@@ -437,7 +441,7 @@
+ 			{
+ 				pArea = new ScArea;
+ 				pRangeUtil->MakeArea( aLbConsAreas.GetEntry( i ),
+-									  *pArea, pDoc, nTab );
++									  *pArea, pDoc, nTab, eConv );
+ 				ppDataAreas[i] = pArea;
+ 			}
+ 
+@@ -488,8 +492,9 @@
+ 			String		aNewEntry( aEdDataArea.GetText() );
+ 			ScArea**	ppAreas = NULL;
+ 			USHORT		nAreaCount = 0;
++            const ScAddress::Convention eConv = pDoc->GetAddressConvention();
+ 
+-			if ( pRangeUtil->IsAbsTabArea( aNewEntry, pDoc, &ppAreas, &nAreaCount, TRUE ) )
++			if ( pRangeUtil->IsAbsTabArea( aNewEntry, pDoc, &ppAreas, &nAreaCount, TRUE, eConv ) )
+ 			{
+ 				// IsAbsTabArea() legt ein Array von ScArea-Zeigern an,
+ 				// welche ebenfalls dynamisch erzeugt wurden.
+@@ -504,7 +509,7 @@
+                         const ScArea& rArea = *(ppAreas[i]);
+                         ScRange( rArea.nColStart, rArea.nRowStart, rArea.nTab,
+                                 rArea.nColEnd, rArea.nRowEnd, rArea.nTab
+-                                ).Format( aNewArea, SCR_ABS_3D, pDoc );
++                                ).Format( aNewArea, SCR_ABS_3D, pDoc, eConv );
+ 
+ 						if ( aLbConsAreas.GetEntryPos( aNewArea )
+ 							 == LISTBOX_ENTRY_NOTFOUND )
+Index: sc/source/ui/dbgui/dbnamdlg.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/dbgui/dbnamdlg.cxx,v
+retrieving revision 1.8
+retrieving revision 1.8.314.2
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.8 -r1.8.314.2
+--- sc/source/ui/dbgui/dbnamdlg.cxx	27 Feb 2007 13:02:23 -0000	1.8
++++ sc/source/ui/dbgui/dbnamdlg.cxx	20 Mar 2008 23:20:04 -0000	1.8.314.2
+@@ -189,6 +189,7 @@
+ 		pViewData		( ptrViewData ),
+ 		pDoc			( ptrViewData->GetDocument() ),
+ 		bRefInputMode	( FALSE ),
++        aAddrDetails    ( pDoc->GetAddressConvention(), 0, 0 ),
+ 		aLocalDbCol		( *(pDoc->GetDBCollection()) )
+ {
+ 	// WB_NOLABEL can't be set in resource...
+@@ -263,7 +264,7 @@
+ 		theCurArea = ScRange( ScAddress( nStartCol, nStartRow, nStartTab ),
+ 							  ScAddress( nEndCol,   nEndRow,   nEndTab ) );
+ 
+-		theCurArea.Format( theAreaStr, ABS_DREF3D, pDoc );
++		theCurArea.Format( theAreaStr, ABS_DREF3D, pDoc, aAddrDetails );
+ 
+ 		if ( pDBColl )
+ 		{
+@@ -342,7 +343,7 @@
+ 		theCurArea = rRef;
+ 
+ 		String aRefStr;
+-        theCurArea.Format( aRefStr, ABS_DREF3D, pDocP );
++        theCurArea.Format( aRefStr, ABS_DREF3D, pDocP, aAddrDetails );
+ 		aEdAssign.SetRefString( aRefStr );
+ 		aBtnHeader.Enable();
+ 		aBtnDoSize.Enable();
+@@ -437,7 +438,7 @@
+ 		pData->GetArea( nTab, nColStart, nRowStart, nColEnd, nRowEnd );
+ 		theCurArea = ScRange( ScAddress( nColStart, nRowStart, nTab ),
+ 							  ScAddress( nColEnd,	nRowEnd,   nTab ) );
+-		theCurArea.Format( theArea, ABS_DREF3D, pDoc );
++		theCurArea.Format( theArea, ABS_DREF3D, pDoc, aAddrDetails );
+ 		aEdAssign.SetText( theArea );
+ 		aBtnAdd.SetText( aStrModify );
+ 		aBtnHeader.Check( pData->HasHeader() );
+@@ -511,7 +512,7 @@
+ 			//	weil jetzt editiert werden kann, muss erst geparst werden
+ 			ScRange aTmpRange;
+ 			String aText = aEdAssign.GetText();
+-			if ( aTmpRange.ParseAny( aText, pDoc ) & SCA_VALID )
++			if ( aTmpRange.ParseAny( aText, pDoc, aAddrDetails ) & SCA_VALID )
+ 			{
+ 				theCurArea = aTmpRange;
+ 				ScAddress aStart = theCurArea.aStart;
+@@ -730,7 +731,7 @@
+ 
+ 	ScRange aTmpRange;
+ 	String aText = aEdAssign.GetText();
+-	if ( aTmpRange.ParseAny( aText, pDoc ) & SCA_VALID )
++	if ( aTmpRange.ParseAny( aText, pDoc, aAddrDetails ) & SCA_VALID )
+ 		theCurArea = aTmpRange;
+ 
+ 	return 0;
+Index: sc/source/ui/dbgui/filtdlg.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/dbgui/filtdlg.cxx,v
+retrieving revision 1.15
+retrieving revision 1.15.70.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.15 -r1.15.70.1
+--- sc/source/ui/dbgui/filtdlg.cxx	29 Jan 2008 15:40:34 -0000	1.15
++++ sc/source/ui/dbgui/filtdlg.cxx	20 Mar 2008 23:20:04 -0000	1.15.70.1
+@@ -316,7 +316,7 @@
+ 		if ( rRef.aStart != rRef.aEnd )
+ 			RefInputStart( &aEdCopyArea );
+ 		String aRefStr;
+-        rRef.aStart.Format( aRefStr, SCA_ABS_3D, pDocP );
++        rRef.aStart.Format( aRefStr, SCA_ABS_3D, pDocP, pDocP->GetAddressConvention() );
+ 		aEdCopyArea.SetRefString( aRefStr );
+ 	}
+ }
+@@ -545,7 +545,7 @@
+ 		if ( STRING_NOTFOUND != nColonPos )
+ 			theCopyStr.Erase( nColonPos );
+ 
+-		USHORT nResult = theCopyPos.Parse( theCopyStr, pDoc );
++		USHORT nResult = theCopyPos.Parse( theCopyStr, pDoc, pDoc->GetAddressConvention() );
+ 		bCopyPosOk = ( SCA_VALID == (nResult & SCA_VALID) );
+ 	}
+ 
+Index: sc/source/ui/dbgui/foptmgr.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/dbgui/foptmgr.cxx,v
+retrieving revision 1.6
+retrieving revision 1.6.314.2
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.6 -r1.6.314.2
+--- sc/source/ui/dbgui/foptmgr.cxx	27 Feb 2007 13:03:27 -0000	1.6
++++ sc/source/ui/dbgui/foptmgr.cxx	21 Mar 2008 03:44:02 -0000	1.6.314.2
+@@ -153,8 +153,9 @@
+ 		ScDBCollection*	pDBColl		= pDoc->GetDBCollection();
+ 		String			theDbArea;
+ 		String			theDbName	= rStrNoName;
++        const ScAddress::Convention eConv = pDoc->GetAddressConvention();
+ 
+-		theCurArea.Format( theAreaStr, SCR_ABS_3D, pDoc );
++		theCurArea.Format( theAreaStr, SCR_ABS_3D, pDoc, eConv );
+ 
+ 		// Zielbereichsliste fuellen
+ 
+@@ -169,7 +170,7 @@
+ 		{
+ 			USHORT nInsert = rLbCopyPos.InsertEntry( aName );
+ 
+-			aRange.aStart.Format( aRefStr, SCA_ABS_3D, pDoc );
++			aRange.aStart.Format( aRefStr, SCA_ABS_3D, pDoc, eConv );
+ 			rLbCopyPos.SetEntryData( nInsert, new String( aRefStr ) );
+ 		}
+ 
+@@ -218,7 +219,7 @@
+ 			ScAddress( rQueryData.nDestCol,
+ 					   rQueryData.nDestRow,
+ 					   rQueryData.nDestTab
+-					 ).Format( aString, SCA_ABS_3D, pDoc );
++					 ).Format( aString, SCA_ABS_3D, pDoc, eConv );
+ 
+ 			rBtnCopyResult.Check( TRUE );
+ 			rEdCopyPos.SetText( aString );
+@@ -253,7 +254,7 @@
+ 	if ( STRING_NOTFOUND != nColonPos )
+ 		aPosStr.Erase( nColonPos );
+ 
+-	USHORT nResult = ScAddress().Parse( aPosStr, pDoc );
++	USHORT nResult = ScAddress().Parse( aPosStr, pDoc, pDoc->GetAddressConvention() );
+ 
+ 	return ( SCA_VALID == (nResult & SCA_VALID) );
+ }
+@@ -288,7 +289,7 @@
+ 	if ( pEd == &rEdCopyPos )
+ 	{
+ 		String	theCurPosStr = pEd->GetText();
+-		USHORT	nResult = ScAddress().Parse( theCurPosStr, pDoc );
++		USHORT	nResult = ScAddress().Parse( theCurPosStr, pDoc, pDoc->GetAddressConvention() );
+ 
+ 		if ( SCA_VALID == (nResult & SCA_VALID) )
+ 		{
+Index: sc/source/ui/dbgui/pfiltdlg.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/dbgui/pfiltdlg.cxx,v
+retrieving revision 1.9
+retrieving revision 1.9.314.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.9 -r1.9.314.1
+--- sc/source/ui/dbgui/pfiltdlg.cxx	27 Feb 2007 13:03:51 -0000	1.9
++++ sc/source/ui/dbgui/pfiltdlg.cxx	20 Mar 2008 23:20:04 -0000	1.9.314.1
+@@ -192,7 +192,7 @@
+ 		 * Bereich um einen Datenbankbereich handelt:
+ 		 */
+ 
+-		theCurArea.Format( theAreaStr, SCR_ABS_3D, pDoc );
++		theCurArea.Format( theAreaStr, SCR_ABS_3D, pDoc, pDoc->GetAddressConvention() );
+ 
+ 		if ( pDBColl )
+ 		{
+Index: sc/source/ui/dbgui/sfiltdlg.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/dbgui/sfiltdlg.cxx,v
+retrieving revision 1.12
+retrieving revision 1.12.314.2
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.12 -r1.12.314.2
+--- sc/source/ui/dbgui/sfiltdlg.cxx	27 Feb 2007 13:05:11 -0000	1.12
++++ sc/source/ui/dbgui/sfiltdlg.cxx	21 Mar 2008 03:54:21 -0000	1.12.314.2
+@@ -197,7 +197,7 @@
+ 		if (rQueryItem.GetAdvancedQuerySource(aAdvSource))
+ 		{
+ 			String aRefStr;
+-			aAdvSource.Format( aRefStr, SCR_ABS_3D, pDoc );
++			aAdvSource.Format( aRefStr, SCR_ABS_3D, pDoc, pDoc->GetAddressConvention() );
+ 			aEdFilterArea.SetRefString( aRefStr );
+ 		}
+ 	}
+@@ -260,11 +260,12 @@
+ 			RefInputStart( pRefInputEdit );
+ 
+ 		String aRefStr;
++        const ScAddress::Convention eConv = pDocP->GetAddressConvention();
+ 
+ 		if ( pRefInputEdit == &aEdCopyArea)
+-			rRef.aStart.Format( aRefStr, SCA_ABS_3D, pDocP );
++			rRef.aStart.Format( aRefStr, SCA_ABS_3D, pDocP, eConv );
+ 		else if ( pRefInputEdit == &aEdFilterArea)
+-			rRef.Format( aRefStr, SCR_ABS_3D, pDocP );
++			rRef.Format( aRefStr, SCR_ABS_3D, pDocP, eConv );
+ 
+ 		pRefInputEdit->SetRefString( aRefStr );
+ 	}
+@@ -334,6 +335,7 @@
+ 		BOOL			bEditInputOk	= TRUE;
+ 		BOOL			bQueryOk		= FALSE;
+ 		ScRange			theFilterArea;
++        const ScAddress::Convention eConv = pDoc->GetAddressConvention();
+ 
+ 		if ( aBtnCopyResult.IsChecked() )
+ 		{
+@@ -342,7 +344,7 @@
+ 			if ( STRING_NOTFOUND != nColonPos )
+ 				theCopyStr.Erase( nColonPos );
+ 
+-			USHORT nResult = theAdrCopy.Parse( theCopyStr, pDoc );
++			USHORT nResult = theAdrCopy.Parse( theCopyStr, pDoc, eConv );
+ 
+ 			if ( SCA_VALID != (nResult & SCA_VALID) )
+ 			{
+@@ -357,7 +359,7 @@
+ 
+ 		if ( bEditInputOk )
+ 		{
+-			USHORT nResult = ScRange().Parse( theAreaStr, pDoc );
++			USHORT nResult = ScRange().Parse( theAreaStr, pDoc, eConv );
+ 
+ 			if ( SCA_VALID != (nResult & SCA_VALID) )
+ 			{
+@@ -375,7 +377,7 @@
+ 			 * ein ScQueryParam zu erzeugen:
+ 			 */
+ 
+-			USHORT	nResult = theFilterArea.Parse( theAreaStr, pDoc );
++			USHORT	nResult = theFilterArea.Parse( theAreaStr, pDoc, eConv );
+ 
+ 			if ( SCA_VALID == (nResult & SCA_VALID) )
+ 			{
+Index: sc/source/ui/dbgui/tpsort.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/dbgui/tpsort.cxx,v
+retrieving revision 1.12
+retrieving revision 1.12.314.3
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.12 -r1.12.314.3
+--- sc/source/ui/dbgui/tpsort.cxx	27 Feb 2007 13:05:23 -0000	1.12
++++ sc/source/ui/dbgui/tpsort.cxx	21 Mar 2008 03:30:33 -0000	1.12.314.3
+@@ -633,6 +633,7 @@
+ 		String			theDbArea;
+ 		String			theDbName	= aStrNoName;
+ 		const SCTAB	nCurTab		= pViewData->GetTabNo();
++        const ScAddress::Convention eConv = pDoc->GetAddressConvention();
+ 
+ 		aLbOutPos.Clear();
+ 		aLbOutPos.InsertEntry( aStrUndefined, 0 );
+@@ -646,7 +647,7 @@
+ 		{
+ 			USHORT nInsert = aLbOutPos.InsertEntry( aName );
+ 
+-			aRange.aStart.Format( aRefStr, SCA_ABS_3D, pDoc );
++			aRange.aStart.Format( aRefStr, SCA_ABS_3D, pDoc, eConv );
+ 			aLbOutPos.SetEntryData( nInsert, new String( aRefStr ) );
+ 		}
+ 
+@@ -661,7 +662,7 @@
+ 		ScAddress aScAddress( rSortData.nCol1, rSortData.nRow1, nCurTab );
+ 		ScRange( aScAddress,
+ 				 ScAddress( rSortData.nCol2, rSortData.nRow2, nCurTab )
+-			   ).Format( theArea, SCR_ABS, pDoc );
++			   ).Format( theArea, SCR_ABS, pDoc, eConv );
+ 
+ 		if ( pDBColl )
+ 		{
+@@ -762,7 +763,7 @@
+ 					   rSortData.nDestRow,
+ 					   rSortData.nDestTab );
+ 
+-		theOutPos.Format( aStr, nFormat, pDoc );
++		theOutPos.Format( aStr, nFormat, pDoc, pDoc->GetAddressConvention() );
+ 		aBtnCopyResult.Check();
+ 		aLbOutPos.Enable();
+ 		aEdOutPos.Enable();
+@@ -874,7 +875,7 @@
+ 			thePos.SetTab( pViewData->GetTabNo() );
+ 		}
+ 
+-		USHORT nResult = thePos.Parse( thePosStr, pDoc );
++		USHORT nResult = thePos.Parse( thePosStr, pDoc, pDoc->GetAddressConvention() );
+ 
+ 		bPosInputOk = ( SCA_VALID == (nResult & SCA_VALID) );
+ 
+@@ -993,7 +994,7 @@
+ 	if ( pEd == &aEdOutPos )
+ 	{
+ 		String	theCurPosStr = aEdOutPos.GetText();
+-		USHORT	nResult = ScAddress().Parse( theCurPosStr, pDoc );
++		USHORT	nResult = ScAddress().Parse( theCurPosStr, pDoc, pDoc->GetAddressConvention() );
+ 
+ 		if ( SCA_VALID == (nResult & SCA_VALID) )
+ 		{
+Index: sc/source/ui/docshell/arealink.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/docshell/arealink.cxx,v
+retrieving revision 1.26
+retrieving revision 1.26.224.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.26 -r1.26.224.1
+--- sc/source/ui/docshell/arealink.cxx	6 Jul 2007 12:41:42 -0000	1.26
++++ sc/source/ui/docshell/arealink.cxx	20 Mar 2008 23:20:14 -0000	1.26.224.1
+@@ -233,7 +233,8 @@
+ 	}
+ 	if (!bFound)		// direct reference (range or cell)
+ 	{
+-		if ( rRange.ParseAny( rAreaName, pSrcDoc ) & SCA_VALID )
++        ScAddress::Details aDetails(pSrcDoc->GetAddressConvention(), 0, 0);
++		if ( rRange.ParseAny( rAreaName, pSrcDoc, aDetails ) & SCA_VALID )
+ 			bFound = TRUE;
+ 	}
+ 	return bFound;
+Index: sc/source/ui/docshell/docfunc.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/docshell/docfunc.cxx,v
+retrieving revision 1.68
+retrieving revision 1.68.12.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.68 -r1.68.12.1
+--- sc/source/ui/docshell/docfunc.cxx	6 Mar 2008 16:11:13 -0000	1.68
++++ sc/source/ui/docshell/docfunc.cxx	19 Mar 2008 17:37:12 -0000	1.68.12.1
+@@ -2229,21 +2229,21 @@
+ 	return TRUE;
+ }
+ 
+-BOOL ScDocFunc::SetAddressConvention( ScAddress::Convention eConv )
++BOOL ScDocFunc::SetGrammar( ScGrammar::Grammar eGrammar )
+ {
+ 	ScDocument* pDoc = rDocShell.GetDocument();
+ 
+-	if ( pDoc->GetAddressConvention() == eConv )
++	if ( pDoc->GetGrammar() == eGrammar )
+ 		return TRUE;
+ 
+ 	BOOL bUndo(pDoc->IsUndoEnabled());
+ 	ScDocShellModificator aModificator( rDocShell );
+ 
+-	pDoc->SetAddressConvention( eConv );
++	pDoc->SetGrammar( eGrammar );
+ 
+ 	if (bUndo)
+ 	{
+-		rDocShell.GetUndoManager()->AddUndoAction( new ScUndoSetAddressConvention( &rDocShell, eConv ) );
++		rDocShell.GetUndoManager()->AddUndoAction( new ScUndoSetGrammar( &rDocShell, eGrammar ) );
+ 	}
+ 
+ 	rDocShell.PostPaint( 0,0,0,MAXCOL,MAXROW,MAXTAB, PAINT_ALL );
+Index: sc/source/ui/docshell/docsh4.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/docshell/docsh4.cxx,v
+retrieving revision 1.59
+retrieving revision 1.59.12.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.59 -r1.59.12.1
+--- sc/source/ui/docshell/docsh4.cxx	7 Mar 2008 12:20:01 -0000	1.59
++++ sc/source/ui/docshell/docsh4.cxx	20 Mar 2008 23:20:14 -0000	1.59.12.1
+@@ -302,7 +302,7 @@
+ 					if ( !pDBColl || !pDBColl->SearchName( sTarget, nDummy ) )
+ 					{
+ 						ScAddress aPos;
+-						if ( aPos.Parse( sTarget, &aDocument ) & SCA_VALID )
++						if ( aPos.Parse( sTarget, &aDocument, aDocument.GetAddressConvention() ) & SCA_VALID )
+ 						{
+ 							bMakeArea = TRUE;
+ 							if (bUndo)
+@@ -389,7 +389,8 @@
+ 					bRowInit = TRUE;
+ 				}
+ 
+-				BOOL bValid = ( aSingleRange.ParseAny( aRangeName, pDoc ) & SCA_VALID ) != 0;
++                ScAddress::Details aDetails(pDoc->GetAddressConvention(), 0, 0);
++				BOOL bValid = ( aSingleRange.ParseAny( aRangeName, pDoc, aDetails ) & SCA_VALID ) != 0;
+ 				if (!bValid)
+ 				{
+ 					aRangeListRef = new ScRangeList;
+@@ -2411,8 +2412,9 @@
+ 		}
+ 	}
+ 	ScRange aRange;
+-	BOOL bValid = ( ( aRange.Parse( aPos, &aDocument ) & SCA_VALID ) ||
+-					( aRange.aStart.Parse( aPos, &aDocument ) & SCA_VALID ) );
++    ScAddress::Convention eConv = aDocument.GetAddressConvention();
++	BOOL bValid = ( ( aRange.Parse( aPos, &aDocument, eConv ) & SCA_VALID ) ||
++					( aRange.aStart.Parse( aPos, &aDocument, eConv ) & SCA_VALID ) );
+ 
+ 	ScServerObject* pObj = NULL;			// NULL = error
+ 	if ( bValid )
+Index: sc/source/ui/docshell/impex.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/docshell/impex.cxx,v
+retrieving revision 1.41
+retrieving revision 1.41.12.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.41 -r1.41.12.1
+--- sc/source/ui/docshell/impex.cxx	6 Mar 2008 16:13:00 -0000	1.41
++++ sc/source/ui/docshell/impex.cxx	20 Mar 2008 23:20:14 -0000	1.41.12.1
+@@ -190,11 +190,12 @@
+ 				pData->GetSymbol( aPos );					// mit dem Inhalt weitertesten
+ 		}
+ 	}
++    ScAddress::Convention eConv = pDoc->GetAddressConvention();
+ 	// Bereich?
+-	if( aRange.Parse( aPos, pDoc ) & SCA_VALID )
++	if( aRange.Parse( aPos, pDoc, eConv ) & SCA_VALID )
+ 		bSingle = FALSE;
+ 	// Zelle?
+-	else if( aRange.aStart.Parse( aPos, pDoc ) & SCA_VALID )
++	else if( aRange.aStart.Parse( aPos, pDoc, eConv ) & SCA_VALID )
+ 		aRange.aEnd = aRange.aStart;
+ 	else
+ 		bAll = TRUE;
+@@ -528,7 +529,7 @@
+ 			String aRefName;
+ 			USHORT nFlags = SCA_VALID | SCA_TAB_3D;
+ 			if( bSingle )
+-				aRange.aStart.Format( aRefName, nFlags, pDoc );
++				aRange.aStart.Format( aRefName, nFlags, pDoc, pDoc->GetAddressConvention() );
+ 			else
+ 			{
+ 				if( aRange.aStart.Tab() != aRange.aEnd.Tab() )
+Index: sc/source/ui/docshell/servobj.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/docshell/servobj.cxx,v
+retrieving revision 1.9
+retrieving revision 1.9.314.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.9 -r1.9.314.1
+--- sc/source/ui/docshell/servobj.cxx	27 Feb 2007 13:09:43 -0000	1.9
++++ sc/source/ui/docshell/servobj.cxx	20 Mar 2008 23:20:14 -0000	1.9.314.1
+@@ -109,7 +109,7 @@
+ 		{
+ 			// area reference
+ 		}
+-		else if ( aRange.aStart.Parse( rItem, pDoc ) & SCA_VALID )
++		else if ( aRange.aStart.Parse( rItem, pDoc, pDoc->GetAddressConvention() ) & SCA_VALID )
+ 		{
+ 			// cell reference
+ 			aRange.aEnd = aRange.aStart;
+Index: sc/source/ui/drawfunc/fuins2.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/drawfunc/fuins2.cxx,v
+retrieving revision 1.27
+retrieving revision 1.27.210.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.27 -r1.27.210.1
+--- sc/source/ui/drawfunc/fuins2.cxx	25 Jul 2007 08:09:23 -0000	1.27
++++ sc/source/ui/drawfunc/fuins2.cxx	20 Mar 2008 23:20:20 -0000	1.27.210.1
+@@ -182,7 +182,7 @@
+             {
+                 pScDoc->LimitChartIfAll( aRangeListRef );               // limit whole columns/rows to used area
+                 String aTmpStr;                            
+-                aRangeListRef->Format( aTmpStr, SCR_ABS_3D, pScDoc );   // update string from changed ranges
++                aRangeListRef->Format( aTmpStr, SCR_ABS_3D, pScDoc, pScDoc->GetAddressConvention() );   // update string from changed ranges
+                 aRangeString = aTmpStr;
+ 
+                 ScChartPositioner aChartPositioner( pScDoc, aRangeListRef );
+Index: sc/source/ui/formdlg/formula.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/formdlg/formula.cxx,v
+retrieving revision 1.17
+retrieving revision 1.17.12.4
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.17 -r1.17.12.4
+--- sc/source/ui/formdlg/formula.cxx	7 Mar 2008 11:19:41 -0000	1.17
++++ sc/source/ui/formdlg/formula.cxx	20 Mar 2008 23:20:27 -0000	1.17.12.4
+@@ -228,7 +228,7 @@
+ 		aMEFormula.UpdateOldSel();
+ 
+ 		pCell = new ScFormulaCell( pDoc, aCursorPos, rStrExp );
+-		pComp=new ScCompiler( pDoc, aCursorPos );
++		pComp=new ScCompiler( pDoc, aCursorPos, pDoc->GetGrammar() );
+ 		pComp->SetCompileForFAP(TRUE);
+ 		UpdateTokenArray(pMEdit->GetText());
+ 		FormulaCursorHdl(&aMEFormula);
+@@ -351,7 +351,7 @@
+ 		pData->SetMode( (USHORT) eMode );
+ 		rStrExp=pMEdit->GetText();
+ 		pCell = new ScFormulaCell( pDoc, aCursorPos, rStrExp );
+-		pComp=new ScCompiler( pDoc, aCursorPos );
++		pComp=new ScCompiler( pDoc, aCursorPos, pDoc->GetGrammar() );
+ 		pComp->SetCompileForFAP(TRUE);
+ 		CalcStruct(rStrExp);
+ 		FillDialog();
+@@ -1070,8 +1070,6 @@
+ 		{
+ 			ScFormulaCell* pFCell = new ScFormulaCell( pDoc, aCursorPos, rStrExp );
+ 
+-			ScCompiler*	pCompi=new ScCompiler( pDoc, aCursorPos, *(pFCell->GetCode()));
+-
+ 			// #35521# HACK! um bei ColRowNames kein #REF! zu bekommen,
+ 			// wenn ein Name eigentlich als Bereich in die Gesamt-Formel
+ 			// eingefuegt wird, bei der Einzeldarstellung aber als
+@@ -1131,7 +1129,6 @@
+ 			}
+ 
+ 			delete pFCell;
+-			delete pCompi;
+ 		}
+ 		else
+ 			bResult = FALSE;
+@@ -1528,7 +1525,7 @@
+ 			USHORT nFmt = ( rRef.aStart.Tab() == aCursorPos.Tab() )
+ 								? SCA_VALID
+ 								: SCA_VALID | SCA_TAB_3D;
+-			rRef.Format( aRefStr, nFmt, pRefDoc );
++			rRef.Format( aRefStr, nFmt, pRefDoc, pRefDoc->GetAddressConvention() );
+ 		}
+ 
+ 		aEdRef.ReplaceSelected( aRefStr );
+@@ -1650,6 +1647,8 @@
+ 
+ xub_StrLen ScFormulaDlg::GetFunctionPos(xub_StrLen nPos)
+ {
++    const sal_Unicode sep = ScCompiler::GetStringFromOpCode(ocSep).GetChar(0);
++
+ 	xub_StrLen nTokPos=1;
+ 	xub_StrLen nOldTokPos=1;
+ 	xub_StrLen nFuncPos=STRING_NOTFOUND;    //@ Testweise
+@@ -1675,7 +1674,7 @@
+ 
+ 			if(eOp==ocPush || eOp==ocSpaces)
+ 			{
+-				xub_StrLen n1=aFormString.Search(';',nTokPos);
++				xub_StrLen n1=aFormString.Search(sep, nTokPos);
+ 				xub_StrLen n2=aFormString.Search(')',nTokPos);
+ 				xub_StrLen nXXX=nTokPos;
+ 				if(n1<n2)
+Index: sc/source/ui/inc/crnrdlg.hxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/inc/crnrdlg.hxx,v
+retrieving revision 1.4
+retrieving revision 1.4.684.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.4 -r1.4.684.1
+--- sc/source/ui/inc/crnrdlg.hxx	8 Sep 2005 21:17:31 -0000	1.4
++++ sc/source/ui/inc/crnrdlg.hxx	21 Mar 2008 17:25:56 -0000	1.4.684.1
+@@ -52,6 +52,7 @@
+ #include <vcl/lstbox.hxx>
+ #endif
+ 
++#include <hash_map>
+ 
+ class ScViewData;
+ class ScDocument;
+@@ -96,6 +97,8 @@
+ 	ScRangePairListRef	xColNameRanges;
+ 	ScRangePairListRef	xRowNameRanges;
+ 
++    typedef ::std::hash_map< String, ScRange, ScStringHashCode, ::std::equal_to<String> > NameRangeMap;
++    NameRangeMap    aRangeMap;
+ 	ScViewData*		pViewData;
+ 	ScDocument*		pDoc;
+ 	ScRefEdit*		pEdActive;
+@@ -105,7 +108,7 @@
+ private:
+ 	void Init				();
+ 	void UpdateNames		();
+-	void UpdateRangeData	( const String& rStrName, BOOL bColName );
++	void UpdateRangeData	( const ScRange& rRange, BOOL bColName );
+ 	void SetColRowData( const ScRange& rLabelRange,BOOL bRef=FALSE);
+ 	void AdjustColRowData( const ScRange& rDataRange,BOOL bRef=FALSE);
+ 	DECL_LINK( CancelBtnHdl, void * );
+Index: sc/source/ui/inc/dbnamdlg.hxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/inc/dbnamdlg.hxx,v
+retrieving revision 1.3
+retrieving revision 1.3.684.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.3 -r1.3.684.1
+--- sc/source/ui/inc/dbnamdlg.hxx	8 Sep 2005 21:20:20 -0000	1.3
++++ sc/source/ui/inc/dbnamdlg.hxx	20 Mar 2008 04:38:05 -0000	1.3.684.1
+@@ -116,6 +116,7 @@
+ 	ScViewData*		pViewData;
+ 	ScDocument*		pDoc;
+ 	BOOL			bRefInputMode;
++    ScAddress::Details aAddrDetails;
+ 
+ 	ScDBCollection	aLocalDbCol;
+ 	ScRange			theCurArea;
+Index: sc/source/ui/inc/docfunc.hxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/inc/docfunc.hxx,v
+retrieving revision 1.17
+retrieving revision 1.17.12.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.17 -r1.17.12.1
+--- sc/source/ui/inc/docfunc.hxx	6 Mar 2008 16:13:54 -0000	1.17
++++ sc/source/ui/inc/docfunc.hxx	19 Mar 2008 17:37:13 -0000	1.17.12.1
+@@ -134,7 +134,7 @@
+ 
+ 	BOOL			SetLayoutRTL( SCTAB nTab, BOOL bRTL, BOOL bApi );
+ 
+-	BOOL	 	    SetAddressConvention( ScAddress::Convention eConv );
++	BOOL	 	    SetGrammar( ScGrammar::Grammar eGrammar );
+ 
+ 	SC_DLLPUBLIC BOOL			SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRanges,
+ 									SCTAB nTab, ScSizeMode eMode, USHORT nSizeTwips,
+Index: sc/source/ui/inc/undotab.hxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/inc/undotab.hxx,v
+retrieving revision 1.9
+retrieving revision 1.9.414.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.9 -r1.9.414.1
+--- sc/source/ui/inc/undotab.hxx	18 Oct 2006 12:28:14 -0000	1.9
++++ sc/source/ui/inc/undotab.hxx	19 Mar 2008 17:37:14 -0000	1.9.414.1
+@@ -60,6 +60,8 @@
+ 
+ #endif
+ 
++#include "grammar.hxx"
++
+ #ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
+ #include <com/sun/star/uno/Sequence.hxx>
+ #endif
+@@ -478,13 +480,13 @@
+ };
+ 
+ 
+-class ScUndoSetAddressConvention : public ScSimpleUndo
++class ScUndoSetGrammar : public ScSimpleUndo
+ {
+ public:
+ 					TYPEINFO();
+-					ScUndoSetAddressConvention( ScDocShell* pShell,
+-												ScAddress::Convention eConv );
+-	virtual			~ScUndoSetAddressConvention();
++                    ScUndoSetGrammar( ScDocShell* pShell,
++                                      ScGrammar::Grammar eGrammar );
++    virtual         ~ScUndoSetGrammar();
+ 
+ 	virtual void	Undo();
+ 	virtual void	Redo();
+@@ -494,9 +496,9 @@
+ 	virtual String	GetComment() const;
+ 
+ private:
+-	ScAddress::Convention eNewConv, eOldConv;
++    ScGrammar::Grammar meNewGrammar, meOldGrammar;
+ 
+-	void DoChange( ScAddress::Convention eConv );
++    void DoChange( ScGrammar::Grammar eGrammar );
+ };
+ 
+ #endif
+Index: sc/source/ui/miscdlgs/anyrefdg.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/miscdlgs/anyrefdg.cxx,v
+retrieving revision 1.20
+retrieving revision 1.20.62.3
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.20 -r1.20.62.3
+--- sc/source/ui/miscdlgs/anyrefdg.cxx	5 Feb 2008 15:46:57 -0000	1.20
++++ sc/source/ui/miscdlgs/anyrefdg.cxx	20 Mar 2008 23:20:34 -0000	1.20.62.3
+@@ -420,7 +420,7 @@
+ 
+ 		String rStrExp;
+ 		pRefCell = new ScFormulaCell( pDoc, aCursorPos, rStrExp );
+-		pRefComp=new ScCompiler( pDoc, aCursorPos );
++		pRefComp=new ScCompiler( pDoc, aCursorPos, pDoc->GetGrammar() );
+ 		pRefComp->SetCompileForFAP(TRUE);
+ 
+         nRefTab = nTab;
+@@ -637,6 +637,7 @@
+     bool bError = false;
+     rRanges.RemoveAll();
+ 
++    ScAddress::Details aDetails(pDoc->GetAddressConvention(), 0, 0);
+     ScRangeUtil aRangeUtil;
+     xub_StrLen nTokenCnt = rStr.GetTokenCount();
+     for( xub_StrLen nToken = 0; nToken < nTokenCnt; ++nToken )
+@@ -644,7 +645,7 @@
+         ScRange aRange;
+         String aRangeStr( rStr.GetToken( nToken ) );
+ 
+-        USHORT nFlags = aRange.ParseAny( aRangeStr, pDoc );
++        USHORT nFlags = aRange.ParseAny( aRangeStr, pDoc, aDetails );
+         if ( nFlags & SCA_VALID )
+         {
+             if ( (nFlags & SCA_TAB_3D) == 0 )
+@@ -653,7 +654,7 @@
+                 aRange.aEnd.SetTab( aRange.aStart.Tab() );
+             rRanges.Append( aRange );
+         }
+-        else if ( aRangeUtil.MakeRangeFromName( aRangeStr, pDoc, nRefTab, aRange, RUTL_NAMES ) )
++        else if ( aRangeUtil.MakeRangeFromName( aRangeStr, pDoc, nRefTab, aRange, RUTL_NAMES, aDetails ) )
+             rRanges.Append( aRange );
+         else
+             bError = true;        
+Index: sc/source/ui/miscdlgs/crnrdlg.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/miscdlgs/crnrdlg.cxx,v
+retrieving revision 1.9
+retrieving revision 1.9.314.2
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.9 -r1.9.314.2
+--- sc/source/ui/miscdlgs/crnrdlg.cxx	27 Feb 2007 13:30:03 -0000	1.9
++++ sc/source/ui/miscdlgs/crnrdlg.cxx	21 Mar 2008 17:26:03 -0000	1.9.314.2
+@@ -289,8 +289,9 @@
+ 	}
+ 	if ( bValid )
+ 	{
++        const ScAddress::Convention eConv = pDoc->GetAddressConvention();
+ 		String aStr;
+-		theCurArea.Format( aStr, SCR_ABS_3D, pDoc );
++		theCurArea.Format( aStr, SCR_ABS_3D, pDoc, eConv );
+ 
+ 		if(bRef)
+ 			aEdAssign.SetRefString( aStr );
+@@ -298,7 +299,7 @@
+ 			aEdAssign.SetText( aStr );
+ 
+ 		aEdAssign.SetSelection( Selection( SELECTION_MAX, SELECTION_MAX ) );
+-		theCurData.Format( aStr, SCR_ABS_3D, pDoc );
++		theCurData.Format( aStr, SCR_ABS_3D, pDoc, eConv );
+ 
+ 		if(bRef)
+ 			aEdAssign2.SetRefString( aStr );
+@@ -393,7 +394,7 @@
+ 		}
+ 	}
+ 	String aStr;
+-	theCurData.Format( aStr, SCR_ABS_3D, pDoc );
++	theCurData.Format( aStr, SCR_ABS_3D, pDoc, pDoc->GetAddressConvention() );
+ 
+ 	if(bRef)
+ 		aEdAssign2.SetRefString( aStr );
+@@ -514,6 +515,7 @@
+ 	aLbRange.SetUpdateMode( FALSE );
+ 	//-----------------------------------------------------------
+ 	aLbRange.Clear();
++    aRangeMap.clear();
+ 	aEdAssign.SetText( EMPTY_STRING );
+ 
+ 	ULONG nCount, j;
+@@ -527,6 +529,7 @@
+ 	SCTAB nTab2;
+ 	String rString;
+ 	String strShow;
++    const ScAddress::Details aDetails(pDoc->GetAddressConvention());
+ 
+ 	String aString;
+ 	String strDelim = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( " --- " ));
+@@ -541,7 +544,8 @@
+ 			nCount, pDoc );
+ 		for ( j=0; j < nCount; j++ )
+ 		{
+-			ppSortArray[j]->GetRange(0).Format( aString, SCR_ABS_3D, pDoc );
++            const ScRange aRange(ppSortArray[j]->GetRange(0));
++			aRange.Format( aString, SCR_ABS_3D, pDoc, aDetails );
+ 
+ 			//@008 Hole Bereichsparameter aus Dok
+ 			ppSortArray[j]->GetRange(0).GetVars( nCol1, nRow1, nTab1,
+@@ -571,6 +575,7 @@
+ 			String aInsStr = aString;
+ 			aInsStr += strShow;
+ 			nPos = aLbRange.InsertEntry( aInsStr );
++            aRangeMap.insert( NameRangeMap::value_type(aInsStr, aRange) );
+ 			aLbRange.SetEntryData( nPos, (void*)nEntryDataCol );
+ 		}
+ 		delete [] ppSortArray;
+@@ -586,7 +591,8 @@
+ 			nCount, pDoc );
+ 		for ( j=0; j < nCount; j++ )
+ 		{
+-			ppSortArray[j]->GetRange(0).Format( aString, SCR_ABS_3D, pDoc );
++            const ScRange aRange(ppSortArray[j]->GetRange(0));
++			aRange.Format( aString, SCR_ABS_3D, pDoc, aDetails );
+ 
+ 			//@008 Ab hier baue String fuer Zeilen
+ 			ppSortArray[j]->GetRange(0).GetVars( nCol1, nRow1, nTab1,
+@@ -614,6 +620,7 @@
+ 			String aInsStr = aString;
+ 			aInsStr += strShow;
+ 			nPos = aLbRange.InsertEntry( aInsStr );
++            aRangeMap.insert( NameRangeMap::value_type(aInsStr, aRange) );
+ 			aLbRange.SetEntryData( nPos, (void*)nEntryDataRow );
+ 		}
+ 		delete [] ppSortArray;
+@@ -639,40 +646,28 @@
+ #*
+ #************************************************************************/
+ 
+-void ScColRowNameRangesDlg::UpdateRangeData( const String& rRangeStr, BOOL bColName )
++void ScColRowNameRangesDlg::UpdateRangeData( const ScRange& rRange, BOOL bColName )
+ {
+-	ScRange aRange;
+-	String aRefString=rRangeStr;
+-
+-	//@008 Suchen nach Erweiterung u. rausschmeissen
+-	xub_StrLen nPosExt=rRangeStr.Search( '[',0 );
+-
+-	if(nPosExt!=STRING_NOTFOUND)
+-	{
+-		nPosExt--;
+-		aRefString.Erase(nPosExt);
+-	}
+-	aRange.ParseAny( aRefString, pDoc );
+-
+     ScRangePair* pPair = NULL;
+ 	BOOL bFound = FALSE;
+-    if ( bColName && (pPair = xColNameRanges->Find( aRange )) != NULL )
++    if ( bColName && (pPair = xColNameRanges->Find( rRange )) != NULL )
+ 		bFound = TRUE;
+-    else if ( !bColName && (pPair = xRowNameRanges->Find( aRange )) != NULL )
++    else if ( !bColName && (pPair = xRowNameRanges->Find( rRange )) != NULL )
+ 		bFound = TRUE;
+ 
+ 	if ( bFound )
+ 	{
++        const ScAddress::Convention eConv = pDoc->GetAddressConvention();
+ 		String aStr;
+-		theCurArea = aRange;
+-		theCurArea.Format( aStr, SCR_ABS_3D, pDoc );
++		theCurArea = rRange;
++		theCurArea.Format( aStr, SCR_ABS_3D, pDoc, eConv );
+ 		aEdAssign.SetText( aStr );
+ 		aBtnAdd.Disable();
+ 		aBtnRemove.Enable();
+ 		aBtnColHead.Check( bColName );
+ 		aBtnRowHead.Check( !bColName );
+ 		theCurData = pPair->GetRange(1);
+-		theCurData.Format( aStr, SCR_ABS_3D, pDoc );
++		theCurData.Format( aStr, SCR_ABS_3D, pDoc, eConv );
+ 		aEdAssign2.SetText( aStr );
+ 	}
+ 	else
+@@ -790,10 +785,11 @@
+ 
+ 	if ( aNewArea.Len() > 0 && aNewData.Len() > 0 )
+ 	{
++        const ScAddress::Convention eConv = pDoc->GetAddressConvention();
+ 		ScRange aRange1, aRange2;
+ 		BOOL bOk1;
+-        if ( (bOk1 = ((aRange1.ParseAny( aNewArea, pDoc ) & SCA_VALID) == SCA_VALID)) != FALSE
+-		  && ((aRange2.ParseAny( aNewData, pDoc ) & SCA_VALID) == SCA_VALID) )
++        if ( (bOk1 = ((aRange1.ParseAny( aNewArea, pDoc, eConv ) & SCA_VALID) == SCA_VALID)) != FALSE
++		  && ((aRange2.ParseAny( aNewData, pDoc, eConv ) & SCA_VALID) == SCA_VALID) )
+ 		{
+ 			theCurArea = aRange1;
+ 			AdjustColRowData( aRange2 );
+@@ -860,26 +856,16 @@
+ 	USHORT nSelectPos = aLbRange.GetSelectEntryPos();
+ 	BOOL bColName =
+ 		((ULONG)aLbRange.GetEntryData( nSelectPos ) == nEntryDataCol);
+-	ScRange aRange;
+-
+-	//@008 Suchen nach Erweiterung u. rausschmeissen
+-	String aRefString=aRangeStr;
+-
+-	xub_StrLen nPosExt=aRangeStr.Search( '[', 0 );
+-
+-	if(nPosExt!=STRING_NOTFOUND)
+-	{
+-		nPosExt--;
+-		aRefString.Erase(nPosExt);
+-	}
+-
+-	aRange.ParseAny( aRefString, pDoc );
++    NameRangeMap::const_iterator itr = aRangeMap.find(aRangeStr);
++    if (itr == aRangeMap.end())
++        return 0;
++    const ScRange& rRange = itr->second;
+ 
+     ScRangePair* pPair = NULL;
+ 	BOOL bFound = FALSE;
+-    if ( bColName && (pPair = xColNameRanges->Find( aRange )) != NULL )
++    if ( bColName && (pPair = xColNameRanges->Find( rRange )) != NULL )
+ 		bFound = TRUE;
+-    else if ( !bColName && (pPair = xRowNameRanges->Find( aRange )) != NULL )
++    else if ( !bColName && (pPair = xRowNameRanges->Find( rRange )) != NULL )
+ 		bFound = TRUE;
+ 	if ( bFound )
+ 	{
+@@ -971,11 +957,12 @@
+ 			aRangeStr = aLbRange.GetSelectEntry();
+ 		}
+ 	}
+-	if ( aRangeStr.Len() && aRangeStr.GetChar(0) == '$' )
++    NameRangeMap::const_iterator itr = aRangeMap.find(aRangeStr);
++    if ( itr != aRangeMap.end() )
+ 	{
+ 		BOOL bColName =
+ 			((ULONG)aLbRange.GetEntryData( nSelectPos ) == nEntryDataCol);
+-		UpdateRangeData( aRangeStr, bColName );
++		UpdateRangeData( itr->second, bColName );
+ 		aBtnAdd.Disable();
+ 		aBtnRemove.Enable();
+ 	}
+@@ -1035,7 +1022,7 @@
+ 	if ( aNewArea.Len() > 0 )
+ 	{
+ 		ScRange aRange;
+-		if ( (aRange.ParseAny( aNewArea, pDoc ) & SCA_VALID) == SCA_VALID )
++		if ( (aRange.ParseAny( aNewArea, pDoc, pDoc->GetAddressConvention() ) & SCA_VALID) == SCA_VALID )
+ 		{
+ 			SetColRowData( aRange );
+ 			bValid = TRUE;
+@@ -1083,7 +1070,7 @@
+ 	if ( aNewData.Len() > 0 )
+ 	{
+ 		ScRange aRange;
+-		if ( (aRange.ParseAny( aNewData, pDoc ) & SCA_VALID) == SCA_VALID )
++		if ( (aRange.ParseAny( aNewData, pDoc, pDoc->GetAddressConvention() ) & SCA_VALID) == SCA_VALID )
+ 		{
+ 			AdjustColRowData( aRange );
+ 			aBtnAdd.Enable();
+@@ -1125,7 +1112,7 @@
+ 		{
+ 			theCurArea.aEnd.SetRow( MAXROW - 1 );
+ 			String aStr;
+-			theCurArea.Format( aStr, SCR_ABS_3D, pDoc );
++			theCurArea.Format( aStr, SCR_ABS_3D, pDoc, pDoc->GetAddressConvention() );
+ 			aEdAssign.SetText( aStr );
+ 		}
+ 		ScRange aRange( theCurData );
+@@ -1163,7 +1150,7 @@
+ 		{
+ 			theCurArea.aEnd.SetCol( MAXCOL - 1 );
+ 			String aStr;
+-			theCurArea.Format( aStr, SCR_ABS_3D, pDoc );
++			theCurArea.Format( aStr, SCR_ABS_3D, pDoc, pDoc->GetAddressConvention() );
+ 			aEdAssign.SetText( aStr );
+ 		}
+ 		ScRange aRange( theCurData );
+Index: sc/source/ui/miscdlgs/highred.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/miscdlgs/highred.cxx,v
+retrieving revision 1.12
+retrieving revision 1.12.284.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.12 -r1.12.284.1
+--- sc/source/ui/miscdlgs/highred.cxx	26 Apr 2007 09:53:36 -0000	1.12
++++ sc/source/ui/miscdlgs/highred.cxx	20 Mar 2008 23:20:34 -0000	1.12.284.1
+@@ -198,7 +198,7 @@
+ 		if ( rRef.aStart != rRef.aEnd )
+ 			RefInputStart(&aEdAssign);
+ 		String aRefStr;
+-        rRef.Format( aRefStr, ABS_DREF3D, pDocP );
++        rRef.Format( aRefStr, ABS_DREF3D, pDocP, pDocP->GetAddressConvention() );
+ 		aEdAssign.SetRefString( aRefStr );
+ 		aFilterCtr.SetRange(aRefStr);
+ 	}
+Index: sc/source/ui/miscdlgs/optsolver.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/miscdlgs/optsolver.cxx,v
+retrieving revision 1.2
+retrieving revision 1.2.62.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.2 -r1.2.62.1
+--- sc/source/ui/miscdlgs/optsolver.cxx	5 Feb 2008 15:47:21 -0000	1.2
++++ sc/source/ui/miscdlgs/optsolver.cxx	20 Mar 2008 23:20:34 -0000	1.2.62.1
+@@ -387,7 +387,7 @@
+         maRbMax.Check();
+         String aCursorStr;
+         if ( !mpDoc->GetRangeAtBlock( ScRange(rCursorPos), &aCursorStr ) )
+-            rCursorPos.Format( aCursorStr, SCA_ABS );
++            rCursorPos.Format( aCursorStr, SCA_ABS, NULL, mpDoc->GetAddressConvention() );
+         maEdObjectiveCell.SetRefString( aCursorStr );
+         if ( nImplCount > 0 )
+             maEngine = maImplNames[0];  // use first implementation
+@@ -504,10 +504,11 @@
+             aStr = aName;
+         else                                                        // format cell/range reference
+         {
++            USHORT nFmt = ( aAdr.Tab() == mnCurTab ) ? SCA_ABS : SCA_ABS_3D;
+             if ( bSingle )
+-                aAdr.Format( aStr, ( aAdr.Tab() == mnCurTab ) ? SCA_ABS : SCA_ABS_3D, pDocP ); 
++                aAdr.Format( aStr, nFmt, pDocP, pDocP->GetAddressConvention() ); 
+             else
+-                rRef.Format( aStr, ( aAdr.Tab() == mnCurTab ) ? SCR_ABS : SCR_ABS_3D, pDocP );
++                rRef.Format( aStr, nFmt, pDocP, pDocP->GetAddressConvention() );
+         }
+ 
+         // variable cells can be several ranges, so only the selection is replaced
+@@ -777,7 +778,8 @@
+ bool ScOptSolverDlg::ParseRef( ScRange& rRange, const String& rInput, bool bAllowRange )
+ {
+     ScRangeUtil aRangeUtil;
+-    USHORT nFlags = rRange.ParseAny( rInput, mpDoc );
++    ScAddress::Details aDetails(mpDoc->GetAddressConvention(), 0, 0);
++    USHORT nFlags = rRange.ParseAny( rInput, mpDoc, aDetails );
+     if ( nFlags & SCA_VALID )
+     {
+         if ( (nFlags & SCA_TAB_3D) == 0 )
+@@ -786,7 +788,7 @@
+             rRange.aEnd.SetTab( rRange.aStart.Tab() );
+         return ( bAllowRange || rRange.aStart == rRange.aEnd );
+     }
+-    else if ( aRangeUtil.MakeRangeFromName( rInput, mpDoc, mnCurTab, rRange, RUTL_NAMES ) )
++    else if ( aRangeUtil.MakeRangeFromName( rInput, mpDoc, mnCurTab, rRange, RUTL_NAMES, aDetails ) )
+         return ( bAllowRange || rRange.aStart == rRange.aEnd );
+ 
+     return false;   // not recognized
+Index: sc/source/ui/miscdlgs/simpref.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/miscdlgs/simpref.cxx,v
+retrieving revision 1.10
+retrieving revision 1.10.276.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.10 -r1.10.276.1
+--- sc/source/ui/miscdlgs/simpref.cxx	22 May 2007 20:09:34 -0000	1.10
++++ sc/source/ui/miscdlgs/simpref.cxx	20 Mar 2008 23:20:34 -0000	1.10.276.1
+@@ -148,10 +148,10 @@
+ 		if ( bSingleCell )
+ 		{
+ 			ScAddress aAdr = rRef.aStart;
+-            aAdr.Format( aRefStr, SCA_ABS_3D, pDocP );
++            aAdr.Format( aRefStr, SCA_ABS_3D, pDocP, pDocP->GetAddressConvention() );
+ 		}
+ 		else
+-            theCurArea.Format( aRefStr, ABS_DREF3D, pDocP );
++            theCurArea.Format( aRefStr, ABS_DREF3D, pDocP, pDocP->GetAddressConvention() );
+ 
+         if ( bMultiSelection )
+         {
+Index: sc/source/ui/miscdlgs/solvrdlg.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/miscdlgs/solvrdlg.cxx,v
+retrieving revision 1.11
+retrieving revision 1.11.314.2
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.11 -r1.11.314.2
+--- sc/source/ui/miscdlgs/solvrdlg.cxx	27 Feb 2007 13:33:43 -0000	1.11
++++ sc/source/ui/miscdlgs/solvrdlg.cxx	21 Mar 2008 17:23:57 -0000	1.11.314.2
+@@ -126,7 +126,7 @@
+     aEdVariableCell.SetLoseFocusHdl ( aLink );
+     aRBVariableCell.SetLoseFocusHdl ( aLink );
+ 
+-	theFormulaCell.Format( aStr, SCA_ABS );
++	theFormulaCell.Format( aStr, SCA_ABS, NULL, pDoc->GetAddressConvention() );
+ 
+ 	aEdFormulaCell.SetText( aStr );
+ 	aEdFormulaCell.GrabFocus();
+@@ -172,7 +172,7 @@
+ 								? SCA_ABS
+ 								: SCA_ABS_3D;
+ 
+-        aAdr.Format( aStr, nFmt, pDocP );
++        aAdr.Format( aStr, nFmt, pDocP, pDocP->GetAddressConvention() );
+ 		pEdActive->SetRefString( aStr );
+ 
+ 		if ( pEdActive == &aEdFormulaCell )
+@@ -241,8 +241,9 @@
+ 		// 2. verweist die Formel-Koordinate wirklich auf eine Formelzelle?
+ 		// 3. wurde ein korrekter Zielwert eingegeben
+ 
+-		USHORT	nRes1 = theFormulaCell .Parse( aEdFormulaCell.GetText(), pDoc );
+-		USHORT	nRes2 = theVariableCell.Parse( aEdVariableCell.GetText(), pDoc );
++        const ScAddress::Convention eConv = pDoc->GetAddressConvention();
++		USHORT	nRes1 = theFormulaCell .Parse( aEdFormulaCell.GetText(),  pDoc, eConv );
++		USHORT	nRes2 = theVariableCell.Parse( aEdVariableCell.GetText(), pDoc, eConv );
+ 
+ 		if ( SCA_VALID == ( nRes1 & SCA_VALID ) )
+ 		{
+Index: sc/source/ui/miscdlgs/tabopdlg.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/miscdlgs/tabopdlg.cxx,v
+retrieving revision 1.10
+retrieving revision 1.10.314.2
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.10 -r1.10.314.2
+--- sc/source/ui/miscdlgs/tabopdlg.cxx	27 Feb 2007 13:34:05 -0000	1.10
++++ sc/source/ui/miscdlgs/tabopdlg.cxx	21 Mar 2008 04:38:42 -0000	1.10.314.2
+@@ -162,6 +162,8 @@
+ {
+ 	if ( pEdActive )
+ 	{
++        ScAddress::Details aDetails(pDocP->GetAddressConvention(), 0, 0);
++
+ 		if ( rRef.aStart != rRef.aEnd )
+ 			RefInputStart(pEdActive);
+ 
+@@ -174,17 +176,17 @@
+ 		{
+ 			theFormulaCell.Set( rRef.aStart, false, false, false);
+ 			theFormulaEnd.Set( rRef.aEnd, false, false, false);
+-            rRef.Format( aStr, nFmt, pDocP );
++            rRef.Format( aStr, nFmt, pDocP, aDetails );
+ 		}
+ 		else if ( pEdActive == &aEdRowCell )
+ 		{
+ 			theRowCell.Set( rRef.aStart, false, false, false);
+-            rRef.aStart.Format( aStr, nFmt, pDocP );
++            rRef.aStart.Format( aStr, nFmt, pDocP, aDetails );
+ 		}
+ 		else if ( pEdActive == &aEdColCell )
+ 		{
+ 			theColCell.Set( rRef.aStart, false, false, false);
+-            rRef.aStart.Format( aStr, nFmt, pDocP );
++            rRef.aStart.Format( aStr, nFmt, pDocP, aDetails );
+ 		}
+ 
+ 		pEdActive->SetRefString( aStr );
+@@ -246,11 +248,12 @@
+ 				ScRefAddress& rStart, ScRefAddress& rEnd )
+ {
+ 	BOOL bRet = FALSE;
++    const ScAddress::Convention eConv = pDoc->GetAddressConvention();
+ 	if ( rString.Search(':') != STRING_NOTFOUND )
+-		bRet = ConvertDoubleRef( pDoc, rString, nCurTab, rStart, rEnd );
++		bRet = ConvertDoubleRef( pDoc, rString, nCurTab, rStart, rEnd, eConv );
+ 	else
+ 	{
+-		bRet = ConvertSingleRef( pDoc, rString, nCurTab, rStart );
++		bRet = ConvertSingleRef( pDoc, rString, nCurTab, rStart, eConv );
+ 		rEnd = rStart;
+ 	}
+ 	return bRet;
+@@ -282,9 +285,11 @@
+ 			nError = TABOPERR_WRONGFORMULA;
+ 		else
+ 		{
++            const ScAddress::Convention eConv = pDoc->GetAddressConvention();
+ 			if (aEdRowCell.GetText().Len() > 0)
+ 			{
+-				if (!ConvertSingleRef( pDoc, aEdRowCell.GetText(), nCurTab, theRowCell ))
++				if (!ConvertSingleRef( pDoc, aEdRowCell.GetText(), nCurTab, 
++                                       theRowCell, eConv ))
+ 					nError = TABOPERR_WRONGROW;
+ 				else
+ 				{
+@@ -298,7 +303,7 @@
+ 			if (aEdColCell.GetText().Len() > 0)
+ 			{
+ 				if (!ConvertSingleRef( pDoc, aEdColCell.GetText(), nCurTab,
+-									   theColCell ))
++									   theColCell, eConv ))
+ 					nError = TABOPERR_WRONGCOL;
+ 				else
+ 				{
+@@ -306,7 +311,7 @@
+ 					{
+ 						nMode = 2;
+ 						ConvertSingleRef( pDoc, aEdFormulaRange.GetText(), nCurTab,
+-										  theFormulaCell );
++										  theFormulaCell, eConv );
+ 					}
+ 					else if (theFormulaCell.Row() != theFormulaEnd.Row())
+ 						nError = TABOPERR_NOROWFORMULA;
+Index: sc/source/ui/namedlg/namedlg.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/namedlg/namedlg.cxx,v
+retrieving revision 1.9
+retrieving revision 1.8.314.2
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.9 -r1.8.314.2
+--- sc/source/ui/namedlg/namedlg.cxx	18 Mar 2008 14:52:04 -0000	1.9
++++ sc/source/ui/namedlg/namedlg.cxx	31 Mar 2008 20:24:00 -0000	1.8.314.2
+@@ -208,7 +208,8 @@
+ 	UpdateNames();
+ 
+ 	pViewData->GetSimpleArea( aRange );
+-	aRange.Format( aAreaStr, ABS_DREF3D, pDoc );
++	aRange.Format( aAreaStr, ABS_DREF3D, pDoc,
++                   ScAddress::Details(pDoc->GetAddressConvention(), 0, 0) );
+ 
+ 	theCurSel = Selection( 0, SELECTION_MAX );
+ 	aEdAssign.GrabFocus();
+@@ -253,7 +254,8 @@
+ 		if ( rRef.aStart != rRef.aEnd )
+ 			RefInputStart(&aEdAssign);
+ 		String aRefStr;
+-        rRef.Format( aRefStr, ABS_DREF3D, pDocP );
++        rRef.Format( aRefStr, ABS_DREF3D, pDocP, 
++                     ScAddress::Details(pDocP->GetAddressConvention(), 0, 0) );
+ 		aEdAssign.SetRefString( aRefStr );
+ 	}
+ }
+Index: sc/source/ui/navipi/content.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/navipi/content.cxx,v
+retrieving revision 1.24
+retrieving revision 1.24.70.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.24 -r1.24.70.1
+--- sc/source/ui/navipi/content.cxx	29 Jan 2008 15:43:51 -0000	1.24
++++ sc/source/ui/navipi/content.cxx	20 Mar 2008 23:20:41 -0000	1.24.70.1
+@@ -353,7 +353,8 @@
+                 {
+                     ScRange aRange = pLink->GetDestArea();
+                     String aRangeStr;
+-                    aRange.Format( aRangeStr, SCR_ABS_3D, GetSourceDocument() );
++                    ScDocument* pSrcDoc = GetSourceDocument();
++                    aRange.Format( aRangeStr, SCR_ABS_3D, pSrcDoc, pSrcDoc->GetAddressConvention() );
+                     pParentWindow->SetCurrentCellStr( aRangeStr );
+                 }
+             }
+Index: sc/source/ui/optdlg/tpusrlst.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/optdlg/tpusrlst.cxx,v
+retrieving revision 1.10
+retrieving revision 1.10.70.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.10 -r1.10.70.1
+--- sc/source/ui/optdlg/tpusrlst.cxx	29 Jan 2008 15:44:03 -0000	1.10
++++ sc/source/ui/optdlg/tpusrlst.cxx	20 Mar 2008 23:20:47 -0000	1.10.70.1
+@@ -765,14 +765,16 @@
+ 											 pViewData->GetTabNo(),
+ 											 &theAreaStr,
+ 											 &theStartPos,
+-											 &theEndPos );
++											 &theEndPos,
++                                             pDoc->GetAddressConvention() );
+ 			if ( !bAreaOk )
+ 			{
+ 				bAreaOk = pRangeUtil->IsAbsPos(  theAreaStr,
+ 												 pDoc,
+ 												 pViewData->GetTabNo(),
+ 												 &theAreaStr,
+-												 &theStartPos );
++												 &theStartPos,
++                                                 pDoc->GetAddressConvention() );
+ 				theEndPos = theStartPos;
+ 			}
+ 		}
+Index: sc/source/ui/pagedlg/areasdlg.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/pagedlg/areasdlg.cxx,v
+retrieving revision 1.14
+retrieving revision 1.14.314.3
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.14 -r1.14.314.3
+--- sc/source/ui/pagedlg/areasdlg.cxx	27 Feb 2007 13:36:45 -0000	1.14
++++ sc/source/ui/pagedlg/areasdlg.cxx	25 Mar 2008 23:01:31 -0000	1.14.314.3
+@@ -61,6 +61,7 @@
+ #include "docsh.hxx"
+ #include "globstr.hrc"
+ #include "pagedlg.hrc"
++#include "compiler.hxx"
+ 
+ // STATIC DATA ---------------------------------------------------------------
+ 
+@@ -85,10 +86,32 @@
+ 
+ // globale Funktionen (->am Ende der Datei):
+ 
+-BOOL	lcl_CheckRepeatString( const String& rStr, BOOL bIsRow, ScRange* pRange );
+-void	lcl_GetRepeatRangeString( const ScRange* pRange, BOOL bIsRow, String& rStr );
+-void	lcl_CheckEqual( String& rStr );
++bool    lcl_CheckRepeatString( const String& rStr, ScDocument* pDoc, bool bIsRow, ScRange* pRange );
++void	lcl_GetRepeatRangeString( const ScRange* pRange, ScDocument* pDoc, bool bIsRow, String& rStr );
+ 
++static void printAddressFlags(USHORT nFlag)
++{
++    if ((nFlag & SCA_COL_ABSOLUTE  ) == SCA_COL_ABSOLUTE  )  printf("SCA_COL_ABSOLUTE \n");
++    if ((nFlag & SCA_ROW_ABSOLUTE  ) == SCA_ROW_ABSOLUTE  )  printf("SCA_ROW_ABSOLUTE \n");
++    if ((nFlag & SCA_TAB_ABSOLUTE  ) == SCA_TAB_ABSOLUTE  )  printf("SCA_TAB_ABSOLUTE \n");
++    if ((nFlag & SCA_TAB_3D        ) == SCA_TAB_3D        )  printf("SCA_TAB_3D       \n");
++    if ((nFlag & SCA_COL2_ABSOLUTE ) == SCA_COL2_ABSOLUTE )  printf("SCA_COL2_ABSOLUTE\n");
++    if ((nFlag & SCA_ROW2_ABSOLUTE ) == SCA_ROW2_ABSOLUTE )  printf("SCA_ROW2_ABSOLUTE\n");
++    if ((nFlag & SCA_TAB2_ABSOLUTE ) == SCA_TAB2_ABSOLUTE )  printf("SCA_TAB2_ABSOLUTE\n");
++    if ((nFlag & SCA_TAB2_3D       ) == SCA_TAB2_3D       )  printf("SCA_TAB2_3D      \n");
++    if ((nFlag & SCA_VALID_ROW     ) == SCA_VALID_ROW     )  printf("SCA_VALID_ROW    \n");
++    if ((nFlag & SCA_VALID_COL     ) == SCA_VALID_COL     )  printf("SCA_VALID_COL    \n");
++    if ((nFlag & SCA_VALID_TAB     ) == SCA_VALID_TAB     )  printf("SCA_VALID_TAB    \n");
++    if ((nFlag & SCA_FORCE_DOC     ) == SCA_FORCE_DOC     )  printf("SCA_FORCE_DOC    \n");
++    if ((nFlag & SCA_VALID_ROW2    ) == SCA_VALID_ROW2    )  printf("SCA_VALID_ROW2   \n");
++    if ((nFlag & SCA_VALID_COL2    ) == SCA_VALID_COL2    )  printf("SCA_VALID_COL2   \n");
++    if ((nFlag & SCA_VALID_TAB2    ) == SCA_VALID_TAB2    )  printf("SCA_VALID_TAB2   \n");
++    if ((nFlag & SCA_VALID         ) == SCA_VALID         )  printf("SCA_VALID        \n");
++    if ((nFlag & SCA_ABS           ) == SCA_ABS           )  printf("SCA_ABS          \n");
++    if ((nFlag & SCR_ABS           ) == SCR_ABS           )  printf("SCR_ABS          \n");
++    if ((nFlag & SCA_ABS_3D        ) == SCA_ABS_3D        )  printf("SCA_ABS_3D       \n");
++    if ((nFlag & SCR_ABS_3D        ) == SCR_ABS_3D        )  printf("SCR_ABS_3D       \n");
++}
+ 
+ //============================================================================
+ //	class ScPrintAreasDlg
+@@ -190,11 +213,11 @@
+ 			RefInputStart( pRefInputEdit );
+ 
+ 		String	aStr;
++        const ScAddress::Convention eConv = pDoc->GetAddressConvention();
+ 
+ 		if ( &aEdPrintArea == pRefInputEdit )
+ 		{
+-			rRef.Format( aStr, SCR_ABS );
+-			lcl_CheckEqual( aStr );
++			rRef.Format( aStr, SCR_ABS, pDoc, eConv );
+ 
+ //			aEdPrintArea.ReplaceSelected( aStr );
+ 
+@@ -210,7 +233,7 @@
+ 		else
+ 		{
+ 			BOOL bRow = ( &aEdRepeatRow == pRefInputEdit );
+-			lcl_GetRepeatRangeString( &rRef, bRow, aStr );
++            lcl_GetRepeatRangeString(&rRef, pDoc, bRow, aStr);
+ 			pRefInputEdit->SetRefString( aStr );
+ 		}
+ 	}
+@@ -225,8 +248,9 @@
+ {
+ 	if ( pRefInputEdit == &aEdPrintArea )
+ 	{
++        const sal_Unicode sep = ScCompiler::GetStringFromOpCode(ocSep).GetChar(0);
+ 		String aVal = aEdPrintArea.GetText();
+-		aVal += ';';
++		aVal += sep;
+ 		aEdPrintArea.SetText(aVal);
+ 
+ 		xub_StrLen nLen = aVal.Len();
+@@ -296,6 +320,8 @@
+ 	//-------------------------
+ 	aStrRange.Erase();
+     String aOne;
++    const ScAddress::Convention eConv = pDoc->GetAddressConvention();
++    const sal_Unicode sep = ScCompiler::GetStringFromOpCode(ocSep).GetChar(0);
+     USHORT nRangeCount = pDoc->GetPrintRangeCount( nCurTab );
+     for (USHORT i=0; i<nRangeCount; i++)
+     {
+@@ -303,9 +329,8 @@
+         if (pPrintRange)
+         {
+             if ( aStrRange.Len() )
+-                aStrRange += ';';
+-            pPrintRange->Format( aOne, SCR_ABS );
+-            lcl_CheckEqual( aOne );
++                aStrRange += sep;
++            pPrintRange->Format( aOne, SCR_ABS, pDoc, eConv );
+             aStrRange += aOne;
+         }
+     }
+@@ -314,13 +339,13 @@
+ 	//-------------------------------
+ 	// Wiederholungszeile
+ 	//-------------------------------
+-	lcl_GetRepeatRangeString( pRepeatRowRange, TRUE, aStrRange );
++    lcl_GetRepeatRangeString(pRepeatRowRange, pDoc, true, aStrRange);
+ 	aEdRepeatRow.SetText( aStrRange );
+ 
+ 	//--------------------------------
+ 	// Wiederholungsspalte
+ 	//--------------------------------
+-	lcl_GetRepeatRangeString( pRepeatColRange, FALSE, aStrRange );
++    lcl_GetRepeatRangeString(pRepeatColRange, pDoc, false, aStrRange);
+ 	aEdRepeatCol.SetText( aStrRange );
+ 
+ 	Impl_ModifyHdl( &aEdPrintArea );
+@@ -345,9 +370,9 @@
+ 	if ( (aRangeStr.Len() > 0) && &aEdPrintArea != pEd )
+ 	{
+ 		ScRange aRange;
+-		lcl_CheckRepeatString( aRangeStr, &aEdRepeatRow == pEd, &aRange );
+-		aRange.Format( aRangeStr, SCR_ABS );
+-		lcl_CheckEqual( aRangeStr );
++        const ScAddress::Convention eConv = pDoc->GetAddressConvention();
++        lcl_CheckRepeatString(aRangeStr, pDoc, &aEdRepeatRow == pEd, &aRange);
++		aRange.Format(aRangeStr, SCR_ABS, pDoc, eConv);
+ 	}
+ 
+ 	rItem.SetValue( aRangeStr );
+@@ -368,25 +393,35 @@
+ 	BOOL bPrintAreaOk = TRUE;
+ 	if ( aStrPrintArea.Len() )
+ 	{
++        const USHORT nValidAddr  = SCA_VALID | SCA_VALID_ROW | SCA_VALID_COL;
++        const USHORT nValidRange = nValidAddr | SCA_VALID_ROW2 | SCA_VALID_COL2;
++        const ScAddress::Convention eConv = pDoc->GetAddressConvention();
++        const sal_Unicode sep  = ScCompiler::GetStringFromOpCode(ocSep).GetChar(0);
++        const sal_Unicode rsep = ScCompiler::GetStringFromOpCode(ocRange).GetChar(0);
++
++        ScAddress aAddr;
+ 		ScRange aRange;
+-		xub_StrLen nTCount = aStrPrintArea.GetTokenCount();
+-		for ( xub_StrLen i=0; i<nTCount && bPrintAreaOk; i++ )
++		xub_StrLen nSepCount = aStrPrintArea.GetTokenCount(sep);
++		for ( xub_StrLen i = 0; i < nSepCount && bPrintAreaOk; ++i )
++		{
++			String aOne = aStrPrintArea.GetToken(i, sep);
++            USHORT nResult = aRange.Parse( aOne, pDoc, eConv );
++            if ((nResult & nValidRange) != nValidRange)
+ 		{
+-			String aOne = aStrPrintArea.GetToken(i);
+-			lcl_CheckEqual( aOne );
+-			USHORT nResult = aRange.ParseAny( aOne, pDoc );
+-			if (!(nResult & SCA_VALID))
++                USHORT nResult = aAddr.Parse( aOne, pDoc, eConv );
++                if ((nResult & nValidAddr) != nValidAddr)
+ 				bPrintAreaOk = FALSE;
+ 		}
+ 	}
++	}
+ 
+ 	BOOL bRepeatRowOk = (aStrRepeatRow.Len() == 0);
+ 	if ( !bRepeatRowOk )
+-		bRepeatRowOk = lcl_CheckRepeatString( aStrRepeatRow, TRUE, NULL );
++        bRepeatRowOk = lcl_CheckRepeatString(aStrRepeatRow, pDoc, true, NULL);
+ 
+ 	BOOL bRepeatColOk = (aStrRepeatCol.Len() == 0);
+ 	if ( !bRepeatColOk )
+-		bRepeatColOk = lcl_CheckRepeatString( aStrRepeatCol, FALSE, NULL );
++        bRepeatColOk = lcl_CheckRepeatString(aStrRepeatCol, pDoc, false, NULL);
+ 
+ 	// Fehlermeldungen
+ 
+@@ -422,13 +457,15 @@
+ 	if ( pViewData )
+ 		bSimple = pViewData->GetSimpleArea( aRange );
+ 
++    ScAddress::Convention eConv = pDoc->GetAddressConvention();
++
+ 	if ( bSimple )
+-		aRange.Format( aStrRange, SCR_ABS, pDoc );
++		aRange.Format( aStrRange, SCR_ABS, pDoc, eConv );
+ 	else
+ 	{
+ 		ScRangeListRef aList( new ScRangeList );
+ 		pViewData->GetMarkData().FillRangeListWithMarks( aList, FALSE );
+-		aList->Format( aStrRange, SCR_ABS, pDoc );
++		aList->Format( aStrRange, SCR_ABS, pDoc, eConv );
+ 	}
+ 
+     aLbPrintArea.SetEntryData( SC_AREASDLG_PR_SELECT, new String( aStrRange ) );
+@@ -457,7 +494,8 @@
+ 				{
+ 					pData->GetName( aName );
+ 					pData->GetSymbol( aSymbol );
+-					if ( aRange.ParseAny( aSymbol, pDoc ) & SCA_VALID )
++                    ScAddress::Details aDetails(pDoc->GetAddressConvention(), 0, 0);
++					if ( aRange.ParseAny( aSymbol, pDoc, aDetails ) & SCA_VALID )
+ 					{
+ 						if ( pData->HasType( RT_PRINTAREA ) )
+ 						{
+@@ -469,7 +507,7 @@
+ 
+ 						if ( pData->HasType( RT_ROWHEADER ) )
+ 						{
+-							lcl_GetRepeatRangeString( &aRange, TRUE, aSymbol );
++                            lcl_GetRepeatRangeString(&aRange, pDoc, true, aSymbol);
+ 							aLbRepeatRow.SetEntryData(
+ 								aLbRepeatRow.InsertEntry( aName ),
+ 								new String( aSymbol ) );
+@@ -477,7 +515,7 @@
+ 
+ 						if ( pData->HasType( RT_COLHEADER ) )
+ 						{
+-							lcl_GetRepeatRangeString( &aRange, FALSE, aSymbol );
++                            lcl_GetRepeatRangeString(&aRange, pDoc, false, aSymbol);
+ 							aLbRepeatCol.SetEntryData(
+ 								aLbRepeatCol.InsertEntry( aName ),
+ 								new String( aSymbol ) );
+@@ -669,9 +707,11 @@
+ //============================================================================
+ // globale Funktionen:
+ 
+-//----------------------------------------------------------------------------
++// ----------------------------------------------------------------------------
++
++// TODO: It might make sense to move these functions to address.?xx. -kohei
+ 
+-BOOL lcl_CheckRepeatOne( const String& rStr, BOOL bIsRow, SCCOLROW& rVal )
++bool lcl_CheckOne_OOO( const String& rStr, bool bIsRow, SCCOLROW& rVal )
+ {
+ 	// Zulaessige Syntax fuer rStr:
+ 	// Row: [$]1-MAXTAB
+@@ -713,115 +753,160 @@
+ 	return bStrOk;
+ }
+ 
++bool lcl_CheckOne_XL_A1( const String& rStr, bool bIsRow, SCCOLROW& rVal )
++{
++    // XL A1 style is identical to OOO one for print range formats.
++    return lcl_CheckOne_OOO(rStr, bIsRow, rVal);
++}
+ 
+-//----------------------------------------------------------------------------
+-//	doppelte Referenz testen
++bool lcl_CheckOne_XL_R1C1( const String& rStr, bool bIsRow, SCCOLROW& rVal )
++{
++    xub_StrLen nLen = rStr.Len();
++    if (nLen <= 1)
++        // There must be at least two characters.
++        return false;
+ 
++    const sal_Unicode preUpper = bIsRow ? 'R' : 'C';
++    const sal_Unicode preLower = bIsRow ? 'r' : 'c';
++    if (rStr.GetChar(0) != preUpper && rStr.GetChar(0) != preLower)
++        return false;
+ 
+-BOOL lcl_CheckRepeatString( const String& rStr, BOOL bIsRow, ScRange* pRange )
+-{
+-	// Zulaessige Syntax fuer rStr:
+-	// Row: $1, $1:$2
+-	// Col: $A, $A:$B
+-	// und alles auch ohne $
++    String aNumStr = rStr.Copy(1);
++    if (!CharClass::isAsciiNumeric(aNumStr))
++        return false;
+ 
+-	BOOL bOk = FALSE;
+-	SCCOLROW nStart = 0;
+-	SCCOLROW nEnd = 0;
+-	xub_StrLen nCount = rStr.GetTokenCount(':');
+-	if (nCount == 1)
++    sal_Int32 nNum = aNumStr.ToInt32();
++
++    if (nNum <= 0)
++        return false;
++
++    if ((bIsRow && nNum > MAXROWCOUNT) || (!bIsRow && nNum > MAXCOLCOUNT))
++        return false;
++
++    rVal = static_cast<SCCOLROW>(nNum-1);
++    return true;
++}
++
++bool lcl_CheckRepeatOne( const String& rStr, ScAddress::Convention eConv, bool bIsRow, SCCOLROW& rVal )
++{
++    switch (eConv)
+ 	{
+-		bOk = lcl_CheckRepeatOne( rStr, bIsRow, nStart );
+-		nEnd = nStart;
++        case ScAddress::CONV_OOO:
++            return lcl_CheckOne_OOO(rStr, bIsRow, rVal);
++        case ScAddress::CONV_XL_A1:
++            return lcl_CheckOne_XL_A1(rStr, bIsRow, rVal);
++        case ScAddress::CONV_XL_R1C1:
++            return lcl_CheckOne_XL_R1C1(rStr, bIsRow, rVal);
+ 	}
+-	else if (nCount == 2)
++    return false;
++}
++
++bool lcl_CheckRepeatString( const String& rStr, ScDocument* pDoc, bool bIsRow, ScRange* pRange )
++{
++    // Row: [valid row] rsep [valid row]
++    // Col: [valid col] rsep [valid col]
++
++    const ScAddress::Convention eConv = pDoc->GetAddressConvention();
++    const sal_Unicode rsep = ScCompiler::GetStringFromOpCode(ocRange).GetChar(0);
++
++    if (pRange)
+ 	{
+-		String aFirst  = rStr.GetToken( 0, ':' );
+-		String aSecond = rStr.GetToken( 1, ':' );
+-		bOk = lcl_CheckRepeatOne( aFirst, bIsRow, nStart );
+-		if (bOk)
+-			bOk = lcl_CheckRepeatOne( aSecond, bIsRow, nEnd );
++        // initialize the range value.
++        pRange->aStart.SetCol(0);
++        pRange->aStart.SetRow(0);
++        pRange->aEnd.SetCol(0);
++        pRange->aEnd.SetRow(0);
+ 	}
+ 
+-
+-	if ( bOk && pRange )
++    String aBuf;
++    SCCOLROW nVal = 0;
++    xub_StrLen nLen = rStr.Len();
++    bool bEndPos = false;
++    for (xub_StrLen i = 0; i < nLen; ++i)
++    {
++        const sal_Unicode c = rStr.GetChar(i);
++        if (c == rsep)
+ 	{
+-		ScAddress& rStart = pRange->aStart;
+-		ScAddress& rEnd	  = pRange->aEnd;
++            if (bEndPos)
++                // We aren't supposed to have more than one range separator.
++                return false;
+ 
+-		if ( bIsRow )
++            // range separator
++            if (aBuf.Len() == 0)
++                return false;
++
++            bool bRes = lcl_CheckRepeatOne(aBuf, eConv, bIsRow, nVal);
++            if (!bRes)
++                return false;
++
++            if (pRange)
++            {
++                if (bIsRow)
+ 		{
+-			rStart.SetCol( 0 );
+-			rEnd  .SetCol( 0 );
+-			rStart.SetRow( nStart );
+-			rEnd  .SetRow( nEnd );
++                    pRange->aStart.SetRow(static_cast<SCROW>(nVal));
++                    pRange->aEnd.SetRow(static_cast<SCROW>(nVal));
+ 		}
+ 		else
+ 		{
+-			rStart.SetCol( static_cast<SCCOL>(nStart) );
+-			rEnd  .SetCol( static_cast<SCCOL>(nEnd) );
+-			rStart.SetRow( 0 );
+-			rEnd  .SetRow( 0 );
++                    pRange->aStart.SetCol(static_cast<SCCOL>(nVal));
++                    pRange->aEnd.SetCol(static_cast<SCCOL>(nVal));
+ 		}
+ 	}
+ 
+-	return bOk;
+-}
+-
+-
+-//----------------------------------------------------------------------------
++            aBuf.Erase();
++            bEndPos = true;
++        }
++        else
++            aBuf.Append(c);
++    }
+ 
+-void lcl_GetRepeatRangeString( const ScRange* pRange, BOOL bIsRow, String& rStr )
+-{
+-	if ( pRange )
++    if (aBuf.Len() > 0)
+ 	{
+-		// In rStr wird die pRange im folgenden Format ausgegeben
+-		// Row: $1, $1:$2
+-		// Col: $A, $A:$B
+-
+-		const ScAddress& rStart = pRange->aStart;
+-		const ScAddress& rEnd = pRange->aEnd;
++        bool bRes = lcl_CheckRepeatOne(aBuf, eConv, bIsRow, nVal);
++        if (!bRes)
++            return false;
+ 
+-		rStr  = '$';
+-		if ( bIsRow )
++        if (pRange)
+ 		{
+-			rStr += String::CreateFromInt32( rStart.Row()+1 );
+-			if ( rStart.Row() != rEnd.Row() )
++            if (bIsRow)
+ 			{
+-				rStr.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ":$" ));
+-				rStr += String::CreateFromInt32( rEnd.Row()+1 );
+-			}
++                if (!bEndPos)
++                    pRange->aStart.SetRow(static_cast<SCROW>(nVal));
++                pRange->aEnd.SetRow(static_cast<SCROW>(nVal));
+ 		}
+ 		else
+ 		{
+-            rStr += ::ColToAlpha( rStart.Col() );
+-			if ( rStart.Col() != rEnd.Col() )
+-			{
+-				rStr.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ":$" ));
+-                rStr += ::ColToAlpha( rEnd.Col() );
++                if (!bEndPos)
++                    pRange->aStart.SetCol(static_cast<SCCOL>(nVal));
++                pRange->aEnd.SetCol(static_cast<SCCOL>(nVal));
+ 			}
+ 		}
+ 	}
+-	else
+-		rStr.Erase();
+-}
+-
+-
+-//----------------------------------------------------------------------------
+ 
+-void lcl_CheckEqual( String& rStr )
+-{
+-	if ( STRING_NOTFOUND == rStr.Search( ':' ) )
+-	{
+-		String aStrTmp = rStr;
+-		rStr += ':';
+-		rStr += aStrTmp;
+-	}
++    return true;
+ }
+ 
++// ----------------------------------------------------------------------------
+ 
++void lcl_GetRepeatRangeString( const ScRange* pRange, ScDocument* pDoc, bool bIsRow, String& rStr )
++{
++    rStr.Erase();
++    if (!pRange)
++        return;
+ 
++    const ScAddress::Convention eConv = pDoc->GetAddressConvention();
++    const ScAddress& rStart = pRange->aStart;
++    const ScAddress& rEnd   = pRange->aEnd;
+ 
+-
+-
++    const USHORT nFmt = bIsRow ? (SCA_VALID_ROW | SCA_ROW_ABSOLUTE) : (SCA_VALID_COL | SCA_COL_ABSOLUTE);
++    String aTmpStr;
++    rStart.Format(aTmpStr, nFmt, pDoc, eConv);
++    rStr += aTmpStr;
++    if ((bIsRow && rStart.Row() != rEnd.Row()) || (!bIsRow && rStart.Col() != rEnd.Col()))
++    {
++        rStr += ScCompiler::GetStringFromOpCode(ocRange);
++        rEnd.Format(aTmpStr, nFmt, pDoc, eConv);
++        rStr += aTmpStr;
++    }
++}
+ 
+Index: sc/source/ui/undo/undotab.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/undo/undotab.cxx,v
+retrieving revision 1.18
+retrieving revision 1.18.40.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.18 -r1.18.40.1
+--- sc/source/ui/undo/undotab.cxx	19 Feb 2008 15:34:09 -0000	1.18
++++ sc/source/ui/undo/undotab.cxx	19 Mar 2008 17:37:15 -0000	1.18.40.1
+@@ -95,7 +95,7 @@
+ TYPEINIT1(ScUndoScenarioFlags,	SfxUndoAction);
+ TYPEINIT1(ScUndoRenameObject,	SfxUndoAction);
+ TYPEINIT1(ScUndoLayoutRTL,		SfxUndoAction);
+-TYPEINIT1(ScUndoSetAddressConvention,		SfxUndoAction);
++TYPEINIT1(ScUndoSetGrammar,		SfxUndoAction);
+ 
+ 
+ // -----------------------------------------------------------------------
+@@ -1534,41 +1534,41 @@
+ 
+ // -----------------------------------------------------------------------
+ //
+-//		Set the address convention used for the sheet
++//		Set the grammar used for the sheet
+ //
+ 
+-ScUndoSetAddressConvention::ScUndoSetAddressConvention( ScDocShell* pShell,
+-														ScAddress::Convention eConv ) :
++ScUndoSetGrammar::ScUndoSetGrammar( ScDocShell* pShell,
++                                    ScGrammar::Grammar eGrammar ) :
+ 	ScSimpleUndo( pShell ),
+-	eNewConv( eConv )
++    meNewGrammar( eGrammar )
+ {
+-	eOldConv = pDocShell->GetDocument()->GetAddressConvention();
++    meOldGrammar = pDocShell->GetDocument()->GetGrammar();
+ }
+ 
+-__EXPORT ScUndoSetAddressConvention::~ScUndoSetAddressConvention()
++__EXPORT ScUndoSetGrammar::~ScUndoSetGrammar()
+ {
+ }
+ 
+-void ScUndoSetAddressConvention::DoChange( ScAddress::Convention eConv )
++void ScUndoSetGrammar::DoChange( ScGrammar::Grammar eGrammar )
+ {
+ 	pDocShell->SetInUndo( TRUE );
+ 	ScDocument* pDoc = pDocShell->GetDocument();
+-	pDoc->SetAddressConvention( eConv );
++    pDoc->SetGrammar( eGrammar );
+ 	pDocShell->SetDocumentModified();
+ 	pDocShell->SetInUndo( FALSE );
+ }
+ 
+-void __EXPORT ScUndoSetAddressConvention::Undo()
++void __EXPORT ScUndoSetGrammar::Undo()
+ {
+-	DoChange( eOldConv );
++    DoChange( meOldGrammar );
+ }
+ 
+-void __EXPORT ScUndoSetAddressConvention::Redo()
++void __EXPORT ScUndoSetGrammar::Redo()
+ {
+-	DoChange( eNewConv );
++    DoChange( meNewGrammar );
+ }
+ 
+-void __EXPORT ScUndoSetAddressConvention::Repeat(SfxRepeatTarget& /* rTarget */)
++void __EXPORT ScUndoSetGrammar::Repeat(SfxRepeatTarget& /* rTarget */)
+ {
+ #if 0
+ // erAck: 2006-09-07T23:00+0200  commented out in CWS scr1c1
+@@ -1578,12 +1578,12 @@
+ #endif
+ }
+ 
+-BOOL __EXPORT ScUndoSetAddressConvention::CanRepeat(SfxRepeatTarget& rTarget) const
++BOOL __EXPORT ScUndoSetGrammar::CanRepeat(SfxRepeatTarget& rTarget) const
+ {
+ 	return (rTarget.ISA(ScTabViewTarget));
+ }
+ 
+-String __EXPORT ScUndoSetAddressConvention::GetComment() const
++String __EXPORT ScUndoSetGrammar::GetComment() const
+ {
+ 	return ScGlobal::GetRscString( STR_UNDO_TAB_R1C1 );
+ }
+Index: sc/source/ui/unoobj/addruno.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/unoobj/addruno.cxx,v
+retrieving revision 1.8
+retrieving revision 1.8.304.2
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.8 -r1.8.304.2
+Index: sc/source/ui/unoobj/cellsuno.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/unoobj/cellsuno.cxx,v
+retrieving revision 1.112
+retrieving revision 1.111.10.3
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.112 -r1.111.10.3
+Index: sc/source/ui/unoobj/chart2uno.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/unoobj/chart2uno.cxx,v
+retrieving revision 1.8
+retrieving revision 1.8.210.2
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.8 -r1.8.210.2
+Index: sc/source/ui/unoobj/chartuno.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/unoobj/chartuno.cxx,v
+retrieving revision 1.20
+retrieving revision 1.20.276.2
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.20 -r1.20.276.2
+Index: sc/source/ui/unoobj/docuno.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/unoobj/docuno.cxx,v
+retrieving revision 1.66
+retrieving revision 1.66.12.2
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.66 -r1.66.12.2
+Index: sc/source/ui/unoobj/tokenuno.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/unoobj/tokenuno.cxx,v
+retrieving revision 1.3
+retrieving revision 1.3.12.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.3 -r1.3.12.1
+--- sc/source/ui/unoobj/tokenuno.cxx	6 Mar 2008 16:18:37 -0000	1.3
++++ sc/source/ui/unoobj/tokenuno.cxx	19 Mar 2008 17:37:15 -0000	1.3.12.1
+@@ -139,7 +139,8 @@
+ 
+     if (mpDocShell)
+     {
+-        ScCompiler aCompiler( mpDocShell->GetDocument(), maRefPos );
++        ScDocument* pDoc = mpDocShell->GetDocument();
++        ScCompiler aCompiler( pDoc, maRefPos, pDoc->GetGrammar() );
+         SetCompilerFlags( aCompiler );
+ 
+         ScTokenArray* pCode = aCompiler.CompileString( aFormula );
+@@ -158,9 +159,10 @@
+ 
+     if (mpDocShell)
+     {
++        ScDocument* pDoc = mpDocShell->GetDocument();
+         ScTokenArray aCode;
+         (void)ScTokenConversion::ConvertToTokenArray( aCode, aTokens );
+-        ScCompiler aCompiler( mpDocShell->GetDocument(), maRefPos, aCode );
++        ScCompiler aCompiler( pDoc, maRefPos, aCode, pDoc->GetGrammar() );
+         SetCompilerFlags( aCompiler );
+ 
+         rtl::OUStringBuffer aBuffer;
+Index: sc/source/ui/vba/vbarange.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbarange.cxx,v
+retrieving revision 1.7
+retrieving revision 1.7.12.2
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.7 -r1.7.12.2
+--- sc/source/ui/vba/vbarange.cxx	6 Mar 2008 16:19:41 -0000	1.7
++++ sc/source/ui/vba/vbarange.cxx	19 Mar 2008 17:37:15 -0000	1.7.12.2
+@@ -745,21 +745,21 @@
+ 		rtl::OUString sFormula;
+ 		if ( aValue >>= sFormula )
+ 		{
+-			// get current convention
+-			ScAddress::Convention eConv = m_pDoc->GetAddressConvention();
+-			// only convert/compile 'real' formulas
+-			if ( eConv != m_eConv && ( sFormula.trim().indexOf('=') == 0 ) )	
++            // convert to CONV_OOO style formula string because XCell::setFormula
++            // always compile it in CONV_OOO style.  Perhaps css.sheet.FormulaParser
++            // should be used in future to directly pass formula tokens.
++            if ( m_eConv != ScAddress::CONV_OOO && ( sFormula.trim().indexOf('=') == 0 ) )	
+ 			{
+ 				uno::Reference< uno::XInterface > xIf( xCell, uno::UNO_QUERY_THROW );
+ 				ScCellRangesBase* pUnoRangesBase = dynamic_cast< ScCellRangesBase* >( xIf.get() );
+ 				if ( pUnoRangesBase )
+ 				{
+ 					ScRangeList aCellRanges = pUnoRangesBase->GetRangeList();	
+-					ScCompiler aCompiler( m_pDoc, aCellRanges.First()->aStart );
++					ScCompiler aCompiler( m_pDoc, aCellRanges.First()->aStart, m_pDoc->GetGrammar() );
+ 					// compile the string in the format passed in
+ 					aCompiler.CompileString( sFormula, m_eConv );
+ 					// set desired convention to that of the document
+-					aCompiler.SetRefConvention( eConv );
++					aCompiler.SetRefConvention( ScAddress::CONV_OOO );
+ 					String sConverted;
+ 					aCompiler.CreateStringFromTokenArray(sConverted);
+ 					sFormula = EQUALS + sConverted;
+@@ -793,7 +793,7 @@
+ 			pUnoRangesBase )
+ 		{
+ 			ScRangeList aCellRanges = pUnoRangesBase->GetRangeList();	
+-			ScCompiler aCompiler( m_pDoc, aCellRanges.First()->aStart );
++			ScCompiler aCompiler( m_pDoc, aCellRanges.First()->aStart, m_pDoc->GetGrammar() );
+ 			aCompiler.CompileString( sVal,  ScAddress::CONV_OOO );
+ 			// set desired convention
+ 			aCompiler.SetRefConvention( m_eConv );
+@@ -1399,8 +1399,8 @@
+ ScVbaRange::setFormula(const uno::Any &rFormula ) throw (uno::RuntimeException)
+ {
+ 	// #FIXME converting "=$a$1" e.g. CONV_XL_A1 -> CONV_OOO                        	// results in "=$a$1:a1", temporalily disable conversion
+-	//setFormulaValue( rFormula, ScAddress::CONV_XL_A1 );;
+-	setFormulaValue( rFormula, ScAddress::CONV_OOO );;
++	setFormulaValue( rFormula, ScAddress::CONV_XL_A1 );;
++	//setFormulaValue( rFormula, ScAddress::CONV_OOO );;
+ }
+ 
+ uno::Any
+Index: sc/source/ui/view/cellsh1.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/view/cellsh1.cxx,v
+retrieving revision 1.49
+retrieving revision 1.49.68.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.49 -r1.49.68.1
+--- sc/source/ui/view/cellsh1.cxx	29 Jan 2008 15:48:29 -0000	1.49
++++ sc/source/ui/view/cellsh1.cxx	20 Mar 2008 23:21:11 -0000	1.49.68.1
+@@ -857,6 +857,7 @@
+ 				GetViewData()->GetFillData( nStartCol, nStartRow, nEndCol, nEndRow );
+ 				SCCOL nFillCol = GetViewData()->GetRefEndX();
+ 				SCROW nFillRow = GetViewData()->GetRefEndY();
++                ScDocument* pDoc = GetViewData()->GetDocument();
+ 
+ 				if( pReqArgs != NULL )
+ 				{
+@@ -867,7 +868,7 @@
+ 						ScAddress aScAddress;
+ 						String aArg = ((const SfxStringItem*)pItem)->GetValue();
+ 
+-						if( aScAddress.Parse( aArg ) & SCA_VALID )
++						if( aScAddress.Parse( aArg, pDoc, pDoc->GetAddressConvention() ) & SCA_VALID )
+ 						{
+ 							nFillRow = aScAddress.Row();
+ 							nFillCol = aScAddress.Col();
+@@ -939,7 +940,8 @@
+ 							{
+ 								String	aAdrStr;
+ 								ScAddress aAdr( nFillCol, nFillRow, 0 );
+-								aAdr.Format( aAdrStr, SCR_ABS, GetViewData()->GetDocument() );
++                                ScDocument* pDoc = GetViewData()->GetDocument();
++								aAdr.Format( aAdrStr, SCR_ABS, pDoc, pDoc->GetAddressConvention() );
+ 
+ 								rReq.AppendItem( SfxStringItem( FID_FILL_AUTO, aAdrStr ) );
+ 								rReq.Done();
+Index: sc/source/ui/view/output.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/view/output.cxx,v
+retrieving revision 1.33
+retrieving revision 1.33.68.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.33 -r1.33.68.1
+--- sc/source/ui/view/output.cxx	29 Jan 2008 15:50:09 -0000	1.33
++++ sc/source/ui/view/output.cxx	20 Mar 2008 23:21:11 -0000	1.33.68.1
+@@ -2385,7 +2385,7 @@
+                         // Note title is the cell address (as on printed note pages)
+                         String aTitle;
+                         ScAddress aAddress( nMergeX, nMergeY, nTab );
+-                        aAddress.Format( aTitle, SCA_VALID, pDoc );
++                        aAddress.Format( aTitle, SCA_VALID, pDoc, pDoc->GetAddressConvention() );
+ 
+                         // Content has to be a simple string without line breaks
+                         String aContent = pNote->GetText();
+Index: sc/source/ui/view/printfun.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/view/printfun.cxx,v
+retrieving revision 1.55
+retrieving revision 1.55.58.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.55 -r1.55.58.1
+--- sc/source/ui/view/printfun.cxx	12 Feb 2008 16:12:33 -0000	1.55
++++ sc/source/ui/view/printfun.cxx	20 Mar 2008 23:21:11 -0000	1.55.58.1
+@@ -2015,7 +2015,7 @@
+ 						pEditEngine->Draw( pDev, Point( nPosX, nPosY ), 0 );
+ 
+ 						String aMarkStr;
+-						pPos->Format( aMarkStr, SCA_VALID, pDoc );
++						pPos->Format( aMarkStr, SCA_VALID, pDoc, pDoc->GetAddressConvention() );
+ 						aMarkStr += ':';
+ 
+ 						//	Zellposition auch per EditEngine, damit die Position stimmt
+Index: sc/source/ui/view/tabvwsh3.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/view/tabvwsh3.cxx,v
+retrieving revision 1.38
+retrieving revision 1.38.68.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.38 -r1.38.68.1
+--- sc/source/ui/view/tabvwsh3.cxx	30 Jan 2008 09:00:26 -0000	1.38
++++ sc/source/ui/view/tabvwsh3.cxx	20 Mar 2008 23:21:11 -0000	1.38.68.1
+@@ -318,8 +318,9 @@
+ 				else
+ 				{
+ 					ScRangeUtil		aRangeUtil;
+-					if(	aRangeUtil.MakeRangeFromName( aAddress, pDoc, nTab, aScRange, RUTL_NAMES ) ||
+-						aRangeUtil.MakeRangeFromName( aAddress, pDoc, nTab, aScRange, RUTL_DBASE ) )
++                    ScAddress::Convention eConv = pDoc->GetAddressConvention();
++					if(	aRangeUtil.MakeRangeFromName( aAddress, pDoc, nTab, aScRange, RUTL_NAMES, eConv ) ||
++						aRangeUtil.MakeRangeFromName( aAddress, pDoc, nTab, aScRange, RUTL_DBASE, eConv ) )
+ 					{
+ 						nResult |= SCA_VALID;
+ 						if( aScRange.aStart.Tab() != nTab )
+Index: sc/source/ui/view/tabvwsha.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/view/tabvwsha.cxx,v
+retrieving revision 1.23
+retrieving revision 1.23.12.2
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.23 -r1.23.12.2
+--- sc/source/ui/view/tabvwsha.cxx	7 Mar 2008 12:24:16 -0000	1.23
++++ sc/source/ui/view/tabvwsha.cxx	20 Mar 2008 23:21:11 -0000	1.23.12.2
+@@ -220,7 +220,7 @@
+ 				{
+ 					ScAddress aScAddress( GetViewData()->GetCurX(), GetViewData()->GetCurY(), 0 );
+ 					String	aAddr;
+-					aScAddress.Format( aAddr, SCA_ABS );
++					aScAddress.Format( aAddr, SCA_ABS, NULL, pDoc->GetAddressConvention() );
+ 					SfxStringItem	aPosItem( SID_CURRENTCELL, aAddr );
+ 
+ 					rSet.Put( aPosItem );
+@@ -487,7 +487,7 @@
+             ScViewData* pViewData = GetViewData();
+             ScDocument* pDoc = pViewData->GetDocument();
+             ScAddress aPos( pViewData->GetCurPos() );
+-            ScCompiler aComp( pDoc, aPos );
++            ScCompiler aComp( pDoc, aPos, pDoc->GetGrammar() );
+             aComp.SetCloseBrackets( false );
+             ScTokenArray* pArr = aComp.CompileString( aString );
+             if ( pArr->MayReferenceFollow() )
+Index: sc/source/ui/view/viewfun2.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/view/viewfun2.cxx,v
+retrieving revision 1.38
+retrieving revision 1.38.12.2
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.38 -r1.38.12.2
+--- sc/source/ui/view/viewfun2.cxx	7 Mar 2008 11:22:45 -0000	1.38
++++ sc/source/ui/view/viewfun2.cxx	22 Mar 2008 18:48:30 -0000	1.38.12.2
+@@ -963,9 +963,12 @@
+ 	ScMarkData& rMark	= GetViewData()->GetMarkData();
+ 	SCTAB nTab;
+ 	BOOL bUndo (pDoc->IsUndoEnabled());
++    const ScAddress::Convention eConv = pDoc->GetAddressConvention();
+ 
+ 	ScPrintRangeSaver* pOldRanges = pDoc->CreatePrintRangeSaver();
+ 
++    ScAddress::Details aDetails(pDoc->GetAddressConvention(), 0, 0);
++
+ 	for (nTab=0; nTab<nTabCount; nTab++)
+ 		if (rMark.GetTableSelect(nTab))
+ 		{
+@@ -984,11 +987,12 @@
+ 			{
+                 if ( pPrint->Len() )
+ 				{
+-					USHORT nTCount = pPrint->GetTokenCount();
++                    const sal_Unicode sep = ScCompiler::GetStringFromOpCode(ocSep).GetChar(0);
++                    USHORT nTCount = pPrint->GetTokenCount(sep);
+ 					for (USHORT i=0; i<nTCount; i++)
+ 					{
+-						String aToken = pPrint->GetToken(i);
+-						if ( aRange.ParseAny( aToken, pDoc ) & SCA_VALID )
++						String aToken = pPrint->GetToken(i, sep);
++						if ( aRange.ParseAny( aToken, pDoc, aDetails ) & SCA_VALID )
+                             pDoc->AddPrintRange( nTab, aRange );
+ 					}
+ 				}
+@@ -1025,7 +1029,7 @@
+ 				if ( !pRepCol->Len() )
+ 					pDoc->SetRepeatColRange( nTab, NULL );
+ 				else
+-					if ( aRange.ParseAny( *pRepCol, pDoc ) & SCA_VALID )
++					if ( aRange.ParseAny( *pRepCol, pDoc, aDetails ) & SCA_VALID )
+ 						pDoc->SetRepeatColRange( nTab, &aRange );
+ 			}
+ 
+@@ -1036,7 +1040,7 @@
+ 				if ( !pRepRow->Len() )
+ 					pDoc->SetRepeatRowRange( nTab, NULL );
+ 				else
+-					if ( aRange.ParseAny( *pRepRow, pDoc ) & SCA_VALID )
++					if ( aRange.ParseAny( *pRepRow, pDoc, aDetails ) & SCA_VALID )
+ 						pDoc->SetRepeatRowRange( nTab, &aRange );
+ 			}
+ 		}
+Index: sc/source/ui/view/viewfun5.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/view/viewfun5.cxx,v
+retrieving revision 1.52
+retrieving revision 1.52.12.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.52 -r1.52.12.1
+--- sc/source/ui/view/viewfun5.cxx	6 Mar 2008 16:21:28 -0000	1.52
++++ sc/source/ui/view/viewfun5.cxx	20 Mar 2008 23:21:12 -0000	1.52.12.1
+@@ -410,7 +410,7 @@
+ 			else
+ 			{
+ 				ScAddress aCellPos( nPosX,nPosY,nTab );
+-				aCellPos.Format( sTarget, SCA_ABS_3D, pDoc );
++				aCellPos.Format( sTarget, SCA_ABS_3D, pDoc, pDoc->GetAddressConvention() );
+ 			}
+ 			SfxStringItem aTarget(FN_PARAM_1, sTarget);
+ 
+Index: sc/source/ui/view/viewfunc.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/view/viewfunc.cxx,v
+retrieving revision 1.42
+retrieving revision 1.42.12.1
+diff -u -b -I $Revision.*$ -I $Author.*$ -r1.42 -r1.42.12.1
+--- sc/source/ui/view/viewfunc.cxx	7 Mar 2008 11:23:12 -0000	1.42
++++ sc/source/ui/view/viewfunc.cxx	19 Mar 2008 17:37:16 -0000	1.42.12.1
+@@ -467,7 +467,7 @@
+ 				if (rMark.GetTableSelect(i))
+ 					break;
+ 			ScAddress aPos( nCol, nRow, i );
+-			ScCompiler aComp( pDoc, aPos );
++			ScCompiler aComp( pDoc, aPos, pDoc->GetGrammar() );
+ //2do: AutoCorrection via CalcOptions abschaltbar machen
+ 			aComp.SetAutoCorrection( TRUE );
+ 			String aFormula( rString );



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]