[Libreoffice-commits] core.git: sc/source
Jens Carl
j.carl43 at gmx.de
Tue Jan 30 12:16:42 UTC 2018
sc/source/ui/unoobj/celllistsource.cxx | 7 ++++---
sc/source/ui/unoobj/cellvaluebinding.cxx | 6 ++++--
sc/source/ui/vba/vbarange.cxx | 6 +++---
3 files changed, 11 insertions(+), 8 deletions(-)
New commits:
commit 9427ab79de3824b8b3edc692c992fa29e5b3cbed
Author: Jens Carl <j.carl43 at gmx.de>
Date: Fri Jan 26 21:06:02 2018 +0000
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 at libreoffice.org>
Reviewed-by: Eike Rathke <erack at redhat.com>
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();
More information about the Libreoffice-commits
mailing list