summaryrefslogtreecommitdiff
path: root/sc/source/ui/drawfunc/fusel.cxx
diff options
context:
space:
mode:
authorCarsten Driesner <cd@openoffice.org>2011-01-21 17:18:37 +0100
committerCarsten Driesner <cd@openoffice.org>2011-01-21 17:18:37 +0100
commitd672102cc70fa4b24eed730e89e9e766cc10a525 (patch)
treeee6e081a403e1e23af6ec7850a34eb10fc7fc8fd /sc/source/ui/drawfunc/fusel.cxx
parent9617758b4b0997f5981a1303684ba9c9a4dd148b (diff)
parent6f68642b7b2310b902264849a5ffc5dca6c15510 (diff)
removetooltypes01: Rebase to DEV300m98
Diffstat (limited to 'sc/source/ui/drawfunc/fusel.cxx')
-rw-r--r--sc/source/ui/drawfunc/fusel.cxx46
1 files changed, 46 insertions, 0 deletions
diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx
index 964e9cb5081e..cb0ebd241d74 100644
--- a/sc/source/ui/drawfunc/fusel.cxx
+++ b/sc/source/ui/drawfunc/fusel.cxx
@@ -56,6 +56,9 @@
#include "drwlayer.hxx"
#include "userdat.hxx"
#include "scmod.hxx"
+#include "charthelper.hxx"
+#include "docuno.hxx"
+#include "docsh.hxx"
// -----------------------------------------------------------------------
@@ -399,6 +402,14 @@ sal_Bool __EXPORT FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
+ bool bCopy = false;
+ ScViewData* pViewData = ( pViewShell ? pViewShell->GetViewData() : NULL );
+ ScDocument* pDocument = ( pViewData ? pViewData->GetDocument() : NULL );
+ SdrPageView* pPageView = ( pView ? pView->GetSdrPageView() : NULL );
+ SdrPage* pPage = ( pPageView ? pPageView->GetPage() : NULL );
+ ::std::vector< ::rtl::OUString > aExcludedChartNames;
+ ScRangeListVector aProtectedChartRangesVector;
+
if ( rMEvt.IsLeft() )
{
if ( pView->IsDragObj() )
@@ -406,6 +417,29 @@ sal_Bool __EXPORT FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
/******************************************************************
* Objekt wurde verschoben
******************************************************************/
+ if ( rMEvt.IsMod1() )
+ {
+ if ( pPage )
+ {
+ ScChartHelper::GetChartNames( aExcludedChartNames, pPage );
+ }
+ if ( pView && pDocument )
+ {
+ const SdrMarkList& rSdrMarkList = pView->GetMarkedObjectList();
+ ULONG nMarkCount = rSdrMarkList.GetMarkCount();
+ for ( ULONG i = 0; i < nMarkCount; ++i )
+ {
+ SdrMark* pMark = rSdrMarkList.GetMark( i );
+ SdrObject* pObj = ( pMark ? pMark->GetMarkedSdrObj() : NULL );
+ if ( pObj )
+ {
+ ScChartHelper::AddRangesIfProtectedChart( aProtectedChartRangesVector, pDocument, pObj );
+ }
+ }
+ }
+ bCopy = true;
+ }
+
pView->EndDragObj( rMEvt.IsMod1() );
pView->ForceMarkedToAnotherPage();
@@ -566,6 +600,18 @@ sal_Bool __EXPORT FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
pViewShell->GetViewData()->GetDispatcher().
Execute(SID_OBJECT_SELECT, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
+ if ( bCopy && pViewData && pDocument && pPage )
+ {
+ ScDocShell* pDocShell = pViewData->GetDocShell();
+ ScModelObj* pModelObj = ( pDocShell ? ScModelObj::getImplementation( pDocShell->GetModel() ) : NULL );
+ if ( pModelObj )
+ {
+ SCTAB nTab = pViewData->GetTabNo();
+ ScChartHelper::CreateProtectedChartListenersAndNotify( pDocument, pPage, pModelObj, nTab,
+ aProtectedChartRangesVector, aExcludedChartNames );
+ }
+ }
+
return (bReturn);
}