xref: /AOO41X/main/sd/source/ui/view/drviewsf.cxx (revision 8809db7a87f97847b57a57f4cd2b0104b2b83182)
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_LINE_STYLE:
312             case SID_ATTR_LINE_DASH:
313             case SID_ATTR_LINE_WIDTH:
314             case SID_ATTR_LINE_COLOR:
315             case SID_ATTR_TEXT_FITTOSIZE:
316             {
317                 bAttr = sal_True;
318             }
319             break;
320 
321             case SID_HYPHENATION:
322             {
323                 SfxItemSet aAttrs( GetDoc()->GetPool() );
324                 mpDrawView->GetAttributes( aAttrs );
325                 if( aAttrs.GetItemState( EE_PARA_HYPHENATE ) >= SFX_ITEM_AVAILABLE )
326                 {
327                     sal_Bool bValue = ( (const SfxBoolItem&) aAttrs.Get( EE_PARA_HYPHENATE ) ).GetValue();
328                     rSet.Put( SfxBoolItem( SID_HYPHENATION, bValue ) );
329                 }
330             }
331             break;
332 
333             case SID_STYLE_FAMILY2:
334             case SID_STYLE_FAMILY3:
335             case SID_STYLE_FAMILY5:
336             case SID_STYLE_APPLY: // StyleControl
337             {
338                 SfxStyleSheet* pStyleSheet = mpDrawView->GetStyleSheet();
339                 if( pStyleSheet )
340                 {
341                     if( nSlotId != SID_STYLE_APPLY && !mpDrawView->AreObjectsMarked() )
342                     {
343                         SfxTemplateItem aTmpItem( nWhich, String() );
344                         aAllSet.Put( aTmpItem, aTmpItem.Which()  );
345                     }
346                     else
347                     {
348                         if (pStyleSheet->GetFamily() == SD_STYLE_FAMILY_MASTERPAGE)
349                             pStyleSheet = ((SdStyleSheet*)pStyleSheet)->GetPseudoStyleSheet();
350 
351                         if( pStyleSheet )
352                         {
353                             SfxStyleFamily eFamily = pStyleSheet->GetFamily();
354 
355                             if ((eFamily == SD_STYLE_FAMILY_GRAPHICS &&     nSlotId == SID_STYLE_FAMILY2)       ||
356                                 (eFamily == SD_STYLE_FAMILY_CELL     && nSlotId == SID_STYLE_FAMILY3)       ||
357                                 (eFamily == SD_STYLE_FAMILY_PSEUDO &&   nSlotId == SID_STYLE_FAMILY5))
358                             {
359                                 SfxTemplateItem aTmpItem ( nWhich, pStyleSheet->GetName() );
360                                 aAllSet.Put( aTmpItem, aTmpItem.Which()  );
361                             }
362                             else
363                             {
364                                 SfxTemplateItem aTmpItem(nWhich, String());
365                                 aAllSet.Put(aTmpItem,aTmpItem.Which()  );
366                             }
367                         }
368                     }
369                 }
370                 else
371                 {   SfxTemplateItem aItem( nWhich, String() );
372                     aAllSet.Put( aItem, aItem.Which() );
373                     // rSet.DisableItem( nWhich );
374                 }
375             }
376             break;
377 
378             case SID_SET_DEFAULT:
379             {
380                 if( !mpDrawView->GetMarkedObjectList().GetMarkCount() ||
381                     ( !mpDrawView->IsTextEdit() && !mpDrawView->GetStyleSheet() )
382                   )
383                     rSet.DisableItem( nWhich );
384             }
385             break;
386 
387             case SID_STYLE_WATERCAN:
388             {
389                 ISfxTemplateCommon* pTemplateCommon = SFX_APP()->GetCurrentTemplateCommon(GetViewFrame()->GetBindings());
390                 if (pTemplateCommon && pTemplateCommon->GetActualFamily() == SD_STYLE_FAMILY_PSEUDO)
391                     rSet.Put(SfxBoolItem(nWhich,sal_False));
392                 else
393                 {
394                     SfxBoolItem aItem(nWhich, SD_MOD()->GetWaterCan());
395                     aAllSet.Put( aItem, aItem.Which());
396                 }
397             }
398             break;
399 
400             case SID_STYLE_NEW:
401             {
402                 ISfxTemplateCommon* pTemplateCommon = SFX_APP()->GetCurrentTemplateCommon(GetViewFrame()->GetBindings());
403                 if (pTemplateCommon && pTemplateCommon->GetActualFamily() == SD_STYLE_FAMILY_PSEUDO)
404                     rSet.DisableItem(nWhich);
405             }
406             break;
407 
408             case SID_STYLE_DRAGHIERARCHIE:
409             {
410                 ISfxTemplateCommon* pTemplateCommon = SFX_APP()->GetCurrentTemplateCommon(GetViewFrame()->GetBindings());
411                 if (pTemplateCommon && pTemplateCommon->GetActualFamily() == SD_STYLE_FAMILY_PSEUDO)
412                     rSet.DisableItem(nWhich);
413             }
414             break;
415 
416             case SID_STYLE_NEW_BY_EXAMPLE:
417             {
418                 // PseudoStyleSheets koennen nicht 'by Example' erzeugt werden;
419                 // normale StyleSheets brauchen dafuer ein selektiertes Objekt
420                 ISfxTemplateCommon* pTemplCommon = SFX_APP()->GetCurrentTemplateCommon(GetViewFrame()->GetBindings());
421                 if (pTemplCommon)
422                 {
423                     if (pTemplCommon->GetActualFamily() == SD_STYLE_FAMILY_PSEUDO)
424                     {
425                         rSet.DisableItem(nWhich);
426                     }
427                     else if (pTemplCommon->GetActualFamily() == SD_STYLE_FAMILY_GRAPHICS)
428                     {
429                         if (!mpDrawView->AreObjectsMarked())
430                         {
431                             rSet.DisableItem(nWhich);
432                         }
433                     }
434                 }
435                 // falls (noch) kein Gestalter da ist, muessen wir uns auf den
436                 // View-Zustand zurueckziehen; eine aktuell eingestellte Familie
437                 // kann nicht beruecksichtigt werden
438                 else
439                 {
440                     if (!mpDrawView->AreObjectsMarked())
441                     {
442                         rSet.DisableItem(nWhich);
443                     }
444                 }
445 
446             }
447             break;
448 
449             case SID_STYLE_UPDATE_BY_EXAMPLE:
450             {
451                 if (!mpDrawView->AreObjectsMarked())
452                 {
453                     rSet.DisableItem(nWhich);
454                 }
455             }
456             break;
457         }
458         nWhich = aIter.NextWhich();
459     }
460 
461     SfxItemSet* pSet = NULL;
462 
463     if( bAttr )
464     {
465         pSet = new SfxItemSet( GetDoc()->GetPool() );
466         mpDrawView->GetAttributes( *pSet );
467         rSet.Put( *pSet, sal_False );
468     }
469 
470     rSet.Put( aAllSet, sal_False );
471 
472     // Flaechen und/oder Linienattribute wurden geaendert
473     if( bAttr && pSet )
474     {
475         // Wenn die View selektierte Objekte besitzt, muessen entspr. Items
476         // von SFX_ITEM_DEFAULT (_ON) auf SFX_ITEM_DISABLED geaendert werden
477         if( mpDrawView->AreObjectsMarked() )
478         {
479             SfxWhichIter aNewIter( *pSet, XATTR_LINE_FIRST, XATTR_FILL_LAST );
480             nWhich = aNewIter.FirstWhich();
481             while( nWhich )
482             {
483                 if( SFX_ITEM_DEFAULT == pSet->GetItemState( nWhich ) )
484                 {
485                     rSet.ClearItem( nWhich );
486                     rSet.DisableItem( nWhich );
487                 }
488                 nWhich = aNewIter.NextWhich();
489             }
490         }
491         delete pSet;
492     }
493 
494 //    const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
495 //    sal_uLong nMarkCount = rMarkList.GetMarkCount();
496 //    sal_Bool bDisabled = sal_False;
497 //
498 //    for (sal_uLong i = 0;
499 //         i < nMarkCount && !bDisabled && i < 50; i++)
500 //    {
501 //        SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
502 //
503 //        if (pObj->GetObjInventor() == E3dInventor)
504 //        {
505 //            bDisabled = sal_True;
506 //            rSet.ClearItem(SDRATTR_SHADOW);
507 //            rSet.DisableItem(SDRATTR_SHADOW);
508 //        }
509 //    }
510 }
511 
512 
513 /*************************************************************************
514 |*
515 |* Text der Selektion zurueckgeben
516 |*
517 \************************************************************************/
518 
519 String DrawViewShell::GetSelectionText(sal_Bool bCompleteWords)
520 {
521     String aStrSelection;
522     ::Outliner* pOl = mpDrawView->GetTextEditOutliner();
523     OutlinerView* pOlView = mpDrawView->GetTextEditOutlinerView();
524 
525     if (pOl && pOlView)
526     {
527         if (bCompleteWords)
528         {
529             ESelection aSel = pOlView->GetSelection();
530             String aStrCurrentDelimiters = pOl->GetWordDelimiters();
531 
532             pOl->SetWordDelimiters( String( RTL_CONSTASCII_USTRINGPARAM( " .,;\"'" )));
533             aStrSelection = pOl->GetWord( aSel.nEndPara, aSel.nEndPos );
534             pOl->SetWordDelimiters( aStrCurrentDelimiters );
535         }
536         else
537         {
538             aStrSelection = pOlView->GetSelected();
539         }
540     }
541 
542     return (aStrSelection);
543 }
544 
545 /*************************************************************************
546 |*
547 |* Ist etwas selektiert?
548 |*
549 \************************************************************************/
550 
551 sal_Bool DrawViewShell::HasSelection(sal_Bool bText) const
552 {
553     sal_Bool bReturn = sal_False;
554 
555     if (bText)
556     {
557         OutlinerView* pOlView = mpDrawView->GetTextEditOutlinerView();
558 
559         if (pOlView && pOlView->GetSelected().Len() != 0)
560         {
561             bReturn = sal_True;
562         }
563     }
564     else if (mpDrawView->GetMarkedObjectList().GetMarkCount() != 0)
565     {
566         bReturn = sal_True;
567     }
568 
569     return bReturn;
570 }
571 
572 } // end of namespace sd
573