diff options
author | Ingrid Halama [iha] <Ingrid.Halama@oracle.com> | 2011-01-28 17:43:26 +0100 |
---|---|---|
committer | Ingrid Halama [iha] <Ingrid.Halama@oracle.com> | 2011-01-28 17:43:26 +0100 |
commit | 770837b8b4d2786ff7925d7ad6be69e1d1587ac4 (patch) | |
tree | 4920319e7916388a5f411be3dc50fd4aadcb331c /sc/source/ui/view/viewfun7.cxx | |
parent | 796dfe2205b9a7735e7fb908b3b4fe7d74d76170 (diff) | |
parent | 6f68642b7b2310b902264849a5ffc5dca6c15510 (diff) |
chart46: merge with dev300m98
Diffstat (limited to 'sc/source/ui/view/viewfun7.cxx')
-rw-r--r-- | sc/source/ui/view/viewfun7.cxx | 48 |
1 files changed, 43 insertions, 5 deletions
diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx index afa06ddfee3e..bdc0ac895b8e 100644 --- a/sc/source/ui/view/viewfun7.cxx +++ b/sc/source/ui/view/viewfun7.cxx @@ -56,6 +56,10 @@ #include "drwlayer.hxx" #include "drwtrans.hxx" #include "globstr.hrc" +#include "chartlis.hxx" +#include "docuno.hxx" +#include "docsh.hxx" +#include "convuno.hxx" extern Point aDragStartDiff; @@ -149,9 +153,16 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel, else { SdrModel* pDrawModel = pDragEditView->GetModel(); - SdrPage* pDestPage = pDrawModel->GetPage( static_cast<sal_uInt16>(GetViewData()->GetTabNo()) ); + SCTAB nTab = GetViewData()->GetTabNo(); + SdrPage* pDestPage = pDrawModel->GetPage( static_cast< sal_uInt16 >( nTab ) ); DBG_ASSERT(pDestPage,"nanu, Page?"); + ::std::vector< ::rtl::OUString > aExcludedChartNames; + if ( pDestPage ) + { + ScChartHelper::GetChartNames( aExcludedChartNames, pDestPage ); + } + SdrMarkList aMark = pDragEditView->GetMarkedObjectList(); aMark.ForceSort(); ULONG nMarkAnz=aMark.GetMarkCount(); @@ -184,6 +195,16 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel, if (bPasteIsMove) pDragEditView->DeleteMarked(); + + ScDocument* pDocument = GetViewData()->GetDocument(); + ScDocShell* pDocShell = GetViewData()->GetDocShell(); + ScModelObj* pModelObj = ( pDocShell ? ScModelObj::getImplementation( pDocShell->GetModel() ) : NULL ); + if ( pDocument && pDestPage && pModelObj && pDrawTrans ) + { + const ScRangeListVector& rProtectedChartRangesVector( pDrawTrans->GetProtectedChartRangesVector() ); + ScChartHelper::CreateProtectedChartListenersAndNotify( pDocument, pDestPage, pModelObj, nTab, + rProtectedChartRangesVector, aExcludedChartNames, bSameDoc ); + } } } else @@ -204,6 +225,15 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel, if ( pClient && pClient->IsObjectInPlaceActive() ) nOptions |= SDRINSERT_DONTMARK; + ::std::vector< ::rtl::OUString > aExcludedChartNames; + SCTAB nTab = GetViewData()->GetTabNo(); + SdrPage* pPage = pScDrawView->GetModel()->GetPage( static_cast< sal_uInt16 >( nTab ) ); + DBG_ASSERT( pPage, "Page?" ); + if ( pPage ) + { + ScChartHelper::GetChartNames( aExcludedChartNames, pPage ); + } + // #89247# Set flag for ScDocument::UpdateChartListeners() which is // called during paste. if ( !bSameDocClipboard ) @@ -216,10 +246,6 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel, // #68991# Paste puts all objects on the active (front) layer // controls must be on SC_LAYER_CONTROLS - - SCTAB nTab = GetViewData()->GetTabNo(); - SdrPage* pPage = pScDrawView->GetModel()->GetPage(static_cast<sal_uInt16>(nTab)); - DBG_ASSERT(pPage,"Page?"); if (pPage) { SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS ); @@ -234,6 +260,18 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel, // #75299# all graphics objects must have names GetViewData()->GetDocument()->EnsureGraphicNames(); + + ScDocument* pDocument = GetViewData()->GetDocument(); + ScDocShell* pDocShell = GetViewData()->GetDocShell(); + ScModelObj* pModelObj = ( pDocShell ? ScModelObj::getImplementation( pDocShell->GetModel() ) : NULL ); + ScDrawTransferObj* pTransferObj = ScDrawTransferObj::GetOwnClipboard( NULL ); + if ( pDocument && pPage && pModelObj && ( pTransferObj || pDrawTrans ) ) + { + const ScRangeListVector& rProtectedChartRangesVector( + pTransferObj ? pTransferObj->GetProtectedChartRangesVector() : pDrawTrans->GetProtectedChartRangesVector() ); + ScChartHelper::CreateProtectedChartListenersAndNotify( pDocument, pPage, pModelObj, nTab, + rProtectedChartRangesVector, aExcludedChartNames, bSameDocClipboard ); + } } if (bGroup) |