summaryrefslogtreecommitdiff
path: root/sc/inc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-02-06 14:11:43 -0500
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-02-25 23:01:23 -0600
commit166e2775d80b7e45ab258a4175d7b9e8a15a5dba (patch)
treef576c3595ead02daa6cc2c8721efee64c6760078 /sc/inc
parent5a13bf7bc741aeb7543b9ff736563b89c086d4fd (diff)
fdo#74573: Delete ranges that are non-empty before pasting from clipboard.
The conditional formatting part is still not working. But other bits appear to be working now. Also, adjust handling of mix document aka paste functions with this change. When using paste function (add, subtract, etc), the behavior between the 'skip empty' flag on and off makes no difference. Let's set the flag to off when paste function is used. (cherry picked from commit 0c12aa670b83b76241077dfb8bc21f40a55b1667) (cherry picked from commit 2f55cee39379a76920f3a4fb14e6c2774093bfcd) (cherry picked from commit cdc8ebf9646e773351c91039a62f2414c7b02105) Conflicts: sc/inc/clipcontext.hxx sc/inc/column.hxx sc/inc/document.hxx sc/inc/table.hxx sc/source/core/data/clipcontext.cxx sc/source/core/data/column4.cxx sc/source/core/data/document10.cxx sc/source/core/data/table7.cxx Change-Id: I67724ba923c9260b2c14464e4123b8445712dbaf Reviewed-on: https://gerrit.libreoffice.org/7906 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc/inc')
-rw-r--r--sc/inc/clipcontext.hxx40
-rw-r--r--sc/inc/column.hxx6
-rw-r--r--sc/inc/document.hxx2
-rw-r--r--sc/inc/table.hxx2
4 files changed, 45 insertions, 5 deletions
diff --git a/sc/inc/clipcontext.hxx b/sc/inc/clipcontext.hxx
index dd63ba6c36c6..dca1fedcd1fd 100644
--- a/sc/inc/clipcontext.hxx
+++ b/sc/inc/clipcontext.hxx
@@ -18,6 +18,7 @@
#include <boost/scoped_ptr.hpp>
class ScDocument;
+class ScConditionalFormatList;
namespace sc {
@@ -39,18 +40,34 @@ public:
class CopyFromClipContext : public ClipContextBase
{
+ SCCOL mnDestCol1;
+ SCCOL mnDestCol2;
+ SCROW mnDestRow1;
+ SCROW mnDestRow2;
SCTAB mnTabStart;
SCTAB mnTabEnd;
ScDocument* mpRefUndoDoc;
ScDocument* mpClipDoc;
- sal_uInt16 mnInsertFlag;
- bool mbAsLink:1;
- bool mbSkipAttrForEmptyCells:1;
- bool mbCloneNotes;
+ sal_uInt16 mnInsertFlag;
+ sal_uInt16 mnDeleteFlag;
+ ScConditionalFormatList* mpCondFormatList;
+ bool mbAsLink:1;
+ bool mbSkipAttrForEmptyCells:1;
+ bool mbCloneNotes;
+ bool mbTableProtected:1;
CopyFromClipContext(); // disabled
public:
+
+ struct Range
+ {
+ SCCOL mnCol1;
+ SCCOL mnCol2;
+ SCROW mnRow1;
+ SCROW mnRow2;
+ };
+
CopyFromClipContext(ScDocument& rDoc,
ScDocument* pRefUndoDoc, ScDocument* pClipDoc, sal_uInt16 nInsertFlag,
bool bAsLink, bool bSkipAttrForEmptyCells);
@@ -62,12 +79,25 @@ public:
SCTAB getTabStart() const;
SCTAB getTabEnd() const;
+ void setDestRange( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
+ Range getDestRange() const;
+
ScDocument* getUndoDoc();
ScDocument* getClipDoc();
sal_uInt16 getInsertFlag() const;
+
+ void setDeleteFlag( sal_uInt16 nFlag );
+ sal_uInt16 getDeleteFlag() const;
+
+ void setCondFormatList( ScConditionalFormatList* pCondFormatList );
+ ScConditionalFormatList* getCondFormatList();
+
+ void setTableProtected( bool b );
+ bool isTableProtected() const;
+
bool isAsLink() const;
bool isSkipAttrForEmptyCells() const;
- bool isCloneNotes() const;
+ bool isCloneNotes() const;
};
class CopyToClipContext : public ClipContextBase
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 529f84fff22b..07da1ca16a89 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -224,6 +224,9 @@ public:
void CopyCellToDocument( SCROW nSrcRow, SCROW nDestRow, ScColumn& rDestCol );
bool InitBlockPosition( sc::ColumnBlockPosition& rBlockPos );
bool InitBlockPosition( sc::ColumnBlockConstPosition& rBlockPos ) const;
+
+ void DeleteBeforeCopyFromClip( sc::CopyFromClipContext& rCxt, const ScColumn& rClipCol );
+
void CopyFromClip(
sc::CopyFromClipContext& rCxt, SCROW nRow1, SCROW nRow2, long nDy, ScColumn& rColumn );
@@ -571,6 +574,9 @@ private:
// cell notes
void SwapCellNotes( SCROW nRow1, SCROW nRow2 );
+ void DeleteCells(
+ sc::ColumnBlockPosition& rBlockPos, SCROW nRow1, SCROW nRow2, sal_uInt16 nDelFlag,
+ std::vector<SCROW>& rDeleted );
};
#endif
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 3ac1089be1bf..f26c3c7395fb 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1202,6 +1202,8 @@ public:
bool InitColumnBlockPosition( sc::ColumnBlockPosition& rBlokPos, SCTAB nTab, SCCOL nCol );
+ void DeleteBeforeCopyFromClip( sc::CopyFromClipContext& rCxt, const ScMarkData& rMark );
+
void CopyBlockFromClip(
sc::CopyFromClipContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
const ScMarkData& rMark, SCsCOL nDx, SCsROW nDy );
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index f6164ced3330..4aab32e5d298 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -411,6 +411,8 @@ public:
bool InitColumnBlockPosition( sc::ColumnBlockPosition& rBlockPos, SCCOL nCol );
+ void DeleteBeforeCopyFromClip( sc::CopyFromClipContext& rCxt, const ScTable& rClipTab );
+
void CopyFromClip(
sc::CopyFromClipContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
SCsCOL nDx, SCsROW nDy, ScTable* pTable );