summaryrefslogtreecommitdiffstats
path: root/sc
diff options
context:
space:
mode:
authorDaniel Rentz <dr@openoffice.org>2010-08-23 12:08:40 +0200
committerDaniel Rentz <dr@openoffice.org>2010-08-23 12:08:40 +0200
commitf43dbd543d60efafd66bb50c5e4e2d0bf6ee0d53 (patch)
tree192fdf8400af3ee717918cb804412efa78a99fa8 /sc
parentmib19: #163305# do not fire sheet activation events, when a sheet gets insert... (diff)
downloadcore-f43dbd543d60efafd66bb50c5e4e2d0bf6ee0d53.tar.gz
core-f43dbd543d60efafd66bb50c5e4e2d0bf6ee0d53.zip
#163288# treat Excel number format 'General' as standard format
Diffstat (limited to 'sc')
-rwxr-xr-xsc/source/ui/vba/vbarange.cxx21
1 files changed, 12 insertions, 9 deletions
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index 455af075306c..d34c0421805f 100755
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -539,19 +539,22 @@ public:
{
uno::Reference< beans::XPropertySet > xNumberProps = getNumberProps();
sal_Int16 nType = ::comphelper::getINT16(
- xNumberProps->getPropertyValue( ::rtl::OUString::createFromAscii( "Type" ) ) );
+ xNumberProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Type" ) ) ) );
return nType;
}
- bool setNumberFormat( const rtl::OUString& rFormat )
+ bool setNumberFormat( const rtl::OUString& rFormat )
{
- lang::Locale aLocale;
- uno::Reference< beans::XPropertySet > xNumProps = getNumberProps();
- xNumProps->getPropertyValue( ::rtl::OUString::createFromAscii( "Locale" ) ) >>= aLocale;
- sal_Int32 nNewIndex = mxFormats->queryKey(rFormat, aLocale, false );
- if ( nNewIndex == -1 ) // format not defined
+ // #163288# treat "General" as "Standard" format
+ sal_Int32 nNewIndex = 0;
+ if( !rFormat.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM( "General" ) ) )
{
- nNewIndex = mxFormats->addNew( rFormat, aLocale );
+ lang::Locale aLocale;
+ uno::Reference< beans::XPropertySet > xNumProps = getNumberProps();
+ xNumProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Locale" ) ) ) >>= aLocale;
+ nNewIndex = mxFormats->queryKey( rFormat, aLocale, false );
+ if ( nNewIndex == -1 ) // format not defined
+ nNewIndex = mxFormats->addNew( rFormat, aLocale );
}
mxRangeProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberFormat") ), uno::makeAny( nNewIndex ) );
return true;
@@ -561,7 +564,7 @@ public:
{
uno::Reference< beans::XPropertySet > xNumberProps = getNumberProps();
lang::Locale aLocale;
- xNumberProps->getPropertyValue( ::rtl::OUString::createFromAscii( "Locale" ) ) >>= aLocale;
+ xNumberProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Locale" ) ) ) >>= aLocale;
uno::Reference<util::XNumberFormatTypes> xTypes( mxFormats, uno::UNO_QUERY );
if ( xTypes.is() )
{