summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-01-30 17:41:23 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-01-30 17:43:03 -0500
commit3d869cda8db03820dea8c4ba463eb155d05e933b (patch)
tree77380cf08857e729dbba87f05df49889887929ff
parent59239c29269d69a7dec9b093b7832dd032dec1e8 (diff)
fdo#74014: Brodcast only when pasting, not during file import.
Change-Id: I7cca5d459491fca782f24093dcdd7d0c1c69bdc9
-rw-r--r--sc/qa/unit/ucalc.cxx1
-rw-r--r--sc/source/ui/docshell/impex.cxx17
-rw-r--r--sc/source/ui/inc/impex.hxx2
-rw-r--r--sc/source/ui/view/viewfun5.cxx1
4 files changed, 14 insertions, 7 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 7e9bba755bbf..5811dc06c865 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -5194,6 +5194,7 @@ void Test::testImportStream()
aOpt.SetFieldSeps(",");
ScImportExport aObj(m_pDoc, ScAddress(0,0,0));
+ aObj.SetImportBroadcast(true);
aObj.SetExtOptions(aOpt);
aObj.ImportString("1,2,3", FORMAT_STRING);
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index bf1c0483d852..d6ce4f3058d3 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -89,7 +89,7 @@ ScImportExport::ScImportExport( ScDocument* p )
bFormulas( false ), bIncludeFiltered( true ),
bAll( true ), bSingle( true ), bUndo( false ),
bOverflowRow( false ), bOverflowCol( false ), bOverflowCell( false ),
- mbApi( true ), mExportTextOptions()
+ mbApi( true ), mbImportBroadcast(false), mExportTextOptions()
{
pUndoDoc = NULL;
pExtOptions = NULL;
@@ -105,7 +105,7 @@ ScImportExport::ScImportExport( ScDocument* p, const ScAddress& rPt )
bFormulas( false ), bIncludeFiltered( true ),
bAll( false ), bSingle( true ), bUndo( pDocSh != NULL ),
bOverflowRow( false ), bOverflowCol( false ), bOverflowCell( false ),
- mbApi( true ), mExportTextOptions()
+ mbApi( true ), mbImportBroadcast(false), mExportTextOptions()
{
pUndoDoc = NULL;
pExtOptions = NULL;
@@ -122,7 +122,7 @@ ScImportExport::ScImportExport( ScDocument* p, const ScRange& r )
bFormulas( false ), bIncludeFiltered( true ),
bAll( false ), bSingle( false ), bUndo( pDocSh != NULL ),
bOverflowRow( false ), bOverflowCol( false ), bOverflowCell( false ),
- mbApi( true ), mExportTextOptions()
+ mbApi( true ), mbImportBroadcast(false), mExportTextOptions()
{
pUndoDoc = NULL;
pExtOptions = NULL;
@@ -140,7 +140,7 @@ ScImportExport::ScImportExport( ScDocument* p, const OUString& rPos )
bFormulas( false ), bIncludeFiltered( true ),
bAll( false ), bSingle( true ), bUndo( pDocSh != NULL ),
bOverflowRow( false ), bOverflowCol( false ), bOverflowCell( false ),
- mbApi( true ), mExportTextOptions()
+ mbApi( true ), mbImportBroadcast(false), mExportTextOptions()
{
pUndoDoc = NULL;
pExtOptions = NULL;
@@ -947,7 +947,7 @@ bool ScImportExport::Text2Doc( SvStream& rStrm )
}
EndPaste();
- if (bOk)
+ if (bOk && mbImportBroadcast)
{
pDoc->BroadcastCells(aRange, SC_HINT_DATACHANGED);
pDocSh->PostDataChanged();
@@ -1490,8 +1490,11 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
if (bRangeIsDetermined)
EndPaste(false);
- pDoc->BroadcastCells(aRange, SC_HINT_DATACHANGED);
- pDocSh->PostDataChanged();
+ if (mbImportBroadcast)
+ {
+ pDoc->BroadcastCells(aRange, SC_HINT_DATACHANGED);
+ pDocSh->PostDataChanged();
+ }
return true;
}
diff --git a/sc/source/ui/inc/impex.hxx b/sc/source/ui/inc/impex.hxx
index 43561540d662..b21511d8ed2d 100644
--- a/sc/source/ui/inc/impex.hxx
+++ b/sc/source/ui/inc/impex.hxx
@@ -65,6 +65,7 @@ class ScImportExport
bool bOverflowCol; // too many columns
bool bOverflowCell; // too much data for a cell
bool mbApi;
+ bool mbImportBroadcast; // whether or not to broadcast after data import.
ScExportTextOptions mExportTextOptions;
ScAsciiOptions* pExtOptions; // extended options
@@ -151,6 +152,7 @@ public:
bool IsApi() const { return mbApi; }
void SetApi( bool bApi ) { mbApi = bApi; }
+ void SetImportBroadcast( bool b ) { mbImportBroadcast = b; }
const ScExportTextOptions& GetExportTextOptions() { return mExportTextOptions; }
void SetExportTextOptions( const ScExportTextOptions& options ) { mExportTextOptions = options; }
};
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index 5045e06c460c..a4d5394051c3 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -288,6 +288,7 @@ sal_Bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
{
ScAddress aCellPos( nPosX, nPosY, GetViewData()->GetTabNo() );
ScImportExport aObj( GetViewData()->GetDocument(), aCellPos );
+ aObj.SetImportBroadcast(true);
OUString aStr;
SotStorageStreamRef xStream;