[Libreoffice-commits] core.git: include/formula sc/inc sc/source
include/formula/tokenarray.hxx |5 + sc/inc/document.hxx|2 +- sc/inc/formulacell.hxx |3 ++- sc/source/core/data/formulacell.cxx|8 +++- sc/source/filter/oox/formulabuffer.cxx | 31 --- sc/source/ui/view/output2.cxx | 13 +++-- 6 files changed, 46 insertions(+), 16 deletions(-) New commits: commit 05ac57f85eb622b798719db03bbdd07b79e1703a Author: Eike Rathke AuthorDate: Thu Feb 23 01:22:16 2023 +0100 Commit: Eike Rathke CommitDate: Thu Feb 23 01:33:48 2023 + Resolves: tdf#153767 Try harder to import OOXML bool shared formula result ... by setting the result value or if necessary recalculating even if AutoCalc is turned off for the document. Similar for other implicitly recalculating formula types. Also set a boolean number format if none. Change-Id: I2f75735707180eccf4b2c525738ac0b763901230 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147425 Reviewed-by: Eike Rathke Tested-by: Jenkins diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx index cbff6a3e469d..330543d427dc 100644 --- a/include/formula/tokenarray.hxx +++ b/include/formula/tokenarray.hxx @@ -430,6 +430,11 @@ public: example OOXML. */ boolIsRecalcModeMustAfterImport() const { return (nMode & ScRecalcMode::EMask) <= ScRecalcMode::ONLOAD_ONCE; } +voidClearRecalcModeMustAfterImport() +{ +if (IsRecalcModeMustAfterImport() && !IsRecalcModeAlways()) +SetExclusiveRecalcModeNormal(); +} /** Get OpCode of the most outer function */ inline OpCode GetOuterFuncOpCode() const; diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 20e42a999ac8..c6b2f2289ddb 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1224,7 +1224,7 @@ public: SC_DLLPUBLIC sal_uInt32 GetNumberFormat( SCCOL nCol, SCROW nRow, SCTAB nTab ) const; sal_uInt32GetNumberFormat( const ScRange& rRange ) const; SC_DLLPUBLIC sal_uInt32 GetNumberFormat( const ScInterpreterContext& rContext, const ScAddress& ) const; -void SetNumberFormat( const ScAddress& rPos, sal_uInt32 nNumberFormat ); +SC_DLLPUBLIC void SetNumberFormat( const ScAddress& rPos, sal_uInt32 nNumberFormat ); void GetNumberFormatInfo( const ScInterpreterContext& rContext, SvNumFormatType& nType, sal_uInt32& nIndex, const ScAddress& rPos ) const; SC_DLLPUBLIC const ScFormulaCell* GetFormulaCell( const ScAddress& rPos ) const; diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx index e4bc41772e0e..42b7f6120149 100644 --- a/sc/inc/formulacell.hxx +++ b/sc/inc/formulacell.hxx @@ -445,7 +445,8 @@ public: if (!IsDirtyOrInTableOpDirty()) return false; -return (rDocument.GetAutoCalc() || (cMatrixFlag != ScMatrixMode::NONE)); +return rDocument.GetAutoCalc() || (cMatrixFlag != ScMatrixMode::NONE) +|| (pCode->IsRecalcModeMustAfterImport() && !pCode->IsRecalcModeAlways()); } void MaybeInterpret() diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index 143b27579a83..0e2840284ec5 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -2331,6 +2331,8 @@ void ScFormulaCell::InterpretTail( ScInterpreterContext& rContext, ScInterpretTa OSL_ENSURE( pCode->GetCodeError() != FormulaError::NONE, "no RPN code and no errors ?!?!" ); ResetDirty(); } + +pCode->ClearRecalcModeMustAfterImport(); } void ScFormulaCell::HandleStuffAfterParallelCalculation(ScInterpreter* pInterpreter) @@ -2546,7 +2548,7 @@ void ScFormulaCell::SetDirty( bool bDirtyFlag ) // the FormulaTree, once in there it would be assumed that its // dependents already had been tracked and it would be skipped on a // subsequent notify. Postpone tracking until all listeners are set. -if (!rDocument.IsImportingXML()) +if (!rDocument.IsImportingXML() && !rDocument.IsInsertingFromOtherDoc()) rDocument.TrackFormulas(); } @@ -2647,10 +2649,6 @@ void ScFormulaCell::AddRecalcMode( ScRecalcMode nBits ) { if ( (nBits & ScRecalcMode::EMask) != ScRecalcMode::NORMAL ) SetDirtyVar(); -if ( nBits & ScRecalcMode::ONLOAD_ONCE ) -{ // OnLoadOnce is used only to set Dirty after filter import. -nBits = (nBits & ~ScRecalcMode::EMask) | ScRecalcMode::NORMAL; -} pCode->AddRecalcMode( nBits ); } diff --git a/sc/sou
[Libreoffice-commits] core.git: include/formula
include/formula/grammar.hxx | 13 + 1 file changed, 13 insertions(+) New commits: commit 3c766512984feff739377d0f0af46558ee7139fd Author: Eike Rathke AuthorDate: Mon Jul 26 16:05:22 2021 +0200 Commit: Eike Rathke CommitDate: Mon Jul 26 21:41:55 2021 +0200 Related: tdf#64086 Add FormulaGrammar::isRefConventionOOXML() ... to prepare detailed compiler scanner handling. Change-Id: I4a50491b4fa95516773adbd7b86e91ab121b1820 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119517 Tested-by: Eike Rathke Reviewed-by: Eike Rathke diff --git a/include/formula/grammar.hxx b/include/formula/grammar.hxx index 5d7933dee24a..b5b499d5aab4 100644 --- a/include/formula/grammar.hxx +++ b/include/formula/grammar.hxx @@ -209,6 +209,19 @@ public: css::sheet::FormulaLanguage::OOXML; } +/** If reference convention is OOXML. + +Note this is not equivalent to isOOXML() as it does not have to be +FormulaLanguage::OOXML but can be Grammar::GRAM_EXTERNAL merged with +AddressConvention::CONV_XL_OOX, which is used by various parts of OOXML +import through the API FormulaParser. + */ +static bool isRefConventionOOXML( const Grammar eGrammar ) +{ +return extractRefConvention( eGrammar) == +FormulaGrammar::AddressConvention::CONV_XL_OOX; +} + /// If grammar has an Excel syntax, determined by address convention. static bool isExcelSyntax( const Grammar eGrammar ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula
include/formula/funcutl.hxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit aa2e56307e8beaae6f56f20a554a0d3f2495499b Author: Caolán McNamara AuthorDate: Tue Dec 1 15:45:02 2020 + Commit: Caolán McNamara CommitDate: Wed Dec 2 09:42:54 2020 +0100 move the callbacks to be private Change-Id: I75a786d379ce1ea80acef90b9574d2901e046f3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106993 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/formula/funcutl.hxx b/include/formula/funcutl.hxx index 02cf585a771e..5c729da03638 100644 --- a/include/formula/funcutl.hxx +++ b/include/formula/funcutl.hxx @@ -48,12 +48,12 @@ private: DECL_LINK( UpdateHdl, Timer*, void ); -protected: DECL_LINK(KeyInputHdl, const KeyEvent&, bool); DECL_LINK(GetFocus, weld::Widget&, void); DECL_LINK(LoseFocus, weld::Widget&, void); DECL_LINK(Modify, weld::Entry&, void); +protected: virtual bool KeyInput(const KeyEvent& rKEvt); public: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula sc/source
include/formula/FormulaCompiler.hxx |3 +-- sc/source/filter/excel/xestream.cxx | 21 ++--- sc/source/filter/excel/xetable.cxx |3 ++- sc/source/filter/inc/xestream.hxx |4 +++- 4 files changed, 24 insertions(+), 7 deletions(-) New commits: commit 456f093975ce4e4266eb12b62590eaaba6f2de88 Author: Eike Rathke AuthorDate: Tue Mar 31 01:14:36 2020 +0200 Commit: Eike Rathke CommitDate: Tue Mar 31 02:55:44 2020 +0200 Resolves: tdf#131372 Write "error cell" formula to OOXML Change-Id: Iedbe0912ff28e6203bec0104c59b1102cf97daf9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91382 Reviewed-by: Eike Rathke Tested-by: Jenkins diff --git a/include/formula/FormulaCompiler.hxx b/include/formula/FormulaCompiler.hxx index a2c6f6f3d9c0..185dd7a04ada 100644 --- a/include/formula/FormulaCompiler.hxx +++ b/include/formula/FormulaCompiler.hxx @@ -221,6 +221,7 @@ public: OpCode GetEnglishOpCode( const OUString& rName ) const; FormulaError GetErrorConstant( const OUString& rName ) const; +void AppendErrorConstant( OUStringBuffer& rBuffer, FormulaError nError ) const; void EnableJumpCommandReorder( bool bEnable ); void EnableStopOnError( bool bEnable ); @@ -305,8 +306,6 @@ protected: virtual void CreateStringFromIndex( OUStringBuffer& rBuffer, const FormulaToken* pToken ) const; virtual void LocalizeString( OUString& rName ) const; // modify rName - input: exact name -void AppendErrorConstant( OUStringBuffer& rBuffer, FormulaError nError ) const; - bool GetToken(); OpCode NextToken(); void PutCode( FormulaTokenRef& ); diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index c22773e1505a..51b11ebaf029 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -795,15 +795,30 @@ OUString XclXmlUtils::ToOUString( const ScfUInt16Vec& rBuf, sal_Int32 nStart, sa } OUString XclXmlUtils::ToOUString( -sc::CompileFormulaContext& rCtx, const ScAddress& rAddress, const ScTokenArray* pTokenArray ) +sc::CompileFormulaContext& rCtx, const ScAddress& rAddress, const ScTokenArray* pTokenArray, +FormulaError nErrCode ) { ScCompiler aCompiler( rCtx, rAddress, const_cast(*pTokenArray)); /* TODO: isn't this the same as passed in rCtx and thus superfluous? */ aCompiler.SetGrammar(FormulaGrammar::GRAM_OOXML); -OUStringBuffer aBuffer( pTokenArray->GetLen() * 5 ); -aCompiler.CreateStringFromTokenArray( aBuffer ); +sal_Int32 nLen = pTokenArray->GetLen(); +OUStringBuffer aBuffer( nLen ? (nLen * 5) : 8 ); +if (nLen) +aCompiler.CreateStringFromTokenArray( aBuffer ); +else +{ +if (nErrCode != FormulaError::NONE) +aCompiler.AppendErrorConstant( aBuffer, nErrCode); +else +{ +// No code SHOULD be an "error cell", assert caller thought of that +// and it really is. +assert(!"No code and no error."); +} +} + return aBuffer.makeStringAndClear(); } diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index 259ed5031c3f..bf2b66808aee 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -1011,7 +1011,8 @@ void XclExpFormulaCell::SaveXml( XclExpXmlStream& rStrm ) (mxAddRec && mxAddRec->IsVolatile()) ) ); } rWorksheet->writeEscaped( XclXmlUtils::ToOUString( -rStrm.GetRoot().GetCompileFormulaContext(), mrScFmlaCell.aPos, mrScFmlaCell.GetCode())); +rStrm.GetRoot().GetCompileFormulaContext(), mrScFmlaCell.aPos, mrScFmlaCell.GetCode(), +mrScFmlaCell.GetErrCode())); rWorksheet->endElement( XML_f ); } diff --git a/sc/source/filter/inc/xestream.hxx b/sc/source/filter/inc/xestream.hxx index 88cf614664b4..3aaebd7ce776 100644 --- a/sc/source/filter/inc/xestream.hxx +++ b/sc/source/filter/inc/xestream.hxx @@ -27,6 +27,7 @@ #include #include #include +#include #include "ftools.hxx" #include @@ -262,7 +263,8 @@ public: static OUString ToOUString( const char* s ); static OUString ToOUString( const ScfUInt16Vec& rBuffer, sal_Int32 nStart = 0, sal_Int32 nLength = -1 ); -static OUString ToOUString( sc::CompileFormulaContext& rCtx, const ScAddress& rAddress, const ScTokenArray* pTokenArray ); +static OUString ToOUString( sc::CompileFormulaContext& rCtx, const ScAddress& rAddress, +const ScTokenArray* pTokenArray, FormulaError nErrCode = FormulaError::NONE ); static OUString ToOUString( const XclExpString& s ); template ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula sc/qa sc/source sc/uiconfig solenv/sanitizers
include/formula/funcutl.hxx |1 sc/qa/unit/tiledrendering/tiledrendering.cxx |5 sc/source/ui/dbgui/filtdlg.cxx | 771 ++ sc/source/ui/dbgui/foptmgr.cxx | 230 ++ sc/source/ui/inc/filtdlg.hxx | 110 +-- sc/source/ui/inc/foptmgr.hxx | 52 + sc/source/ui/inc/reffact.hxx |2 sc/source/ui/view/reffact.cxx|4 sc/source/ui/view/tabvwshc.cxx | 53 - sc/uiconfig/scalc/ui/standardfilterdialog.ui | 916 +-- solenv/sanitizers/ui/modules/scalc.suppr |1 11 files changed, 1206 insertions(+), 939 deletions(-) New commits: commit 59d1d9e661ee4a805ee280d7afab51a52bb11ed3 Author: Caolán McNamara AuthorDate: Mon Apr 15 20:49:03 2019 +0100 Commit: Caolán McNamara CommitDate: Tue Apr 16 22:20:17 2019 +0200 weld ScFilterDlg Change-Id: I8bb8860d398af2ee9d6dd434c50f914e78b8021b Reviewed-on: https://gerrit.libreoffice.org/70801 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/include/formula/funcutl.hxx b/include/formula/funcutl.hxx index 22e46ecc81c1..3654d9ebd966 100644 --- a/include/formula/funcutl.hxx +++ b/include/formula/funcutl.hxx @@ -177,6 +177,7 @@ public: void SetGetFocusHdl(const Link& rLink) { maGetFocusHdl = rLink; } void SetLoseFocusHdl(const Link& rLink) { maLoseFocusHdl = rLink; } void SetModifyHdl(const Link& rLink) { maModifyHdl = rLink; } +const Link& GetModifyHdl() const { return maModifyHdl; } void SetActivateHdl(const Link& rLink) { maActivateHdl = rLink; } }; diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index 5222a64c8dbb..326966e940af 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -1647,11 +1647,8 @@ void ScTiledRenderingTest::testFilterDlg() CPPUNIT_ASSERT_EQUAL(true, pView2->GetViewFrame()->GetDispatcher()->IsLocked()); CPPUNIT_ASSERT_EQUAL(false, pView1->GetViewFrame()->GetDispatcher()->IsLocked()); -KeyEvent aEvent(27, KEY_ESCAPE, 0); -Application::PostKeyEvent(VclEventId::WindowKeyInput, pRefWindow->GetWindow(), &aEvent); -Application::PostKeyEvent(VclEventId::WindowKeyUp, pRefWindow->GetWindow(), &aEvent); +pRefWindow->GetController()->response(RET_CANCEL); -Scheduler::ProcessEventsToIdle(); CPPUNIT_ASSERT_EQUAL(false, pView2->GetViewFrame()->GetDispatcher()->IsLocked()); CPPUNIT_ASSERT_EQUAL(false, pView1->GetViewFrame()->GetDispatcher()->IsLocked()); diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx index 9b6fe0ea03da..477dc0f63cbd 100644 --- a/sc/source/ui/dbgui/filtdlg.cxx +++ b/sc/source/ui/dbgui/filtdlg.cxx @@ -46,10 +46,10 @@ ScFilterDlg::EntryList::EntryList() : mnHeaderPos(INVALID_HEADER_POS) {} -ScFilterDlg::ScFilterDlg(SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent, +ScFilterDlg::ScFilterDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent, const SfxItemSet& rArgSet) -: ScAnyRefDlg ( pB, pCW, pParent, "StandardFilterDialog", -"modules/scalc/ui/standardfilterdialog.ui" ) +: ScAnyRefDlgController(pB, pCW, pParent, +"modules/scalc/ui/standardfilterdialog.ui", "StandardFilterDialog") , aStrUndefined(ScResId(SCSTR_UNDEFINED)) , aStrNone(ScResId(SCSTR_NONE)) , aStrEmpty(ScResId(SCSTR_FILTER_EMPTY)) @@ -61,41 +61,42 @@ ScFilterDlg::ScFilterDlg(SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pPar , pDoc(nullptr) , nSrcTab(0) , bRefInputMode(false) +, m_xLbConnect1(m_xBuilder->weld_combo_box("connect1")) +, m_xLbField1(m_xBuilder->weld_combo_box("field1")) +, m_xLbCond1(m_xBuilder->weld_combo_box("cond1")) +, m_xEdVal1(m_xBuilder->weld_combo_box("val1")) +, m_xLbConnect2(m_xBuilder->weld_combo_box("connect2")) +, m_xLbField2(m_xBuilder->weld_combo_box("field2")) +, m_xLbCond2(m_xBuilder->weld_combo_box("cond2")) +, m_xEdVal2(m_xBuilder->weld_combo_box("val2")) +, m_xLbConnect3(m_xBuilder->weld_combo_box("connect3")) +, m_xLbField3(m_xBuilder->weld_combo_box("field3")) +, m_xLbCond3(m_xBuilder->weld_combo_box("cond3")) +, m_xEdVal3(m_xBuilder->weld_combo_box("val3")) +, m_xLbConnect4(m_xBuilder->weld_combo_box("connect4")) +, m_xLbField4(m_xBuilder->weld_combo_box("field4")) +, m_xLbCond4(m_xBuilder->weld_combo_box("cond4")) +, m_xEdVal4(m_xBuilder->weld_combo_box("val4")) +, m_xContents(m_xBuilder->weld_widget("grid")) +, m_xScrollBar(m_xBuilder->weld_scrolled_window("scrollbar")) +, m_xExpander(m_xBuilder->weld_expander("more")) +, m_xBtnOk(m_xBuilder->weld_button("ok")) +, m_xBtnCancel(m_xBuilder->weld_button("cancel")) +, m_xBtnCase(m_xBuilder->weld_check_button("case")) +, m_xBtnRegExp(m_xBu
[Libreoffice-commits] core.git: include/formula sc/source sc/uiconfig solenv/sanitizers
include/formula/funcutl.hxx |5 sc/source/ui/app/scmod.cxx | 36 +- sc/source/ui/inc/crnrdlg.hxx | 69 ++-- sc/source/ui/inc/reffact.hxx |2 sc/source/ui/miscdlgs/crnrdlg.cxx| 493 +++ sc/source/ui/view/reffact.cxx|4 sc/source/ui/view/tabview3.cxx | 16 - sc/source/ui/view/tabvwsh4.cxx | 15 sc/source/ui/view/tabvwshc.cxx | 11 sc/uiconfig/scalc/ui/namerangesdialog.ui | 64 +++- solenv/sanitizers/ui/modules/scalc.suppr |4 11 files changed, 395 insertions(+), 324 deletions(-) New commits: commit dd5fbb68ebaa8b8be8b6a4a97a8aedbf22d5714f Author: Caolán McNamara AuthorDate: Thu Apr 11 21:19:28 2019 +0100 Commit: Caolán McNamara CommitDate: Fri Apr 12 14:53:02 2019 +0200 weld ScColRowNameRangesDlg Change-Id: I976fb892f8ac1dedb0c2c3110dce17c1211de238 Reviewed-on: https://gerrit.libreoffice.org/70652 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/include/formula/funcutl.hxx b/include/formula/funcutl.hxx index d7734d8fd68d..22e46ecc81c1 100644 --- a/include/formula/funcutl.hxx +++ b/include/formula/funcutl.hxx @@ -147,6 +147,11 @@ public: xEntry->select_region(rSelection.Min(), rSelection.Max()); } +void SetCursorAtLast() +{ +xEntry->set_position(-1); +} + Selection GetSelection() const { int nStartPos, nEndPos; diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index 7235c02076fb..09c7bbd63027 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -1605,11 +1605,19 @@ bool ScModule::IsTableLocked() SfxChildWindow* pChildWnd = lcl_GetChildWinFromAnyView( m_nCurRefDlgId ); if ( pChildWnd ) { -IAnyRefDialog* pRefDlg(dynamic_cast(pChildWnd->GetWindow())); -assert(pRefDlg); -if(pRefDlg) +if (pChildWnd->GetWindow()) +{ +IAnyRefDialog* pRefDlg(dynamic_cast(pChildWnd->GetWindow())); +assert(pRefDlg); +if (pRefDlg) +bLocked = pRefDlg->IsTableLocked(); +} +if (pChildWnd->GetController()) { -bLocked = pRefDlg->IsTableLocked(); +IAnyRefDialog* pRefDlg = dynamic_cast(pChildWnd->GetController().get()); +assert(pRefDlg); +if (pRefDlg) +bLocked = pRefDlg->IsTableLocked(); } } else @@ -1764,11 +1772,23 @@ void ScModule::AddRefEntry() OSL_ENSURE( pChildWnd, "NoChildWin" ); if ( pChildWnd ) { -IAnyRefDialog* pRefDlg = dynamic_cast(pChildWnd->GetWindow()); -assert(pRefDlg); -if(pRefDlg) +if (pChildWnd->GetWindow()) { -pRefDlg->AddRefEntry(); +IAnyRefDialog* pRefDlg = dynamic_cast(pChildWnd->GetWindow()); +assert(pRefDlg); +if (pRefDlg) +{ +pRefDlg->AddRefEntry(); +} +} +if (pChildWnd->GetController()) +{ +IAnyRefDialog* pRefDlg = dynamic_cast(pChildWnd->GetController().get()); +assert(pRefDlg); +if (pRefDlg) +{ +pRefDlg->AddRefEntry(); +} } } } diff --git a/sc/source/ui/inc/crnrdlg.hxx b/sc/source/ui/inc/crnrdlg.hxx index 95222a9b5379..948724e08e84 100644 --- a/sc/source/ui/inc/crnrdlg.hxx +++ b/sc/source/ui/inc/crnrdlg.hxx @@ -29,35 +29,20 @@ class ScViewData; class ScDocument; -class ScColRowNameRangesDlg : public ScAnyRefDlg +class ScColRowNameRangesDlg : public ScAnyRefDlgController { public: -ScColRowNameRangesDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent, - ScViewData*ptrViewData ); -virtual ~ScColRowNameRangesDlg() override; -virtual voiddispose() override; +ScColRowNameRangesDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent, + ScViewData* ptrViewData); +virtual ~ScColRowNameRangesDlg() override; virtual voidSetReference( const ScRange& rRef, ScDocument* pDoc ) override; virtual boolIsRefInputMode() const override; virtual voidSetActive() override; -virtual boolClose() override; +virtual voidClose() override; private: -VclPtr pLbRange; - -VclPtrpEdAssign; -VclPtr pRbAssign; -VclPtr pBtnColHead; -VclPtr pBtnRowHead; -VclPtrpEdAssign2; -VclPtr pRbAssign2; - -VclPtrpBtnOk; -VclPtrpBtnCancel; -VclPtr pBtnAdd; -VclPtr pBtnRemove; -
[Libreoffice-commits] core.git: include/formula sc/source sc/uiconfig solenv/sanitizers
include/formula/funcutl.hxx | 10 sc/source/ui/inc/areasdlg.hxx| 64 +++--- sc/source/ui/inc/reffact.hxx |2 sc/source/ui/pagedlg/areasdlg.cxx| 319 ++- sc/source/ui/view/reffact.cxx|4 sc/source/ui/view/tabvwshc.cxx |9 sc/uiconfig/scalc/ui/printareasdialog.ui | 23 +- solenv/sanitizers/ui/modules/scalc.suppr |9 8 files changed, 219 insertions(+), 221 deletions(-) New commits: commit 0b022f7e1a0312ab4db762a198714675cdf65ca8 Author: Caolán McNamara AuthorDate: Thu Apr 11 14:52:50 2019 +0100 Commit: Caolán McNamara CommitDate: Fri Apr 12 12:45:38 2019 +0200 weld ScPrintAreasDlg Change-Id: I1e1d31551b623453a1bade9c932ef1c9e1060f35 Reviewed-on: https://gerrit.libreoffice.org/70600 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/include/formula/funcutl.hxx b/include/formula/funcutl.hxx index d2aec01bf90a..d7734d8fd68d 100644 --- a/include/formula/funcutl.hxx +++ b/include/formula/funcutl.hxx @@ -159,6 +159,16 @@ public: return pLabelWidget; } +void SaveValue() +{ +xEntry->save_value(); +} + +bool IsValueChangedFromSaved() const +{ +return xEntry->get_value_changed_from_saved(); +} + void SetGetFocusHdl(const Link& rLink) { maGetFocusHdl = rLink; } void SetLoseFocusHdl(const Link& rLink) { maLoseFocusHdl = rLink; } void SetModifyHdl(const Link& rLink) { maModifyHdl = rLink; } diff --git a/sc/source/ui/inc/areasdlg.hxx b/sc/source/ui/inc/areasdlg.hxx index 098eed033468..694e0447d78a 100644 --- a/sc/source/ui/inc/areasdlg.hxx +++ b/sc/source/ui/inc/areasdlg.hxx @@ -28,12 +28,11 @@ class ScDocument; class ScViewData; class SfxStringItem; -class ScPrintAreasDlg : public ScAnyRefDlg +class ScPrintAreasDlg : public ScAnyRefDlgController { public: -ScPrintAreasDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent ); -virtual ~ScPrintAreasDlg() override; -virtual voiddispose() override; +ScPrintAreasDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent); +virtual ~ScPrintAreasDlg() override; virtual voidSetReference( const ScRange& rRef, ScDocument* pDoc ) override; virtual voidAddRefEntry() override; @@ -41,41 +40,52 @@ public: virtual boolIsTableLocked() const override; virtual voidSetActive() override; -virtual voidDeactivate() override; -virtual boolClose() override; +virtual voidClose() override; private: -VclPtr pLbPrintArea; -VclPtrpEdPrintArea; -VclPtr pRbPrintArea; - -VclPtr pLbRepeatRow; -VclPtrpEdRepeatRow; -VclPtr pRbRepeatRow; - -VclPtr pLbRepeatCol; -VclPtrpEdRepeatCol; -VclPtr pRbRepeatCol; - -VclPtrpBtnOk; -VclPtrpBtnCancel; - boolbDlgLostFocus; -VclPtr pRefInputEdit; ScDocument* pDoc; ScViewData* pViewData; SCTAB nCurTab; +formula::WeldRefEdit* m_pRefInputEdit; + +std::unique_ptr m_xLbPrintArea; +std::unique_ptr m_xEdPrintArea; +std::unique_ptr m_xRbPrintArea; + +std::unique_ptr m_xLbRepeatRow; +std::unique_ptr m_xEdRepeatRow; +std::unique_ptr m_xRbRepeatRow; + +std::unique_ptr m_xLbRepeatCol; +std::unique_ptr m_xEdRepeatCol; +std::unique_ptr m_xRbRepeatCol; + +std::unique_ptr m_xBtnOk; +std::unique_ptr m_xBtnCancel; + +std::unique_ptr m_xPrintFrame; +std::unique_ptr m_xRowFrame; +std::unique_ptr m_xColFrame; + +std::unique_ptr m_xPrintFrameFT; +std::unique_ptr m_xRowFrameFT; +std::unique_ptr m_xColFrameFT; + void Impl_Reset(); bool Impl_CheckRefStrings(); void Impl_FillLists(); -bool Impl_GetItem( const Edit* pEd, SfxStringItem& rItem ); +bool Impl_GetItem( const formula::WeldRefEdit* pEd, SfxStringItem& rItem ); // Handler: -DECL_LINK( Impl_SelectHdl, ListBox&, void ); -DECL_LINK( Impl_ModifyHdl, Edit&, void ); -DECL_LINK( Impl_BtnHdl,Button*, void ); -DECL_LINK( Impl_GetFocusHdl, Control&, void ); +DECL_LINK( Impl_SelectHdl, weld::ComboBox&, void ); +DECL_LINK( Impl_ModifyHdl, formula::WeldRefEdit&, void ); +DECL_LINK( Impl_BtnHdl,weld::Button&, void ); +DECL_LINK( Impl_GetEditFocusHdl, formula::WeldRefEdit&, void ); +DECL_LINK( Impl_LoseEditFocusHdl, formula::WeldRefEdit&, void ); +DECL_LINK( Impl_LoseButtonFocusHdl, formula::WeldRefButton&, void ); +DECL_LINK( Impl_GetFocusHdl, weld::Widget&, void ); }; #endif diff --git a/sc/source/ui/inc/reffact.hxx b/sc/source/ui/inc/reffact.hxx index 79a873f31115..444abd3b1362 100644 --- a/sc/source/ui/inc/reffact.hxx +++ b/sc/source/ui/inc/reffact.hxx @@ -55,7 +55,7 @@ DECL_
[Libreoffice-commits] core.git: include/formula sc/source sc/uiconfig solenv/sanitizers
include/formula/funcutl.hxx | 12 +++ sc/source/ui/inc/reffact.hxx |5 + sc/source/ui/inc/simpref.hxx | 25 +++--- sc/source/ui/miscdlgs/simpref.cxx| 91 +--- sc/source/ui/view/reffact.cxx| 35 + sc/source/ui/view/tabvwshc.cxx | 19 ++--- sc/uiconfig/scalc/ui/simplerefdialog.ui | 113 --- solenv/sanitizers/ui/modules/scalc.suppr |1 8 files changed, 151 insertions(+), 150 deletions(-) New commits: commit 8d19e03b17fdd6e6159843249fe0b4f41c526f17 Author: Caolán McNamara AuthorDate: Wed Apr 10 13:09:05 2019 +0100 Commit: Caolán McNamara CommitDate: Thu Apr 11 11:23:30 2019 +0200 weld ScSimpleRefDlg Change-Id: I36fe5a0790b2f7a43b9e4d8def9ef3a224d4d546 Reviewed-on: https://gerrit.libreoffice.org/70549 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/include/formula/funcutl.hxx b/include/formula/funcutl.hxx index 5a6c095db77e..d2aec01bf90a 100644 --- a/include/formula/funcutl.hxx +++ b/include/formula/funcutl.hxx @@ -142,6 +142,18 @@ public: xEntry->select_region(0, -1); } +void SetSelection(const Selection& rSelection) +{ +xEntry->select_region(rSelection.Min(), rSelection.Max()); +} + +Selection GetSelection() const +{ +int nStartPos, nEndPos; +xEntry->get_selection_bounds(nStartPos, nEndPos); +return Selection(nStartPos, nEndPos); +} + weld::Label* GetLabelWidgetForShrinkMode() { return pLabelWidget; diff --git a/sc/source/ui/inc/reffact.hxx b/sc/source/ui/inc/reffact.hxx index b7ab53612a0b..e6bf12c0feec 100644 --- a/sc/source/ui/inc/reffact.hxx +++ b/sc/source/ui/inc/reffact.hxx @@ -180,7 +180,10 @@ class ScSimpleRefDlgWrapper: public SfxChildWindow SfxBindings*, SfxChildWinInfo* ); -SFX_DECL_CHILDWINDOW_WITHID(Class); +static std::unique_ptr CreateImpl(vcl::Window *pParent, sal_uInt16 nId, + SfxBindings *pBindings, SfxChildWinInfo* pInfo); +static void RegisterChildWindow(bool bVisible=false, SfxModule *pMod=nullptr, SfxChildWindowFlags nFlags=SfxChildWindowFlags::NONE); +static sal_uInt16 GetChildWindowId(); static void SetDefaultPosSize(Point aPos, Size aSize); voidSetRefString(const OUString& rStr); diff --git a/sc/source/ui/inc/simpref.hxx b/sc/source/ui/inc/simpref.hxx index 492dac5910b2..c3a9184c1099 100644 --- a/sc/source/ui/inc/simpref.hxx +++ b/sc/source/ui/inc/simpref.hxx @@ -25,7 +25,7 @@ class ScDocument; -class ScSimpleRefDlg: public ScAnyRefDlg +class ScSimpleRefDlg: public ScAnyRefDlgController { private: Link aCloseHdl; @@ -33,13 +33,6 @@ private: Link aAbortedHdl; Link aChangeHdl; -VclPtr m_pFtAssign; -VclPtr m_pEdAssign; -VclPtr m_pRbAssign; - -VclPtr m_pBtnOk; -VclPtr m_pBtnCancel; - ScRange theCurArea; boolbCloseFlag; boolbAutoReOpen; @@ -47,30 +40,34 @@ private: boolbSingleCell; boolbMultiSelection; +std::unique_ptr m_xFtAssign; +std::unique_ptr m_xEdAssign; +std::unique_ptr m_xRbAssign; +std::unique_ptr m_xBtnOk; +std::unique_ptr m_xBtnCancel; + voidInit(); -DECL_LINK( CancelBtnHdl, Button*, void ); -DECL_LINK( OkBtnHdl, Button*, void ); +DECL_LINK( CancelBtnHdl, weld::Button&, void ); +DECL_LINK( OkBtnHdl, weld::Button&, void ); protected: virtual voidRefInputDone( bool bForced = false ) override; public: -ScSimpleRefDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent); +ScSimpleRefDlg( SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent); virtual~ScSimpleRefDlg() override; -virtual voiddispose() override; virtual voidSetReference( const ScRange& rRef, ScDocument* pDoc ) override; virtual boolIsRefInputMode() const override; virtual voidSetActive() override; -virtual boolClose() override; +virtual voidClose() override; voidStartRefInput(); voidSetRefString(const OUString &rStr); -virtual voidFillInfo(SfxChildWinInfo&) const override; voidSetCloseHdl( const Link& rLink ); voidSetUnoLinks( const Link& rDone, const Link& rAbort, diff --git a/sc/source/ui/miscdlgs/simpref.cxx b/sc/source/ui/miscdlgs/simpref.cxx index def1babab0f9..362c4e1382ae 100644 --- a/sc/source/ui/miscdlgs/simpref.cxx +++ b/sc/source/ui/miscdlgs/simpref.cxx @@ -21,23 +21,20 @@ #include #include -ScSimpleRefDlg::ScSimpleRefDlg(SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pP
[Libreoffice-commits] core.git: include/formula
include/formula/funcutl.hxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit f01390010338ae627c990026c4ba579ab5eb266f Author: Caolán McNamara AuthorDate: Tue Apr 9 12:25:22 2019 +0100 Commit: Caolán McNamara CommitDate: Tue Apr 9 14:31:25 2019 +0200 zugeordnetes->associated Change-Id: I4ba1a3c467526b85f576e5549e7c47a1e0fb66a0 Reviewed-on: https://gerrit.libreoffice.org/70456 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/include/formula/funcutl.hxx b/include/formula/funcutl.hxx index 5bb490d648a2..0a4c25d1236c 100644 --- a/include/formula/funcutl.hxx +++ b/include/formula/funcutl.hxx @@ -92,7 +92,7 @@ private: OUString aShrinkQuickHelp; OUString aExpandQuickHelp; IControlReferenceHandler* pAnyRefDlg; // parent dialog -VclPtr pRefEdit; // zugeordnetes Edit-Control +VclPtr pRefEdit; // associated Edit-Control protected: virtual void Click() override; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula sc/inc sc/source
include/formula/errorcodes.hxx |4 sc/inc/globstr.hrc |1 + sc/source/core/data/global.cxx |3 +++ sc/source/core/tool/interpr7.cxx | 35 --- 4 files changed, 32 insertions(+), 11 deletions(-) New commits: commit da9a6f426b61937d9cda17f5be3f82d2e15e6ecd Author: Eike Rathke AuthorDate: Thu Jul 19 17:39:02 2018 +0200 Commit: Eike Rathke CommitDate: Thu Jul 19 20:36:22 2018 +0200 Related: tdf#118735 introduce FormulaError::LinkFormulaNeedingCheck (Err:540) To indicate why the result isn't available ("External content disabled") and in future maybe signal to the formula cell that it could keep the hybrid string result, see source code comment. Change-Id: Ic5d336b8489e8776f7b640b7e46815e71d0a82a4 Reviewed-on: https://gerrit.libreoffice.org/57738 Reviewed-by: Eike Rathke Tested-by: Jenkins diff --git a/include/formula/errorcodes.hxx b/include/formula/errorcodes.hxx index d4324a998db0..7afce495b6de 100644 --- a/include/formula/errorcodes.hxx +++ b/include/formula/errorcodes.hxx @@ -83,6 +83,9 @@ enum class FormulaError : sal_uInt16 MatrixSize = 538, // Bad inline array content, non-value/non-string. BadArrayContent = 539, +// Interpreter: signal result not available because updating links is not +// allowed (yet) and tell to try hybrid string as result. +LinkFormulaNeedingCheck = 540, // Interpreter: NA() not available condition, not a real error NotAvailable = 0x7fff @@ -171,6 +174,7 @@ inline bool isPublishedFormulaError( FormulaError nErr ) return false; case FormulaError::MatrixSize: +case FormulaError::LinkFormulaNeedingCheck: return true; case FormulaError::NotAvailable: diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc index 326c9f01c455..09caaf80423c 100644 --- a/sc/inc/globstr.hrc +++ b/sc/inc/globstr.hrc @@ -510,6 +510,7 @@ #define STR_TEXTNC_("STR_TEXT", "Text") #define STR_QUERY_PIVOTTABLE_DELTAB NC_("STR_QUERY_PIVOTTABLE_DELTAB", "The selected sheet(s) contain source data of related pivot tables that will be lost. Are you sure you want to delete the selected sheet(s)?") #define STR_ERR_NAME_INVALID_CELL_REF NC_("STR_ERR_NAME_INVALID_CELL_REF", "Invalid name. Reference to a cell, or a range of cells not allowed.") +#define STR_ERR_LONG_LINK_FORMULA_NEEDING_CHECK NC_("STR_ERR_LONG_LINK_FORMULA_NEEDING_CHECK", "External content disabled.") #endif diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index 825278134b43..cf0bd92371da 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -423,6 +423,9 @@ OUString ScGlobal::GetLongErrorString(FormulaError nErr) case FormulaError::BadArrayContent: pErrNumber = STR_ERR_LONG_BAD_ARRAY_CONTENT; break; +case FormulaError::LinkFormulaNeedingCheck: +pErrNumber = STR_ERR_LONG_LINK_FORMULA_NEEDING_CHECK; +break; case FormulaError::NoValue: pErrNumber = STR_LONG_ERR_NO_VALUE; break; diff --git a/sc/source/core/tool/interpr7.cxx b/sc/source/core/tool/interpr7.cxx index 108d5f4445ea..e2dd62717fb9 100644 --- a/sc/source/core/tool/interpr7.cxx +++ b/sc/source/core/tool/interpr7.cxx @@ -320,7 +320,6 @@ void ScInterpreter::ScWebservice() ScWebServiceLink* pLink = lcl_GetWebServiceLink(mpLinkManager, aURI); bool bWasError = (pMyFormulaCell && pMyFormulaCell->GetRawError() != FormulaError::NONE); -bool bLinkFormulaNeedingCheck = false; if (!pLink) { @@ -336,8 +335,7 @@ void ScInterpreter::ScWebservice() //if the document was just loaded, but the ScDdeLink entry was missing, then //don't update this link until the links are updated in response to the users //decision -bLinkFormulaNeedingCheck = pDok->HasLinkFormulaNeedingCheck(); -if (!bLinkFormulaNeedingCheck) +if (!pDok->HasLinkFormulaNeedingCheck()) { pLink->Update(); } @@ -361,7 +359,7 @@ void ScInterpreter::ScWebservice() // check the value if (pLink->HasResult()) PushString(pLink->GetResult()); -else +else if (pDok->HasLinkFormulaNeedingCheck()) { // If this formula cell is recalculated just after load and the // expression is exactly WEBSERVICE("literal_URI") (i.e. no other @@ -371,18 +369,33 @@ void ScInterpreter::ScWebservice() // external links has been disabled." // This will work only once, as the new formula cell result won't // be a hybrid anymore. -if (bLinkFormulaNeedingCheck && pMyFormulaCell && pMyFormulaCell->GetCode()->GetCodeLen() == 2 && -pMyFormulaCel
[Libreoffice-commits] core.git: include/formula sc/source
include/formula/tokenarray.hxx |8 ++-- sc/source/filter/oox/formulabuffer.cxx | 26 -- 2 files changed, 26 insertions(+), 8 deletions(-) New commits: commit 771149ac99a57c641caebdfc7dd6fac25c292682 Author: Eike Rathke AuthorDate: Fri Jul 13 22:30:24 2018 +0200 Commit: Eike Rathke CommitDate: Sat Jul 14 01:55:16 2018 +0200 Resolves: tdf#94925 do not unset dirty if formula cell must be recalculated Change-Id: If70860b8babf1cce7fda2ae63412659e72dbb4c3 Reviewed-on: https://gerrit.libreoffice.org/57404 Reviewed-by: Eike Rathke Tested-by: Jenkins diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx index d4111f798d5c..2c422d94faf8 100644 --- a/include/formula/tokenarray.hxx +++ b/include/formula/tokenarray.hxx @@ -58,8 +58,8 @@ enum class ScRecalcMode : sal_uInt8 { ALWAYS = 0x01, // exclusive, always ONLOAD_MUST= 0x02, // exclusive, always after load -ONLOAD_LENIENT = 0x04, // exclusive, lenient after load (eg. macros not always, aliens, ...) -ONLOAD_ONCE= 0x08, // exclusive, once after load, import filter +ONLOAD_ONCE= 0x04, // exclusive, once after load, import filter +ONLOAD_LENIENT = 0x08, // exclusive, lenient after load (eg. macros not always, aliens, ...) NORMAL = 0x10, // exclusive FORCED = 0x20, // combined, also if cell isn't visible, for macros with side effects ONREFMOVE = 0x40, // combined, if reference was moved @@ -416,6 +416,10 @@ public: { return bool(nMode & ScRecalcMode::FORCED); } boolIsRecalcModeOnRefMove() const { return bool(nMode & ScRecalcMode::ONREFMOVE); } +/** Whether recalculation must happen after import, for +example OOXML. */ +boolIsRecalcModeMustAfterImport() const +{ return (nMode & ScRecalcMode::EMask) <= ScRecalcMode::ONLOAD_ONCE; } /** Get OpCode of the most outer function */ inline OpCode GetOuterFuncOpCode(); diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx index 9bec5335a599..53172729ac85 100644 --- a/sc/source/filter/oox/formulabuffer.cxx +++ b/sc/source/filter/oox/formulabuffer.cxx @@ -159,6 +159,11 @@ void applySharedFormulas( case XML_n: // numeric value. pCell->SetResultDouble(rDesc.maCellValue.toDouble()); +/* TODO: is it on purpose that we never reset dirty here + * and thus recalculate anyway if cell was dirty? Or is it + * never dirty and therefor set dirty below otherwise? This + * is different from the non-shared case in + * applyCellFormulaValues(). */ break; case XML_str: if (bGeneratorKnownGood) @@ -168,8 +173,11 @@ void applySharedFormulas( pCell->SetResultToken(new formula::FormulaStringToken(aSS)); // If we don't reset dirty, then e.g. disabling macros makes all cells // that use macro functions to show #VALUE! -pCell->ResetDirty(); -pCell->SetChanged(false); +if (!pCell->GetCode()->IsRecalcModeMustAfterImport()) +{ +pCell->ResetDirty(); +pCell->SetChanged(false); +} break; } SAL_FALLTHROUGH; @@ -270,8 +278,11 @@ void applyCellFormulaValues( case XML_n: { pCell->SetResultDouble(rValueStr.toDouble()); -pCell->ResetDirty(); -pCell->SetChanged(false); +if (!pCell->GetCode()->IsRecalcModeMustAfterImport()) +{ +pCell->ResetDirty(); +pCell->SetChanged(false); +} } break; case XML_str: @@ -289,8 +300,11 @@ void applyCellFormulaValues( { svl::SharedString aSS = rStrPool.intern(rValueStr); pCell->SetResultToken(new formula::FormulaStringToken(aSS)); -pCell->ResetDirty(); -pCell->SetChanged(false); +if (!pCell->GetCode()->IsRecalcModeMustAfterImport()) +{ +pCell->ResetDirty(); +pCell->SetChanged(false); +} } break; default: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesk
[Libreoffice-commits] core.git: include/formula sc/inc sc/source
include/formula/errorcodes.hxx |3 +++ sc/inc/globstr.hrc |1 + sc/source/core/data/global.cxx |3 +++ sc/source/core/tool/compiler.cxx |2 +- 4 files changed, 8 insertions(+), 1 deletion(-) New commits: commit 5870cf6d9b42094dfda3dbf85817003e021d6559 Author: Eike Rathke Date: Tue Jun 5 10:49:07 2018 +0200 Add "Unsupported inline array content." BadArrayContent message, tdf#117879 Change-Id: I176884ea5161c4f12419431a74bfb2c6fbed4e0f Reviewed-on: https://gerrit.libreoffice.org/55317 Reviewed-by: Eike Rathke Tested-by: Jenkins diff --git a/include/formula/errorcodes.hxx b/include/formula/errorcodes.hxx index 41bffa4d9ef9..d4324a998db0 100644 --- a/include/formula/errorcodes.hxx +++ b/include/formula/errorcodes.hxx @@ -81,6 +81,8 @@ enum class FormulaError : sal_uInt16 RetryCircular= 537, // If matrix could not be allocated. MatrixSize = 538, +// Bad inline array content, non-value/non-string. +BadArrayContent = 539, // Interpreter: NA() not available condition, not a real error NotAvailable = 0x7fff @@ -159,6 +161,7 @@ inline bool isPublishedFormulaError( FormulaError nErr ) case FormulaError::NoMacro: case FormulaError::DivisionByZero: case FormulaError::NestedArray: +case FormulaError::BadArrayContent: return true; case FormulaError::NotNumericString: diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc index 4ca23e111439..d33be62479dd 100644 --- a/sc/inc/globstr.hrc +++ b/sc/inc/globstr.hrc @@ -387,6 +387,7 @@ #define STR_RECALC_MANUAL NC_("STR_RECALC_MANUAL", "Manual") #define STR_RECALC_AUTO NC_("STR_RECALC_AUTO", "Automatic") #define STR_ERR_LONG_NESTED_ARRAY NC_("STR_ERR_LONG_NESTED_ARRAY", "Nested arrays are not supported.") +#define STR_ERR_LONG_BAD_ARRAY_CONTENT NC_("STR_ERR_LONG_BAD_ARRAY_CONTENT", "Unsupported inline array content.") #define STR_UNDO_TEXTTOCOLUMNS NC_("STR_UNDO_TEXTTOCOLUMNS", "Text to Columns") #define STR_DOC_UPDATED NC_("STR_DOC_UPDATED", "Your spreadsheet has been updated with changes saved by other users.") #define STR_DOC_WILLBESAVED NC_("STR_DOC_WILLBESAVED", "The spreadsheet must be saved now to activate sharing mode.\n\nDo you want to continue?") diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index 46c9870500e7..775db26946fb 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -446,6 +446,9 @@ OUString ScGlobal::GetLongErrorString(FormulaError nErr) case FormulaError::NestedArray: pErrNumber = STR_ERR_LONG_NESTED_ARRAY; break; +case FormulaError::BadArrayContent: +pErrNumber = STR_ERR_LONG_BAD_ARRAY_CONTENT; +break; case FormulaError::NoValue: pErrNumber = STR_LONG_ERR_NO_VALUE; break; diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 93065ddd0326..4ec04d968042 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -4584,7 +4584,7 @@ ScTokenArray* ScCompiler::CompileString( const OUString& rFormula ) // Nested inline array or non-value/non-string in array. The // original tokens are still in the ScTokenArray and not merged // into an ScMatrixToken. Set error but keep on tokenizing. -SetError( FormulaError::NestedArray); +SetError( FormulaError::BadArrayContent); } else if (!pNewToken) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula
include/formula/opcode.hxx |2 -- 1 file changed, 2 deletions(-) New commits: commit f6c2fd1ce58a8f34483177c0b240c53a7866faf9 Author: Eike Rathke Date: Wed Dec 20 22:04:50 2017 +0100 Remove unused ocExternalRef Change-Id: Ie32411637f2f2dbedfc8e4272e952ecc1d72ac49 diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx index 88527b9244ee..a96707b30bd1 100644 --- a/include/formula/opcode.hxx +++ b/include/formula/opcode.hxx @@ -33,7 +33,6 @@ enum OpCode : sal_uInt16 ocStop = SC_OPCODE_STOP, ocExternal = SC_OPCODE_EXTERNAL, ocName = SC_OPCODE_NAME, -ocExternalRef = SC_OPCODE_EXTERNAL_REF, // Jump commands ocIf= SC_OPCODE_IF, ocIfError = SC_OPCODE_IF_ERROR, @@ -527,7 +526,6 @@ inline std::string OpCodeEnumToString(OpCode eCode) case ocStop: return "Stop"; case ocExternal: return "External"; case ocName: return "Name"; -case ocExternalRef: return "ExternalRef"; case ocIf: return "If"; case ocIfError: return "IfError"; case ocIfNA: return "IfNA"; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula
include/formula/opcode.hxx | 475 + 1 file changed, 475 insertions(+) New commits: commit bfa72a6a2a83ed10793d9723a1db24ec8ee03ed9 Author: Tor Lillqvist Date: Fri Nov 24 22:37:26 2017 +0200 Add a debugging output OpCodeEnumToString() function Change-Id: I5382107dc556df822292e72af48d23e04a3408a2 Reviewed-on: https://gerrit.libreoffice.org/45261 Reviewed-by: Tor Lillqvist Tested-by: Tor Lillqvist diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx index 181de360864e..88527b9244ee 100644 --- a/include/formula/opcode.hxx +++ b/include/formula/opcode.hxx @@ -20,6 +20,8 @@ #ifndef INCLUDED_FORMULA_OPCODE_HXX #define INCLUDED_FORMULA_OPCODE_HXX +#include + #include #include @@ -511,6 +513,479 @@ enum OpCode : sal_uInt16 ocNone = SC_OPCODE_NONE }; +// Only to be used for debugging output. No guarantee of stability of the +// return value. + +// Turn this into an operator<< when OpCode becomes a scoped enum + +inline std::string OpCodeEnumToString(OpCode eCode) +{ +switch (eCode) +{ +case ocPush: return "Push"; +case ocCall: return "Call"; +case ocStop: return "Stop"; +case ocExternal: return "External"; +case ocName: return "Name"; +case ocExternalRef: return "ExternalRef"; +case ocIf: return "If"; +case ocIfError: return "IfError"; +case ocIfNA: return "IfNA"; +case ocChoose: return "Choose"; +case ocOpen: return "Open"; +case ocClose: return "Close"; +case ocTableRefOpen: return "TableRefOpen"; +case ocTableRefClose: return "TableRefClose"; +case ocSep: return "Sep"; +case ocArrayOpen: return "ArrayOpen"; +case ocArrayClose: return "ArrayClose"; +case ocArrayRowSep: return "ArrayRowSep"; +case ocArrayColSep: return "ArrayColSep"; +case ocMissing: return "Missing"; +case ocBad: return "Bad"; +case ocStringXML: return "StringXML"; +case ocSpaces: return "Spaces"; +case ocMatRef: return "MatRef"; +case ocTableRefItemAll: return "TableRefItemAll"; +case ocTableRefItemHeaders: return "TableRefItemHeaders"; +case ocTableRefItemData: return "TableRefItemData"; +case ocTableRefItemTotals: return "TableRefItemTotals"; +case ocTableRefItemThisRow: return "TableRefItemThisRow"; +case ocSkip: return "Skip"; +case ocDBArea: return "DBArea"; +case ocTableRef: return "TableRef"; +case ocMacro: return "Macro"; +case ocColRowName: return "ColRowName"; +case ocColRowNameAuto: return "ColRowNameAuto"; +case ocPercentSign: return "PercentSign"; +case ocErrNull: return "ErrNull"; +case ocErrDivZero: return "ErrDivZero"; +case ocErrValue: return "ErrValue"; +case ocErrRef: return "ErrRef"; +case ocErrName: return "ErrName"; +case ocErrNum: return "ErrNum"; +case ocErrNA: return "ErrNA"; +case ocAdd: return "Add"; +case ocSub: return "Sub"; +case ocMul: return "Mul"; +case ocDiv: return "Div"; +case ocAmpersand: return "Ampersand"; +case ocPow: return "Pow"; +case ocEqual: return "Equal"; +case ocNotEqual: return "NotEqual"; +case ocLess: return "Less"; +case ocGreater: return "Greater"; +case ocLessEqual: return "LessEqual"; +case ocGreaterEqual: return "GreaterEqual"; +case ocAnd: return "And"; +case ocOr: return "Or"; +case ocXor: return "Xor"; +case ocIntersect: return "Intersect"; +case ocUnion: return "Union"; +case ocRange: return "Range"; +case ocNot: return "Not"; +case ocNeg: return "Neg"; +case ocNegSub: return "NegSub"; +case ocPi: return "Pi"; +case ocRandom: return "Random"; +case ocTrue: return "True"; +case ocFalse: return "False"; +case ocGetActDate: return "GetActDate"; +case ocGetActTime: return "GetActTime"; +case ocNotAvail: return "NotAvail"; +case ocCurrent: return "Current"; +case ocDeg: return "Deg"; +case ocRad: return "Rad"; +case ocSin: return "Sin"; +case ocCos: return "Cos"; +case ocTan: return "Tan"; +case ocCot: return "Cot"; +case ocArcSin: return "ArcSin"; +case ocArcCos: return "ArcCos"; +case ocArcTan: return "ArcTan"; +case ocArcCot: return "ArcCot"; +case ocSinHyp: return "SinHyp"; +case ocCosHyp: return "CosHyp"; +case ocTanHyp: return "TanHyp"; +case ocCotHyp: return "CotHyp"; +case ocArcSinHyp: return "ArcSinHyp"; +case ocArcCosHyp: return "ArcCosHyp"; +case ocArcTanHyp: return "ArcTanHyp"; +case ocArcCotHyp: return "ArcCotHyp"; +case ocCosecant: return "Cosecant"; +case ocSecant: return "Secant"; +case ocCosecantHyp: return "CosecantHyp"; +case ocSecantHyp: return "SecantHyp"; +case ocExp: return "Exp"; +case ocLn: return "Ln"; +case ocSqrt: return "Sqrt"; +case ocFact: return "Fact"; +case ocGetYear: return "GetYear"; +case ocGetMonth: return "GetMonth"; +cas
[Libreoffice-commits] core.git: include/formula
include/formula/token.hxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit ceff579722cd606de8ba71444a9d819f4e8a011d Author: Tor Lillqvist Date: Fri Nov 24 22:36:49 2017 +0200 Mention that the StackVarEnumToString should really be an operator<< Change-Id: I71288daf10b1010ab0f9dbedd39875cc24f119ae diff --git a/include/formula/token.hxx b/include/formula/token.hxx index 3de7c761d658..c3144b4a2dcb 100644 --- a/include/formula/token.hxx +++ b/include/formula/token.hxx @@ -84,6 +84,9 @@ enum StackVar : sal_uInt8 // Only to be used for debugging output. No guarantee of stability of the // return value. + +// Turn this into an operator<< when StackVar becomes a scoped enum + inline std::string StackVarEnumToString(StackVar const e) { switch (e) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula include/o3tl include/svtools package/source sc/inc sc/qa sc/source sd/source sw/inc sw/source
include/formula/formula.hxx |5 - include/o3tl/deleter.hxx | 50 ++ include/svtools/ivctrl.hxx |3 include/svtools/templatefoldercache.hxx |4 package/source/xstor/xstorage.hxx|3 sc/inc/document.hxx |3 sc/inc/funcuno.hxx |4 sc/qa/unit/ucalc.cxx |4 sc/qa/unit/ucalc_sharedformula.cxx |2 sc/source/core/data/document.cxx |4 sc/source/filter/inc/XclExpChangeTrack.hxx |3 sc/source/ui/dataprovider/htmldataprovider.hxx |2 sc/source/ui/docshell/dbdocfun.cxx | 14 +- sc/source/ui/docshell/docfunc.cxx|6 - sc/source/ui/docshell/docfuncutil.cxx|6 - sc/source/ui/docshell/documentlinkmgr.cxx|4 sc/source/ui/docshell/impex.cxx |2 sc/source/ui/inc/dataprovider.hxx|2 sc/source/ui/inc/docfuncutil.hxx |4 sc/source/ui/inc/spelldialog.hxx |7 - sc/source/ui/inc/tabvwsh.hxx |3 sc/source/ui/inc/undoblk.hxx | 54 +-- sc/source/ui/inc/undodat.hxx | 30 +++--- sc/source/ui/inc/undotab.hxx |2 sc/source/ui/undo/undoblk.cxx|2 sc/source/ui/undo/undoblk3.cxx |2 sc/source/ui/unoobj/funcuno.cxx |2 sc/source/ui/view/cellsh2.cxx|6 - sc/source/ui/view/dbfunc3.cxx|2 sc/source/ui/view/preview.cxx|8 - sc/source/ui/view/printfun.cxx |2 sc/source/ui/view/tabvwsh4.cxx |3 sc/source/ui/view/viewfun2.cxx |4 sc/source/ui/view/viewfun3.cxx | 18 +-- sc/source/ui/view/viewfun5.cxx |2 sd/source/ui/framework/module/ToolBarModule.hxx |3 sd/source/ui/func/fuolbull.cxx |4 sd/source/ui/func/fuoltext.cxx |2 sd/source/ui/inc/OutlineView.hxx |3 sd/source/ui/inc/ViewShellImplementation.hxx |4 sd/source/ui/inc/ViewShellManager.hxx|3 sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx |3 sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx|3 sd/source/ui/view/ToolBarManager.cxx |3 sd/source/ui/view/drtxtob1.cxx |2 sd/source/ui/view/outlnvs2.cxx |2 sd/source/ui/view/outlnvsh.cxx |2 sw/inc/list.hxx |3 sw/source/uibase/app/applab.cxx |3 sw/source/uibase/dochdl/swdtflvr.cxx |3 50 files changed, 190 insertions(+), 125 deletions(-) New commits: commit e26f8d2592a3d7cc5b43b3246b364397dd704f0d Author: Caolán McNamara Date: Fri Aug 25 11:09:38 2017 +0100 coverity#1401307 document checked 'Uncaught exception' markup std::unique_ptr where coverity warns a dtor might throw exceptions which won't throw in practice, or where std::terminate is an acceptable response if they do Change-Id: Icc99cdecf8d8b011e599574f0a05b59efd1c65c2 Reviewed-on: https://gerrit.libreoffice.org/41561 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/include/formula/formula.hxx b/include/formula/formula.hxx index 82e8246bc9b0..4c9d37e807b0 100644 --- a/include/formula/formula.hxx +++ b/include/formula/formula.hxx @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -69,7 +70,7 @@ public: virtual void dispose() override; private: -::std::unique_ptr m_pImpl; +std::unique_ptr> m_pImpl; protected: @@ -99,7 +100,7 @@ public: virtual ~FormulaDlg() override; virtual void dispose() override; private: -::std::unique_ptr m_pImpl; +std::unique_ptr> m_pImpl; DECL_LINK( UpdateFocusHdl, Timer*, void ); protected: diff --git a/include/o3tl/deleter.hxx b/include/o3tl/deleter.hxx new file mode 100644 index ..5b5e67929a15 --- /dev/null +++ b/include/o3tl/deleter.hxx @@
[Libreoffice-commits] core.git: include/formula
include/formula/tokenarray.hxx |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) New commits: commit bf0996d39cbb0162c037ae1c9037e8c0f9d5b0e7 Author: Eike Rathke Date: Mon Sep 25 13:15:50 2017 +0200 Clarify comment of "copy"-ctor and operator=() Change-Id: Ie6e40e5c08d05ee75e4d1d9d6d8b4e567ecbcdbc diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx index eed55d089921..891b793c3f10 100644 --- a/include/formula/tokenarray.hxx +++ b/include/formula/tokenarray.hxx @@ -292,7 +292,8 @@ public: { nMode = GetCombinedBitsRecalcMode() | nBits; } FormulaTokenArray(); -/// Assignment with references to FormulaToken entries (not copied!) +/** Assignment with incrementing references of FormulaToken entries +(not copied!) */ FormulaTokenArray( const FormulaTokenArray& ); virtual ~FormulaTokenArray(); @@ -468,7 +469,8 @@ public: virtual FormulaToken* MergeArray( ); -/// Assignment with references to FormulaToken entries (not copied!) +/** Assignment with incrementing references of FormulaToken entries +(not copied!) */ FormulaTokenArray& operator=( const FormulaTokenArray& ); /** Determines if this formula needs any changes to convert it to something ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula reportbuilder/java reportdesign/source
include/formula/funcvarargs.h |2 - reportbuilder/java/org/libreoffice/report/pentaho/StarFunctionDescription.java |2 - reportdesign/source/ui/misc/FunctionHelper.cxx | 14 +++--- 3 files changed, 12 insertions(+), 6 deletions(-) New commits: commit 91287c7456b1bc7060a0f1f08902960eb7a868dc Author: Eike Rathke Date: Wed Jul 5 13:44:08 2017 +0200 Enable the Formula Wizard to display 255 argument fields Previously it was, for example for SUM, 1 2 3 ... 28 29 30,31,32,33,...,253,254,255 ie. for more than 30 parameters the exceeding ones were crammed into the last (30th) edit field. The expression still worked, but this was ugly, and selecting the last field it was easy to overwrite all remaining arguments at once. Change-Id: I6b27a20e7f07d3a6b4752855f04d6239e6375418 diff --git a/include/formula/funcvarargs.h b/include/formula/funcvarargs.h index 1be68692fe41..ed529ee98680 100644 --- a/include/formula/funcvarargs.h +++ b/include/formula/funcvarargs.h @@ -32,7 +32,7 @@ functionDescription.isInfiniteParameterCount() which though looks like it could be easily adapted. */ -#define VAR_ARGS30 +#define VAR_ARGS255 /** Used to indicate a variable number of paired parameters for the Function Wizard. diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/StarFunctionDescription.java b/reportbuilder/java/org/libreoffice/report/pentaho/StarFunctionDescription.java index 96c4346e9989..2eddaf307ae9 100644 --- a/reportbuilder/java/org/libreoffice/report/pentaho/StarFunctionDescription.java +++ b/reportbuilder/java/org/libreoffice/report/pentaho/StarFunctionDescription.java @@ -153,7 +153,7 @@ public final class StarFunctionDescription extends WeakBase if (infinite) { // Identical value as VAR_ARGS from formula/funcvarargs.h -count = 30; +count = 255; } final FunctionArgument[] args = new FunctionArgument[count]; for (int i = 0; i < args.length; i++) diff --git a/reportdesign/source/ui/misc/FunctionHelper.cxx b/reportdesign/source/ui/misc/FunctionHelper.cxx index 9c9c7450f03e..b001bf39440d 100644 --- a/reportdesign/source/ui/misc/FunctionHelper.cxx +++ b/reportdesign/source/ui/misc/FunctionHelper.cxx @@ -212,16 +212,22 @@ sal_uInt32 FunctionDescription::getVarArgsStart() const // Don't use defines/constants that could change in future, parameter count // could be part of an implicit stable API. // offapi/com/sun/star/report/meta/XFunctionDescription.idl doesn't tell. -const sal_uInt32 nVarArgs30 = 30; // ugly hard coded VAR_ARGS of formula::ParaWin -const sal_uInt32 nPairedVarArgs60 = 60; // ugly hard coded PAIRED_VAR_ARGS of formula::ParaWin +const sal_uInt32 nVarArgs30 = 30; // ugly hard coded old VAR_ARGS of formula::ParaWin +const sal_uInt32 nPairedVarArgs60 = 60; // ugly hard coded old PAIRED_VAR_ARGS of formula::ParaWin +const sal_uInt32 nVarArgs255 = 255; // ugly hard coded new VAR_ARGS of formula::ParaWin +const sal_uInt32 nPairedVarArgs510 = 510; // ugly hard coded new PAIRED_VAR_ARGS of formula::ParaWin sal_uInt32 nLen = m_aParameter.getLength(); // If the value of VAR_ARGS changes then adapt *and* maintain implicit API // stability, ie. old code using the old VAR_ARGS and PAIRED_VAR_ARGS // values must still be handled. It is *not* sufficient to simply change // the values here. -static_assert(nVarArgs30 == VAR_ARGS && nPairedVarArgs60 == PAIRED_VAR_ARGS, +static_assert(nVarArgs255 == VAR_ARGS && nPairedVarArgs510 == PAIRED_VAR_ARGS, "VAR_ARGS or PAIRED_VAR_ARGS has unexpected value"); -if (nLen >= nPairedVarArgs60) +if (nLen >= nPairedVarArgs510) +nLen -= nPairedVarArgs510; +else if (nLen >= nVarArgs255) +nLen -= nVarArgs255; +else if (nLen >= nPairedVarArgs60) nLen -= nPairedVarArgs60; else if (nLen >= nVarArgs30) nLen -= nVarArgs30; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula reportbuilder/java reportdesign/source
include/formula/funcvarargs.h |3 + reportbuilder/java/org/libreoffice/report/pentaho/StarFunctionDescription.java |1 reportdesign/source/ui/misc/FunctionHelper.cxx | 18 ++ 3 files changed, 16 insertions(+), 6 deletions(-) New commits: commit 3054a8c1c148aee9cb3feaa4e7b5edee010deead Author: Eike Rathke Date: Tue Jul 4 14:04:26 2017 +0200 Prepare for change of VAR_ARGS value Change-Id: I0b1955bb660b5e19587799de657c63634705b99c diff --git a/include/formula/funcvarargs.h b/include/formula/funcvarargs.h index c0836a55a1e4..1be68692fe41 100644 --- a/include/formula/funcvarargs.h +++ b/include/formula/funcvarargs.h @@ -22,6 +22,9 @@ reportdesign/source/ui/misc/FunctionHelper.cxx FunctionDescription::getVarArgsStart() has to provide some backward compatibility for implicit API stability. +The new VAR_ARGS value must be significantly greater than the old +PAIRED_VAR_ARGS (2*VAR_ARGS) value, in fact greater than any used number of +fixed parameters followed by optional paired parameters. @NOTE: also reportbuilder/java/org/libreoffice/report/pentaho/StarFunctionDescription.java diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/StarFunctionDescription.java b/reportbuilder/java/org/libreoffice/report/pentaho/StarFunctionDescription.java index b743ae08e4a1..96c4346e9989 100644 --- a/reportbuilder/java/org/libreoffice/report/pentaho/StarFunctionDescription.java +++ b/reportbuilder/java/org/libreoffice/report/pentaho/StarFunctionDescription.java @@ -152,6 +152,7 @@ public final class StarFunctionDescription extends WeakBase final boolean infinite = functionDescription.isInfiniteParameterCount(); if (infinite) { +// Identical value as VAR_ARGS from formula/funcvarargs.h count = 30; } final FunctionArgument[] args = new FunctionArgument[count]; diff --git a/reportdesign/source/ui/misc/FunctionHelper.cxx b/reportdesign/source/ui/misc/FunctionHelper.cxx index 584a0288e4aa..349bc8d48061 100644 --- a/reportdesign/source/ui/misc/FunctionHelper.cxx +++ b/reportdesign/source/ui/misc/FunctionHelper.cxx @@ -20,6 +20,7 @@ #include "FunctionHelper.hxx" #include +#include namespace rptui @@ -211,13 +212,18 @@ sal_uInt32 FunctionDescription::getVarArgsStart() const // Don't use defines/constants that could change in future, parameter count // could be part of an implicit stable API. // offapi/com/sun/star/report/meta/XFunctionDescription.idl doesn't tell. -const sal_uInt32 nVarArgs = 30; // ugly hard coded VAR_ARGS of formula::ParaWin -const sal_uInt32 nPairedVarArgs = 60; // ugly hard coded PAIRED_VAR_ARGS of formula::ParaWin +const sal_uInt32 nVarArgs30 = 30; // ugly hard coded VAR_ARGS of formula::ParaWin +const sal_uInt32 nPairedVarArgs60 = 60; // ugly hard coded PAIRED_VAR_ARGS of formula::ParaWin sal_uInt32 nLen = m_aParameter.getLength(); -if (nLen >= nPairedVarArgs) -nLen -= nPairedVarArgs; -else if (nLen >= nVarArgs) -nLen -= nVarArgs; +// If the value of VAR_ARGS changes then adapt *and* maintain implicit API +// stability, ie. old code using the old VAR_ARGS and PAIRED_VAR_ARGS +// values must still be handled. It is *not* sufficient to simply change +// the values here. +static_assert(nVarArgs30 == VAR_ARGS && nPairedVarArgs60 == PAIRED_VAR_ARGS); +if (nLen >= nPairedVarArgs60) +nLen -= nPairedVarArgs60; +else if (nLen >= nVarArgs30) +nLen -= nVarArgs30; return nLen ? nLen - 1 : 0; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula sc/source
include/formula/tokenarray.hxx | 106 + sc/source/core/data/colorscale.cxx |4 - sc/source/core/data/conditio.cxx |4 - sc/source/core/tool/compiler.cxx | 15 + 4 files changed, 112 insertions(+), 17 deletions(-) New commits: commit 4e27d3cf6bcb278f26878ef7070723dd8a799a03 Author: Tor Lillqvist Date: Mon Jun 19 19:56:48 2017 +0300 Introduce a range-based iterator for 'references' in a FormulaTokenArray Take it into use in a couple of places. Change-Id: I72127f4236220fbe6fbf9ea25cdd56470be89961 Reviewed-on: https://gerrit.libreoffice.org/38997 Reviewed-by: Eike Rathke Tested-by: Tor Lillqvist diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx index eb04f041abd8..eed55d089921 100644 --- a/include/formula/tokenarray.hxx +++ b/include/formula/tokenarray.hxx @@ -136,6 +136,97 @@ public: } }; +class FORMULA_DLLPUBLIC FormulaTokenArrayReferencesIterator +{ +private: +FormulaToken** maIter; +FormulaToken** maEnd; + +void nextReference() +{ +while (maIter != maEnd) +{ +switch ((*maIter)->GetType()) +{ +case svSingleRef: +case svDoubleRef: +case svExternalSingleRef: +case svExternalDoubleRef: +return; +default: +++maIter; +} +} +} + +enum class Dummy { Flag }; + +FormulaTokenArrayReferencesIterator(const FormulaTokenArrayStandardRange& rRange, Dummy) : +maIter(rRange.end()), +maEnd(rRange.end()) +{ +} + +public: +FormulaTokenArrayReferencesIterator(const FormulaTokenArrayStandardRange& rRange) : +maIter(rRange.begin()), +maEnd(rRange.end()) +{ +nextReference(); +} + +FormulaTokenArrayReferencesIterator operator++(int) +{ +FormulaTokenArrayReferencesIterator result(*this); +operator++(); +return result; +} + +FormulaTokenArrayReferencesIterator operator++() +{ +assert(maIter != maEnd); +++maIter; +nextReference(); +return *this; +} + +FormulaToken* operator*() const +{ +return *maIter; +} + +bool operator==(const FormulaTokenArrayReferencesIterator& rhs) const +{ +return maIter == rhs.maIter; +} + +bool operator!=(const FormulaTokenArrayReferencesIterator& rhs) const +{ +return !operator==(rhs); +} + +static FormulaTokenArrayReferencesIterator endOf(const FormulaTokenArrayStandardRange& rRange) +{ +return FormulaTokenArrayReferencesIterator(rRange, Dummy::Flag); +} +}; + +class FORMULA_DLLPUBLIC FormulaTokenArrayReferencesRange +{ +private: +const FormulaTokenArray& mrFTA; + +public: +FormulaTokenArrayReferencesRange(const FormulaTokenArray& rFTA) : +mrFTA(rFTA) +{ +} + +FormulaTokenArrayReferencesIterator begin(); + +FormulaTokenArrayReferencesIterator end(); +}; + class FORMULA_DLLPUBLIC FormulaTokenArray { protected: @@ -284,6 +375,11 @@ public: return FormulaTokenArrayStandardRange(pRPN, nRPN); } +FormulaTokenArrayReferencesRange References() const +{ +return FormulaTokenArrayReferencesRange(*this); +} + sal_uInt16 GetLen() const { return nLen; } sal_uInt16 GetCodeLen() const { return nRPN; } FormulaError GetCodeError() const { return nError; } @@ -401,6 +497,16 @@ inline OpCode FormulaTokenArray::GetOuterFuncOpCode() return ocNone; } +inline FormulaTokenArrayReferencesIterator FormulaTokenArrayReferencesRange::begin() +{ +return FormulaTokenArrayReferencesIterator(mrFTA.Tokens()); +} + +inline FormulaTokenArrayReferencesIterator FormulaTokenArrayReferencesRange::end() +{ +return FormulaTokenArrayReferencesIterator::endOf(mrFTA.Tokens()); +} + class FORMULA_DLLPUBLIC FormulaTokenIterator { struct Item diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx index 2a7b213de2a3..d14b0622be54 100644 --- a/sc/source/core/data/colorscale.cxx +++ b/sc/source/core/data/colorscale.cxx @@ -41,9 +41,7 @@ void ScFormulaListener::startListening(ScTokenArray* pArr, const ScRange& rRange if (!pArr || mpDoc->IsClipOrUndo()) return; -formula::FormulaToken* t; -formula::FormulaTokenArrayPlainIterator aIter( *pArr ); -while ( ( t = aIter.GetNextReference() ) != nullptr ) +for ( auto t: pArr->References() ) { switch (t->GetType()) { diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index 6ca66da581cb..eab769e70b0d 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -1418,9 +1418,7 @@ ScAddress ScConditionEntry::GetValidSrcPos() const ScTokenArray* pFormula = nPass ? pFormula2 : pFormula1; if (pFormula)
[Libreoffice-commits] core.git: include/formula
include/formula/tokenarray.hxx | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) New commits: commit a8a9d0add52376da9fe5b2ffeb04d4df0e97e69a Author: Tor Lillqvist Date: Mon Jun 19 14:09:45 2017 +0300 s/FormulaTokenArrayStandardIterator/FormulaTokenArrayStandardRange Because that class isn't an iterator, but a class that produces iterators (with its begin() and end() member functions). Change-Id: I13125ced5e82406d049a61078e31690312a82620 diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx index 7252613cf713..eb04f041abd8 100644 --- a/include/formula/tokenarray.hxx +++ b/include/formula/tokenarray.hxx @@ -112,14 +112,14 @@ public: typedef std::unordered_set::type> > unordered_opcode_set; -class FORMULA_DLLPUBLIC FormulaTokenArrayStandardIterator +class FORMULA_DLLPUBLIC FormulaTokenArrayStandardRange { private: FormulaToken** mpBegin; FormulaToken** mpEnd; public: -FormulaTokenArrayStandardIterator(FormulaToken** pBegin, sal_uInt16 nSize) : +FormulaTokenArrayStandardRange(FormulaToken** pBegin, sal_uInt16 nSize) : mpBegin(pBegin), mpEnd(pBegin + nSize) { @@ -272,16 +272,16 @@ public: FormulaToken** GetArray() const { return pCode; } -FormulaTokenArrayStandardIterator Tokens() const +FormulaTokenArrayStandardRange Tokens() const { -return FormulaTokenArrayStandardIterator(pCode, nLen); +return FormulaTokenArrayStandardRange(pCode, nLen); } FormulaToken** GetCode() const { return pRPN; } -FormulaTokenArrayStandardIterator RPNTokens() const +FormulaTokenArrayStandardRange RPNTokens() const { -return FormulaTokenArrayStandardIterator(pRPN, nRPN); +return FormulaTokenArrayStandardRange(pRPN, nRPN); } sal_uInt16 GetLen() const { return nLen; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula
include/formula/tokenarray.hxx |1 - 1 file changed, 1 deletion(-) New commits: commit 60763a9551bea003271de9307923327e7a39b63e Author: Tor Lillqvist Date: Tue Jun 13 21:40:59 2017 +0300 FormulaTokenArray::FirstRPN() can go away now Change-Id: Ic9570421f176c8bc078c1d33697a5f379e05111b diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx index 109146c56b87..0fbfd30e0b27 100644 --- a/include/formula/tokenarray.hxx +++ b/include/formula/tokenarray.hxx @@ -219,7 +219,6 @@ public: FormulaToken* PeekNext(); FormulaToken* PeekPrevNoSpaces();/// Only after Reset/First/Next/Last/Prev! FormulaToken* PeekNextNoSpaces();/// Only after Reset/First/Next/Last/Prev! -FormulaToken* FirstRPN() { nIndex = 0; return NextRPN(); } FormulaToken* FirstRPNToken() const; FormulaToken* NextRPN(); FormulaToken* LastRPN() { nIndex = nRPN; return PrevRPN(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula sc/source
include/formula/paramclass.hxx | 61 +++ sc/source/core/inc/parclass.hxx | 48 +++--- sc/source/core/tool/compiler.cxx |6 +-- sc/source/core/tool/interpr4.cxx | 25 +++ sc/source/core/tool/parclass.cxx | 15 + 5 files changed, 88 insertions(+), 67 deletions(-) New commits: commit 8ba4679c96e08eebf58347edfba33bb9610701b5 Author: Eike Rathke Date: Tue May 9 19:53:09 2017 +0200 Move ScParameterClassification::Type to formula::ParamClass, tdf#107724 prep To be able to later differentiate specific types in the compiler. Change-Id: If97485c0cb8e8e2e129c61cd3f01d9d420c92c8d Reviewed-on: https://gerrit.libreoffice.org/37439 Reviewed-by: Eike Rathke Tested-by: Eike Rathke diff --git a/include/formula/paramclass.hxx b/include/formula/paramclass.hxx new file mode 100644 index ..e8d411088061 --- /dev/null +++ b/include/formula/paramclass.hxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_FORMULA_PARAMCLASS_HXX +#define INCLUDED_FORMULA_PARAMCLASS_HXX + +#include +#include + +namespace formula +{ +enum ParamClass : sal_uInt8 +{ +Unknown = 0,// MUST be zero for initialization mechanism! + +/** Out of bounds, function doesn't expect that many parameters. +However, not necessarily returned if a module specific definition +for example returns type Value for an unlisted function. */ +Bounds, + +/** In array formula: single value to be passed. Results in JumpMatrix +being created and multiple calls to function. Functions handling a +formula::svDoubleRef by means of DoubleRefToPosSingleRef() or +PopDoubleRefOrSingleRef() or GetDouble() or GetString() should have +this. */ +Value, + +/** In array formula: area reference must stay reference. Otherwise +don't care. Functions handling a formula::svDoubleRef by means of +PopDoubleRefOrSingleRef() should not have this. */ +Reference, + +/** In array formula: convert area reference to array. Function will be +called only once if no Value type is involved. Functions able to +handle a svMatrix parameter but not a formula::svDoubleRef parameter as area +should have this. */ +Array, + +/** Area reference must be converted to array in any case, and must +also be propagated to subsequent operators and functions being part +of a parameter of this function. */ +ForceArray, + +/** Area reference is not converted to array, but ForceArray must be +propagated to subsequent operators and functions being part of a +parameter of this function. Used with functions that treat +references separately from arrays, but need the forced array +calculation of parameters that are not references.*/ +ReferenceOrForceArray +}; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sc/source/core/inc/parclass.hxx b/sc/source/core/inc/parclass.hxx index 004c82c253c4..9c7f34224b7f 100644 --- a/sc/source/core/inc/parclass.hxx +++ b/sc/source/core/inc/parclass.hxx @@ -21,6 +21,7 @@ #define INCLUDED_SC_SOURCE_CORE_INC_PARCLASS_HXX #include +#include #include #define DEBUG_SC_PARCLASSDOC 0 @@ -34,45 +35,6 @@ class ScParameterClassification { public: -enum Type -{ -Unknown = 0,// MUST be zero for initialization mechanism! - -/** Out of bounds, function doesn't expect that many parameters. -However, not necessarily returned. */ -Bounds, - -/** In array formula: single value to be passed. Results in JumpMatrix -being created and multiple calls to function. Functions handling a -formula::svDoubleRef by means of DoubleRefToPosSingleRef() or -PopDoubleRefOrSingleRef() or GetDouble() or GetString() should have -this. */ -Value, - -/** In array formula: area reference must stay reference. Otherwise -don't care. Functions handling a formula::svDoubleRef by means of -PopDoubleRefOrSingleRef() should not have this. */ -Reference, - -/** In array formula: convert area reference to array. Function will be -called only once if no Value type is involved. Functions able to -handle a svMatrix parameter but not a formula::svDoubleRef parameter as area -
[Libreoffice-commits] core.git: include/formula
include/formula/token.hxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 0b1b361090cac1838f3a33e554fd44f0b3a9590a Author: Tor Lillqvist Date: Fri Mar 31 17:01:43 2017 +0300 There doesn't seem to be any reason for the svMissing = 0x70 Change-Id: I9b416b28bb87599d222e60f59589cb0ec639166a Reviewed-on: https://gerrit.libreoffice.org/35979 Tested-by: Jenkins Reviewed-by: Tor Lillqvist Reviewed-by: Jochen Nitschke diff --git a/include/formula/token.hxx b/include/formula/token.hxx index d6a50904214b..2de988e551b6 100644 --- a/include/formula/token.hxx +++ b/include/formula/token.hxx @@ -75,7 +75,7 @@ enum StackVarEnum svSingleVectorRef, svDoubleVectorRef, svError,// error token -svMissing = 0x70, // 0 or "" +svMissing, // 0 or "" svSep, // separator, ocSep, ocOpen, ocClose svUnknown // unknown StackType }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula
include/formula/token.hxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 1646e0164a36ecc130e6930174ed325e0a1145fa Author: Tor Lillqvist Date: Wed Mar 29 11:14:40 2017 +0300 Add warning about intended use case of debug helper Change-Id: I685509a92653112f2bbbfc970db3706b5a9bf994 diff --git a/include/formula/token.hxx b/include/formula/token.hxx index 7856d787d660..d6a50904214b 100644 --- a/include/formula/token.hxx +++ b/include/formula/token.hxx @@ -88,6 +88,8 @@ typedef sal_uInt8 StackVar; typedef StackVarEnum StackVar; #endif +// Only to be used for debugging output. No guarantee of stability of the +// return value. inline std::string StackVarEnumToString(StackVar const e) { switch (e) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula
include/formula/token.hxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit c5c82c81ec184999feb982140547bd1351150655 Author: Tor Lillqvist Date: Mon Mar 27 21:32:25 2017 +0300 No std::to_string in the silly C++ library we still use on Android Change-Id: I03a3bd999e4f423f6b5422417109e789dc5b5397 diff --git a/include/formula/token.hxx b/include/formula/token.hxx index 8747517ac481..7856d787d660 100644 --- a/include/formula/token.hxx +++ b/include/formula/token.hxx @@ -117,7 +117,9 @@ inline std::string StackVarEnumToString(StackVar const e) case svSep: return "Sep"; case svUnknown: return "Unknown"; } -return std::to_string(static_cast(e)); +std::ostringstream os; +os << static_cast(e); +return os.str(); } class FORMULA_DLLPUBLIC FormulaToken : public IFormulaToken ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula
include/formula/token.hxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit fc6d65e75e742a483b14d1a6c1c9b65d48683aad Author: Tor Lillqvist Date: Tue Mar 21 15:56:33 2017 +0200 Bin noise comment Change-Id: I7367d494143901c9b78349682f07cc292d1d64ea diff --git a/include/formula/token.hxx b/include/formula/token.hxx index e6e5bc459b51..7b6e1a77a6b8 100644 --- a/include/formula/token.hxx +++ b/include/formula/token.hxx @@ -56,7 +56,7 @@ enum StackVarEnum svJump, svExternal, // Byte + String svFAP, // FormulaAutoPilot only, ever exported -svJumpMatrix, // 2003-07-02 +svJumpMatrix, svRefList, // ocUnion result svEmptyCell,// Result is an empty cell, e.g. in LOOKUP() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula sc/inc sc/source
include/formula/token.hxx|3 --- sc/inc/formulacell.hxx |1 - sc/source/core/data/formulacell.cxx |9 ++--- sc/source/core/opencl/formulagroupcl.cxx |1 - sc/source/core/tool/cellform.cxx |2 -- sc/source/core/tool/formularesult.cxx|6 +- sc/source/core/tool/token.cxx|1 - 7 files changed, 3 insertions(+), 20 deletions(-) New commits: commit 2a91304bddf3b1a7b788b120e6374cc1fb9ea045 Author: Eike Rathke Date: Wed Nov 16 19:24:01 2016 +0100 remove anything svHybridValueCell related, it's nowhere set anymore Change-Id: I9887d7ca83ffc012fec1a78ef9ef537d2188a7e3 diff --git a/include/formula/token.hxx b/include/formula/token.hxx index 767fa21..a2376bc 100644 --- a/include/formula/token.hxx +++ b/include/formula/token.hxx @@ -69,9 +69,6 @@ enum StackVarEnum // and/or string result and a formula // string to be compiled. -svHybridValueCell, // A temporary formula cell with an value -// and possibily a string representation - svExternalSingleRef, svExternalDoubleRef, svExternalName, diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx index d17e1e0..960a753 100644 --- a/sc/inc/formulacell.hxx +++ b/sc/inc/formulacell.hxx @@ -289,7 +289,6 @@ public: boolIsValue(); // also true if formula::svEmptyCell boolIsValueNoError(); boolIsValueNoError() const; -boolIsHybridValueCell(); // for cells after import to deal with inherited number formats double GetValue(); svl::SharedString GetString(); const ScMatrix* GetMatrix(); diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index 1c95096..f59ad09 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -2024,7 +2024,7 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam ) } else { -if ( eOld == svHybridCell || eOld == svHybridValueCell ) // string result from SetFormulaResultString? +if ( eOld == svHybridCell ) // string result from SetFormulaResultString? eOld = svString;// ScHybridCellToken has a valid GetString method // #i106045# use approxEqual to compare with stored value @@ -2049,7 +2049,7 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam ) if ( bChanged && !bContentChanged && pDocument->IsStreamValid(aPos.Tab()) ) { if ((eOld == svUnknown && (eNew == svError || (eNew == svDouble && aNewResult.GetDouble() == 0.0))) || -((eOld == svHybridCell || eOld == svHybridValueCell) && +((eOld == svHybridCell) && eNew == svString && aResult.GetString() == aNewResult.GetString()) || (eOld == svDouble && eNew == svDouble && rtl::math::approxEqual( aResult.GetDouble(), aNewResult.GetDouble( @@ -2598,11 +2598,6 @@ bool ScFormulaCell::IsValueNoError() const return aResult.IsValueNoError(); } -bool ScFormulaCell::IsHybridValueCell() -{ -return aResult.GetType() == formula::svHybridValueCell; -} - double ScFormulaCell::GetValue() { MaybeInterpret(); diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index 7701c2c..54ae0d1 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -116,7 +116,6 @@ std::string StackVarEnumToString(StackVar const e) case svEmptyCell: return "EmptyCell"; case svMatrixCell:return "MatrixCell"; case svHybridCell:return "HybridCell"; -case svHybridValueCell: return "HybridValueCell"; case svExternalSingleRef: return "ExternalSingleRef"; case svExternalDoubleRef: return "ExternalDoubleRef"; case svExternalName: return "ExternalName"; diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx index afa9eea..dab0d2d 100644 --- a/sc/source/core/tool/cellform.cxx +++ b/sc/source/core/tool/cellform.cxx @@ -90,8 +90,6 @@ void ScCellFormat::GetString( ScRefCellValue& rCell, sal_uLong nFormat, OUString double fValue = pFCell->GetValue(); if ( !bNullVals && fValue == 0.0 ) rString.clear(); -else if ( pFCell->IsHybridValueCell() ) -rString = pFCell->GetString().getString(); else rFormatter.GetOutputString( fValue, nFormat, rString, ppColo
[Libreoffice-commits] core.git: include/formula
include/formula/errorcodes.hxx |9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) New commits: commit 4ef10fce39575ec0bd3793b5fdf731c0b9af25a3 Author: Eike Rathke Date: Tue Sep 13 15:26:09 2016 +0200 recognize NaN with no bits set in lower word as error Which can happen for example for -nan(0x8) as a result of calculating with -inf. This was displayed as NaN instead of a proper error value, now #NUM! Example test case: =FORECAST.ETS.ADD(50, {-1,-2,-3,-4}, {10,20,30,40}) Change-Id: I1e1d95e1f188e0036b72be37dd20039c9a9a13f6 diff --git a/include/formula/errorcodes.hxx b/include/formula/errorcodes.hxx index 1157415..e4732b3 100644 --- a/include/formula/errorcodes.hxx +++ b/include/formula/errorcodes.hxx @@ -105,11 +105,14 @@ inline sal_uInt16 GetDoubleErrorValue( double fVal ) return 0; if ( ::rtl::math::isInf( fVal ) ) return errIllegalFPOperation; // normal INF -sal_uInt32 nErr = reinterpret_cast< sal_math_Double * >( -&fVal)->nan_parts.fraction_lo; +sal_uInt32 nErr = reinterpret_cast< sal_math_Double * >( &fVal)->nan_parts.fraction_lo; if ( nErr & 0x ) return errNoValue; // just a normal NAN -return (sal_uInt16)(nErr & 0x); // any other error +if (!nErr) +// Another NAN, e.g. -nan(0x8) from calculating with -inf +return errIllegalFPOperation; +// Any other error known to us as error code. +return (sal_uInt16)(nErr & 0x); } } // namespace formula ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula sc/inc sc/qa sc/source
include/formula/errorcodes.hxx|8 -- sc/inc/math.hxx |2 sc/inc/scmatrix.hxx |2 sc/qa/unit/subsequent_filters-test.cxx|2 sc/qa/unit/ucalc_formula.cxx |8 +- sc/source/core/data/column2.cxx |8 +- sc/source/core/data/dbdocutl.cxx |2 sc/source/core/data/dpoutput.cxx |2 sc/source/core/data/global.cxx| 84 +++--- sc/source/core/data/global2.cxx |2 sc/source/core/data/simpleformulacalc.cxx |4 - sc/source/core/data/table4.cxx|8 +- sc/source/core/inc/interpre.hxx |6 +- sc/source/core/tool/addincol.cxx | 18 +++--- sc/source/core/tool/consoli.cxx |2 sc/source/core/tool/interpr7.cxx | 22 +++ sc/source/core/tool/jumpmatrix.cxx| 14 ++--- sc/source/core/tool/scmatrix.cxx | 50 - sc/source/filter/excel/excform.cxx| 36 ++-- sc/source/filter/excel/xltools.cxx| 50 - sc/source/ui/app/scmod.cxx|2 sc/source/ui/unoobj/cellsuno.cxx |2 sc/source/ui/unoobj/funcuno.cxx |4 - 23 files changed, 166 insertions(+), 172 deletions(-) New commits: commit fa507ae23e1e5e0dd73fe881284bfb41a2eb1315 Author: Kohei Yoshida Date: Tue May 3 21:22:28 2016 -0400 Replace namespace ScErrorCodes with formula... and remove that 'using namespace' statement in the header... Change-Id: I2f994af5088ce6d1ffe92c8d36285a4f6fdd2248 Reviewed-on: https://gerrit.libreoffice.org/24628 Tested-by: Jenkins Reviewed-by: Kohei Yoshida diff --git a/include/formula/errorcodes.hxx b/include/formula/errorcodes.hxx index 6c20d8a..13597b9 100644 --- a/include/formula/errorcodes.hxx +++ b/include/formula/errorcodes.hxx @@ -22,8 +22,7 @@ #include -namespace ScErrorCodes -{ +namespace formula { const sal_uInt16 errIllegalChar = 501; const sal_uInt16 errIllegalArgument = 502; @@ -111,10 +110,7 @@ inline sal_uInt16 GetDoubleErrorValue( double fVal ) return (sal_uInt16)(nErr & 0x); // any other error } -} // namespace ScErrorCodes - -// yes, exceptionally we put a "using namespace" in a header file.. -using namespace ScErrorCodes; +} // namespace formula #endif // INCLUDED_FORMULA_ERRORCODES_HXX diff --git a/sc/inc/math.hxx b/sc/inc/math.hxx index 13355a9..ecea704 100644 --- a/sc/inc/math.hxx +++ b/sc/inc/math.hxx @@ -30,7 +30,7 @@ namespace sc { inline double div( const double& fNumerator, const double& fDenominator ) { return (fDenominator != 0.0) ? (fNumerator / fDenominator) : -CreateDoubleError( errDivisionByZero); +formula::CreateDoubleError( formula::errDivisionByZero); } /** Return fNumerator/fDenominator if fDenominator!=0 else +-Infinity if diff --git a/sc/inc/scmatrix.hxx b/sc/inc/scmatrix.hxx index 3e41d5d..aacb9ce 100644 --- a/sc/inc/scmatrix.hxx +++ b/sc/inc/scmatrix.hxx @@ -64,7 +64,7 @@ struct ScMatrixValue const svl::SharedString& GetString() const { return aStr; } /// Only valid if ScMatrix methods indicate that this is no string! -sal_uInt16 GetError() const { return GetDoubleErrorValue( fVal); } +sal_uInt16 GetError() const { return formula::GetDoubleErrorValue( fVal); } /// Only valid if ScMatrix methods indicate that this is a boolean bool GetBoolean() const { return fVal != 0.0; } diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 847acc1..0c1428e 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -3164,7 +3164,7 @@ void ScFiltersTest::testErrorOnExternalReferences() ScFormulaCell* pFC = rDoc.GetFormulaCell(ScAddress(0,0,0)); CPPUNIT_ASSERT(pFC); -CPPUNIT_ASSERT_EQUAL(ScErrorCodes::errNoName, pFC->GetErrCode()); +CPPUNIT_ASSERT_EQUAL(formula::errNoName, pFC->GetErrCode()); if (!checkFormula(rDoc, ScAddress(0,0,0), "'file:///Path/To/FileA.ods'#$Sheet1.A1A")) CPPUNIT_FAIL("Formula changed"); diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index 54f1318..ffce49a 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -1141,11 +1141,11 @@ void Test::testFormulaRefUpdate() aPos = ScAddress(2,1,0); ScFormulaCell* pFC = m_pDoc->GetFormulaCell(aPos); CPPUNIT_ASSERT_MESSAGE("This should be a formula cell.", pFC); -CPPUNIT_ASSERT_EQUAL(ScErrorCodes::errNoRef, pFC->GetErrCode()); +CPPUNIT_ASSERT_EQUAL(formula::errNoRef, pFC->GetErrCode()); aPos = ScAddress(2,2,0); pFC = m_pDoc->GetFormulaCell(aPos); CPPUNIT_ASSERT_MESSAGE("This should be a formula cell.", pFC); -CPPUNIT_ASSERT_EQUAL(ScErrorCodes::errNoRef, pFC->GetErrCode()); +CPPUNIT_ASSERT_EQUAL(formula::errNoRef, pFC->
[Libreoffice-commits] core.git: include/formula sc/source
include/formula/errorcodes.hxx |3 +++ sc/source/core/data/formulacell.cxx | 14 +- sc/source/core/tool/interpr5.cxx| 10 ++ 3 files changed, 26 insertions(+), 1 deletion(-) New commits: commit ac00b3c256933e667f022a49854a05e40e3d0630 Author: Eike Rathke Date: Tue Jan 19 00:18:21 2016 +0100 tdf#88737 handle temporary array formula matrix circular reference This does not solve the difference in how Excel seems to handle the arguments and calculation, but some corner case. See bug comment 6. Change-Id: Ifa331e8552587c40e1486a08093ed0df92a9d245 diff --git a/include/formula/errorcodes.hxx b/include/formula/errorcodes.hxx index 0f5fdad..e2279f3 100644 --- a/include/formula/errorcodes.hxx +++ b/include/formula/errorcodes.hxx @@ -78,6 +78,9 @@ const sal_uInt16 errJumpMatHasResult = 535; // string or empty, to be distinguished from the general errNoValue NAN and not // to be used as result. const sal_uInt16 errElementNaN = 536; +// ScInterpreter/ScFormulaCell internal: keep dirty, retry interpreting next +// round. +const sal_uInt16 errRetryCircular= 537; // Interpreter: NA() not available condition, not a real error const sal_uInt16 NOTAVAILABLE= 0x7fff; diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index c954b97..b311d7c 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -1868,9 +1868,21 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam ) if( p->GetError() && p->GetError() != errCircularReference) { -ResetDirty(); bChanged = true; + +if (p->GetError() == errRetryCircular) +{ +// Array formula matrix calculation corner case. Keep dirty +// state, do not remove from formula tree or anything else, but +// store errCircularReference in case this cell does not get +// recalculated. +aResult.SetResultError( errCircularReference); +return; +} + +ResetDirty(); } + if (eTailParam == SCITP_FROM_ITERATION && IsDirtyOrInTableOpDirty()) { bool bIsValue = aResult.IsValue(); // the previous type diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx index 12cc662..a32f2de 100644 --- a/sc/source/core/tool/interpr5.cxx +++ b/sc/source/core/tool/interpr5.cxx @@ -3178,6 +3178,16 @@ void ScInterpreter::ScMatRef() return; } +if (aCell.mpFormula->IsRunning()) +{ +// Twisted odd corner case where an array element's cell tries to +// access the top left matrix while it is still running, see tdf#88737 +// This is a hackish workaround, not a general solution, the matrix +// isn't available anyway and errCircularReference would be set. +PushError( errRetryCircular ); +return; +} + const ScMatrix* pMat = aCell.mpFormula->GetMatrix(); if (pMat) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula
include/formula/errorcodes.hxx | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) New commits: commit 79b46d5fad29b8618fed539d04611bfb4f225c5f Author: Eike Rathke Date: Mon Jan 18 12:32:41 2016 +0100 sal_math_Double is already a union containing a double member Change-Id: I6e753bc0c5967ed07f162b0baa2daca4499953be diff --git a/include/formula/errorcodes.hxx b/include/formula/errorcodes.hxx index a92372c..0f5fdad 100644 --- a/include/formula/errorcodes.hxx +++ b/include/formula/errorcodes.hxx @@ -87,14 +87,10 @@ const sal_uInt16 NOTAVAILABLE= 0x7fff; represent an interpreter error code. */ inline double CreateDoubleError( sal_uInt16 nErr ) { -union -{ -double fVal; -sal_math_Double smVal; -}; -::rtl::math::setNan( &fVal ); +sal_math_Double smVal; +::rtl::math::setNan( &smVal.value ); smVal.nan_parts.fraction_lo = nErr; -return fVal; +return smVal.value; } /** Recreate the error code of a coded double error, if any. */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula
include/formula/funcutl.hxx |1 + 1 file changed, 1 insertion(+) New commits: commit 6b203d5050b5ca2aa556246e104eae0e7209e67f Author: Michael Stahl Date: Thu Nov 26 15:23:16 2015 +0100 formula: fix build, undef Idle Change-Id: If256bba5d8207a955c06713db7141831b53324c7 diff --git a/include/formula/funcutl.hxx b/include/formula/funcutl.hxx index f0ea363..e6d03be 100644 --- a/include/formula/funcutl.hxx +++ b/include/formula/funcutl.hxx @@ -23,6 +23,7 @@ #include #include #include +#include #include namespace formula { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula sc/source sc/uiconfig
include/formula/grammar.hxx |6 +- sc/source/core/tool/interpr1.cxx | 14 +++--- sc/source/ui/optdlg/calcoptionsdlg.cxx|4 sc/source/ui/unoobj/confuno.cxx |2 ++ sc/uiconfig/scalc/ui/formulacalculationoptions.ui |1 + 5 files changed, 23 insertions(+), 4 deletions(-) New commits: commit abe178814489286aa45dc0799df50e650a78bc9d Author: Katarina Behrens Date: Mon Jul 20 22:07:53 2015 +0200 tdf#92256: Introducing CONV_A1_XL_A1 address pseudoconvention a special case for INDIRECT function interpretation. Does what OOo used to do, interprets formula using CONV_OOO first, failing that, tries CONV_XL_A1 Change-Id: I4281ab2bb7164607206c0b8e51f7e63a1fc2db9a Reviewed-on: https://gerrit.libreoffice.org/17255 Reviewed-by: Eike Rathke Tested-by: Eike Rathke diff --git a/include/formula/grammar.hxx b/include/formula/grammar.hxx index 4f6a2bc..618db98 100644 --- a/include/formula/grammar.hxx +++ b/include/formula/grammar.hxx @@ -43,7 +43,11 @@ public: CONV_LOTUS_A1, /* external? 3d? A1.B2 */ -CONV_LAST /* for loops, must always be last */ +CONV_LAST, /* for loops, must always be last */ + +// not a real address convention, a special case for INDIRECT function interpretation +// only -> try using CONV_OOO, failing that CONV_XL_A1 +CONV_A1_XL_A1 }; //! CONV_UNSPECIFIED is a negative value! diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index b464da4..31e98b1 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -7036,12 +7036,18 @@ void ScInterpreter::ScIndirect() // Overwrite the config and try Excel R1C1. eConv = FormulaGrammar::CONV_XL_R1C1; } -const ScAddress::Details aDetails( eConv, aPos ); + +bool bTryXlA1 = (eConv == FormulaGrammar::CONV_A1_XL_A1); + +const ScAddress::Details aDetails( bTryXlA1 ? FormulaGrammar::CONV_OOO : eConv, aPos ); +const ScAddress::Details aDetailsXlA1( FormulaGrammar::CONV_XL_A1, aPos ); SCTAB nTab = aPos.Tab(); OUString sRefStr = GetString().getString(); ScRefAddress aRefAd, aRefAd2; ScAddress::ExternalInfo aExtInfo; -if (ConvertDoubleRef(pDok, sRefStr, nTab, aRefAd, aRefAd2, aDetails, &aExtInfo)) +if ( ConvertDoubleRef(pDok, sRefStr, nTab, aRefAd, aRefAd2, aDetails, &aExtInfo) || + ( bTryXlA1 && ConvertDoubleRef(pDok, sRefStr, nTab, aRefAd, +aRefAd2, aDetailsXlA1, &aExtInfo) ) ) { if (aExtInfo.mbExternal) { @@ -7053,7 +7059,9 @@ void ScInterpreter::ScIndirect() else PushDoubleRef( aRefAd, aRefAd2); } -else if (ConvertSingleRef(pDok, sRefStr, nTab, aRefAd, aDetails, &aExtInfo)) +else if ( ConvertSingleRef(pDok, sRefStr, nTab, aRefAd, aDetails, &aExtInfo) || + ( bTryXlA1 && ConvertSingleRef (pDok, sRefStr, nTab, aRefAd, + aDetailsXlA1, &aExtInfo) ) ) { if (aExtInfo.mbExternal) { diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx index d49fb65..6f2de0b 100644 --- a/sc/source/ui/optdlg/calcoptionsdlg.cxx +++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx @@ -46,6 +46,8 @@ formula::FormulaGrammar::AddressConvention toAddressConvention(sal_Int32 nPos) return formula::FormulaGrammar::CONV_XL_A1; case 3: return formula::FormulaGrammar::CONV_XL_R1C1; +case 4: +return formula::FormulaGrammar::CONV_A1_XL_A1; case 0: default: ; @@ -64,6 +66,8 @@ sal_Int32 toSelectedItem( formula::FormulaGrammar::AddressConvention eConv ) return 2; case formula::FormulaGrammar::CONV_XL_R1C1: return 3; +case formula::FormulaGrammar::CONV_A1_XL_A1: +return 4; default: ; } diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx index 82f2502..5d0385e 100644 --- a/sc/source/ui/unoobj/confuno.cxx +++ b/sc/source/ui/unoobj/confuno.cxx @@ -311,6 +311,7 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue( case 0: // CONV_OOO case 2: // CONV_XL_A1 case 3: // CONV_XL_R1C1 +case 7: // CONV_A1_XL_A1 aCalcConfig.meStringRefAddressSyntax = static_cast( nUno ); break; default: @@ -467,6 +468,7 @@ uno::Any SAL_CALL ScDocumentConfiguration::getPropertyValue( const OUString& aPr case formula::FormulaGrammar::CONV_OOO: case formula::FormulaGrammar::CONV_XL_A1
[Libreoffice-commits] core.git: include/formula
include/formula/tokenarray.hxx | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) New commits: commit f96313d16163ce66c2fa04c99fa25b7c6da1c5b1 Author: Stephan Bergmann Date: Mon Jun 15 18:34:00 2015 +0200 Fix previous commit Change-Id: I56b5212595f7750965a7620498fb063422f2eae0 diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx index 991621d..1050047 100644 --- a/include/formula/tokenarray.hxx +++ b/include/formula/tokenarray.hxx @@ -123,6 +123,14 @@ protected: /// Also used by the compiler. The token MUST had been allocated with new! FormulaToken* Add( FormulaToken* ); +public: +enum ReplaceMode +{ +BACKWARD_CODE_ONLY, ///< offset goes backward, replacement only in pCode +FORWARD_CODE_AND_RPN///< offset goes forward, replacement in pCode and RPN +}; + +protected: /** Also used by the compiler. The token MUST had been allocated with new! @param nOffset If eMode==BACKWARD_CODE_ONLY negative offset of token, 0==last, @@ -150,12 +158,6 @@ protected: { nMode = GetCombinedBitsRecalcMode() | nBits; } public: -enum ReplaceMode -{ -BACKWARD_CODE_ONLY, ///< offset goes backward, replacement only in pCode -FORWARD_CODE_AND_RPN///< offset goes forward, replacement in pCode and RPN -}; - FormulaTokenArray(); /// Assignment with references to FormulaToken entries (not copied!) FormulaTokenArray( const FormulaTokenArray& ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula
include/formula/compiler.hrc |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 67360b28c0965992d67afb9356c5ce8ca3bea11d Author: Eike Rathke Date: Thu Jun 11 13:18:25 2015 +0200 keep old CEILING opcode, tdf#69552 follow-up Just in case someone had it in their MRU function list so will be presented with the same function. It doesn't really matter. Change-Id: I4f1023f9650719ad97a669b24f5cdd044f16 diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc index 34bb0d8..9d45b9a 100644 --- a/include/formula/compiler.hrc +++ b/include/formula/compiler.hrc @@ -209,7 +209,7 @@ /*** Functions with more than one parameters ***/ #define SC_OPCODE_START_2_PAR 201 #define SC_OPCODE_ARC_TAN_2 201 -#define SC_OPCODE_CEIL_MATH 202 +#define SC_OPCODE_CEIL 202 #define SC_OPCODE_FLOOR 203 #define SC_OPCODE_ROUND 204 #define SC_OPCODE_ROUND_UP 205 @@ -479,7 +479,7 @@ #define SC_OPCODE_WORKDAY_MS469 #define SC_OPCODE_AGGREGATE 470 #define SC_OPCODE_COLOR 471 -#define SC_OPCODE_CEIL 472 +#define SC_OPCODE_CEIL_MATH 472 #define SC_OPCODE_CEIL_PRECISE 473 #define SC_OPCODE_NETWORKDAYS 474 #define SC_OPCODE_FLOOR_MATH475 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula
include/formula/tokenarray.hxx |1 - 1 file changed, 1 deletion(-) New commits: commit 1fa6ce352d7b72f039e55d830a6a9ae64fddc085 Author: Stephan Bergmann Date: Fri Jan 9 15:45:44 2015 +0100 include is unused again Change-Id: I921c631545be6da66639709642e423c44e82c5af diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx index 639f8fa..e37f751 100644 --- a/include/formula/tokenarray.hxx +++ b/include/formula/tokenarray.hxx @@ -26,7 +26,6 @@ #include #include -#include #include namespace svl { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula include/o3tl
include/formula/tokenarray.hxx |4 + include/o3tl/typed_flags_set.hxx | 112 ++- include/o3tl/underlying_type.hxx | 32 +++ 3 files changed, 87 insertions(+), 61 deletions(-) New commits: commit a1ecce3ad7df6a82191c4956cec986dc50503dde Author: Stephan Bergmann Date: Fri Jan 9 15:44:29 2015 +0100 One more place to work around missing std::underlying_type for GCC 4.6 Change-Id: I46225e30f6326e0af5a8ac3bebe9847f4dbe50d0 diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx index d9c02da..639f8fa 100644 --- a/include/formula/tokenarray.hxx +++ b/include/formula/tokenarray.hxx @@ -23,6 +23,8 @@ #include #include #include +#include + #include #include #include @@ -90,7 +92,7 @@ public: inline boolisRewriteNeeded( OpCode eOp ) const; }; -typedef std::unordered_set::type> > unordered_opcode_set; +typedef std::unordered_set::type> > unordered_opcode_set; class FORMULA_DLLPUBLIC FormulaTokenArray { diff --git a/include/o3tl/typed_flags_set.hxx b/include/o3tl/typed_flags_set.hxx index 501a09a..001d3fe 100644 --- a/include/o3tl/typed_flags_set.hxx +++ b/include/o3tl/typed_flags_set.hxx @@ -23,19 +23,13 @@ #include #include -#include + +#include namespace o3tl { template struct typed_flags {}; -#if defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ <= 7 && \ -!defined __clang__ -#define O3TL_STD_UNDERLYING_TYPE_E signed int -#else -#define O3TL_STD_UNDERLYING_TYPE_E typename std::underlying_type::type -#endif - /// Mark a (scoped) enumeration as a set of bit flags, with accompanying /// operations. /// @@ -49,7 +43,7 @@ template struct typed_flags {}; /// /// \param E the enumeration type. /// \param M the all-bits-set value for the bit flags. -template +template::type M> struct is_typed_flags { static_assert( M >= 0, "is_typed_flags expects only non-negative bit values"); @@ -58,7 +52,7 @@ struct is_typed_flags { class Wrap { public: -explicit Wrap(O3TL_STD_UNDERLYING_TYPE_E value): +explicit Wrap(typename underlying_type::type value): value_(value) { assert(value >= 0); } @@ -67,7 +61,7 @@ struct is_typed_flags { #if !defined _MSC_VER || _MSC_VER > 1700 explicit #endif -operator O3TL_STD_UNDERLYING_TYPE_E() { return value_; } +operator typename underlying_type::type() { return value_; } #if !defined _MSC_VER || _MSC_VER > 1700 explicit @@ -75,20 +69,20 @@ struct is_typed_flags { operator bool() { return value_ != 0; } private: -O3TL_STD_UNDERLYING_TYPE_E value_; +typename underlying_type::type value_; }; -static O3TL_STD_UNDERLYING_TYPE_E const mask = M; +static typename underlying_type::type const mask = M; }; } template inline typename o3tl::typed_flags::Wrap operator ~(E rhs) { -assert(static_cast(rhs) >= 0); +assert(static_cast::type>(rhs) >= 0); return static_cast::Wrap>( o3tl::typed_flags::mask -& ~static_cast(rhs)); +& ~static_cast::type>(rhs)); } template @@ -97,36 +91,36 @@ inline typename o3tl::typed_flags::Wrap operator ~( { return static_cast::Wrap>( o3tl::typed_flags::mask -& ~static_cast(rhs)); +& ~static_cast::type>(rhs)); } template inline typename o3tl::typed_flags::Wrap operator ^(E lhs, E rhs) { -assert(static_cast(lhs) >= 0); -assert(static_cast(rhs) >= 0); +assert(static_cast::type>(lhs) >= 0); +assert(static_cast::type>(rhs) >= 0); return static_cast::Wrap>( -static_cast(lhs) -^ static_cast(rhs)); +static_cast::type>(lhs) +^ static_cast::type>(rhs)); } template inline typename o3tl::typed_flags::Wrap operator ^( E lhs, typename o3tl::typed_flags::Wrap rhs) { -assert(static_cast(lhs) >= 0); +assert(static_cast::type>(lhs) >= 0); return static_cast::Wrap>( -static_cast(lhs) -^ static_cast(rhs)); +static_cast::type>(lhs) +^ static_cast::type>(rhs)); } template inline typename o3tl::typed_flags::Wrap operator ^( typename o3tl::typed_flags::Wrap lhs, E rhs) { -assert(static_cast(rhs) >= 0); +assert(static_cast::type>(rhs) >= 0); return static_cast::Wrap>( -static_cast(lhs) -^ static_cast(rhs)); +static_cast::type>(lhs) +^ static_cast::type>(rhs)); } template @@ -135,37 +129,37 @@ inline typename o3tl::typed_flags::Wrap operator ^( typename o3tl::typed_flags::Wrap rhs) { return static_cast::Wrap>( -static_cast(lhs) -^ static_cast(rhs)); +static_cast::type>(lhs) +^ static_cast::type>(rhs)); } template inline typename o3tl::typed_flags::Wrap operator &(E lhs, E rhs) { -assert(static_cast(lhs) >= 0); -assert(static_cast(rhs) >= 0); +assert(static_cast::type>(lhs) >= 0); +assert(static_cast::
[Libreoffice-commits] core.git: include/formula
include/formula/tokenarray.hxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 05fb5e871e1f7bc0938855b7e6d105ec2932 Author: Caolán McNamara Date: Fri Jan 9 14:31:26 2015 + type_traits for std::underlying_type Change-Id: Iad41da9294c9a38e501e5bcd1b3185f2e3b26ff2 diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx index 9c1e6ee..d9c02da 100644 --- a/include/formula/tokenarray.hxx +++ b/include/formula/tokenarray.hxx @@ -24,7 +24,7 @@ #include #include #include - +#include #include namespace svl { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula sc/inc sc/source
include/formula/opcode.hxx | 10 +- sc/inc/calcconfig.hxx|2 +- sc/inc/formulagroup.hxx |2 +- sc/source/core/tool/calcconfig.cxx |4 ++-- sc/source/core/tool/formulagroup.cxx |2 +- sc/source/core/tool/token.cxx|4 ++-- 6 files changed, 8 insertions(+), 16 deletions(-) New commits: commit c8597274c31ed2ba59b5f2c6f555099aa9928f39 Author: Caolán McNamara Date: Sun Jan 4 13:59:58 2015 + merge OpCodeEnum and OpCode and replace ifdef hackery with an explicit underlying type Change-Id: Ibd340cf28d022af545a82e98e623d4c137ff7e53 diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx index 199d598..0626ed5 100644 --- a/include/formula/opcode.hxx +++ b/include/formula/opcode.hxx @@ -23,7 +23,7 @@ #include #include -enum OpCodeEnum +enum OpCode : sal_uInt16 { // Special commands ocPush = SC_OPCODE_PUSH, @@ -475,14 +475,6 @@ enum OpCodeEnum ocNone = SC_OPCODE_NONE }; -#ifndef DBG_UTIL -// save memory since compilers tend to int an enum -typedef sal_uInt16 OpCode; -#else -// have enum names in debugger -typedef OpCodeEnum OpCode; -#endif - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/inc/calcconfig.hxx b/sc/inc/calcconfig.hxx index 1477134..7cc8fad 100644 --- a/sc/inc/calcconfig.hxx +++ b/sc/inc/calcconfig.hxx @@ -49,7 +49,7 @@ struct SC_DLLPUBLIC ScCalcConfig OUString maOpenCLDevice; sal_Int32 mnOpenCLMinimumFormulaGroupSize; -typedef std::set OpCodeSet; +typedef std::set OpCodeSet; OpCodeSet maOpenCLSubsetOpCodes; diff --git a/sc/inc/formulagroup.hxx b/sc/inc/formulagroup.hxx index 191b78e..ba553c6 100644 --- a/sc/inc/formulagroup.hxx +++ b/sc/inc/formulagroup.hxx @@ -129,7 +129,7 @@ class SC_DLLPUBLIC FormulaGroupInterpreter #if HAVE_FEATURE_OPENCL static void fillOpenCLInfo(std::vector& rPlatforms); static bool switchOpenCLDevice(const OUString& rDeviceId, bool bAutoSelect, bool bForceEvaluation = false); -static void enableOpenCL(bool bEnable, bool bEnableCompletely = false, const std::set& rSubsetToEnable = std::set()); +static void enableOpenCL(bool bEnable, bool bEnableCompletely = false, const std::set& rSubsetToEnable = std::set()); static void getOpenCLDeviceInfo(sal_Int32& rDeviceId, sal_Int32& rPlatformId); #endif virtual ScMatrixRef inverseMatrix(const ScMatrix& rMat) = 0; diff --git a/sc/source/core/tool/calcconfig.cxx b/sc/source/core/tool/calcconfig.cxx index 91ae7e5..3e00b05 100644 --- a/sc/source/core/tool/calcconfig.cxx +++ b/sc/source/core/tool/calcconfig.cxx @@ -184,12 +184,12 @@ ScCalcConfig::OpCodeSet ScStringToOpCodeSet(const OUString& rOpCodes) OUString element(s.copy(fromIndex, semicolon - fromIndex)); sal_Int32 n = element.toInt32(); if (n > 0 || (n == 0 && element == "0")) -result.insert(static_cast(n)); +result.insert(static_cast(n)); else if (pHashMap) { auto opcode(pHashMap->find(element)); if (opcode != pHashMap->end()) -result.insert(static_cast(opcode->second)); +result.insert(static_cast(opcode->second)); else SAL_WARN("sc.opencl", "Unrecognized OpCode " << element << " in OpCode set string"); } diff --git a/sc/source/core/tool/formulagroup.cxx b/sc/source/core/tool/formulagroup.cxx index 870c06a..68e9881 100644 --- a/sc/source/core/tool/formulagroup.cxx +++ b/sc/source/core/tool/formulagroup.cxx @@ -547,7 +547,7 @@ void FormulaGroupInterpreter::getOpenCLDeviceInfo(sal_Int32& rDeviceId, sal_Int3 rPlatformId = aPlatformId; } -void FormulaGroupInterpreter::enableOpenCL(bool bEnable, bool bEnableCompletely, const std::set& rSubsetToEnable) +void FormulaGroupInterpreter::enableOpenCL(bool bEnable, bool bEnableCompletely, const std::set& rSubsetToEnable) { boost::shared_ptr batch(comphelper::ConfigurationChanges::create()); officecfg::Office::Common::Misc::UseOpenCL::set(bEnable, batch); diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index ebfb8ca..cd9e656 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1141,7 +1141,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) if (SC_OPCODE_START_FUNCTION <= eOp && eOp < SC_OPCODE_STOP_FUNCTION) { -if (ScInterpreter::GetGlobalConfig().mbOpenCLSubsetOnly && ScInterpreter::GetGlobalConfig().maOpenCLSubsetOpCodes.find(static_cast(eOp)) == ScInterpreter::GetGlobalConfig().maOpenCLSubsetOpCodes.end()) +if (ScInterpreter::GetGlobalConfig().mbOpenCLSubsetOnly && ScInterpreter::GetGlobalConfig().maOpenCLSubsetOpCodes.find(eOp) == ScInterpreter::GetGlobalConfig().maOpenCLSubsetOpCodes.end()) { meVectorState = Fo
[Libreoffice-commits] core.git: include/formula sc/inc sc/source
include/formula/FormulaCompiler.hxx |9 - sc/inc/externalrefmgr.hxx | 10 -- sc/source/core/inc/parclass.hxx |4 sc/source/ui/inc/docsh.hxx |4 4 files changed, 27 deletions(-) New commits: commit 5353c6dc9ddf36c810f32d678c13c1815547897a Author: Tor Lillqvist Date: Tue Nov 4 10:18:19 2014 +0200 Bin presumably obsolete SUNWS crack Change-Id: I83038a7160251e59a2178e54859c2ab8e4bffe2e diff --git a/include/formula/FormulaCompiler.hxx b/include/formula/FormulaCompiler.hxx index a4fd1af..101369d 100644 --- a/include/formula/FormulaCompiler.hxx +++ b/include/formula/FormulaCompiler.hxx @@ -70,11 +70,6 @@ public: FormulaCompiler(FormulaTokenArray& _rArr); virtual ~FormulaCompiler(); -// SUNWS8 needs a forward declared friend, otherwise members of the outer -// class are not accessible. -class OpCodeMap; -friend class FormulaCompiler::OpCodeMap; - /** Mappings from strings to OpCodes and vice versa. */ class FORMULA_DLLPUBLIC OpCodeMap { @@ -362,10 +357,6 @@ private: rCurr->SetForceArray( true); } -// SUNWS7 needs a forward declared friend, otherwise members of the outer -// class are not accessible. -class CurrentFactor; -friend class FormulaCompiler::CurrentFactor; class CurrentFactor { FormulaTokenRef pPrevFac; diff --git a/sc/inc/externalrefmgr.hxx b/sc/inc/externalrefmgr.hxx index 8a2d3a4..d3f2b1e 100644 --- a/sc/inc/externalrefmgr.hxx +++ b/sc/inc/externalrefmgr.hxx @@ -123,11 +123,6 @@ private: typedef ::boost::unordered_map RowsDataType; public: -// SUNWS needs a forward declared friend, otherwise types and members -// of the outer class are not accessible. -class Table; -friend class ScExternalRefCache::Table; - /** * Represents a single cached table in an external document. It only * stores non-empty cells; empty cells should never be stored in the data @@ -336,11 +331,6 @@ private: typedef ::boost::unordered_map RangeArrayMap; typedef ::boost::unordered_map NamePairMap; -// SUNWS needs a forward declared friend, otherwise types and members -// of the outer class are not accessible. -struct DocItem; -friend struct ScExternalRefCache::DocItem; - /** Represents data cached for a single external document. */ struct DocItem { diff --git a/sc/source/core/inc/parclass.hxx b/sc/source/core/inc/parclass.hxx index 881dbc2..aa1b074 100644 --- a/sc/source/core/inc/parclass.hxx +++ b/sc/source/core/inc/parclass.hxx @@ -101,10 +101,6 @@ private: sal_uInt8 nRepeatLast; }; -// SUNWS7 needs a forward declared friend, otherwise members of the outer -// class are not accessible (in this case CommonData). -struct RawData; -friend struct ScParameterClassification::RawData; struct RawData { OpCode eOp; diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index 98f7109..fc6bccc 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -121,10 +121,6 @@ class SC_DLLPUBLIC ScDocShell: public SfxObjectShell, public SfxListener SAL_DLLPRIVATE void InitOptions(bool bForLoading); SAL_DLLPRIVATE void ResetDrawObjectShell(); -// SUNWS needs a forward declared friend, otherwise types and members -// of the outer class are not accessible. -class PrepareSaveGuard; -friend class ScDocShell::PrepareSaveGuard; /** Do things that need to be done before saving to our own format and necessary clean ups in dtor. */ class PrepareSaveGuard ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula sc/source
include/formula/IFunctionDescription.hxx |2 +- sc/source/ui/formdlg/formula.cxx |4 ++-- sc/source/ui/inc/formula.hxx |2 +- 3 files changed, 4 insertions(+), 4 deletions(-) New commits: commit ac73516da34658005eb06cf1acdd4817ab355a57 Author: Tor Lillqvist Date: Tue Feb 18 10:12:31 2014 +0200 Spelling fix: s/martix/matrix Change-Id: Ieba5e6b1c1f32125a4c266e5252d9c1bc729f061 diff --git a/include/formula/IFunctionDescription.hxx b/include/formula/IFunctionDescription.hxx index 985da7f..7f75d64 100644 --- a/include/formula/IFunctionDescription.hxx +++ b/include/formula/IFunctionDescription.hxx @@ -155,7 +155,7 @@ namespace formula virtual ::com::sun::star::table::CellAddress getReferencePosition() const = 0; virtual void setDispatcherLock( bool bLock ) = 0; -virtual void dispatch(bool _bOK, bool _bMartixChecked) = 0; +virtual void dispatch(bool _bOK, bool _bMatrixChecked) = 0; virtual void doClose(bool _bOk) = 0; virtual void insertEntryToLRUList(const IFunctionDescription* pDesc) = 0; virtual void showReference(const OUString& _sFormula) = 0; diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx index 2b0f913..5285de1 100644 --- a/sc/source/ui/formdlg/formula.cxx +++ b/sc/source/ui/formdlg/formula.cxx @@ -526,10 +526,10 @@ void ScFormulaDlg::ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pB { m_aHelper.ReleaseFocus(pEdit,pButton); } -void ScFormulaDlg::dispatch(bool _bOK, bool _bMartixChecked) +void ScFormulaDlg::dispatch(bool _bOK, bool _bMatrixChecked) { SfxBoolItem aRetItem( SID_DLG_RETOK, _bOK ); -SfxBoolItem aMatItem( SID_DLG_MATRIX, _bMartixChecked ); +SfxBoolItem aMatItem( SID_DLG_MATRIX, _bMatrixChecked ); SfxStringItem aStrItem( SCITEM_STRING, getCurrentFormula() ); // Wenn durch Dokument-Umschalterei die Eingabezeile weg war/ist, diff --git a/sc/source/ui/inc/formula.hxx b/sc/source/ui/inc/formula.hxx index c4472cd..fcaffcb 100644 --- a/sc/source/ui/inc/formula.hxx +++ b/sc/source/ui/inc/formula.hxx @@ -65,7 +65,7 @@ public: virtual void doClose(bool _bOk); virtual void insertEntryToLRUList(const formula::IFunctionDescription* pDesc); virtual void showReference(const OUString& _sFormula); -virtual void dispatch(bool _bOK, bool _bMartixChecked); +virtual void dispatch(bool _bOK, bool _bMatrixChecked); virtual void setDispatcherLock( bool bLock ); virtual void setReferenceInput(const formula::FormEditData* _pData); virtual void deleteFormData(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula
include/formula/token.hxx | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) New commits: commit 7220b55f6347e2236e63491cd5d1ef9355c3320a Author: Kohei Yoshida Date: Wed Nov 6 20:56:20 2013 -0500 Correct reference count type. Change-Id: Id7902c8d21d22a6d5f3740a6bd72e0c1213461e7 diff --git a/include/formula/token.hxx b/include/formula/token.hxx index ea91e2c..f5b49cc 100644 --- a/include/formula/token.hxx +++ b/include/formula/token.hxx @@ -93,13 +93,13 @@ class FORMULA_DLLPUBLIC FormulaToken : public IFormulaToken protected: const StackVar eType; // type of data -mutable sal_uInt16 nRefCnt;// reference count +mutable oslInterlockedCount mnRefCnt;// reference count public: FormulaToken( StackVar eTypeP,OpCode e = ocPush ) : -eOp(e), eType( eTypeP ), nRefCnt(0) {} +eOp(e), eType( eTypeP ), mnRefCnt(0) {} FormulaToken( const FormulaToken& r ) : IFormulaToken(), -eOp(r.eOp), eType( r.eType ), nRefCnt(0) {} +eOp(r.eOp), eType( r.eType ), mnRefCnt(0) {} virtual ~FormulaToken(); @@ -111,16 +111,16 @@ public: inline void IncRef() const { -osl_atomic_increment(&nRefCnt); +osl_atomic_increment(&mnRefCnt); } inline void DecRef() const { -if (!osl_atomic_decrement(&nRefCnt)) +if (!osl_atomic_decrement(&mnRefCnt)) const_cast(this)->Delete(); } -inline sal_uInt16 GetRef() const { return nRefCnt; } +inline oslInterlockedCount GetRef() const { return mnRefCnt; } inline OpCode GetOpCode() const { return eOp; } /** ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula
include/formula/grammar.hxx |1 + 1 file changed, 1 insertion(+) New commits: commit d9a3381eb586b31d305102b40aea4bf543b42ec7 Author: Julien Nabet Date: Thu Aug 29 18:39:01 2013 +0200 Add GRAM_ENGLISH_XL_OOX as supported See comment //! When adding new values adapt isSupported() below as well of this same file @Eike: ;-) Change-Id: Ifa70be0d88208499bef809cc234c86cb6045bcd3 diff --git a/include/formula/grammar.hxx b/include/formula/grammar.hxx index 75556d5..610cf46 100644 --- a/include/formula/grammar.hxx +++ b/include/formula/grammar.hxx @@ -186,6 +186,7 @@ public: case GRAM_NATIVE_XL_R1C1 : case GRAM_ENGLISH_XL_A1 : case GRAM_ENGLISH_XL_R1C1: +case GRAM_ENGLISH_XL_OOX : return true; default: return extractFormulaLanguage( eGrammar) == GRAM_EXTERNAL; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula
include/formula/compiler.hrc |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit efdefd379406cd414ef0901d7aeaaa4f032cf52d Author: Eike Rathke Date: Wed Aug 14 22:34:58 2013 +0200 make this less error prone Change-Id: Ic349d1db5f63b0a2b6ba19eece630d831a912292 diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc index 092a093..b53b825 100644 --- a/include/formula/compiler.hrc +++ b/include/formula/compiler.hrc @@ -409,9 +409,9 @@ #define SC_OPCODE_FILTERXML 411 #define SC_OPCODE_WEBSERVICE412 -#define SC_OPCODE_LAST_OPCODE_ID412 /* last OpCode */ #define SC_OPCODE_STOP_2_PAR413 /* last function with two or more parameters' OpCode + 1 */ -#define SC_OPCODE_STOP_FUNCTION 413 /* last function's OpCode + 1 */ +#define SC_OPCODE_STOP_FUNCTION SC_OPCODE_STOP_2_PAR/* last function's OpCode + 1 */ +#define SC_OPCODE_LAST_OPCODE_ID(SC_OPCODE_STOP_FUNCTION - 1) /* last OpCode */ /*** Internal ***/ #define SC_OPCODE_INTERNAL_BEGIN ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula
include/formula/compiler.hrc | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) New commits: commit 084ac2bfcb37a15d16abfca9e13db3829f89a28e Author: Eike Rathke Date: Wed Aug 14 21:23:01 2013 +0200 corrected SC_OPCODE_STOP_2_PAR and SC_OPCODE_LAST_OPCODE_ID 0946de1e2fbf8bd5ad3919429f648359d4464eca did not adapt SC_OPCODE_STOP_2_PAR and adapted SC_OPCODE_LAST_OPCODE_ID wrongly; LEFTB, LENB, MIDB and RIGHTB didn't work, didn't show up in the Function Wizard's Structure tab and also weren't saved to .xlsx Change-Id: I8d31c8c931e40d84e265bf80f76352f5a7190377 diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc index 91a3d3f..092a093 100644 --- a/include/formula/compiler.hrc +++ b/include/formula/compiler.hrc @@ -402,16 +402,16 @@ #define SC_OPCODE_AVERAGE_IFS 404 #define SC_OPCODE_COUNT_IFS 405 #define SC_OPCODE_SKEWP 406 -#define SC_OPCODE_STOP_2_PAR407 -#define SC_OPCODE_LENB 408 -#define SC_OPCODE_RIGHTB409 -#define SC_OPCODE_LEFTB 410 -#define SC_OPCODE_MIDB 412 -#define SC_OPCODE_FILTERXML 413 -#define SC_OPCODE_WEBSERVICE414 -#define SC_OPCODE_LAST_OPCODE_ID415 /* last OpCode */ +#define SC_OPCODE_LENB 407 +#define SC_OPCODE_RIGHTB408 +#define SC_OPCODE_LEFTB 409 +#define SC_OPCODE_MIDB 410 +#define SC_OPCODE_FILTERXML 411 +#define SC_OPCODE_WEBSERVICE412 -#define SC_OPCODE_STOP_FUNCTION 416 +#define SC_OPCODE_LAST_OPCODE_ID412 /* last OpCode */ +#define SC_OPCODE_STOP_2_PAR413 /* last function with two or more parameters' OpCode + 1 */ +#define SC_OPCODE_STOP_FUNCTION 413 /* last function's OpCode + 1 */ /*** Internal ***/ #define SC_OPCODE_INTERNAL_BEGIN ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula
include/formula/vectortoken.hxx | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) New commits: commit d89f93ba774b717413f6b758a7a4684d7b7c8bb6 Author: Kohei Yoshida Date: Tue Apr 30 15:41:15 2013 -0400 A little more description for the new tokens. Change-Id: I9b158bd4302a84202447a74ac90cf4e9f760c6a5 diff --git a/include/formula/vectortoken.hxx b/include/formula/vectortoken.hxx index 2679b4e..d3d0511 100644 --- a/include/formula/vectortoken.hxx +++ b/include/formula/vectortoken.hxx @@ -14,6 +14,10 @@ namespace formula { +/** + * This token represents a single cell reference in a vectorized formula + * calculation context. + */ class FORMULA_DLLPUBLIC SingleVectorRefToken : public FormulaToken { const double* mpArray; @@ -29,15 +33,17 @@ public: }; /** - * This token describes a range reference in a vectorized formula + * This token represents a range reference in a vectorized formula * calculation context. */ class FORMULA_DLLPUBLIC DoubleVectorRefToken : public FormulaToken { std::vector maArrays; -size_t mnArrayLength; -size_t mnRefRowSize; +size_t mnArrayLength; /// length of all arrays. +size_t mnRefRowSize; /// original reference row size. The row size may + /// change as it goes down the array if either the + /// stard or end position is fixed. bool mbStartFixed:1; /// whether or not the start row position is absolute. bool mbEndFixed:1; /// whether or not the end row position is absolute. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/formula
include/formula/grammar.hxx |5 + 1 file changed, 5 insertions(+) New commits: commit 9bff49e203359921cb279be373773deb13ca8b90 Author: Eike Rathke Date: Tue Apr 30 20:16:31 2013 +0200 added GRAM_ENGLISH_XL_OOX, FormulaLanguage::XL_ENGLISH with CONV_XL_OOX Change-Id: Idabf46bfdfa6092b0ae27fe4116382eaa00d5db9 diff --git a/include/formula/grammar.hxx b/include/formula/grammar.hxx index 584aff1..75556d5 100644 --- a/include/formula/grammar.hxx +++ b/include/formula/grammar.hxx @@ -129,6 +129,11 @@ public: ((CONV_XL_R1C1 + kConventionOffset) << kConventionShift) | kEnglishBit, +/// English with Excel OOXML reference style. +GRAM_ENGLISH_XL_OOX = ::com::sun::star::sheet::FormulaLanguage::XL_ENGLISH | +((CONV_XL_OOX+ + kConventionOffset) << kConventionShift) | +kEnglishBit, /// Central definition of the default grammar to be used. GRAM_DEFAULT= GRAM_NATIVE_UI, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits