diff options
author | Noel Power <noel.power@suse.com> | 2013-04-05 09:04:06 +0100 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2013-04-05 09:06:28 +0100 |
commit | 975192e72eacbc2ab53c94a394eca11bb3a60728 (patch) | |
tree | 5c4c2c9200b1ebd1f3950f5da06f91f0bea8921f /sc/source/ui | |
parent | e8ff6eeb29c89f4dd7c77770c088ad4eb8e6fbeb (diff) |
Revert "prepend Validation.Formula1 results with '=' for anything not a address"
This reverts commit b23f3059af8724cf6c1b19a4835e1bca3522ab2c.
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/vba/vbarange.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/vba/vbarange.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/vba/vbavalidation.cxx | 19 |
3 files changed, 3 insertions, 21 deletions
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index abbe31e509d9..8b77f27a7239 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -1146,7 +1146,7 @@ public: }; bool -ScVbaRange::getCellRangesForAddress( sal_uInt16& rResFlags, const rtl::OUString& sAddress, ScDocShell* pDocSh, ScRangeList& rCellRanges, formula::FormulaGrammar::AddressConvention& eConv, char cDelimiter ) +getCellRangesForAddress( sal_uInt16& rResFlags, const rtl::OUString& sAddress, ScDocShell* pDocSh, ScRangeList& rCellRanges, formula::FormulaGrammar::AddressConvention& eConv, char cDelimiter = 0 ) { ScDocument* pDoc = NULL; @@ -1221,7 +1221,7 @@ bool getScRangeListForAddress( const rtl::OUString& sName, ScDocShell* pDocSh, S } sal_uInt16 nFlags = 0; - if ( !ScVbaRange::getCellRangesForAddress( nFlags, sAddress, pDocSh, aCellRanges, eConv, aChar ) ) + if ( !getCellRangesForAddress( nFlags, sAddress, pDocSh, aCellRanges, eConv, aChar ) ) return false; bool bTabFromReferrer = !( nFlags & SCA_TAB_3D ); diff --git a/sc/source/ui/vba/vbarange.hxx b/sc/source/ui/vba/vbarange.hxx index 7c3a3d9a701f..ff4c618f681e 100644 --- a/sc/source/ui/vba/vbarange.hxx +++ b/sc/source/ui/vba/vbarange.hxx @@ -285,7 +285,6 @@ public: // * object should be a lightweight as possible // * we shouldn't need hacks like this below static css::uno::Reference< ov::excel::XRange > ApplicationRange( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Any &Cell1, const css::uno::Any &Cell2 ) throw (css::uno::RuntimeException); - static bool getCellRangesForAddress( sal_uInt16& rResFlags, const rtl::OUString& sAddress, ScDocShell* pDocSh, ScRangeList& rCellRanges, formula::FormulaGrammar::AddressConvention& eConv, char cDelimiter = 0 ); virtual sal_Bool SAL_CALL GoalSeek( const css::uno::Any& Goal, const css::uno::Reference< ov::excel::XRange >& ChangingCell ) throw (css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XRange > SAL_CALL SpecialCells( const css::uno::Any& _oType, const css::uno::Any& _oValue) throw ( css::script::BasicErrorException ); // XErrorQuery diff --git a/sc/source/ui/vba/vbavalidation.cxx b/sc/source/ui/vba/vbavalidation.cxx index 7431370625ed..c42d97f2d902 100644 --- a/sc/source/ui/vba/vbavalidation.cxx +++ b/sc/source/ui/vba/vbavalidation.cxx @@ -28,9 +28,6 @@ #include <ooo/vba/excel/XlDVAlertStyle.hpp> #include "unonames.hxx" -#include "rangelst.hxx" -#include "excelvbahelper.hxx" -#include "vbarange.hxx" using namespace ::ooo::vba; using namespace ::com::sun::star; @@ -310,21 +307,7 @@ ScVbaValidation::Add( const uno::Any& Type, const uno::Any& AlertStyle, const un ScVbaValidation::getFormula1() throw (uno::RuntimeException) { uno::Reference< sheet::XSheetCondition > xCond( lcl_getValidationProps( m_xRange ), uno::UNO_QUERY_THROW ); - rtl::OUString sString = xCond->getFormula1(); - - sal_uInt16 nFlags = 0; - ScRangeList aCellRanges; - formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_XL_A1; - - ScDocShell* pDocSh = excel::GetDocShellFromRange( m_xRange ); - // in calc validation formula is either a range or formula - // that results in range. - // In VBA both formula and address can have a leading '=' - // in result of getFormula1, however it *seems* that a named range or - // real formula has to (or is expected to) have the '=' - if ( pDocSh && !ScVbaRange::getCellRangesForAddress( nFlags, sString, pDocSh, aCellRanges, eConv ) ) - sString = "=" + sString; - return sString; + return xCond->getFormula1(); } ::rtl::OUString SAL_CALL |