[ooo-build-commit] Branch 'ooo-build-3-1' - patches/dev300
Kohei Yoshida
kohei at kemper.freedesktop.org
Tue Jun 2 21:11:01 PDT 2009
patches/dev300/calc-multi-range-copy-paste.diff | 987 ++++++++++++------------
1 file changed, 533 insertions(+), 454 deletions(-)
New commits:
commit c22deec95eedd3ceaa00755768cd98e8075ed406
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Tue Jun 2 22:13:53 2009 -0400
Fixed a crasher during multi-range copy-n-paste.
Updated the patch to fix one crasher bug during multi-range copy-n-paste,
also refactored the code a bit to remove duplicated code blocks.
(n#509209)
* patches/dev300/calc-multi-range-copy-paste.diff:
diff --git a/patches/dev300/calc-multi-range-copy-paste.diff b/patches/dev300/calc-multi-range-copy-paste.diff
index 7db8a51..d7856d0 100644
--- a/patches/dev300/calc-multi-range-copy-paste.diff
+++ b/patches/dev300/calc-multi-range-copy-paste.diff
@@ -1,5 +1,5 @@
diff --git sc/inc/cell.hxx sc/inc/cell.hxx
-index e9e2582..0bef331 100644
+index 5454907..b460a31 100644
--- sc/inc/cell.hxx
+++ sc/inc/cell.hxx
@@ -40,6 +40,7 @@
@@ -10,14 +10,14 @@ index e9e2582..0bef331 100644
#include "formula/grammar.hxx"
#include "tokenarray.hxx"
#include "formularesult.hxx"
-@@ -571,6 +572,7 @@ public:
- BOOL IsRangeNameInUse(USHORT nIndex) const;
+@@ -462,6 +463,7 @@ public:
+ BOOL IsRangeNameInUse(USHORT nIndex) const;
void FindRangeNamesInUse(std::set<USHORT>& rIndexes) const;
- void ReplaceRangeNamesInUse( const ScIndexMap& rMap );
+ void ReplaceRangeNamesInUse( const ScIndexMap& rMap );
+ void ReplaceRangeNamesInUse( const ScRangeData::IndexMap& rMap );
- BOOL IsSubTotal() const { return bSubTotal; }
- BOOL IsChanged() const { return bChanged; }
- void ResetChanged() { bChanged = FALSE; }
+ BOOL IsSubTotal() const { return bSubTotal; }
+ BOOL IsChanged() const { return bChanged; }
+ void ResetChanged() { bChanged = FALSE; }
diff --git sc/inc/clipparam.hxx sc/inc/clipparam.hxx
new file mode 100644
index 0000000..1a46f4c
@@ -115,7 +115,7 @@ index 0000000..1a46f4c
+
+#endif
diff --git sc/inc/column.hxx sc/inc/column.hxx
-index f24c0c8..18cb668 100644
+index 64ac9a0..5b17512 100644
--- sc/inc/column.hxx
+++ sc/inc/column.hxx
@@ -35,6 +35,7 @@
@@ -126,16 +126,16 @@ index f24c0c8..18cb668 100644
#include <tools/solar.h>
#include <set>
-@@ -300,6 +301,7 @@ public:
- BOOL IsRangeNameInUse(SCROW nRow1, SCROW nRow2, USHORT nIndex) const;
+@@ -301,6 +302,7 @@ public:
+ BOOL IsRangeNameInUse(SCROW nRow1, SCROW nRow2, USHORT nIndex) const;
void FindRangeNamesInUse(SCROW nRow1, SCROW nRow2, std::set<USHORT>& rIndexes) const;
- void ReplaceRangeNamesInUse( SCROW nRow1, SCROW nRow2, const ScIndexMap& rMap );
+ void ReplaceRangeNamesInUse( SCROW nRow1, SCROW nRow2, const ScIndexMap& rMap );
+ void ReplaceRangeNamesInUse( SCROW nRow1, SCROW nRow2, const ScRangeData::IndexMap& rMap );
- const SfxPoolItem* GetAttr( SCROW nRow, USHORT nWhich ) const;
- const ScPatternAttr* GetPattern( SCROW nRow ) const;
+ const SfxPoolItem* GetAttr( SCROW nRow, USHORT nWhich ) const;
+ const ScPatternAttr* GetPattern( SCROW nRow ) const;
diff --git sc/inc/document.hxx sc/inc/document.hxx
-index d8ce3a5..fbcca0d 100644
+index f392382..87a9343 100644
--- sc/inc/document.hxx
+++ sc/inc/document.hxx
@@ -138,6 +138,8 @@ class ScAutoNameCache;
@@ -147,42 +147,42 @@ index d8ce3a5..fbcca0d 100644
namespace com { namespace sun { namespace star {
namespace lang {
-@@ -289,6 +291,7 @@ private:
- ScFieldEditEngine* pCacheFieldEditEngine;
+@@ -286,6 +288,7 @@ private:
+ ScFieldEditEngine* pCacheFieldEditEngine;
::std::auto_ptr<ScDocProtection> pDocProtection;
+ ::std::auto_ptr<ScClipParam> mpClipParam;
::std::auto_ptr<ScExternalRefManager> pExternalRefMgr;
- String aDocName; // opt: Dokumentname
-@@ -311,7 +314,6 @@ private:
+ String aDocName; // opt: Dokumentname
+@@ -307,7 +310,6 @@ private:
sal_uInt32 nRangeOverflowType; // used in (xml) loading for overflow warnings
-- ScRange aClipRange;
- ScRange aEmbedRange;
- ScAddress aCurTextWidthCalcPos;
- ScAddress aOnlineSpellPos; // within whole document
-@@ -363,7 +365,6 @@ private:
- BOOL bForcedFormulaPending;
- BOOL bCalculatingFormulaTree;
- BOOL bIsClip;
-- BOOL bCutMode;
- BOOL bIsUndo;
- BOOL bIsVisible; // set from view ctor
-
-@@ -971,6 +972,9 @@ public:
+- ScRange aClipRange;
+ ScRange aEmbedRange;
+ ScAddress aCurTextWidthCalcPos;
+ ScAddress aOnlineSpellPos; // within whole document
+@@ -357,7 +359,6 @@ private:
+ BOOL bForcedFormulaPending;
+ BOOL bCalculatingFormulaTree;
+ BOOL bIsClip;
+- BOOL bCutMode;
+ BOOL bIsUndo;
+ BOOL bIsVisible; // set from view ctor
+
+@@ -957,6 +958,9 @@ public:
BOOL bKeepScenarioFlags = FALSE,
BOOL bIncludeObjects = FALSE,
BOOL bCloneNoteCaptions = TRUE);
+ void CopyToClip(const ScClipParam& rClipParam, ScDocument* pClipDoc,
+ const ScMarkData* pMarks = NULL, bool bKeepScenarioFlags = false,
+ bool bIncludeObjects = false, bool bCloneNoteCaptions = true);
- void CopyTabToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
- SCTAB nTab, ScDocument* pClipDoc = NULL);
- void CopyBlockFromClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
-@@ -998,6 +1002,12 @@ public:
- BOOL bSkipAttrForEmpty = FALSE,
+ void CopyTabToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
+ SCTAB nTab, ScDocument* pClipDoc = NULL);
+ void CopyBlockFromClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
+@@ -984,6 +988,12 @@ public:
+ BOOL bSkipAttrForEmpty = FALSE,
const ScRangeList * pDestRanges = NULL );
+ void CopyMultiRangeFromClip(const ScAddress& rDestPos, const ScMarkData& rMark,
@@ -191,35 +191,58 @@ index d8ce3a5..fbcca0d 100644
+ bool bIncludeFiltered = true,
+ bool bSkipAttrForEmpty = false);
+
- void GetClipArea(SCCOL& nClipX, SCROW& nClipY, BOOL bIncludeFiltered);
- void GetClipStart(SCCOL& nClipX, SCROW& nClipY);
+ void GetClipArea(SCCOL& nClipX, SCROW& nClipY, BOOL bIncludeFiltered);
+ void GetClipStart(SCCOL& nClipX, SCROW& nClipY);
-@@ -1007,6 +1017,9 @@ public:
+@@ -993,6 +1003,9 @@ public:
- SC_DLLPUBLIC void TransposeClip( ScDocument* pTransClip, USHORT nFlags, BOOL bAsLink );
+ SC_DLLPUBLIC void TransposeClip( ScDocument* pTransClip, USHORT nFlags, BOOL bAsLink );
+ ScClipParam& GetClipParam();
+ void SetClipParam(const ScClipParam& rParam);
+
- void MixDocument( const ScRange& rRange, USHORT nFunction, BOOL bSkipEmpty,
- ScDocument* pSrcDoc );
+ void MixDocument( const ScRange& rRange, USHORT nFunction, BOOL bSkipEmpty,
+ ScDocument* pSrcDoc );
-@@ -1732,6 +1745,13 @@ private: // CLOOK-Impl-Methoden
- void UpdateRefAreaLinks( UpdateRefMode eUpdateRefMode,
- const ScRange& r, SCsCOL nDx, SCsROW nDy, SCsTAB nDz );
+@@ -1692,6 +1705,23 @@ public:
+
+ private: // CLOOK-Impl-Methoden
+
++ /**
++ * Use this class as a locale variable to merge number formatter from
++ * another document, and set NULL pointer to pFormatExchangeList when
++ * done.
++ */
++ class NumFmtMergeHandler
++ {
++ public:
++ explicit NumFmtMergeHandler(ScDocument* pDoc, ScDocument* pSrcDoc);
++ ~NumFmtMergeHandler();
++
++ private:
++ ScDocument* mpDoc;
++ };
++
++ void MergeNumberFormatter(ScDocument* pSrcDoc);
++
+ void ImplCreateOptions(); // bei Gelegenheit auf on-demand umstellen?
+ void ImplDeleteOptions();
+
+@@ -1713,6 +1743,12 @@ private: // CLOOK-Impl-Methoden
+ void UpdateRefAreaLinks( UpdateRefMode eUpdateRefMode,
+ const ScRange& r, SCsCOL nDx, SCsROW nDy, SCsTAB nDz );
+ void CopyRangeNamesToClip(ScDocument* pClipDoc, const ScRange& rClipRange, const ScMarkData* pMarks, bool bAllTabs);
-+ void MergeNumberFormatterFromClip(ScDocument* pClipDoc);
+ void CopyRangeNamesFromClip(ScDocument* pClipDoc, ScClipRangeNameData& rRangeNames);
+ void UpdateRangeNamesInFormulas(
+ ScClipRangeNameData& rRangeNames, const ScRangeList& rDestRanges, const ScMarkData& rMark,
+ SCCOL nXw, SCROW nYw);
+
- BOOL HasPartOfMerged( const ScRange& rRange );
+ BOOL HasPartOfMerged( const ScRange& rRange );
- std::map< SCTAB, ScSortParam > mSheetSortParams;
+ std::map< SCTAB, ScSortParam > mSheetSortParams;
diff --git sc/inc/rangenam.hxx sc/inc/rangenam.hxx
-index c168b00..89830bf 100644
+index 8231cbd..ece1609 100644
--- sc/inc/rangenam.hxx
+++ sc/inc/rangenam.hxx
@@ -37,6 +37,8 @@
@@ -232,49 +255,49 @@ index c168b00..89830bf 100644
class ScDocument;
@@ -84,6 +86,8 @@ private:
- friend class ScRangeName;
- ScRangeData( USHORT nIndex );
+ friend class ScRangeName;
+ ScRangeData( USHORT nIndex );
public:
+ typedef ::std::map<sal_uInt16, sal_uInt16> IndexMap;
+
- SC_DLLPUBLIC ScRangeData( ScDocument* pDoc,
- const String& rName,
- const String& rSymbol,
+ SC_DLLPUBLIC ScRangeData( ScDocument* pDoc,
+ const String& rName,
+ const String& rSymbol,
@@ -150,6 +154,7 @@ public:
- void ValidateTabRefs();
+ void ValidateTabRefs();
- void ReplaceRangeNamesInUse( const ScIndexMap& rMap );
+ void ReplaceRangeNamesInUse( const ScIndexMap& rMap );
+ void ReplaceRangeNamesInUse( const IndexMap& rMap );
- static void MakeValidName( String& rName );
- SC_DLLPUBLIC static BOOL IsNameValid( const String& rName, ScDocument* pDoc );
+ static void MakeValidName( String& rName );
+ SC_DLLPUBLIC static BOOL IsNameValid( const String& rName, ScDocument* pDoc );
diff --git sc/inc/table.hxx sc/inc/table.hxx
-index 74b743f..93ef44e 100644
+index 734ad3c..b32bb64 100644
--- sc/inc/table.hxx
+++ sc/inc/table.hxx
-@@ -297,6 +297,8 @@ public:
- void DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, USHORT nDelFlag);
- void CopyToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScTable* pTable,
+@@ -292,6 +292,8 @@ public:
+ void DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, USHORT nDelFlag);
+ void CopyToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScTable* pTable,
BOOL bKeepScenarioFlags, BOOL bCloneNoteCaptions);
+ void CopyToClip(const ScRangeList& rRanges, ScTable* pTable,
+ bool bKeepScenarioFlags, bool bCloneNoteCaptions);
- void CopyFromClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCsCOL nDx, SCsROW nDy,
- USHORT nInsFlag, BOOL bAsLink, BOOL bSkipAttrForEmpty, ScTable* pTable);
- void StartListeningInArea( SCCOL nCol1, SCROW nRow1,
-@@ -410,6 +412,8 @@ public:
+ void CopyFromClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCsCOL nDx, SCsROW nDy,
+ USHORT nInsFlag, BOOL bAsLink, BOOL bSkipAttrForEmpty, ScTable* pTable);
+ void StartListeningInArea( SCCOL nCol1, SCROW nRow1,
+@@ -406,6 +408,8 @@ public:
std::set<USHORT>& rIndexes) const;
- void ReplaceRangeNamesInUse(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
- const ScIndexMap& rMap );
+ void ReplaceRangeNamesInUse(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
+ const ScIndexMap& rMap );
+ void ReplaceRangeNamesInUse(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
+ const ScRangeData::IndexMap& rMap );
- void Fill( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
- ULONG nFillCount, FillDir eFillDir, FillCmd eFillCmd, FillDateCmd eFillDateCmd,
- double nStepValue, double nMaxValue);
+ void Fill( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
+ ULONG nFillCount, FillDir eFillDir, FillCmd eFillCmd, FillDateCmd eFillDateCmd,
+ double nStepValue, double nMaxValue);
diff --git sc/source/core/data/cell2.cxx sc/source/core/data/cell2.cxx
-index ddd2bef..4c38b39 100644
+index 7e29ed7..c0c17ce 100644
--- sc/source/core/data/cell2.cxx
+++ sc/source/core/data/cell2.cxx
-@@ -1323,6 +1323,26 @@ void ScFormulaCell::ReplaceRangeNamesInUse( const ScIndexMap& rMap )
+@@ -1318,6 +1318,26 @@ void ScFormulaCell::ReplaceRangeNamesInUse( const ScIndexMap& rMap )
CompileTokenArray();
}
@@ -508,11 +531,11 @@ index 0000000..564b04d
+ ScRangeData::IndexMap::value_type(nOldIndex, nNewIndex));
+}
diff --git sc/source/core/data/column.cxx sc/source/core/data/column.cxx
-index c396a27..9e03b31 100644
+index 721a66f..555c3e8 100644
--- sc/source/core/data/column.cxx
+++ sc/source/core/data/column.cxx
-@@ -1917,6 +1917,23 @@ void ScColumn::ReplaceRangeNamesInUse(SCROW nRow1, SCROW nRow2,
- }
+@@ -1884,6 +1884,23 @@ void ScColumn::ReplaceRangeNamesInUse(SCROW nRow1, SCROW nRow2,
+ }
}
+void ScColumn::ReplaceRangeNamesInUse(SCROW nRow1, SCROW nRow2,
@@ -535,8 +558,10 @@ index c396a27..9e03b31 100644
void ScColumn::SetDirtyVar()
{
---- sc/source/core/data/documen2.cxx.old 2009-04-06 20:47:37.000000000 +0200
-+++ sc/source/core/data/documen2.cxx 2009-04-06 20:51:29.000000000 +0200
+diff --git sc/source/core/data/documen2.cxx sc/source/core/data/documen2.cxx
+index db40577..8894d1b 100644
+--- sc/source/core/data/documen2.cxx
++++ sc/source/core/data/documen2.cxx
@@ -95,6 +95,7 @@
#include "lookupcache.hxx"
#include "externalrefmgr.hxx"
@@ -545,27 +570,61 @@ index c396a27..9e03b31 100644
// pImpl because including lookupcache.hxx in document.hxx isn't wanted, and
// dtor plus helpers are convenient.
-@@ -153,6 +154,7 @@ ScDocument::ScDocument( ScDocumentMode e
- pScriptTypeData( NULL ),
+@@ -153,6 +154,7 @@ ScDocument::ScDocument( ScDocumentMode eMode,
+ pScriptTypeData( NULL ),
pCacheFieldEditEngine( NULL ),
pDocProtection( NULL ),
+ mpClipParam( NULL ),
pExternalRefMgr( NULL ),
- pViewOptions( NULL ),
- pDocOptions( NULL ),
-@@ -181,7 +183,6 @@ ScDocument::ScDocument( ScDocumentMode e
- bForcedFormulaPending( FALSE ),
- bCalculatingFormulaTree( FALSE ),
- bIsClip( eMode == SCDOCMODE_CLIP ),
-- bCutMode( FALSE ),
- bIsUndo( eMode == SCDOCMODE_UNDO ),
- bIsVisible( FALSE ),
- bIsEmbedded( FALSE ),
+ pViewOptions( NULL ),
+ pDocOptions( NULL ),
+@@ -181,7 +183,6 @@ ScDocument::ScDocument( ScDocumentMode eMode,
+ bForcedFormulaPending( FALSE ),
+ bCalculatingFormulaTree( FALSE ),
+ bIsClip( eMode == SCDOCMODE_CLIP ),
+- bCutMode( FALSE ),
+ bIsUndo( eMode == SCDOCMODE_UNDO ),
+ bIsVisible( FALSE ),
+ bIsEmbedded( FALSE ),
+@@ -978,23 +979,18 @@ ULONG ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos,
+ bOldAutoCalcSrc = pSrcDoc->GetAutoCalc();
+ pSrcDoc->SetAutoCalc( TRUE ); // falls was berechnet werden muss
+ }
+- SvNumberFormatter* pThisFormatter = xPoolHelper->GetFormTable();
+- SvNumberFormatter* pOtherFormatter = pSrcDoc->xPoolHelper->GetFormTable();
+- if (pOtherFormatter && pOtherFormatter != pThisFormatter)
++
+ {
+- SvNumberFormatterIndexTable* pExchangeList =
+- pThisFormatter->MergeFormatter(*(pOtherFormatter));
+- if (pExchangeList->Count() > 0)
+- pFormatExchangeList = pExchangeList;
+- }
+- nDestPos = Min(nDestPos, (SCTAB)(GetTableCount() - 1));
+- { // scope for bulk broadcast
+- ScBulkBroadcast aBulkBroadcast( pBASM);
+- pSrcDoc->pTab[nSrcPos]->CopyToTable(0, 0, MAXCOL, MAXROW,
+- ( bResultsOnly ? IDF_ALL & ~IDF_FORMULA : IDF_ALL),
+- FALSE, pTab[nDestPos] );
++ NumFmtMergeHandler aNumFmtMergeHdl(this, pSrcDoc);
++
++ nDestPos = Min(nDestPos, (SCTAB)(GetTableCount() - 1));
++ { // scope for bulk broadcast
++ ScBulkBroadcast aBulkBroadcast( pBASM);
++ pSrcDoc->pTab[nSrcPos]->CopyToTable(0, 0, MAXCOL, MAXROW,
++ ( bResultsOnly ? IDF_ALL & ~IDF_FORMULA : IDF_ALL),
++ FALSE, pTab[nDestPos] );
++ }
+ }
+- pFormatExchangeList = NULL;
+ pTab[nDestPos]->SetTabNo(nDestPos);
+
+ if ( !bResultsOnly )
diff --git sc/source/core/data/documen3.cxx sc/source/core/data/documen3.cxx
-index 071674b..60c8cd9 100644
+index 6143b5b..03267f7 100644
--- sc/source/core/data/documen3.cxx
+++ sc/source/core/data/documen3.cxx
-@@ -80,6 +80,7 @@
+@@ -79,6 +79,7 @@
#include "listenercalls.hxx"
#include "svtools/PasswordHelper.hxx"
#include "tabprotection.hxx"
@@ -573,29 +632,55 @@ index 071674b..60c8cd9 100644
#include <memory>
-@@ -868,7 +869,7 @@ void ScDocument::UpdateReference( UpdateRefMode eUpdateRefMode,
- {
- ScDocument* pClipDoc = SC_MOD()->GetClipDoc();
- if (pClipDoc)
-- pClipDoc->bCutMode = FALSE;
+@@ -890,7 +891,7 @@ void ScDocument::UpdateReference( UpdateRefMode eUpdateRefMode,
+ {
+ ScDocument* pClipDoc = SC_MOD()->GetClipDoc();
+ if (pClipDoc)
+- pClipDoc->bCutMode = FALSE;
+ pClipDoc->GetClipParam().mbCutMode = false;
- }
- }
+ }
+ }
}
-@@ -878,7 +879,10 @@ void ScDocument::UpdateTranspose( const ScAddress& rDestPos, ScDocument* pClipDo
+@@ -900,7 +901,10 @@ void ScDocument::UpdateTranspose( const ScAddress& rDestPos, ScDocument* pClipDo
{
- DBG_ASSERT(pClipDoc->bIsClip, "UpdateTranspose: kein Clip");
+ DBG_ASSERT(pClipDoc->bIsClip, "UpdateTranspose: kein Clip");
-- ScRange aSource = pClipDoc->aClipRange; // Tab wird noch angepasst
+- ScRange aSource = pClipDoc->aClipRange; // Tab wird noch angepasst
+ ScRange aSource;
+ ScClipParam& rClipParam = GetClipParam();
+ if (rClipParam.maRanges.Count())
+ aSource = *rClipParam.maRanges.First();
- ScAddress aDest = rDestPos;
+ ScAddress aDest = rDestPos;
+
+ SCTAB nClipTab = 0;
+diff --git sc/source/core/data/documen8.cxx sc/source/core/data/documen8.cxx
+index 2e617d7..8cd34a1 100644
+--- sc/source/core/data/documen8.cxx
++++ sc/source/core/data/documen8.cxx
+@@ -318,20 +318,8 @@ void ScDocument::ModifyStyleSheet( SfxStyleSheetBase& rStyleSheet,
+ void ScDocument::CopyStdStylesFrom( ScDocument* pSrcDoc )
+ {
+ // #b5017505# number format exchange list has to be handled here, too
+-
+- SvNumberFormatter* pThisFormatter = xPoolHelper->GetFormTable();
+- SvNumberFormatter* pOtherFormatter = pSrcDoc->xPoolHelper->GetFormTable();
+- if (pOtherFormatter && pOtherFormatter != pThisFormatter)
+- {
+- SvNumberFormatterIndexTable* pExchangeList =
+- pThisFormatter->MergeFormatter(*(pOtherFormatter));
+- if (pExchangeList->Count() > 0)
+- pFormatExchangeList = pExchangeList;
+- }
+-
++ NumFmtMergeHandler aNumFmtMergeHdl(this, pSrcDoc);
+ xPoolHelper->GetStylePool()->CopyStdStylesFrom( pSrcDoc->xPoolHelper->GetStylePool() );
+-
+- pFormatExchangeList = NULL;
+ }
- SCTAB nClipTab = 0;
+ //------------------------------------------------------------------------
diff --git sc/source/core/data/document.cxx sc/source/core/data/document.cxx
-index 6a97fb5..2df6897 100644
+index 4366571..e477781 100644
--- sc/source/core/data/document.cxx
+++ sc/source/core/data/document.cxx
@@ -94,6 +94,9 @@
@@ -608,74 +693,71 @@ index 6a97fb5..2df6897 100644
namespace WritingMode2 = ::com::sun::star::text::WritingMode2;
-@@ -1258,7 +1261,7 @@ void ScDocument::AddUndoTab( SCTAB nTab1, SCTAB nTab2, BOOL bColInfo, BOOL bRowI
+@@ -1214,7 +1217,7 @@ void ScDocument::AddUndoTab( SCTAB nTab1, SCTAB nTab2, BOOL bColInfo, BOOL bRowI
void ScDocument::SetCutMode( BOOL bVal )
{
- if (bIsClip)
-- bCutMode = bVal;
+ if (bIsClip)
+- bCutMode = bVal;
+ GetClipParam().mbCutMode = bVal;
- else
- {
- DBG_ERROR("SetCutMode without bIsClip");
-@@ -1269,7 +1272,7 @@ void ScDocument::SetCutMode( BOOL bVal )
+ else
+ {
+ DBG_ERROR("SetCutMode without bIsClip");
+@@ -1225,7 +1228,7 @@ void ScDocument::SetCutMode( BOOL bVal )
BOOL ScDocument::IsCutMode()
{
- if (bIsClip)
-- return bCutMode;
+ if (bIsClip)
+- return bCutMode;
+ return GetClipParam().mbCutMode;
- else
- {
- DBG_ERROR("IsCutMode ohne bIsClip");
-@@ -1400,33 +1403,16 @@ void ScDocument::CopyToClip(SCCOL nCol1, SCROW nRow1,
- pClipDoc = SC_MOD()->GetClipDoc();
- }
+ else
+ {
+ DBG_ERROR("IsCutMode ohne bIsClip");
+@@ -1356,33 +1359,16 @@ void ScDocument::CopyToClip(SCCOL nCol1, SCROW nRow1,
+ pClipDoc = SC_MOD()->GetClipDoc();
+ }
+ ScRange aClipRange(nCol1, nRow1, 0, nCol2, nRow2, 0);
+ ScClipParam& rClipParam = pClipDoc->GetClipParam();
+ rClipParam.maRanges.RemoveAll();
+ rClipParam.maRanges.Append(aClipRange);
- pClipDoc->aDocName = aDocName;
-- pClipDoc->aClipRange = ScRange( nCol1,nRow1,0, nCol2,nRow2,0 );
-- pClipDoc->ResetClip( this, pMarks );
-- USHORT i;
+ pClipDoc->aDocName = aDocName;
+- pClipDoc->aClipRange = ScRange( nCol1,nRow1,0, nCol2,nRow2,0 );
+ pClipDoc->ResetClip( this, pMarks );
+- USHORT i;
- SCTAB j;
--
+
- std::set<USHORT> aUsedNames; // indexes of named ranges that are used in the copied cells
- for (j = 0; j <= MAXTAB; j++)
- if (pTab[j] && pClipDoc->pTab[j])
- if ( bAllTabs || !pMarks || pMarks->GetTableSelect(j) )
- pTab[j]->FindRangeNamesInUse( nCol1, nRow1, nCol2, nRow2, aUsedNames );
--
-- pClipDoc->pRangeName->FreeAll();
-- for (i = 0; i < pRangeName->GetCount(); i++) //! DB-Bereiche Pivot-Bereiche auch !!!
-- {
-- USHORT nIndex = ((ScRangeData*)((*pRangeName)[i]))->GetIndex();
-- bool bInUse = ( aUsedNames.find(nIndex) != aUsedNames.end() );
-- if (bInUse)
-- {
-- ScRangeData* pData = new ScRangeData(*((*pRangeName)[i]));
-- if (!pClipDoc->pRangeName->Insert(pData))
-- delete pData;
-- else
-- pData->SetIndex(nIndex);
-- }
-- }
-- for (j = 0; j <= MAXTAB; j++)
-+ pClipDoc->ResetClip( this, pMarks );
-+
+ CopyRangeNamesToClip(pClipDoc, aClipRange, pMarks, bAllTabs);
-+
+
+- pClipDoc->pRangeName->FreeAll();
+- for (i = 0; i < pRangeName->GetCount(); i++) //! DB-Bereiche Pivot-Bereiche auch !!!
+- {
+- USHORT nIndex = ((ScRangeData*)((*pRangeName)[i]))->GetIndex();
+- bool bInUse = ( aUsedNames.find(nIndex) != aUsedNames.end() );
+- if (bInUse)
+- {
+- ScRangeData* pData = new ScRangeData(*((*pRangeName)[i]));
+- if (!pClipDoc->pRangeName->Insert(pData))
+- delete pData;
+- else
+- pData->SetIndex(nIndex);
+- }
+- }
+- for (j = 0; j <= MAXTAB; j++)
+ for (SCTAB j = 0; j <= MAXTAB; j++)
- if (pTab[j] && pClipDoc->pTab[j])
- if ( bAllTabs || !pMarks || pMarks->GetTableSelect(j) )
- {
-@@ -1441,10 +1427,53 @@ void ScDocument::CopyToClip(SCCOL nCol1, SCROW nRow1,
- }
- }
-
-- pClipDoc->bCutMode = bCut;
+ if (pTab[j] && pClipDoc->pTab[j])
+ if ( bAllTabs || !pMarks || pMarks->GetTableSelect(j) )
+ {
+@@ -1397,10 +1383,53 @@ void ScDocument::CopyToClip(SCCOL nCol1, SCROW nRow1,
+ }
+ }
+
+- pClipDoc->bCutMode = bCut;
+ pClipDoc->GetClipParam().mbCutMode = bCut;
- }
+ }
}
+void ScDocument::CopyToClip(const ScClipParam& rClipParam,
@@ -723,53 +805,53 @@ index 6a97fb5..2df6897 100644
+}
void ScDocument::CopyTabToClip(SCCOL nCol1, SCROW nRow1,
- SCCOL nCol2, SCROW nRow2,
-@@ -1460,14 +1486,16 @@ void ScDocument::CopyTabToClip(SCCOL nCol1, SCROW nRow1,
- pClipDoc = SC_MOD()->GetClipDoc();
- }
+ SCCOL nCol2, SCROW nRow2,
+@@ -1416,14 +1445,16 @@ void ScDocument::CopyTabToClip(SCCOL nCol1, SCROW nRow1,
+ pClipDoc = SC_MOD()->GetClipDoc();
+ }
+ ScClipParam& rClipParam = pClipDoc->GetClipParam();
- pClipDoc->aDocName = aDocName;
-- pClipDoc->aClipRange = ScRange( nCol1,nRow1,0, nCol2,nRow2,0 );
+ pClipDoc->aDocName = aDocName;
+- pClipDoc->aClipRange = ScRange( nCol1,nRow1,0, nCol2,nRow2,0 );
+ rClipParam.maRanges.RemoveAll();
+ rClipParam.maRanges.Append(ScRange(nCol1, nRow1, 0, nCol2, nRow2, 0));
- pClipDoc->ResetClip( this, nTab );
+ pClipDoc->ResetClip( this, nTab );
- if (pTab[nTab] && pClipDoc->pTab[nTab])
+ if (pTab[nTab] && pClipDoc->pTab[nTab])
pTab[nTab]->CopyToClip(nCol1, nRow1, nCol2, nRow2, pClipDoc->pTab[nTab], FALSE, TRUE);
-- pClipDoc->bCutMode = FALSE;
-+ pClipDoc->GetClipParam().mbCutMode = false;
- }
+- pClipDoc->bCutMode = FALSE;
++ pClipDoc->GetClipParam().mbCutMode = false;
+ }
}
-@@ -1497,6 +1525,7 @@ void ScDocument::TransposeClip( ScDocument* pTransClip, USHORT nFlags, BOOL bAsL
+@@ -1453,6 +1484,7 @@ void ScDocument::TransposeClip( ScDocument* pTransClip, USHORT nFlags, BOOL bAsL
- // Daten
+ // Daten
+ ScRange aClipRange = GetClipParam().getWholeRange();
- if ( ValidRow(aClipRange.aEnd.Row()-aClipRange.aStart.Row()) )
- {
- for (SCTAB i=0; i<=MAXTAB; i++)
-@@ -1525,10 +1554,8 @@ void ScDocument::TransposeClip( ScDocument* pTransClip, USHORT nFlags, BOOL bAsL
- }
- }
-
-- pTransClip->aClipRange = ScRange( 0, 0, aClipRange.aStart.Tab(),
+ if ( ValidRow(aClipRange.aEnd.Row()-aClipRange.aStart.Row()) )
+ {
+ for (SCTAB i=0; i<=MAXTAB; i++)
+@@ -1481,10 +1513,8 @@ void ScDocument::TransposeClip( ScDocument* pTransClip, USHORT nFlags, BOOL bAsL
+ }
+ }
+
+- pTransClip->aClipRange = ScRange( 0, 0, aClipRange.aStart.Tab(),
- static_cast<SCCOL>(aClipRange.aEnd.Row() - aClipRange.aStart.Row()),
- static_cast<SCROW>(aClipRange.aEnd.Col() - aClipRange.aStart.Col()),
-- aClipRange.aEnd.Tab() );
+- aClipRange.aEnd.Tab() );
+ pTransClip->SetClipParam(GetClipParam());
+ pTransClip->GetClipParam().transpose();
- }
- else
- {
-@@ -1537,9 +1564,173 @@ void ScDocument::TransposeClip( ScDocument* pTransClip, USHORT nFlags, BOOL bAsL
+ }
+ else
+ {
+@@ -1493,9 +1523,184 @@ void ScDocument::TransposeClip( ScDocument* pTransClip, USHORT nFlags, BOOL bAsL
- // Dies passiert erst beim Einfuegen...
+ // Dies passiert erst beim Einfuegen...
-- bCutMode = FALSE;
-+ GetClipParam().mbCutMode = false;
+- bCutMode = FALSE;
++ GetClipParam().mbCutMode = false;
+}
+
+void ScDocument::CopyRangeNamesToClip(ScDocument* pClipDoc, const ScRange& rClipRange, const ScMarkData* pMarks, bool bAllTabs)
@@ -798,10 +880,21 @@ index 6a97fb5..2df6897 100644
+ }
+}
+
-+void ScDocument::MergeNumberFormatterFromClip(ScDocument* pClipDoc)
++ScDocument::NumFmtMergeHandler::NumFmtMergeHandler(ScDocument* pDoc, ScDocument* pSrcDoc) :
++ mpDoc(pDoc)
++{
++ mpDoc->MergeNumberFormatter(pSrcDoc);
++}
++
++ScDocument::NumFmtMergeHandler::~NumFmtMergeHandler()
++{
++ mpDoc->pFormatExchangeList = NULL;
++}
++
++void ScDocument::MergeNumberFormatter(ScDocument* pSrcDoc)
+{
+ SvNumberFormatter* pThisFormatter = xPoolHelper->GetFormTable();
-+ SvNumberFormatter* pOtherFormatter = pClipDoc->xPoolHelper->GetFormTable();
++ SvNumberFormatter* pOtherFormatter = pSrcDoc->xPoolHelper->GetFormTable();
+ if (pOtherFormatter && pOtherFormatter != pThisFormatter)
+ {
+ SvNumberFormatterIndexTable* pExchangeList =
@@ -922,16 +1015,16 @@ index 6a97fb5..2df6897 100644
+ nR2 = Min((SCROW)(nR1 + nYw), nRow2);
+ } while (nR1 <= nRow2);
+ }
- }
-
++}
++
+ScClipParam& ScDocument::GetClipParam()
+{
+ if (!mpClipParam.get())
+ mpClipParam.reset(new ScClipParam);
+
+ return *mpClipParam;
-+}
-+
+ }
+
+void ScDocument::SetClipParam(const ScClipParam& rParam)
+{
+ mpClipParam.reset(new ScClipParam(rParam));
@@ -939,7 +1032,7 @@ index 6a97fb5..2df6897 100644
BOOL ScDocument::IsClipboardSource() const
{
-@@ -1639,7 +1830,7 @@ void ScDocument::CopyBlockFromClip( SCCOL nCol1, SCROW nRow1,
+@@ -1595,7 +1800,7 @@ void ScDocument::CopyBlockFromClip( SCCOL nCol1, SCROW nRow1,
&& ppClipTab[nClipTab + nFollow + 1] )
++nFollow;
@@ -948,89 +1041,89 @@ index 6a97fb5..2df6897 100644
{
BOOL bOldInserting = IsInsertingFromOtherDoc();
SetInsertingFromOtherDoc( TRUE);
-@@ -1681,7 +1872,9 @@ void ScDocument::CopyNonFilteredFromClip( SCCOL nCol1, SCROW nRow1,
+@@ -1637,7 +1842,9 @@ void ScDocument::CopyNonFilteredFromClip( SCCOL nCol1, SCROW nRow1,
pCBFCP->pClipDoc->GetRowFlagsArray( nFlagTab);
- SCROW nSourceRow = rClipStartRow;
-- SCROW nSourceEnd = pCBFCP->pClipDoc->aClipRange.aEnd.Row();
+ SCROW nSourceRow = rClipStartRow;
+- SCROW nSourceEnd = pCBFCP->pClipDoc->aClipRange.aEnd.Row();
+ SCROW nSourceEnd = 0;
+ if (pCBFCP->pClipDoc->GetClipParam().maRanges.Count())
+ nSourceEnd = pCBFCP->pClipDoc->GetClipParam().maRanges.First()->aEnd.Row();
- SCROW nDestRow = nRow1;
-
- while ( nSourceRow <= nSourceEnd && nDestRow <= nRow2 )
-@@ -1727,67 +1920,11 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar
- BOOL bOldAutoCalc = GetAutoCalc();
- SetAutoCalc( FALSE ); // avoid multiple recalculations
-
-- SvNumberFormatter* pThisFormatter = xPoolHelper->GetFormTable();
-- SvNumberFormatter* pOtherFormatter = pClipDoc->xPoolHelper->GetFormTable();
-- if (pOtherFormatter && pOtherFormatter != pThisFormatter)
-- {
-- SvNumberFormatterIndexTable* pExchangeList =
-- pThisFormatter->MergeFormatter(*(pOtherFormatter));
-- if (pExchangeList->Count() > 0)
-- pFormatExchangeList = pExchangeList;
-- }
-+ MergeNumberFormatterFromClip(pClipDoc);
-
-- USHORT nClipRangeNames = pClipDoc->pRangeName->GetCount();
-- // array containing range names which might need update of indices
-- ScRangeData** pClipRangeNames = nClipRangeNames ? new ScRangeData* [nClipRangeNames] : NULL;
-- // the index mapping thereof
-- ScIndexMap aClipRangeMap( nClipRangeNames );
-- BOOL bRangeNameReplace = FALSE;
+ SCROW nDestRow = nRow1;
+
+ while ( nSourceRow <= nSourceEnd && nDestRow <= nRow2 )
+@@ -1683,67 +1890,11 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar
+ BOOL bOldAutoCalc = GetAutoCalc();
+ SetAutoCalc( FALSE ); // avoid multiple recalculations
+
+- SvNumberFormatter* pThisFormatter = xPoolHelper->GetFormTable();
+- SvNumberFormatter* pOtherFormatter = pClipDoc->xPoolHelper->GetFormTable();
+- if (pOtherFormatter && pOtherFormatter != pThisFormatter)
+- {
+- SvNumberFormatterIndexTable* pExchangeList =
+- pThisFormatter->MergeFormatter(*(pOtherFormatter));
+- if (pExchangeList->Count() > 0)
+- pFormatExchangeList = pExchangeList;
+- }
++ NumFmtMergeHandler aNumFmtMergeHdl(this, pClipDoc);
+
+- USHORT nClipRangeNames = pClipDoc->pRangeName->GetCount();
+- // array containing range names which might need update of indices
+- ScRangeData** pClipRangeNames = nClipRangeNames ? new ScRangeData* [nClipRangeNames] : NULL;
+- // the index mapping thereof
+- ScIndexMap aClipRangeMap( nClipRangeNames );
+- BOOL bRangeNameReplace = FALSE;
+ ScClipRangeNameData aClipRangeNames;
+ CopyRangeNamesFromClip(pClipDoc, aClipRangeNames);
-- for (USHORT i = 0; i < nClipRangeNames; i++) //! DB-Bereiche Pivot-Bereiche auch
-- {
-- /* Copy only if the name doesn't exist in this document.
-- If it exists we use the already existing name instead,
-- another possibility could be to create new names if
-- documents differ.
-- A proper solution would ask the user how to proceed.
-- The adjustment of the indices in the formulas is done later.
-- */
+- for (USHORT i = 0; i < nClipRangeNames; i++) //! DB-Bereiche Pivot-Bereiche auch
+- {
+- /* Copy only if the name doesn't exist in this document.
+- If it exists we use the already existing name instead,
+- another possibility could be to create new names if
+- documents differ.
+- A proper solution would ask the user how to proceed.
+- The adjustment of the indices in the formulas is done later.
+- */
- ScRangeData* pClipRangeData = (*pClipDoc->pRangeName)[i];
- USHORT k;
- if ( pRangeName->SearchName( pClipRangeData->GetName(), k ) )
-- {
-- pClipRangeNames[i] = NULL; // range name not inserted
+- {
+- pClipRangeNames[i] = NULL; // range name not inserted
- USHORT nOldIndex = pClipRangeData->GetIndex();
-- USHORT nNewIndex = ((*pRangeName)[k])->GetIndex();
-- aClipRangeMap.SetPair( i, nOldIndex, nNewIndex );
-- if ( !bRangeNameReplace )
-- bRangeNameReplace = ( nOldIndex != nNewIndex );
-- }
-- else
-- {
+- USHORT nNewIndex = ((*pRangeName)[k])->GetIndex();
+- aClipRangeMap.SetPair( i, nOldIndex, nNewIndex );
+- if ( !bRangeNameReplace )
+- bRangeNameReplace = ( nOldIndex != nNewIndex );
+- }
+- else
+- {
- ScRangeData* pData = new ScRangeData( *pClipRangeData );
-- pData->SetDocument(this);
-- if ( pRangeName->FindIndex( pData->GetIndex() ) )
-- pData->SetIndex(0); // need new index, done in Insert
-- if ( pRangeName->Insert( pData ) )
-- {
-- pClipRangeNames[i] = pData;
+- pData->SetDocument(this);
+- if ( pRangeName->FindIndex( pData->GetIndex() ) )
+- pData->SetIndex(0); // need new index, done in Insert
+- if ( pRangeName->Insert( pData ) )
+- {
+- pClipRangeNames[i] = pData;
- USHORT nOldIndex = pClipRangeData->GetIndex();
-- USHORT nNewIndex = pData->GetIndex();
-- aClipRangeMap.SetPair( i, nOldIndex, nNewIndex );
-- if ( !bRangeNameReplace )
-- bRangeNameReplace = ( nOldIndex != nNewIndex );
-- }
-- else
-- { // must be an overflow
-- delete pData;
-- pClipRangeNames[i] = NULL;
+- USHORT nNewIndex = pData->GetIndex();
+- aClipRangeMap.SetPair( i, nOldIndex, nNewIndex );
+- if ( !bRangeNameReplace )
+- bRangeNameReplace = ( nOldIndex != nNewIndex );
+- }
+- else
+- { // must be an overflow
+- delete pData;
+- pClipRangeNames[i] = NULL;
- aClipRangeMap.SetPair( i, pClipRangeData->GetIndex(), 0 );
-- bRangeNameReplace = TRUE;
-- }
-- }
-- }
- SCCOL nAllCol1 = rDestRange.aStart.Col();
- SCROW nAllRow1 = rDestRange.aStart.Row();
- SCCOL nAllCol2 = rDestRange.aEnd.Col();
-@@ -1795,17 +1932,18 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar
+- bRangeNameReplace = TRUE;
+- }
+- }
+- }
+ SCCOL nAllCol1 = rDestRange.aStart.Col();
+ SCROW nAllRow1 = rDestRange.aStart.Row();
+ SCCOL nAllCol2 = rDestRange.aEnd.Col();
+@@ -1751,17 +1902,18 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar
SCCOL nXw = 0;
SCROW nYw = 0;
@@ -1055,9 +1148,9 @@ index 6a97fb5..2df6897 100644
if ( nThisEndX > nXw )
nXw = nThisEndX;
if ( nThisEndY > nYw )
-@@ -1864,10 +2002,10 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar
- if (bDoDouble)
- ScColumn::bDoubleAlloc = TRUE;
+@@ -1820,10 +1972,10 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar
+ if (bDoDouble)
+ ScColumn::bDoubleAlloc = TRUE;
- SCCOL nClipStartCol = pClipDoc->aClipRange.aStart.Col();
- SCROW nClipStartRow = pClipDoc->aClipRange.aStart.Row();
@@ -1069,7 +1162,7 @@ index 6a97fb5..2df6897 100644
for (ULONG nRange = 0; nRange < pDestRanges->Count(); ++nRange)
{
const ScRange* pRange = pDestRanges->GetObject( nRange);
-@@ -1918,7 +2056,7 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar
+@@ -1874,7 +2026,7 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar
nC2 = Min((SCCOL)(nC1 + nXw), nCol2);
} while (nC1 <= nCol2);
if (nClipStartRow > nClipEndRow)
@@ -1078,22 +1171,21 @@ index 6a97fb5..2df6897 100644
nC1 = nCol1;
nC2 = nC1 + nXw;
if (nC2 > nCol2)
-@@ -1934,76 +2072,118 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar
- if (pTab[k] && rMark.GetTableSelect(k))
- pTab[k]->DecRecalcLevel();
-
-- bInsertingFromOtherDoc = FALSE;
-- pFormatExchangeList = NULL;
-- if ( bRangeNameReplace )
-- {
-- // first update all inserted named formulas if they contain other
-- // range names and used indices changed
-- for (USHORT i = 0; i < nClipRangeNames; i++) //! DB-Bereiche Pivot-Bereiche auch
-- {
-- if ( pClipRangeNames[i] )
-- pClipRangeNames[i]->ReplaceRangeNamesInUse( aClipRangeMap );
-- }
-- // then update the formulas, they might need the just updated range names
+@@ -1891,75 +2043,120 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar
+ pTab[k]->DecRecalcLevel();
+
+ bInsertingFromOtherDoc = FALSE;
+- pFormatExchangeList = NULL;
+- if ( bRangeNameReplace )
+- {
+- // first update all inserted named formulas if they contain other
+- // range names and used indices changed
+- for (USHORT i = 0; i < nClipRangeNames; i++) //! DB-Bereiche Pivot-Bereiche auch
+- {
+- if ( pClipRangeNames[i] )
+- pClipRangeNames[i]->ReplaceRangeNamesInUse( aClipRangeMap );
+- }
+- // then update the formulas, they might need the just updated range names
- for (ULONG nRange = 0; nRange < pDestRanges->Count(); ++nRange)
- {
- const ScRange* pRange = pDestRanges->GetObject( nRange);
@@ -1131,24 +1223,22 @@ index 6a97fb5..2df6897 100644
- nR2 = Min((SCROW)(nR1 + nYw), nRow2);
- } while (nR1 <= nRow2);
- }
-- }
-- if ( pClipRangeNames )
-- delete [] pClipRangeNames;
-+ bInsertingFromOtherDoc = FALSE;
-+ pFormatExchangeList = NULL;
+- }
+- if ( pClipRangeNames )
+- delete [] pClipRangeNames;
+
+ UpdateRangeNamesInFormulas(aClipRangeNames, *pDestRanges, rMark, nXw, nYw);
+
- // Listener aufbauen nachdem alles inserted wurde
- StartListeningFromClip( nAllCol1, nAllRow1, nAllCol2, nAllRow2, rMark, nInsFlag );
- // nachdem alle Listener aufgebaut wurden, kann gebroadcastet werden
- BroadcastFromClip( nAllCol1, nAllRow1, nAllCol2, nAllRow2, rMark, nInsFlag );
- if (bResetCut)
-- pClipDoc->bCutMode = FALSE;
-+ pClipDoc->GetClipParam().mbCutMode = false;
- SetAutoCalc( bOldAutoCalc );
- }
- }
+ // Listener aufbauen nachdem alles inserted wurde
+ StartListeningFromClip( nAllCol1, nAllRow1, nAllCol2, nAllRow2, rMark, nInsFlag );
+ // nachdem alle Listener aufgebaut wurden, kann gebroadcastet werden
+ BroadcastFromClip( nAllCol1, nAllRow1, nAllCol2, nAllRow2, rMark, nInsFlag );
+ if (bResetCut)
+- pClipDoc->bCutMode = FALSE;
++ pClipDoc->GetClipParam().mbCutMode = false;
+ SetAutoCalc( bOldAutoCalc );
+ }
+ }
}
+void ScDocument::CopyMultiRangeFromClip(
@@ -1165,7 +1255,7 @@ index 6a97fb5..2df6897 100644
+ BOOL bOldAutoCalc = GetAutoCalc();
+ SetAutoCalc( FALSE ); // avoid multiple recalculations
+
-+ MergeNumberFormatterFromClip(pClipDoc);
++ NumFmtMergeHandler aNumFmtMergeHdl(this, pClipDoc);
+
+ ScClipRangeNameData aClipRangeNames;
+ CopyRangeNamesFromClip(pClipDoc, aClipRangeNames);
@@ -1196,6 +1286,8 @@ index 6a97fb5..2df6897 100644
+ }
+ }
+
++ bInsertingFromOtherDoc = TRUE; // kein Broadcast/Listener aufbauen bei Insert
++
+ if (!bSkipAttrForEmpty)
+ {
+ sal_uInt16 nDelFlag = IDF_CONTENTS;
@@ -1221,74 +1313,71 @@ index 6a97fb5..2df6897 100644
+ if (pTab[i] && rMark.GetTableSelect(i))
+ pTab[i]->DecRecalcLevel();
+
++ bInsertingFromOtherDoc = FALSE;
++
+ ScRange aDestRange(rDestPos.Col(), rDestPos.Row(), rDestPos.Tab(),
+ rDestPos.Col()+nCols-1, rDestPos.Row()+nRows-1, rDestPos.Tab());
+ ScRangeList aRanges;
+ aRanges.Append(aDestRange);
+ UpdateRangeNamesInFormulas(aClipRangeNames, aRanges, rMark, nCols-1, nRows-1);
+
-+ if (bResetCut)
-+ pClipDoc->GetClipParam().mbCutMode = false;
-+ SetAutoCalc( bOldAutoCalc );
-+
+ // Listener aufbauen nachdem alles inserted wurde
+ StartListeningFromClip(aDestRange.aStart.Col(), aDestRange.aStart.Row(),
+ aDestRange.aEnd.Col(), aDestRange.aEnd.Row(), rMark, nInsFlag );
+ // nachdem alle Listener aufgebaut wurden, kann gebroadcastet werden
+ BroadcastFromClip(aDestRange.aStart.Col(), aDestRange.aStart.Row(),
+ aDestRange.aEnd.Col(), aDestRange.aEnd.Row(), rMark, nInsFlag );
++
++ if (bResetCut)
++ pClipDoc->GetClipParam().mbCutMode = false;
++ SetAutoCalc( bOldAutoCalc );
+}
void ScDocument::SetClipArea( const ScRange& rArea, BOOL bCut )
{
- if (bIsClip)
- {
-- aClipRange = rArea;
-- bCutMode = bCut;
+ if (bIsClip)
+ {
+- aClipRange = rArea;
+- bCutMode = bCut;
+ ScClipParam& rClipParam = GetClipParam();
+ rClipParam.maRanges.RemoveAll();
+ rClipParam.maRanges.Append(rArea);
+ rClipParam.mbCutMode = bCut;
- }
- else
- {
-@@ -2014,34 +2194,54 @@ void ScDocument::SetClipArea( const ScRange& rArea, BOOL bCut )
+ }
+ else
+ {
+@@ -1970,33 +2167,53 @@ void ScDocument::SetClipArea( const ScRange& rArea, BOOL bCut )
void ScDocument::GetClipArea(SCCOL& nClipX, SCROW& nClipY, BOOL bIncludeFiltered)
{
-- if (bIsClip)
-- {
-- nClipX = aClipRange.aEnd.Col() - aClipRange.aStart.Col();
--
-- if ( bIncludeFiltered )
-- nClipY = aClipRange.aEnd.Row() - aClipRange.aStart.Row();
-- else
-- {
-- // count non-filtered rows
-- // count on first used table in clipboard
-- SCTAB nCountTab = 0;
-- while ( nCountTab < MAXTAB && !pTab[nCountTab] )
-- ++nCountTab;
+- if (bIsClip)
+- {
+- nClipX = aClipRange.aEnd.Col() - aClipRange.aStart.Col();
++ if (!bIsClip)
++ {
++ DBG_ERROR("GetClipArea: kein Clip");
++ return;
++ }
+
+- if ( bIncludeFiltered )
+- nClipY = aClipRange.aEnd.Row() - aClipRange.aStart.Row();
+- else
+- {
+- // count non-filtered rows
+- // count on first used table in clipboard
+- SCTAB nCountTab = 0;
+- while ( nCountTab < MAXTAB && !pTab[nCountTab] )
+- ++nCountTab;
-
- SCROW nResult = GetRowFlagsArray( nCountTab).CountForCondition(
- aClipRange.aStart.Row(), aClipRange.aEnd.Row(),
- CR_FILTERED, 0);
-
-- if ( nResult > 0 )
-- nClipY = nResult - 1;
-- else
-- nClipY = 0; // always return at least 1 row
-- }
-- }
-- else
-- {
-+ if (!bIsClip)
-+ {
- DBG_ERROR("GetClipArea: kein Clip");
-- }
-+ return;
-+ }
-+
+- if ( nResult > 0 )
+- nClipY = nResult - 1;
+- else
+- nClipY = 0; // always return at least 1 row
+- }
+ ScRangeList& rClipRanges = GetClipParam().maRanges;
+ if (!rClipRanges.Count())
+ // No clip range. Bail out.
@@ -1309,14 +1398,15 @@ index 6a97fb5..2df6897 100644
+ nEndCol = p->aEnd.Col();
+ if (p->aEnd.Row() < nEndRow)
+ nEndRow = p->aEnd.Row();
-+ }
+ }
+
+ nClipX = nEndCol - nStartCol;
+
+ if ( bIncludeFiltered )
+ nClipY = nEndRow - nStartRow;
-+ else
-+ {
+ else
+ {
+- DBG_ERROR("GetClipArea: kein Clip");
+ // count non-filtered rows
+ // count on first used table in clipboard
+ SCTAB nCountTab = 0;
@@ -1330,28 +1420,27 @@ index 6a97fb5..2df6897 100644
+ nClipY = nResult - 1;
+ else
+ nClipY = 0; // always return at least 1 row
-+ }
+ }
}
-
-@@ -2049,8 +2249,12 @@ void ScDocument::GetClipStart(SCCOL& nClipX, SCROW& nClipY)
+@@ -2005,8 +2222,12 @@ void ScDocument::GetClipStart(SCCOL& nClipX, SCROW& nClipY)
{
- if (bIsClip)
- {
-- nClipX = aClipRange.aStart.Col();
-- nClipY = aClipRange.aStart.Row();
+ if (bIsClip)
+ {
+- nClipX = aClipRange.aStart.Col();
+- nClipY = aClipRange.aStart.Row();
+ ScRangeList& rClipRanges = GetClipParam().maRanges;
+ if (rClipRanges.Count())
+ {
+ nClipX = rClipRanges.First()->aStart.Col();
+ nClipY = rClipRanges.First()->aStart.Row();
+ }
- }
- else
- {
-@@ -2066,8 +2270,12 @@ BOOL ScDocument::HasClipFilteredRows()
- while ( nCountTab < MAXTAB && !pTab[nCountTab] )
- ++nCountTab;
+ }
+ else
+ {
+@@ -2022,8 +2243,12 @@ BOOL ScDocument::HasClipFilteredRows()
+ while ( nCountTab < MAXTAB && !pTab[nCountTab] )
+ ++nCountTab;
- return GetRowFlagsArray( nCountTab).HasCondition( aClipRange.aStart.Row(),
- aClipRange.aEnd.Row(), CR_FILTERED, CR_FILTERED);
@@ -1365,23 +1454,23 @@ index 6a97fb5..2df6897 100644
diff --git sc/source/core/data/makefile.mk sc/source/core/data/makefile.mk
-index bd0ded7..2abd0d8 100644
+index 9dfc108..8440ee8 100644
--- sc/source/core/data/makefile.mk
+++ sc/source/core/data/makefile.mk
@@ -56,6 +56,7 @@ SLOFILES = \
- $(SLO)$/bcaslot.obj \
- $(SLO)$/cell.obj \
- $(SLO)$/cell2.obj \
+ $(SLO)$/bcaslot.obj \
+ $(SLO)$/cell.obj \
+ $(SLO)$/cell2.obj \
+ $(SLO)$/clipparam.obj \
- $(SLO)$/column.obj \
- $(SLO)$/column2.obj \
- $(SLO)$/column3.obj \
+ $(SLO)$/column.obj \
+ $(SLO)$/column2.obj \
+ $(SLO)$/column3.obj \
diff --git sc/source/core/data/table1.cxx sc/source/core/data/table1.cxx
-index d32c1d0..ddd1bbb 100644
+index 460abe1..3b2d3c5 100644
--- sc/source/core/data/table1.cxx
+++ sc/source/core/data/table1.cxx
-@@ -1310,6 +1310,16 @@ void ScTable::ReplaceRangeNamesInUse(SCCOL nCol1, SCROW nRow1,
- }
+@@ -1303,6 +1303,16 @@ void ScTable::ReplaceRangeNamesInUse(SCCOL nCol1, SCROW nRow1,
+ }
}
+void ScTable::ReplaceRangeNamesInUse(SCCOL nCol1, SCROW nRow1,
@@ -1398,11 +1487,11 @@ index d32c1d0..ddd1bbb 100644
SCCOL /* nStartCol */, SCROW nStartRow, SCCOL& rEndCol, SCROW nEndRow )
{
diff --git sc/source/core/data/table2.cxx sc/source/core/data/table2.cxx
-index 2f92042..b92cbf8 100644
+index eec97e2..0ef9cbb 100644
--- sc/source/core/data/table2.cxx
+++ sc/source/core/data/table2.cxx
@@ -367,6 +367,16 @@ void ScTable::CopyToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
- }
+ }
}
+void ScTable::CopyToClip(const ScRangeList& rRanges, ScTable* pTable,
@@ -1417,13 +1506,13 @@ index 2f92042..b92cbf8 100644
+}
void ScTable::CopyFromClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
- SCsCOL nDx, SCsROW nDy, USHORT nInsFlag,
+ SCsCOL nDx, SCsROW nDy, USHORT nInsFlag,
diff --git sc/source/core/tool/rangenam.cxx sc/source/core/tool/rangenam.cxx
-index d4864aa..b68d44d 100644
+index 6029663..d30a3d5 100644
--- sc/source/core/tool/rangenam.cxx
+++ sc/source/core/tool/rangenam.cxx
@@ -585,6 +585,31 @@ void ScRangeData::ReplaceRangeNamesInUse( const ScIndexMap& rMap )
- }
+ }
}
+void ScRangeData::ReplaceRangeNamesInUse( const IndexMap& rMap )
@@ -1455,35 +1544,37 @@ index d4864aa..b68d44d 100644
void ScRangeData::ValidateTabRefs()
{
diff --git sc/source/ui/inc/viewfunc.hxx sc/source/ui/inc/viewfunc.hxx
-index 051a705..3f99bde 100644
+index 17ad51a..f727fb4 100644
--- sc/source/ui/inc/viewfunc.hxx
+++ sc/source/ui/inc/viewfunc.hxx
-@@ -359,6 +359,11 @@ private:
- void PasteRTF( SCCOL nCol, SCROW nStartRow,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::datatransfer::XTransferable >& rxTransferable );
+@@ -354,6 +354,11 @@ private:
+ void PasteRTF( SCCOL nCol, SCROW nStartRow,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::datatransfer::XTransferable >& rxTransferable );
+ bool PasteMultiRangesFromClip( sal_uInt16 nFlags, ScDocument* pClipDoc, sal_uInt16 nFunction,
+ bool bSkipEmpty, bool bTranspos, bool bAsLink, bool bAllowDialogs,
+ InsCellCmd eMoveMode, sal_uInt16 nCondFlags, sal_uInt16 nUndoFlags );
+ void PostPasteFromClip(const ScRange& rPasteRange, const ScMarkData& rMark);
+
- USHORT GetOptimalColWidth( SCCOL nCol, SCTAB nTab, BOOL bFormula );
+ USHORT GetOptimalColWidth( SCCOL nCol, SCTAB nTab, BOOL bFormula );
- void StartFormatArea();
+ void StartFormatArea();
diff --git sc/source/ui/view/cellsh.cxx sc/source/ui/view/cellsh.cxx
-index 53e283c..3c047da 100644
+index ddfa8e9..e782dd2 100644
--- sc/source/ui/view/cellsh.cxx
+++ sc/source/ui/view/cellsh.cxx
@@ -206,7 +206,6 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
break;
- case SID_COPY: // Kopieren
-- bDisable = (!bSimpleArea && eMarkType != SC_MARK_SIMPLE_FILTERED);
- // nur wegen Matrix nicht editierbar? Matrix nicht zerreissen
- //! schlaegt nicht zu, wenn geschuetzt UND Matrix, aber damit
- //! muss man leben.. wird in Copy-Routine abgefangen, sonst
---- sc/source/ui/view/cellsh1.cxx.old 2009-04-06 20:47:37.000000000 +0200
-+++ sc/source/ui/view/cellsh1.cxx 2009-04-06 20:51:29.000000000 +0200
+ case SID_COPY: // Kopieren
+- bDisable = (!bSimpleArea && eMarkType != SC_MARK_SIMPLE_FILTERED);
+ // nur wegen Matrix nicht editierbar? Matrix nicht zerreissen
+ //! schlaegt nicht zu, wenn geschuetzt UND Matrix, aber damit
+ //! muss man leben.. wird in Copy-Routine abgefangen, sonst
+diff --git sc/source/ui/view/cellsh1.cxx sc/source/ui/view/cellsh1.cxx
+index e297ee8..dfb2928 100644
+--- sc/source/ui/view/cellsh1.cxx
++++ sc/source/ui/view/cellsh1.cxx
@@ -104,6 +104,7 @@
#include "dpsave.hxx"
#include "dpgroup.hxx" // for ScDPNumGroupInfo
@@ -1492,7 +1583,7 @@ index 53e283c..3c047da 100644
#include "globstr.hrc"
#include "scui_def.hxx" //CHINA001
-@@ -2251,7 +2252,13 @@ void ScCellShell::PasteFromClipboard( Sc
+@@ -2243,7 +2244,13 @@ void ScCellShell::PasteFromClipboard( ScViewData* pViewData, ScTabViewShell* pTa
pTabViewShell->PasteFromSystem();
else
{
@@ -1508,20 +1599,20 @@ index 53e283c..3c047da 100644
bShowDialog ); // allow warning dialog
}
diff --git sc/source/ui/view/tabvwsh4.cxx sc/source/ui/view/tabvwsh4.cxx
-index 551ce8a..3d49c52 100644
+index 4d3dfc1..0e76555 100644
--- sc/source/ui/view/tabvwsh4.cxx
+++ sc/source/ui/view/tabvwsh4.cxx
-@@ -1513,7 +1513,7 @@ BOOL ScTabViewShell::TabKeyInput(const KeyEvent& rKEvt)
- // #51889# Spezialfall: Copy/Cut bei Mehrfachselektion -> Fehlermeldung
- // (Slot ist disabled, SfxViewShell::KeyInput wuerde also kommentarlos verschluckt)
- KeyFuncType eFunc = aCode.GetFunction();
-- if ( eFunc == KEYFUNC_COPY || eFunc == KEYFUNC_CUT )
+@@ -1506,7 +1506,7 @@ BOOL ScTabViewShell::TabKeyInput(const KeyEvent& rKEvt)
+ // #51889# Spezialfall: Copy/Cut bei Mehrfachselektion -> Fehlermeldung
+ // (Slot ist disabled, SfxViewShell::KeyInput wuerde also kommentarlos verschluckt)
+ KeyFuncType eFunc = aCode.GetFunction();
+- if ( eFunc == KEYFUNC_COPY || eFunc == KEYFUNC_CUT )
+ if ( eFunc == KEYFUNC_CUT )
- {
- ScRange aDummy;
- ScMarkType eMarkType = GetViewData()->GetSimpleArea( aDummy );
+ {
+ ScRange aDummy;
+ ScMarkType eMarkType = GetViewData()->GetSimpleArea( aDummy );
diff --git sc/source/ui/view/viewfun3.cxx sc/source/ui/view/viewfun3.cxx
-index a675074..3f5e578 100644
+index 0a97b2a..31fca76 100644
--- sc/source/ui/view/viewfun3.cxx
+++ sc/source/ui/view/viewfun3.cxx
@@ -210,6 +210,7 @@
@@ -1534,21 +1625,21 @@ index a675074..3f5e578 100644
@@ -310,10 +311,10 @@ BOOL ScViewFunc::CopyToClip( ScDocument* pClipDoc, BOOL bCut, BOOL bApi, BOOL bI
- ScRange aRange;
- ScMarkType eMarkType = GetViewData()->GetSimpleArea( aRange );
+ ScRange aRange;
+ ScMarkType eMarkType = GetViewData()->GetSimpleArea( aRange );
+ ScDocument* pDoc = GetViewData()->GetDocument();
+ ScMarkData& rMark = GetViewData()->GetMarkData();
- if ( eMarkType == SC_MARK_SIMPLE || eMarkType == SC_MARK_SIMPLE_FILTERED )
- {
-- ScDocument* pDoc = GetViewData()->GetDocument();
-- ScMarkData& rMark = GetViewData()->GetMarkData();
- if ( !pDoc->HasSelectedBlockMatrixFragment(
- aRange.aStart.Col(), aRange.aStart.Row(),
- aRange.aEnd.Col(), aRange.aEnd.Row(),
-@@ -380,10 +381,126 @@ BOOL ScViewFunc::CopyToClip( ScDocument* pClipDoc, BOOL bCut, BOOL bApi, BOOL bI
- ErrorMessage(STR_MATRIXFRAGMENTERR);
- }
- }
+ if ( eMarkType == SC_MARK_SIMPLE || eMarkType == SC_MARK_SIMPLE_FILTERED )
+ {
+- ScDocument* pDoc = GetViewData()->GetDocument();
+- ScMarkData& rMark = GetViewData()->GetMarkData();
+ if ( !pDoc->HasSelectedBlockMatrixFragment(
+ aRange.aStart.Col(), aRange.aStart.Row(),
+ aRange.aEnd.Col(), aRange.aEnd.Row(),
+@@ -380,6 +381,122 @@ BOOL ScViewFunc::CopyToClip( ScDocument* pClipDoc, BOOL bCut, BOOL bApi, BOOL bI
+ ErrorMessage(STR_MATRIXFRAGMENTERR);
+ }
+ }
+ else if (eMarkType == SC_MARK_MULTI)
+ {
+ bool bSuccess = false;
@@ -1665,15 +1756,9 @@ index a675074..3f5e578 100644
+
+ bDone = bSuccess;
+ }
- else
- {
-- if (!bApi)
-- ErrorMessage(STR_NOMULTISELECT);
-+ if (!bApi)
-+ ErrorMessage(STR_NOMULTISELECT);
- }
-
- return bDone;
+ else
+ {
+ if (!bApi)
@@ -743,6 +860,52 @@ BOOL lcl_SelHasAttrib( ScDocument* pDoc, SCCOL nCol1, SCROW nRow1, SCCOL nCol2,
// internes Paste
@@ -1725,8 +1810,8 @@ index a675074..3f5e578 100644
+}
+
BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
- USHORT nFunction, BOOL bSkipEmpty,
- BOOL bTranspose, BOOL bAsLink,
+ USHORT nFunction, BOOL bSkipEmpty,
+ BOOL bTranspose, BOOL bAsLink,
@@ -768,6 +931,12 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
// do not copy note captions into undo document
nUndoFlags |= IDF_NOCAPTIONS;
@@ -1737,40 +1822,40 @@ index a675074..3f5e578 100644
+ nFlags, pClipDoc, nFunction, bSkipEmpty, bTranspose, bAsLink, bAllowDialogs,
+ eMoveMode, nContFlags, nUndoFlags);
+
- BOOL bCutMode = pClipDoc->IsCutMode(); // if transposing, take from original clipdoc
- BOOL bIncludeFiltered = bCutMode;
+ BOOL bCutMode = pClipDoc->IsCutMode(); // if transposing, take from original clipdoc
+ BOOL bIncludeFiltered = bCutMode;
@@ -996,23 +1165,8 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
- SC_MOD()->GetInputOptions().GetReplaceCellsWarn();
- if ( bAskIfNotEmpty )
- {
-- BOOL bIsEmpty = TRUE;
-- SCTAB nTabCount = pDoc->GetTableCount();
-- for (SCTAB nTab=0; nTab<nTabCount && bIsEmpty; nTab++)
-- if ( aFilteredMark.GetTableSelect(nTab) &&
-- !pDoc->IsBlockEmpty( nTab, aUserRange.aStart.Col(), aUserRange.aStart.Row(),
-- aUserRange.aEnd.Col(), aUserRange.aEnd.Row() ) )
-- bIsEmpty = FALSE;
+ SC_MOD()->GetInputOptions().GetReplaceCellsWarn();
+ if ( bAskIfNotEmpty )
+ {
+- BOOL bIsEmpty = TRUE;
+- SCTAB nTabCount = pDoc->GetTableCount();
+- for (SCTAB nTab=0; nTab<nTabCount && bIsEmpty; nTab++)
+- if ( aFilteredMark.GetTableSelect(nTab) &&
+- !pDoc->IsBlockEmpty( nTab, aUserRange.aStart.Col(), aUserRange.aStart.Row(),
+- aUserRange.aEnd.Col(), aUserRange.aEnd.Row() ) )
+- bIsEmpty = FALSE;
-
-- if ( !bIsEmpty )
-- {
-- ScReplaceWarnBox aBox( GetViewData()->GetDialogParent() );
-- if ( aBox.Execute() != RET_YES )
-- {
-- // changing the configuration is within the ScReplaceWarnBox
-- return FALSE;
-- }
-- }
+- if ( !bIsEmpty )
+- {
+- ScReplaceWarnBox aBox( GetViewData()->GetDialogParent() );
+- if ( aBox.Execute() != RET_YES )
+- {
+- // changing the configuration is within the ScReplaceWarnBox
+- return FALSE;
+- }
+- }
+ if (!lcl_checkDestRangeForOverwrite(aUserRange, pDoc, aFilteredMark, GetViewData()->GetDialogParent()))
+ return false;
- }
- }
+ }
+ }
-@@ -1298,9 +1452,173 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
- // AdjustBlockHeight has already been called above
+@@ -1281,7 +1435,171 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
+ // AdjustBlockHeight has already been called above
- aModificator.SetDocumentModified();
-- pDocSh->UpdateOle(GetViewData());
+ aModificator.SetDocumentModified();
+- pDocSh->UpdateOle(GetViewData());
+ PostPasteFromClip(aUserRange, rMark);
+ return TRUE;
+}
@@ -1825,8 +1910,7 @@ index a675074..3f5e578 100644
+ // the clip size.
+ ScRange aMarkedRange(rCurPos.Col(), rCurPos.Row(), nTab1,
+ rCurPos.Col()+nColSize-1, rCurPos.Row()+nRowSize-1, nTab2);
-
-- SelectionChanged();
++
+ bool bAskIfNotEmpty =
+ bAllowDialogs && (nFlags & IDF_CONTENTS) &&
+ nFunction == PASTE_NOFUNC && SC_MOD()->GetInputOptions().GetReplaceCellsWarn();
@@ -1937,12 +2021,10 @@ index a675074..3f5e578 100644
+ ScDocShell* pDocSh = pViewData->GetDocShell();
+ ScDocument* pDoc = pViewData->GetDocument();
+ pDocSh->UpdateOle(pViewData);
-+
-+ SelectionChanged();
- // #i97876# Spreadsheet data changes are not notified
- ScModelObj* pModelObj = ScModelObj::getImplementation( pDocSh->GetModel() );
-@@ -1312,7 +1630,7 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
+ SelectionChanged();
+
+@@ -1295,7 +1613,7 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
{
if ( rMark.GetTableSelect( i ) )
{
@@ -1951,15 +2033,12 @@ index a675074..3f5e578 100644
aChangeRange.aStart.SetTab( i );
aChangeRange.aEnd.SetTab( i );
aChangeRanges.Append( aChangeRange );
-@@ -1320,11 +1638,8 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
+@@ -1303,8 +1621,6 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
}
pModelObj->NotifyChanges( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "cell-change" ) ), aChangeRanges );
}
-
-- return TRUE;
+- return TRUE;
}
--
- //----------------------------------------------------------------------------
- // D R A G A N D D R O P
- //
+
More information about the ooo-build-commit
mailing list