diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2010-12-21 13:18:13 -0500 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2010-12-21 13:18:13 -0500 |
commit | 8b7d7543b6f94602b468c888cf19753f4c26383a (patch) | |
tree | ece9d4ab6c9e830c1b3a89d40a1eea721d58db9c /sc | |
parent | 3529474954bedb59a455c55dd62755e6d8b362b5 (diff) |
Oops. We can't bail out earlier than that, it seems.
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/viewfun3.cxx | 72 |
1 files changed, 37 insertions, 35 deletions
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index 426e6b35d..e5acd2130 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -1042,46 +1042,48 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc, bool bNoPaste = ((eMarkType != SC_MARK_SIMPLE && !bMarkIsFiltered) || (bMarkIsFiltered && (eMoveMode != INS_NONE || bAsLink))); - if (bNoPaste) + if (!bNoPaste) { - // Exit early when we don't want to perform pasting. - ErrorMessage(STR_MSSG_PASTEFROMCLIP_0); - return FALSE; - } - - if (!rMark.IsMarked()) - { - // Create a selection with clipboard row count and check that for - // filtered. - nStartCol = GetViewData()->GetCurX(); - nStartRow = GetViewData()->GetCurY(); - nStartTab = GetViewData()->GetTabNo(); - nEndCol = nStartCol + nDestSizeX; - nEndRow = nStartRow + nDestSizeY; - nEndTab = nStartTab; - aMarkRange = ScRange( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab); - if (ScViewUtil::HasFiltered( aMarkRange, pDoc)) + if (!rMark.IsMarked()) + { + // Create a selection with clipboard row count and check that for + // filtered. + nStartCol = GetViewData()->GetCurX(); + nStartRow = GetViewData()->GetCurY(); + nStartTab = GetViewData()->GetTabNo(); + nEndCol = nStartCol + nDestSizeX; + nEndRow = nStartRow + nDestSizeY; + nEndTab = nStartTab; + aMarkRange = ScRange( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab); + if (ScViewUtil::HasFiltered( aMarkRange, pDoc)) + { + bMarkIsFiltered = true; + // Fit to clipboard's row count unfiltered rows. If there is no + // fit assume that pasting is not possible. Note that nDestSizeY is + // size-1 (difference). + if (!ScViewUtil::FitToUnfilteredRows( aMarkRange, pDoc, nDestSizeY+1)) + bNoPaste = true; + } + aFilteredMark.SetMarkArea( aMarkRange); + } + else { - bMarkIsFiltered = true; - // Fit to clipboard's row count unfiltered rows. If there is no - // fit assume that pasting is not possible. Note that nDestSizeY is - // size-1 (difference). - if (!ScViewUtil::FitToUnfilteredRows( aMarkRange, pDoc, nDestSizeY+1)) - bNoPaste = true; + // Expand the marked area when the destination area is larger than the + // current selection, to get the undo do the right thing. (i#106711) + ScRange aRange; + aFilteredMark.GetMarkArea( aRange ); + if( (aRange.aEnd.Col() - aRange.aStart.Col()) < nDestSizeX ) + { + aRange.aEnd.SetCol(aRange.aStart.Col() + nDestSizeX); + aFilteredMark.SetMarkArea(aRange); + } } - aFilteredMark.SetMarkArea( aMarkRange); } - else + + if (bNoPaste) { - // Expand the marked area when the destination area is larger than the - // current selection, to get the undo do the right thing. (i#106711) - ScRange aRange; - aFilteredMark.GetMarkArea( aRange ); - if( (aRange.aEnd.Col() - aRange.aStart.Col()) < nDestSizeX ) - { - aRange.aEnd.SetCol(aRange.aStart.Col() + nDestSizeX); - aFilteredMark.SetMarkArea(aRange); - } + ErrorMessage(STR_MSSG_PASTEFROMCLIP_0); + return FALSE; } SCROW nUnfilteredRows = aMarkRange.aEnd.Row() - aMarkRange.aStart.Row() + 1; |