xref: /aoo41x/main/sd/source/ui/view/drviews2.cxx (revision a19c5a60)
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 #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 
661ff378efSZheng Fan #include <editeng/escpitem.hxx>
671ff378efSZheng Fan #include <editeng/kernitem.hxx>
681ff378efSZheng Fan #include <editeng/wghtitem.hxx>
691ff378efSZheng Fan #include <editeng/postitem.hxx>
701ff378efSZheng Fan #include <editeng/udlnitem.hxx>
711ff378efSZheng Fan #include <editeng/crsditem.hxx>
721ff378efSZheng Fan #include <editeng/cntritem.hxx>
731ff378efSZheng Fan #include <editeng/shdditem.hxx>
741ff378efSZheng Fan #include <svx/xtable.hxx>
751ff378efSZheng Fan #include <svx/svdobj.hxx>
761ff378efSZheng Fan #include <editeng/outlobj.hxx>
771ff378efSZheng Fan #include <editeng/flstitem.hxx>
781ff378efSZheng Fan #include <editeng/scripttypeitem.hxx>
791ff378efSZheng Fan #include <editeng/fontitem.hxx>
801ff378efSZheng Fan #include <editeng/fhgtitem.hxx>
811ff378efSZheng Fan #include <editeng/colritem.hxx>
821ff378efSZheng Fan #include <editeng/brshitem.hxx>
831ff378efSZheng Fan 
841ff378efSZheng Fan #include <svl/whiter.hxx>
851ff378efSZheng 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"
107*512ec161SZheng Fan #include "futext.hxx"
108cdf0e10cSrcweir #include "stlpool.hxx"
109cdf0e10cSrcweir 
110cdf0e10cSrcweir // #90356#
111cdf0e10cSrcweir #include "optsitem.hxx"
112cdf0e10cSrcweir #include "sdabstdlg.hxx"
113cdf0e10cSrcweir #include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
114cdf0e10cSrcweir #include <com/sun/star/drawing/XDrawPages.hpp>
115cdf0e10cSrcweir 
116cdf0e10cSrcweir #include <strings.hrc>
117cdf0e10cSrcweir 
118cdf0e10cSrcweir using namespace ::com::sun::star;
119cdf0e10cSrcweir using namespace ::com::sun::star::uno;
120cdf0e10cSrcweir 
121cdf0e10cSrcweir namespace sd {
122cdf0e10cSrcweir 
123cdf0e10cSrcweir /*************************************************************************
124cdf0e10cSrcweir |*
125cdf0e10cSrcweir |* SfxRequests fuer temporaere Funktionen
126cdf0e10cSrcweir |*
127cdf0e10cSrcweir \************************************************************************/
128cdf0e10cSrcweir 
FuTemporary(SfxRequest & rReq)129cdf0e10cSrcweir void DrawViewShell::FuTemporary(SfxRequest& rReq)
130cdf0e10cSrcweir {
131cdf0e10cSrcweir 	// Waehrend einer Native-Diashow wird nichts ausgefuehrt!
132cdf0e10cSrcweir 	if(SlideShow::IsRunning( GetViewShellBase() ) && (rReq.GetSlot() != SID_NAVIGATOR))
133cdf0e10cSrcweir 		return;
134cdf0e10cSrcweir 
135cdf0e10cSrcweir 	DBG_ASSERT( mpDrawView, "sd::DrawViewShell::FuTemporary(), no draw view!" );
136cdf0e10cSrcweir 	if( !mpDrawView )
137cdf0e10cSrcweir 		return;
138cdf0e10cSrcweir 
139cdf0e10cSrcweir 	CheckLineTo (rReq);
140cdf0e10cSrcweir 
141cdf0e10cSrcweir 	DeactivateCurrentFunction();
142cdf0e10cSrcweir 
143cdf0e10cSrcweir 	sal_uInt16 nSId = rReq.GetSlot();
144cdf0e10cSrcweir 
145cdf0e10cSrcweir 	// Slot wird gemapped (ToolboxImages/-Slots)
146cdf0e10cSrcweir 	MapSlot( nSId );
147cdf0e10cSrcweir 
148cdf0e10cSrcweir 	switch ( nSId )
149cdf0e10cSrcweir 	{
150cdf0e10cSrcweir 		// Flaechen und Linien-Attribute:
151cdf0e10cSrcweir 		// Sollten (wie StateMethode) eine eigene
152cdf0e10cSrcweir 		// Execute-Methode besitzen
153cdf0e10cSrcweir 		case SID_ATTR_FILL_STYLE:
154cdf0e10cSrcweir 		case SID_ATTR_FILL_COLOR:
155cdf0e10cSrcweir 		case SID_ATTR_FILL_GRADIENT:
156cdf0e10cSrcweir 		case SID_ATTR_FILL_HATCH:
157cdf0e10cSrcweir 		case SID_ATTR_FILL_BITMAP:
158cdf0e10cSrcweir 		case SID_ATTR_FILL_SHADOW:
159d5370dc8SArmin Le Grand         case SID_ATTR_FILL_TRANSPARENCE:
160d5370dc8SArmin Le Grand         case SID_ATTR_FILL_FLOATTRANSPARENCE:
161cdf0e10cSrcweir 
162cdf0e10cSrcweir 		case SID_ATTR_LINE_STYLE:
163cdf0e10cSrcweir 		case SID_ATTR_LINE_DASH:
164cdf0e10cSrcweir 		case SID_ATTR_LINE_WIDTH:
165cdf0e10cSrcweir 		case SID_ATTR_LINE_COLOR:
166cdf0e10cSrcweir 		case SID_ATTR_LINEEND_STYLE:
167d5370dc8SArmin Le Grand         case SID_ATTR_LINE_START:
168d5370dc8SArmin Le Grand         case SID_ATTR_LINE_END:
169d5370dc8SArmin Le Grand         case SID_ATTR_LINE_TRANSPARENCE:
170d5370dc8SArmin Le Grand         case SID_ATTR_LINE_JOINT:
171d5370dc8SArmin Le Grand         case SID_ATTR_LINE_CAP:
172cdf0e10cSrcweir 
173cdf0e10cSrcweir 		case SID_ATTR_TEXT_FITTOSIZE:
174cdf0e10cSrcweir 		{
175cdf0e10cSrcweir 			if( rReq.GetArgs() )
176cdf0e10cSrcweir 			{
177cdf0e10cSrcweir 				mpDrawView->SetAttributes(*rReq.GetArgs());
178cdf0e10cSrcweir 				rReq.Done();
179cdf0e10cSrcweir 			}
180cdf0e10cSrcweir 			else
181cdf0e10cSrcweir 			{
182cdf0e10cSrcweir 				switch( rReq.GetSlot() )
183cdf0e10cSrcweir 				{
184cdf0e10cSrcweir 					case SID_ATTR_FILL_SHADOW:
185cdf0e10cSrcweir 					case SID_ATTR_FILL_STYLE:
186cdf0e10cSrcweir 					case SID_ATTR_FILL_COLOR:
187cdf0e10cSrcweir 					case SID_ATTR_FILL_GRADIENT:
188cdf0e10cSrcweir 					case SID_ATTR_FILL_HATCH:
189cdf0e10cSrcweir 					case SID_ATTR_FILL_BITMAP:
190d5370dc8SArmin Le Grand                     case SID_ATTR_FILL_TRANSPARENCE:
191d5370dc8SArmin Le Grand                     case SID_ATTR_FILL_FLOATTRANSPARENCE:
192cdf0e10cSrcweir 						GetViewFrame()->GetDispatcher()->Execute( SID_ATTRIBUTES_AREA, SFX_CALLMODE_ASYNCHRON );
193cdf0e10cSrcweir 						break;
194cdf0e10cSrcweir 					case SID_ATTR_LINE_STYLE:
195cdf0e10cSrcweir 					case SID_ATTR_LINE_DASH:
196cdf0e10cSrcweir 					case SID_ATTR_LINE_WIDTH:
197cdf0e10cSrcweir 					case SID_ATTR_LINE_COLOR:
198d5370dc8SArmin Le Grand                     case SID_ATTR_LINE_TRANSPARENCE:
199d5370dc8SArmin Le Grand                     case SID_ATTR_LINE_JOINT:
200d5370dc8SArmin Le Grand                     case SID_ATTR_LINE_CAP:
201cdf0e10cSrcweir 						GetViewFrame()->GetDispatcher()->Execute( SID_ATTRIBUTES_LINE, SFX_CALLMODE_ASYNCHRON );
202cdf0e10cSrcweir 						break;
203cdf0e10cSrcweir 					case SID_ATTR_TEXT_FITTOSIZE:
204cdf0e10cSrcweir 						GetViewFrame()->GetDispatcher()->Execute( SID_TEXTATTR_DLG, SFX_CALLMODE_ASYNCHRON );
205cdf0e10cSrcweir 						break;
206cdf0e10cSrcweir 				}
207cdf0e10cSrcweir 			}
208cdf0e10cSrcweir 			Cancel();
209cdf0e10cSrcweir 		}
210cdf0e10cSrcweir 		break;
211cdf0e10cSrcweir 
212cdf0e10cSrcweir 		case SID_HYPHENATION:
213cdf0e10cSrcweir 		{
214cdf0e10cSrcweir 			// const SfxPoolItem* pItem = rReq.GetArg( SID_HYPHENATION );
215cdf0e10cSrcweir 			//  ^-- Soll so nicht benutzt werden (Defaults sind falsch) !
216cdf0e10cSrcweir 			SFX_REQUEST_ARG( rReq, pItem, SfxBoolItem, SID_HYPHENATION, sal_False);
217cdf0e10cSrcweir 
218cdf0e10cSrcweir 			if( pItem )
219cdf0e10cSrcweir 			{
220cdf0e10cSrcweir 				SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE );
221cdf0e10cSrcweir 				sal_Bool bValue = ( (const SfxBoolItem*) pItem)->GetValue();
222cdf0e10cSrcweir 				aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, bValue ) );
223cdf0e10cSrcweir 				mpDrawView->SetAttributes( aSet );
224cdf0e10cSrcweir 			}
225cdf0e10cSrcweir 			else // nur zum Test
226cdf0e10cSrcweir 			{
227cdf0e10cSrcweir 				DBG_ERROR(" Kein Wert fuer Silbentrennung!");
228cdf0e10cSrcweir 				SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE );
229cdf0e10cSrcweir 				sal_Bool bValue = sal_True;
230cdf0e10cSrcweir 				aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, bValue ) );
231cdf0e10cSrcweir 				mpDrawView->SetAttributes( aSet );
232cdf0e10cSrcweir 			}
233cdf0e10cSrcweir 			rReq.Done();
234cdf0e10cSrcweir 			Cancel();
235cdf0e10cSrcweir 		}
236cdf0e10cSrcweir 		break;
237cdf0e10cSrcweir 
238cdf0e10cSrcweir 		case SID_INSERTPAGE:
239cdf0e10cSrcweir 		case SID_INSERTPAGE_QUICK:
240cdf0e10cSrcweir 		case SID_DUPLICATE_PAGE:
241cdf0e10cSrcweir         {
242cdf0e10cSrcweir             SdPage* pNewPage = CreateOrDuplicatePage (rReq, mePageKind, GetActualPage());
243cdf0e10cSrcweir             Cancel();
244cdf0e10cSrcweir             if(HasCurrentFunction(SID_BEZIER_EDIT) )
245cdf0e10cSrcweir                 GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
246cdf0e10cSrcweir             if (pNewPage != NULL)
247cdf0e10cSrcweir                 SwitchPage((pNewPage->GetPageNum()-1)/2);
248cdf0e10cSrcweir             rReq.Done ();
249cdf0e10cSrcweir         }
250cdf0e10cSrcweir 		break;
251cdf0e10cSrcweir 
252cdf0e10cSrcweir 		case SID_INSERT_MASTER_PAGE:
253cdf0e10cSrcweir         {
254cdf0e10cSrcweir             // Use the API to create a new page.
255cdf0e10cSrcweir             Reference<drawing::XMasterPagesSupplier> xMasterPagesSupplier (
256cdf0e10cSrcweir                 GetDoc()->getUnoModel(), UNO_QUERY);
257cdf0e10cSrcweir             if (xMasterPagesSupplier.is())
258cdf0e10cSrcweir             {
259cdf0e10cSrcweir                 Reference<drawing::XDrawPages> xMasterPages (
260cdf0e10cSrcweir                     xMasterPagesSupplier->getMasterPages());
261cdf0e10cSrcweir                 if (xMasterPages.is())
262cdf0e10cSrcweir                 {
263cdf0e10cSrcweir                     sal_uInt16 nIndex = GetCurPageId();
264cdf0e10cSrcweir                     xMasterPages->insertNewByIndex (nIndex);
265cdf0e10cSrcweir 
266cdf0e10cSrcweir                     // Create shapes for the default layout.
267cdf0e10cSrcweir                     SdPage* pMasterPage = GetDoc()->GetMasterSdPage(
268cdf0e10cSrcweir                         nIndex, PK_STANDARD);
269cdf0e10cSrcweir                     pMasterPage->CreateTitleAndLayout (sal_True,sal_True);
270cdf0e10cSrcweir                 }
271cdf0e10cSrcweir             }
272cdf0e10cSrcweir 
273cdf0e10cSrcweir             Cancel();
274cdf0e10cSrcweir             if(HasCurrentFunction(SID_BEZIER_EDIT))
275cdf0e10cSrcweir                 GetViewFrame()->GetDispatcher()->Execute(
276cdf0e10cSrcweir                     SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
277cdf0e10cSrcweir             rReq.Done ();
278cdf0e10cSrcweir         }
279cdf0e10cSrcweir         break;
280cdf0e10cSrcweir 
281cdf0e10cSrcweir 		case SID_MODIFYPAGE:
282cdf0e10cSrcweir 		{
283cdf0e10cSrcweir 			if (mePageKind==PK_STANDARD || mePageKind==PK_NOTES ||
284cdf0e10cSrcweir 				(mePageKind==PK_HANDOUT && meEditMode==EM_MASTERPAGE) )
285cdf0e10cSrcweir 			{
286cdf0e10cSrcweir 				if ( mpDrawView->IsTextEdit() )
287cdf0e10cSrcweir 				{
288cdf0e10cSrcweir 					mpDrawView->SdrEndTextEdit();
289cdf0e10cSrcweir 				}
290cdf0e10cSrcweir 				sal_uInt16 nPage = maTabControl.GetCurPageId() - 1;
291cdf0e10cSrcweir 				mpActualPage = GetDoc()->GetSdPage(nPage, mePageKind);
292cdf0e10cSrcweir                 ::sd::ViewShell::mpImpl->ProcessModifyPageSlot (
293cdf0e10cSrcweir                     rReq,
294cdf0e10cSrcweir                     mpActualPage,
295cdf0e10cSrcweir                     mePageKind);
296cdf0e10cSrcweir 			}
297cdf0e10cSrcweir 
298cdf0e10cSrcweir 			Cancel();
299cdf0e10cSrcweir 			rReq.Done ();
300cdf0e10cSrcweir 		}
301cdf0e10cSrcweir 		break;
302cdf0e10cSrcweir 
303cdf0e10cSrcweir         case SID_ASSIGN_LAYOUT:
304cdf0e10cSrcweir 		{
305cdf0e10cSrcweir 			if (mePageKind==PK_STANDARD || mePageKind==PK_NOTES || (mePageKind==PK_HANDOUT && meEditMode==EM_MASTERPAGE))
306cdf0e10cSrcweir 			{
307cdf0e10cSrcweir 			    if ( mpDrawView->IsTextEdit() )
308cdf0e10cSrcweir 				    mpDrawView->SdrEndTextEdit();
309cdf0e10cSrcweir 
310cdf0e10cSrcweir 				::sd::ViewShell::mpImpl->AssignLayout(rReq, mePageKind);
311cdf0e10cSrcweir             }
312cdf0e10cSrcweir             Cancel();
313cdf0e10cSrcweir 			rReq.Done ();
314cdf0e10cSrcweir 		}
315cdf0e10cSrcweir         break;
316cdf0e10cSrcweir 
317cdf0e10cSrcweir 		case SID_RENAMEPAGE:
318cdf0e10cSrcweir 		case SID_RENAME_MASTER_PAGE:
319cdf0e10cSrcweir         {
320cdf0e10cSrcweir 			if (mePageKind==PK_STANDARD || mePageKind==PK_NOTES )
321cdf0e10cSrcweir 			{
322cdf0e10cSrcweir 				if ( mpDrawView->IsTextEdit() )
323cdf0e10cSrcweir 				{
324cdf0e10cSrcweir 					mpDrawView->SdrEndTextEdit();
325cdf0e10cSrcweir 				}
326cdf0e10cSrcweir 
327cdf0e10cSrcweir                 sal_uInt16 nPageId = maTabControl.GetCurPageId();
328cdf0e10cSrcweir                 SdPage* pCurrentPage = ( GetEditMode() == EM_PAGE )
329cdf0e10cSrcweir                     ? GetDoc()->GetSdPage( nPageId - 1, GetPageKind() )
330cdf0e10cSrcweir                     : GetDoc()->GetMasterSdPage( nPageId - 1, GetPageKind() );
331cdf0e10cSrcweir 
332cdf0e10cSrcweir                 String aTitle( SdResId( STR_TITLE_RENAMESLIDE ) );
333cdf0e10cSrcweir                 String aDescr( SdResId( STR_DESC_RENAMESLIDE ) );
334cdf0e10cSrcweir                 String aPageName = pCurrentPage->GetName();
335cdf0e10cSrcweir 
336cdf0e10cSrcweir                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
337cdf0e10cSrcweir 				DBG_ASSERT(pFact, "Dialogdiet fail!");
338cdf0e10cSrcweir 				AbstractSvxNameDialog* aNameDlg = pFact->CreateSvxNameDialog( GetActiveWindow(), aPageName, aDescr );
339cdf0e10cSrcweir 				DBG_ASSERT(aNameDlg, "Dialogdiet fail!");
340cdf0e10cSrcweir 				aNameDlg->SetText( aTitle );
341cdf0e10cSrcweir                 aNameDlg->SetCheckNameHdl( LINK( this, DrawViewShell, RenameSlideHdl ), true );
342cdf0e10cSrcweir                 aNameDlg->SetEditHelpId( HID_SD_NAMEDIALOG_PAGE );
343cdf0e10cSrcweir 
344cdf0e10cSrcweir                 if( aNameDlg->Execute() == RET_OK )
345cdf0e10cSrcweir                 {
346cdf0e10cSrcweir                     String aNewName;
347cdf0e10cSrcweir                     aNameDlg->GetName( aNewName );
348cdf0e10cSrcweir                     if( ! aNewName.Equals( aPageName ) )
349cdf0e10cSrcweir                     {
350cdf0e10cSrcweir #ifdef DBG_UTIL
351cdf0e10cSrcweir                         bool bResult =
352cdf0e10cSrcweir #endif
353cdf0e10cSrcweir 							RenameSlide( nPageId, aNewName );
354cdf0e10cSrcweir                         DBG_ASSERT( bResult, "Couldn't rename slide" );
355cdf0e10cSrcweir                     }
356cdf0e10cSrcweir                 }
357cdf0e10cSrcweir 				delete aNameDlg;
358cdf0e10cSrcweir             }
359cdf0e10cSrcweir 
360cdf0e10cSrcweir 			Cancel();
361cdf0e10cSrcweir 			rReq.Ignore ();
362cdf0e10cSrcweir         }
363cdf0e10cSrcweir         break;
364cdf0e10cSrcweir 
365cdf0e10cSrcweir         case SID_RENAMEPAGE_QUICK:
366cdf0e10cSrcweir 		{
367cdf0e10cSrcweir 			if (mePageKind==PK_STANDARD || mePageKind==PK_NOTES )
368cdf0e10cSrcweir 			{
369cdf0e10cSrcweir 				if ( mpDrawView->IsTextEdit() )
370cdf0e10cSrcweir 				{
371cdf0e10cSrcweir 					mpDrawView->SdrEndTextEdit();
372cdf0e10cSrcweir 				}
373cdf0e10cSrcweir 
374cdf0e10cSrcweir 				maTabControl.StartEditMode( maTabControl.GetCurPageId() );
375cdf0e10cSrcweir 			}
376cdf0e10cSrcweir 
377cdf0e10cSrcweir 			Cancel();
378cdf0e10cSrcweir 			rReq.Ignore ();
379cdf0e10cSrcweir 		}
380cdf0e10cSrcweir 		break;
381cdf0e10cSrcweir 
382cdf0e10cSrcweir 		case SID_PAGESIZE :  // entweder dieses (kein menueeintrag o. ae. !!)
383cdf0e10cSrcweir 		{
384cdf0e10cSrcweir 			const SfxItemSet *pArgs = rReq.GetArgs ();
385cdf0e10cSrcweir 
386cdf0e10cSrcweir 			if (pArgs)
387cdf0e10cSrcweir 				if (pArgs->Count () == 3)
388cdf0e10cSrcweir 				{
389cdf0e10cSrcweir 					SFX_REQUEST_ARG (rReq, pWidth, SfxUInt32Item, ID_VAL_PAGEWIDTH, sal_False);
390cdf0e10cSrcweir 					SFX_REQUEST_ARG (rReq, pHeight, SfxUInt32Item, ID_VAL_PAGEHEIGHT, sal_False);
391cdf0e10cSrcweir 					SFX_REQUEST_ARG (rReq, pScaleAll, SfxBoolItem, ID_VAL_SCALEOBJECTS, sal_False);
392cdf0e10cSrcweir 
393cdf0e10cSrcweir 					Size aSize (pWidth->GetValue (), pHeight->GetValue ());
394cdf0e10cSrcweir 
395cdf0e10cSrcweir 					SetupPage (aSize, 0, 0, 0, 0, sal_True, sal_False, pScaleAll->GetValue ());
396cdf0e10cSrcweir 					rReq.Ignore ();
397cdf0e10cSrcweir 					break;
398cdf0e10cSrcweir 				}
399cdf0e10cSrcweir 
400cdf0e10cSrcweir 			StarBASIC::FatalError (SbERR_WRONG_ARGS);
401cdf0e10cSrcweir 			rReq.Ignore ();
402cdf0e10cSrcweir 			break;
403cdf0e10cSrcweir 		}
404cdf0e10cSrcweir 
405cdf0e10cSrcweir 		case SID_PAGEMARGIN :  // oder dieses (kein menueeintrag o. ae. !!)
406cdf0e10cSrcweir 		{
407cdf0e10cSrcweir 			const SfxItemSet *pArgs = rReq.GetArgs ();
408cdf0e10cSrcweir 
409cdf0e10cSrcweir 			if (pArgs)
410cdf0e10cSrcweir 				if (pArgs->Count () == 5)
411cdf0e10cSrcweir 				{
412cdf0e10cSrcweir 					SFX_REQUEST_ARG (rReq, pLeft, SfxUInt32Item, ID_VAL_PAGELEFT, sal_False);
413cdf0e10cSrcweir 					SFX_REQUEST_ARG (rReq, pRight, SfxUInt32Item, ID_VAL_PAGERIGHT, sal_False);
414cdf0e10cSrcweir 					SFX_REQUEST_ARG (rReq, pUpper, SfxUInt32Item, ID_VAL_PAGETOP, sal_False);
415cdf0e10cSrcweir 					SFX_REQUEST_ARG (rReq, pLower, SfxUInt32Item, ID_VAL_PAGEBOTTOM, sal_False);
416cdf0e10cSrcweir 					SFX_REQUEST_ARG (rReq, pScaleAll, SfxBoolItem, ID_VAL_SCALEOBJECTS, sal_False);
417cdf0e10cSrcweir 
418cdf0e10cSrcweir 					Size aEmptySize (0, 0);
419cdf0e10cSrcweir 
420cdf0e10cSrcweir 					SetupPage (aEmptySize, pLeft->GetValue (), pRight->GetValue (),
421cdf0e10cSrcweir 							   pUpper->GetValue (), pLower->GetValue (),
422cdf0e10cSrcweir 							   sal_False, sal_True, pScaleAll->GetValue ());
423cdf0e10cSrcweir 					rReq.Ignore ();
424cdf0e10cSrcweir 					break;
425cdf0e10cSrcweir 				}
426cdf0e10cSrcweir 
427cdf0e10cSrcweir 			StarBASIC::FatalError (SbERR_WRONG_ARGS);
428cdf0e10cSrcweir 			rReq.Ignore ();
429cdf0e10cSrcweir 			break;
430cdf0e10cSrcweir 		}
431cdf0e10cSrcweir 
432cdf0e10cSrcweir 		case SID_ATTR_ZOOMSLIDER:
433cdf0e10cSrcweir 		{
434cdf0e10cSrcweir 			const SfxItemSet* pArgs = rReq.GetArgs();
435cdf0e10cSrcweir 
436cdf0e10cSrcweir 			if (pArgs && pArgs->Count () == 1 )
437cdf0e10cSrcweir 			{
438cdf0e10cSrcweir 				SFX_REQUEST_ARG (rReq, pScale, SfxUInt16Item, SID_ATTR_ZOOMSLIDER, sal_False);
439cdf0e10cSrcweir 				if (CHECK_RANGE (5, pScale->GetValue (), 3000))
440cdf0e10cSrcweir 				{
441cdf0e10cSrcweir 					SetZoom (pScale->GetValue ());
442cdf0e10cSrcweir 
443cdf0e10cSrcweir 					SfxBindings& rBindings = GetViewFrame()->GetBindings();
444cdf0e10cSrcweir 					rBindings.Invalidate( SID_ATTR_ZOOM );
445cdf0e10cSrcweir 					rBindings.Invalidate( SID_ZOOM_IN );
446cdf0e10cSrcweir 					rBindings.Invalidate( SID_ZOOM_OUT );
447cdf0e10cSrcweir 					rBindings.Invalidate( SID_ATTR_ZOOMSLIDER );
448cdf0e10cSrcweir 
449cdf0e10cSrcweir 				}
450cdf0e10cSrcweir 			}
451cdf0e10cSrcweir 
452cdf0e10cSrcweir 			Cancel();
453cdf0e10cSrcweir 			rReq.Done ();
454cdf0e10cSrcweir 			break;
455cdf0e10cSrcweir 		}
456cdf0e10cSrcweir 		case SID_ZOOMING :	// kein Menueintrag, sondern aus dem Zoomdialog generiert
457cdf0e10cSrcweir 		{
458cdf0e10cSrcweir 			const SfxItemSet* pArgs = rReq.GetArgs();
459cdf0e10cSrcweir 
460cdf0e10cSrcweir 			if (pArgs)
461cdf0e10cSrcweir 				if (pArgs->Count () == 1)
462cdf0e10cSrcweir 				{
463cdf0e10cSrcweir 					SFX_REQUEST_ARG (rReq, pScale, SfxUInt32Item, ID_VAL_ZOOM, sal_False);
464cdf0e10cSrcweir 					if (CHECK_RANGE (10, pScale->GetValue (), 1000))
465cdf0e10cSrcweir 					{
466cdf0e10cSrcweir 						SetZoom (pScale->GetValue ());
467cdf0e10cSrcweir 
468cdf0e10cSrcweir 						SfxBindings& rBindings = GetViewFrame()->GetBindings();
469cdf0e10cSrcweir 						rBindings.Invalidate( SID_ATTR_ZOOM );
470cdf0e10cSrcweir 						rBindings.Invalidate( SID_ZOOM_IN );
471cdf0e10cSrcweir 						rBindings.Invalidate( SID_ZOOM_OUT );
472cdf0e10cSrcweir 						rBindings.Invalidate( SID_ATTR_ZOOMSLIDER );
473cdf0e10cSrcweir 					}
474cdf0e10cSrcweir 					else StarBASIC::FatalError (SbERR_BAD_PROP_VALUE);
475cdf0e10cSrcweir 
476cdf0e10cSrcweir 					rReq.Ignore ();
477cdf0e10cSrcweir 					break;
478cdf0e10cSrcweir 				}
479cdf0e10cSrcweir 
480cdf0e10cSrcweir 			StarBASIC::FatalError (SbERR_WRONG_ARGS);
481cdf0e10cSrcweir 			rReq.Ignore ();
482cdf0e10cSrcweir 			break;
483cdf0e10cSrcweir 		}
484cdf0e10cSrcweir 
485cdf0e10cSrcweir 		case SID_ATTR_ZOOM:
486cdf0e10cSrcweir 		{
487cdf0e10cSrcweir 			const SfxItemSet* pArgs = rReq.GetArgs();
488cdf0e10cSrcweir 			mbZoomOnPage = sal_False;
489cdf0e10cSrcweir 
490cdf0e10cSrcweir 			if ( pArgs )
491cdf0e10cSrcweir 			{
492cdf0e10cSrcweir 				SvxZoomType eZT = ( ( const SvxZoomItem& ) pArgs->
493cdf0e10cSrcweir 											Get( SID_ATTR_ZOOM ) ).GetType();
494cdf0e10cSrcweir 				switch( eZT )
495cdf0e10cSrcweir 				{
496cdf0e10cSrcweir 					case SVX_ZOOM_PERCENT:
497cdf0e10cSrcweir 						SetZoom( (long) ( ( const SvxZoomItem& ) pArgs->
498cdf0e10cSrcweir 											Get( SID_ATTR_ZOOM ) ).GetValue() );
499cdf0e10cSrcweir 						break;
500cdf0e10cSrcweir 
501cdf0e10cSrcweir 					case SVX_ZOOM_OPTIMAL:
502cdf0e10cSrcweir 						GetViewFrame()->GetDispatcher()->Execute( SID_SIZE_ALL,
503cdf0e10cSrcweir 									SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
504cdf0e10cSrcweir 						break;
505cdf0e10cSrcweir 
506cdf0e10cSrcweir 					case SVX_ZOOM_PAGEWIDTH:
507cdf0e10cSrcweir 						GetViewFrame()->GetDispatcher()->Execute( SID_SIZE_PAGE_WIDTH,
508cdf0e10cSrcweir 									SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
509cdf0e10cSrcweir 						break;
510cdf0e10cSrcweir 
511cdf0e10cSrcweir 					case SVX_ZOOM_WHOLEPAGE:
512cdf0e10cSrcweir 						GetViewFrame()->GetDispatcher()->Execute( SID_SIZE_PAGE,
513cdf0e10cSrcweir 									SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
514cdf0e10cSrcweir 						break;
515cdf0e10cSrcweir 					case SVX_ZOOM_PAGEWIDTH_NOBORDER:
516cdf0e10cSrcweir 						DBG_ERROR("sd::DrawViewShell::FuTemporary(), SVX_ZOOM_PAGEWIDTH_NOBORDER not handled!" );
517cdf0e10cSrcweir 						break;
518cdf0e10cSrcweir 				}
519cdf0e10cSrcweir 				rReq.Ignore ();
520cdf0e10cSrcweir 			}
521cdf0e10cSrcweir 			else
522cdf0e10cSrcweir 			{
523cdf0e10cSrcweir 				// hier den Zoom-Dialog oeffnen
524cdf0e10cSrcweir 				SetCurrentFunction( FuScale::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
525cdf0e10cSrcweir 			}
526cdf0e10cSrcweir 			Cancel();
527cdf0e10cSrcweir 		}
528cdf0e10cSrcweir 		break;
529cdf0e10cSrcweir 
530cdf0e10cSrcweir 		case SID_CHANGEBEZIER:
531cdf0e10cSrcweir 		case SID_CHANGEPOLYGON:
532cdf0e10cSrcweir 			if ( mpDrawView->IsTextEdit() )
533cdf0e10cSrcweir 			{
534cdf0e10cSrcweir 				mpDrawView->SdrEndTextEdit();
535cdf0e10cSrcweir 				GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
536cdf0e10cSrcweir 			}
537cdf0e10cSrcweir 
538cdf0e10cSrcweir 			if ( mpDrawView->IsPresObjSelected() )
539cdf0e10cSrcweir 			{
540cdf0e10cSrcweir                 ::sd::Window* pWindow = GetActiveWindow();
541cdf0e10cSrcweir 				InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
542cdf0e10cSrcweir 			}
543cdf0e10cSrcweir 			else
544cdf0e10cSrcweir 			{
545cdf0e10cSrcweir 				if( rReq.GetSlot() == SID_CHANGEBEZIER )
546cdf0e10cSrcweir 				{
547cdf0e10cSrcweir 					WaitObject aWait( (Window*)GetActiveWindow() );
548cdf0e10cSrcweir 					mpDrawView->ConvertMarkedToPathObj(sal_False);
549cdf0e10cSrcweir 				}
550cdf0e10cSrcweir 				else
551cdf0e10cSrcweir 				{
552cdf0e10cSrcweir 					if( mpDrawView->IsVectorizeAllowed() )
553ddde725dSArmin Le Grand                     {
554cdf0e10cSrcweir 						SetCurrentFunction( FuVectorize::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
555ddde725dSArmin Le Grand                     }
556cdf0e10cSrcweir 					else
557cdf0e10cSrcweir 					{
558cdf0e10cSrcweir 						WaitObject aWait( (Window*)GetActiveWindow() );
559cdf0e10cSrcweir 						mpDrawView->ConvertMarkedToPolyObj(sal_False);
560cdf0e10cSrcweir 					}
561cdf0e10cSrcweir 				}
562cdf0e10cSrcweir 
563cdf0e10cSrcweir 				Invalidate(SID_CHANGEBEZIER);
564cdf0e10cSrcweir 				Invalidate(SID_CHANGEPOLYGON);
565cdf0e10cSrcweir 			}
566cdf0e10cSrcweir 			Cancel();
567cdf0e10cSrcweir 
568cdf0e10cSrcweir 			if( HasCurrentFunction(SID_BEZIER_EDIT) )
569cdf0e10cSrcweir 			{	// ggf. die richtige Editfunktion aktivieren
570cdf0e10cSrcweir 				GetViewFrame()->GetDispatcher()->Execute(SID_SWITCH_POINTEDIT,
571cdf0e10cSrcweir 										SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD);
572cdf0e10cSrcweir 			}
573cdf0e10cSrcweir 			rReq.Ignore ();
574cdf0e10cSrcweir 			break;
575cdf0e10cSrcweir 
576cdf0e10cSrcweir 		case SID_CONVERT_TO_CONTOUR:
577cdf0e10cSrcweir 			if ( mpDrawView->IsTextEdit() )
578cdf0e10cSrcweir 			{
579cdf0e10cSrcweir 				mpDrawView->SdrEndTextEdit();
580cdf0e10cSrcweir 				GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
581cdf0e10cSrcweir 			}
582cdf0e10cSrcweir 
583cdf0e10cSrcweir 			if ( mpDrawView->IsPresObjSelected() )
584cdf0e10cSrcweir 			{
585cdf0e10cSrcweir                 ::sd::Window* pWindow = GetActiveWindow();
586cdf0e10cSrcweir 				InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
587cdf0e10cSrcweir 			}
588cdf0e10cSrcweir 			else
589cdf0e10cSrcweir 			{
590cdf0e10cSrcweir 				WaitObject aWait( (Window*)GetActiveWindow() );
591cdf0e10cSrcweir 				mpDrawView->ConvertMarkedToPathObj(sal_True);
592cdf0e10cSrcweir 
593cdf0e10cSrcweir 				Invalidate(SID_CONVERT_TO_CONTOUR);
594cdf0e10cSrcweir 			}
595cdf0e10cSrcweir 			Cancel();
596cdf0e10cSrcweir 
597cdf0e10cSrcweir 			rReq.Ignore ();
598cdf0e10cSrcweir 			break;
599cdf0e10cSrcweir 
600cdf0e10cSrcweir 		case SID_CONVERT_TO_METAFILE:
601cdf0e10cSrcweir 		case SID_CONVERT_TO_BITMAP:
602cdf0e10cSrcweir 		{
603cdf0e10cSrcweir             // End text edit mode when it is active because the metafile or
604cdf0e10cSrcweir             // bitmap that will be created does not support it.
605cdf0e10cSrcweir             if ( mpDrawView->IsTextEdit() )
606cdf0e10cSrcweir 			{
607cdf0e10cSrcweir 				mpDrawView->SdrEndTextEdit();
608cdf0e10cSrcweir 				GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
609cdf0e10cSrcweir             }
610cdf0e10cSrcweir 
611cdf0e10cSrcweir 			if ( mpDrawView->IsPresObjSelected(true,true,true) )
612cdf0e10cSrcweir 			{
613cdf0e10cSrcweir                 ::sd::Window* pWindow = GetActiveWindow();
614cdf0e10cSrcweir 				InfoBox(pWindow, String(SdResId(STR_ACTION_NOTPOSSIBLE) ) ).Execute();
615cdf0e10cSrcweir 			}
616cdf0e10cSrcweir 			else
617cdf0e10cSrcweir 			{
618cdf0e10cSrcweir 				WaitObject aWait( (Window*)GetActiveWindow() );
619cdf0e10cSrcweir 
620cdf0e10cSrcweir 				// switch on undo for the next operations
621cdf0e10cSrcweir 				mpDrawView->BegUndo(
622cdf0e10cSrcweir 					String(
623cdf0e10cSrcweir 					SdResId (nSId==SID_CONVERT_TO_METAFILE ? STR_UNDO_CONVERT_TO_METAFILE : STR_UNDO_CONVERT_TO_BITMAP)));
624cdf0e10cSrcweir 
625cdf0e10cSrcweir 				// create SdrGrafObj from metafile/bitmap
626cdf0e10cSrcweir 				Graphic aGraphic;
627cdf0e10cSrcweir 				switch (nSId)
628cdf0e10cSrcweir 				{
629cdf0e10cSrcweir 					case SID_CONVERT_TO_METAFILE:
630cdf0e10cSrcweir 					{
631bb18ee55SArmin Le Grand 						GDIMetaFile aMetaFile(mpDrawView->GetMarkedObjMetaFile());
632cdf0e10cSrcweir 						aGraphic = Graphic(aMetaFile);
633cdf0e10cSrcweir 					}
634cdf0e10cSrcweir 					break;
635cdf0e10cSrcweir 					case SID_CONVERT_TO_BITMAP:
636cdf0e10cSrcweir 					{
637ddde725dSArmin Le Grand                         bool bDone(false);
638ddde725dSArmin Le Grand 
639bb18ee55SArmin Le Grand                         // I have to get the image here directly since GetMarkedObjBitmapEx works
640ddde725dSArmin Le Grand                         // based on Bitmaps, but not on BitmapEx, thus throwing away the alpha
641bb18ee55SArmin Le Grand                         // channel. Argh! GetMarkedObjBitmapEx itself is too widely used to safely
642ddde725dSArmin Le Grand                         // change that, e.g. in the exchange formats. For now I can only add this
643ddde725dSArmin Le Grand                         // exception to get good results for Svgs. This is how the code gets more
644ddde725dSArmin Le Grand                         // and more crowded, at last I made a remark for myself to change this
645ddde725dSArmin Le Grand                         // as one of the next tasks.
646ddde725dSArmin Le Grand                         if(1 == mpDrawView->GetMarkedObjectCount())
647ddde725dSArmin Le Grand                         {
648ddde725dSArmin Le Grand                             const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(mpDrawView->GetMarkedObjectByIndex(0));
649ddde725dSArmin Le Grand 
650ddde725dSArmin Le Grand                             if(pSdrGrafObj && pSdrGrafObj->isEmbeddedSvg())
651ddde725dSArmin Le Grand                             {
652ddde725dSArmin Le Grand                                 aGraphic = Graphic(pSdrGrafObj->GetGraphic().getSvgData()->getReplacement());
653ddde725dSArmin Le Grand                                 bDone = true;
654ddde725dSArmin Le Grand                             }
655ddde725dSArmin Le Grand                         }
656ddde725dSArmin Le Grand 
657ddde725dSArmin Le Grand                         if(!bDone)
658ddde725dSArmin Le Grand                         {
659bb18ee55SArmin Le Grand                             aGraphic = Graphic(mpDrawView->GetMarkedObjBitmapEx());
660ddde725dSArmin Le Grand                         }
661cdf0e10cSrcweir 					}
662cdf0e10cSrcweir 					break;
663cdf0e10cSrcweir 				}
664cdf0e10cSrcweir 
665cdf0e10cSrcweir 				// create new object
666cdf0e10cSrcweir 				SdrGrafObj* pGraphicObj = new SdrGrafObj (aGraphic);
667cdf0e10cSrcweir 
668cdf0e10cSrcweir 				// get some necessary info and ensure it
669cdf0e10cSrcweir 				const SdrMarkList& rMarkList(mpDrawView->GetMarkedObjectList());
670cdf0e10cSrcweir 				const sal_uInt32 nMarkCount(rMarkList.GetMarkCount());
671cdf0e10cSrcweir 				SdrPageView* pPageView = mpDrawView->GetSdrPageView();
672cdf0e10cSrcweir 				OSL_ENSURE(nMarkCount, "DrawViewShell::FuTemporary: SID_CONVERT_TO_BITMAP with empty selection (!)");
673cdf0e10cSrcweir 				OSL_ENSURE(pPageView, "DrawViewShell::FuTemporary: SID_CONVERT_TO_BITMAP without SdrPageView (!)");
674cdf0e10cSrcweir 
675cdf0e10cSrcweir 				// fit rectangle of new graphic object to selection's mark rect
676cdf0e10cSrcweir 				Rectangle aAllMarkedRect;
677cdf0e10cSrcweir 				rMarkList.TakeBoundRect(pPageView, aAllMarkedRect);
678cdf0e10cSrcweir 				pGraphicObj->SetLogicRect(aAllMarkedRect);
679cdf0e10cSrcweir 
680cdf0e10cSrcweir 				// #i71540# to keep the order, it is necessary to replace the lowest object
681cdf0e10cSrcweir 				// of the selection with the new object. This also means that with multi
682cdf0e10cSrcweir 				// selection, all other objects need to be deleted first
683cdf0e10cSrcweir 				SdrMark* pFirstMark = rMarkList.GetMark(0L);
684cdf0e10cSrcweir 				SdrObject* pReplacementCandidate = pFirstMark->GetMarkedSdrObj();
685cdf0e10cSrcweir 
686cdf0e10cSrcweir 				if(nMarkCount > 1L)
687cdf0e10cSrcweir 				{
688cdf0e10cSrcweir 					// take first object out of selection
689cdf0e10cSrcweir 					mpDrawView->MarkObj(pReplacementCandidate, pPageView, true, true);
690cdf0e10cSrcweir 
691cdf0e10cSrcweir 					// clear remaining selection
692cdf0e10cSrcweir 					mpDrawView->DeleteMarkedObj();
693cdf0e10cSrcweir 				}
694cdf0e10cSrcweir 
695cdf0e10cSrcweir 				// now replace lowest object with new one
696cdf0e10cSrcweir 				mpDrawView->ReplaceObjectAtView(pReplacementCandidate, *pPageView, pGraphicObj);
697cdf0e10cSrcweir 
698cdf0e10cSrcweir 				// switch off undo
699cdf0e10cSrcweir 				mpDrawView->EndUndo();
700cdf0e10cSrcweir 			}
701cdf0e10cSrcweir 		}
702cdf0e10cSrcweir 
703cdf0e10cSrcweir 		Cancel();
704cdf0e10cSrcweir 
705cdf0e10cSrcweir 		rReq.Done ();
706cdf0e10cSrcweir 		break;
707cdf0e10cSrcweir 
708cdf0e10cSrcweir 		case SID_SET_DEFAULT:
709cdf0e10cSrcweir 		{
710cdf0e10cSrcweir 			SfxItemSet* pSet = NULL;
711cdf0e10cSrcweir 
712cdf0e10cSrcweir 			if (mpDrawView->IsTextEdit())
713cdf0e10cSrcweir 			{
714cdf0e10cSrcweir 				::Outliner* pOutl = mpDrawView->GetTextEditOutliner();
715cdf0e10cSrcweir 				if (pOutl)
716cdf0e10cSrcweir 				{
717cdf0e10cSrcweir 					pOutl->RemoveFields(sal_True, (TypeId) SvxURLField::StaticType());
718cdf0e10cSrcweir 				}
719cdf0e10cSrcweir 
720cdf0e10cSrcweir 				pSet = new SfxItemSet( GetPool(), EE_ITEMS_START, EE_ITEMS_END );
721cdf0e10cSrcweir 				mpDrawView->SetAttributes( *pSet, sal_True );
722cdf0e10cSrcweir 			}
723cdf0e10cSrcweir 			else
724cdf0e10cSrcweir 			{
725cdf0e10cSrcweir 				const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
726cdf0e10cSrcweir 				sal_uLong nCount = rMarkList.GetMarkCount();
727cdf0e10cSrcweir 
728cdf0e10cSrcweir 				// In diese Liste werden fuer jedes Praesentationsobjekt ein SfxItemSet
729cdf0e10cSrcweir 				// der harten Attribute sowie der UserCall eingetragen, da diese beim nachfolgenden
730cdf0e10cSrcweir 				// mpDrawView->SetAttributes( *pSet, sal_True ) verloren gehen und spaeter restauriert
731cdf0e10cSrcweir 				// werden muessen
732cdf0e10cSrcweir 				List* pAttrList = new List();
733cdf0e10cSrcweir 				SdPage* pPresPage = (SdPage*) mpDrawView->GetSdrPageView()->GetPage();
734cdf0e10cSrcweir 				sal_uLong i;
735cdf0e10cSrcweir 
736cdf0e10cSrcweir 				for ( i = 0; i < nCount; i++ )
737cdf0e10cSrcweir 				{
738cdf0e10cSrcweir 					SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
739cdf0e10cSrcweir 
740cdf0e10cSrcweir 					if( pPresPage->IsPresObj( pObj ) )
741cdf0e10cSrcweir 					{
742cdf0e10cSrcweir 						SfxItemSet* pNewSet = new SfxItemSet( GetDoc()->GetPool(), SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_AUTOGROWHEIGHT, 0 );
743cdf0e10cSrcweir 						pNewSet->Put(pObj->GetMergedItemSet());
744cdf0e10cSrcweir 						pAttrList->Insert( pNewSet, LIST_APPEND );
745cdf0e10cSrcweir 						pAttrList->Insert( pObj->GetUserCall(), LIST_APPEND );
746cdf0e10cSrcweir 					}
747cdf0e10cSrcweir 				}
748cdf0e10cSrcweir 
749cdf0e10cSrcweir 				pSet = new SfxItemSet( GetPool() );
750cdf0e10cSrcweir 				mpDrawView->SetAttributes( *pSet, sal_True );
751cdf0e10cSrcweir 
752cdf0e10cSrcweir 				sal_uLong j = 0;
753cdf0e10cSrcweir 
754cdf0e10cSrcweir 				for ( i = 0; i < nCount; i++ )
755cdf0e10cSrcweir 				{
756cdf0e10cSrcweir 					SfxStyleSheet* pSheet = NULL;
757cdf0e10cSrcweir 					SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
758cdf0e10cSrcweir 
759cdf0e10cSrcweir 					if (pObj->GetObjIdentifier() == OBJ_TITLETEXT)
760cdf0e10cSrcweir 					{
761cdf0e10cSrcweir 						pSheet = mpActualPage->GetStyleSheetForPresObj(PRESOBJ_TITLE);
762cdf0e10cSrcweir 						if (pSheet)
763cdf0e10cSrcweir 							pObj->SetStyleSheet(pSheet, sal_False);
764cdf0e10cSrcweir 					}
765cdf0e10cSrcweir 					else if(pObj->GetObjIdentifier() == OBJ_OUTLINETEXT)
766cdf0e10cSrcweir 					{
767cdf0e10cSrcweir 						for (sal_uInt16 nLevel = 1; nLevel < 10; nLevel++)
768cdf0e10cSrcweir 						{
769cdf0e10cSrcweir 							pSheet = mpActualPage->GetStyleSheetForPresObj( PRESOBJ_OUTLINE );
770cdf0e10cSrcweir 							DBG_ASSERT(pSheet, "Vorlage fuer Gliederungsobjekt nicht gefunden");
771cdf0e10cSrcweir 							if (pSheet)
772cdf0e10cSrcweir 							{
773cdf0e10cSrcweir 								pObj->StartListening(*pSheet);
774cdf0e10cSrcweir 
775cdf0e10cSrcweir 								if( nLevel == 1 )
776cdf0e10cSrcweir 									// Textrahmen hoert auf StyleSheet der Ebene1
777cdf0e10cSrcweir 									pObj->NbcSetStyleSheet(pSheet, sal_False);
778cdf0e10cSrcweir 
779cdf0e10cSrcweir 							}
780cdf0e10cSrcweir 						}
781cdf0e10cSrcweir 					}
782cdf0e10cSrcweir 
783cdf0e10cSrcweir 					if( pPresPage->IsPresObj( pObj ) )
784cdf0e10cSrcweir 					{
785cdf0e10cSrcweir 						SfxItemSet* pNewSet = (SfxItemSet*) pAttrList->GetObject(j++);
786cdf0e10cSrcweir 						SdrObjUserCall* pUserCall = (SdrObjUserCall*) pAttrList->GetObject(j++);
787cdf0e10cSrcweir 
788cdf0e10cSrcweir 						if ( pNewSet && pNewSet->GetItemState( SDRATTR_TEXT_MINFRAMEHEIGHT ) == SFX_ITEM_ON )
789cdf0e10cSrcweir 						{
790cdf0e10cSrcweir 							pObj->SetMergedItem(pNewSet->Get(SDRATTR_TEXT_MINFRAMEHEIGHT));
791cdf0e10cSrcweir 						}
792cdf0e10cSrcweir 
793cdf0e10cSrcweir 						if ( pNewSet && pNewSet->GetItemState( SDRATTR_TEXT_AUTOGROWHEIGHT ) == SFX_ITEM_ON )
794cdf0e10cSrcweir 						{
795cdf0e10cSrcweir 							pObj->SetMergedItem(pNewSet->Get(SDRATTR_TEXT_AUTOGROWHEIGHT));
796cdf0e10cSrcweir 						}
797cdf0e10cSrcweir 
798cdf0e10cSrcweir 						if( pUserCall )
799cdf0e10cSrcweir 							pObj->SetUserCall( pUserCall );
800cdf0e10cSrcweir 
801cdf0e10cSrcweir 						delete pNewSet;
802cdf0e10cSrcweir 					}
803cdf0e10cSrcweir 				}
804cdf0e10cSrcweir 
805cdf0e10cSrcweir 				delete pAttrList;
806cdf0e10cSrcweir 			}
807cdf0e10cSrcweir 
808cdf0e10cSrcweir 			delete pSet;
809cdf0e10cSrcweir 			Cancel();
810cdf0e10cSrcweir 		}
811cdf0e10cSrcweir 		break;
812cdf0e10cSrcweir 
813cdf0e10cSrcweir 		case SID_DELETE_SNAPITEM:
814cdf0e10cSrcweir 		{
815cdf0e10cSrcweir 			SdrPageView* pPV;
816cdf0e10cSrcweir 			Point	aMPos = GetActiveWindow()->PixelToLogic( maMousePos );
817cdf0e10cSrcweir 			sal_uInt16	nHitLog = (sal_uInt16) GetActiveWindow()->PixelToLogic( Size(
818cdf0e10cSrcweir                 FuPoor::HITPIX, 0 ) ).Width();
819cdf0e10cSrcweir 			sal_uInt16	nHelpLine;
820cdf0e10cSrcweir 
821cdf0e10cSrcweir 			mbMousePosFreezed = sal_False;
822cdf0e10cSrcweir 
823cdf0e10cSrcweir 			if( mpDrawView->PickHelpLine( aMPos, nHitLog, *GetActiveWindow(), nHelpLine, pPV) )
824cdf0e10cSrcweir 			{
825cdf0e10cSrcweir 				pPV->DeleteHelpLine( nHelpLine );
826cdf0e10cSrcweir 			}
827cdf0e10cSrcweir 			Cancel();
828cdf0e10cSrcweir 			rReq.Ignore ();
829cdf0e10cSrcweir 		}
830cdf0e10cSrcweir 		break;
831cdf0e10cSrcweir 
832cdf0e10cSrcweir 		case SID_DELETE_PAGE:
833cdf0e10cSrcweir 		case SID_DELETE_MASTER_PAGE:
834cdf0e10cSrcweir 			DeleteActualPage();
835cdf0e10cSrcweir 			Cancel();
836cdf0e10cSrcweir 			rReq.Ignore ();
837cdf0e10cSrcweir 		break;
838cdf0e10cSrcweir 
839cdf0e10cSrcweir 		case SID_DELETE_LAYER:
840cdf0e10cSrcweir 			DeleteActualLayer();
841cdf0e10cSrcweir 			Cancel();
842cdf0e10cSrcweir 			rReq.Ignore ();
843cdf0e10cSrcweir 		break;
844cdf0e10cSrcweir 
845cdf0e10cSrcweir 		case SID_ORIGINAL_SIZE:
846cdf0e10cSrcweir 			mpDrawView->SetMarkedOriginalSize();
847cdf0e10cSrcweir 			Cancel();
848cdf0e10cSrcweir 			rReq.Done();
849cdf0e10cSrcweir 		break;
850cdf0e10cSrcweir 
851cdf0e10cSrcweir 		case SID_DRAW_FONTWORK:
852cdf0e10cSrcweir 		case SID_DRAW_FONTWORK_VERTICAL:
853cdf0e10cSrcweir 		{
854cdf0e10cSrcweir 			svx::FontworkBar::execute( mpView, rReq, GetViewFrame()->GetBindings() );		// SJ: can be removed  (I think)
855cdf0e10cSrcweir 			Cancel();
856cdf0e10cSrcweir 			rReq.Done();
857cdf0e10cSrcweir 		}
858cdf0e10cSrcweir 		break;
859cdf0e10cSrcweir 
860cdf0e10cSrcweir 		case SID_SAVEGRAPHIC:
861cdf0e10cSrcweir 		{
862cdf0e10cSrcweir 			const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
863cdf0e10cSrcweir 			if( rMarkList.GetMarkCount() == 1 )
864cdf0e10cSrcweir 			{
865cdf0e10cSrcweir 				SdrGrafObj *pGrafObj = dynamic_cast< SdrGrafObj* >( rMarkList.GetMark( 0 )->GetMarkedSdrObj() );
866cdf0e10cSrcweir 				if(pGrafObj )
867cdf0e10cSrcweir 				{
868cdf0e10cSrcweir 					::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape( pGrafObj->getUnoShape(), com::sun::star::uno::UNO_QUERY );
869cdf0e10cSrcweir 					SdGRFFilter::SaveGraphic( xShape );
870cdf0e10cSrcweir 				}
871cdf0e10cSrcweir 			}
872cdf0e10cSrcweir 			Cancel();
873cdf0e10cSrcweir 			rReq.Ignore();
874cdf0e10cSrcweir 		}
875cdf0e10cSrcweir 		break;
876cdf0e10cSrcweir 
877cdf0e10cSrcweir 		default:
878cdf0e10cSrcweir 		{
879cdf0e10cSrcweir 			// switch Anweisung wegen CLOOKS aufgeteilt. Alle case-Anweisungen die
880cdf0e10cSrcweir 			// eine Fu???? -Funktion aufrufen, sind in die Methode FuTemp01 (drviews8)
881cdf0e10cSrcweir 			// gewandert.
882cdf0e10cSrcweir 			FuTemp01(rReq);
883cdf0e10cSrcweir 		}
884cdf0e10cSrcweir 		break;
885cdf0e10cSrcweir 	}
886cdf0e10cSrcweir 
887cdf0e10cSrcweir 	if(HasCurrentFunction())
888cdf0e10cSrcweir 	{
889cdf0e10cSrcweir 		GetCurrentFunction()->Activate();
890cdf0e10cSrcweir 	}
891cdf0e10cSrcweir }
892cdf0e10cSrcweir 
ExecChar(SfxRequest & rReq)8931ff378efSZheng Fan void DrawViewShell::ExecChar( SfxRequest &rReq )
8941ff378efSZheng Fan {
8951ff378efSZheng Fan 	SdDrawDocument* pDoc = GetDoc();
8961ff378efSZheng Fan 	if (!pDoc || !mpDrawView)
8971ff378efSZheng Fan 	return;
8981ff378efSZheng Fan 
8991ff378efSZheng Fan 	SfxItemSet aEditAttr( pDoc->GetPool() );
9001ff378efSZheng Fan 	mpDrawView->GetAttributes( aEditAttr );
9011ff378efSZheng Fan 
9021ff378efSZheng Fan 	//modified by wj for sym2_1580, if put old itemset into new set,
9031ff378efSZheng Fan 	//when mpDrawView->SetAttributes(aNewAttr) it will invalidate all the item
9041ff378efSZheng Fan 	// and use old attr to update all the attributes
9051ff378efSZheng Fan //	SfxItemSet aNewAttr( GetPool(),
9061ff378efSZheng Fan //	EE_ITEMS_START, EE_ITEMS_END );
9071ff378efSZheng Fan //	aNewAttr.Put( aEditAttr, sal_False );
9081ff378efSZheng Fan 	SfxItemSet aNewAttr( pDoc->GetPool() );
9091ff378efSZheng Fan 	//modified end
9101ff378efSZheng Fan 
9111ff378efSZheng Fan 	sal_uInt16 nSId = rReq.GetSlot();
9121ff378efSZheng Fan 
9131ff378efSZheng Fan 	MapSlot( nSId );
9141ff378efSZheng Fan 
9151ff378efSZheng Fan 	switch ( nSId )
9161ff378efSZheng Fan 	{
9171ff378efSZheng Fan 	case SID_ATTR_CHAR_FONT:
9181ff378efSZheng Fan 		if( rReq.GetArgs() )
9191ff378efSZheng Fan 		{
9201ff378efSZheng Fan 			SFX_REQUEST_ARG( rReq, pItem, SvxFontItem, SID_ATTR_CHAR_FONT , sal_False );
9211ff378efSZheng Fan 			if (pItem)
9221ff378efSZheng Fan 			{
9231ff378efSZheng Fan 				aNewAttr.Put(*pItem);
9241ff378efSZheng Fan 			}
9251ff378efSZheng Fan 		}
9261ff378efSZheng Fan 		break;
9271ff378efSZheng Fan 	case SID_ATTR_CHAR_FONTHEIGHT:
9281ff378efSZheng Fan 		if( rReq.GetArgs() )
9291ff378efSZheng Fan 		{
9301ff378efSZheng Fan 			SFX_REQUEST_ARG( rReq, pItem, SvxFontHeightItem, SID_ATTR_CHAR_FONTHEIGHT , sal_False );
9311ff378efSZheng Fan 			if (pItem)
9321ff378efSZheng Fan 			{
9331ff378efSZheng Fan 				aNewAttr.Put(*pItem);
9341ff378efSZheng Fan 			}
9351ff378efSZheng Fan 		}
9361ff378efSZheng Fan 		break;
9371ff378efSZheng Fan 	case SID_ATTR_CHAR_WEIGHT:
9381ff378efSZheng Fan 		if( rReq.GetArgs() )
9391ff378efSZheng Fan 		{
9401ff378efSZheng Fan 			//const SvxWeightItem *pItem = (const SvxWeightItem*) rReq.GetArg( SID_ATTR_CHAR_WEIGHT, sal_False, TYPE(SvxWeightItem) );
9411ff378efSZheng Fan 			SFX_REQUEST_ARG( rReq, pItem, SvxWeightItem, SID_ATTR_CHAR_WEIGHT , sal_False );
9421ff378efSZheng Fan 			if (pItem)
9431ff378efSZheng Fan 			{
9441ff378efSZheng Fan 				aNewAttr.Put(*pItem);
9451ff378efSZheng Fan 			}
9461ff378efSZheng Fan 		}
9471ff378efSZheng Fan 		break;
9481ff378efSZheng Fan 	case SID_ATTR_CHAR_POSTURE:
9491ff378efSZheng Fan 		if( rReq.GetArgs() )
9501ff378efSZheng Fan 		{
9511ff378efSZheng Fan 			//const SvxPostureItem *pItem = (const SvxPostureItem*) rReq.GetArg( SID_ATTR_CHAR_POSTURE, sal_False, TYPE(SvxPostureItem) );
9521ff378efSZheng Fan 			SFX_REQUEST_ARG( rReq, pItem, SvxPostureItem, SID_ATTR_CHAR_POSTURE , sal_False );
9531ff378efSZheng Fan 			if (pItem)
9541ff378efSZheng Fan 			{
9551ff378efSZheng Fan 				aNewAttr.Put(*pItem);
9561ff378efSZheng Fan 			}
9571ff378efSZheng Fan 		}
9581ff378efSZheng Fan 		break;
9591ff378efSZheng Fan 	case SID_ATTR_CHAR_UNDERLINE:
9601ff378efSZheng Fan 		if( rReq.GetArgs() )
9611ff378efSZheng Fan 		{
9621ff378efSZheng Fan 			//<<modify by wj for sym2_1873
9631ff378efSZheng Fan 			//SFX_REQUEST_ARG( rReq, pItem, SvxTextLineItem, SID_ATTR_CHAR_UNDERLINE , sal_False );
9641ff378efSZheng Fan 			SFX_REQUEST_ARG( rReq, pItem, SvxUnderlineItem, SID_ATTR_CHAR_UNDERLINE , sal_False );
9651ff378efSZheng Fan 			//end>>
9661ff378efSZheng Fan 			if (pItem)
9671ff378efSZheng Fan 			{
9681ff378efSZheng Fan 				aNewAttr.Put(*pItem);
9691ff378efSZheng Fan 			}
9701ff378efSZheng Fan 			else
9711ff378efSZheng Fan 			{
9721ff378efSZheng Fan 				FontUnderline eFU = ( (const SvxUnderlineItem&) aEditAttr.Get( EE_CHAR_UNDERLINE ) ).GetLineStyle();
9731ff378efSZheng Fan 				aNewAttr.Put( SvxUnderlineItem( eFU != UNDERLINE_NONE ?UNDERLINE_NONE : UNDERLINE_SINGLE,  EE_CHAR_UNDERLINE ) );
9741ff378efSZheng Fan 			}//aNewAttr.Put( (const SvxUnderlineItem&)aEditAttr.Get( EE_CHAR_UNDERLINE ) );
9751ff378efSZheng Fan 		}
9761ff378efSZheng Fan 		break;
9771ff378efSZheng Fan 	case SID_ATTR_CHAR_SHADOWED:
9781ff378efSZheng Fan 		if( rReq.GetArgs() )
9791ff378efSZheng Fan 		{
9801ff378efSZheng Fan 			SFX_REQUEST_ARG( rReq, pItem, SvxShadowedItem, SID_ATTR_CHAR_SHADOWED , sal_False );
9811ff378efSZheng Fan 			if (pItem)
9821ff378efSZheng Fan 			{
9831ff378efSZheng Fan 				aNewAttr.Put(*pItem);
9841ff378efSZheng Fan 			}
9851ff378efSZheng Fan 		}
9861ff378efSZheng Fan 		break;
9871ff378efSZheng Fan 	case SID_ATTR_CHAR_STRIKEOUT:
9881ff378efSZheng Fan 		if( rReq.GetArgs() )
9891ff378efSZheng Fan 		{
9901ff378efSZheng Fan 			SFX_REQUEST_ARG( rReq, pItem, SvxCrossedOutItem, SID_ATTR_CHAR_STRIKEOUT , sal_False );
9911ff378efSZheng Fan 			if (pItem)
9921ff378efSZheng Fan 			{
9931ff378efSZheng Fan 				aNewAttr.Put(*pItem);
9941ff378efSZheng Fan 			}
9951ff378efSZheng Fan 		}
9961ff378efSZheng Fan 		break;
9971ff378efSZheng Fan 	case SID_ATTR_CHAR_COLOR:
9981ff378efSZheng Fan 		if( rReq.GetArgs() )
9991ff378efSZheng Fan 		{
10001ff378efSZheng Fan 			SFX_REQUEST_ARG( rReq, pItem, SvxColorItem, SID_ATTR_CHAR_COLOR , sal_False );
10011ff378efSZheng Fan 			if (pItem)
10021ff378efSZheng Fan 			{
10031ff378efSZheng Fan 				aNewAttr.Put(*pItem);
10041ff378efSZheng Fan 			}
10051ff378efSZheng Fan 		}
10061ff378efSZheng Fan 		break;
10071ff378efSZheng Fan 	case SID_ATTR_CHAR_KERNING:
10081ff378efSZheng Fan 		if( rReq.GetArgs() )
10091ff378efSZheng Fan 		{
10101ff378efSZheng Fan 			SFX_REQUEST_ARG( rReq, pItem, SvxKerningItem, SID_ATTR_CHAR_KERNING , sal_False );
10111ff378efSZheng Fan 			if (pItem)
10121ff378efSZheng Fan 			{
10131ff378efSZheng Fan 				aNewAttr.Put(*pItem);
10141ff378efSZheng Fan 			}
10151ff378efSZheng Fan 		}
10161ff378efSZheng Fan 		break;
10171ff378efSZheng Fan 	case SID_SET_SUB_SCRIPT:
10181ff378efSZheng Fan 		if( rReq.GetArgs() )
10191ff378efSZheng Fan 		{
10201ff378efSZheng Fan 			SvxEscapementItem aItem( EE_CHAR_ESCAPEMENT );
10211ff378efSZheng Fan 			SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&)
10221ff378efSZheng Fan 							aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
10231ff378efSZheng Fan 			if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT )
10241ff378efSZheng Fan 				aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
10251ff378efSZheng Fan 			else
10261ff378efSZheng Fan 				aItem.SetEscapement( SVX_ESCAPEMENT_SUBSCRIPT );
10271ff378efSZheng Fan 			aNewAttr.Put( aItem );
10281ff378efSZheng Fan 		}
10291ff378efSZheng Fan 		break;
10301ff378efSZheng Fan 	case SID_SET_SUPER_SCRIPT:
10311ff378efSZheng Fan 		if( rReq.GetArgs() )
10321ff378efSZheng Fan 		{
10331ff378efSZheng Fan 			SvxEscapementItem aItem( EE_CHAR_ESCAPEMENT );
10341ff378efSZheng Fan 			SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&)
10351ff378efSZheng Fan 							aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
10361ff378efSZheng Fan 			if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
10371ff378efSZheng Fan 				aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
10381ff378efSZheng Fan 			else
10391ff378efSZheng Fan 				aItem.SetEscapement( SVX_ESCAPEMENT_SUPERSCRIPT );
10401ff378efSZheng Fan 			aNewAttr.Put( aItem );
10411ff378efSZheng Fan 		}
10421ff378efSZheng Fan 		break;
1043*512ec161SZheng Fan 	case SID_SHRINK_FONT_SIZE:
1044*512ec161SZheng Fan     	case SID_GROW_FONT_SIZE:
1045*512ec161SZheng Fan 		//if (rReq.GetArgs())
1046*512ec161SZheng Fan 		{
1047*512ec161SZheng Fan 			const SvxFontListItem* pFonts = dynamic_cast<const SvxFontListItem*>(GetDocSh()->GetItem( SID_ATTR_CHAR_FONTLIST ) );
1048*512ec161SZheng Fan 			const FontList* pFontList = pFonts->GetFontList();
1049*512ec161SZheng Fan 			if( pFontList )
1050*512ec161SZheng Fan 			{
1051*512ec161SZheng Fan 				FuText::ChangeFontSize( nSId == SID_GROW_FONT_SIZE, NULL, pFontList, mpView );
1052*512ec161SZheng Fan 				GetViewFrame()->GetBindings().Invalidate( SID_ATTR_CHAR_FONTHEIGHT );
1053*512ec161SZheng Fan 			}
1054*512ec161SZheng Fan 		}
10551ff378efSZheng Fan 	default:
10561ff378efSZheng Fan 		;
10571ff378efSZheng Fan 	}
1058cdf0e10cSrcweir 
10591ff378efSZheng Fan 	mpDrawView->SetAttributes(aNewAttr);
10601ff378efSZheng Fan 	rReq.Done();
10611ff378efSZheng Fan 	Cancel();
10621ff378efSZheng Fan }
1063cdf0e10cSrcweir 
1064cdf0e10cSrcweir 
1065cdf0e10cSrcweir /** This method consists basically of three parts:
1066cdf0e10cSrcweir     1. Process the arguments of the SFX request.
1067cdf0e10cSrcweir     2. Use the model to create a new page or duplicate an existing one.
1068cdf0e10cSrcweir     3. Update the tab control and switch to the new page.
1069cdf0e10cSrcweir */
CreateOrDuplicatePage(SfxRequest & rRequest,PageKind ePageKind,SdPage * pPage,const sal_Int32 nInsertPosition)1070cdf0e10cSrcweir SdPage* DrawViewShell::CreateOrDuplicatePage (
1071cdf0e10cSrcweir     SfxRequest& rRequest,
1072cdf0e10cSrcweir     PageKind ePageKind,
1073cdf0e10cSrcweir     SdPage* pPage,
1074cdf0e10cSrcweir     const sal_Int32 nInsertPosition)
1075cdf0e10cSrcweir {
1076cdf0e10cSrcweir     SdPage* pNewPage = NULL;
1077cdf0e10cSrcweir     if (ePageKind == PK_STANDARD && meEditMode != EM_MASTERPAGE)
1078cdf0e10cSrcweir     {
1079cdf0e10cSrcweir         if ( mpDrawView->IsTextEdit() )
1080cdf0e10cSrcweir         {
1081cdf0e10cSrcweir             mpDrawView->SdrEndTextEdit();
1082cdf0e10cSrcweir         }
1083cdf0e10cSrcweir         pNewPage = ViewShell::CreateOrDuplicatePage (rRequest, ePageKind, pPage, nInsertPosition);
1084cdf0e10cSrcweir     }
1085cdf0e10cSrcweir     return pNewPage;
1086cdf0e10cSrcweir }
1087cdf0e10cSrcweir 
ExecutePropPanelAttr(SfxRequest & rReq)10881ff378efSZheng Fan void DrawViewShell::ExecutePropPanelAttr (SfxRequest& rReq)
10891ff378efSZheng Fan {
10901ff378efSZheng Fan 	if(SlideShow::IsRunning( GetViewShellBase() ))
10911ff378efSZheng Fan 		return;
10921ff378efSZheng Fan 
10931ff378efSZheng Fan 	SdDrawDocument* pDoc = GetDoc();
10941ff378efSZheng Fan 	if (!pDoc || !mpDrawView)
10951ff378efSZheng Fan 		return;
10961ff378efSZheng Fan 
10971ff378efSZheng Fan 	sal_uInt16 nSId = rReq.GetSlot();
10981ff378efSZheng Fan 	SfxItemSet aAttrs( pDoc->GetPool() );
10991ff378efSZheng Fan 
11001ff378efSZheng Fan 	switch ( nSId )
11011ff378efSZheng Fan 	{
11021ff378efSZheng Fan 	case SID_TABLE_VERT_NONE:
11031ff378efSZheng Fan 	case SID_TABLE_VERT_CENTER:
11041ff378efSZheng Fan 	case SID_TABLE_VERT_BOTTOM:
11051ff378efSZheng Fan 		SdrTextVertAdjust eTVA = SDRTEXTVERTADJUST_TOP;
11061ff378efSZheng Fan 		if (nSId == SID_TABLE_VERT_CENTER)
11071ff378efSZheng Fan 			eTVA = SDRTEXTVERTADJUST_CENTER;
11081ff378efSZheng Fan 		else if (nSId == SID_TABLE_VERT_BOTTOM)
11091ff378efSZheng Fan 			eTVA = SDRTEXTVERTADJUST_BOTTOM;
11101ff378efSZheng Fan 
11111ff378efSZheng Fan 		aAttrs.Put( SdrTextVertAdjustItem(eTVA) );
11121ff378efSZheng Fan 		mpDrawView->SetAttributes(aAttrs);
11131ff378efSZheng Fan 
11141ff378efSZheng Fan 		break;
11151ff378efSZheng Fan 	}
11161ff378efSZheng Fan }
11171ff378efSZheng Fan 
GetStatePropPanelAttr(SfxItemSet & rSet)11181ff378efSZheng Fan void DrawViewShell::GetStatePropPanelAttr(SfxItemSet& rSet)
11191ff378efSZheng Fan {
11201ff378efSZheng Fan 	SfxWhichIter	aIter( rSet );
11211ff378efSZheng Fan 	sal_uInt16			nWhich = aIter.FirstWhich();
11221ff378efSZheng Fan 
11231ff378efSZheng Fan 	SdDrawDocument* pDoc = GetDoc();
11241ff378efSZheng Fan 	if (!pDoc || !mpDrawView)
11251ff378efSZheng Fan 		return;
11261ff378efSZheng Fan 
11271ff378efSZheng Fan 	SfxItemSet aAttrs( pDoc->GetPool() );
11281ff378efSZheng Fan 	mpDrawView->GetAttributes( aAttrs );
11291ff378efSZheng Fan 
11301ff378efSZheng Fan 	while ( nWhich )
11311ff378efSZheng Fan 	{
11321ff378efSZheng Fan 		sal_uInt16 nSlotId = SfxItemPool::IsWhich(nWhich)
11331ff378efSZheng Fan 			? GetPool().GetSlotId(nWhich)
11341ff378efSZheng Fan 			: nWhich;
11351ff378efSZheng Fan 		switch ( nSlotId )
11361ff378efSZheng Fan 		{
11371ff378efSZheng Fan 			case SID_TABLE_VERT_NONE:
11381ff378efSZheng Fan 			case SID_TABLE_VERT_CENTER:
11391ff378efSZheng Fan 			case SID_TABLE_VERT_BOTTOM:
11401ff378efSZheng Fan 				sal_Bool bContour = sal_False;
11411ff378efSZheng Fan 				SfxItemState eConState = aAttrs.GetItemState( SDRATTR_TEXT_CONTOURFRAME );
11421ff378efSZheng Fan 				if( eConState != SFX_ITEM_DONTCARE )
11431ff378efSZheng Fan 				{
11441ff378efSZheng Fan 					bContour = ( ( const SdrTextContourFrameItem& )aAttrs.Get( SDRATTR_TEXT_CONTOURFRAME ) ).GetValue();
11451ff378efSZheng Fan 				}
11461ff378efSZheng Fan 				if (bContour) break;
11471ff378efSZheng Fan 
11481ff378efSZheng Fan 				SfxItemState eVState = aAttrs.GetItemState( SDRATTR_TEXT_VERTADJUST );
11491ff378efSZheng Fan 				//SfxItemState eHState = aAttrs.GetItemState( SDRATTR_TEXT_HORZADJUST );
11501ff378efSZheng Fan 
11511ff378efSZheng Fan 				//if(SFX_ITEM_DONTCARE != eVState && SFX_ITEM_DONTCARE != eHState)
11521ff378efSZheng Fan 				if(SFX_ITEM_DONTCARE != eVState)
11531ff378efSZheng Fan 				{
11541ff378efSZheng Fan 					SdrTextVertAdjust eTVA = (SdrTextVertAdjust)((const SdrTextVertAdjustItem&)aAttrs.Get(SDRATTR_TEXT_VERTADJUST)).GetValue();
11551ff378efSZheng Fan 					sal_Bool bSet = nSlotId == SID_TABLE_VERT_NONE && eTVA == SDRTEXTVERTADJUST_TOP||
11561ff378efSZheng Fan                             nSlotId == SID_TABLE_VERT_CENTER && eTVA == SDRTEXTVERTADJUST_CENTER ||
11571ff378efSZheng Fan                             nSlotId == SID_TABLE_VERT_BOTTOM && eTVA == SDRTEXTVERTADJUST_BOTTOM;
11581ff378efSZheng Fan 					rSet.Put(SfxBoolItem(nSlotId, bSet));
11591ff378efSZheng Fan 				}
11601ff378efSZheng Fan 				else
11611ff378efSZheng Fan 				{
11621ff378efSZheng Fan 					rSet.Put(SfxBoolItem(nSlotId, sal_False));
11631ff378efSZheng Fan 				}
11641ff378efSZheng Fan 				break;
11651ff378efSZheng Fan 		}
11661ff378efSZheng Fan 		nWhich = aIter.NextWhich();
11671ff378efSZheng Fan 	}
11681ff378efSZheng Fan }
11691ff378efSZheng Fan 
1170cdf0e10cSrcweir } // end of namespace sd
1171