ooo-build r14991 - in trunk: . patches/dev300
- From: kyoshida svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r14991 - in trunk: . patches/dev300
- Date: Sat, 3 Jan 2009 07:40:17 +0000 (UTC)
Author: kyoshida
Date: Sat Jan 3 07:40:16 2009
New Revision: 14991
URL: http://svn.gnome.org/viewvc/ooo-build?rev=14991&view=rev
Log:
2009-01-03 Kohei Yoshida <kyoshida novell com>
* patches/dev300/chart-odf-always-calc-a1.diff: always store cell
ranges using CONV_OOO address convention ('Calc A1' in the UI).
(n#463305)
* patches/dev300/apply: apply this new patch.
Added:
trunk/patches/dev300/chart-odf-always-calc-a1.diff
Modified:
trunk/ChangeLog
trunk/patches/dev300/apply
Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply (original)
+++ trunk/patches/dev300/apply Sat Jan 3 07:40:16 2009
@@ -910,6 +910,9 @@
# fixed chart wizard failure when the formula syntax is set to Excel A1/R1C1.
chart-wizard-xls-address-convention-fix.diff, n#411450, i#94696, kohei
+# always store ranges in ODF using Calc A1 formula syntax.
+chart-odf-always-calc-a1.diff, n#463305, kohei
+
# fixed change track export to xls files wrt cell change records.
calc-change-track-xls-export-fix.diff, n#416045, i#93839, kohei
Added: trunk/patches/dev300/chart-odf-always-calc-a1.diff
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/chart-odf-always-calc-a1.diff Sat Jan 3 07:40:16 2009
@@ -0,0 +1,1014 @@
+diff --git sc/inc/rangeutl.hxx sc/inc/rangeutl.hxx
+index 8576bbf..66f6cb3 100644
+--- sc/inc/rangeutl.hxx
++++ sc/inc/rangeutl.hxx
+@@ -38,6 +38,11 @@
+ #include <com/sun/star/table/CellRangeAddress.hpp>
+ #include <com/sun/star/uno/Sequence.hxx>
+
++// Chart always stores cell range addresses using CONV_OOO convention. But
++// if parsing with CONV_OOO fails, try parsing it using the current address
++// convention.
++#define CHART_ADDRESS_CONV_WORKAROUND 1
++
+ //------------------------------------------------------------------------
+
+ class SvStream;
+@@ -146,6 +151,7 @@ public:
+ ScAddress& rAddress,
+ const ::rtl::OUString& rAddressStr,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Int32& nOffset,
+ sal_Unicode cSeperator = ' ',
+ sal_Unicode cQuote = '\'');
+@@ -153,6 +159,7 @@ public:
+ ScRange& rRange,
+ const ::rtl::OUString& rRangeStr,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Int32& nOffset,
+ sal_Unicode cSeperator = ' ',
+ sal_Unicode cQuote = '\'');
+@@ -160,6 +167,7 @@ public:
+ ScRangeList& rRangeList,
+ const ::rtl::OUString& rRangeListStr,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Unicode cSeperator = ' ',
+ sal_Unicode cQuote = '\'');
+
+@@ -167,6 +175,7 @@ public:
+ ScArea& rArea,
+ const ::rtl::OUString& rRangeStr,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Int32& nOffset,
+ sal_Unicode cSeperator = ' ',
+ sal_Unicode cQuote = '\'');
+@@ -176,6 +185,7 @@ public:
+ ::com::sun::star::table::CellAddress& rAddress,
+ const ::rtl::OUString& rAddressStr,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Int32& nOffset,
+ sal_Unicode cSeperator = ' ',
+ sal_Unicode cQuote = '\'');
+@@ -183,6 +193,7 @@ public:
+ ::com::sun::star::table::CellRangeAddress& rRange,
+ const ::rtl::OUString& rRangeStr,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Int32& nOffset,
+ sal_Unicode cSeperator = ' ',
+ sal_Unicode cQuote = '\'');
+@@ -190,6 +201,7 @@ public:
+ ::com::sun::star::uno::Sequence< ::com::sun::star::table::CellRangeAddress >& rRangeSeq,
+ const ::rtl::OUString& rRangeListStr,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Unicode cSeperator = ' ',
+ sal_Unicode cQuote = '\'');
+
+@@ -198,6 +210,7 @@ public:
+ ::rtl::OUString& rString,
+ const ScAddress& rAddress,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Unicode cSeperator = ' ',
+ sal_Bool bAppendStr = sal_False,
+ sal_uInt16 nFormatFlags = (SCA_VALID | SCA_TAB_3D) );
+@@ -205,6 +218,7 @@ public:
+ ::rtl::OUString& rString,
+ const ScRange& rRange,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Unicode cSeperator = ' ',
+ sal_Bool bAppendStr = sal_False,
+ sal_uInt16 nFormatFlags = (SCA_VALID | SCA_TAB_3D) );
+@@ -212,6 +226,7 @@ public:
+ ::rtl::OUString& rString,
+ const ScRangeList* pRangeList,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Unicode cSeperator = ' ',
+ sal_uInt16 nFormatFlags = (SCA_VALID | SCA_TAB_3D));
+
+@@ -219,6 +234,7 @@ public:
+ ::rtl::OUString& rString,
+ const ScArea& rArea,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Unicode cSeperator = ' ',
+ sal_Bool bAppendStr = sal_False,
+ sal_uInt16 nFormatFlags = (SCA_VALID | SCA_TAB_3D) );
+@@ -228,6 +244,7 @@ public:
+ ::rtl::OUString& rString,
+ const ::com::sun::star::table::CellAddress& rAddress,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Unicode cSeperator = ' ',
+ sal_Bool bAppendStr = sal_False,
+ sal_uInt16 nFormatFlags = (SCA_VALID | SCA_TAB_3D) );
+@@ -235,6 +252,7 @@ public:
+ ::rtl::OUString& rString,
+ const ::com::sun::star::table::CellRangeAddress& rRange,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Unicode cSeperator = ' ',
+ sal_Bool bAppendStr = sal_False,
+ sal_uInt16 nFormatFlags = (SCA_VALID | SCA_TAB_3D) );
+@@ -242,6 +260,7 @@ public:
+ ::rtl::OUString& rString,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::table::CellRangeAddress >& rRangeSeq,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Unicode cSeperator = ' ',
+ sal_uInt16 nFormatFlags = (SCA_VALID | SCA_TAB_3D) );
+ };
+diff --git sc/source/core/tool/rangeutl.cxx sc/source/core/tool/rangeutl.cxx
+index 8e873e7..76f6e26 100644
+--- sc/source/core/tool/rangeutl.cxx
++++ sc/source/core/tool/rangeutl.cxx
+@@ -456,6 +456,7 @@ sal_Bool ScRangeStringConverter::GetAddressFromString(
+ ScAddress& rAddress,
+ const OUString& rAddressStr,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Int32& nOffset,
+ sal_Unicode cSeperator,
+ sal_Unicode cQuote )
+@@ -463,7 +464,15 @@ sal_Bool ScRangeStringConverter::GetAddressFromString(
+ OUString sToken;
+ GetTokenByOffset( sToken, rAddressStr, nOffset, cSeperator, cQuote );
+ if( nOffset >= 0 )
+- return ((rAddress.Parse( sToken, const_cast<ScDocument*>(pDocument), pDocument->GetAddressConvention() ) & SCA_VALID) == SCA_VALID);
++ {
++ if ((rAddress.Parse( sToken, const_cast<ScDocument*>(pDocument), eConv ) & SCA_VALID) == SCA_VALID)
++ return true;
++#if CHART_ADDRESS_CONV_WORKAROUND
++ ScAddress::Convention eConvUI = pDocument->GetAddressConvention();
++ if (eConv != eConvUI)
++ return ((rAddress.Parse(sToken, const_cast<ScDocument*>(pDocument), eConvUI) & SCA_VALID) == SCA_VALID);
++#endif
++ }
+ return sal_False;
+ }
+
+@@ -471,12 +480,14 @@ sal_Bool ScRangeStringConverter::GetRangeFromString(
+ ScRange& rRange,
+ const OUString& rRangeStr,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Int32& nOffset,
+ sal_Unicode cSeperator,
+ sal_Unicode cQuote )
+ {
+ OUString sToken;
+ sal_Bool bResult(sal_False);
++ ScAddress::Convention eConvUI = pDocument->GetAddressConvention();
+ GetTokenByOffset( sToken, rRangeStr, nOffset, cSeperator, cQuote );
+ if( nOffset >= 0 )
+ {
+@@ -487,7 +498,12 @@ sal_Bool ScRangeStringConverter::GetRangeFromString(
+ {
+ if ( aUIString.GetChar(0) == (sal_Unicode) '.' )
+ aUIString.Erase( 0, 1 );
+- bResult = ((rRange.aStart.Parse( aUIString, const_cast<ScDocument*> (pDocument), pDocument->GetAddressConvention()) & SCA_VALID) == SCA_VALID);
++ bResult = ((rRange.aStart.Parse( aUIString, const_cast<ScDocument*> (pDocument), eConv) & SCA_VALID) == SCA_VALID);
++#if CHART_ADDRESS_CONV_WORKAROUND
++ if (!bResult && eConv != eConvUI)
++ bResult = ((rRange.aStart.Parse(
++ aUIString, const_cast<ScDocument*>(pDocument), eConvUI) & SCA_VALID) == SCA_VALID);
++#endif
+ rRange.aEnd = rRange.aStart;
+ }
+ else
+@@ -502,15 +518,28 @@ sal_Bool ScRangeStringConverter::GetRangeFromString(
+ aUIString.GetChar((xub_StrLen)nIndex + 1) == (sal_Unicode) '.' )
+ aUIString.Erase( (xub_StrLen)nIndex + 1, 1 );
+
+- bResult = ((rRange.Parse(aUIString, const_cast<ScDocument*> (pDocument)) & SCA_VALID) == SCA_VALID);
++ bResult = ((rRange.Parse(aUIString, const_cast<ScDocument*> (pDocument), eConv) & SCA_VALID) == SCA_VALID);
+
+ // #i77703# chart ranges in the file format contain both sheet names, even for an external reference sheet.
+ // This isn't parsed by ScRange, so try to parse the two Addresses then.
+ if (!bResult)
++ {
+ bResult = ((rRange.aStart.Parse( aUIString.Copy(0, (xub_StrLen)nIndex), const_cast<ScDocument*>(pDocument),
+- pDocument->GetAddressConvention()) & SCA_VALID) == SCA_VALID) &&
++ eConv) & SCA_VALID) == SCA_VALID) &&
+ ((rRange.aEnd.Parse( aUIString.Copy((xub_StrLen)nIndex+1), const_cast<ScDocument*>(pDocument),
+- pDocument->GetAddressConvention()) & SCA_VALID) == SCA_VALID);
++ eConv) & SCA_VALID) == SCA_VALID);
++#if CHART_ADDRESS_CONV_WORKAROUND
++ if (!bResult && eConv != eConvUI)
++ {
++ bResult = ((rRange.aStart.Parse( aUIString.Copy(0, (xub_StrLen)nIndex), const_cast<ScDocument*>(pDocument),
++ eConvUI) & SCA_VALID) == SCA_VALID) &&
++ ((rRange.aEnd.Parse( aUIString.Copy((xub_StrLen)nIndex+1), const_cast<ScDocument*>(pDocument),
++ eConvUI) & SCA_VALID) == SCA_VALID);
++ String aFoo;
++ rRange.Format(aFoo, SCA_VALID, const_cast<ScDocument*>(pDocument));
++ }
++#endif
++ }
+ }
+ }
+ return bResult;
+@@ -520,6 +549,7 @@ sal_Bool ScRangeStringConverter::GetRangeListFromString(
+ ScRangeList& rRangeList,
+ const OUString& rRangeListStr,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Unicode cSeperator,
+ sal_Unicode cQuote )
+ {
+@@ -529,7 +559,7 @@ sal_Bool ScRangeStringConverter::GetRangeListFromString(
+ while( nOffset >= 0 )
+ {
+ ScRange* pRange = new ScRange;
+- if( GetRangeFromString( *pRange, rRangeListStr, pDocument, nOffset, cSeperator, cQuote ) && (nOffset >= 0) )
++ if( GetRangeFromString( *pRange, rRangeListStr, pDocument, eConv, nOffset, cSeperator, cQuote ) && (nOffset >= 0) )
+ rRangeList.Insert( pRange, LIST_APPEND );
+ else if (nOffset > -1)
+ bRet = sal_False;
+@@ -544,13 +574,14 @@ sal_Bool ScRangeStringConverter::GetAreaFromString(
+ ScArea& rArea,
+ const OUString& rRangeStr,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Int32& nOffset,
+ sal_Unicode cSeperator,
+ sal_Unicode cQuote )
+ {
+ ScRange aScRange;
+ sal_Bool bResult(sal_False);
+- if( GetRangeFromString( aScRange, rRangeStr, pDocument, nOffset, cSeperator, cQuote ) && (nOffset >= 0) )
++ if( GetRangeFromString( aScRange, rRangeStr, pDocument, eConv, nOffset, cSeperator, cQuote ) && (nOffset >= 0) )
+ {
+ rArea.nTab = aScRange.aStart.Tab();
+ rArea.nColStart = aScRange.aStart.Col();
+@@ -569,13 +600,14 @@ sal_Bool ScRangeStringConverter::GetAddressFromString(
+ table::CellAddress& rAddress,
+ const OUString& rAddressStr,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Int32& nOffset,
+ sal_Unicode cSeperator,
+ sal_Unicode cQuote )
+ {
+ ScAddress aScAddress;
+ sal_Bool bResult(sal_False);
+- if( GetAddressFromString( aScAddress, rAddressStr, pDocument, nOffset, cSeperator, cQuote ) && (nOffset >= 0) )
++ if( GetAddressFromString( aScAddress, rAddressStr, pDocument, eConv, nOffset, cSeperator, cQuote ) && (nOffset >= 0) )
+ {
+ ScUnoConversion::FillApiAddress( rAddress, aScAddress );
+ bResult = sal_True;
+@@ -587,13 +619,14 @@ sal_Bool ScRangeStringConverter::GetRangeFromString(
+ table::CellRangeAddress& rRange,
+ const OUString& rRangeStr,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Int32& nOffset,
+ sal_Unicode cSeperator,
+ sal_Unicode cQuote )
+ {
+ ScRange aScRange;
+ sal_Bool bResult(sal_False);
+- if( GetRangeFromString( aScRange, rRangeStr, pDocument, nOffset, cSeperator, cQuote ) && (nOffset >= 0) )
++ if( GetRangeFromString( aScRange, rRangeStr, pDocument, eConv, nOffset, cSeperator, cQuote ) && (nOffset >= 0) )
+ {
+ ScUnoConversion::FillApiRange( rRange, aScRange );
+ bResult = sal_True;
+@@ -605,6 +638,7 @@ sal_Bool ScRangeStringConverter::GetRangeListFromString(
+ uno::Sequence< table::CellRangeAddress >& rRangeSeq,
+ const OUString& rRangeListStr,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Unicode cSeperator,
+ sal_Unicode cQuote )
+ {
+@@ -614,7 +648,7 @@ sal_Bool ScRangeStringConverter::GetRangeListFromString(
+ sal_Int32 nOffset = 0;
+ while( nOffset >= 0 )
+ {
+- if( GetRangeFromString( aRange, rRangeListStr, pDocument, nOffset, cSeperator, cQuote ) && (nOffset >= 0) )
++ if( GetRangeFromString( aRange, rRangeListStr, pDocument, eConv, nOffset, cSeperator, cQuote ) && (nOffset >= 0) )
+ {
+ rRangeSeq.realloc( rRangeSeq.getLength() + 1 );
+ rRangeSeq[ rRangeSeq.getLength() - 1 ] = aRange;
+@@ -632,6 +666,7 @@ void ScRangeStringConverter::GetStringFromAddress(
+ OUString& rString,
+ const ScAddress& rAddress,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Unicode cSeperator,
+ sal_Bool bAppendStr,
+ sal_uInt16 nFormatFlags )
+@@ -639,7 +674,7 @@ void ScRangeStringConverter::GetStringFromAddress(
+ if (pDocument && pDocument->HasTable(rAddress.Tab()))
+ {
+ String sAddress;
+- rAddress.Format( sAddress, nFormatFlags, (ScDocument*) pDocument, pDocument->GetAddressConvention() );
++ rAddress.Format( sAddress, nFormatFlags, (ScDocument*) pDocument, eConv );
+ AssignString( rString, sAddress, bAppendStr, cSeperator );
+ }
+ }
+@@ -648,6 +683,7 @@ void ScRangeStringConverter::GetStringFromRange(
+ OUString& rString,
+ const ScRange& rRange,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Unicode cSeperator,
+ sal_Bool bAppendStr,
+ sal_uInt16 nFormatFlags )
+@@ -658,7 +694,6 @@ void ScRangeStringConverter::GetStringFromRange(
+ ScAddress aEndAddress( rRange.aEnd );
+ String sStartAddress;
+ String sEndAddress;
+- ScAddress::Convention eConv = pDocument->GetAddressConvention();
+ aStartAddress.Format( sStartAddress, nFormatFlags, (ScDocument*) pDocument, eConv );
+ aEndAddress.Format( sEndAddress, nFormatFlags, (ScDocument*) pDocument, eConv );
+ OUString sOUStartAddress( sStartAddress );
+@@ -672,6 +707,7 @@ void ScRangeStringConverter::GetStringFromRangeList(
+ OUString& rString,
+ const ScRangeList* pRangeList,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Unicode cSeperator,
+ sal_uInt16 nFormatFlags )
+ {
+@@ -683,7 +719,7 @@ void ScRangeStringConverter::GetStringFromRangeList(
+ {
+ const ScRange* pRange = pRangeList->GetObject( nIndex );
+ if( pRange )
+- GetStringFromRange( sRangeListStr, *pRange, pDocument, cSeperator, sal_True, nFormatFlags );
++ GetStringFromRange( sRangeListStr, *pRange, pDocument, eConv, cSeperator, sal_True, nFormatFlags );
+ }
+ }
+ rString = sRangeListStr;
+@@ -696,12 +732,13 @@ void ScRangeStringConverter::GetStringFromArea(
+ OUString& rString,
+ const ScArea& rArea,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Unicode cSeperator,
+ sal_Bool bAppendStr,
+ sal_uInt16 nFormatFlags )
+ {
+ ScRange aRange( rArea.nColStart, rArea.nRowStart, rArea.nTab, rArea.nColEnd, rArea.nRowEnd, rArea.nTab );
+- GetStringFromRange( rString, aRange, pDocument, cSeperator, bAppendStr, nFormatFlags );
++ GetStringFromRange( rString, aRange, pDocument, eConv, cSeperator, bAppendStr, nFormatFlags );
+ }
+
+
+@@ -711,31 +748,34 @@ void ScRangeStringConverter::GetStringFromAddress(
+ OUString& rString,
+ const table::CellAddress& rAddress,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Unicode cSeperator,
+ sal_Bool bAppendStr,
+ sal_uInt16 nFormatFlags )
+ {
+ ScAddress aScAddress( static_cast<SCCOL>(rAddress.Column), static_cast<SCROW>(rAddress.Row), rAddress.Sheet );
+- GetStringFromAddress( rString, aScAddress, pDocument, cSeperator, bAppendStr, nFormatFlags );
++ GetStringFromAddress( rString, aScAddress, pDocument, eConv, cSeperator, bAppendStr, nFormatFlags );
+ }
+
+ void ScRangeStringConverter::GetStringFromRange(
+ OUString& rString,
+ const table::CellRangeAddress& rRange,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Unicode cSeperator,
+ sal_Bool bAppendStr,
+ sal_uInt16 nFormatFlags )
+ {
+ ScRange aScRange( static_cast<SCCOL>(rRange.StartColumn), static_cast<SCROW>(rRange.StartRow), rRange.Sheet,
+ static_cast<SCCOL>(rRange.EndColumn), static_cast<SCROW>(rRange.EndRow), rRange.Sheet );
+- GetStringFromRange( rString, aScRange, pDocument, cSeperator, bAppendStr, nFormatFlags );
++ GetStringFromRange( rString, aScRange, pDocument, eConv, cSeperator, bAppendStr, nFormatFlags );
+ }
+
+ void ScRangeStringConverter::GetStringFromRangeList(
+ OUString& rString,
+ const uno::Sequence< table::CellRangeAddress >& rRangeSeq,
+ const ScDocument* pDocument,
++ ScAddress::Convention eConv,
+ sal_Unicode cSeperator,
+ sal_uInt16 nFormatFlags )
+ {
+@@ -744,7 +784,7 @@ void ScRangeStringConverter::GetStringFromRangeList(
+ for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
+ {
+ const table::CellRangeAddress& rRange = rRangeSeq[ nIndex ];
+- GetStringFromRange( sRangeListStr, rRange, pDocument, cSeperator, sal_True, nFormatFlags );
++ GetStringFromRange( sRangeListStr, rRange, pDocument, eConv, cSeperator, sal_True, nFormatFlags );
+ }
+ rString = sRangeListStr;
+ }
+diff --git sc/source/filter/excel/xechart.cxx sc/source/filter/excel/xechart.cxx
+index d986b48..7ca9458 100644
+--- sc/source/filter/excel/xechart.cxx
++++ sc/source/filter/excel/xechart.cxx
+@@ -679,7 +679,8 @@ sal_uInt16 XclExpChSourceLink::ConvertDataSequence( Reference< XDataSequence > x
+ {
+ OUString aRangeRepr = xDataSeq->getSourceRangeRepresentation();
+ ScRangeList aScRanges;
+- if( ScRangeStringConverter::GetRangeListFromString( aScRanges, aRangeRepr, GetDocPtr(), ';' ) )
++ ScDocument* pDoc = GetDocPtr();
++ if( ScRangeStringConverter::GetRangeListFromString( aScRanges, aRangeRepr, pDoc, pDoc->GetAddressConvention(), ';' ) )
+ {
+ // split 3-dimensional ranges into single sheets
+ ScRangeList aNewScRanges;
+diff --git sc/source/filter/excel/xichart.cxx sc/source/filter/excel/xichart.cxx
+index 473d1b0..e7d60d3 100644
+--- sc/source/filter/excel/xichart.cxx
++++ sc/source/filter/excel/xichart.cxx
+@@ -695,7 +695,8 @@ Reference< XDataSequence > XclImpChSourceLink::CreateDataSequence( const OUStrin
+ {
+ // create the string representation of the range list
+ OUString aRangeRep;
+- ScRangeStringConverter::GetStringFromRangeList( aRangeRep, &maScRanges, GetDocPtr(), ';' );
++ ScDocument* pDoc = GetDocPtr();
++ ScRangeStringConverter::GetStringFromRangeList( aRangeRep, &maScRanges, pDoc, pDoc->GetAddressConvention(), ';' );
+
+ // create the data sequence
+ try
+diff --git sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx
+index 9983eb6..def9694 100644
+--- sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx
++++ sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx
+@@ -395,7 +395,7 @@ void ScChangeTrackingExportHelper::WriteFormulaCell(const ScBaseCell* pCell, con
+ {
+ rtl::OUString sAddress;
+ const ScDocument* pDoc = rExport.GetDocument();
+- ScRangeStringConverter::GetStringFromAddress(sAddress, pFormulaCell->aPos, pDoc);
++ ScRangeStringConverter::GetStringFromAddress(sAddress, pFormulaCell->aPos, pDoc, ScAddress::CONV_OOO);
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_CELL_ADDRESS, sAddress);
+ const ScGrammar::Grammar eGrammar = pDoc->GetStorageGrammar();
+ sal_uInt16 nNamespacePrefix = (eGrammar == ScGrammar::GRAM_ODFF ? XML_NAMESPACE_OF : XML_NAMESPACE_OOOC);
+diff --git sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
+index 1c386a4..37528b2 100644
+--- sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
++++ sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
+@@ -74,7 +74,7 @@ ScBaseCell* ScMyCellInfo::CreateCell(ScDocument* pDoc)
+ {
+ ScAddress aPos;
+ sal_Int32 nOffset(0);
+- ScRangeStringConverter::GetAddressFromString(aPos, sFormulaAddress, pDoc, nOffset);
++ ScRangeStringConverter::GetAddressFromString(aPos, sFormulaAddress, pDoc, ScAddress::CONV_OOO, nOffset);
+ pCell = new ScFormulaCell(pDoc, aPos, sFormula, eGrammar, nMatrixFlag);
+ static_cast<ScFormulaCell*>(pCell)->SetMatColsRows(static_cast<SCCOL>(nMatrixCols), static_cast<SCROW>(nMatrixRows));
+ }
+diff --git sc/source/filter/xml/XMLConsolidationContext.cxx sc/source/filter/xml/XMLConsolidationContext.cxx
+index e04ad00..af8d9f7 100644
+--- sc/source/filter/xml/XMLConsolidationContext.cxx
++++ sc/source/filter/xml/XMLConsolidationContext.cxx
+@@ -84,7 +84,7 @@ ScXMLConsolidationContext::ScXMLConsolidationContext(
+ {
+ sal_Int32 nOffset(0);
+ bTargetAddr = ScRangeStringConverter::GetAddressFromString(
+- aTargetAddr, sValue, GetScImport().GetDocument(), nOffset );
++ aTargetAddr, sValue, GetScImport().GetDocument(), ScAddress::CONV_OOO, nOffset );
+ }
+ break;
+ case XML_TOK_CONSOLIDATION_ATTR_USE_LABEL:
+@@ -130,7 +130,7 @@ void ScXMLConsolidationContext::EndElement()
+ {
+ ppAreas[ nIndex ] = new ScArea;
+ if ( !ScRangeStringConverter::GetAreaFromString(
+- *ppAreas[ nIndex ], sSourceList, GetScImport().GetDocument(), nOffset ) )
++ *ppAreas[ nIndex ], sSourceList, GetScImport().GetDocument(), ScAddress::CONV_OOO, nOffset ) )
+ {
+ bError = sal_True; //! handle error
+ }
+diff --git sc/source/filter/xml/XMLDetectiveContext.cxx sc/source/filter/xml/XMLDetectiveContext.cxx
+index 5abc4e2..6ef23b9 100644
+--- sc/source/filter/xml/XMLDetectiveContext.cxx
++++ sc/source/filter/xml/XMLDetectiveContext.cxx
+@@ -157,7 +157,7 @@ ScXMLDetectiveHighlightedContext::ScXMLDetectiveHighlightedContext(
+ {
+ sal_Int32 nOffset(0);
+ GetScImport().LockSolarMutex();
+- bValid = ScRangeStringConverter::GetRangeFromString( aDetectiveObj.aSourceRange, sValue, GetScImport().GetDocument(), nOffset );
++ bValid = ScRangeStringConverter::GetRangeFromString( aDetectiveObj.aSourceRange, sValue, GetScImport().GetDocument(), ScAddress::CONV_OOO, nOffset );
+ GetScImport().UnlockSolarMutex();
+ }
+ break;
+diff --git sc/source/filter/xml/XMLExportDataPilot.cxx sc/source/filter/xml/XMLExportDataPilot.cxx
+index 79c505e..3e2b31e 100644
+--- sc/source/filter/xml/XMLExportDataPilot.cxx
++++ sc/source/filter/xml/XMLExportDataPilot.cxx
+@@ -204,7 +204,7 @@ void ScXMLExportDataPilot::WriteDPFilter(const ScQueryParam& aQueryParam)
+ ScRange aConditionRange(aQueryParam.nCol1, aQueryParam.nRow1, aQueryParam.nTab,
+ aQueryParam.nCol2, aQueryParam.nRow2, aQueryParam.nTab);
+ rtl::OUString sConditionRange;
+- ScRangeStringConverter::GetStringFromRange( sConditionRange, aConditionRange, pDoc );
++ ScRangeStringConverter::GetStringFromRange( sConditionRange, aConditionRange, pDoc, ScAddress::CONV_OOO );
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_CONDITION_SOURCE_RANGE_ADDRESS, sConditionRange);
+ }
+ if (!aQueryParam.bDuplicate)
+@@ -734,7 +734,7 @@ void ScXMLExportDataPilot::WriteDataPilots(const uno::Reference <sheet::XSpreads
+ {
+ ScRange aOutRange((*pDPs)[i]->GetOutRange());
+ rtl::OUString sTargetRangeAddress;
+- ScRangeStringConverter::GetStringFromRange( sTargetRangeAddress, aOutRange, pDoc );
++ ScRangeStringConverter::GetStringFromRange( sTargetRangeAddress, aOutRange, pDoc, ScAddress::CONV_OOO );
+ ScDocAttrIterator aAttrItr(pDoc, aOutRange.aStart.Tab(),
+ aOutRange.aStart.Col(), aOutRange.aStart.Row(),
+ aOutRange.aEnd.Col(), aOutRange.aEnd.Row());
+@@ -751,7 +751,7 @@ void ScXMLExportDataPilot::WriteDataPilots(const uno::Reference <sheet::XSpreads
+ {
+ ScAddress aButtonAddr(nCol, nButtonRow, aOutRange.aStart.Tab());
+ ScRangeStringConverter::GetStringFromAddress(
+- sOUButtonList, aButtonAddr, pDoc, ' ', sal_True );
++ sOUButtonList, aButtonAddr, pDoc, ScAddress::CONV_OOO, ' ', sal_True );
+ }
+ }
+ pAttr = aAttrItr.GetNext(nCol, nRow1, nRow2);
+@@ -789,7 +789,7 @@ void ScXMLExportDataPilot::WriteDataPilots(const uno::Reference <sheet::XSpreads
+ {
+ const ScSheetSourceDesc* pSheetSource = (*pDPs)[i]->GetSheetDesc();
+ rtl::OUString sCellRangeAddress;
+- ScRangeStringConverter::GetStringFromRange( sCellRangeAddress, pSheetSource->aSourceRange, pDoc );
++ ScRangeStringConverter::GetStringFromRange( sCellRangeAddress, pSheetSource->aSourceRange, pDoc, ScAddress::CONV_OOO );
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_CELL_RANGE_ADDRESS, sCellRangeAddress);
+ SvXMLElementExport aElemSCR(rExport, XML_NAMESPACE_TABLE, XML_SOURCE_CELL_RANGE, sal_True, sal_True);
+ rExport.CheckAttrList();
+diff --git sc/source/filter/xml/XMLExportDatabaseRanges.cxx sc/source/filter/xml/XMLExportDatabaseRanges.cxx
+index 927ff68..38637c2 100644
+--- sc/source/filter/xml/XMLExportDatabaseRanges.cxx
++++ sc/source/filter/xml/XMLExportDatabaseRanges.cxx
+@@ -290,7 +290,7 @@ void ScXMLExportDatabaseRanges::WriteFilterDescriptor(const uno::Reference <shee
+ if (xPropertySet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_OUTPOS))) >>= aOutputPosition)
+ {
+ rtl::OUString sOUCellAddress;
+- ScRangeStringConverter::GetStringFromAddress( sOUCellAddress, aOutputPosition, pDoc );
++ ScRangeStringConverter::GetStringFromAddress( sOUCellAddress, aOutputPosition, pDoc, ScAddress::CONV_OOO );
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TARGET_RANGE_ADDRESS, sOUCellAddress);
+ }
+ }
+@@ -302,7 +302,7 @@ void ScXMLExportDatabaseRanges::WriteFilterDescriptor(const uno::Reference <shee
+ if (pDBData->GetAdvancedQuerySource(aAdvSource))
+ {
+ rtl::OUString sOUCellAddress;
+- ScRangeStringConverter::GetStringFromRange( sOUCellAddress, aAdvSource, pDoc );
++ ScRangeStringConverter::GetStringFromRange( sOUCellAddress, aAdvSource, pDoc, ScAddress::CONV_OOO );
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_CONDITION_SOURCE_RANGE_ADDRESS, sOUCellAddress);
+ }
+
+@@ -445,7 +445,7 @@ void ScXMLExportDatabaseRanges::WriteSortDescriptor(const uno::Sequence <beans::
+ if (bCopyOutputData)
+ {
+ rtl::OUString sOUCellAddress;
+- ScRangeStringConverter::GetStringFromAddress( sOUCellAddress, aOutputPosition, pDoc );
++ ScRangeStringConverter::GetStringFromAddress( sOUCellAddress, aOutputPosition, pDoc, ScAddress::CONV_OOO );
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TARGET_RANGE_ADDRESS, sOUCellAddress);
+ }
+ // no longer supported
+@@ -620,7 +620,7 @@ void ScXMLExportDatabaseRanges::WriteDatabaseRanges(const com::sun::star::uno::R
+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NAME, sDatabaseRangeName);
+ table::CellRangeAddress aRangeAddress(xDatabaseRange->getDataArea());
+ rtl::OUString sOUAddress;
+- ScRangeStringConverter::GetStringFromRange( sOUAddress, aRangeAddress, pDoc );
++ ScRangeStringConverter::GetStringFromRange( sOUAddress, aRangeAddress, pDoc, ScAddress::CONV_OOO );
+ rExport.AddAttribute (XML_NAMESPACE_TABLE, XML_TARGET_RANGE_ADDRESS, sOUAddress);
+ ScDBCollection* pDBCollection = pDoc->GetDBCollection();
+ sal_uInt16 nIndex;
+diff --git sc/source/filter/xml/XMLStylesExportHelper.cxx sc/source/filter/xml/XMLStylesExportHelper.cxx
+index 8c2ee06..e314835 100644
+--- sc/source/filter/xml/XMLStylesExportHelper.cxx
++++ sc/source/filter/xml/XMLStylesExportHelper.cxx
+@@ -306,7 +306,7 @@ rtl::OUString ScMyValidationsContainer::GetCondition(ScXMLExport& rExport, const
+ rtl::OUString ScMyValidationsContainer::GetBaseCellAddress(ScDocument* pDoc, const table::CellAddress& aCell)
+ {
+ rtl::OUString sAddress;
+- ScRangeStringConverter::GetStringFromAddress( sAddress, aCell, pDoc );
++ ScRangeStringConverter::GetStringFromAddress( sAddress, aCell, pDoc, ScAddress::CONV_OOO );
+ return sAddress;
+ }
+
+diff --git sc/source/filter/xml/XMLTableShapeImportHelper.cxx sc/source/filter/xml/XMLTableShapeImportHelper.cxx
+index 7f9fb3f..9546914 100644
+--- sc/source/filter/xml/XMLTableShapeImportHelper.cxx
++++ sc/source/filter/xml/XMLTableShapeImportHelper.cxx
+@@ -106,7 +106,7 @@ void XMLTableShapeImportHelper::finishShape(
+ if (IsXMLToken(aLocalName, XML_END_CELL_ADDRESS))
+ {
+ sal_Int32 nOffset(0);
+- ScRangeStringConverter::GetAddressFromString(aEndCell, rValue, static_cast<ScXMLImport&>(mrImporter).GetDocument(), nOffset);
++ ScRangeStringConverter::GetAddressFromString(aEndCell, rValue, static_cast<ScXMLImport&>(mrImporter).GetDocument(), ScAddress::CONV_OOO, nOffset);
+ }
+ else if (IsXMLToken(aLocalName, XML_END_X))
+ static_cast<ScXMLImport&>(mrImporter).GetMM100UnitConverter().convertMeasure(nEndX, rValue);
+diff --git sc/source/filter/xml/XMLTableShapeResizer.cxx sc/source/filter/xml/XMLTableShapeResizer.cxx
+index f5ab80c..d3be522 100644
+--- sc/source/filter/xml/XMLTableShapeResizer.cxx
++++ sc/source/filter/xml/XMLTableShapeResizer.cxx
+@@ -75,7 +75,7 @@ void ScMyShapeResizer::CreateChartListener(ScDocument* pDoc,
+ if (pCollection)
+ {
+ ScRangeListRef aRangeListRef(new ScRangeList());
+- ScRangeStringConverter::GetRangeListFromString(*aRangeListRef, *pRangeList, pDoc);
++ ScRangeStringConverter::GetRangeListFromString(*aRangeListRef, *pRangeList, pDoc, ScAddress::CONV_OOO);
+ if (aRangeListRef->Count())
+ {
+ ScChartListener* pCL(new ScChartListener(rName, pDoc, aRangeListRef ));
+diff --git sc/source/filter/xml/xmldpimp.cxx sc/source/filter/xml/xmldpimp.cxx
+index 9d79e15..457e7d0 100644
+--- sc/source/filter/xml/xmldpimp.cxx
++++ sc/source/filter/xml/xmldpimp.cxx
+@@ -175,7 +175,7 @@ ScXMLDataPilotTableContext::ScXMLDataPilotTableContext( ScXMLImport& rImport,
+ case XML_TOK_DATA_PILOT_TABLE_ATTR_TARGET_RANGE_ADDRESS :
+ {
+ sal_Int32 nOffset(0);
+- bTargetRangeAddress = ScRangeStringConverter::GetRangeFromString( aTargetRangeAddress, sValue, pDoc, nOffset );
++ bTargetRangeAddress = ScRangeStringConverter::GetRangeFromString( aTargetRangeAddress, sValue, pDoc, ScAddress::CONV_OOO, nOffset );
+ }
+ break;
+ case XML_TOK_DATA_PILOT_TABLE_ATTR_BUTTONS :
+@@ -272,7 +272,7 @@ void ScXMLDataPilotTableContext::SetButtons()
+ {
+ ScAddress aScAddress;
+ sal_Int32 nAddrOffset(0);
+- if (pDoc && ScRangeStringConverter::GetAddressFromString( aScAddress, sAddress, pDoc, nAddrOffset ))
++ if (pDoc && ScRangeStringConverter::GetAddressFromString( aScAddress, sAddress, pDoc, ScAddress::CONV_OOO, nAddrOffset ))
+ {
+ ScMergeFlagAttr aAttr( SC_MF_BUTTON );
+ pDoc->ApplyAttr( aScAddress.Col(), aScAddress.Row(), aScAddress.Tab(), aAttr );
+@@ -675,7 +675,7 @@ ScXMLSourceCellRangeContext::ScXMLSourceCellRangeContext( ScXMLImport& rImport,
+ {
+ ScRange aSourceRangeAddress;
+ sal_Int32 nOffset(0);
+- if (ScRangeStringConverter::GetRangeFromString( aSourceRangeAddress, sValue, GetScImport().GetDocument(), nOffset ))
++ if (ScRangeStringConverter::GetRangeFromString( aSourceRangeAddress, sValue, GetScImport().GetDocument(), ScAddress::CONV_OOO, nOffset ))
+ pDataPilotTable->SetSourceCellRangeAddress(aSourceRangeAddress);
+ }
+ break;
+diff --git sc/source/filter/xml/xmldrani.cxx sc/source/filter/xml/xmldrani.cxx
+index bf8219c..f0ab030 100644
+--- sc/source/filter/xml/xmldrani.cxx
++++ sc/source/filter/xml/xmldrani.cxx
+@@ -292,7 +292,7 @@ void ScXMLDatabaseRangeContext::EndElement()
+ {
+ table::CellRangeAddress aCellRangeAddress;
+ sal_Int32 nOffset(0);
+- if (ScRangeStringConverter::GetRangeFromString( aCellRangeAddress, sRangeAddress, pDoc, nOffset ))
++ if (ScRangeStringConverter::GetRangeFromString( aCellRangeAddress, sRangeAddress, pDoc, ScAddress::CONV_OOO, nOffset ))
+ {
+ sal_Bool bInsert(sal_True);
+ try
+diff --git sc/source/filter/xml/xmlexprt.cxx sc/source/filter/xml/xmlexprt.cxx
+index 8fd5b19..85a5e54 100644
+--- sc/source/filter/xml/xmlexprt.cxx
++++ sc/source/filter/xml/xmlexprt.cxx
+@@ -1422,7 +1422,7 @@ void ScXMLExport::GetColumnRowHeader(sal_Bool& rHasColumnHeader, table::CellRang
+ rRowHeaderRange = xPrintAreas->getTitleRows();
+ rColumnHeaderRange = xPrintAreas->getTitleColumns();
+ uno::Sequence< table::CellRangeAddress > aRangeList( xPrintAreas->getPrintAreas() );
+- ScRangeStringConverter::GetStringFromRangeList( rPrintRanges, aRangeList, pDoc );
++ ScRangeStringConverter::GetStringFromRangeList( rPrintRanges, aRangeList, pDoc, ScAddress::CONV_OOO );
+ }
+ }
+
+@@ -2687,7 +2687,7 @@ void ScXMLExport::WriteShapes(const ScMyCell& rMyCell)
+ Rectangle aEndRec(pDoc->GetMMRect(aItr->aEndAddress.Col(), aItr->aEndAddress.Row(),
+ aItr->aEndAddress.Col(), aItr->aEndAddress.Row(), aItr->aEndAddress.Tab()));
+ rtl::OUString sEndAddress;
+- ScRangeStringConverter::GetStringFromAddress(sEndAddress, aItr->aEndAddress, pDoc);
++ ScRangeStringConverter::GetStringFromAddress(sEndAddress, aItr->aEndAddress, pDoc, ScAddress::CONV_OOO);
+ AddAttribute(XML_NAMESPACE_TABLE, XML_END_CELL_ADDRESS, sEndAddress);
+ if (bNegativePage)
+ aEndPoint.X = -aEndRec.Right();
+@@ -2917,7 +2917,7 @@ void ScXMLExport::WriteDetective( const ScMyCell& rMyCell )
+ {
+ if( (aObjItr->eObjType == SC_DETOBJ_ARROW) || (aObjItr->eObjType == SC_DETOBJ_TOOTHERTAB))
+ {
+- ScRangeStringConverter::GetStringFromRange( sString, aObjItr->aSourceRange, pDoc );
++ ScRangeStringConverter::GetStringFromRange( sString, aObjItr->aSourceRange, pDoc, ScAddress::CONV_OOO );
+ AddAttribute( XML_NAMESPACE_TABLE, XML_CELL_RANGE_ADDRESS, sString );
+ }
+ ScXMLConverter::GetStringFromDetObjType( sString, aObjItr->eObjType );
+@@ -3308,7 +3308,7 @@ void ScXMLExport::WriteScenario()
+ AddAttribute(XML_NAMESPACE_TABLE, XML_IS_ACTIVE, aBuffer.makeStringAndClear());
+ const ScRangeList* pRangeList = pDoc->GetScenarioRanges(static_cast<SCTAB>(nCurrentTable));
+ rtl::OUString sRangeListStr;
+- ScRangeStringConverter::GetStringFromRangeList( sRangeListStr, pRangeList, pDoc );
++ ScRangeStringConverter::GetStringFromRangeList( sRangeListStr, pRangeList, pDoc, ScAddress::CONV_OOO );
+ AddAttribute(XML_NAMESPACE_TABLE, XML_SCENARIO_RANGES, sRangeListStr);
+ if (sComment.Len())
+ AddAttribute(XML_NAMESPACE_TABLE, XML_COMMENT, rtl::OUString(sComment));
+@@ -3350,10 +3350,10 @@ void ScXMLExport::WriteLabelRanges( const uno::Reference< container::XIndexAcces
+ {
+ OUString sRangeStr;
+ table::CellRangeAddress aCellRange( xRange->getLabelArea() );
+- ScRangeStringConverter::GetStringFromRange( sRangeStr, aCellRange, pDoc );
++ ScRangeStringConverter::GetStringFromRange( sRangeStr, aCellRange, pDoc, ScAddress::CONV_OOO );
+ AddAttribute( XML_NAMESPACE_TABLE, XML_LABEL_CELL_RANGE_ADDRESS, sRangeStr );
+ aCellRange = xRange->getDataArea();
+- ScRangeStringConverter::GetStringFromRange( sRangeStr, aCellRange, pDoc );
++ ScRangeStringConverter::GetStringFromRange( sRangeStr, aCellRange, pDoc, ScAddress::CONV_OOO );
+ AddAttribute( XML_NAMESPACE_TABLE, XML_DATA_CELL_RANGE_ADDRESS, sRangeStr );
+ AddAttribute( XML_NAMESPACE_TABLE, XML_ORIENTATION, bColumn ? XML_COLUMN : XML_ROW );
+ SvXMLElementExport aElem( *this, XML_NAMESPACE_TABLE, XML_LABEL_RANGE, sal_True, sal_True );
+@@ -3394,7 +3394,7 @@ void ScXMLExport::WriteNamedExpressions(const com::sun::star::uno::Reference <co
+
+ OUString sOUBaseCellAddress;
+ ScRangeStringConverter::GetStringFromAddress( sOUBaseCellAddress,
+- xNamedRange->getReferencePosition(), pDoc, ' ', sal_False, SCA_ABS_3D );
++ xNamedRange->getReferencePosition(), pDoc, ScAddress::CONV_OOO, ' ', sal_False, SCA_ABS_3D );
+ AddAttribute(XML_NAMESPACE_TABLE, XML_BASE_CELL_ADDRESS, sOUBaseCellAddress);
+
+ sal_uInt16 nRangeIndex;
+@@ -3668,10 +3668,10 @@ void ScXMLExport::WriteConsolidation()
+
+ sStrData = OUString();
+ for( sal_Int32 nIndex = 0; nIndex < pCons->nDataAreaCount; ++nIndex )
+- ScRangeStringConverter::GetStringFromArea( sStrData, *pCons->ppDataAreas[ nIndex ], pDoc, sal_True );
++ ScRangeStringConverter::GetStringFromArea( sStrData, *pCons->ppDataAreas[ nIndex ], pDoc, ScAddress::CONV_OOO, sal_True );
+ AddAttribute( XML_NAMESPACE_TABLE, XML_SOURCE_CELL_RANGE_ADDRESSES, sStrData );
+
+- ScRangeStringConverter::GetStringFromAddress( sStrData, ScAddress( pCons->nCol, pCons->nRow, pCons->nTab ), pDoc );
++ ScRangeStringConverter::GetStringFromAddress( sStrData, ScAddress( pCons->nCol, pCons->nRow, pCons->nTab ), pDoc, ScAddress::CONV_OOO );
+ AddAttribute( XML_NAMESPACE_TABLE, XML_TARGET_CELL_ADDRESS, sStrData );
+
+ if( pCons->bByCol && !pCons->bByRow )
+@@ -3741,7 +3741,7 @@ void ScXMLExport::GetChangeTrackViewSettings(uno::Sequence<beans::PropertyValue>
+ pChangeProps[SC_SHOW_CHANGES_BY_RANGES].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShowChangesByRanges"));
+ pChangeProps[SC_SHOW_CHANGES_BY_RANGES].Value <<= pViewSettings->HasRange();
+ rtl::OUString sRangeList;
+- ScRangeStringConverter::GetStringFromRangeList(sRangeList, &(pViewSettings->GetTheRangeList()), GetDocument());
++ ScRangeStringConverter::GetStringFromRangeList(sRangeList, &(pViewSettings->GetTheRangeList()), GetDocument(), ScAddress::CONV_OOO);
+ pChangeProps[SC_SHOW_CHANGES_BY_RANGES_LIST].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShowChangesByRangesList"));
+ pChangeProps[SC_SHOW_CHANGES_BY_RANGES_LIST].Value <<= sRangeList;
+
+diff --git sc/source/filter/xml/xmlfilti.cxx sc/source/filter/xml/xmlfilti.cxx
+index fabfb5c..01e44a6 100644
+--- sc/source/filter/xml/xmlfilti.cxx
++++ sc/source/filter/xml/xmlfilti.cxx
+@@ -84,7 +84,7 @@ ScXMLFilterContext::ScXMLFilterContext( ScXMLImport& rImport,
+ {
+ ScRange aScRange;
+ sal_Int32 nOffset(0);
+- if (ScRangeStringConverter::GetRangeFromString( aScRange, sValue, pDoc, nOffset ))
++ if (ScRangeStringConverter::GetRangeFromString( aScRange, sValue, pDoc, ScAddress::CONV_OOO, nOffset ))
+ {
+ ScUnoConversion::FillApiAddress( aOutputPosition, aScRange.aStart );
+ bCopyOutputData = sal_True;
+@@ -94,7 +94,7 @@ ScXMLFilterContext::ScXMLFilterContext( ScXMLImport& rImport,
+ case XML_TOK_FILTER_ATTR_CONDITION_SOURCE_RANGE_ADDRESS :
+ {
+ sal_Int32 nOffset(0);
+- if (ScRangeStringConverter::GetRangeFromString( aConditionSourceRangeAddress, sValue, pDoc, nOffset ))
++ if (ScRangeStringConverter::GetRangeFromString( aConditionSourceRangeAddress, sValue, pDoc, ScAddress::CONV_OOO, nOffset ))
+ bConditionSourceRange = sal_True;
+ }
+ break;
+@@ -444,7 +444,7 @@ ScXMLDPFilterContext::ScXMLDPFilterContext( ScXMLImport& rImport,
+ {
+ ScRange aScRange;
+ sal_Int32 nOffset(0);
+- if (ScRangeStringConverter::GetRangeFromString( aScRange, sValue, pDoc, nOffset ))
++ if (ScRangeStringConverter::GetRangeFromString( aScRange, sValue, pDoc, ScAddress::CONV_OOO, nOffset ))
+ {
+ aOutputPosition = aScRange.aStart;
+ bCopyOutputData = sal_True;
+@@ -454,7 +454,7 @@ ScXMLDPFilterContext::ScXMLDPFilterContext( ScXMLImport& rImport,
+ case XML_TOK_FILTER_ATTR_CONDITION_SOURCE_RANGE_ADDRESS :
+ {
+ sal_Int32 nOffset(0);
+- if(ScRangeStringConverter::GetRangeFromString( aConditionSourceRangeAddress, sValue, pDoc, nOffset ))
++ if(ScRangeStringConverter::GetRangeFromString( aConditionSourceRangeAddress, sValue, pDoc, ScAddress::CONV_OOO, nOffset ))
+ bConditionSourceRange = sal_True;
+ }
+ break;
+diff --git sc/source/filter/xml/xmlimprt.cxx sc/source/filter/xml/xmlimprt.cxx
+index 635b53d..f2ba5bd 100644
+--- sc/source/filter/xml/xmlimprt.cxx
++++ sc/source/filter/xml/xmlimprt.cxx
+@@ -2019,7 +2019,7 @@ void ScXMLImport::SetChangeTrackingViewSettings(const com::sun::star::uno::Seque
+ if ((rChangeProps[i].Value >>= sRanges) && sRanges.getLength())
+ {
+ ScRangeList aRangeList;
+- ScRangeStringConverter::GetRangeListFromString(aRangeList, sRanges, GetDocument());
++ ScRangeStringConverter::GetRangeListFromString(aRangeList, sRanges, GetDocument(), ScAddress::CONV_OOO);
+ pViewSettings->SetTheRangeList(aRangeList);
+ }
+ }
+@@ -2518,8 +2518,8 @@ void ScXMLImport::SetLabelRanges()
+ sal_Int32 nOffset1(0);
+ sal_Int32 nOffset2(0);
+
+- if (ScRangeStringConverter::GetRangeFromString( aLabelRange, (*aItr)->sLabelRangeStr, GetDocument(), nOffset1 ) &&
+- ScRangeStringConverter::GetRangeFromString( aDataRange, (*aItr)->sDataRangeStr, GetDocument(), nOffset2 ))
++ if (ScRangeStringConverter::GetRangeFromString( aLabelRange, (*aItr)->sLabelRangeStr, GetDocument(), ScAddress::CONV_OOO, nOffset1 ) &&
++ ScRangeStringConverter::GetRangeFromString( aDataRange, (*aItr)->sDataRangeStr, GetDocument(), ScAddress::CONV_OOO, nOffset2 ))
+ {
+ if ( (*aItr)->bColumnOrientation )
+ xColRanges->addNew( aLabelRange, aDataRange );
+@@ -2554,7 +2554,7 @@ void ScXMLImport::SetNamedRanges()
+ {
+ sal_Int32 nOffset(0);
+ if (ScRangeStringConverter::GetAddressFromString(
+- aCellAddress, (*aItr)->sBaseCellAddress, GetDocument(), nOffset ))
++ aCellAddress, (*aItr)->sBaseCellAddress, GetDocument(), ScAddress::CONV_OOO, nOffset ))
+ {
+ try
+ {
+@@ -2595,7 +2595,7 @@ void ScXMLImport::SetNamedRanges()
+ {
+ sal_Int32 nOffset(0);
+ if (ScRangeStringConverter::GetAddressFromString(
+- aCellAddress, (*aItr)->sBaseCellAddress, GetDocument(), nOffset ))
++ aCellAddress, (*aItr)->sBaseCellAddress, GetDocument(), ScAddress::CONV_OOO, nOffset ))
+ {
+ uno::Reference <sheet::XNamedRange> xNamedRange(xNamedRanges->getByName((*aItr)->sName), uno::UNO_QUERY);
+ if (xNamedRange.is())
+diff --git sc/source/filter/xml/xmlsceni.cxx sc/source/filter/xml/xmlsceni.cxx
+index 525c6de..fe17351 100644
+--- sc/source/filter/xml/xmlsceni.cxx
++++ sc/source/filter/xml/xmlsceni.cxx
+@@ -114,7 +114,7 @@ ScXMLTableScenarioContext::ScXMLTableScenarioContext(
+ case XML_TOK_TABLE_SCENARIO_ATTR_SCENARIO_RANGES:
+ {
+ ScRangeStringConverter::GetRangeListFromString(
+- aScenarioRanges, sValue, GetScImport().GetDocument() );
++ aScenarioRanges, sValue, GetScImport().GetDocument(), ScAddress::CONV_OOO );
+ }
+ break;
+ case XML_TOK_TABLE_SCENARIO_ATTR_COMMENT:
+diff --git sc/source/filter/xml/xmlsorti.cxx sc/source/filter/xml/xmlsorti.cxx
+index a2cddb8..b653a7f 100644
+--- sc/source/filter/xml/xmlsorti.cxx
++++ sc/source/filter/xml/xmlsorti.cxx
+@@ -93,7 +93,7 @@ ScXMLSortContext::ScXMLSortContext( ScXMLImport& rImport,
+ {
+ ScRange aScRange;
+ sal_Int32 nOffset(0);
+- if (ScRangeStringConverter::GetRangeFromString( aScRange, sValue, GetScImport().GetDocument(), nOffset ))
++ if (ScRangeStringConverter::GetRangeFromString( aScRange, sValue, GetScImport().GetDocument(), ScAddress::CONV_OOO, nOffset ))
+ {
+ ScUnoConversion::FillApiAddress( aOutputPosition, aScRange.aStart );
+ bCopyOutputData = sal_True;
+diff --git sc/source/filter/xml/xmlstyle.cxx sc/source/filter/xml/xmlstyle.cxx
+index 6ef1632..2d51ccc 100644
+--- sc/source/filter/xml/xmlstyle.cxx
++++ sc/source/filter/xml/xmlstyle.cxx
+@@ -708,8 +708,9 @@ void ScXMLAutoStylePoolP::exportStyleContent(
+ rScXMLExport.AddAttribute(XML_NAMESPACE_STYLE, XML_CONDITION, sCondition);
+ rScXMLExport.AddAttribute(XML_NAMESPACE_STYLE, XML_APPLY_STYLE_NAME, rScXMLExport.EncodeStyleName( sStyleName ));
+ OUString sOUBaseAddress;
++ ScDocument* pDoc = rScXMLExport.GetDocument();
+ ScRangeStringConverter::GetStringFromAddress( sOUBaseAddress,
+- xSheetCondition->getSourcePosition(), rScXMLExport.GetDocument() );
++ xSheetCondition->getSourcePosition(), pDoc, ScAddress::CONV_OOO );
+ rScXMLExport.AddAttribute(XML_NAMESPACE_STYLE, XML_BASE_CELL_ADDRESS, sOUBaseAddress);
+ SvXMLElementExport aMElem(rScXMLExport, XML_NAMESPACE_STYLE, XML_MAP, sal_True, sal_True);
+ }
+@@ -762,7 +763,7 @@ void ScXMLAutoStylePoolP::exportStyleContent(
+ rScXMLExport.AddAttribute(XML_NAMESPACE_STYLE, XML_APPLY_STYLE_NAME, rScXMLExport.EncodeStyleName( sStyleName ));
+ OUString sOUBaseAddress;
+ ScRangeStringConverter::GetStringFromAddress( sOUBaseAddress,
+- xSheetCondition->getSourcePosition(), rScXMLExport.GetDocument() );
++ xSheetCondition->getSourcePosition(), rScXMLExport.GetDocument(), ScAddress::CONV_OOO );
+ rScXMLExport.AddAttribute(XML_NAMESPACE_STYLE, XML_BASE_CELL_ADDRESS, sOUBaseAddress);
+ SvXMLElementExport aMElem(rScXMLExport, XML_NAMESPACE_STYLE, XML_MAP, sal_True, sal_True);
+ }
+diff --git sc/source/filter/xml/xmltabi.cxx sc/source/filter/xml/xmltabi.cxx
+index f665b56..8b081be 100644
+--- sc/source/filter/xml/xmltabi.cxx
++++ sc/source/filter/xml/xmltabi.cxx
+@@ -331,7 +331,7 @@ void ScXMLTableContext::EndElement()
+ if( xPrintAreas.is() )
+ {
+ uno::Sequence< table::CellRangeAddress > aRangeList;
+- ScRangeStringConverter::GetRangeListFromString( aRangeList, sPrintRanges, pDoc );
++ ScRangeStringConverter::GetRangeListFromString( aRangeList, sPrintRanges, pDoc, ScAddress::CONV_OOO );
+ xPrintAreas->setPrintAreas( aRangeList );
+ }
+ }
+diff --git sc/source/ui/unoobj/chart2uno.cxx sc/source/ui/unoobj/chart2uno.cxx
+index 2ab864a..f375b9b 100644
+--- sc/source/ui/unoobj/chart2uno.cxx
++++ sc/source/ui/unoobj/chart2uno.cxx
+@@ -1008,7 +1008,7 @@ uno::Reference< chart2::data::XDataSequence > SAL_CALL
+ return xResult;
+
+ ScRangeListRef aRangeList = new ScRangeList();
+- if (ScRangeStringConverter::GetRangeListFromString( *aRangeList, aRangeRepresentation, m_pDocument, ';' ))
++ if (ScRangeStringConverter::GetRangeListFromString( *aRangeList, aRangeRepresentation, m_pDocument, m_pDocument->GetAddressConvention(), ';' ))
+ xResult.set(new ScChart2DataSequence(m_pDocument, this, aRangeList));
+
+ return xResult;
+@@ -1042,9 +1042,9 @@ rtl::OUString SAL_CALL ScChart2DataProvider::convertRangeToXML( const rtl::OUStr
+ if( m_pDocument )
+ {
+ ScRangeList aList;
+- if( !ScRangeStringConverter::GetRangeListFromString(aList, sRangeRepresentation, m_pDocument, ';'))
++ if( !ScRangeStringConverter::GetRangeListFromString(aList, sRangeRepresentation, m_pDocument, m_pDocument->GetAddressConvention(), ';'))
+ throw lang::IllegalArgumentException();
+- ScRangeStringConverter::GetStringFromRangeList(sRet, &aList, m_pDocument);
++ ScRangeStringConverter::GetStringFromRangeList(sRet, &aList, m_pDocument, ScAddress::CONV_OOO);
+ }
+
+ return sRet;
+@@ -1053,12 +1053,64 @@ rtl::OUString SAL_CALL ScChart2DataProvider::convertRangeToXML( const rtl::OUStr
+ rtl::OUString SAL_CALL ScChart2DataProvider::convertRangeFromXML( const rtl::OUString& sXMLRange )
+ throw ( uno::RuntimeException, lang::IllegalArgumentException )
+ {
+- // #i74062# When loading flat XML, this is called before the referenced sheets are in the document,
+- // so the conversion has to take place directly with the strings, without looking up the sheets.
+-
+ const sal_Unicode cSep = ' ';
+ const sal_Unicode cQuote = '\'';
+
++ if (m_pDocument)
++ {
++ ScAddress::Convention eConvUI = m_pDocument->GetAddressConvention();
++ ScRange aRange;
++
++ // Chart always saves ranges using CONV_OOO convention.
++ USHORT nRes = aRange.Parse(sXMLRange, m_pDocument, ScAddress::CONV_OOO);
++ if ((nRes & SCA_VALID) == SCA_VALID)
++ {
++ // conversion success !
++ String aRet;
++ aRange.Format(aRet, SCA_VALID, m_pDocument, eConvUI);
++ return aRet;
++ }
++
++ if (eConvUI == ScAddress::CONV_OOO)
++ // convertion failed !
++ return sXMLRange;
++
++#if CHART_ADDRESS_CONV_WORKAROUND
++ // Chart always expressed a range as [start cell] : [end cell]
++ // regardless of address conventions when stored in ODF. This means,
++ // for example, Sheet1!A1:A3 in Excel A1 syntax was expressed as
++ // Sheet1!A1:Sheet1!A3.
++ sal_Int32 nSepPos = sXMLRange.indexOf(sal_Unicode(':'));
++ if (nSepPos >= 0)
++ {
++ rtl::OUString aStartAddr = sXMLRange.copy(0, nSepPos);
++ rtl::OUString aEndAddr = sXMLRange.copy(nSepPos+1);
++ nRes = aRange.aStart.Parse(aStartAddr, m_pDocument, eConvUI);
++ if ((nRes & SCA_VALID) != SCA_VALID)
++ return sXMLRange;
++
++ nRes = aRange.aEnd.Parse(aEndAddr, m_pDocument, eConvUI);
++ if ((nRes & SCA_VALID) != SCA_VALID)
++ return sXMLRange;
++ }
++ else
++ {
++ nRes = aRange.aStart.Parse(sXMLRange, m_pDocument, eConvUI);
++ if ((nRes & SCA_VALID) != SCA_VALID)
++ return sXMLRange;
++
++ aRange.aEnd = aRange.aStart;
++ }
++
++ String aRet;
++ aRange.Format(aRet, SCA_VALID, m_pDocument, eConvUI);
++ return aRet;
++#endif
++ }
++
++ // #i74062# When loading flat XML, this is called before the referenced sheets are in the document,
++ // so the conversion has to take place directly with the strings, without looking up the sheets.
++
+ rtl::OUStringBuffer sRet;
+ sal_Int32 nOffset = 0;
+ while( nOffset >= 0 )
+diff --git sc/source/ui/unoobj/docuno.cxx sc/source/ui/unoobj/docuno.cxx
+index 7a49274..6717cd6 100644
+--- sc/source/ui/unoobj/docuno.cxx
++++ sc/source/ui/unoobj/docuno.cxx
+@@ -2268,7 +2268,8 @@ uno::Sequence < uno::Reference< table::XCellRange > > SAL_CALL ScTableSheetsObj:
+ uno::Sequence < uno::Reference < table::XCellRange > > xRet;
+
+ ScRangeList aRangeList;
+- if (ScRangeStringConverter::GetRangeListFromString( aRangeList, aRange, pDocShell->GetDocument(), ';' ))
++ ScDocument* pDoc = pDocShell->GetDocument();
++ if (ScRangeStringConverter::GetRangeListFromString( aRangeList, aRange, pDoc, ScAddress::CONV_OOO, ';' ))
+ {
+ sal_Int32 nCount = aRangeList.Count();
+ if (nCount)
+diff --git sc/source/ui/view/tabview3.cxx sc/source/ui/view/tabview3.cxx
+index 82ab33f..abc3a87 100644
+--- sc/source/ui/view/tabview3.cxx
++++ sc/source/ui/view/tabview3.cxx
+@@ -2236,8 +2236,9 @@ void ScTabView::DoChartSelection(
+ {
+ Color aSelColor( rHilightRanges[i].PreferredColor );
+ ScRangeList aRangeList;
++ ScDocument* pDoc = aViewData.GetDocShell()->GetDocument();
+ if( ScRangeStringConverter::GetRangeListFromString(
+- aRangeList, rHilightRanges[i].RangeRepresentation, aViewData.GetDocShell()->GetDocument(), ';' ))
++ aRangeList, rHilightRanges[i].RangeRepresentation, pDoc, pDoc->GetAddressConvention(), ';' ))
+ {
+ for ( ScRangePtr p = aRangeList.First(); p; p = aRangeList.Next())
+ {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]