diff options
author | Jens Carl <j.carl43@gmx.de> | 2018-01-26 21:06:02 +0000 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-01-30 13:16:20 +0100 |
commit | 9427ab79de3824b8b3edc692c992fa29e5b3cbed (patch) | |
tree | 78179d35d541b165386eaa908c3acbb436402396 /sc | |
parent | 88ffe971d98715483890448317e82ea168d750c5 (diff) |
Use new property FormulaResultType2 to determinate ...
what result to return if the cell content type is formula.
Cleans up the confusion which was introduced with commit
8a73799d12f0d2dc04890b96bd0adf0ffcf50d17.
Change-Id: Ie4346173abf6bc3732d2fec06341f4e32cf68b82
Reviewed-on: https://gerrit.libreoffice.org/48725
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/unoobj/celllistsource.cxx | 7 | ||||
-rw-r--r-- | sc/source/ui/unoobj/cellvaluebinding.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/vba/vbarange.cxx | 6 |
3 files changed, 11 insertions, 8 deletions
diff --git a/sc/source/ui/unoobj/celllistsource.cxx b/sc/source/ui/unoobj/celllistsource.cxx index 5cbe67624f3a..6dd779d6f762 100644 --- a/sc/source/ui/unoobj/celllistsource.cxx +++ b/sc/source/ui/unoobj/celllistsource.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/lang/NullPointerException.hpp> #include <com/sun/star/text/XTextRange.hpp> #include <com/sun/star/sheet/XCellRangeAddressable.hpp> +#include <com/sun/star/sheet/FormulaResult.hpp> #include <com/sun/star/util/XModifyBroadcaster.hpp> #include <com/sun/star/container/XIndexAccess.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> @@ -200,9 +201,9 @@ namespace calc Reference< XPropertySet > xProp( xCell, UNO_QUERY); if (xProp.is()) { - CellContentType eContentType; - if ((xProp->getPropertyValue("CellContentType") >>= eContentType) && - eContentType == CellContentType_VALUE) + sal_Int32 nResultType; + if ((xProp->getPropertyValue("FormulaResultType2") >>= nResultType) && + nResultType == FormulaResult::VALUE) *pAny <<= xCell->getValue(); else *pAny <<= sText; diff --git a/sc/source/ui/unoobj/cellvaluebinding.cxx b/sc/source/ui/unoobj/cellvaluebinding.cxx index 65aae5c2c4c4..b7e8a01f42b1 100644 --- a/sc/source/ui/unoobj/cellvaluebinding.cxx +++ b/sc/source/ui/unoobj/cellvaluebinding.cxx @@ -22,6 +22,7 @@ #include <com/sun/star/form/binding/IncompatibleTypesException.hpp> #include <com/sun/star/lang/NotInitializedException.hpp> #include <com/sun/star/table/XCellRange.hpp> +#include <com/sun/star/sheet/FormulaResult.hpp> #include <com/sun/star/sheet/XCellAddressable.hpp> #include <com/sun/star/sheet/XCellRangeData.hpp> #include <com/sun/star/container/XIndexAccess.hpp> @@ -203,8 +204,9 @@ namespace calc Reference<XPropertySet> xProp( m_xCell, UNO_QUERY ); if ( xProp.is() ) { - CellContentType eContentType; - if ( (xProp->getPropertyValue("CellContentType") >>= eContentType) && eContentType == CellContentType_VALUE ) + sal_Int32 nResultType; + if ( (xProp->getPropertyValue("FormulaResultType2") >>= nResultType) + && nResultType == FormulaResult::VALUE ) bHasValue = true; } } diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index 24de46dba614..f9577e461c74 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -825,11 +825,11 @@ void CellValueGetter::visitNode( sal_Int32 x, sal_Int32 y, const uno::Reference< { uno::Reference< beans::XPropertySet > xProp( xCell, uno::UNO_QUERY_THROW ); - table::CellContentType eContentType = table::CellContentType_VALUE; + sal_Int32 nResultType = sheet::FormulaResult::VALUE; // some formulas give textual results - xProp->getPropertyValue( "CellContentType" ) >>= eContentType; + xProp->getPropertyValue( "FormulaResultType2" ) >>= nResultType; - if ( eContentType == table::CellContentType_TEXT ) + if ( nResultType == sheet::FormulaResult::STRING ) { uno::Reference< text::XTextRange > xTextRange(xCell, ::uno::UNO_QUERY_THROW); aValue <<= xTextRange->getString(); |