diff options
author | Noel Power <noel.power@novell.com> | 2010-11-04 21:26:31 +0000 |
---|---|---|
committer | Noel Power <noel.power@novell.com> | 2010-11-04 21:26:31 +0000 |
commit | da3733b7035caaf6f6e2136bee240c9002396889 (patch) | |
tree | aa39ac278f0c94fc94eee05291c1cf6aa8823e28 /sc | |
parent | 74d2cd13984ddc4b46497cd696fbeb617010ea50 (diff) |
Fix logic for XLA1Representation for CellAddress/RangeConversion
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/unonames.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/addruno.cxx | 27 |
2 files changed, 14 insertions, 15 deletions
diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx index 556c62416b62..6400802422ec 100644 --- a/sc/inc/unonames.hxx +++ b/sc/inc/unonames.hxx @@ -619,7 +619,7 @@ #define SC_UNONAME_ADDRESS "Address" #define SC_UNONAME_UIREPR "UserInterfaceRepresentation" #define SC_UNONAME_PERSREPR "PersistentRepresentation" -#define SC_UNONAME_XL_A1_REPR "XL_A1_Representation" +#define SC_UNONAME_XLA1REPR "XLA1Representation" #define SC_UNONAME_REFSHEET "ReferenceSheet" // --> PB 2004-08-23 #i33095# Security Options diff --git a/sc/source/ui/unoobj/addruno.cxx b/sc/source/ui/unoobj/addruno.cxx index e9618d43210c..eca77af856ec 100644 --- a/sc/source/ui/unoobj/addruno.cxx +++ b/sc/source/ui/unoobj/addruno.cxx @@ -117,7 +117,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScAddressConversionObj::getProp { {MAP_CHAR_LEN(SC_UNONAME_ADDRESS), 0, &getCppuType((table::CellRangeAddress*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNONAME_PERSREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 }, - {MAP_CHAR_LEN(SC_UNONAME_XL_A1_REPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 }, + {MAP_CHAR_LEN(SC_UNONAME_XLA1REPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNONAME_REFSHEET), 0, &getCppuType((sal_Int32*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNONAME_UIREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 }, {0,0,0,0,0,0} @@ -131,7 +131,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScAddressConversionObj::getProp { {MAP_CHAR_LEN(SC_UNONAME_ADDRESS), 0, &getCppuType((table::CellAddress*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNONAME_PERSREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 }, - {MAP_CHAR_LEN(SC_UNONAME_XL_A1_REPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 }, + {MAP_CHAR_LEN(SC_UNONAME_XLA1REPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNONAME_REFSHEET), 0, &getCppuType((sal_Int32*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNONAME_UIREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 }, {0,0,0,0,0,0} @@ -193,11 +193,11 @@ void SAL_CALL ScAddressConversionObj::setPropertyValue( const rtl::OUString& aPr bSuccess = ParseUIString( aUIString ); } } - else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) || aNameStr.EqualsAscii( SC_UNONAME_XL_A1_REPR ) ) + else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) || aNameStr.EqualsAscii( SC_UNONAME_XLA1REPR ) ) { - ::formula::FormulaGrammar::AddressConvention aConv = ::formula::FormulaGrammar::CONV_OOO; - if ( aNameStr.EqualsAscii( SC_UNONAME_XL_A1_REPR ) ) - aConv = ::formula::FormulaGrammar::CONV_XL_A1; + ::formula::FormulaGrammar::AddressConvention aConv = aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) ? + ::formula::FormulaGrammar::CONV_OOO : ::formula::FormulaGrammar::CONV_XL_A1; + // parse the file format string rtl::OUString sRepresentation; if (aValue >>= sRepresentation) @@ -271,24 +271,23 @@ uno::Any SAL_CALL ScAddressConversionObj::getPropertyValue( const rtl::OUString& aRange.aStart.Format( aFormatStr, nFlags, pDoc ); aRet <<= rtl::OUString( aFormatStr ); } - else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) || aNameStr.EqualsAscii( SC_UNONAME_XL_A1_REPR ) ) + else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) || aNameStr.EqualsAscii( SC_UNONAME_XLA1REPR ) ) { - ::formula::FormulaGrammar::AddressConvention aConv = ::formula::FormulaGrammar::CONV_OOO; - if ( aNameStr.EqualsAscii( SC_UNONAME_XL_A1_REPR ) ) - aConv = ::formula::FormulaGrammar::CONV_XL_A1; + ::formula::FormulaGrammar::AddressConvention eConv = aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) ? + ::formula::FormulaGrammar::CONV_OOO : ::formula::FormulaGrammar::CONV_XL_A1; // generate file format string - always include sheet String aFormatStr; - aRange.aStart.Format( aFormatStr, SCA_VALID | SCA_TAB_3D, pDoc, aConv ); + aRange.aStart.Format( aFormatStr, SCA_VALID | SCA_TAB_3D, pDoc, eConv ); if ( bIsRange ) { // manually concatenate range so both parts always have the sheet name aFormatStr.Append( (sal_Unicode) ':' ); String aSecond; USHORT nFlags = SCA_VALID; - if( aConv != ::formula::FormulaGrammar::CONV_XL_A1 ) - nFlags |= SCA_TAB_3D; - aRange.aEnd.Format( aSecond, SCA_VALID | SCA_TAB_3D, pDoc, aConv ); + if( eConv != ::formula::FormulaGrammar::CONV_XL_A1 ) + nFlags |= SCA_TAB_3D; + aRange.aEnd.Format( aSecond, SCA_VALID | SCA_TAB_3D, pDoc, eConv ); aFormatStr.Append( aSecond ); } aRet <<= rtl::OUString( aFormatStr ); |