[Libreoffice-commits] core.git: sc/inc sc/source

Katarina Behrens Katarina.Behrens at cib.de
Mon Jul 20 04:20:46 PDT 2015


 sc/inc/unonames.hxx             |    1 
 sc/source/ui/unoobj/confuno.cxx |   48 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+)

New commits:
commit 01d1165572f53ca50c626fa036343932c1e8c5db
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Mon Jul 13 18:41:19 2015 +0200

    tdf#92256: ODF save/load syntax for string reference
    
    Change-Id: Iec38867c2fa3750f052e4afc99c5f8d48808c373
    Reviewed-on: https://gerrit.libreoffice.org/17017
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx
index d937775..b064995 100644
--- a/sc/inc/unonames.hxx
+++ b/sc/inc/unonames.hxx
@@ -511,6 +511,7 @@
 #define SC_UNO_INTEROPGRABBAG           "InteropGrabBag"
 #define SC_UNO_RECORDCHANGES            "RecordChanges"
 #define SC_UNO_ISRECORDCHANGESPROTECTED "IsRecordChangesProtected"
+#define SC_UNO_SYNTAXSTRINGREF          "SyntaxStringRef"
 
 
 //  document properties from FormModel
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx
index a56c36f..82f2502 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -31,6 +31,7 @@
 
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <cppuhelper/supportsservice.hxx>
+#include <formula/grammar.hxx>
 #include <sfx2/printer.hxx>
 #include <xmloff/xmluconv.hxx>
 #include <rtl/ustrbuf.hxx>
@@ -75,6 +76,7 @@ static const SfxItemPropertyMapEntry* lcl_GetConfigPropertyMap()
         {OUString(SC_UNO_SHAREDOC),     0,  cppu::UnoType<bool>::get(),              0, 0},
         {OUString(SC_UNO_MODIFYPASSWORDINFO), 0,  cppu::UnoType<uno::Sequence< beans::PropertyValue >>::get(),              0, 0},
         {OUString(SC_UNO_EMBED_FONTS), 0,  cppu::UnoType<bool>::get(),              0, 0},
+        {OUString(SC_UNO_SYNTAXSTRINGREF), 0,  cppu::UnoType<sal_Int16>::get(),     0, 0},
         { OUString(), 0, css::uno::Type(), 0, 0 }
     };
     return aConfigPropertyMap_Impl;
@@ -297,6 +299,28 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue(
                 rDoc.SetIsUsingEmbededFonts(bVal);
             }
         }
+        else if ( aPropertyName == SC_UNO_SYNTAXSTRINGREF )
+        {
+            ScCalcConfig aCalcConfig = rDoc.GetCalcConfig();
+            sal_Int16 nUno = 0;
+
+            if( aValue >>= nUno )
+            {
+                switch (nUno)
+                {
+                    case 0: // CONV_OOO
+                    case 2: // CONV_XL_A1
+                    case 3: // CONV_XL_R1C1
+                        aCalcConfig.meStringRefAddressSyntax = static_cast<formula::FormulaGrammar::AddressConvention>( nUno );
+                        break;
+                    default:
+                        aCalcConfig.meStringRefAddressSyntax = formula::FormulaGrammar::CONV_UNSPECIFIED;
+                        break;
+
+                }
+                rDoc.SetCalcConfig( aCalcConfig );
+            }
+        }
 
         else
         {
@@ -433,6 +457,30 @@ uno::Any SAL_CALL ScDocumentConfiguration::getPropertyValue( const OUString& aPr
         {
             aRet <<= rDoc.IsUsingEmbededFonts();
         }
+        else if ( aPropertyName == SC_UNO_SYNTAXSTRINGREF )
+        {
+            ScCalcConfig aCalcConfig = rDoc.GetCalcConfig();
+            formula::FormulaGrammar::AddressConvention aConv = aCalcConfig.meStringRefAddressSyntax;
+
+            switch (aConv)
+            {
+                case formula::FormulaGrammar::CONV_OOO:
+                case formula::FormulaGrammar::CONV_XL_A1:
+                case formula::FormulaGrammar::CONV_XL_R1C1:
+                     aRet <<= static_cast<sal_Int16>( aConv );
+                     break;
+
+                case formula::FormulaGrammar::CONV_UNSPECIFIED:
+                case formula::FormulaGrammar::CONV_ODF:
+                case formula::FormulaGrammar::CONV_XL_OOX:
+                case formula::FormulaGrammar::CONV_LOTUS_A1:
+                case formula::FormulaGrammar::CONV_LAST:
+                {
+                    aRet <<= sal_Int16(9999);
+                    break;
+                }
+             }
+        }
 
         else
         {


More information about the Libreoffice-commits mailing list