diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-02-18 16:45:02 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-02-18 16:51:18 -0500 |
commit | cdc8ebf9646e773351c91039a62f2414c7b02105 (patch) | |
tree | ed0cedf4dc04dd347293d4e40a04bb997c218fdb /sc/source/core/data/clipcontext.cxx | |
parent | 3c7b65c171eeade3272cc766b813b99a35a6ef7d (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.
Change-Id: Ia8a2cbe57cd2fa9ca9ad46635a91a1d8b99b0e7d
Diffstat (limited to 'sc/source/core/data/clipcontext.cxx')
-rw-r--r-- | sc/source/core/data/clipcontext.cxx | 58 |
1 files changed, 55 insertions, 3 deletions
diff --git a/sc/source/core/data/clipcontext.cxx b/sc/source/core/data/clipcontext.cxx index 35cde4e18161..c70d9d48de2b 100644 --- a/sc/source/core/data/clipcontext.cxx +++ b/sc/source/core/data/clipcontext.cxx @@ -31,11 +31,15 @@ CopyFromClipContext::CopyFromClipContext(ScDocument& rDoc, ScDocument* pRefUndoDoc, ScDocument* pClipDoc, sal_uInt16 nInsertFlag, bool bAsLink, bool bSkipAttrForEmptyCells) : ClipContextBase(rDoc), + mnDestCol1(-1), mnDestCol2(-1), + mnDestRow1(-1), mnDestRow2(-1), mnTabStart(-1), mnTabEnd(-1), - mpRefUndoDoc(pRefUndoDoc), mpClipDoc(pClipDoc), mnInsertFlag(nInsertFlag), - mpSinglePattern(NULL), mpSingleNote(NULL), + mpRefUndoDoc(pRefUndoDoc), mpClipDoc(pClipDoc), + mnInsertFlag(nInsertFlag), mnDeleteFlag(IDF_NONE), + mpCondFormatList(NULL), mpSinglePattern(NULL), mpSingleNote(NULL), mbAsLink(bAsLink), mbSkipAttrForEmptyCells(bSkipAttrForEmptyCells), - mbCloneNotes (mnInsertFlag & (IDF_NOTE|IDF_ADDNOTES)) + mbCloneNotes (mnInsertFlag & (IDF_NOTE|IDF_ADDNOTES)), + mbTableProtected(false) { } @@ -59,6 +63,24 @@ SCTAB CopyFromClipContext::getTabEnd() const return mnTabEnd; } +void CopyFromClipContext::setDestRange( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ) +{ + mnDestCol1 = nCol1; + mnDestRow1 = nRow1; + mnDestCol2 = nCol2; + mnDestRow2 = nRow2; +} + +CopyFromClipContext::Range CopyFromClipContext::getDestRange() const +{ + Range aRet; + aRet.mnCol1 = mnDestCol1; + aRet.mnCol2 = mnDestCol2; + aRet.mnRow1 = mnDestRow1; + aRet.mnRow2 = mnDestRow2; + return aRet; +} + ScDocument* CopyFromClipContext::getUndoDoc() { return mpRefUndoDoc; @@ -74,11 +96,31 @@ sal_uInt16 CopyFromClipContext::getInsertFlag() const return mnInsertFlag; } +void CopyFromClipContext::setDeleteFlag( sal_uInt16 nFlag ) +{ + mnDeleteFlag = nFlag; +} + +sal_uInt16 CopyFromClipContext::getDeleteFlag() const +{ + return mnDeleteFlag; +} + ScCellValue& CopyFromClipContext::getSingleCell() { return maSingleCell; } +void CopyFromClipContext::setCondFormatList( ScConditionalFormatList* pCondFormatList ) +{ + mpCondFormatList = pCondFormatList; +} + +ScConditionalFormatList* CopyFromClipContext::getCondFormatList() +{ + return mpCondFormatList; +} + const ScPatternAttr* CopyFromClipContext::getSingleCellPattern() const { return mpSinglePattern; @@ -99,6 +141,16 @@ void CopyFromClipContext::setSingleCellNote( const ScPostIt* pNote ) mpSingleNote = pNote; } +void CopyFromClipContext::setTableProtected( bool b ) +{ + mbTableProtected = b; +} + +bool CopyFromClipContext::isTableProtected() const +{ + return mbTableProtected; +} + bool CopyFromClipContext::isAsLink() const { return mbAsLink; |