[Libreoffice-commits] core.git: Branch 'feature/formula-core-rework' - 2 commits - sc/source
Kohei Yoshida
kohei.yoshida at gmail.com
Wed Mar 20 15:27:23 PDT 2013
sc/source/ui/docshell/docfunc.cxx | 19 +++++++++----------
sc/source/ui/inc/docfunc.hxx | 6 +++---
2 files changed, 12 insertions(+), 13 deletions(-)
New commits:
commit e3daeea29fe5d5d757ceeabff87ce370241b2848
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Wed Mar 20 18:07:17 2013 -0400
This shouldn't be virtual.
Change-Id: Ic15f96a71b7c315ab94ceed808c348cd6fe535df
diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx
index dfb4ab0..9053b4b 100644
--- a/sc/source/ui/inc/docfunc.hxx
+++ b/sc/source/ui/inc/docfunc.hxx
@@ -107,9 +107,9 @@ public:
const formula::FormulaGrammar::Grammar eGrammar );
// creates a new cell for use with PutCell
- virtual ScBaseCell* InterpretEnglishString( const ScAddress& rPos, const String& rText,
- const String& rFormulaNmsp, const formula::FormulaGrammar::Grammar eGrammar,
- short* pRetFormatType = NULL );
+ ScBaseCell* InterpretEnglishString( const ScAddress& rPos, const String& rText,
+ const String& rFormulaNmsp, const formula::FormulaGrammar::Grammar eGrammar,
+ short* pRetFormatType = NULL );
virtual bool ShowNote( const ScAddress& rPos, bool bShow = true );
inline bool HideNote( const ScAddress& rPos ) { return ShowNote( rPos, false ); }
commit 0ab1ac5f63e4e51a32e451dd02d2f937d44857cb
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Wed Mar 20 17:47:41 2013 -0400
Reorganize SetCellText() to avoid PulCell() at the very end.
Change-Id: Ib5244cbbb81a1dbc20fbf4a63679a862ede525ff
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index efec66a..bb59dd3 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1219,7 +1219,7 @@ sal_Bool ScDocFunc::SetCellText( const ScAddress& rPos, const String& rText,
// SetCellText ruft PutCell oder SetNormalString
ScDocument* pDoc = rDocShell.GetDocument();
- ScBaseCell* pNewCell = NULL;
+
if ( bInterpret )
{
if ( bEnglish )
@@ -1231,23 +1231,22 @@ sal_Bool ScDocFunc::SetCellText( const ScAddress& rPos, const String& rText,
// code moved to own method InterpretEnglishString because it is also used in
// ScCellRangeObj::setFormulaArray
- pNewCell = InterpretEnglishString( rPos, rText, rFormulaNmsp, eGrammar );
+ ScBaseCell* pNewCell = InterpretEnglishString( rPos, rText, rFormulaNmsp, eGrammar );
+ if (pNewCell)
+ return PutCell( rPos, pNewCell, bApi );
}
// sonst Null behalten -> SetString mit lokalen Formeln/Zahlformat
}
else if ( rText.Len() )
{
OSL_ENSURE( rFormulaNmsp.Len() == 0, "ScDocFunc::SetCellText - formula namespace, but do not interpret?" );
- pNewCell = ScBaseCell::CreateTextCell( rText, pDoc ); // immer Text
+ ScBaseCell* pNewCell = ScBaseCell::CreateTextCell( rText, pDoc ); // immer Text
+ if (pNewCell)
+ return PutCell( rPos, pNewCell, bApi );
}
- if (pNewCell)
- return PutCell( rPos, pNewCell, bApi );
- else
- {
- bool bNumFmtSet = false;
- return SetNormalString( bNumFmtSet, rPos, rText, bApi );
- }
+ bool bNumFmtSet = false;
+ return SetNormalString( bNumFmtSet, rPos, rText, bApi );
}
//------------------------------------------------------------------------
More information about the Libreoffice-commits
mailing list