[Libreoffice-commits] core.git: formula/source

Eike Rathke erack at redhat.com
Wed Jul 5 14:06:57 UTC 2017


 formula/source/ui/dlg/formula.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit eda1190de3f7cdd9abeb0a31fb3b2791ce418aab
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Jul 5 16:05:38 2017 +0200

    Replace a "not ideal coding" ...
    
    ... with what was actually meant (worked though).
    
    Change-Id: Ie7fb5f25bc45e8c224f0cc5853a45fc6e1574f3c

diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index d6b40124aa65..ae44642e461b 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -655,14 +655,16 @@ void FormulaDlg_Impl::MakeTree(StructPage* _pTree,SvTreeListEntry* pParent,Formu
                     {
                         pEntry=_pTree->InsertEntry(aResult,pParent,STRUCT_ERROR,0,_pToken);
                     }
-
-                    else if ( eOp<ocAdd || eOp>ocNegSub ) // not ideal coding
+                    else if (!((SC_OPCODE_START_BIN_OP <= eOp && eOp < SC_OPCODE_STOP_BIN_OP) ||
+                                (SC_OPCODE_START_UN_OP <= eOp && eOp < SC_OPCODE_STOP_UN_OP)))
                     {
+                        // Not a binary or unary operator.
                         bCalcSubformula = true;
                         pEntry=_pTree->InsertEntry(aResult,pParent,STRUCT_FOLDER,0,_pToken);
                     }
                     else
                     {
+                        /* TODO: question remains, why not sub calculate operators? */
                         pEntry=_pTree->InsertEntry(aResult,pParent,STRUCT_FOLDER,0,_pToken);
                     }
                 }


More information about the Libreoffice-commits mailing list