summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2012-03-21 15:57:35 +0000
committerMatúš Kukan <matus.kukan@gmail.com>2012-07-17 16:39:24 +0200
commit0e7dd6a9ed7fb8145acf91c036affbf0504cd906 (patch)
tree493faadc437c959933d7249651f27314a6688a25
parente95ef3583542c21e6459734e4f23098d5d64288f (diff)
EnterData - remove un-necessary bRecord parameter for corner-case
-rw-r--r--sc/source/ui/inc/viewfunc.hxx6
-rw-r--r--sc/source/ui/view/cellsh3.cxx2
-rw-r--r--sc/source/ui/view/viewfun4.cxx8
-rw-r--r--sc/source/ui/view/viewfunc.cxx17
4 files changed, 18 insertions, 15 deletions
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index f33771534677..eece3daa535b 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -88,10 +88,10 @@ public:
String GetAutoSumFormula( const ScRangeList& rRangeList, bool bSubTotal, const ScAddress& rAddr );
void EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString,
- sal_Bool bRecord = sal_True, const EditTextObject* pData = NULL );
+ const EditTextObject* pData = NULL );
+ void EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab,
+ const EditTextObject* pData, bool bTestSimple = false );
void EnterValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& rValue );
- void EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, const EditTextObject* pData,
- sal_Bool bRecord = sal_True, sal_Bool bTestSimple = false );
void EnterMatrix( const String& rString, ::formula::FormulaGrammar::Grammar eGram );
void EnterBlock( const String& rString, const EditTextObject* pData );
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 9c5a417aaab5..7a2020443149 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -241,7 +241,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
}
else if ( aString.Len() > 0 && ( aString.GetChar(0) == '=' || aString.GetChar(0) == '+' || aString.GetChar(0) == '-' ) )
{
- pTabViewShell->EnterData( aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab(), aString, sal_True, pData );
+ pTabViewShell->EnterData( aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab(), aString, pData );
}
else
{
diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx
index ee9d3ab96a50..79fdbdc8fc36 100644
--- a/sc/source/ui/view/viewfun4.cxx
+++ b/sc/source/ui/view/viewfun4.cxx
@@ -130,15 +130,19 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow,
}
SCROW nRow = nStartRow;
+
+ // Temporarily turn off undo generation for this lot
+ bool bUndoEnabled = pDoc->IsUndoEnabled();
+ pDoc->EnableUndo( false );
for( sal_uInt16 n = 0; n < nParCnt; n++ )
{
EditTextObject* pObject = pEngine->CreateTextObject( n );
- EnterData( nStartCol, nRow, nTab, pObject, false, sal_True );
- // kein Undo, auf einfache Strings testen
+ EnterData( nStartCol, nRow, nTab, pObject, true );
delete pObject;
if( ++nRow > MAXROW )
break;
}
+ pDoc->EnableUndo(bUndoEnabled);
if (bRecord)
{
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 4832a278558e..20377d228144 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -342,15 +342,15 @@ sal_Bool lcl_AddFunction( ScAppOptions& rAppOpt, sal_uInt16 nOpCode )
// input - undo OK
-void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString,
- sal_Bool bRecord, const EditTextObject* pData )
+void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab,
+ const String& rString,
+ const EditTextObject* pData )
{
ScDocument* pDoc = GetViewData()->GetDocument();
ScMarkData& rMark = GetViewData()->GetMarkData();
SCTAB nSelCount = rMark.GetSelectCount();
+ bool bRecord = pDoc->IsUndoEnabled();
SCTAB i;
- if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = false;
ScDocShell* pDocSh = GetViewData()->GetDocShell();
ScDocShellModificator aModificator( *pDocSh );
@@ -716,14 +716,13 @@ void ScViewFunc::EnterValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& r
}
}
-void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, const EditTextObject* pData,
- sal_Bool bRecord, sal_Bool bTestSimple )
+void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab,
+ const EditTextObject* pData, bool bTestSimple )
{
ScDocShell* pDocSh = GetViewData()->GetDocShell();
ScMarkData& rMark = GetViewData()->GetMarkData();
ScDocument* pDoc = pDocSh->GetDocument();
- if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = false;
+ bool bRecord = pDoc->IsUndoEnabled();
ScDocShellModificator aModificator( *pDocSh );
@@ -812,7 +811,7 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, const EditTextOb
if (bCommon)
AdjustRowHeight(nRow,nRow);
- EnterData(nCol,nRow,nTab,aString,bRecord);
+ EnterData(nCol,nRow,nTab,aString);
}
else
{