[Libreoffice-commits] .: sc/source

Markus Mohrhard mmohrhard at kemper.freedesktop.org
Thu Jun 23 06:22:54 PDT 2011


 sc/source/core/tool/token.cxx    |    8 ++++++++
 sc/source/ui/unoobj/tokenuno.cxx |    8 +++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

New commits:
commit 1feb31381496692fa8cb1a90ba8dd899b8c2bbeb
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Jun 22 15:47:21 2011 +0200

    fix for fdo#37880
    
    we need to save the information if we have a local range name or a
    global range name in the uno api too

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 69017e1..9e8c821 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -56,6 +56,7 @@ using ::std::vector;
 #include <com/sun/star/sheet/ComplexReference.hpp>
 #include <com/sun/star/sheet/ExternalReference.hpp>
 #include <com/sun/star/sheet/ReferenceFlags.hpp>
+#include <com/sun/star/sheet/NameToken.hpp>
 
 using namespace formula;
 using namespace com::sun::star;
@@ -1174,6 +1175,13 @@ bool ScTokenArray::AddFormulaToken(const com::sun::star::sheet::FormulaToken& _a
                         else
                             bError = true;
                     }
+                    else if ( aType.equals( cppu::UnoType<sheet::NameToken>::get() ) )
+                    {
+                        sheet::NameToken aTokenData;
+                        _aToken.Data >>= aTokenData;
+                        if ( eOpCode == ocName )
+                            AddRangeName(aTokenData.Index, aTokenData.Global);
+                    }
                     else if ( aType.equals( cppu::UnoType<sheet::ExternalReference>::get() ) )
                     {
                         sheet::ExternalReference aApiExtRef;
diff --git a/sc/source/ui/unoobj/tokenuno.cxx b/sc/source/ui/unoobj/tokenuno.cxx
index 95e350c..5f89de8 100644
--- a/sc/source/ui/unoobj/tokenuno.cxx
+++ b/sc/source/ui/unoobj/tokenuno.cxx
@@ -37,6 +37,7 @@
 #include <com/sun/star/sheet/ExternalReference.hpp>
 #include <com/sun/star/sheet/ReferenceFlags.hpp>
 #include <com/sun/star/sheet/AddressConvention.hpp>
+#include <com/sun/star/sheet/NameToken.hpp>
 #include <com/sun/star/table/CellAddress.hpp>
 
 #include <svl/itemprop.hxx>
@@ -395,7 +396,12 @@ bool ScTokenConversion::ConvertToTokenSequence( ScDocument& rDoc,
                     }
                     break;
                 case svIndex:
-                    rAPI.Data <<= static_cast<sal_Int32>( rToken.GetIndex() );
+                    {
+                        sheet::NameToken aNameToken;
+                        aNameToken.Index = static_cast<sal_Int32>( rToken.GetIndex() );
+                        aNameToken.Global = static_cast<sal_Bool>( rToken.GetByte() );
+                        rAPI.Data <<= aNameToken;
+                    }
                     break;
                 case svMatrix:
                     if (!ScRangeToSequence::FillMixedArray( rAPI.Data, static_cast<const ScToken&>(rToken).GetMatrix(), true))


More information about the Libreoffice-commits mailing list