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