summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj/addruno.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/unoobj/addruno.cxx')
-rw-r--r--sc/source/ui/unoobj/addruno.cxx30
1 files changed, 22 insertions, 8 deletions
diff --git a/sc/source/ui/unoobj/addruno.cxx b/sc/source/ui/unoobj/addruno.cxx
index 10627222be80..854b0d67b81c 100644
--- a/sc/source/ui/unoobj/addruno.cxx
+++ b/sc/source/ui/unoobj/addruno.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -69,7 +70,7 @@ void ScAddressConversionObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
}
-sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString )
+sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString, ::formula::FormulaGrammar::AddressConvention eConv )
{
if (!pDocShell)
return sal_False;
@@ -78,7 +79,7 @@ sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString )
sal_Bool bSuccess = sal_False;
if ( bIsRange )
{
- USHORT nResult = aRange.ParseAny( rUIString, pDoc );
+ USHORT nResult = aRange.ParseAny( rUIString, pDoc, eConv );
if ( nResult & SCA_VALID )
{
if ( ( nResult & SCA_TAB_3D ) == 0 )
@@ -92,7 +93,7 @@ sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString )
}
else
{
- USHORT nResult = aRange.aStart.Parse( rUIString, pDoc );
+ USHORT nResult = aRange.aStart.Parse( rUIString, pDoc, eConv );
if ( nResult & SCA_VALID )
{
if ( ( nResult & SCA_TAB_3D ) == 0 )
@@ -116,6 +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_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}
@@ -129,6 +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_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}
@@ -190,8 +193,11 @@ void SAL_CALL ScAddressConversionObj::setPropertyValue( const rtl::OUString& aPr
bSuccess = ParseUIString( aUIString );
}
}
- else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) )
+ else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) || aNameStr.EqualsAscii( SC_UNONAME_XL_A1_REPR ) )
{
+ ::formula::FormulaGrammar::AddressConvention aConv = ::formula::FormulaGrammar::CONV_OOO;
+ if ( aNameStr.EqualsAscii( SC_UNONAME_XL_A1_REPR ) )
+ aConv = ::formula::FormulaGrammar::CONV_XL_A1;
// parse the file format string
rtl::OUString sRepresentation;
if (aValue >>= sRepresentation)
@@ -212,7 +218,7 @@ void SAL_CALL ScAddressConversionObj::setPropertyValue( const rtl::OUString& aPr
}
// parse the rest like a UI string
- bSuccess = ParseUIString( aUIString );
+ bSuccess = ParseUIString( aUIString, aConv );
}
}
else
@@ -265,17 +271,24 @@ 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 ) )
+ else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) || aNameStr.EqualsAscii( SC_UNONAME_XL_A1_REPR ) )
{
+ ::formula::FormulaGrammar::AddressConvention aConv = ::formula::FormulaGrammar::CONV_OOO;
+ if ( aNameStr.EqualsAscii( SC_UNONAME_XL_A1_REPR ) )
+ aConv = ::formula::FormulaGrammar::CONV_XL_A1;
+
// generate file format string - always include sheet
String aFormatStr;
- aRange.aStart.Format( aFormatStr, SCA_VALID | SCA_TAB_3D, pDoc );
+ aRange.aStart.Format( aFormatStr, SCA_VALID | SCA_TAB_3D, pDoc, aConv );
if ( bIsRange )
{
// manually concatenate range so both parts always have the sheet name
aFormatStr.Append( (sal_Unicode) ':' );
String aSecond;
- aRange.aEnd.Format( aSecond, SCA_VALID | SCA_TAB_3D, pDoc );
+ 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 );
aFormatStr.Append( aSecond );
}
aRet <<= rtl::OUString( aFormatStr );
@@ -313,3 +326,4 @@ uno::Sequence<rtl::OUString> SAL_CALL ScAddressConversionObj::getSupportedServic
return aRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */