xref: /aoo41x/main/sd/source/ui/view/drviewsf.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_sd.hxx"
30 
31 #include "DrawViewShell.hxx"
32 #include <com/sun/star/form/FormButtonType.hpp>
33 #include <com/sun/star/beans/XPropertySet.hpp>
34 
35 #ifndef _SVXIDS_HRC
36 #include <svx/svxids.hrc>
37 #endif
38 #ifndef _GLOBL3D_HXX
39 #include <svx/globl3d.hxx>
40 #endif
41 #include <svx/hlnkitem.hxx>
42 #include <editeng/eeitem.hxx>
43 #ifndef _FLDITEM_HXX
44 #include <editeng/flditem.hxx>
45 #endif
46 #include <sfx2/viewfrm.hxx>
47 #include <svl/whiter.hxx>
48 #include <svl/eitem.hxx>
49 #include <svl/itempool.hxx>
50 #include <sfx2/tplpitem.hxx>
51 #ifndef _BINDING_HXX //autogen
52 #include <sfx2/bindings.hxx>
53 #endif
54 #include <sfx2/app.hxx>
55 #include <sfx2/templdlg.hxx>
56 #include <svx/xdef.hxx>
57 #include <svx/svddef.hxx>
58 #include <svx/fmglob.hxx>
59 #include <svx/svdouno.hxx>
60 #include <tools/urlobj.hxx>
61 #include <svx/fmshell.hxx>
62 #include <svl/cjkoptions.hxx>
63 
64 #ifndef SD_FRAME_VIEW
65 #include "FrameView.hxx"
66 #endif
67 #include "Outliner.hxx"
68 #include "app.hrc"
69 
70 #include "app.hxx"
71 #include "stlsheet.hxx"
72 #include "drawview.hxx"
73 #include "drawdoc.hxx"
74 #include "Window.hxx"
75 #include "ViewShellBase.hxx"
76 #include "FormShellManager.hxx"
77 #include "cfgids.hxx"
78 #include "anminfo.hxx"
79 
80 using ::rtl::OUString;
81 using namespace ::com::sun::star;
82 
83 namespace sd {
84 
85 /*************************************************************************
86 |*
87 |* Status von Controller-SfxSlots setzen
88 |*
89 \************************************************************************/
90 
91 void DrawViewShell::GetCtrlState(SfxItemSet &rSet)
92 {
93 	if (rSet.GetItemState(SID_RELOAD) != SFX_ITEM_UNKNOWN)
94 	{
95 		// "Letzte Version" vom SFx en/disablen lassen
96         GetViewFrame()->GetSlotState (SID_RELOAD, NULL, &rSet);
97 	}
98 
99 	if (SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_HYPERLINK_GETLINK))
100 	{
101 		SvxHyperlinkItem aHLinkItem;
102 
103 		OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView();
104 
105 		if (pOLV)
106 		{
107 			bool bField = false;
108 			const SvxFieldItem* pFieldItem = pOLV->GetFieldAtSelection();
109 			if (pFieldItem)
110 			{
111                 ESelection aSel = pOLV->GetSelection();
112                 if ( abs( aSel.nEndPos - aSel.nStartPos ) == 1 )
113                 {
114 				    const SvxFieldData* pField = pFieldItem->GetField();
115 				    if (pField->ISA(SvxURLField))
116 				    {
117 					    aHLinkItem.SetName(((const SvxURLField*) pField)->GetRepresentation());
118 					    aHLinkItem.SetURL(((const SvxURLField*) pField)->GetURL());
119 					    aHLinkItem.SetTargetFrame(((const SvxURLField*) pField)->GetTargetFrame());
120 						bField = true;
121 				    }
122                 }
123 			}
124 			if (!bField)
125 			{
126 				// use selected text as name for urls
127 				String sReturn = pOLV->GetSelected();
128 				sReturn.Erase(255);
129 				sReturn.EraseTrailingChars();
130 				aHLinkItem.SetName(sReturn);
131 			}
132 		}
133 		else
134 		{
135 			if (mpDrawView->GetMarkedObjectList().GetMarkCount() > 0)
136 			{
137                 bool bFound = false;
138 
139                 SdrObject* pMarkedObj = mpDrawView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
140                 if( pMarkedObj && (FmFormInventor == pMarkedObj->GetObjInventor()) )
141                 {
142 				    SdrUnoObj* pUnoCtrl = dynamic_cast< SdrUnoObj* >( pMarkedObj );
143 
144 				    if(pUnoCtrl) try
145 				    {
146                         uno::Reference< awt::XControlModel > xControlModel( pUnoCtrl->GetUnoControlModel(), uno::UNO_QUERY_THROW );
147 					    uno::Reference< beans::XPropertySet > xPropSet( xControlModel, uno::UNO_QUERY_THROW );
148 					    uno::Reference< beans::XPropertySetInfo > xPropInfo( xPropSet->getPropertySetInfo(), uno::UNO_QUERY_THROW );
149 
150 					    form::FormButtonType eButtonType = form::FormButtonType_URL;
151                         const OUString sButtonType( RTL_CONSTASCII_USTRINGPARAM( "ButtonType" ) );
152 					    if(xPropInfo->hasPropertyByName( sButtonType ) && (xPropSet->getPropertyValue( sButtonType ) >>= eButtonType ) )
153 				        {
154 					        OUString aString;
155 
156 					        // Label
157                             const OUString sLabel( RTL_CONSTASCII_USTRINGPARAM( "Label" ) );
158 					        if(xPropInfo->hasPropertyByName(sLabel))
159                             {
160 						        if( xPropSet->getPropertyValue(sLabel) >>= aString )
161     						        aHLinkItem.SetName(String( aString ));
162                             }
163 
164 					        // URL
165                             const OUString sTargetURL(RTL_CONSTASCII_USTRINGPARAM( "TargetURL" ));
166 					        if(xPropInfo->hasPropertyByName(sTargetURL))
167                             {
168 						        if( xPropSet->getPropertyValue(sTargetURL) >>= aString )
169     						        aHLinkItem.SetURL(String( aString ));
170                             }
171 
172 					        // Target
173                             const OUString sTargetFrame( RTL_CONSTASCII_USTRINGPARAM( "TargetFrame" ) );
174 					        if(xPropInfo->hasPropertyByName(sTargetFrame) )
175                             {
176 					            if( xPropSet->getPropertyValue(sTargetFrame) >>= aString )
177 						            aHLinkItem.SetTargetFrame(String( aString ));
178                             }
179 
180 					        aHLinkItem.SetInsertMode(HLINK_BUTTON);
181                             bFound = true;
182 				        }
183                     }
184                     catch( uno::Exception& )
185                     {
186                     }
187 				}
188 
189                 // try interaction link
190                 if( !bFound && pMarkedObj )
191                 {
192                     SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pMarkedObj);
193                     if( pInfo && (pInfo->meClickAction == presentation::ClickAction_DOCUMENT) )
194                         aHLinkItem.SetURL( pInfo->GetBookmark());
195                     aHLinkItem.SetInsertMode(HLINK_BUTTON);
196                 }
197 			}
198 		}
199 
200 		rSet.Put(aHLinkItem);
201 	}
202 	rSet.Put( SfxBoolItem( SID_READONLY_MODE, mbReadOnly ) );
203 
204 	// Ausgabequalitaet
205 	if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OUTPUT_QUALITY_COLOR ) ||
206 		SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OUTPUT_QUALITY_GRAYSCALE ) ||
207 		SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OUTPUT_QUALITY_BLACKWHITE ) ||
208         SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OUTPUT_QUALITY_CONTRAST ) )
209 	{
210 		const sal_uLong nMode = (sal_Int32)GetActiveWindow()->GetDrawMode();
211 		rSet.Put( SfxBoolItem( SID_OUTPUT_QUALITY_COLOR, (sal_Bool)((sal_uLong)OUTPUT_DRAWMODE_COLOR == nMode) ) );
212 		rSet.Put( SfxBoolItem( SID_OUTPUT_QUALITY_GRAYSCALE, (sal_Bool)((sal_uLong)OUTPUT_DRAWMODE_GRAYSCALE == nMode) ) );
213 		rSet.Put( SfxBoolItem( SID_OUTPUT_QUALITY_BLACKWHITE, (sal_Bool)((sal_uLong)OUTPUT_DRAWMODE_BLACKWHITE == nMode) ) );
214 		rSet.Put( SfxBoolItem( SID_OUTPUT_QUALITY_CONTRAST, (sal_Bool)((sal_uLong)OUTPUT_DRAWMODE_CONTRAST == nMode) ) );
215 	}
216 
217 	if ( SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_MAIL_SCROLLBODY_PAGEDOWN) )
218 	{
219 		rSet.Put( SfxBoolItem( SID_MAIL_SCROLLBODY_PAGEDOWN, sal_True ) );
220 	}
221 
222 	if ( SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_ATTR_YEAR2000) )
223 	{
224         FmFormShell* pFormShell = GetViewShellBase().GetFormShellManager()->GetFormShell();
225         if (pFormShell != NULL)
226         {
227             sal_uInt16 nState = 0;
228             if (pFormShell->GetY2KState(nState))
229                 rSet.Put( SfxUInt16Item( SID_ATTR_YEAR2000, nState ) );
230             else
231                 rSet.DisableItem( SID_ATTR_YEAR2000 );
232         }
233 	}
234 
235 	if ( !GetView()->GetTextEditOutliner() )
236 	{
237         SvtCJKOptions aCJKOptions;
238 		if( !aCJKOptions.IsChangeCaseMapEnabled() )
239         {
240             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_HALFWIDTH, sal_False );
241             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_FULLWIDTH, sal_False );
242             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_HIRAGANA, sal_False );
243             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_KATAGANA, sal_False );
244         }
245         else
246         {
247             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_HALFWIDTH, sal_True );
248             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_FULLWIDTH, sal_True );
249             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_HIRAGANA, sal_True );
250             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_KATAGANA, sal_True );
251         }
252 
253         rSet.DisableItem( SID_TRANSLITERATE_SENTENCE_CASE );
254         rSet.DisableItem( SID_TRANSLITERATE_TITLE_CASE );
255         rSet.DisableItem( SID_TRANSLITERATE_TOGGLE_CASE );
256         rSet.DisableItem( SID_TRANSLITERATE_UPPER );
257 		rSet.DisableItem( SID_TRANSLITERATE_LOWER );
258 		rSet.DisableItem( SID_TRANSLITERATE_HALFWIDTH );
259 		rSet.DisableItem( SID_TRANSLITERATE_FULLWIDTH );
260 		rSet.DisableItem( SID_TRANSLITERATE_HIRAGANA );
261 		rSet.DisableItem( SID_TRANSLITERATE_KATAGANA );
262 	}
263 	else
264 	{
265         SvtCJKOptions aCJKOptions;
266 		if( !aCJKOptions.IsChangeCaseMapEnabled() )
267 		{
268             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_HALFWIDTH, sal_False );
269             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_FULLWIDTH, sal_False );
270             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_HIRAGANA, sal_False );
271             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_KATAGANA, sal_False );
272             rSet.DisableItem( SID_TRANSLITERATE_HALFWIDTH );
273 			rSet.DisableItem( SID_TRANSLITERATE_FULLWIDTH );
274 			rSet.DisableItem( SID_TRANSLITERATE_HIRAGANA );
275 			rSet.DisableItem( SID_TRANSLITERATE_KATAGANA );
276 		}
277         else
278         {
279             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_HALFWIDTH, sal_True );
280             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_FULLWIDTH, sal_True );
281             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_HIRAGANA, sal_True );
282             GetViewFrame()->GetBindings().SetVisibleState( SID_TRANSLITERATE_KATAGANA, sal_True );
283         }
284 	}
285 }
286 
287 
288 /*************************************************************************
289 |*
290 |* Status der Attribut-Items
291 |*
292 \************************************************************************/
293 
294 void DrawViewShell::GetAttrState( SfxItemSet& rSet )
295 {
296 	SfxWhichIter	aIter( rSet );
297 	sal_uInt16			nWhich = aIter.FirstWhich();
298 
299 	sal_Bool	bAttr = sal_False;
300 	SfxAllItemSet aAllSet( *rSet.GetPool() );
301 
302 	while ( nWhich )
303 	{
304 		sal_uInt16 nSlotId = SfxItemPool::IsWhich(nWhich)
305 			? GetPool().GetSlotId(nWhich)
306 			: nWhich;
307 		switch ( nSlotId )
308 		{
309 			case SID_ATTR_FILL_STYLE:
310 			case SID_ATTR_FILL_COLOR:
311 			case SID_ATTR_FILL_GRADIENT:
312 			case SID_ATTR_FILL_HATCH:
313 			case SID_ATTR_FILL_BITMAP:
314 			case SID_ATTR_FILL_SHADOW:
315 			case SID_ATTR_LINE_STYLE:
316 			case SID_ATTR_LINE_DASH:
317 			case SID_ATTR_LINE_WIDTH:
318 			case SID_ATTR_LINE_COLOR:
319 			case SID_ATTR_TEXT_FITTOSIZE:
320 			{
321 				bAttr = sal_True;
322 			}
323 			break;
324 
325 			case SID_HYPHENATION:
326 			{
327 				SfxItemSet aAttrs( GetDoc()->GetPool() );
328 				mpDrawView->GetAttributes( aAttrs );
329 				if( aAttrs.GetItemState( EE_PARA_HYPHENATE ) >= SFX_ITEM_AVAILABLE )
330 				{
331 					sal_Bool bValue = ( (const SfxBoolItem&) aAttrs.Get( EE_PARA_HYPHENATE ) ).GetValue();
332 					rSet.Put( SfxBoolItem( SID_HYPHENATION, bValue ) );
333 				}
334 			}
335 			break;
336 
337 			case SID_STYLE_FAMILY2:
338 			case SID_STYLE_FAMILY3:
339 			case SID_STYLE_FAMILY5:
340 			case SID_STYLE_APPLY: // StyleControl
341 			{
342 				SfxStyleSheet* pStyleSheet = mpDrawView->GetStyleSheet();
343 				if( pStyleSheet )
344 				{
345 					if( nSlotId != SID_STYLE_APPLY && !mpDrawView->AreObjectsMarked() )
346 					{
347 						SfxTemplateItem aTmpItem( nWhich, String() );
348 						aAllSet.Put( aTmpItem, aTmpItem.Which()  );
349 					}
350 					else
351 					{
352 						if (pStyleSheet->GetFamily() == SD_STYLE_FAMILY_MASTERPAGE)
353 							pStyleSheet = ((SdStyleSheet*)pStyleSheet)->GetPseudoStyleSheet();
354 
355 						if( pStyleSheet )
356 						{
357 							SfxStyleFamily eFamily = pStyleSheet->GetFamily();
358 
359 							if ((eFamily == SD_STYLE_FAMILY_GRAPHICS &&		nSlotId == SID_STYLE_FAMILY2)       ||
360 								(eFamily == SD_STYLE_FAMILY_CELL	 &&	nSlotId == SID_STYLE_FAMILY3)		||
361 								(eFamily == SD_STYLE_FAMILY_PSEUDO &&	nSlotId == SID_STYLE_FAMILY5))
362 							{
363 								SfxTemplateItem aTmpItem ( nWhich, pStyleSheet->GetName() );
364 								aAllSet.Put( aTmpItem, aTmpItem.Which()  );
365 							}
366 							else
367 							{
368 								SfxTemplateItem aTmpItem(nWhich, String());
369 								aAllSet.Put(aTmpItem,aTmpItem.Which()  );
370 							}
371 						}
372 					}
373 				}
374 				else
375 				{	SfxTemplateItem aItem( nWhich, String() );
376 					aAllSet.Put( aItem, aItem.Which() );
377 					// rSet.DisableItem( nWhich );
378 				}
379 			}
380 			break;
381 
382 			case SID_SET_DEFAULT:
383 			{
384                 if( !mpDrawView->GetMarkedObjectList().GetMarkCount() ||
385                     ( !mpDrawView->IsTextEdit() && !mpDrawView->GetStyleSheet() )
386                   )
387 					rSet.DisableItem( nWhich );
388 			}
389 			break;
390 
391 			case SID_STYLE_WATERCAN:
392 			{
393 				ISfxTemplateCommon* pTemplateCommon = SFX_APP()->GetCurrentTemplateCommon(GetViewFrame()->GetBindings());
394 				if (pTemplateCommon && pTemplateCommon->GetActualFamily() == SD_STYLE_FAMILY_PSEUDO)
395 					rSet.Put(SfxBoolItem(nWhich,sal_False));
396 				else
397 				{
398 					SfxBoolItem aItem(nWhich, SD_MOD()->GetWaterCan());
399 					aAllSet.Put( aItem, aItem.Which());
400 				}
401 			}
402 			break;
403 
404 			case SID_STYLE_NEW:
405 			{
406 				ISfxTemplateCommon* pTemplateCommon = SFX_APP()->GetCurrentTemplateCommon(GetViewFrame()->GetBindings());
407 				if (pTemplateCommon && pTemplateCommon->GetActualFamily() == SD_STYLE_FAMILY_PSEUDO)
408 					rSet.DisableItem(nWhich);
409 			}
410 			break;
411 
412 			case SID_STYLE_DRAGHIERARCHIE:
413 			{
414 				ISfxTemplateCommon* pTemplateCommon = SFX_APP()->GetCurrentTemplateCommon(GetViewFrame()->GetBindings());
415 				if (pTemplateCommon && pTemplateCommon->GetActualFamily() == SD_STYLE_FAMILY_PSEUDO)
416 					rSet.DisableItem(nWhich);
417 			}
418 			break;
419 
420 			case SID_STYLE_NEW_BY_EXAMPLE:
421 			{
422 				// PseudoStyleSheets koennen nicht 'by Example' erzeugt werden;
423 				// normale StyleSheets brauchen dafuer ein selektiertes Objekt
424 				ISfxTemplateCommon* pTemplCommon = SFX_APP()->GetCurrentTemplateCommon(GetViewFrame()->GetBindings());
425 				if (pTemplCommon)
426 				{
427 					if (pTemplCommon->GetActualFamily() == SD_STYLE_FAMILY_PSEUDO)
428 					{
429 						rSet.DisableItem(nWhich);
430 					}
431 					else if (pTemplCommon->GetActualFamily() == SD_STYLE_FAMILY_GRAPHICS)
432 					{
433 						if (!mpDrawView->AreObjectsMarked())
434 						{
435 							rSet.DisableItem(nWhich);
436 						}
437 					}
438 				}
439 				// falls (noch) kein Gestalter da ist, muessen wir uns auf den
440 				// View-Zustand zurueckziehen; eine aktuell eingestellte Familie
441 				// kann nicht beruecksichtigt werden
442 				else
443 				{
444 					if (!mpDrawView->AreObjectsMarked())
445 					{
446 						rSet.DisableItem(nWhich);
447 					}
448 				}
449 
450 			}
451 			break;
452 
453 			case SID_STYLE_UPDATE_BY_EXAMPLE:
454 			{
455 				if (!mpDrawView->AreObjectsMarked())
456 				{
457 					rSet.DisableItem(nWhich);
458 				}
459 			}
460 			break;
461 		}
462 		nWhich = aIter.NextWhich();
463 	}
464 
465 	SfxItemSet* pSet = NULL;
466 
467 	if( bAttr )
468 	{
469 		pSet = new SfxItemSet( GetDoc()->GetPool() );
470 		mpDrawView->GetAttributes( *pSet );
471 		rSet.Put( *pSet, sal_False );
472 	}
473 
474 	rSet.Put( aAllSet, sal_False );
475 
476 	// Flaechen und/oder Linienattribute wurden geaendert
477 	if( bAttr && pSet )
478 	{
479 		// Wenn die View selektierte Objekte besitzt, muessen entspr. Items
480 		// von SFX_ITEM_DEFAULT (_ON) auf SFX_ITEM_DISABLED geaendert werden
481 		if( mpDrawView->AreObjectsMarked() )
482 		{
483 			SfxWhichIter aNewIter( *pSet, XATTR_LINE_FIRST, XATTR_FILL_LAST );
484 			nWhich = aNewIter.FirstWhich();
485 			while( nWhich )
486 			{
487 				if( SFX_ITEM_DEFAULT == pSet->GetItemState( nWhich ) )
488 				{
489 					rSet.ClearItem( nWhich );
490 					rSet.DisableItem( nWhich );
491 				}
492 				nWhich = aNewIter.NextWhich();
493 			}
494 		}
495 		delete pSet;
496 	}
497 
498 //    const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
499 //    sal_uLong nMarkCount = rMarkList.GetMarkCount();
500 //    sal_Bool bDisabled = sal_False;
501 //
502 //    for (sal_uLong i = 0;
503 //         i < nMarkCount && !bDisabled && i < 50; i++)
504 //    {
505 //        SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
506 //
507 //        if (pObj->GetObjInventor() == E3dInventor)
508 //        {
509 //            bDisabled = sal_True;
510 //            rSet.ClearItem(SDRATTR_SHADOW);
511 //            rSet.DisableItem(SDRATTR_SHADOW);
512 //        }
513 //    }
514 }
515 
516 
517 /*************************************************************************
518 |*
519 |* Text der Selektion zurueckgeben
520 |*
521 \************************************************************************/
522 
523 String DrawViewShell::GetSelectionText(sal_Bool bCompleteWords)
524 {
525 	String aStrSelection;
526 	::Outliner* pOl = mpDrawView->GetTextEditOutliner();
527 	OutlinerView* pOlView = mpDrawView->GetTextEditOutlinerView();
528 
529 	if (pOl && pOlView)
530 	{
531 		if (bCompleteWords)
532 		{
533 			ESelection aSel = pOlView->GetSelection();
534 			String aStrCurrentDelimiters = pOl->GetWordDelimiters();
535 
536 			pOl->SetWordDelimiters( String( RTL_CONSTASCII_USTRINGPARAM( " .,;\"'" )));
537 			aStrSelection = pOl->GetWord( aSel.nEndPara, aSel.nEndPos );
538 			pOl->SetWordDelimiters( aStrCurrentDelimiters );
539 		}
540 		else
541 		{
542 			aStrSelection = pOlView->GetSelected();
543 		}
544 	}
545 
546 	return (aStrSelection);
547 }
548 
549 /*************************************************************************
550 |*
551 |* Ist etwas selektiert?
552 |*
553 \************************************************************************/
554 
555 sal_Bool DrawViewShell::HasSelection(sal_Bool bText) const
556 {
557 	sal_Bool bReturn = sal_False;
558 
559 	if (bText)
560 	{
561 		OutlinerView* pOlView = mpDrawView->GetTextEditOutlinerView();
562 
563 		if (pOlView && pOlView->GetSelected().Len() != 0)
564 		{
565 			bReturn = sal_True;
566 		}
567 	}
568 	else if (mpDrawView->GetMarkedObjectList().GetMarkCount() != 0)
569 	{
570 		bReturn = sal_True;
571 	}
572 
573 	return bReturn;
574 }
575 
576 } // end of namespace sd
577