15b190011SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
35b190011SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
45b190011SAndrew Rist * or more contributor license agreements. See the NOTICE file
55b190011SAndrew Rist * distributed with this work for additional information
65b190011SAndrew Rist * regarding copyright ownership. The ASF licenses this file
75b190011SAndrew Rist * to you under the Apache License, Version 2.0 (the
85b190011SAndrew Rist * "License"); you may not use this file except in compliance
95b190011SAndrew Rist * with the License. You may obtain a copy of the License at
105b190011SAndrew Rist *
115b190011SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
125b190011SAndrew Rist *
135b190011SAndrew Rist * Unless required by applicable law or agreed to in writing,
145b190011SAndrew Rist * software distributed under the License is distributed on an
155b190011SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
165b190011SAndrew Rist * KIND, either express or implied. See the License for the
175b190011SAndrew Rist * specific language governing permissions and limitations
185b190011SAndrew Rist * under the License.
195b190011SAndrew Rist *
205b190011SAndrew Rist *************************************************************/
215b190011SAndrew Rist
225b190011SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sd.hxx"
26cdf0e10cSrcweir
27cdf0e10cSrcweir
28cdf0e10cSrcweir #include "View.hxx"
29cdf0e10cSrcweir
30cdf0e10cSrcweir #include <vector>
31cdf0e10cSrcweir #include <com/sun/star/embed/XEmbedPersist.hpp>
32cdf0e10cSrcweir #include <tools/ref.hxx>
33cdf0e10cSrcweir #include <tools/urlobj.hxx>
34cdf0e10cSrcweir #ifndef _MSGBOX_HXX //autogen
35cdf0e10cSrcweir #include <vcl/msgbox.hxx>
36cdf0e10cSrcweir #endif
37cdf0e10cSrcweir #include <svx/svdetc.hxx>
38cdf0e10cSrcweir #include <svx/svdoole2.hxx>
39cdf0e10cSrcweir #include <svx/svdograf.hxx>
40cdf0e10cSrcweir #include <vcl/graph.hxx>
41cdf0e10cSrcweir #include <svx/xexch.hxx>
42cdf0e10cSrcweir #include <svx/svxdlg.hxx>
43cdf0e10cSrcweir #include <svx/dialogs.hrc>
44cdf0e10cSrcweir #include <sfx2/docfile.hxx>
45cdf0e10cSrcweir #include <sfx2/childwin.hxx>
46cdf0e10cSrcweir #include <svx/svdundo.hxx>
47cdf0e10cSrcweir #include <svx/svdpagv.hxx>
48cdf0e10cSrcweir #include <svl/urlbmk.hxx>
49cdf0e10cSrcweir #include <svl/urlbmk.hxx>
50cdf0e10cSrcweir #include <editeng/outliner.hxx>
51cdf0e10cSrcweir #include <svx/xflclit.hxx>
52cdf0e10cSrcweir #include <svx/dbexch.hrc>
53cdf0e10cSrcweir #include <sot/formats.hxx>
54cdf0e10cSrcweir #include <editeng/editeng.hxx>
55cdf0e10cSrcweir #include <svx/svditer.hxx>
56cdf0e10cSrcweir #include <svx/obj3d.hxx>
57cdf0e10cSrcweir #include <svx/scene3d.hxx>
58cdf0e10cSrcweir
59cdf0e10cSrcweir #include <sfx2/objsh.hxx>
60cdf0e10cSrcweir #include <svtools/embedtransfer.hxx>
61cdf0e10cSrcweir
62cdf0e10cSrcweir #include "navigatr.hxx"
63cdf0e10cSrcweir #include "anminfo.hxx"
64cdf0e10cSrcweir #include "strings.hrc"
65cdf0e10cSrcweir #include "glob.hrc"
66cdf0e10cSrcweir #include "sdxfer.hxx"
67cdf0e10cSrcweir #include "sdresid.hxx"
68cdf0e10cSrcweir #include "sdmod.hxx"
69cdf0e10cSrcweir #include "DrawViewShell.hxx"
70cdf0e10cSrcweir #include "DrawDocShell.hxx"
71cdf0e10cSrcweir #include "fudraw.hxx"
72cdf0e10cSrcweir #include "drawdoc.hxx"
73cdf0e10cSrcweir #include "Window.hxx"
74cdf0e10cSrcweir #include "sdpage.hxx"
75cdf0e10cSrcweir #include "unoaprms.hxx"
76cdf0e10cSrcweir #include "drawview.hxx"
77cdf0e10cSrcweir #include "helpids.h"
78cdf0e10cSrcweir #include <vcl/svapp.hxx>
79cdf0e10cSrcweir
80cdf0e10cSrcweir #include "slideshow.hxx"
81cdf0e10cSrcweir
82cdf0e10cSrcweir namespace sd {
83cdf0e10cSrcweir
84cdf0e10cSrcweir #ifndef SO2_DECL_SVINPLACEOBJECT_DEFINED
85cdf0e10cSrcweir #define SO2_DECL_SVINPLACEOBJECT_DEFINED
86cdf0e10cSrcweir SO2_DECL_REF(SvInPlaceObject)
87cdf0e10cSrcweir #endif
88cdf0e10cSrcweir #ifndef SO2_DECL_SVSTORAGE_DEFINED
89cdf0e10cSrcweir #define SO2_DECL_SVSTORAGE_DEFINED
90cdf0e10cSrcweir SO2_DECL_REF(SvStorage)
91cdf0e10cSrcweir #endif
92cdf0e10cSrcweir
93cdf0e10cSrcweir using namespace ::com::sun::star;
94cdf0e10cSrcweir
95cdf0e10cSrcweir // ------------------------
96cdf0e10cSrcweir // - SdNavigatorDropEvent -
97cdf0e10cSrcweir // ------------------------
98cdf0e10cSrcweir
99cdf0e10cSrcweir struct SdNavigatorDropEvent : public ExecuteDropEvent
100cdf0e10cSrcweir {
101cdf0e10cSrcweir DropTargetHelper& mrTargetHelper;
102cdf0e10cSrcweir ::sd::Window* mpTargetWindow;
103cdf0e10cSrcweir sal_uInt16 mnPage;
104cdf0e10cSrcweir sal_uInt16 mnLayer;
105cdf0e10cSrcweir
SdNavigatorDropEventsd::SdNavigatorDropEvent106cdf0e10cSrcweir SdNavigatorDropEvent (
107cdf0e10cSrcweir const ExecuteDropEvent& rEvt,
108cdf0e10cSrcweir DropTargetHelper& rTargetHelper,
109cdf0e10cSrcweir ::sd::Window* pTargetWindow,
110cdf0e10cSrcweir sal_uInt16 nPage,
111cdf0e10cSrcweir sal_uInt16 nLayer )
112cdf0e10cSrcweir : ExecuteDropEvent( rEvt ),
113cdf0e10cSrcweir mrTargetHelper( rTargetHelper ),
114cdf0e10cSrcweir mpTargetWindow( pTargetWindow ),
115cdf0e10cSrcweir mnPage( nPage ),
116cdf0e10cSrcweir mnLayer( nLayer )
117cdf0e10cSrcweir {}
118cdf0e10cSrcweir };
119cdf0e10cSrcweir
120cdf0e10cSrcweir // -----------------------------------------------------------------------------
121cdf0e10cSrcweir
CreateClipboardDataObject(View *,::Window &)122cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > View::CreateClipboardDataObject( View*, ::Window& )
123cdf0e10cSrcweir {
124cdf0e10cSrcweir // since SdTransferable::CopyToClipboard is called, this
125cdf0e10cSrcweir // dynamically created object ist destroyed automatically
126cdf0e10cSrcweir SdTransferable* pTransferable = new SdTransferable( mpDoc, NULL, sal_False );
127cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > xRet( pTransferable );
128cdf0e10cSrcweir
129cdf0e10cSrcweir SD_MOD()->pTransferClip = pTransferable;
130cdf0e10cSrcweir
131cdf0e10cSrcweir mpDoc->CreatingDataObj( pTransferable );
132cdf0e10cSrcweir pTransferable->SetWorkDocument( (SdDrawDocument*) GetAllMarkedModel() );
133cdf0e10cSrcweir mpDoc->CreatingDataObj( NULL );
134cdf0e10cSrcweir
135cdf0e10cSrcweir // #112978# need to use GetAllMarkedBoundRect instead of GetAllMarkedRect to get
136cdf0e10cSrcweir // fat lines correctly
137cdf0e10cSrcweir const Rectangle aMarkRect( GetAllMarkedBoundRect() );
138cdf0e10cSrcweir TransferableObjectDescriptor aObjDesc;
139cdf0e10cSrcweir String aDisplayName;
140cdf0e10cSrcweir SdrOle2Obj* pSdrOleObj = NULL;
141cdf0e10cSrcweir SdrPageView* pPgView = GetSdrPageView();
142cdf0e10cSrcweir SdPage* pOldPage = pPgView ? ( (SdPage*) pPgView->GetPage() ) : NULL;
143cdf0e10cSrcweir SdPage* pNewPage = (SdPage*) pTransferable->GetWorkDocument()->GetPage( 0 );
144cdf0e10cSrcweir
145cdf0e10cSrcweir if( pOldPage )
146cdf0e10cSrcweir {
147cdf0e10cSrcweir pNewPage->SetSize( pOldPage->GetSize() );
148cdf0e10cSrcweir pNewPage->SetLayoutName( pOldPage->GetLayoutName() );
149cdf0e10cSrcweir }
150cdf0e10cSrcweir
151cdf0e10cSrcweir if( GetMarkedObjectCount() == 1 )
152cdf0e10cSrcweir {
153cdf0e10cSrcweir SdrObject* pObj = GetMarkedObjectByIndex(0);
154cdf0e10cSrcweir
155cdf0e10cSrcweir if( pObj && pObj->ISA(SdrOle2Obj) && ((SdrOle2Obj*) pObj)->GetObjRef().is() )
156cdf0e10cSrcweir {
157cdf0e10cSrcweir // If object has no persistence it must be copied as part of the document
158cdf0e10cSrcweir try
159cdf0e10cSrcweir {
160cdf0e10cSrcweir uno::Reference< embed::XEmbedPersist > xPersObj( ((SdrOle2Obj*)pObj)->GetObjRef(), uno::UNO_QUERY );
161cdf0e10cSrcweir if ( xPersObj.is() && xPersObj->hasEntry() )
162cdf0e10cSrcweir pSdrOleObj = (SdrOle2Obj*) pObj;
163cdf0e10cSrcweir }
164cdf0e10cSrcweir catch( uno::Exception& )
165cdf0e10cSrcweir {}
166cdf0e10cSrcweir }
167cdf0e10cSrcweir }
168cdf0e10cSrcweir
169cdf0e10cSrcweir if( pSdrOleObj )
170cdf0e10cSrcweir SvEmbedTransferHelper::FillTransferableObjectDescriptor( aObjDesc, pSdrOleObj->GetObjRef(), pSdrOleObj->GetGraphic(), pSdrOleObj->GetAspect() );
171cdf0e10cSrcweir else
172cdf0e10cSrcweir pTransferable->GetWorkDocument()->GetDocSh()->FillTransferableObjectDescriptor( aObjDesc );
173cdf0e10cSrcweir
174cdf0e10cSrcweir if( mpDocSh )
175cdf0e10cSrcweir aObjDesc.maDisplayName = mpDocSh->GetMedium()->GetURLObject().GetURLNoPass();
176cdf0e10cSrcweir
177cdf0e10cSrcweir aObjDesc.maSize = aMarkRect.GetSize();
178cdf0e10cSrcweir
179cdf0e10cSrcweir pTransferable->SetStartPos( aMarkRect.TopLeft() );
180cdf0e10cSrcweir pTransferable->SetObjectDescriptor( aObjDesc );
181cdf0e10cSrcweir pTransferable->CopyToClipboard( mpViewSh->GetActiveWindow() );
182cdf0e10cSrcweir
183cdf0e10cSrcweir return xRet;
184cdf0e10cSrcweir }
185cdf0e10cSrcweir
186cdf0e10cSrcweir // -----------------------------------------------------------------------------
187cdf0e10cSrcweir
CreateDragDataObject(View * pWorkView,::Window & rWindow,const Point & rDragPos)188cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > View::CreateDragDataObject( View* pWorkView, ::Window& rWindow, const Point& rDragPos )
189cdf0e10cSrcweir {
190cdf0e10cSrcweir SdTransferable* pTransferable = new SdTransferable( mpDoc, pWorkView, sal_False );
191cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > xRet( pTransferable );
192cdf0e10cSrcweir
193cdf0e10cSrcweir SD_MOD()->pTransferDrag = pTransferable;
194cdf0e10cSrcweir
195cdf0e10cSrcweir TransferableObjectDescriptor aObjDesc;
196cdf0e10cSrcweir String aDisplayName;
197cdf0e10cSrcweir SdrOle2Obj* pSdrOleObj = NULL;
198cdf0e10cSrcweir
199cdf0e10cSrcweir if( GetMarkedObjectCount() == 1 )
200cdf0e10cSrcweir {
201cdf0e10cSrcweir SdrObject* pObj = GetMarkedObjectByIndex( 0 );
202cdf0e10cSrcweir
203cdf0e10cSrcweir if( pObj && pObj->ISA( SdrOle2Obj ) && ( (SdrOle2Obj*) pObj )->GetObjRef().is() )
204cdf0e10cSrcweir {
205cdf0e10cSrcweir // If object has no persistence it must be copied as part of the document
206cdf0e10cSrcweir try
207cdf0e10cSrcweir {
208cdf0e10cSrcweir uno::Reference< embed::XEmbedPersist > xPersObj( ((SdrOle2Obj*)pObj)->GetObjRef(), uno::UNO_QUERY );
209cdf0e10cSrcweir if ( xPersObj.is() && xPersObj->hasEntry() )
210cdf0e10cSrcweir pSdrOleObj = (SdrOle2Obj*) pObj;
211cdf0e10cSrcweir }
212cdf0e10cSrcweir catch( uno::Exception& )
213cdf0e10cSrcweir {}
214cdf0e10cSrcweir }
215cdf0e10cSrcweir }
216cdf0e10cSrcweir
217cdf0e10cSrcweir if( mpDocSh )
218cdf0e10cSrcweir aDisplayName = mpDocSh->GetMedium()->GetURLObject().GetURLNoPass();
219cdf0e10cSrcweir
220cdf0e10cSrcweir if( pSdrOleObj )
221cdf0e10cSrcweir SvEmbedTransferHelper::FillTransferableObjectDescriptor( aObjDesc, pSdrOleObj->GetObjRef(), pSdrOleObj->GetGraphic(), pSdrOleObj->GetAspect() );
222cdf0e10cSrcweir else
223cdf0e10cSrcweir mpDocSh->FillTransferableObjectDescriptor( aObjDesc );
224cdf0e10cSrcweir
225cdf0e10cSrcweir aObjDesc.maSize = GetAllMarkedRect().GetSize();
226cdf0e10cSrcweir aObjDesc.maDragStartPos = rDragPos;
227cdf0e10cSrcweir aObjDesc.maDisplayName = aDisplayName;
228cdf0e10cSrcweir aObjDesc.mbCanLink = sal_False;
229cdf0e10cSrcweir
230cdf0e10cSrcweir pTransferable->SetStartPos( rDragPos );
231cdf0e10cSrcweir pTransferable->SetObjectDescriptor( aObjDesc );
232cdf0e10cSrcweir pTransferable->StartDrag( &rWindow, DND_ACTION_COPYMOVE | DND_ACTION_LINK );
233cdf0e10cSrcweir
234cdf0e10cSrcweir return xRet;
235cdf0e10cSrcweir }
236cdf0e10cSrcweir
237cdf0e10cSrcweir // -----------------------------------------------------------------------------
238cdf0e10cSrcweir
CreateSelectionDataObject(View * pWorkView,::Window & rWindow)239cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > View::CreateSelectionDataObject( View* pWorkView, ::Window& rWindow )
240cdf0e10cSrcweir {
241cdf0e10cSrcweir SdTransferable* pTransferable = new SdTransferable( mpDoc, pWorkView, sal_True );
242cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > xRet( pTransferable );
243cdf0e10cSrcweir TransferableObjectDescriptor aObjDesc;
244cdf0e10cSrcweir const Rectangle aMarkRect( GetAllMarkedRect() );
245cdf0e10cSrcweir String aDisplayName;
246cdf0e10cSrcweir
247cdf0e10cSrcweir SD_MOD()->pTransferSelection = pTransferable;
248cdf0e10cSrcweir
249cdf0e10cSrcweir if( mpDocSh )
250cdf0e10cSrcweir {
251cdf0e10cSrcweir aDisplayName = mpDocSh->GetMedium()->GetURLObject().GetURLNoPass();
252cdf0e10cSrcweir mpDocSh->FillTransferableObjectDescriptor( aObjDesc );
253cdf0e10cSrcweir }
254cdf0e10cSrcweir
255cdf0e10cSrcweir aObjDesc.maSize = aMarkRect.GetSize();
256cdf0e10cSrcweir
257cdf0e10cSrcweir pTransferable->SetStartPos( aMarkRect.TopLeft() );
258cdf0e10cSrcweir pTransferable->SetObjectDescriptor( aObjDesc );
259cdf0e10cSrcweir pTransferable->CopyToSelection( &rWindow );
260cdf0e10cSrcweir
261cdf0e10cSrcweir return xRet;
262cdf0e10cSrcweir }
263cdf0e10cSrcweir
264cdf0e10cSrcweir // -----------------------------------------------------------------------------
265cdf0e10cSrcweir
UpdateSelectionClipboard(sal_Bool bForceDeselect)266cdf0e10cSrcweir void View::UpdateSelectionClipboard( sal_Bool bForceDeselect )
267cdf0e10cSrcweir {
268cdf0e10cSrcweir if( mpViewSh && mpViewSh->GetActiveWindow() )
269cdf0e10cSrcweir {
270cdf0e10cSrcweir if( !bForceDeselect && GetMarkedObjectList().GetMarkCount() )
271cdf0e10cSrcweir CreateSelectionDataObject( this, *mpViewSh->GetActiveWindow() );
272cdf0e10cSrcweir else if( SD_MOD()->pTransferSelection && ( SD_MOD()->pTransferSelection->GetView() == this ) )
273cdf0e10cSrcweir {
274cdf0e10cSrcweir TransferableHelper::ClearSelection( mpViewSh->GetActiveWindow() );
275cdf0e10cSrcweir SD_MOD()->pTransferSelection = NULL;
276cdf0e10cSrcweir }
277cdf0e10cSrcweir }
278cdf0e10cSrcweir }
279cdf0e10cSrcweir
280cdf0e10cSrcweir // -----------------------------------------------------------------------------
281cdf0e10cSrcweir
DoCut(::Window *)282cdf0e10cSrcweir void View::DoCut(::Window* )
283cdf0e10cSrcweir {
284cdf0e10cSrcweir const OutlinerView* pOLV = GetTextEditOutlinerView();
285cdf0e10cSrcweir
286cdf0e10cSrcweir if( pOLV )
287cdf0e10cSrcweir ( (OutlinerView*) pOLV)->Cut();
288cdf0e10cSrcweir else if( AreObjectsMarked() )
289cdf0e10cSrcweir {
290cdf0e10cSrcweir String aStr( SdResId(STR_UNDO_CUT) );
291cdf0e10cSrcweir
292cdf0e10cSrcweir DoCopy();
293cdf0e10cSrcweir BegUndo( ( aStr += sal_Unicode(' ') ) += GetDescriptionOfMarkedObjects() );
294cdf0e10cSrcweir DeleteMarked();
295cdf0e10cSrcweir EndUndo();
296cdf0e10cSrcweir }
297cdf0e10cSrcweir }
298cdf0e10cSrcweir
299cdf0e10cSrcweir // -----------------------------------------------------------------------------
300cdf0e10cSrcweir
DoCopy(::Window * pWindow)301cdf0e10cSrcweir void View::DoCopy (::Window* pWindow)
302cdf0e10cSrcweir {
303cdf0e10cSrcweir const OutlinerView* pOLV = GetTextEditOutlinerView();
304cdf0e10cSrcweir
305cdf0e10cSrcweir if( pOLV )
306cdf0e10cSrcweir ( (OutlinerView*) pOLV)->Copy();
307cdf0e10cSrcweir else if( AreObjectsMarked() )
308cdf0e10cSrcweir {
309cdf0e10cSrcweir BrkAction();
310cdf0e10cSrcweir CreateClipboardDataObject( this, *pWindow );
311cdf0e10cSrcweir }
312cdf0e10cSrcweir }
313cdf0e10cSrcweir
314cdf0e10cSrcweir // -----------------------------------------------------------------------------
315cdf0e10cSrcweir
DoPaste(::Window * pWindow)316cdf0e10cSrcweir void View::DoPaste (::Window* pWindow)
317cdf0e10cSrcweir {
318cdf0e10cSrcweir TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( mpViewSh->GetActiveWindow() ) );
319cdf0e10cSrcweir if( !aDataHelper.GetTransferable().is() )
320cdf0e10cSrcweir return; // empty clipboard?
321cdf0e10cSrcweir
322cdf0e10cSrcweir const OutlinerView* pOLV = GetTextEditOutlinerView();
323cdf0e10cSrcweir
324cdf0e10cSrcweir if( pOLV && EditEngine::HasValidData( aDataHelper.GetTransferable() ) )
325cdf0e10cSrcweir {
326cdf0e10cSrcweir const_cast< OutlinerView* >(pOLV)->PasteSpecial();
327cdf0e10cSrcweir
328cdf0e10cSrcweir SdrObject* pObj = GetTextEditObject();
329cdf0e10cSrcweir SdPage* pPage = (SdPage*)( pObj ? pObj->GetPage() : NULL );
330cdf0e10cSrcweir ::Outliner* pOutliner = pOLV->GetOutliner();
331cdf0e10cSrcweir
332cdf0e10cSrcweir if( pOutliner)
333cdf0e10cSrcweir {
334cdf0e10cSrcweir if( pObj && pPage && pPage->GetPresObjKind(pObj) == PRESOBJ_TITLE )
335cdf0e10cSrcweir {
336cdf0e10cSrcweir // remove all hard linebreaks from the title
337cdf0e10cSrcweir if( pOutliner && pOutliner->GetParagraphCount() > 1 )
338cdf0e10cSrcweir {
339cdf0e10cSrcweir sal_Bool bOldUpdateMode = pOutliner->GetUpdateMode();
340cdf0e10cSrcweir
341cdf0e10cSrcweir pOutliner->SetUpdateMode( sal_False );
342cdf0e10cSrcweir
343cdf0e10cSrcweir const EditEngine& rEdit = pOutliner->GetEditEngine();
344cdf0e10cSrcweir const int nParaCount = rEdit.GetParagraphCount();
345cdf0e10cSrcweir
346cdf0e10cSrcweir for( int nPara = nParaCount - 2; nPara >= 0; nPara-- )
347cdf0e10cSrcweir {
348cdf0e10cSrcweir const sal_uInt16 nParaLen = (sal_uInt16)rEdit.GetTextLen( (sal_uInt16)nPara );
349cdf0e10cSrcweir pOutliner->QuickDelete( ESelection( (sal_uInt16)nPara, nParaLen, (sal_uInt16)nPara+1, 0 ) );
350cdf0e10cSrcweir pOutliner->QuickInsertLineBreak( ESelection( (sal_uInt16)nPara, nParaLen, (sal_uInt16)nPara, nParaLen ) );
351cdf0e10cSrcweir }
352cdf0e10cSrcweir
353cdf0e10cSrcweir DBG_ASSERT( rEdit.GetParagraphCount() <= 1, "Titelobjekt contains hard line breaks" );
354cdf0e10cSrcweir pOutliner->SetUpdateMode(bOldUpdateMode);
355cdf0e10cSrcweir }
356cdf0e10cSrcweir }
357cdf0e10cSrcweir
358cdf0e10cSrcweir if( !mpDoc->IsChanged() )
359cdf0e10cSrcweir {
360cdf0e10cSrcweir if( pOutliner && pOutliner->IsModified() )
361cdf0e10cSrcweir mpDoc->SetChanged( sal_True );
362cdf0e10cSrcweir }
363cdf0e10cSrcweir }
364cdf0e10cSrcweir }
365cdf0e10cSrcweir else
366cdf0e10cSrcweir {
367cdf0e10cSrcweir Point aPos;
368cdf0e10cSrcweir sal_Int8 nDnDAction = DND_ACTION_COPY;
369cdf0e10cSrcweir
370cdf0e10cSrcweir if( pWindow )
371cdf0e10cSrcweir aPos = pWindow->PixelToLogic( Rectangle( aPos, pWindow->GetOutputSizePixel() ).Center() );
372cdf0e10cSrcweir
373cdf0e10cSrcweir DrawViewShell* pDrViewSh = (DrawViewShell*) mpDocSh->GetViewShell();
374cdf0e10cSrcweir
375cdf0e10cSrcweir if (pDrViewSh != NULL)
376cdf0e10cSrcweir {
377cdf0e10cSrcweir if( !InsertData( aDataHelper, aPos, nDnDAction, sal_False ) )
378cdf0e10cSrcweir {
379cdf0e10cSrcweir INetBookmark aINetBookmark( aEmptyStr, aEmptyStr );
380cdf0e10cSrcweir
381cdf0e10cSrcweir if( ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ) &&
382cdf0e10cSrcweir aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK, aINetBookmark ) ) ||
383cdf0e10cSrcweir ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR ) &&
384cdf0e10cSrcweir aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR, aINetBookmark ) ) ||
385cdf0e10cSrcweir ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ) &&
386cdf0e10cSrcweir aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR, aINetBookmark ) ) )
387cdf0e10cSrcweir {
388cdf0e10cSrcweir pDrViewSh->InsertURLField( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), aEmptyStr, NULL );
389cdf0e10cSrcweir }
390cdf0e10cSrcweir }
391cdf0e10cSrcweir }
392cdf0e10cSrcweir }
393cdf0e10cSrcweir }
394cdf0e10cSrcweir
395cdf0e10cSrcweir // -----------------------------------------------------------------------------
396cdf0e10cSrcweir
StartDrag(const Point & rStartPos,::Window * pWindow)397cdf0e10cSrcweir void View::StartDrag( const Point& rStartPos, ::Window* pWindow )
398cdf0e10cSrcweir {
399cdf0e10cSrcweir if( AreObjectsMarked() && IsAction() && mpViewSh && pWindow && !mpDragSrcMarkList )
400cdf0e10cSrcweir {
401cdf0e10cSrcweir BrkAction();
402cdf0e10cSrcweir
403cdf0e10cSrcweir if( IsTextEdit() )
404cdf0e10cSrcweir SdrEndTextEdit();
405cdf0e10cSrcweir
406cdf0e10cSrcweir DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >( mpDocSh ? mpDocSh->GetViewShell() : 0 );
407cdf0e10cSrcweir
408cdf0e10cSrcweir if( pDrawViewShell )
409cdf0e10cSrcweir {
410cdf0e10cSrcweir FunctionReference xFunction( pDrawViewShell->GetCurrentFunction() );
411cdf0e10cSrcweir
412cdf0e10cSrcweir if( xFunction.is() && xFunction->ISA( FuDraw ) )
413cdf0e10cSrcweir static_cast<FuDraw*>(xFunction.get())->ForcePointer( NULL );
414cdf0e10cSrcweir }
415cdf0e10cSrcweir
416cdf0e10cSrcweir mpDragSrcMarkList = new SdrMarkList(GetMarkedObjectList());
417cdf0e10cSrcweir mnDragSrcPgNum = GetSdrPageView()->GetPage()->GetPageNum();
418cdf0e10cSrcweir
419cdf0e10cSrcweir if( IsUndoEnabled() )
420cdf0e10cSrcweir {
421cdf0e10cSrcweir String aStr( SdResId(STR_UNDO_DRAGDROP) );
422cdf0e10cSrcweir aStr += sal_Unicode(' ');
423cdf0e10cSrcweir aStr += mpDragSrcMarkList->GetMarkDescription();
424cdf0e10cSrcweir BegUndo(aStr);
425cdf0e10cSrcweir }
426cdf0e10cSrcweir CreateDragDataObject( this, *pWindow, rStartPos );
427cdf0e10cSrcweir }
428cdf0e10cSrcweir }
429cdf0e10cSrcweir
430cdf0e10cSrcweir // -----------------------------------------------------------------------------
431cdf0e10cSrcweir
DragFinished(sal_Int8 nDropAction)432cdf0e10cSrcweir void View::DragFinished( sal_Int8 nDropAction )
433cdf0e10cSrcweir {
434cdf0e10cSrcweir const bool bUndo = IsUndoEnabled();
435cdf0e10cSrcweir
436cdf0e10cSrcweir SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag;
437cdf0e10cSrcweir
438cdf0e10cSrcweir if( pDragTransferable )
439cdf0e10cSrcweir pDragTransferable->SetView( NULL );
440cdf0e10cSrcweir
441cdf0e10cSrcweir if( ( nDropAction & DND_ACTION_MOVE ) &&
442cdf0e10cSrcweir pDragTransferable && !pDragTransferable->IsInternalMove() &&
443cdf0e10cSrcweir mpDragSrcMarkList && mpDragSrcMarkList->GetMarkCount() &&
444cdf0e10cSrcweir !IsPresObjSelected() )
445cdf0e10cSrcweir {
446cdf0e10cSrcweir mpDragSrcMarkList->ForceSort();
447cdf0e10cSrcweir
448cdf0e10cSrcweir if( bUndo )
449cdf0e10cSrcweir BegUndo();
450cdf0e10cSrcweir
451cdf0e10cSrcweir sal_uLong nm, nAnz = mpDragSrcMarkList->GetMarkCount();
452cdf0e10cSrcweir
453cdf0e10cSrcweir for( nm = nAnz; nm>0; )
454cdf0e10cSrcweir {
455cdf0e10cSrcweir nm--;
456cdf0e10cSrcweir SdrMark* pM=mpDragSrcMarkList->GetMark(nm);
457cdf0e10cSrcweir if( bUndo )
458cdf0e10cSrcweir AddUndo(mpDoc->GetSdrUndoFactory().CreateUndoDeleteObject(*pM->GetMarkedSdrObj()));
459cdf0e10cSrcweir }
460cdf0e10cSrcweir
461cdf0e10cSrcweir mpDragSrcMarkList->GetMark(0)->GetMarkedSdrObj()->GetOrdNum();
462cdf0e10cSrcweir
463cdf0e10cSrcweir for (nm=nAnz; nm>0;)
464cdf0e10cSrcweir {
465cdf0e10cSrcweir nm--;
466cdf0e10cSrcweir SdrMark* pM=mpDragSrcMarkList->GetMark(nm);
467cdf0e10cSrcweir SdrObject* pObj=pM->GetMarkedSdrObj();
468cdf0e10cSrcweir sal_uInt32 nOrdNum=pObj->GetOrdNumDirect();
469cdf0e10cSrcweir
470cdf0e10cSrcweir if( pObj && pObj->GetPage() )
471cdf0e10cSrcweir {
472cdf0e10cSrcweir #ifdef DBG_UTIL
473cdf0e10cSrcweir SdrObject* pChkObj =
474cdf0e10cSrcweir #endif
475cdf0e10cSrcweir pObj->GetPage()->RemoveObject(nOrdNum);
476cdf0e10cSrcweir DBG_ASSERT(pChkObj==pObj,"pChkObj!=pObj beim RemoveObject()");
477cdf0e10cSrcweir }
478cdf0e10cSrcweir }
479cdf0e10cSrcweir
480cdf0e10cSrcweir if( bUndo )
481cdf0e10cSrcweir EndUndo();
482cdf0e10cSrcweir }
483cdf0e10cSrcweir
484cdf0e10cSrcweir if( pDragTransferable )
485cdf0e10cSrcweir pDragTransferable->SetInternalMove( sal_False );
486cdf0e10cSrcweir
487cdf0e10cSrcweir if( bUndo )
488cdf0e10cSrcweir EndUndo();
489cdf0e10cSrcweir mnDragSrcPgNum = SDRPAGE_NOTFOUND;
490cdf0e10cSrcweir delete mpDragSrcMarkList;
491cdf0e10cSrcweir mpDragSrcMarkList = NULL;
492cdf0e10cSrcweir }
493cdf0e10cSrcweir
494cdf0e10cSrcweir // -----------------------------------------------------------------------------
495cdf0e10cSrcweir
AcceptDrop(const AcceptDropEvent & rEvt,DropTargetHelper & rTargetHelper,::sd::Window *,sal_uInt16,sal_uInt16 nLayer)496cdf0e10cSrcweir sal_Int8 View::AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTargetHelper,
497cdf0e10cSrcweir ::sd::Window*, sal_uInt16, sal_uInt16 nLayer )
498cdf0e10cSrcweir {
499cdf0e10cSrcweir String aLayerName( GetActiveLayer() );
500cdf0e10cSrcweir SdrPageView* pPV = GetSdrPageView();
501cdf0e10cSrcweir sal_Int8 nDropAction = rEvt.mnAction;
502cdf0e10cSrcweir sal_Int8 nRet = DND_ACTION_NONE;
503cdf0e10cSrcweir
504cdf0e10cSrcweir if( nLayer != SDRLAYER_NOTFOUND )
505cdf0e10cSrcweir {
506cdf0e10cSrcweir SdrLayerAdmin& rLayerAdmin = mpDoc->GetLayerAdmin();
507cdf0e10cSrcweir aLayerName = rLayerAdmin.GetLayerPerID(nLayer)->GetName();
508cdf0e10cSrcweir }
509cdf0e10cSrcweir
510cdf0e10cSrcweir if( mbIsDropAllowed && !pPV->IsLayerLocked( aLayerName ) && pPV->IsLayerVisible( aLayerName ) )
511cdf0e10cSrcweir {
512cdf0e10cSrcweir const OutlinerView* pOLV = GetTextEditOutlinerView();
513cdf0e10cSrcweir sal_Bool bIsInsideOutlinerView = sal_False;
514cdf0e10cSrcweir
515cdf0e10cSrcweir if( pOLV )
516cdf0e10cSrcweir {
517cdf0e10cSrcweir Rectangle aRect( pOLV->GetOutputArea() );
518cdf0e10cSrcweir
519cdf0e10cSrcweir if (GetMarkedObjectCount() == 1)
520cdf0e10cSrcweir {
521cdf0e10cSrcweir SdrMark* pMark = GetSdrMarkByIndex(0);
522cdf0e10cSrcweir SdrObject* pObj = pMark->GetMarkedSdrObj();
523cdf0e10cSrcweir aRect.Union( pObj->GetLogicRect() );
524cdf0e10cSrcweir }
525cdf0e10cSrcweir
526cdf0e10cSrcweir if( aRect.IsInside( pOLV->GetWindow()->PixelToLogic( rEvt.maPosPixel ) ) )
527cdf0e10cSrcweir {
528cdf0e10cSrcweir bIsInsideOutlinerView = sal_True;
529cdf0e10cSrcweir }
530cdf0e10cSrcweir }
531cdf0e10cSrcweir
532cdf0e10cSrcweir if( !bIsInsideOutlinerView )
533cdf0e10cSrcweir {
534cdf0e10cSrcweir SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag;
535cdf0e10cSrcweir
536*1cd65da9SArmin Le Grand if(pDragTransferable && (nDropAction & DND_ACTION_LINK))
537*1cd65da9SArmin Le Grand {
538*1cd65da9SArmin Le Grand // suppress own data when it's intention is to use it as fill information
539*1cd65da9SArmin Le Grand pDragTransferable = 0;
540*1cd65da9SArmin Le Grand }
541*1cd65da9SArmin Le Grand
542cdf0e10cSrcweir if( pDragTransferable )
543cdf0e10cSrcweir {
544cdf0e10cSrcweir const View* pSourceView = pDragTransferable->GetView();
545cdf0e10cSrcweir
546cdf0e10cSrcweir if( pDragTransferable->IsPageTransferable() )
547cdf0e10cSrcweir {
548cdf0e10cSrcweir nRet = DND_ACTION_COPY;
549cdf0e10cSrcweir }
550cdf0e10cSrcweir else if( pSourceView )
551cdf0e10cSrcweir {
552cdf0e10cSrcweir if( !( nDropAction & DND_ACTION_LINK ) ||
553cdf0e10cSrcweir pSourceView->GetDocSh()->GetMedium()->GetName().Len() )
554cdf0e10cSrcweir {
555cdf0e10cSrcweir nRet = nDropAction;
556cdf0e10cSrcweir }
557cdf0e10cSrcweir }
558cdf0e10cSrcweir }
559cdf0e10cSrcweir else
560cdf0e10cSrcweir {
561cdf0e10cSrcweir const sal_Bool bDrawing = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_DRAWING );
562cdf0e10cSrcweir const sal_Bool bGraphic = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_SVXB );
563cdf0e10cSrcweir const sal_Bool bMtf = rTargetHelper.IsDropFormatSupported( FORMAT_GDIMETAFILE );
564cdf0e10cSrcweir const sal_Bool bBitmap = rTargetHelper.IsDropFormatSupported( FORMAT_BITMAP );
565cdf0e10cSrcweir sal_Bool bBookmark = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK );
566cdf0e10cSrcweir sal_Bool bXFillExchange = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_XFA );
567cdf0e10cSrcweir
568cdf0e10cSrcweir // check handle insert
569cdf0e10cSrcweir if( !nRet && ( (bXFillExchange && ( SDRDRAG_GRADIENT == GetDragMode() )) || ( SDRDRAG_TRANSPARENCE == GetDragMode() ) ) )
570cdf0e10cSrcweir {
571cdf0e10cSrcweir const SdrHdlList& rHdlList = GetHdlList();
572cdf0e10cSrcweir
573cdf0e10cSrcweir for( sal_uInt32 n = 0; n < rHdlList.GetHdlCount(); n++ )
574cdf0e10cSrcweir {
575cdf0e10cSrcweir SdrHdl* pIAOHandle = rHdlList.GetHdl( n );
576cdf0e10cSrcweir
577cdf0e10cSrcweir if( pIAOHandle && ( HDL_COLR == pIAOHandle->GetKind() ) )
578cdf0e10cSrcweir {
579cdf0e10cSrcweir if(pIAOHandle->getOverlayObjectList().isHitPixel(rEvt.maPosPixel))
580cdf0e10cSrcweir {
581cdf0e10cSrcweir nRet = nDropAction;
582cdf0e10cSrcweir static_cast< SdrHdlColor* >( pIAOHandle )->SetSize( SDR_HANDLE_COLOR_SIZE_SELECTED );
583cdf0e10cSrcweir }
584cdf0e10cSrcweir else
585cdf0e10cSrcweir {
586cdf0e10cSrcweir static_cast< SdrHdlColor* >( pIAOHandle )->SetSize( SDR_HANDLE_COLOR_SIZE_NORMAL );
587cdf0e10cSrcweir }
588cdf0e10cSrcweir }
589cdf0e10cSrcweir }
590cdf0e10cSrcweir }
591cdf0e10cSrcweir
592cdf0e10cSrcweir // check object insert
593cdf0e10cSrcweir if( !nRet && ( bXFillExchange || ( ( bDrawing || bGraphic || bMtf || bBitmap || bBookmark ) && ( nDropAction & DND_ACTION_LINK ) ) ) )
594cdf0e10cSrcweir {
595cdf0e10cSrcweir SdrObject* pPickObj = NULL;
596cdf0e10cSrcweir SdrPageView* pPageView = NULL;
597cdf0e10cSrcweir ::sd::Window* pWindow = mpViewSh->GetActiveWindow();
598cdf0e10cSrcweir Point aPos( pWindow->PixelToLogic( rEvt.maPosPixel ) );
599cdf0e10cSrcweir const sal_Bool bHasPickObj = PickObj( aPos, getHitTolLog(), pPickObj, pPageView );
600cdf0e10cSrcweir sal_Bool bIsPresTarget = sal_False;
601cdf0e10cSrcweir
602cdf0e10cSrcweir if( bHasPickObj && pPickObj && ( pPickObj->IsEmptyPresObj() || pPickObj->GetUserCall() ) )
603cdf0e10cSrcweir {
604cdf0e10cSrcweir SdPage* pPage = (SdPage*) pPickObj->GetPage();
605cdf0e10cSrcweir
606cdf0e10cSrcweir if( pPage && pPage->IsMasterPage() )
607cdf0e10cSrcweir bIsPresTarget = pPage->IsPresObj( pPickObj );
608cdf0e10cSrcweir }
609cdf0e10cSrcweir
610cdf0e10cSrcweir if( bHasPickObj && !bIsPresTarget &&
611*1cd65da9SArmin Le Grand ( bGraphic || bMtf || bBitmap || bXFillExchange ) )
612cdf0e10cSrcweir {
613cdf0e10cSrcweir if( mpDropMarkerObj != pPickObj )
614cdf0e10cSrcweir {
615cdf0e10cSrcweir mpDropMarkerObj = pPickObj;
616cdf0e10cSrcweir ImplClearDrawDropMarker();
617cdf0e10cSrcweir
618cdf0e10cSrcweir if(mpDropMarkerObj)
619cdf0e10cSrcweir {
620cdf0e10cSrcweir mpDropMarker = new SdrDropMarkerOverlay(*this, *mpDropMarkerObj);
621cdf0e10cSrcweir }
622cdf0e10cSrcweir }
623cdf0e10cSrcweir
624cdf0e10cSrcweir nRet = nDropAction;
625cdf0e10cSrcweir }
626cdf0e10cSrcweir else
627cdf0e10cSrcweir bXFillExchange = sal_False;
628cdf0e10cSrcweir }
629cdf0e10cSrcweir
630cdf0e10cSrcweir // check normal insert
631cdf0e10cSrcweir if( !nRet )
632cdf0e10cSrcweir {
633cdf0e10cSrcweir const sal_Bool bSBAFormat = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_SVX_FORMFIELDEXCH );
634cdf0e10cSrcweir const sal_Bool bEditEngine = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_EDITENGINE );
635cdf0e10cSrcweir const sal_Bool bString = rTargetHelper.IsDropFormatSupported( FORMAT_STRING );
636cdf0e10cSrcweir const sal_Bool bRTF = rTargetHelper.IsDropFormatSupported( FORMAT_RTF );
637cdf0e10cSrcweir const sal_Bool bFile = rTargetHelper.IsDropFormatSupported( FORMAT_FILE );
638cdf0e10cSrcweir const sal_Bool bFileList = rTargetHelper.IsDropFormatSupported( FORMAT_FILE_LIST );
639cdf0e10cSrcweir
640cdf0e10cSrcweir if( mpDropMarker )
641cdf0e10cSrcweir {
642cdf0e10cSrcweir ImplClearDrawDropMarker();
643cdf0e10cSrcweir mpDropMarkerObj = NULL;
644cdf0e10cSrcweir }
645cdf0e10cSrcweir
646cdf0e10cSrcweir if( bBookmark && bFile && ( nDropAction & DND_ACTION_MOVE ) && mpViewSh && SlideShow::IsRunning(mpViewSh->GetViewShellBase()) )
647cdf0e10cSrcweir bBookmark = sal_False;
648cdf0e10cSrcweir
649cdf0e10cSrcweir if( bDrawing || bGraphic || bMtf || bBitmap || bBookmark || bFile || bFileList || bXFillExchange || bSBAFormat || bEditEngine || bString || bRTF )
650cdf0e10cSrcweir nRet = nDropAction;
651cdf0e10cSrcweir
652cdf0e10cSrcweir // For entries from the navigator, change action copy.
653cdf0e10cSrcweir if (bBookmark
654cdf0e10cSrcweir && rTargetHelper.IsDropFormatSupported(
655cdf0e10cSrcweir SdPageObjsTLB::SdPageObjsTransferable::GetListBoxDropFormatId())
656cdf0e10cSrcweir && (nDropAction & DND_ACTION_MOVE)!=0)
657cdf0e10cSrcweir {
658cdf0e10cSrcweir nRet = DND_ACTION_COPY;
659cdf0e10cSrcweir }
660cdf0e10cSrcweir }
661cdf0e10cSrcweir }
662cdf0e10cSrcweir }
663cdf0e10cSrcweir }
664cdf0e10cSrcweir
665cdf0e10cSrcweir // destroy drop marker if this is a leaving event
666cdf0e10cSrcweir if( rEvt.mbLeaving && mpDropMarker )
667cdf0e10cSrcweir {
668cdf0e10cSrcweir ImplClearDrawDropMarker();
669cdf0e10cSrcweir mpDropMarkerObj = NULL;
670cdf0e10cSrcweir }
671cdf0e10cSrcweir
672cdf0e10cSrcweir return nRet;
673cdf0e10cSrcweir }
674cdf0e10cSrcweir
675cdf0e10cSrcweir // -----------------------------------------------------------------------------
676cdf0e10cSrcweir
ExecuteDrop(const ExecuteDropEvent & rEvt,DropTargetHelper & rTargetHelper,::sd::Window * pTargetWindow,sal_uInt16 nPage,sal_uInt16 nLayer)677cdf0e10cSrcweir sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTargetHelper,
678cdf0e10cSrcweir ::sd::Window* pTargetWindow, sal_uInt16 nPage, sal_uInt16 nLayer )
679cdf0e10cSrcweir {
680cdf0e10cSrcweir SdrPageView* pPV = GetSdrPageView();
681cdf0e10cSrcweir String aActiveLayer = GetActiveLayer();
682cdf0e10cSrcweir sal_Int8 nDropAction = rEvt.mnAction;
683cdf0e10cSrcweir sal_Int8 nRet = DND_ACTION_NONE;
684cdf0e10cSrcweir
685cdf0e10cSrcweir // destroy drop marker if it is shown
686cdf0e10cSrcweir if( mpDropMarker )
687cdf0e10cSrcweir {
688cdf0e10cSrcweir ImplClearDrawDropMarker();
689cdf0e10cSrcweir mpDropMarkerObj = NULL;
690cdf0e10cSrcweir }
691cdf0e10cSrcweir
692cdf0e10cSrcweir if( !pPV->IsLayerLocked( aActiveLayer ) )
693cdf0e10cSrcweir {
694cdf0e10cSrcweir const OutlinerView* pOLV = GetTextEditOutlinerView();
695cdf0e10cSrcweir sal_Bool bIsInsideOutlinerView = sal_False;
696cdf0e10cSrcweir
697cdf0e10cSrcweir if( pOLV )
698cdf0e10cSrcweir {
699cdf0e10cSrcweir Rectangle aRect( pOLV->GetOutputArea() );
700cdf0e10cSrcweir
701cdf0e10cSrcweir if( GetMarkedObjectCount() == 1 )
702cdf0e10cSrcweir {
703cdf0e10cSrcweir SdrMark* pMark = GetSdrMarkByIndex(0);
704cdf0e10cSrcweir SdrObject* pObj = pMark->GetMarkedSdrObj();
705cdf0e10cSrcweir aRect.Union( pObj->GetLogicRect() );
706cdf0e10cSrcweir }
707cdf0e10cSrcweir
708cdf0e10cSrcweir Point aPos( pOLV->GetWindow()->PixelToLogic( rEvt.maPosPixel ) );
709cdf0e10cSrcweir
710cdf0e10cSrcweir if( aRect.IsInside( aPos ) )
711cdf0e10cSrcweir {
712cdf0e10cSrcweir bIsInsideOutlinerView = sal_True;
713cdf0e10cSrcweir }
714cdf0e10cSrcweir }
715cdf0e10cSrcweir
716cdf0e10cSrcweir if( !bIsInsideOutlinerView )
717cdf0e10cSrcweir {
718cdf0e10cSrcweir Point aPos;
719cdf0e10cSrcweir TransferableDataHelper aDataHelper( rEvt.maDropEvent.Transferable );
720cdf0e10cSrcweir
721cdf0e10cSrcweir if( pTargetWindow )
722cdf0e10cSrcweir aPos = pTargetWindow->PixelToLogic( rEvt.maPosPixel );
723cdf0e10cSrcweir
724cdf0e10cSrcweir // handle insert?
725cdf0e10cSrcweir if( (!nRet && ( SDRDRAG_GRADIENT == GetDragMode() )) || (( SDRDRAG_TRANSPARENCE == GetDragMode() ) && aDataHelper.HasFormat( SOT_FORMATSTR_ID_XFA )) )
726cdf0e10cSrcweir {
727cdf0e10cSrcweir const SdrHdlList& rHdlList = GetHdlList();
728cdf0e10cSrcweir
729cdf0e10cSrcweir for( sal_uInt32 n = 0; !nRet && n < rHdlList.GetHdlCount(); n++ )
730cdf0e10cSrcweir {
731cdf0e10cSrcweir SdrHdl* pIAOHandle = rHdlList.GetHdl( n );
732cdf0e10cSrcweir
733cdf0e10cSrcweir if( pIAOHandle && ( HDL_COLR == pIAOHandle->GetKind() ) )
734cdf0e10cSrcweir {
735cdf0e10cSrcweir if(pIAOHandle->getOverlayObjectList().isHitPixel(rEvt.maPosPixel))
736cdf0e10cSrcweir {
737cdf0e10cSrcweir SotStorageStreamRef xStm;
738cdf0e10cSrcweir
739cdf0e10cSrcweir if( aDataHelper.GetSotStorageStream( SOT_FORMATSTR_ID_XFA, xStm ) && xStm.Is() )
740cdf0e10cSrcweir {
741cdf0e10cSrcweir XFillExchangeData aFillData( XFillAttrSetItem( &mpDoc->GetPool() ) );
742cdf0e10cSrcweir
743cdf0e10cSrcweir *xStm >> aFillData;
744cdf0e10cSrcweir const Color aColor( ( (XFillColorItem&) aFillData.GetXFillAttrSetItem()->GetItemSet().Get( XATTR_FILLCOLOR ) ).GetColorValue() );
745cdf0e10cSrcweir static_cast< SdrHdlColor* >( pIAOHandle )->SetColor( aColor, sal_True );
746cdf0e10cSrcweir nRet = nDropAction;
747cdf0e10cSrcweir }
748cdf0e10cSrcweir }
749cdf0e10cSrcweir }
750cdf0e10cSrcweir }
751cdf0e10cSrcweir }
752cdf0e10cSrcweir
753cdf0e10cSrcweir // standard insert?
754cdf0e10cSrcweir if( !nRet && InsertData( aDataHelper, aPos, nDropAction, sal_True, 0, nPage, nLayer ) )
755cdf0e10cSrcweir nRet = nDropAction;
756cdf0e10cSrcweir
757cdf0e10cSrcweir // special insert?
758cdf0e10cSrcweir if( !nRet && mpViewSh )
759cdf0e10cSrcweir {
760cdf0e10cSrcweir String aTmpString1, aTmpString2;
761cdf0e10cSrcweir INetBookmark aINetBookmark( aTmpString1, aTmpString2 );
762cdf0e10cSrcweir
763cdf0e10cSrcweir // insert bookmark
764cdf0e10cSrcweir if( aDataHelper.HasFormat( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ) &&
765cdf0e10cSrcweir aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK, aINetBookmark ) )
766cdf0e10cSrcweir {
767cdf0e10cSrcweir SdPageObjsTLB::SdPageObjsTransferable* pPageObjsTransferable = SdPageObjsTLB::SdPageObjsTransferable::getImplementation( aDataHelper.GetXTransferable() );
768cdf0e10cSrcweir
769cdf0e10cSrcweir if( pPageObjsTransferable &&
770cdf0e10cSrcweir ( NAVIGATOR_DRAGTYPE_LINK == pPageObjsTransferable->GetDragType() ||
771cdf0e10cSrcweir NAVIGATOR_DRAGTYPE_EMBEDDED == pPageObjsTransferable->GetDragType() ) )
772cdf0e10cSrcweir {
773cdf0e10cSrcweir // insert bookmark from own navigator (handled async. due to possible message box )
774cdf0e10cSrcweir Application::PostUserEvent( LINK( this, View, ExecuteNavigatorDrop ),
775cdf0e10cSrcweir new SdNavigatorDropEvent( rEvt, rTargetHelper, pTargetWindow,
776cdf0e10cSrcweir nPage, nLayer ) );
777cdf0e10cSrcweir nRet = nDropAction;
778cdf0e10cSrcweir }
779cdf0e10cSrcweir else
780cdf0e10cSrcweir {
781cdf0e10cSrcweir SdrObject* pPickObj = NULL;
782cdf0e10cSrcweir SdrPageView* pPageView = NULL;
783cdf0e10cSrcweir
784cdf0e10cSrcweir if( PickObj( aPos, getHitTolLog(), pPickObj, pPageView ) )
785cdf0e10cSrcweir {
786cdf0e10cSrcweir // insert as clip action => jump
787cdf0e10cSrcweir rtl::OUString aBookmark( aINetBookmark.GetURL() );
788cdf0e10cSrcweir SdAnimationInfo* pInfo = mpDoc->GetAnimationInfo( pPickObj );
789cdf0e10cSrcweir sal_Bool bCreated = sal_False;
790cdf0e10cSrcweir
791cdf0e10cSrcweir if( aBookmark.getLength() )
792cdf0e10cSrcweir {
793cdf0e10cSrcweir presentation::ClickAction eClickAction = presentation::ClickAction_DOCUMENT;
794cdf0e10cSrcweir
795cdf0e10cSrcweir sal_Int32 nIndex = aBookmark.indexOf( (sal_Unicode)'#' );
796cdf0e10cSrcweir if( nIndex != -1 )
797cdf0e10cSrcweir {
798cdf0e10cSrcweir const String aDocName( aBookmark.copy( 0, nIndex ) );
799cdf0e10cSrcweir
800cdf0e10cSrcweir if( mpDocSh->GetMedium()->GetName() == aDocName || mpDocSh->GetName() == aDocName )
801cdf0e10cSrcweir {
802cdf0e10cSrcweir // internal jump, only use the part after and including '#'
803cdf0e10cSrcweir eClickAction = presentation::ClickAction_BOOKMARK;
804cdf0e10cSrcweir aBookmark = aBookmark.copy( nIndex+1 );
805cdf0e10cSrcweir }
806cdf0e10cSrcweir }
807cdf0e10cSrcweir
808cdf0e10cSrcweir if( !pInfo )
809cdf0e10cSrcweir {
810cdf0e10cSrcweir pInfo = SdDrawDocument::GetShapeUserData( *pPickObj, true );
811cdf0e10cSrcweir bCreated = sal_True;
812cdf0e10cSrcweir }
813cdf0e10cSrcweir
814cdf0e10cSrcweir // Undo-Action mit alten und neuen Groessen erzeugen
815cdf0e10cSrcweir SdAnimationPrmsUndoAction* pAction = new SdAnimationPrmsUndoAction(mpDoc, pPickObj, bCreated);
816cdf0e10cSrcweir pAction->SetActive(pInfo->mbActive, pInfo->mbActive);
817cdf0e10cSrcweir pAction->SetEffect(pInfo->meEffect, pInfo->meEffect);
818cdf0e10cSrcweir pAction->SetTextEffect(pInfo->meTextEffect, pInfo->meTextEffect);
819cdf0e10cSrcweir pAction->SetSpeed(pInfo->meSpeed, pInfo->meSpeed);
820cdf0e10cSrcweir pAction->SetDim(pInfo->mbDimPrevious, pInfo->mbDimPrevious);
821cdf0e10cSrcweir pAction->SetDimColor(pInfo->maDimColor, pInfo->maDimColor);
822cdf0e10cSrcweir pAction->SetDimHide(pInfo->mbDimHide, pInfo->mbDimHide);
823cdf0e10cSrcweir pAction->SetSoundOn(pInfo->mbSoundOn, pInfo->mbSoundOn);
824cdf0e10cSrcweir pAction->SetSound(pInfo->maSoundFile, pInfo->maSoundFile);
825cdf0e10cSrcweir pAction->SetPlayFull(pInfo->mbPlayFull, pInfo->mbPlayFull);
826cdf0e10cSrcweir pAction->SetPathObj(pInfo->mpPathObj, pInfo->mpPathObj);
827cdf0e10cSrcweir pAction->SetClickAction(pInfo->meClickAction, eClickAction);
828cdf0e10cSrcweir pAction->SetBookmark(pInfo->GetBookmark(), aBookmark);
829cdf0e10cSrcweir // pAction->SetInvisibleInPres(pInfo->mbInvisibleInPresentation, sal_True);
830cdf0e10cSrcweir pAction->SetVerb(pInfo->mnVerb, pInfo->mnVerb);
831cdf0e10cSrcweir pAction->SetSecondEffect(pInfo->meSecondEffect, pInfo->meSecondEffect);
832cdf0e10cSrcweir pAction->SetSecondSpeed(pInfo->meSecondSpeed, pInfo->meSecondSpeed);
833cdf0e10cSrcweir pAction->SetSecondSoundOn(pInfo->mbSecondSoundOn, pInfo->mbSecondSoundOn);
834cdf0e10cSrcweir pAction->SetSecondPlayFull(pInfo->mbSecondPlayFull, pInfo->mbSecondPlayFull);
835cdf0e10cSrcweir
836cdf0e10cSrcweir String aString(SdResId(STR_UNDO_ANIMATION));
837cdf0e10cSrcweir pAction->SetComment(aString);
838cdf0e10cSrcweir mpDocSh->GetUndoManager()->AddUndoAction(pAction);
839cdf0e10cSrcweir pInfo->meClickAction = eClickAction;
840cdf0e10cSrcweir pInfo->SetBookmark( aBookmark );
841cdf0e10cSrcweir mpDoc->SetChanged();
842cdf0e10cSrcweir
843cdf0e10cSrcweir nRet = nDropAction;
844cdf0e10cSrcweir }
845cdf0e10cSrcweir }
846cdf0e10cSrcweir else if( mpViewSh->ISA( DrawViewShell ) )
847cdf0e10cSrcweir {
848cdf0e10cSrcweir // insert as normal URL button
849cdf0e10cSrcweir ( (DrawViewShell*) mpViewSh )->InsertURLButton( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), String(), &aPos );
850cdf0e10cSrcweir nRet = nDropAction;
851cdf0e10cSrcweir }
852cdf0e10cSrcweir }
853cdf0e10cSrcweir }
854cdf0e10cSrcweir }
855cdf0e10cSrcweir }
856cdf0e10cSrcweir }
857cdf0e10cSrcweir
858cdf0e10cSrcweir return nRet;
859cdf0e10cSrcweir }
860cdf0e10cSrcweir
861cdf0e10cSrcweir // -----------------------------------------------------------------------------
862cdf0e10cSrcweir
IMPL_LINK(View,ExecuteNavigatorDrop,SdNavigatorDropEvent *,pSdNavigatorDropEvent)863cdf0e10cSrcweir IMPL_LINK( View, ExecuteNavigatorDrop, SdNavigatorDropEvent*, pSdNavigatorDropEvent )
864cdf0e10cSrcweir {
865cdf0e10cSrcweir TransferableDataHelper aDataHelper( pSdNavigatorDropEvent->maDropEvent.Transferable );
866cdf0e10cSrcweir SdPageObjsTLB::SdPageObjsTransferable* pPageObjsTransferable = SdPageObjsTLB::SdPageObjsTransferable::getImplementation( aDataHelper.GetXTransferable() );
867cdf0e10cSrcweir INetBookmark aINetBookmark;
868cdf0e10cSrcweir
869cdf0e10cSrcweir if( pPageObjsTransferable && aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK, aINetBookmark ) )
870cdf0e10cSrcweir {
871cdf0e10cSrcweir Point aPos;
872cdf0e10cSrcweir List aBookmarkList;
873cdf0e10cSrcweir String aBookmark;
874cdf0e10cSrcweir SdPage* pPage = (SdPage*) GetSdrPageView()->GetPage();
875cdf0e10cSrcweir sal_uInt16 nPgPos = 0xFFFF;
876cdf0e10cSrcweir
877cdf0e10cSrcweir if( pSdNavigatorDropEvent->mpTargetWindow )
878cdf0e10cSrcweir aPos = pSdNavigatorDropEvent->mpTargetWindow->PixelToLogic( pSdNavigatorDropEvent->maPosPixel );
879cdf0e10cSrcweir
880cdf0e10cSrcweir const rtl::OUString aURL( aINetBookmark.GetURL() );
881cdf0e10cSrcweir sal_Int32 nIndex = aURL.indexOf( (sal_Unicode)'#' );
882cdf0e10cSrcweir if( nIndex != -1 )
883cdf0e10cSrcweir aBookmark = aURL.copy( nIndex+1 );
884cdf0e10cSrcweir aBookmarkList.Insert( &aBookmark );
885cdf0e10cSrcweir
886cdf0e10cSrcweir if( !pPage->IsMasterPage() )
887cdf0e10cSrcweir {
888cdf0e10cSrcweir if( pPage->GetPageKind() == PK_STANDARD )
889cdf0e10cSrcweir nPgPos = pPage->GetPageNum() + 2;
890cdf0e10cSrcweir else if( pPage->GetPageKind() == PK_NOTES )
891cdf0e10cSrcweir nPgPos = pPage->GetPageNum() + 1;
892cdf0e10cSrcweir }
893cdf0e10cSrcweir
894cdf0e10cSrcweir // Um zu gewaehrleisten, dass alle Seitennamen eindeutig sind, werden
895cdf0e10cSrcweir // die einzufuegenden geprueft und gegebenenfalls in einer Ersatzliste
896cdf0e10cSrcweir // aufgenommen (bNameOK == sal_False -> Benutzer hat abgebrochen)
897cdf0e10cSrcweir List* pExchangeList = NULL;
898cdf0e10cSrcweir sal_Bool bLink = ( NAVIGATOR_DRAGTYPE_LINK == pPageObjsTransferable->GetDragType() ? sal_True : sal_False );
899cdf0e10cSrcweir sal_Bool bNameOK = GetExchangeList( pExchangeList, &aBookmarkList, 2 );
900cdf0e10cSrcweir sal_Bool bReplace = sal_False;
901cdf0e10cSrcweir
902cdf0e10cSrcweir // Da man hier nicht weiss, ob es sich um eine Seite oder ein Objekt handelt,
903cdf0e10cSrcweir // wird eine Liste sowohl mit Seiten, als auch mit Objekten gefuellt.
904cdf0e10cSrcweir // Sollten Seitennamen und Objektnamen identisch sein gibt es hier natuerlich Probleme !!!
905cdf0e10cSrcweir if( bNameOK )
906cdf0e10cSrcweir {
907cdf0e10cSrcweir mpDoc->InsertBookmark( &aBookmarkList, pExchangeList,
908cdf0e10cSrcweir bLink, bReplace, nPgPos, sal_False,
909cdf0e10cSrcweir &pPageObjsTransferable->GetDocShell(),
910cdf0e10cSrcweir sal_True, &aPos );
911cdf0e10cSrcweir }
912cdf0e10cSrcweir
913cdf0e10cSrcweir // Loeschen der ExchangeList
914cdf0e10cSrcweir if( pExchangeList )
915cdf0e10cSrcweir {
916cdf0e10cSrcweir for( void* p = pExchangeList->First(); p; p = pExchangeList->Next() )
917cdf0e10cSrcweir delete (String*) p;
918cdf0e10cSrcweir
919cdf0e10cSrcweir delete pExchangeList;
920cdf0e10cSrcweir }
921cdf0e10cSrcweir }
922cdf0e10cSrcweir
923cdf0e10cSrcweir delete pSdNavigatorDropEvent;
924cdf0e10cSrcweir
925cdf0e10cSrcweir return 0;
926cdf0e10cSrcweir }
927cdf0e10cSrcweir
928cdf0e10cSrcweir /*************************************************************************
929cdf0e10cSrcweir |*
930cdf0e10cSrcweir |* Rueckgabeparameter:
931cdf0e10cSrcweir |* pExchangeList == NULL -> Namen sind alle eindeutig
932cdf0e10cSrcweir |* bNameOK == sal_False -> Benutzer hat abgebrochen
933cdf0e10cSrcweir |* nType == 0 -> Seiten
934cdf0e10cSrcweir |* nType == 1 -> Objekte
935cdf0e10cSrcweir |* nType == 2 -> Seiten + Objekte
936cdf0e10cSrcweir |*
937cdf0e10cSrcweir \************************************************************************/
938cdf0e10cSrcweir
GetExchangeList(List * & rpExchangeList,List * pBookmarkList,sal_uInt16 nType)939cdf0e10cSrcweir sal_Bool View::GetExchangeList( List*& rpExchangeList, List* pBookmarkList, sal_uInt16 nType )
940cdf0e10cSrcweir {
941cdf0e10cSrcweir DBG_ASSERT( !rpExchangeList, "ExchangeList muss NULL sein!");
942cdf0e10cSrcweir
943cdf0e10cSrcweir sal_Bool bListIdentical = sal_True; // BookmarkList und ExchangeList sind gleich
944cdf0e10cSrcweir sal_Bool bNameOK = sal_True; // Name ist eindeutig
945cdf0e10cSrcweir
946cdf0e10cSrcweir rpExchangeList = new List();
947cdf0e10cSrcweir
948cdf0e10cSrcweir if( pBookmarkList )
949cdf0e10cSrcweir {
950cdf0e10cSrcweir String* pString = (String*) pBookmarkList->First();
951cdf0e10cSrcweir
952cdf0e10cSrcweir while( pString && bNameOK )
953cdf0e10cSrcweir {
954cdf0e10cSrcweir String* pNewName = new String( *pString );
955cdf0e10cSrcweir
956cdf0e10cSrcweir if( nType == 0 || nType == 2 )
957cdf0e10cSrcweir bNameOK = mpDocSh->CheckPageName (
958cdf0e10cSrcweir mpViewSh->GetActiveWindow(), *pNewName);
959cdf0e10cSrcweir
960cdf0e10cSrcweir if( bNameOK && ( nType == 1 || nType == 2 ) )
961cdf0e10cSrcweir {
962cdf0e10cSrcweir if( mpDoc->GetObj( *pNewName ) )
963cdf0e10cSrcweir {
964cdf0e10cSrcweir String aTitle( SdResId( STR_TITLE_NAMEGROUP ) );
965cdf0e10cSrcweir String aDesc( SdResId( STR_DESC_NAMEGROUP ) );
966cdf0e10cSrcweir SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
967cdf0e10cSrcweir AbstractSvxNameDialog* pDlg = pFact ? pFact->CreateSvxNameDialog( mpViewSh->GetActiveWindow(), *pNewName, aDesc ) : 0;
968cdf0e10cSrcweir if( pDlg )
969cdf0e10cSrcweir {
970cdf0e10cSrcweir pDlg->SetEditHelpId( HID_SD_NAMEDIALOG_OBJECT );
971cdf0e10cSrcweir
972cdf0e10cSrcweir bNameOK = sal_False;
973cdf0e10cSrcweir pDlg->SetText( aTitle );
974cdf0e10cSrcweir
975cdf0e10cSrcweir while( !bNameOK && pDlg->Execute() == RET_OK )
976cdf0e10cSrcweir {
977cdf0e10cSrcweir pDlg->GetName( *pNewName );
978cdf0e10cSrcweir
979cdf0e10cSrcweir if( !mpDoc->GetObj( *pNewName ) )
980cdf0e10cSrcweir bNameOK = sal_True;
981cdf0e10cSrcweir }
982cdf0e10cSrcweir
983cdf0e10cSrcweir delete pDlg;
984cdf0e10cSrcweir }
985cdf0e10cSrcweir }
986cdf0e10cSrcweir }
987cdf0e10cSrcweir
988cdf0e10cSrcweir if( bListIdentical )
989cdf0e10cSrcweir bListIdentical = ( *pString == *pNewName );
990cdf0e10cSrcweir
991cdf0e10cSrcweir rpExchangeList->Insert( pNewName, LIST_APPEND );
992cdf0e10cSrcweir pString = (String*) pBookmarkList->Next();
993cdf0e10cSrcweir }
994cdf0e10cSrcweir }
995cdf0e10cSrcweir
996cdf0e10cSrcweir // ExchangeList ist mit BookmarkList identisch
997cdf0e10cSrcweir if( rpExchangeList && bListIdentical )
998cdf0e10cSrcweir {
999cdf0e10cSrcweir String* pString = (String*) rpExchangeList->First();
1000cdf0e10cSrcweir while( pString )
1001cdf0e10cSrcweir {
1002cdf0e10cSrcweir delete pString;
1003cdf0e10cSrcweir pString = (String*) rpExchangeList->Next();
1004cdf0e10cSrcweir }
1005cdf0e10cSrcweir delete rpExchangeList;
1006cdf0e10cSrcweir rpExchangeList = NULL;
1007cdf0e10cSrcweir }
1008cdf0e10cSrcweir
1009cdf0e10cSrcweir return( bNameOK );
1010cdf0e10cSrcweir }
1011cdf0e10cSrcweir
1012cdf0e10cSrcweir typedef std::vector< std::pair< sal_uInt32, sal_uInt32 > > PathSurrogateVector;
1013cdf0e10cSrcweir typedef std::vector< SdrObject* > SdrObjectVector;
1014cdf0e10cSrcweir
ImplProcessObjectList(SdrObject * pObj,SdrObjectVector & rVector)1015cdf0e10cSrcweir void ImplProcessObjectList(SdrObject* pObj, SdrObjectVector& rVector )
1016cdf0e10cSrcweir {
1017cdf0e10cSrcweir sal_Bool bIsGroup(pObj->IsGroupObject());
1018cdf0e10cSrcweir if(bIsGroup && pObj->ISA(E3dObject) && !pObj->ISA(E3dScene))
1019cdf0e10cSrcweir bIsGroup = sal_False;
1020cdf0e10cSrcweir
1021cdf0e10cSrcweir rVector.push_back( pObj );
1022cdf0e10cSrcweir
1023cdf0e10cSrcweir if(bIsGroup)
1024cdf0e10cSrcweir {
1025cdf0e10cSrcweir SdrObjList* pObjList = pObj->GetSubList();
1026cdf0e10cSrcweir sal_uInt32 a;
1027cdf0e10cSrcweir for( a = 0; a < pObjList->GetObjCount(); a++)
1028cdf0e10cSrcweir ImplProcessObjectList(pObjList->GetObj(a), rVector);
1029cdf0e10cSrcweir }
1030cdf0e10cSrcweir }
1031cdf0e10cSrcweir
GetMarkedObjModel() const1032cdf0e10cSrcweir SdrModel* View::GetMarkedObjModel() const
1033cdf0e10cSrcweir {
1034cdf0e10cSrcweir return FmFormView::GetMarkedObjModel();;
1035cdf0e10cSrcweir }
1036cdf0e10cSrcweir
Paste(const SdrModel & rMod,const Point & rPos,SdrObjList * pLst,sal_uInt32 nOptions)1037cdf0e10cSrcweir sal_Bool View::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst /* =NULL */, sal_uInt32 nOptions /* =0 */)
1038cdf0e10cSrcweir {
1039cdf0e10cSrcweir return FmFormView::Paste( rMod, rPos, pLst,nOptions );;
1040cdf0e10cSrcweir }
1041cdf0e10cSrcweir
1042cdf0e10cSrcweir } // end of namespace sd
1043