xref: /AOO42X/main/sd/source/ui/view/drviews2.cxx (revision 1ff378ef29d061c5ebed689ca488bcdadd10692f)
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
10cdf0e10cSrcweir  *
115b190011SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
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.
19cdf0e10cSrcweir  *
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 #include "DrawViewShell.hxx"
28cdf0e10cSrcweir #include "ViewShellImplementation.hxx"
29cdf0e10cSrcweir #include <vcl/waitobj.hxx>
30cdf0e10cSrcweir #include <svx/svdograf.hxx>
31cdf0e10cSrcweir #ifndef _SVXIDS_HRC
32cdf0e10cSrcweir #include <svx/svxids.hrc>
33cdf0e10cSrcweir #endif
34cdf0e10cSrcweir #include <svx/svdpagv.hxx>
35cdf0e10cSrcweir #include <svx/svdundo.hxx>
36cdf0e10cSrcweir #ifndef _ZOOMITEM_HXX
37cdf0e10cSrcweir #include <svx/zoomitem.hxx>
38cdf0e10cSrcweir #endif
39cdf0e10cSrcweir #ifndef _EDITDATA_HXX
40cdf0e10cSrcweir #include <editeng/editdata.hxx>
41cdf0e10cSrcweir #endif
42cdf0e10cSrcweir #include <basic/sberrors.hxx>
43cdf0e10cSrcweir #include <vcl/msgbox.hxx>
44cdf0e10cSrcweir #include <sfx2/request.hxx>
45cdf0e10cSrcweir #include <sfx2/dispatch.hxx>
46cdf0e10cSrcweir #include <svx/xfillit0.hxx>
47cdf0e10cSrcweir #include <svx/xflclit.hxx>
48cdf0e10cSrcweir #include <svl/aeitem.hxx>
49cdf0e10cSrcweir #include <editeng/eeitem.hxx>
50cdf0e10cSrcweir #include <basic/sbstar.hxx>
51cdf0e10cSrcweir #include <editeng/flditem.hxx>
52cdf0e10cSrcweir #include <svx/xlineit0.hxx>
53cdf0e10cSrcweir #include <svx/xfillit0.hxx>
54cdf0e10cSrcweir 
55cdf0e10cSrcweir #ifndef _SDOUTL_HXX //autogen
56cdf0e10cSrcweir #include <svx/svdoutl.hxx>
57cdf0e10cSrcweir #endif
58cdf0e10cSrcweir #include <svx/xlnwtit.hxx>
59cdf0e10cSrcweir #include <svx/svdoattr.hxx>
60cdf0e10cSrcweir #include <svx/xlnstwit.hxx>
61cdf0e10cSrcweir #include <svx/sdtmfitm.hxx>
62cdf0e10cSrcweir #include <svx/sdtagitm.hxx>
63cdf0e10cSrcweir #include <svx/xlnedwit.hxx>
64cdf0e10cSrcweir #include <svx/fontworkbar.hxx>
65cdf0e10cSrcweir 
66*1ff378efSZheng Fan #include <editeng/escpitem.hxx>
67*1ff378efSZheng Fan #include <editeng/kernitem.hxx>
68*1ff378efSZheng Fan #include <editeng/wghtitem.hxx>
69*1ff378efSZheng Fan #include <editeng/postitem.hxx>
70*1ff378efSZheng Fan #include <editeng/udlnitem.hxx>
71*1ff378efSZheng Fan #include <editeng/crsditem.hxx>
72*1ff378efSZheng Fan #include <editeng/cntritem.hxx>
73*1ff378efSZheng Fan #include <editeng/shdditem.hxx>
74*1ff378efSZheng Fan #include <svx/xtable.hxx>
75*1ff378efSZheng Fan #include <svx/svdobj.hxx>
76*1ff378efSZheng Fan #include <editeng/outlobj.hxx>
77*1ff378efSZheng Fan #include <editeng/flstitem.hxx>
78*1ff378efSZheng Fan #include <editeng/scripttypeitem.hxx>
79*1ff378efSZheng Fan #include <editeng/fontitem.hxx>
80*1ff378efSZheng Fan #include <editeng/fhgtitem.hxx>
81*1ff378efSZheng Fan #include <editeng/colritem.hxx>
82*1ff378efSZheng Fan #include <editeng/brshitem.hxx>
83*1ff378efSZheng Fan 
84*1ff378efSZheng Fan #include <svl/whiter.hxx>
85*1ff378efSZheng Fan 
86cdf0e10cSrcweir #include <svx/svxdlg.hxx>
87cdf0e10cSrcweir #include <svx/dialogs.hrc>
88cdf0e10cSrcweir 
89cdf0e10cSrcweir #include <sfx2/viewfrm.hxx>
90cdf0e10cSrcweir #include "sdgrffilter.hxx"
91cdf0e10cSrcweir 
92cdf0e10cSrcweir #include "app.hrc"
93cdf0e10cSrcweir #include "glob.hrc"
94cdf0e10cSrcweir #include "helpids.h"
95cdf0e10cSrcweir #include "sdattr.hxx"
96cdf0e10cSrcweir #include "drawview.hxx"
97cdf0e10cSrcweir #include "Window.hxx"
98cdf0e10cSrcweir #include "drawdoc.hxx"
99cdf0e10cSrcweir #include "DrawDocShell.hxx"
100cdf0e10cSrcweir #include "sdpage.hxx"
101cdf0e10cSrcweir #include "fuscale.hxx"
102cdf0e10cSrcweir #include "sdresid.hxx"
103cdf0e10cSrcweir #include "GraphicViewShell.hxx"
104cdf0e10cSrcweir #include "unmodpg.hxx"
105cdf0e10cSrcweir #include "slideshow.hxx"
106cdf0e10cSrcweir #include "fuvect.hxx"
107cdf0e10cSrcweir #include "stlpool.hxx"
108cdf0e10cSrcweir 
109cdf0e10cSrcweir // #90356#
110cdf0e10cSrcweir #include "optsitem.hxx"
111cdf0e10cSrcweir #include "sdabstdlg.hxx"
112cdf0e10cSrcweir #include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
113cdf0e10cSrcweir #include <com/sun/star/drawing/XDrawPages.hpp>
114cdf0e10cSrcweir 
115cdf0e10cSrcweir #include <strings.hrc>
116cdf0e10cSrcweir 
117cdf0e10cSrcweir using namespace ::com::sun::star;
118cdf0e10cSrcweir using namespace ::com::sun::star::uno;
119cdf0e10cSrcweir 
120cdf0e10cSrcweir namespace sd {
121cdf0e10cSrcweir 
122cdf0e10cSrcweir /*************************************************************************
123cdf0e10cSrcweir |*
124cdf0e10cSrcweir |* SfxRequests fuer temporaere Funktionen
125cdf0e10cSrcweir |*
126cdf0e10cSrcweir \************************************************************************/
127cdf0e10cSrcweir 
128cdf0e10cSrcweir void DrawViewShell::FuTemporary(SfxRequest& rReq)
129cdf0e10cSrcweir {
130cdf0e10cSrcweir     // Waehrend einer Native-Diashow wird nichts ausgefuehrt!
131cdf0e10cSrcweir     if(SlideShow::IsRunning( GetViewShellBase() ) && (rReq.GetSlot() != SID_NAVIGATOR))
132cdf0e10cSrcweir         return;
133cdf0e10cSrcweir 
134cdf0e10cSrcweir     DBG_ASSERT( mpDrawView, "sd::DrawViewShell::FuTemporary(), no draw view!" );
135cdf0e10cSrcweir     if( !mpDrawView )
136cdf0e10cSrcweir         return;
137cdf0e10cSrcweir 
138cdf0e10cSrcweir     CheckLineTo (rReq);
139cdf0e10cSrcweir 
140cdf0e10cSrcweir     DeactivateCurrentFunction();
141cdf0e10cSrcweir 
142cdf0e10cSrcweir     sal_uInt16 nSId = rReq.GetSlot();
143cdf0e10cSrcweir 
144cdf0e10cSrcweir     // Slot wird gemapped (ToolboxImages/-Slots)
145cdf0e10cSrcweir     MapSlot( nSId );
146cdf0e10cSrcweir 
147cdf0e10cSrcweir     switch ( nSId )
148cdf0e10cSrcweir     {
149cdf0e10cSrcweir         // Flaechen und Linien-Attribute:
150cdf0e10cSrcweir         // Sollten (wie StateMethode) eine eigene
151cdf0e10cSrcweir         // Execute-Methode besitzen
152cdf0e10cSrcweir         case SID_ATTR_FILL_STYLE:
153cdf0e10cSrcweir         case SID_ATTR_FILL_COLOR:
154cdf0e10cSrcweir         case SID_ATTR_FILL_GRADIENT:
155cdf0e10cSrcweir         case SID_ATTR_FILL_HATCH:
156cdf0e10cSrcweir         case SID_ATTR_FILL_BITMAP:
157cdf0e10cSrcweir         case SID_ATTR_FILL_SHADOW:
158d5370dc8SArmin Le Grand         case SID_ATTR_FILL_TRANSPARENCE:
159d5370dc8SArmin Le Grand         case SID_ATTR_FILL_FLOATTRANSPARENCE:
160cdf0e10cSrcweir 
161cdf0e10cSrcweir         case SID_ATTR_LINE_STYLE:
162cdf0e10cSrcweir         case SID_ATTR_LINE_DASH:
163cdf0e10cSrcweir         case SID_ATTR_LINE_WIDTH:
164cdf0e10cSrcweir         case SID_ATTR_LINE_COLOR:
165cdf0e10cSrcweir         case SID_ATTR_LINEEND_STYLE:
166d5370dc8SArmin Le Grand         case SID_ATTR_LINE_START:
167d5370dc8SArmin Le Grand         case SID_ATTR_LINE_END:
168d5370dc8SArmin Le Grand         case SID_ATTR_LINE_TRANSPARENCE:
169d5370dc8SArmin Le Grand         case SID_ATTR_LINE_JOINT:
170d5370dc8SArmin Le Grand         case SID_ATTR_LINE_CAP:
171cdf0e10cSrcweir 
172cdf0e10cSrcweir         case SID_ATTR_TEXT_FITTOSIZE:
173cdf0e10cSrcweir         {
174cdf0e10cSrcweir             if( rReq.GetArgs() )
175cdf0e10cSrcweir             {
176cdf0e10cSrcweir                 sal_Bool bMergeUndo = sal_False;
177cdf0e10cSrcweir                 ::svl::IUndoManager* pUndoManager = GetDocSh()->GetUndoManager();
178cdf0e10cSrcweir 
179cdf0e10cSrcweir                 // Anpassungen Start/EndWidth #63083#
180cdf0e10cSrcweir                 if(nSId == SID_ATTR_LINE_WIDTH)
181cdf0e10cSrcweir                 {
182cdf0e10cSrcweir                     SdrObject* pObj = NULL;
183cdf0e10cSrcweir                     const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
184cdf0e10cSrcweir                     sal_uLong nCount = rMarkList.GetMarkCount();
1851dc0a253SArmin Le Grand                     const sal_Int32 nNewLineWidth(((const XLineWidthItem&)rReq.GetArgs()->Get(XATTR_LINEWIDTH)).GetValue());
1861dc0a253SArmin Le Grand                     const bool bUndo(mpDrawView->IsUndoEnabled());
187cdf0e10cSrcweir 
188cdf0e10cSrcweir                     for (sal_uLong i=0; i<nCount; i++)
189cdf0e10cSrcweir                     {
190cdf0e10cSrcweir                         SfxItemSet aAttr(GetDoc()->GetPool());
191cdf0e10cSrcweir                         pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
192cdf0e10cSrcweir                         aAttr.Put(pObj->GetMergedItemSet());
193cdf0e10cSrcweir 
194cdf0e10cSrcweir                         sal_Int32 nActLineWidth = ((const XLineWidthItem&)aAttr.Get(XATTR_LINEWIDTH)).GetValue();
195cdf0e10cSrcweir 
196cdf0e10cSrcweir                         if(nActLineWidth != nNewLineWidth)
197cdf0e10cSrcweir                         {
198cdf0e10cSrcweir                             sal_Bool bSetItemSet(sal_False);
199cdf0e10cSrcweir 
200cdf0e10cSrcweir                             // #86265# do this for SFX_ITEM_DEFAULT and for SFX_ITEM_SET
201cdf0e10cSrcweir                             if(SFX_ITEM_DONTCARE != aAttr.GetItemState(XATTR_LINESTARTWIDTH))
202cdf0e10cSrcweir                             {
203cdf0e10cSrcweir                                 sal_Int32 nValAct = ((const XLineStartWidthItem&)aAttr.Get(XATTR_LINESTARTWIDTH)).GetValue();
204cdf0e10cSrcweir                                 sal_Int32 nValNew = nValAct + (((nNewLineWidth - nActLineWidth) * 15) / 10);
205cdf0e10cSrcweir                                 if(nValNew < 0)
206cdf0e10cSrcweir                                     nValNew = 0;
207cdf0e10cSrcweir                                 bSetItemSet = sal_True;
208cdf0e10cSrcweir                                 aAttr.Put(XLineStartWidthItem(nValNew));
209cdf0e10cSrcweir                             }
210cdf0e10cSrcweir 
211cdf0e10cSrcweir                             // #86265# do this for SFX_ITEM_DEFAULT and for SFX_ITEM_SET
212cdf0e10cSrcweir                             if(SFX_ITEM_DONTCARE != aAttr.GetItemState(XATTR_LINEENDWIDTH))
213cdf0e10cSrcweir                             {
214cdf0e10cSrcweir                                 sal_Int32 nValAct = ((const XLineEndWidthItem&)aAttr.Get(XATTR_LINEENDWIDTH)).GetValue();
215cdf0e10cSrcweir                                 sal_Int32 nValNew = nValAct + (((nNewLineWidth - nActLineWidth) * 15) / 10);
216cdf0e10cSrcweir                                 if(nValNew < 0)
217cdf0e10cSrcweir                                     nValNew = 0;
218cdf0e10cSrcweir                                 bSetItemSet = sal_True;
219cdf0e10cSrcweir                                 aAttr.Put(XLineEndWidthItem(nValNew));
220cdf0e10cSrcweir                             }
221cdf0e10cSrcweir 
222cdf0e10cSrcweir                             if(bSetItemSet)
2231dc0a253SArmin Le Grand                             {
2241dc0a253SArmin Le Grand                                 if(bUndo)
2251dc0a253SArmin Le Grand                                 {
2261dc0a253SArmin Le Grand                                     if(!bMergeUndo)
2271dc0a253SArmin Le Grand                                     {
2281dc0a253SArmin Le Grand                                         pUndoManager->EnterListAction( String(), String() );
2291dc0a253SArmin Le Grand                                         mpDrawView->BegUndo();
2301dc0a253SArmin Le Grand                                         bMergeUndo = sal_True;
2311dc0a253SArmin Le Grand                                     }
2321dc0a253SArmin Le Grand 
2331dc0a253SArmin Le Grand                                     mpDrawView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj));
2341dc0a253SArmin Le Grand                                 }
2351dc0a253SArmin Le Grand 
236cdf0e10cSrcweir                                 pObj->SetMergedItemSet(aAttr);
237cdf0e10cSrcweir                             }
238cdf0e10cSrcweir                         }
239cdf0e10cSrcweir                     }
240cdf0e10cSrcweir 
2411dc0a253SArmin Le Grand                     if(bMergeUndo)
2421dc0a253SArmin Le Grand                     {
2431dc0a253SArmin Le Grand                         mpDrawView->EndUndo();
2441dc0a253SArmin Le Grand                     }
2451dc0a253SArmin Le Grand                 }
2461dc0a253SArmin Le Grand 
247cdf0e10cSrcweir                 if (nSId == SID_ATTR_FILL_SHADOW)
248cdf0e10cSrcweir                 {
249cdf0e10cSrcweir                     // Ggf. werden transparente Objekte wei?gefuellt
250cdf0e10cSrcweir                     SdrObject* pObj = NULL;
251cdf0e10cSrcweir                     const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
252cdf0e10cSrcweir                     sal_uLong nCount = rMarkList.GetMarkCount();
253cdf0e10cSrcweir                     const bool bUndo = mpDrawView->IsUndoEnabled();
254cdf0e10cSrcweir 
255cdf0e10cSrcweir                     for (sal_uLong i=0; i<nCount; i++)
256cdf0e10cSrcweir                     {
257cdf0e10cSrcweir                         SfxItemSet aAttr(GetDoc()->GetPool());
258cdf0e10cSrcweir                         pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
259cdf0e10cSrcweir 
260cdf0e10cSrcweir                         // #i25616#
261cdf0e10cSrcweir                         if(!pObj->ISA(SdrGrafObj))
262cdf0e10cSrcweir                         {
263cdf0e10cSrcweir                             aAttr.Put(pObj->GetMergedItemSet());
264cdf0e10cSrcweir 
2651dc0a253SArmin Le Grand                             const XFillStyleItem& rFillStyle = (const XFillStyleItem&) aAttr.Get(XATTR_FILLSTYLE);
2661dc0a253SArmin Le Grand                             const XLineStyleItem& rLineStyle = (const XLineStyleItem&) aAttr.Get(XATTR_LINESTYLE);
267cdf0e10cSrcweir 
2681dc0a253SArmin Le Grand                             if(XFILL_NONE == rFillStyle.GetValue() && XLINE_NONE == rLineStyle.GetValue())
269cdf0e10cSrcweir                             {
270cdf0e10cSrcweir                                 if( bUndo )
271cdf0e10cSrcweir                                 {
272cdf0e10cSrcweir                                     // Vorlage hat keine Fuellung,
273cdf0e10cSrcweir                                     // daher hart attributieren: Fuellung setzen
274cdf0e10cSrcweir                                     if (!bMergeUndo)
275cdf0e10cSrcweir                                     {
276cdf0e10cSrcweir                                         bMergeUndo = sal_True;
277cdf0e10cSrcweir                                         pUndoManager->EnterListAction( String(), String() );
278cdf0e10cSrcweir                                         mpDrawView->BegUndo();
279cdf0e10cSrcweir                                     }
280cdf0e10cSrcweir 
281cdf0e10cSrcweir                                     mpDrawView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj));
282cdf0e10cSrcweir                                 }
283cdf0e10cSrcweir 
284cdf0e10cSrcweir                                 aAttr.Put(XFillStyleItem(XFILL_SOLID));
285cdf0e10cSrcweir                                 aAttr.Put(XFillColorItem(String(), COL_WHITE));
286cdf0e10cSrcweir 
287cdf0e10cSrcweir                                 pObj->SetMergedItemSet(aAttr);
288cdf0e10cSrcweir                             }
289cdf0e10cSrcweir                         }
290cdf0e10cSrcweir                     }
291cdf0e10cSrcweir 
292cdf0e10cSrcweir                     if (bMergeUndo)
293cdf0e10cSrcweir                     {
294cdf0e10cSrcweir                         mpDrawView->EndUndo();
295cdf0e10cSrcweir                     }
296cdf0e10cSrcweir                 }
297cdf0e10cSrcweir 
298cdf0e10cSrcweir                 mpDrawView->SetAttributes(*rReq.GetArgs());
299cdf0e10cSrcweir 
300cdf0e10cSrcweir                 if (bMergeUndo)
301cdf0e10cSrcweir                 {
302cdf0e10cSrcweir                     pUndoManager->LeaveListAction();
303cdf0e10cSrcweir                 }
304cdf0e10cSrcweir 
305cdf0e10cSrcweir                 rReq.Done();
306cdf0e10cSrcweir             }
307cdf0e10cSrcweir             else
308cdf0e10cSrcweir             {
309cdf0e10cSrcweir                 switch( rReq.GetSlot() )
310cdf0e10cSrcweir                 {
311cdf0e10cSrcweir                     case SID_ATTR_FILL_SHADOW:
312cdf0e10cSrcweir                     case SID_ATTR_FILL_STYLE:
313cdf0e10cSrcweir                     case SID_ATTR_FILL_COLOR:
314cdf0e10cSrcweir                     case SID_ATTR_FILL_GRADIENT:
315cdf0e10cSrcweir                     case SID_ATTR_FILL_HATCH:
316cdf0e10cSrcweir                     case SID_ATTR_FILL_BITMAP:
317d5370dc8SArmin Le Grand                     case SID_ATTR_FILL_TRANSPARENCE:
318d5370dc8SArmin Le Grand                     case SID_ATTR_FILL_FLOATTRANSPARENCE:
319cdf0e10cSrcweir                         GetViewFrame()->GetDispatcher()->Execute( SID_ATTRIBUTES_AREA, SFX_CALLMODE_ASYNCHRON );
320cdf0e10cSrcweir                         break;
321cdf0e10cSrcweir                     case SID_ATTR_LINE_STYLE:
322cdf0e10cSrcweir                     case SID_ATTR_LINE_DASH:
323cdf0e10cSrcweir                     case SID_ATTR_LINE_WIDTH:
324cdf0e10cSrcweir                     case SID_ATTR_LINE_COLOR:
325d5370dc8SArmin Le Grand                     case SID_ATTR_LINE_TRANSPARENCE:
326d5370dc8SArmin Le Grand                     case SID_ATTR_LINE_JOINT:
327d5370dc8SArmin Le Grand                     case SID_ATTR_LINE_CAP:
328cdf0e10cSrcweir                         GetViewFrame()->GetDispatcher()->Execute( SID_ATTRIBUTES_LINE, SFX_CALLMODE_ASYNCHRON );
329cdf0e10cSrcweir                         break;
330cdf0e10cSrcweir                     case SID_ATTR_TEXT_FITTOSIZE:
331cdf0e10cSrcweir                         GetViewFrame()->GetDispatcher()->Execute( SID_TEXTATTR_DLG, SFX_CALLMODE_ASYNCHRON );
332cdf0e10cSrcweir                         break;
333cdf0e10cSrcweir                 }
334cdf0e10cSrcweir             }
335cdf0e10cSrcweir             Cancel();
336cdf0e10cSrcweir         }
337cdf0e10cSrcweir         break;
338cdf0e10cSrcweir 
339cdf0e10cSrcweir         case SID_HYPHENATION:
340cdf0e10cSrcweir         {
341cdf0e10cSrcweir             // const SfxPoolItem* pItem = rReq.GetArg( SID_HYPHENATION );
342cdf0e10cSrcweir             //  ^-- Soll so nicht benutzt werden (Defaults sind falsch) !
343cdf0e10cSrcweir             SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, SID_HYPHENATION, sal_False);
344cdf0e10cSrcweir 
345cdf0e10cSrcweir             if( pItem )
346cdf0e10cSrcweir             {
347cdf0e10cSrcweir                 SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE );
348cdf0e10cSrcweir                 sal_Bool bValue = ( (const SfxBoolItem*) pItem)->GetValue();
349cdf0e10cSrcweir                 aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, bValue ) );
350cdf0e10cSrcweir                 mpDrawView->SetAttributes( aSet );
351cdf0e10cSrcweir             }
352cdf0e10cSrcweir             else // nur zum Test
353cdf0e10cSrcweir             {
354cdf0e10cSrcweir                 DBG_ERROR(" Kein Wert fuer Silbentrennung!");
355cdf0e10cSrcweir                 SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE );
356cdf0e10cSrcweir                 sal_Bool bValue = sal_True;
357cdf0e10cSrcweir                 aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, bValue ) );
358cdf0e10cSrcweir                 mpDrawView->SetAttributes( aSet );
359cdf0e10cSrcweir             }
360cdf0e10cSrcweir             rReq.Done();
361cdf0e10cSrcweir             Cancel();
362cdf0e10cSrcweir         }
363cdf0e10cSrcweir         break;
364cdf0e10cSrcweir 
365cdf0e10cSrcweir         case SID_INSERTPAGE:
366cdf0e10cSrcweir         case SID_INSERTPAGE_QUICK:
367cdf0e10cSrcweir         case SID_DUPLICATE_PAGE:
368cdf0e10cSrcweir         {
369cdf0e10cSrcweir             SdPage* pNewPage = CreateOrDuplicatePage (rReq, mePageKind, GetActualPage());
370cdf0e10cSrcweir             Cancel();
371cdf0e10cSrcweir             if(HasCurrentFunction(SID_BEZIER_EDIT) )
372cdf0e10cSrcweir                 GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
373cdf0e10cSrcweir             if (pNewPage != NULL)
374cdf0e10cSrcweir                 SwitchPage((pNewPage->GetPageNum()-1)/2);
375cdf0e10cSrcweir             rReq.Done ();
376cdf0e10cSrcweir         }
377cdf0e10cSrcweir         break;
378cdf0e10cSrcweir 
379cdf0e10cSrcweir         case SID_INSERT_MASTER_PAGE:
380cdf0e10cSrcweir         {
381cdf0e10cSrcweir             // Use the API to create a new page.
382cdf0e10cSrcweir             Reference<drawing::XMasterPagesSupplier> xMasterPagesSupplier (
383cdf0e10cSrcweir                 GetDoc()->getUnoModel(), UNO_QUERY);
384cdf0e10cSrcweir             if (xMasterPagesSupplier.is())
385cdf0e10cSrcweir             {
386cdf0e10cSrcweir                 Reference<drawing::XDrawPages> xMasterPages (
387cdf0e10cSrcweir                     xMasterPagesSupplier->getMasterPages());
388cdf0e10cSrcweir                 if (xMasterPages.is())
389cdf0e10cSrcweir                 {
390cdf0e10cSrcweir                     sal_uInt16 nIndex = GetCurPageId();
391cdf0e10cSrcweir                     xMasterPages->insertNewByIndex (nIndex);
392cdf0e10cSrcweir 
393cdf0e10cSrcweir                     // Create shapes for the default layout.
394cdf0e10cSrcweir                     SdPage* pMasterPage = GetDoc()->GetMasterSdPage(
395cdf0e10cSrcweir                         nIndex, PK_STANDARD);
396cdf0e10cSrcweir                     pMasterPage->CreateTitleAndLayout (sal_True,sal_True);
397cdf0e10cSrcweir                 }
398cdf0e10cSrcweir             }
399cdf0e10cSrcweir 
400cdf0e10cSrcweir             Cancel();
401cdf0e10cSrcweir             if(HasCurrentFunction(SID_BEZIER_EDIT))
402cdf0e10cSrcweir                 GetViewFrame()->GetDispatcher()->Execute(
403cdf0e10cSrcweir                     SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
404cdf0e10cSrcweir             rReq.Done ();
405cdf0e10cSrcweir         }
406cdf0e10cSrcweir         break;
407cdf0e10cSrcweir 
408cdf0e10cSrcweir         case SID_MODIFYPAGE:
409cdf0e10cSrcweir         {
410cdf0e10cSrcweir             if (mePageKind==PK_STANDARD || mePageKind==PK_NOTES ||
411cdf0e10cSrcweir                 (mePageKind==PK_HANDOUT && meEditMode==EM_MASTERPAGE) )
412cdf0e10cSrcweir             {
413cdf0e10cSrcweir                 if ( mpDrawView->IsTextEdit() )
414cdf0e10cSrcweir                 {
415cdf0e10cSrcweir                     mpDrawView->SdrEndTextEdit();
416cdf0e10cSrcweir                 }
417cdf0e10cSrcweir                 sal_uInt16 nPage = maTabControl.GetCurPageId() - 1;
418cdf0e10cSrcweir                 mpActualPage = GetDoc()->GetSdPage(nPage, mePageKind);
419cdf0e10cSrcweir                 ::sd::ViewShell::mpImpl->ProcessModifyPageSlot (
420cdf0e10cSrcweir                     rReq,
421cdf0e10cSrcweir                     mpActualPage,
422cdf0e10cSrcweir                     mePageKind);
423cdf0e10cSrcweir             }
424cdf0e10cSrcweir 
425cdf0e10cSrcweir             Cancel();
426cdf0e10cSrcweir             rReq.Done ();
427cdf0e10cSrcweir         }
428cdf0e10cSrcweir         break;
429cdf0e10cSrcweir 
430cdf0e10cSrcweir         case SID_ASSIGN_LAYOUT:
431cdf0e10cSrcweir         {
432cdf0e10cSrcweir             if (mePageKind==PK_STANDARD || mePageKind==PK_NOTES || (mePageKind==PK_HANDOUT && meEditMode==EM_MASTERPAGE))
433cdf0e10cSrcweir             {
434cdf0e10cSrcweir                 if ( mpDrawView->IsTextEdit() )
435cdf0e10cSrcweir                     mpDrawView->SdrEndTextEdit();
436cdf0e10cSrcweir 
437cdf0e10cSrcweir                 ::sd::ViewShell::mpImpl->AssignLayout(rReq, mePageKind);
438cdf0e10cSrcweir             }
439cdf0e10cSrcweir             Cancel();
440cdf0e10cSrcweir             rReq.Done ();
441cdf0e10cSrcweir         }
442cdf0e10cSrcweir         break;
443cdf0e10cSrcweir 
444cdf0e10cSrcweir         case SID_RENAMEPAGE:
445cdf0e10cSrcweir         case SID_RENAME_MASTER_PAGE:
446cdf0e10cSrcweir         {
447cdf0e10cSrcweir             if (mePageKind==PK_STANDARD || mePageKind==PK_NOTES )
448cdf0e10cSrcweir             {
449cdf0e10cSrcweir                 if ( mpDrawView->IsTextEdit() )
450cdf0e10cSrcweir                 {
451cdf0e10cSrcweir                     mpDrawView->SdrEndTextEdit();
452cdf0e10cSrcweir                 }
453cdf0e10cSrcweir 
454cdf0e10cSrcweir                 sal_uInt16 nPageId = maTabControl.GetCurPageId();
455cdf0e10cSrcweir                 SdPage* pCurrentPage = ( GetEditMode() == EM_PAGE )
456cdf0e10cSrcweir                     ? GetDoc()->GetSdPage( nPageId - 1, GetPageKind() )
457cdf0e10cSrcweir                     : GetDoc()->GetMasterSdPage( nPageId - 1, GetPageKind() );
458cdf0e10cSrcweir 
459cdf0e10cSrcweir                 String aTitle( SdResId( STR_TITLE_RENAMESLIDE ) );
460cdf0e10cSrcweir                 String aDescr( SdResId( STR_DESC_RENAMESLIDE ) );
461cdf0e10cSrcweir                 String aPageName = pCurrentPage->GetName();
462cdf0e10cSrcweir 
463cdf0e10cSrcweir                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
464cdf0e10cSrcweir                 DBG_ASSERT(pFact, "Dialogdiet fail!");
465cdf0e10cSrcweir                 AbstractSvxNameDialog* aNameDlg = pFact->CreateSvxNameDialog( GetActiveWindow(), aPageName, aDescr );
466cdf0e10cSrcweir                 DBG_ASSERT(aNameDlg, "Dialogdiet fail!");
467cdf0e10cSrcweir                 aNameDlg->SetText( aTitle );
468cdf0e10cSrcweir                 aNameDlg->SetCheckNameHdl( LINK( this, DrawViewShell, RenameSlideHdl ), true );
469cdf0e10cSrcweir                 aNameDlg->SetEditHelpId( HID_SD_NAMEDIALOG_PAGE );
470cdf0e10cSrcweir 
471cdf0e10cSrcweir                 if( aNameDlg->Execute() == RET_OK )
472cdf0e10cSrcweir                 {
473cdf0e10cSrcweir                     String aNewName;
474cdf0e10cSrcweir                     aNameDlg->GetName( aNewName );
475cdf0e10cSrcweir                     if( ! aNewName.Equals( aPageName ) )
476cdf0e10cSrcweir                     {
477cdf0e10cSrcweir #ifdef DBG_UTIL
478cdf0e10cSrcweir                         bool bResult =
479cdf0e10cSrcweir #endif
480cdf0e10cSrcweir                             RenameSlide( nPageId, aNewName );
481cdf0e10cSrcweir                         DBG_ASSERT( bResult, "Couldn't rename slide" );
482cdf0e10cSrcweir                     }
483cdf0e10cSrcweir                 }
484cdf0e10cSrcweir                 delete aNameDlg;
485cdf0e10cSrcweir             }
486cdf0e10cSrcweir 
487cdf0e10cSrcweir             Cancel();
488cdf0e10cSrcweir             rReq.Ignore ();
489cdf0e10cSrcweir         }
490cdf0e10cSrcweir         break;
491cdf0e10cSrcweir 
492cdf0e10cSrcweir         case SID_RENAMEPAGE_QUICK:
493cdf0e10cSrcweir         {
494cdf0e10cSrcweir             if (mePageKind==PK_STANDARD || mePageKind==PK_NOTES )
495cdf0e10cSrcweir             {
496cdf0e10cSrcweir                 if ( mpDrawView->IsTextEdit() )
497cdf0e10cSrcweir                 {
498cdf0e10cSrcweir                     mpDrawView->SdrEndTextEdit();
499cdf0e10cSrcweir                 }
500cdf0e10cSrcweir 
501cdf0e10cSrcweir                 maTabControl.StartEditMode( maTabControl.GetCurPageId() );
502cdf0e10cSrcweir             }
503cdf0e10cSrcweir 
504cdf0e10cSrcweir             Cancel();
505cdf0e10cSrcweir             rReq.Ignore ();
506cdf0e10cSrcweir         }
507cdf0e10cSrcweir         break;
508cdf0e10cSrcweir 
509cdf0e10cSrcweir         case SID_PAGESIZE :  // entweder dieses (kein menueeintrag o. ae. !!)
510cdf0e10cSrcweir         {
511cdf0e10cSrcweir             const SfxItemSet *pArgs = rReq.GetArgs ();
512cdf0e10cSrcweir 
513cdf0e10cSrcweir             if (pArgs)
514cdf0e10cSrcweir                 if (pArgs->Count () == 3)
515cdf0e10cSrcweir                 {
516cdf0e10cSrcweir                     SFX_REQUEST_ARG (rReq, pWidth, SfxUInt32Item, ID_VAL_PAGEWIDTH, sal_False);
517cdf0e10cSrcweir                     SFX_REQUEST_ARG (rReq, pHeight, SfxUInt32Item, ID_VAL_PAGEHEIGHT, sal_False);
518cdf0e10cSrcweir                     SFX_REQUEST_ARG (rReq, pScaleAll, SfxBoolItem, ID_VAL_SCALEOBJECTS, sal_False);
519cdf0e10cSrcweir 
520cdf0e10cSrcweir                     Size aSize (pWidth->GetValue (), pHeight->GetValue ());
521cdf0e10cSrcweir 
522cdf0e10cSrcweir                     SetupPage (aSize, 0, 0, 0, 0, sal_True, sal_False, pScaleAll->GetValue ());
523cdf0e10cSrcweir                     rReq.Ignore ();
524cdf0e10cSrcweir                     break;
525cdf0e10cSrcweir                 }
526cdf0e10cSrcweir 
527cdf0e10cSrcweir             StarBASIC::FatalError (SbERR_WRONG_ARGS);
528cdf0e10cSrcweir             rReq.Ignore ();
529cdf0e10cSrcweir             break;
530cdf0e10cSrcweir         }
531cdf0e10cSrcweir 
532cdf0e10cSrcweir         case SID_PAGEMARGIN :  // oder dieses (kein menueeintrag o. ae. !!)
533cdf0e10cSrcweir         {
534cdf0e10cSrcweir             const SfxItemSet *pArgs = rReq.GetArgs ();
535cdf0e10cSrcweir 
536cdf0e10cSrcweir             if (pArgs)
537cdf0e10cSrcweir                 if (pArgs->Count () == 5)
538cdf0e10cSrcweir                 {
539cdf0e10cSrcweir                     SFX_REQUEST_ARG (rReq, pLeft, SfxUInt32Item, ID_VAL_PAGELEFT, sal_False);
540cdf0e10cSrcweir                     SFX_REQUEST_ARG (rReq, pRight, SfxUInt32Item, ID_VAL_PAGERIGHT, sal_False);
541cdf0e10cSrcweir                     SFX_REQUEST_ARG (rReq, pUpper, SfxUInt32Item, ID_VAL_PAGETOP, sal_False);
542cdf0e10cSrcweir                     SFX_REQUEST_ARG (rReq, pLower, SfxUInt32Item, ID_VAL_PAGEBOTTOM, sal_False);
543cdf0e10cSrcweir                     SFX_REQUEST_ARG (rReq, pScaleAll, SfxBoolItem, ID_VAL_SCALEOBJECTS, sal_False);
544cdf0e10cSrcweir 
545cdf0e10cSrcweir                     Size aEmptySize (0, 0);
546cdf0e10cSrcweir 
547cdf0e10cSrcweir                     SetupPage (aEmptySize, pLeft->GetValue (), pRight->GetValue (),
548cdf0e10cSrcweir                                pUpper->GetValue (), pLower->GetValue (),
549cdf0e10cSrcweir                                sal_False, sal_True, pScaleAll->GetValue ());
550cdf0e10cSrcweir                     rReq.Ignore ();
551cdf0e10cSrcweir                     break;
552cdf0e10cSrcweir                 }
553cdf0e10cSrcweir 
554cdf0e10cSrcweir             StarBASIC::FatalError (SbERR_WRONG_ARGS);
555cdf0e10cSrcweir             rReq.Ignore ();
556cdf0e10cSrcweir             break;
557cdf0e10cSrcweir         }
558cdf0e10cSrcweir 
559cdf0e10cSrcweir         case SID_ATTR_ZOOMSLIDER:
560cdf0e10cSrcweir         {
561cdf0e10cSrcweir             const SfxItemSet* pArgs = rReq.GetArgs();
562cdf0e10cSrcweir 
563cdf0e10cSrcweir             if (pArgs && pArgs->Count () == 1 )
564cdf0e10cSrcweir             {
565cdf0e10cSrcweir                 SFX_REQUEST_ARG (rReq, pScale, SfxUInt16Item, SID_ATTR_ZOOMSLIDER, sal_False);
566cdf0e10cSrcweir                 if (CHECK_RANGE (5, pScale->GetValue (), 3000))
567cdf0e10cSrcweir                 {
568cdf0e10cSrcweir                     SetZoom (pScale->GetValue ());
569cdf0e10cSrcweir 
570cdf0e10cSrcweir                     SfxBindings& rBindings = GetViewFrame()->GetBindings();
571cdf0e10cSrcweir                     rBindings.Invalidate( SID_ATTR_ZOOM );
572cdf0e10cSrcweir                     rBindings.Invalidate( SID_ZOOM_IN );
573cdf0e10cSrcweir                     rBindings.Invalidate( SID_ZOOM_OUT );
574cdf0e10cSrcweir                     rBindings.Invalidate( SID_ATTR_ZOOMSLIDER );
575cdf0e10cSrcweir 
576cdf0e10cSrcweir                 }
577cdf0e10cSrcweir             }
578cdf0e10cSrcweir 
579cdf0e10cSrcweir             Cancel();
580cdf0e10cSrcweir             rReq.Done ();
581cdf0e10cSrcweir             break;
582cdf0e10cSrcweir         }
583cdf0e10cSrcweir         case SID_ZOOMING :  // kein Menueintrag, sondern aus dem Zoomdialog generiert
584cdf0e10cSrcweir         {
585cdf0e10cSrcweir             const SfxItemSet* pArgs = rReq.GetArgs();
586cdf0e10cSrcweir 
587cdf0e10cSrcweir             if (pArgs)
588cdf0e10cSrcweir                 if (pArgs->Count () == 1)
589cdf0e10cSrcweir                 {
590cdf0e10cSrcweir                     SFX_REQUEST_ARG (rReq, pScale, SfxUInt32Item, ID_VAL_ZOOM, sal_False);
591cdf0e10cSrcweir                     if (CHECK_RANGE (10, pScale->GetValue (), 1000))
592cdf0e10cSrcweir                     {
593cdf0e10cSrcweir                         SetZoom (pScale->GetValue ());
594cdf0e10cSrcweir 
595cdf0e10cSrcweir                         SfxBindings& rBindings = GetViewFrame()->GetBindings();
596cdf0e10cSrcweir                         rBindings.Invalidate( SID_ATTR_ZOOM );
597cdf0e10cSrcweir                         rBindings.Invalidate( SID_ZOOM_IN );
598cdf0e10cSrcweir                         rBindings.Invalidate( SID_ZOOM_OUT );
599cdf0e10cSrcweir                         rBindings.Invalidate( SID_ATTR_ZOOMSLIDER );
600cdf0e10cSrcweir                     }
601cdf0e10cSrcweir                     else StarBASIC::FatalError (SbERR_BAD_PROP_VALUE);
602cdf0e10cSrcweir 
603cdf0e10cSrcweir                     rReq.Ignore ();
604cdf0e10cSrcweir                     break;
605cdf0e10cSrcweir                 }
606cdf0e10cSrcweir 
607cdf0e10cSrcweir             StarBASIC::FatalError (SbERR_WRONG_ARGS);
608cdf0e10cSrcweir             rReq.Ignore ();
609cdf0e10cSrcweir             break;
610cdf0e10cSrcweir         }
611cdf0e10cSrcweir 
612cdf0e10cSrcweir         case SID_ATTR_ZOOM:
613cdf0e10cSrcweir         {
614cdf0e10cSrcweir             const SfxItemSet* pArgs = rReq.GetArgs();
615cdf0e10cSrcweir             mbZoomOnPage = sal_False;
616cdf0e10cSrcweir 
617cdf0e10cSrcweir             if ( pArgs )
618cdf0e10cSrcweir             {
619cdf0e10cSrcweir                 SvxZoomType eZT = ( ( const SvxZoomItem& ) pArgs->
620cdf0e10cSrcweir                                             Get( SID_ATTR_ZOOM ) ).GetType();
621cdf0e10cSrcweir                 switch( eZT )
622cdf0e10cSrcweir                 {
623cdf0e10cSrcweir                     case SVX_ZOOM_PERCENT:
624cdf0e10cSrcweir                         SetZoom( (long) ( ( const SvxZoomItem& ) pArgs->
625cdf0e10cSrcweir                                             Get( SID_ATTR_ZOOM ) ).GetValue() );
626cdf0e10cSrcweir                         break;
627cdf0e10cSrcweir 
628cdf0e10cSrcweir                     case SVX_ZOOM_OPTIMAL:
629cdf0e10cSrcweir                         GetViewFrame()->GetDispatcher()->Execute( SID_SIZE_ALL,
630cdf0e10cSrcweir                                     SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
631cdf0e10cSrcweir                         break;
632cdf0e10cSrcweir 
633cdf0e10cSrcweir                     case SVX_ZOOM_PAGEWIDTH:
634cdf0e10cSrcweir                         GetViewFrame()->GetDispatcher()->Execute( SID_SIZE_PAGE_WIDTH,
635cdf0e10cSrcweir                                     SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
636cdf0e10cSrcweir                         break;
637cdf0e10cSrcweir 
638cdf0e10cSrcweir                     case SVX_ZOOM_WHOLEPAGE:
639cdf0e10cSrcweir                         GetViewFrame()->GetDispatcher()->Execute( SID_SIZE_PAGE,
640cdf0e10cSrcweir                                     SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
641cdf0e10cSrcweir                         break;
642cdf0e10cSrcweir                     case SVX_ZOOM_PAGEWIDTH_NOBORDER:
643cdf0e10cSrcweir                         DBG_ERROR("sd::DrawViewShell::FuTemporary(), SVX_ZOOM_PAGEWIDTH_NOBORDER not handled!" );
644cdf0e10cSrcweir                         break;
645cdf0e10cSrcweir                 }
646cdf0e10cSrcweir                 rReq.Ignore ();
647cdf0e10cSrcweir             }
648cdf0e10cSrcweir             else
649cdf0e10cSrcweir             {
650cdf0e10cSrcweir                 // hier den Zoom-Dialog oeffnen
651cdf0e10cSrcweir                 SetCurrentFunction( FuScale::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
652cdf0e10cSrcweir             }
653cdf0e10cSrcweir             Cancel();
654cdf0e10cSrcweir         }
655cdf0e10cSrcweir         break;
656cdf0e10cSrcweir 
657cdf0e10cSrcweir         case SID_CHANGEBEZIER:
658cdf0e10cSrcweir         case SID_CHANGEPOLYGON:
659cdf0e10cSrcweir             if ( mpDrawView->IsTextEdit() )
660cdf0e10cSrcweir             {
661cdf0e10cSrcweir                 mpDrawView->SdrEndTextEdit();
662cdf0e10cSrcweir                 GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
663cdf0e10cSrcweir             }
664cdf0e10cSrcweir 
665cdf0e10cSrcweir             if ( mpDrawView->IsPresObjSelected() )
666cdf0e10cSrcweir             {
667cdf0e10cSrcweir                 ::sd::Window* pWindow = GetActiveWindow();
668cdf0e10cSrcweir                 InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
669cdf0e10cSrcweir             }
670cdf0e10cSrcweir             else
671cdf0e10cSrcweir             {
672cdf0e10cSrcweir                 if( rReq.GetSlot() == SID_CHANGEBEZIER )
673cdf0e10cSrcweir                 {
674cdf0e10cSrcweir                     WaitObject aWait( (Window*)GetActiveWindow() );
675cdf0e10cSrcweir                     mpDrawView->ConvertMarkedToPathObj(sal_False);
676cdf0e10cSrcweir                 }
677cdf0e10cSrcweir                 else
678cdf0e10cSrcweir                 {
679cdf0e10cSrcweir                     if( mpDrawView->IsVectorizeAllowed() )
680ddde725dSArmin Le Grand                     {
681cdf0e10cSrcweir                         SetCurrentFunction( FuVectorize::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
682ddde725dSArmin Le Grand                     }
683cdf0e10cSrcweir                     else
684cdf0e10cSrcweir                     {
685cdf0e10cSrcweir                         WaitObject aWait( (Window*)GetActiveWindow() );
686cdf0e10cSrcweir                         mpDrawView->ConvertMarkedToPolyObj(sal_False);
687cdf0e10cSrcweir                     }
688cdf0e10cSrcweir                 }
689cdf0e10cSrcweir 
690cdf0e10cSrcweir                 Invalidate(SID_CHANGEBEZIER);
691cdf0e10cSrcweir                 Invalidate(SID_CHANGEPOLYGON);
692cdf0e10cSrcweir             }
693cdf0e10cSrcweir             Cancel();
694cdf0e10cSrcweir 
695cdf0e10cSrcweir             if( HasCurrentFunction(SID_BEZIER_EDIT) )
696cdf0e10cSrcweir             {   // ggf. die richtige Editfunktion aktivieren
697cdf0e10cSrcweir                 GetViewFrame()->GetDispatcher()->Execute(SID_SWITCH_POINTEDIT,
698cdf0e10cSrcweir                                         SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
699cdf0e10cSrcweir             }
700cdf0e10cSrcweir             rReq.Ignore ();
701cdf0e10cSrcweir             break;
702cdf0e10cSrcweir 
703cdf0e10cSrcweir         case SID_CONVERT_TO_CONTOUR:
704cdf0e10cSrcweir             if ( mpDrawView->IsTextEdit() )
705cdf0e10cSrcweir             {
706cdf0e10cSrcweir                 mpDrawView->SdrEndTextEdit();
707cdf0e10cSrcweir                 GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
708cdf0e10cSrcweir             }
709cdf0e10cSrcweir 
710cdf0e10cSrcweir             if ( mpDrawView->IsPresObjSelected() )
711cdf0e10cSrcweir             {
712cdf0e10cSrcweir                 ::sd::Window* pWindow = GetActiveWindow();
713cdf0e10cSrcweir                 InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
714cdf0e10cSrcweir             }
715cdf0e10cSrcweir             else
716cdf0e10cSrcweir             {
717cdf0e10cSrcweir                 WaitObject aWait( (Window*)GetActiveWindow() );
718cdf0e10cSrcweir                 mpDrawView->ConvertMarkedToPathObj(sal_True);
719cdf0e10cSrcweir 
720cdf0e10cSrcweir                 Invalidate(SID_CONVERT_TO_CONTOUR);
721cdf0e10cSrcweir             }
722cdf0e10cSrcweir             Cancel();
723cdf0e10cSrcweir 
724cdf0e10cSrcweir             rReq.Ignore ();
725cdf0e10cSrcweir             break;
726cdf0e10cSrcweir 
727cdf0e10cSrcweir         case SID_CONVERT_TO_METAFILE:
728cdf0e10cSrcweir         case SID_CONVERT_TO_BITMAP:
729cdf0e10cSrcweir         {
730cdf0e10cSrcweir             // End text edit mode when it is active because the metafile or
731cdf0e10cSrcweir             // bitmap that will be created does not support it.
732cdf0e10cSrcweir             if ( mpDrawView->IsTextEdit() )
733cdf0e10cSrcweir             {
734cdf0e10cSrcweir                 mpDrawView->SdrEndTextEdit();
735cdf0e10cSrcweir                 GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
736cdf0e10cSrcweir             }
737cdf0e10cSrcweir 
738cdf0e10cSrcweir             if ( mpDrawView->IsPresObjSelected(true,true,true) )
739cdf0e10cSrcweir             {
740cdf0e10cSrcweir                 ::sd::Window* pWindow = GetActiveWindow();
741cdf0e10cSrcweir                 InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
742cdf0e10cSrcweir             }
743cdf0e10cSrcweir             else
744cdf0e10cSrcweir             {
745cdf0e10cSrcweir                 WaitObject aWait( (Window*)GetActiveWindow() );
746cdf0e10cSrcweir 
747cdf0e10cSrcweir                 // switch on undo for the next operations
748cdf0e10cSrcweir                 mpDrawView->BegUndo(
749cdf0e10cSrcweir                     String(
750cdf0e10cSrcweir                     SdResId (nSId==SID_CONVERT_TO_METAFILE ? STR_UNDO_CONVERT_TO_METAFILE : STR_UNDO_CONVERT_TO_BITMAP)));
751cdf0e10cSrcweir 
752cdf0e10cSrcweir                 // create SdrGrafObj from metafile/bitmap
753cdf0e10cSrcweir                 Graphic aGraphic;
754cdf0e10cSrcweir                 switch (nSId)
755cdf0e10cSrcweir                 {
756cdf0e10cSrcweir                     case SID_CONVERT_TO_METAFILE:
757cdf0e10cSrcweir                     {
758bb18ee55SArmin Le Grand                         GDIMetaFile aMetaFile(mpDrawView->GetMarkedObjMetaFile());
759cdf0e10cSrcweir                         aGraphic = Graphic(aMetaFile);
760cdf0e10cSrcweir                     }
761cdf0e10cSrcweir                     break;
762cdf0e10cSrcweir                     case SID_CONVERT_TO_BITMAP:
763cdf0e10cSrcweir                     {
764ddde725dSArmin Le Grand                         bool bDone(false);
765ddde725dSArmin Le Grand 
766bb18ee55SArmin Le Grand                         // I have to get the image here directly since GetMarkedObjBitmapEx works
767ddde725dSArmin Le Grand                         // based on Bitmaps, but not on BitmapEx, thus throwing away the alpha
768bb18ee55SArmin Le Grand                         // channel. Argh! GetMarkedObjBitmapEx itself is too widely used to safely
769ddde725dSArmin Le Grand                         // change that, e.g. in the exchange formats. For now I can only add this
770ddde725dSArmin Le Grand                         // exception to get good results for Svgs. This is how the code gets more
771ddde725dSArmin Le Grand                         // and more crowded, at last I made a remark for myself to change this
772ddde725dSArmin Le Grand                         // as one of the next tasks.
773ddde725dSArmin Le Grand                         if(1 == mpDrawView->GetMarkedObjectCount())
774ddde725dSArmin Le Grand                         {
775ddde725dSArmin Le Grand                             const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(mpDrawView->GetMarkedObjectByIndex(0));
776ddde725dSArmin Le Grand 
777ddde725dSArmin Le Grand                             if(pSdrGrafObj && pSdrGrafObj->isEmbeddedSvg())
778ddde725dSArmin Le Grand                             {
779ddde725dSArmin Le Grand                                 aGraphic = Graphic(pSdrGrafObj->GetGraphic().getSvgData()->getReplacement());
780ddde725dSArmin Le Grand                                 bDone = true;
781ddde725dSArmin Le Grand                             }
782ddde725dSArmin Le Grand                         }
783ddde725dSArmin Le Grand 
784ddde725dSArmin Le Grand                         if(!bDone)
785ddde725dSArmin Le Grand                         {
786bb18ee55SArmin Le Grand                             aGraphic = Graphic(mpDrawView->GetMarkedObjBitmapEx());
787cdf0e10cSrcweir                         }
788ddde725dSArmin Le Grand                     }
789cdf0e10cSrcweir                     break;
790cdf0e10cSrcweir                 }
791cdf0e10cSrcweir 
792cdf0e10cSrcweir                 // create new object
793cdf0e10cSrcweir                 SdrGrafObj* pGraphicObj = new SdrGrafObj (aGraphic);
794cdf0e10cSrcweir 
795cdf0e10cSrcweir                 // get some necessary info and ensure it
796cdf0e10cSrcweir                 const SdrMarkList& rMarkList(mpDrawView->GetMarkedObjectList());
797cdf0e10cSrcweir                 const sal_uInt32 nMarkCount(rMarkList.GetMarkCount());
798cdf0e10cSrcweir                 SdrPageView* pPageView = mpDrawView->GetSdrPageView();
799cdf0e10cSrcweir                 OSL_ENSURE(nMarkCount, "DrawViewShell::FuTemporary: SID_CONVERT_TO_BITMAP with empty selection (!)");
800cdf0e10cSrcweir                 OSL_ENSURE(pPageView, "DrawViewShell::FuTemporary: SID_CONVERT_TO_BITMAP without SdrPageView (!)");
801cdf0e10cSrcweir 
802cdf0e10cSrcweir                 // fit rectangle of new graphic object to selection's mark rect
803cdf0e10cSrcweir                 Rectangle aAllMarkedRect;
804cdf0e10cSrcweir                 rMarkList.TakeBoundRect(pPageView, aAllMarkedRect);
805cdf0e10cSrcweir                 pGraphicObj->SetLogicRect(aAllMarkedRect);
806cdf0e10cSrcweir 
807cdf0e10cSrcweir                 // #i71540# to keep the order, it is necessary to replace the lowest object
808cdf0e10cSrcweir                 // of the selection with the new object. This also means that with multi
809cdf0e10cSrcweir                 // selection, all other objects need to be deleted first
810cdf0e10cSrcweir                 SdrMark* pFirstMark = rMarkList.GetMark(0L);
811cdf0e10cSrcweir                 SdrObject* pReplacementCandidate = pFirstMark->GetMarkedSdrObj();
812cdf0e10cSrcweir 
813cdf0e10cSrcweir                 if(nMarkCount > 1L)
814cdf0e10cSrcweir                 {
815cdf0e10cSrcweir                     // take first object out of selection
816cdf0e10cSrcweir                     mpDrawView->MarkObj(pReplacementCandidate, pPageView, true, true);
817cdf0e10cSrcweir 
818cdf0e10cSrcweir                     // clear remaining selection
819cdf0e10cSrcweir                     mpDrawView->DeleteMarkedObj();
820cdf0e10cSrcweir                 }
821cdf0e10cSrcweir 
822cdf0e10cSrcweir                 // now replace lowest object with new one
823cdf0e10cSrcweir                 mpDrawView->ReplaceObjectAtView(pReplacementCandidate, *pPageView, pGraphicObj);
824cdf0e10cSrcweir 
825cdf0e10cSrcweir                 // switch off undo
826cdf0e10cSrcweir                 mpDrawView->EndUndo();
827cdf0e10cSrcweir             }
828cdf0e10cSrcweir         }
829cdf0e10cSrcweir 
830cdf0e10cSrcweir         Cancel();
831cdf0e10cSrcweir 
832cdf0e10cSrcweir         rReq.Done ();
833cdf0e10cSrcweir         break;
834cdf0e10cSrcweir 
835cdf0e10cSrcweir         case SID_SET_DEFAULT:
836cdf0e10cSrcweir         {
837cdf0e10cSrcweir             SfxItemSet* pSet = NULL;
838cdf0e10cSrcweir 
839cdf0e10cSrcweir             if (mpDrawView->IsTextEdit())
840cdf0e10cSrcweir             {
841cdf0e10cSrcweir                 ::Outliner* pOutl = mpDrawView->GetTextEditOutliner();
842cdf0e10cSrcweir                 if (pOutl)
843cdf0e10cSrcweir                 {
844cdf0e10cSrcweir                     pOutl->RemoveFields(sal_True, (TypeId) SvxURLField::StaticType());
845cdf0e10cSrcweir                 }
846cdf0e10cSrcweir 
847cdf0e10cSrcweir                 pSet = new SfxItemSet( GetPool(), EE_ITEMS_START, EE_ITEMS_END );
848cdf0e10cSrcweir                 mpDrawView->SetAttributes( *pSet, sal_True );
849cdf0e10cSrcweir             }
850cdf0e10cSrcweir             else
851cdf0e10cSrcweir             {
852cdf0e10cSrcweir                 const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
853cdf0e10cSrcweir                 sal_uLong nCount = rMarkList.GetMarkCount();
854cdf0e10cSrcweir 
855cdf0e10cSrcweir                 // In diese Liste werden fuer jedes Praesentationsobjekt ein SfxItemSet
856cdf0e10cSrcweir                 // der harten Attribute sowie der UserCall eingetragen, da diese beim nachfolgenden
857cdf0e10cSrcweir                 // mpDrawView->SetAttributes( *pSet, sal_True ) verloren gehen und spaeter restauriert
858cdf0e10cSrcweir                 // werden muessen
859cdf0e10cSrcweir                 List* pAttrList = new List();
860cdf0e10cSrcweir                 SdPage* pPresPage = (SdPage*) mpDrawView->GetSdrPageView()->GetPage();
861cdf0e10cSrcweir                 sal_uLong i;
862cdf0e10cSrcweir 
863cdf0e10cSrcweir                 for ( i = 0; i < nCount; i++ )
864cdf0e10cSrcweir                 {
865cdf0e10cSrcweir                     SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
866cdf0e10cSrcweir 
867cdf0e10cSrcweir                     if( pPresPage->IsPresObj( pObj ) )
868cdf0e10cSrcweir                     {
869cdf0e10cSrcweir                         SfxItemSet* pNewSet = new SfxItemSet( GetDoc()->GetPool(), SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_AUTOGROWHEIGHT, 0 );
870cdf0e10cSrcweir                         pNewSet->Put(pObj->GetMergedItemSet());
871cdf0e10cSrcweir                         pAttrList->Insert( pNewSet, LIST_APPEND );
872cdf0e10cSrcweir                         pAttrList->Insert( pObj->GetUserCall(), LIST_APPEND );
873cdf0e10cSrcweir                     }
874cdf0e10cSrcweir                 }
875cdf0e10cSrcweir 
876cdf0e10cSrcweir                 pSet = new SfxItemSet( GetPool() );
877cdf0e10cSrcweir                 mpDrawView->SetAttributes( *pSet, sal_True );
878cdf0e10cSrcweir 
879cdf0e10cSrcweir                 sal_uLong j = 0;
880cdf0e10cSrcweir 
881cdf0e10cSrcweir                 for ( i = 0; i < nCount; i++ )
882cdf0e10cSrcweir                 {
883cdf0e10cSrcweir                     SfxStyleSheet* pSheet = NULL;
884cdf0e10cSrcweir                     SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
885cdf0e10cSrcweir 
886cdf0e10cSrcweir                     if (pObj->GetObjIdentifier() == OBJ_TITLETEXT)
887cdf0e10cSrcweir                     {
888cdf0e10cSrcweir                         pSheet = mpActualPage->GetStyleSheetForPresObj(PRESOBJ_TITLE);
889cdf0e10cSrcweir                         if (pSheet)
890cdf0e10cSrcweir                             pObj->SetStyleSheet(pSheet, sal_False);
891cdf0e10cSrcweir                     }
892cdf0e10cSrcweir                     else if(pObj->GetObjIdentifier() == OBJ_OUTLINETEXT)
893cdf0e10cSrcweir                     {
894cdf0e10cSrcweir                         for (sal_uInt16 nLevel = 1; nLevel < 10; nLevel++)
895cdf0e10cSrcweir                         {
896cdf0e10cSrcweir                             pSheet = mpActualPage->GetStyleSheetForPresObj( PRESOBJ_OUTLINE );
897cdf0e10cSrcweir                             DBG_ASSERT(pSheet, "Vorlage fuer Gliederungsobjekt nicht gefunden");
898cdf0e10cSrcweir                             if (pSheet)
899cdf0e10cSrcweir                             {
900cdf0e10cSrcweir                                 pObj->StartListening(*pSheet);
901cdf0e10cSrcweir 
902cdf0e10cSrcweir                                 if( nLevel == 1 )
903cdf0e10cSrcweir                                     // Textrahmen hoert auf StyleSheet der Ebene1
904cdf0e10cSrcweir                                     pObj->NbcSetStyleSheet(pSheet, sal_False);
905cdf0e10cSrcweir 
906cdf0e10cSrcweir                             }
907cdf0e10cSrcweir                         }
908cdf0e10cSrcweir                     }
909cdf0e10cSrcweir 
910cdf0e10cSrcweir                     if( pPresPage->IsPresObj( pObj ) )
911cdf0e10cSrcweir                     {
912cdf0e10cSrcweir                         SfxItemSet* pNewSet = (SfxItemSet*) pAttrList->GetObject(j++);
913cdf0e10cSrcweir                         SdrObjUserCall* pUserCall = (SdrObjUserCall*) pAttrList->GetObject(j++);
914cdf0e10cSrcweir 
915cdf0e10cSrcweir                         if ( pNewSet && pNewSet->GetItemState( SDRATTR_TEXT_MINFRAMEHEIGHT ) == SFX_ITEM_ON )
916cdf0e10cSrcweir                         {
917cdf0e10cSrcweir                             pObj->SetMergedItem(pNewSet->Get(SDRATTR_TEXT_MINFRAMEHEIGHT));
918cdf0e10cSrcweir                         }
919cdf0e10cSrcweir 
920cdf0e10cSrcweir                         if ( pNewSet && pNewSet->GetItemState( SDRATTR_TEXT_AUTOGROWHEIGHT ) == SFX_ITEM_ON )
921cdf0e10cSrcweir                         {
922cdf0e10cSrcweir                             pObj->SetMergedItem(pNewSet->Get(SDRATTR_TEXT_AUTOGROWHEIGHT));
923cdf0e10cSrcweir                         }
924cdf0e10cSrcweir 
925cdf0e10cSrcweir                         if( pUserCall )
926cdf0e10cSrcweir                             pObj->SetUserCall( pUserCall );
927cdf0e10cSrcweir 
928cdf0e10cSrcweir                         delete pNewSet;
929cdf0e10cSrcweir                     }
930cdf0e10cSrcweir                 }
931cdf0e10cSrcweir 
932cdf0e10cSrcweir                 delete pAttrList;
933cdf0e10cSrcweir             }
934cdf0e10cSrcweir 
935cdf0e10cSrcweir             delete pSet;
936cdf0e10cSrcweir             Cancel();
937cdf0e10cSrcweir         }
938cdf0e10cSrcweir         break;
939cdf0e10cSrcweir 
940cdf0e10cSrcweir         case SID_DELETE_SNAPITEM:
941cdf0e10cSrcweir         {
942cdf0e10cSrcweir             SdrPageView* pPV;
943cdf0e10cSrcweir             Point   aMPos = GetActiveWindow()->PixelToLogic( maMousePos );
944cdf0e10cSrcweir             sal_uInt16  nHitLog = (sal_uInt16) GetActiveWindow()->PixelToLogic( Size(
945cdf0e10cSrcweir                 FuPoor::HITPIX, 0 ) ).Width();
946cdf0e10cSrcweir             sal_uInt16  nHelpLine;
947cdf0e10cSrcweir 
948cdf0e10cSrcweir             mbMousePosFreezed = sal_False;
949cdf0e10cSrcweir 
950cdf0e10cSrcweir             if( mpDrawView->PickHelpLine( aMPos, nHitLog, *GetActiveWindow(), nHelpLine, pPV) )
951cdf0e10cSrcweir             {
952cdf0e10cSrcweir                 pPV->DeleteHelpLine( nHelpLine );
953cdf0e10cSrcweir             }
954cdf0e10cSrcweir             Cancel();
955cdf0e10cSrcweir             rReq.Ignore ();
956cdf0e10cSrcweir         }
957cdf0e10cSrcweir         break;
958cdf0e10cSrcweir 
959cdf0e10cSrcweir         case SID_DELETE_PAGE:
960cdf0e10cSrcweir         case SID_DELETE_MASTER_PAGE:
961cdf0e10cSrcweir             DeleteActualPage();
962cdf0e10cSrcweir             Cancel();
963cdf0e10cSrcweir             rReq.Ignore ();
964cdf0e10cSrcweir         break;
965cdf0e10cSrcweir 
966cdf0e10cSrcweir         case SID_DELETE_LAYER:
967cdf0e10cSrcweir             DeleteActualLayer();
968cdf0e10cSrcweir             Cancel();
969cdf0e10cSrcweir             rReq.Ignore ();
970cdf0e10cSrcweir         break;
971cdf0e10cSrcweir 
972cdf0e10cSrcweir         case SID_ORIGINAL_SIZE:
973cdf0e10cSrcweir             mpDrawView->SetMarkedOriginalSize();
974cdf0e10cSrcweir             Cancel();
975cdf0e10cSrcweir             rReq.Done();
976cdf0e10cSrcweir         break;
977cdf0e10cSrcweir 
978cdf0e10cSrcweir         case SID_DRAW_FONTWORK:
979cdf0e10cSrcweir         case SID_DRAW_FONTWORK_VERTICAL:
980cdf0e10cSrcweir         {
981cdf0e10cSrcweir             svx::FontworkBar::execute( mpView, rReq, GetViewFrame()->GetBindings() );       // SJ: can be removed  (I think)
982cdf0e10cSrcweir             Cancel();
983cdf0e10cSrcweir             rReq.Done();
984cdf0e10cSrcweir         }
985cdf0e10cSrcweir         break;
986cdf0e10cSrcweir 
987cdf0e10cSrcweir         case SID_SAVEGRAPHIC:
988cdf0e10cSrcweir         {
989cdf0e10cSrcweir             const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
990cdf0e10cSrcweir             if( rMarkList.GetMarkCount() == 1 )
991cdf0e10cSrcweir             {
992cdf0e10cSrcweir                 SdrGrafObj *pGrafObj = dynamic_cast< SdrGrafObj* >( rMarkList.GetMark( 0 )->GetMarkedSdrObj() );
993cdf0e10cSrcweir                 if(pGrafObj )
994cdf0e10cSrcweir                 {
995cdf0e10cSrcweir                     ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape( pGrafObj->getUnoShape(), com::sun::star::uno::UNO_QUERY );
996cdf0e10cSrcweir                     SdGRFFilter::SaveGraphic( xShape );
997cdf0e10cSrcweir                 }
998cdf0e10cSrcweir             }
999cdf0e10cSrcweir             Cancel();
1000cdf0e10cSrcweir             rReq.Ignore();
1001cdf0e10cSrcweir         }
1002cdf0e10cSrcweir         break;
1003cdf0e10cSrcweir 
1004cdf0e10cSrcweir         default:
1005cdf0e10cSrcweir         {
1006cdf0e10cSrcweir             // switch Anweisung wegen CLOOKS aufgeteilt. Alle case-Anweisungen die
1007cdf0e10cSrcweir             // eine Fu???? -Funktion aufrufen, sind in die Methode FuTemp01 (drviews8)
1008cdf0e10cSrcweir             // gewandert.
1009cdf0e10cSrcweir             FuTemp01(rReq);
1010cdf0e10cSrcweir         }
1011cdf0e10cSrcweir         break;
1012cdf0e10cSrcweir     }
1013cdf0e10cSrcweir 
1014cdf0e10cSrcweir     if(HasCurrentFunction())
1015cdf0e10cSrcweir     {
1016cdf0e10cSrcweir         GetCurrentFunction()->Activate();
1017cdf0e10cSrcweir     }
1018cdf0e10cSrcweir }
1019cdf0e10cSrcweir 
1020*1ff378efSZheng Fan void DrawViewShell::ExecChar( SfxRequest &rReq )
1021*1ff378efSZheng Fan {
1022*1ff378efSZheng Fan     SdDrawDocument* pDoc = GetDoc();
1023*1ff378efSZheng Fan     if (!pDoc || !mpDrawView)
1024*1ff378efSZheng Fan     return;
1025cdf0e10cSrcweir 
1026*1ff378efSZheng Fan     SfxItemSet aEditAttr( pDoc->GetPool() );
1027*1ff378efSZheng Fan     mpDrawView->GetAttributes( aEditAttr );
1028*1ff378efSZheng Fan 
1029*1ff378efSZheng Fan     //modified by wj for sym2_1580, if put old itemset into new set,
1030*1ff378efSZheng Fan     //when mpDrawView->SetAttributes(aNewAttr) it will invalidate all the item
1031*1ff378efSZheng Fan     // and use old attr to update all the attributes
1032*1ff378efSZheng Fan //  SfxItemSet aNewAttr( GetPool(),
1033*1ff378efSZheng Fan //  EE_ITEMS_START, EE_ITEMS_END );
1034*1ff378efSZheng Fan //  aNewAttr.Put( aEditAttr, sal_False );
1035*1ff378efSZheng Fan     SfxItemSet aNewAttr( pDoc->GetPool() );
1036*1ff378efSZheng Fan     //modified end
1037*1ff378efSZheng Fan 
1038*1ff378efSZheng Fan     sal_uInt16 nSId = rReq.GetSlot();
1039*1ff378efSZheng Fan 
1040*1ff378efSZheng Fan     MapSlot( nSId );
1041*1ff378efSZheng Fan 
1042*1ff378efSZheng Fan     switch ( nSId )
1043*1ff378efSZheng Fan     {
1044*1ff378efSZheng Fan     case SID_ATTR_CHAR_FONT:
1045*1ff378efSZheng Fan         if( rReq.GetArgs() )
1046*1ff378efSZheng Fan         {
1047*1ff378efSZheng Fan             SFX_REQUEST_ARG( rReq, pItem, SvxFontItem, SID_ATTR_CHAR_FONT , sal_False );
1048*1ff378efSZheng Fan             if (pItem)
1049*1ff378efSZheng Fan             {
1050*1ff378efSZheng Fan                 aNewAttr.Put(*pItem);
1051*1ff378efSZheng Fan             }
1052*1ff378efSZheng Fan         }
1053*1ff378efSZheng Fan         break;
1054*1ff378efSZheng Fan     case SID_ATTR_CHAR_FONTHEIGHT:
1055*1ff378efSZheng Fan         if( rReq.GetArgs() )
1056*1ff378efSZheng Fan         {
1057*1ff378efSZheng Fan             SFX_REQUEST_ARG( rReq, pItem, SvxFontHeightItem, SID_ATTR_CHAR_FONTHEIGHT , sal_False );
1058*1ff378efSZheng Fan             if (pItem)
1059*1ff378efSZheng Fan             {
1060*1ff378efSZheng Fan                 aNewAttr.Put(*pItem);
1061*1ff378efSZheng Fan             }
1062*1ff378efSZheng Fan         }
1063*1ff378efSZheng Fan         break;
1064*1ff378efSZheng Fan     case SID_ATTR_CHAR_WEIGHT:
1065*1ff378efSZheng Fan         if( rReq.GetArgs() )
1066*1ff378efSZheng Fan         {
1067*1ff378efSZheng Fan             //const SvxWeightItem *pItem = (const SvxWeightItem*) rReq.GetArg( SID_ATTR_CHAR_WEIGHT, sal_False, TYPE(SvxWeightItem) );
1068*1ff378efSZheng Fan             SFX_REQUEST_ARG( rReq, pItem, SvxWeightItem, SID_ATTR_CHAR_WEIGHT , sal_False );
1069*1ff378efSZheng Fan             if (pItem)
1070*1ff378efSZheng Fan             {
1071*1ff378efSZheng Fan                 aNewAttr.Put(*pItem);
1072*1ff378efSZheng Fan             }
1073*1ff378efSZheng Fan         }
1074*1ff378efSZheng Fan         break;
1075*1ff378efSZheng Fan     case SID_ATTR_CHAR_POSTURE:
1076*1ff378efSZheng Fan         if( rReq.GetArgs() )
1077*1ff378efSZheng Fan         {
1078*1ff378efSZheng Fan             //const SvxPostureItem *pItem = (const SvxPostureItem*) rReq.GetArg( SID_ATTR_CHAR_POSTURE, sal_False, TYPE(SvxPostureItem) );
1079*1ff378efSZheng Fan             SFX_REQUEST_ARG( rReq, pItem, SvxPostureItem, SID_ATTR_CHAR_POSTURE , sal_False );
1080*1ff378efSZheng Fan             if (pItem)
1081*1ff378efSZheng Fan             {
1082*1ff378efSZheng Fan                 aNewAttr.Put(*pItem);
1083*1ff378efSZheng Fan             }
1084*1ff378efSZheng Fan         }
1085*1ff378efSZheng Fan         break;
1086*1ff378efSZheng Fan     case SID_ATTR_CHAR_UNDERLINE:
1087*1ff378efSZheng Fan         if( rReq.GetArgs() )
1088*1ff378efSZheng Fan         {
1089*1ff378efSZheng Fan             //<<modify by wj for sym2_1873
1090*1ff378efSZheng Fan             //SFX_REQUEST_ARG( rReq, pItem, SvxTextLineItem, SID_ATTR_CHAR_UNDERLINE , sal_False );
1091*1ff378efSZheng Fan             SFX_REQUEST_ARG( rReq, pItem, SvxUnderlineItem, SID_ATTR_CHAR_UNDERLINE , sal_False );
1092*1ff378efSZheng Fan             //end>>
1093*1ff378efSZheng Fan             if (pItem)
1094*1ff378efSZheng Fan             {
1095*1ff378efSZheng Fan                 aNewAttr.Put(*pItem);
1096*1ff378efSZheng Fan             }
1097*1ff378efSZheng Fan             else
1098*1ff378efSZheng Fan             {
1099*1ff378efSZheng Fan                 FontUnderline eFU = ( (const SvxUnderlineItem&) aEditAttr.Get( EE_CHAR_UNDERLINE ) ).GetLineStyle();
1100*1ff378efSZheng Fan                 aNewAttr.Put( SvxUnderlineItem( eFU != UNDERLINE_NONE ?UNDERLINE_NONE : UNDERLINE_SINGLE,  EE_CHAR_UNDERLINE ) );
1101*1ff378efSZheng Fan             }//aNewAttr.Put( (const SvxUnderlineItem&)aEditAttr.Get( EE_CHAR_UNDERLINE ) );
1102*1ff378efSZheng Fan         }
1103*1ff378efSZheng Fan         break;
1104*1ff378efSZheng Fan     case SID_ATTR_CHAR_SHADOWED:
1105*1ff378efSZheng Fan         if( rReq.GetArgs() )
1106*1ff378efSZheng Fan         {
1107*1ff378efSZheng Fan             SFX_REQUEST_ARG( rReq, pItem, SvxShadowedItem, SID_ATTR_CHAR_SHADOWED , sal_False );
1108*1ff378efSZheng Fan             if (pItem)
1109*1ff378efSZheng Fan             {
1110*1ff378efSZheng Fan                 aNewAttr.Put(*pItem);
1111*1ff378efSZheng Fan             }
1112*1ff378efSZheng Fan         }
1113*1ff378efSZheng Fan         break;
1114*1ff378efSZheng Fan     case SID_ATTR_CHAR_STRIKEOUT:
1115*1ff378efSZheng Fan         if( rReq.GetArgs() )
1116*1ff378efSZheng Fan         {
1117*1ff378efSZheng Fan             SFX_REQUEST_ARG( rReq, pItem, SvxCrossedOutItem, SID_ATTR_CHAR_STRIKEOUT , sal_False );
1118*1ff378efSZheng Fan             if (pItem)
1119*1ff378efSZheng Fan             {
1120*1ff378efSZheng Fan                 aNewAttr.Put(*pItem);
1121*1ff378efSZheng Fan             }
1122*1ff378efSZheng Fan         }
1123*1ff378efSZheng Fan         break;
1124*1ff378efSZheng Fan     case SID_ATTR_CHAR_COLOR:
1125*1ff378efSZheng Fan         if( rReq.GetArgs() )
1126*1ff378efSZheng Fan         {
1127*1ff378efSZheng Fan             SFX_REQUEST_ARG( rReq, pItem, SvxColorItem, SID_ATTR_CHAR_COLOR , sal_False );
1128*1ff378efSZheng Fan             if (pItem)
1129*1ff378efSZheng Fan             {
1130*1ff378efSZheng Fan                 aNewAttr.Put(*pItem);
1131*1ff378efSZheng Fan             }
1132*1ff378efSZheng Fan         }
1133*1ff378efSZheng Fan         break;
1134*1ff378efSZheng Fan     case SID_ATTR_CHAR_KERNING:
1135*1ff378efSZheng Fan         if( rReq.GetArgs() )
1136*1ff378efSZheng Fan         {
1137*1ff378efSZheng Fan             SFX_REQUEST_ARG( rReq, pItem, SvxKerningItem, SID_ATTR_CHAR_KERNING , sal_False );
1138*1ff378efSZheng Fan             if (pItem)
1139*1ff378efSZheng Fan             {
1140*1ff378efSZheng Fan                 aNewAttr.Put(*pItem);
1141*1ff378efSZheng Fan             }
1142*1ff378efSZheng Fan         }
1143*1ff378efSZheng Fan         break;
1144*1ff378efSZheng Fan     case SID_SET_SUB_SCRIPT:
1145*1ff378efSZheng Fan         if( rReq.GetArgs() )
1146*1ff378efSZheng Fan         {
1147*1ff378efSZheng Fan             SvxEscapementItem aItem( EE_CHAR_ESCAPEMENT );
1148*1ff378efSZheng Fan             SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&)
1149*1ff378efSZheng Fan                             aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
1150*1ff378efSZheng Fan             if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT )
1151*1ff378efSZheng Fan                 aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
1152*1ff378efSZheng Fan             else
1153*1ff378efSZheng Fan                 aItem.SetEscapement( SVX_ESCAPEMENT_SUBSCRIPT );
1154*1ff378efSZheng Fan             aNewAttr.Put( aItem );
1155*1ff378efSZheng Fan         }
1156*1ff378efSZheng Fan         break;
1157*1ff378efSZheng Fan     case SID_SET_SUPER_SCRIPT:
1158*1ff378efSZheng Fan         if( rReq.GetArgs() )
1159*1ff378efSZheng Fan         {
1160*1ff378efSZheng Fan             SvxEscapementItem aItem( EE_CHAR_ESCAPEMENT );
1161*1ff378efSZheng Fan             SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&)
1162*1ff378efSZheng Fan                             aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
1163*1ff378efSZheng Fan             if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
1164*1ff378efSZheng Fan                 aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
1165*1ff378efSZheng Fan             else
1166*1ff378efSZheng Fan                 aItem.SetEscapement( SVX_ESCAPEMENT_SUPERSCRIPT );
1167*1ff378efSZheng Fan             aNewAttr.Put( aItem );
1168*1ff378efSZheng Fan         }
1169*1ff378efSZheng Fan         break;
1170*1ff378efSZheng Fan     default:
1171*1ff378efSZheng Fan         ;
1172*1ff378efSZheng Fan     }
1173*1ff378efSZheng Fan 
1174*1ff378efSZheng Fan     mpDrawView->SetAttributes(aNewAttr);
1175*1ff378efSZheng Fan     rReq.Done();
1176*1ff378efSZheng Fan     Cancel();
1177*1ff378efSZheng Fan }
1178cdf0e10cSrcweir 
1179cdf0e10cSrcweir 
1180cdf0e10cSrcweir /** This method consists basically of three parts:
1181cdf0e10cSrcweir     1. Process the arguments of the SFX request.
1182cdf0e10cSrcweir     2. Use the model to create a new page or duplicate an existing one.
1183cdf0e10cSrcweir     3. Update the tab control and switch to the new page.
1184cdf0e10cSrcweir */
1185cdf0e10cSrcweir SdPage* DrawViewShell::CreateOrDuplicatePage (
1186cdf0e10cSrcweir     SfxRequest& rRequest,
1187cdf0e10cSrcweir     PageKind ePageKind,
1188cdf0e10cSrcweir     SdPage* pPage,
1189cdf0e10cSrcweir     const sal_Int32 nInsertPosition)
1190cdf0e10cSrcweir {
1191cdf0e10cSrcweir     SdPage* pNewPage = NULL;
1192cdf0e10cSrcweir     if (ePageKind == PK_STANDARD && meEditMode != EM_MASTERPAGE)
1193cdf0e10cSrcweir     {
1194cdf0e10cSrcweir         if ( mpDrawView->IsTextEdit() )
1195cdf0e10cSrcweir         {
1196cdf0e10cSrcweir             mpDrawView->SdrEndTextEdit();
1197cdf0e10cSrcweir         }
1198cdf0e10cSrcweir         pNewPage = ViewShell::CreateOrDuplicatePage (rRequest, ePageKind, pPage, nInsertPosition);
1199cdf0e10cSrcweir     }
1200cdf0e10cSrcweir     return pNewPage;
1201cdf0e10cSrcweir }
1202cdf0e10cSrcweir 
1203*1ff378efSZheng Fan void DrawViewShell::ExecutePropPanelAttr (SfxRequest& rReq)
1204*1ff378efSZheng Fan {
1205*1ff378efSZheng Fan     if(SlideShow::IsRunning( GetViewShellBase() ))
1206*1ff378efSZheng Fan         return;
1207*1ff378efSZheng Fan 
1208*1ff378efSZheng Fan     SdDrawDocument* pDoc = GetDoc();
1209*1ff378efSZheng Fan     if (!pDoc || !mpDrawView)
1210*1ff378efSZheng Fan         return;
1211*1ff378efSZheng Fan 
1212*1ff378efSZheng Fan     sal_uInt16 nSId = rReq.GetSlot();
1213*1ff378efSZheng Fan     SfxItemSet aAttrs( pDoc->GetPool() );
1214*1ff378efSZheng Fan 
1215*1ff378efSZheng Fan     switch ( nSId )
1216*1ff378efSZheng Fan     {
1217*1ff378efSZheng Fan     case SID_TABLE_VERT_NONE:
1218*1ff378efSZheng Fan     case SID_TABLE_VERT_CENTER:
1219*1ff378efSZheng Fan     case SID_TABLE_VERT_BOTTOM:
1220*1ff378efSZheng Fan         SdrTextVertAdjust eTVA = SDRTEXTVERTADJUST_TOP;
1221*1ff378efSZheng Fan         if (nSId == SID_TABLE_VERT_CENTER)
1222*1ff378efSZheng Fan             eTVA = SDRTEXTVERTADJUST_CENTER;
1223*1ff378efSZheng Fan         else if (nSId == SID_TABLE_VERT_BOTTOM)
1224*1ff378efSZheng Fan             eTVA = SDRTEXTVERTADJUST_BOTTOM;
1225*1ff378efSZheng Fan 
1226*1ff378efSZheng Fan         aAttrs.Put( SdrTextVertAdjustItem(eTVA) );
1227*1ff378efSZheng Fan         mpDrawView->SetAttributes(aAttrs);
1228*1ff378efSZheng Fan 
1229*1ff378efSZheng Fan         break;
1230*1ff378efSZheng Fan     }
1231*1ff378efSZheng Fan }
1232*1ff378efSZheng Fan 
1233*1ff378efSZheng Fan void DrawViewShell::GetStatePropPanelAttr(SfxItemSet& rSet)
1234*1ff378efSZheng Fan {
1235*1ff378efSZheng Fan     SfxWhichIter    aIter( rSet );
1236*1ff378efSZheng Fan     sal_uInt16          nWhich = aIter.FirstWhich();
1237*1ff378efSZheng Fan 
1238*1ff378efSZheng Fan     SdDrawDocument* pDoc = GetDoc();
1239*1ff378efSZheng Fan     if (!pDoc || !mpDrawView)
1240*1ff378efSZheng Fan         return;
1241*1ff378efSZheng Fan 
1242*1ff378efSZheng Fan     SfxItemSet aAttrs( pDoc->GetPool() );
1243*1ff378efSZheng Fan     mpDrawView->GetAttributes( aAttrs );
1244*1ff378efSZheng Fan 
1245*1ff378efSZheng Fan     while ( nWhich )
1246*1ff378efSZheng Fan     {
1247*1ff378efSZheng Fan         sal_uInt16 nSlotId = SfxItemPool::IsWhich(nWhich)
1248*1ff378efSZheng Fan             ? GetPool().GetSlotId(nWhich)
1249*1ff378efSZheng Fan             : nWhich;
1250*1ff378efSZheng Fan         switch ( nSlotId )
1251*1ff378efSZheng Fan         {
1252*1ff378efSZheng Fan             case SID_TABLE_VERT_NONE:
1253*1ff378efSZheng Fan             case SID_TABLE_VERT_CENTER:
1254*1ff378efSZheng Fan             case SID_TABLE_VERT_BOTTOM:
1255*1ff378efSZheng Fan                 sal_Bool bContour = sal_False;
1256*1ff378efSZheng Fan                 SfxItemState eConState = aAttrs.GetItemState( SDRATTR_TEXT_CONTOURFRAME );
1257*1ff378efSZheng Fan                 if( eConState != SFX_ITEM_DONTCARE )
1258*1ff378efSZheng Fan                 {
1259*1ff378efSZheng Fan                     bContour = ( ( const SdrTextContourFrameItem& )aAttrs.Get( SDRATTR_TEXT_CONTOURFRAME ) ).GetValue();
1260*1ff378efSZheng Fan                 }
1261*1ff378efSZheng Fan                 if (bContour) break;
1262*1ff378efSZheng Fan 
1263*1ff378efSZheng Fan                 SfxItemState eVState = aAttrs.GetItemState( SDRATTR_TEXT_VERTADJUST );
1264*1ff378efSZheng Fan                 //SfxItemState eHState = aAttrs.GetItemState( SDRATTR_TEXT_HORZADJUST );
1265*1ff378efSZheng Fan 
1266*1ff378efSZheng Fan                 //if(SFX_ITEM_DONTCARE != eVState && SFX_ITEM_DONTCARE != eHState)
1267*1ff378efSZheng Fan                 if(SFX_ITEM_DONTCARE != eVState)
1268*1ff378efSZheng Fan                 {
1269*1ff378efSZheng Fan                     SdrTextVertAdjust eTVA = (SdrTextVertAdjust)((const SdrTextVertAdjustItem&)aAttrs.Get(SDRATTR_TEXT_VERTADJUST)).GetValue();
1270*1ff378efSZheng Fan                     sal_Bool bSet = nSlotId == SID_TABLE_VERT_NONE && eTVA == SDRTEXTVERTADJUST_TOP||
1271*1ff378efSZheng Fan                             nSlotId == SID_TABLE_VERT_CENTER && eTVA == SDRTEXTVERTADJUST_CENTER ||
1272*1ff378efSZheng Fan                             nSlotId == SID_TABLE_VERT_BOTTOM && eTVA == SDRTEXTVERTADJUST_BOTTOM;
1273*1ff378efSZheng Fan                     rSet.Put(SfxBoolItem(nSlotId, bSet));
1274*1ff378efSZheng Fan                 }
1275*1ff378efSZheng Fan                 else
1276*1ff378efSZheng Fan                 {
1277*1ff378efSZheng Fan                     rSet.Put(SfxBoolItem(nSlotId, sal_False));
1278*1ff378efSZheng Fan                 }
1279*1ff378efSZheng Fan                 break;
1280*1ff378efSZheng Fan         }
1281*1ff378efSZheng Fan         nWhich = aIter.NextWhich();
1282*1ff378efSZheng Fan     }
1283*1ff378efSZheng Fan }
1284*1ff378efSZheng Fan 
1285cdf0e10cSrcweir } // end of namespace sd
1286